%PDF- %PDF-
Direktori : /var/www/projetos/beta1.gracafilmes.com.br/wp-content/plugins/elementor/assets/js/ |
Current File : /var/www/projetos/beta1.gracafilmes.com.br/wp-content/plugins/elementor/assets/js/ai-admin.js |
/*! elementor - v3.14.0 - 26-06-2023 */ /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ "../modules/ai/assets/js/editor/actions-data.js": /*!******************************************************!*\ !*** ../modules/ai/assets/js/editor/actions-data.js ***! \******************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.vocalTones = exports.translateLanguages = exports.textareaAutocomplete = exports.textAutocomplete = exports.codeHtmlAutocomplete = exports.codeCssAutocomplete = void 0; var textAutocomplete = [__('Craft a catchy slogan for', 'elementor'), __('Write a strong section header for', 'elementor'), __('Create a blog title for', 'elementor'), __('Suggest a 4 word headline for', 'elementor'), __('Write an attention grabbing title for', 'elementor')]; exports.textAutocomplete = textAutocomplete; var textareaAutocomplete = [__('Write a product description for', 'elementor'), __('Create a blog post for', 'elementor'), __('Craft an about us section for', 'elementor'), __('Offer a few sentences to invite visitors to', 'elementor'), __('Write microcopy for a submission form that includes', 'elementor')]; exports.textareaAutocomplete = textareaAutocomplete; var codeHtmlAutocomplete = [__('GA event fired on every button element click (assume GA was loaded)', 'elementor'), __('Iframe code to embed a Spotify widget on my web page. My ID is 1234567890', 'elementor'), __('Write an embed code of Google Analytics', 'elementor'), __('Write an embed code of Facebook Pixel', 'elementor'), __('HTML code that embeds the following PDF into a webpage: link to PDF', 'elementor')]; exports.codeHtmlAutocomplete = codeHtmlAutocomplete; var codeCssAutocomplete = [__('On hover, animate 20% bigger, rotate 10 deg CCW', 'elementor'), __('Add a circle-shaped clip mask, semi transparent on hover', 'elementor'), __('Rainbow colored animated text gradient', 'elementor'), __('Add a 3D shadow to the text', 'elementor')]; exports.codeCssAutocomplete = codeCssAutocomplete; var vocalTones = [{ label: __('Casual', 'elementor') }, { label: __('Confidence', 'elementor') }, { label: __('Formal', 'elementor') }, { label: __('Friendly', 'elementor') }, { label: __('Inspirational', 'elementor') }, { label: __('Motivational', 'elementor') }, { label: __('Nostalgic', 'elementor') }, { label: __('Playful', 'elementor') }, { label: __('Professional', 'elementor') }, { label: __('Scientific', 'elementor') }, { label: __('Straightforward', 'elementor') }, { label: __('Witty', 'elementor') }]; exports.vocalTones = vocalTones; var translateLanguages = [{ label: __('Arabic', 'elementor'), value: 'ar-SA' }, { label: __('Chinese', 'elementor'), value: 'zh-CN' }, { label: __('Czech', 'elementor'), value: 'cs-CZ' }, { label: __('Danish', 'elementor'), value: 'da-DK' }, { label: __('Dutch', 'elementor'), value: 'nl-NL' }, { label: __('English', 'elementor'), value: 'en-US' }, { label: __('Finnish', 'elementor'), value: 'fi-FI' }, { label: __('French', 'elementor'), value: 'fr-FR' }, { label: __('German', 'elementor'), value: 'de-DE' }, { label: __('Greek', 'elementor'), value: 'el-GR' }, { label: __('Hebrew', 'elementor'), value: 'he-IL' }, { label: __('Hungarian', 'elementor'), value: 'hu-HU' }, { label: __('Indonesian', 'elementor'), value: 'id-ID' }, { label: __('Italian', 'elementor'), value: 'it-IT' }, { label: __('Japanese', 'elementor'), value: 'ja-JP' }, { label: __('Korean', 'elementor'), value: 'ko-KR' }, { label: __('Persian', 'elementor'), value: 'fa-IR' }, { label: __('Polish', 'elementor'), value: 'pl-PL' }, { label: __('Portuguese', 'elementor'), value: 'pt-PT' }, { label: __('Russian', 'elementor'), value: 'ru-RU' }, { label: __('Spanish', 'elementor'), value: 'es-ES' }, { label: __('Swedish', 'elementor'), value: 'sv-SE' }, { label: __('Thai', 'elementor'), value: 'th-TH' }, { label: __('Turkish', 'elementor'), value: 'tr-TR' }, { label: __('Vietnamese', 'elementor'), value: 'vi-VN' }]; exports.translateLanguages = translateLanguages; /***/ }), /***/ "../modules/ai/assets/js/editor/api/index.js": /*!***************************************************!*\ !*** ../modules/ai/assets/js/editor/api/index.js ***! \***************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.uploadImage = exports.setStatusFeedback = exports.setGetStarted = exports.getUserInformation = exports.getTextToImageGeneration = exports.getImageToImageUpscale = exports.getImageToImageOutPainting = exports.getImageToImageMaskGeneration = exports.getImageToImageGeneration = exports.getImagePromptEnhanced = exports.getEditText = exports.getCustomCode = exports.getCustomCSS = exports.getCompletionText = void 0; var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } var request = function request(endpoint) { var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; return new Promise(function (resolve, reject) { return elementorCommon.ajax.addRequest(endpoint, { success: resolve, error: reject, data: data }); }); }; var getUserInformation = function getUserInformation() { return request('ai_get_user_information'); }; exports.getUserInformation = getUserInformation; var getCompletionText = function getCompletionText(prompt) { return request('ai_get_completion_text', { prompt: prompt }); }; exports.getCompletionText = getCompletionText; var getEditText = function getEditText(input, instruction) { return request('ai_get_edit_text', { input: input, instruction: instruction }); }; exports.getEditText = getEditText; var getCustomCode = function getCustomCode(prompt, language) { return request('ai_get_custom_code', { prompt: prompt, language: language }); }; exports.getCustomCode = getCustomCode; var getCustomCSS = function getCustomCSS(prompt, htmlMarkup, elementId) { return request('ai_get_custom_css', { prompt: prompt, html_markup: htmlMarkup, element_id: elementId }); }; exports.getCustomCSS = getCustomCSS; var setGetStarted = function setGetStarted() { return request('ai_set_get_started'); }; exports.setGetStarted = setGetStarted; var setStatusFeedback = function setStatusFeedback(responseId) { return request('ai_set_status_feedback', { response_id: responseId }); }; exports.setStatusFeedback = setStatusFeedback; var getTextToImageGeneration = function getTextToImageGeneration(prompt, promptSettings) { return request('ai_get_text_to_image', { prompt: prompt, promptSettings: promptSettings }); }; exports.getTextToImageGeneration = getTextToImageGeneration; var getImageToImageGeneration = function getImageToImageGeneration(prompt, promptSettings, image) { return request('ai_get_image_to_image', { prompt: prompt, promptSettings: promptSettings, image: image }); }; exports.getImageToImageGeneration = getImageToImageGeneration; var getImageToImageMaskGeneration = function getImageToImageMaskGeneration(prompt, promptSettings, image, mask) { return request('ai_get_image_to_image_mask', { prompt: prompt, promptSettings: promptSettings, image: image, mask: mask }); }; exports.getImageToImageMaskGeneration = getImageToImageMaskGeneration; var getImageToImageOutPainting = function getImageToImageOutPainting(prompt, promptSettings, image, mask) { return request('ai_get_image_to_image_outpainting', { prompt: prompt, promptSettings: promptSettings, mask: mask }); }; exports.getImageToImageOutPainting = getImageToImageOutPainting; var getImageToImageUpscale = function getImageToImageUpscale(prompt, promptSettings, image) { return request('ai_get_image_to_image_upscale', { prompt: prompt, promptSettings: promptSettings, image: image }); }; exports.getImageToImageUpscale = getImageToImageUpscale; var getImagePromptEnhanced = function getImagePromptEnhanced(prompt) { return request('ai_get_image_prompt_enhancer', { prompt: prompt }); }; exports.getImagePromptEnhanced = getImagePromptEnhanced; var uploadImage = function uploadImage(image) { return request('ai_upload_image', _objectSpread({}, image)); }; exports.uploadImage = uploadImage; /***/ }), /***/ "../modules/ai/assets/js/editor/app.js": /*!*********************************************!*\ !*** ../modules/ai/assets/js/editor/app.js ***! \*********************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _pageContent = _interopRequireDefault(__webpack_require__(/*! ./page-content */ "../modules/ai/assets/js/editor/page-content.js")); var _helpers = __webpack_require__(/*! ./helpers */ "../modules/ai/assets/js/editor/helpers.js"); var App = function App(props) { return /*#__PURE__*/_react.default.createElement(_ui.DirectionProvider, { rtl: props.isRTL }, /*#__PURE__*/_react.default.createElement(_ui.ThemeProvider, { colorScheme: props.colorScheme }, /*#__PURE__*/_react.default.createElement(_pageContent.default, { type: props.type, controlType: props.controlType, onClose: props.onClose, onConnect: _helpers.onConnect, getControlValue: props.getControlValue, setControlValue: props.setControlValue, controlView: props.controlView, additionalOptions: props.additionalOptions }))); }; App.propTypes = { colorScheme: PropTypes.oneOf(['auto', 'light', 'dark']), type: PropTypes.string, controlType: PropTypes.string, onClose: PropTypes.func, getControlValue: PropTypes.func, setControlValue: PropTypes.func, additionalOptions: PropTypes.object, controlView: PropTypes.object, isRTL: PropTypes.bool }; var _default = App; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/components/dialog-header.js": /*!******************************************************************!*\ !*** ../modules/ai/assets/js/editor/components/dialog-header.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); var _styledChip = _interopRequireDefault(__webpack_require__(/*! ./ui/styled-chip */ "../modules/ai/assets/js/editor/components/ui/styled-chip.js")); var ElementorLogo = function ElementorLogo(props) { return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({ viewBox: "0 0 32 32" }, props), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M2.69648 24.8891C0.938383 22.2579 0 19.1645 0 16C0 11.7566 1.68571 7.68687 4.68629 4.68629C7.68687 1.68571 11.7566 0 16 0C19.1645 0 22.2579 0.938383 24.8891 2.69648C27.5203 4.45459 29.5711 6.95344 30.7821 9.87706C31.9931 12.8007 32.3099 16.0177 31.6926 19.1214C31.0752 22.2251 29.5514 25.0761 27.3137 27.3137C25.0761 29.5514 22.2251 31.0752 19.1214 31.6926C16.0177 32.3099 12.8007 31.9931 9.87706 30.7821C6.95344 29.5711 4.45459 27.5203 2.69648 24.8891ZM12.0006 9.33281H9.33437V22.6665H12.0006V9.33281ZM22.6657 9.33281H14.6669V11.9991H22.6657V9.33281ZM22.6657 14.6654H14.6669V17.3316H22.6657V14.6654ZM22.6657 20.0003H14.6669V22.6665H22.6657V20.0003Z" })); }; var StyledElementorLogo = (0, _ui.styled)(ElementorLogo)(function (_ref) { var theme = _ref.theme; return { width: theme.sizing['400'], height: theme.sizing['400'], '& path': { fill: theme.palette.text.primary } }; }); var DialogHeader = function DialogHeader(props) { return /*#__PURE__*/_react.default.createElement(_ui.DialogTitle, { sx: { fontWeight: 'normal' } }, /*#__PURE__*/_react.default.createElement(StyledElementorLogo, { sx: { mr: 3 } }), __('AI', 'elementor'), /*#__PURE__*/_react.default.createElement(_styledChip.default, { label: __('Beta', 'elementor'), color: "default", sx: { ml: 3 } }), /*#__PURE__*/_react.default.createElement(_ui.Stack, { direction: "row", spacing: 3, alignItems: "center", sx: { ml: 'auto' } }, props.children, /*#__PURE__*/_react.default.createElement(_ui.IconButton, { size: "small", "aria-label": "close", onClick: props.onClose, sx: { '&.MuiButtonBase-root': { mr: -4 } } }, /*#__PURE__*/_react.default.createElement(_icons.XIcon, null)))); }; DialogHeader.propTypes = { onClose: PropTypes.func.isRequired, children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]) }; var _default = DialogHeader; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/components/generate-button.js": /*!********************************************************************!*\ !*** ../modules/ai/assets/js/editor/components/generate-button.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); var GenerateButton = function GenerateButton(props) { return /*#__PURE__*/_react.default.createElement(_ui.Button, (0, _extends2.default)({ variant: "contained", endIcon: /*#__PURE__*/_react.default.createElement(_icons.AIIcon, null), disabled: !prompt, "aria-label": __('search', 'elementor'), type: "submit", size: "small", sx: { '& .MuiButton-endIcon': { width: 18 } } }, props)); }; var _default = GenerateButton; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/components/loader.js": /*!***********************************************************!*\ !*** ../modules/ai/assets/js/editor/components/loader.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var Loader = function Loader(props) { return /*#__PURE__*/_react.default.createElement(_ui.Box, { sx: { px: 4, py: 6 } }, /*#__PURE__*/_react.default.createElement(_ui.LinearProgress, (0, _extends2.default)({ color: "secondary" }, props))); }; var _default = Loader; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/components/prompt-action-selection.js": /*!****************************************************************************!*\ !*** ../modules/ai/assets/js/editor/components/prompt-action-selection.js ***! \****************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var labelToDashCash = function labelToDashCash(str) { return str.toLowerCase().replace(/ /g, '-'); }; var PromptActionSelection = function PromptActionSelection(props) { var actionId = labelToDashCash(props.label); var _props$wrapperStyle = props.wrapperStyle, wrapperStyle = _props$wrapperStyle === void 0 ? { width: 138 } : _props$wrapperStyle; return /*#__PURE__*/_react.default.createElement(_ui.FormControl, { sx: wrapperStyle }, /*#__PURE__*/_react.default.createElement(_ui.InputLabel, { id: actionId }, props.label), /*#__PURE__*/_react.default.createElement(_ui.Select, { labelId: actionId, id: actionId, value: props.value || '', color: "secondary", onChange: props.onChange, size: "small", label: props.label, disabled: props.disabled, MenuProps: { PaperProps: { sx: { width: 138 } } }, sx: { // Fixing global CSS of the editor that targets input[disabled] globally. '&.Mui-disabled .MuiSelect-nativeInput': { backgroundColor: 'initial', opacity: 0 } } }, props.options.map(function (option) { var _option$value; return /*#__PURE__*/_react.default.createElement(_ui.MenuItem, { dense: true, key: option.label, value: (_option$value = option.value) !== null && _option$value !== void 0 ? _option$value : option.label }, option.label); }))); }; PromptActionSelection.propTypes = { label: PropTypes.string.isRequired, options: PropTypes.arrayOf(PropTypes.shape({ label: PropTypes.string.isRequired, value: PropTypes.string })).isRequired, onChange: PropTypes.func.isRequired, value: PropTypes.string, wrapperStyle: PropTypes.object, disabled: PropTypes.bool }; var _default = PromptActionSelection; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/components/prompt-action.js": /*!******************************************************************!*\ !*** ../modules/ai/assets/js/editor/components/prompt-action.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _styledChip = _interopRequireDefault(__webpack_require__(/*! ./ui/styled-chip */ "../modules/ai/assets/js/editor/components/ui/styled-chip.js")); var PromptAction = function PromptAction(props) { return /*#__PURE__*/_react.default.createElement(_styledChip.default, (0, _extends2.default)({ size: "large", color: "secondary", variant: "outlined" }, props)); }; var _default = PromptAction; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/components/prompt-credits.js": /*!*******************************************************************!*\ !*** ../modules/ai/assets/js/editor/components/prompt-credits.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var sprintf = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["sprintf"]; /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var PromptCredits = function PromptCredits(props) { if (props.usagePercentage < 80) { return null; } var upgradeLink = props.usagePercentage < 100 ? 'https://go.elementor.com/ai-popup-purchase-limit-reached-80-percent/' : 'https://go.elementor.com/ai-popup-purchase-limit-reached/'; return /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "caption", color: "text.tertiary" }, /* Translators: %s: AI prompt remained credits. */ sprintf(__('You\'ve used %s of the free trial.', 'elementor'), props.usagePercentage + '%'), ' ', /*#__PURE__*/_react.default.createElement("a", { href: upgradeLink, target: "_blank", rel: "noreferrer" }, __('Upgrade for unlimited access', 'elementor')), "."); }; PromptCredits.propTypes = { usagePercentage: PropTypes.number.isRequired }; var _default = PromptCredits; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/components/prompt-dialog.js": /*!******************************************************************!*\ !*** ../modules/ai/assets/js/editor/components/prompt-dialog.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _reactDraggable = _interopRequireDefault(__webpack_require__(/*! react-draggable */ "../node_modules/react-draggable/build/cjs/cjs.js")); var _dialogHeader = _interopRequireDefault(__webpack_require__(/*! ./dialog-header */ "../modules/ai/assets/js/editor/components/dialog-header.js")); var PromptDialog = function PromptDialog(props) { return /*#__PURE__*/_react.default.createElement(_reactDraggable.default, { handle: ".MuiDialogTitle-root", cancel: '[class*="MuiDialogContent-root"]' }, /*#__PURE__*/_react.default.createElement(_ui.Dialog, (0, _extends2.default)({ open: true, fullWidth: true, hideBackdrop: true, scroll: "paper", sx: { '& .MuiDialog-container': { alignItems: 'flex-start', mt: '18vh' } }, PaperProps: { sx: { m: 0, maxHeight: '76vh' } } }, props), props.children)); }; PromptDialog.propTypes = { onClose: PropTypes.func.isRequired, children: PropTypes.node.isRequired, maxWidth: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl', false]) }; PromptDialog.Header = _dialogHeader.default; PromptDialog.Content = _ui.DialogContent; var _default = PromptDialog; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/components/prompt-error-message.js": /*!*************************************************************************!*\ !*** ../modules/ai/assets/js/editor/components/prompt-error-message.js ***! \*************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "../node_modules/@babel/runtime/helpers/objectWithoutProperties.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _excluded = ["error", "onRetry", "actionPosition"]; var PromptErrorMessage = function PromptErrorMessage(_ref) { var error = _ref.error, _ref$onRetry = _ref.onRetry, onRetry = _ref$onRetry === void 0 ? function () {} : _ref$onRetry, _ref$actionPosition = _ref.actionPosition, actionPosition = _ref$actionPosition === void 0 ? 'default' : _ref$actionPosition, props = (0, _objectWithoutProperties2.default)(_ref, _excluded); var messages = { default: { text: /*#__PURE__*/_react.default.createElement(_ui.AlertTitle, null, __('Unknown error. Please try again later.', 'elementor')), description: __('Error code:', 'elementor') + ' ' + error, buttonText: __('Try Again', 'elementor'), buttonAction: onRetry }, service_outage_internal: { text: /*#__PURE__*/_react.default.createElement(_ui.AlertTitle, null, __('Elementor AI is temporarily unavailable', 'elementor')), description: __('Seems like we are experiencing technical difficulty. We should be up and running shortly.', 'elementor'), buttonText: __('Try Again', 'elementor'), buttonAction: onRetry }, invalid_connect_data: { text: /*#__PURE__*/_react.default.createElement(_ui.AlertTitle, null, __('Reconnect your account', 'elementor')), description: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, __('We couldn\'t connect to your account due to technical difficulties on our end. Reconnect your account to continue.', 'elementor'), ' ', /*#__PURE__*/_react.default.createElement("a", { href: "https://elementor.com/help/disconnecting-reconnecting-your-elementor-account/", target: "_blank", rel: "noreferrer" }, __('Show me how', 'elementor'))), buttonText: __('Reconnect', 'elementor'), buttonAction: function buttonAction() { return window.open(window.ElementorAiConfig.connect_url); } }, not_connected: { text: /*#__PURE__*/_react.default.createElement(_ui.AlertTitle, null, __('You aren\'t connected to Elementor AI.', 'elementor')), description: __('Elementor AI is just a few clicks away. Connect your account to instantly create texts and custom code.', 'elementor'), buttonText: __('Connect', 'elementor'), buttonAction: function buttonAction() { return window.open(window.ElementorAiConfig.connect_url); } }, quota_reached_trail: { text: /*#__PURE__*/_react.default.createElement(_ui.AlertTitle, null, __('It\'s time to upgrade.', 'elementor')), description: __('Enjoy the free trial? Upgrade now for unlimited access to built-in image, text and custom code generators.', 'elementor'), buttonText: __('Upgrade', 'elementor'), buttonAction: function buttonAction() { return window.open('https://go.elementor.com/ai-popup-purchase-limit-reached/', '_blank'); } }, quota_reached_subscription: { text: /*#__PURE__*/_react.default.createElement(_ui.AlertTitle, null, __('It\'s time to upgrade.', 'elementor')), description: __('Love Elementor AI? Upgrade to continue creating with built-in image, text and custom code generators.', 'elementor'), buttonText: __('Upgrade', 'elementor'), buttonAction: function buttonAction() { return window.open('https://go.elementor.com/ai-popup-purchase-limit-reached/', '_blank'); } }, rate_limit_network: { text: /*#__PURE__*/_react.default.createElement(_ui.AlertTitle, null, __('Whoa! Slow down there.', 'elementor')), description: __('We can’t process that many requests so fast. Try again in 15 minutes.', 'elementor') }, invalid_prompts: { text: /*#__PURE__*/_react.default.createElement(_ui.AlertTitle, null, __('We were unable to generate that prompt.', 'elementor')), description: __('Seems like the prompt contains words that could generate harmful content. Write a different prompt to continue.', 'elementor') } }; var message = messages[error] || messages.default; var action = (message === null || message === void 0 ? void 0 : message.buttonText) && /*#__PURE__*/_react.default.createElement(_ui.Button, { color: "inherit", size: "small", variant: "outlined", onClick: message.buttonAction }, message.buttonText); return /*#__PURE__*/_react.default.createElement(_ui.Alert, (0, _extends2.default)({ severity: message.severity || 'error', action: 'default' === actionPosition && action }, props), message.text, message.description, 'bottom' === actionPosition && /*#__PURE__*/_react.default.createElement(_ui.Box, { sx: { mt: 3 } }, action)); }; PromptErrorMessage.propTypes = { error: PropTypes.string, onRetry: PropTypes.func, actionPosition: PropTypes.oneOf(['default', 'bottom']) }; var _default = PromptErrorMessage; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/components/prompt-search.js": /*!******************************************************************!*\ !*** ../modules/ai/assets/js/editor/components/prompt-search.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _searchField = _interopRequireDefault(__webpack_require__(/*! ./ui/search-field */ "../modules/ai/assets/js/editor/components/ui/search-field.js")); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } var PromptSearch = (0, _react.forwardRef)(function (props, ref) { return /*#__PURE__*/_react.default.createElement(_searchField.default, (0, _extends2.default)({ name: "prompt", placeholder: __('Describe the text and tone you want to use', 'elementor') + '...' }, props, { ref: ref })); }); var _default = PromptSearch; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/components/prompt-suggestions.js": /*!***********************************************************************!*\ !*** ../modules/ai/assets/js/editor/components/prompt-suggestions.js ***! \***********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _styledChip = _interopRequireDefault(__webpack_require__(/*! ./ui/styled-chip */ "../modules/ai/assets/js/editor/components/ui/styled-chip.js")); var PromptSuggestions = function PromptSuggestions(props) { var _props$suggestions; return /*#__PURE__*/_react.default.createElement(_ui.Box, null, /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "subtitle1", color: "text.secondary" }, __('Suggested prompts', 'elementor') + ':'), /*#__PURE__*/_react.default.createElement(_ui.Stack, { direction: "column", alignItems: "flex-start", gap: 3, sx: { my: 3 } }, (_props$suggestions = props.suggestions) === null || _props$suggestions === void 0 ? void 0 : _props$suggestions.map(function (option, index) { var _props$suggestionFilt; return /*#__PURE__*/_react.default.createElement(_styledChip.default, { key: index, variant: "outlined", size: "large", color: "secondary", label: ((_props$suggestionFilt = props.suggestionFilter) === null || _props$suggestionFilt === void 0 ? void 0 : _props$suggestionFilt.call(props, option)) || option, onClick: function onClick() { return props.onSelect(option); } }); }))); }; PromptSuggestions.propTypes = { suggestions: PropTypes.arrayOf(PropTypes.string), onSelect: PropTypes.func.isRequired, suggestionFilter: PropTypes.func }; var _default = PromptSuggestions; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/components/textarea.js": /*!*************************************************************!*\ !*** ../modules/ai/assets/js/editor/components/textarea.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } var Textarea = (0, _react.forwardRef)(function (props, ref) { return /*#__PURE__*/_react.default.createElement(_ui.TextField, (0, _extends2.default)({ ref: ref, multiline: true, minRows: 4, maxRows: 20, color: "secondary" }, props)); }); Textarea.propTypes = { value: PropTypes.string, onChange: PropTypes.func, helperText: PropTypes.string }; var _default = Textarea; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/components/ui/overlay-bar.js": /*!*******************************************************************!*\ !*** ../modules/ai/assets/js/editor/components/ui/overlay-bar.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var OverlayBar = (0, _ui.styled)(_ui.Stack)(function (_ref) { var theme = _ref.theme, position = _ref.position; var style = { width: '100%', position: 'absolute', left: 0, padding: theme.spacing(6) }; if ('top' === position) { style.top = 0; } else if ('bottom' === position) { style.bottom = 0; } return style; }); var _default = OverlayBar; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/components/ui/overlay.js": /*!***************************************************************!*\ !*** ../modules/ai/assets/js/editor/components/ui/overlay.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var Overlay = (0, _ui.styled)(_ui.Box)(function (_ref) { var theme = _ref.theme; return { width: '100%', height: '100%', position: 'absolute', backgroundColor: 'rgba(0,0,0,0.5)', transition: "opacity ".concat(theme.transitions.duration.short, "ms ").concat(theme.transitions.easing.easeInOut), opacity: 0, '&:hover': { opacity: 1 } }; }); var _default = Overlay; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/components/ui/panel.js": /*!*************************************************************!*\ !*** ../modules/ai/assets/js/editor/components/ui/panel.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "../node_modules/@babel/runtime/helpers/objectWithoutProperties.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _excluded = ["sx"]; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } var Panel = function Panel(_ref) { var _ref$sx = _ref.sx, sx = _ref$sx === void 0 ? {} : _ref$sx, props = (0, _objectWithoutProperties2.default)(_ref, _excluded); return /*#__PURE__*/_react.default.createElement(_ui.Drawer, (0, _extends2.default)({ open: true, anchor: "left", variant: "persistent", PaperProps: { sx: { position: 'relative', width: 360, px: 8, pt: 8, bgcolor: 'background.default' } }, sx: _objectSpread({ height: '100%' }, sx) }, props), props.children); }; Panel.propTypes = { children: PropTypes.node, sx: PropTypes.object }; var _default = Panel; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/components/ui/search-field.js": /*!********************************************************************!*\ !*** ../modules/ai/assets/js/editor/components/ui/search-field.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } var StyledTextField = (0, _ui.styled)(_ui.TextField)(function (_ref) { var theme = _ref.theme; return { // Overwriting the admin global CSS. '& .MuiInputBase-input, & .MuiInputBase-input:focus': { backgroundColor: theme.palette.background.default, border: 'none', boxShadow: 'none', color: theme.palette.text.primary, padding: theme.spacing(0, 3), outline: 'none' }, '& .MuiInputAdornment-root': { color: theme.palette.text.tertiary } }; }); var SearchField = (0, _react.forwardRef)(function (props, ref) { return /*#__PURE__*/_react.default.createElement(StyledTextField // eslint-disable-next-line jsx-a11y/no-autofocus , (0, _extends2.default)({ autoFocus: true, fullWidth: true, required: true, color: "secondary", InputProps: { autoComplete: 'off', startAdornment: /*#__PURE__*/_react.default.createElement(_ui.InputAdornment, { position: "start" }, /*#__PURE__*/_react.default.createElement(_icons.SearchIcon, null)) }, placeholder: props.placeholder, name: props.name, value: props.value, onChange: props.onChange }, props, { ref: ref })); }); SearchField.propTypes = { placeholder: PropTypes.string, name: PropTypes.string, value: PropTypes.string, onChange: PropTypes.func }; var _default = SearchField; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/components/ui/styled-chip.js": /*!*******************************************************************!*\ !*** ../modules/ai/assets/js/editor/components/ui/styled-chip.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var StyledChip = (0, _ui.styled)(_ui.Chip)(function () { return { '& .MuiChip-label': { lineHeight: 1.5 }, '& .MuiSvgIcon-root.MuiChip-icon': { fontSize: '1.25rem' } }; }); var _default = StyledChip; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/components/upgrade-chip.js": /*!*****************************************************************!*\ !*** ../modules/ai/assets/js/editor/components/upgrade-chip.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } var popoverId = 'e-ai-upgrade-popover'; var StyledContent = (0, _ui.styled)(_ui.Box)(function (_ref) { var theme = _ref.theme; return { position: 'relative', marginTop: theme.spacing(6), padding: theme.spacing(7), backgroundColor: theme.palette.background.paper, boxShadow: theme.shadows[4], borderRadius: theme.border.radius.sm, zIndex: '9999' }; }); var StyledArrow = (0, _ui.styled)(_ui.Box)(function (_ref2) { var theme = _ref2.theme; return { width: theme.sizing[500], height: theme.sizing[200], position: 'absolute', top: "calc(".concat(theme.sizing[200], " * -1)"), left: '50%', transform: 'translateX(-50%) rotate(180deg)', overflow: 'hidden', '&::after': { backgroundColor: theme.palette.background.paper, content: '""', display: 'block', position: 'absolute', width: theme.sizing[200], height: theme.sizing[200], top: 0, left: '50%', transform: 'translateX(-50%) translateY(-50%) rotate(45deg)', boxShadow: '1px 1px 5px 0px rgba(0, 0, 0, 0.2)' } }; }); var upgradeBullets = [__('Generate professional texts about any topic, in any tone.', 'elementor'), __('Translate your content into twenty-five different languages.', 'elementor'), __('Unleash infinite possibilities with the custom code generator.', 'elementor')]; var Chip = (0, _ui.styled)(_ui.Chip)(function () { return { '& .MuiChip-label': { lineHeight: 1.5 }, '& .MuiSvgIcon-root.MuiChip-icon': { fontSize: '1.25rem' } }; }); var UpgradeChip = function UpgradeChip(_ref3) { var _ref3$hasSubscription = _ref3.hasSubscription, hasSubscription = _ref3$hasSubscription === void 0 ? false : _ref3$hasSubscription, _ref3$usagePercentage = _ref3.usagePercentage, usagePercentage = _ref3$usagePercentage === void 0 ? 0 : _ref3$usagePercentage; var _useState = (0, _react.useState)(false), _useState2 = (0, _slicedToArray2.default)(_useState, 2), isPopoverOpen = _useState2[0], setIsPopoverOpen = _useState2[1]; var anchorEl = (0, _react.useRef)(null); var showPopover = function showPopover() { return setIsPopoverOpen(true); }; var hidePopover = function hidePopover() { return setIsPopoverOpen(false); }; var actionUrl = 'https://go.elementor.com/ai-popup-purchase-dropdown/'; if (hasSubscription) { actionUrl = usagePercentage >= 100 ? 'https://go.elementor.com/ai-popup-upgrade-limit-reached/' : 'https://go.elementor.com/ai-popup-upgrade-limit-reached-80-percent/'; } var actionLabel = hasSubscription ? __('Upgrade Elementor AI', 'elementor') : __('Get Elementor AI', 'elementor'); return /*#__PURE__*/_react.default.createElement(_ui.Box, { component: "span", "aria-owns": isPopoverOpen ? popoverId : undefined, "aria-haspopup": "true", onMouseEnter: showPopover, onMouseLeave: hidePopover, ref: anchorEl, display: "flex", alignItems: "center" }, /*#__PURE__*/_react.default.createElement(Chip, { color: "accent", label: __('Upgrade', 'elementor'), icon: /*#__PURE__*/_react.default.createElement(_icons.UpgradeIcon, null) }), /*#__PURE__*/_react.default.createElement(_ui.Popper, { open: isPopoverOpen, anchorEl: anchorEl.current, sx: { zIndex: '9999', maxWidth: 300 } }, /*#__PURE__*/_react.default.createElement(StyledContent, null, /*#__PURE__*/_react.default.createElement(StyledArrow, null), /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "h5", color: "text.primary" }, __('Unlimited access to Elementor AI', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.List, { sx: { mb: 7 } }, upgradeBullets.map(function (bullet, index) { return /*#__PURE__*/_react.default.createElement(_ui.ListItem, { key: index, disableGutters: true, sx: { alignItems: 'flex-start', my: 4 } }, /*#__PURE__*/_react.default.createElement(_ui.ListItemIcon, { sx: { mr: 3 } }, /*#__PURE__*/_react.default.createElement(_icons.CheckedCircleIcon, null)), /*#__PURE__*/_react.default.createElement(_ui.ListItemText, { sx: { m: 0 } }, /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "body2" }, bullet))); })), /*#__PURE__*/_react.default.createElement(_ui.Button, { variant: "contained", color: "accent", size: "small", href: actionUrl, target: "_blank", startIcon: /*#__PURE__*/_react.default.createElement(_icons.UpgradeIcon, null), sx: { '&:hover': { color: 'accent.contrastText' } } }, actionLabel)))); }; var _default = UpgradeChip; exports["default"] = _default; UpgradeChip.propTypes = { hasSubscription: PropTypes.bool, usagePercentage: PropTypes.number }; /***/ }), /***/ "../modules/ai/assets/js/editor/components/wizard-dialog.js": /*!******************************************************************!*\ !*** ../modules/ai/assets/js/editor/components/wizard-dialog.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "../node_modules/@babel/runtime/helpers/objectWithoutProperties.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _dialogHeader = _interopRequireDefault(__webpack_require__(/*! ./dialog-header */ "../modules/ai/assets/js/editor/components/dialog-header.js")); var _excluded = ["sx"]; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } var WizardDialog = function WizardDialog(props) { return /*#__PURE__*/_react.default.createElement(_ui.Dialog, { open: true, onClose: props.onClose, fullWidth: true, hideBackdrop: true, maxWidth: "lg", PaperProps: { sx: { height: '88vh' } }, sx: { zIndex: 9999 } }, props.children); }; WizardDialog.propTypes = { onClose: PropTypes.func.isRequired, children: PropTypes.node.isRequired }; var WizardDialogContent = function WizardDialogContent(_ref) { var _ref$sx = _ref.sx, sx = _ref$sx === void 0 ? {} : _ref$sx, props = (0, _objectWithoutProperties2.default)(_ref, _excluded); return /*#__PURE__*/_react.default.createElement(_ui.DialogContent, (0, _extends2.default)({}, props, { sx: _objectSpread({ display: 'flex', flexDirection: 'column', justifyContent: 'center' }, sx) })); }; WizardDialogContent.propTypes = { sx: PropTypes.object }; WizardDialog.Header = _dialogHeader.default; WizardDialog.Content = WizardDialogContent; var _default = WizardDialog; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/helpers.js": /*!*************************************************!*\ !*** ../modules/ai/assets/js/editor/helpers.js ***! \*************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.onConnect = void 0; var onConnect = function onConnect(data) { elementorCommon.config.library_connect.is_connected = true; elementorCommon.config.library_connect.current_access_level = data.accessLevel; }; exports.onConnect = onConnect; /***/ }), /***/ "../modules/ai/assets/js/editor/hooks/use-code-prompt.js": /*!***************************************************************!*\ !*** ../modules/ai/assets/js/editor/hooks/use-code-prompt.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); var _api = __webpack_require__(/*! ../api */ "../modules/ai/assets/js/editor/api/index.js"); var _usePrompt = _interopRequireDefault(__webpack_require__(/*! ./use-prompt */ "../modules/ai/assets/js/editor/hooks/use-prompt.js")); var getCodeResult = /*#__PURE__*/function () { var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(prompt, _ref) { var codeLanguage, htmlMarkup, elementId; return _regenerator.default.wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { case 0: codeLanguage = _ref.codeLanguage, htmlMarkup = _ref.htmlMarkup, elementId = _ref.elementId; if (!('css' === codeLanguage)) { _context.next = 3; break; } return _context.abrupt("return", (0, _api.getCustomCSS)(prompt, htmlMarkup, elementId)); case 3: return _context.abrupt("return", (0, _api.getCustomCode)(prompt, codeLanguage)); case 4: case "end": return _context.stop(); } }, _callee); })); return function getCodeResult(_x, _x2) { return _ref2.apply(this, arguments); }; }(); var useCodePrompt = function useCodePrompt(_ref3) { var codeLanguage = _ref3.codeLanguage, htmlMarkup = _ref3.htmlMarkup, elementId = _ref3.elementId, credits = _ref3.initialCredits; var promptData = (0, _usePrompt.default)(function (promptValue) { return getCodeResult(promptValue, { codeLanguage: codeLanguage, htmlMarkup: htmlMarkup, elementId: elementId }); }, { credits: credits }); return promptData; }; var _default = useCodePrompt; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/hooks/use-image-navigation.js": /*!********************************************************************!*\ !*** ../modules/ai/assets/js/editor/hooks/use-image-navigation.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); var _react = __webpack_require__(/*! react */ "react"); var useImageNavigation = function useImageNavigation(images) { var _useState = (0, _react.useState)(-1), _useState2 = (0, _slicedToArray2.default)(_useState, 2), zoomedImageIndex = _useState2[0], setZoomedImageIndex = _useState2[1]; var imageNavigation = { backToResults: function backToResults() { return setZoomedImageIndex(-1); }, navigatePrevImage: function navigatePrevImage() { var prevImage = zoomedImageIndex + 1; if (prevImage >= images.length) { prevImage = 0; } setZoomedImageIndex(prevImage); }, navigateNextImage: function navigateNextImage() { var nextImage = zoomedImageIndex - 1; if (nextImage < 0) { nextImage = images.length - 1; } setZoomedImageIndex(nextImage); } }; return { zoomedImageIndex: zoomedImageIndex, setZoomedImageIndex: setZoomedImageIndex, imageNavigation: imageNavigation }; }; var _default = useImageNavigation; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/hooks/use-image-prompt-enhancer.js": /*!*************************************************************************!*\ !*** ../modules/ai/assets/js/editor/hooks/use-image-prompt-enhancer.js ***! \*************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); var _api = __webpack_require__(/*! ../api */ "../modules/ai/assets/js/editor/api/index.js"); var _usePrompt = _interopRequireDefault(__webpack_require__(/*! ./use-prompt */ "../modules/ai/assets/js/editor/hooks/use-prompt.js")); var getResult = /*#__PURE__*/function () { var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(prompt) { return _regenerator.default.wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { case 0: return _context.abrupt("return", (0, _api.getImagePromptEnhanced)(prompt)); case 1: case "end": return _context.stop(); } }, _callee); })); return function getResult(_x) { return _ref.apply(this, arguments); }; }(); var useImagePromptEnhancer = function useImagePromptEnhancer(initialValue) { var promptData = (0, _usePrompt.default)(getResult, initialValue); return promptData; }; var _default = useImagePromptEnhancer; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/hooks/use-image-prompt-settings.js": /*!*************************************************************************!*\ !*** ../modules/ai/assets/js/editor/hooks/use-image-prompt-settings.js ***! \*************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); var _react = __webpack_require__(/*! react */ "react"); var _consts = __webpack_require__(/*! ../pages/form-media/consts/consts */ "../modules/ai/assets/js/editor/pages/form-media/consts/consts.js"); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } var useImagePromptSettings = function useImagePromptSettings() { var _useState3; var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, _ref$style = _ref.style, style = _ref$style === void 0 ? '' : _ref$style, _ref$type = _ref.type, type = _ref$type === void 0 ? '' : _ref$type, _ref$imageWeight = _ref.imageWeight, imageWeight = _ref$imageWeight === void 0 ? 0 : _ref$imageWeight, _ref$aspectRatio = _ref.aspectRatio, aspectRatio = _ref$aspectRatio === void 0 ? '1:1' : _ref$aspectRatio, _ref$zoom = _ref.zoom, zoom = _ref$zoom === void 0 ? '1' : _ref$zoom, _ref$upScaleTo = _ref.upScaleTo, upScaleTo = _ref$upScaleTo === void 0 ? '512' : _ref$upScaleTo; var _useState = (0, _react.useState)((_useState3 = {}, (0, _defineProperty2.default)(_useState3, _consts.IMAGE_PROMPT_SETTINGS.IMAGE_TYPE, style), (0, _defineProperty2.default)(_useState3, _consts.IMAGE_PROMPT_SETTINGS.STYLE_PRESET, type), (0, _defineProperty2.default)(_useState3, _consts.IMAGE_PROMPT_SETTINGS.IMAGE_STRENGTH, imageWeight), (0, _defineProperty2.default)(_useState3, _consts.IMAGE_PROMPT_SETTINGS.ASPECT_RATIO, aspectRatio), (0, _defineProperty2.default)(_useState3, _consts.IMAGE_PROMPT_SETTINGS.ZOOM, zoom), (0, _defineProperty2.default)(_useState3, _consts.IMAGE_PROMPT_SETTINGS.UPSCALE_TO, upScaleTo), _useState3)), _useState2 = (0, _slicedToArray2.default)(_useState, 2), promptSettings = _useState2[0], setPromptSettings = _useState2[1]; var updatePromptSettings = function updatePromptSettings(newSettings) { setPromptSettings(_objectSpread(_objectSpread({}, promptSettings), newSettings)); }; var resetPromptSettings = function resetPromptSettings() { var _setPromptSettings; setPromptSettings((_setPromptSettings = {}, (0, _defineProperty2.default)(_setPromptSettings, _consts.IMAGE_PROMPT_SETTINGS.IMAGE_TYPE, style), (0, _defineProperty2.default)(_setPromptSettings, _consts.IMAGE_PROMPT_SETTINGS.STYLE_PRESET, ''), (0, _defineProperty2.default)(_setPromptSettings, _consts.IMAGE_PROMPT_SETTINGS.IMAGE_STRENGTH, 0), (0, _defineProperty2.default)(_setPromptSettings, _consts.IMAGE_PROMPT_SETTINGS.ASPECT_RATIO, '1:1'), (0, _defineProperty2.default)(_setPromptSettings, _consts.IMAGE_PROMPT_SETTINGS.ZOOM, '1'), (0, _defineProperty2.default)(_setPromptSettings, _consts.IMAGE_PROMPT_SETTINGS.UPSCALE_TO, '512'), _setPromptSettings)); }; return { promptSettings: promptSettings, updatePromptSettings: updatePromptSettings, setPromptSettings: setPromptSettings, resetPromptSettings: resetPromptSettings }; }; var _default = useImagePromptSettings; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/hooks/use-image-prompt.js": /*!****************************************************************!*\ !*** ../modules/ai/assets/js/editor/hooks/use-image-prompt.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); var _api = __webpack_require__(/*! ../api */ "../modules/ai/assets/js/editor/api/index.js"); var _usePrompt = _interopRequireDefault(__webpack_require__(/*! ./use-prompt */ "../modules/ai/assets/js/editor/hooks/use-prompt.js")); var _consts = __webpack_require__(/*! ../pages/form-media/consts/consts */ "../modules/ai/assets/js/editor/pages/form-media/consts/consts.js"); var getImageResponse = /*#__PURE__*/function () { var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(prompt, promptSettings) { var image, imageToImageType, mask, apiMethod, _args = arguments; return _regenerator.default.wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { case 0: image = _args.length > 2 && _args[2] !== undefined ? _args[2] : null; imageToImageType = _args.length > 3 && _args[3] !== undefined ? _args[3] : null; mask = _args.length > 4 && _args[4] !== undefined ? _args[4] : null; apiMethod = image ? _api.getImageToImageGeneration : _api.getTextToImageGeneration; if (imageToImageType && _consts.PANELS.IN_PAINTING === imageToImageType) { apiMethod = _api.getImageToImageMaskGeneration; } if (imageToImageType && _consts.PANELS.OUT_PAINTING === imageToImageType) { apiMethod = _api.getImageToImageOutPainting; } if (imageToImageType && _consts.PANELS.UPSCALE === imageToImageType) { apiMethod = _api.getImageToImageUpscale; } return _context.abrupt("return", apiMethod(prompt, promptSettings, image, mask)); case 8: case "end": return _context.stop(); } }, _callee); })); return function getImageResponse(_x, _x2) { return _ref.apply(this, arguments); }; }(); var useImagePrompt = function useImagePrompt(initialValue) { var promptData = (0, _usePrompt.default)(getImageResponse, initialValue); return promptData; }; var _default = useImagePrompt; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/hooks/use-image-screen-panel.js": /*!**********************************************************************!*\ !*** ../modules/ai/assets/js/editor/hooks/use-image-screen-panel.js ***! \**********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); var _react = __webpack_require__(/*! react */ "react"); var useImageScreenPanel = function useImageScreenPanel(initialScreen, initialPanel) { var _useState = (0, _react.useState)(initialScreen), _useState2 = (0, _slicedToArray2.default)(_useState, 2), screen = _useState2[0], setScreen = _useState2[1]; var _useState3 = (0, _react.useState)(initialPanel), _useState4 = (0, _slicedToArray2.default)(_useState3, 2), panel = _useState4[0], setPanel = _useState4[1]; return { screen: screen, setScreen: setScreen, panel: panel, setPanel: setPanel }; }; var _default = useImageScreenPanel; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/hooks/use-image-upload.js": /*!****************************************************************!*\ !*** ../modules/ai/assets/js/editor/hooks/use-image-upload.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); var _react = __webpack_require__(/*! react */ "react"); var _api = __webpack_require__(/*! ../api */ "../modules/ai/assets/js/editor/api/index.js"); var useImageUpload = function useImageUpload() { var _useState = (0, _react.useState)(false), _useState2 = (0, _slicedToArray2.default)(_useState, 2), isUploading = _useState2[0], setIsUploading = _useState2[1]; var _useState3 = (0, _react.useState)(''), _useState4 = (0, _slicedToArray2.default)(_useState3, 2), uploadError = _useState4[0], setUploadError = _useState4[1]; var _useState5 = (0, _react.useState)({}), _useState6 = (0, _slicedToArray2.default)(_useState5, 2), attachmentData = _useState6[0], setAttachmentData = _useState6[1]; var upload = /*#__PURE__*/function () { var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() { var _args = arguments; return _regenerator.default.wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { case 0: setUploadError(''); setIsUploading(true); _api.uploadImage.apply(void 0, _args).then(function (result) { return setAttachmentData(result); }).catch(function (err) { return setUploadError((err === null || err === void 0 ? void 0 : err.responseText) || err); }).finally(function () { return setIsUploading(false); }); case 3: case "end": return _context.stop(); } }, _callee); })); return function upload() { return _ref.apply(this, arguments); }; }(); var resetUpload = function resetUpload() { setAttachmentData({}); setUploadError(''); setIsUploading(false); }; return { attachmentData: attachmentData, isUploading: isUploading, uploadError: uploadError, resetUpload: resetUpload, upload: upload }; }; var _default = useImageUpload; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/hooks/use-images-preload.js": /*!******************************************************************!*\ !*** ../modules/ai/assets/js/editor/hooks/use-images-preload.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); var _react = __webpack_require__(/*! react */ "react"); var useImagesPreload = function useImagesPreload() { var property = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'url'; var _useState = (0, _react.useState)(false), _useState2 = (0, _slicedToArray2.default)(_useState, 2), imagesPreloaded = _useState2[0], setImagesPreLoaded = _useState2[1]; var preloadImages = function preloadImages(images) { setImagesPreLoaded(false); var loadImage = function loadImage(image) { return new Promise(function (resolve, reject) { var loadImg = new Image(); loadImg.src = image[property]; loadImg.onload = function () { return resolve(image[property]); }; loadImg.onerror = function (err) { return reject(err); }; }); }; Promise.all(images.map(function (image) { return loadImage(image); })).then(function () { return setImagesPreLoaded(true); }).catch(function (err) { return console.log('Failed to load images', err); }); // Todo error better handling }; return { imagesPreloaded: imagesPreloaded, preloadImages: preloadImages }; }; var _default = useImagesPreload; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/hooks/use-prompt.js": /*!**********************************************************!*\ !*** ../modules/ai/assets/js/editor/hooks/use-prompt.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); var _react = __webpack_require__(/*! react */ "react"); var _api = __webpack_require__(/*! ../api */ "../modules/ai/assets/js/editor/api/index.js"); var normalizeResponse = function normalizeResponse(_ref) { var text = _ref.text, responseId = _ref.response_id, usage = _ref.usage, images = _ref.images; var creditsData = usage ? usage.quota - usage.usedQuota : 0; var credits = Math.max(creditsData, 0); var result = text || images; return { result: result, responseId: responseId, credits: credits }; }; var usePrompt = function usePrompt(fetchData, initialState) { var _useState = (0, _react.useState)(false), _useState2 = (0, _slicedToArray2.default)(_useState, 2), isLoading = _useState2[0], setIsLoading = _useState2[1]; var _useState3 = (0, _react.useState)(''), _useState4 = (0, _slicedToArray2.default)(_useState3, 2), error = _useState4[0], setError = _useState4[1]; var _useState5 = (0, _react.useState)(initialState), _useState6 = (0, _slicedToArray2.default)(_useState5, 2), data = _useState6[0], setData = _useState6[1]; var send = /*#__PURE__*/function () { var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() { var _args = arguments; return _regenerator.default.wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { case 0: setError(''); setIsLoading(true); fetchData.apply(void 0, _args).then(function (result) { return setData(normalizeResponse(result)); }).catch(function (err) { return setError((err === null || err === void 0 ? void 0 : err.responseText) || err); }).finally(function () { return setIsLoading(false); }); case 3: case "end": return _context.stop(); } }, _callee); })); return function send() { return _ref2.apply(this, arguments); }; }(); var sendUsageData = function sendUsageData() { return data.responseId && (0, _api.setStatusFeedback)(data.responseId); }; var reset = function reset() { setData(function (_ref3) { var credits = _ref3.credits; return { credits: credits, result: '', responseId: '' }; }); setError(''); setIsLoading(false); }; return { isLoading: isLoading, error: error, data: data, reset: reset, send: send, sendUsageData: sendUsageData }; }; var _default = usePrompt; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/hooks/use-session-storage.js": /*!*******************************************************************!*\ !*** ../modules/ai/assets/js/editor/hooks/use-session-storage.js ***! \*******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); var _react = __webpack_require__(/*! react */ "react"); var useSessionStorage = function useSessionStorage(storageKey) { var initialValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; var getSessionStorageData = function getSessionStorageData() { return JSON.parse(sessionStorage.getItem(storageKey)) || initialValue; }; var setSessionStorageData = function setSessionStorageData(value) { return sessionStorage.setItem(storageKey, JSON.stringify(value)); }; var _useState = (0, _react.useState)(getSessionStorageData()), _useState2 = (0, _slicedToArray2.default)(_useState, 2), data = _useState2[0], setData = _useState2[1]; var setStateAndSessionData = function setStateAndSessionData(value) { setSessionStorageData(value); setData(value); }; return { data: data, setStateAndSessionData: setStateAndSessionData }; }; var _default = useSessionStorage; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/hooks/use-text-prompt.js": /*!***************************************************************!*\ !*** ../modules/ai/assets/js/editor/hooks/use-text-prompt.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); var _api = __webpack_require__(/*! ../api */ "../modules/ai/assets/js/editor/api/index.js"); var _usePrompt = _interopRequireDefault(__webpack_require__(/*! ./use-prompt */ "../modules/ai/assets/js/editor/hooks/use-prompt.js")); var getTextResult = /*#__PURE__*/function () { var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(prompt, instruction) { return _regenerator.default.wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { case 0: if (!instruction) { _context.next = 2; break; } return _context.abrupt("return", (0, _api.getEditText)(prompt, instruction)); case 2: return _context.abrupt("return", (0, _api.getCompletionText)(prompt)); case 3: case "end": return _context.stop(); } }, _callee); })); return function getTextResult(_x, _x2) { return _ref.apply(this, arguments); }; }(); var useTextPrompt = function useTextPrompt(initialValue) { var promptData = (0, _usePrompt.default)(getTextResult, initialValue); return promptData; }; var _default = useTextPrompt; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/hooks/use-user-info.js": /*!*************************************************************!*\ !*** ../modules/ai/assets/js/editor/hooks/use-user-info.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); var _react = __webpack_require__(/*! react */ "react"); var _api = __webpack_require__(/*! ../api */ "../modules/ai/assets/js/editor/api/index.js"); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } var useUserInfo = function useUserInfo() { var _useState = (0, _react.useState)(false), _useState2 = (0, _slicedToArray2.default)(_useState, 2), isLoading = _useState2[0], setIsLoading = _useState2[1]; var _useState3 = (0, _react.useState)({ is_connected: false, is_get_started: false, connect_url: '', usage: { hasAiSubscription: false, quota: 0, usedQuota: 0 } }), _useState4 = (0, _slicedToArray2.default)(_useState3, 2), userInfo = _useState4[0], setUserInfo = _useState4[1]; var credits = userInfo.usage.quota - userInfo.usage.usedQuota; var usagePercentage = userInfo.usage.usedQuota / userInfo.usage.quota * 100; var fetchData = /*#__PURE__*/function () { var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() { var userInfoResult; return _regenerator.default.wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { case 0: setIsLoading(true); _context.next = 3; return (0, _api.getUserInformation)(); case 3: userInfoResult = _context.sent; setUserInfo(function (prevState) { return _objectSpread(_objectSpread({}, prevState), userInfoResult); }); setIsLoading(false); case 6: case "end": return _context.stop(); } }, _callee); })); return function fetchData() { return _ref.apply(this, arguments); }; }(); (0, _react.useEffect)(function () { fetchData(); }, []); return { isLoading: isLoading, isConnected: userInfo.is_connected, isGetStarted: userInfo.is_get_started, connectUrl: userInfo.connect_url, hasSubscription: userInfo.usage.hasAiSubscription, credits: credits < 0 ? 0 : credits, usagePercentage: Math.round(usagePercentage), fetchData: fetchData }; }; var _default = useUserInfo; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/icons/brush-icon.js": /*!**********************************************************!*\ !*** ../modules/ai/assets/js/editor/icons/brush-icon.js ***! \**********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var BrushIcon = _react.default.forwardRef(function (props, ref) { return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({ viewBox: "0 0 24 24" }, props, { ref: ref }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M20.8815 2.25919C20.9203 2.25301 20.9599 2.24983 21 2.24988C21.0827 2.24978 21.1629 2.26335 21.2384 2.2887C21.367 2.33162 21.4784 2.40776 21.5642 2.5058C21.6895 2.64891 21.76 2.83868 21.749 3.03992C21.7477 3.06492 21.7452 3.08966 21.7414 3.11407C21.3311 6.09743 20.124 8.91507 18.2472 11.2703C16.5079 13.4529 14.2532 15.1635 11.6906 16.2509C11.8289 17.1168 11.7249 18.0054 11.3884 18.8177C11.0289 19.6857 10.4201 20.4275 9.63896 20.9495C8.85782 21.4714 7.93946 21.75 7 21.75H3C2.58579 21.75 2.25 21.4142 2.25 21V17C2.25 16.0605 2.52858 15.1421 3.05052 14.361C3.57246 13.5799 4.3143 12.9711 5.18225 12.6115C5.99455 12.2751 6.88314 12.1711 7.74905 12.3094C8.83643 9.74682 10.547 7.49212 12.7296 5.75287C15.0837 3.87693 17.8998 2.67012 20.8815 2.25919ZM10.0984 16.0649C10.077 16.0082 10.0629 15.9506 10.0557 15.893C9.89413 15.4471 9.63624 15.04 9.2981 14.7019C8.96001 14.3638 8.55301 14.1059 8.10721 13.9444C8.04953 13.9372 7.99178 13.9231 7.93499 13.9016C7.90509 13.8903 7.87632 13.8773 7.84877 13.8628C7.77794 13.8436 7.70633 13.8268 7.63404 13.8124C7.0036 13.687 6.35014 13.7514 5.75628 13.9974C5.16242 14.2433 4.65484 14.6599 4.29772 15.1944C3.94061 15.7288 3.75 16.3572 3.75 17V20.25H7C7.64279 20.25 8.27114 20.0594 8.8056 19.7022C9.34006 19.3451 9.75662 18.8376 10.0026 18.2437C10.2486 17.6498 10.313 16.9964 10.1876 16.3659C10.1732 16.2935 10.1563 16.2218 10.1371 16.1509C10.1226 16.1234 10.1097 16.0947 10.0984 16.0649ZM10.3588 13.6412C10.7069 13.9894 10.9969 14.3876 11.2204 14.8204C12.2258 14.3839 13.1782 13.8417 14.0621 13.2048C13.3066 11.827 12.173 10.6933 10.7952 9.93782C10.1583 10.8218 9.61603 11.7741 9.17957 12.7795C9.61238 13.0031 10.0106 13.293 10.3588 13.6412ZM11.7434 8.75107C13.1943 9.59789 14.4021 10.8057 15.2489 12.2565C15.9093 11.6727 16.5204 11.0304 17.0741 10.3355C18.5698 8.45849 19.5983 6.25889 20.0821 3.9179C17.7411 4.40165 15.5415 5.43018 13.6644 6.92595C12.9696 7.47964 12.3273 8.0907 11.7434 8.75107Z" })); }); var _default = BrushIcon; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/icons/chevron-left-icon.js": /*!*****************************************************************!*\ !*** ../modules/ai/assets/js/editor/icons/chevron-left-icon.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var ChevronLeftIcon = _react.default.forwardRef(function (props, ref) { return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({ viewBox: "0 0 24 24" }, props, { ref: ref }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M15.5303 18.2803C15.8232 17.9874 15.8232 17.5126 15.5303 17.2197L10.0607 11.75L15.5303 6.28033C15.8232 5.98744 15.8232 5.51256 15.5303 5.21967C15.2374 4.92678 14.7626 4.92678 14.4697 5.21967L8.46967 11.2197C8.17678 11.5126 8.17678 11.9874 8.46967 12.2803L14.4697 18.2803C14.7626 18.5732 15.2374 18.5732 15.5303 18.2803Z" })); }); var _default = ChevronLeftIcon; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/icons/chevron-right-icon.js": /*!******************************************************************!*\ !*** ../modules/ai/assets/js/editor/icons/chevron-right-icon.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var ChevronRightIcon = _react.default.forwardRef(function (props, ref) { return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({ viewBox: "0 0 24 24" }, props, { ref: ref }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.46967 18.2803C8.17678 17.9874 8.17678 17.5126 8.46967 17.2197L13.9393 11.75L8.46967 6.28033C8.17678 5.98744 8.17678 5.51256 8.46967 5.21967C8.76256 4.92678 9.23744 4.92678 9.53033 5.21967L15.5303 11.2197C15.8232 11.5126 15.8232 11.9874 15.5303 12.2803L9.53033 18.2803C9.23744 18.5732 8.76256 18.5732 8.46967 18.2803Z" })); }); var _default = ChevronRightIcon; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/icons/copy-icon.js": /*!*********************************************************!*\ !*** ../modules/ai/assets/js/editor/icons/copy-icon.js ***! \*********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var CopyIcon = _react.default.forwardRef(function (props, ref) { return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({ viewBox: "0 0 24 24" }, props, { ref: ref }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9 3.75C8.30964 3.75 7.75 4.30964 7.75 5V15C7.75 15.6904 8.30964 16.25 9 16.25H19C19.6904 16.25 20.25 15.6904 20.25 15V5C20.25 4.30964 19.6904 3.75 19 3.75H9ZM6.25 5C6.25 3.48122 7.48122 2.25 9 2.25H19C20.5188 2.25 21.75 3.48122 21.75 5V15C21.75 16.5188 20.5188 17.75 19 17.75H9C7.48122 17.75 6.25 16.5188 6.25 15V5Z" }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5 7.75C4.66848 7.75 4.35054 7.8817 4.11612 8.11612C3.8817 8.35054 3.75 8.66848 3.75 9V19C3.75 19.3315 3.8817 19.6495 4.11612 19.8839C4.35054 20.1183 4.66848 20.25 5 20.25H15C15.3315 20.25 15.6495 20.1183 15.8839 19.8839C16.1183 19.6495 16.25 19.3315 16.25 19V17C16.25 16.5858 16.5858 16.25 17 16.25C17.4142 16.25 17.75 16.5858 17.75 17V19C17.75 19.7293 17.4603 20.4288 16.9445 20.9445C16.4288 21.4603 15.7293 21.75 15 21.75H5C4.27065 21.75 3.57118 21.4603 3.05546 20.9445C2.53973 20.4288 2.25 19.7293 2.25 19V9C2.25 8.27065 2.53973 7.57118 3.05546 7.05546C3.57118 6.53973 4.27065 6.25 5 6.25H7C7.41421 6.25 7.75 6.58579 7.75 7C7.75 7.41421 7.41421 7.75 7 7.75H5Z" })); }); var _default = CopyIcon; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/icons/download-icon.js": /*!*************************************************************!*\ !*** ../modules/ai/assets/js/editor/icons/download-icon.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var DownloadIcon = _react.default.forwardRef(function (props, ref) { return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({ viewBox: "0 0 24 24" }, props, { ref: ref }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4 16.25C4.41421 16.25 4.75 16.5858 4.75 17V19C4.75 19.3315 4.8817 19.6495 5.11612 19.8839C5.35054 20.1183 5.66848 20.25 6 20.25H18C18.3315 20.25 18.6495 20.1183 18.8839 19.8839C19.1183 19.6495 19.25 19.3315 19.25 19V17C19.25 16.5858 19.5858 16.25 20 16.25C20.4142 16.25 20.75 16.5858 20.75 17V19C20.75 19.7293 20.4603 20.4288 19.9445 20.9445C19.4288 21.4603 18.7293 21.75 18 21.75H6C5.27065 21.75 4.57118 21.4603 4.05546 20.9445C3.53973 20.4288 3.25 19.7293 3.25 19V17C3.25 16.5858 3.58579 16.25 4 16.25Z" }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.46967 10.4697C6.76256 10.1768 7.23744 10.1768 7.53033 10.4697L12 14.9393L16.4697 10.4697C16.7626 10.1768 17.2374 10.1768 17.5303 10.4697C17.8232 10.7626 17.8232 11.2374 17.5303 11.5303L12.5303 16.5303C12.2374 16.8232 11.7626 16.8232 11.4697 16.5303L6.46967 11.5303C6.17678 11.2374 6.17678 10.7626 6.46967 10.4697Z" }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12 3.25C12.4142 3.25 12.75 3.58579 12.75 4V16C12.75 16.4142 12.4142 16.75 12 16.75C11.5858 16.75 11.25 16.4142 11.25 16V4C11.25 3.58579 11.5858 3.25 12 3.25Z" })); }); var _default = DownloadIcon; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/icons/edit-icon.js": /*!*********************************************************!*\ !*** ../modules/ai/assets/js/editor/icons/edit-icon.js ***! \*********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var EditIcon = _react.default.forwardRef(function (props, ref) { return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({ viewBox: "0 0 24 24" }, props, { ref: ref }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M13.9697 4.96967C14.6408 4.29858 15.5509 3.92157 16.5 3.92157C17.4491 3.92157 18.3592 4.29858 19.0303 4.96967C19.7014 5.64075 20.0784 6.55094 20.0784 7.5C20.0784 8.44905 19.7014 9.35924 19.0303 10.0303L8.53033 20.5303C8.38968 20.671 8.19891 20.75 8 20.75H4C3.58579 20.75 3.25 20.4142 3.25 20V16C3.25 15.8011 3.32902 15.6103 3.46967 15.4697L13.9697 4.96967ZM16.5 5.42157C15.9488 5.42157 15.4201 5.64055 15.0303 6.03033L4.75 16.3107V19.25H7.68934L17.9697 8.96967C18.3595 8.57989 18.5784 8.05123 18.5784 7.5C18.5784 6.94876 18.3595 6.42011 17.9697 6.03033C17.5799 5.64055 17.0512 5.42157 16.5 5.42157Z" }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.9697 5.96967C13.2626 5.67677 13.7374 5.67677 14.0303 5.96967L18.0303 9.96967C18.3232 10.2626 18.3232 10.7374 18.0303 11.0303C17.7374 11.3232 17.2626 11.3232 16.9697 11.0303L12.9697 7.03033C12.6768 6.73743 12.6768 6.26256 12.9697 5.96967Z" })); }); var _default = EditIcon; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/icons/enlarger-icon.js": /*!*************************************************************!*\ !*** ../modules/ai/assets/js/editor/icons/enlarger-icon.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var ExpandIcon = _react.default.forwardRef(function (props, ref) { return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({ viewBox: "0 0 24 24" }, props, { ref: ref }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5.11612 5.11612C5.35054 4.8817 5.66848 4.75 6 4.75H18C18.3315 4.75 18.6495 4.8817 18.8839 5.11612C19.1183 5.35054 19.25 5.66848 19.25 6V18C19.25 18.3315 19.1183 18.6495 18.8839 18.8839C18.6495 19.1183 18.3315 19.25 18 19.25H11.7335C11.7444 19.1709 11.75 19.0908 11.75 19.01V14.01C11.75 13.8051 11.7141 13.604 11.6457 13.4149L16.25 8.81066V11C16.25 11.4142 16.5858 11.75 17 11.75C17.4142 11.75 17.75 11.4142 17.75 11V7C17.75 6.89831 17.7298 6.80134 17.6931 6.71291C17.6565 6.62445 17.6022 6.54158 17.5303 6.46967C17.4584 6.39776 17.3755 6.34351 17.2871 6.30691C17.1993 6.27051 17.1031 6.2503 17.0022 6.25C17.0015 6.25 17.0007 6.25 17 6.25H16.9997H13C12.5858 6.25 12.25 6.58579 12.25 7C12.25 7.41421 12.5858 7.75 13 7.75H15.1893L10.5803 12.359C10.3956 12.2941 10.1995 12.26 10 12.26H5C4.91585 12.26 4.83232 12.2661 4.75 12.278V6C4.75 5.66848 4.8817 5.35054 5.11612 5.11612ZM4.75 14.01V18C4.75 18.3315 4.8817 18.6495 5.11612 18.8839C5.35054 19.1183 5.66848 19.25 6 19.25H10.07C10.11 19.2383 10.1468 19.2168 10.1768 19.1868C10.2237 19.1399 10.25 19.0763 10.25 19.01V14.01C10.25 13.9437 10.2237 13.8801 10.1768 13.8332C10.1299 13.7863 10.0663 13.76 10 13.76H5C4.9337 13.76 4.87011 13.7863 4.82322 13.8332C4.77634 13.8801 4.75 13.9437 4.75 14.01ZM3.25 14.01V6C3.25 5.27065 3.53973 4.57118 4.05546 4.05546C4.57118 3.53973 5.27065 3.25 6 3.25H18C18.7293 3.25 19.4288 3.53973 19.9445 4.05546C20.4603 4.57118 20.75 5.27065 20.75 6V18C20.75 18.7293 20.4603 19.4288 19.9445 19.9445C19.4288 20.4603 18.7293 20.75 18 20.75H10.187C10.1251 20.7566 10.0627 20.76 10 20.76H5C4.53587 20.76 4.09075 20.5756 3.76256 20.2474C3.43438 19.9193 3.25 19.4741 3.25 19.01V18V14.01Z" })); }); var _default = ExpandIcon; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/icons/evolve-icon.js": /*!***********************************************************!*\ !*** ../modules/ai/assets/js/editor/icons/evolve-icon.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var EvolveIcon = _react.default.forwardRef(function (props, ref) { return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({ viewBox: "0 0 24 24" }, props, { ref: ref }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M2.30691 2.71291C2.27024 2.80134 2.25 2.89831 2.25 3V8C2.25 8.41421 2.58579 8.75 3 8.75C3.41421 8.75 3.75 8.41421 3.75 8V4.81066L10.0056 11.0663L10.0057 11.0663C10.8022 11.8631 11.2497 12.9434 11.25 14.07V14.0702V15V21C11.25 21.4142 11.5858 21.75 12 21.75C12.4142 21.75 12.75 21.4142 12.75 21V15V14.0702V14.07C12.7503 12.9434 13.1979 11.863 13.9944 11.0663L20.25 4.81066V8C20.25 8.41421 20.5858 8.75 21 8.75C21.4142 8.75 21.75 8.41421 21.75 8V3C21.75 2.98706 21.7497 2.97419 21.749 2.96141C21.7446 2.87376 21.7251 2.79009 21.6931 2.71291C21.6565 2.62445 21.6022 2.54158 21.5303 2.46967C21.4584 2.39776 21.3755 2.34351 21.2871 2.30691C21.1987 2.27024 21.1017 2.25 21 2.25H16C15.5858 2.25 15.25 2.58579 15.25 3C15.25 3.41421 15.5858 3.75 16 3.75H19.1893L12.9337 10.0057L12.9336 10.0057C12.5656 10.3739 12.2526 10.7867 12 11.2316C11.7474 10.7867 11.4344 10.3739 11.0664 10.0057L11.0663 10.0057L4.81066 3.75H8C8.41421 3.75 8.75 3.41421 8.75 3C8.75 2.58579 8.41421 2.25 8 2.25H3C2.7937 2.25 2.60686 2.33329 2.47126 2.46808C2.47073 2.46861 2.4702 2.46914 2.46967 2.46967C2.46914 2.4702 2.46861 2.47073 2.46808 2.47126C2.39696 2.5428 2.34324 2.62511 2.30691 2.71291Z" })); }); var _default = EvolveIcon; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/icons/expand-icon.js": /*!***********************************************************!*\ !*** ../modules/ai/assets/js/editor/icons/expand-icon.js ***! \***********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var ExpandIcon = _react.default.forwardRef(function (props, ref) { return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({ viewBox: "0 0 24 24" }, props, { ref: ref }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M16 3.25C15.5858 3.25 15.25 3.58579 15.25 4C15.25 4.41421 15.5858 4.75 16 4.75H18.1893L13.4697 9.46967C13.1768 9.76256 13.1768 10.2374 13.4697 10.5303C13.7626 10.8232 14.2374 10.8232 14.5303 10.5303L19.25 5.81066V8C19.25 8.41421 19.5858 8.75 20 8.75C20.4142 8.75 20.75 8.41421 20.75 8V4C20.75 3.80806 20.6768 3.61612 20.5303 3.46967C20.4584 3.39776 20.3755 3.34351 20.2871 3.30691C20.1987 3.27024 20.1017 3.25 20 3.25H16ZM4 15.25C4.41421 15.25 4.75 15.5858 4.75 16V18.1893L9.46967 13.4697C9.76256 13.1768 10.2374 13.1768 10.5303 13.4697C10.8232 13.7626 10.8232 14.2374 10.5303 14.5303L5.81066 19.25H8C8.41421 19.25 8.75 19.5858 8.75 20C8.75 20.4142 8.41421 20.75 8 20.75H4C3.80806 20.75 3.61612 20.6768 3.46967 20.5303C3.39776 20.4584 3.34351 20.3755 3.30691 20.2871C3.27024 20.1987 3.25 20.1017 3.25 20V16C3.25 15.5858 3.58579 15.25 4 15.25ZM20.75 16V20C20.75 20.1017 20.7298 20.1987 20.6931 20.2871C20.6565 20.3755 20.6022 20.4584 20.5303 20.5303C20.4584 20.6022 20.3755 20.6565 20.2871 20.6931C20.2099 20.7251 20.1262 20.7446 20.0386 20.749C20.0258 20.7497 20.0129 20.75 20 20.75H16C15.5858 20.75 15.25 20.4142 15.25 20C15.25 19.5858 15.5858 19.25 16 19.25H18.1893L13.4697 14.5303C13.1768 14.2374 13.1768 13.7626 13.4697 13.4697C13.7626 13.1768 14.2374 13.1768 14.5303 13.4697L19.25 18.1893V16C19.25 15.5858 19.5858 15.25 20 15.25C20.4142 15.25 20.75 15.5858 20.75 16ZM3.71291 3.30691C3.80134 3.27024 3.89831 3.25 4 3.25H8C8.41421 3.25 8.75 3.58579 8.75 4C8.75 4.41421 8.41421 4.75 8 4.75H5.81066L10.5303 9.46967C10.8232 9.76256 10.8232 10.2374 10.5303 10.5303C10.2374 10.8232 9.76256 10.8232 9.46967 10.5303L4.75 5.81066V8C4.75 8.41421 4.41421 8.75 4 8.75C3.58579 8.75 3.25 8.41421 3.25 8V4C3.25 3.7937 3.33329 3.60686 3.46808 3.47126C3.46861 3.47073 3.46914 3.4702 3.46967 3.46967C3.4702 3.46914 3.47073 3.46861 3.47126 3.46808C3.5428 3.39696 3.62511 3.34324 3.71291 3.30691Z" })); }); var _default = ExpandIcon; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/icons/redo-icon.js": /*!*********************************************************!*\ !*** ../modules/ai/assets/js/editor/icons/redo-icon.js ***! \*********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var RedoIcon = _react.default.forwardRef(function (props, ref) { return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({ viewBox: "0 0 24 24" }, props, { ref: ref }), /*#__PURE__*/_react.default.createElement("path", { d: "M15.5303 5.46967C15.2374 5.17678 14.7626 5.17678 14.4697 5.46967C14.1768 5.76256 14.1768 6.23744 14.4697 6.53033L17.1893 9.25H8C6.74022 9.25 5.53204 9.75044 4.64124 10.6412C3.75044 11.532 3.25 12.7402 3.25 14C3.25 15.2598 3.75044 16.468 4.64124 17.3588C5.53204 18.2496 6.74022 18.75 8 18.75H9C9.41421 18.75 9.75 18.4142 9.75 18C9.75 17.5858 9.41421 17.25 9 17.25H8C7.13805 17.25 6.3114 16.9076 5.7019 16.2981C5.09241 15.6886 4.75 14.862 4.75 14C4.75 13.138 5.09241 12.3114 5.7019 11.7019C6.3114 11.0924 7.13805 10.75 8 10.75H17.1893L14.4697 13.4697C14.1768 13.7626 14.1768 14.2374 14.4697 14.5303C14.7626 14.8232 15.2374 14.8232 15.5303 14.5303L19.5303 10.5303C19.6768 10.3839 19.75 10.1919 19.75 10C19.75 9.89831 19.7298 9.80134 19.6931 9.71291C19.6565 9.62445 19.6022 9.54158 19.5303 9.46967L15.5303 5.46967Z" })); }); var _default = RedoIcon; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/icons/refresh-icon.js": /*!************************************************************!*\ !*** ../modules/ai/assets/js/editor/icons/refresh-icon.js ***! \************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var RefreshIcon = _react.default.forwardRef(function (props, ref) { return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({ viewBox: "0 0 24 24" }, props, { ref: ref }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.55012 4.45178C9.23098 3.48072 11.1845 3.08925 13.1097 3.33767C15.035 3.58609 16.8251 4.46061 18.2045 5.82653C19.5838 7.19245 20.4757 8.97399 20.743 10.8967C20.8 11.307 20.5136 11.6858 20.1033 11.7428C19.6931 11.7998 19.3142 11.5135 19.2572 11.1032C19.0353 9.50635 18.2945 8.02677 17.149 6.89236C16.0035 5.75795 14.5167 5.03165 12.9178 4.82534C11.3189 4.61902 9.69644 4.94414 8.30047 5.75061C7.24361 6.36117 6.36093 7.22198 5.72541 8.24995H8.00009C8.41431 8.24995 8.75009 8.58574 8.75009 8.99995C8.75009 9.41417 8.41431 9.74995 8.00009 9.74995H4.51686C4.5055 9.75021 4.49412 9.75021 4.48272 9.74995H4.00009C3.58588 9.74995 3.25009 9.41417 3.25009 8.99995V4.99995C3.25009 4.58574 3.58588 4.24995 4.00009 4.24995C4.41431 4.24995 4.75009 4.58574 4.75009 4.99995V7.00691C5.48358 5.96916 6.43655 5.0951 7.55012 4.45178Z" }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.89686 12.2571C4.30713 12.2001 4.68594 12.4864 4.74295 12.8967C4.96487 14.4936 5.70565 15.9731 6.85119 17.1075C7.99673 18.242 9.48347 18.9683 11.0824 19.1746C12.6813 19.3809 14.3037 19.0558 15.6997 18.2493C16.7566 17.6387 17.6393 16.7779 18.2748 15.75H16.0001C15.5859 15.75 15.2501 15.4142 15.2501 15C15.2501 14.5857 15.5859 14.25 16.0001 14.25H19.4833C19.4947 14.2497 19.5061 14.2497 19.5175 14.25H20.0001C20.4143 14.25 20.7501 14.5857 20.7501 15V19C20.7501 19.4142 20.4143 19.75 20.0001 19.75C19.5859 19.75 19.2501 19.4142 19.2501 19V16.993C18.5166 18.0307 17.5636 18.9048 16.4501 19.5481C14.7692 20.5192 12.8157 20.9107 10.8904 20.6622C8.9652 20.4138 7.17504 19.5393 5.79572 18.1734C4.4164 16.8074 3.52443 15.0259 3.25723 13.1032C3.20022 12.6929 3.48658 12.3141 3.89686 12.2571Z" })); }); var _default = RefreshIcon; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/icons/undo-icon.js": /*!*********************************************************!*\ !*** ../modules/ai/assets/js/editor/icons/undo-icon.js ***! \*********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var UndoIcon = _react.default.forwardRef(function (props, ref) { return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({ viewBox: "0 0 24 24" }, props, { ref: ref }), /*#__PURE__*/_react.default.createElement("path", { d: "M9.53033 6.53033C9.82322 6.23744 9.82322 5.76256 9.53033 5.46967C9.23744 5.17678 8.76256 5.17678 8.46967 5.46967L4.46967 9.46967C4.39776 9.54158 4.34351 9.62445 4.30691 9.71291C4.27024 9.80134 4.25 9.89831 4.25 10C4.25 10.1017 4.27024 10.1987 4.30691 10.2871C4.34351 10.3755 4.39776 10.4584 4.46967 10.5303L8.46967 14.5303C8.76256 14.8232 9.23744 14.8232 9.53033 14.5303C9.82322 14.2374 9.82322 13.7626 9.53033 13.4697L6.81066 10.75H16C16.862 10.75 17.6886 11.0924 18.2981 11.7019C18.9076 12.3114 19.25 13.138 19.25 14C19.25 14.862 18.9076 15.6886 18.2981 16.2981C17.6886 16.9076 16.862 17.25 16 17.25H15C14.5858 17.25 14.25 17.5858 14.25 18C14.25 18.4142 14.5858 18.75 15 18.75H16C17.2598 18.75 18.468 18.2496 19.3588 17.3588C20.2496 16.468 20.75 15.2598 20.75 14C20.75 12.7402 20.2496 11.532 19.3588 10.6412C18.468 9.75044 17.2598 9.25 16 9.25H6.81066L9.53033 6.53033Z" })); }); var _default = UndoIcon; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/icons/wand-icon.js": /*!*********************************************************!*\ !*** ../modules/ai/assets/js/editor/icons/wand-icon.js ***! \*********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var WandIcon = _react.default.forwardRef(function (props, ref) { return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({ viewBox: "0 0 24 24" }, props, { ref: ref }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9 2.25C9.41421 2.25 9.75 2.58579 9.75 3C9.75 3.33152 9.8817 3.64946 10.1161 3.88388C10.3505 4.1183 10.6685 4.25 11 4.25C11.4142 4.25 11.75 4.58579 11.75 5C11.75 5.41421 11.4142 5.75 11 5.75C10.6685 5.75 10.3505 5.8817 10.1161 6.11612C9.8817 6.35054 9.75 6.66848 9.75 7C9.75 7.41421 9.41421 7.75 9 7.75C8.58579 7.75 8.25 7.41421 8.25 7C8.25 6.66848 8.1183 6.35054 7.88388 6.11612C7.64946 5.8817 7.33152 5.75 7 5.75C6.58579 5.75 6.25 5.41421 6.25 5C6.25 4.58579 6.58579 4.25 7 4.25C7.33152 4.25 7.64946 4.1183 7.88388 3.88388C8.1183 3.64946 8.25 3.33152 8.25 3C8.25 2.58579 8.58579 2.25 9 2.25ZM9 4.88746C8.98182 4.90673 8.96333 4.92576 8.94454 4.94454C8.92576 4.96333 8.90673 4.98182 8.88746 5C8.90673 5.01818 8.92576 5.03667 8.94454 5.05546C8.96333 5.07424 8.98182 5.09327 9 5.11254C9.01818 5.09327 9.03667 5.07424 9.05546 5.05546C9.07424 5.03667 9.09327 5.01818 9.11254 5C9.09327 4.98182 9.07424 4.96333 9.05546 4.94454C9.03667 4.92576 9.01818 4.90673 9 4.88746Z" }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M18.5303 2.46967C18.2374 2.17678 17.7626 2.17678 17.4697 2.46967L2.46967 17.4697C2.17678 17.7626 2.17678 18.2374 2.46967 18.5303L5.46967 21.5303C5.76256 21.8232 6.23744 21.8232 6.53033 21.5303L21.5303 6.53033C21.8232 6.23744 21.8232 5.76256 21.5303 5.46967L18.5303 2.46967ZM18 7.93934L19.9393 6L18 4.06066L16.0607 6L18 7.93934ZM15 7.06066L16.9393 9L6 19.9393L4.06066 18L15 7.06066Z" }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M19.75 13C19.75 12.5858 19.4142 12.25 19 12.25C18.5858 12.25 18.25 12.5858 18.25 13C18.25 13.3315 18.1183 13.6495 17.8839 13.8839C17.6495 14.1183 17.3315 14.25 17 14.25C16.5858 14.25 16.25 14.5858 16.25 15C16.25 15.4142 16.5858 15.75 17 15.75C17.3315 15.75 17.6495 15.8817 17.8839 16.1161C18.1183 16.3505 18.25 16.6685 18.25 17C18.25 17.4142 18.5858 17.75 19 17.75C19.4142 17.75 19.75 17.4142 19.75 17C19.75 16.6685 19.8817 16.3505 20.1161 16.1161C20.3505 15.8817 20.6685 15.75 21 15.75C21.4142 15.75 21.75 15.4142 21.75 15C21.75 14.5858 21.4142 14.25 21 14.25C20.6685 14.25 20.3505 14.1183 20.1161 13.8839C19.8817 13.6495 19.75 13.3315 19.75 13ZM18.9445 14.9445C18.9633 14.9258 18.9818 14.9067 19 14.8875C19.0182 14.9067 19.0367 14.9258 19.0555 14.9445C19.0742 14.9633 19.0933 14.9818 19.1125 15C19.0933 15.0182 19.0742 15.0367 19.0555 15.0555C19.0367 15.0742 19.0182 15.0933 19 15.1125C18.9818 15.0933 18.9633 15.0742 18.9445 15.0555C18.9258 15.0367 18.9067 15.0182 18.8875 15C18.9067 14.9818 18.9258 14.9633 18.9445 14.9445Z" })); }); var _default = WandIcon; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/icons/zoom-in-icon.js": /*!************************************************************!*\ !*** ../modules/ai/assets/js/editor/icons/zoom-in-icon.js ***! \************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var ZoomInIcon = _react.default.forwardRef(function (props, ref) { return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({ viewBox: "0 0 24 24" }, props, { ref: ref }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10 3.75C6.54822 3.75 3.75 6.54822 3.75 10C3.75 13.4518 6.54822 16.25 10 16.25C13.4518 16.25 16.25 13.4518 16.25 10C16.25 6.54822 13.4518 3.75 10 3.75ZM2.25 10C2.25 5.71979 5.71979 2.25 10 2.25C14.2802 2.25 17.75 5.71979 17.75 10C17.75 14.2802 14.2802 17.75 10 17.75C5.71979 17.75 2.25 14.2802 2.25 10Z" }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.25 10C6.25 9.58579 6.58579 9.25 7 9.25H13C13.4142 9.25 13.75 9.58579 13.75 10C13.75 10.4142 13.4142 10.75 13 10.75H7C6.58579 10.75 6.25 10.4142 6.25 10Z" }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10 6.25C10.4142 6.25 10.75 6.58579 10.75 7V13C10.75 13.4142 10.4142 13.75 10 13.75C9.58579 13.75 9.25 13.4142 9.25 13V7C9.25 6.58579 9.58579 6.25 10 6.25Z" }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M14.4697 14.4697C14.7626 14.1768 15.2374 14.1768 15.5303 14.4697L21.5303 20.4697C21.8232 20.7626 21.8232 21.2374 21.5303 21.5303C21.2374 21.8232 20.7626 21.8232 20.4697 21.5303L14.4697 15.5303C14.1768 15.2374 14.1768 14.7626 14.4697 14.4697Z" })); }); var _default = ZoomInIcon; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/media-dialog.js": /*!******************************************************!*\ !*** ../modules/ai/assets/js/editor/media-dialog.js ***! \******************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); var _promptDialog = _interopRequireDefault(__webpack_require__(/*! ./components/prompt-dialog */ "../modules/ai/assets/js/editor/components/prompt-dialog.js")); var _formMedia = _interopRequireDefault(__webpack_require__(/*! ./pages/form-media */ "../modules/ai/assets/js/editor/pages/form-media/index.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } var MediaDialog = function MediaDialog(_ref) { var onClose = _ref.onClose, DialogProps = _ref.DialogProps, getControlValue = _ref.getControlValue, controlView = _ref.controlView, additionalOptions = _ref.additionalOptions, credits = _ref.credits, maybeRenderUpgradeChip = _ref.maybeRenderUpgradeChip; var _useState = (0, _react.useState)(false), _useState2 = (0, _slicedToArray2.default)(_useState, 2), hasUnsavedChanges = _useState2[0], setHasUnsavedChanges = _useState2[1]; var _useState3 = (0, _react.useState)(false), _useState4 = (0, _slicedToArray2.default)(_useState3, 2), showUnsavedChangeAlert = _useState4[0], setShowUnsavedChangeAlert = _useState4[1]; var onCloseIntent = function onCloseIntent() { if (hasUnsavedChanges) { setShowUnsavedChangeAlert(true); return; } onClose(); }; return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_promptDialog.default, (0, _extends2.default)({ onClose: onCloseIntent, maxWidth: "lg" }, DialogProps), /*#__PURE__*/_react.default.createElement(_promptDialog.default.Header, { onClose: onCloseIntent }, maybeRenderUpgradeChip()), /*#__PURE__*/_react.default.createElement(_ui.Divider, null), /*#__PURE__*/_react.default.createElement(_formMedia.default, { onClose: onClose, getControlValue: getControlValue, controlView: controlView, additionalOptions: additionalOptions, credits: credits, setHasUnsavedChanges: setHasUnsavedChanges })), showUnsavedChangeAlert && /*#__PURE__*/_react.default.createElement(_ui.Dialog, { open: true, onClose: onClose, "aria-labelledby": "unsaved-changes-alert-title", "aria-describedby": "unsaved-changes-alert-description" }, /*#__PURE__*/_react.default.createElement(_ui.DialogTitle, { id: "unsaved-changes-alert-title", sx: { borderBottom: 0 } }, __('Leave Elementor AI?', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.DialogContent, null, /*#__PURE__*/_react.default.createElement(_ui.DialogContentText, { id: "unsaved-changes-alert-description" }, __('Images will be gone forever and we won’t be able to recover them.', 'elementor'))), /*#__PURE__*/_react.default.createElement(_ui.DialogActions, null, /*#__PURE__*/_react.default.createElement(_ui.Button, { onClick: function onClick() { return setShowUnsavedChangeAlert(false); }, color: "secondary" }, __('Cancel', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Button, { onClick: onClose, color: "error", variant: "contained" }, __('Yes, leave', 'elementor'))))); }; MediaDialog.propTypes = { onClose: PropTypes.func.isRequired, DialogProps: PropTypes.object, getControlValue: PropTypes.func.isRequired, controlView: PropTypes.object, additionalOptions: PropTypes.object, credits: PropTypes.number, maybeRenderUpgradeChip: PropTypes.func }; var _default = MediaDialog; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/page-content.js": /*!******************************************************!*\ !*** ../modules/ai/assets/js/editor/page-content.js ***! \******************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _formText = _interopRequireDefault(__webpack_require__(/*! ./pages/form-text */ "../modules/ai/assets/js/editor/pages/form-text/index.js")); var _connect = _interopRequireDefault(__webpack_require__(/*! ./pages/connect */ "../modules/ai/assets/js/editor/pages/connect/index.js")); var _formCode = _interopRequireDefault(__webpack_require__(/*! ./pages/form-code */ "../modules/ai/assets/js/editor/pages/form-code/index.js")); var _getStarted = _interopRequireDefault(__webpack_require__(/*! ./pages/get-started */ "../modules/ai/assets/js/editor/pages/get-started/index.js")); var _loader = _interopRequireDefault(__webpack_require__(/*! ./components/loader */ "../modules/ai/assets/js/editor/components/loader.js")); var _useUserInfo2 = _interopRequireDefault(__webpack_require__(/*! ./hooks/use-user-info */ "../modules/ai/assets/js/editor/hooks/use-user-info.js")); var _wizardDialog = _interopRequireDefault(__webpack_require__(/*! ./components/wizard-dialog */ "../modules/ai/assets/js/editor/components/wizard-dialog.js")); var _promptDialog = _interopRequireDefault(__webpack_require__(/*! ./components/prompt-dialog */ "../modules/ai/assets/js/editor/components/prompt-dialog.js")); var _upgradeChip = _interopRequireDefault(__webpack_require__(/*! ./components/upgrade-chip */ "../modules/ai/assets/js/editor/components/upgrade-chip.js")); var _mediaDialog = _interopRequireDefault(__webpack_require__(/*! ./media-dialog */ "../modules/ai/assets/js/editor/media-dialog.js")); var PageContent = function PageContent(_ref) { var type = _ref.type, controlType = _ref.controlType, onClose = _ref.onClose, onConnect = _ref.onConnect, getControlValue = _ref.getControlValue, setControlValue = _ref.setControlValue, controlView = _ref.controlView, additionalOptions = _ref.additionalOptions; var _useUserInfo = (0, _useUserInfo2.default)(), isLoading = _useUserInfo.isLoading, isConnected = _useUserInfo.isConnected, isGetStarted = _useUserInfo.isGetStarted, connectUrl = _useUserInfo.connectUrl, fetchData = _useUserInfo.fetchData, hasSubscription = _useUserInfo.hasSubscription, credits = _useUserInfo.credits, usagePercentage = _useUserInfo.usagePercentage; var promptDialogStyleProps = { sx: { '& .MuiDialog-container': { alignItems: 'flex-start', mt: 'media' === type ? '2.5vh' : '18vh' } }, PaperProps: { sx: { m: 0, maxHeight: 'media' === type ? '95vh' : '76vh', height: !isLoading && 'media' === type ? '95vh' : 'auto' } } }; var maybeRenderUpgradeChip = function maybeRenderUpgradeChip() { var needsUpgradeChip = !hasSubscription || 80 <= usagePercentage; if (!needsUpgradeChip) { return; } return /*#__PURE__*/_react.default.createElement(_upgradeChip.default, { hasSubscription: hasSubscription, usagePercentage: usagePercentage }); }; if (isLoading) { return /*#__PURE__*/_react.default.createElement(_promptDialog.default, (0, _extends2.default)({ onClose: onClose }, promptDialogStyleProps, { maxWidth: 'media' === type ? 'lg' : 'sm' }), /*#__PURE__*/_react.default.createElement(_promptDialog.default.Header, { onClose: onClose }), /*#__PURE__*/_react.default.createElement(_promptDialog.default.Content, { dividers: true }, /*#__PURE__*/_react.default.createElement(_loader.default, null))); } if (!isConnected) { return /*#__PURE__*/_react.default.createElement(_wizardDialog.default, { onClose: onClose }, /*#__PURE__*/_react.default.createElement(_wizardDialog.default.Header, { onClose: onClose }), /*#__PURE__*/_react.default.createElement(_wizardDialog.default.Content, { dividers: true }, /*#__PURE__*/_react.default.createElement(_connect.default, { connectUrl: connectUrl, onSuccess: function onSuccess(data) { onConnect(data); fetchData(); } }))); } if (!isGetStarted) { return /*#__PURE__*/_react.default.createElement(_wizardDialog.default, { onClose: onClose }, /*#__PURE__*/_react.default.createElement(_wizardDialog.default.Header, { onClose: onClose }), /*#__PURE__*/_react.default.createElement(_wizardDialog.default.Content, { dividers: true }, /*#__PURE__*/_react.default.createElement(_getStarted.default, { onSuccess: fetchData }))); } if ('media' === type) { return /*#__PURE__*/_react.default.createElement(_mediaDialog.default, { onClose: onClose, getControlValue: getControlValue, controlView: controlView, additionalOptions: additionalOptions, credits: credits, maybeRenderUpgradeChip: maybeRenderUpgradeChip, DialogProps: promptDialogStyleProps }); } if ('code' === type) { return /*#__PURE__*/_react.default.createElement(_promptDialog.default, (0, _extends2.default)({ onClose: onClose }, promptDialogStyleProps), /*#__PURE__*/_react.default.createElement(_promptDialog.default.Header, { onClose: onClose }, maybeRenderUpgradeChip()), /*#__PURE__*/_react.default.createElement(_promptDialog.default.Content, { dividers: true }, /*#__PURE__*/_react.default.createElement(_formCode.default, { onClose: onClose, getControlValue: getControlValue, setControlValue: setControlValue, additionalOptions: additionalOptions, credits: credits, usagePercentage: usagePercentage }))); } return /*#__PURE__*/_react.default.createElement(_promptDialog.default, (0, _extends2.default)({ onClose: onClose }, promptDialogStyleProps), /*#__PURE__*/_react.default.createElement(_promptDialog.default.Header, { onClose: onClose }, maybeRenderUpgradeChip()), /*#__PURE__*/_react.default.createElement(_promptDialog.default.Content, { dividers: true }, /*#__PURE__*/_react.default.createElement(_formText.default, { type: type, controlType: controlType, onClose: onClose, getControlValue: getControlValue, setControlValue: setControlValue, additionalOptions: additionalOptions, credits: credits, usagePercentage: usagePercentage }))); }; PageContent.propTypes = { type: PropTypes.string, controlType: PropTypes.string, onClose: PropTypes.func.isRequired, onConnect: PropTypes.func.isRequired, getControlValue: PropTypes.func.isRequired, setControlValue: PropTypes.func.isRequired, additionalOptions: PropTypes.object, controlView: PropTypes.object }; var _default = PageContent; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/pages/connect/index.js": /*!*************************************************************!*\ !*** ../modules/ai/assets/js/editor/pages/connect/index.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } var Connect = function Connect(_ref) { var connectUrl = _ref.connectUrl, onSuccess = _ref.onSuccess; var approveButtonRef = (0, _react.useRef)(); (0, _react.useEffect)(function () { jQuery(approveButtonRef.current).elementorConnect({ success: function success(_, data) { return onSuccess(data); }, error: function error() { throw new Error('Elementor AI: Failed to connect.'); } }); }, []); return /*#__PURE__*/_react.default.createElement(_ui.Stack, { alignItems: "center", gap: 5 }, /*#__PURE__*/_react.default.createElement(_icons.AIIcon, { sx: { color: 'text.primary', fontSize: '60px', mb: 3 } }), /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "h4", sx: { color: 'text.primary' } }, __('Step into the future with Elementor AI', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "body2" }, __('Create smarter with AI text and code generators built right into the editor.', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "caption", sx: { maxWidth: 520, textAlign: 'center' } }, __('By clicking "Connect", I approve the ', 'elementor'), /*#__PURE__*/_react.default.createElement(_ui.Link, { href: "https://go.elementor.com/ai-terms/", target: "_blank", color: "info.main" }, __('Terms of Service', 'elementor')), ' & ', /*#__PURE__*/_react.default.createElement(_ui.Link, { href: "https://go.elementor.com/ai-privacy-policy/", target: "_blank", color: "info.main" }, __('Privacy Policy', 'elementor')), __(' of the Elementor AI service.', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Button, { ref: approveButtonRef, href: connectUrl, variant: "contained", sx: { mt: 3, '&:hover': { color: 'primary.contrastText' } } }, __('Connect', 'elementor'))); }; Connect.propTypes = { connectUrl: PropTypes.string.isRequired, onSuccess: PropTypes.func.isRequired }; var _default = Connect; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/pages/form-code/code-block.js": /*!********************************************************************!*\ !*** ../modules/ai/assets/js/editor/pages/form-code/code-block.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "../node_modules/@babel/runtime/helpers/objectWithoutProperties.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _textarea = _interopRequireDefault(__webpack_require__(/*! ../../components/textarea */ "../modules/ai/assets/js/editor/components/textarea.js")); var _excluded = ["node", "inline", "children", "defaultValue", "onInsert"]; function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } var CodeBlock = function CodeBlock(_ref) { var node = _ref.node, inline = _ref.inline, children = _ref.children, defaultValue = _ref.defaultValue, onInsert = _ref.onInsert, props = (0, _objectWithoutProperties2.default)(_ref, _excluded); var codeBlockInput = (0, _react.useRef)(null); if (inline) { return /*#__PURE__*/_react.default.createElement("code", props); } return /*#__PURE__*/_react.default.createElement(_ui.Box, { sx: { position: 'relative' }, dir: "ltr" }, /*#__PURE__*/_react.default.createElement(_textarea.default, (0, _extends2.default)({ fullWidth: true, ref: codeBlockInput, defaultValue: children[0], sx: { mb: 3 }, helperText: __('Code generated by AI may be inaccurate.', 'elementor') }, props)), /*#__PURE__*/_react.default.createElement(_ui.Button, { size: "small", variant: "contained", onClick: function onClick() { return onInsert(defaultValue + '\n' + codeBlockInput.current.value); }, sx: { position: 'absolute', right: '11px /* @noflip */', bottom: '44px' } }, __('Insert', 'elementor'))); }; CodeBlock.propTypes = { node: PropTypes.object, inline: PropTypes.bool, children: PropTypes.arrayOf(PropTypes.node).isRequired, defaultValue: PropTypes.string, onInsert: PropTypes.func.isRequired }; var _default = CodeBlock; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/pages/form-code/index.js": /*!***************************************************************!*\ !*** ../modules/ai/assets/js/editor/pages/form-code/index.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _reactMarkdown = _interopRequireDefault(__webpack_require__(/*! react-markdown */ "../node_modules/react-markdown/index.js")); var _actionsData = __webpack_require__(/*! ../../actions-data */ "../modules/ai/assets/js/editor/actions-data.js"); var _loader = _interopRequireDefault(__webpack_require__(/*! ../../components/loader */ "../modules/ai/assets/js/editor/components/loader.js")); var _promptSearch = _interopRequireDefault(__webpack_require__(/*! ../../components/prompt-search */ "../modules/ai/assets/js/editor/components/prompt-search.js")); var _promptSuggestions = _interopRequireDefault(__webpack_require__(/*! ../../components/prompt-suggestions */ "../modules/ai/assets/js/editor/components/prompt-suggestions.js")); var _generateButton = _interopRequireDefault(__webpack_require__(/*! ../../components/generate-button */ "../modules/ai/assets/js/editor/components/generate-button.js")); var _promptErrorMessage = _interopRequireDefault(__webpack_require__(/*! ../../components/prompt-error-message */ "../modules/ai/assets/js/editor/components/prompt-error-message.js")); var _codeBlock = _interopRequireDefault(__webpack_require__(/*! ./code-block */ "../modules/ai/assets/js/editor/pages/form-code/code-block.js")); var _useCodePrompt2 = _interopRequireDefault(__webpack_require__(/*! ../../hooks/use-code-prompt */ "../modules/ai/assets/js/editor/hooks/use-code-prompt.js")); var _promptCredits = _interopRequireDefault(__webpack_require__(/*! ../../components/prompt-credits */ "../modules/ai/assets/js/editor/components/prompt-credits.js")); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } var CodeDisplayWrapper = (0, _ui.styled)(_ui.Box)(function () { return { '& p': { mb: '10px', fontSize: '13px', lineHeight: '1.5' }, '& pre': { position: 'relative' }, '& textarea': { fontSize: '13px', lineHeight: '1.7' } }; }); var FormCode = function FormCode(_ref) { var onClose = _ref.onClose, getControlValue = _ref.getControlValue, setControlValue = _ref.setControlValue, additionalOptions = _ref.additionalOptions, credits = _ref.credits, usagePercentage = _ref.usagePercentage; var _useCodePrompt = (0, _useCodePrompt2.default)(_objectSpread(_objectSpread({}, additionalOptions), {}, { credits: credits })), data = _useCodePrompt.data, isLoading = _useCodePrompt.isLoading, error = _useCodePrompt.error, reset = _useCodePrompt.reset, send = _useCodePrompt.send, sendUsageData = _useCodePrompt.sendUsageData; var _useState = (0, _react.useState)(''), _useState2 = (0, _slicedToArray2.default)(_useState, 2), prompt = _useState2[0], setPrompt = _useState2[1]; var lastRun = (0, _react.useRef)(function () {}); var autocompleteItems = 'css' === (additionalOptions === null || additionalOptions === void 0 ? void 0 : additionalOptions.codeLanguage) ? _actionsData.codeCssAutocomplete : _actionsData.codeHtmlAutocomplete; var showSuggestions = !prompt; var handleSubmit = /*#__PURE__*/function () { var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(event) { return _regenerator.default.wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { case 0: event.preventDefault(); lastRun.current = function () { return send(prompt); }; lastRun.current(); case 3: case "end": return _context.stop(); } }, _callee); })); return function handleSubmit(_x) { return _ref2.apply(this, arguments); }; }(); var applyPrompt = function applyPrompt(inputText) { sendUsageData(); setControlValue(inputText); onClose(); }; if (isLoading) { return /*#__PURE__*/_react.default.createElement(_loader.default, null); } return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, error && /*#__PURE__*/_react.default.createElement(_promptErrorMessage.default, { error: error, onRetry: lastRun.current, sx: { mb: 6 } }), !data.result && /*#__PURE__*/_react.default.createElement(_ui.Box, { component: "form", onSubmit: handleSubmit }, /*#__PURE__*/_react.default.createElement(_ui.Box, { sx: { pb: 4 } }, /*#__PURE__*/_react.default.createElement(_promptSearch.default, { placeholder: __('Describe the code you want to use...', 'elementor'), name: "prompt", value: prompt, color: "secondary", onChange: function onChange(event) { return setPrompt(event.target.value); } })), showSuggestions && /*#__PURE__*/_react.default.createElement(_promptSuggestions.default, { suggestions: autocompleteItems, onSelect: setPrompt }), /*#__PURE__*/_react.default.createElement(_ui.Stack, { direction: "row", alignItems: "center", sx: { py: 4, mt: 8 } }, /*#__PURE__*/_react.default.createElement(_promptCredits.default, { usagePercentage: usagePercentage }), /*#__PURE__*/_react.default.createElement(_ui.Stack, { direction: "row", justifyContent: "flex-end", flexGrow: 1 }, /*#__PURE__*/_react.default.createElement(_generateButton.default, null, __('Generate code', 'elementor'))))), data.result && /*#__PURE__*/_react.default.createElement(CodeDisplayWrapper, null, /*#__PURE__*/_react.default.createElement(_reactMarkdown.default, { components: { code: function code(props) { return /*#__PURE__*/_react.default.createElement(_codeBlock.default, (0, _extends2.default)({}, props, { defaultValue: getControlValue(), onInsert: applyPrompt })); } } }, data.result), /*#__PURE__*/_react.default.createElement(_ui.Stack, { direction: "row", alignItems: "center", sx: { mt: 8 } }, /*#__PURE__*/_react.default.createElement(_promptCredits.default, { usagePercentage: usagePercentage }), /*#__PURE__*/_react.default.createElement(_ui.Stack, { direction: "row", gap: 3, justifyContent: "flex-end", flexGrow: 1 }, /*#__PURE__*/_react.default.createElement(_ui.Button, { size: "small", color: "secondary", variant: "text", onClick: reset }, __('New prompt', 'elementor')))))); }; FormCode.propTypes = { onClose: PropTypes.func.isRequired, getControlValue: PropTypes.func.isRequired, setControlValue: PropTypes.func.isRequired, additionalOptions: PropTypes.shape({ codeLanguage: PropTypes.string, htmlMarkup: PropTypes.string, elementId: PropTypes.string, initialCredits: PropTypes.number }), credits: PropTypes.number, usagePercentage: PropTypes.number }; var _default = FormCode; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/pages/form-media/consts/consts.js": /*!************************************************************************!*\ !*** ../modules/ai/assets/js/editor/pages/form-media/consts/consts.js ***! \************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SCREENS = exports.PANELS = exports.IMAGE_PROMPT_SETTINGS = exports.IMAGE_PROMPT_CATEGORIES = exports.IMAGE_ASPECT_RATIO_DIMENSIONS = exports.IMAGE_ASPECT_RATIOS = exports.IMAGE_ACTIONS = void 0; var IMAGE_ACTIONS = { USE: 'use', REFERENCE: 'reference', ZOOM: 'zoom' }; exports.IMAGE_ACTIONS = IMAGE_ACTIONS; var SCREENS = { GENERATE: 'generate', GENERATE_RESULTS: 'generate-results', VARIATIONS: 'variations', GALLERY: 'gallery', IMAGE_EDITOR: 'image-editor', IN_PAINTING: 'in-painting', OUT_PAINTING: 'out-painting' }; exports.SCREENS = SCREENS; var PANELS = { TEXT_TO_IMAGE: 'text-to-image', IMAGE_TO_IMAGE: 'image-to-image', TOOLS: 'tools', IN_PAINTING: 'in-painting', OUT_PAINTING: 'out-painting', UPSCALE: 'upscale' }; exports.PANELS = PANELS; var IMAGE_PROMPT_SETTINGS = { IMAGE_TYPE: 'image_type', STYLE_PRESET: 'style_preset', IMAGE_STRENGTH: 'image_strength', ASPECT_RATIO: 'ratio', ZOOM: 'zoom', UPSCALE_TO: 'upscale_to' }; exports.IMAGE_PROMPT_SETTINGS = IMAGE_PROMPT_SETTINGS; var IMAGE_PROMPT_CATEGORIES = [{ key: '', label: __('None', 'elementor'), subCategories: {} }, { key: 'photographic', label: __('Photographic', 'elementor'), subCategories: { '': __('None', 'elementor'), landscape: __('Landscape', 'elementor'), macro: __('Macro', 'elementor'), portrait: __('Portrait', 'elementor'), 'long-exposure': __('Long Exposure', 'elementor') } }, { key: 'background', label: __('Background', 'elementor'), subCategories: { '': __('None', 'elementor'), floral: __('Floral', 'elementor'), gradient: __('Gradient', 'elementor'), mosaic: __('Mosaic', 'elementor'), neon: __('Neon', 'elementor'), bokeh: __('Bokeh', 'elementor') } }, { key: 'digital-art', label: __('Digital Art', 'elementor'), subCategories: { '': __('None', 'elementor'), amine: __('Anime', 'elementor'), cartoon: __('Cartoon', 'elementor'), cinematic: __('Cinematic', 'elementor'), 'comic-book': __('Comic Book', 'elementor'), 'fantasy-art': __('Fantasy Art', 'elementor'), isometric: __('Isometric', 'elementor'), vector: __('Vector', 'elementor'), 'pixel-art': __('Pixel Art', 'elementor'), 'low-poly': __('Low Poly', 'elementor'), 'neon-punk': __('Neon Punk', 'elementor') } }, { key: 'handmade', label: __('Handmade', 'elementor'), subCategories: { '': __('None', 'elementor'), doodle: __('Doodle', 'elementor'), 'line-art': __('Line Art', 'elementor'), 'oil-painting': __('Oil Painting', 'elementor'), 'pencil-drawing': __('Pencil Drawing', 'elementor'), watercolor: __('Watercolor', 'elementor') } }, { key: '3d', label: __('3D', 'elementor'), subCategories: { '': __('None', 'elementor'), clay: __('Clay', 'elementor'), digital: __('Digital', 'elementor'), origami: __('Origami', 'elementor'), stone: __('Stone', 'elementor'), wood: __('Wood', 'elementor') } }]; exports.IMAGE_PROMPT_CATEGORIES = IMAGE_PROMPT_CATEGORIES; var IMAGE_ASPECT_RATIOS = { '1:1': __('Square', 'elementor') + ' (1:1)', '3:2': __('Landscape', 'elementor') + ' (3:2)', '4:3': __('Landscape', 'elementor') + ' (4:3)', '16:9': __('Landscape', 'elementor') + ' (16:9)', '2:3': __('Portrait', 'elementor') + ' (2:3)', '3:4': __('Portrait', 'elementor') + ' (3:4)', '9:16': __('Portrait', 'elementor') + ' (9:16)' }; exports.IMAGE_ASPECT_RATIOS = IMAGE_ASPECT_RATIOS; var IMAGE_ASPECT_RATIO_DIMENSIONS = { '1:1': { width: 512, height: 512 }, '2:3': { width: 448, height: 640 }, '3:4': { width: 448, height: 640 }, '9:16': { width: 384, height: 704 }, '3:2': { width: 640, height: 448 }, '4:3': { width: 640, height: 448 }, '16:9': { width: 704, height: 384 } }; exports.IMAGE_ASPECT_RATIO_DIMENSIONS = IMAGE_ASPECT_RATIO_DIMENSIONS; /***/ }), /***/ "../modules/ai/assets/js/editor/pages/form-media/index.js": /*!****************************************************************!*\ !*** ../modules/ai/assets/js/editor/pages/form-media/index.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "../node_modules/@babel/runtime/helpers/objectWithoutProperties.js")); var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _useImagePrompt2 = _interopRequireDefault(__webpack_require__(/*! ../../hooks/use-image-prompt */ "../modules/ai/assets/js/editor/hooks/use-image-prompt.js")); var _useImageUpload2 = _interopRequireDefault(__webpack_require__(/*! ../../hooks/use-image-upload */ "../modules/ai/assets/js/editor/hooks/use-image-upload.js")); var _useImagePromptSettings = _interopRequireDefault(__webpack_require__(/*! ../../hooks/use-image-prompt-settings */ "../modules/ai/assets/js/editor/hooks/use-image-prompt-settings.js")); var _useImageScreenPanel2 = _interopRequireDefault(__webpack_require__(/*! ../../hooks/use-image-screen-panel */ "../modules/ai/assets/js/editor/hooks/use-image-screen-panel.js")); var _consts = __webpack_require__(/*! ./consts/consts */ "../modules/ai/assets/js/editor/pages/form-media/consts/consts.js"); var _screen = __webpack_require__(/*! ./screens/screen */ "../modules/ai/assets/js/editor/pages/form-media/screens/screen.js"); var _panelContent = __webpack_require__(/*! ./panel-content/panel-content */ "../modules/ai/assets/js/editor/pages/form-media/panel-content/panel-content.js"); var _panel = _interopRequireDefault(__webpack_require__(/*! ../../components/ui/panel */ "../modules/ai/assets/js/editor/components/ui/panel.js")); var _utils = __webpack_require__(/*! ./utils */ "../modules/ai/assets/js/editor/pages/form-media/utils/index.js"); var _excluded = ["image"]; function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } var FormMedia = function FormMedia(_ref) { var onClose = _ref.onClose, getControlValue = _ref.getControlValue, additionalOptions = _ref.additionalOptions, controlView = _ref.controlView, credits = _ref.credits, setHasUnsavedChanges = _ref.setHasUnsavedChanges; var initialValue = getControlValue() === (additionalOptions === null || additionalOptions === void 0 ? void 0 : additionalOptions.defaultValue) ? { id: '', url: '' } : getControlValue(); var _useState = (0, _react.useState)(initialValue), _useState2 = (0, _slicedToArray2.default)(_useState, 2), editImage = _useState2[0], setEditImage = _useState2[1]; var _useImageScreenPanel = (0, _useImageScreenPanel2.default)((initialValue === null || initialValue === void 0 ? void 0 : initialValue.id) !== '' ? _consts.SCREENS.IMAGE_EDITOR : _consts.SCREENS.GALLERY, '' === initialValue.id && '' === editImage.id ? _consts.PANELS.TEXT_TO_IMAGE : _consts.PANELS.TOOLS), screen = _useImageScreenPanel.screen, setScreen = _useImageScreenPanel.setScreen, panel = _useImageScreenPanel.panel, setPanel = _useImageScreenPanel.setPanel; var _useState3 = (0, _react.useState)(''), _useState4 = (0, _slicedToArray2.default)(_useState3, 2), prompt = _useState4[0], setPrompt = _useState4[1]; var _useState5 = (0, _react.useState)(''), _useState6 = (0, _slicedToArray2.default)(_useState5, 2), maskImage = _useState6[0], setMaskImage = _useState6[1]; var _useImagePromptSettin = (0, _useImagePromptSettings.default)({ style: '' === initialValue.id ? (additionalOptions === null || additionalOptions === void 0 ? void 0 : additionalOptions.defaultImageType) || _consts.IMAGE_PROMPT_CATEGORIES[1].key : '' }), promptSettings = _useImagePromptSettin.promptSettings, updatePromptSettings = _useImagePromptSettin.updatePromptSettings, resetPromptSettings = _useImagePromptSettin.resetPromptSettings; var _useState7 = (0, _react.useState)([]), _useState8 = (0, _slicedToArray2.default)(_useState7, 2), images = _useState8[0], setImages = _useState8[1]; var _useState9 = (0, _react.useState)(false), _useState10 = (0, _slicedToArray2.default)(_useState9, 2), insertToControl = _useState10[0], setInsertToControl = _useState10[1]; var _useImagePrompt = (0, _useImagePrompt2.default)({ result: initialValue, credits: credits, responseId: false }), data = _useImagePrompt.data, isLoading = _useImagePrompt.isLoading, error = _useImagePrompt.error, send = _useImagePrompt.send, sendUsageData = _useImagePrompt.sendUsageData, reset = _useImagePrompt.reset; var _useImageUpload = (0, _useImageUpload2.default)(), attachmentData = _useImageUpload.attachmentData, isUploading = _useImageUpload.isUploading, uploadError = _useImageUpload.uploadError, upload = _useImageUpload.upload, resetUpload = _useImageUpload.resetUpload; var _useState11 = (0, _react.useState)(function () { return !!(editImage !== null && editImage !== void 0 && editImage.url); }), _useState12 = (0, _slicedToArray2.default)(_useState11, 2), shouldWaitForInitialImage = _useState12[0], setShouldWaitForInitialImage = _useState12[1]; var panelActive = !isLoading && !isUploading && !shouldWaitForInitialImage; var currentAspectRatio = promptSettings[_consts.IMAGE_PROMPT_SETTINGS.ASPECT_RATIO]; var viewData = { width: _consts.IMAGE_ASPECT_RATIO_DIMENSIONS[currentAspectRatio].width, height: _consts.IMAGE_ASPECT_RATIO_DIMENSIONS[currentAspectRatio].height, ratio: currentAspectRatio }; var setTool = function setTool(tool) { var newPanel = tool || _consts.PANELS.TOOLS; var newScreen = _consts.SCREENS.IMAGE_EDITOR; switch (tool) { case _consts.PANELS.IMAGE_TO_IMAGE: newScreen = _consts.SCREENS.VARIATIONS; break; case _consts.PANELS.IN_PAINTING: newScreen = _consts.SCREENS.IN_PAINTING; break; case _consts.PANELS.OUT_PAINTING: newScreen = _consts.SCREENS.OUT_PAINTING; break; case _consts.PANELS.UPSCALE: newScreen = _consts.SCREENS.IMAGE_EDITOR; break; } setPanel(newPanel); setScreen(newScreen); }; var setAttachment = function setAttachment() { setHasUnsavedChanges(false); sendUsageData(); controlView.setSettingsModel(attachmentData.image); controlView.applySavedValue(); onClose(); }; // Get ratio from image (0, _react.useEffect)(function () { if (!(editImage !== null && editImage !== void 0 && editImage.url)) { return; } setShouldWaitForInitialImage(true); var img = new Image(); img.src = editImage.url; img.onload = function () { var _getAspectRatioSizes = (0, _utils.getAspectRatioSizes)(img.width, img.height), ratio = _getAspectRatioSizes.ratio; updatePromptSettings((0, _defineProperty2.default)({}, _consts.IMAGE_PROMPT_SETTINGS.ASPECT_RATIO, ratio)); setShouldWaitForInitialImage(false); }; }, [editImage]); // Image Generation (0, _react.useEffect)(function () { if (!isLoading && data !== null && data !== void 0 && data.result && Array.isArray(data === null || data === void 0 ? void 0 : data.result)) { setImages(data === null || data === void 0 ? void 0 : data.result); setScreen(_consts.SCREENS.GENERATE_RESULTS); } }, [isLoading]); // Image Upload and set attachment (0, _react.useEffect)(function () { var _attachmentData$image; if (!isUploading && attachmentData !== null && attachmentData !== void 0 && (_attachmentData$image = attachmentData.image) !== null && _attachmentData$image !== void 0 && _attachmentData$image.id) { if (insertToControl) { setAttachment(attachmentData.image); } else { setEditImage(attachmentData.image); setPanel(_consts.PANELS.TOOLS); setScreen(_consts.SCREENS.IMAGE_EDITOR); } } }, [isUploading]); var maybeUploadImage = function maybeUploadImage(imageToUpload) { var _editImage$image, _editImage$image2, _imageToUpload, _imageToUpload2; var setAsAttachment = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; if (!imageToUpload) { return; } if (setAsAttachment) { setInsertToControl(true); } // Image already uploaded if (editImage !== null && editImage !== void 0 && (_editImage$image = editImage.image) !== null && _editImage$image !== void 0 && _editImage$image.seed && (editImage === null || editImage === void 0 ? void 0 : (_editImage$image2 = editImage.image) === null || _editImage$image2 === void 0 ? void 0 : _editImage$image2.seed) === ((_imageToUpload = imageToUpload) === null || _imageToUpload === void 0 ? void 0 : _imageToUpload.seed)) { if (setAsAttachment) { // Remove inner image property used to avoid duplicate uploads var image = editImage.image, attachment = (0, _objectWithoutProperties2.default)(editImage, _excluded); return setAttachment(attachment); } setPanel(_consts.PANELS.TOOLS); updatePromptSettings((0, _defineProperty2.default)({}, _consts.IMAGE_PROMPT_SETTINGS.ASPECT_RATIO, '1:1')); } // Normalize object to match the upload function if ((_imageToUpload2 = imageToUpload) !== null && _imageToUpload2 !== void 0 && _imageToUpload2.imageUrl) { imageToUpload = _objectSpread(_objectSpread({}, imageToUpload), {}, { image_url: imageToUpload.imageUrl, use_gallery_image: true }); } upload({ image: _objectSpread({}, imageToUpload), prompt: prompt || imageToUpload.prompt }); }; var submitPrompt = function submitPrompt(promptType, userPrompt) { var mask = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; reset(); resetUpload(); setHasUnsavedChanges(true); if (_consts.PANELS.TEXT_TO_IMAGE === promptType) { return send(userPrompt, promptSettings); } if (_consts.PANELS.IN_PAINTING === promptType) { return send(userPrompt, promptSettings, editImage, _consts.PANELS.IN_PAINTING, mask); } if (_consts.PANELS.OUT_PAINTING === promptType) { return send(userPrompt, promptSettings, true, _consts.PANELS.OUT_PAINTING, maskImage); } if (_consts.PANELS.UPSCALE === promptType) { return send(null, promptSettings, editImage, _consts.PANELS.UPSCALE); } return send(prompt, promptSettings, editImage); }; var generateNewPrompt = function generateNewPrompt() { setPrompt(''); setImages([]); setMaskImage(null); setEditImage({ id: '', url: '' }); resetPromptSettings(); setScreen(_consts.SCREENS.GALLERY); setPanel(_consts.PANELS.TEXT_TO_IMAGE); setHasUnsavedChanges(false); reset(); resetUpload(); }; return /*#__PURE__*/_react.default.createElement(_ui.Box, { display: "flex", sx: { overflowY: 'auto' }, height: "100%" }, /*#__PURE__*/_react.default.createElement(_ui.Box, { position: "relative" }, /*#__PURE__*/_react.default.createElement(_panel.default, null, /*#__PURE__*/_react.default.createElement(_panelContent.PanelContent, { error: error || uploadError, prompt: prompt, setPrompt: setPrompt, panelActive: panelActive, generateNewPrompt: generateNewPrompt, promptSettings: promptSettings, updatePromptSettings: updatePromptSettings, submitPrompt: submitPrompt, panel: panel, editImage: editImage, images: images, setTool: setTool, maskImage: maskImage, reset: reset, viewData: viewData }))), /*#__PURE__*/_react.default.createElement(_screen.Screen, { isUploading: isUploading, isLoading: isLoading, screen: screen, images: images, promptSettings: promptSettings, updatePromptSettings: updatePromptSettings, generateNewPrompt: generateNewPrompt, maybeUploadImage: maybeUploadImage, setPrompt: setPrompt, editImage: editImage, setMaskImage: setMaskImage, viewData: viewData, shouldWaitForInitialImage: shouldWaitForInitialImage })); }; FormMedia.propTypes = { getControlValue: PropTypes.func.isRequired, onClose: PropTypes.func.isRequired, additionalOptions: PropTypes.object, controlView: PropTypes.object, credits: PropTypes.number, setHasUnsavedChanges: PropTypes.func.isRequired }; var _default = FormMedia; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/pages/form-media/panel-content/form-controls/prompt-form.js": /*!**************************************************************************************************!*\ !*** ../modules/ai/assets/js/editor/pages/form-media/panel-content/form-controls/prompt-form.js ***! \**************************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); var _consts = __webpack_require__(/*! ../../consts/consts */ "../modules/ai/assets/js/editor/pages/form-media/consts/consts.js"); var _promptActionSelection = _interopRequireDefault(__webpack_require__(/*! ../../../../components/prompt-action-selection */ "../modules/ai/assets/js/editor/components/prompt-action-selection.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _useSessionStorage2 = _interopRequireDefault(__webpack_require__(/*! ../../../../hooks/use-session-storage */ "../modules/ai/assets/js/editor/hooks/use-session-storage.js")); var _textarea = _interopRequireDefault(__webpack_require__(/*! ../../../../components/textarea */ "../modules/ai/assets/js/editor/components/textarea.js")); var _wandIcon = _interopRequireDefault(__webpack_require__(/*! ../../../../icons/wand-icon */ "../modules/ai/assets/js/editor/icons/wand-icon.js")); var _useImagePromptEnhancer = _interopRequireDefault(__webpack_require__(/*! ../../../../hooks/use-image-prompt-enhancer */ "../modules/ai/assets/js/editor/hooks/use-image-prompt-enhancer.js")); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } var getPromptPlaceholder = function getPromptPlaceholder(data) { var _data$images; if (!(data !== null && data !== void 0 && (_data$images = data.images) !== null && _data$images !== void 0 && _data$images.length)) { return __('describe your image', 'elementor'); } var images = data.images; var randomImage = images[Math.floor(Math.random() * images.length)]; return randomImage.prompt; }; var PromptForm = function PromptForm(_ref) { var promptSettings = _ref.promptSettings, updatePromptSettings = _ref.updatePromptSettings, _ref$prompt = _ref.prompt, prompt = _ref$prompt === void 0 ? '' : _ref$prompt, setPrompt = _ref.setPrompt, panelActive = _ref.panelActive, _ref$hasImage = _ref.hasImage, hasImage = _ref$hasImage === void 0 ? false : _ref$hasImage, _ref$disableAspectRat = _ref.disableAspectRatio, disableAspectRatio = _ref$disableAspectRat === void 0 ? false : _ref$disableAspectRat; var selectedCategory = _consts.IMAGE_PROMPT_CATEGORIES.find(function (category) { return category.key === promptSettings[_consts.IMAGE_PROMPT_SETTINGS.IMAGE_TYPE]; }) || { subCategories: {} }; var _useSessionStorage = (0, _useSessionStorage2.default)('ai-image-gallery'), data = _useSessionStorage.data; var _useImagePromptEnhanc = (0, _useImagePromptEnhancer.default)(prompt), imagePromptData = _useImagePromptEnhanc.data, imagePromptIsLoading = _useImagePromptEnhanc.isLoading, imagePromptEnhancer = _useImagePromptEnhanc.send; // Image Prompt Enhancer (0, _react.useEffect)(function () { if (!imagePromptIsLoading && imagePromptData !== null && imagePromptData !== void 0 && imagePromptData.result) { setPrompt(imagePromptData === null || imagePromptData === void 0 ? void 0 : imagePromptData.result); } }, [imagePromptIsLoading]); var placeholderInitialValue = getPromptPlaceholder(data); var imageType = promptSettings[_consts.IMAGE_PROMPT_SETTINGS.IMAGE_TYPE]; var stylePreset = promptSettings[_consts.IMAGE_PROMPT_SETTINGS.STYLE_PRESET]; var aspectRatio = promptSettings[_consts.IMAGE_PROMPT_SETTINGS.ASPECT_RATIO]; return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, hasImage && /*#__PURE__*/_react.default.createElement(_ui.FormControl, { sx: { width: '100%', mb: 6 } }, /*#__PURE__*/_react.default.createElement(_ui.Slider, { onChange: function onChange(_, value) { return updatePromptSettings((0, _defineProperty2.default)({}, _consts.IMAGE_PROMPT_SETTINGS.IMAGE_STRENGTH, value)); }, id: 'image_strength', name: 'image_strength', "aria-label": __('Reference strength', 'elementor'), defaultValue: 45, getAriaValueText: function getAriaValueText(value) { return "".concat(value, "%"); }, valueLabelDisplay: "auto", step: 10, marks: true, min: 0, max: 100, color: "secondary" }), /*#__PURE__*/_react.default.createElement(_ui.Box, { display: "flex", justifyContent: "space-between", alignItems: "center" }, /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "caption" }, __('Prompt', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "caption" }, __('Reference image', 'elementor')))), /*#__PURE__*/_react.default.createElement(_ui.Stack, { gap: 6 }, /*#__PURE__*/_react.default.createElement(_textarea.default, { minRows: 3, maxRows: 6, disabled: !panelActive || imagePromptIsLoading, placeholder: placeholderInitialValue, onChange: function onChange(event) { return setPrompt(event.target.value); }, value: prompt, onKeyDown: function onKeyDown(event) { if ('Tab' === event.key) { event.preventDefault(); setPrompt(placeholderInitialValue); } }, InputProps: { endAdornment: /*#__PURE__*/_react.default.createElement(_ui.InputAdornment, { position: "end", sx: { position: 'absolute', bottom: '24px', right: '8px' } }, imagePromptIsLoading ? /*#__PURE__*/_react.default.createElement(_ui.CircularProgress, { color: "secondary", size: 20, sx: { mr: 2 } }) : /*#__PURE__*/_react.default.createElement(_ui.Tooltip, { title: __('Enhance prompt', 'elementor') }, /*#__PURE__*/_react.default.createElement(_ui.Box, { component: "span", sx: { cursor: 'pointer' } }, /*#__PURE__*/_react.default.createElement(_ui.IconButton, { size: "small", color: "secondary", onClick: function onClick() { return imagePromptEnhancer(prompt); }, disabled: !panelActive || imagePromptIsLoading || !prompt }, /*#__PURE__*/_react.default.createElement(_wandIcon.default, null))))) }, sx: { '& .MuiInputBase-input.MuiOutlinedInput-input.MuiInputBase-inputMultiline': { pb: 9, width: '89%' } } }), /*#__PURE__*/_react.default.createElement(_promptActionSelection.default, { wrapperStyle: { width: '100%' }, label: __('Image type', 'elementor'), options: _consts.IMAGE_PROMPT_CATEGORIES.map(function (category) { return { label: category.label, value: category.key }; }), onChange: function onChange(event) { return updatePromptSettings((0, _defineProperty2.default)({}, _consts.IMAGE_PROMPT_SETTINGS.IMAGE_TYPE, event.target.value)); }, value: imageType, disabled: !panelActive }), /*#__PURE__*/_react.default.createElement(_promptActionSelection.default, { wrapperStyle: { width: '100%' }, label: __('Style', 'elementor'), options: Object.entries(selectedCategory.subCategories).map(function (_ref2) { var _ref3 = (0, _slicedToArray2.default)(_ref2, 2), value = _ref3[0], label = _ref3[1]; return { label: label, value: value }; }), onChange: function onChange(event) { return updatePromptSettings((0, _defineProperty2.default)({}, _consts.IMAGE_PROMPT_SETTINGS.STYLE_PRESET, event.target.value)); }, value: stylePreset, disabled: !panelActive || !imageType || false }), !disableAspectRatio && /*#__PURE__*/_react.default.createElement(_promptActionSelection.default, { wrapperStyle: { width: '100%' }, label: __('Aspect ratio', 'elementor'), options: Object.entries(_consts.IMAGE_ASPECT_RATIOS).map(function (_ref4) { var _ref5 = (0, _slicedToArray2.default)(_ref4, 2), value = _ref5[0], label = _ref5[1]; return { label: label, value: value }; }), onChange: function onChange(event) { return updatePromptSettings((0, _defineProperty2.default)({}, _consts.IMAGE_PROMPT_SETTINGS.ASPECT_RATIO, event.target.value)); }, value: aspectRatio, disabled: !panelActive || disableAspectRatio }))); }; PromptForm.propTypes = { panelActive: PropTypes.bool, prompt: PropTypes.string, setPrompt: PropTypes.func, promptSettings: PropTypes.object, updatePromptSettings: PropTypes.func, hasImage: PropTypes.bool, disableAspectRatio: PropTypes.bool }; var _default = PromptForm; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/pages/form-media/panel-content/image-prompt-form.js": /*!******************************************************************************************!*\ !*** ../modules/ai/assets/js/editor/pages/form-media/panel-content/image-prompt-form.js ***! \******************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _generateButton = _interopRequireDefault(__webpack_require__(/*! ../../../components/generate-button */ "../modules/ai/assets/js/editor/components/generate-button.js")); var _promptForm = _interopRequireDefault(__webpack_require__(/*! ./form-controls/prompt-form */ "../modules/ai/assets/js/editor/pages/form-media/panel-content/form-controls/prompt-form.js")); var _consts = __webpack_require__(/*! ../consts/consts */ "../modules/ai/assets/js/editor/pages/form-media/consts/consts.js"); var _promptErrorMessage = _interopRequireDefault(__webpack_require__(/*! ../../../components/prompt-error-message */ "../modules/ai/assets/js/editor/components/prompt-error-message.js")); var _refreshIcon = _interopRequireDefault(__webpack_require__(/*! ../../../icons/refresh-icon */ "../modules/ai/assets/js/editor/icons/refresh-icon.js")); var ImagePromptForm = function ImagePromptForm(_ref) { var panelActive = _ref.panelActive, _ref$prompt = _ref.prompt, prompt = _ref$prompt === void 0 ? '' : _ref$prompt, setPrompt = _ref.setPrompt, generateNewPrompt = _ref.generateNewPrompt, images = _ref.images, promptSettings = _ref.promptSettings, updatePromptSettings = _ref.updatePromptSettings, submitPrompt = _ref.submitPrompt, error = _ref.error; var handleSubmit = function handleSubmit(event) { event.preventDefault(); submitPrompt(_consts.PANELS.TEXT_TO_IMAGE, prompt); }; return /*#__PURE__*/_react.default.createElement(_ui.Box, { component: "form", onSubmit: handleSubmit }, /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "h3", sx: { mb: 3 } }, __('Imagine anything create everything', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "body1", color: "secondary", sx: { mb: 8 } }, __('Generate images by selecting the desired type and style, and entering a prompt.', 'elementor')), error && /*#__PURE__*/_react.default.createElement(_promptErrorMessage.default, { error: error, sx: { mb: 6 }, actionPosition: "bottom", onRetry: handleSubmit }), /*#__PURE__*/_react.default.createElement(_promptForm.default, { prompt: prompt, setPrompt: setPrompt, panelActive: panelActive, promptSettings: promptSettings, updatePromptSettings: updatePromptSettings }), images.length ? /*#__PURE__*/_react.default.createElement(_ui.Stack, { gap: 5, sx: { my: 6 } }, /*#__PURE__*/_react.default.createElement(_ui.Button, { fullWidth: true, type: "submit", variant: "contained", color: "secondary", startIcon: /*#__PURE__*/_react.default.createElement(_refreshIcon.default, null), disabled: !panelActive || '' === prompt, sx: { // TODO: Remove on @elementor/ui 1.4.51. color: 'background.paper' } }, __('Generate again', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Button, { fullWidth: true, variant: "text", color: "secondary", disabled: !panelActive, onClick: generateNewPrompt }, __('New prompt', 'elementor'))) : /*#__PURE__*/_react.default.createElement(_generateButton.default, { size: "medium", disabled: !panelActive || '' === prompt, fullWidth: true, sx: { my: 6 } }, __('Generate images', 'elementor'))); }; ImagePromptForm.propTypes = { panelActive: PropTypes.bool, prompt: PropTypes.string, setPrompt: PropTypes.func, generateNewPrompt: PropTypes.func, images: PropTypes.array, promptSettings: PropTypes.object, updatePromptSettings: PropTypes.func, submitPrompt: PropTypes.func, error: PropTypes.string, backToTools: PropTypes.func }; var _default = ImagePromptForm; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/pages/form-media/panel-content/image-tools.js": /*!************************************************************************************!*\ !*** ../modules/ai/assets/js/editor/pages/form-media/panel-content/image-tools.js ***! \************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _expandIcon = _interopRequireDefault(__webpack_require__(/*! ../../../icons/expand-icon */ "../modules/ai/assets/js/editor/icons/expand-icon.js")); var _brushIcon = _interopRequireDefault(__webpack_require__(/*! ../../../icons/brush-icon */ "../modules/ai/assets/js/editor/icons/brush-icon.js")); var _evolveIcon = _interopRequireDefault(__webpack_require__(/*! ../../../icons/evolve-icon */ "../modules/ai/assets/js/editor/icons/evolve-icon.js")); var _enlargerIcon = _interopRequireDefault(__webpack_require__(/*! ../../../icons/enlarger-icon */ "../modules/ai/assets/js/editor/icons/enlarger-icon.js")); var _consts = __webpack_require__(/*! ../consts/consts */ "../modules/ai/assets/js/editor/pages/form-media/consts/consts.js"); var _chevronLeftIcon = _interopRequireDefault(__webpack_require__(/*! ../../../icons/chevron-left-icon */ "../modules/ai/assets/js/editor/icons/chevron-left-icon.js")); var StyledChevronLeftIcon = (0, _ui.withDirection)(_chevronLeftIcon.default); var TeaserDrawing = function TeaserDrawing() { return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, { viewBox: "0 0 184 80", sx: { width: 184, height: 80 } }, /*#__PURE__*/_react.default.createElement("g", { clipPath: "url(#clip0_3127_96542)" }, /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M49.6014 1.36364C49.6014 0.610521 48.9907 0 48.2373 0C47.4839 0 46.8731 0.610521 46.8731 1.36364C46.8731 1.9664 46.6336 2.54448 46.2072 2.9707C45.7808 3.39692 45.2025 3.63636 44.5995 3.63636C43.8461 3.63636 43.2354 4.24689 43.2354 5C43.2354 5.75311 43.8461 6.36364 44.5995 6.36364C45.2025 6.36364 45.7808 6.60308 46.2072 7.0293C46.6336 7.45552 46.8731 8.0336 46.8731 8.63636C46.8731 9.38948 47.4839 10 48.2373 10C48.9907 10 49.6014 9.38948 49.6014 8.63636C49.6014 8.0336 49.8409 7.45552 50.2673 7.0293C50.6937 6.60308 51.272 6.36364 51.875 6.36364C52.6284 6.36364 53.2392 5.75311 53.2392 5C53.2392 4.24689 52.6284 3.63636 51.875 3.63636C51.272 3.63636 50.6937 3.39692 50.2673 2.9707C49.8409 2.54448 49.6014 1.9664 49.6014 1.36364ZM48.1364 4.89917C48.1706 4.86501 48.2042 4.83041 48.2373 4.79538C48.2703 4.83041 48.304 4.86501 48.3381 4.89917C48.3723 4.93333 48.4069 4.96694 48.4419 5C48.4069 5.03306 48.3723 5.06667 48.3381 5.10083C48.304 5.13499 48.2703 5.16959 48.2373 5.20462C48.2042 5.16959 48.1706 5.13499 48.1364 5.10083C48.1022 5.06667 48.0676 5.03306 48.0326 5C48.0676 4.96694 48.1022 4.93333 48.1364 4.89917Z", fill: "#69727D" }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M66.6927 22.3677C66.6927 21.6177 66.082 21.0098 65.3286 21.0098C64.5752 21.0098 63.9644 21.6177 63.9644 22.3677C63.9644 22.9679 63.7249 23.5436 63.2985 23.968C62.8721 24.3924 62.2938 24.6309 61.6908 24.6309C60.9374 24.6309 60.3267 25.2388 60.3267 25.9888C60.3267 26.7387 60.9374 27.3467 61.6908 27.3467C62.2938 27.3467 62.8721 27.5851 63.2985 28.0096C63.7249 28.434 63.9644 29.0096 63.9644 29.6099C63.9644 30.3598 64.5752 30.9678 65.3286 30.9678C66.082 30.9678 66.6927 30.3598 66.6927 29.6099C66.6927 29.0096 66.9323 28.434 67.3586 28.0096C67.785 27.5851 68.3633 27.3467 68.9663 27.3467C69.7197 27.3467 70.3305 26.7387 70.3305 25.9888C70.3305 25.2388 69.7197 24.6309 68.9663 24.6309C68.3633 24.6309 67.785 24.3924 67.3586 23.968C66.9323 23.5436 66.6927 22.9679 66.6927 22.3677ZM65.2277 25.8884C65.2619 25.8544 65.2955 25.8199 65.3286 25.785C65.3616 25.8199 65.3953 25.8544 65.4294 25.8884C65.4636 25.9224 65.4982 25.9559 65.5333 25.9888C65.4982 26.0217 65.4636 26.0552 65.4294 26.0892C65.3953 26.1232 65.3616 26.1577 65.3286 26.1925C65.2955 26.1577 65.2619 26.1232 65.2277 26.0892C65.1935 26.0552 65.1589 26.0217 65.1239 25.9888C65.1589 25.9559 65.1935 25.9224 65.2277 25.8884Z", fill: "#69727D" }), /*#__PURE__*/_react.default.createElement("path", { d: "M53.9717 12L57.2198 17.0456L3.24796 51.4731L-0.000164873 46.4275L53.9717 12Z", fill: "#69727D" }), /*#__PURE__*/_react.default.createElement("path", { d: "M64.9761 5L68.2242 10.0456L57.2612 17.0387L54.013 11.9931L64.9761 5Z", fill: "#E6E8EA" }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M65.7284 9.49923L64.432 7.48537L56.5088 12.5394L57.8052 14.5533L65.7284 9.49923ZM64.9761 5L54.013 11.9931L57.2612 17.0387L68.2242 10.0456L64.9761 5Z", fill: "#69727D" }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M128 41C128 43.7687 121.671 46.2089 112.052 47.6451L114.482 74.7976C114.494 74.8647 114.5 74.9322 114.5 75C114.5 75.0001 114.5 75.0002 114.5 75.0003C114.513 75.1456 114.487 75.2779 114.43 75.3982C113.514 77.9735 103.8 80 91.95 80C79.496 80 69.4 77.7614 69.4 75C69.4 74.8146 69.4456 74.6315 69.5343 74.4513L71.2141 47.5326C62.0087 46.0835 56 43.6977 56 41C56 36.5817 72.1177 33 92 33C111.882 33 128 36.5817 128 41Z", fill: "#69727D" }), /*#__PURE__*/_react.default.createElement("path", { d: "M106.685 3.08259C112.562 16.564 109.338 34.1761 106.713 41.4407C106.713 41.4407 105.151 41.9127 100.894 41.9715C96.6371 42.0303 95.0251 41.9866 95.0251 41.4558C95.0252 40.9249 94.6272 34.6461 96.4177 22.3308C98.0343 11.2116 102.692 5.02553 105.448 2.75675C105.865 2.4137 106.47 2.58777 106.685 3.08259Z", fill: "#E6E8EA" }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M104.883 4.66783C105.347 4.17219 106.14 4.35208 106.38 4.9873C108.716 11.1748 109.254 18.1507 108.889 24.5355C108.513 31.1152 107.184 36.9856 105.954 40.5842C105.778 40.6166 105.55 40.6541 105.265 40.6927C104.388 40.8119 102.974 40.9423 100.88 40.9712C98.7385 41.0008 97.3196 41.0031 96.4377 40.9371C96.2614 40.9239 96.1203 40.9088 96.0088 40.8935C95.9567 39.0573 95.8782 32.9919 97.4073 22.4743C98.766 13.1288 102.302 7.42438 104.883 4.66783ZM106.713 41.4403L107.002 42.3975C107.305 42.3062 107.546 42.0773 107.653 41.7802C109 38.0524 110.481 31.7376 110.886 24.6496C111.29 17.5654 110.626 9.61894 107.602 2.68255C107.147 1.63949 105.792 1.17814 104.812 1.98425C101.838 4.43294 97.0752 10.8574 95.4281 22.1866C93.7715 33.5811 93.975 39.865 94.0187 41.2138C94.0225 41.3324 94.0251 41.4128 94.0251 41.4552C94.025 42.261 94.695 42.5983 95.0067 42.7098C95.3591 42.8358 95.8079 42.8956 96.2886 42.9316C97.2769 43.0055 98.7924 43.0002 100.908 42.971C103.071 42.9411 104.566 42.806 105.534 42.6745C106.018 42.6088 106.371 42.5438 106.61 42.4932C106.729 42.4679 106.82 42.4461 106.885 42.4296C106.917 42.4214 106.943 42.4144 106.962 42.409L106.987 42.4021L106.996 42.3995L106.999 42.3984L107.001 42.398C107.001 42.398 107.002 42.3975 106.713 41.4403ZM106.426 40.4822L106.428 40.4817L106.43 40.4812C106.43 40.4812 106.429 40.4814 106.426 40.4822Z", fill: "#69727D" }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M104.22 13.8372C104.787 15.7536 104.996 18.3439 104.953 21.2589C104.907 24.4148 104.569 27.8559 104.134 31.0529C103.7 34.2469 103.172 37.1799 102.753 39.3152C102.544 40.3824 102.361 41.2491 102.232 41.8481C102.22 41.9009 102.209 41.9516 102.199 42.0001H100.503C100.526 38.5025 100.676 33.4168 101.183 28.2866C101.724 22.8227 102.66 17.4299 104.22 13.8372ZM103 43.0001C103.974 43.2266 103.974 43.2264 103.974 43.2262L103.978 43.2093L103.989 43.1613C103.999 43.1192 104.013 43.0571 104.031 42.976C104.067 42.814 104.12 42.5763 104.186 42.2713C104.318 41.6613 104.503 40.7819 104.716 39.7006C105.14 37.5391 105.675 34.5658 106.116 31.3223C106.556 28.0818 106.905 24.5541 106.953 21.2881C107 18.0456 106.753 14.9635 105.943 12.6671C105.815 12.3045 105.676 11.9539 105.512 11.6797C105.394 11.4809 105.045 10.9388 104.371 10.9076C103.702 10.8766 103.301 11.3772 103.156 11.5722C102.959 11.8385 102.774 12.1912 102.594 12.5778C100.767 16.4945 99.7565 22.3931 99.1929 28.0897C98.6258 33.8211 98.5 39.4812 98.5 43.0001V44.0001H103.794L103.974 43.2262L103 43.0001Z", fill: "#69727D" }), /*#__PURE__*/_react.default.createElement("path", { d: "M79.2952 3.08259C73.4181 16.564 76.6423 34.1761 79.2676 41.4407C79.2676 41.4407 80.8299 41.9127 85.0867 41.9715C89.3434 42.0303 90.9554 41.9866 90.9554 41.4558C90.9553 40.9249 91.3533 34.6461 89.5628 22.3308C87.9462 11.2116 83.2888 5.02553 80.5325 2.75675C80.1157 2.4137 79.511 2.58777 79.2952 3.08259Z", fill: "#E6E8EA" }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M81.0978 4.66783C80.6337 4.17219 79.8403 4.35208 79.6005 4.9873C77.2644 11.1748 76.7267 18.1507 77.0914 24.5355C77.4671 31.1152 78.7963 36.9856 80.0267 40.5842C80.2028 40.6166 80.4308 40.6541 80.7155 40.6927C81.5929 40.8119 83.0069 40.9423 85.1005 40.9712C87.242 41.0008 88.6609 41.0031 89.5427 40.9371C89.7191 40.9239 89.8602 40.9088 89.9716 40.8935C90.0238 39.0573 90.1023 32.9919 88.5732 22.4743C87.2145 13.1288 83.6789 7.42438 81.0978 4.66783ZM79.2676 41.4403L78.9784 42.3975C78.676 42.3062 78.4345 42.0773 78.3271 41.7802C76.98 38.0524 75.4994 31.7376 75.0946 24.6496C74.69 17.5654 75.3547 9.61894 78.3786 2.68255C78.8333 1.63949 80.1887 1.17814 81.168 1.98425C84.1429 4.43294 88.9053 10.8574 90.5524 22.1866C92.209 33.5811 92.0055 39.865 91.9618 41.2138C91.958 41.3324 91.9554 41.4128 91.9554 41.4552C91.9554 42.261 91.2855 42.5983 90.9737 42.7098C90.6214 42.8358 90.1726 42.8956 89.6919 42.9316C88.7036 43.0055 87.1881 43.0002 85.0728 42.971C82.9096 42.9411 81.4141 42.806 80.4462 42.6745C79.9621 42.6088 79.6094 42.5438 79.3707 42.4932C79.2514 42.4679 79.1605 42.4461 79.0958 42.4296C79.0635 42.4214 79.0377 42.4144 79.0182 42.409L78.9937 42.4021L78.9849 42.3995L78.9814 42.3984L78.9798 42.398C78.9798 42.398 78.9784 42.3975 79.2676 41.4403ZM79.5541 40.4822L79.5526 40.4817L79.5507 40.4812C79.5507 40.4812 79.5514 40.4814 79.5541 40.4822Z", fill: "#69727D" }), /*#__PURE__*/_react.default.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M81.7604 13.8372C81.1939 15.7536 80.9847 18.3439 81.0272 21.2589C81.0733 24.4148 81.4118 27.8559 81.8464 31.0529C82.2805 34.2469 82.8081 37.1799 83.2274 39.3152C83.4369 40.3824 83.6192 41.2491 83.7488 41.8481C83.7603 41.9009 83.7713 41.9516 83.7819 42.0001H85.4771C85.4542 38.5025 85.3049 33.4168 84.7973 28.2866C84.2567 22.8227 83.32 17.4299 81.7604 13.8372ZM82.9805 43.0001C82.0065 43.2266 82.0064 43.2264 82.0064 43.2262L82.0025 43.2093L81.9914 43.1613C81.9818 43.1192 81.9677 43.0571 81.9494 42.976C81.913 42.814 81.8602 42.5763 81.7941 42.2713C81.6621 41.6613 81.4772 40.7819 81.2648 39.7006C80.8404 37.5391 80.3054 34.5658 79.8646 31.3223C79.4241 28.0818 79.0751 24.5541 79.0275 21.2881C78.9801 18.0456 79.227 14.9635 80.0375 12.6671C80.1655 12.3045 80.305 11.9539 80.4683 11.6797C80.5868 11.4809 80.9351 10.9388 81.6092 10.9076C82.2782 10.8766 82.6793 11.3772 82.8241 11.5722C83.0217 11.8385 83.2064 12.1912 83.3867 12.5778C85.2136 16.4945 86.224 22.3931 86.7876 28.0897C87.3546 33.8211 87.4805 39.4812 87.4805 43.0001V44.0001H82.1863L82.0064 43.2262L82.9805 43.0001Z", fill: "#69727D" })), /*#__PURE__*/_react.default.createElement("defs", null, /*#__PURE__*/_react.default.createElement("clipPath", { id: "clip0_3127_96542" }, /*#__PURE__*/_react.default.createElement("rect", { width: "184", height: "80", fill: "white" })))); }; var ImageToolsContainer = (0, _ui.styled)(_ui.Box)(function (_ref) { var theme = _ref.theme; return { height: "calc(100% - ".concat(theme.spacing(8), ")") }; }); var ToolsTeaserContainer = (0, _ui.styled)(_ui.Box)(function (_ref2) { var theme = _ref2.theme; return { position: 'sticky', top: "calc(100% - ".concat(theme.spacing(10), ")") }; }); var ImageTools = function ImageTools(_ref3) { var setTool = _ref3.setTool, generateNewPrompt = _ref3.generateNewPrompt, panelActive = _ref3.panelActive; var tools = [{ label: __('Expand Image', 'elementor'), Icon: _expandIcon.default, onClick: function onClick() { return setTool(_consts.PANELS.OUT_PAINTING); } }, { label: __('Generative Fill', 'elementor'), Icon: _brushIcon.default, onClick: function onClick() { return setTool(_consts.PANELS.IN_PAINTING); } }, { label: __('Resize', 'elementor'), Icon: _enlargerIcon.default, onClick: function onClick() { return setTool(_consts.PANELS.UPSCALE); } }, { label: __('Variations', 'elementor'), Icon: _evolveIcon.default, onClick: function onClick() { return setTool(_consts.PANELS.IMAGE_TO_IMAGE); } }]; return /*#__PURE__*/_react.default.createElement(ImageToolsContainer, null, /*#__PURE__*/_react.default.createElement(_ui.Box, { sx: { mb: 3 } }, /*#__PURE__*/_react.default.createElement(_ui.Button, { size: "small", variant: "text", color: "secondary", startIcon: /*#__PURE__*/_react.default.createElement(StyledChevronLeftIcon, null), onClick: function onClick(e) { e.preventDefault(); generateNewPrompt(); } }, __('Generate with a prompt', 'elementor'))), /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "h3", sx: { mb: 7 } }, __('Edit with AI', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Box, { display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: 3, justifyContent: 'center' }, tools.map(function (_ref4) { var label = _ref4.label, Icon = _ref4.Icon, onClick = _ref4.onClick; return /*#__PURE__*/_react.default.createElement(_ui.Button, { onClick: onClick, key: label, variant: "outlined", color: "secondary", disabled: !panelActive, sx: { py: 7, fontSize: '12px', height: 'auto', borderRadius: '4px' } }, /*#__PURE__*/_react.default.createElement(_ui.Box, { display: "flex", justifyContent: "center", alignItems: "center", flexDirection: "column" }, /*#__PURE__*/_react.default.createElement(Icon, { sx: { mb: 2 } }), label)); })), /*#__PURE__*/_react.default.createElement(ToolsTeaserContainer, { display: "flex", flexDirection: "column", alignItems: "center" }, /*#__PURE__*/_react.default.createElement(TeaserDrawing, null), /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "body2", align: "center", color: "secondary", sx: { mt: 5 } }, __('Stay tuned! More incredible AI tools are coming your way soon.', 'elementor')))); }; ImageTools.propTypes = { setTool: PropTypes.func.isRequired, generateNewPrompt: PropTypes.func.isRequired, panelActive: PropTypes.bool.isRequired }; var _default = ImageTools; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/pages/form-media/panel-content/image-variations-form.js": /*!**********************************************************************************************!*\ !*** ../modules/ai/assets/js/editor/pages/form-media/panel-content/image-variations-form.js ***! \**********************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _generateButton = _interopRequireDefault(__webpack_require__(/*! ../../../components/generate-button */ "../modules/ai/assets/js/editor/components/generate-button.js")); var _promptForm = _interopRequireDefault(__webpack_require__(/*! ./form-controls/prompt-form */ "../modules/ai/assets/js/editor/pages/form-media/panel-content/form-controls/prompt-form.js")); var _promptErrorMessage = _interopRequireDefault(__webpack_require__(/*! ../../../components/prompt-error-message */ "../modules/ai/assets/js/editor/components/prompt-error-message.js")); var _refreshIcon = _interopRequireDefault(__webpack_require__(/*! ../../../icons/refresh-icon */ "../modules/ai/assets/js/editor/icons/refresh-icon.js")); var _chevronLeftIcon = _interopRequireDefault(__webpack_require__(/*! ../../../icons/chevron-left-icon */ "../modules/ai/assets/js/editor/icons/chevron-left-icon.js")); var StyledChevronLeftIcon = (0, _ui.withDirection)(_chevronLeftIcon.default); var ImageVariationsForm = function ImageVariationsForm(_ref) { var panelActive = _ref.panelActive, editImage = _ref.editImage, _ref$prompt = _ref.prompt, prompt = _ref$prompt === void 0 ? '' : _ref$prompt, setPrompt = _ref.setPrompt, promptSettings = _ref.promptSettings, updatePromptSettings = _ref.updatePromptSettings, submitPrompt = _ref.submitPrompt, error = _ref.error, images = _ref.images, _ref$disableAspectRat = _ref.disableAspectRatio, disableAspectRatio = _ref$disableAspectRat === void 0 ? false : _ref$disableAspectRat, backToTools = _ref.backToTools, viewData = _ref.viewData; var handleSubmit = function handleSubmit(event) { event.preventDefault(); submitPrompt(); }; return /*#__PURE__*/_react.default.createElement(_ui.Box, { component: "form", onSubmit: handleSubmit }, /*#__PURE__*/_react.default.createElement(_ui.Box, { sx: { mb: 3 } }, /*#__PURE__*/_react.default.createElement(_ui.Button, { size: "small", variant: "text", color: "secondary", startIcon: /*#__PURE__*/_react.default.createElement(StyledChevronLeftIcon, null), onClick: function onClick(e) { e.preventDefault(); backToTools(); } }, __('Back', 'elementor'))), /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "h3", sx: { mb: 3 } }, __('Variations', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "body1", color: "secondary", sx: { mb: 8 } }, __('Create new versions of the original image.', 'elementor')), error && /*#__PURE__*/_react.default.createElement(_promptErrorMessage.default, { error: error, sx: { mb: 6 }, actionPosition: "bottom", onRetry: handleSubmit }), /*#__PURE__*/_react.default.createElement(_ui.Box, { sx: { display: 'flex', alignItems: 'center', justifyContent: 'center', bgcolor: 'secondary.background', mb: 4 } }, /*#__PURE__*/_react.default.createElement("img", { src: (editImage === null || editImage === void 0 ? void 0 : editImage.image_url) || editImage.url, alt: prompt, style: { width: 'auto', height: 'auto', maxWidth: '100%', maxHeight: 166, objectFit: 'contained' } })), /*#__PURE__*/_react.default.createElement(_promptForm.default, { prompt: prompt, setPrompt: setPrompt, panelActive: panelActive, promptSettings: promptSettings, updatePromptSettings: updatePromptSettings, hasImage: true, disableAspectRatio: disableAspectRatio, viewData: viewData }), /*#__PURE__*/_react.default.createElement(_ui.Stack, { gap: 5, sx: { my: 6 } }, images.length ? /*#__PURE__*/_react.default.createElement(_ui.Button, { fullWidth: true, type: "submit", variant: "contained", color: "secondary", startIcon: /*#__PURE__*/_react.default.createElement(_refreshIcon.default, null), disabled: !panelActive || '' === prompt, sx: { // TODO: Remove on @elementor/ui 1.4.51. color: 'background.paper' } }, __('Generate again', 'elementor')) : /*#__PURE__*/_react.default.createElement(_generateButton.default, { size: "medium", disabled: !panelActive || '' === prompt }, __('Generate images', 'elementor')))); }; ImageVariationsForm.propTypes = { panelActive: PropTypes.bool, prompt: PropTypes.string, setPrompt: PropTypes.func, editImage: PropTypes.object, promptSettings: PropTypes.object, updatePromptSettings: PropTypes.func, submitPrompt: PropTypes.func, error: PropTypes.string, images: PropTypes.array, disableAspectRatio: PropTypes.bool, backToTools: PropTypes.func, viewData: PropTypes.object }; var _default = ImageVariationsForm; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/pages/form-media/panel-content/in-painting-form.js": /*!*****************************************************************************************!*\ !*** ../modules/ai/assets/js/editor/pages/form-media/panel-content/in-painting-form.js ***! \*****************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _promptErrorMessage = _interopRequireDefault(__webpack_require__(/*! ../../../components/prompt-error-message */ "../modules/ai/assets/js/editor/components/prompt-error-message.js")); var _consts = __webpack_require__(/*! ../consts/consts */ "../modules/ai/assets/js/editor/pages/form-media/consts/consts.js"); var _wandIcon = _interopRequireDefault(__webpack_require__(/*! ../../../icons/wand-icon */ "../modules/ai/assets/js/editor/icons/wand-icon.js")); var _textarea = _interopRequireDefault(__webpack_require__(/*! ../../../components/textarea */ "../modules/ai/assets/js/editor/components/textarea.js")); var _useImagePromptEnhancer = _interopRequireDefault(__webpack_require__(/*! ../../../hooks/use-image-prompt-enhancer */ "../modules/ai/assets/js/editor/hooks/use-image-prompt-enhancer.js")); var _chevronLeftIcon = _interopRequireDefault(__webpack_require__(/*! ../../../icons/chevron-left-icon */ "../modules/ai/assets/js/editor/icons/chevron-left-icon.js")); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } var StyledChevronLeftIcon = (0, _ui.withDirection)(_chevronLeftIcon.default); var InPaintingForm = function InPaintingForm(_ref) { var panelActive = _ref.panelActive, _ref$prompt = _ref.prompt, prompt = _ref$prompt === void 0 ? '' : _ref$prompt, setPrompt = _ref.setPrompt, submitPrompt = _ref.submitPrompt, error = _ref.error, maskImage = _ref.maskImage, backToTools = _ref.backToTools; var _useImagePromptEnhanc = (0, _useImagePromptEnhancer.default)(prompt), imagePromptData = _useImagePromptEnhanc.data, imagePromptIsLoading = _useImagePromptEnhanc.isLoading, imagePromptEnhancer = _useImagePromptEnhanc.send; // Image Prompt Enhancer (0, _react.useEffect)(function () { if (!imagePromptIsLoading && imagePromptData !== null && imagePromptData !== void 0 && imagePromptData.result) { setPrompt(imagePromptData === null || imagePromptData === void 0 ? void 0 : imagePromptData.result); } }, [imagePromptIsLoading]); var handleSubmit = function handleSubmit(event) { // The fallback instruction should be hidden for the user. event.preventDefault(); var finalPrompt = prompt || 'Remove object and fill based on the surroundings'; submitPrompt(_consts.PANELS.IN_PAINTING, finalPrompt, maskImage); }; return /*#__PURE__*/_react.default.createElement(_ui.Box, { component: "form", onSubmit: handleSubmit }, /*#__PURE__*/_react.default.createElement(_ui.Box, { sx: { mb: 3 } }, /*#__PURE__*/_react.default.createElement(_ui.Button, { size: "small", variant: "text", color: "secondary", startIcon: /*#__PURE__*/_react.default.createElement(StyledChevronLeftIcon, null), onClick: function onClick(e) { e.preventDefault(); backToTools(); } }, __('Back', 'elementor'))), /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "h3", sx: { mb: 3 } }, __('Generative Fill', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "body1", color: "secondary", sx: { mb: 8 } }, __('Mark an area and edit it with a prompt.', 'elementor')), error && /*#__PURE__*/_react.default.createElement(_promptErrorMessage.default, { error: error, sx: { mb: 6 }, actionPosition: "bottom", onRetry: handleSubmit }), /*#__PURE__*/_react.default.createElement(_ui.Stack, { gap: 5, sx: { my: 6 } }, /*#__PURE__*/_react.default.createElement(_textarea.default, { minRows: 3, maxRows: 6, disabled: !panelActive || imagePromptIsLoading, placeholder: __('Describe what you want to generate in the marked area (English only)', 'elementor'), onChange: function onChange(event) { return setPrompt(event.target.value); }, value: prompt, InputProps: { endAdornment: /*#__PURE__*/_react.default.createElement(_ui.InputAdornment, { position: "end", sx: { position: 'absolute', bottom: '24px', right: '8px' } }, imagePromptIsLoading ? /*#__PURE__*/_react.default.createElement(_ui.CircularProgress, { color: "secondary", size: 20, sx: { mr: 2 } }) : /*#__PURE__*/_react.default.createElement(_ui.Tooltip, { title: __('Enhance prompt', 'elementor') }, /*#__PURE__*/_react.default.createElement(_ui.Box, { component: "span", sx: { cursor: 'pointer' } }, /*#__PURE__*/_react.default.createElement(_ui.IconButton, { size: "small", color: "secondary", onClick: function onClick() { return imagePromptEnhancer(prompt); }, disabled: !panelActive || imagePromptIsLoading || !prompt }, /*#__PURE__*/_react.default.createElement(_wandIcon.default, null))))) }, sx: { '& .MuiInputBase-input.MuiOutlinedInput-input.MuiInputBase-inputMultiline': { pb: 9, width: '89%' } } }), /*#__PURE__*/_react.default.createElement(_ui.Button, { type: "submit", variant: "contained", disabled: !panelActive }, __('Generate', 'elementor')))); }; InPaintingForm.propTypes = { panelActive: PropTypes.bool, prompt: PropTypes.string, setPrompt: PropTypes.func, generateNewPrompt: PropTypes.func, editImage: PropTypes.object, promptSettings: PropTypes.object, updatePromptSettings: PropTypes.func, submitPrompt: PropTypes.func, error: PropTypes.string, images: PropTypes.array, maskImage: PropTypes.string, backToTools: PropTypes.func }; var _default = InPaintingForm; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/pages/form-media/panel-content/out-painting-form.js": /*!******************************************************************************************!*\ !*** ../modules/ai/assets/js/editor/pages/form-media/panel-content/out-painting-form.js ***! \******************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _promptErrorMessage = _interopRequireDefault(__webpack_require__(/*! ../../../components/prompt-error-message */ "../modules/ai/assets/js/editor/components/prompt-error-message.js")); var _consts = __webpack_require__(/*! ../consts/consts */ "../modules/ai/assets/js/editor/pages/form-media/consts/consts.js"); var _promptActionSelection = _interopRequireDefault(__webpack_require__(/*! ../../../components/prompt-action-selection */ "../modules/ai/assets/js/editor/components/prompt-action-selection.js")); var _textarea = _interopRequireDefault(__webpack_require__(/*! ../../../components/textarea */ "../modules/ai/assets/js/editor/components/textarea.js")); var _wandIcon = _interopRequireDefault(__webpack_require__(/*! ../../../icons/wand-icon */ "../modules/ai/assets/js/editor/icons/wand-icon.js")); var _useImagePromptEnhancer = _interopRequireDefault(__webpack_require__(/*! ../../../hooks/use-image-prompt-enhancer */ "../modules/ai/assets/js/editor/hooks/use-image-prompt-enhancer.js")); var _chevronLeftIcon = _interopRequireDefault(__webpack_require__(/*! ../../../icons/chevron-left-icon */ "../modules/ai/assets/js/editor/icons/chevron-left-icon.js")); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } var StyledChevronLeftIcon = (0, _ui.withDirection)(_chevronLeftIcon.default); var OutPaintingForm = function OutPaintingForm(_ref) { var panelActive = _ref.panelActive, _ref$prompt = _ref.prompt, prompt = _ref$prompt === void 0 ? '' : _ref$prompt, setPrompt = _ref.setPrompt, updatePromptSettings = _ref.updatePromptSettings, submitPrompt = _ref.submitPrompt, error = _ref.error, maskImage = _ref.maskImage, backToTools = _ref.backToTools, viewData = _ref.viewData; var initialAspectRatio = (0, _react.useMemo)(function () { return viewData.ratio; }, []); var _useImagePromptEnhanc = (0, _useImagePromptEnhancer.default)(prompt), imagePromptData = _useImagePromptEnhanc.data, imagePromptIsLoading = _useImagePromptEnhanc.isLoading, imagePromptEnhancer = _useImagePromptEnhanc.send; // Image Prompt Enhancer (0, _react.useEffect)(function () { if (!imagePromptIsLoading && imagePromptData !== null && imagePromptData !== void 0 && imagePromptData.result) { setPrompt(imagePromptData === null || imagePromptData === void 0 ? void 0 : imagePromptData.result); } }, [imagePromptIsLoading]); var handleSubmit = function handleSubmit(event) { event.preventDefault(); var finalPrompt = prompt || 'Fill based on the surroundings'; submitPrompt(_consts.PANELS.OUT_PAINTING, finalPrompt, maskImage); }; return /*#__PURE__*/_react.default.createElement(_ui.Box, { component: "form", onSubmit: handleSubmit }, /*#__PURE__*/_react.default.createElement(_ui.Box, { sx: { mb: 3 } }, /*#__PURE__*/_react.default.createElement(_ui.Button, { size: "small", variant: "text", color: "secondary", startIcon: /*#__PURE__*/_react.default.createElement(StyledChevronLeftIcon, null), onClick: function onClick(e) { e.preventDefault(); backToTools(); // Restoring the initial aspect ratio for not affecting other views when the new aspect ratio is not saved. if (initialAspectRatio !== viewData.ratio) { updatePromptSettings((0, _defineProperty2.default)({}, _consts.IMAGE_PROMPT_SETTINGS.ASPECT_RATIO, initialAspectRatio)); } } }, __('Back', 'elementor'))), /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "h3", sx: { mb: 3 } }, __('Expand Image', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "body1", color: "secondary", sx: { mb: 8 } }, __('Position image in it’s new size to generate content around the edges.', 'elementor')), error && /*#__PURE__*/_react.default.createElement(_promptErrorMessage.default, { error: error, sx: { mb: 6 }, actionPosition: "bottom", onRetry: handleSubmit }), /*#__PURE__*/_react.default.createElement(_ui.Stack, { gap: 6 }, /*#__PURE__*/_react.default.createElement(_promptActionSelection.default, { wrapperStyle: { width: '100%' }, label: __('Aspect ratio', 'elementor'), options: Object.entries(_consts.IMAGE_ASPECT_RATIOS).map(function (_ref2) { var _ref3 = (0, _slicedToArray2.default)(_ref2, 2), value = _ref3[0], label = _ref3[1]; return { label: label, value: value }; }), onChange: function onChange(event) { updatePromptSettings((0, _defineProperty2.default)({}, _consts.IMAGE_PROMPT_SETTINGS.ASPECT_RATIO, event.target.value)); }, value: viewData.ratio, disabled: !panelActive }), /*#__PURE__*/_react.default.createElement(_ui.FormControl, { sx: { width: '100%', mb: 6 } }, /*#__PURE__*/_react.default.createElement(_ui.Slider, { onChange: function onChange(_, value) { return updatePromptSettings((0, _defineProperty2.default)({}, _consts.IMAGE_PROMPT_SETTINGS.ZOOM, value)); }, id: 'zoom', name: 'zoom', "aria-label": __('Reference strength', 'elementor'), defaultValue: 1, valueLabelDisplay: "auto", step: 0.1, marks: true, min: 0.1, max: 2, color: "secondary", "aria-labelledby": "image-size-slider" }), /*#__PURE__*/_react.default.createElement(_ui.Typography, { id: "image-size-slider", variant: "caption", gutterBottom: true }, __('Original image size', 'elementor'))), /*#__PURE__*/_react.default.createElement(_textarea.default, { minRows: 3, maxRows: 6, disabled: !panelActive || imagePromptIsLoading, placeholder: __('Describe what you want to generate in the expended area (English only)', 'elementor'), onChange: function onChange(event) { return setPrompt(event.target.value); }, value: prompt, InputProps: { endAdornment: /*#__PURE__*/_react.default.createElement(_ui.InputAdornment, { position: "end", sx: { position: 'absolute', bottom: '24px', right: '8px' } }, imagePromptIsLoading ? /*#__PURE__*/_react.default.createElement(_ui.CircularProgress, { color: "secondary", size: 20, sx: { mr: 2 } }) : /*#__PURE__*/_react.default.createElement(_ui.Tooltip, { title: __('Enhance prompt', 'elementor') }, /*#__PURE__*/_react.default.createElement(_ui.Box, { component: "span", sx: { cursor: 'pointer' } }, /*#__PURE__*/_react.default.createElement(_ui.IconButton, { size: "small", color: "secondary", onClick: function onClick() { return imagePromptEnhancer(prompt); }, disabled: !panelActive || imagePromptIsLoading || !prompt }, /*#__PURE__*/_react.default.createElement(_wandIcon.default, null))))) }, sx: { '& .MuiInputBase-input.MuiOutlinedInput-input.MuiInputBase-inputMultiline': { pb: 9, width: '89%' } } })), /*#__PURE__*/_react.default.createElement(_ui.Stack, { gap: 5, sx: { my: 6 } }, /*#__PURE__*/_react.default.createElement(_ui.Button, { type: "submit", variant: "contained", disabled: !panelActive }, __('Generate', 'elementor')))); }; OutPaintingForm.propTypes = { panelActive: PropTypes.bool, prompt: PropTypes.string, setPrompt: PropTypes.func, promptSettings: PropTypes.object, updatePromptSettings: PropTypes.func, submitPrompt: PropTypes.func, error: PropTypes.string, maskImage: PropTypes.string, backToTools: PropTypes.func, viewData: PropTypes.object }; var _default = OutPaintingForm; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/pages/form-media/panel-content/panel-content.js": /*!**************************************************************************************!*\ !*** ../modules/ai/assets/js/editor/pages/form-media/panel-content/panel-content.js ***! \**************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.PanelContent = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); var _consts = __webpack_require__(/*! ../consts/consts */ "../modules/ai/assets/js/editor/pages/form-media/consts/consts.js"); var _imagePromptForm = _interopRequireDefault(__webpack_require__(/*! ./image-prompt-form */ "../modules/ai/assets/js/editor/pages/form-media/panel-content/image-prompt-form.js")); var _imageVariationsForm = _interopRequireDefault(__webpack_require__(/*! ./image-variations-form */ "../modules/ai/assets/js/editor/pages/form-media/panel-content/image-variations-form.js")); var _imageTools = _interopRequireDefault(__webpack_require__(/*! ./image-tools */ "../modules/ai/assets/js/editor/pages/form-media/panel-content/image-tools.js")); var _inPaintingForm = _interopRequireDefault(__webpack_require__(/*! ./in-painting-form */ "../modules/ai/assets/js/editor/pages/form-media/panel-content/in-painting-form.js")); var _outPaintingForm = _interopRequireDefault(__webpack_require__(/*! ./out-painting-form */ "../modules/ai/assets/js/editor/pages/form-media/panel-content/out-painting-form.js")); var _upscaleForm = _interopRequireDefault(__webpack_require__(/*! ./upscale-form */ "../modules/ai/assets/js/editor/pages/form-media/panel-content/upscale-form.js")); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } var PanelContent = function PanelContent(_ref) { var error = _ref.error, images = _ref.images, submitPrompt = _ref.submitPrompt, generateNewPrompt = _ref.generateNewPrompt, promptSettings = _ref.promptSettings, updatePromptSettings = _ref.updatePromptSettings, editImage = _ref.editImage, panel = _ref.panel, prompt = _ref.prompt, setPrompt = _ref.setPrompt, panelActive = _ref.panelActive, setTool = _ref.setTool, maskImage = _ref.maskImage, reset = _ref.reset, viewData = _ref.viewData; var backToTools = function backToTools() { // TODO: Temp solution for preventing the error message to follow to other screens. if (error) { reset(); } setTool(false); }; var commonProps = { prompt: prompt, setPrompt: setPrompt, panelActive: panelActive, generateNewPrompt: generateNewPrompt, promptSettings: promptSettings, updatePromptSettings: updatePromptSettings, submitPrompt: submitPrompt, error: error, images: images, backToTools: backToTools }; if (panel === _consts.PANELS.TEXT_TO_IMAGE) { return /*#__PURE__*/_react.default.createElement(_imagePromptForm.default, commonProps); } if (panel === _consts.PANELS.IMAGE_TO_IMAGE) { return /*#__PURE__*/_react.default.createElement(_imageVariationsForm.default, _objectSpread({ editImage: editImage }, commonProps)); } if (panel === _consts.PANELS.IN_PAINTING) { return /*#__PURE__*/_react.default.createElement(_inPaintingForm.default, _objectSpread(_objectSpread({ editImage: editImage }, commonProps), {}, { disableAspectRatio: true, maskImage: maskImage })); } if (panel === _consts.PANELS.OUT_PAINTING) { return /*#__PURE__*/_react.default.createElement(_outPaintingForm.default, _objectSpread(_objectSpread({ editImage: editImage }, commonProps), {}, { disableAspectRatio: true, maskImage: maskImage, viewData: viewData })); } if (panel === _consts.PANELS.UPSCALE) { return /*#__PURE__*/_react.default.createElement(_upscaleForm.default, _objectSpread({ editImage: editImage }, commonProps)); } return /*#__PURE__*/_react.default.createElement(_imageTools.default, { setTool: setTool, generateNewPrompt: generateNewPrompt, panelActive: panelActive }); }; exports.PanelContent = PanelContent; PanelContent.propTypes = { error: PropTypes.any.isRequired, images: PropTypes.array, generateNewPrompt: PropTypes.func, promptSettings: PropTypes.object, updatePromptSettings: PropTypes.func, editImage: PropTypes.object, submitPrompt: PropTypes.func, panel: PropTypes.string, prompt: PropTypes.string, setPrompt: PropTypes.func, panelActive: PropTypes.bool, setTool: PropTypes.func, maskImage: PropTypes.string, reset: PropTypes.func, viewData: PropTypes.object }; /***/ }), /***/ "../modules/ai/assets/js/editor/pages/form-media/panel-content/upscale-form.js": /*!*************************************************************************************!*\ !*** ../modules/ai/assets/js/editor/pages/form-media/panel-content/upscale-form.js ***! \*************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _promptErrorMessage = _interopRequireDefault(__webpack_require__(/*! ../../../components/prompt-error-message */ "../modules/ai/assets/js/editor/components/prompt-error-message.js")); var _consts = __webpack_require__(/*! ../consts/consts */ "../modules/ai/assets/js/editor/pages/form-media/consts/consts.js"); var _chevronLeftIcon = _interopRequireDefault(__webpack_require__(/*! ../../../icons/chevron-left-icon */ "../modules/ai/assets/js/editor/icons/chevron-left-icon.js")); var StyledChevronLeftIcon = (0, _ui.withDirection)(_chevronLeftIcon.default); var UpscaleForm = function UpscaleForm(_ref) { var panelActive = _ref.panelActive, updatePromptSettings = _ref.updatePromptSettings, submitPrompt = _ref.submitPrompt, error = _ref.error, backToTools = _ref.backToTools; var handleSubmit = function handleSubmit(event) { event.preventDefault(); submitPrompt(_consts.PANELS.UPSCALE); }; return /*#__PURE__*/_react.default.createElement(_ui.Box, { component: "form", onSubmit: handleSubmit }, /*#__PURE__*/_react.default.createElement(_ui.Box, { sx: { mb: 3 } }, /*#__PURE__*/_react.default.createElement(_ui.Button, { size: "small", variant: "text", color: "secondary", startIcon: /*#__PURE__*/_react.default.createElement(StyledChevronLeftIcon, null), onClick: function onClick(e) { e.preventDefault(); backToTools(); } }, __('Back', 'elementor'))), /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "h3", sx: { mb: 3 } }, __('Resize', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "body1", color: "secondary", sx: { mb: 8 } }, __('Make an image larger and improve it’s resolution.', 'elementor')), error && /*#__PURE__*/_react.default.createElement(_promptErrorMessage.default, { error: error, sx: { mb: 6 }, actionPosition: "bottom", onRetry: handleSubmit }), /*#__PURE__*/_react.default.createElement(_ui.Stack, { gap: 6 }, /*#__PURE__*/_react.default.createElement(_ui.FormControl, { sx: { width: '100%' } }, /*#__PURE__*/_react.default.createElement(_ui.Box, { display: "flex", justifyContent: "space-between", alignItems: "center" }, /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "caption" }, "512"), /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "caption" }, "1024")), /*#__PURE__*/_react.default.createElement(_ui.Slider, { onChange: function onChange(_, value) { return updatePromptSettings((0, _defineProperty2.default)({}, _consts.IMAGE_PROMPT_SETTINGS.UPSCALE_TO, value)); }, id: 'upscale_to', name: 'upscale_to', "aria-label": __('Upscale to', 'elementor'), defaultValue: 1, valueLabelDisplay: "auto", step: 64, marks: true, min: 512, max: 1024, color: "secondary" }), /*#__PURE__*/_react.default.createElement(_ui.Box, { display: "flex", justifyContent: "space-between", alignItems: "center" }, /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "caption" }, __('Current', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "caption" }, __('Output', 'elementor'))), /*#__PURE__*/_react.default.createElement(_ui.Button, { type: "submit", variant: "contained", disabled: !panelActive, sx: { mt: 6 } }, __('Generate', 'elementor'))))); }; UpscaleForm.propTypes = { panelActive: PropTypes.bool, prompt: PropTypes.string, setPrompt: PropTypes.func, generateNewPrompt: PropTypes.func, editImage: PropTypes.object, promptSettings: PropTypes.object, updatePromptSettings: PropTypes.func, submitPrompt: PropTypes.func, error: PropTypes.string, maskImage: PropTypes.string, backToTools: PropTypes.func }; var _default = UpscaleForm; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/pages/form-media/screens/components/results-grid.js": /*!******************************************************************************************!*\ !*** ../modules/ai/assets/js/editor/pages/form-media/screens/components/results-grid.js ***! \******************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _consts = __webpack_require__(/*! ../../consts/consts */ "../modules/ai/assets/js/editor/pages/form-media/consts/consts.js"); var _overlay = _interopRequireDefault(__webpack_require__(/*! ../../../../components/ui/overlay */ "../modules/ai/assets/js/editor/components/ui/overlay.js")); var _overlayBar = _interopRequireDefault(__webpack_require__(/*! ../../../../components/ui/overlay-bar */ "../modules/ai/assets/js/editor/components/ui/overlay-bar.js")); var _zoomInIcon = _interopRequireDefault(__webpack_require__(/*! ../../../../icons/zoom-in-icon */ "../modules/ai/assets/js/editor/icons/zoom-in-icon.js")); var _editIcon = _interopRequireDefault(__webpack_require__(/*! ../../../../icons/edit-icon */ "../modules/ai/assets/js/editor/icons/edit-icon.js")); var _downloadIcon = _interopRequireDefault(__webpack_require__(/*! ../../../../icons/download-icon */ "../modules/ai/assets/js/editor/icons/download-icon.js")); var ResultsGrid = function ResultsGrid(_ref) { var images = _ref.images, handleImageAction = _ref.handleImageAction, aspectRatio = _ref.aspectRatio; // TODO: temp solution for displaying the resized image result. if (1 === images.length) { var image = images[0]; return /*#__PURE__*/_react.default.createElement(_ui.Box, null, /*#__PURE__*/_react.default.createElement(_ui.Stack, { spacing: 2, justifyContent: "space-around", alignItems: "center" }, /*#__PURE__*/_react.default.createElement(_ui.Box, { display: "flex", width: "100%", justifyContent: "flex-end", alignItems: "center", sx: { mb: 4 } }, /*#__PURE__*/_react.default.createElement(_ui.Stack, { direction: "row", spacing: 3, justifyContent: "flex-end", width: "100%" }, /*#__PURE__*/_react.default.createElement(_ui.Button, { size: "small", color: "secondary", startIcon: /*#__PURE__*/_react.default.createElement(_editIcon.default, null), onClick: function onClick() { return handleImageAction(_consts.IMAGE_ACTIONS.REFERENCE, image); } }, __('Edit', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Button, { size: "small", variant: "contained", startIcon: /*#__PURE__*/_react.default.createElement(_downloadIcon.default, null), onClick: function onClick() { return handleImageAction(_consts.IMAGE_ACTIONS.USE, image); } }, __('Use Image', 'elementor'))))), /*#__PURE__*/_react.default.createElement(_ui.Box, { display: "flex", justifyContent: "center" }, /*#__PURE__*/_react.default.createElement("img", { src: image.image_url, alt: "generated--resized", style: { maxWidth: '100%', width: 'auto', maxHeight: '100%' } }))); } return /*#__PURE__*/_react.default.createElement(_ui.Box, { display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: 7 }, images.map(function (image, index) { return /*#__PURE__*/_react.default.createElement(_ui.Box, { key: "result-".concat(image.seed), display: "flex", justifyContent: "center", alignItems: "center", sx: { bgcolor: 'secondary.background', height: 336, position: 'relative', overflow: 'hidden' } }, /*#__PURE__*/_react.default.createElement("img", { src: image.image_url, alt: "generated-".concat(index), style: { width: 'auto', height: 'auto', maxWidth: '100%', maxHeight: '1:1' === aspectRatio ? 'initial' : '100%', objectFit: 'contain', aspectRatio: aspectRatio.replace(':', ' / ') } }), /*#__PURE__*/_react.default.createElement(_overlay.default, null, /*#__PURE__*/_react.default.createElement(_overlayBar.default, { position: "bottom", direction: "row", gap: 3, alignItems: "center", justifyContent: "space-between" }, /*#__PURE__*/_react.default.createElement(_ui.Button, { fullWidth: true, variant: "contained", startIcon: /*#__PURE__*/_react.default.createElement(_downloadIcon.default, null), onClick: function onClick() { return handleImageAction(_consts.IMAGE_ACTIONS.USE, image); } }, __('Use Image', 'Elementor')), /*#__PURE__*/_react.default.createElement(_ui.Stack, { direction: "row", gap: 1 }, /*#__PURE__*/_react.default.createElement(_ui.Tooltip, { title: __('Zoom', 'elementor') }, /*#__PURE__*/_react.default.createElement(_ui.IconButton, { color: "secondary", sx: { color: 'common.white', '&:hover': { color: 'common.white' } }, "aria-label": __('Zoom', 'elementor'), onClick: function onClick() { return handleImageAction(_consts.IMAGE_ACTIONS.ZOOM, index); } }, /*#__PURE__*/_react.default.createElement(_zoomInIcon.default, null))), /*#__PURE__*/_react.default.createElement(_ui.Tooltip, { title: __('Edit', 'elementor') }, /*#__PURE__*/_react.default.createElement(_ui.IconButton, { color: "secondary", sx: { color: 'common.white', '&:hover': { color: 'common.white' } }, "aria-label": __('Edit', 'elementor'), onClick: function onClick() { return handleImageAction(_consts.IMAGE_ACTIONS.REFERENCE, image); } }, /*#__PURE__*/_react.default.createElement(_editIcon.default, null))))))); })); }; ResultsGrid.propTypes = { images: PropTypes.array, handleImageAction: PropTypes.func, aspectRatio: PropTypes.string }; var _default = ResultsGrid; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/pages/form-media/screens/components/zoom-image.js": /*!****************************************************************************************!*\ !*** ../modules/ai/assets/js/editor/pages/form-media/screens/components/zoom-image.js ***! \****************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _consts = __webpack_require__(/*! ../../consts/consts */ "../modules/ai/assets/js/editor/pages/form-media/consts/consts.js"); var _downloadIcon = _interopRequireDefault(__webpack_require__(/*! ../../../../icons/download-icon */ "../modules/ai/assets/js/editor/icons/download-icon.js")); var _editIcon = _interopRequireDefault(__webpack_require__(/*! ../../../../icons/edit-icon */ "../modules/ai/assets/js/editor/icons/edit-icon.js")); var _chevronRightIcon = _interopRequireDefault(__webpack_require__(/*! ../../../../icons/chevron-right-icon */ "../modules/ai/assets/js/editor/icons/chevron-right-icon.js")); var _chevronLeftIcon = _interopRequireDefault(__webpack_require__(/*! ../../../../icons/chevron-left-icon */ "../modules/ai/assets/js/editor/icons/chevron-left-icon.js")); var StyledChevronLeftIcon = (0, _ui.withDirection)(_chevronLeftIcon.default); var StyledChevronRightIcon = (0, _ui.withDirection)(_chevronRightIcon.default); var ZoomImage = function ZoomImage(_ref) { var images = _ref.images, zoomedImageIndex = _ref.zoomedImageIndex, imageNavigation = _ref.imageNavigation, handleImageAction = _ref.handleImageAction, viewData = _ref.viewData; var currentImage = images[zoomedImageIndex]; var width = viewData.width, height = viewData.height; return /*#__PURE__*/_react.default.createElement(_ui.Stack, { alignItems: "flex-start", spacing: 2 }, /*#__PURE__*/_react.default.createElement(_ui.Stack, { direction: "row", spacing: 6, alignSelf: "center", alignItems: "center" }, /*#__PURE__*/_react.default.createElement(_ui.IconButton, { onClick: function onClick() { return imageNavigation.navigatePrevImage(); }, size: "large", color: "secondary" }, /*#__PURE__*/_react.default.createElement(StyledChevronLeftIcon, null)), /*#__PURE__*/_react.default.createElement(_ui.Stack, { spacing: 2, justifyContent: "space-around", alignItems: "center" }, /*#__PURE__*/_react.default.createElement(_ui.Box, { display: "flex", width: "100%", justifyContent: "space-between", alignItems: "center", sx: { mb: 4 } }, /*#__PURE__*/_react.default.createElement(_ui.Button, { size: "small", variant: "text", color: "secondary", startIcon: /*#__PURE__*/_react.default.createElement(StyledChevronLeftIcon, null), onClick: function onClick() { return imageNavigation.backToResults(); } }, __('Back', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Stack, { direction: "row", spacing: 3, justifyContent: "flex-end", width: "100%" }, /*#__PURE__*/_react.default.createElement(_ui.Button, { size: "small", color: "secondary", startIcon: /*#__PURE__*/_react.default.createElement(_editIcon.default, null), onClick: function onClick() { return handleImageAction(_consts.IMAGE_ACTIONS.REFERENCE, currentImage); } }, __('Edit', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Button, { size: "small", variant: "contained", startIcon: /*#__PURE__*/_react.default.createElement(_downloadIcon.default, null), onClick: function onClick() { return handleImageAction(_consts.IMAGE_ACTIONS.USE, currentImage); } }, __('Use Image', 'elementor')))), /*#__PURE__*/_react.default.createElement(_ui.Box, { display: "flex", justifyContent: "center", alignItems: "center" }, /*#__PURE__*/_react.default.createElement("img", { src: currentImage.image_url, alt: '', style: { width: width, height: height } }))), /*#__PURE__*/_react.default.createElement(_ui.IconButton, { onClick: function onClick() { return imageNavigation.navigateNextImage(); }, size: "large", color: "secondary" }, /*#__PURE__*/_react.default.createElement(StyledChevronRightIcon, null)))); }; ZoomImage.propTypes = { images: PropTypes.array, zoomedImageIndex: PropTypes.number, handleImageAction: PropTypes.func, imageNavigation: PropTypes.object, viewData: PropTypes.object }; var _default = ZoomImage; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/pages/form-media/screens/generate-result.js": /*!**********************************************************************************!*\ !*** ../modules/ai/assets/js/editor/pages/form-media/screens/generate-result.js ***! \**********************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _consts = __webpack_require__(/*! ../consts/consts */ "../modules/ai/assets/js/editor/pages/form-media/consts/consts.js"); var _useImageNavigation2 = _interopRequireDefault(__webpack_require__(/*! ../../../hooks/use-image-navigation */ "../modules/ai/assets/js/editor/hooks/use-image-navigation.js")); var _zoomImage = _interopRequireDefault(__webpack_require__(/*! ./components/zoom-image */ "../modules/ai/assets/js/editor/pages/form-media/screens/components/zoom-image.js")); var _resultsGrid = _interopRequireDefault(__webpack_require__(/*! ./components/results-grid */ "../modules/ai/assets/js/editor/pages/form-media/screens/components/results-grid.js")); var FormGenerateResult = function FormGenerateResult(_ref) { var maybeUploadImage = _ref.maybeUploadImage, images = _ref.images, aspectRatio = _ref.aspectRatio, viewData = _ref.viewData; var _useImageNavigation = (0, _useImageNavigation2.default)(images), zoomedImageIndex = _useImageNavigation.zoomedImageIndex, setZoomedImageIndex = _useImageNavigation.setZoomedImageIndex, imageNavigation = _useImageNavigation.imageNavigation; var handleImageAction = function handleImageAction(imageAction, imageForAction) { switch (imageAction) { case _consts.IMAGE_ACTIONS.USE: maybeUploadImage(imageForAction, true); break; case _consts.IMAGE_ACTIONS.REFERENCE: // TODO: currently the reference action is the edit action. maybeUploadImage(imageForAction); break; case _consts.IMAGE_ACTIONS.ZOOM: setZoomedImageIndex(imageForAction); break; } }; return /*#__PURE__*/_react.default.createElement(_ui.Box, { sx: { overflowY: 'scroll', p: 8 }, flexGrow: 1 }, zoomedImageIndex > -1 ? /*#__PURE__*/_react.default.createElement(_zoomImage.default, { images: images, zoomedImageIndex: zoomedImageIndex, handleImageAction: handleImageAction, imageNavigation: imageNavigation, viewData: viewData }) : /*#__PURE__*/_react.default.createElement(_resultsGrid.default, { images: images, handleImageAction: handleImageAction, aspectRatio: aspectRatio })); }; FormGenerateResult.propTypes = { maybeUploadImage: PropTypes.func.isRequired, images: PropTypes.array, aspectRatio: PropTypes.string, viewData: PropTypes.object.isRequired }; var _default = FormGenerateResult; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/pages/form-media/screens/image-loader.js": /*!*******************************************************************************!*\ !*** ../modules/ai/assets/js/editor/pages/form-media/screens/image-loader.js ***! \*******************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); var ImageLoader = function ImageLoader() { return /*#__PURE__*/_react.default.createElement(_ui.Stack, { alignItems: "center", justifyContent: "center", gap: 5, width: "100%" }, /*#__PURE__*/_react.default.createElement(_icons.AIIcon, { sx: { color: 'text.primary', fontSize: '60px', mb: 3 } }), /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "h4", sx: { color: 'text.primary' } }, __('Bringing your vision to life...', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "body2" }, __('Hold tight, painting dreams might take a moment.', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Box, { sx: { px: 4, py: 6, width: '100%', maxWidth: 600 } }, /*#__PURE__*/_react.default.createElement(_ui.LinearProgress, { color: "inherit" }))); }; var _default = ImageLoader; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/pages/form-media/screens/image-preview.js": /*!********************************************************************************!*\ !*** ../modules/ai/assets/js/editor/pages/form-media/screens/image-preview.js ***! \********************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var ImagePreview = function ImagePreview(_ref) { var editImage = _ref.editImage; return /*#__PURE__*/_react.default.createElement(_ui.Stack, { alignItems: "flex-start", spacing: 2, flexGrow: 1, sx: { py: 9, overflowY: 'scroll' } }, /*#__PURE__*/_react.default.createElement(_ui.Stack, { direction: "row", spacing: 6, alignSelf: "center", alignItems: "center" }, /*#__PURE__*/_react.default.createElement(_ui.Box, { display: "flex", justifyContent: "center", alignItems: "center" }, /*#__PURE__*/_react.default.createElement("img", { src: editImage.url, alt: '', style: { maxWidth: '90%', maxHeight: '100%' } })))); }; ImagePreview.propTypes = { editImage: PropTypes.object.isRequired }; var _default = ImagePreview; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/pages/form-media/screens/in-painting.js": /*!******************************************************************************!*\ !*** ../modules/ai/assets/js/editor/pages/form-media/screens/in-painting.js ***! \******************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _reactSketchCanvas = __webpack_require__(/*! react-sketch-canvas */ "../node_modules/react-sketch-canvas/dist/react-sketch-canvas.esm.js"); var _undoIcon = _interopRequireDefault(__webpack_require__(/*! ../../../icons/undo-icon */ "../modules/ai/assets/js/editor/icons/undo-icon.js")); var _redoIcon = _interopRequireDefault(__webpack_require__(/*! ../../../icons/redo-icon */ "../modules/ai/assets/js/editor/icons/redo-icon.js")); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } var STROKE_SELECT_WIDTH = 120; var BrushCursor = (0, _ui.styled)(_ui.Box, { shouldForwardProp: function shouldForwardProp(prop) { return 'size' === prop; } })(function (_ref) { var theme = _ref.theme, size = _ref.size; return { position: 'absolute', width: size, height: size, borderRadius: '50%', backgroundColor: theme.palette.common.black, pointerEvents: 'none', transform: "translate(".concat('rtl' === theme.direction ? '50%' : '-50%', ", -50%)") }; }); var BrishSizeIcon = (0, _ui.styled)(_ui.Box, { shouldForwardProp: function shouldForwardProp(prop) { return 'size' === prop; } })(function (_ref2) { var theme = _ref2.theme, size = _ref2.size; return { width: size / 2, height: size / 2, borderRadius: '50%', backgroundColor: theme.palette.secondary.main }; }); var InPainting = function InPainting(_ref3) { var editImage = _ref3.editImage, setMaskImage = _ref3.setMaskImage, viewData = _ref3.viewData; var sketchRef = (0, _react.useRef)(); var _useState = (0, _react.useState)(30), _useState2 = (0, _slicedToArray2.default)(_useState, 2), stroke = _useState2[0], setStroke = _useState2[1]; var brushCursorRef = (0, _react.useRef)(); var canvasWidth = viewData.width, canvasHeight = viewData.height; (0, _react.useEffect)(function () { var canvas = document.querySelector('.eui-in-painting-canvas'); // The BrushCursor should follow the mouse position but should stay only inside the canvas. var positionElement = function positionElement(e) { var _canvas$getBoundingCl = canvas.getBoundingClientRect(), left = _canvas$getBoundingCl.left, top = _canvas$getBoundingCl.top, width = _canvas$getBoundingCl.width, height = _canvas$getBoundingCl.height; var x = e.clientX - left; var y = e.clientY - top; if (x > 0 && x < width && y > 0 && y < height) { brushCursorRef.current.style.left = "".concat(x, "px"); brushCursorRef.current.style.top = "".concat(y, "px"); } }; window.addEventListener('mousemove', positionElement); return function () { window.removeEventListener('mousemove', positionElement); }; }, [stroke]); return /*#__PURE__*/_react.default.createElement(_ui.Stack, { alignItems: "flex-start", spacing: 2, flexGrow: 1, sx: { pt: 9 } }, /*#__PURE__*/_react.default.createElement(_ui.Stack, { width: "100%", direction: "row", spacing: 7, alignSelf: "center", justifyContent: "center", sx: { mb: 6 } }, /*#__PURE__*/_react.default.createElement(_ui.Stack, { direction: "row", gap: 3 }, /*#__PURE__*/_react.default.createElement(_ui.Tooltip, { title: "Undo" }, /*#__PURE__*/_react.default.createElement(_ui.Button, { variant: "outlined", color: "secondary", onClick: function onClick() { return sketchRef.current.undo(); }, sx: { px: 0 } }, /*#__PURE__*/_react.default.createElement(_undoIcon.default, null))), /*#__PURE__*/_react.default.createElement(_ui.Tooltip, { title: "Redo" }, /*#__PURE__*/_react.default.createElement(_ui.Button, { variant: "outlined", color: "secondary", onClick: function onClick() { return sketchRef.current.redo(); }, sx: { px: 0 } }, /*#__PURE__*/_react.default.createElement(_redoIcon.default, null)))), /*#__PURE__*/_react.default.createElement(_ui.FormControl, { sx: { minWidth: STROKE_SELECT_WIDTH } }, /*#__PURE__*/_react.default.createElement(_ui.InputLabel, { id: "stroke" }, "Stroke"), /*#__PURE__*/_react.default.createElement(_ui.Select, { autoWidth: true, label: "Stroke", value: stroke, color: "secondary", id: "demo-simple-select", labelId: "demo-simple-select-label", onChange: function onChange(e) { return setStroke(e.target.value); }, MenuProps: { PaperProps: { sx: { maxWidth: STROKE_SELECT_WIDTH } }, MenuListProps: { sx: { minWidth: STROKE_SELECT_WIDTH } } }, sx: { '& .MuiSelect-select .MuiListItemIcon-root': { mr: 1, width: 'initial', minWidth: 'initial', justifyContent: 'flex-start' } } }, [10, 20, 30, 40, 50].map(function (value) { return /*#__PURE__*/_react.default.createElement(_ui.MenuItem, { key: 'stroke-width-option-' + value, value: value }, /*#__PURE__*/_react.default.createElement(_ui.Stack, { direction: "row", alignItems: "center", gap: 3 }, /*#__PURE__*/_react.default.createElement(_ui.ListItemIcon, { sx: { width: 30, display: 'flex', justifyContent: 'center' } }, /*#__PURE__*/_react.default.createElement(BrishSizeIcon, { size: value })), /*#__PURE__*/_react.default.createElement(_ui.ListItemText, null, value))); })))), /*#__PURE__*/_react.default.createElement("div", { style: { margin: '0 auto', position: 'relative', cursor: 'none', overflow: 'hidden' } }, /*#__PURE__*/_react.default.createElement(BrushCursor, { ref: brushCursorRef, size: stroke }), /*#__PURE__*/_react.default.createElement(_reactSketchCanvas.ReactSketchCanvas, { className: "eui-in-painting-canvas", withViewBox: true, ref: sketchRef, height: canvasHeight + 'px', width: canvasWidth + 'px', strokeWidth: stroke, strokeColor: 'black', backgroundImage: editImage.url, onChange: /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() { var svg; return _regenerator.default.wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { case 0: _context.next = 2; return sketchRef.current.exportSvg(); case 2: svg = _context.sent; setMaskImage(svg); case 4: case "end": return _context.stop(); } }, _callee); })) }))); }; InPainting.propTypes = { editImage: PropTypes.object.isRequired, setMaskImage: PropTypes.func.isRequired, promptSettings: PropTypes.object.isRequired, viewData: PropTypes.object.isRequired }; var _default = InPainting; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/pages/form-media/screens/out-painting.js": /*!*******************************************************************************!*\ !*** ../modules/ai/assets/js/editor/pages/form-media/screens/out-painting.js ***! \*******************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _reactAvatarEditor = _interopRequireDefault(__webpack_require__(/*! react-avatar-editor */ "../node_modules/react-avatar-editor/dist/index.js")); var _consts = __webpack_require__(/*! ../consts/consts */ "../modules/ai/assets/js/editor/pages/form-media/consts/consts.js"); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } var OutPainting = function OutPainting(_ref) { var editImage = _ref.editImage, setMaskImage = _ref.setMaskImage, promptSettings = _ref.promptSettings, viewData = _ref.viewData; var cropperRef = (0, _react.useRef)(); var width = viewData.width, height = viewData.height; var scale = promptSettings[_consts.IMAGE_PROMPT_SETTINGS.ZOOM] || 1; var updateMask = /*#__PURE__*/function () { var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() { var imageDataURL; return _regenerator.default.wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { case 0: _context.next = 2; return cropperRef.current.getImageScaledToCanvas().toDataURL(); case 2: imageDataURL = _context.sent; setMaskImage(imageDataURL); case 4: case "end": return _context.stop(); } }, _callee); })); return function updateMask() { return _ref2.apply(this, arguments); }; }(); return /*#__PURE__*/_react.default.createElement(_ui.Stack, { alignItems: 'center', spacing: 2, flexGrow: 1, sx: { pt: 9 } }, /*#__PURE__*/_react.default.createElement(_reactAvatarEditor.default, { ref: cropperRef, image: editImage.url, style: { backgroundImage: 'linear-gradient(45deg, #bbb 25%, transparent 25%), linear-gradient(-45deg, #bbb 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #bbb 75%), linear-gradient(-45deg, transparent 75%, #bbb 75%)', backgroundSize: '20px 20px', backgroundPosition: '0 0, 0 10px, 10px -10px, -10px 0px', outline: '2px dashed #000', marginTop: '12px' }, color: [0, 0, 0, 0.9], rotate: 0, border: 0, allowZoomOut: true, backgroundColor: 'transparent', showGrid: true, onImageChange: function onImageChange() { return updateMask(); }, onPositionChange: function onPositionChange() { return updateMask(); }, width: width, height: height, scale: scale })); }; OutPainting.propTypes = { editImage: PropTypes.object.isRequired, setMaskImage: PropTypes.func.isRequired, promptSettings: PropTypes.object.isRequired, viewData: PropTypes.object.isRequired }; var _default = OutPainting; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/pages/form-media/screens/prompt-gallery.js": /*!*********************************************************************************!*\ !*** ../modules/ai/assets/js/editor/pages/form-media/screens/prompt-gallery.js ***! \*********************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _loader = _interopRequireDefault(__webpack_require__(/*! ../../../components/loader */ "../modules/ai/assets/js/editor/components/loader.js")); var _useImagesPreload2 = _interopRequireDefault(__webpack_require__(/*! ../../../hooks/use-images-preload */ "../modules/ai/assets/js/editor/hooks/use-images-preload.js")); var _consts = __webpack_require__(/*! ../consts/consts */ "../modules/ai/assets/js/editor/pages/form-media/consts/consts.js"); var _useSessionStorage2 = _interopRequireDefault(__webpack_require__(/*! ../../../hooks/use-session-storage */ "../modules/ai/assets/js/editor/hooks/use-session-storage.js")); var _overlay = _interopRequireDefault(__webpack_require__(/*! ../../../components/ui/overlay */ "../modules/ai/assets/js/editor/components/ui/overlay.js")); var _overlayBar = _interopRequireDefault(__webpack_require__(/*! ../../../components/ui/overlay-bar */ "../modules/ai/assets/js/editor/components/ui/overlay-bar.js")); var _copyIcon = _interopRequireDefault(__webpack_require__(/*! ../../../icons/copy-icon */ "../modules/ai/assets/js/editor/icons/copy-icon.js")); var _downloadIcon = _interopRequireDefault(__webpack_require__(/*! ../../../icons/download-icon */ "../modules/ai/assets/js/editor/icons/download-icon.js")); var _editIcon = _interopRequireDefault(__webpack_require__(/*! ../../../icons/edit-icon */ "../modules/ai/assets/js/editor/icons/edit-icon.js")); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } var shuffleImages = function shuffleImages(images) { return images.map(function (image) { return [Math.random(), image]; }).sort(function (_ref, _ref2) { var _ref3 = (0, _slicedToArray2.default)(_ref, 1), a = _ref3[0]; var _ref4 = (0, _slicedToArray2.default)(_ref2, 1), b = _ref4[0]; return a - b; }).map(function (_ref5) { var _ref6 = (0, _slicedToArray2.default)(_ref5, 2), image = _ref6[1]; return image; }); }; var PromptGallery = function PromptGallery(_ref7) { var maybeUploadImage = _ref7.maybeUploadImage, setPrompt = _ref7.setPrompt, selectedCategory = _ref7.selectedCategory, updatePromptSettings = _ref7.updatePromptSettings; var _useSessionStorage = (0, _useSessionStorage2.default)('ai-image-gallery', { images: [] }), data = _useSessionStorage.data, setStateAndSessionData = _useSessionStorage.setStateAndSessionData; var _useImagesPreload = (0, _useImagesPreload2.default)('thumbnailUrl'), imagesPreloaded = _useImagesPreload.imagesPreloaded, preloadImages = _useImagesPreload.preloadImages; var imagesToRender = (0, _react.useMemo)(function () { var shuffledImages = shuffleImages(data.images); if (!selectedCategory) { return shuffledImages; } var categoryImages = shuffledImages.filter(function (_ref8) { var imageType = _ref8.imageType; return imageType.includes(selectedCategory); }); // Some categories don't have images, so we TEMPORARLY fallback to the shuffled images. return categoryImages.length ? categoryImages : shuffledImages; }, [selectedCategory, data]); var fetchJson = function fetchJson() { fetch('https://my.elementor.com/ai/images-prompt-gallery/ai-gallery.json').then(function (response) { return response.json(); }).then(function (json) { return setStateAndSessionData(json); }).catch(function (e) { return console.log(e.message); }); }; (0, _react.useEffect)(function () { if (0 === (data === null || data === void 0 ? void 0 : data.images.length)) { fetchJson(); return; } preloadImages(data.images); }, [data]); if (!imagesPreloaded) { return /*#__PURE__*/_react.default.createElement(_ui.Box, { sx: { width: '100%', maxWidth: 600, margin: '0 auto', alignSelf: 'center' } }, /*#__PURE__*/_react.default.createElement(_loader.default, { color: "inherit" })); } return /*#__PURE__*/_react.default.createElement(_ui.Box, { sx: { overflowY: 'scroll', p: 8 }, flexGrow: 1 }, /*#__PURE__*/_react.default.createElement(_ui.Stack, { gap: 4, sx: { mb: 7 } }, /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "h6" }, __('Spark your imagination with images generated by our community', 'elementor'))), /*#__PURE__*/_react.default.createElement(_ui.ImageList, { width: "100%", cols: 3, gap: 24 }, imagesToRender.map(function (suggestedPrompt) { return /*#__PURE__*/_react.default.createElement(_ui.ImageListItem, { key: suggestedPrompt.prompt }, /*#__PURE__*/_react.default.createElement("img", { src: "".concat(suggestedPrompt.thumbnailUrl), alt: suggestedPrompt.prompt, style: { width: '100%', maxHeight: '238px' } }), /*#__PURE__*/_react.default.createElement(_overlay.default, null, /*#__PURE__*/_react.default.createElement(_overlayBar.default, { gap: 3, position: "bottom" }, /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "caption", color: "common.white" }, suggestedPrompt.prompt), /*#__PURE__*/_react.default.createElement(_ui.Box, { display: "flex", justifyContent: "space-between", alignItems: "center" }, /*#__PURE__*/_react.default.createElement(_ui.Button, { fullWidth: true, size: "small", variant: "contained", startIcon: /*#__PURE__*/_react.default.createElement(_downloadIcon.default, null), onClick: function onClick() { return maybeUploadImage(suggestedPrompt, true); } }, __('Use Image', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Tooltip, { title: __('Copy prompt', 'elementor') }, /*#__PURE__*/_react.default.createElement(_ui.IconButton, { sx: { mr: -4, ml: 2, color: 'common.white', '&:hover': { color: 'common.white' } }, onClick: function onClick() { var _updatePromptSettings; setPrompt(suggestedPrompt.prompt); var _suggestedPrompt$imag = suggestedPrompt.imageType.split('/'), _suggestedPrompt$imag2 = (0, _slicedToArray2.default)(_suggestedPrompt$imag, 2), stylePreset = _suggestedPrompt$imag2[0], imageType = _suggestedPrompt$imag2[1]; updatePromptSettings((_updatePromptSettings = {}, (0, _defineProperty2.default)(_updatePromptSettings, _consts.IMAGE_PROMPT_SETTINGS.IMAGE_TYPE, stylePreset), (0, _defineProperty2.default)(_updatePromptSettings, _consts.IMAGE_PROMPT_SETTINGS.STYLE_PRESET, imageType), _updatePromptSettings)); } }, /*#__PURE__*/_react.default.createElement(_copyIcon.default, null))), /*#__PURE__*/_react.default.createElement(_ui.Tooltip, { title: __('Edit', 'elementor') }, /*#__PURE__*/_react.default.createElement(_ui.IconButton, { sx: { mr: -4, ml: 2, color: 'common.white', '&:hover': { color: 'common.white' } }, onClick: function onClick() { return maybeUploadImage(suggestedPrompt); } }, /*#__PURE__*/_react.default.createElement(_editIcon.default, null))))))); }))); }; PromptGallery.propTypes = { maybeUploadImage: PropTypes.func, setPrompt: PropTypes.func, selectedCategory: PropTypes.string, updatePromptSettings: PropTypes.func, aspectRatio: PropTypes.string }; var _default = PromptGallery; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/pages/form-media/screens/screen.js": /*!*************************************************************************!*\ !*** ../modules/ai/assets/js/editor/pages/form-media/screens/screen.js ***! \*************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Screen = void 0; var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); var _imageLoader = _interopRequireDefault(__webpack_require__(/*! ./image-loader */ "../modules/ai/assets/js/editor/pages/form-media/screens/image-loader.js")); var _consts = __webpack_require__(/*! ../consts/consts */ "../modules/ai/assets/js/editor/pages/form-media/consts/consts.js"); var _generateResult = _interopRequireDefault(__webpack_require__(/*! ./generate-result */ "../modules/ai/assets/js/editor/pages/form-media/screens/generate-result.js")); var _promptGallery = _interopRequireDefault(__webpack_require__(/*! ./prompt-gallery */ "../modules/ai/assets/js/editor/pages/form-media/screens/prompt-gallery.js")); var _variationsPlaceholder = _interopRequireDefault(__webpack_require__(/*! ./variations-placeholder */ "../modules/ai/assets/js/editor/pages/form-media/screens/variations-placeholder.js")); var _imagePreview = _interopRequireDefault(__webpack_require__(/*! ./image-preview */ "../modules/ai/assets/js/editor/pages/form-media/screens/image-preview.js")); var _inPainting = _interopRequireDefault(__webpack_require__(/*! ./in-painting */ "../modules/ai/assets/js/editor/pages/form-media/screens/in-painting.js")); var _outPainting = _interopRequireDefault(__webpack_require__(/*! ./out-painting */ "../modules/ai/assets/js/editor/pages/form-media/screens/out-painting.js")); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } var Screen = function Screen(_ref) { var isLoading = _ref.isLoading, isUploading = _ref.isUploading, screen = _ref.screen, images = _ref.images, generateNewPrompt = _ref.generateNewPrompt, maybeUploadImage = _ref.maybeUploadImage, setPrompt = _ref.setPrompt, promptSettings = _ref.promptSettings, updatePromptSettings = _ref.updatePromptSettings, editImage = _ref.editImage, setMaskImage = _ref.setMaskImage, viewData = _ref.viewData, shouldWaitForInitialImage = _ref.shouldWaitForInitialImage; /** * The aspect ratio value should be changed only when getting a new instance of the images array. * Otherwise, each change of the selection will cause a re-render and will affect the current images. */ var cachedAspectRation = (0, _react.useMemo)(function () { return promptSettings[_consts.IMAGE_PROMPT_SETTINGS.ASPECT_RATIO]; }, [images]); if (isLoading || isUploading || shouldWaitForInitialImage) { return /*#__PURE__*/_react.default.createElement(_imageLoader.default, null); } if (screen === _consts.SCREENS.GENERATE_RESULTS) { return /*#__PURE__*/_react.default.createElement(_generateResult.default, { images: images, generateNewPrompt: generateNewPrompt, maybeUploadImage: maybeUploadImage, aspectRatio: cachedAspectRation, viewData: viewData }); } if (screen === _consts.SCREENS.VARIATIONS) { return /*#__PURE__*/_react.default.createElement(_variationsPlaceholder.default, null); } if (screen === _consts.SCREENS.IMAGE_EDITOR) { return /*#__PURE__*/_react.default.createElement(_imagePreview.default, { editImage: editImage }); } if (screen === _consts.SCREENS.IN_PAINTING) { return /*#__PURE__*/_react.default.createElement(_inPainting.default, { editImage: editImage, setMaskImage: setMaskImage, promptSettings: promptSettings, viewData: viewData }); } if (screen === _consts.SCREENS.OUT_PAINTING) { return /*#__PURE__*/_react.default.createElement(_outPainting.default, { editImage: editImage, setMaskImage: setMaskImage, promptSettings: promptSettings, viewData: viewData }); } return /*#__PURE__*/_react.default.createElement(_promptGallery.default, { setPrompt: setPrompt, maybeUploadImage: maybeUploadImage, updatePromptSettings: updatePromptSettings, selectedCategory: promptSettings[_consts.IMAGE_PROMPT_SETTINGS.IMAGE_TYPE] }); }; exports.Screen = Screen; Screen.propTypes = { isLoading: PropTypes.bool.isRequired, isUploading: PropTypes.bool.isRequired, screen: PropTypes.string, images: PropTypes.array, generateNewPrompt: PropTypes.func, maybeUploadImage: PropTypes.func, setPrompt: PropTypes.func, promptSettings: PropTypes.object, updatePromptSettings: PropTypes.func, editImage: PropTypes.object, setMaskImage: PropTypes.func, viewData: PropTypes.object, shouldWaitForInitialImage: PropTypes.bool }; /***/ }), /***/ "../modules/ai/assets/js/editor/pages/form-media/screens/variations-placeholder.js": /*!*****************************************************************************************!*\ !*** ../modules/ai/assets/js/editor/pages/form-media/screens/variations-placeholder.js ***! \*****************************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); var VariationsPlaceholder = function VariationsPlaceholder() { return /*#__PURE__*/_react.default.createElement(_ui.Box, { sx: { overflowY: 'scroll', p: 8 }, flexGrow: 1 }, /*#__PURE__*/_react.default.createElement(_ui.Box, { display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: 7 }, Array(4).fill(true).map(function (_, index) { return /*#__PURE__*/_react.default.createElement(_ui.Box, { key: "placeholder-".concat(index), display: "flex", justifyContent: "center", alignItems: "center", sx: { bgcolor: 'secondary.background', height: 336 } }, /*#__PURE__*/_react.default.createElement(_icons.AIIcon, { color: "secondary", sx: { fontSize: 36 } })); }))); }; VariationsPlaceholder.propTypes = {}; var _default = VariationsPlaceholder; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/pages/form-media/utils/index.js": /*!**********************************************************************!*\ !*** ../modules/ai/assets/js/editor/pages/form-media/utils/index.js ***! \**********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getAspectRatioSizes = void 0; var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); var _consts = __webpack_require__(/*! ../consts/consts */ "../modules/ai/assets/js/editor/pages/form-media/consts/consts.js"); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } var getAspectRatioSizes = function getAspectRatioSizes(width, height) { var aspectRatios = Object.keys(_consts.IMAGE_ASPECT_RATIO_DIMENSIONS); var targetRatio = width / height; var closestRatio = aspectRatios[0]; var minDiff = Infinity; aspectRatios.forEach(function (ratio) { var _ratio$split$map = ratio.split(':').map(Number), _ratio$split$map2 = (0, _slicedToArray2.default)(_ratio$split$map, 2), w = _ratio$split$map2[0], h = _ratio$split$map2[1]; var diff = Math.abs(targetRatio - w / h); if (diff < minDiff) { minDiff = diff; closestRatio = ratio; } }); return _objectSpread({ ratio: closestRatio }, _consts.IMAGE_ASPECT_RATIO_DIMENSIONS[closestRatio]); }; exports.getAspectRatioSizes = getAspectRatioSizes; /***/ }), /***/ "../modules/ai/assets/js/editor/pages/form-text/index.js": /*!***************************************************************!*\ !*** ../modules/ai/assets/js/editor/pages/form-text/index.js ***! \***************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); var _loader = _interopRequireDefault(__webpack_require__(/*! ../../components/loader */ "../modules/ai/assets/js/editor/components/loader.js")); var _promptSearch = _interopRequireDefault(__webpack_require__(/*! ../../components/prompt-search */ "../modules/ai/assets/js/editor/components/prompt-search.js")); var _textarea = _interopRequireDefault(__webpack_require__(/*! ../../components/textarea */ "../modules/ai/assets/js/editor/components/textarea.js")); var _promptSuggestions = _interopRequireDefault(__webpack_require__(/*! ../../components/prompt-suggestions */ "../modules/ai/assets/js/editor/components/prompt-suggestions.js")); var _promptActionSelection = _interopRequireDefault(__webpack_require__(/*! ../../components/prompt-action-selection */ "../modules/ai/assets/js/editor/components/prompt-action-selection.js")); var _generateButton = _interopRequireDefault(__webpack_require__(/*! ../../components/generate-button */ "../modules/ai/assets/js/editor/components/generate-button.js")); var _promptAction = _interopRequireDefault(__webpack_require__(/*! ../../components/prompt-action */ "../modules/ai/assets/js/editor/components/prompt-action.js")); var _promptErrorMessage = _interopRequireDefault(__webpack_require__(/*! ../../components/prompt-error-message */ "../modules/ai/assets/js/editor/components/prompt-error-message.js")); var _useTextPrompt2 = _interopRequireDefault(__webpack_require__(/*! ../../hooks/use-text-prompt */ "../modules/ai/assets/js/editor/hooks/use-text-prompt.js")); var _actionsData = __webpack_require__(/*! ../../actions-data */ "../modules/ai/assets/js/editor/actions-data.js"); var _promptCredits = _interopRequireDefault(__webpack_require__(/*! ../../components/prompt-credits */ "../modules/ai/assets/js/editor/components/prompt-credits.js")); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } var promptActions = [{ label: __('Simplify language', 'elementor'), icon: /*#__PURE__*/_react.default.createElement(_icons.MessageIcon, null), value: 'Simplify the language of the following message' }, { label: __('Make it longer', 'elementor'), icon: /*#__PURE__*/_react.default.createElement(_icons.ExpandIcon, null), value: 'Make the following message longer' }, { label: __('Make it shorter', 'elementor'), icon: /*#__PURE__*/_react.default.createElement(_icons.ShrinkIcon, null), value: 'Make the following message shorter' }, { label: __('Fix spelling & grammar', 'elementor'), icon: /*#__PURE__*/_react.default.createElement(_icons.AIIcon, null), value: 'Fix the spelling and grammar of the following message' }]; var promptInstructions = [{ label: __('Change tone', 'elementor'), options: _actionsData.vocalTones, getInstruction: function getInstruction(value) { return "Change the tone of the following message to ".concat(value); } }, { label: __('Translate to', 'elementor'), options: _actionsData.translateLanguages, getInstruction: function getInstruction(value) { return "Translate the following message to ".concat(value); } }]; var FormText = function FormText(_ref) { var type = _ref.type, onClose = _ref.onClose, getControlValue = _ref.getControlValue, setControlValue = _ref.setControlValue, additionalOptions = _ref.additionalOptions, credits = _ref.credits, usagePercentage = _ref.usagePercentage; var initialValue = getControlValue() === (additionalOptions === null || additionalOptions === void 0 ? void 0 : additionalOptions.defaultValue) ? '' : getControlValue(); var _useTextPrompt = (0, _useTextPrompt2.default)({ result: initialValue, credits: credits }), data = _useTextPrompt.data, isLoading = _useTextPrompt.isLoading, error = _useTextPrompt.error, reset = _useTextPrompt.reset, send = _useTextPrompt.send, sendUsageData = _useTextPrompt.sendUsageData; var _useState = (0, _react.useState)(''), _useState2 = (0, _slicedToArray2.default)(_useState, 2), prompt = _useState2[0], setPrompt = _useState2[1]; var searchField = (0, _react.useRef)(null); var resultField = (0, _react.useRef)(null); var lastRun = (0, _react.useRef)(function () {}); var autocompleteItems = 'textarea' === type ? _actionsData.textareaAutocomplete : _actionsData.textAutocomplete; var showSuggestions = !prompt; var handleSubmit = function handleSubmit(event) { event.preventDefault(); lastRun.current = function () { return send(prompt); }; lastRun.current(); }; var handleCustomInstruction = /*#__PURE__*/function () { var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(instruction) { return _regenerator.default.wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { case 0: lastRun.current = function () { return send(resultField.current.value, instruction); }; lastRun.current(); case 2: case "end": return _context.stop(); } }, _callee); })); return function handleCustomInstruction(_x) { return _ref2.apply(this, arguments); }; }(); var handleSuggestion = function handleSuggestion(suggestion) { setPrompt(suggestion + ' '); searchField.current.focus(); }; var applyPrompt = function applyPrompt() { sendUsageData(); setControlValue(resultField.current.value); onClose(); }; if (isLoading) { return /*#__PURE__*/_react.default.createElement(_loader.default, null); } return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, error && /*#__PURE__*/_react.default.createElement(_promptErrorMessage.default, { error: error, onRetry: lastRun.current, sx: { mb: 6 } }), !data.result && /*#__PURE__*/_react.default.createElement(_ui.Box, { component: "form", onSubmit: handleSubmit }, /*#__PURE__*/_react.default.createElement(_ui.Box, { sx: { mb: 6 } }, /*#__PURE__*/_react.default.createElement(_promptSearch.default, { ref: searchField, placeholder: __('Describe the text and tone you want to use...', 'elementor'), name: "prompt", value: prompt, onChange: function onChange(event) { return setPrompt(event.target.value); } })), showSuggestions && /*#__PURE__*/_react.default.createElement(_promptSuggestions.default, { suggestions: autocompleteItems, onSelect: handleSuggestion, suggestionFilter: function suggestionFilter(suggestion) { return suggestion + '...'; } }), /*#__PURE__*/_react.default.createElement(_ui.Stack, { direction: "row", alignItems: "center", sx: { py: 4, mt: 8 } }, /*#__PURE__*/_react.default.createElement(_promptCredits.default, { usagePercentage: usagePercentage }), /*#__PURE__*/_react.default.createElement(_ui.Stack, { direction: "row", justifyContent: "flex-end", flexGrow: 1 }, /*#__PURE__*/_react.default.createElement(_generateButton.default, null, __('Generate text', 'elementor'))))), data.result && /*#__PURE__*/_react.default.createElement(_ui.Box, { sx: { mt: 3 } }, /*#__PURE__*/_react.default.createElement(_textarea.default, { fullWidth: true, ref: resultField, defaultValue: data.result, helperText: __('Text generated by AI may be inaccurate or offensive.', 'elementor') }), /*#__PURE__*/_react.default.createElement(_ui.Grid, { container: true, spacing: 3, sx: { mt: 6 } }, promptActions.map(function (_ref3) { var label = _ref3.label, icon = _ref3.icon, value = _ref3.value; return /*#__PURE__*/_react.default.createElement(_ui.Grid, { item: true, key: label }, /*#__PURE__*/_react.default.createElement(_promptAction.default, { label: label, icon: icon, onClick: function onClick() { return handleCustomInstruction(value); } })); })), /*#__PURE__*/_react.default.createElement(_ui.Grid, { container: true, spacing: 3, sx: { mt: 6 } }, promptInstructions.map(function (_ref4) { var label = _ref4.label, options = _ref4.options, getInstruction = _ref4.getInstruction; return /*#__PURE__*/_react.default.createElement(_ui.Grid, { item: true, key: label }, /*#__PURE__*/_react.default.createElement(_promptActionSelection.default, { label: label, options: options, onChange: function onChange(event) { return handleCustomInstruction(getInstruction(event.target.value)); } })); })), /*#__PURE__*/_react.default.createElement(_ui.Stack, { direction: "row", alignItems: "center", sx: { my: 8 } }, /*#__PURE__*/_react.default.createElement(_promptCredits.default, { usagePercentage: usagePercentage }), /*#__PURE__*/_react.default.createElement(_ui.Stack, { direction: "row", gap: 3, justifyContent: "flex-end", flexGrow: 1 }, /*#__PURE__*/_react.default.createElement(_ui.Button, { size: "small", color: "secondary", variant: "text", onClick: reset }, __('New prompt', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Button, { size: "small", variant: "contained", color: "primary", onClick: applyPrompt }, __('Use text', 'elementor')))))); }; FormText.propTypes = { type: PropTypes.string.isRequired, controlType: PropTypes.string, onClose: PropTypes.func.isRequired, getControlValue: PropTypes.func.isRequired, setControlValue: PropTypes.func.isRequired, additionalOptions: PropTypes.object, credits: PropTypes.number, usagePercentage: PropTypes.number }; var _default = FormText; exports["default"] = _default; /***/ }), /***/ "../modules/ai/assets/js/editor/pages/get-started/index.js": /*!*****************************************************************!*\ !*** ../modules/ai/assets/js/editor/pages/get-started/index.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; /* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); var _api = __webpack_require__(/*! ../../api */ "../modules/ai/assets/js/editor/api/index.js"); var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } var GetStarted = function GetStarted(_ref) { var onSuccess = _ref.onSuccess; var _useState = (0, _react.useState)(false), _useState2 = (0, _slicedToArray2.default)(_useState, 2), isTermsChecked = _useState2[0], setIsTermsChecked = _useState2[1]; var onGetStartedClick = /*#__PURE__*/function () { var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() { return _regenerator.default.wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { case 0: _context.next = 2; return (0, _api.setGetStarted)(); case 2: onSuccess(); case 3: case "end": return _context.stop(); } }, _callee); })); return function onGetStartedClick() { return _ref2.apply(this, arguments); }; }(); return /*#__PURE__*/_react.default.createElement(_ui.Stack, { alignItems: "center", gap: 4 }, /*#__PURE__*/_react.default.createElement(_icons.AIIcon, { sx: { color: 'text.primary', fontSize: '60px', mb: 3 } }), /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "h4", sx: { color: 'text.primary' } }, __('Step into the future with Elementor AI', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "body2" }, __('Create smarter with AI text and code generators built right into the editor.', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Stack, { direction: "row", gap: 4, alignItems: "flex-start" }, /*#__PURE__*/_react.default.createElement(_ui.Checkbox, { id: "e-ai-terms-approval", color: "secondary", sx: { p: 0 }, onChange: function onChange() { return setIsTermsChecked(function (prevState) { return !prevState; }); } }), /*#__PURE__*/_react.default.createElement(_ui.Stack, null, /*#__PURE__*/_react.default.createElement(_ui.Typography, { variant: "caption", sx: { maxWidth: 520 }, component: "label", htmlFor: "e-ai-terms-approval" }, __('I approve the ', 'elementor'), /*#__PURE__*/_react.default.createElement(_ui.Link, { href: "https://go.elementor.com/ai-terms/", target: "_blank", color: "info.main" }, __('Terms of Service', 'elementor')), ' & ', /*#__PURE__*/_react.default.createElement(_ui.Link, { href: "https://go.elementor.com/ai-privacy-policy/", target: "_blank", color: "info.main" }, __('Privacy Policy', 'elementor')), __(' of the Elementor AI service.', 'elementor'), /*#__PURE__*/_react.default.createElement("br", null), __('This includes consenting to the collection and use of data to improve user experience.', 'elementor')))), /*#__PURE__*/_react.default.createElement(_ui.Button, { disabled: !isTermsChecked, variant: "contained", onClick: onGetStartedClick, sx: { mt: 3, '&:hover': { color: 'primary.contrastText' } } }, __('Get Started', 'elementor'))); }; GetStarted.propTypes = { onSuccess: PropTypes.func.isRequired }; var _default = GetStarted; exports["default"] = _default; /***/ }), /***/ "../node_modules/clsx/dist/clsx.m.js": /*!*******************************************!*\ !*** ../node_modules/clsx/dist/clsx.m.js ***! \*******************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "clsx": () => (/* binding */ clsx), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (clsx); /***/ }), /***/ "../node_modules/debug/src/browser.js": /*!********************************************!*\ !*** ../node_modules/debug/src/browser.js ***! \********************************************/ /***/ ((module, exports, __webpack_require__) => { /* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); exports.destroy = (() => { let warned = false; return () => { if (!warned) { warned = true; console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); } }; })(); /** * Colors. */ exports.colors = [ '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33' ]; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || // Is firebug? http://stackoverflow.com/a/398120/376773 (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || // Double check webkit in userAgent just in case we are in a worker (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } const c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into let index = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, match => { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.debug()` when available. * No-op when `console.debug` is not a "function". * If `console.debug` is not available, falls back * to `console.log`. * * @api public */ exports.log = console.debug || console.log || (() => {}); /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { let r; try { r = exports.storage.getItem('debug'); } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } module.exports = __webpack_require__(/*! ./common */ "../node_modules/debug/src/common.js")(exports); const {formatters} = module.exports; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; /***/ }), /***/ "../node_modules/debug/src/common.js": /*!*******************************************!*\ !*** ../node_modules/debug/src/common.js ***! \*******************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = __webpack_require__(/*! ms */ "../node_modules/ms/index.js"); createDebug.destroy = destroy; Object.keys(env).forEach(key => { createDebug[key] = env[key]; }); /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { let hash = 0; for (let i = 0; i < namespace.length; i++) { hash = ((hash << 5) - hash) + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { let prevTime; let enableOverride = null; let namespacesCache; let enabledCache; function debug(...args) { // Disabled? if (!debug.enabled) { return; } const self = debug; // Set `diff` timestamp const curr = Number(new Date()); const ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations let index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return '%'; } index++; const formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { const val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); const logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.useColors = createDebug.useColors(); debug.color = createDebug.selectColor(namespace); debug.extend = extend; debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. Object.defineProperty(debug, 'enabled', { enumerable: true, configurable: false, get: () => { if (enableOverride !== null) { return enableOverride; } if (namespacesCache !== createDebug.namespaces) { namespacesCache = createDebug.namespaces; enabledCache = createDebug.enabled(namespace); } return enabledCache; }, set: v => { enableOverride = v; } }); // Env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } return debug; } function extend(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.namespaces = namespaces; createDebug.names = []; createDebug.skips = []; let i; const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); const len = split.length; for (i = 0; i < len; i++) { if (!split[i]) { // ignore empty strings continue; } namespaces = split[i].replace(/\*/g, '.*?'); if (namespaces[0] === '-') { createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$')); } else { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { const namespaces = [ ...createDebug.names.map(toNamespace), ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) ].join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { if (name[name.length - 1] === '*') { return true; } let i; let len; for (i = 0, len = createDebug.skips.length; i < len; i++) { if (createDebug.skips[i].test(name)) { return false; } } for (i = 0, len = createDebug.names.length; i < len; i++) { if (createDebug.names[i].test(name)) { return true; } } return false; } /** * Convert regexp to namespace * * @param {RegExp} regxep * @return {String} namespace * @api private */ function toNamespace(regexp) { return regexp.toString() .substring(2, regexp.toString().length - 2) .replace(/\.\*\?$/, '*'); } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } /** * XXX DO NOT USE. This is a temporary stub function. * XXX It WILL be removed in the next major release. */ function destroy() { console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; /***/ }), /***/ "../node_modules/extend/index.js": /*!***************************************!*\ !*** ../node_modules/extend/index.js ***! \***************************************/ /***/ ((module) => { "use strict"; var hasOwn = Object.prototype.hasOwnProperty; var toStr = Object.prototype.toString; var defineProperty = Object.defineProperty; var gOPD = Object.getOwnPropertyDescriptor; var isArray = function isArray(arr) { if (typeof Array.isArray === 'function') { return Array.isArray(arr); } return toStr.call(arr) === '[object Array]'; }; var isPlainObject = function isPlainObject(obj) { if (!obj || toStr.call(obj) !== '[object Object]') { return false; } var hasOwnConstructor = hasOwn.call(obj, 'constructor'); var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); // Not own constructor property must be Object if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { return false; } // Own properties are enumerated firstly, so to speed up, // if last one is own, then all properties are own. var key; for (key in obj) { /**/ } return typeof key === 'undefined' || hasOwn.call(obj, key); }; // If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target var setProperty = function setProperty(target, options) { if (defineProperty && options.name === '__proto__') { defineProperty(target, options.name, { enumerable: true, configurable: true, value: options.newValue, writable: true }); } else { target[options.name] = options.newValue; } }; // Return undefined instead of __proto__ if '__proto__' is not an own property var getProperty = function getProperty(obj, name) { if (name === '__proto__') { if (!hasOwn.call(obj, name)) { return void 0; } else if (gOPD) { // In early versions of node, obj['__proto__'] is buggy when obj has // __proto__ as an own property. Object.getOwnPropertyDescriptor() works. return gOPD(obj, name).value; } } return obj[name]; }; module.exports = function extend() { var options, name, src, copy, copyIsArray, clone; var target = arguments[0]; var i = 1; var length = arguments.length; var deep = false; // Handle a deep copy situation if (typeof target === 'boolean') { deep = target; target = arguments[1] || {}; // skip the boolean and the target i = 2; } if (target == null || (typeof target !== 'object' && typeof target !== 'function')) { target = {}; } for (; i < length; ++i) { options = arguments[i]; // Only deal with non-null/undefined values if (options != null) { // Extend the base object for (name in options) { src = getProperty(target, name); copy = getProperty(options, name); // Prevent never-ending loop if (target !== copy) { // Recurse if we're merging plain objects or arrays if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { if (copyIsArray) { copyIsArray = false; clone = src && isArray(src) ? src : []; } else { clone = src && isPlainObject(src) ? src : {}; } // Never move original objects, clone them setProperty(target, { name: name, newValue: extend(deep, clone, copy) }); // Don't bring in undefined values } else if (typeof copy !== 'undefined') { setProperty(target, { name: name, newValue: copy }); } } } } } // Return the modified object return target; }; /***/ }), /***/ "../node_modules/inline-style-parser/index.js": /*!****************************************************!*\ !*** ../node_modules/inline-style-parser/index.js ***! \****************************************************/ /***/ ((module) => { // http://www.w3.org/TR/CSS21/grammar.html // https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027 var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g; var NEWLINE_REGEX = /\n/g; var WHITESPACE_REGEX = /^\s*/; // declaration var PROPERTY_REGEX = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/; var COLON_REGEX = /^:\s*/; var VALUE_REGEX = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/; var SEMICOLON_REGEX = /^[;\s]*/; // https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill var TRIM_REGEX = /^\s+|\s+$/g; // strings var NEWLINE = '\n'; var FORWARD_SLASH = '/'; var ASTERISK = '*'; var EMPTY_STRING = ''; // types var TYPE_COMMENT = 'comment'; var TYPE_DECLARATION = 'declaration'; /** * @param {String} style * @param {Object} [options] * @return {Object[]} * @throws {TypeError} * @throws {Error} */ module.exports = function(style, options) { if (typeof style !== 'string') { throw new TypeError('First argument must be a string'); } if (!style) return []; options = options || {}; /** * Positional. */ var lineno = 1; var column = 1; /** * Update lineno and column based on `str`. * * @param {String} str */ function updatePosition(str) { var lines = str.match(NEWLINE_REGEX); if (lines) lineno += lines.length; var i = str.lastIndexOf(NEWLINE); column = ~i ? str.length - i : column + str.length; } /** * Mark position and patch `node.position`. * * @return {Function} */ function position() { var start = { line: lineno, column: column }; return function(node) { node.position = new Position(start); whitespace(); return node; }; } /** * Store position information for a node. * * @constructor * @property {Object} start * @property {Object} end * @property {undefined|String} source */ function Position(start) { this.start = start; this.end = { line: lineno, column: column }; this.source = options.source; } /** * Non-enumerable source string. */ Position.prototype.content = style; var errorsList = []; /** * Error `msg`. * * @param {String} msg * @throws {Error} */ function error(msg) { var err = new Error( options.source + ':' + lineno + ':' + column + ': ' + msg ); err.reason = msg; err.filename = options.source; err.line = lineno; err.column = column; err.source = style; if (options.silent) { errorsList.push(err); } else { throw err; } } /** * Match `re` and return captures. * * @param {RegExp} re * @return {undefined|Array} */ function match(re) { var m = re.exec(style); if (!m) return; var str = m[0]; updatePosition(str); style = style.slice(str.length); return m; } /** * Parse whitespace. */ function whitespace() { match(WHITESPACE_REGEX); } /** * Parse comments. * * @param {Object[]} [rules] * @return {Object[]} */ function comments(rules) { var c; rules = rules || []; while ((c = comment())) { if (c !== false) { rules.push(c); } } return rules; } /** * Parse comment. * * @return {Object} * @throws {Error} */ function comment() { var pos = position(); if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return; var i = 2; while ( EMPTY_STRING != style.charAt(i) && (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1)) ) { ++i; } i += 2; if (EMPTY_STRING === style.charAt(i - 1)) { return error('End of comment missing'); } var str = style.slice(2, i - 2); column += 2; updatePosition(str); style = style.slice(i); column += 2; return pos({ type: TYPE_COMMENT, comment: str }); } /** * Parse declaration. * * @return {Object} * @throws {Error} */ function declaration() { var pos = position(); // prop var prop = match(PROPERTY_REGEX); if (!prop) return; comment(); // : if (!match(COLON_REGEX)) return error("property missing ':'"); // val var val = match(VALUE_REGEX); var ret = pos({ type: TYPE_DECLARATION, property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)), value: val ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING)) : EMPTY_STRING }); // ; match(SEMICOLON_REGEX); return ret; } /** * Parse declarations. * * @return {Object[]} */ function declarations() { var decls = []; comments(decls); // declarations var decl; while ((decl = declaration())) { if (decl !== false) { decls.push(decl); comments(decls); } } return decls; } whitespace(); return declarations(); }; /** * Trim `str`. * * @param {String} str * @return {String} */ function trim(str) { return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING; } /***/ }), /***/ "../node_modules/is-buffer/index.js": /*!******************************************!*\ !*** ../node_modules/is-buffer/index.js ***! \******************************************/ /***/ ((module) => { /*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh <https://feross.org> * @license MIT */ module.exports = function isBuffer (obj) { return obj != null && obj.constructor != null && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) } /***/ }), /***/ "../node_modules/ms/index.js": /*!***********************************!*\ !*** ../node_modules/ms/index.js ***! \***********************************/ /***/ ((module) => { /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var w = d * 7; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function(val, options) { options = options || {}; var type = typeof val; if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isFinite(val)) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error( 'val is not a non-empty string or a valid number. val=' + JSON.stringify(val) ); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( str ); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'weeks': case 'week': case 'w': return n * w; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return Math.round(ms / d) + 'd'; } if (msAbs >= h) { return Math.round(ms / h) + 'h'; } if (msAbs >= m) { return Math.round(ms / m) + 'm'; } if (msAbs >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return plural(ms, msAbs, d, 'day'); } if (msAbs >= h) { return plural(ms, msAbs, h, 'hour'); } if (msAbs >= m) { return plural(ms, msAbs, m, 'minute'); } if (msAbs >= s) { return plural(ms, msAbs, s, 'second'); } return ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, msAbs, n, name) { var isPlural = msAbs >= n * 1.5; return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); } /***/ }), /***/ "../node_modules/object-assign/index.js": /*!**********************************************!*\ !*** ../node_modules/object-assign/index.js ***! \**********************************************/ /***/ ((module) => { "use strict"; /* object-assign (c) Sindre Sorhus @license MIT */ /* eslint-disable no-unused-vars */ var getOwnPropertySymbols = Object.getOwnPropertySymbols; var hasOwnProperty = Object.prototype.hasOwnProperty; var propIsEnumerable = Object.prototype.propertyIsEnumerable; function toObject(val) { if (val === null || val === undefined) { throw new TypeError('Object.assign cannot be called with null or undefined'); } return Object(val); } function shouldUseNative() { try { if (!Object.assign) { return false; } // Detect buggy property enumeration order in older V8 versions. // https://bugs.chromium.org/p/v8/issues/detail?id=4118 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers test1[5] = 'de'; if (Object.getOwnPropertyNames(test1)[0] === '5') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test2 = {}; for (var i = 0; i < 10; i++) { test2['_' + String.fromCharCode(i)] = i; } var order2 = Object.getOwnPropertyNames(test2).map(function (n) { return test2[n]; }); if (order2.join('') !== '0123456789') { return false; } // https://bugs.chromium.org/p/v8/issues/detail?id=3056 var test3 = {}; 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { test3[letter] = letter; }); if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') { return false; } return true; } catch (err) { // We don't expect any of the above to throw, but better to be safe. return false; } } module.exports = shouldUseNative() ? Object.assign : function (target, source) { var from; var to = toObject(target); var symbols; for (var s = 1; s < arguments.length; s++) { from = Object(arguments[s]); for (var key in from) { if (hasOwnProperty.call(from, key)) { to[key] = from[key]; } } if (getOwnPropertySymbols) { symbols = getOwnPropertySymbols(from); for (var i = 0; i < symbols.length; i++) { if (propIsEnumerable.call(from, symbols[i])) { to[symbols[i]] = from[symbols[i]]; } } } } return to; }; /***/ }), /***/ "../node_modules/prop-types/checkPropTypes.js": /*!****************************************************!*\ !*** ../node_modules/prop-types/checkPropTypes.js ***! \****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var printWarning = function() {}; if (true) { var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "../node_modules/prop-types/lib/ReactPropTypesSecret.js"); var loggedTypeFailures = {}; var has = __webpack_require__(/*! ./lib/has */ "../node_modules/prop-types/lib/has.js"); printWarning = function(text) { var message = 'Warning: ' + text; if (typeof console !== 'undefined') { console.error(message); } try { // --- Welcome to debugging React --- // This error was thrown as a convenience so that you can use this stack // to find the callsite that caused this warning to fire. throw new Error(message); } catch (x) { /**/ } }; } /** * Assert that the values match with the type specs. * Error messages are memorized and will only be shown once. * * @param {object} typeSpecs Map of name to a ReactPropType * @param {object} values Runtime values that need to be type-checked * @param {string} location e.g. "prop", "context", "child context" * @param {string} componentName Name of the component for error messages. * @param {?Function} getStack Returns the component stack. * @private */ function checkPropTypes(typeSpecs, values, location, componentName, getStack) { if (true) { for (var typeSpecName in typeSpecs) { if (has(typeSpecs, typeSpecName)) { var error; // Prop type validation may throw. In case they do, we don't want to // fail the render phase where it didn't fail before. So we log it. // After these have been cleaned up, we'll let them throw. try { // This is intentionally an invariant that gets caught. It's the same // behavior as without this statement except with a better message. if (typeof typeSpecs[typeSpecName] !== 'function') { var err = Error( (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.' ); err.name = 'Invariant Violation'; throw err; } error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); } catch (ex) { error = ex; } if (error && !(error instanceof Error)) { printWarning( (componentName || 'React class') + ': type specification of ' + location + ' `' + typeSpecName + '` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).' ); } if (error instanceof Error && !(error.message in loggedTypeFailures)) { // Only monitor this failure once because there tends to be a lot of the // same error. loggedTypeFailures[error.message] = true; var stack = getStack ? getStack() : ''; printWarning( 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') ); } } } } } /** * Resets warning cache when testing. * * @private */ checkPropTypes.resetWarningCache = function() { if (true) { loggedTypeFailures = {}; } } module.exports = checkPropTypes; /***/ }), /***/ "../node_modules/prop-types/factoryWithTypeCheckers.js": /*!*************************************************************!*\ !*** ../node_modules/prop-types/factoryWithTypeCheckers.js ***! \*************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var ReactIs = __webpack_require__(/*! react-is */ "../node_modules/prop-types/node_modules/react-is/index.js"); var assign = __webpack_require__(/*! object-assign */ "../node_modules/object-assign/index.js"); var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "../node_modules/prop-types/lib/ReactPropTypesSecret.js"); var has = __webpack_require__(/*! ./lib/has */ "../node_modules/prop-types/lib/has.js"); var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ "../node_modules/prop-types/checkPropTypes.js"); var printWarning = function() {}; if (true) { printWarning = function(text) { var message = 'Warning: ' + text; if (typeof console !== 'undefined') { console.error(message); } try { // --- Welcome to debugging React --- // This error was thrown as a convenience so that you can use this stack // to find the callsite that caused this warning to fire. throw new Error(message); } catch (x) {} }; } function emptyFunctionThatReturnsNull() { return null; } module.exports = function(isValidElement, throwOnDirectAccess) { /* global Symbol */ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. /** * Returns the iterator method function contained on the iterable object. * * Be sure to invoke the function with the iterable as context: * * var iteratorFn = getIteratorFn(myIterable); * if (iteratorFn) { * var iterator = iteratorFn.call(myIterable); * ... * } * * @param {?object} maybeIterable * @return {?function} */ function getIteratorFn(maybeIterable) { var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); if (typeof iteratorFn === 'function') { return iteratorFn; } } /** * Collection of methods that allow declaration and validation of props that are * supplied to React components. Example usage: * * var Props = require('ReactPropTypes'); * var MyArticle = React.createClass({ * propTypes: { * // An optional string prop named "description". * description: Props.string, * * // A required enum prop named "category". * category: Props.oneOf(['News','Photos']).isRequired, * * // A prop named "dialog" that requires an instance of Dialog. * dialog: Props.instanceOf(Dialog).isRequired * }, * render: function() { ... } * }); * * A more formal specification of how these methods are used: * * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) * decl := ReactPropTypes.{type}(.isRequired)? * * Each and every declaration produces a function with the same signature. This * allows the creation of custom validation functions. For example: * * var MyLink = React.createClass({ * propTypes: { * // An optional string or URI prop named "href". * href: function(props, propName, componentName) { * var propValue = props[propName]; * if (propValue != null && typeof propValue !== 'string' && * !(propValue instanceof URI)) { * return new Error( * 'Expected a string or an URI for ' + propName + ' in ' + * componentName * ); * } * } * }, * render: function() {...} * }); * * @internal */ var ANONYMOUS = '<<anonymous>>'; // Important! // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. var ReactPropTypes = { array: createPrimitiveTypeChecker('array'), bigint: createPrimitiveTypeChecker('bigint'), bool: createPrimitiveTypeChecker('boolean'), func: createPrimitiveTypeChecker('function'), number: createPrimitiveTypeChecker('number'), object: createPrimitiveTypeChecker('object'), string: createPrimitiveTypeChecker('string'), symbol: createPrimitiveTypeChecker('symbol'), any: createAnyTypeChecker(), arrayOf: createArrayOfTypeChecker, element: createElementTypeChecker(), elementType: createElementTypeTypeChecker(), instanceOf: createInstanceTypeChecker, node: createNodeChecker(), objectOf: createObjectOfTypeChecker, oneOf: createEnumTypeChecker, oneOfType: createUnionTypeChecker, shape: createShapeTypeChecker, exact: createStrictShapeTypeChecker, }; /** * inlined Object.is polyfill to avoid requiring consumers ship their own * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is */ /*eslint-disable no-self-compare*/ function is(x, y) { // SameValue algorithm if (x === y) { // Steps 1-5, 7-10 // Steps 6.b-6.e: +0 != -0 return x !== 0 || 1 / x === 1 / y; } else { // Step 6.a: NaN == NaN return x !== x && y !== y; } } /*eslint-enable no-self-compare*/ /** * We use an Error-like object for backward compatibility as people may call * PropTypes directly and inspect their output. However, we don't use real * Errors anymore. We don't inspect their stack anyway, and creating them * is prohibitively expensive if they are created too often, such as what * happens in oneOfType() for any type before the one that matched. */ function PropTypeError(message, data) { this.message = message; this.data = data && typeof data === 'object' ? data: {}; this.stack = ''; } // Make `instanceof Error` still work for returned errors. PropTypeError.prototype = Error.prototype; function createChainableTypeChecker(validate) { if (true) { var manualPropTypeCallCache = {}; var manualPropTypeWarningCount = 0; } function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { componentName = componentName || ANONYMOUS; propFullName = propFullName || propName; if (secret !== ReactPropTypesSecret) { if (throwOnDirectAccess) { // New behavior only for users of `prop-types` package var err = new Error( 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types' ); err.name = 'Invariant Violation'; throw err; } else if ( true && typeof console !== 'undefined') { // Old behavior for people using React.PropTypes var cacheKey = componentName + ':' + propName; if ( !manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors manualPropTypeWarningCount < 3 ) { printWarning( 'You are manually calling a React.PropTypes validation ' + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.' ); manualPropTypeCallCache[cacheKey] = true; manualPropTypeWarningCount++; } } } if (props[propName] == null) { if (isRequired) { if (props[propName] === null) { return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); } return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); } return null; } else { return validate(props, propName, componentName, location, propFullName); } } var chainedCheckType = checkType.bind(null, false); chainedCheckType.isRequired = checkType.bind(null, true); return chainedCheckType; } function createPrimitiveTypeChecker(expectedType) { function validate(props, propName, componentName, location, propFullName, secret) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== expectedType) { // `propValue` being instance of, say, date/regexp, pass the 'object' // check, but we can offer a more precise error message here rather than // 'of type `object`'. var preciseType = getPreciseType(propValue); return new PropTypeError( 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), {expectedType: expectedType} ); } return null; } return createChainableTypeChecker(validate); } function createAnyTypeChecker() { return createChainableTypeChecker(emptyFunctionThatReturnsNull); } function createArrayOfTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { if (typeof typeChecker !== 'function') { return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); } var propValue = props[propName]; if (!Array.isArray(propValue)) { var propType = getPropType(propValue); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); } for (var i = 0; i < propValue.length; i++) { var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); if (error instanceof Error) { return error; } } return null; } return createChainableTypeChecker(validate); } function createElementTypeChecker() { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; if (!isValidElement(propValue)) { var propType = getPropType(propValue); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); } return null; } return createChainableTypeChecker(validate); } function createElementTypeTypeChecker() { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; if (!ReactIs.isValidElementType(propValue)) { var propType = getPropType(propValue); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.')); } return null; } return createChainableTypeChecker(validate); } function createInstanceTypeChecker(expectedClass) { function validate(props, propName, componentName, location, propFullName) { if (!(props[propName] instanceof expectedClass)) { var expectedClassName = expectedClass.name || ANONYMOUS; var actualClassName = getClassName(props[propName]); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); } return null; } return createChainableTypeChecker(validate); } function createEnumTypeChecker(expectedValues) { if (!Array.isArray(expectedValues)) { if (true) { if (arguments.length > 1) { printWarning( 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).' ); } else { printWarning('Invalid argument supplied to oneOf, expected an array.'); } } return emptyFunctionThatReturnsNull; } function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; for (var i = 0; i < expectedValues.length; i++) { if (is(propValue, expectedValues[i])) { return null; } } var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { var type = getPreciseType(value); if (type === 'symbol') { return String(value); } return value; }); return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); } return createChainableTypeChecker(validate); } function createObjectOfTypeChecker(typeChecker) { function validate(props, propName, componentName, location, propFullName) { if (typeof typeChecker !== 'function') { return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); } var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== 'object') { return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); } for (var key in propValue) { if (has(propValue, key)) { var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); if (error instanceof Error) { return error; } } } return null; } return createChainableTypeChecker(validate); } function createUnionTypeChecker(arrayOfTypeCheckers) { if (!Array.isArray(arrayOfTypeCheckers)) { true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : 0; return emptyFunctionThatReturnsNull; } for (var i = 0; i < arrayOfTypeCheckers.length; i++) { var checker = arrayOfTypeCheckers[i]; if (typeof checker !== 'function') { printWarning( 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.' ); return emptyFunctionThatReturnsNull; } } function validate(props, propName, componentName, location, propFullName) { var expectedTypes = []; for (var i = 0; i < arrayOfTypeCheckers.length; i++) { var checker = arrayOfTypeCheckers[i]; var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret); if (checkerResult == null) { return null; } if (checkerResult.data && has(checkerResult.data, 'expectedType')) { expectedTypes.push(checkerResult.data.expectedType); } } var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': ''; return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.')); } return createChainableTypeChecker(validate); } function createNodeChecker() { function validate(props, propName, componentName, location, propFullName) { if (!isNode(props[propName])) { return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); } return null; } return createChainableTypeChecker(validate); } function invalidValidatorError(componentName, location, propFullName, key, type) { return new PropTypeError( (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.' ); } function createShapeTypeChecker(shapeTypes) { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== 'object') { return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); } for (var key in shapeTypes) { var checker = shapeTypes[key]; if (typeof checker !== 'function') { return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); } var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); if (error) { return error; } } return null; } return createChainableTypeChecker(validate); } function createStrictShapeTypeChecker(shapeTypes) { function validate(props, propName, componentName, location, propFullName) { var propValue = props[propName]; var propType = getPropType(propValue); if (propType !== 'object') { return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); } // We need to check all keys in case some are required but missing from props. var allKeys = assign({}, props[propName], shapeTypes); for (var key in allKeys) { var checker = shapeTypes[key]; if (has(shapeTypes, key) && typeof checker !== 'function') { return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); } if (!checker) { return new PropTypeError( 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') ); } var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); if (error) { return error; } } return null; } return createChainableTypeChecker(validate); } function isNode(propValue) { switch (typeof propValue) { case 'number': case 'string': case 'undefined': return true; case 'boolean': return !propValue; case 'object': if (Array.isArray(propValue)) { return propValue.every(isNode); } if (propValue === null || isValidElement(propValue)) { return true; } var iteratorFn = getIteratorFn(propValue); if (iteratorFn) { var iterator = iteratorFn.call(propValue); var step; if (iteratorFn !== propValue.entries) { while (!(step = iterator.next()).done) { if (!isNode(step.value)) { return false; } } } else { // Iterator will provide entry [k,v] tuples rather than values. while (!(step = iterator.next()).done) { var entry = step.value; if (entry) { if (!isNode(entry[1])) { return false; } } } } } else { return false; } return true; default: return false; } } function isSymbol(propType, propValue) { // Native Symbol. if (propType === 'symbol') { return true; } // falsy value can't be a Symbol if (!propValue) { return false; } // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' if (propValue['@@toStringTag'] === 'Symbol') { return true; } // Fallback for non-spec compliant Symbols which are polyfilled. if (typeof Symbol === 'function' && propValue instanceof Symbol) { return true; } return false; } // Equivalent of `typeof` but with special handling for array and regexp. function getPropType(propValue) { var propType = typeof propValue; if (Array.isArray(propValue)) { return 'array'; } if (propValue instanceof RegExp) { // Old webkits (at least until Android 4.0) return 'function' rather than // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ // passes PropTypes.object. return 'object'; } if (isSymbol(propType, propValue)) { return 'symbol'; } return propType; } // This handles more types than `getPropType`. Only used for error messages. // See `createPrimitiveTypeChecker`. function getPreciseType(propValue) { if (typeof propValue === 'undefined' || propValue === null) { return '' + propValue; } var propType = getPropType(propValue); if (propType === 'object') { if (propValue instanceof Date) { return 'date'; } else if (propValue instanceof RegExp) { return 'regexp'; } } return propType; } // Returns a string that is postfixed to a warning about an invalid type. // For example, "undefined" or "of type array" function getPostfixForTypeWarning(value) { var type = getPreciseType(value); switch (type) { case 'array': case 'object': return 'an ' + type; case 'boolean': case 'date': case 'regexp': return 'a ' + type; default: return type; } } // Returns class name of the object, if any. function getClassName(propValue) { if (!propValue.constructor || !propValue.constructor.name) { return ANONYMOUS; } return propValue.constructor.name; } ReactPropTypes.checkPropTypes = checkPropTypes; ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; ReactPropTypes.PropTypes = ReactPropTypes; return ReactPropTypes; }; /***/ }), /***/ "../node_modules/prop-types/index.js": /*!*******************************************!*\ !*** ../node_modules/prop-types/index.js ***! \*******************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ if (true) { var ReactIs = __webpack_require__(/*! react-is */ "../node_modules/prop-types/node_modules/react-is/index.js"); // By explicitly using `prop-types` you are opting into new development behavior. // http://fb.me/prop-types-in-prod var throwOnDirectAccess = true; module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ "../node_modules/prop-types/factoryWithTypeCheckers.js")(ReactIs.isElement, throwOnDirectAccess); } else {} /***/ }), /***/ "../node_modules/prop-types/lib/ReactPropTypesSecret.js": /*!**************************************************************!*\ !*** ../node_modules/prop-types/lib/ReactPropTypesSecret.js ***! \**************************************************************/ /***/ ((module) => { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; module.exports = ReactPropTypesSecret; /***/ }), /***/ "../node_modules/prop-types/lib/has.js": /*!*********************************************!*\ !*** ../node_modules/prop-types/lib/has.js ***! \*********************************************/ /***/ ((module) => { module.exports = Function.call.bind(Object.prototype.hasOwnProperty); /***/ }), /***/ "../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js": /*!************************************************************************************!*\ !*** ../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js ***! \************************************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; /** @license React v16.13.1 * react-is.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ if (true) { (function() { 'use strict'; // The Symbol used to tag the ReactElement-like types. If there is no native Symbol // nor polyfill, then a plain number is used for performance. var hasSymbol = typeof Symbol === 'function' && Symbol.for; var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary // (unstable) APIs that have been removed. Can we remove the symbols? var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf; var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9; var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5; var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6; var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7; function isValidElementType(type) { return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); } function typeOf(object) { if (typeof object === 'object' && object !== null) { var $$typeof = object.$$typeof; switch ($$typeof) { case REACT_ELEMENT_TYPE: var type = object.type; switch (type) { case REACT_ASYNC_MODE_TYPE: case REACT_CONCURRENT_MODE_TYPE: case REACT_FRAGMENT_TYPE: case REACT_PROFILER_TYPE: case REACT_STRICT_MODE_TYPE: case REACT_SUSPENSE_TYPE: return type; default: var $$typeofType = type && type.$$typeof; switch ($$typeofType) { case REACT_CONTEXT_TYPE: case REACT_FORWARD_REF_TYPE: case REACT_LAZY_TYPE: case REACT_MEMO_TYPE: case REACT_PROVIDER_TYPE: return $$typeofType; default: return $$typeof; } } case REACT_PORTAL_TYPE: return $$typeof; } } return undefined; } // AsyncMode is deprecated along with isAsyncMode var AsyncMode = REACT_ASYNC_MODE_TYPE; var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; var ContextConsumer = REACT_CONTEXT_TYPE; var ContextProvider = REACT_PROVIDER_TYPE; var Element = REACT_ELEMENT_TYPE; var ForwardRef = REACT_FORWARD_REF_TYPE; var Fragment = REACT_FRAGMENT_TYPE; var Lazy = REACT_LAZY_TYPE; var Memo = REACT_MEMO_TYPE; var Portal = REACT_PORTAL_TYPE; var Profiler = REACT_PROFILER_TYPE; var StrictMode = REACT_STRICT_MODE_TYPE; var Suspense = REACT_SUSPENSE_TYPE; var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated function isAsyncMode(object) { { if (!hasWarnedAboutDeprecatedIsAsyncMode) { hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.'); } } return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; } function isConcurrentMode(object) { return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; } function isContextConsumer(object) { return typeOf(object) === REACT_CONTEXT_TYPE; } function isContextProvider(object) { return typeOf(object) === REACT_PROVIDER_TYPE; } function isElement(object) { return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; } function isForwardRef(object) { return typeOf(object) === REACT_FORWARD_REF_TYPE; } function isFragment(object) { return typeOf(object) === REACT_FRAGMENT_TYPE; } function isLazy(object) { return typeOf(object) === REACT_LAZY_TYPE; } function isMemo(object) { return typeOf(object) === REACT_MEMO_TYPE; } function isPortal(object) { return typeOf(object) === REACT_PORTAL_TYPE; } function isProfiler(object) { return typeOf(object) === REACT_PROFILER_TYPE; } function isStrictMode(object) { return typeOf(object) === REACT_STRICT_MODE_TYPE; } function isSuspense(object) { return typeOf(object) === REACT_SUSPENSE_TYPE; } exports.AsyncMode = AsyncMode; exports.ConcurrentMode = ConcurrentMode; exports.ContextConsumer = ContextConsumer; exports.ContextProvider = ContextProvider; exports.Element = Element; exports.ForwardRef = ForwardRef; exports.Fragment = Fragment; exports.Lazy = Lazy; exports.Memo = Memo; exports.Portal = Portal; exports.Profiler = Profiler; exports.StrictMode = StrictMode; exports.Suspense = Suspense; exports.isAsyncMode = isAsyncMode; exports.isConcurrentMode = isConcurrentMode; exports.isContextConsumer = isContextConsumer; exports.isContextProvider = isContextProvider; exports.isElement = isElement; exports.isForwardRef = isForwardRef; exports.isFragment = isFragment; exports.isLazy = isLazy; exports.isMemo = isMemo; exports.isPortal = isPortal; exports.isProfiler = isProfiler; exports.isStrictMode = isStrictMode; exports.isSuspense = isSuspense; exports.isValidElementType = isValidElementType; exports.typeOf = typeOf; })(); } /***/ }), /***/ "../node_modules/prop-types/node_modules/react-is/index.js": /*!*****************************************************************!*\ !*** ../node_modules/prop-types/node_modules/react-is/index.js ***! \*****************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; if (false) {} else { module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js"); } /***/ }), /***/ "../node_modules/react-avatar-editor/dist/index.js": /*!*********************************************************!*\ !*** ../node_modules/react-avatar-editor/dist/index.js ***! \*********************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { !function(e,t){ true?module.exports=t(__webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"),__webpack_require__(/*! react */ "react")):0}(this,function(e,t){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=o(e),i=o(t);function r(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}).apply(this,arguments)}function a(t,e){var o,n=Object.keys(t);return Object.getOwnPropertySymbols&&(o=Object.getOwnPropertySymbols(t),e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)),n}function y(t){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?a(Object(o),!0).forEach(function(e){s(t,e,o[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):a(Object(o)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))})}return t}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e,t){if(null==e)return{};var o,n=function(e,t){if(null==e)return{};for(var o,n={},a=Object.keys(e),r=0;r<a.length;r++)o=a[r],0<=t.indexOf(o)||(n[o]=e[o]);return n}(e,t);if(Object.getOwnPropertySymbols)for(var a=Object.getOwnPropertySymbols(e),r=0;r<a.length;r++)o=a[r],0<=t.indexOf(o)||Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o]);return n}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(r){var i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}();return function(){var e,t,o,n,a=h(r);return t=i?(e=h(this).constructor,Reflect.construct(a,arguments,e)):a.apply(this,arguments),o=this,!(n=t)||"object"!=typeof n&&"function"!=typeof n?d(o):n}}function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var o=[],n=!0,a=!1,r=void 0;try{for(var i,s=e[Symbol.iterator]();!(n=(i=s.next()).done)&&(o.push(i.value),!t||o.length!==t);n=!0);}catch(e){a=!0,r=e}finally{try{n||null==s.return||s.return()}finally{if(a)throw r}}return o}(e,t)||g(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){if(e){if("string"==typeof e)return f(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?f(e,t):void 0}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}function v(a,r){return new Promise(function(e,t){var o,n=new Image;n.onload=function(){return e(n)},n.onerror=t,!1==(null!==(o=a)&&!!o.match(/^\s*data:([a-z]+\/[a-z]+(;[a-z-]+=[a-z-]+)?)?(;base64)?,[a-z0-9!$&',()*+;=\-._~:@/?%\s]*\s*$/i))&&r&&(n.crossOrigin=r),n.src=a})}var b,w=!("undefined"==typeof window||"undefined"==typeof navigator||!("ontouchstart"in window||0<navigator.msMaxTouchPoints)),M="undefined"!=typeof File,O={touch:{react:{down:"onTouchStart",mouseDown:"onMouseDown",drag:"onTouchMove",move:"onTouchMove",mouseMove:"onMouseMove",up:"onTouchEnd",mouseUp:"onMouseUp"},native:{down:"touchstart",mouseDown:"mousedown",drag:"touchmove",move:"touchmove",mouseMove:"mousemove",up:"touchend",mouseUp:"mouseup"}},desktop:{react:{down:"onMouseDown",drag:"onDragOver",move:"onMouseMove",up:"onMouseUp"},native:{down:"mousedown",drag:"dragStart",move:"mousemove",up:"mouseup"}}},I=w?O.touch:O.desktop,P="undefined"!=typeof window&&window.devicePixelRatio?window.devicePixelRatio:1,C={x:.5,y:.5},x=function(){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(a,i["default"].Component);var e,t,o,n=p(a);function a(e){var v;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),s(d(v=n.call(this,e)),"state",{drag:!1,my:null,mx:null,image:C}),s(d(v),"handleImageReady",function(e){var t=v.getInitialSize(e.width,e.height);t.resource=e,t.x=.5,t.y=.5,t.backgroundColor=v.props.backgroundColor,v.setState({drag:!1,image:t},v.props.onImageReady),v.props.onLoadSuccess(t)}),s(d(v),"clearImage",function(){v.canvas.getContext("2d").clearRect(0,0,v.canvas.width,v.canvas.height),v.setState({image:C})}),s(d(v),"handleMouseDown",function(e){(e=e||window.event).preventDefault(),v.setState({drag:!0,mx:null,my:null})}),s(d(v),"handleMouseUp",function(){v.state.drag&&(v.setState({drag:!1}),v.props.onMouseUp())}),s(d(v),"handleMouseMove",function(e){var t,o,n,a,r,i,s,u,h,c,l,d,p,g,f,m;e=e||window.event,!1!==v.state.drag&&(e.preventDefault(),n={mx:t=e.targetTouches?e.targetTouches[0].pageX:e.clientX,my:o=e.targetTouches?e.targetTouches[0].pageY:e.clientY},m=v.props.rotate,m=(m%=360)<0?m+360:m,v.state.mx&&v.state.my&&(a=v.state.mx-t,r=v.state.my-o,i=v.state.image.width*v.props.scale,s=v.state.image.height*v.props.scale,h=(u=v.getCroppingRect()).x,c=u.y,h*=i,c*=s,l=function(e){return e*(Math.PI/180)},d=Math.cos(l(m)),g=c+-a*(p=Math.sin(l(m)))+r*d,f={x:(h+a*d+r*p)/i+1/v.props.scale*v.getXScale()/2,y:g/s+1/v.props.scale*v.getYScale()/2},v.props.onPositionChange(f),n.image=y(y({},v.state.image),f)),v.setState(n),v.props.onMouseMove(e))}),s(d(v),"setCanvas",function(e){v.canvas=e}),v.canvas=null,v}return e=a,(t=[{key:"componentDidMount",value:function(){this.props.disableHiDPIScaling&&(P=1);var e,t,o=this.canvas.getContext("2d");this.props.image&&this.loadImage(this.props.image),this.paint(o),document&&(e=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){t=!1}return t}()&&{passive:!1},t=I.native,document.addEventListener(t.move,this.handleMouseMove,e),document.addEventListener(t.up,this.handleMouseUp,e),w&&(document.addEventListener(t.mouseMove,this.handleMouseMove,e),document.addEventListener(t.mouseUp,this.handleMouseUp,e)))}},{key:"componentDidUpdate",value:function(e,t){this.props.image&&this.props.image!==e.image||this.props.width!==e.width||this.props.height!==e.height||this.props.backgroundColor!==e.backgroundColor?this.loadImage(this.props.image):this.props.image||t.image===C||this.clearImage();var o=this.canvas.getContext("2d");o.clearRect(0,0,this.canvas.width,this.canvas.height),this.paint(o),this.paintImage(o,this.state.image,this.props.border),e.image===this.props.image&&e.width===this.props.width&&e.height===this.props.height&&e.position===this.props.position&&e.scale===this.props.scale&&e.rotate===this.props.rotate&&t.my===this.state.my&&t.mx===this.state.mx&&t.image.x===this.state.image.x&&t.image.y===this.state.image.y&&t.backgroundColor===this.state.backgroundColor||this.props.onImageChange()}},{key:"componentWillUnmount",value:function(){var e;document&&(e=I.native,document.removeEventListener(e.move,this.handleMouseMove,!1),document.removeEventListener(e.up,this.handleMouseUp,!1),w&&(document.removeEventListener(e.mouseMove,this.handleMouseMove,!1),document.removeEventListener(e.mouseUp,this.handleMouseUp,!1)))}},{key:"isVertical",value:function(){return!this.props.disableCanvasRotation&&this.props.rotate%180!=0}},{key:"getBorders",value:function(e){var t=0<arguments.length&&void 0!==e?e:this.props.border;return Array.isArray(t)?t:[t,t]}},{key:"getDimensions",value:function(){var e=this.props,t=e.width,o=e.height,n=e.rotate,a=e.border,r={},i=m(this.getBorders(a),2),s=i[0],u=i[1],h=t,c=o;return this.isVertical()?(r.width=c,r.height=h):(r.width=h,r.height=c),r.width+=2*s,r.height+=2*u,{canvas:r,rotate:n,width:t,height:o,border:a}}},{key:"getImage",value:function(){var e=this.getCroppingRect(),t=this.state.image;e.x*=t.resource.width,e.y*=t.resource.height,e.width*=t.resource.width,e.height*=t.resource.height;var o=document.createElement("canvas");this.isVertical()?(o.width=e.height,o.height=e.width):(o.width=e.width,o.height=e.height);var n=o.getContext("2d");return n.translate(o.width/2,o.height/2),n.rotate(this.props.rotate*Math.PI/180),n.translate(-o.width/2,-o.height/2),this.isVertical()&&n.translate((o.width-o.height)/2,(o.height-o.width)/2),t.backgroundColor&&(n.fillStyle=t.backgroundColor,n.fillRect(-e.x,-e.y,t.resource.width,t.resource.height)),n.drawImage(t.resource,-e.x,-e.y),o}},{key:"getImageScaledToCanvas",value:function(){var e=this.getDimensions(),t=e.width,o=e.height,n=document.createElement("canvas");return this.isVertical()?(n.width=o,n.height=t):(n.width=t,n.height=o),this.paintImage(n.getContext("2d"),this.state.image,0,1),n}},{key:"getXScale",value:function(){var e=this.props.width/this.props.height,t=this.state.image.width/this.state.image.height;return Math.min(1,e/t)}},{key:"getYScale",value:function(){var e=this.props.height/this.props.width,t=this.state.image.height/this.state.image.width;return Math.min(1,e/t)}},{key:"getCroppingRect",value:function(){var e=this.props.position||{x:this.state.image.x,y:this.state.image.y},t=1/this.props.scale*this.getXScale(),o=1/this.props.scale*this.getYScale(),n={x:e.x-t/2,y:e.y-o/2,width:t,height:o},a=0,r=1-n.width,i=0,s=1-n.height;return(this.props.disableBoundaryChecks||1<t||1<o)&&(a=-n.width,i=-n.height,s=r=1),y(y({},n),{},{x:Math.max(a,Math.min(n.x,r)),y:Math.max(i,Math.min(n.y,s))})}},{key:"loadImage",value:function(e){var t;M&&e instanceof File?this.loadingImage=(t=e,new Promise(function(o,n){var e=new FileReader;e.onload=function(e){try{var t=v(e.target.result);o(t)}catch(e){n(e)}},e.readAsDataURL(t)}).then(this.handleImageReady).catch(this.props.onLoadFailure)):"string"==typeof e&&(this.loadingImage=v(e,this.props.crossOrigin).then(this.handleImageReady).catch(this.props.onLoadFailure))}},{key:"getInitialSize",value:function(e,t){var o,n,a=this.getDimensions();return t/e<a.height/a.width?n=e*((o=this.getDimensions().height)/t):o=t*((n=this.getDimensions().width)/e),{height:o,width:n}}},{key:"paintImage",value:function(e,t,o,n){var a,r=3<arguments.length&&void 0!==n?n:P;t.resource&&(a=this.calculatePosition(t,o),e.save(),e.translate(e.canvas.width/2,e.canvas.height/2),e.rotate(this.props.rotate*Math.PI/180),e.translate(-e.canvas.width/2,-e.canvas.height/2),this.isVertical()&&e.translate((e.canvas.width-e.canvas.height)/2,(e.canvas.height-e.canvas.width)/2),e.scale(r,r),e.globalCompositeOperation="destination-over",e.drawImage(t.resource,a.x,a.y,a.width,a.height),t.backgroundColor&&(e.fillStyle=t.backgroundColor,e.fillRect(a.x,a.y,a.width,a.height)),e.restore())}},{key:"calculatePosition",value:function(e,t){e=e||this.state.image;var o=m(this.getBorders(t),2),n=o[0],a=o[1],r=this.getCroppingRect(),i=e.width*this.props.scale,s=e.height*this.props.scale,u=-r.x*i,h=-r.y*s;return this.isVertical()?(u+=a,h+=n):(u+=n,h+=a),{x:u,y:h,height:s,width:i}}},{key:"paint",value:function(e){e.save(),e.scale(P,P),e.translate(0,0),e.fillStyle="rgba("+this.props.color.slice(0,4).join(",")+")";var t,o,n,a,r,i,s,u,h=this.props.borderRadius,c=this.getDimensions(),l=m(this.getBorders(c.border),2),d=l[0],p=l[1],g=c.canvas.height,f=c.canvas.width,h=Math.max(h,0);h=Math.min(h,f/2-d,g/2-p),e.beginPath(),t=e,a=f-2*(o=d),r=g-2*(n=p),0===(i=h)?t.rect(o,n,a,r):(s=a-i,u=r-i,t.translate(o,n),t.arc(i,i,i,Math.PI,1.5*Math.PI),t.lineTo(s,0),t.arc(s,i,i,1.5*Math.PI,2*Math.PI),t.lineTo(a,u),t.arc(s,u,i,2*Math.PI,.5*Math.PI),t.lineTo(i,r),t.arc(i,u,i,.5*Math.PI,Math.PI),t.translate(-o,-n)),e.rect(f,0,-f,g),e.fill("evenodd"),e.restore()}},{key:"render",value:function(){var e=this.props,t=(e.scale,e.rotate,e.image,e.border,e.borderRadius,e.width,e.height,e.position,e.color,e.backgroundColor,e.style),o=(e.crossOrigin,e.onLoadFailure,e.onLoadSuccess,e.onImageReady,e.onImageChange,e.onMouseUp,e.onMouseMove,e.onPositionChange,e.disableBoundaryChecks,e.disableHiDPIScaling,e.disableCanvasRotation,l(e,["scale","rotate","image","border","borderRadius","width","height","position","color","backgroundColor","style","crossOrigin","onLoadFailure","onLoadSuccess","onImageReady","onImageChange","onMouseUp","onMouseMove","onPositionChange","disableBoundaryChecks","disableHiDPIScaling","disableCanvasRotation"])),n=this.getDimensions(),a={width:n.canvas.width,height:n.canvas.height,cursor:this.state.drag?"grabbing":"grab",touchAction:"none"},r={width:n.canvas.width*P,height:n.canvas.height*P,style:y(y({},a),t)};return r[I.react.down]=this.handleMouseDown,w&&(r[I.react.mouseDown]=this.handleMouseDown),i.default.createElement("canvas",u({ref:this.setCanvas},r,o))}}])&&r(e.prototype,t),o&&r(e,o),a}();return s(x,"propTypes",{scale:n.default.number,rotate:n.default.number,image:n.default.oneOfType([n.default.string].concat(function(e){if(Array.isArray(e))return f(e)}(b=M?[n.default.instanceOf(File)]:[])||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(b)||g(b)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())),border:n.default.oneOfType([n.default.number,n.default.arrayOf(n.default.number)]),borderRadius:n.default.number,width:n.default.number,height:n.default.number,position:n.default.shape({x:n.default.number,y:n.default.number}),color:n.default.arrayOf(n.default.number),backgroundColor:n.default.string,crossOrigin:n.default.oneOf(["","anonymous","use-credentials"]),onLoadFailure:n.default.func,onLoadSuccess:n.default.func,onImageReady:n.default.func,onImageChange:n.default.func,onMouseUp:n.default.func,onMouseMove:n.default.func,onPositionChange:n.default.func,disableBoundaryChecks:n.default.bool,disableHiDPIScaling:n.default.bool,disableCanvasRotation:n.default.bool}),s(x,"defaultProps",{scale:1,rotate:0,border:25,borderRadius:0,width:200,height:200,color:[0,0,0,.5],onLoadFailure:function(){},onLoadSuccess:function(){},onImageReady:function(){},onImageChange:function(){},onMouseUp:function(){},onMouseMove:function(){},onPositionChange:function(){},disableBoundaryChecks:!1,disableHiDPIScaling:!1,disableCanvasRotation:!0}),x}); /***/ }), /***/ "../node_modules/react-draggable/build/cjs/Draggable.js": /*!**************************************************************!*\ !*** ../node_modules/react-draggable/build/cjs/Draggable.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "DraggableCore", ({ enumerable: true, get: function get() { return _DraggableCore.default; } })); exports["default"] = void 0; var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js")); var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "react-dom")); var _clsx2 = _interopRequireDefault(__webpack_require__(/*! clsx */ "../node_modules/clsx/dist/clsx.m.js")); var _domFns = __webpack_require__(/*! ./utils/domFns */ "../node_modules/react-draggable/build/cjs/utils/domFns.js"); var _positionFns = __webpack_require__(/*! ./utils/positionFns */ "../node_modules/react-draggable/build/cjs/utils/positionFns.js"); var _shims = __webpack_require__(/*! ./utils/shims */ "../node_modules/react-draggable/build/cjs/utils/shims.js"); var _DraggableCore = _interopRequireDefault(__webpack_require__(/*! ./DraggableCore */ "../node_modules/react-draggable/build/cjs/DraggableCore.js")); var _log = _interopRequireDefault(__webpack_require__(/*! ./utils/log */ "../node_modules/react-draggable/build/cjs/utils/log.js")); var _excluded = ["axis", "bounds", "children", "defaultPosition", "defaultClassName", "defaultClassNameDragging", "defaultClassNameDragged", "position", "positionOffset", "scale"]; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } // // Define <Draggable> // var Draggable = /*#__PURE__*/function (_React$Component) { _inherits(Draggable, _React$Component); var _super = _createSuper(Draggable); function Draggable(props /*: DraggableProps*/ ) { var _this; _classCallCheck(this, Draggable); _this = _super.call(this, props); _defineProperty(_assertThisInitialized(_this), "onDragStart", function (e, coreData) { (0, _log.default)('Draggable: onDragStart: %j', coreData); // Short-circuit if user's callback killed it. var shouldStart = _this.props.onStart(e, (0, _positionFns.createDraggableData)(_assertThisInitialized(_this), coreData)); // Kills start event on core as well, so move handlers are never bound. if (shouldStart === false) return false; _this.setState({ dragging: true, dragged: true }); }); _defineProperty(_assertThisInitialized(_this), "onDrag", function (e, coreData) { if (!_this.state.dragging) return false; (0, _log.default)('Draggable: onDrag: %j', coreData); var uiData = (0, _positionFns.createDraggableData)(_assertThisInitialized(_this), coreData); var newState /*: $Shape<DraggableState>*/ = { x: uiData.x, y: uiData.y }; // Keep within bounds. if (_this.props.bounds) { // Save original x and y. var x = newState.x, y = newState.y; // Add slack to the values used to calculate bound position. This will ensure that if // we start removing slack, the element won't react to it right away until it's been // completely removed. newState.x += _this.state.slackX; newState.y += _this.state.slackY; // Get bound position. This will ceil/floor the x and y within the boundaries. var _getBoundPosition = (0, _positionFns.getBoundPosition)(_assertThisInitialized(_this), newState.x, newState.y), _getBoundPosition2 = _slicedToArray(_getBoundPosition, 2), newStateX = _getBoundPosition2[0], newStateY = _getBoundPosition2[1]; newState.x = newStateX; newState.y = newStateY; // Recalculate slack by noting how much was shaved by the boundPosition handler. newState.slackX = _this.state.slackX + (x - newState.x); newState.slackY = _this.state.slackY + (y - newState.y); // Update the event we fire to reflect what really happened after bounds took effect. uiData.x = newState.x; uiData.y = newState.y; uiData.deltaX = newState.x - _this.state.x; uiData.deltaY = newState.y - _this.state.y; } // Short-circuit if user's callback killed it. var shouldUpdate = _this.props.onDrag(e, uiData); if (shouldUpdate === false) return false; _this.setState(newState); }); _defineProperty(_assertThisInitialized(_this), "onDragStop", function (e, coreData) { if (!_this.state.dragging) return false; // Short-circuit if user's callback killed it. var shouldContinue = _this.props.onStop(e, (0, _positionFns.createDraggableData)(_assertThisInitialized(_this), coreData)); if (shouldContinue === false) return false; (0, _log.default)('Draggable: onDragStop: %j', coreData); var newState /*: $Shape<DraggableState>*/ = { dragging: false, slackX: 0, slackY: 0 }; // If this is a controlled component, the result of this operation will be to // revert back to the old position. We expect a handler on `onDragStop`, at the least. var controlled = Boolean(_this.props.position); if (controlled) { var _this$props$position = _this.props.position, x = _this$props$position.x, y = _this$props$position.y; newState.x = x; newState.y = y; } _this.setState(newState); }); _this.state = { // Whether or not we are currently dragging. dragging: false, // Whether or not we have been dragged before. dragged: false, // Current transform x and y. x: props.position ? props.position.x : props.defaultPosition.x, y: props.position ? props.position.y : props.defaultPosition.y, prevPropsPosition: _objectSpread({}, props.position), // Used for compensating for out-of-bounds drags slackX: 0, slackY: 0, // Can only determine if SVG after mounting isElementSVG: false }; if (props.position && !(props.onDrag || props.onStop)) { // eslint-disable-next-line no-console console.warn('A `position` was applied to this <Draggable>, without drag handlers. This will make this ' + 'component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the ' + '`position` of this element.'); } return _this; } _createClass(Draggable, [{ key: "componentDidMount", value: function componentDidMount() { // Check to see if the element passed is an instanceof SVGElement if (typeof window.SVGElement !== 'undefined' && this.findDOMNode() instanceof window.SVGElement) { this.setState({ isElementSVG: true }); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.setState({ dragging: false }); // prevents invariant if unmounted while dragging } // React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find // the underlying DOM node ourselves. See the README for more information. }, { key: "findDOMNode", value: function findDOMNode() /*: ?HTMLElement*/ { var _this$props$nodeRef$c, _this$props, _this$props$nodeRef; return (_this$props$nodeRef$c = (_this$props = this.props) === null || _this$props === void 0 ? void 0 : (_this$props$nodeRef = _this$props.nodeRef) === null || _this$props$nodeRef === void 0 ? void 0 : _this$props$nodeRef.current) !== null && _this$props$nodeRef$c !== void 0 ? _this$props$nodeRef$c : _reactDom.default.findDOMNode(this); } }, { key: "render", value: function render() /*: ReactElement<any>*/ { var _clsx; var _this$props2 = this.props, axis = _this$props2.axis, bounds = _this$props2.bounds, children = _this$props2.children, defaultPosition = _this$props2.defaultPosition, defaultClassName = _this$props2.defaultClassName, defaultClassNameDragging = _this$props2.defaultClassNameDragging, defaultClassNameDragged = _this$props2.defaultClassNameDragged, position = _this$props2.position, positionOffset = _this$props2.positionOffset, scale = _this$props2.scale, draggableCoreProps = _objectWithoutProperties(_this$props2, _excluded); var style = {}; var svgTransform = null; // If this is controlled, we don't want to move it - unless it's dragging. var controlled = Boolean(position); var draggable = !controlled || this.state.dragging; var validPosition = position || defaultPosition; var transformOpts = { // Set left if horizontal drag is enabled x: (0, _positionFns.canDragX)(this) && draggable ? this.state.x : validPosition.x, // Set top if vertical drag is enabled y: (0, _positionFns.canDragY)(this) && draggable ? this.state.y : validPosition.y }; // If this element was SVG, we use the `transform` attribute. if (this.state.isElementSVG) { svgTransform = (0, _domFns.createSVGTransform)(transformOpts, positionOffset); } else { // Add a CSS transform to move the element around. This allows us to move the element around // without worrying about whether or not it is relatively or absolutely positioned. // If the item you are dragging already has a transform set, wrap it in a <span> so <Draggable> // has a clean slate. style = (0, _domFns.createCSSTransform)(transformOpts, positionOffset); } // Mark with class while dragging var className = (0, _clsx2.default)(children.props.className || '', defaultClassName, (_clsx = {}, _defineProperty(_clsx, defaultClassNameDragging, this.state.dragging), _defineProperty(_clsx, defaultClassNameDragged, this.state.dragged), _clsx)); // Reuse the child provided // This makes it flexible to use whatever element is wanted (div, ul, etc) return /*#__PURE__*/React.createElement(_DraggableCore.default, _extends({}, draggableCoreProps, { onStart: this.onDragStart, onDrag: this.onDrag, onStop: this.onDragStop }), /*#__PURE__*/React.cloneElement(React.Children.only(children), { className: className, style: _objectSpread(_objectSpread({}, children.props.style), style), transform: svgTransform })); } }], [{ key: "getDerivedStateFromProps", value: // React 16.3+ // Arity (props, state) function getDerivedStateFromProps(_ref, _ref2) /*: ?$Shape<DraggableState>*/ { var position = _ref.position; var prevPropsPosition = _ref2.prevPropsPosition; // Set x/y if a new position is provided in props that is different than the previous. if (position && (!prevPropsPosition || position.x !== prevPropsPosition.x || position.y !== prevPropsPosition.y)) { (0, _log.default)('Draggable: getDerivedStateFromProps %j', { position: position, prevPropsPosition: prevPropsPosition }); return { x: position.x, y: position.y, prevPropsPosition: _objectSpread({}, position) }; } return null; } }]); return Draggable; }(React.Component); exports["default"] = Draggable; _defineProperty(Draggable, "displayName", 'Draggable'); _defineProperty(Draggable, "propTypes", _objectSpread(_objectSpread({}, _DraggableCore.default.propTypes), {}, { /** * `axis` determines which axis the draggable can move. * * Note that all callbacks will still return data as normal. This only * controls flushing to the DOM. * * 'both' allows movement horizontally and vertically. * 'x' limits movement to horizontal axis. * 'y' limits movement to vertical axis. * 'none' limits all movement. * * Defaults to 'both'. */ axis: _propTypes.default.oneOf(['both', 'x', 'y', 'none']), /** * `bounds` determines the range of movement available to the element. * Available values are: * * 'parent' restricts movement within the Draggable's parent node. * * Alternatively, pass an object with the following properties, all of which are optional: * * {left: LEFT_BOUND, right: RIGHT_BOUND, bottom: BOTTOM_BOUND, top: TOP_BOUND} * * All values are in px. * * Example: * * ```jsx * let App = React.createClass({ * render: function () { * return ( * <Draggable bounds={{right: 300, bottom: 300}}> * <div>Content</div> * </Draggable> * ); * } * }); * ``` */ bounds: _propTypes.default.oneOfType([_propTypes.default.shape({ left: _propTypes.default.number, right: _propTypes.default.number, top: _propTypes.default.number, bottom: _propTypes.default.number }), _propTypes.default.string, _propTypes.default.oneOf([false])]), defaultClassName: _propTypes.default.string, defaultClassNameDragging: _propTypes.default.string, defaultClassNameDragged: _propTypes.default.string, /** * `defaultPosition` specifies the x and y that the dragged item should start at * * Example: * * ```jsx * let App = React.createClass({ * render: function () { * return ( * <Draggable defaultPosition={{x: 25, y: 25}}> * <div>I start with transformX: 25px and transformY: 25px;</div> * </Draggable> * ); * } * }); * ``` */ defaultPosition: _propTypes.default.shape({ x: _propTypes.default.number, y: _propTypes.default.number }), positionOffset: _propTypes.default.shape({ x: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]), y: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]) }), /** * `position`, if present, defines the current position of the element. * * This is similar to how form elements in React work - if no `position` is supplied, the component * is uncontrolled. * * Example: * * ```jsx * let App = React.createClass({ * render: function () { * return ( * <Draggable position={{x: 25, y: 25}}> * <div>I start with transformX: 25px and transformY: 25px;</div> * </Draggable> * ); * } * }); * ``` */ position: _propTypes.default.shape({ x: _propTypes.default.number, y: _propTypes.default.number }), /** * These properties should be defined on the child, not here. */ className: _shims.dontSetMe, style: _shims.dontSetMe, transform: _shims.dontSetMe })); _defineProperty(Draggable, "defaultProps", _objectSpread(_objectSpread({}, _DraggableCore.default.defaultProps), {}, { axis: 'both', bounds: false, defaultClassName: 'react-draggable', defaultClassNameDragging: 'react-draggable-dragging', defaultClassNameDragged: 'react-draggable-dragged', defaultPosition: { x: 0, y: 0 }, scale: 1 })); /***/ }), /***/ "../node_modules/react-draggable/build/cjs/DraggableCore.js": /*!******************************************************************!*\ !*** ../node_modules/react-draggable/build/cjs/DraggableCore.js ***! \******************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js")); var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "react-dom")); var _domFns = __webpack_require__(/*! ./utils/domFns */ "../node_modules/react-draggable/build/cjs/utils/domFns.js"); var _positionFns = __webpack_require__(/*! ./utils/positionFns */ "../node_modules/react-draggable/build/cjs/utils/positionFns.js"); var _shims = __webpack_require__(/*! ./utils/shims */ "../node_modules/react-draggable/build/cjs/utils/shims.js"); var _log = _interopRequireDefault(__webpack_require__(/*! ./utils/log */ "../node_modules/react-draggable/build/cjs/utils/log.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } // Simple abstraction for dragging events names. var eventsFor = { touch: { start: 'touchstart', move: 'touchmove', stop: 'touchend' }, mouse: { start: 'mousedown', move: 'mousemove', stop: 'mouseup' } }; // Default to mouse events. var dragEventFor = eventsFor.mouse; /*:: type DraggableCoreState = { dragging: boolean, lastX: number, lastY: number, touchIdentifier: ?number };*/ /*:: export type DraggableData = { node: HTMLElement, x: number, y: number, deltaX: number, deltaY: number, lastX: number, lastY: number, };*/ /*:: export type DraggableEventHandler = (e: MouseEvent, data: DraggableData) => void | false;*/ /*:: export type ControlPosition = {x: number, y: number};*/ /*:: export type PositionOffsetControlPosition = {x: number|string, y: number|string};*/ /*:: export type DraggableCoreDefaultProps = { allowAnyClick: boolean, disabled: boolean, enableUserSelectHack: boolean, onStart: DraggableEventHandler, onDrag: DraggableEventHandler, onStop: DraggableEventHandler, onMouseDown: (e: MouseEvent) => void, scale: number, };*/ /*:: export type DraggableCoreProps = { ...DraggableCoreDefaultProps, cancel: string, children: ReactElement<any>, offsetParent: HTMLElement, grid: [number, number], handle: string, nodeRef?: ?React.ElementRef<any>, };*/ // // Define <DraggableCore>. // // <DraggableCore> is for advanced usage of <Draggable>. It maintains minimal internal state so it can // work well with libraries that require more control over the element. // var DraggableCore = /*#__PURE__*/function (_React$Component) { _inherits(DraggableCore, _React$Component); var _super = _createSuper(DraggableCore); function DraggableCore() { var _this; _classCallCheck(this, DraggableCore); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _super.call.apply(_super, [this].concat(args)); _defineProperty(_assertThisInitialized(_this), "state", { dragging: false, // Used while dragging to determine deltas. lastX: NaN, lastY: NaN, touchIdentifier: null }); _defineProperty(_assertThisInitialized(_this), "mounted", false); _defineProperty(_assertThisInitialized(_this), "handleDragStart", function (e) { // Make it possible to attach event handlers on top of this one. _this.props.onMouseDown(e); // Only accept left-clicks. if (!_this.props.allowAnyClick && typeof e.button === 'number' && e.button !== 0) return false; // Get nodes. Be sure to grab relative document (could be iframed) var thisNode = _this.findDOMNode(); if (!thisNode || !thisNode.ownerDocument || !thisNode.ownerDocument.body) { throw new Error('<DraggableCore> not mounted on DragStart!'); } var ownerDocument = thisNode.ownerDocument; // Short circuit if handle or cancel prop was provided and selector doesn't match. if (_this.props.disabled || !(e.target instanceof ownerDocument.defaultView.Node) || _this.props.handle && !(0, _domFns.matchesSelectorAndParentsTo)(e.target, _this.props.handle, thisNode) || _this.props.cancel && (0, _domFns.matchesSelectorAndParentsTo)(e.target, _this.props.cancel, thisNode)) { return; } // Prevent scrolling on mobile devices, like ipad/iphone. // Important that this is after handle/cancel. if (e.type === 'touchstart') e.preventDefault(); // Set touch identifier in component state if this is a touch event. This allows us to // distinguish between individual touches on multitouch screens by identifying which // touchpoint was set to this element. var touchIdentifier = (0, _domFns.getTouchIdentifier)(e); _this.setState({ touchIdentifier: touchIdentifier }); // Get the current drag point from the event. This is used as the offset. var position = (0, _positionFns.getControlPosition)(e, touchIdentifier, _assertThisInitialized(_this)); if (position == null) return; // not possible but satisfies flow var x = position.x, y = position.y; // Create an event object with all the data parents need to make a decision here. var coreEvent = (0, _positionFns.createCoreData)(_assertThisInitialized(_this), x, y); (0, _log.default)('DraggableCore: handleDragStart: %j', coreEvent); // Call event handler. If it returns explicit false, cancel. (0, _log.default)('calling', _this.props.onStart); var shouldUpdate = _this.props.onStart(e, coreEvent); if (shouldUpdate === false || _this.mounted === false) return; // Add a style to the body to disable user-select. This prevents text from // being selected all over the page. if (_this.props.enableUserSelectHack) (0, _domFns.addUserSelectStyles)(ownerDocument); // Initiate dragging. Set the current x and y as offsets // so we know how much we've moved during the drag. This allows us // to drag elements around even if they have been moved, without issue. _this.setState({ dragging: true, lastX: x, lastY: y }); // Add events to the document directly so we catch when the user's mouse/touch moves outside of // this element. We use different events depending on whether or not we have detected that this // is a touch-capable device. (0, _domFns.addEvent)(ownerDocument, dragEventFor.move, _this.handleDrag); (0, _domFns.addEvent)(ownerDocument, dragEventFor.stop, _this.handleDragStop); }); _defineProperty(_assertThisInitialized(_this), "handleDrag", function (e) { // Get the current drag point from the event. This is used as the offset. var position = (0, _positionFns.getControlPosition)(e, _this.state.touchIdentifier, _assertThisInitialized(_this)); if (position == null) return; var x = position.x, y = position.y; // Snap to grid if prop has been provided if (Array.isArray(_this.props.grid)) { var deltaX = x - _this.state.lastX, deltaY = y - _this.state.lastY; var _snapToGrid = (0, _positionFns.snapToGrid)(_this.props.grid, deltaX, deltaY); var _snapToGrid2 = _slicedToArray(_snapToGrid, 2); deltaX = _snapToGrid2[0]; deltaY = _snapToGrid2[1]; if (!deltaX && !deltaY) return; // skip useless drag x = _this.state.lastX + deltaX, y = _this.state.lastY + deltaY; } var coreEvent = (0, _positionFns.createCoreData)(_assertThisInitialized(_this), x, y); (0, _log.default)('DraggableCore: handleDrag: %j', coreEvent); // Call event handler. If it returns explicit false, trigger end. var shouldUpdate = _this.props.onDrag(e, coreEvent); if (shouldUpdate === false || _this.mounted === false) { try { // $FlowIgnore _this.handleDragStop(new MouseEvent('mouseup')); } catch (err) { // Old browsers var event = ((document.createEvent('MouseEvents') /*: any*/ ) /*: MouseTouchEvent*/ ); // I see why this insanity was deprecated // $FlowIgnore event.initMouseEvent('mouseup', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); _this.handleDragStop(event); } return; } _this.setState({ lastX: x, lastY: y }); }); _defineProperty(_assertThisInitialized(_this), "handleDragStop", function (e) { if (!_this.state.dragging) return; var position = (0, _positionFns.getControlPosition)(e, _this.state.touchIdentifier, _assertThisInitialized(_this)); if (position == null) return; var x = position.x, y = position.y; // Snap to grid if prop has been provided if (Array.isArray(_this.props.grid)) { var deltaX = x - _this.state.lastX || 0; var deltaY = y - _this.state.lastY || 0; var _snapToGrid3 = (0, _positionFns.snapToGrid)(_this.props.grid, deltaX, deltaY); var _snapToGrid4 = _slicedToArray(_snapToGrid3, 2); deltaX = _snapToGrid4[0]; deltaY = _snapToGrid4[1]; x = _this.state.lastX + deltaX, y = _this.state.lastY + deltaY; } var coreEvent = (0, _positionFns.createCoreData)(_assertThisInitialized(_this), x, y); // Call event handler var shouldContinue = _this.props.onStop(e, coreEvent); if (shouldContinue === false || _this.mounted === false) return false; var thisNode = _this.findDOMNode(); if (thisNode) { // Remove user-select hack if (_this.props.enableUserSelectHack) (0, _domFns.removeUserSelectStyles)(thisNode.ownerDocument); } (0, _log.default)('DraggableCore: handleDragStop: %j', coreEvent); // Reset the el. _this.setState({ dragging: false, lastX: NaN, lastY: NaN }); if (thisNode) { // Remove event handlers (0, _log.default)('DraggableCore: Removing handlers'); (0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.move, _this.handleDrag); (0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.stop, _this.handleDragStop); } }); _defineProperty(_assertThisInitialized(_this), "onMouseDown", function (e) { dragEventFor = eventsFor.mouse; // on touchscreen laptops we could switch back to mouse return _this.handleDragStart(e); }); _defineProperty(_assertThisInitialized(_this), "onMouseUp", function (e) { dragEventFor = eventsFor.mouse; return _this.handleDragStop(e); }); _defineProperty(_assertThisInitialized(_this), "onTouchStart", function (e) { // We're on a touch device now, so change the event handlers dragEventFor = eventsFor.touch; return _this.handleDragStart(e); }); _defineProperty(_assertThisInitialized(_this), "onTouchEnd", function (e) { // We're on a touch device now, so change the event handlers dragEventFor = eventsFor.touch; return _this.handleDragStop(e); }); return _this; } _createClass(DraggableCore, [{ key: "componentDidMount", value: function componentDidMount() { this.mounted = true; // Touch handlers must be added with {passive: false} to be cancelable. // https://developers.google.com/web/updates/2017/01/scrolling-intervention var thisNode = this.findDOMNode(); if (thisNode) { (0, _domFns.addEvent)(thisNode, eventsFor.touch.start, this.onTouchStart, { passive: false }); } } }, { key: "componentWillUnmount", value: function componentWillUnmount() { this.mounted = false; // Remove any leftover event handlers. Remove both touch and mouse handlers in case // some browser quirk caused a touch event to fire during a mouse move, or vice versa. var thisNode = this.findDOMNode(); if (thisNode) { var ownerDocument = thisNode.ownerDocument; (0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.move, this.handleDrag); (0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.move, this.handleDrag); (0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.stop, this.handleDragStop); (0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.stop, this.handleDragStop); (0, _domFns.removeEvent)(thisNode, eventsFor.touch.start, this.onTouchStart, { passive: false }); if (this.props.enableUserSelectHack) (0, _domFns.removeUserSelectStyles)(ownerDocument); } } // React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find // the underlying DOM node ourselves. See the README for more information. }, { key: "findDOMNode", value: function findDOMNode() /*: ?HTMLElement*/ { var _this$props, _this$props2, _this$props2$nodeRef; return (_this$props = this.props) !== null && _this$props !== void 0 && _this$props.nodeRef ? (_this$props2 = this.props) === null || _this$props2 === void 0 ? void 0 : (_this$props2$nodeRef = _this$props2.nodeRef) === null || _this$props2$nodeRef === void 0 ? void 0 : _this$props2$nodeRef.current : _reactDom.default.findDOMNode(this); } }, { key: "render", value: function render() /*: React.Element<any>*/ { // Reuse the child provided // This makes it flexible to use whatever element is wanted (div, ul, etc) return /*#__PURE__*/React.cloneElement(React.Children.only(this.props.children), { // Note: mouseMove handler is attached to document so it will still function // when the user drags quickly and leaves the bounds of the element. onMouseDown: this.onMouseDown, onMouseUp: this.onMouseUp, // onTouchStart is added on `componentDidMount` so they can be added with // {passive: false}, which allows it to cancel. See // https://developers.google.com/web/updates/2017/01/scrolling-intervention onTouchEnd: this.onTouchEnd }); } }]); return DraggableCore; }(React.Component); exports["default"] = DraggableCore; _defineProperty(DraggableCore, "displayName", 'DraggableCore'); _defineProperty(DraggableCore, "propTypes", { /** * `allowAnyClick` allows dragging using any mouse button. * By default, we only accept the left button. * * Defaults to `false`. */ allowAnyClick: _propTypes.default.bool, /** * `disabled`, if true, stops the <Draggable> from dragging. All handlers, * with the exception of `onMouseDown`, will not fire. */ disabled: _propTypes.default.bool, /** * By default, we add 'user-select:none' attributes to the document body * to prevent ugly text selection during drag. If this is causing problems * for your app, set this to `false`. */ enableUserSelectHack: _propTypes.default.bool, /** * `offsetParent`, if set, uses the passed DOM node to compute drag offsets * instead of using the parent node. */ offsetParent: function offsetParent(props /*: DraggableCoreProps*/ , propName /*: $Keys<DraggableCoreProps>*/ ) { if (props[propName] && props[propName].nodeType !== 1) { throw new Error('Draggable\'s offsetParent must be a DOM Node.'); } }, /** * `grid` specifies the x and y that dragging should snap to. */ grid: _propTypes.default.arrayOf(_propTypes.default.number), /** * `handle` specifies a selector to be used as the handle that initiates drag. * * Example: * * ```jsx * let App = React.createClass({ * render: function () { * return ( * <Draggable handle=".handle"> * <div> * <div className="handle">Click me to drag</div> * <div>This is some other content</div> * </div> * </Draggable> * ); * } * }); * ``` */ handle: _propTypes.default.string, /** * `cancel` specifies a selector to be used to prevent drag initialization. * * Example: * * ```jsx * let App = React.createClass({ * render: function () { * return( * <Draggable cancel=".cancel"> * <div> * <div className="cancel">You can't drag from here</div> * <div>Dragging here works fine</div> * </div> * </Draggable> * ); * } * }); * ``` */ cancel: _propTypes.default.string, /* If running in React Strict mode, ReactDOM.findDOMNode() is deprecated. * Unfortunately, in order for <Draggable> to work properly, we need raw access * to the underlying DOM node. If you want to avoid the warning, pass a `nodeRef` * as in this example: * * function MyComponent() { * const nodeRef = React.useRef(null); * return ( * <Draggable nodeRef={nodeRef}> * <div ref={nodeRef}>Example Target</div> * </Draggable> * ); * } * * This can be used for arbitrarily nested components, so long as the ref ends up * pointing to the actual child DOM node and not a custom component. */ nodeRef: _propTypes.default.object, /** * Called when dragging starts. * If this function returns the boolean false, dragging will be canceled. */ onStart: _propTypes.default.func, /** * Called while dragging. * If this function returns the boolean false, dragging will be canceled. */ onDrag: _propTypes.default.func, /** * Called when dragging stops. * If this function returns the boolean false, the drag will remain active. */ onStop: _propTypes.default.func, /** * A workaround option which can be passed if onMouseDown needs to be accessed, * since it'll always be blocked (as there is internal use of onMouseDown) */ onMouseDown: _propTypes.default.func, /** * `scale`, if set, applies scaling while dragging an element */ scale: _propTypes.default.number, /** * These properties should be defined on the child, not here. */ className: _shims.dontSetMe, style: _shims.dontSetMe, transform: _shims.dontSetMe }); _defineProperty(DraggableCore, "defaultProps", { allowAnyClick: false, // by default only accept left click disabled: false, enableUserSelectHack: true, onStart: function onStart() {}, onDrag: function onDrag() {}, onStop: function onStop() {}, onMouseDown: function onMouseDown() {}, scale: 1 }); /***/ }), /***/ "../node_modules/react-draggable/build/cjs/cjs.js": /*!********************************************************!*\ !*** ../node_modules/react-draggable/build/cjs/cjs.js ***! \********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; var _require = __webpack_require__(/*! ./Draggable */ "../node_modules/react-draggable/build/cjs/Draggable.js"), Draggable = _require.default, DraggableCore = _require.DraggableCore; // Previous versions of this lib exported <Draggable> as the root export. As to no-// them, or TypeScript, we export *both* as the root and as 'default'. // See https://github.com/mzabriskie/react-draggable/pull/254 // and https://github.com/mzabriskie/react-draggable/issues/266 module.exports = Draggable; module.exports["default"] = Draggable; module.exports.DraggableCore = DraggableCore; /***/ }), /***/ "../node_modules/react-draggable/build/cjs/utils/domFns.js": /*!*****************************************************************!*\ !*** ../node_modules/react-draggable/build/cjs/utils/domFns.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } Object.defineProperty(exports, "__esModule", ({ value: true })); exports.addClassName = addClassName; exports.addEvent = addEvent; exports.addUserSelectStyles = addUserSelectStyles; exports.createCSSTransform = createCSSTransform; exports.createSVGTransform = createSVGTransform; exports.getTouch = getTouch; exports.getTouchIdentifier = getTouchIdentifier; exports.getTranslation = getTranslation; exports.innerHeight = innerHeight; exports.innerWidth = innerWidth; exports.matchesSelector = matchesSelector; exports.matchesSelectorAndParentsTo = matchesSelectorAndParentsTo; exports.offsetXYFromParent = offsetXYFromParent; exports.outerHeight = outerHeight; exports.outerWidth = outerWidth; exports.removeClassName = removeClassName; exports.removeEvent = removeEvent; exports.removeUserSelectStyles = removeUserSelectStyles; var _shims = __webpack_require__(/*! ./shims */ "../node_modules/react-draggable/build/cjs/utils/shims.js"); var _getPrefix = _interopRequireWildcard(__webpack_require__(/*! ./getPrefix */ "../node_modules/react-draggable/build/cjs/utils/getPrefix.js")); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } var matchesSelectorFunc = ''; function matchesSelector(el /*: Node*/ , selector /*: string*/ ) /*: boolean*/ { if (!matchesSelectorFunc) { matchesSelectorFunc = (0, _shims.findInArray)(['matches', 'webkitMatchesSelector', 'mozMatchesSelector', 'msMatchesSelector', 'oMatchesSelector'], function (method) { // $FlowIgnore: Doesn't think elements are indexable return (0, _shims.isFunction)(el[method]); }); } // Might not be found entirely (not an Element?) - in that case, bail // $FlowIgnore: Doesn't think elements are indexable if (!(0, _shims.isFunction)(el[matchesSelectorFunc])) return false; // $FlowIgnore: Doesn't think elements are indexable return el[matchesSelectorFunc](selector); } // Works up the tree to the draggable itself attempting to match selector. function matchesSelectorAndParentsTo(el /*: Node*/ , selector /*: string*/ , baseNode /*: Node*/ ) /*: boolean*/ { var node = el; do { if (matchesSelector(node, selector)) return true; if (node === baseNode) return false; node = node.parentNode; } while (node); return false; } function addEvent(el /*: ?Node*/ , event /*: string*/ , handler /*: Function*/ , inputOptions /*: Object*/ ) /*: void*/ { if (!el) return; var options = _objectSpread({ capture: true }, inputOptions); // $FlowIgnore[method-unbinding] if (el.addEventListener) { el.addEventListener(event, handler, options); } else if (el.attachEvent) { el.attachEvent('on' + event, handler); } else { // $FlowIgnore: Doesn't think elements are indexable el['on' + event] = handler; } } function removeEvent(el /*: ?Node*/ , event /*: string*/ , handler /*: Function*/ , inputOptions /*: Object*/ ) /*: void*/ { if (!el) return; var options = _objectSpread({ capture: true }, inputOptions); // $FlowIgnore[method-unbinding] if (el.removeEventListener) { el.removeEventListener(event, handler, options); } else if (el.detachEvent) { el.detachEvent('on' + event, handler); } else { // $FlowIgnore: Doesn't think elements are indexable el['on' + event] = null; } } function outerHeight(node /*: HTMLElement*/ ) /*: number*/ { // This is deliberately excluding margin for our calculations, since we are using // offsetTop which is including margin. See getBoundPosition var height = node.clientHeight; var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node); height += (0, _shims.int)(computedStyle.borderTopWidth); height += (0, _shims.int)(computedStyle.borderBottomWidth); return height; } function outerWidth(node /*: HTMLElement*/ ) /*: number*/ { // This is deliberately excluding margin for our calculations, since we are using // offsetLeft which is including margin. See getBoundPosition var width = node.clientWidth; var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node); width += (0, _shims.int)(computedStyle.borderLeftWidth); width += (0, _shims.int)(computedStyle.borderRightWidth); return width; } function innerHeight(node /*: HTMLElement*/ ) /*: number*/ { var height = node.clientHeight; var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node); height -= (0, _shims.int)(computedStyle.paddingTop); height -= (0, _shims.int)(computedStyle.paddingBottom); return height; } function innerWidth(node /*: HTMLElement*/ ) /*: number*/ { var width = node.clientWidth; var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node); width -= (0, _shims.int)(computedStyle.paddingLeft); width -= (0, _shims.int)(computedStyle.paddingRight); return width; } /*:: interface EventWithOffset { clientX: number, clientY: number }*/ // Get from offsetParent function offsetXYFromParent(evt /*: EventWithOffset*/ , offsetParent /*: HTMLElement*/ , scale /*: number*/ ) /*: ControlPosition*/ { var isBody = offsetParent === offsetParent.ownerDocument.body; var offsetParentRect = isBody ? { left: 0, top: 0 } : offsetParent.getBoundingClientRect(); var x = (evt.clientX + offsetParent.scrollLeft - offsetParentRect.left) / scale; var y = (evt.clientY + offsetParent.scrollTop - offsetParentRect.top) / scale; return { x: x, y: y }; } function createCSSTransform(controlPos /*: ControlPosition*/ , positionOffset /*: PositionOffsetControlPosition*/ ) /*: Object*/ { var translation = getTranslation(controlPos, positionOffset, 'px'); return _defineProperty({}, (0, _getPrefix.browserPrefixToKey)('transform', _getPrefix.default), translation); } function createSVGTransform(controlPos /*: ControlPosition*/ , positionOffset /*: PositionOffsetControlPosition*/ ) /*: string*/ { var translation = getTranslation(controlPos, positionOffset, ''); return translation; } function getTranslation(_ref2, positionOffset /*: PositionOffsetControlPosition*/ , unitSuffix /*: string*/ ) /*: string*/ { var x = _ref2.x, y = _ref2.y; var translation = "translate(".concat(x).concat(unitSuffix, ",").concat(y).concat(unitSuffix, ")"); if (positionOffset) { var defaultX = "".concat(typeof positionOffset.x === 'string' ? positionOffset.x : positionOffset.x + unitSuffix); var defaultY = "".concat(typeof positionOffset.y === 'string' ? positionOffset.y : positionOffset.y + unitSuffix); translation = "translate(".concat(defaultX, ", ").concat(defaultY, ")") + translation; } return translation; } function getTouch(e /*: MouseTouchEvent*/ , identifier /*: number*/ ) /*: ?{clientX: number, clientY: number}*/ { return e.targetTouches && (0, _shims.findInArray)(e.targetTouches, function (t) { return identifier === t.identifier; }) || e.changedTouches && (0, _shims.findInArray)(e.changedTouches, function (t) { return identifier === t.identifier; }); } function getTouchIdentifier(e /*: MouseTouchEvent*/ ) /*: ?number*/ { if (e.targetTouches && e.targetTouches[0]) return e.targetTouches[0].identifier; if (e.changedTouches && e.changedTouches[0]) return e.changedTouches[0].identifier; } // User-select Hacks: // // Useful for preventing blue highlights all over everything when dragging. // Note we're passing `document` b/c we could be iframed function addUserSelectStyles(doc /*: ?Document*/ ) { if (!doc) return; var styleEl = doc.getElementById('react-draggable-style-el'); if (!styleEl) { styleEl = doc.createElement('style'); styleEl.type = 'text/css'; styleEl.id = 'react-draggable-style-el'; styleEl.innerHTML = '.react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n'; styleEl.innerHTML += '.react-draggable-transparent-selection *::selection {all: inherit;}\n'; doc.getElementsByTagName('head')[0].appendChild(styleEl); } if (doc.body) addClassName(doc.body, 'react-draggable-transparent-selection'); } function removeUserSelectStyles(doc /*: ?Document*/ ) { if (!doc) return; try { if (doc.body) removeClassName(doc.body, 'react-draggable-transparent-selection'); // $FlowIgnore: IE if (doc.selection) { // $FlowIgnore: IE doc.selection.empty(); } else { // Remove selection caused by scroll, unless it's a focused input // (we use doc.defaultView in case we're in an iframe) var selection = (doc.defaultView || window).getSelection(); if (selection && selection.type !== 'Caret') { selection.removeAllRanges(); } } } catch (e) {// probably IE } } function addClassName(el /*: HTMLElement*/ , className /*: string*/ ) { if (el.classList) { el.classList.add(className); } else { if (!el.className.match(new RegExp("(?:^|\\s)".concat(className, "(?!\\S)")))) { el.className += " ".concat(className); } } } function removeClassName(el /*: HTMLElement*/ , className /*: string*/ ) { if (el.classList) { el.classList.remove(className); } else { el.className = el.className.replace(new RegExp("(?:^|\\s)".concat(className, "(?!\\S)"), 'g'), ''); } } /***/ }), /***/ "../node_modules/react-draggable/build/cjs/utils/getPrefix.js": /*!********************************************************************!*\ !*** ../node_modules/react-draggable/build/cjs/utils/getPrefix.js ***! \********************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.browserPrefixToKey = browserPrefixToKey; exports.browserPrefixToStyle = browserPrefixToStyle; exports["default"] = void 0; exports.getPrefix = getPrefix; var prefixes = ['Moz', 'Webkit', 'O', 'ms']; function getPrefix() /*: string*/ { var _window$document, _window$document$docu; var prop /*: string*/ = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transform'; // Ensure we're running in an environment where there is actually a global // `window` obj if (typeof window === 'undefined') return ''; // If we're in a pseudo-browser server-side environment, this access // path may not exist, so bail out if it doesn't. var style = (_window$document = window.document) === null || _window$document === void 0 ? void 0 : (_window$document$docu = _window$document.documentElement) === null || _window$document$docu === void 0 ? void 0 : _window$document$docu.style; if (!style) return ''; if (prop in style) return ''; for (var i = 0; i < prefixes.length; i++) { if (browserPrefixToKey(prop, prefixes[i]) in style) return prefixes[i]; } return ''; } function browserPrefixToKey(prop /*: string*/ , prefix /*: string*/ ) /*: string*/ { return prefix ? "".concat(prefix).concat(kebabToTitleCase(prop)) : prop; } function browserPrefixToStyle(prop /*: string*/ , prefix /*: string*/ ) /*: string*/ { return prefix ? "-".concat(prefix.toLowerCase(), "-").concat(prop) : prop; } function kebabToTitleCase(str /*: string*/ ) /*: string*/ { var out = ''; var shouldCapitalize = true; for (var i = 0; i < str.length; i++) { if (shouldCapitalize) { out += str[i].toUpperCase(); shouldCapitalize = false; } else if (str[i] === '-') { shouldCapitalize = true; } else { out += str[i]; } } return out; } // Default export is the prefix itself, like 'Moz', 'Webkit', etc // Note that you may have to re-test for certain things; for instance, Chrome 50 // can handle unprefixed `transform`, but not unprefixed `user-select` var _default = (getPrefix() /*: string*/ ); exports["default"] = _default; /***/ }), /***/ "../node_modules/react-draggable/build/cjs/utils/log.js": /*!**************************************************************!*\ !*** ../node_modules/react-draggable/build/cjs/utils/log.js ***! \**************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = log; /*eslint no-console:0*/ function log() { var _console; if (false) {} } /***/ }), /***/ "../node_modules/react-draggable/build/cjs/utils/positionFns.js": /*!**********************************************************************!*\ !*** ../node_modules/react-draggable/build/cjs/utils/positionFns.js ***! \**********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.canDragX = canDragX; exports.canDragY = canDragY; exports.createCoreData = createCoreData; exports.createDraggableData = createDraggableData; exports.getBoundPosition = getBoundPosition; exports.getControlPosition = getControlPosition; exports.snapToGrid = snapToGrid; var _shims = __webpack_require__(/*! ./shims */ "../node_modules/react-draggable/build/cjs/utils/shims.js"); var _domFns = __webpack_require__(/*! ./domFns */ "../node_modules/react-draggable/build/cjs/utils/domFns.js"); function getBoundPosition(draggable /*: Draggable*/ , x /*: number*/ , y /*: number*/ ) /*: [number, number]*/ { // If no bounds, short-circuit and move on if (!draggable.props.bounds) return [x, y]; // Clone new bounds var bounds = draggable.props.bounds; bounds = typeof bounds === 'string' ? bounds : cloneBounds(bounds); var node = findDOMNode(draggable); if (typeof bounds === 'string') { var ownerDocument = node.ownerDocument; var ownerWindow = ownerDocument.defaultView; var boundNode; if (bounds === 'parent') { boundNode = node.parentNode; } else { boundNode = ownerDocument.querySelector(bounds); } if (!(boundNode instanceof ownerWindow.HTMLElement)) { throw new Error('Bounds selector "' + bounds + '" could not find an element.'); } var boundNodeEl /*: HTMLElement*/ = boundNode; // for Flow, can't seem to refine correctly var nodeStyle = ownerWindow.getComputedStyle(node); var boundNodeStyle = ownerWindow.getComputedStyle(boundNodeEl); // Compute bounds. This is a pain with padding and offsets but this gets it exactly right. bounds = { left: -node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingLeft) + (0, _shims.int)(nodeStyle.marginLeft), top: -node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingTop) + (0, _shims.int)(nodeStyle.marginTop), right: (0, _domFns.innerWidth)(boundNodeEl) - (0, _domFns.outerWidth)(node) - node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingRight) - (0, _shims.int)(nodeStyle.marginRight), bottom: (0, _domFns.innerHeight)(boundNodeEl) - (0, _domFns.outerHeight)(node) - node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingBottom) - (0, _shims.int)(nodeStyle.marginBottom) }; } // Keep x and y below right and bottom limits... if ((0, _shims.isNum)(bounds.right)) x = Math.min(x, bounds.right); if ((0, _shims.isNum)(bounds.bottom)) y = Math.min(y, bounds.bottom); // But above left and top limits. if ((0, _shims.isNum)(bounds.left)) x = Math.max(x, bounds.left); if ((0, _shims.isNum)(bounds.top)) y = Math.max(y, bounds.top); return [x, y]; } function snapToGrid(grid /*: [number, number]*/ , pendingX /*: number*/ , pendingY /*: number*/ ) /*: [number, number]*/ { var x = Math.round(pendingX / grid[0]) * grid[0]; var y = Math.round(pendingY / grid[1]) * grid[1]; return [x, y]; } function canDragX(draggable /*: Draggable*/ ) /*: boolean*/ { return draggable.props.axis === 'both' || draggable.props.axis === 'x'; } function canDragY(draggable /*: Draggable*/ ) /*: boolean*/ { return draggable.props.axis === 'both' || draggable.props.axis === 'y'; } // Get {x, y} positions from event. function getControlPosition(e /*: MouseTouchEvent*/ , touchIdentifier /*: ?number*/ , draggableCore /*: DraggableCore*/ ) /*: ?ControlPosition*/ { var touchObj = typeof touchIdentifier === 'number' ? (0, _domFns.getTouch)(e, touchIdentifier) : null; if (typeof touchIdentifier === 'number' && !touchObj) return null; // not the right touch var node = findDOMNode(draggableCore); // User can provide an offsetParent if desired. var offsetParent = draggableCore.props.offsetParent || node.offsetParent || node.ownerDocument.body; return (0, _domFns.offsetXYFromParent)(touchObj || e, offsetParent, draggableCore.props.scale); } // Create an data object exposed by <DraggableCore>'s events function createCoreData(draggable /*: DraggableCore*/ , x /*: number*/ , y /*: number*/ ) /*: DraggableData*/ { var state = draggable.state; var isStart = !(0, _shims.isNum)(state.lastX); var node = findDOMNode(draggable); if (isStart) { // If this is our first move, use the x and y as last coords. return { node: node, deltaX: 0, deltaY: 0, lastX: x, lastY: y, x: x, y: y }; } else { // Otherwise calculate proper values. return { node: node, deltaX: x - state.lastX, deltaY: y - state.lastY, lastX: state.lastX, lastY: state.lastY, x: x, y: y }; } } // Create an data exposed by <Draggable>'s events function createDraggableData(draggable /*: Draggable*/ , coreData /*: DraggableData*/ ) /*: DraggableData*/ { var scale = draggable.props.scale; return { node: coreData.node, x: draggable.state.x + coreData.deltaX / scale, y: draggable.state.y + coreData.deltaY / scale, deltaX: coreData.deltaX / scale, deltaY: coreData.deltaY / scale, lastX: draggable.state.x, lastY: draggable.state.y }; } // A lot faster than stringify/parse function cloneBounds(bounds /*: Bounds*/ ) /*: Bounds*/ { return { left: bounds.left, top: bounds.top, right: bounds.right, bottom: bounds.bottom }; } function findDOMNode(draggable /*: Draggable | DraggableCore*/ ) /*: HTMLElement*/ { var node = draggable.findDOMNode(); if (!node) { throw new Error('<DraggableCore>: Unmounted during event!'); } // $FlowIgnore we can't assert on HTMLElement due to tests... FIXME return node; } /***/ }), /***/ "../node_modules/react-draggable/build/cjs/utils/shims.js": /*!****************************************************************!*\ !*** ../node_modules/react-draggable/build/cjs/utils/shims.js ***! \****************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.dontSetMe = dontSetMe; exports.findInArray = findInArray; exports.int = int; exports.isFunction = isFunction; exports.isNum = isNum; // @credits https://gist.github.com/rogozhnikoff/a43cfed27c41e4e68cdc function findInArray(array /*: Array<any> | TouchList*/ , callback /*: Function*/ ) /*: any*/ { for (var i = 0, length = array.length; i < length; i++) { if (callback.apply(callback, [array[i], i, array])) return array[i]; } } function isFunction(func /*: any*/ ) /*: boolean %checks*/ { // $FlowIgnore[method-unbinding] return typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]'; } function isNum(num /*: any*/ ) /*: boolean %checks*/ { return typeof num === 'number' && !isNaN(num); } function int(a /*: string*/ ) /*: number*/ { return parseInt(a, 10); } function dontSetMe(props /*: Object*/ , propName /*: string*/ , componentName /*: string*/ ) /*: ?Error*/ { if (props[propName]) { return new Error("Invalid prop ".concat(propName, " passed to ").concat(componentName, " - do not set this, set it on the child.")); } } /***/ }), /***/ "../node_modules/react-is/cjs/react-is.development.js": /*!************************************************************!*\ !*** ../node_modules/react-is/cjs/react-is.development.js ***! \************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; /** * @license React * react-is.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ if (true) { (function() { 'use strict'; // ATTENTION // When adding new symbols to this file, // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' // The Symbol used to tag the ReactElement-like types. var REACT_ELEMENT_TYPE = Symbol.for('react.element'); var REACT_PORTAL_TYPE = Symbol.for('react.portal'); var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment'); var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode'); var REACT_PROFILER_TYPE = Symbol.for('react.profiler'); var REACT_PROVIDER_TYPE = Symbol.for('react.provider'); var REACT_CONTEXT_TYPE = Symbol.for('react.context'); var REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context'); var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref'); var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense'); var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list'); var REACT_MEMO_TYPE = Symbol.for('react.memo'); var REACT_LAZY_TYPE = Symbol.for('react.lazy'); var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen'); // ----------------------------------------------------------------------------- var enableScopeAPI = false; // Experimental Create Event Handle API. var enableCacheElement = false; var enableTransitionTracing = false; // No known bugs, but needs performance testing var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber // stuff. Intended to enable React core members to more easily debug scheduling // issues in DEV builds. var enableDebugTracing = false; // Track which Fiber(s) schedule render work. var REACT_MODULE_REFERENCE; { REACT_MODULE_REFERENCE = Symbol.for('react.module.reference'); } function isValidElementType(type) { if (typeof type === 'string' || typeof type === 'function') { return true; } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) { return true; } if (typeof type === 'object' && type !== null) { if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object // types supported by any Flight configuration anywhere since // we don't know which Flight build this will end up being used // with. type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) { return true; } } return false; } function typeOf(object) { if (typeof object === 'object' && object !== null) { var $$typeof = object.$$typeof; switch ($$typeof) { case REACT_ELEMENT_TYPE: var type = object.type; switch (type) { case REACT_FRAGMENT_TYPE: case REACT_PROFILER_TYPE: case REACT_STRICT_MODE_TYPE: case REACT_SUSPENSE_TYPE: case REACT_SUSPENSE_LIST_TYPE: return type; default: var $$typeofType = type && type.$$typeof; switch ($$typeofType) { case REACT_SERVER_CONTEXT_TYPE: case REACT_CONTEXT_TYPE: case REACT_FORWARD_REF_TYPE: case REACT_LAZY_TYPE: case REACT_MEMO_TYPE: case REACT_PROVIDER_TYPE: return $$typeofType; default: return $$typeof; } } case REACT_PORTAL_TYPE: return $$typeof; } } return undefined; } var ContextConsumer = REACT_CONTEXT_TYPE; var ContextProvider = REACT_PROVIDER_TYPE; var Element = REACT_ELEMENT_TYPE; var ForwardRef = REACT_FORWARD_REF_TYPE; var Fragment = REACT_FRAGMENT_TYPE; var Lazy = REACT_LAZY_TYPE; var Memo = REACT_MEMO_TYPE; var Portal = REACT_PORTAL_TYPE; var Profiler = REACT_PROFILER_TYPE; var StrictMode = REACT_STRICT_MODE_TYPE; var Suspense = REACT_SUSPENSE_TYPE; var SuspenseList = REACT_SUSPENSE_LIST_TYPE; var hasWarnedAboutDeprecatedIsAsyncMode = false; var hasWarnedAboutDeprecatedIsConcurrentMode = false; // AsyncMode should be deprecated function isAsyncMode(object) { { if (!hasWarnedAboutDeprecatedIsAsyncMode) { hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.'); } } return false; } function isConcurrentMode(object) { { if (!hasWarnedAboutDeprecatedIsConcurrentMode) { hasWarnedAboutDeprecatedIsConcurrentMode = true; // Using console['warn'] to evade Babel and ESLint console['warn']('The ReactIs.isConcurrentMode() alias has been deprecated, ' + 'and will be removed in React 18+.'); } } return false; } function isContextConsumer(object) { return typeOf(object) === REACT_CONTEXT_TYPE; } function isContextProvider(object) { return typeOf(object) === REACT_PROVIDER_TYPE; } function isElement(object) { return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; } function isForwardRef(object) { return typeOf(object) === REACT_FORWARD_REF_TYPE; } function isFragment(object) { return typeOf(object) === REACT_FRAGMENT_TYPE; } function isLazy(object) { return typeOf(object) === REACT_LAZY_TYPE; } function isMemo(object) { return typeOf(object) === REACT_MEMO_TYPE; } function isPortal(object) { return typeOf(object) === REACT_PORTAL_TYPE; } function isProfiler(object) { return typeOf(object) === REACT_PROFILER_TYPE; } function isStrictMode(object) { return typeOf(object) === REACT_STRICT_MODE_TYPE; } function isSuspense(object) { return typeOf(object) === REACT_SUSPENSE_TYPE; } function isSuspenseList(object) { return typeOf(object) === REACT_SUSPENSE_LIST_TYPE; } exports.ContextConsumer = ContextConsumer; exports.ContextProvider = ContextProvider; exports.Element = Element; exports.ForwardRef = ForwardRef; exports.Fragment = Fragment; exports.Lazy = Lazy; exports.Memo = Memo; exports.Portal = Portal; exports.Profiler = Profiler; exports.StrictMode = StrictMode; exports.Suspense = Suspense; exports.SuspenseList = SuspenseList; exports.isAsyncMode = isAsyncMode; exports.isConcurrentMode = isConcurrentMode; exports.isContextConsumer = isContextConsumer; exports.isContextProvider = isContextProvider; exports.isElement = isElement; exports.isForwardRef = isForwardRef; exports.isFragment = isFragment; exports.isLazy = isLazy; exports.isMemo = isMemo; exports.isPortal = isPortal; exports.isProfiler = isProfiler; exports.isStrictMode = isStrictMode; exports.isSuspense = isSuspense; exports.isSuspenseList = isSuspenseList; exports.isValidElementType = isValidElementType; exports.typeOf = typeOf; })(); } /***/ }), /***/ "../node_modules/react-is/index.js": /*!*****************************************!*\ !*** ../node_modules/react-is/index.js ***! \*****************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; if (false) {} else { module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "../node_modules/react-is/cjs/react-is.development.js"); } /***/ }), /***/ "../node_modules/react-sketch-canvas/dist/react-sketch-canvas.esm.js": /*!***************************************************************************!*\ !*** ../node_modules/react-sketch-canvas/dist/react-sketch-canvas.esm.js ***! \***************************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Canvas": () => (/* binding */ Canvas), /* harmony export */ "ReactSketchCanvas": () => (/* binding */ ReactSketchCanvas) /* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } var runtime = {exports: {}}; /** * Copyright (c) 2014-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ (function (module) { var runtime = (function (exports) { var Op = Object.prototype; var hasOwn = Op.hasOwnProperty; var undefined$1; // More compressible than void 0. var $Symbol = typeof Symbol === "function" ? Symbol : {}; var iteratorSymbol = $Symbol.iterator || "@@iterator"; var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); return obj[key]; } try { // IE 8 has a broken Object.defineProperty that only works on DOM objects. define({}, ""); } catch (err) { define = function(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; var generator = Object.create(protoGenerator.prototype); var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next, // .throw, and .return methods. generator._invoke = makeInvokeMethod(innerFn, self, context); return generator; } exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion // record like context.tryEntries[i].completion. This interface could // have been (and was previously) designed to take a closure to be // invoked without arguments, but in all the cases we care about we // already have an existing method we want to call, so there's no need // to create a new function object. We can even get away with assuming // the method takes exactly one argument, since that happens to be true // in every case, so we don't have to touch the arguments object. The // only additional allocation required is the completion record, which // has a stable shape and so hopefully should be cheap to allocate. function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } var GenStateSuspendedStart = "suspendedStart"; var GenStateSuspendedYield = "suspendedYield"; var GenStateExecuting = "executing"; var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as // breaking out of the dispatch switch statement. var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and // .constructor.prototype properties for functions that return Generator // objects. For full spec compliance, you may wish to configure your // minifier not to mangle the names of these two functions. function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that // don't natively support it. var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf; var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { // This environment has a native %IteratorPrototype%; use it instead // of the polyfill. IteratorPrototype = NativeIteratorPrototype; } var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); GeneratorFunction.prototype = GeneratorFunctionPrototype; define(Gp, "constructor", GeneratorFunctionPrototype); define(GeneratorFunctionPrototype, "constructor", GeneratorFunction); GeneratorFunction.displayName = define( GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction" ); // Helper for defining the .next, .throw, and .return methods of the // Iterator interface in terms of a single ._invoke method. function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function(method) { define(prototype, method, function(arg) { return this._invoke(method, arg); }); }); } exports.isGeneratorFunction = function(genFun) { var ctor = typeof genFun === "function" && genFun.constructor; return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can // do is to check its .name property. (ctor.displayName || ctor.name) === "GeneratorFunction" : false; }; exports.mark = function(genFun) { if (Object.setPrototypeOf) { Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); } else { genFun.__proto__ = GeneratorFunctionPrototype; define(genFun, toStringTagSymbol, "GeneratorFunction"); } genFun.prototype = Object.create(Gp); return genFun; }; // Within the body of any async function, `await x` is transformed to // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test // `hasOwn.call(value, "__await")` to determine if the yielded value is // meant to be awaited. exports.awrap = function(arg) { return { __await: arg }; }; function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (record.type === "throw") { reject(record.arg); } else { var result = record.arg; var value = result.value; if (value && typeof value === "object" && hasOwn.call(value, "__await")) { return PromiseImpl.resolve(value.__await).then(function(value) { invoke("next", value, resolve, reject); }, function(err) { invoke("throw", err, resolve, reject); }); } return PromiseImpl.resolve(value).then(function(unwrapped) { // When a yielded Promise is resolved, its final value becomes // the .value of the Promise<{value,done}> result for the // current iteration. result.value = unwrapped; resolve(result); }, function(error) { // If a rejected Promise was yielded, throw the rejection back // into the async generator function so it can be handled there. return invoke("throw", error, resolve, reject); }); } } var previousPromise; function enqueue(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function(resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = // If enqueue has been called before, then we want to wait until // all previous Promises have been resolved before calling invoke, // so that results are always delivered in the correct order. If // enqueue has not been called before, then it is important to // call invoke immediately, without waiting on a callback to fire, // so that the async generator function has the opportunity to do // any necessary setup in a predictable way. This predictability // is why the Promise constructor synchronously invokes its // executor callback, and why async functions synchronously // execute code before the first await. Since we implement simple // async functions in terms of async generators, it is especially // important to get this right, even though it requires care. previousPromise ? previousPromise.then( callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later // invocations of the iterator. callInvokeWithMethodAndArg ) : callInvokeWithMethodAndArg(); } // Define the unified helper method that is used to implement .next, // .throw, and .return (see defineIteratorMethods). this._invoke = enqueue; } defineIteratorMethods(AsyncIterator.prototype); define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }); exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of // AsyncIterator objects; they just return a Promise for the value of // the final result produced by the iterator. exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) { if (PromiseImpl === void 0) PromiseImpl = Promise; var iter = new AsyncIterator( wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl ); return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator. : iter.next().then(function(result) { return result.done ? result.value : iter.next(); }); }; function makeInvokeMethod(innerFn, self, context) { var state = GenStateSuspendedStart; return function invoke(method, arg) { if (state === GenStateExecuting) { throw new Error("Generator is already running"); } if (state === GenStateCompleted) { if (method === "throw") { throw arg; } // Be forgiving, per 25.3.3.3.3 of the spec: // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume return doneResult(); } context.method = method; context.arg = arg; while (true) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (context.method === "next") { // Setting context._sent for legacy support of Babel's // function.sent implementation. context.sent = context._sent = context.arg; } else if (context.method === "throw") { if (state === GenStateSuspendedStart) { state = GenStateCompleted; throw context.arg; } context.dispatchException(context.arg); } else if (context.method === "return") { context.abrupt("return", context.arg); } state = GenStateExecuting; var record = tryCatch(innerFn, self, context); if (record.type === "normal") { // If an exception is thrown from innerFn, we leave state === // GenStateExecuting and loop back for another invocation. state = context.done ? GenStateCompleted : GenStateSuspendedYield; if (record.arg === ContinueSentinel) { continue; } return { value: record.arg, done: context.done }; } else if (record.type === "throw") { state = GenStateCompleted; // Dispatch the exception by looping back around to the // context.dispatchException(context.arg) call above. context.method = "throw"; context.arg = record.arg; } } }; } // Call delegate.iterator[context.method](context.arg) and handle the // result, either by returning a { value, done } result from the // delegate iterator, or by modifying context.method and context.arg, // setting context.delegate to null, and returning the ContinueSentinel. function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (method === undefined$1) { // A .throw or .return when the delegate iterator has no .throw // method always terminates the yield* loop. context.delegate = null; if (context.method === "throw") { // Note: ["return"] must be used for ES3 parsing compatibility. if (delegate.iterator["return"]) { // If the delegate iterator has a return method, give it a // chance to clean up. context.method = "return"; context.arg = undefined$1; maybeInvokeDelegate(delegate, context); if (context.method === "throw") { // If maybeInvokeDelegate(context) changed context.method from // "return" to "throw", let that override the TypeError below. return ContinueSentinel; } } context.method = "throw"; context.arg = new TypeError( "The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (record.type === "throw") { context.method = "throw"; context.arg = record.arg; context.delegate = null; return ContinueSentinel; } var info = record.arg; if (! info) { context.method = "throw"; context.arg = new TypeError("iterator result is not an object"); context.delegate = null; return ContinueSentinel; } if (info.done) { // Assign the result of the finished delegate to the temporary // variable specified by delegate.resultName (see delegateYield). context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield). context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the // exception, let the outer generator proceed normally. If // context.method was "next", forget context.arg since it has been // "consumed" by the delegate iterator. If context.method was // "return", allow the original .return call to continue in the // outer generator. if (context.method !== "return") { context.method = "next"; context.arg = undefined$1; } } else { // Re-yield the result returned by the delegate method. return info; } // The delegate iterator is finished, so forget it and continue with // the outer generator. context.delegate = null; return ContinueSentinel; } // Define Generator.prototype.{next,throw,return} in terms of the // unified ._invoke helper method. defineIteratorMethods(Gp); define(Gp, toStringTagSymbol, "Generator"); // A Generator should always return itself as the iterator object when the // @@iterator function is called on it. Some browsers' implementations of the // iterator prototype chain incorrectly implement this, causing the Generator // object to not be returned from this call. This ensures that doesn't happen. // See https://github.com/facebook/regenerator/issues/274 for more details. define(Gp, iteratorSymbol, function() { return this; }); define(Gp, "toString", function() { return "[object Generator]"; }); function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; if (1 in locs) { entry.catchLoc = locs[1]; } if (2 in locs) { entry.finallyLoc = locs[2]; entry.afterLoc = locs[3]; } this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal"; delete record.arg; entry.completion = record; } function Context(tryLocsList) { // The root entry object (effectively a try statement without a catch // or a finally block) gives us a place to store values thrown from // locations where there is no enclosing try statement. this.tryEntries = [{ tryLoc: "root" }]; tryLocsList.forEach(pushTryEntry, this); this.reset(true); } exports.keys = function(object) { var keys = []; for (var key in object) { keys.push(key); } keys.reverse(); // Rather than returning an object with a next method, we keep // things simple and return the next function itself. return function next() { while (keys.length) { var key = keys.pop(); if (key in object) { next.value = key; next.done = false; return next; } } // To avoid creating an additional object, we just hang the .value // and .done properties off the next function object itself. This // also ensures that the minifier will not anonymize the function. next.done = true; return next; }; }; function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) { return iteratorMethod.call(iterable); } if (typeof iterable.next === "function") { return iterable; } if (!isNaN(iterable.length)) { var i = -1, next = function next() { while (++i < iterable.length) { if (hasOwn.call(iterable, i)) { next.value = iterable[i]; next.done = false; return next; } } next.value = undefined$1; next.done = true; return next; }; return next.next = next; } } // Return an iterator with no values. return { next: doneResult }; } exports.values = values; function doneResult() { return { value: undefined$1, done: true }; } Context.prototype = { constructor: Context, reset: function(skipTempReset) { this.prev = 0; this.next = 0; // Resetting context._sent for legacy support of Babel's // function.sent implementation. this.sent = this._sent = undefined$1; this.done = false; this.delegate = null; this.method = "next"; this.arg = undefined$1; this.tryEntries.forEach(resetTryEntry); if (!skipTempReset) { for (var name in this) { // Not sure about the optimal order of these conditions: if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) { this[name] = undefined$1; } } } }, stop: function() { this.done = true; var rootEntry = this.tryEntries[0]; var rootRecord = rootEntry.completion; if (rootRecord.type === "throw") { throw rootRecord.arg; } return this.rval; }, dispatchException: function(exception) { if (this.done) { throw exception; } var context = this; function handle(loc, caught) { record.type = "throw"; record.arg = exception; context.next = loc; if (caught) { // If the dispatched exception was caught by a catch block, // then let that catch block handle the exception normally. context.method = "next"; context.arg = undefined$1; } return !! caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; var record = entry.completion; if (entry.tryLoc === "root") { // Exception thrown outside of any try block that could handle // it, so set the completion value of the entire function to // throw the exception. return handle("end"); } if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"); var hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true); } else if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc); } } else if (hasCatch) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true); } } else if (hasFinally) { if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc); } } else { throw new Error("try statement without catch or finally"); } } } }, abrupt: function(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) { // Ignore the finally entry if control is not jumping to a // location outside the try/catch block. finallyEntry = null; } var record = finallyEntry ? finallyEntry.completion : {}; record.type = type; record.arg = arg; if (finallyEntry) { this.method = "next"; this.next = finallyEntry.finallyLoc; return ContinueSentinel; } return this.complete(record); }, complete: function(record, afterLoc) { if (record.type === "throw") { throw record.arg; } if (record.type === "break" || record.type === "continue") { this.next = record.arg; } else if (record.type === "return") { this.rval = this.arg = record.arg; this.method = "return"; this.next = "end"; } else if (record.type === "normal" && afterLoc) { this.next = afterLoc; } return ContinueSentinel; }, finish: function(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) { this.complete(entry.completion, entry.afterLoc); resetTryEntry(entry); return ContinueSentinel; } } }, "catch": function(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (record.type === "throw") { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } // The context.catch method must only be called with a location // argument that corresponds to a known catch block. throw new Error("illegal catch attempt"); }, delegateYield: function(iterable, resultName, nextLoc) { this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }; if (this.method === "next") { // Deliberately forget the last sent value so that we don't // accidentally pass it on to the delegate. this.arg = undefined$1; } return ContinueSentinel; } }; // Regardless of whether this script is executing as a CommonJS module // or not, return the runtime object so that we can declare the variable // regeneratorRuntime in the outer scope, which allows this module to be // injected easily by `bin/regenerator --include-runtime script.js`. return exports; }( // If this script is executing as a CommonJS module, use module.exports // as the regeneratorRuntime namespace. Otherwise create a new empty // object. Either way, the resulting object will be used to initialize // the regeneratorRuntime variable at the top of this file. module.exports )); try { regeneratorRuntime = runtime; } catch (accidentalStrictMode) { // This module should not be running in strict mode, so the above // assignment should always work unless something is misconfigured. Just // in case runtime.js accidentally runs in strict mode, in modern engines // we can explicitly access globalThis. In older engines we can escape // strict mode using a global Function call. This could conceivably fail // if a Content Security Policy forbids using Function, but in that case // the proper solution is to fix the accidental strict mode problem. If // you've misconfigured your bundler to force strict mode and applied a // CSP to forbid Function, and you're not willing to fix either of those // problems, please detail your unique predicament in a GitHub issue. if (typeof globalThis === "object") { globalThis.regeneratorRuntime = runtime; } else { Function("r", "regeneratorRuntime = r")(runtime); } } }(runtime)); var _regeneratorRuntime = runtime.exports; /** * Generate SVG Path tag from the given points */ var SvgPath = function SvgPath(_ref) { var paths = _ref.paths, id = _ref.id, strokeWidth = _ref.strokeWidth, strokeColor = _ref.strokeColor, _ref$command = _ref.command, command = _ref$command === void 0 ? bezierCommand : _ref$command; if (paths.length === 1) { var _paths$ = paths[0], x = _paths$.x, y = _paths$.y; var radius = strokeWidth / 2; return react__WEBPACK_IMPORTED_MODULE_0__.createElement("circle", { key: id, id: id, cx: x, cy: y, r: radius, stroke: strokeColor, fill: strokeColor }); } var d = paths.reduce(function (acc, point, i, a) { return i === 0 ? "M " + point.x + "," + point.y : acc + " " + command(point, i, a); }, ''); return react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", { key: id, id: id, d: d, fill: "none", strokeLinecap: "round", stroke: strokeColor, strokeWidth: strokeWidth }); }; var line = function line(pointA, pointB) { var lengthX = pointB.x - pointA.x; var lengthY = pointB.y - pointA.y; return { length: Math.sqrt(Math.pow(lengthX, 2) + Math.pow(lengthY, 2)), angle: Math.atan2(lengthY, lengthX) }; }; var controlPoint = function controlPoint(controlPoints) { var current = controlPoints.current, next = controlPoints.next, previous = controlPoints.previous, reverse = controlPoints.reverse; var p = previous || current; var n = next || current; var smoothing = 0.2; var o = line(p, n); var angle = o.angle + (reverse ? Math.PI : 0); var length = o.length * smoothing; var x = current.x + Math.cos(angle) * length; var y = current.y + Math.sin(angle) * length; return [x, y]; }; var bezierCommand = function bezierCommand(point, i, a) { var cpsX = null; var cpsY = null; switch (i) { case 0: var _controlPoint = controlPoint({ current: point }); cpsX = _controlPoint[0]; cpsY = _controlPoint[1]; break; case 1: var _controlPoint2 = controlPoint({ current: a[i - 1], next: point }); cpsX = _controlPoint2[0]; cpsY = _controlPoint2[1]; break; default: var _controlPoint3 = controlPoint({ current: a[i - 1], previous: a[i - 2], next: point }); cpsX = _controlPoint3[0]; cpsY = _controlPoint3[1]; break; } var _controlPoint4 = controlPoint({ current: point, previous: a[i - 1], next: a[i + 1], reverse: true }), cpeX = _controlPoint4[0], cpeY = _controlPoint4[1]; return "C " + cpsX + "," + cpsY + " " + cpeX + "," + cpeY + " " + point.x + ", " + point.y; }; var Paths = function Paths(_ref2) { var id = _ref2.id, paths = _ref2.paths; return react__WEBPACK_IMPORTED_MODULE_0__.createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, paths.map(function (path, index) { return react__WEBPACK_IMPORTED_MODULE_0__.createElement(SvgPath, { key: id + "__" + index, paths: path.paths, id: id + "__" + index, strokeWidth: path.strokeWidth, strokeColor: path.strokeColor, command: bezierCommand }); })); }; var loadImage = function loadImage(url) { return new Promise(function (resolve, reject) { var img = new Image(); img.addEventListener('load', function () { if (img.width > 0) { resolve(img); } reject('Image not found'); }); img.addEventListener('error', function (err) { return reject(err); }); img.src = url; img.setAttribute('crossorigin', 'anonymous'); }); }; function getCanvasWithViewBox(canvas) { var _canvas$firstChild; var svgCanvas = (_canvas$firstChild = canvas.firstChild) == null ? void 0 : _canvas$firstChild.cloneNode(true); var width = canvas.offsetWidth; var height = canvas.offsetHeight; svgCanvas.setAttribute('viewBox', "0 0 " + width + " " + height); svgCanvas.setAttribute('width', width.toString()); svgCanvas.setAttribute('height', height.toString()); return { svgCanvas: svgCanvas, width: width, height: height }; } var Canvas = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(function (props, ref) { var paths = props.paths, isDrawing = props.isDrawing, onPointerDown = props.onPointerDown, onPointerMove = props.onPointerMove, onPointerUp = props.onPointerUp, _props$id = props.id, id = _props$id === void 0 ? 'react-sketch-canvas' : _props$id, _props$width = props.width, width = _props$width === void 0 ? '100%' : _props$width, _props$height = props.height, height = _props$height === void 0 ? '100%' : _props$height, _props$className = props.className, className = _props$className === void 0 ? 'react-sketch-canvas' : _props$className, _props$canvasColor = props.canvasColor, canvasColor = _props$canvasColor === void 0 ? 'red' : _props$canvasColor, _props$backgroundImag = props.backgroundImage, backgroundImage = _props$backgroundImag === void 0 ? '' : _props$backgroundImag, _props$exportWithBack = props.exportWithBackgroundImage, exportWithBackgroundImage = _props$exportWithBack === void 0 ? false : _props$exportWithBack, _props$preserveBackgr = props.preserveBackgroundImageAspectRatio, preserveBackgroundImageAspectRatio = _props$preserveBackgr === void 0 ? 'none' : _props$preserveBackgr, _props$allowOnlyPoint = props.allowOnlyPointerType, allowOnlyPointerType = _props$allowOnlyPoint === void 0 ? 'all' : _props$allowOnlyPoint, _props$style = props.style, style = _props$style === void 0 ? { border: '0.0625rem solid #9c9c9c', borderRadius: '0.25rem' } : _props$style, _props$svgStyle = props.svgStyle, svgStyle = _props$svgStyle === void 0 ? {} : _props$svgStyle; var canvasRef = react__WEBPACK_IMPORTED_MODULE_0__.useRef(null); // Converts mouse coordinates to relative coordinate based on the absolute position of svg var getCoordinates = function getCoordinates(pointerEvent) { var _canvasRef$current, _window$scrollX, _window$scrollY; var boundingArea = (_canvasRef$current = canvasRef.current) == null ? void 0 : _canvasRef$current.getBoundingClientRect(); var scrollLeft = (_window$scrollX = window.scrollX) != null ? _window$scrollX : 0; var scrollTop = (_window$scrollY = window.scrollY) != null ? _window$scrollY : 0; if (!boundingArea) { return { x: 0, y: 0 }; } var point = { x: pointerEvent.pageX - boundingArea.left - scrollLeft, y: pointerEvent.pageY - boundingArea.top - scrollTop }; return point; }; /* Mouse Handlers - Mouse down, move and up */ var handlePointerDown = function handlePointerDown(event) { // Allow only chosen pointer type if (allowOnlyPointerType !== 'all' && event.pointerType !== allowOnlyPointerType) { return; } if (event.pointerType === 'mouse' && event.button !== 0) return; var point = getCoordinates(event); onPointerDown(point); }; var handlePointerMove = function handlePointerMove(event) { if (!isDrawing) return; // Allow only chosen pointer type if (allowOnlyPointerType !== 'all' && event.pointerType !== allowOnlyPointerType) { return; } var point = getCoordinates(event); onPointerMove(point); }; var handlePointerUp = function handlePointerUp(event) { if (event.pointerType === 'mouse' && event.button !== 0) return; // Allow only chosen pointer type if (allowOnlyPointerType !== 'all' && event.pointerType !== allowOnlyPointerType) { return; } onPointerUp(); }; /* Mouse Handlers ends */ react__WEBPACK_IMPORTED_MODULE_0__.useImperativeHandle(ref, function () { return { exportImage: function exportImage(imageType) { return new Promise( /*#__PURE__*/function () { var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(resolve, reject) { var canvas, _getCanvasWithViewBox, svgCanvas, _width, _height, canvasSketch, loadImagePromises, img; return _regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.prev = 0; canvas = canvasRef.current; if (canvas) { _context.next = 4; break; } throw Error('Canvas not rendered yet'); case 4: _getCanvasWithViewBox = getCanvasWithViewBox(canvas), svgCanvas = _getCanvasWithViewBox.svgCanvas, _width = _getCanvasWithViewBox.width, _height = _getCanvasWithViewBox.height; canvasSketch = "data:image/svg+xml;base64," + btoa(svgCanvas.outerHTML); _context.next = 8; return loadImage(canvasSketch); case 8: _context.t0 = _context.sent; loadImagePromises = [_context.t0]; if (!exportWithBackgroundImage) { _context.next = 21; break; } _context.prev = 11; _context.next = 14; return loadImage(backgroundImage); case 14: img = _context.sent; loadImagePromises.push(img); _context.next = 21; break; case 18: _context.prev = 18; _context.t1 = _context["catch"](11); console.warn('exportWithBackgroundImage props is set without a valid background image URL. This option is ignored'); case 21: Promise.all(loadImagePromises).then(function (images) { var renderCanvas = document.createElement('canvas'); renderCanvas.setAttribute('width', _width.toString()); renderCanvas.setAttribute('height', _height.toString()); var context = renderCanvas.getContext('2d'); if (!context) { throw Error('Canvas not rendered yet'); } images.reverse().forEach(function (image) { context.drawImage(image, 0, 0); }); resolve(renderCanvas.toDataURL("image/" + imageType)); })["catch"](function (e) { throw e; }); _context.next = 27; break; case 24: _context.prev = 24; _context.t2 = _context["catch"](0); reject(_context.t2); case 27: case "end": return _context.stop(); } } }, _callee, null, [[0, 24], [11, 18]]); })); return function (_x, _x2) { return _ref.apply(this, arguments); }; }()); }, exportSvg: function exportSvg() { return new Promise(function (resolve, reject) { try { var _canvasRef$current2; var canvas = (_canvasRef$current2 = canvasRef.current) != null ? _canvasRef$current2 : null; if (canvas !== null) { var _svgCanvas$querySelec, _svgCanvas$querySelec2; var _getCanvasWithViewBox2 = getCanvasWithViewBox(canvas), svgCanvas = _getCanvasWithViewBox2.svgCanvas; if (exportWithBackgroundImage) { resolve(svgCanvas.outerHTML); return; } (_svgCanvas$querySelec = svgCanvas.querySelector("#" + id + "__background")) == null ? void 0 : _svgCanvas$querySelec.remove(); (_svgCanvas$querySelec2 = svgCanvas.querySelector("#" + id + "__canvas-background")) == null ? void 0 : _svgCanvas$querySelec2.setAttribute('fill', canvasColor); resolve(svgCanvas.outerHTML); } reject(new Error('Canvas not loaded')); } catch (e) { reject(e); } }); } }; }); /* Add event listener to Mouse up and Touch up to release drawing even when point goes out of canvas */ react__WEBPACK_IMPORTED_MODULE_0__.useEffect(function () { document.addEventListener('pointerup', handlePointerUp); return function () { document.removeEventListener('pointerup', handlePointerUp); }; }, [handlePointerUp]); var eraserPaths = paths.filter(function (path) { return !path.drawMode; }); var currentGroup = 0; var pathGroups = paths.reduce(function (arrayGroup, path) { if (!path.drawMode) { currentGroup += 1; return arrayGroup; } if (arrayGroup[currentGroup] === undefined) { arrayGroup[currentGroup] = []; } arrayGroup[currentGroup].push(path); return arrayGroup; }, [[]]); return react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", { role: "presentation", ref: canvasRef, className: className, style: _extends({ touchAction: 'none', width: width, height: height }, style), "touch-action": "none", onPointerDown: handlePointerDown, onPointerMove: handlePointerMove, onPointerUp: handlePointerUp }, react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", { version: "1.1", baseProfile: "full", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", style: _extends({ width: '100%', height: '100%' }, svgStyle), id: id }, react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", { id: id + "__eraser-stroke-group", display: "none" }, react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", { id: id + "__mask-background", x: "0", y: "0", width: "100%", height: "100%", fill: "white" }), eraserPaths.map(function (eraserPath, i) { return react__WEBPACK_IMPORTED_MODULE_0__.createElement(SvgPath, { key: id + "__eraser-" + i, id: id + "__eraser-" + i, paths: eraserPath.paths, strokeColor: "#000000", strokeWidth: eraserPath.strokeWidth }); })), react__WEBPACK_IMPORTED_MODULE_0__.createElement("defs", null, backgroundImage && react__WEBPACK_IMPORTED_MODULE_0__.createElement("pattern", { id: id + "__background", x: "0", y: "0", width: "100%", height: "100%", patternUnits: "userSpaceOnUse" }, react__WEBPACK_IMPORTED_MODULE_0__.createElement("image", { x: "0", y: "0", width: "100%", height: "100%", xlinkHref: backgroundImage, preserveAspectRatio: preserveBackgroundImageAspectRatio })), eraserPaths.map(function (_, i) { return react__WEBPACK_IMPORTED_MODULE_0__.createElement("mask", { id: id + "__eraser-mask-" + i, key: id + "__eraser-mask-" + i, maskUnits: "userSpaceOnUse" }, react__WEBPACK_IMPORTED_MODULE_0__.createElement("use", { href: "#" + id + "__mask-background" }), Array.from({ length: eraserPaths.length - i }, function (_, j) { return j + i; }).map(function (k) { return react__WEBPACK_IMPORTED_MODULE_0__.createElement("use", { key: k.toString(), href: "#" + id + "__eraser-" + k.toString() }); })); })), react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", { id: id + "__canvas-background-group" }, react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", { id: id + "__canvas-background", x: "0", y: "0", width: "100%", height: "100%", fill: backgroundImage ? "url(#" + id + "__background)" : canvasColor })), pathGroups.map(function (pathGroup, i) { return react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", { id: id + "__stroke-group-" + i, key: id + "__stroke-group-" + i, mask: "url(#" + id + "__eraser-mask-" + i + ")" }, react__WEBPACK_IMPORTED_MODULE_0__.createElement(Paths, { id: id, paths: pathGroup })); }))); }); var ReactSketchCanvas = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(function (props, ref) { var _props$id = props.id, id = _props$id === void 0 ? 'react-sketch-canvas' : _props$id, _props$width = props.width, width = _props$width === void 0 ? '100%' : _props$width, _props$height = props.height, height = _props$height === void 0 ? '100%' : _props$height, _props$className = props.className, className = _props$className === void 0 ? '' : _props$className, _props$canvasColor = props.canvasColor, canvasColor = _props$canvasColor === void 0 ? 'white' : _props$canvasColor, _props$strokeColor = props.strokeColor, strokeColor = _props$strokeColor === void 0 ? 'red' : _props$strokeColor, _props$backgroundImag = props.backgroundImage, backgroundImage = _props$backgroundImag === void 0 ? '' : _props$backgroundImag, _props$exportWithBack = props.exportWithBackgroundImage, exportWithBackgroundImage = _props$exportWithBack === void 0 ? false : _props$exportWithBack, _props$preserveBackgr = props.preserveBackgroundImageAspectRatio, preserveBackgroundImageAspectRatio = _props$preserveBackgr === void 0 ? 'none' : _props$preserveBackgr, _props$strokeWidth = props.strokeWidth, strokeWidth = _props$strokeWidth === void 0 ? 4 : _props$strokeWidth, _props$eraserWidth = props.eraserWidth, eraserWidth = _props$eraserWidth === void 0 ? 8 : _props$eraserWidth, _props$allowOnlyPoint = props.allowOnlyPointerType, allowOnlyPointerType = _props$allowOnlyPoint === void 0 ? 'all' : _props$allowOnlyPoint, _props$style = props.style, style = _props$style === void 0 ? { border: '0.0625rem solid #9c9c9c', borderRadius: '0.25rem' } : _props$style, _props$svgStyle = props.svgStyle, svgStyle = _props$svgStyle === void 0 ? {} : _props$svgStyle, _props$onChange = props.onChange, onChange = _props$onChange === void 0 ? function (_paths) {} : _props$onChange, _props$onStroke = props.onStroke, onStroke = _props$onStroke === void 0 ? function (_path, _isEraser) {} : _props$onStroke, _props$withTimestamp = props.withTimestamp, withTimestamp = _props$withTimestamp === void 0 ? false : _props$withTimestamp; var svgCanvas = react__WEBPACK_IMPORTED_MODULE_0__.createRef(); var _React$useState = react__WEBPACK_IMPORTED_MODULE_0__.useState(true), drawMode = _React$useState[0], setDrawMode = _React$useState[1]; var _React$useState2 = react__WEBPACK_IMPORTED_MODULE_0__.useState(false), isDrawing = _React$useState2[0], setIsDrawing = _React$useState2[1]; var _React$useState3 = react__WEBPACK_IMPORTED_MODULE_0__.useState([]), resetStack = _React$useState3[0], setResetStack = _React$useState3[1]; var _React$useState4 = react__WEBPACK_IMPORTED_MODULE_0__.useState([]), undoStack = _React$useState4[0], setUndoStack = _React$useState4[1]; var _React$useState5 = react__WEBPACK_IMPORTED_MODULE_0__.useState([]), currentPaths = _React$useState5[0], setCurrentPaths = _React$useState5[1]; var liftStrokeUp = react__WEBPACK_IMPORTED_MODULE_0__.useCallback(function () { var _currentPaths$slice$, _currentPaths$slice; var lastStroke = (_currentPaths$slice$ = (_currentPaths$slice = currentPaths.slice(-1)) == null ? void 0 : _currentPaths$slice[0]) != null ? _currentPaths$slice$ : null; if (lastStroke === null) { console.warn('No stroke found!'); return; } onStroke(lastStroke, !lastStroke.drawMode); }, [isDrawing]); react__WEBPACK_IMPORTED_MODULE_0__.useEffect(function () { liftStrokeUp(); }, [isDrawing]); react__WEBPACK_IMPORTED_MODULE_0__.useEffect(function () { onChange(currentPaths); }, [currentPaths]); react__WEBPACK_IMPORTED_MODULE_0__.useImperativeHandle(ref, function () { return { eraseMode: function eraseMode(erase) { setDrawMode(!erase); }, clearCanvas: function clearCanvas() { setResetStack([].concat(currentPaths)); setCurrentPaths([]); }, undo: function undo() { // If there was a last reset then if (resetStack.length !== 0) { setCurrentPaths([].concat(resetStack)); setResetStack([]); return; } setUndoStack(function (undoStack) { return [].concat(undoStack, currentPaths.slice(-1)); }); setCurrentPaths(function (currentPaths) { return currentPaths.slice(0, -1); }); }, redo: function redo() { // Nothing to Redo if (undoStack.length === 0) return; setCurrentPaths(function (currentPaths) { return [].concat(currentPaths, undoStack.slice(-1)); }); setUndoStack(function (undoStack) { return undoStack.slice(0, -1); }); }, exportImage: function exportImage(imageType) { var _svgCanvas$current; var exportImage = (_svgCanvas$current = svgCanvas.current) == null ? void 0 : _svgCanvas$current.exportImage; if (!exportImage) { throw Error('Export function called before canvas loaded'); } else { return exportImage(imageType); } }, exportSvg: function exportSvg() { return new Promise(function (resolve, reject) { var _svgCanvas$current2; var exportSvg = (_svgCanvas$current2 = svgCanvas.current) == null ? void 0 : _svgCanvas$current2.exportSvg; if (!exportSvg) { reject(Error('Export function called before canvas loaded')); } else { exportSvg().then(function (data) { resolve(data); })["catch"](function (e) { reject(e); }); } }); }, exportPaths: function exportPaths() { return new Promise(function (resolve, reject) { try { resolve(currentPaths); } catch (e) { reject(e); } }); }, loadPaths: function loadPaths(paths) { setCurrentPaths(function (currentPaths) { return [].concat(currentPaths, paths); }); }, getSketchingTime: function getSketchingTime() { return new Promise(function (resolve, reject) { if (!withTimestamp) { reject(new Error("Set 'withTimestamp' prop to get sketching time")); } try { var sketchingTime = currentPaths.reduce(function (totalSketchingTime, path) { var _path$startTimestamp, _path$endTimestamp; var startTimestamp = (_path$startTimestamp = path.startTimestamp) != null ? _path$startTimestamp : 0; var endTimestamp = (_path$endTimestamp = path.endTimestamp) != null ? _path$endTimestamp : 0; return totalSketchingTime + (endTimestamp - startTimestamp); }, 0); resolve(sketchingTime); } catch (e) { reject(e); } }); }, resetCanvas: function resetCanvas() { setResetStack([]); setUndoStack([]); setCurrentPaths([]); } }; }); var handlePointerDown = function handlePointerDown(point) { setIsDrawing(true); setUndoStack([]); var stroke = { drawMode: drawMode, strokeColor: drawMode ? strokeColor : '#000000', strokeWidth: drawMode ? strokeWidth : eraserWidth, paths: [point] }; if (withTimestamp) { stroke = _extends({}, stroke, { startTimestamp: Date.now(), endTimestamp: 0 }); } setCurrentPaths(function (currentPaths) { return [].concat(currentPaths, [stroke]); }); }; var handlePointerMove = function handlePointerMove(point) { if (!isDrawing) return; var currentStroke = currentPaths.slice(-1)[0]; var updatedStroke = _extends({}, currentStroke, { paths: [].concat(currentStroke.paths, [point]) }); setCurrentPaths(function (currentPaths) { return [].concat(currentPaths.slice(0, -1), [updatedStroke]); }); }; var handlePointerUp = function handlePointerUp() { var _currentPaths$slice$2, _currentPaths$slice2; if (!isDrawing) { return; } setIsDrawing(false); if (!withTimestamp) { return; } var currentStroke = (_currentPaths$slice$2 = (_currentPaths$slice2 = currentPaths.slice(-1)) == null ? void 0 : _currentPaths$slice2[0]) != null ? _currentPaths$slice$2 : null; if (currentStroke === null) { return; } var updatedStroke = _extends({}, currentStroke, { endTimestamp: Date.now() }); setCurrentPaths(function (currentPaths) { return [].concat(currentPaths.slice(0, -1), [updatedStroke]); }); }; return react__WEBPACK_IMPORTED_MODULE_0__.createElement(Canvas, { ref: svgCanvas, id: id, width: width, height: height, className: className, canvasColor: canvasColor, backgroundImage: backgroundImage, exportWithBackgroundImage: exportWithBackgroundImage, preserveBackgroundImageAspectRatio: preserveBackgroundImageAspectRatio, allowOnlyPointerType: allowOnlyPointerType, style: style, svgStyle: svgStyle, paths: currentPaths, isDrawing: isDrawing, onPointerDown: handlePointerDown, onPointerMove: handlePointerMove, onPointerUp: handlePointerUp }); }); //# sourceMappingURL=react-sketch-canvas.esm.js.map /***/ }), /***/ "../node_modules/style-to-object/index.js": /*!************************************************!*\ !*** ../node_modules/style-to-object/index.js ***! \************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var parse = __webpack_require__(/*! inline-style-parser */ "../node_modules/inline-style-parser/index.js"); /** * Parses inline style to object. * * @example * // returns { 'line-height': '42' } * StyleToObject('line-height: 42;'); * * @param {String} style - The inline style. * @param {Function} [iterator] - The iterator function. * @return {null|Object} */ function StyleToObject(style, iterator) { var output = null; if (!style || typeof style !== 'string') { return output; } var declaration; var declarations = parse(style); var hasIterator = typeof iterator === 'function'; var property; var value; for (var i = 0, len = declarations.length; i < len; i++) { declaration = declarations[i]; property = declaration.property; value = declaration.value; if (hasIterator) { iterator(property, value, declaration); } else if (value) { output || (output = {}); output[property] = value; } } return output; } module.exports = StyleToObject; module.exports["default"] = StyleToObject; // ESM support /***/ }), /***/ "react": /*!************************!*\ !*** external "React" ***! \************************/ /***/ ((module) => { "use strict"; module.exports = React; /***/ }), /***/ "react-dom": /*!***************************!*\ !*** external "ReactDOM" ***! \***************************/ /***/ ((module) => { "use strict"; module.exports = ReactDOM; /***/ }), /***/ "@elementor/icons": /*!******************************************************!*\ !*** external "__UNSTABLE__elementorPackages.icons" ***! \******************************************************/ /***/ ((module) => { "use strict"; module.exports = __UNSTABLE__elementorPackages.icons; /***/ }), /***/ "@elementor/ui": /*!***************************************************!*\ !*** external "__UNSTABLE__elementorPackages.ui" ***! \***************************************************/ /***/ ((module) => { "use strict"; module.exports = __UNSTABLE__elementorPackages.ui; /***/ }), /***/ "@wordpress/i18n": /*!**************************!*\ !*** external "wp.i18n" ***! \**************************/ /***/ ((module) => { "use strict"; module.exports = wp.i18n; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js": /*!******************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***! \******************************************************************/ /***/ ((module) => { function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js": /*!****************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/arrayWithHoles.js ***! \****************************************************************/ /***/ ((module) => { function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js": /*!******************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***! \******************************************************************/ /***/ ((module) => { function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/defineProperty.js": /*!****************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***! \****************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js"); function _defineProperty(obj, key, value) { key = toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/extends.js": /*!*********************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/extends.js ***! \*********************************************************/ /***/ ((module) => { function _extends() { module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }, module.exports.__esModule = true, module.exports["default"] = module.exports; return _extends.apply(this, arguments); } module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js": /*!***********************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***! \***********************************************************************/ /***/ ((module) => { function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js": /*!**********************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***! \**********************************************************************/ /***/ ((module) => { function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } } module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/nonIterableRest.js": /*!*****************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/nonIterableRest.js ***! \*****************************************************************/ /***/ ((module) => { function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/objectWithoutProperties.js": /*!*************************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/objectWithoutProperties.js ***! \*************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var objectWithoutPropertiesLoose = __webpack_require__(/*! ./objectWithoutPropertiesLoose.js */ "../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js"); function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } module.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js": /*!******************************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js ***! \******************************************************************************/ /***/ ((module) => { function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js": /*!********************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***! \********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ module.exports = _regeneratorRuntime = function _regeneratorRuntime() { return exports; }, module.exports.__esModule = true, module.exports["default"] = module.exports; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/slicedToArray.js": /*!***************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/slicedToArray.js ***! \***************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js"); var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js"); var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js"); var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ "../node_modules/@babel/runtime/helpers/nonIterableRest.js"); function _slicedToArray(arr, i) { return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest(); } module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js": /*!*************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***! \*************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js": /*!***************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***! \***************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js"); function _toPropertyKey(arg) { var key = toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/typeof.js": /*!********************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/typeof.js ***! \********************************************************/ /***/ ((module) => { function _typeof(obj) { "@babel/helpers - typeof"; return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj); } module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js": /*!****************************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***! \****************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js"); function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen); } module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/regenerator/index.js": /*!***********************************************************!*\ !*** ../node_modules/@babel/runtime/regenerator/index.js ***! \***********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // TODO(Babel 8): Remove this file. var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js")(); module.exports = runtime; // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736= try { regeneratorRuntime = runtime; } catch (accidentalStrictMode) { if (typeof globalThis === "object") { globalThis.regeneratorRuntime = runtime; } else { Function("r", "regeneratorRuntime = r")(runtime); } } /***/ }), /***/ "../node_modules/bail/index.js": /*!*************************************!*\ !*** ../node_modules/bail/index.js ***! \*************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "bail": () => (/* binding */ bail) /* harmony export */ }); /** * Throw a given error. * * @param {Error|null|undefined} [error] * Maybe error. * @returns {asserts error is null|undefined} */ function bail(error) { if (error) { throw error } } /***/ }), /***/ "../node_modules/comma-separated-tokens/index.js": /*!*******************************************************!*\ !*** ../node_modules/comma-separated-tokens/index.js ***! \*******************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "parse": () => (/* binding */ parse), /* harmony export */ "stringify": () => (/* binding */ stringify) /* harmony export */ }); /** * @typedef Options * Configuration for `stringify`. * @property {boolean} [padLeft=true] * Whether to pad a space before a token. * @property {boolean} [padRight=false] * Whether to pad a space after a token. */ /** * @typedef {Options} StringifyOptions * Please use `StringifyOptions` instead. */ /** * Parse comma-separated tokens to an array. * * @param {string} value * Comma-separated tokens. * @returns {Array<string>} * List of tokens. */ function parse(value) { /** @type {Array<string>} */ const tokens = [] const input = String(value || '') let index = input.indexOf(',') let start = 0 /** @type {boolean} */ let end = false while (!end) { if (index === -1) { index = input.length end = true } const token = input.slice(start, index).trim() if (token || !end) { tokens.push(token) } start = index + 1 index = input.indexOf(',', start) } return tokens } /** * Serialize an array of strings or numbers to comma-separated tokens. * * @param {Array<string|number>} values * List of tokens. * @param {Options} [options] * Configuration for `stringify` (optional). * @returns {string} * Comma-separated tokens. */ function stringify(values, options) { const settings = options || {} // Ensure the last empty entry is seen. const input = values[values.length - 1] === '' ? [...values, ''] : values return input .join( (settings.padRight ? ' ' : '') + ',' + (settings.padLeft === false ? '' : ' ') ) .trim() } /***/ }), /***/ "../node_modules/decode-named-character-reference/index.dom.js": /*!*********************************************************************!*\ !*** ../node_modules/decode-named-character-reference/index.dom.js ***! \*********************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "decodeNamedCharacterReference": () => (/* binding */ decodeNamedCharacterReference) /* harmony export */ }); /// <reference lib="dom" /> /* eslint-env browser */ const element = document.createElement('i') /** * @param {string} value * @returns {string|false} */ function decodeNamedCharacterReference(value) { const characterReference = '&' + value + ';' element.innerHTML = characterReference const char = element.textContent // Some named character references do not require the closing semicolon // (`¬`, for instance), which leads to situations where parsing the assumed // named reference of `¬it;` will result in the string `¬it;`. // When we encounter a trailing semicolon after parsing, and the character // reference to decode was not a semicolon (`;`), we can assume that the // matching was not complete. // @ts-expect-error: TypeScript is wrong that `textContent` on elements can // yield `null`. if (char.charCodeAt(char.length - 1) === 59 /* `;` */ && value !== 'semi') { return false } // If the decoded string is equal to the input, the character reference was // not valid. // @ts-expect-error: TypeScript is wrong that `textContent` on elements can // yield `null`. return char === characterReference ? false : char } /***/ }), /***/ "../node_modules/dequal/dist/index.mjs": /*!*********************************************!*\ !*** ../node_modules/dequal/dist/index.mjs ***! \*********************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "dequal": () => (/* binding */ dequal) /* harmony export */ }); var has = Object.prototype.hasOwnProperty; function find(iter, tar, key) { for (key of iter.keys()) { if (dequal(key, tar)) return key; } } function dequal(foo, bar) { var ctor, len, tmp; if (foo === bar) return true; if (foo && bar && (ctor=foo.constructor) === bar.constructor) { if (ctor === Date) return foo.getTime() === bar.getTime(); if (ctor === RegExp) return foo.toString() === bar.toString(); if (ctor === Array) { if ((len=foo.length) === bar.length) { while (len-- && dequal(foo[len], bar[len])); } return len === -1; } if (ctor === Set) { if (foo.size !== bar.size) { return false; } for (len of foo) { tmp = len; if (tmp && typeof tmp === 'object') { tmp = find(bar, tmp); if (!tmp) return false; } if (!bar.has(tmp)) return false; } return true; } if (ctor === Map) { if (foo.size !== bar.size) { return false; } for (len of foo) { tmp = len[0]; if (tmp && typeof tmp === 'object') { tmp = find(bar, tmp); if (!tmp) return false; } if (!dequal(len[1], bar.get(tmp))) { return false; } } return true; } if (ctor === ArrayBuffer) { foo = new Uint8Array(foo); bar = new Uint8Array(bar); } else if (ctor === DataView) { if ((len=foo.byteLength) === bar.byteLength) { while (len-- && foo.getInt8(len) === bar.getInt8(len)); } return len === -1; } if (ArrayBuffer.isView(foo)) { if ((len=foo.byteLength) === bar.byteLength) { while (len-- && foo[len] === bar[len]); } return len === -1; } if (!ctor || typeof foo === 'object') { len = 0; for (ctor in foo) { if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false; if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false; } return Object.keys(bar).length === len; } } return foo !== foo && bar !== bar; } /***/ }), /***/ "../node_modules/diff/lib/index.mjs": /*!******************************************!*\ !*** ../node_modules/diff/lib/index.mjs ***! \******************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Diff": () => (/* binding */ Diff), /* harmony export */ "applyPatch": () => (/* binding */ applyPatch), /* harmony export */ "applyPatches": () => (/* binding */ applyPatches), /* harmony export */ "canonicalize": () => (/* binding */ canonicalize), /* harmony export */ "convertChangesToDMP": () => (/* binding */ convertChangesToDMP), /* harmony export */ "convertChangesToXML": () => (/* binding */ convertChangesToXML), /* harmony export */ "createPatch": () => (/* binding */ createPatch), /* harmony export */ "createTwoFilesPatch": () => (/* binding */ createTwoFilesPatch), /* harmony export */ "diffArrays": () => (/* binding */ diffArrays), /* harmony export */ "diffChars": () => (/* binding */ diffChars), /* harmony export */ "diffCss": () => (/* binding */ diffCss), /* harmony export */ "diffJson": () => (/* binding */ diffJson), /* harmony export */ "diffLines": () => (/* binding */ diffLines), /* harmony export */ "diffSentences": () => (/* binding */ diffSentences), /* harmony export */ "diffTrimmedLines": () => (/* binding */ diffTrimmedLines), /* harmony export */ "diffWords": () => (/* binding */ diffWords), /* harmony export */ "diffWordsWithSpace": () => (/* binding */ diffWordsWithSpace), /* harmony export */ "merge": () => (/* binding */ merge), /* harmony export */ "parsePatch": () => (/* binding */ parsePatch), /* harmony export */ "structuredPatch": () => (/* binding */ structuredPatch) /* harmony export */ }); function Diff() {} Diff.prototype = { diff: function diff(oldString, newString) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var callback = options.callback; if (typeof options === 'function') { callback = options; options = {}; } this.options = options; var self = this; function done(value) { if (callback) { setTimeout(function () { callback(undefined, value); }, 0); return true; } else { return value; } } // Allow subclasses to massage the input prior to running oldString = this.castInput(oldString); newString = this.castInput(newString); oldString = this.removeEmpty(this.tokenize(oldString)); newString = this.removeEmpty(this.tokenize(newString)); var newLen = newString.length, oldLen = oldString.length; var editLength = 1; var maxEditLength = newLen + oldLen; if (options.maxEditLength) { maxEditLength = Math.min(maxEditLength, options.maxEditLength); } var bestPath = [{ newPos: -1, components: [] }]; // Seed editLength = 0, i.e. the content starts with the same values var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) { // Identity per the equality and tokenizer return done([{ value: this.join(newString), count: newString.length }]); } // Main worker method. checks all permutations of a given edit length for acceptance. function execEditLength() { for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) { var basePath = void 0; var addPath = bestPath[diagonalPath - 1], removePath = bestPath[diagonalPath + 1], _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; if (addPath) { // No one else is going to attempt to use this value, clear it bestPath[diagonalPath - 1] = undefined; } var canAdd = addPath && addPath.newPos + 1 < newLen, canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen; if (!canAdd && !canRemove) { // If this path is a terminal then prune bestPath[diagonalPath] = undefined; continue; } // Select the diagonal that we want to branch from. We select the prior // path whose position in the new string is the farthest from the origin // and does not pass the bounds of the diff graph if (!canAdd || canRemove && addPath.newPos < removePath.newPos) { basePath = clonePath(removePath); self.pushComponent(basePath.components, undefined, true); } else { basePath = addPath; // No need to clone, we've pulled it from the list basePath.newPos++; self.pushComponent(basePath.components, true, undefined); } _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) { return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken)); } else { // Otherwise track this path as a potential candidate and continue. bestPath[diagonalPath] = basePath; } } editLength++; } // Performs the length of edit iteration. Is a bit fugly as this has to support the // sync and async mode which is never fun. Loops over execEditLength until a value // is produced, or until the edit length exceeds options.maxEditLength (if given), // in which case it will return undefined. if (callback) { (function exec() { setTimeout(function () { if (editLength > maxEditLength) { return callback(); } if (!execEditLength()) { exec(); } }, 0); })(); } else { while (editLength <= maxEditLength) { var ret = execEditLength(); if (ret) { return ret; } } } }, pushComponent: function pushComponent(components, added, removed) { var last = components[components.length - 1]; if (last && last.added === added && last.removed === removed) { // We need to clone here as the component clone operation is just // as shallow array clone components[components.length - 1] = { count: last.count + 1, added: added, removed: removed }; } else { components.push({ count: 1, added: added, removed: removed }); } }, extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) { var newLen = newString.length, oldLen = oldString.length, newPos = basePath.newPos, oldPos = newPos - diagonalPath, commonCount = 0; while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) { newPos++; oldPos++; commonCount++; } if (commonCount) { basePath.components.push({ count: commonCount }); } basePath.newPos = newPos; return oldPos; }, equals: function equals(left, right) { if (this.options.comparator) { return this.options.comparator(left, right); } else { return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase(); } }, removeEmpty: function removeEmpty(array) { var ret = []; for (var i = 0; i < array.length; i++) { if (array[i]) { ret.push(array[i]); } } return ret; }, castInput: function castInput(value) { return value; }, tokenize: function tokenize(value) { return value.split(''); }, join: function join(chars) { return chars.join(''); } }; function buildValues(diff, components, newString, oldString, useLongestToken) { var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0; for (; componentPos < componentLen; componentPos++) { var component = components[componentPos]; if (!component.removed) { if (!component.added && useLongestToken) { var value = newString.slice(newPos, newPos + component.count); value = value.map(function (value, i) { var oldValue = oldString[oldPos + i]; return oldValue.length > value.length ? oldValue : value; }); component.value = diff.join(value); } else { component.value = diff.join(newString.slice(newPos, newPos + component.count)); } newPos += component.count; // Common case if (!component.added) { oldPos += component.count; } } else { component.value = diff.join(oldString.slice(oldPos, oldPos + component.count)); oldPos += component.count; // Reverse add and remove so removes are output first to match common convention // The diffing algorithm is tied to add then remove output and this is the simplest // route to get the desired output with minimal overhead. if (componentPos && components[componentPos - 1].added) { var tmp = components[componentPos - 1]; components[componentPos - 1] = components[componentPos]; components[componentPos] = tmp; } } } // Special case handle for when one terminal is ignored (i.e. whitespace). // For this case we merge the terminal into the prior string and drop the change. // This is only available for string mode. var lastComponent = components[componentLen - 1]; if (componentLen > 1 && typeof lastComponent.value === 'string' && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) { components[componentLen - 2].value += lastComponent.value; components.pop(); } return components; } function clonePath(path) { return { newPos: path.newPos, components: path.components.slice(0) }; } var characterDiff = new Diff(); function diffChars(oldStr, newStr, options) { return characterDiff.diff(oldStr, newStr, options); } function generateOptions(options, defaults) { if (typeof options === 'function') { defaults.callback = options; } else if (options) { for (var name in options) { /* istanbul ignore else */ if (options.hasOwnProperty(name)) { defaults[name] = options[name]; } } } return defaults; } // // Ranges and exceptions: // Latin-1 Supplement, 0080–00FF // - U+00D7 × Multiplication sign // - U+00F7 ÷ Division sign // Latin Extended-A, 0100–017F // Latin Extended-B, 0180–024F // IPA Extensions, 0250–02AF // Spacing Modifier Letters, 02B0–02FF // - U+02C7 ˇ ˇ Caron // - U+02D8 ˘ ˘ Breve // - U+02D9 ˙ ˙ Dot Above // - U+02DA ˚ ˚ Ring Above // - U+02DB ˛ ˛ Ogonek // - U+02DC ˜ ˜ Small Tilde // - U+02DD ˝ ˝ Double Acute Accent // Latin Extended Additional, 1E00–1EFF var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/; var reWhitespace = /\S/; var wordDiff = new Diff(); wordDiff.equals = function (left, right) { if (this.options.ignoreCase) { left = left.toLowerCase(); right = right.toLowerCase(); } return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right); }; wordDiff.tokenize = function (value) { // All whitespace symbols except newline group into one token, each newline - in separate token var tokens = value.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/); // Join the boundary splits that we do not consider to be boundaries. This is primarily the extended Latin character set. for (var i = 0; i < tokens.length - 1; i++) { // If we have an empty string in the next field and we have only word chars before and after, merge if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) { tokens[i] += tokens[i + 2]; tokens.splice(i + 1, 2); i--; } } return tokens; }; function diffWords(oldStr, newStr, options) { options = generateOptions(options, { ignoreWhitespace: true }); return wordDiff.diff(oldStr, newStr, options); } function diffWordsWithSpace(oldStr, newStr, options) { return wordDiff.diff(oldStr, newStr, options); } var lineDiff = new Diff(); lineDiff.tokenize = function (value) { var retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/); // Ignore the final empty token that occurs if the string ends with a new line if (!linesAndNewlines[linesAndNewlines.length - 1]) { linesAndNewlines.pop(); } // Merge the content and line separators into single tokens for (var i = 0; i < linesAndNewlines.length; i++) { var line = linesAndNewlines[i]; if (i % 2 && !this.options.newlineIsToken) { retLines[retLines.length - 1] += line; } else { if (this.options.ignoreWhitespace) { line = line.trim(); } retLines.push(line); } } return retLines; }; function diffLines(oldStr, newStr, callback) { return lineDiff.diff(oldStr, newStr, callback); } function diffTrimmedLines(oldStr, newStr, callback) { var options = generateOptions(callback, { ignoreWhitespace: true }); return lineDiff.diff(oldStr, newStr, options); } var sentenceDiff = new Diff(); sentenceDiff.tokenize = function (value) { return value.split(/(\S.+?[.!?])(?=\s+|$)/); }; function diffSentences(oldStr, newStr, callback) { return sentenceDiff.diff(oldStr, newStr, callback); } var cssDiff = new Diff(); cssDiff.tokenize = function (value) { return value.split(/([{}:;,]|\s+)/); }; function diffCss(oldStr, newStr, callback) { return cssDiff.diff(oldStr, newStr, callback); } function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function (obj) { return typeof obj; }; } else { _typeof = function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var objectPrototypeToString = Object.prototype.toString; var jsonDiff = new Diff(); // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a // dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output: jsonDiff.useLongestToken = true; jsonDiff.tokenize = lineDiff.tokenize; jsonDiff.castInput = function (value) { var _this$options = this.options, undefinedReplacement = _this$options.undefinedReplacement, _this$options$stringi = _this$options.stringifyReplacer, stringifyReplacer = _this$options$stringi === void 0 ? function (k, v) { return typeof v === 'undefined' ? undefinedReplacement : v; } : _this$options$stringi; return typeof value === 'string' ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, ' '); }; jsonDiff.equals = function (left, right) { return Diff.prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1')); }; function diffJson(oldObj, newObj, options) { return jsonDiff.diff(oldObj, newObj, options); } // This function handles the presence of circular references by bailing out when encountering an // object that is already on the "stack" of items being processed. Accepts an optional replacer function canonicalize(obj, stack, replacementStack, replacer, key) { stack = stack || []; replacementStack = replacementStack || []; if (replacer) { obj = replacer(key, obj); } var i; for (i = 0; i < stack.length; i += 1) { if (stack[i] === obj) { return replacementStack[i]; } } var canonicalizedObj; if ('[object Array]' === objectPrototypeToString.call(obj)) { stack.push(obj); canonicalizedObj = new Array(obj.length); replacementStack.push(canonicalizedObj); for (i = 0; i < obj.length; i += 1) { canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key); } stack.pop(); replacementStack.pop(); return canonicalizedObj; } if (obj && obj.toJSON) { obj = obj.toJSON(); } if (_typeof(obj) === 'object' && obj !== null) { stack.push(obj); canonicalizedObj = {}; replacementStack.push(canonicalizedObj); var sortedKeys = [], _key; for (_key in obj) { /* istanbul ignore else */ if (obj.hasOwnProperty(_key)) { sortedKeys.push(_key); } } sortedKeys.sort(); for (i = 0; i < sortedKeys.length; i += 1) { _key = sortedKeys[i]; canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key); } stack.pop(); replacementStack.pop(); } else { canonicalizedObj = obj; } return canonicalizedObj; } var arrayDiff = new Diff(); arrayDiff.tokenize = function (value) { return value.slice(); }; arrayDiff.join = arrayDiff.removeEmpty = function (value) { return value; }; function diffArrays(oldArr, newArr, callback) { return arrayDiff.diff(oldArr, newArr, callback); } function parsePatch(uniDiff) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var diffstr = uniDiff.split(/\r\n|[\n\v\f\r\x85]/), delimiters = uniDiff.match(/\r\n|[\n\v\f\r\x85]/g) || [], list = [], i = 0; function parseIndex() { var index = {}; list.push(index); // Parse diff metadata while (i < diffstr.length) { var line = diffstr[i]; // File header found, end parsing diff metadata if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) { break; } // Diff index var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line); if (header) { index.index = header[1]; } i++; } // Parse file headers if they are defined. Unified diff requires them, but // there's no technical issues to have an isolated hunk without file header parseFileHeader(index); parseFileHeader(index); // Parse hunks index.hunks = []; while (i < diffstr.length) { var _line = diffstr[i]; if (/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(_line)) { break; } else if (/^@@/.test(_line)) { index.hunks.push(parseHunk()); } else if (_line && options.strict) { // Ignore unexpected content unless in strict mode throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line)); } else { i++; } } } // Parses the --- and +++ headers, if none are found, no lines // are consumed. function parseFileHeader(index) { var fileHeader = /^(---|\+\+\+)\s+(.*)$/.exec(diffstr[i]); if (fileHeader) { var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new'; var data = fileHeader[2].split('\t', 2); var fileName = data[0].replace(/\\\\/g, '\\'); if (/^".*"$/.test(fileName)) { fileName = fileName.substr(1, fileName.length - 2); } index[keyPrefix + 'FileName'] = fileName; index[keyPrefix + 'Header'] = (data[1] || '').trim(); i++; } } // Parses a hunk // This assumes that we are at the start of a hunk. function parseHunk() { var chunkHeaderIndex = i, chunkHeaderLine = diffstr[i++], chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/); var hunk = { oldStart: +chunkHeader[1], oldLines: typeof chunkHeader[2] === 'undefined' ? 1 : +chunkHeader[2], newStart: +chunkHeader[3], newLines: typeof chunkHeader[4] === 'undefined' ? 1 : +chunkHeader[4], lines: [], linedelimiters: [] }; // Unified Diff Format quirk: If the chunk size is 0, // the first number is one lower than one would expect. // https://www.artima.com/weblogs/viewpost.jsp?thread=164293 if (hunk.oldLines === 0) { hunk.oldStart += 1; } if (hunk.newLines === 0) { hunk.newStart += 1; } var addCount = 0, removeCount = 0; for (; i < diffstr.length; i++) { // Lines starting with '---' could be mistaken for the "remove line" operation // But they could be the header for the next file. Therefore prune such cases out. if (diffstr[i].indexOf('--- ') === 0 && i + 2 < diffstr.length && diffstr[i + 1].indexOf('+++ ') === 0 && diffstr[i + 2].indexOf('@@') === 0) { break; } var operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? ' ' : diffstr[i][0]; if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') { hunk.lines.push(diffstr[i]); hunk.linedelimiters.push(delimiters[i] || '\n'); if (operation === '+') { addCount++; } else if (operation === '-') { removeCount++; } else if (operation === ' ') { addCount++; removeCount++; } } else { break; } } // Handle the empty block count case if (!addCount && hunk.newLines === 1) { hunk.newLines = 0; } if (!removeCount && hunk.oldLines === 1) { hunk.oldLines = 0; } // Perform optional sanity checking if (options.strict) { if (addCount !== hunk.newLines) { throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); } if (removeCount !== hunk.oldLines) { throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); } } return hunk; } while (i < diffstr.length) { parseIndex(); } return list; } // Iterator that traverses in the range of [min, max], stepping // by distance from a given start position. I.e. for [0, 4], with // start of 2, this will iterate 2, 3, 1, 4, 0. function distanceIterator (start, minLine, maxLine) { var wantForward = true, backwardExhausted = false, forwardExhausted = false, localOffset = 1; return function iterator() { if (wantForward && !forwardExhausted) { if (backwardExhausted) { localOffset++; } else { wantForward = false; } // Check if trying to fit beyond text length, and if not, check it fits // after offset location (or desired location on first iteration) if (start + localOffset <= maxLine) { return localOffset; } forwardExhausted = true; } if (!backwardExhausted) { if (!forwardExhausted) { wantForward = true; } // Check if trying to fit before text beginning, and if not, check it fits // before offset location if (minLine <= start - localOffset) { return -localOffset++; } backwardExhausted = true; return iterator(); } // We tried to fit hunk before text beginning and beyond text length, then // hunk can't fit on the text. Return undefined }; } function applyPatch(source, uniDiff) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; if (typeof uniDiff === 'string') { uniDiff = parsePatch(uniDiff); } if (Array.isArray(uniDiff)) { if (uniDiff.length > 1) { throw new Error('applyPatch only works with a single input.'); } uniDiff = uniDiff[0]; } // Apply the diff to the input var lines = source.split(/\r\n|[\n\v\f\r\x85]/), delimiters = source.match(/\r\n|[\n\v\f\r\x85]/g) || [], hunks = uniDiff.hunks, compareLine = options.compareLine || function (lineNumber, line, operation, patchContent) { return line === patchContent; }, errorCount = 0, fuzzFactor = options.fuzzFactor || 0, minLine = 0, offset = 0, removeEOFNL, addEOFNL; /** * Checks if the hunk exactly fits on the provided location */ function hunkFits(hunk, toPos) { for (var j = 0; j < hunk.lines.length; j++) { var line = hunk.lines[j], operation = line.length > 0 ? line[0] : ' ', content = line.length > 0 ? line.substr(1) : line; if (operation === ' ' || operation === '-') { // Context sanity check if (!compareLine(toPos + 1, lines[toPos], operation, content)) { errorCount++; if (errorCount > fuzzFactor) { return false; } } toPos++; } } return true; } // Search best fit offsets for each hunk based on the previous ones for (var i = 0; i < hunks.length; i++) { var hunk = hunks[i], maxLine = lines.length - hunk.oldLines, localOffset = 0, toPos = offset + hunk.oldStart - 1; var iterator = distanceIterator(toPos, minLine, maxLine); for (; localOffset !== undefined; localOffset = iterator()) { if (hunkFits(hunk, toPos + localOffset)) { hunk.offset = offset += localOffset; break; } } if (localOffset === undefined) { return false; } // Set lower text limit to end of the current hunk, so next ones don't try // to fit over already patched text minLine = hunk.offset + hunk.oldStart + hunk.oldLines; } // Apply patch hunks var diffOffset = 0; for (var _i = 0; _i < hunks.length; _i++) { var _hunk = hunks[_i], _toPos = _hunk.oldStart + _hunk.offset + diffOffset - 1; diffOffset += _hunk.newLines - _hunk.oldLines; for (var j = 0; j < _hunk.lines.length; j++) { var line = _hunk.lines[j], operation = line.length > 0 ? line[0] : ' ', content = line.length > 0 ? line.substr(1) : line, delimiter = _hunk.linedelimiters[j]; if (operation === ' ') { _toPos++; } else if (operation === '-') { lines.splice(_toPos, 1); delimiters.splice(_toPos, 1); /* istanbul ignore else */ } else if (operation === '+') { lines.splice(_toPos, 0, content); delimiters.splice(_toPos, 0, delimiter); _toPos++; } else if (operation === '\\') { var previousOperation = _hunk.lines[j - 1] ? _hunk.lines[j - 1][0] : null; if (previousOperation === '+') { removeEOFNL = true; } else if (previousOperation === '-') { addEOFNL = true; } } } } // Handle EOFNL insertion/removal if (removeEOFNL) { while (!lines[lines.length - 1]) { lines.pop(); delimiters.pop(); } } else if (addEOFNL) { lines.push(''); delimiters.push('\n'); } for (var _k = 0; _k < lines.length - 1; _k++) { lines[_k] = lines[_k] + delimiters[_k]; } return lines.join(''); } // Wrapper that supports multiple file patches via callbacks. function applyPatches(uniDiff, options) { if (typeof uniDiff === 'string') { uniDiff = parsePatch(uniDiff); } var currentIndex = 0; function processIndex() { var index = uniDiff[currentIndex++]; if (!index) { return options.complete(); } options.loadFile(index, function (err, data) { if (err) { return options.complete(err); } var updatedContent = applyPatch(data, index, options); options.patched(index, updatedContent, function (err) { if (err) { return options.complete(err); } processIndex(); }); }); } processIndex(); } function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { if (!options) { options = {}; } if (typeof options.context === 'undefined') { options.context = 4; } var diff = diffLines(oldStr, newStr, options); if (!diff) { return; } diff.push({ value: '', lines: [] }); // Append an empty value to make cleanup easier function contextLines(lines) { return lines.map(function (entry) { return ' ' + entry; }); } var hunks = []; var oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1; var _loop = function _loop(i) { var current = diff[i], lines = current.lines || current.value.replace(/\n$/, '').split('\n'); current.lines = lines; if (current.added || current.removed) { var _curRange; // If we have previous context, start with that if (!oldRangeStart) { var prev = diff[i - 1]; oldRangeStart = oldLine; newRangeStart = newLine; if (prev) { curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : []; oldRangeStart -= curRange.length; newRangeStart -= curRange.length; } } // Output our changes (_curRange = curRange).push.apply(_curRange, _toConsumableArray(lines.map(function (entry) { return (current.added ? '+' : '-') + entry; }))); // Track the updated file position if (current.added) { newLine += lines.length; } else { oldLine += lines.length; } } else { // Identical context lines. Track line changes if (oldRangeStart) { // Close out any changes that have been output (or join overlapping) if (lines.length <= options.context * 2 && i < diff.length - 2) { var _curRange2; // Overlapping (_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines))); } else { var _curRange3; // end the range and output var contextSize = Math.min(lines.length, options.context); (_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray(contextLines(lines.slice(0, contextSize)))); var hunk = { oldStart: oldRangeStart, oldLines: oldLine - oldRangeStart + contextSize, newStart: newRangeStart, newLines: newLine - newRangeStart + contextSize, lines: curRange }; if (i >= diff.length - 2 && lines.length <= options.context) { // EOF is inside this hunk var oldEOFNewline = /\n$/.test(oldStr); var newEOFNewline = /\n$/.test(newStr); var noNlBeforeAdds = lines.length == 0 && curRange.length > hunk.oldLines; if (!oldEOFNewline && noNlBeforeAdds && oldStr.length > 0) { // special case: old has no eol and no trailing context; no-nl can end up before adds // however, if the old file is empty, do not output the no-nl line curRange.splice(hunk.oldLines, 0, '\\ No newline at end of file'); } if (!oldEOFNewline && !noNlBeforeAdds || !newEOFNewline) { curRange.push('\\ No newline at end of file'); } } hunks.push(hunk); oldRangeStart = 0; newRangeStart = 0; curRange = []; } } oldLine += lines.length; newLine += lines.length; } }; for (var i = 0; i < diff.length; i++) { _loop(i); } return { oldFileName: oldFileName, newFileName: newFileName, oldHeader: oldHeader, newHeader: newHeader, hunks: hunks }; } function formatPatch(diff) { var ret = []; if (diff.oldFileName == diff.newFileName) { ret.push('Index: ' + diff.oldFileName); } ret.push('==================================================================='); ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\t' + diff.oldHeader)); ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader)); for (var i = 0; i < diff.hunks.length; i++) { var hunk = diff.hunks[i]; // Unified Diff Format quirk: If the chunk size is 0, // the first number is one lower than one would expect. // https://www.artima.com/weblogs/viewpost.jsp?thread=164293 if (hunk.oldLines === 0) { hunk.oldStart -= 1; } if (hunk.newLines === 0) { hunk.newStart -= 1; } ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@'); ret.push.apply(ret, hunk.lines); } return ret.join('\n') + '\n'; } function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { return formatPatch(structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options)); } function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) { return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options); } function arrayEqual(a, b) { if (a.length !== b.length) { return false; } return arrayStartsWith(a, b); } function arrayStartsWith(array, start) { if (start.length > array.length) { return false; } for (var i = 0; i < start.length; i++) { if (start[i] !== array[i]) { return false; } } return true; } function calcLineCount(hunk) { var _calcOldNewLineCount = calcOldNewLineCount(hunk.lines), oldLines = _calcOldNewLineCount.oldLines, newLines = _calcOldNewLineCount.newLines; if (oldLines !== undefined) { hunk.oldLines = oldLines; } else { delete hunk.oldLines; } if (newLines !== undefined) { hunk.newLines = newLines; } else { delete hunk.newLines; } } function merge(mine, theirs, base) { mine = loadPatch(mine, base); theirs = loadPatch(theirs, base); var ret = {}; // For index we just let it pass through as it doesn't have any necessary meaning. // Leaving sanity checks on this to the API consumer that may know more about the // meaning in their own context. if (mine.index || theirs.index) { ret.index = mine.index || theirs.index; } if (mine.newFileName || theirs.newFileName) { if (!fileNameChanged(mine)) { // No header or no change in ours, use theirs (and ours if theirs does not exist) ret.oldFileName = theirs.oldFileName || mine.oldFileName; ret.newFileName = theirs.newFileName || mine.newFileName; ret.oldHeader = theirs.oldHeader || mine.oldHeader; ret.newHeader = theirs.newHeader || mine.newHeader; } else if (!fileNameChanged(theirs)) { // No header or no change in theirs, use ours ret.oldFileName = mine.oldFileName; ret.newFileName = mine.newFileName; ret.oldHeader = mine.oldHeader; ret.newHeader = mine.newHeader; } else { // Both changed... figure it out ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName); ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName); ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader); ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader); } } ret.hunks = []; var mineIndex = 0, theirsIndex = 0, mineOffset = 0, theirsOffset = 0; while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) { var mineCurrent = mine.hunks[mineIndex] || { oldStart: Infinity }, theirsCurrent = theirs.hunks[theirsIndex] || { oldStart: Infinity }; if (hunkBefore(mineCurrent, theirsCurrent)) { // This patch does not overlap with any of the others, yay. ret.hunks.push(cloneHunk(mineCurrent, mineOffset)); mineIndex++; theirsOffset += mineCurrent.newLines - mineCurrent.oldLines; } else if (hunkBefore(theirsCurrent, mineCurrent)) { // This patch does not overlap with any of the others, yay. ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset)); theirsIndex++; mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines; } else { // Overlap, merge as best we can var mergedHunk = { oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart), oldLines: 0, newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset), newLines: 0, lines: [] }; mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines); theirsIndex++; mineIndex++; ret.hunks.push(mergedHunk); } } return ret; } function loadPatch(param, base) { if (typeof param === 'string') { if (/^@@/m.test(param) || /^Index:/m.test(param)) { return parsePatch(param)[0]; } if (!base) { throw new Error('Must provide a base reference or pass in a patch'); } return structuredPatch(undefined, undefined, base, param); } return param; } function fileNameChanged(patch) { return patch.newFileName && patch.newFileName !== patch.oldFileName; } function selectField(index, mine, theirs) { if (mine === theirs) { return mine; } else { index.conflict = true; return { mine: mine, theirs: theirs }; } } function hunkBefore(test, check) { return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart; } function cloneHunk(hunk, offset) { return { oldStart: hunk.oldStart, oldLines: hunk.oldLines, newStart: hunk.newStart + offset, newLines: hunk.newLines, lines: hunk.lines }; } function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) { // This will generally result in a conflicted hunk, but there are cases where the context // is the only overlap where we can successfully merge the content here. var mine = { offset: mineOffset, lines: mineLines, index: 0 }, their = { offset: theirOffset, lines: theirLines, index: 0 }; // Handle any leading content insertLeading(hunk, mine, their); insertLeading(hunk, their, mine); // Now in the overlap content. Scan through and select the best changes from each. while (mine.index < mine.lines.length && their.index < their.lines.length) { var mineCurrent = mine.lines[mine.index], theirCurrent = their.lines[their.index]; if ((mineCurrent[0] === '-' || mineCurrent[0] === '+') && (theirCurrent[0] === '-' || theirCurrent[0] === '+')) { // Both modified ... mutualChange(hunk, mine, their); } else if (mineCurrent[0] === '+' && theirCurrent[0] === ' ') { var _hunk$lines; // Mine inserted (_hunk$lines = hunk.lines).push.apply(_hunk$lines, _toConsumableArray(collectChange(mine))); } else if (theirCurrent[0] === '+' && mineCurrent[0] === ' ') { var _hunk$lines2; // Theirs inserted (_hunk$lines2 = hunk.lines).push.apply(_hunk$lines2, _toConsumableArray(collectChange(their))); } else if (mineCurrent[0] === '-' && theirCurrent[0] === ' ') { // Mine removed or edited removal(hunk, mine, their); } else if (theirCurrent[0] === '-' && mineCurrent[0] === ' ') { // Their removed or edited removal(hunk, their, mine, true); } else if (mineCurrent === theirCurrent) { // Context identity hunk.lines.push(mineCurrent); mine.index++; their.index++; } else { // Context mismatch conflict(hunk, collectChange(mine), collectChange(their)); } } // Now push anything that may be remaining insertTrailing(hunk, mine); insertTrailing(hunk, their); calcLineCount(hunk); } function mutualChange(hunk, mine, their) { var myChanges = collectChange(mine), theirChanges = collectChange(their); if (allRemoves(myChanges) && allRemoves(theirChanges)) { // Special case for remove changes that are supersets of one another if (arrayStartsWith(myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) { var _hunk$lines3; (_hunk$lines3 = hunk.lines).push.apply(_hunk$lines3, _toConsumableArray(myChanges)); return; } else if (arrayStartsWith(theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) { var _hunk$lines4; (_hunk$lines4 = hunk.lines).push.apply(_hunk$lines4, _toConsumableArray(theirChanges)); return; } } else if (arrayEqual(myChanges, theirChanges)) { var _hunk$lines5; (_hunk$lines5 = hunk.lines).push.apply(_hunk$lines5, _toConsumableArray(myChanges)); return; } conflict(hunk, myChanges, theirChanges); } function removal(hunk, mine, their, swap) { var myChanges = collectChange(mine), theirChanges = collectContext(their, myChanges); if (theirChanges.merged) { var _hunk$lines6; (_hunk$lines6 = hunk.lines).push.apply(_hunk$lines6, _toConsumableArray(theirChanges.merged)); } else { conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges); } } function conflict(hunk, mine, their) { hunk.conflict = true; hunk.lines.push({ conflict: true, mine: mine, theirs: their }); } function insertLeading(hunk, insert, their) { while (insert.offset < their.offset && insert.index < insert.lines.length) { var line = insert.lines[insert.index++]; hunk.lines.push(line); insert.offset++; } } function insertTrailing(hunk, insert) { while (insert.index < insert.lines.length) { var line = insert.lines[insert.index++]; hunk.lines.push(line); } } function collectChange(state) { var ret = [], operation = state.lines[state.index][0]; while (state.index < state.lines.length) { var line = state.lines[state.index]; // Group additions that are immediately after subtractions and treat them as one "atomic" modify change. if (operation === '-' && line[0] === '+') { operation = '+'; } if (operation === line[0]) { ret.push(line); state.index++; } else { break; } } return ret; } function collectContext(state, matchChanges) { var changes = [], merged = [], matchIndex = 0, contextChanges = false, conflicted = false; while (matchIndex < matchChanges.length && state.index < state.lines.length) { var change = state.lines[state.index], match = matchChanges[matchIndex]; // Once we've hit our add, then we are done if (match[0] === '+') { break; } contextChanges = contextChanges || change[0] !== ' '; merged.push(match); matchIndex++; // Consume any additions in the other block as a conflict to attempt // to pull in the remaining context after this if (change[0] === '+') { conflicted = true; while (change[0] === '+') { changes.push(change); change = state.lines[++state.index]; } } if (match.substr(1) === change.substr(1)) { changes.push(change); state.index++; } else { conflicted = true; } } if ((matchChanges[matchIndex] || '')[0] === '+' && contextChanges) { conflicted = true; } if (conflicted) { return changes; } while (matchIndex < matchChanges.length) { merged.push(matchChanges[matchIndex++]); } return { merged: merged, changes: changes }; } function allRemoves(changes) { return changes.reduce(function (prev, change) { return prev && change[0] === '-'; }, true); } function skipRemoveSuperset(state, removeChanges, delta) { for (var i = 0; i < delta; i++) { var changeContent = removeChanges[removeChanges.length - delta + i].substr(1); if (state.lines[state.index + i] !== ' ' + changeContent) { return false; } } state.index += delta; return true; } function calcOldNewLineCount(lines) { var oldLines = 0; var newLines = 0; lines.forEach(function (line) { if (typeof line !== 'string') { var myCount = calcOldNewLineCount(line.mine); var theirCount = calcOldNewLineCount(line.theirs); if (oldLines !== undefined) { if (myCount.oldLines === theirCount.oldLines) { oldLines += myCount.oldLines; } else { oldLines = undefined; } } if (newLines !== undefined) { if (myCount.newLines === theirCount.newLines) { newLines += myCount.newLines; } else { newLines = undefined; } } } else { if (newLines !== undefined && (line[0] === '+' || line[0] === ' ')) { newLines++; } if (oldLines !== undefined && (line[0] === '-' || line[0] === ' ')) { oldLines++; } } }); return { oldLines: oldLines, newLines: newLines }; } // See: http://code.google.com/p/google-diff-match-patch/wiki/API function convertChangesToDMP(changes) { var ret = [], change, operation; for (var i = 0; i < changes.length; i++) { change = changes[i]; if (change.added) { operation = 1; } else if (change.removed) { operation = -1; } else { operation = 0; } ret.push([operation, change.value]); } return ret; } function convertChangesToXML(changes) { var ret = []; for (var i = 0; i < changes.length; i++) { var change = changes[i]; if (change.added) { ret.push('<ins>'); } else if (change.removed) { ret.push('<del>'); } ret.push(escapeHTML(change.value)); if (change.added) { ret.push('</ins>'); } else if (change.removed) { ret.push('</del>'); } } return ret.join(''); } function escapeHTML(s) { var n = s; n = n.replace(/&/g, '&'); n = n.replace(/</g, '<'); n = n.replace(/>/g, '>'); n = n.replace(/"/g, '"'); return n; } /***/ }), /***/ "../node_modules/hast-util-whitespace/index.js": /*!*****************************************************!*\ !*** ../node_modules/hast-util-whitespace/index.js ***! \*****************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "whitespace": () => (/* binding */ whitespace) /* harmony export */ }); /** * Check if the given value is *inter-element whitespace*. * * @param {unknown} thing * Thing to check (typically `Node` or `string`). * @returns {boolean} * Whether the `value` is inter-element whitespace (`boolean`): consisting of * zero or more of space, tab (`\t`), line feed (`\n`), carriage return * (`\r`), or form feed (`\f`). * If a node is passed it must be a `Text` node, whose `value` field is * checked. */ function whitespace(thing) { /** @type {string} */ const value = // @ts-expect-error looks like a node. thing && typeof thing === 'object' && thing.type === 'text' ? // @ts-expect-error looks like a text. thing.value || '' : thing // HTML whitespace expression. // See <https://infra.spec.whatwg.org/#ascii-whitespace>. return typeof value === 'string' && value.replace(/[ \t\n\f\r]/g, '') === '' } /***/ }), /***/ "../node_modules/is-plain-obj/index.js": /*!*********************************************!*\ !*** ../node_modules/is-plain-obj/index.js ***! \*********************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ isPlainObject) /* harmony export */ }); function isPlainObject(value) { if (typeof value !== 'object' || value === null) { return false; } const prototype = Object.getPrototypeOf(value); return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value); } /***/ }), /***/ "../node_modules/mdast-util-definitions/lib/index.js": /*!***********************************************************!*\ !*** ../node_modules/mdast-util-definitions/lib/index.js ***! \***********************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "definitions": () => (/* binding */ definitions) /* harmony export */ }); /* harmony import */ var unist_util_visit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! unist-util-visit */ "../node_modules/unist-util-visit/lib/index.js"); /** * @typedef {import('mdast').Root} Root * @typedef {import('mdast').Content} Content * @typedef {import('mdast').Definition} Definition */ /** * @typedef {Root | Content} Node * * @callback GetDefinition * Get a definition by identifier. * @param {string | null | undefined} [identifier] * Identifier of definition. * @returns {Definition | null} * Definition corresponding to `identifier` or `null`. */ const own = {}.hasOwnProperty /** * Find definitions in `tree`. * * Uses CommonMark precedence, which means that earlier definitions are * preferred over duplicate later definitions. * * @param {Node} tree * Tree to check. * @returns {GetDefinition} * Getter. */ function definitions(tree) { /** @type {Record<string, Definition>} */ const cache = Object.create(null) if (!tree || !tree.type) { throw new Error('mdast-util-definitions expected node') } (0,unist_util_visit__WEBPACK_IMPORTED_MODULE_0__.visit)(tree, 'definition', (definition) => { const id = clean(definition.identifier) if (id && !own.call(cache, id)) { cache[id] = definition } }) return definition /** @type {GetDefinition} */ function definition(identifier) { const id = clean(identifier) // To do: next major: return `undefined` when not found. return id && own.call(cache, id) ? cache[id] : null } } /** * @param {string | null | undefined} [value] * @returns {string} */ function clean(value) { return String(value || '').toUpperCase() } /***/ }), /***/ "../node_modules/mdast-util-from-markdown/dev/lib/index.js": /*!*****************************************************************!*\ !*** ../node_modules/mdast-util-from-markdown/dev/lib/index.js ***! \*****************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "fromMarkdown": () => (/* binding */ fromMarkdown) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var mdast_util_to_string__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! mdast-util-to-string */ "../node_modules/mdast-util-to-string/lib/index.js"); /* harmony import */ var micromark_lib_parse_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark/lib/parse.js */ "../node_modules/micromark/dev/lib/parse.js"); /* harmony import */ var micromark_lib_preprocess_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark/lib/preprocess.js */ "../node_modules/micromark/dev/lib/preprocess.js"); /* harmony import */ var micromark_lib_postprocess_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark/lib/postprocess.js */ "../node_modules/micromark/dev/lib/postprocess.js"); /* harmony import */ var micromark_util_decode_numeric_character_reference__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! micromark-util-decode-numeric-character-reference */ "../node_modules/micromark-util-decode-numeric-character-reference/dev/index.js"); /* harmony import */ var micromark_util_decode_string__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! micromark-util-decode-string */ "../node_modules/micromark-util-decode-string/dev/index.js"); /* harmony import */ var micromark_util_normalize_identifier__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! micromark-util-normalize-identifier */ "../node_modules/micromark-util-normalize-identifier/dev/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /* harmony import */ var decode_named_character_reference__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! decode-named-character-reference */ "../node_modules/decode-named-character-reference/index.dom.js"); /* harmony import */ var unist_util_stringify_position__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! unist-util-stringify-position */ "../node_modules/unist-util-stringify-position/lib/index.js"); /** * @typedef {import('micromark-util-types').Encoding} Encoding * @typedef {import('micromark-util-types').Event} Event * @typedef {import('micromark-util-types').ParseOptions} ParseOptions * @typedef {import('micromark-util-types').Token} Token * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext * @typedef {import('micromark-util-types').Value} Value * * @typedef {import('unist').Parent} UnistParent * @typedef {import('unist').Point} Point * * @typedef {import('mdast').PhrasingContent} PhrasingContent * @typedef {import('mdast').StaticPhrasingContent} StaticPhrasingContent * @typedef {import('mdast').Content} Content * @typedef {import('mdast').Break} Break * @typedef {import('mdast').Blockquote} Blockquote * @typedef {import('mdast').Code} Code * @typedef {import('mdast').Definition} Definition * @typedef {import('mdast').Emphasis} Emphasis * @typedef {import('mdast').Heading} Heading * @typedef {import('mdast').HTML} HTML * @typedef {import('mdast').Image} Image * @typedef {import('mdast').ImageReference} ImageReference * @typedef {import('mdast').InlineCode} InlineCode * @typedef {import('mdast').Link} Link * @typedef {import('mdast').LinkReference} LinkReference * @typedef {import('mdast').List} List * @typedef {import('mdast').ListItem} ListItem * @typedef {import('mdast').Paragraph} Paragraph * @typedef {import('mdast').Root} Root * @typedef {import('mdast').Strong} Strong * @typedef {import('mdast').Text} Text * @typedef {import('mdast').ThematicBreak} ThematicBreak * @typedef {import('mdast').ReferenceType} ReferenceType * @typedef {import('../index.js').CompileData} CompileData */ /** * @typedef {Root | Content} Node * @typedef {Extract<Node, UnistParent>} Parent * * @typedef {Omit<UnistParent, 'type' | 'children'> & {type: 'fragment', children: Array<PhrasingContent>}} Fragment */ /** * @callback Transform * Extra transform, to change the AST afterwards. * @param {Root} tree * Tree to transform. * @returns {Root | undefined | null | void} * New tree or nothing (in which case the current tree is used). * * @callback Handle * Handle a token. * @param {CompileContext} this * Context. * @param {Token} token * Current token. * @returns {void} * Nothing. * * @typedef {Record<string, Handle>} Handles * Token types mapping to handles * * @callback OnEnterError * Handle the case where the `right` token is open, but it is closed (by the * `left` token) or because we reached the end of the document. * @param {Omit<CompileContext, 'sliceSerialize'>} this * Context. * @param {Token | undefined} left * Left token. * @param {Token} right * Right token. * @returns {void} * Nothing. * * @callback OnExitError * Handle the case where the `right` token is open but it is closed by * exiting the `left` token. * @param {Omit<CompileContext, 'sliceSerialize'>} this * Context. * @param {Token} left * Left token. * @param {Token} right * Right token. * @returns {void} * Nothing. * * @typedef {[Token, OnEnterError | undefined]} TokenTuple * Open token on the stack, with an optional error handler for when * that token isn’t closed properly. */ /** * @typedef Config * Configuration. * * We have our defaults, but extensions will add more. * @property {Array<string>} canContainEols * Token types where line endings are used. * @property {Handles} enter * Opening handles. * @property {Handles} exit * Closing handles. * @property {Array<Transform>} transforms * Tree transforms. * * @typedef {Partial<Config>} Extension * Change how markdown tokens from micromark are turned into mdast. * * @typedef CompileContext * mdast compiler context. * @property {Array<Node | Fragment>} stack * Stack of nodes. * @property {Array<TokenTuple>} tokenStack * Stack of tokens. * @property {<Key extends keyof CompileData>(key: Key) => CompileData[Key]} getData * Get data from the key/value store. * @property {<Key extends keyof CompileData>(key: Key, value?: CompileData[Key]) => void} setData * Set data into the key/value store. * @property {(this: CompileContext) => void} buffer * Capture some of the output data. * @property {(this: CompileContext) => string} resume * Stop capturing and access the output data. * @property {<Kind extends Node>(this: CompileContext, node: Kind, token: Token, onError?: OnEnterError) => Kind} enter * Enter a token. * @property {(this: CompileContext, token: Token, onError?: OnExitError) => Node} exit * Exit a token. * @property {TokenizeContext['sliceSerialize']} sliceSerialize * Get the string value of a token. * @property {Config} config * Configuration. * * @typedef FromMarkdownOptions * Configuration for how to build mdast. * @property {Array<Extension | Array<Extension>> | null | undefined} [mdastExtensions] * Extensions for this utility to change how tokens are turned into a tree. * * @typedef {ParseOptions & FromMarkdownOptions} Options * Configuration. */ // To do: micromark: create a registry of tokens? // To do: next major: don’t return given `Node` from `enter`. // To do: next major: remove setter/getter. const own = {}.hasOwnProperty /** * @param value * Markdown to parse. * @param encoding * Character encoding for when `value` is `Buffer`. * @param options * Configuration. * @returns * mdast tree. */ const fromMarkdown = /** * @type {( * ((value: Value, encoding: Encoding, options?: Options | null | undefined) => Root) & * ((value: Value, options?: Options | null | undefined) => Root) * )} */ ( /** * @param {Value} value * @param {Encoding | Options | null | undefined} [encoding] * @param {Options | null | undefined} [options] * @returns {Root} */ function (value, encoding, options) { if (typeof encoding !== 'string') { options = encoding encoding = undefined } return compiler(options)( (0,micromark_lib_postprocess_js__WEBPACK_IMPORTED_MODULE_1__.postprocess)( // @ts-expect-error: micromark types need to accept `null`. (0,micromark_lib_parse_js__WEBPACK_IMPORTED_MODULE_2__.parse)(options).document().write((0,micromark_lib_preprocess_js__WEBPACK_IMPORTED_MODULE_3__.preprocess)()(value, encoding, true)) ) ) } ) /** * Note this compiler only understand complete buffering, not streaming. * * @param {Options | null | undefined} [options] */ function compiler(options) { /** @type {Config} */ const config = { transforms: [], canContainEols: ['emphasis', 'fragment', 'heading', 'paragraph', 'strong'], enter: { autolink: opener(link), autolinkProtocol: onenterdata, autolinkEmail: onenterdata, atxHeading: opener(heading), blockQuote: opener(blockQuote), characterEscape: onenterdata, characterReference: onenterdata, codeFenced: opener(codeFlow), codeFencedFenceInfo: buffer, codeFencedFenceMeta: buffer, codeIndented: opener(codeFlow, buffer), codeText: opener(codeText, buffer), codeTextData: onenterdata, data: onenterdata, codeFlowValue: onenterdata, definition: opener(definition), definitionDestinationString: buffer, definitionLabelString: buffer, definitionTitleString: buffer, emphasis: opener(emphasis), hardBreakEscape: opener(hardBreak), hardBreakTrailing: opener(hardBreak), htmlFlow: opener(html, buffer), htmlFlowData: onenterdata, htmlText: opener(html, buffer), htmlTextData: onenterdata, image: opener(image), label: buffer, link: opener(link), listItem: opener(listItem), listItemValue: onenterlistitemvalue, listOrdered: opener(list, onenterlistordered), listUnordered: opener(list), paragraph: opener(paragraph), reference: onenterreference, referenceString: buffer, resourceDestinationString: buffer, resourceTitleString: buffer, setextHeading: opener(heading), strong: opener(strong), thematicBreak: opener(thematicBreak) }, exit: { atxHeading: closer(), atxHeadingSequence: onexitatxheadingsequence, autolink: closer(), autolinkEmail: onexitautolinkemail, autolinkProtocol: onexitautolinkprotocol, blockQuote: closer(), characterEscapeValue: onexitdata, characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker, characterReferenceMarkerNumeric: onexitcharacterreferencemarker, characterReferenceValue: onexitcharacterreferencevalue, codeFenced: closer(onexitcodefenced), codeFencedFence: onexitcodefencedfence, codeFencedFenceInfo: onexitcodefencedfenceinfo, codeFencedFenceMeta: onexitcodefencedfencemeta, codeFlowValue: onexitdata, codeIndented: closer(onexitcodeindented), codeText: closer(onexitcodetext), codeTextData: onexitdata, data: onexitdata, definition: closer(), definitionDestinationString: onexitdefinitiondestinationstring, definitionLabelString: onexitdefinitionlabelstring, definitionTitleString: onexitdefinitiontitlestring, emphasis: closer(), hardBreakEscape: closer(onexithardbreak), hardBreakTrailing: closer(onexithardbreak), htmlFlow: closer(onexithtmlflow), htmlFlowData: onexitdata, htmlText: closer(onexithtmltext), htmlTextData: onexitdata, image: closer(onexitimage), label: onexitlabel, labelText: onexitlabeltext, lineEnding: onexitlineending, link: closer(onexitlink), listItem: closer(), listOrdered: closer(), listUnordered: closer(), paragraph: closer(), referenceString: onexitreferencestring, resourceDestinationString: onexitresourcedestinationstring, resourceTitleString: onexitresourcetitlestring, resource: onexitresource, setextHeading: closer(onexitsetextheading), setextHeadingLineSequence: onexitsetextheadinglinesequence, setextHeadingText: onexitsetextheadingtext, strong: closer(), thematicBreak: closer() } } configure(config, (options || {}).mdastExtensions || []) /** @type {CompileData} */ const data = {} return compile /** * Turn micromark events into an mdast tree. * * @param {Array<Event>} events * Events. * @returns {Root} * mdast tree. */ function compile(events) { /** @type {Root} */ let tree = {type: 'root', children: []} /** @type {Omit<CompileContext, 'sliceSerialize'>} */ const context = { stack: [tree], tokenStack: [], config, enter, exit, buffer, resume, setData, getData } /** @type {Array<number>} */ const listStack = [] let index = -1 while (++index < events.length) { // We preprocess lists to add `listItem` tokens, and to infer whether // items the list itself are spread out. if ( events[index][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.listOrdered || events[index][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.listUnordered ) { if (events[index][0] === 'enter') { listStack.push(index) } else { const tail = listStack.pop() ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(typeof tail === 'number', 'expected list ot be open') index = prepareList(events, tail, index) } } } index = -1 while (++index < events.length) { const handler = config[events[index][0]] if (own.call(handler, events[index][1].type)) { handler[events[index][1].type].call( Object.assign( {sliceSerialize: events[index][2].sliceSerialize}, context ), events[index][1] ) } } // Handle tokens still being open. if (context.tokenStack.length > 0) { const tail = context.tokenStack[context.tokenStack.length - 1] const handler = tail[1] || defaultOnError handler.call(context, undefined, tail[0]) } // Figure out `root` position. tree.position = { start: point( events.length > 0 ? events[0][1].start : {line: 1, column: 1, offset: 0} ), end: point( events.length > 0 ? events[events.length - 2][1].end : {line: 1, column: 1, offset: 0} ) } // Call transforms. index = -1 while (++index < config.transforms.length) { tree = config.transforms[index](tree) || tree } return tree } /** * @param {Array<Event>} events * @param {number} start * @param {number} length * @returns {number} */ function prepareList(events, start, length) { let index = start - 1 let containerBalance = -1 let listSpread = false /** @type {Token | undefined} */ let listItem /** @type {number | undefined} */ let lineIndex /** @type {number | undefined} */ let firstBlankLineIndex /** @type {boolean | undefined} */ let atMarker while (++index <= length) { const event = events[index] if ( event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.listUnordered || event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.listOrdered || event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.blockQuote ) { if (event[0] === 'enter') { containerBalance++ } else { containerBalance-- } atMarker = undefined } else if (event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.lineEndingBlank) { if (event[0] === 'enter') { if ( listItem && !atMarker && !containerBalance && !firstBlankLineIndex ) { firstBlankLineIndex = index } atMarker = undefined } } else if ( event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.linePrefix || event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.listItemValue || event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.listItemMarker || event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.listItemPrefix || event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.listItemPrefixWhitespace ) { // Empty. } else { atMarker = undefined } if ( (!containerBalance && event[0] === 'enter' && event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.listItemPrefix) || (containerBalance === -1 && event[0] === 'exit' && (event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.listUnordered || event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.listOrdered)) ) { if (listItem) { let tailIndex = index lineIndex = undefined while (tailIndex--) { const tailEvent = events[tailIndex] if ( tailEvent[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.lineEnding || tailEvent[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.lineEndingBlank ) { if (tailEvent[0] === 'exit') continue if (lineIndex) { events[lineIndex][1].type = micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.lineEndingBlank listSpread = true } tailEvent[1].type = micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.lineEnding lineIndex = tailIndex } else if ( tailEvent[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.linePrefix || tailEvent[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.blockQuotePrefix || tailEvent[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.blockQuotePrefixWhitespace || tailEvent[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.blockQuoteMarker || tailEvent[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.listItemIndent ) { // Empty } else { break } } if ( firstBlankLineIndex && (!lineIndex || firstBlankLineIndex < lineIndex) ) { // @ts-expect-error Patched. listItem._spread = true } // Fix position. listItem.end = Object.assign( {}, lineIndex ? events[lineIndex][1].start : event[1].end ) events.splice(lineIndex || index, 0, ['exit', listItem, event[2]]) index++ length++ } // Create a new list item. if (event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.listItemPrefix) { listItem = { type: 'listItem', // @ts-expect-error Patched _spread: false, start: Object.assign({}, event[1].start) } // @ts-expect-error: `listItem` is most definitely defined, TS... events.splice(index, 0, ['enter', listItem, event[2]]) index++ length++ firstBlankLineIndex = undefined atMarker = true } } } // @ts-expect-error Patched. events[start][1]._spread = listSpread return length } /** * Set data. * * @template {keyof CompileData} Key * Field type. * @param {Key} key * Key of field. * @param {CompileData[Key]} [value] * New value. * @returns {void} * Nothing. */ function setData(key, value) { data[key] = value } /** * Get data. * * @template {keyof CompileData} Key * Field type. * @param {Key} key * Key of field. * @returns {CompileData[Key]} * Value. */ function getData(key) { return data[key] } /** * Create an opener handle. * * @param {(token: Token) => Node} create * Create a node. * @param {Handle} [and] * Optional function to also run. * @returns {Handle} * Handle. */ function opener(create, and) { return open /** * @this {CompileContext} * @param {Token} token * @returns {void} */ function open(token) { enter.call(this, create(token), token) if (and) and.call(this, token) } } /** * @this {CompileContext} * @returns {void} */ function buffer() { this.stack.push({type: 'fragment', children: []}) } /** * @template {Node} Kind * Node type. * @this {CompileContext} * Context. * @param {Kind} node * Node to enter. * @param {Token} token * Corresponding token. * @param {OnEnterError | undefined} [errorHandler] * Handle the case where this token is open, but it is closed by something else. * @returns {Kind} * The given node. */ function enter(node, token, errorHandler) { const parent = this.stack[this.stack.length - 1] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(parent, 'expected `parent`') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)('children' in parent, 'expected `parent`') // @ts-expect-error: Assume `Node` can exist as a child of `parent`. parent.children.push(node) this.stack.push(node) this.tokenStack.push([token, errorHandler]) // @ts-expect-error: `end` will be patched later. node.position = {start: point(token.start)} return node } /** * Create a closer handle. * * @param {Handle} [and] * Optional function to also run. * @returns {Handle} * Handle. */ function closer(and) { return close /** * @this {CompileContext} * @param {Token} token * @returns {void} */ function close(token) { if (and) and.call(this, token) exit.call(this, token) } } /** * @this {CompileContext} * Context. * @param {Token} token * Corresponding token. * @param {OnExitError | undefined} [onExitError] * Handle the case where another token is open. * @returns {Node} * The closed node. */ function exit(token, onExitError) { const node = this.stack.pop() ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected `node`') const open = this.tokenStack.pop() if (!open) { throw new Error( 'Cannot close `' + token.type + '` (' + (0,unist_util_stringify_position__WEBPACK_IMPORTED_MODULE_5__.stringifyPosition)({start: token.start, end: token.end}) + '): it’s not open' ) } else if (open[0].type !== token.type) { if (onExitError) { onExitError.call(this, token, open[0]) } else { const handler = open[1] || defaultOnError handler.call(this, token, open[0]) } } (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type !== 'fragment', 'unexpected fragment `exit`ed') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.position, 'expected `position` to be defined') node.position.end = point(token.end) return node } /** * @this {CompileContext} * @returns {string} */ function resume() { return (0,mdast_util_to_string__WEBPACK_IMPORTED_MODULE_6__.toString)(this.stack.pop()) } // // Handlers. // /** * @this {CompileContext} * @type {Handle} */ function onenterlistordered() { setData('expectingFirstListItemValue', true) } /** * @this {CompileContext} * @type {Handle} */ function onenterlistitemvalue(token) { if (getData('expectingFirstListItemValue')) { const ancestor = this.stack[this.stack.length - 2] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(ancestor, 'expected nodes on stack') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(ancestor.type === 'list', 'expected list on stack') ancestor.start = Number.parseInt( this.sliceSerialize(token), micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_7__.constants.numericBaseDecimal ) setData('expectingFirstListItemValue') } } /** * @this {CompileContext} * @type {Handle} */ function onexitcodefencedfenceinfo() { const data = this.resume() const node = this.stack[this.stack.length - 1] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'code', 'expected code on stack') node.lang = data } /** * @this {CompileContext} * @type {Handle} */ function onexitcodefencedfencemeta() { const data = this.resume() const node = this.stack[this.stack.length - 1] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'code', 'expected code on stack') node.meta = data } /** * @this {CompileContext} * @type {Handle} */ function onexitcodefencedfence() { // Exit if this is the closing fence. if (getData('flowCodeInside')) return this.buffer() setData('flowCodeInside', true) } /** * @this {CompileContext} * @type {Handle} */ function onexitcodefenced() { const data = this.resume() const node = this.stack[this.stack.length - 1] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'code', 'expected code on stack') node.value = data.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, '') setData('flowCodeInside') } /** * @this {CompileContext} * @type {Handle} */ function onexitcodeindented() { const data = this.resume() const node = this.stack[this.stack.length - 1] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'code', 'expected code on stack') node.value = data.replace(/(\r?\n|\r)$/g, '') } /** * @this {CompileContext} * @type {Handle} */ function onexitdefinitionlabelstring(token) { const label = this.resume() const node = this.stack[this.stack.length - 1] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'definition', 'expected definition on stack') node.label = label node.identifier = (0,micromark_util_normalize_identifier__WEBPACK_IMPORTED_MODULE_8__.normalizeIdentifier)( this.sliceSerialize(token) ).toLowerCase() } /** * @this {CompileContext} * @type {Handle} */ function onexitdefinitiontitlestring() { const data = this.resume() const node = this.stack[this.stack.length - 1] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'definition', 'expected definition on stack') node.title = data } /** * @this {CompileContext} * @type {Handle} */ function onexitdefinitiondestinationstring() { const data = this.resume() const node = this.stack[this.stack.length - 1] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'definition', 'expected definition on stack') node.url = data } /** * @this {CompileContext} * @type {Handle} */ function onexitatxheadingsequence(token) { const node = this.stack[this.stack.length - 1] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'heading', 'expected heading on stack') if (!node.depth) { const depth = this.sliceSerialize(token).length ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( depth === 1 || depth === 2 || depth === 3 || depth === 4 || depth === 5 || depth === 6, 'expected `depth` between `1` and `6`' ) node.depth = depth } } /** * @this {CompileContext} * @type {Handle} */ function onexitsetextheadingtext() { setData('setextHeadingSlurpLineEnding', true) } /** * @this {CompileContext} * @type {Handle} */ function onexitsetextheadinglinesequence(token) { const node = this.stack[this.stack.length - 1] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'heading', 'expected heading on stack') node.depth = this.sliceSerialize(token).charCodeAt(0) === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_9__.codes.equalsTo ? 1 : 2 } /** * @this {CompileContext} * @type {Handle} */ function onexitsetextheading() { setData('setextHeadingSlurpLineEnding') } /** * @this {CompileContext} * @type {Handle} */ function onenterdata(token) { const node = this.stack[this.stack.length - 1] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)('children' in node, 'expected parent on stack') let tail = node.children[node.children.length - 1] if (!tail || tail.type !== 'text') { // Add a new text node. tail = text() // @ts-expect-error: we’ll add `end` later. tail.position = {start: point(token.start)} // @ts-expect-error: Assume `parent` accepts `text`. node.children.push(tail) } this.stack.push(tail) } /** * @this {CompileContext} * @type {Handle} */ function onexitdata(token) { const tail = this.stack.pop() ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(tail, 'expected a `node` to be on the stack') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)('value' in tail, 'expected a `literal` to be on the stack') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(tail.position, 'expected `node` to have an open position') tail.value += this.sliceSerialize(token) tail.position.end = point(token.end) } /** * @this {CompileContext} * @type {Handle} */ function onexitlineending(token) { const context = this.stack[this.stack.length - 1] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(context, 'expected `node`') // If we’re at a hard break, include the line ending in there. if (getData('atHardBreak')) { (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)('children' in context, 'expected `parent`') const tail = context.children[context.children.length - 1] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(tail.position, 'expected tail to have a starting position') tail.position.end = point(token.end) setData('atHardBreak') return } if ( !getData('setextHeadingSlurpLineEnding') && config.canContainEols.includes(context.type) ) { onenterdata.call(this, token) onexitdata.call(this, token) } } /** * @this {CompileContext} * @type {Handle} */ function onexithardbreak() { setData('atHardBreak', true) } /** * @this {CompileContext} * @type {Handle} */ function onexithtmlflow() { const data = this.resume() const node = this.stack[this.stack.length - 1] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'html', 'expected html on stack') node.value = data } /** * @this {CompileContext} * @type {Handle} */ function onexithtmltext() { const data = this.resume() const node = this.stack[this.stack.length - 1] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'html', 'expected html on stack') node.value = data } /** * @this {CompileContext} * @type {Handle} */ function onexitcodetext() { const data = this.resume() const node = this.stack[this.stack.length - 1] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'inlineCode', 'expected inline code on stack') node.value = data } /** * @this {CompileContext} * @type {Handle} */ function onexitlink() { const node = this.stack[this.stack.length - 1] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'link', 'expected link on stack') // Note: there are also `identifier` and `label` fields on this link node! // These are used / cleaned here. // To do: clean. if (getData('inReference')) { /** @type {ReferenceType} */ const referenceType = getData('referenceType') || 'shortcut' node.type += 'Reference' // @ts-expect-error: mutate. node.referenceType = referenceType // @ts-expect-error: mutate. delete node.url delete node.title } else { // @ts-expect-error: mutate. delete node.identifier // @ts-expect-error: mutate. delete node.label } setData('referenceType') } /** * @this {CompileContext} * @type {Handle} */ function onexitimage() { const node = this.stack[this.stack.length - 1] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'image', 'expected image on stack') // Note: there are also `identifier` and `label` fields on this link node! // These are used / cleaned here. // To do: clean. if (getData('inReference')) { /** @type {ReferenceType} */ const referenceType = getData('referenceType') || 'shortcut' node.type += 'Reference' // @ts-expect-error: mutate. node.referenceType = referenceType // @ts-expect-error: mutate. delete node.url delete node.title } else { // @ts-expect-error: mutate. delete node.identifier // @ts-expect-error: mutate. delete node.label } setData('referenceType') } /** * @this {CompileContext} * @type {Handle} */ function onexitlabeltext(token) { const string = this.sliceSerialize(token) const ancestor = this.stack[this.stack.length - 2] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(ancestor, 'expected ancestor on stack') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( ancestor.type === 'image' || ancestor.type === 'link', 'expected image or link on stack' ) // @ts-expect-error: stash this on the node, as it might become a reference // later. ancestor.label = (0,micromark_util_decode_string__WEBPACK_IMPORTED_MODULE_10__.decodeString)(string) // @ts-expect-error: same as above. ancestor.identifier = (0,micromark_util_normalize_identifier__WEBPACK_IMPORTED_MODULE_8__.normalizeIdentifier)(string).toLowerCase() } /** * @this {CompileContext} * @type {Handle} */ function onexitlabel() { const fragment = this.stack[this.stack.length - 1] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(fragment, 'expected node on stack') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(fragment.type === 'fragment', 'expected fragment on stack') const value = this.resume() const node = this.stack[this.stack.length - 1] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( node.type === 'image' || node.type === 'link', 'expected image or link on stack' ) // Assume a reference. setData('inReference', true) if (node.type === 'link') { /** @type {Array<StaticPhrasingContent>} */ // @ts-expect-error: Assume static phrasing content. const children = fragment.children node.children = children } else { node.alt = value } } /** * @this {CompileContext} * @type {Handle} */ function onexitresourcedestinationstring() { const data = this.resume() const node = this.stack[this.stack.length - 1] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( node.type === 'image' || node.type === 'link', 'expected image or link on stack' ) node.url = data } /** * @this {CompileContext} * @type {Handle} */ function onexitresourcetitlestring() { const data = this.resume() const node = this.stack[this.stack.length - 1] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( node.type === 'image' || node.type === 'link', 'expected image or link on stack' ) node.title = data } /** * @this {CompileContext} * @type {Handle} */ function onexitresource() { setData('inReference') } /** * @this {CompileContext} * @type {Handle} */ function onenterreference() { setData('referenceType', 'collapsed') } /** * @this {CompileContext} * @type {Handle} */ function onexitreferencestring(token) { const label = this.resume() const node = this.stack[this.stack.length - 1] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( node.type === 'image' || node.type === 'link', 'expected image reference or link reference on stack' ) // @ts-expect-error: stash this on the node, as it might become a reference // later. node.label = label // @ts-expect-error: same as above. node.identifier = (0,micromark_util_normalize_identifier__WEBPACK_IMPORTED_MODULE_8__.normalizeIdentifier)( this.sliceSerialize(token) ).toLowerCase() setData('referenceType', 'full') } /** * @this {CompileContext} * @type {Handle} */ function onexitcharacterreferencemarker(token) { (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( token.type === 'characterReferenceMarkerNumeric' || token.type === 'characterReferenceMarkerHexadecimal' ) setData('characterReferenceType', token.type) } /** * @this {CompileContext} * @type {Handle} */ function onexitcharacterreferencevalue(token) { const data = this.sliceSerialize(token) const type = getData('characterReferenceType') /** @type {string} */ let value if (type) { value = (0,micromark_util_decode_numeric_character_reference__WEBPACK_IMPORTED_MODULE_11__.decodeNumericCharacterReference)( data, type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.characterReferenceMarkerNumeric ? micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_7__.constants.numericBaseDecimal : micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_7__.constants.numericBaseHexadecimal ) setData('characterReferenceType') } else { const result = (0,decode_named_character_reference__WEBPACK_IMPORTED_MODULE_12__.decodeNamedCharacterReference)(data) ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(result !== false, 'expected reference to decode') value = result } const tail = this.stack.pop() ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(tail, 'expected `node`') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(tail.position, 'expected `node.position`') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)('value' in tail, 'expected `node.value`') tail.value += value tail.position.end = point(token.end) } /** * @this {CompileContext} * @type {Handle} */ function onexitautolinkprotocol(token) { onexitdata.call(this, token) const node = this.stack[this.stack.length - 1] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'link', 'expected link on stack') node.url = this.sliceSerialize(token) } /** * @this {CompileContext} * @type {Handle} */ function onexitautolinkemail(token) { onexitdata.call(this, token) const node = this.stack[this.stack.length - 1] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node, 'expected node on stack') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(node.type === 'link', 'expected link on stack') node.url = 'mailto:' + this.sliceSerialize(token) } // // Creaters. // /** @returns {Blockquote} */ function blockQuote() { return {type: 'blockquote', children: []} } /** @returns {Code} */ function codeFlow() { return {type: 'code', lang: null, meta: null, value: ''} } /** @returns {InlineCode} */ function codeText() { return {type: 'inlineCode', value: ''} } /** @returns {Definition} */ function definition() { return { type: 'definition', identifier: '', label: null, title: null, url: '' } } /** @returns {Emphasis} */ function emphasis() { return {type: 'emphasis', children: []} } /** @returns {Heading} */ function heading() { // @ts-expect-error `depth` will be set later. return {type: 'heading', depth: undefined, children: []} } /** @returns {Break} */ function hardBreak() { return {type: 'break'} } /** @returns {HTML} */ function html() { return {type: 'html', value: ''} } /** @returns {Image} */ function image() { return {type: 'image', title: null, url: '', alt: null} } /** @returns {Link} */ function link() { return {type: 'link', title: null, url: '', children: []} } /** * @param {Token} token * @returns {List} */ function list(token) { return { type: 'list', ordered: token.type === 'listOrdered', start: null, // @ts-expect-error Patched. spread: token._spread, children: [] } } /** * @param {Token} token * @returns {ListItem} */ function listItem(token) { return { type: 'listItem', // @ts-expect-error Patched. spread: token._spread, checked: null, children: [] } } /** @returns {Paragraph} */ function paragraph() { return {type: 'paragraph', children: []} } /** @returns {Strong} */ function strong() { return {type: 'strong', children: []} } /** @returns {Text} */ function text() { return {type: 'text', value: ''} } /** @returns {ThematicBreak} */ function thematicBreak() { return {type: 'thematicBreak'} } } /** * Copy a point-like value. * * @param {Point} d * Point-like value. * @returns {Point} * unist point. */ function point(d) { return {line: d.line, column: d.column, offset: d.offset} } /** * @param {Config} combined * @param {Array<Extension | Array<Extension>>} extensions * @returns {void} */ function configure(combined, extensions) { let index = -1 while (++index < extensions.length) { const value = extensions[index] if (Array.isArray(value)) { configure(combined, value) } else { extension(combined, value) } } } /** * @param {Config} combined * @param {Extension} extension * @returns {void} */ function extension(combined, extension) { /** @type {keyof Extension} */ let key for (key in extension) { if (own.call(extension, key)) { if (key === 'canContainEols') { const right = extension[key] if (right) { combined[key].push(...right) } } else if (key === 'transforms') { const right = extension[key] if (right) { combined[key].push(...right) } } else if (key === 'enter' || key === 'exit') { const right = extension[key] if (right) { Object.assign(combined[key], right) } } } } } /** @type {OnEnterError} */ function defaultOnError(left, right) { if (left) { throw new Error( 'Cannot close `' + left.type + '` (' + (0,unist_util_stringify_position__WEBPACK_IMPORTED_MODULE_5__.stringifyPosition)({start: left.start, end: left.end}) + '): a different token (`' + right.type + '`, ' + (0,unist_util_stringify_position__WEBPACK_IMPORTED_MODULE_5__.stringifyPosition)({start: right.start, end: right.end}) + ') is open' ) } else { throw new Error( 'Cannot close document, a token (`' + right.type + '`, ' + (0,unist_util_stringify_position__WEBPACK_IMPORTED_MODULE_5__.stringifyPosition)({start: right.start, end: right.end}) + ') is still open' ) } } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/footer.js": /*!********************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/footer.js ***! \********************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "footer": () => (/* binding */ footer) /* harmony export */ }); /* harmony import */ var micromark_util_sanitize_uri__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-sanitize-uri */ "../node_modules/micromark-util-sanitize-uri/dev/index.js"); /** * @typedef {import('hast').Element} Element * @typedef {import('hast').ElementContent} ElementContent * * @typedef {import('./state.js').State} State */ /** * Generate a hast footer for called footnote definitions. * * @param {State} state * Info passed around. * @returns {Element | undefined} * `section` element or `undefined`. */ function footer(state) { /** @type {Array<ElementContent>} */ const listItems = [] let index = -1 while (++index < state.footnoteOrder.length) { const def = state.footnoteById[state.footnoteOrder[index]] if (!def) { continue } const content = state.all(def) const id = String(def.identifier).toUpperCase() const safeId = (0,micromark_util_sanitize_uri__WEBPACK_IMPORTED_MODULE_0__.normalizeUri)(id.toLowerCase()) let referenceIndex = 0 /** @type {Array<ElementContent>} */ const backReferences = [] while (++referenceIndex <= state.footnoteCounts[id]) { /** @type {Element} */ const backReference = { type: 'element', tagName: 'a', properties: { href: '#' + state.clobberPrefix + 'fnref-' + safeId + (referenceIndex > 1 ? '-' + referenceIndex : ''), dataFootnoteBackref: true, className: ['data-footnote-backref'], ariaLabel: state.footnoteBackLabel }, children: [{type: 'text', value: '↩'}] } if (referenceIndex > 1) { backReference.children.push({ type: 'element', tagName: 'sup', children: [{type: 'text', value: String(referenceIndex)}] }) } if (backReferences.length > 0) { backReferences.push({type: 'text', value: ' '}) } backReferences.push(backReference) } const tail = content[content.length - 1] if (tail && tail.type === 'element' && tail.tagName === 'p') { const tailTail = tail.children[tail.children.length - 1] if (tailTail && tailTail.type === 'text') { tailTail.value += ' ' } else { tail.children.push({type: 'text', value: ' '}) } tail.children.push(...backReferences) } else { content.push(...backReferences) } /** @type {Element} */ const listItem = { type: 'element', tagName: 'li', properties: {id: state.clobberPrefix + 'fn-' + safeId}, children: state.wrap(content, true) } state.patch(def, listItem) listItems.push(listItem) } if (listItems.length === 0) { return } return { type: 'element', tagName: 'section', properties: {dataFootnotes: true, className: ['footnotes']}, children: [ { type: 'element', tagName: state.footnoteLabelTagName, properties: { // To do: use structured clone. ...JSON.parse(JSON.stringify(state.footnoteLabelProperties)), id: 'footnote-label' }, children: [{type: 'text', value: state.footnoteLabel}] }, {type: 'text', value: '\n'}, { type: 'element', tagName: 'ol', properties: {}, children: state.wrap(listItems, true) }, {type: 'text', value: '\n'} ] } } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/handlers/blockquote.js": /*!*********************************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/handlers/blockquote.js ***! \*********************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "blockquote": () => (/* binding */ blockquote) /* harmony export */ }); /** * @typedef {import('hast').Element} Element * @typedef {import('mdast').Blockquote} Blockquote * @typedef {import('../state.js').State} State */ /** * Turn an mdast `blockquote` node into hast. * * @param {State} state * Info passed around. * @param {Blockquote} node * mdast node. * @returns {Element} * hast node. */ function blockquote(state, node) { /** @type {Element} */ const result = { type: 'element', tagName: 'blockquote', properties: {}, children: state.wrap(state.all(node), true) } state.patch(node, result) return state.applyData(node, result) } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/handlers/break.js": /*!****************************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/handlers/break.js ***! \****************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "hardBreak": () => (/* binding */ hardBreak) /* harmony export */ }); /** * @typedef {import('hast').Element} Element * @typedef {import('hast').Text} Text * @typedef {import('mdast').Break} Break * @typedef {import('../state.js').State} State */ /** * Turn an mdast `break` node into hast. * * @param {State} state * Info passed around. * @param {Break} node * mdast node. * @returns {Array<Element | Text>} * hast element content. */ function hardBreak(state, node) { /** @type {Element} */ const result = {type: 'element', tagName: 'br', properties: {}, children: []} state.patch(node, result) return [state.applyData(node, result), {type: 'text', value: '\n'}] } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/handlers/code.js": /*!***************************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/handlers/code.js ***! \***************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "code": () => (/* binding */ code) /* harmony export */ }); /** * @typedef {import('hast').Element} Element * @typedef {import('hast').Properties} Properties * @typedef {import('mdast').Code} Code * @typedef {import('../state.js').State} State */ /** * Turn an mdast `code` node into hast. * * @param {State} state * Info passed around. * @param {Code} node * mdast node. * @returns {Element} * hast node. */ function code(state, node) { const value = node.value ? node.value + '\n' : '' // To do: next major, use `node.lang` w/o regex, the splitting’s been going // on for years in remark now. const lang = node.lang ? node.lang.match(/^[^ \t]+(?=[ \t]|$)/) : null /** @type {Properties} */ const properties = {} if (lang) { properties.className = ['language-' + lang] } // Create `<code>`. /** @type {Element} */ let result = { type: 'element', tagName: 'code', properties, children: [{type: 'text', value}] } if (node.meta) { result.data = {meta: node.meta} } state.patch(node, result) result = state.applyData(node, result) // Create `<pre>`. result = {type: 'element', tagName: 'pre', properties: {}, children: [result]} state.patch(node, result) return result } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/handlers/delete.js": /*!*****************************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/handlers/delete.js ***! \*****************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "strikethrough": () => (/* binding */ strikethrough) /* harmony export */ }); /** * @typedef {import('hast').Element} Element * @typedef {import('mdast').Delete} Delete * @typedef {import('../state.js').State} State */ /** * Turn an mdast `delete` node into hast. * * @param {State} state * Info passed around. * @param {Delete} node * mdast node. * @returns {Element} * hast node. */ function strikethrough(state, node) { /** @type {Element} */ const result = { type: 'element', tagName: 'del', properties: {}, children: state.all(node) } state.patch(node, result) return state.applyData(node, result) } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/handlers/emphasis.js": /*!*******************************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/handlers/emphasis.js ***! \*******************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "emphasis": () => (/* binding */ emphasis) /* harmony export */ }); /** * @typedef {import('hast').Element} Element * @typedef {import('mdast').Emphasis} Emphasis * @typedef {import('../state.js').State} State */ /** * Turn an mdast `emphasis` node into hast. * * @param {State} state * Info passed around. * @param {Emphasis} node * mdast node. * @returns {Element} * hast node. */ function emphasis(state, node) { /** @type {Element} */ const result = { type: 'element', tagName: 'em', properties: {}, children: state.all(node) } state.patch(node, result) return state.applyData(node, result) } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js": /*!*****************************************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js ***! \*****************************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "footnoteReference": () => (/* binding */ footnoteReference) /* harmony export */ }); /* harmony import */ var micromark_util_sanitize_uri__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-sanitize-uri */ "../node_modules/micromark-util-sanitize-uri/dev/index.js"); /** * @typedef {import('mdast').FootnoteReference} FootnoteReference * @typedef {import('hast').Element} Element * @typedef {import('../state.js').State} State */ /** * Turn an mdast `footnoteReference` node into hast. * * @param {State} state * Info passed around. * @param {FootnoteReference} node * mdast node. * @returns {Element} * hast node. */ function footnoteReference(state, node) { const id = String(node.identifier).toUpperCase() const safeId = (0,micromark_util_sanitize_uri__WEBPACK_IMPORTED_MODULE_0__.normalizeUri)(id.toLowerCase()) const index = state.footnoteOrder.indexOf(id) /** @type {number} */ let counter if (index === -1) { state.footnoteOrder.push(id) state.footnoteCounts[id] = 1 counter = state.footnoteOrder.length } else { state.footnoteCounts[id]++ counter = index + 1 } const reuseCounter = state.footnoteCounts[id] /** @type {Element} */ const link = { type: 'element', tagName: 'a', properties: { href: '#' + state.clobberPrefix + 'fn-' + safeId, id: state.clobberPrefix + 'fnref-' + safeId + (reuseCounter > 1 ? '-' + reuseCounter : ''), dataFootnoteRef: true, ariaDescribedBy: ['footnote-label'] }, children: [{type: 'text', value: String(counter)}] } state.patch(node, link) /** @type {Element} */ const sup = { type: 'element', tagName: 'sup', properties: {}, children: [link] } state.patch(node, sup) return state.applyData(node, sup) } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/handlers/footnote.js": /*!*******************************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/handlers/footnote.js ***! \*******************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "footnote": () => (/* binding */ footnote) /* harmony export */ }); /* harmony import */ var _footnote_reference_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./footnote-reference.js */ "../node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js"); /** * @typedef {import('hast').Element} Element * @typedef {import('mdast').Footnote} Footnote * @typedef {import('../state.js').State} State */ // To do: when both: // * <https://github.com/micromark/micromark-extension-footnote> // * <https://github.com/syntax-tree/mdast-util-footnote> // …are archived, remove this (also from mdast). // These inline notes are not used in GFM. /** * Turn an mdast `footnote` node into hast. * * @param {State} state * Info passed around. * @param {Footnote} node * mdast node. * @returns {Element} * hast node. */ function footnote(state, node) { const footnoteById = state.footnoteById let no = 1 while (no in footnoteById) no++ const identifier = String(no) footnoteById[identifier] = { type: 'footnoteDefinition', identifier, children: [{type: 'paragraph', children: node.children}], position: node.position } return (0,_footnote_reference_js__WEBPACK_IMPORTED_MODULE_0__.footnoteReference)(state, { type: 'footnoteReference', identifier, position: node.position }) } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/handlers/heading.js": /*!******************************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/handlers/heading.js ***! \******************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "heading": () => (/* binding */ heading) /* harmony export */ }); /** * @typedef {import('hast').Element} Element * @typedef {import('mdast').Heading} Heading * @typedef {import('../state.js').State} State */ /** * Turn an mdast `heading` node into hast. * * @param {State} state * Info passed around. * @param {Heading} node * mdast node. * @returns {Element} * hast node. */ function heading(state, node) { /** @type {Element} */ const result = { type: 'element', tagName: 'h' + node.depth, properties: {}, children: state.all(node) } state.patch(node, result) return state.applyData(node, result) } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/handlers/html.js": /*!***************************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/handlers/html.js ***! \***************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "html": () => (/* binding */ html) /* harmony export */ }); /** * @typedef {import('hast').Element} Element * @typedef {import('mdast').HTML} Html * @typedef {import('../state.js').State} State * @typedef {import('../../index.js').Raw} Raw */ /** * Turn an mdast `html` node into hast (`raw` node in dangerous mode, otherwise * nothing). * * @param {State} state * Info passed around. * @param {Html} node * mdast node. * @returns {Raw | Element | null} * hast node. */ function html(state, node) { if (state.dangerous) { /** @type {Raw} */ const result = {type: 'raw', value: node.value} state.patch(node, result) return state.applyData(node, result) } // To do: next major: return `undefined`. return null } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/handlers/image-reference.js": /*!**************************************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/handlers/image-reference.js ***! \**************************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "imageReference": () => (/* binding */ imageReference) /* harmony export */ }); /* harmony import */ var micromark_util_sanitize_uri__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-sanitize-uri */ "../node_modules/micromark-util-sanitize-uri/dev/index.js"); /* harmony import */ var _revert_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../revert.js */ "../node_modules/mdast-util-to-hast/lib/revert.js"); /** * @typedef {import('hast').ElementContent} ElementContent * @typedef {import('hast').Element} Element * @typedef {import('hast').Properties} Properties * @typedef {import('mdast').ImageReference} ImageReference * @typedef {import('../state.js').State} State */ /** * Turn an mdast `imageReference` node into hast. * * @param {State} state * Info passed around. * @param {ImageReference} node * mdast node. * @returns {ElementContent | Array<ElementContent>} * hast node. */ function imageReference(state, node) { const def = state.definition(node.identifier) if (!def) { return (0,_revert_js__WEBPACK_IMPORTED_MODULE_0__.revert)(state, node) } /** @type {Properties} */ const properties = {src: (0,micromark_util_sanitize_uri__WEBPACK_IMPORTED_MODULE_1__.normalizeUri)(def.url || ''), alt: node.alt} if (def.title !== null && def.title !== undefined) { properties.title = def.title } /** @type {Element} */ const result = {type: 'element', tagName: 'img', properties, children: []} state.patch(node, result) return state.applyData(node, result) } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/handlers/image.js": /*!****************************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/handlers/image.js ***! \****************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "image": () => (/* binding */ image) /* harmony export */ }); /* harmony import */ var micromark_util_sanitize_uri__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-sanitize-uri */ "../node_modules/micromark-util-sanitize-uri/dev/index.js"); /** * @typedef {import('hast').Element} Element * @typedef {import('hast').Properties} Properties * @typedef {import('mdast').Image} Image * @typedef {import('../state.js').State} State */ /** * Turn an mdast `image` node into hast. * * @param {State} state * Info passed around. * @param {Image} node * mdast node. * @returns {Element} * hast node. */ function image(state, node) { /** @type {Properties} */ const properties = {src: (0,micromark_util_sanitize_uri__WEBPACK_IMPORTED_MODULE_0__.normalizeUri)(node.url)} if (node.alt !== null && node.alt !== undefined) { properties.alt = node.alt } if (node.title !== null && node.title !== undefined) { properties.title = node.title } /** @type {Element} */ const result = {type: 'element', tagName: 'img', properties, children: []} state.patch(node, result) return state.applyData(node, result) } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/handlers/index.js": /*!****************************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/handlers/index.js ***! \****************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "handlers": () => (/* binding */ handlers) /* harmony export */ }); /* harmony import */ var _blockquote_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./blockquote.js */ "../node_modules/mdast-util-to-hast/lib/handlers/blockquote.js"); /* harmony import */ var _break_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./break.js */ "../node_modules/mdast-util-to-hast/lib/handlers/break.js"); /* harmony import */ var _code_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./code.js */ "../node_modules/mdast-util-to-hast/lib/handlers/code.js"); /* harmony import */ var _delete_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./delete.js */ "../node_modules/mdast-util-to-hast/lib/handlers/delete.js"); /* harmony import */ var _emphasis_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./emphasis.js */ "../node_modules/mdast-util-to-hast/lib/handlers/emphasis.js"); /* harmony import */ var _footnote_reference_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./footnote-reference.js */ "../node_modules/mdast-util-to-hast/lib/handlers/footnote-reference.js"); /* harmony import */ var _footnote_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./footnote.js */ "../node_modules/mdast-util-to-hast/lib/handlers/footnote.js"); /* harmony import */ var _heading_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./heading.js */ "../node_modules/mdast-util-to-hast/lib/handlers/heading.js"); /* harmony import */ var _html_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./html.js */ "../node_modules/mdast-util-to-hast/lib/handlers/html.js"); /* harmony import */ var _image_reference_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./image-reference.js */ "../node_modules/mdast-util-to-hast/lib/handlers/image-reference.js"); /* harmony import */ var _image_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./image.js */ "../node_modules/mdast-util-to-hast/lib/handlers/image.js"); /* harmony import */ var _inline_code_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./inline-code.js */ "../node_modules/mdast-util-to-hast/lib/handlers/inline-code.js"); /* harmony import */ var _link_reference_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./link-reference.js */ "../node_modules/mdast-util-to-hast/lib/handlers/link-reference.js"); /* harmony import */ var _link_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./link.js */ "../node_modules/mdast-util-to-hast/lib/handlers/link.js"); /* harmony import */ var _list_item_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./list-item.js */ "../node_modules/mdast-util-to-hast/lib/handlers/list-item.js"); /* harmony import */ var _list_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./list.js */ "../node_modules/mdast-util-to-hast/lib/handlers/list.js"); /* harmony import */ var _paragraph_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./paragraph.js */ "../node_modules/mdast-util-to-hast/lib/handlers/paragraph.js"); /* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./root.js */ "../node_modules/mdast-util-to-hast/lib/handlers/root.js"); /* harmony import */ var _strong_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./strong.js */ "../node_modules/mdast-util-to-hast/lib/handlers/strong.js"); /* harmony import */ var _table_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./table.js */ "../node_modules/mdast-util-to-hast/lib/handlers/table.js"); /* harmony import */ var _table_row_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./table-row.js */ "../node_modules/mdast-util-to-hast/lib/handlers/table-row.js"); /* harmony import */ var _table_cell_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./table-cell.js */ "../node_modules/mdast-util-to-hast/lib/handlers/table-cell.js"); /* harmony import */ var _text_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./text.js */ "../node_modules/mdast-util-to-hast/lib/handlers/text.js"); /* harmony import */ var _thematic_break_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./thematic-break.js */ "../node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js"); /** * Default handlers for nodes. */ const handlers = { blockquote: _blockquote_js__WEBPACK_IMPORTED_MODULE_0__.blockquote, break: _break_js__WEBPACK_IMPORTED_MODULE_1__.hardBreak, code: _code_js__WEBPACK_IMPORTED_MODULE_2__.code, delete: _delete_js__WEBPACK_IMPORTED_MODULE_3__.strikethrough, emphasis: _emphasis_js__WEBPACK_IMPORTED_MODULE_4__.emphasis, footnoteReference: _footnote_reference_js__WEBPACK_IMPORTED_MODULE_5__.footnoteReference, footnote: _footnote_js__WEBPACK_IMPORTED_MODULE_6__.footnote, heading: _heading_js__WEBPACK_IMPORTED_MODULE_7__.heading, html: _html_js__WEBPACK_IMPORTED_MODULE_8__.html, imageReference: _image_reference_js__WEBPACK_IMPORTED_MODULE_9__.imageReference, image: _image_js__WEBPACK_IMPORTED_MODULE_10__.image, inlineCode: _inline_code_js__WEBPACK_IMPORTED_MODULE_11__.inlineCode, linkReference: _link_reference_js__WEBPACK_IMPORTED_MODULE_12__.linkReference, link: _link_js__WEBPACK_IMPORTED_MODULE_13__.link, listItem: _list_item_js__WEBPACK_IMPORTED_MODULE_14__.listItem, list: _list_js__WEBPACK_IMPORTED_MODULE_15__.list, paragraph: _paragraph_js__WEBPACK_IMPORTED_MODULE_16__.paragraph, root: _root_js__WEBPACK_IMPORTED_MODULE_17__.root, strong: _strong_js__WEBPACK_IMPORTED_MODULE_18__.strong, table: _table_js__WEBPACK_IMPORTED_MODULE_19__.table, tableCell: _table_cell_js__WEBPACK_IMPORTED_MODULE_20__.tableCell, tableRow: _table_row_js__WEBPACK_IMPORTED_MODULE_21__.tableRow, text: _text_js__WEBPACK_IMPORTED_MODULE_22__.text, thematicBreak: _thematic_break_js__WEBPACK_IMPORTED_MODULE_23__.thematicBreak, toml: ignore, yaml: ignore, definition: ignore, footnoteDefinition: ignore } // Return nothing for nodes that are ignored. function ignore() { // To do: next major: return `undefined`. return null } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/handlers/inline-code.js": /*!**********************************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/handlers/inline-code.js ***! \**********************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "inlineCode": () => (/* binding */ inlineCode) /* harmony export */ }); /** * @typedef {import('hast').Element} Element * @typedef {import('hast').Text} Text * @typedef {import('mdast').InlineCode} InlineCode * @typedef {import('../state.js').State} State */ /** * Turn an mdast `inlineCode` node into hast. * * @param {State} state * Info passed around. * @param {InlineCode} node * mdast node. * @returns {Element} * hast node. */ function inlineCode(state, node) { /** @type {Text} */ const text = {type: 'text', value: node.value.replace(/\r?\n|\r/g, ' ')} state.patch(node, text) /** @type {Element} */ const result = { type: 'element', tagName: 'code', properties: {}, children: [text] } state.patch(node, result) return state.applyData(node, result) } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/handlers/link-reference.js": /*!*************************************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/handlers/link-reference.js ***! \*************************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "linkReference": () => (/* binding */ linkReference) /* harmony export */ }); /* harmony import */ var micromark_util_sanitize_uri__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-sanitize-uri */ "../node_modules/micromark-util-sanitize-uri/dev/index.js"); /* harmony import */ var _revert_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../revert.js */ "../node_modules/mdast-util-to-hast/lib/revert.js"); /** * @typedef {import('hast').Element} Element * @typedef {import('hast').ElementContent} ElementContent * @typedef {import('hast').Properties} Properties * @typedef {import('mdast').LinkReference} LinkReference * @typedef {import('../state.js').State} State */ /** * Turn an mdast `linkReference` node into hast. * * @param {State} state * Info passed around. * @param {LinkReference} node * mdast node. * @returns {ElementContent | Array<ElementContent>} * hast node. */ function linkReference(state, node) { const def = state.definition(node.identifier) if (!def) { return (0,_revert_js__WEBPACK_IMPORTED_MODULE_0__.revert)(state, node) } /** @type {Properties} */ const properties = {href: (0,micromark_util_sanitize_uri__WEBPACK_IMPORTED_MODULE_1__.normalizeUri)(def.url || '')} if (def.title !== null && def.title !== undefined) { properties.title = def.title } /** @type {Element} */ const result = { type: 'element', tagName: 'a', properties, children: state.all(node) } state.patch(node, result) return state.applyData(node, result) } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/handlers/link.js": /*!***************************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/handlers/link.js ***! \***************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "link": () => (/* binding */ link) /* harmony export */ }); /* harmony import */ var micromark_util_sanitize_uri__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-sanitize-uri */ "../node_modules/micromark-util-sanitize-uri/dev/index.js"); /** * @typedef {import('hast').Element} Element * @typedef {import('hast').Properties} Properties * @typedef {import('mdast').Link} Link * @typedef {import('../state.js').State} State */ /** * Turn an mdast `link` node into hast. * * @param {State} state * Info passed around. * @param {Link} node * mdast node. * @returns {Element} * hast node. */ function link(state, node) { /** @type {Properties} */ const properties = {href: (0,micromark_util_sanitize_uri__WEBPACK_IMPORTED_MODULE_0__.normalizeUri)(node.url)} if (node.title !== null && node.title !== undefined) { properties.title = node.title } /** @type {Element} */ const result = { type: 'element', tagName: 'a', properties, children: state.all(node) } state.patch(node, result) return state.applyData(node, result) } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/handlers/list-item.js": /*!********************************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/handlers/list-item.js ***! \********************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "listItem": () => (/* binding */ listItem) /* harmony export */ }); /** * @typedef {import('hast').Element} Element * @typedef {import('hast').ElementContent} ElementContent * @typedef {import('hast').Properties} Properties * @typedef {import('mdast').Content} Content * @typedef {import('mdast').ListItem} ListItem * @typedef {import('mdast').Parent} Parent * @typedef {import('mdast').Root} Root * @typedef {import('../state.js').State} State */ /** * @typedef {Root | Content} Nodes * @typedef {Extract<Nodes, Parent>} Parents */ /** * Turn an mdast `listItem` node into hast. * * @param {State} state * Info passed around. * @param {ListItem} node * mdast node. * @param {Parents | null | undefined} parent * Parent of `node`. * @returns {Element} * hast node. */ function listItem(state, node, parent) { const results = state.all(node) const loose = parent ? listLoose(parent) : listItemLoose(node) /** @type {Properties} */ const properties = {} /** @type {Array<ElementContent>} */ const children = [] if (typeof node.checked === 'boolean') { const head = results[0] /** @type {Element} */ let paragraph if (head && head.type === 'element' && head.tagName === 'p') { paragraph = head } else { paragraph = {type: 'element', tagName: 'p', properties: {}, children: []} results.unshift(paragraph) } if (paragraph.children.length > 0) { paragraph.children.unshift({type: 'text', value: ' '}) } paragraph.children.unshift({ type: 'element', tagName: 'input', properties: {type: 'checkbox', checked: node.checked, disabled: true}, children: [] }) // According to github-markdown-css, this class hides bullet. // See: <https://github.com/sindresorhus/github-markdown-css>. properties.className = ['task-list-item'] } let index = -1 while (++index < results.length) { const child = results[index] // Add eols before nodes, except if this is a loose, first paragraph. if ( loose || index !== 0 || child.type !== 'element' || child.tagName !== 'p' ) { children.push({type: 'text', value: '\n'}) } if (child.type === 'element' && child.tagName === 'p' && !loose) { children.push(...child.children) } else { children.push(child) } } const tail = results[results.length - 1] // Add a final eol. if (tail && (loose || tail.type !== 'element' || tail.tagName !== 'p')) { children.push({type: 'text', value: '\n'}) } /** @type {Element} */ const result = {type: 'element', tagName: 'li', properties, children} state.patch(node, result) return state.applyData(node, result) } /** * @param {Parents} node * @return {Boolean} */ function listLoose(node) { let loose = false if (node.type === 'list') { loose = node.spread || false const children = node.children let index = -1 while (!loose && ++index < children.length) { loose = listItemLoose(children[index]) } } return loose } /** * @param {ListItem} node * @return {Boolean} */ function listItemLoose(node) { const spread = node.spread return spread === undefined || spread === null ? node.children.length > 1 : spread } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/handlers/list.js": /*!***************************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/handlers/list.js ***! \***************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "list": () => (/* binding */ list) /* harmony export */ }); /** * @typedef {import('hast').Element} Element * @typedef {import('hast').Properties} Properties * @typedef {import('mdast').List} List * @typedef {import('../state.js').State} State */ /** * Turn an mdast `list` node into hast. * * @param {State} state * Info passed around. * @param {List} node * mdast node. * @returns {Element} * hast node. */ function list(state, node) { /** @type {Properties} */ const properties = {} const results = state.all(node) let index = -1 if (typeof node.start === 'number' && node.start !== 1) { properties.start = node.start } // Like GitHub, add a class for custom styling. while (++index < results.length) { const child = results[index] if ( child.type === 'element' && child.tagName === 'li' && child.properties && Array.isArray(child.properties.className) && child.properties.className.includes('task-list-item') ) { properties.className = ['contains-task-list'] break } } /** @type {Element} */ const result = { type: 'element', tagName: node.ordered ? 'ol' : 'ul', properties, children: state.wrap(results, true) } state.patch(node, result) return state.applyData(node, result) } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/handlers/paragraph.js": /*!********************************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/handlers/paragraph.js ***! \********************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "paragraph": () => (/* binding */ paragraph) /* harmony export */ }); /** * @typedef {import('hast').Element} Element * @typedef {import('mdast').Paragraph} Paragraph * @typedef {import('../state.js').State} State */ /** * Turn an mdast `paragraph` node into hast. * * @param {State} state * Info passed around. * @param {Paragraph} node * mdast node. * @returns {Element} * hast node. */ function paragraph(state, node) { /** @type {Element} */ const result = { type: 'element', tagName: 'p', properties: {}, children: state.all(node) } state.patch(node, result) return state.applyData(node, result) } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/handlers/root.js": /*!***************************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/handlers/root.js ***! \***************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "root": () => (/* binding */ root) /* harmony export */ }); /** * @typedef {import('hast').Root} HastRoot * @typedef {import('hast').Element} HastElement * @typedef {import('mdast').Root} MdastRoot * @typedef {import('../state.js').State} State */ /** * Turn an mdast `root` node into hast. * * @param {State} state * Info passed around. * @param {MdastRoot} node * mdast node. * @returns {HastRoot | HastElement} * hast node. */ function root(state, node) { /** @type {HastRoot} */ const result = {type: 'root', children: state.wrap(state.all(node))} state.patch(node, result) return state.applyData(node, result) } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/handlers/strong.js": /*!*****************************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/handlers/strong.js ***! \*****************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "strong": () => (/* binding */ strong) /* harmony export */ }); /** * @typedef {import('hast').Element} Element * @typedef {import('mdast').Strong} Strong * @typedef {import('../state.js').State} State */ /** * Turn an mdast `strong` node into hast. * * @param {State} state * Info passed around. * @param {Strong} node * mdast node. * @returns {Element} * hast node. */ function strong(state, node) { /** @type {Element} */ const result = { type: 'element', tagName: 'strong', properties: {}, children: state.all(node) } state.patch(node, result) return state.applyData(node, result) } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/handlers/table-cell.js": /*!*********************************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/handlers/table-cell.js ***! \*********************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "tableCell": () => (/* binding */ tableCell) /* harmony export */ }); /** * @typedef {import('hast').Element} Element * @typedef {import('mdast').TableCell} TableCell * @typedef {import('../state.js').State} State */ /** * Turn an mdast `tableCell` node into hast. * * @param {State} state * Info passed around. * @param {TableCell} node * mdast node. * @returns {Element} * hast node. */ function tableCell(state, node) { // Note: this function is normally not called: see `table-row` for how rows // and their cells are compiled. /** @type {Element} */ const result = { type: 'element', tagName: 'td', // Assume body cell. properties: {}, children: state.all(node) } state.patch(node, result) return state.applyData(node, result) } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/handlers/table-row.js": /*!********************************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/handlers/table-row.js ***! \********************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "tableRow": () => (/* binding */ tableRow) /* harmony export */ }); /** * @typedef {import('hast').Properties} Properties * @typedef {import('hast').Element} Element * @typedef {import('hast').ElementContent} ElementContent * @typedef {import('mdast').Content} Content * @typedef {import('mdast').Parent} Parent * @typedef {import('mdast').Root} Root * @typedef {import('mdast').TableRow} TableRow * @typedef {import('../state.js').State} State */ /** * @typedef {Root | Content} Nodes * @typedef {Extract<Nodes, Parent>} Parents */ /** * Turn an mdast `tableRow` node into hast. * * @param {State} state * Info passed around. * @param {TableRow} node * mdast node. * @param {Parents | null | undefined} parent * Parent of `node`. * @returns {Element} * hast node. */ function tableRow(state, node, parent) { const siblings = parent ? parent.children : undefined // Generate a body row when without parent. const rowIndex = siblings ? siblings.indexOf(node) : 1 const tagName = rowIndex === 0 ? 'th' : 'td' const align = parent && parent.type === 'table' ? parent.align : undefined const length = align ? align.length : node.children.length let cellIndex = -1 /** @type {Array<ElementContent>} */ const cells = [] while (++cellIndex < length) { // Note: can also be undefined. const cell = node.children[cellIndex] /** @type {Properties} */ const properties = {} const alignValue = align ? align[cellIndex] : undefined if (alignValue) { properties.align = alignValue } /** @type {Element} */ let result = {type: 'element', tagName, properties, children: []} if (cell) { result.children = state.all(cell) state.patch(cell, result) result = state.applyData(node, result) } cells.push(result) } /** @type {Element} */ const result = { type: 'element', tagName: 'tr', properties: {}, children: state.wrap(cells, true) } state.patch(node, result) return state.applyData(node, result) } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/handlers/table.js": /*!****************************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/handlers/table.js ***! \****************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "table": () => (/* binding */ table) /* harmony export */ }); /* harmony import */ var unist_util_position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! unist-util-position */ "../node_modules/unist-util-position/lib/index.js"); /** * @typedef {import('hast').Element} Element * @typedef {import('mdast').Table} Table * @typedef {import('../state.js').State} State */ /** * Turn an mdast `table` node into hast. * * @param {State} state * Info passed around. * @param {Table} node * mdast node. * @returns {Element} * hast node. */ function table(state, node) { const rows = state.all(node) const firstRow = rows.shift() /** @type {Array<Element>} */ const tableContent = [] if (firstRow) { /** @type {Element} */ const head = { type: 'element', tagName: 'thead', properties: {}, children: state.wrap([firstRow], true) } state.patch(node.children[0], head) tableContent.push(head) } if (rows.length > 0) { /** @type {Element} */ const body = { type: 'element', tagName: 'tbody', properties: {}, children: state.wrap(rows, true) } const start = (0,unist_util_position__WEBPACK_IMPORTED_MODULE_0__.pointStart)(node.children[1]) const end = (0,unist_util_position__WEBPACK_IMPORTED_MODULE_0__.pointEnd)(node.children[node.children.length - 1]) if (start.line && end.line) body.position = {start, end} tableContent.push(body) } /** @type {Element} */ const result = { type: 'element', tagName: 'table', properties: {}, children: state.wrap(tableContent, true) } state.patch(node, result) return state.applyData(node, result) } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/handlers/text.js": /*!***************************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/handlers/text.js ***! \***************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "text": () => (/* binding */ text) /* harmony export */ }); /* harmony import */ var trim_lines__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! trim-lines */ "../node_modules/trim-lines/index.js"); /** * @typedef {import('hast').Element} HastElement * @typedef {import('hast').Text} HastText * @typedef {import('mdast').Text} MdastText * @typedef {import('../state.js').State} State */ /** * Turn an mdast `text` node into hast. * * @param {State} state * Info passed around. * @param {MdastText} node * mdast node. * @returns {HastText | HastElement} * hast node. */ function text(state, node) { /** @type {HastText} */ const result = {type: 'text', value: (0,trim_lines__WEBPACK_IMPORTED_MODULE_0__.trimLines)(String(node.value))} state.patch(node, result) return state.applyData(node, result) } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js": /*!*************************************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/handlers/thematic-break.js ***! \*************************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "thematicBreak": () => (/* binding */ thematicBreak) /* harmony export */ }); /** * @typedef {import('hast').Element} Element * @typedef {import('mdast').ThematicBreak} ThematicBreak * @typedef {import('../state.js').State} State */ /** * Turn an mdast `thematicBreak` node into hast. * * @param {State} state * Info passed around. * @param {ThematicBreak} node * mdast node. * @returns {Element} * hast node. */ function thematicBreak(state, node) { /** @type {Element} */ const result = { type: 'element', tagName: 'hr', properties: {}, children: [] } state.patch(node, result) return state.applyData(node, result) } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/index.js": /*!*******************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/index.js ***! \*******************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "toHast": () => (/* binding */ toHast) /* harmony export */ }); /* harmony import */ var _footer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./footer.js */ "../node_modules/mdast-util-to-hast/lib/footer.js"); /* harmony import */ var _state_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./state.js */ "../node_modules/mdast-util-to-hast/lib/state.js"); /** * @typedef {import('hast').Content} HastContent * @typedef {import('hast').Root} HastRoot * * @typedef {import('mdast').Content} MdastContent * @typedef {import('mdast').Root} MdastRoot * * @typedef {import('./state.js').Options} Options */ /** * @typedef {HastRoot | HastContent} HastNodes * @typedef {MdastRoot | MdastContent} MdastNodes */ /** * Transform mdast to hast. * * ##### Notes * * ###### HTML * * Raw HTML is available in mdast as `html` nodes and can be embedded in hast * as semistandard `raw` nodes. * Most utilities ignore `raw` nodes but two notable ones don’t: * * * `hast-util-to-html` also has an option `allowDangerousHtml` which will * output the raw HTML. * This is typically discouraged as noted by the option name but is useful * if you completely trust authors * * `hast-util-raw` can handle the raw embedded HTML strings by parsing them * into standard hast nodes (`element`, `text`, etc). * This is a heavy task as it needs a full HTML parser, but it is the only * way to support untrusted content * * ###### Footnotes * * Many options supported here relate to footnotes. * Footnotes are not specified by CommonMark, which we follow by default. * They are supported by GitHub, so footnotes can be enabled in markdown with * `mdast-util-gfm`. * * The options `footnoteBackLabel` and `footnoteLabel` define natural language * that explains footnotes, which is hidden for sighted users but shown to * assistive technology. * When your page is not in English, you must define translated values. * * Back references use ARIA attributes, but the section label itself uses a * heading that is hidden with an `sr-only` class. * To show it to sighted users, define different attributes in * `footnoteLabelProperties`. * * ###### Clobbering * * Footnotes introduces a problem, as it links footnote calls to footnote * definitions on the page through `id` attributes generated from user content, * which results in DOM clobbering. * * DOM clobbering is this: * * ```html * <p id=x></p> * <script>alert(x) // `x` now refers to the DOM `p#x` element</script> * ``` * * Elements by their ID are made available by browsers on the `window` object, * which is a security risk. * Using a prefix solves this problem. * * More information on how to handle clobbering and the prefix is explained in * Example: headings (DOM clobbering) in `rehype-sanitize`. * * ###### Unknown nodes * * Unknown nodes are nodes with a type that isn’t in `handlers` or `passThrough`. * The default behavior for unknown nodes is: * * * when the node has a `value` (and doesn’t have `data.hName`, * `data.hProperties`, or `data.hChildren`, see later), create a hast `text` * node * * otherwise, create a `<div>` element (which could be changed with * `data.hName`), with its children mapped from mdast to hast as well * * This behavior can be changed by passing an `unknownHandler`. * * @param {MdastNodes} tree * mdast tree. * @param {Options | null | undefined} [options] * Configuration. * @returns {HastNodes | null | undefined} * hast tree. */ // To do: next major: always return a single `root`. function toHast(tree, options) { const state = (0,_state_js__WEBPACK_IMPORTED_MODULE_0__.createState)(tree, options) const node = state.one(tree, null) const foot = (0,_footer_js__WEBPACK_IMPORTED_MODULE_1__.footer)(state) if (foot) { // @ts-expect-error If there’s a footer, there were definitions, meaning block // content. // So assume `node` is a parent node. node.children.push({type: 'text', value: '\n'}, foot) } // To do: next major: always return root? return Array.isArray(node) ? {type: 'root', children: node} : node } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/revert.js": /*!********************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/revert.js ***! \********************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "revert": () => (/* binding */ revert) /* harmony export */ }); /** * @typedef {import('hast').ElementContent} ElementContent * * @typedef {import('mdast').Content} Content * @typedef {import('mdast').Reference} Reference * @typedef {import('mdast').Root} Root * * @typedef {import('./state.js').State} State */ /** * @typedef {Root | Content} Nodes * @typedef {Extract<Nodes, Reference>} References */ // To do: next major: always return array. /** * Return the content of a reference without definition as plain text. * * @param {State} state * Info passed around. * @param {References} node * Reference node (image, link). * @returns {ElementContent | Array<ElementContent>} * hast content. */ function revert(state, node) { const subtype = node.referenceType let suffix = ']' if (subtype === 'collapsed') { suffix += '[]' } else if (subtype === 'full') { suffix += '[' + (node.label || node.identifier) + ']' } if (node.type === 'imageReference') { return {type: 'text', value: '![' + node.alt + suffix} } const contents = state.all(node) const head = contents[0] if (head && head.type === 'text') { head.value = '[' + head.value } else { contents.unshift({type: 'text', value: '['}) } const tail = contents[contents.length - 1] if (tail && tail.type === 'text') { tail.value += suffix } else { contents.push({type: 'text', value: suffix}) } return contents } /***/ }), /***/ "../node_modules/mdast-util-to-hast/lib/state.js": /*!*******************************************************!*\ !*** ../node_modules/mdast-util-to-hast/lib/state.js ***! \*******************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "all": () => (/* binding */ all), /* harmony export */ "createState": () => (/* binding */ createState), /* harmony export */ "one": () => (/* binding */ one), /* harmony export */ "wrap": () => (/* binding */ wrap) /* harmony export */ }); /* harmony import */ var unist_util_visit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! unist-util-visit */ "../node_modules/unist-util-visit/lib/index.js"); /* harmony import */ var unist_util_position__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! unist-util-position */ "../node_modules/unist-util-position/lib/index.js"); /* harmony import */ var unist_util_generated__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! unist-util-generated */ "../node_modules/unist-util-generated/lib/index.js"); /* harmony import */ var mdast_util_definitions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! mdast-util-definitions */ "../node_modules/mdast-util-definitions/lib/index.js"); /* harmony import */ var _handlers_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./handlers/index.js */ "../node_modules/mdast-util-to-hast/lib/handlers/index.js"); /** * @typedef {import('hast').Content} HastContent * @typedef {import('hast').Element} HastElement * @typedef {import('hast').ElementContent} HastElementContent * @typedef {import('hast').Properties} HastProperties * @typedef {import('hast').Root} HastRoot * @typedef {import('hast').Text} HastText * * @typedef {import('mdast').Content} MdastContent * @typedef {import('mdast').Definition} MdastDefinition * @typedef {import('mdast').FootnoteDefinition} MdastFootnoteDefinition * @typedef {import('mdast').Parent} MdastParent * @typedef {import('mdast').Root} MdastRoot */ /** * @typedef {HastRoot | HastContent} HastNodes * @typedef {MdastRoot | MdastContent} MdastNodes * @typedef {Extract<MdastNodes, MdastParent>} MdastParents * * @typedef EmbeddedHastFields * hast fields. * @property {string | null | undefined} [hName] * Generate a specific element with this tag name instead. * @property {HastProperties | null | undefined} [hProperties] * Generate an element with these properties instead. * @property {Array<HastElementContent> | null | undefined} [hChildren] * Generate an element with this content instead. * * @typedef {Record<string, unknown> & EmbeddedHastFields} MdastData * mdast data with embedded hast fields. * * @typedef {MdastNodes & {data?: MdastData | null | undefined}} MdastNodeWithData * mdast node with embedded hast data. * * @typedef PointLike * Point-like value. * @property {number | null | undefined} [line] * Line. * @property {number | null | undefined} [column] * Column. * @property {number | null | undefined} [offset] * Offset. * * @typedef PositionLike * Position-like value. * @property {PointLike | null | undefined} [start] * Point-like value. * @property {PointLike | null | undefined} [end] * Point-like value. * * @callback Handler * Handle a node. * @param {State} state * Info passed around. * @param {any} node * mdast node to handle. * @param {MdastParents | null | undefined} parent * Parent of `node`. * @returns {HastElementContent | Array<HastElementContent> | null | undefined} * hast node. * * @callback HFunctionProps * Signature of `state` for when props are passed. * @param {MdastNodes | PositionLike | null | undefined} node * mdast node or unist position. * @param {string} tagName * HTML tag name. * @param {HastProperties} props * Properties. * @param {Array<HastElementContent> | null | undefined} [children] * hast content. * @returns {HastElement} * Compiled element. * * @callback HFunctionNoProps * Signature of `state` for when no props are passed. * @param {MdastNodes | PositionLike | null | undefined} node * mdast node or unist position. * @param {string} tagName * HTML tag name. * @param {Array<HastElementContent> | null | undefined} [children] * hast content. * @returns {HastElement} * Compiled element. * * @typedef HFields * Info on `state`. * @property {boolean} dangerous * Whether HTML is allowed. * @property {string} clobberPrefix * Prefix to use to prevent DOM clobbering. * @property {string} footnoteLabel * Label to use to introduce the footnote section. * @property {string} footnoteLabelTagName * HTML used for the footnote label. * @property {HastProperties} footnoteLabelProperties * Properties on the HTML tag used for the footnote label. * @property {string} footnoteBackLabel * Label to use from backreferences back to their footnote call. * @property {(identifier: string) => MdastDefinition | null} definition * Definition cache. * @property {Record<string, MdastFootnoteDefinition>} footnoteById * Footnote definitions by their identifier. * @property {Array<string>} footnoteOrder * Identifiers of order when footnote calls first appear in tree order. * @property {Record<string, number>} footnoteCounts * Counts for how often the same footnote was called. * @property {Handlers} handlers * Applied handlers. * @property {Handler} unknownHandler * Handler for any none not in `passThrough` or otherwise handled. * @property {(from: MdastNodes, node: HastNodes) => void} patch * Copy a node’s positional info. * @property {<Type extends HastNodes>(from: MdastNodes, to: Type) => Type | HastElement} applyData * Honor the `data` of `from`, and generate an element instead of `node`. * @property {(node: MdastNodes, parent: MdastParents | null | undefined) => HastElementContent | Array<HastElementContent> | null | undefined} one * Transform an mdast node to hast. * @property {(node: MdastNodes) => Array<HastElementContent>} all * Transform the children of an mdast parent to hast. * @property {<Type extends HastContent>(nodes: Array<Type>, loose?: boolean | null | undefined) => Array<Type | HastText>} wrap * Wrap `nodes` with line endings between each node, adds initial/final line endings when `loose`. * @property {(left: MdastNodeWithData | PositionLike | null | undefined, right: HastElementContent) => HastElementContent} augment * Like `state` but lower-level and usable on non-elements. * Deprecated: use `patch` and `applyData`. * @property {Array<string>} passThrough * List of node types to pass through untouched (except for their children). * * @typedef Options * Configuration (optional). * @property {boolean | null | undefined} [allowDangerousHtml=false] * Whether to persist raw HTML in markdown in the hast tree. * @property {string | null | undefined} [clobberPrefix='user-content-'] * Prefix to use before the `id` attribute on footnotes to prevent it from * *clobbering*. * @property {string | null | undefined} [footnoteBackLabel='Back to content'] * Label to use from backreferences back to their footnote call (affects * screen readers). * @property {string | null | undefined} [footnoteLabel='Footnotes'] * Label to use for the footnotes section (affects screen readers). * @property {HastProperties | null | undefined} [footnoteLabelProperties={className: ['sr-only']}] * Properties to use on the footnote label (note that `id: 'footnote-label'` * is always added as footnote calls use it with `aria-describedby` to * provide an accessible label). * @property {string | null | undefined} [footnoteLabelTagName='h2'] * Tag name to use for the footnote label. * @property {Handlers | null | undefined} [handlers] * Extra handlers for nodes. * @property {Array<string> | null | undefined} [passThrough] * List of custom mdast node types to pass through (keep) in hast (note that * the node itself is passed, but eventual children are transformed). * @property {Handler | null | undefined} [unknownHandler] * Handler for all unknown nodes. * * @typedef {Record<string, Handler>} Handlers * Handle nodes. * * @typedef {HFunctionProps & HFunctionNoProps & HFields} State * Info passed around. */ const own = {}.hasOwnProperty /** * Create `state` from an mdast tree. * * @param {MdastNodes} tree * mdast node to transform. * @param {Options | null | undefined} [options] * Configuration. * @returns {State} * `state` function. */ function createState(tree, options) { const settings = options || {} const dangerous = settings.allowDangerousHtml || false /** @type {Record<string, MdastFootnoteDefinition>} */ const footnoteById = {} // To do: next major: add `options` to state, remove: // `dangerous`, `clobberPrefix`, `footnoteLabel`, `footnoteLabelTagName`, // `footnoteLabelProperties`, `footnoteBackLabel`, `passThrough`, // `unknownHandler`. // To do: next major: move to `state.options.allowDangerousHtml`. state.dangerous = dangerous // To do: next major: move to `state.options`. state.clobberPrefix = settings.clobberPrefix === undefined || settings.clobberPrefix === null ? 'user-content-' : settings.clobberPrefix // To do: next major: move to `state.options`. state.footnoteLabel = settings.footnoteLabel || 'Footnotes' // To do: next major: move to `state.options`. state.footnoteLabelTagName = settings.footnoteLabelTagName || 'h2' // To do: next major: move to `state.options`. state.footnoteLabelProperties = settings.footnoteLabelProperties || { className: ['sr-only'] } // To do: next major: move to `state.options`. state.footnoteBackLabel = settings.footnoteBackLabel || 'Back to content' // To do: next major: move to `state.options`. state.unknownHandler = settings.unknownHandler // To do: next major: move to `state.options`. state.passThrough = settings.passThrough state.handlers = {..._handlers_index_js__WEBPACK_IMPORTED_MODULE_0__.handlers, ...settings.handlers} // To do: next major: replace utility with `definitionById` object, so we // only walk once (as we need footnotes too). state.definition = (0,mdast_util_definitions__WEBPACK_IMPORTED_MODULE_1__.definitions)(tree) state.footnoteById = footnoteById /** @type {Array<string>} */ state.footnoteOrder = [] /** @type {Record<string, number>} */ state.footnoteCounts = {} state.patch = patch state.applyData = applyData state.one = oneBound state.all = allBound state.wrap = wrap // To do: next major: remove `augment`. state.augment = augment ;(0,unist_util_visit__WEBPACK_IMPORTED_MODULE_2__.visit)(tree, 'footnoteDefinition', (definition) => { const id = String(definition.identifier).toUpperCase() // Mimick CM behavior of link definitions. // See: <https://github.com/syntax-tree/mdast-util-definitions/blob/8290999/index.js#L26>. if (!own.call(footnoteById, id)) { footnoteById[id] = definition } }) // @ts-expect-error Hush, it’s fine! return state /** * Finalise the created `right`, a hast node, from `left`, an mdast node. * * @param {MdastNodeWithData | PositionLike | null | undefined} left * @param {HastElementContent} right * @returns {HastElementContent} */ /* c8 ignore start */ // To do: next major: remove. function augment(left, right) { // Handle `data.hName`, `data.hProperties, `data.hChildren`. if (left && 'data' in left && left.data) { /** @type {MdastData} */ const data = left.data if (data.hName) { if (right.type !== 'element') { right = { type: 'element', tagName: '', properties: {}, children: [] } } right.tagName = data.hName } if (right.type === 'element' && data.hProperties) { right.properties = {...right.properties, ...data.hProperties} } if ('children' in right && right.children && data.hChildren) { right.children = data.hChildren } } if (left) { const ctx = 'type' in left ? left : {position: left} if (!(0,unist_util_generated__WEBPACK_IMPORTED_MODULE_3__.generated)(ctx)) { // @ts-expect-error: fine. right.position = {start: (0,unist_util_position__WEBPACK_IMPORTED_MODULE_4__.pointStart)(ctx), end: (0,unist_util_position__WEBPACK_IMPORTED_MODULE_4__.pointEnd)(ctx)} } } return right } /* c8 ignore stop */ /** * Create an element for `node`. * * @type {HFunctionProps} */ /* c8 ignore start */ // To do: next major: remove. function state(node, tagName, props, children) { if (Array.isArray(props)) { children = props props = {} } // @ts-expect-error augmenting an element yields an element. return augment(node, { type: 'element', tagName, properties: props || {}, children: children || [] }) } /* c8 ignore stop */ /** * Transform an mdast node into a hast node. * * @param {MdastNodes} node * mdast node. * @param {MdastParents | null | undefined} [parent] * Parent of `node`. * @returns {HastElementContent | Array<HastElementContent> | null | undefined} * Resulting hast node. */ function oneBound(node, parent) { // @ts-expect-error: that’s a state :) return one(state, node, parent) } /** * Transform the children of an mdast node into hast nodes. * * @param {MdastNodes} parent * mdast node to compile * @returns {Array<HastElementContent>} * Resulting hast nodes. */ function allBound(parent) { // @ts-expect-error: that’s a state :) return all(state, parent) } } /** * Copy a node’s positional info. * * @param {MdastNodes} from * mdast node to copy from. * @param {HastNodes} to * hast node to copy into. * @returns {void} * Nothing. */ function patch(from, to) { if (from.position) to.position = (0,unist_util_position__WEBPACK_IMPORTED_MODULE_4__.position)(from) } /** * Honor the `data` of `from` and maybe generate an element instead of `to`. * * @template {HastNodes} Type * Node type. * @param {MdastNodes} from * mdast node to use data from. * @param {Type} to * hast node to change. * @returns {Type | HastElement} * Nothing. */ function applyData(from, to) { /** @type {Type | HastElement} */ let result = to // Handle `data.hName`, `data.hProperties, `data.hChildren`. if (from && from.data) { const hName = from.data.hName const hChildren = from.data.hChildren const hProperties = from.data.hProperties if (typeof hName === 'string') { // Transforming the node resulted in an element with a different name // than wanted: if (result.type === 'element') { result.tagName = hName } // Transforming the node resulted in a non-element, which happens for // raw, text, and root nodes (unless custom handlers are passed). // The intent is likely to keep the content around (otherwise: pass // `hChildren`). else { result = { type: 'element', tagName: hName, properties: {}, children: [] } // To do: next major: take the children from the `root`, or inject the // raw/text/comment or so into the element? // if ('children' in node) { // // @ts-expect-error: assume `children` are allowed in elements. // result.children = node.children // } else { // // @ts-expect-error: assume `node` is allowed in elements. // result.children.push(node) // } } } if (result.type === 'element' && hProperties) { result.properties = {...result.properties, ...hProperties} } if ( 'children' in result && result.children && hChildren !== null && hChildren !== undefined ) { // @ts-expect-error: assume valid children are defined. result.children = hChildren } } return result } /** * Transform an mdast node into a hast node. * * @param {State} state * Info passed around. * @param {MdastNodes} node * mdast node. * @param {MdastParents | null | undefined} [parent] * Parent of `node`. * @returns {HastElementContent | Array<HastElementContent> | null | undefined} * Resulting hast node. */ // To do: next major: do not expose, keep bound. function one(state, node, parent) { const type = node && node.type // Fail on non-nodes. if (!type) { throw new Error('Expected node, got `' + node + '`') } if (own.call(state.handlers, type)) { return state.handlers[type](state, node, parent) } if (state.passThrough && state.passThrough.includes(type)) { // To do: next major: deep clone. // @ts-expect-error: types of passed through nodes are expected to be added manually. return 'children' in node ? {...node, children: all(state, node)} : node } if (state.unknownHandler) { return state.unknownHandler(state, node, parent) } return defaultUnknownHandler(state, node) } /** * Transform the children of an mdast node into hast nodes. * * @param {State} state * Info passed around. * @param {MdastNodes} parent * mdast node to compile * @returns {Array<HastElementContent>} * Resulting hast nodes. */ // To do: next major: do not expose, keep bound. function all(state, parent) { /** @type {Array<HastElementContent>} */ const values = [] if ('children' in parent) { const nodes = parent.children let index = -1 while (++index < nodes.length) { const result = one(state, nodes[index], parent) // To do: see if we van clean this? Can we merge texts? if (result) { if (index && nodes[index - 1].type === 'break') { if (!Array.isArray(result) && result.type === 'text') { result.value = result.value.replace(/^\s+/, '') } if (!Array.isArray(result) && result.type === 'element') { const head = result.children[0] if (head && head.type === 'text') { head.value = head.value.replace(/^\s+/, '') } } } if (Array.isArray(result)) { values.push(...result) } else { values.push(result) } } } } return values } /** * Transform an unknown node. * * @param {State} state * Info passed around. * @param {MdastNodes} node * Unknown mdast node. * @returns {HastText | HastElement} * Resulting hast node. */ function defaultUnknownHandler(state, node) { const data = node.data || {} /** @type {HastText | HastElement} */ const result = 'value' in node && !(own.call(data, 'hProperties') || own.call(data, 'hChildren')) ? {type: 'text', value: node.value} : { type: 'element', tagName: 'div', properties: {}, children: all(state, node) } state.patch(node, result) return state.applyData(node, result) } /** * Wrap `nodes` with line endings between each node. * * @template {HastContent} Type * Node type. * @param {Array<Type>} nodes * List of nodes to wrap. * @param {boolean | null | undefined} [loose=false] * Whether to add line endings at start and end. * @returns {Array<Type | HastText>} * Wrapped nodes. */ function wrap(nodes, loose) { /** @type {Array<Type | HastText>} */ const result = [] let index = -1 if (loose) { result.push({type: 'text', value: '\n'}) } while (++index < nodes.length) { if (index) result.push({type: 'text', value: '\n'}) result.push(nodes[index]) } if (loose && nodes.length > 0) { result.push({type: 'text', value: '\n'}) } return result } /***/ }), /***/ "../node_modules/mdast-util-to-string/lib/index.js": /*!*********************************************************!*\ !*** ../node_modules/mdast-util-to-string/lib/index.js ***! \*********************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "toString": () => (/* binding */ toString) /* harmony export */ }); /** * @typedef {import('mdast').Root|import('mdast').Content} Node * * @typedef Options * Configuration (optional). * @property {boolean | null | undefined} [includeImageAlt=true] * Whether to use `alt` for `image`s. * @property {boolean | null | undefined} [includeHtml=true] * Whether to use `value` of HTML. */ /** @type {Options} */ const emptyOptions = {} /** * Get the text content of a node or list of nodes. * * Prefers the node’s plain-text fields, otherwise serializes its children, * and if the given value is an array, serialize the nodes in it. * * @param {unknown} value * Thing to serialize, typically `Node`. * @param {Options | null | undefined} [options] * Configuration (optional). * @returns {string} * Serialized `value`. */ function toString(value, options) { const settings = options || emptyOptions const includeImageAlt = typeof settings.includeImageAlt === 'boolean' ? settings.includeImageAlt : true const includeHtml = typeof settings.includeHtml === 'boolean' ? settings.includeHtml : true return one(value, includeImageAlt, includeHtml) } /** * One node or several nodes. * * @param {unknown} value * Thing to serialize. * @param {boolean} includeImageAlt * Include image `alt`s. * @param {boolean} includeHtml * Include HTML. * @returns {string} * Serialized node. */ function one(value, includeImageAlt, includeHtml) { if (node(value)) { if ('value' in value) { return value.type === 'html' && !includeHtml ? '' : value.value } if (includeImageAlt && 'alt' in value && value.alt) { return value.alt } if ('children' in value) { return all(value.children, includeImageAlt, includeHtml) } } if (Array.isArray(value)) { return all(value, includeImageAlt, includeHtml) } return '' } /** * Serialize a list of nodes. * * @param {Array<unknown>} values * Thing to serialize. * @param {boolean} includeImageAlt * Include image `alt`s. * @param {boolean} includeHtml * Include HTML. * @returns {string} * Serialized nodes. */ function all(values, includeImageAlt, includeHtml) { /** @type {Array<string>} */ const result = [] let index = -1 while (++index < values.length) { result[index] = one(values[index], includeImageAlt, includeHtml) } return result.join('') } /** * Check if `value` looks like a node. * * @param {unknown} value * Thing. * @returns {value is Node} * Whether `value` is a node. */ function node(value) { return Boolean(value && typeof value === 'object') } /***/ }), /***/ "../node_modules/micromark-core-commonmark/dev/lib/attention.js": /*!**********************************************************************!*\ !*** ../node_modules/micromark-core-commonmark/dev/lib/attention.js ***! \**********************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "attention": () => (/* binding */ attention) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-chunked */ "../node_modules/micromark-util-chunked/dev/index.js"); /* harmony import */ var micromark_util_classify_character__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-classify-character */ "../node_modules/micromark-util-classify-character/dev/index.js"); /* harmony import */ var micromark_util_resolve_all__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-resolve-all */ "../node_modules/micromark-util-resolve-all/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /** * @typedef {import('micromark-util-types').Construct} Construct * @typedef {import('micromark-util-types').Tokenizer} Tokenizer * @typedef {import('micromark-util-types').Resolver} Resolver * @typedef {import('micromark-util-types').State} State * @typedef {import('micromark-util-types').Token} Token * @typedef {import('micromark-util-types').Event} Event * @typedef {import('micromark-util-types').Code} Code * @typedef {import('micromark-util-types').Point} Point */ /** @type {Construct} */ const attention = { name: 'attention', tokenize: tokenizeAttention, resolveAll: resolveAllAttention } /** * Take all events and resolve attention to emphasis or strong. * * @type {Resolver} */ function resolveAllAttention(events, context) { let index = -1 /** @type {number} */ let open /** @type {Token} */ let group /** @type {Token} */ let text /** @type {Token} */ let openingSequence /** @type {Token} */ let closingSequence /** @type {number} */ let use /** @type {Event[]} */ let nextEvents /** @type {number} */ let offset // Walk through all events. // // Note: performance of this is fine on an mb of normal markdown, but it’s // a bottleneck for malicious stuff. while (++index < events.length) { // Find a token that can close. if ( events[index][0] === 'enter' && events[index][1].type === 'attentionSequence' && events[index][1]._close ) { open = index // Now walk back to find an opener. while (open--) { // Find a token that can open the closer. if ( events[open][0] === 'exit' && events[open][1].type === 'attentionSequence' && events[open][1]._open && // If the markers are the same: context.sliceSerialize(events[open][1]).charCodeAt(0) === context.sliceSerialize(events[index][1]).charCodeAt(0) ) { // If the opening can close or the closing can open, // and the close size *is not* a multiple of three, // but the sum of the opening and closing size *is* multiple of three, // then don’t match. if ( (events[open][1]._close || events[index][1]._open) && (events[index][1].end.offset - events[index][1].start.offset) % 3 && !( (events[open][1].end.offset - events[open][1].start.offset + events[index][1].end.offset - events[index][1].start.offset) % 3 ) ) { continue } // Number of markers to use from the sequence. use = events[open][1].end.offset - events[open][1].start.offset > 1 && events[index][1].end.offset - events[index][1].start.offset > 1 ? 2 : 1 const start = Object.assign({}, events[open][1].end) const end = Object.assign({}, events[index][1].start) movePoint(start, -use) movePoint(end, use) openingSequence = { type: use > 1 ? micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.strongSequence : micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.emphasisSequence, start, end: Object.assign({}, events[open][1].end) } closingSequence = { type: use > 1 ? micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.strongSequence : micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.emphasisSequence, start: Object.assign({}, events[index][1].start), end } text = { type: use > 1 ? micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.strongText : micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.emphasisText, start: Object.assign({}, events[open][1].end), end: Object.assign({}, events[index][1].start) } group = { type: use > 1 ? micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.strong : micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.emphasis, start: Object.assign({}, openingSequence.start), end: Object.assign({}, closingSequence.end) } events[open][1].end = Object.assign({}, openingSequence.start) events[index][1].start = Object.assign({}, closingSequence.end) nextEvents = [] // If there are more markers in the opening, add them before. if (events[open][1].end.offset - events[open][1].start.offset) { nextEvents = (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.push)(nextEvents, [ ['enter', events[open][1], context], ['exit', events[open][1], context] ]) } // Opening. nextEvents = (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.push)(nextEvents, [ ['enter', group, context], ['enter', openingSequence, context], ['exit', openingSequence, context], ['enter', text, context] ]) // Between. nextEvents = (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.push)( nextEvents, (0,micromark_util_resolve_all__WEBPACK_IMPORTED_MODULE_3__.resolveAll)( context.parser.constructs.insideSpan.null, events.slice(open + 1, index), context ) ) // Closing. nextEvents = (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.push)(nextEvents, [ ['exit', text, context], ['enter', closingSequence, context], ['exit', closingSequence, context], ['exit', group, context] ]) // If there are more markers in the closing, add them after. if (events[index][1].end.offset - events[index][1].start.offset) { offset = 2 nextEvents = (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.push)(nextEvents, [ ['enter', events[index][1], context], ['exit', events[index][1], context] ]) } else { offset = 0 } (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.splice)(events, open - 1, index - open + 3, nextEvents) index = open + nextEvents.length - offset - 2 break } } } } // Remove remaining sequences. index = -1 while (++index < events.length) { if (events[index][1].type === 'attentionSequence') { events[index][1].type = 'data' } } return events } /** @type {Tokenizer} */ function tokenizeAttention(effects, ok) { const attentionMarkers = this.parser.constructs.attentionMarkers.null const previous = this.previous const before = (0,micromark_util_classify_character__WEBPACK_IMPORTED_MODULE_4__.classifyCharacter)(previous) /** @type {NonNullable<Code>} */ let marker return start /** @type {State} */ function start(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_5__.codes.asterisk || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_5__.codes.underscore, 'expected asterisk or underscore' ) effects.enter('attentionSequence') marker = code return sequence(code) } /** @type {State} */ function sequence(code) { if (code === marker) { effects.consume(code) return sequence } const token = effects.exit('attentionSequence') const after = (0,micromark_util_classify_character__WEBPACK_IMPORTED_MODULE_4__.classifyCharacter)(code) const open = !after || (after === micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_6__.constants.characterGroupPunctuation && before) || attentionMarkers.includes(code) const close = !before || (before === micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_6__.constants.characterGroupPunctuation && after) || attentionMarkers.includes(previous) token._open = Boolean( marker === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_5__.codes.asterisk ? open : open && (before || !close) ) token._close = Boolean( marker === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_5__.codes.asterisk ? close : close && (after || !open) ) return ok(code) } } /** * Move a point a bit. * * Note: `move` only works inside lines! It’s not possible to move past other * chunks (replacement characters, tabs, or line endings). * * @param {Point} point * @param {number} offset * @returns {void} */ function movePoint(point, offset) { point.column += offset point.offset += offset point._bufferIndex += offset } /***/ }), /***/ "../node_modules/micromark-core-commonmark/dev/lib/autolink.js": /*!*********************************************************************!*\ !*** ../node_modules/micromark-core-commonmark/dev/lib/autolink.js ***! \*********************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "autolink": () => (/* binding */ autolink) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /** * @typedef {import('micromark-util-types').Construct} Construct * @typedef {import('micromark-util-types').Tokenizer} Tokenizer * @typedef {import('micromark-util-types').State} State */ /** @type {Construct} */ const autolink = {name: 'autolink', tokenize: tokenizeAutolink} /** @type {Tokenizer} */ function tokenizeAutolink(effects, ok, nok) { let size = 1 return start /** @type {State} */ function start(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.lessThan, 'expected `<`') effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.autolink) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.autolinkMarker) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.autolinkMarker) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.autolinkProtocol) return open } /** @type {State} */ function open(code) { if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAlpha)(code)) { effects.consume(code) return schemeOrEmailAtext } return (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAtext)(code) ? emailAtext(code) : nok(code) } /** @type {State} */ function schemeOrEmailAtext(code) { return code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.plusSign || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dash || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dot || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAlphanumeric)(code) ? schemeInsideOrEmailAtext(code) : emailAtext(code) } /** @type {State} */ function schemeInsideOrEmailAtext(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.colon) { effects.consume(code) return urlInside } if ( (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.plusSign || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dash || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dot || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAlphanumeric)(code)) && size++ < micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_4__.constants.autolinkSchemeSizeMax ) { effects.consume(code) return schemeInsideOrEmailAtext } return emailAtext(code) } /** @type {State} */ function urlInside(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.autolinkProtocol) return end(code) } if ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.space || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.lessThan || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiControl)(code) ) { return nok(code) } effects.consume(code) return urlInside } /** @type {State} */ function emailAtext(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.atSign) { effects.consume(code) size = 0 return emailAtSignOrDot } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAtext)(code)) { effects.consume(code) return emailAtext } return nok(code) } /** @type {State} */ function emailAtSignOrDot(code) { return (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAlphanumeric)(code) ? emailLabel(code) : nok(code) } /** @type {State} */ function emailLabel(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dot) { effects.consume(code) size = 0 return emailAtSignOrDot } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan) { // Exit, then change the type. effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.autolinkProtocol).type = micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.autolinkEmail return end(code) } return emailValue(code) } /** @type {State} */ function emailValue(code) { if ( (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dash || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAlphanumeric)(code)) && size++ < micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_4__.constants.autolinkDomainSizeMax ) { effects.consume(code) return code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dash ? emailValue : emailLabel } return nok(code) } /** @type {State} */ function end(code) { (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan, 'expected `>`') effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.autolinkMarker) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.autolinkMarker) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.autolink) return ok } } /***/ }), /***/ "../node_modules/micromark-core-commonmark/dev/lib/blank-line.js": /*!***********************************************************************!*\ !*** ../node_modules/micromark-core-commonmark/dev/lib/blank-line.js ***! \***********************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "blankLine": () => (/* binding */ blankLine) /* harmony export */ }); /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js"); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /** * @typedef {import('micromark-util-types').Construct} Construct * @typedef {import('micromark-util-types').Tokenizer} Tokenizer * @typedef {import('micromark-util-types').State} State */ /** @type {Construct} */ const blankLine = {tokenize: tokenizeBlankLine, partial: true} /** @type {Tokenizer} */ function tokenizeBlankLine(effects, ok, nok) { return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_0__.factorySpace)(effects, afterWhitespace, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.linePrefix) /** @type {State} */ function afterWhitespace(code) { return code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code) ? ok(code) : nok(code) } } /***/ }), /***/ "../node_modules/micromark-core-commonmark/dev/lib/block-quote.js": /*!************************************************************************!*\ !*** ../node_modules/micromark-core-commonmark/dev/lib/block-quote.js ***! \************************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "blockQuote": () => (/* binding */ blockQuote) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js"); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /** * @typedef {import('micromark-util-types').Construct} Construct * @typedef {import('micromark-util-types').Tokenizer} Tokenizer * @typedef {import('micromark-util-types').Exiter} Exiter * @typedef {import('micromark-util-types').State} State */ /** @type {Construct} */ const blockQuote = { name: 'blockQuote', tokenize: tokenizeBlockQuoteStart, continuation: {tokenize: tokenizeBlockQuoteContinuation}, exit } /** @type {Tokenizer} */ function tokenizeBlockQuoteStart(effects, ok, nok) { const self = this return start /** @type {State} */ function start(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan) { const state = self.containerState ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(state, 'expected `containerState` to be defined in container') if (!state.open) { effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.blockQuote, {_container: true}) state.open = true } effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.blockQuotePrefix) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.blockQuoteMarker) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.blockQuoteMarker) return after } return nok(code) } /** @type {State} */ function after(code) { if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownSpace)(code)) { effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.blockQuotePrefixWhitespace) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.blockQuotePrefixWhitespace) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.blockQuotePrefix) return ok } effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.blockQuotePrefix) return ok(code) } } /** @type {Tokenizer} */ function tokenizeBlockQuoteContinuation(effects, ok, nok) { return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__.factorySpace)( effects, effects.attempt(blockQuote, ok, nok), micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.linePrefix, this.parser.constructs.disable.null.includes('codeIndented') ? undefined : micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__.constants.tabSize ) } /** @type {Exiter} */ function exit(effects) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.blockQuote) } /***/ }), /***/ "../node_modules/micromark-core-commonmark/dev/lib/character-escape.js": /*!*****************************************************************************!*\ !*** ../node_modules/micromark-core-commonmark/dev/lib/character-escape.js ***! \*****************************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "characterEscape": () => (/* binding */ characterEscape) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /** * @typedef {import('micromark-util-types').Construct} Construct * @typedef {import('micromark-util-types').Tokenizer} Tokenizer * @typedef {import('micromark-util-types').State} State */ /** @type {Construct} */ const characterEscape = { name: 'characterEscape', tokenize: tokenizeCharacterEscape } /** @type {Tokenizer} */ function tokenizeCharacterEscape(effects, ok, nok) { return start /** @type {State} */ function start(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.backslash, 'expected `\\`') effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterEscape) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.escapeMarker) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.escapeMarker) return open } /** @type {State} */ function open(code) { if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiPunctuation)(code)) { effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterEscapeValue) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterEscapeValue) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterEscape) return ok } return nok(code) } } /***/ }), /***/ "../node_modules/micromark-core-commonmark/dev/lib/character-reference.js": /*!********************************************************************************!*\ !*** ../node_modules/micromark-core-commonmark/dev/lib/character-reference.js ***! \********************************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "characterReference": () => (/* binding */ characterReference) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var decode_named_character_reference__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! decode-named-character-reference */ "../node_modules/decode-named-character-reference/index.dom.js"); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /** * @typedef {import('micromark-util-types').Construct} Construct * @typedef {import('micromark-util-types').Tokenizer} Tokenizer * @typedef {import('micromark-util-types').Token} Token * @typedef {import('micromark-util-types').State} State * @typedef {import('micromark-util-types').Code} Code */ /** @type {Construct} */ const characterReference = { name: 'characterReference', tokenize: tokenizeCharacterReference } /** @type {Tokenizer} */ function tokenizeCharacterReference(effects, ok, nok) { const self = this let size = 0 /** @type {number} */ let max /** @type {(code: Code) => code is number} */ let test return start /** @type {State} */ function start(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.ampersand, 'expected `&`') effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReference) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReferenceMarker) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReferenceMarker) return open } /** @type {State} */ function open(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.numberSign) { effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReferenceMarkerNumeric) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReferenceMarkerNumeric) return numeric } effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReferenceValue) max = micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.characterReferenceNamedSizeMax test = micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.asciiAlphanumeric return value(code) } /** @type {State} */ function numeric(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.uppercaseX || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.lowercaseX) { effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReferenceMarkerHexadecimal) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReferenceMarkerHexadecimal) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReferenceValue) max = micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.characterReferenceHexadecimalSizeMax test = micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.asciiHexDigit return value } effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReferenceValue) max = micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.characterReferenceDecimalSizeMax test = micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.asciiDigit return value(code) } /** @type {State} */ function value(code) { /** @type {Token} */ let token if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.semicolon && size) { token = effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReferenceValue) if ( test === micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.asciiAlphanumeric && !(0,decode_named_character_reference__WEBPACK_IMPORTED_MODULE_5__.decodeNamedCharacterReference)(self.sliceSerialize(token)) ) { return nok(code) } effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReferenceMarker) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReferenceMarker) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.characterReference) return ok } if (test(code) && size++ < max) { effects.consume(code) return value } return nok(code) } } /***/ }), /***/ "../node_modules/micromark-core-commonmark/dev/lib/code-fenced.js": /*!************************************************************************!*\ !*** ../node_modules/micromark-core-commonmark/dev/lib/code-fenced.js ***! \************************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "codeFenced": () => (/* binding */ codeFenced) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js"); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /** * @typedef {import('micromark-util-types').Construct} Construct * @typedef {import('micromark-util-types').Tokenizer} Tokenizer * @typedef {import('micromark-util-types').State} State * @typedef {import('micromark-util-types').Code} Code */ /** @type {Construct} */ const codeFenced = { name: 'codeFenced', tokenize: tokenizeCodeFenced, concrete: true } /** @type {Tokenizer} */ function tokenizeCodeFenced(effects, ok, nok) { const self = this /** @type {Construct} */ const closingFenceConstruct = {tokenize: tokenizeClosingFence, partial: true} /** @type {Construct} */ const nonLazyLine = {tokenize: tokenizeNonLazyLine, partial: true} const tail = this.events[this.events.length - 1] const initialPrefix = tail && tail[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.linePrefix ? tail[2].sliceSerialize(tail[1], true).length : 0 let sizeOpen = 0 /** @type {NonNullable<Code>} */ let marker return start /** @type {State} */ function start(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.graveAccent || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.tilde, 'expected `` ` `` or `~`' ) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFenced) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFencedFence) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFencedFenceSequence) marker = code return sequenceOpen(code) } /** @type {State} */ function sequenceOpen(code) { if (code === marker) { effects.consume(code) sizeOpen++ return sequenceOpen } effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFencedFenceSequence) return sizeOpen < micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.codeFencedSequenceSizeMin ? nok(code) : (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__.factorySpace)(effects, infoOpen, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.whitespace)(code) } /** @type {State} */ function infoOpen(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownLineEnding)(code)) { return openAfter(code) } effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFencedFenceInfo) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.chunkString, {contentType: micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.contentTypeString}) return info(code) } /** @type {State} */ function info(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownLineEndingOrSpace)(code)) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.chunkString) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFencedFenceInfo) return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__.factorySpace)(effects, infoAfter, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.whitespace)(code) } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.graveAccent && code === marker) return nok(code) effects.consume(code) return info } /** @type {State} */ function infoAfter(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownLineEnding)(code)) { return openAfter(code) } effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFencedFenceMeta) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.chunkString, {contentType: micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.contentTypeString}) return meta(code) } /** @type {State} */ function meta(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownLineEnding)(code)) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.chunkString) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFencedFenceMeta) return openAfter(code) } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.graveAccent && code === marker) return nok(code) effects.consume(code) return meta } /** @type {State} */ function openAfter(code) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFencedFence) return self.interrupt ? ok(code) : contentStart(code) } /** @type {State} */ function contentStart(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof) { return after(code) } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownLineEnding)(code)) { return effects.attempt( nonLazyLine, effects.attempt( closingFenceConstruct, after, initialPrefix ? (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__.factorySpace)( effects, contentStart, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.linePrefix, initialPrefix + 1 ) : contentStart ), after )(code) } effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFlowValue) return contentContinue(code) } /** @type {State} */ function contentContinue(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownLineEnding)(code)) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFlowValue) return contentStart(code) } effects.consume(code) return contentContinue } /** @type {State} */ function after(code) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFenced) return ok(code) } /** @type {Tokenizer} */ function tokenizeNonLazyLine(effects, ok, nok) { const self = this return start /** @type {State} */ function start(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownLineEnding)(code), 'expected eol') effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding) return lineStart } /** @type {State} */ function lineStart(code) { return self.parser.lazy[self.now().line] ? nok(code) : ok(code) } } /** @type {Tokenizer} */ function tokenizeClosingFence(effects, ok, nok) { let size = 0 return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__.factorySpace)( effects, closingSequenceStart, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.linePrefix, this.parser.constructs.disable.null.includes('codeIndented') ? undefined : micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.tabSize ) /** @type {State} */ function closingSequenceStart(code) { effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFencedFence) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFencedFenceSequence) return closingSequence(code) } /** @type {State} */ function closingSequence(code) { if (code === marker) { effects.consume(code) size++ return closingSequence } if (size < sizeOpen) return nok(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFencedFenceSequence) return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__.factorySpace)(effects, closingSequenceEnd, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.whitespace)(code) } /** @type {State} */ function closingSequenceEnd(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownLineEnding)(code)) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeFencedFence) return ok(code) } return nok(code) } } } /***/ }), /***/ "../node_modules/micromark-core-commonmark/dev/lib/code-indented.js": /*!**************************************************************************!*\ !*** ../node_modules/micromark-core-commonmark/dev/lib/code-indented.js ***! \**************************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "codeIndented": () => (/* binding */ codeIndented) /* harmony export */ }); /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js"); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /** * @typedef {import('micromark-util-types').Construct} Construct * @typedef {import('micromark-util-types').Tokenizer} Tokenizer * @typedef {import('micromark-util-types').Resolver} Resolver * @typedef {import('micromark-util-types').Token} Token * @typedef {import('micromark-util-types').State} State */ /** @type {Construct} */ const codeIndented = { name: 'codeIndented', tokenize: tokenizeCodeIndented } /** @type {Construct} */ const indentedContent = {tokenize: tokenizeIndentedContent, partial: true} /** @type {Tokenizer} */ function tokenizeCodeIndented(effects, ok, nok) { const self = this return start /** @type {State} */ function start(code) { effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_0__.types.codeIndented) return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_1__.factorySpace)( effects, afterStartPrefix, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_0__.types.linePrefix, micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.tabSize + 1 )(code) } /** @type {State} */ function afterStartPrefix(code) { const tail = self.events[self.events.length - 1] return tail && tail[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_0__.types.linePrefix && tail[2].sliceSerialize(tail[1], true).length >= micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.tabSize ? afterPrefix(code) : nok(code) } /** @type {State} */ function afterPrefix(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_3__.codes.eof) { return after(code) } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEnding)(code)) { return effects.attempt(indentedContent, afterPrefix, after)(code) } effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_0__.types.codeFlowValue) return content(code) } /** @type {State} */ function content(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_3__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEnding)(code)) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_0__.types.codeFlowValue) return afterPrefix(code) } effects.consume(code) return content } /** @type {State} */ function after(code) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_0__.types.codeIndented) return ok(code) } } /** @type {Tokenizer} */ function tokenizeIndentedContent(effects, ok, nok) { const self = this return start /** @type {State} */ function start(code) { // If this is a lazy line, it can’t be code. if (self.parser.lazy[self.now().line]) { return nok(code) } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEnding)(code)) { effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_0__.types.lineEnding) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_0__.types.lineEnding) return start } return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_1__.factorySpace)( effects, afterPrefix, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_0__.types.linePrefix, micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.tabSize + 1 )(code) } /** @type {State} */ function afterPrefix(code) { const tail = self.events[self.events.length - 1] return tail && tail[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_0__.types.linePrefix && tail[2].sliceSerialize(tail[1], true).length >= micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.tabSize ? ok(code) : (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEnding)(code) ? start(code) : nok(code) } } /***/ }), /***/ "../node_modules/micromark-core-commonmark/dev/lib/code-text.js": /*!**********************************************************************!*\ !*** ../node_modules/micromark-core-commonmark/dev/lib/code-text.js ***! \**********************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "codeText": () => (/* binding */ codeText) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /** * @typedef {import('micromark-util-types').Construct} Construct * @typedef {import('micromark-util-types').Resolver} Resolver * @typedef {import('micromark-util-types').Tokenizer} Tokenizer * @typedef {import('micromark-util-types').Previous} Previous * @typedef {import('micromark-util-types').Token} Token * @typedef {import('micromark-util-types').State} State */ /** @type {Construct} */ const codeText = { name: 'codeText', tokenize: tokenizeCodeText, resolve: resolveCodeText, previous } /** @type {Resolver} */ function resolveCodeText(events) { let tailExitIndex = events.length - 4 let headEnterIndex = 3 /** @type {number} */ let index /** @type {number|undefined} */ let enter // If we start and end with an EOL or a space. if ( (events[headEnterIndex][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding || events[headEnterIndex][1].type === 'space') && (events[tailExitIndex][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding || events[tailExitIndex][1].type === 'space') ) { index = headEnterIndex // And we have data. while (++index < tailExitIndex) { if (events[index][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeTextData) { // Then we have padding. events[headEnterIndex][1].type = micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeTextPadding events[tailExitIndex][1].type = micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeTextPadding headEnterIndex += 2 tailExitIndex -= 2 break } } } // Merge adjacent spaces and data. index = headEnterIndex - 1 tailExitIndex++ while (++index <= tailExitIndex) { if (enter === undefined) { if ( index !== tailExitIndex && events[index][1].type !== micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding ) { enter = index } } else if ( index === tailExitIndex || events[index][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding ) { events[enter][1].type = micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeTextData if (index !== enter + 2) { events[enter][1].end = events[index - 1][1].end events.splice(enter + 2, index - enter - 2) tailExitIndex -= index - enter - 2 index = enter + 2 } enter = undefined } } return events } /** @type {Previous} */ function previous(code) { // If there is a previous code, there will always be a tail. return ( code !== micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.graveAccent || this.events[this.events.length - 1][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.characterEscape ) } /** @type {Tokenizer} */ function tokenizeCodeText(effects, ok, nok) { const self = this let sizeOpen = 0 /** @type {number} */ let size /** @type {Token} */ let token return start /** @type {State} */ function start(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.graveAccent, 'expected `` ` ``') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(previous.call(self, self.previous), 'expected correct previous') effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeText) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeTextSequence) return openingSequence(code) } /** @type {State} */ function openingSequence(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.graveAccent) { effects.consume(code) sizeOpen++ return openingSequence } effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeTextSequence) return gap(code) } /** @type {State} */ function gap(code) { // EOF. if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof) { return nok(code) } // Closing fence? // Could also be data. if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.graveAccent) { token = effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeTextSequence) size = 0 return closingSequence(code) } // Tabs don’t work, and virtual spaces don’t make sense. if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.space) { effects.enter('space') effects.consume(code) effects.exit('space') return gap } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) { effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding) return gap } // Data. effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeTextData) return data(code) } // In code. /** @type {State} */ function data(code) { if ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.space || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.graveAccent || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code) ) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeTextData) return gap(code) } effects.consume(code) return data } // Closing fence. /** @type {State} */ function closingSequence(code) { // More. if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.graveAccent) { effects.consume(code) size++ return closingSequence } // Done! if (size === sizeOpen) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeTextSequence) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeText) return ok(code) } // More or less accents: mark as data. token.type = micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.codeTextData return data(code) } } /***/ }), /***/ "../node_modules/micromark-core-commonmark/dev/lib/content.js": /*!********************************************************************!*\ !*** ../node_modules/micromark-core-commonmark/dev/lib/content.js ***! \********************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "content": () => (/* binding */ content) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js"); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_subtokenize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-subtokenize */ "../node_modules/micromark-util-subtokenize/dev/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /** * @typedef {import('micromark-util-types').Construct} Construct * @typedef {import('micromark-util-types').Resolver} Resolver * @typedef {import('micromark-util-types').Tokenizer} Tokenizer * @typedef {import('micromark-util-types').Token} Token * @typedef {import('micromark-util-types').State} State */ /** * No name because it must not be turned off. * @type {Construct} */ const content = {tokenize: tokenizeContent, resolve: resolveContent} /** @type {Construct} */ const continuationConstruct = {tokenize: tokenizeContinuation, partial: true} /** * Content is transparent: it’s parsed right now. That way, definitions are also * parsed right now: before text in paragraphs (specifically, media) are parsed. * * @type {Resolver} */ function resolveContent(events) { ;(0,micromark_util_subtokenize__WEBPACK_IMPORTED_MODULE_1__.subtokenize)(events) return events } /** @type {Tokenizer} */ function tokenizeContent(effects, ok) { /** @type {Token} */ let previous return start /** @type {State} */ function start(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( code !== micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof && !(0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code), 'expected no eof or eol' ) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.content) previous = effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.chunkContent, { contentType: micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__.constants.contentTypeContent }) return data(code) } /** @type {State} */ function data(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof) { return contentEnd(code) } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) { return effects.check( continuationConstruct, contentContinue, contentEnd )(code) } // Data. effects.consume(code) return data } /** @type {State} */ function contentEnd(code) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.chunkContent) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.content) return ok(code) } /** @type {State} */ function contentContinue(code) { (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code), 'expected eol') effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.chunkContent) previous.next = effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.chunkContent, { contentType: micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__.constants.contentTypeContent, previous }) previous = previous.next return data } } /** @type {Tokenizer} */ function tokenizeContinuation(effects, ok, nok) { const self = this return startLookahead /** @type {State} */ function startLookahead(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code), 'expected a line ending') effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.chunkContent) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.lineEnding) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.lineEnding) return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_6__.factorySpace)(effects, prefixed, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.linePrefix) } /** @type {State} */ function prefixed(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) { return nok(code) } const tail = self.events[self.events.length - 1] if ( !self.parser.constructs.disable.null.includes('codeIndented') && tail && tail[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.linePrefix && tail[2].sliceSerialize(tail[1], true).length >= micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__.constants.tabSize ) { return ok(code) } return effects.interrupt(self.parser.constructs.flow, nok, ok)(code) } } /***/ }), /***/ "../node_modules/micromark-core-commonmark/dev/lib/definition.js": /*!***********************************************************************!*\ !*** ../node_modules/micromark-core-commonmark/dev/lib/definition.js ***! \***********************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "definition": () => (/* binding */ definition) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var micromark_factory_destination__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! micromark-factory-destination */ "../node_modules/micromark-factory-destination/dev/index.js"); /* harmony import */ var micromark_factory_label__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-factory-label */ "../node_modules/micromark-factory-label/dev/index.js"); /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js"); /* harmony import */ var micromark_factory_title__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! micromark-factory-title */ "../node_modules/micromark-factory-title/dev/index.js"); /* harmony import */ var micromark_factory_whitespace__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-factory-whitespace */ "../node_modules/micromark-factory-whitespace/dev/index.js"); /* harmony import */ var micromark_util_normalize_identifier__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-normalize-identifier */ "../node_modules/micromark-util-normalize-identifier/dev/index.js"); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /** * @typedef {import('micromark-util-types').Construct} Construct * @typedef {import('micromark-util-types').Tokenizer} Tokenizer * @typedef {import('micromark-util-types').State} State */ /** @type {Construct} */ const definition = {name: 'definition', tokenize: tokenizeDefinition} /** @type {Construct} */ const titleConstruct = {tokenize: tokenizeTitle, partial: true} /** @type {Tokenizer} */ function tokenizeDefinition(effects, ok, nok) { const self = this /** @type {string} */ let identifier return start /** @type {State} */ function start(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.leftSquareBracket, 'expected `[`') effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definition) return micromark_factory_label__WEBPACK_IMPORTED_MODULE_3__.factoryLabel.call( self, effects, labelAfter, nok, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definitionLabel, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definitionLabelMarker, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definitionLabelString )(code) } /** @type {State} */ function labelAfter(code) { identifier = (0,micromark_util_normalize_identifier__WEBPACK_IMPORTED_MODULE_4__.normalizeIdentifier)( self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1) ) if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.colon) { effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definitionMarker) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definitionMarker) // Note: blank lines can’t exist in content. return (0,micromark_factory_whitespace__WEBPACK_IMPORTED_MODULE_5__.factoryWhitespace)( effects, (0,micromark_factory_destination__WEBPACK_IMPORTED_MODULE_6__.factoryDestination)( effects, effects.attempt( titleConstruct, (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_7__.factorySpace)(effects, after, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.whitespace), (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_7__.factorySpace)(effects, after, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.whitespace) ), nok, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definitionDestination, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definitionDestinationLiteral, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definitionDestinationLiteralMarker, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definitionDestinationRaw, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definitionDestinationString ) ) } return nok(code) } /** @type {State} */ function after(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_8__.markdownLineEnding)(code)) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definition) if (!self.parser.defined.includes(identifier)) { self.parser.defined.push(identifier) } return ok(code) } return nok(code) } } /** @type {Tokenizer} */ function tokenizeTitle(effects, ok, nok) { return start /** @type {State} */ function start(code) { return (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_8__.markdownLineEndingOrSpace)(code) ? (0,micromark_factory_whitespace__WEBPACK_IMPORTED_MODULE_5__.factoryWhitespace)(effects, before)(code) : nok(code) } /** @type {State} */ function before(code) { if ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.quotationMark || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.apostrophe || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.leftParenthesis ) { return (0,micromark_factory_title__WEBPACK_IMPORTED_MODULE_9__.factoryTitle)( effects, (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_7__.factorySpace)(effects, after, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.whitespace), nok, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definitionTitle, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definitionTitleMarker, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.definitionTitleString )(code) } return nok(code) } /** @type {State} */ function after(code) { return code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_8__.markdownLineEnding)(code) ? ok(code) : nok(code) } } /***/ }), /***/ "../node_modules/micromark-core-commonmark/dev/lib/hard-break-escape.js": /*!******************************************************************************!*\ !*** ../node_modules/micromark-core-commonmark/dev/lib/hard-break-escape.js ***! \******************************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "hardBreakEscape": () => (/* binding */ hardBreakEscape) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /** * @typedef {import('micromark-util-types').Construct} Construct * @typedef {import('micromark-util-types').Tokenizer} Tokenizer * @typedef {import('micromark-util-types').State} State */ /** @type {Construct} */ const hardBreakEscape = { name: 'hardBreakEscape', tokenize: tokenizeHardBreakEscape } /** @type {Tokenizer} */ function tokenizeHardBreakEscape(effects, ok, nok) { return start /** @type {State} */ function start(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.backslash, 'expected `\\`') effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.hardBreakEscape) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.escapeMarker) effects.consume(code) return open } /** @type {State} */ function open(code) { if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.escapeMarker) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.hardBreakEscape) return ok(code) } return nok(code) } } /***/ }), /***/ "../node_modules/micromark-core-commonmark/dev/lib/heading-atx.js": /*!************************************************************************!*\ !*** ../node_modules/micromark-core-commonmark/dev/lib/heading-atx.js ***! \************************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "headingAtx": () => (/* binding */ headingAtx) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js"); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_chunked__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-chunked */ "../node_modules/micromark-util-chunked/dev/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /** * @typedef {import('micromark-util-types').Construct} Construct * @typedef {import('micromark-util-types').Resolver} Resolver * @typedef {import('micromark-util-types').Tokenizer} Tokenizer * @typedef {import('micromark-util-types').Token} Token * @typedef {import('micromark-util-types').State} State */ /** @type {Construct} */ const headingAtx = { name: 'headingAtx', tokenize: tokenizeHeadingAtx, resolve: resolveHeadingAtx } /** @type {Resolver} */ function resolveHeadingAtx(events, context) { let contentEnd = events.length - 2 let contentStart = 3 /** @type {Token} */ let content /** @type {Token} */ let text // Prefix whitespace, part of the opening. if (events[contentStart][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.whitespace) { contentStart += 2 } // Suffix whitespace, part of the closing. if ( contentEnd - 2 > contentStart && events[contentEnd][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.whitespace ) { contentEnd -= 2 } if ( events[contentEnd][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.atxHeadingSequence && (contentStart === contentEnd - 1 || (contentEnd - 4 > contentStart && events[contentEnd - 2][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.whitespace)) ) { contentEnd -= contentStart + 1 === contentEnd ? 2 : 4 } if (contentEnd > contentStart) { content = { type: micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.atxHeadingText, start: events[contentStart][1].start, end: events[contentEnd][1].end } text = { type: micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.chunkText, start: events[contentStart][1].start, end: events[contentEnd][1].end, // @ts-expect-error Constants are fine to assign. contentType: micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.contentTypeText } ;(0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_3__.splice)(events, contentStart, contentEnd - contentStart + 1, [ ['enter', content, context], ['enter', text, context], ['exit', text, context], ['exit', content, context] ]) } return events } /** @type {Tokenizer} */ function tokenizeHeadingAtx(effects, ok, nok) { const self = this let size = 0 return start /** @type {State} */ function start(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.numberSign, 'expected `#`') effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.atxHeading) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.atxHeadingSequence) return fenceOpenInside(code) } /** @type {State} */ function fenceOpenInside(code) { if ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.numberSign && size++ < micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.atxHeadingOpeningFenceSizeMax ) { effects.consume(code) return fenceOpenInside } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownLineEndingOrSpace)(code)) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.atxHeadingSequence) return self.interrupt ? ok(code) : headingBreak(code) } return nok(code) } /** @type {State} */ function headingBreak(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.numberSign) { effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.atxHeadingSequence) return sequence(code) } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownLineEnding)(code)) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.atxHeading) return ok(code) } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownSpace)(code)) { return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_6__.factorySpace)(effects, headingBreak, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.whitespace)(code) } effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.atxHeadingText) return data(code) } /** @type {State} */ function sequence(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.numberSign) { effects.consume(code) return sequence } effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.atxHeadingSequence) return headingBreak(code) } /** @type {State} */ function data(code) { if ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.eof || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.numberSign || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownLineEndingOrSpace)(code) ) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.atxHeadingText) return headingBreak(code) } effects.consume(code) return data } } /***/ }), /***/ "../node_modules/micromark-core-commonmark/dev/lib/html-flow.js": /*!**********************************************************************!*\ !*** ../node_modules/micromark-core-commonmark/dev/lib/html-flow.js ***! \**********************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "htmlFlow": () => (/* binding */ htmlFlow) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_html_tag_name__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-html-tag-name */ "../node_modules/micromark-util-html-tag-name/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /* harmony import */ var _blank_line_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./blank-line.js */ "../node_modules/micromark-core-commonmark/dev/lib/blank-line.js"); /** * @typedef {import('micromark-util-types').Construct} Construct * @typedef {import('micromark-util-types').Resolver} Resolver * @typedef {import('micromark-util-types').Tokenizer} Tokenizer * @typedef {import('micromark-util-types').State} State * @typedef {import('micromark-util-types').Code} Code */ /** @type {Construct} */ const htmlFlow = { name: 'htmlFlow', tokenize: tokenizeHtmlFlow, resolveTo: resolveToHtmlFlow, concrete: true } /** @type {Construct} */ const nextBlankConstruct = {tokenize: tokenizeNextBlank, partial: true} /** @type {Resolver} */ function resolveToHtmlFlow(events) { let index = events.length while (index--) { if ( events[index][0] === 'enter' && events[index][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.htmlFlow ) { break } } if (index > 1 && events[index - 2][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.linePrefix) { // Add the prefix start to the HTML token. events[index][1].start = events[index - 2][1].start // Add the prefix start to the HTML line token. events[index + 1][1].start = events[index - 2][1].start // Remove the line prefix. events.splice(index - 2, 2) } return events } /** @type {Tokenizer} */ function tokenizeHtmlFlow(effects, ok, nok) { const self = this /** @type {number} */ let kind /** @type {boolean} */ let startTag /** @type {string} */ let buffer /** @type {number} */ let index /** @type {Code} */ let marker return start /** @type {State} */ function start(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.lessThan, 'expected `<`') effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.htmlFlow) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.htmlFlowData) effects.consume(code) return open } /** @type {State} */ function open(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.exclamationMark) { effects.consume(code) return declarationStart } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.slash) { effects.consume(code) return tagCloseStart } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.questionMark) { effects.consume(code) kind = micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlInstruction // While we’re in an instruction instead of a declaration, we’re on a `?` // right now, so we do need to search for `>`, similar to declarations. return self.interrupt ? ok : continuationDeclarationInside } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.asciiAlpha)(code)) { effects.consume(code) buffer = String.fromCharCode(code) startTag = true return tagName } return nok(code) } /** @type {State} */ function declarationStart(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.dash) { effects.consume(code) kind = micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlComment return commentOpenInside } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.leftSquareBracket) { effects.consume(code) kind = micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlCdata buffer = micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.cdataOpeningString index = 0 return cdataOpenInside } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.asciiAlpha)(code)) { effects.consume(code) kind = micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlDeclaration return self.interrupt ? ok : continuationDeclarationInside } return nok(code) } /** @type {State} */ function commentOpenInside(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.dash) { effects.consume(code) return self.interrupt ? ok : continuationDeclarationInside } return nok(code) } /** @type {State} */ function cdataOpenInside(code) { if (code === buffer.charCodeAt(index++)) { effects.consume(code) return index === buffer.length ? self.interrupt ? ok : continuation : cdataOpenInside } return nok(code) } /** @type {State} */ function tagCloseStart(code) { if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.asciiAlpha)(code)) { effects.consume(code) buffer = String.fromCharCode(code) return tagName } return nok(code) } /** @type {State} */ function tagName(code) { if ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.slash || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.greaterThan || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEndingOrSpace)(code) ) { if ( code !== micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.slash && startTag && micromark_util_html_tag_name__WEBPACK_IMPORTED_MODULE_5__.htmlRawNames.includes(buffer.toLowerCase()) ) { kind = micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlRaw return self.interrupt ? ok(code) : continuation(code) } if (micromark_util_html_tag_name__WEBPACK_IMPORTED_MODULE_5__.htmlBlockNames.includes(buffer.toLowerCase())) { kind = micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlBasic if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.slash) { effects.consume(code) return basicSelfClosing } return self.interrupt ? ok(code) : continuation(code) } kind = micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlComplete // Do not support complete HTML when interrupting return self.interrupt && !self.parser.lazy[self.now().line] ? nok(code) : startTag ? completeAttributeNameBefore(code) : completeClosingTagAfter(code) } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.dash || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.asciiAlphanumeric)(code)) { effects.consume(code) buffer += String.fromCharCode(code) return tagName } return nok(code) } /** @type {State} */ function basicSelfClosing(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.greaterThan) { effects.consume(code) return self.interrupt ? ok : continuation } return nok(code) } /** @type {State} */ function completeClosingTagAfter(code) { if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownSpace)(code)) { effects.consume(code) return completeClosingTagAfter } return completeEnd(code) } /** @type {State} */ function completeAttributeNameBefore(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.slash) { effects.consume(code) return completeEnd } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.colon || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.underscore || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.asciiAlpha)(code)) { effects.consume(code) return completeAttributeName } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownSpace)(code)) { effects.consume(code) return completeAttributeNameBefore } return completeEnd(code) } /** @type {State} */ function completeAttributeName(code) { if ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.dash || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.dot || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.colon || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.underscore || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.asciiAlphanumeric)(code) ) { effects.consume(code) return completeAttributeName } return completeAttributeNameAfter(code) } /** @type {State} */ function completeAttributeNameAfter(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.equalsTo) { effects.consume(code) return completeAttributeValueBefore } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownSpace)(code)) { effects.consume(code) return completeAttributeNameAfter } return completeAttributeNameBefore(code) } /** @type {State} */ function completeAttributeValueBefore(code) { if ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.lessThan || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.equalsTo || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.greaterThan || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.graveAccent ) { return nok(code) } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.quotationMark || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.apostrophe) { effects.consume(code) marker = code return completeAttributeValueQuoted } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownSpace)(code)) { effects.consume(code) return completeAttributeValueBefore } marker = null return completeAttributeValueUnquoted(code) } /** @type {State} */ function completeAttributeValueQuoted(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEnding)(code)) { return nok(code) } if (code === marker) { effects.consume(code) return completeAttributeValueQuotedAfter } effects.consume(code) return completeAttributeValueQuoted } /** @type {State} */ function completeAttributeValueUnquoted(code) { if ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.quotationMark || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.apostrophe || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.lessThan || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.equalsTo || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.greaterThan || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.graveAccent || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEndingOrSpace)(code) ) { return completeAttributeNameAfter(code) } effects.consume(code) return completeAttributeValueUnquoted } /** @type {State} */ function completeAttributeValueQuotedAfter(code) { if ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.slash || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.greaterThan || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownSpace)(code) ) { return completeAttributeNameBefore(code) } return nok(code) } /** @type {State} */ function completeEnd(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.greaterThan) { effects.consume(code) return completeAfter } return nok(code) } /** @type {State} */ function completeAfter(code) { if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownSpace)(code)) { effects.consume(code) return completeAfter } return code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEnding)(code) ? continuation(code) : nok(code) } /** @type {State} */ function continuation(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.dash && kind === micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlComment) { effects.consume(code) return continuationCommentInside } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.lessThan && kind === micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlRaw) { effects.consume(code) return continuationRawTagOpen } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.greaterThan && kind === micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlDeclaration) { effects.consume(code) return continuationClose } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.questionMark && kind === micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlInstruction) { effects.consume(code) return continuationDeclarationInside } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.rightSquareBracket && kind === micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlCdata) { effects.consume(code) return continuationCharacterDataInside } if ( (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEnding)(code) && (kind === micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlBasic || kind === micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlComplete) ) { return effects.check( nextBlankConstruct, continuationClose, continuationAtLineEnding )(code) } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEnding)(code)) { return continuationAtLineEnding(code) } effects.consume(code) return continuation } /** @type {State} */ function continuationAtLineEnding(code) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.htmlFlowData) return htmlContinueStart(code) } /** @type {State} */ function htmlContinueStart(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof) { return done(code) } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEnding)(code)) { return effects.attempt( {tokenize: htmlLineEnd, partial: true}, htmlContinueStart, done )(code) } effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.htmlFlowData) return continuation(code) } /** @type {Tokenizer} */ function htmlLineEnd(effects, ok, nok) { return start /** @type {State} */ function start(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEnding)(code), 'expected eol') effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding) return lineStart } /** @type {State} */ function lineStart(code) { return self.parser.lazy[self.now().line] ? nok(code) : ok(code) } } /** @type {State} */ function continuationCommentInside(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.dash) { effects.consume(code) return continuationDeclarationInside } return continuation(code) } /** @type {State} */ function continuationRawTagOpen(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.slash) { effects.consume(code) buffer = '' return continuationRawEndTag } return continuation(code) } /** @type {State} */ function continuationRawEndTag(code) { if ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.greaterThan && micromark_util_html_tag_name__WEBPACK_IMPORTED_MODULE_5__.htmlRawNames.includes(buffer.toLowerCase()) ) { effects.consume(code) return continuationClose } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.asciiAlpha)(code) && buffer.length < micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlRawSizeMax) { effects.consume(code) buffer += String.fromCharCode(code) return continuationRawEndTag } return continuation(code) } /** @type {State} */ function continuationCharacterDataInside(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.rightSquareBracket) { effects.consume(code) return continuationDeclarationInside } return continuation(code) } /** @type {State} */ function continuationDeclarationInside(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.greaterThan) { effects.consume(code) return continuationClose } // More dashes. if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.dash && kind === micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.htmlComment) { effects.consume(code) return continuationDeclarationInside } return continuation(code) } /** @type {State} */ function continuationClose(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEnding)(code)) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.htmlFlowData) return done(code) } effects.consume(code) return continuationClose } /** @type {State} */ function done(code) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.htmlFlow) return ok(code) } } /** @type {Tokenizer} */ function tokenizeNextBlank(effects, ok, nok) { return start /** @type {State} */ function start(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEnding)(code), 'expected a line ending') effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.htmlFlowData) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEndingBlank) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEndingBlank) return effects.attempt(_blank_line_js__WEBPACK_IMPORTED_MODULE_6__.blankLine, ok, nok) } } /***/ }), /***/ "../node_modules/micromark-core-commonmark/dev/lib/html-text.js": /*!**********************************************************************!*\ !*** ../node_modules/micromark-core-commonmark/dev/lib/html-text.js ***! \**********************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "htmlText": () => (/* binding */ htmlText) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js"); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /** * @typedef {import('micromark-util-types').Construct} Construct * @typedef {import('micromark-util-types').Tokenizer} Tokenizer * @typedef {import('micromark-util-types').State} State * @typedef {import('micromark-util-types').Code} Code */ /** @type {Construct} */ const htmlText = {name: 'htmlText', tokenize: tokenizeHtmlText} /** @type {Tokenizer} */ function tokenizeHtmlText(effects, ok, nok) { const self = this /** @type {NonNullable<Code>|undefined} */ let marker /** @type {string} */ let buffer /** @type {number} */ let index /** @type {State} */ let returnState return start /** @type {State} */ function start(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.lessThan, 'expected `<`') effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.htmlText) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.htmlTextData) effects.consume(code) return open } /** @type {State} */ function open(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.exclamationMark) { effects.consume(code) return declarationOpen } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.slash) { effects.consume(code) return tagCloseStart } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.questionMark) { effects.consume(code) return instruction } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAlpha)(code)) { effects.consume(code) return tagOpen } return nok(code) } /** @type {State} */ function declarationOpen(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dash) { effects.consume(code) return commentOpen } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.leftSquareBracket) { effects.consume(code) buffer = micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_4__.constants.cdataOpeningString index = 0 return cdataOpen } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAlpha)(code)) { effects.consume(code) return declaration } return nok(code) } /** @type {State} */ function commentOpen(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dash) { effects.consume(code) return commentStart } return nok(code) } /** @type {State} */ function commentStart(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan) { return nok(code) } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dash) { effects.consume(code) return commentStartDash } return comment(code) } /** @type {State} */ function commentStartDash(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan) { return nok(code) } return comment(code) } /** @type {State} */ function comment(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof) { return nok(code) } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dash) { effects.consume(code) return commentClose } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) { returnState = comment return atLineEnding(code) } effects.consume(code) return comment } /** @type {State} */ function commentClose(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dash) { effects.consume(code) return end } return comment(code) } /** @type {State} */ function cdataOpen(code) { if (code === buffer.charCodeAt(index++)) { effects.consume(code) return index === buffer.length ? cdata : cdataOpen } return nok(code) } /** @type {State} */ function cdata(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof) { return nok(code) } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.rightSquareBracket) { effects.consume(code) return cdataClose } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) { returnState = cdata return atLineEnding(code) } effects.consume(code) return cdata } /** @type {State} */ function cdataClose(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.rightSquareBracket) { effects.consume(code) return cdataEnd } return cdata(code) } /** @type {State} */ function cdataEnd(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan) { return end(code) } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.rightSquareBracket) { effects.consume(code) return cdataEnd } return cdata(code) } /** @type {State} */ function declaration(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan) { return end(code) } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) { returnState = declaration return atLineEnding(code) } effects.consume(code) return declaration } /** @type {State} */ function instruction(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof) { return nok(code) } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.questionMark) { effects.consume(code) return instructionClose } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) { returnState = instruction return atLineEnding(code) } effects.consume(code) return instruction } /** @type {State} */ function instructionClose(code) { return code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan ? end(code) : instruction(code) } /** @type {State} */ function tagCloseStart(code) { if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAlpha)(code)) { effects.consume(code) return tagClose } return nok(code) } /** @type {State} */ function tagClose(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dash || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAlphanumeric)(code)) { effects.consume(code) return tagClose } return tagCloseBetween(code) } /** @type {State} */ function tagCloseBetween(code) { if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) { returnState = tagCloseBetween return atLineEnding(code) } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownSpace)(code)) { effects.consume(code) return tagCloseBetween } return end(code) } /** @type {State} */ function tagOpen(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dash || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAlphanumeric)(code)) { effects.consume(code) return tagOpen } if ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.slash || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEndingOrSpace)(code) ) { return tagOpenBetween(code) } return nok(code) } /** @type {State} */ function tagOpenBetween(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.slash) { effects.consume(code) return end } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.colon || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.underscore || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAlpha)(code)) { effects.consume(code) return tagOpenAttributeName } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) { returnState = tagOpenBetween return atLineEnding(code) } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownSpace)(code)) { effects.consume(code) return tagOpenBetween } return end(code) } /** @type {State} */ function tagOpenAttributeName(code) { if ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dash || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dot || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.colon || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.underscore || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiAlphanumeric)(code) ) { effects.consume(code) return tagOpenAttributeName } return tagOpenAttributeNameAfter(code) } /** @type {State} */ function tagOpenAttributeNameAfter(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.equalsTo) { effects.consume(code) return tagOpenAttributeValueBefore } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) { returnState = tagOpenAttributeNameAfter return atLineEnding(code) } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownSpace)(code)) { effects.consume(code) return tagOpenAttributeNameAfter } return tagOpenBetween(code) } /** @type {State} */ function tagOpenAttributeValueBefore(code) { if ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.lessThan || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.equalsTo || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.graveAccent ) { return nok(code) } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.quotationMark || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.apostrophe) { effects.consume(code) marker = code return tagOpenAttributeValueQuoted } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) { returnState = tagOpenAttributeValueBefore return atLineEnding(code) } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownSpace)(code)) { effects.consume(code) return tagOpenAttributeValueBefore } effects.consume(code) marker = undefined return tagOpenAttributeValueUnquoted } /** @type {State} */ function tagOpenAttributeValueQuoted(code) { if (code === marker) { effects.consume(code) return tagOpenAttributeValueQuotedAfter } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof) { return nok(code) } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) { returnState = tagOpenAttributeValueQuoted return atLineEnding(code) } effects.consume(code) return tagOpenAttributeValueQuoted } /** @type {State} */ function tagOpenAttributeValueQuotedAfter(code) { if ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.slash || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEndingOrSpace)(code) ) { return tagOpenBetween(code) } return nok(code) } /** @type {State} */ function tagOpenAttributeValueUnquoted(code) { if ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.quotationMark || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.apostrophe || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.lessThan || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.equalsTo || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.graveAccent ) { return nok(code) } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEndingOrSpace)(code)) { return tagOpenBetween(code) } effects.consume(code) return tagOpenAttributeValueUnquoted } // We can’t have blank lines in content, so no need to worry about empty // tokens. /** @type {State} */ function atLineEnding(code) { (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(returnState, 'expected return state') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code), 'expected eol') effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.htmlTextData) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.lineEnding) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.lineEnding) return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_5__.factorySpace)( effects, afterPrefix, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.linePrefix, self.parser.constructs.disable.null.includes('codeIndented') ? undefined : micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_4__.constants.tabSize ) } /** @type {State} */ function afterPrefix(code) { effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.htmlTextData) return returnState(code) } /** @type {State} */ function end(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.greaterThan) { effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.htmlTextData) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.htmlText) return ok } return nok(code) } } /***/ }), /***/ "../node_modules/micromark-core-commonmark/dev/lib/label-end.js": /*!**********************************************************************!*\ !*** ../node_modules/micromark-core-commonmark/dev/lib/label-end.js ***! \**********************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "labelEnd": () => (/* binding */ labelEnd) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var micromark_factory_destination__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! micromark-factory-destination */ "../node_modules/micromark-factory-destination/dev/index.js"); /* harmony import */ var micromark_factory_label__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! micromark-factory-label */ "../node_modules/micromark-factory-label/dev/index.js"); /* harmony import */ var micromark_factory_title__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! micromark-factory-title */ "../node_modules/micromark-factory-title/dev/index.js"); /* harmony import */ var micromark_factory_whitespace__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! micromark-factory-whitespace */ "../node_modules/micromark-factory-whitespace/dev/index.js"); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-chunked */ "../node_modules/micromark-util-chunked/dev/index.js"); /* harmony import */ var micromark_util_normalize_identifier__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-normalize-identifier */ "../node_modules/micromark-util-normalize-identifier/dev/index.js"); /* harmony import */ var micromark_util_resolve_all__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-resolve-all */ "../node_modules/micromark-util-resolve-all/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /** * @typedef {import('micromark-util-types').Construct} Construct * @typedef {import('micromark-util-types').Resolver} Resolver * @typedef {import('micromark-util-types').Tokenizer} Tokenizer * @typedef {import('micromark-util-types').Event} Event * @typedef {import('micromark-util-types').Token} Token * @typedef {import('micromark-util-types').State} State * @typedef {import('micromark-util-types').Code} Code */ /** @type {Construct} */ const labelEnd = { name: 'labelEnd', tokenize: tokenizeLabelEnd, resolveTo: resolveToLabelEnd, resolveAll: resolveAllLabelEnd } /** @type {Construct} */ const resourceConstruct = {tokenize: tokenizeResource} /** @type {Construct} */ const fullReferenceConstruct = {tokenize: tokenizeFullReference} /** @type {Construct} */ const collapsedReferenceConstruct = {tokenize: tokenizeCollapsedReference} /** @type {Resolver} */ function resolveAllLabelEnd(events) { let index = -1 /** @type {Token} */ let token while (++index < events.length) { token = events[index][1] if ( token.type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelImage || token.type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelLink || token.type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelEnd ) { // Remove the marker. events.splice(index + 1, token.type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelImage ? 4 : 2) token.type = micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.data index++ } } return events } /** @type {Resolver} */ function resolveToLabelEnd(events, context) { let index = events.length let offset = 0 /** @type {Token} */ let token /** @type {number|undefined} */ let open /** @type {number|undefined} */ let close /** @type {Event[]} */ let media // Find an opening. while (index--) { token = events[index][1] if (open) { // If we see another link, or inactive link label, we’ve been here before. if ( token.type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.link || (token.type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelLink && token._inactive) ) { break } // Mark other link openings as inactive, as we can’t have links in // links. if (events[index][0] === 'enter' && token.type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelLink) { token._inactive = true } } else if (close) { if ( events[index][0] === 'enter' && (token.type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelImage || token.type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelLink) && !token._balanced ) { open = index if (token.type !== micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelLink) { offset = 2 break } } } else if (token.type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelEnd) { close = index } } (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(open !== undefined, '`open` is supposed to be found') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(close !== undefined, '`close` is supposed to be found') const group = { type: events[open][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelLink ? micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.link : micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.image, start: Object.assign({}, events[open][1].start), end: Object.assign({}, events[events.length - 1][1].end) } const label = { type: micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.label, start: Object.assign({}, events[open][1].start), end: Object.assign({}, events[close][1].end) } const text = { type: micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelText, start: Object.assign({}, events[open + offset + 2][1].end), end: Object.assign({}, events[close - 2][1].start) } media = [ ['enter', group, context], ['enter', label, context] ] // Opening marker. media = (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.push)(media, events.slice(open + 1, open + offset + 3)) // Text open. media = (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.push)(media, [['enter', text, context]]) // Between. media = (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.push)( media, (0,micromark_util_resolve_all__WEBPACK_IMPORTED_MODULE_3__.resolveAll)( context.parser.constructs.insideSpan.null, events.slice(open + offset + 4, close - 3), context ) ) // Text close, marker close, label close. media = (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.push)(media, [ ['exit', text, context], events[close - 2], events[close - 1], ['exit', label, context] ]) // Reference, resource, or so. media = (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.push)(media, events.slice(close + 1)) // Media close. media = (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.push)(media, [['exit', group, context]]) ;(0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.splice)(events, open, events.length, media) return events } /** @type {Tokenizer} */ function tokenizeLabelEnd(effects, ok, nok) { const self = this let index = self.events.length /** @type {Token} */ let labelStart /** @type {boolean} */ let defined // Find an opening. while (index--) { if ( (self.events[index][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelImage || self.events[index][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelLink) && !self.events[index][1]._balanced ) { labelStart = self.events[index][1] break } } return start /** @type {State} */ function start(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.rightSquareBracket, 'expected `]`') if (!labelStart) { return nok(code) } // It’s a balanced bracket, but contains a link. if (labelStart._inactive) return balanced(code) defined = self.parser.defined.includes( (0,micromark_util_normalize_identifier__WEBPACK_IMPORTED_MODULE_5__.normalizeIdentifier)( self.sliceSerialize({start: labelStart.end, end: self.now()}) ) ) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelEnd) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelMarker) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelMarker) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.labelEnd) return afterLabelEnd } /** @type {State} */ function afterLabelEnd(code) { // Resource: `[asd](fgh)`. if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.leftParenthesis) { return effects.attempt( resourceConstruct, ok, defined ? ok : balanced )(code) } // Collapsed (`[asd][]`) or full (`[asd][fgh]`) reference? if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.leftSquareBracket) { return effects.attempt( fullReferenceConstruct, ok, defined ? effects.attempt(collapsedReferenceConstruct, ok, balanced) : balanced )(code) } // Shortcut reference: `[asd]`? return defined ? ok(code) : balanced(code) } /** @type {State} */ function balanced(code) { labelStart._balanced = true return nok(code) } } /** @type {Tokenizer} */ function tokenizeResource(effects, ok, nok) { return start /** @type {State} */ function start(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.leftParenthesis, 'expected left paren') effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resource) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resourceMarker) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resourceMarker) return (0,micromark_factory_whitespace__WEBPACK_IMPORTED_MODULE_6__.factoryWhitespace)(effects, open) } /** @type {State} */ function open(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.rightParenthesis) { return end(code) } return (0,micromark_factory_destination__WEBPACK_IMPORTED_MODULE_7__.factoryDestination)( effects, destinationAfter, nok, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resourceDestination, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resourceDestinationLiteral, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resourceDestinationLiteralMarker, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resourceDestinationRaw, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resourceDestinationString, micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_8__.constants.linkResourceDestinationBalanceMax )(code) } /** @type {State} */ function destinationAfter(code) { return (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_9__.markdownLineEndingOrSpace)(code) ? (0,micromark_factory_whitespace__WEBPACK_IMPORTED_MODULE_6__.factoryWhitespace)(effects, between)(code) : end(code) } /** @type {State} */ function between(code) { if ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.quotationMark || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.apostrophe || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.leftParenthesis ) { return (0,micromark_factory_title__WEBPACK_IMPORTED_MODULE_10__.factoryTitle)( effects, (0,micromark_factory_whitespace__WEBPACK_IMPORTED_MODULE_6__.factoryWhitespace)(effects, end), nok, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resourceTitle, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resourceTitleMarker, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resourceTitleString )(code) } return end(code) } /** @type {State} */ function end(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.rightParenthesis) { effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resourceMarker) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resourceMarker) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.resource) return ok } return nok(code) } } /** @type {Tokenizer} */ function tokenizeFullReference(effects, ok, nok) { const self = this return start /** @type {State} */ function start(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.leftSquareBracket, 'expected left bracket') return micromark_factory_label__WEBPACK_IMPORTED_MODULE_11__.factoryLabel.call( self, effects, afterLabel, nok, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.reference, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.referenceMarker, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.referenceString )(code) } /** @type {State} */ function afterLabel(code) { return self.parser.defined.includes( (0,micromark_util_normalize_identifier__WEBPACK_IMPORTED_MODULE_5__.normalizeIdentifier)( self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1) ) ) ? ok(code) : nok(code) } } /** @type {Tokenizer} */ function tokenizeCollapsedReference(effects, ok, nok) { return start /** @type {State} */ function start(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.leftSquareBracket, 'expected left bracket') effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.reference) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.referenceMarker) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.referenceMarker) return open } /** @type {State} */ function open(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_4__.codes.rightSquareBracket) { effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.referenceMarker) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.referenceMarker) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.reference) return ok } return nok(code) } } /***/ }), /***/ "../node_modules/micromark-core-commonmark/dev/lib/label-start-image.js": /*!******************************************************************************!*\ !*** ../node_modules/micromark-core-commonmark/dev/lib/label-start-image.js ***! \******************************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "labelStartImage": () => (/* binding */ labelStartImage) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /* harmony import */ var _label_end_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./label-end.js */ "../node_modules/micromark-core-commonmark/dev/lib/label-end.js"); /** * @typedef {import('micromark-util-types').Construct} Construct * @typedef {import('micromark-util-types').Tokenizer} Tokenizer * @typedef {import('micromark-util-types').State} State */ /** @type {Construct} */ const labelStartImage = { name: 'labelStartImage', tokenize: tokenizeLabelStartImage, resolveAll: _label_end_js__WEBPACK_IMPORTED_MODULE_1__.labelEnd.resolveAll } /** @type {Tokenizer} */ function tokenizeLabelStartImage(effects, ok, nok) { const self = this return start /** @type {State} */ function start(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.exclamationMark, 'expected `!`') effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.labelImage) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.labelImageMarker) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.labelImageMarker) return open } /** @type {State} */ function open(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.leftSquareBracket) { effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.labelMarker) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.labelMarker) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.labelImage) return after } return nok(code) } /** @type {State} */ function after(code) { /* To do: remove in the future once we’ve switched from * `micromark-extension-footnote` to `micromark-extension-gfm-footnote`, * which doesn’t need this */ /* Hidden footnotes hook */ /* c8 ignore next 3 */ return code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.caret && '_hiddenFootnoteSupport' in self.parser.constructs ? nok(code) : ok(code) } } /***/ }), /***/ "../node_modules/micromark-core-commonmark/dev/lib/label-start-link.js": /*!*****************************************************************************!*\ !*** ../node_modules/micromark-core-commonmark/dev/lib/label-start-link.js ***! \*****************************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "labelStartLink": () => (/* binding */ labelStartLink) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /* harmony import */ var _label_end_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./label-end.js */ "../node_modules/micromark-core-commonmark/dev/lib/label-end.js"); /** * @typedef {import('micromark-util-types').Construct} Construct * @typedef {import('micromark-util-types').Tokenizer} Tokenizer * @typedef {import('micromark-util-types').State} State */ /** @type {Construct} */ const labelStartLink = { name: 'labelStartLink', tokenize: tokenizeLabelStartLink, resolveAll: _label_end_js__WEBPACK_IMPORTED_MODULE_1__.labelEnd.resolveAll } /** @type {Tokenizer} */ function tokenizeLabelStartLink(effects, ok, nok) { const self = this return start /** @type {State} */ function start(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.leftSquareBracket, 'expected `[`') effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.labelLink) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.labelMarker) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.labelMarker) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.labelLink) return after } /** @type {State} */ function after(code) { /* To do: remove in the future once we’ve switched from * `micromark-extension-footnote` to `micromark-extension-gfm-footnote`, * which doesn’t need this */ /* Hidden footnotes hook. */ /* c8 ignore next 3 */ return code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.caret && '_hiddenFootnoteSupport' in self.parser.constructs ? nok(code) : ok(code) } } /***/ }), /***/ "../node_modules/micromark-core-commonmark/dev/lib/line-ending.js": /*!************************************************************************!*\ !*** ../node_modules/micromark-core-commonmark/dev/lib/line-ending.js ***! \************************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "lineEnding": () => (/* binding */ lineEnding) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js"); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /** * @typedef {import('micromark-util-types').Construct} Construct * @typedef {import('micromark-util-types').Tokenizer} Tokenizer * @typedef {import('micromark-util-types').State} State */ /** @type {Construct} */ const lineEnding = {name: 'lineEnding', tokenize: tokenizeLineEnding} /** @type {Tokenizer} */ function tokenizeLineEnding(effects, ok) { return start /** @type {State} */ function start(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_1__.markdownLineEnding)(code), 'expected eol') effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.lineEnding) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.lineEnding) return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_3__.factorySpace)(effects, ok, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.linePrefix) } } /***/ }), /***/ "../node_modules/micromark-core-commonmark/dev/lib/list.js": /*!*****************************************************************!*\ !*** ../node_modules/micromark-core-commonmark/dev/lib/list.js ***! \*****************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "list": () => (/* binding */ list) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js"); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /* harmony import */ var _blank_line_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./blank-line.js */ "../node_modules/micromark-core-commonmark/dev/lib/blank-line.js"); /* harmony import */ var _thematic_break_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./thematic-break.js */ "../node_modules/micromark-core-commonmark/dev/lib/thematic-break.js"); /** * @typedef {import('micromark-util-types').Construct} Construct * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext * @typedef {import('micromark-util-types').Exiter} Exiter * @typedef {import('micromark-util-types').Tokenizer} Tokenizer * @typedef {import('micromark-util-types').State} State * @typedef {import('micromark-util-types').Code} Code */ /** * @typedef {Record<string, unknown> & {marker: Code, type: string, size: number}} ListContainerState * @typedef {TokenizeContext & {containerState: ListContainerState}} TokenizeContextWithState */ /** @type {Construct} */ const list = { name: 'list', tokenize: tokenizeListStart, continuation: {tokenize: tokenizeListContinuation}, exit: tokenizeListEnd } /** @type {Construct} */ const listItemPrefixWhitespaceConstruct = { tokenize: tokenizeListItemPrefixWhitespace, partial: true } /** @type {Construct} */ const indentConstruct = {tokenize: tokenizeIndent, partial: true} /** * @type {Tokenizer} * @this {TokenizeContextWithState} */ function tokenizeListStart(effects, ok, nok) { const self = this const tail = self.events[self.events.length - 1] let initialSize = tail && tail[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.linePrefix ? tail[2].sliceSerialize(tail[1], true).length : 0 let size = 0 return start /** @type {State} */ function start(code) { const kind = self.containerState.type || (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.asterisk || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.plusSign || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.dash ? micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listUnordered : micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listOrdered) if ( kind === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listUnordered ? !self.containerState.marker || code === self.containerState.marker : (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiDigit)(code) ) { if (!self.containerState.type) { self.containerState.type = kind effects.enter(kind, {_container: true}) } if (kind === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listUnordered) { effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemPrefix) return code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.asterisk || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.dash ? effects.check(_thematic_break_js__WEBPACK_IMPORTED_MODULE_4__.thematicBreak, nok, atMarker)(code) : atMarker(code) } if (!self.interrupt || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.digit1) { effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemPrefix) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemValue) return inside(code) } } return nok(code) } /** @type {State} */ function inside(code) { if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.asciiDigit)(code) && ++size < micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__.constants.listItemValueSizeMax) { effects.consume(code) return inside } if ( (!self.interrupt || size < 2) && (self.containerState.marker ? code === self.containerState.marker : code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.rightParenthesis || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.dot) ) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemValue) return atMarker(code) } return nok(code) } /** * @type {State} **/ function atMarker(code) { (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code !== micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof, 'eof (`null`) is not a marker') effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemMarker) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemMarker) self.containerState.marker = self.containerState.marker || code return effects.check( _blank_line_js__WEBPACK_IMPORTED_MODULE_6__.blankLine, // Can’t be empty when interrupting. self.interrupt ? nok : onBlank, effects.attempt( listItemPrefixWhitespaceConstruct, endOfPrefix, otherPrefix ) ) } /** @type {State} */ function onBlank(code) { self.containerState.initialBlankLine = true initialSize++ return endOfPrefix(code) } /** @type {State} */ function otherPrefix(code) { if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownSpace)(code)) { effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemPrefixWhitespace) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemPrefixWhitespace) return endOfPrefix } return nok(code) } /** @type {State} */ function endOfPrefix(code) { self.containerState.size = initialSize + self.sliceSerialize(effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemPrefix), true).length return ok(code) } } /** * @type {Tokenizer} * @this {TokenizeContextWithState} */ function tokenizeListContinuation(effects, ok, nok) { const self = this self.containerState._closeFlow = undefined return effects.check(_blank_line_js__WEBPACK_IMPORTED_MODULE_6__.blankLine, onBlank, notBlank) /** @type {State} */ function onBlank(code) { self.containerState.furtherBlankLines = self.containerState.furtherBlankLines || self.containerState.initialBlankLine // We have a blank line. // Still, try to consume at most the items size. return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_7__.factorySpace)( effects, ok, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemIndent, self.containerState.size + 1 )(code) } /** @type {State} */ function notBlank(code) { if (self.containerState.furtherBlankLines || !(0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownSpace)(code)) { self.containerState.furtherBlankLines = undefined self.containerState.initialBlankLine = undefined return notInCurrentItem(code) } self.containerState.furtherBlankLines = undefined self.containerState.initialBlankLine = undefined return effects.attempt(indentConstruct, ok, notInCurrentItem)(code) } /** @type {State} */ function notInCurrentItem(code) { // While we do continue, we signal that the flow should be closed. self.containerState._closeFlow = true // As we’re closing flow, we’re no longer interrupting. self.interrupt = undefined return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_7__.factorySpace)( effects, effects.attempt(list, ok, nok), micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.linePrefix, self.parser.constructs.disable.null.includes('codeIndented') ? undefined : micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__.constants.tabSize )(code) } } /** * @type {Tokenizer} * @this {TokenizeContextWithState} */ function tokenizeIndent(effects, ok, nok) { const self = this return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_7__.factorySpace)( effects, afterPrefix, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemIndent, self.containerState.size + 1 ) /** @type {State} */ function afterPrefix(code) { const tail = self.events[self.events.length - 1] return tail && tail[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemIndent && tail[2].sliceSerialize(tail[1], true).length === self.containerState.size ? ok(code) : nok(code) } } /** * @type {Exiter} * @this {TokenizeContextWithState} */ function tokenizeListEnd(effects) { effects.exit(this.containerState.type) } /** * @type {Tokenizer} * @this {TokenizeContextWithState} */ function tokenizeListItemPrefixWhitespace(effects, ok, nok) { const self = this return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_7__.factorySpace)( effects, afterPrefix, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemPrefixWhitespace, self.parser.constructs.disable.null.includes('codeIndented') ? undefined : micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__.constants.tabSize + 1 ) /** @type {State} */ function afterPrefix(code) { const tail = self.events[self.events.length - 1] return !(0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownSpace)(code) && tail && tail[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemPrefixWhitespace ? ok(code) : nok(code) } } /***/ }), /***/ "../node_modules/micromark-core-commonmark/dev/lib/setext-underline.js": /*!*****************************************************************************!*\ !*** ../node_modules/micromark-core-commonmark/dev/lib/setext-underline.js ***! \*****************************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "setextUnderline": () => (/* binding */ setextUnderline) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js"); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /** * @typedef {import('micromark-util-types').Construct} Construct * @typedef {import('micromark-util-types').Resolver} Resolver * @typedef {import('micromark-util-types').Tokenizer} Tokenizer * @typedef {import('micromark-util-types').State} State * @typedef {import('micromark-util-types').Code} Code */ /** @type {Construct} */ const setextUnderline = { name: 'setextUnderline', tokenize: tokenizeSetextUnderline, resolveTo: resolveToSetextUnderline } /** @type {Resolver} */ function resolveToSetextUnderline(events, context) { let index = events.length /** @type {number|undefined} */ let content /** @type {number|undefined} */ let text /** @type {number|undefined} */ let definition // Find the opening of the content. // It’ll always exist: we don’t tokenize if it isn’t there. while (index--) { if (events[index][0] === 'enter') { if (events[index][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.content) { content = index break } if (events[index][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.paragraph) { text = index } } // Exit else { if (events[index][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.content) { // Remove the content end (if needed we’ll add it later) events.splice(index, 1) } if (!definition && events[index][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.definition) { definition = index } } } (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(text !== undefined, 'expected a `text` index to be found') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(content !== undefined, 'expected a `text` index to be found') const heading = { type: micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.setextHeading, start: Object.assign({}, events[text][1].start), end: Object.assign({}, events[events.length - 1][1].end) } // Change the paragraph to setext heading text. events[text][1].type = micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.setextHeadingText // If we have definitions in the content, we’ll keep on having content, // but we need move it. if (definition) { events.splice(text, 0, ['enter', heading, context]) events.splice(definition + 1, 0, ['exit', events[content][1], context]) events[content][1].end = Object.assign({}, events[definition][1].end) } else { events[content][1] = heading } // Add the heading exit at the end. events.push(['exit', heading, context]) return events } /** @type {Tokenizer} */ function tokenizeSetextUnderline(effects, ok, nok) { const self = this let index = self.events.length /** @type {NonNullable<Code>} */ let marker /** @type {boolean} */ let paragraph // Find an opening. while (index--) { // Skip enter/exit of line ending, line prefix, and content. // We can now either have a definition or a paragraph. if ( self.events[index][1].type !== micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding && self.events[index][1].type !== micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.linePrefix && self.events[index][1].type !== micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.content ) { paragraph = self.events[index][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.paragraph break } } return start /** @type {State} */ function start(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.dash || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.equalsTo, 'expected `=` or `-`' ) if (!self.parser.lazy[self.now().line] && (self.interrupt || paragraph)) { effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.setextHeadingLine) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.setextHeadingLineSequence) marker = code return closingSequence(code) } return nok(code) } /** @type {State} */ function closingSequence(code) { if (code === marker) { effects.consume(code) return closingSequence } effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.setextHeadingLineSequence) return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_3__.factorySpace)(effects, closingSequenceEnd, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineSuffix)(code) } /** @type {State} */ function closingSequenceEnd(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_4__.markdownLineEnding)(code)) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.setextHeadingLine) return ok(code) } return nok(code) } } /***/ }), /***/ "../node_modules/micromark-core-commonmark/dev/lib/thematic-break.js": /*!***************************************************************************!*\ !*** ../node_modules/micromark-core-commonmark/dev/lib/thematic-break.js ***! \***************************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "thematicBreak": () => (/* binding */ thematicBreak) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js"); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /** * @typedef {import('micromark-util-types').Construct} Construct * @typedef {import('micromark-util-types').Tokenizer} Tokenizer * @typedef {import('micromark-util-types').State} State * @typedef {import('micromark-util-types').Code} Code */ /** @type {Construct} */ const thematicBreak = { name: 'thematicBreak', tokenize: tokenizeThematicBreak } /** @type {Tokenizer} */ function tokenizeThematicBreak(effects, ok, nok) { let size = 0 /** @type {NonNullable<Code>} */ let marker return start /** @type {State} */ function start(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.asterisk || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.dash || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.underscore, 'expected `*`, `-`, or `_`' ) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.thematicBreak) marker = code return atBreak(code) } /** @type {State} */ function atBreak(code) { if (code === marker) { effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.thematicBreakSequence) return sequence(code) } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownSpace)(code)) { return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__.factorySpace)(effects, atBreak, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.whitespace)(code) } if ( size < micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__.constants.thematicBreakMarkerCountMin || (code !== micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof && !(0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) ) { return nok(code) } effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.thematicBreak) return ok(code) } /** @type {State} */ function sequence(code) { if (code === marker) { effects.consume(code) size++ return sequence } effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.thematicBreakSequence) return atBreak(code) } } /***/ }), /***/ "../node_modules/micromark-factory-destination/dev/index.js": /*!******************************************************************!*\ !*** ../node_modules/micromark-factory-destination/dev/index.js ***! \******************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "factoryDestination": () => (/* binding */ factoryDestination) /* harmony export */ }); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /** * @typedef {import('micromark-util-types').Effects} Effects * @typedef {import('micromark-util-types').State} State */ /** * @param {Effects} effects * @param {State} ok * @param {State} nok * @param {string} type * @param {string} literalType * @param {string} literalMarkerType * @param {string} rawType * @param {string} stringType * @param {number} [max=Infinity] * @returns {State} */ // eslint-disable-next-line max-params function factoryDestination( effects, ok, nok, type, literalType, literalMarkerType, rawType, stringType, max ) { const limit = max || Number.POSITIVE_INFINITY let balance = 0 return start /** @type {State} */ function start(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.lessThan) { effects.enter(type) effects.enter(literalType) effects.enter(literalMarkerType) effects.consume(code) effects.exit(literalMarkerType) return destinationEnclosedBefore } if ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.eof || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.rightParenthesis || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_1__.asciiControl)(code) ) { return nok(code) } effects.enter(type) effects.enter(rawType) effects.enter(stringType) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.chunkString, {contentType: micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.contentTypeString}) return destinationRaw(code) } /** @type {State} */ function destinationEnclosedBefore(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.greaterThan) { effects.enter(literalMarkerType) effects.consume(code) effects.exit(literalMarkerType) effects.exit(literalType) effects.exit(type) return ok } effects.enter(stringType) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.chunkString, {contentType: micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_3__.constants.contentTypeString}) return destinationEnclosed(code) } /** @type {State} */ function destinationEnclosed(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.greaterThan) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.chunkString) effects.exit(stringType) return destinationEnclosedBefore(code) } if ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.eof || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.lessThan || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_1__.markdownLineEnding)(code) ) { return nok(code) } effects.consume(code) return code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.backslash ? destinationEnclosedEscape : destinationEnclosed } /** @type {State} */ function destinationEnclosedEscape(code) { if ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.lessThan || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.greaterThan || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.backslash ) { effects.consume(code) return destinationEnclosed } return destinationEnclosed(code) } /** @type {State} */ function destinationRaw(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.leftParenthesis) { if (++balance > limit) return nok(code) effects.consume(code) return destinationRaw } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.rightParenthesis) { if (!balance--) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.chunkString) effects.exit(stringType) effects.exit(rawType) effects.exit(type) return ok(code) } effects.consume(code) return destinationRaw } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_1__.markdownLineEndingOrSpace)(code)) { if (balance) return nok(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_2__.types.chunkString) effects.exit(stringType) effects.exit(rawType) effects.exit(type) return ok(code) } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_1__.asciiControl)(code)) return nok(code) effects.consume(code) return code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.backslash ? destinationRawEscape : destinationRaw } /** @type {State} */ function destinationRawEscape(code) { if ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.leftParenthesis || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.rightParenthesis || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.backslash ) { effects.consume(code) return destinationRaw } return destinationRaw(code) } } /***/ }), /***/ "../node_modules/micromark-factory-label/dev/index.js": /*!************************************************************!*\ !*** ../node_modules/micromark-factory-label/dev/index.js ***! \************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "factoryLabel": () => (/* binding */ factoryLabel) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /** * @typedef {import('micromark-util-types').Effects} Effects * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext * @typedef {import('micromark-util-types').State} State */ /** * @this {TokenizeContext} * @param {Effects} effects * @param {State} ok * @param {State} nok * @param {string} type * @param {string} markerType * @param {string} stringType * @returns {State} */ // eslint-disable-next-line max-params function factoryLabel(effects, ok, nok, type, markerType, stringType) { const self = this let size = 0 /** @type {boolean} */ let data return start /** @type {State} */ function start(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.leftSquareBracket, 'expected `[`') effects.enter(type) effects.enter(markerType) effects.consume(code) effects.exit(markerType) effects.enter(stringType) return atBreak } /** @type {State} */ function atBreak(code) { if ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.leftSquareBracket || (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.rightSquareBracket && !data) || /* To do: remove in the future once we’ve switched from * `micromark-extension-footnote` to `micromark-extension-gfm-footnote`, * which doesn’t need this */ /* Hidden footnotes hook */ /* c8 ignore next 3 */ (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.caret && !size && '_hiddenFootnoteSupport' in self.parser.constructs) || size > micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.linkReferenceSizeMax ) { return nok(code) } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.rightSquareBracket) { effects.exit(stringType) effects.enter(markerType) effects.consume(code) effects.exit(markerType) effects.exit(type) return ok } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code)) { effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.lineEnding) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.lineEnding) return atBreak } effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.chunkString, {contentType: micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.contentTypeString}) return label(code) } /** @type {State} */ function label(code) { if ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.leftSquareBracket || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.rightSquareBracket || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownLineEnding)(code) || size++ > micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.linkReferenceSizeMax ) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.chunkString) return atBreak(code) } effects.consume(code) data = data || !(0,micromark_util_character__WEBPACK_IMPORTED_MODULE_3__.markdownSpace)(code) return code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.backslash ? labelEscape : label } /** @type {State} */ function labelEscape(code) { if ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.leftSquareBracket || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.backslash || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.rightSquareBracket ) { effects.consume(code) size++ return label } return label(code) } } /***/ }), /***/ "../node_modules/micromark-factory-space/dev/index.js": /*!************************************************************!*\ !*** ../node_modules/micromark-factory-space/dev/index.js ***! \************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "factorySpace": () => (/* binding */ factorySpace) /* harmony export */ }); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /** * @typedef {import('micromark-util-types').Effects} Effects * @typedef {import('micromark-util-types').State} State */ /** * @param {Effects} effects * @param {State} ok * @param {string} type * @param {number} [max=Infinity] * @returns {State} */ function factorySpace(effects, ok, type, max) { const limit = max ? max - 1 : Number.POSITIVE_INFINITY let size = 0 return start /** @type {State} */ function start(code) { if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_0__.markdownSpace)(code)) { effects.enter(type) return prefix(code) } return ok(code) } /** @type {State} */ function prefix(code) { if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_0__.markdownSpace)(code) && size++ < limit) { effects.consume(code) return prefix } effects.exit(type) return ok(code) } } /***/ }), /***/ "../node_modules/micromark-factory-title/dev/index.js": /*!************************************************************!*\ !*** ../node_modules/micromark-factory-title/dev/index.js ***! \************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "factoryTitle": () => (/* binding */ factoryTitle) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js"); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /** * @typedef {import('micromark-util-types').Effects} Effects * @typedef {import('micromark-util-types').State} State * @typedef {import('micromark-util-types').Code} Code */ /** * @param {Effects} effects * @param {State} ok * @param {State} nok * @param {string} type * @param {string} markerType * @param {string} stringType * @returns {State} */ // eslint-disable-next-line max-params function factoryTitle(effects, ok, nok, type, markerType, stringType) { /** @type {NonNullable<Code>} */ let marker return start /** @type {State} */ function start(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.quotationMark || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.apostrophe || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.leftParenthesis, 'expected `"`, `\'`, or `(`' ) effects.enter(type) effects.enter(markerType) effects.consume(code) effects.exit(markerType) marker = code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.leftParenthesis ? micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.rightParenthesis : code return atFirstTitleBreak } /** @type {State} */ function atFirstTitleBreak(code) { if (code === marker) { effects.enter(markerType) effects.consume(code) effects.exit(markerType) effects.exit(type) return ok } effects.enter(stringType) return atTitleBreak(code) } /** @type {State} */ function atTitleBreak(code) { if (code === marker) { effects.exit(stringType) return atFirstTitleBreak(marker) } if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof) { return nok(code) } // Note: blank lines can’t exist in content. if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_2__.markdownLineEnding)(code)) { effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.lineEnding) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.lineEnding) return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__.factorySpace)(effects, atTitleBreak, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.linePrefix) } effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.chunkString, {contentType: micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__.constants.contentTypeString}) return title(code) } /** @type {State} */ function title(code) { if (code === marker || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_2__.markdownLineEnding)(code)) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.chunkString) return atTitleBreak(code) } effects.consume(code) return code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.backslash ? titleEscape : title } /** @type {State} */ function titleEscape(code) { if (code === marker || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.backslash) { effects.consume(code) return title } return title(code) } } /***/ }), /***/ "../node_modules/micromark-factory-whitespace/dev/index.js": /*!*****************************************************************!*\ !*** ../node_modules/micromark-factory-whitespace/dev/index.js ***! \*****************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "factoryWhitespace": () => (/* binding */ factoryWhitespace) /* harmony export */ }); /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js"); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /** * @typedef {import('micromark-util-types').Effects} Effects * @typedef {import('micromark-util-types').State} State */ /** * @param {Effects} effects * @param {State} ok */ function factoryWhitespace(effects, ok) { /** @type {boolean} */ let seen return start /** @type {State} */ function start(code) { if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_0__.markdownLineEnding)(code)) { effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding) seen = true return start } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_0__.markdownSpace)(code)) { return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_2__.factorySpace)( effects, start, seen ? micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.linePrefix : micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineSuffix )(code) } return ok(code) } } /***/ }), /***/ "../node_modules/micromark-util-character/dev/index.js": /*!*************************************************************!*\ !*** ../node_modules/micromark-util-character/dev/index.js ***! \*************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "asciiAlpha": () => (/* binding */ asciiAlpha), /* harmony export */ "asciiAlphanumeric": () => (/* binding */ asciiAlphanumeric), /* harmony export */ "asciiAtext": () => (/* binding */ asciiAtext), /* harmony export */ "asciiControl": () => (/* binding */ asciiControl), /* harmony export */ "asciiDigit": () => (/* binding */ asciiDigit), /* harmony export */ "asciiHexDigit": () => (/* binding */ asciiHexDigit), /* harmony export */ "asciiPunctuation": () => (/* binding */ asciiPunctuation), /* harmony export */ "markdownLineEnding": () => (/* binding */ markdownLineEnding), /* harmony export */ "markdownLineEndingOrSpace": () => (/* binding */ markdownLineEndingOrSpace), /* harmony export */ "markdownSpace": () => (/* binding */ markdownSpace), /* harmony export */ "unicodePunctuation": () => (/* binding */ unicodePunctuation), /* harmony export */ "unicodeWhitespace": () => (/* binding */ unicodeWhitespace) /* harmony export */ }); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var _lib_unicode_punctuation_regex_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/unicode-punctuation-regex.js */ "../node_modules/micromark-util-character/dev/lib/unicode-punctuation-regex.js"); /** * @typedef {import('micromark-util-types').Code} Code */ /** * Check whether the character code represents an ASCII alpha (`a` through `z`, * case insensitive). * * An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha. * * An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`) * to U+005A (`Z`). * * An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`) * to U+007A (`z`). */ const asciiAlpha = regexCheck(/[A-Za-z]/) /** * Check whether the character code represents an ASCII digit (`0` through `9`). * * An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to * U+0039 (`9`). */ const asciiDigit = regexCheck(/\d/) /** * Check whether the character code represents an ASCII hex digit (`a` through * `f`, case insensitive, or `0` through `9`). * * An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex * digit, or an ASCII lower hex digit. * * An **ASCII upper hex digit** is a character in the inclusive range U+0041 * (`A`) to U+0046 (`F`). * * An **ASCII lower hex digit** is a character in the inclusive range U+0061 * (`a`) to U+0066 (`f`). */ const asciiHexDigit = regexCheck(/[\dA-Fa-f]/) /** * Check whether the character code represents an ASCII alphanumeric (`a` * through `z`, case insensitive, or `0` through `9`). * * An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha * (see `asciiAlpha`). */ const asciiAlphanumeric = regexCheck(/[\dA-Za-z]/) /** * Check whether the character code represents ASCII punctuation. * * An **ASCII punctuation** is a character in the inclusive ranges U+0021 * EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT * SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT * (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`). */ const asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/) /** * Check whether the character code represents an ASCII atext. * * atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in * the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`), * U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F * SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E * CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE * (`{`) to U+007E TILDE (`~`). * * See: * **\[RFC5322]**: * [Internet Message Format](https://tools.ietf.org/html/rfc5322). * P. Resnick. * IETF. */ const asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/) /** * Check whether a character code is an ASCII control character. * * An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL) * to U+001F (US), or U+007F (DEL). * * @param {Code} code * @returns {code is number} */ function asciiControl(code) { return ( // Special whitespace codes (which have negative values), C0 and Control // character DEL code !== null && (code < micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.space || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.del) ) } /** * Check whether a character code is a markdown line ending (see * `markdownLineEnding`) or markdown space (see `markdownSpace`). * * @param {Code} code * @returns {code is number} */ function markdownLineEndingOrSpace(code) { return code !== null && (code < micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.nul || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.space) } /** * Check whether a character code is a markdown line ending. * * A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN * LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR). * * In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE * RETURN (CR) are replaced by these virtual characters depending on whether * they occurred together. * * @param {Code} code * @returns {code is number} */ function markdownLineEnding(code) { return code !== null && code < micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.horizontalTab } /** * Check whether a character code is a markdown space. * * A **markdown space** is the concrete character U+0020 SPACE (SP) and the * virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT). * * In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is * replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL * SPACE (VS) characters, depending on the column at which the tab occurred. * * @param {Code} code * @returns {code is number} */ function markdownSpace(code) { return ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.horizontalTab || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.virtualSpace || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.space ) } /** * Check whether the character code represents Unicode whitespace. * * Note that this does handle micromark specific markdown whitespace characters. * See `markdownLineEndingOrSpace` to check that. * * A **Unicode whitespace** is a character in the Unicode `Zs` (Separator, * Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF), * U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\[UNICODE]**). * * See: * **\[UNICODE]**: * [The Unicode Standard](https://www.unicode.org/versions/). * Unicode Consortium. */ const unicodeWhitespace = regexCheck(/\s/) /** * Check whether the character code represents Unicode punctuation. * * A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation, * Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf` * (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po` * (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII * punctuation (see `asciiPunctuation`). * * See: * **\[UNICODE]**: * [The Unicode Standard](https://www.unicode.org/versions/). * Unicode Consortium. */ // Size note: removing ASCII from the regex and using `asciiPunctuation` here // In fact adds to the bundle size. const unicodePunctuation = regexCheck(_lib_unicode_punctuation_regex_js__WEBPACK_IMPORTED_MODULE_1__.unicodePunctuationRegex) /** * Create a code check from a regex. * * @param {RegExp} regex * @returns {(code: Code) => code is number} */ function regexCheck(regex) { return check /** * Check whether a code matches the bound regex. * * @param {Code} code Character code * @returns {code is number} Whether the character code matches the bound regex */ function check(code) { return code !== null && regex.test(String.fromCharCode(code)) } } /***/ }), /***/ "../node_modules/micromark-util-character/dev/lib/unicode-punctuation-regex.js": /*!*************************************************************************************!*\ !*** ../node_modules/micromark-util-character/dev/lib/unicode-punctuation-regex.js ***! \*************************************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "unicodePunctuationRegex": () => (/* binding */ unicodePunctuationRegex) /* harmony export */ }); // This module is generated by `script/`. // // CommonMark handles attention (emphasis, strong) markers based on what comes // before or after them. // One such difference is if those characters are Unicode punctuation. // This script is generated from the Unicode data. const unicodePunctuationRegex = /[!-/:-@[-`{-~\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/ /***/ }), /***/ "../node_modules/micromark-util-chunked/dev/index.js": /*!***********************************************************!*\ !*** ../node_modules/micromark-util-chunked/dev/index.js ***! \***********************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "push": () => (/* binding */ push), /* harmony export */ "splice": () => (/* binding */ splice) /* harmony export */ }); /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js"); /** * Like `Array#splice`, but smarter for giant arrays. * * `Array#splice` takes all items to be inserted as individual argument which * causes a stack overflow in V8 when trying to insert 100k items for instance. * * Otherwise, this does not return the removed items, and takes `items` as an * array instead of rest parameters. * * @template {unknown} T * @param {T[]} list * @param {number} start * @param {number} remove * @param {T[]} items * @returns {void} */ function splice(list, start, remove, items) { const end = list.length let chunkStart = 0 /** @type {unknown[]} */ let parameters // Make start between zero and `end` (included). if (start < 0) { start = -start > end ? 0 : end + start } else { start = start > end ? end : start } remove = remove > 0 ? remove : 0 // No need to chunk the items if there’s only a couple (10k) items. if (items.length < micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_0__.constants.v8MaxSafeChunkSize) { parameters = Array.from(items) parameters.unshift(start, remove) // @ts-expect-error Hush, it’s fine. ;[].splice.apply(list, parameters) } else { // Delete `remove` items starting from `start` if (remove) [].splice.apply(list, [start, remove]) // Insert the items in chunks to not cause stack overflows. while (chunkStart < items.length) { parameters = items.slice( chunkStart, chunkStart + micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_0__.constants.v8MaxSafeChunkSize ) parameters.unshift(start, 0) // @ts-expect-error Hush, it’s fine. ;[].splice.apply(list, parameters) chunkStart += micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_0__.constants.v8MaxSafeChunkSize start += micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_0__.constants.v8MaxSafeChunkSize } } } /** * Append `items` (an array) at the end of `list` (another array). * When `list` was empty, returns `items` instead. * * This prevents a potentially expensive operation when `list` is empty, * and adds items in batches to prevent V8 from hanging. * * @template {unknown} T * @param {T[]} list * @param {T[]} items * @returns {T[]} */ function push(list, items) { if (list.length > 0) { splice(list, list.length, 0, items) return list } return items } /***/ }), /***/ "../node_modules/micromark-util-classify-character/dev/index.js": /*!**********************************************************************!*\ !*** ../node_modules/micromark-util-classify-character/dev/index.js ***! \**********************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "classifyCharacter": () => (/* binding */ classifyCharacter) /* harmony export */ }); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js"); /** * @typedef {import('micromark-util-types').Code} Code */ /** * Classify whether a character code represents whitespace, punctuation, or * something else. * * Used for attention (emphasis, strong), whose sequences can open or close * based on the class of surrounding characters. * * Note that eof (`null`) is seen as whitespace. * * @param {Code} code * @returns {number|undefined} */ function classifyCharacter(code) { if ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_1__.markdownLineEndingOrSpace)(code) || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_1__.unicodeWhitespace)(code) ) { return micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.characterGroupWhitespace } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_1__.unicodePunctuation)(code)) { return micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.characterGroupPunctuation } } /***/ }), /***/ "../node_modules/micromark-util-combine-extensions/index.js": /*!******************************************************************!*\ !*** ../node_modules/micromark-util-combine-extensions/index.js ***! \******************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "combineExtensions": () => (/* binding */ combineExtensions), /* harmony export */ "combineHtmlExtensions": () => (/* binding */ combineHtmlExtensions) /* harmony export */ }); /* harmony import */ var micromark_util_chunked__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-chunked */ "../node_modules/micromark-util-chunked/dev/index.js"); /** * @typedef {import('micromark-util-types').NormalizedExtension} NormalizedExtension * @typedef {import('micromark-util-types').Extension} Extension * @typedef {import('micromark-util-types').Construct} Construct * @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension */ const hasOwnProperty = {}.hasOwnProperty /** * Combine several syntax extensions into one. * * @param {Extension[]} extensions List of syntax extensions. * @returns {NormalizedExtension} A single combined extension. */ function combineExtensions(extensions) { /** @type {NormalizedExtension} */ const all = {} let index = -1 while (++index < extensions.length) { syntaxExtension(all, extensions[index]) } return all } /** * Merge `extension` into `all`. * * @param {NormalizedExtension} all Extension to merge into. * @param {Extension} extension Extension to merge. * @returns {void} */ function syntaxExtension(all, extension) { /** @type {string} */ let hook for (hook in extension) { const maybe = hasOwnProperty.call(all, hook) ? all[hook] : undefined const left = maybe || (all[hook] = {}) const right = extension[hook] /** @type {string} */ let code for (code in right) { if (!hasOwnProperty.call(left, code)) left[code] = [] const value = right[code] constructs( // @ts-expect-error Looks like a list. left[code], Array.isArray(value) ? value : value ? [value] : [] ) } } } /** * Merge `list` into `existing` (both lists of constructs). * Mutates `existing`. * * @param {unknown[]} existing * @param {unknown[]} list * @returns {void} */ function constructs(existing, list) { let index = -1 /** @type {unknown[]} */ const before = [] while (++index < list.length) { // @ts-expect-error Looks like an object. ;(list[index].add === 'after' ? existing : before).push(list[index]) } (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_0__.splice)(existing, 0, 0, before) } /** * Combine several HTML extensions into one. * * @param {HtmlExtension[]} htmlExtensions List of HTML extensions. * @returns {HtmlExtension} A single combined extension. */ function combineHtmlExtensions(htmlExtensions) { /** @type {HtmlExtension} */ const handlers = {} let index = -1 while (++index < htmlExtensions.length) { htmlExtension(handlers, htmlExtensions[index]) } return handlers } /** * Merge `extension` into `all`. * * @param {HtmlExtension} all Extension to merge into. * @param {HtmlExtension} extension Extension to merge. * @returns {void} */ function htmlExtension(all, extension) { /** @type {string} */ let hook for (hook in extension) { const maybe = hasOwnProperty.call(all, hook) ? all[hook] : undefined const left = maybe || (all[hook] = {}) const right = extension[hook] /** @type {string} */ let type if (right) { for (type in right) { left[type] = right[type] } } } } /***/ }), /***/ "../node_modules/micromark-util-decode-numeric-character-reference/dev/index.js": /*!**************************************************************************************!*\ !*** ../node_modules/micromark-util-decode-numeric-character-reference/dev/index.js ***! \**************************************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "decodeNumericCharacterReference": () => (/* binding */ decodeNumericCharacterReference) /* harmony export */ }); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/values.js */ "../node_modules/micromark-util-symbol/values.js"); /** * Turn the number (in string form as either hexa- or plain decimal) coming from * a numeric character reference into a character. * * @param {string} value * Value to decode. * @param {number} base * Numeric base. * @returns {string} */ function decodeNumericCharacterReference(value, base) { const code = Number.parseInt(value, base) if ( // C0 except for HT, LF, FF, CR, space code < micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.ht || code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.vt || (code > micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.cr && code < micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.space) || // Control character (DEL) of the basic block and C1 controls. (code > micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.tilde && code < 160) || // Lone high surrogates and low surrogates. (code > 55295 && code < 57344) || // Noncharacters. (code > 64975 && code < 65008) || (code & 65535) === 65535 || (code & 65535) === 65534 || // Out of range code > 1114111 ) { return micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_1__.values.replacementCharacter } return String.fromCharCode(code) } /***/ }), /***/ "../node_modules/micromark-util-decode-string/dev/index.js": /*!*****************************************************************!*\ !*** ../node_modules/micromark-util-decode-string/dev/index.js ***! \*****************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "decodeString": () => (/* binding */ decodeString) /* harmony export */ }); /* harmony import */ var decode_named_character_reference__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! decode-named-character-reference */ "../node_modules/decode-named-character-reference/index.dom.js"); /* harmony import */ var micromark_util_decode_numeric_character_reference__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-decode-numeric-character-reference */ "../node_modules/micromark-util-decode-numeric-character-reference/dev/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js"); const characterEscapeOrReference = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi /** * Utility to decode markdown strings (which occur in places such as fenced * code info strings, destinations, labels, and titles). * The “string” content type allows character escapes and -references. * This decodes those. * * @param {string} value * @returns {string} */ function decodeString(value) { return value.replace(characterEscapeOrReference, decode) } /** * @param {string} $0 * @param {string} $1 * @param {string} $2 * @returns {string} */ function decode($0, $1, $2) { if ($1) { // Escape. return $1 } // Reference. const head = $2.charCodeAt(0) if (head === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.numberSign) { const head = $2.charCodeAt(1) const hex = head === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.lowercaseX || head === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.uppercaseX return (0,micromark_util_decode_numeric_character_reference__WEBPACK_IMPORTED_MODULE_1__.decodeNumericCharacterReference)( $2.slice(hex ? 2 : 1), hex ? micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.numericBaseHexadecimal : micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.numericBaseDecimal ) } return (0,decode_named_character_reference__WEBPACK_IMPORTED_MODULE_3__.decodeNamedCharacterReference)($2) || $0 } /***/ }), /***/ "../node_modules/micromark-util-encode/index.js": /*!******************************************************!*\ !*** ../node_modules/micromark-util-encode/index.js ***! \******************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "encode": () => (/* binding */ encode) /* harmony export */ }); const characterReferences = {'"': 'quot', '&': 'amp', '<': 'lt', '>': 'gt'} /** * Encode only the dangerous HTML characters. * * This ensures that certain characters which have special meaning in HTML are * dealt with. * Technically, we can skip `>` and `"` in many cases, but CM includes them. * * @param {string} value * @returns {string} */ function encode(value) { return value.replace(/["&<>]/g, replace) /** * @param {string} value * @returns {string} */ function replace(value) { // @ts-expect-error Hush, it’s fine. return '&' + characterReferences[value] + ';' } } /***/ }), /***/ "../node_modules/micromark-util-html-tag-name/index.js": /*!*************************************************************!*\ !*** ../node_modules/micromark-util-html-tag-name/index.js ***! \*************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "htmlBlockNames": () => (/* binding */ htmlBlockNames), /* harmony export */ "htmlRawNames": () => (/* binding */ htmlRawNames) /* harmony export */ }); /** * List of lowercase HTML tag names which when parsing HTML (flow), result * in more relaxed rules (condition 6): because they are known blocks, the * HTML-like syntax doesn’t have to be strictly parsed. * For tag names not in this list, a more strict algorithm (condition 7) is used * to detect whether the HTML-like syntax is seen as HTML (flow) or not. * * This is copied from: * <https://spec.commonmark.org/0.30/#html-blocks>. */ const htmlBlockNames = [ 'address', 'article', 'aside', 'base', 'basefont', 'blockquote', 'body', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dialog', 'dir', 'div', 'dl', 'dt', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hr', 'html', 'iframe', 'legend', 'li', 'link', 'main', 'menu', 'menuitem', 'nav', 'noframes', 'ol', 'optgroup', 'option', 'p', 'param', 'section', 'summary', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul' ] /** * List of lowercase HTML tag names which when parsing HTML (flow), result in * HTML that can include lines w/o exiting, until a closing tag also in this * list is found (condition 1). * * This module is copied from: * <https://spec.commonmark.org/0.30/#html-blocks>. * * Note that `textarea` was added in `CommonMark@0.30`. */ const htmlRawNames = ['pre', 'script', 'style', 'textarea'] /***/ }), /***/ "../node_modules/micromark-util-normalize-identifier/dev/index.js": /*!************************************************************************!*\ !*** ../node_modules/micromark-util-normalize-identifier/dev/index.js ***! \************************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "normalizeIdentifier": () => (/* binding */ normalizeIdentifier) /* harmony export */ }); /* harmony import */ var micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-symbol/values.js */ "../node_modules/micromark-util-symbol/values.js"); /** * Normalize an identifier (such as used in definitions). * * @param {string} value * @returns {string} */ function normalizeIdentifier(value) { return ( value // Collapse Markdown whitespace. .replace(/[\t\n\r ]+/g, micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_0__.values.space) // Trim. .replace(/^ | $/g, '') // Some characters are considered “uppercase”, but if their lowercase // counterpart is uppercased will result in a different uppercase // character. // Hence, to get that form, we perform both lower- and uppercase. // Upper case makes sure keys will not interact with default prototypal // methods: no method is uppercase. .toLowerCase() .toUpperCase() ) } /***/ }), /***/ "../node_modules/micromark-util-resolve-all/index.js": /*!***********************************************************!*\ !*** ../node_modules/micromark-util-resolve-all/index.js ***! \***********************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "resolveAll": () => (/* binding */ resolveAll) /* harmony export */ }); /** * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext * @typedef {import('micromark-util-types').Event} Event * @typedef {import('micromark-util-types').Resolver} Resolver */ /** * Call all `resolveAll`s. * * @param {{resolveAll?: Resolver}[]} constructs * @param {Event[]} events * @param {TokenizeContext} context * @returns {Event[]} */ function resolveAll(constructs, events, context) { /** @type {Resolver[]} */ const called = [] let index = -1 while (++index < constructs.length) { const resolve = constructs[index].resolveAll if (resolve && !called.includes(resolve)) { events = resolve(events, context) called.push(resolve) } } return events } /***/ }), /***/ "../node_modules/micromark-util-sanitize-uri/dev/index.js": /*!****************************************************************!*\ !*** ../node_modules/micromark-util-sanitize-uri/dev/index.js ***! \****************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "normalizeUri": () => (/* binding */ normalizeUri), /* harmony export */ "sanitizeUri": () => (/* binding */ sanitizeUri) /* harmony export */ }); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_encode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-encode */ "../node_modules/micromark-util-encode/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-symbol/values.js */ "../node_modules/micromark-util-symbol/values.js"); /** * Make a value safe for injection as a URL. * * This encodes unsafe characters with percent-encoding and skips already * encoded sequences (see `normalizeUri` below). * Further unsafe characters are encoded as character references (see * `micromark-util-encode`). * * Then, a regex of allowed protocols can be given, in which case the URL is * sanitized. * For example, `/^(https?|ircs?|mailto|xmpp)$/i` can be used for `a[href]`, * or `/^https?$/i` for `img[src]`. * If the URL includes an unknown protocol (one not matched by `protocol`, such * as a dangerous example, `javascript:`), the value is ignored. * * @param {string|undefined} url * @param {RegExp} [protocol] * @returns {string} */ function sanitizeUri(url, protocol) { const value = (0,micromark_util_encode__WEBPACK_IMPORTED_MODULE_0__.encode)(normalizeUri(url || '')) if (!protocol) { return value } const colon = value.indexOf(':') const questionMark = value.indexOf('?') const numberSign = value.indexOf('#') const slash = value.indexOf('/') if ( // If there is no protocol, it’s relative. colon < 0 || // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol. (slash > -1 && colon > slash) || (questionMark > -1 && colon > questionMark) || (numberSign > -1 && colon > numberSign) || // It is a protocol, it should be allowed. protocol.test(value.slice(0, colon)) ) { return value } return '' } /** * Normalize a URL (such as used in definitions). * * Encode unsafe characters with percent-encoding, skipping already encoded * sequences. * * @param {string} value * @returns {string} */ function normalizeUri(value) { /** @type {Array<string>} */ const result = [] let index = -1 let start = 0 let skip = 0 while (++index < value.length) { const code = value.charCodeAt(index) /** @type {string} */ let replace = '' // A correct percent encoded value. if ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.percentSign && (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_2__.asciiAlphanumeric)(value.charCodeAt(index + 1)) && (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_2__.asciiAlphanumeric)(value.charCodeAt(index + 2)) ) { skip = 2 } // ASCII. else if (code < 128) { if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code))) { replace = String.fromCharCode(code) } } // Astral. else if (code > 55295 && code < 57344) { const next = value.charCodeAt(index + 1) // A correct surrogate pair. if (code < 56320 && next > 56319 && next < 57344) { replace = String.fromCharCode(code, next) skip = 1 } // Lone surrogate. else { replace = micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_3__.values.replacementCharacter } } // Unicode. else { replace = String.fromCharCode(code) } if (replace) { result.push(value.slice(start, index), encodeURIComponent(replace)) start = index + skip + 1 replace = '' } if (skip) { index += skip skip = 0 } } return result.join('') + value.slice(start) } /***/ }), /***/ "../node_modules/micromark-util-subtokenize/dev/index.js": /*!***************************************************************!*\ !*** ../node_modules/micromark-util-subtokenize/dev/index.js ***! \***************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "subtokenize": () => (/* binding */ subtokenize) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-chunked */ "../node_modules/micromark-util-chunked/dev/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /** * @typedef {import('micromark-util-types').Token} Token * @typedef {import('micromark-util-types').Chunk} Chunk * @typedef {import('micromark-util-types').Event} Event */ /** * Tokenize subcontent. * * @param {Event[]} events * @returns {boolean} */ function subtokenize(events) { /** @type {Record<string, number>} */ const jumps = {} let index = -1 /** @type {Event} */ let event /** @type {number|undefined} */ let lineIndex /** @type {number} */ let otherIndex /** @type {Event} */ let otherEvent /** @type {Event[]} */ let parameters /** @type {Event[]} */ let subevents /** @type {boolean|undefined} */ let more while (++index < events.length) { while (index in jumps) { index = jumps[index] } event = events[index] // Add a hook for the GFM tasklist extension, which needs to know if text // is in the first content of a list item. if ( index && event[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.chunkFlow && events[index - 1][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.listItemPrefix ) { (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(event[1]._tokenizer, 'expected `_tokenizer` on subtokens') subevents = event[1]._tokenizer.events otherIndex = 0 if ( otherIndex < subevents.length && subevents[otherIndex][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEndingBlank ) { otherIndex += 2 } if ( otherIndex < subevents.length && subevents[otherIndex][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.content ) { while (++otherIndex < subevents.length) { if (subevents[otherIndex][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.content) { break } if (subevents[otherIndex][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.chunkText) { subevents[otherIndex][1]._isInFirstContentOfListItem = true otherIndex++ } } } } // Enter. if (event[0] === 'enter') { if (event[1].contentType) { Object.assign(jumps, subcontent(events, index)) index = jumps[index] more = true } } // Exit. else if (event[1]._container) { otherIndex = index lineIndex = undefined while (otherIndex--) { otherEvent = events[otherIndex] if ( otherEvent[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding || otherEvent[1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEndingBlank ) { if (otherEvent[0] === 'enter') { if (lineIndex) { events[lineIndex][1].type = micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEndingBlank } otherEvent[1].type = micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding lineIndex = otherIndex } } else { break } } if (lineIndex) { // Fix position. event[1].end = Object.assign({}, events[lineIndex][1].start) // Switch container exit w/ line endings. parameters = events.slice(lineIndex, index) parameters.unshift(event) ;(0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.splice)(events, lineIndex, index - lineIndex + 1, parameters) } } } return !more } /** * Tokenize embedded tokens. * * @param {Event[]} events * @param {number} eventIndex * @returns {Record<string, number>} */ function subcontent(events, eventIndex) { const token = events[eventIndex][1] const context = events[eventIndex][2] let startPosition = eventIndex - 1 /** @type {number[]} */ const startPositions = [] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(token.contentType, 'expected `contentType` on subtokens') const tokenizer = token._tokenizer || context.parser[token.contentType](token.start) const childEvents = tokenizer.events /** @type {[number, number][]} */ const jumps = [] /** @type {Record<string, number>} */ const gaps = {} /** @type {Chunk[]} */ let stream /** @type {Token|undefined} */ let previous let index = -1 /** @type {Token|undefined} */ let current = token let adjust = 0 let start = 0 const breaks = [start] // Loop forward through the linked tokens to pass them in order to the // subtokenizer. while (current) { // Find the position of the event for this token. while (events[++startPosition][1] !== current) { // Empty. } (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( !previous || current.previous === previous, 'expected previous to match' ) ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(!previous || previous.next === current, 'expected next to match') startPositions.push(startPosition) if (!current._tokenizer) { stream = context.sliceStream(current) if (!current.next) { stream.push(micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_3__.codes.eof) } if (previous) { tokenizer.defineSkip(current.start) } if (current._isInFirstContentOfListItem) { tokenizer._gfmTasklistFirstContentOfListItem = true } tokenizer.write(stream) if (current._isInFirstContentOfListItem) { tokenizer._gfmTasklistFirstContentOfListItem = undefined } } // Unravel the next token. previous = current current = current.next } // Now, loop back through all events (and linked tokens), to figure out which // parts belong where. current = token while (++index < childEvents.length) { if ( // Find a void token that includes a break. childEvents[index][0] === 'exit' && childEvents[index - 1][0] === 'enter' && childEvents[index][1].type === childEvents[index - 1][1].type && childEvents[index][1].start.line !== childEvents[index][1].end.line ) { (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(current, 'expected a current token') start = index + 1 breaks.push(start) // Help GC. current._tokenizer = undefined current.previous = undefined current = current.next } } // Help GC. tokenizer.events = [] // If there’s one more token (which is the cases for lines that end in an // EOF), that’s perfect: the last point we found starts it. // If there isn’t then make sure any remaining content is added to it. if (current) { // Help GC. current._tokenizer = undefined current.previous = undefined ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(!current.next, 'expected no next token') } else { breaks.pop() } // Now splice the events from the subtokenizer into the current events, // moving back to front so that splice indices aren’t affected. index = breaks.length while (index--) { const slice = childEvents.slice(breaks[index], breaks[index + 1]) const start = startPositions.pop() ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(start !== undefined, 'expected a start position when splicing') jumps.unshift([start, start + slice.length - 1]) ;(0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.splice)(events, start, 2, slice) } index = -1 while (++index < jumps.length) { gaps[adjust + jumps[index][0]] = adjust + jumps[index][1] adjust += jumps[index][1] - jumps[index][0] - 1 } return gaps } /***/ }), /***/ "../node_modules/micromark-util-symbol/codes.js": /*!******************************************************!*\ !*** ../node_modules/micromark-util-symbol/codes.js ***! \******************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "codes": () => (/* binding */ codes) /* harmony export */ }); /** * Character codes. * * This module is compiled away! * * micromark works based on character codes. * This module contains constants for the ASCII block and the replacement * character. * A couple of them are handled in a special way, such as the line endings * (CR, LF, and CR+LF, commonly known as end-of-line: EOLs), the tab (horizontal * tab) and its expansion based on what column it’s at (virtual space), * and the end-of-file (eof) character. * As values are preprocessed before handling them, the actual characters LF, * CR, HT, and NUL (which is present as the replacement character), are * guaranteed to not exist. * * Unicode basic latin block. */ const codes = { carriageReturn: -5, lineFeed: -4, carriageReturnLineFeed: -3, horizontalTab: -2, virtualSpace: -1, eof: null, nul: 0, soh: 1, stx: 2, etx: 3, eot: 4, enq: 5, ack: 6, bel: 7, bs: 8, ht: 9, // `\t` lf: 10, // `\n` vt: 11, // `\v` ff: 12, // `\f` cr: 13, // `\r` so: 14, si: 15, dle: 16, dc1: 17, dc2: 18, dc3: 19, dc4: 20, nak: 21, syn: 22, etb: 23, can: 24, em: 25, sub: 26, esc: 27, fs: 28, gs: 29, rs: 30, us: 31, space: 32, exclamationMark: 33, // `!` quotationMark: 34, // `"` numberSign: 35, // `#` dollarSign: 36, // `$` percentSign: 37, // `%` ampersand: 38, // `&` apostrophe: 39, // `'` leftParenthesis: 40, // `(` rightParenthesis: 41, // `)` asterisk: 42, // `*` plusSign: 43, // `+` comma: 44, // `,` dash: 45, // `-` dot: 46, // `.` slash: 47, // `/` digit0: 48, // `0` digit1: 49, // `1` digit2: 50, // `2` digit3: 51, // `3` digit4: 52, // `4` digit5: 53, // `5` digit6: 54, // `6` digit7: 55, // `7` digit8: 56, // `8` digit9: 57, // `9` colon: 58, // `:` semicolon: 59, // `;` lessThan: 60, // `<` equalsTo: 61, // `=` greaterThan: 62, // `>` questionMark: 63, // `?` atSign: 64, // `@` uppercaseA: 65, // `A` uppercaseB: 66, // `B` uppercaseC: 67, // `C` uppercaseD: 68, // `D` uppercaseE: 69, // `E` uppercaseF: 70, // `F` uppercaseG: 71, // `G` uppercaseH: 72, // `H` uppercaseI: 73, // `I` uppercaseJ: 74, // `J` uppercaseK: 75, // `K` uppercaseL: 76, // `L` uppercaseM: 77, // `M` uppercaseN: 78, // `N` uppercaseO: 79, // `O` uppercaseP: 80, // `P` uppercaseQ: 81, // `Q` uppercaseR: 82, // `R` uppercaseS: 83, // `S` uppercaseT: 84, // `T` uppercaseU: 85, // `U` uppercaseV: 86, // `V` uppercaseW: 87, // `W` uppercaseX: 88, // `X` uppercaseY: 89, // `Y` uppercaseZ: 90, // `Z` leftSquareBracket: 91, // `[` backslash: 92, // `\` rightSquareBracket: 93, // `]` caret: 94, // `^` underscore: 95, // `_` graveAccent: 96, // `` ` `` lowercaseA: 97, // `a` lowercaseB: 98, // `b` lowercaseC: 99, // `c` lowercaseD: 100, // `d` lowercaseE: 101, // `e` lowercaseF: 102, // `f` lowercaseG: 103, // `g` lowercaseH: 104, // `h` lowercaseI: 105, // `i` lowercaseJ: 106, // `j` lowercaseK: 107, // `k` lowercaseL: 108, // `l` lowercaseM: 109, // `m` lowercaseN: 110, // `n` lowercaseO: 111, // `o` lowercaseP: 112, // `p` lowercaseQ: 113, // `q` lowercaseR: 114, // `r` lowercaseS: 115, // `s` lowercaseT: 116, // `t` lowercaseU: 117, // `u` lowercaseV: 118, // `v` lowercaseW: 119, // `w` lowercaseX: 120, // `x` lowercaseY: 121, // `y` lowercaseZ: 122, // `z` leftCurlyBrace: 123, // `{` verticalBar: 124, // `|` rightCurlyBrace: 125, // `}` tilde: 126, // `~` del: 127, // Unicode Specials block. byteOrderMarker: 65279, // Unicode Specials block. replacementCharacter: 65533 // `` } /***/ }), /***/ "../node_modules/micromark-util-symbol/constants.js": /*!**********************************************************!*\ !*** ../node_modules/micromark-util-symbol/constants.js ***! \**********************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "constants": () => (/* binding */ constants) /* harmony export */ }); /** * This module is compiled away! * * Parsing markdown comes with a couple of constants, such as minimum or maximum * sizes of certain sequences. * Additionally, there are a couple symbols used inside micromark. * These are all defined here, but compiled away by scripts. */ const constants = { attentionSideBefore: 1, // Symbol to mark an attention sequence as before content: `*a` attentionSideAfter: 2, // Symbol to mark an attention sequence as after content: `a*` atxHeadingOpeningFenceSizeMax: 6, // 6 number signs is fine, 7 isn’t. autolinkDomainSizeMax: 63, // 63 characters is fine, 64 is too many. autolinkSchemeSizeMax: 32, // 32 characters is fine, 33 is too many. cdataOpeningString: 'CDATA[', // And preceded by `<![`. characterGroupWhitespace: 1, // Symbol used to indicate a character is whitespace characterGroupPunctuation: 2, // Symbol used to indicate a character is punctuation characterReferenceDecimalSizeMax: 7, // `�`. characterReferenceHexadecimalSizeMax: 6, // `�`. characterReferenceNamedSizeMax: 31, // `∳`. codeFencedSequenceSizeMin: 3, // At least 3 ticks or tildes are needed. contentTypeDocument: 'document', contentTypeFlow: 'flow', contentTypeContent: 'content', contentTypeString: 'string', contentTypeText: 'text', hardBreakPrefixSizeMin: 2, // At least 2 trailing spaces are needed. htmlRaw: 1, // Symbol for `<script>` htmlComment: 2, // Symbol for `<!---->` htmlInstruction: 3, // Symbol for `<?php?>` htmlDeclaration: 4, // Symbol for `<!doctype>` htmlCdata: 5, // Symbol for `<![CDATA[]]>` htmlBasic: 6, // Symbol for `<div` htmlComplete: 7, // Symbol for `<x>` htmlRawSizeMax: 8, // Length of `textarea`. linkResourceDestinationBalanceMax: 32, // See: <https://spec.commonmark.org/0.30/#link-destination>, <https://github.com/remarkjs/react-markdown/issues/658#issuecomment-984345577> linkReferenceSizeMax: 999, // See: <https://spec.commonmark.org/0.30/#link-label> listItemValueSizeMax: 10, // See: <https://spec.commonmark.org/0.30/#ordered-list-marker> numericBaseDecimal: 10, numericBaseHexadecimal: 0x10, tabSize: 4, // Tabs have a hard-coded size of 4, per CommonMark. thematicBreakMarkerCountMin: 3, // At least 3 asterisks, dashes, or underscores are needed. v8MaxSafeChunkSize: 10000 // V8 (and potentially others) have problems injecting giant arrays into other arrays, hence we operate in chunks. } /***/ }), /***/ "../node_modules/micromark-util-symbol/types.js": /*!******************************************************!*\ !*** ../node_modules/micromark-util-symbol/types.js ***! \******************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "types": () => (/* binding */ types) /* harmony export */ }); /** * This module is compiled away! * * Here is the list of all types of tokens exposed by micromark, with a short * explanation of what they include and where they are found. * In picking names, generally, the rule is to be as explicit as possible * instead of reusing names. * For example, there is a `definitionDestination` and a `resourceDestination`, * instead of one shared name. */ const types = { // Generic type for data, such as in a title, a destination, etc. data: 'data', // Generic type for syntactic whitespace (tabs, virtual spaces, spaces). // Such as, between a fenced code fence and an info string. whitespace: 'whitespace', // Generic type for line endings (line feed, carriage return, carriage return + // line feed). lineEnding: 'lineEnding', // A line ending, but ending a blank line. lineEndingBlank: 'lineEndingBlank', // Generic type for whitespace (tabs, virtual spaces, spaces) at the start of a // line. linePrefix: 'linePrefix', // Generic type for whitespace (tabs, virtual spaces, spaces) at the end of a // line. lineSuffix: 'lineSuffix', // Whole ATX heading: // // ```markdown // # // ## Alpha // ### Bravo ### // ``` // // Includes `atxHeadingSequence`, `whitespace`, `atxHeadingText`. atxHeading: 'atxHeading', // Sequence of number signs in an ATX heading (`###`). atxHeadingSequence: 'atxHeadingSequence', // Content in an ATX heading (`alpha`). // Includes text. atxHeadingText: 'atxHeadingText', // Whole autolink (`<https://example.com>` or `<admin@example.com>`) // Includes `autolinkMarker` and `autolinkProtocol` or `autolinkEmail`. autolink: 'autolink', // Email autolink w/o markers (`admin@example.com`) autolinkEmail: 'autolinkEmail', // Marker around an `autolinkProtocol` or `autolinkEmail` (`<` or `>`). autolinkMarker: 'autolinkMarker', // Protocol autolink w/o markers (`https://example.com`) autolinkProtocol: 'autolinkProtocol', // A whole character escape (`\-`). // Includes `escapeMarker` and `characterEscapeValue`. characterEscape: 'characterEscape', // The escaped character (`-`). characterEscapeValue: 'characterEscapeValue', // A whole character reference (`&`, `≠`, or `𝌆`). // Includes `characterReferenceMarker`, an optional // `characterReferenceMarkerNumeric`, in which case an optional // `characterReferenceMarkerHexadecimal`, and a `characterReferenceValue`. characterReference: 'characterReference', // The start or end marker (`&` or `;`). characterReferenceMarker: 'characterReferenceMarker', // Mark reference as numeric (`#`). characterReferenceMarkerNumeric: 'characterReferenceMarkerNumeric', // Mark reference as numeric (`x` or `X`). characterReferenceMarkerHexadecimal: 'characterReferenceMarkerHexadecimal', // Value of character reference w/o markers (`amp`, `8800`, or `1D306`). characterReferenceValue: 'characterReferenceValue', // Whole fenced code: // // ````markdown // ```js // alert(1) // ``` // ```` codeFenced: 'codeFenced', // A fenced code fence, including whitespace, sequence, info, and meta // (` ```js `). codeFencedFence: 'codeFencedFence', // Sequence of grave accent or tilde characters (` ``` `) in a fence. codeFencedFenceSequence: 'codeFencedFenceSequence', // Info word (`js`) in a fence. // Includes string. codeFencedFenceInfo: 'codeFencedFenceInfo', // Meta words (`highlight="1"`) in a fence. // Includes string. codeFencedFenceMeta: 'codeFencedFenceMeta', // A line of code. codeFlowValue: 'codeFlowValue', // Whole indented code: // // ```markdown // alert(1) // ``` // // Includes `lineEnding`, `linePrefix`, and `codeFlowValue`. codeIndented: 'codeIndented', // A text code (``` `alpha` ```). // Includes `codeTextSequence`, `codeTextData`, `lineEnding`, and can include // `codeTextPadding`. codeText: 'codeText', codeTextData: 'codeTextData', // A space or line ending right after or before a tick. codeTextPadding: 'codeTextPadding', // A text code fence (` `` `). codeTextSequence: 'codeTextSequence', // Whole content: // // ```markdown // [a]: b // c // = // d // ``` // // Includes `paragraph` and `definition`. content: 'content', // Whole definition: // // ```markdown // [micromark]: https://github.com/micromark/micromark // ``` // // Includes `definitionLabel`, `definitionMarker`, `whitespace`, // `definitionDestination`, and optionally `lineEnding` and `definitionTitle`. definition: 'definition', // Destination of a definition (`https://github.com/micromark/micromark` or // `<https://github.com/micromark/micromark>`). // Includes `definitionDestinationLiteral` or `definitionDestinationRaw`. definitionDestination: 'definitionDestination', // Enclosed destination of a definition // (`<https://github.com/micromark/micromark>`). // Includes `definitionDestinationLiteralMarker` and optionally // `definitionDestinationString`. definitionDestinationLiteral: 'definitionDestinationLiteral', // Markers of an enclosed definition destination (`<` or `>`). definitionDestinationLiteralMarker: 'definitionDestinationLiteralMarker', // Unenclosed destination of a definition // (`https://github.com/micromark/micromark`). // Includes `definitionDestinationString`. definitionDestinationRaw: 'definitionDestinationRaw', // Text in an destination (`https://github.com/micromark/micromark`). // Includes string. definitionDestinationString: 'definitionDestinationString', // Label of a definition (`[micromark]`). // Includes `definitionLabelMarker` and `definitionLabelString`. definitionLabel: 'definitionLabel', // Markers of a definition label (`[` or `]`). definitionLabelMarker: 'definitionLabelMarker', // Value of a definition label (`micromark`). // Includes string. definitionLabelString: 'definitionLabelString', // Marker between a label and a destination (`:`). definitionMarker: 'definitionMarker', // Title of a definition (`"x"`, `'y'`, or `(z)`). // Includes `definitionTitleMarker` and optionally `definitionTitleString`. definitionTitle: 'definitionTitle', // Marker around a title of a definition (`"`, `'`, `(`, or `)`). definitionTitleMarker: 'definitionTitleMarker', // Data without markers in a title (`z`). // Includes string. definitionTitleString: 'definitionTitleString', // Emphasis (`*alpha*`). // Includes `emphasisSequence` and `emphasisText`. emphasis: 'emphasis', // Sequence of emphasis markers (`*` or `_`). emphasisSequence: 'emphasisSequence', // Emphasis text (`alpha`). // Includes text. emphasisText: 'emphasisText', // The character escape marker (`\`). escapeMarker: 'escapeMarker', // A hard break created with a backslash (`\\n`). // Includes `escapeMarker` (does not include the line ending) hardBreakEscape: 'hardBreakEscape', // A hard break created with trailing spaces (` \n`). // Does not include the line ending. hardBreakTrailing: 'hardBreakTrailing', // Flow HTML: // // ```markdown // <div // ``` // // Inlcudes `lineEnding`, `htmlFlowData`. htmlFlow: 'htmlFlow', htmlFlowData: 'htmlFlowData', // HTML in text (the tag in `a <i> b`). // Includes `lineEnding`, `htmlTextData`. htmlText: 'htmlText', htmlTextData: 'htmlTextData', // Whole image (`![alpha](bravo)`, `![alpha][bravo]`, `![alpha][]`, or // `![alpha]`). // Includes `label` and an optional `resource` or `reference`. image: 'image', // Whole link label (`[*alpha*]`). // Includes `labelLink` or `labelImage`, `labelText`, and `labelEnd`. label: 'label', // Text in an label (`*alpha*`). // Includes text. labelText: 'labelText', // Start a link label (`[`). // Includes a `labelMarker`. labelLink: 'labelLink', // Start an image label (`![`). // Includes `labelImageMarker` and `labelMarker`. labelImage: 'labelImage', // Marker of a label (`[` or `]`). labelMarker: 'labelMarker', // Marker to start an image (`!`). labelImageMarker: 'labelImageMarker', // End a label (`]`). // Includes `labelMarker`. labelEnd: 'labelEnd', // Whole link (`[alpha](bravo)`, `[alpha][bravo]`, `[alpha][]`, or `[alpha]`). // Includes `label` and an optional `resource` or `reference`. link: 'link', // Whole paragraph: // // ```markdown // alpha // bravo. // ``` // // Includes text. paragraph: 'paragraph', // A reference (`[alpha]` or `[]`). // Includes `referenceMarker` and an optional `referenceString`. reference: 'reference', // A reference marker (`[` or `]`). referenceMarker: 'referenceMarker', // Reference text (`alpha`). // Includes string. referenceString: 'referenceString', // A resource (`(https://example.com "alpha")`). // Includes `resourceMarker`, an optional `resourceDestination` with an optional // `whitespace` and `resourceTitle`. resource: 'resource', // A resource destination (`https://example.com`). // Includes `resourceDestinationLiteral` or `resourceDestinationRaw`. resourceDestination: 'resourceDestination', // A literal resource destination (`<https://example.com>`). // Includes `resourceDestinationLiteralMarker` and optionally // `resourceDestinationString`. resourceDestinationLiteral: 'resourceDestinationLiteral', // A resource destination marker (`<` or `>`). resourceDestinationLiteralMarker: 'resourceDestinationLiteralMarker', // A raw resource destination (`https://example.com`). // Includes `resourceDestinationString`. resourceDestinationRaw: 'resourceDestinationRaw', // Resource destination text (`https://example.com`). // Includes string. resourceDestinationString: 'resourceDestinationString', // A resource marker (`(` or `)`). resourceMarker: 'resourceMarker', // A resource title (`"alpha"`, `'alpha'`, or `(alpha)`). // Includes `resourceTitleMarker` and optionally `resourceTitleString`. resourceTitle: 'resourceTitle', // A resource title marker (`"`, `'`, `(`, or `)`). resourceTitleMarker: 'resourceTitleMarker', // Resource destination title (`alpha`). // Includes string. resourceTitleString: 'resourceTitleString', // Whole setext heading: // // ```markdown // alpha // bravo // ===== // ``` // // Includes `setextHeadingText`, `lineEnding`, `linePrefix`, and // `setextHeadingLine`. setextHeading: 'setextHeading', // Content in a setext heading (`alpha\nbravo`). // Includes text. setextHeadingText: 'setextHeadingText', // Underline in a setext heading, including whitespace suffix (`==`). // Includes `setextHeadingLineSequence`. setextHeadingLine: 'setextHeadingLine', // Sequence of equals or dash characters in underline in a setext heading (`-`). setextHeadingLineSequence: 'setextHeadingLineSequence', // Strong (`**alpha**`). // Includes `strongSequence` and `strongText`. strong: 'strong', // Sequence of strong markers (`**` or `__`). strongSequence: 'strongSequence', // Strong text (`alpha`). // Includes text. strongText: 'strongText', // Whole thematic break: // // ```markdown // * * * // ``` // // Includes `thematicBreakSequence` and `whitespace`. thematicBreak: 'thematicBreak', // A sequence of one or more thematic break markers (`***`). thematicBreakSequence: 'thematicBreakSequence', // Whole block quote: // // ```markdown // > a // > // > b // ``` // // Includes `blockQuotePrefix` and flow. blockQuote: 'blockQuote', // The `>` or `> ` of a block quote. blockQuotePrefix: 'blockQuotePrefix', // The `>` of a block quote prefix. blockQuoteMarker: 'blockQuoteMarker', // The optional ` ` of a block quote prefix. blockQuotePrefixWhitespace: 'blockQuotePrefixWhitespace', // Whole unordered list: // // ```markdown // - a // b // ``` // // Includes `listItemPrefix`, flow, and optionally `listItemIndent` on further // lines. listOrdered: 'listOrdered', // Whole ordered list: // // ```markdown // 1. a // b // ``` // // Includes `listItemPrefix`, flow, and optionally `listItemIndent` on further // lines. listUnordered: 'listUnordered', // The indent of further list item lines. listItemIndent: 'listItemIndent', // A marker, as in, `*`, `+`, `-`, `.`, or `)`. listItemMarker: 'listItemMarker', // The thing that starts a list item, such as `1. `. // Includes `listItemValue` if ordered, `listItemMarker`, and // `listItemPrefixWhitespace` (unless followed by a line ending). listItemPrefix: 'listItemPrefix', // The whitespace after a marker. listItemPrefixWhitespace: 'listItemPrefixWhitespace', // The numerical value of an ordered item. listItemValue: 'listItemValue', // Internal types used for subtokenizers, compiled away chunkDocument: 'chunkDocument', chunkContent: 'chunkContent', chunkFlow: 'chunkFlow', chunkText: 'chunkText', chunkString: 'chunkString' } /***/ }), /***/ "../node_modules/micromark-util-symbol/values.js": /*!*******************************************************!*\ !*** ../node_modules/micromark-util-symbol/values.js ***! \*******************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "values": () => (/* binding */ values) /* harmony export */ }); // This module is compiled away! // // While micromark works based on character codes, this module includes the // string versions of ’em. // The C0 block, except for LF, CR, HT, and w/ the replacement character added, // are available here. const values = { ht: '\t', lf: '\n', cr: '\r', space: ' ', exclamationMark: '!', quotationMark: '"', numberSign: '#', dollarSign: '$', percentSign: '%', ampersand: '&', apostrophe: "'", leftParenthesis: '(', rightParenthesis: ')', asterisk: '*', plusSign: '+', comma: ',', dash: '-', dot: '.', slash: '/', digit0: '0', digit1: '1', digit2: '2', digit3: '3', digit4: '4', digit5: '5', digit6: '6', digit7: '7', digit8: '8', digit9: '9', colon: ':', semicolon: ';', lessThan: '<', equalsTo: '=', greaterThan: '>', questionMark: '?', atSign: '@', uppercaseA: 'A', uppercaseB: 'B', uppercaseC: 'C', uppercaseD: 'D', uppercaseE: 'E', uppercaseF: 'F', uppercaseG: 'G', uppercaseH: 'H', uppercaseI: 'I', uppercaseJ: 'J', uppercaseK: 'K', uppercaseL: 'L', uppercaseM: 'M', uppercaseN: 'N', uppercaseO: 'O', uppercaseP: 'P', uppercaseQ: 'Q', uppercaseR: 'R', uppercaseS: 'S', uppercaseT: 'T', uppercaseU: 'U', uppercaseV: 'V', uppercaseW: 'W', uppercaseX: 'X', uppercaseY: 'Y', uppercaseZ: 'Z', leftSquareBracket: '[', backslash: '\\', rightSquareBracket: ']', caret: '^', underscore: '_', graveAccent: '`', lowercaseA: 'a', lowercaseB: 'b', lowercaseC: 'c', lowercaseD: 'd', lowercaseE: 'e', lowercaseF: 'f', lowercaseG: 'g', lowercaseH: 'h', lowercaseI: 'i', lowercaseJ: 'j', lowercaseK: 'k', lowercaseL: 'l', lowercaseM: 'm', lowercaseN: 'n', lowercaseO: 'o', lowercaseP: 'p', lowercaseQ: 'q', lowercaseR: 'r', lowercaseS: 's', lowercaseT: 't', lowercaseU: 'u', lowercaseV: 'v', lowercaseW: 'w', lowercaseX: 'x', lowercaseY: 'y', lowercaseZ: 'z', leftCurlyBrace: '{', verticalBar: '|', rightCurlyBrace: '}', tilde: '~', replacementCharacter: '' } /***/ }), /***/ "../node_modules/micromark/dev/lib/constructs.js": /*!*******************************************************!*\ !*** ../node_modules/micromark/dev/lib/constructs.js ***! \*******************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "attentionMarkers": () => (/* binding */ attentionMarkers), /* harmony export */ "contentInitial": () => (/* binding */ contentInitial), /* harmony export */ "disable": () => (/* binding */ disable), /* harmony export */ "document": () => (/* binding */ document), /* harmony export */ "flow": () => (/* binding */ flow), /* harmony export */ "flowInitial": () => (/* binding */ flowInitial), /* harmony export */ "insideSpan": () => (/* binding */ insideSpan), /* harmony export */ "string": () => (/* binding */ string), /* harmony export */ "text": () => (/* binding */ text) /* harmony export */ }); /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/list.js"); /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/block-quote.js"); /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/definition.js"); /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/code-indented.js"); /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/heading-atx.js"); /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/thematic-break.js"); /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/setext-underline.js"); /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/html-flow.js"); /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/code-fenced.js"); /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/character-reference.js"); /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/character-escape.js"); /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/line-ending.js"); /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/label-start-image.js"); /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/attention.js"); /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/autolink.js"); /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/html-text.js"); /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/label-start-link.js"); /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/hard-break-escape.js"); /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/label-end.js"); /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/code-text.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var _initialize_text_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./initialize/text.js */ "../node_modules/micromark/dev/lib/initialize/text.js"); /** * @typedef {import('micromark-util-types').Extension} Extension */ /** @type {Extension['document']} */ const document = { [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.asterisk]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.list, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.plusSign]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.list, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.dash]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.list, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.digit0]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.list, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.digit1]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.list, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.digit2]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.list, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.digit3]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.list, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.digit4]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.list, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.digit5]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.list, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.digit6]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.list, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.digit7]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.list, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.digit8]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.list, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.digit9]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.list, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.greaterThan]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_2__.blockQuote } /** @type {Extension['contentInitial']} */ const contentInitial = { [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.leftSquareBracket]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_3__.definition } /** @type {Extension['flowInitial']} */ const flowInitial = { [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.horizontalTab]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_4__.codeIndented, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.virtualSpace]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_4__.codeIndented, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.space]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_4__.codeIndented } /** @type {Extension['flow']} */ const flow = { [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.numberSign]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_5__.headingAtx, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.asterisk]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_6__.thematicBreak, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.dash]: [micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_7__.setextUnderline, micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_6__.thematicBreak], [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.lessThan]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_8__.htmlFlow, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.equalsTo]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_7__.setextUnderline, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.underscore]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_6__.thematicBreak, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.graveAccent]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_9__.codeFenced, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.tilde]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_9__.codeFenced } /** @type {Extension['string']} */ const string = { [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.ampersand]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_10__.characterReference, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.backslash]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_11__.characterEscape } /** @type {Extension['text']} */ const text = { [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.carriageReturn]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_12__.lineEnding, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.lineFeed]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_12__.lineEnding, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.carriageReturnLineFeed]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_12__.lineEnding, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.exclamationMark]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_13__.labelStartImage, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.ampersand]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_10__.characterReference, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.asterisk]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_14__.attention, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.lessThan]: [micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_15__.autolink, micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_16__.htmlText], [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.leftSquareBracket]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_17__.labelStartLink, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.backslash]: [micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_18__.hardBreakEscape, micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_11__.characterEscape], [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.rightSquareBracket]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_19__.labelEnd, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.underscore]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_14__.attention, [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.graveAccent]: micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_20__.codeText } /** @type {Extension['insideSpan']} */ const insideSpan = {null: [micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_14__.attention, _initialize_text_js__WEBPACK_IMPORTED_MODULE_21__.resolver]} /** @type {Extension['attentionMarkers']} */ const attentionMarkers = {null: [micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.asterisk, micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.underscore]} /** @type {Extension['disable']} */ const disable = {null: []} /***/ }), /***/ "../node_modules/micromark/dev/lib/create-tokenizer.js": /*!*************************************************************!*\ !*** ../node_modules/micromark/dev/lib/create-tokenizer.js ***! \*************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "createTokenizer": () => (/* binding */ createTokenizer) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var debug__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! debug */ "../node_modules/debug/src/browser.js"); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_chunked__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-chunked */ "../node_modules/micromark-util-chunked/dev/index.js"); /* harmony import */ var micromark_util_resolve_all__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-resolve-all */ "../node_modules/micromark-util-resolve-all/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! micromark-util-symbol/values.js */ "../node_modules/micromark-util-symbol/values.js"); /** * @typedef {import('micromark-util-types').Code} Code * @typedef {import('micromark-util-types').Chunk} Chunk * @typedef {import('micromark-util-types').Point} Point * @typedef {import('micromark-util-types').Token} Token * @typedef {import('micromark-util-types').Effects} Effects * @typedef {import('micromark-util-types').State} State * @typedef {import('micromark-util-types').Construct} Construct * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct * @typedef {import('micromark-util-types').ConstructRecord} ConstructRecord * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext * @typedef {import('micromark-util-types').ParseContext} ParseContext */ /** * @typedef Info * @property {() => void} restore * @property {number} from * * @callback ReturnHandle * Handle a successful run. * @param {Construct} construct * @param {Info} info * @returns {void} */ const debug = debug__WEBPACK_IMPORTED_MODULE_1__('micromark') /** * Create a tokenizer. * Tokenizers deal with one type of data (e.g., containers, flow, text). * The parser is the object dealing with it all. * `initialize` works like other constructs, except that only its `tokenize` * function is used, in which case it doesn’t receive an `ok` or `nok`. * `from` can be given to set the point before the first character, although * when further lines are indented, they must be set with `defineSkip`. * * @param {ParseContext} parser * @param {InitialConstruct} initialize * @param {Omit<Point, '_index'|'_bufferIndex'>} [from] * @returns {TokenizeContext} */ function createTokenizer(parser, initialize, from) { /** @type {Point} */ let point = Object.assign( from ? Object.assign({}, from) : {line: 1, column: 1, offset: 0}, {_index: 0, _bufferIndex: -1} ) /** @type {Record<string, number>} */ const columnStart = {} /** @type {Array<Construct>} */ const resolveAllConstructs = [] /** @type {Array<Chunk>} */ let chunks = [] /** @type {Array<Token>} */ let stack = [] /** @type {boolean|undefined} */ let consumed = true /** * Tools used for tokenizing. * * @type {Effects} */ const effects = { consume, enter, exit, attempt: constructFactory(onsuccessfulconstruct), check: constructFactory(onsuccessfulcheck), interrupt: constructFactory(onsuccessfulcheck, {interrupt: true}) } /** * State and tools for resolving and serializing. * * @type {TokenizeContext} */ const context = { previous: micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof, code: micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof, containerState: {}, events: [], parser, sliceStream, sliceSerialize, now, defineSkip, write } /** * The state function. * * @type {State|void} */ let state = initialize.tokenize.call(context, effects) /** * Track which character we expect to be consumed, to catch bugs. * * @type {Code} */ let expectedCode if (initialize.resolveAll) { resolveAllConstructs.push(initialize) } return context /** @type {TokenizeContext['write']} */ function write(slice) { chunks = (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_3__.push)(chunks, slice) main() // Exit if we’re not done, resolve might change stuff. if (chunks[chunks.length - 1] !== micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.eof) { return [] } addResult(initialize, 0) // Otherwise, resolve, and exit. context.events = (0,micromark_util_resolve_all__WEBPACK_IMPORTED_MODULE_4__.resolveAll)(resolveAllConstructs, context.events, context) return context.events } // // Tools. // /** @type {TokenizeContext['sliceSerialize']} */ function sliceSerialize(token, expandTabs) { return serializeChunks(sliceStream(token), expandTabs) } /** @type {TokenizeContext['sliceStream']} */ function sliceStream(token) { return sliceChunks(chunks, token) } /** @type {TokenizeContext['now']} */ function now() { return Object.assign({}, point) } /** @type {TokenizeContext['defineSkip']} */ function defineSkip(value) { columnStart[value.line] = value.column accountForPotentialSkip() debug('position: define skip: `%j`', point) } // // State management. // /** * Main loop (note that `_index` and `_bufferIndex` in `point` are modified by * `consume`). * Here is where we walk through the chunks, which either include strings of * several characters, or numerical character codes. * The reason to do this in a loop instead of a call is so the stack can * drain. * * @returns {void} */ function main() { /** @type {number} */ let chunkIndex while (point._index < chunks.length) { const chunk = chunks[point._index] // If we’re in a buffer chunk, loop through it. if (typeof chunk === 'string') { chunkIndex = point._index if (point._bufferIndex < 0) { point._bufferIndex = 0 } while ( point._index === chunkIndex && point._bufferIndex < chunk.length ) { go(chunk.charCodeAt(point._bufferIndex)) } } else { go(chunk) } } } /** * Deal with one code. * * @param {Code} code * @returns {void} */ function go(code) { (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(consumed === true, 'expected character to be consumed') consumed = undefined debug('main: passing `%s` to %s', code, state && state.name) expectedCode = code ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(typeof state === 'function', 'expected state') state = state(code) } /** @type {Effects['consume']} */ function consume(code) { (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === expectedCode, 'expected given code to equal expected code') debug('consume: `%s`', code) ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( consumed === undefined, 'expected code to not have been consumed: this might be because `return x(code)` instead of `return x` was used' ) ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( code === null ? context.events.length === 0 || context.events[context.events.length - 1][0] === 'exit' : context.events[context.events.length - 1][0] === 'enter', 'expected last token to be open' ) if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownLineEnding)(code)) { point.line++ point.column = 1 point.offset += code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.carriageReturnLineFeed ? 2 : 1 accountForPotentialSkip() debug('position: after eol: `%j`', point) } else if (code !== micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.virtualSpace) { point.column++ point.offset++ } // Not in a string chunk. if (point._bufferIndex < 0) { point._index++ } else { point._bufferIndex++ // At end of string chunk. // @ts-expect-error Points w/ non-negative `_bufferIndex` reference // strings. if (point._bufferIndex === chunks[point._index].length) { point._bufferIndex = -1 point._index++ } } // Expose the previous character. context.previous = code // Mark as consumed. consumed = true } /** @type {Effects['enter']} */ function enter(type, fields) { /** @type {Token} */ // @ts-expect-error Patch instead of assign required fields to help GC. const token = fields || {} token.type = type token.start = now() ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(typeof type === 'string', 'expected string type') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(type.length > 0, 'expected non-empty string') debug('enter: `%s`', type) context.events.push(['enter', token, context]) stack.push(token) return token } /** @type {Effects['exit']} */ function exit(type) { (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(typeof type === 'string', 'expected string type') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(type.length > 0, 'expected non-empty string') const token = stack.pop() ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(token, 'cannot close w/o open tokens') token.end = now() ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(type === token.type, 'expected exit token to match current token') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( !( token.start._index === token.end._index && token.start._bufferIndex === token.end._bufferIndex ), 'expected non-empty token (`' + type + '`)' ) debug('exit: `%s`', token.type) context.events.push(['exit', token, context]) return token } /** * Use results. * * @type {ReturnHandle} */ function onsuccessfulconstruct(construct, info) { addResult(construct, info.from) } /** * Discard results. * * @type {ReturnHandle} */ function onsuccessfulcheck(_, info) { info.restore() } /** * Factory to attempt/check/interrupt. * * @param {ReturnHandle} onreturn * @param {Record<string, unknown>} [fields] */ function constructFactory(onreturn, fields) { return hook /** * Handle either an object mapping codes to constructs, a list of * constructs, or a single construct. * * @param {Construct|Array<Construct>|ConstructRecord} constructs * @param {State} returnState * @param {State} [bogusState] * @returns {State} */ function hook(constructs, returnState, bogusState) { /** @type {Array<Construct>} */ let listOfConstructs /** @type {number} */ let constructIndex /** @type {Construct} */ let currentConstruct /** @type {Info} */ let info return Array.isArray(constructs) ? /* c8 ignore next 1 */ handleListOfConstructs(constructs) : 'tokenize' in constructs ? // @ts-expect-error Looks like a construct. handleListOfConstructs([constructs]) : handleMapOfConstructs(constructs) /** * Handle a list of construct. * * @param {ConstructRecord} map * @returns {State} */ function handleMapOfConstructs(map) { return start /** @type {State} */ function start(code) { const def = code !== null && map[code] const all = code !== null && map.null const list = [ // To do: add more extension tests. /* c8 ignore next 2 */ ...(Array.isArray(def) ? def : def ? [def] : []), ...(Array.isArray(all) ? all : all ? [all] : []) ] return handleListOfConstructs(list)(code) } } /** * Handle a list of construct. * * @param {Array<Construct>} list * @returns {State} */ function handleListOfConstructs(list) { listOfConstructs = list constructIndex = 0 if (list.length === 0) { (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(bogusState, 'expected `bogusState` to be given') return bogusState } return handleConstruct(list[constructIndex]) } /** * Handle a single construct. * * @param {Construct} construct * @returns {State} */ function handleConstruct(construct) { return start /** @type {State} */ function start(code) { // To do: not needed to store if there is no bogus state, probably? // Currently doesn’t work because `inspect` in document does a check // w/o a bogus, which doesn’t make sense. But it does seem to help perf // by not storing. info = store() currentConstruct = construct if (!construct.partial) { context.currentConstruct = construct } if ( construct.name && context.parser.constructs.disable.null.includes(construct.name) ) { return nok(code) } return construct.tokenize.call( // If we do have fields, create an object w/ `context` as its // prototype. // This allows a “live binding”, which is needed for `interrupt`. fields ? Object.assign(Object.create(context), fields) : context, effects, ok, nok )(code) } } /** @type {State} */ function ok(code) { (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === expectedCode, 'expected code') consumed = true onreturn(currentConstruct, info) return returnState } /** @type {State} */ function nok(code) { (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(code === expectedCode, 'expected code') consumed = true info.restore() if (++constructIndex < listOfConstructs.length) { return handleConstruct(listOfConstructs[constructIndex]) } return bogusState } } } /** * @param {Construct} construct * @param {number} from * @returns {void} */ function addResult(construct, from) { if (construct.resolveAll && !resolveAllConstructs.includes(construct)) { resolveAllConstructs.push(construct) } if (construct.resolve) { (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_3__.splice)( context.events, from, context.events.length - from, construct.resolve(context.events.slice(from), context) ) } if (construct.resolveTo) { context.events = construct.resolveTo(context.events, context) } (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( construct.partial || context.events.length === 0 || context.events[context.events.length - 1][0] === 'exit', 'expected last token to end' ) } /** * Store state. * * @returns {Info} */ function store() { const startPoint = now() const startPrevious = context.previous const startCurrentConstruct = context.currentConstruct const startEventsIndex = context.events.length const startStack = Array.from(stack) return {restore, from: startEventsIndex} /** * Restore state. * * @returns {void} */ function restore() { point = startPoint context.previous = startPrevious context.currentConstruct = startCurrentConstruct context.events.length = startEventsIndex stack = startStack accountForPotentialSkip() debug('position: restore: `%j`', point) } } /** * Move the current point a bit forward in the line when it’s on a column * skip. * * @returns {void} */ function accountForPotentialSkip() { if (point.line in columnStart && point.column < 2) { point.column = columnStart[point.line] point.offset += columnStart[point.line] - 1 } } } /** * Get the chunks from a slice of chunks in the range of a token. * * @param {Array<Chunk>} chunks * @param {Pick<Token, 'start'|'end'>} token * @returns {Array<Chunk>} */ function sliceChunks(chunks, token) { const startIndex = token.start._index const startBufferIndex = token.start._bufferIndex const endIndex = token.end._index const endBufferIndex = token.end._bufferIndex /** @type {Array<Chunk>} */ let view if (startIndex === endIndex) { (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(endBufferIndex > -1, 'expected non-negative end buffer index') ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(startBufferIndex > -1, 'expected non-negative start buffer index') // @ts-expect-error `_bufferIndex` is used on string chunks. view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)] } else { view = chunks.slice(startIndex, endIndex) if (startBufferIndex > -1) { // @ts-expect-error `_bufferIndex` is used on string chunks. view[0] = view[0].slice(startBufferIndex) } if (endBufferIndex > 0) { // @ts-expect-error `_bufferIndex` is used on string chunks. view.push(chunks[endIndex].slice(0, endBufferIndex)) } } return view } /** * Get the string value of a slice of chunks. * * @param {Array<Chunk>} chunks * @param {boolean} [expandTabs=false] * @returns {string} */ function serializeChunks(chunks, expandTabs) { let index = -1 /** @type {Array<string>} */ const result = [] /** @type {boolean|undefined} */ let atTab while (++index < chunks.length) { const chunk = chunks[index] /** @type {string} */ let value if (typeof chunk === 'string') { value = chunk } else switch (chunk) { case micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.carriageReturn: { value = micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_6__.values.cr break } case micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.lineFeed: { value = micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_6__.values.lf break } case micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.carriageReturnLineFeed: { value = micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_6__.values.cr + micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_6__.values.lf break } case micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.horizontalTab: { value = expandTabs ? micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_6__.values.space : micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_6__.values.ht break } case micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.virtualSpace: { if (!expandTabs && atTab) continue value = micromark_util_symbol_values_js__WEBPACK_IMPORTED_MODULE_6__.values.space break } default: { (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(typeof chunk === 'number', 'expected number') // Currently only replacement character. value = String.fromCharCode(chunk) } } atTab = chunk === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_2__.codes.horizontalTab result.push(value) } return result.join('') } /***/ }), /***/ "../node_modules/micromark/dev/lib/initialize/content.js": /*!***************************************************************!*\ !*** ../node_modules/micromark/dev/lib/initialize/content.js ***! \***************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "content": () => (/* binding */ content) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js"); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /** * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct * @typedef {import('micromark-util-types').Initializer} Initializer * @typedef {import('micromark-util-types').Token} Token * @typedef {import('micromark-util-types').State} State */ /** @type {InitialConstruct} */ const content = {tokenize: initializeContent} /** @type {Initializer} */ function initializeContent(effects) { const contentStart = effects.attempt( this.parser.constructs.contentInitial, afterContentStartConstruct, paragraphInitial ) /** @type {Token} */ let previous return contentStart /** @type {State} */ function afterContentStartConstruct(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_2__.markdownLineEnding)(code), 'expected eol or eof' ) if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof) { effects.consume(code) return } effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.lineEnding) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.lineEnding) return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_4__.factorySpace)(effects, contentStart, micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.linePrefix) } /** @type {State} */ function paragraphInitial(code) { (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( code !== micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof && !(0,micromark_util_character__WEBPACK_IMPORTED_MODULE_2__.markdownLineEnding)(code), 'expected anything other than a line ending or EOF' ) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.paragraph) return lineStart(code) } /** @type {State} */ function lineStart(code) { const token = effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.chunkText, { contentType: micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_5__.constants.contentTypeText, previous }) if (previous) { previous.next = token } previous = token return data(code) } /** @type {State} */ function data(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_1__.codes.eof) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.chunkText) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.paragraph) effects.consume(code) return } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_2__.markdownLineEnding)(code)) { effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_3__.types.chunkText) return lineStart } // Data. effects.consume(code) return data } } /***/ }), /***/ "../node_modules/micromark/dev/lib/initialize/document.js": /*!****************************************************************!*\ !*** ../node_modules/micromark/dev/lib/initialize/document.js ***! \****************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "document": () => (/* binding */ document) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js"); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /* harmony import */ var micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-chunked */ "../node_modules/micromark-util-chunked/dev/index.js"); /** * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct * @typedef {import('micromark-util-types').Initializer} Initializer * @typedef {import('micromark-util-types').Construct} Construct * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext * @typedef {import('micromark-util-types').Tokenizer} Tokenizer * @typedef {import('micromark-util-types').Token} Token * @typedef {import('micromark-util-types').State} State * @typedef {import('micromark-util-types').Point} Point */ /** * @typedef {Record<string, unknown>} StackState * @typedef {[Construct, StackState]} StackItem */ /** @type {InitialConstruct} */ const document = {tokenize: initializeDocument} /** @type {Construct} */ const containerConstruct = {tokenize: tokenizeContainer} /** @type {Initializer} */ function initializeDocument(effects) { const self = this /** @type {Array<StackItem>} */ const stack = [] let continued = 0 /** @type {TokenizeContext|undefined} */ let childFlow /** @type {Token|undefined} */ let childToken /** @type {number} */ let lineStartOffset return start /** @type {State} */ function start(code) { // First we iterate through the open blocks, starting with the root // document, and descending through last children down to the last open // block. // Each block imposes a condition that the line must satisfy if the block is // to remain open. // For example, a block quote requires a `>` character. // A paragraph requires a non-blank line. // In this phase we may match all or just some of the open blocks. // But we cannot close unmatched blocks yet, because we may have a lazy // continuation line. if (continued < stack.length) { const item = stack[continued] self.containerState = item[1] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( item[0].continuation, 'expected `continuation` to be defined on container construct' ) return effects.attempt( item[0].continuation, documentContinue, checkNewContainers )(code) } // Done. return checkNewContainers(code) } /** @type {State} */ function documentContinue(code) { (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( self.containerState, 'expected `containerState` to be defined after continuation' ) continued++ // Note: this field is called `_closeFlow` but it also closes containers. // Perhaps a good idea to rename it but it’s already used in the wild by // extensions. if (self.containerState._closeFlow) { self.containerState._closeFlow = undefined if (childFlow) { closeFlow() } // Note: this algorithm for moving events around is similar to the // algorithm when dealing with lazy lines in `writeToChild`. const indexBeforeExits = self.events.length let indexBeforeFlow = indexBeforeExits /** @type {Point|undefined} */ let point // Find the flow chunk. while (indexBeforeFlow--) { if ( self.events[indexBeforeFlow][0] === 'exit' && self.events[indexBeforeFlow][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.chunkFlow ) { point = self.events[indexBeforeFlow][1].end break } } (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(point, 'could not find previous flow chunk') exitContainers(continued) // Fix positions. let index = indexBeforeExits while (index < self.events.length) { self.events[index][1].end = Object.assign({}, point) index++ } // Inject the exits earlier (they’re still also at the end). (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.splice)( self.events, indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits) ) // Discard the duplicate exits. self.events.length = index return checkNewContainers(code) } return start(code) } /** @type {State} */ function checkNewContainers(code) { // Next, after consuming the continuation markers for existing blocks, we // look for new block starts (e.g. `>` for a block quote). // If we encounter a new block start, we close any blocks unmatched in // step 1 before creating the new block as a child of the last matched // block. if (continued === stack.length) { // No need to `check` whether there’s a container, of `exitContainers` // would be moot. // We can instead immediately `attempt` to parse one. if (!childFlow) { return documentContinued(code) } // If we have concrete content, such as block HTML or fenced code, // we can’t have containers “pierce” into them, so we can immediately // start. if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) { return flowStart(code) } // If we do have flow, it could still be a blank line, // but we’d be interrupting it w/ a new container if there’s a current // construct. self.interrupt = Boolean( childFlow.currentConstruct && !childFlow._gfmTableDynamicInterruptHack ) } // Check if there is a new container. self.containerState = {} return effects.check( containerConstruct, thereIsANewContainer, thereIsNoNewContainer )(code) } /** @type {State} */ function thereIsANewContainer(code) { if (childFlow) closeFlow() exitContainers(continued) return documentContinued(code) } /** @type {State} */ function thereIsNoNewContainer(code) { self.parser.lazy[self.now().line] = continued !== stack.length lineStartOffset = self.now().offset return flowStart(code) } /** @type {State} */ function documentContinued(code) { // Try new containers. self.containerState = {} return effects.attempt( containerConstruct, containerContinue, flowStart )(code) } /** @type {State} */ function containerContinue(code) { (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( self.currentConstruct, 'expected `currentConstruct` to be defined on tokenizer' ) ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( self.containerState, 'expected `containerState` to be defined on tokenizer' ) continued++ stack.push([self.currentConstruct, self.containerState]) // Try another. return documentContinued(code) } /** @type {State} */ function flowStart(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_3__.codes.eof) { if (childFlow) closeFlow() exitContainers(0) effects.consume(code) return } childFlow = childFlow || self.parser.flow(self.now()) effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.chunkFlow, { contentType: micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_4__.constants.contentTypeFlow, previous: childToken, _tokenizer: childFlow }) return flowContinue(code) } /** @type {State} */ function flowContinue(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_3__.codes.eof) { writeToChild(effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.chunkFlow), true) exitContainers(0) effects.consume(code) return } if ((0,micromark_util_character__WEBPACK_IMPORTED_MODULE_5__.markdownLineEnding)(code)) { effects.consume(code) writeToChild(effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.chunkFlow)) // Get ready for the next line. continued = 0 self.interrupt = undefined return start } effects.consume(code) return flowContinue } /** * @param {Token} token * @param {boolean} [eof] * @returns {void} */ function writeToChild(token, eof) { (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(childFlow, 'expected `childFlow` to be defined when continuing') const stream = self.sliceStream(token) if (eof) stream.push(null) token.previous = childToken if (childToken) childToken.next = token childToken = token childFlow.defineSkip(token.start) childFlow.write(stream) // Alright, so we just added a lazy line: // // ```markdown // > a // b. // // Or: // // > ~~~c // d // // Or: // // > | e | // f // ``` // // The construct in the second example (fenced code) does not accept lazy // lines, so it marked itself as done at the end of its first line, and // then the content construct parses `d`. // Most constructs in markdown match on the first line: if the first line // forms a construct, a non-lazy line can’t “unmake” it. // // The construct in the third example is potentially a GFM table, and // those are *weird*. // It *could* be a table, from the first line, if the following line // matches a condition. // In this case, that second line is lazy, which “unmakes” the first line // and turns the whole into one content block. // // We’ve now parsed the non-lazy and the lazy line, and can figure out // whether the lazy line started a new flow block. // If it did, we exit the current containers between the two flow blocks. if (self.parser.lazy[token.start.line]) { let index = childFlow.events.length while (index--) { if ( // The token starts before the line ending… childFlow.events[index][1].start.offset < lineStartOffset && // …and either is not ended yet… (!childFlow.events[index][1].end || // …or ends after it. childFlow.events[index][1].end.offset > lineStartOffset) ) { // Exit: there’s still something open, which means it’s a lazy line // part of something. return } } // Note: this algorithm for moving events around is similar to the // algorithm when closing flow in `documentContinue`. const indexBeforeExits = self.events.length let indexBeforeFlow = indexBeforeExits /** @type {boolean|undefined} */ let seen /** @type {Point|undefined} */ let point // Find the previous chunk (the one before the lazy line). while (indexBeforeFlow--) { if ( self.events[indexBeforeFlow][0] === 'exit' && self.events[indexBeforeFlow][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.chunkFlow ) { if (seen) { point = self.events[indexBeforeFlow][1].end break } seen = true } } (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(point, 'could not find previous flow chunk') exitContainers(continued) // Fix positions. index = indexBeforeExits while (index < self.events.length) { self.events[index][1].end = Object.assign({}, point) index++ } // Inject the exits earlier (they’re still also at the end). (0,micromark_util_chunked__WEBPACK_IMPORTED_MODULE_2__.splice)( self.events, indexBeforeFlow + 1, 0, self.events.slice(indexBeforeExits) ) // Discard the duplicate exits. self.events.length = index } } /** * @param {number} size * @returns {void} */ function exitContainers(size) { let index = stack.length // Exit open containers. while (index-- > size) { const entry = stack[index] self.containerState = entry[1] ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( entry[0].exit, 'expected `exit` to be defined on container construct' ) entry[0].exit.call(self, effects) } stack.length = size } function closeFlow() { (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( self.containerState, 'expected `containerState` to be defined when closing flow' ) ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)(childFlow, 'expected `childFlow` to be defined when closing it') childFlow.write([micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_3__.codes.eof]) childToken = undefined childFlow = undefined self.containerState._closeFlow = undefined } } /** @type {Tokenizer} */ function tokenizeContainer(effects, ok, nok) { return (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_6__.factorySpace)( effects, effects.attempt(this.parser.constructs.document, ok, nok), micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.linePrefix, this.parser.constructs.disable.null.includes('codeIndented') ? undefined : micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_4__.constants.tabSize ) } /***/ }), /***/ "../node_modules/micromark/dev/lib/initialize/flow.js": /*!************************************************************!*\ !*** ../node_modules/micromark/dev/lib/initialize/flow.js ***! \************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "flow": () => (/* binding */ flow) /* harmony export */ }); /* harmony import */ var uvu_assert__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! uvu/assert */ "../node_modules/uvu/assert/index.mjs"); /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/blank-line.js"); /* harmony import */ var micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! micromark-core-commonmark */ "../node_modules/micromark-core-commonmark/dev/lib/content.js"); /* harmony import */ var micromark_factory_space__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-factory-space */ "../node_modules/micromark-factory-space/dev/index.js"); /* harmony import */ var micromark_util_character__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! micromark-util-character */ "../node_modules/micromark-util-character/dev/index.js"); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /** * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct * @typedef {import('micromark-util-types').Initializer} Initializer * @typedef {import('micromark-util-types').State} State */ /** @type {InitialConstruct} */ const flow = {tokenize: initializeFlow} /** @type {Initializer} */ function initializeFlow(effects) { const self = this const initial = effects.attempt( // Try to parse a blank line. micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_1__.blankLine, atBlankEnding, // Try to parse initial flow (essentially, only code). effects.attempt( this.parser.constructs.flowInitial, afterConstruct, (0,micromark_factory_space__WEBPACK_IMPORTED_MODULE_2__.factorySpace)( effects, effects.attempt( this.parser.constructs.flow, afterConstruct, effects.attempt(micromark_core_commonmark__WEBPACK_IMPORTED_MODULE_3__.content, afterConstruct) ), micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.linePrefix ) ) ) return initial /** @type {State} */ function atBlankEnding(code) { ;(0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_5__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_6__.markdownLineEnding)(code), 'expected eol or eof' ) if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_5__.codes.eof) { effects.consume(code) return } effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.lineEndingBlank) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.lineEndingBlank) self.currentConstruct = undefined return initial } /** @type {State} */ function afterConstruct(code) { (0,uvu_assert__WEBPACK_IMPORTED_MODULE_0__.ok)( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_5__.codes.eof || (0,micromark_util_character__WEBPACK_IMPORTED_MODULE_6__.markdownLineEnding)(code), 'expected eol or eof' ) if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_5__.codes.eof) { effects.consume(code) return } effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.lineEnding) effects.consume(code) effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_4__.types.lineEnding) self.currentConstruct = undefined return initial } } /***/ }), /***/ "../node_modules/micromark/dev/lib/initialize/text.js": /*!************************************************************!*\ !*** ../node_modules/micromark/dev/lib/initialize/text.js ***! \************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "resolver": () => (/* binding */ resolver), /* harmony export */ "string": () => (/* binding */ string), /* harmony export */ "text": () => (/* binding */ text) /* harmony export */ }); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js"); /* harmony import */ var micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/types.js */ "../node_modules/micromark-util-symbol/types.js"); /** * @typedef {import('micromark-util-types').Resolver} Resolver * @typedef {import('micromark-util-types').Initializer} Initializer * @typedef {import('micromark-util-types').Construct} Construct * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct * @typedef {import('micromark-util-types').State} State * @typedef {import('micromark-util-types').Code} Code */ const resolver = {resolveAll: createResolver()} const string = initializeFactory('string') const text = initializeFactory('text') /** * @param {'string'|'text'} field * @returns {InitialConstruct} */ function initializeFactory(field) { return { tokenize: initializeText, resolveAll: createResolver( field === 'text' ? resolveAllLineSuffixes : undefined ) } /** @type {Initializer} */ function initializeText(effects) { const self = this const constructs = this.parser.constructs[field] const text = effects.attempt(constructs, start, notText) return start /** @type {State} */ function start(code) { return atBreak(code) ? text(code) : notText(code) } /** @type {State} */ function notText(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.eof) { effects.consume(code) return } effects.enter(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.data) effects.consume(code) return data } /** @type {State} */ function data(code) { if (atBreak(code)) { effects.exit(micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.data) return text(code) } // Data. effects.consume(code) return data } /** * @param {Code} code * @returns {boolean} */ function atBreak(code) { if (code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.eof) { return true } const list = constructs[code] let index = -1 if (list) { while (++index < list.length) { const item = list[index] if (!item.previous || item.previous.call(self, self.previous)) { return true } } } return false } } } /** * @param {Resolver} [extraResolver] * @returns {Resolver} */ function createResolver(extraResolver) { return resolveAllText /** @type {Resolver} */ function resolveAllText(events, context) { let index = -1 /** @type {number|undefined} */ let enter // A rather boring computation (to merge adjacent `data` events) which // improves mm performance by 29%. while (++index <= events.length) { if (enter === undefined) { if (events[index] && events[index][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.data) { enter = index index++ } } else if (!events[index] || events[index][1].type !== micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.data) { // Don’t do anything if there is one data token. if (index !== enter + 2) { events[enter][1].end = events[index - 1][1].end events.splice(enter + 2, index - enter - 2) index = enter + 2 } enter = undefined } } return extraResolver ? extraResolver(events, context) : events } } /** * A rather ugly set of instructions which again looks at chunks in the input * stream. * The reason to do this here is that it is *much* faster to parse in reverse. * And that we can’t hook into `null` to split the line suffix before an EOF. * To do: figure out if we can make this into a clean utility, or even in core. * As it will be useful for GFMs literal autolink extension (and maybe even * tables?) * * @type {Resolver} */ function resolveAllLineSuffixes(events, context) { let eventIndex = 0 // Skip first. while (++eventIndex <= events.length) { if ( (eventIndex === events.length || events[eventIndex][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineEnding) && events[eventIndex - 1][1].type === micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.data ) { const data = events[eventIndex - 1][1] const chunks = context.sliceStream(data) let index = chunks.length let bufferIndex = -1 let size = 0 /** @type {boolean|undefined} */ let tabs while (index--) { const chunk = chunks[index] if (typeof chunk === 'string') { bufferIndex = chunk.length while (chunk.charCodeAt(bufferIndex - 1) === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.space) { size++ bufferIndex-- } if (bufferIndex) break bufferIndex = -1 } // Number else if (chunk === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.horizontalTab) { tabs = true size++ } else if (chunk === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.virtualSpace) { // Empty } else { // Replacement character, exit. index++ break } } if (size) { const token = { type: eventIndex === events.length || tabs || size < micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_2__.constants.hardBreakPrefixSizeMin ? micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.lineSuffix : micromark_util_symbol_types_js__WEBPACK_IMPORTED_MODULE_1__.types.hardBreakTrailing, start: { line: data.end.line, column: data.end.column - size, offset: data.end.offset - size, _index: data.start._index + index, _bufferIndex: index ? bufferIndex : data.start._bufferIndex + bufferIndex }, end: Object.assign({}, data.end) } data.end = Object.assign({}, token.start) if (data.start.offset === data.end.offset) { Object.assign(data, token) } else { events.splice( eventIndex, 0, ['enter', token, context], ['exit', token, context] ) eventIndex += 2 } } eventIndex++ } } return events } /***/ }), /***/ "../node_modules/micromark/dev/lib/parse.js": /*!**************************************************!*\ !*** ../node_modules/micromark/dev/lib/parse.js ***! \**************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "parse": () => (/* binding */ parse) /* harmony export */ }); /* harmony import */ var micromark_util_combine_extensions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-combine-extensions */ "../node_modules/micromark-util-combine-extensions/index.js"); /* harmony import */ var _initialize_content_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./initialize/content.js */ "../node_modules/micromark/dev/lib/initialize/content.js"); /* harmony import */ var _initialize_document_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./initialize/document.js */ "../node_modules/micromark/dev/lib/initialize/document.js"); /* harmony import */ var _initialize_flow_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./initialize/flow.js */ "../node_modules/micromark/dev/lib/initialize/flow.js"); /* harmony import */ var _initialize_text_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./initialize/text.js */ "../node_modules/micromark/dev/lib/initialize/text.js"); /* harmony import */ var _create_tokenizer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./create-tokenizer.js */ "../node_modules/micromark/dev/lib/create-tokenizer.js"); /* harmony import */ var _constructs_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constructs.js */ "../node_modules/micromark/dev/lib/constructs.js"); /** * @typedef {import('micromark-util-types').InitialConstruct} InitialConstruct * @typedef {import('micromark-util-types').FullNormalizedExtension} FullNormalizedExtension * @typedef {import('micromark-util-types').ParseOptions} ParseOptions * @typedef {import('micromark-util-types').ParseContext} ParseContext * @typedef {import('micromark-util-types').Create} Create */ /** * @param {ParseOptions} [options] * @returns {ParseContext} */ function parse(options = {}) { /** @type {FullNormalizedExtension} */ // @ts-expect-error `defaultConstructs` is full, so the result will be too. const constructs = (0,micromark_util_combine_extensions__WEBPACK_IMPORTED_MODULE_0__.combineExtensions)( // @ts-expect-error Same as above. [_constructs_js__WEBPACK_IMPORTED_MODULE_1__].concat(options.extensions || []) ) /** @type {ParseContext} */ const parser = { defined: [], lazy: {}, constructs, content: create(_initialize_content_js__WEBPACK_IMPORTED_MODULE_2__.content), document: create(_initialize_document_js__WEBPACK_IMPORTED_MODULE_3__.document), flow: create(_initialize_flow_js__WEBPACK_IMPORTED_MODULE_4__.flow), string: create(_initialize_text_js__WEBPACK_IMPORTED_MODULE_5__.string), text: create(_initialize_text_js__WEBPACK_IMPORTED_MODULE_5__.text) } return parser /** * @param {InitialConstruct} initial */ function create(initial) { return creator /** @type {Create} */ function creator(from) { return (0,_create_tokenizer_js__WEBPACK_IMPORTED_MODULE_6__.createTokenizer)(parser, initial, from) } } } /***/ }), /***/ "../node_modules/micromark/dev/lib/postprocess.js": /*!********************************************************!*\ !*** ../node_modules/micromark/dev/lib/postprocess.js ***! \********************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "postprocess": () => (/* binding */ postprocess) /* harmony export */ }); /* harmony import */ var micromark_util_subtokenize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-subtokenize */ "../node_modules/micromark-util-subtokenize/dev/index.js"); /** * @typedef {import('micromark-util-types').Event} Event */ /** * @param {Array<Event>} events * @returns {Array<Event>} */ function postprocess(events) { while (!(0,micromark_util_subtokenize__WEBPACK_IMPORTED_MODULE_0__.subtokenize)(events)) { // Empty } return events } /***/ }), /***/ "../node_modules/micromark/dev/lib/preprocess.js": /*!*******************************************************!*\ !*** ../node_modules/micromark/dev/lib/preprocess.js ***! \*******************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "preprocess": () => (/* binding */ preprocess) /* harmony export */ }); /* harmony import */ var micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! micromark-util-symbol/codes.js */ "../node_modules/micromark-util-symbol/codes.js"); /* harmony import */ var micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! micromark-util-symbol/constants.js */ "../node_modules/micromark-util-symbol/constants.js"); /** * @typedef {import('micromark-util-types').Encoding} Encoding * @typedef {import('micromark-util-types').Value} Value * @typedef {import('micromark-util-types').Chunk} Chunk * @typedef {import('micromark-util-types').Code} Code */ /** * @callback Preprocessor * @param {Value} value * @param {Encoding} [encoding] * @param {boolean} [end=false] * @returns {Array<Chunk>} */ const search = /[\0\t\n\r]/g /** * @returns {Preprocessor} */ function preprocess() { let column = 1 let buffer = '' /** @type {boolean|undefined} */ let start = true /** @type {boolean|undefined} */ let atCarriageReturn return preprocessor /** @type {Preprocessor} */ function preprocessor(value, encoding, end) { /** @type {Array<Chunk>} */ const chunks = [] /** @type {RegExpMatchArray|null} */ let match /** @type {number} */ let next /** @type {number} */ let startPosition /** @type {number} */ let endPosition /** @type {Code} */ let code // @ts-expect-error `Buffer` does allow an encoding. value = buffer + value.toString(encoding) startPosition = 0 buffer = '' if (start) { if (value.charCodeAt(0) === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.byteOrderMarker) { startPosition++ } start = undefined } while (startPosition < value.length) { search.lastIndex = startPosition match = search.exec(value) endPosition = match && match.index !== undefined ? match.index : value.length code = value.charCodeAt(endPosition) if (!match) { buffer = value.slice(startPosition) break } if ( code === micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.lf && startPosition === endPosition && atCarriageReturn ) { chunks.push(micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.carriageReturnLineFeed) atCarriageReturn = undefined } else { if (atCarriageReturn) { chunks.push(micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.carriageReturn) atCarriageReturn = undefined } if (startPosition < endPosition) { chunks.push(value.slice(startPosition, endPosition)) column += endPosition - startPosition } switch (code) { case micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.nul: { chunks.push(micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.replacementCharacter) column++ break } case micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.ht: { next = Math.ceil(column / micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_1__.constants.tabSize) * micromark_util_symbol_constants_js__WEBPACK_IMPORTED_MODULE_1__.constants.tabSize chunks.push(micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.horizontalTab) while (column++ < next) chunks.push(micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.virtualSpace) break } case micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.lf: { chunks.push(micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.lineFeed) column = 1 break } default: { atCarriageReturn = true column = 1 } } } startPosition = endPosition + 1 } if (end) { if (atCarriageReturn) chunks.push(micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.carriageReturn) if (buffer) chunks.push(buffer) chunks.push(micromark_util_symbol_codes_js__WEBPACK_IMPORTED_MODULE_0__.codes.eof) } return chunks } } /***/ }), /***/ "../node_modules/property-information/index.js": /*!*****************************************************!*\ !*** ../node_modules/property-information/index.js ***! \*****************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "find": () => (/* reexport safe */ _lib_find_js__WEBPACK_IMPORTED_MODULE_0__.find), /* harmony export */ "hastToReact": () => (/* reexport safe */ _lib_hast_to_react_js__WEBPACK_IMPORTED_MODULE_1__.hastToReact), /* harmony export */ "html": () => (/* binding */ html), /* harmony export */ "normalize": () => (/* reexport safe */ _lib_normalize_js__WEBPACK_IMPORTED_MODULE_2__.normalize), /* harmony export */ "svg": () => (/* binding */ svg) /* harmony export */ }); /* harmony import */ var _lib_util_merge_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/util/merge.js */ "../node_modules/property-information/lib/util/merge.js"); /* harmony import */ var _lib_xlink_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lib/xlink.js */ "../node_modules/property-information/lib/xlink.js"); /* harmony import */ var _lib_xml_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/xml.js */ "../node_modules/property-information/lib/xml.js"); /* harmony import */ var _lib_xmlns_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./lib/xmlns.js */ "../node_modules/property-information/lib/xmlns.js"); /* harmony import */ var _lib_aria_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./lib/aria.js */ "../node_modules/property-information/lib/aria.js"); /* harmony import */ var _lib_html_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./lib/html.js */ "../node_modules/property-information/lib/html.js"); /* harmony import */ var _lib_svg_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./lib/svg.js */ "../node_modules/property-information/lib/svg.js"); /* harmony import */ var _lib_find_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/find.js */ "../node_modules/property-information/lib/find.js"); /* harmony import */ var _lib_hast_to_react_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/hast-to-react.js */ "../node_modules/property-information/lib/hast-to-react.js"); /* harmony import */ var _lib_normalize_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/normalize.js */ "../node_modules/property-information/lib/normalize.js"); /** * @typedef {import('./lib/util/info.js').Info} Info * @typedef {import('./lib/util/schema.js').Schema} Schema */ const html = (0,_lib_util_merge_js__WEBPACK_IMPORTED_MODULE_3__.merge)([_lib_xml_js__WEBPACK_IMPORTED_MODULE_4__.xml, _lib_xlink_js__WEBPACK_IMPORTED_MODULE_5__.xlink, _lib_xmlns_js__WEBPACK_IMPORTED_MODULE_6__.xmlns, _lib_aria_js__WEBPACK_IMPORTED_MODULE_7__.aria, _lib_html_js__WEBPACK_IMPORTED_MODULE_8__.html], 'html') const svg = (0,_lib_util_merge_js__WEBPACK_IMPORTED_MODULE_3__.merge)([_lib_xml_js__WEBPACK_IMPORTED_MODULE_4__.xml, _lib_xlink_js__WEBPACK_IMPORTED_MODULE_5__.xlink, _lib_xmlns_js__WEBPACK_IMPORTED_MODULE_6__.xmlns, _lib_aria_js__WEBPACK_IMPORTED_MODULE_7__.aria, _lib_svg_js__WEBPACK_IMPORTED_MODULE_9__.svg], 'svg') /***/ }), /***/ "../node_modules/property-information/lib/aria.js": /*!********************************************************!*\ !*** ../node_modules/property-information/lib/aria.js ***! \********************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "aria": () => (/* binding */ aria) /* harmony export */ }); /* harmony import */ var _util_types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/types.js */ "../node_modules/property-information/lib/util/types.js"); /* harmony import */ var _util_create_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/create.js */ "../node_modules/property-information/lib/util/create.js"); const aria = (0,_util_create_js__WEBPACK_IMPORTED_MODULE_0__.create)({ transform(_, prop) { return prop === 'role' ? prop : 'aria-' + prop.slice(4).toLowerCase() }, properties: { ariaActiveDescendant: null, ariaAtomic: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish, ariaAutoComplete: null, ariaBusy: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish, ariaChecked: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish, ariaColCount: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.number, ariaColIndex: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.number, ariaColSpan: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.number, ariaControls: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.spaceSeparated, ariaCurrent: null, ariaDescribedBy: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.spaceSeparated, ariaDetails: null, ariaDisabled: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish, ariaDropEffect: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.spaceSeparated, ariaErrorMessage: null, ariaExpanded: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish, ariaFlowTo: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.spaceSeparated, ariaGrabbed: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish, ariaHasPopup: null, ariaHidden: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish, ariaInvalid: null, ariaKeyShortcuts: null, ariaLabel: null, ariaLabelledBy: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.spaceSeparated, ariaLevel: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.number, ariaLive: null, ariaModal: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish, ariaMultiLine: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish, ariaMultiSelectable: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish, ariaOrientation: null, ariaOwns: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.spaceSeparated, ariaPlaceholder: null, ariaPosInSet: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.number, ariaPressed: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish, ariaReadOnly: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish, ariaRelevant: null, ariaRequired: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish, ariaRoleDescription: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.spaceSeparated, ariaRowCount: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.number, ariaRowIndex: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.number, ariaRowSpan: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.number, ariaSelected: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.booleanish, ariaSetSize: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.number, ariaSort: null, ariaValueMax: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.number, ariaValueMin: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.number, ariaValueNow: _util_types_js__WEBPACK_IMPORTED_MODULE_1__.number, ariaValueText: null, role: null } }) /***/ }), /***/ "../node_modules/property-information/lib/find.js": /*!********************************************************!*\ !*** ../node_modules/property-information/lib/find.js ***! \********************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "find": () => (/* binding */ find) /* harmony export */ }); /* harmony import */ var _normalize_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./normalize.js */ "../node_modules/property-information/lib/normalize.js"); /* harmony import */ var _util_defined_info_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/defined-info.js */ "../node_modules/property-information/lib/util/defined-info.js"); /* harmony import */ var _util_info_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/info.js */ "../node_modules/property-information/lib/util/info.js"); /** * @typedef {import('./util/schema.js').Schema} Schema */ const valid = /^data[-\w.:]+$/i const dash = /-[a-z]/g const cap = /[A-Z]/g /** * @param {Schema} schema * @param {string} value * @returns {Info} */ function find(schema, value) { const normal = (0,_normalize_js__WEBPACK_IMPORTED_MODULE_0__.normalize)(value) let prop = value let Type = _util_info_js__WEBPACK_IMPORTED_MODULE_1__.Info if (normal in schema.normal) { return schema.property[schema.normal[normal]] } if (normal.length > 4 && normal.slice(0, 4) === 'data' && valid.test(value)) { // Attribute or property. if (value.charAt(4) === '-') { // Turn it into a property. const rest = value.slice(5).replace(dash, camelcase) prop = 'data' + rest.charAt(0).toUpperCase() + rest.slice(1) } else { // Turn it into an attribute. const rest = value.slice(4) if (!dash.test(rest)) { let dashes = rest.replace(cap, kebab) if (dashes.charAt(0) !== '-') { dashes = '-' + dashes } value = 'data' + dashes } } Type = _util_defined_info_js__WEBPACK_IMPORTED_MODULE_2__.DefinedInfo } return new Type(prop, value) } /** * @param {string} $0 * @returns {string} */ function kebab($0) { return '-' + $0.toLowerCase() } /** * @param {string} $0 * @returns {string} */ function camelcase($0) { return $0.charAt(1).toUpperCase() } /***/ }), /***/ "../node_modules/property-information/lib/hast-to-react.js": /*!*****************************************************************!*\ !*** ../node_modules/property-information/lib/hast-to-react.js ***! \*****************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "hastToReact": () => (/* binding */ hastToReact) /* harmony export */ }); /** * `hast` is close to `React`, but differs in a couple of cases. * * To get a React property from a hast property, check if it is in * `hastToReact`, if it is, then use the corresponding value, * otherwise, use the hast property. * * @type {Record<string, string>} */ const hastToReact = { classId: 'classID', dataType: 'datatype', itemId: 'itemID', strokeDashArray: 'strokeDasharray', strokeDashOffset: 'strokeDashoffset', strokeLineCap: 'strokeLinecap', strokeLineJoin: 'strokeLinejoin', strokeMiterLimit: 'strokeMiterlimit', typeOf: 'typeof', xLinkActuate: 'xlinkActuate', xLinkArcRole: 'xlinkArcrole', xLinkHref: 'xlinkHref', xLinkRole: 'xlinkRole', xLinkShow: 'xlinkShow', xLinkTitle: 'xlinkTitle', xLinkType: 'xlinkType', xmlnsXLink: 'xmlnsXlink' } /***/ }), /***/ "../node_modules/property-information/lib/html.js": /*!********************************************************!*\ !*** ../node_modules/property-information/lib/html.js ***! \********************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "html": () => (/* binding */ html) /* harmony export */ }); /* harmony import */ var _util_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/types.js */ "../node_modules/property-information/lib/util/types.js"); /* harmony import */ var _util_create_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/create.js */ "../node_modules/property-information/lib/util/create.js"); /* harmony import */ var _util_case_insensitive_transform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/case-insensitive-transform.js */ "../node_modules/property-information/lib/util/case-insensitive-transform.js"); const html = (0,_util_create_js__WEBPACK_IMPORTED_MODULE_0__.create)({ space: 'html', attributes: { acceptcharset: 'accept-charset', classname: 'class', htmlfor: 'for', httpequiv: 'http-equiv' }, transform: _util_case_insensitive_transform_js__WEBPACK_IMPORTED_MODULE_1__.caseInsensitiveTransform, mustUseProperty: ['checked', 'multiple', 'muted', 'selected'], properties: { // Standard Properties. abbr: null, accept: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaSeparated, acceptCharset: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated, accessKey: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated, action: null, allow: null, allowFullScreen: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, allowPaymentRequest: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, allowUserMedia: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, alt: null, as: null, async: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, autoCapitalize: null, autoComplete: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated, autoFocus: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, autoPlay: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, capture: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, charSet: null, checked: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, cite: null, className: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated, cols: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, colSpan: null, content: null, contentEditable: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.booleanish, controls: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, controlsList: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated, coords: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number | _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaSeparated, crossOrigin: null, data: null, dateTime: null, decoding: null, default: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, defer: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, dir: null, dirName: null, disabled: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, download: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.overloadedBoolean, draggable: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.booleanish, encType: null, enterKeyHint: null, form: null, formAction: null, formEncType: null, formMethod: null, formNoValidate: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, formTarget: null, headers: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated, height: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, hidden: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, high: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, href: null, hrefLang: null, htmlFor: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated, httpEquiv: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated, id: null, imageSizes: null, imageSrcSet: null, inputMode: null, integrity: null, is: null, isMap: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, itemId: null, itemProp: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated, itemRef: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated, itemScope: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, itemType: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated, kind: null, label: null, lang: null, language: null, list: null, loading: null, loop: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, low: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, manifest: null, max: null, maxLength: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, media: null, method: null, min: null, minLength: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, multiple: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, muted: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, name: null, nonce: null, noModule: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, noValidate: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, onAbort: null, onAfterPrint: null, onAuxClick: null, onBeforeMatch: null, onBeforePrint: null, onBeforeUnload: null, onBlur: null, onCancel: null, onCanPlay: null, onCanPlayThrough: null, onChange: null, onClick: null, onClose: null, onContextLost: null, onContextMenu: null, onContextRestored: null, onCopy: null, onCueChange: null, onCut: null, onDblClick: null, onDrag: null, onDragEnd: null, onDragEnter: null, onDragExit: null, onDragLeave: null, onDragOver: null, onDragStart: null, onDrop: null, onDurationChange: null, onEmptied: null, onEnded: null, onError: null, onFocus: null, onFormData: null, onHashChange: null, onInput: null, onInvalid: null, onKeyDown: null, onKeyPress: null, onKeyUp: null, onLanguageChange: null, onLoad: null, onLoadedData: null, onLoadedMetadata: null, onLoadEnd: null, onLoadStart: null, onMessage: null, onMessageError: null, onMouseDown: null, onMouseEnter: null, onMouseLeave: null, onMouseMove: null, onMouseOut: null, onMouseOver: null, onMouseUp: null, onOffline: null, onOnline: null, onPageHide: null, onPageShow: null, onPaste: null, onPause: null, onPlay: null, onPlaying: null, onPopState: null, onProgress: null, onRateChange: null, onRejectionHandled: null, onReset: null, onResize: null, onScroll: null, onScrollEnd: null, onSecurityPolicyViolation: null, onSeeked: null, onSeeking: null, onSelect: null, onSlotChange: null, onStalled: null, onStorage: null, onSubmit: null, onSuspend: null, onTimeUpdate: null, onToggle: null, onUnhandledRejection: null, onUnload: null, onVolumeChange: null, onWaiting: null, onWheel: null, open: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, optimum: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, pattern: null, ping: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated, placeholder: null, playsInline: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, poster: null, preload: null, readOnly: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, referrerPolicy: null, rel: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated, required: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, reversed: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, rows: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, rowSpan: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, sandbox: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated, scope: null, scoped: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, seamless: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, selected: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, shape: null, size: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, sizes: null, slot: null, span: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, spellCheck: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.booleanish, src: null, srcDoc: null, srcLang: null, srcSet: null, start: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, step: null, style: null, tabIndex: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, target: null, title: null, translate: null, type: null, typeMustMatch: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, useMap: null, value: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.booleanish, width: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, wrap: null, // Legacy. // See: https://html.spec.whatwg.org/#other-elements,-attributes-and-apis align: null, // Several. Use CSS `text-align` instead, aLink: null, // `<body>`. Use CSS `a:active {color}` instead archive: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated, // `<object>`. List of URIs to archives axis: null, // `<td>` and `<th>`. Use `scope` on `<th>` background: null, // `<body>`. Use CSS `background-image` instead bgColor: null, // `<body>` and table elements. Use CSS `background-color` instead border: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, // `<table>`. Use CSS `border-width` instead, borderColor: null, // `<table>`. Use CSS `border-color` instead, bottomMargin: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, // `<body>` cellPadding: null, // `<table>` cellSpacing: null, // `<table>` char: null, // Several table elements. When `align=char`, sets the character to align on charOff: null, // Several table elements. When `char`, offsets the alignment classId: null, // `<object>` clear: null, // `<br>`. Use CSS `clear` instead code: null, // `<object>` codeBase: null, // `<object>` codeType: null, // `<object>` color: null, // `<font>` and `<hr>`. Use CSS instead compact: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, // Lists. Use CSS to reduce space between items instead declare: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, // `<object>` event: null, // `<script>` face: null, // `<font>`. Use CSS instead frame: null, // `<table>` frameBorder: null, // `<iframe>`. Use CSS `border` instead hSpace: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, // `<img>` and `<object>` leftMargin: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, // `<body>` link: null, // `<body>`. Use CSS `a:link {color: *}` instead longDesc: null, // `<frame>`, `<iframe>`, and `<img>`. Use an `<a>` lowSrc: null, // `<img>`. Use a `<picture>` marginHeight: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, // `<body>` marginWidth: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, // `<body>` noResize: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, // `<frame>` noHref: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, // `<area>`. Use no href instead of an explicit `nohref` noShade: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, // `<hr>`. Use background-color and height instead of borders noWrap: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, // `<td>` and `<th>` object: null, // `<applet>` profile: null, // `<head>` prompt: null, // `<isindex>` rev: null, // `<link>` rightMargin: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, // `<body>` rules: null, // `<table>` scheme: null, // `<meta>` scrolling: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.booleanish, // `<frame>`. Use overflow in the child context standby: null, // `<object>` summary: null, // `<table>` text: null, // `<body>`. Use CSS `color` instead topMargin: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, // `<body>` valueType: null, // `<param>` version: null, // `<html>`. Use a doctype. vAlign: null, // Several. Use CSS `vertical-align` instead vLink: null, // `<body>`. Use CSS `a:visited {color}` instead vSpace: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, // `<img>` and `<object>` // Non-standard Properties. allowTransparency: null, autoCorrect: null, autoSave: null, disablePictureInPicture: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, disableRemotePlayback: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, prefix: null, property: null, results: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, security: null, unselectable: null } }) /***/ }), /***/ "../node_modules/property-information/lib/normalize.js": /*!*************************************************************!*\ !*** ../node_modules/property-information/lib/normalize.js ***! \*************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "normalize": () => (/* binding */ normalize) /* harmony export */ }); /** * @param {string} value * @returns {string} */ function normalize(value) { return value.toLowerCase() } /***/ }), /***/ "../node_modules/property-information/lib/svg.js": /*!*******************************************************!*\ !*** ../node_modules/property-information/lib/svg.js ***! \*******************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "svg": () => (/* binding */ svg) /* harmony export */ }); /* harmony import */ var _util_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/types.js */ "../node_modules/property-information/lib/util/types.js"); /* harmony import */ var _util_create_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/create.js */ "../node_modules/property-information/lib/util/create.js"); /* harmony import */ var _util_case_sensitive_transform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/case-sensitive-transform.js */ "../node_modules/property-information/lib/util/case-sensitive-transform.js"); const svg = (0,_util_create_js__WEBPACK_IMPORTED_MODULE_0__.create)({ space: 'svg', attributes: { accentHeight: 'accent-height', alignmentBaseline: 'alignment-baseline', arabicForm: 'arabic-form', baselineShift: 'baseline-shift', capHeight: 'cap-height', className: 'class', clipPath: 'clip-path', clipRule: 'clip-rule', colorInterpolation: 'color-interpolation', colorInterpolationFilters: 'color-interpolation-filters', colorProfile: 'color-profile', colorRendering: 'color-rendering', crossOrigin: 'crossorigin', dataType: 'datatype', dominantBaseline: 'dominant-baseline', enableBackground: 'enable-background', fillOpacity: 'fill-opacity', fillRule: 'fill-rule', floodColor: 'flood-color', floodOpacity: 'flood-opacity', fontFamily: 'font-family', fontSize: 'font-size', fontSizeAdjust: 'font-size-adjust', fontStretch: 'font-stretch', fontStyle: 'font-style', fontVariant: 'font-variant', fontWeight: 'font-weight', glyphName: 'glyph-name', glyphOrientationHorizontal: 'glyph-orientation-horizontal', glyphOrientationVertical: 'glyph-orientation-vertical', hrefLang: 'hreflang', horizAdvX: 'horiz-adv-x', horizOriginX: 'horiz-origin-x', horizOriginY: 'horiz-origin-y', imageRendering: 'image-rendering', letterSpacing: 'letter-spacing', lightingColor: 'lighting-color', markerEnd: 'marker-end', markerMid: 'marker-mid', markerStart: 'marker-start', navDown: 'nav-down', navDownLeft: 'nav-down-left', navDownRight: 'nav-down-right', navLeft: 'nav-left', navNext: 'nav-next', navPrev: 'nav-prev', navRight: 'nav-right', navUp: 'nav-up', navUpLeft: 'nav-up-left', navUpRight: 'nav-up-right', onAbort: 'onabort', onActivate: 'onactivate', onAfterPrint: 'onafterprint', onBeforePrint: 'onbeforeprint', onBegin: 'onbegin', onCancel: 'oncancel', onCanPlay: 'oncanplay', onCanPlayThrough: 'oncanplaythrough', onChange: 'onchange', onClick: 'onclick', onClose: 'onclose', onCopy: 'oncopy', onCueChange: 'oncuechange', onCut: 'oncut', onDblClick: 'ondblclick', onDrag: 'ondrag', onDragEnd: 'ondragend', onDragEnter: 'ondragenter', onDragExit: 'ondragexit', onDragLeave: 'ondragleave', onDragOver: 'ondragover', onDragStart: 'ondragstart', onDrop: 'ondrop', onDurationChange: 'ondurationchange', onEmptied: 'onemptied', onEnd: 'onend', onEnded: 'onended', onError: 'onerror', onFocus: 'onfocus', onFocusIn: 'onfocusin', onFocusOut: 'onfocusout', onHashChange: 'onhashchange', onInput: 'oninput', onInvalid: 'oninvalid', onKeyDown: 'onkeydown', onKeyPress: 'onkeypress', onKeyUp: 'onkeyup', onLoad: 'onload', onLoadedData: 'onloadeddata', onLoadedMetadata: 'onloadedmetadata', onLoadStart: 'onloadstart', onMessage: 'onmessage', onMouseDown: 'onmousedown', onMouseEnter: 'onmouseenter', onMouseLeave: 'onmouseleave', onMouseMove: 'onmousemove', onMouseOut: 'onmouseout', onMouseOver: 'onmouseover', onMouseUp: 'onmouseup', onMouseWheel: 'onmousewheel', onOffline: 'onoffline', onOnline: 'ononline', onPageHide: 'onpagehide', onPageShow: 'onpageshow', onPaste: 'onpaste', onPause: 'onpause', onPlay: 'onplay', onPlaying: 'onplaying', onPopState: 'onpopstate', onProgress: 'onprogress', onRateChange: 'onratechange', onRepeat: 'onrepeat', onReset: 'onreset', onResize: 'onresize', onScroll: 'onscroll', onSeeked: 'onseeked', onSeeking: 'onseeking', onSelect: 'onselect', onShow: 'onshow', onStalled: 'onstalled', onStorage: 'onstorage', onSubmit: 'onsubmit', onSuspend: 'onsuspend', onTimeUpdate: 'ontimeupdate', onToggle: 'ontoggle', onUnload: 'onunload', onVolumeChange: 'onvolumechange', onWaiting: 'onwaiting', onZoom: 'onzoom', overlinePosition: 'overline-position', overlineThickness: 'overline-thickness', paintOrder: 'paint-order', panose1: 'panose-1', pointerEvents: 'pointer-events', referrerPolicy: 'referrerpolicy', renderingIntent: 'rendering-intent', shapeRendering: 'shape-rendering', stopColor: 'stop-color', stopOpacity: 'stop-opacity', strikethroughPosition: 'strikethrough-position', strikethroughThickness: 'strikethrough-thickness', strokeDashArray: 'stroke-dasharray', strokeDashOffset: 'stroke-dashoffset', strokeLineCap: 'stroke-linecap', strokeLineJoin: 'stroke-linejoin', strokeMiterLimit: 'stroke-miterlimit', strokeOpacity: 'stroke-opacity', strokeWidth: 'stroke-width', tabIndex: 'tabindex', textAnchor: 'text-anchor', textDecoration: 'text-decoration', textRendering: 'text-rendering', typeOf: 'typeof', underlinePosition: 'underline-position', underlineThickness: 'underline-thickness', unicodeBidi: 'unicode-bidi', unicodeRange: 'unicode-range', unitsPerEm: 'units-per-em', vAlphabetic: 'v-alphabetic', vHanging: 'v-hanging', vIdeographic: 'v-ideographic', vMathematical: 'v-mathematical', vectorEffect: 'vector-effect', vertAdvY: 'vert-adv-y', vertOriginX: 'vert-origin-x', vertOriginY: 'vert-origin-y', wordSpacing: 'word-spacing', writingMode: 'writing-mode', xHeight: 'x-height', // These were camelcased in Tiny. Now lowercased in SVG 2 playbackOrder: 'playbackorder', timelineBegin: 'timelinebegin' }, transform: _util_case_sensitive_transform_js__WEBPACK_IMPORTED_MODULE_1__.caseSensitiveTransform, properties: { about: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaOrSpaceSeparated, accentHeight: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, accumulate: null, additive: null, alignmentBaseline: null, alphabetic: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, amplitude: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, arabicForm: null, ascent: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, attributeName: null, attributeType: null, azimuth: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, bandwidth: null, baselineShift: null, baseFrequency: null, baseProfile: null, bbox: null, begin: null, bias: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, by: null, calcMode: null, capHeight: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, className: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated, clip: null, clipPath: null, clipPathUnits: null, clipRule: null, color: null, colorInterpolation: null, colorInterpolationFilters: null, colorProfile: null, colorRendering: null, content: null, contentScriptType: null, contentStyleType: null, crossOrigin: null, cursor: null, cx: null, cy: null, d: null, dataType: null, defaultAction: null, descent: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, diffuseConstant: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, direction: null, display: null, dur: null, divisor: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, dominantBaseline: null, download: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.boolean, dx: null, dy: null, edgeMode: null, editable: null, elevation: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, enableBackground: null, end: null, event: null, exponent: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, externalResourcesRequired: null, fill: null, fillOpacity: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, fillRule: null, filter: null, filterRes: null, filterUnits: null, floodColor: null, floodOpacity: null, focusable: null, focusHighlight: null, fontFamily: null, fontSize: null, fontSizeAdjust: null, fontStretch: null, fontStyle: null, fontVariant: null, fontWeight: null, format: null, fr: null, from: null, fx: null, fy: null, g1: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaSeparated, g2: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaSeparated, glyphName: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaSeparated, glyphOrientationHorizontal: null, glyphOrientationVertical: null, glyphRef: null, gradientTransform: null, gradientUnits: null, handler: null, hanging: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, hatchContentUnits: null, hatchUnits: null, height: null, href: null, hrefLang: null, horizAdvX: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, horizOriginX: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, horizOriginY: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, id: null, ideographic: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, imageRendering: null, initialVisibility: null, in: null, in2: null, intercept: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, k: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, k1: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, k2: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, k3: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, k4: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, kernelMatrix: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaOrSpaceSeparated, kernelUnitLength: null, keyPoints: null, // SEMI_COLON_SEPARATED keySplines: null, // SEMI_COLON_SEPARATED keyTimes: null, // SEMI_COLON_SEPARATED kerning: null, lang: null, lengthAdjust: null, letterSpacing: null, lightingColor: null, limitingConeAngle: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, local: null, markerEnd: null, markerMid: null, markerStart: null, markerHeight: null, markerUnits: null, markerWidth: null, mask: null, maskContentUnits: null, maskUnits: null, mathematical: null, max: null, media: null, mediaCharacterEncoding: null, mediaContentEncodings: null, mediaSize: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, mediaTime: null, method: null, min: null, mode: null, name: null, navDown: null, navDownLeft: null, navDownRight: null, navLeft: null, navNext: null, navPrev: null, navRight: null, navUp: null, navUpLeft: null, navUpRight: null, numOctaves: null, observer: null, offset: null, onAbort: null, onActivate: null, onAfterPrint: null, onBeforePrint: null, onBegin: null, onCancel: null, onCanPlay: null, onCanPlayThrough: null, onChange: null, onClick: null, onClose: null, onCopy: null, onCueChange: null, onCut: null, onDblClick: null, onDrag: null, onDragEnd: null, onDragEnter: null, onDragExit: null, onDragLeave: null, onDragOver: null, onDragStart: null, onDrop: null, onDurationChange: null, onEmptied: null, onEnd: null, onEnded: null, onError: null, onFocus: null, onFocusIn: null, onFocusOut: null, onHashChange: null, onInput: null, onInvalid: null, onKeyDown: null, onKeyPress: null, onKeyUp: null, onLoad: null, onLoadedData: null, onLoadedMetadata: null, onLoadStart: null, onMessage: null, onMouseDown: null, onMouseEnter: null, onMouseLeave: null, onMouseMove: null, onMouseOut: null, onMouseOver: null, onMouseUp: null, onMouseWheel: null, onOffline: null, onOnline: null, onPageHide: null, onPageShow: null, onPaste: null, onPause: null, onPlay: null, onPlaying: null, onPopState: null, onProgress: null, onRateChange: null, onRepeat: null, onReset: null, onResize: null, onScroll: null, onSeeked: null, onSeeking: null, onSelect: null, onShow: null, onStalled: null, onStorage: null, onSubmit: null, onSuspend: null, onTimeUpdate: null, onToggle: null, onUnload: null, onVolumeChange: null, onWaiting: null, onZoom: null, opacity: null, operator: null, order: null, orient: null, orientation: null, origin: null, overflow: null, overlay: null, overlinePosition: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, overlineThickness: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, paintOrder: null, panose1: null, path: null, pathLength: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, patternContentUnits: null, patternTransform: null, patternUnits: null, phase: null, ping: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.spaceSeparated, pitch: null, playbackOrder: null, pointerEvents: null, points: null, pointsAtX: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, pointsAtY: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, pointsAtZ: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, preserveAlpha: null, preserveAspectRatio: null, primitiveUnits: null, propagate: null, property: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaOrSpaceSeparated, r: null, radius: null, referrerPolicy: null, refX: null, refY: null, rel: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaOrSpaceSeparated, rev: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaOrSpaceSeparated, renderingIntent: null, repeatCount: null, repeatDur: null, requiredExtensions: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaOrSpaceSeparated, requiredFeatures: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaOrSpaceSeparated, requiredFonts: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaOrSpaceSeparated, requiredFormats: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaOrSpaceSeparated, resource: null, restart: null, result: null, rotate: null, rx: null, ry: null, scale: null, seed: null, shapeRendering: null, side: null, slope: null, snapshotTime: null, specularConstant: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, specularExponent: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, spreadMethod: null, spacing: null, startOffset: null, stdDeviation: null, stemh: null, stemv: null, stitchTiles: null, stopColor: null, stopOpacity: null, strikethroughPosition: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, strikethroughThickness: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, string: null, stroke: null, strokeDashArray: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaOrSpaceSeparated, strokeDashOffset: null, strokeLineCap: null, strokeLineJoin: null, strokeMiterLimit: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, strokeOpacity: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, strokeWidth: null, style: null, surfaceScale: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, syncBehavior: null, syncBehaviorDefault: null, syncMaster: null, syncTolerance: null, syncToleranceDefault: null, systemLanguage: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaOrSpaceSeparated, tabIndex: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, tableValues: null, target: null, targetX: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, targetY: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, textAnchor: null, textDecoration: null, textRendering: null, textLength: null, timelineBegin: null, title: null, transformBehavior: null, type: null, typeOf: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.commaOrSpaceSeparated, to: null, transform: null, u1: null, u2: null, underlinePosition: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, underlineThickness: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, unicode: null, unicodeBidi: null, unicodeRange: null, unitsPerEm: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, values: null, vAlphabetic: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, vMathematical: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, vectorEffect: null, vHanging: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, vIdeographic: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, version: null, vertAdvY: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, vertOriginX: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, vertOriginY: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, viewBox: null, viewTarget: null, visibility: null, width: null, widths: null, wordSpacing: null, writingMode: null, x: null, x1: null, x2: null, xChannelSelector: null, xHeight: _util_types_js__WEBPACK_IMPORTED_MODULE_2__.number, y: null, y1: null, y2: null, yChannelSelector: null, z: null, zoomAndPan: null } }) /***/ }), /***/ "../node_modules/property-information/lib/util/case-insensitive-transform.js": /*!***********************************************************************************!*\ !*** ../node_modules/property-information/lib/util/case-insensitive-transform.js ***! \***********************************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "caseInsensitiveTransform": () => (/* binding */ caseInsensitiveTransform) /* harmony export */ }); /* harmony import */ var _case_sensitive_transform_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./case-sensitive-transform.js */ "../node_modules/property-information/lib/util/case-sensitive-transform.js"); /** * @param {Record<string, string>} attributes * @param {string} property * @returns {string} */ function caseInsensitiveTransform(attributes, property) { return (0,_case_sensitive_transform_js__WEBPACK_IMPORTED_MODULE_0__.caseSensitiveTransform)(attributes, property.toLowerCase()) } /***/ }), /***/ "../node_modules/property-information/lib/util/case-sensitive-transform.js": /*!*********************************************************************************!*\ !*** ../node_modules/property-information/lib/util/case-sensitive-transform.js ***! \*********************************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "caseSensitiveTransform": () => (/* binding */ caseSensitiveTransform) /* harmony export */ }); /** * @param {Record<string, string>} attributes * @param {string} attribute * @returns {string} */ function caseSensitiveTransform(attributes, attribute) { return attribute in attributes ? attributes[attribute] : attribute } /***/ }), /***/ "../node_modules/property-information/lib/util/create.js": /*!***************************************************************!*\ !*** ../node_modules/property-information/lib/util/create.js ***! \***************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "create": () => (/* binding */ create) /* harmony export */ }); /* harmony import */ var _normalize_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../normalize.js */ "../node_modules/property-information/lib/normalize.js"); /* harmony import */ var _schema_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./schema.js */ "../node_modules/property-information/lib/util/schema.js"); /* harmony import */ var _defined_info_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defined-info.js */ "../node_modules/property-information/lib/util/defined-info.js"); /** * @typedef {import('./schema.js').Properties} Properties * @typedef {import('./schema.js').Normal} Normal * * @typedef {Record<string, string>} Attributes * * @typedef {Object} Definition * @property {Record<string, number|null>} properties * @property {(attributes: Attributes, property: string) => string} transform * @property {string} [space] * @property {Attributes} [attributes] * @property {Array<string>} [mustUseProperty] */ const own = {}.hasOwnProperty /** * @param {Definition} definition * @returns {Schema} */ function create(definition) { /** @type {Properties} */ const property = {} /** @type {Normal} */ const normal = {} /** @type {string} */ let prop for (prop in definition.properties) { if (own.call(definition.properties, prop)) { const value = definition.properties[prop] const info = new _defined_info_js__WEBPACK_IMPORTED_MODULE_0__.DefinedInfo( prop, definition.transform(definition.attributes || {}, prop), value, definition.space ) if ( definition.mustUseProperty && definition.mustUseProperty.includes(prop) ) { info.mustUseProperty = true } property[prop] = info normal[(0,_normalize_js__WEBPACK_IMPORTED_MODULE_1__.normalize)(prop)] = prop normal[(0,_normalize_js__WEBPACK_IMPORTED_MODULE_1__.normalize)(info.attribute)] = prop } } return new _schema_js__WEBPACK_IMPORTED_MODULE_2__.Schema(property, normal, definition.space) } /***/ }), /***/ "../node_modules/property-information/lib/util/defined-info.js": /*!*********************************************************************!*\ !*** ../node_modules/property-information/lib/util/defined-info.js ***! \*********************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "DefinedInfo": () => (/* binding */ DefinedInfo) /* harmony export */ }); /* harmony import */ var _info_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./info.js */ "../node_modules/property-information/lib/util/info.js"); /* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types.js */ "../node_modules/property-information/lib/util/types.js"); /** @type {Array<keyof types>} */ // @ts-expect-error: hush. const checks = Object.keys(_types_js__WEBPACK_IMPORTED_MODULE_0__) class DefinedInfo extends _info_js__WEBPACK_IMPORTED_MODULE_1__.Info { /** * @constructor * @param {string} property * @param {string} attribute * @param {number|null} [mask] * @param {string} [space] */ constructor(property, attribute, mask, space) { let index = -1 super(property, attribute) mark(this, 'space', space) if (typeof mask === 'number') { while (++index < checks.length) { const check = checks[index] mark(this, checks[index], (mask & _types_js__WEBPACK_IMPORTED_MODULE_0__[check]) === _types_js__WEBPACK_IMPORTED_MODULE_0__[check]) } } } } DefinedInfo.prototype.defined = true /** * @param {DefinedInfo} values * @param {string} key * @param {unknown} value */ function mark(values, key, value) { if (value) { // @ts-expect-error: assume `value` matches the expected value of `key`. values[key] = value } } /***/ }), /***/ "../node_modules/property-information/lib/util/info.js": /*!*************************************************************!*\ !*** ../node_modules/property-information/lib/util/info.js ***! \*************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Info": () => (/* binding */ Info) /* harmony export */ }); class Info { /** * @constructor * @param {string} property * @param {string} attribute */ constructor(property, attribute) { /** @type {string} */ this.property = property /** @type {string} */ this.attribute = attribute } } /** @type {string|null} */ Info.prototype.space = null Info.prototype.boolean = false Info.prototype.booleanish = false Info.prototype.overloadedBoolean = false Info.prototype.number = false Info.prototype.commaSeparated = false Info.prototype.spaceSeparated = false Info.prototype.commaOrSpaceSeparated = false Info.prototype.mustUseProperty = false Info.prototype.defined = false /***/ }), /***/ "../node_modules/property-information/lib/util/merge.js": /*!**************************************************************!*\ !*** ../node_modules/property-information/lib/util/merge.js ***! \**************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "merge": () => (/* binding */ merge) /* harmony export */ }); /* harmony import */ var _schema_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./schema.js */ "../node_modules/property-information/lib/util/schema.js"); /** * @typedef {import('./schema.js').Properties} Properties * @typedef {import('./schema.js').Normal} Normal */ /** * @param {Schema[]} definitions * @param {string} [space] * @returns {Schema} */ function merge(definitions, space) { /** @type {Properties} */ const property = {} /** @type {Normal} */ const normal = {} let index = -1 while (++index < definitions.length) { Object.assign(property, definitions[index].property) Object.assign(normal, definitions[index].normal) } return new _schema_js__WEBPACK_IMPORTED_MODULE_0__.Schema(property, normal, space) } /***/ }), /***/ "../node_modules/property-information/lib/util/schema.js": /*!***************************************************************!*\ !*** ../node_modules/property-information/lib/util/schema.js ***! \***************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Schema": () => (/* binding */ Schema) /* harmony export */ }); /** * @typedef {import('./info.js').Info} Info * @typedef {Record<string, Info>} Properties * @typedef {Record<string, string>} Normal */ class Schema { /** * @constructor * @param {Properties} property * @param {Normal} normal * @param {string} [space] */ constructor(property, normal, space) { this.property = property this.normal = normal if (space) { this.space = space } } } /** @type {Properties} */ Schema.prototype.property = {} /** @type {Normal} */ Schema.prototype.normal = {} /** @type {string|null} */ Schema.prototype.space = null /***/ }), /***/ "../node_modules/property-information/lib/util/types.js": /*!**************************************************************!*\ !*** ../node_modules/property-information/lib/util/types.js ***! \**************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "boolean": () => (/* binding */ boolean), /* harmony export */ "booleanish": () => (/* binding */ booleanish), /* harmony export */ "commaOrSpaceSeparated": () => (/* binding */ commaOrSpaceSeparated), /* harmony export */ "commaSeparated": () => (/* binding */ commaSeparated), /* harmony export */ "number": () => (/* binding */ number), /* harmony export */ "overloadedBoolean": () => (/* binding */ overloadedBoolean), /* harmony export */ "spaceSeparated": () => (/* binding */ spaceSeparated) /* harmony export */ }); let powers = 0 const boolean = increment() const booleanish = increment() const overloadedBoolean = increment() const number = increment() const spaceSeparated = increment() const commaSeparated = increment() const commaOrSpaceSeparated = increment() function increment() { return 2 ** ++powers } /***/ }), /***/ "../node_modules/property-information/lib/xlink.js": /*!*********************************************************!*\ !*** ../node_modules/property-information/lib/xlink.js ***! \*********************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "xlink": () => (/* binding */ xlink) /* harmony export */ }); /* harmony import */ var _util_create_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/create.js */ "../node_modules/property-information/lib/util/create.js"); const xlink = (0,_util_create_js__WEBPACK_IMPORTED_MODULE_0__.create)({ space: 'xlink', transform(_, prop) { return 'xlink:' + prop.slice(5).toLowerCase() }, properties: { xLinkActuate: null, xLinkArcRole: null, xLinkHref: null, xLinkRole: null, xLinkShow: null, xLinkTitle: null, xLinkType: null } }) /***/ }), /***/ "../node_modules/property-information/lib/xml.js": /*!*******************************************************!*\ !*** ../node_modules/property-information/lib/xml.js ***! \*******************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "xml": () => (/* binding */ xml) /* harmony export */ }); /* harmony import */ var _util_create_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/create.js */ "../node_modules/property-information/lib/util/create.js"); const xml = (0,_util_create_js__WEBPACK_IMPORTED_MODULE_0__.create)({ space: 'xml', transform(_, prop) { return 'xml:' + prop.slice(3).toLowerCase() }, properties: {xmlLang: null, xmlBase: null, xmlSpace: null} }) /***/ }), /***/ "../node_modules/property-information/lib/xmlns.js": /*!*********************************************************!*\ !*** ../node_modules/property-information/lib/xmlns.js ***! \*********************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "xmlns": () => (/* binding */ xmlns) /* harmony export */ }); /* harmony import */ var _util_create_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/create.js */ "../node_modules/property-information/lib/util/create.js"); /* harmony import */ var _util_case_insensitive_transform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/case-insensitive-transform.js */ "../node_modules/property-information/lib/util/case-insensitive-transform.js"); const xmlns = (0,_util_create_js__WEBPACK_IMPORTED_MODULE_0__.create)({ space: 'xmlns', attributes: {xmlnsxlink: 'xmlns:xlink'}, transform: _util_case_insensitive_transform_js__WEBPACK_IMPORTED_MODULE_1__.caseInsensitiveTransform, properties: {xmlns: null, xmlnsXLink: null} }) /***/ }), /***/ "../node_modules/react-markdown/index.js": /*!***********************************************!*\ !*** ../node_modules/react-markdown/index.js ***! \***********************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* reexport safe */ _lib_react_markdown_js__WEBPACK_IMPORTED_MODULE_1__.ReactMarkdown), /* harmony export */ "uriTransformer": () => (/* reexport safe */ _lib_uri_transformer_js__WEBPACK_IMPORTED_MODULE_0__.uriTransformer) /* harmony export */ }); /* harmony import */ var _lib_uri_transformer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/uri-transformer.js */ "../node_modules/react-markdown/lib/uri-transformer.js"); /* harmony import */ var _lib_react_markdown_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/react-markdown.js */ "../node_modules/react-markdown/lib/react-markdown.js"); /** * @typedef {import('./lib/react-markdown.js').ReactMarkdownOptions} Options * @typedef {import('./lib/ast-to-react.js').Components} Components */ /***/ }), /***/ "../node_modules/react-markdown/lib/ast-to-react.js": /*!**********************************************************!*\ !*** ../node_modules/react-markdown/lib/ast-to-react.js ***! \**********************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "childrenToReact": () => (/* binding */ childrenToReact) /* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); /* harmony import */ var react_is__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-is */ "../node_modules/react-is/index.js"); /* harmony import */ var hast_util_whitespace__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! hast-util-whitespace */ "../node_modules/hast-util-whitespace/index.js"); /* harmony import */ var property_information__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! property-information */ "../node_modules/property-information/index.js"); /* harmony import */ var property_information__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! property-information */ "../node_modules/property-information/lib/find.js"); /* harmony import */ var property_information__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! property-information */ "../node_modules/property-information/lib/hast-to-react.js"); /* harmony import */ var space_separated_tokens__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! space-separated-tokens */ "../node_modules/space-separated-tokens/index.js"); /* harmony import */ var comma_separated_tokens__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! comma-separated-tokens */ "../node_modules/comma-separated-tokens/index.js"); /* harmony import */ var style_to_object__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! style-to-object */ "../node_modules/style-to-object/index.mjs"); /* harmony import */ var _uri_transformer_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./uri-transformer.js */ "../node_modules/react-markdown/lib/uri-transformer.js"); /** * @template T * @typedef {import('react').ComponentType<T>} ComponentType<T> */ /** * @template {import('react').ElementType} T * @typedef {import('react').ComponentPropsWithoutRef<T>} ComponentPropsWithoutRef<T> */ /** * @typedef {import('react').ReactNode} ReactNode * @typedef {import('unist').Position} Position * @typedef {import('hast').Element} Element * @typedef {import('hast').ElementContent} ElementContent * @typedef {import('hast').Root} Root * @typedef {import('hast').Text} Text * @typedef {import('hast').Comment} Comment * @typedef {import('hast').DocType} Doctype * @typedef {import('property-information').Info} Info * @typedef {import('property-information').Schema} Schema * @typedef {import('./complex-types.js').ReactMarkdownProps} ReactMarkdownProps * * @typedef Raw * @property {'raw'} type * @property {string} value * * @typedef Context * @property {Options} options * @property {Schema} schema * @property {number} listDepth * * @callback TransformLink * @param {string} href * @param {Array<ElementContent>} children * @param {string?} title * @returns {string} * * @callback TransformImage * @param {string} src * @param {string} alt * @param {string?} title * @returns {string} * * @typedef {import('react').HTMLAttributeAnchorTarget} TransformLinkTargetType * * @callback TransformLinkTarget * @param {string} href * @param {Array<ElementContent>} children * @param {string?} title * @returns {TransformLinkTargetType|undefined} * * @typedef {keyof JSX.IntrinsicElements} ReactMarkdownNames * * To do: is `data-sourcepos` typeable? * * @typedef {ComponentPropsWithoutRef<'code'> & ReactMarkdownProps & {inline?: boolean}} CodeProps * @typedef {ComponentPropsWithoutRef<'h1'> & ReactMarkdownProps & {level: number}} HeadingProps * @typedef {ComponentPropsWithoutRef<'li'> & ReactMarkdownProps & {checked: boolean|null, index: number, ordered: boolean}} LiProps * @typedef {ComponentPropsWithoutRef<'ol'> & ReactMarkdownProps & {depth: number, ordered: true}} OrderedListProps * @typedef {ComponentPropsWithoutRef<'td'> & ReactMarkdownProps & {style?: Record<string, unknown>, isHeader: false}} TableDataCellProps * @typedef {ComponentPropsWithoutRef<'th'> & ReactMarkdownProps & {style?: Record<string, unknown>, isHeader: true}} TableHeaderCellProps * @typedef {ComponentPropsWithoutRef<'tr'> & ReactMarkdownProps & {isHeader: boolean}} TableRowProps * @typedef {ComponentPropsWithoutRef<'ul'> & ReactMarkdownProps & {depth: number, ordered: false}} UnorderedListProps * * @typedef {ComponentType<CodeProps>} CodeComponent * @typedef {ComponentType<HeadingProps>} HeadingComponent * @typedef {ComponentType<LiProps>} LiComponent * @typedef {ComponentType<OrderedListProps>} OrderedListComponent * @typedef {ComponentType<TableDataCellProps>} TableDataCellComponent * @typedef {ComponentType<TableHeaderCellProps>} TableHeaderCellComponent * @typedef {ComponentType<TableRowProps>} TableRowComponent * @typedef {ComponentType<UnorderedListProps>} UnorderedListComponent * * @typedef SpecialComponents * @property {CodeComponent|ReactMarkdownNames} code * @property {HeadingComponent|ReactMarkdownNames} h1 * @property {HeadingComponent|ReactMarkdownNames} h2 * @property {HeadingComponent|ReactMarkdownNames} h3 * @property {HeadingComponent|ReactMarkdownNames} h4 * @property {HeadingComponent|ReactMarkdownNames} h5 * @property {HeadingComponent|ReactMarkdownNames} h6 * @property {LiComponent|ReactMarkdownNames} li * @property {OrderedListComponent|ReactMarkdownNames} ol * @property {TableDataCellComponent|ReactMarkdownNames} td * @property {TableHeaderCellComponent|ReactMarkdownNames} th * @property {TableRowComponent|ReactMarkdownNames} tr * @property {UnorderedListComponent|ReactMarkdownNames} ul * * @typedef {Partial<Omit<import('./complex-types.js').NormalComponents, keyof SpecialComponents> & SpecialComponents>} Components * * @typedef Options * @property {boolean} [sourcePos=false] * @property {boolean} [rawSourcePos=false] * @property {boolean} [skipHtml=false] * @property {boolean} [includeElementIndex=false] * @property {null|false|TransformLink} [transformLinkUri] * @property {TransformImage} [transformImageUri] * @property {TransformLinkTargetType|TransformLinkTarget} [linkTarget] * @property {Components} [components] */ const own = {}.hasOwnProperty // The table-related elements that must not contain whitespace text according // to React. const tableElements = new Set(['table', 'thead', 'tbody', 'tfoot', 'tr']) /** * @param {Context} context * @param {Element|Root} node */ function childrenToReact(context, node) { /** @type {Array<ReactNode>} */ const children = [] let childIndex = -1 /** @type {Comment|Doctype|Element|Raw|Text} */ let child while (++childIndex < node.children.length) { child = node.children[childIndex] if (child.type === 'element') { children.push(toReact(context, child, childIndex, node)) } else if (child.type === 'text') { // Currently, a warning is triggered by react for *any* white space in // tables. // So we drop it. // See: <https://github.com/facebook/react/pull/7081>. // See: <https://github.com/facebook/react/pull/7515>. // See: <https://github.com/remarkjs/remark-react/issues/64>. // See: <https://github.com/remarkjs/react-markdown/issues/576>. if ( node.type !== 'element' || !tableElements.has(node.tagName) || !(0,hast_util_whitespace__WEBPACK_IMPORTED_MODULE_3__.whitespace)(child) ) { children.push(child.value) } } else if (child.type === 'raw' && !context.options.skipHtml) { // Default behavior is to show (encoded) HTML. children.push(child.value) } } return children } /** * @param {Context} context * @param {Element} node * @param {number} index * @param {Element|Root} parent */ function toReact(context, node, index, parent) { const options = context.options const transform = options.transformLinkUri === undefined ? _uri_transformer_js__WEBPACK_IMPORTED_MODULE_4__.uriTransformer : options.transformLinkUri const parentSchema = context.schema /** @type {ReactMarkdownNames} */ // @ts-expect-error assume a known HTML/SVG element. const name = node.tagName /** @type {Record<string, unknown>} */ const properties = {} let schema = parentSchema /** @type {string} */ let property if (parentSchema.space === 'html' && name === 'svg') { schema = property_information__WEBPACK_IMPORTED_MODULE_5__.svg context.schema = schema } if (node.properties) { for (property in node.properties) { if (own.call(node.properties, property)) { addProperty(properties, property, node.properties[property], context) } } } if (name === 'ol' || name === 'ul') { context.listDepth++ } const children = childrenToReact(context, node) if (name === 'ol' || name === 'ul') { context.listDepth-- } // Restore parent schema. context.schema = parentSchema // Nodes created by plugins do not have positional info, in which case we use // an object that matches the position interface. const position = node.position || { start: {line: null, column: null, offset: null}, end: {line: null, column: null, offset: null} } const component = options.components && own.call(options.components, name) ? options.components[name] : name const basic = typeof component === 'string' || component === react__WEBPACK_IMPORTED_MODULE_0__.Fragment if (!react_is__WEBPACK_IMPORTED_MODULE_1__.isValidElementType(component)) { throw new TypeError( `Component for name \`${name}\` not defined or is not renderable` ) } properties.key = index if (name === 'a' && options.linkTarget) { properties.target = typeof options.linkTarget === 'function' ? options.linkTarget( String(properties.href || ''), node.children, typeof properties.title === 'string' ? properties.title : null ) : options.linkTarget } if (name === 'a' && transform) { properties.href = transform( String(properties.href || ''), node.children, typeof properties.title === 'string' ? properties.title : null ) } if ( !basic && name === 'code' && parent.type === 'element' && parent.tagName !== 'pre' ) { properties.inline = true } if ( !basic && (name === 'h1' || name === 'h2' || name === 'h3' || name === 'h4' || name === 'h5' || name === 'h6') ) { properties.level = Number.parseInt(name.charAt(1), 10) } if (name === 'img' && options.transformImageUri) { properties.src = options.transformImageUri( String(properties.src || ''), String(properties.alt || ''), typeof properties.title === 'string' ? properties.title : null ) } if (!basic && name === 'li' && parent.type === 'element') { const input = getInputElement(node) properties.checked = input && input.properties ? Boolean(input.properties.checked) : null properties.index = getElementsBeforeCount(parent, node) properties.ordered = parent.tagName === 'ol' } if (!basic && (name === 'ol' || name === 'ul')) { properties.ordered = name === 'ol' properties.depth = context.listDepth } if (name === 'td' || name === 'th') { if (properties.align) { if (!properties.style) properties.style = {} // @ts-expect-error assume `style` is an object properties.style.textAlign = properties.align delete properties.align } if (!basic) { properties.isHeader = name === 'th' } } if (!basic && name === 'tr' && parent.type === 'element') { properties.isHeader = Boolean(parent.tagName === 'thead') } // If `sourcePos` is given, pass source information (line/column info from markdown source). if (options.sourcePos) { properties['data-sourcepos'] = flattenPosition(position) } if (!basic && options.rawSourcePos) { properties.sourcePosition = node.position } // If `includeElementIndex` is given, pass node index info to components. if (!basic && options.includeElementIndex) { properties.index = getElementsBeforeCount(parent, node) properties.siblingCount = getElementsBeforeCount(parent) } if (!basic) { properties.node = node } // Ensure no React warnings are emitted for void elements w/ children. return children.length > 0 ? react__WEBPACK_IMPORTED_MODULE_0__.createElement(component, properties, children) : react__WEBPACK_IMPORTED_MODULE_0__.createElement(component, properties) } /** * @param {Element|Root} node * @returns {Element?} */ function getInputElement(node) { let index = -1 while (++index < node.children.length) { const child = node.children[index] if (child.type === 'element' && child.tagName === 'input') { return child } } return null } /** * @param {Element|Root} parent * @param {Element} [node] * @returns {number} */ function getElementsBeforeCount(parent, node) { let index = -1 let count = 0 while (++index < parent.children.length) { if (parent.children[index] === node) break if (parent.children[index].type === 'element') count++ } return count } /** * @param {Record<string, unknown>} props * @param {string} prop * @param {unknown} value * @param {Context} ctx */ function addProperty(props, prop, value, ctx) { const info = (0,property_information__WEBPACK_IMPORTED_MODULE_6__.find)(ctx.schema, prop) let result = value // Ignore nullish and `NaN` values. // eslint-disable-next-line no-self-compare if (result === null || result === undefined || result !== result) { return } // Accept `array`. // Most props are space-separated. if (Array.isArray(result)) { result = info.commaSeparated ? (0,comma_separated_tokens__WEBPACK_IMPORTED_MODULE_7__.stringify)(result) : (0,space_separated_tokens__WEBPACK_IMPORTED_MODULE_8__.stringify)(result) } if (info.property === 'style' && typeof result === 'string') { result = parseStyle(result) } if (info.space && info.property) { props[ own.call(property_information__WEBPACK_IMPORTED_MODULE_9__.hastToReact, info.property) ? property_information__WEBPACK_IMPORTED_MODULE_9__.hastToReact[info.property] : info.property ] = result } else if (info.attribute) { props[info.attribute] = result } } /** * @param {string} value * @returns {Record<string, string>} */ function parseStyle(value) { /** @type {Record<string, string>} */ const result = {} try { ;(0,style_to_object__WEBPACK_IMPORTED_MODULE_2__["default"])(value, iterator) } catch { // Silent. } return result /** * @param {string} name * @param {string} v */ function iterator(name, v) { const k = name.slice(0, 4) === '-ms-' ? `ms-${name.slice(4)}` : name result[k.replace(/-([a-z])/g, styleReplacer)] = v } } /** * @param {unknown} _ * @param {string} $1 */ function styleReplacer(_, $1) { return $1.toUpperCase() } /** * @param {Position|{start: {line: null, column: null, offset: null}, end: {line: null, column: null, offset: null}}} pos * @returns {string} */ function flattenPosition(pos) { return [ pos.start.line, ':', pos.start.column, '-', pos.end.line, ':', pos.end.column ] .map(String) .join('') } /***/ }), /***/ "../node_modules/react-markdown/lib/react-markdown.js": /*!************************************************************!*\ !*** ../node_modules/react-markdown/lib/react-markdown.js ***! \************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "ReactMarkdown": () => (/* binding */ ReactMarkdown) /* harmony export */ }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); /* harmony import */ var vfile__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vfile */ "../node_modules/vfile/lib/index.js"); /* harmony import */ var unified__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! unified */ "../node_modules/unified/lib/index.js"); /* harmony import */ var remark_parse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! remark-parse */ "../node_modules/remark-parse/index.js"); /* harmony import */ var remark_rehype__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! remark-rehype */ "../node_modules/remark-rehype/lib/index.js"); /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); /* harmony import */ var property_information__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! property-information */ "../node_modules/property-information/index.js"); /* harmony import */ var _rehype_filter_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./rehype-filter.js */ "../node_modules/react-markdown/lib/rehype-filter.js"); /* harmony import */ var _ast_to_react_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ast-to-react.js */ "../node_modules/react-markdown/lib/ast-to-react.js"); /** * @typedef {import('react').ReactNode} ReactNode * @typedef {import('react').ReactElement<{}>} ReactElement * @typedef {import('unified').PluggableList} PluggableList * @typedef {import('hast').Root} Root * @typedef {import('./rehype-filter.js').Options} FilterOptions * @typedef {import('./ast-to-react.js').Options} TransformOptions * * @typedef CoreOptions * @property {string} children * * @typedef PluginOptions * @property {PluggableList} [remarkPlugins=[]] * @property {PluggableList} [rehypePlugins=[]] * @property {import('remark-rehype').Options | undefined} [remarkRehypeOptions={}] * * @typedef LayoutOptions * @property {string} [className] * * @typedef {CoreOptions & PluginOptions & LayoutOptions & FilterOptions & TransformOptions} ReactMarkdownOptions * * @typedef Deprecation * @property {string} id * @property {string} [to] */ const own = {}.hasOwnProperty const changelog = 'https://github.com/remarkjs/react-markdown/blob/main/changelog.md' /** @type {Record<string, Deprecation>} */ const deprecated = { plugins: {to: 'remarkPlugins', id: 'change-plugins-to-remarkplugins'}, renderers: {to: 'components', id: 'change-renderers-to-components'}, astPlugins: {id: 'remove-buggy-html-in-markdown-parser'}, allowDangerousHtml: {id: 'remove-buggy-html-in-markdown-parser'}, escapeHtml: {id: 'remove-buggy-html-in-markdown-parser'}, source: {to: 'children', id: 'change-source-to-children'}, allowNode: { to: 'allowElement', id: 'replace-allownode-allowedtypes-and-disallowedtypes' }, allowedTypes: { to: 'allowedElements', id: 'replace-allownode-allowedtypes-and-disallowedtypes' }, disallowedTypes: { to: 'disallowedElements', id: 'replace-allownode-allowedtypes-and-disallowedtypes' }, includeNodeIndex: { to: 'includeElementIndex', id: 'change-includenodeindex-to-includeelementindex' } } /** * React component to render markdown. * * @param {ReactMarkdownOptions} options * @returns {ReactElement} */ function ReactMarkdown(options) { for (const key in deprecated) { if (own.call(deprecated, key) && own.call(options, key)) { const deprecation = deprecated[key] console.warn( `[react-markdown] Warning: please ${ deprecation.to ? `use \`${deprecation.to}\` instead of` : 'remove' } \`${key}\` (see <${changelog}#${deprecation.id}> for more info)` ) delete deprecated[key] } } const processor = (0,unified__WEBPACK_IMPORTED_MODULE_1__.unified)() .use(remark_parse__WEBPACK_IMPORTED_MODULE_2__["default"]) .use(options.remarkPlugins || []) .use(remark_rehype__WEBPACK_IMPORTED_MODULE_3__["default"], { ...options.remarkRehypeOptions, allowDangerousHtml: true }) .use(options.rehypePlugins || []) .use(_rehype_filter_js__WEBPACK_IMPORTED_MODULE_4__["default"], options) const file = new vfile__WEBPACK_IMPORTED_MODULE_5__.VFile() if (typeof options.children === 'string') { file.value = options.children } else if (options.children !== undefined && options.children !== null) { console.warn( `[react-markdown] Warning: please pass a string as \`children\` (not: \`${options.children}\`)` ) } const hastNode = processor.runSync(processor.parse(file), file) if (hastNode.type !== 'root') { throw new TypeError('Expected a `root` node') } /** @type {ReactElement} */ let result = react__WEBPACK_IMPORTED_MODULE_0__.createElement( react__WEBPACK_IMPORTED_MODULE_0__.Fragment, {}, (0,_ast_to_react_js__WEBPACK_IMPORTED_MODULE_6__.childrenToReact)({options, schema: property_information__WEBPACK_IMPORTED_MODULE_7__.html, listDepth: 0}, hastNode) ) if (options.className) { result = react__WEBPACK_IMPORTED_MODULE_0__.createElement('div', {className: options.className}, result) } return result } ReactMarkdown.propTypes = { // Core options: children: prop_types__WEBPACK_IMPORTED_MODULE_8__.string, // Layout options: className: prop_types__WEBPACK_IMPORTED_MODULE_8__.string, // Filter options: allowElement: prop_types__WEBPACK_IMPORTED_MODULE_8__.func, allowedElements: prop_types__WEBPACK_IMPORTED_MODULE_8__.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_8__.string), disallowedElements: prop_types__WEBPACK_IMPORTED_MODULE_8__.arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_8__.string), unwrapDisallowed: prop_types__WEBPACK_IMPORTED_MODULE_8__.bool, // Plugin options: remarkPlugins: prop_types__WEBPACK_IMPORTED_MODULE_8__.arrayOf( prop_types__WEBPACK_IMPORTED_MODULE_8__.oneOfType([ prop_types__WEBPACK_IMPORTED_MODULE_8__.object, prop_types__WEBPACK_IMPORTED_MODULE_8__.func, prop_types__WEBPACK_IMPORTED_MODULE_8__.arrayOf( prop_types__WEBPACK_IMPORTED_MODULE_8__.oneOfType([ prop_types__WEBPACK_IMPORTED_MODULE_8__.bool, prop_types__WEBPACK_IMPORTED_MODULE_8__.string, prop_types__WEBPACK_IMPORTED_MODULE_8__.object, prop_types__WEBPACK_IMPORTED_MODULE_8__.func, prop_types__WEBPACK_IMPORTED_MODULE_8__.arrayOf( // prettier-ignore // type-coverage:ignore-next-line prop_types__WEBPACK_IMPORTED_MODULE_8__.any ) ]) ) ]) ), rehypePlugins: prop_types__WEBPACK_IMPORTED_MODULE_8__.arrayOf( prop_types__WEBPACK_IMPORTED_MODULE_8__.oneOfType([ prop_types__WEBPACK_IMPORTED_MODULE_8__.object, prop_types__WEBPACK_IMPORTED_MODULE_8__.func, prop_types__WEBPACK_IMPORTED_MODULE_8__.arrayOf( prop_types__WEBPACK_IMPORTED_MODULE_8__.oneOfType([ prop_types__WEBPACK_IMPORTED_MODULE_8__.bool, prop_types__WEBPACK_IMPORTED_MODULE_8__.string, prop_types__WEBPACK_IMPORTED_MODULE_8__.object, prop_types__WEBPACK_IMPORTED_MODULE_8__.func, prop_types__WEBPACK_IMPORTED_MODULE_8__.arrayOf( // prettier-ignore // type-coverage:ignore-next-line prop_types__WEBPACK_IMPORTED_MODULE_8__.any ) ]) ) ]) ), // Transform options: sourcePos: prop_types__WEBPACK_IMPORTED_MODULE_8__.bool, rawSourcePos: prop_types__WEBPACK_IMPORTED_MODULE_8__.bool, skipHtml: prop_types__WEBPACK_IMPORTED_MODULE_8__.bool, includeElementIndex: prop_types__WEBPACK_IMPORTED_MODULE_8__.bool, transformLinkUri: prop_types__WEBPACK_IMPORTED_MODULE_8__.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_8__.func, prop_types__WEBPACK_IMPORTED_MODULE_8__.bool]), linkTarget: prop_types__WEBPACK_IMPORTED_MODULE_8__.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_8__.func, prop_types__WEBPACK_IMPORTED_MODULE_8__.string]), transformImageUri: prop_types__WEBPACK_IMPORTED_MODULE_8__.func, components: prop_types__WEBPACK_IMPORTED_MODULE_8__.object } /***/ }), /***/ "../node_modules/react-markdown/lib/rehype-filter.js": /*!***********************************************************!*\ !*** ../node_modules/react-markdown/lib/rehype-filter.js ***! \***********************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ rehypeFilter) /* harmony export */ }); /* harmony import */ var unist_util_visit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! unist-util-visit */ "../node_modules/unist-util-visit/lib/index.js"); /** * @typedef {import('unist').Node} Node * @typedef {import('hast').Root} Root * @typedef {import('hast').Element} Element * * @callback AllowElement * @param {Element} element * @param {number} index * @param {Element|Root} parent * @returns {boolean|undefined} * * @typedef Options * @property {Array<string>} [allowedElements] * @property {Array<string>} [disallowedElements=[]] * @property {AllowElement} [allowElement] * @property {boolean} [unwrapDisallowed=false] */ /** * @type {import('unified').Plugin<[Options], Root>} */ function rehypeFilter(options) { if (options.allowedElements && options.disallowedElements) { throw new TypeError( 'Only one of `allowedElements` and `disallowedElements` should be defined' ) } if ( options.allowedElements || options.disallowedElements || options.allowElement ) { return (tree) => { (0,unist_util_visit__WEBPACK_IMPORTED_MODULE_0__.visit)(tree, 'element', (node, index, parent_) => { const parent = /** @type {Element|Root} */ (parent_) /** @type {boolean|undefined} */ let remove if (options.allowedElements) { remove = !options.allowedElements.includes(node.tagName) } else if (options.disallowedElements) { remove = options.disallowedElements.includes(node.tagName) } if (!remove && options.allowElement && typeof index === 'number') { remove = !options.allowElement(node, index, parent) } if (remove && typeof index === 'number') { if (options.unwrapDisallowed && node.children) { parent.children.splice(index, 1, ...node.children) } else { parent.children.splice(index, 1) } return index } return undefined }) } } } /***/ }), /***/ "../node_modules/react-markdown/lib/uri-transformer.js": /*!*************************************************************!*\ !*** ../node_modules/react-markdown/lib/uri-transformer.js ***! \*************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "uriTransformer": () => (/* binding */ uriTransformer) /* harmony export */ }); const protocols = ['http', 'https', 'mailto', 'tel'] /** * @param {string} uri * @returns {string} */ function uriTransformer(uri) { const url = (uri || '').trim() const first = url.charAt(0) if (first === '#' || first === '/') { return url } const colon = url.indexOf(':') if (colon === -1) { return url } let index = -1 while (++index < protocols.length) { const protocol = protocols[index] if ( colon === protocol.length && url.slice(0, protocol.length).toLowerCase() === protocol ) { return url } } index = url.indexOf('?') if (index !== -1 && colon > index) { return url } index = url.indexOf('#') if (index !== -1 && colon > index) { return url } // eslint-disable-next-line no-script-url return 'javascript:void(0)' } /***/ }), /***/ "../node_modules/remark-parse/index.js": /*!*********************************************!*\ !*** ../node_modules/remark-parse/index.js ***! \*********************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _lib_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/index.js */ "../node_modules/remark-parse/lib/index.js"); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_lib_index_js__WEBPACK_IMPORTED_MODULE_0__["default"]); /***/ }), /***/ "../node_modules/remark-parse/lib/index.js": /*!*************************************************!*\ !*** ../node_modules/remark-parse/lib/index.js ***! \*************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ remarkParse) /* harmony export */ }); /* harmony import */ var mdast_util_from_markdown__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mdast-util-from-markdown */ "../node_modules/mdast-util-from-markdown/dev/lib/index.js"); /** * @typedef {import('mdast').Root} Root * @typedef {import('mdast-util-from-markdown').Options} Options */ /** @type {import('unified').Plugin<[Options?] | void[], string, Root>} */ function remarkParse(options) { /** @type {import('unified').ParserFunction<Root>} */ const parser = (doc) => { // Assume options. const settings = /** @type {Options} */ (this.data('settings')) return (0,mdast_util_from_markdown__WEBPACK_IMPORTED_MODULE_0__.fromMarkdown)( doc, Object.assign({}, settings, options, { // Note: these options are not in the readme. // The goal is for them to be set by plugins on `data` instead of being // passed by users. extensions: this.data('micromarkExtensions') || [], mdastExtensions: this.data('fromMarkdownExtensions') || [] }) ) } Object.assign(this, {Parser: parser}) } /***/ }), /***/ "../node_modules/remark-rehype/lib/index.js": /*!**************************************************!*\ !*** ../node_modules/remark-rehype/lib/index.js ***! \**************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var mdast_util_to_hast__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! mdast-util-to-hast */ "../node_modules/mdast-util-to-hast/lib/index.js"); /** * @typedef {import('hast').Root} HastRoot * @typedef {import('mdast').Root} MdastRoot * @typedef {import('mdast-util-to-hast').Options} Options * @typedef {import('unified').Processor<any, any, any, any>} Processor * * @typedef {import('mdast-util-to-hast')} DoNotTouchAsThisImportIncludesRawInTree */ // Note: the `<MdastRoot, HastRoot>` overload doesn’t seem to work :'( /** * Plugin that turns markdown into HTML to support rehype. * * * If a destination processor is given, that processor runs with a new HTML * (hast) tree (bridge-mode). * As the given processor runs with a hast tree, and rehype plugins support * hast, that means rehype plugins can be used with the given processor. * The hast tree is discarded in the end. * It’s highly unlikely that you want to do this. * * The common case is to not pass a destination processor, in which case the * current processor continues running with a new HTML (hast) tree * (mutate-mode). * As the current processor continues with a hast tree, and rehype plugins * support hast, that means rehype plugins can be used after * `remark-rehype`. * It’s likely that this is what you want to do. * * @param destination * Optional unified processor. * @param options * Options passed to `mdast-util-to-hast`. */ const remarkRehype = /** @type {(import('unified').Plugin<[Processor, Options?]|[null|undefined, Options?]|[Options]|[], MdastRoot>)} */ ( function (destination, options) { return destination && 'run' in destination ? bridge(destination, options) : mutate(destination || options) } ) /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (remarkRehype); /** * Bridge-mode. * Runs the destination with the new hast tree. * * @type {import('unified').Plugin<[Processor, Options?], MdastRoot>} */ function bridge(destination, options) { return (node, file, next) => { destination.run((0,mdast_util_to_hast__WEBPACK_IMPORTED_MODULE_0__.toHast)(node, options), file, (error) => { next(error) }) } } /** * Mutate-mode. * Further plugins run on the hast tree. * * @type {import('unified').Plugin<[Options?]|void[], MdastRoot, HastRoot>} */ function mutate(options) { // @ts-expect-error: assume a corresponding node is returned by `toHast`. return (node) => (0,mdast_util_to_hast__WEBPACK_IMPORTED_MODULE_0__.toHast)(node, options) } /***/ }), /***/ "../node_modules/space-separated-tokens/index.js": /*!*******************************************************!*\ !*** ../node_modules/space-separated-tokens/index.js ***! \*******************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "parse": () => (/* binding */ parse), /* harmony export */ "stringify": () => (/* binding */ stringify) /* harmony export */ }); /** * Parse space-separated tokens to an array of strings. * * @param {string} value * Space-separated tokens. * @returns {Array<string>} * List of tokens. */ function parse(value) { const input = String(value || '').trim() return input ? input.split(/[ \t\n\r\f]+/g) : [] } /** * Serialize an array of strings as space separated-tokens. * * @param {Array<string|number>} values * List of tokens. * @returns {string} * Space-separated tokens. */ function stringify(values) { return values.join(' ').trim() } /***/ }), /***/ "../node_modules/style-to-object/index.mjs": /*!*************************************************!*\ !*** ../node_modules/style-to-object/index.mjs ***! \*************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.js */ "../node_modules/style-to-object/index.js"); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_index_js__WEBPACK_IMPORTED_MODULE_0__); /***/ }), /***/ "../node_modules/trim-lines/index.js": /*!*******************************************!*\ !*** ../node_modules/trim-lines/index.js ***! \*******************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "trimLines": () => (/* binding */ trimLines) /* harmony export */ }); const tab = 9 /* `\t` */ const space = 32 /* ` ` */ /** * Remove initial and final spaces and tabs at the line breaks in `value`. * Does not trim initial and final spaces and tabs of the value itself. * * @param {string} value * Value to trim. * @returns {string} * Trimmed value. */ function trimLines(value) { const source = String(value) const search = /\r?\n|\r/g let match = search.exec(source) let last = 0 /** @type {Array<string>} */ const lines = [] while (match) { lines.push( trimLine(source.slice(last, match.index), last > 0, true), match[0] ) last = match.index + match[0].length match = search.exec(source) } lines.push(trimLine(source.slice(last), last > 0, false)) return lines.join('') } /** * @param {string} value * Line to trim. * @param {boolean} start * Whether to trim the start of the line. * @param {boolean} end * Whether to trim the end of the line. * @returns {string} * Trimmed line. */ function trimLine(value, start, end) { let startIndex = 0 let endIndex = value.length if (start) { let code = value.codePointAt(startIndex) while (code === tab || code === space) { startIndex++ code = value.codePointAt(startIndex) } } if (end) { let code = value.codePointAt(endIndex - 1) while (code === tab || code === space) { endIndex-- code = value.codePointAt(endIndex - 1) } } return endIndex > startIndex ? value.slice(startIndex, endIndex) : '' } /***/ }), /***/ "../node_modules/trough/index.js": /*!***************************************!*\ !*** ../node_modules/trough/index.js ***! \***************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "trough": () => (/* binding */ trough), /* harmony export */ "wrap": () => (/* binding */ wrap) /* harmony export */ }); /** * @typedef {(error?: Error|null|undefined, ...output: Array<any>) => void} Callback * @typedef {(...input: Array<any>) => any} Middleware * * @typedef {(...input: Array<any>) => void} Run * Call all middleware. * @typedef {(fn: Middleware) => Pipeline} Use * Add `fn` (middleware) to the list. * @typedef {{run: Run, use: Use}} Pipeline * Middleware. */ /** * Create new middleware. * * @returns {Pipeline} */ function trough() { /** @type {Array<Middleware>} */ const fns = [] /** @type {Pipeline} */ const pipeline = {run, use} return pipeline /** @type {Run} */ function run(...values) { let middlewareIndex = -1 /** @type {Callback} */ const callback = values.pop() if (typeof callback !== 'function') { throw new TypeError('Expected function as last argument, not ' + callback) } next(null, ...values) /** * Run the next `fn`, or we’re done. * * @param {Error|null|undefined} error * @param {Array<any>} output */ function next(error, ...output) { const fn = fns[++middlewareIndex] let index = -1 if (error) { callback(error) return } // Copy non-nullish input into values. while (++index < values.length) { if (output[index] === null || output[index] === undefined) { output[index] = values[index] } } // Save the newly created `output` for the next call. values = output // Next or done. if (fn) { wrap(fn, next)(...output) } else { callback(null, ...output) } } } /** @type {Use} */ function use(middelware) { if (typeof middelware !== 'function') { throw new TypeError( 'Expected `middelware` to be a function, not ' + middelware ) } fns.push(middelware) return pipeline } } /** * Wrap `middleware`. * Can be sync or async; return a promise, receive a callback, or return new * values and errors. * * @param {Middleware} middleware * @param {Callback} callback */ function wrap(middleware, callback) { /** @type {boolean} */ let called return wrapped /** * Call `middleware`. * @this {any} * @param {Array<any>} parameters * @returns {void} */ function wrapped(...parameters) { const fnExpectsCallback = middleware.length > parameters.length /** @type {any} */ let result if (fnExpectsCallback) { parameters.push(done) } try { result = middleware.apply(this, parameters) } catch (error) { const exception = /** @type {Error} */ (error) // Well, this is quite the pickle. // `middleware` received a callback and called it synchronously, but that // threw an error. // The only thing left to do is to throw the thing instead. if (fnExpectsCallback && called) { throw exception } return done(exception) } if (!fnExpectsCallback) { if (result instanceof Promise) { result.then(then, done) } else if (result instanceof Error) { done(result) } else { then(result) } } } /** * Call `callback`, only once. * @type {Callback} */ function done(error, ...output) { if (!called) { called = true callback(error, ...output) } } /** * Call `done` with one value. * * @param {any} [value] */ function then(value) { done(null, value) } } /***/ }), /***/ "../node_modules/unified/lib/index.js": /*!********************************************!*\ !*** ../node_modules/unified/lib/index.js ***! \********************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "unified": () => (/* binding */ unified) /* harmony export */ }); /* harmony import */ var bail__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! bail */ "../node_modules/bail/index.js"); /* harmony import */ var is_buffer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! is-buffer */ "../node_modules/is-buffer/index.js"); /* harmony import */ var extend__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! extend */ "../node_modules/extend/index.js"); /* harmony import */ var is_plain_obj__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! is-plain-obj */ "../node_modules/is-plain-obj/index.js"); /* harmony import */ var trough__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! trough */ "../node_modules/trough/index.js"); /* harmony import */ var vfile__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vfile */ "../node_modules/vfile/lib/index.js"); /** * @typedef {import('unist').Node} Node * @typedef {import('vfile').VFileCompatible} VFileCompatible * @typedef {import('vfile').VFileValue} VFileValue * @typedef {import('..').Processor} Processor * @typedef {import('..').Plugin} Plugin * @typedef {import('..').Preset} Preset * @typedef {import('..').Pluggable} Pluggable * @typedef {import('..').PluggableList} PluggableList * @typedef {import('..').Transformer} Transformer * @typedef {import('..').Parser} Parser * @typedef {import('..').Compiler} Compiler * @typedef {import('..').RunCallback} RunCallback * @typedef {import('..').ProcessCallback} ProcessCallback * * @typedef Context * @property {Node} tree * @property {VFile} file */ // Expose a frozen processor. const unified = base().freeze() const own = {}.hasOwnProperty // Function to create the first processor. /** * @returns {Processor} */ function base() { const transformers = (0,trough__WEBPACK_IMPORTED_MODULE_3__.trough)() /** @type {Processor['attachers']} */ const attachers = [] /** @type {Record<string, unknown>} */ let namespace = {} /** @type {boolean|undefined} */ let frozen let freezeIndex = -1 // Data management. // @ts-expect-error: overloads are handled. processor.data = data processor.Parser = undefined processor.Compiler = undefined // Lock. processor.freeze = freeze // Plugins. processor.attachers = attachers // @ts-expect-error: overloads are handled. processor.use = use // API. processor.parse = parse processor.stringify = stringify // @ts-expect-error: overloads are handled. processor.run = run processor.runSync = runSync // @ts-expect-error: overloads are handled. processor.process = process processor.processSync = processSync // Expose. return processor // Create a new processor based on the processor in the current scope. /** @type {Processor} */ function processor() { const destination = base() let index = -1 while (++index < attachers.length) { destination.use(...attachers[index]) } destination.data(extend__WEBPACK_IMPORTED_MODULE_1__(true, {}, namespace)) return destination } /** * @param {string|Record<string, unknown>} [key] * @param {unknown} [value] * @returns {unknown} */ function data(key, value) { if (typeof key === 'string') { // Set `key`. if (arguments.length === 2) { assertUnfrozen('data', frozen) namespace[key] = value return processor } // Get `key`. return (own.call(namespace, key) && namespace[key]) || null } // Set space. if (key) { assertUnfrozen('data', frozen) namespace = key return processor } // Get space. return namespace } /** @type {Processor['freeze']} */ function freeze() { if (frozen) { return processor } while (++freezeIndex < attachers.length) { const [attacher, ...options] = attachers[freezeIndex] if (options[0] === false) { continue } if (options[0] === true) { options[0] = undefined } /** @type {Transformer|void} */ const transformer = attacher.call(processor, ...options) if (typeof transformer === 'function') { transformers.use(transformer) } } frozen = true freezeIndex = Number.POSITIVE_INFINITY return processor } /** * @param {Pluggable|null|undefined} [value] * @param {...unknown} options * @returns {Processor} */ function use(value, ...options) { /** @type {Record<string, unknown>|undefined} */ let settings assertUnfrozen('use', frozen) if (value === null || value === undefined) { // Empty. } else if (typeof value === 'function') { addPlugin(value, ...options) } else if (typeof value === 'object') { if (Array.isArray(value)) { addList(value) } else { addPreset(value) } } else { throw new TypeError('Expected usable value, not `' + value + '`') } if (settings) { namespace.settings = Object.assign(namespace.settings || {}, settings) } return processor /** * @param {import('..').Pluggable<unknown[]>} value * @returns {void} */ function add(value) { if (typeof value === 'function') { addPlugin(value) } else if (typeof value === 'object') { if (Array.isArray(value)) { const [plugin, ...options] = value addPlugin(plugin, ...options) } else { addPreset(value) } } else { throw new TypeError('Expected usable value, not `' + value + '`') } } /** * @param {Preset} result * @returns {void} */ function addPreset(result) { addList(result.plugins) if (result.settings) { settings = Object.assign(settings || {}, result.settings) } } /** * @param {PluggableList|null|undefined} [plugins] * @returns {void} */ function addList(plugins) { let index = -1 if (plugins === null || plugins === undefined) { // Empty. } else if (Array.isArray(plugins)) { while (++index < plugins.length) { const thing = plugins[index] add(thing) } } else { throw new TypeError('Expected a list of plugins, not `' + plugins + '`') } } /** * @param {Plugin} plugin * @param {...unknown} [value] * @returns {void} */ function addPlugin(plugin, value) { let index = -1 /** @type {Processor['attachers'][number]|undefined} */ let entry while (++index < attachers.length) { if (attachers[index][0] === plugin) { entry = attachers[index] break } } if (entry) { if ((0,is_plain_obj__WEBPACK_IMPORTED_MODULE_2__["default"])(entry[1]) && (0,is_plain_obj__WEBPACK_IMPORTED_MODULE_2__["default"])(value)) { value = extend__WEBPACK_IMPORTED_MODULE_1__(true, entry[1], value) } entry[1] = value } else { // @ts-expect-error: fine. attachers.push([...arguments]) } } } /** @type {Processor['parse']} */ function parse(doc) { processor.freeze() const file = vfile(doc) const Parser = processor.Parser assertParser('parse', Parser) if (newable(Parser, 'parse')) { // @ts-expect-error: `newable` checks this. return new Parser(String(file), file).parse() } // @ts-expect-error: `newable` checks this. return Parser(String(file), file) // eslint-disable-line new-cap } /** @type {Processor['stringify']} */ function stringify(node, doc) { processor.freeze() const file = vfile(doc) const Compiler = processor.Compiler assertCompiler('stringify', Compiler) assertNode(node) if (newable(Compiler, 'compile')) { // @ts-expect-error: `newable` checks this. return new Compiler(node, file).compile() } // @ts-expect-error: `newable` checks this. return Compiler(node, file) // eslint-disable-line new-cap } /** * @param {Node} node * @param {VFileCompatible|RunCallback} [doc] * @param {RunCallback} [callback] * @returns {Promise<Node>|void} */ function run(node, doc, callback) { assertNode(node) processor.freeze() if (!callback && typeof doc === 'function') { callback = doc doc = undefined } if (!callback) { return new Promise(executor) } executor(null, callback) /** * @param {null|((node: Node) => void)} resolve * @param {(error: Error) => void} reject * @returns {void} */ function executor(resolve, reject) { // @ts-expect-error: `doc` can’t be a callback anymore, we checked. transformers.run(node, vfile(doc), done) /** * @param {Error|null} error * @param {Node} tree * @param {VFile} file * @returns {void} */ function done(error, tree, file) { tree = tree || node if (error) { reject(error) } else if (resolve) { resolve(tree) } else { // @ts-expect-error: `callback` is defined if `resolve` is not. callback(null, tree, file) } } } } /** @type {Processor['runSync']} */ function runSync(node, file) { /** @type {Node|undefined} */ let result /** @type {boolean|undefined} */ let complete processor.run(node, file, done) assertDone('runSync', 'run', complete) // @ts-expect-error: we either bailed on an error or have a tree. return result /** * @param {Error|null} [error] * @param {Node} [tree] * @returns {void} */ function done(error, tree) { ;(0,bail__WEBPACK_IMPORTED_MODULE_4__.bail)(error) result = tree complete = true } } /** * @param {VFileCompatible} doc * @param {ProcessCallback} [callback] * @returns {Promise<VFile>|undefined} */ function process(doc, callback) { processor.freeze() assertParser('process', processor.Parser) assertCompiler('process', processor.Compiler) if (!callback) { return new Promise(executor) } executor(null, callback) /** * @param {null|((file: VFile) => void)} resolve * @param {(error?: Error|null|undefined) => void} reject * @returns {void} */ function executor(resolve, reject) { const file = vfile(doc) processor.run(processor.parse(file), file, (error, tree, file) => { if (error || !tree || !file) { done(error) } else { /** @type {unknown} */ const result = processor.stringify(tree, file) if (result === undefined || result === null) { // Empty. } else if (looksLikeAVFileValue(result)) { file.value = result } else { file.result = result } done(error, file) } }) /** * @param {Error|null|undefined} [error] * @param {VFile|undefined} [file] * @returns {void} */ function done(error, file) { if (error || !file) { reject(error) } else if (resolve) { resolve(file) } else { // @ts-expect-error: `callback` is defined if `resolve` is not. callback(null, file) } } } } /** @type {Processor['processSync']} */ function processSync(doc) { /** @type {boolean|undefined} */ let complete processor.freeze() assertParser('processSync', processor.Parser) assertCompiler('processSync', processor.Compiler) const file = vfile(doc) processor.process(file, done) assertDone('processSync', 'process', complete) return file /** * @param {Error|null|undefined} [error] * @returns {void} */ function done(error) { complete = true ;(0,bail__WEBPACK_IMPORTED_MODULE_4__.bail)(error) } } } /** * Check if `value` is a constructor. * * @param {unknown} value * @param {string} name * @returns {boolean} */ function newable(value, name) { return ( typeof value === 'function' && // Prototypes do exist. // type-coverage:ignore-next-line value.prototype && // A function with keys in its prototype is probably a constructor. // Classes’ prototype methods are not enumerable, so we check if some value // exists in the prototype. // type-coverage:ignore-next-line (keys(value.prototype) || name in value.prototype) ) } /** * Check if `value` is an object with keys. * * @param {Record<string, unknown>} value * @returns {boolean} */ function keys(value) { /** @type {string} */ let key for (key in value) { if (own.call(value, key)) { return true } } return false } /** * Assert a parser is available. * * @param {string} name * @param {unknown} value * @returns {asserts value is Parser} */ function assertParser(name, value) { if (typeof value !== 'function') { throw new TypeError('Cannot `' + name + '` without `Parser`') } } /** * Assert a compiler is available. * * @param {string} name * @param {unknown} value * @returns {asserts value is Compiler} */ function assertCompiler(name, value) { if (typeof value !== 'function') { throw new TypeError('Cannot `' + name + '` without `Compiler`') } } /** * Assert the processor is not frozen. * * @param {string} name * @param {unknown} frozen * @returns {asserts frozen is false} */ function assertUnfrozen(name, frozen) { if (frozen) { throw new Error( 'Cannot call `' + name + '` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.' ) } } /** * Assert `node` is a unist node. * * @param {unknown} node * @returns {asserts node is Node} */ function assertNode(node) { // `isPlainObj` unfortunately uses `any` instead of `unknown`. // type-coverage:ignore-next-line if (!(0,is_plain_obj__WEBPACK_IMPORTED_MODULE_2__["default"])(node) || typeof node.type !== 'string') { throw new TypeError('Expected node, got `' + node + '`') // Fine. } } /** * Assert that `complete` is `true`. * * @param {string} name * @param {string} asyncName * @param {unknown} complete * @returns {asserts complete is true} */ function assertDone(name, asyncName, complete) { if (!complete) { throw new Error( '`' + name + '` finished async. Use `' + asyncName + '` instead' ) } } /** * @param {VFileCompatible} [value] * @returns {VFile} */ function vfile(value) { return looksLikeAVFile(value) ? value : new vfile__WEBPACK_IMPORTED_MODULE_5__.VFile(value) } /** * @param {VFileCompatible} [value] * @returns {value is VFile} */ function looksLikeAVFile(value) { return Boolean( value && typeof value === 'object' && 'message' in value && 'messages' in value ) } /** * @param {unknown} [value] * @returns {value is VFileValue} */ function looksLikeAVFileValue(value) { return typeof value === 'string' || is_buffer__WEBPACK_IMPORTED_MODULE_0__(value) } /***/ }), /***/ "../node_modules/unist-util-generated/lib/index.js": /*!*********************************************************!*\ !*** ../node_modules/unist-util-generated/lib/index.js ***! \*********************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "generated": () => (/* binding */ generated) /* harmony export */ }); /** * @typedef PointLike * @property {number | null | undefined} [line] * @property {number | null | undefined} [column] * @property {number | null | undefined} [offset] * * @typedef PositionLike * @property {PointLike | null | undefined} [start] * @property {PointLike | null | undefined} [end] * * @typedef NodeLike * @property {PositionLike | null | undefined} [position] */ /** * Check if `node` is generated. * * @param {NodeLike | null | undefined} [node] * Node to check. * @returns {boolean} * Whether `node` is generated (does not have positional info). */ function generated(node) { return ( !node || !node.position || !node.position.start || !node.position.start.line || !node.position.start.column || !node.position.end || !node.position.end.line || !node.position.end.column ) } /***/ }), /***/ "../node_modules/unist-util-is/lib/index.js": /*!**************************************************!*\ !*** ../node_modules/unist-util-is/lib/index.js ***! \**************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "convert": () => (/* binding */ convert), /* harmony export */ "is": () => (/* binding */ is) /* harmony export */ }); /** * @typedef {import('unist').Node} Node * @typedef {import('unist').Parent} Parent */ /** * @typedef {Record<string, unknown>} Props * @typedef {null | undefined | string | Props | TestFunctionAnything | Array<string | Props | TestFunctionAnything>} Test * Check for an arbitrary node, unaware of TypeScript inferral. * * @callback TestFunctionAnything * Check if a node passes a test, unaware of TypeScript inferral. * @param {unknown} this * The given context. * @param {Node} node * A node. * @param {number | null | undefined} [index] * The node’s position in its parent. * @param {Parent | null | undefined} [parent] * The node’s parent. * @returns {boolean | void} * Whether this node passes the test. */ /** * @template {Node} Kind * Node type. * @typedef {Kind['type'] | Partial<Kind> | TestFunctionPredicate<Kind> | Array<Kind['type'] | Partial<Kind> | TestFunctionPredicate<Kind>>} PredicateTest * Check for a node that can be inferred by TypeScript. */ /** * Check if a node passes a certain test. * * @template {Node} Kind * Node type. * @callback TestFunctionPredicate * Complex test function for a node that can be inferred by TypeScript. * @param {Node} node * A node. * @param {number | null | undefined} [index] * The node’s position in its parent. * @param {Parent | null | undefined} [parent] * The node’s parent. * @returns {node is Kind} * Whether this node passes the test. */ /** * @callback AssertAnything * Check that an arbitrary value is a node, unaware of TypeScript inferral. * @param {unknown} [node] * Anything (typically a node). * @param {number | null | undefined} [index] * The node’s position in its parent. * @param {Parent | null | undefined} [parent] * The node’s parent. * @returns {boolean} * Whether this is a node and passes a test. */ /** * Check if a node is a node and passes a certain node test. * * @template {Node} Kind * Node type. * @callback AssertPredicate * Check that an arbitrary value is a specific node, aware of TypeScript. * @param {unknown} [node] * Anything (typically a node). * @param {number | null | undefined} [index] * The node’s position in its parent. * @param {Parent | null | undefined} [parent] * The node’s parent. * @returns {node is Kind} * Whether this is a node and passes a test. */ /** * Check if `node` is a `Node` and whether it passes the given test. * * @param node * Thing to check, typically `Node`. * @param test * A check for a specific node. * @param index * The node’s position in its parent. * @param parent * The node’s parent. * @returns * Whether `node` is a node and passes a test. */ const is = /** * @type {( * (() => false) & * (<Kind extends Node = Node>(node: unknown, test: PredicateTest<Kind>, index: number, parent: Parent, context?: unknown) => node is Kind) & * (<Kind extends Node = Node>(node: unknown, test: PredicateTest<Kind>, index?: null | undefined, parent?: null | undefined, context?: unknown) => node is Kind) & * ((node: unknown, test: Test, index: number, parent: Parent, context?: unknown) => boolean) & * ((node: unknown, test?: Test, index?: null | undefined, parent?: null | undefined, context?: unknown) => boolean) * )} */ ( /** * @param {unknown} [node] * @param {Test} [test] * @param {number | null | undefined} [index] * @param {Parent | null | undefined} [parent] * @param {unknown} [context] * @returns {boolean} */ // eslint-disable-next-line max-params function is(node, test, index, parent, context) { const check = convert(test) if ( index !== undefined && index !== null && (typeof index !== 'number' || index < 0 || index === Number.POSITIVE_INFINITY) ) { throw new Error('Expected positive finite index') } if ( parent !== undefined && parent !== null && (!is(parent) || !parent.children) ) { throw new Error('Expected parent node') } if ( (parent === undefined || parent === null) !== (index === undefined || index === null) ) { throw new Error('Expected both parent and index') } // @ts-expect-error Looks like a node. return node && node.type && typeof node.type === 'string' ? Boolean(check.call(context, node, index, parent)) : false } ) /** * Generate an assertion from a test. * * Useful if you’re going to test many nodes, for example when creating a * utility where something else passes a compatible test. * * The created function is a bit faster because it expects valid input only: * a `node`, `index`, and `parent`. * * @param test * * when nullish, checks if `node` is a `Node`. * * when `string`, works like passing `(node) => node.type === test`. * * when `function` checks if function passed the node is true. * * when `object`, checks that all keys in test are in node, and that they have (strictly) equal values. * * when `array`, checks if any one of the subtests pass. * @returns * An assertion. */ const convert = /** * @type {( * (<Kind extends Node>(test: PredicateTest<Kind>) => AssertPredicate<Kind>) & * ((test?: Test) => AssertAnything) * )} */ ( /** * @param {Test} [test] * @returns {AssertAnything} */ function (test) { if (test === undefined || test === null) { return ok } if (typeof test === 'string') { return typeFactory(test) } if (typeof test === 'object') { return Array.isArray(test) ? anyFactory(test) : propsFactory(test) } if (typeof test === 'function') { return castFactory(test) } throw new Error('Expected function, string, or object as test') } ) /** * @param {Array<string | Props | TestFunctionAnything>} tests * @returns {AssertAnything} */ function anyFactory(tests) { /** @type {Array<AssertAnything>} */ const checks = [] let index = -1 while (++index < tests.length) { checks[index] = convert(tests[index]) } return castFactory(any) /** * @this {unknown} * @param {Array<unknown>} parameters * @returns {boolean} */ function any(...parameters) { let index = -1 while (++index < checks.length) { if (checks[index].call(this, ...parameters)) return true } return false } } /** * Turn an object into a test for a node with a certain fields. * * @param {Props} check * @returns {AssertAnything} */ function propsFactory(check) { return castFactory(all) /** * @param {Node} node * @returns {boolean} */ function all(node) { /** @type {string} */ let key for (key in check) { // @ts-expect-error: hush, it sure works as an index. if (node[key] !== check[key]) return false } return true } } /** * Turn a string into a test for a node with a certain type. * * @param {string} check * @returns {AssertAnything} */ function typeFactory(check) { return castFactory(type) /** * @param {Node} node */ function type(node) { return node && node.type === check } } /** * Turn a custom test into a test for a node that passes that test. * * @param {TestFunctionAnything} check * @returns {AssertAnything} */ function castFactory(check) { return assertion /** * @this {unknown} * @param {unknown} node * @param {Array<unknown>} parameters * @returns {boolean} */ function assertion(node, ...parameters) { return Boolean( node && typeof node === 'object' && 'type' in node && // @ts-expect-error: fine. Boolean(check.call(this, node, ...parameters)) ) } } function ok() { return true } /***/ }), /***/ "../node_modules/unist-util-position/lib/index.js": /*!********************************************************!*\ !*** ../node_modules/unist-util-position/lib/index.js ***! \********************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "pointEnd": () => (/* binding */ pointEnd), /* harmony export */ "pointStart": () => (/* binding */ pointStart), /* harmony export */ "position": () => (/* binding */ position) /* harmony export */ }); /** * @typedef {import('unist').Position} Position * @typedef {import('unist').Node} Node * @typedef {import('unist').Point} Point */ /** * @typedef NodeLike * @property {string} type * @property {PositionLike | null | undefined} [position] * * @typedef PositionLike * @property {PointLike | null | undefined} [start] * @property {PointLike | null | undefined} [end] * * @typedef PointLike * @property {number | null | undefined} [line] * @property {number | null | undefined} [column] * @property {number | null | undefined} [offset] */ /** * Get the starting point of `node`. * * @param node * Node. * @returns * Point. */ const pointStart = point('start') /** * Get the ending point of `node`. * * @param node * Node. * @returns * Point. */ const pointEnd = point('end') /** * Get the positional info of `node`. * * @param {NodeLike | Node | null | undefined} [node] * Node. * @returns {Position} * Position. */ function position(node) { return {start: pointStart(node), end: pointEnd(node)} } /** * Get the positional info of `node`. * * @param {'start' | 'end'} type * Side. * @returns * Getter. */ function point(type) { return point /** * Get the point info of `node` at a bound side. * * @param {NodeLike | Node | null | undefined} [node] * @returns {Point} */ function point(node) { const point = (node && node.position && node.position[type]) || {} // To do: next major: don’t return points when invalid. return { // @ts-expect-error: in practice, null is allowed. line: point.line || null, // @ts-expect-error: in practice, null is allowed. column: point.column || null, // @ts-expect-error: in practice, null is allowed. offset: point.offset > -1 ? point.offset : null } } } /***/ }), /***/ "../node_modules/unist-util-stringify-position/lib/index.js": /*!******************************************************************!*\ !*** ../node_modules/unist-util-stringify-position/lib/index.js ***! \******************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "stringifyPosition": () => (/* binding */ stringifyPosition) /* harmony export */ }); /** * @typedef {import('unist').Node} Node * @typedef {import('unist').Point} Point * @typedef {import('unist').Position} Position */ /** * @typedef NodeLike * @property {string} type * @property {PositionLike | null | undefined} [position] * * @typedef PositionLike * @property {PointLike | null | undefined} [start] * @property {PointLike | null | undefined} [end] * * @typedef PointLike * @property {number | null | undefined} [line] * @property {number | null | undefined} [column] * @property {number | null | undefined} [offset] */ /** * Serialize the positional info of a point, position (start and end points), * or node. * * @param {Node | NodeLike | Position | PositionLike | Point | PointLike | null | undefined} [value] * Node, position, or point. * @returns {string} * Pretty printed positional info of a node (`string`). * * In the format of a range `ls:cs-le:ce` (when given `node` or `position`) * or a point `l:c` (when given `point`), where `l` stands for line, `c` for * column, `s` for `start`, and `e` for end. * An empty string (`''`) is returned if the given value is neither `node`, * `position`, nor `point`. */ function stringifyPosition(value) { // Nothing. if (!value || typeof value !== 'object') { return '' } // Node. if ('position' in value || 'type' in value) { return position(value.position) } // Position. if ('start' in value || 'end' in value) { return position(value) } // Point. if ('line' in value || 'column' in value) { return point(value) } // ? return '' } /** * @param {Point | PointLike | null | undefined} point * @returns {string} */ function point(point) { return index(point && point.line) + ':' + index(point && point.column) } /** * @param {Position | PositionLike | null | undefined} pos * @returns {string} */ function position(pos) { return point(pos && pos.start) + '-' + point(pos && pos.end) } /** * @param {number | null | undefined} value * @returns {number} */ function index(value) { return value && typeof value === 'number' ? value : 1 } /***/ }), /***/ "../node_modules/unist-util-visit-parents/lib/color.browser.js": /*!*********************************************************************!*\ !*** ../node_modules/unist-util-visit-parents/lib/color.browser.js ***! \*********************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "color": () => (/* binding */ color) /* harmony export */ }); /** * @param {string} d * @returns {string} */ function color(d) { return d } /***/ }), /***/ "../node_modules/unist-util-visit-parents/lib/index.js": /*!*************************************************************!*\ !*** ../node_modules/unist-util-visit-parents/lib/index.js ***! \*************************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "CONTINUE": () => (/* binding */ CONTINUE), /* harmony export */ "EXIT": () => (/* binding */ EXIT), /* harmony export */ "SKIP": () => (/* binding */ SKIP), /* harmony export */ "visitParents": () => (/* binding */ visitParents) /* harmony export */ }); /* harmony import */ var unist_util_is__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! unist-util-is */ "../node_modules/unist-util-is/lib/index.js"); /* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ "../node_modules/unist-util-visit-parents/lib/color.browser.js"); /** * @typedef {import('unist').Node} Node * @typedef {import('unist').Parent} Parent * @typedef {import('unist-util-is').Test} Test */ /** * @typedef {boolean | 'skip'} Action * Union of the action types. * * @typedef {number} Index * Move to the sibling at `index` next (after node itself is completely * traversed). * * Useful if mutating the tree, such as removing the node the visitor is * currently on, or any of its previous siblings. * Results less than 0 or greater than or equal to `children.length` stop * traversing the parent. * * @typedef {[(Action | null | undefined | void)?, (Index | null | undefined)?]} ActionTuple * List with one or two values, the first an action, the second an index. * * @typedef {Action | ActionTuple | Index | null | undefined | void} VisitorResult * Any value that can be returned from a visitor. */ /** * @template {Node} [Visited=Node] * Visited node type. * @template {Parent} [Ancestor=Parent] * Ancestor type. * @callback Visitor * Handle a node (matching `test`, if given). * * Visitors are free to transform `node`. * They can also transform the parent of node (the last of `ancestors`). * * Replacing `node` itself, if `SKIP` is not returned, still causes its * descendants to be walked (which is a bug). * * When adding or removing previous siblings of `node` (or next siblings, in * case of reverse), the `Visitor` should return a new `Index` to specify the * sibling to traverse after `node` is traversed. * Adding or removing next siblings of `node` (or previous siblings, in case * of reverse) is handled as expected without needing to return a new `Index`. * * Removing the children property of an ancestor still results in them being * traversed. * @param {Visited} node * Found node. * @param {Array<Ancestor>} ancestors * Ancestors of `node`. * @returns {VisitorResult} * What to do next. * * An `Index` is treated as a tuple of `[CONTINUE, Index]`. * An `Action` is treated as a tuple of `[Action]`. * * Passing a tuple back only makes sense if the `Action` is `SKIP`. * When the `Action` is `EXIT`, that action can be returned. * When the `Action` is `CONTINUE`, `Index` can be returned. */ /** * @template {Node} [Tree=Node] * Tree type. * @template {Test} [Check=string] * Test type. * @typedef {Visitor<import('./complex-types.js').Matches<import('./complex-types.js').InclusiveDescendant<Tree>, Check>, Extract<import('./complex-types.js').InclusiveDescendant<Tree>, Parent>>} BuildVisitor * Build a typed `Visitor` function from a tree and a test. * * It will infer which values are passed as `node` and which as `parents`. */ /** * Continue traversing as normal. */ const CONTINUE = true /** * Stop traversing immediately. */ const EXIT = false /** * Do not traverse this node’s children. */ const SKIP = 'skip' /** * Visit nodes, with ancestral information. * * This algorithm performs *depth-first* *tree traversal* in *preorder* * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**). * * You can choose for which nodes `visitor` is called by passing a `test`. * For complex tests, you should test yourself in `visitor`, as it will be * faster and will have improved type information. * * Walking the tree is an intensive task. * Make use of the return values of the visitor when possible. * Instead of walking a tree multiple times, walk it once, use `unist-util-is` * to check if a node matches, and then perform different operations. * * You can change the tree. * See `Visitor` for more info. * * @param tree * Tree to traverse. * @param test * `unist-util-is`-compatible test * @param visitor * Handle each node. * @param reverse * Traverse in reverse preorder (NRL) instead of the default preorder (NLR). * @returns * Nothing. */ const visitParents = /** * @type {( * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: BuildVisitor<Tree, Check>, reverse?: boolean | null | undefined) => void) & * (<Tree extends Node>(tree: Tree, visitor: BuildVisitor<Tree>, reverse?: boolean | null | undefined) => void) * )} */ ( /** * @param {Node} tree * @param {Test} test * @param {Visitor<Node>} visitor * @param {boolean | null | undefined} [reverse] * @returns {void} */ function (tree, test, visitor, reverse) { if (typeof test === 'function' && typeof visitor !== 'function') { reverse = visitor // @ts-expect-error no visitor given, so `visitor` is test. visitor = test test = null } const is = (0,unist_util_is__WEBPACK_IMPORTED_MODULE_0__.convert)(test) const step = reverse ? -1 : 1 factory(tree, undefined, [])() /** * @param {Node} node * @param {number | undefined} index * @param {Array<Parent>} parents */ function factory(node, index, parents) { /** @type {Record<string, unknown>} */ // @ts-expect-error: hush const value = node && typeof node === 'object' ? node : {} if (typeof value.type === 'string') { const name = // `hast` typeof value.tagName === 'string' ? value.tagName : // `xast` typeof value.name === 'string' ? value.name : undefined Object.defineProperty(visit, 'name', { value: 'node (' + (0,_color_js__WEBPACK_IMPORTED_MODULE_1__.color)(node.type + (name ? '<' + name + '>' : '')) + ')' }) } return visit function visit() { /** @type {ActionTuple} */ let result = [] /** @type {ActionTuple} */ let subresult /** @type {number} */ let offset /** @type {Array<Parent>} */ let grandparents if (!test || is(node, index, parents[parents.length - 1] || null)) { result = toResult(visitor(node, parents)) if (result[0] === EXIT) { return result } } // @ts-expect-error looks like a parent. if (node.children && result[0] !== SKIP) { // @ts-expect-error looks like a parent. offset = (reverse ? node.children.length : -1) + step // @ts-expect-error looks like a parent. grandparents = parents.concat(node) // @ts-expect-error looks like a parent. while (offset > -1 && offset < node.children.length) { // @ts-expect-error looks like a parent. subresult = factory(node.children[offset], offset, grandparents)() if (subresult[0] === EXIT) { return subresult } offset = typeof subresult[1] === 'number' ? subresult[1] : offset + step } } return result } } } ) /** * Turn a return value into a clean result. * * @param {VisitorResult} value * Valid return values from visitors. * @returns {ActionTuple} * Clean result. */ function toResult(value) { if (Array.isArray(value)) { return value } if (typeof value === 'number') { return [CONTINUE, value] } return [value] } /***/ }), /***/ "../node_modules/unist-util-visit/lib/index.js": /*!*****************************************************!*\ !*** ../node_modules/unist-util-visit/lib/index.js ***! \*****************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "CONTINUE": () => (/* reexport safe */ unist_util_visit_parents__WEBPACK_IMPORTED_MODULE_0__.CONTINUE), /* harmony export */ "EXIT": () => (/* reexport safe */ unist_util_visit_parents__WEBPACK_IMPORTED_MODULE_0__.EXIT), /* harmony export */ "SKIP": () => (/* reexport safe */ unist_util_visit_parents__WEBPACK_IMPORTED_MODULE_0__.SKIP), /* harmony export */ "visit": () => (/* binding */ visit) /* harmony export */ }); /* harmony import */ var unist_util_visit_parents__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! unist-util-visit-parents */ "../node_modules/unist-util-visit-parents/lib/index.js"); /** * @typedef {import('unist').Node} Node * @typedef {import('unist').Parent} Parent * @typedef {import('unist-util-is').Test} Test * @typedef {import('unist-util-visit-parents').VisitorResult} VisitorResult */ /** * Check if `Child` can be a child of `Ancestor`. * * Returns the ancestor when `Child` can be a child of `Ancestor`, or returns * `never`. * * @template {Node} Ancestor * Node type. * @template {Node} Child * Node type. * @typedef {( * Ancestor extends Parent * ? Child extends Ancestor['children'][number] * ? Ancestor * : never * : never * )} ParentsOf */ /** * @template {Node} [Visited=Node] * Visited node type. * @template {Parent} [Ancestor=Parent] * Ancestor type. * @callback Visitor * Handle a node (matching `test`, if given). * * Visitors are free to transform `node`. * They can also transform `parent`. * * Replacing `node` itself, if `SKIP` is not returned, still causes its * descendants to be walked (which is a bug). * * When adding or removing previous siblings of `node` (or next siblings, in * case of reverse), the `Visitor` should return a new `Index` to specify the * sibling to traverse after `node` is traversed. * Adding or removing next siblings of `node` (or previous siblings, in case * of reverse) is handled as expected without needing to return a new `Index`. * * Removing the children property of `parent` still results in them being * traversed. * @param {Visited} node * Found node. * @param {Visited extends Node ? number | null : never} index * Index of `node` in `parent`. * @param {Ancestor extends Node ? Ancestor | null : never} parent * Parent of `node`. * @returns {VisitorResult} * What to do next. * * An `Index` is treated as a tuple of `[CONTINUE, Index]`. * An `Action` is treated as a tuple of `[Action]`. * * Passing a tuple back only makes sense if the `Action` is `SKIP`. * When the `Action` is `EXIT`, that action can be returned. * When the `Action` is `CONTINUE`, `Index` can be returned. */ /** * Build a typed `Visitor` function from a node and all possible parents. * * It will infer which values are passed as `node` and which as `parent`. * * @template {Node} Visited * Node type. * @template {Parent} Ancestor * Parent type. * @typedef {Visitor<Visited, ParentsOf<Ancestor, Visited>>} BuildVisitorFromMatch */ /** * Build a typed `Visitor` function from a list of descendants and a test. * * It will infer which values are passed as `node` and which as `parent`. * * @template {Node} Descendant * Node type. * @template {Test} Check * Test type. * @typedef {( * BuildVisitorFromMatch< * import('unist-util-visit-parents/complex-types.js').Matches<Descendant, Check>, * Extract<Descendant, Parent> * > * )} BuildVisitorFromDescendants */ /** * Build a typed `Visitor` function from a tree and a test. * * It will infer which values are passed as `node` and which as `parent`. * * @template {Node} [Tree=Node] * Node type. * @template {Test} [Check=string] * Test type. * @typedef {( * BuildVisitorFromDescendants< * import('unist-util-visit-parents/complex-types.js').InclusiveDescendant<Tree>, * Check * > * )} BuildVisitor */ /** * Visit nodes. * * This algorithm performs *depth-first* *tree traversal* in *preorder* * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**). * * You can choose for which nodes `visitor` is called by passing a `test`. * For complex tests, you should test yourself in `visitor`, as it will be * faster and will have improved type information. * * Walking the tree is an intensive task. * Make use of the return values of the visitor when possible. * Instead of walking a tree multiple times, walk it once, use `unist-util-is` * to check if a node matches, and then perform different operations. * * You can change the tree. * See `Visitor` for more info. * * @param tree * Tree to traverse. * @param test * `unist-util-is`-compatible test * @param visitor * Handle each node. * @param reverse * Traverse in reverse preorder (NRL) instead of the default preorder (NLR). * @returns * Nothing. */ const visit = /** * @type {( * (<Tree extends Node, Check extends Test>(tree: Tree, test: Check, visitor: BuildVisitor<Tree, Check>, reverse?: boolean | null | undefined) => void) & * (<Tree extends Node>(tree: Tree, visitor: BuildVisitor<Tree>, reverse?: boolean | null | undefined) => void) * )} */ ( /** * @param {Node} tree * @param {Test} test * @param {Visitor} visitor * @param {boolean | null | undefined} [reverse] * @returns {void} */ function (tree, test, visitor, reverse) { if (typeof test === 'function' && typeof visitor !== 'function') { reverse = visitor visitor = test test = null } (0,unist_util_visit_parents__WEBPACK_IMPORTED_MODULE_0__.visitParents)(tree, test, overload, reverse) /** * @param {Node} node * @param {Array<Parent>} parents */ function overload(node, parents) { const parent = parents[parents.length - 1] return visitor( node, parent ? parent.children.indexOf(node) : null, parent ) } } ) /***/ }), /***/ "../node_modules/uvu/assert/index.mjs": /*!********************************************!*\ !*** ../node_modules/uvu/assert/index.mjs ***! \********************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Assertion": () => (/* binding */ Assertion), /* harmony export */ "equal": () => (/* binding */ equal), /* harmony export */ "fixture": () => (/* binding */ fixture), /* harmony export */ "instance": () => (/* binding */ instance), /* harmony export */ "is": () => (/* binding */ is), /* harmony export */ "match": () => (/* binding */ match), /* harmony export */ "not": () => (/* binding */ not), /* harmony export */ "ok": () => (/* binding */ ok), /* harmony export */ "snapshot": () => (/* binding */ snapshot), /* harmony export */ "throws": () => (/* binding */ throws), /* harmony export */ "type": () => (/* binding */ type), /* harmony export */ "unreachable": () => (/* binding */ unreachable) /* harmony export */ }); /* harmony import */ var dequal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dequal */ "../node_modules/dequal/dist/index.mjs"); /* harmony import */ var uvu_diff__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! uvu/diff */ "../node_modules/uvu/diff/index.mjs"); function dedent(str) { str = str.replace(/\r?\n/g, '\n'); let arr = str.match(/^[ \t]*(?=\S)/gm); let i = 0, min = 1/0, len = (arr||[]).length; for (; i < len; i++) min = Math.min(min, arr[i].length); return len && min ? str.replace(new RegExp(`^[ \\t]{${min}}`, 'gm'), '') : str; } class Assertion extends Error { constructor(opts={}) { super(opts.message); this.name = 'Assertion'; this.code = 'ERR_ASSERTION'; if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } this.details = opts.details || false; this.generated = !!opts.generated; this.operator = opts.operator; this.expects = opts.expects; this.actual = opts.actual; } } function assert(bool, actual, expects, operator, detailer, backup, msg) { if (bool) return; let message = msg || backup; if (msg instanceof Error) throw msg; let details = detailer && detailer(actual, expects); throw new Assertion({ actual, expects, operator, message, details, generated: !msg }); } function ok(val, msg) { assert(!!val, false, true, 'ok', false, 'Expected value to be truthy', msg); } function is(val, exp, msg) { assert(val === exp, val, exp, 'is', uvu_diff__WEBPACK_IMPORTED_MODULE_1__.compare, 'Expected values to be strictly equal:', msg); } function equal(val, exp, msg) { assert((0,dequal__WEBPACK_IMPORTED_MODULE_0__.dequal)(val, exp), val, exp, 'equal', uvu_diff__WEBPACK_IMPORTED_MODULE_1__.compare, 'Expected values to be deeply equal:', msg); } function unreachable(msg) { assert(false, true, false, 'unreachable', false, 'Expected not to be reached!', msg); } function type(val, exp, msg) { let tmp = typeof val; assert(tmp === exp, tmp, exp, 'type', false, `Expected "${tmp}" to be "${exp}"`, msg); } function instance(val, exp, msg) { let name = '`' + (exp.name || exp.constructor.name) + '`'; assert(val instanceof exp, val, exp, 'instance', false, `Expected value to be an instance of ${name}`, msg); } function match(val, exp, msg) { if (typeof exp === 'string') { assert(val.includes(exp), val, exp, 'match', false, `Expected value to include "${exp}" substring`, msg); } else { assert(exp.test(val), val, exp, 'match', false, `Expected value to match \`${String(exp)}\` pattern`, msg); } } function snapshot(val, exp, msg) { val=dedent(val); exp=dedent(exp); assert(val === exp, val, exp, 'snapshot', uvu_diff__WEBPACK_IMPORTED_MODULE_1__.lines, 'Expected value to match snapshot:', msg); } const lineNums = (x, y) => (0,uvu_diff__WEBPACK_IMPORTED_MODULE_1__.lines)(x, y, 1); function fixture(val, exp, msg) { val=dedent(val); exp=dedent(exp); assert(val === exp, val, exp, 'fixture', lineNums, 'Expected value to match fixture:', msg); } function throws(blk, exp, msg) { if (!msg && typeof exp === 'string') { msg = exp; exp = null; } try { blk(); assert(false, false, true, 'throws', false, 'Expected function to throw', msg); } catch (err) { if (err instanceof Assertion) throw err; if (typeof exp === 'function') { assert(exp(err), false, true, 'throws', false, 'Expected function to throw matching exception', msg); } else if (exp instanceof RegExp) { assert(exp.test(err.message), false, true, 'throws', false, `Expected function to throw exception matching \`${String(exp)}\` pattern`, msg); } } } // --- function not(val, msg) { assert(!val, true, false, 'not', false, 'Expected value to be falsey', msg); } not.ok = not; is.not = function (val, exp, msg) { assert(val !== exp, val, exp, 'is.not', false, 'Expected values not to be strictly equal', msg); } not.equal = function (val, exp, msg) { assert(!(0,dequal__WEBPACK_IMPORTED_MODULE_0__.dequal)(val, exp), val, exp, 'not.equal', false, 'Expected values not to be deeply equal', msg); } not.type = function (val, exp, msg) { let tmp = typeof val; assert(tmp !== exp, tmp, exp, 'not.type', false, `Expected "${tmp}" not to be "${exp}"`, msg); } not.instance = function (val, exp, msg) { let name = '`' + (exp.name || exp.constructor.name) + '`'; assert(!(val instanceof exp), val, exp, 'not.instance', false, `Expected value not to be an instance of ${name}`, msg); } not.snapshot = function (val, exp, msg) { val=dedent(val); exp=dedent(exp); assert(val !== exp, val, exp, 'not.snapshot', false, 'Expected value not to match snapshot', msg); } not.fixture = function (val, exp, msg) { val=dedent(val); exp=dedent(exp); assert(val !== exp, val, exp, 'not.fixture', false, 'Expected value not to match fixture', msg); } not.match = function (val, exp, msg) { if (typeof exp === 'string') { assert(!val.includes(exp), val, exp, 'not.match', false, `Expected value not to include "${exp}" substring`, msg); } else { assert(!exp.test(val), val, exp, 'not.match', false, `Expected value not to match \`${String(exp)}\` pattern`, msg); } } not.throws = function (blk, exp, msg) { if (!msg && typeof exp === 'string') { msg = exp; exp = null; } try { blk(); } catch (err) { if (typeof exp === 'function') { assert(!exp(err), true, false, 'not.throws', false, 'Expected function not to throw matching exception', msg); } else if (exp instanceof RegExp) { assert(!exp.test(err.message), true, false, 'not.throws', false, `Expected function not to throw exception matching \`${String(exp)}\` pattern`, msg); } else if (!exp) { assert(false, true, false, 'not.throws', false, 'Expected function not to throw', msg); } } } /***/ }), /***/ "../node_modules/uvu/diff/index.mjs": /*!******************************************!*\ !*** ../node_modules/uvu/diff/index.mjs ***! \******************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "arrays": () => (/* binding */ arrays), /* harmony export */ "chars": () => (/* binding */ chars), /* harmony export */ "circular": () => (/* binding */ circular), /* harmony export */ "compare": () => (/* binding */ compare), /* harmony export */ "direct": () => (/* binding */ direct), /* harmony export */ "lines": () => (/* binding */ lines), /* harmony export */ "sort": () => (/* binding */ sort), /* harmony export */ "stringify": () => (/* binding */ stringify) /* harmony export */ }); /* harmony import */ var kleur__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! kleur */ "../node_modules/uvu/node_modules/kleur/index.mjs"); /* harmony import */ var diff__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! diff */ "../node_modules/diff/lib/index.mjs"); const colors = { '--': kleur__WEBPACK_IMPORTED_MODULE_0__["default"].red, '··': kleur__WEBPACK_IMPORTED_MODULE_0__["default"].grey, '++': kleur__WEBPACK_IMPORTED_MODULE_0__["default"].green, }; const TITLE = kleur__WEBPACK_IMPORTED_MODULE_0__["default"].dim().italic; const TAB=kleur__WEBPACK_IMPORTED_MODULE_0__["default"].dim('→'), SPACE=kleur__WEBPACK_IMPORTED_MODULE_0__["default"].dim('·'), NL=kleur__WEBPACK_IMPORTED_MODULE_0__["default"].dim('↵'); const LOG = (sym, str) => colors[sym](sym + PRETTY(str)) + '\n'; const LINE = (num, x) => kleur__WEBPACK_IMPORTED_MODULE_0__["default"].dim('L' + String(num).padStart(x, '0') + ' '); const PRETTY = str => str.replace(/[ ]/g, SPACE).replace(/\t/g, TAB).replace(/(\r?\n)/g, NL); function line(obj, prev, pad) { let char = obj.removed ? '--' : obj.added ? '++' : '··'; let arr = obj.value.replace(/\r?\n$/, '').split('\n'); let i=0, tmp, out=''; if (obj.added) out += colors[char]().underline(TITLE('Expected:')) + '\n'; else if (obj.removed) out += colors[char]().underline(TITLE('Actual:')) + '\n'; for (; i < arr.length; i++) { tmp = arr[i]; if (tmp != null) { if (prev) out += LINE(prev + i, pad); out += LOG(char, tmp || '\n'); } } return out; } // TODO: want better diffing //~> complex items bail outright function arrays(input, expect) { let arr = diff__WEBPACK_IMPORTED_MODULE_1__.diffArrays(input, expect); let i=0, j=0, k=0, tmp, val, char, isObj, str; let out = LOG('··', '['); for (; i < arr.length; i++) { char = (tmp = arr[i]).removed ? '--' : tmp.added ? '++' : '··'; if (tmp.added) { out += colors[char]().underline(TITLE('Expected:')) + '\n'; } else if (tmp.removed) { out += colors[char]().underline(TITLE('Actual:')) + '\n'; } for (j=0; j < tmp.value.length; j++) { isObj = (tmp.value[j] && typeof tmp.value[j] === 'object'); val = stringify(tmp.value[j]).split(/\r?\n/g); for (k=0; k < val.length;) { str = ' ' + val[k++] + (isObj ? '' : ','); if (isObj && k === val.length && (j + 1) < tmp.value.length) str += ','; out += LOG(char, str); } } } return out + LOG('··', ']'); } function lines(input, expect, linenum = 0) { let i=0, tmp, output=''; let arr = diff__WEBPACK_IMPORTED_MODULE_1__.diffLines(input, expect); let pad = String(expect.split(/\r?\n/g).length - linenum).length; for (; i < arr.length; i++) { output += line(tmp = arr[i], linenum, pad); if (linenum && !tmp.removed) linenum += tmp.count; } return output; } function chars(input, expect) { let arr = diff__WEBPACK_IMPORTED_MODULE_1__.diffChars(input, expect); let i=0, output='', tmp; let l1 = input.length; let l2 = expect.length; let p1 = PRETTY(input); let p2 = PRETTY(expect); tmp = arr[i]; if (l1 === l2) { // no length offsets } else if (tmp.removed && arr[i + 1]) { let del = tmp.count - arr[i + 1].count; if (del == 0) { // wash~ } else if (del > 0) { expect = ' '.repeat(del) + expect; p2 = ' '.repeat(del) + p2; l2 += del; } else if (del < 0) { input = ' '.repeat(-del) + input; p1 = ' '.repeat(-del) + p1; l1 += -del; } } output += direct(p1, p2, l1, l2); if (l1 === l2) { for (tmp=' '; i < l1; i++) { tmp += input[i] === expect[i] ? ' ' : '^'; } } else { for (tmp=' '; i < arr.length; i++) { tmp += ((arr[i].added || arr[i].removed) ? '^' : ' ').repeat(Math.max(arr[i].count, 0)); if (i + 1 < arr.length && ((arr[i].added && arr[i+1].removed) || (arr[i].removed && arr[i+1].added))) { arr[i + 1].count -= arr[i].count; } } } return output + kleur__WEBPACK_IMPORTED_MODULE_0__["default"].red(tmp); } function direct(input, expect, lenA = String(input).length, lenB = String(expect).length) { let gutter = 4; let lenC = Math.max(lenA, lenB); let typeA=typeof input, typeB=typeof expect; if (typeA !== typeB) { gutter = 2; let delA = gutter + lenC - lenA; let delB = gutter + lenC - lenB; input += ' '.repeat(delA) + kleur__WEBPACK_IMPORTED_MODULE_0__["default"].dim(`[${typeA}]`); expect += ' '.repeat(delB) + kleur__WEBPACK_IMPORTED_MODULE_0__["default"].dim(`[${typeB}]`); lenA += delA + typeA.length + 2; lenB += delB + typeB.length + 2; lenC = Math.max(lenA, lenB); } let output = colors['++']('++' + expect + ' '.repeat(gutter + lenC - lenB) + TITLE('(Expected)')) + '\n'; return output + colors['--']('--' + input + ' '.repeat(gutter + lenC - lenA) + TITLE('(Actual)')) + '\n'; } function sort(input, expect) { var k, i=0, tmp, isArr = Array.isArray(input); var keys=[], out=isArr ? Array(input.length) : {}; if (isArr) { for (i=0; i < out.length; i++) { tmp = input[i]; if (!tmp || typeof tmp !== 'object') out[i] = tmp; else out[i] = sort(tmp, expect[i]); // might not be right } } else { for (k in expect) keys.push(k); for (; i < keys.length; i++) { if (Object.prototype.hasOwnProperty.call(input, k = keys[i])) { if (!(tmp = input[k]) || typeof tmp !== 'object') out[k] = tmp; else out[k] = sort(tmp, expect[k]); } } for (k in input) { if (!out.hasOwnProperty(k)) { out[k] = input[k]; // expect didnt have } } } return out; } function circular() { var cache = new Set; return function print(key, val) { if (val === void 0) return '[__VOID__]'; if (typeof val === 'number' && val !== val) return '[__NAN__]'; if (typeof val === 'bigint') return val.toString(); if (!val || typeof val !== 'object') return val; if (cache.has(val)) return '[Circular]'; cache.add(val); return val; } } function stringify(input) { return JSON.stringify(input, circular(), 2).replace(/"\[__NAN__\]"/g, 'NaN').replace(/"\[__VOID__\]"/g, 'undefined'); } function compare(input, expect) { if (Array.isArray(expect) && Array.isArray(input)) return arrays(input, expect); if (expect instanceof RegExp) return chars(''+input, ''+expect); let isA = input && typeof input == 'object'; let isB = expect && typeof expect == 'object'; if (isA && isB) input = sort(input, expect); if (isB) expect = stringify(expect); if (isA) input = stringify(input); if (expect && typeof expect == 'object') { input = stringify(sort(input, expect)); expect = stringify(expect); } isA = typeof input == 'string'; isB = typeof expect == 'string'; if (isA && /\r?\n/.test(input)) return lines(input, ''+expect); if (isB && /\r?\n/.test(expect)) return lines(''+input, expect); if (isA && isB) return chars(input, expect); return direct(input, expect); } /***/ }), /***/ "../node_modules/uvu/node_modules/kleur/index.mjs": /*!********************************************************!*\ !*** ../node_modules/uvu/node_modules/kleur/index.mjs ***! \********************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); let FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, isTTY=true; if (typeof process !== 'undefined') { ({ FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM } = process.env || {}); isTTY = process.stdout && process.stdout.isTTY; } const $ = { enabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== 'dumb' && ( FORCE_COLOR != null && FORCE_COLOR !== '0' || isTTY ), // modifiers reset: init(0, 0), bold: init(1, 22), dim: init(2, 22), italic: init(3, 23), underline: init(4, 24), inverse: init(7, 27), hidden: init(8, 28), strikethrough: init(9, 29), // colors black: init(30, 39), red: init(31, 39), green: init(32, 39), yellow: init(33, 39), blue: init(34, 39), magenta: init(35, 39), cyan: init(36, 39), white: init(37, 39), gray: init(90, 39), grey: init(90, 39), // background colors bgBlack: init(40, 49), bgRed: init(41, 49), bgGreen: init(42, 49), bgYellow: init(43, 49), bgBlue: init(44, 49), bgMagenta: init(45, 49), bgCyan: init(46, 49), bgWhite: init(47, 49) }; function run(arr, str) { let i=0, tmp, beg='', end=''; for (; i < arr.length; i++) { tmp = arr[i]; beg += tmp.open; end += tmp.close; if (!!~str.indexOf(tmp.close)) { str = str.replace(tmp.rgx, tmp.close + tmp.open); } } return beg + str + end; } function chain(has, keys) { let ctx = { has, keys }; ctx.reset = $.reset.bind(ctx); ctx.bold = $.bold.bind(ctx); ctx.dim = $.dim.bind(ctx); ctx.italic = $.italic.bind(ctx); ctx.underline = $.underline.bind(ctx); ctx.inverse = $.inverse.bind(ctx); ctx.hidden = $.hidden.bind(ctx); ctx.strikethrough = $.strikethrough.bind(ctx); ctx.black = $.black.bind(ctx); ctx.red = $.red.bind(ctx); ctx.green = $.green.bind(ctx); ctx.yellow = $.yellow.bind(ctx); ctx.blue = $.blue.bind(ctx); ctx.magenta = $.magenta.bind(ctx); ctx.cyan = $.cyan.bind(ctx); ctx.white = $.white.bind(ctx); ctx.gray = $.gray.bind(ctx); ctx.grey = $.grey.bind(ctx); ctx.bgBlack = $.bgBlack.bind(ctx); ctx.bgRed = $.bgRed.bind(ctx); ctx.bgGreen = $.bgGreen.bind(ctx); ctx.bgYellow = $.bgYellow.bind(ctx); ctx.bgBlue = $.bgBlue.bind(ctx); ctx.bgMagenta = $.bgMagenta.bind(ctx); ctx.bgCyan = $.bgCyan.bind(ctx); ctx.bgWhite = $.bgWhite.bind(ctx); return ctx; } function init(open, close) { let blk = { open: `\x1b[${open}m`, close: `\x1b[${close}m`, rgx: new RegExp(`\\x1b\\[${close}m`, 'g') }; return function (txt) { if (this !== void 0 && this.has !== void 0) { !!~this.has.indexOf(open) || (this.has.push(open),this.keys.push(blk)); return txt === void 0 ? this : $.enabled ? run(this.keys, txt+'') : txt+''; } return txt === void 0 ? chain([open], [blk]) : $.enabled ? run([blk], txt+'') : txt+''; }; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ($); /***/ }), /***/ "../node_modules/vfile-message/lib/index.js": /*!**************************************************!*\ !*** ../node_modules/vfile-message/lib/index.js ***! \**************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "VFileMessage": () => (/* binding */ VFileMessage) /* harmony export */ }); /* harmony import */ var unist_util_stringify_position__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! unist-util-stringify-position */ "../node_modules/unist-util-stringify-position/lib/index.js"); /** * @typedef {import('unist').Node} Node * @typedef {import('unist').Position} Position * @typedef {import('unist').Point} Point * @typedef {object & {type: string, position?: Position | undefined}} NodeLike */ /** * Message. */ class VFileMessage extends Error { /** * Create a message for `reason` at `place` from `origin`. * * When an error is passed in as `reason`, the `stack` is copied. * * @param {string | Error | VFileMessage} reason * Reason for message, uses the stack and message of the error if given. * * > 👉 **Note**: you should use markdown. * @param {Node | NodeLike | Position | Point | null | undefined} [place] * Place in file where the message occurred. * @param {string | null | undefined} [origin] * Place in code where the message originates (example: * `'my-package:my-rule'` or `'my-rule'`). * @returns * Instance of `VFileMessage`. */ // To do: next major: expose `undefined` everywhere instead of `null`. constructor(reason, place, origin) { /** @type {[string | null, string | null]} */ const parts = [null, null] /** @type {Position} */ let position = { // @ts-expect-error: we always follows the structure of `position`. start: {line: null, column: null}, // @ts-expect-error: " end: {line: null, column: null} } super() if (typeof place === 'string') { origin = place place = undefined } if (typeof origin === 'string') { const index = origin.indexOf(':') if (index === -1) { parts[1] = origin } else { parts[0] = origin.slice(0, index) parts[1] = origin.slice(index + 1) } } if (place) { // Node. if ('type' in place || 'position' in place) { if (place.position) { // To do: next major: deep clone. // @ts-expect-error: looks like a position. position = place.position } } // Position. else if ('start' in place || 'end' in place) { // @ts-expect-error: looks like a position. // To do: next major: deep clone. position = place } // Point. else if ('line' in place || 'column' in place) { // To do: next major: deep clone. position.start = place } } // Fields from `Error`. /** * Serialized positional info of error. * * On normal errors, this would be something like `ParseError`, buit in * `VFile` messages we use this space to show where an error happened. */ this.name = (0,unist_util_stringify_position__WEBPACK_IMPORTED_MODULE_0__.stringifyPosition)(place) || '1:1' /** * Reason for message. * * @type {string} */ this.message = typeof reason === 'object' ? reason.message : reason /** * Stack of message. * * This is used by normal errors to show where something happened in * programming code, irrelevant for `VFile` messages, * * @type {string} */ this.stack = '' if (typeof reason === 'object' && reason.stack) { this.stack = reason.stack } /** * Reason for message. * * > 👉 **Note**: you should use markdown. * * @type {string} */ this.reason = this.message /* eslint-disable no-unused-expressions */ /** * State of problem. * * * `true` — marks associated file as no longer processable (error) * * `false` — necessitates a (potential) change (warning) * * `null | undefined` — for things that might not need changing (info) * * @type {boolean | null | undefined} */ this.fatal /** * Starting line of error. * * @type {number | null} */ this.line = position.start.line /** * Starting column of error. * * @type {number | null} */ this.column = position.start.column /** * Full unist position. * * @type {Position | null} */ this.position = position /** * Namespace of message (example: `'my-package'`). * * @type {string | null} */ this.source = parts[0] /** * Category of message (example: `'my-rule'`). * * @type {string | null} */ this.ruleId = parts[1] /** * Path of a file (used throughout the `VFile` ecosystem). * * @type {string | null} */ this.file // The following fields are “well known”. // Not standard. // Feel free to add other non-standard fields to your messages. /** * Specify the source value that’s being reported, which is deemed * incorrect. * * @type {string | null} */ this.actual /** * Suggest acceptable values that can be used instead of `actual`. * * @type {Array<string> | null} */ this.expected /** * Link to docs for the message. * * > 👉 **Note**: this must be an absolute URL that can be passed as `x` * > to `new URL(x)`. * * @type {string | null} */ this.url /** * Long form description of the message (you should use markdown). * * @type {string | null} */ this.note /* eslint-enable no-unused-expressions */ } } VFileMessage.prototype.file = '' VFileMessage.prototype.name = '' VFileMessage.prototype.reason = '' VFileMessage.prototype.message = '' VFileMessage.prototype.stack = '' VFileMessage.prototype.fatal = null VFileMessage.prototype.column = null VFileMessage.prototype.line = null VFileMessage.prototype.source = null VFileMessage.prototype.ruleId = null VFileMessage.prototype.position = null /***/ }), /***/ "../node_modules/vfile/lib/index.js": /*!******************************************!*\ !*** ../node_modules/vfile/lib/index.js ***! \******************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "VFile": () => (/* binding */ VFile) /* harmony export */ }); /* harmony import */ var is_buffer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! is-buffer */ "../node_modules/is-buffer/index.js"); /* harmony import */ var vfile_message__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vfile-message */ "../node_modules/vfile-message/lib/index.js"); /* harmony import */ var _minpath_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./minpath.js */ "../node_modules/vfile/lib/minpath.browser.js"); /* harmony import */ var _minproc_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./minproc.js */ "../node_modules/vfile/lib/minproc.browser.js"); /* harmony import */ var _minurl_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./minurl.js */ "../node_modules/vfile/lib/minurl.shared.js"); /* harmony import */ var _minurl_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./minurl.js */ "../node_modules/vfile/lib/minurl.browser.js"); /** * @typedef {import('unist').Node} Node * @typedef {import('unist').Position} Position * @typedef {import('unist').Point} Point * @typedef {import('./minurl.shared.js').URL} URL * @typedef {import('../index.js').Data} Data * @typedef {import('../index.js').Value} Value */ /** * @typedef {Record<string, unknown> & {type: string, position?: Position | undefined}} NodeLike * * @typedef {'ascii' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2' | 'base64' | 'base64url' | 'latin1' | 'binary' | 'hex'} BufferEncoding * Encodings supported by the buffer class. * * This is a copy of the types from Node, copied to prevent Node globals from * being needed. * Copied from: <https://github.com/DefinitelyTyped/DefinitelyTyped/blob/90a4ec8/types/node/buffer.d.ts#L170> * * @typedef {Options | URL | Value | VFile} Compatible * Things that can be passed to the constructor. * * @typedef VFileCoreOptions * Set multiple values. * @property {Value | null | undefined} [value] * Set `value`. * @property {string | null | undefined} [cwd] * Set `cwd`. * @property {Array<string> | null | undefined} [history] * Set `history`. * @property {URL | string | null | undefined} [path] * Set `path`. * @property {string | null | undefined} [basename] * Set `basename`. * @property {string | null | undefined} [stem] * Set `stem`. * @property {string | null | undefined} [extname] * Set `extname`. * @property {string | null | undefined} [dirname] * Set `dirname`. * @property {Data | null | undefined} [data] * Set `data`. * * @typedef Map * Raw source map. * * See: * <https://github.com/mozilla/source-map/blob/58819f0/source-map.d.ts#L15-L23>. * @property {number} version * Which version of the source map spec this map is following. * @property {Array<string>} sources * An array of URLs to the original source files. * @property {Array<string>} names * An array of identifiers which can be referenced by individual mappings. * @property {string | undefined} [sourceRoot] * The URL root from which all sources are relative. * @property {Array<string> | undefined} [sourcesContent] * An array of contents of the original source files. * @property {string} mappings * A string of base64 VLQs which contain the actual mappings. * @property {string} file * The generated file this source map is associated with. * * @typedef {{[key: string]: unknown} & VFileCoreOptions} Options * Configuration. * * A bunch of keys that will be shallow copied over to the new file. * * @typedef {Record<string, unknown>} ReporterSettings * Configuration for reporters. */ /** * @template {ReporterSettings} Settings * Options type. * @callback Reporter * Type for a reporter. * @param {Array<VFile>} files * Files to report. * @param {Settings} options * Configuration. * @returns {string} * Report. */ /** * Order of setting (least specific to most), we need this because otherwise * `{stem: 'a', path: '~/b.js'}` would throw, as a path is needed before a * stem can be set. * * @type {Array<'basename' | 'dirname' | 'extname' | 'history' | 'path' | 'stem'>} */ const order = ['history', 'path', 'basename', 'stem', 'extname', 'dirname'] class VFile { /** * Create a new virtual file. * * `options` is treated as: * * * `string` or `Buffer` — `{value: options}` * * `URL` — `{path: options}` * * `VFile` — shallow copies its data over to the new file * * `object` — all fields are shallow copied over to the new file * * Path related fields are set in the following order (least specific to * most specific): `history`, `path`, `basename`, `stem`, `extname`, * `dirname`. * * You cannot set `dirname` or `extname` without setting either `history`, * `path`, `basename`, or `stem` too. * * @param {Compatible | null | undefined} [value] * File value. * @returns * New instance. */ constructor(value) { /** @type {Options | VFile} */ let options if (!value) { options = {} } else if (typeof value === 'string' || buffer(value)) { options = {value} } else if ((0,_minurl_js__WEBPACK_IMPORTED_MODULE_1__.isUrl)(value)) { options = {path: value} } else { options = value } /** * Place to store custom information (default: `{}`). * * It’s OK to store custom data directly on the file but moving it to * `data` is recommended. * * @type {Data} */ this.data = {} /** * List of messages associated with the file. * * @type {Array<VFileMessage>} */ this.messages = [] /** * List of filepaths the file moved between. * * The first is the original path and the last is the current path. * * @type {Array<string>} */ this.history = [] /** * Base of `path` (default: `process.cwd()` or `'/'` in browsers). * * @type {string} */ this.cwd = _minproc_js__WEBPACK_IMPORTED_MODULE_2__.proc.cwd() /* eslint-disable no-unused-expressions */ /** * Raw value. * * @type {Value} */ this.value // The below are non-standard, they are “well-known”. // As in, used in several tools. /** * Whether a file was saved to disk. * * This is used by vfile reporters. * * @type {boolean} */ this.stored /** * Custom, non-string, compiled, representation. * * This is used by unified to store non-string results. * One example is when turning markdown into React nodes. * * @type {unknown} */ this.result /** * Source map. * * This type is equivalent to the `RawSourceMap` type from the `source-map` * module. * * @type {Map | null | undefined} */ this.map /* eslint-enable no-unused-expressions */ // Set path related properties in the correct order. let index = -1 while (++index < order.length) { const prop = order[index] // Note: we specifically use `in` instead of `hasOwnProperty` to accept // `vfile`s too. if ( prop in options && options[prop] !== undefined && options[prop] !== null ) { // @ts-expect-error: TS doesn’t understand basic reality. this[prop] = prop === 'history' ? [...options[prop]] : options[prop] } } /** @type {string} */ let prop // Set non-path related properties. for (prop in options) { // @ts-expect-error: fine to set other things. if (!order.includes(prop)) { // @ts-expect-error: fine to set other things. this[prop] = options[prop] } } } /** * Get the full path (example: `'~/index.min.js'`). * * @returns {string} */ get path() { return this.history[this.history.length - 1] } /** * Set the full path (example: `'~/index.min.js'`). * * Cannot be nullified. * You can set a file URL (a `URL` object with a `file:` protocol) which will * be turned into a path with `url.fileURLToPath`. * * @param {string | URL} path */ set path(path) { if ((0,_minurl_js__WEBPACK_IMPORTED_MODULE_1__.isUrl)(path)) { path = (0,_minurl_js__WEBPACK_IMPORTED_MODULE_3__.urlToPath)(path) } assertNonEmpty(path, 'path') if (this.path !== path) { this.history.push(path) } } /** * Get the parent path (example: `'~'`). */ get dirname() { return typeof this.path === 'string' ? _minpath_js__WEBPACK_IMPORTED_MODULE_4__.path.dirname(this.path) : undefined } /** * Set the parent path (example: `'~'`). * * Cannot be set if there’s no `path` yet. */ set dirname(dirname) { assertPath(this.basename, 'dirname') this.path = _minpath_js__WEBPACK_IMPORTED_MODULE_4__.path.join(dirname || '', this.basename) } /** * Get the basename (including extname) (example: `'index.min.js'`). */ get basename() { return typeof this.path === 'string' ? _minpath_js__WEBPACK_IMPORTED_MODULE_4__.path.basename(this.path) : undefined } /** * Set basename (including extname) (`'index.min.js'`). * * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'` * on windows). * Cannot be nullified (use `file.path = file.dirname` instead). */ set basename(basename) { assertNonEmpty(basename, 'basename') assertPart(basename, 'basename') this.path = _minpath_js__WEBPACK_IMPORTED_MODULE_4__.path.join(this.dirname || '', basename) } /** * Get the extname (including dot) (example: `'.js'`). */ get extname() { return typeof this.path === 'string' ? _minpath_js__WEBPACK_IMPORTED_MODULE_4__.path.extname(this.path) : undefined } /** * Set the extname (including dot) (example: `'.js'`). * * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'` * on windows). * Cannot be set if there’s no `path` yet. */ set extname(extname) { assertPart(extname, 'extname') assertPath(this.dirname, 'extname') if (extname) { if (extname.charCodeAt(0) !== 46 /* `.` */) { throw new Error('`extname` must start with `.`') } if (extname.includes('.', 1)) { throw new Error('`extname` cannot contain multiple dots') } } this.path = _minpath_js__WEBPACK_IMPORTED_MODULE_4__.path.join(this.dirname, this.stem + (extname || '')) } /** * Get the stem (basename w/o extname) (example: `'index.min'`). */ get stem() { return typeof this.path === 'string' ? _minpath_js__WEBPACK_IMPORTED_MODULE_4__.path.basename(this.path, this.extname) : undefined } /** * Set the stem (basename w/o extname) (example: `'index.min'`). * * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'` * on windows). * Cannot be nullified (use `file.path = file.dirname` instead). */ set stem(stem) { assertNonEmpty(stem, 'stem') assertPart(stem, 'stem') this.path = _minpath_js__WEBPACK_IMPORTED_MODULE_4__.path.join(this.dirname || '', stem + (this.extname || '')) } /** * Serialize the file. * * @param {BufferEncoding | null | undefined} [encoding='utf8'] * Character encoding to understand `value` as when it’s a `Buffer` * (default: `'utf8'`). * @returns {string} * Serialized file. */ toString(encoding) { return (this.value || '').toString(encoding || undefined) } /** * Create a warning message associated with the file. * * Its `fatal` is set to `false` and `file` is set to the current file path. * Its added to `file.messages`. * * @param {string | Error | VFileMessage} reason * Reason for message, uses the stack and message of the error if given. * @param {Node | NodeLike | Position | Point | null | undefined} [place] * Place in file where the message occurred. * @param {string | null | undefined} [origin] * Place in code where the message originates (example: * `'my-package:my-rule'` or `'my-rule'`). * @returns {VFileMessage} * Message. */ message(reason, place, origin) { const message = new vfile_message__WEBPACK_IMPORTED_MODULE_5__.VFileMessage(reason, place, origin) if (this.path) { message.name = this.path + ':' + message.name message.file = this.path } message.fatal = false this.messages.push(message) return message } /** * Create an info message associated with the file. * * Its `fatal` is set to `null` and `file` is set to the current file path. * Its added to `file.messages`. * * @param {string | Error | VFileMessage} reason * Reason for message, uses the stack and message of the error if given. * @param {Node | NodeLike | Position | Point | null | undefined} [place] * Place in file where the message occurred. * @param {string | null | undefined} [origin] * Place in code where the message originates (example: * `'my-package:my-rule'` or `'my-rule'`). * @returns {VFileMessage} * Message. */ info(reason, place, origin) { const message = this.message(reason, place, origin) message.fatal = null return message } /** * Create a fatal error associated with the file. * * Its `fatal` is set to `true` and `file` is set to the current file path. * Its added to `file.messages`. * * > 👉 **Note**: a fatal error means that a file is no longer processable. * * @param {string | Error | VFileMessage} reason * Reason for message, uses the stack and message of the error if given. * @param {Node | NodeLike | Position | Point | null | undefined} [place] * Place in file where the message occurred. * @param {string | null | undefined} [origin] * Place in code where the message originates (example: * `'my-package:my-rule'` or `'my-rule'`). * @returns {never} * Message. * @throws {VFileMessage} * Message. */ fail(reason, place, origin) { const message = this.message(reason, place, origin) message.fatal = true throw message } } /** * Assert that `part` is not a path (as in, does not contain `path.sep`). * * @param {string | null | undefined} part * File path part. * @param {string} name * Part name. * @returns {void} * Nothing. */ function assertPart(part, name) { if (part && part.includes(_minpath_js__WEBPACK_IMPORTED_MODULE_4__.path.sep)) { throw new Error( '`' + name + '` cannot be a path: did not expect `' + _minpath_js__WEBPACK_IMPORTED_MODULE_4__.path.sep + '`' ) } } /** * Assert that `part` is not empty. * * @param {string | undefined} part * Thing. * @param {string} name * Part name. * @returns {asserts part is string} * Nothing. */ function assertNonEmpty(part, name) { if (!part) { throw new Error('`' + name + '` cannot be empty') } } /** * Assert `path` exists. * * @param {string | undefined} path * Path. * @param {string} name * Dependency name. * @returns {asserts path is string} * Nothing. */ function assertPath(path, name) { if (!path) { throw new Error('Setting `' + name + '` requires `path` to be set too') } } /** * Assert `value` is a buffer. * * @param {unknown} value * thing. * @returns {value is Buffer} * Whether `value` is a Node.js buffer. */ function buffer(value) { return is_buffer__WEBPACK_IMPORTED_MODULE_0__(value) } /***/ }), /***/ "../node_modules/vfile/lib/minpath.browser.js": /*!****************************************************!*\ !*** ../node_modules/vfile/lib/minpath.browser.js ***! \****************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "path": () => (/* binding */ path) /* harmony export */ }); // A derivative work based on: // <https://github.com/browserify/path-browserify>. // Which is licensed: // // MIT License // // Copyright (c) 2013 James Halliday // // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in // the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do so, // subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // A derivative work based on: // // Parts of that are extracted from Node’s internal `path` module: // <https://github.com/nodejs/node/blob/master/lib/path.js>. // Which is licensed: // // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. const path = {basename, dirname, extname, join, sep: '/'} /* eslint-disable max-depth, complexity */ /** * Get the basename from a path. * * @param {string} path * File path. * @param {string | undefined} [ext] * Extension to strip. * @returns {string} * Stem or basename. */ function basename(path, ext) { if (ext !== undefined && typeof ext !== 'string') { throw new TypeError('"ext" argument must be a string') } assertPath(path) let start = 0 let end = -1 let index = path.length /** @type {boolean | undefined} */ let seenNonSlash if (ext === undefined || ext.length === 0 || ext.length > path.length) { while (index--) { if (path.charCodeAt(index) === 47 /* `/` */) { // If we reached a path separator that was not part of a set of path // separators at the end of the string, stop now. if (seenNonSlash) { start = index + 1 break } } else if (end < 0) { // We saw the first non-path separator, mark this as the end of our // path component. seenNonSlash = true end = index + 1 } } return end < 0 ? '' : path.slice(start, end) } if (ext === path) { return '' } let firstNonSlashEnd = -1 let extIndex = ext.length - 1 while (index--) { if (path.charCodeAt(index) === 47 /* `/` */) { // If we reached a path separator that was not part of a set of path // separators at the end of the string, stop now. if (seenNonSlash) { start = index + 1 break } } else { if (firstNonSlashEnd < 0) { // We saw the first non-path separator, remember this index in case // we need it if the extension ends up not matching. seenNonSlash = true firstNonSlashEnd = index + 1 } if (extIndex > -1) { // Try to match the explicit extension. if (path.charCodeAt(index) === ext.charCodeAt(extIndex--)) { if (extIndex < 0) { // We matched the extension, so mark this as the end of our path // component end = index } } else { // Extension does not match, so our result is the entire path // component extIndex = -1 end = firstNonSlashEnd } } } } if (start === end) { end = firstNonSlashEnd } else if (end < 0) { end = path.length } return path.slice(start, end) } /** * Get the dirname from a path. * * @param {string} path * File path. * @returns {string} * File path. */ function dirname(path) { assertPath(path) if (path.length === 0) { return '.' } let end = -1 let index = path.length /** @type {boolean | undefined} */ let unmatchedSlash // Prefix `--` is important to not run on `0`. while (--index) { if (path.charCodeAt(index) === 47 /* `/` */) { if (unmatchedSlash) { end = index break } } else if (!unmatchedSlash) { // We saw the first non-path separator unmatchedSlash = true } } return end < 0 ? path.charCodeAt(0) === 47 /* `/` */ ? '/' : '.' : end === 1 && path.charCodeAt(0) === 47 /* `/` */ ? '//' : path.slice(0, end) } /** * Get an extname from a path. * * @param {string} path * File path. * @returns {string} * Extname. */ function extname(path) { assertPath(path) let index = path.length let end = -1 let startPart = 0 let startDot = -1 // Track the state of characters (if any) we see before our first dot and // after any path separator we find. let preDotState = 0 /** @type {boolean | undefined} */ let unmatchedSlash while (index--) { const code = path.charCodeAt(index) if (code === 47 /* `/` */) { // If we reached a path separator that was not part of a set of path // separators at the end of the string, stop now. if (unmatchedSlash) { startPart = index + 1 break } continue } if (end < 0) { // We saw the first non-path separator, mark this as the end of our // extension. unmatchedSlash = true end = index + 1 } if (code === 46 /* `.` */) { // If this is our first dot, mark it as the start of our extension. if (startDot < 0) { startDot = index } else if (preDotState !== 1) { preDotState = 1 } } else if (startDot > -1) { // We saw a non-dot and non-path separator before our dot, so we should // have a good chance at having a non-empty extension. preDotState = -1 } } if ( startDot < 0 || end < 0 || // We saw a non-dot character immediately before the dot. preDotState === 0 || // The (right-most) trimmed path component is exactly `..`. (preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) ) { return '' } return path.slice(startDot, end) } /** * Join segments from a path. * * @param {Array<string>} segments * Path segments. * @returns {string} * File path. */ function join(...segments) { let index = -1 /** @type {string | undefined} */ let joined while (++index < segments.length) { assertPath(segments[index]) if (segments[index]) { joined = joined === undefined ? segments[index] : joined + '/' + segments[index] } } return joined === undefined ? '.' : normalize(joined) } /** * Normalize a basic file path. * * @param {string} path * File path. * @returns {string} * File path. */ // Note: `normalize` is not exposed as `path.normalize`, so some code is // manually removed from it. function normalize(path) { assertPath(path) const absolute = path.charCodeAt(0) === 47 /* `/` */ // Normalize the path according to POSIX rules. let value = normalizeString(path, !absolute) if (value.length === 0 && !absolute) { value = '.' } if (value.length > 0 && path.charCodeAt(path.length - 1) === 47 /* / */) { value += '/' } return absolute ? '/' + value : value } /** * Resolve `.` and `..` elements in a path with directory names. * * @param {string} path * File path. * @param {boolean} allowAboveRoot * Whether `..` can move above root. * @returns {string} * File path. */ function normalizeString(path, allowAboveRoot) { let result = '' let lastSegmentLength = 0 let lastSlash = -1 let dots = 0 let index = -1 /** @type {number | undefined} */ let code /** @type {number} */ let lastSlashIndex while (++index <= path.length) { if (index < path.length) { code = path.charCodeAt(index) } else if (code === 47 /* `/` */) { break } else { code = 47 /* `/` */ } if (code === 47 /* `/` */) { if (lastSlash === index - 1 || dots === 1) { // Empty. } else if (lastSlash !== index - 1 && dots === 2) { if ( result.length < 2 || lastSegmentLength !== 2 || result.charCodeAt(result.length - 1) !== 46 /* `.` */ || result.charCodeAt(result.length - 2) !== 46 /* `.` */ ) { if (result.length > 2) { lastSlashIndex = result.lastIndexOf('/') if (lastSlashIndex !== result.length - 1) { if (lastSlashIndex < 0) { result = '' lastSegmentLength = 0 } else { result = result.slice(0, lastSlashIndex) lastSegmentLength = result.length - 1 - result.lastIndexOf('/') } lastSlash = index dots = 0 continue } } else if (result.length > 0) { result = '' lastSegmentLength = 0 lastSlash = index dots = 0 continue } } if (allowAboveRoot) { result = result.length > 0 ? result + '/..' : '..' lastSegmentLength = 2 } } else { if (result.length > 0) { result += '/' + path.slice(lastSlash + 1, index) } else { result = path.slice(lastSlash + 1, index) } lastSegmentLength = index - lastSlash - 1 } lastSlash = index dots = 0 } else if (code === 46 /* `.` */ && dots > -1) { dots++ } else { dots = -1 } } return result } /** * Make sure `path` is a string. * * @param {string} path * File path. * @returns {asserts path is string} * Nothing. */ function assertPath(path) { if (typeof path !== 'string') { throw new TypeError( 'Path must be a string. Received ' + JSON.stringify(path) ) } } /* eslint-enable max-depth, complexity */ /***/ }), /***/ "../node_modules/vfile/lib/minproc.browser.js": /*!****************************************************!*\ !*** ../node_modules/vfile/lib/minproc.browser.js ***! \****************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "proc": () => (/* binding */ proc) /* harmony export */ }); // Somewhat based on: // <https://github.com/defunctzombie/node-process/blob/master/browser.js>. // But I don’t think one tiny line of code can be copyrighted. 😅 const proc = {cwd} function cwd() { return '/' } /***/ }), /***/ "../node_modules/vfile/lib/minurl.browser.js": /*!***************************************************!*\ !*** ../node_modules/vfile/lib/minurl.browser.js ***! \***************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "isUrl": () => (/* reexport safe */ _minurl_shared_js__WEBPACK_IMPORTED_MODULE_0__.isUrl), /* harmony export */ "urlToPath": () => (/* binding */ urlToPath) /* harmony export */ }); /* harmony import */ var _minurl_shared_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./minurl.shared.js */ "../node_modules/vfile/lib/minurl.shared.js"); /// <reference lib="dom" /> // See: <https://github.com/nodejs/node/blob/fcf8ba4/lib/internal/url.js> /** * @param {string | URL} path * File URL. * @returns {string} * File URL. */ function urlToPath(path) { if (typeof path === 'string') { path = new URL(path) } else if (!(0,_minurl_shared_js__WEBPACK_IMPORTED_MODULE_0__.isUrl)(path)) { /** @type {NodeJS.ErrnoException} */ const error = new TypeError( 'The "path" argument must be of type string or an instance of URL. Received `' + path + '`' ) error.code = 'ERR_INVALID_ARG_TYPE' throw error } if (path.protocol !== 'file:') { /** @type {NodeJS.ErrnoException} */ const error = new TypeError('The URL must be of scheme file') error.code = 'ERR_INVALID_URL_SCHEME' throw error } return getPathFromURLPosix(path) } /** * Get a path from a POSIX URL. * * @param {URL} url * URL. * @returns {string} * File path. */ function getPathFromURLPosix(url) { if (url.hostname !== '') { /** @type {NodeJS.ErrnoException} */ const error = new TypeError( 'File URL host must be "localhost" or empty on darwin' ) error.code = 'ERR_INVALID_FILE_URL_HOST' throw error } const pathname = url.pathname let index = -1 while (++index < pathname.length) { if ( pathname.charCodeAt(index) === 37 /* `%` */ && pathname.charCodeAt(index + 1) === 50 /* `2` */ ) { const third = pathname.charCodeAt(index + 2) if (third === 70 /* `F` */ || third === 102 /* `f` */) { /** @type {NodeJS.ErrnoException} */ const error = new TypeError( 'File URL path must not include encoded / characters' ) error.code = 'ERR_INVALID_FILE_URL_PATH' throw error } } } return decodeURIComponent(pathname) } /***/ }), /***/ "../node_modules/vfile/lib/minurl.shared.js": /*!**************************************************!*\ !*** ../node_modules/vfile/lib/minurl.shared.js ***! \**************************************************/ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "isUrl": () => (/* binding */ isUrl) /* harmony export */ }); /** * @typedef URL * @property {string} hash * @property {string} host * @property {string} hostname * @property {string} href * @property {string} origin * @property {string} password * @property {string} pathname * @property {string} port * @property {string} protocol * @property {string} search * @property {any} searchParams * @property {string} username * @property {() => string} toString * @property {() => string} toJSON */ /** * Check if `fileUrlOrPath` looks like a URL. * * @param {unknown} fileUrlOrPath * File path or URL. * @returns {fileUrlOrPath is URL} * Whether it’s a URL. */ // From: <https://github.com/nodejs/node/blob/fcf8ba4/lib/internal/url.js#L1501> function isUrl(fileUrlOrPath) { return ( fileUrlOrPath !== null && typeof fileUrlOrPath === 'object' && // @ts-expect-error: indexable. fileUrlOrPath.href && // @ts-expect-error: indexable. fileUrlOrPath.origin ) } /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be in strict mode. (() => { "use strict"; /*!**********************************************!*\ !*** ../modules/ai/assets/js/admin/index.js ***! \**********************************************/ var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); var _app = _interopRequireDefault(__webpack_require__(/*! elementor/modules/ai/assets/js/editor/app */ "../modules/ai/assets/js/editor/app.js")); // Temporary solution for exposing the AI App. window.__UNSTABLE__elementorAI = { App: _app.default }; })(); /******/ })() ; //# sourceMappingURL=ai-admin.js.map