react-semaphor 0.1.215 → 0.1.217

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.
Files changed (42) hide show
  1. package/dist/chunks/{dashboard-controls-gCssNmJm.js → dashboard-controls-DLjwyISu.js} +548 -470
  2. package/dist/chunks/dashboard-controls-p-PLTBKo.js +47 -0
  3. package/dist/chunks/{dashboard-json-DqjdMwqj.js → dashboard-json-DC8Hr2u7.js} +1 -1
  4. package/dist/chunks/{dashboard-json-BZdOqyyK.js → dashboard-json-Dy8OL7sx.js} +5 -5
  5. package/dist/chunks/{dashboard-summary-settings-dialog-BxEopSPW.js → dashboard-summary-settings-dialog-CQISZPzc.js} +1 -1
  6. package/dist/chunks/{dashboard-summary-settings-dialog-Diz1-VIZ.js → dashboard-summary-settings-dialog-Dlzv-d9Z.js} +1 -1
  7. package/dist/chunks/{edit-dashboard-visual-CWytKzAl.js → edit-dashboard-visual-DAiqFH7i.js} +9 -9
  8. package/dist/chunks/{edit-dashboard-visual-Bq0O78OS.js → edit-dashboard-visual-DkZya-OV.js} +2649 -2653
  9. package/dist/chunks/{editor-action-buttons-D3hMMbWz.js → editor-action-buttons-4-UuoSZc.js} +1 -1
  10. package/dist/chunks/{editor-action-buttons-CdrejHS2.js → editor-action-buttons-BQtxnqBZ.js} +2 -2
  11. package/dist/chunks/index-CRJ97-41.js +1098 -0
  12. package/dist/chunks/{index-Cxj7oWTZ.js → index-Cr-d0ray.js} +27027 -27593
  13. package/dist/chunks/normalize-dashboard-for-dirty-check-B7NQDI1H.js +1 -0
  14. package/dist/chunks/normalize-dashboard-for-dirty-check-Bn27S0PN.js +69 -0
  15. package/dist/chunks/{notification-bell-D1NnHIWO.js → notification-bell-CyZx_uZ1.js} +1 -1
  16. package/dist/chunks/{notification-bell-BTWYtgvh.js → notification-bell-_OADjyy7.js} +37 -37
  17. package/dist/chunks/{resource-management-panel-DATz276M.js → resource-management-panel-Bq9zRYsk.js} +1 -1
  18. package/dist/chunks/{resource-management-panel-BnRwLkjR.js → resource-management-panel-rmEMdbbS.js} +33 -33
  19. package/dist/chunks/use-debounced-dirty-check-BwAbnX_5.js +59 -0
  20. package/dist/chunks/use-debounced-dirty-check-XHSwAefL.js +1 -0
  21. package/dist/chunks/{use-role-aware-display-preferences-ASD7plKm.js → use-role-aware-display-preferences-1U-ed07h.js} +1 -1
  22. package/dist/chunks/{use-role-aware-display-preferences-DP-Ng_hb.js → use-role-aware-display-preferences-DOA8kcfK.js} +1 -1
  23. package/dist/chunks/{use-visual-utils-C_9jH8bu.js → use-visual-utils-DX-4Hwoe.js} +1 -1
  24. package/dist/chunks/{use-visual-utils-873PUDHm.js → use-visual-utils-DxigSU7y.js} +1 -1
  25. package/dist/dashboard/index.cjs +1 -1
  26. package/dist/dashboard/index.js +1 -1
  27. package/dist/index.cjs +1 -1
  28. package/dist/index.js +19 -18
  29. package/dist/shared/index.cjs +1 -1
  30. package/dist/shared/index.js +5 -4
  31. package/dist/surfboard/index.cjs +1 -1
  32. package/dist/surfboard/index.js +2 -2
  33. package/dist/types/dashboard.d.ts +9 -4
  34. package/dist/types/main.d.ts +17 -8
  35. package/dist/types/shared.d.ts +9 -4
  36. package/dist/types/surfboard.d.ts +9 -4
  37. package/dist/types/types.d.ts +9 -4
  38. package/package.json +2 -1
  39. package/dist/chunks/dashboard-controls-DO8B0l2Z.js +0 -47
  40. package/dist/chunks/index-BkklWRT2.js +0 -1109
  41. package/dist/chunks/normalize-dashboard-for-dirty-check-D9x96J2F.js +0 -1
  42. package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +0 -119
@@ -0,0 +1 @@
1
+ "use strict";const s=["i","x","y","w","h","minW","minH","maxW","maxH","static","isResizable","isDraggable"];function y(t,e,r){t[e]=r}function a(t){const e={};for(const r of s){const i=t[r];i!==void 0&&((r==="isResizable"||r==="isDraggable")&&i===!0||y(e,r,i))}return e}function o(t){return t?t.map(a).sort((e,r)=>{const i=String(e.i??""),n=String(r.i??"");return i!==n?i.localeCompare(n):Number(e.y??0)-Number(r.y??0)||Number(e.x??0)-Number(r.x??0)||Number(e.h??0)-Number(r.h??0)||Number(e.w??0)-Number(r.w??0)}):[]}function u(t){if(!t)return;const e={};for(const r of Object.keys(t).sort()){const i=t[r];i&&(e[r]=o(i))}return e}function c(t){return JSON.stringify(t,(e,r)=>!r||typeof r!="object"||Array.isArray(r)?r:Object.keys(r).sort().reduce((i,n)=>(i[n]=r[n],i),{}))}function f(t){var e;return t?{...t,sheets:(e=t.sheets)==null?void 0:e.map(r=>{if(!r)return r;const i={...r};return r.layout&&(i.layout=o(r.layout)),r.layouts&&(i.layouts=u(r.layouts)),i})}:null}function m(t){return JSON.stringify(t??null,function(e,r){return e==="layout"&&Array.isArray(r)?o(r):e==="layouts"&&r&&typeof r=="object"&&!Array.isArray(r)?u(r):!r||typeof r!="object"||Array.isArray(r)?r:Object.keys(r).sort().reduce((i,n)=>(i[n]=r[n],i),{})})}function b(t){return c(u(t)??null)}exports.normalizeDashboardForDirtyCheck=f;exports.serializeDashboardForDirtyCheck=m;exports.serializeLayoutsForDirtyCheck=b;
@@ -0,0 +1,69 @@
1
+ const s = [
2
+ "i",
3
+ "x",
4
+ "y",
5
+ "w",
6
+ "h",
7
+ "minW",
8
+ "minH",
9
+ "maxW",
10
+ "maxH",
11
+ "static",
12
+ "isResizable",
13
+ "isDraggable"
14
+ ];
15
+ function y(t, n, r) {
16
+ t[n] = r;
17
+ }
18
+ function f(t) {
19
+ const n = {};
20
+ for (const r of s) {
21
+ const e = t[r];
22
+ e !== void 0 && ((r === "isResizable" || r === "isDraggable") && e === !0 || y(n, r, e));
23
+ }
24
+ return n;
25
+ }
26
+ function o(t) {
27
+ return t ? t.map(f).sort((n, r) => {
28
+ const e = String(n.i ?? ""), i = String(r.i ?? "");
29
+ return e !== i ? e.localeCompare(i) : Number(n.y ?? 0) - Number(r.y ?? 0) || Number(n.x ?? 0) - Number(r.x ?? 0) || Number(n.h ?? 0) - Number(r.h ?? 0) || Number(n.w ?? 0) - Number(r.w ?? 0);
30
+ }) : [];
31
+ }
32
+ function u(t) {
33
+ if (!t) return;
34
+ const n = {};
35
+ for (const r of Object.keys(t).sort()) {
36
+ const e = t[r];
37
+ e && (n[r] = o(e));
38
+ }
39
+ return n;
40
+ }
41
+ function a(t) {
42
+ return JSON.stringify(t, (n, r) => !r || typeof r != "object" || Array.isArray(r) ? r : Object.keys(r).sort().reduce((e, i) => (e[i] = r[i], e), {}));
43
+ }
44
+ function c(t) {
45
+ var n;
46
+ return t ? {
47
+ ...t,
48
+ sheets: (n = t.sheets) == null ? void 0 : n.map((r) => {
49
+ if (!r) return r;
50
+ const e = {
51
+ ...r
52
+ };
53
+ return r.layout && (e.layout = o(r.layout)), r.layouts && (e.layouts = u(r.layouts)), e;
54
+ })
55
+ } : null;
56
+ }
57
+ function m(t) {
58
+ return JSON.stringify(t ?? null, function(n, r) {
59
+ return n === "layout" && Array.isArray(r) ? o(r) : n === "layouts" && r && typeof r == "object" && !Array.isArray(r) ? u(r) : !r || typeof r != "object" || Array.isArray(r) ? r : Object.keys(r).sort().reduce((e, i) => (e[i] = r[i], e), {});
60
+ });
61
+ }
62
+ function b(t) {
63
+ return a(u(t) ?? null);
64
+ }
65
+ export {
66
+ b as a,
67
+ c as n,
68
+ m as s
69
+ };
@@ -1,4 +1,4 @@
1
- "use strict";const f=require("react"),t=require("./index-BkklWRT2.js"),e=require("react/jsx-runtime"),A=require("./editor-action-buttons-D3hMMbWz.js"),U=require("./use-visual-utils-C_9jH8bu.js"),I=require("./date-formatter-Sz6QDaM8.js");/**
1
+ "use strict";const f=require("react"),t=require("./index-CRJ97-41.js"),e=require("react/jsx-runtime"),A=require("./editor-action-buttons-4-UuoSZc.js"),U=require("./use-visual-utils-DX-4Hwoe.js"),I=require("./date-formatter-Sz6QDaM8.js");/**
2
2
  * @license lucide-react v0.453.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,8 +1,8 @@
1
- import K, { useState as D, useRef as M, useCallback as k, useEffect as L, useContext as ee } from "react";
2
- import { bS as te, l as z, bM as T, b6 as B, aT as Q, aS as $, bL as Y, aU as ae, m as se, n as re, o as oe, p as ne, q as ie, L as j, cB as le, cH as ce, G as de, B as I, H as _, a1 as P, V as ue, u as V, W as me, Z, cI as he, cJ as H, I as R, bO as pe, c as U, c8 as fe, c9 as ge, ab as ve, cb as be, cc as F, E as xe, cg as we, c7 as ye, Y as Ce, cK as Ne, cL as Ae, cM as De, cp as Ee, cq as Se, cr as Le, cN as Ie, cs as Te, ct as Ue, cu as ke, cv as Ve, cw as Fe, ay as Me, aI as Pe, X as Re, cO as Oe, cP as ze, cQ as Be, ax as q, ad as $e, bN as _e, P as je, s as He, cR as qe, t as Ge } from "./index-Cxj7oWTZ.js";
1
+ import J, { useState as D, useRef as M, useCallback as k, useEffect as L, useContext as ee } from "react";
2
+ import { bS as te, l as z, aE as T, bP as B, bL as K, bM as $, aF as Q, bK as ae, m as se, n as re, o as oe, p as ne, q as ie, L as _, cB as le, cH as ce, G as de, B as I, H, a1 as P, V as ue, u as F, W as me, Z as Y, cI as he, cJ as j, I as R, ah as pe, c as U, c8 as fe, c9 as ge, ab as ve, cb as be, cc as V, E as xe, cg as we, c7 as ye, Y as Ce, cK as Ne, cL as Ae, cM as De, cp as Ee, cq as Se, cr as Le, cN as Ie, cs as Te, ct as Ue, cu as ke, cv as Fe, cw as Ve, au as Me, bR as Pe, X as Re, cO as Oe, cP as ze, cQ as Be, bN as q, ad as $e, aH as He, P as _e, s as je, cR as qe, t as Ge } from "./index-Cr-d0ray.js";
3
3
  import { jsx as t, jsxs as o, Fragment as O } from "react/jsx-runtime";
4
- import { V as Xe, E as We, a as Qe, b as Ye, L as Ze, c as Je, d as Ke, C as et } from "./editor-action-buttons-CdrejHS2.js";
5
- import { a as J } from "./use-visual-utils-873PUDHm.js";
4
+ import { V as Xe, E as We, a as Ke, b as Qe, L as Ye, c as Ze, d as Je, C as et } from "./editor-action-buttons-BQtxnqBZ.js";
5
+ import { a as Z } from "./use-visual-utils-DxigSU7y.js";
6
6
  import { c as G } from "./date-formatter-Y8Za1ib3.js";
7
7
  /**
8
8
  * @license lucide-react v0.453.0 - ISC
@@ -70,7 +70,7 @@ function bt() {
70
70
  const y = await Promise.allSettled(
71
71
  p.map(async (s) => {
72
72
  try {
73
- const r = await Q(f, i, s.id);
73
+ const r = await K(f, i, s.id);
74
74
  let v;
75
75
  if (r.status === "completed")
76
76
  try {
@@ -135,7 +135,7 @@ function bt() {
135
135
  };
136
136
  }
137
137
  function xt() {
138
- const { authToken: e, tokenProps: a } = z(), m = T((l) => l.activeExports), { addExport: c } = Y(), d = M(!1), u = a == null ? void 0 : a.apiServiceUrl, n = e == null ? void 0 : e.accessToken;
138
+ const { authToken: e, tokenProps: a } = z(), m = T((l) => l.activeExports), { addExport: c } = Q(), d = M(!1), u = a == null ? void 0 : a.apiServiceUrl, n = e == null ? void 0 : e.accessToken;
139
139
  L(() => {
140
140
  if (d.current || !u || !n) return;
141
141
  (async () => {
@@ -200,7 +200,7 @@ function lt({
200
200
  const [l, f] = D(
201
201
  m && c ? `Copy of ${c}` : c || ""
202
202
  ), [i, g] = D("");
203
- K.useEffect(() => {
203
+ J.useEffect(() => {
204
204
  e && (f(
205
205
  m && c ? `Copy of ${c}` : c || ""
206
206
  ), g(""));
@@ -248,7 +248,7 @@ function lt({
248
248
  ] }),
249
249
  /* @__PURE__ */ o("div", { className: "grid gap-4 py-4", children: [
250
250
  /* @__PURE__ */ o("div", { className: "grid gap-2", children: [
251
- /* @__PURE__ */ t(j, { htmlFor: "name", children: "Name" }),
251
+ /* @__PURE__ */ t(_, { htmlFor: "name", children: "Name" }),
252
252
  /* @__PURE__ */ t(
253
253
  le,
254
254
  {
@@ -261,7 +261,7 @@ function lt({
261
261
  )
262
262
  ] }),
263
263
  /* @__PURE__ */ o("div", { className: "grid gap-2", children: [
264
- /* @__PURE__ */ t(j, { htmlFor: "description", children: "Description (optional)" }),
264
+ /* @__PURE__ */ t(_, { htmlFor: "description", children: "Description (optional)" }),
265
265
  /* @__PURE__ */ t(
266
266
  ce,
267
267
  {
@@ -286,16 +286,16 @@ function lt({
286
286
  }
287
287
  ),
288
288
  /* @__PURE__ */ o(I, { onClick: b, disabled: !x || d, children: [
289
- d && /* @__PURE__ */ t(_, { className: "mr-2 h-4 w-4 animate-spin" }),
289
+ d && /* @__PURE__ */ t(H, { className: "mr-2 h-4 w-4 animate-spin" }),
290
290
  h.actionLabel
291
291
  ] })
292
292
  ] })
293
293
  ] }) });
294
294
  }
295
295
  function ct() {
296
- const [e, a] = D(!1), [m, c] = D(!1), [d, u] = D(null), n = P((r) => r.frame), l = P((r) => r.card), f = ue(), i = V((r) => r.selectedSheetId), g = V(
296
+ const [e, a] = D(!1), [m, c] = D(!1), [d, u] = D(null), n = P((r) => r.frame), l = P((r) => r.card), f = ue(), i = F((r) => r.selectedSheetId), g = F(
297
297
  (r) => r.actions.setIsDashboardPanelOpen
298
- ), { getUpdatedFrame: x } = J(), { selectVisual: h } = me(), { addFrame: b, setSelectedFrameId: N, setIsVisualEditing: p } = Z(), y = !!(n != null && n.visualId), A = (() => {
298
+ ), { getUpdatedFrame: x } = Z(), { selectVisual: h } = me(), { addFrame: b, setSelectedFrameId: N, setIsVisualEditing: p } = Y(), y = !!(n != null && n.visualId), A = (() => {
299
299
  var r, v;
300
300
  return ((r = n == null ? void 0 : n.cards) == null ? void 0 : r.length) === 1 && ((v = n.cards[0]) != null && v.title) ? n.cards[0].title : f != null && f.title ? f.title : (l == null ? void 0 : l.title) || "Untitled Visual";
301
301
  })(), w = he((r) => {
@@ -303,7 +303,7 @@ function ct() {
303
303
  if (h(r), m && d && i) {
304
304
  const v = {
305
305
  ...d,
306
- id: H(),
306
+ id: j(),
307
307
  visualId: r.id
308
308
  // Link to the newly created library visual
309
309
  };
@@ -342,7 +342,7 @@ function ct() {
342
342
  const S = {
343
343
  ...C,
344
344
  // Card title already synced
345
- id: H(),
345
+ id: j(),
346
346
  visualId: void 0
347
347
  // Explicitly no visualId for local visuals
348
348
  };
@@ -357,14 +357,14 @@ function ct() {
357
357
  function wt({
358
358
  className: e
359
359
  }) {
360
- const a = P((C) => C.frame), m = pe((C) => C.selectedVisual), c = V((C) => C.selectedFrameId), d = V((C) => C.selectedSheetId), { setIsVisualEditing: u, updateFrame: n } = Z(), [l, f] = D(!1), [i, g] = D("both"), x = !!(a != null && a.visualId || m != null && m.id), h = !!(a != null && a.visualId && c), b = x && !h, {
360
+ const a = P((C) => C.frame), m = pe((C) => C.selectedVisual), c = F((C) => C.selectedFrameId), d = F((C) => C.selectedSheetId), { setIsVisualEditing: u, updateFrame: n } = Y(), [l, f] = D(!1), [i, g] = D("both"), x = !!(a != null && a.visualId || m != null && m.id), h = !!(a != null && a.visualId && c), b = x && !h, {
361
361
  saveAsDialogOpen: N,
362
362
  setSaveAsDialogOpen: p,
363
363
  handleSaveAs: y,
364
364
  isLibraryVisual: A,
365
365
  currentVisualName: w,
366
366
  isSaving: s
367
- } = ct(), { getUpdatedFrame: r } = J(), v = () => {
367
+ } = ct(), { getUpdatedFrame: r } = Z(), v = () => {
368
368
  if (!d) {
369
369
  R.error("No sheet selected");
370
370
  return;
@@ -391,14 +391,14 @@ function wt({
391
391
  }
392
392
  ),
393
393
  x && b && /* @__PURE__ */ t(
394
- Qe,
394
+ Ke,
395
395
  {
396
396
  className: U(e, "rounded-none border-0"),
397
397
  variant: "default"
398
398
  }
399
399
  ),
400
400
  x && h && /* @__PURE__ */ t(
401
- Ye,
401
+ Qe,
402
402
  {
403
403
  className: U(e, "rounded-none border-0")
404
404
  }
@@ -421,7 +421,7 @@ function wt({
421
421
  /* @__PURE__ */ o(be, { align: "end", children: [
422
422
  h && /* @__PURE__ */ o(O, { children: [
423
423
  /* @__PURE__ */ o(
424
- F,
424
+ V,
425
425
  {
426
426
  onClick: v,
427
427
  disabled: l,
@@ -434,7 +434,7 @@ function wt({
434
434
  /* @__PURE__ */ t(we, {})
435
435
  ] }),
436
436
  /* @__PURE__ */ o(
437
- F,
437
+ V,
438
438
  {
439
439
  onClick: () => E("local"),
440
440
  disabled: s,
@@ -445,23 +445,23 @@ function wt({
445
445
  }
446
446
  ),
447
447
  /* @__PURE__ */ o(
448
- F,
448
+ V,
449
449
  {
450
450
  onClick: () => E("library"),
451
451
  disabled: s,
452
452
  children: [
453
- /* @__PURE__ */ t(Ze, { className: "mr-2 h-4 w-4" }),
453
+ /* @__PURE__ */ t(Ye, { className: "mr-2 h-4 w-4" }),
454
454
  "Save as Library Visual"
455
455
  ]
456
456
  }
457
457
  ),
458
458
  /* @__PURE__ */ o(
459
- F,
459
+ V,
460
460
  {
461
461
  onClick: () => E("both"),
462
462
  disabled: s,
463
463
  children: [
464
- /* @__PURE__ */ t(Je, { className: "mr-2 h-4 w-4" }),
464
+ /* @__PURE__ */ t(Ze, { className: "mr-2 h-4 w-4" }),
465
465
  "Save Copy as Linked Visual"
466
466
  ]
467
467
  }
@@ -469,7 +469,7 @@ function wt({
469
469
  ] })
470
470
  ] })
471
471
  ] }),
472
- /* @__PURE__ */ t(Ke, { className: e }),
472
+ /* @__PURE__ */ t(Je, { className: e }),
473
473
  /* @__PURE__ */ t(
474
474
  lt,
475
475
  {
@@ -491,7 +491,7 @@ function yt({
491
491
  //labelClassName,
492
492
  switchClassName: a
493
493
  }) {
494
- const m = P((l) => l.isDevMode), c = V((l) => l.isVisualEditing), { setIsDevMode: d } = Ce(), { config: u } = ee(Ne).tokenProps, n = (u == null ? void 0 : u.showAdvancedMode) !== !1;
494
+ const m = P((l) => l.isDevMode), c = F((l) => l.isVisualEditing), { setIsDevMode: d } = Ce(), { config: u } = ee(Ne).tokenProps, n = (u == null ? void 0 : u.showAdvancedMode) !== !1;
495
495
  return !c || !n ? null : /* @__PURE__ */ o("div", { className: U("flex items-center space-x-2", e), children: [
496
496
  /* @__PURE__ */ t(
497
497
  Ae,
@@ -531,7 +531,7 @@ function Ct({
531
531
  ] }),
532
532
  /* @__PURE__ */ o(ke, { className: "mt-2 flex-col gap-1.5 sm:flex-row sm:justify-end", children: [
533
533
  /* @__PURE__ */ t(
534
- Ve,
534
+ Fe,
535
535
  {
536
536
  disabled: d,
537
537
  className: "order-1 m-0 h-9 border-border/60 px-4 sm:order-1",
@@ -548,13 +548,13 @@ function Ct({
548
548
  }
549
549
  ),
550
550
  /* @__PURE__ */ t(
551
- Fe,
551
+ Ve,
552
552
  {
553
553
  onClick: m,
554
554
  disabled: d,
555
555
  className: "order-3 m-0 h-9 px-4 sm:order-3",
556
556
  children: d ? /* @__PURE__ */ o(O, { children: [
557
- /* @__PURE__ */ t(_, { className: "mr-2 h-4 w-4 animate-spin" }),
557
+ /* @__PURE__ */ t(H, { className: "mr-2 h-4 w-4 animate-spin" }),
558
558
  "Saving..."
559
559
  ] }) : i
560
560
  }
@@ -582,7 +582,7 @@ function dt({
582
582
  case "failed":
583
583
  return /* @__PURE__ */ t(et, { className: "mt-0.5 h-5 w-5 shrink-0 text-destructive" });
584
584
  default:
585
- return /* @__PURE__ */ t(_, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
585
+ return /* @__PURE__ */ t(H, { className: "text-foreground-muted mt-0.5 h-5 w-5 shrink-0 animate-spin" });
586
586
  }
587
587
  }, u = B(e.status), n = (() => {
588
588
  switch (e.status) {
@@ -659,7 +659,7 @@ function dt({
659
659
  ] });
660
660
  }
661
661
  function ut() {
662
- const { authToken: e, tokenProps: a } = z(), m = T((p) => p.activeExports), { clearCompleted: c, removeExport: d, updateExport: u } = Y(), [n, l] = D(!1), [f, i] = D(!1), g = Array.from(m.values()).sort(
662
+ const { authToken: e, tokenProps: a } = z(), m = T((p) => p.activeExports), { clearCompleted: c, removeExport: d, updateExport: u } = Q(), [n, l] = D(!1), [f, i] = D(!1), g = Array.from(m.values()).sort(
663
663
  (p, y) => y.startedAt.getTime() - p.startedAt.getTime()
664
664
  ), x = g.some(
665
665
  (p) => p.status === "completed" || p.status === "failed"
@@ -672,7 +672,7 @@ function ut() {
672
672
  await Promise.all(
673
673
  A.map(async (w) => {
674
674
  try {
675
- const s = await Q(p, y, w.id);
675
+ const s = await K(p, y, w.id);
676
676
  let r;
677
677
  if (s.status === "completed")
678
678
  try {
@@ -800,11 +800,11 @@ function ut() {
800
800
  function At({
801
801
  variant: e
802
802
  }) {
803
- const a = T((f) => f.activeExports), m = _e(), c = a.size > 0, d = Array.from(a.values()).some(
803
+ const a = T((f) => f.activeExports), m = He(), c = a.size > 0, d = Array.from(a.values()).some(
804
804
  (f) => f.status === "completed" || f.status === "failed"
805
805
  ), n = m > 0 ? m > 9 ? "9+" : String(m) : null;
806
- return /* @__PURE__ */ o(je, { children: [
807
- /* @__PURE__ */ t(He, { asChild: !0, children: /* @__PURE__ */ o(
806
+ return /* @__PURE__ */ o(_e, { children: [
807
+ /* @__PURE__ */ t(je, { asChild: !0, children: /* @__PURE__ */ o(
808
808
  I,
809
809
  {
810
810
  variant: e ?? "ghost",
@@ -828,11 +828,11 @@ function At({
828
828
  }
829
829
  export {
830
830
  yt as A,
831
- dt as E,
831
+ ut as E,
832
832
  At as N,
833
833
  Ct as U,
834
834
  wt as V,
835
- ut as a,
835
+ dt as a,
836
836
  xt as b,
837
837
  Nt as c,
838
838
  bt as u
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("./index-BkklWRT2.js"),c=require("react"),le=require("./use-visual-utils-C_9jH8bu.js"),he=require("./use-role-aware-display-preferences-ASD7plKm.js");/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("./index-CRJ97-41.js"),c=require("react"),le=require("./use-visual-utils-DX-4Hwoe.js"),he=require("./use-role-aware-display-preferences-1U-ed07h.js");/**
2
2
  * @license lucide-react v0.453.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,15 +1,15 @@
1
1
  import { jsx as e, jsxs as n, Fragment as ge } from "react/jsx-runtime";
2
- import { bS as _e, u as ie, a1 as Ge, W as le, c5 as qe, c6 as Ke, B as U, c7 as pe, c8 as We, c9 as Ye, ca as Ze, cb as $e, cc as Z, H as de, cd as Je, ce as Qe, cf as Xe, cg as ve, ch as De, ci as ke, cj as et, c as re, ck as be, e as ce, cl as ye, cm as Se, cn as tt, au as Ee, as as Ve, co as Le, cp as Ae, cq as Oe, cr as Te, cs as Re, ct as Pe, cu as Ue, cv as je, cw as Fe, cx as st, cy as nt, bO as ae, l as at, cz as Ie, cA as it, m as rt, n as ot, o as lt, p as dt, q as ct, L as Ce, cB as fe, G as ut, cC as ht, cD as mt, cE as pt, bZ as ft, b_ as gt, b$ as Dt, c1 as xt, cF as Nt, cG as wt } from "./index-Cxj7oWTZ.js";
2
+ import { bS as _e, u as ie, a1 as Ge, W as le, c5 as qe, c6 as Ke, c as re, B as U, c7 as pe, c8 as We, c9 as Ye, ca as Ze, cb as $e, cc as Z, H as de, cd as Je, ce as Qe, cf as Xe, cg as ve, ch as De, ci as ke, cj as et, ck as ye, e as ce, cl as be, cm as Se, cn as tt, an as Ee, aj as Ve, co as Le, cp as Ae, cq as Oe, cr as Te, cs as Re, ct as Pe, cu as Ue, cv as je, cw as Fe, cx as st, cy as nt, ah as ae, l as at, cz as Ie, cA as it, m as rt, n as ot, o as lt, p as dt, q as ct, L as Ce, cB as fe, G as ut, cC as ht, cD as mt, cE as pt, bZ as ft, b_ as gt, b$ as Dt, c1 as xt, cF as Nt, cG as wt } from "./index-Cr-d0ray.js";
3
3
  import vt, { useRef as Ct, useEffect as oe, useState as N } from "react";
4
- import { a as Me } from "./use-visual-utils-873PUDHm.js";
5
- import { u as bt } from "./use-role-aware-display-preferences-DP-Ng_hb.js";
4
+ import { a as Me } from "./use-visual-utils-DxigSU7y.js";
5
+ import { u as yt } from "./use-role-aware-display-preferences-DOA8kcfK.js";
6
6
  /**
7
7
  * @license lucide-react v0.453.0 - ISC
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
11
  */
12
- const yt = _e("FolderOpen", [
12
+ const bt = _e("FolderOpen", [
13
13
  [
14
14
  "path",
15
15
  {
@@ -61,12 +61,12 @@ function Vt({
61
61
  onDuplicateVisual: i,
62
62
  // onTogglePrivacy,
63
63
  onShareVisual: w,
64
- formatDate: b
64
+ formatDate: y
65
65
  }) {
66
66
  var T, F, v, z;
67
- const { selectVisual: u } = le(), h = qe(t.id), d = Et(t.id), A = ie((f) => f.isVisualEditing), { isConsoleMode: O } = Ke(), x = vt.useRef(null), [V, y] = N(!1), [S, M] = N(!1);
67
+ const { selectVisual: u } = le(), h = qe(t.id), d = Et(t.id), A = ie((f) => f.isVisualEditing), { isConsoleMode: O } = Ke(), x = vt.useRef(null), [V, b] = N(!1), [S, M] = N(!1);
68
68
  oe(() => {
69
- p ? (y(!0), M(!0)) : S && (y(!1), M(!1));
69
+ p ? (b(!0), M(!0)) : S && (b(!1), M(!1));
70
70
  }, [p, S]), oe(() => {
71
71
  d && x.current && x.current.scrollIntoView({
72
72
  behavior: "smooth",
@@ -131,7 +131,7 @@ function Vt({
131
131
  {
132
132
  modal: !1,
133
133
  open: V,
134
- onOpenChange: y,
134
+ onOpenChange: b,
135
135
  children: [
136
136
  /* @__PURE__ */ e(Ye, { asChild: !0, children: /* @__PURE__ */ e(
137
137
  U,
@@ -164,7 +164,7 @@ function Vt({
164
164
  f.stopPropagation(), r == null || r(t);
165
165
  },
166
166
  children: [
167
- /* @__PURE__ */ e(yt, { className: "mr-2 h-3 w-3" }),
167
+ /* @__PURE__ */ e(bt, { className: "mr-2 h-3 w-3" }),
168
168
  "Open"
169
169
  ]
170
170
  }
@@ -231,7 +231,7 @@ function Vt({
231
231
  ] }),
232
232
  /* @__PURE__ */ n("div", { className: "flex items-center gap-1", children: [
233
233
  /* @__PURE__ */ e(et, { className: "h-3 w-3" }),
234
- /* @__PURE__ */ e("span", { children: b(t.lastModified) })
234
+ /* @__PURE__ */ e("span", { children: y(t.lastModified) })
235
235
  ] })
236
236
  ] })
237
237
  ] })
@@ -249,11 +249,11 @@ function Vt({
249
249
  function Lt({ searchQuery: t }) {
250
250
  const [g, p] = N(!1), [o, r] = N(
251
251
  null
252
- ), [c, D] = N(!1), [i, w] = N(null), [b, u] = N(null), [h, d] = N(
252
+ ), [c, D] = N(!1), [i, w] = N(null), [y, u] = N(null), [h, d] = N(
253
253
  null
254
254
  ), { selectVisual: A } = le(), { handleEditLibraryVisual: O, handleAddLibraryVisual: x } = Me(), {
255
255
  resources: V,
256
- isLoading: y,
256
+ isLoading: b,
257
257
  isError: S,
258
258
  isFetching: M,
259
259
  updateResource: j,
@@ -262,7 +262,7 @@ function Lt({ searchQuery: t }) {
262
262
  isDeleting: v,
263
263
  isDuplicating: z,
264
264
  isUpdating: f
265
- } = be(() => {
265
+ } = ye(() => {
266
266
  D(!1), w(null);
267
267
  });
268
268
  ce();
@@ -283,7 +283,7 @@ function Lt({ searchQuery: t }) {
283
283
  startUpdating: ue,
284
284
  stopUpdating: E,
285
285
  isUpdating: te
286
- } = ye(), J = (a, L, l) => {
286
+ } = be(), J = (a, L, l) => {
287
287
  var ne;
288
288
  const k = Object.fromEntries(
289
289
  Object.entries(L).filter(([, P]) => P !== void 0)
@@ -344,7 +344,7 @@ function Lt({ searchQuery: t }) {
344
344
  }
345
345
  });
346
346
  };
347
- return y ? /* @__PURE__ */ e(ze, {}) : S ? /* @__PURE__ */ e(Se, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ n("div", { className: "py-8 text-center text-muted-foreground", children: [
347
+ return b ? /* @__PURE__ */ e(ze, {}) : S ? /* @__PURE__ */ e(Se, { className: "w-full flex-1 pr-2", children: /* @__PURE__ */ n("div", { className: "py-8 text-center text-muted-foreground", children: [
348
348
  /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: "Failed to load visuals" }),
349
349
  /* @__PURE__ */ e(
350
350
  U,
@@ -373,7 +373,7 @@ function Lt({ searchQuery: t }) {
373
373
  onTogglePrivacy: K,
374
374
  onShareVisual: X,
375
375
  isDeleting: v,
376
- isDuplicating: b === a.id,
376
+ isDuplicating: y === a.id,
377
377
  formatDate: q
378
378
  },
379
379
  a.id
@@ -448,11 +448,11 @@ function At({
448
448
  onDuplicateDashboard: D,
449
449
  onShareDashboard: i,
450
450
  formatDate: w,
451
- onDashboardItemClick: b
451
+ onDashboardItemClick: y
452
452
  }) {
453
- var y, S;
454
- const { selectDashboard: u } = le(), h = st(t.id), { userContext: d, isLoading: A } = ce(), O = ((y = d == null ? void 0 : d.permissions) == null ? void 0 : y.canEdit) ?? !1, x = A || !O, V = () => {
455
- u(t), o(t.id), b == null || b(t.id);
453
+ var b, S;
454
+ const { selectDashboard: u } = le(), h = st(t.id), { userContext: d, isLoading: A } = ce(), O = ((b = d == null ? void 0 : d.permissions) == null ? void 0 : b.canEdit) ?? !1, x = A || !O, V = () => {
455
+ u(t), o(t.id), y == null || y(t.id);
456
456
  };
457
457
  return /* @__PURE__ */ e(
458
458
  "div",
@@ -510,7 +510,7 @@ function Tt(t) {
510
510
  var xe;
511
511
  const { searchQuery: g, onLoadDashboard: p, onEditDashboard: o, onDashboardItemClick: r } = t, [c, D] = N(!1), [i, w] = N(
512
512
  null
513
- ), [b, u] = N(!1), [h, d] = N(null), [A, O] = N(null), [x, V] = N(null), y = ae(
513
+ ), [y, u] = N(!1), [h, d] = N(null), [A, O] = N(null), [x, V] = N(null), b = ae(
514
514
  (s) => s.lastSelectedDashboard
515
515
  ), S = ae(
516
516
  (s) => s.selectedDashboard
@@ -519,7 +519,7 @@ function Tt(t) {
519
519
  ), j = ae(
520
520
  (s) => s.actions.clearSelectedDashboard
521
521
  ), { tokenProps: T, id: F } = at();
522
- bt();
522
+ yt();
523
523
  const {
524
524
  resources: v,
525
525
  isLoading: z,
@@ -535,7 +535,7 @@ function Tt(t) {
535
535
  } = Ie(() => {
536
536
  u(!1);
537
537
  const s = h == null ? void 0 : h.id;
538
- d(null), (S == null ? void 0 : S.id) === s && (!(T != null && T.dashboard_id) && !F ? j() : y && y.id !== s && M(y));
538
+ d(null), (S == null ? void 0 : S.id) === s && (!(T != null && T.dashboard_id) && !F ? j() : b && b.id !== s && M(b));
539
539
  }), { currentUser: H, userContext: _ } = ce(), Q = ((xe = _ == null ? void 0 : _.permissions) == null ? void 0 : xe.canCreateDashboard) ?? !1, K = v.filter(
540
540
  (s) => {
541
541
  var R, m;
@@ -559,7 +559,7 @@ function Tt(t) {
559
559
  startUpdating: L,
560
560
  stopUpdating: l,
561
561
  isUpdating: k
562
- } = ye(), se = (s, R, m) => {
562
+ } = be(), se = (s, R, m) => {
563
563
  var we;
564
564
  const he = Object.fromEntries(
565
565
  Object.entries(R).filter(([, G]) => G !== void 0)
@@ -649,7 +649,7 @@ function Tt(t) {
649
649
  /* @__PURE__ */ e(
650
650
  Ae,
651
651
  {
652
- open: b,
652
+ open: y,
653
653
  onOpenChange: (s) => {
654
654
  !s && E || (u(s), s || d(null));
655
655
  },
@@ -708,10 +708,10 @@ function Rt({
708
708
  }, [t]);
709
709
  const w = () => {
710
710
  r.trim() && p({ title: r, description: D });
711
- }, b = (u) => {
711
+ }, y = (u) => {
712
712
  g(u);
713
713
  };
714
- return /* @__PURE__ */ e(rt, { open: t, onOpenChange: b, children: /* @__PURE__ */ n(ot, { children: [
714
+ return /* @__PURE__ */ e(rt, { open: t, onOpenChange: y, children: /* @__PURE__ */ n(ot, { children: [
715
715
  /* @__PURE__ */ n(lt, { children: [
716
716
  /* @__PURE__ */ e(dt, { children: "Create New Visual" }),
717
717
  /* @__PURE__ */ e(ct, { children: "Add a new visual to your library. You can configure it after creation." })
@@ -752,7 +752,7 @@ function Rt({
752
752
  U,
753
753
  {
754
754
  variant: "outline",
755
- onClick: () => b(!1),
755
+ onClick: () => y(!1),
756
756
  disabled: o,
757
757
  children: "Cancel"
758
758
  }
@@ -781,17 +781,17 @@ function Mt({
781
781
  var W, Y;
782
782
  const c = ie(
783
783
  (C) => C.isDashboardEditing
784
- ), [D, i] = N(!1), [w, b] = N(""), [u, h] = N(!1), { currentUser: d, userContext: A } = ce(), O = ((W = A == null ? void 0 : A.permissions) == null ? void 0 : W.canCreateDashboard) ?? !1, { onCreateSuccess: x } = ht({
784
+ ), [D, i] = N(!1), [w, y] = N(""), [u, h] = N(!1), { currentUser: d, userContext: A } = ce(), O = ((W = A == null ? void 0 : A.permissions) == null ? void 0 : W.canCreateDashboard) ?? !1, { onCreateSuccess: x } = ht({
785
785
  onDashboardSelect: o
786
- }), { selectVisual: V } = le(), { handleEditLibraryVisual: y } = Me(), {
786
+ }), { selectVisual: V } = le(), { handleEditLibraryVisual: b } = Me(), {
787
787
  createResource: S,
788
788
  isCreating: M,
789
789
  refetch: j
790
- } = Ie(), { createResource: T, isCreating: F } = be(
790
+ } = Ie(), { createResource: T, isCreating: F } = ye(
791
791
  void 0,
792
792
  // onDeleteSuccess (not needed here)
793
793
  (C) => {
794
- i(!1), C && (V(C), y(C));
794
+ i(!1), C && (V(C), b(C));
795
795
  }
796
796
  ), v = r === "overlay", z = c ? "New Visual" : "New", f = c ? "New Visual" : "New Dashboard", $ = c ? "Search visuals..." : "Search dashboards...", q = c ? "Collapse visuals panel" : "Collapse dashboard panel", B = ((d == null ? void 0 : d.name) ?? "").trim(), I = ((d == null ? void 0 : d.email) ?? "").trim(), E = B && B.toLowerCase() !== "undefined" ? B : I || "Current user", te = ((Y = E.charAt(0)) == null ? void 0 : Y.toUpperCase()) || "?", J = I && I.toLowerCase() !== "undefined" ? I : "", H = St(g, {
797
797
  enabled: t && v
@@ -860,7 +860,7 @@ function Mt({
860
860
  {
861
861
  placeholder: $,
862
862
  value: w,
863
- onChange: (C) => b(C.target.value),
863
+ onChange: (C) => y(C.target.value),
864
864
  className: "h-8 border-muted-foreground/20 bg-background text-sm focus-visible:border-muted-foreground/40 focus-visible:ring-0 focus-visible:ring-offset-0",
865
865
  autoFocus: !0
866
866
  }
@@ -0,0 +1,59 @@
1
+ import { useState as C, useRef as m, useEffect as h, useCallback as W } from "react";
2
+ const j = (n) => JSON.stringify(n, (e, r) => !r || typeof r != "object" || Array.isArray(r) ? r : Object.keys(r).sort().reduce((c, l) => (c[l] = r[l], c), {}));
3
+ function O(n, e, r = 300, c = 1e3, l) {
4
+ const [D, f] = C(!1), [I, o] = C(!1), d = m(null), t = m(0), T = m(n), w = m(e), u = l || j;
5
+ h(() => {
6
+ t.current += 1;
7
+ const a = t.current, k = T.current !== n, R = w.current !== e;
8
+ if (T.current = n, w.current = e, e === null) {
9
+ const i = window.setTimeout(() => {
10
+ a === t.current && (f(!1), o(!1));
11
+ }, 0);
12
+ return () => clearTimeout(i);
13
+ }
14
+ if (R && !k) {
15
+ const i = window.setTimeout(() => {
16
+ if (a === t.current) {
17
+ const s = u(n), y = u(e);
18
+ f(s !== y), o(!1);
19
+ }
20
+ }, 0);
21
+ return () => clearTimeout(i);
22
+ }
23
+ const g = k ? window.setTimeout(() => {
24
+ a === t.current && o(!0);
25
+ }, 0) : null, z = setTimeout(() => {
26
+ const i = window.requestIdleCallback || ((s) => window.setTimeout(
27
+ () => s({
28
+ didTimeout: !1,
29
+ timeRemaining: () => 50
30
+ }),
31
+ 1
32
+ ));
33
+ d.current = i(
34
+ (s) => {
35
+ if (s.timeRemaining() > 0 || s.didTimeout) {
36
+ if (a !== t.current) return;
37
+ const y = u(n), P = u(e);
38
+ f(y !== P), o(!1);
39
+ }
40
+ },
41
+ { timeout: c }
42
+ );
43
+ }, r);
44
+ return () => {
45
+ g !== null && clearTimeout(g), clearTimeout(z), d.current !== null && ((window.cancelIdleCallback || window.clearTimeout)(d.current), d.current = null);
46
+ };
47
+ }, [n, e, r, c, u]);
48
+ const b = W(() => {
49
+ f(!1), o(!1);
50
+ }, []);
51
+ return {
52
+ isDirty: e === null ? !1 : D,
53
+ isDirtyPending: e === null ? !1 : I,
54
+ resetDirty: b
55
+ };
56
+ }
57
+ export {
58
+ O as u
59
+ };
@@ -0,0 +1 @@
1
+ "use strict";const t=require("react"),z=n=>JSON.stringify(n,(e,r)=>!r||typeof r!="object"||Array.isArray(r)?r:Object.keys(r).sort().reduce((u,f)=>(u[f]=r[f],u),{}));function P(n,e,r=300,u=1e3,f){const[R,d]=t.useState(!1),[g,o]=t.useState(!1),a=t.useRef(null),i=t.useRef(0),T=t.useRef(n),w=t.useRef(e),l=f||z;t.useEffect(()=>{i.current+=1;const m=i.current,k=T.current!==n,b=w.current!==e;if(T.current=n,w.current=e,e===null){const s=window.setTimeout(()=>{m===i.current&&(d(!1),o(!1))},0);return()=>clearTimeout(s)}if(b&&!k){const s=window.setTimeout(()=>{if(m===i.current){const c=l(n),y=l(e);d(c!==y),o(!1)}},0);return()=>clearTimeout(s)}const D=k?window.setTimeout(()=>{m===i.current&&o(!0)},0):null,I=setTimeout(()=>{const s=window.requestIdleCallback||(c=>window.setTimeout(()=>c({didTimeout:!1,timeRemaining:()=>50}),1));a.current=s(c=>{if(c.timeRemaining()>0||c.didTimeout){if(m!==i.current)return;const y=l(n),h=l(e);d(y!==h),o(!1)}},{timeout:u})},r);return()=>{D!==null&&clearTimeout(D),clearTimeout(I),a.current!==null&&((window.cancelIdleCallback||window.clearTimeout)(a.current),a.current=null)}},[n,e,r,u,l]);const C=t.useCallback(()=>{d(!1),o(!1)},[]);return{isDirty:e===null?!1:R,isDirtyPending:e===null?!1:g,resetDirty:C}}exports.useDebouncedDirtyCheck=P;
@@ -1 +1 @@
1
- "use strict";const a=require("./index-BkklWRT2.js"),n=require("react");function f(){const{displayPreferences:c,shouldShowElement:o}=a.useDisplayPreferences(),{currentUser:e,userContext:s}=a.useCurrentUserInfo(),i=n.useMemo(()=>a.getRoleBasedDisplayOverrides(e),[e]),t=n.useMemo(()=>r=>i&&i[r]!==void 0&&i[r]===!1?!1:o(r),[i,o,c]),p=n.useMemo(()=>{var r,d,l,u,h;return{canEdit:((r=s==null?void 0:s.permissions)==null?void 0:r.canEdit)??a.canUserEdit(e),canUseFilters:((d=s==null?void 0:s.permissions)==null?void 0:d.canEdit)??a.canUserUseFilters(e),canManageDashboards:((l=s==null?void 0:s.permissions)==null?void 0:l.canCreateDashboard)??a.canUserManageDashboards(e),canCreateDashboards:((u=s==null?void 0:s.permissions)==null?void 0:u.canCreateDashboard)??a.canUserCreateDashboards(e),canAccessVisuals:((h=s==null?void 0:s.permissions)==null?void 0:h.canEdit)??a.canUserAccessVisuals(e)}},[e,s]);return{displayPreferences:c,shouldShowElement:t,permissions:p,currentUser:e}}exports.useRoleAwareDisplayPreferences=f;
1
+ "use strict";const a=require("./index-CRJ97-41.js"),n=require("react");function f(){const{displayPreferences:c,shouldShowElement:o}=a.useDisplayPreferences(),{currentUser:e,userContext:s}=a.useCurrentUserInfo(),i=n.useMemo(()=>a.getRoleBasedDisplayOverrides(e),[e]),t=n.useMemo(()=>r=>i&&i[r]!==void 0&&i[r]===!1?!1:o(r),[i,o,c]),p=n.useMemo(()=>{var r,d,l,u,h;return{canEdit:((r=s==null?void 0:s.permissions)==null?void 0:r.canEdit)??a.canUserEdit(e),canUseFilters:((d=s==null?void 0:s.permissions)==null?void 0:d.canEdit)??a.canUserUseFilters(e),canManageDashboards:((l=s==null?void 0:s.permissions)==null?void 0:l.canCreateDashboard)??a.canUserManageDashboards(e),canCreateDashboards:((u=s==null?void 0:s.permissions)==null?void 0:u.canCreateDashboard)??a.canUserCreateDashboards(e),canAccessVisuals:((h=s==null?void 0:s.permissions)==null?void 0:h.canEdit)??a.canUserAccessVisuals(e)}},[e,s]);return{displayPreferences:c,shouldShowElement:t,permissions:p,currentUser:e}}exports.useRoleAwareDisplayPreferences=f;
@@ -1,4 +1,4 @@
1
- import { b as m, e as t, g as D, f as U, h as b, i as u, j as E, k as g } from "./index-Cxj7oWTZ.js";
1
+ import { b as m, e as t, g as D, f as U, h as b, i as u, j as E, k as g } from "./index-Cr-d0ray.js";
2
2
  import { useMemo as i } from "react";
3
3
  function S() {
4
4
  const { displayPreferences: n, shouldShowElement: c } = m(), { currentUser: a, userContext: s } = t(), r = i(