diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 48e24a113..8c1db59e0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -30,7 +30,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: v1.26.1 + go-version: v1.26.2 - uses: actions/setup-node@v4 with: node-version: '20' @@ -45,7 +45,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: v1.26.1 + go-version: v1.26.2 - uses: actions/setup-node@v4 with: node-version: '20' @@ -60,7 +60,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: v1.26.1 + go-version: v1.26.2 - run: make test lint: @@ -70,7 +70,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: v1.26.1 + go-version: v1.26.2 - run: make lint verify: @@ -80,5 +80,5 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: v1.26.1 + go-version: v1.26.2 - run: make verify diff --git a/.github/workflows/docs-gen-and-push.yaml b/.github/workflows/docs-gen-and-push.yaml index 595ec249c..ef38d5e98 100644 --- a/.github/workflows/docs-gen-and-push.yaml +++ b/.github/workflows/docs-gen-and-push.yaml @@ -34,7 +34,7 @@ jobs: - uses: actions/setup-go@v5 with: - go-version: v1.26.1 + go-version: v1.26.2 cache: true - uses: actions/setup-python@v5 diff --git a/.github/workflows/goreleaser.yaml b/.github/workflows/goreleaser.yaml index 9ff1cf57f..fee2f1e4b 100644 --- a/.github/workflows/goreleaser.yaml +++ b/.github/workflows/goreleaser.yaml @@ -22,7 +22,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-go@v5 with: - go-version: v1.26.1 + go-version: v1.26.2 - name: Delete non-semver tags run: 'git tag -d $(git tag -l | grep -v "^v")' - name: Set LDFLAGS diff --git a/.github/workflows/image.yaml b/.github/workflows/image.yaml index 6c5143654..8c696215e 100644 --- a/.github/workflows/image.yaml +++ b/.github/workflows/image.yaml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: v1.26.1 + go-version: v1.26.2 check-latest: true # We need this to remove local tags that are not semver so goreleaser doesn't get confused. diff --git a/.ko.yaml b/.ko.yaml index e2f07f410..49897f4d7 100644 --- a/.ko.yaml +++ b/.ko.yaml @@ -1,5 +1,5 @@ baseImageOverrides: - github.com/google/ko: golang:1.26.1 + github.com/google/ko: golang:1.26.2 builds: - id: konnector diff --git a/Dockerfile b/Dockerfile index 6316c7af2..1e6d6fe2e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,7 +36,7 @@ ENV VITE_BUILD_TARGET=docker RUN npm run build # Build Go binary with embedded UI assets -FROM golang:1.26.1 AS go-build-env +FROM golang:1.26.2 AS go-build-env WORKDIR /app # Accept build arguments for multi-arch support diff --git a/Dockerfile.konnector b/Dockerfile.konnector index 269ae5d70..8913d3fdb 100644 --- a/Dockerfile.konnector +++ b/Dockerfile.konnector @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM golang:1.26.1 AS builder +FROM golang:1.26.2 AS builder WORKDIR /app # Accept build arguments for multi-arch support diff --git a/Makefile b/Makefile index 6be2e73f3..2793390f1 100644 --- a/Makefile +++ b/Makefile @@ -110,6 +110,10 @@ install: WHAT ?= ./cmd/... ./cli/cmd/... install: ## install binaries to GOBIN go install -ldflags="$(LDFLAGS)" $(WHAT) +.PHONY: install-crds +install-crds: ## Install all CRDs into the current cluster + kubectl apply -f deploy/crd + GOLANGCI_LINT = $(ROOT_DIR)/$(UGET_DIRECTORY)/golangci-lint-$(GOLANGCI_LINT_VERSION) .PHONY: install-golangci-lint diff --git a/cli/go.mod b/cli/go.mod index ef8b8d6c4..c95ba603a 100644 --- a/cli/go.mod +++ b/cli/go.mod @@ -1,6 +1,6 @@ module github.com/kube-bind/kube-bind/cli -go 1.26.0 +go 1.26.2 replace ( github.com/kube-bind/kube-bind => ../ diff --git a/contrib/kcp/go.mod b/contrib/kcp/go.mod index daaf75ec3..b0f756903 100644 --- a/contrib/kcp/go.mod +++ b/contrib/kcp/go.mod @@ -1,6 +1,6 @@ module github.com/kube-bind/kube-bind/contrib/kcp -go 1.26.0 +go 1.26.2 replace ( github.com/kube-bind/kube-bind => ../../ diff --git a/docs/generators/cli-doc/go.mod b/docs/generators/cli-doc/go.mod index b5b8666d9..7d10b0e2c 100644 --- a/docs/generators/cli-doc/go.mod +++ b/docs/generators/cli-doc/go.mod @@ -1,6 +1,6 @@ module github.com/kube-bind/kube-bind/docs/generators/cli-doc -go 1.26.0 +go 1.26.2 replace ( github.com/kube-bind/kube-bind => ../../../ diff --git a/docs/requirements.txt b/docs/requirements.txt index ee42d703c..b14446b02 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -5,6 +5,7 @@ mkdocs-macros-plugin==1.0.5 mkdocs-material[imaging]>=9.7.1 mkdocs-material-extensions==1.3.1 mkdocs-static-i18n==1.3.0 +pymdown-extensions==10.16.1 # https://github.com/mkdocs/mkdocs/issues/4032 click<=8.2.1 diff --git a/go.mod b/go.mod index 45ca6a103..979092784 100644 --- a/go.mod +++ b/go.mod @@ -6,8 +6,8 @@ module github.com/kube-bind/kube-bind // The script hack/verify-go-versions.sh checks that all version // references across the codebase are consistent with the versions // maintained here. -// go-build-version 1.26.1 -go 1.26.0 +// go-build-version 1.26.2 +go 1.26.2 replace ( github.com/kube-bind/kube-bind => ./ diff --git a/sdk/go.mod b/sdk/go.mod index 825bcfd64..b555252da 100644 --- a/sdk/go.mod +++ b/sdk/go.mod @@ -1,6 +1,6 @@ module github.com/kube-bind/kube-bind/sdk -go 1.26.0 +go 1.26.2 require ( github.com/google/go-cmp v0.7.0 diff --git a/web/dist/assets/index.DE_Nx7OI.js b/web/dist/assets/index.B099aFUK.js similarity index 96% rename from web/dist/assets/index.DE_Nx7OI.js rename to web/dist/assets/index.B099aFUK.js index 0223fd465..4c0ec3948 100644 --- a/web/dist/assets/index.DE_Nx7OI.js +++ b/web/dist/assets/index.B099aFUK.js @@ -6537,9 +6537,9 @@ var isFile = kindOfTest("File"); * also have a `name` and `type` attribute to specify filename and content type * * @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71 -* +* * @param {*} value The value to test -* +* * @returns {boolean} True if value is a React Native Blob, otherwise false */ var isReactNativeBlob = (value) => { @@ -6548,9 +6548,9 @@ var isReactNativeBlob = (value) => { /** * Determine if environment is React Native * ReactNative `FormData` has a non-standard `getParts()` method -* +* * @param {*} formData The formData to test -* +* * @returns {boolean} True if environment is React Native, otherwise false */ var isReactNative = (formData) => formData && typeof formData.getParts !== "undefined"; @@ -6567,7 +6567,7 @@ var isBlob = kindOfTest("Blob"); * * @param {*} val The value to test * -* @returns {boolean} True if value is a File, otherwise false +* @returns {boolean} True if value is a FileList, otherwise false */ var isFileList = kindOfTest("FileList"); /** @@ -6595,8 +6595,13 @@ function getGlobal() { var G = getGlobal(); var FormDataCtor = typeof G.FormData !== "undefined" ? G.FormData : void 0; var isFormData = (thing) => { - let kind; - return thing && (FormDataCtor && thing instanceof FormDataCtor || isFunction$1(thing.append) && ((kind = kindOf(thing)) === "formdata" || kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]")); + if (!thing) return false; + if (FormDataCtor && thing instanceof FormDataCtor) return true; + const proto = getPrototypeOf(thing); + if (!proto || proto === Object.prototype) return false; + if (!isFunction$1(thing.append)) return false; + const kind = kindOf(thing); + return kind === "formdata" || kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]"; }; /** * Determine if a value is a URLSearchParams object @@ -6698,18 +6703,19 @@ var isContextDefined = (context) => !isUndefined(context) && context !== _global * * @returns {Object} Result of all merge properties */ -function merge() { +function merge(...objs) { const { caseless, skipUndefined } = isContextDefined(this) && this || {}; const result = {}; const assignValue = (val, key) => { if (key === "__proto__" || key === "constructor" || key === "prototype") return; const targetKey = caseless && findKey(result, key) || key; - if (isPlainObject(result[targetKey]) && isPlainObject(val)) result[targetKey] = merge(result[targetKey], val); + const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : void 0; + if (isPlainObject(existing) && isPlainObject(val)) result[targetKey] = merge(existing, val); else if (isPlainObject(val)) result[targetKey] = merge({}, val); else if (isArray(val)) result[targetKey] = val.slice(); else if (!skipUndefined || !isUndefined(val)) result[targetKey] = val; }; - for (let i = 0, l = arguments.length; i < l; i++) arguments[i] && forEach(arguments[i], assignValue); + for (let i = 0, l = objs.length; i < l; i++) objs[i] && forEach(objs[i], assignValue); return result; } /** @@ -6726,12 +6732,14 @@ function merge() { var extend = (a, b, thisArg, { allOwnKeys } = {}) => { forEach(b, (val, key) => { if (thisArg && isFunction$1(val)) Object.defineProperty(a, key, { + __proto__: null, value: bind(val, thisArg), writable: true, enumerable: true, configurable: true }); else Object.defineProperty(a, key, { + __proto__: null, value: val, writable: true, enumerable: true, @@ -6763,12 +6771,16 @@ var stripBOM = (content) => { var inherits = (constructor, superConstructor, props, descriptors) => { constructor.prototype = Object.create(superConstructor.prototype, descriptors); Object.defineProperty(constructor.prototype, "constructor", { + __proto__: null, value: constructor, writable: true, enumerable: false, configurable: true }); - Object.defineProperty(constructor, "super", { value: superConstructor.prototype }); + Object.defineProperty(constructor, "super", { + __proto__: null, + value: superConstructor.prototype + }); props && Object.assign(constructor.prototype, props); }; /** @@ -6910,7 +6922,7 @@ var freezeMethods = (obj) => { "arguments", "caller", "callee" - ].indexOf(name) !== -1) return false; + ].includes(name)) return false; const value = obj[name]; if (!isFunction$1(value)) return; descriptor.enumerable = false; @@ -7086,175 +7098,497 @@ var utils_default = { isIterable }; //#endregion -//#region node_modules/axios/lib/core/AxiosError.js -var AxiosError = class AxiosError extends Error { - static from(error, code, config, request, response, customProps) { - const axiosError = new AxiosError(error.message, code || error.code, config, request, response); - axiosError.cause = error; - axiosError.name = error.name; - if (error.status != null && axiosError.status == null) axiosError.status = error.status; - customProps && Object.assign(axiosError, customProps); - return axiosError; - } - /** - * Create an Error with the specified message, config, error code, request and response. - * - * @param {string} message The error message. - * @param {string} [code] The error code (for example, 'ECONNABORTED'). - * @param {Object} [config] The config. - * @param {Object} [request] The request. - * @param {Object} [response] The response. - * - * @returns {Error} The created error. - */ - constructor(message, code, config, request, response) { - super(message); - Object.defineProperty(this, "message", { - value: message, - enumerable: true, - writable: true, - configurable: true - }); - this.name = "AxiosError"; - this.isAxiosError = true; - code && (this.code = code); - config && (this.config = config); - request && (this.request = request); - if (response) { - this.response = response; - this.status = response.status; - } - } - toJSON() { - return { - message: this.message, - name: this.name, - description: this.description, - number: this.number, - fileName: this.fileName, - lineNumber: this.lineNumber, - columnNumber: this.columnNumber, - stack: this.stack, - config: utils_default.toJSONObject(this.config), - code: this.code, - status: this.status - }; - } -}; -AxiosError.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE"; -AxiosError.ERR_BAD_OPTION = "ERR_BAD_OPTION"; -AxiosError.ECONNABORTED = "ECONNABORTED"; -AxiosError.ETIMEDOUT = "ETIMEDOUT"; -AxiosError.ERR_NETWORK = "ERR_NETWORK"; -AxiosError.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS"; -AxiosError.ERR_DEPRECATED = "ERR_DEPRECATED"; -AxiosError.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE"; -AxiosError.ERR_BAD_REQUEST = "ERR_BAD_REQUEST"; -AxiosError.ERR_CANCELED = "ERR_CANCELED"; -AxiosError.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT"; -AxiosError.ERR_INVALID_URL = "ERR_INVALID_URL"; -//#endregion -//#region node_modules/axios/lib/helpers/toFormData.js +//#region node_modules/axios/lib/helpers/parseHeaders.js +var ignoreDuplicateOf = utils_default.toObjectSet([ + "age", + "authorization", + "content-length", + "content-type", + "etag", + "expires", + "from", + "host", + "if-modified-since", + "if-unmodified-since", + "last-modified", + "location", + "max-forwards", + "proxy-authorization", + "referer", + "retry-after", + "user-agent" +]); /** -* Determines if the given thing is a array or js object. -* -* @param {string} thing - The object or array to be visited. +* Parse headers into an object * -* @returns {boolean} -*/ -function isVisitable(thing) { - return utils_default.isPlainObject(thing) || utils_default.isArray(thing); -} -/** -* It removes the brackets from the end of a string +* ``` +* Date: Wed, 27 Aug 2014 08:58:49 GMT +* Content-Type: application/json +* Connection: keep-alive +* Transfer-Encoding: chunked +* ``` * -* @param {string} key - The key of the parameter. +* @param {String} rawHeaders Headers needing to be parsed * -* @returns {string} the key without the brackets. +* @returns {Object} Headers parsed into an object */ -function removeBrackets(key) { - return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key; +var parseHeaders_default = (rawHeaders) => { + const parsed = {}; + let key; + let val; + let i; + rawHeaders && rawHeaders.split("\n").forEach(function parser(line) { + i = line.indexOf(":"); + key = line.substring(0, i).trim().toLowerCase(); + val = line.substring(i + 1).trim(); + if (!key || parsed[key] && ignoreDuplicateOf[key]) return; + if (key === "set-cookie") if (parsed[key]) parsed[key].push(val); + else parsed[key] = [val]; + else parsed[key] = parsed[key] ? parsed[key] + ", " + val : val; + }); + return parsed; +}; +//#endregion +//#region node_modules/axios/lib/core/AxiosHeaders.js +var $internals = Symbol("internals"); +var INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g; +function trimSPorHTAB(str) { + let start = 0; + let end = str.length; + while (start < end) { + const code = str.charCodeAt(start); + if (code !== 9 && code !== 32) break; + start += 1; + } + while (end > start) { + const code = str.charCodeAt(end - 1); + if (code !== 9 && code !== 32) break; + end -= 1; + } + return start === 0 && end === str.length ? str : str.slice(start, end); } -/** -* It takes a path, a key, and a boolean, and returns a string -* -* @param {string} path - The path to the current key. -* @param {string} key - The key of the current object being iterated over. -* @param {string} dots - If true, the key will be rendered with dots instead of brackets. -* -* @returns {string} The path to the current key. -*/ -function renderKey(path, key, dots) { - if (!path) return key; - return path.concat(key).map(function each(token, i) { - token = removeBrackets(token); - return !dots && i ? "[" + token + "]" : token; - }).join(dots ? "." : ""); +function normalizeHeader(header) { + return header && String(header).trim().toLowerCase(); } -/** -* If the array is an array and none of its elements are visitable, then it's a flat array. -* -* @param {Array} arr - The array to check -* -* @returns {boolean} -*/ -function isFlatArray(arr) { - return utils_default.isArray(arr) && !arr.some(isVisitable); +function sanitizeHeaderValue(str) { + return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, "")); } -var predicates = utils_default.toFlatObject(utils_default, {}, null, function filter(prop) { - return /^is[A-Z]/.test(prop); -}); -/** -* Convert a data object to FormData -* -* @param {Object} obj -* @param {?Object} [formData] -* @param {?Object} [options] -* @param {Function} [options.visitor] -* @param {Boolean} [options.metaTokens = true] -* @param {Boolean} [options.dots = false] -* @param {?Boolean} [options.indexes = false] -* -* @returns {Object} -**/ -/** -* It converts an object into a FormData object -* -* @param {Object} obj - The object to convert to form data. -* @param {string} formData - The FormData object to append to. -* @param {Object} options -* -* @returns -*/ -function toFormData(obj, formData, options) { - if (!utils_default.isObject(obj)) throw new TypeError("target must be an object"); - formData = formData || new FormData(); - options = utils_default.toFlatObject(options, { - metaTokens: true, - dots: false, - indexes: false - }, false, function defined(option, source) { - return !utils_default.isUndefined(source[option]); +function normalizeValue(value) { + if (value === false || value == null) return value; + return utils_default.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value)); +} +function parseTokens(str) { + const tokens = Object.create(null); + const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; + let match; + while (match = tokensRE.exec(str)) tokens[match[1]] = match[2]; + return tokens; +} +var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); +function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { + if (utils_default.isFunction(filter)) return filter.call(this, value, header); + if (isHeaderNameFilter) value = header; + if (!utils_default.isString(value)) return; + if (utils_default.isString(filter)) return value.indexOf(filter) !== -1; + if (utils_default.isRegExp(filter)) return filter.test(value); +} +function formatHeader(header) { + return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { + return char.toUpperCase() + str; }); - const metaTokens = options.metaTokens; - const visitor = options.visitor || defaultVisitor; - const dots = options.dots; - const indexes = options.indexes; - const useBlob = (options.Blob || typeof Blob !== "undefined" && Blob) && utils_default.isSpecCompliantForm(formData); - if (!utils_default.isFunction(visitor)) throw new TypeError("visitor must be a function"); - function convertValue(value) { - if (value === null) return ""; - if (utils_default.isDate(value)) return value.toISOString(); - if (utils_default.isBoolean(value)) return value.toString(); - if (!useBlob && utils_default.isBlob(value)) throw new AxiosError("Blob is not supported. Use a Buffer instead."); - if (utils_default.isArrayBuffer(value) || utils_default.isTypedArray(value)) return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value); - return value; +} +function buildAccessors(obj, header) { + const accessorName = utils_default.toCamelCase(" " + header); + [ + "get", + "set", + "has" + ].forEach((methodName) => { + Object.defineProperty(obj, methodName + accessorName, { + __proto__: null, + value: function(arg1, arg2, arg3) { + return this[methodName].call(this, header, arg1, arg2, arg3); + }, + configurable: true + }); + }); +} +var AxiosHeaders = class { + constructor(headers) { + headers && this.set(headers); } - /** - * Default visitor. - * - * @param {*} value - * @param {String|Number} key + set(header, valueOrRewrite, rewrite) { + const self = this; + function setHeader(_value, _header, _rewrite) { + const lHeader = normalizeHeader(_header); + if (!lHeader) throw new Error("header name must be a non-empty string"); + const key = utils_default.findKey(self, lHeader); + if (!key || self[key] === void 0 || _rewrite === true || _rewrite === void 0 && self[key] !== false) self[key || _header] = normalizeValue(_value); + } + const setHeaders = (headers, _rewrite) => utils_default.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); + if (utils_default.isPlainObject(header) || header instanceof this.constructor) setHeaders(header, valueOrRewrite); + else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) setHeaders(parseHeaders_default(header), valueOrRewrite); + else if (utils_default.isObject(header) && utils_default.isIterable(header)) { + let obj = {}, dest, key; + for (const entry of header) { + if (!utils_default.isArray(entry)) throw TypeError("Object iterator must return a key-value pair"); + obj[key = entry[0]] = (dest = obj[key]) ? utils_default.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1]; + } + setHeaders(obj, valueOrRewrite); + } else header != null && setHeader(valueOrRewrite, header, rewrite); + return this; + } + get(header, parser) { + header = normalizeHeader(header); + if (header) { + const key = utils_default.findKey(this, header); + if (key) { + const value = this[key]; + if (!parser) return value; + if (parser === true) return parseTokens(value); + if (utils_default.isFunction(parser)) return parser.call(this, value, key); + if (utils_default.isRegExp(parser)) return parser.exec(value); + throw new TypeError("parser must be boolean|regexp|function"); + } + } + } + has(header, matcher) { + header = normalizeHeader(header); + if (header) { + const key = utils_default.findKey(this, header); + return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher))); + } + return false; + } + delete(header, matcher) { + const self = this; + let deleted = false; + function deleteHeader(_header) { + _header = normalizeHeader(_header); + if (_header) { + const key = utils_default.findKey(self, _header); + if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { + delete self[key]; + deleted = true; + } + } + } + if (utils_default.isArray(header)) header.forEach(deleteHeader); + else deleteHeader(header); + return deleted; + } + clear(matcher) { + const keys = Object.keys(this); + let i = keys.length; + let deleted = false; + while (i--) { + const key = keys[i]; + if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { + delete this[key]; + deleted = true; + } + } + return deleted; + } + normalize(format) { + const self = this; + const headers = {}; + utils_default.forEach(this, (value, header) => { + const key = utils_default.findKey(headers, header); + if (key) { + self[key] = normalizeValue(value); + delete self[header]; + return; + } + const normalized = format ? formatHeader(header) : String(header).trim(); + if (normalized !== header) delete self[header]; + self[normalized] = normalizeValue(value); + headers[normalized] = true; + }); + return this; + } + concat(...targets) { + return this.constructor.concat(this, ...targets); + } + toJSON(asStrings) { + const obj = Object.create(null); + utils_default.forEach(this, (value, header) => { + value != null && value !== false && (obj[header] = asStrings && utils_default.isArray(value) ? value.join(", ") : value); + }); + return obj; + } + [Symbol.iterator]() { + return Object.entries(this.toJSON())[Symbol.iterator](); + } + toString() { + return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n"); + } + getSetCookie() { + return this.get("set-cookie") || []; + } + get [Symbol.toStringTag]() { + return "AxiosHeaders"; + } + static from(thing) { + return thing instanceof this ? thing : new this(thing); + } + static concat(first, ...targets) { + const computed = new this(first); + targets.forEach((target) => computed.set(target)); + return computed; + } + static accessor(header) { + const accessors = (this[$internals] = this[$internals] = { accessors: {} }).accessors; + const prototype = this.prototype; + function defineAccessor(_header) { + const lHeader = normalizeHeader(_header); + if (!accessors[lHeader]) { + buildAccessors(prototype, _header); + accessors[lHeader] = true; + } + } + utils_default.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); + return this; + } +}; +AxiosHeaders.accessor([ + "Content-Type", + "Content-Length", + "Accept", + "Accept-Encoding", + "User-Agent", + "Authorization" +]); +utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => { + let mapped = key[0].toUpperCase() + key.slice(1); + return { + get: () => value, + set(headerValue) { + this[mapped] = headerValue; + } + }; +}); +utils_default.freezeMethods(AxiosHeaders); +//#endregion +//#region node_modules/axios/lib/core/AxiosError.js +var REDACTED = "[REDACTED ****]"; +function hasOwnOrPrototypeToJSON(source) { + if (utils_default.hasOwnProp(source, "toJSON")) return true; + let prototype = Object.getPrototypeOf(source); + while (prototype && prototype !== Object.prototype) { + if (utils_default.hasOwnProp(prototype, "toJSON")) return true; + prototype = Object.getPrototypeOf(prototype); + } + return false; +} +function redactConfig(config, redactKeys) { + const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase())); + const seen = []; + const visit = (source) => { + if (source === null || typeof source !== "object") return source; + if (utils_default.isBuffer(source)) return source; + if (seen.indexOf(source) !== -1) return void 0; + if (source instanceof AxiosHeaders) source = source.toJSON(); + seen.push(source); + let result; + if (utils_default.isArray(source)) { + result = []; + source.forEach((v, i) => { + const reducedValue = visit(v); + if (!utils_default.isUndefined(reducedValue)) result[i] = reducedValue; + }); + } else { + if (!utils_default.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) { + seen.pop(); + return source; + } + result = Object.create(null); + for (const [key, value] of Object.entries(source)) { + const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value); + if (!utils_default.isUndefined(reducedValue)) result[key] = reducedValue; + } + } + seen.pop(); + return result; + }; + return visit(config); +} +var AxiosError = class AxiosError extends Error { + static from(error, code, config, request, response, customProps) { + const axiosError = new AxiosError(error.message, code || error.code, config, request, response); + axiosError.cause = error; + axiosError.name = error.name; + if (error.status != null && axiosError.status == null) axiosError.status = error.status; + customProps && Object.assign(axiosError, customProps); + return axiosError; + } + /** + * Create an Error with the specified message, config, error code, request and response. + * + * @param {string} message The error message. + * @param {string} [code] The error code (for example, 'ECONNABORTED'). + * @param {Object} [config] The config. + * @param {Object} [request] The request. + * @param {Object} [response] The response. + * + * @returns {Error} The created error. + */ + constructor(message, code, config, request, response) { + super(message); + Object.defineProperty(this, "message", { + __proto__: null, + value: message, + enumerable: true, + writable: true, + configurable: true + }); + this.name = "AxiosError"; + this.isAxiosError = true; + code && (this.code = code); + config && (this.config = config); + request && (this.request = request); + if (response) { + this.response = response; + this.status = response.status; + } + } + toJSON() { + const config = this.config; + const redactKeys = config && utils_default.hasOwnProp(config, "redact") ? config.redact : void 0; + const serializedConfig = utils_default.isArray(redactKeys) && redactKeys.length > 0 ? redactConfig(config, redactKeys) : utils_default.toJSONObject(config); + return { + message: this.message, + name: this.name, + description: this.description, + number: this.number, + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + config: serializedConfig, + code: this.code, + status: this.status + }; + } +}; +AxiosError.ERR_BAD_OPTION_VALUE = "ERR_BAD_OPTION_VALUE"; +AxiosError.ERR_BAD_OPTION = "ERR_BAD_OPTION"; +AxiosError.ECONNABORTED = "ECONNABORTED"; +AxiosError.ETIMEDOUT = "ETIMEDOUT"; +AxiosError.ECONNREFUSED = "ECONNREFUSED"; +AxiosError.ERR_NETWORK = "ERR_NETWORK"; +AxiosError.ERR_FR_TOO_MANY_REDIRECTS = "ERR_FR_TOO_MANY_REDIRECTS"; +AxiosError.ERR_DEPRECATED = "ERR_DEPRECATED"; +AxiosError.ERR_BAD_RESPONSE = "ERR_BAD_RESPONSE"; +AxiosError.ERR_BAD_REQUEST = "ERR_BAD_REQUEST"; +AxiosError.ERR_CANCELED = "ERR_CANCELED"; +AxiosError.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT"; +AxiosError.ERR_INVALID_URL = "ERR_INVALID_URL"; +AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = "ERR_FORM_DATA_DEPTH_EXCEEDED"; +//#endregion +//#region node_modules/axios/lib/helpers/toFormData.js +/** +* Determines if the given thing is a array or js object. +* +* @param {string} thing - The object or array to be visited. +* +* @returns {boolean} +*/ +function isVisitable(thing) { + return utils_default.isPlainObject(thing) || utils_default.isArray(thing); +} +/** +* It removes the brackets from the end of a string +* +* @param {string} key - The key of the parameter. +* +* @returns {string} the key without the brackets. +*/ +function removeBrackets(key) { + return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key; +} +/** +* It takes a path, a key, and a boolean, and returns a string +* +* @param {string} path - The path to the current key. +* @param {string} key - The key of the current object being iterated over. +* @param {string} dots - If true, the key will be rendered with dots instead of brackets. +* +* @returns {string} The path to the current key. +*/ +function renderKey(path, key, dots) { + if (!path) return key; + return path.concat(key).map(function each(token, i) { + token = removeBrackets(token); + return !dots && i ? "[" + token + "]" : token; + }).join(dots ? "." : ""); +} +/** +* If the array is an array and none of its elements are visitable, then it's a flat array. +* +* @param {Array} arr - The array to check +* +* @returns {boolean} +*/ +function isFlatArray(arr) { + return utils_default.isArray(arr) && !arr.some(isVisitable); +} +var predicates = utils_default.toFlatObject(utils_default, {}, null, function filter(prop) { + return /^is[A-Z]/.test(prop); +}); +/** +* Convert a data object to FormData +* +* @param {Object} obj +* @param {?Object} [formData] +* @param {?Object} [options] +* @param {Function} [options.visitor] +* @param {Boolean} [options.metaTokens = true] +* @param {Boolean} [options.dots = false] +* @param {?Boolean} [options.indexes = false] +* +* @returns {Object} +**/ +/** +* It converts an object into a FormData object +* +* @param {Object} obj - The object to convert to form data. +* @param {string} formData - The FormData object to append to. +* @param {Object} options +* +* @returns +*/ +function toFormData(obj, formData, options) { + if (!utils_default.isObject(obj)) throw new TypeError("target must be an object"); + formData = formData || new FormData(); + options = utils_default.toFlatObject(options, { + metaTokens: true, + dots: false, + indexes: false + }, false, function defined(option, source) { + return !utils_default.isUndefined(source[option]); + }); + const metaTokens = options.metaTokens; + const visitor = options.visitor || defaultVisitor; + const dots = options.dots; + const indexes = options.indexes; + const _Blob = options.Blob || typeof Blob !== "undefined" && Blob; + const maxDepth = options.maxDepth === void 0 ? 100 : options.maxDepth; + const useBlob = _Blob && utils_default.isSpecCompliantForm(formData); + if (!utils_default.isFunction(visitor)) throw new TypeError("visitor must be a function"); + function convertValue(value) { + if (value === null) return ""; + if (utils_default.isDate(value)) return value.toISOString(); + if (utils_default.isBoolean(value)) return value.toString(); + if (!useBlob && utils_default.isBlob(value)) throw new AxiosError("Blob is not supported. Use a Buffer instead."); + if (utils_default.isArrayBuffer(value) || utils_default.isTypedArray(value)) return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value); + return value; + } + /** + * Default visitor. + * + * @param {*} value + * @param {String|Number} key * @param {Array} path * @this {FormData} * @@ -7288,12 +7622,13 @@ function toFormData(obj, formData, options) { convertValue, isVisitable }); - function build(value, path) { + function build(value, path, depth = 0) { if (utils_default.isUndefined(value)) return; + if (depth > maxDepth) throw new AxiosError("Object is too deeply nested (" + depth + " levels). Max depth: " + maxDepth, AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED); if (stack.indexOf(value) !== -1) throw Error("Circular reference detected in " + path.join(".")); stack.push(value); utils_default.forEach(value, function each(el, key) { - if ((!(utils_default.isUndefined(el) || el === null) && visitor.call(formData, el, utils_default.isString(key) ? key.trim() : key, path, exposedHelpers)) === true) build(el, path ? path.concat(key) : [key]); + if ((!(utils_default.isUndefined(el) || el === null) && visitor.call(formData, el, utils_default.isString(key) ? key.trim() : key, path, exposedHelpers)) === true) build(el, path ? path.concat(key) : [key], depth + 1); }); stack.pop(); } @@ -7318,10 +7653,9 @@ function encode$1(str) { "(": "%28", ")": "%29", "~": "%7E", - "%20": "+", - "%00": "\0" + "%20": "+" }; - return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { + return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) { return charMap[match]; }); } @@ -7439,511 +7773,264 @@ var InterceptorManager = class { * @returns {void} */ forEach(fn) { - utils_default.forEach(this.handlers, function forEachHandler(h) { - if (h !== null) fn(h); - }); - } -}; -//#endregion -//#region node_modules/axios/lib/defaults/transitional.js -var transitional_default = { - silentJSONParsing: true, - forcedJSONParsing: true, - clarifyTimeoutError: false, - legacyInterceptorReqResOrdering: true -}; -//#endregion -//#region node_modules/axios/lib/platform/browser/index.js -var browser_default = { - isBrowser: true, - classes: { - URLSearchParams: typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams, - FormData: typeof FormData !== "undefined" ? FormData : null, - Blob: typeof Blob !== "undefined" ? Blob : null - }, - protocols: [ - "http", - "https", - "file", - "blob", - "url", - "data" - ] -}; -//#endregion -//#region node_modules/axios/lib/platform/common/utils.js -var utils_exports = /* @__PURE__ */ __exportAll({ - hasBrowserEnv: () => hasBrowserEnv, - hasStandardBrowserEnv: () => hasStandardBrowserEnv, - hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv, - navigator: () => _navigator, - origin: () => origin -}); -var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined"; -var _navigator = typeof navigator === "object" && navigator || void 0; -/** -* Determine if we're running in a standard browser environment -* -* This allows axios to run in a web worker, and react-native. -* Both environments support XMLHttpRequest, but not fully standard globals. -* -* web workers: -* typeof window -> undefined -* typeof document -> undefined -* -* react-native: -* navigator.product -> 'ReactNative' -* nativescript -* navigator.product -> 'NativeScript' or 'NS' -* -* @returns {boolean} -*/ -var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || [ - "ReactNative", - "NativeScript", - "NS" -].indexOf(_navigator.product) < 0); -/** -* Determine if we're running in a standard browser webWorker environment -* -* Although the `isStandardBrowserEnv` method indicates that -* `allows axios to run in a web worker`, the WebWorker will still be -* filtered out due to its judgment standard -* `typeof window !== 'undefined' && typeof document !== 'undefined'`. -* This leads to a problem when axios post `FormData` in webWorker -*/ -var hasStandardBrowserWebWorkerEnv = typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope && typeof self.importScripts === "function"; -var origin = hasBrowserEnv && window.location.href || "http://localhost"; -//#endregion -//#region node_modules/axios/lib/platform/index.js -var platform_default = _objectSpread2(_objectSpread2({}, utils_exports), browser_default); -//#endregion -//#region node_modules/axios/lib/helpers/toURLEncodedForm.js -function toURLEncodedForm(data, options) { - return toFormData(data, new platform_default.classes.URLSearchParams(), _objectSpread2({ visitor: function(value, key, path, helpers) { - if (platform_default.isNode && utils_default.isBuffer(value)) { - this.append(key, value.toString("base64")); - return false; - } - return helpers.defaultVisitor.apply(this, arguments); - } }, options)); -} -//#endregion -//#region node_modules/axios/lib/helpers/formDataToJSON.js -/** -* It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] -* -* @param {string} name - The name of the property to get. -* -* @returns An array of strings. -*/ -function parsePropPath(name) { - return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match) => { - return match[0] === "[]" ? "" : match[1] || match[0]; - }); -} -/** -* Convert an array to an object. -* -* @param {Array} arr - The array to convert to an object. -* -* @returns An object with the same keys and values as the array. -*/ -function arrayToObject(arr) { - const obj = {}; - const keys = Object.keys(arr); - let i; - const len = keys.length; - let key; - for (i = 0; i < len; i++) { - key = keys[i]; - obj[key] = arr[key]; - } - return obj; -} -/** -* It takes a FormData object and returns a JavaScript object -* -* @param {string} formData The FormData object to convert to JSON. -* -* @returns {Object | null} The converted object. -*/ -function formDataToJSON(formData) { - function buildPath(path, value, target, index) { - let name = path[index++]; - if (name === "__proto__") return true; - const isNumericKey = Number.isFinite(+name); - const isLast = index >= path.length; - name = !name && utils_default.isArray(target) ? target.length : name; - if (isLast) { - if (utils_default.hasOwnProp(target, name)) target[name] = [target[name], value]; - else target[name] = value; - return !isNumericKey; - } - if (!target[name] || !utils_default.isObject(target[name])) target[name] = []; - if (buildPath(path, value, target[name], index) && utils_default.isArray(target[name])) target[name] = arrayToObject(target[name]); - return !isNumericKey; - } - if (utils_default.isFormData(formData) && utils_default.isFunction(formData.entries)) { - const obj = {}; - utils_default.forEachEntry(formData, (name, value) => { - buildPath(parsePropPath(name), value, obj, 0); - }); - return obj; - } - return null; -} -//#endregion -//#region node_modules/axios/lib/defaults/index.js -/** -* It takes a string, tries to parse it, and if it fails, it returns the stringified version -* of the input -* -* @param {any} rawValue - The value to be stringified. -* @param {Function} parser - A function that parses a string into a JavaScript object. -* @param {Function} encoder - A function that takes a value and returns a string. -* -* @returns {string} A stringified version of the rawValue. -*/ -function stringifySafely(rawValue, parser, encoder) { - if (utils_default.isString(rawValue)) try { - (parser || JSON.parse)(rawValue); - return utils_default.trim(rawValue); - } catch (e) { - if (e.name !== "SyntaxError") throw e; - } - return (encoder || JSON.stringify)(rawValue); -} -var defaults = { - transitional: transitional_default, - adapter: [ - "xhr", - "http", - "fetch" - ], - transformRequest: [function transformRequest(data, headers) { - const contentType = headers.getContentType() || ""; - const hasJSONContentType = contentType.indexOf("application/json") > -1; - const isObjectPayload = utils_default.isObject(data); - if (isObjectPayload && utils_default.isHTMLForm(data)) data = new FormData(data); - if (utils_default.isFormData(data)) return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; - if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data) || utils_default.isReadableStream(data)) return data; - if (utils_default.isArrayBufferView(data)) return data.buffer; - if (utils_default.isURLSearchParams(data)) { - headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false); - return data.toString(); - } - let isFileList; - if (isObjectPayload) { - if (contentType.indexOf("application/x-www-form-urlencoded") > -1) return toURLEncodedForm(data, this.formSerializer).toString(); - if ((isFileList = utils_default.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) { - const _FormData = this.env && this.env.FormData; - return toFormData(isFileList ? { "files[]": data } : data, _FormData && new _FormData(), this.formSerializer); - } - } - if (isObjectPayload || hasJSONContentType) { - headers.setContentType("application/json", false); - return stringifySafely(data); - } - return data; - }], - transformResponse: [function transformResponse(data) { - const transitional = this.transitional || defaults.transitional; - const forcedJSONParsing = transitional && transitional.forcedJSONParsing; - const JSONRequested = this.responseType === "json"; - if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) return data; - if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) { - const strictJSONParsing = !(transitional && transitional.silentJSONParsing) && JSONRequested; - try { - return JSON.parse(data, this.parseReviver); - } catch (e) { - if (strictJSONParsing) { - if (e.name === "SyntaxError") throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response); - throw e; - } - } - } - return data; - }], - timeout: 0, - xsrfCookieName: "XSRF-TOKEN", - xsrfHeaderName: "X-XSRF-TOKEN", - maxContentLength: -1, - maxBodyLength: -1, - env: { - FormData: platform_default.classes.FormData, - Blob: platform_default.classes.Blob - }, - validateStatus: function validateStatus(status) { - return status >= 200 && status < 300; + utils_default.forEach(this.handlers, function forEachHandler(h) { + if (h !== null) fn(h); + }); + } +}; +//#endregion +//#region node_modules/axios/lib/defaults/transitional.js +var transitional_default = { + silentJSONParsing: true, + forcedJSONParsing: true, + clarifyTimeoutError: false, + legacyInterceptorReqResOrdering: true +}; +//#endregion +//#region node_modules/axios/lib/platform/browser/index.js +var browser_default = { + isBrowser: true, + classes: { + URLSearchParams: typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams, + FormData: typeof FormData !== "undefined" ? FormData : null, + Blob: typeof Blob !== "undefined" ? Blob : null }, - headers: { common: { - Accept: "application/json, text/plain, */*", - "Content-Type": void 0 - } } + protocols: [ + "http", + "https", + "file", + "blob", + "url", + "data" + ] }; -utils_default.forEach([ - "delete", - "get", - "head", - "post", - "put", - "patch" -], (method) => { - defaults.headers[method] = {}; -}); //#endregion -//#region node_modules/axios/lib/helpers/parseHeaders.js -var ignoreDuplicateOf = utils_default.toObjectSet([ - "age", - "authorization", - "content-length", - "content-type", - "etag", - "expires", - "from", - "host", - "if-modified-since", - "if-unmodified-since", - "last-modified", - "location", - "max-forwards", - "proxy-authorization", - "referer", - "retry-after", - "user-agent" -]); +//#region node_modules/axios/lib/platform/common/utils.js +var utils_exports = /* @__PURE__ */ __exportAll({ + hasBrowserEnv: () => hasBrowserEnv, + hasStandardBrowserEnv: () => hasStandardBrowserEnv, + hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv, + navigator: () => _navigator, + origin: () => origin +}); +var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined"; +var _navigator = typeof navigator === "object" && navigator || void 0; /** -* Parse headers into an object +* Determine if we're running in a standard browser environment * -* ``` -* Date: Wed, 27 Aug 2014 08:58:49 GMT -* Content-Type: application/json -* Connection: keep-alive -* Transfer-Encoding: chunked -* ``` +* This allows axios to run in a web worker, and react-native. +* Both environments support XMLHttpRequest, but not fully standard globals. * -* @param {String} rawHeaders Headers needing to be parsed +* web workers: +* typeof window -> undefined +* typeof document -> undefined * -* @returns {Object} Headers parsed into an object +* react-native: +* navigator.product -> 'ReactNative' +* nativescript +* navigator.product -> 'NativeScript' or 'NS' +* +* @returns {boolean} */ -var parseHeaders_default = (rawHeaders) => { - const parsed = {}; - let key; - let val; - let i; - rawHeaders && rawHeaders.split("\n").forEach(function parser(line) { - i = line.indexOf(":"); - key = line.substring(0, i).trim().toLowerCase(); - val = line.substring(i + 1).trim(); - if (!key || parsed[key] && ignoreDuplicateOf[key]) return; - if (key === "set-cookie") if (parsed[key]) parsed[key].push(val); - else parsed[key] = [val]; - else parsed[key] = parsed[key] ? parsed[key] + ", " + val : val; - }); - return parsed; -}; +var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || [ + "ReactNative", + "NativeScript", + "NS" +].indexOf(_navigator.product) < 0); +/** +* Determine if we're running in a standard browser webWorker environment +* +* Although the `isStandardBrowserEnv` method indicates that +* `allows axios to run in a web worker`, the WebWorker will still be +* filtered out due to its judgment standard +* `typeof window !== 'undefined' && typeof document !== 'undefined'`. +* This leads to a problem when axios post `FormData` in webWorker +*/ +var hasStandardBrowserWebWorkerEnv = typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope && typeof self.importScripts === "function"; +var origin = hasBrowserEnv && window.location.href || "http://localhost"; //#endregion -//#region node_modules/axios/lib/core/AxiosHeaders.js -var $internals = Symbol("internals"); -function normalizeHeader(header) { - return header && String(header).trim().toLowerCase(); -} -function normalizeValue(value) { - if (value === false || value == null) return value; - return utils_default.isArray(value) ? value.map(normalizeValue) : String(value).replace(/[\r\n]+$/, ""); -} -function parseTokens(str) { - const tokens = Object.create(null); - const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; - let match; - while (match = tokensRE.exec(str)) tokens[match[1]] = match[2]; - return tokens; -} -var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim()); -function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) { - if (utils_default.isFunction(filter)) return filter.call(this, value, header); - if (isHeaderNameFilter) value = header; - if (!utils_default.isString(value)) return; - if (utils_default.isString(filter)) return value.indexOf(filter) !== -1; - if (utils_default.isRegExp(filter)) return filter.test(value); -} -function formatHeader(header) { - return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => { - return char.toUpperCase() + str; - }); +//#region node_modules/axios/lib/platform/index.js +var platform_default = _objectSpread2(_objectSpread2({}, utils_exports), browser_default); +//#endregion +//#region node_modules/axios/lib/helpers/toURLEncodedForm.js +function toURLEncodedForm(data, options) { + return toFormData(data, new platform_default.classes.URLSearchParams(), _objectSpread2({ visitor: function(value, key, path, helpers) { + if (platform_default.isNode && utils_default.isBuffer(value)) { + this.append(key, value.toString("base64")); + return false; + } + return helpers.defaultVisitor.apply(this, arguments); + } }, options)); } -function buildAccessors(obj, header) { - const accessorName = utils_default.toCamelCase(" " + header); - [ - "get", - "set", - "has" - ].forEach((methodName) => { - Object.defineProperty(obj, methodName + accessorName, { - value: function(arg1, arg2, arg3) { - return this[methodName].call(this, header, arg1, arg2, arg3); - }, - configurable: true - }); +//#endregion +//#region node_modules/axios/lib/helpers/formDataToJSON.js +/** +* It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z'] +* +* @param {string} name - The name of the property to get. +* +* @returns An array of strings. +*/ +function parsePropPath(name) { + return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match) => { + return match[0] === "[]" ? "" : match[1] || match[0]; }); } -var AxiosHeaders = class { - constructor(headers) { - headers && this.set(headers); - } - set(header, valueOrRewrite, rewrite) { - const self = this; - function setHeader(_value, _header, _rewrite) { - const lHeader = normalizeHeader(_header); - if (!lHeader) throw new Error("header name must be a non-empty string"); - const key = utils_default.findKey(self, lHeader); - if (!key || self[key] === void 0 || _rewrite === true || _rewrite === void 0 && self[key] !== false) self[key || _header] = normalizeValue(_value); - } - const setHeaders = (headers, _rewrite) => utils_default.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite)); - if (utils_default.isPlainObject(header) || header instanceof this.constructor) setHeaders(header, valueOrRewrite); - else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) setHeaders(parseHeaders_default(header), valueOrRewrite); - else if (utils_default.isObject(header) && utils_default.isIterable(header)) { - let obj = {}, dest, key; - for (const entry of header) { - if (!utils_default.isArray(entry)) throw TypeError("Object iterator must return a key-value pair"); - obj[key = entry[0]] = (dest = obj[key]) ? utils_default.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1]; - } - setHeaders(obj, valueOrRewrite); - } else header != null && setHeader(valueOrRewrite, header, rewrite); - return this; - } - get(header, parser) { - header = normalizeHeader(header); - if (header) { - const key = utils_default.findKey(this, header); - if (key) { - const value = this[key]; - if (!parser) return value; - if (parser === true) return parseTokens(value); - if (utils_default.isFunction(parser)) return parser.call(this, value, key); - if (utils_default.isRegExp(parser)) return parser.exec(value); - throw new TypeError("parser must be boolean|regexp|function"); - } - } - } - has(header, matcher) { - header = normalizeHeader(header); - if (header) { - const key = utils_default.findKey(this, header); - return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher))); - } - return false; - } - delete(header, matcher) { - const self = this; - let deleted = false; - function deleteHeader(_header) { - _header = normalizeHeader(_header); - if (_header) { - const key = utils_default.findKey(self, _header); - if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) { - delete self[key]; - deleted = true; - } - } - } - if (utils_default.isArray(header)) header.forEach(deleteHeader); - else deleteHeader(header); - return deleted; +/** +* Convert an array to an object. +* +* @param {Array} arr - The array to convert to an object. +* +* @returns An object with the same keys and values as the array. +*/ +function arrayToObject(arr) { + const obj = {}; + const keys = Object.keys(arr); + let i; + const len = keys.length; + let key; + for (i = 0; i < len; i++) { + key = keys[i]; + obj[key] = arr[key]; } - clear(matcher) { - const keys = Object.keys(this); - let i = keys.length; - let deleted = false; - while (i--) { - const key = keys[i]; - if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { - delete this[key]; - deleted = true; - } + return obj; +} +/** +* It takes a FormData object and returns a JavaScript object +* +* @param {string} formData The FormData object to convert to JSON. +* +* @returns {Object | null} The converted object. +*/ +function formDataToJSON(formData) { + function buildPath(path, value, target, index) { + let name = path[index++]; + if (name === "__proto__") return true; + const isNumericKey = Number.isFinite(+name); + const isLast = index >= path.length; + name = !name && utils_default.isArray(target) ? target.length : name; + if (isLast) { + if (utils_default.hasOwnProp(target, name)) target[name] = utils_default.isArray(target[name]) ? target[name].concat(value) : [target[name], value]; + else target[name] = value; + return !isNumericKey; } - return deleted; - } - normalize(format) { - const self = this; - const headers = {}; - utils_default.forEach(this, (value, header) => { - const key = utils_default.findKey(headers, header); - if (key) { - self[key] = normalizeValue(value); - delete self[header]; - return; - } - const normalized = format ? formatHeader(header) : String(header).trim(); - if (normalized !== header) delete self[header]; - self[normalized] = normalizeValue(value); - headers[normalized] = true; - }); - return this; - } - concat(...targets) { - return this.constructor.concat(this, ...targets); + if (!target[name] || !utils_default.isObject(target[name])) target[name] = []; + if (buildPath(path, value, target[name], index) && utils_default.isArray(target[name])) target[name] = arrayToObject(target[name]); + return !isNumericKey; } - toJSON(asStrings) { - const obj = Object.create(null); - utils_default.forEach(this, (value, header) => { - value != null && value !== false && (obj[header] = asStrings && utils_default.isArray(value) ? value.join(", ") : value); + if (utils_default.isFormData(formData) && utils_default.isFunction(formData.entries)) { + const obj = {}; + utils_default.forEachEntry(formData, (name, value) => { + buildPath(parsePropPath(name), value, obj, 0); }); return obj; } - [Symbol.iterator]() { - return Object.entries(this.toJSON())[Symbol.iterator](); - } - toString() { - return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n"); - } - getSetCookie() { - return this.get("set-cookie") || []; - } - get [Symbol.toStringTag]() { - return "AxiosHeaders"; - } - static from(thing) { - return thing instanceof this ? thing : new this(thing); - } - static concat(first, ...targets) { - const computed = new this(first); - targets.forEach((target) => computed.set(target)); - return computed; + return null; +} +//#endregion +//#region node_modules/axios/lib/defaults/index.js +var own = (obj, key) => obj != null && utils_default.hasOwnProp(obj, key) ? obj[key] : void 0; +/** +* It takes a string, tries to parse it, and if it fails, it returns the stringified version +* of the input +* +* @param {any} rawValue - The value to be stringified. +* @param {Function} parser - A function that parses a string into a JavaScript object. +* @param {Function} encoder - A function that takes a value and returns a string. +* +* @returns {string} A stringified version of the rawValue. +*/ +function stringifySafely(rawValue, parser, encoder) { + if (utils_default.isString(rawValue)) try { + (parser || JSON.parse)(rawValue); + return utils_default.trim(rawValue); + } catch (e) { + if (e.name !== "SyntaxError") throw e; } - static accessor(header) { - const accessors = (this[$internals] = this[$internals] = { accessors: {} }).accessors; - const prototype = this.prototype; - function defineAccessor(_header) { - const lHeader = normalizeHeader(_header); - if (!accessors[lHeader]) { - buildAccessors(prototype, _header); - accessors[lHeader] = true; + return (encoder || JSON.stringify)(rawValue); +} +var defaults = { + transitional: transitional_default, + adapter: [ + "xhr", + "http", + "fetch" + ], + transformRequest: [function transformRequest(data, headers) { + const contentType = headers.getContentType() || ""; + const hasJSONContentType = contentType.indexOf("application/json") > -1; + const isObjectPayload = utils_default.isObject(data); + if (isObjectPayload && utils_default.isHTMLForm(data)) data = new FormData(data); + if (utils_default.isFormData(data)) return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data; + if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data) || utils_default.isReadableStream(data)) return data; + if (utils_default.isArrayBufferView(data)) return data.buffer; + if (utils_default.isURLSearchParams(data)) { + headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false); + return data.toString(); + } + let isFileList; + if (isObjectPayload) { + const formSerializer = own(this, "formSerializer"); + if (contentType.indexOf("application/x-www-form-urlencoded") > -1) return toURLEncodedForm(data, formSerializer).toString(); + if ((isFileList = utils_default.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) { + const env = own(this, "env"); + const _FormData = env && env.FormData; + return toFormData(isFileList ? { "files[]": data } : data, _FormData && new _FormData(), formSerializer); } } - utils_default.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header); - return this; - } -}; -AxiosHeaders.accessor([ - "Content-Type", - "Content-Length", - "Accept", - "Accept-Encoding", - "User-Agent", - "Authorization" -]); -utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => { - let mapped = key[0].toUpperCase() + key.slice(1); - return { - get: () => value, - set(headerValue) { - this[mapped] = headerValue; + if (isObjectPayload || hasJSONContentType) { + headers.setContentType("application/json", false); + return stringifySafely(data); } - }; + return data; + }], + transformResponse: [function transformResponse(data) { + const transitional = own(this, "transitional") || defaults.transitional; + const forcedJSONParsing = transitional && transitional.forcedJSONParsing; + const responseType = own(this, "responseType"); + const JSONRequested = responseType === "json"; + if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) return data; + if (data && utils_default.isString(data) && (forcedJSONParsing && !responseType || JSONRequested)) { + const strictJSONParsing = !(transitional && transitional.silentJSONParsing) && JSONRequested; + try { + return JSON.parse(data, own(this, "parseReviver")); + } catch (e) { + if (strictJSONParsing) { + if (e.name === "SyntaxError") throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, own(this, "response")); + throw e; + } + } + } + return data; + }], + timeout: 0, + xsrfCookieName: "XSRF-TOKEN", + xsrfHeaderName: "X-XSRF-TOKEN", + maxContentLength: -1, + maxBodyLength: -1, + env: { + FormData: platform_default.classes.FormData, + Blob: platform_default.classes.Blob + }, + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + }, + headers: { common: { + Accept: "application/json, text/plain, */*", + "Content-Type": void 0 + } } +}; +utils_default.forEach([ + "delete", + "get", + "head", + "post", + "put", + "patch", + "query" +], (method) => { + defaults.headers[method] = {}; }); -utils_default.freezeMethods(AxiosHeaders); //#endregion //#region node_modules/axios/lib/core/transformData.js /** @@ -8002,12 +8089,12 @@ var CanceledError = class extends AxiosError { function settle(resolve, reject, response) { const validateStatus = response.config.validateStatus; if (!response.status || !validateStatus || validateStatus(response.status)) resolve(response); - else reject(new AxiosError("Request failed with status code " + response.status, [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4], response.config, response.request, response)); + else reject(new AxiosError("Request failed with status code " + response.status, response.status >= 400 && response.status < 500 ? AxiosError.ERR_BAD_REQUEST : AxiosError.ERR_BAD_RESPONSE, response.config, response.request, response)); } //#endregion //#region node_modules/axios/lib/helpers/parseProtocol.js function parseProtocol(url) { - const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); + const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url); return match && match[1] || ""; } //#endregion @@ -8088,19 +8175,19 @@ var progressEventReducer = (listener, isDownloadStream, freq = 3) => { let bytesNotified = 0; const _speedometer = speedometer(50, 250); return throttle((e) => { - const loaded = e.loaded; + const rawLoaded = e.loaded; const total = e.lengthComputable ? e.total : void 0; - const progressBytes = loaded - bytesNotified; + const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded; + const progressBytes = Math.max(0, loaded - bytesNotified); const rate = _speedometer(progressBytes); - const inRange = loaded <= total; - bytesNotified = loaded; + bytesNotified = Math.max(bytesNotified, loaded); listener({ loaded, total, progress: total ? loaded / total : void 0, bytes: progressBytes, rate: rate ? rate : void 0, - estimated: rate && total && inRange ? (total - loaded) / rate : void 0, + estimated: rate && total ? (total - loaded) / rate : void 0, event: e, lengthComputable: total != null, [isDownloadStream ? "download" : "upload"]: true @@ -8137,8 +8224,13 @@ var cookies_default = platform_default.hasStandardBrowserEnv ? { }, read(name) { if (typeof document === "undefined") return null; - const match = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)")); - return match ? decodeURIComponent(match[1]) : null; + const cookies = document.cookie.split(";"); + for (let i = 0; i < cookies.length; i++) { + const cookie = cookies[i].replace(/^\s+/, ""); + const eq = cookie.indexOf("="); + if (eq !== -1 && cookie.slice(0, eq) === name) return decodeURIComponent(cookie.slice(eq + 1)); + } + return null; }, remove(name) { this.write(name, "", Date.now() - 864e5, "/"); @@ -8190,7 +8282,7 @@ function combineURLs(baseURL, relativeURL) { */ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) { let isRelativeUrl = !isAbsoluteURL(requestedURL); - if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) return combineURLs(baseURL, requestedURL); + if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) return combineURLs(baseURL, requestedURL); return requestedURL; } //#endregion @@ -8207,7 +8299,14 @@ var headersToObject = (thing) => thing instanceof AxiosHeaders ? _objectSpread2( */ function mergeConfig(config1, config2) { config2 = config2 || {}; - const config = {}; + const config = Object.create(null); + Object.defineProperty(config, "hasOwnProperty", { + __proto__: null, + value: Object.prototype.hasOwnProperty, + enumerable: false, + writable: true, + configurable: true + }); function getMergedValue(target, source, prop, caseless) { if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) return utils_default.merge.call({ caseless }, target, source); else if (utils_default.isPlainObject(source)) return utils_default.merge({}, source); @@ -8226,8 +8325,8 @@ function mergeConfig(config1, config2) { else if (!utils_default.isUndefined(a)) return getMergedValue(void 0, a); } function mergeDirectKeys(a, b, prop) { - if (prop in config2) return getMergedValue(a, b); - else if (prop in config1) return getMergedValue(void 0, a); + if (utils_default.hasOwnProp(config2, prop)) return getMergedValue(a, b); + else if (utils_default.hasOwnProp(config1, prop)) return getMergedValue(void 0, a); } const mergeMap = { url: valueFromConfig2, @@ -8256,6 +8355,7 @@ function mergeConfig(config1, config2) { httpsAgent: defaultToConfig2, cancelToken: defaultToConfig2, socketPath: defaultToConfig2, + allowedSocketPaths: defaultToConfig2, responseEncoding: defaultToConfig2, validateStatus: mergeDirectKeys, headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true) @@ -8263,32 +8363,54 @@ function mergeConfig(config1, config2) { utils_default.forEach(Object.keys(_objectSpread2(_objectSpread2({}, config1), config2)), function computeConfigValue(prop) { if (prop === "__proto__" || prop === "constructor" || prop === "prototype") return; const merge = utils_default.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties; - const configValue = merge(config1[prop], config2[prop], prop); + const configValue = merge(utils_default.hasOwnProp(config1, prop) ? config1[prop] : void 0, utils_default.hasOwnProp(config2, prop) ? config2[prop] : void 0, prop); utils_default.isUndefined(configValue) && merge !== mergeDirectKeys || (config[prop] = configValue); }); return config; } //#endregion //#region node_modules/axios/lib/helpers/resolveConfig.js +var FORM_DATA_CONTENT_HEADERS = ["content-type", "content-length"]; +function setFormDataHeaders(headers, formHeaders, policy) { + if (policy !== "content-only") { + headers.set(formHeaders); + return; + } + Object.entries(formHeaders).forEach(([key, val]) => { + if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) headers.set(key, val); + }); +} +/** +* Encode a UTF-8 string to a Latin-1 byte string for use with btoa(). +* This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern. +* +* @param {string} str The string to encode +* +* @returns {string} UTF-8 bytes as a Latin-1 string +*/ +var encodeUTF8 = (str) => encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) => String.fromCharCode(parseInt(hex, 16))); var resolveConfig_default = (config) => { const newConfig = mergeConfig({}, config); - let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig; + const own = (key) => utils_default.hasOwnProp(newConfig, key) ? newConfig[key] : void 0; + const data = own("data"); + let withXSRFToken = own("withXSRFToken"); + const xsrfHeaderName = own("xsrfHeaderName"); + const xsrfCookieName = own("xsrfCookieName"); + let headers = own("headers"); + const auth = own("auth"); + const baseURL = own("baseURL"); + const allowAbsoluteUrls = own("allowAbsoluteUrls"); + const url = own("url"); newConfig.headers = headers = AxiosHeaders.from(headers); - newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer); - if (auth) headers.set("Authorization", "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))); + newConfig.url = buildURL(buildFullPath(baseURL, url, allowAbsoluteUrls), config.params, config.paramsSerializer); + if (auth) headers.set("Authorization", "Basic " + btoa((auth.username || "") + ":" + (auth.password ? encodeUTF8(auth.password) : ""))); if (utils_default.isFormData(data)) { if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) headers.setContentType(void 0); - else if (utils_default.isFunction(data.getHeaders)) { - const formHeaders = data.getHeaders(); - const allowedHeaders = ["content-type", "content-length"]; - Object.entries(formHeaders).forEach(([key, val]) => { - if (allowedHeaders.includes(key.toLowerCase())) headers.set(key, val); - }); - } + else if (utils_default.isFunction(data.getHeaders)) setFormDataHeaders(headers, data.getHeaders(), own("formDataHeaderPolicy")); } if (platform_default.hasStandardBrowserEnv) { - withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig)); - if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin_default(newConfig.url)) { + if (utils_default.isFunction(withXSRFToken)) withXSRFToken = withXSRFToken(newConfig); + if (withXSRFToken === true || withXSRFToken == null && isURLSameOrigin_default(newConfig.url)) { const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies_default.read(xsrfCookieName); if (xsrfValue) headers.set(xsrfHeaderName, xsrfValue); } @@ -8335,18 +8457,20 @@ var xhr_default = typeof XMLHttpRequest !== "undefined" && function(config) { if ("onloadend" in request) request.onloadend = onloadend; else request.onreadystatechange = function handleLoad() { if (!request || request.readyState !== 4) return; - if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) return; + if (request.status === 0 && !(request.responseURL && request.responseURL.startsWith("file:"))) return; setTimeout(onloadend); }; request.onabort = function handleAbort() { if (!request) return; reject(new AxiosError("Request aborted", AxiosError.ECONNABORTED, config, request)); + done(); request = null; }; request.onerror = function handleError(event) { const err = new AxiosError(event && event.message ? event.message : "Network Error", AxiosError.ERR_NETWORK, config, request); err.event = event || null; reject(err); + done(); request = null; }; request.ontimeout = function handleTimeout() { @@ -8354,6 +8478,7 @@ var xhr_default = typeof XMLHttpRequest !== "undefined" && function(config) { const transitional = _config.transitional || transitional_default; if (_config.timeoutErrorMessage) timeoutErrorMessage = _config.timeoutErrorMessage; reject(new AxiosError(timeoutErrorMessage, transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED, config, request)); + done(); request = null; }; requestData === void 0 && requestHeaders.setContentType(null); @@ -8376,13 +8501,14 @@ var xhr_default = typeof XMLHttpRequest !== "undefined" && function(config) { if (!request) return; reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel); request.abort(); + done(); request = null; }; _config.cancelToken && _config.cancelToken.subscribe(onCanceled); if (_config.signal) _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled); } const protocol = parseProtocol(_config.url); - if (protocol && platform_default.protocols.indexOf(protocol) === -1) { + if (protocol && !platform_default.protocols.includes(protocol)) { reject(new AxiosError("Unsupported protocol " + protocol + ":", AxiosError.ERR_BAD_REQUEST, config)); return; } @@ -8664,14 +8790,76 @@ var trackStream = (stream, chunkSize, onProgress, onFinish) => { }, { highWaterMark: 2 }); }; //#endregion +//#region node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +/** +* Estimate decoded byte length of a data:// URL *without* allocating large buffers. +* - For base64: compute exact decoded size using length and padding; +* handle %XX at the character-count level (no string allocation). +* - For non-base64: use UTF-8 byteLength of the encoded body as a safe upper bound. +* +* @param {string} url +* @returns {number} +*/ +function estimateDataURLDecodedBytes(url) { + if (!url || typeof url !== "string") return 0; + if (!url.startsWith("data:")) return 0; + const comma = url.indexOf(","); + if (comma < 0) return 0; + const meta = url.slice(5, comma); + const body = url.slice(comma + 1); + if (/;base64/i.test(meta)) { + let effectiveLen = body.length; + const len = body.length; + for (let i = 0; i < len; i++) if (body.charCodeAt(i) === 37 && i + 2 < len) { + const a = body.charCodeAt(i + 1); + const b = body.charCodeAt(i + 2); + if ((a >= 48 && a <= 57 || a >= 65 && a <= 70 || a >= 97 && a <= 102) && (b >= 48 && b <= 57 || b >= 65 && b <= 70 || b >= 97 && b <= 102)) { + effectiveLen -= 2; + i += 2; + } + } + let pad = 0; + let idx = len - 1; + const tailIsPct3D = (j) => j >= 2 && body.charCodeAt(j - 2) === 37 && body.charCodeAt(j - 1) === 51 && (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100); + if (idx >= 0) { + if (body.charCodeAt(idx) === 61) { + pad++; + idx--; + } else if (tailIsPct3D(idx)) { + pad++; + idx -= 3; + } + } + if (pad === 1 && idx >= 0) { + if (body.charCodeAt(idx) === 61) pad++; + else if (tailIsPct3D(idx)) pad++; + } + const bytes = Math.floor(effectiveLen / 4) * 3 - (pad || 0); + return bytes > 0 ? bytes : 0; + } + if (typeof Buffer !== "undefined" && typeof Buffer.byteLength === "function") return Buffer.byteLength(body, "utf8"); + let bytes = 0; + for (let i = 0, len = body.length; i < len; i++) { + const c = body.charCodeAt(i); + if (c < 128) bytes += 1; + else if (c < 2048) bytes += 2; + else if (c >= 55296 && c <= 56319 && i + 1 < len) { + const next = body.charCodeAt(i + 1); + if (next >= 56320 && next <= 57343) { + bytes += 4; + i++; + } else bytes += 3; + } else bytes += 3; + } + return bytes; +} +//#endregion +//#region node_modules/axios/lib/env/data.js +var VERSION = "1.16.0"; +//#endregion //#region node_modules/axios/lib/adapters/fetch.js var DEFAULT_CHUNK_SIZE = 64 * 1024; var { isFunction } = utils_default; -var globalFetchAPI = (({ Request, Response }) => ({ - Request, - Response -}))(utils_default.global); -var { ReadableStream: ReadableStream$1, TextEncoder } = utils_default.global; var test = (fn, ...args) => { try { return !!fn(...args); @@ -8680,13 +8868,19 @@ var test = (fn, ...args) => { } }; var factory = (env) => { - env = utils_default.merge.call({ skipUndefined: true }, globalFetchAPI, env); + var _utils$global; + const globalObject = (_utils$global = utils_default.global) !== null && _utils$global !== void 0 ? _utils$global : globalThis; + const { ReadableStream, TextEncoder } = globalObject; + env = utils_default.merge.call({ skipUndefined: true }, { + Request: globalObject.Request, + Response: globalObject.Response + }, env); const { fetch: envFetch, Request, Response } = env; const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === "function"; const isRequestSupported = isFunction(Request); const isResponseSupported = isFunction(Response); if (!isFetchSupported) return false; - const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1); + const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream); const encodeText = isFetchSupported && (typeof TextEncoder === "function" ? ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) : function() { var _ref = _asyncToGenerator(function* (str) { return new Uint8Array(yield new Request(str).arrayBuffer()); @@ -8697,16 +8891,16 @@ var factory = (env) => { }()); const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => { let duplexAccessed = false; - const body = new ReadableStream$1(); - const hasContentType = new Request(platform_default.origin, { - body, + const request = new Request(platform_default.origin, { + body: new ReadableStream(), method: "POST", get duplex() { duplexAccessed = true; return "half"; } - }).headers.has("Content-Type"); - body.cancel(); + }); + const hasContentType = request.headers.has("Content-Type"); + if (request.body != null) request.body.cancel(); return duplexAccessed && !hasContentType; }); const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body)); @@ -8751,7 +8945,9 @@ var factory = (env) => { }(); return function() { var _ref4 = _asyncToGenerator(function* (config) { - let { url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, withCredentials = "same-origin", fetchOptions } = resolveConfig_default(config); + let { url, method, data, signal, cancelToken, timeout, onDownloadProgress, onUploadProgress, responseType, headers, withCredentials = "same-origin", fetchOptions, maxContentLength, maxBodyLength } = resolveConfig_default(config); + const hasMaxContentLength = utils_default.isNumber(maxContentLength) && maxContentLength > -1; + const hasMaxBodyLength = utils_default.isNumber(maxBodyLength) && maxBodyLength > -1; let _fetch = envFetch || fetch; responseType = responseType ? (responseType + "").toLowerCase() : "text"; let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout); @@ -8761,6 +8957,13 @@ var factory = (env) => { }); let requestContentLength; try { + if (hasMaxContentLength && typeof url === "string" && url.startsWith("data:")) { + if (estimateDataURLDecodedBytes(url) > maxContentLength) throw new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, request); + } + if (hasMaxBodyLength && method !== "get" && method !== "head") { + const outboundLength = yield resolveBodyLength(headers, data); + if (typeof outboundLength === "number" && isFinite(outboundLength) && outboundLength > maxBodyLength) throw new AxiosError("Request body larger than maxBodyLength limit", AxiosError.ERR_BAD_REQUEST, config, request); + } if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = yield resolveBodyLength(headers, data)) !== 0) { let _request = new Request(url, { method: "POST", @@ -8776,6 +8979,11 @@ var factory = (env) => { } if (!utils_default.isString(withCredentials)) withCredentials = withCredentials ? "include" : "omit"; const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype; + if (utils_default.isFormData(data)) { + const contentType = headers.getContentType(); + if (contentType && /^multipart\/form-data/i.test(contentType) && !/boundary=/i.test(contentType)) headers.delete("content-type"); + } + headers.set("User-Agent", "axios/" + VERSION, false); const resolvedOptions = _objectSpread2(_objectSpread2({}, fetchOptions), {}, { signal: composedSignal, method: method.toUpperCase(), @@ -8786,8 +8994,12 @@ var factory = (env) => { }); request = isRequestSupported && new Request(url, resolvedOptions); let response = yield isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions); + if (hasMaxContentLength) { + const declaredLength = utils_default.toFiniteNumber(response.headers.get("content-length")); + if (declaredLength != null && declaredLength > maxContentLength) throw new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, request); + } const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response"); - if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) { + if (supportsResponseStream && response.body && (onDownloadProgress || hasMaxContentLength || isStreamResponse && unsubscribe)) { const options = {}; [ "status", @@ -8798,13 +9010,30 @@ var factory = (env) => { }); const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length")); const [onProgress, flush] = onDownloadProgress && progressEventDecorator(responseContentLength, progressEventReducer(asyncDecorator(onDownloadProgress), true)) || []; - response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => { + let bytesRead = 0; + const onChunkProgress = (loadedBytes) => { + if (hasMaxContentLength) { + bytesRead = loadedBytes; + if (bytesRead > maxContentLength) throw new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, request); + } + onProgress && onProgress(loadedBytes); + }; + response = new Response(trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => { flush && flush(); unsubscribe && unsubscribe(); }), options); } responseType = responseType || "text"; let responseData = yield resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config); + if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) { + let materializedSize; + if (responseData != null) { + if (typeof responseData.byteLength === "number") materializedSize = responseData.byteLength; + else if (typeof responseData.size === "number") materializedSize = responseData.size; + else if (typeof responseData === "string") materializedSize = typeof TextEncoder === "function" ? new TextEncoder().encode(responseData).byteLength : responseData.length; + } + if (typeof materializedSize === "number" && materializedSize > maxContentLength) throw new AxiosError("maxContentLength size of " + maxContentLength + " exceeded", AxiosError.ERR_BAD_RESPONSE, config, request); + } !isStreamResponse && unsubscribe && unsubscribe(); return yield new Promise((resolve, reject) => { settle(resolve, reject, { @@ -8818,6 +9047,13 @@ var factory = (env) => { }); } catch (err) { unsubscribe && unsubscribe(); + if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError) { + const canceledError = composedSignal.reason; + canceledError.config = config; + request && (canceledError.request = request); + err !== canceledError && (canceledError.cause = err); + throw canceledError; + } if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) throw Object.assign(new AxiosError("Network Error", AxiosError.ERR_NETWORK, config, request, err && err.response), { cause: err.cause || err }); throw AxiosError.from(err, err && err.code, config, request, err && err.response); } @@ -8865,9 +9101,15 @@ var knownAdapters = { utils_default.forEach(knownAdapters, (fn, value) => { if (fn) { try { - Object.defineProperty(fn, "name", { value }); + Object.defineProperty(fn, "name", { + __proto__: null, + value + }); } catch (e) {} - Object.defineProperty(fn, "adapterName", { value }); + Object.defineProperty(fn, "adapterName", { + __proto__: null, + value + }); } }); /** @@ -8955,14 +9197,24 @@ function dispatchRequest(config) { ].indexOf(config.method) !== -1) config.headers.setContentType("application/x-www-form-urlencoded", false); return adapters_default.getAdapter(config.adapter || defaults.adapter, config)(config).then(function onAdapterResolution(response) { throwIfCancellationRequested(config); - response.data = transformData.call(config, config.transformResponse, response); + config.response = response; + try { + response.data = transformData.call(config, config.transformResponse, response); + } finally { + delete config.response; + } response.headers = AxiosHeaders.from(response.headers); return response; }, function onAdapterRejection(reason) { if (!isCancel(reason)) { throwIfCancellationRequested(config); if (reason && reason.response) { - reason.response.data = transformData.call(config, config.transformResponse, reason.response); + config.response = reason.response; + try { + reason.response.data = transformData.call(config, config.transformResponse, reason.response); + } finally { + delete config.response; + } reason.response.headers = AxiosHeaders.from(reason.response.headers); } } @@ -8970,9 +9222,6 @@ function dispatchRequest(config) { }); } //#endregion -//#region node_modules/axios/lib/env/data.js -var VERSION = "1.14.0"; -//#endregion //#region node_modules/axios/lib/helpers/validator.js var validators$1 = {}; [ @@ -9031,7 +9280,7 @@ function assertOptions(options, schema, allowUnknown) { let i = keys.length; while (i-- > 0) { const opt = keys[i]; - const validator = schema[opt]; + const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : void 0; if (validator) { const value = options[opt]; const result = value === void 0 || validator(value, opt, options); @@ -9080,10 +9329,19 @@ var Axios = class { if (err instanceof Error) { let dummy = {}; Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = /* @__PURE__ */ new Error(); - const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : ""; + const stack = (() => { + if (!dummy.stack) return ""; + const firstNewlineIndex = dummy.stack.indexOf("\n"); + return firstNewlineIndex === -1 ? "" : dummy.stack.slice(firstNewlineIndex + 1); + })(); try { if (!err.stack) err.stack = stack; - else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) err.stack += "\n" + stack; + else if (stack) { + const firstNewlineIndex = stack.indexOf("\n"); + const secondNewlineIndex = firstNewlineIndex === -1 ? -1 : stack.indexOf("\n", firstNewlineIndex + 1); + const stackWithoutTwoTopLines = secondNewlineIndex === -1 ? "" : stack.slice(secondNewlineIndex + 1); + if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) err.stack += "\n" + stack; + } } catch (e) {} } throw err; @@ -9123,6 +9381,7 @@ var Axios = class { "post", "put", "patch", + "query", "common" ], (method) => { delete headers[method]; @@ -9197,7 +9456,8 @@ utils_default.forEach([ utils_default.forEach([ "post", "put", - "patch" + "patch", + "query" ], function forEachMethodWithData(method) { function generateHTTPMethod(isForm) { return function httpMethod(url, data, config) { @@ -9210,7 +9470,7 @@ utils_default.forEach([ }; } Axios.prototype[method] = generateHTTPMethod(); - Axios.prototype[method + "Form"] = generateHTTPMethod(true); + if (method !== "query") Axios.prototype[method + "Form"] = generateHTTPMethod(true); }); //#endregion //#region node_modules/axios/lib/cancel/CancelToken.js diff --git a/web/dist/index.html b/web/dist/index.html index 05648f660..b1670ff73 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -5,7 +5,7 @@ Kube Bind - + diff --git a/web/go.mod b/web/go.mod index 2fd2316c4..17a7322ef 100644 --- a/web/go.mod +++ b/web/go.mod @@ -1,3 +1,3 @@ module github.com/kube-bind/kube-bind/web -go 1.26.0 +go 1.26.2 diff --git a/web/package-lock.json b/web/package-lock.json index 125ab1f6e..dcd8b5994 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -8,7 +8,7 @@ "name": "kube-bind-frontend", "version": "1.0.0", "dependencies": { - "axios": "^1.15.0", + "axios": "^1.15.2", "vue": "^3.5.32", "vue-router": "^5.0.4" }, @@ -87,29 +87,6 @@ "node": ">=6.9.0" } }, - "node_modules/@emnapi/core": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.9.1.tgz", - "integrity": "sha512-mukuNALVsoix/w1BJwFzwXBN/dHeejQtuVzcDsfOEsdpCumXb/E9j8w11h5S54tT1xhifGfbbSm/ICrObRb3KA==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "@emnapi/wasi-threads": "1.2.0", - "tslib": "^2.4.0" - } - }, - "node_modules/@emnapi/runtime": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.1.tgz", - "integrity": "sha512-VYi5+ZVLhpgK4hQ0TAjiQiZ6ol0oe4mBx7mVv7IflsiEp0OWoVsp/+f9Vc1hOhE0TtkORVrI1GvzyreqpgWtkA==", - "dev": true, - "license": "MIT", - "optional": true, - "dependencies": { - "tslib": "^2.4.0" - } - }, "node_modules/@emnapi/wasi-threads": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.0.tgz", @@ -681,6 +658,7 @@ "integrity": "sha512-tO4ZIRKNC+MDWV4qKVZe3Ql/woTnmHDr5JD8UI5hn2pwBrHEwOEMZK7WlNb5RKB6EoJ02gwmQS9OrjuFnZYdpg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "undici-types": "~7.18.0" } @@ -720,6 +698,7 @@ "integrity": "sha512-rLoGZIf9afaRBYsPUMtvkDWykwXwUPL60HebR4JgTI8mxfFe2cQTu3AGitANp4b9B2QlVru6WzjgB2IzJKiCSA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.58.0", "@typescript-eslint/types": "8.58.0", @@ -1178,6 +1157,7 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", "license": "MIT", + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -1258,12 +1238,12 @@ "license": "MIT" }, "node_modules/axios": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.15.0.tgz", - "integrity": "sha512-wWyJDlAatxk30ZJer+GeCWS209sA42X+N5jU2jy6oHTp7ufw8uzUTVFBX9+wTfAlhiJXGS0Bq7X6efruWjuK9Q==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.16.0.tgz", + "integrity": "sha512-6hp5CwvTPlN2A31g5dxnwAX0orzM7pmCRDLnZSX772mv8WDqICwFjowHuPs04Mc8deIld1+ejhtaMn5vp6b+1w==", "license": "MIT", "dependencies": { - "follow-redirects": "^1.15.11", + "follow-redirects": "^1.16.0", "form-data": "^4.0.5", "proxy-from-env": "^2.1.0" } @@ -1534,6 +1514,7 @@ "integrity": "sha512-+L0vBFYGIpSNIt/KWTpFonPrqYvgKw1eUI5Vn7mEogrQcWtWYtNQ7dNqC+px/J0idT3BAkiWrhfS7k+Tum8TUA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.2", @@ -1590,6 +1571,7 @@ "integrity": "sha512-f1J/tcbnrpgC8suPN5AtdJ5MQjuXbSU9pGRSSYAuF3SHoiYCOdEX6O22pLaRyLHXvDcOe+O5ENgc1owQ587agA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "natural-compare": "^1.4.0", @@ -3054,6 +3036,7 @@ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -3114,6 +3097,7 @@ "integrity": "sha512-bGdAIrZ0wiGDo5l8c++HWtbaNCWTS4UTv7RaTH/ThVIgjkveJt83m74bBHMJkuCbslY8ixgLBVZJIOiQlQTjfQ==", "devOptional": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -3236,6 +3220,7 @@ "integrity": "sha512-P1PbweD+2/udplnThz3btF4cf6AgPky7kk23RtHUkJIU5BIxwPprhRGmOAHs6FTI7UiGbTNrgNP6jSYD6JaRnw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "lightningcss": "^1.32.0", "picomatch": "^4.0.4", @@ -3333,6 +3318,7 @@ "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.32.tgz", "integrity": "sha512-vM4z4Q9tTafVfMAK7IVzmxg34rSzTFMyIe0UUEijUCkn9+23lj0WRfA83dg7eQZIUlgOSGrkViIaCfqSAUXsMw==", "license": "MIT", + "peer": true, "dependencies": { "@vue/compiler-dom": "3.5.32", "@vue/compiler-sfc": "3.5.32", diff --git a/web/package.json b/web/package.json index 76c0a003a..7584a5ae9 100644 --- a/web/package.json +++ b/web/package.json @@ -15,7 +15,7 @@ "dependencies": { "vue": "^3.5.32", "vue-router": "^5.0.4", - "axios": "^1.15.0" + "axios": "^1.15.2" }, "devDependencies": { "@types/node": "^25.5.2",