react-semaphor 0.1.570 → 0.1.572
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assistant-context/index.js +1 -1
- package/dist/brand-studio/index.js +2 -2
- package/dist/briefings/index.js +1 -1
- package/dist/chunks/{assistant-chat-B-Ddyy8b.js → assistant-chat-DF1-q82n.js} +182 -182
- package/dist/chunks/{bookmark-impact-DCYD-6Fr.js → bookmark-impact-fdj8fY9i.js} +2 -2
- package/dist/chunks/{bookmark-state-CflS88gq.js → bookmark-state-BEl_G9vr.js} +54 -54
- package/dist/chunks/{brand-B4BdpAB_.js → brand-BoUV0iHF.js} +1 -1
- package/dist/chunks/{card-filter-builder-0VvKmRst.js → card-filter-builder-BFT21WI-.js} +3 -3
- package/dist/chunks/{dashboard-briefing-launcher-B-quOOOQ.js → dashboard-briefing-launcher-DDXzTYuA.js} +873 -906
- package/dist/chunks/{dashboard-controls-Caodx80b.js → dashboard-controls-BwKQEoGp.js} +103 -103
- package/dist/chunks/{dashboard-DxGIr1vZ.js → dashboard-jUhZ7T4f.js} +1 -1
- package/dist/chunks/{dashboard-json-Ct-AGDHF.js → dashboard-json-B3fR1_Oc.js} +1 -1
- package/dist/chunks/{dates-B9mL8BHE.js → dates-DKkSDWHe.js} +5 -5
- package/dist/chunks/{edit-Bpdh_P_a.js → edit-9df1zOWe.js} +3 -3
- package/dist/chunks/{edit-dashboard-visual-DeDTuYB5.js → edit-dashboard-visual-DGZABdS-.js} +8 -8
- package/dist/chunks/{filter-reach-copy-BSY33ro5.js → filter-reach-copy-CWHV7GSb.js} +1195 -1261
- package/dist/chunks/{index-y3HUzRNk.js → index-CeeY4wjE.js} +2 -2
- package/dist/chunks/{report-preferences-dialog-Yvhv3WX2.js → report-preferences-dialog-R3EGbxfu.js} +725 -801
- package/dist/chunks/{resolve-dashboard-input-context-Lkbwycwe.js → resolve-dashboard-input-context-CBQF3obr.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-DC_TEd6y.js → saved-dashboard-context-_-7LKeK1.js} +3 -3
- package/dist/chunks/{semaphor-ready-indicator-ByFvqHEO.js → semaphor-ready-indicator-CEbA4CFb.js} +19866 -19758
- package/dist/chunks/{shelf-drop-preview-context-CjoVaK6J.js → shelf-drop-preview-context-UqUUVSJq.js} +259 -259
- package/dist/chunks/{stored-dashboard-C0hekXiI.js → stored-dashboard-Bk3iCXtp.js} +131 -131
- package/dist/chunks/{variable-draft-9-huI1h4.js → variable-draft-ggS3X7FG.js} +2 -2
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +1919 -1853
- package/dist/index.js +147 -147
- package/dist/surfboard/index.js +2 -2
- package/dist/types/index.js +1 -1
- package/dist/types/lib/stores/dashboard-store.d.ts +1 -1
- package/dist/types/lib/types/common-types.d.ts +0 -50
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +1 -2
- package/dist/types/shared/dashboard-authoring/dashboard-style/layers.d.ts +6 -5
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +1 -2
- package/package.json +1 -1
package/dist/chunks/{report-preferences-dialog-Yvhv3WX2.js → report-preferences-dialog-R3EGbxfu.js}
RENAMED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as i, Fragment as te, jsxs as h } from "react/jsx-runtime";
|
|
2
2
|
import * as p from "react";
|
|
3
|
-
import
|
|
4
|
-
import { b as
|
|
5
|
-
import { j as
|
|
6
|
-
import {
|
|
7
|
-
import { r as
|
|
8
|
-
import { s as
|
|
9
|
-
import { B as
|
|
3
|
+
import Mt, { useMemo as ee, useState as F, useEffect as Z, lazy as Ie, Suspense as Se, useRef as H, useLayoutEffect as Ce, useCallback as W, Activity as jt, useId as de } from "react";
|
|
4
|
+
import { b as Bt, b1 as qe, bd as $t, be as Vt, u as U, bf as bt, L as Wt, J as Kt, bg as qt, bh as Ht, bi as Gt, bj as Jt, bk as ge, bl as vt, bm as Qe, bn as Xt, a6 as ye, a5 as Zt, bo as Yt, bp as Qt, a7 as et, a8 as ea, bq as ta, E as aa, F as ra, S as na, B as sa, a as la, U as ia, br as oa, D as da, A as ca, C as ua, bs as ma, bt as fa, bu as ha, bv as pa, bw as ba, bx as va, by as tt, bz as ke, bA as ga, bB as He, bC as G, bD as ya, bE as wa, bF as Sa, bG as xa, bH as Ca } from "./semaphor-ready-indicator-CEbA4CFb.js";
|
|
5
|
+
import { j as Ea, c as j } from "./pickers-DkqmtnTL.js";
|
|
6
|
+
import { J as Ia } from "./bookmark-state-BEl_G9vr.js";
|
|
7
|
+
import { r as Na, a as gt } from "./availability-Bp5Gfu1I.js";
|
|
8
|
+
import { s as Ta } from "./resolve-dashboard-input-context-CBQF3obr.js";
|
|
9
|
+
import { B as K, Z as ka, _ as Aa, $ as Da, a0 as Ra, a1 as Pa, a2 as _a, a3 as ie, H as Q, a4 as he, s as pe, e as La, f as za, h as Fa, j as at, L as yt, y as Fe, z as Oe, A as Ue, D as Me, E as X, T as Oa, k as Ua, l as rt, n as nt } from "./style-sheet-parts-C7qGZuH1.js";
|
|
10
10
|
import "./validators-B8fpdinG.js";
|
|
11
11
|
import "./matrix-operation-contract-DCVinw1o.js";
|
|
12
12
|
import "./analytics-base-schemas-BaIQrEzX.js";
|
|
13
|
-
import { parseValueFormatPreferencesResponse as
|
|
14
|
-
import {
|
|
15
|
-
import { a as
|
|
13
|
+
import { parseValueFormatPreferencesResponse as Ma, canonicalizeSupportedLocale as wt, getSupportedCurrencyCodes as ja, canonicalizeSupportedCurrencyCode as Ba } from "../value-format-preferences/index.js";
|
|
14
|
+
import { e as $a } from "./filter-reach-copy-CWHV7GSb.js";
|
|
15
|
+
import { a as Va } from "./report-runtime-context-BhPzLTbS.js";
|
|
16
16
|
import { ah as we, ao as ce } from "./temporal-input-presentation-CqbJjIuu.js";
|
|
17
|
-
function
|
|
18
|
-
return /* @__PURE__ */
|
|
17
|
+
function Wa() {
|
|
18
|
+
return /* @__PURE__ */ i(
|
|
19
19
|
"div",
|
|
20
20
|
{
|
|
21
21
|
role: "dashboard-plus-main",
|
|
22
22
|
className: "flex min-h-0 grow basis-0 overflow-hidden",
|
|
23
|
-
children: /* @__PURE__ */
|
|
23
|
+
children: /* @__PURE__ */ i("section", { className: "flex min-h-0 grow basis-0 flex-col overflow-hidden", children: /* @__PURE__ */ i(Bt, {}) })
|
|
24
24
|
}
|
|
25
25
|
);
|
|
26
26
|
}
|
|
27
|
-
const
|
|
28
|
-
function
|
|
29
|
-
return
|
|
27
|
+
const Ka = /* @__PURE__ */ new Set(["iat", "exp", "nbf", "jti"]);
|
|
28
|
+
function qa(e) {
|
|
29
|
+
return Ta(
|
|
30
30
|
Object.fromEntries(
|
|
31
|
-
Object.entries(e ?? {}).filter(([a]) => !
|
|
31
|
+
Object.entries(e ?? {}).filter(([a]) => !Ka.has(a))
|
|
32
32
|
)
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function Ha(e) {
|
|
36
36
|
var t;
|
|
37
37
|
const a = e == null ? void 0 : e.config;
|
|
38
|
-
return
|
|
38
|
+
return Na({
|
|
39
39
|
features: ((t = a == null ? void 0 : a.projectFeatures) == null ? void 0 : t.features) ?? {},
|
|
40
|
-
config: { enabled:
|
|
40
|
+
config: { enabled: gt(a).enabled },
|
|
41
41
|
identity: {
|
|
42
42
|
orgUserId: e == null ? void 0 : e.orgUserId,
|
|
43
43
|
tenantId: e == null ? void 0 : e.tenantId,
|
|
@@ -46,128 +46,61 @@ function Xa(e) {
|
|
|
46
46
|
modelConfigured: !0
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
-
let
|
|
50
|
-
function
|
|
51
|
-
|
|
52
|
-
const { name: t, layout: n } =
|
|
53
|
-
return { ...
|
|
49
|
+
let st = 0;
|
|
50
|
+
function lt(e, a) {
|
|
51
|
+
st += 1;
|
|
52
|
+
const { name: t, layout: n } = gt(a == null ? void 0 : a.config);
|
|
53
|
+
return { ...Vt(n), id: st, callerKey: e, assistantName: t };
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function Ga({
|
|
56
56
|
children: e,
|
|
57
57
|
authToken: a
|
|
58
58
|
}) {
|
|
59
|
-
const t =
|
|
60
|
-
() => a === void 0 ? t.tokenProps :
|
|
59
|
+
const t = qe(), n = ee(
|
|
60
|
+
() => a === void 0 ? t.tokenProps : Xa(a),
|
|
61
61
|
[a, t.tokenProps]
|
|
62
|
-
), r = ee(() =>
|
|
63
|
-
() =>
|
|
62
|
+
), r = ee(() => qa(n), [n]), l = ee(
|
|
63
|
+
() => Ha(n).available,
|
|
64
64
|
[n]
|
|
65
|
-
), [s,
|
|
66
|
-
s.callerKey !== r &&
|
|
67
|
-
const
|
|
68
|
-
return /* @__PURE__ */
|
|
65
|
+
), [s, o] = F(() => lt(r, n));
|
|
66
|
+
s.callerKey !== r && o(lt(r, n)), Za(s);
|
|
67
|
+
const f = ee(() => ({ instance: s, available: l }), [s, l]);
|
|
68
|
+
return /* @__PURE__ */ i($t.Provider, { value: f, children: e });
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
return
|
|
70
|
+
function Ja({ children: e }) {
|
|
71
|
+
return bt() ? /* @__PURE__ */ i(te, { children: e }) : /* @__PURE__ */ i(Ga, { children: e });
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function Xa(e) {
|
|
74
74
|
if (!(e != null && e.accessToken)) return {};
|
|
75
75
|
try {
|
|
76
|
-
return
|
|
76
|
+
return Ea(e.accessToken);
|
|
77
77
|
} catch {
|
|
78
78
|
return {};
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
|
|
81
|
+
function Za(e) {
|
|
82
|
+
Z(() => {
|
|
83
83
|
const a = (n, r) => {
|
|
84
84
|
const l = e.store.getState().focus;
|
|
85
|
-
l && !
|
|
85
|
+
l && !Ya(l, n, r) && e.clearFocus();
|
|
86
86
|
}, t = U.getState();
|
|
87
87
|
return a(t.selectedSheetId, t.dashboard), U.subscribe((n, r) => {
|
|
88
88
|
(n.selectedSheetId !== r.selectedSheetId || n.dashboard !== r.dashboard) && a(n.selectedSheetId, n.dashboard), n.isVisualEditing && !r.isVisualEditing && e.leaveBeside();
|
|
89
89
|
});
|
|
90
90
|
}, [e]);
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function Ya(e, a, t) {
|
|
93
93
|
if ((a ?? null) !== e.sheetId) return !1;
|
|
94
|
-
const n = t ?
|
|
94
|
+
const n = t ? Ia(t, e.cardId) : void 0;
|
|
95
95
|
return !!n && n.sheet.id === e.sheetId;
|
|
96
96
|
}
|
|
97
|
-
const
|
|
98
|
-
function
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
function nr(e, a) {
|
|
102
|
-
return e === "always" ? !0 : e === "menu" ? !1 : e === "md" ? a !== "sm" : a === "lg";
|
|
103
|
-
}
|
|
104
|
-
const sr = {
|
|
105
|
-
width: "lg",
|
|
106
|
-
hasOverflowMenu: !1,
|
|
107
|
-
overflowItems: [],
|
|
108
|
-
register: () => () => {
|
|
109
|
-
},
|
|
110
|
-
openOverflowId: null,
|
|
111
|
-
setOpenOverflowId: () => {
|
|
112
|
-
},
|
|
113
|
-
anchorSlot: null,
|
|
114
|
-
setAnchorSlot: () => {
|
|
115
|
-
}
|
|
116
|
-
}, Xe = $t(sr);
|
|
117
|
-
function En() {
|
|
118
|
-
const [e, a] = L("lg"), t = j(null);
|
|
119
|
-
return { measure: K((r) => {
|
|
120
|
-
var s;
|
|
121
|
-
if ((s = t.current) == null || s.disconnect(), t.current = null, !r || typeof ResizeObserver > "u") return;
|
|
122
|
-
const l = (i) => a(rr(i));
|
|
123
|
-
l(r.getBoundingClientRect().width), t.current = new ResizeObserver(([i]) => {
|
|
124
|
-
i && l(i.contentRect.width);
|
|
125
|
-
}), t.current.observe(r);
|
|
126
|
-
}, []), width: e };
|
|
127
|
-
}
|
|
128
|
-
function lr() {
|
|
129
|
-
return qe(Xe).width;
|
|
130
|
-
}
|
|
131
|
-
function Nn() {
|
|
132
|
-
return qe(Xe).overflowItems;
|
|
133
|
-
}
|
|
134
|
-
function Tn(e, a, t) {
|
|
135
|
-
const n = qe(Xe), r = n.hasOverflowMenu && !nr(a, n.width), { register: l, setOpenOverflowId: s } = n, i = t == null ? void 0 : t.label, m = t == null ? void 0 : t.hint, u = t == null ? void 0 : t.checked, y = (t == null ? void 0 : t.order) ?? 0, c = j(t == null ? void 0 : t.icon);
|
|
136
|
-
c.current = t == null ? void 0 : t.icon;
|
|
137
|
-
const v = j(t == null ? void 0 : t.onSelect);
|
|
138
|
-
v.current = t == null ? void 0 : t.onSelect;
|
|
139
|
-
const f = j(t == null ? void 0 : t.onOpen);
|
|
140
|
-
return f.current = t == null ? void 0 : t.onOpen, X(() => {
|
|
141
|
-
if (!(!r || i === void 0))
|
|
142
|
-
return l({
|
|
143
|
-
id: e,
|
|
144
|
-
label: i,
|
|
145
|
-
icon: c.current,
|
|
146
|
-
hint: m,
|
|
147
|
-
checked: u,
|
|
148
|
-
order: y,
|
|
149
|
-
onSelect: () => {
|
|
150
|
-
if (v.current) return v.current();
|
|
151
|
-
window.setTimeout(() => {
|
|
152
|
-
var w;
|
|
153
|
-
s(e), (w = f.current) == null || w.call(f);
|
|
154
|
-
}, 0);
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
}, [u, r, m, e, i, y, l, s]), {
|
|
158
|
-
collapsed: r,
|
|
159
|
-
popoverOpen: n.openOverflowId === e,
|
|
160
|
-
setPopoverOpen: (w) => s(w ? e : null),
|
|
161
|
-
anchorSlot: n.anchorSlot
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
const or = Ee(() => import("./assistant-chat-B-Ddyy8b.js"));
|
|
165
|
-
function kn() {
|
|
166
|
-
const e = Ht(), a = lr();
|
|
97
|
+
const Qa = Ie(() => import("./assistant-chat-DF1-q82n.js"));
|
|
98
|
+
function vn() {
|
|
99
|
+
const e = Wt(), a = Kt();
|
|
167
100
|
if (!e.available) return null;
|
|
168
101
|
const t = a !== "lg";
|
|
169
102
|
return /* @__PURE__ */ h(
|
|
170
|
-
|
|
103
|
+
K,
|
|
171
104
|
{
|
|
172
105
|
variant: e.isOpen ? "secondary" : "outline",
|
|
173
106
|
size: "xs",
|
|
@@ -177,151 +110,151 @@ function kn() {
|
|
|
177
110
|
onClick: e.toggle,
|
|
178
111
|
className: t ? "w-7 px-0" : void 0,
|
|
179
112
|
children: [
|
|
180
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ i(qt, { className: "h-3.5 w-3.5" }),
|
|
181
114
|
!t && e.assistantName
|
|
182
115
|
]
|
|
183
116
|
}
|
|
184
117
|
);
|
|
185
118
|
}
|
|
186
|
-
const
|
|
119
|
+
const er = {
|
|
187
120
|
// Docked widths are the viewer's (the resize handle), applied as a style.
|
|
188
121
|
"docked-right": "relative shrink-0 border-l border-border",
|
|
189
122
|
"docked-left": "relative order-first shrink-0 border-r border-border",
|
|
190
123
|
centered: "absolute left-1/2 top-1/2 z-30 h-[min(80%,760px)] w-[min(640px,calc(100%-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-card border border-border shadow-lg",
|
|
191
124
|
"full-page": "absolute inset-0 z-30"
|
|
192
|
-
},
|
|
193
|
-
function
|
|
194
|
-
const a =
|
|
195
|
-
(a == null ? void 0 : a.instance.store) ??
|
|
196
|
-
|
|
125
|
+
}, tr = "absolute left-0 top-0 z-30 max-h-[var(--assistant-beside-max-h)] max-w-[var(--assistant-beside-max-w)] rounded-card border border-border shadow-lg", ar = 640, fe = 8;
|
|
126
|
+
function rr({ surface: e = "dashboard" } = {}) {
|
|
127
|
+
const a = bt(), { isOpen: t, mounted: n, storedLayout: r, width: l, beside: s, besideSize: o, focusCardId: f, askCount: u } = Ht(
|
|
128
|
+
(a == null ? void 0 : a.instance.store) ?? Jt,
|
|
129
|
+
Gt((y) => {
|
|
197
130
|
var C;
|
|
198
131
|
return {
|
|
199
|
-
isOpen:
|
|
200
|
-
mounted:
|
|
201
|
-
storedLayout:
|
|
202
|
-
width:
|
|
203
|
-
beside:
|
|
204
|
-
besideSize:
|
|
205
|
-
focusCardId: (C =
|
|
206
|
-
askCount:
|
|
132
|
+
isOpen: y.isOpen,
|
|
133
|
+
mounted: y.mounted,
|
|
134
|
+
storedLayout: y.layout,
|
|
135
|
+
width: y.width,
|
|
136
|
+
beside: y.beside,
|
|
137
|
+
besideSize: y.besideSize,
|
|
138
|
+
focusCardId: (C = y.focus) == null ? void 0 : C.cardId,
|
|
139
|
+
askCount: y.askCount
|
|
207
140
|
};
|
|
208
141
|
})
|
|
209
|
-
),
|
|
210
|
-
(
|
|
211
|
-
), v =
|
|
212
|
-
if (!(a != null && a.available) || !n && !
|
|
213
|
-
const
|
|
142
|
+
), w = e === "none", c = U(
|
|
143
|
+
(y) => s && t && f && !w ? nr(y.dashboard, y.selectedSheetId, f) : void 0
|
|
144
|
+
), v = sr(c, u);
|
|
145
|
+
if (!(a != null && a.available) || !n && !w) return null;
|
|
146
|
+
const m = w ? "full-page" : v.shown ? "beside-card" : r, S = w || t, b = m === "docked-right" || m === "docked-left";
|
|
214
147
|
return /* @__PURE__ */ h(
|
|
215
148
|
"aside",
|
|
216
149
|
{
|
|
217
150
|
ref: v.setFloating,
|
|
218
151
|
"aria-label": a.instance.assistantName,
|
|
219
152
|
"data-testid": "assistant-panel",
|
|
220
|
-
"data-layout":
|
|
221
|
-
"data-beside-frame":
|
|
222
|
-
"data-beside-side":
|
|
223
|
-
className:
|
|
153
|
+
"data-layout": m,
|
|
154
|
+
"data-beside-frame": m === "beside-card" ? c : void 0,
|
|
155
|
+
"data-beside-side": m === "beside-card" ? v.side : void 0,
|
|
156
|
+
className: j(
|
|
224
157
|
"flex-col bg-background",
|
|
225
|
-
|
|
226
|
-
|
|
158
|
+
m === "beside-card" ? tr : er[m],
|
|
159
|
+
S ? "flex" : "hidden"
|
|
227
160
|
),
|
|
228
|
-
style:
|
|
161
|
+
style: m === "beside-card" ? { ...v.style, width: o.width, height: o.height } : (
|
|
229
162
|
// The saved width, never more than the share of the dashboard's area the
|
|
230
163
|
// handle allows, however the area is sized now or later (P4-10).
|
|
231
|
-
b ? { width: l, maxWidth: `${
|
|
164
|
+
b ? { width: l, maxWidth: `${St * 100}%` } : void 0
|
|
232
165
|
),
|
|
233
|
-
onKeyDown:
|
|
234
|
-
if (
|
|
235
|
-
|
|
166
|
+
onKeyDown: m === "beside-card" ? (y) => {
|
|
167
|
+
if (y.key !== "Escape" || y.defaultPrevented || !(y.target instanceof Node) || !y.currentTarget.contains(y.target)) return;
|
|
168
|
+
y.preventDefault();
|
|
236
169
|
const C = v.cardActions();
|
|
237
170
|
a.instance.close(), C == null || C.focus();
|
|
238
171
|
} : void 0,
|
|
239
172
|
children: [
|
|
240
|
-
b ? /* @__PURE__ */
|
|
241
|
-
|
|
242
|
-
/* @__PURE__ */
|
|
173
|
+
b ? /* @__PURE__ */ i(or, { instance: a.instance, side: m === "docked-left" ? "right" : "left", width: l }) : null,
|
|
174
|
+
m === "beside-card" ? /* @__PURE__ */ i(ir, { instance: a.instance, size: o, side: v.handleSide }) : null,
|
|
175
|
+
/* @__PURE__ */ i(Se, { fallback: null, children: /* @__PURE__ */ i(Qa, { instance: a.instance, surface: e, placement: m }, a.instance.id) })
|
|
243
176
|
]
|
|
244
177
|
}
|
|
245
178
|
);
|
|
246
179
|
}
|
|
247
|
-
function
|
|
180
|
+
function nr(e, a, t) {
|
|
248
181
|
var r, l, s;
|
|
249
|
-
const n = (r = e.sheets) == null ? void 0 : r.find((
|
|
250
|
-
return (s = (l = n == null ? void 0 : n.frames) == null ? void 0 : l.find((
|
|
251
|
-
var
|
|
252
|
-
return (
|
|
182
|
+
const n = (r = e.sheets) == null ? void 0 : r.find((o) => o.id === a);
|
|
183
|
+
return (s = (l = n == null ? void 0 : n.frames) == null ? void 0 : l.find((o) => {
|
|
184
|
+
var f;
|
|
185
|
+
return (f = o.cards) == null ? void 0 : f.some((u) => u.id === t);
|
|
253
186
|
})) == null ? void 0 : s.id;
|
|
254
187
|
}
|
|
255
|
-
function
|
|
256
|
-
var
|
|
257
|
-
const [t, n] =
|
|
188
|
+
function sr(e, a) {
|
|
189
|
+
var S;
|
|
190
|
+
const [t, n] = F(void 0), [r, l] = F(void 0), s = H(a);
|
|
258
191
|
Ce(() => {
|
|
259
192
|
s.current = a;
|
|
260
193
|
});
|
|
261
|
-
const
|
|
194
|
+
const o = r === a ? null : t, { refs: f, elements: u, floatingStyles: w, middlewareData: c, isPositioned: v } = ka({
|
|
262
195
|
strategy: "absolute",
|
|
263
|
-
placement:
|
|
196
|
+
placement: o ?? "right-start",
|
|
264
197
|
middleware: [
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
padding:
|
|
269
|
-
apply: ({ availableWidth: b, availableHeight:
|
|
270
|
-
C.floating.style.setProperty("--assistant-beside-max-w", `${Math.max(0, b)}px`), C.floating.style.setProperty("--assistant-beside-max-h", `${Math.max(0,
|
|
198
|
+
Aa(fe),
|
|
199
|
+
Da({ padding: fe }),
|
|
200
|
+
Ra({
|
|
201
|
+
padding: fe,
|
|
202
|
+
apply: ({ availableWidth: b, availableHeight: y, elements: C }) => {
|
|
203
|
+
C.floating.style.setProperty("--assistant-beside-max-w", `${Math.max(0, b)}px`), C.floating.style.setProperty("--assistant-beside-max-h", `${Math.max(0, y)}px`);
|
|
271
204
|
}
|
|
272
205
|
}),
|
|
273
|
-
|
|
206
|
+
Pa()
|
|
274
207
|
],
|
|
275
|
-
whileElementsMounted: (b,
|
|
276
|
-
const
|
|
277
|
-
n(
|
|
208
|
+
whileElementsMounted: (b, y, C) => _a(b, y, () => {
|
|
209
|
+
const P = lr(b, y);
|
|
210
|
+
n(P), P === null && l(s.current), C();
|
|
278
211
|
})
|
|
279
|
-
}),
|
|
212
|
+
}), m = u.floating;
|
|
280
213
|
return Ce(() => {
|
|
281
|
-
|
|
282
|
-
}, [e,
|
|
283
|
-
shown: e !== void 0 &&
|
|
284
|
-
setFloating:
|
|
214
|
+
f.setReference(e ? it(m == null ? void 0 : m.parentElement, e) : null);
|
|
215
|
+
}, [e, m, f]), {
|
|
216
|
+
shown: e !== void 0 && o !== null && u.reference !== null,
|
|
217
|
+
setFloating: f.setFloating,
|
|
285
218
|
style: {
|
|
286
|
-
...
|
|
219
|
+
...w,
|
|
287
220
|
// Not before it is placed (its side is chosen first): never a flash at
|
|
288
221
|
// the row's corner. With the card wholly out of view, it goes with the card.
|
|
289
|
-
...!v || (
|
|
222
|
+
...!v || (S = c.hide) != null && S.referenceHidden ? { visibility: "hidden" } : {}
|
|
290
223
|
},
|
|
291
224
|
/** The side the conversation took; the size handle sits on the corner away from the card. */
|
|
292
|
-
side:
|
|
293
|
-
handleSide:
|
|
225
|
+
side: o ?? void 0,
|
|
226
|
+
handleSide: o === "left-start" ? "left" : "right",
|
|
294
227
|
/** The card's ··· menu, where Ask lives and focus returns on Escape. */
|
|
295
228
|
cardActions: () => {
|
|
296
229
|
var b;
|
|
297
|
-
return e ? (b =
|
|
230
|
+
return e ? (b = it(m == null ? void 0 : m.parentElement, e)) == null ? void 0 : b.querySelector("[data-card-actions]") : null;
|
|
298
231
|
}
|
|
299
232
|
};
|
|
300
233
|
}
|
|
301
|
-
function
|
|
234
|
+
function it(e, a) {
|
|
302
235
|
return e ? Array.from(e.querySelectorAll("[data-frame-id]")).find((t) => t.dataset.frameId === a) ?? null : null;
|
|
303
236
|
}
|
|
304
|
-
function
|
|
237
|
+
function lr(e, a) {
|
|
305
238
|
const t = a.parentElement;
|
|
306
239
|
if (!t || !e.isConnected) return null;
|
|
307
240
|
const n = t.getBoundingClientRect();
|
|
308
|
-
if (n.width <
|
|
309
|
-
const r = e.getBoundingClientRect(), { min: l } =
|
|
241
|
+
if (n.width < ar) return null;
|
|
242
|
+
const r = e.getBoundingClientRect(), { min: l } = vt, s = (o, f) => o >= l.width + 2 * fe && f >= l.height + 2 * fe;
|
|
310
243
|
return s(n.right - r.right, n.height) ? "right-start" : s(r.left - n.left, n.height) ? "left-start" : s(n.width, n.bottom - r.bottom) ? "bottom-start" : null;
|
|
311
244
|
}
|
|
312
|
-
function
|
|
245
|
+
function ir({
|
|
313
246
|
instance: e,
|
|
314
247
|
size: a,
|
|
315
248
|
side: t
|
|
316
249
|
}) {
|
|
317
|
-
const n =
|
|
318
|
-
const
|
|
250
|
+
const n = H(void 0), r = t === "left" ? -1 : 1, l = (s) => {
|
|
251
|
+
const o = n.current;
|
|
319
252
|
return {
|
|
320
|
-
width:
|
|
321
|
-
height:
|
|
253
|
+
width: o.start.width + r * (s.clientX - o.x),
|
|
254
|
+
height: o.start.height + (s.clientY - o.y)
|
|
322
255
|
};
|
|
323
256
|
};
|
|
324
|
-
return /* @__PURE__ */
|
|
257
|
+
return /* @__PURE__ */ i(
|
|
325
258
|
"div",
|
|
326
259
|
{
|
|
327
260
|
role: "separator",
|
|
@@ -329,8 +262,8 @@ function pr({
|
|
|
329
262
|
tabIndex: 0,
|
|
330
263
|
title: "Drag to resize. Double-click to reset.",
|
|
331
264
|
onPointerDown: (s) => {
|
|
332
|
-
var
|
|
333
|
-
s.preventDefault(), (
|
|
265
|
+
var o, f;
|
|
266
|
+
s.preventDefault(), (f = (o = s.currentTarget).setPointerCapture) == null || f.call(o, s.pointerId), n.current = { x: s.clientX, y: s.clientY, start: a };
|
|
334
267
|
},
|
|
335
268
|
onPointerMove: (s) => {
|
|
336
269
|
n.current && e.setBesideSize(l(s));
|
|
@@ -342,50 +275,50 @@ function pr({
|
|
|
342
275
|
n.current = void 0;
|
|
343
276
|
},
|
|
344
277
|
onKeyDown: (s) => {
|
|
345
|
-
const
|
|
278
|
+
const o = {
|
|
346
279
|
ArrowLeft: { width: -r * le, height: 0 },
|
|
347
280
|
ArrowRight: { width: r * le, height: 0 },
|
|
348
281
|
ArrowUp: { width: 0, height: -le },
|
|
349
282
|
ArrowDown: { width: 0, height: le }
|
|
350
283
|
}[s.key];
|
|
351
|
-
|
|
284
|
+
o && (s.preventDefault(), e.setBesideSize({ width: a.width + o.width, height: a.height + o.height }, { save: !0 }));
|
|
352
285
|
},
|
|
353
|
-
onDoubleClick: () => e.setBesideSize(
|
|
354
|
-
className:
|
|
286
|
+
onDoubleClick: () => e.setBesideSize(vt.default, { save: !0 }),
|
|
287
|
+
className: j(
|
|
355
288
|
"absolute bottom-0 z-10 h-3 w-3 touch-none outline-none hover:bg-primary/30 focus-visible:bg-primary/40",
|
|
356
289
|
t === "left" ? "left-0 cursor-nesw-resize rounded-bl-card" : "right-0 cursor-nwse-resize rounded-br-card"
|
|
357
290
|
)
|
|
358
291
|
}
|
|
359
292
|
);
|
|
360
293
|
}
|
|
361
|
-
const le = 16,
|
|
362
|
-
function
|
|
363
|
-
const n =
|
|
364
|
-
var
|
|
365
|
-
const v = (
|
|
366
|
-
return v ? v *
|
|
294
|
+
const le = 16, St = 0.6;
|
|
295
|
+
function or({ instance: e, side: a, width: t }) {
|
|
296
|
+
const n = H(void 0), r = (c) => {
|
|
297
|
+
var m, S;
|
|
298
|
+
const v = (S = (m = c.closest("aside")) == null ? void 0 : m.parentElement) == null ? void 0 : S.clientWidth;
|
|
299
|
+
return v ? v * St : ge.max;
|
|
367
300
|
}, l = (c) => {
|
|
368
301
|
var v;
|
|
369
302
|
return ((v = c.closest("aside")) == null ? void 0 : v.getBoundingClientRect().width) || t;
|
|
370
303
|
}, s = (c) => {
|
|
371
304
|
const v = n.current;
|
|
372
305
|
if (!v) return t;
|
|
373
|
-
const
|
|
374
|
-
return
|
|
375
|
-
},
|
|
376
|
-
var v,
|
|
377
|
-
c.preventDefault(), (
|
|
378
|
-
},
|
|
306
|
+
const m = c - v.startX;
|
|
307
|
+
return Qe(v.startWidth + (a === "left" ? -m : m), v.maxForArea);
|
|
308
|
+
}, o = (c) => {
|
|
309
|
+
var v, m;
|
|
310
|
+
c.preventDefault(), (m = (v = c.currentTarget).setPointerCapture) == null || m.call(v, c.pointerId), n.current = { startX: c.clientX, startWidth: l(c.currentTarget), maxForArea: r(c.currentTarget) };
|
|
311
|
+
}, f = (c) => {
|
|
379
312
|
n.current && e.setWidth(s(c.clientX));
|
|
380
313
|
}, u = (c) => {
|
|
381
314
|
n.current && (e.setWidth(s(c.clientX), { save: !0 }), n.current = void 0);
|
|
382
|
-
},
|
|
315
|
+
}, w = (c) => {
|
|
383
316
|
if (c.key !== "ArrowLeft" && c.key !== "ArrowRight") return;
|
|
384
317
|
c.preventDefault();
|
|
385
318
|
const v = c.key === "ArrowLeft" == (a === "left");
|
|
386
|
-
e.setWidth(
|
|
319
|
+
e.setWidth(Qe(l(c.currentTarget) + (v ? le : -le), r(c.currentTarget)), { save: !0 });
|
|
387
320
|
};
|
|
388
|
-
return /* @__PURE__ */
|
|
321
|
+
return /* @__PURE__ */ i(
|
|
389
322
|
"div",
|
|
390
323
|
{
|
|
391
324
|
role: "separator",
|
|
@@ -396,22 +329,22 @@ function vr({ instance: e, side: a, width: t }) {
|
|
|
396
329
|
"aria-valuemax": ge.max,
|
|
397
330
|
tabIndex: 0,
|
|
398
331
|
title: "Drag to resize. Double-click to reset.",
|
|
399
|
-
onPointerDown:
|
|
400
|
-
onPointerMove:
|
|
332
|
+
onPointerDown: o,
|
|
333
|
+
onPointerMove: f,
|
|
401
334
|
onPointerUp: u,
|
|
402
335
|
onPointerCancel: u,
|
|
403
|
-
onKeyDown:
|
|
336
|
+
onKeyDown: w,
|
|
404
337
|
onDoubleClick: () => e.setWidth(ge.default, { save: !0 }),
|
|
405
|
-
className:
|
|
338
|
+
className: j(
|
|
406
339
|
"absolute inset-y-0 z-10 w-1.5 cursor-col-resize touch-none outline-none hover:bg-primary/30 focus-visible:bg-primary/40",
|
|
407
340
|
a === "left" ? "-left-[3px]" : "-right-[3px]"
|
|
408
341
|
)
|
|
409
342
|
}
|
|
410
343
|
);
|
|
411
344
|
}
|
|
412
|
-
function
|
|
413
|
-
const a =
|
|
414
|
-
return
|
|
345
|
+
function dr(e) {
|
|
346
|
+
const a = Xt();
|
|
347
|
+
return W(
|
|
415
348
|
async (t, n) => {
|
|
416
349
|
const r = U.getState();
|
|
417
350
|
if (r.isVisualEditing)
|
|
@@ -419,32 +352,32 @@ function br(e) {
|
|
|
419
352
|
if (!e()) return { ok: !1, reason: "not_editable", message: ye.no_save };
|
|
420
353
|
if (r.dashboard !== t.basedOn)
|
|
421
354
|
return { ok: !1, reason: "dashboard_changed", message: ye.dashboard_changed };
|
|
422
|
-
const l =
|
|
355
|
+
const l = $a(t.basedOn, t.operations, t.context);
|
|
423
356
|
if (!l.ok) return { ok: !1, reason: "refused", message: l.failedAt.message };
|
|
424
357
|
const s = { domainsById: {} };
|
|
425
|
-
for (const
|
|
426
|
-
const
|
|
358
|
+
for (const o of l.queryFrames) {
|
|
359
|
+
const f = await a(o, { reuseLoaded: !0 }).catch((u) => {
|
|
427
360
|
console.warn("Applying the change without refreshed semantic metadata:", u);
|
|
428
361
|
});
|
|
429
|
-
|
|
362
|
+
Zt(s, f);
|
|
430
363
|
}
|
|
431
364
|
return n != null && n.stillWanted && !n.stillWanted() ? { ok: !1, reason: "dropped" } : e() ? U.getState().actions.applyProposal({ ...t, semanticExecutionPayload: s }) : { ok: !1, reason: "not_editable", message: ye.no_save };
|
|
432
365
|
},
|
|
433
366
|
[e, a]
|
|
434
367
|
);
|
|
435
368
|
}
|
|
436
|
-
function
|
|
437
|
-
const { canEditDashboard: a, isInspectionMode: t } =
|
|
369
|
+
function cr(e) {
|
|
370
|
+
const { canEditDashboard: a, isInspectionMode: t } = Yt(), n = Qt(), r = U(et), l = e && n && a === !0 && !t, s = H(l);
|
|
438
371
|
Ce(() => {
|
|
439
372
|
s.current = l;
|
|
440
373
|
});
|
|
441
|
-
const
|
|
442
|
-
() => s.current &&
|
|
374
|
+
const o = W(
|
|
375
|
+
() => s.current && et(U.getState()),
|
|
443
376
|
[]
|
|
444
377
|
);
|
|
445
|
-
return { canChange: l && r, canChangeNow:
|
|
378
|
+
return { canChange: l && r, canChangeNow: o };
|
|
446
379
|
}
|
|
447
|
-
const
|
|
380
|
+
const xt = {
|
|
448
381
|
dashboard_changed: "Not applied: the dashboard on screen changed after this change was prepared.",
|
|
449
382
|
not_editable: "Not applied: the dashboard can't be changed on screen right now (the editor is open, or Save isn't shown).",
|
|
450
383
|
expired: "Not applied: it arrived after the time it had to land.",
|
|
@@ -455,68 +388,68 @@ const It = {
|
|
|
455
388
|
changedSince: "Changed since. Cancel discards every unsaved change.",
|
|
456
389
|
closeEditorToUndo: "Close the editor to undo."
|
|
457
390
|
};
|
|
458
|
-
function
|
|
391
|
+
function ur({
|
|
459
392
|
port: e,
|
|
460
393
|
onLifecycleEvent: a
|
|
461
394
|
}) {
|
|
462
|
-
const { canChange: t, canChangeNow: n } =
|
|
463
|
-
var
|
|
464
|
-
return (
|
|
465
|
-
}), l =
|
|
395
|
+
const { canChange: t, canChangeNow: n } = cr(!0), r = U((m) => {
|
|
396
|
+
var S;
|
|
397
|
+
return (S = m.dashboard) == null ? void 0 : S.id;
|
|
398
|
+
}), l = dr(n), [s, o] = F(null), f = H(/* @__PURE__ */ new Map()), u = H(/* @__PURE__ */ new Map()), w = H(Promise.resolve()), c = H({ apply: l, onLifecycleEvent: a });
|
|
466
399
|
Ce(() => {
|
|
467
400
|
c.current = { apply: l, onLifecycleEvent: a };
|
|
468
|
-
}),
|
|
401
|
+
}), Z(() => {
|
|
469
402
|
e.setScreenState({ eligible: t, ...r ? { dashboardId: r } : {} });
|
|
470
|
-
}, [e, t, r]),
|
|
471
|
-
() => U.subscribe((
|
|
472
|
-
if (
|
|
473
|
-
|
|
403
|
+
}, [e, t, r]), Z(
|
|
404
|
+
() => U.subscribe((m, S) => {
|
|
405
|
+
if (m.editSessionEpoch !== S.editSessionEpoch) {
|
|
406
|
+
f.current.clear(), o(null);
|
|
474
407
|
return;
|
|
475
408
|
}
|
|
476
|
-
if (
|
|
477
|
-
for (const [b,
|
|
478
|
-
|
|
409
|
+
if (m.dashboard !== S.dashboard)
|
|
410
|
+
for (const [b, y] of f.current)
|
|
411
|
+
y !== m.dashboard && f.current.delete(b);
|
|
479
412
|
}),
|
|
480
413
|
[]
|
|
481
|
-
),
|
|
482
|
-
const
|
|
483
|
-
const
|
|
484
|
-
if (!
|
|
485
|
-
const C =
|
|
486
|
-
|
|
414
|
+
), Z(() => {
|
|
415
|
+
const m = (b) => {
|
|
416
|
+
const y = U.getState().dashboard;
|
|
417
|
+
if (!y || y.id !== b.dashboardId) return;
|
|
418
|
+
const C = hr();
|
|
419
|
+
f.current.set(C, y), e.answerCopyRequest({
|
|
487
420
|
kind: "uploaded",
|
|
488
421
|
screenId: e.screenId,
|
|
489
422
|
requestId: b.requestId,
|
|
490
423
|
revisionId: C,
|
|
491
|
-
dashboard:
|
|
424
|
+
dashboard: y
|
|
492
425
|
});
|
|
493
|
-
},
|
|
494
|
-
var g,
|
|
426
|
+
}, S = async (b, y) => {
|
|
427
|
+
var g, I, D;
|
|
495
428
|
const C = u.current.get(b.deliveryId);
|
|
496
429
|
if (C) {
|
|
497
430
|
e.reportOutcome({ screenId: e.screenId, deliveryId: b.deliveryId, outcome: C });
|
|
498
431
|
return;
|
|
499
432
|
}
|
|
500
|
-
const
|
|
501
|
-
let
|
|
502
|
-
if (
|
|
503
|
-
|
|
433
|
+
const P = f.current.get(b.revisionId), z = () => !P || f.current.get(b.revisionId) !== P ? "dashboard_changed" : performance.now() < y + b.applyWithinMs ? null : "expired", O = z();
|
|
434
|
+
let _;
|
|
435
|
+
if (O || !P)
|
|
436
|
+
_ = xe(O ?? "dashboard_changed");
|
|
504
437
|
else {
|
|
505
|
-
let
|
|
506
|
-
const
|
|
507
|
-
{ proposalId: b.proposalId, operations: b.operations, context: b.context, basedOn:
|
|
438
|
+
let E = "expired";
|
|
439
|
+
const q = await c.current.apply(
|
|
440
|
+
{ proposalId: b.proposalId, operations: b.operations, context: b.context, basedOn: P },
|
|
508
441
|
{
|
|
509
442
|
stillWanted: () => {
|
|
510
|
-
const
|
|
511
|
-
return
|
|
443
|
+
const $ = z();
|
|
444
|
+
return $ && (E = $), $ === null;
|
|
512
445
|
}
|
|
513
446
|
}
|
|
514
447
|
);
|
|
515
|
-
|
|
448
|
+
_ = fr(q, E);
|
|
516
449
|
}
|
|
517
|
-
if (u.current.set(b.deliveryId,
|
|
450
|
+
if (u.current.set(b.deliveryId, _), e.reportOutcome({ screenId: e.screenId, deliveryId: b.deliveryId, outcome: _ }), _.status !== "applied") return;
|
|
518
451
|
const N = ((g = U.getState().dashboard) == null ? void 0 : g.id) ?? "";
|
|
519
|
-
|
|
452
|
+
o({ deliveryId: b.deliveryId, proposalId: b.proposalId, summary: b.summary, dashboardId: N, words: null }), (D = (I = c.current).onLifecycleEvent) == null || D.call(I, {
|
|
520
453
|
type: "dashboard:change-applied",
|
|
521
454
|
dashboardId: N,
|
|
522
455
|
payload: { deliveryId: b.deliveryId, summary: b.summary }
|
|
@@ -524,29 +457,29 @@ function yr({
|
|
|
524
457
|
};
|
|
525
458
|
return e.subscribe((b) => {
|
|
526
459
|
if (b.type === "copy_request") {
|
|
527
|
-
|
|
460
|
+
m(b);
|
|
528
461
|
return;
|
|
529
462
|
}
|
|
530
|
-
const
|
|
531
|
-
|
|
532
|
-
() =>
|
|
463
|
+
const y = performance.now();
|
|
464
|
+
w.current = w.current.then(
|
|
465
|
+
() => S(b, y).catch((C) => console.error("[live-screen] a delivery failed", C))
|
|
533
466
|
);
|
|
534
467
|
});
|
|
535
468
|
}, [e]);
|
|
536
|
-
const v =
|
|
537
|
-
var
|
|
469
|
+
const v = W(() => {
|
|
470
|
+
var S, b;
|
|
538
471
|
if (!s) return;
|
|
539
|
-
const
|
|
540
|
-
|
|
472
|
+
const m = U.getState().actions.undoProposal(s.proposalId);
|
|
473
|
+
m.ok ? ((b = (S = c.current).onLifecycleEvent) == null || b.call(S, {
|
|
541
474
|
type: "dashboard:change-undone",
|
|
542
475
|
dashboardId: s.dashboardId,
|
|
543
476
|
payload: { deliveryId: s.deliveryId, summary: s.summary }
|
|
544
|
-
}),
|
|
477
|
+
}), o(null)) : m.reason === "changed_since" ? o({ ...s, words: "changed_since" }) : m.reason === "not_editable" ? o({ ...s, words: "not_editable" }) : o(null);
|
|
545
478
|
}, [s]);
|
|
546
|
-
return s ? /* @__PURE__ */
|
|
479
|
+
return s ? /* @__PURE__ */ i(mr, { note: s, onUndo: v }) : null;
|
|
547
480
|
}
|
|
548
|
-
function
|
|
549
|
-
const t = U((s) =>
|
|
481
|
+
function mr({ note: e, onUndo: a }) {
|
|
482
|
+
const t = U((s) => ea(s, e.proposalId)), n = U((s) => s.isVisualEditing);
|
|
550
483
|
if (t === "none" && e.words === null) return null;
|
|
551
484
|
const r = e.words === "changed_since" || t === "changed_since", l = r ? "changed_since" : e.words === "not_editable" ? "not_editable" : t;
|
|
552
485
|
return /* @__PURE__ */ h(
|
|
@@ -562,9 +495,9 @@ function wr({ note: e, onUndo: a }) {
|
|
|
562
495
|
r ? `. ${ue.changedSince}` : e.words === "not_editable" ? `. ${ue.closeEditorToUndo}` : ""
|
|
563
496
|
] }),
|
|
564
497
|
!r && t === "undoable" ? /* @__PURE__ */ h(te, { children: [
|
|
565
|
-
/* @__PURE__ */
|
|
498
|
+
/* @__PURE__ */ i("span", { "aria-hidden": "true", children: "·" }),
|
|
566
499
|
/* @__PURE__ */ h(
|
|
567
|
-
|
|
500
|
+
K,
|
|
568
501
|
{
|
|
569
502
|
variant: "outline",
|
|
570
503
|
size: "xs",
|
|
@@ -573,7 +506,7 @@ function wr({ note: e, onUndo: a }) {
|
|
|
573
506
|
title: n ? ue.closeEditorToUndo : void 0,
|
|
574
507
|
onClick: a,
|
|
575
508
|
children: [
|
|
576
|
-
/* @__PURE__ */
|
|
509
|
+
/* @__PURE__ */ i(ta, { className: "h-3 w-3" }),
|
|
577
510
|
ue.undo
|
|
578
511
|
]
|
|
579
512
|
}
|
|
@@ -583,14 +516,14 @@ function wr({ note: e, onUndo: a }) {
|
|
|
583
516
|
}
|
|
584
517
|
);
|
|
585
518
|
}
|
|
586
|
-
function
|
|
519
|
+
function fr(e, a) {
|
|
587
520
|
if (e.ok) return { status: "applied" };
|
|
588
521
|
switch (e.reason) {
|
|
589
522
|
case "dashboard_changed":
|
|
590
523
|
case "not_editable":
|
|
591
524
|
return xe(e.reason);
|
|
592
525
|
case "refused":
|
|
593
|
-
return { status: "not_applied", reason: "refused", message: (e.message ||
|
|
526
|
+
return { status: "not_applied", reason: "refused", message: (e.message || xt.refused).slice(0, 500) };
|
|
594
527
|
case "dropped":
|
|
595
528
|
return xe(a);
|
|
596
529
|
case "previous_not_applied":
|
|
@@ -598,28 +531,28 @@ function Sr(e, a) {
|
|
|
598
531
|
}
|
|
599
532
|
}
|
|
600
533
|
function xe(e) {
|
|
601
|
-
return { status: "not_applied", reason: e, message:
|
|
534
|
+
return { status: "not_applied", reason: e, message: xt[e] };
|
|
602
535
|
}
|
|
603
|
-
function
|
|
536
|
+
function hr() {
|
|
604
537
|
return globalThis.crypto.randomUUID();
|
|
605
538
|
}
|
|
606
|
-
const
|
|
607
|
-
() => import("./edit-dashboard-visual-
|
|
608
|
-
),
|
|
609
|
-
function
|
|
539
|
+
const pr = Ie(() => import("./dashboard-controls-BwKQEoGp.js")), br = Ie(
|
|
540
|
+
() => import("./edit-dashboard-visual-DGZABdS-.js")
|
|
541
|
+
), vr = Ie(() => import("./dashboard-json-B3fR1_Oc.js"));
|
|
542
|
+
function gn({
|
|
610
543
|
showControls: e = !1,
|
|
611
544
|
showFooter: a = !0,
|
|
612
545
|
liveScreen: t,
|
|
613
546
|
...n
|
|
614
547
|
}) {
|
|
615
|
-
const r = U((
|
|
616
|
-
(
|
|
617
|
-
), { appearance: s, preferences:
|
|
618
|
-
return /* @__PURE__ */
|
|
619
|
-
/* @__PURE__ */
|
|
620
|
-
/* @__PURE__ */ h(
|
|
621
|
-
/* @__PURE__ */
|
|
622
|
-
|
|
548
|
+
const r = U((f) => f.isVisualEditing), l = U(
|
|
549
|
+
(f) => f.showDashboardJSON
|
|
550
|
+
), { appearance: s, preferences: o } = n;
|
|
551
|
+
return /* @__PURE__ */ i(aa, { FallbackComponent: ra, children: /* @__PURE__ */ i(na, { dashboardProps: n, children: /* @__PURE__ */ h(sa, { children: [
|
|
552
|
+
/* @__PURE__ */ i(la, { componentType: "surfboard", componentId: n.id }),
|
|
553
|
+
/* @__PURE__ */ h(ia, { appearance: s, children: [
|
|
554
|
+
/* @__PURE__ */ i(
|
|
555
|
+
oa,
|
|
623
556
|
{
|
|
624
557
|
toastOptions: {
|
|
625
558
|
classNames: {
|
|
@@ -633,65 +566,65 @@ function An({
|
|
|
633
566
|
}
|
|
634
567
|
}
|
|
635
568
|
),
|
|
636
|
-
/* @__PURE__ */ h(
|
|
637
|
-
l && /* @__PURE__ */
|
|
638
|
-
/* @__PURE__ */
|
|
639
|
-
e && /* @__PURE__ */
|
|
640
|
-
t && /* @__PURE__ */
|
|
569
|
+
/* @__PURE__ */ h(da, { preferences: o, children: [
|
|
570
|
+
l && /* @__PURE__ */ i(Se, { fallback: null, children: /* @__PURE__ */ i(vr, {}) }),
|
|
571
|
+
/* @__PURE__ */ i(ca, { children: /* @__PURE__ */ i(Ja, { children: /* @__PURE__ */ h("main", { className: "relative flex h-full w-full flex-col overflow-hidden", children: [
|
|
572
|
+
e && /* @__PURE__ */ i(Se, { fallback: null, children: /* @__PURE__ */ i(pr, {}) }),
|
|
573
|
+
t && /* @__PURE__ */ i(ur, { port: t, onLifecycleEvent: n.onDashboardLifecycleEvent }),
|
|
641
574
|
/* @__PURE__ */ h("div", { className: "relative flex grow overflow-hidden", children: [
|
|
642
|
-
/* @__PURE__ */
|
|
643
|
-
r && /* @__PURE__ */
|
|
644
|
-
/* @__PURE__ */
|
|
575
|
+
/* @__PURE__ */ i("div", { className: "flex min-w-0 flex-1", children: /* @__PURE__ */ h(ua, { ...n, type: "dashboard", children: [
|
|
576
|
+
r && /* @__PURE__ */ i(Se, { fallback: null, children: /* @__PURE__ */ i(br, {}) }),
|
|
577
|
+
/* @__PURE__ */ i(jt, { mode: r ? "hidden" : "visible", children: /* @__PURE__ */ i(Wa, {}) })
|
|
645
578
|
] }) }),
|
|
646
|
-
/* @__PURE__ */
|
|
579
|
+
/* @__PURE__ */ i(rr, {})
|
|
647
580
|
] })
|
|
648
581
|
] }) }) })
|
|
649
582
|
] })
|
|
650
583
|
] })
|
|
651
584
|
] }) }) });
|
|
652
585
|
}
|
|
653
|
-
var
|
|
654
|
-
function
|
|
655
|
-
if (l === a.length) return r === e.length ?
|
|
656
|
-
var
|
|
657
|
-
if (s[
|
|
658
|
-
for (var
|
|
659
|
-
return s[
|
|
586
|
+
var ot = 1, gr = 0.9, yr = 0.8, wr = 0.17, Ae = 0.1, De = 0.999, Sr = 0.9999, xr = 0.99, Cr = /[\\\/_+.#"@\[\(\{&]/, Er = /[\\\/_+.#"@\[\(\{&]/g, Ir = /[\s-]/, Ct = /[\s-]/g;
|
|
587
|
+
function je(e, a, t, n, r, l, s) {
|
|
588
|
+
if (l === a.length) return r === e.length ? ot : xr;
|
|
589
|
+
var o = `${r},${l}`;
|
|
590
|
+
if (s[o] !== void 0) return s[o];
|
|
591
|
+
for (var f = n.charAt(l), u = t.indexOf(f, r), w = 0, c, v, m, S; u >= 0; ) c = je(e, a, t, n, u + 1, l + 1, s), c > w && (u === r ? c *= ot : Cr.test(e.charAt(u - 1)) ? (c *= yr, m = e.slice(r, u - 1).match(Er), m && r > 0 && (c *= Math.pow(De, m.length))) : Ir.test(e.charAt(u - 1)) ? (c *= gr, S = e.slice(r, u - 1).match(Ct), S && r > 0 && (c *= Math.pow(De, S.length))) : (c *= wr, r > 0 && (c *= Math.pow(De, u - r))), e.charAt(u) !== a.charAt(l) && (c *= Sr)), (c < Ae && t.charAt(u - 1) === n.charAt(l + 1) || n.charAt(l + 1) === n.charAt(l) && t.charAt(u - 1) !== n.charAt(l)) && (v = je(e, a, t, n, u + 1, l + 2, s), v * Ae > c && (c = v * Ae)), c > w && (w = c), u = t.indexOf(f, u + 1);
|
|
592
|
+
return s[o] = w, w;
|
|
660
593
|
}
|
|
661
|
-
function
|
|
662
|
-
return e.toLowerCase().replace(
|
|
594
|
+
function dt(e) {
|
|
595
|
+
return e.toLowerCase().replace(Ct, " ");
|
|
663
596
|
}
|
|
664
|
-
function
|
|
665
|
-
return e = t && t.length > 0 ? `${e + " " + t.join(" ")}` : e,
|
|
597
|
+
function Nr(e, a, t) {
|
|
598
|
+
return e = t && t.length > 0 ? `${e + " " + t.join(" ")}` : e, je(e, a, dt(e), dt(a), 0, 0, {});
|
|
666
599
|
}
|
|
667
|
-
var
|
|
600
|
+
var me = '[cmdk-group=""]', Re = '[cmdk-group-items=""]', Tr = '[cmdk-group-heading=""]', Et = '[cmdk-item=""]', ct = `${Et}:not([aria-disabled="true"])`, Be = "cmdk-item-select", ne = "data-value", kr = (e, a, t) => Nr(e, a, t), It = p.createContext(void 0), be = () => p.useContext(It), Nt = p.createContext(void 0), Ge = () => p.useContext(Nt), Tt = p.createContext(void 0), kt = p.forwardRef((e, a) => {
|
|
668
601
|
let t = se(() => {
|
|
669
602
|
var d, T;
|
|
670
603
|
return { search: "", value: (T = (d = e.value) != null ? d : e.defaultValue) != null ? T : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
|
|
671
|
-
}), n = se(() => /* @__PURE__ */ new Set()), r = se(() => /* @__PURE__ */ new Map()), l = se(() => /* @__PURE__ */ new Map()), s = se(() => /* @__PURE__ */ new Set()),
|
|
604
|
+
}), n = se(() => /* @__PURE__ */ new Set()), r = se(() => /* @__PURE__ */ new Map()), l = se(() => /* @__PURE__ */ new Map()), s = se(() => /* @__PURE__ */ new Set()), o = At(e), { label: f, children: u, value: w, onValueChange: c, filter: v, shouldFilter: m, loop: S, disablePointerSelection: b = !1, vimBindings: y = !0, ...C } = e, P = ie(), z = ie(), O = ie(), _ = p.useRef(null), N = Mr();
|
|
672
605
|
ae(() => {
|
|
673
|
-
if (
|
|
674
|
-
let d =
|
|
606
|
+
if (w !== void 0) {
|
|
607
|
+
let d = w.trim();
|
|
675
608
|
t.current.value = d, g.emit();
|
|
676
609
|
}
|
|
677
|
-
}, [
|
|
610
|
+
}, [w]), ae(() => {
|
|
678
611
|
N(6, re);
|
|
679
612
|
}, []);
|
|
680
613
|
let g = p.useMemo(() => ({ subscribe: (d) => (s.current.add(d), () => s.current.delete(d)), snapshot: () => t.current, setState: (d, T, A) => {
|
|
681
|
-
var x,
|
|
614
|
+
var x, R, L, V;
|
|
682
615
|
if (!Object.is(t.current[d], T)) {
|
|
683
|
-
if (t.current[d] = T, d === "search")
|
|
616
|
+
if (t.current[d] = T, d === "search") $(), E(), N(1, q);
|
|
684
617
|
else if (d === "value") {
|
|
685
618
|
if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
|
|
686
|
-
let M = document.getElementById(
|
|
687
|
-
M ? M.focus() : (x = document.getElementById(
|
|
619
|
+
let M = document.getElementById(O);
|
|
620
|
+
M ? M.focus() : (x = document.getElementById(P)) == null || x.focus();
|
|
688
621
|
}
|
|
689
622
|
if (N(7, () => {
|
|
690
623
|
var M;
|
|
691
624
|
t.current.selectedItemId = (M = J()) == null ? void 0 : M.id, g.emit();
|
|
692
|
-
}), A || N(5, re), ((
|
|
625
|
+
}), A || N(5, re), ((R = o.current) == null ? void 0 : R.value) !== void 0) {
|
|
693
626
|
let M = T ?? "";
|
|
694
|
-
(
|
|
627
|
+
(V = (L = o.current).onValueChange) == null || V.call(L, M);
|
|
695
628
|
return;
|
|
696
629
|
}
|
|
697
630
|
}
|
|
@@ -699,104 +632,104 @@ var fe = '[cmdk-group=""]', De = '[cmdk-group-items=""]', Lr = '[cmdk-group-head
|
|
|
699
632
|
}
|
|
700
633
|
}, emit: () => {
|
|
701
634
|
s.current.forEach((d) => d());
|
|
702
|
-
} }), []),
|
|
635
|
+
} }), []), I = p.useMemo(() => ({ value: (d, T, A) => {
|
|
703
636
|
var x;
|
|
704
|
-
T !== ((x = l.current.get(d)) == null ? void 0 : x.value) && (l.current.set(d, { value: T, keywords: A }), t.current.filtered.items.set(d,
|
|
705
|
-
|
|
637
|
+
T !== ((x = l.current.get(d)) == null ? void 0 : x.value) && (l.current.set(d, { value: T, keywords: A }), t.current.filtered.items.set(d, D(T, A)), N(2, () => {
|
|
638
|
+
E(), g.emit();
|
|
706
639
|
}));
|
|
707
640
|
}, item: (d, T) => (n.current.add(d), T && (r.current.has(T) ? r.current.get(T).add(d) : r.current.set(T, /* @__PURE__ */ new Set([d]))), N(3, () => {
|
|
708
|
-
|
|
641
|
+
$(), E(), t.current.value || q(), g.emit();
|
|
709
642
|
}), () => {
|
|
710
643
|
l.current.delete(d), n.current.delete(d), t.current.filtered.items.delete(d);
|
|
711
644
|
let A = J();
|
|
712
645
|
N(4, () => {
|
|
713
|
-
|
|
646
|
+
$(), (A == null ? void 0 : A.getAttribute("id")) === d && q(), g.emit();
|
|
714
647
|
});
|
|
715
648
|
}), group: (d) => (r.current.has(d) || r.current.set(d, /* @__PURE__ */ new Set()), () => {
|
|
716
649
|
l.current.delete(d), r.current.delete(d);
|
|
717
|
-
}), filter: () =>
|
|
718
|
-
function
|
|
650
|
+
}), filter: () => o.current.shouldFilter, label: f || e["aria-label"], getDisablePointerSelection: () => o.current.disablePointerSelection, listId: P, inputId: O, labelId: z, listInnerRef: _ }), []);
|
|
651
|
+
function D(d, T) {
|
|
719
652
|
var A, x;
|
|
720
|
-
let
|
|
721
|
-
return d ?
|
|
653
|
+
let R = (x = (A = o.current) == null ? void 0 : A.filter) != null ? x : kr;
|
|
654
|
+
return d ? R(d, t.current.search, T) : 0;
|
|
722
655
|
}
|
|
723
|
-
function
|
|
724
|
-
if (!t.current.search ||
|
|
656
|
+
function E() {
|
|
657
|
+
if (!t.current.search || o.current.shouldFilter === !1) return;
|
|
725
658
|
let d = t.current.filtered.items, T = [];
|
|
726
659
|
t.current.filtered.groups.forEach((x) => {
|
|
727
|
-
let
|
|
728
|
-
|
|
729
|
-
let M = d.get(
|
|
730
|
-
|
|
731
|
-
}), T.push([x,
|
|
660
|
+
let R = r.current.get(x), L = 0;
|
|
661
|
+
R.forEach((V) => {
|
|
662
|
+
let M = d.get(V);
|
|
663
|
+
L = Math.max(M, L);
|
|
664
|
+
}), T.push([x, L]);
|
|
732
665
|
});
|
|
733
|
-
let A =
|
|
734
|
-
k().sort((x,
|
|
735
|
-
var
|
|
736
|
-
let M = x.getAttribute("id"),
|
|
737
|
-
return ((
|
|
666
|
+
let A = _.current;
|
|
667
|
+
k().sort((x, R) => {
|
|
668
|
+
var L, V;
|
|
669
|
+
let M = x.getAttribute("id"), ve = R.getAttribute("id");
|
|
670
|
+
return ((L = d.get(ve)) != null ? L : 0) - ((V = d.get(M)) != null ? V : 0);
|
|
738
671
|
}).forEach((x) => {
|
|
739
|
-
let
|
|
740
|
-
|
|
741
|
-
}), T.sort((x,
|
|
742
|
-
var
|
|
743
|
-
let
|
|
744
|
-
|
|
672
|
+
let R = x.closest(Re);
|
|
673
|
+
R ? R.appendChild(x.parentElement === R ? x : x.closest(`${Re} > *`)) : A.appendChild(x.parentElement === A ? x : x.closest(`${Re} > *`));
|
|
674
|
+
}), T.sort((x, R) => R[1] - x[1]).forEach((x) => {
|
|
675
|
+
var R;
|
|
676
|
+
let L = (R = _.current) == null ? void 0 : R.querySelector(`${me}[${ne}="${encodeURIComponent(x[0])}"]`);
|
|
677
|
+
L == null || L.parentElement.appendChild(L);
|
|
745
678
|
});
|
|
746
679
|
}
|
|
747
|
-
function
|
|
680
|
+
function q() {
|
|
748
681
|
let d = k().find((A) => A.getAttribute("aria-disabled") !== "true"), T = d == null ? void 0 : d.getAttribute(ne);
|
|
749
682
|
g.setState("value", T || void 0);
|
|
750
683
|
}
|
|
751
|
-
function
|
|
684
|
+
function $() {
|
|
752
685
|
var d, T, A, x;
|
|
753
|
-
if (!t.current.search ||
|
|
686
|
+
if (!t.current.search || o.current.shouldFilter === !1) {
|
|
754
687
|
t.current.filtered.count = n.current.size;
|
|
755
688
|
return;
|
|
756
689
|
}
|
|
757
690
|
t.current.filtered.groups = /* @__PURE__ */ new Set();
|
|
758
|
-
let
|
|
759
|
-
for (let
|
|
760
|
-
let
|
|
761
|
-
t.current.filtered.items.set(
|
|
691
|
+
let R = 0;
|
|
692
|
+
for (let L of n.current) {
|
|
693
|
+
let V = (T = (d = l.current.get(L)) == null ? void 0 : d.value) != null ? T : "", M = (x = (A = l.current.get(L)) == null ? void 0 : A.keywords) != null ? x : [], ve = D(V, M);
|
|
694
|
+
t.current.filtered.items.set(L, ve), ve > 0 && R++;
|
|
762
695
|
}
|
|
763
|
-
for (let [
|
|
764
|
-
t.current.filtered.groups.add(
|
|
696
|
+
for (let [L, V] of r.current) for (let M of V) if (t.current.filtered.items.get(M) > 0) {
|
|
697
|
+
t.current.filtered.groups.add(L);
|
|
765
698
|
break;
|
|
766
699
|
}
|
|
767
|
-
t.current.filtered.count =
|
|
700
|
+
t.current.filtered.count = R;
|
|
768
701
|
}
|
|
769
702
|
function re() {
|
|
770
703
|
var d, T, A;
|
|
771
704
|
let x = J();
|
|
772
|
-
x && (((d = x.parentElement) == null ? void 0 : d.firstChild) === x && ((A = (T = x.closest(
|
|
705
|
+
x && (((d = x.parentElement) == null ? void 0 : d.firstChild) === x && ((A = (T = x.closest(me)) == null ? void 0 : T.querySelector(Tr)) == null || A.scrollIntoView({ block: "nearest" })), x.scrollIntoView({ block: "nearest" }));
|
|
773
706
|
}
|
|
774
707
|
function J() {
|
|
775
708
|
var d;
|
|
776
|
-
return (d =
|
|
709
|
+
return (d = _.current) == null ? void 0 : d.querySelector(`${Et}[aria-selected="true"]`);
|
|
777
710
|
}
|
|
778
711
|
function k() {
|
|
779
712
|
var d;
|
|
780
|
-
return Array.from(((d =
|
|
713
|
+
return Array.from(((d = _.current) == null ? void 0 : d.querySelectorAll(ct)) || []);
|
|
781
714
|
}
|
|
782
|
-
function
|
|
715
|
+
function oe(d) {
|
|
783
716
|
let T = k()[d];
|
|
784
717
|
T && g.setState("value", T.getAttribute(ne));
|
|
785
718
|
}
|
|
786
719
|
function Te(d) {
|
|
787
720
|
var T;
|
|
788
|
-
let A = J(), x = k(),
|
|
789
|
-
(T =
|
|
721
|
+
let A = J(), x = k(), R = x.findIndex((V) => V === A), L = x[R + d];
|
|
722
|
+
(T = o.current) != null && T.loop && (L = R + d < 0 ? x[x.length - 1] : R + d === x.length ? x[0] : x[R + d]), L && g.setState("value", L.getAttribute(ne));
|
|
790
723
|
}
|
|
791
|
-
function
|
|
792
|
-
let T = J(), A = T == null ? void 0 : T.closest(
|
|
793
|
-
for (; A && !x; ) A = d > 0 ?
|
|
724
|
+
function Je(d) {
|
|
725
|
+
let T = J(), A = T == null ? void 0 : T.closest(me), x;
|
|
726
|
+
for (; A && !x; ) A = d > 0 ? Or(A, me) : Ur(A, me), x = A == null ? void 0 : A.querySelector(ct);
|
|
794
727
|
x ? g.setState("value", x.getAttribute(ne)) : Te(d);
|
|
795
728
|
}
|
|
796
|
-
let
|
|
797
|
-
d.preventDefault(), d.metaKey ?
|
|
798
|
-
},
|
|
799
|
-
d.preventDefault(), d.metaKey ?
|
|
729
|
+
let Xe = () => oe(k().length - 1), Ze = (d) => {
|
|
730
|
+
d.preventDefault(), d.metaKey ? Xe() : d.altKey ? Je(1) : Te(1);
|
|
731
|
+
}, Ye = (d) => {
|
|
732
|
+
d.preventDefault(), d.metaKey ? oe(0) : d.altKey ? Je(-1) : Te(-1);
|
|
800
733
|
};
|
|
801
734
|
return p.createElement(Q.div, { ref: a, tabIndex: -1, ...C, "cmdk-root": "", onKeyDown: (d) => {
|
|
802
735
|
var T;
|
|
@@ -805,113 +738,113 @@ var fe = '[cmdk-group=""]', De = '[cmdk-group-items=""]', Lr = '[cmdk-group-head
|
|
|
805
738
|
if (!(d.defaultPrevented || A)) switch (d.key) {
|
|
806
739
|
case "n":
|
|
807
740
|
case "j": {
|
|
808
|
-
|
|
741
|
+
y && d.ctrlKey && Ze(d);
|
|
809
742
|
break;
|
|
810
743
|
}
|
|
811
744
|
case "ArrowDown": {
|
|
812
|
-
|
|
745
|
+
Ze(d);
|
|
813
746
|
break;
|
|
814
747
|
}
|
|
815
748
|
case "p":
|
|
816
749
|
case "k": {
|
|
817
|
-
|
|
750
|
+
y && d.ctrlKey && Ye(d);
|
|
818
751
|
break;
|
|
819
752
|
}
|
|
820
753
|
case "ArrowUp": {
|
|
821
|
-
|
|
754
|
+
Ye(d);
|
|
822
755
|
break;
|
|
823
756
|
}
|
|
824
757
|
case "Home": {
|
|
825
|
-
d.preventDefault(),
|
|
758
|
+
d.preventDefault(), oe(0);
|
|
826
759
|
break;
|
|
827
760
|
}
|
|
828
761
|
case "End": {
|
|
829
|
-
d.preventDefault(),
|
|
762
|
+
d.preventDefault(), Xe();
|
|
830
763
|
break;
|
|
831
764
|
}
|
|
832
765
|
case "Enter": {
|
|
833
766
|
d.preventDefault();
|
|
834
767
|
let x = J();
|
|
835
768
|
if (x) {
|
|
836
|
-
let
|
|
837
|
-
x.dispatchEvent(
|
|
769
|
+
let R = new Event(Be);
|
|
770
|
+
x.dispatchEvent(R);
|
|
838
771
|
}
|
|
839
772
|
}
|
|
840
773
|
}
|
|
841
|
-
} }, p.createElement("label", { "cmdk-label": "", htmlFor:
|
|
842
|
-
}),
|
|
774
|
+
} }, p.createElement("label", { "cmdk-label": "", htmlFor: I.inputId, id: I.labelId, style: Br }, f), Ne(e, (d) => p.createElement(Nt.Provider, { value: g }, p.createElement(It.Provider, { value: I }, d))));
|
|
775
|
+
}), Ar = p.forwardRef((e, a) => {
|
|
843
776
|
var t, n;
|
|
844
|
-
let r =
|
|
777
|
+
let r = ie(), l = p.useRef(null), s = p.useContext(Tt), o = be(), f = At(e), u = (n = (t = f.current) == null ? void 0 : t.forceMount) != null ? n : s == null ? void 0 : s.forceMount;
|
|
845
778
|
ae(() => {
|
|
846
|
-
if (!u) return
|
|
779
|
+
if (!u) return o.item(r, s == null ? void 0 : s.id);
|
|
847
780
|
}, [u]);
|
|
848
|
-
let
|
|
781
|
+
let w = Dt(r, l, [e.value, e.children, l], e.keywords), c = Ge(), v = Y((N) => N.value && N.value === w.current), m = Y((N) => u || o.filter() === !1 ? !0 : N.search ? N.filtered.items.get(r) > 0 : !0);
|
|
849
782
|
p.useEffect(() => {
|
|
850
783
|
let N = l.current;
|
|
851
|
-
if (!(!N || e.disabled)) return N.addEventListener(
|
|
852
|
-
}, [
|
|
853
|
-
function
|
|
784
|
+
if (!(!N || e.disabled)) return N.addEventListener(Be, S), () => N.removeEventListener(Be, S);
|
|
785
|
+
}, [m, e.onSelect, e.disabled]);
|
|
786
|
+
function S() {
|
|
854
787
|
var N, g;
|
|
855
|
-
b(), (g = (N =
|
|
788
|
+
b(), (g = (N = f.current).onSelect) == null || g.call(N, w.current);
|
|
856
789
|
}
|
|
857
790
|
function b() {
|
|
858
|
-
c.setState("value",
|
|
791
|
+
c.setState("value", w.current, !0);
|
|
859
792
|
}
|
|
860
|
-
if (!
|
|
861
|
-
let { disabled:
|
|
862
|
-
return p.createElement(Q.div, { ref: he(l, a), ...
|
|
863
|
-
}),
|
|
864
|
-
let { heading: t, children: n, forceMount: r, ...l } = e, s =
|
|
865
|
-
ae(() =>
|
|
793
|
+
if (!m) return null;
|
|
794
|
+
let { disabled: y, value: C, onSelect: P, forceMount: z, keywords: O, ..._ } = e;
|
|
795
|
+
return p.createElement(Q.div, { ref: he(l, a), ..._, id: r, "cmdk-item": "", role: "option", "aria-disabled": !!y, "aria-selected": !!v, "data-disabled": !!y, "data-selected": !!v, onPointerMove: y || o.getDisablePointerSelection() ? void 0 : b, onClick: y ? void 0 : S }, e.children);
|
|
796
|
+
}), Dr = p.forwardRef((e, a) => {
|
|
797
|
+
let { heading: t, children: n, forceMount: r, ...l } = e, s = ie(), o = p.useRef(null), f = p.useRef(null), u = ie(), w = be(), c = Y((m) => r || w.filter() === !1 ? !0 : m.search ? m.filtered.groups.has(s) : !0);
|
|
798
|
+
ae(() => w.group(s), []), Dt(s, o, [e.value, e.heading, f]);
|
|
866
799
|
let v = p.useMemo(() => ({ id: s, forceMount: r }), [r]);
|
|
867
|
-
return p.createElement(Q.div, { ref: he(
|
|
868
|
-
}),
|
|
800
|
+
return p.createElement(Q.div, { ref: he(o, a), ...l, "cmdk-group": "", role: "presentation", hidden: c ? void 0 : !0 }, t && p.createElement("div", { ref: f, "cmdk-group-heading": "", "aria-hidden": !0, id: u }, t), Ne(e, (m) => p.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": t ? u : void 0 }, p.createElement(Tt.Provider, { value: v }, m))));
|
|
801
|
+
}), Rr = p.forwardRef((e, a) => {
|
|
869
802
|
let { alwaysRender: t, ...n } = e, r = p.useRef(null), l = Y((s) => !s.search);
|
|
870
803
|
return !t && !l ? null : p.createElement(Q.div, { ref: he(r, a), ...n, "cmdk-separator": "", role: "separator" });
|
|
871
|
-
}),
|
|
872
|
-
let { onValueChange: t, ...n } = e, r = e.value != null, l =
|
|
804
|
+
}), Pr = p.forwardRef((e, a) => {
|
|
805
|
+
let { onValueChange: t, ...n } = e, r = e.value != null, l = Ge(), s = Y((u) => u.search), o = Y((u) => u.selectedItemId), f = be();
|
|
873
806
|
return p.useEffect(() => {
|
|
874
807
|
e.value != null && l.setState("search", e.value);
|
|
875
|
-
}, [e.value]), p.createElement(Q.input, { ref: a, ...n, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls":
|
|
808
|
+
}, [e.value]), p.createElement(Q.input, { ref: a, ...n, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": f.listId, "aria-labelledby": f.labelId, "aria-activedescendant": o, id: f.inputId, type: "text", value: r ? e.value : s, onChange: (u) => {
|
|
876
809
|
r || l.setState("search", u.target.value), t == null || t(u.target.value);
|
|
877
810
|
} });
|
|
878
|
-
}),
|
|
879
|
-
let { children: t, label: n = "Suggestions", ...r } = e, l = p.useRef(null), s = p.useRef(null),
|
|
811
|
+
}), _r = p.forwardRef((e, a) => {
|
|
812
|
+
let { children: t, label: n = "Suggestions", ...r } = e, l = p.useRef(null), s = p.useRef(null), o = Y((u) => u.selectedItemId), f = be();
|
|
880
813
|
return p.useEffect(() => {
|
|
881
814
|
if (s.current && l.current) {
|
|
882
|
-
let u = s.current,
|
|
815
|
+
let u = s.current, w = l.current, c, v = new ResizeObserver(() => {
|
|
883
816
|
c = requestAnimationFrame(() => {
|
|
884
|
-
let
|
|
885
|
-
|
|
817
|
+
let m = u.offsetHeight;
|
|
818
|
+
w.style.setProperty("--cmdk-list-height", m.toFixed(1) + "px");
|
|
886
819
|
});
|
|
887
820
|
});
|
|
888
821
|
return v.observe(u), () => {
|
|
889
822
|
cancelAnimationFrame(c), v.unobserve(u);
|
|
890
823
|
};
|
|
891
824
|
}
|
|
892
|
-
}, []), p.createElement(Q.div, { ref: he(l, a), ...r, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant":
|
|
893
|
-
}),
|
|
894
|
-
let { open: t, onOpenChange: n, overlayClassName: r, contentClassName: l, container: s, ...
|
|
895
|
-
return p.createElement(
|
|
896
|
-
}),
|
|
825
|
+
}, []), p.createElement(Q.div, { ref: he(l, a), ...r, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": o, "aria-label": n, id: f.listId }, Ne(e, (u) => p.createElement("div", { ref: he(s, f.listInnerRef), "cmdk-list-sizer": "" }, u)));
|
|
826
|
+
}), Lr = p.forwardRef((e, a) => {
|
|
827
|
+
let { open: t, onOpenChange: n, overlayClassName: r, contentClassName: l, container: s, ...o } = e;
|
|
828
|
+
return p.createElement(ma, { open: t, onOpenChange: n }, p.createElement(fa, { container: s }, p.createElement(ha, { "cmdk-overlay": "", className: r }), p.createElement(pa, { "aria-label": e.label, "cmdk-dialog": "", className: l }, p.createElement(kt, { ref: a, ...o }))));
|
|
829
|
+
}), zr = p.forwardRef((e, a) => Y((t) => t.filtered.count === 0) ? p.createElement(Q.div, { ref: a, ...e, "cmdk-empty": "", role: "presentation" }) : null), Fr = p.forwardRef((e, a) => {
|
|
897
830
|
let { progress: t, children: n, label: r = "Loading...", ...l } = e;
|
|
898
831
|
return p.createElement(Q.div, { ref: a, ...l, "cmdk-loading": "", role: "progressbar", "aria-valuenow": t, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": r }, Ne(e, (s) => p.createElement("div", { "aria-hidden": !0 }, s)));
|
|
899
|
-
}),
|
|
900
|
-
function
|
|
832
|
+
}), B = Object.assign(kt, { List: _r, Item: Ar, Input: Pr, Group: Dr, Separator: Rr, Dialog: Lr, Empty: zr, Loading: Fr });
|
|
833
|
+
function Or(e, a) {
|
|
901
834
|
let t = e.nextElementSibling;
|
|
902
835
|
for (; t; ) {
|
|
903
836
|
if (t.matches(a)) return t;
|
|
904
837
|
t = t.nextElementSibling;
|
|
905
838
|
}
|
|
906
839
|
}
|
|
907
|
-
function
|
|
840
|
+
function Ur(e, a) {
|
|
908
841
|
let t = e.previousElementSibling;
|
|
909
842
|
for (; t; ) {
|
|
910
843
|
if (t.matches(a)) return t;
|
|
911
844
|
t = t.previousElementSibling;
|
|
912
845
|
}
|
|
913
846
|
}
|
|
914
|
-
function
|
|
847
|
+
function At(e) {
|
|
915
848
|
let a = p.useRef(e);
|
|
916
849
|
return ae(() => {
|
|
917
850
|
a.current = e;
|
|
@@ -923,24 +856,24 @@ function se(e) {
|
|
|
923
856
|
return a.current === void 0 && (a.current = e()), a;
|
|
924
857
|
}
|
|
925
858
|
function Y(e) {
|
|
926
|
-
let a =
|
|
859
|
+
let a = Ge(), t = () => e(a.snapshot());
|
|
927
860
|
return p.useSyncExternalStore(a.subscribe, t, t);
|
|
928
861
|
}
|
|
929
|
-
function
|
|
930
|
-
let r = p.useRef(), l =
|
|
862
|
+
function Dt(e, a, t, n = []) {
|
|
863
|
+
let r = p.useRef(), l = be();
|
|
931
864
|
return ae(() => {
|
|
932
865
|
var s;
|
|
933
|
-
let
|
|
866
|
+
let o = (() => {
|
|
934
867
|
var u;
|
|
935
|
-
for (let
|
|
936
|
-
if (typeof
|
|
937
|
-
if (typeof
|
|
868
|
+
for (let w of t) {
|
|
869
|
+
if (typeof w == "string") return w.trim();
|
|
870
|
+
if (typeof w == "object" && "current" in w) return w.current ? (u = w.current.textContent) == null ? void 0 : u.trim() : r.current;
|
|
938
871
|
}
|
|
939
|
-
})(),
|
|
940
|
-
l.value(e,
|
|
872
|
+
})(), f = n.map((u) => u.trim());
|
|
873
|
+
l.value(e, o, f), (s = a.current) == null || s.setAttribute(ne, o), r.current = o;
|
|
941
874
|
}), r;
|
|
942
875
|
}
|
|
943
|
-
var
|
|
876
|
+
var Mr = () => {
|
|
944
877
|
let [e, a] = p.useState(), t = se(() => /* @__PURE__ */ new Map());
|
|
945
878
|
return ae(() => {
|
|
946
879
|
t.current.forEach((n) => n()), t.current = /* @__PURE__ */ new Map();
|
|
@@ -948,33 +881,33 @@ var Hr = () => {
|
|
|
948
881
|
t.current.set(n, r), a({});
|
|
949
882
|
};
|
|
950
883
|
};
|
|
951
|
-
function
|
|
884
|
+
function jr(e) {
|
|
952
885
|
let a = e.type;
|
|
953
886
|
return typeof a == "function" ? a(e.props) : "render" in a ? a.render(e.props) : e;
|
|
954
887
|
}
|
|
955
888
|
function Ne({ asChild: e, children: a }, t) {
|
|
956
|
-
return e && p.isValidElement(a) ? p.cloneElement(
|
|
889
|
+
return e && p.isValidElement(a) ? p.cloneElement(jr(a), { ref: a.ref }, t(a.props.children)) : t(a);
|
|
957
890
|
}
|
|
958
|
-
var
|
|
959
|
-
const
|
|
960
|
-
|
|
891
|
+
var Br = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
|
|
892
|
+
const Rt = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ i(
|
|
893
|
+
B,
|
|
961
894
|
{
|
|
962
895
|
ref: t,
|
|
963
|
-
className:
|
|
896
|
+
className: j(
|
|
964
897
|
"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
|
|
965
898
|
e
|
|
966
899
|
),
|
|
967
900
|
...a
|
|
968
901
|
}
|
|
969
902
|
));
|
|
970
|
-
|
|
971
|
-
const
|
|
972
|
-
/* @__PURE__ */
|
|
973
|
-
/* @__PURE__ */
|
|
974
|
-
|
|
903
|
+
Rt.displayName = B.displayName;
|
|
904
|
+
const Pt = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ h("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
905
|
+
/* @__PURE__ */ i(ba, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
906
|
+
/* @__PURE__ */ i(
|
|
907
|
+
B.Input,
|
|
975
908
|
{
|
|
976
909
|
ref: t,
|
|
977
|
-
className:
|
|
910
|
+
className: j(
|
|
978
911
|
"flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-[hsl(var(--semaphor-placeholder-foreground))] disabled:cursor-not-allowed disabled:opacity-50",
|
|
979
912
|
e
|
|
980
913
|
),
|
|
@@ -982,74 +915,74 @@ const Ot = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ h("div",
|
|
|
982
915
|
}
|
|
983
916
|
)
|
|
984
917
|
] }));
|
|
985
|
-
|
|
986
|
-
const
|
|
987
|
-
|
|
918
|
+
Pt.displayName = B.Input.displayName;
|
|
919
|
+
const _t = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ i(
|
|
920
|
+
B.List,
|
|
988
921
|
{
|
|
989
922
|
ref: t,
|
|
990
|
-
className:
|
|
923
|
+
className: j("max-h-[300px] overflow-y-auto overflow-x-hidden", e),
|
|
991
924
|
...a
|
|
992
925
|
}
|
|
993
926
|
));
|
|
994
|
-
|
|
995
|
-
const
|
|
996
|
-
|
|
927
|
+
_t.displayName = B.List.displayName;
|
|
928
|
+
const Lt = p.forwardRef((e, a) => /* @__PURE__ */ i(
|
|
929
|
+
B.Empty,
|
|
997
930
|
{
|
|
998
931
|
ref: a,
|
|
999
932
|
className: "py-6 text-center text-sm",
|
|
1000
933
|
...e
|
|
1001
934
|
}
|
|
1002
935
|
));
|
|
1003
|
-
|
|
1004
|
-
const $e = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */
|
|
1005
|
-
|
|
936
|
+
Lt.displayName = B.Empty.displayName;
|
|
937
|
+
const $e = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ i(
|
|
938
|
+
B.Group,
|
|
1006
939
|
{
|
|
1007
940
|
ref: t,
|
|
1008
|
-
className:
|
|
941
|
+
className: j(
|
|
1009
942
|
"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
|
|
1010
943
|
e
|
|
1011
944
|
),
|
|
1012
945
|
...a
|
|
1013
946
|
}
|
|
1014
947
|
));
|
|
1015
|
-
$e.displayName =
|
|
1016
|
-
const
|
|
1017
|
-
|
|
948
|
+
$e.displayName = B.Group.displayName;
|
|
949
|
+
const zt = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ i(
|
|
950
|
+
B.Separator,
|
|
1018
951
|
{
|
|
1019
952
|
ref: t,
|
|
1020
|
-
className:
|
|
953
|
+
className: j("-mx-1 h-px bg-border", e),
|
|
1021
954
|
...a
|
|
1022
955
|
}
|
|
1023
956
|
));
|
|
1024
|
-
|
|
1025
|
-
const Ve = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */
|
|
1026
|
-
|
|
957
|
+
zt.displayName = B.Separator.displayName;
|
|
958
|
+
const Ve = p.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ i(
|
|
959
|
+
B.Item,
|
|
1027
960
|
{
|
|
1028
961
|
ref: t,
|
|
1029
|
-
className:
|
|
962
|
+
className: j(
|
|
1030
963
|
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50",
|
|
1031
964
|
e
|
|
1032
965
|
),
|
|
1033
966
|
...a
|
|
1034
967
|
}
|
|
1035
968
|
));
|
|
1036
|
-
Ve.displayName =
|
|
1037
|
-
function
|
|
1038
|
-
const { authToken: a, tokenProps: t } =
|
|
969
|
+
Ve.displayName = B.Item.displayName;
|
|
970
|
+
function $r(e = {}) {
|
|
971
|
+
const { authToken: a, tokenProps: t } = qe(), n = U(
|
|
1039
972
|
(N) => N.actions.applyResolvedCalendarPreferences
|
|
1040
|
-
), r = e.enabled ?? !0, l = (a == null ? void 0 : a.accessToken) ?? null, s = (t == null ? void 0 : t.apiServiceUrl) ?? null, [
|
|
1041
|
-
C.current = l,
|
|
1042
|
-
|
|
973
|
+
), r = e.enabled ?? !0, l = (a == null ? void 0 : a.accessToken) ?? null, s = (t == null ? void 0 : t.apiServiceUrl) ?? null, [o, f] = F(!1), [u, w] = F(!1), [c, v] = F(!1), [m, S] = F(null), [b, y] = F(null), C = H(l);
|
|
974
|
+
C.current = l, Z(() => {
|
|
975
|
+
y(null), S(null), f(!1), w(!1), v(!1);
|
|
1043
976
|
}, [l]);
|
|
1044
|
-
const
|
|
1045
|
-
const g =
|
|
977
|
+
const P = W(async (N) => {
|
|
978
|
+
const g = Va(await N.json());
|
|
1046
979
|
if (!g.ok)
|
|
1047
980
|
throw new Error("Calendar preferences response is invalid");
|
|
1048
981
|
return g.value;
|
|
1049
|
-
}, []), z =
|
|
982
|
+
}, []), z = W(async () => {
|
|
1050
983
|
if (!r || !l || !s) return;
|
|
1051
984
|
const N = l;
|
|
1052
|
-
|
|
985
|
+
f(!0), S(null);
|
|
1053
986
|
try {
|
|
1054
987
|
const g = await fetch(
|
|
1055
988
|
`${s}/v1/user-preferences/calendar`,
|
|
@@ -1059,28 +992,28 @@ function Jr(e = {}) {
|
|
|
1059
992
|
}
|
|
1060
993
|
);
|
|
1061
994
|
if (!g.ok) {
|
|
1062
|
-
const
|
|
1063
|
-
throw new Error(
|
|
995
|
+
const D = await g.json().catch(() => ({}));
|
|
996
|
+
throw new Error(D.error || "Failed to fetch preferences");
|
|
1064
997
|
}
|
|
1065
|
-
const
|
|
1066
|
-
C.current === N &&
|
|
998
|
+
const I = await P(g);
|
|
999
|
+
C.current === N && y(I);
|
|
1067
1000
|
} catch (g) {
|
|
1068
|
-
C.current === N &&
|
|
1001
|
+
C.current === N && S(g instanceof Error ? g.message : "Unknown error");
|
|
1069
1002
|
} finally {
|
|
1070
|
-
C.current === N &&
|
|
1003
|
+
C.current === N && f(!1);
|
|
1071
1004
|
}
|
|
1072
|
-
}, [l, s, r,
|
|
1073
|
-
|
|
1005
|
+
}, [l, s, r, P]);
|
|
1006
|
+
Z(() => {
|
|
1074
1007
|
r && z();
|
|
1075
1008
|
}, [r, z]);
|
|
1076
|
-
const
|
|
1009
|
+
const O = W(
|
|
1077
1010
|
async (N) => {
|
|
1078
1011
|
if (!l || !s)
|
|
1079
|
-
return
|
|
1012
|
+
return S("Not authenticated"), !1;
|
|
1080
1013
|
const g = l;
|
|
1081
|
-
|
|
1014
|
+
w(!0), S(null);
|
|
1082
1015
|
try {
|
|
1083
|
-
const
|
|
1016
|
+
const I = await fetch(
|
|
1084
1017
|
`${s}/v1/user-preferences/calendar`,
|
|
1085
1018
|
{
|
|
1086
1019
|
method: "PATCH",
|
|
@@ -1091,29 +1024,29 @@ function Jr(e = {}) {
|
|
|
1091
1024
|
body: JSON.stringify(N)
|
|
1092
1025
|
}
|
|
1093
1026
|
);
|
|
1094
|
-
if (!
|
|
1095
|
-
const
|
|
1096
|
-
throw new Error(
|
|
1027
|
+
if (!I.ok) {
|
|
1028
|
+
const E = await I.json().catch(() => ({}));
|
|
1029
|
+
throw new Error(E.error || "Failed to update preferences");
|
|
1097
1030
|
}
|
|
1098
|
-
const
|
|
1099
|
-
return C.current !== g ? !1 : (
|
|
1100
|
-
} catch (
|
|
1101
|
-
return C.current === g &&
|
|
1031
|
+
const D = await P(I);
|
|
1032
|
+
return C.current !== g ? !1 : (y(D), n(D.resolved, D.sources), !0);
|
|
1033
|
+
} catch (I) {
|
|
1034
|
+
return C.current === g && S(I instanceof Error ? I.message : "Unknown error"), !1;
|
|
1102
1035
|
} finally {
|
|
1103
|
-
C.current === g &&
|
|
1036
|
+
C.current === g && w(!1);
|
|
1104
1037
|
}
|
|
1105
1038
|
},
|
|
1106
1039
|
[
|
|
1107
1040
|
l,
|
|
1108
1041
|
s,
|
|
1109
1042
|
n,
|
|
1110
|
-
|
|
1043
|
+
P
|
|
1111
1044
|
]
|
|
1112
|
-
),
|
|
1045
|
+
), _ = W(async () => {
|
|
1113
1046
|
if (!l || !s)
|
|
1114
|
-
return
|
|
1047
|
+
return S("Not authenticated"), !1;
|
|
1115
1048
|
const N = l;
|
|
1116
|
-
v(!0),
|
|
1049
|
+
v(!0), S(null);
|
|
1117
1050
|
try {
|
|
1118
1051
|
const g = await fetch(
|
|
1119
1052
|
`${s}/v1/user-preferences/calendar`,
|
|
@@ -1123,13 +1056,13 @@ function Jr(e = {}) {
|
|
|
1123
1056
|
}
|
|
1124
1057
|
);
|
|
1125
1058
|
if (!g.ok) {
|
|
1126
|
-
const
|
|
1127
|
-
throw new Error(
|
|
1059
|
+
const D = await g.json().catch(() => ({}));
|
|
1060
|
+
throw new Error(D.error || "Failed to clear preferences");
|
|
1128
1061
|
}
|
|
1129
|
-
const
|
|
1130
|
-
return C.current !== N ? !1 : (
|
|
1062
|
+
const I = await P(g);
|
|
1063
|
+
return C.current !== N ? !1 : (y(I), n(I.resolved, I.sources), !0);
|
|
1131
1064
|
} catch (g) {
|
|
1132
|
-
return C.current === N &&
|
|
1065
|
+
return C.current === N && S(g instanceof Error ? g.message : "Unknown error"), !1;
|
|
1133
1066
|
} finally {
|
|
1134
1067
|
C.current === N && v(!1);
|
|
1135
1068
|
}
|
|
@@ -1137,20 +1070,20 @@ function Jr(e = {}) {
|
|
|
1137
1070
|
l,
|
|
1138
1071
|
s,
|
|
1139
1072
|
n,
|
|
1140
|
-
|
|
1073
|
+
P
|
|
1141
1074
|
]);
|
|
1142
1075
|
return {
|
|
1143
1076
|
preferences: b,
|
|
1144
|
-
isLoading:
|
|
1077
|
+
isLoading: o,
|
|
1145
1078
|
isSaving: u,
|
|
1146
1079
|
isClearing: c,
|
|
1147
|
-
error:
|
|
1148
|
-
updatePreferences:
|
|
1149
|
-
clearPreferences:
|
|
1080
|
+
error: m,
|
|
1081
|
+
updatePreferences: O,
|
|
1082
|
+
clearPreferences: _,
|
|
1150
1083
|
refetch: z
|
|
1151
1084
|
};
|
|
1152
1085
|
}
|
|
1153
|
-
const
|
|
1086
|
+
const Ee = [
|
|
1154
1087
|
{ value: "America/New_York", label: "Eastern Time (US & Canada)" },
|
|
1155
1088
|
{ value: "America/Chicago", label: "Central Time (US & Canada)" },
|
|
1156
1089
|
{ value: "America/Denver", label: "Mountain Time (US & Canada)" },
|
|
@@ -1165,21 +1098,21 @@ const Ie = [
|
|
|
1165
1098
|
{ value: "Asia/Kolkata", label: "Mumbai, New Delhi" },
|
|
1166
1099
|
{ value: "Australia/Sydney", label: "Sydney" },
|
|
1167
1100
|
{ value: "UTC", label: "UTC" }
|
|
1168
|
-
],
|
|
1101
|
+
], Ft = [
|
|
1169
1102
|
{ value: 0, label: "Sunday" },
|
|
1170
1103
|
{ value: 1, label: "Monday" },
|
|
1171
1104
|
{ value: 6, label: "Saturday" }
|
|
1172
|
-
],
|
|
1173
|
-
function
|
|
1105
|
+
], ut = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
|
|
1106
|
+
function Vr() {
|
|
1174
1107
|
try {
|
|
1175
1108
|
const e = Intl;
|
|
1176
1109
|
if (e.supportedValuesOf)
|
|
1177
1110
|
return e.supportedValuesOf("timeZone");
|
|
1178
1111
|
} catch {
|
|
1179
1112
|
}
|
|
1180
|
-
return
|
|
1113
|
+
return Ee.map((e) => e.value);
|
|
1181
1114
|
}
|
|
1182
|
-
function
|
|
1115
|
+
function Wr(e) {
|
|
1183
1116
|
if (!e) return "default";
|
|
1184
1117
|
if (e.tz !== e.weekStart) return "inherited";
|
|
1185
1118
|
switch (e.tz) {
|
|
@@ -1195,15 +1128,15 @@ function Yr(e) {
|
|
|
1195
1128
|
return "default";
|
|
1196
1129
|
}
|
|
1197
1130
|
}
|
|
1198
|
-
function
|
|
1199
|
-
const a =
|
|
1131
|
+
function mt(e) {
|
|
1132
|
+
const a = Ee.find((t) => t.value === e);
|
|
1200
1133
|
return a ? a.label : e;
|
|
1201
1134
|
}
|
|
1202
|
-
function
|
|
1203
|
-
const a =
|
|
1135
|
+
function Kr(e) {
|
|
1136
|
+
const a = Ft.find((t) => t.value === e);
|
|
1204
1137
|
return a ? a.label : String(e);
|
|
1205
1138
|
}
|
|
1206
|
-
function
|
|
1139
|
+
function qr({
|
|
1207
1140
|
active: e,
|
|
1208
1141
|
onClose: a
|
|
1209
1142
|
}) {
|
|
@@ -1213,52 +1146,52 @@ function en({
|
|
|
1213
1146
|
isSaving: r,
|
|
1214
1147
|
isClearing: l,
|
|
1215
1148
|
updatePreferences: s,
|
|
1216
|
-
clearPreferences:
|
|
1217
|
-
} =
|
|
1149
|
+
clearPreferences: o
|
|
1150
|
+
} = $r({ enabled: e }), f = va(), u = (t == null ? void 0 : t.resolved.tz) || (f == null ? void 0 : f.tz) || "UTC", w = (t == null ? void 0 : t.resolved.weekStart) ?? (f == null ? void 0 : f.weekStart) ?? 1, [c, v] = F((t == null ? void 0 : t.stored) === null), [m, S] = F(!1), [b, y] = F(
|
|
1218
1151
|
u
|
|
1219
|
-
), [C,
|
|
1220
|
-
|
|
1221
|
-
), [z,
|
|
1222
|
-
() =>
|
|
1223
|
-
(k) => !
|
|
1152
|
+
), [C, P] = F(
|
|
1153
|
+
w
|
|
1154
|
+
), [z, O] = F(!1), _ = ee(() => Vr(), []), N = ee(
|
|
1155
|
+
() => _.filter(
|
|
1156
|
+
(k) => !Ee.some((oe) => oe.value === k)
|
|
1224
1157
|
),
|
|
1225
|
-
[
|
|
1226
|
-
), g = ee(() =>
|
|
1158
|
+
[_]
|
|
1159
|
+
), g = ee(() => mt(b), [b]), I = t != null && t.inherited ? mt(t.inherited.tz) : "UTC", D = t != null && t.inherited ? Kr(t.inherited.weekStart) : "Monday", E = Wr(
|
|
1227
1160
|
t == null ? void 0 : t.inheritedSources
|
|
1228
1161
|
);
|
|
1229
|
-
|
|
1162
|
+
Mt.useEffect(() => {
|
|
1230
1163
|
if (!e) {
|
|
1231
|
-
|
|
1164
|
+
S(!1);
|
|
1232
1165
|
return;
|
|
1233
1166
|
}
|
|
1234
|
-
|
|
1167
|
+
m || (t && v(t.stored === null), y(u), P(w));
|
|
1235
1168
|
}, [
|
|
1236
1169
|
e,
|
|
1237
|
-
|
|
1170
|
+
m,
|
|
1238
1171
|
t,
|
|
1239
1172
|
u,
|
|
1240
|
-
|
|
1173
|
+
w
|
|
1241
1174
|
]);
|
|
1242
|
-
const
|
|
1175
|
+
const q = async () => {
|
|
1243
1176
|
if (n) {
|
|
1244
1177
|
G.error("Preferences are still loading. Please try again.");
|
|
1245
1178
|
return;
|
|
1246
1179
|
}
|
|
1247
|
-
c ? await
|
|
1180
|
+
c ? await o() ? (G.success("Now using default settings."), a()) : G.error("Failed to save preferences. Please try again.") : await s({
|
|
1248
1181
|
tz: b,
|
|
1249
1182
|
weekStart: C
|
|
1250
1183
|
}) ? (G.success("Preferences saved."), a()) : G.error("Failed to save preferences. Please try again.");
|
|
1251
|
-
},
|
|
1184
|
+
}, $ = () => {
|
|
1252
1185
|
a();
|
|
1253
1186
|
}, re = r || l, J = re || n;
|
|
1254
1187
|
return /* @__PURE__ */ h(te, { children: [
|
|
1255
1188
|
/* @__PURE__ */ h("div", { className: "space-y-4 py-1", children: [
|
|
1256
1189
|
/* @__PURE__ */ h(
|
|
1257
|
-
|
|
1190
|
+
tt,
|
|
1258
1191
|
{
|
|
1259
1192
|
value: c ? "defaults" : "custom",
|
|
1260
1193
|
onValueChange: (k) => {
|
|
1261
|
-
|
|
1194
|
+
S(!0), v(k === "defaults");
|
|
1262
1195
|
},
|
|
1263
1196
|
className: "space-y-0.5",
|
|
1264
1197
|
children: [
|
|
@@ -1266,15 +1199,15 @@ function en({
|
|
|
1266
1199
|
"label",
|
|
1267
1200
|
{
|
|
1268
1201
|
htmlFor: "mode-defaults",
|
|
1269
|
-
className:
|
|
1202
|
+
className: j(
|
|
1270
1203
|
"flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",
|
|
1271
1204
|
c && "bg-muted/50"
|
|
1272
1205
|
),
|
|
1273
1206
|
onClick: () => {
|
|
1274
|
-
|
|
1207
|
+
S(!0), v(!0);
|
|
1275
1208
|
},
|
|
1276
1209
|
children: [
|
|
1277
|
-
/* @__PURE__ */
|
|
1210
|
+
/* @__PURE__ */ i(
|
|
1278
1211
|
ke,
|
|
1279
1212
|
{
|
|
1280
1213
|
value: "defaults",
|
|
@@ -1285,13 +1218,13 @@ function en({
|
|
|
1285
1218
|
/* @__PURE__ */ h("div", { className: "flex-1 min-w-0", children: [
|
|
1286
1219
|
/* @__PURE__ */ h("p", { className: "text-[13px] font-medium text-foreground", children: [
|
|
1287
1220
|
"Use ",
|
|
1288
|
-
|
|
1221
|
+
E,
|
|
1289
1222
|
" defaults"
|
|
1290
1223
|
] }),
|
|
1291
1224
|
/* @__PURE__ */ h("p", { className: "text-[12px] text-muted-foreground", children: [
|
|
1292
|
-
|
|
1225
|
+
I,
|
|
1293
1226
|
", week starts ",
|
|
1294
|
-
|
|
1227
|
+
D
|
|
1295
1228
|
] })
|
|
1296
1229
|
] })
|
|
1297
1230
|
]
|
|
@@ -1301,15 +1234,15 @@ function en({
|
|
|
1301
1234
|
"label",
|
|
1302
1235
|
{
|
|
1303
1236
|
htmlFor: "mode-custom",
|
|
1304
|
-
className:
|
|
1237
|
+
className: j(
|
|
1305
1238
|
"flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",
|
|
1306
1239
|
!c && "bg-muted/50"
|
|
1307
1240
|
),
|
|
1308
1241
|
onClick: () => {
|
|
1309
|
-
|
|
1242
|
+
S(!0), v(!1);
|
|
1310
1243
|
},
|
|
1311
1244
|
children: [
|
|
1312
|
-
/* @__PURE__ */
|
|
1245
|
+
/* @__PURE__ */ i(
|
|
1313
1246
|
ke,
|
|
1314
1247
|
{
|
|
1315
1248
|
value: "custom",
|
|
@@ -1317,7 +1250,7 @@ function en({
|
|
|
1317
1250
|
className: "mt-0.5"
|
|
1318
1251
|
}
|
|
1319
1252
|
),
|
|
1320
|
-
/* @__PURE__ */
|
|
1253
|
+
/* @__PURE__ */ i("p", { className: "flex-1 text-[13px] font-medium text-foreground", children: "Use custom settings" })
|
|
1321
1254
|
]
|
|
1322
1255
|
}
|
|
1323
1256
|
)
|
|
@@ -1327,22 +1260,22 @@ function en({
|
|
|
1327
1260
|
/* @__PURE__ */ h(
|
|
1328
1261
|
"div",
|
|
1329
1262
|
{
|
|
1330
|
-
className:
|
|
1263
|
+
className: j(
|
|
1331
1264
|
"space-y-4 border-t border-border/60 pt-4 transition-opacity",
|
|
1332
1265
|
c && "pointer-events-none opacity-50"
|
|
1333
1266
|
),
|
|
1334
1267
|
children: [
|
|
1335
1268
|
/* @__PURE__ */ h("div", { className: "space-y-1.5", children: [
|
|
1336
|
-
/* @__PURE__ */
|
|
1269
|
+
/* @__PURE__ */ i(pe, { className: ut, children: "Timezone" }),
|
|
1337
1270
|
/* @__PURE__ */ h(
|
|
1338
|
-
|
|
1271
|
+
La,
|
|
1339
1272
|
{
|
|
1340
1273
|
open: z,
|
|
1341
|
-
onOpenChange:
|
|
1274
|
+
onOpenChange: O,
|
|
1342
1275
|
modal: !0,
|
|
1343
1276
|
children: [
|
|
1344
|
-
/* @__PURE__ */
|
|
1345
|
-
|
|
1277
|
+
/* @__PURE__ */ i(za, { asChild: !0, children: /* @__PURE__ */ h(
|
|
1278
|
+
K,
|
|
1346
1279
|
{
|
|
1347
1280
|
variant: "outline",
|
|
1348
1281
|
size: "xs",
|
|
@@ -1351,56 +1284,56 @@ function en({
|
|
|
1351
1284
|
className: "w-full justify-between text-[12px] font-normal",
|
|
1352
1285
|
disabled: c,
|
|
1353
1286
|
children: [
|
|
1354
|
-
/* @__PURE__ */
|
|
1355
|
-
/* @__PURE__ */
|
|
1287
|
+
/* @__PURE__ */ i("span", { className: "truncate", children: g }),
|
|
1288
|
+
/* @__PURE__ */ i(ga, { className: "ml-2 h-3.5 w-3.5 shrink-0 opacity-50" })
|
|
1356
1289
|
]
|
|
1357
1290
|
}
|
|
1358
1291
|
) }),
|
|
1359
|
-
/* @__PURE__ */
|
|
1360
|
-
|
|
1292
|
+
/* @__PURE__ */ i(
|
|
1293
|
+
Fa,
|
|
1361
1294
|
{
|
|
1362
1295
|
className: "z-50 w-[--radix-popover-trigger-width] p-0",
|
|
1363
1296
|
align: "start",
|
|
1364
|
-
children: /* @__PURE__ */ h(
|
|
1365
|
-
/* @__PURE__ */
|
|
1366
|
-
/* @__PURE__ */ h(
|
|
1367
|
-
/* @__PURE__ */
|
|
1368
|
-
/* @__PURE__ */
|
|
1297
|
+
children: /* @__PURE__ */ h(Rt, { className: "overflow-visible", children: [
|
|
1298
|
+
/* @__PURE__ */ i(Pt, { placeholder: "Search timezones…" }),
|
|
1299
|
+
/* @__PURE__ */ h(_t, { children: [
|
|
1300
|
+
/* @__PURE__ */ i(Lt, { children: "No timezone found." }),
|
|
1301
|
+
/* @__PURE__ */ i($e, { heading: "Common", children: Ee.map((k) => /* @__PURE__ */ h(
|
|
1369
1302
|
Ve,
|
|
1370
1303
|
{
|
|
1371
1304
|
value: `${k.value} ${k.label}`,
|
|
1372
1305
|
onSelect: () => {
|
|
1373
|
-
|
|
1306
|
+
S(!0), y(k.value), O(!1);
|
|
1374
1307
|
},
|
|
1375
1308
|
children: [
|
|
1376
|
-
/* @__PURE__ */
|
|
1377
|
-
|
|
1309
|
+
/* @__PURE__ */ i(
|
|
1310
|
+
at,
|
|
1378
1311
|
{
|
|
1379
|
-
className:
|
|
1312
|
+
className: j(
|
|
1380
1313
|
"h-3.5 w-3.5",
|
|
1381
1314
|
b === k.value ? "opacity-100" : "opacity-0"
|
|
1382
1315
|
)
|
|
1383
1316
|
}
|
|
1384
1317
|
),
|
|
1385
|
-
/* @__PURE__ */
|
|
1386
|
-
/* @__PURE__ */
|
|
1318
|
+
/* @__PURE__ */ i("span", { className: "flex-1", children: k.label }),
|
|
1319
|
+
/* @__PURE__ */ i("span", { className: "text-[11px] text-muted-foreground", children: k.value })
|
|
1387
1320
|
]
|
|
1388
1321
|
},
|
|
1389
1322
|
k.value
|
|
1390
1323
|
)) }),
|
|
1391
|
-
/* @__PURE__ */
|
|
1392
|
-
/* @__PURE__ */
|
|
1324
|
+
/* @__PURE__ */ i(zt, {}),
|
|
1325
|
+
/* @__PURE__ */ i($e, { heading: "All timezones", children: N.map((k) => /* @__PURE__ */ h(
|
|
1393
1326
|
Ve,
|
|
1394
1327
|
{
|
|
1395
1328
|
value: k,
|
|
1396
1329
|
onSelect: () => {
|
|
1397
|
-
|
|
1330
|
+
S(!0), y(k), O(!1);
|
|
1398
1331
|
},
|
|
1399
1332
|
children: [
|
|
1400
|
-
/* @__PURE__ */
|
|
1401
|
-
|
|
1333
|
+
/* @__PURE__ */ i(
|
|
1334
|
+
at,
|
|
1402
1335
|
{
|
|
1403
|
-
className:
|
|
1336
|
+
className: j(
|
|
1404
1337
|
"h-3.5 w-3.5",
|
|
1405
1338
|
b === k ? "opacity-100" : "opacity-0"
|
|
1406
1339
|
)
|
|
@@ -1420,26 +1353,26 @@ function en({
|
|
|
1420
1353
|
)
|
|
1421
1354
|
] }),
|
|
1422
1355
|
/* @__PURE__ */ h("div", { className: "space-y-1.5", children: [
|
|
1423
|
-
/* @__PURE__ */
|
|
1424
|
-
/* @__PURE__ */
|
|
1425
|
-
|
|
1356
|
+
/* @__PURE__ */ i(pe, { className: ut, children: "Week starts on" }),
|
|
1357
|
+
/* @__PURE__ */ i(
|
|
1358
|
+
tt,
|
|
1426
1359
|
{
|
|
1427
1360
|
value: String(C),
|
|
1428
1361
|
onValueChange: (k) => {
|
|
1429
|
-
|
|
1362
|
+
S(!0), P(Number(k));
|
|
1430
1363
|
},
|
|
1431
1364
|
className: "flex gap-4",
|
|
1432
1365
|
disabled: c,
|
|
1433
|
-
children:
|
|
1366
|
+
children: Ft.map((k) => /* @__PURE__ */ h(
|
|
1434
1367
|
"label",
|
|
1435
1368
|
{
|
|
1436
1369
|
htmlFor: `week-start-${k.value}`,
|
|
1437
|
-
className:
|
|
1370
|
+
className: j(
|
|
1438
1371
|
"flex cursor-pointer items-center gap-2 text-[13px]",
|
|
1439
1372
|
c && "cursor-not-allowed"
|
|
1440
1373
|
),
|
|
1441
1374
|
children: [
|
|
1442
|
-
/* @__PURE__ */
|
|
1375
|
+
/* @__PURE__ */ i(
|
|
1443
1376
|
ke,
|
|
1444
1377
|
{
|
|
1445
1378
|
value: String(k.value),
|
|
@@ -1459,111 +1392,111 @@ function en({
|
|
|
1459
1392
|
}
|
|
1460
1393
|
)
|
|
1461
1394
|
] }),
|
|
1462
|
-
/* @__PURE__ */ h(
|
|
1463
|
-
/* @__PURE__ */
|
|
1464
|
-
|
|
1395
|
+
/* @__PURE__ */ h(He, { children: [
|
|
1396
|
+
/* @__PURE__ */ i(
|
|
1397
|
+
K,
|
|
1465
1398
|
{
|
|
1466
1399
|
variant: "outline",
|
|
1467
1400
|
size: "xs",
|
|
1468
|
-
onClick:
|
|
1401
|
+
onClick: $,
|
|
1469
1402
|
disabled: re,
|
|
1470
1403
|
children: "Cancel"
|
|
1471
1404
|
}
|
|
1472
1405
|
),
|
|
1473
|
-
/* @__PURE__ */
|
|
1474
|
-
/* @__PURE__ */
|
|
1406
|
+
/* @__PURE__ */ i(K, { size: "xs", onClick: q, disabled: J, children: re ? /* @__PURE__ */ h(te, { children: [
|
|
1407
|
+
/* @__PURE__ */ i(yt, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
1475
1408
|
"Saving…"
|
|
1476
1409
|
] }) : "Save" })
|
|
1477
1410
|
] })
|
|
1478
1411
|
] });
|
|
1479
1412
|
}
|
|
1480
|
-
function
|
|
1481
|
-
const { authToken: a, tokenProps: t } =
|
|
1413
|
+
function Hr(e = {}) {
|
|
1414
|
+
const { authToken: a, tokenProps: t } = qe(), n = U(
|
|
1482
1415
|
(g) => g.actions.applyResolvedValueFormatPreferences
|
|
1483
|
-
), r = e.enabled ?? !0, l = (a == null ? void 0 : a.accessToken) ?? null, s = (t == null ? void 0 : t.apiServiceUrl) ?? null,
|
|
1484
|
-
|
|
1485
|
-
const [
|
|
1486
|
-
|
|
1487
|
-
u(null), C(null), c(!1),
|
|
1416
|
+
), r = e.enabled ?? !0, l = (a == null ? void 0 : a.accessToken) ?? null, s = (t == null ? void 0 : t.apiServiceUrl) ?? null, o = H(l);
|
|
1417
|
+
o.current = l;
|
|
1418
|
+
const [f, u] = F(null), [w, c] = F(!1), [v, m] = F(!1), [S, b] = F(!1), [y, C] = F(null);
|
|
1419
|
+
Z(() => {
|
|
1420
|
+
u(null), C(null), c(!1), m(!1), b(!1);
|
|
1488
1421
|
}, [l]);
|
|
1489
|
-
const
|
|
1490
|
-
const
|
|
1491
|
-
if (!
|
|
1422
|
+
const P = W(async (g) => {
|
|
1423
|
+
const I = Ma(await g.json());
|
|
1424
|
+
if (!I.ok)
|
|
1492
1425
|
throw new Error("Value format preferences response is invalid");
|
|
1493
|
-
return
|
|
1494
|
-
}, []), z =
|
|
1495
|
-
async (g,
|
|
1426
|
+
return I.value;
|
|
1427
|
+
}, []), z = W(
|
|
1428
|
+
async (g, I) => {
|
|
1496
1429
|
if (!l || !s)
|
|
1497
1430
|
throw new Error("Not authenticated");
|
|
1498
|
-
const
|
|
1431
|
+
const D = await fetch(
|
|
1499
1432
|
`${s}/v1/user-preferences/value-format`,
|
|
1500
1433
|
{
|
|
1501
1434
|
method: g,
|
|
1502
1435
|
headers: {
|
|
1503
1436
|
Authorization: `Bearer ${l}`,
|
|
1504
|
-
...
|
|
1437
|
+
...I ? { "Content-Type": "application/json" } : {}
|
|
1505
1438
|
},
|
|
1506
|
-
body:
|
|
1439
|
+
body: I ? JSON.stringify(I) : void 0
|
|
1507
1440
|
}
|
|
1508
1441
|
);
|
|
1509
|
-
if (!
|
|
1510
|
-
const
|
|
1511
|
-
throw new Error(
|
|
1442
|
+
if (!D.ok) {
|
|
1443
|
+
const E = await D.json().catch(() => ({}));
|
|
1444
|
+
throw new Error(E.error || "Failed to update preferences");
|
|
1512
1445
|
}
|
|
1513
|
-
return
|
|
1446
|
+
return P(D);
|
|
1514
1447
|
},
|
|
1515
|
-
[l, s,
|
|
1516
|
-
),
|
|
1448
|
+
[l, s, P]
|
|
1449
|
+
), O = W(async () => {
|
|
1517
1450
|
if (!r || !l || !s) return;
|
|
1518
1451
|
const g = l;
|
|
1519
1452
|
c(!0), C(null);
|
|
1520
1453
|
try {
|
|
1521
|
-
const
|
|
1522
|
-
|
|
1523
|
-
} catch (
|
|
1524
|
-
|
|
1454
|
+
const I = await z("GET");
|
|
1455
|
+
o.current === g && u(I);
|
|
1456
|
+
} catch (I) {
|
|
1457
|
+
o.current === g && C(I instanceof Error ? I.message : "Unknown error");
|
|
1525
1458
|
} finally {
|
|
1526
|
-
|
|
1459
|
+
o.current === g && c(!1);
|
|
1527
1460
|
}
|
|
1528
1461
|
}, [l, s, r, z]);
|
|
1529
|
-
|
|
1530
|
-
r &&
|
|
1531
|
-
}, [r,
|
|
1532
|
-
const
|
|
1462
|
+
Z(() => {
|
|
1463
|
+
r && O();
|
|
1464
|
+
}, [r, O]);
|
|
1465
|
+
const _ = W(
|
|
1533
1466
|
async (g) => {
|
|
1534
|
-
const
|
|
1535
|
-
|
|
1467
|
+
const I = l;
|
|
1468
|
+
m(!0), C(null);
|
|
1536
1469
|
try {
|
|
1537
|
-
const
|
|
1538
|
-
return
|
|
1539
|
-
} catch (
|
|
1540
|
-
return
|
|
1470
|
+
const D = await z("PATCH", g);
|
|
1471
|
+
return o.current !== I ? !1 : (u(D), n(D.resolved, D.sources), !0);
|
|
1472
|
+
} catch (D) {
|
|
1473
|
+
return o.current === I && C(D instanceof Error ? D.message : "Unknown error"), !1;
|
|
1541
1474
|
} finally {
|
|
1542
|
-
|
|
1475
|
+
o.current === I && m(!1);
|
|
1543
1476
|
}
|
|
1544
1477
|
},
|
|
1545
1478
|
[l, n, z]
|
|
1546
|
-
), N =
|
|
1479
|
+
), N = W(async () => {
|
|
1547
1480
|
const g = l;
|
|
1548
1481
|
b(!0), C(null);
|
|
1549
1482
|
try {
|
|
1550
|
-
const
|
|
1551
|
-
return
|
|
1552
|
-
} catch (
|
|
1553
|
-
return
|
|
1483
|
+
const I = await z("DELETE");
|
|
1484
|
+
return o.current !== g ? !1 : (u(I), n(I.resolved, I.sources), !0);
|
|
1485
|
+
} catch (I) {
|
|
1486
|
+
return o.current === g && C(I instanceof Error ? I.message : "Unknown error"), !1;
|
|
1554
1487
|
} finally {
|
|
1555
|
-
|
|
1488
|
+
o.current === g && b(!1);
|
|
1556
1489
|
}
|
|
1557
1490
|
}, [l, n, z]);
|
|
1558
1491
|
return {
|
|
1559
|
-
preferences:
|
|
1560
|
-
isLoading:
|
|
1492
|
+
preferences: f,
|
|
1493
|
+
isLoading: w,
|
|
1561
1494
|
isSaving: v,
|
|
1562
|
-
isClearing:
|
|
1563
|
-
error:
|
|
1564
|
-
updatePreferences:
|
|
1495
|
+
isClearing: S,
|
|
1496
|
+
error: y,
|
|
1497
|
+
updatePreferences: _,
|
|
1565
1498
|
clearPreferences: N,
|
|
1566
|
-
refetch:
|
|
1499
|
+
refetch: O
|
|
1567
1500
|
};
|
|
1568
1501
|
}
|
|
1569
1502
|
const We = [
|
|
@@ -1579,7 +1512,7 @@ const We = [
|
|
|
1579
1512
|
{ value: "en-IN", label: "English (India)" },
|
|
1580
1513
|
{ value: "en-NZ", label: "English (New Zealand)" },
|
|
1581
1514
|
{ value: "mi-NZ", label: "Māori (New Zealand)" }
|
|
1582
|
-
],
|
|
1515
|
+
], Ot = /* @__PURE__ */ new Set([
|
|
1583
1516
|
"USD",
|
|
1584
1517
|
"EUR",
|
|
1585
1518
|
"GBP",
|
|
@@ -1590,13 +1523,13 @@ const We = [
|
|
|
1590
1523
|
"INR",
|
|
1591
1524
|
"BRL",
|
|
1592
1525
|
"KWD"
|
|
1593
|
-
]),
|
|
1594
|
-
(e) => !
|
|
1595
|
-
),
|
|
1526
|
+
]), Gr = ja(), Jr = Gr.filter(
|
|
1527
|
+
(e) => !Ot.has(e)
|
|
1528
|
+
), Ut = [
|
|
1596
1529
|
{ value: "short", label: "Short" },
|
|
1597
1530
|
{ value: "medium", label: "Medium" },
|
|
1598
1531
|
{ value: "long", label: "Long" }
|
|
1599
|
-
],
|
|
1532
|
+
], ft = "2026-07-31", Pe = "2026-07-31T14:30:45";
|
|
1600
1533
|
function Ke(e) {
|
|
1601
1534
|
switch (e) {
|
|
1602
1535
|
case "viewer_user":
|
|
@@ -1615,22 +1548,22 @@ function Ke(e) {
|
|
|
1615
1548
|
return "another preference level";
|
|
1616
1549
|
}
|
|
1617
1550
|
}
|
|
1618
|
-
function
|
|
1551
|
+
function _e(e) {
|
|
1619
1552
|
var a;
|
|
1620
|
-
return ((a =
|
|
1553
|
+
return ((a = Ut.find((t) => t.value === e)) == null ? void 0 : a.label) ?? e;
|
|
1621
1554
|
}
|
|
1622
|
-
function
|
|
1555
|
+
function Xr(e) {
|
|
1623
1556
|
const a = We.find((t) => t.value === e);
|
|
1624
1557
|
return a ? `${a.label} — ${a.value}` : e;
|
|
1625
1558
|
}
|
|
1626
|
-
function
|
|
1559
|
+
function Le(e) {
|
|
1627
1560
|
return {
|
|
1628
1561
|
short: e("short"),
|
|
1629
1562
|
medium: e("medium"),
|
|
1630
1563
|
long: e("long")
|
|
1631
1564
|
};
|
|
1632
1565
|
}
|
|
1633
|
-
function
|
|
1566
|
+
function ze({
|
|
1634
1567
|
id: e,
|
|
1635
1568
|
label: a,
|
|
1636
1569
|
value: t,
|
|
@@ -1638,38 +1571,38 @@ function Le({
|
|
|
1638
1571
|
inheritedSource: r,
|
|
1639
1572
|
examples: l,
|
|
1640
1573
|
disabled: s,
|
|
1641
|
-
onValueChange:
|
|
1574
|
+
onValueChange: o
|
|
1642
1575
|
}) {
|
|
1643
|
-
const
|
|
1576
|
+
const f = t === void 0 ? `Inherited · ${_e(n)}` : _e(t);
|
|
1644
1577
|
return /* @__PURE__ */ h("div", { className: "space-y-1.5", children: [
|
|
1645
|
-
/* @__PURE__ */
|
|
1578
|
+
/* @__PURE__ */ i(pe, { htmlFor: e, className: "text-[11px] text-muted-foreground", children: a }),
|
|
1646
1579
|
/* @__PURE__ */ h(
|
|
1647
|
-
|
|
1580
|
+
Fe,
|
|
1648
1581
|
{
|
|
1649
1582
|
value: t ?? "inherit",
|
|
1650
1583
|
disabled: s,
|
|
1651
|
-
onValueChange:
|
|
1584
|
+
onValueChange: o,
|
|
1652
1585
|
children: [
|
|
1653
|
-
/* @__PURE__ */
|
|
1586
|
+
/* @__PURE__ */ i(Oe, { id: e, size: "xs", children: /* @__PURE__ */ i(Ue, { children: f }) }),
|
|
1654
1587
|
/* @__PURE__ */ h(Me, { children: [
|
|
1655
|
-
/* @__PURE__ */
|
|
1588
|
+
/* @__PURE__ */ i(X, { value: "inherit", className: "[&>span:last-child]:w-full", children: /* @__PURE__ */ h("span", { className: "flex w-full min-w-0 items-center justify-between gap-4", children: [
|
|
1656
1589
|
/* @__PURE__ */ h("span", { children: [
|
|
1657
1590
|
"Inherited from ",
|
|
1658
1591
|
Ke(r),
|
|
1659
1592
|
" ·",
|
|
1660
1593
|
" ",
|
|
1661
|
-
|
|
1594
|
+
_e(n)
|
|
1662
1595
|
] }),
|
|
1663
|
-
/* @__PURE__ */
|
|
1596
|
+
/* @__PURE__ */ i("span", { className: "shrink-0 tabular-nums text-muted-foreground", children: l[n] })
|
|
1664
1597
|
] }) }),
|
|
1665
|
-
|
|
1666
|
-
|
|
1598
|
+
Ut.map((u) => /* @__PURE__ */ i(
|
|
1599
|
+
X,
|
|
1667
1600
|
{
|
|
1668
1601
|
value: u.value,
|
|
1669
1602
|
className: "[&>span:last-child]:w-full",
|
|
1670
1603
|
children: /* @__PURE__ */ h("span", { className: "flex w-full min-w-0 items-center justify-between gap-4", children: [
|
|
1671
|
-
/* @__PURE__ */
|
|
1672
|
-
/* @__PURE__ */
|
|
1604
|
+
/* @__PURE__ */ i("span", { children: u.label }),
|
|
1605
|
+
/* @__PURE__ */ i("span", { className: "shrink-0 tabular-nums text-muted-foreground", children: l[u.value] })
|
|
1673
1606
|
] })
|
|
1674
1607
|
},
|
|
1675
1608
|
u.value
|
|
@@ -1680,15 +1613,15 @@ function Le({
|
|
|
1680
1613
|
)
|
|
1681
1614
|
] });
|
|
1682
1615
|
}
|
|
1683
|
-
function
|
|
1616
|
+
function Zr({
|
|
1684
1617
|
value: e,
|
|
1685
1618
|
inherited: a,
|
|
1686
1619
|
inheritedSources: t,
|
|
1687
1620
|
onChange: n,
|
|
1688
1621
|
disabled: r
|
|
1689
1622
|
}) {
|
|
1690
|
-
var N, g,
|
|
1691
|
-
const l = de(), s = de(),
|
|
1623
|
+
var N, g, I, D;
|
|
1624
|
+
const l = de(), s = de(), o = de(), f = de(), u = de(), c = (e.locale === void 0 ? void 0 : wt(e.locale)) ?? a.locale, v = e.defaultCurrency ?? a.defaultCurrency, m = {
|
|
1692
1625
|
locale: c,
|
|
1693
1626
|
dateStyle: e.dateStyle ?? a.dateStyle,
|
|
1694
1627
|
dateTime: {
|
|
@@ -1696,66 +1629,66 @@ function sn({
|
|
|
1696
1629
|
timeStyle: ((g = e.dateTime) == null ? void 0 : g.timeStyle) ?? a.dateTime.timeStyle
|
|
1697
1630
|
},
|
|
1698
1631
|
defaultCurrency: v
|
|
1699
|
-
},
|
|
1632
|
+
}, S = new Intl.NumberFormat(c, {
|
|
1700
1633
|
style: "currency",
|
|
1701
1634
|
currency: v
|
|
1702
1635
|
}).format(1e3), b = we({
|
|
1703
|
-
preferences:
|
|
1636
|
+
preferences: m,
|
|
1704
1637
|
calendar: { tz: "UTC" }
|
|
1705
|
-
}),
|
|
1706
|
-
value:
|
|
1638
|
+
}), y = ce({
|
|
1639
|
+
value: ft,
|
|
1707
1640
|
metadata: { kind: "raw_temporal", valueKind: "date" },
|
|
1708
1641
|
format: b
|
|
1709
1642
|
}).text, C = ce({
|
|
1710
|
-
value:
|
|
1643
|
+
value: Pe,
|
|
1711
1644
|
metadata: { kind: "raw_temporal", valueKind: "wall_datetime" },
|
|
1712
1645
|
format: b
|
|
1713
|
-
}).text,
|
|
1714
|
-
(
|
|
1715
|
-
value:
|
|
1646
|
+
}).text, P = Le(
|
|
1647
|
+
(E) => ce({
|
|
1648
|
+
value: ft,
|
|
1716
1649
|
metadata: { kind: "raw_temporal", valueKind: "date" },
|
|
1717
1650
|
format: we({
|
|
1718
|
-
preferences: { ...
|
|
1651
|
+
preferences: { ...m, dateStyle: E },
|
|
1719
1652
|
calendar: { tz: "UTC" }
|
|
1720
1653
|
})
|
|
1721
1654
|
}).text
|
|
1722
|
-
), z =
|
|
1723
|
-
(
|
|
1724
|
-
value:
|
|
1655
|
+
), z = Le(
|
|
1656
|
+
(E) => ce({
|
|
1657
|
+
value: Pe,
|
|
1725
1658
|
metadata: { kind: "raw_temporal", valueKind: "wall_datetime" },
|
|
1726
1659
|
format: we({
|
|
1727
1660
|
preferences: {
|
|
1728
|
-
...
|
|
1729
|
-
dateTime: { ...
|
|
1661
|
+
...m,
|
|
1662
|
+
dateTime: { ...m.dateTime, dateStyle: E }
|
|
1730
1663
|
},
|
|
1731
1664
|
calendar: { tz: "UTC" }
|
|
1732
1665
|
})
|
|
1733
1666
|
}).text
|
|
1734
|
-
),
|
|
1735
|
-
(
|
|
1736
|
-
value:
|
|
1667
|
+
), O = Le(
|
|
1668
|
+
(E) => ce({
|
|
1669
|
+
value: Pe,
|
|
1737
1670
|
metadata: { kind: "raw_temporal", valueKind: "wall_datetime" },
|
|
1738
1671
|
format: we({
|
|
1739
1672
|
preferences: {
|
|
1740
|
-
...
|
|
1741
|
-
dateTime: { ...
|
|
1673
|
+
...m,
|
|
1674
|
+
dateTime: { ...m.dateTime, timeStyle: E }
|
|
1742
1675
|
},
|
|
1743
1676
|
calendar: { tz: "UTC" }
|
|
1744
1677
|
})
|
|
1745
1678
|
}).text
|
|
1746
|
-
),
|
|
1747
|
-
const
|
|
1679
|
+
), _ = (E, q) => {
|
|
1680
|
+
const $ = {
|
|
1748
1681
|
...e.dateTime,
|
|
1749
|
-
[
|
|
1682
|
+
[E]: q === "inherit" ? void 0 : q
|
|
1750
1683
|
};
|
|
1751
1684
|
n({
|
|
1752
1685
|
...e,
|
|
1753
|
-
dateTime:
|
|
1686
|
+
dateTime: $.dateStyle === void 0 && $.timeStyle === void 0 ? void 0 : $
|
|
1754
1687
|
});
|
|
1755
1688
|
};
|
|
1756
1689
|
return /* @__PURE__ */ h("div", { className: "space-y-4", children: [
|
|
1757
1690
|
/* @__PURE__ */ h("div", { className: "space-y-1.5", children: [
|
|
1758
|
-
/* @__PURE__ */
|
|
1691
|
+
/* @__PURE__ */ i(
|
|
1759
1692
|
pe,
|
|
1760
1693
|
{
|
|
1761
1694
|
htmlFor: l,
|
|
@@ -1764,18 +1697,18 @@ function sn({
|
|
|
1764
1697
|
}
|
|
1765
1698
|
),
|
|
1766
1699
|
/* @__PURE__ */ h(
|
|
1767
|
-
|
|
1700
|
+
Fe,
|
|
1768
1701
|
{
|
|
1769
1702
|
value: e.locale ?? "inherit",
|
|
1770
1703
|
disabled: r,
|
|
1771
|
-
onValueChange: (
|
|
1704
|
+
onValueChange: (E) => n({
|
|
1772
1705
|
...e,
|
|
1773
|
-
locale:
|
|
1706
|
+
locale: E === "inherit" ? void 0 : E
|
|
1774
1707
|
}),
|
|
1775
1708
|
children: [
|
|
1776
|
-
/* @__PURE__ */
|
|
1709
|
+
/* @__PURE__ */ i(Oe, { id: l, size: "xs", children: /* @__PURE__ */ i(Ue, { children: e.locale === void 0 ? `Inherited · ${a.locale}` : Xr(e.locale) }) }),
|
|
1777
1710
|
/* @__PURE__ */ h(Me, { children: [
|
|
1778
|
-
/* @__PURE__ */ h(
|
|
1711
|
+
/* @__PURE__ */ h(X, { value: "inherit", children: [
|
|
1779
1712
|
"Inherited from ",
|
|
1780
1713
|
Ke(t.locale),
|
|
1781
1714
|
" ·",
|
|
@@ -1783,68 +1716,68 @@ function sn({
|
|
|
1783
1716
|
a.locale
|
|
1784
1717
|
] }),
|
|
1785
1718
|
e.locale && !We.some(
|
|
1786
|
-
(
|
|
1787
|
-
) && /* @__PURE__ */
|
|
1788
|
-
We.map((
|
|
1789
|
-
|
|
1719
|
+
(E) => E.value === e.locale
|
|
1720
|
+
) && /* @__PURE__ */ i(X, { value: e.locale, children: e.locale }),
|
|
1721
|
+
We.map((E) => /* @__PURE__ */ h(X, { value: E.value, children: [
|
|
1722
|
+
E.label,
|
|
1790
1723
|
" — ",
|
|
1791
|
-
|
|
1792
|
-
] },
|
|
1724
|
+
E.value
|
|
1725
|
+
] }, E.value))
|
|
1793
1726
|
] })
|
|
1794
1727
|
]
|
|
1795
1728
|
}
|
|
1796
1729
|
)
|
|
1797
1730
|
] }),
|
|
1798
1731
|
/* @__PURE__ */ h("fieldset", { className: "space-y-2", children: [
|
|
1799
|
-
/* @__PURE__ */
|
|
1800
|
-
/* @__PURE__ */
|
|
1801
|
-
|
|
1732
|
+
/* @__PURE__ */ i("legend", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Date values" }),
|
|
1733
|
+
/* @__PURE__ */ i(
|
|
1734
|
+
ze,
|
|
1802
1735
|
{
|
|
1803
|
-
id:
|
|
1736
|
+
id: o,
|
|
1804
1737
|
label: "Format",
|
|
1805
1738
|
value: e.dateStyle,
|
|
1806
1739
|
inherited: a.dateStyle,
|
|
1807
1740
|
inheritedSource: t.dateStyle,
|
|
1808
|
-
examples:
|
|
1741
|
+
examples: P,
|
|
1809
1742
|
disabled: r,
|
|
1810
|
-
onValueChange: (
|
|
1743
|
+
onValueChange: (E) => n({
|
|
1811
1744
|
...e,
|
|
1812
|
-
dateStyle:
|
|
1745
|
+
dateStyle: E === "inherit" ? void 0 : E
|
|
1813
1746
|
})
|
|
1814
1747
|
}
|
|
1815
1748
|
)
|
|
1816
1749
|
] }),
|
|
1817
1750
|
/* @__PURE__ */ h("fieldset", { className: "space-y-2", children: [
|
|
1818
|
-
/* @__PURE__ */
|
|
1819
|
-
/* @__PURE__ */
|
|
1820
|
-
|
|
1751
|
+
/* @__PURE__ */ i("legend", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Date & time values" }),
|
|
1752
|
+
/* @__PURE__ */ i(
|
|
1753
|
+
ze,
|
|
1821
1754
|
{
|
|
1822
|
-
id:
|
|
1755
|
+
id: f,
|
|
1823
1756
|
label: "Date",
|
|
1824
|
-
value: (
|
|
1757
|
+
value: (I = e.dateTime) == null ? void 0 : I.dateStyle,
|
|
1825
1758
|
inherited: a.dateTime.dateStyle,
|
|
1826
1759
|
inheritedSource: t.dateTime.dateStyle,
|
|
1827
1760
|
examples: z,
|
|
1828
1761
|
disabled: r,
|
|
1829
|
-
onValueChange: (
|
|
1762
|
+
onValueChange: (E) => _("dateStyle", E)
|
|
1830
1763
|
}
|
|
1831
1764
|
),
|
|
1832
|
-
/* @__PURE__ */
|
|
1833
|
-
|
|
1765
|
+
/* @__PURE__ */ i(
|
|
1766
|
+
ze,
|
|
1834
1767
|
{
|
|
1835
1768
|
id: u,
|
|
1836
1769
|
label: "Time",
|
|
1837
|
-
value: (
|
|
1770
|
+
value: (D = e.dateTime) == null ? void 0 : D.timeStyle,
|
|
1838
1771
|
inherited: a.dateTime.timeStyle,
|
|
1839
1772
|
inheritedSource: t.dateTime.timeStyle,
|
|
1840
|
-
examples:
|
|
1773
|
+
examples: O,
|
|
1841
1774
|
disabled: r,
|
|
1842
|
-
onValueChange: (
|
|
1775
|
+
onValueChange: (E) => _("timeStyle", E)
|
|
1843
1776
|
}
|
|
1844
1777
|
)
|
|
1845
1778
|
] }),
|
|
1846
1779
|
/* @__PURE__ */ h("div", { className: "space-y-1.5", children: [
|
|
1847
|
-
/* @__PURE__ */
|
|
1780
|
+
/* @__PURE__ */ i(
|
|
1848
1781
|
pe,
|
|
1849
1782
|
{
|
|
1850
1783
|
htmlFor: s,
|
|
@@ -1853,59 +1786,59 @@ function sn({
|
|
|
1853
1786
|
}
|
|
1854
1787
|
),
|
|
1855
1788
|
/* @__PURE__ */ h(
|
|
1856
|
-
|
|
1789
|
+
Fe,
|
|
1857
1790
|
{
|
|
1858
1791
|
value: e.defaultCurrency ?? "inherit",
|
|
1859
1792
|
disabled: r,
|
|
1860
|
-
onValueChange: (
|
|
1793
|
+
onValueChange: (E) => n({
|
|
1861
1794
|
...e,
|
|
1862
|
-
defaultCurrency:
|
|
1795
|
+
defaultCurrency: E === "inherit" ? void 0 : E
|
|
1863
1796
|
}),
|
|
1864
1797
|
children: [
|
|
1865
|
-
/* @__PURE__ */
|
|
1798
|
+
/* @__PURE__ */ i(Oe, { id: s, size: "xs", children: /* @__PURE__ */ i(Ue, { children: e.defaultCurrency === void 0 ? `Inherited · ${a.defaultCurrency}` : e.defaultCurrency }) }),
|
|
1866
1799
|
/* @__PURE__ */ h(Me, { children: [
|
|
1867
|
-
/* @__PURE__ */ h(
|
|
1800
|
+
/* @__PURE__ */ h(X, { value: "inherit", children: [
|
|
1868
1801
|
"Inherited from ",
|
|
1869
1802
|
Ke(t.defaultCurrency),
|
|
1870
1803
|
" ·",
|
|
1871
1804
|
" ",
|
|
1872
1805
|
a.defaultCurrency
|
|
1873
1806
|
] }),
|
|
1874
|
-
[...
|
|
1875
|
-
|
|
1807
|
+
[...Ot].map((E) => /* @__PURE__ */ i(X, { value: E, children: E }, E)),
|
|
1808
|
+
Jr.map((E) => /* @__PURE__ */ i(X, { value: E, children: E }, E))
|
|
1876
1809
|
] })
|
|
1877
1810
|
]
|
|
1878
1811
|
}
|
|
1879
1812
|
)
|
|
1880
1813
|
] }),
|
|
1881
1814
|
/* @__PURE__ */ h("div", { className: "rounded-control border border-border/60 bg-muted/30 px-3 py-2", children: [
|
|
1882
|
-
/* @__PURE__ */
|
|
1815
|
+
/* @__PURE__ */ i("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Preview" }),
|
|
1883
1816
|
/* @__PURE__ */ h("dl", { className: "mt-1.5 space-y-1 text-[12px]", children: [
|
|
1884
1817
|
/* @__PURE__ */ h("div", { className: "flex items-baseline justify-between gap-4", children: [
|
|
1885
|
-
/* @__PURE__ */
|
|
1886
|
-
/* @__PURE__ */
|
|
1818
|
+
/* @__PURE__ */ i("dt", { className: "text-muted-foreground", children: "Date" }),
|
|
1819
|
+
/* @__PURE__ */ i("dd", { className: "text-right font-medium text-foreground", children: y })
|
|
1887
1820
|
] }),
|
|
1888
1821
|
/* @__PURE__ */ h("div", { className: "flex items-baseline justify-between gap-4", children: [
|
|
1889
|
-
/* @__PURE__ */
|
|
1890
|
-
/* @__PURE__ */
|
|
1822
|
+
/* @__PURE__ */ i("dt", { className: "text-muted-foreground", children: "Date & time" }),
|
|
1823
|
+
/* @__PURE__ */ i("dd", { className: "text-right font-medium text-foreground", children: C })
|
|
1891
1824
|
] }),
|
|
1892
1825
|
/* @__PURE__ */ h("div", { className: "flex items-baseline justify-between gap-4", children: [
|
|
1893
|
-
/* @__PURE__ */
|
|
1894
|
-
/* @__PURE__ */
|
|
1826
|
+
/* @__PURE__ */ i("dt", { className: "text-muted-foreground", children: "Currency" }),
|
|
1827
|
+
/* @__PURE__ */ i("dd", { className: "text-right font-medium text-foreground", children: S })
|
|
1895
1828
|
] })
|
|
1896
1829
|
] })
|
|
1897
1830
|
] }),
|
|
1898
|
-
/* @__PURE__ */
|
|
1831
|
+
/* @__PURE__ */ i("p", { className: "text-[11px] text-muted-foreground", children: "Currency values are not converted. Date examples use a fixed reference value and the Gregorian calendar." })
|
|
1899
1832
|
] });
|
|
1900
1833
|
}
|
|
1901
|
-
const
|
|
1834
|
+
const ht = [
|
|
1902
1835
|
"locale",
|
|
1903
1836
|
"dateStyle",
|
|
1904
1837
|
"dateTime.dateStyle",
|
|
1905
1838
|
"dateTime.timeStyle",
|
|
1906
1839
|
"defaultCurrency"
|
|
1907
1840
|
];
|
|
1908
|
-
function
|
|
1841
|
+
function pt(e, a) {
|
|
1909
1842
|
var t, n;
|
|
1910
1843
|
switch (a) {
|
|
1911
1844
|
case "locale":
|
|
@@ -1920,7 +1853,7 @@ function bt(e, a) {
|
|
|
1920
1853
|
return e == null ? void 0 : e.defaultCurrency;
|
|
1921
1854
|
}
|
|
1922
1855
|
}
|
|
1923
|
-
function
|
|
1856
|
+
function Yr(e) {
|
|
1924
1857
|
var n, r;
|
|
1925
1858
|
const a = (n = e == null ? void 0 : e.dateTime) == null ? void 0 : n.dateStyle, t = (r = e == null ? void 0 : e.dateTime) == null ? void 0 : r.timeStyle;
|
|
1926
1859
|
return {
|
|
@@ -1930,33 +1863,33 @@ function ln(e) {
|
|
|
1930
1863
|
defaultCurrency: e == null ? void 0 : e.defaultCurrency
|
|
1931
1864
|
};
|
|
1932
1865
|
}
|
|
1933
|
-
function
|
|
1866
|
+
function Qr({
|
|
1934
1867
|
active: e,
|
|
1935
1868
|
onClose: a
|
|
1936
1869
|
}) {
|
|
1937
|
-
var
|
|
1938
|
-
const { preferences: t, isLoading: n, isSaving: r, updatePreferences: l } =
|
|
1870
|
+
var o, f, u, w, c, v, m;
|
|
1871
|
+
const { preferences: t, isLoading: n, isSaving: r, updatePreferences: l } = Hr({ enabled: e });
|
|
1939
1872
|
if (!e) return null;
|
|
1940
1873
|
if (!t)
|
|
1941
1874
|
return /* @__PURE__ */ h(te, { children: [
|
|
1942
|
-
/* @__PURE__ */
|
|
1943
|
-
/* @__PURE__ */ h(
|
|
1944
|
-
/* @__PURE__ */
|
|
1875
|
+
/* @__PURE__ */ i("div", { className: "py-2", children: /* @__PURE__ */ i("div", { className: "flex min-h-36 items-center justify-center text-[12px] text-muted-foreground", children: n ? "Loading preferences…" : "Preferences unavailable." }) }),
|
|
1876
|
+
/* @__PURE__ */ h(He, { className: "justify-between sm:justify-between", children: [
|
|
1877
|
+
/* @__PURE__ */ i(K, { variant: "ghost", size: "xs", disabled: !0, children: "Reset display formats" }),
|
|
1945
1878
|
/* @__PURE__ */ h("div", { className: "flex gap-2", children: [
|
|
1946
|
-
/* @__PURE__ */
|
|
1947
|
-
/* @__PURE__ */
|
|
1879
|
+
/* @__PURE__ */ i(K, { variant: "outline", size: "xs", onClick: a, children: "Cancel" }),
|
|
1880
|
+
/* @__PURE__ */ i(K, { size: "xs", disabled: !0, children: "Save" })
|
|
1948
1881
|
] })
|
|
1949
1882
|
] })
|
|
1950
1883
|
] });
|
|
1951
1884
|
const s = [
|
|
1952
|
-
((
|
|
1953
|
-
((
|
|
1954
|
-
((
|
|
1885
|
+
((o = t.stored) == null ? void 0 : o.locale) ?? "",
|
|
1886
|
+
((f = t.stored) == null ? void 0 : f.dateStyle) ?? "",
|
|
1887
|
+
((w = (u = t.stored) == null ? void 0 : u.dateTime) == null ? void 0 : w.dateStyle) ?? "",
|
|
1955
1888
|
((v = (c = t.stored) == null ? void 0 : c.dateTime) == null ? void 0 : v.timeStyle) ?? "",
|
|
1956
|
-
((
|
|
1889
|
+
((m = t.stored) == null ? void 0 : m.defaultCurrency) ?? ""
|
|
1957
1890
|
].join(":");
|
|
1958
|
-
return /* @__PURE__ */
|
|
1959
|
-
|
|
1891
|
+
return /* @__PURE__ */ i(
|
|
1892
|
+
en,
|
|
1960
1893
|
{
|
|
1961
1894
|
preferences: t,
|
|
1962
1895
|
isSaving: r,
|
|
@@ -1966,38 +1899,38 @@ function on({
|
|
|
1966
1899
|
s
|
|
1967
1900
|
);
|
|
1968
1901
|
}
|
|
1969
|
-
function
|
|
1902
|
+
function en({
|
|
1970
1903
|
preferences: e,
|
|
1971
1904
|
isSaving: a,
|
|
1972
1905
|
updatePreferences: t,
|
|
1973
1906
|
onClose: n
|
|
1974
1907
|
}) {
|
|
1975
|
-
var u,
|
|
1976
|
-
const [r, l] =
|
|
1977
|
-
() =>
|
|
1978
|
-
), s = (r.locale === void 0 ||
|
|
1908
|
+
var u, w;
|
|
1909
|
+
const [r, l] = F(
|
|
1910
|
+
() => Yr(e.stored)
|
|
1911
|
+
), s = (r.locale === void 0 || wt(r.locale) !== void 0) && (r.defaultCurrency === void 0 || Ba(r.defaultCurrency) !== void 0) && (r.dateStyle === void 0 || ["short", "medium", "long"].includes(r.dateStyle)) && (((u = r.dateTime) == null ? void 0 : u.dateStyle) === void 0 || ["short", "medium", "long"].includes(r.dateTime.dateStyle)) && (((w = r.dateTime) == null ? void 0 : w.timeStyle) === void 0 || ["short", "medium", "long"].includes(r.dateTime.timeStyle)), o = async () => {
|
|
1979
1912
|
const c = {
|
|
1980
1913
|
...r.locale !== void 0 ? { locale: r.locale } : {},
|
|
1981
1914
|
...r.dateStyle !== void 0 ? { dateStyle: r.dateStyle } : {},
|
|
1982
1915
|
...r.dateTime ? { dateTime: { ...r.dateTime } } : {},
|
|
1983
1916
|
...r.defaultCurrency !== void 0 ? { defaultCurrency: r.defaultCurrency } : {}
|
|
1984
|
-
}, v =
|
|
1985
|
-
(b) =>
|
|
1986
|
-
),
|
|
1917
|
+
}, v = ht.filter(
|
|
1918
|
+
(b) => pt(r, b) === void 0 && pt(e.stored, b) !== void 0
|
|
1919
|
+
), m = {
|
|
1987
1920
|
...Object.keys(c).length > 0 ? { set: c } : {},
|
|
1988
1921
|
...v.length > 0 ? { clear: v } : {}
|
|
1989
1922
|
};
|
|
1990
|
-
(Object.keys(
|
|
1991
|
-
},
|
|
1923
|
+
(Object.keys(m).length === 0 ? !0 : await t(m)) ? (G.success("Display format preferences saved."), n()) : G.error("Failed to save preferences. Please try again.");
|
|
1924
|
+
}, f = async () => {
|
|
1992
1925
|
await t({
|
|
1993
|
-
clear: [...
|
|
1926
|
+
clear: [...ht]
|
|
1994
1927
|
}) ? (G.success("Display format preferences reset."), n()) : G.error(
|
|
1995
1928
|
"Failed to reset display format preferences. Please try again."
|
|
1996
1929
|
);
|
|
1997
1930
|
};
|
|
1998
1931
|
return /* @__PURE__ */ h(te, { children: [
|
|
1999
|
-
/* @__PURE__ */
|
|
2000
|
-
|
|
1932
|
+
/* @__PURE__ */ i("div", { className: "py-2", children: /* @__PURE__ */ i(
|
|
1933
|
+
Zr,
|
|
2001
1934
|
{
|
|
2002
1935
|
value: r,
|
|
2003
1936
|
inherited: e.inherited,
|
|
@@ -2006,20 +1939,20 @@ function dn({
|
|
|
2006
1939
|
disabled: a
|
|
2007
1940
|
}
|
|
2008
1941
|
) }),
|
|
2009
|
-
/* @__PURE__ */ h(
|
|
2010
|
-
/* @__PURE__ */
|
|
2011
|
-
|
|
1942
|
+
/* @__PURE__ */ h(He, { className: "justify-between sm:justify-between", children: [
|
|
1943
|
+
/* @__PURE__ */ i(
|
|
1944
|
+
K,
|
|
2012
1945
|
{
|
|
2013
1946
|
variant: "ghost",
|
|
2014
1947
|
size: "xs",
|
|
2015
|
-
onClick:
|
|
1948
|
+
onClick: f,
|
|
2016
1949
|
disabled: a || e.stored === null,
|
|
2017
1950
|
children: "Reset display formats"
|
|
2018
1951
|
}
|
|
2019
1952
|
),
|
|
2020
1953
|
/* @__PURE__ */ h("div", { className: "flex gap-2", children: [
|
|
2021
|
-
/* @__PURE__ */
|
|
2022
|
-
|
|
1954
|
+
/* @__PURE__ */ i(
|
|
1955
|
+
K,
|
|
2023
1956
|
{
|
|
2024
1957
|
variant: "outline",
|
|
2025
1958
|
size: "xs",
|
|
@@ -2028,14 +1961,14 @@ function dn({
|
|
|
2028
1961
|
children: "Cancel"
|
|
2029
1962
|
}
|
|
2030
1963
|
),
|
|
2031
|
-
/* @__PURE__ */
|
|
2032
|
-
|
|
1964
|
+
/* @__PURE__ */ i(
|
|
1965
|
+
K,
|
|
2033
1966
|
{
|
|
2034
1967
|
size: "xs",
|
|
2035
|
-
onClick:
|
|
1968
|
+
onClick: o,
|
|
2036
1969
|
disabled: a || !s,
|
|
2037
1970
|
children: a ? /* @__PURE__ */ h(te, { children: [
|
|
2038
|
-
/* @__PURE__ */
|
|
1971
|
+
/* @__PURE__ */ i(yt, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
2039
1972
|
"Saving…"
|
|
2040
1973
|
] }) : "Save"
|
|
2041
1974
|
}
|
|
@@ -2044,30 +1977,30 @@ function dn({
|
|
|
2044
1977
|
] })
|
|
2045
1978
|
] });
|
|
2046
1979
|
}
|
|
2047
|
-
function
|
|
1980
|
+
function yn({
|
|
2048
1981
|
open: e,
|
|
2049
1982
|
onOpenChange: a
|
|
2050
1983
|
}) {
|
|
2051
|
-
const [t, n] =
|
|
2052
|
-
return /* @__PURE__ */
|
|
2053
|
-
/* @__PURE__ */ h(
|
|
2054
|
-
/* @__PURE__ */
|
|
2055
|
-
/* @__PURE__ */
|
|
1984
|
+
const [t, n] = F("display"), r = () => a(!1);
|
|
1985
|
+
return /* @__PURE__ */ i(ya, { open: e, onOpenChange: a, children: /* @__PURE__ */ h(wa, { className: "rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control", children: [
|
|
1986
|
+
/* @__PURE__ */ h(Sa, { children: [
|
|
1987
|
+
/* @__PURE__ */ i(xa, { className: "text-[15px]", children: "Report preferences" }),
|
|
1988
|
+
/* @__PURE__ */ i(Ca, { className: "text-[13px] leading-5", children: "Set how values and Calendar periods appear for you." })
|
|
2056
1989
|
] }),
|
|
2057
|
-
/* @__PURE__ */ h(
|
|
2058
|
-
/* @__PURE__ */ h(
|
|
2059
|
-
/* @__PURE__ */
|
|
2060
|
-
/* @__PURE__ */
|
|
1990
|
+
/* @__PURE__ */ h(Oa, { value: t, onValueChange: n, children: [
|
|
1991
|
+
/* @__PURE__ */ h(Ua, { variant: "underline", className: "w-full justify-start", children: [
|
|
1992
|
+
/* @__PURE__ */ i(rt, { value: "display", children: "Display formats" }),
|
|
1993
|
+
/* @__PURE__ */ i(rt, { value: "calendar", children: "Calendar" })
|
|
2061
1994
|
] }),
|
|
2062
|
-
/* @__PURE__ */
|
|
2063
|
-
|
|
1995
|
+
/* @__PURE__ */ i(nt, { value: "display", children: /* @__PURE__ */ i(
|
|
1996
|
+
Qr,
|
|
2064
1997
|
{
|
|
2065
1998
|
active: e && t === "display",
|
|
2066
1999
|
onClose: r
|
|
2067
2000
|
}
|
|
2068
2001
|
) }),
|
|
2069
|
-
/* @__PURE__ */
|
|
2070
|
-
|
|
2002
|
+
/* @__PURE__ */ i(nt, { value: "calendar", children: /* @__PURE__ */ i(
|
|
2003
|
+
qr,
|
|
2071
2004
|
{
|
|
2072
2005
|
active: e && t === "calendar",
|
|
2073
2006
|
onClose: r
|
|
@@ -2077,27 +2010,18 @@ function Rn({
|
|
|
2077
2010
|
] }) });
|
|
2078
2011
|
}
|
|
2079
2012
|
export {
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
Lt as
|
|
2088
|
-
zt as d,
|
|
2013
|
+
Ga as A,
|
|
2014
|
+
Rt as C,
|
|
2015
|
+
gn as D,
|
|
2016
|
+
yn as R,
|
|
2017
|
+
Zr as a,
|
|
2018
|
+
Pt as b,
|
|
2019
|
+
_t as c,
|
|
2020
|
+
Lt as d,
|
|
2089
2021
|
$e as e,
|
|
2090
2022
|
Ve as f,
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
Tn as k,
|
|
2096
|
-
Nn as l,
|
|
2097
|
-
lr as m,
|
|
2098
|
-
gr as n,
|
|
2099
|
-
br as o,
|
|
2100
|
-
Xe as p,
|
|
2101
|
-
rr as t,
|
|
2102
|
-
En as u
|
|
2023
|
+
rr as g,
|
|
2024
|
+
vn as h,
|
|
2025
|
+
dr as i,
|
|
2026
|
+
cr as u
|
|
2103
2027
|
};
|