From c05856c9e9e4b0bb54cda8ea6bbd85b9a7ffed14 Mon Sep 17 00:00:00 2001
From: huchenlei <20929282+huchenlei@users.noreply.github.com>
Date: Sun, 19 Jan 2025 01:19:31 +0000
Subject: [PATCH] Update frontend to v1.7.14
---
web/assets/BaseViewTemplate-BNGF4K22.js | 23 -
web/assets/BaseViewTemplate-BhQMaVFP.js | 54 +
web/assets/DesktopStartView-le6AjGZr.js | 22 +
...eC7MBzG.js => DownloadGitView-rPK_vYgU.js} | 6 +-
...D4Phn0Zr.js => ExtensionPanel-3jWrm6Zi.js} | 9 +-
...View-HVeNbkaW.js => GraphView-CDDCHVO0.js} | 1091 +-
...ew-CIRWBKTm.css => GraphView-CqZ3opAX.css} | 157 +-
...ew-CAcYt0HL.js => InstallView-By3hC1fC.js} | 71 +-
...-CwQdoH-C.css => InstallView-CxhfFC8Y.css} | 36 +-
...c3C4lG1.js => KeybindingPanel-D6O16W_1.js} | 11 +-
...s => ManualConfigurationView-CsirlNfV.css} | 4 +-
...js => ManualConfigurationView-enyqGo0M.js} | 12 +-
web/assets/MetricsConsentView-lSfLu4nr.js | 86 +
...mqNj.css => NotSupportedView-DQerxQzi.css} | 8 +-
...z3x2d-.js => NotSupportedView-Vc8_xWgH.js} | 14 +-
...StJmv.js => ServerConfigPanel-B-w0HFlz.js} | 6 +-
web/assets/ServerStartView-48wfE1MS.js | 101 +
web/assets/ServerStartView-CIDTUh4x.js | 98 -
...N4Ib6.css => ServerStartView-CJiwVDQY.css} | 2 +-
...B3jYchWu.js => UserSelectView-CXmVKOeK.js} | 6 +-
...ew-N0ZXLjdi.js => WelcomeView-C8whKl15.js} | 6 +-
web/assets/index-5HFeZax4.js | 27 -
...{index-t-sFBuUC.css => index-Cf-n7v0V.css} | 146 +-
.../{index-B5F0uxTQ.js => index-DpF-ptbJ.js} | 7 +-
.../{index-B-aVupP5.js => index-Q1cQr26V.js} | 4 +-
.../{index-DjNHn37O.js => index-QvfM__ze.js} | 111876 +++++++++------
web/assets/index-jXPKy3pP.js | 173 -
.../{index-Bordpmzt.js => index-je62U6DH.js} | 613 +-
...YdkXn.js => keybindingService-Cak1En5n.js} | 24 +-
...KFVuP.js => serverConfigStore-DCme3xlV.js} | 4 +-
web/index.html | 4 +-
31 files changed, 71687 insertions(+), 43014 deletions(-)
delete mode 100644 web/assets/BaseViewTemplate-BNGF4K22.js
create mode 100644 web/assets/BaseViewTemplate-BhQMaVFP.js
create mode 100644 web/assets/DesktopStartView-le6AjGZr.js
rename web/assets/{DownloadGitView-DeC7MBzG.js => DownloadGitView-rPK_vYgU.js} (87%)
rename web/assets/{ExtensionPanel-D4Phn0Zr.js => ExtensionPanel-3jWrm6Zi.js} (91%)
rename web/assets/{GraphView-HVeNbkaW.js => GraphView-CDDCHVO0.js} (94%)
rename web/assets/{GraphView-CIRWBKTm.css => GraphView-CqZ3opAX.css} (70%)
rename web/assets/{InstallView-CAcYt0HL.js => InstallView-By3hC1fC.js} (94%)
rename web/assets/{InstallView-CwQdoH-C.css => InstallView-CxhfFC8Y.css} (70%)
rename web/assets/{KeybindingPanel-Dc3C4lG1.js => KeybindingPanel-D6O16W_1.js} (92%)
rename web/assets/{ManualConfigurationView-B6ecEClB.css => ManualConfigurationView-CsirlNfV.css} (59%)
rename web/assets/{ManualConfigurationView-Bi_qHE-n.js => ManualConfigurationView-enyqGo0M.js} (81%)
create mode 100644 web/assets/MetricsConsentView-lSfLu4nr.js
rename web/assets/{NotSupportedView-bFzHmqNj.css => NotSupportedView-DQerxQzi.css} (63%)
rename web/assets/{NotSupportedView-Drz3x2d-.js => NotSupportedView-Vc8_xWgH.js} (81%)
rename web/assets/{ServerConfigPanel-Be4StJmv.js => ServerConfigPanel-B-w0HFlz.js} (91%)
create mode 100644 web/assets/ServerStartView-48wfE1MS.js
delete mode 100644 web/assets/ServerStartView-CIDTUh4x.js
rename web/assets/{ServerStartView-CnyN4Ib6.css => ServerStartView-CJiwVDQY.css} (64%)
rename web/assets/{UserSelectView-B3jYchWu.js => UserSelectView-CXmVKOeK.js} (89%)
rename web/assets/{WelcomeView-N0ZXLjdi.js => WelcomeView-C8whKl15.js} (79%)
delete mode 100644 web/assets/index-5HFeZax4.js
rename web/assets/{index-t-sFBuUC.css => index-Cf-n7v0V.css} (97%)
rename web/assets/{index-B5F0uxTQ.js => index-DpF-ptbJ.js} (99%)
rename web/assets/{index-B-aVupP5.js => index-Q1cQr26V.js} (91%)
rename web/assets/{index-DjNHn37O.js => index-QvfM__ze.js} (81%)
delete mode 100644 web/assets/index-jXPKy3pP.js
rename web/assets/{index-Bordpmzt.js => index-je62U6DH.js} (99%)
rename web/assets/{keybindingService-Bx7YdkXn.js => keybindingService-Cak1En5n.js} (89%)
rename web/assets/{serverConfigStore-CvyKFVuP.js => serverConfigStore-DCme3xlV.js} (95%)
diff --git a/web/assets/BaseViewTemplate-BNGF4K22.js b/web/assets/BaseViewTemplate-BNGF4K22.js
deleted file mode 100644
index b03956141e9..00000000000
--- a/web/assets/BaseViewTemplate-BNGF4K22.js
+++ /dev/null
@@ -1,23 +0,0 @@
-import { d as defineComponent, o as openBlock, f as createElementBlock, J as renderSlot, T as normalizeClass } from "./index-DjNHn37O.js";
-const _sfc_main = /* @__PURE__ */ defineComponent({
- __name: "BaseViewTemplate",
- props: {
- dark: { type: Boolean, default: false }
- },
- setup(__props) {
- const props = __props;
- return (_ctx, _cache) => {
- return openBlock(), createElementBlock("div", {
- class: normalizeClass(["font-sans w-screen h-screen flex items-center justify-center pointer-events-auto overflow-auto", [
- props.dark ? "text-neutral-300 bg-neutral-900 dark-theme" : "text-neutral-900 bg-neutral-300"
- ]])
- }, [
- renderSlot(_ctx.$slots, "default")
- ], 2);
- };
- }
-});
-export {
- _sfc_main as _
-};
-//# sourceMappingURL=BaseViewTemplate-BNGF4K22.js.map
diff --git a/web/assets/BaseViewTemplate-BhQMaVFP.js b/web/assets/BaseViewTemplate-BhQMaVFP.js
new file mode 100644
index 00000000000..af2f3028c50
--- /dev/null
+++ b/web/assets/BaseViewTemplate-BhQMaVFP.js
@@ -0,0 +1,54 @@
+import { d as defineComponent, ad as ref, t as onMounted, bT as isElectron, bV as electronAPI, af as nextTick, o as openBlock, f as createElementBlock, i as withDirectives, v as vShow, m as createBaseVNode, M as renderSlot, V as normalizeClass } from "./index-QvfM__ze.js";
+const _hoisted_1 = { class: "flex-grow w-full flex items-center justify-center overflow-auto" };
+const _sfc_main = /* @__PURE__ */ defineComponent({
+ __name: "BaseViewTemplate",
+ props: {
+ dark: { type: Boolean, default: false }
+ },
+ setup(__props) {
+ const props = __props;
+ const darkTheme = {
+ color: "rgba(0, 0, 0, 0)",
+ symbolColor: "#d4d4d4"
+ };
+ const lightTheme = {
+ color: "rgba(0, 0, 0, 0)",
+ symbolColor: "#171717"
+ };
+ const topMenuRef = ref(null);
+ const isNativeWindow = ref(false);
+ onMounted(async () => {
+ if (isElectron()) {
+ const windowStyle = await electronAPI().Config.getWindowStyle();
+ isNativeWindow.value = windowStyle === "custom";
+ await nextTick();
+ electronAPI().changeTheme({
+ ...props.dark ? darkTheme : lightTheme,
+ height: topMenuRef.value.getBoundingClientRect().height
+ });
+ }
+ });
+ return (_ctx, _cache) => {
+ return openBlock(), createElementBlock("div", {
+ class: normalizeClass(["font-sans w-screen h-screen flex flex-col pointer-events-auto", [
+ props.dark ? "text-neutral-300 bg-neutral-900 dark-theme" : "text-neutral-900 bg-neutral-300"
+ ]])
+ }, [
+ withDirectives(createBaseVNode("div", {
+ ref_key: "topMenuRef",
+ ref: topMenuRef,
+ class: "app-drag w-full h-[var(--comfy-topbar-height)]"
+ }, null, 512), [
+ [vShow, isNativeWindow.value]
+ ]),
+ createBaseVNode("div", _hoisted_1, [
+ renderSlot(_ctx.$slots, "default")
+ ])
+ ], 2);
+ };
+ }
+});
+export {
+ _sfc_main as _
+};
+//# sourceMappingURL=BaseViewTemplate-BhQMaVFP.js.map
diff --git a/web/assets/DesktopStartView-le6AjGZr.js b/web/assets/DesktopStartView-le6AjGZr.js
new file mode 100644
index 00000000000..41a212f3a38
--- /dev/null
+++ b/web/assets/DesktopStartView-le6AjGZr.js
@@ -0,0 +1,22 @@
+import { d as defineComponent, o as openBlock, J as createBlock, P as withCtx, m as createBaseVNode, k as createVNode, j as unref, ch as script } from "./index-QvfM__ze.js";
+import { _ as _sfc_main$1 } from "./BaseViewTemplate-BhQMaVFP.js";
+const _hoisted_1 = { class: "max-w-screen-sm w-screen p-8" };
+const _sfc_main = /* @__PURE__ */ defineComponent({
+ __name: "DesktopStartView",
+ setup(__props) {
+ return (_ctx, _cache) => {
+ return openBlock(), createBlock(_sfc_main$1, { dark: "" }, {
+ default: withCtx(() => [
+ createBaseVNode("div", _hoisted_1, [
+ createVNode(unref(script), { mode: "indeterminate" })
+ ])
+ ]),
+ _: 1
+ });
+ };
+ }
+});
+export {
+ _sfc_main as default
+};
+//# sourceMappingURL=DesktopStartView-le6AjGZr.js.map
diff --git a/web/assets/DownloadGitView-DeC7MBzG.js b/web/assets/DownloadGitView-rPK_vYgU.js
similarity index 87%
rename from web/assets/DownloadGitView-DeC7MBzG.js
rename to web/assets/DownloadGitView-rPK_vYgU.js
index 6f00b3647a6..c286da35559 100644
--- a/web/assets/DownloadGitView-DeC7MBzG.js
+++ b/web/assets/DownloadGitView-rPK_vYgU.js
@@ -1,7 +1,7 @@
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { d as defineComponent, o as openBlock, k as createBlock, M as withCtx, H as createBaseVNode, X as toDisplayString, N as createVNode, j as unref, l as script, bW as useRouter } from "./index-DjNHn37O.js";
-import { _ as _sfc_main$1 } from "./BaseViewTemplate-BNGF4K22.js";
+import { d as defineComponent, o as openBlock, J as createBlock, P as withCtx, m as createBaseVNode, Z as toDisplayString, k as createVNode, j as unref, l as script, c2 as useRouter } from "./index-QvfM__ze.js";
+import { _ as _sfc_main$1 } from "./BaseViewTemplate-BhQMaVFP.js";
const _hoisted_1 = { class: "max-w-screen-sm flex flex-col gap-8 p-8 bg-[url('/assets/images/Git-Logo-White.svg')] bg-no-repeat bg-right-top bg-origin-padding" };
const _hoisted_2 = { class: "mt-24 text-4xl font-bold text-red-500" };
const _hoisted_3 = { class: "space-y-4" };
@@ -55,4 +55,4 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
export {
_sfc_main as default
};
-//# sourceMappingURL=DownloadGitView-DeC7MBzG.js.map
+//# sourceMappingURL=DownloadGitView-rPK_vYgU.js.map
diff --git a/web/assets/ExtensionPanel-D4Phn0Zr.js b/web/assets/ExtensionPanel-3jWrm6Zi.js
similarity index 91%
rename from web/assets/ExtensionPanel-D4Phn0Zr.js
rename to web/assets/ExtensionPanel-3jWrm6Zi.js
index 02baf6e174b..3c580dd1b95 100644
--- a/web/assets/ExtensionPanel-D4Phn0Zr.js
+++ b/web/assets/ExtensionPanel-3jWrm6Zi.js
@@ -1,9 +1,8 @@
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { d as defineComponent, ab as ref, cn as FilterMatchMode, cs as useExtensionStore, a as useSettingStore, m as onMounted, c as computed, o as openBlock, k as createBlock, M as withCtx, N as createVNode, co as SearchBox, j as unref, bZ as script, H as createBaseVNode, f as createElementBlock, E as renderList, X as toDisplayString, aE as createTextVNode, F as Fragment, l as script$1, I as createCommentVNode, aI as script$3, bO as script$4, c4 as script$5, cp as _sfc_main$1 } from "./index-DjNHn37O.js";
-import { s as script$2, a as script$6 } from "./index-B5F0uxTQ.js";
-import "./index-B-aVupP5.js";
-import "./index-5HFeZax4.js";
+import { d as defineComponent, ad as ref, cu as FilterMatchMode, cz as useExtensionStore, a as useSettingStore, t as onMounted, c as computed, o as openBlock, J as createBlock, P as withCtx, k as createVNode, cv as SearchBox, j as unref, c6 as script, m as createBaseVNode, f as createElementBlock, I as renderList, Z as toDisplayString, aG as createTextVNode, H as Fragment, l as script$1, L as createCommentVNode, aK as script$3, b8 as script$4, cc as script$5, cw as _sfc_main$1 } from "./index-QvfM__ze.js";
+import { s as script$2, a as script$6 } from "./index-DpF-ptbJ.js";
+import "./index-Q1cQr26V.js";
const _hoisted_1 = { class: "flex justify-end" };
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "ExtensionPanel",
@@ -180,4 +179,4 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
export {
_sfc_main as default
};
-//# sourceMappingURL=ExtensionPanel-D4Phn0Zr.js.map
+//# sourceMappingURL=ExtensionPanel-3jWrm6Zi.js.map
diff --git a/web/assets/GraphView-HVeNbkaW.js b/web/assets/GraphView-CDDCHVO0.js
similarity index 94%
rename from web/assets/GraphView-HVeNbkaW.js
rename to web/assets/GraphView-CDDCHVO0.js
index 648d3aab170..34b0cd73186 100644
--- a/web/assets/GraphView-HVeNbkaW.js
+++ b/web/assets/GraphView-CDDCHVO0.js
@@ -1,14 +1,12 @@
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { d as defineComponent, u as useExecutionStore, c as computed, a as useSettingStore, b as useWorkflowStore, e as useTitle, o as openBlock, f as createElementBlock, g as useWorkspaceStore, w as watchEffect, h as app, r as resolveDirective, i as withDirectives, v as vShow, j as unref, k as createBlock, n as normalizeStyle, s as showNativeMenu, l as script$d, _ as _export_sfc, m as onMounted, p as onBeforeUnmount, B as BaseStyle, q as script$e, t as getWidth, x as getHeight, y as getOuterWidth, z as getOuterHeight, A as getVNodeProp, C as isArray, D as mergeProps, F as Fragment, E as renderList, G as resolveDynamicComponent, H as createBaseVNode, I as createCommentVNode, J as renderSlot, K as useSidebarTabStore, L as useBottomPanelStore, M as withCtx, N as createVNode, O as getAttribute, P as findSingle, Q as focus, R as equals, S as Ripple, T as normalizeClass, U as getOffset, V as script$f, W as script$g, X as toDisplayString, Y as script$h, Z as markRaw, $ as defineStore, a0 as shallowRef, a1 as useI18n, a2 as useCommandStore, a3 as LiteGraph, a4 as useColorPaletteStore, a5 as watch, a6 as useNodeDefStore, a7 as BadgePosition, a8 as LGraphBadge, a9 as _, aa as NodeBadgeMode, ab as ref, ac as useEventListener, ad as nextTick, ae as st, af as normalizeI18nKey, ag as LGraphGroup, ah as LGraphNode, ai as EditableText, aj as isNotEmpty, ak as UniqueComponentId, al as ZIndex, am as resolveFieldData, an as OverlayEventBus, ao as isEmpty, ap as addStyle, aq as relativePosition, ar as absolutePosition, as as ConnectedOverlayScrollHandler, at as isTouchDevice, au as findLastIndex, av as script$i, aw as script$j, ax as script$k, ay as script$l, az as script$m, aA as script$n, aB as resolveComponent, aC as Transition, aD as createSlots, aE as createTextVNode, aF as useNodeFrequencyStore, aG as useNodeBookmarkStore, aH as highlightQuery, aI as script$o, aJ as formatNumberWithSuffix, aK as NodeSourceType, aL as pushScopeId, aM as popScopeId, aN as NodePreview, aO as NodeSearchFilter, aP as script$p, aQ as SearchFilterChip, aR as useLitegraphService, aS as storeToRefs, aT as isRef, aU as toRaw, aV as LinkReleaseTriggerAction, aW as script$q, aX as useUserStore, aY as useDialogStore, aZ as SettingDialogHeader, a_ as SettingDialogContent, a$ as useKeybindingStore, b0 as Teleport, b1 as LinkMarkerShape, b2 as useModelToNodeStore, b3 as CanvasPointer, b4 as IS_CONTROL_WIDGET, b5 as updateControlWidgetLabel, b6 as useColorPaletteService, b7 as setStorageValue, b8 as api, b9 as usePragmaticDroppable, ba as LGraph, bb as LLink, bc as DragAndScale, bd as LGraphCanvas, be as ContextMenu, bf as ChangeTracker, bg as useWorkflowService, bh as ComfyNodeDefImpl, bi as ComfyModelDef, bj as script$r, bk as script$s, bl as script$t, bm as script$u, bn as script$v, bo as normalizeProps, bp as ToastEventBus, bq as setAttribute, br as TransitionGroup, bs as useToast, bt as useToastStore, bu as resolve, bv as nestedPosition, bw as script$w, bx as isPrintableCharacter, by as useQueueSettingsStore, bz as script$x, bA as useQueuePendingTaskCountStore, bB as useLocalStorage, bC as useDraggable, bD as watchDebounced, bE as inject, bF as useElementBounding, bG as lodashExports, bH as useEventBus, bI as script$z, bJ as guardReactiveProps, bK as useMenuItemStore, bL as usePragmaticDraggable, bM as withModifiers, bN as script$B, bO as script$C, bP as provide, bQ as script$D, bR as useDialogService, bS as LGraphEventMode, bT as useQueueStore, bU as i18n, bV as useModelStore } from "./index-DjNHn37O.js";
-import { s as script$y } from "./index-jXPKy3pP.js";
-import { s as script$A } from "./index-B-aVupP5.js";
-import { u as useKeybindingService } from "./keybindingService-Bx7YdkXn.js";
-import { u as useServerConfigStore } from "./serverConfigStore-CvyKFVuP.js";
-import "./index-5HFeZax4.js";
+import { d as defineComponent, u as useExecutionStore, c as computed, a as useSettingStore, b as useWorkflowStore, e as useTitle, o as openBlock, f as createElementBlock, g as useWorkspaceStore, w as watchEffect, h as app, r as resolveDirective, i as withDirectives, v as vShow, j as unref, k as createVNode, s as showNativeMenu, l as script$d, m as createBaseVNode, n as normalizeStyle, p as pushScopeId, q as popScopeId, _ as _export_sfc, t as onMounted, x as onBeforeUnmount, B as BaseStyle, y as script$e, z as getWidth, A as getHeight, C as getOuterWidth, D as getOuterHeight, E as getVNodeProp, F as isArray, G as mergeProps, H as Fragment, I as renderList, J as createBlock, K as resolveDynamicComponent, L as createCommentVNode, M as renderSlot, N as useSidebarTabStore, O as useBottomPanelStore, P as withCtx, Q as getAttribute, R as findSingle, S as focus, T as equals, U as Ripple, V as normalizeClass, W as getOffset, X as script$f, Y as script$g, Z as toDisplayString, $ as script$h, a0 as markRaw, a1 as defineStore, a2 as shallowRef, a3 as useI18n, a4 as useCommandStore, a5 as LiteGraph, a6 as useColorPaletteStore, a7 as watch, a8 as useNodeDefStore, a9 as BadgePosition, aa as LGraphBadge, ab as _, ac as NodeBadgeMode, ad as ref, ae as useEventListener, af as nextTick, ag as st, ah as normalizeI18nKey, ai as LGraphGroup, aj as LGraphNode, ak as EditableText, al as isNotEmpty, am as UniqueComponentId, an as ZIndex, ao as resolveFieldData, ap as OverlayEventBus, aq as isEmpty, ar as addStyle, as as relativePosition, at as absolutePosition, au as ConnectedOverlayScrollHandler, av as isTouchDevice, aw as findLastIndex, ax as script$i, ay as script$j, az as script$k, aA as script$l, aB as script$m, aC as script$n, aD as resolveComponent, aE as Transition, aF as createSlots, aG as createTextVNode, aH as useNodeFrequencyStore, aI as useNodeBookmarkStore, aJ as highlightQuery, aK as script$o, aL as formatNumberWithSuffix, aM as NodeSourceType, aN as NodePreview, aO as NodeSearchFilter, aP as script$p, aQ as SearchFilterChip, aR as useLitegraphService, aS as storeToRefs, aT as isRef, aU as toRaw, aV as LinkReleaseTriggerAction, aW as script$q, aX as useUserStore, aY as useDialogStore, aZ as SettingDialogHeader, a_ as SettingDialogContent, a$ as useKeybindingStore, b0 as Teleport, b1 as usePragmaticDraggable, b2 as usePragmaticDroppable, b3 as withModifiers, b4 as useWorkflowService, b5 as useWorkflowBookmarkStore, b6 as script$r, b7 as script$s, b8 as script$t, b9 as LinkMarkerShape, ba as useModelToNodeStore, bb as getStorageValue, bc as CanvasPointer, bd as IS_CONTROL_WIDGET, be as updateControlWidgetLabel, bf as useColorPaletteService, bg as setStorageValue, bh as api, bi as LGraph, bj as LLink, bk as DragAndScale, bl as LGraphCanvas, bm as ContextMenu, bn as ChangeTracker, bo as ComfyNodeDefImpl, bp as ComfyModelDef, bq as script$u, br as script$v, bs as script$w, bt as script$x, bu as script$y, bv as normalizeProps, bw as ToastEventBus, bx as setAttribute, by as TransitionGroup, bz as useToast, bA as useToastStore, bB as resolve, bC as nestedPosition, bD as script$z, bE as isPrintableCharacter, bF as useQueueSettingsStore, bG as script$A, bH as useQueuePendingTaskCountStore, bI as useLocalStorage, bJ as useDraggable, bK as watchDebounced, bL as inject, bM as useElementBounding, bN as script$B, bO as lodashExports, bP as useEventBus, bQ as script$C, bR as guardReactiveProps, bS as useMenuItemStore, bT as isElectron, bU as provide, bV as electronAPI, bW as useDialogService, bX as LGraphEventMode, bY as useQueueStore, bZ as DEFAULT_DARK_COLOR_PALETTE, b_ as DEFAULT_LIGHT_COLOR_PALETTE, b$ as i18n, c0 as useErrorHandling, c1 as useModelStore } from "./index-QvfM__ze.js";
+import { s as script$D } from "./index-Q1cQr26V.js";
+import { u as useKeybindingService } from "./keybindingService-Cak1En5n.js";
+import { u as useServerConfigStore } from "./serverConfigStore-DCme3xlV.js";
const DEFAULT_TITLE = "ComfyUI";
const TITLE_SUFFIX = " - ComfyUI";
-const _sfc_main$t = /* @__PURE__ */ defineComponent({
+const _sfc_main$u = /* @__PURE__ */ defineComponent({
__name: "BrowserTabTitle",
setup(__props) {
const executionStore = useExecutionStore();
@@ -40,7 +38,9 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
};
}
});
-const _sfc_main$s = /* @__PURE__ */ defineComponent({
+const _withScopeId$9 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-7ed57d1a"), n = n(), popScopeId(), n), "_withScopeId$9");
+const _hoisted_1$q = { class: "window-actions-spacer" };
+const _sfc_main$t = /* @__PURE__ */ defineComponent({
__name: "MenuHamburger",
setup(__props) {
const workspaceState = useWorkspaceStore();
@@ -68,29 +68,39 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
);
return (_ctx, _cache) => {
const _directive_tooltip = resolveDirective("tooltip");
- return withDirectives((openBlock(), createBlock(unref(script$d), {
- class: "comfy-menu-hamburger",
- style: normalizeStyle(positionCSS.value),
- icon: "pi pi-bars",
- severity: "secondary",
- text: "",
- size: "large",
- onClick: exitFocusMode,
- onContextmenu: unref(showNativeMenu)
- }, null, 8, ["style", "onContextmenu"])), [
- [vShow, unref(workspaceState).focusMode],
- [_directive_tooltip, { value: _ctx.$t("menu.showMenu"), showDelay: 300 }]
+ return withDirectives((openBlock(), createElementBlock("div", {
+ class: "comfy-menu-hamburger no-drag",
+ style: normalizeStyle(positionCSS.value)
+ }, [
+ withDirectives(createVNode(unref(script$d), {
+ icon: "pi pi-bars",
+ severity: "secondary",
+ text: "",
+ size: "large",
+ "aria-label": _ctx.$t("menu.showMenu"),
+ "aria-live": "assertive",
+ onClick: exitFocusMode,
+ onContextmenu: unref(showNativeMenu)
+ }, null, 8, ["aria-label", "onContextmenu"]), [
+ [_directive_tooltip, { value: _ctx.$t("menu.showMenu"), showDelay: 300 }]
+ ]),
+ withDirectives(createBaseVNode("div", _hoisted_1$q, null, 512), [
+ [vShow, menuSetting.value !== "Bottom"]
+ ])
+ ], 4)), [
+ [vShow, unref(workspaceState).focusMode]
]);
};
}
});
-const MenuHamburger = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-5661bed0"]]);
-const _sfc_main$r = /* @__PURE__ */ defineComponent({
+const MenuHamburger = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-7ed57d1a"]]);
+const _sfc_main$s = /* @__PURE__ */ defineComponent({
__name: "UnloadWindowConfirmDialog",
setup(__props) {
const settingStore = useSettingStore();
+ const workflowStore = useWorkflowStore();
const handleBeforeUnload = /* @__PURE__ */ __name((event) => {
- if (settingStore.get("Comfy.Window.UnloadConfirmation")) {
+ if (settingStore.get("Comfy.Window.UnloadConfirmation") && workflowStore.modifiedWorkflows.length > 0) {
event.preventDefault();
return true;
}
@@ -542,7 +552,7 @@ var script$c = {
}, "getPTOptions")
}
};
-var _hoisted_1$m = ["onMousedown", "onTouchstart", "onTouchmove", "onTouchend"];
+var _hoisted_1$p = ["onMousedown", "onTouchstart", "onTouchmove", "onTouchend"];
var _hoisted_2$j = ["aria-orientation", "aria-valuenow", "onKeydown"];
function render$j(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("div", mergeProps({
@@ -587,7 +597,7 @@ function render$j(_ctx, _cache, $props, $setup, $data, $options) {
return $options.onGutterKeyDown($event, i);
}, "onKeydown"),
ref_for: true
- }, _ctx.ptm("gutterHandle")), null, 16, _hoisted_2$j)], 16, _hoisted_1$m)) : createCommentVNode("", true)], 64);
+ }, _ctx.ptm("gutterHandle")), null, 16, _hoisted_2$j)], 16, _hoisted_1$p)) : createCommentVNode("", true)], 64);
}), 128))], 16);
}
__name(render$j, "render$j");
@@ -659,7 +669,7 @@ function render$i(_ctx, _cache, $props, $setup, $data, $options) {
}
__name(render$i, "render$i");
script$b.render = render$i;
-const _sfc_main$q = /* @__PURE__ */ defineComponent({
+const _sfc_main$r = /* @__PURE__ */ defineComponent({
__name: "LiteGraphCanvasSplitterOverlay",
setup(__props) {
const settingStore = useSettingStore();
@@ -746,7 +756,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
};
}
});
-const LiteGraphCanvasSplitterOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-e50caa15"]]);
+const LiteGraphCanvasSplitterOverlay = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-e50caa15"]]);
var classes$8 = {
root: /* @__PURE__ */ __name(function root4(_ref) {
var instance = _ref.instance, props = _ref.props;
@@ -1112,9 +1122,9 @@ var script$9 = {
ripple: Ripple
}
};
-var _hoisted_1$l = ["aria-label", "tabindex"];
+var _hoisted_1$o = ["aria-label", "tabindex"];
var _hoisted_2$i = ["aria-orientation"];
-var _hoisted_3$g = ["aria-label", "tabindex"];
+var _hoisted_3$h = ["aria-label", "tabindex"];
function render$g(_ctx, _cache, $props, $setup, $data, $options) {
var _directive_ripple = resolveDirective("ripple");
return openBlock(), createElementBlock("div", mergeProps({
@@ -1133,7 +1143,7 @@ function render$g(_ctx, _cache, $props, $setup, $data, $options) {
"data-pc-group-section": "navigator"
}), [(openBlock(), createBlock(resolveDynamicComponent($options.templates.previcon || "ChevronLeftIcon"), mergeProps({
"aria-hidden": "true"
- }, _ctx.ptm("prevIcon")), null, 16))], 16, _hoisted_1$l)), [[_directive_ripple]]) : createCommentVNode("", true), createBaseVNode("div", mergeProps({
+ }, _ctx.ptm("prevIcon")), null, 16))], 16, _hoisted_1$o)), [[_directive_ripple]]) : createCommentVNode("", true), createBaseVNode("div", mergeProps({
ref: "content",
"class": _ctx.cx("content"),
onScroll: _cache[1] || (_cache[1] = function() {
@@ -1162,11 +1172,11 @@ function render$g(_ctx, _cache, $props, $setup, $data, $options) {
"data-pc-group-section": "navigator"
}), [(openBlock(), createBlock(resolveDynamicComponent($options.templates.nexticon || "ChevronRightIcon"), mergeProps({
"aria-hidden": "true"
- }, _ctx.ptm("nextIcon")), null, 16))], 16, _hoisted_3$g)), [[_directive_ripple]]) : createCommentVNode("", true)], 16);
+ }, _ctx.ptm("nextIcon")), null, 16))], 16, _hoisted_3$h)), [[_directive_ripple]]) : createCommentVNode("", true)], 16);
}
__name(render$g, "render$g");
script$9.render = render$g;
-const _sfc_main$p = /* @__PURE__ */ defineComponent({
+const _sfc_main$q = /* @__PURE__ */ defineComponent({
__name: "ExtensionSlot",
props: {
extension: {}
@@ -1195,17 +1205,17 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
};
}
});
-const _hoisted_1$k = { class: "flex flex-col h-full" };
+const _hoisted_1$n = { class: "flex flex-col h-full" };
const _hoisted_2$h = { class: "w-full flex justify-between" };
-const _hoisted_3$f = { class: "tabs-container" };
-const _hoisted_4$5 = { class: "font-bold" };
+const _hoisted_3$g = { class: "tabs-container" };
+const _hoisted_4$6 = { class: "font-bold" };
const _hoisted_5$4 = { class: "flex-grow h-0" };
-const _sfc_main$o = /* @__PURE__ */ defineComponent({
+const _sfc_main$p = /* @__PURE__ */ defineComponent({
__name: "BottomPanel",
setup(__props) {
const bottomPanelStore = useBottomPanelStore();
return (_ctx, _cache) => {
- return openBlock(), createElementBlock("div", _hoisted_1$k, [
+ return openBlock(), createElementBlock("div", _hoisted_1$n, [
createVNode(unref(script$h), {
value: unref(bottomPanelStore).activeBottomPanelTabId,
"onUpdate:value": _cache[1] || (_cache[1] = ($event) => unref(bottomPanelStore).activeBottomPanelTabId = $event)
@@ -1214,7 +1224,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
createVNode(unref(script$9), { "pt:tabList": "border-none" }, {
default: withCtx(() => [
createBaseVNode("div", _hoisted_2$h, [
- createBaseVNode("div", _hoisted_3$f, [
+ createBaseVNode("div", _hoisted_3$g, [
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(bottomPanelStore).bottomPanelTabs, (tab) => {
return openBlock(), createBlock(unref(script$a), {
key: tab.id,
@@ -1222,7 +1232,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
class: "p-3 border-none"
}, {
default: withCtx(() => [
- createBaseVNode("span", _hoisted_4$5, toDisplayString(tab.title.toUpperCase()), 1)
+ createBaseVNode("span", _hoisted_4$6, toDisplayString(tab.title.toUpperCase()), 1)
]),
_: 2
}, 1032, ["value"]);
@@ -1244,7 +1254,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
_: 1
}, 8, ["value"]),
createBaseVNode("div", _hoisted_5$4, [
- unref(bottomPanelStore).bottomPanelVisible && unref(bottomPanelStore).activeBottomPanelTab ? (openBlock(), createBlock(_sfc_main$p, {
+ unref(bottomPanelStore).bottomPanelVisible && unref(bottomPanelStore).activeBottomPanelTab ? (openBlock(), createBlock(_sfc_main$q, {
key: 0,
extension: unref(bottomPanelStore).activeBottomPanelTab
}, null, 8, ["extension"])) : createCommentVNode("", true)
@@ -1253,7 +1263,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
};
}
});
-const _hoisted_1$j = {
+const _hoisted_1$m = {
viewBox: "0 0 1024 1024",
width: "1.2em",
height: "1.2em"
@@ -1262,15 +1272,15 @@ const _hoisted_2$g = /* @__PURE__ */ createBaseVNode("path", {
fill: "currentColor",
d: "M921.088 103.232L584.832 889.024L465.52 544.512L121.328 440.48zM1004.46.769c-6.096 0-13.52 1.728-22.096 5.36L27.708 411.2c-34.383 14.592-36.56 42.704-4.847 62.464l395.296 123.584l129.36 403.264c9.28 15.184 20.496 22.72 31.263 22.72c11.936 0 23.296-9.152 31.04-27.248l408.272-953.728C1029.148 16.368 1022.86.769 1004.46.769"
}, null, -1);
-const _hoisted_3$e = [
+const _hoisted_3$f = [
_hoisted_2$g
];
function render$f(_ctx, _cache) {
- return openBlock(), createElementBlock("svg", _hoisted_1$j, [..._hoisted_3$e]);
+ return openBlock(), createElementBlock("svg", _hoisted_1$m, [..._hoisted_3$f]);
}
__name(render$f, "render$f");
const __unplugin_components_1$2 = markRaw({ name: "simple-line-icons-cursor", render: render$f });
-const _hoisted_1$i = {
+const _hoisted_1$l = {
viewBox: "0 0 24 24",
width: "1.2em",
height: "1.2em"
@@ -1279,11 +1289,11 @@ const _hoisted_2$f = /* @__PURE__ */ createBaseVNode("path", {
fill: "currentColor",
d: "M10.05 23q-.75 0-1.4-.337T7.575 21.7L1.2 12.375l.6-.575q.475-.475 1.125-.55t1.175.3L7 13.575V4q0-.425.288-.712T8 3t.713.288T9 4v13.425l-3.7-2.6l3.925 5.725q.125.2.35.325t.475.125H17q.825 0 1.413-.587T19 19V5q0-.425.288-.712T20 4t.713.288T21 5v14q0 1.65-1.175 2.825T17 23zM11 12V2q0-.425.288-.712T12 1t.713.288T13 2v10zm4 0V3q0-.425.288-.712T16 2t.713.288T17 3v9zm-2.85 4.5"
}, null, -1);
-const _hoisted_3$d = [
+const _hoisted_3$e = [
_hoisted_2$f
];
function render$e(_ctx, _cache) {
- return openBlock(), createElementBlock("svg", _hoisted_1$i, [..._hoisted_3$d]);
+ return openBlock(), createElementBlock("svg", _hoisted_1$l, [..._hoisted_3$e]);
}
__name(render$e, "render$e");
const __unplugin_components_0$2 = markRaw({ name: "material-symbols-pan-tool-outline", render: render$e });
@@ -1335,7 +1345,7 @@ const useCanvasStore = defineStore("canvas", () => {
canvas
};
});
-const _sfc_main$n = /* @__PURE__ */ defineComponent({
+const _sfc_main$o = /* @__PURE__ */ defineComponent({
__name: "GraphCanvasMenu",
setup(__props) {
const { t } = useI18n();
@@ -1367,9 +1377,10 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
withDirectives(createVNode(unref(script$d), {
severity: "secondary",
icon: "pi pi-plus",
+ "aria-label": _ctx.$t("graphCanvasMenu.zoomIn"),
onMousedown: _cache[0] || (_cache[0] = ($event) => repeat2("Comfy.Canvas.ZoomIn")),
onMouseup: stopRepeat
- }, null, 512), [
+ }, null, 8, ["aria-label"]), [
[
_directive_tooltip,
unref(t)("graphCanvasMenu.zoomIn"),
@@ -1380,9 +1391,10 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
withDirectives(createVNode(unref(script$d), {
severity: "secondary",
icon: "pi pi-minus",
+ "aria-label": _ctx.$t("graphCanvasMenu.zoomOut"),
onMousedown: _cache[1] || (_cache[1] = ($event) => repeat2("Comfy.Canvas.ZoomOut")),
onMouseup: stopRepeat
- }, null, 512), [
+ }, null, 8, ["aria-label"]), [
[
_directive_tooltip,
unref(t)("graphCanvasMenu.zoomOut"),
@@ -1393,8 +1405,9 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
withDirectives(createVNode(unref(script$d), {
severity: "secondary",
icon: "pi pi-expand",
+ "aria-label": _ctx.$t("graphCanvasMenu.fitView"),
onClick: _cache[2] || (_cache[2] = () => unref(commandStore).execute("Comfy.Canvas.FitView"))
- }, null, 512), [
+ }, null, 8, ["aria-label"]), [
[
_directive_tooltip,
unref(t)("graphCanvasMenu.fitView"),
@@ -1404,13 +1417,16 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
]),
withDirectives((openBlock(), createBlock(unref(script$d), {
severity: "secondary",
+ "aria-label": unref(t)(
+ "graphCanvasMenu." + (unref(canvasStore).canvas?.read_only ? "panMode" : "selectMode")
+ ),
onClick: _cache[3] || (_cache[3] = () => unref(commandStore).execute("Comfy.Canvas.ToggleLock"))
}, {
icon: withCtx(() => [
unref(canvasStore).canvas?.read_only ? (openBlock(), createBlock(_component_i_material_symbols58pan_tool_outline, { key: 0 })) : (openBlock(), createBlock(_component_i_simple_line_icons58cursor, { key: 1 }))
]),
_: 1
- })), [
+ }, 8, ["aria-label"])), [
[
_directive_tooltip,
unref(t)(
@@ -1423,9 +1439,10 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
withDirectives(createVNode(unref(script$d), {
severity: "secondary",
icon: linkHidden.value ? "pi pi-eye-slash" : "pi pi-eye",
+ "aria-label": _ctx.$t("graphCanvasMenu.toggleLinkVisibility"),
onClick: _cache[4] || (_cache[4] = () => unref(commandStore).execute("Comfy.Canvas.ToggleLinkVisibility")),
"data-testid": "toggle-link-visibility-button"
- }, null, 8, ["icon"]), [
+ }, null, 8, ["icon", "aria-label"]), [
[
_directive_tooltip,
unref(t)("graphCanvasMenu.toggleLinkVisibility"),
@@ -1439,8 +1456,8 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
};
}
});
-const GraphCanvasMenu = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-cf40dd39"]]);
-const _sfc_main$m = /* @__PURE__ */ defineComponent({
+const GraphCanvasMenu = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-cb8f9a1a"]]);
+const _sfc_main$n = /* @__PURE__ */ defineComponent({
__name: "NodeBadge",
setup(__props) {
const settingStore = useSettingStore();
@@ -1493,7 +1510,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
};
}
});
-const _sfc_main$l = /* @__PURE__ */ defineComponent({
+const _sfc_main$m = /* @__PURE__ */ defineComponent({
__name: "NodeTooltip",
setup(__props) {
let idleTimeout;
@@ -1582,8 +1599,8 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
};
}
});
-const NodeTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-46859edf"]]);
-const _sfc_main$k = /* @__PURE__ */ defineComponent({
+const NodeTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-46859edf"]]);
+const _sfc_main$l = /* @__PURE__ */ defineComponent({
__name: "TitleEditor",
setup(__props) {
const settingStore = useSettingStore();
@@ -1690,7 +1707,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
};
}
});
-const TitleEditor = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-12d3fd12"]]);
+const TitleEditor = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-12d3fd12"]]);
const useSearchBoxStore = defineStore("searchBox", () => {
const visible = ref(false);
function toggleVisible() {
@@ -2873,10 +2890,10 @@ function _toPrimitive$4(t, r) {
return ("string" === r ? String : Number)(t);
}
__name(_toPrimitive$4, "_toPrimitive$4");
-var _hoisted_1$h = ["aria-activedescendant"];
+var _hoisted_1$k = ["aria-activedescendant"];
var _hoisted_2$e = ["id", "aria-label", "aria-setsize", "aria-posinset"];
-var _hoisted_3$c = ["id", "placeholder", "tabindex", "disabled", "aria-label", "aria-labelledby", "aria-expanded", "aria-controls", "aria-activedescendant", "aria-invalid"];
-var _hoisted_4$4 = ["disabled", "aria-expanded", "aria-controls"];
+var _hoisted_3$d = ["id", "placeholder", "tabindex", "disabled", "aria-label", "aria-labelledby", "aria-expanded", "aria-controls", "aria-activedescendant", "aria-invalid"];
+var _hoisted_4$5 = ["disabled", "aria-expanded", "aria-controls"];
var _hoisted_5$3 = ["id"];
var _hoisted_6$2 = ["id", "aria-label"];
var _hoisted_7$1 = ["id"];
@@ -3024,7 +3041,7 @@ function render$c(_ctx, _cache, $props, $setup, $data, $options) {
onChange: _cache[4] || (_cache[4] = function() {
return $options.onChange && $options.onChange.apply($options, arguments);
})
- }, _ctx.ptm("input")), null, 16, _hoisted_3$c)], 16)], 16, _hoisted_1$h)) : createCommentVNode("", true), $data.searching || _ctx.loading ? renderSlot(_ctx.$slots, _ctx.$slots.loader ? "loader" : "loadingicon", {
+ }, _ctx.ptm("input")), null, 16, _hoisted_3$d)], 16)], 16, _hoisted_1$k)) : createCommentVNode("", true), $data.searching || _ctx.loading ? renderSlot(_ctx.$slots, _ctx.$slots.loader ? "loader" : "loadingicon", {
key: 2,
"class": normalizeClass(_ctx.cx("loader"))
}, function() {
@@ -3061,7 +3078,7 @@ function render$c(_ctx, _cache, $props, $setup, $data, $options) {
return [(openBlock(), createBlock(resolveDynamicComponent(_ctx.dropdownIcon ? "span" : "ChevronDownIcon"), mergeProps({
"class": _ctx.dropdownIcon
}, _ctx.ptm("dropdownIcon")), null, 16, ["class"]))];
- })], 16, _hoisted_4$4)) : createCommentVNode("", true)];
+ })], 16, _hoisted_4$5)) : createCommentVNode("", true)];
}), createBaseVNode("span", mergeProps({
role: "status",
"aria-live": "polite",
@@ -3206,7 +3223,7 @@ function render$c(_ctx, _cache, $props, $setup, $data, $options) {
}
__name(render$c, "render$c");
script$7.render = render$c;
-const _sfc_main$j = {
+const _sfc_main$k = {
name: "AutoCompletePlus",
extends: script$7,
emits: ["focused-option-changed"],
@@ -3222,23 +3239,23 @@ const _sfc_main$j = {
);
}
};
-const _withScopeId$5 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-5741c9ae"), n = n(), popScopeId(), n), "_withScopeId$5");
-const _hoisted_1$g = { class: "option-container flex justify-between items-center px-2 py-0 cursor-pointer overflow-hidden w-full" };
+const _withScopeId$8 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-fd0a74bd"), n = n(), popScopeId(), n), "_withScopeId$8");
+const _hoisted_1$j = { class: "option-container flex justify-between items-center px-2 py-0 cursor-pointer overflow-hidden w-full" };
const _hoisted_2$d = { class: "option-display-name font-semibold flex flex-col" };
-const _hoisted_3$b = { key: 0 };
-const _hoisted_4$3 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ createBaseVNode("i", { class: "pi pi-bookmark-fill text-sm mr-1" }, null, -1));
+const _hoisted_3$c = { key: 0 };
+const _hoisted_4$4 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ createBaseVNode("i", { class: "pi pi-bookmark-fill text-sm mr-1" }, null, -1));
const _hoisted_5$2 = [
- _hoisted_4$3
+ _hoisted_4$4
];
const _hoisted_6$1 = ["innerHTML"];
-const _hoisted_7 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ createBaseVNode("span", null, " ", -1));
+const _hoisted_7 = /* @__PURE__ */ _withScopeId$8(() => /* @__PURE__ */ createBaseVNode("span", null, " ", -1));
const _hoisted_8 = ["innerHTML"];
const _hoisted_9 = {
key: 0,
- class: "option-category font-light text-sm text-gray-400 overflow-hidden text-ellipsis whitespace-nowrap"
+ class: "option-category font-light text-sm text-muted overflow-hidden text-ellipsis whitespace-nowrap"
};
const _hoisted_10 = { class: "option-badges" };
-const _sfc_main$i = /* @__PURE__ */ defineComponent({
+const _sfc_main$j = /* @__PURE__ */ defineComponent({
__name: "NodeSearchItem",
props: {
nodeDef: {},
@@ -3265,10 +3282,10 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
);
const props = __props;
return (_ctx, _cache) => {
- return openBlock(), createElementBlock("div", _hoisted_1$g, [
+ return openBlock(), createElementBlock("div", _hoisted_1$j, [
createBaseVNode("div", _hoisted_2$d, [
createBaseVNode("div", null, [
- isBookmarked.value ? (openBlock(), createElementBlock("span", _hoisted_3$b, _hoisted_5$2)) : createCommentVNode("", true),
+ isBookmarked.value ? (openBlock(), createElementBlock("span", _hoisted_3$c, _hoisted_5$2)) : createCommentVNode("", true),
createBaseVNode("span", {
innerHTML: unref(highlightQuery)(_ctx.nodeDef.display_name, _ctx.currentQuery)
}, null, 8, _hoisted_6$1),
@@ -3317,15 +3334,15 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
};
}
});
-const NodeSearchItem = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-5741c9ae"]]);
-const _hoisted_1$f = { class: "comfy-vue-node-search-container flex justify-center items-center w-full min-w-96 pointer-events-auto" };
+const NodeSearchItem = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-fd0a74bd"]]);
+const _hoisted_1$i = { class: "comfy-vue-node-search-container flex justify-center items-center w-full min-w-96 pointer-events-auto" };
const _hoisted_2$c = {
key: 0,
class: "comfy-vue-node-preview-container absolute left-[-350px] top-[50px]"
};
-const _hoisted_3$a = /* @__PURE__ */ createBaseVNode("h3", null, "Add node filter condition", -1);
-const _hoisted_4$2 = { class: "_dialog-body" };
-const _sfc_main$h = /* @__PURE__ */ defineComponent({
+const _hoisted_3$b = /* @__PURE__ */ createBaseVNode("h3", null, "Add node filter condition", -1);
+const _hoisted_4$3 = { class: "_dialog-body" };
+const _sfc_main$i = /* @__PURE__ */ defineComponent({
__name: "NodeSearchBox",
props: {
filters: {},
@@ -3371,7 +3388,6 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
const onAddFilter = /* @__PURE__ */ __name((filterAndValue) => {
nodeSearchFilterVisible.value = false;
emit("addFilter", filterAndValue);
- reFocusInput();
}, "onAddFilter");
const onRemoveFilter = /* @__PURE__ */ __name((event, filterAndValue) => {
event.stopPropagation();
@@ -3388,7 +3404,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
hoveredSuggestion.value = value;
}, "setHoverSuggestion");
return (_ctx, _cache) => {
- return openBlock(), createElementBlock("div", _hoisted_1$f, [
+ return openBlock(), createElementBlock("div", _hoisted_1$i, [
enableNodePreview.value ? (openBlock(), createElementBlock("div", _hoisted_2$c, [
hoveredSuggestion.value ? (openBlock(), createBlock(NodePreview, {
nodeDef: hoveredSuggestion.value,
@@ -3404,19 +3420,22 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
createVNode(unref(script$p), {
visible: nodeSearchFilterVisible.value,
"onUpdate:visible": _cache[1] || (_cache[1] = ($event) => nodeSearchFilterVisible.value = $event),
- class: "min-w-96"
+ class: "min-w-96",
+ "dismissable-mask": "",
+ modal: "",
+ onHide: reFocusInput
}, {
header: withCtx(() => [
- _hoisted_3$a
+ _hoisted_3$b
]),
default: withCtx(() => [
- createBaseVNode("div", _hoisted_4$2, [
+ createBaseVNode("div", _hoisted_4$3, [
createVNode(NodeSearchFilter, { onAddFilter })
])
]),
_: 1
}, 8, ["visible"]),
- createVNode(_sfc_main$j, {
+ createVNode(_sfc_main$k, {
"model-value": props.filters,
class: "comfy-vue-node-search-box z-10 flex-grow",
scrollHeight: "40vh",
@@ -3457,7 +3476,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
};
}
});
-const _sfc_main$g = /* @__PURE__ */ defineComponent({
+const _sfc_main$h = /* @__PURE__ */ defineComponent({
__name: "NodeSearchBoxPopover",
setup(__props) {
const settingStore = useSettingStore();
@@ -3638,7 +3657,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
}
}, {
container: withCtx(() => [
- createVNode(_sfc_main$h, {
+ createVNode(_sfc_main$i, {
filters: nodeFilters.value,
onAddFilter: addFilter,
onRemoveFilter: removeFilter,
@@ -3692,7 +3711,7 @@ function render$b(_ctx, _cache, $props, $setup, $data, $options) {
}
__name(render$b, "render$b");
script$6.render = render$b;
-const _sfc_main$f = /* @__PURE__ */ defineComponent({
+const _sfc_main$g = /* @__PURE__ */ defineComponent({
__name: "SidebarIcon",
props: {
icon: String,
@@ -3754,8 +3773,8 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
};
}
});
-const SidebarIcon = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-6ab4daa6"]]);
-const _sfc_main$e = /* @__PURE__ */ defineComponent({
+const SidebarIcon = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-6ab4daa6"]]);
+const _sfc_main$f = /* @__PURE__ */ defineComponent({
__name: "SidebarLogoutIcon",
setup(__props) {
const { t } = useI18n();
@@ -3776,7 +3795,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
};
}
});
-const _sfc_main$d = /* @__PURE__ */ defineComponent({
+const _sfc_main$e = /* @__PURE__ */ defineComponent({
__name: "SidebarSettingsToggleIcon",
setup(__props) {
const dialogStore = useDialogStore();
@@ -3797,13 +3816,12 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
};
}
});
-const _sfc_main$c = /* @__PURE__ */ defineComponent({
+const _sfc_main$d = /* @__PURE__ */ defineComponent({
__name: "SidebarThemeToggleIcon",
setup(__props) {
- const settingStore = useSettingStore();
- const currentTheme = computed(() => settingStore.get("Comfy.ColorPalette"));
+ const colorPaletteStore = useColorPaletteStore();
const icon = computed(
- () => currentTheme.value !== "light" ? "pi pi-moon" : "pi pi-sun"
+ () => colorPaletteStore.completedActivePalette.light_theme ? "pi pi-sun" : "pi pi-moon"
);
const commandStore = useCommandStore();
const toggleTheme = /* @__PURE__ */ __name(() => {
@@ -3819,13 +3837,13 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
};
}
});
-const _withScopeId$4 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-37d8d7b4"), n = n(), popScopeId(), n), "_withScopeId$4");
-const _hoisted_1$e = { class: "side-tool-bar-end" };
+const _withScopeId$7 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-33cac83a"), n = n(), popScopeId(), n), "_withScopeId$7");
+const _hoisted_1$h = { class: "side-tool-bar-end" };
const _hoisted_2$b = {
key: 0,
class: "sidebar-content-container h-full overflow-y-auto overflow-x-hidden"
};
-const _sfc_main$b = /* @__PURE__ */ defineComponent({
+const _sfc_main$c = /* @__PURE__ */ defineComponent({
__name: "SideToolbar",
setup(__props) {
const workspaceStore = useWorkspaceStore();
@@ -3853,7 +3871,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
return openBlock(), createElementBlock(Fragment, null, [
(openBlock(), createBlock(Teleport, { to: teleportTarget.value }, [
createBaseVNode("nav", {
- class: normalizeClass("side-tool-bar-container" + (isSmall.value ? " small-sidebar" : ""))
+ class: normalizeClass(["side-tool-bar-container", { "small-sidebar": isSmall.value }])
}, [
(openBlock(true), createElementBlock(Fragment, null, renderList(tabs.value, (tab) => {
return openBlock(), createBlock(SidebarIcon, {
@@ -3866,21 +3884,277 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
onClick: /* @__PURE__ */ __name(($event) => onTabClick(tab), "onClick")
}, null, 8, ["icon", "iconBadge", "tooltip", "selected", "class", "onClick"]);
}), 128)),
- createBaseVNode("div", _hoisted_1$e, [
- unref(userStore).isMultiUserServer ? (openBlock(), createBlock(_sfc_main$e, { key: 0 })) : createCommentVNode("", true),
- createVNode(_sfc_main$c),
- createVNode(_sfc_main$d)
+ createBaseVNode("div", _hoisted_1$h, [
+ unref(userStore).isMultiUserServer ? (openBlock(), createBlock(_sfc_main$f, { key: 0 })) : createCommentVNode("", true),
+ createVNode(_sfc_main$d),
+ createVNode(_sfc_main$e)
])
], 2)
], 8, ["to"])),
selectedTab.value ? (openBlock(), createElementBlock("div", _hoisted_2$b, [
- createVNode(_sfc_main$p, { extension: selectedTab.value }, null, 8, ["extension"])
+ createVNode(_sfc_main$q, { extension: selectedTab.value }, null, 8, ["extension"])
])) : createCommentVNode("", true)
], 64);
};
}
});
-const SideToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-37d8d7b4"]]);
+const SideToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-33cac83a"]]);
+const _withScopeId$6 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-8d011a31"), n = n(), popScopeId(), n), "_withScopeId$6");
+const _hoisted_1$g = { class: "workflow-label text-sm max-w-[150px] truncate inline-block" };
+const _hoisted_2$a = { class: "relative" };
+const _hoisted_3$a = {
+ key: 0,
+ class: "status-indicator"
+};
+const _sfc_main$b = /* @__PURE__ */ defineComponent({
+ __name: "WorkflowTab",
+ props: {
+ class: {},
+ workflowOption: {}
+ },
+ setup(__props) {
+ const props = __props;
+ const workspaceStore = useWorkspaceStore();
+ const workflowStore = useWorkflowStore();
+ const workflowTabRef = ref(null);
+ const closeWorkflows = /* @__PURE__ */ __name(async (options) => {
+ for (const opt of options) {
+ if (!await useWorkflowService().closeWorkflow(opt.workflow, {
+ warnIfUnsaved: !workspaceStore.shiftDown
+ })) {
+ break;
+ }
+ }
+ }, "closeWorkflows");
+ const onCloseWorkflow = /* @__PURE__ */ __name((option2) => {
+ closeWorkflows([option2]);
+ }, "onCloseWorkflow");
+ const tabGetter = /* @__PURE__ */ __name(() => workflowTabRef.value, "tabGetter");
+ usePragmaticDraggable(tabGetter, {
+ getInitialData: /* @__PURE__ */ __name(() => {
+ return {
+ workflowKey: props.workflowOption.workflow.key
+ };
+ }, "getInitialData")
+ });
+ usePragmaticDroppable(tabGetter, {
+ getData: /* @__PURE__ */ __name(() => {
+ return {
+ workflowKey: props.workflowOption.workflow.key
+ };
+ }, "getData"),
+ onDrop: /* @__PURE__ */ __name((e) => {
+ const fromIndex = workflowStore.openWorkflows.findIndex(
+ (wf) => wf.key === e.source.data.workflowKey
+ );
+ const toIndex = workflowStore.openWorkflows.findIndex(
+ (wf) => wf.key === e.location.current.dropTargets[0]?.data.workflowKey
+ );
+ if (fromIndex !== toIndex) {
+ workflowStore.reorderWorkflows(fromIndex, toIndex);
+ }
+ }, "onDrop")
+ });
+ return (_ctx, _cache) => {
+ const _directive_tooltip = resolveDirective("tooltip");
+ return openBlock(), createElementBlock("div", mergeProps({
+ class: "flex p-2 gap-2 workflow-tab",
+ ref_key: "workflowTabRef",
+ ref: workflowTabRef
+ }, _ctx.$attrs), [
+ withDirectives((openBlock(), createElementBlock("span", _hoisted_1$g, [
+ createTextVNode(toDisplayString(_ctx.workflowOption.workflow.filename), 1)
+ ])), [
+ [
+ _directive_tooltip,
+ _ctx.workflowOption.workflow.key,
+ void 0,
+ { bottom: true }
+ ]
+ ]),
+ createBaseVNode("div", _hoisted_2$a, [
+ !unref(workspaceStore).shiftDown && (_ctx.workflowOption.workflow.isModified || !_ctx.workflowOption.workflow.isPersisted) ? (openBlock(), createElementBlock("span", _hoisted_3$a, "•")) : createCommentVNode("", true),
+ createVNode(unref(script$d), {
+ class: "close-button p-0 w-auto",
+ icon: "pi pi-times",
+ text: "",
+ severity: "secondary",
+ size: "small",
+ onClick: _cache[0] || (_cache[0] = withModifiers(($event) => onCloseWorkflow(_ctx.workflowOption), ["stop"]))
+ })
+ ])
+ ], 16);
+ };
+ }
+});
+const WorkflowTab = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-8d011a31"]]);
+const _withScopeId$5 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-54fadc45"), n = n(), popScopeId(), n), "_withScopeId$5");
+const _hoisted_1$f = { class: "workflow-tabs-container flex flex-row max-w-full h-full" };
+const _sfc_main$a = /* @__PURE__ */ defineComponent({
+ __name: "WorkflowTabs",
+ props: {
+ class: {}
+ },
+ setup(__props) {
+ const props = __props;
+ const { t } = useI18n();
+ const workspaceStore = useWorkspaceStore();
+ const workflowStore = useWorkflowStore();
+ const workflowService = useWorkflowService();
+ const workflowBookmarkStore = useWorkflowBookmarkStore();
+ const rightClickedTab = ref(null);
+ const menu = ref();
+ const workflowToOption = /* @__PURE__ */ __name((workflow) => ({
+ value: workflow.path,
+ workflow
+ }), "workflowToOption");
+ const options = computed(
+ () => workflowStore.openWorkflows.map(workflowToOption)
+ );
+ const selectedWorkflow = computed(
+ () => workflowStore.activeWorkflow ? workflowToOption(workflowStore.activeWorkflow) : null
+ );
+ const onWorkflowChange = /* @__PURE__ */ __name((option2) => {
+ if (!option2) {
+ return;
+ }
+ if (selectedWorkflow.value?.value === option2.value) {
+ return;
+ }
+ workflowService.openWorkflow(option2.workflow);
+ }, "onWorkflowChange");
+ const closeWorkflows = /* @__PURE__ */ __name(async (options2) => {
+ for (const opt of options2) {
+ if (!await workflowService.closeWorkflow(opt.workflow, {
+ warnIfUnsaved: !workspaceStore.shiftDown
+ })) {
+ break;
+ }
+ }
+ }, "closeWorkflows");
+ const onCloseWorkflow = /* @__PURE__ */ __name((option2) => {
+ closeWorkflows([option2]);
+ }, "onCloseWorkflow");
+ const showContextMenu = /* @__PURE__ */ __name((event, option2) => {
+ rightClickedTab.value = option2;
+ menu.value.show(event);
+ }, "showContextMenu");
+ const contextMenuItems = computed(() => {
+ const tab = rightClickedTab.value;
+ if (!tab) return [];
+ const index = options.value.findIndex((v) => v.workflow === tab.workflow);
+ return [
+ {
+ label: t("tabMenu.duplicateTab"),
+ command: /* @__PURE__ */ __name(() => {
+ workflowService.duplicateWorkflow(tab.workflow);
+ }, "command")
+ },
+ {
+ separator: true
+ },
+ {
+ label: t("tabMenu.closeTab"),
+ command: /* @__PURE__ */ __name(() => onCloseWorkflow(tab), "command")
+ },
+ {
+ label: t("tabMenu.closeTabsToLeft"),
+ command: /* @__PURE__ */ __name(() => closeWorkflows(options.value.slice(0, index)), "command"),
+ disabled: index <= 0
+ },
+ {
+ label: t("tabMenu.closeTabsToRight"),
+ command: /* @__PURE__ */ __name(() => closeWorkflows(options.value.slice(index + 1)), "command"),
+ disabled: index === options.value.length - 1
+ },
+ {
+ label: t("tabMenu.closeOtherTabs"),
+ command: /* @__PURE__ */ __name(() => closeWorkflows([
+ ...options.value.slice(index + 1),
+ ...options.value.slice(0, index)
+ ]), "command"),
+ disabled: options.value.length <= 1
+ },
+ {
+ label: workflowBookmarkStore.isBookmarked(tab.workflow.path) ? t("tabMenu.removeFromBookmarks") : t("tabMenu.addToBookmarks"),
+ command: /* @__PURE__ */ __name(() => workflowBookmarkStore.toggleBookmarked(tab.workflow.path), "command"),
+ disabled: tab.workflow.isTemporary
+ }
+ ];
+ });
+ const commandStore = useCommandStore();
+ const handleWheel = /* @__PURE__ */ __name((event) => {
+ const scrollElement = event.currentTarget;
+ const scrollAmount = event.deltaX || event.deltaY;
+ scrollElement.scroll({
+ left: scrollElement.scrollLeft + scrollAmount
+ });
+ }, "handleWheel");
+ return (_ctx, _cache) => {
+ const _directive_tooltip = resolveDirective("tooltip");
+ return openBlock(), createElementBlock("div", _hoisted_1$f, [
+ createVNode(unref(script$s), {
+ class: "overflow-hidden no-drag",
+ "pt:content": {
+ class: "p-0 w-full",
+ onwheel: handleWheel
+ },
+ "pt:barX": "h-1"
+ }, {
+ default: withCtx(() => [
+ createVNode(unref(script$r), {
+ class: normalizeClass(["workflow-tabs bg-transparent", props.class]),
+ modelValue: selectedWorkflow.value,
+ "onUpdate:modelValue": onWorkflowChange,
+ options: options.value,
+ optionLabel: "label",
+ dataKey: "value"
+ }, {
+ option: withCtx(({ option: option2 }) => [
+ createVNode(WorkflowTab, {
+ onContextmenu: /* @__PURE__ */ __name(($event) => showContextMenu($event, option2), "onContextmenu"),
+ onMouseup: withModifiers(($event) => onCloseWorkflow(option2), ["middle"]),
+ "workflow-option": option2
+ }, null, 8, ["onContextmenu", "onMouseup", "workflow-option"])
+ ]),
+ _: 1
+ }, 8, ["class", "modelValue", "options"])
+ ]),
+ _: 1
+ }, 8, ["pt:content"]),
+ withDirectives(createVNode(unref(script$d), {
+ class: "new-blank-workflow-button flex-shrink-0 no-drag",
+ icon: "pi pi-plus",
+ text: "",
+ severity: "secondary",
+ "aria-label": _ctx.$t("sideToolbar.newBlankWorkflow"),
+ onClick: _cache[0] || (_cache[0] = () => unref(commandStore).execute("Comfy.NewBlankWorkflow"))
+ }, null, 8, ["aria-label"]), [
+ [_directive_tooltip, { value: _ctx.$t("sideToolbar.newBlankWorkflow"), showDelay: 300 }]
+ ]),
+ createVNode(unref(script$t), {
+ ref_key: "menu",
+ ref: menu,
+ model: contextMenuItems.value
+ }, null, 8, ["model"])
+ ]);
+ };
+ }
+});
+const WorkflowTabs = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-54fadc45"]]);
+const _withScopeId$4 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-38831d8e"), n = n(), popScopeId(), n), "_withScopeId$4");
+const _hoisted_1$e = { class: "absolute top-0 left-0 w-auto max-w-full pointer-events-auto" };
+const _sfc_main$9 = /* @__PURE__ */ defineComponent({
+ __name: "SecondRowWorkflowTabs",
+ setup(__props) {
+ return (_ctx, _cache) => {
+ return openBlock(), createElementBlock("div", _hoisted_1$e, [
+ createVNode(WorkflowTabs)
+ ]);
+ };
+ }
+});
+const SecondRowWorkflowTabs = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-38831d8e"]]);
const CORE_SETTINGS = [
{
id: "Comfy.Validation.Workflows",
@@ -3959,7 +4233,8 @@ const CORE_SETTINGS = [
name: "Sidebar size",
type: "combo",
options: ["normal", "small"],
- defaultValue: /* @__PURE__ */ __name(() => window.innerWidth < 1600 ? "small" : "normal", "defaultValue")
+ // Default to small if the window is less than 1536px(2xl) wide.
+ defaultValue: /* @__PURE__ */ __name(() => window.innerWidth < 1536 ? "small" : "normal", "defaultValue")
},
{
id: "Comfy.TextareaWidget.FontSize",
@@ -4101,7 +4376,8 @@ const CORE_SETTINGS = [
id: "Comfy.Window.UnloadConfirmation",
name: "Show confirmation when closing window",
type: "boolean",
- defaultValue: false
+ defaultValue: true,
+ versionModified: "1.7.12"
},
{
id: "Comfy.TreeExplorer.ItemPadding",
@@ -4266,8 +4542,9 @@ const CORE_SETTINGS = [
id: "Comfy.Workflow.WorkflowTabsPosition",
name: "Opened workflows position",
type: "combo",
- options: ["Sidebar", "Topbar"],
- defaultValue: "Topbar"
+ options: ["Sidebar", "Topbar", "Topbar (2nd-row)"],
+ // Default to topbar (2nd-row) if the window is less than 1536px(2xl) wide.
+ defaultValue: /* @__PURE__ */ __name(() => window.innerWidth < 1536 ? "Topbar (2nd-row)" : "Topbar", "defaultValue")
},
{
id: "Comfy.Graph.CanvasMenu",
@@ -4289,9 +4566,18 @@ const CORE_SETTINGS = [
name: "Keybindings unset by the user",
type: "hidden",
defaultValue: [],
- versionAdded: "1.3.7"
- },
- {
+ versionAdded: "1.3.7",
+ versionModified: "1.7.3",
+ migrateDeprecatedValue: /* @__PURE__ */ __name((value) => {
+ return value.map((keybinding) => {
+ if (keybinding["targetSelector"] === "#graph-canvas") {
+ keybinding["targetElementId"] = "graph-canvas";
+ }
+ return keybinding;
+ });
+ }, "migrateDeprecatedValue")
+ },
+ {
id: "Comfy.Keybinding.NewBindings",
name: "Keybindings set by the user",
type: "hidden",
@@ -4550,7 +4836,7 @@ const CORE_SETTINGS = [
versionModified: "1.6.10"
}
];
-const _sfc_main$a = /* @__PURE__ */ defineComponent({
+const _sfc_main$8 = /* @__PURE__ */ defineComponent({
__name: "GraphCanvas",
emits: ["ready"],
setup(__props, { emit: __emit }) {
@@ -4565,10 +4851,31 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
const betaMenuEnabled = computed(
() => settingStore.get("Comfy.UseNewMenu") !== "Disabled"
);
+ const workflowTabsPosition = computed(
+ () => settingStore.get("Comfy.Workflow.WorkflowTabsPosition")
+ );
const canvasMenuEnabled = computed(
() => settingStore.get("Comfy.Graph.CanvasMenu")
);
const tooltipEnabled = computed(() => settingStore.get("Comfy.EnableTooltips"));
+ const storedWorkflows = JSON.parse(
+ getStorageValue("Comfy.OpenWorkflowsPaths") || "[]"
+ );
+ const storedActiveIndex = JSON.parse(
+ getStorageValue("Comfy.ActiveWorkflowIndex") || "-1"
+ );
+ const openWorkflows = computed(() => workspaceStore?.workflow?.openWorkflows);
+ const activeWorkflow = computed(() => workspaceStore?.workflow?.activeWorkflow);
+ const restoreState2 = computed(() => {
+ if (!openWorkflows.value || !activeWorkflow.value) {
+ return { paths: [], activeIndex: -1 };
+ }
+ const paths = openWorkflows.value.filter((workflow) => workflow?.isPersisted && !workflow.isModified).map((workflow) => workflow.path);
+ const activeIndex = openWorkflows.value.findIndex(
+ (workflow) => workflow.path === activeWorkflow.value?.path
+ );
+ return { paths, activeIndex };
+ });
watchEffect(() => {
const canvasInfoEnabled = settingStore.get("Comfy.Graph.CanvasInfo");
if (canvasStore.canvas) {
@@ -4799,6 +5106,16 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
colorPaletteStore.customPalettes = settingStore.get(
"Comfy.CustomColorPalettes"
);
+ const isRestorable = storedWorkflows?.length > 0 && storedActiveIndex >= 0;
+ if (isRestorable)
+ workflowStore.openWorkflowsInBackground({
+ left: storedWorkflows.slice(0, storedActiveIndex),
+ right: storedWorkflows.slice(storedActiveIndex)
+ });
+ watch(restoreState2, ({ paths, activeIndex }) => {
+ setStorageValue("Comfy.OpenWorkflowsPaths", JSON.stringify(paths));
+ setStorageValue("Comfy.ActiveWorkflowIndex", JSON.stringify(activeIndex));
+ });
watch(
() => settingStore.get("Comfy.Locale"),
async () => {
@@ -4816,10 +5133,11 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
createVNode(SideToolbar)
]),
"bottom-panel": withCtx(() => [
- createVNode(_sfc_main$o)
+ createVNode(_sfc_main$p)
]),
"graph-canvas-panel": withCtx(() => [
- canvasMenuEnabled.value ? (openBlock(), createBlock(GraphCanvasMenu, { key: 0 })) : createCommentVNode("", true)
+ workflowTabsPosition.value === "Topbar (2nd-row)" ? (openBlock(), createBlock(SecondRowWorkflowTabs, { key: 0 })) : createCommentVNode("", true),
+ canvasMenuEnabled.value ? (openBlock(), createBlock(GraphCanvasMenu, { key: 1 })) : createCommentVNode("", true)
]),
_: 1
})) : createCommentVNode("", true),
@@ -4832,9 +5150,9 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
tabindex: "1"
}, null, 512)
])),
- createVNode(_sfc_main$g),
+ createVNode(_sfc_main$h),
tooltipEnabled.value ? (openBlock(), createBlock(NodeTooltip, { key: 0 })) : createCommentVNode("", true),
- createVNode(_sfc_main$m)
+ createVNode(_sfc_main$n)
], 64);
};
}
@@ -5049,10 +5367,10 @@ var script$1$3 = {
computed: {
iconComponent: /* @__PURE__ */ __name(function iconComponent() {
return {
- info: !this.infoIcon && script$r,
- success: !this.successIcon && script$s,
- warn: !this.warnIcon && script$t,
- error: !this.errorIcon && script$u
+ info: !this.infoIcon && script$u,
+ success: !this.successIcon && script$v,
+ warn: !this.warnIcon && script$w,
+ error: !this.errorIcon && script$x
}[this.message.severity];
}, "iconComponent"),
closeAriaLabel: /* @__PURE__ */ __name(function closeAriaLabel() {
@@ -5060,11 +5378,11 @@ var script$1$3 = {
}, "closeAriaLabel")
},
components: {
- TimesIcon: script$v,
- InfoCircleIcon: script$r,
- CheckIcon: script$s,
- ExclamationTriangleIcon: script$t,
- TimesCircleIcon: script$u
+ TimesIcon: script$y,
+ InfoCircleIcon: script$u,
+ CheckIcon: script$v,
+ ExclamationTriangleIcon: script$w,
+ TimesCircleIcon: script$x
},
directives: {
ripple: Ripple
@@ -5410,7 +5728,7 @@ function render$a(_ctx, _cache, $props, $setup, $data, $options) {
}
__name(render$a, "render$a");
script$5.render = render$a;
-const _sfc_main$9 = /* @__PURE__ */ defineComponent({
+const _sfc_main$7 = /* @__PURE__ */ defineComponent({
__name: "GlobalToast",
setup(__props) {
const toast = useToast();
@@ -5489,7 +5807,7 @@ const _hoisted_1$c = {
width: "1.2em",
height: "1.2em"
};
-const _hoisted_2$a = /* @__PURE__ */ createBaseVNode("path", {
+const _hoisted_2$9 = /* @__PURE__ */ createBaseVNode("path", {
fill: "none",
stroke: "currentColor",
"stroke-linecap": "round",
@@ -5498,7 +5816,7 @@ const _hoisted_2$a = /* @__PURE__ */ createBaseVNode("path", {
d: "M6 4v16m4-16l10 8l-10 8z"
}, null, -1);
const _hoisted_3$9 = [
- _hoisted_2$a
+ _hoisted_2$9
];
function render$9(_ctx, _cache) {
return openBlock(), createElementBlock("svg", _hoisted_1$c, [..._hoisted_3$9]);
@@ -5510,7 +5828,7 @@ const _hoisted_1$b = {
width: "1.2em",
height: "1.2em"
};
-const _hoisted_2$9 = /* @__PURE__ */ createBaseVNode("path", {
+const _hoisted_2$8 = /* @__PURE__ */ createBaseVNode("path", {
fill: "none",
stroke: "currentColor",
"stroke-linecap": "round",
@@ -5519,7 +5837,7 @@ const _hoisted_2$9 = /* @__PURE__ */ createBaseVNode("path", {
d: "m13 19l9-7l-9-7zM2 19l9-7l-9-7z"
}, null, -1);
const _hoisted_3$8 = [
- _hoisted_2$9
+ _hoisted_2$8
];
function render$8(_ctx, _cache) {
return openBlock(), createElementBlock("svg", _hoisted_1$b, [..._hoisted_3$8]);
@@ -5531,7 +5849,7 @@ const _hoisted_1$a = {
width: "1.2em",
height: "1.2em"
};
-const _hoisted_2$8 = /* @__PURE__ */ createBaseVNode("path", {
+const _hoisted_2$7 = /* @__PURE__ */ createBaseVNode("path", {
fill: "none",
stroke: "currentColor",
"stroke-linecap": "round",
@@ -5540,7 +5858,7 @@ const _hoisted_2$8 = /* @__PURE__ */ createBaseVNode("path", {
d: "m6 3l14 9l-14 9z"
}, null, -1);
const _hoisted_3$7 = [
- _hoisted_2$8
+ _hoisted_2$7
];
function render$7(_ctx, _cache) {
return openBlock(), createElementBlock("svg", _hoisted_1$a, [..._hoisted_3$7]);
@@ -5552,7 +5870,7 @@ const _hoisted_1$9 = {
width: "1.2em",
height: "1.2em"
};
-const _hoisted_2$7 = /* @__PURE__ */ createBaseVNode("g", {
+const _hoisted_2$6 = /* @__PURE__ */ createBaseVNode("g", {
fill: "none",
stroke: "currentColor",
"stroke-linecap": "round",
@@ -5563,7 +5881,7 @@ const _hoisted_2$7 = /* @__PURE__ */ createBaseVNode("g", {
/* @__PURE__ */ createBaseVNode("path", { d: "m16 8l-2-2l2-2" })
], -1);
const _hoisted_3$6 = [
- _hoisted_2$7
+ _hoisted_2$6
];
function render$6(_ctx, _cache) {
return openBlock(), createElementBlock("svg", _hoisted_1$9, [..._hoisted_3$6]);
@@ -5809,16 +6127,16 @@ var script$1$2 = {
}, "containerRef")
},
components: {
- AngleRightIcon: script$w
+ AngleRightIcon: script$z
},
directives: {
ripple: Ripple
}
};
var _hoisted_1$1$2 = ["tabindex"];
-var _hoisted_2$6 = ["id", "aria-label", "aria-disabled", "aria-expanded", "aria-haspopup", "aria-level", "aria-setsize", "aria-posinset", "data-p-active", "data-p-focused", "data-p-disabled"];
+var _hoisted_2$5 = ["id", "aria-label", "aria-disabled", "aria-expanded", "aria-haspopup", "aria-level", "aria-setsize", "aria-posinset", "data-p-active", "data-p-focused", "data-p-disabled"];
var _hoisted_3$5 = ["onClick", "onMouseenter", "onMousemove"];
-var _hoisted_4$1 = ["href", "target"];
+var _hoisted_4$2 = ["href", "target"];
var _hoisted_5$1 = ["id"];
var _hoisted_6 = ["id"];
function render$1$1(_ctx, _cache, $props, $setup, $data, $options) {
@@ -5900,7 +6218,7 @@ function render$1$1(_ctx, _cache, $props, $setup, $data, $options) {
key: 1,
"class": _ctx.cx("submenuIcon"),
ref_for: true
- }, $options.getPTOptions(processedItem, index, "submenuIcon")), null, 16, ["class"]))], 64)) : createCommentVNode("", true)], 16, _hoisted_4$1)), [[_directive_ripple]]) : (openBlock(), createBlock(resolveDynamicComponent($props.templates.item), {
+ }, $options.getPTOptions(processedItem, index, "submenuIcon")), null, 16, ["class"]))], 64)) : createCommentVNode("", true)], 16, _hoisted_4$2)), [[_directive_ripple]]) : (openBlock(), createBlock(resolveDynamicComponent($props.templates.item), {
key: 1,
item: processedItem.item,
hasSubmenu: $options.getItemProp(processedItem, "items"),
@@ -5932,7 +6250,7 @@ function render$1$1(_ctx, _cache, $props, $setup, $data, $options) {
onItemMousemove: _cache[2] || (_cache[2] = function($event) {
return _ctx.$emit("item-mousemove", $event);
})
- }, null, 8, ["id", "style", "aria-labelledby", "menuId", "focusedItemId", "items", "templates", "activeItemPath", "level", "visible", "pt", "unstyled"])) : createCommentVNode("", true)], 16, _hoisted_2$6)) : createCommentVNode("", true), $options.isItemVisible(processedItem) && $options.getItemProp(processedItem, "separator") ? (openBlock(), createElementBlock("li", mergeProps({
+ }, null, 8, ["id", "style", "aria-labelledby", "menuId", "focusedItemId", "items", "templates", "activeItemPath", "level", "visible", "pt", "unstyled"])) : createCommentVNode("", true)], 16, _hoisted_2$5)) : createCommentVNode("", true), $options.isItemVisible(processedItem) && $options.getItemProp(processedItem, "separator") ? (openBlock(), createElementBlock("li", mergeProps({
key: 1,
id: $options.getItemId(processedItem),
style: $options.getItemProp(processedItem, "style"),
@@ -6910,8 +7228,10 @@ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
}
__name(render$4, "render$4");
script$3.render = render$4;
+const _withScopeId$3 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-26957f1f"), n = n(), popScopeId(), n), "_withScopeId$3");
+const _hoisted_1$6 = ["aria-label"];
const minQueueCount = 1;
-const _sfc_main$8 = /* @__PURE__ */ defineComponent({
+const _sfc_main$6 = /* @__PURE__ */ defineComponent({
__name: "BatchCountEdit",
props: {
class: { default: "" }
@@ -6938,9 +7258,10 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
return (_ctx, _cache) => {
const _directive_tooltip = resolveDirective("tooltip");
return withDirectives((openBlock(), createElementBlock("div", {
- class: normalizeClass(["batch-count", props.class])
+ class: normalizeClass(["batch-count", props.class]),
+ "aria-label": _ctx.$t("menu.batchCount")
}, [
- createVNode(unref(script$x), {
+ createVNode(unref(script$A), {
class: "w-14",
modelValue: unref(batchCount),
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(batchCount) ? batchCount.value = $event : null),
@@ -6963,7 +7284,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
}
}
}, null, 8, ["modelValue", "max", "pt"])
- ], 2)), [
+ ], 10, _hoisted_1$6)), [
[
_directive_tooltip,
_ctx.$t("menu.batchCount"),
@@ -6974,10 +7295,10 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
};
}
});
-const BatchCountEdit = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-b9328350"]]);
-const _withScopeId$3 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-7f4f551b"), n = n(), popScopeId(), n), "_withScopeId$3");
-const _hoisted_1$6 = { class: "queue-button-group flex" };
-const _sfc_main$7 = /* @__PURE__ */ defineComponent({
+const BatchCountEdit = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-26957f1f"]]);
+const _withScopeId$2 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-e9044686"), n = n(), popScopeId(), n), "_withScopeId$2");
+const _hoisted_1$5 = { class: "queue-button-group flex" };
+const _sfc_main$5 = /* @__PURE__ */ defineComponent({
__name: "ComfyQueueButton",
setup(__props) {
const workspaceStore = useWorkspaceStore();
@@ -7029,7 +7350,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
const _component_i_lucide58fast_forward = __unplugin_components_2;
const _component_i_lucide58step_forward = __unplugin_components_3;
const _directive_tooltip = resolveDirective("tooltip");
- return openBlock(), createElementBlock("div", _hoisted_1$6, [
+ return openBlock(), createElementBlock("div", _hoisted_1$5, [
withDirectives((openBlock(), createBlock(unref(script$3), {
class: "comfyui-queue-button",
label: activeQueueModeMenuItem.value.label,
@@ -7070,8 +7391,9 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
severity: executingPrompt.value ? "danger" : "secondary",
disabled: !executingPrompt.value,
text: "",
+ "aria-label": _ctx.$t("menu.interrupt"),
onClick: _cache[0] || (_cache[0] = () => unref(commandStore).execute("Comfy.Interrupt"))
- }, null, 8, ["severity", "disabled"]), [
+ }, null, 8, ["severity", "disabled", "aria-label"]), [
[
_directive_tooltip,
_ctx.$t("menu.interrupt"),
@@ -7084,8 +7406,9 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
severity: hasPendingTasks.value ? "danger" : "secondary",
disabled: !hasPendingTasks.value,
text: "",
+ "aria-label": _ctx.$t("sideToolbar.queueTab.clearPendingTasks"),
onClick: _cache[1] || (_cache[1] = () => unref(commandStore).execute("Comfy.ClearPendingTasks"))
- }, null, 8, ["severity", "disabled"]), [
+ }, null, 8, ["severity", "disabled", "aria-label"]), [
[
_directive_tooltip,
_ctx.$t("sideToolbar.queueTab.clearPendingTasks"),
@@ -7100,9 +7423,9 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
};
}
});
-const ComfyQueueButton = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-7f4f551b"]]);
+const ComfyQueueButton = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-e9044686"]]);
const overlapThreshold = 20;
-const _sfc_main$6 = /* @__PURE__ */ defineComponent({
+const _sfc_main$4 = /* @__PURE__ */ defineComponent({
__name: "ComfyActionbar",
setup(__props) {
const settingsStore = useSettingStore();
@@ -7251,7 +7574,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
});
});
return (_ctx, _cache) => {
- return openBlock(), createBlock(unref(script$y), {
+ return openBlock(), createBlock(unref(script$B), {
class: normalizeClass(["actionbar w-fit", { "is-dragging": unref(isDragging), "is-docked": unref(isDocked) }]),
style: normalizeStyle(unref(style))
}, {
@@ -7274,42 +7597,42 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
};
}
});
-const Actionbar = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-915e5456"]]);
-const _hoisted_1$5 = {
+const Actionbar = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-915e5456"]]);
+const _hoisted_1$4 = {
viewBox: "0 0 24 24",
width: "1.2em",
height: "1.2em"
};
-const _hoisted_2$5 = /* @__PURE__ */ createBaseVNode("path", {
+const _hoisted_2$4 = /* @__PURE__ */ createBaseVNode("path", {
fill: "currentColor",
d: "M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-5v3h14v-3zm0-2h14V5H5zm0 2v3z"
}, null, -1);
const _hoisted_3$4 = [
- _hoisted_2$5
+ _hoisted_2$4
];
function render$3(_ctx, _cache) {
- return openBlock(), createElementBlock("svg", _hoisted_1$5, [..._hoisted_3$4]);
+ return openBlock(), createElementBlock("svg", _hoisted_1$4, [..._hoisted_3$4]);
}
__name(render$3, "render$3");
const __unplugin_components_1 = markRaw({ name: "material-symbols-dock-to-bottom-outline", render: render$3 });
-const _hoisted_1$4 = {
+const _hoisted_1$3 = {
viewBox: "0 0 24 24",
width: "1.2em",
height: "1.2em"
};
-const _hoisted_2$4 = /* @__PURE__ */ createBaseVNode("path", {
+const _hoisted_2$3 = /* @__PURE__ */ createBaseVNode("path", {
fill: "currentColor",
d: "M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h14q.825 0 1.413.588T21 5v14q0 .825-.587 1.413T19 21zm0-7h14V5H5z"
}, null, -1);
const _hoisted_3$3 = [
- _hoisted_2$4
+ _hoisted_2$3
];
function render$2(_ctx, _cache) {
- return openBlock(), createElementBlock("svg", _hoisted_1$4, [..._hoisted_3$3]);
+ return openBlock(), createElementBlock("svg", _hoisted_1$3, [..._hoisted_3$3]);
}
__name(render$2, "render$2");
const __unplugin_components_0 = markRaw({ name: "material-symbols-dock-to-bottom", render: render$2 });
-const _sfc_main$5 = /* @__PURE__ */ defineComponent({
+const _sfc_main$3 = /* @__PURE__ */ defineComponent({
__name: "BottomPanelToggleButton",
setup(__props) {
const bottomPanelStore = useBottomPanelStore();
@@ -7320,13 +7643,14 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
return withDirectives((openBlock(), createBlock(unref(script$d), {
severity: "secondary",
text: "",
+ "aria-label": _ctx.$t("menu.toggleBottomPanel"),
onClick: unref(bottomPanelStore).toggleBottomPanel
}, {
icon: withCtx(() => [
unref(bottomPanelStore).bottomPanelVisible ? (openBlock(), createBlock(_component_i_material_symbols58dock_to_bottom, { key: 0 })) : (openBlock(), createBlock(_component_i_material_symbols58dock_to_bottom_outline, { key: 1 }))
]),
_: 1
- }, 8, ["onClick"])), [
+ }, 8, ["aria-label", "onClick"])), [
[vShow, unref(bottomPanelStore).bottomPanelTabs.length > 0],
[_directive_tooltip, { value: _ctx.$t("menu.toggleBottomPanel"), showDelay: 300 }]
]);
@@ -7561,17 +7885,17 @@ var script$1 = {
}, "getAriaSetSize")
},
components: {
- AngleRightIcon: script$w,
- AngleDownIcon: script$z
+ AngleRightIcon: script$z,
+ AngleDownIcon: script$C
},
directives: {
ripple: Ripple
}
};
var _hoisted_1$1$1 = ["id", "aria-label", "aria-disabled", "aria-expanded", "aria-haspopup", "aria-level", "aria-setsize", "aria-posinset", "data-p-active", "data-p-focused", "data-p-disabled"];
-var _hoisted_2$3 = ["onClick", "onMouseenter", "onMousemove"];
+var _hoisted_2$2 = ["onClick", "onMouseenter", "onMousemove"];
var _hoisted_3$2 = ["href", "target"];
-var _hoisted_4 = ["id"];
+var _hoisted_4$1 = ["id"];
var _hoisted_5 = ["id"];
function render$1(_ctx, _cache, $props, $setup, $data, $options) {
var _component_MenubarSub = resolveComponent("MenubarSub", true);
@@ -7632,7 +7956,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
id: $options.getItemLabelId(processedItem),
"class": _ctx.cx("itemLabel"),
ref_for: true
- }, $options.getPTOptions(processedItem, index, "itemLabel")), toDisplayString($options.getItemLabel(processedItem)), 17, _hoisted_4), $options.getItemProp(processedItem, "items") ? (openBlock(), createElementBlock(Fragment, {
+ }, $options.getPTOptions(processedItem, index, "itemLabel")), toDisplayString($options.getItemLabel(processedItem)), 17, _hoisted_4$1), $options.getItemProp(processedItem, "items") ? (openBlock(), createElementBlock(Fragment, {
key: 2
}, [$props.templates.submenuicon ? (openBlock(), createBlock(resolveDynamicComponent($props.templates.submenuicon), {
key: 0,
@@ -7650,7 +7974,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
hasSubmenu: $options.getItemProp(processedItem, "items"),
label: $options.getItemLabel(processedItem),
props: $options.getMenuItemProps(processedItem, index)
- }, null, 8, ["item", "root", "hasSubmenu", "label", "props"]))], 16, _hoisted_2$3), $options.isItemVisible(processedItem) && $options.isItemGroup(processedItem) ? (openBlock(), createBlock(_component_MenubarSub, {
+ }, null, 8, ["item", "root", "hasSubmenu", "label", "props"]))], 16, _hoisted_2$2), $options.isItemVisible(processedItem) && $options.isItemGroup(processedItem) ? (openBlock(), createBlock(_component_MenubarSub, {
key: 0,
id: $options.getItemId(processedItem) + "_list",
menuId: $props.menuId,
@@ -8293,7 +8617,7 @@ var script = {
},
components: {
MenubarSub: script$1,
- BarsIcon: script$A
+ BarsIcon: script$D
}
};
function _typeof(o) {
@@ -8348,7 +8672,7 @@ function _toPrimitive(t, r) {
return ("string" === r ? String : Number)(t);
}
__name(_toPrimitive, "_toPrimitive");
-var _hoisted_1$3 = ["aria-haspopup", "aria-expanded", "aria-controls", "aria-label"];
+var _hoisted_1$2 = ["aria-haspopup", "aria-expanded", "aria-controls", "aria-label"];
function render(_ctx, _cache, $props, $setup, $data, $options) {
var _component_BarsIcon = resolveComponent("BarsIcon");
var _component_MenubarSub = resolveComponent("MenubarSub");
@@ -8384,7 +8708,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
})
}, _objectSpread(_objectSpread({}, _ctx.buttonProps), _ctx.ptm("button"))), [renderSlot(_ctx.$slots, _ctx.$slots.buttonicon ? "buttonicon" : "menubuttonicon", {}, function() {
return [createVNode(_component_BarsIcon, normalizeProps(guardReactiveProps(_ctx.ptm("buttonicon"))), null, 16)];
- })], 16, _hoisted_1$3)) : createCommentVNode("", true)];
+ })], 16, _hoisted_1$2)) : createCommentVNode("", true)];
}), createVNode(_component_MenubarSub, {
ref: $options.menubarRef,
id: $data.id + "_list",
@@ -8416,14 +8740,14 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
}
__name(render, "render");
script.render = render;
-const _withScopeId$2 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-6fecd137"), n = n(), popScopeId(), n), "_withScopeId$2");
-const _hoisted_1$2 = ["href"];
-const _hoisted_2$2 = { class: "p-menubar-item-label" };
+const _withScopeId$1 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-56df69d2"), n = n(), popScopeId(), n), "_withScopeId$1");
+const _hoisted_1$1 = ["href"];
+const _hoisted_2$1 = { class: "p-menubar-item-label" };
const _hoisted_3$1 = {
key: 1,
- class: "ml-auto border border-surface rounded text-muted text-xs p-1 keybinding-tag"
+ class: "ml-auto border border-surface rounded text-muted text-xs text-nowrap p-1 keybinding-tag"
};
-const _sfc_main$4 = /* @__PURE__ */ defineComponent({
+const _sfc_main$2 = /* @__PURE__ */ defineComponent({
__name: "CommandMenubar",
setup(__props) {
const settingStore = useSettingStore();
@@ -8463,231 +8787,21 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
key: 0,
class: normalizeClass(["p-menubar-item-icon", item3.icon])
}, null, 2)) : createCommentVNode("", true),
- createBaseVNode("span", _hoisted_2$2, toDisplayString(item3.label), 1),
+ createBaseVNode("span", _hoisted_2$1, toDisplayString(item3.label), 1),
item3?.comfyCommand?.keybinding ? (openBlock(), createElementBlock("span", _hoisted_3$1, toDisplayString(item3.comfyCommand.keybinding.combo.toString()), 1)) : createCommentVNode("", true)
- ], 16, _hoisted_1$2)
+ ], 16, _hoisted_1$1)
]),
_: 1
}, 8, ["model", "pt"]);
};
}
});
-const CommandMenubar = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-6fecd137"]]);
-const _withScopeId$1 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-8d011a31"), n = n(), popScopeId(), n), "_withScopeId$1");
-const _hoisted_1$1 = { class: "workflow-label text-sm max-w-[150px] truncate inline-block" };
-const _hoisted_2$1 = { class: "relative" };
-const _hoisted_3 = {
- key: 0,
- class: "status-indicator"
-};
-const _sfc_main$3 = /* @__PURE__ */ defineComponent({
- __name: "WorkflowTab",
- props: {
- class: {},
- workflowOption: {}
- },
- setup(__props) {
- const props = __props;
- const workspaceStore = useWorkspaceStore();
- const workflowStore = useWorkflowStore();
- const workflowTabRef = ref(null);
- const closeWorkflows = /* @__PURE__ */ __name(async (options) => {
- for (const opt of options) {
- if (!await useWorkflowService().closeWorkflow(opt.workflow, {
- warnIfUnsaved: !workspaceStore.shiftDown
- })) {
- break;
- }
- }
- }, "closeWorkflows");
- const onCloseWorkflow = /* @__PURE__ */ __name((option2) => {
- closeWorkflows([option2]);
- }, "onCloseWorkflow");
- const tabGetter = /* @__PURE__ */ __name(() => workflowTabRef.value, "tabGetter");
- usePragmaticDraggable(tabGetter, {
- getInitialData: /* @__PURE__ */ __name(() => {
- return {
- workflowKey: props.workflowOption.workflow.key
- };
- }, "getInitialData")
- });
- usePragmaticDroppable(tabGetter, {
- getData: /* @__PURE__ */ __name(() => {
- return {
- workflowKey: props.workflowOption.workflow.key
- };
- }, "getData"),
- onDrop: /* @__PURE__ */ __name((e) => {
- const fromIndex = workflowStore.openWorkflows.findIndex(
- (wf) => wf.key === e.source.data.workflowKey
- );
- const toIndex = workflowStore.openWorkflows.findIndex(
- (wf) => wf.key === e.location.current.dropTargets[0]?.data.workflowKey
- );
- if (fromIndex !== toIndex) {
- workflowStore.reorderWorkflows(fromIndex, toIndex);
- }
- }, "onDrop")
- });
- return (_ctx, _cache) => {
- const _directive_tooltip = resolveDirective("tooltip");
- return openBlock(), createElementBlock("div", mergeProps({
- class: "flex p-2 gap-2 workflow-tab",
- ref_key: "workflowTabRef",
- ref: workflowTabRef
- }, _ctx.$attrs), [
- withDirectives((openBlock(), createElementBlock("span", _hoisted_1$1, [
- createTextVNode(toDisplayString(_ctx.workflowOption.workflow.filename), 1)
- ])), [
- [
- _directive_tooltip,
- _ctx.workflowOption.workflow.key,
- void 0,
- { bottom: true }
- ]
- ]),
- createBaseVNode("div", _hoisted_2$1, [
- !unref(workspaceStore).shiftDown && (_ctx.workflowOption.workflow.isModified || !_ctx.workflowOption.workflow.isPersisted) ? (openBlock(), createElementBlock("span", _hoisted_3, "•")) : createCommentVNode("", true),
- createVNode(unref(script$d), {
- class: "close-button p-0 w-auto",
- icon: "pi pi-times",
- text: "",
- severity: "secondary",
- size: "small",
- onClick: _cache[0] || (_cache[0] = withModifiers(($event) => onCloseWorkflow(_ctx.workflowOption), ["stop"]))
- })
- ])
- ], 16);
- };
- }
-});
-const WorkflowTab = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-8d011a31"]]);
-const _sfc_main$2 = /* @__PURE__ */ defineComponent({
- __name: "WorkflowTabs",
- props: {
- class: {}
- },
- setup(__props) {
- const props = __props;
- const { t } = useI18n();
- const workspaceStore = useWorkspaceStore();
- const workflowStore = useWorkflowStore();
- const workflowService = useWorkflowService();
- const rightClickedTab = ref(null);
- const menu = ref();
- const workflowToOption = /* @__PURE__ */ __name((workflow) => ({
- value: workflow.path,
- workflow
- }), "workflowToOption");
- const options = computed(
- () => workflowStore.openWorkflows.map(workflowToOption)
- );
- const selectedWorkflow = computed(
- () => workflowStore.activeWorkflow ? workflowToOption(workflowStore.activeWorkflow) : null
- );
- const onWorkflowChange = /* @__PURE__ */ __name((option2) => {
- if (!option2) {
- return;
- }
- if (selectedWorkflow.value?.value === option2.value) {
- return;
- }
- workflowService.openWorkflow(option2.workflow);
- }, "onWorkflowChange");
- const closeWorkflows = /* @__PURE__ */ __name(async (options2) => {
- for (const opt of options2) {
- if (!await workflowService.closeWorkflow(opt.workflow, {
- warnIfUnsaved: !workspaceStore.shiftDown
- })) {
- break;
- }
- }
- }, "closeWorkflows");
- const onCloseWorkflow = /* @__PURE__ */ __name((option2) => {
- closeWorkflows([option2]);
- }, "onCloseWorkflow");
- const showContextMenu = /* @__PURE__ */ __name((event, option2) => {
- rightClickedTab.value = option2;
- menu.value.show(event);
- }, "showContextMenu");
- const contextMenuItems = computed(() => {
- const tab = rightClickedTab.value;
- if (!tab) return [];
- const index = options.value.findIndex((v) => v.workflow === tab.workflow);
- return [
- {
- label: t("tabMenu.duplicateTab"),
- command: /* @__PURE__ */ __name(() => {
- workflowService.duplicateWorkflow(tab.workflow);
- }, "command")
- },
- {
- separator: true
- },
- {
- label: t("tabMenu.closeTab"),
- command: /* @__PURE__ */ __name(() => onCloseWorkflow(tab), "command")
- },
- {
- label: t("tabMenu.closeTabsToLeft"),
- command: /* @__PURE__ */ __name(() => closeWorkflows(options.value.slice(0, index)), "command"),
- disabled: index <= 0
- },
- {
- label: t("tabMenu.closeTabsToRight"),
- command: /* @__PURE__ */ __name(() => closeWorkflows(options.value.slice(index + 1)), "command"),
- disabled: index === options.value.length - 1
- },
- {
- label: t("tabMenu.closeOtherTabs"),
- command: /* @__PURE__ */ __name(() => closeWorkflows([
- ...options.value.slice(index + 1),
- ...options.value.slice(0, index)
- ]), "command"),
- disabled: options.value.length <= 1
- }
- ];
- });
- const commandStore = useCommandStore();
- return (_ctx, _cache) => {
- return openBlock(), createElementBlock(Fragment, null, [
- createVNode(unref(script$B), {
- class: normalizeClass(["workflow-tabs bg-transparent inline", props.class]),
- modelValue: selectedWorkflow.value,
- "onUpdate:modelValue": onWorkflowChange,
- options: options.value,
- optionLabel: "label",
- dataKey: "value"
- }, {
- option: withCtx(({ option: option2 }) => [
- createVNode(WorkflowTab, {
- onContextmenu: /* @__PURE__ */ __name(($event) => showContextMenu($event, option2), "onContextmenu"),
- onMouseup: withModifiers(($event) => onCloseWorkflow(option2), ["middle"]),
- "workflow-option": option2
- }, null, 8, ["onContextmenu", "onMouseup", "workflow-option"])
- ]),
- _: 1
- }, 8, ["class", "modelValue", "options"]),
- createVNode(unref(script$d), {
- class: "new-blank-workflow-button",
- icon: "pi pi-plus",
- text: "",
- severity: "secondary",
- onClick: _cache[0] || (_cache[0] = () => unref(commandStore).execute("Comfy.NewBlankWorkflow"))
- }),
- createVNode(unref(script$C), {
- ref_key: "menu",
- ref: menu,
- model: contextMenuItems.value
- }, null, 8, ["model"])
- ], 64);
- };
- }
-});
-const WorkflowTabs = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-d485c044"]]);
-const _withScopeId = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-878b63b8"), n = n(), popScopeId(), n), "_withScopeId");
-const _hoisted_1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createBaseVNode("h1", { class: "comfyui-logo mx-2" }, "ComfyUI", -1));
-const _hoisted_2 = { class: "flex-grow" };
+const CommandMenubar = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-56df69d2"]]);
+const _withScopeId = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-6e35440f"), n = n(), popScopeId(), n), "_withScopeId");
+const _hoisted_1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createBaseVNode("h1", { class: "comfyui-logo mx-2 app-drag" }, "ComfyUI", -1));
+const _hoisted_2 = { class: "flex-grow min-w-0 app-drag h-full" };
+const _hoisted_3 = { class: "window-actions-spacer flex-shrink-0" };
+const _hoisted_4 = { class: "fixed top-0 left-0 app-drag w-full h-[var(--comfy-topbar-height)]" };
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
__name: "TopMenubar",
setup(__props) {
@@ -8696,12 +8810,17 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
const workflowTabsPosition = computed(
() => settingStore.get("Comfy.Workflow.WorkflowTabsPosition")
);
- const betaMenuEnabled = computed(
- () => settingStore.get("Comfy.UseNewMenu") !== "Disabled"
- );
+ const menuSetting = computed(() => settingStore.get("Comfy.UseNewMenu"));
+ const betaMenuEnabled = computed(() => menuSetting.value !== "Disabled");
const teleportTarget = computed(
() => settingStore.get("Comfy.UseNewMenu") === "Top" ? ".comfyui-body-top" : ".comfyui-body-bottom"
);
+ const isNativeWindow = computed(
+ () => isElectron() && settingStore.get("Comfy-Desktop.WindowStyle") === "custom"
+ );
+ const showTopMenu = computed(
+ () => betaMenuEnabled.value && !workspaceState.focusMode
+ );
const menuRight = ref(null);
onMounted(() => {
if (menuRight.value) {
@@ -8719,47 +8838,60 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
isDroppable.value = payload.isOverlapping && payload.isDragging;
}
});
+ onMounted(() => {
+ if (isElectron()) {
+ electronAPI().changeTheme({
+ height: topMenuRef.value.getBoundingClientRect().height
+ });
+ }
+ });
return (_ctx, _cache) => {
const _directive_tooltip = resolveDirective("tooltip");
- return openBlock(), createBlock(Teleport, { to: teleportTarget.value }, [
- withDirectives(createBaseVNode("div", {
- ref_key: "topMenuRef",
- ref: topMenuRef,
- class: normalizeClass(["comfyui-menu flex items-center", { dropzone: isDropZone.value, "dropzone-active": isDroppable.value }])
- }, [
- _hoisted_1,
- createVNode(CommandMenubar),
- createVNode(unref(script$D), {
- layout: "vertical",
- class: "mx-2"
- }),
- createBaseVNode("div", _hoisted_2, [
- workflowTabsPosition.value === "Topbar" ? (openBlock(), createBlock(WorkflowTabs, { key: 0 })) : createCommentVNode("", true)
- ]),
- createBaseVNode("div", {
- class: "comfyui-menu-right",
- ref_key: "menuRight",
- ref: menuRight
- }, null, 512),
- createVNode(Actionbar),
- createVNode(_sfc_main$5),
- withDirectives(createVNode(unref(script$d), {
- icon: "pi pi-bars",
- severity: "secondary",
- text: "",
- onClick: _cache[0] || (_cache[0] = ($event) => unref(workspaceState).focusMode = true),
- onContextmenu: unref(showNativeMenu)
- }, null, 8, ["onContextmenu"]), [
- [_directive_tooltip, { value: _ctx.$t("menu.hideMenu"), showDelay: 300 }]
+ return openBlock(), createElementBlock(Fragment, null, [
+ (openBlock(), createBlock(Teleport, { to: teleportTarget.value }, [
+ withDirectives(createBaseVNode("div", {
+ ref_key: "topMenuRef",
+ ref: topMenuRef,
+ class: normalizeClass(["comfyui-menu flex items-center", { dropzone: isDropZone.value, "dropzone-active": isDroppable.value }])
+ }, [
+ _hoisted_1,
+ createVNode(CommandMenubar),
+ createBaseVNode("div", _hoisted_2, [
+ workflowTabsPosition.value === "Topbar" ? (openBlock(), createBlock(WorkflowTabs, { key: 0 })) : createCommentVNode("", true)
+ ]),
+ createBaseVNode("div", {
+ class: "comfyui-menu-right",
+ ref_key: "menuRight",
+ ref: menuRight
+ }, null, 512),
+ createVNode(Actionbar),
+ createVNode(_sfc_main$3, { class: "flex-shrink-0" }),
+ withDirectives(createVNode(unref(script$d), {
+ class: "flex-shrink-0",
+ icon: "pi pi-bars",
+ severity: "secondary",
+ text: "",
+ "aria-label": _ctx.$t("menu.hideMenu"),
+ onClick: _cache[0] || (_cache[0] = ($event) => unref(workspaceState).focusMode = true),
+ onContextmenu: unref(showNativeMenu)
+ }, null, 8, ["aria-label", "onContextmenu"]), [
+ [_directive_tooltip, { value: _ctx.$t("menu.hideMenu"), showDelay: 300 }]
+ ]),
+ withDirectives(createBaseVNode("div", _hoisted_3, null, 512), [
+ [vShow, menuSetting.value !== "Bottom"]
+ ])
+ ], 2), [
+ [vShow, showTopMenu.value]
])
- ], 2), [
- [vShow, betaMenuEnabled.value && !unref(workspaceState).focusMode]
+ ], 8, ["to"])),
+ withDirectives(createBaseVNode("div", _hoisted_4, null, 512), [
+ [vShow, isNativeWindow.value && !showTopMenu.value]
])
- ], 8, ["to"]);
+ ], 64);
};
}
});
-const TopMenubar = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-878b63b8"]]);
+const TopMenubar = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-6e35440f"]]);
var LatentPreviewMethod = /* @__PURE__ */ ((LatentPreviewMethod2) => {
LatentPreviewMethod2["NoPreviews"] = "none";
LatentPreviewMethod2["Auto"] = "auto";
@@ -9241,6 +9373,7 @@ function useCoreCommands() {
const workflowService = useWorkflowService();
const workflowStore = useWorkflowStore();
const dialogService = useDialogService();
+ const colorPaletteStore = useColorPaletteStore();
const getTracker = /* @__PURE__ */ __name(() => workflowStore.activeWorkflow?.changeTracker, "getTracker");
const getSelectedNodes = /* @__PURE__ */ __name(() => {
const selectedNodes = app.canvas.selected_nodes;
@@ -9613,17 +9746,18 @@ function useCoreCommands() {
icon: "pi pi-moon",
label: "Toggle Theme (Dark/Light)",
versionAdded: "1.3.12",
- function: /* @__PURE__ */ (() => {
- let previousDarkTheme = "dark";
- const isDarkMode = /* @__PURE__ */ __name((themeId) => themeId !== "light", "isDarkMode");
+ function: (() => {
+ let previousDarkTheme = DEFAULT_DARK_COLOR_PALETTE.id;
+ let previousLightTheme = DEFAULT_LIGHT_COLOR_PALETTE.id;
return () => {
const settingStore = useSettingStore();
- const currentTheme = settingStore.get("Comfy.ColorPalette");
- if (isDarkMode(currentTheme)) {
- previousDarkTheme = currentTheme;
- settingStore.set("Comfy.ColorPalette", "light");
- } else {
+ const theme10 = colorPaletteStore.completedActivePalette;
+ if (theme10.light_theme) {
+ previousLightTheme = theme10.id;
settingStore.set("Comfy.ColorPalette", previousDarkTheme);
+ } else {
+ previousDarkTheme = theme10.id;
+ settingStore.set("Comfy.ColorPalette", previousLightTheme);
}
};
})()
@@ -9724,6 +9858,16 @@ function useCoreCommands() {
function: /* @__PURE__ */ __name(() => {
workflowService.duplicateWorkflow(workflowStore.activeWorkflow);
}, "function")
+ },
+ {
+ id: "Workspace.CloseWorkflow",
+ icon: "pi pi-times",
+ label: "Close Current Workflow",
+ versionAdded: "1.7.3",
+ function: /* @__PURE__ */ __name(() => {
+ if (workflowStore.activeWorkflow)
+ workflowService.closeWorkflow(workflowStore.activeWorkflow);
+ }, "function")
}
];
}
@@ -9766,20 +9910,45 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
const toast = useToast();
const settingStore = useSettingStore();
const executionStore = useExecutionStore();
- const theme10 = computed(() => settingStore.get("Comfy.ColorPalette"));
+ const colorPaletteStore = useColorPaletteStore();
+ const queueStore = useQueueStore();
watch(
- theme10,
+ () => colorPaletteStore.completedActivePalette,
(newTheme) => {
const DARK_THEME_CLASS = "dark-theme";
- const isDarkTheme = newTheme !== "light";
- if (isDarkTheme) {
- document.body.classList.add(DARK_THEME_CLASS);
- } else {
+ if (newTheme.light_theme) {
document.body.classList.remove(DARK_THEME_CLASS);
+ } else {
+ document.body.classList.add(DARK_THEME_CLASS);
+ }
+ if (isElectron()) {
+ electronAPI().changeTheme({
+ color: "rgba(0, 0, 0, 0)",
+ symbolColor: newTheme.colors.comfy_base["input-text"]
+ });
}
},
{ immediate: true }
);
+ if (isElectron()) {
+ watch(
+ () => queueStore.tasks,
+ (newTasks, oldTasks) => {
+ const oldRunningTaskIds = new Set(
+ oldTasks.filter((task) => task.isRunning).map((task) => task.promptId)
+ );
+ newTasks.filter(
+ (task) => oldRunningTaskIds.has(task.promptId) && task.isHistory
+ ).forEach((task) => {
+ electronAPI().Events.incrementUserProperty(
+ `execution:${task.displayStatus.toLowerCase()}`,
+ 1
+ );
+ });
+ },
+ { deep: true }
+ );
+ }
watchEffect(() => {
const fontSize = settingStore.get("Comfy.TextareaWidget.FontSize");
document.documentElement.style.setProperty(
@@ -9810,9 +9979,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
}
});
watchEffect(() => {
- useQueueStore().maxHistoryItems = settingStore.get(
- "Comfy.Queue.MaxHistoryItems"
- );
+ queueStore.maxHistoryItems = settingStore.get("Comfy.Queue.MaxHistoryItems");
});
const init = /* @__PURE__ */ __name(() => {
const coreCommands = useCoreCommands();
@@ -9824,8 +9991,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
app.extensionManager = useWorkspaceStore();
}, "init");
const queuePendingTaskCountStore = useQueuePendingTaskCountStore();
- const onStatus = /* @__PURE__ */ __name((e) => {
+ const onStatus = /* @__PURE__ */ __name(async (e) => {
queuePendingTaskCountStore.update(e);
+ await queueStore.update();
}, "onStatus");
const reconnectingMessage = {
severity: "error",
@@ -9861,17 +10029,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
executionStore.unbindExecutionEvents();
});
useEventListener(window, "keydown", useKeybindingService().keybindHandler);
+ const { wrapWithErrorHandling, wrapWithErrorHandlingAsync } = useErrorHandling();
const onGraphReady = /* @__PURE__ */ __name(() => {
requestIdleCallback(
() => {
- useKeybindingService().registerUserKeybindings();
- useServerConfigStore().loadServerConfig(
+ wrapWithErrorHandling(useKeybindingService().registerUserKeybindings)();
+ wrapWithErrorHandling(useServerConfigStore().loadServerConfig)(
SERVER_CONFIG_ITEMS,
settingStore.get("Comfy.Server.ServerConfigValues")
);
- useModelStore().loadModelFolders();
+ wrapWithErrorHandlingAsync(useModelStore().loadModelFolders)();
+ wrapWithErrorHandlingAsync(useNodeFrequencyStore().loadNodeFrequencies)();
useNodeDefStore().nodeSearchService.endsWithFilterStartSequence("");
- useNodeFrequencyStore().loadNodeFrequencies();
},
{ timeout: 1e3 }
);
@@ -9879,10 +10048,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
return (_ctx, _cache) => {
return openBlock(), createElementBlock(Fragment, null, [
createVNode(TopMenubar),
- createVNode(_sfc_main$a, { onReady: onGraphReady }),
- createVNode(_sfc_main$9),
- createVNode(_sfc_main$r),
- createVNode(_sfc_main$t),
+ createVNode(_sfc_main$8, { onReady: onGraphReady }),
+ createVNode(_sfc_main$7),
+ createVNode(_sfc_main$s),
+ createVNode(_sfc_main$u),
createVNode(MenuHamburger)
], 64);
};
@@ -9891,4 +10060,4 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
export {
_sfc_main as default
};
-//# sourceMappingURL=GraphView-HVeNbkaW.js.map
+//# sourceMappingURL=GraphView-CDDCHVO0.js.map
diff --git a/web/assets/GraphView-CIRWBKTm.css b/web/assets/GraphView-CqZ3opAX.css
similarity index 70%
rename from web/assets/GraphView-CIRWBKTm.css
rename to web/assets/GraphView-CqZ3opAX.css
index 59d1b3d149a..f735c838624 100644
--- a/web/assets/GraphView-CIRWBKTm.css
+++ b/web/assets/GraphView-CqZ3opAX.css
@@ -1,8 +1,10 @@
-.comfy-menu-hamburger[data-v-5661bed0] {
- pointer-events: auto;
- position: fixed;
- z-index: 9999;
+.comfy-menu-hamburger[data-v-7ed57d1a] {
+ pointer-events: auto;
+ position: fixed;
+ z-index: 9999;
+ display: flex;
+ flex-direction: row
}
[data-v-e50caa15] .p-splitter-gutter {
@@ -39,14 +41,14 @@
z-index: 999;
}
-.p-buttongroup-vertical[data-v-cf40dd39] {
+.p-buttongroup-vertical[data-v-cb8f9a1a] {
display: flex;
flex-direction: column;
border-radius: var(--p-button-border-radius);
overflow: hidden;
border: 1px solid var(--p-panel-border-color);
}
-.p-buttongroup-vertical .p-button[data-v-cf40dd39] {
+.p-buttongroup-vertical .p-button[data-v-cb8f9a1a] {
margin: 0;
border-radius: 0;
}
@@ -82,7 +84,7 @@
font-size: inherit;
}
-[data-v-5741c9ae] .highlight {
+[data-v-fd0a74bd] .highlight {
background-color: var(--p-primary-color);
color: var(--p-primary-contrast-color);
font-weight: bold;
@@ -131,16 +133,7 @@
border-right: 4px solid var(--p-button-text-primary-color);
}
-:root {
- --sidebar-width: 64px;
- --sidebar-icon-size: 1.5rem;
-}
-:root .small-sidebar {
- --sidebar-width: 40px;
- --sidebar-icon-size: 1rem;
-}
-
-.side-tool-bar-container[data-v-37d8d7b4] {
+.side-tool-bar-container[data-v-33cac83a] {
display: flex;
flex-direction: column;
align-items: center;
@@ -153,18 +146,91 @@
background-color: var(--comfy-menu-secondary-bg);
color: var(--fg-color);
box-shadow: var(--bar-shadow);
+
+ --sidebar-width: 4rem;
+ --sidebar-icon-size: 1.5rem;
}
-.side-tool-bar-end[data-v-37d8d7b4] {
+.side-tool-bar-container.small-sidebar[data-v-33cac83a] {
+ --sidebar-width: 2.5rem;
+ --sidebar-icon-size: 1rem;
+}
+.side-tool-bar-end[data-v-33cac83a] {
align-self: flex-end;
margin-top: auto;
}
-[data-v-b9328350] .p-inputtext {
+.status-indicator[data-v-8d011a31] {
+ position: absolute;
+ font-weight: 700;
+ font-size: 1.5rem;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%)
+}
+
+[data-v-54fadc45] .p-togglebutton {
+ position: relative;
+ flex-shrink: 0;
+ border-radius: 0px;
+ border-width: 0px;
+ border-right-width: 1px;
+ border-style: solid;
+ background-color: transparent;
+ padding: 0px;
+ border-right-color: var(--border-color)
+}
+[data-v-54fadc45] .p-togglebutton::before {
+ display: none
+}
+[data-v-54fadc45] .p-togglebutton:first-child {
+ border-left-width: 1px;
+ border-style: solid;
+ border-left-color: var(--border-color)
+}
+[data-v-54fadc45] .p-togglebutton:not(:first-child) {
+ border-left-width: 0px
+}
+[data-v-54fadc45] .p-togglebutton.p-togglebutton-checked {
+ height: 100%;
+ border-bottom-width: 1px;
+ border-style: solid;
+ border-bottom-color: var(--p-button-text-primary-color)
+}
+[data-v-54fadc45] .p-togglebutton:not(.p-togglebutton-checked) {
+ opacity: 0.75
+}
+[data-v-54fadc45] .p-togglebutton-checked .close-button,[data-v-54fadc45] .p-togglebutton:hover .close-button {
+ visibility: visible
+}
+[data-v-54fadc45] .p-togglebutton:hover .status-indicator {
+ display: none
+}
+[data-v-54fadc45] .p-togglebutton .close-button {
+ visibility: hidden
+}
+[data-v-54fadc45] .p-scrollpanel-content {
+ height: 100%
+}
+
+/* Scrollbar half opacity to avoid blocking the active tab bottom border */
+[data-v-54fadc45] .p-scrollpanel:hover .p-scrollpanel-bar,[data-v-54fadc45] .p-scrollpanel:active .p-scrollpanel-bar {
+ opacity: 0.5
+}
+[data-v-54fadc45] .p-selectbutton {
+ height: 100%;
+ border-radius: 0px
+}
+
+[data-v-38831d8e] .workflow-tabs {
+ background-color: var(--comfy-menu-bg);
+}
+
+[data-v-26957f1f] .p-inputtext {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
-.comfyui-queue-button[data-v-7f4f551b] .p-splitbutton-dropdown {
+.comfyui-queue-button[data-v-e9044686] .p-splitbutton-dropdown {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
@@ -195,55 +261,23 @@
display: none;
}
-.top-menubar[data-v-6fecd137] .p-menubar-item-link svg {
+.top-menubar[data-v-56df69d2] .p-menubar-item-link svg {
display: none;
}
-[data-v-6fecd137] .p-menubar-submenu.dropdown-direction-up {
+[data-v-56df69d2] .p-menubar-submenu.dropdown-direction-up {
top: auto;
bottom: 100%;
flex-direction: column-reverse;
}
-.keybinding-tag[data-v-6fecd137] {
+.keybinding-tag[data-v-56df69d2] {
background: var(--p-content-hover-background);
border-color: var(--p-content-border-color);
border-style: solid;
}
-.status-indicator[data-v-8d011a31] {
- position: absolute;
- font-weight: 700;
- font-size: 1.5rem;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%)
-}
-
-[data-v-d485c044] .p-togglebutton::before {
- display: none
-}
-[data-v-d485c044] .p-togglebutton {
- position: relative;
- flex-shrink: 0;
- border-radius: 0px;
- background-color: transparent;
- padding: 0px
-}
-[data-v-d485c044] .p-togglebutton.p-togglebutton-checked {
- border-bottom-width: 2px;
- border-bottom-color: var(--p-button-text-primary-color)
-}
-[data-v-d485c044] .p-togglebutton-checked .close-button,[data-v-d485c044] .p-togglebutton:hover .close-button {
- visibility: visible
-}
-[data-v-d485c044] .p-togglebutton:hover .status-indicator {
- display: none
-}
-[data-v-d485c044] .p-togglebutton .close-button {
- visibility: hidden
-}
-
-.comfyui-menu[data-v-878b63b8] {
+.comfyui-menu[data-v-6e35440f] {
width: 100vw;
+ height: var(--comfy-topbar-height);
background: var(--comfy-menu-bg);
color: var(--fg-color);
box-shadow: var(--bar-shadow);
@@ -253,18 +287,17 @@
z-index: 1000;
order: 0;
grid-column: 1/-1;
- max-height: 90vh;
}
-.comfyui-menu.dropzone[data-v-878b63b8] {
+.comfyui-menu.dropzone[data-v-6e35440f] {
background: var(--p-highlight-background);
}
-.comfyui-menu.dropzone-active[data-v-878b63b8] {
+.comfyui-menu.dropzone-active[data-v-6e35440f] {
background: var(--p-highlight-background-focus);
}
-[data-v-878b63b8] .p-menubar-item-label {
+[data-v-6e35440f] .p-menubar-item-label {
line-height: revert;
}
-.comfyui-logo[data-v-878b63b8] {
+.comfyui-logo[data-v-6e35440f] {
font-size: 1.2em;
-webkit-user-select: none;
-moz-user-select: none;
diff --git a/web/assets/InstallView-CAcYt0HL.js b/web/assets/InstallView-By3hC1fC.js
similarity index 94%
rename from web/assets/InstallView-CAcYt0HL.js
rename to web/assets/InstallView-By3hC1fC.js
index 2cf9e7f1506..4262b264670 100644
--- a/web/assets/InstallView-CAcYt0HL.js
+++ b/web/assets/InstallView-By3hC1fC.js
@@ -1,7 +1,7 @@
var __defProp = Object.defineProperty;
var __name = (target, value2) => __defProp(target, "name", { value: value2, configurable: true });
-import { B as BaseStyle, q as script$6, o as openBlock, f as createElementBlock, D as mergeProps, c1 as findIndexInList, c2 as find, aB as resolveComponent, k as createBlock, G as resolveDynamicComponent, M as withCtx, H as createBaseVNode, X as toDisplayString, J as renderSlot, I as createCommentVNode, T as normalizeClass, P as findSingle, F as Fragment, aC as Transition, i as withDirectives, v as vShow, ak as UniqueComponentId, d as defineComponent, ab as ref, c3 as useModel, N as createVNode, j as unref, c4 as script$7, bQ as script$8, bM as withModifiers, aP as script$9, a1 as useI18n, c as computed, aI as script$a, aE as createTextVNode, c0 as electronAPI, m as onMounted, r as resolveDirective, av as script$b, c5 as script$c, c6 as script$d, l as script$e, bZ as script$f, c7 as MigrationItems, w as watchEffect, E as renderList, c8 as script$g, bW as useRouter, aL as pushScopeId, aM as popScopeId, aU as toRaw, _ as _export_sfc } from "./index-DjNHn37O.js";
-import { _ as _sfc_main$5 } from "./BaseViewTemplate-BNGF4K22.js";
+import { B as BaseStyle, y as script$6, o as openBlock, f as createElementBlock, G as mergeProps, c9 as findIndexInList, ca as find, aD as resolveComponent, J as createBlock, K as resolveDynamicComponent, P as withCtx, m as createBaseVNode, Z as toDisplayString, M as renderSlot, L as createCommentVNode, V as normalizeClass, R as findSingle, H as Fragment, aE as Transition, i as withDirectives, v as vShow, am as UniqueComponentId, d as defineComponent, ad as ref, cb as useModel, k as createVNode, j as unref, cc as script$7, c4 as script$8, b3 as withModifiers, aP as script$9, a3 as useI18n, c as computed, aK as script$a, aG as createTextVNode, p as pushScopeId, q as popScopeId, bV as electronAPI, _ as _export_sfc, t as onMounted, r as resolveDirective, ax as script$b, cd as script$c, ce as script$d, l as script$e, c6 as script$f, cf as MigrationItems, w as watchEffect, I as renderList, cg as script$g, c2 as useRouter, aU as toRaw } from "./index-QvfM__ze.js";
+import { _ as _sfc_main$5 } from "./BaseViewTemplate-BhQMaVFP.js";
var classes$4 = {
root: /* @__PURE__ */ __name(function root(_ref) {
var instance = _ref.instance;
@@ -548,6 +548,12 @@ const _hoisted_15$2 = { class: "font-medium mb-2" };
const _hoisted_16$2 = { class: "list-disc pl-6 space-y-1" };
const _hoisted_17$2 = { class: "font-medium mt-4 mb-2" };
const _hoisted_18$2 = { class: "list-disc pl-6 space-y-1" };
+const _hoisted_19 = { class: "mt-4" };
+const _hoisted_20 = {
+ href: "https://comfy.org/privacy",
+ target: "_blank",
+ class: "text-blue-400 hover:text-blue-300 underline"
+};
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
__name: "DesktopSettingsConfiguration",
props: {
@@ -608,17 +614,29 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
createBaseVNode("div", _hoisted_14$2, [
createBaseVNode("h4", _hoisted_15$2, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.whatWeCollect")), 1),
createBaseVNode("ul", _hoisted_16$2, [
- createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.errorReports")), 1),
- createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.systemInfo")), 1)
+ createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.collect.errorReports")), 1),
+ createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.collect.systemInfo")), 1),
+ createBaseVNode("li", null, toDisplayString(_ctx.$t(
+ "install.settings.dataCollectionDialog.collect.userJourneyEvents"
+ )), 1)
]),
createBaseVNode("h4", _hoisted_17$2, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.whatWeDoNotCollect")), 1),
createBaseVNode("ul", _hoisted_18$2, [
- createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.personalInformation")), 1),
- createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.workflowContents")), 1),
- createBaseVNode("li", null, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.fileSystemInformation")), 1),
createBaseVNode("li", null, toDisplayString(_ctx.$t(
- "install.settings.dataCollectionDialog.customNodeConfigurations"
+ "install.settings.dataCollectionDialog.doNotCollect.personalInformation"
+ )), 1),
+ createBaseVNode("li", null, toDisplayString(_ctx.$t(
+ "install.settings.dataCollectionDialog.doNotCollect.workflowContents"
+ )), 1),
+ createBaseVNode("li", null, toDisplayString(_ctx.$t(
+ "install.settings.dataCollectionDialog.doNotCollect.fileSystemInformation"
+ )), 1),
+ createBaseVNode("li", null, toDisplayString(_ctx.$t(
+ "install.settings.dataCollectionDialog.doNotCollect.customNodeConfigurations"
)), 1)
+ ]),
+ createBaseVNode("div", _hoisted_19, [
+ createBaseVNode("a", _hoisted_20, toDisplayString(_ctx.$t("install.settings.dataCollectionDialog.viewFullPolicy")), 1)
])
])
]),
@@ -631,36 +649,37 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
const _imports_0 = "" + new URL("images/nvidia-logo.svg", import.meta.url).href;
const _imports_1 = "" + new URL("images/apple-mps-logo.png", import.meta.url).href;
const _imports_2 = "" + new URL("images/manual-configuration.svg", import.meta.url).href;
+const _withScopeId$1 = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-79125ff6"), n = n(), popScopeId(), n), "_withScopeId$1");
const _hoisted_1$3 = { class: "flex flex-col gap-6 w-[600px] h-[30rem] select-none" };
const _hoisted_2$3 = { class: "grow flex flex-col gap-4 text-neutral-300" };
const _hoisted_3$3 = { class: "text-2xl font-semibold text-neutral-100" };
const _hoisted_4$3 = { class: "m-1 text-neutral-400" };
-const _hoisted_5$2 = /* @__PURE__ */ createBaseVNode("img", {
+const _hoisted_5$2 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createBaseVNode("img", {
class: "m-12",
alt: "NVIDIA logo",
width: "196",
height: "32",
src: _imports_0
-}, null, -1);
+}, null, -1));
const _hoisted_6$2 = [
_hoisted_5$2
];
-const _hoisted_7$2 = /* @__PURE__ */ createBaseVNode("img", {
+const _hoisted_7$2 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createBaseVNode("img", {
class: "rounded-lg hover-brighten",
alt: "Apple Metal Performance Shaders Logo",
width: "292",
ratio: "",
src: _imports_1
-}, null, -1);
+}, null, -1));
const _hoisted_8$2 = [
_hoisted_7$2
];
-const _hoisted_9$2 = /* @__PURE__ */ createBaseVNode("img", {
+const _hoisted_9$2 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ createBaseVNode("img", {
class: "m-12",
alt: "Manual configuration",
width: "196",
src: _imports_2
-}, null, -1);
+}, null, -1));
const _hoisted_10$2 = [
_hoisted_9$2
];
@@ -797,6 +816,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
};
}
});
+const GpuPicker = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-79125ff6"]]);
const _hoisted_1$2 = { class: "flex flex-col gap-6 w-[600px]" };
const _hoisted_2$2 = { class: "flex flex-col gap-4" };
const _hoisted_3$2 = { class: "text-2xl font-semibold text-neutral-100" };
@@ -1082,7 +1102,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
};
}
});
-const _withScopeId = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-de33872d"), n = n(), popScopeId(), n), "_withScopeId");
+const _withScopeId = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-0a97b0ae"), n = n(), popScopeId(), n), "_withScopeId");
const _hoisted_1 = { class: "flex pt-6 justify-end" };
const _hoisted_2 = { class: "flex pt-6 justify-between" };
const _hoisted_3 = { class: "flex pt-6 justify-between" };
@@ -1098,6 +1118,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
const autoUpdate = ref(true);
const allowMetrics = ref(true);
const highestStep = ref(0);
+ const handleStepChange = /* @__PURE__ */ __name((value2) => {
+ setHighestStep(value2);
+ electronAPI().Events.trackEvent("install_stepper_change", {
+ step: value2
+ });
+ }, "handleStepChange");
const setHighestStep = /* @__PURE__ */ __name((value2) => {
const int = typeof value2 === "number" ? value2 : parseInt(value2, 10);
if (!isNaN(int) && int > highestStep.value) highestStep.value = int;
@@ -1122,8 +1148,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
onMounted(async () => {
if (!electron) return;
const detectedGpu = await electron.Config.getDetectedGpu();
- if (detectedGpu === "mps" || detectedGpu === "nvidia")
+ if (detectedGpu === "mps" || detectedGpu === "nvidia") {
device.value = detectedGpu;
+ }
+ electronAPI().Events.trackEvent("install_stepper_change", {
+ step: "0",
+ gpu: detectedGpu
+ });
});
return (_ctx, _cache) => {
return openBlock(), createBlock(_sfc_main$5, { dark: "" }, {
@@ -1131,7 +1162,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
createVNode(unref(script), {
class: "h-full p-8 2xl:p-16",
value: "0",
- "onUpdate:value": setHighestStep
+ "onUpdate:value": handleStepChange
}, {
default: withCtx(() => [
createVNode(unref(script$4), { class: "select-none" }, {
@@ -1176,7 +1207,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
default: withCtx(() => [
createVNode(unref(script$3), { value: "0" }, {
default: withCtx(({ activateCallback }) => [
- createVNode(_sfc_main$3, {
+ createVNode(GpuPicker, {
device: device.value,
"onUpdate:device": _cache[0] || (_cache[0] = ($event) => device.value = $event)
}, null, 8, ["device"]),
@@ -1281,8 +1312,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
};
}
});
-const InstallView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-de33872d"]]);
+const InstallView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0a97b0ae"]]);
export {
InstallView as default
};
-//# sourceMappingURL=InstallView-CAcYt0HL.js.map
+//# sourceMappingURL=InstallView-By3hC1fC.js.map
diff --git a/web/assets/InstallView-CwQdoH-C.css b/web/assets/InstallView-CxhfFC8Y.css
similarity index 70%
rename from web/assets/InstallView-CwQdoH-C.css
rename to web/assets/InstallView-CxhfFC8Y.css
index df57877871a..a406c869548 100644
--- a/web/assets/InstallView-CwQdoH-C.css
+++ b/web/assets/InstallView-CxhfFC8Y.css
@@ -1,18 +1,18 @@
-:root {
+.p-tag[data-v-79125ff6] {
--p-tag-gap: 0.5rem;
}
-.hover-brighten {
+.hover-brighten[data-v-79125ff6] {
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 150ms;
transition-property: filter, box-shadow;
-&:hover {
+&[data-v-79125ff6]:hover {
filter: brightness(107%) contrast(105%);
box-shadow: 0 0 0.25rem #ffffff79;
}
}
-.p-accordioncontent-content {
+.p-accordioncontent-content[data-v-79125ff6] {
border-radius: 0.5rem;
--tw-bg-opacity: 1;
background-color: rgb(23 23 23 / var(--tw-bg-opacity));
@@ -20,15 +20,15 @@
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 150ms;
}
-div.selected {
-.gpu-button:not(.selected) {
+div.selected[data-v-79125ff6] {
+.gpu-button[data-v-79125ff6]:not(.selected) {
opacity: 0.5;
}
-.gpu-button:not(.selected):hover {
+.gpu-button[data-v-79125ff6]:not(.selected):hover {
opacity: 1;
}
}
-.gpu-button {
+.gpu-button[data-v-79125ff6] {
margin: 0px;
display: flex;
width: 50%;
@@ -43,37 +43,37 @@ div.selected {
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 150ms;
}
-.gpu-button:hover {
+.gpu-button[data-v-79125ff6]:hover {
--tw-bg-opacity: 0.75;
}
-.gpu-button {
-&.selected {
+.gpu-button[data-v-79125ff6] {
+&.selected[data-v-79125ff6] {
--tw-bg-opacity: 1;
background-color: rgb(64 64 64 / var(--tw-bg-opacity));
}
-&.selected {
+&.selected[data-v-79125ff6] {
--tw-bg-opacity: 0.5;
}
-&.selected {
+&.selected[data-v-79125ff6] {
opacity: 1;
}
-&.selected:hover {
+&.selected[data-v-79125ff6]:hover {
--tw-bg-opacity: 0.6;
}
}
-.disabled {
+.disabled[data-v-79125ff6] {
pointer-events: none;
opacity: 0.4;
}
-.p-card-header {
+.p-card-header[data-v-79125ff6] {
flex-grow: 1;
text-align: center;
}
-.p-card-body {
+.p-card-body[data-v-79125ff6] {
padding-top: 0px;
text-align: center;
}
-[data-v-de33872d] .p-steppanel {
+[data-v-0a97b0ae] .p-steppanel {
background-color: transparent
}
diff --git a/web/assets/KeybindingPanel-Dc3C4lG1.js b/web/assets/KeybindingPanel-D6O16W_1.js
similarity index 92%
rename from web/assets/KeybindingPanel-Dc3C4lG1.js
rename to web/assets/KeybindingPanel-D6O16W_1.js
index 6cf204dd270..b0fbfd8459e 100644
--- a/web/assets/KeybindingPanel-Dc3C4lG1.js
+++ b/web/assets/KeybindingPanel-D6O16W_1.js
@@ -1,10 +1,9 @@
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { d as defineComponent, c as computed, o as openBlock, f as createElementBlock, F as Fragment, E as renderList, N as createVNode, M as withCtx, aE as createTextVNode, X as toDisplayString, j as unref, aI as script, I as createCommentVNode, ab as ref, cn as FilterMatchMode, a$ as useKeybindingStore, a2 as useCommandStore, a1 as useI18n, af as normalizeI18nKey, w as watchEffect, bs as useToast, r as resolveDirective, k as createBlock, co as SearchBox, H as createBaseVNode, l as script$2, av as script$4, bM as withModifiers, bZ as script$5, aP as script$6, i as withDirectives, cp as _sfc_main$2, aL as pushScopeId, aM as popScopeId, cq as KeyComboImpl, cr as KeybindingImpl, _ as _export_sfc } from "./index-DjNHn37O.js";
-import { s as script$1, a as script$3 } from "./index-B5F0uxTQ.js";
-import { u as useKeybindingService } from "./keybindingService-Bx7YdkXn.js";
-import "./index-B-aVupP5.js";
-import "./index-5HFeZax4.js";
+import { d as defineComponent, c as computed, o as openBlock, f as createElementBlock, H as Fragment, I as renderList, k as createVNode, P as withCtx, aG as createTextVNode, Z as toDisplayString, j as unref, aK as script, L as createCommentVNode, ad as ref, cu as FilterMatchMode, a$ as useKeybindingStore, a4 as useCommandStore, a3 as useI18n, ah as normalizeI18nKey, w as watchEffect, bz as useToast, r as resolveDirective, J as createBlock, cv as SearchBox, m as createBaseVNode, l as script$2, ax as script$4, b3 as withModifiers, c6 as script$5, aP as script$6, i as withDirectives, cw as _sfc_main$2, p as pushScopeId, q as popScopeId, cx as KeyComboImpl, cy as KeybindingImpl, _ as _export_sfc } from "./index-QvfM__ze.js";
+import { s as script$1, a as script$3 } from "./index-DpF-ptbJ.js";
+import { u as useKeybindingService } from "./keybindingService-Cak1En5n.js";
+import "./index-Q1cQr26V.js";
const _hoisted_1$1 = {
key: 0,
class: "px-2"
@@ -281,4 +280,4 @@ const KeybindingPanel = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "d
export {
KeybindingPanel as default
};
-//# sourceMappingURL=KeybindingPanel-Dc3C4lG1.js.map
+//# sourceMappingURL=KeybindingPanel-D6O16W_1.js.map
diff --git a/web/assets/ManualConfigurationView-B6ecEClB.css b/web/assets/ManualConfigurationView-CsirlNfV.css
similarity index 59%
rename from web/assets/ManualConfigurationView-B6ecEClB.css
rename to web/assets/ManualConfigurationView-CsirlNfV.css
index 06a5cc3e828..dba81a0bb66 100644
--- a/web/assets/ManualConfigurationView-B6ecEClB.css
+++ b/web/assets/ManualConfigurationView-CsirlNfV.css
@@ -1,7 +1,7 @@
-:root {
+.p-tag[data-v-dc169863] {
--p-tag-gap: 0.5rem;
}
-.comfy-installer {
+.comfy-installer[data-v-dc169863] {
margin-top: max(1rem, max(0px, calc((100vh - 42rem) * 0.5)));
}
diff --git a/web/assets/ManualConfigurationView-Bi_qHE-n.js b/web/assets/ManualConfigurationView-enyqGo0M.js
similarity index 81%
rename from web/assets/ManualConfigurationView-Bi_qHE-n.js
rename to web/assets/ManualConfigurationView-enyqGo0M.js
index 233f20fa777..43131f52ce2 100644
--- a/web/assets/ManualConfigurationView-Bi_qHE-n.js
+++ b/web/assets/ManualConfigurationView-enyqGo0M.js
@@ -1,9 +1,8 @@
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { d as defineComponent, a1 as useI18n, ab as ref, m as onMounted, o as openBlock, k as createBlock, M as withCtx, H as createBaseVNode, X as toDisplayString, N as createVNode, j as unref, aI as script, l as script$2, c0 as electronAPI } from "./index-DjNHn37O.js";
-import { s as script$1 } from "./index-jXPKy3pP.js";
-import { _ as _sfc_main$1 } from "./BaseViewTemplate-BNGF4K22.js";
-import "./index-5HFeZax4.js";
+import { d as defineComponent, a3 as useI18n, ad as ref, t as onMounted, o as openBlock, J as createBlock, P as withCtx, m as createBaseVNode, Z as toDisplayString, k as createVNode, j as unref, aK as script, bN as script$1, l as script$2, p as pushScopeId, q as popScopeId, bV as electronAPI, _ as _export_sfc } from "./index-QvfM__ze.js";
+import { _ as _sfc_main$1 } from "./BaseViewTemplate-BhQMaVFP.js";
+const _withScopeId = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-dc169863"), n = n(), popScopeId(), n), "_withScopeId");
const _hoisted_1 = { class: "comfy-installer grow flex flex-col gap-4 text-neutral-300 max-w-110" };
const _hoisted_2 = { class: "text-2xl font-semibold text-neutral-100" };
const _hoisted_3 = { class: "m-1 text-neutral-300" };
@@ -69,7 +68,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
};
}
});
+const ManualConfigurationView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-dc169863"]]);
export {
- _sfc_main as default
+ ManualConfigurationView as default
};
-//# sourceMappingURL=ManualConfigurationView-Bi_qHE-n.js.map
+//# sourceMappingURL=ManualConfigurationView-enyqGo0M.js.map
diff --git a/web/assets/MetricsConsentView-lSfLu4nr.js b/web/assets/MetricsConsentView-lSfLu4nr.js
new file mode 100644
index 00000000000..a53fdbb9cb0
--- /dev/null
+++ b/web/assets/MetricsConsentView-lSfLu4nr.js
@@ -0,0 +1,86 @@
+var __defProp = Object.defineProperty;
+var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
+import { _ as _sfc_main$1 } from "./BaseViewTemplate-BhQMaVFP.js";
+import { d as defineComponent, bz as useToast, a3 as useI18n, ad as ref, c2 as useRouter, o as openBlock, J as createBlock, P as withCtx, m as createBaseVNode, Z as toDisplayString, aG as createTextVNode, k as createVNode, j as unref, cc as script, l as script$1, bV as electronAPI } from "./index-QvfM__ze.js";
+const _hoisted_1 = { class: "h-full p-8 2xl:p-16 flex flex-col items-center justify-center" };
+const _hoisted_2 = { class: "bg-neutral-800 rounded-lg shadow-lg p-6 w-full max-w-[600px] flex flex-col gap-6" };
+const _hoisted_3 = { class: "text-3xl font-semibold text-neutral-100" };
+const _hoisted_4 = { class: "text-neutral-400" };
+const _hoisted_5 = { class: "text-neutral-400" };
+const _hoisted_6 = {
+ href: "https://comfy.org/privacy",
+ target: "_blank",
+ class: "text-blue-400 hover:text-blue-300 underline"
+};
+const _hoisted_7 = { class: "flex items-center gap-4" };
+const _hoisted_8 = {
+ id: "metricsDescription",
+ class: "text-neutral-100"
+};
+const _hoisted_9 = { class: "flex pt-6 justify-end" };
+const _sfc_main = /* @__PURE__ */ defineComponent({
+ __name: "MetricsConsentView",
+ setup(__props) {
+ const toast = useToast();
+ const { t } = useI18n();
+ const allowMetrics = ref(true);
+ const router = useRouter();
+ const isUpdating = ref(false);
+ const updateConsent = /* @__PURE__ */ __name(async () => {
+ isUpdating.value = true;
+ try {
+ await electronAPI().setMetricsConsent(allowMetrics.value);
+ } catch (error) {
+ toast.add({
+ severity: "error",
+ summary: t("install.errorUpdatingConsent"),
+ detail: t("install.errorUpdatingConsentDetail"),
+ life: 3e3
+ });
+ } finally {
+ isUpdating.value = false;
+ }
+ router.push("/");
+ }, "updateConsent");
+ return (_ctx, _cache) => {
+ const _component_BaseViewTemplate = _sfc_main$1;
+ return openBlock(), createBlock(_component_BaseViewTemplate, { dark: "" }, {
+ default: withCtx(() => [
+ createBaseVNode("div", _hoisted_1, [
+ createBaseVNode("div", _hoisted_2, [
+ createBaseVNode("h2", _hoisted_3, toDisplayString(_ctx.$t("install.helpImprove")), 1),
+ createBaseVNode("p", _hoisted_4, toDisplayString(_ctx.$t("install.updateConsent")), 1),
+ createBaseVNode("p", _hoisted_5, [
+ createTextVNode(toDisplayString(_ctx.$t("install.moreInfo")) + " ", 1),
+ createBaseVNode("a", _hoisted_6, toDisplayString(_ctx.$t("install.privacyPolicy")), 1),
+ createTextVNode(". ")
+ ]),
+ createBaseVNode("div", _hoisted_7, [
+ createVNode(unref(script), {
+ modelValue: allowMetrics.value,
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => allowMetrics.value = $event),
+ "aria-describedby": "metricsDescription"
+ }, null, 8, ["modelValue"]),
+ createBaseVNode("span", _hoisted_8, toDisplayString(allowMetrics.value ? _ctx.$t("install.metricsEnabled") : _ctx.$t("install.metricsDisabled")), 1)
+ ]),
+ createBaseVNode("div", _hoisted_9, [
+ createVNode(unref(script$1), {
+ label: _ctx.$t("g.ok"),
+ icon: "pi pi-check",
+ loading: isUpdating.value,
+ iconPos: "right",
+ onClick: updateConsent
+ }, null, 8, ["label", "loading"])
+ ])
+ ])
+ ])
+ ]),
+ _: 1
+ });
+ };
+ }
+});
+export {
+ _sfc_main as default
+};
+//# sourceMappingURL=MetricsConsentView-lSfLu4nr.js.map
diff --git a/web/assets/NotSupportedView-bFzHmqNj.css b/web/assets/NotSupportedView-DQerxQzi.css
similarity index 63%
rename from web/assets/NotSupportedView-bFzHmqNj.css
rename to web/assets/NotSupportedView-DQerxQzi.css
index 80ac329829b..3b90d2796be 100644
--- a/web/assets/NotSupportedView-bFzHmqNj.css
+++ b/web/assets/NotSupportedView-DQerxQzi.css
@@ -1,17 +1,17 @@
-.sad-container {
+.sad-container[data-v-ebb20958] {
display: grid;
align-items: center;
justify-content: space-evenly;
grid-template-columns: 25rem 1fr;
-& > * {
+&[data-v-ebb20958] > * {
grid-row: 1;
}
}
-.sad-text {
+.sad-text[data-v-ebb20958] {
grid-column: 1/3;
}
-.sad-girl {
+.sad-girl[data-v-ebb20958] {
grid-column: 2/3;
width: min(75vw, 100vh);
}
diff --git a/web/assets/NotSupportedView-Drz3x2d-.js b/web/assets/NotSupportedView-Vc8_xWgH.js
similarity index 81%
rename from web/assets/NotSupportedView-Drz3x2d-.js
rename to web/assets/NotSupportedView-Vc8_xWgH.js
index a24af84a243..ebc712a47aa 100644
--- a/web/assets/NotSupportedView-Drz3x2d-.js
+++ b/web/assets/NotSupportedView-Vc8_xWgH.js
@@ -1,14 +1,15 @@
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { d as defineComponent, bW as useRouter, r as resolveDirective, o as openBlock, k as createBlock, M as withCtx, H as createBaseVNode, X as toDisplayString, N as createVNode, j as unref, l as script, i as withDirectives } from "./index-DjNHn37O.js";
-import { _ as _sfc_main$1 } from "./BaseViewTemplate-BNGF4K22.js";
+import { d as defineComponent, c2 as useRouter, r as resolveDirective, o as openBlock, J as createBlock, P as withCtx, m as createBaseVNode, Z as toDisplayString, k as createVNode, j as unref, l as script, i as withDirectives, p as pushScopeId, q as popScopeId, _ as _export_sfc } from "./index-QvfM__ze.js";
+import { _ as _sfc_main$1 } from "./BaseViewTemplate-BhQMaVFP.js";
const _imports_0 = "" + new URL("images/sad_girl.png", import.meta.url).href;
+const _withScopeId = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-ebb20958"), n = n(), popScopeId(), n), "_withScopeId");
const _hoisted_1 = { class: "sad-container" };
-const _hoisted_2 = /* @__PURE__ */ createBaseVNode("img", {
+const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createBaseVNode("img", {
class: "sad-girl",
src: _imports_0,
alt: "Sad girl illustration"
-}, null, -1);
+}, null, -1));
const _hoisted_3 = { class: "no-drag sad-text flex items-center" };
const _hoisted_4 = { class: "flex flex-col gap-8 p-8 min-w-110" };
const _hoisted_5 = { class: "text-4xl font-bold text-red-500" };
@@ -80,7 +81,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
};
}
});
+const NotSupportedView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ebb20958"]]);
export {
- _sfc_main as default
+ NotSupportedView as default
};
-//# sourceMappingURL=NotSupportedView-Drz3x2d-.js.map
+//# sourceMappingURL=NotSupportedView-Vc8_xWgH.js.map
diff --git a/web/assets/ServerConfigPanel-Be4StJmv.js b/web/assets/ServerConfigPanel-B-w0HFlz.js
similarity index 91%
rename from web/assets/ServerConfigPanel-Be4StJmv.js
rename to web/assets/ServerConfigPanel-B-w0HFlz.js
index e84d2d43a09..d00cf672a7c 100644
--- a/web/assets/ServerConfigPanel-Be4StJmv.js
+++ b/web/assets/ServerConfigPanel-B-w0HFlz.js
@@ -1,7 +1,7 @@
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { H as createBaseVNode, o as openBlock, f as createElementBlock, Z as markRaw, d as defineComponent, a as useSettingStore, aS as storeToRefs, a5 as watch, cO as useCopyToClipboard, a1 as useI18n, k as createBlock, M as withCtx, j as unref, bZ as script, X as toDisplayString, E as renderList, F as Fragment, N as createVNode, l as script$1, I as createCommentVNode, bQ as script$2, cP as FormItem, cp as _sfc_main$1, c0 as electronAPI } from "./index-DjNHn37O.js";
-import { u as useServerConfigStore } from "./serverConfigStore-CvyKFVuP.js";
+import { m as createBaseVNode, o as openBlock, f as createElementBlock, a0 as markRaw, d as defineComponent, a as useSettingStore, aS as storeToRefs, a7 as watch, cW as useCopyToClipboard, a3 as useI18n, J as createBlock, P as withCtx, j as unref, c6 as script, Z as toDisplayString, I as renderList, H as Fragment, k as createVNode, l as script$1, L as createCommentVNode, c4 as script$2, cX as FormItem, cw as _sfc_main$1, bV as electronAPI } from "./index-QvfM__ze.js";
+import { u as useServerConfigStore } from "./serverConfigStore-DCme3xlV.js";
const _hoisted_1$1 = {
viewBox: "0 0 24 24",
width: "1.2em",
@@ -155,4 +155,4 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
export {
_sfc_main as default
};
-//# sourceMappingURL=ServerConfigPanel-Be4StJmv.js.map
+//# sourceMappingURL=ServerConfigPanel-B-w0HFlz.js.map
diff --git a/web/assets/ServerStartView-48wfE1MS.js b/web/assets/ServerStartView-48wfE1MS.js
new file mode 100644
index 00000000000..4b74f5ad1e8
--- /dev/null
+++ b/web/assets/ServerStartView-48wfE1MS.js
@@ -0,0 +1,101 @@
+var __defProp = Object.defineProperty;
+var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
+import { d as defineComponent, a3 as useI18n, ad as ref, c7 as ProgressStatus, t as onMounted, o as openBlock, J as createBlock, P as withCtx, m as createBaseVNode, aG as createTextVNode, Z as toDisplayString, j as unref, f as createElementBlock, L as createCommentVNode, k as createVNode, l as script, i as withDirectives, v as vShow, c8 as BaseTerminal, p as pushScopeId, q as popScopeId, bV as electronAPI, _ as _export_sfc } from "./index-QvfM__ze.js";
+import { _ as _sfc_main$1 } from "./BaseViewTemplate-BhQMaVFP.js";
+const _withScopeId = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-4140d62b"), n = n(), popScopeId(), n), "_withScopeId");
+const _hoisted_1 = { class: "flex flex-col w-full h-full items-center" };
+const _hoisted_2 = { class: "text-2xl font-bold" };
+const _hoisted_3 = { key: 0 };
+const _hoisted_4 = {
+ key: 0,
+ class: "flex flex-col items-center gap-4"
+};
+const _hoisted_5 = { class: "flex items-center my-4 gap-2" };
+const _sfc_main = /* @__PURE__ */ defineComponent({
+ __name: "ServerStartView",
+ setup(__props) {
+ const electron = electronAPI();
+ const { t } = useI18n();
+ const status = ref(ProgressStatus.INITIAL_STATE);
+ const electronVersion = ref("");
+ let xterm;
+ const terminalVisible = ref(true);
+ const updateProgress = /* @__PURE__ */ __name(({ status: newStatus }) => {
+ status.value = newStatus;
+ if (newStatus === ProgressStatus.ERROR) terminalVisible.value = false;
+ else xterm?.clear();
+ }, "updateProgress");
+ const terminalCreated = /* @__PURE__ */ __name(({ terminal, useAutoSize }, root) => {
+ xterm = terminal;
+ useAutoSize({ root, autoRows: true, autoCols: true });
+ electron.onLogMessage((message) => {
+ terminal.write(message);
+ });
+ terminal.options.cursorBlink = false;
+ terminal.options.disableStdin = true;
+ terminal.options.cursorInactiveStyle = "block";
+ }, "terminalCreated");
+ const reinstall = /* @__PURE__ */ __name(() => electron.reinstall(), "reinstall");
+ const reportIssue = /* @__PURE__ */ __name(() => {
+ window.open("https://forum.comfy.org/c/v1-feedback/", "_blank");
+ }, "reportIssue");
+ const openLogs = /* @__PURE__ */ __name(() => electron.openLogsFolder(), "openLogs");
+ onMounted(async () => {
+ electron.sendReady();
+ electron.onProgressUpdate(updateProgress);
+ electronVersion.value = await electron.getElectronVersion();
+ });
+ return (_ctx, _cache) => {
+ return openBlock(), createBlock(_sfc_main$1, {
+ dark: "",
+ class: "flex-col"
+ }, {
+ default: withCtx(() => [
+ createBaseVNode("div", _hoisted_1, [
+ createBaseVNode("h2", _hoisted_2, [
+ createTextVNode(toDisplayString(unref(t)(`serverStart.process.${status.value}`)) + " ", 1),
+ status.value === unref(ProgressStatus).ERROR ? (openBlock(), createElementBlock("span", _hoisted_3, " v" + toDisplayString(electronVersion.value), 1)) : createCommentVNode("", true)
+ ]),
+ status.value === unref(ProgressStatus).ERROR ? (openBlock(), createElementBlock("div", _hoisted_4, [
+ createBaseVNode("div", _hoisted_5, [
+ createVNode(unref(script), {
+ icon: "pi pi-flag",
+ severity: "secondary",
+ label: unref(t)("serverStart.reportIssue"),
+ onClick: reportIssue
+ }, null, 8, ["label"]),
+ createVNode(unref(script), {
+ icon: "pi pi-file",
+ severity: "secondary",
+ label: unref(t)("serverStart.openLogs"),
+ onClick: openLogs
+ }, null, 8, ["label"]),
+ createVNode(unref(script), {
+ icon: "pi pi-refresh",
+ label: unref(t)("serverStart.reinstall"),
+ onClick: reinstall
+ }, null, 8, ["label"])
+ ]),
+ !terminalVisible.value ? (openBlock(), createBlock(unref(script), {
+ key: 0,
+ icon: "pi pi-search",
+ severity: "secondary",
+ label: unref(t)("serverStart.showTerminal"),
+ onClick: _cache[0] || (_cache[0] = ($event) => terminalVisible.value = true)
+ }, null, 8, ["label"])) : createCommentVNode("", true)
+ ])) : createCommentVNode("", true),
+ withDirectives(createVNode(BaseTerminal, { onCreated: terminalCreated }, null, 512), [
+ [vShow, terminalVisible.value]
+ ])
+ ])
+ ]),
+ _: 1
+ });
+ };
+ }
+});
+const ServerStartView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4140d62b"]]);
+export {
+ ServerStartView as default
+};
+//# sourceMappingURL=ServerStartView-48wfE1MS.js.map
diff --git a/web/assets/ServerStartView-CIDTUh4x.js b/web/assets/ServerStartView-CIDTUh4x.js
deleted file mode 100644
index 6567eea213f..00000000000
--- a/web/assets/ServerStartView-CIDTUh4x.js
+++ /dev/null
@@ -1,98 +0,0 @@
-var __defProp = Object.defineProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { d as defineComponent, a1 as useI18n, ab as ref, b_ as ProgressStatus, m as onMounted, o as openBlock, k as createBlock, M as withCtx, H as createBaseVNode, aE as createTextVNode, X as toDisplayString, j as unref, f as createElementBlock, I as createCommentVNode, N as createVNode, l as script, i as withDirectives, v as vShow, b$ as BaseTerminal, aL as pushScopeId, aM as popScopeId, c0 as electronAPI, _ as _export_sfc } from "./index-DjNHn37O.js";
-import { _ as _sfc_main$1 } from "./BaseViewTemplate-BNGF4K22.js";
-const _withScopeId = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-42c1131d"), n = n(), popScopeId(), n), "_withScopeId");
-const _hoisted_1 = { class: "text-2xl font-bold" };
-const _hoisted_2 = { key: 0 };
-const _hoisted_3 = {
- key: 0,
- class: "flex flex-col items-center gap-4"
-};
-const _hoisted_4 = { class: "flex items-center my-4 gap-2" };
-const _sfc_main = /* @__PURE__ */ defineComponent({
- __name: "ServerStartView",
- setup(__props) {
- const electron = electronAPI();
- const { t } = useI18n();
- const status = ref(ProgressStatus.INITIAL_STATE);
- const electronVersion = ref("");
- let xterm;
- const terminalVisible = ref(true);
- const updateProgress = /* @__PURE__ */ __name(({ status: newStatus }) => {
- status.value = newStatus;
- if (newStatus === ProgressStatus.ERROR) terminalVisible.value = false;
- else xterm?.clear();
- }, "updateProgress");
- const terminalCreated = /* @__PURE__ */ __name(({ terminal, useAutoSize }, root) => {
- xterm = terminal;
- useAutoSize(root, true, true);
- electron.onLogMessage((message) => {
- terminal.write(message);
- });
- terminal.options.cursorBlink = false;
- terminal.options.disableStdin = true;
- terminal.options.cursorInactiveStyle = "block";
- }, "terminalCreated");
- const reinstall = /* @__PURE__ */ __name(() => electron.reinstall(), "reinstall");
- const reportIssue = /* @__PURE__ */ __name(() => {
- window.open("https://forum.comfy.org/c/v1-feedback/", "_blank");
- }, "reportIssue");
- const openLogs = /* @__PURE__ */ __name(() => electron.openLogsFolder(), "openLogs");
- onMounted(async () => {
- electron.sendReady();
- electron.onProgressUpdate(updateProgress);
- electronVersion.value = await electron.getElectronVersion();
- });
- return (_ctx, _cache) => {
- return openBlock(), createBlock(_sfc_main$1, {
- dark: "",
- class: "flex-col"
- }, {
- default: withCtx(() => [
- createBaseVNode("h2", _hoisted_1, [
- createTextVNode(toDisplayString(unref(t)(`serverStart.process.${status.value}`)) + " ", 1),
- status.value === unref(ProgressStatus).ERROR ? (openBlock(), createElementBlock("span", _hoisted_2, " v" + toDisplayString(electronVersion.value), 1)) : createCommentVNode("", true)
- ]),
- status.value === unref(ProgressStatus).ERROR ? (openBlock(), createElementBlock("div", _hoisted_3, [
- createBaseVNode("div", _hoisted_4, [
- createVNode(unref(script), {
- icon: "pi pi-flag",
- severity: "secondary",
- label: unref(t)("serverStart.reportIssue"),
- onClick: reportIssue
- }, null, 8, ["label"]),
- createVNode(unref(script), {
- icon: "pi pi-file",
- severity: "secondary",
- label: unref(t)("serverStart.openLogs"),
- onClick: openLogs
- }, null, 8, ["label"]),
- createVNode(unref(script), {
- icon: "pi pi-refresh",
- label: unref(t)("serverStart.reinstall"),
- onClick: reinstall
- }, null, 8, ["label"])
- ]),
- !terminalVisible.value ? (openBlock(), createBlock(unref(script), {
- key: 0,
- icon: "pi pi-search",
- severity: "secondary",
- label: unref(t)("serverStart.showTerminal"),
- onClick: _cache[0] || (_cache[0] = ($event) => terminalVisible.value = true)
- }, null, 8, ["label"])) : createCommentVNode("", true)
- ])) : createCommentVNode("", true),
- withDirectives(createVNode(BaseTerminal, { onCreated: terminalCreated }, null, 512), [
- [vShow, terminalVisible.value]
- ])
- ]),
- _: 1
- });
- };
- }
-});
-const ServerStartView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-42c1131d"]]);
-export {
- ServerStartView as default
-};
-//# sourceMappingURL=ServerStartView-CIDTUh4x.js.map
diff --git a/web/assets/ServerStartView-CnyN4Ib6.css b/web/assets/ServerStartView-CJiwVDQY.css
similarity index 64%
rename from web/assets/ServerStartView-CnyN4Ib6.css
rename to web/assets/ServerStartView-CJiwVDQY.css
index 60a63414f7f..7d53a927c9d 100644
--- a/web/assets/ServerStartView-CnyN4Ib6.css
+++ b/web/assets/ServerStartView-CJiwVDQY.css
@@ -1,5 +1,5 @@
-[data-v-42c1131d] .xterm-helper-textarea {
+[data-v-4140d62b] .xterm-helper-textarea {
/* Hide this as it moves all over when uv is running */
display: none;
}
diff --git a/web/assets/UserSelectView-B3jYchWu.js b/web/assets/UserSelectView-CXmVKOeK.js
similarity index 89%
rename from web/assets/UserSelectView-B3jYchWu.js
rename to web/assets/UserSelectView-CXmVKOeK.js
index 9d2dda86c28..88b4d3f3d6b 100644
--- a/web/assets/UserSelectView-B3jYchWu.js
+++ b/web/assets/UserSelectView-CXmVKOeK.js
@@ -1,7 +1,7 @@
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { d as defineComponent, aX as useUserStore, bW as useRouter, ab as ref, c as computed, m as onMounted, o as openBlock, k as createBlock, M as withCtx, H as createBaseVNode, X as toDisplayString, N as createVNode, bX as withKeys, j as unref, av as script, bQ as script$1, bY as script$2, bZ as script$3, aE as createTextVNode, I as createCommentVNode, l as script$4 } from "./index-DjNHn37O.js";
-import { _ as _sfc_main$1 } from "./BaseViewTemplate-BNGF4K22.js";
+import { d as defineComponent, aX as useUserStore, c2 as useRouter, ad as ref, c as computed, t as onMounted, o as openBlock, J as createBlock, P as withCtx, m as createBaseVNode, Z as toDisplayString, k as createVNode, c3 as withKeys, j as unref, ax as script, c4 as script$1, c5 as script$2, c6 as script$3, aG as createTextVNode, L as createCommentVNode, l as script$4 } from "./index-QvfM__ze.js";
+import { _ as _sfc_main$1 } from "./BaseViewTemplate-BhQMaVFP.js";
const _hoisted_1 = {
id: "comfy-user-selection",
class: "min-w-84 relative rounded-lg bg-[var(--comfy-menu-bg)] p-5 px-10 shadow-lg"
@@ -99,4 +99,4 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
export {
_sfc_main as default
};
-//# sourceMappingURL=UserSelectView-B3jYchWu.js.map
+//# sourceMappingURL=UserSelectView-CXmVKOeK.js.map
diff --git a/web/assets/WelcomeView-N0ZXLjdi.js b/web/assets/WelcomeView-C8whKl15.js
similarity index 79%
rename from web/assets/WelcomeView-N0ZXLjdi.js
rename to web/assets/WelcomeView-C8whKl15.js
index bec1292ec37..7625ec43bed 100644
--- a/web/assets/WelcomeView-N0ZXLjdi.js
+++ b/web/assets/WelcomeView-C8whKl15.js
@@ -1,7 +1,7 @@
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { d as defineComponent, bW as useRouter, o as openBlock, k as createBlock, M as withCtx, H as createBaseVNode, X as toDisplayString, N as createVNode, j as unref, l as script, aL as pushScopeId, aM as popScopeId, _ as _export_sfc } from "./index-DjNHn37O.js";
-import { _ as _sfc_main$1 } from "./BaseViewTemplate-BNGF4K22.js";
+import { d as defineComponent, c2 as useRouter, o as openBlock, J as createBlock, P as withCtx, m as createBaseVNode, Z as toDisplayString, k as createVNode, j as unref, l as script, p as pushScopeId, q as popScopeId, _ as _export_sfc } from "./index-QvfM__ze.js";
+import { _ as _sfc_main$1 } from "./BaseViewTemplate-BhQMaVFP.js";
const _withScopeId = /* @__PURE__ */ __name((n) => (pushScopeId("data-v-7dfaf74c"), n = n(), popScopeId(), n), "_withScopeId");
const _hoisted_1 = { class: "flex flex-col items-center justify-center gap-8 p-8" };
const _hoisted_2 = { class: "animated-gradient-text text-glow select-none" };
@@ -37,4 +37,4 @@ const WelcomeView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-
export {
WelcomeView as default
};
-//# sourceMappingURL=WelcomeView-N0ZXLjdi.js.map
+//# sourceMappingURL=WelcomeView-C8whKl15.js.map
diff --git a/web/assets/index-5HFeZax4.js b/web/assets/index-5HFeZax4.js
deleted file mode 100644
index b4bc111e926..00000000000
--- a/web/assets/index-5HFeZax4.js
+++ /dev/null
@@ -1,27 +0,0 @@
-var __defProp = Object.defineProperty;
-var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { ct as script$1, H as createBaseVNode, o as openBlock, f as createElementBlock, D as mergeProps } from "./index-DjNHn37O.js";
-var script = {
- name: "PlusIcon",
- "extends": script$1
-};
-var _hoisted_1 = /* @__PURE__ */ createBaseVNode("path", {
- d: "M7.67742 6.32258V0.677419C7.67742 0.497757 7.60605 0.325452 7.47901 0.198411C7.35197 0.0713707 7.17966 0 7 0C6.82034 0 6.64803 0.0713707 6.52099 0.198411C6.39395 0.325452 6.32258 0.497757 6.32258 0.677419V6.32258H0.677419C0.497757 6.32258 0.325452 6.39395 0.198411 6.52099C0.0713707 6.64803 0 6.82034 0 7C0 7.17966 0.0713707 7.35197 0.198411 7.47901C0.325452 7.60605 0.497757 7.67742 0.677419 7.67742H6.32258V13.3226C6.32492 13.5015 6.39704 13.6725 6.52358 13.799C6.65012 13.9255 6.82106 13.9977 7 14C7.17966 14 7.35197 13.9286 7.47901 13.8016C7.60605 13.6745 7.67742 13.5022 7.67742 13.3226V7.67742H13.3226C13.5022 7.67742 13.6745 7.60605 13.8016 7.47901C13.9286 7.35197 14 7.17966 14 7C13.9977 6.82106 13.9255 6.65012 13.799 6.52358C13.6725 6.39704 13.5015 6.32492 13.3226 6.32258H7.67742Z",
- fill: "currentColor"
-}, null, -1);
-var _hoisted_2 = [_hoisted_1];
-function render(_ctx, _cache, $props, $setup, $data, $options) {
- return openBlock(), createElementBlock("svg", mergeProps({
- width: "14",
- height: "14",
- viewBox: "0 0 14 14",
- fill: "none",
- xmlns: "http://www.w3.org/2000/svg"
- }, _ctx.pti()), _hoisted_2, 16);
-}
-__name(render, "render");
-script.render = render;
-export {
- script as s
-};
-//# sourceMappingURL=index-5HFeZax4.js.map
diff --git a/web/assets/index-t-sFBuUC.css b/web/assets/index-Cf-n7v0V.css
similarity index 97%
rename from web/assets/index-t-sFBuUC.css
rename to web/assets/index-Cf-n7v0V.css
index f588a35ce77..b8e6a53ad4b 100644
--- a/web/assets/index-t-sFBuUC.css
+++ b/web/assets/index-Cf-n7v0V.css
@@ -2131,6 +2131,9 @@
.z-\[1000\]{
z-index: 1000;
}
+ .z-\[9999\]{
+ z-index: 9999;
+ }
.m-0{
margin: 0px;
}
@@ -2253,6 +2256,9 @@
.h-0{
height: 0px;
}
+ .h-1{
+ height: 0.25rem;
+ }
.h-16{
height: 4rem;
}
@@ -2271,6 +2277,9 @@
.h-\[30rem\]{
height: 30rem;
}
+ .h-\[var\(--comfy-topbar-height\)\]{
+ height: var(--comfy-topbar-height);
+ }
.h-full{
height: 100%;
}
@@ -2341,6 +2350,9 @@
.w-screen{
width: 100vw;
}
+ .min-w-0{
+ min-width: 0px;
+ }
.min-w-110{
min-width: 32rem;
}
@@ -2359,6 +2371,9 @@
.max-w-\[150px\]{
max-width: 150px;
}
+ .max-w-\[600px\]{
+ max-width: 600px;
+ }
.max-w-full{
max-width: 100%;
}
@@ -2519,6 +2534,9 @@
.text-wrap{
text-wrap: wrap;
}
+ .text-nowrap{
+ text-wrap: nowrap;
+ }
.rounded{
border-radius: 0.25rem;
}
@@ -2528,16 +2546,35 @@
.rounded-none{
border-radius: 0px;
}
+ .rounded-t-lg{
+ border-top-left-radius: 0.5rem;
+ border-top-right-radius: 0.5rem;
+ }
.border{
border-width: 1px;
}
+ .border-0{
+ border-width: 0px;
+ }
.border-x-0{
border-left-width: 0px;
border-right-width: 0px;
}
+ .border-b{
+ border-bottom-width: 1px;
+ }
+ .border-l{
+ border-left-width: 1px;
+ }
+ .border-r{
+ border-right-width: 1px;
+ }
.border-t-0{
border-top-width: 0px;
}
+ .border-solid{
+ border-style: solid;
+ }
.border-none{
border-style: none;
}
@@ -2635,6 +2672,9 @@
.p-5{
padding: 1.25rem;
}
+ .p-6{
+ padding: 1.5rem;
+ }
.p-8{
padding: 2rem;
}
@@ -2701,6 +2741,9 @@
.text-2xl{
font-size: 1.5rem;
}
+ .text-3xl{
+ font-size: 1.875rem;
+ }
.text-4xl{
font-size: 2.25rem;
}
@@ -2783,6 +2826,9 @@
--tw-text-opacity: 1;
color: rgb(239 68 68 / var(--tw-text-opacity));
}
+ .underline{
+ text-decoration-line: underline;
+ }
.no-underline{
text-decoration-line: none;
}
@@ -2868,6 +2914,7 @@
--bg-color: #fff;
--comfy-menu-bg: #353535;
--comfy-menu-secondary-bg: #292929;
+ --comfy-topbar-height: 2.5rem;
--comfy-input-bg: #222;
--input-text: #ddd;
--descrip-text: #999;
@@ -3625,24 +3672,33 @@ audio.comfy-audio.empty-audio-widget {
padding: var(--comfy-tree-explorer-item-padding) !important;
}
+/* [Desktop] Electron window specific styles */
+.app-drag {
+ app-region: drag;
+}
+
+.no-drag {
+ app-region: no-drag;
+}
+
+.window-actions-spacer {
+ width: calc(100vw - env(titlebar-area-width, 100vw));
+}
+/* End of [Desktop] Electron window specific styles */
.hover\:bg-neutral-700:hover{
--tw-bg-opacity: 1;
background-color: rgb(64 64 64 / var(--tw-bg-opacity));
}
-
.hover\:bg-opacity-75:hover{
--tw-bg-opacity: 0.75;
}
-
.hover\:text-blue-300:hover{
--tw-text-opacity: 1;
color: rgb(144 205 244 / var(--tw-text-opacity));
}
-
.hover\:opacity-100:hover{
opacity: 1;
}
-
@media (min-width: 768px){
.md\:flex{
@@ -3653,7 +3709,6 @@ audio.comfy-audio.empty-audio-widget {
display: none;
}
}
-
@media (min-width: 1536px){
.\32xl\:mx-4{
@@ -3689,8 +3744,11 @@ audio.comfy-audio.empty-audio-widget {
padding-left: 1rem;
padding-right: 1rem;
}
-}
+ .\32xl\:text-sm{
+ font-size: 0.875rem;
+ }
+}
@media (prefers-color-scheme: dark){
.dark\:bg-gray-800{
@@ -3740,17 +3798,17 @@ audio.comfy-audio.empty-audio-widget {
margin-bottom: 1rem;
}
-.comfy-error-report[data-v-ddf3e2da] {
+.comfy-error-report[data-v-09b72a20] {
display: flex;
flex-direction: column;
gap: 1rem;
}
-.action-container[data-v-ddf3e2da] {
+.action-container[data-v-09b72a20] {
display: flex;
gap: 1rem;
justify-content: flex-end;
}
-.wrapper-pre[data-v-ddf3e2da] {
+.wrapper-pre[data-v-09b72a20] {
white-space: pre-wrap;
word-wrap: break-word;
}
@@ -3834,7 +3892,7 @@ audio.comfy-audio.empty-audio-widget {
padding-top: 0px !important;
}
-.settings-container[data-v-67f71ae9] {
+.settings-container[data-v-2e21278f] {
display: flex;
height: 70vh;
width: 60vw;
@@ -3842,25 +3900,25 @@ audio.comfy-audio.empty-audio-widget {
overflow: hidden;
}
@media (max-width: 768px) {
-.settings-container[data-v-67f71ae9] {
+.settings-container[data-v-2e21278f] {
flex-direction: column;
height: auto;
width: 80vw;
}
-.settings-sidebar[data-v-67f71ae9] {
+.settings-sidebar[data-v-2e21278f] {
width: 100%;
}
-.settings-content[data-v-67f71ae9] {
+.settings-content[data-v-2e21278f] {
height: 350px;
}
}
/* Show a separator line above the Keybinding tab */
/* This indicates the start of custom setting panels */
-.settings-sidebar[data-v-67f71ae9] .p-listbox-option[aria-label='Keybinding'] {
+.settings-sidebar[data-v-2e21278f] .p-listbox-option[aria-label='Keybinding'] {
position: relative;
}
-.settings-sidebar[data-v-67f71ae9] .p-listbox-option[aria-label='Keybinding']::before {
+.settings-sidebar[data-v-2e21278f] .p-listbox-option[aria-label='Keybinding']::before {
position: absolute;
top: 0px;
left: 0px;
@@ -3878,15 +3936,15 @@ audio.comfy-audio.empty-audio-widget {
margin-left: 0.5rem;
}
-.p-card[data-v-d65acb9a] {
+.p-card[data-v-ffc83afa] {
--p-card-body-padding: 10px 0 0 0;
overflow: hidden;
}
-[data-v-d65acb9a] .p-card-subtitle {
+[data-v-ffc83afa] .p-card-subtitle {
text-align: center;
}
-.carousel[data-v-fc26284b] {
+.carousel[data-v-d9962275] {
width: 66vw;
}
/**
@@ -4123,18 +4181,18 @@ audio.comfy-audio.empty-audio-widget {
overflow-y: hidden;
}
-[data-v-6187144a] .p-terminal .xterm {
+[data-v-90a7f075] .p-terminal .xterm {
overflow-x: auto;
}
-[data-v-6187144a] .p-terminal .xterm-screen {
+[data-v-90a7f075] .p-terminal .xterm-screen {
background-color: black;
overflow-y: hidden;
}
-[data-v-b27b58f4] .p-terminal .xterm {
+[data-v-03daf1c8] .p-terminal .xterm {
overflow-x: auto;
}
-[data-v-b27b58f4] .p-terminal .xterm-screen {
+[data-v-03daf1c8] .p-terminal .xterm-screen {
background-color: black;
overflow-y: hidden;
}
@@ -4494,16 +4552,28 @@ audio.comfy-audio.empty-audio-widget {
pointer-events: none;
}
-[data-v-9159c070] .p-toolbar-end .p-button {
+[data-v-5e759e25] .p-toolbar-end .p-button {
+
padding-top: 0.25rem;
+
padding-bottom: 0.25rem
}
@media (min-width: 1536px) {
-[data-v-9159c070] .p-toolbar-end .p-button {
+[data-v-5e759e25] .p-toolbar-end .p-button {
+
padding-top: 0.5rem;
+
padding-bottom: 0.5rem
}
}
+[data-v-5e759e25] .p-toolbar-start {
+
+ min-width: 0px;
+
+ flex: 1 1 0%;
+
+ overflow: hidden
+}
.model_preview[data-v-32e6c4d9] {
background-color: var(--comfy-menu-bg);
@@ -4736,18 +4806,18 @@ audio.comfy-audio.empty-audio-widget {
width: 100%
}
-.p-selectbutton .p-button[data-v-4b8adc78] {
+.p-selectbutton .p-button[data-v-05364174] {
padding: 0.5rem;
}
-.p-selectbutton .p-button .pi[data-v-4b8adc78] {
+.p-selectbutton .p-button .pi[data-v-05364174] {
font-size: 1.5rem;
}
-.field[data-v-4b8adc78] {
+.field[data-v-05364174] {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
-.color-picker-container[data-v-4b8adc78] {
+.color-picker-container[data-v-05364174] {
display: flex;
align-items: center;
gap: 0.5rem;
@@ -4767,10 +4837,10 @@ audio.comfy-audio.empty-audio-widget {
}
}
-.comfy-image-wrap[data-v-ffe66146] {
+.comfy-image-wrap[data-v-a748ccd8] {
display: contents;
}
-.comfy-image-blur[data-v-ffe66146] {
+.comfy-image-blur[data-v-a748ccd8] {
position: absolute;
top: 0;
left: 0;
@@ -4779,7 +4849,7 @@ audio.comfy-audio.empty-audio-widget {
-o-object-fit: cover;
object-fit: cover;
}
-.comfy-image-main[data-v-ffe66146] {
+.comfy-image-main[data-v-a748ccd8] {
width: 100%;
height: 100%;
-o-object-fit: cover;
@@ -4788,19 +4858,19 @@ audio.comfy-audio.empty-audio-widget {
object-position: center;
z-index: 1;
}
-.contain .comfy-image-wrap[data-v-ffe66146] {
+.contain .comfy-image-wrap[data-v-a748ccd8] {
position: relative;
width: 100%;
height: 100%;
}
-.contain .comfy-image-main[data-v-ffe66146] {
+.contain .comfy-image-main[data-v-a748ccd8] {
-o-object-fit: contain;
object-fit: contain;
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
position: absolute;
}
-.broken-image-placeholder[data-v-ffe66146] {
+.broken-image-placeholder[data-v-a748ccd8] {
display: flex;
flex-direction: column;
align-items: center;
@@ -4809,7 +4879,7 @@ audio.comfy-audio.empty-audio-widget {
height: 100%;
margin: 2rem;
}
-.broken-image-placeholder i[data-v-ffe66146] {
+.broken-image-placeholder i[data-v-a748ccd8] {
font-size: 3rem;
margin-bottom: 0.5rem;
}
@@ -4827,7 +4897,7 @@ img.galleria-image {
z-index: 1;
}
-.result-container[data-v-61515e14] {
+.result-container[data-v-2403edc6] {
width: 100%;
height: 100%;
aspect-ratio: 1 / 1;
@@ -4837,7 +4907,7 @@ img.galleria-image {
justify-content: center;
align-items: center;
}
-.preview-mask[data-v-61515e14] {
+.preview-mask[data-v-2403edc6] {
position: absolute;
left: 50%;
top: 50%;
@@ -4849,7 +4919,7 @@ img.galleria-image {
transition: opacity 0.3s ease;
z-index: 1;
}
-.result-container:hover .preview-mask[data-v-61515e14] {
+.result-container:hover .preview-mask[data-v-2403edc6] {
opacity: 1;
}
diff --git a/web/assets/index-B5F0uxTQ.js b/web/assets/index-DpF-ptbJ.js
similarity index 99%
rename from web/assets/index-B5F0uxTQ.js
rename to web/assets/index-DpF-ptbJ.js
index 78222d183bf..792856c6699 100644
--- a/web/assets/index-B5F0uxTQ.js
+++ b/web/assets/index-DpF-ptbJ.js
@@ -1,8 +1,7 @@
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { B as BaseStyle, q as script$s, ct as script$t, H as createBaseVNode, o as openBlock, f as createElementBlock, D as mergeProps, X as toDisplayString, S as Ripple, r as resolveDirective, i as withDirectives, k as createBlock, G as resolveDynamicComponent, bY as script$u, aB as resolveComponent, T as normalizeClass, aD as createSlots, M as withCtx, bz as script$v, bw as script$w, F as Fragment, E as renderList, aE as createTextVNode, bq as setAttribute, ak as UniqueComponentId, bo as normalizeProps, J as renderSlot, I as createCommentVNode, R as equals, bk as script$x, c8 as script$y, cu as getFirstFocusableElement, an as OverlayEventBus, A as getVNodeProp, am as resolveFieldData, cv as invokeElementMethod, O as getAttribute, cw as getNextElementSibling, y as getOuterWidth, cx as getPreviousElementSibling, l as script$z, ay as script$A, W as script$B, bn as script$D, aj as isNotEmpty, bM as withModifiers, z as getOuterHeight, cy as _default, al as ZIndex, Q as focus, ap as addStyle, ar as absolutePosition, as as ConnectedOverlayScrollHandler, at as isTouchDevice, cz as FilterOperator, ax as script$E, cA as FocusTrap, N as createVNode, aC as Transition, bX as withKeys, cB as getIndex, aW as script$G, cC as isClickable, cD as clearSelection, cE as localeComparator, cF as sort, cG as FilterService, cn as FilterMatchMode, P as findSingle, c1 as findIndexInList, c2 as find, cH as exportCSV, U as getOffset, cI as getHiddenElementOuterWidth, cJ as getHiddenElementOuterHeight, cK as reorderArray, cL as getWindowScrollTop, cM as removeClass, cN as addClass, ao as isEmpty, aw as script$H, az as script$I } from "./index-DjNHn37O.js";
-import { s as script$C } from "./index-B-aVupP5.js";
-import { s as script$F } from "./index-5HFeZax4.js";
+import { B as BaseStyle, y as script$s, cA as script$t, m as createBaseVNode, o as openBlock, f as createElementBlock, G as mergeProps, Z as toDisplayString, U as Ripple, r as resolveDirective, i as withDirectives, J as createBlock, K as resolveDynamicComponent, c5 as script$u, aD as resolveComponent, V as normalizeClass, aF as createSlots, P as withCtx, bG as script$v, bD as script$w, H as Fragment, I as renderList, aG as createTextVNode, bx as setAttribute, am as UniqueComponentId, bv as normalizeProps, M as renderSlot, L as createCommentVNode, T as equals, br as script$x, cg as script$y, cB as getFirstFocusableElement, ap as OverlayEventBus, E as getVNodeProp, ao as resolveFieldData, cC as invokeElementMethod, Q as getAttribute, cD as getNextElementSibling, C as getOuterWidth, cE as getPreviousElementSibling, l as script$z, aA as script$A, Y as script$B, bu as script$D, al as isNotEmpty, b3 as withModifiers, D as getOuterHeight, cF as _default, an as ZIndex, S as focus, ar as addStyle, at as absolutePosition, au as ConnectedOverlayScrollHandler, av as isTouchDevice, cG as FilterOperator, az as script$E, cH as script$F, cI as FocusTrap, k as createVNode, aE as Transition, c3 as withKeys, cJ as getIndex, aW as script$G, cK as isClickable, cL as clearSelection, cM as localeComparator, cN as sort, cO as FilterService, cu as FilterMatchMode, R as findSingle, c9 as findIndexInList, ca as find, cP as exportCSV, W as getOffset, cQ as getHiddenElementOuterWidth, cR as getHiddenElementOuterHeight, cS as reorderArray, cT as getWindowScrollTop, cU as removeClass, cV as addClass, aq as isEmpty, ay as script$H, aB as script$I } from "./index-QvfM__ze.js";
+import { s as script$C } from "./index-Q1cQr26V.js";
var ColumnStyle = BaseStyle.extend({
name: "column"
});
@@ -8783,4 +8782,4 @@ export {
script as a,
script$r as s
};
-//# sourceMappingURL=index-B5F0uxTQ.js.map
+//# sourceMappingURL=index-DpF-ptbJ.js.map
diff --git a/web/assets/index-B-aVupP5.js b/web/assets/index-Q1cQr26V.js
similarity index 91%
rename from web/assets/index-B-aVupP5.js
rename to web/assets/index-Q1cQr26V.js
index 2f4957c2f47..ce20e200e44 100644
--- a/web/assets/index-B-aVupP5.js
+++ b/web/assets/index-Q1cQr26V.js
@@ -1,6 +1,6 @@
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
-import { ct as script$1, H as createBaseVNode, o as openBlock, f as createElementBlock, D as mergeProps } from "./index-DjNHn37O.js";
+import { cA as script$1, m as createBaseVNode, o as openBlock, f as createElementBlock, G as mergeProps } from "./index-QvfM__ze.js";
var script = {
name: "BarsIcon",
"extends": script$1
@@ -26,4 +26,4 @@ script.render = render;
export {
script as s
};
-//# sourceMappingURL=index-B-aVupP5.js.map
+//# sourceMappingURL=index-Q1cQr26V.js.map
diff --git a/web/assets/index-DjNHn37O.js b/web/assets/index-QvfM__ze.js
similarity index 81%
rename from web/assets/index-DjNHn37O.js
rename to web/assets/index-QvfM__ze.js
index fff8484bd1f..dc3143769f4 100644
--- a/web/assets/index-DjNHn37O.js
+++ b/web/assets/index-QvfM__ze.js
@@ -1,7 +1,7 @@
-const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./GraphView-HVeNbkaW.js","./index-jXPKy3pP.js","./index-5HFeZax4.js","./index-B-aVupP5.js","./keybindingService-Bx7YdkXn.js","./serverConfigStore-CvyKFVuP.js","./GraphView-CIRWBKTm.css","./UserSelectView-B3jYchWu.js","./BaseViewTemplate-BNGF4K22.js","./ServerStartView-CIDTUh4x.js","./ServerStartView-CnyN4Ib6.css","./InstallView-CAcYt0HL.js","./InstallView-CwQdoH-C.css","./WelcomeView-N0ZXLjdi.js","./WelcomeView-Brz3-luE.css","./NotSupportedView-Drz3x2d-.js","./NotSupportedView-bFzHmqNj.css","./DownloadGitView-DeC7MBzG.js","./ManualConfigurationView-Bi_qHE-n.js","./ManualConfigurationView-B6ecEClB.css","./KeybindingPanel-Dc3C4lG1.js","./index-B5F0uxTQ.js","./KeybindingPanel-DvrUYZ4S.css","./ExtensionPanel-D4Phn0Zr.js","./ServerConfigPanel-Be4StJmv.js","./index-Bordpmzt.js","./index-BRhY6FpL.css"])))=>i.map(i=>d[i]);
+const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./GraphView-CDDCHVO0.js","./index-Q1cQr26V.js","./keybindingService-Cak1En5n.js","./serverConfigStore-DCme3xlV.js","./GraphView-CqZ3opAX.css","./UserSelectView-CXmVKOeK.js","./BaseViewTemplate-BhQMaVFP.js","./ServerStartView-48wfE1MS.js","./ServerStartView-CJiwVDQY.css","./InstallView-By3hC1fC.js","./InstallView-CxhfFC8Y.css","./WelcomeView-C8whKl15.js","./WelcomeView-Brz3-luE.css","./NotSupportedView-Vc8_xWgH.js","./NotSupportedView-DQerxQzi.css","./DownloadGitView-rPK_vYgU.js","./ManualConfigurationView-enyqGo0M.js","./ManualConfigurationView-CsirlNfV.css","./MetricsConsentView-lSfLu4nr.js","./DesktopStartView-le6AjGZr.js","./KeybindingPanel-D6O16W_1.js","./index-DpF-ptbJ.js","./KeybindingPanel-DvrUYZ4S.css","./ExtensionPanel-3jWrm6Zi.js","./ServerConfigPanel-B-w0HFlz.js","./index-je62U6DH.js","./index-BRhY6FpL.css"])))=>i.map(i=>d[i]);
var __defProp2 = Object.defineProperty;
var __name = (target, value4) => __defProp2(target, "name", { value: value4, configurable: true });
-(/* @__PURE__ */ __name(function polyfill() {
+(/* @__PURE__ */ __name(function polyfill2() {
const relList = document.createElement("link").relList;
if (relList && relList.supports && relList.supports("modulepreload")) {
return;
@@ -45,16 +45,16 @@ var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
var __defNormalProp$2 = /* @__PURE__ */ __name((obj, key, value4) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value: value4 }) : obj[key] = value4, "__defNormalProp$2");
-var __spreadValues$1 = /* @__PURE__ */ __name((a, b) => {
- for (var prop2 in b || (b = {}))
- if (__hasOwnProp$1.call(b, prop2))
- __defNormalProp$2(a, prop2, b[prop2]);
+var __spreadValues$1 = /* @__PURE__ */ __name((a2, b2) => {
+ for (var prop2 in b2 || (b2 = {}))
+ if (__hasOwnProp$1.call(b2, prop2))
+ __defNormalProp$2(a2, prop2, b2[prop2]);
if (__getOwnPropSymbols$1)
- for (var prop2 of __getOwnPropSymbols$1(b)) {
- if (__propIsEnum$1.call(b, prop2))
- __defNormalProp$2(a, prop2, b[prop2]);
+ for (var prop2 of __getOwnPropSymbols$1(b2)) {
+ if (__propIsEnum$1.call(b2, prop2))
+ __defNormalProp$2(a2, prop2, b2[prop2]);
}
- return a;
+ return a2;
}, "__spreadValues$1");
function isEmpty$1(value4) {
return value4 === null || value4 === void 0 || value4 === "" || Array.isArray(value4) && value4.length === 0 || !(value4 instanceof Date) && typeof value4 === "object" && Object.keys(value4).length === 0;
@@ -102,31 +102,31 @@ function deepEquals(obj1, obj2) {
return obj1 !== obj1 && obj2 !== obj2;
}
__name(deepEquals, "deepEquals");
-function isFunction$5(value4) {
+function isFunction$9(value4) {
return !!(value4 && value4.constructor && value4.call && value4.apply);
}
-__name(isFunction$5, "isFunction$5");
+__name(isFunction$9, "isFunction$9");
function isNotEmpty(value4) {
return !isEmpty$1(value4);
}
__name(isNotEmpty, "isNotEmpty");
-function resolveFieldData(data24, field) {
- if (!data24 || !field) {
+function resolveFieldData(data25, field) {
+ if (!data25 || !field) {
return null;
}
try {
- const value4 = data24[field];
+ const value4 = data25[field];
if (isNotEmpty(value4)) return value4;
} catch (e2) {
}
- if (Object.keys(data24).length) {
- if (isFunction$5(field)) {
- return field(data24);
+ if (Object.keys(data25).length) {
+ if (isFunction$9(field)) {
+ return field(data25);
} else if (field.indexOf(".") === -1) {
- return data24[field];
+ return data25[field];
} else {
let fields = field.split(".");
- let value4 = data24;
+ let value4 = data25;
for (let i2 = 0, len = fields.length; i2 < len; ++i2) {
if (value4 == null) {
return null;
@@ -205,26 +205,26 @@ function findLastIndex(arr, callback) {
return index2;
}
__name(findLastIndex, "findLastIndex");
-function isObject$7(value4, empty3 = true) {
+function isObject$e(value4, empty3 = true) {
return value4 instanceof Object && value4.constructor === Object && (empty3 || Object.keys(value4).length !== 0);
}
-__name(isObject$7, "isObject$7");
-function resolve$1(obj, ...params) {
- return isFunction$5(obj) ? obj(...params) : obj;
+__name(isObject$e, "isObject$e");
+function resolve$2(obj, ...params) {
+ return isFunction$9(obj) ? obj(...params) : obj;
}
-__name(resolve$1, "resolve$1");
-function isString$8(value4, empty3 = true) {
+__name(resolve$2, "resolve$2");
+function isString$9(value4, empty3 = true) {
return typeof value4 === "string" && (empty3 || value4 !== "");
}
-__name(isString$8, "isString$8");
+__name(isString$9, "isString$9");
function toFlatCase(str) {
- return isString$8(str) ? str.replace(/(-|_)/g, "").toLowerCase() : str;
+ return isString$9(str) ? str.replace(/(-|_)/g, "").toLowerCase() : str;
}
__name(toFlatCase, "toFlatCase");
function getKeyValue(obj, key = "", params = {}) {
const fKeys = toFlatCase(key).split(".");
const fKey = fKeys.shift();
- return fKey ? isObject$7(obj) ? getKeyValue(resolve$1(obj[Object.keys(obj).find((k) => toFlatCase(k) === fKey) || ""], params), fKeys.join("."), params) : void 0 : resolve$1(obj, params);
+ return fKey ? isObject$e(obj) ? getKeyValue(resolve$2(obj[Object.keys(obj).find((k2) => toFlatCase(k2) === fKey) || ""], params), fKeys.join("."), params) : void 0 : resolve$2(obj, params);
}
__name(getKeyValue, "getKeyValue");
function insertIntoOrderedArray(item3, index2, arr, sourceArr) {
@@ -246,10 +246,10 @@ function insertIntoOrderedArray(item3, index2, arr, sourceArr) {
}
}
__name(insertIntoOrderedArray, "insertIntoOrderedArray");
-function isArray$5(value4, empty3 = true) {
+function isArray$a(value4, empty3 = true) {
return Array.isArray(value4) && (empty3 || value4.length !== 0);
}
-__name(isArray$5, "isArray$5");
+__name(isArray$a, "isArray$a");
function isDate$3(value4) {
return value4 instanceof Date && value4.constructor === Date;
}
@@ -279,7 +279,7 @@ function mergeKeys(...args) {
const _mergeKeys = /* @__PURE__ */ __name((target = {}, source = {}) => {
const mergedObj = __spreadValues$1({}, target);
Object.keys(source).forEach((key) => {
- if (isObject$7(source[key]) && key in target && isObject$7(target[key])) {
+ if (isObject$e(source[key]) && key in target && isObject$e(target[key])) {
mergedObj[key] = _mergeKeys(target[key], source[key]);
} else {
mergedObj[key] = source[key];
@@ -295,10 +295,10 @@ function minifyCSS(css3) {
}
__name(minifyCSS, "minifyCSS");
function nestedKeys(obj = {}, parentKey = "") {
- return Object.entries(obj).reduce((o, [key, value4]) => {
+ return Object.entries(obj).reduce((o2, [key, value4]) => {
const currentKey = parentKey ? `${parentKey}.${key}` : key;
- isObject$7(value4) ? o = o.concat(nestedKeys(value4, currentKey)) : o.push(currentKey);
- return o;
+ isObject$e(value4) ? o2 = o2.concat(nestedKeys(value4, currentKey)) : o2.push(currentKey);
+ return o2;
}, []);
}
__name(nestedKeys, "nestedKeys");
@@ -331,14 +331,14 @@ __name(sort, "sort");
function stringify(value4, indent = 2, currentIndent = 0) {
const currentIndentStr = " ".repeat(currentIndent);
const nextIndentStr = " ".repeat(currentIndent + indent);
- if (isArray$5(value4)) {
+ if (isArray$a(value4)) {
return "[" + value4.map((v2) => stringify(v2, indent, currentIndent + indent)).join(", ") + "]";
} else if (isDate$3(value4)) {
return value4.toISOString();
- } else if (isFunction$5(value4)) {
+ } else if (isFunction$9(value4)) {
return value4.toString();
- } else if (isObject$7(value4)) {
- return "{\n" + Object.entries(value4).map(([k, v2]) => `${nextIndentStr}${k}: ${stringify(v2, indent, currentIndent + indent)}`).join(",\n") + `
+ } else if (isObject$e(value4)) {
+ return "{\n" + Object.entries(value4).map(([k2, v2]) => `${nextIndentStr}${k2}: ${stringify(v2, indent, currentIndent + indent)}`).join(",\n") + `
${currentIndentStr}}`;
} else {
return JSON.stringify(value4);
@@ -346,15 +346,15 @@ ${currentIndentStr}}`;
}
__name(stringify, "stringify");
function toCapitalCase(str) {
- return isString$8(str, false) ? str[0].toUpperCase() + str.slice(1) : str;
+ return isString$9(str, false) ? str[0].toUpperCase() + str.slice(1) : str;
}
__name(toCapitalCase, "toCapitalCase");
function toKebabCase(str) {
- return isString$8(str) ? str.replace(/(_)/g, "-").replace(/[A-Z]/g, (c, i2) => i2 === 0 ? c : "-" + c.toLowerCase()).toLowerCase() : str;
+ return isString$9(str) ? str.replace(/(_)/g, "-").replace(/[A-Z]/g, (c2, i2) => i2 === 0 ? c2 : "-" + c2.toLowerCase()).toLowerCase() : str;
}
__name(toKebabCase, "toKebabCase");
function toTokenKey$1(str) {
- return isString$8(str) ? str.replace(/[A-Z]/g, (c, i2) => i2 === 0 ? c : "." + c.toLowerCase()).toLowerCase() : str;
+ return isString$9(str) ? str.replace(/[A-Z]/g, (c2, i2) => i2 === 0 ? c2 : "." + c2.toLowerCase()).toLowerCase() : str;
}
__name(toTokenKey$1, "toTokenKey$1");
function EventBus() {
@@ -395,18 +395,18 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp$1 = /* @__PURE__ */ __name((obj, key, value4) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value: value4 }) : obj[key] = value4, "__defNormalProp$1");
-var __spreadValues = /* @__PURE__ */ __name((a, b) => {
- for (var prop2 in b || (b = {}))
- if (__hasOwnProp.call(b, prop2))
- __defNormalProp$1(a, prop2, b[prop2]);
+var __spreadValues = /* @__PURE__ */ __name((a2, b2) => {
+ for (var prop2 in b2 || (b2 = {}))
+ if (__hasOwnProp.call(b2, prop2))
+ __defNormalProp$1(a2, prop2, b2[prop2]);
if (__getOwnPropSymbols)
- for (var prop2 of __getOwnPropSymbols(b)) {
- if (__propIsEnum.call(b, prop2))
- __defNormalProp$1(a, prop2, b[prop2]);
+ for (var prop2 of __getOwnPropSymbols(b2)) {
+ if (__propIsEnum.call(b2, prop2))
+ __defNormalProp$1(a2, prop2, b2[prop2]);
}
- return a;
+ return a2;
}, "__spreadValues");
-var __spreadProps = /* @__PURE__ */ __name((a, b) => __defProps(a, __getOwnPropDescs(b)), "__spreadProps");
+var __spreadProps = /* @__PURE__ */ __name((a2, b2) => __defProps(a2, __getOwnPropDescs(b2)), "__spreadProps");
var __objRest = /* @__PURE__ */ __name((source, exclude) => {
var target = {};
for (var prop2 in source)
@@ -426,19 +426,19 @@ __name(definePreset, "definePreset");
var ThemeService = EventBus();
var service_default = ThemeService;
function toTokenKey(str) {
- return isString$8(str) ? str.replace(/[A-Z]/g, (c, i2) => i2 === 0 ? c : "." + c.toLowerCase()).toLowerCase() : str;
+ return isString$9(str) ? str.replace(/[A-Z]/g, (c2, i2) => i2 === 0 ? c2 : "." + c2.toLowerCase()).toLowerCase() : str;
}
__name(toTokenKey, "toTokenKey");
-function merge$1(value1, value22) {
- if (isArray$5(value1)) {
+function merge$2(value1, value22) {
+ if (isArray$a(value1)) {
value1.push(...value22 || []);
- } else if (isObject$7(value1)) {
+ } else if (isObject$e(value1)) {
Object.assign(value1, value22);
}
}
-__name(merge$1, "merge$1");
+__name(merge$2, "merge$2");
function toValue$2(value4) {
- return isObject$7(value4) && value4.hasOwnProperty("value") && value4.hasOwnProperty("type") ? value4.value : value4;
+ return isObject$e(value4) && value4.hasOwnProperty("value") && value4.hasOwnProperty("type") ? value4.value : value4;
}
__name(toValue$2, "toValue$2");
function toUnit(value4, variable = "") {
@@ -456,7 +456,7 @@ function toNormalizePrefix(prefix2) {
}
__name(toNormalizePrefix, "toNormalizePrefix");
function toNormalizeVariable(prefix2 = "", variable = "") {
- return toNormalizePrefix(`${isString$8(prefix2, false) && isString$8(variable, false) ? `${prefix2}-` : prefix2}${variable}`);
+ return toNormalizePrefix(`${isString$9(prefix2, false) && isString$9(variable, false) ? `${prefix2}-` : prefix2}${variable}`);
}
__name(toNormalizeVariable, "toNormalizeVariable");
function getVariableName(prefix2 = "", variable = "") {
@@ -464,7 +464,7 @@ function getVariableName(prefix2 = "", variable = "") {
}
__name(getVariableName, "getVariableName");
function getVariableValue(value4, variable = "", prefix2 = "", excludedKeyRegexes = [], fallback) {
- if (isString$8(value4)) {
+ if (isString$9(value4)) {
const regex2 = /{([^}]*)}/g;
const val = value4.trim();
if (matchRegex(val, regex2)) {
@@ -485,7 +485,7 @@ function getVariableValue(value4, variable = "", prefix2 = "", excludedKeyRegexe
}
__name(getVariableValue, "getVariableValue");
function getComputedValue(obj = {}, value4) {
- if (isString$8(value4)) {
+ if (isString$9(value4)) {
const regex2 = /{([^}]*)}/g;
const val = value4.trim();
return matchRegex(val, regex2) ? val.replaceAll(regex2, (v2) => getKeyValue(obj, v2.replace(/{|}/g, ""))) : val;
@@ -496,7 +496,7 @@ function getComputedValue(obj = {}, value4) {
}
__name(getComputedValue, "getComputedValue");
function setProperty(properties, key, value4) {
- if (isString$8(key, false)) {
+ if (isString$9(key, false)) {
properties.push(`${key}:${value4};`);
}
}
@@ -517,29 +517,29 @@ function normalizeColor(color2) {
__name(normalizeColor, "normalizeColor");
function hexToRgb$1(hex) {
var bigint = parseInt(hex.substring(1), 16);
- var r = bigint >> 16 & 255;
+ var r2 = bigint >> 16 & 255;
var g2 = bigint >> 8 & 255;
- var b = bigint & 255;
- return { r, g: g2, b };
+ var b2 = bigint & 255;
+ return { r: r2, g: g2, b: b2 };
}
__name(hexToRgb$1, "hexToRgb$1");
-function rgbToHex(r, g2, b) {
- return `#${r.toString(16).padStart(2, "0")}${g2.toString(16).padStart(2, "0")}${b.toString(16).padStart(2, "0")}`;
+function rgbToHex(r2, g2, b2) {
+ return `#${r2.toString(16).padStart(2, "0")}${g2.toString(16).padStart(2, "0")}${b2.toString(16).padStart(2, "0")}`;
}
__name(rgbToHex, "rgbToHex");
var mix_default = /* @__PURE__ */ __name((color1, color2, weight) => {
color1 = normalizeColor(color1);
color2 = normalizeColor(color2);
var p2 = weight / 100;
- var w = p2 * 2 - 1;
- var w1 = (w + 1) / 2;
- var w2 = 1 - w1;
+ var w2 = p2 * 2 - 1;
+ var w1 = (w2 + 1) / 2;
+ var w22 = 1 - w1;
var rgb1 = hexToRgb$1(color1);
var rgb2 = hexToRgb$1(color2);
- var r = Math.round(rgb1.r * w1 + rgb2.r * w2);
- var g2 = Math.round(rgb1.g * w1 + rgb2.g * w2);
- var b = Math.round(rgb1.b * w1 + rgb2.b * w2);
- return rgbToHex(r, g2, b);
+ var r2 = Math.round(rgb1.r * w1 + rgb2.r * w22);
+ var g2 = Math.round(rgb1.g * w1 + rgb2.g * w22);
+ var b2 = Math.round(rgb1.b * w1 + rgb2.b * w22);
+ return rgbToHex(r2, g2, b2);
}, "mix_default");
var shade_default = /* @__PURE__ */ __name((color2, percent) => mix_default("#000000", color2, percent), "shade_default");
var tint_default = /* @__PURE__ */ __name((color2, percent) => mix_default("#ffffff", color2, percent), "tint_default");
@@ -553,10 +553,10 @@ var palette_default = /* @__PURE__ */ __name((color2) => {
}, "palette_default");
var $dt = /* @__PURE__ */ __name((tokenPath) => {
var _a2;
- const theme40 = config_default.getTheme();
- const variable = dtwt(theme40, tokenPath, void 0, "variable");
+ const theme42 = config_default.getTheme();
+ const variable = dtwt(theme42, tokenPath, void 0, "variable");
const name2 = (_a2 = variable.match(/--[\w-]+/g)) == null ? void 0 : _a2[0];
- const value4 = dtwt(theme40, tokenPath, void 0, "value");
+ const value4 = dtwt(theme42, tokenPath, void 0, "value");
return {
name: name2,
variable,
@@ -566,10 +566,10 @@ var $dt = /* @__PURE__ */ __name((tokenPath) => {
var dt = /* @__PURE__ */ __name((...args) => {
return dtwt(config_default.getTheme(), ...args);
}, "dt");
-var dtwt = /* @__PURE__ */ __name((theme40 = {}, tokenPath, fallback, type = "variable") => {
+var dtwt = /* @__PURE__ */ __name((theme42 = {}, tokenPath, fallback, type = "variable") => {
if (tokenPath) {
const { variable: VARIABLE, options: OPTIONS } = config_default.defaults || {};
- const { prefix: prefix2, transform: transform2 } = (theme40 == null ? void 0 : theme40.options) || OPTIONS || {};
+ const { prefix: prefix2, transform: transform2 } = (theme42 == null ? void 0 : theme42.options) || OPTIONS || {};
const regex2 = /{([^}]*)}/g;
const token = matchRegex(tokenPath, regex2) ? tokenPath : `{${tokenPath}}`;
const isStrictTransform = type === "value" || transform2 === "strict";
@@ -578,11 +578,11 @@ var dtwt = /* @__PURE__ */ __name((theme40 = {}, tokenPath, fallback, type = "va
return "";
}, "dtwt");
function css$2(style2) {
- return resolve$1(style2, { dt });
+ return resolve$2(style2, { dt });
}
__name(css$2, "css$2");
-var $t = /* @__PURE__ */ __name((theme40 = {}) => {
- let { preset: _preset, options: _options } = theme40;
+var $t = /* @__PURE__ */ __name((theme42 = {}) => {
+ let { preset: _preset, options: _options } = theme42;
return {
preset(value4) {
_preset = _preset ? mergeKeys(_preset, value4) : value4;
@@ -634,7 +634,7 @@ var $t = /* @__PURE__ */ __name((theme40 = {}) => {
}
};
}, "$t");
-function toVariables_default(theme40, options4 = {}) {
+function toVariables_default(theme42, options4 = {}) {
const VARIABLE = config_default.defaults.variable;
const { prefix: prefix2 = VARIABLE.prefix, selector = VARIABLE.selector, excludedKeyRegex = VARIABLE.excludedKeyRegex } = options4;
const _toVariables = /* @__PURE__ */ __name((_theme, _prefix = "") => {
@@ -642,10 +642,10 @@ function toVariables_default(theme40, options4 = {}) {
(acc, [key, value4]) => {
const px = matchRegex(key, excludedKeyRegex) ? toNormalizeVariable(_prefix) : toNormalizeVariable(_prefix, toKebabCase(key));
const v2 = toValue$2(value4);
- if (isObject$7(v2)) {
+ if (isObject$e(v2)) {
const { variables: variables2, tokens: tokens2 } = _toVariables(v2, px);
- merge$1(acc["tokens"], tokens2);
- merge$1(acc["variables"], variables2);
+ merge$2(acc["tokens"], tokens2);
+ merge$2(acc["variables"], variables2);
} else {
acc["tokens"].push((prefix2 ? px.replace(`${prefix2}-`, "") : px).replaceAll("-", "."));
setProperty(acc["variables"], getVariableName(px), getVariableValue(v2, px, prefix2, [excludedKeyRegex]));
@@ -655,7 +655,7 @@ function toVariables_default(theme40, options4 = {}) {
{ variables: [], tokens: [] }
);
}, "_toVariables");
- const { variables, tokens } = _toVariables(theme40, prefix2);
+ const { variables, tokens } = _toVariables(theme42, prefix2);
return {
value: variables,
tokens,
@@ -698,19 +698,19 @@ var themeUtils_default = {
}
},
resolve(value4) {
- const rules = Object.keys(this.rules).filter((k) => k !== "custom").map((r) => this.rules[r]);
+ const rules = Object.keys(this.rules).filter((k2) => k2 !== "custom").map((r2) => this.rules[r2]);
return [value4].flat().map((v2) => {
var _a2;
- return (_a2 = rules.map((r) => r.resolve(v2)).find((rr) => rr.matched)) != null ? _a2 : this.rules.custom.resolve(v2);
+ return (_a2 = rules.map((r2) => r2.resolve(v2)).find((rr) => rr.matched)) != null ? _a2 : this.rules.custom.resolve(v2);
});
}
},
- _toVariables(theme40, options4) {
- return toVariables_default(theme40, { prefix: options4 == null ? void 0 : options4.prefix });
+ _toVariables(theme42, options4) {
+ return toVariables_default(theme42, { prefix: options4 == null ? void 0 : options4.prefix });
},
- getCommon({ name: name2 = "", theme: theme40 = {}, params, set: set3, defaults: defaults2 }) {
+ getCommon({ name: name2 = "", theme: theme42 = {}, params, set: set3, defaults: defaults2 }) {
var _c, _d, _e, _f;
- const { preset, options: options4 } = theme40;
+ const { preset, options: options4 } = theme42;
let primitive_css, primitive_tokens, semantic_css, semantic_tokens;
if (isNotEmpty(preset)) {
const { primitive, semantic } = preset;
@@ -761,16 +761,16 @@ var themeUtils_default = {
tokens
};
},
- getPresetC({ name: name2 = "", theme: theme40 = {}, params, set: set3, defaults: defaults2 }) {
+ getPresetC({ name: name2 = "", theme: theme42 = {}, params, set: set3, defaults: defaults2 }) {
var _a2;
- const { preset, options: options4 } = theme40;
+ const { preset, options: options4 } = theme42;
const cPreset = (_a2 = preset == null ? void 0 : preset.components) == null ? void 0 : _a2[name2];
return this.getPreset({ name: name2, preset: cPreset, options: options4, params, set: set3, defaults: defaults2 });
},
- getPresetD({ name: name2 = "", theme: theme40 = {}, params, set: set3, defaults: defaults2 }) {
+ getPresetD({ name: name2 = "", theme: theme42 = {}, params, set: set3, defaults: defaults2 }) {
var _a2;
const dName = name2.replace("-directive", "");
- const { preset, options: options4 } = theme40;
+ const { preset, options: options4 } = theme42;
const dPreset = (_a2 = preset == null ? void 0 : preset.directives) == null ? void 0 : _a2[dName];
return this.getPreset({ name: dName, preset: dPreset, options: options4, params, set: set3, defaults: defaults2 });
},
@@ -781,14 +781,14 @@ var themeUtils_default = {
getLayerOrder(name2, options4 = {}, params, defaults2) {
const { cssLayer } = options4;
if (cssLayer) {
- const order = resolve$1(cssLayer.order || "primeui", params);
+ const order = resolve$2(cssLayer.order || "primeui", params);
return `@layer ${order}`;
}
return "";
},
- getCommonStyleSheet({ name: name2 = "", theme: theme40 = {}, params, props = {}, set: set3, defaults: defaults2 }) {
- const common = this.getCommon({ name: name2, theme: theme40, params, set: set3, defaults: defaults2 });
- const _props = Object.entries(props).reduce((acc, [k, v2]) => acc.push(`${k}="${v2}"`) && acc, []).join(" ");
+ getCommonStyleSheet({ name: name2 = "", theme: theme42 = {}, params, props = {}, set: set3, defaults: defaults2 }) {
+ const common = this.getCommon({ name: name2, theme: theme42, params, set: set3, defaults: defaults2 });
+ const _props = Object.entries(props).reduce((acc, [k2, v2]) => acc.push(`${k2}="${v2}"`) && acc, []).join(" ");
return Object.entries(common || {}).reduce((acc, [key, value4]) => {
if (value4 == null ? void 0 : value4.css) {
const _css = minifyCSS(value4 == null ? void 0 : value4.css);
@@ -798,18 +798,18 @@ var themeUtils_default = {
return acc;
}, []).join("");
},
- getStyleSheet({ name: name2 = "", theme: theme40 = {}, params, props = {}, set: set3, defaults: defaults2 }) {
+ getStyleSheet({ name: name2 = "", theme: theme42 = {}, params, props = {}, set: set3, defaults: defaults2 }) {
var _a2;
- const options4 = { name: name2, theme: theme40, params, set: set3, defaults: defaults2 };
+ const options4 = { name: name2, theme: theme42, params, set: set3, defaults: defaults2 };
const preset_css = (_a2 = name2.includes("-directive") ? this.getPresetD(options4) : this.getPresetC(options4)) == null ? void 0 : _a2.css;
- const _props = Object.entries(props).reduce((acc, [k, v2]) => acc.push(`${k}="${v2}"`) && acc, []).join(" ");
+ const _props = Object.entries(props).reduce((acc, [k2, v2]) => acc.push(`${k2}="${v2}"`) && acc, []).join(" ");
return preset_css ? `` : "";
},
createTokens(obj = {}, defaults2, parentKey = "", parentPath = "", tokens = {}) {
Object.entries(obj).forEach(([key, value4]) => {
const currentKey = matchRegex(key, defaults2.variable.excludedKeyRegex) ? parentKey : parentKey ? `${parentKey}.${toTokenKey$1(key)}` : toTokenKey$1(key);
const currentPath = parentPath ? `${parentPath}.${key}` : key;
- if (isObject$7(value4)) {
+ if (isObject$e(value4)) {
this.createTokens(value4, defaults2, currentKey, currentPath, tokens);
} else {
tokens[currentKey] || (tokens[currentKey] = {
@@ -857,11 +857,11 @@ var themeUtils_default = {
},
getTokenValue(tokens, path, defaults2) {
var _a2;
- const normalizePath = /* @__PURE__ */ __name((str) => {
+ const normalizePath2 = /* @__PURE__ */ __name((str) => {
const strArr = str.split(".");
- return strArr.filter((s) => !matchRegex(s.toLowerCase(), defaults2.variable.excludedKeyRegex)).join(".");
+ return strArr.filter((s2) => !matchRegex(s2.toLowerCase(), defaults2.variable.excludedKeyRegex)).join(".");
}, "normalizePath");
- const token = normalizePath(path);
+ const token = normalizePath2(path);
const colorScheme = path.includes("colorScheme.light") ? "light" : path.includes("colorScheme.dark") ? "dark" : void 0;
const computedValues = [(_a2 = tokens[token]) == null ? void 0 : _a2.computed(colorScheme)].flat().filter((computed2) => computed2);
return computedValues.length === 1 ? computedValues[0].value : computedValues.reduce((acc = {}, computed2) => {
@@ -888,7 +888,7 @@ var themeUtils_default = {
name: "primeui",
order: "primeui"
};
- isObject$7(cssLayer) && (layerOptions.name = resolve$1(cssLayer.name, { name: name2, type }));
+ isObject$e(cssLayer) && (layerOptions.name = resolve$2(cssLayer.name, { name: name2, type }));
if (isNotEmpty(layerOptions.name)) {
css22 = getRule(`@layer ${layerOptions.name}`, css22);
set3 == null ? void 0 : set3.layerNames(layerOptions.name);
@@ -918,10 +918,10 @@ var config_default = {
_loadingStyles: /* @__PURE__ */ new Set(),
_tokens: {},
update(newValues = {}) {
- const { theme: theme40 } = newValues;
- if (theme40) {
- this._theme = __spreadProps(__spreadValues({}, theme40), {
- options: __spreadValues(__spreadValues({}, this.defaults.options), theme40.options)
+ const { theme: theme42 } = newValues;
+ if (theme42) {
+ this._theme = __spreadProps(__spreadValues({}, theme42), {
+ options: __spreadValues(__spreadValues({}, this.defaults.options), theme42.options)
});
this._tokens = themeUtils_default.createTokens(this.preset, this.defaults);
this.clearLoadedStyleNames();
@@ -1052,8 +1052,8 @@ function usePreset(...presets) {
return newPreset;
}
__name(usePreset, "usePreset");
-function useTheme(theme40) {
- return $t(theme40).update({ mergePresets: false });
+function useTheme(theme42) {
+ return $t(theme42).update({ mergePresets: false });
}
__name(useTheme, "useTheme");
var index$1n = {
@@ -5973,38674 +5973,64191 @@ var index$2 = {
ripple: index$u
}
};
-/**
-* @vue/shared v3.4.31
-* (c) 2018-present Yuxi (Evan) You and Vue contributors
-* @license MIT
-**/
-/*! #__NO_SIDE_EFFECTS__ */
-// @__NO_SIDE_EFFECTS__
-function makeMap(str, expectsLowerCase) {
- const set3 = new Set(str.split(","));
- return expectsLowerCase ? (val) => set3.has(val.toLowerCase()) : (val) => set3.has(val);
+const DEBUG_BUILD$6 = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__;
+const SDK_VERSION = "8.48.0";
+const GLOBAL_OBJ = globalThis;
+function getGlobalSingleton(name2, creator, obj) {
+ const gbl = obj || GLOBAL_OBJ;
+ const __SENTRY__ = gbl.__SENTRY__ = gbl.__SENTRY__ || {};
+ const versionedCarrier = __SENTRY__[SDK_VERSION] = __SENTRY__[SDK_VERSION] || {};
+ return versionedCarrier[name2] || (versionedCarrier[name2] = creator());
+}
+__name(getGlobalSingleton, "getGlobalSingleton");
+const DEBUG_BUILD$5 = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__;
+const PREFIX$2 = "Sentry Logger ";
+const CONSOLE_LEVELS$1 = [
+ "debug",
+ "info",
+ "warn",
+ "error",
+ "log",
+ "assert",
+ "trace"
+];
+const 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];
+ });
+ }
+}
+__name(consoleSandbox, "consoleSandbox");
+function makeLogger() {
+ let enabled = false;
+ const logger2 = {
+ enable: /* @__PURE__ */ __name(() => {
+ enabled = true;
+ }, "enable"),
+ disable: /* @__PURE__ */ __name(() => {
+ enabled = false;
+ }, "disable"),
+ isEnabled: /* @__PURE__ */ __name(() => enabled, "isEnabled")
+ };
+ if (DEBUG_BUILD$5) {
+ CONSOLE_LEVELS$1.forEach((name2) => {
+ logger2[name2] = (...args) => {
+ if (enabled) {
+ consoleSandbox(() => {
+ GLOBAL_OBJ.console[name2](`${PREFIX$2}[${name2}]:`, ...args);
+ });
+ }
+ };
+ });
+ } else {
+ CONSOLE_LEVELS$1.forEach((name2) => {
+ logger2[name2] = () => void 0;
+ });
+ }
+ return logger2;
+}
+__name(makeLogger, "makeLogger");
+const logger$2 = getGlobalSingleton("logger", makeLogger);
+const STACKTRACE_FRAME_LIMIT = 50;
+const UNKNOWN_FUNCTION = "?";
+const WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/;
+const STRIP_FRAME_REGEXP = /captureMessage|captureException/;
+function createStackParser(...parsers) {
+ const sortedParsers = parsers.sort((a2, b2) => a2[0] - b2[0]).map((p2) => p2[1]);
+ return (stack2, skipFirstLines = 0, framesToPop = 0) => {
+ const frames = [];
+ const lines = stack2.split("\n");
+ for (let i2 = skipFirstLines; i2 < lines.length; i2++) {
+ const line = lines[i2];
+ 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));
+ };
}
-__name(makeMap, "makeMap");
-const EMPTY_OBJ = false ? Object.freeze({}) : {};
-const EMPTY_ARR = false ? Object.freeze([]) : [];
-const NOOP = /* @__PURE__ */ __name(() => {
-}, "NOOP");
-const NO = /* @__PURE__ */ __name(() => false, "NO");
-const isOn = /* @__PURE__ */ __name((key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
-(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97), "isOn");
-const isModelListener = /* @__PURE__ */ __name((key) => key.startsWith("onUpdate:"), "isModelListener");
-const extend$1 = Object.assign;
-const remove$1 = /* @__PURE__ */ __name((arr, el) => {
- const i2 = arr.indexOf(el);
- if (i2 > -1) {
- arr.splice(i2, 1);
+__name(createStackParser, "createStackParser");
+function stackParserFromStackParserOptions(stackParser) {
+ if (Array.isArray(stackParser)) {
+ return createStackParser(...stackParser);
}
-}, "remove$1");
-const hasOwnProperty$3 = Object.prototype.hasOwnProperty;
-const hasOwn$3 = /* @__PURE__ */ __name((val, key) => hasOwnProperty$3.call(val, key), "hasOwn$3");
-const isArray$4 = Array.isArray;
-const isMap = /* @__PURE__ */ __name((val) => toTypeString$1(val) === "[object Map]", "isMap");
-const isSet = /* @__PURE__ */ __name((val) => toTypeString$1(val) === "[object Set]", "isSet");
-const isDate$2 = /* @__PURE__ */ __name((val) => toTypeString$1(val) === "[object Date]", "isDate$2");
-const isRegExp$4 = /* @__PURE__ */ __name((val) => toTypeString$1(val) === "[object RegExp]", "isRegExp$4");
-const isFunction$4 = /* @__PURE__ */ __name((val) => typeof val === "function", "isFunction$4");
-const isString$7 = /* @__PURE__ */ __name((val) => typeof val === "string", "isString$7");
-const isSymbol$1 = /* @__PURE__ */ __name((val) => typeof val === "symbol", "isSymbol$1");
-const isObject$6 = /* @__PURE__ */ __name((val) => val !== null && typeof val === "object", "isObject$6");
-const isPromise$1 = /* @__PURE__ */ __name((val) => {
- return (isObject$6(val) || isFunction$4(val)) && isFunction$4(val.then) && isFunction$4(val.catch);
-}, "isPromise$1");
-const objectToString$1 = Object.prototype.toString;
-const toTypeString$1 = /* @__PURE__ */ __name((value4) => objectToString$1.call(value4), "toTypeString$1");
-const toRawType = /* @__PURE__ */ __name((value4) => {
- return toTypeString$1(value4).slice(8, -1);
-}, "toRawType");
-const isPlainObject$4 = /* @__PURE__ */ __name((val) => toTypeString$1(val) === "[object Object]", "isPlainObject$4");
-const isIntegerKey = /* @__PURE__ */ __name((key) => isString$7(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key, "isIntegerKey");
-const isReservedProp = /* @__PURE__ */ makeMap(
- // the leading comma is intentional so empty string "" is also included
- ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
-);
-const isBuiltInDirective = /* @__PURE__ */ makeMap(
- "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
-);
-const cacheStringFunction$1 = /* @__PURE__ */ __name((fn) => {
- const cache2 = /* @__PURE__ */ Object.create(null);
- return (str) => {
- const hit = cache2[str];
- return hit || (cache2[str] = fn(str));
- };
-}, "cacheStringFunction$1");
-const camelizeRE$1 = /-(\w)/g;
-const camelize$1 = cacheStringFunction$1((str) => {
- return str.replace(camelizeRE$1, (_2, c) => c ? c.toUpperCase() : "");
-});
-const hyphenateRE$1 = /\B([A-Z])/g;
-const hyphenate$1 = cacheStringFunction$1(
- (str) => str.replace(hyphenateRE$1, "-$1").toLowerCase()
-);
-const capitalize$1 = cacheStringFunction$1((str) => {
- return str.charAt(0).toUpperCase() + str.slice(1);
-});
-const toHandlerKey = cacheStringFunction$1((str) => {
- const s = str ? `on${capitalize$1(str)}` : ``;
- return s;
-});
-const hasChanged = /* @__PURE__ */ __name((value4, oldValue2) => !Object.is(value4, oldValue2), "hasChanged");
-const invokeArrayFns = /* @__PURE__ */ __name((fns, ...arg) => {
- for (let i2 = 0; i2 < fns.length; i2++) {
- fns[i2](...arg);
+ return stackParser;
+}
+__name(stackParserFromStackParserOptions, "stackParserFromStackParserOptions");
+function stripSentryFramesAndReverse(stack2) {
+ if (!stack2.length) {
+ return [];
}
-}, "invokeArrayFns");
-const def = /* @__PURE__ */ __name((obj, key, value4, writable = false) => {
- Object.defineProperty(obj, key, {
- configurable: true,
- enumerable: false,
- writable,
- value: value4
- });
-}, "def");
-const looseToNumber = /* @__PURE__ */ __name((val) => {
- const n = parseFloat(val);
- return isNaN(n) ? val : n;
-}, "looseToNumber");
-const toNumber = /* @__PURE__ */ __name((val) => {
- const n = isString$7(val) ? Number(val) : NaN;
- return isNaN(n) ? val : n;
-}, "toNumber");
-let _globalThis$1;
-const getGlobalThis$1 = /* @__PURE__ */ __name(() => {
- return _globalThis$1 || (_globalThis$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
-}, "getGlobalThis$1");
-const identRE = /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/;
-function genPropsAccessExp(name2) {
- return identRE.test(name2) ? `__props.${name2}` : `__props[${JSON.stringify(name2)}]`;
+ const localStack = Array.from(stack2);
+ 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
+ }));
}
-__name(genPropsAccessExp, "genPropsAccessExp");
-const PatchFlags = {
- "TEXT": 1,
- "1": "TEXT",
- "CLASS": 2,
- "2": "CLASS",
- "STYLE": 4,
- "4": "STYLE",
- "PROPS": 8,
- "8": "PROPS",
- "FULL_PROPS": 16,
- "16": "FULL_PROPS",
- "NEED_HYDRATION": 32,
- "32": "NEED_HYDRATION",
- "STABLE_FRAGMENT": 64,
- "64": "STABLE_FRAGMENT",
- "KEYED_FRAGMENT": 128,
- "128": "KEYED_FRAGMENT",
- "UNKEYED_FRAGMENT": 256,
- "256": "UNKEYED_FRAGMENT",
- "NEED_PATCH": 512,
- "512": "NEED_PATCH",
- "DYNAMIC_SLOTS": 1024,
- "1024": "DYNAMIC_SLOTS",
- "DEV_ROOT_FRAGMENT": 2048,
- "2048": "DEV_ROOT_FRAGMENT",
- "HOISTED": -1,
- "-1": "HOISTED",
- "BAIL": -2,
- "-2": "BAIL"
-};
-const PatchFlagNames = {
- [1]: `TEXT`,
- [2]: `CLASS`,
- [4]: `STYLE`,
- [8]: `PROPS`,
- [16]: `FULL_PROPS`,
- [32]: `NEED_HYDRATION`,
- [64]: `STABLE_FRAGMENT`,
- [128]: `KEYED_FRAGMENT`,
- [256]: `UNKEYED_FRAGMENT`,
- [512]: `NEED_PATCH`,
- [1024]: `DYNAMIC_SLOTS`,
- [2048]: `DEV_ROOT_FRAGMENT`,
- [-1]: `HOISTED`,
- [-2]: `BAIL`
-};
-const ShapeFlags = {
- "ELEMENT": 1,
- "1": "ELEMENT",
- "FUNCTIONAL_COMPONENT": 2,
- "2": "FUNCTIONAL_COMPONENT",
- "STATEFUL_COMPONENT": 4,
- "4": "STATEFUL_COMPONENT",
- "TEXT_CHILDREN": 8,
- "8": "TEXT_CHILDREN",
- "ARRAY_CHILDREN": 16,
- "16": "ARRAY_CHILDREN",
- "SLOTS_CHILDREN": 32,
- "32": "SLOTS_CHILDREN",
- "TELEPORT": 64,
- "64": "TELEPORT",
- "SUSPENSE": 128,
- "128": "SUSPENSE",
- "COMPONENT_SHOULD_KEEP_ALIVE": 256,
- "256": "COMPONENT_SHOULD_KEEP_ALIVE",
- "COMPONENT_KEPT_ALIVE": 512,
- "512": "COMPONENT_KEPT_ALIVE",
- "COMPONENT": 6,
- "6": "COMPONENT"
-};
-const SlotFlags = {
- "STABLE": 1,
- "1": "STABLE",
- "DYNAMIC": 2,
- "2": "DYNAMIC",
- "FORWARDED": 3,
- "3": "FORWARDED"
-};
-const slotFlagsText = {
- [1]: "STABLE",
- [2]: "DYNAMIC",
- [3]: "FORWARDED"
-};
-const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error";
-const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
-const isGloballyWhitelisted = isGloballyAllowed;
-const range = 2;
-function generateCodeFrame$1(source, start2 = 0, end = source.length) {
- start2 = Math.max(0, Math.min(start2, source.length));
- end = Math.max(0, Math.min(end, source.length));
- if (start2 > end) return "";
- let lines = source.split(/(\r?\n)/);
- const newlineSequences = lines.filter((_2, idx) => idx % 2 === 1);
- lines = lines.filter((_2, idx) => idx % 2 === 0);
- let count = 0;
- const res = [];
- for (let i2 = 0; i2 < lines.length; i2++) {
- count += lines[i2].length + (newlineSequences[i2] && newlineSequences[i2].length || 0);
- if (count >= start2) {
- for (let j = i2 - range; j <= i2 + range || end > count; j++) {
- if (j < 0 || j >= lines.length) continue;
- const line = j + 1;
- res.push(
- `${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`
- );
- const lineLength = lines[j].length;
- const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0;
- if (j === i2) {
- const pad = start2 - (count - (lineLength + newLineSeqLength));
- const length = Math.max(
- 1,
- end > count ? lineLength - pad : end - start2
- );
- res.push(` | ` + " ".repeat(pad) + "^".repeat(length));
- } else if (j > i2) {
- if (end > count) {
- const length = Math.max(Math.min(end - count, lineLength), 1);
- res.push(` | ` + "^".repeat(length));
- }
- count += lineLength + newLineSeqLength;
- }
- }
- break;
+__name(stripSentryFramesAndReverse, "stripSentryFramesAndReverse");
+function getLastStackFrame(arr) {
+ return arr[arr.length - 1] || {};
+}
+__name(getLastStackFrame, "getLastStackFrame");
+const defaultFunctionName = "";
+function getFunctionName(fn) {
+ try {
+ if (!fn || typeof fn !== "function") {
+ return defaultFunctionName;
}
+ return fn.name || defaultFunctionName;
+ } catch (e2) {
+ return defaultFunctionName;
}
- return res.join("\n");
}
-__name(generateCodeFrame$1, "generateCodeFrame$1");
-function normalizeStyle(value4) {
- if (isArray$4(value4)) {
- const res = {};
- for (let i2 = 0; i2 < value4.length; i2++) {
- const item3 = value4[i2];
- const normalized = isString$7(item3) ? parseStringStyle(item3) : normalizeStyle(item3);
- if (normalized) {
- for (const key in normalized) {
- res[key] = normalized[key];
+__name(getFunctionName, "getFunctionName");
+function getFramesFromEvent(event) {
+ const exception = event.exception;
+ if (exception) {
+ const frames = [];
+ try {
+ exception.values.forEach((value4) => {
+ if (value4.stacktrace.frames) {
+ frames.push(...value4.stacktrace.frames);
}
- }
+ });
+ return frames;
+ } catch (_oO) {
+ return void 0;
}
- return res;
- } else if (isString$7(value4) || isObject$6(value4)) {
- return value4;
}
+ return void 0;
}
-__name(normalizeStyle, "normalizeStyle");
-const listDelimiterRE = /;(?![^(]*\))/g;
-const propertyDelimiterRE = /:([^]+)/;
-const styleCommentRE = /\/\*[^]*?\*\//g;
-function parseStringStyle(cssText) {
- const ret = {};
- cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item3) => {
- if (item3) {
- const tmp = item3.split(propertyDelimiterRE);
- tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
- }
+__name(getFramesFromEvent, "getFramesFromEvent");
+const handlers$4 = {};
+const instrumented$1 = {};
+function addHandler$1(type, handler6) {
+ handlers$4[type] = handlers$4[type] || [];
+ handlers$4[type].push(handler6);
+}
+__name(addHandler$1, "addHandler$1");
+function resetInstrumentationHandlers() {
+ Object.keys(handlers$4).forEach((key) => {
+ handlers$4[key] = void 0;
});
- return ret;
}
-__name(parseStringStyle, "parseStringStyle");
-function stringifyStyle(styles) {
- let ret = "";
- if (!styles || isString$7(styles)) {
- return ret;
+__name(resetInstrumentationHandlers, "resetInstrumentationHandlers");
+function maybeInstrument(type, instrumentFn) {
+ if (!instrumented$1[type]) {
+ instrumented$1[type] = true;
+ try {
+ instrumentFn();
+ } catch (e2) {
+ DEBUG_BUILD$5 && logger$2.error(`Error while instrumenting ${type}`, e2);
+ }
}
- for (const key in styles) {
- const value4 = styles[key];
- if (isString$7(value4) || typeof value4 === "number") {
- const normalizedKey = key.startsWith(`--`) ? key : hyphenate$1(key);
- ret += `${normalizedKey}:${value4};`;
+}
+__name(maybeInstrument, "maybeInstrument");
+function triggerHandlers$1(type, data25) {
+ const typeHandlers = type && handlers$4[type];
+ if (!typeHandlers) {
+ return;
+ }
+ for (const handler6 of typeHandlers) {
+ try {
+ handler6(data25);
+ } catch (e2) {
+ DEBUG_BUILD$5 && logger$2.error(
+ `Error while triggering instrumentation handler.
+Type: ${type}
+Name: ${getFunctionName(handler6)}
+Error:`,
+ e2
+ );
}
}
- return ret;
}
-__name(stringifyStyle, "stringifyStyle");
-function normalizeClass(value4) {
- let res = "";
- if (isString$7(value4)) {
- res = value4;
- } else if (isArray$4(value4)) {
- for (let i2 = 0; i2 < value4.length; i2++) {
- const normalized = normalizeClass(value4[i2]);
- if (normalized) {
- res += normalized + " ";
- }
+__name(triggerHandlers$1, "triggerHandlers$1");
+let _oldOnErrorHandler = null;
+function addGlobalErrorInstrumentationHandler(handler6) {
+ const type = "error";
+ addHandler$1(type, handler6);
+ maybeInstrument(type, instrumentError);
+}
+__name(addGlobalErrorInstrumentationHandler, "addGlobalErrorInstrumentationHandler");
+function instrumentError() {
+ _oldOnErrorHandler = GLOBAL_OBJ.onerror;
+ GLOBAL_OBJ.onerror = function(msg, url, line, column, error2) {
+ const handlerData = {
+ column,
+ error: error2,
+ line,
+ msg,
+ url
+ };
+ triggerHandlers$1("error", handlerData);
+ if (_oldOnErrorHandler) {
+ return _oldOnErrorHandler.apply(this, arguments);
}
- } else if (isObject$6(value4)) {
- for (const name2 in value4) {
- if (value4[name2]) {
- res += name2 + " ";
- }
+ return false;
+ };
+ GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__ = true;
+}
+__name(instrumentError, "instrumentError");
+let _oldOnUnhandledRejectionHandler = null;
+function addGlobalUnhandledRejectionInstrumentationHandler(handler6) {
+ const type = "unhandledrejection";
+ addHandler$1(type, handler6);
+ maybeInstrument(type, instrumentUnhandledRejection);
+}
+__name(addGlobalUnhandledRejectionInstrumentationHandler, "addGlobalUnhandledRejectionInstrumentationHandler");
+function instrumentUnhandledRejection() {
+ _oldOnUnhandledRejectionHandler = GLOBAL_OBJ.onunhandledrejection;
+ GLOBAL_OBJ.onunhandledrejection = function(e2) {
+ const handlerData = e2;
+ triggerHandlers$1("unhandledrejection", handlerData);
+ if (_oldOnUnhandledRejectionHandler) {
+ return _oldOnUnhandledRejectionHandler.apply(this, arguments);
}
+ return true;
+ };
+ GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;
+}
+__name(instrumentUnhandledRejection, "instrumentUnhandledRejection");
+function getMainCarrier() {
+ getSentryCarrier(GLOBAL_OBJ);
+ return GLOBAL_OBJ;
+}
+__name(getMainCarrier, "getMainCarrier");
+function getSentryCarrier(carrier) {
+ const __SENTRY__ = carrier.__SENTRY__ = carrier.__SENTRY__ || {};
+ __SENTRY__.version = __SENTRY__.version || SDK_VERSION;
+ return __SENTRY__[SDK_VERSION] = __SENTRY__[SDK_VERSION] || {};
+}
+__name(getSentryCarrier, "getSentryCarrier");
+const objectToString$4 = Object.prototype.toString;
+function isError(wat) {
+ switch (objectToString$4.call(wat)) {
+ case "[object Error]":
+ case "[object Exception]":
+ case "[object DOMException]":
+ case "[object WebAssembly.Exception]":
+ return true;
+ default:
+ return isInstanceOf(wat, Error);
}
- return res.trim();
}
-__name(normalizeClass, "normalizeClass");
-function normalizeProps(props) {
- if (!props) return null;
- let { class: klass, style: style2 } = props;
- if (klass && !isString$7(klass)) {
- props.class = normalizeClass(klass);
- }
- if (style2) {
- props.style = normalizeStyle(style2);
- }
- return props;
+__name(isError, "isError");
+function isBuiltin(wat, className) {
+ return objectToString$4.call(wat) === `[object ${className}]`;
}
-__name(normalizeProps, "normalizeProps");
-const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
-const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
-const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics";
-const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
-const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
-const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
-const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
-const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
-const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
-const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
-const isBooleanAttr = /* @__PURE__ */ makeMap(
- specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
-);
-function includeBooleanAttr(value4) {
- return !!value4 || value4 === "";
+__name(isBuiltin, "isBuiltin");
+function isErrorEvent$2(wat) {
+ return isBuiltin(wat, "ErrorEvent");
}
-__name(includeBooleanAttr, "includeBooleanAttr");
-const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/;
-const attrValidationCache = {};
-function isSSRSafeAttrName(name2) {
- if (attrValidationCache.hasOwnProperty(name2)) {
- return attrValidationCache[name2];
- }
- const isUnsafe = unsafeAttrCharRE.test(name2);
- if (isUnsafe) {
- console.error(`unsafe attribute name: ${name2}`);
- }
- return attrValidationCache[name2] = !isUnsafe;
+__name(isErrorEvent$2, "isErrorEvent$2");
+function isDOMError(wat) {
+ return isBuiltin(wat, "DOMError");
}
-__name(isSSRSafeAttrName, "isSSRSafeAttrName");
-const propsToAttrMap = {
- acceptCharset: "accept-charset",
- className: "class",
- htmlFor: "for",
- httpEquiv: "http-equiv"
-};
-const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
- `accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`
-);
-const isKnownSvgAttr = /* @__PURE__ */ makeMap(
- `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`
-);
-function isRenderableAttrValue(value4) {
- if (value4 == null) {
+__name(isDOMError, "isDOMError");
+function isDOMException(wat) {
+ return isBuiltin(wat, "DOMException");
+}
+__name(isDOMException, "isDOMException");
+function isString$8(wat) {
+ return isBuiltin(wat, "String");
+}
+__name(isString$8, "isString$8");
+function isParameterizedString(wat) {
+ return typeof wat === "object" && wat !== null && "__sentry_template_string__" in wat && "__sentry_template_values__" in wat;
+}
+__name(isParameterizedString, "isParameterizedString");
+function isPrimitive(wat) {
+ return wat === null || isParameterizedString(wat) || typeof wat !== "object" && typeof wat !== "function";
+}
+__name(isPrimitive, "isPrimitive");
+function isPlainObject$5(wat) {
+ return isBuiltin(wat, "Object");
+}
+__name(isPlainObject$5, "isPlainObject$5");
+function isEvent(wat) {
+ return typeof Event !== "undefined" && isInstanceOf(wat, Event);
+}
+__name(isEvent, "isEvent");
+function isElement$3(wat) {
+ return typeof Element !== "undefined" && isInstanceOf(wat, Element);
+}
+__name(isElement$3, "isElement$3");
+function isRegExp$5(wat) {
+ return isBuiltin(wat, "RegExp");
+}
+__name(isRegExp$5, "isRegExp$5");
+function isThenable$1(wat) {
+ return Boolean(wat && wat.then && typeof wat.then === "function");
+}
+__name(isThenable$1, "isThenable$1");
+function isSyntheticEvent(wat) {
+ return isPlainObject$5(wat) && "nativeEvent" in wat && "preventDefault" in wat && "stopPropagation" in wat;
+}
+__name(isSyntheticEvent, "isSyntheticEvent");
+function isInstanceOf(wat, base2) {
+ try {
+ return wat instanceof base2;
+ } catch (_e) {
return false;
}
- const type = typeof value4;
- return type === "string" || type === "number" || type === "boolean";
}
-__name(isRenderableAttrValue, "isRenderableAttrValue");
-const escapeRE$2 = /["'&<>]/;
-function escapeHtml$2(string) {
- const str = "" + string;
- const match2 = escapeRE$2.exec(str);
- if (!match2) {
- return str;
+__name(isInstanceOf, "isInstanceOf");
+function isVueViewModel(wat) {
+ return !!(typeof wat === "object" && wat !== null && (wat.__isVue || wat._isVue));
+}
+__name(isVueViewModel, "isVueViewModel");
+const WINDOW$8 = GLOBAL_OBJ;
+const DEFAULT_MAX_STRING_LENGTH = 80;
+function htmlTreeAsString(elem, options4 = {}) {
+ if (!elem) {
+ return "";
}
- let html = "";
- let escaped;
- let index2;
- let lastIndex2 = 0;
- for (index2 = match2.index; index2 < str.length; index2++) {
- switch (str.charCodeAt(index2)) {
- case 34:
- escaped = """;
- break;
- case 38:
- escaped = "&";
- break;
- case 39:
- escaped = "'";
- break;
- case 60:
- escaped = "<";
- break;
- case 62:
- escaped = ">";
+ 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(options4) ? options4 : options4.keyAttrs;
+ const maxStringLength = !Array.isArray(options4) && options4.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;
- default:
- continue;
- }
- if (lastIndex2 !== index2) {
- html += str.slice(lastIndex2, index2);
+ }
+ out.push(nextStr);
+ len += nextStr.length;
+ currentElem = currentElem.parentNode;
}
- lastIndex2 = index2 + 1;
- html += escaped;
+ return out.reverse().join(separator);
+ } catch (_oO) {
+ return "";
}
- return lastIndex2 !== index2 ? html + str.slice(lastIndex2, index2) : html;
-}
-__name(escapeHtml$2, "escapeHtml$2");
-const commentStripRE = /^-?>||--!>| 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$8(className)) {
+ const classes2 = className.split(/\s+/);
+ for (const c2 of classes2) {
+ out.push(`.${c2}`);
+ }
+ }
+ }
+ const allowedAttrs = ["aria-label", "type", "name", "title", "alt"];
+ for (const k2 of allowedAttrs) {
+ const attr = elem.getAttribute(k2);
+ if (attr) {
+ out.push(`[${k2}="${attr}"]`);
+ }
+ }
+ return out.join("");
}
-__name(looseCompareArrays, "looseCompareArrays");
-function looseEqual(a, b) {
- if (a === b) return true;
- let aValidType = isDate$2(a);
- let bValidType = isDate$2(b);
- if (aValidType || bValidType) {
- return aValidType && bValidType ? a.getTime() === b.getTime() : false;
+__name(_htmlElementAsString, "_htmlElementAsString");
+function getLocationHref() {
+ try {
+ return WINDOW$8.document.location.href;
+ } catch (oO) {
+ return "";
}
- aValidType = isSymbol$1(a);
- bValidType = isSymbol$1(b);
- if (aValidType || bValidType) {
- return a === b;
+}
+__name(getLocationHref, "getLocationHref");
+function getDomElement(selector) {
+ if (WINDOW$8.document && WINDOW$8.document.querySelector) {
+ return WINDOW$8.document.querySelector(selector);
}
- aValidType = isArray$4(a);
- bValidType = isArray$4(b);
- if (aValidType || bValidType) {
- return aValidType && bValidType ? looseCompareArrays(a, b) : false;
+ return null;
+}
+__name(getDomElement, "getDomElement");
+function getComponentName$1(elem) {
+ if (!WINDOW$8.HTMLElement) {
+ return null;
}
- aValidType = isObject$6(a);
- bValidType = isObject$6(b);
- if (aValidType || bValidType) {
- if (!aValidType || !bValidType) {
- return false;
- }
- const aKeysCount = Object.keys(a).length;
- const bKeysCount = Object.keys(b).length;
- if (aKeysCount !== bKeysCount) {
- return false;
+ let currentElem = elem;
+ const MAX_TRAVERSE_HEIGHT = 5;
+ for (let i2 = 0; i2 < MAX_TRAVERSE_HEIGHT; i2++) {
+ if (!currentElem) {
+ return null;
}
- for (const key in a) {
- const aHasKey = a.hasOwnProperty(key);
- const bHasKey = b.hasOwnProperty(key);
- if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
- return false;
+ if (currentElem instanceof HTMLElement) {
+ if (currentElem.dataset["sentryComponent"]) {
+ return currentElem.dataset["sentryComponent"];
+ }
+ if (currentElem.dataset["sentryElement"]) {
+ return currentElem.dataset["sentryElement"];
}
}
+ currentElem = currentElem.parentNode;
}
- return String(a) === String(b);
-}
-__name(looseEqual, "looseEqual");
-function looseIndexOf(arr, val) {
- return arr.findIndex((item3) => looseEqual(item3, val));
+ return null;
}
-__name(looseIndexOf, "looseIndexOf");
-const isRef$1 = /* @__PURE__ */ __name((val) => {
- return !!(val && val.__v_isRef === true);
-}, "isRef$1");
-const toDisplayString$1 = /* @__PURE__ */ __name((val) => {
- return isString$7(val) ? val : val == null ? "" : isArray$4(val) || isObject$6(val) && (val.toString === objectToString$1 || !isFunction$4(val.toString)) ? isRef$1(val) ? toDisplayString$1(val.value) : JSON.stringify(val, replacer, 2) : String(val);
-}, "toDisplayString$1");
-const replacer = /* @__PURE__ */ __name((_key, val) => {
- if (isRef$1(val)) {
- return replacer(_key, val.value);
- } else if (isMap(val)) {
- return {
- [`Map(${val.size})`]: [...val.entries()].reduce(
- (entries, [key, val2], i2) => {
- entries[stringifySymbol(key, i2) + " =>"] = val2;
- return entries;
- },
- {}
- )
- };
- } else if (isSet(val)) {
- return {
- [`Set(${val.size})`]: [...val.values()].map((v2) => stringifySymbol(v2))
- };
- } else if (isSymbol$1(val)) {
- return stringifySymbol(val);
- } else if (isObject$6(val) && !isArray$4(val) && !isPlainObject$4(val)) {
- return String(val);
+__name(getComponentName$1, "getComponentName$1");
+function truncate(str, max = 0) {
+ if (typeof str !== "string" || max === 0) {
+ return str;
}
- return val;
-}, "replacer");
-const stringifySymbol = /* @__PURE__ */ __name((v2, i2 = "") => {
- var _a2;
- return (
- // Symbol.description in es2019+ so we need to cast here to pass
- // the lib: es2016 check
- isSymbol$1(v2) ? `Symbol(${(_a2 = v2.description) != null ? _a2 : i2})` : v2
- );
-}, "stringifySymbol");
-/**
-* @vue/reactivity v3.4.31
-* (c) 2018-present Yuxi (Evan) You and Vue contributors
-* @license MIT
-**/
-function warn$4(msg, ...args) {
- console.warn(`[Vue warn] ${msg}`, ...args);
+ return str.length <= max ? str : `${str.slice(0, max)}...`;
}
-__name(warn$4, "warn$4");
-let activeEffectScope;
-class EffectScope {
- static {
- __name(this, "EffectScope");
+__name(truncate, "truncate");
+function snipLine(line, colno) {
+ let newLine = line;
+ const lineLength = newLine.length;
+ if (lineLength <= 150) {
+ return newLine;
}
- constructor(detached = false) {
- this.detached = detached;
- this._active = true;
- this.effects = [];
- this.cleanups = [];
- this.parent = activeEffectScope;
- if (!detached && activeEffectScope) {
- this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push(
- this
- ) - 1;
- }
+ if (colno > lineLength) {
+ colno = lineLength;
}
- get active() {
- return this._active;
+ let start2 = Math.max(colno - 60, 0);
+ if (start2 < 5) {
+ start2 = 0;
}
- run(fn) {
- if (this._active) {
- const currentEffectScope = activeEffectScope;
- try {
- activeEffectScope = this;
- return fn();
- } finally {
- activeEffectScope = currentEffectScope;
- }
- } else if (false) {
- warn$4(`cannot run an inactive effect scope.`);
- }
+ let end = Math.min(start2 + 140, lineLength);
+ if (end > lineLength - 5) {
+ end = lineLength;
}
- /**
- * This should only be called on non-detached scopes
- * @internal
- */
- on() {
- activeEffectScope = this;
+ if (end === lineLength) {
+ start2 = Math.max(end - 140, 0);
}
- /**
- * This should only be called on non-detached scopes
- * @internal
- */
- off() {
- activeEffectScope = this.parent;
+ newLine = newLine.slice(start2, end);
+ if (start2 > 0) {
+ newLine = `'{snip} ${newLine}`;
}
- stop(fromParent) {
- if (this._active) {
- let i2, l;
- for (i2 = 0, l = this.effects.length; i2 < l; i2++) {
- this.effects[i2].stop();
- }
- for (i2 = 0, l = this.cleanups.length; i2 < l; i2++) {
- this.cleanups[i2]();
- }
- if (this.scopes) {
- for (i2 = 0, l = this.scopes.length; i2 < l; i2++) {
- this.scopes[i2].stop(true);
- }
- }
- if (!this.detached && this.parent && !fromParent) {
- const last = this.parent.scopes.pop();
- if (last && last !== this) {
- this.parent.scopes[this.index] = last;
- last.index = this.index;
- }
+ if (end < lineLength) {
+ newLine += " {snip}";
+ }
+ return newLine;
+}
+__name(snipLine, "snipLine");
+function safeJoin(input, delimiter2) {
+ if (!Array.isArray(input)) {
+ return "";
+ }
+ const output = [];
+ for (let i2 = 0; i2 < input.length; i2++) {
+ const value4 = input[i2];
+ try {
+ if (isVueViewModel(value4)) {
+ output.push("[VueViewModel]");
+ } else {
+ output.push(String(value4));
}
- this.parent = void 0;
- this._active = false;
+ } catch (e2) {
+ output.push("[value cannot be serialized]");
}
}
+ return output.join(delimiter2);
}
-function effectScope(detached) {
- return new EffectScope(detached);
+__name(safeJoin, "safeJoin");
+function isMatchingPattern(value4, pattern, requireExactStringMatch = false) {
+ if (!isString$8(value4)) {
+ return false;
+ }
+ if (isRegExp$5(pattern)) {
+ return pattern.test(value4);
+ }
+ if (isString$8(pattern)) {
+ return requireExactStringMatch ? value4 === pattern : value4.includes(pattern);
+ }
+ return false;
}
-__name(effectScope, "effectScope");
-function recordEffectScope(effect2, scope = activeEffectScope) {
- if (scope && scope.active) {
- scope.effects.push(effect2);
+__name(isMatchingPattern, "isMatchingPattern");
+function stringMatchesSomePattern(testString, patterns = [], requireExactStringMatch = false) {
+ return patterns.some((pattern) => isMatchingPattern(testString, pattern, requireExactStringMatch));
+}
+__name(stringMatchesSomePattern, "stringMatchesSomePattern");
+function fill(source, name2, replacementFactory) {
+ if (!(name2 in source)) {
+ return;
+ }
+ const original = source[name2];
+ const wrapped = replacementFactory(original);
+ if (typeof wrapped === "function") {
+ markFunctionWrapped(wrapped, original);
+ }
+ try {
+ source[name2] = wrapped;
+ } catch (e2) {
+ DEBUG_BUILD$5 && logger$2.log(`Failed to replace method "${name2}" in object`, source);
}
}
-__name(recordEffectScope, "recordEffectScope");
-function getCurrentScope() {
- return activeEffectScope;
+__name(fill, "fill");
+function addNonEnumerableProperty(obj, name2, value4) {
+ try {
+ Object.defineProperty(obj, name2, {
+ // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it
+ value: value4,
+ writable: true,
+ configurable: true
+ });
+ } catch (o_O) {
+ DEBUG_BUILD$5 && logger$2.log(`Failed to add non-enumerable property "${name2}" to object`, obj);
+ }
}
-__name(getCurrentScope, "getCurrentScope");
-function onScopeDispose(fn) {
- if (activeEffectScope) {
- activeEffectScope.cleanups.push(fn);
- } else if (false) {
- warn$4(
- `onScopeDispose() is called when there is no active effect scope to be associated with.`
- );
+__name(addNonEnumerableProperty, "addNonEnumerableProperty");
+function markFunctionWrapped(wrapped, original) {
+ try {
+ const proto = original.prototype || {};
+ wrapped.prototype = original.prototype = proto;
+ addNonEnumerableProperty(wrapped, "__sentry_original__", original);
+ } catch (o_O) {
}
}
-__name(onScopeDispose, "onScopeDispose");
-let activeEffect;
-class ReactiveEffect {
- static {
- __name(this, "ReactiveEffect");
+__name(markFunctionWrapped, "markFunctionWrapped");
+function getOriginalFunction(func) {
+ return func.__sentry_original__;
+}
+__name(getOriginalFunction, "getOriginalFunction");
+function urlEncode(object) {
+ return Object.entries(object).map(([key, value4]) => `${encodeURIComponent(key)}=${encodeURIComponent(value4)}`).join("&");
+}
+__name(urlEncode, "urlEncode");
+function convertToPlainObject(value4) {
+ if (isError(value4)) {
+ return {
+ message: value4.message,
+ name: value4.name,
+ stack: value4.stack,
+ ...getOwnProperties(value4)
+ };
+ } else if (isEvent(value4)) {
+ const newObj = {
+ type: value4.type,
+ target: serializeEventTarget(value4.target),
+ currentTarget: serializeEventTarget(value4.currentTarget),
+ ...getOwnProperties(value4)
+ };
+ if (typeof CustomEvent !== "undefined" && isInstanceOf(value4, CustomEvent)) {
+ newObj.detail = value4.detail;
+ }
+ return newObj;
+ } else {
+ return value4;
}
- constructor(fn, trigger2, scheduler, scope) {
- this.fn = fn;
- this.trigger = trigger2;
- this.scheduler = scheduler;
- this.active = true;
- this.deps = [];
- this._dirtyLevel = 4;
- this._trackId = 0;
- this._runnings = 0;
- this._shouldSchedule = false;
- this._depsLength = 0;
- recordEffectScope(this, scope);
+}
+__name(convertToPlainObject, "convertToPlainObject");
+function serializeEventTarget(target) {
+ try {
+ return isElement$3(target) ? htmlTreeAsString(target) : Object.prototype.toString.call(target);
+ } catch (_oO) {
+ return "";
}
- get dirty() {
- if (this._dirtyLevel === 2 || this._dirtyLevel === 3) {
- this._dirtyLevel = 1;
- pauseTracking();
- for (let i2 = 0; i2 < this._depsLength; i2++) {
- const dep = this.deps[i2];
- if (dep.computed) {
- triggerComputed(dep.computed);
- if (this._dirtyLevel >= 4) {
- break;
- }
- }
- }
- if (this._dirtyLevel === 1) {
- this._dirtyLevel = 0;
+}
+__name(serializeEventTarget, "serializeEventTarget");
+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];
}
- resetTracking();
}
- return this._dirtyLevel >= 4;
+ return extractedProps;
+ } else {
+ return {};
}
- set dirty(v2) {
- this._dirtyLevel = v2 ? 4 : 0;
+}
+__name(getOwnProperties, "getOwnProperties");
+function extractExceptionKeysForMessage(exception, maxLength = 40) {
+ const keys2 = Object.keys(convertToPlainObject(exception));
+ keys2.sort();
+ const firstKey = keys2[0];
+ if (!firstKey) {
+ return "[object has no keys]";
}
- run() {
- this._dirtyLevel = 0;
- if (!this.active) {
- return this.fn();
- }
- let lastShouldTrack = shouldTrack;
- let lastEffect = activeEffect;
- try {
- shouldTrack = true;
- activeEffect = this;
- this._runnings++;
- preCleanupEffect(this);
- return this.fn();
- } finally {
- postCleanupEffect(this);
- this._runnings--;
- activeEffect = lastEffect;
- shouldTrack = lastShouldTrack;
- }
+ if (firstKey.length >= maxLength) {
+ return truncate(firstKey, maxLength);
}
- stop() {
- if (this.active) {
- preCleanupEffect(this);
- postCleanupEffect(this);
- this.onStop && this.onStop();
- this.active = false;
+ for (let includedKeys = keys2.length; includedKeys > 0; includedKeys--) {
+ const serialized = keys2.slice(0, includedKeys).join(", ");
+ if (serialized.length > maxLength) {
+ continue;
}
+ if (includedKeys === keys2.length) {
+ return serialized;
+ }
+ return truncate(serialized, maxLength);
}
+ return "";
}
-function triggerComputed(computed2) {
- return computed2.value;
-}
-__name(triggerComputed, "triggerComputed");
-function preCleanupEffect(effect2) {
- effect2._trackId++;
- effect2._depsLength = 0;
+__name(extractExceptionKeysForMessage, "extractExceptionKeysForMessage");
+function dropUndefinedKeys(inputValue) {
+ const memoizationMap = /* @__PURE__ */ new Map();
+ return _dropUndefinedKeys(inputValue, memoizationMap);
}
-__name(preCleanupEffect, "preCleanupEffect");
-function postCleanupEffect(effect2) {
- if (effect2.deps.length > effect2._depsLength) {
- for (let i2 = effect2._depsLength; i2 < effect2.deps.length; i2++) {
- cleanupDepEffect(effect2.deps[i2], effect2);
+__name(dropUndefinedKeys, "dropUndefinedKeys");
+function _dropUndefinedKeys(inputValue, memoizationMap) {
+ if (isPojo(inputValue)) {
+ const memoVal = memoizationMap.get(inputValue);
+ if (memoVal !== void 0) {
+ return memoVal;
}
- effect2.deps.length = effect2._depsLength;
+ const returnValue = {};
+ memoizationMap.set(inputValue, returnValue);
+ for (const key of Object.getOwnPropertyNames(inputValue)) {
+ if (typeof inputValue[key] !== "undefined") {
+ returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap);
+ }
+ }
+ return returnValue;
}
-}
-__name(postCleanupEffect, "postCleanupEffect");
-function cleanupDepEffect(dep, effect2) {
- const trackId = dep.get(effect2);
- if (trackId !== void 0 && effect2._trackId !== trackId) {
- dep.delete(effect2);
- if (dep.size === 0) {
- dep.cleanup();
+ if (Array.isArray(inputValue)) {
+ const memoVal = memoizationMap.get(inputValue);
+ if (memoVal !== void 0) {
+ return memoVal;
}
+ const returnValue = [];
+ memoizationMap.set(inputValue, returnValue);
+ inputValue.forEach((item3) => {
+ returnValue.push(_dropUndefinedKeys(item3, memoizationMap));
+ });
+ return returnValue;
}
+ return inputValue;
}
-__name(cleanupDepEffect, "cleanupDepEffect");
-function effect(fn, options4) {
- if (fn.effect instanceof ReactiveEffect) {
- fn = fn.effect.fn;
- }
- const _effect = new ReactiveEffect(fn, NOOP, () => {
- if (_effect.dirty) {
- _effect.run();
- }
- });
- if (options4) {
- extend$1(_effect, options4);
- if (options4.scope) recordEffectScope(_effect, options4.scope);
+__name(_dropUndefinedKeys, "_dropUndefinedKeys");
+function isPojo(input) {
+ if (!isPlainObject$5(input)) {
+ return false;
}
- if (!options4 || !options4.lazy) {
- _effect.run();
+ try {
+ const name2 = Object.getPrototypeOf(input).constructor.name;
+ return !name2 || name2 === "Object";
+ } catch (e2) {
+ return true;
}
- const runner = _effect.run.bind(_effect);
- runner.effect = _effect;
- return runner;
-}
-__name(effect, "effect");
-function stop(runner) {
- runner.effect.stop();
-}
-__name(stop, "stop");
-let shouldTrack = true;
-let pauseScheduleStack = 0;
-const trackStack = [];
-function pauseTracking() {
- trackStack.push(shouldTrack);
- shouldTrack = false;
-}
-__name(pauseTracking, "pauseTracking");
-function enableTracking() {
- trackStack.push(shouldTrack);
- shouldTrack = true;
}
-__name(enableTracking, "enableTracking");
-function resetTracking() {
- const last = trackStack.pop();
- shouldTrack = last === void 0 ? true : last;
+__name(isPojo, "isPojo");
+function objectify(wat) {
+ let objectified;
+ switch (true) {
+ case wat == void 0:
+ objectified = new String(wat);
+ break;
+ case (typeof wat === "symbol" || typeof wat === "bigint"):
+ objectified = Object(wat);
+ break;
+ case isPrimitive(wat):
+ objectified = new wat.constructor(wat);
+ break;
+ default:
+ objectified = wat;
+ break;
+ }
+ return objectified;
}
-__name(resetTracking, "resetTracking");
-function pauseScheduling() {
- pauseScheduleStack++;
+__name(objectify, "objectify");
+const ONE_SECOND_IN_MS = 1e3;
+function dateTimestampInSeconds() {
+ return Date.now() / ONE_SECOND_IN_MS;
}
-__name(pauseScheduling, "pauseScheduling");
-function resetScheduling() {
- pauseScheduleStack--;
- while (!pauseScheduleStack && queueEffectSchedulers.length) {
- queueEffectSchedulers.shift()();
+__name(dateTimestampInSeconds, "dateTimestampInSeconds");
+function createUnixTimestampInSecondsFunc() {
+ const { performance: performance2 } = GLOBAL_OBJ;
+ if (!performance2 || !performance2.now) {
+ return dateTimestampInSeconds;
}
+ const approxStartingTimeOrigin = Date.now() - performance2.now();
+ const timeOrigin = performance2.timeOrigin == void 0 ? approxStartingTimeOrigin : performance2.timeOrigin;
+ return () => {
+ return (timeOrigin + performance2.now()) / ONE_SECOND_IN_MS;
+ };
}
-__name(resetScheduling, "resetScheduling");
-function trackEffect(effect2, dep, debuggerEventExtraInfo) {
- var _a2;
- if (dep.get(effect2) !== effect2._trackId) {
- dep.set(effect2, effect2._trackId);
- const oldDep = effect2.deps[effect2._depsLength];
- if (oldDep !== dep) {
- if (oldDep) {
- cleanupDepEffect(oldDep, effect2);
- }
- effect2.deps[effect2._depsLength++] = dep;
+__name(createUnixTimestampInSecondsFunc, "createUnixTimestampInSecondsFunc");
+const timestampInSeconds = createUnixTimestampInSecondsFunc();
+let _browserPerformanceTimeOriginMode;
+const browserPerformanceTimeOrigin = (() => {
+ const { performance: performance2 } = GLOBAL_OBJ;
+ if (!performance2 || !performance2.now) {
+ _browserPerformanceTimeOriginMode = "none";
+ return void 0;
+ }
+ const threshold = 3600 * 1e3;
+ const performanceNow = performance2.now();
+ const dateNow = Date.now();
+ const timeOriginDelta = performance2.timeOrigin ? Math.abs(performance2.timeOrigin + performanceNow - dateNow) : threshold;
+ const timeOriginIsReliable = timeOriginDelta < threshold;
+ const navigationStart = performance2.timing && performance2.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 performance2.timeOrigin;
} else {
- effect2._depsLength++;
- }
- if (false) {
- (_a2 = effect2.onTrack) == null ? void 0 : _a2.call(effect2, extend$1({ effect: effect2 }, debuggerEventExtraInfo));
+ _browserPerformanceTimeOriginMode = "navigationStart";
+ return navigationStart;
}
}
-}
-__name(trackEffect, "trackEffect");
-const queueEffectSchedulers = [];
-function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
- var _a2;
- pauseScheduling();
- for (const effect2 of dep.keys()) {
- let tracking;
- if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
- effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
- effect2._dirtyLevel = dirtyLevel;
+ _browserPerformanceTimeOriginMode = "dateNow";
+ return dateNow;
+})();
+function uuid4() {
+ const gbl = GLOBAL_OBJ;
+ const crypto = gbl.crypto || gbl.msCrypto;
+ let getRandomByte = /* @__PURE__ */ __name(() => Math.random() * 16, "getRandomByte");
+ try {
+ if (crypto && crypto.randomUUID) {
+ return crypto.randomUUID().replace(/-/g, "");
}
- if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
- if (false) {
- (_a2 = effect2.onTrigger) == null ? void 0 : _a2.call(effect2, extend$1({ effect: effect2 }, debuggerEventExtraInfo));
- }
- effect2.trigger();
- if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 2) {
- effect2._shouldSchedule = false;
- if (effect2.scheduler) {
- queueEffectSchedulers.push(effect2.scheduler);
- }
- }
+ if (crypto && crypto.getRandomValues) {
+ getRandomByte = /* @__PURE__ */ __name(() => {
+ const typedArray = new Uint8Array(1);
+ crypto.getRandomValues(typedArray);
+ return typedArray[0];
+ }, "getRandomByte");
}
+ } catch (_2) {
}
- resetScheduling();
+ return ("10000000100040008000" + 1e11).replace(
+ /[018]/g,
+ (c2) => (
+ // eslint-disable-next-line no-bitwise
+ (c2 ^ (getRandomByte() & 15) >> c2 / 4).toString(16)
+ )
+ );
}
-__name(triggerEffects, "triggerEffects");
-const createDep = /* @__PURE__ */ __name((cleanup, computed2) => {
- const dep = /* @__PURE__ */ new Map();
- dep.cleanup = cleanup;
- dep.computed = computed2;
- return dep;
-}, "createDep");
-const targetMap = /* @__PURE__ */ new WeakMap();
-const ITERATE_KEY = Symbol(false ? "iterate" : "");
-const MAP_KEY_ITERATE_KEY = Symbol(false ? "Map key iterate" : "");
-function track(target, type, key) {
- if (shouldTrack && activeEffect) {
- let depsMap = targetMap.get(target);
- if (!depsMap) {
- targetMap.set(target, depsMap = /* @__PURE__ */ new Map());
- }
- let dep = depsMap.get(key);
- if (!dep) {
- depsMap.set(key, dep = createDep(() => depsMap.delete(key)));
+__name(uuid4, "uuid4");
+function getFirstException(event) {
+ return event.exception && event.exception.values ? event.exception.values[0] : void 0;
+}
+__name(getFirstException, "getFirstException");
+function getEventDescription(event) {
+ const { message: message3, event_id: eventId } = event;
+ if (message3) {
+ return message3;
+ }
+ const firstException = getFirstException(event);
+ if (firstException) {
+ if (firstException.type && firstException.value) {
+ return `${firstException.type}: ${firstException.value}`;
}
- trackEffect(
- activeEffect,
- dep,
- false ? {
- target,
- type,
- key
- } : void 0
- );
+ return firstException.type || firstException.value || eventId || "";
}
+ return eventId || "";
}
-__name(track, "track");
-function trigger(target, type, key, newValue2, oldValue2, oldTarget) {
- const depsMap = targetMap.get(target);
- if (!depsMap) {
+__name(getEventDescription, "getEventDescription");
+function addExceptionTypeValue(event, value4, type) {
+ const exception = event.exception = event.exception || {};
+ const values = exception.values = exception.values || [];
+ const firstException = values[0] = values[0] || {};
+ if (!firstException.value) {
+ firstException.value = value4 || "";
+ }
+ if (!firstException.type) {
+ firstException.type = type || "Error";
+ }
+}
+__name(addExceptionTypeValue, "addExceptionTypeValue");
+function addExceptionMechanism(event, newMechanism) {
+ const firstException = getFirstException(event);
+ if (!firstException) {
return;
}
- let deps = [];
- if (type === "clear") {
- deps = [...depsMap.values()];
- } else if (key === "length" && isArray$4(target)) {
- const newLength = Number(newValue2);
- depsMap.forEach((dep, key2) => {
- if (key2 === "length" || !isSymbol$1(key2) && key2 >= newLength) {
- deps.push(dep);
- }
- });
- } else {
- if (key !== void 0) {
- deps.push(depsMap.get(key));
+ 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;
+ }
+}
+__name(addExceptionMechanism, "addExceptionMechanism");
+const 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);
+}
+__name(_parseInt, "_parseInt");
+function parseSemver(input) {
+ const match2 = input.match(SEMVER_REGEXP) || [];
+ const major = _parseInt(match2[1]);
+ const minor = _parseInt(match2[2]);
+ const patch2 = _parseInt(match2[3]);
+ return {
+ buildmetadata: match2[5],
+ major: isNaN(major) ? void 0 : major,
+ minor: isNaN(minor) ? void 0 : minor,
+ patch: isNaN(patch2) ? void 0 : patch2,
+ prerelease: match2[4]
+ };
+}
+__name(parseSemver, "parseSemver");
+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));
+}
+__name(addContextToFrame, "addContextToFrame");
+function checkOrSetAlreadyCaught(exception) {
+ if (isAlreadyCaptured(exception)) {
+ return true;
+ }
+ try {
+ addNonEnumerableProperty(exception, "__sentry_captured__", true);
+ } catch (err) {
+ }
+ return false;
+}
+__name(checkOrSetAlreadyCaught, "checkOrSetAlreadyCaught");
+function isAlreadyCaptured(exception) {
+ try {
+ return exception.__sentry_captured__;
+ } catch (e2) {
+ }
+}
+__name(isAlreadyCaptured, "isAlreadyCaptured");
+function arrayify(maybeArray) {
+ return Array.isArray(maybeArray) ? maybeArray : [maybeArray];
+}
+__name(arrayify, "arrayify");
+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(value4) {
+ return new SyncPromise((resolve2) => {
+ resolve2(value4);
+ });
+}
+__name(resolvedSyncPromise, "resolvedSyncPromise");
+function rejectedSyncPromise(reason) {
+ return new SyncPromise((_2, reject3) => {
+ reject3(reason);
+ });
+}
+__name(rejectedSyncPromise, "rejectedSyncPromise");
+class SyncPromise {
+ static {
+ __name(this, "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 (e2) {
+ this._reject(e2);
}
- switch (type) {
- case "add":
- if (!isArray$4(target)) {
- deps.push(depsMap.get(ITERATE_KEY));
- if (isMap(target)) {
- deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
+ }
+ /** JSDoc */
+ then(onfulfilled, onrejected) {
+ return new SyncPromise((resolve2, reject3) => {
+ this._handlers.push([
+ false,
+ (result) => {
+ if (!onfulfilled) {
+ resolve2(result);
+ } else {
+ try {
+ resolve2(onfulfilled(result));
+ } catch (e2) {
+ reject3(e2);
+ }
+ }
+ },
+ (reason) => {
+ if (!onrejected) {
+ reject3(reason);
+ } else {
+ try {
+ resolve2(onrejected(reason));
+ } catch (e2) {
+ reject3(e2);
+ }
}
- } else if (isIntegerKey(key)) {
- deps.push(depsMap.get("length"));
}
- break;
- case "delete":
- if (!isArray$4(target)) {
- deps.push(depsMap.get(ITERATE_KEY));
- if (isMap(target)) {
- deps.push(depsMap.get(MAP_KEY_ITERATE_KEY));
+ ]);
+ this._executeHandlers();
+ });
+ }
+ /** JSDoc */
+ catch(onrejected) {
+ return this.then((val) => val, onrejected);
+ }
+ /** JSDoc */
+ finally(onfinally) {
+ return new SyncPromise((resolve2, reject3) => {
+ let val;
+ let isRejected;
+ return this.then(
+ (value4) => {
+ isRejected = false;
+ val = value4;
+ if (onfinally) {
+ onfinally();
+ }
+ },
+ (reason) => {
+ isRejected = true;
+ val = reason;
+ if (onfinally) {
+ onfinally();
}
}
- break;
- case "set":
- if (isMap(target)) {
- deps.push(depsMap.get(ITERATE_KEY));
+ ).then(() => {
+ if (isRejected) {
+ reject3(val);
+ return;
}
- break;
- }
+ resolve2(val);
+ });
+ });
}
- pauseScheduling();
- for (const dep of deps) {
- if (dep) {
- triggerEffects(
- dep,
- 4,
- false ? {
- target,
- type,
- key,
- newValue: newValue2,
- oldValue: oldValue2,
- oldTarget
- } : void 0
- );
- }
+ /** JSDoc */
+ __init() {
+ this._resolve = (value4) => {
+ this._setResult(States.RESOLVED, value4);
+ };
}
- resetScheduling();
-}
-__name(trigger, "trigger");
-function getDepFromReactive(object, key) {
- const depsMap = targetMap.get(object);
- return depsMap && depsMap.get(key);
-}
-__name(getDepFromReactive, "getDepFromReactive");
-const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
-const builtInSymbols = new Set(
- /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol$1)
-);
-const arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();
-function createArrayInstrumentations() {
- const instrumentations = {};
- ["includes", "indexOf", "lastIndexOf"].forEach((key) => {
- instrumentations[key] = function(...args) {
- const arr = toRaw(this);
- for (let i2 = 0, l = this.length; i2 < l; i2++) {
- track(arr, "get", i2 + "");
+ /** JSDoc */
+ __init2() {
+ this._reject = (reason) => {
+ this._setResult(States.REJECTED, reason);
+ };
+ }
+ /** JSDoc */
+ __init3() {
+ this._setResult = (state, value4) => {
+ if (this._state !== States.PENDING) {
+ return;
}
- const res = arr[key](...args);
- if (res === -1 || res === false) {
- return arr[key](...args.map(toRaw));
- } else {
- return res;
+ if (isThenable$1(value4)) {
+ void value4.then(this._resolve, this._reject);
+ return;
}
+ this._state = state;
+ this._value = value4;
+ this._executeHandlers();
};
- });
- ["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
- instrumentations[key] = function(...args) {
- pauseTracking();
- pauseScheduling();
- const res = toRaw(this)[key].apply(this, args);
- resetScheduling();
- resetTracking();
- return res;
+ }
+ /** JSDoc */
+ __init4() {
+ this._executeHandlers = () => {
+ if (this._state === States.PENDING) {
+ return;
+ }
+ const cachedHandlers = this._handlers.slice();
+ this._handlers = [];
+ cachedHandlers.forEach((handler6) => {
+ if (handler6[0]) {
+ return;
+ }
+ if (this._state === States.RESOLVED) {
+ handler6[1](this._value);
+ }
+ if (this._state === States.REJECTED) {
+ handler6[2](this._value);
+ }
+ handler6[0] = true;
+ });
};
- });
- return instrumentations;
+ }
}
-__name(createArrayInstrumentations, "createArrayInstrumentations");
-function hasOwnProperty$2(key) {
- if (!isSymbol$1(key)) key = String(key);
- const obj = toRaw(this);
- track(obj, "has", key);
- return obj.hasOwnProperty(key);
+function makeSession$1(context) {
+ const startingTime = timestampInSeconds();
+ const session = {
+ sid: uuid4(),
+ init: true,
+ timestamp: startingTime,
+ started: startingTime,
+ duration: 0,
+ status: "ok",
+ errors: 0,
+ ignoreDuration: false,
+ toJSON: /* @__PURE__ */ __name(() => sessionToJSON(session), "toJSON")
+ };
+ if (context) {
+ updateSession(session, context);
+ }
+ return session;
}
-__name(hasOwnProperty$2, "hasOwnProperty$2");
-class BaseReactiveHandler {
- static {
- __name(this, "BaseReactiveHandler");
+__name(makeSession$1, "makeSession$1");
+function updateSession(session, context = {}) {
+ if (context.user) {
+ if (!session.ipAddress && context.user.ip_address) {
+ session.ipAddress = context.user.ip_address;
+ }
+ if (!session.did && !context.did) {
+ session.did = context.user.id || context.user.email || context.user.username;
+ }
}
- constructor(_isReadonly = false, _isShallow = false) {
- this._isReadonly = _isReadonly;
- this._isShallow = _isShallow;
+ session.timestamp = context.timestamp || timestampInSeconds();
+ if (context.abnormal_mechanism) {
+ session.abnormal_mechanism = context.abnormal_mechanism;
}
- get(target, key, receiver) {
- const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
- if (key === "__v_isReactive") {
- return !isReadonly2;
- } else if (key === "__v_isReadonly") {
- return isReadonly2;
- } else if (key === "__v_isShallow") {
- return isShallow2;
- } else if (key === "__v_raw") {
- if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype
- // this means the reciever is a user proxy of the reactive proxy
- Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) {
- return target;
- }
- return;
+ if (context.ignoreDuration) {
+ session.ignoreDuration = context.ignoreDuration;
+ }
+ if (context.sid) {
+ session.sid = context.sid.length === 32 ? context.sid : uuid4();
+ }
+ if (context.init !== void 0) {
+ session.init = context.init;
+ }
+ if (!session.did && context.did) {
+ session.did = `${context.did}`;
+ }
+ if (typeof context.started === "number") {
+ session.started = context.started;
+ }
+ if (session.ignoreDuration) {
+ session.duration = void 0;
+ } else if (typeof context.duration === "number") {
+ session.duration = context.duration;
+ } else {
+ const duration = session.timestamp - session.started;
+ session.duration = duration >= 0 ? duration : 0;
+ }
+ if (context.release) {
+ session.release = context.release;
+ }
+ if (context.environment) {
+ session.environment = context.environment;
+ }
+ if (!session.ipAddress && context.ipAddress) {
+ session.ipAddress = context.ipAddress;
+ }
+ if (!session.userAgent && context.userAgent) {
+ session.userAgent = context.userAgent;
+ }
+ if (typeof context.errors === "number") {
+ session.errors = context.errors;
+ }
+ if (context.status) {
+ session.status = context.status;
+ }
+}
+__name(updateSession, "updateSession");
+function closeSession(session, status) {
+ let context = {};
+ if (status) {
+ context = { status };
+ } else if (session.status === "ok") {
+ context = { status: "exited" };
+ }
+ updateSession(session, context);
+}
+__name(closeSession, "closeSession");
+function sessionToJSON(session) {
+ return dropUndefinedKeys({
+ sid: `${session.sid}`,
+ init: session.init,
+ // Make sure that sec is converted to ms for date constructor
+ started: new Date(session.started * 1e3).toISOString(),
+ timestamp: new Date(session.timestamp * 1e3).toISOString(),
+ status: session.status,
+ errors: session.errors,
+ did: typeof session.did === "number" || typeof session.did === "string" ? `${session.did}` : void 0,
+ duration: session.duration,
+ abnormal_mechanism: session.abnormal_mechanism,
+ attrs: {
+ release: session.release,
+ environment: session.environment,
+ ip_address: session.ipAddress,
+ user_agent: session.userAgent
}
- const targetIsArray = isArray$4(target);
- if (!isReadonly2) {
- if (targetIsArray && hasOwn$3(arrayInstrumentations, key)) {
- return Reflect.get(arrayInstrumentations, key, receiver);
- }
- if (key === "hasOwnProperty") {
- return hasOwnProperty$2;
- }
- }
- const res = Reflect.get(target, key, receiver);
- if (isSymbol$1(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {
- return res;
- }
- if (!isReadonly2) {
- track(target, "get", key);
- }
- if (isShallow2) {
- return res;
- }
- if (isRef(res)) {
- return targetIsArray && isIntegerKey(key) ? res : res.value;
- }
- if (isObject$6(res)) {
- return isReadonly2 ? readonly(res) : reactive(res);
+ });
+}
+__name(sessionToJSON, "sessionToJSON");
+function generatePropagationContext() {
+ return {
+ traceId: generateTraceId(),
+ spanId: generateSpanId()
+ };
+}
+__name(generatePropagationContext, "generatePropagationContext");
+function generateTraceId() {
+ return uuid4();
+}
+__name(generateTraceId, "generateTraceId");
+function generateSpanId() {
+ return uuid4().substring(16);
+}
+__name(generateSpanId, "generateSpanId");
+function merge$1(initialObj, mergeObj, levels = 2) {
+ if (!mergeObj || typeof mergeObj !== "object" || levels <= 0) {
+ return mergeObj;
+ }
+ if (initialObj && mergeObj && Object.keys(mergeObj).length === 0) {
+ return initialObj;
+ }
+ const output = { ...initialObj };
+ for (const key in mergeObj) {
+ if (Object.prototype.hasOwnProperty.call(mergeObj, key)) {
+ output[key] = merge$1(output[key], mergeObj[key], levels - 1);
}
- return res;
}
+ return output;
}
-class MutableReactiveHandler extends BaseReactiveHandler {
+__name(merge$1, "merge$1");
+const SCOPE_SPAN_FIELD = "_sentrySpan";
+function _setSpanForScope(scope, span) {
+ if (span) {
+ addNonEnumerableProperty(scope, SCOPE_SPAN_FIELD, span);
+ } else {
+ delete scope[SCOPE_SPAN_FIELD];
+ }
+}
+__name(_setSpanForScope, "_setSpanForScope");
+function _getSpanForScope(scope) {
+ return scope[SCOPE_SPAN_FIELD];
+}
+__name(_getSpanForScope, "_getSpanForScope");
+const DEFAULT_MAX_BREADCRUMBS = 100;
+class ScopeClass {
static {
- __name(this, "MutableReactiveHandler");
+ __name(this, "ScopeClass");
+ }
+ /** Flag if notifying is happening. */
+ /** Callback for client to receive scope changes. */
+ /** Callback list that will be called during event processing. */
+ /** Array of breadcrumbs. */
+ /** User */
+ /** Tags */
+ /** Extra */
+ /** Contexts */
+ /** Attachments */
+ /** Propagation Context for distributed tracing */
+ /**
+ * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get
+ * sent to Sentry
+ */
+ /** Fingerprint */
+ /** Severity */
+ /**
+ * Transaction Name
+ *
+ * IMPORTANT: The transaction name on the scope has nothing to do with root spans/transaction objects.
+ * It's purpose is to assign a transaction to the scope that's added to non-transaction events.
+ */
+ /** Session */
+ /** Request Mode Session Status */
+ // eslint-disable-next-line deprecation/deprecation
+ /** The client on this scope */
+ /** Contains the last event id of a captured event. */
+ // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method.
+ constructor() {
+ this._notifyingListeners = false;
+ this._scopeListeners = [];
+ this._eventProcessors = [];
+ this._breadcrumbs = [];
+ this._attachments = [];
+ this._user = {};
+ this._tags = {};
+ this._extra = {};
+ this._contexts = {};
+ this._sdkProcessingMetadata = {};
+ this._propagationContext = {
+ traceId: generateTraceId(),
+ spanId: generateSpanId()
+ };
+ }
+ /**
+ * @inheritDoc
+ */
+ clone() {
+ const newScope = new ScopeClass();
+ newScope._breadcrumbs = [...this._breadcrumbs];
+ newScope._tags = { ...this._tags };
+ newScope._extra = { ...this._extra };
+ newScope._contexts = { ...this._contexts };
+ if (this._contexts.flags) {
+ newScope._contexts.flags = {
+ values: [...this._contexts.flags.values]
+ };
+ }
+ newScope._user = this._user;
+ newScope._level = this._level;
+ newScope._session = this._session;
+ newScope._transactionName = this._transactionName;
+ newScope._fingerprint = this._fingerprint;
+ newScope._eventProcessors = [...this._eventProcessors];
+ newScope._requestSession = this._requestSession;
+ newScope._attachments = [...this._attachments];
+ newScope._sdkProcessingMetadata = { ...this._sdkProcessingMetadata };
+ newScope._propagationContext = { ...this._propagationContext };
+ newScope._client = this._client;
+ newScope._lastEventId = this._lastEventId;
+ _setSpanForScope(newScope, _getSpanForScope(this));
+ return newScope;
+ }
+ /**
+ * @inheritDoc
+ */
+ setClient(client) {
+ this._client = client;
}
- constructor(isShallow2 = false) {
- super(false, isShallow2);
+ /**
+ * @inheritDoc
+ */
+ setLastEventId(lastEventId2) {
+ this._lastEventId = lastEventId2;
}
- set(target, key, value4, receiver) {
- let oldValue2 = target[key];
- if (!this._isShallow) {
- const isOldValueReadonly = isReadonly(oldValue2);
- if (!isShallow(value4) && !isReadonly(value4)) {
- oldValue2 = toRaw(oldValue2);
- value4 = toRaw(value4);
- }
- if (!isArray$4(target) && isRef(oldValue2) && !isRef(value4)) {
- if (isOldValueReadonly) {
- return false;
- } else {
- oldValue2.value = value4;
- return true;
- }
- }
- }
- const hadKey = isArray$4(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn$3(target, key);
- const result = Reflect.set(target, key, value4, receiver);
- if (target === toRaw(receiver)) {
- if (!hadKey) {
- trigger(target, "add", key, value4);
- } else if (hasChanged(value4, oldValue2)) {
- trigger(target, "set", key, value4, oldValue2);
- }
- }
- return result;
+ /**
+ * @inheritDoc
+ */
+ getClient() {
+ return this._client;
}
- deleteProperty(target, key) {
- const hadKey = hasOwn$3(target, key);
- const oldValue2 = target[key];
- const result = Reflect.deleteProperty(target, key);
- if (result && hadKey) {
- trigger(target, "delete", key, void 0, oldValue2);
- }
- return result;
+ /**
+ * @inheritDoc
+ */
+ lastEventId() {
+ return this._lastEventId;
}
- has(target, key) {
- const result = Reflect.has(target, key);
- if (!isSymbol$1(key) || !builtInSymbols.has(key)) {
- track(target, "has", key);
+ /**
+ * @inheritDoc
+ */
+ addScopeListener(callback) {
+ this._scopeListeners.push(callback);
+ }
+ /**
+ * @inheritDoc
+ */
+ addEventProcessor(callback) {
+ this._eventProcessors.push(callback);
+ return this;
+ }
+ /**
+ * @inheritDoc
+ */
+ setUser(user) {
+ this._user = user || {
+ email: void 0,
+ id: void 0,
+ ip_address: void 0,
+ username: void 0
+ };
+ if (this._session) {
+ updateSession(this._session, { user });
}
- return result;
+ this._notifyScopeListeners();
+ return this;
}
- ownKeys(target) {
- track(
- target,
- "iterate",
- isArray$4(target) ? "length" : ITERATE_KEY
- );
- return Reflect.ownKeys(target);
+ /**
+ * @inheritDoc
+ */
+ getUser() {
+ return this._user;
}
-}
-class ReadonlyReactiveHandler extends BaseReactiveHandler {
- static {
- __name(this, "ReadonlyReactiveHandler");
+ /**
+ * @inheritDoc
+ */
+ // eslint-disable-next-line deprecation/deprecation
+ getRequestSession() {
+ return this._requestSession;
}
- constructor(isShallow2 = false) {
- super(true, isShallow2);
+ /**
+ * @inheritDoc
+ */
+ // eslint-disable-next-line deprecation/deprecation
+ setRequestSession(requestSession) {
+ this._requestSession = requestSession;
+ return this;
}
- set(target, key) {
- if (false) {
- warn$4(
- `Set operation on key "${String(key)}" failed: target is readonly.`,
- target
- );
+ /**
+ * @inheritDoc
+ */
+ setTags(tags) {
+ this._tags = {
+ ...this._tags,
+ ...tags
+ };
+ this._notifyScopeListeners();
+ return this;
+ }
+ /**
+ * @inheritDoc
+ */
+ setTag(key, value4) {
+ this._tags = { ...this._tags, [key]: value4 };
+ this._notifyScopeListeners();
+ return this;
+ }
+ /**
+ * @inheritDoc
+ */
+ setExtras(extras) {
+ this._extra = {
+ ...this._extra,
+ ...extras
+ };
+ this._notifyScopeListeners();
+ return this;
+ }
+ /**
+ * @inheritDoc
+ */
+ setExtra(key, extra) {
+ this._extra = { ...this._extra, [key]: extra };
+ this._notifyScopeListeners();
+ return this;
+ }
+ /**
+ * @inheritDoc
+ */
+ setFingerprint(fingerprint) {
+ this._fingerprint = fingerprint;
+ this._notifyScopeListeners();
+ return this;
+ }
+ /**
+ * @inheritDoc
+ */
+ setLevel(level) {
+ this._level = level;
+ this._notifyScopeListeners();
+ return this;
+ }
+ /**
+ * @inheritDoc
+ */
+ setTransactionName(name2) {
+ this._transactionName = name2;
+ this._notifyScopeListeners();
+ return this;
+ }
+ /**
+ * @inheritDoc
+ */
+ setContext(key, context) {
+ if (context === null) {
+ delete this._contexts[key];
+ } else {
+ this._contexts[key] = context;
}
- return true;
+ this._notifyScopeListeners();
+ return this;
}
- deleteProperty(target, key) {
- if (false) {
- warn$4(
- `Delete operation on key "${String(key)}" failed: target is readonly.`,
- target
- );
+ /**
+ * @inheritDoc
+ */
+ setSession(session) {
+ if (!session) {
+ delete this._session;
+ } else {
+ this._session = session;
}
- return true;
+ this._notifyScopeListeners();
+ return this;
}
-}
-const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler();
-const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler();
-const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(
- true
-);
-const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true);
-const toShallow = /* @__PURE__ */ __name((value4) => value4, "toShallow");
-const getProto = /* @__PURE__ */ __name((v2) => Reflect.getPrototypeOf(v2), "getProto");
-function get$3(target, key, isReadonly2 = false, isShallow2 = false) {
- target = target["__v_raw"];
- const rawTarget = toRaw(target);
- const rawKey = toRaw(key);
- if (!isReadonly2) {
- if (hasChanged(key, rawKey)) {
- track(rawTarget, "get", key);
+ /**
+ * @inheritDoc
+ */
+ getSession() {
+ return this._session;
+ }
+ /**
+ * @inheritDoc
+ */
+ update(captureContext) {
+ if (!captureContext) {
+ return this;
}
- track(rawTarget, "get", rawKey);
+ const scopeToMerge = typeof captureContext === "function" ? captureContext(this) : captureContext;
+ const [scopeInstance, requestSession] = scopeToMerge instanceof Scope ? (
+ // eslint-disable-next-line deprecation/deprecation
+ [scopeToMerge.getScopeData(), scopeToMerge.getRequestSession()]
+ ) : isPlainObject$5(scopeToMerge) ? [captureContext, captureContext.requestSession] : [];
+ const { tags, extra, user, contexts, level, fingerprint = [], propagationContext } = scopeInstance || {};
+ this._tags = { ...this._tags, ...tags };
+ this._extra = { ...this._extra, ...extra };
+ this._contexts = { ...this._contexts, ...contexts };
+ if (user && Object.keys(user).length) {
+ this._user = user;
+ }
+ if (level) {
+ this._level = level;
+ }
+ if (fingerprint.length) {
+ this._fingerprint = fingerprint;
+ }
+ if (propagationContext) {
+ this._propagationContext = propagationContext;
+ }
+ if (requestSession) {
+ this._requestSession = requestSession;
+ }
+ return this;
}
- const { has: has2 } = getProto(rawTarget);
- const wrap2 = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive$1;
- if (has2.call(rawTarget, key)) {
- return wrap2(target.get(key));
- } else if (has2.call(rawTarget, rawKey)) {
- return wrap2(target.get(rawKey));
- } else if (target !== rawTarget) {
- target.get(key);
+ /**
+ * @inheritDoc
+ */
+ clear() {
+ this._breadcrumbs = [];
+ this._tags = {};
+ this._extra = {};
+ this._user = {};
+ this._contexts = {};
+ this._level = void 0;
+ this._transactionName = void 0;
+ this._fingerprint = void 0;
+ this._requestSession = void 0;
+ this._session = void 0;
+ _setSpanForScope(this, void 0);
+ this._attachments = [];
+ this.setPropagationContext({ traceId: generateTraceId() });
+ this._notifyScopeListeners();
+ return this;
}
-}
-__name(get$3, "get$3");
-function has$1(key, isReadonly2 = false) {
- const target = this["__v_raw"];
- const rawTarget = toRaw(target);
- const rawKey = toRaw(key);
- if (!isReadonly2) {
- if (hasChanged(key, rawKey)) {
- track(rawTarget, "has", key);
+ /**
+ * @inheritDoc
+ */
+ addBreadcrumb(breadcrumb, maxBreadcrumbs) {
+ const maxCrumbs = typeof maxBreadcrumbs === "number" ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS;
+ if (maxCrumbs <= 0) {
+ return this;
}
- track(rawTarget, "has", rawKey);
+ const mergedBreadcrumb = {
+ timestamp: dateTimestampInSeconds(),
+ ...breadcrumb
+ };
+ const breadcrumbs = this._breadcrumbs;
+ breadcrumbs.push(mergedBreadcrumb);
+ this._breadcrumbs = breadcrumbs.length > maxCrumbs ? breadcrumbs.slice(-maxCrumbs) : breadcrumbs;
+ this._notifyScopeListeners();
+ return this;
}
- return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
-}
-__name(has$1, "has$1");
-function size(target, isReadonly2 = false) {
- target = target["__v_raw"];
- !isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
- return Reflect.get(target, "size", target);
-}
-__name(size, "size");
-function add$1(value4) {
- value4 = toRaw(value4);
- const target = toRaw(this);
- const proto = getProto(target);
- const hadKey = proto.has.call(target, value4);
- if (!hadKey) {
- target.add(value4);
- trigger(target, "add", value4, value4);
+ /**
+ * @inheritDoc
+ */
+ getLastBreadcrumb() {
+ return this._breadcrumbs[this._breadcrumbs.length - 1];
}
- return this;
-}
-__name(add$1, "add$1");
-function set$4(key, value4) {
- value4 = toRaw(value4);
- const target = toRaw(this);
- const { has: has2, get: get22 } = getProto(target);
- let hadKey = has2.call(target, key);
- if (!hadKey) {
- key = toRaw(key);
- hadKey = has2.call(target, key);
- } else if (false) {
- checkIdentityKeys(target, has2, key);
+ /**
+ * @inheritDoc
+ */
+ clearBreadcrumbs() {
+ this._breadcrumbs = [];
+ this._notifyScopeListeners();
+ return this;
}
- const oldValue2 = get22.call(target, key);
- target.set(key, value4);
- if (!hadKey) {
- trigger(target, "add", key, value4);
- } else if (hasChanged(value4, oldValue2)) {
- trigger(target, "set", key, value4, oldValue2);
+ /**
+ * @inheritDoc
+ */
+ addAttachment(attachment) {
+ this._attachments.push(attachment);
+ return this;
}
- return this;
-}
-__name(set$4, "set$4");
-function deleteEntry(key) {
- const target = toRaw(this);
- const { has: has2, get: get22 } = getProto(target);
- let hadKey = has2.call(target, key);
- if (!hadKey) {
- key = toRaw(key);
- hadKey = has2.call(target, key);
- } else if (false) {
- checkIdentityKeys(target, has2, key);
+ /**
+ * @inheritDoc
+ */
+ clearAttachments() {
+ this._attachments = [];
+ return this;
}
- const oldValue2 = get22 ? get22.call(target, key) : void 0;
- const result = target.delete(key);
- if (hadKey) {
- trigger(target, "delete", key, void 0, oldValue2);
+ /** @inheritDoc */
+ getScopeData() {
+ return {
+ breadcrumbs: this._breadcrumbs,
+ attachments: this._attachments,
+ contexts: this._contexts,
+ tags: this._tags,
+ extra: this._extra,
+ user: this._user,
+ level: this._level,
+ fingerprint: this._fingerprint || [],
+ eventProcessors: this._eventProcessors,
+ propagationContext: this._propagationContext,
+ sdkProcessingMetadata: this._sdkProcessingMetadata,
+ transactionName: this._transactionName,
+ span: _getSpanForScope(this)
+ };
+ }
+ /**
+ * @inheritDoc
+ */
+ setSDKProcessingMetadata(newData) {
+ this._sdkProcessingMetadata = merge$1(this._sdkProcessingMetadata, newData, 2);
+ return this;
}
- return result;
-}
-__name(deleteEntry, "deleteEntry");
-function clear() {
- const target = toRaw(this);
- const hadItems = target.size !== 0;
- const oldTarget = false ? isMap(target) ? new Map(target) : new Set(target) : void 0;
- const result = target.clear();
- if (hadItems) {
- trigger(target, "clear", void 0, void 0, oldTarget);
+ /**
+ * @inheritDoc
+ */
+ setPropagationContext(context) {
+ this._propagationContext = {
+ // eslint-disable-next-line deprecation/deprecation
+ spanId: generateSpanId(),
+ ...context
+ };
+ return this;
}
- return result;
-}
-__name(clear, "clear");
-function createForEach(isReadonly2, isShallow2) {
- return /* @__PURE__ */ __name(function forEach3(callback, thisArg) {
- const observed = this;
- const target = observed["__v_raw"];
- const rawTarget = toRaw(target);
- const wrap2 = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive$1;
- !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
- return target.forEach((value4, key) => {
- return callback.call(thisArg, wrap2(value4), wrap2(key), observed);
- });
- }, "forEach");
-}
-__name(createForEach, "createForEach");
-function createIterableMethod(method, isReadonly2, isShallow2) {
- return function(...args) {
- const target = this["__v_raw"];
- const rawTarget = toRaw(target);
- const targetIsMap = isMap(rawTarget);
- const isPair = method === "entries" || method === Symbol.iterator && targetIsMap;
- const isKeyOnly = method === "keys" && targetIsMap;
- const innerIterator = target[method](...args);
- const wrap2 = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive$1;
- !isReadonly2 && track(
- rawTarget,
- "iterate",
- isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY
+ /**
+ * @inheritDoc
+ */
+ getPropagationContext() {
+ return this._propagationContext;
+ }
+ /**
+ * @inheritDoc
+ */
+ captureException(exception, hint) {
+ const eventId = hint && hint.event_id ? hint.event_id : uuid4();
+ if (!this._client) {
+ logger$2.warn("No client configured on scope - will not capture exception!");
+ return eventId;
+ }
+ const syntheticException = new Error("Sentry syntheticException");
+ this._client.captureException(
+ exception,
+ {
+ originalException: exception,
+ syntheticException,
+ ...hint,
+ event_id: eventId
+ },
+ this
);
- return {
- // iterator protocol
- next() {
- const { value: value4, done } = innerIterator.next();
- return done ? { value: value4, done } : {
- value: isPair ? [wrap2(value4[0]), wrap2(value4[1])] : wrap2(value4),
- done
- };
+ return eventId;
+ }
+ /**
+ * @inheritDoc
+ */
+ captureMessage(message3, level, hint) {
+ const eventId = hint && hint.event_id ? hint.event_id : uuid4();
+ if (!this._client) {
+ logger$2.warn("No client configured on scope - will not capture message!");
+ return eventId;
+ }
+ const syntheticException = new Error(message3);
+ this._client.captureMessage(
+ message3,
+ level,
+ {
+ originalException: message3,
+ syntheticException,
+ ...hint,
+ event_id: eventId
},
- // iterable protocol
- [Symbol.iterator]() {
- return this;
- }
- };
- };
+ this
+ );
+ return eventId;
+ }
+ /**
+ * @inheritDoc
+ */
+ captureEvent(event, hint) {
+ const eventId = hint && hint.event_id ? hint.event_id : uuid4();
+ if (!this._client) {
+ logger$2.warn("No client configured on scope - will not capture event!");
+ return eventId;
+ }
+ this._client.captureEvent(event, { ...hint, event_id: eventId }, this);
+ return eventId;
+ }
+ /**
+ * This will be called on every set call.
+ */
+ _notifyScopeListeners() {
+ if (!this._notifyingListeners) {
+ this._notifyingListeners = true;
+ this._scopeListeners.forEach((callback) => {
+ callback(this);
+ });
+ this._notifyingListeners = false;
+ }
+ }
}
-__name(createIterableMethod, "createIterableMethod");
-function createReadonlyMethod(type) {
- return function(...args) {
- if (false) {
- const key = args[0] ? `on key "${args[0]}" ` : ``;
- warn$4(
- `${capitalize$1(type)} operation ${key}failed: target is readonly.`,
- toRaw(this)
+const Scope = ScopeClass;
+function getDefaultCurrentScope() {
+ return getGlobalSingleton("defaultCurrentScope", () => new Scope());
+}
+__name(getDefaultCurrentScope, "getDefaultCurrentScope");
+function getDefaultIsolationScope() {
+ return getGlobalSingleton("defaultIsolationScope", () => new Scope());
+}
+__name(getDefaultIsolationScope, "getDefaultIsolationScope");
+class AsyncContextStack {
+ static {
+ __name(this, "AsyncContextStack");
+ }
+ constructor(scope, isolationScope) {
+ let assignedScope;
+ if (!scope) {
+ assignedScope = new Scope();
+ } else {
+ assignedScope = scope;
+ }
+ let assignedIsolationScope;
+ if (!isolationScope) {
+ assignedIsolationScope = new Scope();
+ } else {
+ assignedIsolationScope = isolationScope;
+ }
+ this._stack = [{ scope: assignedScope }];
+ this._isolationScope = assignedIsolationScope;
+ }
+ /**
+ * Fork a scope for the stack.
+ */
+ withScope(callback) {
+ const scope = this._pushScope();
+ let maybePromiseResult;
+ try {
+ maybePromiseResult = callback(scope);
+ } catch (e2) {
+ this._popScope();
+ throw e2;
+ }
+ if (isThenable$1(maybePromiseResult)) {
+ return maybePromiseResult.then(
+ (res) => {
+ this._popScope();
+ return res;
+ },
+ (e2) => {
+ this._popScope();
+ throw e2;
+ }
);
}
- return type === "delete" ? false : type === "clear" ? void 0 : this;
- };
+ this._popScope();
+ return maybePromiseResult;
+ }
+ /**
+ * Get the client of the stack.
+ */
+ getClient() {
+ return this.getStackTop().client;
+ }
+ /**
+ * Returns the scope of the top stack.
+ */
+ getScope() {
+ return this.getStackTop().scope;
+ }
+ /**
+ * Get the isolation scope for the stack.
+ */
+ getIsolationScope() {
+ return this._isolationScope;
+ }
+ /**
+ * Returns the topmost scope layer in the order domain > local > process.
+ */
+ getStackTop() {
+ return this._stack[this._stack.length - 1];
+ }
+ /**
+ * Push a scope to the stack.
+ */
+ _pushScope() {
+ const scope = this.getScope().clone();
+ this._stack.push({
+ client: this.getClient(),
+ scope
+ });
+ return scope;
+ }
+ /**
+ * Pop a scope from the stack.
+ */
+ _popScope() {
+ if (this._stack.length <= 1) return false;
+ return !!this._stack.pop();
+ }
+}
+function getAsyncContextStack() {
+ const registry = getMainCarrier();
+ const sentry = getSentryCarrier(registry);
+ return sentry.stack = sentry.stack || new AsyncContextStack(getDefaultCurrentScope(), getDefaultIsolationScope());
+}
+__name(getAsyncContextStack, "getAsyncContextStack");
+function withScope$1(callback) {
+ return getAsyncContextStack().withScope(callback);
+}
+__name(withScope$1, "withScope$1");
+function withSetScope(scope, callback) {
+ const stack2 = getAsyncContextStack();
+ return stack2.withScope(() => {
+ stack2.getStackTop().scope = scope;
+ return callback(scope);
+ });
}
-__name(createReadonlyMethod, "createReadonlyMethod");
-function createInstrumentations() {
- const mutableInstrumentations2 = {
- get(key) {
- return get$3(this, key);
- },
- get size() {
- return size(this);
- },
- has: has$1,
- add: add$1,
- set: set$4,
- delete: deleteEntry,
- clear,
- forEach: createForEach(false, false)
- };
- const shallowInstrumentations2 = {
- get(key) {
- return get$3(this, key, false, true);
- },
- get size() {
- return size(this);
- },
- has: has$1,
- add: add$1,
- set: set$4,
- delete: deleteEntry,
- clear,
- forEach: createForEach(false, true)
- };
- const readonlyInstrumentations2 = {
- get(key) {
- return get$3(this, key, true);
- },
- get size() {
- return size(this, true);
- },
- has(key) {
- return has$1.call(this, key, true);
- },
- add: createReadonlyMethod("add"),
- set: createReadonlyMethod("set"),
- delete: createReadonlyMethod("delete"),
- clear: createReadonlyMethod("clear"),
- forEach: createForEach(true, false)
- };
- const shallowReadonlyInstrumentations2 = {
- get(key) {
- return get$3(this, key, true, true);
- },
- get size() {
- return size(this, true);
- },
- has(key) {
- return has$1.call(this, key, true);
- },
- add: createReadonlyMethod("add"),
- set: createReadonlyMethod("set"),
- delete: createReadonlyMethod("delete"),
- clear: createReadonlyMethod("clear"),
- forEach: createForEach(true, true)
- };
- const iteratorMethods = [
- "keys",
- "values",
- "entries",
- Symbol.iterator
- ];
- iteratorMethods.forEach((method) => {
- mutableInstrumentations2[method] = createIterableMethod(method, false, false);
- readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
- shallowInstrumentations2[method] = createIterableMethod(method, false, true);
- shallowReadonlyInstrumentations2[method] = createIterableMethod(
- method,
- true,
- true
- );
+__name(withSetScope, "withSetScope");
+function withIsolationScope$1(callback) {
+ return getAsyncContextStack().withScope(() => {
+ return callback(getAsyncContextStack().getIsolationScope());
});
- return [
- mutableInstrumentations2,
- readonlyInstrumentations2,
- shallowInstrumentations2,
- shallowReadonlyInstrumentations2
- ];
}
-__name(createInstrumentations, "createInstrumentations");
-const [
- mutableInstrumentations,
- readonlyInstrumentations,
- shallowInstrumentations,
- shallowReadonlyInstrumentations
-] = /* @__PURE__ */ createInstrumentations();
-function createInstrumentationGetter(isReadonly2, shallow) {
- const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;
- return (target, key, receiver) => {
- if (key === "__v_isReactive") {
- return !isReadonly2;
- } else if (key === "__v_isReadonly") {
- return isReadonly2;
- } else if (key === "__v_raw") {
- return target;
- }
- return Reflect.get(
- hasOwn$3(instrumentations, key) && key in target ? instrumentations : target,
- key,
- receiver
- );
+__name(withIsolationScope$1, "withIsolationScope$1");
+function getStackAsyncContextStrategy() {
+ return {
+ withIsolationScope: withIsolationScope$1,
+ withScope: withScope$1,
+ withSetScope,
+ withSetIsolationScope: /* @__PURE__ */ __name((_isolationScope, callback) => {
+ return withIsolationScope$1(callback);
+ }, "withSetIsolationScope"),
+ getCurrentScope: /* @__PURE__ */ __name(() => getAsyncContextStack().getScope(), "getCurrentScope"),
+ getIsolationScope: /* @__PURE__ */ __name(() => getAsyncContextStack().getIsolationScope(), "getIsolationScope")
};
}
-__name(createInstrumentationGetter, "createInstrumentationGetter");
-const mutableCollectionHandlers = {
- get: /* @__PURE__ */ createInstrumentationGetter(false, false)
-};
-const shallowCollectionHandlers = {
- get: /* @__PURE__ */ createInstrumentationGetter(false, true)
-};
-const readonlyCollectionHandlers = {
- get: /* @__PURE__ */ createInstrumentationGetter(true, false)
-};
-const shallowReadonlyCollectionHandlers = {
- get: /* @__PURE__ */ createInstrumentationGetter(true, true)
-};
-function checkIdentityKeys(target, has2, key) {
- const rawKey = toRaw(key);
- if (rawKey !== key && has2.call(target, rawKey)) {
- const type = toRawType(target);
- warn$4(
- `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
- );
+__name(getStackAsyncContextStrategy, "getStackAsyncContextStrategy");
+function setAsyncContextStrategy(strategy) {
+ const registry = getMainCarrier();
+ const sentry = getSentryCarrier(registry);
+ sentry.acs = strategy;
+}
+__name(setAsyncContextStrategy, "setAsyncContextStrategy");
+function getAsyncContextStrategy(carrier) {
+ const sentry = getSentryCarrier(carrier);
+ if (sentry.acs) {
+ return sentry.acs;
+ }
+ return getStackAsyncContextStrategy();
+}
+__name(getAsyncContextStrategy, "getAsyncContextStrategy");
+function getCurrentScope$1() {
+ const carrier = getMainCarrier();
+ const acs = getAsyncContextStrategy(carrier);
+ return acs.getCurrentScope();
+}
+__name(getCurrentScope$1, "getCurrentScope$1");
+function getIsolationScope() {
+ const carrier = getMainCarrier();
+ const acs = getAsyncContextStrategy(carrier);
+ return acs.getIsolationScope();
+}
+__name(getIsolationScope, "getIsolationScope");
+function getGlobalScope() {
+ return getGlobalSingleton("globalScope", () => new Scope());
+}
+__name(getGlobalScope, "getGlobalScope");
+function withScope(...rest) {
+ const carrier = getMainCarrier();
+ const acs = getAsyncContextStrategy(carrier);
+ if (rest.length === 2) {
+ const [scope, callback] = rest;
+ if (!scope) {
+ return acs.withScope(callback);
+ }
+ return acs.withSetScope(scope, callback);
+ }
+ return acs.withScope(rest[0]);
+}
+__name(withScope, "withScope");
+function withIsolationScope(...rest) {
+ const carrier = getMainCarrier();
+ const acs = getAsyncContextStrategy(carrier);
+ if (rest.length === 2) {
+ const [isolationScope, callback] = rest;
+ if (!isolationScope) {
+ return acs.withIsolationScope(callback);
+ }
+ return acs.withSetIsolationScope(isolationScope, callback);
+ }
+ return acs.withIsolationScope(rest[0]);
+}
+__name(withIsolationScope, "withIsolationScope");
+function getClient() {
+ return getCurrentScope$1().getClient();
+}
+__name(getClient, "getClient");
+function getTraceContextFromScope(scope) {
+ const propagationContext = scope.getPropagationContext();
+ const { traceId, spanId, parentSpanId } = propagationContext;
+ const traceContext = dropUndefinedKeys({
+ trace_id: traceId,
+ span_id: spanId,
+ parent_span_id: parentSpanId
+ });
+ return traceContext;
+}
+__name(getTraceContextFromScope, "getTraceContextFromScope");
+const METRICS_SPAN_FIELD = "_sentryMetrics";
+function getMetricSummaryJsonForSpan(span) {
+ const storage = span[METRICS_SPAN_FIELD];
+ if (!storage) {
+ return void 0;
}
+ const output = {};
+ for (const [, [exportKey, summary]] of storage) {
+ const arr = output[exportKey] || (output[exportKey] = []);
+ arr.push(dropUndefinedKeys(summary));
+ }
+ return output;
}
-__name(checkIdentityKeys, "checkIdentityKeys");
-const reactiveMap = /* @__PURE__ */ new WeakMap();
-const shallowReactiveMap = /* @__PURE__ */ new WeakMap();
-const readonlyMap = /* @__PURE__ */ new WeakMap();
-const shallowReadonlyMap = /* @__PURE__ */ new WeakMap();
-function targetTypeMap(rawType) {
- switch (rawType) {
- case "Object":
- case "Array":
- return 1;
- case "Map":
- case "Set":
- case "WeakMap":
- case "WeakSet":
- return 2;
- default:
- return 0;
+__name(getMetricSummaryJsonForSpan, "getMetricSummaryJsonForSpan");
+function updateMetricSummaryOnSpan(span, metricType, sanitizedName, value4, unit, tags, bucketKey) {
+ const existingStorage = span[METRICS_SPAN_FIELD];
+ const storage = existingStorage || (span[METRICS_SPAN_FIELD] = /* @__PURE__ */ new Map());
+ const exportKey = `${metricType}:${sanitizedName}@${unit}`;
+ const bucketItem = storage.get(bucketKey);
+ if (bucketItem) {
+ const [, summary] = bucketItem;
+ storage.set(bucketKey, [
+ exportKey,
+ {
+ min: Math.min(summary.min, value4),
+ max: Math.max(summary.max, value4),
+ count: summary.count += 1,
+ sum: summary.sum += value4,
+ tags: summary.tags
+ }
+ ]);
+ } else {
+ storage.set(bucketKey, [
+ exportKey,
+ {
+ min: value4,
+ max: value4,
+ count: 1,
+ sum: value4,
+ tags
+ }
+ ]);
}
}
-__name(targetTypeMap, "targetTypeMap");
-function getTargetType(value4) {
- return value4["__v_skip"] || !Object.isExtensible(value4) ? 0 : targetTypeMap(toRawType(value4));
+__name(updateMetricSummaryOnSpan, "updateMetricSummaryOnSpan");
+const SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = "sentry.source";
+const SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = "sentry.sample_rate";
+const SEMANTIC_ATTRIBUTE_SENTRY_OP = "sentry.op";
+const SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = "sentry.origin";
+const SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON = "sentry.idle_span_finish_reason";
+const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT = "sentry.measurement_unit";
+const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE = "sentry.measurement_value";
+const SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME = "sentry.custom_span_name";
+const SEMANTIC_ATTRIBUTE_PROFILE_ID = "sentry.profile_id";
+const SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME = "sentry.exclusive_time";
+const SEMANTIC_ATTRIBUTE_CACHE_HIT = "cache.hit";
+const SEMANTIC_ATTRIBUTE_CACHE_KEY = "cache.key";
+const SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE = "cache.item_size";
+const SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD = "http.request.method";
+const SEMANTIC_ATTRIBUTE_URL_FULL = "url.full";
+const SPAN_STATUS_UNSET = 0;
+const SPAN_STATUS_OK = 1;
+const SPAN_STATUS_ERROR = 2;
+function getSpanStatusFromHttpCode(httpStatus) {
+ if (httpStatus < 400 && httpStatus >= 100) {
+ return { code: SPAN_STATUS_OK };
+ }
+ if (httpStatus >= 400 && httpStatus < 500) {
+ switch (httpStatus) {
+ case 401:
+ return { code: SPAN_STATUS_ERROR, message: "unauthenticated" };
+ case 403:
+ return { code: SPAN_STATUS_ERROR, message: "permission_denied" };
+ case 404:
+ return { code: SPAN_STATUS_ERROR, message: "not_found" };
+ case 409:
+ return { code: SPAN_STATUS_ERROR, message: "already_exists" };
+ case 413:
+ return { code: SPAN_STATUS_ERROR, message: "failed_precondition" };
+ case 429:
+ return { code: SPAN_STATUS_ERROR, message: "resource_exhausted" };
+ case 499:
+ return { code: SPAN_STATUS_ERROR, message: "cancelled" };
+ default:
+ return { code: SPAN_STATUS_ERROR, message: "invalid_argument" };
+ }
+ }
+ if (httpStatus >= 500 && httpStatus < 600) {
+ switch (httpStatus) {
+ case 501:
+ return { code: SPAN_STATUS_ERROR, message: "unimplemented" };
+ case 503:
+ return { code: SPAN_STATUS_ERROR, message: "unavailable" };
+ case 504:
+ return { code: SPAN_STATUS_ERROR, message: "deadline_exceeded" };
+ default:
+ return { code: SPAN_STATUS_ERROR, message: "internal_error" };
+ }
+ }
+ return { code: SPAN_STATUS_ERROR, message: "unknown_error" };
}
-__name(getTargetType, "getTargetType");
-function reactive(target) {
- if (isReadonly(target)) {
- return target;
+__name(getSpanStatusFromHttpCode, "getSpanStatusFromHttpCode");
+function setHttpStatus(span, httpStatus) {
+ span.setAttribute("http.response.status_code", httpStatus);
+ const spanStatus = getSpanStatusFromHttpCode(httpStatus);
+ if (spanStatus.message !== "unknown_error") {
+ span.setStatus(spanStatus);
}
- return createReactiveObject(
- target,
- false,
- mutableHandlers,
- mutableCollectionHandlers,
- reactiveMap
- );
}
-__name(reactive, "reactive");
-function shallowReactive(target) {
- return createReactiveObject(
- target,
- false,
- shallowReactiveHandlers,
- shallowCollectionHandlers,
- shallowReactiveMap
- );
+__name(setHttpStatus, "setHttpStatus");
+const BAGGAGE_HEADER_NAME = "baggage";
+const SENTRY_BAGGAGE_KEY_PREFIX = "sentry-";
+const SENTRY_BAGGAGE_KEY_PREFIX_REGEX = /^sentry-/;
+const MAX_BAGGAGE_STRING_LENGTH = 8192;
+function baggageHeaderToDynamicSamplingContext(baggageHeader) {
+ const baggageObject = parseBaggageHeader(baggageHeader);
+ if (!baggageObject) {
+ return void 0;
+ }
+ const dynamicSamplingContext = Object.entries(baggageObject).reduce((acc, [key, value4]) => {
+ if (key.match(SENTRY_BAGGAGE_KEY_PREFIX_REGEX)) {
+ const nonPrefixedKey = key.slice(SENTRY_BAGGAGE_KEY_PREFIX.length);
+ acc[nonPrefixedKey] = value4;
+ }
+ return acc;
+ }, {});
+ if (Object.keys(dynamicSamplingContext).length > 0) {
+ return dynamicSamplingContext;
+ } else {
+ return void 0;
+ }
}
-__name(shallowReactive, "shallowReactive");
-function readonly(target) {
- return createReactiveObject(
- target,
- true,
- readonlyHandlers,
- readonlyCollectionHandlers,
- readonlyMap
+__name(baggageHeaderToDynamicSamplingContext, "baggageHeaderToDynamicSamplingContext");
+function dynamicSamplingContextToSentryBaggageHeader(dynamicSamplingContext) {
+ if (!dynamicSamplingContext) {
+ return void 0;
+ }
+ const sentryPrefixedDSC = Object.entries(dynamicSamplingContext).reduce(
+ (acc, [dscKey, dscValue]) => {
+ if (dscValue) {
+ acc[`${SENTRY_BAGGAGE_KEY_PREFIX}${dscKey}`] = dscValue;
+ }
+ return acc;
+ },
+ {}
);
+ return objectToBaggageHeader(sentryPrefixedDSC);
}
-__name(readonly, "readonly");
-function shallowReadonly(target) {
- return createReactiveObject(
- target,
- true,
- shallowReadonlyHandlers,
- shallowReadonlyCollectionHandlers,
- shallowReadonlyMap
- );
+__name(dynamicSamplingContextToSentryBaggageHeader, "dynamicSamplingContextToSentryBaggageHeader");
+function parseBaggageHeader(baggageHeader) {
+ if (!baggageHeader || !isString$8(baggageHeader) && !Array.isArray(baggageHeader)) {
+ return void 0;
+ }
+ if (Array.isArray(baggageHeader)) {
+ return baggageHeader.reduce((acc, curr) => {
+ const currBaggageObject = baggageHeaderToObject(curr);
+ Object.entries(currBaggageObject).forEach(([key, value4]) => {
+ acc[key] = value4;
+ });
+ return acc;
+ }, {});
+ }
+ return baggageHeaderToObject(baggageHeader);
}
-__name(shallowReadonly, "shallowReadonly");
-function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {
- if (!isObject$6(target)) {
- if (false) {
- warn$4(
- `value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String(
- target
- )}`
- );
+__name(parseBaggageHeader, "parseBaggageHeader");
+function baggageHeaderToObject(baggageHeader) {
+ return baggageHeader.split(",").map((baggageEntry) => baggageEntry.split("=").map((keyOrValue) => decodeURIComponent(keyOrValue.trim()))).reduce((acc, [key, value4]) => {
+ if (key && value4) {
+ acc[key] = value4;
}
- return target;
+ return acc;
+ }, {});
+}
+__name(baggageHeaderToObject, "baggageHeaderToObject");
+function objectToBaggageHeader(object) {
+ if (Object.keys(object).length === 0) {
+ return void 0;
}
- if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) {
- return target;
+ return Object.entries(object).reduce((baggageHeader, [objectKey, objectValue], currentIndex) => {
+ const baggageEntry = `${encodeURIComponent(objectKey)}=${encodeURIComponent(objectValue)}`;
+ const newBaggageHeader = currentIndex === 0 ? baggageEntry : `${baggageHeader},${baggageEntry}`;
+ if (newBaggageHeader.length > MAX_BAGGAGE_STRING_LENGTH) {
+ DEBUG_BUILD$5 && logger$2.warn(
+ `Not adding key: ${objectKey} with val: ${objectValue} to baggage header due to exceeding baggage size limits.`
+ );
+ return baggageHeader;
+ } else {
+ return newBaggageHeader;
+ }
+ }, "");
+}
+__name(objectToBaggageHeader, "objectToBaggageHeader");
+const TRACEPARENT_REGEXP = new RegExp(
+ "^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$"
+ // whitespace
+);
+function extractTraceparentData(traceparent) {
+ if (!traceparent) {
+ return void 0;
}
- const existingProxy = proxyMap.get(target);
- if (existingProxy) {
- return existingProxy;
+ const matches2 = traceparent.match(TRACEPARENT_REGEXP);
+ if (!matches2) {
+ return void 0;
}
- const targetType = getTargetType(target);
- if (targetType === 0) {
- return target;
+ let parentSampled;
+ if (matches2[3] === "1") {
+ parentSampled = true;
+ } else if (matches2[3] === "0") {
+ parentSampled = false;
}
- const proxy = new Proxy(
- target,
- targetType === 2 ? collectionHandlers : baseHandlers
- );
- proxyMap.set(target, proxy);
- return proxy;
+ return {
+ traceId: matches2[1],
+ parentSampled,
+ parentSpanId: matches2[2]
+ };
}
-__name(createReactiveObject, "createReactiveObject");
-function isReactive(value4) {
- if (isReadonly(value4)) {
- return isReactive(value4["__v_raw"]);
+__name(extractTraceparentData, "extractTraceparentData");
+function propagationContextFromHeaders(sentryTrace, baggage) {
+ const traceparentData = extractTraceparentData(sentryTrace);
+ const dynamicSamplingContext = baggageHeaderToDynamicSamplingContext(baggage);
+ if (!traceparentData || !traceparentData.traceId) {
+ return { traceId: generateTraceId(), spanId: generateSpanId() };
}
- return !!(value4 && value4["__v_isReactive"]);
-}
-__name(isReactive, "isReactive");
-function isReadonly(value4) {
- return !!(value4 && value4["__v_isReadonly"]);
+ const { traceId, parentSpanId, parentSampled } = traceparentData;
+ const virtualSpanId = generateSpanId();
+ return {
+ traceId,
+ parentSpanId,
+ spanId: virtualSpanId,
+ sampled: parentSampled,
+ dsc: dynamicSamplingContext || {}
+ // If we have traceparent data but no DSC it means we are not head of trace and we must freeze it
+ };
}
-__name(isReadonly, "isReadonly");
-function isShallow(value4) {
- return !!(value4 && value4["__v_isShallow"]);
+__name(propagationContextFromHeaders, "propagationContextFromHeaders");
+function generateSentryTraceHeader(traceId = generateTraceId(), spanId = generateSpanId(), sampled) {
+ let sampledString = "";
+ if (sampled !== void 0) {
+ sampledString = sampled ? "-1" : "-0";
+ }
+ return `${traceId}-${spanId}${sampledString}`;
+}
+__name(generateSentryTraceHeader, "generateSentryTraceHeader");
+const TRACE_FLAG_NONE = 0;
+const TRACE_FLAG_SAMPLED = 1;
+let hasShownSpanDropWarning = false;
+function spanToTransactionTraceContext(span) {
+ const { spanId: span_id, traceId: trace_id } = span.spanContext();
+ const { data: data25, op, parent_span_id, status, origin: origin2 } = spanToJSON(span);
+ return dropUndefinedKeys({
+ parent_span_id,
+ span_id,
+ trace_id,
+ data: data25,
+ op,
+ status,
+ origin: origin2
+ });
}
-__name(isShallow, "isShallow");
-function isProxy(value4) {
- return value4 ? !!value4["__v_raw"] : false;
+__name(spanToTransactionTraceContext, "spanToTransactionTraceContext");
+function spanToTraceContext(span) {
+ const { spanId, traceId: trace_id, isRemote } = span.spanContext();
+ const parent_span_id = isRemote ? spanId : spanToJSON(span).parent_span_id;
+ const span_id = isRemote ? generateSpanId() : spanId;
+ return dropUndefinedKeys({
+ parent_span_id,
+ span_id,
+ trace_id
+ });
}
-__name(isProxy, "isProxy");
-function toRaw(observed) {
- const raw = observed && observed["__v_raw"];
- return raw ? toRaw(raw) : observed;
+__name(spanToTraceContext, "spanToTraceContext");
+function spanToTraceHeader(span) {
+ const { traceId, spanId } = span.spanContext();
+ const sampled = spanIsSampled(span);
+ return generateSentryTraceHeader(traceId, spanId, sampled);
}
-__name(toRaw, "toRaw");
-function markRaw(value4) {
- if (Object.isExtensible(value4)) {
- def(value4, "__v_skip", true);
+__name(spanToTraceHeader, "spanToTraceHeader");
+function spanTimeInputToSeconds(input) {
+ if (typeof input === "number") {
+ return ensureTimestampInSeconds(input);
}
- return value4;
-}
-__name(markRaw, "markRaw");
-const toReactive$1 = /* @__PURE__ */ __name((value4) => isObject$6(value4) ? reactive(value4) : value4, "toReactive$1");
-const toReadonly = /* @__PURE__ */ __name((value4) => isObject$6(value4) ? readonly(value4) : value4, "toReadonly");
-const COMPUTED_SIDE_EFFECT_WARN = `Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided. Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free`;
-class ComputedRefImpl {
- static {
- __name(this, "ComputedRefImpl");
+ if (Array.isArray(input)) {
+ return input[0] + input[1] / 1e9;
}
- constructor(getter, _setter, isReadonly2, isSSR) {
- this.getter = getter;
- this._setter = _setter;
- this.dep = void 0;
- this.__v_isRef = true;
- this["__v_isReadonly"] = false;
- this.effect = new ReactiveEffect(
- () => getter(this._value),
- () => triggerRefValue(
- this,
- this.effect._dirtyLevel === 2 ? 2 : 3
- )
- );
- this.effect.computed = this;
- this.effect.active = this._cacheable = !isSSR;
- this["__v_isReadonly"] = isReadonly2;
+ if (input instanceof Date) {
+ return ensureTimestampInSeconds(input.getTime());
}
- get value() {
- const self2 = toRaw(this);
- if ((!self2._cacheable || self2.effect.dirty) && hasChanged(self2._value, self2._value = self2.effect.run())) {
- triggerRefValue(self2, 4);
- }
- trackRefValue(self2);
- if (self2.effect._dirtyLevel >= 2) {
- if (false) {
- warn$4(COMPUTED_SIDE_EFFECT_WARN, `
-
-getter: `, this.getter);
- }
- triggerRefValue(self2, 2);
- }
- return self2._value;
+ return timestampInSeconds();
+}
+__name(spanTimeInputToSeconds, "spanTimeInputToSeconds");
+function ensureTimestampInSeconds(timestamp2) {
+ const isMs = timestamp2 > 9999999999;
+ return isMs ? timestamp2 / 1e3 : timestamp2;
+}
+__name(ensureTimestampInSeconds, "ensureTimestampInSeconds");
+function spanToJSON(span) {
+ if (spanIsSentrySpan(span)) {
+ return span.getSpanJSON();
}
- set value(newValue2) {
- this._setter(newValue2);
+ try {
+ const { spanId: span_id, traceId: trace_id } = span.spanContext();
+ if (spanIsOpenTelemetrySdkTraceBaseSpan(span)) {
+ const { attributes, startTime, name: name2, endTime, parentSpanId, status } = span;
+ return dropUndefinedKeys({
+ span_id,
+ trace_id,
+ data: attributes,
+ description: name2,
+ parent_span_id: parentSpanId,
+ start_timestamp: spanTimeInputToSeconds(startTime),
+ // This is [0,0] by default in OTEL, in which case we want to interpret this as no end time
+ timestamp: spanTimeInputToSeconds(endTime) || void 0,
+ status: getStatusMessage(status),
+ op: attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP],
+ origin: attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN],
+ _metrics_summary: getMetricSummaryJsonForSpan(span)
+ });
+ }
+ return {
+ span_id,
+ trace_id
+ };
+ } catch (e2) {
+ return {};
}
- // #region polyfill _dirty for backward compatibility third party code for Vue <= 3.3.x
- get _dirty() {
- return this.effect.dirty;
+}
+__name(spanToJSON, "spanToJSON");
+function spanIsOpenTelemetrySdkTraceBaseSpan(span) {
+ const castSpan = span;
+ return !!castSpan.attributes && !!castSpan.startTime && !!castSpan.name && !!castSpan.endTime && !!castSpan.status;
+}
+__name(spanIsOpenTelemetrySdkTraceBaseSpan, "spanIsOpenTelemetrySdkTraceBaseSpan");
+function spanIsSentrySpan(span) {
+ return typeof span.getSpanJSON === "function";
+}
+__name(spanIsSentrySpan, "spanIsSentrySpan");
+function spanIsSampled(span) {
+ const { traceFlags } = span.spanContext();
+ return traceFlags === TRACE_FLAG_SAMPLED;
+}
+__name(spanIsSampled, "spanIsSampled");
+function getStatusMessage(status) {
+ if (!status || status.code === SPAN_STATUS_UNSET) {
+ return void 0;
}
- set _dirty(v2) {
- this.effect.dirty = v2;
+ if (status.code === SPAN_STATUS_OK) {
+ return "ok";
}
- // #endregion
+ return status.message || "unknown_error";
}
-function computed$1(getterOrOptions, debugOptions, isSSR = false) {
- let getter;
- let setter;
- const onlyGetter = isFunction$4(getterOrOptions);
- if (onlyGetter) {
- getter = getterOrOptions;
- setter = false ? () => {
- warn$4("Write operation failed: computed value is readonly");
- } : NOOP;
+__name(getStatusMessage, "getStatusMessage");
+const CHILD_SPANS_FIELD = "_sentryChildSpans";
+const ROOT_SPAN_FIELD = "_sentryRootSpan";
+function addChildSpanToSpan(span, childSpan) {
+ const rootSpan = span[ROOT_SPAN_FIELD] || span;
+ addNonEnumerableProperty(childSpan, ROOT_SPAN_FIELD, rootSpan);
+ if (span[CHILD_SPANS_FIELD]) {
+ span[CHILD_SPANS_FIELD].add(childSpan);
} else {
- getter = getterOrOptions.get;
- setter = getterOrOptions.set;
- }
- const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
- if (false) {
- cRef.effect.onTrack = debugOptions.onTrack;
- cRef.effect.onTrigger = debugOptions.onTrigger;
+ addNonEnumerableProperty(span, CHILD_SPANS_FIELD, /* @__PURE__ */ new Set([childSpan]));
}
- return cRef;
}
-__name(computed$1, "computed$1");
-function trackRefValue(ref2) {
- var _a2;
- if (shouldTrack && activeEffect) {
- ref2 = toRaw(ref2);
- trackEffect(
- activeEffect,
- (_a2 = ref2.dep) != null ? _a2 : ref2.dep = createDep(
- () => ref2.dep = void 0,
- ref2 instanceof ComputedRefImpl ? ref2 : void 0
- ),
- false ? {
- target: ref2,
- type: "get",
- key: "value"
- } : void 0
- );
+__name(addChildSpanToSpan, "addChildSpanToSpan");
+function removeChildSpanFromSpan(span, childSpan) {
+ if (span[CHILD_SPANS_FIELD]) {
+ span[CHILD_SPANS_FIELD].delete(childSpan);
}
}
-__name(trackRefValue, "trackRefValue");
-function triggerRefValue(ref2, dirtyLevel = 4, newVal, oldVal) {
- ref2 = toRaw(ref2);
- const dep = ref2.dep;
- if (dep) {
- triggerEffects(
- dep,
- dirtyLevel,
- false ? {
- target: ref2,
- type: "set",
- key: "value",
- newValue: newVal,
- oldValue: oldVal
- } : void 0
- );
+__name(removeChildSpanFromSpan, "removeChildSpanFromSpan");
+function getSpanDescendants(span) {
+ const resultSet = /* @__PURE__ */ new Set();
+ function addSpanChildren(span2) {
+ if (resultSet.has(span2)) {
+ return;
+ } else if (spanIsSampled(span2)) {
+ resultSet.add(span2);
+ const childSpans = span2[CHILD_SPANS_FIELD] ? Array.from(span2[CHILD_SPANS_FIELD]) : [];
+ for (const childSpan of childSpans) {
+ addSpanChildren(childSpan);
+ }
+ }
}
+ __name(addSpanChildren, "addSpanChildren");
+ addSpanChildren(span);
+ return Array.from(resultSet);
}
-__name(triggerRefValue, "triggerRefValue");
-function isRef(r) {
- return !!(r && r.__v_isRef === true);
-}
-__name(isRef, "isRef");
-function ref(value4) {
- return createRef(value4, false);
-}
-__name(ref, "ref");
-function shallowRef(value4) {
- return createRef(value4, true);
+__name(getSpanDescendants, "getSpanDescendants");
+function getRootSpan(span) {
+ return span[ROOT_SPAN_FIELD] || span;
}
-__name(shallowRef, "shallowRef");
-function createRef(rawValue, shallow) {
- if (isRef(rawValue)) {
- return rawValue;
+__name(getRootSpan, "getRootSpan");
+function getActiveSpan() {
+ const carrier = getMainCarrier();
+ const acs = getAsyncContextStrategy(carrier);
+ if (acs.getActiveSpan) {
+ return acs.getActiveSpan();
}
- return new RefImpl(rawValue, shallow);
+ return _getSpanForScope(getCurrentScope$1());
}
-__name(createRef, "createRef");
-class RefImpl {
- static {
- __name(this, "RefImpl");
+__name(getActiveSpan, "getActiveSpan");
+function updateMetricSummaryOnActiveSpan(metricType, sanitizedName, value4, unit, tags, bucketKey) {
+ const span = getActiveSpan();
+ if (span) {
+ updateMetricSummaryOnSpan(span, metricType, sanitizedName, value4, unit, tags, bucketKey);
}
- constructor(value4, __v_isShallow) {
- this.__v_isShallow = __v_isShallow;
- this.dep = void 0;
- this.__v_isRef = true;
- this._rawValue = __v_isShallow ? value4 : toRaw(value4);
- this._value = __v_isShallow ? value4 : toReactive$1(value4);
+}
+__name(updateMetricSummaryOnActiveSpan, "updateMetricSummaryOnActiveSpan");
+function showSpanDropWarning() {
+ if (!hasShownSpanDropWarning) {
+ consoleSandbox(() => {
+ console.warn(
+ "[Sentry] Deprecation warning: Returning null from `beforeSendSpan` will be disallowed from SDK version 9.0.0 onwards. The callback will only support mutating spans. To drop certain spans, configure the respective integrations directly."
+ );
+ });
+ hasShownSpanDropWarning = true;
}
- get value() {
- trackRefValue(this);
- return this._value;
+}
+__name(showSpanDropWarning, "showSpanDropWarning");
+function updateSpanName(span, name2) {
+ span.updateName(name2);
+ span.setAttributes({
+ [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "custom",
+ [SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME]: name2
+ });
+}
+__name(updateSpanName, "updateSpanName");
+let errorsInstrumented = false;
+function registerSpanErrorInstrumentation() {
+ if (errorsInstrumented) {
+ return;
}
- set value(newVal) {
- const useDirectValue = this.__v_isShallow || isShallow(newVal) || isReadonly(newVal);
- newVal = useDirectValue ? newVal : toRaw(newVal);
- if (hasChanged(newVal, this._rawValue)) {
- const oldVal = this._rawValue;
- this._rawValue = newVal;
- this._value = useDirectValue ? newVal : toReactive$1(newVal);
- triggerRefValue(this, 4, newVal, oldVal);
- }
+ errorsInstrumented = true;
+ addGlobalErrorInstrumentationHandler(errorCallback);
+ addGlobalUnhandledRejectionInstrumentationHandler(errorCallback);
+}
+__name(registerSpanErrorInstrumentation, "registerSpanErrorInstrumentation");
+function errorCallback() {
+ const activeSpan = getActiveSpan();
+ const rootSpan = activeSpan && getRootSpan(activeSpan);
+ if (rootSpan) {
+ const message3 = "internal_error";
+ DEBUG_BUILD$6 && logger$2.log(`[Tracing] Root span: ${message3} -> Global error occurred`);
+ rootSpan.setStatus({ code: SPAN_STATUS_ERROR, message: message3 });
}
}
-function triggerRef(ref2) {
- triggerRefValue(ref2, 4, false ? ref2.value : void 0);
+__name(errorCallback, "errorCallback");
+errorCallback.tag = "sentry_tracingErrorCallback";
+const SCOPE_ON_START_SPAN_FIELD = "_sentryScope";
+const ISOLATION_SCOPE_ON_START_SPAN_FIELD = "_sentryIsolationScope";
+function setCapturedScopesOnSpan(span, scope, isolationScope) {
+ if (span) {
+ addNonEnumerableProperty(span, ISOLATION_SCOPE_ON_START_SPAN_FIELD, isolationScope);
+ addNonEnumerableProperty(span, SCOPE_ON_START_SPAN_FIELD, scope);
+ }
}
-__name(triggerRef, "triggerRef");
-function unref(ref2) {
- return isRef(ref2) ? ref2.value : ref2;
+__name(setCapturedScopesOnSpan, "setCapturedScopesOnSpan");
+function getCapturedScopesOnSpan(span) {
+ return {
+ scope: span[SCOPE_ON_START_SPAN_FIELD],
+ isolationScope: span[ISOLATION_SCOPE_ON_START_SPAN_FIELD]
+ };
}
-__name(unref, "unref");
-function toValue$1(source) {
- return isFunction$4(source) ? source() : unref(source);
+__name(getCapturedScopesOnSpan, "getCapturedScopesOnSpan");
+function addTracingExtensions() {
+ registerSpanErrorInstrumentation();
}
-__name(toValue$1, "toValue$1");
-const shallowUnwrapHandlers = {
- get: /* @__PURE__ */ __name((target, key, receiver) => unref(Reflect.get(target, key, receiver)), "get"),
- set: /* @__PURE__ */ __name((target, key, value4, receiver) => {
- const oldValue2 = target[key];
- if (isRef(oldValue2) && !isRef(value4)) {
- oldValue2.value = value4;
- return true;
- } else {
- return Reflect.set(target, key, value4, receiver);
- }
- }, "set")
-};
-function proxyRefs(objectWithRefs) {
- return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
+__name(addTracingExtensions, "addTracingExtensions");
+function hasTracingEnabled(maybeOptions) {
+ if (typeof __SENTRY_TRACING__ === "boolean" && !__SENTRY_TRACING__) {
+ return false;
+ }
+ const client = getClient();
+ const options4 = maybeOptions || client && client.getOptions();
+ return !!options4 && (options4.enableTracing || "tracesSampleRate" in options4 || "tracesSampler" in options4);
}
-__name(proxyRefs, "proxyRefs");
-class CustomRefImpl {
+__name(hasTracingEnabled, "hasTracingEnabled");
+class SentryNonRecordingSpan {
static {
- __name(this, "CustomRefImpl");
+ __name(this, "SentryNonRecordingSpan");
}
- constructor(factory) {
- this.dep = void 0;
- this.__v_isRef = true;
- const { get: get22, set: set22 } = factory(
- () => trackRefValue(this),
- () => triggerRefValue(this)
- );
- this._get = get22;
- this._set = set22;
+ constructor(spanContext = {}) {
+ this._traceId = spanContext.traceId || generateTraceId();
+ this._spanId = spanContext.spanId || generateSpanId();
}
- get value() {
- return this._get();
+ /** @inheritdoc */
+ spanContext() {
+ return {
+ spanId: this._spanId,
+ traceId: this._traceId,
+ traceFlags: TRACE_FLAG_NONE
+ };
}
- set value(newVal) {
- this._set(newVal);
+ /** @inheritdoc */
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
+ end(_timestamp) {
}
-}
-function customRef(factory) {
- return new CustomRefImpl(factory);
-}
-__name(customRef, "customRef");
-function toRefs$1(object) {
- if (false) {
- warn$4(`toRefs() expects a reactive object but received a plain one.`);
+ /** @inheritdoc */
+ setAttribute(_key, _value) {
+ return this;
}
- const ret = isArray$4(object) ? new Array(object.length) : {};
- for (const key in object) {
- ret[key] = propertyToRef(object, key);
+ /** @inheritdoc */
+ setAttributes(_values) {
+ return this;
}
- return ret;
-}
-__name(toRefs$1, "toRefs$1");
-class ObjectRefImpl {
- static {
- __name(this, "ObjectRefImpl");
+ /** @inheritdoc */
+ setStatus(_status) {
+ return this;
}
- constructor(_object, _key, _defaultValue) {
- this._object = _object;
- this._key = _key;
- this._defaultValue = _defaultValue;
- this.__v_isRef = true;
+ /** @inheritdoc */
+ updateName(_name) {
+ return this;
}
- get value() {
- const val = this._object[this._key];
- return val === void 0 ? this._defaultValue : val;
+ /** @inheritdoc */
+ isRecording() {
+ return false;
}
- set value(newVal) {
- this._object[this._key] = newVal;
+ /** @inheritdoc */
+ addEvent(_name, _attributesOrStartTime, _startTime) {
+ return this;
}
- get dep() {
- return getDepFromReactive(toRaw(this._object), this._key);
+ /**
+ * This should generally not be used,
+ * but we need it for being compliant with the OTEL Span interface.
+ *
+ * @hidden
+ * @internal
+ */
+ addLink(_link) {
+ return this;
+ }
+ /**
+ * This should generally not be used,
+ * but we need it for being compliant with the OTEL Span interface.
+ *
+ * @hidden
+ * @internal
+ */
+ addLinks(_links) {
+ return this;
+ }
+ /**
+ * This should generally not be used,
+ * but we need it for being compliant with the OTEL Span interface.
+ *
+ * @hidden
+ * @internal
+ */
+ recordException(_exception, _time) {
}
}
-class GetterRefImpl {
- static {
- __name(this, "GetterRefImpl");
+function handleCallbackErrors(fn, onError, onFinally = () => {
+}) {
+ let maybePromiseResult;
+ try {
+ maybePromiseResult = fn();
+ } catch (e2) {
+ onError(e2);
+ onFinally();
+ throw e2;
+ }
+ return maybeHandlePromiseRejection(maybePromiseResult, onError, onFinally);
+}
+__name(handleCallbackErrors, "handleCallbackErrors");
+function maybeHandlePromiseRejection(value4, onError, onFinally) {
+ if (isThenable$1(value4)) {
+ return value4.then(
+ (res) => {
+ onFinally();
+ return res;
+ },
+ (e2) => {
+ onError(e2);
+ onFinally();
+ throw e2;
+ }
+ );
}
- constructor(_getter) {
- this._getter = _getter;
- this.__v_isRef = true;
- this.__v_isReadonly = true;
+ onFinally();
+ return value4;
+}
+__name(maybeHandlePromiseRejection, "maybeHandlePromiseRejection");
+const DEFAULT_ENVIRONMENT = "production";
+const FROZEN_DSC_FIELD = "_frozenDsc";
+function freezeDscOnSpan(span, dsc) {
+ const spanWithMaybeDsc = span;
+ addNonEnumerableProperty(spanWithMaybeDsc, FROZEN_DSC_FIELD, dsc);
+}
+__name(freezeDscOnSpan, "freezeDscOnSpan");
+function getDynamicSamplingContextFromClient(trace_id, client) {
+ const options4 = client.getOptions();
+ const { publicKey: public_key } = client.getDsn() || {};
+ const dsc = dropUndefinedKeys({
+ environment: options4.environment || DEFAULT_ENVIRONMENT,
+ release: options4.release,
+ public_key,
+ trace_id
+ });
+ client.emit("createDsc", dsc);
+ return dsc;
+}
+__name(getDynamicSamplingContextFromClient, "getDynamicSamplingContextFromClient");
+function getDynamicSamplingContextFromScope(client, scope) {
+ const propagationContext = scope.getPropagationContext();
+ return propagationContext.dsc || getDynamicSamplingContextFromClient(propagationContext.traceId, client);
+}
+__name(getDynamicSamplingContextFromScope, "getDynamicSamplingContextFromScope");
+function getDynamicSamplingContextFromSpan(span) {
+ const client = getClient();
+ if (!client) {
+ return {};
}
- get value() {
- return this._getter();
+ const rootSpan = getRootSpan(span);
+ const frozenDsc = rootSpan[FROZEN_DSC_FIELD];
+ if (frozenDsc) {
+ return frozenDsc;
+ }
+ const traceState = rootSpan.spanContext().traceState;
+ const traceStateDsc = traceState && traceState.get("sentry.dsc");
+ const dscOnTraceState = traceStateDsc && baggageHeaderToDynamicSamplingContext(traceStateDsc);
+ if (dscOnTraceState) {
+ return dscOnTraceState;
+ }
+ const dsc = getDynamicSamplingContextFromClient(span.spanContext().traceId, client);
+ const jsonSpan = spanToJSON(rootSpan);
+ const attributes = jsonSpan.data || {};
+ const maybeSampleRate = attributes[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE];
+ if (maybeSampleRate != null) {
+ dsc.sample_rate = `${maybeSampleRate}`;
+ }
+ const source = attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];
+ const name2 = jsonSpan.description;
+ if (source !== "url" && name2) {
+ dsc.transaction = name2;
+ }
+ if (hasTracingEnabled()) {
+ dsc.sampled = String(spanIsSampled(rootSpan));
+ }
+ client.emit("createDsc", dsc, rootSpan);
+ return dsc;
+}
+__name(getDynamicSamplingContextFromSpan, "getDynamicSamplingContextFromSpan");
+function spanToBaggageHeader(span) {
+ const dsc = getDynamicSamplingContextFromSpan(span);
+ return dynamicSamplingContextToSentryBaggageHeader(dsc);
+}
+__name(spanToBaggageHeader, "spanToBaggageHeader");
+function logSpanStart(span) {
+ if (!DEBUG_BUILD$6) return;
+ const { description = "< unknown name >", op = "< unknown op >", parent_span_id: parentSpanId } = spanToJSON(span);
+ const { spanId } = span.spanContext();
+ const sampled = spanIsSampled(span);
+ const rootSpan = getRootSpan(span);
+ const isRootSpan = rootSpan === span;
+ const header3 = `[Tracing] Starting ${sampled ? "sampled" : "unsampled"} ${isRootSpan ? "root " : ""}span`;
+ const infoParts = [`op: ${op}`, `name: ${description}`, `ID: ${spanId}`];
+ if (parentSpanId) {
+ infoParts.push(`parent ID: ${parentSpanId}`);
+ }
+ if (!isRootSpan) {
+ const { op: op2, description: description2 } = spanToJSON(rootSpan);
+ infoParts.push(`root ID: ${rootSpan.spanContext().spanId}`);
+ if (op2) {
+ infoParts.push(`root op: ${op2}`);
+ }
+ if (description2) {
+ infoParts.push(`root description: ${description2}`);
+ }
+ }
+ logger$2.log(`${header3}
+ ${infoParts.join("\n ")}`);
+}
+__name(logSpanStart, "logSpanStart");
+function logSpanEnd(span) {
+ if (!DEBUG_BUILD$6) return;
+ const { description = "< unknown name >", op = "< unknown op >" } = spanToJSON(span);
+ const { spanId } = span.spanContext();
+ const rootSpan = getRootSpan(span);
+ const isRootSpan = rootSpan === span;
+ const msg = `[Tracing] Finishing "${op}" ${isRootSpan ? "root " : ""}span "${description}" with ID ${spanId}`;
+ logger$2.log(msg);
+}
+__name(logSpanEnd, "logSpanEnd");
+function parseSampleRate(sampleRate) {
+ if (typeof sampleRate === "boolean") {
+ return Number(sampleRate);
+ }
+ const rate = typeof sampleRate === "string" ? parseFloat(sampleRate) : sampleRate;
+ if (typeof rate !== "number" || isNaN(rate) || rate < 0 || rate > 1) {
+ DEBUG_BUILD$6 && logger$2.warn(
+ `[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(
+ sampleRate
+ )} of type ${JSON.stringify(typeof sampleRate)}.`
+ );
+ return void 0;
}
+ return rate;
}
-function toRef$1(source, key, defaultValue) {
- if (isRef(source)) {
- return source;
- } else if (isFunction$4(source)) {
- return new GetterRefImpl(source);
- } else if (isObject$6(source) && arguments.length > 1) {
- return propertyToRef(source, key, defaultValue);
+__name(parseSampleRate, "parseSampleRate");
+function sampleSpan(options4, samplingContext) {
+ if (!hasTracingEnabled(options4)) {
+ return [false];
+ }
+ const normalizedRequest = getIsolationScope().getScopeData().sdkProcessingMetadata.normalizedRequest;
+ const enhancedSamplingContext = {
+ ...samplingContext,
+ normalizedRequest: samplingContext.normalizedRequest || normalizedRequest
+ };
+ let sampleRate;
+ if (typeof options4.tracesSampler === "function") {
+ sampleRate = options4.tracesSampler(enhancedSamplingContext);
+ } else if (enhancedSamplingContext.parentSampled !== void 0) {
+ sampleRate = enhancedSamplingContext.parentSampled;
+ } else if (typeof options4.tracesSampleRate !== "undefined") {
+ sampleRate = options4.tracesSampleRate;
} else {
- return ref(source);
+ sampleRate = 1;
+ }
+ const parsedSampleRate = parseSampleRate(sampleRate);
+ if (parsedSampleRate === void 0) {
+ DEBUG_BUILD$6 && logger$2.warn("[Tracing] Discarding transaction because of invalid sample rate.");
+ return [false];
+ }
+ if (!parsedSampleRate) {
+ DEBUG_BUILD$6 && logger$2.log(
+ `[Tracing] Discarding transaction because ${typeof options4.tracesSampler === "function" ? "tracesSampler returned 0 or false" : "a negative sampling decision was inherited or tracesSampleRate is set to 0"}`
+ );
+ return [false, parsedSampleRate];
+ }
+ const shouldSample = Math.random() < parsedSampleRate;
+ if (!shouldSample) {
+ DEBUG_BUILD$6 && logger$2.log(
+ `[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(
+ sampleRate
+ )})`
+ );
+ return [false, parsedSampleRate];
}
+ return [true, parsedSampleRate];
}
-__name(toRef$1, "toRef$1");
-function propertyToRef(source, key, defaultValue) {
- const val = source[key];
- return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
+__name(sampleSpan, "sampleSpan");
+const DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;
+function isValidProtocol(protocol) {
+ return protocol === "http" || protocol === "https";
}
-__name(propertyToRef, "propertyToRef");
-const deferredComputed = computed$1;
-const TrackOpTypes = {
- "GET": "get",
- "HAS": "has",
- "ITERATE": "iterate"
-};
-const TriggerOpTypes = {
- "SET": "set",
- "ADD": "add",
- "DELETE": "delete",
- "CLEAR": "clear"
-};
-const ReactiveFlags = {
- "SKIP": "__v_skip",
- "IS_REACTIVE": "__v_isReactive",
- "IS_READONLY": "__v_isReadonly",
- "IS_SHALLOW": "__v_isShallow",
- "RAW": "__v_raw"
-};
-/**
-* @vue/runtime-core v3.4.31
-* (c) 2018-present Yuxi (Evan) You and Vue contributors
-* @license MIT
-**/
-const stack = [];
-function pushWarningContext(vnode) {
- stack.push(vnode);
-}
-__name(pushWarningContext, "pushWarningContext");
-function popWarningContext() {
- stack.pop();
+__name(isValidProtocol, "isValidProtocol");
+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}`;
}
-__name(popWarningContext, "popWarningContext");
-function warn$1$1(msg, ...args) {
- pauseTracking();
- const instance = stack.length ? stack[stack.length - 1].component : null;
- const appWarnHandler = instance && instance.appContext.config.warnHandler;
- const trace = getComponentTrace();
- if (appWarnHandler) {
- callWithErrorHandling(
- appWarnHandler,
- instance,
- 11,
- [
- // eslint-disable-next-line no-restricted-syntax
- msg + args.map((a) => {
- var _a2, _b;
- return (_b = (_a2 = a.toString) == null ? void 0 : _a2.call(a)) != null ? _b : JSON.stringify(a);
- }).join(""),
- instance && instance.proxy,
- trace.map(
- ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
- ).join("\n"),
- trace
- ]
- );
- } else {
- const warnArgs = [`[Vue warn]: ${msg}`, ...args];
- if (trace.length && // avoid spamming console during tests
- true) {
- warnArgs.push(`
-`, ...formatTrace(trace));
- }
- console.warn(...warnArgs);
+__name(dsnToString, "dsnToString");
+function dsnFromString(str) {
+ const match2 = DSN_REGEX.exec(str);
+ if (!match2) {
+ consoleSandbox(() => {
+ console.error(`Invalid Sentry Dsn: ${str}`);
+ });
+ return void 0;
}
- resetTracking();
-}
-__name(warn$1$1, "warn$1$1");
-function getComponentTrace() {
- let currentVNode = stack[stack.length - 1];
- if (!currentVNode) {
- return [];
+ const [protocol, publicKey, pass = "", host = "", port = "", lastPath = ""] = match2.slice(1);
+ let path = "";
+ let projectId = lastPath;
+ const split2 = projectId.split("/");
+ if (split2.length > 1) {
+ path = split2.slice(0, -1).join("/");
+ projectId = split2.pop();
}
- const normalizedStack = [];
- while (currentVNode) {
- const last = normalizedStack[0];
- if (last && last.vnode === currentVNode) {
- last.recurseCount++;
- } else {
- normalizedStack.push({
- vnode: currentVNode,
- recurseCount: 0
- });
+ if (projectId) {
+ const projectMatch = projectId.match(/^\d+/);
+ if (projectMatch) {
+ projectId = projectMatch[0];
}
- const parentInstance = currentVNode.component && currentVNode.component.parent;
- currentVNode = parentInstance && parentInstance.vnode;
}
- return normalizedStack;
-}
-__name(getComponentTrace, "getComponentTrace");
-function formatTrace(trace) {
- const logs = [];
- trace.forEach((entry, i2) => {
- logs.push(...i2 === 0 ? [] : [`
-`], ...formatTraceEntry(entry));
- });
- return logs;
+ return dsnFromComponents({ host, pass, path, projectId, port, protocol, publicKey });
}
-__name(formatTrace, "formatTrace");
-function formatTraceEntry({ vnode, recurseCount }) {
- const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
- const isRoot = vnode.component ? vnode.component.parent == null : false;
- const open2 = ` at <${formatComponentName(
- vnode.component,
- vnode.type,
- isRoot
- )}`;
- const close5 = `>` + postfix;
- return vnode.props ? [open2, ...formatProps(vnode.props), close5] : [open2 + close5];
+__name(dsnFromString, "dsnFromString");
+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
+ };
}
-__name(formatTraceEntry, "formatTraceEntry");
-function formatProps(props) {
- const res = [];
- const keys2 = Object.keys(props);
- keys2.slice(0, 3).forEach((key) => {
- res.push(...formatProp(key, props[key]));
+__name(dsnFromComponents, "dsnFromComponents");
+function validateDsn(dsn) {
+ if (!DEBUG_BUILD$5) {
+ return true;
+ }
+ const { port, projectId, protocol } = dsn;
+ const requiredComponents = ["protocol", "publicKey", "host", "projectId"];
+ const hasMissingRequiredComponent = requiredComponents.find((component) => {
+ if (!dsn[component]) {
+ logger$2.error(`Invalid Sentry Dsn: ${component} missing`);
+ return true;
+ }
+ return false;
});
- if (keys2.length > 3) {
- res.push(` ...`);
+ if (hasMissingRequiredComponent) {
+ return false;
}
- return res;
+ if (!projectId.match(/^\d+$/)) {
+ logger$2.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`);
+ return false;
+ }
+ if (!isValidProtocol(protocol)) {
+ logger$2.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`);
+ return false;
+ }
+ if (port && isNaN(parseInt(port, 10))) {
+ logger$2.error(`Invalid Sentry Dsn: Invalid port ${port}`);
+ return false;
+ }
+ return true;
}
-__name(formatProps, "formatProps");
-function formatProp(key, value4, raw) {
- if (isString$7(value4)) {
- value4 = JSON.stringify(value4);
- return raw ? value4 : [`${key}=${value4}`];
- } else if (typeof value4 === "number" || typeof value4 === "boolean" || value4 == null) {
- return raw ? value4 : [`${key}=${value4}`];
- } else if (isRef(value4)) {
- value4 = formatProp(key, toRaw(value4.value), true);
- return raw ? value4 : [`${key}=Ref<`, value4, `>`];
- } else if (isFunction$4(value4)) {
- return [`${key}=fn${value4.name ? `<${value4.name}>` : ``}`];
- } else {
- value4 = toRaw(value4);
- return raw ? value4 : [`${key}=`, value4];
+__name(validateDsn, "validateDsn");
+function makeDsn(from2) {
+ const components = typeof from2 === "string" ? dsnFromString(from2) : dsnFromComponents(from2);
+ if (!components || !validateDsn(components)) {
+ return void 0;
}
+ return components;
}
-__name(formatProp, "formatProp");
-function assertNumber(val, type) {
- if (true) return;
- if (val === void 0) {
- return;
- } else if (typeof val !== "number") {
- warn$1$1(`${type} is not a valid number - got ${JSON.stringify(val)}.`);
- } else if (isNaN(val)) {
- warn$1$1(`${type} is NaN - the duration expression might be incorrect.`);
+__name(makeDsn, "makeDsn");
+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 i2 = 0; i2 < inner.length; i2++) {
+ const value4 = inner[i2];
+ if (value4 === obj) {
+ return true;
+ }
+ }
+ inner.push(obj);
+ return false;
+ }
+ __name(memoize, "memoize");
+ function unmemoize(obj) {
+ if (hasWeakSet) {
+ inner.delete(obj);
+ } else {
+ for (let i2 = 0; i2 < inner.length; i2++) {
+ if (inner[i2] === obj) {
+ inner.splice(i2, 1);
+ break;
+ }
+ }
+ }
}
+ __name(unmemoize, "unmemoize");
+ return [memoize, unmemoize];
}
-__name(assertNumber, "assertNumber");
-const ErrorCodes = {
- "SETUP_FUNCTION": 0,
- "0": "SETUP_FUNCTION",
- "RENDER_FUNCTION": 1,
- "1": "RENDER_FUNCTION",
- "WATCH_GETTER": 2,
- "2": "WATCH_GETTER",
- "WATCH_CALLBACK": 3,
- "3": "WATCH_CALLBACK",
- "WATCH_CLEANUP": 4,
- "4": "WATCH_CLEANUP",
- "NATIVE_EVENT_HANDLER": 5,
- "5": "NATIVE_EVENT_HANDLER",
- "COMPONENT_EVENT_HANDLER": 6,
- "6": "COMPONENT_EVENT_HANDLER",
- "VNODE_HOOK": 7,
- "7": "VNODE_HOOK",
- "DIRECTIVE_HOOK": 8,
- "8": "DIRECTIVE_HOOK",
- "TRANSITION_HOOK": 9,
- "9": "TRANSITION_HOOK",
- "APP_ERROR_HANDLER": 10,
- "10": "APP_ERROR_HANDLER",
- "APP_WARN_HANDLER": 11,
- "11": "APP_WARN_HANDLER",
- "FUNCTION_REF": 12,
- "12": "FUNCTION_REF",
- "ASYNC_COMPONENT_LOADER": 13,
- "13": "ASYNC_COMPONENT_LOADER",
- "SCHEDULER": 14,
- "14": "SCHEDULER"
-};
-const ErrorTypeStrings$1 = {
- ["sp"]: "serverPrefetch hook",
- ["bc"]: "beforeCreate hook",
- ["c"]: "created hook",
- ["bm"]: "beforeMount hook",
- ["m"]: "mounted hook",
- ["bu"]: "beforeUpdate hook",
- ["u"]: "updated",
- ["bum"]: "beforeUnmount hook",
- ["um"]: "unmounted hook",
- ["a"]: "activated hook",
- ["da"]: "deactivated hook",
- ["ec"]: "errorCaptured hook",
- ["rtc"]: "renderTracked hook",
- ["rtg"]: "renderTriggered hook",
- [0]: "setup function",
- [1]: "render function",
- [2]: "watcher getter",
- [3]: "watcher callback",
- [4]: "watcher cleanup function",
- [5]: "native event handler",
- [6]: "component event handler",
- [7]: "vnode hook",
- [8]: "directive hook",
- [9]: "transition hook",
- [10]: "app errorHandler",
- [11]: "app warnHandler",
- [12]: "ref function",
- [13]: "async component loader",
- [14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."
-};
-function callWithErrorHandling(fn, instance, type, args) {
+__name(memoBuilder, "memoBuilder");
+function normalize$2(input, depth = 100, maxProperties = Infinity) {
try {
- return args ? fn(...args) : fn();
+ return visit("", input, depth, maxProperties);
} catch (err) {
- handleError(err, instance, type);
+ return { ERROR: `**non-serializable** (${err})` };
}
}
-__name(callWithErrorHandling, "callWithErrorHandling");
-function callWithAsyncErrorHandling(fn, instance, type, args) {
- if (isFunction$4(fn)) {
- const res = callWithErrorHandling(fn, instance, type, args);
- if (res && isPromise$1(res)) {
- res.catch((err) => {
- handleError(err, instance, type);
- });
- }
- return res;
+__name(normalize$2, "normalize$2");
+function normalizeToSize(object, depth = 3, maxSize = 100 * 1024) {
+ const normalized = normalize$2(object, depth);
+ if (jsonSize(normalized) > maxSize) {
+ return normalizeToSize(object, depth - 1, maxSize);
}
- if (isArray$4(fn)) {
- const values = [];
- for (let i2 = 0; i2 < fn.length; i2++) {
- values.push(callWithAsyncErrorHandling(fn[i2], instance, type, args));
+ return normalized;
+}
+__name(normalizeToSize, "normalizeToSize");
+function visit(key, value4, depth = Infinity, maxProperties = Infinity, memo = memoBuilder()) {
+ const [memoize, unmemoize] = memo;
+ if (value4 == null || // this matches null and undefined -> eqeq not eqeqeq
+ ["boolean", "string"].includes(typeof value4) || typeof value4 === "number" && Number.isFinite(value4)) {
+ return value4;
+ }
+ const stringified = stringifyValue(key, value4);
+ if (!stringified.startsWith("[object ")) {
+ return stringified;
+ }
+ if (value4["__sentry_skip_normalization__"]) {
+ return value4;
+ }
+ const remainingDepth = typeof value4["__sentry_override_normalization_depth__"] === "number" ? value4["__sentry_override_normalization_depth__"] : depth;
+ if (remainingDepth === 0) {
+ return stringified.replace("object ", "");
+ }
+ if (memoize(value4)) {
+ return "[Circular ~]";
+ }
+ const valueWithToJSON = value4;
+ if (valueWithToJSON && typeof valueWithToJSON.toJSON === "function") {
+ try {
+ const jsonValue = valueWithToJSON.toJSON();
+ return visit("", jsonValue, remainingDepth - 1, maxProperties, memo);
+ } catch (err) {
}
- return values;
- } else if (false) {
- warn$1$1(
- `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`
- );
}
-}
-__name(callWithAsyncErrorHandling, "callWithAsyncErrorHandling");
-function handleError(err, instance, type, throwInDev = true) {
- const contextVNode = instance ? instance.vnode : null;
- if (instance) {
- let cur = instance.parent;
- const exposedInstance = instance.proxy;
- const errorInfo = false ? ErrorTypeStrings$1[type] : `https://vuejs.org/error-reference/#runtime-${type}`;
- while (cur) {
- const errorCapturedHooks = cur.ec;
- if (errorCapturedHooks) {
- for (let i2 = 0; i2 < errorCapturedHooks.length; i2++) {
- if (errorCapturedHooks[i2](err, exposedInstance, errorInfo) === false) {
- return;
- }
- }
- }
- cur = cur.parent;
+ const normalized = Array.isArray(value4) ? [] : {};
+ let numAdded = 0;
+ const visitable = convertToPlainObject(value4);
+ for (const visitKey in visitable) {
+ if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) {
+ continue;
}
- const appErrorHandler = instance.appContext.config.errorHandler;
- if (appErrorHandler) {
- pauseTracking();
- callWithErrorHandling(
- appErrorHandler,
- null,
- 10,
- [err, exposedInstance, errorInfo]
- );
- resetTracking();
- return;
+ if (numAdded >= maxProperties) {
+ normalized[visitKey] = "[MaxProperties ~]";
+ break;
}
+ const visitValue = visitable[visitKey];
+ normalized[visitKey] = visit(visitKey, visitValue, remainingDepth - 1, maxProperties, memo);
+ numAdded++;
}
- logError(err, type, contextVNode, throwInDev);
+ unmemoize(value4);
+ return normalized;
}
-__name(handleError, "handleError");
-function logError(err, type, contextVNode, throwInDev = true) {
- if (false) {
- const info = ErrorTypeStrings$1[type];
- if (contextVNode) {
- pushWarningContext(contextVNode);
+__name(visit, "visit");
+function stringifyValue(key, value4) {
+ try {
+ if (key === "domain" && value4 && typeof value4 === "object" && value4._events) {
+ return "[Domain]";
}
- warn$1$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
- if (contextVNode) {
- popWarningContext();
+ if (key === "domainEmitter") {
+ return "[DomainEmitter]";
}
- if (throwInDev) {
- throw err;
- } else {
- console.error(err);
+ if (typeof global !== "undefined" && value4 === global) {
+ return "[Global]";
}
- } else {
- console.error(err);
+ if (typeof window !== "undefined" && value4 === window) {
+ return "[Window]";
+ }
+ if (typeof document !== "undefined" && value4 === document) {
+ return "[Document]";
+ }
+ if (isVueViewModel(value4)) {
+ return "[VueViewModel]";
+ }
+ if (isSyntheticEvent(value4)) {
+ return "[SyntheticEvent]";
+ }
+ if (typeof value4 === "number" && !Number.isFinite(value4)) {
+ return `[${value4}]`;
+ }
+ if (typeof value4 === "function") {
+ return `[Function: ${getFunctionName(value4)}]`;
+ }
+ if (typeof value4 === "symbol") {
+ return `[${String(value4)}]`;
+ }
+ if (typeof value4 === "bigint") {
+ return `[BigInt: ${String(value4)}]`;
+ }
+ const objName = getConstructorName(value4);
+ if (/^HTML(\w*)Element$/.test(objName)) {
+ return `[HTMLElement: ${objName}]`;
+ }
+ return `[object ${objName}]`;
+ } catch (err) {
+ return `**non-serializable** (${err})`;
}
}
-__name(logError, "logError");
-let isFlushing = false;
-let isFlushPending = false;
-const queue = [];
-let flushIndex = 0;
-const pendingPostFlushCbs = [];
-let activePostFlushCbs = null;
-let postFlushIndex = 0;
-const resolvedPromise = /* @__PURE__ */ Promise.resolve();
-let currentFlushPromise = null;
-const RECURSION_LIMIT = 100;
-function nextTick(fn) {
- const p2 = currentFlushPromise || resolvedPromise;
- return fn ? p2.then(this ? fn.bind(this) : fn) : p2;
+__name(stringifyValue, "stringifyValue");
+function getConstructorName(value4) {
+ const prototype2 = Object.getPrototypeOf(value4);
+ return prototype2 ? prototype2.constructor.name : "null prototype";
}
-__name(nextTick, "nextTick");
-function findInsertionIndex$1(id3) {
- let start2 = flushIndex + 1;
- let end = queue.length;
- while (start2 < end) {
- const middle = start2 + end >>> 1;
- const middleJob = queue[middle];
- const middleJobId = getId(middleJob);
- if (middleJobId < id3 || middleJobId === id3 && middleJob.pre) {
- start2 = middle + 1;
- } else {
- end = middle;
+__name(getConstructorName, "getConstructorName");
+function utf8Length(value4) {
+ return ~-encodeURI(value4).split(/%..|./).length;
+}
+__name(utf8Length, "utf8Length");
+function jsonSize(value4) {
+ return utf8Length(JSON.stringify(value4));
+}
+__name(jsonSize, "jsonSize");
+function normalizeUrlToBase(url, basePath2) {
+ const escapedBase = basePath2.replace(/\\/g, "/").replace(/[|\\{}()[\]^$+*?.]/g, "\\$&");
+ let newUrl = url;
+ try {
+ newUrl = decodeURI(url);
+ } catch (_Oo) {
+ }
+ return newUrl.replace(/\\/g, "/").replace(/webpack:\/?/g, "").replace(new RegExp(`(file://)?/*${escapedBase}/*`, "ig"), "app:///");
+}
+__name(normalizeUrlToBase, "normalizeUrlToBase");
+function createEnvelope(headers, items2 = []) {
+ return [headers, items2];
+}
+__name(createEnvelope, "createEnvelope");
+function addItemToEnvelope(envelope, newItem) {
+ const [headers, items2] = envelope;
+ return [headers, [...items2, newItem]];
+}
+__name(addItemToEnvelope, "addItemToEnvelope");
+function forEachEnvelopeItem(envelope, callback) {
+ const envelopeItems = envelope[1];
+ for (const envelopeItem of envelopeItems) {
+ const envelopeItemType = envelopeItem[0].type;
+ const result = callback(envelopeItem, envelopeItemType);
+ if (result) {
+ return true;
}
}
- return start2;
+ return false;
}
-__name(findInsertionIndex$1, "findInsertionIndex$1");
-function queueJob(job) {
- if (!queue.length || !queue.includes(
- job,
- isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex
- )) {
- if (job.id == null) {
- queue.push(job);
+__name(forEachEnvelopeItem, "forEachEnvelopeItem");
+function envelopeContainsItemType(envelope, types) {
+ return forEachEnvelopeItem(envelope, (_2, type) => types.includes(type));
+}
+__name(envelopeContainsItemType, "envelopeContainsItemType");
+function encodeUTF8(input) {
+ return GLOBAL_OBJ.__SENTRY__ && GLOBAL_OBJ.__SENTRY__.encodePolyfill ? GLOBAL_OBJ.__SENTRY__.encodePolyfill(input) : new TextEncoder().encode(input);
+}
+__name(encodeUTF8, "encodeUTF8");
+function decodeUTF8(input) {
+ return GLOBAL_OBJ.__SENTRY__ && GLOBAL_OBJ.__SENTRY__.decodePolyfill ? GLOBAL_OBJ.__SENTRY__.decodePolyfill(input) : new TextDecoder().decode(input);
+}
+__name(decodeUTF8, "decodeUTF8");
+function serializeEnvelope(envelope) {
+ const [envHeaders, items2] = envelope;
+ let parts2 = JSON.stringify(envHeaders);
+ function append3(next2) {
+ if (typeof parts2 === "string") {
+ parts2 = typeof next2 === "string" ? parts2 + next2 : [encodeUTF8(parts2), next2];
} else {
- queue.splice(findInsertionIndex$1(job.id), 0, job);
+ parts2.push(typeof next2 === "string" ? encodeUTF8(next2) : next2);
}
- queueFlush();
}
-}
-__name(queueJob, "queueJob");
-function queueFlush() {
- if (!isFlushing && !isFlushPending) {
- isFlushPending = true;
- currentFlushPromise = resolvedPromise.then(flushJobs);
+ __name(append3, "append");
+ for (const item3 of items2) {
+ const [itemHeaders, payload] = item3;
+ append3(`
+${JSON.stringify(itemHeaders)}
+`);
+ if (typeof payload === "string" || payload instanceof Uint8Array) {
+ append3(payload);
+ } else {
+ let stringifiedPayload;
+ try {
+ stringifiedPayload = JSON.stringify(payload);
+ } catch (e2) {
+ stringifiedPayload = JSON.stringify(normalize$2(payload));
+ }
+ append3(stringifiedPayload);
+ }
}
+ return typeof parts2 === "string" ? parts2 : concatBuffers(parts2);
}
-__name(queueFlush, "queueFlush");
-function invalidateJob(job) {
- const i2 = queue.indexOf(job);
- if (i2 > flushIndex) {
- queue.splice(i2, 1);
+__name(serializeEnvelope, "serializeEnvelope");
+function concatBuffers(buffers) {
+ const totalLength = buffers.reduce((acc, buf) => acc + buf.length, 0);
+ const merged = new Uint8Array(totalLength);
+ let offset = 0;
+ for (const buffer2 of buffers) {
+ merged.set(buffer2, offset);
+ offset += buffer2.length;
}
+ return merged;
}
-__name(invalidateJob, "invalidateJob");
-function queuePostFlushCb(cb) {
- if (!isArray$4(cb)) {
- if (!activePostFlushCbs || !activePostFlushCbs.includes(
- cb,
- cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex
- )) {
- pendingPostFlushCbs.push(cb);
+__name(concatBuffers, "concatBuffers");
+function parseEnvelope(env) {
+ let buffer2 = typeof env === "string" ? encodeUTF8(env) : env;
+ function readBinary(length) {
+ const bin = buffer2.subarray(0, length);
+ buffer2 = buffer2.subarray(length + 1);
+ return bin;
+ }
+ __name(readBinary, "readBinary");
+ function readJson() {
+ let i2 = buffer2.indexOf(10);
+ if (i2 < 0) {
+ i2 = buffer2.length;
}
- } else {
- pendingPostFlushCbs.push(...cb);
+ return JSON.parse(decodeUTF8(readBinary(i2)));
}
- queueFlush();
+ __name(readJson, "readJson");
+ const envelopeHeader = readJson();
+ const items2 = [];
+ while (buffer2.length) {
+ const itemHeader = readJson();
+ const binaryLength = typeof itemHeader.length === "number" ? itemHeader.length : void 0;
+ items2.push([itemHeader, binaryLength ? readBinary(binaryLength) : readJson()]);
+ }
+ return [envelopeHeader, items2];
}
-__name(queuePostFlushCb, "queuePostFlushCb");
-function flushPreFlushCbs(instance, seen2, i2 = isFlushing ? flushIndex + 1 : 0) {
- if (false) {
- seen2 = seen2 || /* @__PURE__ */ new Map();
+__name(parseEnvelope, "parseEnvelope");
+function createSpanEnvelopeItem(spanJson) {
+ const spanHeaders = {
+ type: "span"
+ };
+ return [spanHeaders, spanJson];
+}
+__name(createSpanEnvelopeItem, "createSpanEnvelopeItem");
+function createAttachmentEnvelopeItem(attachment) {
+ const buffer2 = typeof attachment.data === "string" ? encodeUTF8(attachment.data) : attachment.data;
+ return [
+ dropUndefinedKeys({
+ type: "attachment",
+ length: buffer2.length,
+ filename: attachment.filename,
+ content_type: attachment.contentType,
+ attachment_type: attachment.attachmentType
+ }),
+ buffer2
+ ];
+}
+__name(createAttachmentEnvelopeItem, "createAttachmentEnvelopeItem");
+const ITEM_TYPE_TO_DATA_CATEGORY_MAP = {
+ session: "session",
+ sessions: "session",
+ attachment: "attachment",
+ transaction: "transaction",
+ event: "error",
+ client_report: "internal",
+ user_report: "default",
+ profile: "profile",
+ profile_chunk: "profile",
+ replay_event: "replay",
+ replay_recording: "replay",
+ check_in: "monitor",
+ feedback: "feedback",
+ span: "span",
+ statsd: "metric_bucket",
+ raw_security: "security"
+};
+function envelopeItemTypeToDataCategory(type) {
+ return ITEM_TYPE_TO_DATA_CATEGORY_MAP[type];
+}
+__name(envelopeItemTypeToDataCategory, "envelopeItemTypeToDataCategory");
+function getSdkMetadataForEnvelopeHeader(metadataOrEvent) {
+ if (!metadataOrEvent || !metadataOrEvent.sdk) {
+ return;
}
- for (; i2 < queue.length; i2++) {
- const cb = queue[i2];
- if (cb && cb.pre) {
- if (instance && cb.id !== instance.uid) {
- continue;
- }
- if (false) {
- continue;
- }
- queue.splice(i2, 1);
- i2--;
- cb();
+ const { name: name2, version: version2 } = metadataOrEvent.sdk;
+ return { name: name2, version: version2 };
+}
+__name(getSdkMetadataForEnvelopeHeader, "getSdkMetadataForEnvelopeHeader");
+function createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn) {
+ const dynamicSamplingContext = event.sdkProcessingMetadata && event.sdkProcessingMetadata.dynamicSamplingContext;
+ return {
+ event_id: event.event_id,
+ sent_at: (/* @__PURE__ */ new Date()).toISOString(),
+ ...sdkInfo && { sdk: sdkInfo },
+ ...!!tunnel && dsn && { dsn: dsnToString(dsn) },
+ ...dynamicSamplingContext && {
+ trace: dropUndefinedKeys({ ...dynamicSamplingContext })
}
+ };
+}
+__name(createEventEnvelopeHeaders, "createEventEnvelopeHeaders");
+function enhanceEventWithSdkInfo(event, sdkInfo) {
+ if (!sdkInfo) {
+ return event;
}
+ event.sdk = event.sdk || {};
+ event.sdk.name = event.sdk.name || sdkInfo.name;
+ event.sdk.version = event.sdk.version || sdkInfo.version;
+ event.sdk.integrations = [...event.sdk.integrations || [], ...sdkInfo.integrations || []];
+ event.sdk.packages = [...event.sdk.packages || [], ...sdkInfo.packages || []];
+ return event;
}
-__name(flushPreFlushCbs, "flushPreFlushCbs");
-function flushPostFlushCbs(seen2) {
- if (pendingPostFlushCbs.length) {
- const deduped = [...new Set(pendingPostFlushCbs)].sort(
- (a, b) => getId(a) - getId(b)
- );
- pendingPostFlushCbs.length = 0;
- if (activePostFlushCbs) {
- activePostFlushCbs.push(...deduped);
- return;
- }
- activePostFlushCbs = deduped;
- if (false) {
- seen2 = seen2 || /* @__PURE__ */ new Map();
+__name(enhanceEventWithSdkInfo, "enhanceEventWithSdkInfo");
+function createSessionEnvelope(session, dsn, metadata, tunnel) {
+ const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);
+ const envelopeHeaders = {
+ sent_at: (/* @__PURE__ */ new Date()).toISOString(),
+ ...sdkInfo && { sdk: sdkInfo },
+ ...!!tunnel && dsn && { dsn: dsnToString(dsn) }
+ };
+ const envelopeItem = "aggregates" in session ? [{ type: "sessions" }, session] : [{ type: "session" }, session.toJSON()];
+ return createEnvelope(envelopeHeaders, [envelopeItem]);
+}
+__name(createSessionEnvelope, "createSessionEnvelope");
+function createEventEnvelope(event, dsn, metadata, tunnel) {
+ const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);
+ const eventType = event.type && event.type !== "replay_event" ? event.type : "event";
+ enhanceEventWithSdkInfo(event, metadata && metadata.sdk);
+ const envelopeHeaders = createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn);
+ delete event.sdkProcessingMetadata;
+ const eventItem = [{ type: eventType }, event];
+ return createEnvelope(envelopeHeaders, [eventItem]);
+}
+__name(createEventEnvelope, "createEventEnvelope");
+function createSpanEnvelope(spans, client) {
+ function dscHasRequiredProps(dsc2) {
+ return !!dsc2.trace_id && !!dsc2.public_key;
+ }
+ __name(dscHasRequiredProps, "dscHasRequiredProps");
+ const dsc = getDynamicSamplingContextFromSpan(spans[0]);
+ const dsn = client && client.getDsn();
+ const tunnel = client && client.getOptions().tunnel;
+ const headers = {
+ sent_at: (/* @__PURE__ */ new Date()).toISOString(),
+ ...dscHasRequiredProps(dsc) && { trace: dsc },
+ ...!!tunnel && dsn && { dsn: dsnToString(dsn) }
+ };
+ const beforeSendSpan = client && client.getOptions().beforeSendSpan;
+ const convertToSpanJSON = beforeSendSpan ? (span) => {
+ const spanJson = beforeSendSpan(spanToJSON(span));
+ if (!spanJson) {
+ showSpanDropWarning();
}
- for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
- const cb = activePostFlushCbs[postFlushIndex];
- if (false) {
- continue;
- }
- if (cb.active !== false) cb();
+ return spanJson;
+ } : (span) => spanToJSON(span);
+ const items2 = [];
+ for (const span of spans) {
+ const spanJson = convertToSpanJSON(span);
+ if (spanJson) {
+ items2.push(createSpanEnvelopeItem(spanJson));
}
- activePostFlushCbs = null;
- postFlushIndex = 0;
}
+ return createEnvelope(headers, items2);
}
-__name(flushPostFlushCbs, "flushPostFlushCbs");
-const getId = /* @__PURE__ */ __name((job) => job.id == null ? Infinity : job.id, "getId");
-const comparator = /* @__PURE__ */ __name((a, b) => {
- const diff2 = getId(a) - getId(b);
- if (diff2 === 0) {
- if (a.pre && !b.pre) return -1;
- if (b.pre && !a.pre) return 1;
+__name(createSpanEnvelope, "createSpanEnvelope");
+function setMeasurement(name2, value4, unit, activeSpan = getActiveSpan()) {
+ const rootSpan = activeSpan && getRootSpan(activeSpan);
+ if (rootSpan) {
+ DEBUG_BUILD$6 && logger$2.log(`[Measurement] Setting measurement on root span: ${name2} = ${value4} ${unit}`);
+ rootSpan.addEvent(name2, {
+ [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]: value4,
+ [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]: unit
+ });
}
- return diff2;
-}, "comparator");
-function flushJobs(seen2) {
- isFlushPending = false;
- isFlushing = true;
- if (false) {
- seen2 = seen2 || /* @__PURE__ */ new Map();
+}
+__name(setMeasurement, "setMeasurement");
+function timedEventsToMeasurements(events2) {
+ if (!events2 || events2.length === 0) {
+ return void 0;
}
- queue.sort(comparator);
- const check = false ? (job) => checkRecursiveUpdates(seen2, job) : NOOP;
- try {
- for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
- const job = queue[flushIndex];
- if (job && job.active !== false) {
- if (false) {
- continue;
+ const measurements = {};
+ events2.forEach((event) => {
+ const attributes = event.attributes || {};
+ const unit = attributes[SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT];
+ const value4 = attributes[SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE];
+ if (typeof unit === "string" && typeof value4 === "number") {
+ measurements[event.name] = { value: value4, unit };
+ }
+ });
+ return measurements;
+}
+__name(timedEventsToMeasurements, "timedEventsToMeasurements");
+const MAX_SPAN_COUNT = 1e3;
+class SentrySpan {
+ static {
+ __name(this, "SentrySpan");
+ }
+ /** Epoch timestamp in seconds when the span started. */
+ /** Epoch timestamp in seconds when the span ended. */
+ /** Internal keeper of the status */
+ /** The timed events added to this span. */
+ /** if true, treat span as a standalone span (not part of a transaction) */
+ /**
+ * You should never call the constructor manually, always use `Sentry.startSpan()`
+ * or other span methods.
+ * @internal
+ * @hideconstructor
+ * @hidden
+ */
+ constructor(spanContext = {}) {
+ this._traceId = spanContext.traceId || generateTraceId();
+ this._spanId = spanContext.spanId || generateSpanId();
+ this._startTime = spanContext.startTimestamp || timestampInSeconds();
+ this._attributes = {};
+ this.setAttributes({
+ [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "manual",
+ [SEMANTIC_ATTRIBUTE_SENTRY_OP]: spanContext.op,
+ ...spanContext.attributes
+ });
+ this._name = spanContext.name;
+ if (spanContext.parentSpanId) {
+ this._parentSpanId = spanContext.parentSpanId;
+ }
+ if ("sampled" in spanContext) {
+ this._sampled = spanContext.sampled;
+ }
+ if (spanContext.endTimestamp) {
+ this._endTime = spanContext.endTimestamp;
+ }
+ this._events = [];
+ this._isStandaloneSpan = spanContext.isStandalone;
+ if (this._endTime) {
+ this._onSpanEnded();
+ }
+ }
+ /**
+ * This should generally not be used,
+ * but it is needed for being compliant with the OTEL Span interface.
+ *
+ * @hidden
+ * @internal
+ */
+ addLink(_link) {
+ return this;
+ }
+ /**
+ * This should generally not be used,
+ * but it is needed for being compliant with the OTEL Span interface.
+ *
+ * @hidden
+ * @internal
+ */
+ addLinks(_links) {
+ return this;
+ }
+ /**
+ * This should generally not be used,
+ * but it is needed for being compliant with the OTEL Span interface.
+ *
+ * @hidden
+ * @internal
+ */
+ recordException(_exception, _time) {
+ }
+ /** @inheritdoc */
+ spanContext() {
+ const { _spanId: spanId, _traceId: traceId, _sampled: sampled } = this;
+ return {
+ spanId,
+ traceId,
+ traceFlags: sampled ? TRACE_FLAG_SAMPLED : TRACE_FLAG_NONE
+ };
+ }
+ /** @inheritdoc */
+ setAttribute(key, value4) {
+ if (value4 === void 0) {
+ delete this._attributes[key];
+ } else {
+ this._attributes[key] = value4;
+ }
+ return this;
+ }
+ /** @inheritdoc */
+ setAttributes(attributes) {
+ Object.keys(attributes).forEach((key) => this.setAttribute(key, attributes[key]));
+ return this;
+ }
+ /**
+ * This should generally not be used,
+ * but we need it for browser tracing where we want to adjust the start time afterwards.
+ * USE THIS WITH CAUTION!
+ *
+ * @hidden
+ * @internal
+ */
+ updateStartTime(timeInput) {
+ this._startTime = spanTimeInputToSeconds(timeInput);
+ }
+ /**
+ * @inheritDoc
+ */
+ setStatus(value4) {
+ this._status = value4;
+ return this;
+ }
+ /**
+ * @inheritDoc
+ */
+ updateName(name2) {
+ this._name = name2;
+ this.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, "custom");
+ return this;
+ }
+ /** @inheritdoc */
+ end(endTimestamp) {
+ if (this._endTime) {
+ return;
+ }
+ this._endTime = spanTimeInputToSeconds(endTimestamp);
+ logSpanEnd(this);
+ this._onSpanEnded();
+ }
+ /**
+ * Get JSON representation of this span.
+ *
+ * @hidden
+ * @internal This method is purely for internal purposes and should not be used outside
+ * of SDK code. If you need to get a JSON representation of a span,
+ * use `spanToJSON(span)` instead.
+ */
+ getSpanJSON() {
+ return dropUndefinedKeys({
+ data: this._attributes,
+ description: this._name,
+ op: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP],
+ parent_span_id: this._parentSpanId,
+ span_id: this._spanId,
+ start_timestamp: this._startTime,
+ status: getStatusMessage(this._status),
+ timestamp: this._endTime,
+ trace_id: this._traceId,
+ origin: this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN],
+ _metrics_summary: getMetricSummaryJsonForSpan(this),
+ profile_id: this._attributes[SEMANTIC_ATTRIBUTE_PROFILE_ID],
+ exclusive_time: this._attributes[SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME],
+ measurements: timedEventsToMeasurements(this._events),
+ is_segment: this._isStandaloneSpan && getRootSpan(this) === this || void 0,
+ segment_id: this._isStandaloneSpan ? getRootSpan(this).spanContext().spanId : void 0
+ });
+ }
+ /** @inheritdoc */
+ isRecording() {
+ return !this._endTime && !!this._sampled;
+ }
+ /**
+ * @inheritdoc
+ */
+ addEvent(name2, attributesOrStartTime, startTime) {
+ DEBUG_BUILD$6 && logger$2.log("[Tracing] Adding an event to span:", name2);
+ const time = isSpanTimeInput(attributesOrStartTime) ? attributesOrStartTime : startTime || timestampInSeconds();
+ const attributes = isSpanTimeInput(attributesOrStartTime) ? {} : attributesOrStartTime || {};
+ const event = {
+ name: name2,
+ time: spanTimeInputToSeconds(time),
+ attributes
+ };
+ this._events.push(event);
+ return this;
+ }
+ /**
+ * This method should generally not be used,
+ * but for now we need a way to publicly check if the `_isStandaloneSpan` flag is set.
+ * USE THIS WITH CAUTION!
+ * @internal
+ * @hidden
+ * @experimental
+ */
+ isStandaloneSpan() {
+ return !!this._isStandaloneSpan;
+ }
+ /** Emit `spanEnd` when the span is ended. */
+ _onSpanEnded() {
+ const client = getClient();
+ if (client) {
+ client.emit("spanEnd", this);
+ }
+ const isSegmentSpan = this._isStandaloneSpan || this === getRootSpan(this);
+ if (!isSegmentSpan) {
+ return;
+ }
+ if (this._isStandaloneSpan) {
+ if (this._sampled) {
+ sendSpanEnvelope(createSpanEnvelope([this], client));
+ } else {
+ DEBUG_BUILD$6 && logger$2.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled.");
+ if (client) {
+ client.recordDroppedEvent("sample_rate", "span");
}
- callWithErrorHandling(job, null, 14);
}
+ return;
}
- } finally {
- flushIndex = 0;
- queue.length = 0;
- flushPostFlushCbs(seen2);
- isFlushing = false;
- currentFlushPromise = null;
- if (queue.length || pendingPostFlushCbs.length) {
- flushJobs(seen2);
+ const transactionEvent = this._convertSpanToTransaction();
+ if (transactionEvent) {
+ const scope = getCapturedScopesOnSpan(this).scope || getCurrentScope$1();
+ scope.captureEvent(transactionEvent);
}
}
-}
-__name(flushJobs, "flushJobs");
-function checkRecursiveUpdates(seen2, fn) {
- if (!seen2.has(fn)) {
- seen2.set(fn, 1);
- } else {
- const count = seen2.get(fn);
- if (count > RECURSION_LIMIT) {
- const instance = fn.ownerInstance;
- const componentName = instance && getComponentName(instance.type);
- handleError(
- `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
- null,
- 10
+ /**
+ * Finish the transaction & prepare the event to send to Sentry.
+ */
+ _convertSpanToTransaction() {
+ if (!isFullFinishedSpan(spanToJSON(this))) {
+ return void 0;
+ }
+ if (!this._name) {
+ DEBUG_BUILD$6 && logger$2.warn("Transaction has no name, falling back to ``.");
+ this._name = "";
+ }
+ const { scope: capturedSpanScope, isolationScope: capturedSpanIsolationScope } = getCapturedScopesOnSpan(this);
+ const scope = capturedSpanScope || getCurrentScope$1();
+ const client = scope.getClient() || getClient();
+ if (this._sampled !== true) {
+ DEBUG_BUILD$6 && logger$2.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled.");
+ if (client) {
+ client.recordDroppedEvent("sample_rate", "transaction");
+ }
+ return void 0;
+ }
+ const finishedSpans = getSpanDescendants(this).filter((span) => span !== this && !isStandaloneSpan(span));
+ const spans = finishedSpans.map((span) => spanToJSON(span)).filter(isFullFinishedSpan);
+ const source = this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];
+ delete this._attributes[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME];
+ spans.forEach((span) => {
+ span.data && delete span.data[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME];
+ });
+ const transaction = {
+ contexts: {
+ trace: spanToTransactionTraceContext(this)
+ },
+ spans: (
+ // spans.sort() mutates the array, but `spans` is already a copy so we can safely do this here
+ // we do not use spans anymore after this point
+ spans.length > MAX_SPAN_COUNT ? spans.sort((a2, b2) => a2.start_timestamp - b2.start_timestamp).slice(0, MAX_SPAN_COUNT) : spans
+ ),
+ start_timestamp: this._startTime,
+ timestamp: this._endTime,
+ transaction: this._name,
+ type: "transaction",
+ sdkProcessingMetadata: {
+ capturedSpanScope,
+ capturedSpanIsolationScope,
+ ...dropUndefinedKeys({
+ dynamicSamplingContext: getDynamicSamplingContextFromSpan(this)
+ })
+ },
+ _metrics_summary: getMetricSummaryJsonForSpan(this),
+ ...source && {
+ transaction_info: {
+ source
+ }
+ }
+ };
+ const measurements = timedEventsToMeasurements(this._events);
+ const hasMeasurements = measurements && Object.keys(measurements).length;
+ if (hasMeasurements) {
+ DEBUG_BUILD$6 && logger$2.log(
+ "[Measurements] Adding measurements to transaction event",
+ JSON.stringify(measurements, void 0, 2)
);
- return true;
- } else {
- seen2.set(fn, count + 1);
+ transaction.measurements = measurements;
}
+ return transaction;
}
}
-__name(checkRecursiveUpdates, "checkRecursiveUpdates");
-let isHmrUpdating = false;
-const hmrDirtyComponents = /* @__PURE__ */ new Set();
-if (false) {
- getGlobalThis$1().__VUE_HMR_RUNTIME__ = {
- createRecord: tryWrap(createRecord),
- rerender: tryWrap(rerender),
- reload: tryWrap(reload)
- };
+function isSpanTimeInput(value4) {
+ return value4 && typeof value4 === "number" || value4 instanceof Date || Array.isArray(value4);
}
-const map$1 = /* @__PURE__ */ new Map();
-function registerHMR(instance) {
- const id3 = instance.type.__hmrId;
- let record = map$1.get(id3);
- if (!record) {
- createRecord(id3, instance.type);
- record = map$1.get(id3);
- }
- record.instances.add(instance);
+__name(isSpanTimeInput, "isSpanTimeInput");
+function isFullFinishedSpan(input) {
+ return !!input.start_timestamp && !!input.timestamp && !!input.span_id && !!input.trace_id;
}
-__name(registerHMR, "registerHMR");
-function unregisterHMR(instance) {
- map$1.get(instance.type.__hmrId).instances.delete(instance);
+__name(isFullFinishedSpan, "isFullFinishedSpan");
+function isStandaloneSpan(span) {
+ return span instanceof SentrySpan && span.isStandaloneSpan();
}
-__name(unregisterHMR, "unregisterHMR");
-function createRecord(id3, initialDef) {
- if (map$1.has(id3)) {
- return false;
+__name(isStandaloneSpan, "isStandaloneSpan");
+function sendSpanEnvelope(envelope) {
+ const client = getClient();
+ if (!client) {
+ return;
}
- map$1.set(id3, {
- initialDef: normalizeClassComponent(initialDef),
- instances: /* @__PURE__ */ new Set()
- });
- return true;
-}
-__name(createRecord, "createRecord");
-function normalizeClassComponent(component) {
- return isClassComponent(component) ? component.__vccOpts : component;
-}
-__name(normalizeClassComponent, "normalizeClassComponent");
-function rerender(id3, newRender) {
- const record = map$1.get(id3);
- if (!record) {
+ const spanItems = envelope[1];
+ if (!spanItems || spanItems.length === 0) {
+ client.recordDroppedEvent("before_send", "span");
return;
}
- record.initialDef.render = newRender;
- [...record.instances].forEach((instance) => {
- if (newRender) {
- instance.render = newRender;
- normalizeClassComponent(instance.type).render = newRender;
- }
- instance.renderCache = [];
- isHmrUpdating = true;
- instance.effect.dirty = true;
- instance.update();
- isHmrUpdating = false;
+ client.sendEnvelope(envelope);
+}
+__name(sendSpanEnvelope, "sendSpanEnvelope");
+const SUPPRESS_TRACING_KEY = "__SENTRY_SUPPRESS_TRACING__";
+function startSpan(options4, callback) {
+ const acs = getAcs();
+ if (acs.startSpan) {
+ return acs.startSpan(options4, callback);
+ }
+ const spanArguments = parseSentrySpanArguments(options4);
+ const { forceTransaction, parentSpan: customParentSpan } = options4;
+ return withScope(options4.scope, () => {
+ const wrapper = getActiveSpanWrapper(customParentSpan);
+ return wrapper(() => {
+ const scope = getCurrentScope$1();
+ const parentSpan = getParentSpan(scope);
+ const shouldSkipSpan = options4.onlyIfParent && !parentSpan;
+ const activeSpan = shouldSkipSpan ? new SentryNonRecordingSpan() : createChildOrRootSpan({
+ parentSpan,
+ spanArguments,
+ forceTransaction,
+ scope
+ });
+ _setSpanForScope(scope, activeSpan);
+ return handleCallbackErrors(
+ () => callback(activeSpan),
+ () => {
+ const { status } = spanToJSON(activeSpan);
+ if (activeSpan.isRecording() && (!status || status === "ok")) {
+ activeSpan.setStatus({ code: SPAN_STATUS_ERROR, message: "internal_error" });
+ }
+ },
+ () => activeSpan.end()
+ );
+ });
});
}
-__name(rerender, "rerender");
-function reload(id3, newComp) {
- const record = map$1.get(id3);
- if (!record) return;
- newComp = normalizeClassComponent(newComp);
- updateComponentDef(record.initialDef, newComp);
- const instances = [...record.instances];
- for (const instance of instances) {
- const oldComp = normalizeClassComponent(instance.type);
- if (!hmrDirtyComponents.has(oldComp)) {
- if (oldComp !== record.initialDef) {
- updateComponentDef(oldComp, newComp);
- }
- hmrDirtyComponents.add(oldComp);
- }
- instance.appContext.propsCache.delete(instance.type);
- instance.appContext.emitsCache.delete(instance.type);
- instance.appContext.optionsCache.delete(instance.type);
- if (instance.ceReload) {
- hmrDirtyComponents.add(oldComp);
- instance.ceReload(newComp.styles);
- hmrDirtyComponents.delete(oldComp);
- } else if (instance.parent) {
- instance.parent.effect.dirty = true;
- queueJob(() => {
- instance.parent.update();
- hmrDirtyComponents.delete(oldComp);
+__name(startSpan, "startSpan");
+function startSpanManual(options4, callback) {
+ const acs = getAcs();
+ if (acs.startSpanManual) {
+ return acs.startSpanManual(options4, callback);
+ }
+ const spanArguments = parseSentrySpanArguments(options4);
+ const { forceTransaction, parentSpan: customParentSpan } = options4;
+ return withScope(options4.scope, () => {
+ const wrapper = getActiveSpanWrapper(customParentSpan);
+ return wrapper(() => {
+ const scope = getCurrentScope$1();
+ const parentSpan = getParentSpan(scope);
+ const shouldSkipSpan = options4.onlyIfParent && !parentSpan;
+ const activeSpan = shouldSkipSpan ? new SentryNonRecordingSpan() : createChildOrRootSpan({
+ parentSpan,
+ spanArguments,
+ forceTransaction,
+ scope
});
- } else if (instance.appContext.reload) {
- instance.appContext.reload();
- } else if (typeof window !== "undefined") {
- window.location.reload();
- } else {
- console.warn(
- "[HMR] Root or manually mounted instance modified. Full reload required."
+ _setSpanForScope(scope, activeSpan);
+ function finishAndSetSpan() {
+ activeSpan.end();
+ }
+ __name(finishAndSetSpan, "finishAndSetSpan");
+ return handleCallbackErrors(
+ () => callback(activeSpan, finishAndSetSpan),
+ () => {
+ const { status } = spanToJSON(activeSpan);
+ if (activeSpan.isRecording() && (!status || status === "ok")) {
+ activeSpan.setStatus({ code: SPAN_STATUS_ERROR, message: "internal_error" });
+ }
+ }
);
- }
+ });
+ });
+}
+__name(startSpanManual, "startSpanManual");
+function startInactiveSpan(options4) {
+ const acs = getAcs();
+ if (acs.startInactiveSpan) {
+ return acs.startInactiveSpan(options4);
+ }
+ const spanArguments = parseSentrySpanArguments(options4);
+ const { forceTransaction, parentSpan: customParentSpan } = options4;
+ const wrapper = options4.scope ? (callback) => withScope(options4.scope, callback) : customParentSpan !== void 0 ? (callback) => withActiveSpan(customParentSpan, callback) : (callback) => callback();
+ return wrapper(() => {
+ const scope = getCurrentScope$1();
+ const parentSpan = getParentSpan(scope);
+ const shouldSkipSpan = options4.onlyIfParent && !parentSpan;
+ if (shouldSkipSpan) {
+ return new SentryNonRecordingSpan();
+ }
+ return createChildOrRootSpan({
+ parentSpan,
+ spanArguments,
+ forceTransaction,
+ scope
+ });
+ });
+}
+__name(startInactiveSpan, "startInactiveSpan");
+const continueTrace = /* @__PURE__ */ __name((options4, callback) => {
+ const carrier = getMainCarrier();
+ const acs = getAsyncContextStrategy(carrier);
+ if (acs.continueTrace) {
+ return acs.continueTrace(options4, callback);
+ }
+ const { sentryTrace, baggage } = options4;
+ return withScope((scope) => {
+ const propagationContext = propagationContextFromHeaders(sentryTrace, baggage);
+ scope.setPropagationContext(propagationContext);
+ return callback();
+ });
+}, "continueTrace");
+function withActiveSpan(span, callback) {
+ const acs = getAcs();
+ if (acs.withActiveSpan) {
+ return acs.withActiveSpan(span, callback);
+ }
+ return withScope((scope) => {
+ _setSpanForScope(scope, span || void 0);
+ return callback(scope);
+ });
+}
+__name(withActiveSpan, "withActiveSpan");
+function suppressTracing(callback) {
+ const acs = getAcs();
+ if (acs.suppressTracing) {
+ return acs.suppressTracing(callback);
}
- queuePostFlushCb(() => {
- for (const instance of instances) {
- hmrDirtyComponents.delete(
- normalizeClassComponent(instance.type)
- );
- }
+ return withScope((scope) => {
+ scope.setSDKProcessingMetadata({ [SUPPRESS_TRACING_KEY]: true });
+ return callback();
});
}
-__name(reload, "reload");
-function updateComponentDef(oldComp, newComp) {
- extend$1(oldComp, newComp);
- for (const key in oldComp) {
- if (key !== "__file" && !(key in newComp)) {
- delete oldComp[key];
+__name(suppressTracing, "suppressTracing");
+function startNewTrace(callback) {
+ return withScope((scope) => {
+ scope.setPropagationContext({ traceId: generateTraceId() });
+ DEBUG_BUILD$6 && logger$2.info(`Starting a new trace with id ${scope.getPropagationContext().traceId}`);
+ return withActiveSpan(null, callback);
+ });
+}
+__name(startNewTrace, "startNewTrace");
+function createChildOrRootSpan({
+ parentSpan,
+ spanArguments,
+ forceTransaction,
+ scope
+}) {
+ if (!hasTracingEnabled()) {
+ return new SentryNonRecordingSpan();
+ }
+ const isolationScope = getIsolationScope();
+ let span;
+ if (parentSpan && !forceTransaction) {
+ span = _startChildSpan(parentSpan, scope, spanArguments);
+ addChildSpanToSpan(parentSpan, span);
+ } else if (parentSpan) {
+ const dsc = getDynamicSamplingContextFromSpan(parentSpan);
+ const { traceId, spanId: parentSpanId } = parentSpan.spanContext();
+ const parentSampled = spanIsSampled(parentSpan);
+ span = _startRootSpan(
+ {
+ traceId,
+ parentSpanId,
+ ...spanArguments
+ },
+ scope,
+ parentSampled
+ );
+ freezeDscOnSpan(span, dsc);
+ } else {
+ const {
+ traceId,
+ dsc,
+ parentSpanId,
+ sampled: parentSampled
+ } = {
+ ...isolationScope.getPropagationContext(),
+ ...scope.getPropagationContext()
+ };
+ span = _startRootSpan(
+ {
+ traceId,
+ parentSpanId,
+ ...spanArguments
+ },
+ scope,
+ parentSampled
+ );
+ if (dsc) {
+ freezeDscOnSpan(span, dsc);
}
}
+ logSpanStart(span);
+ setCapturedScopesOnSpan(span, scope, isolationScope);
+ return span;
}
-__name(updateComponentDef, "updateComponentDef");
-function tryWrap(fn) {
- return (id3, arg) => {
- try {
- return fn(id3, arg);
- } catch (e2) {
- console.error(e2);
- console.warn(
- `[HMR] Something went wrong during Vue component hot-reload. Full reload required.`
- );
- }
+__name(createChildOrRootSpan, "createChildOrRootSpan");
+function parseSentrySpanArguments(options4) {
+ const exp = options4.experimental || {};
+ const initialCtx = {
+ isStandalone: exp.standalone,
+ ...options4
};
-}
-__name(tryWrap, "tryWrap");
-let devtools$1;
-let buffer = [];
-let devtoolsNotInstalled = false;
-function emit$1(event, ...args) {
- if (devtools$1) {
- devtools$1.emit(event, ...args);
- } else if (!devtoolsNotInstalled) {
- buffer.push({ event, args });
+ if (options4.startTime) {
+ const ctx = { ...initialCtx };
+ ctx.startTimestamp = spanTimeInputToSeconds(options4.startTime);
+ delete ctx.startTime;
+ return ctx;
}
+ return initialCtx;
}
-__name(emit$1, "emit$1");
-function setDevtoolsHook$1(hook, target) {
- var _a2, _b;
- devtools$1 = hook;
- if (devtools$1) {
- devtools$1.enabled = true;
- buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args));
- buffer = [];
- } else if (
- // handle late devtools injection - only do this if we are in an actual
- // browser environment to avoid the timer handle stalling test runner exit
- // (#4815)
- typeof window !== "undefined" && // some envs mock window but not fully
- window.HTMLElement && // also exclude jsdom
- // eslint-disable-next-line no-restricted-syntax
- !((_b = (_a2 = window.navigator) == null ? void 0 : _a2.userAgent) == null ? void 0 : _b.includes("jsdom"))
- ) {
- const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || [];
- replay.push((newHook) => {
- setDevtoolsHook$1(newHook, target);
- });
- setTimeout(() => {
- if (!devtools$1) {
- target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null;
- devtoolsNotInstalled = true;
- buffer = [];
+__name(parseSentrySpanArguments, "parseSentrySpanArguments");
+function getAcs() {
+ const carrier = getMainCarrier();
+ return getAsyncContextStrategy(carrier);
+}
+__name(getAcs, "getAcs");
+function _startRootSpan(spanArguments, scope, parentSampled) {
+ const client = getClient();
+ const options4 = client && client.getOptions() || {};
+ const { name: name2 = "", attributes } = spanArguments;
+ const [sampled, sampleRate] = scope.getScopeData().sdkProcessingMetadata[SUPPRESS_TRACING_KEY] ? [false] : sampleSpan(options4, {
+ name: name2,
+ parentSampled,
+ attributes,
+ transactionContext: {
+ name: name2,
+ parentSampled
+ }
+ });
+ const rootSpan = new SentrySpan({
+ ...spanArguments,
+ attributes: {
+ [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "custom",
+ ...spanArguments.attributes
+ },
+ sampled
+ });
+ if (sampleRate !== void 0) {
+ rootSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, sampleRate);
+ }
+ if (client) {
+ client.emit("spanStart", rootSpan);
+ }
+ return rootSpan;
+}
+__name(_startRootSpan, "_startRootSpan");
+function _startChildSpan(parentSpan, scope, spanArguments) {
+ const { spanId, traceId } = parentSpan.spanContext();
+ const sampled = scope.getScopeData().sdkProcessingMetadata[SUPPRESS_TRACING_KEY] ? false : spanIsSampled(parentSpan);
+ const childSpan = sampled ? new SentrySpan({
+ ...spanArguments,
+ parentSpanId: spanId,
+ traceId,
+ sampled
+ }) : new SentryNonRecordingSpan({ traceId });
+ addChildSpanToSpan(parentSpan, childSpan);
+ const client = getClient();
+ if (client) {
+ client.emit("spanStart", childSpan);
+ if (spanArguments.endTimestamp) {
+ client.emit("spanEnd", childSpan);
+ }
+ }
+ return childSpan;
+}
+__name(_startChildSpan, "_startChildSpan");
+function getParentSpan(scope) {
+ const span = _getSpanForScope(scope);
+ if (!span) {
+ return void 0;
+ }
+ const client = getClient();
+ const options4 = client ? client.getOptions() : {};
+ if (options4.parentSpanIsAlwaysRootSpan) {
+ return getRootSpan(span);
+ }
+ return span;
+}
+__name(getParentSpan, "getParentSpan");
+function getActiveSpanWrapper(parentSpan) {
+ return parentSpan !== void 0 ? (callback) => {
+ return withActiveSpan(parentSpan, callback);
+ } : (callback) => callback();
+}
+__name(getActiveSpanWrapper, "getActiveSpanWrapper");
+const TRACING_DEFAULTS = {
+ idleTimeout: 1e3,
+ finalTimeout: 3e4,
+ childSpanTimeout: 15e3
+};
+const FINISH_REASON_HEARTBEAT_FAILED = "heartbeatFailed";
+const FINISH_REASON_IDLE_TIMEOUT = "idleTimeout";
+const FINISH_REASON_FINAL_TIMEOUT = "finalTimeout";
+const FINISH_REASON_EXTERNAL_FINISH = "externalFinish";
+function startIdleSpan(startSpanOptions, options4 = {}) {
+ const activities = /* @__PURE__ */ new Map();
+ let _finished = false;
+ let _idleTimeoutID;
+ let _finishReason = FINISH_REASON_EXTERNAL_FINISH;
+ let _autoFinishAllowed = !options4.disableAutoFinish;
+ const _cleanupHooks = [];
+ const {
+ idleTimeout = TRACING_DEFAULTS.idleTimeout,
+ finalTimeout = TRACING_DEFAULTS.finalTimeout,
+ childSpanTimeout = TRACING_DEFAULTS.childSpanTimeout,
+ beforeSpanEnd
+ } = options4;
+ const client = getClient();
+ if (!client || !hasTracingEnabled()) {
+ return new SentryNonRecordingSpan();
+ }
+ const scope = getCurrentScope$1();
+ const previousActiveSpan = getActiveSpan();
+ const span = _startIdleSpan(startSpanOptions);
+ span.end = new Proxy(span.end, {
+ apply(target, thisArg, args) {
+ if (beforeSpanEnd) {
+ beforeSpanEnd(span);
+ }
+ const [definedEndTimestamp, ...rest] = args;
+ const timestamp2 = definedEndTimestamp || timestampInSeconds();
+ const spanEndTimestamp = spanTimeInputToSeconds(timestamp2);
+ const spans = getSpanDescendants(span).filter((child) => child !== span);
+ if (!spans.length) {
+ onIdleSpanEnded(spanEndTimestamp);
+ return Reflect.apply(target, thisArg, [spanEndTimestamp, ...rest]);
+ }
+ const childEndTimestamps = spans.map((span2) => spanToJSON(span2).timestamp).filter((timestamp3) => !!timestamp3);
+ const latestSpanEndTimestamp = childEndTimestamps.length ? Math.max(...childEndTimestamps) : void 0;
+ const spanStartTimestamp = spanToJSON(span).start_timestamp;
+ const endTimestamp = Math.min(
+ spanStartTimestamp ? spanStartTimestamp + finalTimeout / 1e3 : Infinity,
+ Math.max(spanStartTimestamp || -Infinity, Math.min(spanEndTimestamp, latestSpanEndTimestamp || Infinity))
+ );
+ onIdleSpanEnded(endTimestamp);
+ return Reflect.apply(target, thisArg, [endTimestamp, ...rest]);
+ }
+ });
+ function _cancelIdleTimeout() {
+ if (_idleTimeoutID) {
+ clearTimeout(_idleTimeoutID);
+ _idleTimeoutID = void 0;
+ }
+ }
+ __name(_cancelIdleTimeout, "_cancelIdleTimeout");
+ function _restartIdleTimeout(endTimestamp) {
+ _cancelIdleTimeout();
+ _idleTimeoutID = setTimeout(() => {
+ if (!_finished && activities.size === 0 && _autoFinishAllowed) {
+ _finishReason = FINISH_REASON_IDLE_TIMEOUT;
+ span.end(endTimestamp);
+ }
+ }, idleTimeout);
+ }
+ __name(_restartIdleTimeout, "_restartIdleTimeout");
+ function _restartChildSpanTimeout(endTimestamp) {
+ _idleTimeoutID = setTimeout(() => {
+ if (!_finished && _autoFinishAllowed) {
+ _finishReason = FINISH_REASON_HEARTBEAT_FAILED;
+ span.end(endTimestamp);
+ }
+ }, childSpanTimeout);
+ }
+ __name(_restartChildSpanTimeout, "_restartChildSpanTimeout");
+ function _pushActivity(spanId) {
+ _cancelIdleTimeout();
+ activities.set(spanId, true);
+ const endTimestamp = timestampInSeconds();
+ _restartChildSpanTimeout(endTimestamp + childSpanTimeout / 1e3);
+ }
+ __name(_pushActivity, "_pushActivity");
+ function _popActivity(spanId) {
+ if (activities.has(spanId)) {
+ activities.delete(spanId);
+ }
+ if (activities.size === 0) {
+ const endTimestamp = timestampInSeconds();
+ _restartIdleTimeout(endTimestamp + idleTimeout / 1e3);
+ }
+ }
+ __name(_popActivity, "_popActivity");
+ function onIdleSpanEnded(endTimestamp) {
+ _finished = true;
+ activities.clear();
+ _cleanupHooks.forEach((cleanup) => cleanup());
+ _setSpanForScope(scope, previousActiveSpan);
+ const spanJSON = spanToJSON(span);
+ const { start_timestamp: startTimestamp } = spanJSON;
+ if (!startTimestamp) {
+ return;
+ }
+ const attributes = spanJSON.data || {};
+ if (!attributes[SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON]) {
+ span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, _finishReason);
+ }
+ logger$2.log(`[Tracing] Idle span "${spanJSON.op}" finished`);
+ const childSpans = getSpanDescendants(span).filter((child) => child !== span);
+ let discardedSpans = 0;
+ childSpans.forEach((childSpan) => {
+ if (childSpan.isRecording()) {
+ childSpan.setStatus({ code: SPAN_STATUS_ERROR, message: "cancelled" });
+ childSpan.end(endTimestamp);
+ DEBUG_BUILD$6 && logger$2.log("[Tracing] Cancelling span since span ended early", JSON.stringify(childSpan, void 0, 2));
+ }
+ const childSpanJSON = spanToJSON(childSpan);
+ const { timestamp: childEndTimestamp = 0, start_timestamp: childStartTimestamp = 0 } = childSpanJSON;
+ const spanStartedBeforeIdleSpanEnd = childStartTimestamp <= endTimestamp;
+ const timeoutWithMarginOfError = (finalTimeout + idleTimeout) / 1e3;
+ const spanEndedBeforeFinalTimeout = childEndTimestamp - childStartTimestamp <= timeoutWithMarginOfError;
+ if (DEBUG_BUILD$6) {
+ const stringifiedSpan = JSON.stringify(childSpan, void 0, 2);
+ if (!spanStartedBeforeIdleSpanEnd) {
+ logger$2.log("[Tracing] Discarding span since it happened after idle span was finished", stringifiedSpan);
+ } else if (!spanEndedBeforeFinalTimeout) {
+ logger$2.log("[Tracing] Discarding span since it finished after idle span final timeout", stringifiedSpan);
+ }
+ }
+ if (!spanEndedBeforeFinalTimeout || !spanStartedBeforeIdleSpanEnd) {
+ removeChildSpanFromSpan(span, childSpan);
+ discardedSpans++;
+ }
+ });
+ if (discardedSpans > 0) {
+ span.setAttribute("sentry.idle_span_discarded_spans", discardedSpans);
+ }
+ }
+ __name(onIdleSpanEnded, "onIdleSpanEnded");
+ _cleanupHooks.push(
+ client.on("spanStart", (startedSpan) => {
+ if (_finished || startedSpan === span || !!spanToJSON(startedSpan).timestamp) {
+ return;
}
- }, 3e3);
- } else {
- devtoolsNotInstalled = true;
- buffer = [];
+ const allSpans = getSpanDescendants(span);
+ if (allSpans.includes(startedSpan)) {
+ _pushActivity(startedSpan.spanContext().spanId);
+ }
+ })
+ );
+ _cleanupHooks.push(
+ client.on("spanEnd", (endedSpan) => {
+ if (_finished) {
+ return;
+ }
+ _popActivity(endedSpan.spanContext().spanId);
+ })
+ );
+ _cleanupHooks.push(
+ client.on("idleSpanEnableAutoFinish", (spanToAllowAutoFinish) => {
+ if (spanToAllowAutoFinish === span) {
+ _autoFinishAllowed = true;
+ _restartIdleTimeout();
+ if (activities.size) {
+ _restartChildSpanTimeout();
+ }
+ }
+ })
+ );
+ if (!options4.disableAutoFinish) {
+ _restartIdleTimeout();
}
-}
-__name(setDevtoolsHook$1, "setDevtoolsHook$1");
-function devtoolsInitApp(app2, version2) {
- emit$1("app:init", app2, version2, {
- Fragment: Fragment$1,
- Text: Text$4,
- Comment,
- Static
+ setTimeout(() => {
+ if (!_finished) {
+ span.setStatus({ code: SPAN_STATUS_ERROR, message: "deadline_exceeded" });
+ _finishReason = FINISH_REASON_FINAL_TIMEOUT;
+ span.end();
+ }
+ }, finalTimeout);
+ return span;
+}
+__name(startIdleSpan, "startIdleSpan");
+function _startIdleSpan(options4) {
+ const span = startInactiveSpan(options4);
+ _setSpanForScope(getCurrentScope$1(), span);
+ DEBUG_BUILD$6 && logger$2.log("[Tracing] Started span is an idle span");
+ return span;
+}
+__name(_startIdleSpan, "_startIdleSpan");
+function notifyEventProcessors(processors, event, hint, index2 = 0) {
+ return new SyncPromise((resolve2, reject3) => {
+ const processor = processors[index2];
+ if (event === null || typeof processor !== "function") {
+ resolve2(event);
+ } else {
+ const result = processor({ ...event }, hint);
+ DEBUG_BUILD$6 && processor.id && result === null && logger$2.log(`Event processor "${processor.id}" dropped event`);
+ if (isThenable$1(result)) {
+ void result.then((final) => notifyEventProcessors(processors, final, hint, index2 + 1).then(resolve2)).then(null, reject3);
+ } else {
+ void notifyEventProcessors(processors, result, hint, index2 + 1).then(resolve2).then(null, reject3);
+ }
+ }
});
}
-__name(devtoolsInitApp, "devtoolsInitApp");
-function devtoolsUnmountApp(app2) {
- emit$1("app:unmount", app2);
+__name(notifyEventProcessors, "notifyEventProcessors");
+let parsedStackResults;
+let lastKeysCount;
+let cachedFilenameDebugIds;
+function getFilenameToDebugIdMap(stackParser) {
+ const debugIdMap = GLOBAL_OBJ._sentryDebugIds;
+ if (!debugIdMap) {
+ return {};
+ }
+ const debugIdKeys = Object.keys(debugIdMap);
+ if (cachedFilenameDebugIds && debugIdKeys.length === lastKeysCount) {
+ return cachedFilenameDebugIds;
+ }
+ lastKeysCount = debugIdKeys.length;
+ cachedFilenameDebugIds = debugIdKeys.reduce((acc, stackKey) => {
+ if (!parsedStackResults) {
+ parsedStackResults = {};
+ }
+ const result = parsedStackResults[stackKey];
+ if (result) {
+ acc[result[0]] = result[1];
+ } else {
+ const parsedStack = stackParser(stackKey);
+ for (let i2 = parsedStack.length - 1; i2 >= 0; i2--) {
+ const stackFrame = parsedStack[i2];
+ const filename = stackFrame && stackFrame.filename;
+ const debugId = debugIdMap[stackKey];
+ if (filename && debugId) {
+ acc[filename] = debugId;
+ parsedStackResults[stackKey] = [filename, debugId];
+ break;
+ }
+ }
+ }
+ return acc;
+ }, {});
+ return cachedFilenameDebugIds;
}
-__name(devtoolsUnmountApp, "devtoolsUnmountApp");
-const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook(
- "component:added"
- /* COMPONENT_ADDED */
-);
-const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook(
- "component:updated"
- /* COMPONENT_UPDATED */
-);
-const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook(
- "component:removed"
- /* COMPONENT_REMOVED */
-);
-const devtoolsComponentRemoved = /* @__PURE__ */ __name((component) => {
- if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered
- !devtools$1.cleanupBuffer(component)) {
- _devtoolsComponentRemoved(component);
+__name(getFilenameToDebugIdMap, "getFilenameToDebugIdMap");
+function getDebugImagesForResources(stackParser, resource_paths) {
+ const filenameDebugIdMap = getFilenameToDebugIdMap(stackParser);
+ if (!filenameDebugIdMap) {
+ return [];
}
-}, "devtoolsComponentRemoved");
-/*! #__NO_SIDE_EFFECTS__ */
-// @__NO_SIDE_EFFECTS__
-function createDevtoolsComponentHook(hook) {
- return (component) => {
- emit$1(
- hook,
- component.appContext.app,
- component.uid,
- component.parent ? component.parent.uid : void 0,
- component
- );
- };
+ const images = [];
+ for (const path of resource_paths) {
+ if (path && filenameDebugIdMap[path]) {
+ images.push({
+ type: "sourcemap",
+ code_file: path,
+ debug_id: filenameDebugIdMap[path]
+ });
+ }
+ }
+ return images;
}
-__name(createDevtoolsComponentHook, "createDevtoolsComponentHook");
-const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook(
- "perf:start"
- /* PERFORMANCE_START */
-);
-const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook(
- "perf:end"
- /* PERFORMANCE_END */
-);
-function createDevtoolsPerformanceHook(hook) {
- return (component, type, time) => {
- emit$1(hook, component.appContext.app, component.uid, component, type, time);
+__name(getDebugImagesForResources, "getDebugImagesForResources");
+function applyScopeDataToEvent(event, data25) {
+ const { fingerprint, span, breadcrumbs, sdkProcessingMetadata } = data25;
+ applyDataToEvent(event, data25);
+ if (span) {
+ applySpanToEvent(event, span);
+ }
+ applyFingerprintToEvent(event, fingerprint);
+ applyBreadcrumbsToEvent(event, breadcrumbs);
+ applySdkMetadataToEvent(event, sdkProcessingMetadata);
+}
+__name(applyScopeDataToEvent, "applyScopeDataToEvent");
+function mergeScopeData(data25, mergeData) {
+ const {
+ extra,
+ tags,
+ user,
+ contexts,
+ level,
+ sdkProcessingMetadata,
+ breadcrumbs,
+ fingerprint,
+ eventProcessors,
+ attachments,
+ propagationContext,
+ transactionName,
+ span
+ } = mergeData;
+ mergeAndOverwriteScopeData(data25, "extra", extra);
+ mergeAndOverwriteScopeData(data25, "tags", tags);
+ mergeAndOverwriteScopeData(data25, "user", user);
+ mergeAndOverwriteScopeData(data25, "contexts", contexts);
+ data25.sdkProcessingMetadata = merge$1(data25.sdkProcessingMetadata, sdkProcessingMetadata, 2);
+ if (level) {
+ data25.level = level;
+ }
+ if (transactionName) {
+ data25.transactionName = transactionName;
+ }
+ if (span) {
+ data25.span = span;
+ }
+ if (breadcrumbs.length) {
+ data25.breadcrumbs = [...data25.breadcrumbs, ...breadcrumbs];
+ }
+ if (fingerprint.length) {
+ data25.fingerprint = [...data25.fingerprint, ...fingerprint];
+ }
+ if (eventProcessors.length) {
+ data25.eventProcessors = [...data25.eventProcessors, ...eventProcessors];
+ }
+ if (attachments.length) {
+ data25.attachments = [...data25.attachments, ...attachments];
+ }
+ data25.propagationContext = { ...data25.propagationContext, ...propagationContext };
+}
+__name(mergeScopeData, "mergeScopeData");
+function mergeAndOverwriteScopeData(data25, prop2, mergeVal) {
+ data25[prop2] = merge$1(data25[prop2], mergeVal, 1);
+}
+__name(mergeAndOverwriteScopeData, "mergeAndOverwriteScopeData");
+function applyDataToEvent(event, data25) {
+ const { extra, tags, user, contexts, level, transactionName } = data25;
+ const cleanedExtra = dropUndefinedKeys(extra);
+ if (cleanedExtra && Object.keys(cleanedExtra).length) {
+ event.extra = { ...cleanedExtra, ...event.extra };
+ }
+ const cleanedTags = dropUndefinedKeys(tags);
+ if (cleanedTags && Object.keys(cleanedTags).length) {
+ event.tags = { ...cleanedTags, ...event.tags };
+ }
+ const cleanedUser = dropUndefinedKeys(user);
+ if (cleanedUser && Object.keys(cleanedUser).length) {
+ event.user = { ...cleanedUser, ...event.user };
+ }
+ const cleanedContexts = dropUndefinedKeys(contexts);
+ if (cleanedContexts && Object.keys(cleanedContexts).length) {
+ event.contexts = { ...cleanedContexts, ...event.contexts };
+ }
+ if (level) {
+ event.level = level;
+ }
+ if (transactionName && event.type !== "transaction") {
+ event.transaction = transactionName;
+ }
+}
+__name(applyDataToEvent, "applyDataToEvent");
+function applyBreadcrumbsToEvent(event, breadcrumbs) {
+ const mergedBreadcrumbs = [...event.breadcrumbs || [], ...breadcrumbs];
+ event.breadcrumbs = mergedBreadcrumbs.length ? mergedBreadcrumbs : void 0;
+}
+__name(applyBreadcrumbsToEvent, "applyBreadcrumbsToEvent");
+function applySdkMetadataToEvent(event, sdkProcessingMetadata) {
+ event.sdkProcessingMetadata = {
+ ...event.sdkProcessingMetadata,
+ ...sdkProcessingMetadata
};
}
-__name(createDevtoolsPerformanceHook, "createDevtoolsPerformanceHook");
-function devtoolsComponentEmit(component, event, params) {
- emit$1(
- "component:emit",
- component.appContext.app,
- component,
- event,
- params
- );
+__name(applySdkMetadataToEvent, "applySdkMetadataToEvent");
+function applySpanToEvent(event, span) {
+ event.contexts = {
+ trace: spanToTraceContext(span),
+ ...event.contexts
+ };
+ event.sdkProcessingMetadata = {
+ dynamicSamplingContext: getDynamicSamplingContextFromSpan(span),
+ ...event.sdkProcessingMetadata
+ };
+ const rootSpan = getRootSpan(span);
+ const transactionName = spanToJSON(rootSpan).description;
+ if (transactionName && !event.transaction && event.type === "transaction") {
+ event.transaction = transactionName;
+ }
}
-__name(devtoolsComponentEmit, "devtoolsComponentEmit");
-function emit(instance, event, ...rawArgs) {
- if (instance.isUnmounted) return;
- const props = instance.vnode.props || EMPTY_OBJ;
- if (false) {
- const {
- emitsOptions,
- propsOptions: [propsOptions]
- } = instance;
- if (emitsOptions) {
- if (!(event in emitsOptions) && true) {
- if (!propsOptions || !(toHandlerKey(event) in propsOptions)) {
- warn$1$1(
- `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(event)}" prop.`
- );
- }
- } else {
- const validator3 = emitsOptions[event];
- if (isFunction$4(validator3)) {
- const isValid2 = validator3(...rawArgs);
- if (!isValid2) {
- warn$1$1(
- `Invalid event arguments: event validation failed for event "${event}".`
- );
- }
- }
- }
- }
+__name(applySpanToEvent, "applySpanToEvent");
+function applyFingerprintToEvent(event, fingerprint) {
+ event.fingerprint = event.fingerprint ? Array.isArray(event.fingerprint) ? event.fingerprint : [event.fingerprint] : [];
+ if (fingerprint) {
+ event.fingerprint = event.fingerprint.concat(fingerprint);
}
- let args = rawArgs;
- const isModelListener2 = event.startsWith("update:");
- const modelArg = isModelListener2 && event.slice(7);
- if (modelArg && modelArg in props) {
- const modifiersKey = `${modelArg === "modelValue" ? "model" : modelArg}Modifiers`;
- const { number: number2, trim: trim2 } = props[modifiersKey] || EMPTY_OBJ;
- if (trim2) {
- args = rawArgs.map((a) => isString$7(a) ? a.trim() : a);
+ if (event.fingerprint && !event.fingerprint.length) {
+ delete event.fingerprint;
+ }
+}
+__name(applyFingerprintToEvent, "applyFingerprintToEvent");
+function prepareEvent(options4, event, hint, scope, client, isolationScope) {
+ const { normalizeDepth = 3, normalizeMaxBreadth = 1e3 } = options4;
+ const prepared = {
+ ...event,
+ event_id: event.event_id || hint.event_id || uuid4(),
+ timestamp: event.timestamp || dateTimestampInSeconds()
+ };
+ const integrations = hint.integrations || options4.integrations.map((i2) => i2.name);
+ applyClientOptions(prepared, options4);
+ applyIntegrationsMetadata(prepared, integrations);
+ if (client) {
+ client.emit("applyFrameMetadata", event);
+ }
+ if (event.type === void 0) {
+ applyDebugIds(prepared, options4.stackParser);
+ }
+ const finalScope = getFinalScope(scope, hint.captureContext);
+ if (hint.mechanism) {
+ addExceptionMechanism(prepared, hint.mechanism);
+ }
+ const clientEventProcessors = client ? client.getEventProcessors() : [];
+ const data25 = getGlobalScope().getScopeData();
+ if (isolationScope) {
+ const isolationData = isolationScope.getScopeData();
+ mergeScopeData(data25, isolationData);
+ }
+ if (finalScope) {
+ const finalScopeData = finalScope.getScopeData();
+ mergeScopeData(data25, finalScopeData);
+ }
+ const attachments = [...hint.attachments || [], ...data25.attachments];
+ if (attachments.length) {
+ hint.attachments = attachments;
+ }
+ applyScopeDataToEvent(prepared, data25);
+ const eventProcessors = [
+ ...clientEventProcessors,
+ // Run scope event processors _after_ all other processors
+ ...data25.eventProcessors
+ ];
+ const result = notifyEventProcessors(eventProcessors, prepared, hint);
+ return result.then((evt) => {
+ if (evt) {
+ applyDebugMeta(evt);
}
- if (number2) {
- args = rawArgs.map(looseToNumber);
+ if (typeof normalizeDepth === "number" && normalizeDepth > 0) {
+ return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);
}
+ return evt;
+ });
+}
+__name(prepareEvent, "prepareEvent");
+function applyClientOptions(event, options4) {
+ const { environment, release, dist: dist3, maxValueLength = 250 } = options4;
+ event.environment = event.environment || environment || DEFAULT_ENVIRONMENT;
+ if (!event.release && release) {
+ event.release = release;
}
- if (false) {
- devtoolsComponentEmit(instance, event, args);
+ if (!event.dist && dist3) {
+ event.dist = dist3;
}
- if (false) {
- const lowerCaseEvent = event.toLowerCase();
- if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) {
- warn$1$1(
- `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName(
- instance,
- instance.type
- )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate$1(
- event
- )}" instead of "${event}".`
- );
- }
+ if (event.message) {
+ event.message = truncate(event.message, maxValueLength);
}
- let handlerName;
- let handler6 = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249)
- props[handlerName = toHandlerKey(camelize$1(event))];
- if (!handler6 && isModelListener2) {
- handler6 = props[handlerName = toHandlerKey(hyphenate$1(event))];
+ const exception = event.exception && event.exception.values && event.exception.values[0];
+ if (exception && exception.value) {
+ exception.value = truncate(exception.value, maxValueLength);
}
- if (handler6) {
- callWithAsyncErrorHandling(
- handler6,
- instance,
- 6,
- args
- );
+ const request = event.request;
+ if (request && request.url) {
+ request.url = truncate(request.url, maxValueLength);
}
- const onceHandler = props[handlerName + `Once`];
- if (onceHandler) {
- if (!instance.emitted) {
- instance.emitted = {};
- } else if (instance.emitted[handlerName]) {
- return;
- }
- instance.emitted[handlerName] = true;
- callWithAsyncErrorHandling(
- onceHandler,
- instance,
- 6,
- args
- );
+}
+__name(applyClientOptions, "applyClientOptions");
+function applyDebugIds(event, stackParser) {
+ const filenameDebugIdMap = getFilenameToDebugIdMap(stackParser);
+ try {
+ event.exception.values.forEach((exception) => {
+ exception.stacktrace.frames.forEach((frame) => {
+ if (filenameDebugIdMap && frame.filename) {
+ frame.debug_id = filenameDebugIdMap[frame.filename];
+ }
+ });
+ });
+ } catch (e2) {
}
}
-__name(emit, "emit");
-function normalizeEmitsOptions(comp, appContext, asMixin = false) {
- const cache2 = appContext.emitsCache;
- const cached = cache2.get(comp);
- if (cached !== void 0) {
- return cached;
+__name(applyDebugIds, "applyDebugIds");
+function applyDebugMeta(event) {
+ const filenameDebugIdMap = {};
+ try {
+ event.exception.values.forEach((exception) => {
+ exception.stacktrace.frames.forEach((frame) => {
+ if (frame.debug_id) {
+ if (frame.abs_path) {
+ filenameDebugIdMap[frame.abs_path] = frame.debug_id;
+ } else if (frame.filename) {
+ filenameDebugIdMap[frame.filename] = frame.debug_id;
+ }
+ delete frame.debug_id;
+ }
+ });
+ });
+ } catch (e2) {
}
- const raw = comp.emits;
- let normalized = {};
- let hasExtends = false;
- if (!isFunction$4(comp)) {
- const extendEmits = /* @__PURE__ */ __name((raw2) => {
- const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true);
- if (normalizedFromExtend) {
- hasExtends = true;
- extend$1(normalized, normalizedFromExtend);
- }
- }, "extendEmits");
- if (!asMixin && appContext.mixins.length) {
- appContext.mixins.forEach(extendEmits);
- }
- if (comp.extends) {
- extendEmits(comp.extends);
- }
- if (comp.mixins) {
- comp.mixins.forEach(extendEmits);
- }
+ if (Object.keys(filenameDebugIdMap).length === 0) {
+ return;
}
- if (!raw && !hasExtends) {
- if (isObject$6(comp)) {
- cache2.set(comp, null);
- }
+ event.debug_meta = event.debug_meta || {};
+ event.debug_meta.images = event.debug_meta.images || [];
+ const images = event.debug_meta.images;
+ Object.entries(filenameDebugIdMap).forEach(([filename, debug_id]) => {
+ images.push({
+ type: "sourcemap",
+ code_file: filename,
+ debug_id
+ });
+ });
+}
+__name(applyDebugMeta, "applyDebugMeta");
+function applyIntegrationsMetadata(event, integrationNames) {
+ if (integrationNames.length > 0) {
+ event.sdk = event.sdk || {};
+ event.sdk.integrations = [...event.sdk.integrations || [], ...integrationNames];
+ }
+}
+__name(applyIntegrationsMetadata, "applyIntegrationsMetadata");
+function normalizeEvent(event, depth, maxBreadth) {
+ if (!event) {
return null;
}
- if (isArray$4(raw)) {
- raw.forEach((key) => normalized[key] = null);
- } else {
- extend$1(normalized, raw);
+ const normalized = {
+ ...event,
+ ...event.breadcrumbs && {
+ breadcrumbs: event.breadcrumbs.map((b2) => ({
+ ...b2,
+ ...b2.data && {
+ data: normalize$2(b2.data, depth, maxBreadth)
+ }
+ }))
+ },
+ ...event.user && {
+ user: normalize$2(event.user, depth, maxBreadth)
+ },
+ ...event.contexts && {
+ contexts: normalize$2(event.contexts, depth, maxBreadth)
+ },
+ ...event.extra && {
+ extra: normalize$2(event.extra, depth, maxBreadth)
+ }
+ };
+ if (event.contexts && event.contexts.trace && normalized.contexts) {
+ normalized.contexts.trace = event.contexts.trace;
+ if (event.contexts.trace.data) {
+ normalized.contexts.trace.data = normalize$2(event.contexts.trace.data, depth, maxBreadth);
+ }
}
- if (isObject$6(comp)) {
- cache2.set(comp, normalized);
+ if (event.spans) {
+ normalized.spans = event.spans.map((span) => {
+ return {
+ ...span,
+ ...span.data && {
+ data: normalize$2(span.data, depth, maxBreadth)
+ }
+ };
+ });
+ }
+ if (event.contexts && event.contexts.flags && normalized.contexts) {
+ normalized.contexts.flags = normalize$2(event.contexts.flags, 3, maxBreadth);
}
return normalized;
}
-__name(normalizeEmitsOptions, "normalizeEmitsOptions");
-function isEmitListener(options4, key) {
- if (!options4 || !isOn(key)) {
- return false;
+__name(normalizeEvent, "normalizeEvent");
+function getFinalScope(scope, captureContext) {
+ if (!captureContext) {
+ return scope;
}
- key = key.slice(2).replace(/Once$/, "");
- return hasOwn$3(options4, key[0].toLowerCase() + key.slice(1)) || hasOwn$3(options4, hyphenate$1(key)) || hasOwn$3(options4, key);
+ const finalScope = scope ? scope.clone() : new Scope();
+ finalScope.update(captureContext);
+ return finalScope;
}
-__name(isEmitListener, "isEmitListener");
-let currentRenderingInstance = null;
-let currentScopeId = null;
-function setCurrentRenderingInstance(instance) {
- const prev2 = currentRenderingInstance;
- currentRenderingInstance = instance;
- currentScopeId = instance && instance.type.__scopeId || null;
- return prev2;
+__name(getFinalScope, "getFinalScope");
+function parseEventHintOrCaptureContext(hint) {
+ if (!hint) {
+ return void 0;
+ }
+ if (hintIsScopeOrFunction(hint)) {
+ return { captureContext: hint };
+ }
+ if (hintIsScopeContext(hint)) {
+ return {
+ captureContext: hint
+ };
+ }
+ return hint;
}
-__name(setCurrentRenderingInstance, "setCurrentRenderingInstance");
-function pushScopeId(id3) {
- currentScopeId = id3;
+__name(parseEventHintOrCaptureContext, "parseEventHintOrCaptureContext");
+function hintIsScopeOrFunction(hint) {
+ return hint instanceof Scope || typeof hint === "function";
}
-__name(pushScopeId, "pushScopeId");
-function popScopeId() {
- currentScopeId = null;
+__name(hintIsScopeOrFunction, "hintIsScopeOrFunction");
+const captureContextKeys = [
+ "user",
+ "level",
+ "extra",
+ "contexts",
+ "tags",
+ "fingerprint",
+ "requestSession",
+ "propagationContext"
+];
+function hintIsScopeContext(hint) {
+ return Object.keys(hint).some((key) => captureContextKeys.includes(key));
+}
+__name(hintIsScopeContext, "hintIsScopeContext");
+function captureException(exception, hint) {
+ return getCurrentScope$1().captureException(exception, parseEventHintOrCaptureContext(hint));
+}
+__name(captureException, "captureException");
+function captureMessage(message3, captureContext) {
+ const level = typeof captureContext === "string" ? captureContext : void 0;
+ const context = typeof captureContext !== "string" ? { captureContext } : void 0;
+ return getCurrentScope$1().captureMessage(message3, level, context);
+}
+__name(captureMessage, "captureMessage");
+function captureEvent(event, hint) {
+ return getCurrentScope$1().captureEvent(event, hint);
+}
+__name(captureEvent, "captureEvent");
+function setContext(name2, context) {
+ getIsolationScope().setContext(name2, context);
+}
+__name(setContext, "setContext");
+function setExtras(extras) {
+ getIsolationScope().setExtras(extras);
+}
+__name(setExtras, "setExtras");
+function setExtra(key, extra) {
+ getIsolationScope().setExtra(key, extra);
+}
+__name(setExtra, "setExtra");
+function setTags(tags) {
+ getIsolationScope().setTags(tags);
+}
+__name(setTags, "setTags");
+function setTag$5(key, value4) {
+ getIsolationScope().setTag(key, value4);
+}
+__name(setTag$5, "setTag$5");
+function setUser(user) {
+ getIsolationScope().setUser(user);
+}
+__name(setUser, "setUser");
+function lastEventId() {
+ return getIsolationScope().lastEventId();
+}
+__name(lastEventId, "lastEventId");
+function captureCheckIn(checkIn, upsertMonitorConfig) {
+ const scope = getCurrentScope$1();
+ const client = getClient();
+ if (!client) {
+ DEBUG_BUILD$6 && logger$2.warn("Cannot capture check-in. No client defined.");
+ } else if (!client.captureCheckIn) {
+ DEBUG_BUILD$6 && logger$2.warn("Cannot capture check-in. Client does not support sending check-ins.");
+ } else {
+ return client.captureCheckIn(checkIn, upsertMonitorConfig, scope);
+ }
+ return uuid4();
}
-__name(popScopeId, "popScopeId");
-const withScopeId = /* @__PURE__ */ __name((_id2) => withCtx, "withScopeId");
-function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
- if (!ctx) return fn;
- if (fn._n) {
- return fn;
+__name(captureCheckIn, "captureCheckIn");
+function withMonitor(monitorSlug, callback, upsertMonitorConfig) {
+ const checkInId = captureCheckIn({ monitorSlug, status: "in_progress" }, upsertMonitorConfig);
+ const now2 = timestampInSeconds();
+ function finishCheckIn(status) {
+ captureCheckIn({ monitorSlug, status, checkInId, duration: timestampInSeconds() - now2 });
}
- const renderFnWithContext = /* @__PURE__ */ __name((...args) => {
- if (renderFnWithContext._d) {
- setBlockTracking(-1);
- }
- const prevInstance = setCurrentRenderingInstance(ctx);
- let res;
+ __name(finishCheckIn, "finishCheckIn");
+ return withIsolationScope(() => {
+ let maybePromiseResult;
try {
- res = fn(...args);
- } finally {
- setCurrentRenderingInstance(prevInstance);
- if (renderFnWithContext._d) {
- setBlockTracking(1);
- }
- }
- if (false) {
- devtoolsComponentUpdated(ctx);
+ maybePromiseResult = callback();
+ } catch (e2) {
+ finishCheckIn("error");
+ throw e2;
}
- return res;
- }, "renderFnWithContext");
- renderFnWithContext._n = true;
- renderFnWithContext._c = true;
- renderFnWithContext._d = true;
- return renderFnWithContext;
-}
-__name(withCtx, "withCtx");
-let accessedAttrs = false;
-function markAttrsAccessed() {
- accessedAttrs = true;
-}
-__name(markAttrsAccessed, "markAttrsAccessed");
-function renderComponentRoot(instance) {
- const {
- type: Component,
- vnode,
- proxy,
- withProxy,
- propsOptions: [propsOptions],
- slots,
- attrs: attrs4,
- emit: emit2,
- render: render2,
- renderCache,
- props,
- data: data24,
- setupState,
- ctx,
- inheritAttrs
- } = instance;
- const prev2 = setCurrentRenderingInstance(instance);
- let result;
- let fallthroughAttrs;
- if (false) {
- accessedAttrs = false;
- }
- try {
- if (vnode.shapeFlag & 4) {
- const proxyToUse = withProxy || proxy;
- const thisProxy = false ? new Proxy(proxyToUse, {
- get(target, key, receiver) {
- warn$1$1(
- `Property '${String(
- key
- )}' was accessed via 'this'. Avoid using 'this' in templates.`
- );
- return Reflect.get(target, key, receiver);
+ if (isThenable$1(maybePromiseResult)) {
+ Promise.resolve(maybePromiseResult).then(
+ () => {
+ finishCheckIn("ok");
+ },
+ (e2) => {
+ finishCheckIn("error");
+ throw e2;
}
- }) : proxyToUse;
- result = normalizeVNode(
- render2.call(
- thisProxy,
- proxyToUse,
- renderCache,
- false ? shallowReadonly(props) : props,
- setupState,
- data24,
- ctx
- )
);
- fallthroughAttrs = attrs4;
} else {
- const render22 = Component;
- if (false) {
- markAttrsAccessed();
- }
- result = normalizeVNode(
- render22.length > 1 ? render22(
- false ? shallowReadonly(props) : props,
- false ? {
- get attrs() {
- markAttrsAccessed();
- return shallowReadonly(attrs4);
- },
- slots,
- emit: emit2
- } : { attrs: attrs4, slots, emit: emit2 }
- ) : render22(
- false ? shallowReadonly(props) : props,
- null
- )
- );
- fallthroughAttrs = Component.props ? attrs4 : getFunctionalFallthrough(attrs4);
+ finishCheckIn("ok");
}
- } catch (err) {
- blockStack.length = 0;
- handleError(err, instance, 1);
- result = createVNode(Comment);
+ return maybePromiseResult;
+ });
+}
+__name(withMonitor, "withMonitor");
+async function flush(timeout) {
+ const client = getClient();
+ if (client) {
+ return client.flush(timeout);
+ }
+ DEBUG_BUILD$6 && logger$2.warn("Cannot flush events. No client defined.");
+ return Promise.resolve(false);
+}
+__name(flush, "flush");
+async function close$1(timeout) {
+ const client = getClient();
+ if (client) {
+ return client.close(timeout);
+ }
+ DEBUG_BUILD$6 && logger$2.warn("Cannot flush events and disable SDK. No client defined.");
+ return Promise.resolve(false);
+}
+__name(close$1, "close$1");
+function isInitialized() {
+ return !!getClient();
+}
+__name(isInitialized, "isInitialized");
+function isEnabled() {
+ const client = getClient();
+ return !!client && client.getOptions().enabled !== false && !!client.getTransport();
+}
+__name(isEnabled, "isEnabled");
+function addEventProcessor(callback) {
+ getIsolationScope().addEventProcessor(callback);
+}
+__name(addEventProcessor, "addEventProcessor");
+function startSession(context) {
+ const client = getClient();
+ const isolationScope = getIsolationScope();
+ const currentScope = getCurrentScope$1();
+ const { release, environment = DEFAULT_ENVIRONMENT } = client && client.getOptions() || {};
+ const { userAgent } = GLOBAL_OBJ.navigator || {};
+ const session = makeSession$1({
+ release,
+ environment,
+ user: currentScope.getUser() || isolationScope.getUser(),
+ ...userAgent && { userAgent },
+ ...context
+ });
+ const currentSession = isolationScope.getSession();
+ if (currentSession && currentSession.status === "ok") {
+ updateSession(currentSession, { status: "exited" });
+ }
+ endSession();
+ isolationScope.setSession(session);
+ currentScope.setSession(session);
+ return session;
+}
+__name(startSession, "startSession");
+function endSession() {
+ const isolationScope = getIsolationScope();
+ const currentScope = getCurrentScope$1();
+ const session = currentScope.getSession() || isolationScope.getSession();
+ if (session) {
+ closeSession(session);
+ }
+ _sendSessionUpdate$1();
+ isolationScope.setSession();
+ currentScope.setSession();
+}
+__name(endSession, "endSession");
+function _sendSessionUpdate$1() {
+ const isolationScope = getIsolationScope();
+ const currentScope = getCurrentScope$1();
+ const client = getClient();
+ const session = currentScope.getSession() || isolationScope.getSession();
+ if (session && client) {
+ client.captureSession(session);
+ }
+}
+__name(_sendSessionUpdate$1, "_sendSessionUpdate$1");
+function captureSession(end = false) {
+ if (end) {
+ endSession();
+ return;
}
- let root24 = result;
- let setRoot = void 0;
- if (false) {
- [root24, setRoot] = getChildRoot(result);
+ _sendSessionUpdate$1();
+}
+__name(captureSession, "captureSession");
+class SessionFlusher {
+ static {
+ __name(this, "SessionFlusher");
}
- if (fallthroughAttrs && inheritAttrs !== false) {
- const keys2 = Object.keys(fallthroughAttrs);
- const { shapeFlag } = root24;
- if (keys2.length) {
- if (shapeFlag & (1 | 6)) {
- if (propsOptions && keys2.some(isModelListener)) {
- fallthroughAttrs = filterModelListeners(
- fallthroughAttrs,
- propsOptions
- );
- }
- root24 = cloneVNode(root24, fallthroughAttrs, false, true);
- } else if (false) {
- const allAttrs = Object.keys(attrs4);
- const eventAttrs = [];
- const extraAttrs = [];
- for (let i2 = 0, l = allAttrs.length; i2 < l; i2++) {
- const key = allAttrs[i2];
- if (isOn(key)) {
- if (!isModelListener(key)) {
- eventAttrs.push(key[2].toLowerCase() + key.slice(3));
- }
- } else {
- extraAttrs.push(key);
- }
- }
- if (extraAttrs.length) {
- warn$1$1(
- `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`
- );
- }
- if (eventAttrs.length) {
- warn$1$1(
- `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`
- );
- }
- }
+ // We adjust the type here to add the `unref()` part, as setInterval can technically return a number or a NodeJS.Timer
+ constructor(client, attrs4) {
+ this._client = client;
+ this.flushTimeout = 60;
+ this._pendingAggregates = /* @__PURE__ */ new Map();
+ this._isEnabled = true;
+ this._intervalId = setInterval(() => this.flush(), this.flushTimeout * 1e3);
+ if (this._intervalId.unref) {
+ this._intervalId.unref();
}
+ this._sessionAttrs = attrs4;
}
- if (vnode.dirs) {
- if (false) {
- warn$1$1(
- `Runtime directive used on component with non-element root node. The directives will not function as intended.`
- );
+ /** Checks if `pendingAggregates` has entries, and if it does flushes them by calling `sendSession` */
+ flush() {
+ const sessionAggregates = this.getSessionAggregates();
+ if (sessionAggregates.aggregates.length === 0) {
+ return;
}
- root24 = cloneVNode(root24, null, false, true);
- root24.dirs = root24.dirs ? root24.dirs.concat(vnode.dirs) : vnode.dirs;
+ this._pendingAggregates = /* @__PURE__ */ new Map();
+ this._client.sendSession(sessionAggregates);
}
- if (vnode.transition) {
- if (false) {
- warn$1$1(
- `Component inside renders non-element root node that cannot be animated.`
- );
+ /** Massages the entries in `pendingAggregates` and returns aggregated sessions */
+ getSessionAggregates() {
+ const aggregates = Array.from(this._pendingAggregates.values());
+ const sessionAggregates = {
+ attrs: this._sessionAttrs,
+ aggregates
+ };
+ return dropUndefinedKeys(sessionAggregates);
+ }
+ /** JSDoc */
+ close() {
+ clearInterval(this._intervalId);
+ this._isEnabled = false;
+ this.flush();
+ }
+ /**
+ * Wrapper function for _incrementSessionStatusCount that checks if the instance of SessionFlusher is enabled then
+ * fetches the session status of the request from `Scope.getRequestSession().status` on the scope and passes them to
+ * `_incrementSessionStatusCount` along with the start date
+ */
+ incrementSessionStatusCount() {
+ if (!this._isEnabled) {
+ return;
+ }
+ const isolationScope = getIsolationScope();
+ const requestSession = isolationScope.getRequestSession();
+ if (requestSession && requestSession.status) {
+ this._incrementSessionStatusCount(requestSession.status, /* @__PURE__ */ new Date());
+ isolationScope.setRequestSession(void 0);
}
- root24.transition = vnode.transition;
}
- if (false) {
- setRoot(root24);
- } else {
- result = root24;
+ /**
+ * Increments status bucket in pendingAggregates buffer (internal state) corresponding to status of
+ * the session received
+ */
+ // eslint-disable-next-line deprecation/deprecation
+ _incrementSessionStatusCount(status, date) {
+ const sessionStartedTrunc = new Date(date).setSeconds(0, 0);
+ let aggregationCounts = this._pendingAggregates.get(sessionStartedTrunc);
+ if (!aggregationCounts) {
+ aggregationCounts = { started: new Date(sessionStartedTrunc).toISOString() };
+ this._pendingAggregates.set(sessionStartedTrunc, aggregationCounts);
+ }
+ switch (status) {
+ case "errored":
+ aggregationCounts.errored = (aggregationCounts.errored || 0) + 1;
+ return aggregationCounts.errored;
+ case "ok":
+ aggregationCounts.exited = (aggregationCounts.exited || 0) + 1;
+ return aggregationCounts.exited;
+ default:
+ aggregationCounts.crashed = (aggregationCounts.crashed || 0) + 1;
+ return aggregationCounts.crashed;
+ }
}
- setCurrentRenderingInstance(prev2);
- return result;
}
-__name(renderComponentRoot, "renderComponentRoot");
-const getChildRoot = /* @__PURE__ */ __name((vnode) => {
- const rawChildren = vnode.children;
- const dynamicChildren = vnode.dynamicChildren;
- const childRoot = filterSingleRoot(rawChildren, false);
- if (!childRoot) {
- return [vnode, void 0];
- } else if (false) {
- return getChildRoot(childRoot);
+const SENTRY_API_VERSION = "7";
+function getBaseApiEndpoint(dsn) {
+ const protocol = dsn.protocol ? `${dsn.protocol}:` : "";
+ const port = dsn.port ? `:${dsn.port}` : "";
+ return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ""}/api/`;
+}
+__name(getBaseApiEndpoint, "getBaseApiEndpoint");
+function _getIngestEndpoint(dsn) {
+ return `${getBaseApiEndpoint(dsn)}${dsn.projectId}/envelope/`;
+}
+__name(_getIngestEndpoint, "_getIngestEndpoint");
+function _encodedAuth(dsn, sdkInfo) {
+ const params = {
+ sentry_version: SENTRY_API_VERSION
+ };
+ if (dsn.publicKey) {
+ params.sentry_key = dsn.publicKey;
}
- const index2 = rawChildren.indexOf(childRoot);
- const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1;
- const setRoot = /* @__PURE__ */ __name((updatedRoot) => {
- rawChildren[index2] = updatedRoot;
- if (dynamicChildren) {
- if (dynamicIndex > -1) {
- dynamicChildren[dynamicIndex] = updatedRoot;
- } else if (updatedRoot.patchFlag > 0) {
- vnode.dynamicChildren = [...dynamicChildren, updatedRoot];
- }
+ if (sdkInfo) {
+ params.sentry_client = `${sdkInfo.name}/${sdkInfo.version}`;
+ }
+ return new URLSearchParams(params).toString();
+}
+__name(_encodedAuth, "_encodedAuth");
+function getEnvelopeEndpointWithUrlEncodedAuth(dsn, tunnel, sdkInfo) {
+ return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`;
+}
+__name(getEnvelopeEndpointWithUrlEncodedAuth, "getEnvelopeEndpointWithUrlEncodedAuth");
+function getReportDialogEndpoint(dsnLike, dialogOptions) {
+ const dsn = makeDsn(dsnLike);
+ if (!dsn) {
+ return "";
+ }
+ const endpoint = `${getBaseApiEndpoint(dsn)}embed/error-page/`;
+ let encodedOptions = `dsn=${dsnToString(dsn)}`;
+ for (const key in dialogOptions) {
+ if (key === "dsn") {
+ continue;
}
- }, "setRoot");
- return [normalizeVNode(childRoot), setRoot];
-}, "getChildRoot");
-function filterSingleRoot(children, recurse = true) {
- let singleRoot;
- for (let i2 = 0; i2 < children.length; i2++) {
- const child = children[i2];
- if (isVNode$1(child)) {
- if (child.type !== Comment || child.children === "v-if") {
- if (singleRoot) {
- return;
- } else {
- singleRoot = child;
- if (false) {
- return filterSingleRoot(singleRoot.children);
- }
- }
+ if (key === "onClose") {
+ continue;
+ }
+ if (key === "user") {
+ const user = dialogOptions.user;
+ if (!user) {
+ continue;
+ }
+ if (user.name) {
+ encodedOptions += `&name=${encodeURIComponent(user.name)}`;
+ }
+ if (user.email) {
+ encodedOptions += `&email=${encodeURIComponent(user.email)}`;
}
} else {
+ encodedOptions += `&${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key])}`;
+ }
+ }
+ return `${endpoint}?${encodedOptions}`;
+}
+__name(getReportDialogEndpoint, "getReportDialogEndpoint");
+const installedIntegrations = [];
+function filterDuplicates(integrations) {
+ const integrationsByName = {};
+ integrations.forEach((currentInstance2) => {
+ const { name: name2 } = currentInstance2;
+ const existingInstance = integrationsByName[name2];
+ if (existingInstance && !existingInstance.isDefaultInstance && currentInstance2.isDefaultInstance) {
return;
}
+ integrationsByName[name2] = currentInstance2;
+ });
+ return Object.values(integrationsByName);
+}
+__name(filterDuplicates, "filterDuplicates");
+function getIntegrationsToSetup(options4) {
+ const defaultIntegrations = options4.defaultIntegrations || [];
+ const userIntegrations = options4.integrations;
+ defaultIntegrations.forEach((integration) => {
+ integration.isDefaultInstance = true;
+ });
+ let integrations;
+ if (Array.isArray(userIntegrations)) {
+ integrations = [...defaultIntegrations, ...userIntegrations];
+ } else if (typeof userIntegrations === "function") {
+ const resolvedUserIntegrations = userIntegrations(defaultIntegrations);
+ integrations = Array.isArray(resolvedUserIntegrations) ? resolvedUserIntegrations : [resolvedUserIntegrations];
+ } else {
+ integrations = defaultIntegrations;
}
- return singleRoot;
+ const finalIntegrations = filterDuplicates(integrations);
+ const debugIndex = finalIntegrations.findIndex((integration) => integration.name === "Debug");
+ if (debugIndex > -1) {
+ const [debugInstance] = finalIntegrations.splice(debugIndex, 1);
+ finalIntegrations.push(debugInstance);
+ }
+ return finalIntegrations;
}
-__name(filterSingleRoot, "filterSingleRoot");
-const getFunctionalFallthrough = /* @__PURE__ */ __name((attrs4) => {
- let res;
- for (const key in attrs4) {
- if (key === "class" || key === "style" || isOn(key)) {
- (res || (res = {}))[key] = attrs4[key];
+__name(getIntegrationsToSetup, "getIntegrationsToSetup");
+function setupIntegrations(client, integrations) {
+ const integrationIndex = {};
+ integrations.forEach((integration) => {
+ if (integration) {
+ setupIntegration(client, integration, integrationIndex);
+ }
+ });
+ return integrationIndex;
+}
+__name(setupIntegrations, "setupIntegrations");
+function afterSetupIntegrations(client, integrations) {
+ for (const integration of integrations) {
+ if (integration && integration.afterAllSetup) {
+ integration.afterAllSetup(client);
}
}
- return res;
-}, "getFunctionalFallthrough");
-const filterModelListeners = /* @__PURE__ */ __name((attrs4, props) => {
- const res = {};
- for (const key in attrs4) {
- if (!isModelListener(key) || !(key.slice(9) in props)) {
- res[key] = attrs4[key];
+}
+__name(afterSetupIntegrations, "afterSetupIntegrations");
+function setupIntegration(client, integration, integrationIndex) {
+ if (integrationIndex[integration.name]) {
+ DEBUG_BUILD$6 && logger$2.log(`Integration skipped because it was already installed: ${integration.name}`);
+ return;
+ }
+ integrationIndex[integration.name] = integration;
+ if (installedIntegrations.indexOf(integration.name) === -1 && typeof integration.setupOnce === "function") {
+ integration.setupOnce();
+ installedIntegrations.push(integration.name);
+ }
+ if (integration.setup && typeof integration.setup === "function") {
+ integration.setup(client);
+ }
+ if (typeof integration.preprocessEvent === "function") {
+ const callback = integration.preprocessEvent.bind(integration);
+ client.on("preprocessEvent", (event, hint) => callback(event, hint, client));
+ }
+ if (typeof integration.processEvent === "function") {
+ const callback = integration.processEvent.bind(integration);
+ const processor = Object.assign((event, hint) => callback(event, hint, client), {
+ id: integration.name
+ });
+ client.addEventProcessor(processor);
+ }
+ DEBUG_BUILD$6 && logger$2.log(`Integration installed: ${integration.name}`);
+}
+__name(setupIntegration, "setupIntegration");
+function addIntegration(integration) {
+ const client = getClient();
+ if (!client) {
+ DEBUG_BUILD$6 && logger$2.warn(`Cannot add integration "${integration.name}" because no SDK Client is available.`);
+ return;
+ }
+ client.addIntegration(integration);
+}
+__name(addIntegration, "addIntegration");
+function defineIntegration(fn) {
+ return fn;
+}
+__name(defineIntegration, "defineIntegration");
+function createClientReportEnvelope(discarded_events, dsn, timestamp2) {
+ const clientReportItem = [
+ { type: "client_report" },
+ {
+ timestamp: timestamp2 || dateTimestampInSeconds(),
+ discarded_events
}
+ ];
+ return createEnvelope(dsn ? { dsn } : {}, [clientReportItem]);
+}
+__name(createClientReportEnvelope, "createClientReportEnvelope");
+class SentryError extends Error {
+ static {
+ __name(this, "SentryError");
}
- return res;
-}, "filterModelListeners");
-const isElementRoot = /* @__PURE__ */ __name((vnode) => {
- return vnode.shapeFlag & (6 | 1) || vnode.type === Comment;
-}, "isElementRoot");
-function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
- const { props: prevProps, children: prevChildren, component } = prevVNode;
- const { props: nextProps, children: nextChildren, patchFlag } = nextVNode;
- const emits = component.emitsOptions;
- if (false) {
- return true;
+ /** Display name of this error instance. */
+ constructor(message3, logLevel = "warn") {
+ super(message3);
+ this.message = message3;
+ this.name = new.target.prototype.constructor.name;
+ Object.setPrototypeOf(this, new.target.prototype);
+ this.logLevel = logLevel;
}
- if (nextVNode.dirs || nextVNode.transition) {
- return true;
+}
+const ALREADY_SEEN_ERROR = "Not capturing exception because it's already been captured.";
+class BaseClient {
+ static {
+ __name(this, "BaseClient");
}
- if (optimized && patchFlag >= 0) {
- if (patchFlag & 1024) {
- return true;
+ /** Options passed to the SDK. */
+ /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */
+ /** Array of set up integrations. */
+ /** Number of calls being processed */
+ /** Holds flushable */
+ // eslint-disable-next-line @typescript-eslint/ban-types
+ /**
+ * Initializes this client instance.
+ *
+ * @param options Options for the client.
+ */
+ constructor(options4) {
+ this._options = options4;
+ this._integrations = {};
+ this._numProcessing = 0;
+ this._outcomes = {};
+ this._hooks = {};
+ this._eventProcessors = [];
+ if (options4.dsn) {
+ this._dsn = makeDsn(options4.dsn);
+ } else {
+ DEBUG_BUILD$6 && logger$2.warn("No DSN provided, client will not send events.");
}
- if (patchFlag & 16) {
- if (!prevProps) {
- return !!nextProps;
+ if (this._dsn) {
+ const url = getEnvelopeEndpointWithUrlEncodedAuth(
+ this._dsn,
+ options4.tunnel,
+ options4._metadata ? options4._metadata.sdk : void 0
+ );
+ this._transport = options4.transport({
+ tunnel: this._options.tunnel,
+ recordDroppedEvent: this.recordDroppedEvent.bind(this),
+ ...options4.transportOptions,
+ url
+ });
+ }
+ const tracingOptions = ["enableTracing", "tracesSampleRate", "tracesSampler"];
+ const undefinedOption = tracingOptions.find((option3) => option3 in options4 && options4[option3] == void 0);
+ if (undefinedOption) {
+ consoleSandbox(() => {
+ console.warn(
+ `[Sentry] Deprecation warning: \`${undefinedOption}\` is set to undefined, which leads to tracing being enabled. In v9, a value of \`undefined\` will result in tracing being disabled.`
+ );
+ });
+ }
+ }
+ /**
+ * @inheritDoc
+ */
+ captureException(exception, hint, scope) {
+ const eventId = uuid4();
+ if (checkOrSetAlreadyCaught(exception)) {
+ DEBUG_BUILD$6 && logger$2.log(ALREADY_SEEN_ERROR);
+ return eventId;
+ }
+ const hintWithEventId = {
+ event_id: eventId,
+ ...hint
+ };
+ this._process(
+ this.eventFromException(exception, hintWithEventId).then(
+ (event) => this._captureEvent(event, hintWithEventId, scope)
+ )
+ );
+ return hintWithEventId.event_id;
+ }
+ /**
+ * @inheritDoc
+ */
+ captureMessage(message3, level, hint, currentScope) {
+ const hintWithEventId = {
+ event_id: uuid4(),
+ ...hint
+ };
+ const eventMessage = isParameterizedString(message3) ? message3 : String(message3);
+ const promisedEvent = isPrimitive(message3) ? this.eventFromMessage(eventMessage, level, hintWithEventId) : this.eventFromException(message3, hintWithEventId);
+ this._process(promisedEvent.then((event) => this._captureEvent(event, hintWithEventId, currentScope)));
+ return hintWithEventId.event_id;
+ }
+ /**
+ * @inheritDoc
+ */
+ captureEvent(event, hint, currentScope) {
+ const eventId = uuid4();
+ if (hint && hint.originalException && checkOrSetAlreadyCaught(hint.originalException)) {
+ DEBUG_BUILD$6 && logger$2.log(ALREADY_SEEN_ERROR);
+ return eventId;
+ }
+ const hintWithEventId = {
+ event_id: eventId,
+ ...hint
+ };
+ const sdkProcessingMetadata = event.sdkProcessingMetadata || {};
+ const capturedSpanScope = sdkProcessingMetadata.capturedSpanScope;
+ this._process(this._captureEvent(event, hintWithEventId, capturedSpanScope || currentScope));
+ return hintWithEventId.event_id;
+ }
+ /**
+ * @inheritDoc
+ */
+ captureSession(session) {
+ if (!(typeof session.release === "string")) {
+ DEBUG_BUILD$6 && logger$2.warn("Discarded session because of missing or non-string release");
+ } else {
+ this.sendSession(session);
+ updateSession(session, { init: false });
+ }
+ }
+ /**
+ * @inheritDoc
+ */
+ getDsn() {
+ return this._dsn;
+ }
+ /**
+ * @inheritDoc
+ */
+ getOptions() {
+ return this._options;
+ }
+ /**
+ * @see SdkMetadata
+ *
+ * @return The metadata of the SDK
+ */
+ getSdkMetadata() {
+ return this._options._metadata;
+ }
+ /**
+ * @inheritDoc
+ */
+ getTransport() {
+ return this._transport;
+ }
+ /**
+ * @inheritDoc
+ */
+ flush(timeout) {
+ const transport = this._transport;
+ if (transport) {
+ this.emit("flush");
+ return this._isClientDoneProcessing(timeout).then((clientFinished) => {
+ return transport.flush(timeout).then((transportFlushed) => clientFinished && transportFlushed);
+ });
+ } else {
+ return resolvedSyncPromise(true);
+ }
+ }
+ /**
+ * @inheritDoc
+ */
+ close(timeout) {
+ return this.flush(timeout).then((result) => {
+ this.getOptions().enabled = false;
+ this.emit("close");
+ return result;
+ });
+ }
+ /** Get all installed event processors. */
+ getEventProcessors() {
+ return this._eventProcessors;
+ }
+ /** @inheritDoc */
+ addEventProcessor(eventProcessor) {
+ this._eventProcessors.push(eventProcessor);
+ }
+ /** @inheritdoc */
+ init() {
+ if (this._isEnabled() || // Force integrations to be setup even if no DSN was set when we have
+ // Spotlight enabled. This is particularly important for browser as we
+ // don't support the `spotlight` option there and rely on the users
+ // adding the `spotlightBrowserIntegration()` to their integrations which
+ // wouldn't get initialized with the check below when there's no DSN set.
+ this._options.integrations.some(({ name: name2 }) => name2.startsWith("Spotlight"))) {
+ this._setupIntegrations();
+ }
+ }
+ /**
+ * Gets an installed integration by its name.
+ *
+ * @returns The installed integration or `undefined` if no integration with that `name` was installed.
+ */
+ getIntegrationByName(integrationName) {
+ return this._integrations[integrationName];
+ }
+ /**
+ * @inheritDoc
+ */
+ addIntegration(integration) {
+ const isAlreadyInstalled = this._integrations[integration.name];
+ setupIntegration(this, integration, this._integrations);
+ if (!isAlreadyInstalled) {
+ afterSetupIntegrations(this, [integration]);
+ }
+ }
+ /**
+ * @inheritDoc
+ */
+ sendEvent(event, hint = {}) {
+ this.emit("beforeSendEvent", event, hint);
+ let env = createEventEnvelope(event, this._dsn, this._options._metadata, this._options.tunnel);
+ for (const attachment of hint.attachments || []) {
+ env = addItemToEnvelope(env, createAttachmentEnvelopeItem(attachment));
+ }
+ const promise = this.sendEnvelope(env);
+ if (promise) {
+ promise.then((sendResponse) => this.emit("afterSendEvent", event, sendResponse), null);
+ }
+ }
+ /**
+ * @inheritDoc
+ */
+ sendSession(session) {
+ const env = createSessionEnvelope(session, this._dsn, this._options._metadata, this._options.tunnel);
+ this.sendEnvelope(env);
+ }
+ /**
+ * @inheritDoc
+ */
+ recordDroppedEvent(reason, category, eventOrCount) {
+ if (this._options.sendClientReports) {
+ const count = typeof eventOrCount === "number" ? eventOrCount : 1;
+ const key = `${reason}:${category}`;
+ DEBUG_BUILD$6 && logger$2.log(`Recording outcome: "${key}"${count > 1 ? ` (${count} times)` : ""}`);
+ this._outcomes[key] = (this._outcomes[key] || 0) + count;
+ }
+ }
+ // Keep on() & emit() signatures in sync with types' client.ts interface
+ /* eslint-disable @typescript-eslint/unified-signatures */
+ /** @inheritdoc */
+ /** @inheritdoc */
+ on(hook, callback) {
+ const hooks2 = this._hooks[hook] = this._hooks[hook] || [];
+ hooks2.push(callback);
+ return () => {
+ const cbIndex = hooks2.indexOf(callback);
+ if (cbIndex > -1) {
+ hooks2.splice(cbIndex, 1);
}
- return hasPropsChanged(prevProps, nextProps, emits);
- } else if (patchFlag & 8) {
- const dynamicProps = nextVNode.dynamicProps;
- for (let i2 = 0; i2 < dynamicProps.length; i2++) {
- const key = dynamicProps[i2];
- if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) {
- return true;
+ };
+ }
+ /** @inheritdoc */
+ /** @inheritdoc */
+ emit(hook, ...rest) {
+ const callbacks = this._hooks[hook];
+ if (callbacks) {
+ callbacks.forEach((callback) => callback(...rest));
+ }
+ }
+ /**
+ * @inheritdoc
+ */
+ sendEnvelope(envelope) {
+ this.emit("beforeEnvelope", envelope);
+ if (this._isEnabled() && this._transport) {
+ return this._transport.send(envelope).then(null, (reason) => {
+ DEBUG_BUILD$6 && logger$2.error("Error while sending envelope:", reason);
+ return reason;
+ });
+ }
+ DEBUG_BUILD$6 && logger$2.error("Transport disabled");
+ return resolvedSyncPromise({});
+ }
+ /* eslint-enable @typescript-eslint/unified-signatures */
+ /** Setup integrations for this client. */
+ _setupIntegrations() {
+ const { integrations } = this._options;
+ this._integrations = setupIntegrations(this, integrations);
+ afterSetupIntegrations(this, integrations);
+ }
+ /** Updates existing session based on the provided event */
+ _updateSessionFromEvent(session, event) {
+ let crashed = false;
+ let errored = false;
+ const exceptions = event.exception && event.exception.values;
+ if (exceptions) {
+ errored = true;
+ for (const ex of exceptions) {
+ const mechanism = ex.mechanism;
+ if (mechanism && mechanism.handled === false) {
+ crashed = true;
+ break;
}
}
}
- } else {
- if (prevChildren || nextChildren) {
- if (!nextChildren || !nextChildren.$stable) {
- return true;
+ const sessionNonTerminal = session.status === "ok";
+ const shouldUpdateAndSend = sessionNonTerminal && session.errors === 0 || sessionNonTerminal && crashed;
+ if (shouldUpdateAndSend) {
+ updateSession(session, {
+ ...crashed && { status: "crashed" },
+ errors: session.errors || Number(errored || crashed)
+ });
+ this.captureSession(session);
+ }
+ }
+ /**
+ * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying
+ * "no" (resolving to `false`) in order to give the client a chance to potentially finish first.
+ *
+ * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not
+ * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to
+ * `true`.
+ * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and
+ * `false` otherwise
+ */
+ _isClientDoneProcessing(timeout) {
+ return new SyncPromise((resolve2) => {
+ let ticked = 0;
+ const tick = 1;
+ const interval = setInterval(() => {
+ if (this._numProcessing == 0) {
+ clearInterval(interval);
+ resolve2(true);
+ } else {
+ ticked += tick;
+ if (timeout && ticked >= timeout) {
+ clearInterval(interval);
+ resolve2(false);
+ }
+ }
+ }, tick);
+ });
+ }
+ /** Determines whether this SDK is enabled and a transport is present. */
+ _isEnabled() {
+ return this.getOptions().enabled !== false && this._transport !== void 0;
+ }
+ /**
+ * Adds common information to events.
+ *
+ * The information includes release and environment from `options`,
+ * breadcrumbs and context (extra, tags and user) from the scope.
+ *
+ * Information that is already present in the event is never overwritten. For
+ * nested objects, such as the context, keys are merged.
+ *
+ * @param event The original event.
+ * @param hint May contain additional information about the original exception.
+ * @param currentScope A scope containing event metadata.
+ * @returns A new event with more information.
+ */
+ _prepareEvent(event, hint, currentScope = getCurrentScope$1(), isolationScope = getIsolationScope()) {
+ const options4 = this.getOptions();
+ const integrations = Object.keys(this._integrations);
+ if (!hint.integrations && integrations.length > 0) {
+ hint.integrations = integrations;
+ }
+ this.emit("preprocessEvent", event, hint);
+ if (!event.type) {
+ isolationScope.setLastEventId(event.event_id || hint.event_id);
+ }
+ return prepareEvent(options4, event, hint, currentScope, this, isolationScope).then((evt) => {
+ if (evt === null) {
+ return evt;
+ }
+ evt.contexts = {
+ trace: getTraceContextFromScope(currentScope),
+ ...evt.contexts
+ };
+ const dynamicSamplingContext = getDynamicSamplingContextFromScope(this, currentScope);
+ evt.sdkProcessingMetadata = {
+ dynamicSamplingContext,
+ ...evt.sdkProcessingMetadata
+ };
+ return evt;
+ });
+ }
+ /**
+ * Processes the event and logs an error in case of rejection
+ * @param event
+ * @param hint
+ * @param scope
+ */
+ _captureEvent(event, hint = {}, scope) {
+ return this._processEvent(event, hint, scope).then(
+ (finalEvent) => {
+ return finalEvent.event_id;
+ },
+ (reason) => {
+ if (DEBUG_BUILD$6) {
+ const sentryError = reason;
+ if (sentryError.logLevel === "log") {
+ logger$2.log(sentryError.message);
+ } else {
+ logger$2.warn(sentryError);
+ }
+ }
+ return void 0;
}
+ );
+ }
+ /**
+ * Processes an event (either error or message) and sends it to Sentry.
+ *
+ * This also adds breadcrumbs and context information to the event. However,
+ * platform specific meta data (such as the User's IP address) must be added
+ * by the SDK implementor.
+ *
+ *
+ * @param event The event to send to Sentry.
+ * @param hint May contain additional information about the original exception.
+ * @param currentScope A scope containing event metadata.
+ * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.
+ */
+ _processEvent(event, hint, currentScope) {
+ const options4 = this.getOptions();
+ const { sampleRate } = options4;
+ const isTransaction = isTransactionEvent$1(event);
+ const isError2 = isErrorEvent$1(event);
+ const eventType = event.type || "error";
+ const beforeSendLabel = `before send for type \`${eventType}\``;
+ const parsedSampleRate = typeof sampleRate === "undefined" ? void 0 : parseSampleRate(sampleRate);
+ if (isError2 && typeof parsedSampleRate === "number" && Math.random() > parsedSampleRate) {
+ this.recordDroppedEvent("sample_rate", "error", event);
+ return rejectedSyncPromise(
+ new SentryError(
+ `Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})`,
+ "log"
+ )
+ );
}
- if (prevProps === nextProps) {
- return false;
+ const dataCategory = eventType === "replay_event" ? "replay" : eventType;
+ const sdkProcessingMetadata = event.sdkProcessingMetadata || {};
+ const capturedSpanIsolationScope = sdkProcessingMetadata.capturedSpanIsolationScope;
+ return this._prepareEvent(event, hint, currentScope, capturedSpanIsolationScope).then((prepared) => {
+ if (prepared === null) {
+ this.recordDroppedEvent("event_processor", dataCategory, event);
+ throw new SentryError("An event processor returned `null`, will not send event.", "log");
+ }
+ const isInternalException = hint.data && hint.data.__sentry__ === true;
+ if (isInternalException) {
+ return prepared;
+ }
+ const result = processBeforeSend(this, options4, prepared, hint);
+ return _validateBeforeSendResult(result, beforeSendLabel);
+ }).then((processedEvent) => {
+ if (processedEvent === null) {
+ this.recordDroppedEvent("before_send", dataCategory, event);
+ if (isTransaction) {
+ const spans = event.spans || [];
+ const spanCount = 1 + spans.length;
+ this.recordDroppedEvent("before_send", "span", spanCount);
+ }
+ throw new SentryError(`${beforeSendLabel} returned \`null\`, will not send event.`, "log");
+ }
+ const session = currentScope && currentScope.getSession();
+ if (!isTransaction && session) {
+ this._updateSessionFromEvent(session, processedEvent);
+ }
+ if (isTransaction) {
+ const spanCountBefore = processedEvent.sdkProcessingMetadata && processedEvent.sdkProcessingMetadata.spanCountBeforeProcessing || 0;
+ const spanCountAfter = processedEvent.spans ? processedEvent.spans.length : 0;
+ const droppedSpanCount = spanCountBefore - spanCountAfter;
+ if (droppedSpanCount > 0) {
+ this.recordDroppedEvent("before_send", "span", droppedSpanCount);
+ }
+ }
+ const transactionInfo = processedEvent.transaction_info;
+ if (isTransaction && transactionInfo && processedEvent.transaction !== event.transaction) {
+ const source = "custom";
+ processedEvent.transaction_info = {
+ ...transactionInfo,
+ source
+ };
+ }
+ this.sendEvent(processedEvent, hint);
+ return processedEvent;
+ }).then(null, (reason) => {
+ if (reason instanceof SentryError) {
+ throw reason;
+ }
+ this.captureException(reason, {
+ data: {
+ __sentry__: true
+ },
+ originalException: reason
+ });
+ throw new SentryError(
+ `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
+Reason: ${reason}`
+ );
+ });
+ }
+ /**
+ * Occupies the client with processing and event
+ */
+ _process(promise) {
+ this._numProcessing++;
+ void promise.then(
+ (value4) => {
+ this._numProcessing--;
+ return value4;
+ },
+ (reason) => {
+ this._numProcessing--;
+ return reason;
+ }
+ );
+ }
+ /**
+ * Clears outcomes on this client and returns them.
+ */
+ _clearOutcomes() {
+ const outcomes = this._outcomes;
+ this._outcomes = {};
+ return Object.entries(outcomes).map(([key, quantity]) => {
+ const [reason, category] = key.split(":");
+ return {
+ reason,
+ category,
+ quantity
+ };
+ });
+ }
+ /**
+ * Sends client reports as an envelope.
+ */
+ _flushOutcomes() {
+ DEBUG_BUILD$6 && logger$2.log("Flushing outcomes...");
+ const outcomes = this._clearOutcomes();
+ if (outcomes.length === 0) {
+ DEBUG_BUILD$6 && logger$2.log("No outcomes to send");
+ return;
}
- if (!prevProps) {
- return !!nextProps;
+ if (!this._dsn) {
+ DEBUG_BUILD$6 && logger$2.log("No dsn provided, will not send outcomes");
+ return;
}
- if (!nextProps) {
- return true;
+ DEBUG_BUILD$6 && logger$2.log("Sending outcomes:", outcomes);
+ const envelope = createClientReportEnvelope(outcomes, this._options.tunnel && dsnToString(this._dsn));
+ this.sendEnvelope(envelope);
+ }
+ /**
+ * @inheritDoc
+ */
+}
+function _validateBeforeSendResult(beforeSendResult, beforeSendLabel) {
+ const invalidValueError = `${beforeSendLabel} must return \`null\` or a valid event.`;
+ if (isThenable$1(beforeSendResult)) {
+ return beforeSendResult.then(
+ (event) => {
+ if (!isPlainObject$5(event) && event !== null) {
+ throw new SentryError(invalidValueError);
+ }
+ return event;
+ },
+ (e2) => {
+ throw new SentryError(`${beforeSendLabel} rejected with ${e2}`);
+ }
+ );
+ } else if (!isPlainObject$5(beforeSendResult) && beforeSendResult !== null) {
+ throw new SentryError(invalidValueError);
+ }
+ return beforeSendResult;
+}
+__name(_validateBeforeSendResult, "_validateBeforeSendResult");
+function processBeforeSend(client, options4, event, hint) {
+ const { beforeSend, beforeSendTransaction, beforeSendSpan } = options4;
+ if (isErrorEvent$1(event) && beforeSend) {
+ return beforeSend(event, hint);
+ }
+ if (isTransactionEvent$1(event)) {
+ if (event.spans && beforeSendSpan) {
+ const processedSpans = [];
+ for (const span of event.spans) {
+ const processedSpan = beforeSendSpan(span);
+ if (processedSpan) {
+ processedSpans.push(processedSpan);
+ } else {
+ showSpanDropWarning();
+ client.recordDroppedEvent("before_send", "span");
+ }
+ }
+ event.spans = processedSpans;
+ }
+ if (beforeSendTransaction) {
+ if (event.spans) {
+ const spanCountBefore = event.spans.length;
+ event.sdkProcessingMetadata = {
+ ...event.sdkProcessingMetadata,
+ spanCountBeforeProcessing: spanCountBefore
+ };
+ }
+ return beforeSendTransaction(event, hint);
}
- return hasPropsChanged(prevProps, nextProps, emits);
}
- return false;
+ return event;
}
-__name(shouldUpdateComponent, "shouldUpdateComponent");
-function hasPropsChanged(prevProps, nextProps, emitsOptions) {
- const nextKeys = Object.keys(nextProps);
- if (nextKeys.length !== Object.keys(prevProps).length) {
- return true;
+__name(processBeforeSend, "processBeforeSend");
+function isErrorEvent$1(event) {
+ return event.type === void 0;
+}
+__name(isErrorEvent$1, "isErrorEvent$1");
+function isTransactionEvent$1(event) {
+ return event.type === "transaction";
+}
+__name(isTransactionEvent$1, "isTransactionEvent$1");
+function createCheckInEnvelope(checkIn, dynamicSamplingContext, metadata, tunnel, dsn) {
+ const headers = {
+ sent_at: (/* @__PURE__ */ new Date()).toISOString()
+ };
+ if (metadata && metadata.sdk) {
+ headers.sdk = {
+ name: metadata.sdk.name,
+ version: metadata.sdk.version
+ };
}
- for (let i2 = 0; i2 < nextKeys.length; i2++) {
- const key = nextKeys[i2];
- if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) {
- return true;
- }
+ if (!!tunnel && !!dsn) {
+ headers.dsn = dsnToString(dsn);
}
- return false;
+ if (dynamicSamplingContext) {
+ headers.trace = dropUndefinedKeys(dynamicSamplingContext);
+ }
+ const item3 = createCheckInEnvelopeItem(checkIn);
+ return createEnvelope(headers, [item3]);
}
-__name(hasPropsChanged, "hasPropsChanged");
-function updateHOCHostEl({ vnode, parent }, el) {
- while (parent) {
- const root24 = parent.subTree;
- if (root24.suspense && root24.suspense.activeBranch === vnode) {
- root24.el = vnode.el;
+__name(createCheckInEnvelope, "createCheckInEnvelope");
+function createCheckInEnvelopeItem(checkIn) {
+ const checkInHeaders = {
+ type: "check_in"
+ };
+ return [checkInHeaders, checkIn];
+}
+__name(createCheckInEnvelopeItem, "createCheckInEnvelopeItem");
+function parseStackFrames$1(stackParser, error2) {
+ return stackParser(error2.stack || "", 1);
+}
+__name(parseStackFrames$1, "parseStackFrames$1");
+function exceptionFromError$1(stackParser, error2) {
+ const exception = {
+ type: error2.name || error2.constructor.name,
+ value: error2.message
+ };
+ const frames = parseStackFrames$1(stackParser, error2);
+ if (frames.length) {
+ exception.stacktrace = { frames };
+ }
+ return exception;
+}
+__name(exceptionFromError$1, "exceptionFromError$1");
+function getErrorPropertyFromObject$1(obj) {
+ for (const prop2 in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj, prop2)) {
+ const value4 = obj[prop2];
+ if (value4 instanceof Error) {
+ return value4;
+ }
}
- if (root24 === vnode) {
- (vnode = parent.vnode).el = el;
- parent = parent.parent;
- } else {
- break;
+ }
+ return void 0;
+}
+__name(getErrorPropertyFromObject$1, "getErrorPropertyFromObject$1");
+function getMessageForObject(exception) {
+ if ("name" in exception && typeof exception.name === "string") {
+ let message3 = `'${exception.name}' captured as exception`;
+ if ("message" in exception && typeof exception.message === "string") {
+ message3 += ` with message '${exception.message}'`;
}
+ return message3;
+ } else if ("message" in exception && typeof exception.message === "string") {
+ return exception.message;
}
+ const keys2 = extractExceptionKeysForMessage(exception);
+ if (isErrorEvent$2(exception)) {
+ return `Event \`ErrorEvent\` captured as exception with message \`${exception.message}\``;
+ }
+ const className = getObjectClassName$1(exception);
+ return `${className && className !== "Object" ? `'${className}'` : "Object"} captured as exception with keys: ${keys2}`;
}
-__name(updateHOCHostEl, "updateHOCHostEl");
-const COMPONENTS = "components";
-const DIRECTIVES = "directives";
-function resolveComponent(name2, maybeSelfReference) {
- return resolveAsset(COMPONENTS, name2, true, maybeSelfReference) || name2;
+__name(getMessageForObject, "getMessageForObject");
+function getObjectClassName$1(obj) {
+ try {
+ const prototype2 = Object.getPrototypeOf(obj);
+ return prototype2 ? prototype2.constructor.name : void 0;
+ } catch (e2) {
+ }
}
-__name(resolveComponent, "resolveComponent");
-const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
-function resolveDynamicComponent(component) {
- if (isString$7(component)) {
- return resolveAsset(COMPONENTS, component, false) || component;
- } else {
- return component || NULL_DYNAMIC_COMPONENT;
+__name(getObjectClassName$1, "getObjectClassName$1");
+function getException(client, mechanism, exception, hint) {
+ if (isError(exception)) {
+ return [exception, void 0];
+ }
+ mechanism.synthetic = true;
+ if (isPlainObject$5(exception)) {
+ const normalizeDepth = client && client.getOptions().normalizeDepth;
+ const extras = { ["__serialized__"]: normalizeToSize(exception, normalizeDepth) };
+ const errorFromProp = getErrorPropertyFromObject$1(exception);
+ if (errorFromProp) {
+ return [errorFromProp, extras];
+ }
+ const message3 = getMessageForObject(exception);
+ const ex2 = hint && hint.syntheticException || new Error(message3);
+ ex2.message = message3;
+ return [ex2, extras];
+ }
+ const ex = hint && hint.syntheticException || new Error(exception);
+ ex.message = `${exception}`;
+ return [ex, void 0];
+}
+__name(getException, "getException");
+function eventFromUnknownInput$1(client, stackParser, exception, hint) {
+ const providedMechanism = hint && hint.data && hint.data.mechanism;
+ const mechanism = providedMechanism || {
+ handled: true,
+ type: "generic"
+ };
+ const [ex, extras] = getException(client, mechanism, exception, hint);
+ const event = {
+ exception: {
+ values: [exceptionFromError$1(stackParser, ex)]
+ }
+ };
+ if (extras) {
+ event.extra = extras;
}
+ addExceptionTypeValue(event, void 0, void 0);
+ addExceptionMechanism(event, mechanism);
+ return {
+ ...event,
+ event_id: hint && hint.event_id
+ };
}
-__name(resolveDynamicComponent, "resolveDynamicComponent");
-function resolveDirective(name2) {
- return resolveAsset(DIRECTIVES, name2);
+__name(eventFromUnknownInput$1, "eventFromUnknownInput$1");
+function eventFromMessage$1(stackParser, message3, level = "info", hint, attachStacktrace) {
+ const event = {
+ event_id: hint && hint.event_id,
+ level
+ };
+ if (attachStacktrace && hint && hint.syntheticException) {
+ const frames = parseStackFrames$1(stackParser, hint.syntheticException);
+ if (frames.length) {
+ event.exception = {
+ values: [
+ {
+ value: message3,
+ stacktrace: { frames }
+ }
+ ]
+ };
+ addExceptionMechanism(event, { synthetic: true });
+ }
+ }
+ if (isParameterizedString(message3)) {
+ const { __sentry_template_string__, __sentry_template_values__ } = message3;
+ event.logentry = {
+ message: __sentry_template_string__,
+ params: __sentry_template_values__
+ };
+ return event;
+ }
+ event.message = message3;
+ return event;
}
-__name(resolveDirective, "resolveDirective");
-function resolveAsset(type, name2, warnMissing = true, maybeSelfReference = false) {
- const instance = currentRenderingInstance || currentInstance;
- if (instance) {
- const Component = instance.type;
- if (type === COMPONENTS) {
- const selfName = getComponentName(
- Component,
- false
- );
- if (selfName && (selfName === name2 || selfName === camelize$1(name2) || selfName === capitalize$1(camelize$1(name2)))) {
- return Component;
+__name(eventFromMessage$1, "eventFromMessage$1");
+class ServerRuntimeClient extends BaseClient {
+ static {
+ __name(this, "ServerRuntimeClient");
+ }
+ // eslint-disable-next-line deprecation/deprecation
+ /**
+ * Creates a new Edge SDK instance.
+ * @param options Configuration options for this SDK.
+ */
+ constructor(options4) {
+ registerSpanErrorInstrumentation();
+ super(options4);
+ }
+ /**
+ * @inheritDoc
+ */
+ eventFromException(exception, hint) {
+ const event = eventFromUnknownInput$1(this, this._options.stackParser, exception, hint);
+ event.level = "error";
+ return resolvedSyncPromise(event);
+ }
+ /**
+ * @inheritDoc
+ */
+ eventFromMessage(message3, level = "info", hint) {
+ return resolvedSyncPromise(
+ eventFromMessage$1(this._options.stackParser, message3, level, hint, this._options.attachStacktrace)
+ );
+ }
+ /**
+ * @inheritDoc
+ */
+ captureException(exception, hint, scope) {
+ if (this._options.autoSessionTracking && this._sessionFlusher) {
+ const requestSession = getIsolationScope().getRequestSession();
+ if (requestSession && requestSession.status === "ok") {
+ requestSession.status = "errored";
}
}
- const res = (
- // local registration
- // check instance[type] first which is resolved for options API
- resolve(instance[type] || Component[type], name2) || // global registration
- resolve(instance.appContext[type], name2)
- );
- if (!res && maybeSelfReference) {
- return Component;
+ return super.captureException(exception, hint, scope);
+ }
+ /**
+ * @inheritDoc
+ */
+ captureEvent(event, hint, scope) {
+ if (this._options.autoSessionTracking && this._sessionFlusher) {
+ const eventType = event.type || "exception";
+ const isException = eventType === "exception" && event.exception && event.exception.values && event.exception.values.length > 0;
+ if (isException) {
+ const requestSession = getIsolationScope().getRequestSession();
+ if (requestSession && requestSession.status === "ok") {
+ requestSession.status = "errored";
+ }
+ }
}
- if (false) {
- const extra = type === COMPONENTS ? `
-If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
- warn$1$1(`Failed to resolve ${type.slice(0, -1)}: ${name2}${extra}`);
+ return super.captureEvent(event, hint, scope);
+ }
+ /**
+ *
+ * @inheritdoc
+ */
+ close(timeout) {
+ if (this._sessionFlusher) {
+ this._sessionFlusher.close();
}
- return res;
- } else if (false) {
- warn$1$1(
- `resolve${capitalize$1(type.slice(0, -1))} can only be used in render() or setup().`
+ return super.close(timeout);
+ }
+ /**
+ * Initializes an instance of SessionFlusher on the client which will aggregate and periodically flush session data.
+ *
+ * NOTICE: This method will implicitly create an interval that is periodically called.
+ * To clean up this resources, call `.close()` when you no longer intend to use the client.
+ * Not doing so will result in a memory leak.
+ */
+ initSessionFlusher() {
+ const { release, environment } = this._options;
+ if (!release) {
+ DEBUG_BUILD$6 && logger$2.warn("Cannot initialize an instance of SessionFlusher if no release is provided!");
+ } else {
+ this._sessionFlusher = new SessionFlusher(this, {
+ release,
+ environment
+ });
+ }
+ }
+ /**
+ * Create a cron monitor check in and send it to Sentry.
+ *
+ * @param checkIn An object that describes a check in.
+ * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want
+ * to create a monitor automatically when sending a check in.
+ */
+ captureCheckIn(checkIn, monitorConfig, scope) {
+ const id3 = "checkInId" in checkIn && checkIn.checkInId ? checkIn.checkInId : uuid4();
+ if (!this._isEnabled()) {
+ DEBUG_BUILD$6 && logger$2.warn("SDK not enabled, will not capture checkin.");
+ return id3;
+ }
+ const options4 = this.getOptions();
+ const { release, environment, tunnel } = options4;
+ const serializedCheckIn = {
+ check_in_id: id3,
+ monitor_slug: checkIn.monitorSlug,
+ status: checkIn.status,
+ release,
+ environment
+ };
+ if ("duration" in checkIn) {
+ serializedCheckIn.duration = checkIn.duration;
+ }
+ if (monitorConfig) {
+ serializedCheckIn.monitor_config = {
+ schedule: monitorConfig.schedule,
+ checkin_margin: monitorConfig.checkinMargin,
+ max_runtime: monitorConfig.maxRuntime,
+ timezone: monitorConfig.timezone,
+ failure_issue_threshold: monitorConfig.failureIssueThreshold,
+ recovery_threshold: monitorConfig.recoveryThreshold
+ };
+ }
+ const [dynamicSamplingContext, traceContext] = this._getTraceInfoFromScope(scope);
+ if (traceContext) {
+ serializedCheckIn.contexts = {
+ trace: traceContext
+ };
+ }
+ const envelope = createCheckInEnvelope(
+ serializedCheckIn,
+ dynamicSamplingContext,
+ this.getSdkMetadata(),
+ tunnel,
+ this.getDsn()
);
+ DEBUG_BUILD$6 && logger$2.info("Sending checkin:", checkIn.monitorSlug, checkIn.status);
+ this.sendEnvelope(envelope);
+ return id3;
+ }
+ /**
+ * Method responsible for capturing/ending a request session by calling `incrementSessionStatusCount` to increment
+ * appropriate session aggregates bucket
+ *
+ * @deprecated This method should not be used or extended. It's functionality will move into the `httpIntegration` and not be part of any public API.
+ */
+ _captureRequestSession() {
+ if (!this._sessionFlusher) {
+ DEBUG_BUILD$6 && logger$2.warn("Discarded request mode session because autoSessionTracking option was disabled");
+ } else {
+ this._sessionFlusher.incrementSessionStatusCount();
+ }
+ }
+ /**
+ * @inheritDoc
+ */
+ _prepareEvent(event, hint, scope, isolationScope) {
+ if (this._options.platform) {
+ event.platform = event.platform || this._options.platform;
+ }
+ if (this._options.runtime) {
+ event.contexts = {
+ ...event.contexts,
+ runtime: (event.contexts || {}).runtime || this._options.runtime
+ };
+ }
+ if (this._options.serverName) {
+ event.server_name = event.server_name || this._options.serverName;
+ }
+ return super._prepareEvent(event, hint, scope, isolationScope);
+ }
+ /** Extract trace information from scope */
+ _getTraceInfoFromScope(scope) {
+ if (!scope) {
+ return [void 0, void 0];
+ }
+ const span = _getSpanForScope(scope);
+ const traceContext = span ? spanToTraceContext(span) : getTraceContextFromScope(scope);
+ const dynamicSamplingContext = span ? getDynamicSamplingContextFromSpan(span) : getDynamicSamplingContextFromScope(this, scope);
+ return [dynamicSamplingContext, traceContext];
}
}
-__name(resolveAsset, "resolveAsset");
-function resolve(registry, name2) {
- return registry && (registry[name2] || registry[camelize$1(name2)] || registry[capitalize$1(camelize$1(name2))]);
-}
-__name(resolve, "resolve");
-const isSuspense = /* @__PURE__ */ __name((type) => type.__isSuspense, "isSuspense");
-let suspenseId = 0;
-const SuspenseImpl = {
- name: "Suspense",
- // In order to make Suspense tree-shakable, we need to avoid importing it
- // directly in the renderer. The renderer checks for the __isSuspense flag
- // on a vnode's type and calls the `process` method, passing in renderer
- // internals.
- __isSuspense: true,
- process(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
- if (n1 == null) {
- mountSuspense(
- n2,
- container,
- anchor,
- parentComponent,
- parentSuspense,
- namespace,
- slotScopeIds,
- optimized,
- rendererInternals
- );
+function initAndBind(clientClass, options4) {
+ if (options4.debug === true) {
+ if (DEBUG_BUILD$6) {
+ logger$2.enable();
} else {
- if (parentSuspense && parentSuspense.deps > 0 && !n1.suspense.isInFallback) {
- n2.suspense = n1.suspense;
- n2.suspense.vnode = n2;
- n2.el = n1.el;
- return;
- }
- patchSuspense(
- n1,
- n2,
- container,
- anchor,
- parentComponent,
- namespace,
- slotScopeIds,
- optimized,
- rendererInternals
- );
+ consoleSandbox(() => {
+ console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.");
+ });
}
- },
- hydrate: hydrateSuspense,
- normalize: normalizeSuspenseChildren
-};
-const Suspense = SuspenseImpl;
-function triggerEvent(vnode, name2) {
- const eventListener = vnode.props && vnode.props[name2];
- if (isFunction$4(eventListener)) {
- eventListener();
}
+ const scope = getCurrentScope$1();
+ scope.update(options4.initialScope);
+ const client = new clientClass(options4);
+ setCurrentClient(client);
+ client.init();
+ return client;
}
-__name(triggerEvent, "triggerEvent");
-function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
- const {
- p: patch2,
- o: { createElement: createElement2 }
- } = rendererInternals;
- const hiddenContainer = createElement2("div");
- const suspense = vnode.suspense = createSuspenseBoundary(
- vnode,
- parentSuspense,
- parentComponent,
- container,
- hiddenContainer,
- anchor,
- namespace,
- slotScopeIds,
- optimized,
- rendererInternals
- );
- patch2(
- null,
- suspense.pendingBranch = vnode.ssContent,
- hiddenContainer,
- null,
- parentComponent,
- suspense,
- namespace,
- slotScopeIds
- );
- if (suspense.deps > 0) {
- triggerEvent(vnode, "onPending");
- triggerEvent(vnode, "onFallback");
- patch2(
- null,
- vnode.ssFallback,
- container,
- anchor,
- parentComponent,
+__name(initAndBind, "initAndBind");
+function setCurrentClient(client) {
+ getCurrentScope$1().setClient(client);
+}
+__name(setCurrentClient, "setCurrentClient");
+function makePromiseBuffer(limit) {
+ const buffer2 = [];
+ function isReady() {
+ return limit === void 0 || buffer2.length < limit;
+ }
+ __name(isReady, "isReady");
+ function remove4(task) {
+ return buffer2.splice(buffer2.indexOf(task), 1)[0] || Promise.resolve(void 0);
+ }
+ __name(remove4, "remove");
+ function add3(taskProducer) {
+ if (!isReady()) {
+ return rejectedSyncPromise(new SentryError("Not adding Promise because buffer limit was reached."));
+ }
+ const task = taskProducer();
+ if (buffer2.indexOf(task) === -1) {
+ buffer2.push(task);
+ }
+ void task.then(() => remove4(task)).then(
null,
- // fallback tree will not have suspense context
- namespace,
- slotScopeIds
+ () => remove4(task).then(null, () => {
+ })
);
- setActiveBranch(suspense, vnode.ssFallback);
- } else {
- suspense.resolve(false, true);
+ return task;
+ }
+ __name(add3, "add");
+ function drain(timeout) {
+ return new SyncPromise((resolve2, reject3) => {
+ let counter = buffer2.length;
+ if (!counter) {
+ return resolve2(true);
+ }
+ const capturedSetTimeout = setTimeout(() => {
+ if (timeout && timeout > 0) {
+ resolve2(false);
+ }
+ }, timeout);
+ buffer2.forEach((item3) => {
+ void resolvedSyncPromise(item3).then(() => {
+ if (!--counter) {
+ clearTimeout(capturedSetTimeout);
+ resolve2(true);
+ }
+ }, reject3);
+ });
+ });
}
+ __name(drain, "drain");
+ return {
+ $: buffer2,
+ add: add3,
+ drain
+ };
}
-__name(mountSuspense, "mountSuspense");
-function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, slotScopeIds, optimized, { p: patch2, um: unmount, o: { createElement: createElement2 } }) {
- const suspense = n2.suspense = n1.suspense;
- suspense.vnode = n2;
- n2.el = n1.el;
- const newBranch = n2.ssContent;
- const newFallback = n2.ssFallback;
- const { activeBranch, pendingBranch, isInFallback, isHydrating } = suspense;
- if (pendingBranch) {
- suspense.pendingBranch = newBranch;
- if (isSameVNodeType(newBranch, pendingBranch)) {
- patch2(
- pendingBranch,
- newBranch,
- suspense.hiddenContainer,
- null,
- parentComponent,
- suspense,
- namespace,
- slotScopeIds,
- optimized
- );
- if (suspense.deps <= 0) {
- suspense.resolve();
- } else if (isInFallback) {
- if (!isHydrating) {
- patch2(
- activeBranch,
- newFallback,
- container,
- anchor,
- parentComponent,
- null,
- // fallback tree will not have suspense context
- namespace,
- slotScopeIds,
- optimized
- );
- setActiveBranch(suspense, newFallback);
+__name(makePromiseBuffer, "makePromiseBuffer");
+const DEFAULT_RETRY_AFTER = 60 * 1e3;
+function parseRetryAfterHeader(header3, now2 = Date.now()) {
+ const headerDelay = parseInt(`${header3}`, 10);
+ if (!isNaN(headerDelay)) {
+ return headerDelay * 1e3;
+ }
+ const headerDate = Date.parse(`${header3}`);
+ if (!isNaN(headerDate)) {
+ return headerDate - now2;
+ }
+ return DEFAULT_RETRY_AFTER;
+}
+__name(parseRetryAfterHeader, "parseRetryAfterHeader");
+function disabledUntil(limits, dataCategory) {
+ return limits[dataCategory] || limits.all || 0;
+}
+__name(disabledUntil, "disabledUntil");
+function isRateLimited(limits, dataCategory, now2 = Date.now()) {
+ return disabledUntil(limits, dataCategory) > now2;
+}
+__name(isRateLimited, "isRateLimited");
+function updateRateLimits(limits, { statusCode, headers }, now2 = Date.now()) {
+ const updatedRateLimits = {
+ ...limits
+ };
+ const rateLimitHeader = headers && headers["x-sentry-rate-limits"];
+ const retryAfterHeader = headers && headers["retry-after"];
+ if (rateLimitHeader) {
+ for (const limit of rateLimitHeader.trim().split(",")) {
+ const [retryAfter, categories, , , namespaces] = limit.split(":", 5);
+ const headerDelay = parseInt(retryAfter, 10);
+ const delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1e3;
+ if (!categories) {
+ updatedRateLimits.all = now2 + delay;
+ } else {
+ for (const category of categories.split(";")) {
+ if (category === "metric_bucket") {
+ if (!namespaces || namespaces.split(";").includes("custom")) {
+ updatedRateLimits[category] = now2 + delay;
+ }
+ } else {
+ updatedRateLimits[category] = now2 + delay;
+ }
}
}
- } else {
- suspense.pendingId = suspenseId++;
- if (isHydrating) {
- suspense.isHydrating = false;
- suspense.activeBranch = pendingBranch;
+ }
+ } else if (retryAfterHeader) {
+ updatedRateLimits.all = now2 + parseRetryAfterHeader(retryAfterHeader, now2);
+ } else if (statusCode === 429) {
+ updatedRateLimits.all = now2 + 60 * 1e3;
+ }
+ return updatedRateLimits;
+}
+__name(updateRateLimits, "updateRateLimits");
+const DEFAULT_TRANSPORT_BUFFER_SIZE = 64;
+function createTransport(options4, makeRequest, buffer2 = makePromiseBuffer(
+ options4.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE
+)) {
+ let rateLimits = {};
+ const flush2 = /* @__PURE__ */ __name((timeout) => buffer2.drain(timeout), "flush");
+ function send(envelope) {
+ const filteredEnvelopeItems = [];
+ forEachEnvelopeItem(envelope, (item3, type) => {
+ const dataCategory = envelopeItemTypeToDataCategory(type);
+ if (isRateLimited(rateLimits, dataCategory)) {
+ const event = getEventForEnvelopeItem(item3, type);
+ options4.recordDroppedEvent("ratelimit_backoff", dataCategory, event);
} else {
- unmount(pendingBranch, parentComponent, suspense);
+ filteredEnvelopeItems.push(item3);
}
- suspense.deps = 0;
- suspense.effects.length = 0;
- suspense.hiddenContainer = createElement2("div");
- if (isInFallback) {
- patch2(
- null,
- newBranch,
- suspense.hiddenContainer,
- null,
- parentComponent,
- suspense,
- namespace,
- slotScopeIds,
- optimized
- );
- if (suspense.deps <= 0) {
- suspense.resolve();
+ });
+ if (filteredEnvelopeItems.length === 0) {
+ return resolvedSyncPromise({});
+ }
+ const filteredEnvelope = createEnvelope(envelope[0], filteredEnvelopeItems);
+ const recordEnvelopeLoss = /* @__PURE__ */ __name((reason) => {
+ forEachEnvelopeItem(filteredEnvelope, (item3, type) => {
+ const event = getEventForEnvelopeItem(item3, type);
+ options4.recordDroppedEvent(reason, envelopeItemTypeToDataCategory(type), event);
+ });
+ }, "recordEnvelopeLoss");
+ const requestTask = /* @__PURE__ */ __name(() => makeRequest({ body: serializeEnvelope(filteredEnvelope) }).then(
+ (response) => {
+ if (response.statusCode !== void 0 && (response.statusCode < 200 || response.statusCode >= 300)) {
+ DEBUG_BUILD$6 && logger$2.warn(`Sentry responded with status code ${response.statusCode} to sent event.`);
+ }
+ rateLimits = updateRateLimits(rateLimits, response);
+ return response;
+ },
+ (error2) => {
+ recordEnvelopeLoss("network_error");
+ throw error2;
+ }
+ ), "requestTask");
+ return buffer2.add(requestTask).then(
+ (result) => result,
+ (error2) => {
+ if (error2 instanceof SentryError) {
+ DEBUG_BUILD$6 && logger$2.error("Skipped sending event because buffer is full.");
+ recordEnvelopeLoss("queue_overflow");
+ return resolvedSyncPromise({});
} else {
- patch2(
- activeBranch,
- newFallback,
- container,
- anchor,
- parentComponent,
- null,
- // fallback tree will not have suspense context
- namespace,
- slotScopeIds,
- optimized
- );
- setActiveBranch(suspense, newFallback);
+ throw error2;
}
- } else if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
- patch2(
- activeBranch,
- newBranch,
- container,
- anchor,
- parentComponent,
- suspense,
- namespace,
- slotScopeIds,
- optimized
- );
- suspense.resolve(true);
- } else {
- patch2(
- null,
- newBranch,
- suspense.hiddenContainer,
- null,
- parentComponent,
- suspense,
- namespace,
- slotScopeIds,
- optimized
- );
- if (suspense.deps <= 0) {
- suspense.resolve();
+ }
+ );
+ }
+ __name(send, "send");
+ return {
+ send,
+ flush: flush2
+ };
+}
+__name(createTransport, "createTransport");
+function getEventForEnvelopeItem(item3, type) {
+ if (type !== "event" && type !== "transaction") {
+ return void 0;
+ }
+ return Array.isArray(item3) ? item3[1] : void 0;
+}
+__name(getEventForEnvelopeItem, "getEventForEnvelopeItem");
+const MIN_DELAY = 100;
+const START_DELAY = 5e3;
+const MAX_DELAY = 36e5;
+function makeOfflineTransport(createTransport2) {
+ function log2(...args) {
+ DEBUG_BUILD$6 && logger$2.info("[Offline]:", ...args);
+ }
+ __name(log2, "log");
+ return (options4) => {
+ const transport = createTransport2(options4);
+ if (!options4.createStore) {
+ throw new Error("No `createStore` function was provided");
+ }
+ const store = options4.createStore(options4);
+ let retryDelay = START_DELAY;
+ let flushTimer;
+ function shouldQueue(env, error2, retryDelay2) {
+ if (envelopeContainsItemType(env, ["client_report"])) {
+ return false;
+ }
+ if (options4.shouldStore) {
+ return options4.shouldStore(env, error2, retryDelay2);
+ }
+ return true;
+ }
+ __name(shouldQueue, "shouldQueue");
+ function flushIn(delay) {
+ if (flushTimer) {
+ clearTimeout(flushTimer);
+ }
+ flushTimer = setTimeout(async () => {
+ flushTimer = void 0;
+ const found2 = await store.shift();
+ if (found2) {
+ log2("Attempting to send previously queued event");
+ found2[0].sent_at = (/* @__PURE__ */ new Date()).toISOString();
+ void send(found2, true).catch((e2) => {
+ log2("Failed to retry sending", e2);
+ });
}
+ }, delay);
+ if (typeof flushTimer !== "number" && flushTimer.unref) {
+ flushTimer.unref();
}
}
- } else {
- if (activeBranch && isSameVNodeType(newBranch, activeBranch)) {
- patch2(
- activeBranch,
- newBranch,
- container,
- anchor,
- parentComponent,
- suspense,
- namespace,
- slotScopeIds,
- optimized
- );
- setActiveBranch(suspense, newBranch);
- } else {
- triggerEvent(n2, "onPending");
- suspense.pendingBranch = newBranch;
- if (newBranch.shapeFlag & 512) {
- suspense.pendingId = newBranch.component.suspenseId;
- } else {
- suspense.pendingId = suspenseId++;
+ __name(flushIn, "flushIn");
+ function flushWithBackOff() {
+ if (flushTimer) {
+ return;
}
- patch2(
- null,
- newBranch,
- suspense.hiddenContainer,
- null,
- parentComponent,
- suspense,
- namespace,
- slotScopeIds,
- optimized
- );
- if (suspense.deps <= 0) {
- suspense.resolve();
- } else {
- const { timeout, pendingId } = suspense;
- if (timeout > 0) {
- setTimeout(() => {
- if (suspense.pendingId === pendingId) {
- suspense.fallback(newFallback);
- }
- }, timeout);
- } else if (timeout === 0) {
- suspense.fallback(newFallback);
+ flushIn(retryDelay);
+ retryDelay = Math.min(retryDelay * 2, MAX_DELAY);
+ }
+ __name(flushWithBackOff, "flushWithBackOff");
+ async function send(envelope, isRetry = false) {
+ if (!isRetry && envelopeContainsItemType(envelope, ["replay_event", "replay_recording"])) {
+ await store.push(envelope);
+ flushIn(MIN_DELAY);
+ return {};
+ }
+ try {
+ const result = await transport.send(envelope);
+ let delay = MIN_DELAY;
+ if (result) {
+ if (result.headers && result.headers["retry-after"]) {
+ delay = parseRetryAfterHeader(result.headers["retry-after"]);
+ } else if (result.headers && result.headers["x-sentry-rate-limits"]) {
+ delay = 6e4;
+ } else if ((result.statusCode || 0) >= 400) {
+ return result;
+ }
+ }
+ flushIn(delay);
+ retryDelay = START_DELAY;
+ return result;
+ } catch (e2) {
+ if (await shouldQueue(envelope, e2, retryDelay)) {
+ if (isRetry) {
+ await store.unshift(envelope);
+ } else {
+ await store.push(envelope);
+ }
+ flushWithBackOff();
+ log2("Error sending. Event queued.", e2);
+ return {};
+ } else {
+ throw e2;
}
}
}
- }
+ __name(send, "send");
+ if (options4.flushAtStartup) {
+ flushWithBackOff();
+ }
+ return {
+ send,
+ flush: /* @__PURE__ */ __name((t2) => transport.flush(t2), "flush")
+ };
+ };
}
-__name(patchSuspense, "patchSuspense");
-let hasWarned$1 = false;
-function createSuspenseBoundary(vnode, parentSuspense, parentComponent, container, hiddenContainer, anchor, namespace, slotScopeIds, optimized, rendererInternals, isHydrating = false) {
- if (false) {
- hasWarned$1 = true;
- console[console.info ? "info" : "log"](
- ` is an experimental feature and its API will likely change.`
- );
- }
- const {
- p: patch2,
- m: move,
- um: unmount,
- n: next2,
- o: { parentNode: parentNode2, remove: remove22 }
- } = rendererInternals;
- let parentSuspenseId;
- const isSuspensible = isVNodeSuspensible(vnode);
- if (isSuspensible) {
- if (parentSuspense && parentSuspense.pendingBranch) {
- parentSuspenseId = parentSuspense.pendingId;
- parentSuspense.deps++;
+__name(makeOfflineTransport, "makeOfflineTransport");
+function eventFromEnvelope(env, types) {
+ let event;
+ forEachEnvelopeItem(env, (item3, type) => {
+ if (types.includes(type)) {
+ event = Array.isArray(item3) ? item3[1] : void 0;
+ }
+ return !!event;
+ });
+ return event;
+}
+__name(eventFromEnvelope, "eventFromEnvelope");
+function makeOverrideReleaseTransport(createTransport2, release) {
+ return (options4) => {
+ const transport = createTransport2(options4);
+ return {
+ ...transport,
+ send: /* @__PURE__ */ __name(async (envelope) => {
+ const event = eventFromEnvelope(envelope, ["event", "transaction", "profile", "replay_event"]);
+ if (event) {
+ event.release = release;
+ }
+ return transport.send(envelope);
+ }, "send")
+ };
+ };
+}
+__name(makeOverrideReleaseTransport, "makeOverrideReleaseTransport");
+function overrideDsn(envelope, dsn) {
+ return createEnvelope(
+ dsn ? {
+ ...envelope[0],
+ dsn
+ } : envelope[0],
+ envelope[1]
+ );
+}
+__name(overrideDsn, "overrideDsn");
+function makeMultiplexedTransport(createTransport2, matcher) {
+ return (options4) => {
+ const fallbackTransport = createTransport2(options4);
+ const otherTransports = /* @__PURE__ */ new Map();
+ function getTransport(dsn, release) {
+ const key = release ? `${dsn}:${release}` : dsn;
+ let transport = otherTransports.get(key);
+ if (!transport) {
+ const validatedDsn = dsnFromString(dsn);
+ if (!validatedDsn) {
+ return void 0;
+ }
+ const url = getEnvelopeEndpointWithUrlEncodedAuth(validatedDsn, options4.tunnel);
+ transport = release ? makeOverrideReleaseTransport(createTransport2, release)({ ...options4, url }) : createTransport2({ ...options4, url });
+ otherTransports.set(key, transport);
+ }
+ return [dsn, transport];
+ }
+ __name(getTransport, "getTransport");
+ async function send(envelope) {
+ function getEvent(types) {
+ const eventTypes = types && types.length ? types : ["event"];
+ return eventFromEnvelope(envelope, eventTypes);
+ }
+ __name(getEvent, "getEvent");
+ const transports = matcher({ envelope, getEvent }).map((result) => {
+ if (typeof result === "string") {
+ return getTransport(result, void 0);
+ } else {
+ return getTransport(result.dsn, result.release);
+ }
+ }).filter((t2) => !!t2);
+ const transportsWithFallback = transports.length ? transports : [["", fallbackTransport]];
+ const results = await Promise.all(
+ transportsWithFallback.map(([dsn, transport]) => transport.send(overrideDsn(envelope, dsn)))
+ );
+ return results[0];
}
+ __name(send, "send");
+ async function flush2(timeout) {
+ const allTransports = [...otherTransports.values(), fallbackTransport];
+ const results = await Promise.all(allTransports.map((transport) => transport.flush(timeout)));
+ return results.every((r2) => r2);
+ }
+ __name(flush2, "flush");
+ return {
+ send,
+ flush: flush2
+ };
+ };
+}
+__name(makeMultiplexedTransport, "makeMultiplexedTransport");
+function isSentryRequestUrl(url, client) {
+ const dsn = client && client.getDsn();
+ const tunnel = client && client.getOptions().tunnel;
+ return checkDsn(url, dsn) || checkTunnel(url, tunnel);
+}
+__name(isSentryRequestUrl, "isSentryRequestUrl");
+function checkTunnel(url, tunnel) {
+ if (!tunnel) {
+ return false;
}
- const timeout = vnode.props ? toNumber(vnode.props.timeout) : void 0;
- if (false) {
- assertNumber(timeout, `Suspense timeout`);
+ return removeTrailingSlash$1(url) === removeTrailingSlash$1(tunnel);
+}
+__name(checkTunnel, "checkTunnel");
+function checkDsn(url, dsn) {
+ return dsn ? url.includes(dsn.host) : false;
+}
+__name(checkDsn, "checkDsn");
+function removeTrailingSlash$1(str) {
+ return str[str.length - 1] === "/" ? str.slice(0, -1) : str;
+}
+__name(removeTrailingSlash$1, "removeTrailingSlash$1");
+function parameterize(strings, ...values) {
+ const formatted = new String(String.raw(strings, ...values));
+ formatted.__sentry_template_string__ = strings.join("\0").replace(/%/g, "%%").replace(/\0/g, "%s");
+ formatted.__sentry_template_values__ = values;
+ return formatted;
+}
+__name(parameterize, "parameterize");
+function applySdkMetadata(options4, name2, names = [name2], source = "npm") {
+ const metadata = options4._metadata || {};
+ if (!metadata.sdk) {
+ metadata.sdk = {
+ name: `sentry.javascript.${name2}`,
+ packages: names.map((name3) => ({
+ name: `${source}:@sentry/${name3}`,
+ version: SDK_VERSION
+ })),
+ version: SDK_VERSION
+ };
}
- const initialAnchor = anchor;
- const suspense = {
- vnode,
- parent: parentSuspense,
- parentComponent,
- namespace,
- container,
- hiddenContainer,
- deps: 0,
- pendingId: suspenseId++,
- timeout: typeof timeout === "number" ? timeout : -1,
- activeBranch: null,
- pendingBranch: null,
- isInFallback: !isHydrating,
- isHydrating,
- isUnmounted: false,
- effects: [],
- resolve(resume = false, sync = false) {
- if (false) {
- if (!resume && !suspense.pendingBranch) {
- throw new Error(
- `suspense.resolve() is called without a pending branch.`
- );
- }
- if (suspense.isUnmounted) {
- throw new Error(
- `suspense.resolve() is called on an already unmounted suspense boundary.`
- );
- }
- }
- const {
- vnode: vnode2,
- activeBranch,
- pendingBranch,
- pendingId,
- effects,
- parentComponent: parentComponent2,
- container: container2
- } = suspense;
- let delayEnter = false;
- if (suspense.isHydrating) {
- suspense.isHydrating = false;
- } else if (!resume) {
- delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
- if (delayEnter) {
- activeBranch.transition.afterLeave = () => {
- if (pendingId === suspense.pendingId) {
- move(
- pendingBranch,
- container2,
- anchor === initialAnchor ? next2(activeBranch) : anchor,
- 0
- );
- queuePostFlushCb(effects);
- }
- };
- }
- if (activeBranch) {
- if (parentNode2(activeBranch.el) !== suspense.hiddenContainer) {
- anchor = next2(activeBranch);
- }
- unmount(activeBranch, parentComponent2, suspense, true);
- }
- if (!delayEnter) {
- move(pendingBranch, container2, anchor, 0);
- }
- }
- setActiveBranch(suspense, pendingBranch);
- suspense.pendingBranch = null;
- suspense.isInFallback = false;
- let parent = suspense.parent;
- let hasUnresolvedAncestor = false;
- while (parent) {
- if (parent.pendingBranch) {
- parent.effects.push(...effects);
- hasUnresolvedAncestor = true;
- break;
- }
- parent = parent.parent;
- }
- if (!hasUnresolvedAncestor && !delayEnter) {
- queuePostFlushCb(effects);
- }
- suspense.effects = [];
- if (isSuspensible) {
- if (parentSuspense && parentSuspense.pendingBranch && parentSuspenseId === parentSuspense.pendingId) {
- parentSuspense.deps--;
- if (parentSuspense.deps === 0 && !sync) {
- parentSuspense.resolve();
- }
- }
- }
- triggerEvent(vnode2, "onResolve");
- },
- fallback(fallbackVNode) {
- if (!suspense.pendingBranch) {
- return;
- }
- const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
- triggerEvent(vnode2, "onFallback");
- const anchor2 = next2(activeBranch);
- const mountFallback = /* @__PURE__ */ __name(() => {
- if (!suspense.isInFallback) {
- return;
- }
- patch2(
- null,
- fallbackVNode,
- container2,
- anchor2,
- parentComponent2,
- null,
- // fallback tree will not have suspense context
- namespace2,
- slotScopeIds,
- optimized
- );
- setActiveBranch(suspense, fallbackVNode);
- }, "mountFallback");
- const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
- if (delayEnter) {
- activeBranch.transition.afterLeave = mountFallback;
- }
- suspense.isInFallback = true;
- unmount(
- activeBranch,
- parentComponent2,
- null,
- // no suspense so unmount hooks fire now
- true
- // shouldRemove
- );
- if (!delayEnter) {
- mountFallback();
- }
- },
- move(container2, anchor2, type) {
- suspense.activeBranch && move(suspense.activeBranch, container2, anchor2, type);
- suspense.container = container2;
- },
- next() {
- return suspense.activeBranch && next2(suspense.activeBranch);
- },
- registerDep(instance, setupRenderEffect, optimized2) {
- const isInPendingSuspense = !!suspense.pendingBranch;
- if (isInPendingSuspense) {
- suspense.deps++;
+ options4._metadata = metadata;
+}
+__name(applySdkMetadata, "applySdkMetadata");
+function getTraceData(options4 = {}) {
+ const client = getClient();
+ if (!isEnabled() || !client) {
+ return {};
+ }
+ const carrier = getMainCarrier();
+ const acs = getAsyncContextStrategy(carrier);
+ if (acs.getTraceData) {
+ return acs.getTraceData(options4);
+ }
+ const scope = getCurrentScope$1();
+ const span = options4.span || getActiveSpan();
+ const sentryTrace = span ? spanToTraceHeader(span) : scopeToTraceHeader(scope);
+ const dsc = span ? getDynamicSamplingContextFromSpan(span) : getDynamicSamplingContextFromScope(client, scope);
+ const baggage = dynamicSamplingContextToSentryBaggageHeader(dsc);
+ const isValidSentryTraceHeader = TRACEPARENT_REGEXP.test(sentryTrace);
+ if (!isValidSentryTraceHeader) {
+ logger$2.warn("Invalid sentry-trace data. Cannot generate trace data");
+ return {};
+ }
+ return {
+ "sentry-trace": sentryTrace,
+ baggage
+ };
+}
+__name(getTraceData, "getTraceData");
+function scopeToTraceHeader(scope) {
+ const { traceId, sampled, spanId } = scope.getPropagationContext();
+ return generateSentryTraceHeader(traceId, spanId, sampled);
+}
+__name(scopeToTraceHeader, "scopeToTraceHeader");
+function getTraceMetaTags() {
+ return Object.entries(getTraceData()).map(([key, value4]) => ``).join("\n");
+}
+__name(getTraceMetaTags, "getTraceMetaTags");
+const DEFAULT_BREADCRUMBS = 100;
+function addBreadcrumb(breadcrumb, hint) {
+ const client = getClient();
+ const isolationScope = getIsolationScope();
+ if (!client) return;
+ const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } = client.getOptions();
+ if (maxBreadcrumbs <= 0) return;
+ const timestamp2 = dateTimestampInSeconds();
+ const mergedBreadcrumb = { timestamp: timestamp2, ...breadcrumb };
+ const finalBreadcrumb = beforeBreadcrumb ? consoleSandbox(() => beforeBreadcrumb(mergedBreadcrumb, hint)) : mergedBreadcrumb;
+ if (finalBreadcrumb === null) return;
+ if (client.emit) {
+ client.emit("beforeAddBreadcrumb", finalBreadcrumb, hint);
+ }
+ isolationScope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs);
+}
+__name(addBreadcrumb, "addBreadcrumb");
+let originalFunctionToString;
+const INTEGRATION_NAME$l = "FunctionToString";
+const SETUP_CLIENTS$1 = /* @__PURE__ */ new WeakMap();
+const _functionToStringIntegration = /* @__PURE__ */ __name(() => {
+ return {
+ name: INTEGRATION_NAME$l,
+ setupOnce() {
+ originalFunctionToString = Function.prototype.toString;
+ try {
+ Function.prototype.toString = function(...args) {
+ const originalFunction = getOriginalFunction(this);
+ const context = SETUP_CLIENTS$1.has(getClient()) && originalFunction !== void 0 ? originalFunction : this;
+ return originalFunctionToString.apply(context, args);
+ };
+ } catch (e2) {
}
- const hydratedEl = instance.vnode.el;
- instance.asyncDep.catch((err) => {
- handleError(err, instance, 0);
- }).then((asyncSetupResult) => {
- if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
- return;
- }
- instance.asyncResolved = true;
- const { vnode: vnode2 } = instance;
- if (false) {
- pushWarningContext(vnode2);
- }
- handleSetupResult(instance, asyncSetupResult, false);
- if (hydratedEl) {
- vnode2.el = hydratedEl;
- }
- const placeholder = !hydratedEl && instance.subTree.el;
- setupRenderEffect(
- instance,
- vnode2,
- // component may have been moved before resolve.
- // if this is not a hydration, instance.subTree will be the comment
- // placeholder.
- parentNode2(hydratedEl || instance.subTree.el),
- // anchor will not be used if this is hydration, so only need to
- // consider the comment placeholder case.
- hydratedEl ? null : next2(instance.subTree),
- suspense,
- namespace,
- optimized2
- );
- if (placeholder) {
- remove22(placeholder);
- }
- updateHOCHostEl(instance, vnode2.el);
- if (false) {
- popWarningContext();
- }
- if (isInPendingSuspense && --suspense.deps === 0) {
- suspense.resolve();
- }
- });
},
- unmount(parentSuspense2, doRemove) {
- suspense.isUnmounted = true;
- if (suspense.activeBranch) {
- unmount(
- suspense.activeBranch,
- parentComponent,
- parentSuspense2,
- doRemove
- );
- }
- if (suspense.pendingBranch) {
- unmount(
- suspense.pendingBranch,
- parentComponent,
- parentSuspense2,
- doRemove
- );
- }
+ setup(client) {
+ SETUP_CLIENTS$1.set(client, true);
}
};
- return suspense;
+}, "_functionToStringIntegration");
+const functionToStringIntegration = defineIntegration(_functionToStringIntegration);
+const DEFAULT_IGNORE_ERRORS = [
+ /^Script error\.?$/,
+ /^Javascript error: Script error\.? on line 0$/,
+ /^ResizeObserver loop completed with undelivered notifications.$/,
+ // The browser logs this when a ResizeObserver handler takes a bit longer. Usually this is not an actual issue though. It indicates slowness.
+ /^Cannot redefine property: googletag$/,
+ // This is thrown when google tag manager is used in combination with an ad blocker
+ "undefined is not an object (evaluating 'a.L')",
+ // Random error that happens but not actionable or noticeable to end-users.
+ `can't redefine non-configurable property "solana"`,
+ // Probably a browser extension or custom browser (Brave) throwing this error
+ "vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)",
+ // Error thrown by GTM, seemingly not affecting end-users
+ "Can't find variable: _AutofillCallbackHandler",
+ // Unactionable error in instagram webview https://developers.facebook.com/community/threads/320013549791141/
+ /^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/
+ // unactionable error from CEFSharp, a .NET library that embeds chromium in .NET apps
+];
+const INTEGRATION_NAME$k = "InboundFilters";
+const _inboundFiltersIntegration = /* @__PURE__ */ __name((options4 = {}) => {
+ return {
+ name: INTEGRATION_NAME$k,
+ processEvent(event, _hint, client) {
+ const clientOptions = client.getOptions();
+ const mergedOptions = _mergeOptions(options4, clientOptions);
+ return _shouldDropEvent$1(event, mergedOptions) ? null : event;
+ }
+ };
+}, "_inboundFiltersIntegration");
+const inboundFiltersIntegration = defineIntegration(_inboundFiltersIntegration);
+function _mergeOptions(internalOptions = {}, clientOptions = {}) {
+ return {
+ allowUrls: [...internalOptions.allowUrls || [], ...clientOptions.allowUrls || []],
+ denyUrls: [...internalOptions.denyUrls || [], ...clientOptions.denyUrls || []],
+ ignoreErrors: [
+ ...internalOptions.ignoreErrors || [],
+ ...clientOptions.ignoreErrors || [],
+ ...internalOptions.disableErrorDefaults ? [] : DEFAULT_IGNORE_ERRORS
+ ],
+ ignoreTransactions: [...internalOptions.ignoreTransactions || [], ...clientOptions.ignoreTransactions || []],
+ ignoreInternal: internalOptions.ignoreInternal !== void 0 ? internalOptions.ignoreInternal : true
+ };
}
-__name(createSuspenseBoundary, "createSuspenseBoundary");
-function hydrateSuspense(node3, vnode, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals, hydrateNode) {
- const suspense = vnode.suspense = createSuspenseBoundary(
- vnode,
- parentSuspense,
- parentComponent,
- node3.parentNode,
- // eslint-disable-next-line no-restricted-globals
- document.createElement("div"),
- null,
- namespace,
- slotScopeIds,
- optimized,
- rendererInternals,
- true
- );
- const result = hydrateNode(
- node3,
- suspense.pendingBranch = vnode.ssContent,
- parentComponent,
- suspense,
- slotScopeIds,
- optimized
- );
- if (suspense.deps === 0) {
- suspense.resolve(false, true);
+__name(_mergeOptions, "_mergeOptions");
+function _shouldDropEvent$1(event, options4) {
+ if (options4.ignoreInternal && _isSentryError(event)) {
+ DEBUG_BUILD$6 && logger$2.warn(`Event dropped due to being internal Sentry Error.
+Event: ${getEventDescription(event)}`);
+ return true;
}
- return result;
+ if (_isIgnoredError(event, options4.ignoreErrors)) {
+ DEBUG_BUILD$6 && logger$2.warn(
+ `Event dropped due to being matched by \`ignoreErrors\` option.
+Event: ${getEventDescription(event)}`
+ );
+ return true;
+ }
+ if (_isUselessError(event)) {
+ DEBUG_BUILD$6 && logger$2.warn(
+ `Event dropped due to not having an error message, error type or stacktrace.
+Event: ${getEventDescription(
+ event
+ )}`
+ );
+ return true;
+ }
+ if (_isIgnoredTransaction(event, options4.ignoreTransactions)) {
+ DEBUG_BUILD$6 && logger$2.warn(
+ `Event dropped due to being matched by \`ignoreTransactions\` option.
+Event: ${getEventDescription(event)}`
+ );
+ return true;
+ }
+ if (_isDeniedUrl(event, options4.denyUrls)) {
+ DEBUG_BUILD$6 && logger$2.warn(
+ `Event dropped due to being matched by \`denyUrls\` option.
+Event: ${getEventDescription(
+ event
+ )}.
+Url: ${_getEventFilterUrl(event)}`
+ );
+ return true;
+ }
+ if (!_isAllowedUrl(event, options4.allowUrls)) {
+ DEBUG_BUILD$6 && logger$2.warn(
+ `Event dropped due to not being matched by \`allowUrls\` option.
+Event: ${getEventDescription(
+ event
+ )}.
+Url: ${_getEventFilterUrl(event)}`
+ );
+ return true;
+ }
+ return false;
}
-__name(hydrateSuspense, "hydrateSuspense");
-function normalizeSuspenseChildren(vnode) {
- const { shapeFlag, children } = vnode;
- const isSlotChildren = shapeFlag & 32;
- vnode.ssContent = normalizeSuspenseSlot(
- isSlotChildren ? children.default : children
- );
- vnode.ssFallback = isSlotChildren ? normalizeSuspenseSlot(children.fallback) : createVNode(Comment);
+__name(_shouldDropEvent$1, "_shouldDropEvent$1");
+function _isIgnoredError(event, ignoreErrors) {
+ if (event.type || !ignoreErrors || !ignoreErrors.length) {
+ return false;
+ }
+ return _getPossibleEventMessages(event).some((message3) => stringMatchesSomePattern(message3, ignoreErrors));
}
-__name(normalizeSuspenseChildren, "normalizeSuspenseChildren");
-function normalizeSuspenseSlot(s) {
- let block3;
- if (isFunction$4(s)) {
- const trackBlock = isBlockTreeEnabled && s._c;
- if (trackBlock) {
- s._d = false;
- openBlock();
- }
- s = s();
- if (trackBlock) {
- s._d = true;
- block3 = currentBlock;
- closeBlock();
- }
+__name(_isIgnoredError, "_isIgnoredError");
+function _isIgnoredTransaction(event, ignoreTransactions) {
+ if (event.type !== "transaction" || !ignoreTransactions || !ignoreTransactions.length) {
+ return false;
}
- if (isArray$4(s)) {
- const singleChild = filterSingleRoot(s);
- if (false) {
- warn$1$1(` slots expect a single root node.`);
- }
- s = singleChild;
+ const name2 = event.transaction;
+ return name2 ? stringMatchesSomePattern(name2, ignoreTransactions) : false;
+}
+__name(_isIgnoredTransaction, "_isIgnoredTransaction");
+function _isDeniedUrl(event, denyUrls) {
+ if (!denyUrls || !denyUrls.length) {
+ return false;
}
- s = normalizeVNode(s);
- if (block3 && !s.dynamicChildren) {
- s.dynamicChildren = block3.filter((c) => c !== s);
+ const url = _getEventFilterUrl(event);
+ return !url ? false : stringMatchesSomePattern(url, denyUrls);
+}
+__name(_isDeniedUrl, "_isDeniedUrl");
+function _isAllowedUrl(event, allowUrls) {
+ if (!allowUrls || !allowUrls.length) {
+ return true;
}
- return s;
+ const url = _getEventFilterUrl(event);
+ return !url ? true : stringMatchesSomePattern(url, allowUrls);
}
-__name(normalizeSuspenseSlot, "normalizeSuspenseSlot");
-function queueEffectWithSuspense(fn, suspense) {
- if (suspense && suspense.pendingBranch) {
- if (isArray$4(fn)) {
- suspense.effects.push(...fn);
- } else {
- suspense.effects.push(fn);
+__name(_isAllowedUrl, "_isAllowedUrl");
+function _getPossibleEventMessages(event) {
+ const possibleMessages = [];
+ if (event.message) {
+ possibleMessages.push(event.message);
+ }
+ let lastException;
+ try {
+ lastException = event.exception.values[event.exception.values.length - 1];
+ } catch (e2) {
+ }
+ if (lastException) {
+ if (lastException.value) {
+ possibleMessages.push(lastException.value);
+ if (lastException.type) {
+ possibleMessages.push(`${lastException.type}: ${lastException.value}`);
+ }
}
- } else {
- queuePostFlushCb(fn);
}
+ return possibleMessages;
}
-__name(queueEffectWithSuspense, "queueEffectWithSuspense");
-function setActiveBranch(suspense, branch) {
- suspense.activeBranch = branch;
- const { vnode, parentComponent } = suspense;
- let el = branch.el;
- while (!el && branch.component) {
- branch = branch.component.subTree;
- el = branch.el;
- }
- vnode.el = el;
- if (parentComponent && parentComponent.subTree === vnode) {
- parentComponent.vnode.el = el;
- updateHOCHostEl(parentComponent, el);
+__name(_getPossibleEventMessages, "_getPossibleEventMessages");
+function _isSentryError(event) {
+ try {
+ return event.exception.values[0].type === "SentryError";
+ } catch (e2) {
}
+ return false;
}
-__name(setActiveBranch, "setActiveBranch");
-function isVNodeSuspensible(vnode) {
- const suspensible = vnode.props && vnode.props.suspensible;
- return suspensible != null && suspensible !== false;
+__name(_isSentryError, "_isSentryError");
+function _getLastValidUrl(frames = []) {
+ for (let i2 = frames.length - 1; i2 >= 0; i2--) {
+ const frame = frames[i2];
+ if (frame && frame.filename !== "" && frame.filename !== "[native code]") {
+ return frame.filename || null;
+ }
+ }
+ return null;
}
-__name(isVNodeSuspensible, "isVNodeSuspensible");
-function injectHook(type, hook, target = currentInstance, prepend2 = false) {
- if (target) {
- const hooks = target[type] || (target[type] = []);
- const wrappedHook = hook.__weh || (hook.__weh = (...args) => {
- pauseTracking();
- const reset2 = setCurrentInstance(target);
- const res = callWithAsyncErrorHandling(hook, target, type, args);
- reset2();
- resetTracking();
- return res;
- });
- if (prepend2) {
- hooks.unshift(wrappedHook);
- } else {
- hooks.push(wrappedHook);
+__name(_getLastValidUrl, "_getLastValidUrl");
+function _getEventFilterUrl(event) {
+ try {
+ let frames;
+ try {
+ frames = event.exception.values[0].stacktrace.frames;
+ } catch (e2) {
}
- return wrappedHook;
- } else if (false) {
- const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""));
- warn$1$1(
- `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`
- );
+ return frames ? _getLastValidUrl(frames) : null;
+ } catch (oO) {
+ DEBUG_BUILD$6 && logger$2.error(`Cannot extract url for event ${getEventDescription(event)}`);
+ return null;
}
}
-__name(injectHook, "injectHook");
-const createHook = /* @__PURE__ */ __name((lifecycle2) => (hook, target = currentInstance) => {
- if (!isInSSRComponentSetup || lifecycle2 === "sp") {
- injectHook(lifecycle2, (...args) => hook(...args), target);
+__name(_getEventFilterUrl, "_getEventFilterUrl");
+function _isUselessError(event) {
+ if (event.type) {
+ return false;
}
-}, "createHook");
-const onBeforeMount = createHook("bm");
-const onMounted = createHook("m");
-const onBeforeUpdate = createHook("bu");
-const onUpdated = createHook("u");
-const onBeforeUnmount = createHook("bum");
-const onUnmounted = createHook("um");
-const onServerPrefetch = createHook("sp");
-const onRenderTriggered = createHook(
- "rtg"
-);
-const onRenderTracked = createHook(
- "rtc"
-);
-function onErrorCaptured(hook, target = currentInstance) {
- injectHook("ec", hook, target);
+ if (!event.exception || !event.exception.values || event.exception.values.length === 0) {
+ return false;
+ }
+ return (
+ // No top-level message
+ !event.message && // There are no exception values that have a stacktrace, a non-generic-Error type or value
+ !event.exception.values.some((value4) => value4.stacktrace || value4.type && value4.type !== "Error" || value4.value)
+ );
}
-__name(onErrorCaptured, "onErrorCaptured");
-function validateDirectiveName(name2) {
- if (isBuiltInDirective(name2)) {
- warn$1$1("Do not use built-in directive ids as custom directive id: " + name2);
+__name(_isUselessError, "_isUselessError");
+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
+ );
}
}
-__name(validateDirectiveName, "validateDirectiveName");
-function withDirectives(vnode, directives) {
- if (currentRenderingInstance === null) {
- return vnode;
+__name(applyAggregateErrorsToEvent, "applyAggregateErrorsToEvent");
+function aggregateExceptionsFromError(exceptionFromErrorImplementation, parser, limit, error2, key, prevExceptions, exception, exceptionId) {
+ if (prevExceptions.length >= limit + 1) {
+ return prevExceptions;
+ }
+ let newExceptions = [...prevExceptions];
+ if (isInstanceOf(error2[key], Error)) {
+ applyExceptionGroupFieldsForParentException(exception, exceptionId);
+ const newException = exceptionFromErrorImplementation(parser, error2[key]);
+ const newExceptionId = newExceptions.length;
+ applyExceptionGroupFieldsForChildException(newException, key, newExceptionId, exceptionId);
+ newExceptions = aggregateExceptionsFromError(
+ exceptionFromErrorImplementation,
+ parser,
+ limit,
+ error2[key],
+ key,
+ [newException, ...newExceptions],
+ newException,
+ newExceptionId
+ );
}
- const instance = getComponentPublicInstance(currentRenderingInstance);
- const bindings = vnode.dirs || (vnode.dirs = []);
- for (let i2 = 0; i2 < directives.length; i2++) {
- let [dir, value4, arg, modifiers2 = EMPTY_OBJ] = directives[i2];
- if (dir) {
- if (isFunction$4(dir)) {
- dir = {
- mounted: dir,
- updated: dir
- };
- }
- if (dir.deep) {
- traverse(value4);
+ if (Array.isArray(error2.errors)) {
+ error2.errors.forEach((childError, i2) => {
+ if (isInstanceOf(childError, Error)) {
+ applyExceptionGroupFieldsForParentException(exception, exceptionId);
+ const newException = exceptionFromErrorImplementation(parser, childError);
+ const newExceptionId = newExceptions.length;
+ applyExceptionGroupFieldsForChildException(newException, `errors[${i2}]`, newExceptionId, exceptionId);
+ newExceptions = aggregateExceptionsFromError(
+ exceptionFromErrorImplementation,
+ parser,
+ limit,
+ childError,
+ key,
+ [newException, ...newExceptions],
+ newException,
+ newExceptionId
+ );
}
- bindings.push({
- dir,
- instance,
- value: value4,
- oldValue: void 0,
- arg,
- modifiers: modifiers2
- });
- }
+ });
}
- return vnode;
+ return newExceptions;
}
-__name(withDirectives, "withDirectives");
-function invokeDirectiveHook(vnode, prevVNode, instance, name2) {
- const bindings = vnode.dirs;
- const oldBindings = prevVNode && prevVNode.dirs;
- for (let i2 = 0; i2 < bindings.length; i2++) {
- const binding = bindings[i2];
- if (oldBindings) {
- binding.oldValue = oldBindings[i2].value;
- }
- let hook = binding.dir[name2];
- if (hook) {
- pauseTracking();
- callWithAsyncErrorHandling(hook, instance, 8, [
- vnode.el,
- binding,
- vnode,
- prevVNode
- ]);
- resetTracking();
- }
- }
+__name(aggregateExceptionsFromError, "aggregateExceptionsFromError");
+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
+ };
}
-__name(invokeDirectiveHook, "invokeDirectiveHook");
-function renderList(source, renderItem, cache2, index2) {
- let ret;
- const cached = cache2 && cache2[index2];
- if (isArray$4(source) || isString$7(source)) {
- ret = new Array(source.length);
- for (let i2 = 0, l = source.length; i2 < l; i2++) {
- ret[i2] = renderItem(source[i2], i2, void 0, cached && cached[i2]);
+__name(applyExceptionGroupFieldsForParentException, "applyExceptionGroupFieldsForParentException");
+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
+ };
+}
+__name(applyExceptionGroupFieldsForChildException, "applyExceptionGroupFieldsForChildException");
+function truncateAggregateExceptions(exceptions, maxValueLength) {
+ return exceptions.map((exception) => {
+ if (exception.value) {
+ exception.value = truncate(exception.value, maxValueLength);
}
- } else if (typeof source === "number") {
- if (false) {
- warn$1$1(`The v-for range expect an integer value but got ${source}.`);
+ return exception;
+ });
+}
+__name(truncateAggregateExceptions, "truncateAggregateExceptions");
+const DEFAULT_KEY$1 = "cause";
+const DEFAULT_LIMIT$2 = 5;
+const INTEGRATION_NAME$j = "LinkedErrors";
+const _linkedErrorsIntegration$1 = /* @__PURE__ */ __name((options4 = {}) => {
+ const limit = options4.limit || DEFAULT_LIMIT$2;
+ const key = options4.key || DEFAULT_KEY$1;
+ return {
+ name: INTEGRATION_NAME$j,
+ preprocessEvent(event, hint, client) {
+ const options5 = client.getOptions();
+ applyAggregateErrorsToEvent(
+ exceptionFromError$1,
+ options5.stackParser,
+ options5.maxValueLength,
+ key,
+ limit,
+ event,
+ hint
+ );
}
- ret = new Array(source);
- for (let i2 = 0; i2 < source; i2++) {
- ret[i2] = renderItem(i2 + 1, i2, void 0, cached && cached[i2]);
+ };
+}, "_linkedErrorsIntegration$1");
+const linkedErrorsIntegration$1 = defineIntegration(_linkedErrorsIntegration$1);
+const filenameMetadataMap = /* @__PURE__ */ new Map();
+const parsedStacks = /* @__PURE__ */ new Set();
+function ensureMetadataStacksAreParsed(parser) {
+ if (!GLOBAL_OBJ._sentryModuleMetadata) {
+ return;
+ }
+ for (const stack2 of Object.keys(GLOBAL_OBJ._sentryModuleMetadata)) {
+ const metadata = GLOBAL_OBJ._sentryModuleMetadata[stack2];
+ if (parsedStacks.has(stack2)) {
+ continue;
}
- } else if (isObject$6(source)) {
- if (source[Symbol.iterator]) {
- ret = Array.from(
- source,
- (item3, i2) => renderItem(item3, i2, void 0, cached && cached[i2])
- );
- } else {
- const keys2 = Object.keys(source);
- ret = new Array(keys2.length);
- for (let i2 = 0, l = keys2.length; i2 < l; i2++) {
- const key = keys2[i2];
- ret[i2] = renderItem(source[key], key, i2, cached && cached[i2]);
+ parsedStacks.add(stack2);
+ const frames = parser(stack2);
+ for (const frame of frames.reverse()) {
+ if (frame.filename) {
+ filenameMetadataMap.set(frame.filename, metadata);
+ break;
}
}
- } else {
- ret = [];
- }
- if (cache2) {
- cache2[index2] = ret;
}
- return ret;
}
-__name(renderList, "renderList");
-function createSlots(slots, dynamicSlots) {
- for (let i2 = 0; i2 < dynamicSlots.length; i2++) {
- const slot = dynamicSlots[i2];
- if (isArray$4(slot)) {
- for (let j = 0; j < slot.length; j++) {
- slots[slot[j].name] = slot[j].fn;
+__name(ensureMetadataStacksAreParsed, "ensureMetadataStacksAreParsed");
+function getMetadataForUrl(parser, filename) {
+ ensureMetadataStacksAreParsed(parser);
+ return filenameMetadataMap.get(filename);
+}
+__name(getMetadataForUrl, "getMetadataForUrl");
+function addMetadataToStackFrames(parser, event) {
+ try {
+ event.exception.values.forEach((exception) => {
+ if (!exception.stacktrace) {
+ return;
}
- } else if (slot) {
- slots[slot.name] = slot.key ? (...args) => {
- const res = slot.fn(...args);
- if (res) res.key = slot.key;
- return res;
- } : slot.fn;
- }
+ for (const frame of exception.stacktrace.frames || []) {
+ if (!frame.filename || frame.module_metadata) {
+ continue;
+ }
+ const metadata = getMetadataForUrl(parser, frame.filename);
+ if (metadata) {
+ frame.module_metadata = metadata;
+ }
+ }
+ });
+ } catch (_2) {
}
- return slots;
-}
-__name(createSlots, "createSlots");
-/*! #__NO_SIDE_EFFECTS__ */
-// @__NO_SIDE_EFFECTS__
-function defineComponent(options4, extraOptions) {
- return isFunction$4(options4) ? (
- // #8326: extend call and options.name access are considered side-effects
- // by Rollup, so we have to wrap it in a pure-annotated IIFE.
- /* @__PURE__ */ (() => extend$1({ name: options4.name }, extraOptions, { setup: options4 }))()
- ) : options4;
}
-__name(defineComponent, "defineComponent");
-const isAsyncWrapper = /* @__PURE__ */ __name((i2) => !!i2.type.__asyncLoader, "isAsyncWrapper");
-/*! #__NO_SIDE_EFFECTS__ */
-// @__NO_SIDE_EFFECTS__
-function defineAsyncComponent(source) {
- if (isFunction$4(source)) {
- source = { loader: source };
+__name(addMetadataToStackFrames, "addMetadataToStackFrames");
+function stripMetadataFromStackFrames(event) {
+ try {
+ event.exception.values.forEach((exception) => {
+ if (!exception.stacktrace) {
+ return;
+ }
+ for (const frame of exception.stacktrace.frames || []) {
+ delete frame.module_metadata;
+ }
+ });
+ } catch (_2) {
}
- const {
- loader,
- loadingComponent,
- errorComponent,
- delay = 200,
- timeout,
- // undefined = never times out
- suspensible = true,
- onError: userOnError
- } = source;
- let pendingRequest = null;
- let resolvedComp;
- let retries = 0;
- const retry = /* @__PURE__ */ __name(() => {
- retries++;
- pendingRequest = null;
- return load2();
- }, "retry");
- const load2 = /* @__PURE__ */ __name(() => {
- let thisRequest;
- return pendingRequest || (thisRequest = pendingRequest = loader().catch((err) => {
- err = err instanceof Error ? err : new Error(String(err));
- if (userOnError) {
- return new Promise((resolve2, reject3) => {
- const userRetry = /* @__PURE__ */ __name(() => resolve2(retry()), "userRetry");
- const userFail = /* @__PURE__ */ __name(() => reject3(err), "userFail");
- userOnError(err, userRetry, userFail, retries + 1);
+}
+__name(stripMetadataFromStackFrames, "stripMetadataFromStackFrames");
+const moduleMetadataIntegration = defineIntegration(() => {
+ return {
+ name: "ModuleMetadata",
+ setup(client) {
+ client.on("beforeEnvelope", (envelope) => {
+ forEachEnvelopeItem(envelope, (item3, type) => {
+ if (type === "event") {
+ const event = Array.isArray(item3) ? item3[1] : void 0;
+ if (event) {
+ stripMetadataFromStackFrames(event);
+ item3[1] = event;
+ }
+ }
});
- } else {
- throw err;
- }
- }).then((comp) => {
- if (thisRequest !== pendingRequest && pendingRequest) {
- return pendingRequest;
+ });
+ client.on("applyFrameMetadata", (event) => {
+ if (event.type) {
+ return;
+ }
+ const stackParser = client.getOptions().stackParser;
+ addMetadataToStackFrames(stackParser, event);
+ });
+ }
+ };
+});
+function parseCookie(str) {
+ const obj = {};
+ let index2 = 0;
+ while (index2 < str.length) {
+ const eqIdx = str.indexOf("=", index2);
+ if (eqIdx === -1) {
+ break;
+ }
+ let endIdx = str.indexOf(";", index2);
+ if (endIdx === -1) {
+ endIdx = str.length;
+ } else if (endIdx < eqIdx) {
+ index2 = str.lastIndexOf(";", eqIdx - 1) + 1;
+ continue;
+ }
+ const key = str.slice(index2, 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);
}
- if (false) {
- warn$1$1(
- `Async component loader resolved to undefined. If you are using retry(), make sure to return its return value.`
- );
+ try {
+ obj[key] = val.indexOf("%") !== -1 ? decodeURIComponent(val) : val;
+ } catch (e2) {
+ obj[key] = val;
}
- if (comp && (comp.__esModule || comp[Symbol.toStringTag] === "Module")) {
- comp = comp.default;
+ }
+ index2 = endIdx + 1;
+ }
+ return obj;
+}
+__name(parseCookie, "parseCookie");
+function parseUrl$1(url) {
+ if (!url) {
+ return {};
+ }
+ const match2 = url.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);
+ if (!match2) {
+ return {};
+ }
+ const query = match2[6] || "";
+ const fragment = match2[8] || "";
+ return {
+ host: match2[4],
+ path: match2[5],
+ protocol: match2[2],
+ search: query,
+ hash: fragment,
+ relative: match2[5] + query + fragment
+ // everything minus origin
+ };
+}
+__name(parseUrl$1, "parseUrl$1");
+function stripUrlQueryAndFragment(urlPath) {
+ return urlPath.split(/[?#]/, 1)[0];
+}
+__name(stripUrlQueryAndFragment, "stripUrlQueryAndFragment");
+function getNumberOfUrlSegments(url) {
+ return url.split(/\\?\//).filter((s2) => s2.length > 0 && s2 !== ",").length;
+}
+__name(getNumberOfUrlSegments, "getNumberOfUrlSegments");
+function getSanitizedUrlString(url) {
+ const { protocol, host, path } = url;
+ const filteredHost = host && host.replace(/^.*@/, "[filtered]:[filtered]@").replace(/(:80)$/, "").replace(/(:443)$/, "") || "";
+ return `${protocol ? `${protocol}://` : ""}${filteredHost}${path}`;
+}
+__name(getSanitizedUrlString, "getSanitizedUrlString");
+const ipHeaderNames = [
+ "X-Client-IP",
+ "X-Forwarded-For",
+ "Fly-Client-IP",
+ "CF-Connecting-IP",
+ "Fastly-Client-Ip",
+ "True-Client-Ip",
+ "X-Real-IP",
+ "X-Cluster-Client-IP",
+ "X-Forwarded",
+ "Forwarded-For",
+ "Forwarded",
+ "X-Vercel-Forwarded-For"
+];
+function getClientIPAddress(headers) {
+ const headerValues = ipHeaderNames.map((headerName) => {
+ const rawValue = headers[headerName];
+ const value4 = Array.isArray(rawValue) ? rawValue.join(";") : rawValue;
+ if (headerName === "Forwarded") {
+ return parseForwardedHeader(value4);
+ }
+ return value4 && value4.split(",").map((v2) => v2.trim());
+ });
+ const flattenedHeaderValues = headerValues.reduce((acc, val) => {
+ if (!val) {
+ return acc;
+ }
+ return acc.concat(val);
+ }, []);
+ const ipAddress = flattenedHeaderValues.find((ip) => ip !== null && isIP(ip));
+ return ipAddress || null;
+}
+__name(getClientIPAddress, "getClientIPAddress");
+function parseForwardedHeader(value4) {
+ if (!value4) {
+ return null;
+ }
+ for (const part of value4.split(";")) {
+ if (part.startsWith("for=")) {
+ return part.slice(4);
+ }
+ }
+ return null;
+}
+__name(parseForwardedHeader, "parseForwardedHeader");
+function isIP(str) {
+ const regex2 = /(?:^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$)|(?:^(?:(?:[a-fA-F\d]{1,4}:){7}(?:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,2}|:)|(?:[a-fA-F\d]{1,4}:){4}(?:(?::[a-fA-F\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,3}|:)|(?:[a-fA-F\d]{1,4}:){3}(?:(?::[a-fA-F\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,4}|:)|(?:[a-fA-F\d]{1,4}:){2}(?:(?::[a-fA-F\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,5}|:)|(?:[a-fA-F\d]{1,4}:){1}(?:(?::[a-fA-F\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,6}|:)|(?::(?:(?::[a-fA-F\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,7}|:)))(?:%[0-9a-zA-Z]{1,})?$)/;
+ return regex2.test(str);
+}
+__name(isIP, "isIP");
+const DEFAULT_INCLUDES = {
+ ip: false,
+ request: true,
+ user: true
+};
+const DEFAULT_REQUEST_INCLUDES = ["cookies", "data", "headers", "method", "query_string", "url"];
+const DEFAULT_USER_INCLUDES = ["id", "username", "email"];
+function extractPathForTransaction(req, options4 = {}) {
+ const method = req.method && req.method.toUpperCase();
+ let path = "";
+ let source = "url";
+ if (options4.customRoute || req.route) {
+ path = options4.customRoute || `${req.baseUrl || ""}${req.route && req.route.path}`;
+ source = "route";
+ } else if (req.originalUrl || req.url) {
+ path = stripUrlQueryAndFragment(req.originalUrl || req.url || "");
+ }
+ let name2 = "";
+ if (options4.method && method) {
+ name2 += method;
+ }
+ if (options4.method && options4.path) {
+ name2 += " ";
+ }
+ if (options4.path && path) {
+ name2 += path;
+ }
+ return [name2, source];
+}
+__name(extractPathForTransaction, "extractPathForTransaction");
+function extractUserData(user, keys2) {
+ const extractedUser = {};
+ const attributes = Array.isArray(keys2) ? keys2 : DEFAULT_USER_INCLUDES;
+ attributes.forEach((key) => {
+ if (user && key in user) {
+ extractedUser[key] = user[key];
+ }
+ });
+ return extractedUser;
+}
+__name(extractUserData, "extractUserData");
+function extractRequestData(req, options4 = {}) {
+ const { include = DEFAULT_REQUEST_INCLUDES } = options4;
+ const requestData = {};
+ const headers = req.headers || {};
+ const method = req.method;
+ const host = headers.host || req.hostname || req.host || "";
+ const protocol = req.protocol === "https" || req.socket && req.socket.encrypted ? "https" : "http";
+ const originalUrl = req.originalUrl || req.url || "";
+ const absoluteUrl = originalUrl.startsWith(protocol) ? originalUrl : `${protocol}://${host}${originalUrl}`;
+ include.forEach((key) => {
+ switch (key) {
+ case "headers": {
+ requestData.headers = headers;
+ if (!include.includes("cookies")) {
+ delete requestData.headers.cookie;
+ }
+ if (!include.includes("ip")) {
+ ipHeaderNames.forEach((ipHeaderName) => {
+ delete requestData.headers[ipHeaderName];
+ });
+ }
+ break;
}
- if (false) {
- throw new Error(`Invalid async component load result: ${comp}`);
+ case "method": {
+ requestData.method = method;
+ break;
}
- resolvedComp = comp;
- return comp;
- }));
- }, "load");
- return /* @__PURE__ */ defineComponent({
- name: "AsyncComponentWrapper",
- __asyncLoader: load2,
- get __asyncResolved() {
- return resolvedComp;
- },
- setup() {
- const instance = currentInstance;
- if (resolvedComp) {
- return () => createInnerComp(resolvedComp, instance);
+ case "url": {
+ requestData.url = absoluteUrl;
+ break;
}
- const onError = /* @__PURE__ */ __name((err) => {
- pendingRequest = null;
- handleError(
- err,
- instance,
- 13,
- !errorComponent
- );
- }, "onError");
- if (suspensible && instance.suspense || isInSSRComponentSetup) {
- return load2().then((comp) => {
- return () => createInnerComp(comp, instance);
- }).catch((err) => {
- onError(err);
- return () => errorComponent ? createVNode(errorComponent, {
- error: err
- }) : null;
- });
+ case "cookies": {
+ requestData.cookies = // TODO (v8 / #5257): We're only sending the empty object for backwards compatibility, so the last bit can
+ // come off in v8
+ req.cookies || headers.cookie && parseCookie(headers.cookie) || {};
+ break;
}
- const loaded = ref(false);
- const error2 = ref();
- const delayed = ref(!!delay);
- if (delay) {
- setTimeout(() => {
- delayed.value = false;
- }, delay);
+ case "query_string": {
+ requestData.query_string = extractQueryParams(req);
+ break;
}
- if (timeout != null) {
- setTimeout(() => {
- if (!loaded.value && !error2.value) {
- const err = new Error(
- `Async component timed out after ${timeout}ms.`
- );
- onError(err);
- error2.value = err;
+ case "data": {
+ if (method === "GET" || method === "HEAD") {
+ break;
+ }
+ const body = req.body;
+ if (body !== void 0) {
+ const stringBody = isString$8(body) ? body : isPlainObject$5(body) ? JSON.stringify(normalize$2(body)) : truncate(`${body}`, 1024);
+ if (stringBody) {
+ requestData.data = stringBody;
}
- }, timeout);
- }
- load2().then(() => {
- loaded.value = true;
- if (instance.parent && isKeepAlive(instance.parent.vnode)) {
- instance.parent.effect.dirty = true;
- queueJob(instance.parent.update);
}
- }).catch((err) => {
- onError(err);
- error2.value = err;
- });
- return () => {
- if (loaded.value && resolvedComp) {
- return createInnerComp(resolvedComp, instance);
- } else if (error2.value && errorComponent) {
- return createVNode(errorComponent, {
- error: error2.value
- });
- } else if (loadingComponent && !delayed.value) {
- return createVNode(loadingComponent);
+ break;
+ }
+ default: {
+ if ({}.hasOwnProperty.call(req, key)) {
+ requestData[key] = req[key];
}
- };
+ }
}
});
+ return requestData;
}
-__name(defineAsyncComponent, "defineAsyncComponent");
-function createInnerComp(comp, parent) {
- const { ref: ref22, props, children, ce } = parent.vnode;
- const vnode = createVNode(comp, props, children);
- vnode.ref = ref22;
- vnode.ce = ce;
- delete parent.vnode.ce;
- return vnode;
+__name(extractRequestData, "extractRequestData");
+function addNormalizedRequestDataToEvent(event, req, additionalData, options4) {
+ const include = {
+ ...DEFAULT_INCLUDES,
+ ...options4 && options4.include
+ };
+ if (include.request) {
+ const includeRequest = Array.isArray(include.request) ? [...include.request] : [...DEFAULT_REQUEST_INCLUDES];
+ if (include.ip) {
+ includeRequest.push("ip");
+ }
+ const extractedRequestData = extractNormalizedRequestData(req, { include: includeRequest });
+ event.request = {
+ ...event.request,
+ ...extractedRequestData
+ };
+ }
+ if (include.user) {
+ const extractedUser = additionalData.user && isPlainObject$5(additionalData.user) ? extractUserData(additionalData.user, include.user) : {};
+ if (Object.keys(extractedUser).length) {
+ event.user = {
+ ...extractedUser,
+ ...event.user
+ };
+ }
+ }
+ if (include.ip) {
+ const ip = req.headers && getClientIPAddress(req.headers) || additionalData.ipAddress;
+ if (ip) {
+ event.user = {
+ ...event.user,
+ ip_address: ip
+ };
+ }
+ }
}
-__name(createInnerComp, "createInnerComp");
-function renderSlot(slots, name2, props = {}, fallback, noSlotted) {
- if (currentRenderingInstance.isCE || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.isCE) {
- if (name2 !== "default") props.name = name2;
- return createVNode("slot", props, fallback && fallback());
+__name(addNormalizedRequestDataToEvent, "addNormalizedRequestDataToEvent");
+function addRequestDataToEvent(event, req, options4) {
+ const include = {
+ ...DEFAULT_INCLUDES,
+ ...options4 && options4.include
+ };
+ if (include.request) {
+ const includeRequest = Array.isArray(include.request) ? [...include.request] : [...DEFAULT_REQUEST_INCLUDES];
+ if (include.ip) {
+ includeRequest.push("ip");
+ }
+ const extractedRequestData = extractRequestData(req, { include: includeRequest });
+ event.request = {
+ ...event.request,
+ ...extractedRequestData
+ };
+ }
+ if (include.user) {
+ const extractedUser = req.user && isPlainObject$5(req.user) ? extractUserData(req.user, include.user) : {};
+ if (Object.keys(extractedUser).length) {
+ event.user = {
+ ...event.user,
+ ...extractedUser
+ };
+ }
}
- let slot = slots[name2];
- if (false) {
- warn$1$1(
- `SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template.`
- );
- slot = /* @__PURE__ */ __name(() => [], "slot");
+ if (include.ip) {
+ const ip = req.headers && getClientIPAddress(req.headers) || req.ip || req.socket && req.socket.remoteAddress;
+ if (ip) {
+ event.user = {
+ ...event.user,
+ ip_address: ip
+ };
+ }
}
- if (slot && slot._c) {
- slot._d = false;
+ return event;
+}
+__name(addRequestDataToEvent, "addRequestDataToEvent");
+function extractQueryParams(req) {
+ let originalUrl = req.originalUrl || req.url || "";
+ if (!originalUrl) {
+ return;
}
- openBlock();
- const validSlotContent = slot && ensureValidVNode(slot(props));
- const rendered = createBlock(
- Fragment$1,
- {
- key: props.key || // slot content array of a dynamic conditional slot may have a branch
- // key attached in the `createSlots` helper, respect that
- validSlotContent && validSlotContent.key || `_${name2}`
- },
- validSlotContent || (fallback ? fallback() : []),
- validSlotContent && slots._ === 1 ? 64 : -2
- );
- if (!noSlotted && rendered.scopeId) {
- rendered.slotScopeIds = [rendered.scopeId + "-s"];
+ if (originalUrl.startsWith("/")) {
+ originalUrl = `http://dogs.are.great${originalUrl}`;
}
- if (slot && slot._c) {
- slot._d = true;
+ try {
+ const queryParams = req.query || new URL(originalUrl).search.slice(1);
+ return queryParams.length ? queryParams : void 0;
+ } catch (e2) {
+ return void 0;
}
- return rendered;
}
-__name(renderSlot, "renderSlot");
-function ensureValidVNode(vnodes) {
- return vnodes.some((child) => {
- if (!isVNode$1(child)) return true;
- if (child.type === Comment) return false;
- if (child.type === Fragment$1 && !ensureValidVNode(child.children))
- return false;
- return true;
- }) ? vnodes : null;
+__name(extractQueryParams, "extractQueryParams");
+function winterCGHeadersToDict(winterCGHeaders) {
+ const headers = {};
+ try {
+ winterCGHeaders.forEach((value4, key) => {
+ if (typeof value4 === "string") {
+ headers[key] = value4;
+ }
+ });
+ } catch (e2) {
+ DEBUG_BUILD$5 && logger$2.warn("Sentry failed extracting headers from a request object. If you see this, please file an issue.");
+ }
+ return headers;
}
-__name(ensureValidVNode, "ensureValidVNode");
-function toHandlers(obj, preserveCaseIfNecessary) {
- const ret = {};
- if (false) {
- warn$1$1(`v-on with no argument expects an object value.`);
- return ret;
+__name(winterCGHeadersToDict, "winterCGHeadersToDict");
+function headersToDict(reqHeaders) {
+ const headers = /* @__PURE__ */ Object.create(null);
+ try {
+ Object.entries(reqHeaders).forEach(([key, value4]) => {
+ if (typeof value4 === "string") {
+ headers[key] = value4;
+ }
+ });
+ } catch (e2) {
+ DEBUG_BUILD$5 && logger$2.warn("Sentry failed extracting headers from a request object. If you see this, please file an issue.");
}
- for (const key in obj) {
- ret[preserveCaseIfNecessary && /[A-Z]/.test(key) ? `on:${key}` : toHandlerKey(key)] = obj[key];
+ return headers;
+}
+__name(headersToDict, "headersToDict");
+function winterCGRequestToRequestData(req) {
+ const headers = winterCGHeadersToDict(req.headers);
+ return {
+ method: req.method,
+ url: req.url,
+ query_string: extractQueryParamsFromUrl(req.url),
+ headers
+ // TODO: Can we extract body data from the request?
+ };
+}
+__name(winterCGRequestToRequestData, "winterCGRequestToRequestData");
+function httpRequestToRequestData(request) {
+ const headers = request.headers || {};
+ const host = headers.host || "";
+ const protocol = request.socket && request.socket.encrypted ? "https" : "http";
+ const originalUrl = request.url || "";
+ const absoluteUrl = originalUrl.startsWith(protocol) ? originalUrl : `${protocol}://${host}${originalUrl}`;
+ const data25 = request.body || void 0;
+ const cookies2 = request.cookies;
+ return dropUndefinedKeys({
+ url: absoluteUrl,
+ method: request.method,
+ query_string: extractQueryParamsFromUrl(originalUrl),
+ headers: headersToDict(headers),
+ cookies: cookies2,
+ data: data25
+ });
+}
+__name(httpRequestToRequestData, "httpRequestToRequestData");
+function extractQueryParamsFromUrl(url) {
+ if (!url) {
+ return;
+ }
+ try {
+ const queryParams = new URL(url, "http://dogs.are.great").search.slice(1);
+ return queryParams.length ? queryParams : void 0;
+ } catch (e3) {
+ return void 0;
}
- return ret;
}
-__name(toHandlers, "toHandlers");
-const getPublicInstance = /* @__PURE__ */ __name((i2) => {
- if (!i2) return null;
- if (isStatefulComponent(i2)) return getComponentPublicInstance(i2);
- return getPublicInstance(i2.parent);
-}, "getPublicInstance");
-const publicPropertiesMap = (
- // Move PURE marker to new line to workaround compiler discarding it
- // due to type annotation
- /* @__PURE__ */ extend$1(/* @__PURE__ */ Object.create(null), {
- $: /* @__PURE__ */ __name((i2) => i2, "$"),
- $el: /* @__PURE__ */ __name((i2) => i2.vnode.el, "$el"),
- $data: /* @__PURE__ */ __name((i2) => i2.data, "$data"),
- $props: /* @__PURE__ */ __name((i2) => false ? shallowReadonly(i2.props) : i2.props, "$props"),
- $attrs: /* @__PURE__ */ __name((i2) => false ? shallowReadonly(i2.attrs) : i2.attrs, "$attrs"),
- $slots: /* @__PURE__ */ __name((i2) => false ? shallowReadonly(i2.slots) : i2.slots, "$slots"),
- $refs: /* @__PURE__ */ __name((i2) => false ? shallowReadonly(i2.refs) : i2.refs, "$refs"),
- $parent: /* @__PURE__ */ __name((i2) => getPublicInstance(i2.parent), "$parent"),
- $root: /* @__PURE__ */ __name((i2) => getPublicInstance(i2.root), "$root"),
- $emit: /* @__PURE__ */ __name((i2) => i2.emit, "$emit"),
- $options: /* @__PURE__ */ __name((i2) => true ? resolveMergedOptions(i2) : i2.type, "$options"),
- $forceUpdate: /* @__PURE__ */ __name((i2) => i2.f || (i2.f = () => {
- i2.effect.dirty = true;
- queueJob(i2.update);
- }), "$forceUpdate"),
- $nextTick: /* @__PURE__ */ __name((i2) => i2.n || (i2.n = nextTick.bind(i2.proxy)), "$nextTick"),
- $watch: /* @__PURE__ */ __name((i2) => true ? instanceWatch.bind(i2) : NOOP, "$watch")
- })
-);
-const isReservedPrefix = /* @__PURE__ */ __name((key) => key === "_" || key === "$", "isReservedPrefix");
-const hasSetupBinding = /* @__PURE__ */ __name((state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn$3(state, key), "hasSetupBinding");
-const PublicInstanceProxyHandlers = {
- get({ _: instance }, key) {
- if (key === "__v_skip") {
- return true;
+__name(extractQueryParamsFromUrl, "extractQueryParamsFromUrl");
+function extractNormalizedRequestData(normalizedRequest, { include }) {
+ const includeKeys = include ? Array.isArray(include) ? include : DEFAULT_REQUEST_INCLUDES : [];
+ const requestData = {};
+ const headers = { ...normalizedRequest.headers };
+ if (includeKeys.includes("headers")) {
+ requestData.headers = headers;
+ if (!include.includes("cookies")) {
+ delete headers.cookie;
}
- const { ctx, setupState, data: data24, props, accessCache, type, appContext } = instance;
- if (false) {
- return true;
+ if (!include.includes("ip")) {
+ ipHeaderNames.forEach((ipHeaderName) => {
+ delete headers[ipHeaderName];
+ });
}
- let normalizedProps;
- if (key[0] !== "$") {
- const n = accessCache[key];
- if (n !== void 0) {
- switch (n) {
- case 1:
- return setupState[key];
- case 2:
- return data24[key];
- case 4:
- return ctx[key];
- case 3:
- return props[key];
- }
- } else if (hasSetupBinding(setupState, key)) {
- accessCache[key] = 1;
- return setupState[key];
- } else if (data24 !== EMPTY_OBJ && hasOwn$3(data24, key)) {
- accessCache[key] = 2;
- return data24[key];
- } else if (
- // only cache other properties when instance has declared (thus stable)
- // props
- (normalizedProps = instance.propsOptions[0]) && hasOwn$3(normalizedProps, key)
- ) {
- accessCache[key] = 3;
- return props[key];
- } else if (ctx !== EMPTY_OBJ && hasOwn$3(ctx, key)) {
- accessCache[key] = 4;
- return ctx[key];
- } else if (shouldCacheAccess) {
- accessCache[key] = 0;
- }
+ }
+ if (includeKeys.includes("method")) {
+ requestData.method = normalizedRequest.method;
+ }
+ if (includeKeys.includes("url")) {
+ requestData.url = normalizedRequest.url;
+ }
+ if (includeKeys.includes("cookies")) {
+ const cookies2 = normalizedRequest.cookies || (headers && headers.cookie ? parseCookie(headers.cookie) : void 0);
+ requestData.cookies = cookies2 || {};
+ }
+ if (includeKeys.includes("query_string")) {
+ requestData.query_string = normalizedRequest.query_string;
+ }
+ if (includeKeys.includes("data")) {
+ requestData.data = normalizedRequest.data;
+ }
+ return requestData;
+}
+__name(extractNormalizedRequestData, "extractNormalizedRequestData");
+const DEFAULT_OPTIONS$1 = {
+ include: {
+ cookies: true,
+ data: true,
+ headers: true,
+ ip: false,
+ query_string: true,
+ url: true,
+ user: {
+ id: true,
+ username: true,
+ email: true
}
- const publicGetter = publicPropertiesMap[key];
- let cssModule, globalProperties;
- if (publicGetter) {
- if (key === "$attrs") {
- track(instance.attrs, "get", "");
- } else if (false) {
- track(instance, "get", key);
+ },
+ transactionNamingScheme: "methodPath"
+};
+const INTEGRATION_NAME$i = "RequestData";
+const _requestDataIntegration = /* @__PURE__ */ __name((options4 = {}) => {
+ const _options = {
+ ...DEFAULT_OPTIONS$1,
+ ...options4,
+ include: {
+ ...DEFAULT_OPTIONS$1.include,
+ ...options4.include,
+ user: options4.include && typeof options4.include.user === "boolean" ? options4.include.user : {
+ ...DEFAULT_OPTIONS$1.include.user,
+ // Unclear why TS still thinks `options.include.user` could be a boolean at this point
+ ...(options4.include || {}).user
}
- return publicGetter(instance);
- } else if (
- // css module (injected by vue-loader)
- (cssModule = type.__cssModules) && (cssModule = cssModule[key])
- ) {
- return cssModule;
- } else if (ctx !== EMPTY_OBJ && hasOwn$3(ctx, key)) {
- accessCache[key] = 4;
- return ctx[key];
- } else if (
- // global properties
- globalProperties = appContext.config.globalProperties, hasOwn$3(globalProperties, key)
- ) {
- {
- return globalProperties[key];
+ }
+ };
+ return {
+ name: INTEGRATION_NAME$i,
+ processEvent(event) {
+ const { sdkProcessingMetadata = {} } = event;
+ const { request, normalizedRequest } = sdkProcessingMetadata;
+ const addRequestDataOptions = convertReqDataIntegrationOptsToAddReqDataOpts(_options);
+ if (normalizedRequest) {
+ const ipAddress = request ? request.ip || request.socket && request.socket.remoteAddress : void 0;
+ const user = request ? request.user : void 0;
+ addNormalizedRequestDataToEvent(event, normalizedRequest, { ipAddress, user }, addRequestDataOptions);
+ return event;
}
- } else if (false) {
- if (data24 !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn$3(data24, key)) {
- warn$1$1(
- `Property ${JSON.stringify(
- key
- )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`
- );
- } else if (instance === currentRenderingInstance) {
- warn$1$1(
- `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.`
- );
+ if (!request) {
+ return event;
}
+ return addRequestDataToEvent(event, request, addRequestDataOptions);
}
- },
- set({ _: instance }, key, value4) {
- const { data: data24, setupState, ctx } = instance;
- if (hasSetupBinding(setupState, key)) {
- setupState[key] = value4;
- return true;
- } else if (false) {
- warn$1$1(`Cannot mutate
-
+
+