From f2021d638475b042aa92dc10c7efcb217724adc8 Mon Sep 17 00:00:00 2001 From: Kiko Beats Date: Tue, 25 May 2021 23:10:24 +0200 Subject: [PATCH] build(no-release): generate bundle --- dist/mql.js | 1309 +++++++++++++++++++++---------------------- dist/mql.js.map | 2 +- dist/mql.min.js | 4 +- dist/mql.min.js.map | 2 +- 4 files changed, 658 insertions(+), 659 deletions(-) diff --git a/dist/mql.js b/dist/mql.js index a61779e..eebcb3d 100644 --- a/dist/mql.js +++ b/dist/mql.js @@ -1,12 +1,12 @@ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('url')) : typeof define === 'function' && define.amd ? define(['url'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.mql = factory(global.require$$0)); -}(this, (function (require$$0) { 'use strict'; + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.mql = factory(global.require$$0$1)); +}(this, (function (require$$0$1) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } - var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0); + var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0$1); var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; @@ -25,11 +25,6 @@ return a; } - function createCommonjsModule(fn) { - var module = { exports: {} }; - return fn(module, module.exports), module.exports; - } - const URL$1 = commonjsGlobal.window ? window.URL : require$$0__default['default'].URL; const REGEX_HTTP_PROTOCOL = /^https?:\/\//i; @@ -41,6 +36,8 @@ } }; + var dist = {}; + function iter(output, nullish, sep, val, key) { var k, pfx = key ? (key + sep) : key; @@ -67,11 +64,7 @@ return output; } - var flattie_1 = flattie; - - var dist = { - flattie: flattie_1 - }; + dist.flattie = flattie; function encode(obj, pfx) { var k, i, tmp, str=''; @@ -123,812 +116,818 @@ decode: decode }); - var ky = createCommonjsModule(function (module, exports) { - (function (global, factory) { - module.exports = factory() ; - }(commonjsGlobal, (function () { - /*! MIT License © Sindre Sorhus */ + var require$$2 = /*@__PURE__*/getAugmentedNamespace(qss_m); - const isObject = value => value !== null && typeof value === 'object'; - const supportsAbortController = typeof globalThis.AbortController === 'function'; - const supportsStreams = typeof globalThis.ReadableStream === 'function'; - const supportsFormData = typeof globalThis.FormData === 'function'; + var lib = {exports: {}}; - const mergeHeaders = (source1, source2) => { - const result = new globalThis.Headers(source1 || {}); - const isHeadersInstance = source2 instanceof globalThis.Headers; - const source = new globalThis.Headers(source2 || {}); + var _rollupPluginShim1 = str => str; - for (const [key, value] of source) { - if ((isHeadersInstance && value === 'undefined') || value === undefined) { - result.delete(key); - } else { - result.set(key, value); - } - } + var _rollupPluginShim1$1 = /*#__PURE__*/Object.freeze({ + __proto__: null, + 'default': _rollupPluginShim1 + }); - return result; - }; + var require$$0 = /*@__PURE__*/getAugmentedNamespace(_rollupPluginShim1$1); - const deepMerge = (...sources) => { - let returnValue = {}; - let headers = {}; + const copyProperty = (to, from, property, ignoreNonConfigurable) => { + // `Function#length` should reflect the parameters of `to` not `from` since we keep its body. + // `Function#prototype` is non-writable and non-configurable so can never be modified. + if (property === 'length' || property === 'prototype') { + return; + } - for (const source of sources) { - if (Array.isArray(source)) { - if (!(Array.isArray(returnValue))) { - returnValue = []; - } + const toDescriptor = Object.getOwnPropertyDescriptor(to, property); + const fromDescriptor = Object.getOwnPropertyDescriptor(from, property); - returnValue = [...returnValue, ...source]; - } else if (isObject(source)) { - for (let [key, value] of Object.entries(source)) { - if (isObject(value) && (key in returnValue)) { - value = deepMerge(returnValue[key], value); - } + if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) { + return; + } - returnValue = {...returnValue, [key]: value}; - } + Object.defineProperty(to, property, fromDescriptor); + }; - if (isObject(source.headers)) { - headers = mergeHeaders(headers, source.headers); - } - } + // `Object.defineProperty()` throws if the property exists, is not configurable and either: + // - one its descriptors is changed + // - it is non-writable and its value is changed + const canCopyProperty = function (toDescriptor, fromDescriptor) { + return toDescriptor === undefined || toDescriptor.configurable || ( + toDescriptor.writable === fromDescriptor.writable && + toDescriptor.enumerable === fromDescriptor.enumerable && + toDescriptor.configurable === fromDescriptor.configurable && + (toDescriptor.writable || toDescriptor.value === fromDescriptor.value) + ); + }; - returnValue.headers = headers; - } + const changePrototype = (to, from) => { + const fromPrototype = Object.getPrototypeOf(from); + if (fromPrototype === Object.getPrototypeOf(to)) { + return; + } - return returnValue; - }; + Object.setPrototypeOf(to, fromPrototype); + }; - const requestMethods = [ - 'get', - 'post', - 'put', - 'patch', - 'head', - 'delete' - ]; + const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/\n${fromBody}`; - const responseTypes = { - json: 'application/json', - text: 'text/*', - formData: 'multipart/form-data', - arrayBuffer: '*/*', - blob: '*/*' - }; + const toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, 'toString'); + const toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, 'name'); - const retryMethods = [ - 'get', - 'put', - 'head', - 'delete', - 'options', - 'trace' - ]; + // We call `from.toString()` early (not lazily) to ensure `from` can be garbage collected. + // We use `bind()` instead of a closure for the same reason. + // Calling `from.toString()` early also allows caching it in case `to.toString()` is called several times. + const changeToString = (to, from, name) => { + const withName = name === '' ? '' : `with ${name.trim()}() `; + const newToString = wrappedToString.bind(null, withName, from.toString()); + // Ensure `to.toString.toString` is non-enumerable and has the same `same` + Object.defineProperty(newToString, 'name', toStringName); + Object.defineProperty(to, 'toString', {...toStringDescriptor, value: newToString}); + }; - const retryStatusCodes = [ - 408, - 413, - 429, - 500, - 502, - 503, - 504 - ]; + const mimicFn$2 = (to, from, {ignoreNonConfigurable = false} = {}) => { + const {name} = to; - const retryAfterStatusCodes = [ - 413, - 429, - 503 - ]; + for (const property of Reflect.ownKeys(from)) { + copyProperty(to, from, property, ignoreNonConfigurable); + } - const stop = Symbol('stop'); + changePrototype(to, from); + changeToString(to, from, name); - class HTTPError extends Error { - constructor(response, request, options) { - // Set the message to the status text, such as Unauthorized, - // with some fallbacks. This message should never be undefined. - super( - response.statusText || - String( - (response.status === 0 || response.status) ? - response.status : 'Unknown response error' - ) - ); - this.name = 'HTTPError'; - this.response = response; - this.request = request; - this.options = options; - } - } + return to; + }; - class TimeoutError extends Error { - constructor(request) { - super('Request timed out'); - this.name = 'TimeoutError'; - this.request = request; - } - } + var mimicFn_1 = mimicFn$2; - const delay = ms => new Promise(resolve => setTimeout(resolve, ms)); + var helpers = { + isFunction: obj => typeof obj === 'function', + isString: obj => typeof obj === 'string', + composeErrorMessage: (code, description) => `${code}, ${description}`, + inherits: (ctor, superCtor) => { + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + } + }; - // `Promise.race()` workaround (#91) - const timeout = (request, abortController, options) => - new Promise((resolve, reject) => { - const timeoutID = setTimeout(() => { - if (abortController) { - abortController.abort(); - } + const {isFunction, composeErrorMessage} = helpers; - reject(new TimeoutError(request)); - }, options.timeout); + function interfaceObject (error, ...props) { + Object.assign(error, ...props); - /* eslint-disable promise/prefer-await-to-then */ - options.fetch(request) - .then(resolve) - .catch(reject) - .then(() => { - clearTimeout(timeoutID); - }); - /* eslint-enable promise/prefer-await-to-then */ - }); + error.description = isFunction(error.message) ? error.message(error) : error.message; - const normalizeRequestMethod = input => requestMethods.includes(input) ? input.toUpperCase() : input; + error.message = error.code + ? composeErrorMessage(error.code, error.description) + : error.description; + } - const defaultRetryOptions = { - limit: 2, - methods: retryMethods, - statusCodes: retryStatusCodes, - afterStatusCodes: retryAfterStatusCodes - }; + var addErrorProps$1 = interfaceObject; - const normalizeRetryOptions = (retry = {}) => { - if (typeof retry === 'number') { - return { - ...defaultRetryOptions, - limit: retry - }; - } + const cleanStack = require$$0; + const mimicFn$1 = mimicFn_1; - if (retry.methods && !Array.isArray(retry.methods)) { - throw new Error('retry.methods must be an array'); - } + const addErrorProps = addErrorProps$1; + const {isString} = helpers; - if (retry.statusCodes && !Array.isArray(retry.statusCodes)) { - throw new Error('retry.statusCodes must be an array'); - } + function createExtendError$1 (ErrorClass, classProps) { + function ExtendError (props) { + const error = new ErrorClass(); + const errorProps = isString(props) ? {message: props} : props; + addErrorProps(error, classProps, errorProps); - return { - ...defaultRetryOptions, - ...retry, - afterStatusCodes: retryAfterStatusCodes - }; - }; + error.stack = cleanStack(error.stack); + return error + } - // The maximum value of a 32bit int (see issue #117) - const maxSafeTimeout = 2147483647; + ExtendError.prototype = ErrorClass.prototype; + mimicFn$1(ExtendError, ErrorClass); - class Ky { - constructor(input, options = {}) { - this._retryCount = 0; - this._input = input; - this._options = { - // TODO: credentials can be removed when the spec change is implemented in all browsers. Context: https://www.chromestatus.com/feature/4539473312350208 - credentials: this._input.credentials || 'same-origin', - ...options, - headers: mergeHeaders(this._input.headers, options.headers), - hooks: deepMerge({ - beforeRequest: [], - beforeRetry: [], - afterResponse: [] - }, options.hooks), - method: normalizeRequestMethod(options.method || this._input.method), - prefixUrl: String(options.prefixUrl || ''), - retry: normalizeRetryOptions(options.retry), - throwHttpErrors: options.throwHttpErrors !== false, - timeout: typeof options.timeout === 'undefined' ? 10000 : options.timeout, - fetch: options.fetch || globalThis.fetch.bind(globalThis) - }; - - if (typeof this._input !== 'string' && !(this._input instanceof URL || this._input instanceof globalThis.Request)) { - throw new TypeError('`input` must be a string, URL, or Request'); - } + return ExtendError + } - if (this._options.prefixUrl && typeof this._input === 'string') { - if (this._input.startsWith('/')) { - throw new Error('`input` must not begin with a slash when using `prefixUrl`'); - } + var createExtendError_1 = createExtendError$1; - if (!this._options.prefixUrl.endsWith('/')) { - this._options.prefixUrl += '/'; - } + const {inherits} = helpers; + const mimicFn = mimicFn_1; - this._input = this._options.prefixUrl + this._input; - } + const REGEX_CLASS_NAME = /[^0-9a-zA-Z_$]/; - if (supportsAbortController) { - this.abortController = new globalThis.AbortController(); - if (this._options.signal) { - this._options.signal.addEventListener('abort', () => { - this.abortController.abort(); - }); - } + function createError$1 (className) { + if (typeof className !== 'string') { + throw new TypeError('Expected className to be a string') + } - this._options.signal = this.abortController.signal; - } + if (REGEX_CLASS_NAME.test(className)) { + throw new Error('className contains invalid characters') + } - this.request = new globalThis.Request(this._input, this._options); + function ErrorClass () { + Object.defineProperty(this, 'name', { + configurable: true, + value: className, + writable: true + }); - if (this._options.searchParams) { - const textSearchParams = typeof this._options.searchParams === 'string' ? - this._options.searchParams.replace(/^\?/, '') : - new URLSearchParams(this._options.searchParams).toString(); - const searchParams = '?' + textSearchParams; - const url = this.request.url.replace(/(?:\?.*?)?(?=#|$)/, searchParams); + Error.captureStackTrace(this, this.constructor); + } - // To provide correct form boundary, Content-Type header should be deleted each time when new Request instantiated from another one - if (((supportsFormData && this._options.body instanceof globalThis.FormData) || this._options.body instanceof URLSearchParams) && !(this._options.headers && this._options.headers['content-type'])) { - this.request.headers.delete('content-type'); - } + inherits(ErrorClass, Error); + mimicFn(ErrorClass, Error); + return ErrorClass + } - this.request = new globalThis.Request(new globalThis.Request(url, this.request), this._options); - } + var createError_1 = createError$1; - if (this._options.json !== undefined) { - this._options.body = JSON.stringify(this._options.json); - this.request.headers.set('content-type', 'application/json'); - this.request = new globalThis.Request(this.request, {body: this._options.body}); - } + const createExtendError = createExtendError_1; + const createError = createError_1; - const fn = async () => { - if (this._options.timeout > maxSafeTimeout) { - throw new RangeError(`The \`timeout\` option cannot be greater than ${maxSafeTimeout}`); - } + const createErrorClass = ErrorClass => (className, props) => { + const errorClass = createError(className || ErrorClass.name); + return createExtendError(errorClass, props) + }; - await delay(1); - let response = await this._fetch(); + lib.exports = createErrorClass(Error); + lib.exports.type = createErrorClass(TypeError); + lib.exports.range = createErrorClass(RangeError); + lib.exports.eval = createErrorClass(EvalError); + lib.exports.syntax = createErrorClass(SyntaxError); + lib.exports.reference = createErrorClass(ReferenceError); + lib.exports.uri = createErrorClass(URIError); - for (const hook of this._options.hooks.afterResponse) { - // eslint-disable-next-line no-await-in-loop - const modifiedResponse = await hook( - this.request, - this._options, - this._decorateResponse(response.clone()) - ); + const ENDPOINT = { + FREE: 'https://api.microlink.io', + PRO: 'https://pro.microlink.io' + }; - if (modifiedResponse instanceof globalThis.Response) { - response = modifiedResponse; - } - } + const isObject = input => typeof input === 'object'; - this._decorateResponse(response); + const pickBy = obj => { + Object.keys(obj).forEach(key => obj[key] == null && delete obj[key]); + return obj + }; - if (!response.ok && this._options.throwHttpErrors) { - throw new HTTPError(response, this.request, this._options); - } + const parseBody = (input, error, url) => { + try { + return JSON.parse(input) + } catch (_) { + const message = input || error.message; - // If `onDownloadProgress` is passed, it uses the stream API internally - /* istanbul ignore next */ - if (this._options.onDownloadProgress) { - if (typeof this._options.onDownloadProgress !== 'function') { - throw new TypeError('The `onDownloadProgress` option must be a function'); - } + return { + status: 'error', + data: { url: message }, + more: 'https://microlink.io/efatal', + code: 'EFATAL', + message, + url + } + } + }; - if (!supportsStreams) { - throw new Error('Streams are not supported in your environment. `ReadableStream` is missing.'); - } + const factory$1 = ({ VERSION, MicrolinkError, isUrlHttp, stringify, got, flatten }) => { + const assertUrl = (url = '') => { + if (!isUrlHttp(url)) { + const message = `The \`url\` as \`${url}\` is not valid. Ensure it has protocol (http or https) and hostname.`; + throw new MicrolinkError({ + status: 'fail', + data: { url: message }, + more: 'https://microlink.io/docs/api/api-parameters/url', + code: 'EINVALURLCLIENT', + message, + url + }) + } + }; - return this._stream(response.clone(), this._options.onDownloadProgress); - } + const mapRules = rules => { + if (!isObject(rules)) return + const flatRules = flatten(rules); + return Object.keys(flatRules).reduce( + (acc, key) => ({ ...acc, [`data.${key}`]: flatRules[key] }), + {} + ) + }; - return response; - }; + const fetchFromApi = async (apiUrl, opts = {}) => { + try { + const response = await got(apiUrl, opts); + return opts.responseType === 'buffer' + ? { body: response.body, response } + : { ...response.body, response } + } catch (err) { + const { response = {} } = err; + const { statusCode, body: rawBody, headers, url: uri = apiUrl } = response; - const isRetriableMethod = this._options.retry.methods.includes(this.request.method.toLowerCase()); - const result = isRetriableMethod ? this._retry(fn) : fn(); + const body = + isObject(rawBody) && !Buffer.isBuffer(rawBody) ? rawBody : parseBody(rawBody, err, uri); - for (const [type, mimeType] of Object.entries(responseTypes)) { - result[type] = async () => { - this.request.headers.set('accept', this.request.headers.get('accept') || mimeType); + throw MicrolinkError({ + ...body, + message: body.message, + url: uri, + statusCode, + headers + }) + } + }; - const response = (await result).clone(); + const getApiUrl = ( + url, + { data, apiKey, endpoint, retry, cache, ...opts } = {}, + { responseType = 'json', headers: gotHeaders, ...gotOpts } = {} + ) => { + const isPro = !!apiKey; + const apiEndpoint = endpoint || ENDPOINT[isPro ? 'PRO' : 'FREE']; - if (type === 'json') { - if (response.status === 204) { - return ''; - } + const apiUrl = `${apiEndpoint}?${stringify({ + url, + ...mapRules(data), + ...flatten(pickBy(opts)) + })}`; - if (options.parseJson) { - return options.parseJson(await response.text()); - } - } + const headers = isPro ? { ...gotHeaders, 'x-api-key': apiKey } : { ...gotHeaders }; + return [apiUrl, { ...gotOpts, responseType, cache, retry, headers }] + }; - return response[type](); - }; - } + const createMql = defaultOpts => async (url, opts, gotOpts) => { + assertUrl(url); + const [apiUrl, fetchOpts] = getApiUrl(url, opts, { + ...defaultOpts, + ...gotOpts + }); + return fetchFromApi(apiUrl, fetchOpts) + }; - return result; - } + const mql = createMql(); + mql.MicrolinkError = MicrolinkError; + mql.getApiUrl = getApiUrl; + mql.fetchFromApi = fetchFromApi; + mql.mapRules = mapRules; + mql.version = VERSION; + mql.stream = got.stream; + mql.buffer = createMql({ responseType: 'buffer' }); - _calculateRetryDelay(error) { - this._retryCount++; + return mql + }; - if (this._retryCount < this._options.retry.limit && !(error instanceof TimeoutError)) { - if (error instanceof HTTPError) { - if (!this._options.retry.statusCodes.includes(error.response.status)) { - return 0; - } + var factory_1 = factory$1; - const retryAfter = error.response.headers.get('Retry-After'); - if (retryAfter && this._options.retry.afterStatusCodes.includes(error.response.status)) { - let after = Number(retryAfter); - if (Number.isNaN(after)) { - after = Date.parse(retryAfter) - Date.now(); - } else { - after *= 1000; - } + var ky$1 = {exports: {}}; - if (typeof this._options.retry.maxRetryAfter !== 'undefined' && after > this._options.retry.maxRetryAfter) { - return 0; - } + (function (module, exports) { + (function (global, factory) { + module.exports = factory() ; + }(commonjsGlobal, (function () { + /*! MIT License © Sindre Sorhus */ - return after; - } + const isObject = value => value !== null && typeof value === 'object'; + const supportsAbortController = typeof globalThis.AbortController === 'function'; + const supportsStreams = typeof globalThis.ReadableStream === 'function'; + const supportsFormData = typeof globalThis.FormData === 'function'; - if (error.response.status === 413) { - return 0; - } - } + const mergeHeaders = (source1, source2) => { + const result = new globalThis.Headers(source1 || {}); + const isHeadersInstance = source2 instanceof globalThis.Headers; + const source = new globalThis.Headers(source2 || {}); - const BACKOFF_FACTOR = 0.3; - return BACKOFF_FACTOR * (2 ** (this._retryCount - 1)) * 1000; + for (const [key, value] of source) { + if ((isHeadersInstance && value === 'undefined') || value === undefined) { + result.delete(key); + } else { + result.set(key, value); } - - return 0; } - _decorateResponse(response) { - if (this._options.parseJson) { - response.json = async () => { - return this._options.parseJson(await response.text()); - }; - } - - return response; - } + return result; + }; - async _retry(fn) { - try { - return await fn(); - } catch (error) { - const ms = Math.min(this._calculateRetryDelay(error), maxSafeTimeout); - if (ms !== 0 && this._retryCount > 0) { - await delay(ms); + const deepMerge = (...sources) => { + let returnValue = {}; + let headers = {}; - for (const hook of this._options.hooks.beforeRetry) { - // eslint-disable-next-line no-await-in-loop - const hookResult = await hook({ - request: this.request, - options: this._options, - error, - retryCount: this._retryCount - }); + for (const source of sources) { + if (Array.isArray(source)) { + if (!(Array.isArray(returnValue))) { + returnValue = []; + } - // If `stop` is returned from the hook, the retry process is stopped - if (hookResult === stop) { - return; - } + returnValue = [...returnValue, ...source]; + } else if (isObject(source)) { + for (let [key, value] of Object.entries(source)) { + if (isObject(value) && (key in returnValue)) { + value = deepMerge(returnValue[key], value); } - return this._retry(fn); + returnValue = {...returnValue, [key]: value}; } - if (this._options.throwHttpErrors) { - throw error; + if (isObject(source.headers)) { + headers = mergeHeaders(headers, source.headers); } } + + returnValue.headers = headers; } - async _fetch() { - for (const hook of this._options.hooks.beforeRequest) { - // eslint-disable-next-line no-await-in-loop - const result = await hook(this.request, this._options); + return returnValue; + }; - if (result instanceof Request) { - this.request = result; - break; - } + const requestMethods = [ + 'get', + 'post', + 'put', + 'patch', + 'head', + 'delete' + ]; - if (result instanceof Response) { - return result; - } - } + const responseTypes = { + json: 'application/json', + text: 'text/*', + formData: 'multipart/form-data', + arrayBuffer: '*/*', + blob: '*/*' + }; - if (this._options.timeout === false) { - return this._options.fetch(this.request.clone()); - } + const retryMethods = [ + 'get', + 'put', + 'head', + 'delete', + 'options', + 'trace' + ]; - return timeout(this.request.clone(), this.abortController, this._options); - } + const retryStatusCodes = [ + 408, + 413, + 429, + 500, + 502, + 503, + 504 + ]; - /* istanbul ignore next */ - _stream(response, onDownloadProgress) { - const totalBytes = Number(response.headers.get('content-length')) || 0; - let transferredBytes = 0; + const retryAfterStatusCodes = [ + 413, + 429, + 503 + ]; - return new globalThis.Response( - new globalThis.ReadableStream({ - async start(controller) { - const reader = response.body.getReader(); + const stop = Symbol('stop'); - if (onDownloadProgress) { - onDownloadProgress({percent: 0, transferredBytes: 0, totalBytes}, new Uint8Array()); - } + class HTTPError extends Error { + constructor(response, request, options) { + // Set the message to the status text, such as Unauthorized, + // with some fallbacks. This message should never be undefined. + super( + response.statusText || + String( + (response.status === 0 || response.status) ? + response.status : 'Unknown response error' + ) + ); + this.name = 'HTTPError'; + this.response = response; + this.request = request; + this.options = options; + } + } - async function read() { - const {done, value} = await reader.read(); - if (done) { - controller.close(); - return; - } + class TimeoutError extends Error { + constructor(request) { + super('Request timed out'); + this.name = 'TimeoutError'; + this.request = request; + } + } - if (onDownloadProgress) { - transferredBytes += value.byteLength; - const percent = totalBytes === 0 ? 0 : transferredBytes / totalBytes; - onDownloadProgress({percent, transferredBytes, totalBytes}, value); - } + const delay = ms => new Promise(resolve => setTimeout(resolve, ms)); - controller.enqueue(value); - await read(); - } + // `Promise.race()` workaround (#91) + const timeout = (request, abortController, options) => + new Promise((resolve, reject) => { + const timeoutID = setTimeout(() => { + if (abortController) { + abortController.abort(); + } - await read(); - } - }) - ); - } - } + reject(new TimeoutError(request)); + }, options.timeout); + + /* eslint-disable promise/prefer-await-to-then */ + options.fetch(request) + .then(resolve) + .catch(reject) + .then(() => { + clearTimeout(timeoutID); + }); + /* eslint-enable promise/prefer-await-to-then */ + }); - const validateAndMerge = (...sources) => { - for (const source of sources) { - if ((!isObject(source) || Array.isArray(source)) && typeof source !== 'undefined') { - throw new TypeError('The `options` argument must be an object'); - } - } + const normalizeRequestMethod = input => requestMethods.includes(input) ? input.toUpperCase() : input; - return deepMerge({}, ...sources); + const defaultRetryOptions = { + limit: 2, + methods: retryMethods, + statusCodes: retryStatusCodes, + afterStatusCodes: retryAfterStatusCodes }; - const createInstance = defaults => { - const ky = (input, options) => new Ky(input, validateAndMerge(defaults, options)); + const normalizeRetryOptions = (retry = {}) => { + if (typeof retry === 'number') { + return { + ...defaultRetryOptions, + limit: retry + }; + } - for (const method of requestMethods) { - ky[method] = (input, options) => new Ky(input, validateAndMerge(defaults, options, {method})); + if (retry.methods && !Array.isArray(retry.methods)) { + throw new Error('retry.methods must be an array'); } - ky.HTTPError = HTTPError; - ky.TimeoutError = TimeoutError; - ky.create = newDefaults => createInstance(validateAndMerge(newDefaults)); - ky.extend = newDefaults => createInstance(validateAndMerge(defaults, newDefaults)); - ky.stop = stop; + if (retry.statusCodes && !Array.isArray(retry.statusCodes)) { + throw new Error('retry.statusCodes must be an array'); + } - return ky; + return { + ...defaultRetryOptions, + ...retry, + afterStatusCodes: retryAfterStatusCodes + }; }; - const ky = createInstance(); + // The maximum value of a 32bit int (see issue #117) + const maxSafeTimeout = 2147483647; - return ky; + class Ky { + constructor(input, options = {}) { + this._retryCount = 0; + this._input = input; + this._options = { + // TODO: credentials can be removed when the spec change is implemented in all browsers. Context: https://www.chromestatus.com/feature/4539473312350208 + credentials: this._input.credentials || 'same-origin', + ...options, + headers: mergeHeaders(this._input.headers, options.headers), + hooks: deepMerge({ + beforeRequest: [], + beforeRetry: [], + afterResponse: [] + }, options.hooks), + method: normalizeRequestMethod(options.method || this._input.method), + prefixUrl: String(options.prefixUrl || ''), + retry: normalizeRetryOptions(options.retry), + throwHttpErrors: options.throwHttpErrors !== false, + timeout: typeof options.timeout === 'undefined' ? 10000 : options.timeout, + fetch: options.fetch || globalThis.fetch.bind(globalThis) + }; - }))); - }); + if (typeof this._input !== 'string' && !(this._input instanceof URL || this._input instanceof globalThis.Request)) { + throw new TypeError('`input` must be a string, URL, or Request'); + } - var _rollupPluginShim1 = str => str; + if (this._options.prefixUrl && typeof this._input === 'string') { + if (this._input.startsWith('/')) { + throw new Error('`input` must not begin with a slash when using `prefixUrl`'); + } - var _rollupPluginShim1$1 = /*#__PURE__*/Object.freeze({ - __proto__: null, - 'default': _rollupPluginShim1 - }); + if (!this._options.prefixUrl.endsWith('/')) { + this._options.prefixUrl += '/'; + } - const copyProperty = (to, from, property, ignoreNonConfigurable) => { - // `Function#length` should reflect the parameters of `to` not `from` since we keep its body. - // `Function#prototype` is non-writable and non-configurable so can never be modified. - if (property === 'length' || property === 'prototype') { - return; - } + this._input = this._options.prefixUrl + this._input; + } - const toDescriptor = Object.getOwnPropertyDescriptor(to, property); - const fromDescriptor = Object.getOwnPropertyDescriptor(from, property); + if (supportsAbortController) { + this.abortController = new globalThis.AbortController(); + if (this._options.signal) { + this._options.signal.addEventListener('abort', () => { + this.abortController.abort(); + }); + } - if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) { - return; - } + this._options.signal = this.abortController.signal; + } - Object.defineProperty(to, property, fromDescriptor); - }; + this.request = new globalThis.Request(this._input, this._options); - // `Object.defineProperty()` throws if the property exists, is not configurable and either: - // - one its descriptors is changed - // - it is non-writable and its value is changed - const canCopyProperty = function (toDescriptor, fromDescriptor) { - return toDescriptor === undefined || toDescriptor.configurable || ( - toDescriptor.writable === fromDescriptor.writable && - toDescriptor.enumerable === fromDescriptor.enumerable && - toDescriptor.configurable === fromDescriptor.configurable && - (toDescriptor.writable || toDescriptor.value === fromDescriptor.value) - ); - }; + if (this._options.searchParams) { + const textSearchParams = typeof this._options.searchParams === 'string' ? + this._options.searchParams.replace(/^\?/, '') : + new URLSearchParams(this._options.searchParams).toString(); + const searchParams = '?' + textSearchParams; + const url = this.request.url.replace(/(?:\?.*?)?(?=#|$)/, searchParams); - const changePrototype = (to, from) => { - const fromPrototype = Object.getPrototypeOf(from); - if (fromPrototype === Object.getPrototypeOf(to)) { - return; - } + // To provide correct form boundary, Content-Type header should be deleted each time when new Request instantiated from another one + if (((supportsFormData && this._options.body instanceof globalThis.FormData) || this._options.body instanceof URLSearchParams) && !(this._options.headers && this._options.headers['content-type'])) { + this.request.headers.delete('content-type'); + } - Object.setPrototypeOf(to, fromPrototype); - }; + this.request = new globalThis.Request(new globalThis.Request(url, this.request), this._options); + } - const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/\n${fromBody}`; + if (this._options.json !== undefined) { + this._options.body = JSON.stringify(this._options.json); + this.request.headers.set('content-type', 'application/json'); + this.request = new globalThis.Request(this.request, {body: this._options.body}); + } - const toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, 'toString'); - const toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, 'name'); + const fn = async () => { + if (this._options.timeout > maxSafeTimeout) { + throw new RangeError(`The \`timeout\` option cannot be greater than ${maxSafeTimeout}`); + } - // We call `from.toString()` early (not lazily) to ensure `from` can be garbage collected. - // We use `bind()` instead of a closure for the same reason. - // Calling `from.toString()` early also allows caching it in case `to.toString()` is called several times. - const changeToString = (to, from, name) => { - const withName = name === '' ? '' : `with ${name.trim()}() `; - const newToString = wrappedToString.bind(null, withName, from.toString()); - // Ensure `to.toString.toString` is non-enumerable and has the same `same` - Object.defineProperty(newToString, 'name', toStringName); - Object.defineProperty(to, 'toString', {...toStringDescriptor, value: newToString}); - }; + await delay(1); + let response = await this._fetch(); - const mimicFn = (to, from, {ignoreNonConfigurable = false} = {}) => { - const {name} = to; + for (const hook of this._options.hooks.afterResponse) { + // eslint-disable-next-line no-await-in-loop + const modifiedResponse = await hook( + this.request, + this._options, + this._decorateResponse(response.clone()) + ); - for (const property of Reflect.ownKeys(from)) { - copyProperty(to, from, property, ignoreNonConfigurable); - } + if (modifiedResponse instanceof globalThis.Response) { + response = modifiedResponse; + } + } - changePrototype(to, from); - changeToString(to, from, name); + this._decorateResponse(response); - return to; - }; + if (!response.ok && this._options.throwHttpErrors) { + throw new HTTPError(response, this.request, this._options); + } + + // If `onDownloadProgress` is passed, it uses the stream API internally + /* istanbul ignore next */ + if (this._options.onDownloadProgress) { + if (typeof this._options.onDownloadProgress !== 'function') { + throw new TypeError('The `onDownloadProgress` option must be a function'); + } - var mimicFn_1 = mimicFn; + if (!supportsStreams) { + throw new Error('Streams are not supported in your environment. `ReadableStream` is missing.'); + } - var helpers = { - isFunction: obj => typeof obj === 'function', - isString: obj => typeof obj === 'string', - composeErrorMessage: (code, description) => `${code}, ${description}`, - inherits: (ctor, superCtor) => { - ctor.super_ = superCtor; - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }); - } - }; + return this._stream(response.clone(), this._options.onDownloadProgress); + } - const {isFunction, composeErrorMessage} = helpers; + return response; + }; - function interfaceObject (error, ...props) { - Object.assign(error, ...props); + const isRetriableMethod = this._options.retry.methods.includes(this.request.method.toLowerCase()); + const result = isRetriableMethod ? this._retry(fn) : fn(); - error.description = isFunction(error.message) ? error.message(error) : error.message; + for (const [type, mimeType] of Object.entries(responseTypes)) { + result[type] = async () => { + this.request.headers.set('accept', this.request.headers.get('accept') || mimeType); - error.message = error.code - ? composeErrorMessage(error.code, error.description) - : error.description; - } + const response = (await result).clone(); - var addErrorProps = interfaceObject; + if (type === 'json') { + if (response.status === 204) { + return ''; + } - var cleanStack = /*@__PURE__*/getAugmentedNamespace(_rollupPluginShim1$1); + if (options.parseJson) { + return options.parseJson(await response.text()); + } + } - const {isString} = helpers; + return response[type](); + }; + } - function createExtendError (ErrorClass, classProps) { - function ExtendError (props) { - const error = new ErrorClass(); - const errorProps = isString(props) ? {message: props} : props; - addErrorProps(error, classProps, errorProps); + return result; + } - error.stack = cleanStack(error.stack); - return error - } + _calculateRetryDelay(error) { + this._retryCount++; - ExtendError.prototype = ErrorClass.prototype; - mimicFn_1(ExtendError, ErrorClass); + if (this._retryCount < this._options.retry.limit && !(error instanceof TimeoutError)) { + if (error instanceof HTTPError) { + if (!this._options.retry.statusCodes.includes(error.response.status)) { + return 0; + } - return ExtendError - } + const retryAfter = error.response.headers.get('Retry-After'); + if (retryAfter && this._options.retry.afterStatusCodes.includes(error.response.status)) { + let after = Number(retryAfter); + if (Number.isNaN(after)) { + after = Date.parse(retryAfter) - Date.now(); + } else { + after *= 1000; + } - var createExtendError_1 = createExtendError; + if (typeof this._options.retry.maxRetryAfter !== 'undefined' && after > this._options.retry.maxRetryAfter) { + return 0; + } - const {inherits} = helpers; + return after; + } + if (error.response.status === 413) { + return 0; + } + } - const REGEX_CLASS_NAME = /[^0-9a-zA-Z_$]/; + const BACKOFF_FACTOR = 0.3; + return BACKOFF_FACTOR * (2 ** (this._retryCount - 1)) * 1000; + } - function createError (className) { - if (typeof className !== 'string') { - throw new TypeError('Expected className to be a string') - } + return 0; + } - if (REGEX_CLASS_NAME.test(className)) { - throw new Error('className contains invalid characters') - } + _decorateResponse(response) { + if (this._options.parseJson) { + response.json = async () => { + return this._options.parseJson(await response.text()); + }; + } - function ErrorClass () { - Object.defineProperty(this, 'name', { - configurable: true, - value: className, - writable: true - }); + return response; + } - Error.captureStackTrace(this, this.constructor); - } + async _retry(fn) { + try { + return await fn(); + } catch (error) { + const ms = Math.min(this._calculateRetryDelay(error), maxSafeTimeout); + if (ms !== 0 && this._retryCount > 0) { + await delay(ms); - inherits(ErrorClass, Error); - mimicFn_1(ErrorClass, Error); - return ErrorClass - } + for (const hook of this._options.hooks.beforeRetry) { + // eslint-disable-next-line no-await-in-loop + const hookResult = await hook({ + request: this.request, + options: this._options, + error, + retryCount: this._retryCount + }); - var createError_1 = createError; + // If `stop` is returned from the hook, the retry process is stopped + if (hookResult === stop) { + return; + } + } - const createErrorClass = ErrorClass => (className, props) => { - const errorClass = createError_1(className || ErrorClass.name); - return createExtendError_1(errorClass, props) - }; + return this._retry(fn); + } - var lib = createErrorClass(Error); - var type = createErrorClass(TypeError); - var range = createErrorClass(RangeError); - var _eval = createErrorClass(EvalError); - var syntax = createErrorClass(SyntaxError); - var reference = createErrorClass(ReferenceError); - var uri = createErrorClass(URIError); - lib.type = type; - lib.range = range; - lib.eval = _eval; - lib.syntax = syntax; - lib.reference = reference; - lib.uri = uri; + if (this._options.throwHttpErrors) { + throw error; + } + } + } - const ENDPOINT = { - FREE: 'https://api.microlink.io', - PRO: 'https://pro.microlink.io' - }; + async _fetch() { + for (const hook of this._options.hooks.beforeRequest) { + // eslint-disable-next-line no-await-in-loop + const result = await hook(this.request, this._options); - const isObject = input => typeof input === 'object'; + if (result instanceof Request) { + this.request = result; + break; + } - const pickBy = obj => { - Object.keys(obj).forEach(key => obj[key] == null && delete obj[key]); - return obj - }; + if (result instanceof Response) { + return result; + } + } - const parseBody = (input, error, url) => { - try { - return JSON.parse(input) - } catch (_) { - const message = input || error.message; + if (this._options.timeout === false) { + return this._options.fetch(this.request.clone()); + } - return { - status: 'error', - data: { url: message }, - more: 'https://microlink.io/efatal', - code: 'EFATAL', - message, - url - } - } - }; + return timeout(this.request.clone(), this.abortController, this._options); + } - const factory = ({ VERSION, MicrolinkError, isUrlHttp, stringify, got, flatten }) => { - const assertUrl = (url = '') => { - if (!isUrlHttp(url)) { - const message = `The \`url\` as \`${url}\` is not valid. Ensure it has protocol (http or https) and hostname.`; - throw new MicrolinkError({ - status: 'fail', - data: { url: message }, - more: 'https://microlink.io/docs/api/api-parameters/url', - code: 'EINVALURLCLIENT', - message, - url - }) - } - }; + /* istanbul ignore next */ + _stream(response, onDownloadProgress) { + const totalBytes = Number(response.headers.get('content-length')) || 0; + let transferredBytes = 0; - const mapRules = rules => { - if (!isObject(rules)) return - const flatRules = flatten(rules); - return Object.keys(flatRules).reduce( - (acc, key) => ({ ...acc, [`data.${key}`]: flatRules[key] }), - {} - ) - }; + return new globalThis.Response( + new globalThis.ReadableStream({ + async start(controller) { + const reader = response.body.getReader(); - const fetchFromApi = async (apiUrl, opts = {}) => { - try { - const response = await got(apiUrl, opts); - return opts.responseType === 'buffer' - ? { body: response.body, response } - : { ...response.body, response } - } catch (err) { - const { response = {} } = err; - const { statusCode, body: rawBody, headers, url: uri = apiUrl } = response; + if (onDownloadProgress) { + onDownloadProgress({percent: 0, transferredBytes: 0, totalBytes}, new Uint8Array()); + } - const body = - isObject(rawBody) && !Buffer.isBuffer(rawBody) ? rawBody : parseBody(rawBody, err, uri); + async function read() { + const {done, value} = await reader.read(); + if (done) { + controller.close(); + return; + } - throw MicrolinkError({ - ...body, - message: body.message, - url: uri, - statusCode, - headers - }) - } - }; + if (onDownloadProgress) { + transferredBytes += value.byteLength; + const percent = totalBytes === 0 ? 0 : transferredBytes / totalBytes; + onDownloadProgress({percent, transferredBytes, totalBytes}, value); + } - const getApiUrl = ( - url, - { data, apiKey, endpoint, retry, cache, ...opts } = {}, - { responseType = 'json', headers: gotHeaders, ...gotOpts } = {} - ) => { - const isPro = !!apiKey; - const apiEndpoint = endpoint || ENDPOINT[isPro ? 'PRO' : 'FREE']; + controller.enqueue(value); + await read(); + } - const apiUrl = `${apiEndpoint}?${stringify({ - url, - ...mapRules(data), - ...flatten(pickBy(opts)) - })}`; + await read(); + } + }) + ); + } + } - const headers = isPro ? { ...gotHeaders, 'x-api-key': apiKey } : { ...gotHeaders }; - return [apiUrl, { ...gotOpts, responseType, cache, retry, headers }] - }; + const validateAndMerge = (...sources) => { + for (const source of sources) { + if ((!isObject(source) || Array.isArray(source)) && typeof source !== 'undefined') { + throw new TypeError('The `options` argument must be an object'); + } + } - const createMql = defaultOpts => async (url, opts, gotOpts) => { - assertUrl(url); - const [apiUrl, fetchOpts] = getApiUrl(url, opts, { - ...defaultOpts, - ...gotOpts - }); - return fetchFromApi(apiUrl, fetchOpts) - }; + return deepMerge({}, ...sources); + }; - const mql = createMql(); - mql.MicrolinkError = MicrolinkError; - mql.getApiUrl = getApiUrl; - mql.fetchFromApi = fetchFromApi; - mql.mapRules = mapRules; - mql.version = VERSION; - mql.stream = got.stream; - mql.buffer = createMql({ responseType: 'buffer' }); + const createInstance = defaults => { + const ky = (input, options) => new Ky(input, validateAndMerge(defaults, options)); - return mql - }; + for (const method of requestMethods) { + ky[method] = (input, options) => new Ky(input, validateAndMerge(defaults, options, {method})); + } - var factory_1 = factory; + ky.HTTPError = HTTPError; + ky.TimeoutError = TimeoutError; + ky.create = newDefaults => createInstance(validateAndMerge(newDefaults)); + ky.extend = newDefaults => createInstance(validateAndMerge(defaults, newDefaults)); + ky.stop = stop; - var require$$1 = /*@__PURE__*/getAugmentedNamespace(qss_m); + return ky; + }; - const { flattie: flatten } = dist; - const { encode: stringify } = require$$1; + const ky = createInstance(); + return ky; + }))); + }(ky$1)); + const isUrlHttp = lightweight; + const { flattie: flatten } = dist; + const { encode: stringify } = require$$2; + const whoops = lib.exports; + const factory = factory_1; + const ky = ky$1.exports; - const MicrolinkError = lib('MicrolinkError'); + const MicrolinkError = whoops('MicrolinkError'); const got = async (url, opts) => { try { @@ -954,13 +953,13 @@ } }; - var browser = factory_1({ + var browser = factory({ MicrolinkError, - isUrlHttp: lightweight, + isUrlHttp, stringify, got, flatten, - VERSION: '0.9.3' + VERSION: '0.9.4' }); return browser; diff --git a/dist/mql.js.map b/dist/mql.js.map index 5a33cc1..90f8c55 100644 --- a/dist/mql.js.map +++ b/dist/mql.js.map @@ -1 +1 @@ -{"version":3,"file":"mql.js","sources":["../node_modules/is-url-http/lightweight.js","../node_modules/flattie/dist/index.js","../node_modules/qss/dist/qss.m.js","../src/ky.js","../node_modules/whoops/node_modules/mimic-fn/index.js","../node_modules/whoops/lib/helpers.js","../node_modules/whoops/lib/add-error-props.js","../node_modules/whoops/lib/create-extend-error.js","../node_modules/whoops/lib/create-error.js","../node_modules/whoops/lib/index.js","../src/factory.js","../src/browser.js"],"sourcesContent":["'use strict'\n\nconst URL = global.window ? window.URL : require('url').URL\nconst REGEX_HTTP_PROTOCOL = /^https?:\\/\\//i\n\nmodule.exports = url => {\n try {\n return REGEX_HTTP_PROTOCOL.test(new URL(url).href)\n } catch (err) {\n return false\n }\n}\n","function iter(output, nullish, sep, val, key) {\n\tvar k, pfx = key ? (key + sep) : key;\n\n\tif (val == null) {\n\t\tif (nullish) output[key] = val;\n\t} else if (typeof val != 'object') {\n\t\toutput[key] = val;\n\t} else if (Array.isArray(val)) {\n\t\tfor (k=0; k < val.length; k++) {\n\t\t\titer(output, nullish, sep, val[k], pfx + k);\n\t\t}\n\t} else {\n\t\tfor (k in val) {\n\t\t\titer(output, nullish, sep, val[k], pfx + k);\n\t\t}\n\t}\n}\n\nfunction flattie(input, glue, toNull) {\n\tvar output = {};\n\tif (typeof input == 'object') {\n\t\titer(output, !!toNull, glue || '.', input, '');\n\t}\n\treturn output;\n}\n\nexports.flattie = flattie;","export function encode(obj, pfx) {\n\tvar k, i, tmp, str='';\n\n\tfor (k in obj) {\n\t\tif ((tmp = obj[k]) !== void 0) {\n\t\t\tif (Array.isArray(tmp)) {\n\t\t\t\tfor (i=0; i < tmp.length; i++) {\n\t\t\t\t\tstr && (str += '&');\n\t\t\t\t\tstr += encodeURIComponent(k) + '=' + encodeURIComponent(tmp[i]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstr && (str += '&');\n\t\t\t\tstr += encodeURIComponent(k) + '=' + encodeURIComponent(tmp);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn (pfx || '') + str;\n}\n\nfunction toValue(mix) {\n\tif (!mix) return '';\n\tvar str = decodeURIComponent(mix);\n\tif (str === 'false') return false;\n\tif (str === 'true') return true;\n\treturn (+str * 0 === 0) ? (+str) : str;\n}\n\nexport function decode(str) {\n\tvar tmp, k, out={}, arr=str.split('&');\n\n\twhile (tmp = arr.shift()) {\n\t\ttmp = tmp.split('=');\n\t\tk = tmp.shift();\n\t\tif (out[k] !== void 0) {\n\t\t\tout[k] = [].concat(out[k], toValue(tmp.shift()));\n\t\t} else {\n\t\t\tout[k] = toValue(tmp.shift());\n\t\t}\n\t}\n\n\treturn out;\n}\n","(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.ky = factory());\n}(this, (function () { 'use strict';\n\n\t/*! MIT License © Sindre Sorhus */\n\n\tconst isObject = value => value !== null && typeof value === 'object';\n\tconst supportsAbortController = typeof globalThis.AbortController === 'function';\n\tconst supportsStreams = typeof globalThis.ReadableStream === 'function';\n\tconst supportsFormData = typeof globalThis.FormData === 'function';\n\n\tconst mergeHeaders = (source1, source2) => {\n\t\tconst result = new globalThis.Headers(source1 || {});\n\t\tconst isHeadersInstance = source2 instanceof globalThis.Headers;\n\t\tconst source = new globalThis.Headers(source2 || {});\n\n\t\tfor (const [key, value] of source) {\n\t\t\tif ((isHeadersInstance && value === 'undefined') || value === undefined) {\n\t\t\t\tresult.delete(key);\n\t\t\t} else {\n\t\t\t\tresult.set(key, value);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t};\n\n\tconst deepMerge = (...sources) => {\n\t\tlet returnValue = {};\n\t\tlet headers = {};\n\n\t\tfor (const source of sources) {\n\t\t\tif (Array.isArray(source)) {\n\t\t\t\tif (!(Array.isArray(returnValue))) {\n\t\t\t\t\treturnValue = [];\n\t\t\t\t}\n\n\t\t\t\treturnValue = [...returnValue, ...source];\n\t\t\t} else if (isObject(source)) {\n\t\t\t\tfor (let [key, value] of Object.entries(source)) {\n\t\t\t\t\tif (isObject(value) && (key in returnValue)) {\n\t\t\t\t\t\tvalue = deepMerge(returnValue[key], value);\n\t\t\t\t\t}\n\n\t\t\t\t\treturnValue = {...returnValue, [key]: value};\n\t\t\t\t}\n\n\t\t\t\tif (isObject(source.headers)) {\n\t\t\t\t\theaders = mergeHeaders(headers, source.headers);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturnValue.headers = headers;\n\t\t}\n\n\t\treturn returnValue;\n\t};\n\n\tconst requestMethods = [\n\t\t'get',\n\t\t'post',\n\t\t'put',\n\t\t'patch',\n\t\t'head',\n\t\t'delete'\n\t];\n\n\tconst responseTypes = {\n\t\tjson: 'application/json',\n\t\ttext: 'text/*',\n\t\tformData: 'multipart/form-data',\n\t\tarrayBuffer: '*/*',\n\t\tblob: '*/*'\n\t};\n\n\tconst retryMethods = [\n\t\t'get',\n\t\t'put',\n\t\t'head',\n\t\t'delete',\n\t\t'options',\n\t\t'trace'\n\t];\n\n\tconst retryStatusCodes = [\n\t\t408,\n\t\t413,\n\t\t429,\n\t\t500,\n\t\t502,\n\t\t503,\n\t\t504\n\t];\n\n\tconst retryAfterStatusCodes = [\n\t\t413,\n\t\t429,\n\t\t503\n\t];\n\n\tconst stop = Symbol('stop');\n\n\tclass HTTPError extends Error {\n\t\tconstructor(response, request, options) {\n\t\t\t// Set the message to the status text, such as Unauthorized,\n\t\t\t// with some fallbacks. This message should never be undefined.\n\t\t\tsuper(\n\t\t\t\tresponse.statusText ||\n\t\t\t\tString(\n\t\t\t\t\t(response.status === 0 || response.status) ?\n\t\t\t\t\t\tresponse.status : 'Unknown response error'\n\t\t\t\t)\n\t\t\t);\n\t\t\tthis.name = 'HTTPError';\n\t\t\tthis.response = response;\n\t\t\tthis.request = request;\n\t\t\tthis.options = options;\n\t\t}\n\t}\n\n\tclass TimeoutError extends Error {\n\t\tconstructor(request) {\n\t\t\tsuper('Request timed out');\n\t\t\tthis.name = 'TimeoutError';\n\t\t\tthis.request = request;\n\t\t}\n\t}\n\n\tconst delay = ms => new Promise(resolve => setTimeout(resolve, ms));\n\n\t// `Promise.race()` workaround (#91)\n\tconst timeout = (request, abortController, options) =>\n\t\tnew Promise((resolve, reject) => {\n\t\t\tconst timeoutID = setTimeout(() => {\n\t\t\t\tif (abortController) {\n\t\t\t\t\tabortController.abort();\n\t\t\t\t}\n\n\t\t\t\treject(new TimeoutError(request));\n\t\t\t}, options.timeout);\n\n\t\t\t/* eslint-disable promise/prefer-await-to-then */\n\t\t\toptions.fetch(request)\n\t\t\t\t.then(resolve)\n\t\t\t\t.catch(reject)\n\t\t\t\t.then(() => {\n\t\t\t\t\tclearTimeout(timeoutID);\n\t\t\t\t});\n\t\t\t/* eslint-enable promise/prefer-await-to-then */\n\t\t});\n\n\tconst normalizeRequestMethod = input => requestMethods.includes(input) ? input.toUpperCase() : input;\n\n\tconst defaultRetryOptions = {\n\t\tlimit: 2,\n\t\tmethods: retryMethods,\n\t\tstatusCodes: retryStatusCodes,\n\t\tafterStatusCodes: retryAfterStatusCodes\n\t};\n\n\tconst normalizeRetryOptions = (retry = {}) => {\n\t\tif (typeof retry === 'number') {\n\t\t\treturn {\n\t\t\t\t...defaultRetryOptions,\n\t\t\t\tlimit: retry\n\t\t\t};\n\t\t}\n\n\t\tif (retry.methods && !Array.isArray(retry.methods)) {\n\t\t\tthrow new Error('retry.methods must be an array');\n\t\t}\n\n\t\tif (retry.statusCodes && !Array.isArray(retry.statusCodes)) {\n\t\t\tthrow new Error('retry.statusCodes must be an array');\n\t\t}\n\n\t\treturn {\n\t\t\t...defaultRetryOptions,\n\t\t\t...retry,\n\t\t\tafterStatusCodes: retryAfterStatusCodes\n\t\t};\n\t};\n\n\t// The maximum value of a 32bit int (see issue #117)\n\tconst maxSafeTimeout = 2147483647;\n\n\tclass Ky {\n\t\tconstructor(input, options = {}) {\n\t\t\tthis._retryCount = 0;\n\t\t\tthis._input = input;\n\t\t\tthis._options = {\n\t\t\t\t// TODO: credentials can be removed when the spec change is implemented in all browsers. Context: https://www.chromestatus.com/feature/4539473312350208\n\t\t\t\tcredentials: this._input.credentials || 'same-origin',\n\t\t\t\t...options,\n\t\t\t\theaders: mergeHeaders(this._input.headers, options.headers),\n\t\t\t\thooks: deepMerge({\n\t\t\t\t\tbeforeRequest: [],\n\t\t\t\t\tbeforeRetry: [],\n\t\t\t\t\tafterResponse: []\n\t\t\t\t}, options.hooks),\n\t\t\t\tmethod: normalizeRequestMethod(options.method || this._input.method),\n\t\t\t\tprefixUrl: String(options.prefixUrl || ''),\n\t\t\t\tretry: normalizeRetryOptions(options.retry),\n\t\t\t\tthrowHttpErrors: options.throwHttpErrors !== false,\n\t\t\t\ttimeout: typeof options.timeout === 'undefined' ? 10000 : options.timeout,\n\t\t\t\tfetch: options.fetch || globalThis.fetch.bind(globalThis)\n\t\t\t};\n\n\t\t\tif (typeof this._input !== 'string' && !(this._input instanceof URL || this._input instanceof globalThis.Request)) {\n\t\t\t\tthrow new TypeError('`input` must be a string, URL, or Request');\n\t\t\t}\n\n\t\t\tif (this._options.prefixUrl && typeof this._input === 'string') {\n\t\t\t\tif (this._input.startsWith('/')) {\n\t\t\t\t\tthrow new Error('`input` must not begin with a slash when using `prefixUrl`');\n\t\t\t\t}\n\n\t\t\t\tif (!this._options.prefixUrl.endsWith('/')) {\n\t\t\t\t\tthis._options.prefixUrl += '/';\n\t\t\t\t}\n\n\t\t\t\tthis._input = this._options.prefixUrl + this._input;\n\t\t\t}\n\n\t\t\tif (supportsAbortController) {\n\t\t\t\tthis.abortController = new globalThis.AbortController();\n\t\t\t\tif (this._options.signal) {\n\t\t\t\t\tthis._options.signal.addEventListener('abort', () => {\n\t\t\t\t\t\tthis.abortController.abort();\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tthis._options.signal = this.abortController.signal;\n\t\t\t}\n\n\t\t\tthis.request = new globalThis.Request(this._input, this._options);\n\n\t\t\tif (this._options.searchParams) {\n\t\t\t\tconst textSearchParams = typeof this._options.searchParams === 'string' ?\n\t\t\t\t\tthis._options.searchParams.replace(/^\\?/, '') :\n\t\t\t\t\tnew URLSearchParams(this._options.searchParams).toString();\n\t\t\t\tconst searchParams = '?' + textSearchParams;\n\t\t\t\tconst url = this.request.url.replace(/(?:\\?.*?)?(?=#|$)/, searchParams);\n\n\t\t\t\t// To provide correct form boundary, Content-Type header should be deleted each time when new Request instantiated from another one\n\t\t\t\tif (((supportsFormData && this._options.body instanceof globalThis.FormData) || this._options.body instanceof URLSearchParams) && !(this._options.headers && this._options.headers['content-type'])) {\n\t\t\t\t\tthis.request.headers.delete('content-type');\n\t\t\t\t}\n\n\t\t\t\tthis.request = new globalThis.Request(new globalThis.Request(url, this.request), this._options);\n\t\t\t}\n\n\t\t\tif (this._options.json !== undefined) {\n\t\t\t\tthis._options.body = JSON.stringify(this._options.json);\n\t\t\t\tthis.request.headers.set('content-type', 'application/json');\n\t\t\t\tthis.request = new globalThis.Request(this.request, {body: this._options.body});\n\t\t\t}\n\n\t\t\tconst fn = async () => {\n\t\t\t\tif (this._options.timeout > maxSafeTimeout) {\n\t\t\t\t\tthrow new RangeError(`The \\`timeout\\` option cannot be greater than ${maxSafeTimeout}`);\n\t\t\t\t}\n\n\t\t\t\tawait delay(1);\n\t\t\t\tlet response = await this._fetch();\n\n\t\t\t\tfor (const hook of this._options.hooks.afterResponse) {\n\t\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\t\tconst modifiedResponse = await hook(\n\t\t\t\t\t\tthis.request,\n\t\t\t\t\t\tthis._options,\n\t\t\t\t\t\tthis._decorateResponse(response.clone())\n\t\t\t\t\t);\n\n\t\t\t\t\tif (modifiedResponse instanceof globalThis.Response) {\n\t\t\t\t\t\tresponse = modifiedResponse;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis._decorateResponse(response);\n\n\t\t\t\tif (!response.ok && this._options.throwHttpErrors) {\n\t\t\t\t\tthrow new HTTPError(response, this.request, this._options);\n\t\t\t\t}\n\n\t\t\t\t// If `onDownloadProgress` is passed, it uses the stream API internally\n\t\t\t\t/* istanbul ignore next */\n\t\t\t\tif (this._options.onDownloadProgress) {\n\t\t\t\t\tif (typeof this._options.onDownloadProgress !== 'function') {\n\t\t\t\t\t\tthrow new TypeError('The `onDownloadProgress` option must be a function');\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!supportsStreams) {\n\t\t\t\t\t\tthrow new Error('Streams are not supported in your environment. `ReadableStream` is missing.');\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this._stream(response.clone(), this._options.onDownloadProgress);\n\t\t\t\t}\n\n\t\t\t\treturn response;\n\t\t\t};\n\n\t\t\tconst isRetriableMethod = this._options.retry.methods.includes(this.request.method.toLowerCase());\n\t\t\tconst result = isRetriableMethod ? this._retry(fn) : fn();\n\n\t\t\tfor (const [type, mimeType] of Object.entries(responseTypes)) {\n\t\t\t\tresult[type] = async () => {\n\t\t\t\t\tthis.request.headers.set('accept', this.request.headers.get('accept') || mimeType);\n\n\t\t\t\t\tconst response = (await result).clone();\n\n\t\t\t\t\tif (type === 'json') {\n\t\t\t\t\t\tif (response.status === 204) {\n\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (options.parseJson) {\n\t\t\t\t\t\t\treturn options.parseJson(await response.text());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn response[type]();\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\t_calculateRetryDelay(error) {\n\t\t\tthis._retryCount++;\n\n\t\t\tif (this._retryCount < this._options.retry.limit && !(error instanceof TimeoutError)) {\n\t\t\t\tif (error instanceof HTTPError) {\n\t\t\t\t\tif (!this._options.retry.statusCodes.includes(error.response.status)) {\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst retryAfter = error.response.headers.get('Retry-After');\n\t\t\t\t\tif (retryAfter && this._options.retry.afterStatusCodes.includes(error.response.status)) {\n\t\t\t\t\t\tlet after = Number(retryAfter);\n\t\t\t\t\t\tif (Number.isNaN(after)) {\n\t\t\t\t\t\t\tafter = Date.parse(retryAfter) - Date.now();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tafter *= 1000;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (typeof this._options.retry.maxRetryAfter !== 'undefined' && after > this._options.retry.maxRetryAfter) {\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn after;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (error.response.status === 413) {\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst BACKOFF_FACTOR = 0.3;\n\t\t\t\treturn BACKOFF_FACTOR * (2 ** (this._retryCount - 1)) * 1000;\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t}\n\n\t\t_decorateResponse(response) {\n\t\t\tif (this._options.parseJson) {\n\t\t\t\tresponse.json = async () => {\n\t\t\t\t\treturn this._options.parseJson(await response.text());\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn response;\n\t\t}\n\n\t\tasync _retry(fn) {\n\t\t\ttry {\n\t\t\t\treturn await fn();\n\t\t\t} catch (error) {\n\t\t\t\tconst ms = Math.min(this._calculateRetryDelay(error), maxSafeTimeout);\n\t\t\t\tif (ms !== 0 && this._retryCount > 0) {\n\t\t\t\t\tawait delay(ms);\n\n\t\t\t\t\tfor (const hook of this._options.hooks.beforeRetry) {\n\t\t\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\t\t\tconst hookResult = await hook({\n\t\t\t\t\t\t\trequest: this.request,\n\t\t\t\t\t\t\toptions: this._options,\n\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t\tretryCount: this._retryCount\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t// If `stop` is returned from the hook, the retry process is stopped\n\t\t\t\t\t\tif (hookResult === stop) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this._retry(fn);\n\t\t\t\t}\n\n\t\t\t\tif (this._options.throwHttpErrors) {\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tasync _fetch() {\n\t\t\tfor (const hook of this._options.hooks.beforeRequest) {\n\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\tconst result = await hook(this.request, this._options);\n\n\t\t\t\tif (result instanceof Request) {\n\t\t\t\t\tthis.request = result;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (result instanceof Response) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this._options.timeout === false) {\n\t\t\t\treturn this._options.fetch(this.request.clone());\n\t\t\t}\n\n\t\t\treturn timeout(this.request.clone(), this.abortController, this._options);\n\t\t}\n\n\t\t/* istanbul ignore next */\n\t\t_stream(response, onDownloadProgress) {\n\t\t\tconst totalBytes = Number(response.headers.get('content-length')) || 0;\n\t\t\tlet transferredBytes = 0;\n\n\t\t\treturn new globalThis.Response(\n\t\t\t\tnew globalThis.ReadableStream({\n\t\t\t\t\tasync start(controller) {\n\t\t\t\t\t\tconst reader = response.body.getReader();\n\n\t\t\t\t\t\tif (onDownloadProgress) {\n\t\t\t\t\t\t\tonDownloadProgress({percent: 0, transferredBytes: 0, totalBytes}, new Uint8Array());\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tasync function read() {\n\t\t\t\t\t\t\tconst {done, value} = await reader.read();\n\t\t\t\t\t\t\tif (done) {\n\t\t\t\t\t\t\t\tcontroller.close();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (onDownloadProgress) {\n\t\t\t\t\t\t\t\ttransferredBytes += value.byteLength;\n\t\t\t\t\t\t\t\tconst percent = totalBytes === 0 ? 0 : transferredBytes / totalBytes;\n\t\t\t\t\t\t\t\tonDownloadProgress({percent, transferredBytes, totalBytes}, value);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcontroller.enqueue(value);\n\t\t\t\t\t\t\tawait read();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tawait read();\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\t}\n\n\tconst validateAndMerge = (...sources) => {\n\t\tfor (const source of sources) {\n\t\t\tif ((!isObject(source) || Array.isArray(source)) && typeof source !== 'undefined') {\n\t\t\t\tthrow new TypeError('The `options` argument must be an object');\n\t\t\t}\n\t\t}\n\n\t\treturn deepMerge({}, ...sources);\n\t};\n\n\tconst createInstance = defaults => {\n\t\tconst ky = (input, options) => new Ky(input, validateAndMerge(defaults, options));\n\n\t\tfor (const method of requestMethods) {\n\t\t\tky[method] = (input, options) => new Ky(input, validateAndMerge(defaults, options, {method}));\n\t\t}\n\n\t\tky.HTTPError = HTTPError;\n\t\tky.TimeoutError = TimeoutError;\n\t\tky.create = newDefaults => createInstance(validateAndMerge(newDefaults));\n\t\tky.extend = newDefaults => createInstance(validateAndMerge(defaults, newDefaults));\n\t\tky.stop = stop;\n\n\t\treturn ky;\n\t};\n\n\tconst ky = createInstance();\n\n\treturn ky;\n\n})));\n","'use strict';\n\nconst copyProperty = (to, from, property, ignoreNonConfigurable) => {\n\t// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.\n\t// `Function#prototype` is non-writable and non-configurable so can never be modified.\n\tif (property === 'length' || property === 'prototype') {\n\t\treturn;\n\t}\n\n\tconst toDescriptor = Object.getOwnPropertyDescriptor(to, property);\n\tconst fromDescriptor = Object.getOwnPropertyDescriptor(from, property);\n\n\tif (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {\n\t\treturn;\n\t}\n\n\tObject.defineProperty(to, property, fromDescriptor);\n};\n\n// `Object.defineProperty()` throws if the property exists, is not configurable and either:\n// - one its descriptors is changed\n// - it is non-writable and its value is changed\nconst canCopyProperty = function (toDescriptor, fromDescriptor) {\n\treturn toDescriptor === undefined || toDescriptor.configurable || (\n\t\ttoDescriptor.writable === fromDescriptor.writable &&\n\t\ttoDescriptor.enumerable === fromDescriptor.enumerable &&\n\t\ttoDescriptor.configurable === fromDescriptor.configurable &&\n\t\t(toDescriptor.writable || toDescriptor.value === fromDescriptor.value)\n\t);\n};\n\nconst changePrototype = (to, from) => {\n\tconst fromPrototype = Object.getPrototypeOf(from);\n\tif (fromPrototype === Object.getPrototypeOf(to)) {\n\t\treturn;\n\t}\n\n\tObject.setPrototypeOf(to, fromPrototype);\n};\n\nconst wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/\\n${fromBody}`;\n\nconst toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, 'toString');\nconst toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, 'name');\n\n// We call `from.toString()` early (not lazily) to ensure `from` can be garbage collected.\n// We use `bind()` instead of a closure for the same reason.\n// Calling `from.toString()` early also allows caching it in case `to.toString()` is called several times.\nconst changeToString = (to, from, name) => {\n\tconst withName = name === '' ? '' : `with ${name.trim()}() `;\n\tconst newToString = wrappedToString.bind(null, withName, from.toString());\n\t// Ensure `to.toString.toString` is non-enumerable and has the same `same`\n\tObject.defineProperty(newToString, 'name', toStringName);\n\tObject.defineProperty(to, 'toString', {...toStringDescriptor, value: newToString});\n};\n\nconst mimicFn = (to, from, {ignoreNonConfigurable = false} = {}) => {\n\tconst {name} = to;\n\n\tfor (const property of Reflect.ownKeys(from)) {\n\t\tcopyProperty(to, from, property, ignoreNonConfigurable);\n\t}\n\n\tchangePrototype(to, from);\n\tchangeToString(to, from, name);\n\n\treturn to;\n};\n\nmodule.exports = mimicFn;\n","'use strict'\n\nmodule.exports = {\n isFunction: obj => typeof obj === 'function',\n isString: obj => typeof obj === 'string',\n composeErrorMessage: (code, description) => `${code}, ${description}`,\n inherits: (ctor, superCtor) => {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n}\n","'use strict'\n\nconst {isFunction, composeErrorMessage} = require('./helpers')\n\nfunction interfaceObject (error, ...props) {\n Object.assign(error, ...props)\n\n error.description = isFunction(error.message) ? error.message(error) : error.message\n\n error.message = error.code\n ? composeErrorMessage(error.code, error.description)\n : error.description\n}\n\nmodule.exports = interfaceObject\n","'use strict'\n\nconst cleanStack = require('clean-stack')\nconst mimicFn = require('mimic-fn')\n\nconst addErrorProps = require('./add-error-props')\nconst {isString} = require('./helpers')\n\nfunction createExtendError (ErrorClass, classProps) {\n function ExtendError (props) {\n const error = new ErrorClass()\n const errorProps = isString(props) ? {message: props} : props\n addErrorProps(error, classProps, errorProps)\n\n error.stack = cleanStack(error.stack)\n return error\n }\n\n ExtendError.prototype = ErrorClass.prototype\n mimicFn(ExtendError, ErrorClass)\n\n return ExtendError\n}\n\nmodule.exports = createExtendError\n","'use strict'\n\nconst {inherits} = require('./helpers')\nconst mimicFn = require('mimic-fn')\n\nconst REGEX_CLASS_NAME = /[^0-9a-zA-Z_$]/\n\nfunction createError (className) {\n if (typeof className !== 'string') {\n throw new TypeError('Expected className to be a string')\n }\n\n if (REGEX_CLASS_NAME.test(className)) {\n throw new Error('className contains invalid characters')\n }\n\n function ErrorClass () {\n Object.defineProperty(this, 'name', {\n configurable: true,\n value: className,\n writable: true\n })\n\n Error.captureStackTrace(this, this.constructor)\n }\n\n inherits(ErrorClass, Error)\n mimicFn(ErrorClass, Error)\n return ErrorClass\n}\n\nmodule.exports = createError\n","'use strict'\n\nconst createExtendError = require('./create-extend-error')\nconst createError = require('./create-error')\n\nconst createErrorClass = ErrorClass => (className, props) => {\n const errorClass = createError(className || ErrorClass.name)\n return createExtendError(errorClass, props)\n}\n\nmodule.exports = createErrorClass(Error)\nmodule.exports.type = createErrorClass(TypeError)\nmodule.exports.range = createErrorClass(RangeError)\nmodule.exports.eval = createErrorClass(EvalError)\nmodule.exports.syntax = createErrorClass(SyntaxError)\nmodule.exports.reference = createErrorClass(ReferenceError)\nmodule.exports.uri = createErrorClass(URIError)\n","const ENDPOINT = {\n FREE: 'https://api.microlink.io',\n PRO: 'https://pro.microlink.io'\n}\n\nconst isObject = input => typeof input === 'object'\n\nconst pickBy = obj => {\n Object.keys(obj).forEach(key => obj[key] == null && delete obj[key])\n return obj\n}\n\nconst parseBody = (input, error, url) => {\n try {\n return JSON.parse(input)\n } catch (_) {\n const message = input || error.message\n\n return {\n status: 'error',\n data: { url: message },\n more: 'https://microlink.io/efatal',\n code: 'EFATAL',\n message,\n url\n }\n }\n}\n\nconst factory = ({ VERSION, MicrolinkError, isUrlHttp, stringify, got, flatten }) => {\n const assertUrl = (url = '') => {\n if (!isUrlHttp(url)) {\n const message = `The \\`url\\` as \\`${url}\\` is not valid. Ensure it has protocol (http or https) and hostname.`\n throw new MicrolinkError({\n status: 'fail',\n data: { url: message },\n more: 'https://microlink.io/docs/api/api-parameters/url',\n code: 'EINVALURLCLIENT',\n message,\n url\n })\n }\n }\n\n const mapRules = rules => {\n if (!isObject(rules)) return\n const flatRules = flatten(rules)\n return Object.keys(flatRules).reduce(\n (acc, key) => ({ ...acc, [`data.${key}`]: flatRules[key] }),\n {}\n )\n }\n\n const fetchFromApi = async (apiUrl, opts = {}) => {\n try {\n const response = await got(apiUrl, opts)\n return opts.responseType === 'buffer'\n ? { body: response.body, response }\n : { ...response.body, response }\n } catch (err) {\n const { response = {} } = err\n const { statusCode, body: rawBody, headers, url: uri = apiUrl } = response\n\n const body =\n isObject(rawBody) && !Buffer.isBuffer(rawBody) ? rawBody : parseBody(rawBody, err, uri)\n\n throw MicrolinkError({\n ...body,\n message: body.message,\n url: uri,\n statusCode,\n headers\n })\n }\n }\n\n const getApiUrl = (\n url,\n { data, apiKey, endpoint, retry, cache, ...opts } = {},\n { responseType = 'json', headers: gotHeaders, ...gotOpts } = {}\n ) => {\n const isPro = !!apiKey\n const apiEndpoint = endpoint || ENDPOINT[isPro ? 'PRO' : 'FREE']\n\n const apiUrl = `${apiEndpoint}?${stringify({\n url,\n ...mapRules(data),\n ...flatten(pickBy(opts))\n })}`\n\n const headers = isPro ? { ...gotHeaders, 'x-api-key': apiKey } : { ...gotHeaders }\n return [apiUrl, { ...gotOpts, responseType, cache, retry, headers }]\n }\n\n const createMql = defaultOpts => async (url, opts, gotOpts) => {\n assertUrl(url)\n const [apiUrl, fetchOpts] = getApiUrl(url, opts, {\n ...defaultOpts,\n ...gotOpts\n })\n return fetchFromApi(apiUrl, fetchOpts)\n }\n\n const mql = createMql()\n mql.MicrolinkError = MicrolinkError\n mql.getApiUrl = getApiUrl\n mql.fetchFromApi = fetchFromApi\n mql.mapRules = mapRules\n mql.version = VERSION\n mql.stream = got.stream\n mql.buffer = createMql({ responseType: 'buffer' })\n\n return mql\n}\n\nmodule.exports = factory\n","'use strict'\n\nconst isUrlHttp = require('is-url-http/lightweight')\nconst { flattie: flatten } = require('flattie')\nconst { encode: stringify } = require('qss')\nconst ky = require('./ky')\nconst whoops = require('whoops')\n\nconst factory = require('./factory')\n\nconst MicrolinkError = whoops('MicrolinkError')\n\nconst got = async (url, opts) => {\n try {\n if (opts.timeout === undefined) opts.timeout = false\n const response = await ky(url, opts)\n const body = await response.json()\n const { headers, status: statusCode, statusText: statusMessage } = response\n return { url: response.url, body, headers, statusCode, statusMessage }\n } catch (err) {\n if (err.response) {\n const { response } = err\n err.response = {\n ...response,\n headers: [...response.headers.entries()].reduce(\n (acc, [key, value]) => ({ ...acc, [key]: value }),\n {}\n ),\n statusCode: response.status,\n body: await response.text()\n }\n }\n throw err\n }\n}\n\nmodule.exports = factory({\n MicrolinkError,\n isUrlHttp,\n stringify,\n got,\n flatten,\n VERSION: '__MQL_VERSION__'\n})\n"],"names":["URL","global","require$$0","this","mimicFn","createError","createExtendError","whoops","factory","isUrlHttp"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEA,MAAMA,KAAG,GA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MAAM,EAAE,CAAC,GAAG,EAAE,IAAI,EAAC;CACxC,IAAI,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,GAAE;CACtC,IAAI,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,SAAQ;CAC/E,IAAI,OAAO,EAAE,GAAG,EAAE,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE;CAC1E,GAAG,CAAC,OAAO,GAAG,EAAE;CAChB,IAAI,IAAI,GAAG,CAAC,QAAQ,EAAE;CACtB,MAAM,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAG;CAC9B,MAAM,GAAG,CAAC,QAAQ,GAAG;CACrB,QAAQ,GAAG,QAAQ;CACnB,QAAQ,OAAO,EAAE,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM;CACvD,UAAU,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,EAAE,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,KAAK,EAAE,CAAC;CAC3D,UAAU,EAAE;CACZ,SAAS;CACT,QAAQ,UAAU,EAAE,QAAQ,CAAC,MAAM;CACnC,QAAQ,IAAI,EAAE,MAAM,QAAQ,CAAC,IAAI,EAAE;CACnC,QAAO;CACP,KAAK;CACL,IAAI,MAAM,GAAG;CACb,GAAG;CACH,EAAC;AACD;YACc,GAAGC,SAAO,CAAC;CACzB,EAAE,cAAc;CAChB,aAAEC,WAAS;CACX,EAAE,SAAS;CACX,EAAE,GAAG;CACL,EAAE,OAAO;CACT,EAAE,OAAO,EAAE,OAAiB;CAC5B,CAAC;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"mql.js","sources":["../node_modules/is-url-http/lightweight.js","../node_modules/flattie/dist/index.js","../node_modules/qss/dist/qss.m.js","../node_modules/mimic-fn/index.js","../node_modules/whoops/lib/helpers.js","../node_modules/whoops/lib/add-error-props.js","../node_modules/whoops/lib/create-extend-error.js","../node_modules/whoops/lib/create-error.js","../node_modules/whoops/lib/index.js","../src/factory.js","../src/ky.js","../src/browser.js"],"sourcesContent":["'use strict'\n\nconst URL = global.window ? window.URL : require('url').URL\nconst REGEX_HTTP_PROTOCOL = /^https?:\\/\\//i\n\nmodule.exports = url => {\n try {\n return REGEX_HTTP_PROTOCOL.test(new URL(url).href)\n } catch (err) {\n return false\n }\n}\n","function iter(output, nullish, sep, val, key) {\n\tvar k, pfx = key ? (key + sep) : key;\n\n\tif (val == null) {\n\t\tif (nullish) output[key] = val;\n\t} else if (typeof val != 'object') {\n\t\toutput[key] = val;\n\t} else if (Array.isArray(val)) {\n\t\tfor (k=0; k < val.length; k++) {\n\t\t\titer(output, nullish, sep, val[k], pfx + k);\n\t\t}\n\t} else {\n\t\tfor (k in val) {\n\t\t\titer(output, nullish, sep, val[k], pfx + k);\n\t\t}\n\t}\n}\n\nfunction flattie(input, glue, toNull) {\n\tvar output = {};\n\tif (typeof input == 'object') {\n\t\titer(output, !!toNull, glue || '.', input, '');\n\t}\n\treturn output;\n}\n\nexports.flattie = flattie;","export function encode(obj, pfx) {\n\tvar k, i, tmp, str='';\n\n\tfor (k in obj) {\n\t\tif ((tmp = obj[k]) !== void 0) {\n\t\t\tif (Array.isArray(tmp)) {\n\t\t\t\tfor (i=0; i < tmp.length; i++) {\n\t\t\t\t\tstr && (str += '&');\n\t\t\t\t\tstr += encodeURIComponent(k) + '=' + encodeURIComponent(tmp[i]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstr && (str += '&');\n\t\t\t\tstr += encodeURIComponent(k) + '=' + encodeURIComponent(tmp);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn (pfx || '') + str;\n}\n\nfunction toValue(mix) {\n\tif (!mix) return '';\n\tvar str = decodeURIComponent(mix);\n\tif (str === 'false') return false;\n\tif (str === 'true') return true;\n\treturn (+str * 0 === 0) ? (+str) : str;\n}\n\nexport function decode(str) {\n\tvar tmp, k, out={}, arr=str.split('&');\n\n\twhile (tmp = arr.shift()) {\n\t\ttmp = tmp.split('=');\n\t\tk = tmp.shift();\n\t\tif (out[k] !== void 0) {\n\t\t\tout[k] = [].concat(out[k], toValue(tmp.shift()));\n\t\t} else {\n\t\t\tout[k] = toValue(tmp.shift());\n\t\t}\n\t}\n\n\treturn out;\n}\n","'use strict';\n\nconst copyProperty = (to, from, property, ignoreNonConfigurable) => {\n\t// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.\n\t// `Function#prototype` is non-writable and non-configurable so can never be modified.\n\tif (property === 'length' || property === 'prototype') {\n\t\treturn;\n\t}\n\n\tconst toDescriptor = Object.getOwnPropertyDescriptor(to, property);\n\tconst fromDescriptor = Object.getOwnPropertyDescriptor(from, property);\n\n\tif (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {\n\t\treturn;\n\t}\n\n\tObject.defineProperty(to, property, fromDescriptor);\n};\n\n// `Object.defineProperty()` throws if the property exists, is not configurable and either:\n// - one its descriptors is changed\n// - it is non-writable and its value is changed\nconst canCopyProperty = function (toDescriptor, fromDescriptor) {\n\treturn toDescriptor === undefined || toDescriptor.configurable || (\n\t\ttoDescriptor.writable === fromDescriptor.writable &&\n\t\ttoDescriptor.enumerable === fromDescriptor.enumerable &&\n\t\ttoDescriptor.configurable === fromDescriptor.configurable &&\n\t\t(toDescriptor.writable || toDescriptor.value === fromDescriptor.value)\n\t);\n};\n\nconst changePrototype = (to, from) => {\n\tconst fromPrototype = Object.getPrototypeOf(from);\n\tif (fromPrototype === Object.getPrototypeOf(to)) {\n\t\treturn;\n\t}\n\n\tObject.setPrototypeOf(to, fromPrototype);\n};\n\nconst wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/\\n${fromBody}`;\n\nconst toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, 'toString');\nconst toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, 'name');\n\n// We call `from.toString()` early (not lazily) to ensure `from` can be garbage collected.\n// We use `bind()` instead of a closure for the same reason.\n// Calling `from.toString()` early also allows caching it in case `to.toString()` is called several times.\nconst changeToString = (to, from, name) => {\n\tconst withName = name === '' ? '' : `with ${name.trim()}() `;\n\tconst newToString = wrappedToString.bind(null, withName, from.toString());\n\t// Ensure `to.toString.toString` is non-enumerable and has the same `same`\n\tObject.defineProperty(newToString, 'name', toStringName);\n\tObject.defineProperty(to, 'toString', {...toStringDescriptor, value: newToString});\n};\n\nconst mimicFn = (to, from, {ignoreNonConfigurable = false} = {}) => {\n\tconst {name} = to;\n\n\tfor (const property of Reflect.ownKeys(from)) {\n\t\tcopyProperty(to, from, property, ignoreNonConfigurable);\n\t}\n\n\tchangePrototype(to, from);\n\tchangeToString(to, from, name);\n\n\treturn to;\n};\n\nmodule.exports = mimicFn;\n","'use strict'\n\nmodule.exports = {\n isFunction: obj => typeof obj === 'function',\n isString: obj => typeof obj === 'string',\n composeErrorMessage: (code, description) => `${code}, ${description}`,\n inherits: (ctor, superCtor) => {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n}\n","'use strict'\n\nconst {isFunction, composeErrorMessage} = require('./helpers')\n\nfunction interfaceObject (error, ...props) {\n Object.assign(error, ...props)\n\n error.description = isFunction(error.message) ? error.message(error) : error.message\n\n error.message = error.code\n ? composeErrorMessage(error.code, error.description)\n : error.description\n}\n\nmodule.exports = interfaceObject\n","'use strict'\n\nconst cleanStack = require('clean-stack')\nconst mimicFn = require('mimic-fn')\n\nconst addErrorProps = require('./add-error-props')\nconst {isString} = require('./helpers')\n\nfunction createExtendError (ErrorClass, classProps) {\n function ExtendError (props) {\n const error = new ErrorClass()\n const errorProps = isString(props) ? {message: props} : props\n addErrorProps(error, classProps, errorProps)\n\n error.stack = cleanStack(error.stack)\n return error\n }\n\n ExtendError.prototype = ErrorClass.prototype\n mimicFn(ExtendError, ErrorClass)\n\n return ExtendError\n}\n\nmodule.exports = createExtendError\n","'use strict'\n\nconst {inherits} = require('./helpers')\nconst mimicFn = require('mimic-fn')\n\nconst REGEX_CLASS_NAME = /[^0-9a-zA-Z_$]/\n\nfunction createError (className) {\n if (typeof className !== 'string') {\n throw new TypeError('Expected className to be a string')\n }\n\n if (REGEX_CLASS_NAME.test(className)) {\n throw new Error('className contains invalid characters')\n }\n\n function ErrorClass () {\n Object.defineProperty(this, 'name', {\n configurable: true,\n value: className,\n writable: true\n })\n\n Error.captureStackTrace(this, this.constructor)\n }\n\n inherits(ErrorClass, Error)\n mimicFn(ErrorClass, Error)\n return ErrorClass\n}\n\nmodule.exports = createError\n","'use strict'\n\nconst createExtendError = require('./create-extend-error')\nconst createError = require('./create-error')\n\nconst createErrorClass = ErrorClass => (className, props) => {\n const errorClass = createError(className || ErrorClass.name)\n return createExtendError(errorClass, props)\n}\n\nmodule.exports = createErrorClass(Error)\nmodule.exports.type = createErrorClass(TypeError)\nmodule.exports.range = createErrorClass(RangeError)\nmodule.exports.eval = createErrorClass(EvalError)\nmodule.exports.syntax = createErrorClass(SyntaxError)\nmodule.exports.reference = createErrorClass(ReferenceError)\nmodule.exports.uri = createErrorClass(URIError)\n","const ENDPOINT = {\n FREE: 'https://api.microlink.io',\n PRO: 'https://pro.microlink.io'\n}\n\nconst isObject = input => typeof input === 'object'\n\nconst pickBy = obj => {\n Object.keys(obj).forEach(key => obj[key] == null && delete obj[key])\n return obj\n}\n\nconst parseBody = (input, error, url) => {\n try {\n return JSON.parse(input)\n } catch (_) {\n const message = input || error.message\n\n return {\n status: 'error',\n data: { url: message },\n more: 'https://microlink.io/efatal',\n code: 'EFATAL',\n message,\n url\n }\n }\n}\n\nconst factory = ({ VERSION, MicrolinkError, isUrlHttp, stringify, got, flatten }) => {\n const assertUrl = (url = '') => {\n if (!isUrlHttp(url)) {\n const message = `The \\`url\\` as \\`${url}\\` is not valid. Ensure it has protocol (http or https) and hostname.`\n throw new MicrolinkError({\n status: 'fail',\n data: { url: message },\n more: 'https://microlink.io/docs/api/api-parameters/url',\n code: 'EINVALURLCLIENT',\n message,\n url\n })\n }\n }\n\n const mapRules = rules => {\n if (!isObject(rules)) return\n const flatRules = flatten(rules)\n return Object.keys(flatRules).reduce(\n (acc, key) => ({ ...acc, [`data.${key}`]: flatRules[key] }),\n {}\n )\n }\n\n const fetchFromApi = async (apiUrl, opts = {}) => {\n try {\n const response = await got(apiUrl, opts)\n return opts.responseType === 'buffer'\n ? { body: response.body, response }\n : { ...response.body, response }\n } catch (err) {\n const { response = {} } = err\n const { statusCode, body: rawBody, headers, url: uri = apiUrl } = response\n\n const body =\n isObject(rawBody) && !Buffer.isBuffer(rawBody) ? rawBody : parseBody(rawBody, err, uri)\n\n throw MicrolinkError({\n ...body,\n message: body.message,\n url: uri,\n statusCode,\n headers\n })\n }\n }\n\n const getApiUrl = (\n url,\n { data, apiKey, endpoint, retry, cache, ...opts } = {},\n { responseType = 'json', headers: gotHeaders, ...gotOpts } = {}\n ) => {\n const isPro = !!apiKey\n const apiEndpoint = endpoint || ENDPOINT[isPro ? 'PRO' : 'FREE']\n\n const apiUrl = `${apiEndpoint}?${stringify({\n url,\n ...mapRules(data),\n ...flatten(pickBy(opts))\n })}`\n\n const headers = isPro ? { ...gotHeaders, 'x-api-key': apiKey } : { ...gotHeaders }\n return [apiUrl, { ...gotOpts, responseType, cache, retry, headers }]\n }\n\n const createMql = defaultOpts => async (url, opts, gotOpts) => {\n assertUrl(url)\n const [apiUrl, fetchOpts] = getApiUrl(url, opts, {\n ...defaultOpts,\n ...gotOpts\n })\n return fetchFromApi(apiUrl, fetchOpts)\n }\n\n const mql = createMql()\n mql.MicrolinkError = MicrolinkError\n mql.getApiUrl = getApiUrl\n mql.fetchFromApi = fetchFromApi\n mql.mapRules = mapRules\n mql.version = VERSION\n mql.stream = got.stream\n mql.buffer = createMql({ responseType: 'buffer' })\n\n return mql\n}\n\nmodule.exports = factory\n","(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.ky = factory());\n}(this, (function () { 'use strict';\n\n\t/*! MIT License © Sindre Sorhus */\n\n\tconst isObject = value => value !== null && typeof value === 'object';\n\tconst supportsAbortController = typeof globalThis.AbortController === 'function';\n\tconst supportsStreams = typeof globalThis.ReadableStream === 'function';\n\tconst supportsFormData = typeof globalThis.FormData === 'function';\n\n\tconst mergeHeaders = (source1, source2) => {\n\t\tconst result = new globalThis.Headers(source1 || {});\n\t\tconst isHeadersInstance = source2 instanceof globalThis.Headers;\n\t\tconst source = new globalThis.Headers(source2 || {});\n\n\t\tfor (const [key, value] of source) {\n\t\t\tif ((isHeadersInstance && value === 'undefined') || value === undefined) {\n\t\t\t\tresult.delete(key);\n\t\t\t} else {\n\t\t\t\tresult.set(key, value);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t};\n\n\tconst deepMerge = (...sources) => {\n\t\tlet returnValue = {};\n\t\tlet headers = {};\n\n\t\tfor (const source of sources) {\n\t\t\tif (Array.isArray(source)) {\n\t\t\t\tif (!(Array.isArray(returnValue))) {\n\t\t\t\t\treturnValue = [];\n\t\t\t\t}\n\n\t\t\t\treturnValue = [...returnValue, ...source];\n\t\t\t} else if (isObject(source)) {\n\t\t\t\tfor (let [key, value] of Object.entries(source)) {\n\t\t\t\t\tif (isObject(value) && (key in returnValue)) {\n\t\t\t\t\t\tvalue = deepMerge(returnValue[key], value);\n\t\t\t\t\t}\n\n\t\t\t\t\treturnValue = {...returnValue, [key]: value};\n\t\t\t\t}\n\n\t\t\t\tif (isObject(source.headers)) {\n\t\t\t\t\theaders = mergeHeaders(headers, source.headers);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturnValue.headers = headers;\n\t\t}\n\n\t\treturn returnValue;\n\t};\n\n\tconst requestMethods = [\n\t\t'get',\n\t\t'post',\n\t\t'put',\n\t\t'patch',\n\t\t'head',\n\t\t'delete'\n\t];\n\n\tconst responseTypes = {\n\t\tjson: 'application/json',\n\t\ttext: 'text/*',\n\t\tformData: 'multipart/form-data',\n\t\tarrayBuffer: '*/*',\n\t\tblob: '*/*'\n\t};\n\n\tconst retryMethods = [\n\t\t'get',\n\t\t'put',\n\t\t'head',\n\t\t'delete',\n\t\t'options',\n\t\t'trace'\n\t];\n\n\tconst retryStatusCodes = [\n\t\t408,\n\t\t413,\n\t\t429,\n\t\t500,\n\t\t502,\n\t\t503,\n\t\t504\n\t];\n\n\tconst retryAfterStatusCodes = [\n\t\t413,\n\t\t429,\n\t\t503\n\t];\n\n\tconst stop = Symbol('stop');\n\n\tclass HTTPError extends Error {\n\t\tconstructor(response, request, options) {\n\t\t\t// Set the message to the status text, such as Unauthorized,\n\t\t\t// with some fallbacks. This message should never be undefined.\n\t\t\tsuper(\n\t\t\t\tresponse.statusText ||\n\t\t\t\tString(\n\t\t\t\t\t(response.status === 0 || response.status) ?\n\t\t\t\t\t\tresponse.status : 'Unknown response error'\n\t\t\t\t)\n\t\t\t);\n\t\t\tthis.name = 'HTTPError';\n\t\t\tthis.response = response;\n\t\t\tthis.request = request;\n\t\t\tthis.options = options;\n\t\t}\n\t}\n\n\tclass TimeoutError extends Error {\n\t\tconstructor(request) {\n\t\t\tsuper('Request timed out');\n\t\t\tthis.name = 'TimeoutError';\n\t\t\tthis.request = request;\n\t\t}\n\t}\n\n\tconst delay = ms => new Promise(resolve => setTimeout(resolve, ms));\n\n\t// `Promise.race()` workaround (#91)\n\tconst timeout = (request, abortController, options) =>\n\t\tnew Promise((resolve, reject) => {\n\t\t\tconst timeoutID = setTimeout(() => {\n\t\t\t\tif (abortController) {\n\t\t\t\t\tabortController.abort();\n\t\t\t\t}\n\n\t\t\t\treject(new TimeoutError(request));\n\t\t\t}, options.timeout);\n\n\t\t\t/* eslint-disable promise/prefer-await-to-then */\n\t\t\toptions.fetch(request)\n\t\t\t\t.then(resolve)\n\t\t\t\t.catch(reject)\n\t\t\t\t.then(() => {\n\t\t\t\t\tclearTimeout(timeoutID);\n\t\t\t\t});\n\t\t\t/* eslint-enable promise/prefer-await-to-then */\n\t\t});\n\n\tconst normalizeRequestMethod = input => requestMethods.includes(input) ? input.toUpperCase() : input;\n\n\tconst defaultRetryOptions = {\n\t\tlimit: 2,\n\t\tmethods: retryMethods,\n\t\tstatusCodes: retryStatusCodes,\n\t\tafterStatusCodes: retryAfterStatusCodes\n\t};\n\n\tconst normalizeRetryOptions = (retry = {}) => {\n\t\tif (typeof retry === 'number') {\n\t\t\treturn {\n\t\t\t\t...defaultRetryOptions,\n\t\t\t\tlimit: retry\n\t\t\t};\n\t\t}\n\n\t\tif (retry.methods && !Array.isArray(retry.methods)) {\n\t\t\tthrow new Error('retry.methods must be an array');\n\t\t}\n\n\t\tif (retry.statusCodes && !Array.isArray(retry.statusCodes)) {\n\t\t\tthrow new Error('retry.statusCodes must be an array');\n\t\t}\n\n\t\treturn {\n\t\t\t...defaultRetryOptions,\n\t\t\t...retry,\n\t\t\tafterStatusCodes: retryAfterStatusCodes\n\t\t};\n\t};\n\n\t// The maximum value of a 32bit int (see issue #117)\n\tconst maxSafeTimeout = 2147483647;\n\n\tclass Ky {\n\t\tconstructor(input, options = {}) {\n\t\t\tthis._retryCount = 0;\n\t\t\tthis._input = input;\n\t\t\tthis._options = {\n\t\t\t\t// TODO: credentials can be removed when the spec change is implemented in all browsers. Context: https://www.chromestatus.com/feature/4539473312350208\n\t\t\t\tcredentials: this._input.credentials || 'same-origin',\n\t\t\t\t...options,\n\t\t\t\theaders: mergeHeaders(this._input.headers, options.headers),\n\t\t\t\thooks: deepMerge({\n\t\t\t\t\tbeforeRequest: [],\n\t\t\t\t\tbeforeRetry: [],\n\t\t\t\t\tafterResponse: []\n\t\t\t\t}, options.hooks),\n\t\t\t\tmethod: normalizeRequestMethod(options.method || this._input.method),\n\t\t\t\tprefixUrl: String(options.prefixUrl || ''),\n\t\t\t\tretry: normalizeRetryOptions(options.retry),\n\t\t\t\tthrowHttpErrors: options.throwHttpErrors !== false,\n\t\t\t\ttimeout: typeof options.timeout === 'undefined' ? 10000 : options.timeout,\n\t\t\t\tfetch: options.fetch || globalThis.fetch.bind(globalThis)\n\t\t\t};\n\n\t\t\tif (typeof this._input !== 'string' && !(this._input instanceof URL || this._input instanceof globalThis.Request)) {\n\t\t\t\tthrow new TypeError('`input` must be a string, URL, or Request');\n\t\t\t}\n\n\t\t\tif (this._options.prefixUrl && typeof this._input === 'string') {\n\t\t\t\tif (this._input.startsWith('/')) {\n\t\t\t\t\tthrow new Error('`input` must not begin with a slash when using `prefixUrl`');\n\t\t\t\t}\n\n\t\t\t\tif (!this._options.prefixUrl.endsWith('/')) {\n\t\t\t\t\tthis._options.prefixUrl += '/';\n\t\t\t\t}\n\n\t\t\t\tthis._input = this._options.prefixUrl + this._input;\n\t\t\t}\n\n\t\t\tif (supportsAbortController) {\n\t\t\t\tthis.abortController = new globalThis.AbortController();\n\t\t\t\tif (this._options.signal) {\n\t\t\t\t\tthis._options.signal.addEventListener('abort', () => {\n\t\t\t\t\t\tthis.abortController.abort();\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tthis._options.signal = this.abortController.signal;\n\t\t\t}\n\n\t\t\tthis.request = new globalThis.Request(this._input, this._options);\n\n\t\t\tif (this._options.searchParams) {\n\t\t\t\tconst textSearchParams = typeof this._options.searchParams === 'string' ?\n\t\t\t\t\tthis._options.searchParams.replace(/^\\?/, '') :\n\t\t\t\t\tnew URLSearchParams(this._options.searchParams).toString();\n\t\t\t\tconst searchParams = '?' + textSearchParams;\n\t\t\t\tconst url = this.request.url.replace(/(?:\\?.*?)?(?=#|$)/, searchParams);\n\n\t\t\t\t// To provide correct form boundary, Content-Type header should be deleted each time when new Request instantiated from another one\n\t\t\t\tif (((supportsFormData && this._options.body instanceof globalThis.FormData) || this._options.body instanceof URLSearchParams) && !(this._options.headers && this._options.headers['content-type'])) {\n\t\t\t\t\tthis.request.headers.delete('content-type');\n\t\t\t\t}\n\n\t\t\t\tthis.request = new globalThis.Request(new globalThis.Request(url, this.request), this._options);\n\t\t\t}\n\n\t\t\tif (this._options.json !== undefined) {\n\t\t\t\tthis._options.body = JSON.stringify(this._options.json);\n\t\t\t\tthis.request.headers.set('content-type', 'application/json');\n\t\t\t\tthis.request = new globalThis.Request(this.request, {body: this._options.body});\n\t\t\t}\n\n\t\t\tconst fn = async () => {\n\t\t\t\tif (this._options.timeout > maxSafeTimeout) {\n\t\t\t\t\tthrow new RangeError(`The \\`timeout\\` option cannot be greater than ${maxSafeTimeout}`);\n\t\t\t\t}\n\n\t\t\t\tawait delay(1);\n\t\t\t\tlet response = await this._fetch();\n\n\t\t\t\tfor (const hook of this._options.hooks.afterResponse) {\n\t\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\t\tconst modifiedResponse = await hook(\n\t\t\t\t\t\tthis.request,\n\t\t\t\t\t\tthis._options,\n\t\t\t\t\t\tthis._decorateResponse(response.clone())\n\t\t\t\t\t);\n\n\t\t\t\t\tif (modifiedResponse instanceof globalThis.Response) {\n\t\t\t\t\t\tresponse = modifiedResponse;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis._decorateResponse(response);\n\n\t\t\t\tif (!response.ok && this._options.throwHttpErrors) {\n\t\t\t\t\tthrow new HTTPError(response, this.request, this._options);\n\t\t\t\t}\n\n\t\t\t\t// If `onDownloadProgress` is passed, it uses the stream API internally\n\t\t\t\t/* istanbul ignore next */\n\t\t\t\tif (this._options.onDownloadProgress) {\n\t\t\t\t\tif (typeof this._options.onDownloadProgress !== 'function') {\n\t\t\t\t\t\tthrow new TypeError('The `onDownloadProgress` option must be a function');\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!supportsStreams) {\n\t\t\t\t\t\tthrow new Error('Streams are not supported in your environment. `ReadableStream` is missing.');\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this._stream(response.clone(), this._options.onDownloadProgress);\n\t\t\t\t}\n\n\t\t\t\treturn response;\n\t\t\t};\n\n\t\t\tconst isRetriableMethod = this._options.retry.methods.includes(this.request.method.toLowerCase());\n\t\t\tconst result = isRetriableMethod ? this._retry(fn) : fn();\n\n\t\t\tfor (const [type, mimeType] of Object.entries(responseTypes)) {\n\t\t\t\tresult[type] = async () => {\n\t\t\t\t\tthis.request.headers.set('accept', this.request.headers.get('accept') || mimeType);\n\n\t\t\t\t\tconst response = (await result).clone();\n\n\t\t\t\t\tif (type === 'json') {\n\t\t\t\t\t\tif (response.status === 204) {\n\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (options.parseJson) {\n\t\t\t\t\t\t\treturn options.parseJson(await response.text());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn response[type]();\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\t_calculateRetryDelay(error) {\n\t\t\tthis._retryCount++;\n\n\t\t\tif (this._retryCount < this._options.retry.limit && !(error instanceof TimeoutError)) {\n\t\t\t\tif (error instanceof HTTPError) {\n\t\t\t\t\tif (!this._options.retry.statusCodes.includes(error.response.status)) {\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst retryAfter = error.response.headers.get('Retry-After');\n\t\t\t\t\tif (retryAfter && this._options.retry.afterStatusCodes.includes(error.response.status)) {\n\t\t\t\t\t\tlet after = Number(retryAfter);\n\t\t\t\t\t\tif (Number.isNaN(after)) {\n\t\t\t\t\t\t\tafter = Date.parse(retryAfter) - Date.now();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tafter *= 1000;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (typeof this._options.retry.maxRetryAfter !== 'undefined' && after > this._options.retry.maxRetryAfter) {\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn after;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (error.response.status === 413) {\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst BACKOFF_FACTOR = 0.3;\n\t\t\t\treturn BACKOFF_FACTOR * (2 ** (this._retryCount - 1)) * 1000;\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t}\n\n\t\t_decorateResponse(response) {\n\t\t\tif (this._options.parseJson) {\n\t\t\t\tresponse.json = async () => {\n\t\t\t\t\treturn this._options.parseJson(await response.text());\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn response;\n\t\t}\n\n\t\tasync _retry(fn) {\n\t\t\ttry {\n\t\t\t\treturn await fn();\n\t\t\t} catch (error) {\n\t\t\t\tconst ms = Math.min(this._calculateRetryDelay(error), maxSafeTimeout);\n\t\t\t\tif (ms !== 0 && this._retryCount > 0) {\n\t\t\t\t\tawait delay(ms);\n\n\t\t\t\t\tfor (const hook of this._options.hooks.beforeRetry) {\n\t\t\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\t\t\tconst hookResult = await hook({\n\t\t\t\t\t\t\trequest: this.request,\n\t\t\t\t\t\t\toptions: this._options,\n\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t\tretryCount: this._retryCount\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t// If `stop` is returned from the hook, the retry process is stopped\n\t\t\t\t\t\tif (hookResult === stop) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this._retry(fn);\n\t\t\t\t}\n\n\t\t\t\tif (this._options.throwHttpErrors) {\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tasync _fetch() {\n\t\t\tfor (const hook of this._options.hooks.beforeRequest) {\n\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\tconst result = await hook(this.request, this._options);\n\n\t\t\t\tif (result instanceof Request) {\n\t\t\t\t\tthis.request = result;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (result instanceof Response) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this._options.timeout === false) {\n\t\t\t\treturn this._options.fetch(this.request.clone());\n\t\t\t}\n\n\t\t\treturn timeout(this.request.clone(), this.abortController, this._options);\n\t\t}\n\n\t\t/* istanbul ignore next */\n\t\t_stream(response, onDownloadProgress) {\n\t\t\tconst totalBytes = Number(response.headers.get('content-length')) || 0;\n\t\t\tlet transferredBytes = 0;\n\n\t\t\treturn new globalThis.Response(\n\t\t\t\tnew globalThis.ReadableStream({\n\t\t\t\t\tasync start(controller) {\n\t\t\t\t\t\tconst reader = response.body.getReader();\n\n\t\t\t\t\t\tif (onDownloadProgress) {\n\t\t\t\t\t\t\tonDownloadProgress({percent: 0, transferredBytes: 0, totalBytes}, new Uint8Array());\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tasync function read() {\n\t\t\t\t\t\t\tconst {done, value} = await reader.read();\n\t\t\t\t\t\t\tif (done) {\n\t\t\t\t\t\t\t\tcontroller.close();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (onDownloadProgress) {\n\t\t\t\t\t\t\t\ttransferredBytes += value.byteLength;\n\t\t\t\t\t\t\t\tconst percent = totalBytes === 0 ? 0 : transferredBytes / totalBytes;\n\t\t\t\t\t\t\t\tonDownloadProgress({percent, transferredBytes, totalBytes}, value);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcontroller.enqueue(value);\n\t\t\t\t\t\t\tawait read();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tawait read();\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\t}\n\n\tconst validateAndMerge = (...sources) => {\n\t\tfor (const source of sources) {\n\t\t\tif ((!isObject(source) || Array.isArray(source)) && typeof source !== 'undefined') {\n\t\t\t\tthrow new TypeError('The `options` argument must be an object');\n\t\t\t}\n\t\t}\n\n\t\treturn deepMerge({}, ...sources);\n\t};\n\n\tconst createInstance = defaults => {\n\t\tconst ky = (input, options) => new Ky(input, validateAndMerge(defaults, options));\n\n\t\tfor (const method of requestMethods) {\n\t\t\tky[method] = (input, options) => new Ky(input, validateAndMerge(defaults, options, {method}));\n\t\t}\n\n\t\tky.HTTPError = HTTPError;\n\t\tky.TimeoutError = TimeoutError;\n\t\tky.create = newDefaults => createInstance(validateAndMerge(newDefaults));\n\t\tky.extend = newDefaults => createInstance(validateAndMerge(defaults, newDefaults));\n\t\tky.stop = stop;\n\n\t\treturn ky;\n\t};\n\n\tconst ky = createInstance();\n\n\treturn ky;\n\n})));\n","'use strict'\n\nconst isUrlHttp = require('is-url-http/lightweight')\nconst { flattie: flatten } = require('flattie')\nconst { encode: stringify } = require('qss')\nconst whoops = require('whoops')\n\nconst factory = require('./factory')\nconst ky = require('./ky')\n\nconst MicrolinkError = whoops('MicrolinkError')\n\nconst got = async (url, opts) => {\n try {\n if (opts.timeout === undefined) opts.timeout = false\n const response = await ky(url, opts)\n const body = await response.json()\n const { headers, status: statusCode, statusText: statusMessage } = response\n return { url: response.url, body, headers, statusCode, statusMessage }\n } catch (err) {\n if (err.response) {\n const { response } = err\n err.response = {\n ...response,\n headers: [...response.headers.entries()].reduce(\n (acc, [key, value]) => ({ ...acc, [key]: value }),\n {}\n ),\n statusCode: response.status,\n body: await response.text()\n }\n }\n throw err\n }\n}\n\nmodule.exports = factory({\n MicrolinkError,\n isUrlHttp,\n stringify,\n got,\n flatten,\n VERSION: '__MQL_VERSION__'\n})\n"],"names":["URL","global","require$$0","mimicFn","addErrorProps","require$$1","require$$2","require$$3","createExtendError","createError","libModule","factory","this","require$$4","require$$5"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;CAEA,MAAMA,KAAG,GAAGC,cAAM,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,GAAGC,8BAAc,CAAC,IAAG;CAC3D,MAAM,mBAAm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OAAO,EAAE,OAAiB;CAC5B,CAAC;;;;;;;;"} \ No newline at end of file diff --git a/dist/mql.min.js b/dist/mql.min.js index 75c5c85..12c227a 100644 --- a/dist/mql.min.js +++ b/dist/mql.min.js @@ -1,4 +1,4 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("url")):"function"==typeof define&&define.amd?define(["url"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).mql=e(t.require$$0)}(this,(function(t){"use strict";function e(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=e(t),o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function s(t){if(t.__esModule)return t;var e=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(t).forEach((function(r){var o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,o.get?o:{enumerable:!0,get:function(){return t[r]}})})),e}const n=o.window?window.URL:r.default.URL,i=/^https?:\/\//i;function a(t,e,r,o,s){var n,i=s?s+r:s;if(null==o)e&&(t[s]=o);else if("object"!=typeof o)t[s]=o;else if(Array.isArray(o))for(n=0;nt}));const l=(t,e,r,o)=>{if("length"===r||"prototype"===r)return;const s=Object.getOwnPropertyDescriptor(t,r),n=Object.getOwnPropertyDescriptor(e,r);!d(s,n)&&o||Object.defineProperty(t,r,n)},d=function(t,e){return void 0===t||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},y=(t,e)=>`/* Wrapped ${t}*/\n${e}`,b=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),m=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");var g=(t,e,{ignoreNonConfigurable:r=!1}={})=>{const{name:o}=t;for(const o of Reflect.ownKeys(e))l(t,e,o,r);return((t,e)=>{const r=Object.getPrototypeOf(e);r!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,r)})(t,e),((t,e,r)=>{const o=""===r?"":`with ${r.trim()}() `,s=y.bind(null,o,e.toString());Object.defineProperty(s,"name",m),Object.defineProperty(t,"toString",{...b,value:s})})(t,e,o),t},w={isFunction:t=>"function"==typeof t,isString:t=>"string"==typeof t,composeErrorMessage:(t,e)=>`${t}, ${e}`,inherits:(t,e)=>{t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}};const{isFunction:_,composeErrorMessage:R}=w;const E=f,T=g,j=function(t,...e){Object.assign(t,...e),t.description=_(t.message)?t.message(t):t.message,t.message=t.code?R(t.code,t.description):t.description},{isString:v}=w;var x=function(t,e){function r(r){const o=new t,s=v(r)?{message:r}:r;return j(o,e,s),o.stack=E(o.stack),o}return r.prototype=t.prototype,T(r,t),r};const{inherits:O}=w,q=g,C=/[^0-9a-zA-Z_$]/;const P=x,A=function(t){if("string"!=typeof t)throw new TypeError("Expected className to be a string");if(C.test(t))throw new Error("className contains invalid characters");function e(){Object.defineProperty(this,"name",{configurable:!0,value:t,writable:!0}),Error.captureStackTrace(this,this.constructor)}return O(e,Error),q(e,Error),e},U=t=>(e,r)=>{const o=A(e||t.name);return P(o,r)};h.exports=U(Error),h.exports.type=U(TypeError),h.exports.range=U(RangeError),h.exports.eval=U(EvalError),h.exports.syntax=U(SyntaxError),h.exports.reference=U(ReferenceError),h.exports.uri=U(URIError);const S={FREE:"https://api.microlink.io",PRO:"https://pro.microlink.io"},k=t=>"object"==typeof t;var D=({VERSION:t,MicrolinkError:e,isUrlHttp:r,stringify:o,got:s,flatten:n})=>{const i=t=>{if(!k(t))return;const e=n(t);return Object.keys(e).reduce(((t,r)=>({...t,[`data.${r}`]:e[r]})),{})},a=async(t,r={})=>{try{const e=await s(t,r);return"buffer"===r.responseType?{body:e.body,response:e}:{...e.body,response:e}}catch(r){const{response:o={}}=r,{statusCode:s,body:n,headers:i,url:a=t}=o,u=k(n)&&!Buffer.isBuffer(n)?n:((t,e,r)=>{try{return JSON.parse(t)}catch(o){const s=t||e.message;return{status:"error",data:{url:s},more:"https://microlink.io/efatal",code:"EFATAL",message:s,url:r}}})(n,r,a);throw e({...u,message:u.message,url:a,statusCode:s,headers:i})}},u=(t,{data:e,apiKey:r,endpoint:s,retry:a,cache:u,...c}={},{responseType:p="json",headers:h,...f}={})=>{const l=!!r;var d;return[`${s||S[l?"PRO":"FREE"]}?${o({url:t,...i(e),...n((d=c,Object.keys(d).forEach((t=>null==d[t]&&delete d[t])),d))})}`,{...f,responseType:p,cache:u,retry:a,headers:l?{...h,"x-api-key":r}:{...h}}]},c=t=>async(o,s,n)=>{((t="")=>{if(!r(t)){const r=`The \`url\` as \`${t}\` is not valid. Ensure it has protocol (http or https) and hostname.`;throw new e({status:"fail",data:{url:r},more:"https://microlink.io/docs/api/api-parameters/url",code:"EINVALURLCLIENT",message:r,url:t})}})(o);const[i,c]=u(o,s,{...t,...n});return a(i,c)},p=c();return p.MicrolinkError=e,p.getApiUrl=u,p.fetchFromApi=a,p.mapRules=i,p.version=t,p.stream=s.stream,p.buffer=c({responseType:"buffer"}),p},$={exports:{}};!function(t,e){t.exports=function(){ /*! MIT License © Sindre Sorhus */ -const t=t=>null!==t&&"object"==typeof t,e="function"==typeof globalThis.AbortController,r="function"==typeof globalThis.ReadableStream,o="function"==typeof globalThis.FormData,s=(t,e)=>{const r=new globalThis.Headers(t||{}),o=e instanceof globalThis.Headers,s=new globalThis.Headers(e||{});for(const[t,e]of s)o&&"undefined"===e||void 0===e?r.delete(t):r.set(t,e);return r},n=(...e)=>{let r={},o={};for(const i of e){if(Array.isArray(i))Array.isArray(r)||(r=[]),r=[...r,...i];else if(t(i)){for(let[e,o]of Object.entries(i))t(o)&&e in r&&(o=n(r[e],o)),r={...r,[e]:o};t(i.headers)&&(o=s(o,i.headers))}r.headers=o}return r},i=["get","post","put","patch","head","delete"],a={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},u=["get","put","head","delete","options","trace"],c=[408,413,429,500,502,503,504],p=[413,429,503],h=Symbol("stop");class f extends Error{constructor(t,e,r){super(t.statusText||String(0===t.status||t.status?t.status:"Unknown response error")),this.name="HTTPError",this.response=t,this.request=e,this.options=r}}class l extends Error{constructor(t){super("Request timed out"),this.name="TimeoutError",this.request=t}}const d=t=>new Promise((e=>setTimeout(e,t))),y=(t,e,r)=>new Promise(((o,s)=>{const n=setTimeout((()=>{e&&e.abort(),s(new l(t))}),r.timeout);r.fetch(t).then(o).catch(s).then((()=>{clearTimeout(n)}))})),b=t=>i.includes(t)?t.toUpperCase():t,m={limit:2,methods:u,statusCodes:c,afterStatusCodes:p},g=(t={})=>{if("number"==typeof t)return{...m,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");return{...m,...t,afterStatusCodes:p}},w=2147483647;class _{constructor(t,i={}){if(this._retryCount=0,this._input=t,this._options={credentials:this._input.credentials||"same-origin",...i,headers:s(this._input.headers,i.headers),hooks:n({beforeRequest:[],beforeRetry:[],afterResponse:[]},i.hooks),method:b(i.method||this._input.method),prefixUrl:String(i.prefixUrl||""),retry:g(i.retry),throwHttpErrors:!1!==i.throwHttpErrors,timeout:void 0===i.timeout?1e4:i.timeout,fetch:i.fetch||globalThis.fetch.bind(globalThis)},"string"!=typeof this._input&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&"string"==typeof this._input){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(e&&(this.abortController=new globalThis.AbortController,this._options.signal&&this._options.signal.addEventListener("abort",(()=>{this.abortController.abort()})),this._options.signal=this.abortController.signal),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){const t="?"+("string"==typeof this._options.searchParams?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),e=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,t);!(o&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)||this._options.headers&&this._options.headers["content-type"]||this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(e,this.request),this._options)}void 0!==this._options.json&&(this._options.body=JSON.stringify(this._options.json),this.request.headers.set("content-type","application/json"),this.request=new globalThis.Request(this.request,{body:this._options.body}));const u=async()=>{if(this._options.timeout>w)throw new RangeError(`The \`timeout\` option cannot be greater than ${w}`);await d(1);let t=await this._fetch();for(const e of this._options.hooks.afterResponse){const r=await e(this.request,this._options,this._decorateResponse(t.clone()));r instanceof globalThis.Response&&(t=r)}if(this._decorateResponse(t),!t.ok&&this._options.throwHttpErrors)throw new f(t,this.request,this._options);if(this._options.onDownloadProgress){if("function"!=typeof this._options.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!r)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return this._stream(t.clone(),this._options.onDownloadProgress)}return t},c=this._options.retry.methods.includes(this.request.method.toLowerCase())?this._retry(u):u();for(const[t,e]of Object.entries(a))c[t]=async()=>{this.request.headers.set("accept",this.request.headers.get("accept")||e);const r=(await c).clone();if("json"===t){if(204===r.status)return"";if(i.parseJson)return i.parseJson(await r.text())}return r[t]()};return c}_calculateRetryDelay(t){if(this._retryCount++,this._retryCountthis._options.retry.maxRetryAfter?0:t}if(413===t.response.status)return 0}return.3*2**(this._retryCount-1)*1e3}return 0}_decorateResponse(t){return this._options.parseJson&&(t.json=async()=>this._options.parseJson(await t.text())),t}async _retry(t){try{return await t()}catch(e){const r=Math.min(this._calculateRetryDelay(e),w);if(0!==r&&this._retryCount>0){await d(r);for(const t of this._options.hooks.beforeRetry)if(await t({request:this.request,options:this._options,error:e,retryCount:this._retryCount})===h)return;return this._retry(t)}if(this._options.throwHttpErrors)throw e}}async _fetch(){for(const t of this._options.hooks.beforeRequest){const e=await t(this.request,this._options);if(e instanceof Request){this.request=e;break}if(e instanceof Response)return e}return!1===this._options.timeout?this._options.fetch(this.request.clone()):y(this.request.clone(),this.abortController,this._options)}_stream(t,e){const r=Number(t.headers.get("content-length"))||0;let o=0;return new globalThis.Response(new globalThis.ReadableStream({async start(s){const n=t.body.getReader();async function i(){const{done:t,value:a}=await n.read();t?s.close():(e&&(o+=a.byteLength,e({percent:0===r?0:o/r,transferredBytes:o,totalBytes:r},a)),s.enqueue(a),await i())}e&&e({percent:0,transferredBytes:0,totalBytes:r},new Uint8Array),await i()}}))}}const R=(...e)=>{for(const r of e)if((!t(r)||Array.isArray(r))&&void 0!==r)throw new TypeError("The `options` argument must be an object");return n({},...e)},E=t=>{const e=(e,r)=>new _(e,R(t,r));for(const r of i)e[r]=(e,o)=>new _(e,R(t,o,{method:r}));return e.HTTPError=f,e.TimeoutError=l,e.create=t=>E(R(t)),e.extend=e=>E(R(t,e)),e.stop=h,e};return E()}()})),f=Object.freeze({__proto__:null,default:t=>t});const l=(t,e,r,o)=>{if("length"===r||"prototype"===r)return;const s=Object.getOwnPropertyDescriptor(t,r),n=Object.getOwnPropertyDescriptor(e,r);!d(s,n)&&o||Object.defineProperty(t,r,n)},d=function(t,e){return void 0===t||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},y=(t,e)=>`/* Wrapped ${t}*/\n${e}`,b=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),m=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");var g=(t,e,{ignoreNonConfigurable:r=!1}={})=>{const{name:o}=t;for(const o of Reflect.ownKeys(e))l(t,e,o,r);return((t,e)=>{const r=Object.getPrototypeOf(e);r!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,r)})(t,e),((t,e,r)=>{const o=""===r?"":`with ${r.trim()}() `,s=y.bind(null,o,e.toString());Object.defineProperty(s,"name",m),Object.defineProperty(t,"toString",{...b,value:s})})(t,e,o),t},w={isFunction:t=>"function"==typeof t,isString:t=>"string"==typeof t,composeErrorMessage:(t,e)=>`${t}, ${e}`,inherits:(t,e)=>{t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}};const{isFunction:_,composeErrorMessage:R}=w;var E=function(t,...e){Object.assign(t,...e),t.description=_(t.message)?t.message(t):t.message,t.message=t.code?R(t.code,t.description):t.description},T=s(f);const{isString:v}=w;var j=function(t,e){function r(r){const o=new t,s=v(r)?{message:r}:r;return E(o,e,s),o.stack=T(o.stack),o}return r.prototype=t.prototype,g(r,t),r};const{inherits:O}=w,q=/[^0-9a-zA-Z_$]/;var C=function(t){if("string"!=typeof t)throw new TypeError("Expected className to be a string");if(q.test(t))throw new Error("className contains invalid characters");function e(){Object.defineProperty(this,"name",{configurable:!0,value:t,writable:!0}),Error.captureStackTrace(this,this.constructor)}return O(e,Error),g(e,Error),e};const P=t=>(e,r)=>{const o=C(e||t.name);return j(o,r)};var x=P(Error),A=P(TypeError),U=P(RangeError),S=P(EvalError),k=P(SyntaxError),D=P(ReferenceError),N=P(URIError);x.type=A,x.range=U,x.eval=S,x.syntax=k,x.reference=D,x.uri=N;const $={FREE:"https://api.microlink.io",PRO:"https://pro.microlink.io"},L=t=>"object"==typeof t;var H=({VERSION:t,MicrolinkError:e,isUrlHttp:r,stringify:o,got:s,flatten:n})=>{const i=t=>{if(!L(t))return;const e=n(t);return Object.keys(e).reduce(((t,r)=>({...t,[`data.${r}`]:e[r]})),{})},a=async(t,r={})=>{try{const e=await s(t,r);return"buffer"===r.responseType?{body:e.body,response:e}:{...e.body,response:e}}catch(r){const{response:o={}}=r,{statusCode:s,body:n,headers:i,url:a=t}=o,u=L(n)&&!Buffer.isBuffer(n)?n:((t,e,r)=>{try{return JSON.parse(t)}catch(o){const s=t||e.message;return{status:"error",data:{url:s},more:"https://microlink.io/efatal",code:"EFATAL",message:s,url:r}}})(n,r,a);throw e({...u,message:u.message,url:a,statusCode:s,headers:i})}},u=(t,{data:e,apiKey:r,endpoint:s,retry:a,cache:u,...c}={},{responseType:p="json",headers:h,...f}={})=>{const l=!!r;var d;return[`${s||$[l?"PRO":"FREE"]}?${o({url:t,...i(e),...n((d=c,Object.keys(d).forEach((t=>null==d[t]&&delete d[t])),d))})}`,{...f,responseType:p,cache:u,retry:a,headers:l?{...h,"x-api-key":r}:{...h}}]},c=t=>async(o,s,n)=>{((t="")=>{if(!r(t)){const r=`The \`url\` as \`${t}\` is not valid. Ensure it has protocol (http or https) and hostname.`;throw new e({status:"fail",data:{url:r},more:"https://microlink.io/docs/api/api-parameters/url",code:"EINVALURLCLIENT",message:r,url:t})}})(o);const[i,c]=u(o,s,{...t,...n});return a(i,c)},p=c();return p.MicrolinkError=e,p.getApiUrl=u,p.fetchFromApi=a,p.mapRules=i,p.version=t,p.stream=s.stream,p.buffer=c({responseType:"buffer"}),p},F=s(p);const{flattie:I}=u,{encode:M}=F;return H({MicrolinkError:x("MicrolinkError"),isUrlHttp:t=>{try{return i.test(new n(t).href)}catch(t){return!1}},stringify:M,got:async(t,e)=>{try{void 0===e.timeout&&(e.timeout=!1);const r=await h(t,e),o=await r.json(),{headers:s,status:n,statusText:i}=r;return{url:r.url,body:o,headers:s,statusCode:n,statusMessage:i}}catch(t){if(t.response){const{response:e}=t;t.response={...e,headers:[...e.headers.entries()].reduce(((t,[e,r])=>({...t,[e]:r})),{}),statusCode:e.status,body:await e.text()}}throw t}},flatten:I,VERSION:"0.9.3"})})); +const t=t=>null!==t&&"object"==typeof t,e="function"==typeof globalThis.AbortController,r="function"==typeof globalThis.ReadableStream,o="function"==typeof globalThis.FormData,s=(t,e)=>{const r=new globalThis.Headers(t||{}),o=e instanceof globalThis.Headers,s=new globalThis.Headers(e||{});for(const[t,e]of s)o&&"undefined"===e||void 0===e?r.delete(t):r.set(t,e);return r},n=(...e)=>{let r={},o={};for(const i of e){if(Array.isArray(i))Array.isArray(r)||(r=[]),r=[...r,...i];else if(t(i)){for(let[e,o]of Object.entries(i))t(o)&&e in r&&(o=n(r[e],o)),r={...r,[e]:o};t(i.headers)&&(o=s(o,i.headers))}r.headers=o}return r},i=["get","post","put","patch","head","delete"],a={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},u=["get","put","head","delete","options","trace"],c=[408,413,429,500,502,503,504],p=[413,429,503],h=Symbol("stop");class f extends Error{constructor(t,e,r){super(t.statusText||String(0===t.status||t.status?t.status:"Unknown response error")),this.name="HTTPError",this.response=t,this.request=e,this.options=r}}class l extends Error{constructor(t){super("Request timed out"),this.name="TimeoutError",this.request=t}}const d=t=>new Promise((e=>setTimeout(e,t))),y=(t,e,r)=>new Promise(((o,s)=>{const n=setTimeout((()=>{e&&e.abort(),s(new l(t))}),r.timeout);r.fetch(t).then(o).catch(s).then((()=>{clearTimeout(n)}))})),b=t=>i.includes(t)?t.toUpperCase():t,m={limit:2,methods:u,statusCodes:c,afterStatusCodes:p},g=(t={})=>{if("number"==typeof t)return{...m,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");return{...m,...t,afterStatusCodes:p}},w=2147483647;class _{constructor(t,i={}){if(this._retryCount=0,this._input=t,this._options={credentials:this._input.credentials||"same-origin",...i,headers:s(this._input.headers,i.headers),hooks:n({beforeRequest:[],beforeRetry:[],afterResponse:[]},i.hooks),method:b(i.method||this._input.method),prefixUrl:String(i.prefixUrl||""),retry:g(i.retry),throwHttpErrors:!1!==i.throwHttpErrors,timeout:void 0===i.timeout?1e4:i.timeout,fetch:i.fetch||globalThis.fetch.bind(globalThis)},"string"!=typeof this._input&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&"string"==typeof this._input){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(e&&(this.abortController=new globalThis.AbortController,this._options.signal&&this._options.signal.addEventListener("abort",(()=>{this.abortController.abort()})),this._options.signal=this.abortController.signal),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){const t="?"+("string"==typeof this._options.searchParams?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),e=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,t);!(o&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)||this._options.headers&&this._options.headers["content-type"]||this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(e,this.request),this._options)}void 0!==this._options.json&&(this._options.body=JSON.stringify(this._options.json),this.request.headers.set("content-type","application/json"),this.request=new globalThis.Request(this.request,{body:this._options.body}));const u=async()=>{if(this._options.timeout>w)throw new RangeError(`The \`timeout\` option cannot be greater than ${w}`);await d(1);let t=await this._fetch();for(const e of this._options.hooks.afterResponse){const r=await e(this.request,this._options,this._decorateResponse(t.clone()));r instanceof globalThis.Response&&(t=r)}if(this._decorateResponse(t),!t.ok&&this._options.throwHttpErrors)throw new f(t,this.request,this._options);if(this._options.onDownloadProgress){if("function"!=typeof this._options.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!r)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return this._stream(t.clone(),this._options.onDownloadProgress)}return t},c=this._options.retry.methods.includes(this.request.method.toLowerCase())?this._retry(u):u();for(const[t,e]of Object.entries(a))c[t]=async()=>{this.request.headers.set("accept",this.request.headers.get("accept")||e);const r=(await c).clone();if("json"===t){if(204===r.status)return"";if(i.parseJson)return i.parseJson(await r.text())}return r[t]()};return c}_calculateRetryDelay(t){if(this._retryCount++,this._retryCountthis._options.retry.maxRetryAfter?0:t}if(413===t.response.status)return 0}return.3*2**(this._retryCount-1)*1e3}return 0}_decorateResponse(t){return this._options.parseJson&&(t.json=async()=>this._options.parseJson(await t.text())),t}async _retry(t){try{return await t()}catch(e){const r=Math.min(this._calculateRetryDelay(e),w);if(0!==r&&this._retryCount>0){await d(r);for(const t of this._options.hooks.beforeRetry)if(await t({request:this.request,options:this._options,error:e,retryCount:this._retryCount})===h)return;return this._retry(t)}if(this._options.throwHttpErrors)throw e}}async _fetch(){for(const t of this._options.hooks.beforeRequest){const e=await t(this.request,this._options);if(e instanceof Request){this.request=e;break}if(e instanceof Response)return e}return!1===this._options.timeout?this._options.fetch(this.request.clone()):y(this.request.clone(),this.abortController,this._options)}_stream(t,e){const r=Number(t.headers.get("content-length"))||0;let o=0;return new globalThis.Response(new globalThis.ReadableStream({async start(s){const n=t.body.getReader();async function i(){const{done:t,value:a}=await n.read();t?s.close():(e&&(o+=a.byteLength,e({percent:0===r?0:o/r,transferredBytes:o,totalBytes:r},a)),s.enqueue(a),await i())}e&&e({percent:0,transferredBytes:0,totalBytes:r},new Uint8Array),await i()}}))}}const R=(...e)=>{for(const r of e)if((!t(r)||Array.isArray(r))&&void 0!==r)throw new TypeError("The `options` argument must be an object");return n({},...e)},E=t=>{const e=(e,r)=>new _(e,R(t,r));for(const r of i)e[r]=(e,o)=>new _(e,R(t,o,{method:r}));return e.HTTPError=f,e.TimeoutError=l,e.create=t=>E(R(t)),e.extend=e=>E(R(t,e)),e.stop=h,e};return E()}()}($);const N=t=>{try{return i.test(new n(t).href)}catch(t){return!1}},{flattie:L}=a,{encode:H}=p,F=h.exports,I=$.exports;return D({MicrolinkError:F("MicrolinkError"),isUrlHttp:N,stringify:H,got:async(t,e)=>{try{void 0===e.timeout&&(e.timeout=!1);const r=await I(t,e),o=await r.json(),{headers:s,status:n,statusText:i}=r;return{url:r.url,body:o,headers:s,statusCode:n,statusMessage:i}}catch(t){if(t.response){const{response:e}=t;t.response={...e,headers:[...e.headers.entries()].reduce(((t,[e,r])=>({...t,[e]:r})),{}),statusCode:e.status,body:await e.text()}}throw t}},flatten:L,VERSION:"0.9.4"})})); //# sourceMappingURL=mql.min.js.map diff --git a/dist/mql.min.js.map b/dist/mql.min.js.map index a795393..00a583e 100644 --- a/dist/mql.min.js.map +++ b/dist/mql.min.js.map @@ -1 +1 @@ -{"version":3,"file":"mql.min.js","sources":["../node_modules/is-url-http/lightweight.js","../node_modules/flattie/dist/index.js","../node_modules/qss/dist/qss.m.js","../src/ky.js","../node_modules/whoops/node_modules/mimic-fn/index.js","../node_modules/whoops/lib/helpers.js","../node_modules/whoops/lib/add-error-props.js","../node_modules/whoops/lib/create-extend-error.js","../node_modules/whoops/lib/create-error.js","../node_modules/whoops/lib/index.js","../src/factory.js","../src/browser.js"],"sourcesContent":["'use strict'\n\nconst URL = global.window ? window.URL : require('url').URL\nconst REGEX_HTTP_PROTOCOL = /^https?:\\/\\//i\n\nmodule.exports = url => {\n try {\n return REGEX_HTTP_PROTOCOL.test(new URL(url).href)\n } catch (err) {\n return false\n }\n}\n","function iter(output, nullish, sep, val, key) {\n\tvar k, pfx = key ? (key + sep) : key;\n\n\tif (val == null) {\n\t\tif (nullish) output[key] = val;\n\t} else if (typeof val != 'object') {\n\t\toutput[key] = val;\n\t} else if (Array.isArray(val)) {\n\t\tfor (k=0; k < val.length; k++) {\n\t\t\titer(output, nullish, sep, val[k], pfx + k);\n\t\t}\n\t} else {\n\t\tfor (k in val) {\n\t\t\titer(output, nullish, sep, val[k], pfx + k);\n\t\t}\n\t}\n}\n\nfunction flattie(input, glue, toNull) {\n\tvar output = {};\n\tif (typeof input == 'object') {\n\t\titer(output, !!toNull, glue || '.', input, '');\n\t}\n\treturn output;\n}\n\nexports.flattie = flattie;","export function encode(obj, pfx) {\n\tvar k, i, tmp, str='';\n\n\tfor (k in obj) {\n\t\tif ((tmp = obj[k]) !== void 0) {\n\t\t\tif (Array.isArray(tmp)) {\n\t\t\t\tfor (i=0; i < tmp.length; i++) {\n\t\t\t\t\tstr && (str += '&');\n\t\t\t\t\tstr += encodeURIComponent(k) + '=' + encodeURIComponent(tmp[i]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstr && (str += '&');\n\t\t\t\tstr += encodeURIComponent(k) + '=' + encodeURIComponent(tmp);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn (pfx || '') + str;\n}\n\nfunction toValue(mix) {\n\tif (!mix) return '';\n\tvar str = decodeURIComponent(mix);\n\tif (str === 'false') return false;\n\tif (str === 'true') return true;\n\treturn (+str * 0 === 0) ? (+str) : str;\n}\n\nexport function decode(str) {\n\tvar tmp, k, out={}, arr=str.split('&');\n\n\twhile (tmp = arr.shift()) {\n\t\ttmp = tmp.split('=');\n\t\tk = tmp.shift();\n\t\tif (out[k] !== void 0) {\n\t\t\tout[k] = [].concat(out[k], toValue(tmp.shift()));\n\t\t} else {\n\t\t\tout[k] = toValue(tmp.shift());\n\t\t}\n\t}\n\n\treturn out;\n}\n","(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.ky = factory());\n}(this, (function () { 'use strict';\n\n\t/*! MIT License © Sindre Sorhus */\n\n\tconst isObject = value => value !== null && typeof value === 'object';\n\tconst supportsAbortController = typeof globalThis.AbortController === 'function';\n\tconst supportsStreams = typeof globalThis.ReadableStream === 'function';\n\tconst supportsFormData = typeof globalThis.FormData === 'function';\n\n\tconst mergeHeaders = (source1, source2) => {\n\t\tconst result = new globalThis.Headers(source1 || {});\n\t\tconst isHeadersInstance = source2 instanceof globalThis.Headers;\n\t\tconst source = new globalThis.Headers(source2 || {});\n\n\t\tfor (const [key, value] of source) {\n\t\t\tif ((isHeadersInstance && value === 'undefined') || value === undefined) {\n\t\t\t\tresult.delete(key);\n\t\t\t} else {\n\t\t\t\tresult.set(key, value);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t};\n\n\tconst deepMerge = (...sources) => {\n\t\tlet returnValue = {};\n\t\tlet headers = {};\n\n\t\tfor (const source of sources) {\n\t\t\tif (Array.isArray(source)) {\n\t\t\t\tif (!(Array.isArray(returnValue))) {\n\t\t\t\t\treturnValue = [];\n\t\t\t\t}\n\n\t\t\t\treturnValue = [...returnValue, ...source];\n\t\t\t} else if (isObject(source)) {\n\t\t\t\tfor (let [key, value] of Object.entries(source)) {\n\t\t\t\t\tif (isObject(value) && (key in returnValue)) {\n\t\t\t\t\t\tvalue = deepMerge(returnValue[key], value);\n\t\t\t\t\t}\n\n\t\t\t\t\treturnValue = {...returnValue, [key]: value};\n\t\t\t\t}\n\n\t\t\t\tif (isObject(source.headers)) {\n\t\t\t\t\theaders = mergeHeaders(headers, source.headers);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturnValue.headers = headers;\n\t\t}\n\n\t\treturn returnValue;\n\t};\n\n\tconst requestMethods = [\n\t\t'get',\n\t\t'post',\n\t\t'put',\n\t\t'patch',\n\t\t'head',\n\t\t'delete'\n\t];\n\n\tconst responseTypes = {\n\t\tjson: 'application/json',\n\t\ttext: 'text/*',\n\t\tformData: 'multipart/form-data',\n\t\tarrayBuffer: '*/*',\n\t\tblob: '*/*'\n\t};\n\n\tconst retryMethods = [\n\t\t'get',\n\t\t'put',\n\t\t'head',\n\t\t'delete',\n\t\t'options',\n\t\t'trace'\n\t];\n\n\tconst retryStatusCodes = [\n\t\t408,\n\t\t413,\n\t\t429,\n\t\t500,\n\t\t502,\n\t\t503,\n\t\t504\n\t];\n\n\tconst retryAfterStatusCodes = [\n\t\t413,\n\t\t429,\n\t\t503\n\t];\n\n\tconst stop = Symbol('stop');\n\n\tclass HTTPError extends Error {\n\t\tconstructor(response, request, options) {\n\t\t\t// Set the message to the status text, such as Unauthorized,\n\t\t\t// with some fallbacks. This message should never be undefined.\n\t\t\tsuper(\n\t\t\t\tresponse.statusText ||\n\t\t\t\tString(\n\t\t\t\t\t(response.status === 0 || response.status) ?\n\t\t\t\t\t\tresponse.status : 'Unknown response error'\n\t\t\t\t)\n\t\t\t);\n\t\t\tthis.name = 'HTTPError';\n\t\t\tthis.response = response;\n\t\t\tthis.request = request;\n\t\t\tthis.options = options;\n\t\t}\n\t}\n\n\tclass TimeoutError extends Error {\n\t\tconstructor(request) {\n\t\t\tsuper('Request timed out');\n\t\t\tthis.name = 'TimeoutError';\n\t\t\tthis.request = request;\n\t\t}\n\t}\n\n\tconst delay = ms => new Promise(resolve => setTimeout(resolve, ms));\n\n\t// `Promise.race()` workaround (#91)\n\tconst timeout = (request, abortController, options) =>\n\t\tnew Promise((resolve, reject) => {\n\t\t\tconst timeoutID = setTimeout(() => {\n\t\t\t\tif (abortController) {\n\t\t\t\t\tabortController.abort();\n\t\t\t\t}\n\n\t\t\t\treject(new TimeoutError(request));\n\t\t\t}, options.timeout);\n\n\t\t\t/* eslint-disable promise/prefer-await-to-then */\n\t\t\toptions.fetch(request)\n\t\t\t\t.then(resolve)\n\t\t\t\t.catch(reject)\n\t\t\t\t.then(() => {\n\t\t\t\t\tclearTimeout(timeoutID);\n\t\t\t\t});\n\t\t\t/* eslint-enable promise/prefer-await-to-then */\n\t\t});\n\n\tconst normalizeRequestMethod = input => requestMethods.includes(input) ? input.toUpperCase() : input;\n\n\tconst defaultRetryOptions = {\n\t\tlimit: 2,\n\t\tmethods: retryMethods,\n\t\tstatusCodes: retryStatusCodes,\n\t\tafterStatusCodes: retryAfterStatusCodes\n\t};\n\n\tconst normalizeRetryOptions = (retry = {}) => {\n\t\tif (typeof retry === 'number') {\n\t\t\treturn {\n\t\t\t\t...defaultRetryOptions,\n\t\t\t\tlimit: retry\n\t\t\t};\n\t\t}\n\n\t\tif (retry.methods && !Array.isArray(retry.methods)) {\n\t\t\tthrow new Error('retry.methods must be an array');\n\t\t}\n\n\t\tif (retry.statusCodes && !Array.isArray(retry.statusCodes)) {\n\t\t\tthrow new Error('retry.statusCodes must be an array');\n\t\t}\n\n\t\treturn {\n\t\t\t...defaultRetryOptions,\n\t\t\t...retry,\n\t\t\tafterStatusCodes: retryAfterStatusCodes\n\t\t};\n\t};\n\n\t// The maximum value of a 32bit int (see issue #117)\n\tconst maxSafeTimeout = 2147483647;\n\n\tclass Ky {\n\t\tconstructor(input, options = {}) {\n\t\t\tthis._retryCount = 0;\n\t\t\tthis._input = input;\n\t\t\tthis._options = {\n\t\t\t\t// TODO: credentials can be removed when the spec change is implemented in all browsers. Context: https://www.chromestatus.com/feature/4539473312350208\n\t\t\t\tcredentials: this._input.credentials || 'same-origin',\n\t\t\t\t...options,\n\t\t\t\theaders: mergeHeaders(this._input.headers, options.headers),\n\t\t\t\thooks: deepMerge({\n\t\t\t\t\tbeforeRequest: [],\n\t\t\t\t\tbeforeRetry: [],\n\t\t\t\t\tafterResponse: []\n\t\t\t\t}, options.hooks),\n\t\t\t\tmethod: normalizeRequestMethod(options.method || this._input.method),\n\t\t\t\tprefixUrl: String(options.prefixUrl || ''),\n\t\t\t\tretry: normalizeRetryOptions(options.retry),\n\t\t\t\tthrowHttpErrors: options.throwHttpErrors !== false,\n\t\t\t\ttimeout: typeof options.timeout === 'undefined' ? 10000 : options.timeout,\n\t\t\t\tfetch: options.fetch || globalThis.fetch.bind(globalThis)\n\t\t\t};\n\n\t\t\tif (typeof this._input !== 'string' && !(this._input instanceof URL || this._input instanceof globalThis.Request)) {\n\t\t\t\tthrow new TypeError('`input` must be a string, URL, or Request');\n\t\t\t}\n\n\t\t\tif (this._options.prefixUrl && typeof this._input === 'string') {\n\t\t\t\tif (this._input.startsWith('/')) {\n\t\t\t\t\tthrow new Error('`input` must not begin with a slash when using `prefixUrl`');\n\t\t\t\t}\n\n\t\t\t\tif (!this._options.prefixUrl.endsWith('/')) {\n\t\t\t\t\tthis._options.prefixUrl += '/';\n\t\t\t\t}\n\n\t\t\t\tthis._input = this._options.prefixUrl + this._input;\n\t\t\t}\n\n\t\t\tif (supportsAbortController) {\n\t\t\t\tthis.abortController = new globalThis.AbortController();\n\t\t\t\tif (this._options.signal) {\n\t\t\t\t\tthis._options.signal.addEventListener('abort', () => {\n\t\t\t\t\t\tthis.abortController.abort();\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tthis._options.signal = this.abortController.signal;\n\t\t\t}\n\n\t\t\tthis.request = new globalThis.Request(this._input, this._options);\n\n\t\t\tif (this._options.searchParams) {\n\t\t\t\tconst textSearchParams = typeof this._options.searchParams === 'string' ?\n\t\t\t\t\tthis._options.searchParams.replace(/^\\?/, '') :\n\t\t\t\t\tnew URLSearchParams(this._options.searchParams).toString();\n\t\t\t\tconst searchParams = '?' + textSearchParams;\n\t\t\t\tconst url = this.request.url.replace(/(?:\\?.*?)?(?=#|$)/, searchParams);\n\n\t\t\t\t// To provide correct form boundary, Content-Type header should be deleted each time when new Request instantiated from another one\n\t\t\t\tif (((supportsFormData && this._options.body instanceof globalThis.FormData) || this._options.body instanceof URLSearchParams) && !(this._options.headers && this._options.headers['content-type'])) {\n\t\t\t\t\tthis.request.headers.delete('content-type');\n\t\t\t\t}\n\n\t\t\t\tthis.request = new globalThis.Request(new globalThis.Request(url, this.request), this._options);\n\t\t\t}\n\n\t\t\tif (this._options.json !== undefined) {\n\t\t\t\tthis._options.body = JSON.stringify(this._options.json);\n\t\t\t\tthis.request.headers.set('content-type', 'application/json');\n\t\t\t\tthis.request = new globalThis.Request(this.request, {body: this._options.body});\n\t\t\t}\n\n\t\t\tconst fn = async () => {\n\t\t\t\tif (this._options.timeout > maxSafeTimeout) {\n\t\t\t\t\tthrow new RangeError(`The \\`timeout\\` option cannot be greater than ${maxSafeTimeout}`);\n\t\t\t\t}\n\n\t\t\t\tawait delay(1);\n\t\t\t\tlet response = await this._fetch();\n\n\t\t\t\tfor (const hook of this._options.hooks.afterResponse) {\n\t\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\t\tconst modifiedResponse = await hook(\n\t\t\t\t\t\tthis.request,\n\t\t\t\t\t\tthis._options,\n\t\t\t\t\t\tthis._decorateResponse(response.clone())\n\t\t\t\t\t);\n\n\t\t\t\t\tif (modifiedResponse instanceof globalThis.Response) {\n\t\t\t\t\t\tresponse = modifiedResponse;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis._decorateResponse(response);\n\n\t\t\t\tif (!response.ok && this._options.throwHttpErrors) {\n\t\t\t\t\tthrow new HTTPError(response, this.request, this._options);\n\t\t\t\t}\n\n\t\t\t\t// If `onDownloadProgress` is passed, it uses the stream API internally\n\t\t\t\t/* istanbul ignore next */\n\t\t\t\tif (this._options.onDownloadProgress) {\n\t\t\t\t\tif (typeof this._options.onDownloadProgress !== 'function') {\n\t\t\t\t\t\tthrow new TypeError('The `onDownloadProgress` option must be a function');\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!supportsStreams) {\n\t\t\t\t\t\tthrow new Error('Streams are not supported in your environment. `ReadableStream` is missing.');\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this._stream(response.clone(), this._options.onDownloadProgress);\n\t\t\t\t}\n\n\t\t\t\treturn response;\n\t\t\t};\n\n\t\t\tconst isRetriableMethod = this._options.retry.methods.includes(this.request.method.toLowerCase());\n\t\t\tconst result = isRetriableMethod ? this._retry(fn) : fn();\n\n\t\t\tfor (const [type, mimeType] of Object.entries(responseTypes)) {\n\t\t\t\tresult[type] = async () => {\n\t\t\t\t\tthis.request.headers.set('accept', this.request.headers.get('accept') || mimeType);\n\n\t\t\t\t\tconst response = (await result).clone();\n\n\t\t\t\t\tif (type === 'json') {\n\t\t\t\t\t\tif (response.status === 204) {\n\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (options.parseJson) {\n\t\t\t\t\t\t\treturn options.parseJson(await response.text());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn response[type]();\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\t_calculateRetryDelay(error) {\n\t\t\tthis._retryCount++;\n\n\t\t\tif (this._retryCount < this._options.retry.limit && !(error instanceof TimeoutError)) {\n\t\t\t\tif (error instanceof HTTPError) {\n\t\t\t\t\tif (!this._options.retry.statusCodes.includes(error.response.status)) {\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst retryAfter = error.response.headers.get('Retry-After');\n\t\t\t\t\tif (retryAfter && this._options.retry.afterStatusCodes.includes(error.response.status)) {\n\t\t\t\t\t\tlet after = Number(retryAfter);\n\t\t\t\t\t\tif (Number.isNaN(after)) {\n\t\t\t\t\t\t\tafter = Date.parse(retryAfter) - Date.now();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tafter *= 1000;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (typeof this._options.retry.maxRetryAfter !== 'undefined' && after > this._options.retry.maxRetryAfter) {\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn after;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (error.response.status === 413) {\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst BACKOFF_FACTOR = 0.3;\n\t\t\t\treturn BACKOFF_FACTOR * (2 ** (this._retryCount - 1)) * 1000;\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t}\n\n\t\t_decorateResponse(response) {\n\t\t\tif (this._options.parseJson) {\n\t\t\t\tresponse.json = async () => {\n\t\t\t\t\treturn this._options.parseJson(await response.text());\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn response;\n\t\t}\n\n\t\tasync _retry(fn) {\n\t\t\ttry {\n\t\t\t\treturn await fn();\n\t\t\t} catch (error) {\n\t\t\t\tconst ms = Math.min(this._calculateRetryDelay(error), maxSafeTimeout);\n\t\t\t\tif (ms !== 0 && this._retryCount > 0) {\n\t\t\t\t\tawait delay(ms);\n\n\t\t\t\t\tfor (const hook of this._options.hooks.beforeRetry) {\n\t\t\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\t\t\tconst hookResult = await hook({\n\t\t\t\t\t\t\trequest: this.request,\n\t\t\t\t\t\t\toptions: this._options,\n\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t\tretryCount: this._retryCount\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t// If `stop` is returned from the hook, the retry process is stopped\n\t\t\t\t\t\tif (hookResult === stop) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this._retry(fn);\n\t\t\t\t}\n\n\t\t\t\tif (this._options.throwHttpErrors) {\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tasync _fetch() {\n\t\t\tfor (const hook of this._options.hooks.beforeRequest) {\n\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\tconst result = await hook(this.request, this._options);\n\n\t\t\t\tif (result instanceof Request) {\n\t\t\t\t\tthis.request = result;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (result instanceof Response) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this._options.timeout === false) {\n\t\t\t\treturn this._options.fetch(this.request.clone());\n\t\t\t}\n\n\t\t\treturn timeout(this.request.clone(), this.abortController, this._options);\n\t\t}\n\n\t\t/* istanbul ignore next */\n\t\t_stream(response, onDownloadProgress) {\n\t\t\tconst totalBytes = Number(response.headers.get('content-length')) || 0;\n\t\t\tlet transferredBytes = 0;\n\n\t\t\treturn new globalThis.Response(\n\t\t\t\tnew globalThis.ReadableStream({\n\t\t\t\t\tasync start(controller) {\n\t\t\t\t\t\tconst reader = response.body.getReader();\n\n\t\t\t\t\t\tif (onDownloadProgress) {\n\t\t\t\t\t\t\tonDownloadProgress({percent: 0, transferredBytes: 0, totalBytes}, new Uint8Array());\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tasync function read() {\n\t\t\t\t\t\t\tconst {done, value} = await reader.read();\n\t\t\t\t\t\t\tif (done) {\n\t\t\t\t\t\t\t\tcontroller.close();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (onDownloadProgress) {\n\t\t\t\t\t\t\t\ttransferredBytes += value.byteLength;\n\t\t\t\t\t\t\t\tconst percent = totalBytes === 0 ? 0 : transferredBytes / totalBytes;\n\t\t\t\t\t\t\t\tonDownloadProgress({percent, transferredBytes, totalBytes}, value);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcontroller.enqueue(value);\n\t\t\t\t\t\t\tawait read();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tawait read();\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\t}\n\n\tconst validateAndMerge = (...sources) => {\n\t\tfor (const source of sources) {\n\t\t\tif ((!isObject(source) || Array.isArray(source)) && typeof source !== 'undefined') {\n\t\t\t\tthrow new TypeError('The `options` argument must be an object');\n\t\t\t}\n\t\t}\n\n\t\treturn deepMerge({}, ...sources);\n\t};\n\n\tconst createInstance = defaults => {\n\t\tconst ky = (input, options) => new Ky(input, validateAndMerge(defaults, options));\n\n\t\tfor (const method of requestMethods) {\n\t\t\tky[method] = (input, options) => new Ky(input, validateAndMerge(defaults, options, {method}));\n\t\t}\n\n\t\tky.HTTPError = HTTPError;\n\t\tky.TimeoutError = TimeoutError;\n\t\tky.create = newDefaults => createInstance(validateAndMerge(newDefaults));\n\t\tky.extend = newDefaults => createInstance(validateAndMerge(defaults, newDefaults));\n\t\tky.stop = stop;\n\n\t\treturn ky;\n\t};\n\n\tconst ky = createInstance();\n\n\treturn ky;\n\n})));\n","'use strict';\n\nconst copyProperty = (to, from, property, ignoreNonConfigurable) => {\n\t// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.\n\t// `Function#prototype` is non-writable and non-configurable so can never be modified.\n\tif (property === 'length' || property === 'prototype') {\n\t\treturn;\n\t}\n\n\tconst toDescriptor = Object.getOwnPropertyDescriptor(to, property);\n\tconst fromDescriptor = Object.getOwnPropertyDescriptor(from, property);\n\n\tif (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {\n\t\treturn;\n\t}\n\n\tObject.defineProperty(to, property, fromDescriptor);\n};\n\n// `Object.defineProperty()` throws if the property exists, is not configurable and either:\n// - one its descriptors is changed\n// - it is non-writable and its value is changed\nconst canCopyProperty = function (toDescriptor, fromDescriptor) {\n\treturn toDescriptor === undefined || toDescriptor.configurable || (\n\t\ttoDescriptor.writable === fromDescriptor.writable &&\n\t\ttoDescriptor.enumerable === fromDescriptor.enumerable &&\n\t\ttoDescriptor.configurable === fromDescriptor.configurable &&\n\t\t(toDescriptor.writable || toDescriptor.value === fromDescriptor.value)\n\t);\n};\n\nconst changePrototype = (to, from) => {\n\tconst fromPrototype = Object.getPrototypeOf(from);\n\tif (fromPrototype === Object.getPrototypeOf(to)) {\n\t\treturn;\n\t}\n\n\tObject.setPrototypeOf(to, fromPrototype);\n};\n\nconst wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/\\n${fromBody}`;\n\nconst toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, 'toString');\nconst toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, 'name');\n\n// We call `from.toString()` early (not lazily) to ensure `from` can be garbage collected.\n// We use `bind()` instead of a closure for the same reason.\n// Calling `from.toString()` early also allows caching it in case `to.toString()` is called several times.\nconst changeToString = (to, from, name) => {\n\tconst withName = name === '' ? '' : `with ${name.trim()}() `;\n\tconst newToString = wrappedToString.bind(null, withName, from.toString());\n\t// Ensure `to.toString.toString` is non-enumerable and has the same `same`\n\tObject.defineProperty(newToString, 'name', toStringName);\n\tObject.defineProperty(to, 'toString', {...toStringDescriptor, value: newToString});\n};\n\nconst mimicFn = (to, from, {ignoreNonConfigurable = false} = {}) => {\n\tconst {name} = to;\n\n\tfor (const property of Reflect.ownKeys(from)) {\n\t\tcopyProperty(to, from, property, ignoreNonConfigurable);\n\t}\n\n\tchangePrototype(to, from);\n\tchangeToString(to, from, name);\n\n\treturn to;\n};\n\nmodule.exports = mimicFn;\n","'use strict'\n\nmodule.exports = {\n isFunction: obj => typeof obj === 'function',\n isString: obj => typeof obj === 'string',\n composeErrorMessage: (code, description) => `${code}, ${description}`,\n inherits: (ctor, superCtor) => {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n}\n","'use strict'\n\nconst {isFunction, composeErrorMessage} = require('./helpers')\n\nfunction interfaceObject (error, ...props) {\n Object.assign(error, ...props)\n\n error.description = isFunction(error.message) ? error.message(error) : error.message\n\n error.message = error.code\n ? composeErrorMessage(error.code, error.description)\n : error.description\n}\n\nmodule.exports = interfaceObject\n","'use strict'\n\nconst cleanStack = require('clean-stack')\nconst mimicFn = require('mimic-fn')\n\nconst addErrorProps = require('./add-error-props')\nconst {isString} = require('./helpers')\n\nfunction createExtendError (ErrorClass, classProps) {\n function ExtendError (props) {\n const error = new ErrorClass()\n const errorProps = isString(props) ? {message: props} : props\n addErrorProps(error, classProps, errorProps)\n\n error.stack = cleanStack(error.stack)\n return error\n }\n\n ExtendError.prototype = ErrorClass.prototype\n mimicFn(ExtendError, ErrorClass)\n\n return ExtendError\n}\n\nmodule.exports = createExtendError\n","'use strict'\n\nconst {inherits} = require('./helpers')\nconst mimicFn = require('mimic-fn')\n\nconst REGEX_CLASS_NAME = /[^0-9a-zA-Z_$]/\n\nfunction createError (className) {\n if (typeof className !== 'string') {\n throw new TypeError('Expected className to be a string')\n }\n\n if (REGEX_CLASS_NAME.test(className)) {\n throw new Error('className contains invalid characters')\n }\n\n function ErrorClass () {\n Object.defineProperty(this, 'name', {\n configurable: true,\n value: className,\n writable: true\n })\n\n Error.captureStackTrace(this, this.constructor)\n }\n\n inherits(ErrorClass, Error)\n mimicFn(ErrorClass, Error)\n return ErrorClass\n}\n\nmodule.exports = createError\n","'use strict'\n\nconst createExtendError = require('./create-extend-error')\nconst createError = require('./create-error')\n\nconst createErrorClass = ErrorClass => (className, props) => {\n const errorClass = createError(className || ErrorClass.name)\n return createExtendError(errorClass, props)\n}\n\nmodule.exports = createErrorClass(Error)\nmodule.exports.type = createErrorClass(TypeError)\nmodule.exports.range = createErrorClass(RangeError)\nmodule.exports.eval = createErrorClass(EvalError)\nmodule.exports.syntax = createErrorClass(SyntaxError)\nmodule.exports.reference = createErrorClass(ReferenceError)\nmodule.exports.uri = createErrorClass(URIError)\n","const ENDPOINT = {\n FREE: 'https://api.microlink.io',\n PRO: 'https://pro.microlink.io'\n}\n\nconst isObject = input => typeof input === 'object'\n\nconst pickBy = obj => {\n Object.keys(obj).forEach(key => obj[key] == null && delete obj[key])\n return obj\n}\n\nconst parseBody = (input, error, url) => {\n try {\n return JSON.parse(input)\n } catch (_) {\n const message = input || error.message\n\n return {\n status: 'error',\n data: { url: message },\n more: 'https://microlink.io/efatal',\n code: 'EFATAL',\n message,\n url\n }\n }\n}\n\nconst factory = ({ VERSION, MicrolinkError, isUrlHttp, stringify, got, flatten }) => {\n const assertUrl = (url = '') => {\n if (!isUrlHttp(url)) {\n const message = `The \\`url\\` as \\`${url}\\` is not valid. Ensure it has protocol (http or https) and hostname.`\n throw new MicrolinkError({\n status: 'fail',\n data: { url: message },\n more: 'https://microlink.io/docs/api/api-parameters/url',\n code: 'EINVALURLCLIENT',\n message,\n url\n })\n }\n }\n\n const mapRules = rules => {\n if (!isObject(rules)) return\n const flatRules = flatten(rules)\n return Object.keys(flatRules).reduce(\n (acc, key) => ({ ...acc, [`data.${key}`]: flatRules[key] }),\n {}\n )\n }\n\n const fetchFromApi = async (apiUrl, opts = {}) => {\n try {\n const response = await got(apiUrl, opts)\n return opts.responseType === 'buffer'\n ? { body: response.body, response }\n : { ...response.body, response }\n } catch (err) {\n const { response = {} } = err\n const { statusCode, body: rawBody, headers, url: uri = apiUrl } = response\n\n const body =\n isObject(rawBody) && !Buffer.isBuffer(rawBody) ? rawBody : parseBody(rawBody, err, uri)\n\n throw MicrolinkError({\n ...body,\n message: body.message,\n url: uri,\n statusCode,\n headers\n })\n }\n }\n\n const getApiUrl = (\n url,\n { data, apiKey, endpoint, retry, cache, ...opts } = {},\n { responseType = 'json', headers: gotHeaders, ...gotOpts } = {}\n ) => {\n const isPro = !!apiKey\n const apiEndpoint = endpoint || ENDPOINT[isPro ? 'PRO' : 'FREE']\n\n const apiUrl = `${apiEndpoint}?${stringify({\n url,\n ...mapRules(data),\n ...flatten(pickBy(opts))\n })}`\n\n const headers = isPro ? { ...gotHeaders, 'x-api-key': apiKey } : { ...gotHeaders }\n return [apiUrl, { ...gotOpts, responseType, cache, retry, headers }]\n }\n\n const createMql = defaultOpts => async (url, opts, gotOpts) => {\n assertUrl(url)\n const [apiUrl, fetchOpts] = getApiUrl(url, opts, {\n ...defaultOpts,\n ...gotOpts\n })\n return fetchFromApi(apiUrl, fetchOpts)\n }\n\n const mql = createMql()\n mql.MicrolinkError = MicrolinkError\n mql.getApiUrl = getApiUrl\n mql.fetchFromApi = fetchFromApi\n mql.mapRules = mapRules\n mql.version = VERSION\n mql.stream = got.stream\n mql.buffer = createMql({ responseType: 'buffer' })\n\n return mql\n}\n\nmodule.exports = factory\n","'use strict'\n\nconst isUrlHttp = require('is-url-http/lightweight')\nconst { flattie: flatten } = require('flattie')\nconst { encode: stringify } = require('qss')\nconst ky = require('./ky')\nconst whoops = require('whoops')\n\nconst factory = require('./factory')\n\nconst MicrolinkError = whoops('MicrolinkError')\n\nconst got = async (url, opts) => {\n try {\n if (opts.timeout === undefined) opts.timeout = false\n const response = await ky(url, opts)\n const body = await response.json()\n const { headers, status: statusCode, statusText: statusMessage } = response\n return { url: response.url, body, headers, statusCode, statusMessage }\n } catch (err) {\n if (err.response) {\n const { response } = err\n err.response = {\n ...response,\n headers: [...response.headers.entries()].reduce(\n (acc, [key, value]) => ({ ...acc, [key]: value }),\n {}\n ),\n statusCode: response.status,\n body: await response.text()\n }\n }\n throw err\n }\n}\n\nmodule.exports = factory({\n MicrolinkError,\n isUrlHttp,\n stringify,\n got,\n flatten,\n VERSION: '__MQL_VERSION__'\n})\n"],"names":["URL","global","window","require$$0","REGEX_HTTP_PROTOCOL","iter","output","nullish","sep","val","key","k","pfx","Array","isArray","length","input","glue","toNull","toValue","mix","str","decodeURIComponent","obj","i","tmp","encodeURIComponent","out","arr","split","shift","concat","module","isObject","value","supportsAbortController","globalThis","AbortController","supportsStreams","ReadableStream","supportsFormData","FormData","mergeHeaders","source1","source2","result","Headers","isHeadersInstance","source","undefined","delete","set","deepMerge","sources","returnValue","headers","Object","entries","[object Object]","requestMethods","responseTypes","json","text","formData","arrayBuffer","blob","retryMethods","retryStatusCodes","retryAfterStatusCodes","stop","Symbol","HTTPError","Error","response","request","options","super","statusText","String","status","this","name","TimeoutError","delay","ms","Promise","resolve","setTimeout","timeout","abortController","reject","timeoutID","abort","fetch","then","catch","clearTimeout","normalizeRequestMethod","includes","toUpperCase","defaultRetryOptions","limit","methods","statusCodes","afterStatusCodes","normalizeRetryOptions","retry","maxSafeTimeout","Ky","_retryCount","_input","_options","credentials","hooks","beforeRequest","beforeRetry","afterResponse","method","prefixUrl","throwHttpErrors","bind","Request","TypeError","startsWith","endsWith","signal","addEventListener","searchParams","replace","URLSearchParams","toString","url","body","JSON","stringify","fn","async","RangeError","_fetch","hook","modifiedResponse","_decorateResponse","clone","Response","ok","onDownloadProgress","_stream","toLowerCase","_retry","type","mimeType","get","parseJson","error","retryAfter","after","Number","isNaN","Date","parse","now","maxRetryAfter","Math","min","_calculateRetryDelay","retryCount","totalBytes","transferredBytes","controller","reader","getReader","read","done","close","byteLength","percent","enqueue","Uint8Array","validateAndMerge","createInstance","defaults","ky","create","newDefaults","extend","factory","copyProperty","to","from","property","ignoreNonConfigurable","toDescriptor","getOwnPropertyDescriptor","fromDescriptor","canCopyProperty","defineProperty","configurable","writable","enumerable","wrappedToString","withName","fromBody","toStringDescriptor","Function","prototype","toStringName","Reflect","ownKeys","fromPrototype","getPrototypeOf","setPrototypeOf","changePrototype","trim","newToString","changeToString","isFunction","isString","composeErrorMessage","code","description","inherits","ctor","superCtor","super_","constructor","props","assign","message","ErrorClass","classProps","ExtendError","errorProps","addErrorProps","stack","cleanStack","mimicFn","REGEX_CLASS_NAME","className","test","captureStackTrace","createErrorClass","errorClass","createError","createExtendError","EvalError","SyntaxError","ReferenceError","URIError","ENDPOINT","FREE","PRO","VERSION","MicrolinkError","isUrlHttp","got","flatten","mapRules","rules","flatRules","keys","reduce","acc","fetchFromApi","apiUrl","opts","responseType","err","statusCode","rawBody","uri","Buffer","isBuffer","_","data","more","parseBody","getApiUrl","apiKey","endpoint","cache","gotHeaders","gotOpts","isPro","forEach","x-api-key","createMql","defaultOpts","assertUrl","fetchOpts","mql","version","stream","buffer","flattie","encode","require$$1","whoops","href","statusMessage"],"mappings":"ovBAEA,MAAMA,EAAMC,EAAOC,OAASA,OAAOF,IAAMG,UAAeH,IAClDI,EAAsB,gBCH5B,SAASC,EAAKC,EAAQC,EAASC,EAAKC,EAAKC,GACxC,IAAIC,EAAGC,EAAMF,EAAOA,EAAMF,EAAOE,EAEjC,GAAW,MAAPD,EACCF,IAASD,EAAOI,GAAOD,QACrB,GAAkB,iBAAPA,EACjBH,EAAOI,GAAOD,OACR,GAAII,MAAMC,QAAQL,GACxB,IAAKE,EAAE,EAAGA,EAAIF,EAAIM,OAAQJ,IACzBN,EAAKC,EAAQC,EAASC,EAAKC,EAAIE,GAAIC,EAAMD,QAG1C,IAAKA,KAAKF,EACTJ,EAAKC,EAAQC,EAASC,EAAKC,EAAIE,GAAIC,EAAMD,GAa5C,eARA,SAAiBK,EAAOC,EAAMC,GAC7B,IAAIZ,EAAS,GAIb,MAHoB,iBAATU,GACVX,EAAKC,IAAUY,EAAQD,GAAQ,IAAKD,EAAO,IAErCV,ICHR,SAASa,EAAQC,GAChB,IAAKA,EAAK,MAAO,GACjB,IAAIC,EAAMC,mBAAmBF,GAC7B,MAAY,UAARC,IACQ,SAARA,IACW,GAANA,GAAY,GAAOA,EAAOA,+CAzB7B,SAAgBE,EAAKX,GAC3B,IAAID,EAAGa,EAAGC,EAAKJ,EAAI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iBA,EACrBqC,EAAIb,UAAYA,EAChBa,EAAI3B,aAAeA,EACnB2B,EAAIjC,SAAWA,EACfiC,EAAIC,QAAUvC,EACdsC,EAAIE,OAASrC,EAAIqC,OACjBF,EAAIG,OAASP,EAAU,CAAEpB,aAAc,WAEhCwB,UC7GT,MAAQI,QAAStC,GAAY5P,GACrBmS,OAAQhK,GAAciK,SAgCb9G,EAAQ,CACvBmE,eA3BqB4C,EAAO,4BXLbrK,IACf,IACE,OAAO/H,EAAoB0O,KAAK,IAAI9O,EAAImI,GAAKsK,MAC7C,MAAO/B,GACP,OAAO,IW8BTpI,UAAAA,EACAwH,IA5BUtH,MAAOL,EAAKqI,KACtB,SACuBvN,IAAjBuN,EAAKhL,UAAuBgL,EAAKhL,SAAU,GAC/C,MAAMf,QAAiB4G,EAAGlD,EAAKqI,GACzBpI,QAAa3D,EAASZ,QACtBN,QAAEA,EAASwB,OAAQ4L,EAAY9L,WAAY6N,GAAkBjO,EACnE,MAAO,CAAE0D,IAAK1D,EAAS0D,IAAKC,KAAAA,EAAM7E,QAAAA,EAASoN,WAAAA,EAAY+B,cAAAA,GACvD,MAAOhC,GACP,GAAIA,EAAIjM,SAAU,CAChB,MAAMA,SAAEA,GAAaiM,EACrBA,EAAIjM,SAAW,IACVA,EACHlB,QAAS,IAAIkB,EAASlB,QAAQE,WAAW2M,QACvC,CAACC,GAAM3P,EAAKwB,UAAiBmO,EAAK3M,CAAChD,GAAMwB,KACzC,IAEFyO,WAAYlM,EAASM,OACrBqD,WAAY3D,EAASX,QAGzB,MAAM4M,IASRX,QAAAA,EACAJ,QAAS"} \ No newline at end of file +{"version":3,"file":"mql.min.js","sources":["../node_modules/is-url-http/lightweight.js","../node_modules/flattie/dist/index.js","../node_modules/qss/dist/qss.m.js","../node_modules/mimic-fn/index.js","../node_modules/whoops/lib/helpers.js","../node_modules/whoops/lib/add-error-props.js","../node_modules/whoops/lib/create-extend-error.js","../node_modules/whoops/lib/create-error.js","../node_modules/whoops/lib/index.js","../src/factory.js","../src/ky.js","../src/browser.js"],"sourcesContent":["'use strict'\n\nconst URL = global.window ? window.URL : require('url').URL\nconst REGEX_HTTP_PROTOCOL = /^https?:\\/\\//i\n\nmodule.exports = url => {\n try {\n return REGEX_HTTP_PROTOCOL.test(new URL(url).href)\n } catch (err) {\n return false\n }\n}\n","function iter(output, nullish, sep, val, key) {\n\tvar k, pfx = key ? (key + sep) : key;\n\n\tif (val == null) {\n\t\tif (nullish) output[key] = val;\n\t} else if (typeof val != 'object') {\n\t\toutput[key] = val;\n\t} else if (Array.isArray(val)) {\n\t\tfor (k=0; k < val.length; k++) {\n\t\t\titer(output, nullish, sep, val[k], pfx + k);\n\t\t}\n\t} else {\n\t\tfor (k in val) {\n\t\t\titer(output, nullish, sep, val[k], pfx + k);\n\t\t}\n\t}\n}\n\nfunction flattie(input, glue, toNull) {\n\tvar output = {};\n\tif (typeof input == 'object') {\n\t\titer(output, !!toNull, glue || '.', input, '');\n\t}\n\treturn output;\n}\n\nexports.flattie = flattie;","export function encode(obj, pfx) {\n\tvar k, i, tmp, str='';\n\n\tfor (k in obj) {\n\t\tif ((tmp = obj[k]) !== void 0) {\n\t\t\tif (Array.isArray(tmp)) {\n\t\t\t\tfor (i=0; i < tmp.length; i++) {\n\t\t\t\t\tstr && (str += '&');\n\t\t\t\t\tstr += encodeURIComponent(k) + '=' + encodeURIComponent(tmp[i]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstr && (str += '&');\n\t\t\t\tstr += encodeURIComponent(k) + '=' + encodeURIComponent(tmp);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn (pfx || '') + str;\n}\n\nfunction toValue(mix) {\n\tif (!mix) return '';\n\tvar str = decodeURIComponent(mix);\n\tif (str === 'false') return false;\n\tif (str === 'true') return true;\n\treturn (+str * 0 === 0) ? (+str) : str;\n}\n\nexport function decode(str) {\n\tvar tmp, k, out={}, arr=str.split('&');\n\n\twhile (tmp = arr.shift()) {\n\t\ttmp = tmp.split('=');\n\t\tk = tmp.shift();\n\t\tif (out[k] !== void 0) {\n\t\t\tout[k] = [].concat(out[k], toValue(tmp.shift()));\n\t\t} else {\n\t\t\tout[k] = toValue(tmp.shift());\n\t\t}\n\t}\n\n\treturn out;\n}\n","'use strict';\n\nconst copyProperty = (to, from, property, ignoreNonConfigurable) => {\n\t// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.\n\t// `Function#prototype` is non-writable and non-configurable so can never be modified.\n\tif (property === 'length' || property === 'prototype') {\n\t\treturn;\n\t}\n\n\tconst toDescriptor = Object.getOwnPropertyDescriptor(to, property);\n\tconst fromDescriptor = Object.getOwnPropertyDescriptor(from, property);\n\n\tif (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {\n\t\treturn;\n\t}\n\n\tObject.defineProperty(to, property, fromDescriptor);\n};\n\n// `Object.defineProperty()` throws if the property exists, is not configurable and either:\n// - one its descriptors is changed\n// - it is non-writable and its value is changed\nconst canCopyProperty = function (toDescriptor, fromDescriptor) {\n\treturn toDescriptor === undefined || toDescriptor.configurable || (\n\t\ttoDescriptor.writable === fromDescriptor.writable &&\n\t\ttoDescriptor.enumerable === fromDescriptor.enumerable &&\n\t\ttoDescriptor.configurable === fromDescriptor.configurable &&\n\t\t(toDescriptor.writable || toDescriptor.value === fromDescriptor.value)\n\t);\n};\n\nconst changePrototype = (to, from) => {\n\tconst fromPrototype = Object.getPrototypeOf(from);\n\tif (fromPrototype === Object.getPrototypeOf(to)) {\n\t\treturn;\n\t}\n\n\tObject.setPrototypeOf(to, fromPrototype);\n};\n\nconst wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/\\n${fromBody}`;\n\nconst toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, 'toString');\nconst toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, 'name');\n\n// We call `from.toString()` early (not lazily) to ensure `from` can be garbage collected.\n// We use `bind()` instead of a closure for the same reason.\n// Calling `from.toString()` early also allows caching it in case `to.toString()` is called several times.\nconst changeToString = (to, from, name) => {\n\tconst withName = name === '' ? '' : `with ${name.trim()}() `;\n\tconst newToString = wrappedToString.bind(null, withName, from.toString());\n\t// Ensure `to.toString.toString` is non-enumerable and has the same `same`\n\tObject.defineProperty(newToString, 'name', toStringName);\n\tObject.defineProperty(to, 'toString', {...toStringDescriptor, value: newToString});\n};\n\nconst mimicFn = (to, from, {ignoreNonConfigurable = false} = {}) => {\n\tconst {name} = to;\n\n\tfor (const property of Reflect.ownKeys(from)) {\n\t\tcopyProperty(to, from, property, ignoreNonConfigurable);\n\t}\n\n\tchangePrototype(to, from);\n\tchangeToString(to, from, name);\n\n\treturn to;\n};\n\nmodule.exports = mimicFn;\n","'use strict'\n\nmodule.exports = {\n isFunction: obj => typeof obj === 'function',\n isString: obj => typeof obj === 'string',\n composeErrorMessage: (code, description) => `${code}, ${description}`,\n inherits: (ctor, superCtor) => {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n}\n","'use strict'\n\nconst {isFunction, composeErrorMessage} = require('./helpers')\n\nfunction interfaceObject (error, ...props) {\n Object.assign(error, ...props)\n\n error.description = isFunction(error.message) ? error.message(error) : error.message\n\n error.message = error.code\n ? composeErrorMessage(error.code, error.description)\n : error.description\n}\n\nmodule.exports = interfaceObject\n","'use strict'\n\nconst cleanStack = require('clean-stack')\nconst mimicFn = require('mimic-fn')\n\nconst addErrorProps = require('./add-error-props')\nconst {isString} = require('./helpers')\n\nfunction createExtendError (ErrorClass, classProps) {\n function ExtendError (props) {\n const error = new ErrorClass()\n const errorProps = isString(props) ? {message: props} : props\n addErrorProps(error, classProps, errorProps)\n\n error.stack = cleanStack(error.stack)\n return error\n }\n\n ExtendError.prototype = ErrorClass.prototype\n mimicFn(ExtendError, ErrorClass)\n\n return ExtendError\n}\n\nmodule.exports = createExtendError\n","'use strict'\n\nconst {inherits} = require('./helpers')\nconst mimicFn = require('mimic-fn')\n\nconst REGEX_CLASS_NAME = /[^0-9a-zA-Z_$]/\n\nfunction createError (className) {\n if (typeof className !== 'string') {\n throw new TypeError('Expected className to be a string')\n }\n\n if (REGEX_CLASS_NAME.test(className)) {\n throw new Error('className contains invalid characters')\n }\n\n function ErrorClass () {\n Object.defineProperty(this, 'name', {\n configurable: true,\n value: className,\n writable: true\n })\n\n Error.captureStackTrace(this, this.constructor)\n }\n\n inherits(ErrorClass, Error)\n mimicFn(ErrorClass, Error)\n return ErrorClass\n}\n\nmodule.exports = createError\n","'use strict'\n\nconst createExtendError = require('./create-extend-error')\nconst createError = require('./create-error')\n\nconst createErrorClass = ErrorClass => (className, props) => {\n const errorClass = createError(className || ErrorClass.name)\n return createExtendError(errorClass, props)\n}\n\nmodule.exports = createErrorClass(Error)\nmodule.exports.type = createErrorClass(TypeError)\nmodule.exports.range = createErrorClass(RangeError)\nmodule.exports.eval = createErrorClass(EvalError)\nmodule.exports.syntax = createErrorClass(SyntaxError)\nmodule.exports.reference = createErrorClass(ReferenceError)\nmodule.exports.uri = createErrorClass(URIError)\n","const ENDPOINT = {\n FREE: 'https://api.microlink.io',\n PRO: 'https://pro.microlink.io'\n}\n\nconst isObject = input => typeof input === 'object'\n\nconst pickBy = obj => {\n Object.keys(obj).forEach(key => obj[key] == null && delete obj[key])\n return obj\n}\n\nconst parseBody = (input, error, url) => {\n try {\n return JSON.parse(input)\n } catch (_) {\n const message = input || error.message\n\n return {\n status: 'error',\n data: { url: message },\n more: 'https://microlink.io/efatal',\n code: 'EFATAL',\n message,\n url\n }\n }\n}\n\nconst factory = ({ VERSION, MicrolinkError, isUrlHttp, stringify, got, flatten }) => {\n const assertUrl = (url = '') => {\n if (!isUrlHttp(url)) {\n const message = `The \\`url\\` as \\`${url}\\` is not valid. Ensure it has protocol (http or https) and hostname.`\n throw new MicrolinkError({\n status: 'fail',\n data: { url: message },\n more: 'https://microlink.io/docs/api/api-parameters/url',\n code: 'EINVALURLCLIENT',\n message,\n url\n })\n }\n }\n\n const mapRules = rules => {\n if (!isObject(rules)) return\n const flatRules = flatten(rules)\n return Object.keys(flatRules).reduce(\n (acc, key) => ({ ...acc, [`data.${key}`]: flatRules[key] }),\n {}\n )\n }\n\n const fetchFromApi = async (apiUrl, opts = {}) => {\n try {\n const response = await got(apiUrl, opts)\n return opts.responseType === 'buffer'\n ? { body: response.body, response }\n : { ...response.body, response }\n } catch (err) {\n const { response = {} } = err\n const { statusCode, body: rawBody, headers, url: uri = apiUrl } = response\n\n const body =\n isObject(rawBody) && !Buffer.isBuffer(rawBody) ? rawBody : parseBody(rawBody, err, uri)\n\n throw MicrolinkError({\n ...body,\n message: body.message,\n url: uri,\n statusCode,\n headers\n })\n }\n }\n\n const getApiUrl = (\n url,\n { data, apiKey, endpoint, retry, cache, ...opts } = {},\n { responseType = 'json', headers: gotHeaders, ...gotOpts } = {}\n ) => {\n const isPro = !!apiKey\n const apiEndpoint = endpoint || ENDPOINT[isPro ? 'PRO' : 'FREE']\n\n const apiUrl = `${apiEndpoint}?${stringify({\n url,\n ...mapRules(data),\n ...flatten(pickBy(opts))\n })}`\n\n const headers = isPro ? { ...gotHeaders, 'x-api-key': apiKey } : { ...gotHeaders }\n return [apiUrl, { ...gotOpts, responseType, cache, retry, headers }]\n }\n\n const createMql = defaultOpts => async (url, opts, gotOpts) => {\n assertUrl(url)\n const [apiUrl, fetchOpts] = getApiUrl(url, opts, {\n ...defaultOpts,\n ...gotOpts\n })\n return fetchFromApi(apiUrl, fetchOpts)\n }\n\n const mql = createMql()\n mql.MicrolinkError = MicrolinkError\n mql.getApiUrl = getApiUrl\n mql.fetchFromApi = fetchFromApi\n mql.mapRules = mapRules\n mql.version = VERSION\n mql.stream = got.stream\n mql.buffer = createMql({ responseType: 'buffer' })\n\n return mql\n}\n\nmodule.exports = factory\n","(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.ky = factory());\n}(this, (function () { 'use strict';\n\n\t/*! MIT License © Sindre Sorhus */\n\n\tconst isObject = value => value !== null && typeof value === 'object';\n\tconst supportsAbortController = typeof globalThis.AbortController === 'function';\n\tconst supportsStreams = typeof globalThis.ReadableStream === 'function';\n\tconst supportsFormData = typeof globalThis.FormData === 'function';\n\n\tconst mergeHeaders = (source1, source2) => {\n\t\tconst result = new globalThis.Headers(source1 || {});\n\t\tconst isHeadersInstance = source2 instanceof globalThis.Headers;\n\t\tconst source = new globalThis.Headers(source2 || {});\n\n\t\tfor (const [key, value] of source) {\n\t\t\tif ((isHeadersInstance && value === 'undefined') || value === undefined) {\n\t\t\t\tresult.delete(key);\n\t\t\t} else {\n\t\t\t\tresult.set(key, value);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t};\n\n\tconst deepMerge = (...sources) => {\n\t\tlet returnValue = {};\n\t\tlet headers = {};\n\n\t\tfor (const source of sources) {\n\t\t\tif (Array.isArray(source)) {\n\t\t\t\tif (!(Array.isArray(returnValue))) {\n\t\t\t\t\treturnValue = [];\n\t\t\t\t}\n\n\t\t\t\treturnValue = [...returnValue, ...source];\n\t\t\t} else if (isObject(source)) {\n\t\t\t\tfor (let [key, value] of Object.entries(source)) {\n\t\t\t\t\tif (isObject(value) && (key in returnValue)) {\n\t\t\t\t\t\tvalue = deepMerge(returnValue[key], value);\n\t\t\t\t\t}\n\n\t\t\t\t\treturnValue = {...returnValue, [key]: value};\n\t\t\t\t}\n\n\t\t\t\tif (isObject(source.headers)) {\n\t\t\t\t\theaders = mergeHeaders(headers, source.headers);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturnValue.headers = headers;\n\t\t}\n\n\t\treturn returnValue;\n\t};\n\n\tconst requestMethods = [\n\t\t'get',\n\t\t'post',\n\t\t'put',\n\t\t'patch',\n\t\t'head',\n\t\t'delete'\n\t];\n\n\tconst responseTypes = {\n\t\tjson: 'application/json',\n\t\ttext: 'text/*',\n\t\tformData: 'multipart/form-data',\n\t\tarrayBuffer: '*/*',\n\t\tblob: '*/*'\n\t};\n\n\tconst retryMethods = [\n\t\t'get',\n\t\t'put',\n\t\t'head',\n\t\t'delete',\n\t\t'options',\n\t\t'trace'\n\t];\n\n\tconst retryStatusCodes = [\n\t\t408,\n\t\t413,\n\t\t429,\n\t\t500,\n\t\t502,\n\t\t503,\n\t\t504\n\t];\n\n\tconst retryAfterStatusCodes = [\n\t\t413,\n\t\t429,\n\t\t503\n\t];\n\n\tconst stop = Symbol('stop');\n\n\tclass HTTPError extends Error {\n\t\tconstructor(response, request, options) {\n\t\t\t// Set the message to the status text, such as Unauthorized,\n\t\t\t// with some fallbacks. This message should never be undefined.\n\t\t\tsuper(\n\t\t\t\tresponse.statusText ||\n\t\t\t\tString(\n\t\t\t\t\t(response.status === 0 || response.status) ?\n\t\t\t\t\t\tresponse.status : 'Unknown response error'\n\t\t\t\t)\n\t\t\t);\n\t\t\tthis.name = 'HTTPError';\n\t\t\tthis.response = response;\n\t\t\tthis.request = request;\n\t\t\tthis.options = options;\n\t\t}\n\t}\n\n\tclass TimeoutError extends Error {\n\t\tconstructor(request) {\n\t\t\tsuper('Request timed out');\n\t\t\tthis.name = 'TimeoutError';\n\t\t\tthis.request = request;\n\t\t}\n\t}\n\n\tconst delay = ms => new Promise(resolve => setTimeout(resolve, ms));\n\n\t// `Promise.race()` workaround (#91)\n\tconst timeout = (request, abortController, options) =>\n\t\tnew Promise((resolve, reject) => {\n\t\t\tconst timeoutID = setTimeout(() => {\n\t\t\t\tif (abortController) {\n\t\t\t\t\tabortController.abort();\n\t\t\t\t}\n\n\t\t\t\treject(new TimeoutError(request));\n\t\t\t}, options.timeout);\n\n\t\t\t/* eslint-disable promise/prefer-await-to-then */\n\t\t\toptions.fetch(request)\n\t\t\t\t.then(resolve)\n\t\t\t\t.catch(reject)\n\t\t\t\t.then(() => {\n\t\t\t\t\tclearTimeout(timeoutID);\n\t\t\t\t});\n\t\t\t/* eslint-enable promise/prefer-await-to-then */\n\t\t});\n\n\tconst normalizeRequestMethod = input => requestMethods.includes(input) ? input.toUpperCase() : input;\n\n\tconst defaultRetryOptions = {\n\t\tlimit: 2,\n\t\tmethods: retryMethods,\n\t\tstatusCodes: retryStatusCodes,\n\t\tafterStatusCodes: retryAfterStatusCodes\n\t};\n\n\tconst normalizeRetryOptions = (retry = {}) => {\n\t\tif (typeof retry === 'number') {\n\t\t\treturn {\n\t\t\t\t...defaultRetryOptions,\n\t\t\t\tlimit: retry\n\t\t\t};\n\t\t}\n\n\t\tif (retry.methods && !Array.isArray(retry.methods)) {\n\t\t\tthrow new Error('retry.methods must be an array');\n\t\t}\n\n\t\tif (retry.statusCodes && !Array.isArray(retry.statusCodes)) {\n\t\t\tthrow new Error('retry.statusCodes must be an array');\n\t\t}\n\n\t\treturn {\n\t\t\t...defaultRetryOptions,\n\t\t\t...retry,\n\t\t\tafterStatusCodes: retryAfterStatusCodes\n\t\t};\n\t};\n\n\t// The maximum value of a 32bit int (see issue #117)\n\tconst maxSafeTimeout = 2147483647;\n\n\tclass Ky {\n\t\tconstructor(input, options = {}) {\n\t\t\tthis._retryCount = 0;\n\t\t\tthis._input = input;\n\t\t\tthis._options = {\n\t\t\t\t// TODO: credentials can be removed when the spec change is implemented in all browsers. Context: https://www.chromestatus.com/feature/4539473312350208\n\t\t\t\tcredentials: this._input.credentials || 'same-origin',\n\t\t\t\t...options,\n\t\t\t\theaders: mergeHeaders(this._input.headers, options.headers),\n\t\t\t\thooks: deepMerge({\n\t\t\t\t\tbeforeRequest: [],\n\t\t\t\t\tbeforeRetry: [],\n\t\t\t\t\tafterResponse: []\n\t\t\t\t}, options.hooks),\n\t\t\t\tmethod: normalizeRequestMethod(options.method || this._input.method),\n\t\t\t\tprefixUrl: String(options.prefixUrl || ''),\n\t\t\t\tretry: normalizeRetryOptions(options.retry),\n\t\t\t\tthrowHttpErrors: options.throwHttpErrors !== false,\n\t\t\t\ttimeout: typeof options.timeout === 'undefined' ? 10000 : options.timeout,\n\t\t\t\tfetch: options.fetch || globalThis.fetch.bind(globalThis)\n\t\t\t};\n\n\t\t\tif (typeof this._input !== 'string' && !(this._input instanceof URL || this._input instanceof globalThis.Request)) {\n\t\t\t\tthrow new TypeError('`input` must be a string, URL, or Request');\n\t\t\t}\n\n\t\t\tif (this._options.prefixUrl && typeof this._input === 'string') {\n\t\t\t\tif (this._input.startsWith('/')) {\n\t\t\t\t\tthrow new Error('`input` must not begin with a slash when using `prefixUrl`');\n\t\t\t\t}\n\n\t\t\t\tif (!this._options.prefixUrl.endsWith('/')) {\n\t\t\t\t\tthis._options.prefixUrl += '/';\n\t\t\t\t}\n\n\t\t\t\tthis._input = this._options.prefixUrl + this._input;\n\t\t\t}\n\n\t\t\tif (supportsAbortController) {\n\t\t\t\tthis.abortController = new globalThis.AbortController();\n\t\t\t\tif (this._options.signal) {\n\t\t\t\t\tthis._options.signal.addEventListener('abort', () => {\n\t\t\t\t\t\tthis.abortController.abort();\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tthis._options.signal = this.abortController.signal;\n\t\t\t}\n\n\t\t\tthis.request = new globalThis.Request(this._input, this._options);\n\n\t\t\tif (this._options.searchParams) {\n\t\t\t\tconst textSearchParams = typeof this._options.searchParams === 'string' ?\n\t\t\t\t\tthis._options.searchParams.replace(/^\\?/, '') :\n\t\t\t\t\tnew URLSearchParams(this._options.searchParams).toString();\n\t\t\t\tconst searchParams = '?' + textSearchParams;\n\t\t\t\tconst url = this.request.url.replace(/(?:\\?.*?)?(?=#|$)/, searchParams);\n\n\t\t\t\t// To provide correct form boundary, Content-Type header should be deleted each time when new Request instantiated from another one\n\t\t\t\tif (((supportsFormData && this._options.body instanceof globalThis.FormData) || this._options.body instanceof URLSearchParams) && !(this._options.headers && this._options.headers['content-type'])) {\n\t\t\t\t\tthis.request.headers.delete('content-type');\n\t\t\t\t}\n\n\t\t\t\tthis.request = new globalThis.Request(new globalThis.Request(url, this.request), this._options);\n\t\t\t}\n\n\t\t\tif (this._options.json !== undefined) {\n\t\t\t\tthis._options.body = JSON.stringify(this._options.json);\n\t\t\t\tthis.request.headers.set('content-type', 'application/json');\n\t\t\t\tthis.request = new globalThis.Request(this.request, {body: this._options.body});\n\t\t\t}\n\n\t\t\tconst fn = async () => {\n\t\t\t\tif (this._options.timeout > maxSafeTimeout) {\n\t\t\t\t\tthrow new RangeError(`The \\`timeout\\` option cannot be greater than ${maxSafeTimeout}`);\n\t\t\t\t}\n\n\t\t\t\tawait delay(1);\n\t\t\t\tlet response = await this._fetch();\n\n\t\t\t\tfor (const hook of this._options.hooks.afterResponse) {\n\t\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\t\tconst modifiedResponse = await hook(\n\t\t\t\t\t\tthis.request,\n\t\t\t\t\t\tthis._options,\n\t\t\t\t\t\tthis._decorateResponse(response.clone())\n\t\t\t\t\t);\n\n\t\t\t\t\tif (modifiedResponse instanceof globalThis.Response) {\n\t\t\t\t\t\tresponse = modifiedResponse;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis._decorateResponse(response);\n\n\t\t\t\tif (!response.ok && this._options.throwHttpErrors) {\n\t\t\t\t\tthrow new HTTPError(response, this.request, this._options);\n\t\t\t\t}\n\n\t\t\t\t// If `onDownloadProgress` is passed, it uses the stream API internally\n\t\t\t\t/* istanbul ignore next */\n\t\t\t\tif (this._options.onDownloadProgress) {\n\t\t\t\t\tif (typeof this._options.onDownloadProgress !== 'function') {\n\t\t\t\t\t\tthrow new TypeError('The `onDownloadProgress` option must be a function');\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!supportsStreams) {\n\t\t\t\t\t\tthrow new Error('Streams are not supported in your environment. `ReadableStream` is missing.');\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this._stream(response.clone(), this._options.onDownloadProgress);\n\t\t\t\t}\n\n\t\t\t\treturn response;\n\t\t\t};\n\n\t\t\tconst isRetriableMethod = this._options.retry.methods.includes(this.request.method.toLowerCase());\n\t\t\tconst result = isRetriableMethod ? this._retry(fn) : fn();\n\n\t\t\tfor (const [type, mimeType] of Object.entries(responseTypes)) {\n\t\t\t\tresult[type] = async () => {\n\t\t\t\t\tthis.request.headers.set('accept', this.request.headers.get('accept') || mimeType);\n\n\t\t\t\t\tconst response = (await result).clone();\n\n\t\t\t\t\tif (type === 'json') {\n\t\t\t\t\t\tif (response.status === 204) {\n\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (options.parseJson) {\n\t\t\t\t\t\t\treturn options.parseJson(await response.text());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn response[type]();\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\t_calculateRetryDelay(error) {\n\t\t\tthis._retryCount++;\n\n\t\t\tif (this._retryCount < this._options.retry.limit && !(error instanceof TimeoutError)) {\n\t\t\t\tif (error instanceof HTTPError) {\n\t\t\t\t\tif (!this._options.retry.statusCodes.includes(error.response.status)) {\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst retryAfter = error.response.headers.get('Retry-After');\n\t\t\t\t\tif (retryAfter && this._options.retry.afterStatusCodes.includes(error.response.status)) {\n\t\t\t\t\t\tlet after = Number(retryAfter);\n\t\t\t\t\t\tif (Number.isNaN(after)) {\n\t\t\t\t\t\t\tafter = Date.parse(retryAfter) - Date.now();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tafter *= 1000;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (typeof this._options.retry.maxRetryAfter !== 'undefined' && after > this._options.retry.maxRetryAfter) {\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn after;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (error.response.status === 413) {\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst BACKOFF_FACTOR = 0.3;\n\t\t\t\treturn BACKOFF_FACTOR * (2 ** (this._retryCount - 1)) * 1000;\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t}\n\n\t\t_decorateResponse(response) {\n\t\t\tif (this._options.parseJson) {\n\t\t\t\tresponse.json = async () => {\n\t\t\t\t\treturn this._options.parseJson(await response.text());\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn response;\n\t\t}\n\n\t\tasync _retry(fn) {\n\t\t\ttry {\n\t\t\t\treturn await fn();\n\t\t\t} catch (error) {\n\t\t\t\tconst ms = Math.min(this._calculateRetryDelay(error), maxSafeTimeout);\n\t\t\t\tif (ms !== 0 && this._retryCount > 0) {\n\t\t\t\t\tawait delay(ms);\n\n\t\t\t\t\tfor (const hook of this._options.hooks.beforeRetry) {\n\t\t\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\t\t\tconst hookResult = await hook({\n\t\t\t\t\t\t\trequest: this.request,\n\t\t\t\t\t\t\toptions: this._options,\n\t\t\t\t\t\t\terror,\n\t\t\t\t\t\t\tretryCount: this._retryCount\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t// If `stop` is returned from the hook, the retry process is stopped\n\t\t\t\t\t\tif (hookResult === stop) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn this._retry(fn);\n\t\t\t\t}\n\n\t\t\t\tif (this._options.throwHttpErrors) {\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tasync _fetch() {\n\t\t\tfor (const hook of this._options.hooks.beforeRequest) {\n\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\tconst result = await hook(this.request, this._options);\n\n\t\t\t\tif (result instanceof Request) {\n\t\t\t\t\tthis.request = result;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (result instanceof Response) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this._options.timeout === false) {\n\t\t\t\treturn this._options.fetch(this.request.clone());\n\t\t\t}\n\n\t\t\treturn timeout(this.request.clone(), this.abortController, this._options);\n\t\t}\n\n\t\t/* istanbul ignore next */\n\t\t_stream(response, onDownloadProgress) {\n\t\t\tconst totalBytes = Number(response.headers.get('content-length')) || 0;\n\t\t\tlet transferredBytes = 0;\n\n\t\t\treturn new globalThis.Response(\n\t\t\t\tnew globalThis.ReadableStream({\n\t\t\t\t\tasync start(controller) {\n\t\t\t\t\t\tconst reader = response.body.getReader();\n\n\t\t\t\t\t\tif (onDownloadProgress) {\n\t\t\t\t\t\t\tonDownloadProgress({percent: 0, transferredBytes: 0, totalBytes}, new Uint8Array());\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tasync function read() {\n\t\t\t\t\t\t\tconst {done, value} = await reader.read();\n\t\t\t\t\t\t\tif (done) {\n\t\t\t\t\t\t\t\tcontroller.close();\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (onDownloadProgress) {\n\t\t\t\t\t\t\t\ttransferredBytes += value.byteLength;\n\t\t\t\t\t\t\t\tconst percent = totalBytes === 0 ? 0 : transferredBytes / totalBytes;\n\t\t\t\t\t\t\t\tonDownloadProgress({percent, transferredBytes, totalBytes}, value);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcontroller.enqueue(value);\n\t\t\t\t\t\t\tawait read();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tawait read();\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t);\n\t\t}\n\t}\n\n\tconst validateAndMerge = (...sources) => {\n\t\tfor (const source of sources) {\n\t\t\tif ((!isObject(source) || Array.isArray(source)) && typeof source !== 'undefined') {\n\t\t\t\tthrow new TypeError('The `options` argument must be an object');\n\t\t\t}\n\t\t}\n\n\t\treturn deepMerge({}, ...sources);\n\t};\n\n\tconst createInstance = defaults => {\n\t\tconst ky = (input, options) => new Ky(input, validateAndMerge(defaults, options));\n\n\t\tfor (const method of requestMethods) {\n\t\t\tky[method] = (input, options) => new Ky(input, validateAndMerge(defaults, options, {method}));\n\t\t}\n\n\t\tky.HTTPError = HTTPError;\n\t\tky.TimeoutError = TimeoutError;\n\t\tky.create = newDefaults => createInstance(validateAndMerge(newDefaults));\n\t\tky.extend = newDefaults => createInstance(validateAndMerge(defaults, newDefaults));\n\t\tky.stop = stop;\n\n\t\treturn ky;\n\t};\n\n\tconst ky = createInstance();\n\n\treturn ky;\n\n})));\n","'use strict'\n\nconst isUrlHttp = require('is-url-http/lightweight')\nconst { flattie: flatten } = require('flattie')\nconst { encode: stringify } = require('qss')\nconst whoops = require('whoops')\n\nconst factory = require('./factory')\nconst ky = require('./ky')\n\nconst MicrolinkError = whoops('MicrolinkError')\n\nconst got = async (url, opts) => {\n try {\n if (opts.timeout === undefined) opts.timeout = false\n const response = await ky(url, opts)\n const body = await response.json()\n const { headers, status: statusCode, statusText: statusMessage } = response\n return { url: response.url, body, headers, statusCode, statusMessage }\n } catch (err) {\n if (err.response) {\n const { response } = err\n err.response = {\n ...response,\n headers: [...response.headers.entries()].reduce(\n (acc, [key, value]) => ({ ...acc, [key]: value }),\n {}\n ),\n statusCode: response.status,\n body: await response.text()\n }\n }\n throw err\n }\n}\n\nmodule.exports = factory({\n MicrolinkError,\n isUrlHttp,\n stringify,\n got,\n flatten,\n VERSION: '__MQL_VERSION__'\n})\n"],"names":["URL","global","window","require$$0","REGEX_HTTP_PROTOCOL","iter","output","nullish","sep","val","key","k","pfx","Array","isArray","length","toValue","mix","str","decodeURIComponent","input","glue","toNull","obj","i","tmp","encodeURIComponent","out","arr","split","shift","concat","copyProperty","to","from","property","ignoreNonConfigurable","toDescriptor","Object","getOwnPropertyDescriptor","fromDescriptor","canCopyProperty","defineProperty","undefined","configurable","writable","enumerable","value","wrappedToString","withName","fromBody","toStringDescriptor","Function","prototype","toStringName","toString","mimicFn_1","name","Reflect","ownKeys","fromPrototype","getPrototypeOf","setPrototypeOf","changePrototype","trim","newToString","bind","changeToString","helpers","isFunction","isString","composeErrorMessage","code","description","inherits","ctor","superCtor","super_","create","constructor","cleanStack","mimicFn","require$$1","addErrorProps","error","props","assign","message","require$$3","createExtendError_1","ErrorClass","classProps","ExtendError","errorProps","stack","REGEX_CLASS_NAME","createExtendError","createError","className","TypeError","test","Error","this","captureStackTrace","createErrorClass","errorClass","RangeError","EvalError","SyntaxError","ReferenceError","URIError","ENDPOINT","FREE","PRO","isObject","factory_1","VERSION","MicrolinkError","isUrlHttp","stringify","got","flatten","mapRules","rules","flatRules","keys","reduce","acc","[object Object]","fetchFromApi","async","apiUrl","opts","response","responseType","body","err","statusCode","rawBody","headers","url","uri","Buffer","isBuffer","JSON","parse","_","status","data","more","parseBody","getApiUrl","apiKey","endpoint","retry","cache","gotHeaders","gotOpts","isPro","forEach","x-api-key","createMql","defaultOpts","assertUrl","fetchOpts","mql","version","stream","buffer","module","supportsAbortController","globalThis","AbortController","supportsStreams","ReadableStream","supportsFormData","FormData","mergeHeaders","source1","source2","result","Headers","isHeadersInstance","source","delete","set","deepMerge","sources","returnValue","entries","requestMethods","responseTypes","json","text","formData","arrayBuffer","blob","retryMethods","retryStatusCodes","retryAfterStatusCodes","stop","Symbol","HTTPError","request","options","super","statusText","String","TimeoutError","delay","ms","Promise","resolve","setTimeout","timeout","abortController","reject","timeoutID","abort","fetch","then","catch","clearTimeout","normalizeRequestMethod","includes","toUpperCase","defaultRetryOptions","limit","methods","statusCodes","afterStatusCodes","normalizeRetryOptions","maxSafeTimeout","Ky","_retryCount","_input","_options","credentials","hooks","beforeRequest","beforeRetry","afterResponse","method","prefixUrl","throwHttpErrors","Request","startsWith","endsWith","signal","addEventListener","searchParams","replace","URLSearchParams","fn","_fetch","hook","modifiedResponse","_decorateResponse","clone","Response","ok","onDownloadProgress","_stream","toLowerCase","_retry","type","mimeType","get","parseJson","retryAfter","after","Number","isNaN","Date","now","maxRetryAfter","Math","min","_calculateRetryDelay","retryCount","totalBytes","transferredBytes","controller","reader","getReader","read","done","close","byteLength","percent","enqueue","Uint8Array","validateAndMerge","createInstance","defaults","ky","newDefaults","extend","factory","href","flattie","encode","require$$2","whoops","require$$5","require$$4","statusMessage"],"mappings":"svBAEA,MAAMA,EAAMC,EAAOC,OAASA,OAAOF,IAAMG,UAAeH,IAClDI,EAAsB,yBCH5B,SAASC,EAAKC,EAAQC,EAASC,EAAKC,EAAKC,GACxC,IAAIC,EAAGC,EAAMF,EAAOA,EAAMF,EAAOE,EAEjC,GAAW,MAAPD,EACCF,IAASD,EAAOI,GAAOD,QACrB,GAAkB,iBAAPA,EACjBH,EAAOI,GAAOD,OACR,GAAII,MAAMC,QAAQL,GACxB,IAAKE,EAAE,EAAGA,EAAIF,EAAIM,OAAQJ,IACzBN,EAAKC,EAAQC,EAASC,EAAKC,EAAIE,GAAIC,EAAMD,QAG1C,IAAKA,KAAKF,EACTJ,EAAKC,EAAQC,EAASC,EAAKC,EAAIE,GAAIC,EAAMD,GCO5C,SAASK,EAAQC,GAChB,IAAKA,EAAK,MAAO,GACjB,IAAIC,EAAMC,mBAAmBF,GAC7B,MAAY,UAARC,IACQ,SAARA,IACW,GAANA,GAAY,GAAOA,EAAOA,cDPpC,SAAiBE,EAAOC,EAAMC,GAC7B,IAAIhB,EAAS,GAIb,MAHoB,iBAATc,GACVf,EAAKC,IAAUgB,EAAQD,GAAQ,IAAKD,EAAO,IAErCd,gDCvBD,SAAgBiB,EAAKX,GAC3B,IAAID,EAAGa,EAAGC,EAAKP,EAAI,GAEnB,IAAKP,KAAKY,EACT,QAAuB,KAAlBE,EAAMF,EAAIZ,IACd,GAAIE,MAAMC,QAAQW,GACjB,IAAKD,EAAE,EAAGA,EAAIC,EAAIV,OAAQS,IACzBN,IAAQA,GAAO,KACfA,GAAOQ,mBAAmBf,GAAK,IAAMe,mBAAmBD,EAAID,SAG7DN,IAAQA,GAAO,KACfA,GAAOQ,mBAAmBf,GAAK,IAAMe,mBAAmBD,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