From 095127b1267d20c324755540b712555b4980d6d7 Mon Sep 17 00:00:00 2001 From: Ronald Huereca Date: Sat, 7 Jan 2023 09:57:46 -0600 Subject: [PATCH] Updating build scripts. --- build/wppic-blocks.asset.php | 2 +- build/wppic-blocks.js | 11657 +-------------------------------- build/wppic-blocks.js.map | 1 - dist/wppic-admin.css | 2942 +-------- dist/wppic-admin.css.map | 1 - dist/wppic-editor.css | 253 +- dist/wppic-editor.css.map | 1 - dist/wppic-styles.css | 2544 +------ dist/wppic-styles.css.map | 1 - 9 files changed, 5 insertions(+), 17397 deletions(-) delete mode 100644 build/wppic-blocks.js.map delete mode 100644 dist/wppic-admin.css.map delete mode 100644 dist/wppic-editor.css.map delete mode 100644 dist/wppic-styles.css.map diff --git a/build/wppic-blocks.asset.php b/build/wppic-blocks.asset.php index e96980f..de4015f 100644 --- a/build/wppic-blocks.asset.php +++ b/build/wppic-blocks.asset.php @@ -1 +1 @@ - array('react'), 'version' => '5eb59aec08d8ad340d7a'); + array('react'), 'version' => '25700c06eda26fed0ebf'); diff --git a/build/wppic-blocks.js b/build/wppic-blocks.js index c83a757..5d36bbb 100644 --- a/build/wppic-blocks.js +++ b/build/wppic-blocks.js @@ -1,11656 +1 @@ -/******/ (() => { // webpackBootstrap -/******/ var __webpack_modules__ = ({ - -/***/ "./node_modules/axios/index.js": -/*!*************************************!*\ - !*** ./node_modules/axios/index.js ***! - \*************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -module.exports = __webpack_require__(/*! ./lib/axios */ "./node_modules/axios/lib/axios.js"); - -/***/ }), - -/***/ "./node_modules/axios/lib/adapters/xhr.js": -/*!************************************************!*\ - !*** ./node_modules/axios/lib/adapters/xhr.js ***! - \************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); -var settle = __webpack_require__(/*! ./../core/settle */ "./node_modules/axios/lib/core/settle.js"); -var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./node_modules/axios/lib/helpers/cookies.js"); -var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js"); -var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./node_modules/axios/lib/core/buildFullPath.js"); -var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./node_modules/axios/lib/helpers/parseHeaders.js"); -var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js"); -var createError = __webpack_require__(/*! ../core/createError */ "./node_modules/axios/lib/core/createError.js"); - -module.exports = function xhrAdapter(config) { - return new Promise(function dispatchXhrRequest(resolve, reject) { - var requestData = config.data; - var requestHeaders = config.headers; - var responseType = config.responseType; - - if (utils.isFormData(requestData)) { - delete requestHeaders['Content-Type']; // Let the browser set it - } - - var request = new XMLHttpRequest(); - - // HTTP basic authentication - if (config.auth) { - var username = config.auth.username || ''; - var password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ''; - requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); - } - - var fullPath = buildFullPath(config.baseURL, config.url); - request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); - - // Set the request timeout in MS - request.timeout = config.timeout; - - function onloadend() { - if (!request) { - return; - } - // Prepare the response - var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; - var responseData = !responseType || responseType === 'text' || responseType === 'json' ? - request.responseText : request.response; - var response = { - data: responseData, - status: request.status, - statusText: request.statusText, - headers: responseHeaders, - config: config, - request: request - }; - - settle(resolve, reject, response); - - // Clean up request - request = null; - } - - if ('onloadend' in request) { - // Use onloadend if available - request.onloadend = onloadend; - } else { - // Listen for ready state to emulate onloadend - request.onreadystatechange = function handleLoad() { - if (!request || request.readyState !== 4) { - return; - } - - // The request errored out and we didn't get a response, this will be - // handled by onerror instead - // With one exception: request that using file: protocol, most browsers - // will return status as 0 even though it's a successful request - if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { - return; - } - // readystate handler is calling before onerror or ontimeout handlers, - // so we should call onloadend on the next 'tick' - setTimeout(onloadend); - }; - } - - // Handle browser request cancellation (as opposed to a manual cancellation) - request.onabort = function handleAbort() { - if (!request) { - return; - } - - reject(createError('Request aborted', config, 'ECONNABORTED', request)); - - // Clean up request - request = null; - }; - - // Handle low level network errors - request.onerror = function handleError() { - // Real errors are hidden from us by the browser - // onerror should only fire if it's a network error - reject(createError('Network Error', config, null, request)); - - // Clean up request - request = null; - }; - - // Handle timeout - request.ontimeout = function handleTimeout() { - var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded'; - if (config.timeoutErrorMessage) { - timeoutErrorMessage = config.timeoutErrorMessage; - } - reject(createError( - timeoutErrorMessage, - config, - config.transitional && config.transitional.clarifyTimeoutError ? 'ETIMEDOUT' : 'ECONNABORTED', - request)); - - // Clean up request - request = null; - }; - - // Add xsrf header - // This is only done if running in a standard browser environment. - // Specifically not if we're in a web worker, or react-native. - if (utils.isStandardBrowserEnv()) { - // Add xsrf header - var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? - cookies.read(config.xsrfCookieName) : - undefined; - - if (xsrfValue) { - requestHeaders[config.xsrfHeaderName] = xsrfValue; - } - } - - // Add headers to the request - if ('setRequestHeader' in request) { - utils.forEach(requestHeaders, function setRequestHeader(val, key) { - if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { - // Remove Content-Type if data is undefined - delete requestHeaders[key]; - } else { - // Otherwise add header to the request - request.setRequestHeader(key, val); - } - }); - } - - // Add withCredentials to request if needed - if (!utils.isUndefined(config.withCredentials)) { - request.withCredentials = !!config.withCredentials; - } - - // Add responseType to request if needed - if (responseType && responseType !== 'json') { - request.responseType = config.responseType; - } - - // Handle progress if needed - if (typeof config.onDownloadProgress === 'function') { - request.addEventListener('progress', config.onDownloadProgress); - } - - // Not all browsers support upload events - if (typeof config.onUploadProgress === 'function' && request.upload) { - request.upload.addEventListener('progress', config.onUploadProgress); - } - - if (config.cancelToken) { - // Handle cancellation - config.cancelToken.promise.then(function onCanceled(cancel) { - if (!request) { - return; - } - - request.abort(); - reject(cancel); - // Clean up request - request = null; - }); - } - - if (!requestData) { - requestData = null; - } - - // Send the request - request.send(requestData); - }); -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/axios.js": -/*!*****************************************!*\ - !*** ./node_modules/axios/lib/axios.js ***! - \*****************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js"); -var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js"); -var Axios = __webpack_require__(/*! ./core/Axios */ "./node_modules/axios/lib/core/Axios.js"); -var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js"); -var defaults = __webpack_require__(/*! ./defaults */ "./node_modules/axios/lib/defaults.js"); - -/** - * Create an instance of Axios - * - * @param {Object} defaultConfig The default config for the instance - * @return {Axios} A new instance of Axios - */ -function createInstance(defaultConfig) { - var context = new Axios(defaultConfig); - var instance = bind(Axios.prototype.request, context); - - // Copy axios.prototype to instance - utils.extend(instance, Axios.prototype, context); - - // Copy context to instance - utils.extend(instance, context); - - return instance; -} - -// Create the default instance to be exported -var axios = createInstance(defaults); - -// Expose Axios class to allow class inheritance -axios.Axios = Axios; - -// Factory for creating new instances -axios.create = function create(instanceConfig) { - return createInstance(mergeConfig(axios.defaults, instanceConfig)); -}; - -// Expose Cancel & CancelToken -axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js"); -axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./node_modules/axios/lib/cancel/CancelToken.js"); -axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js"); - -// Expose all/spread -axios.all = function all(promises) { - return Promise.all(promises); -}; -axios.spread = __webpack_require__(/*! ./helpers/spread */ "./node_modules/axios/lib/helpers/spread.js"); - -// Expose isAxiosError -axios.isAxiosError = __webpack_require__(/*! ./helpers/isAxiosError */ "./node_modules/axios/lib/helpers/isAxiosError.js"); - -module.exports = axios; - -// Allow use of default import syntax in TypeScript -module.exports["default"] = axios; - - -/***/ }), - -/***/ "./node_modules/axios/lib/cancel/Cancel.js": -/*!*************************************************!*\ - !*** ./node_modules/axios/lib/cancel/Cancel.js ***! - \*************************************************/ -/***/ ((module) => { - -"use strict"; - - -/** - * A `Cancel` is an object that is thrown when an operation is canceled. - * - * @class - * @param {string=} message The message. - */ -function Cancel(message) { - this.message = message; -} - -Cancel.prototype.toString = function toString() { - return 'Cancel' + (this.message ? ': ' + this.message : ''); -}; - -Cancel.prototype.__CANCEL__ = true; - -module.exports = Cancel; - - -/***/ }), - -/***/ "./node_modules/axios/lib/cancel/CancelToken.js": -/*!******************************************************!*\ - !*** ./node_modules/axios/lib/cancel/CancelToken.js ***! - \******************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var Cancel = __webpack_require__(/*! ./Cancel */ "./node_modules/axios/lib/cancel/Cancel.js"); - -/** - * A `CancelToken` is an object that can be used to request cancellation of an operation. - * - * @class - * @param {Function} executor The executor function. - */ -function CancelToken(executor) { - if (typeof executor !== 'function') { - throw new TypeError('executor must be a function.'); - } - - var resolvePromise; - this.promise = new Promise(function promiseExecutor(resolve) { - resolvePromise = resolve; - }); - - var token = this; - executor(function cancel(message) { - if (token.reason) { - // Cancellation has already been requested - return; - } - - token.reason = new Cancel(message); - resolvePromise(token.reason); - }); -} - -/** - * Throws a `Cancel` if cancellation has been requested. - */ -CancelToken.prototype.throwIfRequested = function throwIfRequested() { - if (this.reason) { - throw this.reason; - } -}; - -/** - * Returns an object that contains a new `CancelToken` and a function that, when called, - * cancels the `CancelToken`. - */ -CancelToken.source = function source() { - var cancel; - var token = new CancelToken(function executor(c) { - cancel = c; - }); - return { - token: token, - cancel: cancel - }; -}; - -module.exports = CancelToken; - - -/***/ }), - -/***/ "./node_modules/axios/lib/cancel/isCancel.js": -/*!***************************************************!*\ - !*** ./node_modules/axios/lib/cancel/isCancel.js ***! - \***************************************************/ -/***/ ((module) => { - -"use strict"; - - -module.exports = function isCancel(value) { - return !!(value && value.__CANCEL__); -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/core/Axios.js": -/*!**********************************************!*\ - !*** ./node_modules/axios/lib/core/Axios.js ***! - \**********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); -var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js"); -var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./node_modules/axios/lib/core/InterceptorManager.js"); -var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./node_modules/axios/lib/core/dispatchRequest.js"); -var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js"); -var validator = __webpack_require__(/*! ../helpers/validator */ "./node_modules/axios/lib/helpers/validator.js"); - -var validators = validator.validators; -/** - * Create a new instance of Axios - * - * @param {Object} instanceConfig The default config for the instance - */ -function Axios(instanceConfig) { - this.defaults = instanceConfig; - this.interceptors = { - request: new InterceptorManager(), - response: new InterceptorManager() - }; -} - -/** - * Dispatch a request - * - * @param {Object} config The config specific for this request (merged with this.defaults) - */ -Axios.prototype.request = function request(config) { - /*eslint no-param-reassign:0*/ - // Allow for axios('example/url'[, config]) a la fetch API - if (typeof config === 'string') { - config = arguments[1] || {}; - config.url = arguments[0]; - } else { - config = config || {}; - } - - config = mergeConfig(this.defaults, config); - - // Set config.method - if (config.method) { - config.method = config.method.toLowerCase(); - } else if (this.defaults.method) { - config.method = this.defaults.method.toLowerCase(); - } else { - config.method = 'get'; - } - - var transitional = config.transitional; - - if (transitional !== undefined) { - validator.assertOptions(transitional, { - silentJSONParsing: validators.transitional(validators.boolean, '1.0.0'), - forcedJSONParsing: validators.transitional(validators.boolean, '1.0.0'), - clarifyTimeoutError: validators.transitional(validators.boolean, '1.0.0') - }, false); - } - - // filter out skipped interceptors - var requestInterceptorChain = []; - var synchronousRequestInterceptors = true; - this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { - if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) { - return; - } - - synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous; - - requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected); - }); - - var responseInterceptorChain = []; - this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { - responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); - }); - - var promise; - - if (!synchronousRequestInterceptors) { - var chain = [dispatchRequest, undefined]; - - Array.prototype.unshift.apply(chain, requestInterceptorChain); - chain = chain.concat(responseInterceptorChain); - - promise = Promise.resolve(config); - while (chain.length) { - promise = promise.then(chain.shift(), chain.shift()); - } - - return promise; - } - - - var newConfig = config; - while (requestInterceptorChain.length) { - var onFulfilled = requestInterceptorChain.shift(); - var onRejected = requestInterceptorChain.shift(); - try { - newConfig = onFulfilled(newConfig); - } catch (error) { - onRejected(error); - break; - } - } - - try { - promise = dispatchRequest(newConfig); - } catch (error) { - return Promise.reject(error); - } - - while (responseInterceptorChain.length) { - promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift()); - } - - return promise; -}; - -Axios.prototype.getUri = function getUri(config) { - config = mergeConfig(this.defaults, config); - return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); -}; - -// Provide aliases for supported request methods -utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { - /*eslint func-names:0*/ - Axios.prototype[method] = function(url, config) { - return this.request(mergeConfig(config || {}, { - method: method, - url: url, - data: (config || {}).data - })); - }; -}); - -utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { - /*eslint func-names:0*/ - Axios.prototype[method] = function(url, data, config) { - return this.request(mergeConfig(config || {}, { - method: method, - url: url, - data: data - })); - }; -}); - -module.exports = Axios; - - -/***/ }), - -/***/ "./node_modules/axios/lib/core/InterceptorManager.js": -/*!***********************************************************!*\ - !*** ./node_modules/axios/lib/core/InterceptorManager.js ***! - \***********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); - -function InterceptorManager() { - this.handlers = []; -} - -/** - * Add a new interceptor to the stack - * - * @param {Function} fulfilled The function to handle `then` for a `Promise` - * @param {Function} rejected The function to handle `reject` for a `Promise` - * - * @return {Number} An ID used to remove interceptor later - */ -InterceptorManager.prototype.use = function use(fulfilled, rejected, options) { - this.handlers.push({ - fulfilled: fulfilled, - rejected: rejected, - synchronous: options ? options.synchronous : false, - runWhen: options ? options.runWhen : null - }); - return this.handlers.length - 1; -}; - -/** - * Remove an interceptor from the stack - * - * @param {Number} id The ID that was returned by `use` - */ -InterceptorManager.prototype.eject = function eject(id) { - if (this.handlers[id]) { - this.handlers[id] = null; - } -}; - -/** - * Iterate over all the registered interceptors - * - * This method is particularly useful for skipping over any - * interceptors that may have become `null` calling `eject`. - * - * @param {Function} fn The function to call for each interceptor - */ -InterceptorManager.prototype.forEach = function forEach(fn) { - utils.forEach(this.handlers, function forEachHandler(h) { - if (h !== null) { - fn(h); - } - }); -}; - -module.exports = InterceptorManager; - - -/***/ }), - -/***/ "./node_modules/axios/lib/core/buildFullPath.js": -/*!******************************************************!*\ - !*** ./node_modules/axios/lib/core/buildFullPath.js ***! - \******************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js"); -var combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ "./node_modules/axios/lib/helpers/combineURLs.js"); - -/** - * Creates a new URL by combining the baseURL with the requestedURL, - * only when the requestedURL is not already an absolute URL. - * If the requestURL is absolute, this function returns the requestedURL untouched. - * - * @param {string} baseURL The base URL - * @param {string} requestedURL Absolute or relative URL to combine - * @returns {string} The combined full path - */ -module.exports = function buildFullPath(baseURL, requestedURL) { - if (baseURL && !isAbsoluteURL(requestedURL)) { - return combineURLs(baseURL, requestedURL); - } - return requestedURL; -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/core/createError.js": -/*!****************************************************!*\ - !*** ./node_modules/axios/lib/core/createError.js ***! - \****************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var enhanceError = __webpack_require__(/*! ./enhanceError */ "./node_modules/axios/lib/core/enhanceError.js"); - -/** - * Create an Error with the specified message, config, error code, request and response. - * - * @param {string} message The error message. - * @param {Object} config The config. - * @param {string} [code] The error code (for example, 'ECONNABORTED'). - * @param {Object} [request] The request. - * @param {Object} [response] The response. - * @returns {Error} The created error. - */ -module.exports = function createError(message, config, code, request, response) { - var error = new Error(message); - return enhanceError(error, config, code, request, response); -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/core/dispatchRequest.js": -/*!********************************************************!*\ - !*** ./node_modules/axios/lib/core/dispatchRequest.js ***! - \********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); -var transformData = __webpack_require__(/*! ./transformData */ "./node_modules/axios/lib/core/transformData.js"); -var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js"); -var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults.js"); - -/** - * Throws a `Cancel` if cancellation has been requested. - */ -function throwIfCancellationRequested(config) { - if (config.cancelToken) { - config.cancelToken.throwIfRequested(); - } -} - -/** - * Dispatch a request to the server using the configured adapter. - * - * @param {object} config The config that is to be used for the request - * @returns {Promise} The Promise to be fulfilled - */ -module.exports = function dispatchRequest(config) { - throwIfCancellationRequested(config); - - // Ensure headers exist - config.headers = config.headers || {}; - - // Transform request data - config.data = transformData.call( - config, - config.data, - config.headers, - config.transformRequest - ); - - // Flatten headers - config.headers = utils.merge( - config.headers.common || {}, - config.headers[config.method] || {}, - config.headers - ); - - utils.forEach( - ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], - function cleanHeaderConfig(method) { - delete config.headers[method]; - } - ); - - var adapter = config.adapter || defaults.adapter; - - return adapter(config).then(function onAdapterResolution(response) { - throwIfCancellationRequested(config); - - // Transform response data - response.data = transformData.call( - config, - response.data, - response.headers, - config.transformResponse - ); - - return response; - }, function onAdapterRejection(reason) { - if (!isCancel(reason)) { - throwIfCancellationRequested(config); - - // Transform response data - if (reason && reason.response) { - reason.response.data = transformData.call( - config, - reason.response.data, - reason.response.headers, - config.transformResponse - ); - } - } - - return Promise.reject(reason); - }); -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/core/enhanceError.js": -/*!*****************************************************!*\ - !*** ./node_modules/axios/lib/core/enhanceError.js ***! - \*****************************************************/ -/***/ ((module) => { - -"use strict"; - - -/** - * Update an Error with the specified config, error code, and response. - * - * @param {Error} error The error to update. - * @param {Object} config The config. - * @param {string} [code] The error code (for example, 'ECONNABORTED'). - * @param {Object} [request] The request. - * @param {Object} [response] The response. - * @returns {Error} The error. - */ -module.exports = function enhanceError(error, config, code, request, response) { - error.config = config; - if (code) { - error.code = code; - } - - error.request = request; - error.response = response; - error.isAxiosError = true; - - error.toJSON = function toJSON() { - return { - // Standard - message: this.message, - name: this.name, - // Microsoft - description: this.description, - number: this.number, - // Mozilla - fileName: this.fileName, - lineNumber: this.lineNumber, - columnNumber: this.columnNumber, - stack: this.stack, - // Axios - config: this.config, - code: this.code - }; - }; - return error; -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/core/mergeConfig.js": -/*!****************************************************!*\ - !*** ./node_modules/axios/lib/core/mergeConfig.js ***! - \****************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js"); - -/** - * Config-specific merge-function which creates a new config-object - * by merging two configuration objects together. - * - * @param {Object} config1 - * @param {Object} config2 - * @returns {Object} New object resulting from merging config2 to config1 - */ -module.exports = function mergeConfig(config1, config2) { - // eslint-disable-next-line no-param-reassign - config2 = config2 || {}; - var config = {}; - - var valueFromConfig2Keys = ['url', 'method', 'data']; - var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params']; - var defaultToConfig2Keys = [ - 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer', - 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', - 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress', - 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent', - 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding' - ]; - var directMergeKeys = ['validateStatus']; - - function getMergedValue(target, source) { - if (utils.isPlainObject(target) && utils.isPlainObject(source)) { - return utils.merge(target, source); - } else if (utils.isPlainObject(source)) { - return utils.merge({}, source); - } else if (utils.isArray(source)) { - return source.slice(); - } - return source; - } - - function mergeDeepProperties(prop) { - if (!utils.isUndefined(config2[prop])) { - config[prop] = getMergedValue(config1[prop], config2[prop]); - } else if (!utils.isUndefined(config1[prop])) { - config[prop] = getMergedValue(undefined, config1[prop]); - } - } - - utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) { - if (!utils.isUndefined(config2[prop])) { - config[prop] = getMergedValue(undefined, config2[prop]); - } - }); - - utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties); - - utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) { - if (!utils.isUndefined(config2[prop])) { - config[prop] = getMergedValue(undefined, config2[prop]); - } else if (!utils.isUndefined(config1[prop])) { - config[prop] = getMergedValue(undefined, config1[prop]); - } - }); - - utils.forEach(directMergeKeys, function merge(prop) { - if (prop in config2) { - config[prop] = getMergedValue(config1[prop], config2[prop]); - } else if (prop in config1) { - config[prop] = getMergedValue(undefined, config1[prop]); - } - }); - - var axiosKeys = valueFromConfig2Keys - .concat(mergeDeepPropertiesKeys) - .concat(defaultToConfig2Keys) - .concat(directMergeKeys); - - var otherKeys = Object - .keys(config1) - .concat(Object.keys(config2)) - .filter(function filterAxiosKeys(key) { - return axiosKeys.indexOf(key) === -1; - }); - - utils.forEach(otherKeys, mergeDeepProperties); - - return config; -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/core/settle.js": -/*!***********************************************!*\ - !*** ./node_modules/axios/lib/core/settle.js ***! - \***********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var createError = __webpack_require__(/*! ./createError */ "./node_modules/axios/lib/core/createError.js"); - -/** - * Resolve or reject a Promise based on response status. - * - * @param {Function} resolve A function that resolves the promise. - * @param {Function} reject A function that rejects the promise. - * @param {object} response The response. - */ -module.exports = function settle(resolve, reject, response) { - var validateStatus = response.config.validateStatus; - if (!response.status || !validateStatus || validateStatus(response.status)) { - resolve(response); - } else { - reject(createError( - 'Request failed with status code ' + response.status, - response.config, - null, - response.request, - response - )); - } -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/core/transformData.js": -/*!******************************************************!*\ - !*** ./node_modules/axios/lib/core/transformData.js ***! - \******************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); -var defaults = __webpack_require__(/*! ./../defaults */ "./node_modules/axios/lib/defaults.js"); - -/** - * Transform the data for a request or a response - * - * @param {Object|String} data The data to be transformed - * @param {Array} headers The headers for the request or response - * @param {Array|Function} fns A single function or Array of functions - * @returns {*} The resulting transformed data - */ -module.exports = function transformData(data, headers, fns) { - var context = this || defaults; - /*eslint no-param-reassign:0*/ - utils.forEach(fns, function transform(fn) { - data = fn.call(context, data, headers); - }); - - return data; -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/defaults.js": -/*!********************************************!*\ - !*** ./node_modules/axios/lib/defaults.js ***! - \********************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js"); -var normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ "./node_modules/axios/lib/helpers/normalizeHeaderName.js"); -var enhanceError = __webpack_require__(/*! ./core/enhanceError */ "./node_modules/axios/lib/core/enhanceError.js"); - -var DEFAULT_CONTENT_TYPE = { - 'Content-Type': 'application/x-www-form-urlencoded' -}; - -function setContentTypeIfUnset(headers, value) { - if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { - headers['Content-Type'] = value; - } -} - -function getDefaultAdapter() { - var adapter; - if (typeof XMLHttpRequest !== 'undefined') { - // For browsers use XHR adapter - adapter = __webpack_require__(/*! ./adapters/xhr */ "./node_modules/axios/lib/adapters/xhr.js"); - } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { - // For node use HTTP adapter - adapter = __webpack_require__(/*! ./adapters/http */ "./node_modules/axios/lib/adapters/xhr.js"); - } - return adapter; -} - -function stringifySafely(rawValue, parser, encoder) { - if (utils.isString(rawValue)) { - try { - (parser || JSON.parse)(rawValue); - return utils.trim(rawValue); - } catch (e) { - if (e.name !== 'SyntaxError') { - throw e; - } - } - } - - return (encoder || JSON.stringify)(rawValue); -} - -var defaults = { - - transitional: { - silentJSONParsing: true, - forcedJSONParsing: true, - clarifyTimeoutError: false - }, - - adapter: getDefaultAdapter(), - - transformRequest: [function transformRequest(data, headers) { - normalizeHeaderName(headers, 'Accept'); - normalizeHeaderName(headers, 'Content-Type'); - - if (utils.isFormData(data) || - utils.isArrayBuffer(data) || - utils.isBuffer(data) || - utils.isStream(data) || - utils.isFile(data) || - utils.isBlob(data) - ) { - return data; - } - if (utils.isArrayBufferView(data)) { - return data.buffer; - } - if (utils.isURLSearchParams(data)) { - setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); - return data.toString(); - } - if (utils.isObject(data) || (headers && headers['Content-Type'] === 'application/json')) { - setContentTypeIfUnset(headers, 'application/json'); - return stringifySafely(data); - } - return data; - }], - - transformResponse: [function transformResponse(data) { - var transitional = this.transitional; - var silentJSONParsing = transitional && transitional.silentJSONParsing; - var forcedJSONParsing = transitional && transitional.forcedJSONParsing; - var strictJSONParsing = !silentJSONParsing && this.responseType === 'json'; - - if (strictJSONParsing || (forcedJSONParsing && utils.isString(data) && data.length)) { - try { - return JSON.parse(data); - } catch (e) { - if (strictJSONParsing) { - if (e.name === 'SyntaxError') { - throw enhanceError(e, this, 'E_JSON_PARSE'); - } - throw e; - } - } - } - - return data; - }], - - /** - * A timeout in milliseconds to abort a request. If set to 0 (default) a - * timeout is not created. - */ - timeout: 0, - - xsrfCookieName: 'XSRF-TOKEN', - xsrfHeaderName: 'X-XSRF-TOKEN', - - maxContentLength: -1, - maxBodyLength: -1, - - validateStatus: function validateStatus(status) { - return status >= 200 && status < 300; - } -}; - -defaults.headers = { - common: { - 'Accept': 'application/json, text/plain, */*' - } -}; - -utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { - defaults.headers[method] = {}; -}); - -utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { - defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); -}); - -module.exports = defaults; - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/bind.js": -/*!************************************************!*\ - !*** ./node_modules/axios/lib/helpers/bind.js ***! - \************************************************/ -/***/ ((module) => { - -"use strict"; - - -module.exports = function bind(fn, thisArg) { - return function wrap() { - var args = new Array(arguments.length); - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i]; - } - return fn.apply(thisArg, args); - }; -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/buildURL.js": -/*!****************************************************!*\ - !*** ./node_modules/axios/lib/helpers/buildURL.js ***! - \****************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); - -function encode(val) { - return encodeURIComponent(val). - replace(/%3A/gi, ':'). - replace(/%24/g, '$'). - replace(/%2C/gi, ','). - replace(/%20/g, '+'). - replace(/%5B/gi, '['). - replace(/%5D/gi, ']'); -} - -/** - * Build a URL by appending params to the end - * - * @param {string} url The base of the url (e.g., http://www.google.com) - * @param {object} [params] The params to be appended - * @returns {string} The formatted url - */ -module.exports = function buildURL(url, params, paramsSerializer) { - /*eslint no-param-reassign:0*/ - if (!params) { - return url; - } - - var serializedParams; - if (paramsSerializer) { - serializedParams = paramsSerializer(params); - } else if (utils.isURLSearchParams(params)) { - serializedParams = params.toString(); - } else { - var parts = []; - - utils.forEach(params, function serialize(val, key) { - if (val === null || typeof val === 'undefined') { - return; - } - - if (utils.isArray(val)) { - key = key + '[]'; - } else { - val = [val]; - } - - utils.forEach(val, function parseValue(v) { - if (utils.isDate(v)) { - v = v.toISOString(); - } else if (utils.isObject(v)) { - v = JSON.stringify(v); - } - parts.push(encode(key) + '=' + encode(v)); - }); - }); - - serializedParams = parts.join('&'); - } - - if (serializedParams) { - var hashmarkIndex = url.indexOf('#'); - if (hashmarkIndex !== -1) { - url = url.slice(0, hashmarkIndex); - } - - url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; - } - - return url; -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/combineURLs.js": -/*!*******************************************************!*\ - !*** ./node_modules/axios/lib/helpers/combineURLs.js ***! - \*******************************************************/ -/***/ ((module) => { - -"use strict"; - - -/** - * Creates a new URL by combining the specified URLs - * - * @param {string} baseURL The base URL - * @param {string} relativeURL The relative URL - * @returns {string} The combined URL - */ -module.exports = function combineURLs(baseURL, relativeURL) { - return relativeURL - ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') - : baseURL; -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/cookies.js": -/*!***************************************************!*\ - !*** ./node_modules/axios/lib/helpers/cookies.js ***! - \***************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); - -module.exports = ( - utils.isStandardBrowserEnv() ? - - // Standard browser envs support document.cookie - (function standardBrowserEnv() { - return { - write: function write(name, value, expires, path, domain, secure) { - var cookie = []; - cookie.push(name + '=' + encodeURIComponent(value)); - - if (utils.isNumber(expires)) { - cookie.push('expires=' + new Date(expires).toGMTString()); - } - - if (utils.isString(path)) { - cookie.push('path=' + path); - } - - if (utils.isString(domain)) { - cookie.push('domain=' + domain); - } - - if (secure === true) { - cookie.push('secure'); - } - - document.cookie = cookie.join('; '); - }, - - read: function read(name) { - var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); - return (match ? decodeURIComponent(match[3]) : null); - }, - - remove: function remove(name) { - this.write(name, '', Date.now() - 86400000); - } - }; - })() : - - // Non standard browser env (web workers, react-native) lack needed support. - (function nonStandardBrowserEnv() { - return { - write: function write() {}, - read: function read() { return null; }, - remove: function remove() {} - }; - })() -); - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js": -/*!*********************************************************!*\ - !*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***! - \*********************************************************/ -/***/ ((module) => { - -"use strict"; - - -/** - * Determines whether the specified URL is absolute - * - * @param {string} url The URL to test - * @returns {boolean} True if the specified URL is absolute, otherwise false - */ -module.exports = function isAbsoluteURL(url) { - // A URL is considered absolute if it begins with "://" or "//" (protocol-relative URL). - // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed - // by any combination of letters, digits, plus, period, or hyphen. - return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/isAxiosError.js": -/*!********************************************************!*\ - !*** ./node_modules/axios/lib/helpers/isAxiosError.js ***! - \********************************************************/ -/***/ ((module) => { - -"use strict"; - - -/** - * Determines whether the payload is an error thrown by Axios - * - * @param {*} payload The value to test - * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false - */ -module.exports = function isAxiosError(payload) { - return (typeof payload === 'object') && (payload.isAxiosError === true); -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js": -/*!***********************************************************!*\ - !*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***! - \***********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); - -module.exports = ( - utils.isStandardBrowserEnv() ? - - // Standard browser envs have full support of the APIs needed to test - // whether the request URL is of the same origin as current location. - (function standardBrowserEnv() { - var msie = /(msie|trident)/i.test(navigator.userAgent); - var urlParsingNode = document.createElement('a'); - var originURL; - - /** - * Parse a URL to discover it's components - * - * @param {String} url The URL to be parsed - * @returns {Object} - */ - function resolveURL(url) { - var href = url; - - if (msie) { - // IE needs attribute set twice to normalize properties - urlParsingNode.setAttribute('href', href); - href = urlParsingNode.href; - } - - urlParsingNode.setAttribute('href', href); - - // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils - return { - href: urlParsingNode.href, - protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', - host: urlParsingNode.host, - search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', - hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', - hostname: urlParsingNode.hostname, - port: urlParsingNode.port, - pathname: (urlParsingNode.pathname.charAt(0) === '/') ? - urlParsingNode.pathname : - '/' + urlParsingNode.pathname - }; - } - - originURL = resolveURL(window.location.href); - - /** - * Determine if a URL shares the same origin as the current location - * - * @param {String} requestURL The URL to test - * @returns {boolean} True if URL shares the same origin, otherwise false - */ - return function isURLSameOrigin(requestURL) { - var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; - return (parsed.protocol === originURL.protocol && - parsed.host === originURL.host); - }; - })() : - - // Non standard browser envs (web workers, react-native) lack needed support. - (function nonStandardBrowserEnv() { - return function isURLSameOrigin() { - return true; - }; - })() -); - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/normalizeHeaderName.js": -/*!***************************************************************!*\ - !*** ./node_modules/axios/lib/helpers/normalizeHeaderName.js ***! - \***************************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js"); - -module.exports = function normalizeHeaderName(headers, normalizedName) { - utils.forEach(headers, function processHeader(value, name) { - if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { - headers[normalizedName] = value; - delete headers[name]; - } - }); -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/parseHeaders.js": -/*!********************************************************!*\ - !*** ./node_modules/axios/lib/helpers/parseHeaders.js ***! - \********************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); - -// Headers whose duplicates are ignored by node -// c.f. https://nodejs.org/api/http.html#http_message_headers -var ignoreDuplicateOf = [ - 'age', 'authorization', 'content-length', 'content-type', 'etag', - 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', - 'last-modified', 'location', 'max-forwards', 'proxy-authorization', - 'referer', 'retry-after', 'user-agent' -]; - -/** - * Parse headers into an object - * - * ``` - * Date: Wed, 27 Aug 2014 08:58:49 GMT - * Content-Type: application/json - * Connection: keep-alive - * Transfer-Encoding: chunked - * ``` - * - * @param {String} headers Headers needing to be parsed - * @returns {Object} Headers parsed into an object - */ -module.exports = function parseHeaders(headers) { - var parsed = {}; - var key; - var val; - var i; - - if (!headers) { return parsed; } - - utils.forEach(headers.split('\n'), function parser(line) { - i = line.indexOf(':'); - key = utils.trim(line.substr(0, i)).toLowerCase(); - val = utils.trim(line.substr(i + 1)); - - if (key) { - if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { - return; - } - if (key === 'set-cookie') { - parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); - } else { - parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; - } - } - }); - - return parsed; -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/spread.js": -/*!**************************************************!*\ - !*** ./node_modules/axios/lib/helpers/spread.js ***! - \**************************************************/ -/***/ ((module) => { - -"use strict"; - - -/** - * Syntactic sugar for invoking a function and expanding an array for arguments. - * - * Common use case would be to use `Function.prototype.apply`. - * - * ```js - * function f(x, y, z) {} - * var args = [1, 2, 3]; - * f.apply(null, args); - * ``` - * - * With `spread` this example can be re-written. - * - * ```js - * spread(function(x, y, z) {})([1, 2, 3]); - * ``` - * - * @param {Function} callback - * @returns {Function} - */ -module.exports = function spread(callback) { - return function wrap(arr) { - return callback.apply(null, arr); - }; -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/helpers/validator.js": -/*!*****************************************************!*\ - !*** ./node_modules/axios/lib/helpers/validator.js ***! - \*****************************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var pkg = __webpack_require__(/*! ./../../package.json */ "./node_modules/axios/package.json"); - -var validators = {}; - -// eslint-disable-next-line func-names -['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach(function(type, i) { - validators[type] = function validator(thing) { - return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type; - }; -}); - -var deprecatedWarnings = {}; -var currentVerArr = pkg.version.split('.'); - -/** - * Compare package versions - * @param {string} version - * @param {string?} thanVersion - * @returns {boolean} - */ -function isOlderVersion(version, thanVersion) { - var pkgVersionArr = thanVersion ? thanVersion.split('.') : currentVerArr; - var destVer = version.split('.'); - for (var i = 0; i < 3; i++) { - if (pkgVersionArr[i] > destVer[i]) { - return true; - } else if (pkgVersionArr[i] < destVer[i]) { - return false; - } - } - return false; -} - -/** - * Transitional option validator - * @param {function|boolean?} validator - * @param {string?} version - * @param {string} message - * @returns {function} - */ -validators.transitional = function transitional(validator, version, message) { - var isDeprecated = version && isOlderVersion(version); - - function formatMessage(opt, desc) { - return '[Axios v' + pkg.version + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : ''); - } - - // eslint-disable-next-line func-names - return function(value, opt, opts) { - if (validator === false) { - throw new Error(formatMessage(opt, ' has been removed in ' + version)); - } - - if (isDeprecated && !deprecatedWarnings[opt]) { - deprecatedWarnings[opt] = true; - // eslint-disable-next-line no-console - console.warn( - formatMessage( - opt, - ' has been deprecated since v' + version + ' and will be removed in the near future' - ) - ); - } - - return validator ? validator(value, opt, opts) : true; - }; -}; - -/** - * Assert object's properties type - * @param {object} options - * @param {object} schema - * @param {boolean?} allowUnknown - */ - -function assertOptions(options, schema, allowUnknown) { - if (typeof options !== 'object') { - throw new TypeError('options must be an object'); - } - var keys = Object.keys(options); - var i = keys.length; - while (i-- > 0) { - var opt = keys[i]; - var validator = schema[opt]; - if (validator) { - var value = options[opt]; - var result = value === undefined || validator(value, opt, options); - if (result !== true) { - throw new TypeError('option ' + opt + ' must be ' + result); - } - continue; - } - if (allowUnknown !== true) { - throw Error('Unknown option ' + opt); - } - } -} - -module.exports = { - isOlderVersion: isOlderVersion, - assertOptions: assertOptions, - validators: validators -}; - - -/***/ }), - -/***/ "./node_modules/axios/lib/utils.js": -/*!*****************************************!*\ - !*** ./node_modules/axios/lib/utils.js ***! - \*****************************************/ -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { - -"use strict"; - - -var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js"); - -// utils is a library of generic helper functions non-specific to axios - -var toString = Object.prototype.toString; - -/** - * Determine if a value is an Array - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an Array, otherwise false - */ -function isArray(val) { - return toString.call(val) === '[object Array]'; -} - -/** - * Determine if a value is undefined - * - * @param {Object} val The value to test - * @returns {boolean} True if the value is undefined, otherwise false - */ -function isUndefined(val) { - return typeof val === 'undefined'; -} - -/** - * Determine if a value is a Buffer - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Buffer, otherwise false - */ -function isBuffer(val) { - return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) - && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); -} - -/** - * Determine if a value is an ArrayBuffer - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an ArrayBuffer, otherwise false - */ -function isArrayBuffer(val) { - return toString.call(val) === '[object ArrayBuffer]'; -} - -/** - * Determine if a value is a FormData - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an FormData, otherwise false - */ -function isFormData(val) { - return (typeof FormData !== 'undefined') && (val instanceof FormData); -} - -/** - * Determine if a value is a view on an ArrayBuffer - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false - */ -function isArrayBufferView(val) { - var result; - if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { - result = ArrayBuffer.isView(val); - } else { - result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); - } - return result; -} - -/** - * Determine if a value is a String - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a String, otherwise false - */ -function isString(val) { - return typeof val === 'string'; -} - -/** - * Determine if a value is a Number - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Number, otherwise false - */ -function isNumber(val) { - return typeof val === 'number'; -} - -/** - * Determine if a value is an Object - * - * @param {Object} val The value to test - * @returns {boolean} True if value is an Object, otherwise false - */ -function isObject(val) { - return val !== null && typeof val === 'object'; -} - -/** - * Determine if a value is a plain Object - * - * @param {Object} val The value to test - * @return {boolean} True if value is a plain Object, otherwise false - */ -function isPlainObject(val) { - if (toString.call(val) !== '[object Object]') { - return false; - } - - var prototype = Object.getPrototypeOf(val); - return prototype === null || prototype === Object.prototype; -} - -/** - * Determine if a value is a Date - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Date, otherwise false - */ -function isDate(val) { - return toString.call(val) === '[object Date]'; -} - -/** - * Determine if a value is a File - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a File, otherwise false - */ -function isFile(val) { - return toString.call(val) === '[object File]'; -} - -/** - * Determine if a value is a Blob - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Blob, otherwise false - */ -function isBlob(val) { - return toString.call(val) === '[object Blob]'; -} - -/** - * Determine if a value is a Function - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Function, otherwise false - */ -function isFunction(val) { - return toString.call(val) === '[object Function]'; -} - -/** - * Determine if a value is a Stream - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a Stream, otherwise false - */ -function isStream(val) { - return isObject(val) && isFunction(val.pipe); -} - -/** - * Determine if a value is a URLSearchParams object - * - * @param {Object} val The value to test - * @returns {boolean} True if value is a URLSearchParams object, otherwise false - */ -function isURLSearchParams(val) { - return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; -} - -/** - * Trim excess whitespace off the beginning and end of a string - * - * @param {String} str The String to trim - * @returns {String} The String freed of excess whitespace - */ -function trim(str) { - return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); -} - -/** - * Determine if we're running in a standard browser environment - * - * This allows axios to run in a web worker, and react-native. - * Both environments support XMLHttpRequest, but not fully standard globals. - * - * web workers: - * typeof window -> undefined - * typeof document -> undefined - * - * react-native: - * navigator.product -> 'ReactNative' - * nativescript - * navigator.product -> 'NativeScript' or 'NS' - */ -function isStandardBrowserEnv() { - if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || - navigator.product === 'NativeScript' || - navigator.product === 'NS')) { - return false; - } - return ( - typeof window !== 'undefined' && - typeof document !== 'undefined' - ); -} - -/** - * Iterate over an Array or an Object invoking a function for each item. - * - * If `obj` is an Array callback will be called passing - * the value, index, and complete array for each item. - * - * If 'obj' is an Object callback will be called passing - * the value, key, and complete object for each property. - * - * @param {Object|Array} obj The object to iterate - * @param {Function} fn The callback to invoke for each item - */ -function forEach(obj, fn) { - // Don't bother if no value provided - if (obj === null || typeof obj === 'undefined') { - return; - } - - // Force an array if not already something iterable - if (typeof obj !== 'object') { - /*eslint no-param-reassign:0*/ - obj = [obj]; - } - - if (isArray(obj)) { - // Iterate over array values - for (var i = 0, l = obj.length; i < l; i++) { - fn.call(null, obj[i], i, obj); - } - } else { - // Iterate over object keys - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - fn.call(null, obj[key], key, obj); - } - } - } -} - -/** - * Accepts varargs expecting each argument to be an object, then - * immutably merges the properties of each object and returns result. - * - * When multiple objects contain the same key the later object in - * the arguments list will take precedence. - * - * Example: - * - * ```js - * var result = merge({foo: 123}, {foo: 456}); - * console.log(result.foo); // outputs 456 - * ``` - * - * @param {Object} obj1 Object to merge - * @returns {Object} Result of all merge properties - */ -function merge(/* obj1, obj2, obj3, ... */) { - var result = {}; - function assignValue(val, key) { - if (isPlainObject(result[key]) && isPlainObject(val)) { - result[key] = merge(result[key], val); - } else if (isPlainObject(val)) { - result[key] = merge({}, val); - } else if (isArray(val)) { - result[key] = val.slice(); - } else { - result[key] = val; - } - } - - for (var i = 0, l = arguments.length; i < l; i++) { - forEach(arguments[i], assignValue); - } - return result; -} - -/** - * Extends object a by mutably adding to it the properties of object b. - * - * @param {Object} a The object to be extended - * @param {Object} b The object to copy properties from - * @param {Object} thisArg The object to bind function to - * @return {Object} The resulting value of object a - */ -function extend(a, b, thisArg) { - forEach(b, function assignValue(val, key) { - if (thisArg && typeof val === 'function') { - a[key] = bind(val, thisArg); - } else { - a[key] = val; - } - }); - return a; -} - -/** - * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) - * - * @param {string} content with BOM - * @return {string} content value without BOM - */ -function stripBOM(content) { - if (content.charCodeAt(0) === 0xFEFF) { - content = content.slice(1); - } - return content; -} - -module.exports = { - isArray: isArray, - isArrayBuffer: isArrayBuffer, - isBuffer: isBuffer, - isFormData: isFormData, - isArrayBufferView: isArrayBufferView, - isString: isString, - isNumber: isNumber, - isObject: isObject, - isPlainObject: isPlainObject, - isUndefined: isUndefined, - isDate: isDate, - isFile: isFile, - isBlob: isBlob, - isFunction: isFunction, - isStream: isStream, - isURLSearchParams: isURLSearchParams, - isStandardBrowserEnv: isStandardBrowserEnv, - forEach: forEach, - merge: merge, - extend: extend, - trim: trim, - stripBOM: stripBOM -}; - - -/***/ }), - -/***/ "./src/blocks/Logo.js": -/*!****************************!*\ - !*** ./src/blocks/Logo.js ***! - \****************************/ -/***/ ((__unused_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 */ }); -var Logo = function Logo(a) { - return /*#__PURE__*/React.createElement("svg", { - version: "1.1", - id: "Calque_1", - xmlns: "http://www.w3.org/2000/svg", - x: "0px", - y: "0px", - width: "".concat(a.size, "px"), - height: "".concat(a.size, "px"), - viewBox: "0 0 850.39 850.39", - enableBackground: "new 0 0 850.39 850.39" - }, /*#__PURE__*/React.createElement("path", { - fill: "".concat(a.fill), - d: "M425.195,2C190.366,2,0,191.918,0,426.195C0,660.472,190.366,850.39,425.195,850.39 c234.828,0,425.195-189.918,425.195-424.195C850.39,191.918,660.023,2,425.195,2z M662.409,476.302l-2.624,4.533L559.296,654.451 l78.654,45.525l-228.108,105.9L388.046,555.33l78.653,45.523l69.391-119.887l-239.354-0.303l-94.925-0.337l-28.75-0.032l-0.041-0.07 h0l-24.361-42.303l28.111-48.563l109.635-189.419l-78.653-45.524L435.859,48.514l21.797,250.546l-78.654-45.525l-69.391,119.887 l239.353,0.303l123.676,0.37l16.571,28.772l7.831,13.596L662.409,476.302z" - })); -}; -Logo.defaultProps = { - size: '75', - fill: '#DB3939' -}; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Logo); - -/***/ }), - -/***/ "./src/blocks/PluginInfoCard/block.js": -/*!********************************************!*\ - !*** ./src/blocks/PluginInfoCard/block.js ***! - \********************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./block.json */ "./src/blocks/PluginInfoCard/block.json"); -/* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./edit */ "./src/blocks/PluginInfoCard/edit.js"); - - -// Import main block file. - -var __ = wp.i18n.__; // Import __() from wp.i18n -var registerBlockType = wp.blocks.registerBlockType; // Import registerBlockType() from wp.blocks - -registerBlockType(_block_json__WEBPACK_IMPORTED_MODULE_0__, { - icon: /*#__PURE__*/React.createElement("svg", { - version: "1.1", - id: "Calque_1", - xmlns: "http://www.w3.org/2000/svg", - x: "0px", - y: "0px", - width: "850.39px", - height: "850.39px", - viewBox: "0 0 850.39 850.39", - enableBackground: "new 0 0 850.39 850.39" - }, /*#__PURE__*/React.createElement("path", { - fill: "#DB3939", - d: "M425.195,2C190.366,2,0,191.918,0,426.195C0,660.472,190.366,850.39,425.195,850.39\nc234.828,0,425.195-189.918,425.195-424.195C850.39,191.918,660.023,2,425.195,2z M662.409,476.302l-2.624,4.533L559.296,654.451\nl78.654,45.525l-228.108,105.9L388.046,555.33l78.653,45.523l69.391-119.887l-239.354-0.303l-94.925-0.337l-28.75-0.032l-0.041-0.07\nh0l-24.361-42.303l28.111-48.563l109.635-189.419l-78.653-45.524L435.859,48.514l21.797,250.546l-78.654-45.525l-69.391,119.887\nl239.353,0.303l123.676,0.37l16.571,28.772l7.831,13.596L662.409,476.302z" - })), - edit: _edit__WEBPACK_IMPORTED_MODULE_1__["default"], - // Render via PHP - save: function save() { - return null; - } -}); - -/***/ }), - -/***/ "./src/blocks/PluginInfoCard/edit.js": -/*!*******************************************!*\ - !*** ./src/blocks/PluginInfoCard/edit.js ***! - \*******************************************/ -/***/ ((__unused_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 axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! axios */ "./node_modules/axios/index.js"); -/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _templates_PluginFlex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../templates/PluginFlex */ "./src/blocks/templates/PluginFlex.js"); -/* harmony import */ var _templates_PluginCard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../templates/PluginCard */ "./src/blocks/templates/PluginCard.js"); -/* harmony import */ var _templates_PluginLarge__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../templates/PluginLarge */ "./src/blocks/templates/PluginLarge.js"); -/* harmony import */ var _templates_PluginWordPress__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../templates/PluginWordPress */ "./src/blocks/templates/PluginWordPress.js"); -/* harmony import */ var _templates_ThemeFlex__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../templates/ThemeFlex */ "./src/blocks/templates/ThemeFlex.js"); -/* harmony import */ var _templates_ThemeWordPress__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../templates/ThemeWordPress */ "./src/blocks/templates/ThemeWordPress.js"); -/* harmony import */ var _templates_ThemeLarge__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../templates/ThemeLarge */ "./src/blocks/templates/ThemeLarge.js"); -/* harmony import */ var _templates_ThemeCard__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../templates/ThemeCard */ "./src/blocks/templates/ThemeCard.js"); -/* harmony import */ var _Logo__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../Logo */ "./src/blocks/Logo.js"); -function _slicedToArray(a, b) { return _arrayWithHoles(a) || _iterableToArrayLimit(a, b) || _unsupportedIterableToArray(a, b) || _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(a, b) { if (!a) return; if (typeof a === "string") return _arrayLikeToArray(a, b); var c = Object.prototype.toString.call(a).slice(8, -1); if (c === "Object" && a.constructor) c = a.constructor.name; if (c === "Map" || c === "Set") return Array.from(a); if (c === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)) return _arrayLikeToArray(a, b); } -function _arrayLikeToArray(a, b) { if (b == null || b > a.length) b = a.length; for (var c = 0, d = new Array(b); c < b; c++) d[c] = a[c]; return d; } -function _iterableToArrayLimit(a, b) { var c = null == a ? null : "undefined" != typeof Symbol && a[Symbol.iterator] || a["@@iterator"]; if (null != c) { var d, e, _x, f, g = [], _n = !0, h = !1; try { if (_x = (c = c.call(a)).next, 0 === b) { if (Object(c) !== c) return; _n = !1; } else for (; !(_n = (d = _x.call(c)).done) && (g.push(d.value), g.length !== b); _n = !0); } catch (a) { h = !0, e = a; } finally { try { if (!_n && null != c["return"] && (f = c["return"](), Object(f) !== f)) return; } finally { if (h) throw e; } } return g; } } -function _arrayWithHoles(a) { if (Array.isArray(a)) return a; } -/* eslint-disable react/jsx-key */ -/* eslint-disable no-unused-vars */ -/* eslint-disable no-undef */ -/* eslint-disable camelcase */ -/** - * External dependencies - */ - - - - - - - - - - - -var _wp$element = wp.element, - Fragment = _wp$element.Fragment, - useEffect = _wp$element.useEffect, - useState = _wp$element.useState; -var __ = wp.i18n.__; -var _wp$components = wp.components, - PanelBody = _wp$components.PanelBody, - PanelRow = _wp$components.PanelRow, - SelectControl = _wp$components.SelectControl, - Spinner = _wp$components.Spinner, - TextControl = _wp$components.TextControl, - Toolbar = _wp$components.Toolbar, - ToolbarGroup = _wp$components.ToolbarGroup, - ToolbarButton = _wp$components.ToolbarButton, - ToolbarItem = _wp$components.ToolbarItem, - ToolbarDropdownMenu = _wp$components.ToolbarDropdownMenu, - DropdownMenu = _wp$components.DropdownMenu, - CheckboxControl = _wp$components.CheckboxControl, - TabPanel = _wp$components.TabPanel, - Button = _wp$components.Button, - MenuGroup = _wp$components.MenuGroup, - MenuItemsChoice = _wp$components.MenuItemsChoice, - MenuItem = _wp$components.MenuItem; -var _wp$blockEditor = wp.blockEditor, - InspectorControls = _wp$blockEditor.InspectorControls, - BlockAlignmentToolbar = _wp$blockEditor.BlockAlignmentToolbar, - MediaUpload = _wp$blockEditor.MediaUpload, - BlockControls = _wp$blockEditor.BlockControls, - useBlockProps = _wp$blockEditor.useBlockProps; -var WPPluginInfoCard = function WPPluginInfoCard(a) { - var b = a.attributes, - c = a.setAttributes; - var d = useState(b.type), - e = _slicedToArray(d, 2), - f = e[0], - g = e[1]; - var h = useState(b.slug), - i = _slicedToArray(h, 2), - j = i[0], - k = i[1]; - var l = useState(false), - m = _slicedToArray(l, 2), - n = m[0], - o = m[1]; - var p = useState(false), - q = _slicedToArray(p, 2), - r = q[0], - s = q[1]; - var t = useState(b.image), - u = _slicedToArray(t, 2), - v = u[0], - w = u[1]; - var x = useState(b.containerid), - y = _slicedToArray(x, 2), - z = y[0], - A = y[1]; - var B = useState(b.scheme), - C = _slicedToArray(B, 2), - D = C[0], - E = C[1]; - var F = useState(b.layout), - G = _slicedToArray(F, 2), - H = G[0], - I = G[1]; - var J = useState(true), - K = _slicedToArray(J, 2), - L = K[0], - M = K[1]; - var N = useState(b.preview), - O = _slicedToArray(N, 2), - P = O[0], - Q = O[1]; - var R = useState(b.assetData), - S = _slicedToArray(R, 2), - T = S[0], - U = S[1]; - var V = useState(b.align), - W = _slicedToArray(V, 2), - X = W[0], - Y = W[1]; - var Z = function loadData() { - o(false); - s(true); - var a = wppic.rest_url + 'wppic/v2/get_data'; - axios__WEBPACK_IMPORTED_MODULE_0___default().get(a + "?type=".concat(f, "&slug=").concat(encodeURIComponent(j))).then(function (a) { - // Now Set State - U(a.data.data); - c({ - assetData: a.data.data - }); - s(false); - }); - }; - var $ = function pluginOnClick(a, b) { - Z(); - }; - useEffect(function () { - if (!T || 0 === T.length) { - Z(); - } - w(b.image); - I(b.layout); - o(b.loading); - g(b.type); - k(b.slug); - if (!b.defaultsApplied && 'default' === b.scheme) { - c({ - defaultsApplied: true, - scheme: wppic.default_scheme, - layout: wppic.default_layout - }); - E(wppic.default_scheme); - I(wppic.default_layout); - } - }, []); - var _ = function outputInfoCards(a) { - return a.map(function (a, b) { - return /*#__PURE__*/React.createElement(Fragment, { - key: b - }, 'flex' === H && 'plugin' === f && /*#__PURE__*/React.createElement(_templates_PluginFlex__WEBPACK_IMPORTED_MODULE_2__["default"], { - scheme: D, - image: v, - data: a, - align: X - }), 'card' === H && 'plugin' === f && /*#__PURE__*/React.createElement(_templates_PluginCard__WEBPACK_IMPORTED_MODULE_3__["default"], { - scheme: D, - image: v, - data: a, - align: X - }), 'large' === H && 'plugin' === f && /*#__PURE__*/React.createElement(_templates_PluginLarge__WEBPACK_IMPORTED_MODULE_4__["default"], { - scheme: D, - image: v, - data: a, - align: X - }), 'wordpress' === H && 'plugin' === f && /*#__PURE__*/React.createElement(_templates_PluginWordPress__WEBPACK_IMPORTED_MODULE_5__["default"], { - scheme: D, - image: v, - data: a, - align: X - }), 'flex' === H && 'theme' === f && /*#__PURE__*/React.createElement(_templates_ThemeFlex__WEBPACK_IMPORTED_MODULE_6__["default"], { - scheme: D, - image: v, - data: a, - align: X - }), 'wordpress' === H && 'theme' === f && /*#__PURE__*/React.createElement(_templates_ThemeWordPress__WEBPACK_IMPORTED_MODULE_7__["default"], { - scheme: D, - image: v, - data: a, - align: X - }), 'large' === H && 'theme' === f && /*#__PURE__*/React.createElement(_templates_ThemeLarge__WEBPACK_IMPORTED_MODULE_8__["default"], { - scheme: D, - image: v, - data: a, - align: X - }), 'card' === H && 'theme' === f && /*#__PURE__*/React.createElement(_templates_ThemeCard__WEBPACK_IMPORTED_MODULE_9__["default"], { - scheme: D, - image: v, - data: a, - align: X - })); - }); - }; - var aa = [{ - icon: 'edit', - title: __('Edit and Configure', 'wp-plugin-info-card'), - onClick: function onClick() { - return o(true); - } - }]; - var ba = [{ - value: 'plugin', - label: __('Plugin', 'wp-plugin-info-card') - }, { - value: 'theme', - label: __('Theme', 'wp-plugin-info-card') - }]; - var ca = [{ - value: 'none', - label: __('None', 'wp-plugin-info-card') - }, { - value: 'before', - label: __('Before', 'wp-plugin-info-card') - }, { - value: 'after', - label: __('After', 'wp-plugin-info-card') - }]; - var da = [{ - value: 'false', - label: __('No', 'wp-plugin-info-card') - }, { - value: 'true', - label: __('Yes', 'wp-plugin-info-card') - }]; - var ea = [{ - value: 'default', - label: __('Default', 'wp-plugin-info-card') - }, { - value: 'scheme1', - label: __('Scheme 1', 'wp-plugin-info-card') - }, { - value: 'scheme2', - label: __('Scheme 2', 'wp-plugin-info-card') - }, { - value: 'scheme3', - label: __('Scheme 3', 'wp-plugin-info-card') - }, { - value: 'scheme4', - label: __('Scheme 4', 'wp-plugin-info-card') - }, { - value: 'scheme5', - label: __('Scheme 5', 'wp-plugin-info-card') - }, { - value: 'scheme6', - label: __('Scheme 6', 'wp-plugin-info-card') - }, { - value: 'scheme7', - label: __('Scheme 7', 'wp-plugin-info-card') - }, { - value: 'scheme8', - label: __('Scheme 8', 'wp-plugin-info-card') - }, { - value: 'scheme9', - label: __('Scheme 9', 'wp-plugin-info-card') - }, { - value: 'scheme10', - label: __('Scheme 10', 'wp-plugin-info-card') - }, { - value: 'scheme11', - label: __('Scheme 11', 'wp-plugin-info-card') - }, { - value: 'scheme12', - label: __('Scheme 12', 'wp-plugin-info-card') - }, { - value: 'scheme13', - label: __('Scheme 13', 'wp-plugin-info-card') - }, { - value: 'scheme14', - label: __('Scheme 14', 'wp-plugin-info-card') - }]; - var fa = [{ - value: 'card', - label: __('Card', 'wp-plugin-info-card') - }, { - value: 'large', - label: __('Large', 'wp-plugin-info-card') - }, { - value: 'wordpress', - label: __('WordPress', 'wp-plugin-info-card') - }, { - value: 'flex', - label: __('Flex', 'wp-plugin-info-card') - }]; - var ga = 'card' === H ? 'wp-pic-card' : H; - var ha = r ? 'wp-pic-spin' : ''; - var ia = /*#__PURE__*/React.createElement(InspectorControls, null, /*#__PURE__*/React.createElement(PanelBody, { - title: __('Layout', 'wp-plugin-info-card') - }, /*#__PURE__*/React.createElement(PanelRow, null, /*#__PURE__*/React.createElement(SelectControl, { - label: __('Scheme', 'wp-plugin-info-card'), - options: ea, - value: D, - onChange: function onChange(a) { - c({ - scheme: a - }); - E(a); - } - })), /*#__PURE__*/React.createElement(PanelRow, null, /*#__PURE__*/React.createElement(SelectControl, { - label: __('Layout', 'wp-plugin-info-card'), - options: fa, - value: H, - onChange: function onChange(a) { - if ('flex' === a) { - c({ - layout: a, - align: 'full' - }); - I(a); - Y('full'); - } else { - c({ - layout: a, - align: 'center' - }); - I(a); - Y('center'); - } - } - }))), /*#__PURE__*/React.createElement(PanelBody, { - title: __('Options', 'wp-plugin-info-card'), - initialOpen: false - }, /*#__PURE__*/React.createElement(PanelRow, null, /*#__PURE__*/React.createElement(MediaUpload, { - onSelect: function onSelect(a) { - c({ - image: a.url - }); - w(a.url); - }, - type: "image", - value: v, - render: function render(a) { - var b = a.open; - return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("button", { - className: "components-button is-button", - onClick: b - }, __('Upload Image!', 'wp-plugin-info-card')), v && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("img", { - src: v, - alt: __('Plugin Card Image', 'wp-plugin-info-card'), - width: "250", - height: "250" - })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", { - className: "components-button is-button", - onClick: function onClick(a) { - c({ - image: '' - }); - w(''); - } - }, __('Reset Image', 'wp-plugin-info-card'))))); - } - })), /*#__PURE__*/React.createElement(PanelRow, null, /*#__PURE__*/React.createElement(TextControl, { - label: __('Container ID', 'wp-plugin-info-card'), - type: "text", - value: z, - onChange: function onChange(a) { - c({ - containerid: a - }); - A(a); - } - })))); - var ja = useBlockProps({ - className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("wp-plugin-info-card align".concat(X)) - }); - if (P) { - return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("img", { - src: wppic.wppic_preview, - alt: "", - style: { - width: '100%', - height: 'auto' - } - })); - } - if (r) { - return /*#__PURE__*/React.createElement("div", ja, /*#__PURE__*/React.createElement("div", { - className: "wppic-loading-placeholder" - }, /*#__PURE__*/React.createElement("div", { - className: "wppic-loading" - }, /*#__PURE__*/React.createElement(_Logo__WEBPACK_IMPORTED_MODULE_10__["default"], { - size: "45" - }), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("div", { - className: "wppic-spinner" - }, /*#__PURE__*/React.createElement(Spinner, null))))); - } - var ka = /*#__PURE__*/React.createElement(Fragment, null, n && /*#__PURE__*/React.createElement("div", { - className: "wppic-query-block wppic-query-block-panel" - }, /*#__PURE__*/React.createElement("div", { - className: "wppic-block-svg" - }, /*#__PURE__*/React.createElement(_Logo__WEBPACK_IMPORTED_MODULE_10__["default"], { - size: "75" - })), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-tab-panel" - }, /*#__PURE__*/React.createElement(TabPanel, { - activeClass: "active-tab", - initialTabName: "slug", - tabs: [{ - title: __('Type', 'wp-plugin-info-card'), - name: 'slug', - className: 'wppic-tab-slug' - }, { - title: __('Appearance', 'wp-plugin-info-card'), - name: 'layout', - className: 'wppic-tab-layout' - }] - }, function (a) { - var b; - if ('slug' === a.name) { - b = /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(SelectControl, { - label: __('Select a Plugin or Theme', 'wp-plugin-info-card'), - options: ba, - value: f, - onChange: function onChange(a) { - c({ - type: a - }); - g(a); - } - }), /*#__PURE__*/React.createElement(TextControl, { - label: __('Plugin or Theme Slug', 'wp-plugin-info-card'), - value: j, - onChange: function onChange(a) { - c({ - slug: a - }); - k(a); - }, - help: __('Comma separated slugs are supported.', 'wp-plugin-info-card') - })); - } else if ('layout' === a.name) { - b = /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SelectControl, { - label: __('Select an initial layout', 'wp-plugin-info-card'), - options: fa, - value: H, - onChange: function onChange(a) { - if ('flex' === a) { - c({ - layout: a, - align: 'full' - }); - I(a); - Y('full'); - } else { - c({ - layout: a, - align: 'center' - }); - I(a); - Y('center'); - } - } - }), /*#__PURE__*/React.createElement(SelectControl, { - label: __('Scheme', 'wp-plugin-info-card'), - options: ea, - value: D, - onChange: function onChange(a) { - c({ - scheme: a - }); - E(a); - } - }))); - } else { - b = /*#__PURE__*/React.createElement(Fragment, null, "no data found"); - } - return /*#__PURE__*/React.createElement("div", null, b); - })), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-gutenberg-button" - }, /*#__PURE__*/React.createElement(Button, { - iconSize: 20, - icon: /*#__PURE__*/React.createElement(_Logo__WEBPACK_IMPORTED_MODULE_10__["default"], { - size: "25" - }), - isSecondary: true, - id: "wppic-input-submit", - onClick: function onClick(a) { - a.preventDefault(); - c({ - loading: false - }); - $(a); - } - }, __('Preview and Configure', 'wp-plugin-info-card')))), r && /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", { - className: "wppic-loading-placeholder" - }, /*#__PURE__*/React.createElement("div", { - className: "wppic-loading" - }, /*#__PURE__*/React.createElement(_Logo__WEBPACK_IMPORTED_MODULE_10__["default"], { - size: "45" - }), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("div", { - className: "wppic-spinner" - }, /*#__PURE__*/React.createElement(Spinner, null))))), !n && !r && /*#__PURE__*/React.createElement(Fragment, null, ia, /*#__PURE__*/React.createElement(BlockControls, null, /*#__PURE__*/React.createElement(ToolbarGroup, null, /*#__PURE__*/React.createElement(ToolbarButton, { - icon: "edit", - title: __('Edit and Configure', 'wp-plugin-info-card'), - onClick: function onClick() { - return o(true); - } - })), /*#__PURE__*/React.createElement(ToolbarGroup, null, /*#__PURE__*/React.createElement(ToolbarItem, { - as: "button" - }, function (a) { - return /*#__PURE__*/React.createElement(DropdownMenu, { - toggleProps: a, - label: __('Select Color Scheme', 'wp-plugin-info-card'), - icon: "admin-customizer" - }, function (a) { - var b = a.onClose; - return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(MenuItemsChoice, { - choices: ea, - onSelect: function onSelect(a) { - c({ - scheme: a - }); - E(a); - b(); - }, - value: D - })); - }); - })), /*#__PURE__*/React.createElement(ToolbarGroup, null, /*#__PURE__*/React.createElement(ToolbarItem, { - as: "button" - }, function (a) { - return /*#__PURE__*/React.createElement(DropdownMenu, { - toggleProps: a, - label: __('Select a Layout', 'wp-plugin-info-card'), - icon: "layout" - }, function (a) { - var b = a.onClose; - return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(MenuItemsChoice, { - choices: fa, - onSelect: function onSelect(a) { - c({ - layout: a - }); - I(a); - b(); - }, - value: H - })); - }); - }))), /*#__PURE__*/React.createElement("div", { - className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('is-placeholder', ga, 'wp-block-plugin-info-card', "align".concat(X)) - }, _(T)))); - return /*#__PURE__*/React.createElement("div", ja, ka); -}; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (WPPluginInfoCard); - -/***/ }), - -/***/ "./src/blocks/PluginInfoCardQuery/edit-query.js": -/*!******************************************************!*\ - !*** ./src/blocks/PluginInfoCardQuery/edit-query.js ***! - \******************************************************/ -/***/ ((__unused_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 axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! axios */ "./node_modules/axios/index.js"); -/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var _templates_PluginFlex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../templates/PluginFlex */ "./src/blocks/templates/PluginFlex.js"); -/* harmony import */ var _templates_PluginCard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../templates/PluginCard */ "./src/blocks/templates/PluginCard.js"); -/* harmony import */ var _templates_PluginLarge__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../templates/PluginLarge */ "./src/blocks/templates/PluginLarge.js"); -/* harmony import */ var _templates_PluginWordPress__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../templates/PluginWordPress */ "./src/blocks/templates/PluginWordPress.js"); -/* harmony import */ var _templates_ThemeFlex__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../templates/ThemeFlex */ "./src/blocks/templates/ThemeFlex.js"); -/* harmony import */ var _templates_ThemeWordPress__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../templates/ThemeWordPress */ "./src/blocks/templates/ThemeWordPress.js"); -/* harmony import */ var _templates_ThemeLarge__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../templates/ThemeLarge */ "./src/blocks/templates/ThemeLarge.js"); -/* harmony import */ var _templates_ThemeCard__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../templates/ThemeCard */ "./src/blocks/templates/ThemeCard.js"); -/* harmony import */ var _Logo__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../Logo */ "./src/blocks/Logo.js"); -function _slicedToArray(a, b) { return _arrayWithHoles(a) || _iterableToArrayLimit(a, b) || _unsupportedIterableToArray(a, b) || _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(a, b) { if (!a) return; if (typeof a === "string") return _arrayLikeToArray(a, b); var c = Object.prototype.toString.call(a).slice(8, -1); if (c === "Object" && a.constructor) c = a.constructor.name; if (c === "Map" || c === "Set") return Array.from(a); if (c === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)) return _arrayLikeToArray(a, b); } -function _arrayLikeToArray(a, b) { if (b == null || b > a.length) b = a.length; for (var c = 0, d = new Array(b); c < b; c++) d[c] = a[c]; return d; } -function _iterableToArrayLimit(a, b) { var c = null == a ? null : "undefined" != typeof Symbol && a[Symbol.iterator] || a["@@iterator"]; if (null != c) { var d, e, _x, f, g = [], _n = !0, h = !1; try { if (_x = (c = c.call(a)).next, 0 === b) { if (Object(c) !== c) return; _n = !1; } else for (; !(_n = (d = _x.call(c)).done) && (g.push(d.value), g.length !== b); _n = !0); } catch (a) { h = !0, e = a; } finally { try { if (!_n && null != c["return"] && (f = c["return"](), Object(f) !== f)) return; } finally { if (h) throw e; } } return g; } } -function _arrayWithHoles(a) { if (Array.isArray(a)) return a; } -// @ts-nocheck -/** - * External dependencies - */ - - -var HtmlToReactParser = (__webpack_require__(/*! html-to-react */ "./node_modules/html-to-react/index.js").Parser); -var __ = wp.i18n.__; -var _wp$element = wp.element, - useState = _wp$element.useState, - useEffect = _wp$element.useEffect, - Fragment = _wp$element.Fragment; -var _wp$components = wp.components, - PanelBody = _wp$components.PanelBody, - SelectControl = _wp$components.SelectControl, - Spinner = _wp$components.Spinner, - TextControl = _wp$components.TextControl, - Button = _wp$components.Button, - Toolbar = _wp$components.Toolbar; -var _wp$blockEditor = wp.blockEditor, - InspectorControls = _wp$blockEditor.InspectorControls, - BlockControls = _wp$blockEditor.BlockControls, - MediaUpload = _wp$blockEditor.MediaUpload, - AlignmentToolbar = _wp$blockEditor.AlignmentToolbar, - BlockAlignmentToolbar = _wp$blockEditor.BlockAlignmentToolbar, - useBlockProps = _wp$blockEditor.useBlockProps; - - - - - - - - - -var WP_Plugin_Card_Query = function WP_Plugin_Card_Query(a) { - var b = a.attributes, - c = a.setAttributes; - var d = useState(false), - e = _slicedToArray(d, 2), - f = e[0], - g = e[1]; - var h = useState(false), - i = _slicedToArray(h, 2), - j = i[0], - k = i[1]; - var l = b.assetData, - m = b.type, - n = b.slug, - o = b.html, - p = b.align, - q = b.image, - r = b.containerid, - s = b.margin, - t = b.clear, - u = b.expiration, - v = b.ajax, - w = b.scheme, - x = b.layout, - y = b.width, - z = b.search, - A = b.tag, - B = b.author, - C = b.user, - D = b.browse, - E = b.per_page, - F = b.preview, - G = b.cols, - H = b.sortby, - I = b.sort; - useEffect(function () { - // If we have HTML, then we don't need to load it. - if (!o) { - g(true); - } else { - g(false); - } - - // Apply defaults. - if (!b.defaultsApplied && 'default' === b.scheme) { - c({ - defaultsApplied: true, - scheme: wppic.default_scheme, - layout: wppic.default_layout - }); - } - }, []); - var J = function pluginOnClick(a) { - if ('' !== m) { - k(true); - var d = wppic.rest_url + 'wppic/v1/get_query/'; - axios__WEBPACK_IMPORTED_MODULE_0___default().get(d + "?type=".concat(b.type, "&slug=").concat(b.slug, "&align=").concat(b.align, "&image=").concat(b.image, "&containerid=").concat(b.containerid, "&margin=").concat(b.margin, "&clear=").concat(b.clear, "&expiration=").concat(b.expiration, "&ajax=").concat(b.ajax, "&scheme=").concat(b.scheme, "&layout=").concat(b.layout, "&search=").concat(b.search, "&tag=").concat(b.tag, "&author=").concat(b.author, "&user=").concat(b.user, "&browse=").concat(b.browse, "&per_page=").concat(b.per_page, "&cols=").concat(b.cols, "}&sortby=").concat(b.sortby, "&sort=").concat(b.sort)).then(function (a) { - // Now Set State - g(false); - k(false); - c({ - assetData: a.data.data.api_response - }); - c({ - html: a.data.data.html - }); - }); - } - }; - var K = function outputInfoCards() { - return l.map(function (a, b) { - return /*#__PURE__*/React.createElement(Fragment, { - key: b - }, 'flex' === x && 'plugin' === m && /*#__PURE__*/React.createElement(_templates_PluginFlex__WEBPACK_IMPORTED_MODULE_2__["default"], { - scheme: w, - image: q, - data: a, - align: p - }), 'card' === x && 'plugin' === m && /*#__PURE__*/React.createElement(_templates_PluginCard__WEBPACK_IMPORTED_MODULE_3__["default"], { - scheme: w, - image: q, - data: a, - align: p - }), 'large' === x && 'plugin' === m && /*#__PURE__*/React.createElement(_templates_PluginLarge__WEBPACK_IMPORTED_MODULE_4__["default"], { - scheme: w, - image: q, - data: a, - align: p - }), 'wordpress' === x && 'plugin' === m && /*#__PURE__*/React.createElement(_templates_PluginWordPress__WEBPACK_IMPORTED_MODULE_5__["default"], { - scheme: w, - image: q, - data: a, - align: p - }), 'flex' === x && 'theme' === m && /*#__PURE__*/React.createElement(_templates_ThemeFlex__WEBPACK_IMPORTED_MODULE_6__["default"], { - scheme: w, - image: q, - data: a, - align: p - }), 'wordpress' === x && 'theme' === m && /*#__PURE__*/React.createElement(_templates_ThemeWordPress__WEBPACK_IMPORTED_MODULE_7__["default"], { - scheme: w, - image: q, - data: a, - align: p - }), 'large' === x && 'theme' === m && /*#__PURE__*/React.createElement(_templates_ThemeLarge__WEBPACK_IMPORTED_MODULE_8__["default"], { - scheme: w, - image: q, - data: a, - align: p - }), 'card' === x && 'theme' === m && /*#__PURE__*/React.createElement(_templates_ThemeCard__WEBPACK_IMPORTED_MODULE_9__["default"], { - scheme: w, - image: q, - data: a, - align: p - })); - }); - }; - var L = new HtmlToReactParser(); - var M = [{ - icon: 'edit', - title: __('Reset', 'wp-plugin-info-card'), - onClick: function onClick() { - return g(true); - } - }]; - var N = [{ - value: 'none', - label: __('None', 'wp-plugin-info-card') - }, { - value: 'before', - label: __('Before', 'wp-plugin-info-card') - }, { - value: 'after', - label: __('After', 'wp-plugin-info-card') - }]; - var O = [{ - value: 'false', - label: __('No', 'wp-plugin-info-card') - }, { - value: 'true', - label: __('Yes', 'wp-plugin-info-card') - }]; - var P = [{ - value: 'default', - label: __('Default', 'wp-plugin-info-card') - }, { - value: 'scheme1', - label: __('Scheme 1', 'wp-plugin-info-card') - }, { - value: 'scheme2', - label: __('Scheme 2', 'wp-plugin-info-card') - }, { - value: 'scheme3', - label: __('Scheme 3', 'wp-plugin-info-card') - }, { - value: 'scheme4', - label: __('Scheme 4', 'wp-plugin-info-card') - }, { - value: 'scheme5', - label: __('Scheme 5', 'wp-plugin-info-card') - }, { - value: 'scheme6', - label: __('Scheme 6', 'wp-plugin-info-card') - }, { - value: 'scheme7', - label: __('Scheme 7', 'wp-plugin-info-card') - }, { - value: 'scheme8', - label: __('Scheme 8', 'wp-plugin-info-card') - }, { - value: 'scheme9', - label: __('Scheme 9', 'wp-plugin-info-card') - }, { - value: 'scheme10', - label: __('Scheme 10', 'wp-plugin-info-card') - }, { - value: 'scheme11', - label: __('Scheme 11', 'wp-plugin-info-card') - }, { - value: 'scheme12', - label: __('Scheme 12', 'wp-plugin-info-card') - }, { - value: 'scheme13', - label: __('Scheme 13', 'wp-plugin-info-card') - }, { - value: 'scheme14', - label: __('Scheme 14', 'wp-plugin-info-card') - }]; - var Q = [{ - value: 'card', - label: __('Card', 'wp-plugin-info-card') - }, { - value: 'large', - label: __('Large', 'wp-plugin-info-card') - }, { - value: 'wordpress', - label: __('WordPress', 'wp-plugin-info-card') - }, { - value: 'flex', - label: __('Flex', 'wp-plugin-info-card') - }]; - var R = [{ - value: '', - label: __('None', 'wp-plugin-info-card') - }, { - value: 'url', - label: __('URL', 'wp-plugin-info-card') - }, { - value: 'name', - label: __('Name', 'wp-plugin-info-card') - }, { - value: 'version', - label: __('Version', 'wp-plugin-info-card') - }, { - value: 'author', - label: __('Author', 'wp-plugin-info-card') - }, { - value: 'screenshot_url', - label: __('Screenshot URL', 'wp-plugin-info-card') - }, { - value: 'rating', - label: __('Ratings', 'wp-plugin-info-card') - }, { - value: 'num_ratings', - label: __('Number of Ratings', 'wp-plugin-info-card') - }, { - value: 'active_installs', - label: __('Active Installs', 'wp-plugin-info-card') - }, { - value: 'last_updated', - label: __('Last Updated', 'wp-plugin-info-card') - }, { - value: 'homepage', - label: __('Homepage', 'wp-plugin-info-card') - }, { - value: 'download_link', - label: __('Download Link', 'wp-plugin-info-card') - }]; - var S = [{ - value: 'none', - label: __('Default', 'wp-plugin-info-card') - }, { - value: 'full', - label: __('Full Width', 'wp-plugin-info-card') - }]; - var T = /*#__PURE__*/React.createElement(InspectorControls, null, /*#__PURE__*/React.createElement(PanelBody, { - title: __('WP Plugin Info Card', 'wp-plugin-info-card') - }, /*#__PURE__*/React.createElement(SelectControl, { - label: __('Scheme', 'wp-plugin-info-card'), - options: P, - value: w, - onChange: function onChange(a) { - c({ - scheme: a - }); - } - }), /*#__PURE__*/React.createElement(SelectControl, { - label: __('Layout', 'wp-plugin-info-card'), - options: Q, - value: x, - onChange: function onChange(a) { - c({ - layout: a - }); - } - }), /*#__PURE__*/React.createElement(SelectControl, { - label: __('Width', 'wp-plugin-info-card'), - options: S, - value: y, - onChange: function onChange(a) { - c({ - width: a - }); - } - }), /*#__PURE__*/React.createElement(MediaUpload, { - onSelect: function onSelect(a) { - c({ - image: a.url - }); - b.image = a.url; - J(); - }, - type: "image", - value: q, - render: function render(a) { - var d = a.open; - return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("button", { - className: "components-button is-button", - onClick: d - }, __('Upload Image!', 'wp-plugin-info-card')), q && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("img", { - src: q, - alt: __('Plugin Card Image', 'wp-plugin-info-card'), - width: "250", - height: "250" - })), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("button", { - className: "components-button is-button", - onClick: function onClick(a) { - c({ - image: '' - }); - b.image = ''; - J(); - } - }, __('Reset Image', 'wp-plugin-info-card'))))); - } - }), /*#__PURE__*/React.createElement(TextControl, { - label: __('Container ID', 'wp-plugin-info-card'), - type: "text", - value: r, - onChange: function onChange(a) { - c({ - containerid: a - }); - b.containerId = a; - setTimeout(function () { - J(); - }, 5000); - } - }), /*#__PURE__*/React.createElement(TextControl, { - label: __('Margin', 'wp-plugin-info-card'), - type: "text", - value: s, - onChange: function onChange(a) { - c({ - margin: a - }); - b.margin = a; - setTimeout(function () { - J(); - }, 5000); - } - }), /*#__PURE__*/React.createElement(SelectControl, { - label: __('Clear', 'wp-plugin-info-card'), - options: N, - value: t, - onChange: function onChange(a) { - c({ - clear: a - }); - } - }), /*#__PURE__*/React.createElement(TextControl, { - label: __('Expiration in minutes', 'wp-plugin-info-card'), - type: "number", - value: u, - onChange: function onChange(a) { - c({ - expiration: a - }); - } - }), /*#__PURE__*/React.createElement(SelectControl, { - label: __('Load card via Ajax?', 'wp-plugin-info-card'), - options: O, - value: v, - onChange: function onChange(a) { - c({ - ajax: a - }); - } - }))); - var U = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(React.Fragment, null, f && /*#__PURE__*/React.createElement("div", { - className: "wppic-query-block wppic-query-block-panel" - }, /*#__PURE__*/React.createElement("div", { - className: "wppic-block-svg" - }, /*#__PURE__*/React.createElement(_Logo__WEBPACK_IMPORTED_MODULE_10__["default"], { - size: "75" - })), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-tab-panel" - }, /*#__PURE__*/React.createElement(SelectControl, { - label: __('Select a Type', 'wp-plugin-info-card'), - options: [{ - label: __('Plugin', 'wp-plugin-info-card'), - value: 'plugin' - }, { - label: __('Theme', 'wp-plugin-info-card'), - value: 'theme' - }], - value: m, - onChange: function onChange(a) { - c({ - type: a - }); - } - }), /*#__PURE__*/React.createElement(TextControl, { - label: __('Search', 'wp-plugin-info-card'), - value: z, - onChange: function onChange(a) { - c({ - search: a - }); - } - }), /*#__PURE__*/React.createElement(TextControl, { - label: __('Tags', 'wp-plugin-info-card'), - value: A, - onChange: function onChange(a) { - c({ - tag: a - }); - }, - help: __('Comma separated', 'wp-plugin-info-card') - }), /*#__PURE__*/React.createElement(TextControl, { - label: __('Author', 'wp-plugin-info-card'), - value: B, - onChange: function onChange(a) { - c({ - author: a - }); - } - }), /*#__PURE__*/React.createElement(TextControl, { - label: __('User (Username)', 'wp-plugin-info-card'), - value: C, - onChange: function onChange(a) { - c({ - user: a - }); - }, - help: __('See the favorites from this username', 'wp-plugin-info-card') - }), /*#__PURE__*/React.createElement(SelectControl, { - label: __('Browse', 'wp-plugin-info-card'), - options: [{ - label: __('None', 'wp-plugin-info-card'), - value: '' - }, { - label: __('Featured', 'wp-plugin-info-card'), - value: 'featured' - }, { - label: __('Updated', 'wp-plugin-info-card'), - value: 'updated' - }, { - label: __('Favorites', 'wp-plugin-info-card'), - value: 'favorites' - }, { - label: __('Popular', 'wp-plugin-info-card'), - value: 'popular' - }], - value: D, - onChange: function onChange(a) { - c({ - browse: a - }); - } - }), /*#__PURE__*/React.createElement(TextControl, { - type: "number", - label: __('Per Page', 'wp-plugin-info-card'), - value: E, - onChange: function onChange(a) { - c({ - per_page: a - }); - }, - help: __('Set how many cards to return.', 'wp-plugin-info-card') - }), /*#__PURE__*/React.createElement(SelectControl, { - label: __('Columns', 'wp-plugin-info-card'), - options: [{ - label: __('1', 'wp-plugin-info-card'), - value: '1' - }, { - label: __('2', 'wp-plugin-info-card'), - value: '2' - }, { - label: __('3', 'wp-plugin-info-card'), - value: '3' - }], - value: G, - onChange: function onChange(a) { - c({ - cols: a - }); - } - }), /*#__PURE__*/React.createElement(SelectControl, { - label: __('Sort results by:', 'wp-plugin-info-card'), - options: [{ - label: __('None', 'wp-plugin-info-card'), - value: 'none' - }, { - label: __('Active Installs (Plugins only)', 'wp-plugin-info-card'), - value: 'active_installs' - }, { - label: __('Downloads', 'wp-plugin-info-card'), - value: 'downloaded' - }, { - label: __('Last Updated', 'wp-plugin-info-card'), - value: 'last_updated' - }], - value: H, - onChange: function onChange(a) { - c({ - sortby: a - }); - } - }), /*#__PURE__*/React.createElement(SelectControl, { - label: __('Sort Order:', 'wp-plugin-info-card'), - options: [{ - label: __('ASC', 'wp-plugin-info-card'), - value: 'ASC' - }, { - label: __('DESC', 'wp-plugin-info-card'), - value: 'DESC' - }], - value: I, - onChange: function onChange(a) { - c({ - sort: a - }); - } - })), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-gutenberg-button" - }, /*#__PURE__*/React.createElement(Button, { - iconSize: 20, - icon: /*#__PURE__*/React.createElement(_Logo__WEBPACK_IMPORTED_MODULE_10__["default"], { - size: "25" - }), - isSecondary: true, - id: "wppic-input-submit", - onClick: function onClick(a) { - a.preventDefault(); - g(false); - J(a); - } - }, __('Query and Configure', 'wp-plugin-info-card')))), j && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", { - className: "wppic-loading-placeholder" - }, /*#__PURE__*/React.createElement("div", { - className: "wppic-loading" - }, /*#__PURE__*/React.createElement(_Logo__WEBPACK_IMPORTED_MODULE_10__["default"], { - size: "45" - }), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("div", { - className: "wppic-spinner" - }, /*#__PURE__*/React.createElement(Spinner, null))))), !f && !j && /*#__PURE__*/React.createElement(React.Fragment, null, T, /*#__PURE__*/React.createElement(BlockControls, null, /*#__PURE__*/React.createElement(Toolbar, { - controls: M - }), 'flex' === x && /*#__PURE__*/React.createElement(BlockAlignmentToolbar, { - value: p, - onChange: function onChange(a) { - c({ - align: a - }); - J(a); - } - }), 'card' === x && /*#__PURE__*/React.createElement(AlignmentToolbar, { - value: p, - onChange: function onChange(a) { - c({ - align: a - }); - J(a); - } - })), /*#__PURE__*/React.createElement("div", { - className: '' !== y ? 'wp-pic-full-width' : '' - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-1-".concat(G) - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-grid cols-".concat(G) - }, K())))))); - var V = useBlockProps({ - className: classnames__WEBPACK_IMPORTED_MODULE_1___default()("wp-plugin-info-card-query align".concat(p)) - }); - if (F) { - return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("img", { - src: wppic.query_preview, - style: { - width: '100%', - height: 'auto' - } - })); - } - return /*#__PURE__*/React.createElement("div", V, U); -}; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (WP_Plugin_Card_Query); - -/***/ }), - -/***/ "./src/blocks/PluginInfoCardQuery/wppic-query.js": -/*!*******************************************************!*\ - !*** ./src/blocks/PluginInfoCardQuery/wppic-query.js ***! - \*******************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var _edit_query__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./edit-query */ "./src/blocks/PluginInfoCardQuery/edit-query.js"); -/* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./block.json */ "./src/blocks/PluginInfoCardQuery/block.json"); -/** - * BLOCK: wp-plugin-info-card - * - * Registering a basic block with Gutenberg. - * Simple block, renders and saves the same content without any interactivity. - */ - -// Import CSS. - - -var __ = wp.i18n.__; // Import __() from wp.i18n -var registerBlockType = wp.blocks.registerBlockType; // Import registerBlockType() from wp.blocks -registerBlockType(_block_json__WEBPACK_IMPORTED_MODULE_1__, { - icon: /*#__PURE__*/React.createElement("svg", { - version: "1.1", - id: "Calque_1", - xmlns: "http://www.w3.org/2000/svg", - x: "0px", - y: "0px", - width: "850.39px", - height: "850.39px", - viewBox: "0 0 850.39 850.39", - enableBackground: "new 0 0 850.39 850.39" - }, /*#__PURE__*/React.createElement("path", { - fill: "#DB3939", - d: "M425.195,2C190.366,2,0,191.918,0,426.195C0,660.472,190.366,850.39,425.195,850.39\nc234.828,0,425.195-189.918,425.195-424.195C850.39,191.918,660.023,2,425.195,2z M662.409,476.302l-2.624,4.533L559.296,654.451\nl78.654,45.525l-228.108,105.9L388.046,555.33l78.653,45.523l69.391-119.887l-239.354-0.303l-94.925-0.337l-28.75-0.032l-0.041-0.07\nh0l-24.361-42.303l28.111-48.563l109.635-189.419l-78.653-45.524L435.859,48.514l21.797,250.546l-78.654-45.525l-69.391,119.887\nl239.353,0.303l123.676,0.37l16.571,28.772l7.831,13.596L662.409,476.302z" - })), - edit: _edit_query__WEBPACK_IMPORTED_MODULE_0__["default"], - // Render via PHP - save: function save() { - return null; - } -}); - -/***/ }), - -/***/ "./src/blocks/components/BannerWrapper.js": -/*!************************************************!*\ - !*** ./src/blocks/components/BannerWrapper.js ***! - \************************************************/ -/***/ ((__unused_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 */ }); -var Fragment = wp.element.Fragment; -var BannerWrapper = function BannerWrapper(a) { - var b = a.defaultBanner; - if ('high' in a.bannerImage && false !== a.bannerImage.high) { - b = a.bannerImage.high; - } else if ('low' in a.bannerImage && false !== a.bannerImage) { - b = a.bannerImage.low; - } - if (a.image) { - b = a.image; - } - return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-banner-wrapper" - }, /*#__PURE__*/React.createElement("img", { - src: b, - alt: a.name - }))); -}; -BannerWrapper.defaultProps = { - name: '', - banners: {}, - hasBanner: false, - bannerImage: {}, - // eslint-disable-next-line no-undef - defaultBanner: wppic.wppic_banner_default, - image: false -}; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BannerWrapper); - -/***/ }), - -/***/ "./src/blocks/components/PicIcon.js": -/*!******************************************!*\ - !*** ./src/blocks/components/PicIcon.js ***! - \******************************************/ -/***/ ((__unused_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 */ }); -var Fragment = wp.element.Fragment; -var PicIcon = function PicIcon(a) { - var b = a.defaultIcon; - if (a.image) { - b = a.image; - } else if (a.data.icons.svg) { - b = a.data.icons.svg; - } else if (a.data.icons['2x']) { - b = a.data.icons['2x']; - } else if (a.data.icons['1x']) { - b = a.data.icons['1x']; - } - return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("img", { - src: b, - className: "wp-pic-plugin-icon", - alt: a.data.name - })); -}; -PicIcon.defaultProps = { - name: '', - image: false -}; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PicIcon); - -/***/ }), - -/***/ "./src/blocks/templates/PluginCard.js": -/*!********************************************!*\ - !*** ./src/blocks/templates/PluginCard.js ***! - \********************************************/ -/***/ ((__unused_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 classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var validator_lib_isNumeric__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! validator/lib/isNumeric */ "./node_modules/validator/lib/isNumeric.js"); -/* harmony import */ var validator_lib_isNumeric__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(validator_lib_isNumeric__WEBPACK_IMPORTED_MODULE_1__); - - -var HtmlToReactParser = (__webpack_require__(/*! html-to-react */ "./node_modules/html-to-react/index.js").Parser); -var __ = wp.i18n.__; -var PluginCard = function PluginCard(a) { - var b = classnames__WEBPACK_IMPORTED_MODULE_0___default()({ - 'wp-pic-wrapper': true, - 'wp-pic-card': true - }); - var c = classnames__WEBPACK_IMPORTED_MODULE_0___default()(a.scheme, { - 'wp-pic': true, - 'wp-pic-card': true, - plugin: true - }); - // WordPress Requires. - var d = a.data.requires; - if (validator_lib_isNumeric__WEBPACK_IMPORTED_MODULE_1___default()(d)) { - d = 'WP ' + d + '+'; - } - var e = ''; - if (a.data.icons.svg) { - e = a.data.icons.svg; - } else if (a.data.icons['2x']) { - e = a.data.icons['2x']; - } else if (a.data.icons['1x']) { - e = a.data.icons['1x']; - } else { - e = a.defaultIcon; - } - var f = { - backgroundImage: "url(".concat(e, ")"), - backgroundRepeat: 'no-repeat', - backgroundSize: 'cover' - }; - var g = new HtmlToReactParser(); - return /*#__PURE__*/React.createElement("div", { - className: b - }, /*#__PURE__*/React.createElement("div", { - className: c - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-flip", - style: { - display: 'none' - } - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-face wp-pic-front" - }, /*#__PURE__*/React.createElement("span", { - className: "wp-pic-logo", - style: f - }), /*#__PURE__*/React.createElement("span", { - className: "wp-pic-name" - }, g.parse(a.data.name)), /*#__PURE__*/React.createElement("p", { - className: "wp-pic-author" - }, __('Author(s):', 'wp-plugin-info-card'), ' ', g.parse(a.data.author)), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-bottom" - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-bar" - }, /*#__PURE__*/React.createElement("span", { - className: "wp-pic-rating" - }, a.data.rating, "%", /*#__PURE__*/React.createElement("em", null, __('Ratings', 'wp-plugin-info-card'))), /*#__PURE__*/React.createElement("span", { - className: "wp-pic-downloaded" - }, a.data.active_installs.toLocaleString('en'), "+", /*#__PURE__*/React.createElement("em", null, __('Installs', 'wp-plugin-info-card'))), /*#__PURE__*/React.createElement("span", { - className: "wp-pic-requires" - }, a.data.requires, /*#__PURE__*/React.createElement("em", null, __('Requires', 'wp-plugin-info-card')))), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-download" - }, /*#__PURE__*/React.createElement("span", null, __('More info', 'wp-plugin-info-card')))))))); -}; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PluginCard); - -/***/ }), - -/***/ "./src/blocks/templates/PluginFlex.js": -/*!********************************************!*\ - !*** ./src/blocks/templates/PluginFlex.js ***! - \********************************************/ -/***/ ((__unused_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 classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _components_BannerWrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/BannerWrapper */ "./src/blocks/components/BannerWrapper.js"); - - -var HtmlToReactParser = (__webpack_require__(/*! html-to-react */ "./node_modules/html-to-react/index.js").Parser); -var __ = wp.i18n.__; -var PluginFlex = function PluginFlex(a) { - var b = classnames__WEBPACK_IMPORTED_MODULE_0___default()({ - flex: true, - 'wp-pic-wrapper': true, - 'wp-pic-card': true - }); - var c = classnames__WEBPACK_IMPORTED_MODULE_0___default()(a.scheme, { - 'wp-pic': true, - flex: true, - 'wp-pic-card': true, - plugin: true - }); - var d = new HtmlToReactParser(); - return /*#__PURE__*/React.createElement("div", { - className: b - }, /*#__PURE__*/React.createElement("div", { - className: c - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-flip", - style: { - display: 'none' - } - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-face wp-pic-front" - }, /*#__PURE__*/React.createElement(_components_BannerWrapper__WEBPACK_IMPORTED_MODULE_1__["default"], { - name: a.data.name, - bannerImage: a.data.banners, - image: a.image - }), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-name-wrapper" - }, /*#__PURE__*/React.createElement("span", { - className: "wp-pic-name" - }, /*#__PURE__*/React.createElement("strong", null, d.parse(a.data.name)))), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-version-wrapper" - }, /*#__PURE__*/React.createElement("p", { - className: "wp-pic-version" - }, /*#__PURE__*/React.createElement("span", null, __('Current Version:', 'wp-plugin-info-card')), ' ', a.data.version)), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-updated-wrapper" - }, /*#__PURE__*/React.createElement("p", { - className: "wp-pic-updated" - }, /*#__PURE__*/React.createElement("span", null, __('Last Updated:', 'wp-plugin-info-card')), ' ', a.data.last_updated)), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-tested-wrapper" - }, /*#__PURE__*/React.createElement("p", { - className: "wp-pic-tested" - }, /*#__PURE__*/React.createElement("span", null, __('Tested Up To:', 'wp-plugin-info-card')), ' ', a.data.tested)), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-author-wrapper" - }, /*#__PURE__*/React.createElement("p", { - className: "wp-pic-author" - }, __('Author(s):', 'wp-plugin-info-card'), ' ', d.parse(a.data.author))), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-bottom" - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-bar" - }, /*#__PURE__*/React.createElement("span", { - className: "wp-pic-rating" - }, a.data.rating, "%", ' ', /*#__PURE__*/React.createElement("em", null, __('Ratings', 'wp-plugin-info-card'))), /*#__PURE__*/React.createElement("span", { - className: "wp-pic-downloaded" - }, a.data.active_installs.toLocaleString('en'), '+', ' ', /*#__PURE__*/React.createElement("em", null, __('Installs', 'wp-plugin-info-card'))), /*#__PURE__*/React.createElement("span", { - className: "wp-pic-requires" - }, a.data.requires, /*#__PURE__*/React.createElement("em", null, __('Requires', 'wp-plugin-info-card')))), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-download-link" - }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", null, __('Download', 'wp-plugin-info-card'), ' ', d.parse(a.data.name))))))))); -}; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PluginFlex); - -/***/ }), - -/***/ "./src/blocks/templates/PluginLarge.js": -/*!*********************************************!*\ - !*** ./src/blocks/templates/PluginLarge.js ***! - \*********************************************/ -/***/ ((__unused_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 classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var validator_lib_isNumeric__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! validator/lib/isNumeric */ "./node_modules/validator/lib/isNumeric.js"); -/* harmony import */ var validator_lib_isNumeric__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(validator_lib_isNumeric__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _components_BannerWrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/BannerWrapper */ "./src/blocks/components/BannerWrapper.js"); - - - -var HtmlToReactParser = (__webpack_require__(/*! html-to-react */ "./node_modules/html-to-react/index.js").Parser); -var __ = wp.i18n.__; -var PluginLarge = function PluginLarge(a) { - var b = classnames__WEBPACK_IMPORTED_MODULE_0___default()({ - large: true, - 'wp-pic-wrapper': true, - 'wp-pic-card': true - }); - var c = classnames__WEBPACK_IMPORTED_MODULE_0___default()(a.scheme, { - 'wp-pic': true, - 'wp-pic-card': true, - large: true, - plugin: true - }); - // WordPress Requires. - var d = a.data.requires; - if (validator_lib_isNumeric__WEBPACK_IMPORTED_MODULE_2___default()(d)) { - d = 'WP ' + d + '+'; - } - var e = ''; - if (a.data.icons.svg) { - e = a.data.icons.svg; - } else if (a.data.icons['2x']) { - e = a.data.icons['2x']; - } else if (a.data.icons['1x']) { - e = a.data.icons['1x']; - } else { - e = a.defaultIcon; - } - var f = { - backgroundImage: "url(".concat(e, ")"), - backgroundRepeat: 'no-repeat', - backgroundSize: 'cover' - }; - var g = new HtmlToReactParser(); - return /*#__PURE__*/React.createElement("div", { - className: b - }, /*#__PURE__*/React.createElement("div", { - className: c - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-large", - style: { - display: 'none' - } - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-large-content" - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-asset-bg" - }, /*#__PURE__*/React.createElement(_components_BannerWrapper__WEBPACK_IMPORTED_MODULE_1__["default"], { - name: g.parse(a.data.name), - bannerImage: a.data.banners, - image: a.image - }), /*#__PURE__*/React.createElement("span", { - className: "wp-pic-asset-bg-title" - }, /*#__PURE__*/React.createElement("span", null, g.parse(a.data.name)))), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-half-first" - }, /*#__PURE__*/React.createElement("span", { - className: "wp-pic-logo", - style: f - }), /*#__PURE__*/React.createElement("p", { - className: "wp-pic-author" - }, __('Author(s):', 'wp-plugin-info-card'), ' ', g.parse(a.data.author)), /*#__PURE__*/React.createElement("p", { - className: "wp-pic-version" - }, /*#__PURE__*/React.createElement("span", null, __('Current Version:', 'wp-plugin-info-card')), ' ', a.data.version), /*#__PURE__*/React.createElement("p", { - className: "wp-pic-updated" - }, /*#__PURE__*/React.createElement("span", null, __('Last Updated:', 'wp-plugin-info-card')), ' ', a.data.last_updated)), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-half-last" - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-bottom" - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-bar" - }, /*#__PURE__*/React.createElement("span", { - className: "wp-pic-rating" - }, a.data.rating, "%", ' ', /*#__PURE__*/React.createElement("em", null, __('Ratings', 'wp-plugin-info-card'))), /*#__PURE__*/React.createElement("span", { - className: "wp-pic-downloaded" - }, a.data.active_installs.toLocaleString('en'), '+', ' ', /*#__PURE__*/React.createElement("em", null, __('Installs', 'wp-plugin-info-card'))), /*#__PURE__*/React.createElement("span", { - className: "wp-pic-requires" - }, a.data.requires, /*#__PURE__*/React.createElement("em", null, __('Requires', 'wp-plugin-info-card')))))))))); -}; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PluginLarge); - -/***/ }), - -/***/ "./src/blocks/templates/PluginWordPress.js": -/*!*************************************************!*\ - !*** ./src/blocks/templates/PluginWordPress.js ***! - \*************************************************/ -/***/ ((__unused_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 classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var validator_lib_isNumeric__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! validator/lib/isNumeric */ "./node_modules/validator/lib/isNumeric.js"); -/* harmony import */ var validator_lib_isNumeric__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(validator_lib_isNumeric__WEBPACK_IMPORTED_MODULE_3__); -/* harmony import */ var _components_PicIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/PicIcon */ "./src/blocks/components/PicIcon.js"); -/* harmony import */ var react_star_ratings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-star-ratings */ "./node_modules/react-star-ratings/build/index.js"); -/* eslint-disable @wordpress/i18n-translator-comments */ - - - - -var HtmlToReactParser = (__webpack_require__(/*! html-to-react */ "./node_modules/html-to-react/index.js").Parser); -var _wp$i18n = wp.i18n, - __ = _wp$i18n.__, - _n = _wp$i18n._n, - sprintf = _wp$i18n.sprintf; -var PluginWordPress = function PluginWordPress(a) { - var b = classnames__WEBPACK_IMPORTED_MODULE_0___default()({ - wordpress: true, - 'wp-pic-wrapper': true, - 'wp-pic-card': true - }); - var c = classnames__WEBPACK_IMPORTED_MODULE_0___default()(a.scheme, "align".concat(a.align), { - 'wp-pic': true, - 'wp-pic-wordpress': true, - wordpress: true, - full: false, - plugin: true - }); - // WordPress Requires. - var d = a.data.requires; - if (validator_lib_isNumeric__WEBPACK_IMPORTED_MODULE_3___default()(d)) { - d = 'WP ' + d + '+'; - } - var e = new HtmlToReactParser(); - return /*#__PURE__*/React.createElement("div", { - className: b - }, /*#__PURE__*/React.createElement("div", { - className: c - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-wordpress", - style: { - display: 'none' - } - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-wordpress-content" - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-plugin-card-top" - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-column-name" - }, /*#__PURE__*/React.createElement("h3", null, e.parse(a.data.name), /*#__PURE__*/React.createElement(_components_PicIcon__WEBPACK_IMPORTED_MODULE_1__["default"], { - image: a.image, - data: a.data - }))), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-action-links" - }, /*#__PURE__*/React.createElement("span", { - className: "wp-pic-action-buttons" - }, __('Download', 'wp-plugin-info-card'))), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-column-description" - }, /*#__PURE__*/React.createElement("p", null, a.data.short_description), /*#__PURE__*/React.createElement("p", { - className: "authors" - }, /*#__PURE__*/React.createElement("cite", null, e.parse(sprintf(__('By %s', 'wp-plugin-info-card'), a.data.author)))))), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-plugin-card-bottom" - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-column-rating", - title: sprintf(_n('(based on %s rating)', '(based on %s ratings)', a.data.num_ratings, 'wp-plugin-info-card'), a.data.num_ratings) - }, /*#__PURE__*/React.createElement("span", { - className: "wp-pic-num-ratings", - "aria-hidden": "true" - }, /*#__PURE__*/React.createElement(react_star_ratings__WEBPACK_IMPORTED_MODULE_2__["default"], { - rating: a.data.rating / 100 * 5, - starRatedColor: "orange", - starDimension: "20px", - starSpacing: "0", - numberOfStars: 5, - name: "" - }), "\xA0 (", a.data.num_ratings, ")")), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-column-updated" - }, /*#__PURE__*/React.createElement("strong", null, __('Last Updated:', 'wp-plugin-info-card')), ' ', a.data.last_updated), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-column-downloaded" - }, sprintf(__('%s+ Active Installs', 'wp-plugin-info-card'), a.data.active_installs.toLocaleString('en'))), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-column-compatibility" - }, /*#__PURE__*/React.createElement("span", { - className: "wp-pic-compatibility-compatible" - }, __('Compatible with WordPress', 'wp-plugin-info-card'), ' ', a.data.requires))))))); -}; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PluginWordPress); - -/***/ }), - -/***/ "./src/blocks/templates/ThemeCard.js": -/*!*******************************************!*\ - !*** ./src/blocks/templates/ThemeCard.js ***! - \*******************************************/ -/***/ ((__unused_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 classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); - -var HtmlToReactParser = (__webpack_require__(/*! html-to-react */ "./node_modules/html-to-react/index.js").Parser); -var __ = wp.i18n.__; -var ThemeCard = function ThemeCard(a) { - var b = classnames__WEBPACK_IMPORTED_MODULE_0___default()({ - 'wp-pic-wrapper': true, - 'wp-pic-card': true - }); - var c = classnames__WEBPACK_IMPORTED_MODULE_0___default()(a.scheme, { - 'wp-pic': true, - 'wp-pic-card': true, - theme: true - }); - var d = a.image || a.data.screenshot_url; - var e = { - backgroundImage: "url(".concat(d, ")"), - backgroundRepeat: 'no-repeat', - backgroundSize: 'cover' - }; - var f = a.data.author; - if (f.hasOwnProperty('author')) { - f = f.author; - } - var g = new HtmlToReactParser(); - return /*#__PURE__*/React.createElement("div", { - className: b - }, /*#__PURE__*/React.createElement("div", { - className: c - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-flip", - style: { - display: 'none' - } - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-face wp-pic-front" - }, /*#__PURE__*/React.createElement("span", { - className: "wp-pic-logo", - style: e - }), /*#__PURE__*/React.createElement("span", { - className: "wp-pic-name" - }, g.parse(a.data.name)), /*#__PURE__*/React.createElement("p", { - className: "wp-pic-author" - }, __('Author(s):', 'wp-plugin-info-card'), ' ', f), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-bottom" - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-bar" - }, /*#__PURE__*/React.createElement("span", { - className: "wp-pic-rating" - }, a.data.rating, "%", /*#__PURE__*/React.createElement("em", null, __('Ratings', 'wp-plugin-info-card'))), /*#__PURE__*/React.createElement("span", { - className: "wp-pic-downloaded" - }, a.data.downloaded.toLocaleString('en'), /*#__PURE__*/React.createElement("em", null, __('Downloads', 'wp-plugin-info-card'))), /*#__PURE__*/React.createElement("span", { - className: "wp-pic-requires" - }, a.data.version, /*#__PURE__*/React.createElement("em", null, __('Version', 'wp-plugin-info-card')))), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-download" - }, /*#__PURE__*/React.createElement("span", null, __('More info', 'wp-plugin-info-card')))))))); -}; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ThemeCard); - -/***/ }), - -/***/ "./src/blocks/templates/ThemeFlex.js": -/*!*******************************************!*\ - !*** ./src/blocks/templates/ThemeFlex.js ***! - \*******************************************/ -/***/ ((__unused_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 classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _components_BannerWrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/BannerWrapper */ "./src/blocks/components/BannerWrapper.js"); - - -var HtmlToReactParser = (__webpack_require__(/*! html-to-react */ "./node_modules/html-to-react/index.js").Parser); -var __ = wp.i18n.__; -var PluginFlex = function PluginFlex(a) { - var b = classnames__WEBPACK_IMPORTED_MODULE_0___default()({ - flex: true, - 'wp-pic-wrapper': true, - 'wp-pic-card': true - }); - var c = classnames__WEBPACK_IMPORTED_MODULE_0___default()(a.scheme, { - 'wp-pic': true, - flex: true, - 'wp-pic-card': true, - theme: true - }); - var d = a.data.author; - if (d.hasOwnProperty('author')) { - d = d.author; - } - var e = new HtmlToReactParser(); - return /*#__PURE__*/React.createElement("div", { - className: b - }, /*#__PURE__*/React.createElement("div", { - className: c - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-flip", - style: { - display: 'none' - } - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-face wp-pic-front" - }, /*#__PURE__*/React.createElement(_components_BannerWrapper__WEBPACK_IMPORTED_MODULE_1__["default"], { - name: e.parse(a.data.name), - bannerImage: a.data.banners, - image: a.image || a.data.screenshot_url - }), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-name-wrapper" - }, /*#__PURE__*/React.createElement("span", { - className: "wp-pic-name" - }, /*#__PURE__*/React.createElement("strong", null, e.parse(a.data.name)))), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-preview-wrapper" - }, /*#__PURE__*/React.createElement("span", { - className: "wp-pic-preview" - }, /*#__PURE__*/React.createElement("span", null, __('Theme Preview', 'wp-plugin-info-card'))), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-updated-wrapper" - }, /*#__PURE__*/React.createElement("p", { - className: "wp-pic-updated" - }, /*#__PURE__*/React.createElement("span", null, __('Last Updated:', 'wp-plugin-info-card')), ' ', a.data.last_updated)), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-author-wrapper" - }, /*#__PURE__*/React.createElement("p", { - className: "wp-pic-author" - }, __('Author(s):', 'wp-plugin-info-card'), ' ', d)), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-bottom" - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-bar" - }, /*#__PURE__*/React.createElement("span", { - className: "wp-pic-rating" - }, a.data.rating, "%", ' ', /*#__PURE__*/React.createElement("em", null, __('Ratings', 'wp-plugin-info-card'))), /*#__PURE__*/React.createElement("span", { - className: "wp-pic-downloaded" - }, a.data.downloaded.toLocaleString('en'), '+', ' ', /*#__PURE__*/React.createElement("em", null, __('Downloads', 'wp-plugin-info-card'))), /*#__PURE__*/React.createElement("span", { - className: "wp-pic-version" - }, a.data.version, /*#__PURE__*/React.createElement("em", null, __('Version', 'wp-plugin-info-card')))), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-download-link" - }, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", null, __('Download', 'wp-plugin-info-card'), ' ', a.data.name))))))))); -}; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PluginFlex); - -/***/ }), - -/***/ "./src/blocks/templates/ThemeLarge.js": -/*!********************************************!*\ - !*** ./src/blocks/templates/ThemeLarge.js ***! - \********************************************/ -/***/ ((__unused_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 classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var _components_BannerWrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../components/BannerWrapper */ "./src/blocks/components/BannerWrapper.js"); - - -var HtmlToReactParser = (__webpack_require__(/*! html-to-react */ "./node_modules/html-to-react/index.js").Parser); -var __ = wp.i18n.__; -var PluginLarge = function PluginLarge(a) { - var b = classnames__WEBPACK_IMPORTED_MODULE_0___default()({ - large: true, - 'wp-pic-wrapper': true, - 'wp-pic-card': true - }); - var c = classnames__WEBPACK_IMPORTED_MODULE_0___default()(a.scheme, { - 'wp-pic': true, - 'wp-pic-card': true, - large: true, - theme: true - }); - var d = a.data.author; - if (d.hasOwnProperty('author')) { - d = d.author; - } - var e = new HtmlToReactParser(); - return /*#__PURE__*/React.createElement("div", { - className: b - }, /*#__PURE__*/React.createElement("div", { - className: c - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-large", - style: { - display: 'none' - } - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-large-content" - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-asset-bg" - }, /*#__PURE__*/React.createElement(_components_BannerWrapper__WEBPACK_IMPORTED_MODULE_1__["default"], { - name: e.parse(a.data.name), - bannerImage: a.data.banners, - image: a.image || a.data.screenshot_url - }), /*#__PURE__*/React.createElement("span", { - className: "wp-pic-asset-bg-title" - }, /*#__PURE__*/React.createElement("span", null, e.parse(a.data.name)))), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-half-first" - }, /*#__PURE__*/React.createElement("span", { - className: "wp-pic-logo", - href: "#" - }), /*#__PURE__*/React.createElement("p", { - className: "wp-pic-author" - }, __('Author(s):', 'wp-plugin-info-card'), ' ', d), /*#__PURE__*/React.createElement("p", { - className: "wp-pic-version" - }, /*#__PURE__*/React.createElement("span", null, __('Current Version:', 'wp-plugin-info-card')), ' ', a.data.version), /*#__PURE__*/React.createElement("p", { - className: "wp-pic-updated" - }, /*#__PURE__*/React.createElement("span", null, __('Last Updated:', 'wp-plugin-info-card')), ' ', a.data.last_updated)), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-half-last" - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-bottom" - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-bar" - }, /*#__PURE__*/React.createElement("span", { - className: "wp-pic-rating" - }, a.data.rating, "%", ' ', /*#__PURE__*/React.createElement("em", null, __('Ratings', 'wp-plugin-info-card'))), /*#__PURE__*/React.createElement("span", { - className: "wp-pic-downloaded" - }, a.data.downloaded.toLocaleString('en'), '+', ' ', /*#__PURE__*/React.createElement("em", null, __('Downloads', 'wp-plugin-info-card'))), /*#__PURE__*/React.createElement("span", { - className: "wp-pic-requires" - }, a.data.version, /*#__PURE__*/React.createElement("em", null, __('Version', 'wp-plugin-info-card')))))))))); -}; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PluginLarge); - -/***/ }), - -/***/ "./src/blocks/templates/ThemeWordPress.js": -/*!************************************************!*\ - !*** ./src/blocks/templates/ThemeWordPress.js ***! - \************************************************/ -/***/ ((__unused_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 classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "./node_modules/classnames/index.js"); -/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var react_star_ratings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-star-ratings */ "./node_modules/react-star-ratings/build/index.js"); -/* harmony import */ var _components_BannerWrapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../components/BannerWrapper */ "./src/blocks/components/BannerWrapper.js"); -/* eslint-disable @wordpress/i18n-translator-comments */ - - - -var HtmlToReactParser = (__webpack_require__(/*! html-to-react */ "./node_modules/html-to-react/index.js").Parser); -var _wp$i18n = wp.i18n, - __ = _wp$i18n.__, - _n = _wp$i18n._n, - sprintf = _wp$i18n.sprintf; -var ThemeWordPress = function ThemeWordPress(a) { - var b = classnames__WEBPACK_IMPORTED_MODULE_0___default()({ - wordpress: true, - 'wp-pic-wrapper': true, - 'wp-pic-card': true - }); - var c = classnames__WEBPACK_IMPORTED_MODULE_0___default()(a.scheme, { - 'wp-pic': true, - 'wp-pic-wordpress': true, - wordpress: true, - theme: true - }); - var d = new HtmlToReactParser(); - return /*#__PURE__*/React.createElement("div", { - className: b - }, /*#__PURE__*/React.createElement("div", { - className: c - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-wordpress", - style: { - display: 'none' - } - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-theme-card-top" - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-theme-screenshot" - }, /*#__PURE__*/React.createElement(_components_BannerWrapper__WEBPACK_IMPORTED_MODULE_2__["default"], { - name: d.parse(a.data.name), - bannerImage: a.data.banners, - image: a.image || a.data.screenshot_url - }), /*#__PURE__*/React.createElement("span", { - className: "wp-pic-theme-preview" - }, __('Theme Preview', 'wp-plugin-info-card'))), /*#__PURE__*/React.createElement("h3", null, d.parse(a.data.name), "\xA0", /*#__PURE__*/React.createElement("span", { - className: "wp-pic-author" - }, sprintf(__('By %s', 'wp-plugin-info-card'), a.data.author))), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-action-links" - }, /*#__PURE__*/React.createElement("span", { - className: "wp-pic-action-buttons" - }, __('Download', 'wp-plugin-info-card')))), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-theme-card-bottom" - }, /*#__PURE__*/React.createElement("div", { - className: "wp-pic-column-rating", - title: sprintf(_n('(based on %s rating)', '(based on %s ratings)', a.data.num_ratings, 'wp-plugin-info-card'), a.data.num_ratings) - }, /*#__PURE__*/React.createElement("span", { - className: "wp-pic-num-ratings", - "aria-hidden": "true" - }, /*#__PURE__*/React.createElement(react_star_ratings__WEBPACK_IMPORTED_MODULE_1__["default"], { - rating: a.data.rating / 100 * 5, - starRatedColor: "orange", - starDimension: "20px", - starSpacing: "0", - numberOfStars: 5, - name: "" - }), "\xA0 (", a.data.num_ratings, ")")), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-column-updated" - }, /*#__PURE__*/React.createElement("strong", null, __('Last Updated:', 'wp-plugin-info-card')), ' ', a.data.last_updated), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-column-downloaded" - }, sprintf(__('%s+ Downloads', 'wp-plugin-info-card'), a.data.downloaded.toLocaleString('en'))), /*#__PURE__*/React.createElement("div", { - className: "wp-pic-column-version" - }, /*#__PURE__*/React.createElement("span", null, __('Version', 'wp-plugin-info-card'), ' ', a.data.version)))))); -}; -/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ThemeWordPress); - -/***/ }), - -/***/ "./node_modules/classnames/index.js": -/*!******************************************!*\ - !*** ./node_modules/classnames/index.js ***! - \******************************************/ -/***/ ((module, exports) => { - -var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! - Copyright (c) 2018 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/ -/* global define */ - -(function () { - 'use strict'; - - var hasOwn = {}.hasOwnProperty; - var nativeCodeString = '[native code]'; - - function classNames() { - var classes = []; - - for (var i = 0; i < arguments.length; i++) { - var arg = arguments[i]; - if (!arg) continue; - - var argType = typeof arg; - - if (argType === 'string' || argType === 'number') { - classes.push(arg); - } else if (Array.isArray(arg)) { - if (arg.length) { - var inner = classNames.apply(null, arg); - if (inner) { - classes.push(inner); - } - } - } else if (argType === 'object') { - if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) { - classes.push(arg.toString()); - continue; - } - - for (var key in arg) { - if (hasOwn.call(arg, key) && arg[key]) { - classes.push(key); - } - } - } - } - - return classes.join(' '); - } - - if ( true && module.exports) { - classNames.default = classNames; - module.exports = classNames; - } else if (true) { - // register as 'classnames', consistent with npm package name - !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { - return classNames; - }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), - __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); - } else {} -}()); - - -/***/ }), - -/***/ "./node_modules/domhandler/lib/index.js": -/*!**********************************************!*\ - !*** ./node_modules/domhandler/lib/index.js ***! - \**********************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DomHandler = void 0; -var domelementtype_1 = __webpack_require__(/*! domelementtype */ "./node_modules/domhandler/node_modules/domelementtype/lib/index.js"); -var node_js_1 = __webpack_require__(/*! ./node.js */ "./node_modules/domhandler/lib/node.js"); -__exportStar(__webpack_require__(/*! ./node.js */ "./node_modules/domhandler/lib/node.js"), exports); -// Default options -var defaultOpts = { - withStartIndices: false, - withEndIndices: false, - xmlMode: false, -}; -var DomHandler = /** @class */ (function () { - /** - * @param callback Called once parsing has completed. - * @param options Settings for the handler. - * @param elementCB Callback whenever a tag is closed. - */ - function DomHandler(callback, options, elementCB) { - /** The elements of the DOM */ - this.dom = []; - /** The root element for the DOM */ - this.root = new node_js_1.Document(this.dom); - /** Indicated whether parsing has been completed. */ - this.done = false; - /** Stack of open tags. */ - this.tagStack = [this.root]; - /** A data node that is still being written to. */ - this.lastNode = null; - /** Reference to the parser instance. Used for location information. */ - this.parser = null; - // Make it possible to skip arguments, for backwards-compatibility - if (typeof options === "function") { - elementCB = options; - options = defaultOpts; - } - if (typeof callback === "object") { - options = callback; - callback = undefined; - } - this.callback = callback !== null && callback !== void 0 ? callback : null; - this.options = options !== null && options !== void 0 ? options : defaultOpts; - this.elementCB = elementCB !== null && elementCB !== void 0 ? elementCB : null; - } - DomHandler.prototype.onparserinit = function (parser) { - this.parser = parser; - }; - // Resets the handler back to starting state - DomHandler.prototype.onreset = function () { - this.dom = []; - this.root = new node_js_1.Document(this.dom); - this.done = false; - this.tagStack = [this.root]; - this.lastNode = null; - this.parser = null; - }; - // Signals the handler that parsing is done - DomHandler.prototype.onend = function () { - if (this.done) - return; - this.done = true; - this.parser = null; - this.handleCallback(null); - }; - DomHandler.prototype.onerror = function (error) { - this.handleCallback(error); - }; - DomHandler.prototype.onclosetag = function () { - this.lastNode = null; - var elem = this.tagStack.pop(); - if (this.options.withEndIndices) { - elem.endIndex = this.parser.endIndex; - } - if (this.elementCB) - this.elementCB(elem); - }; - DomHandler.prototype.onopentag = function (name, attribs) { - var type = this.options.xmlMode ? domelementtype_1.ElementType.Tag : undefined; - var element = new node_js_1.Element(name, attribs, undefined, type); - this.addNode(element); - this.tagStack.push(element); - }; - DomHandler.prototype.ontext = function (data) { - var lastNode = this.lastNode; - if (lastNode && lastNode.type === domelementtype_1.ElementType.Text) { - lastNode.data += data; - if (this.options.withEndIndices) { - lastNode.endIndex = this.parser.endIndex; - } - } - else { - var node = new node_js_1.Text(data); - this.addNode(node); - this.lastNode = node; - } - }; - DomHandler.prototype.oncomment = function (data) { - if (this.lastNode && this.lastNode.type === domelementtype_1.ElementType.Comment) { - this.lastNode.data += data; - return; - } - var node = new node_js_1.Comment(data); - this.addNode(node); - this.lastNode = node; - }; - DomHandler.prototype.oncommentend = function () { - this.lastNode = null; - }; - DomHandler.prototype.oncdatastart = function () { - var text = new node_js_1.Text(""); - var node = new node_js_1.CDATA([text]); - this.addNode(node); - text.parent = node; - this.lastNode = text; - }; - DomHandler.prototype.oncdataend = function () { - this.lastNode = null; - }; - DomHandler.prototype.onprocessinginstruction = function (name, data) { - var node = new node_js_1.ProcessingInstruction(name, data); - this.addNode(node); - }; - DomHandler.prototype.handleCallback = function (error) { - if (typeof this.callback === "function") { - this.callback(error, this.dom); - } - else if (error) { - throw error; - } - }; - DomHandler.prototype.addNode = function (node) { - var parent = this.tagStack[this.tagStack.length - 1]; - var previousSibling = parent.children[parent.children.length - 1]; - if (this.options.withStartIndices) { - node.startIndex = this.parser.startIndex; - } - if (this.options.withEndIndices) { - node.endIndex = this.parser.endIndex; - } - parent.children.push(node); - if (previousSibling) { - node.prev = previousSibling; - previousSibling.next = node; - } - node.parent = parent; - this.lastNode = null; - }; - return DomHandler; -}()); -exports.DomHandler = DomHandler; -exports["default"] = DomHandler; - - -/***/ }), - -/***/ "./node_modules/domhandler/lib/node.js": -/*!*********************************************!*\ - !*** ./node_modules/domhandler/lib/node.js ***! - \*********************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.cloneNode = exports.hasChildren = exports.isDocument = exports.isDirective = exports.isComment = exports.isText = exports.isCDATA = exports.isTag = exports.Element = exports.Document = exports.CDATA = exports.NodeWithChildren = exports.ProcessingInstruction = exports.Comment = exports.Text = exports.DataNode = exports.Node = void 0; -var domelementtype_1 = __webpack_require__(/*! domelementtype */ "./node_modules/domhandler/node_modules/domelementtype/lib/index.js"); -/** - * This object will be used as the prototype for Nodes when creating a - * DOM-Level-1-compliant structure. - */ -var Node = /** @class */ (function () { - function Node() { - /** Parent of the node */ - this.parent = null; - /** Previous sibling */ - this.prev = null; - /** Next sibling */ - this.next = null; - /** The start index of the node. Requires `withStartIndices` on the handler to be `true. */ - this.startIndex = null; - /** The end index of the node. Requires `withEndIndices` on the handler to be `true. */ - this.endIndex = null; - } - Object.defineProperty(Node.prototype, "parentNode", { - // Read-write aliases for properties - /** - * Same as {@link parent}. - * [DOM spec](https://dom.spec.whatwg.org)-compatible alias. - */ - get: function () { - return this.parent; - }, - set: function (parent) { - this.parent = parent; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Node.prototype, "previousSibling", { - /** - * Same as {@link prev}. - * [DOM spec](https://dom.spec.whatwg.org)-compatible alias. - */ - get: function () { - return this.prev; - }, - set: function (prev) { - this.prev = prev; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Node.prototype, "nextSibling", { - /** - * Same as {@link next}. - * [DOM spec](https://dom.spec.whatwg.org)-compatible alias. - */ - get: function () { - return this.next; - }, - set: function (next) { - this.next = next; - }, - enumerable: false, - configurable: true - }); - /** - * Clone this node, and optionally its children. - * - * @param recursive Clone child nodes as well. - * @returns A clone of the node. - */ - Node.prototype.cloneNode = function (recursive) { - if (recursive === void 0) { recursive = false; } - return cloneNode(this, recursive); - }; - return Node; -}()); -exports.Node = Node; -/** - * A node that contains some data. - */ -var DataNode = /** @class */ (function (_super) { - __extends(DataNode, _super); - /** - * @param data The content of the data node - */ - function DataNode(data) { - var _this = _super.call(this) || this; - _this.data = data; - return _this; - } - Object.defineProperty(DataNode.prototype, "nodeValue", { - /** - * Same as {@link data}. - * [DOM spec](https://dom.spec.whatwg.org)-compatible alias. - */ - get: function () { - return this.data; - }, - set: function (data) { - this.data = data; - }, - enumerable: false, - configurable: true - }); - return DataNode; -}(Node)); -exports.DataNode = DataNode; -/** - * Text within the document. - */ -var Text = /** @class */ (function (_super) { - __extends(Text, _super); - function Text() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = domelementtype_1.ElementType.Text; - return _this; - } - Object.defineProperty(Text.prototype, "nodeType", { - get: function () { - return 3; - }, - enumerable: false, - configurable: true - }); - return Text; -}(DataNode)); -exports.Text = Text; -/** - * Comments within the document. - */ -var Comment = /** @class */ (function (_super) { - __extends(Comment, _super); - function Comment() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = domelementtype_1.ElementType.Comment; - return _this; - } - Object.defineProperty(Comment.prototype, "nodeType", { - get: function () { - return 8; - }, - enumerable: false, - configurable: true - }); - return Comment; -}(DataNode)); -exports.Comment = Comment; -/** - * Processing instructions, including doc types. - */ -var ProcessingInstruction = /** @class */ (function (_super) { - __extends(ProcessingInstruction, _super); - function ProcessingInstruction(name, data) { - var _this = _super.call(this, data) || this; - _this.name = name; - _this.type = domelementtype_1.ElementType.Directive; - return _this; - } - Object.defineProperty(ProcessingInstruction.prototype, "nodeType", { - get: function () { - return 1; - }, - enumerable: false, - configurable: true - }); - return ProcessingInstruction; -}(DataNode)); -exports.ProcessingInstruction = ProcessingInstruction; -/** - * A `Node` that can have children. - */ -var NodeWithChildren = /** @class */ (function (_super) { - __extends(NodeWithChildren, _super); - /** - * @param children Children of the node. Only certain node types can have children. - */ - function NodeWithChildren(children) { - var _this = _super.call(this) || this; - _this.children = children; - return _this; - } - Object.defineProperty(NodeWithChildren.prototype, "firstChild", { - // Aliases - /** First child of the node. */ - get: function () { - var _a; - return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(NodeWithChildren.prototype, "lastChild", { - /** Last child of the node. */ - get: function () { - return this.children.length > 0 - ? this.children[this.children.length - 1] - : null; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(NodeWithChildren.prototype, "childNodes", { - /** - * Same as {@link children}. - * [DOM spec](https://dom.spec.whatwg.org)-compatible alias. - */ - get: function () { - return this.children; - }, - set: function (children) { - this.children = children; - }, - enumerable: false, - configurable: true - }); - return NodeWithChildren; -}(Node)); -exports.NodeWithChildren = NodeWithChildren; -var CDATA = /** @class */ (function (_super) { - __extends(CDATA, _super); - function CDATA() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = domelementtype_1.ElementType.CDATA; - return _this; - } - Object.defineProperty(CDATA.prototype, "nodeType", { - get: function () { - return 4; - }, - enumerable: false, - configurable: true - }); - return CDATA; -}(NodeWithChildren)); -exports.CDATA = CDATA; -/** - * The root node of the document. - */ -var Document = /** @class */ (function (_super) { - __extends(Document, _super); - function Document() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.type = domelementtype_1.ElementType.Root; - return _this; - } - Object.defineProperty(Document.prototype, "nodeType", { - get: function () { - return 9; - }, - enumerable: false, - configurable: true - }); - return Document; -}(NodeWithChildren)); -exports.Document = Document; -/** - * An element within the DOM. - */ -var Element = /** @class */ (function (_super) { - __extends(Element, _super); - /** - * @param name Name of the tag, eg. `div`, `span`. - * @param attribs Object mapping attribute names to attribute values. - * @param children Children of the node. - */ - function Element(name, attribs, children, type) { - if (children === void 0) { children = []; } - if (type === void 0) { type = name === "script" - ? domelementtype_1.ElementType.Script - : name === "style" - ? domelementtype_1.ElementType.Style - : domelementtype_1.ElementType.Tag; } - var _this = _super.call(this, children) || this; - _this.name = name; - _this.attribs = attribs; - _this.type = type; - return _this; - } - Object.defineProperty(Element.prototype, "nodeType", { - get: function () { - return 1; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Element.prototype, "tagName", { - // DOM Level 1 aliases - /** - * Same as {@link name}. - * [DOM spec](https://dom.spec.whatwg.org)-compatible alias. - */ - get: function () { - return this.name; - }, - set: function (name) { - this.name = name; - }, - enumerable: false, - configurable: true - }); - Object.defineProperty(Element.prototype, "attributes", { - get: function () { - var _this = this; - return Object.keys(this.attribs).map(function (name) { - var _a, _b; - return ({ - name: name, - value: _this.attribs[name], - namespace: (_a = _this["x-attribsNamespace"]) === null || _a === void 0 ? void 0 : _a[name], - prefix: (_b = _this["x-attribsPrefix"]) === null || _b === void 0 ? void 0 : _b[name], - }); - }); - }, - enumerable: false, - configurable: true - }); - return Element; -}(NodeWithChildren)); -exports.Element = Element; -/** - * @param node Node to check. - * @returns `true` if the node is a `Element`, `false` otherwise. - */ -function isTag(node) { - return (0, domelementtype_1.isTag)(node); -} -exports.isTag = isTag; -/** - * @param node Node to check. - * @returns `true` if the node has the type `CDATA`, `false` otherwise. - */ -function isCDATA(node) { - return node.type === domelementtype_1.ElementType.CDATA; -} -exports.isCDATA = isCDATA; -/** - * @param node Node to check. - * @returns `true` if the node has the type `Text`, `false` otherwise. - */ -function isText(node) { - return node.type === domelementtype_1.ElementType.Text; -} -exports.isText = isText; -/** - * @param node Node to check. - * @returns `true` if the node has the type `Comment`, `false` otherwise. - */ -function isComment(node) { - return node.type === domelementtype_1.ElementType.Comment; -} -exports.isComment = isComment; -/** - * @param node Node to check. - * @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise. - */ -function isDirective(node) { - return node.type === domelementtype_1.ElementType.Directive; -} -exports.isDirective = isDirective; -/** - * @param node Node to check. - * @returns `true` if the node has the type `ProcessingInstruction`, `false` otherwise. - */ -function isDocument(node) { - return node.type === domelementtype_1.ElementType.Root; -} -exports.isDocument = isDocument; -/** - * @param node Node to check. - * @returns `true` if the node has children, `false` otherwise. - */ -function hasChildren(node) { - return Object.prototype.hasOwnProperty.call(node, "children"); -} -exports.hasChildren = hasChildren; -/** - * Clone a node, and optionally its children. - * - * @param recursive Clone child nodes as well. - * @returns A clone of the node. - */ -function cloneNode(node, recursive) { - if (recursive === void 0) { recursive = false; } - var result; - if (isText(node)) { - result = new Text(node.data); - } - else if (isComment(node)) { - result = new Comment(node.data); - } - else if (isTag(node)) { - var children = recursive ? cloneChildren(node.children) : []; - var clone_1 = new Element(node.name, __assign({}, node.attribs), children); - children.forEach(function (child) { return (child.parent = clone_1); }); - if (node.namespace != null) { - clone_1.namespace = node.namespace; - } - if (node["x-attribsNamespace"]) { - clone_1["x-attribsNamespace"] = __assign({}, node["x-attribsNamespace"]); - } - if (node["x-attribsPrefix"]) { - clone_1["x-attribsPrefix"] = __assign({}, node["x-attribsPrefix"]); - } - result = clone_1; - } - else if (isCDATA(node)) { - var children = recursive ? cloneChildren(node.children) : []; - var clone_2 = new CDATA(children); - children.forEach(function (child) { return (child.parent = clone_2); }); - result = clone_2; - } - else if (isDocument(node)) { - var children = recursive ? cloneChildren(node.children) : []; - var clone_3 = new Document(children); - children.forEach(function (child) { return (child.parent = clone_3); }); - if (node["x-mode"]) { - clone_3["x-mode"] = node["x-mode"]; - } - result = clone_3; - } - else if (isDirective(node)) { - var instruction = new ProcessingInstruction(node.name, node.data); - if (node["x-name"] != null) { - instruction["x-name"] = node["x-name"]; - instruction["x-publicId"] = node["x-publicId"]; - instruction["x-systemId"] = node["x-systemId"]; - } - result = instruction; - } - else { - throw new Error("Not implemented yet: ".concat(node.type)); - } - result.startIndex = node.startIndex; - result.endIndex = node.endIndex; - if (node.sourceCodeLocation != null) { - result.sourceCodeLocation = node.sourceCodeLocation; - } - return result; -} -exports.cloneNode = cloneNode; -function cloneChildren(childs) { - var children = childs.map(function (child) { return cloneNode(child, true); }); - for (var i = 1; i < children.length; i++) { - children[i].prev = children[i - 1]; - children[i - 1].next = children[i]; - } - return children; -} - - -/***/ }), - -/***/ "./node_modules/domhandler/node_modules/domelementtype/lib/index.js": -/*!**************************************************************************!*\ - !*** ./node_modules/domhandler/node_modules/domelementtype/lib/index.js ***! - \**************************************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Doctype = exports.CDATA = exports.Tag = exports.Style = exports.Script = exports.Comment = exports.Directive = exports.Text = exports.Root = exports.isTag = exports.ElementType = void 0; -/** Types of elements found in htmlparser2's DOM */ -var ElementType; -(function (ElementType) { - /** Type for the root element of a document */ - ElementType["Root"] = "root"; - /** Type for Text */ - ElementType["Text"] = "text"; - /** Type for */ - ElementType["Directive"] = "directive"; - /** Type for */ - ElementType["Comment"] = "comment"; - /** Type for `. - this.sequenceIndex = Number(c === CharCodes.Lt); - } - }; - Tokenizer.prototype.stateCDATASequence = function (c) { - if (c === Sequences.Cdata[this.sequenceIndex]) { - if (++this.sequenceIndex === Sequences.Cdata.length) { - this.state = State.InCommentLike; - this.currentSequence = Sequences.CdataEnd; - this.sequenceIndex = 0; - this.sectionStart = this.index + 1; - } - } - else { - this.sequenceIndex = 0; - this.state = State.InDeclaration; - this.stateInDeclaration(c); // Reconsume the character - } - }; - /** - * When we wait for one specific character, we can speed things up - * by skipping through the buffer until we find it. - * - * @returns Whether the character was found. - */ - Tokenizer.prototype.fastForwardTo = function (c) { - while (++this.index < this.buffer.length + this.offset) { - if (this.buffer.charCodeAt(this.index - this.offset) === c) { - return true; - } - } - /* - * We increment the index at the end of the `parse` loop, - * so set it to `buffer.length - 1` here. - * - * TODO: Refactor `parse` to increment index before calling states. - */ - this.index = this.buffer.length + this.offset - 1; - return false; - }; - /** - * Comments and CDATA end with `-->` and `]]>`. - * - * Their common qualities are: - * - Their end sequences have a distinct character they start with. - * - That character is then repeated, so we have to check multiple repeats. - * - All characters but the start character of the sequence can be skipped. - */ - Tokenizer.prototype.stateInCommentLike = function (c) { - if (c === this.currentSequence[this.sequenceIndex]) { - if (++this.sequenceIndex === this.currentSequence.length) { - if (this.currentSequence === Sequences.CdataEnd) { - this.cbs.oncdata(this.sectionStart, this.index, 2); - } - else { - this.cbs.oncomment(this.sectionStart, this.index, 2); - } - this.sequenceIndex = 0; - this.sectionStart = this.index + 1; - this.state = State.Text; - } - } - else if (this.sequenceIndex === 0) { - // Fast-forward to the first character of the sequence - if (this.fastForwardTo(this.currentSequence[0])) { - this.sequenceIndex = 1; - } - } - else if (c !== this.currentSequence[this.sequenceIndex - 1]) { - // Allow long sequences, eg. --->, ]]]> - this.sequenceIndex = 0; - } - }; - /** - * HTML only allows ASCII alpha characters (a-z and A-Z) at the beginning of a tag name. - * - * XML allows a lot more characters here (@see https://www.w3.org/TR/REC-xml/#NT-NameStartChar). - * We allow anything that wouldn't end the tag. - */ - Tokenizer.prototype.isTagStartChar = function (c) { - return this.xmlMode ? !isEndOfTagSection(c) : isASCIIAlpha(c); - }; - Tokenizer.prototype.startSpecial = function (sequence, offset) { - this.isSpecial = true; - this.currentSequence = sequence; - this.sequenceIndex = offset; - this.state = State.SpecialStartSequence; - }; - Tokenizer.prototype.stateBeforeTagName = function (c) { - if (c === CharCodes.ExclamationMark) { - this.state = State.BeforeDeclaration; - this.sectionStart = this.index + 1; - } - else if (c === CharCodes.Questionmark) { - this.state = State.InProcessingInstruction; - this.sectionStart = this.index + 1; - } - else if (this.isTagStartChar(c)) { - var lower = c | 0x20; - this.sectionStart = this.index; - if (!this.xmlMode && lower === Sequences.TitleEnd[2]) { - this.startSpecial(Sequences.TitleEnd, 3); - } - else { - this.state = - !this.xmlMode && lower === Sequences.ScriptEnd[2] - ? State.BeforeSpecialS - : State.InTagName; - } - } - else if (c === CharCodes.Slash) { - this.state = State.BeforeClosingTagName; - } - else { - this.state = State.Text; - this.stateText(c); - } - }; - Tokenizer.prototype.stateInTagName = function (c) { - if (isEndOfTagSection(c)) { - this.cbs.onopentagname(this.sectionStart, this.index); - this.sectionStart = -1; - this.state = State.BeforeAttributeName; - this.stateBeforeAttributeName(c); - } - }; - Tokenizer.prototype.stateBeforeClosingTagName = function (c) { - if (isWhitespace(c)) { - // Ignore - } - else if (c === CharCodes.Gt) { - this.state = State.Text; - } - else { - this.state = this.isTagStartChar(c) - ? State.InClosingTagName - : State.InSpecialComment; - this.sectionStart = this.index; - } - }; - Tokenizer.prototype.stateInClosingTagName = function (c) { - if (c === CharCodes.Gt || isWhitespace(c)) { - this.cbs.onclosetag(this.sectionStart, this.index); - this.sectionStart = -1; - this.state = State.AfterClosingTagName; - this.stateAfterClosingTagName(c); - } - }; - Tokenizer.prototype.stateAfterClosingTagName = function (c) { - // Skip everything until ">" - if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) { - this.state = State.Text; - this.sectionStart = this.index + 1; - } - }; - Tokenizer.prototype.stateBeforeAttributeName = function (c) { - if (c === CharCodes.Gt) { - this.cbs.onopentagend(this.index); - if (this.isSpecial) { - this.state = State.InSpecialTag; - this.sequenceIndex = 0; - } - else { - this.state = State.Text; - } - this.baseState = this.state; - this.sectionStart = this.index + 1; - } - else if (c === CharCodes.Slash) { - this.state = State.InSelfClosingTag; - } - else if (!isWhitespace(c)) { - this.state = State.InAttributeName; - this.sectionStart = this.index; - } - }; - Tokenizer.prototype.stateInSelfClosingTag = function (c) { - if (c === CharCodes.Gt) { - this.cbs.onselfclosingtag(this.index); - this.state = State.Text; - this.baseState = State.Text; - this.sectionStart = this.index + 1; - this.isSpecial = false; // Reset special state, in case of self-closing special tags - } - else if (!isWhitespace(c)) { - this.state = State.BeforeAttributeName; - this.stateBeforeAttributeName(c); - } - }; - Tokenizer.prototype.stateInAttributeName = function (c) { - if (c === CharCodes.Eq || isEndOfTagSection(c)) { - this.cbs.onattribname(this.sectionStart, this.index); - this.sectionStart = -1; - this.state = State.AfterAttributeName; - this.stateAfterAttributeName(c); - } - }; - Tokenizer.prototype.stateAfterAttributeName = function (c) { - if (c === CharCodes.Eq) { - this.state = State.BeforeAttributeValue; - } - else if (c === CharCodes.Slash || c === CharCodes.Gt) { - this.cbs.onattribend(QuoteType.NoValue, this.index); - this.state = State.BeforeAttributeName; - this.stateBeforeAttributeName(c); - } - else if (!isWhitespace(c)) { - this.cbs.onattribend(QuoteType.NoValue, this.index); - this.state = State.InAttributeName; - this.sectionStart = this.index; - } - }; - Tokenizer.prototype.stateBeforeAttributeValue = function (c) { - if (c === CharCodes.DoubleQuote) { - this.state = State.InAttributeValueDq; - this.sectionStart = this.index + 1; - } - else if (c === CharCodes.SingleQuote) { - this.state = State.InAttributeValueSq; - this.sectionStart = this.index + 1; - } - else if (!isWhitespace(c)) { - this.sectionStart = this.index; - this.state = State.InAttributeValueNq; - this.stateInAttributeValueNoQuotes(c); // Reconsume token - } - }; - Tokenizer.prototype.handleInAttributeValue = function (c, quote) { - if (c === quote || - (!this.decodeEntities && this.fastForwardTo(quote))) { - this.cbs.onattribdata(this.sectionStart, this.index); - this.sectionStart = -1; - this.cbs.onattribend(quote === CharCodes.DoubleQuote - ? QuoteType.Double - : QuoteType.Single, this.index); - this.state = State.BeforeAttributeName; - } - else if (this.decodeEntities && c === CharCodes.Amp) { - this.baseState = this.state; - this.state = State.BeforeEntity; - } - }; - Tokenizer.prototype.stateInAttributeValueDoubleQuotes = function (c) { - this.handleInAttributeValue(c, CharCodes.DoubleQuote); - }; - Tokenizer.prototype.stateInAttributeValueSingleQuotes = function (c) { - this.handleInAttributeValue(c, CharCodes.SingleQuote); - }; - Tokenizer.prototype.stateInAttributeValueNoQuotes = function (c) { - if (isWhitespace(c) || c === CharCodes.Gt) { - this.cbs.onattribdata(this.sectionStart, this.index); - this.sectionStart = -1; - this.cbs.onattribend(QuoteType.Unquoted, this.index); - this.state = State.BeforeAttributeName; - this.stateBeforeAttributeName(c); - } - else if (this.decodeEntities && c === CharCodes.Amp) { - this.baseState = this.state; - this.state = State.BeforeEntity; - } - }; - Tokenizer.prototype.stateBeforeDeclaration = function (c) { - if (c === CharCodes.OpeningSquareBracket) { - this.state = State.CDATASequence; - this.sequenceIndex = 0; - } - else { - this.state = - c === CharCodes.Dash - ? State.BeforeComment - : State.InDeclaration; - } - }; - Tokenizer.prototype.stateInDeclaration = function (c) { - if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) { - this.cbs.ondeclaration(this.sectionStart, this.index); - this.state = State.Text; - this.sectionStart = this.index + 1; - } - }; - Tokenizer.prototype.stateInProcessingInstruction = function (c) { - if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) { - this.cbs.onprocessinginstruction(this.sectionStart, this.index); - this.state = State.Text; - this.sectionStart = this.index + 1; - } - }; - Tokenizer.prototype.stateBeforeComment = function (c) { - if (c === CharCodes.Dash) { - this.state = State.InCommentLike; - this.currentSequence = Sequences.CommentEnd; - // Allow short comments (eg. ) - this.sequenceIndex = 2; - this.sectionStart = this.index + 1; - } - else { - this.state = State.InDeclaration; - } - }; - Tokenizer.prototype.stateInSpecialComment = function (c) { - if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) { - this.cbs.oncomment(this.sectionStart, this.index, 0); - this.state = State.Text; - this.sectionStart = this.index + 1; - } - }; - Tokenizer.prototype.stateBeforeSpecialS = function (c) { - var lower = c | 0x20; - if (lower === Sequences.ScriptEnd[3]) { - this.startSpecial(Sequences.ScriptEnd, 4); - } - else if (lower === Sequences.StyleEnd[3]) { - this.startSpecial(Sequences.StyleEnd, 4); - } - else { - this.state = State.InTagName; - this.stateInTagName(c); // Consume the token again - } - }; - Tokenizer.prototype.stateBeforeEntity = function (c) { - // Start excess with 1 to include the '&' - this.entityExcess = 1; - this.entityResult = 0; - if (c === CharCodes.Num) { - this.state = State.BeforeNumericEntity; - } - else if (c === CharCodes.Amp) { - // We have two `&` characters in a row. Stay in the current state. - } - else { - this.trieIndex = 0; - this.trieCurrent = this.entityTrie[0]; - this.state = State.InNamedEntity; - this.stateInNamedEntity(c); - } - }; - Tokenizer.prototype.stateInNamedEntity = function (c) { - this.entityExcess += 1; - this.trieIndex = (0, decode_js_1.determineBranch)(this.entityTrie, this.trieCurrent, this.trieIndex + 1, c); - if (this.trieIndex < 0) { - this.emitNamedEntity(); - this.index--; - return; - } - this.trieCurrent = this.entityTrie[this.trieIndex]; - var masked = this.trieCurrent & decode_js_1.BinTrieFlags.VALUE_LENGTH; - // If the branch is a value, store it and continue - if (masked) { - // The mask is the number of bytes of the value, including the current byte. - var valueLength = (masked >> 14) - 1; - // If we have a legacy entity while parsing strictly, just skip the number of bytes - if (!this.allowLegacyEntity() && c !== CharCodes.Semi) { - this.trieIndex += valueLength; - } - else { - // Add 1 as we have already incremented the excess - var entityStart = this.index - this.entityExcess + 1; - if (entityStart > this.sectionStart) { - this.emitPartial(this.sectionStart, entityStart); - } - // If this is a surrogate pair, consume the next two bytes - this.entityResult = this.trieIndex; - this.trieIndex += valueLength; - this.entityExcess = 0; - this.sectionStart = this.index + 1; - if (valueLength === 0) { - this.emitNamedEntity(); - } - } - } - }; - Tokenizer.prototype.emitNamedEntity = function () { - this.state = this.baseState; - if (this.entityResult === 0) { - return; - } - var valueLength = (this.entityTrie[this.entityResult] & decode_js_1.BinTrieFlags.VALUE_LENGTH) >> - 14; - switch (valueLength) { - case 1: - this.emitCodePoint(this.entityTrie[this.entityResult] & - ~decode_js_1.BinTrieFlags.VALUE_LENGTH); - break; - case 2: - this.emitCodePoint(this.entityTrie[this.entityResult + 1]); - break; - case 3: { - this.emitCodePoint(this.entityTrie[this.entityResult + 1]); - this.emitCodePoint(this.entityTrie[this.entityResult + 2]); - } - } - }; - Tokenizer.prototype.stateBeforeNumericEntity = function (c) { - if ((c | 0x20) === CharCodes.LowerX) { - this.entityExcess++; - this.state = State.InHexEntity; - } - else { - this.state = State.InNumericEntity; - this.stateInNumericEntity(c); - } - }; - Tokenizer.prototype.emitNumericEntity = function (strict) { - var entityStart = this.index - this.entityExcess - 1; - var numberStart = entityStart + 2 + Number(this.state === State.InHexEntity); - if (numberStart !== this.index) { - // Emit leading data if any - if (entityStart > this.sectionStart) { - this.emitPartial(this.sectionStart, entityStart); - } - this.sectionStart = this.index + Number(strict); - this.emitCodePoint((0, decode_js_1.replaceCodePoint)(this.entityResult)); - } - this.state = this.baseState; - }; - Tokenizer.prototype.stateInNumericEntity = function (c) { - if (c === CharCodes.Semi) { - this.emitNumericEntity(true); - } - else if (isNumber(c)) { - this.entityResult = this.entityResult * 10 + (c - CharCodes.Zero); - this.entityExcess++; - } - else { - if (this.allowLegacyEntity()) { - this.emitNumericEntity(false); - } - else { - this.state = this.baseState; - } - this.index--; - } - }; - Tokenizer.prototype.stateInHexEntity = function (c) { - if (c === CharCodes.Semi) { - this.emitNumericEntity(true); - } - else if (isNumber(c)) { - this.entityResult = this.entityResult * 16 + (c - CharCodes.Zero); - this.entityExcess++; - } - else if (isHexDigit(c)) { - this.entityResult = - this.entityResult * 16 + ((c | 0x20) - CharCodes.LowerA + 10); - this.entityExcess++; - } - else { - if (this.allowLegacyEntity()) { - this.emitNumericEntity(false); - } - else { - this.state = this.baseState; - } - this.index--; - } - }; - Tokenizer.prototype.allowLegacyEntity = function () { - return (!this.xmlMode && - (this.baseState === State.Text || - this.baseState === State.InSpecialTag)); - }; - /** - * Remove data that has already been consumed from the buffer. - */ - Tokenizer.prototype.cleanup = function () { - // If we are inside of text or attributes, emit what we already have. - if (this.running && this.sectionStart !== this.index) { - if (this.state === State.Text || - (this.state === State.InSpecialTag && this.sequenceIndex === 0)) { - this.cbs.ontext(this.sectionStart, this.index); - this.sectionStart = this.index; - } - else if (this.state === State.InAttributeValueDq || - this.state === State.InAttributeValueSq || - this.state === State.InAttributeValueNq) { - this.cbs.onattribdata(this.sectionStart, this.index); - this.sectionStart = this.index; - } - } - }; - Tokenizer.prototype.shouldContinue = function () { - return this.index < this.buffer.length + this.offset && this.running; - }; - /** - * Iterates through the buffer, calling the function corresponding to the current state. - * - * States that are more likely to be hit are higher up, as a performance improvement. - */ - Tokenizer.prototype.parse = function () { - while (this.shouldContinue()) { - var c = this.buffer.charCodeAt(this.index - this.offset); - if (this.state === State.Text) { - this.stateText(c); - } - else if (this.state === State.SpecialStartSequence) { - this.stateSpecialStartSequence(c); - } - else if (this.state === State.InSpecialTag) { - this.stateInSpecialTag(c); - } - else if (this.state === State.CDATASequence) { - this.stateCDATASequence(c); - } - else if (this.state === State.InAttributeValueDq) { - this.stateInAttributeValueDoubleQuotes(c); - } - else if (this.state === State.InAttributeName) { - this.stateInAttributeName(c); - } - else if (this.state === State.InCommentLike) { - this.stateInCommentLike(c); - } - else if (this.state === State.InSpecialComment) { - this.stateInSpecialComment(c); - } - else if (this.state === State.BeforeAttributeName) { - this.stateBeforeAttributeName(c); - } - else if (this.state === State.InTagName) { - this.stateInTagName(c); - } - else if (this.state === State.InClosingTagName) { - this.stateInClosingTagName(c); - } - else if (this.state === State.BeforeTagName) { - this.stateBeforeTagName(c); - } - else if (this.state === State.AfterAttributeName) { - this.stateAfterAttributeName(c); - } - else if (this.state === State.InAttributeValueSq) { - this.stateInAttributeValueSingleQuotes(c); - } - else if (this.state === State.BeforeAttributeValue) { - this.stateBeforeAttributeValue(c); - } - else if (this.state === State.BeforeClosingTagName) { - this.stateBeforeClosingTagName(c); - } - else if (this.state === State.AfterClosingTagName) { - this.stateAfterClosingTagName(c); - } - else if (this.state === State.BeforeSpecialS) { - this.stateBeforeSpecialS(c); - } - else if (this.state === State.InAttributeValueNq) { - this.stateInAttributeValueNoQuotes(c); - } - else if (this.state === State.InSelfClosingTag) { - this.stateInSelfClosingTag(c); - } - else if (this.state === State.InDeclaration) { - this.stateInDeclaration(c); - } - else if (this.state === State.BeforeDeclaration) { - this.stateBeforeDeclaration(c); - } - else if (this.state === State.BeforeComment) { - this.stateBeforeComment(c); - } - else if (this.state === State.InProcessingInstruction) { - this.stateInProcessingInstruction(c); - } - else if (this.state === State.InNamedEntity) { - this.stateInNamedEntity(c); - } - else if (this.state === State.BeforeEntity) { - this.stateBeforeEntity(c); - } - else if (this.state === State.InHexEntity) { - this.stateInHexEntity(c); - } - else if (this.state === State.InNumericEntity) { - this.stateInNumericEntity(c); - } - else { - // `this._state === State.BeforeNumericEntity` - this.stateBeforeNumericEntity(c); - } - this.index++; - } - this.cleanup(); - }; - Tokenizer.prototype.finish = function () { - if (this.state === State.InNamedEntity) { - this.emitNamedEntity(); - } - // If there is remaining data, emit it in a reasonable way - if (this.sectionStart < this.index) { - this.handleTrailingData(); - } - this.cbs.onend(); - }; - /** Handle any trailing data. */ - Tokenizer.prototype.handleTrailingData = function () { - var endIndex = this.buffer.length + this.offset; - if (this.state === State.InCommentLike) { - if (this.currentSequence === Sequences.CdataEnd) { - this.cbs.oncdata(this.sectionStart, endIndex, 0); - } - else { - this.cbs.oncomment(this.sectionStart, endIndex, 0); - } - } - else if (this.state === State.InNumericEntity && - this.allowLegacyEntity()) { - this.emitNumericEntity(false); - // All trailing data will have been consumed - } - else if (this.state === State.InHexEntity && - this.allowLegacyEntity()) { - this.emitNumericEntity(false); - // All trailing data will have been consumed - } - else if (this.state === State.InTagName || - this.state === State.BeforeAttributeName || - this.state === State.BeforeAttributeValue || - this.state === State.AfterAttributeName || - this.state === State.InAttributeName || - this.state === State.InAttributeValueSq || - this.state === State.InAttributeValueDq || - this.state === State.InAttributeValueNq || - this.state === State.InClosingTagName) { - /* - * If we are currently in an opening or closing tag, us not calling the - * respective callback signals that the tag should be ignored. - */ - } - else { - this.cbs.ontext(this.sectionStart, endIndex); - } - }; - Tokenizer.prototype.emitPartial = function (start, endIndex) { - if (this.baseState !== State.Text && - this.baseState !== State.InSpecialTag) { - this.cbs.onattribdata(start, endIndex); - } - else { - this.cbs.ontext(start, endIndex); - } - }; - Tokenizer.prototype.emitCodePoint = function (cp) { - if (this.baseState !== State.Text && - this.baseState !== State.InSpecialTag) { - this.cbs.onattribentity(cp); - } - else { - this.cbs.ontextentity(cp); - } - }; - return Tokenizer; -}()); -exports["default"] = Tokenizer; -//# sourceMappingURL=Tokenizer.js.map - -/***/ }), - -/***/ "./node_modules/htmlparser2/lib/index.js": -/*!***********************************************!*\ - !*** ./node_modules/htmlparser2/lib/index.js ***! - \***********************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.DefaultHandler = exports.DomUtils = exports.parseFeed = exports.getFeed = exports.ElementType = exports.Tokenizer = exports.createDomStream = exports.parseDOM = exports.parseDocument = exports.DomHandler = exports.Parser = void 0; -var Parser_js_1 = __webpack_require__(/*! ./Parser.js */ "./node_modules/htmlparser2/lib/Parser.js"); -Object.defineProperty(exports, "Parser", ({ enumerable: true, get: function () { return Parser_js_1.Parser; } })); -var domhandler_1 = __webpack_require__(/*! domhandler */ "./node_modules/domhandler/lib/index.js"); -Object.defineProperty(exports, "DomHandler", ({ enumerable: true, get: function () { return domhandler_1.DomHandler; } })); -Object.defineProperty(exports, "DefaultHandler", ({ enumerable: true, get: function () { return domhandler_1.DomHandler; } })); -// Helper methods -/** - * Parses the data, returns the resulting document. - * - * @param data The data that should be parsed. - * @param options Optional options for the parser and DOM builder. - */ -function parseDocument(data, options) { - var handler = new domhandler_1.DomHandler(undefined, options); - new Parser_js_1.Parser(handler, options).end(data); - return handler.root; -} -exports.parseDocument = parseDocument; -/** - * Parses data, returns an array of the root nodes. - * - * Note that the root nodes still have a `Document` node as their parent. - * Use `parseDocument` to get the `Document` node instead. - * - * @param data The data that should be parsed. - * @param options Optional options for the parser and DOM builder. - * @deprecated Use `parseDocument` instead. - */ -function parseDOM(data, options) { - return parseDocument(data, options).children; -} -exports.parseDOM = parseDOM; -/** - * Creates a parser instance, with an attached DOM handler. - * - * @param cb A callback that will be called once parsing has been completed. - * @param options Optional options for the parser and DOM builder. - * @param elementCb An optional callback that will be called every time a tag has been completed inside of the DOM. - */ -function createDomStream(cb, options, elementCb) { - var handler = new domhandler_1.DomHandler(cb, options, elementCb); - return new Parser_js_1.Parser(handler, options); -} -exports.createDomStream = createDomStream; -var Tokenizer_js_1 = __webpack_require__(/*! ./Tokenizer.js */ "./node_modules/htmlparser2/lib/Tokenizer.js"); -Object.defineProperty(exports, "Tokenizer", ({ enumerable: true, get: function () { return __importDefault(Tokenizer_js_1).default; } })); -/* - * All of the following exports exist for backwards-compatibility. - * They should probably be removed eventually. - */ -var ElementType = __importStar(__webpack_require__(/*! domelementtype */ "./node_modules/htmlparser2/node_modules/domelementtype/lib/index.js")); -exports.ElementType = ElementType; -var domutils_1 = __webpack_require__(/*! domutils */ "./node_modules/htmlparser2/node_modules/domutils/lib/index.js"); -Object.defineProperty(exports, "getFeed", ({ enumerable: true, get: function () { return domutils_1.getFeed; } })); -/** - * Parse a feed. - * - * @param feed The feed that should be parsed, as a string. - * @param options Optionally, options for parsing. When using this, you should set `xmlMode` to `true`. - */ -function parseFeed(feed, options) { - if (options === void 0) { options = { xmlMode: true }; } - return (0, domutils_1.getFeed)(parseDOM(feed, options)); -} -exports.parseFeed = parseFeed; -exports.DomUtils = __importStar(__webpack_require__(/*! domutils */ "./node_modules/htmlparser2/node_modules/domutils/lib/index.js")); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ "./node_modules/htmlparser2/node_modules/dom-serializer/lib/foreignNames.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/htmlparser2/node_modules/dom-serializer/lib/foreignNames.js ***! - \**********************************************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.attributeNames = exports.elementNames = void 0; -exports.elementNames = new Map([ - "altGlyph", - "altGlyphDef", - "altGlyphItem", - "animateColor", - "animateMotion", - "animateTransform", - "clipPath", - "feBlend", - "feColorMatrix", - "feComponentTransfer", - "feComposite", - "feConvolveMatrix", - "feDiffuseLighting", - "feDisplacementMap", - "feDistantLight", - "feDropShadow", - "feFlood", - "feFuncA", - "feFuncB", - "feFuncG", - "feFuncR", - "feGaussianBlur", - "feImage", - "feMerge", - "feMergeNode", - "feMorphology", - "feOffset", - "fePointLight", - "feSpecularLighting", - "feSpotLight", - "feTile", - "feTurbulence", - "foreignObject", - "glyphRef", - "linearGradient", - "radialGradient", - "textPath", -].map(function (val) { return [val.toLowerCase(), val]; })); -exports.attributeNames = new Map([ - "definitionURL", - "attributeName", - "attributeType", - "baseFrequency", - "baseProfile", - "calcMode", - "clipPathUnits", - "diffuseConstant", - "edgeMode", - "filterUnits", - "glyphRef", - "gradientTransform", - "gradientUnits", - "kernelMatrix", - "kernelUnitLength", - "keyPoints", - "keySplines", - "keyTimes", - "lengthAdjust", - "limitingConeAngle", - "markerHeight", - "markerUnits", - "markerWidth", - "maskContentUnits", - "maskUnits", - "numOctaves", - "pathLength", - "patternContentUnits", - "patternTransform", - "patternUnits", - "pointsAtX", - "pointsAtY", - "pointsAtZ", - "preserveAlpha", - "preserveAspectRatio", - "primitiveUnits", - "refX", - "refY", - "repeatCount", - "repeatDur", - "requiredExtensions", - "requiredFeatures", - "specularConstant", - "specularExponent", - "spreadMethod", - "startOffset", - "stdDeviation", - "stitchTiles", - "surfaceScale", - "systemLanguage", - "tableValues", - "targetX", - "targetY", - "textLength", - "viewBox", - "viewTarget", - "xChannelSelector", - "yChannelSelector", - "zoomAndPan", -].map(function (val) { return [val.toLowerCase(), val]; })); - - -/***/ }), - -/***/ "./node_modules/htmlparser2/node_modules/dom-serializer/lib/index.js": -/*!***************************************************************************!*\ - !*** ./node_modules/htmlparser2/node_modules/dom-serializer/lib/index.js ***! - \***************************************************************************/ -/***/ (function(__unused_webpack_module, exports, __webpack_require__) { - -"use strict"; - -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.render = void 0; -/* - * Module dependencies - */ -var ElementType = __importStar(__webpack_require__(/*! domelementtype */ "./node_modules/htmlparser2/node_modules/domelementtype/lib/index.js")); -var entities_1 = __webpack_require__(/*! entities */ "./node_modules/htmlparser2/node_modules/entities/lib/index.js"); -/** - * Mixed-case SVG and MathML tags & attributes - * recognized by the HTML parser. - * - * @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign - */ -var foreignNames_js_1 = __webpack_require__(/*! ./foreignNames.js */ "./node_modules/htmlparser2/node_modules/dom-serializer/lib/foreignNames.js"); -var unencodedElements = new Set([ - "style", - "script", - "xmp", - "iframe", - "noembed", - "noframes", - "plaintext", - "noscript", -]); -function replaceQuotes(value) { - return value.replace(/"/g, """); -} -/** - * Format attributes - */ -function formatAttributes(attributes, opts) { - var _a; - if (!attributes) - return; - var encode = ((_a = opts.encodeEntities) !== null && _a !== void 0 ? _a : opts.decodeEntities) === false - ? replaceQuotes - : opts.xmlMode || opts.encodeEntities !== "utf8" - ? entities_1.encodeXML - : entities_1.escapeAttribute; - return Object.keys(attributes) - .map(function (key) { - var _a, _b; - var value = (_a = attributes[key]) !== null && _a !== void 0 ? _a : ""; - if (opts.xmlMode === "foreign") { - /* Fix up mixed-case attribute names */ - key = (_b = foreignNames_js_1.attributeNames.get(key)) !== null && _b !== void 0 ? _b : key; - } - if (!opts.emptyAttrs && !opts.xmlMode && value === "") { - return key; - } - return "".concat(key, "=\"").concat(encode(value), "\""); - }) - .join(" "); -} -/** - * Self-enclosing tags - */ -var singleTag = new Set([ - "area", - "base", - "basefont", - "br", - "col", - "command", - "embed", - "frame", - "hr", - "img", - "input", - "isindex", - "keygen", - "link", - "meta", - "param", - "source", - "track", - "wbr", -]); -/** - * Renders a DOM node or an array of DOM nodes to a string. - * - * Can be thought of as the equivalent of the `outerHTML` of the passed node(s). - * - * @param node Node to be rendered. - * @param options Changes serialization behavior - */ -function render(node, options) { - if (options === void 0) { options = {}; } - var nodes = "length" in node ? node : [node]; - var output = ""; - for (var i = 0; i < nodes.length; i++) { - output += renderNode(nodes[i], options); - } - return output; -} -exports.render = render; -exports["default"] = render; -function renderNode(node, options) { - switch (node.type) { - case ElementType.Root: - return render(node.children, options); - // @ts-expect-error We don't use `Doctype` yet - case ElementType.Doctype: - case ElementType.Directive: - return renderDirective(node); - case ElementType.Comment: - return renderComment(node); - case ElementType.CDATA: - return renderCdata(node); - case ElementType.Script: - case ElementType.Style: - case ElementType.Tag: - return renderTag(node, options); - case ElementType.Text: - return renderText(node, options); - } -} -var foreignModeIntegrationPoints = new Set([ - "mi", - "mo", - "mn", - "ms", - "mtext", - "annotation-xml", - "foreignObject", - "desc", - "title", -]); -var foreignElements = new Set(["svg", "math"]); -function renderTag(elem, opts) { - var _a; - // Handle SVG / MathML in HTML - if (opts.xmlMode === "foreign") { - /* Fix up mixed-case element names */ - elem.name = (_a = foreignNames_js_1.elementNames.get(elem.name)) !== null && _a !== void 0 ? _a : elem.name; - /* Exit foreign mode at integration points */ - if (elem.parent && - foreignModeIntegrationPoints.has(elem.parent.name)) { - opts = __assign(__assign({}, opts), { xmlMode: false }); - } - } - if (!opts.xmlMode && foreignElements.has(elem.name)) { - opts = __assign(__assign({}, opts), { xmlMode: "foreign" }); - } - var tag = "<".concat(elem.name); - var attribs = formatAttributes(elem.attribs, opts); - if (attribs) { - tag += " ".concat(attribs); - } - if (elem.children.length === 0 && - (opts.xmlMode - ? // In XML mode or foreign mode, and user hasn't explicitly turned off self-closing tags - opts.selfClosingTags !== false - : // User explicitly asked for self-closing tags, even in HTML mode - opts.selfClosingTags && singleTag.has(elem.name))) { - if (!opts.xmlMode) - tag += " "; - tag += "/>"; - } - else { - tag += ">"; - if (elem.children.length > 0) { - tag += render(elem.children, opts); - } - if (opts.xmlMode || !singleTag.has(elem.name)) { - tag += ""); - } - } - return tag; -} -function renderDirective(elem) { - return "<".concat(elem.data, ">"); -} -function renderText(elem, opts) { - var _a; - var data = elem.data || ""; - // If entities weren't decoded, no need to encode them back - if (((_a = opts.encodeEntities) !== null && _a !== void 0 ? _a : opts.decodeEntities) !== false && - !(!opts.xmlMode && - elem.parent && - unencodedElements.has(elem.parent.name))) { - data = - opts.xmlMode || opts.encodeEntities !== "utf8" - ? (0, entities_1.encodeXML)(data) - : (0, entities_1.escapeText)(data); - } - return data; -} -function renderCdata(elem) { - return ""); -} -function renderComment(elem) { - return ""); -} - - -/***/ }), - -/***/ "./node_modules/htmlparser2/node_modules/domelementtype/lib/index.js": -/*!***************************************************************************!*\ - !*** ./node_modules/htmlparser2/node_modules/domelementtype/lib/index.js ***! - \***************************************************************************/ -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Doctype = exports.CDATA = exports.Tag = exports.Style = exports.Script = exports.Comment = exports.Directive = exports.Text = exports.Root = exports.isTag = exports.ElementType = void 0; -/** Types of elements found in htmlparser2's DOM */ -var ElementType; -(function (ElementType) { - /** Type for the root element of a document */ - ElementType["Root"] = "root"; - /** Type for Text */ - ElementType["Text"] = "text"; - /** Type for */ - ElementType["Directive"] = "directive"; - /** Type for */ - ElementType["Comment"] = "comment"; - /** Type for `.\n this.sequenceIndex = Number(c === CharCodes.Lt);\n }\n };\n Tokenizer.prototype.stateCDATASequence = function (c) {\n if (c === Sequences.Cdata[this.sequenceIndex]) {\n if (++this.sequenceIndex === Sequences.Cdata.length) {\n this.state = State.InCommentLike;\n this.currentSequence = Sequences.CdataEnd;\n this.sequenceIndex = 0;\n this.sectionStart = this.index + 1;\n }\n }\n else {\n this.sequenceIndex = 0;\n this.state = State.InDeclaration;\n this.stateInDeclaration(c); // Reconsume the character\n }\n };\n /**\n * When we wait for one specific character, we can speed things up\n * by skipping through the buffer until we find it.\n *\n * @returns Whether the character was found.\n */\n Tokenizer.prototype.fastForwardTo = function (c) {\n while (++this.index < this.buffer.length + this.offset) {\n if (this.buffer.charCodeAt(this.index - this.offset) === c) {\n return true;\n }\n }\n /*\n * We increment the index at the end of the `parse` loop,\n * so set it to `buffer.length - 1` here.\n *\n * TODO: Refactor `parse` to increment index before calling states.\n */\n this.index = this.buffer.length + this.offset - 1;\n return false;\n };\n /**\n * Comments and CDATA end with `-->` and `]]>`.\n *\n * Their common qualities are:\n * - Their end sequences have a distinct character they start with.\n * - That character is then repeated, so we have to check multiple repeats.\n * - All characters but the start character of the sequence can be skipped.\n */\n Tokenizer.prototype.stateInCommentLike = function (c) {\n if (c === this.currentSequence[this.sequenceIndex]) {\n if (++this.sequenceIndex === this.currentSequence.length) {\n if (this.currentSequence === Sequences.CdataEnd) {\n this.cbs.oncdata(this.sectionStart, this.index, 2);\n }\n else {\n this.cbs.oncomment(this.sectionStart, this.index, 2);\n }\n this.sequenceIndex = 0;\n this.sectionStart = this.index + 1;\n this.state = State.Text;\n }\n }\n else if (this.sequenceIndex === 0) {\n // Fast-forward to the first character of the sequence\n if (this.fastForwardTo(this.currentSequence[0])) {\n this.sequenceIndex = 1;\n }\n }\n else if (c !== this.currentSequence[this.sequenceIndex - 1]) {\n // Allow long sequences, eg. --->, ]]]>\n this.sequenceIndex = 0;\n }\n };\n /**\n * HTML only allows ASCII alpha characters (a-z and A-Z) at the beginning of a tag name.\n *\n * XML allows a lot more characters here (@see https://www.w3.org/TR/REC-xml/#NT-NameStartChar).\n * We allow anything that wouldn't end the tag.\n */\n Tokenizer.prototype.isTagStartChar = function (c) {\n return this.xmlMode ? !isEndOfTagSection(c) : isASCIIAlpha(c);\n };\n Tokenizer.prototype.startSpecial = function (sequence, offset) {\n this.isSpecial = true;\n this.currentSequence = sequence;\n this.sequenceIndex = offset;\n this.state = State.SpecialStartSequence;\n };\n Tokenizer.prototype.stateBeforeTagName = function (c) {\n if (c === CharCodes.ExclamationMark) {\n this.state = State.BeforeDeclaration;\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.Questionmark) {\n this.state = State.InProcessingInstruction;\n this.sectionStart = this.index + 1;\n }\n else if (this.isTagStartChar(c)) {\n var lower = c | 0x20;\n this.sectionStart = this.index;\n if (!this.xmlMode && lower === Sequences.TitleEnd[2]) {\n this.startSpecial(Sequences.TitleEnd, 3);\n }\n else {\n this.state =\n !this.xmlMode && lower === Sequences.ScriptEnd[2]\n ? State.BeforeSpecialS\n : State.InTagName;\n }\n }\n else if (c === CharCodes.Slash) {\n this.state = State.BeforeClosingTagName;\n }\n else {\n this.state = State.Text;\n this.stateText(c);\n }\n };\n Tokenizer.prototype.stateInTagName = function (c) {\n if (isEndOfTagSection(c)) {\n this.cbs.onopentagname(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n };\n Tokenizer.prototype.stateBeforeClosingTagName = function (c) {\n if (isWhitespace(c)) {\n // Ignore\n }\n else if (c === CharCodes.Gt) {\n this.state = State.Text;\n }\n else {\n this.state = this.isTagStartChar(c)\n ? State.InClosingTagName\n : State.InSpecialComment;\n this.sectionStart = this.index;\n }\n };\n Tokenizer.prototype.stateInClosingTagName = function (c) {\n if (c === CharCodes.Gt || isWhitespace(c)) {\n this.cbs.onclosetag(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = State.AfterClosingTagName;\n this.stateAfterClosingTagName(c);\n }\n };\n Tokenizer.prototype.stateAfterClosingTagName = function (c) {\n // Skip everything until \">\"\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n };\n Tokenizer.prototype.stateBeforeAttributeName = function (c) {\n if (c === CharCodes.Gt) {\n this.cbs.onopentagend(this.index);\n if (this.isSpecial) {\n this.state = State.InSpecialTag;\n this.sequenceIndex = 0;\n }\n else {\n this.state = State.Text;\n }\n this.baseState = this.state;\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.Slash) {\n this.state = State.InSelfClosingTag;\n }\n else if (!isWhitespace(c)) {\n this.state = State.InAttributeName;\n this.sectionStart = this.index;\n }\n };\n Tokenizer.prototype.stateInSelfClosingTag = function (c) {\n if (c === CharCodes.Gt) {\n this.cbs.onselfclosingtag(this.index);\n this.state = State.Text;\n this.baseState = State.Text;\n this.sectionStart = this.index + 1;\n this.isSpecial = false; // Reset special state, in case of self-closing special tags\n }\n else if (!isWhitespace(c)) {\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n };\n Tokenizer.prototype.stateInAttributeName = function (c) {\n if (c === CharCodes.Eq || isEndOfTagSection(c)) {\n this.cbs.onattribname(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.state = State.AfterAttributeName;\n this.stateAfterAttributeName(c);\n }\n };\n Tokenizer.prototype.stateAfterAttributeName = function (c) {\n if (c === CharCodes.Eq) {\n this.state = State.BeforeAttributeValue;\n }\n else if (c === CharCodes.Slash || c === CharCodes.Gt) {\n this.cbs.onattribend(QuoteType.NoValue, this.index);\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n else if (!isWhitespace(c)) {\n this.cbs.onattribend(QuoteType.NoValue, this.index);\n this.state = State.InAttributeName;\n this.sectionStart = this.index;\n }\n };\n Tokenizer.prototype.stateBeforeAttributeValue = function (c) {\n if (c === CharCodes.DoubleQuote) {\n this.state = State.InAttributeValueDq;\n this.sectionStart = this.index + 1;\n }\n else if (c === CharCodes.SingleQuote) {\n this.state = State.InAttributeValueSq;\n this.sectionStart = this.index + 1;\n }\n else if (!isWhitespace(c)) {\n this.sectionStart = this.index;\n this.state = State.InAttributeValueNq;\n this.stateInAttributeValueNoQuotes(c); // Reconsume token\n }\n };\n Tokenizer.prototype.handleInAttributeValue = function (c, quote) {\n if (c === quote ||\n (!this.decodeEntities && this.fastForwardTo(quote))) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.cbs.onattribend(quote === CharCodes.DoubleQuote\n ? QuoteType.Double\n : QuoteType.Single, this.index);\n this.state = State.BeforeAttributeName;\n }\n else if (this.decodeEntities && c === CharCodes.Amp) {\n this.baseState = this.state;\n this.state = State.BeforeEntity;\n }\n };\n Tokenizer.prototype.stateInAttributeValueDoubleQuotes = function (c) {\n this.handleInAttributeValue(c, CharCodes.DoubleQuote);\n };\n Tokenizer.prototype.stateInAttributeValueSingleQuotes = function (c) {\n this.handleInAttributeValue(c, CharCodes.SingleQuote);\n };\n Tokenizer.prototype.stateInAttributeValueNoQuotes = function (c) {\n if (isWhitespace(c) || c === CharCodes.Gt) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = -1;\n this.cbs.onattribend(QuoteType.Unquoted, this.index);\n this.state = State.BeforeAttributeName;\n this.stateBeforeAttributeName(c);\n }\n else if (this.decodeEntities && c === CharCodes.Amp) {\n this.baseState = this.state;\n this.state = State.BeforeEntity;\n }\n };\n Tokenizer.prototype.stateBeforeDeclaration = function (c) {\n if (c === CharCodes.OpeningSquareBracket) {\n this.state = State.CDATASequence;\n this.sequenceIndex = 0;\n }\n else {\n this.state =\n c === CharCodes.Dash\n ? State.BeforeComment\n : State.InDeclaration;\n }\n };\n Tokenizer.prototype.stateInDeclaration = function (c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.ondeclaration(this.sectionStart, this.index);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n };\n Tokenizer.prototype.stateInProcessingInstruction = function (c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.onprocessinginstruction(this.sectionStart, this.index);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n };\n Tokenizer.prototype.stateBeforeComment = function (c) {\n if (c === CharCodes.Dash) {\n this.state = State.InCommentLike;\n this.currentSequence = Sequences.CommentEnd;\n // Allow short comments (eg. )\n this.sequenceIndex = 2;\n this.sectionStart = this.index + 1;\n }\n else {\n this.state = State.InDeclaration;\n }\n };\n Tokenizer.prototype.stateInSpecialComment = function (c) {\n if (c === CharCodes.Gt || this.fastForwardTo(CharCodes.Gt)) {\n this.cbs.oncomment(this.sectionStart, this.index, 0);\n this.state = State.Text;\n this.sectionStart = this.index + 1;\n }\n };\n Tokenizer.prototype.stateBeforeSpecialS = function (c) {\n var lower = c | 0x20;\n if (lower === Sequences.ScriptEnd[3]) {\n this.startSpecial(Sequences.ScriptEnd, 4);\n }\n else if (lower === Sequences.StyleEnd[3]) {\n this.startSpecial(Sequences.StyleEnd, 4);\n }\n else {\n this.state = State.InTagName;\n this.stateInTagName(c); // Consume the token again\n }\n };\n Tokenizer.prototype.stateBeforeEntity = function (c) {\n // Start excess with 1 to include the '&'\n this.entityExcess = 1;\n this.entityResult = 0;\n if (c === CharCodes.Num) {\n this.state = State.BeforeNumericEntity;\n }\n else if (c === CharCodes.Amp) {\n // We have two `&` characters in a row. Stay in the current state.\n }\n else {\n this.trieIndex = 0;\n this.trieCurrent = this.entityTrie[0];\n this.state = State.InNamedEntity;\n this.stateInNamedEntity(c);\n }\n };\n Tokenizer.prototype.stateInNamedEntity = function (c) {\n this.entityExcess += 1;\n this.trieIndex = (0, decode_js_1.determineBranch)(this.entityTrie, this.trieCurrent, this.trieIndex + 1, c);\n if (this.trieIndex < 0) {\n this.emitNamedEntity();\n this.index--;\n return;\n }\n this.trieCurrent = this.entityTrie[this.trieIndex];\n var masked = this.trieCurrent & decode_js_1.BinTrieFlags.VALUE_LENGTH;\n // If the branch is a value, store it and continue\n if (masked) {\n // The mask is the number of bytes of the value, including the current byte.\n var valueLength = (masked >> 14) - 1;\n // If we have a legacy entity while parsing strictly, just skip the number of bytes\n if (!this.allowLegacyEntity() && c !== CharCodes.Semi) {\n this.trieIndex += valueLength;\n }\n else {\n // Add 1 as we have already incremented the excess\n var entityStart = this.index - this.entityExcess + 1;\n if (entityStart > this.sectionStart) {\n this.emitPartial(this.sectionStart, entityStart);\n }\n // If this is a surrogate pair, consume the next two bytes\n this.entityResult = this.trieIndex;\n this.trieIndex += valueLength;\n this.entityExcess = 0;\n this.sectionStart = this.index + 1;\n if (valueLength === 0) {\n this.emitNamedEntity();\n }\n }\n }\n };\n Tokenizer.prototype.emitNamedEntity = function () {\n this.state = this.baseState;\n if (this.entityResult === 0) {\n return;\n }\n var valueLength = (this.entityTrie[this.entityResult] & decode_js_1.BinTrieFlags.VALUE_LENGTH) >>\n 14;\n switch (valueLength) {\n case 1:\n this.emitCodePoint(this.entityTrie[this.entityResult] &\n ~decode_js_1.BinTrieFlags.VALUE_LENGTH);\n break;\n case 2:\n this.emitCodePoint(this.entityTrie[this.entityResult + 1]);\n break;\n case 3: {\n this.emitCodePoint(this.entityTrie[this.entityResult + 1]);\n this.emitCodePoint(this.entityTrie[this.entityResult + 2]);\n }\n }\n };\n Tokenizer.prototype.stateBeforeNumericEntity = function (c) {\n if ((c | 0x20) === CharCodes.LowerX) {\n this.entityExcess++;\n this.state = State.InHexEntity;\n }\n else {\n this.state = State.InNumericEntity;\n this.stateInNumericEntity(c);\n }\n };\n Tokenizer.prototype.emitNumericEntity = function (strict) {\n var entityStart = this.index - this.entityExcess - 1;\n var numberStart = entityStart + 2 + Number(this.state === State.InHexEntity);\n if (numberStart !== this.index) {\n // Emit leading data if any\n if (entityStart > this.sectionStart) {\n this.emitPartial(this.sectionStart, entityStart);\n }\n this.sectionStart = this.index + Number(strict);\n this.emitCodePoint((0, decode_js_1.replaceCodePoint)(this.entityResult));\n }\n this.state = this.baseState;\n };\n Tokenizer.prototype.stateInNumericEntity = function (c) {\n if (c === CharCodes.Semi) {\n this.emitNumericEntity(true);\n }\n else if (isNumber(c)) {\n this.entityResult = this.entityResult * 10 + (c - CharCodes.Zero);\n this.entityExcess++;\n }\n else {\n if (this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n }\n else {\n this.state = this.baseState;\n }\n this.index--;\n }\n };\n Tokenizer.prototype.stateInHexEntity = function (c) {\n if (c === CharCodes.Semi) {\n this.emitNumericEntity(true);\n }\n else if (isNumber(c)) {\n this.entityResult = this.entityResult * 16 + (c - CharCodes.Zero);\n this.entityExcess++;\n }\n else if (isHexDigit(c)) {\n this.entityResult =\n this.entityResult * 16 + ((c | 0x20) - CharCodes.LowerA + 10);\n this.entityExcess++;\n }\n else {\n if (this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n }\n else {\n this.state = this.baseState;\n }\n this.index--;\n }\n };\n Tokenizer.prototype.allowLegacyEntity = function () {\n return (!this.xmlMode &&\n (this.baseState === State.Text ||\n this.baseState === State.InSpecialTag));\n };\n /**\n * Remove data that has already been consumed from the buffer.\n */\n Tokenizer.prototype.cleanup = function () {\n // If we are inside of text or attributes, emit what we already have.\n if (this.running && this.sectionStart !== this.index) {\n if (this.state === State.Text ||\n (this.state === State.InSpecialTag && this.sequenceIndex === 0)) {\n this.cbs.ontext(this.sectionStart, this.index);\n this.sectionStart = this.index;\n }\n else if (this.state === State.InAttributeValueDq ||\n this.state === State.InAttributeValueSq ||\n this.state === State.InAttributeValueNq) {\n this.cbs.onattribdata(this.sectionStart, this.index);\n this.sectionStart = this.index;\n }\n }\n };\n Tokenizer.prototype.shouldContinue = function () {\n return this.index < this.buffer.length + this.offset && this.running;\n };\n /**\n * Iterates through the buffer, calling the function corresponding to the current state.\n *\n * States that are more likely to be hit are higher up, as a performance improvement.\n */\n Tokenizer.prototype.parse = function () {\n while (this.shouldContinue()) {\n var c = this.buffer.charCodeAt(this.index - this.offset);\n if (this.state === State.Text) {\n this.stateText(c);\n }\n else if (this.state === State.SpecialStartSequence) {\n this.stateSpecialStartSequence(c);\n }\n else if (this.state === State.InSpecialTag) {\n this.stateInSpecialTag(c);\n }\n else if (this.state === State.CDATASequence) {\n this.stateCDATASequence(c);\n }\n else if (this.state === State.InAttributeValueDq) {\n this.stateInAttributeValueDoubleQuotes(c);\n }\n else if (this.state === State.InAttributeName) {\n this.stateInAttributeName(c);\n }\n else if (this.state === State.InCommentLike) {\n this.stateInCommentLike(c);\n }\n else if (this.state === State.InSpecialComment) {\n this.stateInSpecialComment(c);\n }\n else if (this.state === State.BeforeAttributeName) {\n this.stateBeforeAttributeName(c);\n }\n else if (this.state === State.InTagName) {\n this.stateInTagName(c);\n }\n else if (this.state === State.InClosingTagName) {\n this.stateInClosingTagName(c);\n }\n else if (this.state === State.BeforeTagName) {\n this.stateBeforeTagName(c);\n }\n else if (this.state === State.AfterAttributeName) {\n this.stateAfterAttributeName(c);\n }\n else if (this.state === State.InAttributeValueSq) {\n this.stateInAttributeValueSingleQuotes(c);\n }\n else if (this.state === State.BeforeAttributeValue) {\n this.stateBeforeAttributeValue(c);\n }\n else if (this.state === State.BeforeClosingTagName) {\n this.stateBeforeClosingTagName(c);\n }\n else if (this.state === State.AfterClosingTagName) {\n this.stateAfterClosingTagName(c);\n }\n else if (this.state === State.BeforeSpecialS) {\n this.stateBeforeSpecialS(c);\n }\n else if (this.state === State.InAttributeValueNq) {\n this.stateInAttributeValueNoQuotes(c);\n }\n else if (this.state === State.InSelfClosingTag) {\n this.stateInSelfClosingTag(c);\n }\n else if (this.state === State.InDeclaration) {\n this.stateInDeclaration(c);\n }\n else if (this.state === State.BeforeDeclaration) {\n this.stateBeforeDeclaration(c);\n }\n else if (this.state === State.BeforeComment) {\n this.stateBeforeComment(c);\n }\n else if (this.state === State.InProcessingInstruction) {\n this.stateInProcessingInstruction(c);\n }\n else if (this.state === State.InNamedEntity) {\n this.stateInNamedEntity(c);\n }\n else if (this.state === State.BeforeEntity) {\n this.stateBeforeEntity(c);\n }\n else if (this.state === State.InHexEntity) {\n this.stateInHexEntity(c);\n }\n else if (this.state === State.InNumericEntity) {\n this.stateInNumericEntity(c);\n }\n else {\n // `this._state === State.BeforeNumericEntity`\n this.stateBeforeNumericEntity(c);\n }\n this.index++;\n }\n this.cleanup();\n };\n Tokenizer.prototype.finish = function () {\n if (this.state === State.InNamedEntity) {\n this.emitNamedEntity();\n }\n // If there is remaining data, emit it in a reasonable way\n if (this.sectionStart < this.index) {\n this.handleTrailingData();\n }\n this.cbs.onend();\n };\n /** Handle any trailing data. */\n Tokenizer.prototype.handleTrailingData = function () {\n var endIndex = this.buffer.length + this.offset;\n if (this.state === State.InCommentLike) {\n if (this.currentSequence === Sequences.CdataEnd) {\n this.cbs.oncdata(this.sectionStart, endIndex, 0);\n }\n else {\n this.cbs.oncomment(this.sectionStart, endIndex, 0);\n }\n }\n else if (this.state === State.InNumericEntity &&\n this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n // All trailing data will have been consumed\n }\n else if (this.state === State.InHexEntity &&\n this.allowLegacyEntity()) {\n this.emitNumericEntity(false);\n // All trailing data will have been consumed\n }\n else if (this.state === State.InTagName ||\n this.state === State.BeforeAttributeName ||\n this.state === State.BeforeAttributeValue ||\n this.state === State.AfterAttributeName ||\n this.state === State.InAttributeName ||\n this.state === State.InAttributeValueSq ||\n this.state === State.InAttributeValueDq ||\n this.state === State.InAttributeValueNq ||\n this.state === State.InClosingTagName) {\n /*\n * If we are currently in an opening or closing tag, us not calling the\n * respective callback signals that the tag should be ignored.\n */\n }\n else {\n this.cbs.ontext(this.sectionStart, endIndex);\n }\n };\n Tokenizer.prototype.emitPartial = function (start, endIndex) {\n if (this.baseState !== State.Text &&\n this.baseState !== State.InSpecialTag) {\n this.cbs.onattribdata(start, endIndex);\n }\n else {\n this.cbs.ontext(start, endIndex);\n }\n };\n Tokenizer.prototype.emitCodePoint = function (cp) {\n if (this.baseState !== State.Text &&\n this.baseState !== State.InSpecialTag) {\n this.cbs.onattribentity(cp);\n }\n else {\n this.cbs.ontextentity(cp);\n }\n };\n return Tokenizer;\n}());\nexports.default = Tokenizer;\n//# sourceMappingURL=Tokenizer.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DefaultHandler = exports.DomUtils = exports.parseFeed = exports.getFeed = exports.ElementType = exports.Tokenizer = exports.createDomStream = exports.parseDOM = exports.parseDocument = exports.DomHandler = exports.Parser = void 0;\nvar Parser_js_1 = require(\"./Parser.js\");\nObject.defineProperty(exports, \"Parser\", { enumerable: true, get: function () { return Parser_js_1.Parser; } });\nvar domhandler_1 = require(\"domhandler\");\nObject.defineProperty(exports, \"DomHandler\", { enumerable: true, get: function () { return domhandler_1.DomHandler; } });\nObject.defineProperty(exports, \"DefaultHandler\", { enumerable: true, get: function () { return domhandler_1.DomHandler; } });\n// Helper methods\n/**\n * Parses the data, returns the resulting document.\n *\n * @param data The data that should be parsed.\n * @param options Optional options for the parser and DOM builder.\n */\nfunction parseDocument(data, options) {\n var handler = new domhandler_1.DomHandler(undefined, options);\n new Parser_js_1.Parser(handler, options).end(data);\n return handler.root;\n}\nexports.parseDocument = parseDocument;\n/**\n * Parses data, returns an array of the root nodes.\n *\n * Note that the root nodes still have a `Document` node as their parent.\n * Use `parseDocument` to get the `Document` node instead.\n *\n * @param data The data that should be parsed.\n * @param options Optional options for the parser and DOM builder.\n * @deprecated Use `parseDocument` instead.\n */\nfunction parseDOM(data, options) {\n return parseDocument(data, options).children;\n}\nexports.parseDOM = parseDOM;\n/**\n * Creates a parser instance, with an attached DOM handler.\n *\n * @param cb A callback that will be called once parsing has been completed.\n * @param options Optional options for the parser and DOM builder.\n * @param elementCb An optional callback that will be called every time a tag has been completed inside of the DOM.\n */\nfunction createDomStream(cb, options, elementCb) {\n var handler = new domhandler_1.DomHandler(cb, options, elementCb);\n return new Parser_js_1.Parser(handler, options);\n}\nexports.createDomStream = createDomStream;\nvar Tokenizer_js_1 = require(\"./Tokenizer.js\");\nObject.defineProperty(exports, \"Tokenizer\", { enumerable: true, get: function () { return __importDefault(Tokenizer_js_1).default; } });\n/*\n * All of the following exports exist for backwards-compatibility.\n * They should probably be removed eventually.\n */\nvar ElementType = __importStar(require(\"domelementtype\"));\nexports.ElementType = ElementType;\nvar domutils_1 = require(\"domutils\");\nObject.defineProperty(exports, \"getFeed\", { enumerable: true, get: function () { return domutils_1.getFeed; } });\n/**\n * Parse a feed.\n *\n * @param feed The feed that should be parsed, as a string.\n * @param options Optionally, options for parsing. When using this, you should set `xmlMode` to `true`.\n */\nfunction parseFeed(feed, options) {\n if (options === void 0) { options = { xmlMode: true }; }\n return (0, domutils_1.getFeed)(parseDOM(feed, options));\n}\nexports.parseFeed = parseFeed;\nexports.DomUtils = __importStar(require(\"domutils\"));\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.attributeNames = exports.elementNames = void 0;\nexports.elementNames = new Map([\n \"altGlyph\",\n \"altGlyphDef\",\n \"altGlyphItem\",\n \"animateColor\",\n \"animateMotion\",\n \"animateTransform\",\n \"clipPath\",\n \"feBlend\",\n \"feColorMatrix\",\n \"feComponentTransfer\",\n \"feComposite\",\n \"feConvolveMatrix\",\n \"feDiffuseLighting\",\n \"feDisplacementMap\",\n \"feDistantLight\",\n \"feDropShadow\",\n \"feFlood\",\n \"feFuncA\",\n \"feFuncB\",\n \"feFuncG\",\n \"feFuncR\",\n \"feGaussianBlur\",\n \"feImage\",\n \"feMerge\",\n \"feMergeNode\",\n \"feMorphology\",\n \"feOffset\",\n \"fePointLight\",\n \"feSpecularLighting\",\n \"feSpotLight\",\n \"feTile\",\n \"feTurbulence\",\n \"foreignObject\",\n \"glyphRef\",\n \"linearGradient\",\n \"radialGradient\",\n \"textPath\",\n].map(function (val) { return [val.toLowerCase(), val]; }));\nexports.attributeNames = new Map([\n \"definitionURL\",\n \"attributeName\",\n \"attributeType\",\n \"baseFrequency\",\n \"baseProfile\",\n \"calcMode\",\n \"clipPathUnits\",\n \"diffuseConstant\",\n \"edgeMode\",\n \"filterUnits\",\n \"glyphRef\",\n \"gradientTransform\",\n \"gradientUnits\",\n \"kernelMatrix\",\n \"kernelUnitLength\",\n \"keyPoints\",\n \"keySplines\",\n \"keyTimes\",\n \"lengthAdjust\",\n \"limitingConeAngle\",\n \"markerHeight\",\n \"markerUnits\",\n \"markerWidth\",\n \"maskContentUnits\",\n \"maskUnits\",\n \"numOctaves\",\n \"pathLength\",\n \"patternContentUnits\",\n \"patternTransform\",\n \"patternUnits\",\n \"pointsAtX\",\n \"pointsAtY\",\n \"pointsAtZ\",\n \"preserveAlpha\",\n \"preserveAspectRatio\",\n \"primitiveUnits\",\n \"refX\",\n \"refY\",\n \"repeatCount\",\n \"repeatDur\",\n \"requiredExtensions\",\n \"requiredFeatures\",\n \"specularConstant\",\n \"specularExponent\",\n \"spreadMethod\",\n \"startOffset\",\n \"stdDeviation\",\n \"stitchTiles\",\n \"surfaceScale\",\n \"systemLanguage\",\n \"tableValues\",\n \"targetX\",\n \"targetY\",\n \"textLength\",\n \"viewBox\",\n \"viewTarget\",\n \"xChannelSelector\",\n \"yChannelSelector\",\n \"zoomAndPan\",\n].map(function (val) { return [val.toLowerCase(), val]; }));\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.render = void 0;\n/*\n * Module dependencies\n */\nvar ElementType = __importStar(require(\"domelementtype\"));\nvar entities_1 = require(\"entities\");\n/**\n * Mixed-case SVG and MathML tags & attributes\n * recognized by the HTML parser.\n *\n * @see https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inforeign\n */\nvar foreignNames_js_1 = require(\"./foreignNames.js\");\nvar unencodedElements = new Set([\n \"style\",\n \"script\",\n \"xmp\",\n \"iframe\",\n \"noembed\",\n \"noframes\",\n \"plaintext\",\n \"noscript\",\n]);\nfunction replaceQuotes(value) {\n return value.replace(/\"/g, \""\");\n}\n/**\n * Format attributes\n */\nfunction formatAttributes(attributes, opts) {\n var _a;\n if (!attributes)\n return;\n var encode = ((_a = opts.encodeEntities) !== null && _a !== void 0 ? _a : opts.decodeEntities) === false\n ? replaceQuotes\n : opts.xmlMode || opts.encodeEntities !== \"utf8\"\n ? entities_1.encodeXML\n : entities_1.escapeAttribute;\n return Object.keys(attributes)\n .map(function (key) {\n var _a, _b;\n var value = (_a = attributes[key]) !== null && _a !== void 0 ? _a : \"\";\n if (opts.xmlMode === \"foreign\") {\n /* Fix up mixed-case attribute names */\n key = (_b = foreignNames_js_1.attributeNames.get(key)) !== null && _b !== void 0 ? _b : key;\n }\n if (!opts.emptyAttrs && !opts.xmlMode && value === \"\") {\n return key;\n }\n return \"\".concat(key, \"=\\\"\").concat(encode(value), \"\\\"\");\n })\n .join(\" \");\n}\n/**\n * Self-enclosing tags\n */\nvar singleTag = new Set([\n \"area\",\n \"base\",\n \"basefont\",\n \"br\",\n \"col\",\n \"command\",\n \"embed\",\n \"frame\",\n \"hr\",\n \"img\",\n \"input\",\n \"isindex\",\n \"keygen\",\n \"link\",\n \"meta\",\n \"param\",\n \"source\",\n \"track\",\n \"wbr\",\n]);\n/**\n * Renders a DOM node or an array of DOM nodes to a string.\n *\n * Can be thought of as the equivalent of the `outerHTML` of the passed node(s).\n *\n * @param node Node to be rendered.\n * @param options Changes serialization behavior\n */\nfunction render(node, options) {\n if (options === void 0) { options = {}; }\n var nodes = \"length\" in node ? node : [node];\n var output = \"\";\n for (var i = 0; i < nodes.length; i++) {\n output += renderNode(nodes[i], options);\n }\n return output;\n}\nexports.render = render;\nexports.default = render;\nfunction renderNode(node, options) {\n switch (node.type) {\n case ElementType.Root:\n return render(node.children, options);\n // @ts-expect-error We don't use `Doctype` yet\n case ElementType.Doctype:\n case ElementType.Directive:\n return renderDirective(node);\n case ElementType.Comment:\n return renderComment(node);\n case ElementType.CDATA:\n return renderCdata(node);\n case ElementType.Script:\n case ElementType.Style:\n case ElementType.Tag:\n return renderTag(node, options);\n case ElementType.Text:\n return renderText(node, options);\n }\n}\nvar foreignModeIntegrationPoints = new Set([\n \"mi\",\n \"mo\",\n \"mn\",\n \"ms\",\n \"mtext\",\n \"annotation-xml\",\n \"foreignObject\",\n \"desc\",\n \"title\",\n]);\nvar foreignElements = new Set([\"svg\", \"math\"]);\nfunction renderTag(elem, opts) {\n var _a;\n // Handle SVG / MathML in HTML\n if (opts.xmlMode === \"foreign\") {\n /* Fix up mixed-case element names */\n elem.name = (_a = foreignNames_js_1.elementNames.get(elem.name)) !== null && _a !== void 0 ? _a : elem.name;\n /* Exit foreign mode at integration points */\n if (elem.parent &&\n foreignModeIntegrationPoints.has(elem.parent.name)) {\n opts = __assign(__assign({}, opts), { xmlMode: false });\n }\n }\n if (!opts.xmlMode && foreignElements.has(elem.name)) {\n opts = __assign(__assign({}, opts), { xmlMode: \"foreign\" });\n }\n var tag = \"<\".concat(elem.name);\n var attribs = formatAttributes(elem.attribs, opts);\n if (attribs) {\n tag += \" \".concat(attribs);\n }\n if (elem.children.length === 0 &&\n (opts.xmlMode\n ? // In XML mode or foreign mode, and user hasn't explicitly turned off self-closing tags\n opts.selfClosingTags !== false\n : // User explicitly asked for self-closing tags, even in HTML mode\n opts.selfClosingTags && singleTag.has(elem.name))) {\n if (!opts.xmlMode)\n tag += \" \";\n tag += \"/>\";\n }\n else {\n tag += \">\";\n if (elem.children.length > 0) {\n tag += render(elem.children, opts);\n }\n if (opts.xmlMode || !singleTag.has(elem.name)) {\n tag += \"\");\n }\n }\n return tag;\n}\nfunction renderDirective(elem) {\n return \"<\".concat(elem.data, \">\");\n}\nfunction renderText(elem, opts) {\n var _a;\n var data = elem.data || \"\";\n // If entities weren't decoded, no need to encode them back\n if (((_a = opts.encodeEntities) !== null && _a !== void 0 ? _a : opts.decodeEntities) !== false &&\n !(!opts.xmlMode &&\n elem.parent &&\n unencodedElements.has(elem.parent.name))) {\n data =\n opts.xmlMode || opts.encodeEntities !== \"utf8\"\n ? (0, entities_1.encodeXML)(data)\n : (0, entities_1.escapeText)(data);\n }\n return data;\n}\nfunction renderCdata(elem) {\n return \"\");\n}\nfunction renderComment(elem) {\n return \"\");\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Doctype = exports.CDATA = exports.Tag = exports.Style = exports.Script = exports.Comment = exports.Directive = exports.Text = exports.Root = exports.isTag = exports.ElementType = void 0;\n/** Types of elements found in htmlparser2's DOM */\nvar ElementType;\n(function (ElementType) {\n /** Type for the root element of a document */\n ElementType[\"Root\"] = \"root\";\n /** Type for Text */\n ElementType[\"Text\"] = \"text\";\n /** Type for */\n ElementType[\"Directive\"] = \"directive\";\n /** Type for */\n ElementType[\"Comment\"] = \"comment\";\n /** Type for