@workflow/web 4.1.6 → 4.1.8

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