@odynn/awayz-core 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { useMemo as
|
|
4
|
-
import { u as D, a as
|
|
5
|
-
import { r as
|
|
6
|
-
import { useQuery as
|
|
1
|
+
import { jsx as d, Fragment as tt, jsxs as R } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import { useMemo as rt } from "react";
|
|
4
|
+
import { u as D, a as nt, c as A, b as q, d as he, e as ot, f as st, g as G, o as it, s as at, h as ct, i as lt, j as ut, k as dt, l as pt, m as ft, n as ht, p as vt, P as ve } from "../../index-BC-KTkxU.js";
|
|
5
|
+
import { r as mt, R as yt } from "../../index-Cv-wvFlM.js";
|
|
6
|
+
import { useQuery as gt } from "@tanstack/react-query";
|
|
7
7
|
import "../../arrayExtensions-DlcBOj5a.js";
|
|
8
|
-
import { E as
|
|
9
|
-
import { b as
|
|
8
|
+
import { E as Ct } from "../../AccountService-CtMwRIoL.js";
|
|
9
|
+
import { b as de } from "../../index-agnspg2e.js";
|
|
10
10
|
import "../../context/AwayzContext.js";
|
|
11
11
|
import "../../configs/awayzClient.js";
|
|
12
12
|
import { useAwayzContext as wt } from "../../hooks/useAwayzContext.js";
|
|
13
13
|
import "../../services/noRetryInstance.js";
|
|
14
|
-
import { CurrencyService as
|
|
15
|
-
import { EInvalidAmountDisplayOption as N, EToolTipPosition as
|
|
14
|
+
import { CurrencyService as Et } from "../../services/currency/CurrencyService.js";
|
|
15
|
+
import { EInvalidAmountDisplayOption as N, EToolTipPosition as Pt } from "./CashValueTypes.js";
|
|
16
16
|
import '../../assets/_styles.css';import '../../assets/_styles5.css';import '../../assets/_styles4.css';import '../../assets/_styles3.css';import '../../assets/_styles2.css';/* empty css */
|
|
17
17
|
/* empty css */
|
|
18
18
|
/* empty css */
|
|
@@ -24,66 +24,73 @@ const Y = (e, t) => {
|
|
|
24
24
|
currency: t ?? "USD"
|
|
25
25
|
});
|
|
26
26
|
if (!e) return r.format(0);
|
|
27
|
-
const
|
|
28
|
-
return r.format(
|
|
29
|
-
},
|
|
30
|
-
if (e < 0) return "N/A";
|
|
27
|
+
const n = parseFloat(e.toString());
|
|
28
|
+
return r.format(n);
|
|
29
|
+
}, bt = (e, t) => {
|
|
31
30
|
var r = new Intl.NumberFormat("en-US", {
|
|
32
31
|
style: "currency",
|
|
33
32
|
currency: t ?? "USD"
|
|
34
33
|
});
|
|
35
34
|
return r.format(Math.round(e)).toString().split(".")[0];
|
|
35
|
+
}, xt = (e, t, r = 0) => {
|
|
36
|
+
const n = parseFloat((e == null ? void 0 : e.toString()) || "0");
|
|
37
|
+
return new Intl.NumberFormat("en-US", {
|
|
38
|
+
style: "currency",
|
|
39
|
+
currency: t ?? "USD",
|
|
40
|
+
minimumFractionDigits: r,
|
|
41
|
+
maximumFractionDigits: r
|
|
42
|
+
}).format(isNaN(n) ? 0 : n);
|
|
36
43
|
};
|
|
37
44
|
// @__NO_SIDE_EFFECTS__
|
|
38
|
-
function
|
|
39
|
-
const t = /* @__PURE__ */
|
|
40
|
-
const { children:
|
|
41
|
-
if (
|
|
42
|
-
const
|
|
43
|
-
return /* @__PURE__ */
|
|
45
|
+
function Tt(e) {
|
|
46
|
+
const t = /* @__PURE__ */ At(e), r = s.forwardRef((n, o) => {
|
|
47
|
+
const { children: i, ...a } = n, l = s.Children.toArray(i), c = l.find(St);
|
|
48
|
+
if (c) {
|
|
49
|
+
const u = c.props.children, p = l.map((f) => f === c ? s.Children.count(u) > 1 ? s.Children.only(null) : s.isValidElement(u) ? u.props.children : null : f);
|
|
50
|
+
return /* @__PURE__ */ d(t, { ...a, ref: o, children: s.isValidElement(u) ? s.cloneElement(u, void 0, p) : null });
|
|
44
51
|
}
|
|
45
|
-
return /* @__PURE__ */
|
|
52
|
+
return /* @__PURE__ */ d(t, { ...a, ref: o, children: i });
|
|
46
53
|
});
|
|
47
54
|
return r.displayName = `${e}.Slot`, r;
|
|
48
55
|
}
|
|
49
56
|
// @__NO_SIDE_EFFECTS__
|
|
50
|
-
function
|
|
51
|
-
const t =
|
|
52
|
-
const { children:
|
|
53
|
-
if (
|
|
54
|
-
const
|
|
55
|
-
return
|
|
57
|
+
function At(e) {
|
|
58
|
+
const t = s.forwardRef((r, n) => {
|
|
59
|
+
const { children: o, ...i } = r, a = s.isValidElement(o) ? Nt(o) : void 0, l = D(a, n);
|
|
60
|
+
if (s.isValidElement(o)) {
|
|
61
|
+
const c = Ot(i, o.props);
|
|
62
|
+
return o.type !== s.Fragment && (c.ref = l), s.cloneElement(o, c);
|
|
56
63
|
}
|
|
57
|
-
return
|
|
64
|
+
return s.Children.count(o) > 1 ? s.Children.only(null) : null;
|
|
58
65
|
});
|
|
59
66
|
return t.displayName = `${e}.SlotClone`, t;
|
|
60
67
|
}
|
|
61
|
-
var
|
|
68
|
+
var me = Symbol("radix.slottable");
|
|
62
69
|
// @__NO_SIDE_EFFECTS__
|
|
63
|
-
function At(e) {
|
|
64
|
-
const t = ({ children: r }) => /* @__PURE__ */ c(rt, { children: r });
|
|
65
|
-
return t.displayName = `${e}.Slottable`, t.__radixId = ye, t;
|
|
66
|
-
}
|
|
67
70
|
function Rt(e) {
|
|
68
|
-
|
|
71
|
+
const t = ({ children: r }) => /* @__PURE__ */ d(tt, { children: r });
|
|
72
|
+
return t.displayName = `${e}.Slottable`, t.__radixId = me, t;
|
|
73
|
+
}
|
|
74
|
+
function St(e) {
|
|
75
|
+
return s.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === me;
|
|
69
76
|
}
|
|
70
77
|
function Ot(e, t) {
|
|
71
78
|
const r = { ...t };
|
|
72
|
-
for (const
|
|
73
|
-
const
|
|
74
|
-
/^on[A-Z]/.test(
|
|
75
|
-
const
|
|
76
|
-
return
|
|
77
|
-
} :
|
|
79
|
+
for (const n in t) {
|
|
80
|
+
const o = e[n], i = t[n];
|
|
81
|
+
/^on[A-Z]/.test(n) ? o && i ? r[n] = (...l) => {
|
|
82
|
+
const c = i(...l);
|
|
83
|
+
return o(...l), c;
|
|
84
|
+
} : o && (r[n] = o) : n === "style" ? r[n] = { ...o, ...i } : n === "className" && (r[n] = [o, i].filter(Boolean).join(" "));
|
|
78
85
|
}
|
|
79
86
|
return { ...e, ...r };
|
|
80
87
|
}
|
|
81
|
-
function
|
|
82
|
-
var
|
|
83
|
-
let t = (
|
|
84
|
-
return r ? e.ref : (t = (
|
|
88
|
+
function Nt(e) {
|
|
89
|
+
var n, o;
|
|
90
|
+
let t = (n = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : n.get, r = t && "isReactWarning" in t && t.isReactWarning;
|
|
91
|
+
return r ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, r = t && "isReactWarning" in t && t.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
|
|
85
92
|
}
|
|
86
|
-
var
|
|
93
|
+
var Dt = [
|
|
87
94
|
"a",
|
|
88
95
|
"button",
|
|
89
96
|
"div",
|
|
@@ -101,53 +108,53 @@ var Nt = [
|
|
|
101
108
|
"span",
|
|
102
109
|
"svg",
|
|
103
110
|
"ul"
|
|
104
|
-
],
|
|
105
|
-
const r = /* @__PURE__ */
|
|
106
|
-
const { asChild: a, ...
|
|
107
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ c
|
|
111
|
+
], S = Dt.reduce((e, t) => {
|
|
112
|
+
const r = /* @__PURE__ */ Tt(`Primitive.${t}`), n = s.forwardRef((o, i) => {
|
|
113
|
+
const { asChild: a, ...l } = o, c = a ? r : t;
|
|
114
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ d(c, { ...l, ref: i });
|
|
108
115
|
});
|
|
109
|
-
return
|
|
116
|
+
return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
|
|
110
117
|
}, {});
|
|
111
|
-
function
|
|
112
|
-
e &&
|
|
118
|
+
function _t(e, t) {
|
|
119
|
+
e && mt.flushSync(() => e.dispatchEvent(t));
|
|
113
120
|
}
|
|
114
|
-
var
|
|
121
|
+
var Lt = "DismissableLayer", z = "dismissableLayer.update", It = "dismissableLayer.pointerDownOutside", Mt = "dismissableLayer.focusOutside", pe, ye = s.createContext({
|
|
115
122
|
layers: /* @__PURE__ */ new Set(),
|
|
116
123
|
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
117
124
|
branches: /* @__PURE__ */ new Set()
|
|
118
|
-
}),
|
|
125
|
+
}), ge = s.forwardRef(
|
|
119
126
|
(e, t) => {
|
|
120
127
|
const {
|
|
121
128
|
disableOutsidePointerEvents: r = !1,
|
|
122
|
-
onEscapeKeyDown:
|
|
123
|
-
onPointerDownOutside:
|
|
124
|
-
onFocusOutside:
|
|
129
|
+
onEscapeKeyDown: n,
|
|
130
|
+
onPointerDownOutside: o,
|
|
131
|
+
onFocusOutside: i,
|
|
125
132
|
onInteractOutside: a,
|
|
126
|
-
onDismiss:
|
|
127
|
-
...
|
|
128
|
-
} = e,
|
|
129
|
-
const
|
|
130
|
-
!P ||
|
|
131
|
-
},
|
|
132
|
-
const
|
|
133
|
-
[...
|
|
134
|
-
},
|
|
135
|
-
return
|
|
136
|
-
|
|
137
|
-
},
|
|
138
|
-
if (
|
|
139
|
-
return r && (
|
|
140
|
-
r &&
|
|
133
|
+
onDismiss: l,
|
|
134
|
+
...c
|
|
135
|
+
} = e, u = s.useContext(ye), [p, f] = s.useState(null), h = (p == null ? void 0 : p.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, v] = s.useState({}), m = D(t, (g) => f(g)), y = Array.from(u.layers), [C] = [...u.layersWithOutsidePointerEventsDisabled].slice(-1), E = y.indexOf(C), w = p ? y.indexOf(p) : -1, x = u.layersWithOutsidePointerEventsDisabled.size > 0, P = w >= E, T = kt((g) => {
|
|
136
|
+
const O = g.target, k = [...u.branches].some((I) => I.contains(O));
|
|
137
|
+
!P || k || (o == null || o(g), a == null || a(g), g.defaultPrevented || l == null || l());
|
|
138
|
+
}, h), b = $t((g) => {
|
|
139
|
+
const O = g.target;
|
|
140
|
+
[...u.branches].some((I) => I.contains(O)) || (i == null || i(g), a == null || a(g), g.defaultPrevented || l == null || l());
|
|
141
|
+
}, h);
|
|
142
|
+
return nt((g) => {
|
|
143
|
+
w === u.layers.size - 1 && (n == null || n(g), !g.defaultPrevented && l && (g.preventDefault(), l()));
|
|
144
|
+
}, h), s.useEffect(() => {
|
|
145
|
+
if (p)
|
|
146
|
+
return r && (u.layersWithOutsidePointerEventsDisabled.size === 0 && (pe = h.body.style.pointerEvents, h.body.style.pointerEvents = "none"), u.layersWithOutsidePointerEventsDisabled.add(p)), u.layers.add(p), fe(), () => {
|
|
147
|
+
r && u.layersWithOutsidePointerEventsDisabled.size === 1 && (h.body.style.pointerEvents = pe);
|
|
141
148
|
};
|
|
142
|
-
}, [
|
|
143
|
-
|
|
144
|
-
}, [
|
|
145
|
-
const g = () =>
|
|
149
|
+
}, [p, h, r, u]), s.useEffect(() => () => {
|
|
150
|
+
p && (u.layers.delete(p), u.layersWithOutsidePointerEventsDisabled.delete(p), fe());
|
|
151
|
+
}, [p, u]), s.useEffect(() => {
|
|
152
|
+
const g = () => v({});
|
|
146
153
|
return document.addEventListener(z, g), () => document.removeEventListener(z, g);
|
|
147
|
-
}, []), /* @__PURE__ */
|
|
148
|
-
|
|
154
|
+
}, []), /* @__PURE__ */ d(
|
|
155
|
+
S.div,
|
|
149
156
|
{
|
|
150
|
-
...
|
|
157
|
+
...c,
|
|
151
158
|
ref: m,
|
|
152
159
|
style: {
|
|
153
160
|
pointerEvents: x ? P ? "auto" : "none" : void 0,
|
|
@@ -163,198 +170,198 @@ var _t = "DismissableLayer", z = "dismissableLayer.update", Lt = "dismissableLay
|
|
|
163
170
|
);
|
|
164
171
|
}
|
|
165
172
|
);
|
|
166
|
-
|
|
167
|
-
var
|
|
168
|
-
const r =
|
|
169
|
-
return
|
|
170
|
-
const
|
|
171
|
-
if (
|
|
172
|
-
return r.branches.add(
|
|
173
|
-
r.branches.delete(
|
|
173
|
+
ge.displayName = Lt;
|
|
174
|
+
var Ht = "DismissableLayerBranch", Ft = s.forwardRef((e, t) => {
|
|
175
|
+
const r = s.useContext(ye), n = s.useRef(null), o = D(t, n);
|
|
176
|
+
return s.useEffect(() => {
|
|
177
|
+
const i = n.current;
|
|
178
|
+
if (i)
|
|
179
|
+
return r.branches.add(i), () => {
|
|
180
|
+
r.branches.delete(i);
|
|
174
181
|
};
|
|
175
|
-
}, [r.branches]), /* @__PURE__ */
|
|
182
|
+
}, [r.branches]), /* @__PURE__ */ d(S.div, { ...e, ref: o });
|
|
176
183
|
});
|
|
177
|
-
|
|
184
|
+
Ft.displayName = Ht;
|
|
178
185
|
function kt(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
179
|
-
const r = q(e),
|
|
186
|
+
const r = q(e), n = s.useRef(!1), o = s.useRef(() => {
|
|
180
187
|
});
|
|
181
|
-
return
|
|
182
|
-
const
|
|
183
|
-
if (
|
|
184
|
-
let
|
|
185
|
-
|
|
186
|
-
|
|
188
|
+
return s.useEffect(() => {
|
|
189
|
+
const i = (l) => {
|
|
190
|
+
if (l.target && !n.current) {
|
|
191
|
+
let c = function() {
|
|
192
|
+
Ce(
|
|
193
|
+
It,
|
|
187
194
|
r,
|
|
188
|
-
|
|
195
|
+
u,
|
|
189
196
|
{ discrete: !0 }
|
|
190
197
|
);
|
|
191
198
|
};
|
|
192
|
-
const
|
|
193
|
-
|
|
199
|
+
const u = { originalEvent: l };
|
|
200
|
+
l.pointerType === "touch" ? (t.removeEventListener("click", o.current), o.current = c, t.addEventListener("click", o.current, { once: !0 })) : c();
|
|
194
201
|
} else
|
|
195
|
-
t.removeEventListener("click",
|
|
196
|
-
|
|
202
|
+
t.removeEventListener("click", o.current);
|
|
203
|
+
n.current = !1;
|
|
197
204
|
}, a = window.setTimeout(() => {
|
|
198
|
-
t.addEventListener("pointerdown",
|
|
205
|
+
t.addEventListener("pointerdown", i);
|
|
199
206
|
}, 0);
|
|
200
207
|
return () => {
|
|
201
|
-
window.clearTimeout(a), t.removeEventListener("pointerdown",
|
|
208
|
+
window.clearTimeout(a), t.removeEventListener("pointerdown", i), t.removeEventListener("click", o.current);
|
|
202
209
|
};
|
|
203
210
|
}, [t, r]), {
|
|
204
211
|
// ensures we check React component tree (not just DOM tree)
|
|
205
|
-
onPointerDownCapture: () =>
|
|
212
|
+
onPointerDownCapture: () => n.current = !0
|
|
206
213
|
};
|
|
207
214
|
}
|
|
208
|
-
function
|
|
209
|
-
const r = q(e),
|
|
210
|
-
return
|
|
211
|
-
const
|
|
212
|
-
|
|
215
|
+
function $t(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
216
|
+
const r = q(e), n = s.useRef(!1);
|
|
217
|
+
return s.useEffect(() => {
|
|
218
|
+
const o = (i) => {
|
|
219
|
+
i.target && !n.current && Ce(Mt, r, { originalEvent: i }, {
|
|
213
220
|
discrete: !1
|
|
214
221
|
});
|
|
215
222
|
};
|
|
216
|
-
return t.addEventListener("focusin",
|
|
223
|
+
return t.addEventListener("focusin", o), () => t.removeEventListener("focusin", o);
|
|
217
224
|
}, [t, r]), {
|
|
218
|
-
onFocusCapture: () =>
|
|
219
|
-
onBlurCapture: () =>
|
|
225
|
+
onFocusCapture: () => n.current = !0,
|
|
226
|
+
onBlurCapture: () => n.current = !1
|
|
220
227
|
};
|
|
221
228
|
}
|
|
222
|
-
function
|
|
229
|
+
function fe() {
|
|
223
230
|
const e = new CustomEvent(z);
|
|
224
231
|
document.dispatchEvent(e);
|
|
225
232
|
}
|
|
226
|
-
function
|
|
227
|
-
const
|
|
228
|
-
t &&
|
|
233
|
+
function Ce(e, t, r, { discrete: n }) {
|
|
234
|
+
const o = r.originalEvent.target, i = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: r });
|
|
235
|
+
t && o.addEventListener(e, t, { once: !0 }), n ? _t(o, i) : o.dispatchEvent(i);
|
|
229
236
|
}
|
|
230
|
-
var
|
|
231
|
-
const { children: r, width:
|
|
232
|
-
return /* @__PURE__ */
|
|
233
|
-
|
|
237
|
+
var Wt = "Arrow", we = s.forwardRef((e, t) => {
|
|
238
|
+
const { children: r, width: n = 10, height: o = 5, ...i } = e;
|
|
239
|
+
return /* @__PURE__ */ d(
|
|
240
|
+
S.svg,
|
|
234
241
|
{
|
|
235
|
-
...
|
|
242
|
+
...i,
|
|
236
243
|
ref: t,
|
|
237
|
-
width:
|
|
238
|
-
height:
|
|
244
|
+
width: n,
|
|
245
|
+
height: o,
|
|
239
246
|
viewBox: "0 0 30 10",
|
|
240
247
|
preserveAspectRatio: "none",
|
|
241
|
-
children: e.asChild ? r : /* @__PURE__ */
|
|
248
|
+
children: e.asChild ? r : /* @__PURE__ */ d("polygon", { points: "0,0 30,0 15,10" })
|
|
242
249
|
}
|
|
243
250
|
);
|
|
244
251
|
});
|
|
245
|
-
we.displayName =
|
|
246
|
-
var
|
|
247
|
-
const { __scopePopper: t, children: r } = e, [
|
|
248
|
-
return /* @__PURE__ */
|
|
252
|
+
we.displayName = Wt;
|
|
253
|
+
var Bt = we, K = "Popper", [Ee, Pe] = he(K), [Ut, be] = Ee(K), xe = (e) => {
|
|
254
|
+
const { __scopePopper: t, children: r } = e, [n, o] = s.useState(null);
|
|
255
|
+
return /* @__PURE__ */ d(Ut, { scope: t, anchor: n, onAnchorChange: o, children: r });
|
|
249
256
|
};
|
|
250
|
-
|
|
251
|
-
var
|
|
257
|
+
xe.displayName = K;
|
|
258
|
+
var Te = "PopperAnchor", Ae = s.forwardRef(
|
|
252
259
|
(e, t) => {
|
|
253
|
-
const { __scopePopper: r, virtualRef:
|
|
254
|
-
return
|
|
255
|
-
|
|
256
|
-
}),
|
|
260
|
+
const { __scopePopper: r, virtualRef: n, ...o } = e, i = be(Te, r), a = s.useRef(null), l = D(t, a);
|
|
261
|
+
return s.useEffect(() => {
|
|
262
|
+
i.onAnchorChange((n == null ? void 0 : n.current) || a.current);
|
|
263
|
+
}), n ? null : /* @__PURE__ */ d(S.div, { ...o, ref: l });
|
|
257
264
|
}
|
|
258
265
|
);
|
|
259
|
-
|
|
260
|
-
var Q = "PopperContent", [
|
|
266
|
+
Ae.displayName = Te;
|
|
267
|
+
var Q = "PopperContent", [Yt, Vt] = Ee(Q), Re = s.forwardRef(
|
|
261
268
|
(e, t) => {
|
|
262
|
-
var oe, se, ie, ae,
|
|
269
|
+
var oe, se, ie, ae, ce, le;
|
|
263
270
|
const {
|
|
264
271
|
__scopePopper: r,
|
|
265
|
-
side:
|
|
266
|
-
sideOffset:
|
|
267
|
-
align:
|
|
272
|
+
side: n = "bottom",
|
|
273
|
+
sideOffset: o = 0,
|
|
274
|
+
align: i = "center",
|
|
268
275
|
alignOffset: a = 0,
|
|
269
|
-
arrowPadding:
|
|
270
|
-
avoidCollisions:
|
|
271
|
-
collisionBoundary:
|
|
272
|
-
collisionPadding:
|
|
276
|
+
arrowPadding: l = 0,
|
|
277
|
+
avoidCollisions: c = !0,
|
|
278
|
+
collisionBoundary: u = [],
|
|
279
|
+
collisionPadding: p = 0,
|
|
273
280
|
sticky: f = "partial",
|
|
274
|
-
hideWhenDetached:
|
|
275
|
-
updatePositionStrategy:
|
|
281
|
+
hideWhenDetached: h = !1,
|
|
282
|
+
updatePositionStrategy: v = "optimized",
|
|
276
283
|
onPlaced: m,
|
|
277
284
|
...y
|
|
278
|
-
} = e, C =
|
|
285
|
+
} = e, C = be(Q, r), [E, w] = s.useState(null), x = D(t, (M) => w(M)), [P, T] = s.useState(null), b = ot(P), g = (b == null ? void 0 : b.width) ?? 0, O = (b == null ? void 0 : b.height) ?? 0, k = n + (i !== "center" ? "-" + i : ""), I = typeof p == "number" ? p : { top: 0, right: 0, bottom: 0, left: 0, ...p }, te = Array.isArray(u) ? u : [u], Ue = te.length > 0, $ = {
|
|
279
286
|
padding: I,
|
|
280
|
-
boundary: te.filter(
|
|
287
|
+
boundary: te.filter(Gt),
|
|
281
288
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
282
|
-
altBoundary:
|
|
283
|
-
}, { refs:
|
|
289
|
+
altBoundary: Ue
|
|
290
|
+
}, { refs: Ye, floatingStyles: re, placement: Ve, isPositioned: W, middlewareData: _ } = st({
|
|
284
291
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
285
292
|
strategy: "fixed",
|
|
286
|
-
placement:
|
|
287
|
-
whileElementsMounted: (...M) =>
|
|
288
|
-
animationFrame:
|
|
293
|
+
placement: k,
|
|
294
|
+
whileElementsMounted: (...M) => ft(...M, {
|
|
295
|
+
animationFrame: v === "always"
|
|
289
296
|
}),
|
|
290
297
|
elements: {
|
|
291
298
|
reference: C.anchor
|
|
292
299
|
},
|
|
293
300
|
middleware: [
|
|
294
|
-
|
|
295
|
-
|
|
301
|
+
it({ mainAxis: o + O, alignmentAxis: a }),
|
|
302
|
+
c && at({
|
|
296
303
|
mainAxis: !0,
|
|
297
304
|
crossAxis: !1,
|
|
298
|
-
limiter: f === "partial" ?
|
|
305
|
+
limiter: f === "partial" ? pt() : void 0,
|
|
299
306
|
...$
|
|
300
307
|
}),
|
|
301
|
-
|
|
302
|
-
|
|
308
|
+
c && ct({ ...$ }),
|
|
309
|
+
lt({
|
|
303
310
|
...$,
|
|
304
|
-
apply: ({ elements: M, rects:
|
|
305
|
-
const { width:
|
|
306
|
-
U.setProperty("--radix-popper-available-width", `${
|
|
311
|
+
apply: ({ elements: M, rects: ue, availableWidth: Ke, availableHeight: Qe }) => {
|
|
312
|
+
const { width: Je, height: et } = ue.reference, U = M.floating.style;
|
|
313
|
+
U.setProperty("--radix-popper-available-width", `${Ke}px`), U.setProperty("--radix-popper-available-height", `${Qe}px`), U.setProperty("--radix-popper-anchor-width", `${Je}px`), U.setProperty("--radix-popper-anchor-height", `${et}px`);
|
|
307
314
|
}
|
|
308
315
|
}),
|
|
309
|
-
P && ut({ element: P, padding:
|
|
310
|
-
|
|
311
|
-
|
|
316
|
+
P && ut({ element: P, padding: l }),
|
|
317
|
+
zt({ arrowWidth: g, arrowHeight: O }),
|
|
318
|
+
h && dt({ strategy: "referenceHidden", ...$ })
|
|
312
319
|
]
|
|
313
|
-
}), [ne,
|
|
320
|
+
}), [ne, je] = Ne(Ve), B = q(m);
|
|
314
321
|
G(() => {
|
|
315
322
|
W && (B == null || B());
|
|
316
323
|
}, [W, B]);
|
|
317
|
-
const
|
|
324
|
+
const Ge = (oe = _.arrow) == null ? void 0 : oe.x, ze = (se = _.arrow) == null ? void 0 : se.y, Xe = ((ie = _.arrow) == null ? void 0 : ie.centerOffset) !== 0, [Ze, qe] = s.useState();
|
|
318
325
|
return G(() => {
|
|
319
|
-
|
|
320
|
-
}, [
|
|
326
|
+
E && qe(window.getComputedStyle(E).zIndex);
|
|
327
|
+
}, [E]), /* @__PURE__ */ d(
|
|
321
328
|
"div",
|
|
322
329
|
{
|
|
323
|
-
ref:
|
|
330
|
+
ref: Ye.setFloating,
|
|
324
331
|
"data-radix-popper-content-wrapper": "",
|
|
325
332
|
style: {
|
|
326
333
|
...re,
|
|
327
334
|
transform: W ? re.transform : "translate(0, -200%)",
|
|
328
335
|
// keep off the page when measuring
|
|
329
336
|
minWidth: "max-content",
|
|
330
|
-
zIndex:
|
|
337
|
+
zIndex: Ze,
|
|
331
338
|
"--radix-popper-transform-origin": [
|
|
332
339
|
(ae = _.transformOrigin) == null ? void 0 : ae.x,
|
|
333
|
-
(
|
|
340
|
+
(ce = _.transformOrigin) == null ? void 0 : ce.y
|
|
334
341
|
].join(" "),
|
|
335
342
|
// hide the content if using the hide middleware and should be hidden
|
|
336
343
|
// set visibility to hidden and disable pointer events so the UI behaves
|
|
337
344
|
// as if the PopperContent isn't there at all
|
|
338
|
-
...((
|
|
345
|
+
...((le = _.hide) == null ? void 0 : le.referenceHidden) && {
|
|
339
346
|
visibility: "hidden",
|
|
340
347
|
pointerEvents: "none"
|
|
341
348
|
}
|
|
342
349
|
},
|
|
343
350
|
dir: e.dir,
|
|
344
|
-
children: /* @__PURE__ */
|
|
345
|
-
|
|
351
|
+
children: /* @__PURE__ */ d(
|
|
352
|
+
Yt,
|
|
346
353
|
{
|
|
347
354
|
scope: r,
|
|
348
355
|
placedSide: ne,
|
|
349
356
|
onArrowChange: T,
|
|
350
|
-
arrowX:
|
|
351
|
-
arrowY:
|
|
352
|
-
shouldHideArrow:
|
|
353
|
-
children: /* @__PURE__ */
|
|
354
|
-
|
|
357
|
+
arrowX: Ge,
|
|
358
|
+
arrowY: ze,
|
|
359
|
+
shouldHideArrow: Xe,
|
|
360
|
+
children: /* @__PURE__ */ d(
|
|
361
|
+
S.div,
|
|
355
362
|
{
|
|
356
363
|
"data-side": ne,
|
|
357
|
-
"data-align":
|
|
364
|
+
"data-align": je,
|
|
358
365
|
...y,
|
|
359
366
|
ref: x,
|
|
360
367
|
style: {
|
|
@@ -371,48 +378,48 @@ var Q = "PopperContent", [Ut, Yt] = Pe(Q), Oe = i.forwardRef(
|
|
|
371
378
|
);
|
|
372
379
|
}
|
|
373
380
|
);
|
|
374
|
-
|
|
375
|
-
var Se = "PopperArrow",
|
|
381
|
+
Re.displayName = Q;
|
|
382
|
+
var Se = "PopperArrow", jt = {
|
|
376
383
|
top: "bottom",
|
|
377
384
|
right: "left",
|
|
378
385
|
bottom: "top",
|
|
379
386
|
left: "right"
|
|
380
|
-
},
|
|
381
|
-
const { __scopePopper:
|
|
387
|
+
}, Oe = s.forwardRef(function(t, r) {
|
|
388
|
+
const { __scopePopper: n, ...o } = t, i = Vt(Se, n), a = jt[i.placedSide];
|
|
382
389
|
return (
|
|
383
390
|
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
384
391
|
// doesn't report size as we'd expect on SVG elements.
|
|
385
392
|
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
386
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ d(
|
|
387
394
|
"span",
|
|
388
395
|
{
|
|
389
|
-
ref:
|
|
396
|
+
ref: i.onArrowChange,
|
|
390
397
|
style: {
|
|
391
398
|
position: "absolute",
|
|
392
|
-
left:
|
|
393
|
-
top:
|
|
399
|
+
left: i.arrowX,
|
|
400
|
+
top: i.arrowY,
|
|
394
401
|
[a]: 0,
|
|
395
402
|
transformOrigin: {
|
|
396
403
|
top: "",
|
|
397
404
|
right: "0 0",
|
|
398
405
|
bottom: "center 0",
|
|
399
406
|
left: "100% 0"
|
|
400
|
-
}[
|
|
407
|
+
}[i.placedSide],
|
|
401
408
|
transform: {
|
|
402
409
|
top: "translateY(100%)",
|
|
403
410
|
right: "translateY(50%) rotate(90deg) translateX(-50%)",
|
|
404
411
|
bottom: "rotate(180deg)",
|
|
405
412
|
left: "translateY(50%) rotate(-90deg) translateX(50%)"
|
|
406
|
-
}[
|
|
407
|
-
visibility:
|
|
413
|
+
}[i.placedSide],
|
|
414
|
+
visibility: i.shouldHideArrow ? "hidden" : void 0
|
|
408
415
|
},
|
|
409
|
-
children: /* @__PURE__ */
|
|
410
|
-
|
|
416
|
+
children: /* @__PURE__ */ d(
|
|
417
|
+
Bt,
|
|
411
418
|
{
|
|
412
|
-
...
|
|
419
|
+
...o,
|
|
413
420
|
ref: r,
|
|
414
421
|
style: {
|
|
415
|
-
...
|
|
422
|
+
...o.style,
|
|
416
423
|
// ensures the element can be measured correctly (mostly for if SVG)
|
|
417
424
|
display: "block"
|
|
418
425
|
}
|
|
@@ -422,33 +429,33 @@ var Se = "PopperArrow", Vt = {
|
|
|
422
429
|
)
|
|
423
430
|
);
|
|
424
431
|
});
|
|
425
|
-
|
|
426
|
-
function
|
|
432
|
+
Oe.displayName = Se;
|
|
433
|
+
function Gt(e) {
|
|
427
434
|
return e !== null;
|
|
428
435
|
}
|
|
429
|
-
var
|
|
436
|
+
var zt = (e) => ({
|
|
430
437
|
name: "transformOrigin",
|
|
431
438
|
options: e,
|
|
432
439
|
fn(t) {
|
|
433
|
-
var C,
|
|
434
|
-
const { placement: r, rects:
|
|
440
|
+
var C, E, w;
|
|
441
|
+
const { placement: r, rects: n, middlewareData: o } = t, a = ((C = o.arrow) == null ? void 0 : C.centerOffset) !== 0, l = a ? 0 : e.arrowWidth, c = a ? 0 : e.arrowHeight, [u, p] = Ne(r), f = { start: "0%", center: "50%", end: "100%" }[p], h = (((E = o.arrow) == null ? void 0 : E.x) ?? 0) + l / 2, v = (((w = o.arrow) == null ? void 0 : w.y) ?? 0) + c / 2;
|
|
435
442
|
let m = "", y = "";
|
|
436
|
-
return
|
|
443
|
+
return u === "bottom" ? (m = a ? f : `${h}px`, y = `${-c}px`) : u === "top" ? (m = a ? f : `${h}px`, y = `${n.floating.height + c}px`) : u === "right" ? (m = `${-c}px`, y = a ? f : `${v}px`) : u === "left" && (m = `${n.floating.width + c}px`, y = a ? f : `${v}px`), { data: { x: m, y } };
|
|
437
444
|
}
|
|
438
445
|
});
|
|
439
|
-
function
|
|
446
|
+
function Ne(e) {
|
|
440
447
|
const [t, r = "center"] = e.split("-");
|
|
441
448
|
return [t, r];
|
|
442
449
|
}
|
|
443
|
-
var
|
|
444
|
-
var
|
|
445
|
-
const { container: r, ...
|
|
446
|
-
G(() =>
|
|
447
|
-
const a = r ||
|
|
448
|
-
return a ?
|
|
450
|
+
var Xt = xe, Zt = Ae, qt = Re, Kt = Oe, Qt = "Portal", De = s.forwardRef((e, t) => {
|
|
451
|
+
var l;
|
|
452
|
+
const { container: r, ...n } = e, [o, i] = s.useState(!1);
|
|
453
|
+
G(() => i(!0), []);
|
|
454
|
+
const a = r || o && ((l = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : l.body);
|
|
455
|
+
return a ? yt.createPortal(/* @__PURE__ */ d(S.div, { ...n, ref: t }), a) : null;
|
|
449
456
|
});
|
|
450
|
-
|
|
451
|
-
var
|
|
457
|
+
De.displayName = Qt;
|
|
458
|
+
var Jt = Object.freeze({
|
|
452
459
|
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
453
460
|
position: "absolute",
|
|
454
461
|
border: 0,
|
|
@@ -460,96 +467,96 @@ var Qt = Object.freeze({
|
|
|
460
467
|
clip: "rect(0, 0, 0, 0)",
|
|
461
468
|
whiteSpace: "nowrap",
|
|
462
469
|
wordWrap: "normal"
|
|
463
|
-
}),
|
|
464
|
-
(e, t) => /* @__PURE__ */
|
|
465
|
-
|
|
470
|
+
}), er = "VisuallyHidden", _e = s.forwardRef(
|
|
471
|
+
(e, t) => /* @__PURE__ */ d(
|
|
472
|
+
S.span,
|
|
466
473
|
{
|
|
467
474
|
...e,
|
|
468
475
|
ref: t,
|
|
469
|
-
style: { ...
|
|
476
|
+
style: { ...Jt, ...e.style }
|
|
470
477
|
}
|
|
471
478
|
)
|
|
472
479
|
);
|
|
473
|
-
|
|
474
|
-
var
|
|
475
|
-
|
|
476
|
-
]), j =
|
|
480
|
+
_e.displayName = er;
|
|
481
|
+
var tr = _e, [V, Vr] = he("Tooltip", [
|
|
482
|
+
Pe
|
|
483
|
+
]), j = Pe(), Le = "TooltipProvider", rr = 700, X = "tooltip.open", [nr, J] = V(Le), Ie = (e) => {
|
|
477
484
|
const {
|
|
478
485
|
__scopeTooltip: t,
|
|
479
|
-
delayDuration: r =
|
|
480
|
-
skipDelayDuration:
|
|
481
|
-
disableHoverableContent:
|
|
482
|
-
children:
|
|
483
|
-
} = e, a =
|
|
484
|
-
return
|
|
485
|
-
const
|
|
486
|
-
return () => window.clearTimeout(
|
|
487
|
-
}, []), /* @__PURE__ */
|
|
488
|
-
|
|
486
|
+
delayDuration: r = rr,
|
|
487
|
+
skipDelayDuration: n = 300,
|
|
488
|
+
disableHoverableContent: o = !1,
|
|
489
|
+
children: i
|
|
490
|
+
} = e, a = s.useRef(!0), l = s.useRef(!1), c = s.useRef(0);
|
|
491
|
+
return s.useEffect(() => {
|
|
492
|
+
const u = c.current;
|
|
493
|
+
return () => window.clearTimeout(u);
|
|
494
|
+
}, []), /* @__PURE__ */ d(
|
|
495
|
+
nr,
|
|
489
496
|
{
|
|
490
497
|
scope: t,
|
|
491
498
|
isOpenDelayedRef: a,
|
|
492
499
|
delayDuration: r,
|
|
493
|
-
onOpen:
|
|
494
|
-
window.clearTimeout(
|
|
500
|
+
onOpen: s.useCallback(() => {
|
|
501
|
+
window.clearTimeout(c.current), a.current = !1;
|
|
495
502
|
}, []),
|
|
496
|
-
onClose:
|
|
497
|
-
window.clearTimeout(
|
|
503
|
+
onClose: s.useCallback(() => {
|
|
504
|
+
window.clearTimeout(c.current), c.current = window.setTimeout(
|
|
498
505
|
() => a.current = !0,
|
|
499
|
-
|
|
506
|
+
n
|
|
500
507
|
);
|
|
501
|
-
}, [
|
|
502
|
-
isPointerInTransitRef:
|
|
503
|
-
onPointerInTransitChange:
|
|
504
|
-
|
|
508
|
+
}, [n]),
|
|
509
|
+
isPointerInTransitRef: l,
|
|
510
|
+
onPointerInTransitChange: s.useCallback((u) => {
|
|
511
|
+
l.current = u;
|
|
505
512
|
}, []),
|
|
506
|
-
disableHoverableContent:
|
|
507
|
-
children:
|
|
513
|
+
disableHoverableContent: o,
|
|
514
|
+
children: i
|
|
508
515
|
}
|
|
509
516
|
);
|
|
510
517
|
};
|
|
511
|
-
|
|
512
|
-
var H = "Tooltip", [
|
|
518
|
+
Ie.displayName = Le;
|
|
519
|
+
var H = "Tooltip", [or, F] = V(H), Me = (e) => {
|
|
513
520
|
const {
|
|
514
521
|
__scopeTooltip: t,
|
|
515
522
|
children: r,
|
|
516
|
-
open:
|
|
517
|
-
defaultOpen:
|
|
518
|
-
onOpenChange:
|
|
523
|
+
open: n,
|
|
524
|
+
defaultOpen: o,
|
|
525
|
+
onOpenChange: i,
|
|
519
526
|
disableHoverableContent: a,
|
|
520
|
-
delayDuration:
|
|
521
|
-
} = e,
|
|
522
|
-
prop:
|
|
523
|
-
defaultProp:
|
|
527
|
+
delayDuration: l
|
|
528
|
+
} = e, c = J(H, e.__scopeTooltip), u = j(t), [p, f] = s.useState(null), h = ht(), v = s.useRef(0), m = a ?? c.disableHoverableContent, y = l ?? c.delayDuration, C = s.useRef(!1), [E, w] = vt({
|
|
529
|
+
prop: n,
|
|
530
|
+
defaultProp: o ?? !1,
|
|
524
531
|
onChange: (g) => {
|
|
525
|
-
g ? (
|
|
532
|
+
g ? (c.onOpen(), document.dispatchEvent(new CustomEvent(X))) : c.onClose(), i == null || i(g);
|
|
526
533
|
},
|
|
527
534
|
caller: H
|
|
528
|
-
}), x =
|
|
529
|
-
window.clearTimeout(
|
|
530
|
-
}, [
|
|
531
|
-
window.clearTimeout(
|
|
532
|
-
}, [
|
|
533
|
-
window.clearTimeout(
|
|
534
|
-
C.current = !0,
|
|
535
|
+
}), x = s.useMemo(() => E ? C.current ? "delayed-open" : "instant-open" : "closed", [E]), P = s.useCallback(() => {
|
|
536
|
+
window.clearTimeout(v.current), v.current = 0, C.current = !1, w(!0);
|
|
537
|
+
}, [w]), T = s.useCallback(() => {
|
|
538
|
+
window.clearTimeout(v.current), v.current = 0, w(!1);
|
|
539
|
+
}, [w]), b = s.useCallback(() => {
|
|
540
|
+
window.clearTimeout(v.current), v.current = window.setTimeout(() => {
|
|
541
|
+
C.current = !0, w(!0), v.current = 0;
|
|
535
542
|
}, y);
|
|
536
|
-
}, [y,
|
|
537
|
-
return
|
|
538
|
-
|
|
539
|
-
}, []), /* @__PURE__ */
|
|
540
|
-
|
|
543
|
+
}, [y, w]);
|
|
544
|
+
return s.useEffect(() => () => {
|
|
545
|
+
v.current && (window.clearTimeout(v.current), v.current = 0);
|
|
546
|
+
}, []), /* @__PURE__ */ d(Xt, { ...u, children: /* @__PURE__ */ d(
|
|
547
|
+
or,
|
|
541
548
|
{
|
|
542
549
|
scope: t,
|
|
543
|
-
contentId:
|
|
544
|
-
open:
|
|
550
|
+
contentId: h,
|
|
551
|
+
open: E,
|
|
545
552
|
stateAttribute: x,
|
|
546
|
-
trigger:
|
|
553
|
+
trigger: p,
|
|
547
554
|
onTriggerChange: f,
|
|
548
|
-
onTriggerEnter:
|
|
549
|
-
|
|
550
|
-
}, [
|
|
551
|
-
onTriggerLeave:
|
|
552
|
-
m ? T() : (window.clearTimeout(
|
|
555
|
+
onTriggerEnter: s.useCallback(() => {
|
|
556
|
+
c.isOpenDelayedRef.current ? b() : P();
|
|
557
|
+
}, [c.isOpenDelayedRef, b, P]),
|
|
558
|
+
onTriggerLeave: s.useCallback(() => {
|
|
559
|
+
m ? T() : (window.clearTimeout(v.current), v.current = 0);
|
|
553
560
|
}, [T, m]),
|
|
554
561
|
onOpen: P,
|
|
555
562
|
onClose: T,
|
|
@@ -558,110 +565,110 @@ var H = "Tooltip", [nr, k] = V(H), He = (e) => {
|
|
|
558
565
|
}
|
|
559
566
|
) });
|
|
560
567
|
};
|
|
561
|
-
|
|
562
|
-
var Z = "TooltipTrigger",
|
|
568
|
+
Me.displayName = H;
|
|
569
|
+
var Z = "TooltipTrigger", He = s.forwardRef(
|
|
563
570
|
(e, t) => {
|
|
564
|
-
const { __scopeTooltip: r, ...
|
|
565
|
-
return
|
|
566
|
-
|
|
571
|
+
const { __scopeTooltip: r, ...n } = e, o = F(Z, r), i = J(Z, r), a = j(r), l = s.useRef(null), c = D(t, l, o.onTriggerChange), u = s.useRef(!1), p = s.useRef(!1), f = s.useCallback(() => u.current = !1, []);
|
|
572
|
+
return s.useEffect(() => () => document.removeEventListener("pointerup", f), [f]), /* @__PURE__ */ d(Zt, { asChild: !0, ...a, children: /* @__PURE__ */ d(
|
|
573
|
+
S.button,
|
|
567
574
|
{
|
|
568
|
-
"aria-describedby":
|
|
569
|
-
"data-state":
|
|
570
|
-
...
|
|
571
|
-
ref:
|
|
572
|
-
onPointerMove: A(e.onPointerMove, (
|
|
573
|
-
|
|
575
|
+
"aria-describedby": o.open ? o.contentId : void 0,
|
|
576
|
+
"data-state": o.stateAttribute,
|
|
577
|
+
...n,
|
|
578
|
+
ref: c,
|
|
579
|
+
onPointerMove: A(e.onPointerMove, (h) => {
|
|
580
|
+
h.pointerType !== "touch" && !p.current && !i.isPointerInTransitRef.current && (o.onTriggerEnter(), p.current = !0);
|
|
574
581
|
}),
|
|
575
582
|
onPointerLeave: A(e.onPointerLeave, () => {
|
|
576
|
-
|
|
583
|
+
o.onTriggerLeave(), p.current = !1;
|
|
577
584
|
}),
|
|
578
585
|
onPointerDown: A(e.onPointerDown, () => {
|
|
579
|
-
|
|
586
|
+
o.open && o.onClose(), u.current = !0, document.addEventListener("pointerup", f, { once: !0 });
|
|
580
587
|
}),
|
|
581
588
|
onFocus: A(e.onFocus, () => {
|
|
582
|
-
|
|
589
|
+
u.current || o.onOpen();
|
|
583
590
|
}),
|
|
584
|
-
onBlur: A(e.onBlur,
|
|
585
|
-
onClick: A(e.onClick,
|
|
591
|
+
onBlur: A(e.onBlur, o.onClose),
|
|
592
|
+
onClick: A(e.onClick, o.onClose)
|
|
586
593
|
}
|
|
587
594
|
) });
|
|
588
595
|
}
|
|
589
596
|
);
|
|
590
|
-
|
|
591
|
-
var ee = "TooltipPortal", [
|
|
597
|
+
He.displayName = Z;
|
|
598
|
+
var ee = "TooltipPortal", [sr, ir] = V(ee, {
|
|
592
599
|
forceMount: void 0
|
|
593
600
|
}), Fe = (e) => {
|
|
594
|
-
const { __scopeTooltip: t, forceMount: r, children:
|
|
595
|
-
return /* @__PURE__ */
|
|
601
|
+
const { __scopeTooltip: t, forceMount: r, children: n, container: o } = e, i = F(ee, t);
|
|
602
|
+
return /* @__PURE__ */ d(sr, { scope: t, forceMount: r, children: /* @__PURE__ */ d(ve, { present: r || i.open, children: /* @__PURE__ */ d(De, { asChild: !0, container: o, children: n }) }) });
|
|
596
603
|
};
|
|
597
604
|
Fe.displayName = ee;
|
|
598
|
-
var L = "TooltipContent",
|
|
605
|
+
var L = "TooltipContent", ke = s.forwardRef(
|
|
599
606
|
(e, t) => {
|
|
600
|
-
const r =
|
|
601
|
-
return /* @__PURE__ */
|
|
607
|
+
const r = ir(L, e.__scopeTooltip), { forceMount: n = r.forceMount, side: o = "top", ...i } = e, a = F(L, e.__scopeTooltip);
|
|
608
|
+
return /* @__PURE__ */ d(ve, { present: n || a.open, children: a.disableHoverableContent ? /* @__PURE__ */ d($e, { side: o, ...i, ref: t }) : /* @__PURE__ */ d(ar, { side: o, ...i, ref: t }) });
|
|
602
609
|
}
|
|
603
|
-
),
|
|
604
|
-
const r =
|
|
605
|
-
|
|
606
|
-
}, [f]),
|
|
610
|
+
), ar = s.forwardRef((e, t) => {
|
|
611
|
+
const r = F(L, e.__scopeTooltip), n = J(L, e.__scopeTooltip), o = s.useRef(null), i = D(t, o), [a, l] = s.useState(null), { trigger: c, onClose: u } = r, p = o.current, { onPointerInTransitChange: f } = n, h = s.useCallback(() => {
|
|
612
|
+
l(null), f(!1);
|
|
613
|
+
}, [f]), v = s.useCallback(
|
|
607
614
|
(m, y) => {
|
|
608
|
-
const C = m.currentTarget,
|
|
609
|
-
|
|
615
|
+
const C = m.currentTarget, E = { x: m.clientX, y: m.clientY }, w = dr(E, C.getBoundingClientRect()), x = pr(E, w), P = fr(y.getBoundingClientRect()), T = vr([...x, ...P]);
|
|
616
|
+
l(T), f(!0);
|
|
610
617
|
},
|
|
611
618
|
[f]
|
|
612
619
|
);
|
|
613
|
-
return
|
|
614
|
-
if (
|
|
615
|
-
const m = (C) =>
|
|
616
|
-
return
|
|
617
|
-
|
|
620
|
+
return s.useEffect(() => () => h(), [h]), s.useEffect(() => {
|
|
621
|
+
if (c && p) {
|
|
622
|
+
const m = (C) => v(C, p), y = (C) => v(C, c);
|
|
623
|
+
return c.addEventListener("pointerleave", m), p.addEventListener("pointerleave", y), () => {
|
|
624
|
+
c.removeEventListener("pointerleave", m), p.removeEventListener("pointerleave", y);
|
|
618
625
|
};
|
|
619
626
|
}
|
|
620
|
-
}, [
|
|
627
|
+
}, [c, p, v, h]), s.useEffect(() => {
|
|
621
628
|
if (a) {
|
|
622
629
|
const m = (y) => {
|
|
623
|
-
const C = y.target,
|
|
624
|
-
|
|
630
|
+
const C = y.target, E = { x: y.clientX, y: y.clientY }, w = (c == null ? void 0 : c.contains(C)) || (p == null ? void 0 : p.contains(C)), x = !hr(E, a);
|
|
631
|
+
w ? h() : x && (h(), u());
|
|
625
632
|
};
|
|
626
633
|
return document.addEventListener("pointermove", m), () => document.removeEventListener("pointermove", m);
|
|
627
634
|
}
|
|
628
|
-
}, [
|
|
629
|
-
}), [
|
|
635
|
+
}, [c, p, a, u, h]), /* @__PURE__ */ d($e, { ...e, ref: i });
|
|
636
|
+
}), [cr, lr] = V(H, { isInside: !1 }), ur = /* @__PURE__ */ Rt("TooltipContent"), $e = s.forwardRef(
|
|
630
637
|
(e, t) => {
|
|
631
638
|
const {
|
|
632
639
|
__scopeTooltip: r,
|
|
633
|
-
children:
|
|
634
|
-
"aria-label":
|
|
635
|
-
onEscapeKeyDown:
|
|
640
|
+
children: n,
|
|
641
|
+
"aria-label": o,
|
|
642
|
+
onEscapeKeyDown: i,
|
|
636
643
|
onPointerDownOutside: a,
|
|
637
|
-
...
|
|
638
|
-
} = e,
|
|
639
|
-
return
|
|
640
|
-
if (
|
|
641
|
-
const f = (
|
|
642
|
-
const
|
|
643
|
-
|
|
644
|
+
...l
|
|
645
|
+
} = e, c = F(L, r), u = j(r), { onClose: p } = c;
|
|
646
|
+
return s.useEffect(() => (document.addEventListener(X, p), () => document.removeEventListener(X, p)), [p]), s.useEffect(() => {
|
|
647
|
+
if (c.trigger) {
|
|
648
|
+
const f = (h) => {
|
|
649
|
+
const v = h.target;
|
|
650
|
+
v != null && v.contains(c.trigger) && p();
|
|
644
651
|
};
|
|
645
652
|
return window.addEventListener("scroll", f, { capture: !0 }), () => window.removeEventListener("scroll", f, { capture: !0 });
|
|
646
653
|
}
|
|
647
|
-
}, [
|
|
648
|
-
|
|
654
|
+
}, [c.trigger, p]), /* @__PURE__ */ d(
|
|
655
|
+
ge,
|
|
649
656
|
{
|
|
650
657
|
asChild: !0,
|
|
651
658
|
disableOutsidePointerEvents: !1,
|
|
652
|
-
onEscapeKeyDown:
|
|
659
|
+
onEscapeKeyDown: i,
|
|
653
660
|
onPointerDownOutside: a,
|
|
654
661
|
onFocusOutside: (f) => f.preventDefault(),
|
|
655
|
-
onDismiss:
|
|
662
|
+
onDismiss: p,
|
|
656
663
|
children: /* @__PURE__ */ R(
|
|
657
|
-
|
|
664
|
+
qt,
|
|
658
665
|
{
|
|
659
|
-
"data-state":
|
|
660
|
-
...p,
|
|
666
|
+
"data-state": c.stateAttribute,
|
|
661
667
|
...u,
|
|
668
|
+
...l,
|
|
662
669
|
ref: t,
|
|
663
670
|
style: {
|
|
664
|
-
...
|
|
671
|
+
...l.style,
|
|
665
672
|
"--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
666
673
|
"--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
|
|
667
674
|
"--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
|
|
@@ -669,8 +676,8 @@ var L = "TooltipContent", $e = i.forwardRef(
|
|
|
669
676
|
"--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
|
|
670
677
|
},
|
|
671
678
|
children: [
|
|
672
|
-
/* @__PURE__ */
|
|
673
|
-
/* @__PURE__ */
|
|
679
|
+
/* @__PURE__ */ d(ur, { children: n }),
|
|
680
|
+
/* @__PURE__ */ d(cr, { scope: r, isInside: !0, children: /* @__PURE__ */ d(tr, { id: c.contentId, role: "tooltip", children: o || n }) })
|
|
674
681
|
]
|
|
675
682
|
}
|
|
676
683
|
)
|
|
@@ -678,192 +685,197 @@ var L = "TooltipContent", $e = i.forwardRef(
|
|
|
678
685
|
);
|
|
679
686
|
}
|
|
680
687
|
);
|
|
681
|
-
|
|
682
|
-
var
|
|
688
|
+
ke.displayName = L;
|
|
689
|
+
var We = "TooltipArrow", Be = s.forwardRef(
|
|
683
690
|
(e, t) => {
|
|
684
|
-
const { __scopeTooltip: r, ...
|
|
691
|
+
const { __scopeTooltip: r, ...n } = e, o = j(r);
|
|
685
692
|
return lr(
|
|
686
|
-
|
|
693
|
+
We,
|
|
687
694
|
r
|
|
688
|
-
).isInside ? null : /* @__PURE__ */
|
|
695
|
+
).isInside ? null : /* @__PURE__ */ d(Kt, { ...o, ...n, ref: t });
|
|
689
696
|
}
|
|
690
697
|
);
|
|
691
|
-
|
|
698
|
+
Be.displayName = We;
|
|
692
699
|
function dr(e, t) {
|
|
693
|
-
const r = Math.abs(t.top - e.y),
|
|
694
|
-
switch (Math.min(r,
|
|
695
|
-
case
|
|
700
|
+
const r = Math.abs(t.top - e.y), n = Math.abs(t.bottom - e.y), o = Math.abs(t.right - e.x), i = Math.abs(t.left - e.x);
|
|
701
|
+
switch (Math.min(r, n, o, i)) {
|
|
702
|
+
case i:
|
|
696
703
|
return "left";
|
|
697
|
-
case
|
|
704
|
+
case o:
|
|
698
705
|
return "right";
|
|
699
706
|
case r:
|
|
700
707
|
return "top";
|
|
701
|
-
case
|
|
708
|
+
case n:
|
|
702
709
|
return "bottom";
|
|
703
710
|
default:
|
|
704
711
|
throw new Error("unreachable");
|
|
705
712
|
}
|
|
706
713
|
}
|
|
707
|
-
function
|
|
708
|
-
const
|
|
714
|
+
function pr(e, t, r = 5) {
|
|
715
|
+
const n = [];
|
|
709
716
|
switch (t) {
|
|
710
717
|
case "top":
|
|
711
|
-
|
|
718
|
+
n.push(
|
|
712
719
|
{ x: e.x - r, y: e.y + r },
|
|
713
720
|
{ x: e.x + r, y: e.y + r }
|
|
714
721
|
);
|
|
715
722
|
break;
|
|
716
723
|
case "bottom":
|
|
717
|
-
|
|
724
|
+
n.push(
|
|
718
725
|
{ x: e.x - r, y: e.y - r },
|
|
719
726
|
{ x: e.x + r, y: e.y - r }
|
|
720
727
|
);
|
|
721
728
|
break;
|
|
722
729
|
case "left":
|
|
723
|
-
|
|
730
|
+
n.push(
|
|
724
731
|
{ x: e.x + r, y: e.y - r },
|
|
725
732
|
{ x: e.x + r, y: e.y + r }
|
|
726
733
|
);
|
|
727
734
|
break;
|
|
728
735
|
case "right":
|
|
729
|
-
|
|
736
|
+
n.push(
|
|
730
737
|
{ x: e.x - r, y: e.y - r },
|
|
731
738
|
{ x: e.x - r, y: e.y + r }
|
|
732
739
|
);
|
|
733
740
|
break;
|
|
734
741
|
}
|
|
735
|
-
return
|
|
742
|
+
return n;
|
|
736
743
|
}
|
|
737
|
-
function
|
|
738
|
-
const { top: t, right: r, bottom:
|
|
744
|
+
function fr(e) {
|
|
745
|
+
const { top: t, right: r, bottom: n, left: o } = e;
|
|
739
746
|
return [
|
|
740
|
-
{ x:
|
|
747
|
+
{ x: o, y: t },
|
|
741
748
|
{ x: r, y: t },
|
|
742
|
-
{ x: r, y:
|
|
743
|
-
{ x:
|
|
749
|
+
{ x: r, y: n },
|
|
750
|
+
{ x: o, y: n }
|
|
744
751
|
];
|
|
745
752
|
}
|
|
746
|
-
function
|
|
747
|
-
const { x: r, y:
|
|
748
|
-
let
|
|
749
|
-
for (let
|
|
750
|
-
const
|
|
751
|
-
|
|
753
|
+
function hr(e, t) {
|
|
754
|
+
const { x: r, y: n } = e;
|
|
755
|
+
let o = !1;
|
|
756
|
+
for (let i = 0, a = t.length - 1; i < t.length; a = i++) {
|
|
757
|
+
const l = t[i], c = t[a], u = l.x, p = l.y, f = c.x, h = c.y;
|
|
758
|
+
p > n != h > n && r < (f - u) * (n - p) / (h - p) + u && (o = !o);
|
|
752
759
|
}
|
|
753
|
-
return
|
|
760
|
+
return o;
|
|
754
761
|
}
|
|
755
|
-
function
|
|
762
|
+
function vr(e) {
|
|
756
763
|
const t = e.slice();
|
|
757
|
-
return t.sort((r,
|
|
764
|
+
return t.sort((r, n) => r.x < n.x ? -1 : r.x > n.x ? 1 : r.y < n.y ? -1 : r.y > n.y ? 1 : 0), mr(t);
|
|
758
765
|
}
|
|
759
|
-
function
|
|
766
|
+
function mr(e) {
|
|
760
767
|
if (e.length <= 1) return e.slice();
|
|
761
768
|
const t = [];
|
|
762
|
-
for (let
|
|
763
|
-
const
|
|
769
|
+
for (let n = 0; n < e.length; n++) {
|
|
770
|
+
const o = e[n];
|
|
764
771
|
for (; t.length >= 2; ) {
|
|
765
|
-
const
|
|
766
|
-
if ((
|
|
772
|
+
const i = t[t.length - 1], a = t[t.length - 2];
|
|
773
|
+
if ((i.x - a.x) * (o.y - a.y) >= (i.y - a.y) * (o.x - a.x)) t.pop();
|
|
767
774
|
else break;
|
|
768
775
|
}
|
|
769
|
-
t.push(
|
|
776
|
+
t.push(o);
|
|
770
777
|
}
|
|
771
778
|
t.pop();
|
|
772
779
|
const r = [];
|
|
773
|
-
for (let
|
|
774
|
-
const
|
|
780
|
+
for (let n = e.length - 1; n >= 0; n--) {
|
|
781
|
+
const o = e[n];
|
|
775
782
|
for (; r.length >= 2; ) {
|
|
776
|
-
const
|
|
777
|
-
if ((
|
|
783
|
+
const i = r[r.length - 1], a = r[r.length - 2];
|
|
784
|
+
if ((i.x - a.x) * (o.y - a.y) >= (i.y - a.y) * (o.x - a.x)) r.pop();
|
|
778
785
|
else break;
|
|
779
786
|
}
|
|
780
|
-
r.push(
|
|
787
|
+
r.push(o);
|
|
781
788
|
}
|
|
782
789
|
return r.pop(), t.length === 1 && r.length === 1 && t[0].x === r[0].x && t[0].y === r[0].y ? t : t.concat(r);
|
|
783
790
|
}
|
|
784
|
-
var
|
|
785
|
-
const
|
|
791
|
+
var yr = Ie, gr = Me, Cr = He, wr = Fe, Er = ke, Pr = Be;
|
|
792
|
+
const br = 1e3 * 60 * 60, jr = ({
|
|
786
793
|
amount: e,
|
|
787
794
|
currency: t,
|
|
788
|
-
position: r =
|
|
789
|
-
zeroDisplayOption:
|
|
790
|
-
customDisplay:
|
|
795
|
+
position: r = Pt.RIGHT,
|
|
796
|
+
zeroDisplayOption: n = N.NA,
|
|
797
|
+
customDisplay: o,
|
|
798
|
+
decimalPlaces: i = 0
|
|
791
799
|
}) => {
|
|
792
|
-
var
|
|
793
|
-
const { user:
|
|
794
|
-
queryKey: [
|
|
795
|
-
queryFn: () =>
|
|
800
|
+
var h, v;
|
|
801
|
+
const { user: a } = wt(), l = ((h = a == null ? void 0 : a.preferences) == null ? void 0 : h.currency) ?? ((v = a == null ? void 0 : a.userRegion) == null ? void 0 : v.currency), c = l !== t, { data: u, isPending: p } = gt({
|
|
802
|
+
queryKey: [Ct.CONVERT_CURRENCY, t, l],
|
|
803
|
+
queryFn: () => Et.convertCurrency({
|
|
796
804
|
baseCurrency: t,
|
|
797
|
-
targetCurrency:
|
|
805
|
+
targetCurrency: l
|
|
798
806
|
}),
|
|
799
|
-
enabled:
|
|
800
|
-
staleTime:
|
|
801
|
-
}),
|
|
802
|
-
if (!
|
|
807
|
+
enabled: c,
|
|
808
|
+
staleTime: br
|
|
809
|
+
}), f = rt(() => {
|
|
810
|
+
if (!a)
|
|
803
811
|
return null;
|
|
804
|
-
let
|
|
805
|
-
if (
|
|
806
|
-
if (p || !
|
|
807
|
-
|
|
812
|
+
let m = typeof e == "string" ? parseFloat(e) : e;
|
|
813
|
+
if (c) {
|
|
814
|
+
if (p || !u) return null;
|
|
815
|
+
m = m * u;
|
|
808
816
|
}
|
|
809
|
-
return
|
|
810
|
-
}, [e,
|
|
811
|
-
if (!
|
|
812
|
-
switch (
|
|
817
|
+
return m;
|
|
818
|
+
}, [e, a, p, c, u]);
|
|
819
|
+
if (!l || !f || f < 0)
|
|
820
|
+
switch (n) {
|
|
813
821
|
case N.NA:
|
|
814
|
-
return /* @__PURE__ */
|
|
822
|
+
return /* @__PURE__ */ d("span", { children: "N/A" });
|
|
815
823
|
case N.HIDDEN:
|
|
816
|
-
return /* @__PURE__ */
|
|
824
|
+
return /* @__PURE__ */ d("span", { className: "hidden", children: "N/A" });
|
|
817
825
|
case N.DISPLAY_AS_ZERO:
|
|
818
|
-
return /* @__PURE__ */
|
|
826
|
+
return /* @__PURE__ */ d("span", { children: "0" });
|
|
819
827
|
case N.DISPLAY_AS_ZERO_WITH_CURRENCY:
|
|
820
|
-
return /* @__PURE__ */
|
|
828
|
+
return /* @__PURE__ */ d("span", { children: Y(0, l ?? t) });
|
|
821
829
|
case N.DISPLAY_AS_ZERO_WITH_CURRENCY_NO_DECIMAL:
|
|
822
|
-
return /* @__PURE__ */
|
|
830
|
+
return /* @__PURE__ */ d("span", { children: bt(0, l ?? t) });
|
|
823
831
|
case N.CUSTOM:
|
|
824
|
-
return /* @__PURE__ */
|
|
832
|
+
return /* @__PURE__ */ d("span", { children: f == 0 ? o : "N/A" });
|
|
825
833
|
default:
|
|
826
|
-
return /* @__PURE__ */
|
|
834
|
+
return /* @__PURE__ */ d("span", { children: "N/A" });
|
|
827
835
|
}
|
|
828
836
|
return /* @__PURE__ */ R("span", { className: "currency-conversion", children: [
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
837
|
+
xt(
|
|
838
|
+
f,
|
|
839
|
+
l,
|
|
840
|
+
i
|
|
841
|
+
),
|
|
842
|
+
c && /* @__PURE__ */ d(
|
|
843
|
+
xr,
|
|
832
844
|
{
|
|
833
|
-
trigger: /* @__PURE__ */
|
|
845
|
+
trigger: /* @__PURE__ */ d("sup", { children: /* @__PURE__ */ d(de, {}) }),
|
|
834
846
|
position: r,
|
|
835
847
|
children: /* @__PURE__ */ R("div", { className: "currency-conversion-container", children: [
|
|
836
848
|
/* @__PURE__ */ R("p", { children: [
|
|
837
849
|
"Converted from ",
|
|
838
850
|
t,
|
|
839
851
|
" to ",
|
|
840
|
-
|
|
852
|
+
l
|
|
841
853
|
] }),
|
|
842
854
|
/* @__PURE__ */ R("div", { className: "currency-conversion-amounts", children: [
|
|
843
|
-
/* @__PURE__ */
|
|
844
|
-
/* @__PURE__ */
|
|
845
|
-
/* @__PURE__ */
|
|
855
|
+
/* @__PURE__ */ d("div", { children: /* @__PURE__ */ d("p", { children: Y(e, t) }) }),
|
|
856
|
+
/* @__PURE__ */ d("div", { children: /* @__PURE__ */ d("p", { children: Y(f, l) }) }),
|
|
857
|
+
/* @__PURE__ */ d("span", { className: "conversion-icon", children: /* @__PURE__ */ d(de, {}) })
|
|
846
858
|
] }),
|
|
847
|
-
/* @__PURE__ */
|
|
859
|
+
/* @__PURE__ */ d("div", { className: "currency-conversion-rate", children: /* @__PURE__ */ R("p", { children: [
|
|
848
860
|
"Current Rate:",
|
|
849
861
|
" ",
|
|
850
|
-
|
|
862
|
+
u ? (
|
|
851
863
|
// only leaving 2 decimal places for the conversion rate is
|
|
852
864
|
// not enough, can lead to confusion
|
|
853
865
|
// use Number constructor to strip unnecessary trailing zeros
|
|
854
|
-
`${Number((1 /
|
|
866
|
+
`${Number((1 / u).toFixed(5))} ${t}`
|
|
855
867
|
) : "N/A",
|
|
856
868
|
" ",
|
|
857
869
|
"≈ ",
|
|
858
|
-
Y(1,
|
|
870
|
+
Y(1, l)
|
|
859
871
|
] }) })
|
|
860
872
|
] })
|
|
861
873
|
}
|
|
862
874
|
)
|
|
863
875
|
] });
|
|
864
|
-
},
|
|
865
|
-
/* @__PURE__ */
|
|
866
|
-
/* @__PURE__ */
|
|
876
|
+
}, xr = ({ children: e, trigger: t, position: r }) => /* @__PURE__ */ d(yr, { delayDuration: 100, children: /* @__PURE__ */ R(gr, { children: [
|
|
877
|
+
/* @__PURE__ */ d(Cr, { asChild: !0, children: t }),
|
|
878
|
+
/* @__PURE__ */ d(wr, { children: /* @__PURE__ */ R(
|
|
867
879
|
Er,
|
|
868
880
|
{
|
|
869
881
|
className: `tooltip-content ${r}`,
|
|
@@ -871,12 +883,12 @@ const Pr = 1e3 * 60 * 60, Vr = ({
|
|
|
871
883
|
align: "center",
|
|
872
884
|
children: [
|
|
873
885
|
e,
|
|
874
|
-
/* @__PURE__ */
|
|
886
|
+
/* @__PURE__ */ d(Pr, { className: "tooltip-arrow" })
|
|
875
887
|
]
|
|
876
888
|
}
|
|
877
889
|
) })
|
|
878
890
|
] }) });
|
|
879
891
|
export {
|
|
880
|
-
|
|
881
|
-
|
|
892
|
+
jr as CashValue,
|
|
893
|
+
br as CurrencyCallStaleTimeMs
|
|
882
894
|
};
|