UNPKG

@wix/cli

Version:

CLI tool for building Wix sites and applications

1,731 lines (1,690 loc) 254 kB
import { createRequire as _createRequire } from 'node:module'; const require = _createRequire(import.meta.url); import { init_esm_shims } from "./chunk-4EFJZ3GQ.js"; // ../../node_modules/@sentry/utils/build/esm/version.js init_esm_shims(); var SDK_VERSION = "8.20.0"; // ../../node_modules/@sentry/utils/build/esm/index.js init_esm_shims(); // ../../node_modules/@sentry/utils/build/esm/aggregate-errors.js init_esm_shims(); // ../../node_modules/@sentry/utils/build/esm/is.js init_esm_shims(); var objectToString = Object.prototype.toString; function isError(wat) { switch (objectToString.call(wat)) { case "[object Error]": case "[object Exception]": case "[object DOMException]": return true; default: return isInstanceOf(wat, Error); } } function isBuiltin(wat, className) { return objectToString.call(wat) === `[object ${className}]`; } function isErrorEvent(wat) { return isBuiltin(wat, "ErrorEvent"); } function isDOMError(wat) { return isBuiltin(wat, "DOMError"); } function isDOMException(wat) { return isBuiltin(wat, "DOMException"); } function isString(wat) { return isBuiltin(wat, "String"); } function isParameterizedString(wat) { return typeof wat === "object" && wat !== null && "__sentry_template_string__" in wat && "__sentry_template_values__" in wat; } function isPrimitive(wat) { return wat === null || isParameterizedString(wat) || typeof wat !== "object" && typeof wat !== "function"; } function isPlainObject(wat) { return isBuiltin(wat, "Object"); } function isEvent(wat) { return typeof Event !== "undefined" && isInstanceOf(wat, Event); } function isElement(wat) { return typeof Element !== "undefined" && isInstanceOf(wat, Element); } function isRegExp(wat) { return isBuiltin(wat, "RegExp"); } function isThenable(wat) { return Boolean(wat && wat.then && typeof wat.then === "function"); } function isSyntheticEvent(wat) { return isPlainObject(wat) && "nativeEvent" in wat && "preventDefault" in wat && "stopPropagation" in wat; } function isInstanceOf(wat, base) { try { return wat instanceof base; } catch (_e) { return false; } } function isVueViewModel(wat) { return !!(typeof wat === "object" && wat !== null && (wat.__isVue || wat._isVue)); } // ../../node_modules/@sentry/utils/build/esm/string.js init_esm_shims(); function truncate(str, max = 0) { if (typeof str !== "string" || max === 0) { return str; } return str.length <= max ? str : `${str.slice(0, max)}...`; } function snipLine(line, colno) { let newLine = line; const lineLength = newLine.length; if (lineLength <= 150) { return newLine; } if (colno > lineLength) { colno = lineLength; } let start = Math.max(colno - 60, 0); if (start < 5) { start = 0; } let end = Math.min(start + 140, lineLength); if (end > lineLength - 5) { end = lineLength; } if (end === lineLength) { start = Math.max(end - 140, 0); } newLine = newLine.slice(start, end); if (start > 0) { newLine = `'{snip} ${newLine}`; } if (end < lineLength) { newLine += " {snip}"; } return newLine; } function safeJoin(input, delimiter) { if (!Array.isArray(input)) { return ""; } const output = []; for (let i = 0; i < input.length; i++) { const value = input[i]; try { if (isVueViewModel(value)) { output.push("[VueViewModel]"); } else { output.push(String(value)); } } catch (e) { output.push("[value cannot be serialized]"); } } return output.join(delimiter); } function isMatchingPattern(value, pattern, requireExactStringMatch = false) { if (!isString(value)) { return false; } if (isRegExp(pattern)) { return pattern.test(value); } if (isString(pattern)) { return requireExactStringMatch ? value === pattern : value.includes(pattern); } return false; } function stringMatchesSomePattern(testString, patterns = [], requireExactStringMatch = false) { return patterns.some((pattern) => isMatchingPattern(testString, pattern, requireExactStringMatch)); } // ../../node_modules/@sentry/utils/build/esm/aggregate-errors.js function applyAggregateErrorsToEvent(exceptionFromErrorImplementation, parser, maxValueLimit = 250, key, limit, event, hint) { if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) { return; } const originalException = event.exception.values.length > 0 ? event.exception.values[event.exception.values.length - 1] : void 0; if (originalException) { event.exception.values = truncateAggregateExceptions( aggregateExceptionsFromError( exceptionFromErrorImplementation, parser, limit, hint.originalException, key, event.exception.values, originalException, 0 ), maxValueLimit ); } } function aggregateExceptionsFromError(exceptionFromErrorImplementation, parser, limit, error, key, prevExceptions, exception, exceptionId) { if (prevExceptions.length >= limit + 1) { return prevExceptions; } let newExceptions = [...prevExceptions]; if (isInstanceOf(error[key], Error)) { applyExceptionGroupFieldsForParentException(exception, exceptionId); const newException = exceptionFromErrorImplementation(parser, error[key]); const newExceptionId = newExceptions.length; applyExceptionGroupFieldsForChildException(newException, key, newExceptionId, exceptionId); newExceptions = aggregateExceptionsFromError( exceptionFromErrorImplementation, parser, limit, error[key], key, [newException, ...newExceptions], newException, newExceptionId ); } if (Array.isArray(error.errors)) { error.errors.forEach((childError, i) => { if (isInstanceOf(childError, Error)) { applyExceptionGroupFieldsForParentException(exception, exceptionId); const newException = exceptionFromErrorImplementation(parser, childError); const newExceptionId = newExceptions.length; applyExceptionGroupFieldsForChildException(newException, `errors[${i}]`, newExceptionId, exceptionId); newExceptions = aggregateExceptionsFromError( exceptionFromErrorImplementation, parser, limit, childError, key, [newException, ...newExceptions], newException, newExceptionId ); } }); } return newExceptions; } function applyExceptionGroupFieldsForParentException(exception, exceptionId) { exception.mechanism = exception.mechanism || { type: "generic", handled: true }; exception.mechanism = { ...exception.mechanism, ...exception.type === "AggregateError" && { is_exception_group: true }, exception_id: exceptionId }; } function applyExceptionGroupFieldsForChildException(exception, source, exceptionId, parentId) { exception.mechanism = exception.mechanism || { type: "generic", handled: true }; exception.mechanism = { ...exception.mechanism, type: "chained", source, exception_id: exceptionId, parent_id: parentId }; } function truncateAggregateExceptions(exceptions, maxValueLength) { return exceptions.map((exception) => { if (exception.value) { exception.value = truncate(exception.value, maxValueLength); } return exception; }); } // ../../node_modules/@sentry/utils/build/esm/array.js init_esm_shims(); function flatten(input) { const result = []; const flattenHelper = (input2) => { input2.forEach((el) => { if (Array.isArray(el)) { flattenHelper(el); } else { result.push(el); } }); }; flattenHelper(input); return result; } // ../../node_modules/@sentry/utils/build/esm/browser.js init_esm_shims(); // ../../node_modules/@sentry/utils/build/esm/worldwide.js init_esm_shims(); var GLOBAL_OBJ = globalThis; function getGlobalSingleton(name, creator, obj) { const gbl = obj || GLOBAL_OBJ; const __SENTRY__ = gbl.__SENTRY__ = gbl.__SENTRY__ || {}; const versionedCarrier = __SENTRY__[SDK_VERSION] = __SENTRY__[SDK_VERSION] || {}; return versionedCarrier[name] || (versionedCarrier[name] = creator()); } // ../../node_modules/@sentry/utils/build/esm/browser.js var WINDOW = GLOBAL_OBJ; var DEFAULT_MAX_STRING_LENGTH = 80; function htmlTreeAsString(elem, options = {}) { if (!elem) { return "<unknown>"; } try { let currentElem = elem; const MAX_TRAVERSE_HEIGHT = 5; const out = []; let height = 0; let len = 0; const separator = " > "; const sepLength = separator.length; let nextStr; const keyAttrs = Array.isArray(options) ? options : options.keyAttrs; const maxStringLength = !Array.isArray(options) && options.maxStringLength || DEFAULT_MAX_STRING_LENGTH; while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) { nextStr = _htmlElementAsString(currentElem, keyAttrs); if (nextStr === "html" || height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength) { break; } out.push(nextStr); len += nextStr.length; currentElem = currentElem.parentNode; } return out.reverse().join(separator); } catch (_oO) { return "<unknown>"; } } function _htmlElementAsString(el, keyAttrs) { const elem = el; const out = []; if (!elem || !elem.tagName) { return ""; } if (WINDOW.HTMLElement) { if (elem instanceof HTMLElement && elem.dataset) { if (elem.dataset["sentryComponent"]) { return elem.dataset["sentryComponent"]; } if (elem.dataset["sentryElement"]) { return elem.dataset["sentryElement"]; } } } out.push(elem.tagName.toLowerCase()); const keyAttrPairs = keyAttrs && keyAttrs.length ? keyAttrs.filter((keyAttr) => elem.getAttribute(keyAttr)).map((keyAttr) => [keyAttr, elem.getAttribute(keyAttr)]) : null; if (keyAttrPairs && keyAttrPairs.length) { keyAttrPairs.forEach((keyAttrPair) => { out.push(`[${keyAttrPair[0]}="${keyAttrPair[1]}"]`); }); } else { if (elem.id) { out.push(`#${elem.id}`); } const className = elem.className; if (className && isString(className)) { const classes = className.split(/\s+/); for (const c of classes) { out.push(`.${c}`); } } } const allowedAttrs = ["aria-label", "type", "name", "title", "alt"]; for (const k of allowedAttrs) { const attr = elem.getAttribute(k); if (attr) { out.push(`[${k}="${attr}"]`); } } return out.join(""); } function getLocationHref() { try { return WINDOW.document.location.href; } catch (oO) { return ""; } } function getDomElement(selector) { if (WINDOW.document && WINDOW.document.querySelector) { return WINDOW.document.querySelector(selector); } return null; } function getComponentName(elem) { if (!WINDOW.HTMLElement) { return null; } let currentElem = elem; const MAX_TRAVERSE_HEIGHT = 5; for (let i = 0; i < MAX_TRAVERSE_HEIGHT; i++) { if (!currentElem) { return null; } if (currentElem instanceof HTMLElement) { if (currentElem.dataset["sentryComponent"]) { return currentElem.dataset["sentryComponent"]; } if (currentElem.dataset["sentryElement"]) { return currentElem.dataset["sentryElement"]; } } currentElem = currentElem.parentNode; } return null; } // ../../node_modules/@sentry/utils/build/esm/dsn.js init_esm_shims(); // ../../node_modules/@sentry/utils/build/esm/debug-build.js init_esm_shims(); var DEBUG_BUILD = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__; // ../../node_modules/@sentry/utils/build/esm/logger.js init_esm_shims(); var PREFIX = "Sentry Logger "; var CONSOLE_LEVELS = [ "debug", "info", "warn", "error", "log", "assert", "trace" ]; var originalConsoleMethods = {}; function consoleSandbox(callback) { if (!("console" in GLOBAL_OBJ)) { return callback(); } const console2 = GLOBAL_OBJ.console; const wrappedFuncs = {}; const wrappedLevels = Object.keys(originalConsoleMethods); wrappedLevels.forEach((level) => { const originalConsoleMethod = originalConsoleMethods[level]; wrappedFuncs[level] = console2[level]; console2[level] = originalConsoleMethod; }); try { return callback(); } finally { wrappedLevels.forEach((level) => { console2[level] = wrappedFuncs[level]; }); } } function makeLogger() { let enabled = false; const logger2 = { enable: () => { enabled = true; }, disable: () => { enabled = false; }, isEnabled: () => enabled }; if (DEBUG_BUILD) { CONSOLE_LEVELS.forEach((name) => { logger2[name] = (...args) => { if (enabled) { consoleSandbox(() => { GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args); }); } }; }); } else { CONSOLE_LEVELS.forEach((name) => { logger2[name] = () => void 0; }); } return logger2; } var logger = makeLogger(); // ../../node_modules/@sentry/utils/build/esm/dsn.js var DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/; function isValidProtocol(protocol) { return protocol === "http" || protocol === "https"; } function dsnToString(dsn, withPassword = false) { const { host, path, pass, port, projectId, protocol, publicKey } = dsn; return `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ""}@${host}${port ? `:${port}` : ""}/${path ? `${path}/` : path}${projectId}`; } function dsnFromString(str) { const match = DSN_REGEX.exec(str); if (!match) { consoleSandbox(() => { console.error(`Invalid Sentry Dsn: ${str}`); }); return void 0; } const [protocol, publicKey, pass = "", host = "", port = "", lastPath = ""] = match.slice(1); let path = ""; let projectId = lastPath; const split = projectId.split("/"); if (split.length > 1) { path = split.slice(0, -1).join("/"); projectId = split.pop(); } if (projectId) { const projectMatch = projectId.match(/^\d+/); if (projectMatch) { projectId = projectMatch[0]; } } return dsnFromComponents({ host, pass, path, projectId, port, protocol, publicKey }); } function dsnFromComponents(components) { return { protocol: components.protocol, publicKey: components.publicKey || "", pass: components.pass || "", host: components.host, port: components.port || "", path: components.path || "", projectId: components.projectId }; } function validateDsn(dsn) { if (!DEBUG_BUILD) { return true; } const { port, projectId, protocol } = dsn; const requiredComponents = ["protocol", "publicKey", "host", "projectId"]; const hasMissingRequiredComponent = requiredComponents.find((component) => { if (!dsn[component]) { logger.error(`Invalid Sentry Dsn: ${component} missing`); return true; } return false; }); if (hasMissingRequiredComponent) { return false; } if (!projectId.match(/^\d+$/)) { logger.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`); return false; } if (!isValidProtocol(protocol)) { logger.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`); return false; } if (port && isNaN(parseInt(port, 10))) { logger.error(`Invalid Sentry Dsn: Invalid port ${port}`); return false; } return true; } function makeDsn(from) { const components = typeof from === "string" ? dsnFromString(from) : dsnFromComponents(from); if (!components || !validateDsn(components)) { return void 0; } return components; } // ../../node_modules/@sentry/utils/build/esm/error.js init_esm_shims(); var SentryError = class extends Error { /** Display name of this error instance. */ constructor(message, logLevel = "warn") { super(message); this.message = message; this.name = new.target.prototype.constructor.name; Object.setPrototypeOf(this, new.target.prototype); this.logLevel = logLevel; } }; // ../../node_modules/@sentry/utils/build/esm/instrument/console.js init_esm_shims(); // ../../node_modules/@sentry/utils/build/esm/object.js init_esm_shims(); function fill(source, name, replacementFactory) { if (!(name in source)) { return; } const original = source[name]; const wrapped = replacementFactory(original); if (typeof wrapped === "function") { markFunctionWrapped(wrapped, original); } source[name] = wrapped; } function addNonEnumerableProperty(obj, name, value) { try { Object.defineProperty(obj, name, { // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it value, writable: true, configurable: true }); } catch (o_O) { DEBUG_BUILD && logger.log(`Failed to add non-enumerable property "${name}" to object`, obj); } } function markFunctionWrapped(wrapped, original) { try { const proto = original.prototype || {}; wrapped.prototype = original.prototype = proto; addNonEnumerableProperty(wrapped, "__sentry_original__", original); } catch (o_O) { } } function getOriginalFunction(func) { return func.__sentry_original__; } function urlEncode(object) { return Object.keys(object).map((key) => `${encodeURIComponent(key)}=${encodeURIComponent(object[key])}`).join("&"); } function convertToPlainObject(value) { if (isError(value)) { return { message: value.message, name: value.name, stack: value.stack, ...getOwnProperties(value) }; } else if (isEvent(value)) { const newObj = { type: value.type, target: serializeEventTarget(value.target), currentTarget: serializeEventTarget(value.currentTarget), ...getOwnProperties(value) }; if (typeof CustomEvent !== "undefined" && isInstanceOf(value, CustomEvent)) { newObj.detail = value.detail; } return newObj; } else { return value; } } function serializeEventTarget(target) { try { return isElement(target) ? htmlTreeAsString(target) : Object.prototype.toString.call(target); } catch (_oO) { return "<unknown>"; } } function getOwnProperties(obj) { if (typeof obj === "object" && obj !== null) { const extractedProps = {}; for (const property in obj) { if (Object.prototype.hasOwnProperty.call(obj, property)) { extractedProps[property] = obj[property]; } } return extractedProps; } else { return {}; } } function extractExceptionKeysForMessage(exception, maxLength = 40) { const keys = Object.keys(convertToPlainObject(exception)); keys.sort(); const firstKey = keys[0]; if (!firstKey) { return "[object has no keys]"; } if (firstKey.length >= maxLength) { return truncate(firstKey, maxLength); } for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) { const serialized = keys.slice(0, includedKeys).join(", "); if (serialized.length > maxLength) { continue; } if (includedKeys === keys.length) { return serialized; } return truncate(serialized, maxLength); } return ""; } function dropUndefinedKeys(inputValue) { const memoizationMap = /* @__PURE__ */ new Map(); return _dropUndefinedKeys(inputValue, memoizationMap); } function _dropUndefinedKeys(inputValue, memoizationMap) { if (isPojo(inputValue)) { const memoVal = memoizationMap.get(inputValue); if (memoVal !== void 0) { return memoVal; } const returnValue = {}; memoizationMap.set(inputValue, returnValue); for (const key of Object.keys(inputValue)) { if (typeof inputValue[key] !== "undefined") { returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap); } } return returnValue; } if (Array.isArray(inputValue)) { const memoVal = memoizationMap.get(inputValue); if (memoVal !== void 0) { return memoVal; } const returnValue = []; memoizationMap.set(inputValue, returnValue); inputValue.forEach((item) => { returnValue.push(_dropUndefinedKeys(item, memoizationMap)); }); return returnValue; } return inputValue; } function isPojo(input) { if (!isPlainObject(input)) { return false; } try { const name = Object.getPrototypeOf(input).constructor.name; return !name || name === "Object"; } catch (e) { return true; } } // ../../node_modules/@sentry/utils/build/esm/instrument/handlers.js init_esm_shims(); // ../../node_modules/@sentry/utils/build/esm/stacktrace.js init_esm_shims(); var STACKTRACE_FRAME_LIMIT = 50; var UNKNOWN_FUNCTION = "?"; var WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/; var STRIP_FRAME_REGEXP = /captureMessage|captureException/; function createStackParser(...parsers) { const sortedParsers = parsers.sort((a, b) => a[0] - b[0]).map((p) => p[1]); return (stack, skipFirstLines = 0, framesToPop = 0) => { const frames = []; const lines = stack.split("\n"); for (let i = skipFirstLines; i < lines.length; i++) { const line = lines[i]; if (line.length > 1024) { continue; } const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) ? line.replace(WEBPACK_ERROR_REGEXP, "$1") : line; if (cleanedLine.match(/\S*Error: /)) { continue; } for (const parser of sortedParsers) { const frame = parser(cleanedLine); if (frame) { frames.push(frame); break; } } if (frames.length >= STACKTRACE_FRAME_LIMIT + framesToPop) { break; } } return stripSentryFramesAndReverse(frames.slice(framesToPop)); }; } function stackParserFromStackParserOptions(stackParser) { if (Array.isArray(stackParser)) { return createStackParser(...stackParser); } return stackParser; } function stripSentryFramesAndReverse(stack) { if (!stack.length) { return []; } const localStack = Array.from(stack); if (/sentryWrapped/.test(getLastStackFrame(localStack).function || "")) { localStack.pop(); } localStack.reverse(); if (STRIP_FRAME_REGEXP.test(getLastStackFrame(localStack).function || "")) { localStack.pop(); if (STRIP_FRAME_REGEXP.test(getLastStackFrame(localStack).function || "")) { localStack.pop(); } } return localStack.slice(0, STACKTRACE_FRAME_LIMIT).map((frame) => ({ ...frame, filename: frame.filename || getLastStackFrame(localStack).filename, function: frame.function || UNKNOWN_FUNCTION })); } function getLastStackFrame(arr) { return arr[arr.length - 1] || {}; } var defaultFunctionName = "<anonymous>"; function getFunctionName(fn) { try { if (!fn || typeof fn !== "function") { return defaultFunctionName; } return fn.name || defaultFunctionName; } catch (e) { return defaultFunctionName; } } function getFramesFromEvent(event) { const exception = event.exception; if (exception) { const frames = []; try { exception.values.forEach((value) => { if (value.stacktrace.frames) { frames.push(...value.stacktrace.frames); } }); return frames; } catch (_oO) { return void 0; } } return void 0; } // ../../node_modules/@sentry/utils/build/esm/instrument/handlers.js var handlers = {}; var instrumented = {}; function addHandler(type, handler) { handlers[type] = handlers[type] || []; handlers[type].push(handler); } function maybeInstrument(type, instrumentFn) { if (!instrumented[type]) { instrumentFn(); instrumented[type] = true; } } function triggerHandlers(type, data) { const typeHandlers = type && handlers[type]; if (!typeHandlers) { return; } for (const handler of typeHandlers) { try { handler(data); } catch (e) { DEBUG_BUILD && logger.error( `Error while triggering instrumentation handler. Type: ${type} Name: ${getFunctionName(handler)} Error:`, e ); } } } // ../../node_modules/@sentry/utils/build/esm/instrument/console.js function addConsoleInstrumentationHandler(handler) { const type = "console"; addHandler(type, handler); maybeInstrument(type, instrumentConsole); } function instrumentConsole() { if (!("console" in GLOBAL_OBJ)) { return; } CONSOLE_LEVELS.forEach(function(level) { if (!(level in GLOBAL_OBJ.console)) { return; } fill(GLOBAL_OBJ.console, level, function(originalConsoleMethod) { originalConsoleMethods[level] = originalConsoleMethod; return function(...args) { const handlerData = { args, level }; triggerHandlers("console", handlerData); const log = originalConsoleMethods[level]; log && log.apply(GLOBAL_OBJ.console, args); }; }); }); } // ../../node_modules/@sentry/utils/build/esm/instrument/fetch.js init_esm_shims(); // ../../node_modules/@sentry/utils/build/esm/supports.js init_esm_shims(); var WINDOW2 = GLOBAL_OBJ; function supportsFetch() { if (!("fetch" in WINDOW2)) { return false; } try { new Headers(); new Request("http://www.example.com"); new Response(); return true; } catch (e) { return false; } } function isNativeFunction(func) { return func && /^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(func.toString()); } function supportsNativeFetch() { if (typeof EdgeRuntime === "string") { return true; } if (!supportsFetch()) { return false; } if (isNativeFunction(WINDOW2.fetch)) { return true; } let result = false; const doc = WINDOW2.document; if (doc && typeof doc.createElement === "function") { try { const sandbox = doc.createElement("iframe"); sandbox.hidden = true; doc.head.appendChild(sandbox); if (sandbox.contentWindow && sandbox.contentWindow.fetch) { result = isNativeFunction(sandbox.contentWindow.fetch); } doc.head.removeChild(sandbox); } catch (err) { DEBUG_BUILD && logger.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ", err); } } return result; } function supportsReportingObserver() { return "ReportingObserver" in WINDOW2; } // ../../node_modules/@sentry/utils/build/esm/time.js init_esm_shims(); var ONE_SECOND_IN_MS = 1e3; function dateTimestampInSeconds() { return Date.now() / ONE_SECOND_IN_MS; } function createUnixTimestampInSecondsFunc() { const { performance } = GLOBAL_OBJ; if (!performance || !performance.now) { return dateTimestampInSeconds; } const approxStartingTimeOrigin = Date.now() - performance.now(); const timeOrigin = performance.timeOrigin == void 0 ? approxStartingTimeOrigin : performance.timeOrigin; return () => { return (timeOrigin + performance.now()) / ONE_SECOND_IN_MS; }; } var timestampInSeconds = createUnixTimestampInSecondsFunc(); var _browserPerformanceTimeOriginMode; var browserPerformanceTimeOrigin = (() => { const { performance } = GLOBAL_OBJ; if (!performance || !performance.now) { _browserPerformanceTimeOriginMode = "none"; return void 0; } const threshold = 3600 * 1e3; const performanceNow = performance.now(); const dateNow = Date.now(); const timeOriginDelta = performance.timeOrigin ? Math.abs(performance.timeOrigin + performanceNow - dateNow) : threshold; const timeOriginIsReliable = timeOriginDelta < threshold; const navigationStart = performance.timing && performance.timing.navigationStart; const hasNavigationStart = typeof navigationStart === "number"; const navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold; const navigationStartIsReliable = navigationStartDelta < threshold; if (timeOriginIsReliable || navigationStartIsReliable) { if (timeOriginDelta <= navigationStartDelta) { _browserPerformanceTimeOriginMode = "timeOrigin"; return performance.timeOrigin; } else { _browserPerformanceTimeOriginMode = "navigationStart"; return navigationStart; } } _browserPerformanceTimeOriginMode = "dateNow"; return dateNow; })(); // ../../node_modules/@sentry/utils/build/esm/instrument/fetch.js function addFetchInstrumentationHandler(handler) { const type = "fetch"; addHandler(type, handler); maybeInstrument(type, instrumentFetch); } function instrumentFetch() { if (!supportsNativeFetch()) { return; } fill(GLOBAL_OBJ, "fetch", function(originalFetch) { return function(...args) { const { method, url } = parseFetchArgs(args); const handlerData = { args, fetchData: { method, url }, startTimestamp: timestampInSeconds() * 1e3 }; triggerHandlers("fetch", { ...handlerData }); const virtualStackTrace = new Error().stack; return originalFetch.apply(GLOBAL_OBJ, args).then( (response) => { const finishedHandlerData = { ...handlerData, endTimestamp: timestampInSeconds() * 1e3, response }; triggerHandlers("fetch", finishedHandlerData); return response; }, (error) => { const erroredHandlerData = { ...handlerData, endTimestamp: timestampInSeconds() * 1e3, error }; triggerHandlers("fetch", erroredHandlerData); if (isError(error) && error.stack === void 0) { error.stack = virtualStackTrace; addNonEnumerableProperty(error, "framesToPop", 1); } throw error; } ); }; }); } function hasProp(obj, prop) { return !!obj && typeof obj === "object" && !!obj[prop]; } function getUrlFromResource(resource) { if (typeof resource === "string") { return resource; } if (!resource) { return ""; } if (hasProp(resource, "url")) { return resource.url; } if (resource.toString) { return resource.toString(); } return ""; } function parseFetchArgs(fetchArgs) { if (fetchArgs.length === 0) { return { method: "GET", url: "" }; } if (fetchArgs.length === 2) { const [url, options] = fetchArgs; return { url: getUrlFromResource(url), method: hasProp(options, "method") ? String(options.method).toUpperCase() : "GET" }; } const arg = fetchArgs[0]; return { url: getUrlFromResource(arg), method: hasProp(arg, "method") ? String(arg.method).toUpperCase() : "GET" }; } // ../../node_modules/@sentry/utils/build/esm/instrument/globalError.js init_esm_shims(); var _oldOnErrorHandler = null; function addGlobalErrorInstrumentationHandler(handler) { const type = "error"; addHandler(type, handler); maybeInstrument(type, instrumentError); } function instrumentError() { _oldOnErrorHandler = GLOBAL_OBJ.onerror; GLOBAL_OBJ.onerror = function(msg, url, line, column, error) { const handlerData = { column, error, line, msg, url }; triggerHandlers("error", handlerData); if (_oldOnErrorHandler && !_oldOnErrorHandler.__SENTRY_LOADER__) { return _oldOnErrorHandler.apply(this, arguments); } return false; }; GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__ = true; } // ../../node_modules/@sentry/utils/build/esm/instrument/globalUnhandledRejection.js init_esm_shims(); var _oldOnUnhandledRejectionHandler = null; function addGlobalUnhandledRejectionInstrumentationHandler(handler) { const type = "unhandledrejection"; addHandler(type, handler); maybeInstrument(type, instrumentUnhandledRejection); } function instrumentUnhandledRejection() { _oldOnUnhandledRejectionHandler = GLOBAL_OBJ.onunhandledrejection; GLOBAL_OBJ.onunhandledrejection = function(e) { const handlerData = e; triggerHandlers("unhandledrejection", handlerData); if (_oldOnUnhandledRejectionHandler && !_oldOnUnhandledRejectionHandler.__SENTRY_LOADER__) { return _oldOnUnhandledRejectionHandler.apply(this, arguments); } return true; }; GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true; } // ../../node_modules/@sentry/utils/build/esm/isBrowser.js init_esm_shims(); // ../../node_modules/@sentry/utils/build/esm/node.js init_esm_shims(); // ../../node_modules/@sentry/utils/build/esm/env.js init_esm_shims(); function isBrowserBundle() { return typeof __SENTRY_BROWSER_BUNDLE__ !== "undefined" && !!__SENTRY_BROWSER_BUNDLE__; } function getSDKSource() { return "npm"; } // ../../node_modules/@sentry/utils/build/esm/node.js function isNodeEnv() { return !isBrowserBundle() && Object.prototype.toString.call(typeof process !== "undefined" ? process : 0) === "[object process]"; } // ../../node_modules/@sentry/utils/build/esm/isBrowser.js function isBrowser() { return typeof window !== "undefined" && (!isNodeEnv() || isElectronNodeRenderer()); } function isElectronNodeRenderer() { return ( // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any GLOBAL_OBJ.process !== void 0 && GLOBAL_OBJ.process.type === "renderer" ); } // ../../node_modules/@sentry/utils/build/esm/memo.js init_esm_shims(); function memoBuilder() { const hasWeakSet = typeof WeakSet === "function"; const inner = hasWeakSet ? /* @__PURE__ */ new WeakSet() : []; function memoize(obj) { if (hasWeakSet) { if (inner.has(obj)) { return true; } inner.add(obj); return false; } for (let i = 0; i < inner.length; i++) { const value = inner[i]; if (value === obj) { return true; } } inner.push(obj); return false; } function unmemoize(obj) { if (hasWeakSet) { inner.delete(obj); } else { for (let i = 0; i < inner.length; i++) { if (inner[i] === obj) { inner.splice(i, 1); break; } } } } return [memoize, unmemoize]; } // ../../node_modules/@sentry/utils/build/esm/misc.js init_esm_shims(); function uuid4() { const gbl = GLOBAL_OBJ; const crypto = gbl.crypto || gbl.msCrypto; let getRandomByte = () => Math.random() * 16; try { if (crypto && crypto.randomUUID) { return crypto.randomUUID().replace(/-/g, ""); } if (crypto && crypto.getRandomValues) { getRandomByte = () => { const typedArray = new Uint8Array(1); crypto.getRandomValues(typedArray); return typedArray[0]; }; } } catch (_) { } return ("10000000100040008000" + 1e11).replace( /[018]/g, (c) => ( // eslint-disable-next-line no-bitwise (c ^ (getRandomByte() & 15) >> c / 4).toString(16) ) ); } function getFirstException(event) { return event.exception && event.exception.values ? event.exception.values[0] : void 0; } function getEventDescription(event) { const { message, event_id: eventId } = event; if (message) { return message; } const firstException = getFirstException(event); if (firstException) { if (firstException.type && firstException.value) { return `${firstException.type}: ${firstException.value}`; } return firstException.type || firstException.value || eventId || "<unknown>"; } return eventId || "<unknown>"; } function addExceptionTypeValue(event, value, type) { const exception = event.exception = event.exception || {}; const values = exception.values = exception.values || []; const firstException = values[0] = values[0] || {}; if (!firstException.value) { firstException.value = value || ""; } if (!firstException.type) { firstException.type = type || "Error"; } } function addExceptionMechanism(event, newMechanism) { const firstException = getFirstException(event); if (!firstException) { return; } const defaultMechanism = { type: "generic", handled: true }; const currentMechanism = firstException.mechanism; firstException.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism }; if (newMechanism && "data" in newMechanism) { const mergedData = { ...currentMechanism && currentMechanism.data, ...newMechanism.data }; firstException.mechanism.data = mergedData; } } var SEMVER_REGEXP = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/; function _parseInt(input) { return parseInt(input || "", 10); } function parseSemver(input) { const match = input.match(SEMVER_REGEXP) || []; const major = _parseInt(match[1]); const minor = _parseInt(match[2]); const patch = _parseInt(match[3]); return { buildmetadata: match[5], major: isNaN(major) ? void 0 : major, minor: isNaN(minor) ? void 0 : minor, patch: isNaN(patch) ? void 0 : patch, prerelease: match[4] }; } function addContextToFrame(lines, frame, linesOfContext = 5) { if (frame.lineno === void 0) { return; } const maxLines = lines.length; const sourceLine = Math.max(Math.min(maxLines - 1, frame.lineno - 1), 0); frame.pre_context = lines.slice(Math.max(0, sourceLine - linesOfContext), sourceLine).map((line) => snipLine(line, 0)); const lineIndex = Math.min(maxLines - 1, sourceLine); frame.context_line = snipLine(lines[lineIndex], frame.colno || 0); frame.post_context = lines.slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext).map((line) => snipLine(line, 0)); } function checkOrSetAlreadyCaught(exception) { if (exception && exception.__sentry_captured__) { return true; } try { addNonEnumerableProperty(exception, "__sentry_captured__", true); } catch (err) { } return false; } function arrayify(maybeArray) { return Array.isArray(maybeArray) ? maybeArray : [maybeArray]; } // ../../node_modules/@sentry/utils/build/esm/normalize.js init_esm_shims(); function normalize(input, depth = 100, maxProperties = Infinity) { try { return visit("", input, depth, maxProperties); } catch (err) { return { ERROR: `**non-serializable** (${err})` }; } } function normalizeToSize(object, depth = 3, maxSize = 100 * 1024) { const normalized = normalize(object, depth); if (jsonSize(normalized) > maxSize) { return normalizeToSize(object, depth - 1, maxSize); } return normalized; } function visit(key, value, depth = Infinity, maxProperties = Infinity, memo = memoBuilder()) { const [memoize, unmemoize] = memo; if (value == null || // this matches null and undefined -> eqeq not eqeqeq ["number", "boolean", "string"].includes(typeof value) && !Number.isNaN(value)) { return value; } const stringified = stringifyValue(key, value); if (!stringified.startsWith("[object ")) { return stringified; } if (value["__sentry_skip_normalization__"]) { return value; } const remainingDepth = typeof value["__sentry_override_normalization_depth__"] === "number" ? value["__sentry_override_normalization_depth__"] : depth; if (remainingDepth === 0) { return stringified.replace("object ", ""); } if (memoize(value)) { return "[Circular ~]"; } const valueWithToJSON = value; if (valueWithToJSON && typeof valueWithToJSON.toJSON === "function") { try { const jsonValue = valueWithToJSON.toJSON(); return visit("", jsonValue, remainingDepth - 1, maxProperties, memo); } catch (err) { } } const normalized = Array.isArray(value) ? [] : {}; let numAdded = 0; const visitable = convertToPlainObject(value); for (const visitKey in visitable) { if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) { continue; } if (numAdded >= maxProperties) { normalized[visitKey] = "[MaxProperties ~]"; break; } const visitValue = visitable[visitKey]; normalized[visitKey] = visit(visitKey, visitValue, remainingDepth - 1, maxProperties, memo); numAdded++; } unmemoize(value); return normalized; } function stringifyValue(key, value) { try { if (key === "domain" && value && typeof value === "object" && value._events) { return "[Domain]"; } if (key === "domainEmitter") { return "[DomainEmitter]"; } if (typeof global !== "undefined" && value === global) { return "[Global]"; } if (typeof window !== "undefined" && value === window) { return "[Window]"; } if (typeof document !== "undefined" && value === document) { return "[Document]"; } if (isVueViewModel(value)) { return "[VueViewModel]"; } if (isSyntheticEvent(value)) { return "[SyntheticEvent]"; } if (typeof value === "number" && value !== value) { return "[NaN]"; } if (typeof value === "function") { return `[Function: ${getFunctionName(value)}]`; } if (typeof value === "symbol") { return `[${String(value)}]`; } if (typeof value === "bigint") { return `[BigInt: ${String(value)}]`; } const objName = getConstructorName(value); if (/^HTML(\w*)Element$/.test(objName)) { return `[HTMLElement: ${objName}]`; } return `[object ${objName}]`; } catch (err) { return `**non-serializable** (${err})`; } } function getConstructorName(value) { const prototype = Object.getPrototypeOf(value); return prototype ? prototype.constructor.name : "null prototype"; } function utf8Length(value) { return ~-encodeURI(value).split(/%..|./).length; } function jsonSize(value) { return utf8Length(JSON.stringify(value)); } // ../../node_modules/@sentry/utils/build/esm/path.js init_esm_shims(); function normalizeArray(parts, allowAboveRoot) { let up = 0; for (let i = parts.length - 1; i >= 0; i--) { const last = parts[i]; if (last === ".") { parts.splice(i, 1); } else if (last === "..") { parts.splice(i, 1); up++; } else if (up) { parts.splice(i, 1); up--; } } if (allowAboveRoot) { for (; up--; up) { parts.unshift(".."); } } return parts; } var splitPathRe = /^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/; function splitPath(filename) { const truncated = filename.length > 1024 ? `<truncated>${filename.slice(-1024)}` : filename; const parts = splitPathRe.exec(truncated); return parts ? parts.slice(1) : []; } function resolve(...args) { let resolvedPath = ""; let resolvedAbsolute = false; for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) { const path = i >= 0 ? args[i] : "/"; if (!path) { continue; } resolvedPath = `${path}/${resolvedPath}`; resolvedAbsolute = path.charAt(0) === "/"; } resolvedPath = normalizeArray( resolvedPath.split("/").filter((p) => !!p), !resolvedAbsolute ).join("/"); return (resolvedAbsolute ? "/" : "") + resolvedPath || "."; } function trim(arr) { let start = 0; for (; start < arr.length; start++) { if (arr[start] !== "") { break; } } let end = arr.length - 1; for (; end >= 0; end--) { if (arr[end] !== "") { break; } } if (start > end) { return []; } return arr.slice(start, end - start + 1); } function relative(from, to) { from = resolve(from).slice(1); to = resolve(to).slice(1); const fromParts = trim(from.split("/")); const toParts = trim(to.split("/")); const length = Math.min(fromParts.length, toParts.length); let samePartsLength = length; for (let i = 0; i < length; i++) { if (fromParts[i] !== toParts[i]) { samePartsLength = i; break; } } let outputParts = []; for (let i = samePartsLength; i < fromParts.length; i++) { outputParts.push(".."); } outputParts = outputParts.concat(toParts.slice(samePartsLength)); return outputParts.join("/"); } function dirname(path) { const result = splitPath(path); const root = result[0] || ""; let dir = result[1]; if (!root && !dir) { return "."; } if (dir) { dir = dir.slice(0, dir.length - 1); } return root + dir; } function basename(path, ext) { let f = splitPath(path)[2] || ""; if (ext && f.slice(ext.length * -1) === ext) { f = f.slice(0, f.length - ext.length); } return f; } // ../../node_modules/@sentry/utils/build/esm/promisebuffer.js init_esm_shims(); // ../../node_modules/@sentry/utils/build/esm/syncpromise.js init_esm_shims(); var States; (function(States2) { const PENDING = 0; States2[States2["PENDING"] = PENDING] = "PENDING"; const RESOLVED = 1; States2[States2["RESOLVED"] = RESOLVED] = "RESOLVED"; const REJECTED = 2; States2[States2["REJECTED"] = REJECTED] = "REJECTED"; })(States || (States = {})); function resolvedSyncPromise(value) { return new SyncPromise((resolve2) => { resolve2(value); }); } function rejectedSyncPromise(reason) { return new SyncPromise((_, reject) => { reject(reason); }); } var SyncPromise = class _SyncPromise { constructor(executor) { _SyncPromise.prototype.__init.call(this); _SyncPromise.prototype.__init2.call(this); _SyncPromise.prototype.__init3.call(this); _SyncPromise.prototype.__init4.call(this); this._state = States.PENDING; this._handlers = []; try { executor(this._resolve, this._reject); } catch (e) { this._reject(e); } } /** JSDoc */ then(onfulfilled, onrejected) { return new _SyncPromise((resolve2, reject) => { this._handlers.push([ false, (result) => { if (!onfulfilled) { resolve2(result); } else { try { resolve2(onfulfilled(result)); } catch (e) { reject(e); } } }, (reason) => { if (!onrejected) { reject(reason); } else { try { resolve2(onrejected(reason)); } catch (e) { reject(e); } } } ]); this._executeHandlers(); }); } /** JSDoc */ catch(onrejected) { return this.then((val) => val, onrejected); } /** JSDoc */ finally(onfinally) { return new _SyncPromise((resolve2, reject) => { let val; let isRejected; return this.then( (value) => { isRejected = false; val = value; if (onfinally) { onfinally(); } }, (reason) => { isRejected = true; val = reason; if (onfinally) { onfinally(); } } ).then(() => { if (isRejected) { reject(val); return; } resolve2(val); }); }); } /** JSDoc */ __init() { this._resolve = (value) => { this._setResult(States.RESOLVED, value); }; } /** JSDoc */ __init2() { this._reject = (reason) => { this._setResult(States.REJECTED, reason); }; } /** JSDoc */ __init3() { this._setResult = (state, value) => { if (this._state !== States.PENDING) { return; } if (isThenable(value)) { void value.then(this._resolve, this._reject); return; } this._state = state; this._value = value; this._executeHandlers(); }; } /** JSDoc */ __init4() { this._executeHandlers = () => { if (this._state === States.PENDING) { return; } const cachedHandlers = this._handlers.slice(); this._handlers = []; cachedHandlers.forEach((handler) => { if (handler[0]) { return; } if (this._state === States.RESOLVED) { handler[1](this._value); } if (this._state === States.REJECTED) { handler[2](this._value); } handler[0] = true; }); }; } }; // ../../node_modules/@sentry/utils/build/esm/promisebuffer.js function makePromiseBuffer(limit) { const buffer = []; function isReady() { return limit === void 0 || buffer.length < limit; } function remove(task) { return buffer.splice(buffer.indexOf(task), 1)[0] || Promise.resolve(void 0); } function add(taskProducer) { if (!isReady()) { return rejectedSyncPromise(new SentryError("Not adding Promise because buffer limit was reached.")); } const task = taskProducer(); if (buffer.indexOf(task) === -1) { buffer.push(task); } void task.then(() => remove(task)).then( null, () => remove(task).then(null, () => { }) ); return task; } function drain(timeout) { return new SyncPromise((resolve2, reject) => { let counter = buffer.length; if (!counter) { return resolve2(true); } const capturedSetTimeout = setTimeout(() => { if (timeout && timeout > 0) { resolve2(false); } }, timeout); buffer.forEach((item) => { void resolvedSyncPromise(item).then(() => { if (!--counter) { clearTimeout(capturedSetTimeout); resolve2(true); } }, reject); }); }); } return { $: buffer, add, drain }; } // ../../node_modules/@sentry/utils/build/esm/requestdata.js init_esm_shims(); // ../../node_modules/@sentry/utils/build/esm/cookie.js init_esm_shims(); function parseCookie(str) { const obj = {}; let index = 0; while (index < str.length) { const eqIdx = str.indexOf("=", index); if (eqIdx === -1) { break; } let endIdx = str.indexOf(";", index); if (endIdx === -1) { endIdx = str.length; } else if (endIdx < eqIdx) { index = str.lastIndexOf(";", eqIdx - 1) + 1; continue; } const key = str.slice(index, eqIdx).trim(); if (void 0 === obj[key]) { let val = str.slice(eqIdx + 1, endIdx).trim(); if (val.charCodeAt(0) === 34) { val = val.slice(1, -1); } try { obj[key] = val.indexOf("%") !== -1 ? decodeURIComponent(val) : val; } catch (e) { obj[key] = val; } } index = endIdx + 1; } return