@workflow/web 4.1.5 → 4.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/client/assets/{highlighted-body-B3W2YXNL-CdV7thm2.js → highlighted-body-B3W2YXNL-D1wKXrjI.js} +1 -1
- package/build/client/assets/{home-BMWyCqWy.js → home-B9GhesEF.js} +2 -2
- package/build/client/assets/{manifest-c0697365.js → manifest-830d5c7d.js} +1 -1
- package/build/client/assets/{mermaid-3ZIDBTTL-B_qZU5zW.js → mermaid-3ZIDBTTL-Cr7OQX4b.js} +2098 -2079
- package/build/client/assets/{root-CLs7COa2.js → root-BzOKTpCh.js} +1 -1
- package/build/client/assets/{run-detail-D7xkVxzE.js → run-detail-CRqjlzw9.js} +237 -103
- package/build/client/assets/{workflow-graph-viewer-D5yEggTb.js → workflow-graph-viewer-P4oMQJaV.js} +7 -7
- package/build/server/assets/{app-fdUHF124.js → app-CthB1gsr.js} +1 -1
- package/build/server/assets/{highlighted-body-B3W2YXNL-2WxWqSYU.js → highlighted-body-B3W2YXNL-Bid3dXog.js} +2 -2
- package/build/server/assets/{index-C64kz8oy.js → index-DSI4dt08.js} +30 -29
- package/build/server/assets/{mermaid-3ZIDBTTL-FF5ZIJp-.js → mermaid-3ZIDBTTL-Dx3Er0ad.js} +3 -3
- package/build/server/assets/{server-build-Mddyhj54.js → server-build-DBNmVwSJ.js} +2482 -1976
- package/build/server/assets/{token-D_Q6dhhy.js → token-bXRgYyTK.js} +2 -2
- package/build/server/assets/{token-util-BAhz4ocz.js → token-util-B88n4Kn9.js} +2 -2
- package/build/server/index.js +1 -1
- package/package.json +7 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/highlighted-body-B3W2YXNL-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/highlighted-body-B3W2YXNL-D1wKXrjI.js","assets/index-DQa-BExo.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
@@ -15268,6 +15268,7 @@ const StepCompletedEventSchema = BaseEventSchema.extend({
|
|
|
15268
15268
|
eventType: literal("step_completed"),
|
|
15269
15269
|
correlationId: string$2(),
|
|
15270
15270
|
eventData: object({
|
|
15271
|
+
stepName: string$2().optional(),
|
|
15271
15272
|
result: SerializedDataSchema
|
|
15272
15273
|
})
|
|
15273
15274
|
});
|
|
@@ -15275,6 +15276,7 @@ const StepFailedEventSchema = BaseEventSchema.extend({
|
|
|
15275
15276
|
eventType: literal("step_failed"),
|
|
15276
15277
|
correlationId: string$2(),
|
|
15277
15278
|
eventData: object({
|
|
15279
|
+
stepName: string$2().optional(),
|
|
15278
15280
|
error: any(),
|
|
15279
15281
|
stack: string$2().optional()
|
|
15280
15282
|
})
|
|
@@ -15283,6 +15285,7 @@ const StepRetryingEventSchema = BaseEventSchema.extend({
|
|
|
15283
15285
|
eventType: literal("step_retrying"),
|
|
15284
15286
|
correlationId: string$2(),
|
|
15285
15287
|
eventData: object({
|
|
15288
|
+
stepName: string$2().optional(),
|
|
15286
15289
|
error: any(),
|
|
15287
15290
|
stack: string$2().optional(),
|
|
15288
15291
|
retryAfter: date().optional()
|
|
@@ -15292,6 +15295,7 @@ const StepStartedEventSchema = BaseEventSchema.extend({
|
|
|
15292
15295
|
eventType: literal("step_started"),
|
|
15293
15296
|
correlationId: string$2(),
|
|
15294
15297
|
eventData: object({
|
|
15298
|
+
stepName: string$2().optional(),
|
|
15295
15299
|
attempt: number$2().optional()
|
|
15296
15300
|
}).optional()
|
|
15297
15301
|
});
|
|
@@ -15315,12 +15319,16 @@ const HookReceivedEventSchema = BaseEventSchema.extend({
|
|
|
15315
15319
|
eventType: literal("hook_received"),
|
|
15316
15320
|
correlationId: string$2(),
|
|
15317
15321
|
eventData: object({
|
|
15322
|
+
token: string$2().optional(),
|
|
15318
15323
|
payload: SerializedDataSchema
|
|
15319
15324
|
})
|
|
15320
15325
|
});
|
|
15321
15326
|
const HookDisposedEventSchema = BaseEventSchema.extend({
|
|
15322
15327
|
eventType: literal("hook_disposed"),
|
|
15323
|
-
correlationId: string$2()
|
|
15328
|
+
correlationId: string$2(),
|
|
15329
|
+
eventData: object({
|
|
15330
|
+
token: string$2().optional()
|
|
15331
|
+
}).optional()
|
|
15324
15332
|
});
|
|
15325
15333
|
const HookConflictEventSchema = BaseEventSchema.extend({
|
|
15326
15334
|
eventType: literal("hook_conflict"),
|
|
@@ -15338,7 +15346,10 @@ const WaitCreatedEventSchema = BaseEventSchema.extend({
|
|
|
15338
15346
|
});
|
|
15339
15347
|
const WaitCompletedEventSchema = BaseEventSchema.extend({
|
|
15340
15348
|
eventType: literal("wait_completed"),
|
|
15341
|
-
correlationId: string$2()
|
|
15349
|
+
correlationId: string$2(),
|
|
15350
|
+
eventData: object({
|
|
15351
|
+
resumeAt: date().optional()
|
|
15352
|
+
}).optional()
|
|
15342
15353
|
});
|
|
15343
15354
|
const RunCreatedEventSchema = BaseEventSchema.extend({
|
|
15344
15355
|
eventType: literal("run_created"),
|
|
@@ -15491,7 +15502,7 @@ const StructuredErrorSchema = object({
|
|
|
15491
15502
|
message: string$2(),
|
|
15492
15503
|
stack: string$2().optional(),
|
|
15493
15504
|
code: string$2().optional()
|
|
15494
|
-
// Populated with RunErrorCode values (USER_ERROR, RUNTIME_ERROR) for run_failed events
|
|
15505
|
+
// Populated with RunErrorCode values (USER_ERROR, RUNTIME_ERROR, etc.) for run_failed events
|
|
15495
15506
|
});
|
|
15496
15507
|
const WorkflowRunStatusSchema = _enum([
|
|
15497
15508
|
"pending",
|
|
@@ -15528,7 +15539,7 @@ const WorkflowRunBaseSchema = object({
|
|
|
15528
15539
|
// Optional in database for backwards compatibility, defaults to 1 (legacy) when reading
|
|
15529
15540
|
specVersion: number$2().optional(),
|
|
15530
15541
|
executionContext: record(string$2(), any()).optional(),
|
|
15531
|
-
input: SerializedDataSchema,
|
|
15542
|
+
input: SerializedDataSchema.optional(),
|
|
15532
15543
|
output: SerializedDataSchema.optional(),
|
|
15533
15544
|
error: StructuredErrorSchema.optional(),
|
|
15534
15545
|
expiredAt: date().optional(),
|
|
@@ -15541,28 +15552,28 @@ discriminatedUnion("status", [
|
|
|
15541
15552
|
// Non-final states
|
|
15542
15553
|
WorkflowRunBaseSchema.extend({
|
|
15543
15554
|
status: _enum(["pending", "running"]),
|
|
15544
|
-
output: _undefined(),
|
|
15545
|
-
error: _undefined(),
|
|
15546
|
-
completedAt: _undefined()
|
|
15555
|
+
output: _undefined().optional(),
|
|
15556
|
+
error: _undefined().optional(),
|
|
15557
|
+
completedAt: _undefined().optional()
|
|
15547
15558
|
}),
|
|
15548
15559
|
// Cancelled state
|
|
15549
15560
|
WorkflowRunBaseSchema.extend({
|
|
15550
15561
|
status: literal("cancelled"),
|
|
15551
|
-
output: _undefined(),
|
|
15552
|
-
error: _undefined(),
|
|
15562
|
+
output: _undefined().optional(),
|
|
15563
|
+
error: _undefined().optional(),
|
|
15553
15564
|
completedAt: date()
|
|
15554
15565
|
}),
|
|
15555
15566
|
// Completed state - output can be v1 or v2 format
|
|
15556
15567
|
WorkflowRunBaseSchema.extend({
|
|
15557
15568
|
status: literal("completed"),
|
|
15558
15569
|
output: SerializedDataSchema,
|
|
15559
|
-
error: _undefined(),
|
|
15570
|
+
error: _undefined().optional(),
|
|
15560
15571
|
completedAt: date()
|
|
15561
15572
|
}),
|
|
15562
15573
|
// Failed state
|
|
15563
15574
|
WorkflowRunBaseSchema.extend({
|
|
15564
15575
|
status: literal("failed"),
|
|
15565
|
-
output: _undefined(),
|
|
15576
|
+
output: _undefined().optional(),
|
|
15566
15577
|
error: StructuredErrorSchema,
|
|
15567
15578
|
completedAt: date()
|
|
15568
15579
|
})
|
|
@@ -15599,7 +15610,7 @@ object({
|
|
|
15599
15610
|
*/
|
|
15600
15611
|
stepName: string$2(),
|
|
15601
15612
|
status: StepStatusSchema,
|
|
15602
|
-
input: SerializedDataSchema,
|
|
15613
|
+
input: SerializedDataSchema.optional(),
|
|
15603
15614
|
output: SerializedDataSchema.optional(),
|
|
15604
15615
|
/**
|
|
15605
15616
|
* The error from a step_retrying or step_failed event.
|
|
@@ -15902,2145 +15913,2145 @@ function Spinner({ size: size2 = 14, color: color5 }) {
|
|
|
15902
15913
|
animationDelay: `${delay}ms`
|
|
15903
15914
|
} }, delay))] });
|
|
15904
15915
|
}
|
|
15905
|
-
|
|
15906
|
-
|
|
15907
|
-
|
|
15908
|
-
|
|
15909
|
-
|
|
15910
|
-
|
|
15911
|
-
|
|
15912
|
-
|
|
15916
|
+
function __insertCSS(code2) {
|
|
15917
|
+
if (typeof document == "undefined") return;
|
|
15918
|
+
let head = document.head || document.getElementsByTagName("head")[0];
|
|
15919
|
+
let style2 = document.createElement("style");
|
|
15920
|
+
style2.type = "text/css";
|
|
15921
|
+
head.appendChild(style2);
|
|
15922
|
+
style2.styleSheet ? style2.styleSheet.cssText = code2 : style2.appendChild(document.createTextNode(code2));
|
|
15923
|
+
}
|
|
15924
|
+
const getAsset = (type) => {
|
|
15925
|
+
switch (type) {
|
|
15926
|
+
case "success":
|
|
15927
|
+
return SuccessIcon;
|
|
15928
|
+
case "info":
|
|
15929
|
+
return InfoIcon;
|
|
15930
|
+
case "warning":
|
|
15931
|
+
return WarningIcon;
|
|
15932
|
+
case "error":
|
|
15933
|
+
return ErrorIcon;
|
|
15934
|
+
default:
|
|
15935
|
+
return null;
|
|
15936
|
+
}
|
|
15913
15937
|
};
|
|
15914
|
-
|
|
15915
|
-
|
|
15916
|
-
|
|
15938
|
+
const bars = Array(12).fill(0);
|
|
15939
|
+
const Loader = ({ visible, className }) => {
|
|
15940
|
+
return /* @__PURE__ */ ReactExports.createElement("div", {
|
|
15941
|
+
className: [
|
|
15942
|
+
"sonner-loading-wrapper",
|
|
15943
|
+
className
|
|
15944
|
+
].filter(Boolean).join(" "),
|
|
15945
|
+
"data-visible": visible
|
|
15946
|
+
}, /* @__PURE__ */ ReactExports.createElement("div", {
|
|
15947
|
+
className: "sonner-spinner"
|
|
15948
|
+
}, bars.map((_2, i) => /* @__PURE__ */ ReactExports.createElement("div", {
|
|
15949
|
+
className: "sonner-loading-bar",
|
|
15950
|
+
key: `spinner-bar-${i}`
|
|
15951
|
+
}))));
|
|
15917
15952
|
};
|
|
15918
|
-
|
|
15919
|
-
|
|
15920
|
-
|
|
15921
|
-
|
|
15922
|
-
|
|
15923
|
-
|
|
15924
|
-
|
|
15953
|
+
const SuccessIcon = /* @__PURE__ */ ReactExports.createElement("svg", {
|
|
15954
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
15955
|
+
viewBox: "0 0 20 20",
|
|
15956
|
+
fill: "currentColor",
|
|
15957
|
+
height: "20",
|
|
15958
|
+
width: "20"
|
|
15959
|
+
}, /* @__PURE__ */ ReactExports.createElement("path", {
|
|
15960
|
+
fillRule: "evenodd",
|
|
15961
|
+
d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",
|
|
15962
|
+
clipRule: "evenodd"
|
|
15963
|
+
}));
|
|
15964
|
+
const WarningIcon = /* @__PURE__ */ ReactExports.createElement("svg", {
|
|
15965
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
15966
|
+
viewBox: "0 0 24 24",
|
|
15967
|
+
fill: "currentColor",
|
|
15968
|
+
height: "20",
|
|
15969
|
+
width: "20"
|
|
15970
|
+
}, /* @__PURE__ */ ReactExports.createElement("path", {
|
|
15971
|
+
fillRule: "evenodd",
|
|
15972
|
+
d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",
|
|
15973
|
+
clipRule: "evenodd"
|
|
15974
|
+
}));
|
|
15975
|
+
const InfoIcon = /* @__PURE__ */ ReactExports.createElement("svg", {
|
|
15976
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
15977
|
+
viewBox: "0 0 20 20",
|
|
15978
|
+
fill: "currentColor",
|
|
15979
|
+
height: "20",
|
|
15980
|
+
width: "20"
|
|
15981
|
+
}, /* @__PURE__ */ ReactExports.createElement("path", {
|
|
15982
|
+
fillRule: "evenodd",
|
|
15983
|
+
d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",
|
|
15984
|
+
clipRule: "evenodd"
|
|
15985
|
+
}));
|
|
15986
|
+
const ErrorIcon = /* @__PURE__ */ ReactExports.createElement("svg", {
|
|
15987
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
15988
|
+
viewBox: "0 0 20 20",
|
|
15989
|
+
fill: "currentColor",
|
|
15990
|
+
height: "20",
|
|
15991
|
+
width: "20"
|
|
15992
|
+
}, /* @__PURE__ */ ReactExports.createElement("path", {
|
|
15993
|
+
fillRule: "evenodd",
|
|
15994
|
+
d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",
|
|
15995
|
+
clipRule: "evenodd"
|
|
15996
|
+
}));
|
|
15997
|
+
const CloseIcon = /* @__PURE__ */ ReactExports.createElement("svg", {
|
|
15998
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
15999
|
+
width: "12",
|
|
16000
|
+
height: "12",
|
|
16001
|
+
viewBox: "0 0 24 24",
|
|
16002
|
+
fill: "none",
|
|
16003
|
+
stroke: "currentColor",
|
|
16004
|
+
strokeWidth: "1.5",
|
|
16005
|
+
strokeLinecap: "round",
|
|
16006
|
+
strokeLinejoin: "round"
|
|
16007
|
+
}, /* @__PURE__ */ ReactExports.createElement("line", {
|
|
16008
|
+
x1: "18",
|
|
16009
|
+
y1: "6",
|
|
16010
|
+
x2: "6",
|
|
16011
|
+
y2: "18"
|
|
16012
|
+
}), /* @__PURE__ */ ReactExports.createElement("line", {
|
|
16013
|
+
x1: "6",
|
|
16014
|
+
y1: "6",
|
|
16015
|
+
x2: "18",
|
|
16016
|
+
y2: "18"
|
|
16017
|
+
}));
|
|
16018
|
+
const useIsDocumentHidden = () => {
|
|
16019
|
+
const [isDocumentHidden, setIsDocumentHidden] = ReactExports.useState(document.hidden);
|
|
16020
|
+
ReactExports.useEffect(() => {
|
|
16021
|
+
const callback = () => {
|
|
16022
|
+
setIsDocumentHidden(document.hidden);
|
|
16023
|
+
};
|
|
16024
|
+
document.addEventListener("visibilitychange", callback);
|
|
16025
|
+
return () => window.removeEventListener("visibilitychange", callback);
|
|
16026
|
+
}, []);
|
|
16027
|
+
return isDocumentHidden;
|
|
15925
16028
|
};
|
|
15926
|
-
|
|
15927
|
-
|
|
15928
|
-
|
|
15929
|
-
|
|
15930
|
-
|
|
15931
|
-
|
|
15932
|
-
|
|
15933
|
-
)
|
|
15934
|
-
|
|
15935
|
-
"node_modules/is-object/index.js"(exports$1, module) {
|
|
15936
|
-
module.exports = function isObject2(x2) {
|
|
15937
|
-
return typeof x2 === "object" && x2 !== null;
|
|
16029
|
+
let toastsCounter = 1;
|
|
16030
|
+
class Observer {
|
|
16031
|
+
constructor() {
|
|
16032
|
+
this.subscribe = (subscriber) => {
|
|
16033
|
+
this.subscribers.push(subscriber);
|
|
16034
|
+
return () => {
|
|
16035
|
+
const index2 = this.subscribers.indexOf(subscriber);
|
|
16036
|
+
this.subscribers.splice(index2, 1);
|
|
16037
|
+
};
|
|
15938
16038
|
};
|
|
15939
|
-
|
|
15940
|
-
|
|
15941
|
-
|
|
15942
|
-
|
|
15943
|
-
|
|
15944
|
-
|
|
15945
|
-
|
|
16039
|
+
this.publish = (data) => {
|
|
16040
|
+
this.subscribers.forEach((subscriber) => subscriber(data));
|
|
16041
|
+
};
|
|
16042
|
+
this.addToast = (data) => {
|
|
16043
|
+
this.publish(data);
|
|
16044
|
+
this.toasts = [
|
|
16045
|
+
...this.toasts,
|
|
16046
|
+
data
|
|
16047
|
+
];
|
|
16048
|
+
};
|
|
16049
|
+
this.create = (data) => {
|
|
16050
|
+
var _data_id;
|
|
16051
|
+
const { message, ...rest } = data;
|
|
16052
|
+
const id = typeof (data == null ? void 0 : data.id) === "number" || ((_data_id = data.id) == null ? void 0 : _data_id.length) > 0 ? data.id : toastsCounter++;
|
|
16053
|
+
const alreadyExists = this.toasts.find((toast2) => {
|
|
16054
|
+
return toast2.id === id;
|
|
16055
|
+
});
|
|
16056
|
+
const dismissible = data.dismissible === void 0 ? true : data.dismissible;
|
|
16057
|
+
if (this.dismissedToasts.has(id)) {
|
|
16058
|
+
this.dismissedToasts.delete(id);
|
|
15946
16059
|
}
|
|
15947
|
-
|
|
15948
|
-
|
|
16060
|
+
if (alreadyExists) {
|
|
16061
|
+
this.toasts = this.toasts.map((toast2) => {
|
|
16062
|
+
if (toast2.id === id) {
|
|
16063
|
+
this.publish({
|
|
16064
|
+
...toast2,
|
|
16065
|
+
...data,
|
|
16066
|
+
id,
|
|
16067
|
+
title: message
|
|
16068
|
+
});
|
|
16069
|
+
return {
|
|
16070
|
+
...toast2,
|
|
16071
|
+
...data,
|
|
16072
|
+
id,
|
|
16073
|
+
dismissible,
|
|
16074
|
+
title: message
|
|
16075
|
+
};
|
|
16076
|
+
}
|
|
16077
|
+
return toast2;
|
|
16078
|
+
});
|
|
16079
|
+
} else {
|
|
16080
|
+
this.addToast({
|
|
16081
|
+
title: message,
|
|
16082
|
+
...rest,
|
|
16083
|
+
dismissible,
|
|
16084
|
+
id
|
|
16085
|
+
});
|
|
16086
|
+
}
|
|
16087
|
+
return id;
|
|
15949
16088
|
};
|
|
15950
|
-
|
|
15951
|
-
|
|
15952
|
-
|
|
15953
|
-
|
|
15954
|
-
|
|
15955
|
-
|
|
15956
|
-
|
|
15957
|
-
|
|
15958
|
-
|
|
16089
|
+
this.dismiss = (id) => {
|
|
16090
|
+
if (id) {
|
|
16091
|
+
this.dismissedToasts.add(id);
|
|
16092
|
+
requestAnimationFrame(() => this.subscribers.forEach((subscriber) => subscriber({
|
|
16093
|
+
id,
|
|
16094
|
+
dismiss: true
|
|
16095
|
+
})));
|
|
16096
|
+
} else {
|
|
16097
|
+
this.toasts.forEach((toast2) => {
|
|
16098
|
+
this.subscribers.forEach((subscriber) => subscriber({
|
|
16099
|
+
id: toast2.id,
|
|
16100
|
+
dismiss: true
|
|
16101
|
+
}));
|
|
16102
|
+
});
|
|
15959
16103
|
}
|
|
15960
|
-
return
|
|
15961
|
-
}
|
|
15962
|
-
|
|
16104
|
+
return id;
|
|
16105
|
+
};
|
|
16106
|
+
this.message = (message, data) => {
|
|
16107
|
+
return this.create({
|
|
16108
|
+
...data,
|
|
16109
|
+
message
|
|
16110
|
+
});
|
|
16111
|
+
};
|
|
16112
|
+
this.error = (message, data) => {
|
|
16113
|
+
return this.create({
|
|
16114
|
+
...data,
|
|
16115
|
+
message,
|
|
16116
|
+
type: "error"
|
|
16117
|
+
});
|
|
16118
|
+
};
|
|
16119
|
+
this.success = (message, data) => {
|
|
16120
|
+
return this.create({
|
|
16121
|
+
...data,
|
|
16122
|
+
type: "success",
|
|
16123
|
+
message
|
|
16124
|
+
});
|
|
16125
|
+
};
|
|
16126
|
+
this.info = (message, data) => {
|
|
16127
|
+
return this.create({
|
|
16128
|
+
...data,
|
|
16129
|
+
type: "info",
|
|
16130
|
+
message
|
|
16131
|
+
});
|
|
16132
|
+
};
|
|
16133
|
+
this.warning = (message, data) => {
|
|
16134
|
+
return this.create({
|
|
16135
|
+
...data,
|
|
16136
|
+
type: "warning",
|
|
16137
|
+
message
|
|
16138
|
+
});
|
|
16139
|
+
};
|
|
16140
|
+
this.loading = (message, data) => {
|
|
16141
|
+
return this.create({
|
|
16142
|
+
...data,
|
|
16143
|
+
type: "loading",
|
|
16144
|
+
message
|
|
16145
|
+
});
|
|
16146
|
+
};
|
|
16147
|
+
this.promise = (promise, data) => {
|
|
16148
|
+
if (!data) {
|
|
16149
|
+
return;
|
|
16150
|
+
}
|
|
16151
|
+
let id = void 0;
|
|
16152
|
+
if (data.loading !== void 0) {
|
|
16153
|
+
id = this.create({
|
|
16154
|
+
...data,
|
|
16155
|
+
promise,
|
|
16156
|
+
type: "loading",
|
|
16157
|
+
message: data.loading,
|
|
16158
|
+
description: typeof data.description !== "function" ? data.description : void 0
|
|
16159
|
+
});
|
|
16160
|
+
}
|
|
16161
|
+
const p2 = Promise.resolve(promise instanceof Function ? promise() : promise);
|
|
16162
|
+
let shouldDismiss = id !== void 0;
|
|
16163
|
+
let result;
|
|
16164
|
+
const originalPromise = p2.then(async (response) => {
|
|
16165
|
+
result = [
|
|
16166
|
+
"resolve",
|
|
16167
|
+
response
|
|
16168
|
+
];
|
|
16169
|
+
const isReactElementResponse = ReactExports.isValidElement(response);
|
|
16170
|
+
if (isReactElementResponse) {
|
|
16171
|
+
shouldDismiss = false;
|
|
16172
|
+
this.create({
|
|
16173
|
+
id,
|
|
16174
|
+
type: "default",
|
|
16175
|
+
message: response
|
|
16176
|
+
});
|
|
16177
|
+
} else if (isHttpResponse(response) && !response.ok) {
|
|
16178
|
+
shouldDismiss = false;
|
|
16179
|
+
const promiseData = typeof data.error === "function" ? await data.error(`HTTP error! status: ${response.status}`) : data.error;
|
|
16180
|
+
const description = typeof data.description === "function" ? await data.description(`HTTP error! status: ${response.status}`) : data.description;
|
|
16181
|
+
const isExtendedResult = typeof promiseData === "object" && !ReactExports.isValidElement(promiseData);
|
|
16182
|
+
const toastSettings = isExtendedResult ? promiseData : {
|
|
16183
|
+
message: promiseData
|
|
16184
|
+
};
|
|
16185
|
+
this.create({
|
|
16186
|
+
id,
|
|
16187
|
+
type: "error",
|
|
16188
|
+
description,
|
|
16189
|
+
...toastSettings
|
|
16190
|
+
});
|
|
16191
|
+
} else if (response instanceof Error) {
|
|
16192
|
+
shouldDismiss = false;
|
|
16193
|
+
const promiseData = typeof data.error === "function" ? await data.error(response) : data.error;
|
|
16194
|
+
const description = typeof data.description === "function" ? await data.description(response) : data.description;
|
|
16195
|
+
const isExtendedResult = typeof promiseData === "object" && !ReactExports.isValidElement(promiseData);
|
|
16196
|
+
const toastSettings = isExtendedResult ? promiseData : {
|
|
16197
|
+
message: promiseData
|
|
16198
|
+
};
|
|
16199
|
+
this.create({
|
|
16200
|
+
id,
|
|
16201
|
+
type: "error",
|
|
16202
|
+
description,
|
|
16203
|
+
...toastSettings
|
|
16204
|
+
});
|
|
16205
|
+
} else if (data.success !== void 0) {
|
|
16206
|
+
shouldDismiss = false;
|
|
16207
|
+
const promiseData = typeof data.success === "function" ? await data.success(response) : data.success;
|
|
16208
|
+
const description = typeof data.description === "function" ? await data.description(response) : data.description;
|
|
16209
|
+
const isExtendedResult = typeof promiseData === "object" && !ReactExports.isValidElement(promiseData);
|
|
16210
|
+
const toastSettings = isExtendedResult ? promiseData : {
|
|
16211
|
+
message: promiseData
|
|
16212
|
+
};
|
|
16213
|
+
this.create({
|
|
16214
|
+
id,
|
|
16215
|
+
type: "success",
|
|
16216
|
+
description,
|
|
16217
|
+
...toastSettings
|
|
16218
|
+
});
|
|
16219
|
+
}
|
|
16220
|
+
}).catch(async (error) => {
|
|
16221
|
+
result = [
|
|
16222
|
+
"reject",
|
|
16223
|
+
error
|
|
16224
|
+
];
|
|
16225
|
+
if (data.error !== void 0) {
|
|
16226
|
+
shouldDismiss = false;
|
|
16227
|
+
const promiseData = typeof data.error === "function" ? await data.error(error) : data.error;
|
|
16228
|
+
const description = typeof data.description === "function" ? await data.description(error) : data.description;
|
|
16229
|
+
const isExtendedResult = typeof promiseData === "object" && !ReactExports.isValidElement(promiseData);
|
|
16230
|
+
const toastSettings = isExtendedResult ? promiseData : {
|
|
16231
|
+
message: promiseData
|
|
16232
|
+
};
|
|
16233
|
+
this.create({
|
|
16234
|
+
id,
|
|
16235
|
+
type: "error",
|
|
16236
|
+
description,
|
|
16237
|
+
...toastSettings
|
|
16238
|
+
});
|
|
16239
|
+
}
|
|
16240
|
+
}).finally(() => {
|
|
16241
|
+
if (shouldDismiss) {
|
|
16242
|
+
this.dismiss(id);
|
|
16243
|
+
id = void 0;
|
|
16244
|
+
}
|
|
16245
|
+
data.finally == null ? void 0 : data.finally.call(data);
|
|
16246
|
+
});
|
|
16247
|
+
const unwrap = () => new Promise((resolve, reject) => originalPromise.then(() => result[0] === "reject" ? reject(result[1]) : resolve(result[1])).catch(reject));
|
|
16248
|
+
if (typeof id !== "string" && typeof id !== "number") {
|
|
16249
|
+
return {
|
|
16250
|
+
unwrap
|
|
16251
|
+
};
|
|
16252
|
+
} else {
|
|
16253
|
+
return Object.assign(id, {
|
|
16254
|
+
unwrap
|
|
16255
|
+
});
|
|
16256
|
+
}
|
|
16257
|
+
};
|
|
16258
|
+
this.custom = (jsx, data) => {
|
|
16259
|
+
const id = (data == null ? void 0 : data.id) || toastsCounter++;
|
|
16260
|
+
this.create({
|
|
16261
|
+
jsx: jsx(id),
|
|
16262
|
+
id,
|
|
16263
|
+
...data
|
|
16264
|
+
});
|
|
16265
|
+
return id;
|
|
16266
|
+
};
|
|
16267
|
+
this.getActiveToasts = () => {
|
|
16268
|
+
return this.toasts.filter((toast2) => !this.dismissedToasts.has(toast2.id));
|
|
16269
|
+
};
|
|
16270
|
+
this.subscribers = [];
|
|
16271
|
+
this.toasts = [];
|
|
16272
|
+
this.dismissedToasts = /* @__PURE__ */ new Set();
|
|
15963
16273
|
}
|
|
15964
|
-
}
|
|
15965
|
-
|
|
15966
|
-
|
|
15967
|
-
|
|
15968
|
-
|
|
15969
|
-
|
|
15970
|
-
|
|
15971
|
-
|
|
15972
|
-
|
|
15973
|
-
|
|
15974
|
-
BASE_BACKGROUND_COLOR: "rgb(36, 36, 36)",
|
|
15975
|
-
BASE_COLOR: "rgb(213, 213, 213)",
|
|
15976
|
-
OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES: 10,
|
|
15977
|
-
OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES: 5,
|
|
15978
|
-
OBJECT_NAME_COLOR: "rgb(227, 110, 236)",
|
|
15979
|
-
OBJECT_VALUE_NULL_COLOR: "rgb(127, 127, 127)",
|
|
15980
|
-
OBJECT_VALUE_UNDEFINED_COLOR: "rgb(127, 127, 127)",
|
|
15981
|
-
OBJECT_VALUE_REGEXP_COLOR: "rgb(233, 63, 59)",
|
|
15982
|
-
OBJECT_VALUE_STRING_COLOR: "rgb(233, 63, 59)",
|
|
15983
|
-
OBJECT_VALUE_SYMBOL_COLOR: "rgb(233, 63, 59)",
|
|
15984
|
-
OBJECT_VALUE_NUMBER_COLOR: "hsl(252, 100%, 75%)",
|
|
15985
|
-
OBJECT_VALUE_BOOLEAN_COLOR: "hsl(252, 100%, 75%)",
|
|
15986
|
-
OBJECT_VALUE_FUNCTION_PREFIX_COLOR: "rgb(85, 106, 242)",
|
|
15987
|
-
HTML_TAG_COLOR: "rgb(93, 176, 215)",
|
|
15988
|
-
HTML_TAGNAME_COLOR: "rgb(93, 176, 215)",
|
|
15989
|
-
HTML_TAGNAME_TEXT_TRANSFORM: "lowercase",
|
|
15990
|
-
HTML_ATTRIBUTE_NAME_COLOR: "rgb(155, 187, 220)",
|
|
15991
|
-
HTML_ATTRIBUTE_VALUE_COLOR: "rgb(242, 151, 102)",
|
|
15992
|
-
HTML_COMMENT_COLOR: "rgb(137, 137, 137)",
|
|
15993
|
-
HTML_DOCTYPE_COLOR: "rgb(192, 192, 192)",
|
|
15994
|
-
ARROW_COLOR: "rgb(145, 145, 145)",
|
|
15995
|
-
ARROW_MARGIN_RIGHT: 3,
|
|
15996
|
-
ARROW_FONT_SIZE: 12,
|
|
15997
|
-
ARROW_ANIMATION_DURATION: "0",
|
|
15998
|
-
TREENODE_FONT_FAMILY: "Menlo, monospace",
|
|
15999
|
-
TREENODE_FONT_SIZE: "11px",
|
|
16000
|
-
TREENODE_LINE_HEIGHT: 1.2,
|
|
16001
|
-
TREENODE_PADDING_LEFT: 12,
|
|
16002
|
-
TABLE_BORDER_COLOR: "rgb(85, 85, 85)",
|
|
16003
|
-
TABLE_TH_BACKGROUND_COLOR: "rgb(44, 44, 44)",
|
|
16004
|
-
TABLE_TH_HOVER_COLOR: "rgb(48, 48, 48)",
|
|
16005
|
-
TABLE_SORT_ICON_COLOR: "black",
|
|
16006
|
-
//'rgb(48, 57, 66)',
|
|
16007
|
-
TABLE_DATA_BACKGROUND_IMAGE: "linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0) 50%, rgba(51, 139, 255, 0.0980392) 50%, rgba(51, 139, 255, 0.0980392))",
|
|
16008
|
-
TABLE_DATA_BACKGROUND_SIZE: "128px 32px"
|
|
16274
|
+
}
|
|
16275
|
+
const ToastState = new Observer();
|
|
16276
|
+
const toastFunction = (message, data) => {
|
|
16277
|
+
const id = (data == null ? void 0 : data.id) || toastsCounter++;
|
|
16278
|
+
ToastState.addToast({
|
|
16279
|
+
title: message,
|
|
16280
|
+
...data,
|
|
16281
|
+
id
|
|
16282
|
+
});
|
|
16283
|
+
return id;
|
|
16009
16284
|
};
|
|
16010
|
-
|
|
16011
|
-
|
|
16012
|
-
BASE_FONT_SIZE: "11px",
|
|
16013
|
-
BASE_LINE_HEIGHT: 1.2,
|
|
16014
|
-
BASE_BACKGROUND_COLOR: "white",
|
|
16015
|
-
BASE_COLOR: "black",
|
|
16016
|
-
OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES: 10,
|
|
16017
|
-
OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES: 5,
|
|
16018
|
-
OBJECT_NAME_COLOR: "rgb(136, 19, 145)",
|
|
16019
|
-
OBJECT_VALUE_NULL_COLOR: "rgb(128, 128, 128)",
|
|
16020
|
-
OBJECT_VALUE_UNDEFINED_COLOR: "rgb(128, 128, 128)",
|
|
16021
|
-
OBJECT_VALUE_REGEXP_COLOR: "rgb(196, 26, 22)",
|
|
16022
|
-
OBJECT_VALUE_STRING_COLOR: "rgb(196, 26, 22)",
|
|
16023
|
-
OBJECT_VALUE_SYMBOL_COLOR: "rgb(196, 26, 22)",
|
|
16024
|
-
OBJECT_VALUE_NUMBER_COLOR: "rgb(28, 0, 207)",
|
|
16025
|
-
OBJECT_VALUE_BOOLEAN_COLOR: "rgb(28, 0, 207)",
|
|
16026
|
-
OBJECT_VALUE_FUNCTION_PREFIX_COLOR: "rgb(13, 34, 170)",
|
|
16027
|
-
HTML_TAG_COLOR: "rgb(168, 148, 166)",
|
|
16028
|
-
HTML_TAGNAME_COLOR: "rgb(136, 18, 128)",
|
|
16029
|
-
HTML_TAGNAME_TEXT_TRANSFORM: "lowercase",
|
|
16030
|
-
HTML_ATTRIBUTE_NAME_COLOR: "rgb(153, 69, 0)",
|
|
16031
|
-
HTML_ATTRIBUTE_VALUE_COLOR: "rgb(26, 26, 166)",
|
|
16032
|
-
HTML_COMMENT_COLOR: "rgb(35, 110, 37)",
|
|
16033
|
-
HTML_DOCTYPE_COLOR: "rgb(192, 192, 192)",
|
|
16034
|
-
ARROW_COLOR: "#6e6e6e",
|
|
16035
|
-
ARROW_MARGIN_RIGHT: 3,
|
|
16036
|
-
ARROW_FONT_SIZE: 12,
|
|
16037
|
-
ARROW_ANIMATION_DURATION: "0",
|
|
16038
|
-
TREENODE_FONT_FAMILY: "Menlo, monospace",
|
|
16039
|
-
TREENODE_FONT_SIZE: "11px",
|
|
16040
|
-
TREENODE_LINE_HEIGHT: 1.2,
|
|
16041
|
-
TREENODE_PADDING_LEFT: 12,
|
|
16042
|
-
TABLE_BORDER_COLOR: "#aaa",
|
|
16043
|
-
TABLE_TH_BACKGROUND_COLOR: "#eee",
|
|
16044
|
-
TABLE_TH_HOVER_COLOR: "hsla(0, 0%, 90%, 1)",
|
|
16045
|
-
TABLE_SORT_ICON_COLOR: "#6e6e6e",
|
|
16046
|
-
TABLE_DATA_BACKGROUND_IMAGE: "linear-gradient(to bottom, white, white 50%, rgb(234, 243, 255) 50%, rgb(234, 243, 255))",
|
|
16047
|
-
TABLE_DATA_BACKGROUND_SIZE: "128px 32px"
|
|
16285
|
+
const isHttpResponse = (data) => {
|
|
16286
|
+
return data && typeof data === "object" && "ok" in data && typeof data.ok === "boolean" && "status" in data && typeof data.status === "number";
|
|
16048
16287
|
};
|
|
16049
|
-
|
|
16050
|
-
|
|
16051
|
-
|
|
16052
|
-
|
|
16053
|
-
|
|
16054
|
-
|
|
16055
|
-
|
|
16056
|
-
|
|
16057
|
-
|
|
16058
|
-
|
|
16059
|
-
|
|
16060
|
-
|
|
16061
|
-
|
|
16062
|
-
|
|
16063
|
-
|
|
16064
|
-
|
|
16065
|
-
|
|
16066
|
-
tagName: {
|
|
16067
|
-
|
|
16068
|
-
|
|
16069
|
-
|
|
16070
|
-
|
|
16071
|
-
|
|
16072
|
-
|
|
16073
|
-
|
|
16074
|
-
|
|
16288
|
+
const basicToast = toastFunction;
|
|
16289
|
+
const getHistory = () => ToastState.toasts;
|
|
16290
|
+
const getToasts = () => ToastState.getActiveToasts();
|
|
16291
|
+
const toast = Object.assign(basicToast, {
|
|
16292
|
+
success: ToastState.success,
|
|
16293
|
+
info: ToastState.info,
|
|
16294
|
+
warning: ToastState.warning,
|
|
16295
|
+
error: ToastState.error,
|
|
16296
|
+
custom: ToastState.custom,
|
|
16297
|
+
message: ToastState.message,
|
|
16298
|
+
promise: ToastState.promise,
|
|
16299
|
+
dismiss: ToastState.dismiss,
|
|
16300
|
+
loading: ToastState.loading
|
|
16301
|
+
}, {
|
|
16302
|
+
getHistory,
|
|
16303
|
+
getToasts
|
|
16304
|
+
});
|
|
16305
|
+
__insertCSS("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
|
|
16306
|
+
function isAction(action) {
|
|
16307
|
+
return action.label !== void 0;
|
|
16308
|
+
}
|
|
16309
|
+
const VISIBLE_TOASTS_AMOUNT = 3;
|
|
16310
|
+
const VIEWPORT_OFFSET = "24px";
|
|
16311
|
+
const MOBILE_VIEWPORT_OFFSET = "16px";
|
|
16312
|
+
const TOAST_LIFETIME = 4e3;
|
|
16313
|
+
const TOAST_WIDTH = 356;
|
|
16314
|
+
const GAP = 14;
|
|
16315
|
+
const SWIPE_THRESHOLD = 45;
|
|
16316
|
+
const TIME_BEFORE_UNMOUNT = 200;
|
|
16317
|
+
function cn$3(...classes) {
|
|
16318
|
+
return classes.filter(Boolean).join(" ");
|
|
16319
|
+
}
|
|
16320
|
+
function getDefaultSwipeDirections(position2) {
|
|
16321
|
+
const [y2, x2] = position2.split("-");
|
|
16322
|
+
const directions = [];
|
|
16323
|
+
if (y2) {
|
|
16324
|
+
directions.push(y2);
|
|
16325
|
+
}
|
|
16326
|
+
if (x2) {
|
|
16327
|
+
directions.push(x2);
|
|
16328
|
+
}
|
|
16329
|
+
return directions;
|
|
16330
|
+
}
|
|
16331
|
+
const Toast = (props) => {
|
|
16332
|
+
var _toast_classNames, _toast_classNames1, _toast_classNames2, _toast_classNames3, _toast_classNames4, _toast_classNames5, _toast_classNames6, _toast_classNames7, _toast_classNames8;
|
|
16333
|
+
const { invert: ToasterInvert, toast: toast2, unstyled, interacting, setHeights, visibleToasts, heights, index: index2, toasts, expanded: expanded2, removeToast, defaultRichColors, closeButton: closeButtonFromToaster, style: style2, cancelButtonStyle, actionButtonStyle, className = "", descriptionClassName = "", duration: durationFromToaster, position: position2, gap, expandByDefault, classNames, icons, closeButtonAriaLabel = "Close toast" } = props;
|
|
16334
|
+
const [swipeDirection, setSwipeDirection] = ReactExports.useState(null);
|
|
16335
|
+
const [swipeOutDirection, setSwipeOutDirection] = ReactExports.useState(null);
|
|
16336
|
+
const [mounted, setMounted] = ReactExports.useState(false);
|
|
16337
|
+
const [removed, setRemoved] = ReactExports.useState(false);
|
|
16338
|
+
const [swiping, setSwiping] = ReactExports.useState(false);
|
|
16339
|
+
const [swipeOut, setSwipeOut] = ReactExports.useState(false);
|
|
16340
|
+
const [isSwiped, setIsSwiped] = ReactExports.useState(false);
|
|
16341
|
+
const [offsetBeforeRemove, setOffsetBeforeRemove] = ReactExports.useState(0);
|
|
16342
|
+
const [initialHeight, setInitialHeight] = ReactExports.useState(0);
|
|
16343
|
+
const remainingTime = ReactExports.useRef(toast2.duration || durationFromToaster || TOAST_LIFETIME);
|
|
16344
|
+
const dragStartTime = ReactExports.useRef(null);
|
|
16345
|
+
const toastRef = ReactExports.useRef(null);
|
|
16346
|
+
const isFront = index2 === 0;
|
|
16347
|
+
const isVisible = index2 + 1 <= visibleToasts;
|
|
16348
|
+
const toastType = toast2.type;
|
|
16349
|
+
const dismissible = toast2.dismissible !== false;
|
|
16350
|
+
const toastClassname = toast2.className || "";
|
|
16351
|
+
const toastDescriptionClassname = toast2.descriptionClassName || "";
|
|
16352
|
+
const heightIndex = ReactExports.useMemo(() => heights.findIndex((height) => height.toastId === toast2.id) || 0, [
|
|
16353
|
+
heights,
|
|
16354
|
+
toast2.id
|
|
16355
|
+
]);
|
|
16356
|
+
const closeButton = ReactExports.useMemo(() => {
|
|
16357
|
+
var _toast_closeButton;
|
|
16358
|
+
return (_toast_closeButton = toast2.closeButton) != null ? _toast_closeButton : closeButtonFromToaster;
|
|
16359
|
+
}, [
|
|
16360
|
+
toast2.closeButton,
|
|
16361
|
+
closeButtonFromToaster
|
|
16362
|
+
]);
|
|
16363
|
+
const duration2 = ReactExports.useMemo(() => toast2.duration || durationFromToaster || TOAST_LIFETIME, [
|
|
16364
|
+
toast2.duration,
|
|
16365
|
+
durationFromToaster
|
|
16366
|
+
]);
|
|
16367
|
+
const closeTimerStartTimeRef = ReactExports.useRef(0);
|
|
16368
|
+
const offset2 = ReactExports.useRef(0);
|
|
16369
|
+
const lastCloseTimerStartTimeRef = ReactExports.useRef(0);
|
|
16370
|
+
const pointerStartRef = ReactExports.useRef(null);
|
|
16371
|
+
const [y2, x2] = position2.split("-");
|
|
16372
|
+
const toastsHeightBefore = ReactExports.useMemo(() => {
|
|
16373
|
+
return heights.reduce((prev, curr, reducerIndex) => {
|
|
16374
|
+
if (reducerIndex >= heightIndex) {
|
|
16375
|
+
return prev;
|
|
16075
16376
|
}
|
|
16076
|
-
|
|
16077
|
-
|
|
16078
|
-
|
|
16079
|
-
|
|
16080
|
-
|
|
16081
|
-
|
|
16082
|
-
|
|
16083
|
-
|
|
16084
|
-
|
|
16085
|
-
|
|
16086
|
-
|
|
16087
|
-
|
|
16377
|
+
return prev + curr.height;
|
|
16378
|
+
}, 0);
|
|
16379
|
+
}, [
|
|
16380
|
+
heights,
|
|
16381
|
+
heightIndex
|
|
16382
|
+
]);
|
|
16383
|
+
const isDocumentHidden = useIsDocumentHidden();
|
|
16384
|
+
const invert = toast2.invert || ToasterInvert;
|
|
16385
|
+
const disabled = toastType === "loading";
|
|
16386
|
+
offset2.current = ReactExports.useMemo(() => heightIndex * gap + toastsHeightBefore, [
|
|
16387
|
+
heightIndex,
|
|
16388
|
+
toastsHeightBefore
|
|
16389
|
+
]);
|
|
16390
|
+
ReactExports.useEffect(() => {
|
|
16391
|
+
remainingTime.current = duration2;
|
|
16392
|
+
}, [
|
|
16393
|
+
duration2
|
|
16394
|
+
]);
|
|
16395
|
+
ReactExports.useEffect(() => {
|
|
16396
|
+
setMounted(true);
|
|
16397
|
+
}, []);
|
|
16398
|
+
ReactExports.useEffect(() => {
|
|
16399
|
+
const toastNode = toastRef.current;
|
|
16400
|
+
if (toastNode) {
|
|
16401
|
+
const height = toastNode.getBoundingClientRect().height;
|
|
16402
|
+
setInitialHeight(height);
|
|
16403
|
+
setHeights((h2) => [
|
|
16404
|
+
{
|
|
16405
|
+
toastId: toast2.id,
|
|
16406
|
+
height,
|
|
16407
|
+
position: toast2.position
|
|
16408
|
+
},
|
|
16409
|
+
...h2
|
|
16410
|
+
]);
|
|
16411
|
+
return () => setHeights((h2) => h2.filter((height2) => height2.toastId !== toast2.id));
|
|
16412
|
+
}
|
|
16413
|
+
}, [
|
|
16414
|
+
setHeights,
|
|
16415
|
+
toast2.id
|
|
16416
|
+
]);
|
|
16417
|
+
ReactExports.useLayoutEffect(() => {
|
|
16418
|
+
if (!mounted) return;
|
|
16419
|
+
const toastNode = toastRef.current;
|
|
16420
|
+
const originalHeight = toastNode.style.height;
|
|
16421
|
+
toastNode.style.height = "auto";
|
|
16422
|
+
const newHeight = toastNode.getBoundingClientRect().height;
|
|
16423
|
+
toastNode.style.height = originalHeight;
|
|
16424
|
+
setInitialHeight(newHeight);
|
|
16425
|
+
setHeights((heights2) => {
|
|
16426
|
+
const alreadyExists = heights2.find((height) => height.toastId === toast2.id);
|
|
16427
|
+
if (!alreadyExists) {
|
|
16428
|
+
return [
|
|
16429
|
+
{
|
|
16430
|
+
toastId: toast2.id,
|
|
16431
|
+
height: newHeight,
|
|
16432
|
+
position: toast2.position
|
|
16433
|
+
},
|
|
16434
|
+
...heights2
|
|
16435
|
+
];
|
|
16436
|
+
} else {
|
|
16437
|
+
return heights2.map((height) => height.toastId === toast2.id ? {
|
|
16438
|
+
...height,
|
|
16439
|
+
height: newHeight
|
|
16440
|
+
} : height);
|
|
16088
16441
|
}
|
|
16089
|
-
}
|
|
16090
|
-
|
|
16091
|
-
|
|
16092
|
-
|
|
16093
|
-
|
|
16094
|
-
|
|
16442
|
+
});
|
|
16443
|
+
}, [
|
|
16444
|
+
mounted,
|
|
16445
|
+
toast2.title,
|
|
16446
|
+
toast2.description,
|
|
16447
|
+
setHeights,
|
|
16448
|
+
toast2.id,
|
|
16449
|
+
toast2.jsx,
|
|
16450
|
+
toast2.action,
|
|
16451
|
+
toast2.cancel
|
|
16452
|
+
]);
|
|
16453
|
+
const deleteToast = ReactExports.useCallback(() => {
|
|
16454
|
+
setRemoved(true);
|
|
16455
|
+
setOffsetBeforeRemove(offset2.current);
|
|
16456
|
+
setHeights((h2) => h2.filter((height) => height.toastId !== toast2.id));
|
|
16457
|
+
setTimeout(() => {
|
|
16458
|
+
removeToast(toast2);
|
|
16459
|
+
}, TIME_BEFORE_UNMOUNT);
|
|
16460
|
+
}, [
|
|
16461
|
+
toast2,
|
|
16462
|
+
removeToast,
|
|
16463
|
+
setHeights,
|
|
16464
|
+
offset2
|
|
16465
|
+
]);
|
|
16466
|
+
ReactExports.useEffect(() => {
|
|
16467
|
+
if (toast2.promise && toastType === "loading" || toast2.duration === Infinity || toast2.type === "loading") return;
|
|
16468
|
+
let timeoutId;
|
|
16469
|
+
const pauseTimer = () => {
|
|
16470
|
+
if (lastCloseTimerStartTimeRef.current < closeTimerStartTimeRef.current) {
|
|
16471
|
+
const elapsedTime = (/* @__PURE__ */ new Date()).getTime() - closeTimerStartTimeRef.current;
|
|
16472
|
+
remainingTime.current = remainingTime.current - elapsedTime;
|
|
16473
|
+
}
|
|
16474
|
+
lastCloseTimerStartTimeRef.current = (/* @__PURE__ */ new Date()).getTime();
|
|
16475
|
+
};
|
|
16476
|
+
const startTimer = () => {
|
|
16477
|
+
if (remainingTime.current === Infinity) return;
|
|
16478
|
+
closeTimerStartTimeRef.current = (/* @__PURE__ */ new Date()).getTime();
|
|
16479
|
+
timeoutId = setTimeout(() => {
|
|
16480
|
+
toast2.onAutoClose == null ? void 0 : toast2.onAutoClose.call(toast2, toast2);
|
|
16481
|
+
deleteToast();
|
|
16482
|
+
}, remainingTime.current);
|
|
16483
|
+
};
|
|
16484
|
+
if (expanded2 || interacting || isDocumentHidden) {
|
|
16485
|
+
pauseTimer();
|
|
16486
|
+
} else {
|
|
16487
|
+
startTimer();
|
|
16095
16488
|
}
|
|
16096
|
-
|
|
16097
|
-
|
|
16098
|
-
|
|
16099
|
-
|
|
16100
|
-
|
|
16101
|
-
|
|
16102
|
-
|
|
16103
|
-
|
|
16104
|
-
|
|
16105
|
-
|
|
16106
|
-
|
|
16107
|
-
|
|
16108
|
-
|
|
16109
|
-
color: theme3.OBJECT_NAME_COLOR
|
|
16110
|
-
},
|
|
16111
|
-
dimmed: {
|
|
16112
|
-
opacity: 0.6
|
|
16489
|
+
return () => clearTimeout(timeoutId);
|
|
16490
|
+
}, [
|
|
16491
|
+
expanded2,
|
|
16492
|
+
interacting,
|
|
16493
|
+
toast2,
|
|
16494
|
+
toastType,
|
|
16495
|
+
isDocumentHidden,
|
|
16496
|
+
deleteToast
|
|
16497
|
+
]);
|
|
16498
|
+
ReactExports.useEffect(() => {
|
|
16499
|
+
if (toast2.delete) {
|
|
16500
|
+
deleteToast();
|
|
16501
|
+
toast2.onDismiss == null ? void 0 : toast2.onDismiss.call(toast2, toast2);
|
|
16113
16502
|
}
|
|
16114
|
-
},
|
|
16115
|
-
|
|
16116
|
-
|
|
16117
|
-
|
|
16118
|
-
|
|
16119
|
-
|
|
16120
|
-
|
|
16503
|
+
}, [
|
|
16504
|
+
deleteToast,
|
|
16505
|
+
toast2.delete
|
|
16506
|
+
]);
|
|
16507
|
+
function getLoadingIcon() {
|
|
16508
|
+
var _toast_classNames9;
|
|
16509
|
+
if (icons == null ? void 0 : icons.loading) {
|
|
16510
|
+
var _toast_classNames12;
|
|
16511
|
+
return /* @__PURE__ */ ReactExports.createElement("div", {
|
|
16512
|
+
className: cn$3(classNames == null ? void 0 : classNames.loader, toast2 == null ? void 0 : (_toast_classNames12 = toast2.classNames) == null ? void 0 : _toast_classNames12.loader, "sonner-loader"),
|
|
16513
|
+
"data-visible": toastType === "loading"
|
|
16514
|
+
}, icons.loading);
|
|
16515
|
+
}
|
|
16516
|
+
return /* @__PURE__ */ ReactExports.createElement(Loader, {
|
|
16517
|
+
className: cn$3(classNames == null ? void 0 : classNames.loader, toast2 == null ? void 0 : (_toast_classNames9 = toast2.classNames) == null ? void 0 : _toast_classNames9.loader),
|
|
16518
|
+
visible: toastType === "loading"
|
|
16519
|
+
});
|
|
16520
|
+
}
|
|
16521
|
+
const icon = toast2.icon || (icons == null ? void 0 : icons[toastType]) || getAsset(toastType);
|
|
16522
|
+
var _toast_richColors, _icons_close;
|
|
16523
|
+
return /* @__PURE__ */ ReactExports.createElement("li", {
|
|
16524
|
+
tabIndex: 0,
|
|
16525
|
+
ref: toastRef,
|
|
16526
|
+
className: cn$3(className, toastClassname, classNames == null ? void 0 : classNames.toast, toast2 == null ? void 0 : (_toast_classNames = toast2.classNames) == null ? void 0 : _toast_classNames.toast, classNames == null ? void 0 : classNames.default, classNames == null ? void 0 : classNames[toastType], toast2 == null ? void 0 : (_toast_classNames1 = toast2.classNames) == null ? void 0 : _toast_classNames1[toastType]),
|
|
16527
|
+
"data-sonner-toast": "",
|
|
16528
|
+
"data-rich-colors": (_toast_richColors = toast2.richColors) != null ? _toast_richColors : defaultRichColors,
|
|
16529
|
+
"data-styled": !Boolean(toast2.jsx || toast2.unstyled || unstyled),
|
|
16530
|
+
"data-mounted": mounted,
|
|
16531
|
+
"data-promise": Boolean(toast2.promise),
|
|
16532
|
+
"data-swiped": isSwiped,
|
|
16533
|
+
"data-removed": removed,
|
|
16534
|
+
"data-visible": isVisible,
|
|
16535
|
+
"data-y-position": y2,
|
|
16536
|
+
"data-x-position": x2,
|
|
16537
|
+
"data-index": index2,
|
|
16538
|
+
"data-front": isFront,
|
|
16539
|
+
"data-swiping": swiping,
|
|
16540
|
+
"data-dismissible": dismissible,
|
|
16541
|
+
"data-type": toastType,
|
|
16542
|
+
"data-invert": invert,
|
|
16543
|
+
"data-swipe-out": swipeOut,
|
|
16544
|
+
"data-swipe-direction": swipeOutDirection,
|
|
16545
|
+
"data-expanded": Boolean(expanded2 || expandByDefault && mounted),
|
|
16546
|
+
"data-testid": toast2.testId,
|
|
16547
|
+
style: {
|
|
16548
|
+
"--index": index2,
|
|
16549
|
+
"--toasts-before": index2,
|
|
16550
|
+
"--z-index": toasts.length - index2,
|
|
16551
|
+
"--offset": `${removed ? offsetBeforeRemove : offset2.current}px`,
|
|
16552
|
+
"--initial-height": expandByDefault ? "auto" : `${initialHeight}px`,
|
|
16553
|
+
...style2,
|
|
16554
|
+
...toast2.style
|
|
16121
16555
|
},
|
|
16122
|
-
|
|
16123
|
-
|
|
16556
|
+
onDragEnd: () => {
|
|
16557
|
+
setSwiping(false);
|
|
16558
|
+
setSwipeDirection(null);
|
|
16559
|
+
pointerStartRef.current = null;
|
|
16124
16560
|
},
|
|
16125
|
-
|
|
16126
|
-
|
|
16561
|
+
onPointerDown: (event) => {
|
|
16562
|
+
if (event.button === 2) return;
|
|
16563
|
+
if (disabled || !dismissible) return;
|
|
16564
|
+
dragStartTime.current = /* @__PURE__ */ new Date();
|
|
16565
|
+
setOffsetBeforeRemove(offset2.current);
|
|
16566
|
+
event.target.setPointerCapture(event.pointerId);
|
|
16567
|
+
if (event.target.tagName === "BUTTON") return;
|
|
16568
|
+
setSwiping(true);
|
|
16569
|
+
pointerStartRef.current = {
|
|
16570
|
+
x: event.clientX,
|
|
16571
|
+
y: event.clientY
|
|
16572
|
+
};
|
|
16127
16573
|
},
|
|
16128
|
-
|
|
16129
|
-
|
|
16574
|
+
onPointerUp: () => {
|
|
16575
|
+
var _toastRef_current, _toastRef_current1, _dragStartTime_current;
|
|
16576
|
+
if (swipeOut || !dismissible) return;
|
|
16577
|
+
pointerStartRef.current = null;
|
|
16578
|
+
const swipeAmountX = Number(((_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0);
|
|
16579
|
+
const swipeAmountY = Number(((_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0);
|
|
16580
|
+
const timeTaken = (/* @__PURE__ */ new Date()).getTime() - ((_dragStartTime_current = dragStartTime.current) == null ? void 0 : _dragStartTime_current.getTime());
|
|
16581
|
+
const swipeAmount = swipeDirection === "x" ? swipeAmountX : swipeAmountY;
|
|
16582
|
+
const velocity = Math.abs(swipeAmount) / timeTaken;
|
|
16583
|
+
if (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > 0.11) {
|
|
16584
|
+
setOffsetBeforeRemove(offset2.current);
|
|
16585
|
+
toast2.onDismiss == null ? void 0 : toast2.onDismiss.call(toast2, toast2);
|
|
16586
|
+
if (swipeDirection === "x") {
|
|
16587
|
+
setSwipeOutDirection(swipeAmountX > 0 ? "right" : "left");
|
|
16588
|
+
} else {
|
|
16589
|
+
setSwipeOutDirection(swipeAmountY > 0 ? "down" : "up");
|
|
16590
|
+
}
|
|
16591
|
+
deleteToast();
|
|
16592
|
+
setSwipeOut(true);
|
|
16593
|
+
return;
|
|
16594
|
+
} else {
|
|
16595
|
+
var _toastRef_current2, _toastRef_current3;
|
|
16596
|
+
(_toastRef_current2 = toastRef.current) == null ? void 0 : _toastRef_current2.style.setProperty("--swipe-amount-x", `0px`);
|
|
16597
|
+
(_toastRef_current3 = toastRef.current) == null ? void 0 : _toastRef_current3.style.setProperty("--swipe-amount-y", `0px`);
|
|
16598
|
+
}
|
|
16599
|
+
setIsSwiped(false);
|
|
16600
|
+
setSwiping(false);
|
|
16601
|
+
setSwipeDirection(null);
|
|
16130
16602
|
},
|
|
16131
|
-
|
|
16132
|
-
|
|
16603
|
+
onPointerMove: (event) => {
|
|
16604
|
+
var _window_getSelection, _toastRef_current, _toastRef_current1;
|
|
16605
|
+
if (!pointerStartRef.current || !dismissible) return;
|
|
16606
|
+
const isHighlighted = ((_window_getSelection = window.getSelection()) == null ? void 0 : _window_getSelection.toString().length) > 0;
|
|
16607
|
+
if (isHighlighted) return;
|
|
16608
|
+
const yDelta = event.clientY - pointerStartRef.current.y;
|
|
16609
|
+
const xDelta = event.clientX - pointerStartRef.current.x;
|
|
16610
|
+
var _props_swipeDirections;
|
|
16611
|
+
const swipeDirections = (_props_swipeDirections = props.swipeDirections) != null ? _props_swipeDirections : getDefaultSwipeDirections(position2);
|
|
16612
|
+
if (!swipeDirection && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) {
|
|
16613
|
+
setSwipeDirection(Math.abs(xDelta) > Math.abs(yDelta) ? "x" : "y");
|
|
16614
|
+
}
|
|
16615
|
+
let swipeAmount = {
|
|
16616
|
+
x: 0,
|
|
16617
|
+
y: 0
|
|
16618
|
+
};
|
|
16619
|
+
const getDampening = (delta) => {
|
|
16620
|
+
const factor = Math.abs(delta) / 20;
|
|
16621
|
+
return 1 / (1.5 + factor);
|
|
16622
|
+
};
|
|
16623
|
+
if (swipeDirection === "y") {
|
|
16624
|
+
if (swipeDirections.includes("top") || swipeDirections.includes("bottom")) {
|
|
16625
|
+
if (swipeDirections.includes("top") && yDelta < 0 || swipeDirections.includes("bottom") && yDelta > 0) {
|
|
16626
|
+
swipeAmount.y = yDelta;
|
|
16627
|
+
} else {
|
|
16628
|
+
const dampenedDelta = yDelta * getDampening(yDelta);
|
|
16629
|
+
swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta;
|
|
16630
|
+
}
|
|
16631
|
+
}
|
|
16632
|
+
} else if (swipeDirection === "x") {
|
|
16633
|
+
if (swipeDirections.includes("left") || swipeDirections.includes("right")) {
|
|
16634
|
+
if (swipeDirections.includes("left") && xDelta < 0 || swipeDirections.includes("right") && xDelta > 0) {
|
|
16635
|
+
swipeAmount.x = xDelta;
|
|
16636
|
+
} else {
|
|
16637
|
+
const dampenedDelta = xDelta * getDampening(xDelta);
|
|
16638
|
+
swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta;
|
|
16639
|
+
}
|
|
16640
|
+
}
|
|
16641
|
+
}
|
|
16642
|
+
if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) {
|
|
16643
|
+
setIsSwiped(true);
|
|
16644
|
+
}
|
|
16645
|
+
(_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.setProperty("--swipe-amount-x", `${swipeAmount.x}px`);
|
|
16646
|
+
(_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.setProperty("--swipe-amount-y", `${swipeAmount.y}px`);
|
|
16647
|
+
}
|
|
16648
|
+
}, closeButton && !toast2.jsx && toastType !== "loading" ? /* @__PURE__ */ ReactExports.createElement("button", {
|
|
16649
|
+
"aria-label": closeButtonAriaLabel,
|
|
16650
|
+
"data-disabled": disabled,
|
|
16651
|
+
"data-close-button": true,
|
|
16652
|
+
onClick: disabled || !dismissible ? () => {
|
|
16653
|
+
} : () => {
|
|
16654
|
+
deleteToast();
|
|
16655
|
+
toast2.onDismiss == null ? void 0 : toast2.onDismiss.call(toast2, toast2);
|
|
16133
16656
|
},
|
|
16134
|
-
|
|
16135
|
-
|
|
16657
|
+
className: cn$3(classNames == null ? void 0 : classNames.closeButton, toast2 == null ? void 0 : (_toast_classNames2 = toast2.classNames) == null ? void 0 : _toast_classNames2.closeButton)
|
|
16658
|
+
}, (_icons_close = icons == null ? void 0 : icons.close) != null ? _icons_close : CloseIcon) : null, (toastType || toast2.icon || toast2.promise) && toast2.icon !== null && ((icons == null ? void 0 : icons[toastType]) !== null || toast2.icon) ? /* @__PURE__ */ ReactExports.createElement("div", {
|
|
16659
|
+
"data-icon": "",
|
|
16660
|
+
className: cn$3(classNames == null ? void 0 : classNames.icon, toast2 == null ? void 0 : (_toast_classNames3 = toast2.classNames) == null ? void 0 : _toast_classNames3.icon)
|
|
16661
|
+
}, toast2.promise || toast2.type === "loading" && !toast2.icon ? toast2.icon || getLoadingIcon() : null, toast2.type !== "loading" ? icon : null) : null, /* @__PURE__ */ ReactExports.createElement("div", {
|
|
16662
|
+
"data-content": "",
|
|
16663
|
+
className: cn$3(classNames == null ? void 0 : classNames.content, toast2 == null ? void 0 : (_toast_classNames4 = toast2.classNames) == null ? void 0 : _toast_classNames4.content)
|
|
16664
|
+
}, /* @__PURE__ */ ReactExports.createElement("div", {
|
|
16665
|
+
"data-title": "",
|
|
16666
|
+
className: cn$3(classNames == null ? void 0 : classNames.title, toast2 == null ? void 0 : (_toast_classNames5 = toast2.classNames) == null ? void 0 : _toast_classNames5.title)
|
|
16667
|
+
}, toast2.jsx ? toast2.jsx : typeof toast2.title === "function" ? toast2.title() : toast2.title), toast2.description ? /* @__PURE__ */ ReactExports.createElement("div", {
|
|
16668
|
+
"data-description": "",
|
|
16669
|
+
className: cn$3(descriptionClassName, toastDescriptionClassname, classNames == null ? void 0 : classNames.description, toast2 == null ? void 0 : (_toast_classNames6 = toast2.classNames) == null ? void 0 : _toast_classNames6.description)
|
|
16670
|
+
}, typeof toast2.description === "function" ? toast2.description() : toast2.description) : null), /* @__PURE__ */ ReactExports.isValidElement(toast2.cancel) ? toast2.cancel : toast2.cancel && isAction(toast2.cancel) ? /* @__PURE__ */ ReactExports.createElement("button", {
|
|
16671
|
+
"data-button": true,
|
|
16672
|
+
"data-cancel": true,
|
|
16673
|
+
style: toast2.cancelButtonStyle || cancelButtonStyle,
|
|
16674
|
+
onClick: (event) => {
|
|
16675
|
+
if (!isAction(toast2.cancel)) return;
|
|
16676
|
+
if (!dismissible) return;
|
|
16677
|
+
toast2.cancel.onClick == null ? void 0 : toast2.cancel.onClick.call(toast2.cancel, event);
|
|
16678
|
+
deleteToast();
|
|
16136
16679
|
},
|
|
16137
|
-
|
|
16138
|
-
|
|
16139
|
-
|
|
16680
|
+
className: cn$3(classNames == null ? void 0 : classNames.cancelButton, toast2 == null ? void 0 : (_toast_classNames7 = toast2.classNames) == null ? void 0 : _toast_classNames7.cancelButton)
|
|
16681
|
+
}, toast2.cancel.label) : null, /* @__PURE__ */ ReactExports.isValidElement(toast2.action) ? toast2.action : toast2.action && isAction(toast2.action) ? /* @__PURE__ */ ReactExports.createElement("button", {
|
|
16682
|
+
"data-button": true,
|
|
16683
|
+
"data-action": true,
|
|
16684
|
+
style: toast2.actionButtonStyle || actionButtonStyle,
|
|
16685
|
+
onClick: (event) => {
|
|
16686
|
+
if (!isAction(toast2.action)) return;
|
|
16687
|
+
toast2.action.onClick == null ? void 0 : toast2.action.onClick.call(toast2.action, event);
|
|
16688
|
+
if (event.defaultPrevented) return;
|
|
16689
|
+
deleteToast();
|
|
16140
16690
|
},
|
|
16141
|
-
|
|
16142
|
-
|
|
16143
|
-
|
|
16144
|
-
|
|
16145
|
-
|
|
16146
|
-
|
|
16147
|
-
|
|
16148
|
-
|
|
16149
|
-
|
|
16691
|
+
className: cn$3(classNames == null ? void 0 : classNames.actionButton, toast2 == null ? void 0 : (_toast_classNames8 = toast2.classNames) == null ? void 0 : _toast_classNames8.actionButton)
|
|
16692
|
+
}, toast2.action.label) : null);
|
|
16693
|
+
};
|
|
16694
|
+
function getDocumentDirection() {
|
|
16695
|
+
if (typeof window === "undefined") return "ltr";
|
|
16696
|
+
if (typeof document === "undefined") return "ltr";
|
|
16697
|
+
const dirAttribute = document.documentElement.getAttribute("dir");
|
|
16698
|
+
if (dirAttribute === "auto" || !dirAttribute) {
|
|
16699
|
+
return window.getComputedStyle(document.documentElement).direction;
|
|
16700
|
+
}
|
|
16701
|
+
return dirAttribute;
|
|
16702
|
+
}
|
|
16703
|
+
function assignOffset(defaultOffset, mobileOffset) {
|
|
16704
|
+
const styles2 = {};
|
|
16705
|
+
[
|
|
16706
|
+
defaultOffset,
|
|
16707
|
+
mobileOffset
|
|
16708
|
+
].forEach((offset2, index2) => {
|
|
16709
|
+
const isMobile = index2 === 1;
|
|
16710
|
+
const prefix = isMobile ? "--mobile-offset" : "--offset";
|
|
16711
|
+
const defaultValue = isMobile ? MOBILE_VIEWPORT_OFFSET : VIEWPORT_OFFSET;
|
|
16712
|
+
function assignAll(offset3) {
|
|
16713
|
+
[
|
|
16714
|
+
"top",
|
|
16715
|
+
"right",
|
|
16716
|
+
"bottom",
|
|
16717
|
+
"left"
|
|
16718
|
+
].forEach((key) => {
|
|
16719
|
+
styles2[`${prefix}-${key}`] = typeof offset3 === "number" ? `${offset3}px` : offset3;
|
|
16720
|
+
});
|
|
16150
16721
|
}
|
|
16151
|
-
|
|
16152
|
-
|
|
16153
|
-
|
|
16154
|
-
|
|
16155
|
-
|
|
16156
|
-
|
|
16157
|
-
|
|
16158
|
-
|
|
16159
|
-
|
|
16160
|
-
|
|
16161
|
-
|
|
16162
|
-
|
|
16163
|
-
|
|
16164
|
-
|
|
16165
|
-
|
|
16166
|
-
|
|
16167
|
-
|
|
16168
|
-
...unselectable
|
|
16169
|
-
},
|
|
16170
|
-
treeNodeArrow: {
|
|
16171
|
-
base: {
|
|
16172
|
-
color: theme3.ARROW_COLOR,
|
|
16173
|
-
display: "inline-block",
|
|
16174
|
-
// lineHeight: '14px',
|
|
16175
|
-
fontSize: theme3.ARROW_FONT_SIZE,
|
|
16176
|
-
marginRight: theme3.ARROW_MARGIN_RIGHT,
|
|
16177
|
-
...parseFloat(theme3.ARROW_ANIMATION_DURATION) > 0 ? {
|
|
16178
|
-
transition: `transform ${theme3.ARROW_ANIMATION_DURATION} ease 0s`
|
|
16179
|
-
} : {},
|
|
16180
|
-
...unselectable
|
|
16181
|
-
},
|
|
16182
|
-
expanded: {
|
|
16183
|
-
WebkitTransform: "rotateZ(90deg)",
|
|
16184
|
-
MozTransform: "rotateZ(90deg)",
|
|
16185
|
-
transform: "rotateZ(90deg)"
|
|
16186
|
-
},
|
|
16187
|
-
collapsed: {
|
|
16188
|
-
WebkitTransform: "rotateZ(0deg)",
|
|
16189
|
-
MozTransform: "rotateZ(0deg)",
|
|
16190
|
-
transform: "rotateZ(0deg)"
|
|
16191
|
-
}
|
|
16192
|
-
},
|
|
16193
|
-
treeNodeChildNodesContainer: {
|
|
16194
|
-
margin: 0,
|
|
16195
|
-
// reset user-agent style
|
|
16196
|
-
paddingLeft: theme3.TREENODE_PADDING_LEFT
|
|
16197
|
-
}
|
|
16198
|
-
},
|
|
16199
|
-
TableInspector: {
|
|
16200
|
-
base: {
|
|
16201
|
-
color: theme3.BASE_COLOR,
|
|
16202
|
-
position: "relative",
|
|
16203
|
-
border: `1px solid ${theme3.TABLE_BORDER_COLOR}`,
|
|
16204
|
-
fontFamily: theme3.BASE_FONT_FAMILY,
|
|
16205
|
-
fontSize: theme3.BASE_FONT_SIZE,
|
|
16206
|
-
lineHeight: "120%",
|
|
16207
|
-
boxSizing: "border-box",
|
|
16208
|
-
cursor: "default"
|
|
16209
|
-
}
|
|
16210
|
-
},
|
|
16211
|
-
TableInspectorHeaderContainer: {
|
|
16212
|
-
base: {
|
|
16213
|
-
top: 0,
|
|
16214
|
-
height: "17px",
|
|
16215
|
-
left: 0,
|
|
16216
|
-
right: 0,
|
|
16217
|
-
overflowX: "hidden"
|
|
16218
|
-
},
|
|
16219
|
-
table: {
|
|
16220
|
-
tableLayout: "fixed",
|
|
16221
|
-
borderSpacing: 0,
|
|
16222
|
-
borderCollapse: "separate",
|
|
16223
|
-
height: "100%",
|
|
16224
|
-
width: "100%",
|
|
16225
|
-
margin: 0
|
|
16226
|
-
}
|
|
16227
|
-
},
|
|
16228
|
-
TableInspectorDataContainer: {
|
|
16229
|
-
tr: {
|
|
16230
|
-
display: "table-row"
|
|
16231
|
-
},
|
|
16232
|
-
td: {
|
|
16233
|
-
boxSizing: "border-box",
|
|
16234
|
-
border: "none",
|
|
16235
|
-
// prevent overrides
|
|
16236
|
-
height: "16px",
|
|
16237
|
-
// /* 0.5 * table.background-size height */
|
|
16238
|
-
verticalAlign: "top",
|
|
16239
|
-
padding: "1px 4px",
|
|
16240
|
-
WebkitUserSelect: "text",
|
|
16241
|
-
whiteSpace: "nowrap",
|
|
16242
|
-
textOverflow: "ellipsis",
|
|
16243
|
-
overflow: "hidden",
|
|
16244
|
-
lineHeight: "14px"
|
|
16245
|
-
},
|
|
16246
|
-
div: {
|
|
16247
|
-
position: "static",
|
|
16248
|
-
top: "17px",
|
|
16249
|
-
bottom: 0,
|
|
16250
|
-
overflowY: "overlay",
|
|
16251
|
-
transform: "translateZ(0)",
|
|
16252
|
-
left: 0,
|
|
16253
|
-
right: 0,
|
|
16254
|
-
overflowX: "hidden"
|
|
16255
|
-
},
|
|
16256
|
-
table: {
|
|
16257
|
-
positon: "static",
|
|
16258
|
-
left: 0,
|
|
16259
|
-
top: 0,
|
|
16260
|
-
right: 0,
|
|
16261
|
-
bottom: 0,
|
|
16262
|
-
borderTop: "0 none transparent",
|
|
16263
|
-
margin: 0,
|
|
16264
|
-
// prevent user agent stylesheet overrides
|
|
16265
|
-
backgroundImage: theme3.TABLE_DATA_BACKGROUND_IMAGE,
|
|
16266
|
-
backgroundSize: theme3.TABLE_DATA_BACKGROUND_SIZE,
|
|
16267
|
-
tableLayout: "fixed",
|
|
16268
|
-
// table
|
|
16269
|
-
borderSpacing: 0,
|
|
16270
|
-
borderCollapse: "separate",
|
|
16271
|
-
// height: '100%',
|
|
16272
|
-
width: "100%",
|
|
16273
|
-
fontSize: theme3.BASE_FONT_SIZE,
|
|
16274
|
-
lineHeight: "120%"
|
|
16275
|
-
}
|
|
16276
|
-
},
|
|
16277
|
-
TableInspectorTH: {
|
|
16278
|
-
base: {
|
|
16279
|
-
position: "relative",
|
|
16280
|
-
// anchor for sort icon container
|
|
16281
|
-
height: "auto",
|
|
16282
|
-
textAlign: "left",
|
|
16283
|
-
backgroundColor: theme3.TABLE_TH_BACKGROUND_COLOR,
|
|
16284
|
-
borderBottom: `1px solid ${theme3.TABLE_BORDER_COLOR}`,
|
|
16285
|
-
fontWeight: "normal",
|
|
16286
|
-
verticalAlign: "middle",
|
|
16287
|
-
padding: "0 4px",
|
|
16288
|
-
whiteSpace: "nowrap",
|
|
16289
|
-
textOverflow: "ellipsis",
|
|
16290
|
-
overflow: "hidden",
|
|
16291
|
-
lineHeight: "14px",
|
|
16292
|
-
":hover": {
|
|
16293
|
-
backgroundColor: theme3.TABLE_TH_HOVER_COLOR
|
|
16294
|
-
}
|
|
16295
|
-
},
|
|
16296
|
-
div: {
|
|
16297
|
-
whiteSpace: "nowrap",
|
|
16298
|
-
textOverflow: "ellipsis",
|
|
16299
|
-
overflow: "hidden",
|
|
16300
|
-
// prevent user agent stylesheet overrides
|
|
16301
|
-
fontSize: theme3.BASE_FONT_SIZE,
|
|
16302
|
-
lineHeight: "120%"
|
|
16722
|
+
if (typeof offset2 === "number" || typeof offset2 === "string") {
|
|
16723
|
+
assignAll(offset2);
|
|
16724
|
+
} else if (typeof offset2 === "object") {
|
|
16725
|
+
[
|
|
16726
|
+
"top",
|
|
16727
|
+
"right",
|
|
16728
|
+
"bottom",
|
|
16729
|
+
"left"
|
|
16730
|
+
].forEach((key) => {
|
|
16731
|
+
if (offset2[key] === void 0) {
|
|
16732
|
+
styles2[`${prefix}-${key}`] = defaultValue;
|
|
16733
|
+
} else {
|
|
16734
|
+
styles2[`${prefix}-${key}`] = typeof offset2[key] === "number" ? `${offset2[key]}px` : offset2[key];
|
|
16735
|
+
}
|
|
16736
|
+
});
|
|
16737
|
+
} else {
|
|
16738
|
+
assignAll(defaultValue);
|
|
16303
16739
|
}
|
|
16304
|
-
}
|
|
16305
|
-
|
|
16306
|
-
|
|
16307
|
-
|
|
16308
|
-
|
|
16309
|
-
|
|
16310
|
-
|
|
16740
|
+
});
|
|
16741
|
+
return styles2;
|
|
16742
|
+
}
|
|
16743
|
+
const Toaster = /* @__PURE__ */ ReactExports.forwardRef(function Toaster2(props, ref) {
|
|
16744
|
+
const { id, invert, position: position2 = "bottom-right", hotkey = [
|
|
16745
|
+
"altKey",
|
|
16746
|
+
"KeyT"
|
|
16747
|
+
], expand, closeButton, className, offset: offset2, mobileOffset, theme: theme3 = "light", richColors, duration: duration2, style: style2, visibleToasts = VISIBLE_TOASTS_AMOUNT, toastOptions, dir = getDocumentDirection(), gap = GAP, icons, containerAriaLabel = "Notifications" } = props;
|
|
16748
|
+
const [toasts, setToasts] = ReactExports.useState([]);
|
|
16749
|
+
const filteredToasts = ReactExports.useMemo(() => {
|
|
16750
|
+
if (id) {
|
|
16751
|
+
return toasts.filter((toast2) => toast2.toasterId === id);
|
|
16311
16752
|
}
|
|
16312
|
-
|
|
16313
|
-
|
|
16314
|
-
|
|
16315
|
-
|
|
16316
|
-
|
|
16317
|
-
|
|
16318
|
-
|
|
16319
|
-
|
|
16320
|
-
|
|
16321
|
-
|
|
16322
|
-
|
|
16323
|
-
|
|
16324
|
-
|
|
16325
|
-
|
|
16326
|
-
|
|
16327
|
-
|
|
16328
|
-
|
|
16329
|
-
const
|
|
16330
|
-
|
|
16331
|
-
|
|
16332
|
-
|
|
16333
|
-
const
|
|
16334
|
-
|
|
16335
|
-
|
|
16336
|
-
|
|
16337
|
-
|
|
16338
|
-
case "[object Object]":
|
|
16339
|
-
return createTheme(theme3);
|
|
16340
|
-
default:
|
|
16341
|
-
return createTheme(themes_exports[DEFAULT_THEME_NAME]);
|
|
16753
|
+
return toasts.filter((toast2) => !toast2.toasterId);
|
|
16754
|
+
}, [
|
|
16755
|
+
toasts,
|
|
16756
|
+
id
|
|
16757
|
+
]);
|
|
16758
|
+
const possiblePositions = ReactExports.useMemo(() => {
|
|
16759
|
+
return Array.from(new Set([
|
|
16760
|
+
position2
|
|
16761
|
+
].concat(filteredToasts.filter((toast2) => toast2.position).map((toast2) => toast2.position))));
|
|
16762
|
+
}, [
|
|
16763
|
+
filteredToasts,
|
|
16764
|
+
position2
|
|
16765
|
+
]);
|
|
16766
|
+
const [heights, setHeights] = ReactExports.useState([]);
|
|
16767
|
+
const [expanded2, setExpanded] = ReactExports.useState(false);
|
|
16768
|
+
const [interacting, setInteracting] = ReactExports.useState(false);
|
|
16769
|
+
const [actualTheme, setActualTheme] = ReactExports.useState(theme3 !== "system" ? theme3 : typeof window !== "undefined" ? window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : "light");
|
|
16770
|
+
const listRef = ReactExports.useRef(null);
|
|
16771
|
+
const hotkeyLabel = hotkey.join("+").replace(/Key/g, "").replace(/Digit/g, "");
|
|
16772
|
+
const lastFocusedElementRef = ReactExports.useRef(null);
|
|
16773
|
+
const isFocusWithinRef = ReactExports.useRef(false);
|
|
16774
|
+
const removeToast = ReactExports.useCallback((toastToRemove) => {
|
|
16775
|
+
setToasts((toasts2) => {
|
|
16776
|
+
var _toasts_find;
|
|
16777
|
+
if (!((_toasts_find = toasts2.find((toast2) => toast2.id === toastToRemove.id)) == null ? void 0 : _toasts_find.delete)) {
|
|
16778
|
+
ToastState.dismiss(toastToRemove.id);
|
|
16342
16779
|
}
|
|
16343
|
-
|
|
16344
|
-
|
|
16345
|
-
};
|
|
16346
|
-
|
|
16347
|
-
|
|
16348
|
-
|
|
16349
|
-
|
|
16350
|
-
|
|
16351
|
-
|
|
16352
|
-
|
|
16353
|
-
|
|
16354
|
-
|
|
16355
|
-
},
|
|
16356
|
-
"▶"
|
|
16357
|
-
);
|
|
16358
|
-
var TreeNode = reactExports.memo((props) => {
|
|
16359
|
-
props = {
|
|
16360
|
-
expanded: true,
|
|
16361
|
-
nodeRenderer: ({ name: name2 }) => /* @__PURE__ */ ReactExports.createElement("span", null, name2),
|
|
16362
|
-
onClick: () => {
|
|
16363
|
-
},
|
|
16364
|
-
shouldShowArrow: false,
|
|
16365
|
-
shouldShowPlaceholder: true,
|
|
16366
|
-
...props
|
|
16367
|
-
};
|
|
16368
|
-
const { expanded: expanded2, onClick, children: children2, nodeRenderer, title, shouldShowArrow, shouldShowPlaceholder } = props;
|
|
16369
|
-
const styles2 = useStyles("TreeNode");
|
|
16370
|
-
const NodeRenderer2 = nodeRenderer;
|
|
16371
|
-
return /* @__PURE__ */ ReactExports.createElement("li", { "aria-expanded": expanded2, role: "treeitem", style: styles2.treeNodeBase, title }, /* @__PURE__ */ ReactExports.createElement("div", { style: styles2.treeNodePreviewContainer, onClick }, shouldShowArrow || reactExports.Children.count(children2) > 0 ? /* @__PURE__ */ ReactExports.createElement(Arrow, { expanded: expanded2, styles: styles2.treeNodeArrow }) : shouldShowPlaceholder && /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.treeNodePlaceholder }, " "), /* @__PURE__ */ ReactExports.createElement(NodeRenderer2, { ...props })), /* @__PURE__ */ ReactExports.createElement("ol", { role: "group", style: styles2.treeNodeChildNodesContainer }, expanded2 ? children2 : void 0));
|
|
16372
|
-
});
|
|
16373
|
-
var DEFAULT_ROOT_PATH = "$";
|
|
16374
|
-
var WILDCARD = "*";
|
|
16375
|
-
function hasChildNodes(data, dataIterator) {
|
|
16376
|
-
return !dataIterator(data).next().done;
|
|
16377
|
-
}
|
|
16378
|
-
var wildcardPathsFromLevel = (level) => {
|
|
16379
|
-
return Array.from(
|
|
16380
|
-
{ length: level },
|
|
16381
|
-
(_2, i) => [DEFAULT_ROOT_PATH].concat(Array.from({ length: i }, () => "*")).join(".")
|
|
16382
|
-
);
|
|
16383
|
-
};
|
|
16384
|
-
var getExpandedPaths = (data, dataIterator, expandPaths, expandLevel, prevExpandedPaths) => {
|
|
16385
|
-
const wildcardPaths = [].concat(wildcardPathsFromLevel(expandLevel)).concat(expandPaths).filter((path2) => typeof path2 === "string");
|
|
16386
|
-
const expandedPaths = [];
|
|
16387
|
-
wildcardPaths.forEach((wildcardPath) => {
|
|
16388
|
-
const keyPaths = wildcardPath.split(".");
|
|
16389
|
-
const populatePaths = (curData, curPath, depth) => {
|
|
16390
|
-
if (depth === keyPaths.length) {
|
|
16391
|
-
expandedPaths.push(curPath);
|
|
16780
|
+
return toasts2.filter(({ id: id2 }) => id2 !== toastToRemove.id);
|
|
16781
|
+
});
|
|
16782
|
+
}, []);
|
|
16783
|
+
ReactExports.useEffect(() => {
|
|
16784
|
+
return ToastState.subscribe((toast2) => {
|
|
16785
|
+
if (toast2.dismiss) {
|
|
16786
|
+
requestAnimationFrame(() => {
|
|
16787
|
+
setToasts((toasts2) => toasts2.map((t) => t.id === toast2.id ? {
|
|
16788
|
+
...t,
|
|
16789
|
+
delete: true
|
|
16790
|
+
} : t));
|
|
16791
|
+
});
|
|
16392
16792
|
return;
|
|
16393
16793
|
}
|
|
16394
|
-
|
|
16395
|
-
|
|
16396
|
-
|
|
16397
|
-
|
|
16398
|
-
|
|
16399
|
-
|
|
16400
|
-
|
|
16401
|
-
|
|
16402
|
-
|
|
16403
|
-
|
|
16794
|
+
setTimeout(() => {
|
|
16795
|
+
ReactDOM.flushSync(() => {
|
|
16796
|
+
setToasts((toasts2) => {
|
|
16797
|
+
const indexOfExistingToast = toasts2.findIndex((t) => t.id === toast2.id);
|
|
16798
|
+
if (indexOfExistingToast !== -1) {
|
|
16799
|
+
return [
|
|
16800
|
+
...toasts2.slice(0, indexOfExistingToast),
|
|
16801
|
+
{
|
|
16802
|
+
...toasts2[indexOfExistingToast],
|
|
16803
|
+
...toast2
|
|
16804
|
+
},
|
|
16805
|
+
...toasts2.slice(indexOfExistingToast + 1)
|
|
16806
|
+
];
|
|
16404
16807
|
}
|
|
16405
|
-
|
|
16808
|
+
return [
|
|
16809
|
+
toast2,
|
|
16810
|
+
...toasts2
|
|
16811
|
+
];
|
|
16812
|
+
});
|
|
16813
|
+
});
|
|
16814
|
+
});
|
|
16815
|
+
});
|
|
16816
|
+
}, [
|
|
16817
|
+
toasts
|
|
16818
|
+
]);
|
|
16819
|
+
ReactExports.useEffect(() => {
|
|
16820
|
+
if (theme3 !== "system") {
|
|
16821
|
+
setActualTheme(theme3);
|
|
16822
|
+
return;
|
|
16823
|
+
}
|
|
16824
|
+
if (theme3 === "system") {
|
|
16825
|
+
if (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches) {
|
|
16826
|
+
setActualTheme("dark");
|
|
16827
|
+
} else {
|
|
16828
|
+
setActualTheme("light");
|
|
16829
|
+
}
|
|
16830
|
+
}
|
|
16831
|
+
if (typeof window === "undefined") return;
|
|
16832
|
+
const darkMediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
16833
|
+
try {
|
|
16834
|
+
darkMediaQuery.addEventListener("change", ({ matches }) => {
|
|
16835
|
+
if (matches) {
|
|
16836
|
+
setActualTheme("dark");
|
|
16406
16837
|
} else {
|
|
16407
|
-
|
|
16408
|
-
|
|
16409
|
-
|
|
16838
|
+
setActualTheme("light");
|
|
16839
|
+
}
|
|
16840
|
+
});
|
|
16841
|
+
} catch (error) {
|
|
16842
|
+
darkMediaQuery.addListener(({ matches }) => {
|
|
16843
|
+
try {
|
|
16844
|
+
if (matches) {
|
|
16845
|
+
setActualTheme("dark");
|
|
16846
|
+
} else {
|
|
16847
|
+
setActualTheme("light");
|
|
16410
16848
|
}
|
|
16849
|
+
} catch (e) {
|
|
16850
|
+
console.error(e);
|
|
16411
16851
|
}
|
|
16852
|
+
});
|
|
16853
|
+
}
|
|
16854
|
+
}, [
|
|
16855
|
+
theme3
|
|
16856
|
+
]);
|
|
16857
|
+
ReactExports.useEffect(() => {
|
|
16858
|
+
if (toasts.length <= 1) {
|
|
16859
|
+
setExpanded(false);
|
|
16860
|
+
}
|
|
16861
|
+
}, [
|
|
16862
|
+
toasts
|
|
16863
|
+
]);
|
|
16864
|
+
ReactExports.useEffect(() => {
|
|
16865
|
+
const handleKeyDown = (event) => {
|
|
16866
|
+
var _listRef_current;
|
|
16867
|
+
const isHotkeyPressed = hotkey.every((key) => event[key] || event.code === key);
|
|
16868
|
+
if (isHotkeyPressed) {
|
|
16869
|
+
var _listRef_current1;
|
|
16870
|
+
setExpanded(true);
|
|
16871
|
+
(_listRef_current1 = listRef.current) == null ? void 0 : _listRef_current1.focus();
|
|
16872
|
+
}
|
|
16873
|
+
if (event.code === "Escape" && (document.activeElement === listRef.current || ((_listRef_current = listRef.current) == null ? void 0 : _listRef_current.contains(document.activeElement)))) {
|
|
16874
|
+
setExpanded(false);
|
|
16412
16875
|
}
|
|
16413
16876
|
};
|
|
16414
|
-
|
|
16415
|
-
|
|
16416
|
-
|
|
16417
|
-
|
|
16418
|
-
|
|
16419
|
-
|
|
16420
|
-
|
|
16421
|
-
|
|
16422
|
-
|
|
16423
|
-
|
|
16424
|
-
|
|
16425
|
-
|
|
16426
|
-
|
|
16427
|
-
|
|
16428
|
-
const expanded2 = !!expandedPaths[path2];
|
|
16429
|
-
const handleClick = reactExports.useCallback(
|
|
16430
|
-
() => nodeHasChildNodes && setExpandedPaths((prevExpandedPaths) => ({
|
|
16431
|
-
...prevExpandedPaths,
|
|
16432
|
-
[path2]: !expanded2
|
|
16433
|
-
})),
|
|
16434
|
-
[nodeHasChildNodes, setExpandedPaths, path2, expanded2]
|
|
16435
|
-
);
|
|
16436
|
-
return /* @__PURE__ */ ReactExports.createElement(
|
|
16437
|
-
TreeNode,
|
|
16438
|
-
{
|
|
16439
|
-
expanded: expanded2,
|
|
16440
|
-
onClick: handleClick,
|
|
16441
|
-
shouldShowArrow: nodeHasChildNodes,
|
|
16442
|
-
shouldShowPlaceholder: depth > 0,
|
|
16443
|
-
nodeRenderer,
|
|
16444
|
-
...props
|
|
16445
|
-
},
|
|
16446
|
-
// only render if the node is expanded
|
|
16447
|
-
expanded2 ? [...dataIterator(data)].map(({ name: name2, data: data2, ...renderNodeProps }) => {
|
|
16448
|
-
return /* @__PURE__ */ ReactExports.createElement(
|
|
16449
|
-
ConnectedTreeNode,
|
|
16450
|
-
{
|
|
16451
|
-
name: name2,
|
|
16452
|
-
data: data2,
|
|
16453
|
-
depth: depth + 1,
|
|
16454
|
-
path: `${path2}.${name2}`,
|
|
16455
|
-
key: name2,
|
|
16456
|
-
dataIterator,
|
|
16457
|
-
nodeRenderer,
|
|
16458
|
-
...renderNodeProps
|
|
16877
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
16878
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
16879
|
+
}, [
|
|
16880
|
+
hotkey
|
|
16881
|
+
]);
|
|
16882
|
+
ReactExports.useEffect(() => {
|
|
16883
|
+
if (listRef.current) {
|
|
16884
|
+
return () => {
|
|
16885
|
+
if (lastFocusedElementRef.current) {
|
|
16886
|
+
lastFocusedElementRef.current.focus({
|
|
16887
|
+
preventScroll: true
|
|
16888
|
+
});
|
|
16889
|
+
lastFocusedElementRef.current = null;
|
|
16890
|
+
isFocusWithinRef.current = false;
|
|
16459
16891
|
}
|
|
16460
|
-
|
|
16461
|
-
}) : null
|
|
16462
|
-
);
|
|
16463
|
-
});
|
|
16464
|
-
var TreeView = reactExports.memo(({ name: name2, data, dataIterator, nodeRenderer, expandPaths, expandLevel }) => {
|
|
16465
|
-
const styles2 = useStyles("TreeView");
|
|
16466
|
-
const stateAndSetter = reactExports.useState({});
|
|
16467
|
-
const [, setExpandedPaths] = stateAndSetter;
|
|
16468
|
-
reactExports.useLayoutEffect(
|
|
16469
|
-
() => setExpandedPaths(
|
|
16470
|
-
(prevExpandedPaths) => getExpandedPaths(data, dataIterator, expandPaths, expandLevel, prevExpandedPaths)
|
|
16471
|
-
),
|
|
16472
|
-
[data, dataIterator, expandPaths, expandLevel]
|
|
16473
|
-
);
|
|
16474
|
-
return /* @__PURE__ */ ReactExports.createElement(ExpandedPathsContext.Provider, { value: stateAndSetter }, /* @__PURE__ */ ReactExports.createElement("ol", { role: "tree", style: styles2.treeViewOutline }, /* @__PURE__ */ ReactExports.createElement(
|
|
16475
|
-
ConnectedTreeNode,
|
|
16476
|
-
{
|
|
16477
|
-
name: name2,
|
|
16478
|
-
data,
|
|
16479
|
-
dataIterator,
|
|
16480
|
-
depth: 0,
|
|
16481
|
-
path: DEFAULT_ROOT_PATH,
|
|
16482
|
-
nodeRenderer
|
|
16892
|
+
};
|
|
16483
16893
|
}
|
|
16484
|
-
|
|
16485
|
-
|
|
16486
|
-
|
|
16487
|
-
|
|
16488
|
-
|
|
16489
|
-
|
|
16490
|
-
|
|
16491
|
-
|
|
16492
|
-
|
|
16493
|
-
|
|
16494
|
-
|
|
16495
|
-
|
|
16496
|
-
|
|
16497
|
-
|
|
16498
|
-
|
|
16499
|
-
|
|
16500
|
-
|
|
16501
|
-
|
|
16502
|
-
|
|
16503
|
-
|
|
16504
|
-
|
|
16505
|
-
|
|
16506
|
-
|
|
16507
|
-
|
|
16508
|
-
|
|
16509
|
-
|
|
16510
|
-
|
|
16511
|
-
|
|
16512
|
-
|
|
16513
|
-
|
|
16514
|
-
|
|
16515
|
-
|
|
16516
|
-
|
|
16517
|
-
|
|
16518
|
-
|
|
16519
|
-
|
|
16520
|
-
|
|
16521
|
-
|
|
16522
|
-
|
|
16523
|
-
|
|
16524
|
-
|
|
16525
|
-
|
|
16526
|
-
|
|
16527
|
-
|
|
16528
|
-
|
|
16529
|
-
|
|
16530
|
-
|
|
16531
|
-
|
|
16532
|
-
|
|
16533
|
-
|
|
16534
|
-
|
|
16535
|
-
|
|
16894
|
+
}, [
|
|
16895
|
+
listRef.current
|
|
16896
|
+
]);
|
|
16897
|
+
return (
|
|
16898
|
+
// Remove item from normal navigation flow, only available via hotkey
|
|
16899
|
+
/* @__PURE__ */ ReactExports.createElement("section", {
|
|
16900
|
+
ref,
|
|
16901
|
+
"aria-label": `${containerAriaLabel} ${hotkeyLabel}`,
|
|
16902
|
+
tabIndex: -1,
|
|
16903
|
+
"aria-live": "polite",
|
|
16904
|
+
"aria-relevant": "additions text",
|
|
16905
|
+
"aria-atomic": "false",
|
|
16906
|
+
suppressHydrationWarning: true
|
|
16907
|
+
}, possiblePositions.map((position3, index2) => {
|
|
16908
|
+
var _heights_;
|
|
16909
|
+
const [y2, x2] = position3.split("-");
|
|
16910
|
+
if (!filteredToasts.length) return null;
|
|
16911
|
+
return /* @__PURE__ */ ReactExports.createElement("ol", {
|
|
16912
|
+
key: position3,
|
|
16913
|
+
dir: dir === "auto" ? getDocumentDirection() : dir,
|
|
16914
|
+
tabIndex: -1,
|
|
16915
|
+
ref: listRef,
|
|
16916
|
+
className,
|
|
16917
|
+
"data-sonner-toaster": true,
|
|
16918
|
+
"data-sonner-theme": actualTheme,
|
|
16919
|
+
"data-y-position": y2,
|
|
16920
|
+
"data-x-position": x2,
|
|
16921
|
+
style: {
|
|
16922
|
+
"--front-toast-height": `${((_heights_ = heights[0]) == null ? void 0 : _heights_.height) || 0}px`,
|
|
16923
|
+
"--width": `${TOAST_WIDTH}px`,
|
|
16924
|
+
"--gap": `${gap}px`,
|
|
16925
|
+
...style2,
|
|
16926
|
+
...assignOffset(offset2, mobileOffset)
|
|
16927
|
+
},
|
|
16928
|
+
onBlur: (event) => {
|
|
16929
|
+
if (isFocusWithinRef.current && !event.currentTarget.contains(event.relatedTarget)) {
|
|
16930
|
+
isFocusWithinRef.current = false;
|
|
16931
|
+
if (lastFocusedElementRef.current) {
|
|
16932
|
+
lastFocusedElementRef.current.focus({
|
|
16933
|
+
preventScroll: true
|
|
16934
|
+
});
|
|
16935
|
+
lastFocusedElementRef.current = null;
|
|
16936
|
+
}
|
|
16937
|
+
}
|
|
16938
|
+
},
|
|
16939
|
+
onFocus: (event) => {
|
|
16940
|
+
const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === "false";
|
|
16941
|
+
if (isNotDismissible) return;
|
|
16942
|
+
if (!isFocusWithinRef.current) {
|
|
16943
|
+
isFocusWithinRef.current = true;
|
|
16944
|
+
lastFocusedElementRef.current = event.relatedTarget;
|
|
16945
|
+
}
|
|
16946
|
+
},
|
|
16947
|
+
onMouseEnter: () => setExpanded(true),
|
|
16948
|
+
onMouseMove: () => setExpanded(true),
|
|
16949
|
+
onMouseLeave: () => {
|
|
16950
|
+
if (!interacting) {
|
|
16951
|
+
setExpanded(false);
|
|
16952
|
+
}
|
|
16953
|
+
},
|
|
16954
|
+
onDragEnd: () => setExpanded(false),
|
|
16955
|
+
onPointerDown: (event) => {
|
|
16956
|
+
const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === "false";
|
|
16957
|
+
if (isNotDismissible) return;
|
|
16958
|
+
setInteracting(true);
|
|
16959
|
+
},
|
|
16960
|
+
onPointerUp: () => setInteracting(false)
|
|
16961
|
+
}, filteredToasts.filter((toast2) => !toast2.position && index2 === 0 || toast2.position === position3).map((toast2, index3) => {
|
|
16962
|
+
var _toastOptions_duration, _toastOptions_closeButton;
|
|
16963
|
+
return /* @__PURE__ */ ReactExports.createElement(Toast, {
|
|
16964
|
+
key: toast2.id,
|
|
16965
|
+
icons,
|
|
16966
|
+
index: index3,
|
|
16967
|
+
toast: toast2,
|
|
16968
|
+
defaultRichColors: richColors,
|
|
16969
|
+
duration: (_toastOptions_duration = toastOptions == null ? void 0 : toastOptions.duration) != null ? _toastOptions_duration : duration2,
|
|
16970
|
+
className: toastOptions == null ? void 0 : toastOptions.className,
|
|
16971
|
+
descriptionClassName: toastOptions == null ? void 0 : toastOptions.descriptionClassName,
|
|
16972
|
+
invert,
|
|
16973
|
+
visibleToasts,
|
|
16974
|
+
closeButton: (_toastOptions_closeButton = toastOptions == null ? void 0 : toastOptions.closeButton) != null ? _toastOptions_closeButton : closeButton,
|
|
16975
|
+
interacting,
|
|
16976
|
+
position: position3,
|
|
16977
|
+
style: toastOptions == null ? void 0 : toastOptions.style,
|
|
16978
|
+
unstyled: toastOptions == null ? void 0 : toastOptions.unstyled,
|
|
16979
|
+
classNames: toastOptions == null ? void 0 : toastOptions.classNames,
|
|
16980
|
+
cancelButtonStyle: toastOptions == null ? void 0 : toastOptions.cancelButtonStyle,
|
|
16981
|
+
actionButtonStyle: toastOptions == null ? void 0 : toastOptions.actionButtonStyle,
|
|
16982
|
+
closeButtonAriaLabel: toastOptions == null ? void 0 : toastOptions.closeButtonAriaLabel,
|
|
16983
|
+
removeToast,
|
|
16984
|
+
toasts: filteredToasts.filter((t) => t.position == toast2.position),
|
|
16985
|
+
heights: heights.filter((h2) => h2.position == toast2.position),
|
|
16986
|
+
setHeights,
|
|
16987
|
+
expandByDefault: expand,
|
|
16988
|
+
gap,
|
|
16989
|
+
expanded: expanded2,
|
|
16990
|
+
swipeDirections: props.swipeDirections
|
|
16991
|
+
});
|
|
16992
|
+
}));
|
|
16993
|
+
}))
|
|
16994
|
+
);
|
|
16995
|
+
});
|
|
16996
|
+
const defaultAdapter = {
|
|
16997
|
+
success: (msg, opts) => toast.success(msg, opts),
|
|
16998
|
+
error: (msg, opts) => toast.error(msg, opts),
|
|
16999
|
+
info: (msg, opts) => toast.info(msg, opts)
|
|
16536
17000
|
};
|
|
16537
|
-
|
|
16538
|
-
|
|
16539
|
-
|
|
16540
|
-
const propertyDescriptor = Object.getOwnPropertyDescriptor(object2, propertyName);
|
|
16541
|
-
if (propertyDescriptor.get) {
|
|
16542
|
-
try {
|
|
16543
|
-
return propertyDescriptor.get();
|
|
16544
|
-
} catch {
|
|
16545
|
-
return propertyDescriptor.get;
|
|
16546
|
-
}
|
|
16547
|
-
}
|
|
16548
|
-
return object2[propertyName];
|
|
16549
|
-
}
|
|
16550
|
-
function intersperse(arr, sep) {
|
|
16551
|
-
if (arr.length === 0) {
|
|
16552
|
-
return [];
|
|
16553
|
-
}
|
|
16554
|
-
return arr.slice(1).reduce((xs, x2) => xs.concat([sep, x2]), [arr[0]]);
|
|
17001
|
+
const ToastContext = reactExports.createContext(defaultAdapter);
|
|
17002
|
+
function useToast() {
|
|
17003
|
+
return reactExports.useContext(ToastContext);
|
|
16555
17004
|
}
|
|
16556
|
-
var
|
|
16557
|
-
|
|
16558
|
-
|
|
16559
|
-
|
|
16560
|
-
|
|
16561
|
-
|
|
16562
|
-
|
|
16563
|
-
|
|
16564
|
-
const previewArray = object2.slice(0, maxProperties).map((element2, index2) => /* @__PURE__ */ ReactExports.createElement(ObjectValue, { key: index2, object: element2 }));
|
|
16565
|
-
if (object2.length > maxProperties) {
|
|
16566
|
-
previewArray.push(/* @__PURE__ */ ReactExports.createElement("span", { key: "ellipsis" }, "…"));
|
|
16567
|
-
}
|
|
16568
|
-
const arrayLength = object2.length;
|
|
16569
|
-
return /* @__PURE__ */ ReactExports.createElement(ReactExports.Fragment, null, /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.objectDescription }, arrayLength === 0 ? `` : `(${arrayLength}) `), /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.preview }, "[", intersperse(previewArray, ", "), "]"));
|
|
16570
|
-
} else {
|
|
16571
|
-
const maxProperties = styles2.objectMaxProperties;
|
|
16572
|
-
const propertyNodes = [];
|
|
16573
|
-
for (const propertyName in object2) {
|
|
16574
|
-
if (hasOwnProperty$1.call(object2, propertyName)) {
|
|
16575
|
-
let ellipsis;
|
|
16576
|
-
if (propertyNodes.length === maxProperties - 1 && Object.keys(object2).length > maxProperties) {
|
|
16577
|
-
ellipsis = /* @__PURE__ */ ReactExports.createElement("span", { key: "ellipsis" }, "…");
|
|
16578
|
-
}
|
|
16579
|
-
const propertyValue2 = getPropertyValue(object2, propertyName);
|
|
16580
|
-
propertyNodes.push(
|
|
16581
|
-
/* @__PURE__ */ ReactExports.createElement("span", { key: propertyName }, /* @__PURE__ */ ReactExports.createElement(ObjectName, { name: propertyName || `""` }), ": ", /* @__PURE__ */ ReactExports.createElement(ObjectValue, { object: propertyValue2 }), ellipsis)
|
|
16582
|
-
);
|
|
16583
|
-
if (ellipsis) break;
|
|
16584
|
-
}
|
|
16585
|
-
}
|
|
16586
|
-
const objectConstructorName = object2.constructor ? object2.constructor.name : "Object";
|
|
16587
|
-
return /* @__PURE__ */ ReactExports.createElement(ReactExports.Fragment, null, /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.objectDescription }, objectConstructorName === "Object" ? "" : `${objectConstructorName} `), /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.preview }, "{", intersperse(propertyNodes, ", "), "}"));
|
|
16588
|
-
}
|
|
17005
|
+
var __create = Object.create;
|
|
17006
|
+
var __defProp2 = Object.defineProperty;
|
|
17007
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
17008
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
17009
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
17010
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
17011
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
17012
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
16589
17013
|
};
|
|
16590
|
-
var
|
|
16591
|
-
|
|
16592
|
-
|
|
16593
|
-
} else {
|
|
16594
|
-
return /* @__PURE__ */ ReactExports.createElement(ObjectPreview, { data });
|
|
16595
|
-
}
|
|
17014
|
+
var __export = (target2, all2) => {
|
|
17015
|
+
for (var name2 in all2)
|
|
17016
|
+
__defProp2(target2, name2, { get: all2[name2], enumerable: true });
|
|
16596
17017
|
};
|
|
16597
|
-
var
|
|
16598
|
-
|
|
16599
|
-
|
|
17018
|
+
var __copyProps = (to2, from, except, desc) => {
|
|
17019
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17020
|
+
for (let key of __getOwnPropNames(from))
|
|
17021
|
+
if (!__hasOwnProp.call(to2, key) && key !== except)
|
|
17022
|
+
__defProp2(to2, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17023
|
+
}
|
|
17024
|
+
return to2;
|
|
16600
17025
|
};
|
|
16601
|
-
var
|
|
16602
|
-
|
|
16603
|
-
|
|
16604
|
-
|
|
16605
|
-
|
|
16606
|
-
|
|
16607
|
-
|
|
16608
|
-
|
|
16609
|
-
|
|
16610
|
-
|
|
16611
|
-
|
|
16612
|
-
|
|
16613
|
-
|
|
16614
|
-
|
|
16615
|
-
|
|
16616
|
-
|
|
16617
|
-
|
|
16618
|
-
|
|
16619
|
-
|
|
16620
|
-
|
|
16621
|
-
i++;
|
|
16622
|
-
}
|
|
16623
|
-
} else {
|
|
16624
|
-
const keys2 = Object.getOwnPropertyNames(data);
|
|
16625
|
-
if (sortObjectKeys === true && !dataIsArray) {
|
|
16626
|
-
keys2.sort();
|
|
16627
|
-
} else if (typeof sortObjectKeys === "function") {
|
|
16628
|
-
keys2.sort(sortObjectKeys);
|
|
16629
|
-
}
|
|
16630
|
-
for (const propertyName of keys2) {
|
|
16631
|
-
if (propertyIsEnumerable.call(data, propertyName)) {
|
|
16632
|
-
const propertyValue2 = getPropertyValue(data, propertyName);
|
|
16633
|
-
yield {
|
|
16634
|
-
name: propertyName || `""`,
|
|
16635
|
-
data: propertyValue2
|
|
16636
|
-
};
|
|
16637
|
-
} else if (showNonenumerable) {
|
|
16638
|
-
let propertyValue2;
|
|
16639
|
-
try {
|
|
16640
|
-
propertyValue2 = getPropertyValue(data, propertyName);
|
|
16641
|
-
} catch (e) {
|
|
16642
|
-
}
|
|
16643
|
-
if (propertyValue2 !== void 0) {
|
|
16644
|
-
yield {
|
|
16645
|
-
name: propertyName,
|
|
16646
|
-
data: propertyValue2,
|
|
16647
|
-
isNonenumerable: true
|
|
16648
|
-
};
|
|
16649
|
-
}
|
|
16650
|
-
}
|
|
17026
|
+
var __toESM = (mod, isNodeMode, target2) => (target2 = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17027
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
17028
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
17029
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
17030
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
17031
|
+
__defProp2(target2, "default", { value: mod, enumerable: true }),
|
|
17032
|
+
mod
|
|
17033
|
+
));
|
|
17034
|
+
var require_is_object = __commonJS({
|
|
17035
|
+
"node_modules/is-object/index.js"(exports$1, module) {
|
|
17036
|
+
module.exports = function isObject2(x2) {
|
|
17037
|
+
return typeof x2 === "object" && x2 !== null;
|
|
17038
|
+
};
|
|
17039
|
+
}
|
|
17040
|
+
});
|
|
17041
|
+
var require_is_window = __commonJS({
|
|
17042
|
+
"node_modules/is-window/index.js"(exports$1, module) {
|
|
17043
|
+
module.exports = function(obj) {
|
|
17044
|
+
if (obj == null) {
|
|
17045
|
+
return false;
|
|
16651
17046
|
}
|
|
16652
|
-
|
|
16653
|
-
|
|
16654
|
-
|
|
16655
|
-
|
|
16656
|
-
|
|
16657
|
-
|
|
17047
|
+
var o = Object(obj);
|
|
17048
|
+
return o === o.window;
|
|
17049
|
+
};
|
|
17050
|
+
}
|
|
17051
|
+
});
|
|
17052
|
+
var require_is_dom = __commonJS({
|
|
17053
|
+
"node_modules/is-dom/index.js"(exports$1, module) {
|
|
17054
|
+
var isObject2 = require_is_object();
|
|
17055
|
+
var isWindow = require_is_window();
|
|
17056
|
+
function isNode2(val) {
|
|
17057
|
+
if (!isObject2(val) || !isWindow(window) || typeof window.Node !== "function") {
|
|
17058
|
+
return false;
|
|
16658
17059
|
}
|
|
17060
|
+
return typeof val.nodeType === "number" && typeof val.nodeName === "string";
|
|
16659
17061
|
}
|
|
16660
|
-
|
|
16661
|
-
|
|
16662
|
-
};
|
|
16663
|
-
var
|
|
16664
|
-
|
|
16665
|
-
|
|
16666
|
-
|
|
16667
|
-
|
|
16668
|
-
|
|
16669
|
-
|
|
16670
|
-
__toESM(require_is_dom());
|
|
16671
|
-
const useDarkMode = () => {
|
|
16672
|
-
const [isDark, setIsDark] = reactExports.useState(() => {
|
|
16673
|
-
if (typeof document === "undefined")
|
|
16674
|
-
return false;
|
|
16675
|
-
return document.documentElement.classList.contains("dark");
|
|
16676
|
-
});
|
|
16677
|
-
reactExports.useEffect(() => {
|
|
16678
|
-
if (typeof document === "undefined")
|
|
16679
|
-
return;
|
|
16680
|
-
const observer = new MutationObserver(() => {
|
|
16681
|
-
setIsDark(document.documentElement.classList.contains("dark"));
|
|
16682
|
-
});
|
|
16683
|
-
observer.observe(document.documentElement, {
|
|
16684
|
-
attributes: true,
|
|
16685
|
-
attributeFilter: ["class"]
|
|
16686
|
-
});
|
|
16687
|
-
return () => observer.disconnect();
|
|
16688
|
-
}, []);
|
|
16689
|
-
return isDark;
|
|
16690
|
-
};
|
|
16691
|
-
const inspectorThemeExtendedLight = {
|
|
16692
|
-
OBJECT_VALUE_DATE_COLOR: "#a21caf"
|
|
16693
|
-
// fuchsia-700
|
|
16694
|
-
};
|
|
16695
|
-
const inspectorThemeExtendedDark = {
|
|
16696
|
-
OBJECT_VALUE_DATE_COLOR: "#e879f9"
|
|
16697
|
-
// fuchsia-400
|
|
16698
|
-
};
|
|
16699
|
-
const shared = {
|
|
17062
|
+
module.exports = isNode2;
|
|
17063
|
+
}
|
|
17064
|
+
});
|
|
17065
|
+
var themes_exports = {};
|
|
17066
|
+
__export(themes_exports, {
|
|
17067
|
+
chromeDark: () => theme,
|
|
17068
|
+
chromeLight: () => theme2
|
|
17069
|
+
});
|
|
17070
|
+
var theme = {
|
|
17071
|
+
BASE_FONT_FAMILY: "Menlo, monospace",
|
|
16700
17072
|
BASE_FONT_SIZE: "11px",
|
|
16701
|
-
BASE_LINE_HEIGHT: 1.
|
|
16702
|
-
BASE_BACKGROUND_COLOR: "
|
|
17073
|
+
BASE_LINE_HEIGHT: 1.2,
|
|
17074
|
+
BASE_BACKGROUND_COLOR: "rgb(36, 36, 36)",
|
|
17075
|
+
BASE_COLOR: "rgb(213, 213, 213)",
|
|
16703
17076
|
OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES: 10,
|
|
16704
17077
|
OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES: 5,
|
|
17078
|
+
OBJECT_NAME_COLOR: "rgb(227, 110, 236)",
|
|
17079
|
+
OBJECT_VALUE_NULL_COLOR: "rgb(127, 127, 127)",
|
|
17080
|
+
OBJECT_VALUE_UNDEFINED_COLOR: "rgb(127, 127, 127)",
|
|
17081
|
+
OBJECT_VALUE_REGEXP_COLOR: "rgb(233, 63, 59)",
|
|
17082
|
+
OBJECT_VALUE_STRING_COLOR: "rgb(233, 63, 59)",
|
|
17083
|
+
OBJECT_VALUE_SYMBOL_COLOR: "rgb(233, 63, 59)",
|
|
17084
|
+
OBJECT_VALUE_NUMBER_COLOR: "hsl(252, 100%, 75%)",
|
|
17085
|
+
OBJECT_VALUE_BOOLEAN_COLOR: "hsl(252, 100%, 75%)",
|
|
17086
|
+
OBJECT_VALUE_FUNCTION_PREFIX_COLOR: "rgb(85, 106, 242)",
|
|
17087
|
+
HTML_TAG_COLOR: "rgb(93, 176, 215)",
|
|
17088
|
+
HTML_TAGNAME_COLOR: "rgb(93, 176, 215)",
|
|
16705
17089
|
HTML_TAGNAME_TEXT_TRANSFORM: "lowercase",
|
|
17090
|
+
HTML_ATTRIBUTE_NAME_COLOR: "rgb(155, 187, 220)",
|
|
17091
|
+
HTML_ATTRIBUTE_VALUE_COLOR: "rgb(242, 151, 102)",
|
|
17092
|
+
HTML_COMMENT_COLOR: "rgb(137, 137, 137)",
|
|
17093
|
+
HTML_DOCTYPE_COLOR: "rgb(192, 192, 192)",
|
|
17094
|
+
ARROW_COLOR: "rgb(145, 145, 145)",
|
|
16706
17095
|
ARROW_MARGIN_RIGHT: 3,
|
|
16707
17096
|
ARROW_FONT_SIZE: 12,
|
|
16708
|
-
|
|
17097
|
+
ARROW_ANIMATION_DURATION: "0",
|
|
17098
|
+
TREENODE_FONT_FAMILY: "Menlo, monospace",
|
|
16709
17099
|
TREENODE_FONT_SIZE: "11px",
|
|
16710
|
-
TREENODE_LINE_HEIGHT: 1.
|
|
17100
|
+
TREENODE_LINE_HEIGHT: 1.2,
|
|
16711
17101
|
TREENODE_PADDING_LEFT: 12,
|
|
16712
|
-
|
|
16713
|
-
|
|
17102
|
+
TABLE_BORDER_COLOR: "rgb(85, 85, 85)",
|
|
17103
|
+
TABLE_TH_BACKGROUND_COLOR: "rgb(44, 44, 44)",
|
|
17104
|
+
TABLE_TH_HOVER_COLOR: "rgb(48, 48, 48)",
|
|
17105
|
+
TABLE_SORT_ICON_COLOR: "black",
|
|
17106
|
+
//'rgb(48, 57, 66)',
|
|
17107
|
+
TABLE_DATA_BACKGROUND_IMAGE: "linear-gradient(rgba(255, 255, 255, 0), rgba(255, 255, 255, 0) 50%, rgba(51, 139, 255, 0.0980392) 50%, rgba(51, 139, 255, 0.0980392))",
|
|
17108
|
+
TABLE_DATA_BACKGROUND_SIZE: "128px 32px"
|
|
16714
17109
|
};
|
|
16715
|
-
|
|
16716
|
-
|
|
16717
|
-
|
|
16718
|
-
|
|
16719
|
-
|
|
16720
|
-
|
|
16721
|
-
|
|
16722
|
-
|
|
16723
|
-
|
|
16724
|
-
|
|
16725
|
-
|
|
16726
|
-
|
|
16727
|
-
|
|
16728
|
-
|
|
16729
|
-
|
|
16730
|
-
|
|
16731
|
-
|
|
16732
|
-
|
|
16733
|
-
|
|
16734
|
-
|
|
16735
|
-
|
|
16736
|
-
|
|
16737
|
-
|
|
16738
|
-
|
|
16739
|
-
|
|
16740
|
-
|
|
16741
|
-
|
|
16742
|
-
|
|
16743
|
-
|
|
16744
|
-
|
|
16745
|
-
|
|
16746
|
-
|
|
16747
|
-
|
|
16748
|
-
|
|
16749
|
-
|
|
16750
|
-
|
|
16751
|
-
|
|
17110
|
+
var theme2 = {
|
|
17111
|
+
BASE_FONT_FAMILY: "Menlo, monospace",
|
|
17112
|
+
BASE_FONT_SIZE: "11px",
|
|
17113
|
+
BASE_LINE_HEIGHT: 1.2,
|
|
17114
|
+
BASE_BACKGROUND_COLOR: "white",
|
|
17115
|
+
BASE_COLOR: "black",
|
|
17116
|
+
OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES: 10,
|
|
17117
|
+
OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES: 5,
|
|
17118
|
+
OBJECT_NAME_COLOR: "rgb(136, 19, 145)",
|
|
17119
|
+
OBJECT_VALUE_NULL_COLOR: "rgb(128, 128, 128)",
|
|
17120
|
+
OBJECT_VALUE_UNDEFINED_COLOR: "rgb(128, 128, 128)",
|
|
17121
|
+
OBJECT_VALUE_REGEXP_COLOR: "rgb(196, 26, 22)",
|
|
17122
|
+
OBJECT_VALUE_STRING_COLOR: "rgb(196, 26, 22)",
|
|
17123
|
+
OBJECT_VALUE_SYMBOL_COLOR: "rgb(196, 26, 22)",
|
|
17124
|
+
OBJECT_VALUE_NUMBER_COLOR: "rgb(28, 0, 207)",
|
|
17125
|
+
OBJECT_VALUE_BOOLEAN_COLOR: "rgb(28, 0, 207)",
|
|
17126
|
+
OBJECT_VALUE_FUNCTION_PREFIX_COLOR: "rgb(13, 34, 170)",
|
|
17127
|
+
HTML_TAG_COLOR: "rgb(168, 148, 166)",
|
|
17128
|
+
HTML_TAGNAME_COLOR: "rgb(136, 18, 128)",
|
|
17129
|
+
HTML_TAGNAME_TEXT_TRANSFORM: "lowercase",
|
|
17130
|
+
HTML_ATTRIBUTE_NAME_COLOR: "rgb(153, 69, 0)",
|
|
17131
|
+
HTML_ATTRIBUTE_VALUE_COLOR: "rgb(26, 26, 166)",
|
|
17132
|
+
HTML_COMMENT_COLOR: "rgb(35, 110, 37)",
|
|
17133
|
+
HTML_DOCTYPE_COLOR: "rgb(192, 192, 192)",
|
|
17134
|
+
ARROW_COLOR: "#6e6e6e",
|
|
17135
|
+
ARROW_MARGIN_RIGHT: 3,
|
|
17136
|
+
ARROW_FONT_SIZE: 12,
|
|
17137
|
+
ARROW_ANIMATION_DURATION: "0",
|
|
17138
|
+
TREENODE_FONT_FAMILY: "Menlo, monospace",
|
|
17139
|
+
TREENODE_FONT_SIZE: "11px",
|
|
17140
|
+
TREENODE_LINE_HEIGHT: 1.2,
|
|
17141
|
+
TREENODE_PADDING_LEFT: 12,
|
|
17142
|
+
TABLE_BORDER_COLOR: "#aaa",
|
|
17143
|
+
TABLE_TH_BACKGROUND_COLOR: "#eee",
|
|
17144
|
+
TABLE_TH_HOVER_COLOR: "hsla(0, 0%, 90%, 1)",
|
|
17145
|
+
TABLE_SORT_ICON_COLOR: "#6e6e6e",
|
|
17146
|
+
TABLE_DATA_BACKGROUND_IMAGE: "linear-gradient(to bottom, white, white 50%, rgb(234, 243, 255) 50%, rgb(234, 243, 255))",
|
|
17147
|
+
TABLE_DATA_BACKGROUND_SIZE: "128px 32px"
|
|
16752
17148
|
};
|
|
16753
|
-
|
|
16754
|
-
|
|
16755
|
-
|
|
16756
|
-
|
|
16757
|
-
|
|
16758
|
-
|
|
16759
|
-
|
|
16760
|
-
|
|
16761
|
-
|
|
16762
|
-
|
|
16763
|
-
// Numbers & booleans — yellow (Node: 'yellow')
|
|
16764
|
-
OBJECT_VALUE_NUMBER_COLOR: "#facc15",
|
|
16765
|
-
// yellow-400
|
|
16766
|
-
OBJECT_VALUE_BOOLEAN_COLOR: "#facc15",
|
|
16767
|
-
// null — bold foreground / white (Node: 'bold')
|
|
16768
|
-
OBJECT_VALUE_NULL_COLOR: "var(--ds-gray-1000)",
|
|
16769
|
-
// undefined — grey (Node: 'grey')
|
|
16770
|
-
OBJECT_VALUE_UNDEFINED_COLOR: "var(--ds-gray-500)",
|
|
16771
|
-
// RegExp — red (Node regexp palette)
|
|
16772
|
-
OBJECT_VALUE_REGEXP_COLOR: "#f87171",
|
|
16773
|
-
// red-400
|
|
16774
|
-
// Functions — cyan (Node: 'special' → 'cyan')
|
|
16775
|
-
OBJECT_VALUE_FUNCTION_PREFIX_COLOR: "#22d3ee",
|
|
16776
|
-
// cyan-400
|
|
16777
|
-
// HTML
|
|
16778
|
-
HTML_TAG_COLOR: "var(--ds-gray-500)",
|
|
16779
|
-
HTML_TAGNAME_COLOR: "#22d3ee",
|
|
16780
|
-
HTML_ATTRIBUTE_NAME_COLOR: "#facc15",
|
|
16781
|
-
HTML_ATTRIBUTE_VALUE_COLOR: "#4ade80",
|
|
16782
|
-
HTML_COMMENT_COLOR: "var(--ds-gray-500)",
|
|
16783
|
-
HTML_DOCTYPE_COLOR: "var(--ds-gray-500)",
|
|
16784
|
-
// Structural
|
|
16785
|
-
ARROW_COLOR: "var(--ds-gray-500)",
|
|
16786
|
-
TABLE_BORDER_COLOR: "var(--ds-gray-300)",
|
|
16787
|
-
TABLE_TH_BACKGROUND_COLOR: "var(--ds-gray-100)",
|
|
16788
|
-
TABLE_TH_HOVER_COLOR: "var(--ds-gray-200)",
|
|
16789
|
-
TABLE_SORT_ICON_COLOR: "var(--ds-gray-500)"
|
|
17149
|
+
var ExpandedPathsContext = reactExports.createContext([{}, () => {
|
|
17150
|
+
}]);
|
|
17151
|
+
var unselectable = {
|
|
17152
|
+
WebkitTouchCallout: "none",
|
|
17153
|
+
WebkitUserSelect: "none",
|
|
17154
|
+
KhtmlUserSelect: "none",
|
|
17155
|
+
MozUserSelect: "none",
|
|
17156
|
+
msUserSelect: "none",
|
|
17157
|
+
OUserSelect: "none",
|
|
17158
|
+
userSelect: "none"
|
|
16790
17159
|
};
|
|
16791
|
-
|
|
16792
|
-
|
|
16793
|
-
|
|
16794
|
-
|
|
16795
|
-
|
|
16796
|
-
|
|
16797
|
-
|
|
16798
|
-
|
|
16799
|
-
|
|
16800
|
-
|
|
16801
|
-
|
|
16802
|
-
|
|
16803
|
-
|
|
16804
|
-
|
|
16805
|
-
|
|
16806
|
-
|
|
16807
|
-
|
|
16808
|
-
|
|
16809
|
-
|
|
16810
|
-
|
|
16811
|
-
|
|
16812
|
-
|
|
16813
|
-
|
|
16814
|
-
|
|
16815
|
-
|
|
16816
|
-
|
|
16817
|
-
|
|
16818
|
-
|
|
16819
|
-
|
|
16820
|
-
|
|
16821
|
-
|
|
16822
|
-
|
|
16823
|
-
|
|
16824
|
-
|
|
16825
|
-
|
|
16826
|
-
color: "var(--ds-blue-800)",
|
|
16827
|
-
border: "1px solid var(--ds-blue-300)"
|
|
16828
|
-
}, onClick: () => onStreamClick == null ? void 0 : onStreamClick(streamRef.streamId), title: `View stream: ${streamRef.streamId}`, children: [jsxRuntimeExports.jsx("span", { children: "📡" }), jsxRuntimeExports.jsx("span", { children: streamRef.streamId })] });
|
|
16829
|
-
}
|
|
16830
|
-
const ExtendedThemeContext = reactExports.createContext(inspectorThemeExtendedLight);
|
|
16831
|
-
function NodeRenderer({ depth, name: name2, data, isNonenumerable }) {
|
|
16832
|
-
var _a3;
|
|
16833
|
-
const extendedTheme = reactExports.useContext(ExtendedThemeContext);
|
|
16834
|
-
if (data !== null && typeof data === "object" && ((_a3 = data.constructor) == null ? void 0 : _a3.name) === ENCRYPTED_DISPLAY_NAME) {
|
|
16835
|
-
const label = jsxRuntimeExports.jsx(EncryptedInlineLabel, {});
|
|
16836
|
-
if (depth === 0) {
|
|
16837
|
-
return label;
|
|
17160
|
+
var createTheme = (theme3) => ({
|
|
17161
|
+
DOMNodePreview: {
|
|
17162
|
+
htmlOpenTag: {
|
|
17163
|
+
base: {
|
|
17164
|
+
color: theme3.HTML_TAG_COLOR
|
|
17165
|
+
},
|
|
17166
|
+
tagName: {
|
|
17167
|
+
color: theme3.HTML_TAGNAME_COLOR,
|
|
17168
|
+
textTransform: theme3.HTML_TAGNAME_TEXT_TRANSFORM
|
|
17169
|
+
},
|
|
17170
|
+
htmlAttributeName: {
|
|
17171
|
+
color: theme3.HTML_ATTRIBUTE_NAME_COLOR
|
|
17172
|
+
},
|
|
17173
|
+
htmlAttributeValue: {
|
|
17174
|
+
color: theme3.HTML_ATTRIBUTE_VALUE_COLOR
|
|
17175
|
+
}
|
|
17176
|
+
},
|
|
17177
|
+
htmlCloseTag: {
|
|
17178
|
+
base: {
|
|
17179
|
+
color: theme3.HTML_TAG_COLOR
|
|
17180
|
+
},
|
|
17181
|
+
offsetLeft: {
|
|
17182
|
+
/* hack: offset placeholder */
|
|
17183
|
+
marginLeft: -theme3.TREENODE_PADDING_LEFT
|
|
17184
|
+
},
|
|
17185
|
+
tagName: {
|
|
17186
|
+
color: theme3.HTML_TAGNAME_COLOR,
|
|
17187
|
+
textTransform: theme3.HTML_TAGNAME_TEXT_TRANSFORM
|
|
17188
|
+
}
|
|
17189
|
+
},
|
|
17190
|
+
htmlComment: {
|
|
17191
|
+
color: theme3.HTML_COMMENT_COLOR
|
|
17192
|
+
},
|
|
17193
|
+
htmlDoctype: {
|
|
17194
|
+
color: theme3.HTML_DOCTYPE_COLOR
|
|
16838
17195
|
}
|
|
16839
|
-
|
|
16840
|
-
|
|
16841
|
-
|
|
16842
|
-
|
|
16843
|
-
|
|
16844
|
-
|
|
16845
|
-
|
|
16846
|
-
|
|
17196
|
+
},
|
|
17197
|
+
ObjectPreview: {
|
|
17198
|
+
objectDescription: {
|
|
17199
|
+
fontStyle: "italic"
|
|
17200
|
+
},
|
|
17201
|
+
preview: {
|
|
17202
|
+
fontStyle: "italic"
|
|
17203
|
+
},
|
|
17204
|
+
arrayMaxProperties: theme3.OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES,
|
|
17205
|
+
objectMaxProperties: theme3.OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES
|
|
17206
|
+
},
|
|
17207
|
+
ObjectName: {
|
|
17208
|
+
base: {
|
|
17209
|
+
color: theme3.OBJECT_NAME_COLOR
|
|
17210
|
+
},
|
|
17211
|
+
dimmed: {
|
|
17212
|
+
opacity: 0.6
|
|
16847
17213
|
}
|
|
16848
|
-
|
|
16849
|
-
|
|
16850
|
-
|
|
16851
|
-
|
|
16852
|
-
|
|
16853
|
-
|
|
17214
|
+
},
|
|
17215
|
+
ObjectValue: {
|
|
17216
|
+
objectValueNull: {
|
|
17217
|
+
color: theme3.OBJECT_VALUE_NULL_COLOR
|
|
17218
|
+
},
|
|
17219
|
+
objectValueUndefined: {
|
|
17220
|
+
color: theme3.OBJECT_VALUE_UNDEFINED_COLOR
|
|
17221
|
+
},
|
|
17222
|
+
objectValueRegExp: {
|
|
17223
|
+
color: theme3.OBJECT_VALUE_REGEXP_COLOR
|
|
17224
|
+
},
|
|
17225
|
+
objectValueString: {
|
|
17226
|
+
color: theme3.OBJECT_VALUE_STRING_COLOR
|
|
17227
|
+
},
|
|
17228
|
+
objectValueSymbol: {
|
|
17229
|
+
color: theme3.OBJECT_VALUE_SYMBOL_COLOR
|
|
17230
|
+
},
|
|
17231
|
+
objectValueNumber: {
|
|
17232
|
+
color: theme3.OBJECT_VALUE_NUMBER_COLOR
|
|
17233
|
+
},
|
|
17234
|
+
objectValueBoolean: {
|
|
17235
|
+
color: theme3.OBJECT_VALUE_BOOLEAN_COLOR
|
|
17236
|
+
},
|
|
17237
|
+
objectValueFunctionPrefix: {
|
|
17238
|
+
color: theme3.OBJECT_VALUE_FUNCTION_PREFIX_COLOR,
|
|
17239
|
+
fontStyle: "italic"
|
|
17240
|
+
},
|
|
17241
|
+
objectValueFunctionName: {
|
|
17242
|
+
fontStyle: "italic"
|
|
16854
17243
|
}
|
|
16855
|
-
|
|
16856
|
-
|
|
16857
|
-
|
|
16858
|
-
|
|
16859
|
-
|
|
16860
|
-
|
|
16861
|
-
}
|
|
16862
|
-
function DataInspector({ data, expandLevel = 2, name: name2, onStreamClick, onDecrypt, isDecrypting = false }) {
|
|
16863
|
-
const stableData = useStableInspectorData(data);
|
|
16864
|
-
const [initialExpandLevel, setInitialExpandLevel] = reactExports.useState(expandLevel);
|
|
16865
|
-
const isDark = useDarkMode();
|
|
16866
|
-
const extendedTheme = isDark ? inspectorThemeExtendedDark : inspectorThemeExtendedLight;
|
|
16867
|
-
reactExports.useEffect(() => {
|
|
16868
|
-
setInitialExpandLevel(0);
|
|
16869
|
-
}, []);
|
|
16870
|
-
const content2 = jsxRuntimeExports.jsx(ExtendedThemeContext.Provider, { value: extendedTheme, children: jsxRuntimeExports.jsx(themedObjectInspector, {
|
|
16871
|
-
data: stableData,
|
|
16872
|
-
name: name2,
|
|
16873
|
-
// @ts-expect-error react-inspector accepts theme objects at runtime despite
|
|
16874
|
-
// types declaring string only — see https://github.com/storybookjs/react-inspector/blob/main/README.md#theme
|
|
16875
|
-
theme: isDark ? inspectorThemeDark : inspectorThemeLight,
|
|
16876
|
-
expandLevel: initialExpandLevel,
|
|
16877
|
-
nodeRenderer: NodeRenderer
|
|
16878
|
-
}) });
|
|
16879
|
-
let wrapped = content2;
|
|
16880
|
-
if (onStreamClick) {
|
|
16881
|
-
wrapped = jsxRuntimeExports.jsx(StreamClickContext.Provider, { value: onStreamClick, children: wrapped });
|
|
16882
|
-
}
|
|
16883
|
-
if (onDecrypt) {
|
|
16884
|
-
wrapped = jsxRuntimeExports.jsx(DecryptClickContext.Provider, { value: { onDecrypt, isDecrypting }, children: wrapped });
|
|
16885
|
-
}
|
|
16886
|
-
return wrapped;
|
|
16887
|
-
}
|
|
16888
|
-
function useStableInspectorData(next2) {
|
|
16889
|
-
const previousRef = reactExports.useRef(next2);
|
|
16890
|
-
if (!isDeepEqual(previousRef.current, next2)) {
|
|
16891
|
-
previousRef.current = next2;
|
|
16892
|
-
}
|
|
16893
|
-
return previousRef.current;
|
|
16894
|
-
}
|
|
16895
|
-
function isObjectLike(value) {
|
|
16896
|
-
return typeof value === "object" && value !== null;
|
|
16897
|
-
}
|
|
16898
|
-
function isDeepEqual(a2, b2, seen2 = /* @__PURE__ */ new WeakMap()) {
|
|
16899
|
-
if (Object.is(a2, b2))
|
|
16900
|
-
return true;
|
|
16901
|
-
if (a2 instanceof Date && b2 instanceof Date) {
|
|
16902
|
-
return a2.getTime() === b2.getTime();
|
|
16903
|
-
}
|
|
16904
|
-
if (a2 instanceof RegExp && b2 instanceof RegExp) {
|
|
16905
|
-
return a2.source === b2.source && a2.flags === b2.flags;
|
|
16906
|
-
}
|
|
16907
|
-
if (a2 instanceof Map && b2 instanceof Map) {
|
|
16908
|
-
if (a2.size !== b2.size)
|
|
16909
|
-
return false;
|
|
16910
|
-
for (const [key, value] of a2.entries()) {
|
|
16911
|
-
if (!b2.has(key) || !isDeepEqual(value, b2.get(key), seen2))
|
|
16912
|
-
return false;
|
|
17244
|
+
},
|
|
17245
|
+
TreeView: {
|
|
17246
|
+
treeViewOutline: {
|
|
17247
|
+
padding: 0,
|
|
17248
|
+
margin: 0,
|
|
17249
|
+
listStyleType: "none"
|
|
16913
17250
|
}
|
|
16914
|
-
|
|
16915
|
-
|
|
16916
|
-
|
|
16917
|
-
|
|
16918
|
-
|
|
16919
|
-
|
|
16920
|
-
|
|
16921
|
-
|
|
17251
|
+
},
|
|
17252
|
+
TreeNode: {
|
|
17253
|
+
treeNodeBase: {
|
|
17254
|
+
color: theme3.BASE_COLOR,
|
|
17255
|
+
backgroundColor: theme3.BASE_BACKGROUND_COLOR,
|
|
17256
|
+
lineHeight: theme3.TREENODE_LINE_HEIGHT,
|
|
17257
|
+
cursor: "default",
|
|
17258
|
+
boxSizing: "border-box",
|
|
17259
|
+
listStyle: "none",
|
|
17260
|
+
fontFamily: theme3.TREENODE_FONT_FAMILY,
|
|
17261
|
+
fontSize: theme3.TREENODE_FONT_SIZE
|
|
17262
|
+
},
|
|
17263
|
+
treeNodePreviewContainer: {},
|
|
17264
|
+
treeNodePlaceholder: {
|
|
17265
|
+
whiteSpace: "pre",
|
|
17266
|
+
fontSize: theme3.ARROW_FONT_SIZE,
|
|
17267
|
+
marginRight: theme3.ARROW_MARGIN_RIGHT,
|
|
17268
|
+
...unselectable
|
|
17269
|
+
},
|
|
17270
|
+
treeNodeArrow: {
|
|
17271
|
+
base: {
|
|
17272
|
+
color: theme3.ARROW_COLOR,
|
|
17273
|
+
display: "inline-block",
|
|
17274
|
+
// lineHeight: '14px',
|
|
17275
|
+
fontSize: theme3.ARROW_FONT_SIZE,
|
|
17276
|
+
marginRight: theme3.ARROW_MARGIN_RIGHT,
|
|
17277
|
+
...parseFloat(theme3.ARROW_ANIMATION_DURATION) > 0 ? {
|
|
17278
|
+
transition: `transform ${theme3.ARROW_ANIMATION_DURATION} ease 0s`
|
|
17279
|
+
} : {},
|
|
17280
|
+
...unselectable
|
|
17281
|
+
},
|
|
17282
|
+
expanded: {
|
|
17283
|
+
WebkitTransform: "rotateZ(90deg)",
|
|
17284
|
+
MozTransform: "rotateZ(90deg)",
|
|
17285
|
+
transform: "rotateZ(90deg)"
|
|
17286
|
+
},
|
|
17287
|
+
collapsed: {
|
|
17288
|
+
WebkitTransform: "rotateZ(0deg)",
|
|
17289
|
+
MozTransform: "rotateZ(0deg)",
|
|
17290
|
+
transform: "rotateZ(0deg)"
|
|
17291
|
+
}
|
|
17292
|
+
},
|
|
17293
|
+
treeNodeChildNodesContainer: {
|
|
17294
|
+
margin: 0,
|
|
17295
|
+
// reset user-agent style
|
|
17296
|
+
paddingLeft: theme3.TREENODE_PADDING_LEFT
|
|
16922
17297
|
}
|
|
16923
|
-
|
|
16924
|
-
|
|
16925
|
-
|
|
16926
|
-
|
|
16927
|
-
|
|
16928
|
-
|
|
16929
|
-
|
|
16930
|
-
|
|
16931
|
-
|
|
16932
|
-
|
|
16933
|
-
|
|
16934
|
-
return false;
|
|
16935
|
-
if (aIsArray && bIsArray) {
|
|
16936
|
-
if (a2.length !== b2.length)
|
|
16937
|
-
return false;
|
|
16938
|
-
for (let i = 0; i < a2.length; i += 1) {
|
|
16939
|
-
if (!isDeepEqual(a2[i], b2[i], seen2))
|
|
16940
|
-
return false;
|
|
17298
|
+
},
|
|
17299
|
+
TableInspector: {
|
|
17300
|
+
base: {
|
|
17301
|
+
color: theme3.BASE_COLOR,
|
|
17302
|
+
position: "relative",
|
|
17303
|
+
border: `1px solid ${theme3.TABLE_BORDER_COLOR}`,
|
|
17304
|
+
fontFamily: theme3.BASE_FONT_FAMILY,
|
|
17305
|
+
fontSize: theme3.BASE_FONT_SIZE,
|
|
17306
|
+
lineHeight: "120%",
|
|
17307
|
+
boxSizing: "border-box",
|
|
17308
|
+
cursor: "default"
|
|
16941
17309
|
}
|
|
16942
|
-
|
|
16943
|
-
|
|
16944
|
-
|
|
16945
|
-
|
|
16946
|
-
|
|
16947
|
-
|
|
16948
|
-
|
|
16949
|
-
|
|
16950
|
-
|
|
16951
|
-
|
|
16952
|
-
|
|
16953
|
-
|
|
16954
|
-
|
|
16955
|
-
|
|
16956
|
-
|
|
16957
|
-
|
|
16958
|
-
|
|
16959
|
-
|
|
16960
|
-
|
|
16961
|
-
|
|
16962
|
-
|
|
16963
|
-
}
|
|
16964
|
-
|
|
16965
|
-
|
|
16966
|
-
|
|
16967
|
-
|
|
16968
|
-
|
|
16969
|
-
|
|
16970
|
-
|
|
16971
|
-
|
|
16972
|
-
|
|
16973
|
-
|
|
16974
|
-
|
|
16975
|
-
|
|
17310
|
+
},
|
|
17311
|
+
TableInspectorHeaderContainer: {
|
|
17312
|
+
base: {
|
|
17313
|
+
top: 0,
|
|
17314
|
+
height: "17px",
|
|
17315
|
+
left: 0,
|
|
17316
|
+
right: 0,
|
|
17317
|
+
overflowX: "hidden"
|
|
17318
|
+
},
|
|
17319
|
+
table: {
|
|
17320
|
+
tableLayout: "fixed",
|
|
17321
|
+
borderSpacing: 0,
|
|
17322
|
+
borderCollapse: "separate",
|
|
17323
|
+
height: "100%",
|
|
17324
|
+
width: "100%",
|
|
17325
|
+
margin: 0
|
|
17326
|
+
}
|
|
17327
|
+
},
|
|
17328
|
+
TableInspectorDataContainer: {
|
|
17329
|
+
tr: {
|
|
17330
|
+
display: "table-row"
|
|
17331
|
+
},
|
|
17332
|
+
td: {
|
|
17333
|
+
boxSizing: "border-box",
|
|
17334
|
+
border: "none",
|
|
17335
|
+
// prevent overrides
|
|
17336
|
+
height: "16px",
|
|
17337
|
+
// /* 0.5 * table.background-size height */
|
|
17338
|
+
verticalAlign: "top",
|
|
17339
|
+
padding: "1px 4px",
|
|
17340
|
+
WebkitUserSelect: "text",
|
|
17341
|
+
whiteSpace: "nowrap",
|
|
17342
|
+
textOverflow: "ellipsis",
|
|
17343
|
+
overflow: "hidden",
|
|
17344
|
+
lineHeight: "14px"
|
|
17345
|
+
},
|
|
17346
|
+
div: {
|
|
17347
|
+
position: "static",
|
|
17348
|
+
top: "17px",
|
|
17349
|
+
bottom: 0,
|
|
17350
|
+
overflowY: "overlay",
|
|
17351
|
+
transform: "translateZ(0)",
|
|
17352
|
+
left: 0,
|
|
17353
|
+
right: 0,
|
|
17354
|
+
overflowX: "hidden"
|
|
17355
|
+
},
|
|
17356
|
+
table: {
|
|
17357
|
+
positon: "static",
|
|
17358
|
+
left: 0,
|
|
17359
|
+
top: 0,
|
|
17360
|
+
right: 0,
|
|
17361
|
+
bottom: 0,
|
|
17362
|
+
borderTop: "0 none transparent",
|
|
17363
|
+
margin: 0,
|
|
17364
|
+
// prevent user agent stylesheet overrides
|
|
17365
|
+
backgroundImage: theme3.TABLE_DATA_BACKGROUND_IMAGE,
|
|
17366
|
+
backgroundSize: theme3.TABLE_DATA_BACKGROUND_SIZE,
|
|
17367
|
+
tableLayout: "fixed",
|
|
17368
|
+
// table
|
|
17369
|
+
borderSpacing: 0,
|
|
17370
|
+
borderCollapse: "separate",
|
|
17371
|
+
// height: '100%',
|
|
17372
|
+
width: "100%",
|
|
17373
|
+
fontSize: theme3.BASE_FONT_SIZE,
|
|
17374
|
+
lineHeight: "120%"
|
|
17375
|
+
}
|
|
17376
|
+
},
|
|
17377
|
+
TableInspectorTH: {
|
|
17378
|
+
base: {
|
|
17379
|
+
position: "relative",
|
|
17380
|
+
// anchor for sort icon container
|
|
17381
|
+
height: "auto",
|
|
17382
|
+
textAlign: "left",
|
|
17383
|
+
backgroundColor: theme3.TABLE_TH_BACKGROUND_COLOR,
|
|
17384
|
+
borderBottom: `1px solid ${theme3.TABLE_BORDER_COLOR}`,
|
|
17385
|
+
fontWeight: "normal",
|
|
17386
|
+
verticalAlign: "middle",
|
|
17387
|
+
padding: "0 4px",
|
|
17388
|
+
whiteSpace: "nowrap",
|
|
17389
|
+
textOverflow: "ellipsis",
|
|
17390
|
+
overflow: "hidden",
|
|
17391
|
+
lineHeight: "14px",
|
|
17392
|
+
":hover": {
|
|
17393
|
+
backgroundColor: theme3.TABLE_TH_HOVER_COLOR
|
|
17394
|
+
}
|
|
17395
|
+
},
|
|
17396
|
+
div: {
|
|
17397
|
+
whiteSpace: "nowrap",
|
|
17398
|
+
textOverflow: "ellipsis",
|
|
17399
|
+
overflow: "hidden",
|
|
17400
|
+
// prevent user agent stylesheet overrides
|
|
17401
|
+
fontSize: theme3.BASE_FONT_SIZE,
|
|
17402
|
+
lineHeight: "120%"
|
|
17403
|
+
}
|
|
17404
|
+
},
|
|
17405
|
+
TableInspectorLeftBorder: {
|
|
17406
|
+
none: {
|
|
17407
|
+
borderLeft: "none"
|
|
17408
|
+
},
|
|
17409
|
+
solid: {
|
|
17410
|
+
borderLeft: `1px solid ${theme3.TABLE_BORDER_COLOR}`
|
|
17411
|
+
}
|
|
17412
|
+
},
|
|
17413
|
+
TableInspectorSortIcon: {
|
|
17414
|
+
display: "block",
|
|
17415
|
+
marginRight: 3,
|
|
17416
|
+
// 4,
|
|
17417
|
+
width: 8,
|
|
17418
|
+
height: 7,
|
|
17419
|
+
marginTop: -7,
|
|
17420
|
+
color: theme3.TABLE_SORT_ICON_COLOR,
|
|
17421
|
+
fontSize: 12,
|
|
17422
|
+
// lineHeight: 14
|
|
17423
|
+
...unselectable
|
|
16976
17424
|
}
|
|
17425
|
+
});
|
|
17426
|
+
var DEFAULT_THEME_NAME = "chromeLight";
|
|
17427
|
+
var ThemeContext = reactExports.createContext(createTheme(themes_exports[DEFAULT_THEME_NAME]));
|
|
17428
|
+
var useStyles = (baseStylesKey) => {
|
|
17429
|
+
const themeStyles = reactExports.useContext(ThemeContext);
|
|
17430
|
+
return themeStyles[baseStylesKey];
|
|
16977
17431
|
};
|
|
16978
|
-
|
|
16979
|
-
const
|
|
16980
|
-
|
|
16981
|
-
|
|
16982
|
-
|
|
16983
|
-
|
|
16984
|
-
|
|
16985
|
-
|
|
16986
|
-
|
|
16987
|
-
|
|
16988
|
-
|
|
16989
|
-
|
|
16990
|
-
|
|
16991
|
-
}
|
|
17432
|
+
var themeAcceptor = (WrappedComponent) => {
|
|
17433
|
+
const ThemeAcceptor = ({ theme: theme3 = DEFAULT_THEME_NAME, ...restProps }) => {
|
|
17434
|
+
const themeStyles = reactExports.useMemo(() => {
|
|
17435
|
+
switch (Object.prototype.toString.call(theme3)) {
|
|
17436
|
+
case "[object String]":
|
|
17437
|
+
return createTheme(themes_exports[theme3]);
|
|
17438
|
+
case "[object Object]":
|
|
17439
|
+
return createTheme(theme3);
|
|
17440
|
+
default:
|
|
17441
|
+
return createTheme(themes_exports[DEFAULT_THEME_NAME]);
|
|
17442
|
+
}
|
|
17443
|
+
}, [theme3]);
|
|
17444
|
+
return /* @__PURE__ */ ReactExports.createElement(ThemeContext.Provider, { value: themeStyles }, /* @__PURE__ */ ReactExports.createElement(WrappedComponent, { ...restProps }));
|
|
17445
|
+
};
|
|
17446
|
+
return ThemeAcceptor;
|
|
16992
17447
|
};
|
|
16993
|
-
|
|
16994
|
-
|
|
16995
|
-
|
|
16996
|
-
|
|
16997
|
-
|
|
16998
|
-
|
|
16999
|
-
}
|
|
17000
|
-
|
|
17001
|
-
|
|
17002
|
-
|
|
17003
|
-
|
|
17004
|
-
|
|
17005
|
-
|
|
17006
|
-
|
|
17007
|
-
|
|
17008
|
-
|
|
17009
|
-
|
|
17010
|
-
|
|
17011
|
-
|
|
17012
|
-
|
|
17013
|
-
|
|
17014
|
-
|
|
17015
|
-
const
|
|
17016
|
-
|
|
17017
|
-
|
|
17018
|
-
|
|
17019
|
-
|
|
17020
|
-
|
|
17021
|
-
|
|
17022
|
-
|
|
17023
|
-
|
|
17024
|
-
|
|
17025
|
-
}
|
|
17026
|
-
|
|
17027
|
-
|
|
17028
|
-
viewBox: "0 0 20 20",
|
|
17029
|
-
fill: "currentColor",
|
|
17030
|
-
height: "20",
|
|
17031
|
-
width: "20"
|
|
17032
|
-
}, /* @__PURE__ */ ReactExports.createElement("path", {
|
|
17033
|
-
fillRule: "evenodd",
|
|
17034
|
-
d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",
|
|
17035
|
-
clipRule: "evenodd"
|
|
17036
|
-
}));
|
|
17037
|
-
const CloseIcon = /* @__PURE__ */ ReactExports.createElement("svg", {
|
|
17038
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
17039
|
-
width: "12",
|
|
17040
|
-
height: "12",
|
|
17041
|
-
viewBox: "0 0 24 24",
|
|
17042
|
-
fill: "none",
|
|
17043
|
-
stroke: "currentColor",
|
|
17044
|
-
strokeWidth: "1.5",
|
|
17045
|
-
strokeLinecap: "round",
|
|
17046
|
-
strokeLinejoin: "round"
|
|
17047
|
-
}, /* @__PURE__ */ ReactExports.createElement("line", {
|
|
17048
|
-
x1: "18",
|
|
17049
|
-
y1: "6",
|
|
17050
|
-
x2: "6",
|
|
17051
|
-
y2: "18"
|
|
17052
|
-
}), /* @__PURE__ */ ReactExports.createElement("line", {
|
|
17053
|
-
x1: "6",
|
|
17054
|
-
y1: "6",
|
|
17055
|
-
x2: "18",
|
|
17056
|
-
y2: "18"
|
|
17057
|
-
}));
|
|
17058
|
-
const useIsDocumentHidden = () => {
|
|
17059
|
-
const [isDocumentHidden, setIsDocumentHidden] = ReactExports.useState(document.hidden);
|
|
17060
|
-
ReactExports.useEffect(() => {
|
|
17061
|
-
const callback = () => {
|
|
17062
|
-
setIsDocumentHidden(document.hidden);
|
|
17063
|
-
};
|
|
17064
|
-
document.addEventListener("visibilitychange", callback);
|
|
17065
|
-
return () => window.removeEventListener("visibilitychange", callback);
|
|
17066
|
-
}, []);
|
|
17067
|
-
return isDocumentHidden;
|
|
17448
|
+
var Arrow = ({ expanded: expanded2, styles: styles2 }) => /* @__PURE__ */ ReactExports.createElement(
|
|
17449
|
+
"span",
|
|
17450
|
+
{
|
|
17451
|
+
style: {
|
|
17452
|
+
...styles2.base,
|
|
17453
|
+
...expanded2 ? styles2.expanded : styles2.collapsed
|
|
17454
|
+
}
|
|
17455
|
+
},
|
|
17456
|
+
"▶"
|
|
17457
|
+
);
|
|
17458
|
+
var TreeNode = reactExports.memo((props) => {
|
|
17459
|
+
props = {
|
|
17460
|
+
expanded: true,
|
|
17461
|
+
nodeRenderer: ({ name: name2 }) => /* @__PURE__ */ ReactExports.createElement("span", null, name2),
|
|
17462
|
+
onClick: () => {
|
|
17463
|
+
},
|
|
17464
|
+
shouldShowArrow: false,
|
|
17465
|
+
shouldShowPlaceholder: true,
|
|
17466
|
+
...props
|
|
17467
|
+
};
|
|
17468
|
+
const { expanded: expanded2, onClick, children: children2, nodeRenderer, title, shouldShowArrow, shouldShowPlaceholder } = props;
|
|
17469
|
+
const styles2 = useStyles("TreeNode");
|
|
17470
|
+
const NodeRenderer2 = nodeRenderer;
|
|
17471
|
+
return /* @__PURE__ */ ReactExports.createElement("li", { "aria-expanded": expanded2, role: "treeitem", style: styles2.treeNodeBase, title }, /* @__PURE__ */ ReactExports.createElement("div", { style: styles2.treeNodePreviewContainer, onClick }, shouldShowArrow || reactExports.Children.count(children2) > 0 ? /* @__PURE__ */ ReactExports.createElement(Arrow, { expanded: expanded2, styles: styles2.treeNodeArrow }) : shouldShowPlaceholder && /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.treeNodePlaceholder }, " "), /* @__PURE__ */ ReactExports.createElement(NodeRenderer2, { ...props })), /* @__PURE__ */ ReactExports.createElement("ol", { role: "group", style: styles2.treeNodeChildNodesContainer }, expanded2 ? children2 : void 0));
|
|
17472
|
+
});
|
|
17473
|
+
var DEFAULT_ROOT_PATH = "$";
|
|
17474
|
+
var WILDCARD = "*";
|
|
17475
|
+
function hasChildNodes(data, dataIterator) {
|
|
17476
|
+
return !dataIterator(data).next().done;
|
|
17477
|
+
}
|
|
17478
|
+
var wildcardPathsFromLevel = (level) => {
|
|
17479
|
+
return Array.from(
|
|
17480
|
+
{ length: level },
|
|
17481
|
+
(_2, i) => [DEFAULT_ROOT_PATH].concat(Array.from({ length: i }, () => "*")).join(".")
|
|
17482
|
+
);
|
|
17068
17483
|
};
|
|
17069
|
-
|
|
17070
|
-
|
|
17071
|
-
|
|
17072
|
-
|
|
17073
|
-
|
|
17074
|
-
|
|
17075
|
-
|
|
17076
|
-
|
|
17077
|
-
};
|
|
17078
|
-
};
|
|
17079
|
-
this.publish = (data) => {
|
|
17080
|
-
this.subscribers.forEach((subscriber) => subscriber(data));
|
|
17081
|
-
};
|
|
17082
|
-
this.addToast = (data) => {
|
|
17083
|
-
this.publish(data);
|
|
17084
|
-
this.toasts = [
|
|
17085
|
-
...this.toasts,
|
|
17086
|
-
data
|
|
17087
|
-
];
|
|
17088
|
-
};
|
|
17089
|
-
this.create = (data) => {
|
|
17090
|
-
var _data_id;
|
|
17091
|
-
const { message, ...rest } = data;
|
|
17092
|
-
const id = typeof (data == null ? void 0 : data.id) === "number" || ((_data_id = data.id) == null ? void 0 : _data_id.length) > 0 ? data.id : toastsCounter++;
|
|
17093
|
-
const alreadyExists = this.toasts.find((toast2) => {
|
|
17094
|
-
return toast2.id === id;
|
|
17095
|
-
});
|
|
17096
|
-
const dismissible = data.dismissible === void 0 ? true : data.dismissible;
|
|
17097
|
-
if (this.dismissedToasts.has(id)) {
|
|
17098
|
-
this.dismissedToasts.delete(id);
|
|
17099
|
-
}
|
|
17100
|
-
if (alreadyExists) {
|
|
17101
|
-
this.toasts = this.toasts.map((toast2) => {
|
|
17102
|
-
if (toast2.id === id) {
|
|
17103
|
-
this.publish({
|
|
17104
|
-
...toast2,
|
|
17105
|
-
...data,
|
|
17106
|
-
id,
|
|
17107
|
-
title: message
|
|
17108
|
-
});
|
|
17109
|
-
return {
|
|
17110
|
-
...toast2,
|
|
17111
|
-
...data,
|
|
17112
|
-
id,
|
|
17113
|
-
dismissible,
|
|
17114
|
-
title: message
|
|
17115
|
-
};
|
|
17116
|
-
}
|
|
17117
|
-
return toast2;
|
|
17118
|
-
});
|
|
17119
|
-
} else {
|
|
17120
|
-
this.addToast({
|
|
17121
|
-
title: message,
|
|
17122
|
-
...rest,
|
|
17123
|
-
dismissible,
|
|
17124
|
-
id
|
|
17125
|
-
});
|
|
17126
|
-
}
|
|
17127
|
-
return id;
|
|
17128
|
-
};
|
|
17129
|
-
this.dismiss = (id) => {
|
|
17130
|
-
if (id) {
|
|
17131
|
-
this.dismissedToasts.add(id);
|
|
17132
|
-
requestAnimationFrame(() => this.subscribers.forEach((subscriber) => subscriber({
|
|
17133
|
-
id,
|
|
17134
|
-
dismiss: true
|
|
17135
|
-
})));
|
|
17136
|
-
} else {
|
|
17137
|
-
this.toasts.forEach((toast2) => {
|
|
17138
|
-
this.subscribers.forEach((subscriber) => subscriber({
|
|
17139
|
-
id: toast2.id,
|
|
17140
|
-
dismiss: true
|
|
17141
|
-
}));
|
|
17142
|
-
});
|
|
17143
|
-
}
|
|
17144
|
-
return id;
|
|
17145
|
-
};
|
|
17146
|
-
this.message = (message, data) => {
|
|
17147
|
-
return this.create({
|
|
17148
|
-
...data,
|
|
17149
|
-
message
|
|
17150
|
-
});
|
|
17151
|
-
};
|
|
17152
|
-
this.error = (message, data) => {
|
|
17153
|
-
return this.create({
|
|
17154
|
-
...data,
|
|
17155
|
-
message,
|
|
17156
|
-
type: "error"
|
|
17157
|
-
});
|
|
17158
|
-
};
|
|
17159
|
-
this.success = (message, data) => {
|
|
17160
|
-
return this.create({
|
|
17161
|
-
...data,
|
|
17162
|
-
type: "success",
|
|
17163
|
-
message
|
|
17164
|
-
});
|
|
17165
|
-
};
|
|
17166
|
-
this.info = (message, data) => {
|
|
17167
|
-
return this.create({
|
|
17168
|
-
...data,
|
|
17169
|
-
type: "info",
|
|
17170
|
-
message
|
|
17171
|
-
});
|
|
17172
|
-
};
|
|
17173
|
-
this.warning = (message, data) => {
|
|
17174
|
-
return this.create({
|
|
17175
|
-
...data,
|
|
17176
|
-
type: "warning",
|
|
17177
|
-
message
|
|
17178
|
-
});
|
|
17179
|
-
};
|
|
17180
|
-
this.loading = (message, data) => {
|
|
17181
|
-
return this.create({
|
|
17182
|
-
...data,
|
|
17183
|
-
type: "loading",
|
|
17184
|
-
message
|
|
17185
|
-
});
|
|
17186
|
-
};
|
|
17187
|
-
this.promise = (promise, data) => {
|
|
17188
|
-
if (!data) {
|
|
17484
|
+
var getExpandedPaths = (data, dataIterator, expandPaths, expandLevel, prevExpandedPaths) => {
|
|
17485
|
+
const wildcardPaths = [].concat(wildcardPathsFromLevel(expandLevel)).concat(expandPaths).filter((path2) => typeof path2 === "string");
|
|
17486
|
+
const expandedPaths = [];
|
|
17487
|
+
wildcardPaths.forEach((wildcardPath) => {
|
|
17488
|
+
const keyPaths = wildcardPath.split(".");
|
|
17489
|
+
const populatePaths = (curData, curPath, depth) => {
|
|
17490
|
+
if (depth === keyPaths.length) {
|
|
17491
|
+
expandedPaths.push(curPath);
|
|
17189
17492
|
return;
|
|
17190
17493
|
}
|
|
17191
|
-
|
|
17192
|
-
if (
|
|
17193
|
-
|
|
17194
|
-
|
|
17195
|
-
promise,
|
|
17196
|
-
type: "loading",
|
|
17197
|
-
message: data.loading,
|
|
17198
|
-
description: typeof data.description !== "function" ? data.description : void 0
|
|
17199
|
-
});
|
|
17200
|
-
}
|
|
17201
|
-
const p2 = Promise.resolve(promise instanceof Function ? promise() : promise);
|
|
17202
|
-
let shouldDismiss = id !== void 0;
|
|
17203
|
-
let result;
|
|
17204
|
-
const originalPromise = p2.then(async (response) => {
|
|
17205
|
-
result = [
|
|
17206
|
-
"resolve",
|
|
17207
|
-
response
|
|
17208
|
-
];
|
|
17209
|
-
const isReactElementResponse = ReactExports.isValidElement(response);
|
|
17210
|
-
if (isReactElementResponse) {
|
|
17211
|
-
shouldDismiss = false;
|
|
17212
|
-
this.create({
|
|
17213
|
-
id,
|
|
17214
|
-
type: "default",
|
|
17215
|
-
message: response
|
|
17216
|
-
});
|
|
17217
|
-
} else if (isHttpResponse(response) && !response.ok) {
|
|
17218
|
-
shouldDismiss = false;
|
|
17219
|
-
const promiseData = typeof data.error === "function" ? await data.error(`HTTP error! status: ${response.status}`) : data.error;
|
|
17220
|
-
const description = typeof data.description === "function" ? await data.description(`HTTP error! status: ${response.status}`) : data.description;
|
|
17221
|
-
const isExtendedResult = typeof promiseData === "object" && !ReactExports.isValidElement(promiseData);
|
|
17222
|
-
const toastSettings = isExtendedResult ? promiseData : {
|
|
17223
|
-
message: promiseData
|
|
17224
|
-
};
|
|
17225
|
-
this.create({
|
|
17226
|
-
id,
|
|
17227
|
-
type: "error",
|
|
17228
|
-
description,
|
|
17229
|
-
...toastSettings
|
|
17230
|
-
});
|
|
17231
|
-
} else if (response instanceof Error) {
|
|
17232
|
-
shouldDismiss = false;
|
|
17233
|
-
const promiseData = typeof data.error === "function" ? await data.error(response) : data.error;
|
|
17234
|
-
const description = typeof data.description === "function" ? await data.description(response) : data.description;
|
|
17235
|
-
const isExtendedResult = typeof promiseData === "object" && !ReactExports.isValidElement(promiseData);
|
|
17236
|
-
const toastSettings = isExtendedResult ? promiseData : {
|
|
17237
|
-
message: promiseData
|
|
17238
|
-
};
|
|
17239
|
-
this.create({
|
|
17240
|
-
id,
|
|
17241
|
-
type: "error",
|
|
17242
|
-
description,
|
|
17243
|
-
...toastSettings
|
|
17244
|
-
});
|
|
17245
|
-
} else if (data.success !== void 0) {
|
|
17246
|
-
shouldDismiss = false;
|
|
17247
|
-
const promiseData = typeof data.success === "function" ? await data.success(response) : data.success;
|
|
17248
|
-
const description = typeof data.description === "function" ? await data.description(response) : data.description;
|
|
17249
|
-
const isExtendedResult = typeof promiseData === "object" && !ReactExports.isValidElement(promiseData);
|
|
17250
|
-
const toastSettings = isExtendedResult ? promiseData : {
|
|
17251
|
-
message: promiseData
|
|
17252
|
-
};
|
|
17253
|
-
this.create({
|
|
17254
|
-
id,
|
|
17255
|
-
type: "success",
|
|
17256
|
-
description,
|
|
17257
|
-
...toastSettings
|
|
17258
|
-
});
|
|
17259
|
-
}
|
|
17260
|
-
}).catch(async (error) => {
|
|
17261
|
-
result = [
|
|
17262
|
-
"reject",
|
|
17263
|
-
error
|
|
17264
|
-
];
|
|
17265
|
-
if (data.error !== void 0) {
|
|
17266
|
-
shouldDismiss = false;
|
|
17267
|
-
const promiseData = typeof data.error === "function" ? await data.error(error) : data.error;
|
|
17268
|
-
const description = typeof data.description === "function" ? await data.description(error) : data.description;
|
|
17269
|
-
const isExtendedResult = typeof promiseData === "object" && !ReactExports.isValidElement(promiseData);
|
|
17270
|
-
const toastSettings = isExtendedResult ? promiseData : {
|
|
17271
|
-
message: promiseData
|
|
17272
|
-
};
|
|
17273
|
-
this.create({
|
|
17274
|
-
id,
|
|
17275
|
-
type: "error",
|
|
17276
|
-
description,
|
|
17277
|
-
...toastSettings
|
|
17278
|
-
});
|
|
17279
|
-
}
|
|
17280
|
-
}).finally(() => {
|
|
17281
|
-
if (shouldDismiss) {
|
|
17282
|
-
this.dismiss(id);
|
|
17283
|
-
id = void 0;
|
|
17494
|
+
const key = keyPaths[depth];
|
|
17495
|
+
if (depth === 0) {
|
|
17496
|
+
if (hasChildNodes(curData, dataIterator) && (key === DEFAULT_ROOT_PATH || key === WILDCARD)) {
|
|
17497
|
+
populatePaths(curData, DEFAULT_ROOT_PATH, depth + 1);
|
|
17284
17498
|
}
|
|
17285
|
-
data.finally == null ? void 0 : data.finally.call(data);
|
|
17286
|
-
});
|
|
17287
|
-
const unwrap = () => new Promise((resolve, reject) => originalPromise.then(() => result[0] === "reject" ? reject(result[1]) : resolve(result[1])).catch(reject));
|
|
17288
|
-
if (typeof id !== "string" && typeof id !== "number") {
|
|
17289
|
-
return {
|
|
17290
|
-
unwrap
|
|
17291
|
-
};
|
|
17292
17499
|
} else {
|
|
17293
|
-
|
|
17294
|
-
|
|
17295
|
-
|
|
17500
|
+
if (key === WILDCARD) {
|
|
17501
|
+
for (const { name: name2, data: data2 } of dataIterator(curData)) {
|
|
17502
|
+
if (hasChildNodes(data2, dataIterator)) {
|
|
17503
|
+
populatePaths(data2, `${curPath}.${name2}`, depth + 1);
|
|
17504
|
+
}
|
|
17505
|
+
}
|
|
17506
|
+
} else {
|
|
17507
|
+
const value = curData[key];
|
|
17508
|
+
if (hasChildNodes(value, dataIterator)) {
|
|
17509
|
+
populatePaths(value, `${curPath}.${key}`, depth + 1);
|
|
17510
|
+
}
|
|
17511
|
+
}
|
|
17296
17512
|
}
|
|
17297
17513
|
};
|
|
17298
|
-
|
|
17299
|
-
const id = (data == null ? void 0 : data.id) || toastsCounter++;
|
|
17300
|
-
this.create({
|
|
17301
|
-
jsx: jsx(id),
|
|
17302
|
-
id,
|
|
17303
|
-
...data
|
|
17304
|
-
});
|
|
17305
|
-
return id;
|
|
17306
|
-
};
|
|
17307
|
-
this.getActiveToasts = () => {
|
|
17308
|
-
return this.toasts.filter((toast2) => !this.dismissedToasts.has(toast2.id));
|
|
17309
|
-
};
|
|
17310
|
-
this.subscribers = [];
|
|
17311
|
-
this.toasts = [];
|
|
17312
|
-
this.dismissedToasts = /* @__PURE__ */ new Set();
|
|
17313
|
-
}
|
|
17314
|
-
}
|
|
17315
|
-
const ToastState = new Observer();
|
|
17316
|
-
const toastFunction = (message, data) => {
|
|
17317
|
-
const id = (data == null ? void 0 : data.id) || toastsCounter++;
|
|
17318
|
-
ToastState.addToast({
|
|
17319
|
-
title: message,
|
|
17320
|
-
...data,
|
|
17321
|
-
id
|
|
17514
|
+
populatePaths(data, "", 0);
|
|
17322
17515
|
});
|
|
17323
|
-
return
|
|
17324
|
-
|
|
17325
|
-
|
|
17326
|
-
|
|
17516
|
+
return expandedPaths.reduce(
|
|
17517
|
+
(obj, path2) => {
|
|
17518
|
+
obj[path2] = true;
|
|
17519
|
+
return obj;
|
|
17520
|
+
},
|
|
17521
|
+
{ ...prevExpandedPaths }
|
|
17522
|
+
);
|
|
17327
17523
|
};
|
|
17328
|
-
|
|
17329
|
-
const
|
|
17330
|
-
const
|
|
17331
|
-
const
|
|
17332
|
-
|
|
17333
|
-
|
|
17334
|
-
|
|
17335
|
-
|
|
17336
|
-
|
|
17337
|
-
|
|
17338
|
-
|
|
17339
|
-
|
|
17340
|
-
|
|
17341
|
-
|
|
17342
|
-
|
|
17343
|
-
|
|
17344
|
-
|
|
17345
|
-
__insertCSS("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
|
|
17346
|
-
|
|
17347
|
-
|
|
17348
|
-
|
|
17349
|
-
|
|
17350
|
-
|
|
17351
|
-
|
|
17352
|
-
|
|
17353
|
-
|
|
17354
|
-
const GAP = 14;
|
|
17355
|
-
const SWIPE_THRESHOLD = 45;
|
|
17356
|
-
const TIME_BEFORE_UNMOUNT = 200;
|
|
17357
|
-
function cn$3(...classes) {
|
|
17358
|
-
return classes.filter(Boolean).join(" ");
|
|
17359
|
-
}
|
|
17360
|
-
function getDefaultSwipeDirections(position2) {
|
|
17361
|
-
const [y2, x2] = position2.split("-");
|
|
17362
|
-
const directions = [];
|
|
17363
|
-
if (y2) {
|
|
17364
|
-
directions.push(y2);
|
|
17365
|
-
}
|
|
17366
|
-
if (x2) {
|
|
17367
|
-
directions.push(x2);
|
|
17368
|
-
}
|
|
17369
|
-
return directions;
|
|
17370
|
-
}
|
|
17371
|
-
const Toast = (props) => {
|
|
17372
|
-
var _toast_classNames, _toast_classNames1, _toast_classNames2, _toast_classNames3, _toast_classNames4, _toast_classNames5, _toast_classNames6, _toast_classNames7, _toast_classNames8;
|
|
17373
|
-
const { invert: ToasterInvert, toast: toast2, unstyled, interacting, setHeights, visibleToasts, heights, index: index2, toasts, expanded: expanded2, removeToast, defaultRichColors, closeButton: closeButtonFromToaster, style: style2, cancelButtonStyle, actionButtonStyle, className = "", descriptionClassName = "", duration: durationFromToaster, position: position2, gap, expandByDefault, classNames, icons, closeButtonAriaLabel = "Close toast" } = props;
|
|
17374
|
-
const [swipeDirection, setSwipeDirection] = ReactExports.useState(null);
|
|
17375
|
-
const [swipeOutDirection, setSwipeOutDirection] = ReactExports.useState(null);
|
|
17376
|
-
const [mounted, setMounted] = ReactExports.useState(false);
|
|
17377
|
-
const [removed, setRemoved] = ReactExports.useState(false);
|
|
17378
|
-
const [swiping, setSwiping] = ReactExports.useState(false);
|
|
17379
|
-
const [swipeOut, setSwipeOut] = ReactExports.useState(false);
|
|
17380
|
-
const [isSwiped, setIsSwiped] = ReactExports.useState(false);
|
|
17381
|
-
const [offsetBeforeRemove, setOffsetBeforeRemove] = ReactExports.useState(0);
|
|
17382
|
-
const [initialHeight, setInitialHeight] = ReactExports.useState(0);
|
|
17383
|
-
const remainingTime = ReactExports.useRef(toast2.duration || durationFromToaster || TOAST_LIFETIME);
|
|
17384
|
-
const dragStartTime = ReactExports.useRef(null);
|
|
17385
|
-
const toastRef = ReactExports.useRef(null);
|
|
17386
|
-
const isFront = index2 === 0;
|
|
17387
|
-
const isVisible = index2 + 1 <= visibleToasts;
|
|
17388
|
-
const toastType = toast2.type;
|
|
17389
|
-
const dismissible = toast2.dismissible !== false;
|
|
17390
|
-
const toastClassname = toast2.className || "";
|
|
17391
|
-
const toastDescriptionClassname = toast2.descriptionClassName || "";
|
|
17392
|
-
const heightIndex = ReactExports.useMemo(() => heights.findIndex((height) => height.toastId === toast2.id) || 0, [
|
|
17393
|
-
heights,
|
|
17394
|
-
toast2.id
|
|
17395
|
-
]);
|
|
17396
|
-
const closeButton = ReactExports.useMemo(() => {
|
|
17397
|
-
var _toast_closeButton;
|
|
17398
|
-
return (_toast_closeButton = toast2.closeButton) != null ? _toast_closeButton : closeButtonFromToaster;
|
|
17399
|
-
}, [
|
|
17400
|
-
toast2.closeButton,
|
|
17401
|
-
closeButtonFromToaster
|
|
17402
|
-
]);
|
|
17403
|
-
const duration2 = ReactExports.useMemo(() => toast2.duration || durationFromToaster || TOAST_LIFETIME, [
|
|
17404
|
-
toast2.duration,
|
|
17405
|
-
durationFromToaster
|
|
17406
|
-
]);
|
|
17407
|
-
const closeTimerStartTimeRef = ReactExports.useRef(0);
|
|
17408
|
-
const offset2 = ReactExports.useRef(0);
|
|
17409
|
-
const lastCloseTimerStartTimeRef = ReactExports.useRef(0);
|
|
17410
|
-
const pointerStartRef = ReactExports.useRef(null);
|
|
17411
|
-
const [y2, x2] = position2.split("-");
|
|
17412
|
-
const toastsHeightBefore = ReactExports.useMemo(() => {
|
|
17413
|
-
return heights.reduce((prev, curr, reducerIndex) => {
|
|
17414
|
-
if (reducerIndex >= heightIndex) {
|
|
17415
|
-
return prev;
|
|
17416
|
-
}
|
|
17417
|
-
return prev + curr.height;
|
|
17418
|
-
}, 0);
|
|
17419
|
-
}, [
|
|
17420
|
-
heights,
|
|
17421
|
-
heightIndex
|
|
17422
|
-
]);
|
|
17423
|
-
const isDocumentHidden = useIsDocumentHidden();
|
|
17424
|
-
const invert = toast2.invert || ToasterInvert;
|
|
17425
|
-
const disabled = toastType === "loading";
|
|
17426
|
-
offset2.current = ReactExports.useMemo(() => heightIndex * gap + toastsHeightBefore, [
|
|
17427
|
-
heightIndex,
|
|
17428
|
-
toastsHeightBefore
|
|
17429
|
-
]);
|
|
17430
|
-
ReactExports.useEffect(() => {
|
|
17431
|
-
remainingTime.current = duration2;
|
|
17432
|
-
}, [
|
|
17433
|
-
duration2
|
|
17434
|
-
]);
|
|
17435
|
-
ReactExports.useEffect(() => {
|
|
17436
|
-
setMounted(true);
|
|
17437
|
-
}, []);
|
|
17438
|
-
ReactExports.useEffect(() => {
|
|
17439
|
-
const toastNode = toastRef.current;
|
|
17440
|
-
if (toastNode) {
|
|
17441
|
-
const height = toastNode.getBoundingClientRect().height;
|
|
17442
|
-
setInitialHeight(height);
|
|
17443
|
-
setHeights((h2) => [
|
|
17524
|
+
var ConnectedTreeNode = reactExports.memo((props) => {
|
|
17525
|
+
const { data, dataIterator, path: path2, depth, nodeRenderer } = props;
|
|
17526
|
+
const [expandedPaths, setExpandedPaths] = reactExports.useContext(ExpandedPathsContext);
|
|
17527
|
+
const nodeHasChildNodes = hasChildNodes(data, dataIterator);
|
|
17528
|
+
const expanded2 = !!expandedPaths[path2];
|
|
17529
|
+
const handleClick = reactExports.useCallback(
|
|
17530
|
+
() => nodeHasChildNodes && setExpandedPaths((prevExpandedPaths) => ({
|
|
17531
|
+
...prevExpandedPaths,
|
|
17532
|
+
[path2]: !expanded2
|
|
17533
|
+
})),
|
|
17534
|
+
[nodeHasChildNodes, setExpandedPaths, path2, expanded2]
|
|
17535
|
+
);
|
|
17536
|
+
return /* @__PURE__ */ ReactExports.createElement(
|
|
17537
|
+
TreeNode,
|
|
17538
|
+
{
|
|
17539
|
+
expanded: expanded2,
|
|
17540
|
+
onClick: handleClick,
|
|
17541
|
+
shouldShowArrow: nodeHasChildNodes,
|
|
17542
|
+
shouldShowPlaceholder: depth > 0,
|
|
17543
|
+
nodeRenderer,
|
|
17544
|
+
...props
|
|
17545
|
+
},
|
|
17546
|
+
// only render if the node is expanded
|
|
17547
|
+
expanded2 ? [...dataIterator(data)].map(({ name: name2, data: data2, ...renderNodeProps }) => {
|
|
17548
|
+
return /* @__PURE__ */ ReactExports.createElement(
|
|
17549
|
+
ConnectedTreeNode,
|
|
17444
17550
|
{
|
|
17445
|
-
|
|
17446
|
-
|
|
17447
|
-
|
|
17448
|
-
|
|
17449
|
-
|
|
17450
|
-
|
|
17451
|
-
|
|
17551
|
+
name: name2,
|
|
17552
|
+
data: data2,
|
|
17553
|
+
depth: depth + 1,
|
|
17554
|
+
path: `${path2}.${name2}`,
|
|
17555
|
+
key: name2,
|
|
17556
|
+
dataIterator,
|
|
17557
|
+
nodeRenderer,
|
|
17558
|
+
...renderNodeProps
|
|
17559
|
+
}
|
|
17560
|
+
);
|
|
17561
|
+
}) : null
|
|
17562
|
+
);
|
|
17563
|
+
});
|
|
17564
|
+
var TreeView = reactExports.memo(({ name: name2, data, dataIterator, nodeRenderer, expandPaths, expandLevel }) => {
|
|
17565
|
+
const styles2 = useStyles("TreeView");
|
|
17566
|
+
const stateAndSetter = reactExports.useState({});
|
|
17567
|
+
const [, setExpandedPaths] = stateAndSetter;
|
|
17568
|
+
reactExports.useLayoutEffect(
|
|
17569
|
+
() => setExpandedPaths(
|
|
17570
|
+
(prevExpandedPaths) => getExpandedPaths(data, dataIterator, expandPaths, expandLevel, prevExpandedPaths)
|
|
17571
|
+
),
|
|
17572
|
+
[data, dataIterator, expandPaths, expandLevel]
|
|
17573
|
+
);
|
|
17574
|
+
return /* @__PURE__ */ ReactExports.createElement(ExpandedPathsContext.Provider, { value: stateAndSetter }, /* @__PURE__ */ ReactExports.createElement("ol", { role: "tree", style: styles2.treeViewOutline }, /* @__PURE__ */ ReactExports.createElement(
|
|
17575
|
+
ConnectedTreeNode,
|
|
17576
|
+
{
|
|
17577
|
+
name: name2,
|
|
17578
|
+
data,
|
|
17579
|
+
dataIterator,
|
|
17580
|
+
depth: 0,
|
|
17581
|
+
path: DEFAULT_ROOT_PATH,
|
|
17582
|
+
nodeRenderer
|
|
17452
17583
|
}
|
|
17453
|
-
|
|
17454
|
-
|
|
17455
|
-
|
|
17456
|
-
|
|
17457
|
-
|
|
17458
|
-
|
|
17459
|
-
|
|
17460
|
-
|
|
17461
|
-
|
|
17462
|
-
|
|
17463
|
-
|
|
17464
|
-
|
|
17465
|
-
|
|
17466
|
-
|
|
17467
|
-
|
|
17468
|
-
|
|
17469
|
-
|
|
17470
|
-
|
|
17471
|
-
|
|
17472
|
-
|
|
17473
|
-
|
|
17474
|
-
|
|
17475
|
-
|
|
17476
|
-
|
|
17477
|
-
|
|
17478
|
-
|
|
17479
|
-
|
|
17480
|
-
|
|
17584
|
+
)));
|
|
17585
|
+
});
|
|
17586
|
+
var ObjectName = ({ name: name2, dimmed = false, styles: styles2 = {} }) => {
|
|
17587
|
+
const themeStyles = useStyles("ObjectName");
|
|
17588
|
+
const appliedStyles = {
|
|
17589
|
+
...themeStyles.base,
|
|
17590
|
+
...dimmed ? themeStyles["dimmed"] : {},
|
|
17591
|
+
...styles2
|
|
17592
|
+
};
|
|
17593
|
+
return /* @__PURE__ */ ReactExports.createElement("span", { style: appliedStyles }, name2);
|
|
17594
|
+
};
|
|
17595
|
+
var ObjectValue = ({ object: object2, styles: styles2 }) => {
|
|
17596
|
+
const themeStyles = useStyles("ObjectValue");
|
|
17597
|
+
const mkStyle = (key) => ({ ...themeStyles[key], ...styles2 });
|
|
17598
|
+
switch (typeof object2) {
|
|
17599
|
+
case "bigint":
|
|
17600
|
+
return /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueNumber") }, String(object2), "n");
|
|
17601
|
+
case "number":
|
|
17602
|
+
return /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueNumber") }, String(object2));
|
|
17603
|
+
case "string":
|
|
17604
|
+
return /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueString") }, '"', object2, '"');
|
|
17605
|
+
case "boolean":
|
|
17606
|
+
return /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueBoolean") }, String(object2));
|
|
17607
|
+
case "undefined":
|
|
17608
|
+
return /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueUndefined") }, "undefined");
|
|
17609
|
+
case "object":
|
|
17610
|
+
if (object2 === null) {
|
|
17611
|
+
return /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueNull") }, "null");
|
|
17481
17612
|
}
|
|
17482
|
-
|
|
17483
|
-
|
|
17484
|
-
mounted,
|
|
17485
|
-
toast2.title,
|
|
17486
|
-
toast2.description,
|
|
17487
|
-
setHeights,
|
|
17488
|
-
toast2.id,
|
|
17489
|
-
toast2.jsx,
|
|
17490
|
-
toast2.action,
|
|
17491
|
-
toast2.cancel
|
|
17492
|
-
]);
|
|
17493
|
-
const deleteToast = ReactExports.useCallback(() => {
|
|
17494
|
-
setRemoved(true);
|
|
17495
|
-
setOffsetBeforeRemove(offset2.current);
|
|
17496
|
-
setHeights((h2) => h2.filter((height) => height.toastId !== toast2.id));
|
|
17497
|
-
setTimeout(() => {
|
|
17498
|
-
removeToast(toast2);
|
|
17499
|
-
}, TIME_BEFORE_UNMOUNT);
|
|
17500
|
-
}, [
|
|
17501
|
-
toast2,
|
|
17502
|
-
removeToast,
|
|
17503
|
-
setHeights,
|
|
17504
|
-
offset2
|
|
17505
|
-
]);
|
|
17506
|
-
ReactExports.useEffect(() => {
|
|
17507
|
-
if (toast2.promise && toastType === "loading" || toast2.duration === Infinity || toast2.type === "loading") return;
|
|
17508
|
-
let timeoutId;
|
|
17509
|
-
const pauseTimer = () => {
|
|
17510
|
-
if (lastCloseTimerStartTimeRef.current < closeTimerStartTimeRef.current) {
|
|
17511
|
-
const elapsedTime = (/* @__PURE__ */ new Date()).getTime() - closeTimerStartTimeRef.current;
|
|
17512
|
-
remainingTime.current = remainingTime.current - elapsedTime;
|
|
17613
|
+
if (object2 instanceof Date) {
|
|
17614
|
+
return /* @__PURE__ */ ReactExports.createElement("span", null, object2.toString());
|
|
17513
17615
|
}
|
|
17514
|
-
|
|
17515
|
-
|
|
17516
|
-
|
|
17517
|
-
if (
|
|
17518
|
-
|
|
17519
|
-
|
|
17520
|
-
|
|
17521
|
-
|
|
17522
|
-
}
|
|
17523
|
-
|
|
17524
|
-
|
|
17525
|
-
|
|
17526
|
-
|
|
17527
|
-
|
|
17616
|
+
if (object2 instanceof RegExp) {
|
|
17617
|
+
return /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueRegExp") }, object2.toString());
|
|
17618
|
+
}
|
|
17619
|
+
if (Array.isArray(object2)) {
|
|
17620
|
+
return /* @__PURE__ */ ReactExports.createElement("span", null, `Array(${object2.length})`);
|
|
17621
|
+
}
|
|
17622
|
+
if (!object2.constructor) {
|
|
17623
|
+
return /* @__PURE__ */ ReactExports.createElement("span", null, "Object");
|
|
17624
|
+
}
|
|
17625
|
+
if (typeof object2.constructor.isBuffer === "function" && object2.constructor.isBuffer(object2)) {
|
|
17626
|
+
return /* @__PURE__ */ ReactExports.createElement("span", null, `Buffer[${object2.length}]`);
|
|
17627
|
+
}
|
|
17628
|
+
return /* @__PURE__ */ ReactExports.createElement("span", null, object2.constructor.name);
|
|
17629
|
+
case "function":
|
|
17630
|
+
return /* @__PURE__ */ ReactExports.createElement("span", null, /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueFunctionPrefix") }, "ƒ "), /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueFunctionName") }, object2.name, "()"));
|
|
17631
|
+
case "symbol":
|
|
17632
|
+
return /* @__PURE__ */ ReactExports.createElement("span", { style: mkStyle("objectValueSymbol") }, object2.toString());
|
|
17633
|
+
default:
|
|
17634
|
+
return /* @__PURE__ */ ReactExports.createElement("span", null);
|
|
17635
|
+
}
|
|
17636
|
+
};
|
|
17637
|
+
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
17638
|
+
var propertyIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
17639
|
+
function getPropertyValue(object2, propertyName) {
|
|
17640
|
+
const propertyDescriptor = Object.getOwnPropertyDescriptor(object2, propertyName);
|
|
17641
|
+
if (propertyDescriptor.get) {
|
|
17642
|
+
try {
|
|
17643
|
+
return propertyDescriptor.get();
|
|
17644
|
+
} catch {
|
|
17645
|
+
return propertyDescriptor.get;
|
|
17528
17646
|
}
|
|
17529
|
-
|
|
17530
|
-
|
|
17531
|
-
|
|
17532
|
-
|
|
17533
|
-
|
|
17534
|
-
|
|
17535
|
-
|
|
17536
|
-
|
|
17537
|
-
|
|
17538
|
-
|
|
17539
|
-
|
|
17540
|
-
|
|
17541
|
-
|
|
17647
|
+
}
|
|
17648
|
+
return object2[propertyName];
|
|
17649
|
+
}
|
|
17650
|
+
function intersperse(arr, sep) {
|
|
17651
|
+
if (arr.length === 0) {
|
|
17652
|
+
return [];
|
|
17653
|
+
}
|
|
17654
|
+
return arr.slice(1).reduce((xs, x2) => xs.concat([sep, x2]), [arr[0]]);
|
|
17655
|
+
}
|
|
17656
|
+
var ObjectPreview = ({ data }) => {
|
|
17657
|
+
const styles2 = useStyles("ObjectPreview");
|
|
17658
|
+
const object2 = data;
|
|
17659
|
+
if (typeof object2 !== "object" || object2 === null || object2 instanceof Date || object2 instanceof RegExp) {
|
|
17660
|
+
return /* @__PURE__ */ ReactExports.createElement(ObjectValue, { object: object2 });
|
|
17661
|
+
}
|
|
17662
|
+
if (Array.isArray(object2)) {
|
|
17663
|
+
const maxProperties = styles2.arrayMaxProperties;
|
|
17664
|
+
const previewArray = object2.slice(0, maxProperties).map((element2, index2) => /* @__PURE__ */ ReactExports.createElement(ObjectValue, { key: index2, object: element2 }));
|
|
17665
|
+
if (object2.length > maxProperties) {
|
|
17666
|
+
previewArray.push(/* @__PURE__ */ ReactExports.createElement("span", { key: "ellipsis" }, "…"));
|
|
17542
17667
|
}
|
|
17543
|
-
|
|
17544
|
-
|
|
17545
|
-
|
|
17546
|
-
|
|
17547
|
-
|
|
17548
|
-
|
|
17549
|
-
|
|
17550
|
-
|
|
17551
|
-
|
|
17552
|
-
|
|
17553
|
-
|
|
17554
|
-
|
|
17668
|
+
const arrayLength = object2.length;
|
|
17669
|
+
return /* @__PURE__ */ ReactExports.createElement(ReactExports.Fragment, null, /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.objectDescription }, arrayLength === 0 ? `` : `(${arrayLength}) `), /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.preview }, "[", intersperse(previewArray, ", "), "]"));
|
|
17670
|
+
} else {
|
|
17671
|
+
const maxProperties = styles2.objectMaxProperties;
|
|
17672
|
+
const propertyNodes = [];
|
|
17673
|
+
for (const propertyName in object2) {
|
|
17674
|
+
if (hasOwnProperty$1.call(object2, propertyName)) {
|
|
17675
|
+
let ellipsis;
|
|
17676
|
+
if (propertyNodes.length === maxProperties - 1 && Object.keys(object2).length > maxProperties) {
|
|
17677
|
+
ellipsis = /* @__PURE__ */ ReactExports.createElement("span", { key: "ellipsis" }, "…");
|
|
17678
|
+
}
|
|
17679
|
+
const propertyValue2 = getPropertyValue(object2, propertyName);
|
|
17680
|
+
propertyNodes.push(
|
|
17681
|
+
/* @__PURE__ */ ReactExports.createElement("span", { key: propertyName }, /* @__PURE__ */ ReactExports.createElement(ObjectName, { name: propertyName || `""` }), ": ", /* @__PURE__ */ ReactExports.createElement(ObjectValue, { object: propertyValue2 }), ellipsis)
|
|
17682
|
+
);
|
|
17683
|
+
if (ellipsis) break;
|
|
17684
|
+
}
|
|
17555
17685
|
}
|
|
17556
|
-
|
|
17557
|
-
|
|
17558
|
-
visible: toastType === "loading"
|
|
17559
|
-
});
|
|
17686
|
+
const objectConstructorName = object2.constructor ? object2.constructor.name : "Object";
|
|
17687
|
+
return /* @__PURE__ */ ReactExports.createElement(ReactExports.Fragment, null, /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.objectDescription }, objectConstructorName === "Object" ? "" : `${objectConstructorName} `), /* @__PURE__ */ ReactExports.createElement("span", { style: styles2.preview }, "{", intersperse(propertyNodes, ", "), "}"));
|
|
17560
17688
|
}
|
|
17561
|
-
|
|
17562
|
-
|
|
17563
|
-
|
|
17564
|
-
|
|
17565
|
-
|
|
17566
|
-
|
|
17567
|
-
|
|
17568
|
-
|
|
17569
|
-
|
|
17570
|
-
|
|
17571
|
-
|
|
17572
|
-
|
|
17573
|
-
|
|
17574
|
-
|
|
17575
|
-
"data
|
|
17576
|
-
|
|
17577
|
-
|
|
17578
|
-
|
|
17579
|
-
|
|
17580
|
-
|
|
17581
|
-
|
|
17582
|
-
|
|
17583
|
-
|
|
17584
|
-
|
|
17585
|
-
|
|
17586
|
-
|
|
17587
|
-
style: {
|
|
17588
|
-
"--index": index2,
|
|
17589
|
-
"--toasts-before": index2,
|
|
17590
|
-
"--z-index": toasts.length - index2,
|
|
17591
|
-
"--offset": `${removed ? offsetBeforeRemove : offset2.current}px`,
|
|
17592
|
-
"--initial-height": expandByDefault ? "auto" : `${initialHeight}px`,
|
|
17593
|
-
...style2,
|
|
17594
|
-
...toast2.style
|
|
17595
|
-
},
|
|
17596
|
-
onDragEnd: () => {
|
|
17597
|
-
setSwiping(false);
|
|
17598
|
-
setSwipeDirection(null);
|
|
17599
|
-
pointerStartRef.current = null;
|
|
17600
|
-
},
|
|
17601
|
-
onPointerDown: (event) => {
|
|
17602
|
-
if (event.button === 2) return;
|
|
17603
|
-
if (disabled || !dismissible) return;
|
|
17604
|
-
dragStartTime.current = /* @__PURE__ */ new Date();
|
|
17605
|
-
setOffsetBeforeRemove(offset2.current);
|
|
17606
|
-
event.target.setPointerCapture(event.pointerId);
|
|
17607
|
-
if (event.target.tagName === "BUTTON") return;
|
|
17608
|
-
setSwiping(true);
|
|
17609
|
-
pointerStartRef.current = {
|
|
17610
|
-
x: event.clientX,
|
|
17611
|
-
y: event.clientY
|
|
17612
|
-
};
|
|
17613
|
-
},
|
|
17614
|
-
onPointerUp: () => {
|
|
17615
|
-
var _toastRef_current, _toastRef_current1, _dragStartTime_current;
|
|
17616
|
-
if (swipeOut || !dismissible) return;
|
|
17617
|
-
pointerStartRef.current = null;
|
|
17618
|
-
const swipeAmountX = Number(((_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0);
|
|
17619
|
-
const swipeAmountY = Number(((_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0);
|
|
17620
|
-
const timeTaken = (/* @__PURE__ */ new Date()).getTime() - ((_dragStartTime_current = dragStartTime.current) == null ? void 0 : _dragStartTime_current.getTime());
|
|
17621
|
-
const swipeAmount = swipeDirection === "x" ? swipeAmountX : swipeAmountY;
|
|
17622
|
-
const velocity = Math.abs(swipeAmount) / timeTaken;
|
|
17623
|
-
if (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > 0.11) {
|
|
17624
|
-
setOffsetBeforeRemove(offset2.current);
|
|
17625
|
-
toast2.onDismiss == null ? void 0 : toast2.onDismiss.call(toast2, toast2);
|
|
17626
|
-
if (swipeDirection === "x") {
|
|
17627
|
-
setSwipeOutDirection(swipeAmountX > 0 ? "right" : "left");
|
|
17689
|
+
};
|
|
17690
|
+
var ObjectRootLabel = ({ name: name2, data }) => {
|
|
17691
|
+
if (typeof name2 === "string") {
|
|
17692
|
+
return /* @__PURE__ */ ReactExports.createElement("span", null, /* @__PURE__ */ ReactExports.createElement(ObjectName, { name: name2 }), /* @__PURE__ */ ReactExports.createElement("span", null, ": "), /* @__PURE__ */ ReactExports.createElement(ObjectPreview, { data }));
|
|
17693
|
+
} else {
|
|
17694
|
+
return /* @__PURE__ */ ReactExports.createElement(ObjectPreview, { data });
|
|
17695
|
+
}
|
|
17696
|
+
};
|
|
17697
|
+
var ObjectLabel = ({ name: name2, data, isNonenumerable = false }) => {
|
|
17698
|
+
const object2 = data;
|
|
17699
|
+
return /* @__PURE__ */ ReactExports.createElement("span", null, typeof name2 === "string" ? /* @__PURE__ */ ReactExports.createElement(ObjectName, { name: name2, dimmed: isNonenumerable }) : /* @__PURE__ */ ReactExports.createElement(ObjectPreview, { data: name2 }), /* @__PURE__ */ ReactExports.createElement("span", null, ": "), /* @__PURE__ */ ReactExports.createElement(ObjectValue, { object: object2 }));
|
|
17700
|
+
};
|
|
17701
|
+
var createIterator = (showNonenumerable, sortObjectKeys) => {
|
|
17702
|
+
const objectIterator = function* (data) {
|
|
17703
|
+
const shouldIterate = typeof data === "object" && data !== null || typeof data === "function";
|
|
17704
|
+
if (!shouldIterate) return;
|
|
17705
|
+
const dataIsArray = Array.isArray(data);
|
|
17706
|
+
if (!dataIsArray && data[Symbol.iterator]) {
|
|
17707
|
+
let i = 0;
|
|
17708
|
+
for (const entry of data) {
|
|
17709
|
+
if (Array.isArray(entry) && entry.length === 2) {
|
|
17710
|
+
const [k2, v2] = entry;
|
|
17711
|
+
yield {
|
|
17712
|
+
name: k2,
|
|
17713
|
+
data: v2
|
|
17714
|
+
};
|
|
17628
17715
|
} else {
|
|
17629
|
-
|
|
17716
|
+
yield {
|
|
17717
|
+
name: i.toString(),
|
|
17718
|
+
data: entry
|
|
17719
|
+
};
|
|
17630
17720
|
}
|
|
17631
|
-
|
|
17632
|
-
setSwipeOut(true);
|
|
17633
|
-
return;
|
|
17634
|
-
} else {
|
|
17635
|
-
var _toastRef_current2, _toastRef_current3;
|
|
17636
|
-
(_toastRef_current2 = toastRef.current) == null ? void 0 : _toastRef_current2.style.setProperty("--swipe-amount-x", `0px`);
|
|
17637
|
-
(_toastRef_current3 = toastRef.current) == null ? void 0 : _toastRef_current3.style.setProperty("--swipe-amount-y", `0px`);
|
|
17721
|
+
i++;
|
|
17638
17722
|
}
|
|
17639
|
-
|
|
17640
|
-
|
|
17641
|
-
|
|
17642
|
-
|
|
17643
|
-
|
|
17644
|
-
|
|
17645
|
-
if (!pointerStartRef.current || !dismissible) return;
|
|
17646
|
-
const isHighlighted = ((_window_getSelection = window.getSelection()) == null ? void 0 : _window_getSelection.toString().length) > 0;
|
|
17647
|
-
if (isHighlighted) return;
|
|
17648
|
-
const yDelta = event.clientY - pointerStartRef.current.y;
|
|
17649
|
-
const xDelta = event.clientX - pointerStartRef.current.x;
|
|
17650
|
-
var _props_swipeDirections;
|
|
17651
|
-
const swipeDirections = (_props_swipeDirections = props.swipeDirections) != null ? _props_swipeDirections : getDefaultSwipeDirections(position2);
|
|
17652
|
-
if (!swipeDirection && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) {
|
|
17653
|
-
setSwipeDirection(Math.abs(xDelta) > Math.abs(yDelta) ? "x" : "y");
|
|
17723
|
+
} else {
|
|
17724
|
+
const keys2 = Object.getOwnPropertyNames(data);
|
|
17725
|
+
if (sortObjectKeys === true && !dataIsArray) {
|
|
17726
|
+
keys2.sort();
|
|
17727
|
+
} else if (typeof sortObjectKeys === "function") {
|
|
17728
|
+
keys2.sort(sortObjectKeys);
|
|
17654
17729
|
}
|
|
17655
|
-
|
|
17656
|
-
|
|
17657
|
-
|
|
17658
|
-
|
|
17659
|
-
|
|
17660
|
-
|
|
17661
|
-
|
|
17662
|
-
|
|
17663
|
-
|
|
17664
|
-
|
|
17665
|
-
|
|
17666
|
-
|
|
17667
|
-
} else {
|
|
17668
|
-
const dampenedDelta = yDelta * getDampening(yDelta);
|
|
17669
|
-
swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta;
|
|
17730
|
+
for (const propertyName of keys2) {
|
|
17731
|
+
if (propertyIsEnumerable.call(data, propertyName)) {
|
|
17732
|
+
const propertyValue2 = getPropertyValue(data, propertyName);
|
|
17733
|
+
yield {
|
|
17734
|
+
name: propertyName || `""`,
|
|
17735
|
+
data: propertyValue2
|
|
17736
|
+
};
|
|
17737
|
+
} else if (showNonenumerable) {
|
|
17738
|
+
let propertyValue2;
|
|
17739
|
+
try {
|
|
17740
|
+
propertyValue2 = getPropertyValue(data, propertyName);
|
|
17741
|
+
} catch (e) {
|
|
17670
17742
|
}
|
|
17671
|
-
|
|
17672
|
-
|
|
17673
|
-
|
|
17674
|
-
|
|
17675
|
-
|
|
17676
|
-
|
|
17677
|
-
const dampenedDelta = xDelta * getDampening(xDelta);
|
|
17678
|
-
swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta;
|
|
17743
|
+
if (propertyValue2 !== void 0) {
|
|
17744
|
+
yield {
|
|
17745
|
+
name: propertyName,
|
|
17746
|
+
data: propertyValue2,
|
|
17747
|
+
isNonenumerable: true
|
|
17748
|
+
};
|
|
17679
17749
|
}
|
|
17680
17750
|
}
|
|
17681
17751
|
}
|
|
17682
|
-
if (
|
|
17683
|
-
|
|
17752
|
+
if (showNonenumerable && data !== Object.prototype) {
|
|
17753
|
+
yield {
|
|
17754
|
+
name: "__proto__",
|
|
17755
|
+
data: Object.getPrototypeOf(data),
|
|
17756
|
+
isNonenumerable: true
|
|
17757
|
+
};
|
|
17684
17758
|
}
|
|
17685
|
-
(_toastRef_current = toastRef.current) == null ? void 0 : _toastRef_current.style.setProperty("--swipe-amount-x", `${swipeAmount.x}px`);
|
|
17686
|
-
(_toastRef_current1 = toastRef.current) == null ? void 0 : _toastRef_current1.style.setProperty("--swipe-amount-y", `${swipeAmount.y}px`);
|
|
17687
17759
|
}
|
|
17688
|
-
}
|
|
17689
|
-
|
|
17690
|
-
|
|
17691
|
-
|
|
17692
|
-
|
|
17693
|
-
|
|
17694
|
-
|
|
17695
|
-
|
|
17696
|
-
|
|
17697
|
-
|
|
17698
|
-
|
|
17699
|
-
|
|
17700
|
-
|
|
17701
|
-
|
|
17702
|
-
|
|
17703
|
-
|
|
17704
|
-
}
|
|
17705
|
-
|
|
17706
|
-
|
|
17707
|
-
|
|
17708
|
-
|
|
17709
|
-
|
|
17710
|
-
|
|
17711
|
-
|
|
17712
|
-
|
|
17713
|
-
|
|
17714
|
-
|
|
17715
|
-
|
|
17716
|
-
|
|
17717
|
-
|
|
17718
|
-
|
|
17719
|
-
|
|
17720
|
-
|
|
17721
|
-
|
|
17722
|
-
|
|
17723
|
-
|
|
17724
|
-
|
|
17725
|
-
|
|
17726
|
-
|
|
17727
|
-
|
|
17728
|
-
|
|
17729
|
-
|
|
17730
|
-
|
|
17731
|
-
|
|
17732
|
-
|
|
17760
|
+
};
|
|
17761
|
+
return objectIterator;
|
|
17762
|
+
};
|
|
17763
|
+
var defaultNodeRenderer = ({ depth, name: name2, data, isNonenumerable }) => depth === 0 ? /* @__PURE__ */ ReactExports.createElement(ObjectRootLabel, { name: name2, data }) : /* @__PURE__ */ ReactExports.createElement(ObjectLabel, { name: name2, data, isNonenumerable });
|
|
17764
|
+
var ObjectInspector = ({ showNonenumerable = false, sortObjectKeys, nodeRenderer, ...treeViewProps }) => {
|
|
17765
|
+
const dataIterator = createIterator(showNonenumerable, sortObjectKeys);
|
|
17766
|
+
const renderer = nodeRenderer ? nodeRenderer : defaultNodeRenderer;
|
|
17767
|
+
return /* @__PURE__ */ ReactExports.createElement(TreeView, { nodeRenderer: renderer, dataIterator, ...treeViewProps });
|
|
17768
|
+
};
|
|
17769
|
+
var themedObjectInspector = themeAcceptor(ObjectInspector);
|
|
17770
|
+
__toESM(require_is_dom());
|
|
17771
|
+
const useDarkMode = () => {
|
|
17772
|
+
const [isDark, setIsDark] = reactExports.useState(() => {
|
|
17773
|
+
if (typeof document === "undefined")
|
|
17774
|
+
return false;
|
|
17775
|
+
return document.documentElement.classList.contains("dark");
|
|
17776
|
+
});
|
|
17777
|
+
reactExports.useEffect(() => {
|
|
17778
|
+
if (typeof document === "undefined")
|
|
17779
|
+
return;
|
|
17780
|
+
const observer = new MutationObserver(() => {
|
|
17781
|
+
setIsDark(document.documentElement.classList.contains("dark"));
|
|
17782
|
+
});
|
|
17783
|
+
observer.observe(document.documentElement, {
|
|
17784
|
+
attributes: true,
|
|
17785
|
+
attributeFilter: ["class"]
|
|
17786
|
+
});
|
|
17787
|
+
return () => observer.disconnect();
|
|
17788
|
+
}, []);
|
|
17789
|
+
return isDark;
|
|
17790
|
+
};
|
|
17791
|
+
const inspectorThemeExtendedLight = {
|
|
17792
|
+
OBJECT_VALUE_DATE_COLOR: "#a21caf"
|
|
17793
|
+
// fuchsia-700
|
|
17794
|
+
};
|
|
17795
|
+
const inspectorThemeExtendedDark = {
|
|
17796
|
+
OBJECT_VALUE_DATE_COLOR: "#e879f9"
|
|
17797
|
+
// fuchsia-400
|
|
17798
|
+
};
|
|
17799
|
+
const shared = {
|
|
17800
|
+
BASE_FONT_SIZE: "11px",
|
|
17801
|
+
BASE_LINE_HEIGHT: 1.4,
|
|
17802
|
+
BASE_BACKGROUND_COLOR: "transparent",
|
|
17803
|
+
OBJECT_PREVIEW_ARRAY_MAX_PROPERTIES: 10,
|
|
17804
|
+
OBJECT_PREVIEW_OBJECT_MAX_PROPERTIES: 5,
|
|
17805
|
+
HTML_TAGNAME_TEXT_TRANSFORM: "lowercase",
|
|
17806
|
+
ARROW_MARGIN_RIGHT: 3,
|
|
17807
|
+
ARROW_FONT_SIZE: 12,
|
|
17808
|
+
TREENODE_FONT_FAMILY: "var(--font-mono)",
|
|
17809
|
+
TREENODE_FONT_SIZE: "11px",
|
|
17810
|
+
TREENODE_LINE_HEIGHT: 1.4,
|
|
17811
|
+
TREENODE_PADDING_LEFT: 12,
|
|
17812
|
+
TABLE_DATA_BACKGROUND_IMAGE: "none",
|
|
17813
|
+
TABLE_DATA_BACKGROUND_SIZE: "0"
|
|
17814
|
+
};
|
|
17815
|
+
const inspectorThemeLight = {
|
|
17816
|
+
...shared,
|
|
17817
|
+
// Base text
|
|
17818
|
+
BASE_COLOR: "var(--ds-gray-1000)",
|
|
17819
|
+
// Property names — unstyled, same as base foreground (Node: no style)
|
|
17820
|
+
OBJECT_NAME_COLOR: "var(--ds-gray-900)",
|
|
17821
|
+
// Strings & symbols — green (Node: 'green')
|
|
17822
|
+
OBJECT_VALUE_STRING_COLOR: "#16a34a",
|
|
17823
|
+
// green-600
|
|
17824
|
+
OBJECT_VALUE_SYMBOL_COLOR: "#16a34a",
|
|
17825
|
+
// Numbers & booleans — yellow/amber (Node: 'yellow')
|
|
17826
|
+
OBJECT_VALUE_NUMBER_COLOR: "#b45309",
|
|
17827
|
+
// amber-700 (readable on white)
|
|
17828
|
+
OBJECT_VALUE_BOOLEAN_COLOR: "#b45309",
|
|
17829
|
+
// null — bold foreground (Node: 'bold')
|
|
17830
|
+
OBJECT_VALUE_NULL_COLOR: "var(--ds-gray-900)",
|
|
17831
|
+
// undefined — grey (Node: 'grey')
|
|
17832
|
+
OBJECT_VALUE_UNDEFINED_COLOR: "var(--ds-gray-500)",
|
|
17833
|
+
// RegExp — red (Node regexp base uses green/red/yellow palette)
|
|
17834
|
+
OBJECT_VALUE_REGEXP_COLOR: "#dc2626",
|
|
17835
|
+
// red-600
|
|
17836
|
+
// Functions — cyan (Node: 'special' → 'cyan')
|
|
17837
|
+
OBJECT_VALUE_FUNCTION_PREFIX_COLOR: "#0891b2",
|
|
17838
|
+
// cyan-600
|
|
17839
|
+
// HTML (less relevant for data inspection, but reasonable defaults)
|
|
17840
|
+
HTML_TAG_COLOR: "var(--ds-gray-500)",
|
|
17841
|
+
HTML_TAGNAME_COLOR: "#0891b2",
|
|
17842
|
+
HTML_ATTRIBUTE_NAME_COLOR: "#b45309",
|
|
17843
|
+
HTML_ATTRIBUTE_VALUE_COLOR: "#16a34a",
|
|
17844
|
+
HTML_COMMENT_COLOR: "var(--ds-gray-400)",
|
|
17845
|
+
HTML_DOCTYPE_COLOR: "var(--ds-gray-400)",
|
|
17846
|
+
// Structural
|
|
17847
|
+
ARROW_COLOR: "var(--ds-gray-500)",
|
|
17848
|
+
TABLE_BORDER_COLOR: "var(--ds-gray-300)",
|
|
17849
|
+
TABLE_TH_BACKGROUND_COLOR: "var(--ds-gray-100)",
|
|
17850
|
+
TABLE_TH_HOVER_COLOR: "var(--ds-gray-200)",
|
|
17851
|
+
TABLE_SORT_ICON_COLOR: "var(--ds-gray-500)"
|
|
17733
17852
|
};
|
|
17734
|
-
|
|
17735
|
-
|
|
17736
|
-
|
|
17737
|
-
|
|
17738
|
-
|
|
17739
|
-
|
|
17853
|
+
const inspectorThemeDark = {
|
|
17854
|
+
...shared,
|
|
17855
|
+
// Base text
|
|
17856
|
+
BASE_COLOR: "var(--ds-gray-1000)",
|
|
17857
|
+
// Property names — white/light foreground (Node: unstyled = white in dark terminal)
|
|
17858
|
+
OBJECT_NAME_COLOR: "var(--ds-gray-900)",
|
|
17859
|
+
// Strings & symbols — green (Node: 'green')
|
|
17860
|
+
OBJECT_VALUE_STRING_COLOR: "#4ade80",
|
|
17861
|
+
// green-400
|
|
17862
|
+
OBJECT_VALUE_SYMBOL_COLOR: "#4ade80",
|
|
17863
|
+
// Numbers & booleans — yellow (Node: 'yellow')
|
|
17864
|
+
OBJECT_VALUE_NUMBER_COLOR: "#facc15",
|
|
17865
|
+
// yellow-400
|
|
17866
|
+
OBJECT_VALUE_BOOLEAN_COLOR: "#facc15",
|
|
17867
|
+
// null — bold foreground / white (Node: 'bold')
|
|
17868
|
+
OBJECT_VALUE_NULL_COLOR: "var(--ds-gray-1000)",
|
|
17869
|
+
// undefined — grey (Node: 'grey')
|
|
17870
|
+
OBJECT_VALUE_UNDEFINED_COLOR: "var(--ds-gray-500)",
|
|
17871
|
+
// RegExp — red (Node regexp palette)
|
|
17872
|
+
OBJECT_VALUE_REGEXP_COLOR: "#f87171",
|
|
17873
|
+
// red-400
|
|
17874
|
+
// Functions — cyan (Node: 'special' → 'cyan')
|
|
17875
|
+
OBJECT_VALUE_FUNCTION_PREFIX_COLOR: "#22d3ee",
|
|
17876
|
+
// cyan-400
|
|
17877
|
+
// HTML
|
|
17878
|
+
HTML_TAG_COLOR: "var(--ds-gray-500)",
|
|
17879
|
+
HTML_TAGNAME_COLOR: "#22d3ee",
|
|
17880
|
+
HTML_ATTRIBUTE_NAME_COLOR: "#facc15",
|
|
17881
|
+
HTML_ATTRIBUTE_VALUE_COLOR: "#4ade80",
|
|
17882
|
+
HTML_COMMENT_COLOR: "var(--ds-gray-500)",
|
|
17883
|
+
HTML_DOCTYPE_COLOR: "var(--ds-gray-500)",
|
|
17884
|
+
// Structural
|
|
17885
|
+
ARROW_COLOR: "var(--ds-gray-500)",
|
|
17886
|
+
TABLE_BORDER_COLOR: "var(--ds-gray-300)",
|
|
17887
|
+
TABLE_TH_BACKGROUND_COLOR: "var(--ds-gray-100)",
|
|
17888
|
+
TABLE_TH_HOVER_COLOR: "var(--ds-gray-200)",
|
|
17889
|
+
TABLE_SORT_ICON_COLOR: "var(--ds-gray-500)"
|
|
17890
|
+
};
|
|
17891
|
+
const STREAM_REF_TYPE = "__workflow_stream_ref__";
|
|
17892
|
+
const CLASS_INSTANCE_REF_TYPE = "__workflow_class_instance_ref__";
|
|
17893
|
+
function isStreamRef(value) {
|
|
17894
|
+
return value !== null && typeof value === "object" && "__type" in value && value.__type === STREAM_REF_TYPE;
|
|
17895
|
+
}
|
|
17896
|
+
function isClassInstanceRef(value) {
|
|
17897
|
+
return value !== null && typeof value === "object" && "__type" in value && value.__type === CLASS_INSTANCE_REF_TYPE;
|
|
17898
|
+
}
|
|
17899
|
+
const StreamClickContext = reactExports.createContext(void 0);
|
|
17900
|
+
const DecryptClickContext = reactExports.createContext(void 0);
|
|
17901
|
+
function EncryptedInlineLabel() {
|
|
17902
|
+
const ctx = reactExports.useContext(DecryptClickContext);
|
|
17903
|
+
if (ctx) {
|
|
17904
|
+
return jsxRuntimeExports.jsxs("button", { type: "button", className: "inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[11px] cursor-pointer", style: {
|
|
17905
|
+
backgroundColor: "var(--ds-gray-100)",
|
|
17906
|
+
color: "var(--ds-gray-700)",
|
|
17907
|
+
border: "1px solid var(--ds-gray-400)",
|
|
17908
|
+
fontStyle: "italic",
|
|
17909
|
+
opacity: ctx.isDecrypting ? 0.6 : 1
|
|
17910
|
+
}, disabled: ctx.isDecrypting, onClick: (e) => {
|
|
17911
|
+
e.stopPropagation();
|
|
17912
|
+
ctx.onDecrypt();
|
|
17913
|
+
}, title: "Click to decrypt", children: [ctx.isDecrypting ? jsxRuntimeExports.jsx(Spinner, { size: 12 }) : jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3", style: { display: "inline", flexShrink: 0 } }), jsxRuntimeExports.jsx("span", { children: ctx.isDecrypting ? "Decrypting…" : "Decrypt" })] });
|
|
17740
17914
|
}
|
|
17741
|
-
return
|
|
17915
|
+
return jsxRuntimeExports.jsxs("span", { style: { color: "var(--ds-gray-600)", fontStyle: "italic" }, children: [jsxRuntimeExports.jsx(Lock, { className: "h-3 w-3", style: {
|
|
17916
|
+
display: "inline",
|
|
17917
|
+
verticalAlign: "middle",
|
|
17918
|
+
marginRight: "3px",
|
|
17919
|
+
marginTop: "-1px"
|
|
17920
|
+
} }), "Encrypted"] });
|
|
17742
17921
|
}
|
|
17743
|
-
function
|
|
17744
|
-
const
|
|
17745
|
-
[
|
|
17746
|
-
|
|
17747
|
-
|
|
17748
|
-
|
|
17749
|
-
|
|
17750
|
-
const prefix = isMobile ? "--mobile-offset" : "--offset";
|
|
17751
|
-
const defaultValue = isMobile ? MOBILE_VIEWPORT_OFFSET : VIEWPORT_OFFSET;
|
|
17752
|
-
function assignAll(offset3) {
|
|
17753
|
-
[
|
|
17754
|
-
"top",
|
|
17755
|
-
"right",
|
|
17756
|
-
"bottom",
|
|
17757
|
-
"left"
|
|
17758
|
-
].forEach((key) => {
|
|
17759
|
-
styles2[`${prefix}-${key}`] = typeof offset3 === "number" ? `${offset3}px` : offset3;
|
|
17760
|
-
});
|
|
17761
|
-
}
|
|
17762
|
-
if (typeof offset2 === "number" || typeof offset2 === "string") {
|
|
17763
|
-
assignAll(offset2);
|
|
17764
|
-
} else if (typeof offset2 === "object") {
|
|
17765
|
-
[
|
|
17766
|
-
"top",
|
|
17767
|
-
"right",
|
|
17768
|
-
"bottom",
|
|
17769
|
-
"left"
|
|
17770
|
-
].forEach((key) => {
|
|
17771
|
-
if (offset2[key] === void 0) {
|
|
17772
|
-
styles2[`${prefix}-${key}`] = defaultValue;
|
|
17773
|
-
} else {
|
|
17774
|
-
styles2[`${prefix}-${key}`] = typeof offset2[key] === "number" ? `${offset2[key]}px` : offset2[key];
|
|
17775
|
-
}
|
|
17776
|
-
});
|
|
17777
|
-
} else {
|
|
17778
|
-
assignAll(defaultValue);
|
|
17779
|
-
}
|
|
17780
|
-
});
|
|
17781
|
-
return styles2;
|
|
17922
|
+
function StreamRefInline({ streamRef }) {
|
|
17923
|
+
const onStreamClick = reactExports.useContext(StreamClickContext);
|
|
17924
|
+
return jsxRuntimeExports.jsxs("button", { type: "button", className: "inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-mono cursor-pointer", style: {
|
|
17925
|
+
backgroundColor: "var(--ds-blue-100)",
|
|
17926
|
+
color: "var(--ds-blue-800)",
|
|
17927
|
+
border: "1px solid var(--ds-blue-300)"
|
|
17928
|
+
}, onClick: () => onStreamClick == null ? void 0 : onStreamClick(streamRef.streamId), title: `View stream: ${streamRef.streamId}`, children: [jsxRuntimeExports.jsx("span", { children: "📡" }), jsxRuntimeExports.jsx("span", { children: streamRef.streamId })] });
|
|
17782
17929
|
}
|
|
17783
|
-
const
|
|
17784
|
-
|
|
17785
|
-
|
|
17786
|
-
|
|
17787
|
-
|
|
17788
|
-
|
|
17789
|
-
|
|
17790
|
-
|
|
17791
|
-
return toasts.filter((toast2) => toast2.toasterId === id);
|
|
17930
|
+
const ExtendedThemeContext = reactExports.createContext(inspectorThemeExtendedLight);
|
|
17931
|
+
function NodeRenderer({ depth, name: name2, data, isNonenumerable }) {
|
|
17932
|
+
var _a3;
|
|
17933
|
+
const extendedTheme = reactExports.useContext(ExtendedThemeContext);
|
|
17934
|
+
if (data !== null && typeof data === "object" && ((_a3 = data.constructor) == null ? void 0 : _a3.name) === ENCRYPTED_DISPLAY_NAME) {
|
|
17935
|
+
const label = jsxRuntimeExports.jsx(EncryptedInlineLabel, {});
|
|
17936
|
+
if (depth === 0) {
|
|
17937
|
+
return label;
|
|
17792
17938
|
}
|
|
17793
|
-
return
|
|
17794
|
-
}
|
|
17795
|
-
|
|
17796
|
-
|
|
17797
|
-
|
|
17798
|
-
|
|
17799
|
-
|
|
17800
|
-
|
|
17801
|
-
].concat(filteredToasts.filter((toast2) => toast2.position).map((toast2) => toast2.position))));
|
|
17802
|
-
}, [
|
|
17803
|
-
filteredToasts,
|
|
17804
|
-
position2
|
|
17805
|
-
]);
|
|
17806
|
-
const [heights, setHeights] = ReactExports.useState([]);
|
|
17807
|
-
const [expanded2, setExpanded] = ReactExports.useState(false);
|
|
17808
|
-
const [interacting, setInteracting] = ReactExports.useState(false);
|
|
17809
|
-
const [actualTheme, setActualTheme] = ReactExports.useState(theme3 !== "system" ? theme3 : typeof window !== "undefined" ? window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : "light");
|
|
17810
|
-
const listRef = ReactExports.useRef(null);
|
|
17811
|
-
const hotkeyLabel = hotkey.join("+").replace(/Key/g, "").replace(/Digit/g, "");
|
|
17812
|
-
const lastFocusedElementRef = ReactExports.useRef(null);
|
|
17813
|
-
const isFocusWithinRef = ReactExports.useRef(false);
|
|
17814
|
-
const removeToast = ReactExports.useCallback((toastToRemove) => {
|
|
17815
|
-
setToasts((toasts2) => {
|
|
17816
|
-
var _toasts_find;
|
|
17817
|
-
if (!((_toasts_find = toasts2.find((toast2) => toast2.id === toastToRemove.id)) == null ? void 0 : _toasts_find.delete)) {
|
|
17818
|
-
ToastState.dismiss(toastToRemove.id);
|
|
17819
|
-
}
|
|
17820
|
-
return toasts2.filter(({ id: id2 }) => id2 !== toastToRemove.id);
|
|
17821
|
-
});
|
|
17822
|
-
}, []);
|
|
17823
|
-
ReactExports.useEffect(() => {
|
|
17824
|
-
return ToastState.subscribe((toast2) => {
|
|
17825
|
-
if (toast2.dismiss) {
|
|
17826
|
-
requestAnimationFrame(() => {
|
|
17827
|
-
setToasts((toasts2) => toasts2.map((t) => t.id === toast2.id ? {
|
|
17828
|
-
...t,
|
|
17829
|
-
delete: true
|
|
17830
|
-
} : t));
|
|
17831
|
-
});
|
|
17832
|
-
return;
|
|
17833
|
-
}
|
|
17834
|
-
setTimeout(() => {
|
|
17835
|
-
ReactDOM.flushSync(() => {
|
|
17836
|
-
setToasts((toasts2) => {
|
|
17837
|
-
const indexOfExistingToast = toasts2.findIndex((t) => t.id === toast2.id);
|
|
17838
|
-
if (indexOfExistingToast !== -1) {
|
|
17839
|
-
return [
|
|
17840
|
-
...toasts2.slice(0, indexOfExistingToast),
|
|
17841
|
-
{
|
|
17842
|
-
...toasts2[indexOfExistingToast],
|
|
17843
|
-
...toast2
|
|
17844
|
-
},
|
|
17845
|
-
...toasts2.slice(indexOfExistingToast + 1)
|
|
17846
|
-
];
|
|
17847
|
-
}
|
|
17848
|
-
return [
|
|
17849
|
-
toast2,
|
|
17850
|
-
...toasts2
|
|
17851
|
-
];
|
|
17852
|
-
});
|
|
17853
|
-
});
|
|
17854
|
-
});
|
|
17855
|
-
});
|
|
17856
|
-
}, [
|
|
17857
|
-
toasts
|
|
17858
|
-
]);
|
|
17859
|
-
ReactExports.useEffect(() => {
|
|
17860
|
-
if (theme3 !== "system") {
|
|
17861
|
-
setActualTheme(theme3);
|
|
17862
|
-
return;
|
|
17939
|
+
return jsxRuntimeExports.jsxs("span", { children: [name2 != null && jsxRuntimeExports.jsx(ObjectName, { name: name2 }), name2 != null && jsxRuntimeExports.jsx("span", { children: ": " }), label] });
|
|
17940
|
+
}
|
|
17941
|
+
if (isStreamRef(data)) {
|
|
17942
|
+
return jsxRuntimeExports.jsxs("span", { children: [name2 != null && jsxRuntimeExports.jsx(ObjectName, { name: name2 }), name2 != null && jsxRuntimeExports.jsx("span", { children: ": " }), jsxRuntimeExports.jsx(StreamRefInline, { streamRef: data })] });
|
|
17943
|
+
}
|
|
17944
|
+
if (isClassInstanceRef(data)) {
|
|
17945
|
+
if (depth === 0) {
|
|
17946
|
+
return jsxRuntimeExports.jsx(ObjectRootLabel, { name: data.className, data: data.data });
|
|
17863
17947
|
}
|
|
17864
|
-
|
|
17865
|
-
|
|
17866
|
-
|
|
17867
|
-
|
|
17868
|
-
|
|
17869
|
-
}
|
|
17948
|
+
return jsxRuntimeExports.jsxs("span", { children: [name2 != null && jsxRuntimeExports.jsx(ObjectName, { name: name2 }), name2 != null && jsxRuntimeExports.jsx("span", { children: ": " }), jsxRuntimeExports.jsxs("span", { style: { fontStyle: "italic" }, children: [data.className, " "] }), jsxRuntimeExports.jsx(ObjectValue, { object: data.data })] });
|
|
17949
|
+
}
|
|
17950
|
+
if (data instanceof Date) {
|
|
17951
|
+
const dateStr = data.toISOString();
|
|
17952
|
+
if (depth === 0) {
|
|
17953
|
+
return jsxRuntimeExports.jsx("span", { style: { color: extendedTheme.OBJECT_VALUE_DATE_COLOR }, children: dateStr });
|
|
17870
17954
|
}
|
|
17871
|
-
|
|
17872
|
-
|
|
17873
|
-
|
|
17874
|
-
|
|
17875
|
-
|
|
17876
|
-
|
|
17877
|
-
|
|
17878
|
-
|
|
17879
|
-
|
|
17880
|
-
|
|
17881
|
-
|
|
17882
|
-
|
|
17883
|
-
|
|
17884
|
-
|
|
17885
|
-
|
|
17886
|
-
|
|
17887
|
-
|
|
17888
|
-
|
|
17889
|
-
|
|
17890
|
-
|
|
17891
|
-
|
|
17892
|
-
|
|
17955
|
+
return jsxRuntimeExports.jsxs("span", { children: [name2 != null && jsxRuntimeExports.jsx(ObjectName, { name: name2 }), name2 != null && jsxRuntimeExports.jsx("span", { children: ": " }), jsxRuntimeExports.jsx("span", { style: { color: extendedTheme.OBJECT_VALUE_DATE_COLOR }, children: dateStr })] });
|
|
17956
|
+
}
|
|
17957
|
+
if (depth === 0) {
|
|
17958
|
+
return jsxRuntimeExports.jsx(ObjectRootLabel, { name: name2, data });
|
|
17959
|
+
}
|
|
17960
|
+
return jsxRuntimeExports.jsx(ObjectLabel, { name: name2, data, isNonenumerable });
|
|
17961
|
+
}
|
|
17962
|
+
function DataInspector({ data, expandLevel = 2, name: name2, onStreamClick, onDecrypt, isDecrypting = false }) {
|
|
17963
|
+
const stableData = useStableInspectorData(data);
|
|
17964
|
+
const [initialExpandLevel, setInitialExpandLevel] = reactExports.useState(expandLevel);
|
|
17965
|
+
const isDark = useDarkMode();
|
|
17966
|
+
const extendedTheme = isDark ? inspectorThemeExtendedDark : inspectorThemeExtendedLight;
|
|
17967
|
+
reactExports.useEffect(() => {
|
|
17968
|
+
setInitialExpandLevel(0);
|
|
17969
|
+
}, []);
|
|
17970
|
+
const content2 = jsxRuntimeExports.jsx(ExtendedThemeContext.Provider, { value: extendedTheme, children: jsxRuntimeExports.jsx(themedObjectInspector, {
|
|
17971
|
+
data: stableData,
|
|
17972
|
+
name: name2,
|
|
17973
|
+
// @ts-expect-error react-inspector accepts theme objects at runtime despite
|
|
17974
|
+
// types declaring string only — see https://github.com/storybookjs/react-inspector/blob/main/README.md#theme
|
|
17975
|
+
theme: isDark ? inspectorThemeDark : inspectorThemeLight,
|
|
17976
|
+
expandLevel: initialExpandLevel,
|
|
17977
|
+
nodeRenderer: NodeRenderer
|
|
17978
|
+
}) });
|
|
17979
|
+
let wrapped = content2;
|
|
17980
|
+
if (onStreamClick) {
|
|
17981
|
+
wrapped = jsxRuntimeExports.jsx(StreamClickContext.Provider, { value: onStreamClick, children: wrapped });
|
|
17982
|
+
}
|
|
17983
|
+
if (onDecrypt) {
|
|
17984
|
+
wrapped = jsxRuntimeExports.jsx(DecryptClickContext.Provider, { value: { onDecrypt, isDecrypting }, children: wrapped });
|
|
17985
|
+
}
|
|
17986
|
+
return wrapped;
|
|
17987
|
+
}
|
|
17988
|
+
function useStableInspectorData(next2) {
|
|
17989
|
+
const previousRef = reactExports.useRef(next2);
|
|
17990
|
+
if (!isDeepEqual(previousRef.current, next2)) {
|
|
17991
|
+
previousRef.current = next2;
|
|
17992
|
+
}
|
|
17993
|
+
return previousRef.current;
|
|
17994
|
+
}
|
|
17995
|
+
function isObjectLike(value) {
|
|
17996
|
+
return typeof value === "object" && value !== null;
|
|
17997
|
+
}
|
|
17998
|
+
function isDeepEqual(a2, b2, seen2 = /* @__PURE__ */ new WeakMap()) {
|
|
17999
|
+
if (Object.is(a2, b2))
|
|
18000
|
+
return true;
|
|
18001
|
+
if (a2 instanceof Date && b2 instanceof Date) {
|
|
18002
|
+
return a2.getTime() === b2.getTime();
|
|
18003
|
+
}
|
|
18004
|
+
if (a2 instanceof RegExp && b2 instanceof RegExp) {
|
|
18005
|
+
return a2.source === b2.source && a2.flags === b2.flags;
|
|
18006
|
+
}
|
|
18007
|
+
if (a2 instanceof Map && b2 instanceof Map) {
|
|
18008
|
+
if (a2.size !== b2.size)
|
|
18009
|
+
return false;
|
|
18010
|
+
for (const [key, value] of a2.entries()) {
|
|
18011
|
+
if (!b2.has(key) || !isDeepEqual(value, b2.get(key), seen2))
|
|
18012
|
+
return false;
|
|
17893
18013
|
}
|
|
17894
|
-
|
|
17895
|
-
|
|
17896
|
-
|
|
17897
|
-
|
|
17898
|
-
|
|
17899
|
-
|
|
18014
|
+
return true;
|
|
18015
|
+
}
|
|
18016
|
+
if (a2 instanceof Set && b2 instanceof Set) {
|
|
18017
|
+
if (a2.size !== b2.size)
|
|
18018
|
+
return false;
|
|
18019
|
+
for (const value of a2.values()) {
|
|
18020
|
+
if (!b2.has(value))
|
|
18021
|
+
return false;
|
|
17900
18022
|
}
|
|
17901
|
-
|
|
17902
|
-
|
|
17903
|
-
|
|
17904
|
-
|
|
17905
|
-
|
|
17906
|
-
|
|
17907
|
-
|
|
17908
|
-
|
|
17909
|
-
|
|
17910
|
-
|
|
17911
|
-
|
|
17912
|
-
|
|
17913
|
-
|
|
17914
|
-
|
|
17915
|
-
|
|
17916
|
-
|
|
17917
|
-
|
|
17918
|
-
|
|
17919
|
-
}, [
|
|
17920
|
-
hotkey
|
|
17921
|
-
]);
|
|
17922
|
-
ReactExports.useEffect(() => {
|
|
17923
|
-
if (listRef.current) {
|
|
17924
|
-
return () => {
|
|
17925
|
-
if (lastFocusedElementRef.current) {
|
|
17926
|
-
lastFocusedElementRef.current.focus({
|
|
17927
|
-
preventScroll: true
|
|
17928
|
-
});
|
|
17929
|
-
lastFocusedElementRef.current = null;
|
|
17930
|
-
isFocusWithinRef.current = false;
|
|
17931
|
-
}
|
|
17932
|
-
};
|
|
18023
|
+
return true;
|
|
18024
|
+
}
|
|
18025
|
+
if (!isObjectLike(a2) || !isObjectLike(b2)) {
|
|
18026
|
+
return false;
|
|
18027
|
+
}
|
|
18028
|
+
if (seen2.get(a2) === b2)
|
|
18029
|
+
return true;
|
|
18030
|
+
seen2.set(a2, b2);
|
|
18031
|
+
const aIsArray = Array.isArray(a2);
|
|
18032
|
+
const bIsArray = Array.isArray(b2);
|
|
18033
|
+
if (aIsArray !== bIsArray)
|
|
18034
|
+
return false;
|
|
18035
|
+
if (aIsArray && bIsArray) {
|
|
18036
|
+
if (a2.length !== b2.length)
|
|
18037
|
+
return false;
|
|
18038
|
+
for (let i = 0; i < a2.length; i += 1) {
|
|
18039
|
+
if (!isDeepEqual(a2[i], b2[i], seen2))
|
|
18040
|
+
return false;
|
|
17933
18041
|
}
|
|
17934
|
-
|
|
17935
|
-
|
|
17936
|
-
|
|
17937
|
-
|
|
17938
|
-
|
|
17939
|
-
|
|
17940
|
-
|
|
17941
|
-
|
|
17942
|
-
|
|
17943
|
-
|
|
17944
|
-
|
|
17945
|
-
|
|
17946
|
-
|
|
17947
|
-
}, possiblePositions.map((position3, index2) => {
|
|
17948
|
-
var _heights_;
|
|
17949
|
-
const [y2, x2] = position3.split("-");
|
|
17950
|
-
if (!filteredToasts.length) return null;
|
|
17951
|
-
return /* @__PURE__ */ ReactExports.createElement("ol", {
|
|
17952
|
-
key: position3,
|
|
17953
|
-
dir: dir === "auto" ? getDocumentDirection() : dir,
|
|
17954
|
-
tabIndex: -1,
|
|
17955
|
-
ref: listRef,
|
|
17956
|
-
className,
|
|
17957
|
-
"data-sonner-toaster": true,
|
|
17958
|
-
"data-sonner-theme": actualTheme,
|
|
17959
|
-
"data-y-position": y2,
|
|
17960
|
-
"data-x-position": x2,
|
|
17961
|
-
style: {
|
|
17962
|
-
"--front-toast-height": `${((_heights_ = heights[0]) == null ? void 0 : _heights_.height) || 0}px`,
|
|
17963
|
-
"--width": `${TOAST_WIDTH}px`,
|
|
17964
|
-
"--gap": `${gap}px`,
|
|
17965
|
-
...style2,
|
|
17966
|
-
...assignOffset(offset2, mobileOffset)
|
|
17967
|
-
},
|
|
17968
|
-
onBlur: (event) => {
|
|
17969
|
-
if (isFocusWithinRef.current && !event.currentTarget.contains(event.relatedTarget)) {
|
|
17970
|
-
isFocusWithinRef.current = false;
|
|
17971
|
-
if (lastFocusedElementRef.current) {
|
|
17972
|
-
lastFocusedElementRef.current.focus({
|
|
17973
|
-
preventScroll: true
|
|
17974
|
-
});
|
|
17975
|
-
lastFocusedElementRef.current = null;
|
|
17976
|
-
}
|
|
17977
|
-
}
|
|
17978
|
-
},
|
|
17979
|
-
onFocus: (event) => {
|
|
17980
|
-
const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === "false";
|
|
17981
|
-
if (isNotDismissible) return;
|
|
17982
|
-
if (!isFocusWithinRef.current) {
|
|
17983
|
-
isFocusWithinRef.current = true;
|
|
17984
|
-
lastFocusedElementRef.current = event.relatedTarget;
|
|
17985
|
-
}
|
|
17986
|
-
},
|
|
17987
|
-
onMouseEnter: () => setExpanded(true),
|
|
17988
|
-
onMouseMove: () => setExpanded(true),
|
|
17989
|
-
onMouseLeave: () => {
|
|
17990
|
-
if (!interacting) {
|
|
17991
|
-
setExpanded(false);
|
|
17992
|
-
}
|
|
17993
|
-
},
|
|
17994
|
-
onDragEnd: () => setExpanded(false),
|
|
17995
|
-
onPointerDown: (event) => {
|
|
17996
|
-
const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === "false";
|
|
17997
|
-
if (isNotDismissible) return;
|
|
17998
|
-
setInteracting(true);
|
|
17999
|
-
},
|
|
18000
|
-
onPointerUp: () => setInteracting(false)
|
|
18001
|
-
}, filteredToasts.filter((toast2) => !toast2.position && index2 === 0 || toast2.position === position3).map((toast2, index3) => {
|
|
18002
|
-
var _toastOptions_duration, _toastOptions_closeButton;
|
|
18003
|
-
return /* @__PURE__ */ ReactExports.createElement(Toast, {
|
|
18004
|
-
key: toast2.id,
|
|
18005
|
-
icons,
|
|
18006
|
-
index: index3,
|
|
18007
|
-
toast: toast2,
|
|
18008
|
-
defaultRichColors: richColors,
|
|
18009
|
-
duration: (_toastOptions_duration = toastOptions == null ? void 0 : toastOptions.duration) != null ? _toastOptions_duration : duration2,
|
|
18010
|
-
className: toastOptions == null ? void 0 : toastOptions.className,
|
|
18011
|
-
descriptionClassName: toastOptions == null ? void 0 : toastOptions.descriptionClassName,
|
|
18012
|
-
invert,
|
|
18013
|
-
visibleToasts,
|
|
18014
|
-
closeButton: (_toastOptions_closeButton = toastOptions == null ? void 0 : toastOptions.closeButton) != null ? _toastOptions_closeButton : closeButton,
|
|
18015
|
-
interacting,
|
|
18016
|
-
position: position3,
|
|
18017
|
-
style: toastOptions == null ? void 0 : toastOptions.style,
|
|
18018
|
-
unstyled: toastOptions == null ? void 0 : toastOptions.unstyled,
|
|
18019
|
-
classNames: toastOptions == null ? void 0 : toastOptions.classNames,
|
|
18020
|
-
cancelButtonStyle: toastOptions == null ? void 0 : toastOptions.cancelButtonStyle,
|
|
18021
|
-
actionButtonStyle: toastOptions == null ? void 0 : toastOptions.actionButtonStyle,
|
|
18022
|
-
closeButtonAriaLabel: toastOptions == null ? void 0 : toastOptions.closeButtonAriaLabel,
|
|
18023
|
-
removeToast,
|
|
18024
|
-
toasts: filteredToasts.filter((t) => t.position == toast2.position),
|
|
18025
|
-
heights: heights.filter((h2) => h2.position == toast2.position),
|
|
18026
|
-
setHeights,
|
|
18027
|
-
expandByDefault: expand,
|
|
18028
|
-
gap,
|
|
18029
|
-
expanded: expanded2,
|
|
18030
|
-
swipeDirections: props.swipeDirections
|
|
18031
|
-
});
|
|
18032
|
-
}));
|
|
18033
|
-
}))
|
|
18034
|
-
);
|
|
18035
|
-
});
|
|
18036
|
-
const defaultAdapter = {
|
|
18037
|
-
success: (msg, opts) => toast.success(msg, opts),
|
|
18038
|
-
error: (msg, opts) => toast.error(msg, opts),
|
|
18039
|
-
info: (msg, opts) => toast.info(msg, opts)
|
|
18040
|
-
};
|
|
18041
|
-
const ToastContext = reactExports.createContext(defaultAdapter);
|
|
18042
|
-
function useToast() {
|
|
18043
|
-
return reactExports.useContext(ToastContext);
|
|
18042
|
+
return true;
|
|
18043
|
+
}
|
|
18044
|
+
const aKeys = Object.keys(a2);
|
|
18045
|
+
const bKeys = Object.keys(b2);
|
|
18046
|
+
if (aKeys.length !== bKeys.length)
|
|
18047
|
+
return false;
|
|
18048
|
+
for (const key of aKeys) {
|
|
18049
|
+
if (!Object.hasOwn(b2, key))
|
|
18050
|
+
return false;
|
|
18051
|
+
if (!isDeepEqual(a2[key], b2[key], seen2))
|
|
18052
|
+
return false;
|
|
18053
|
+
}
|
|
18054
|
+
return true;
|
|
18044
18055
|
}
|
|
18045
18056
|
function Skeleton$1({ className, style: style2, ...props }) {
|
|
18046
18057
|
return jsxRuntimeExports.jsx("div", { ...props, className: cn$4("rounded-md", className), style: { backgroundColor: "var(--ds-gray-200)", ...style2 } });
|
|
@@ -42807,7 +42818,7 @@ var tn = f("block", "before:content-[counter(line)]", "before:inline-block", "be
|
|
|
42807
42818
|
var et = ({ className: e, language: t, style: o, isIncomplete: n, ...s2 }) => jsxRuntimeExports.jsx("div", { className: f("my-4 flex w-full flex-col gap-2 rounded-xl border border-border bg-sidebar p-2", e), "data-incomplete": n || void 0, "data-language": t, "data-streamdown": "code-block", style: { contentVisibility: "auto", containIntrinsicSize: "auto 200px", ...o }, ...s2 });
|
|
42808
42819
|
var Se = reactExports.createContext({ code: "" }), de = () => reactExports.useContext(Se);
|
|
42809
42820
|
var ot = ({ language: e }) => jsxRuntimeExports.jsx("div", { className: "flex h-8 items-center text-muted-foreground text-xs", "data-language": e, "data-streamdown": "code-block-header", children: jsxRuntimeExports.jsx("span", { className: "ml-1 font-mono lowercase", children: e }) });
|
|
42810
|
-
var cn$1 = /\n+$/, dn = reactExports.lazy(() => __vitePreload(() => import("./highlighted-body-B3W2YXNL-
|
|
42821
|
+
var cn$1 = /\n+$/, dn = reactExports.lazy(() => __vitePreload(() => import("./highlighted-body-B3W2YXNL-D1wKXrjI.js"), true ? __vite__mapDeps([0,1]) : void 0).then((e) => ({ default: e.HighlightedCodeBlockBody }))), rt = ({ code: e, language: t, className: o, children: n, isIncomplete: s2 = false, ...r2 }) => {
|
|
42811
42822
|
let i = reactExports.useMemo(() => e.replace(cn$1, ""), [e]), c = reactExports.useMemo(() => ({ bg: "transparent", fg: "inherit", tokens: i.split(`
|
|
42812
42823
|
`).map((a2) => [{ content: a2, color: "inherit", bgColor: "transparent", htmlStyle: {}, offset: 0 }]) }), [i]);
|
|
42813
42824
|
return jsxRuntimeExports.jsx(Se.Provider, { value: { code: e }, children: jsxRuntimeExports.jsxs(et, { isIncomplete: s2, language: t, children: [jsxRuntimeExports.jsx(ot, { language: t }), n ? jsxRuntimeExports.jsx("div", { className: "pointer-events-none sticky top-2 z-10 -mt-10 flex h-8 items-center justify-end", children: jsxRuntimeExports.jsx("div", { className: "pointer-events-auto flex shrink-0 items-center gap-2 rounded-md border border-sidebar bg-sidebar/80 px-1.5 py-1 supports-[backdrop-filter]:bg-sidebar/70 supports-[backdrop-filter]:backdrop-blur", "data-streamdown": "code-block-actions", children: n }) }) : null, jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: jsxRuntimeExports.jsx(Qe, { className: o, language: t, result: c, ...r2 }), children: jsxRuntimeExports.jsx(dn, { className: o, code: i, language: t, raw: c, ...r2 }) })] }) });
|
|
@@ -47912,6 +47923,13 @@ async function fetchEvents(worldEnv, runId, params) {
|
|
|
47912
47923
|
async function fetchEvent(worldEnv, runId, eventId, resolveData = "all") {
|
|
47913
47924
|
return rpc("fetchEvent", { worldEnv, runId, eventId, resolveData });
|
|
47914
47925
|
}
|
|
47926
|
+
async function fetchEventsByCorrelationId(worldEnv, correlationId, params) {
|
|
47927
|
+
return rpc("fetchEventsByCorrelationId", {
|
|
47928
|
+
worldEnv,
|
|
47929
|
+
correlationId,
|
|
47930
|
+
params
|
|
47931
|
+
});
|
|
47932
|
+
}
|
|
47915
47933
|
async function fetchHooks(worldEnv, params) {
|
|
47916
47934
|
return rpc("fetchHooks", { worldEnv, params });
|
|
47917
47935
|
}
|
|
@@ -47990,26 +48008,27 @@ export {
|
|
|
47990
48008
|
formatWallClockTime as a8,
|
|
47991
48009
|
useImmediateStyle as a9,
|
|
47992
48010
|
getWebRevivers as aA,
|
|
47993
|
-
|
|
47994
|
-
|
|
47995
|
-
|
|
47996
|
-
|
|
47997
|
-
|
|
47998
|
-
|
|
47999
|
-
|
|
48000
|
-
|
|
48001
|
-
|
|
48002
|
-
|
|
48003
|
-
|
|
48004
|
-
|
|
48005
|
-
|
|
48006
|
-
|
|
48007
|
-
|
|
48008
|
-
|
|
48009
|
-
|
|
48010
|
-
|
|
48011
|
-
|
|
48012
|
-
|
|
48011
|
+
fetchEvent as aB,
|
|
48012
|
+
fetchEventsByCorrelationId as aC,
|
|
48013
|
+
LIVE_UPDATE_INTERVAL_MS as aD,
|
|
48014
|
+
getEncryptionKeyForRun as aE,
|
|
48015
|
+
StreamViewer as aF,
|
|
48016
|
+
cn$4 as aG,
|
|
48017
|
+
composeRefs as aH,
|
|
48018
|
+
useFloating as aI,
|
|
48019
|
+
offset as aJ,
|
|
48020
|
+
shift as aK,
|
|
48021
|
+
limitShift as aL,
|
|
48022
|
+
flip as aM,
|
|
48023
|
+
size as aN,
|
|
48024
|
+
arrow as aO,
|
|
48025
|
+
hide as aP,
|
|
48026
|
+
autoUpdate as aQ,
|
|
48027
|
+
cancelRun as aR,
|
|
48028
|
+
reenqueueRun as aS,
|
|
48029
|
+
wakeUpRun as aT,
|
|
48030
|
+
resumeHook as aU,
|
|
48031
|
+
recreateRun as aV,
|
|
48013
48032
|
TIMELINE_PADDING as aa,
|
|
48014
48033
|
formatTimeSelection as ab,
|
|
48015
48034
|
MARKER_HEIGHT as ac,
|
|
@@ -48049,15 +48068,15 @@ export {
|
|
|
48049
48068
|
fetchEvents as l,
|
|
48050
48069
|
useCallbackRef as m,
|
|
48051
48070
|
useComposedRefs$1 as n,
|
|
48052
|
-
|
|
48053
|
-
|
|
48054
|
-
|
|
48071
|
+
composeEventHandlers as o,
|
|
48072
|
+
useId as p,
|
|
48073
|
+
createPopperScope as q,
|
|
48055
48074
|
runHealthCheck as r,
|
|
48056
|
-
|
|
48075
|
+
DismissableLayer as s,
|
|
48057
48076
|
toast as t,
|
|
48058
48077
|
useServerConfig as u,
|
|
48059
|
-
|
|
48060
|
-
|
|
48078
|
+
createContextScope as v,
|
|
48079
|
+
createSlot as w,
|
|
48061
48080
|
useControllableState as x,
|
|
48062
48081
|
Root2 as y,
|
|
48063
48082
|
Arrow$1 as z
|