@hortiview/shared-components 2.27.1 → 2.27.2

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,420 +0,0 @@
1
- import ae, { createContext as bt, useState as g, useRef as z, useEffect as p, useContext as gt, useCallback as St, useImperativeHandle as Et, useLayoutEffect as At } from "react";
2
- import { a as kt, b as Ot, c as it, o as xt, f as Tt, s as Lt } from "./floating-ui.dom-CeD8zknG.js";
3
- import { g as Ct } from "./_commonjsHelpers-ByX85dGu.js";
4
- var et = { exports: {} };
5
- var ct;
6
- function Rt() {
7
- return ct || (ct = 1, (function(t) {
8
- (function() {
9
- var l = {}.hasOwnProperty;
10
- function u() {
11
- for (var s = "", f = 0; f < arguments.length; f++) {
12
- var d = arguments[f];
13
- d && (s = m(s, i(d)));
14
- }
15
- return s;
16
- }
17
- function i(s) {
18
- if (typeof s == "string" || typeof s == "number")
19
- return s;
20
- if (typeof s != "object")
21
- return "";
22
- if (Array.isArray(s))
23
- return u.apply(null, s);
24
- if (s.toString !== Object.prototype.toString && !s.toString.toString().includes("[native code]"))
25
- return s.toString();
26
- var f = "";
27
- for (var d in s)
28
- l.call(s, d) && s[d] && (f = m(f, d));
29
- return f;
30
- }
31
- function m(s, f) {
32
- return f ? s ? s + " " + f : s + f : s;
33
- }
34
- t.exports ? (u.default = u, t.exports = u) : window.classNames = u;
35
- })();
36
- })(et)), et.exports;
37
- }
38
- var Nt = Rt();
39
- const ot = /* @__PURE__ */ Ct(Nt);
40
- const jt = "react-tooltip-core-styles", $t = "react-tooltip-base-styles", ut = { core: !1, base: !1 };
41
- function dt({ css: t, id: l = $t, type: u = "base", ref: i }) {
42
- var m, s;
43
- if (!t || typeof document > "u" || ut[u] || u === "core" && typeof process < "u" && (!((m = process == null ? void 0 : process.env) === null || m === void 0) && m.REACT_TOOLTIP_DISABLE_CORE_STYLES) || u !== "base" && typeof process < "u" && (!((s = process == null ? void 0 : process.env) === null || s === void 0) && s.REACT_TOOLTIP_DISABLE_BASE_STYLES)) return;
44
- u === "core" && (l = jt), i || (i = {});
45
- const { insertAt: f } = i;
46
- if (document.getElementById(l)) return;
47
- const d = document.head || document.getElementsByTagName("head")[0], h = document.createElement("style");
48
- h.id = l, h.type = "text/css", f === "top" && d.firstChild ? d.insertBefore(h, d.firstChild) : d.appendChild(h), h.styleSheet ? h.styleSheet.cssText = t : h.appendChild(document.createTextNode(t)), ut[u] = !0;
49
- }
50
- const pt = async ({ elementReference: t = null, tooltipReference: l = null, tooltipArrowReference: u = null, place: i = "top", offset: m = 10, strategy: s = "absolute", middlewares: f = [xt(Number(m)), Tt({ fallbackAxisSideDirection: "start" }), Lt({ padding: 5 })], border: d }) => {
51
- if (!t) return { tooltipStyles: {}, tooltipArrowStyles: {}, place: i };
52
- if (l === null) return { tooltipStyles: {}, tooltipArrowStyles: {}, place: i };
53
- const h = f;
54
- return u ? (h.push(Ot({ element: u, padding: 5 })), it(t, l, { placement: i, strategy: s, middleware: h }).then((({ x: K, y: M, placement: T, middlewareData: ie }) => {
55
- var X, j;
56
- const $ = { left: `${K}px`, top: `${M}px`, border: d }, { x: Q, y: W } = (X = ie.arrow) !== null && X !== void 0 ? X : { x: 0, y: 0 }, U = (j = { top: "bottom", right: "left", bottom: "top", left: "right" }[T.split("-")[0]]) !== null && j !== void 0 ? j : "bottom", I = d && { borderBottom: d, borderRight: d };
57
- let F = 0;
58
- if (d) {
59
- const ee = `${d}`.match(/(\d+)px/);
60
- F = ee?.[1] ? Number(ee[1]) : 1;
61
- }
62
- return { tooltipStyles: $, tooltipArrowStyles: { left: Q != null ? `${Q}px` : "", top: W != null ? `${W}px` : "", right: "", bottom: "", ...I, [U]: `-${4 + F}px` }, place: T };
63
- }))) : it(t, l, { placement: "bottom", strategy: s, middleware: h }).then((({ x: K, y: M, placement: T }) => ({ tooltipStyles: { left: `${K}px`, top: `${M}px` }, tooltipArrowStyles: {}, place: T })));
64
- }, ft = (t, l) => !("CSS" in window && "supports" in window.CSS) || window.CSS.supports(t, l), vt = (t, l, u) => {
65
- let i = null;
66
- const m = function(...s) {
67
- const f = () => {
68
- i = null;
69
- };
70
- !i && (t.apply(this, s), i = setTimeout(f, l));
71
- };
72
- return m.cancel = () => {
73
- i && (clearTimeout(i), i = null);
74
- }, m;
75
- }, mt = (t) => t !== null && !Array.isArray(t) && typeof t == "object", rt = (t, l) => {
76
- if (t === l) return !0;
77
- if (Array.isArray(t) && Array.isArray(l)) return t.length === l.length && t.every(((m, s) => rt(m, l[s])));
78
- if (Array.isArray(t) !== Array.isArray(l)) return !1;
79
- if (!mt(t) || !mt(l)) return t === l;
80
- const u = Object.keys(t), i = Object.keys(l);
81
- return u.length === i.length && u.every(((m) => rt(t[m], l[m])));
82
- }, It = (t) => {
83
- if (!(t instanceof HTMLElement || t instanceof SVGElement)) return !1;
84
- const l = getComputedStyle(t);
85
- return ["overflow", "overflow-x", "overflow-y"].some(((u) => {
86
- const i = l.getPropertyValue(u);
87
- return i === "auto" || i === "scroll";
88
- }));
89
- }, yt = (t) => {
90
- if (!t) return null;
91
- let l = t.parentElement;
92
- for (; l; ) {
93
- if (It(l)) return l;
94
- l = l.parentElement;
95
- }
96
- return document.scrollingElement || document.documentElement;
97
- }, Bt = typeof window < "u" ? At : p, N = (t) => {
98
- t.current && (clearTimeout(t.current), t.current = null);
99
- }, Dt = "DEFAULT_TOOLTIP_ID", qt = { anchorRefs: /* @__PURE__ */ new Set(), activeAnchor: { current: null }, attach: () => {
100
- }, detach: () => {
101
- }, setActiveAnchor: () => {
102
- } }, zt = bt({ getTooltipData: () => qt });
103
- function ht(t = Dt) {
104
- return gt(zt).getTooltipData(t);
105
- }
106
- var ge = { tooltip: "core-styles-module_tooltip__3vRRp", fixed: "core-styles-module_fixed__pcSol", arrow: "core-styles-module_arrow__cvMwQ", noArrow: "core-styles-module_noArrow__xock6", clickable: "core-styles-module_clickable__ZuTTB", show: "core-styles-module_show__Nt9eE", closing: "core-styles-module_closing__sGnxF" }, tt = { tooltip: "styles-module_tooltip__mnnfp", arrow: "styles-module_arrow__K0L3T", dark: "styles-module_dark__xNqje", light: "styles-module_light__Z6W-X", success: "styles-module_success__A2AKt", warning: "styles-module_warning__SCK0X", error: "styles-module_error__JvumD", info: "styles-module_info__BWdHW" };
107
- const Kt = ({ forwardRef: t, id: l, className: u, classNameArrow: i, variant: m = "dark", anchorId: s, anchorSelect: f, place: d = "top", offset: h = 10, events: K = ["hover"], openOnClick: M = !1, positionStrategy: T = "absolute", middlewares: ie, wrapper: X, delayShow: j = 0, delayHide: $ = 0, float: Q = !1, hidden: W = !1, noArrow: U = !1, clickable: I = !1, closeOnEsc: F = !1, closeOnScroll: ee = !1, closeOnResize: Je = !1, openEvents: L, closeEvents: ce, globalCloseEvents: Se, imperativeModeOnly: Qe, style: qe, position: ze, afterShow: Ke, afterHide: H, disableTooltip: ue, content: Ee, contentWrapperRef: te, isOpen: B, defaultIsOpen: de = !1, setIsOpen: oe, activeAnchor: _, setActiveAnchor: pe, border: Me, opacity: We, arrowColor: He, role: Ue = "tooltip" }) => {
108
- var Ae;
109
- const A = z(null), fe = z(null), D = z(null), Y = z(null), ke = z(null), [Z, Ye] = g({ tooltipStyles: {}, tooltipArrowStyles: {}, place: d }), [O, Pe] = g(!1), [re, le] = g(!1), [y, Oe] = g(null), xe = z(!1), Te = z(null), { anchorRefs: Le, setActiveAnchor: Ve } = ht(l), ve = z(!1), [G, Ce] = g([]), ne = z(!1), me = M || K.includes("click"), Re = me || L?.click || L?.dblclick || L?.mousedown, ye = L ? { ...L } : { mouseover: !0, focus: !0, mouseenter: !1, click: !1, dblclick: !1, mousedown: !1 };
110
- !L && me && Object.assign(ye, { mouseenter: !1, focus: !1, mouseover: !1, click: !0 });
111
- const Ne = ce ? { ...ce } : { mouseout: !0, blur: !0, mouseleave: !1, click: !1, dblclick: !1, mouseup: !1 };
112
- !ce && me && Object.assign(Ne, { mouseleave: !1, blur: !1, mouseout: !1 });
113
- const q = Se ? { ...Se } : { escape: F || !1, scroll: ee || !1, resize: Je || !1, clickOutsideAnchor: Re || !1 };
114
- Qe && (Object.assign(ye, { mouseenter: !1, focus: !1, click: !1, dblclick: !1, mousedown: !1 }), Object.assign(Ne, { mouseleave: !1, blur: !1, click: !1, dblclick: !1, mouseup: !1 }), Object.assign(q, { escape: !1, scroll: !1, resize: !1, clickOutsideAnchor: !1 })), Bt((() => (ne.current = !0, () => {
115
- ne.current = !1;
116
- })), []);
117
- const w = (e) => {
118
- ne.current && (e && le(!0), setTimeout((() => {
119
- ne.current && (oe?.(e), B === void 0 && Pe(e));
120
- }), 10));
121
- };
122
- p((() => {
123
- if (B === void 0) return () => null;
124
- B && le(!0);
125
- const e = setTimeout((() => {
126
- Pe(B);
127
- }), 10);
128
- return () => {
129
- clearTimeout(e);
130
- };
131
- }), [B]), p((() => {
132
- if (O !== xe.current) if (N(ke), xe.current = O, O) Ke?.();
133
- else {
134
- const e = ((r) => {
135
- const n = r.match(/^([\d.]+)(ms|s)$/);
136
- if (!n) return 0;
137
- const [, b, E] = n;
138
- return Number(b) * (E === "ms" ? 1 : 1e3);
139
- })(getComputedStyle(document.body).getPropertyValue("--rt-transition-show-delay"));
140
- ke.current = setTimeout((() => {
141
- le(!1), Oe(null), H?.();
142
- }), e + 25);
143
- }
144
- }), [O]);
145
- const Xe = (e) => {
146
- Ye(((r) => rt(r, e) ? r : e));
147
- }, je = (e = j) => {
148
- N(D), re ? w(!0) : D.current = setTimeout((() => {
149
- w(!0);
150
- }), e);
151
- }, he = (e = $) => {
152
- N(Y), Y.current = setTimeout((() => {
153
- ve.current || w(!1);
154
- }), e);
155
- }, $e = (e) => {
156
- var r;
157
- if (!e) return;
158
- const n = (r = e.currentTarget) !== null && r !== void 0 ? r : e.target;
159
- if (!n?.isConnected) return pe(null), void Ve({ current: null });
160
- j ? je() : w(!0), pe(n), Ve({ current: n }), N(Y);
161
- }, we = () => {
162
- I ? he($ || 100) : $ ? he() : w(!1), N(D);
163
- }, _e = ({ x: e, y: r }) => {
164
- var n;
165
- const b = { getBoundingClientRect: () => ({ x: e, y: r, width: 0, height: 0, top: r, left: e, right: e, bottom: r }) };
166
- pt({ place: (n = y?.place) !== null && n !== void 0 ? n : d, offset: h, elementReference: b, tooltipReference: A.current, tooltipArrowReference: fe.current, strategy: T, middlewares: ie, border: Me }).then(((E) => {
167
- Xe(E);
168
- }));
169
- }, be = (e) => {
170
- if (!e) return;
171
- const r = e, n = { x: r.clientX, y: r.clientY };
172
- _e(n), Te.current = n;
173
- }, Ie = (e) => {
174
- var r;
175
- if (!O) return;
176
- const n = e.target;
177
- n.isConnected && (!((r = A.current) === null || r === void 0) && r.contains(n) || [document.querySelector(`[id='${s}']`), ...G].some(((b) => b?.contains(n))) || (w(!1), N(D)));
178
- }, Fe = vt($e, 50), S = vt(we, 50), C = (e) => {
179
- S.cancel(), Fe(e);
180
- }, o = () => {
181
- Fe.cancel(), S();
182
- }, a = St((() => {
183
- var e, r;
184
- const n = (e = y?.position) !== null && e !== void 0 ? e : ze;
185
- n ? _e(n) : Q ? Te.current && _e(Te.current) : _?.isConnected && pt({ place: (r = y?.place) !== null && r !== void 0 ? r : d, offset: h, elementReference: _, tooltipReference: A.current, tooltipArrowReference: fe.current, strategy: T, middlewares: ie, border: Me }).then(((b) => {
186
- ne.current && Xe(b);
187
- }));
188
- }), [O, _, Ee, qe, d, y?.place, h, T, ze, y?.position, Q]);
189
- p((() => {
190
- var e, r;
191
- const n = new Set(Le);
192
- G.forEach(((c) => {
193
- ue?.(c) || n.add({ current: c });
194
- }));
195
- const b = document.querySelector(`[id='${s}']`);
196
- b && !ue?.(b) && n.add({ current: b });
197
- const E = () => {
198
- w(!1);
199
- }, P = yt(_), V = yt(A.current);
200
- q.scroll && (window.addEventListener("scroll", E), P?.addEventListener("scroll", E), V?.addEventListener("scroll", E));
201
- let k = null;
202
- q.resize ? window.addEventListener("resize", E) : _ && A.current && (k = kt(_, A.current, a, { ancestorResize: !0, elementResize: !0, layoutShift: !0 }));
203
- const R = (c) => {
204
- c.key === "Escape" && w(!1);
205
- };
206
- q.escape && window.addEventListener("keydown", R), q.clickOutsideAnchor && window.addEventListener("click", Ie);
207
- const v = [], Be = (c) => {
208
- O && c?.target === _ || $e(c);
209
- }, wt = (c) => {
210
- O && c?.target === _ && we();
211
- }, lt = ["mouseover", "mouseout", "mouseenter", "mouseleave", "focus", "blur"], nt = ["click", "dblclick", "mousedown", "mouseup"];
212
- Object.entries(ye).forEach((([c, J]) => {
213
- J && (lt.includes(c) ? v.push({ event: c, listener: C }) : nt.includes(c) && v.push({ event: c, listener: Be }));
214
- })), Object.entries(Ne).forEach((([c, J]) => {
215
- J && (lt.includes(c) ? v.push({ event: c, listener: o }) : nt.includes(c) && v.push({ event: c, listener: wt }));
216
- })), Q && v.push({ event: "pointermove", listener: be });
217
- const st = () => {
218
- ve.current = !0;
219
- }, at = () => {
220
- ve.current = !1, we();
221
- };
222
- return I && !Re && ((e = A.current) === null || e === void 0 || e.addEventListener("mouseenter", st), (r = A.current) === null || r === void 0 || r.addEventListener("mouseleave", at)), v.forEach((({ event: c, listener: J }) => {
223
- n.forEach(((Ze) => {
224
- var De;
225
- (De = Ze.current) === null || De === void 0 || De.addEventListener(c, J);
226
- }));
227
- })), () => {
228
- var c, J;
229
- q.scroll && (window.removeEventListener("scroll", E), P?.removeEventListener("scroll", E), V?.removeEventListener("scroll", E)), q.resize ? window.removeEventListener("resize", E) : k?.(), q.clickOutsideAnchor && window.removeEventListener("click", Ie), q.escape && window.removeEventListener("keydown", R), I && !Re && ((c = A.current) === null || c === void 0 || c.removeEventListener("mouseenter", st), (J = A.current) === null || J === void 0 || J.removeEventListener("mouseleave", at)), v.forEach((({ event: Ze, listener: De }) => {
230
- n.forEach(((_t) => {
231
- var Ge;
232
- (Ge = _t.current) === null || Ge === void 0 || Ge.removeEventListener(Ze, De);
233
- }));
234
- }));
235
- };
236
- }), [_, a, re, Le, G, L, ce, Se, me, j, $]), p((() => {
237
- var e, r;
238
- let n = (r = (e = y?.anchorSelect) !== null && e !== void 0 ? e : f) !== null && r !== void 0 ? r : "";
239
- !n && l && (n = `[data-tooltip-id='${l.replace(/'/g, "\\'")}']`);
240
- const b = new MutationObserver(((E) => {
241
- const P = [], V = [];
242
- E.forEach(((k) => {
243
- if (k.type === "attributes" && k.attributeName === "data-tooltip-id" && (k.target.getAttribute("data-tooltip-id") === l ? P.push(k.target) : k.oldValue === l && V.push(k.target)), k.type === "childList") {
244
- if (_) {
245
- const R = [...k.removedNodes].filter(((v) => v.nodeType === 1));
246
- if (n) try {
247
- V.push(...R.filter(((v) => v.matches(n)))), V.push(...R.flatMap(((v) => [...v.querySelectorAll(n)])));
248
- } catch {
249
- }
250
- R.some(((v) => {
251
- var Be;
252
- return !!(!((Be = v?.contains) === null || Be === void 0) && Be.call(v, _)) && (le(!1), w(!1), pe(null), N(D), N(Y), !0);
253
- }));
254
- }
255
- if (n) try {
256
- const R = [...k.addedNodes].filter(((v) => v.nodeType === 1));
257
- P.push(...R.filter(((v) => v.matches(n)))), P.push(...R.flatMap(((v) => [...v.querySelectorAll(n)])));
258
- } catch {
259
- }
260
- }
261
- })), (P.length || V.length) && Ce(((k) => [...k.filter(((R) => !V.includes(R))), ...P]));
262
- }));
263
- return b.observe(document.body, { childList: !0, subtree: !0, attributes: !0, attributeFilter: ["data-tooltip-id"], attributeOldValue: !0 }), () => {
264
- b.disconnect();
265
- };
266
- }), [l, f, y?.anchorSelect, _]), p((() => {
267
- a();
268
- }), [a]), p((() => {
269
- if (!te?.current) return () => null;
270
- const e = new ResizeObserver((() => {
271
- setTimeout((() => a()));
272
- }));
273
- return e.observe(te.current), () => {
274
- e.disconnect();
275
- };
276
- }), [Ee, te?.current]), p((() => {
277
- var e;
278
- const r = document.querySelector(`[id='${s}']`), n = [...G, r];
279
- _ && n.includes(_) || pe((e = G[0]) !== null && e !== void 0 ? e : r);
280
- }), [s, G, _]), p((() => (de && w(!0), () => {
281
- N(D), N(Y);
282
- })), []), p((() => {
283
- var e;
284
- let r = (e = y?.anchorSelect) !== null && e !== void 0 ? e : f;
285
- if (!r && l && (r = `[data-tooltip-id='${l.replace(/'/g, "\\'")}']`), r) try {
286
- const n = Array.from(document.querySelectorAll(r));
287
- Ce(n);
288
- } catch {
289
- Ce([]);
290
- }
291
- }), [l, f, y?.anchorSelect]), p((() => {
292
- D.current && (N(D), je(j));
293
- }), [j]);
294
- const x = (Ae = y?.content) !== null && Ae !== void 0 ? Ae : Ee, se = O && Object.keys(Z.tooltipStyles).length > 0;
295
- return Et(t, (() => ({ open: (e) => {
296
- if (e?.anchorSelect) try {
297
- document.querySelector(e.anchorSelect);
298
- } catch {
299
- return void console.warn(`[react-tooltip] "${e.anchorSelect}" is not a valid CSS selector`);
300
- }
301
- Oe(e ?? null), e?.delay ? je(e.delay) : w(!0);
302
- }, close: (e) => {
303
- e?.delay ? he(e.delay) : w(!1);
304
- }, activeAnchor: _, place: Z.place, isOpen: !!(re && !W && x && se) }))), re && !W && x ? ae.createElement(X, { id: l, role: Ue, className: ot("react-tooltip", ge.tooltip, tt.tooltip, tt[m], u, `react-tooltip__place-${Z.place}`, ge[se ? "show" : "closing"], se ? "react-tooltip__show" : "react-tooltip__closing", T === "fixed" && ge.fixed, I && ge.clickable), onTransitionEnd: (e) => {
305
- N(ke), O || e.propertyName !== "opacity" || (le(!1), Oe(null), H?.());
306
- }, style: { ...qe, ...Z.tooltipStyles, opacity: We !== void 0 && se ? We : void 0 }, ref: A }, x, ae.createElement(X, { className: ot("react-tooltip-arrow", ge.arrow, tt.arrow, i, U && ge.noArrow), style: { ...Z.tooltipArrowStyles, background: He ? `linear-gradient(to right bottom, transparent 50%, ${He} 50%)` : void 0 }, ref: fe })) : null;
307
- }, Mt = ({ content: t }) => ae.createElement("span", { dangerouslySetInnerHTML: { __html: t } }), Vt = ae.forwardRef((({ id: t, anchorId: l, anchorSelect: u, content: i, html: m, render: s, className: f, classNameArrow: d, variant: h = "dark", place: K = "top", offset: M = 10, wrapper: T = "div", children: ie = null, events: X = ["hover"], openOnClick: j = !1, positionStrategy: $ = "absolute", middlewares: Q, delayShow: W = 0, delayHide: U = 0, float: I = !1, hidden: F = !1, noArrow: ee = !1, clickable: Je = !1, closeOnEsc: L = !1, closeOnScroll: ce = !1, closeOnResize: Se = !1, openEvents: Qe, closeEvents: qe, globalCloseEvents: ze, imperativeModeOnly: Ke = !1, style: H, position: ue, isOpen: Ee, defaultIsOpen: te = !1, disableStyleInjection: B = !1, border: de, opacity: oe, arrowColor: _, setIsOpen: pe, afterShow: Me, afterHide: We, disableTooltip: He, role: Ue = "tooltip" }, Ae) => {
308
- const [A, fe] = g(i), [D, Y] = g(m), [ke, Z] = g(K), [Ye, O] = g(h), [Pe, re] = g(M), [le, y] = g(W), [Oe, xe] = g(U), [Te, Le] = g(I), [Ve, ve] = g(F), [G, Ce] = g(T), [ne, me] = g(X), [Re, ye] = g($), [Ne, q] = g(null), [w, Xe] = g(null), je = z(B), { anchorRefs: he, activeAnchor: $e } = ht(t), we = (S) => S?.getAttributeNames().reduce(((C, o) => {
309
- var a;
310
- return o.startsWith("data-tooltip-") && (C[o.replace(/^data-tooltip-/, "")] = (a = S?.getAttribute(o)) !== null && a !== void 0 ? a : null), C;
311
- }), {}), _e = (S) => {
312
- const C = { place: (o) => {
313
- var a;
314
- Z((a = o) !== null && a !== void 0 ? a : K);
315
- }, content: (o) => {
316
- fe(o ?? i);
317
- }, html: (o) => {
318
- Y(o ?? m);
319
- }, variant: (o) => {
320
- var a;
321
- O((a = o) !== null && a !== void 0 ? a : h);
322
- }, offset: (o) => {
323
- re(o === null ? M : Number(o));
324
- }, wrapper: (o) => {
325
- var a;
326
- Ce((a = o) !== null && a !== void 0 ? a : T);
327
- }, events: (o) => {
328
- const a = o?.split(" ");
329
- me(a ?? X);
330
- }, "position-strategy": (o) => {
331
- var a;
332
- ye((a = o) !== null && a !== void 0 ? a : $);
333
- }, "delay-show": (o) => {
334
- y(o === null ? W : Number(o));
335
- }, "delay-hide": (o) => {
336
- xe(o === null ? U : Number(o));
337
- }, float: (o) => {
338
- Le(o === null ? I : o === "true");
339
- }, hidden: (o) => {
340
- ve(o === null ? F : o === "true");
341
- }, "class-name": (o) => {
342
- q(o);
343
- } };
344
- Object.values(C).forEach(((o) => o(null))), Object.entries(S).forEach((([o, a]) => {
345
- var x;
346
- (x = C[o]) === null || x === void 0 || x.call(C, a);
347
- }));
348
- };
349
- p((() => {
350
- fe(i);
351
- }), [i]), p((() => {
352
- Y(m);
353
- }), [m]), p((() => {
354
- Z(K);
355
- }), [K]), p((() => {
356
- O(h);
357
- }), [h]), p((() => {
358
- re(M);
359
- }), [M]), p((() => {
360
- y(W);
361
- }), [W]), p((() => {
362
- xe(U);
363
- }), [U]), p((() => {
364
- Le(I);
365
- }), [I]), p((() => {
366
- ve(F);
367
- }), [F]), p((() => {
368
- ye($);
369
- }), [$]), p((() => {
370
- je.current !== B && console.warn("[react-tooltip] Do not change `disableStyleInjection` dynamically.");
371
- }), [B]), p((() => {
372
- typeof window < "u" && window.dispatchEvent(new CustomEvent("react-tooltip-inject-styles", { detail: { disableCore: B === "core", disableBase: B } }));
373
- }), []), p((() => {
374
- var S;
375
- const C = new Set(he);
376
- let o = u;
377
- if (!o && t && (o = `[data-tooltip-id='${t.replace(/'/g, "\\'")}']`), o) try {
378
- document.querySelectorAll(o).forEach(((r) => {
379
- C.add({ current: r });
380
- }));
381
- } catch {
382
- console.warn(`[react-tooltip] "${o}" is not a valid CSS selector`);
383
- }
384
- const a = document.querySelector(`[id='${l}']`);
385
- if (a && C.add({ current: a }), !C.size) return () => null;
386
- const x = (S = w ?? a) !== null && S !== void 0 ? S : $e.current, se = new MutationObserver(((r) => {
387
- r.forEach(((n) => {
388
- var b;
389
- if (!x || n.type !== "attributes" || !(!((b = n.attributeName) === null || b === void 0) && b.startsWith("data-tooltip-"))) return;
390
- const E = we(x);
391
- _e(E);
392
- }));
393
- })), e = { attributes: !0, childList: !1, subtree: !1 };
394
- if (x) {
395
- const r = we(x);
396
- _e(r), se.observe(x, e);
397
- }
398
- return () => {
399
- se.disconnect();
400
- };
401
- }), [he, $e, w, l, u]), p((() => {
402
- H?.border && console.warn("[react-tooltip] Do not set `style.border`. Use `border` prop instead."), de && !ft("border", `${de}`) && console.warn(`[react-tooltip] "${de}" is not a valid \`border\`.`), H?.opacity && console.warn("[react-tooltip] Do not set `style.opacity`. Use `opacity` prop instead."), oe && !ft("opacity", `${oe}`) && console.warn(`[react-tooltip] "${oe}" is not a valid \`opacity\`.`);
403
- }), []);
404
- let be = ie;
405
- const Ie = z(null);
406
- if (s) {
407
- const S = s({ content: w?.getAttribute("data-tooltip-content") || A || null, activeAnchor: w });
408
- be = S ? ae.createElement("div", { ref: Ie, className: "react-tooltip-content-wrapper" }, S) : null;
409
- } else A && (be = A);
410
- D && (be = ae.createElement(Mt, { content: D }));
411
- const Fe = { forwardRef: Ae, id: t, anchorId: l, anchorSelect: u, className: ot(f, Ne), classNameArrow: d, content: be, contentWrapperRef: Ie, place: ke, variant: Ye, offset: Pe, wrapper: G, events: ne, openOnClick: j, positionStrategy: Re, middlewares: Q, delayShow: le, delayHide: Oe, float: Te, hidden: Ve, noArrow: ee, clickable: Je, closeOnEsc: L, closeOnScroll: ce, closeOnResize: Se, openEvents: Qe, closeEvents: qe, globalCloseEvents: ze, imperativeModeOnly: Ke, style: H, position: ue, isOpen: Ee, defaultIsOpen: te, border: de, opacity: oe, arrowColor: _, setIsOpen: pe, afterShow: Me, afterHide: We, disableTooltip: He, activeAnchor: w, setActiveAnchor: (S) => Xe(S), role: Ue };
412
- return ae.createElement(Kt, { ...Fe });
413
- }));
414
- typeof window < "u" && window.addEventListener("react-tooltip-inject-styles", ((t) => {
415
- t.detail.disableCore || dt({ css: ":root{--rt-color-white:#fff;--rt-color-dark:#222;--rt-color-success:#8dc572;--rt-color-error:#be6464;--rt-color-warning:#f0ad4e;--rt-color-info:#337ab7;--rt-opacity:0.9;--rt-transition-show-delay:0.15s;--rt-transition-closing-delay:0.15s}.core-styles-module_tooltip__3vRRp{position:absolute;top:0;left:0;pointer-events:none;opacity:0;will-change:opacity}.core-styles-module_fixed__pcSol{position:fixed}.core-styles-module_arrow__cvMwQ{position:absolute;background:inherit}.core-styles-module_noArrow__xock6{display:none}.core-styles-module_clickable__ZuTTB{pointer-events:auto}.core-styles-module_show__Nt9eE{opacity:var(--rt-opacity);transition:opacity var(--rt-transition-show-delay)ease-out}.core-styles-module_closing__sGnxF{opacity:0;transition:opacity var(--rt-transition-closing-delay)ease-in}", type: "core" }), t.detail.disableBase || dt({ css: `
416
- .styles-module_tooltip__mnnfp{padding:8px 16px;border-radius:3px;font-size:90%;width:max-content}.styles-module_arrow__K0L3T{width:8px;height:8px}[class*='react-tooltip__place-top']>.styles-module_arrow__K0L3T{transform:rotate(45deg)}[class*='react-tooltip__place-right']>.styles-module_arrow__K0L3T{transform:rotate(135deg)}[class*='react-tooltip__place-bottom']>.styles-module_arrow__K0L3T{transform:rotate(225deg)}[class*='react-tooltip__place-left']>.styles-module_arrow__K0L3T{transform:rotate(315deg)}.styles-module_dark__xNqje{background:var(--rt-color-dark);color:var(--rt-color-white)}.styles-module_light__Z6W-X{background-color:var(--rt-color-white);color:var(--rt-color-dark)}.styles-module_success__A2AKt{background-color:var(--rt-color-success);color:var(--rt-color-white)}.styles-module_warning__SCK0X{background-color:var(--rt-color-warning);color:var(--rt-color-white)}.styles-module_error__JvumD{background-color:var(--rt-color-error);color:var(--rt-color-white)}.styles-module_info__BWdHW{background-color:var(--rt-color-info);color:var(--rt-color-white)}`, type: "base" });
417
- }));
418
- export {
419
- Vt as M
420
- };