@levo-so/react 0.1.63 → 0.1.64
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/audience/components/block.d.ts.map +1 -0
- package/dist/audience/components/component.d.ts.map +1 -0
- package/dist/audience/components/page.d.ts +1 -1
- package/dist/audience/components/page.d.ts.map +1 -0
- package/dist/audience/hooks/useBounce.d.ts.map +1 -0
- package/dist/audience/hooks/useCurrentTab.d.ts.map +1 -0
- package/dist/audience/hooks/useIdentifyAudience.d.ts.map +1 -0
- package/dist/audience/hooks/useOpenTabs.d.ts.map +1 -0
- package/dist/audience/hooks/useScrollBehavior.d.ts.map +1 -0
- package/dist/audience/hooks/useTextSelection.d.ts.map +1 -0
- package/dist/audience/hooks/useTrackClicks.d.ts.map +1 -0
- package/dist/audience/index.d.ts.map +1 -0
- package/dist/audience/utils/autocapture.d.ts.map +1 -0
- package/dist/audience/utils/rageclick.d.ts.map +1 -0
- package/dist/components/Dialog.d.ts.map +1 -0
- package/dist/components/DialogWrapper.d.ts.map +1 -0
- package/dist/components/Sonner.d.ts.map +1 -0
- package/dist/components/Spinner.d.ts.map +1 -0
- package/dist/components/Table.d.ts.map +1 -0
- package/dist/components/Tabs.d.ts.map +1 -0
- package/dist/components/Tooltip.d.ts.map +1 -0
- package/dist/components/button/Button.d.ts.map +1 -0
- package/dist/components/button/buttonVariants.d.ts.map +1 -0
- package/dist/components/button/index.d.ts.map +1 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/constants/fileUploadPresets.d.ts.map +1 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.js +550 -533
- package/dist/membership/components/Button.d.ts.map +1 -0
- package/dist/membership/components/Container.d.ts.map +1 -0
- package/dist/membership/components/Core.d.ts.map +1 -0
- package/dist/membership/components/Popup.d.ts.map +1 -0
- package/dist/membership/index.d.ts.map +1 -0
- package/dist/membership/useLevoOAuth.d.ts.map +1 -0
- package/dist/providers/LevoProvider.d.ts +9 -3
- package/dist/providers/LevoProvider.d.ts.map +1 -0
- package/dist/utils/byteToSize.d.ts.map +1 -0
- package/dist/utils/cn.d.ts.map +1 -0
- package/dist/utils/errorHandler.d.ts.map +1 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/isDateObject.d.ts.map +1 -0
- package/dist/utils/isEmptyObject.d.ts.map +1 -0
- package/dist/utils/isNullOrUndefined.d.ts.map +1 -0
- package/dist/utils/isObject.d.ts.map +1 -0
- package/package.json +14 -14
package/dist/index.js
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import { clsx as
|
|
5
|
-
import { twMerge as
|
|
2
|
+
import * as $ from "react";
|
|
3
|
+
import D, { createContext as nt, useContext as Re, useState as N, useEffect as k, useRef as H, useCallback as Q, useMemo as fe } from "react";
|
|
4
|
+
import { clsx as ot } from "clsx";
|
|
5
|
+
import { twMerge as Ce } from "tailwind-merge";
|
|
6
6
|
import { getLevoError as U } from "@levo-so/core";
|
|
7
|
-
import { usePageLifecycle as
|
|
8
|
-
import { Slot as
|
|
9
|
-
import { cva as
|
|
10
|
-
import { X as
|
|
11
|
-
import { Toaster as
|
|
12
|
-
import { toast as
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
function
|
|
16
|
-
if (
|
|
17
|
-
|
|
7
|
+
import { usePageLifecycle as st, LifecycleState as xe } from "use-page-lifecycle";
|
|
8
|
+
import { Slot as it, Dialog as j, Tabs as W, Tooltip as z } from "radix-ui";
|
|
9
|
+
import { cva as at } from "class-variance-authority";
|
|
10
|
+
import { X as ct } from "lucide-react";
|
|
11
|
+
import { Toaster as lt, toast as ue } from "sonner";
|
|
12
|
+
import { toast as An } from "sonner";
|
|
13
|
+
var q = { exports: {} }, V = {};
|
|
14
|
+
var Te;
|
|
15
|
+
function ut() {
|
|
16
|
+
if (Te) return V;
|
|
17
|
+
Te = 1;
|
|
18
18
|
var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
|
|
19
19
|
function r(n, o, i) {
|
|
20
|
-
var
|
|
21
|
-
if (i !== void 0 && (
|
|
20
|
+
var c = null;
|
|
21
|
+
if (i !== void 0 && (c = "" + i), o.key !== void 0 && (c = "" + o.key), "key" in o) {
|
|
22
22
|
i = {};
|
|
23
|
-
for (var
|
|
24
|
-
|
|
23
|
+
for (var l in o)
|
|
24
|
+
l !== "key" && (i[l] = o[l]);
|
|
25
25
|
} else i = o;
|
|
26
26
|
return o = i.ref, {
|
|
27
27
|
$$typeof: e,
|
|
28
28
|
type: n,
|
|
29
|
-
key:
|
|
29
|
+
key: c,
|
|
30
30
|
ref: o !== void 0 ? o : null,
|
|
31
31
|
props: i
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
return
|
|
34
|
+
return V.Fragment = t, V.jsx = r, V.jsxs = r, V;
|
|
35
35
|
}
|
|
36
|
-
var
|
|
37
|
-
var
|
|
38
|
-
function
|
|
39
|
-
return
|
|
36
|
+
var G = {};
|
|
37
|
+
var Ee;
|
|
38
|
+
function dt() {
|
|
39
|
+
return Ee || (Ee = 1, process.env.NODE_ENV !== "production" && function() {
|
|
40
40
|
function e(s) {
|
|
41
41
|
if (s == null) return null;
|
|
42
42
|
if (typeof s == "function")
|
|
43
|
-
return s.$$typeof ===
|
|
43
|
+
return s.$$typeof === et ? null : s.displayName || s.name || null;
|
|
44
44
|
if (typeof s == "string") return s;
|
|
45
45
|
switch (s) {
|
|
46
46
|
case x:
|
|
47
47
|
return "Fragment";
|
|
48
48
|
case w:
|
|
49
49
|
return "Profiler";
|
|
50
|
-
case
|
|
50
|
+
case R:
|
|
51
51
|
return "StrictMode";
|
|
52
52
|
case v:
|
|
53
53
|
return "Suspense";
|
|
54
54
|
case L:
|
|
55
55
|
return "SuspenseList";
|
|
56
|
-
case
|
|
56
|
+
case Qe:
|
|
57
57
|
return "Activity";
|
|
58
58
|
}
|
|
59
59
|
if (typeof s == "object")
|
|
@@ -62,14 +62,14 @@ function ft() {
|
|
|
62
62
|
), s.$$typeof) {
|
|
63
63
|
case O:
|
|
64
64
|
return "Portal";
|
|
65
|
-
case
|
|
65
|
+
case A:
|
|
66
66
|
return s.displayName || "Context";
|
|
67
67
|
case _:
|
|
68
68
|
return (s._context.displayName || "Context") + ".Consumer";
|
|
69
69
|
case M:
|
|
70
70
|
var f = s.render;
|
|
71
71
|
return s = s.displayName, s || (s = f.displayName || f.name || "", s = s !== "" ? "ForwardRef(" + s + ")" : "ForwardRef"), s;
|
|
72
|
-
case
|
|
72
|
+
case I:
|
|
73
73
|
return f = s.displayName || null, f !== null ? f : e(s.type) || "Memo";
|
|
74
74
|
case F:
|
|
75
75
|
f = s._payload, s = s._init;
|
|
@@ -112,22 +112,22 @@ function ft() {
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
function o() {
|
|
115
|
-
var s =
|
|
115
|
+
var s = oe.A;
|
|
116
116
|
return s === null ? null : s.getOwner();
|
|
117
117
|
}
|
|
118
118
|
function i() {
|
|
119
119
|
return Error("react-stack-top-frame");
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
if (
|
|
121
|
+
function c(s) {
|
|
122
|
+
if (pe.call(s, "key")) {
|
|
123
123
|
var f = Object.getOwnPropertyDescriptor(s, "key").get;
|
|
124
124
|
if (f && f.isReactWarning) return !1;
|
|
125
125
|
}
|
|
126
126
|
return s.key !== void 0;
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function l(s, f) {
|
|
129
129
|
function y() {
|
|
130
|
-
|
|
130
|
+
be || (be = !0, console.error(
|
|
131
131
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
132
132
|
f
|
|
133
133
|
));
|
|
@@ -139,11 +139,11 @@ function ft() {
|
|
|
139
139
|
}
|
|
140
140
|
function a() {
|
|
141
141
|
var s = e(this.type);
|
|
142
|
-
return
|
|
142
|
+
return he[s] || (he[s] = !0, console.error(
|
|
143
143
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
144
144
|
)), s = this.props.ref, s !== void 0 ? s : null;
|
|
145
145
|
}
|
|
146
|
-
function d(s, f, y, T,
|
|
146
|
+
function d(s, f, y, T, J, ie) {
|
|
147
147
|
var E = y.ref;
|
|
148
148
|
return s = {
|
|
149
149
|
$$typeof: h,
|
|
@@ -168,19 +168,19 @@ function ft() {
|
|
|
168
168
|
configurable: !1,
|
|
169
169
|
enumerable: !1,
|
|
170
170
|
writable: !0,
|
|
171
|
-
value:
|
|
171
|
+
value: J
|
|
172
172
|
}), Object.defineProperty(s, "_debugTask", {
|
|
173
173
|
configurable: !1,
|
|
174
174
|
enumerable: !1,
|
|
175
175
|
writable: !0,
|
|
176
|
-
value:
|
|
176
|
+
value: ie
|
|
177
177
|
}), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
|
|
178
178
|
}
|
|
179
|
-
function
|
|
179
|
+
function m(s, f, y, T, J, ie) {
|
|
180
180
|
var E = f.children;
|
|
181
181
|
if (E !== void 0)
|
|
182
182
|
if (T)
|
|
183
|
-
if (
|
|
183
|
+
if (tt(E)) {
|
|
184
184
|
for (T = 0; T < E.length; T++)
|
|
185
185
|
u(E[T]);
|
|
186
186
|
Object.freeze && Object.freeze(E);
|
|
@@ -189,12 +189,12 @@ function ft() {
|
|
|
189
189
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
190
190
|
);
|
|
191
191
|
else u(E);
|
|
192
|
-
if (
|
|
192
|
+
if (pe.call(f, "key")) {
|
|
193
193
|
E = e(s);
|
|
194
|
-
var B = Object.keys(f).filter(function(
|
|
195
|
-
return
|
|
194
|
+
var B = Object.keys(f).filter(function(rt) {
|
|
195
|
+
return rt !== "key";
|
|
196
196
|
});
|
|
197
|
-
T = 0 < B.length ? "{key: someKey, " + B.join(": ..., ") + ": ...}" : "{key: someKey}",
|
|
197
|
+
T = 0 < B.length ? "{key: someKey, " + B.join(": ..., ") + ": ...}" : "{key: someKey}", we[E + T] || (B = 0 < B.length ? "{" + B.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
198
198
|
`A props object containing a "key" prop is being spread into JSX:
|
|
199
199
|
let props = %s;
|
|
200
200
|
<%s {...props} />
|
|
@@ -205,14 +205,14 @@ React keys must be passed directly to JSX without using spread:
|
|
|
205
205
|
E,
|
|
206
206
|
B,
|
|
207
207
|
E
|
|
208
|
-
),
|
|
208
|
+
), we[E + T] = !0);
|
|
209
209
|
}
|
|
210
|
-
if (E = null, y !== void 0 && (r(y), E = "" + y),
|
|
210
|
+
if (E = null, y !== void 0 && (r(y), E = "" + y), c(f) && (r(f.key), E = "" + f.key), "key" in f) {
|
|
211
211
|
y = {};
|
|
212
|
-
for (var
|
|
213
|
-
|
|
212
|
+
for (var ae in f)
|
|
213
|
+
ae !== "key" && (y[ae] = f[ae]);
|
|
214
214
|
} else y = f;
|
|
215
|
-
return E &&
|
|
215
|
+
return E && l(
|
|
216
216
|
y,
|
|
217
217
|
typeof s == "function" ? s.displayName || s.name || "Unknown" : s
|
|
218
218
|
), d(
|
|
@@ -220,17 +220,17 @@ React keys must be passed directly to JSX without using spread:
|
|
|
220
220
|
E,
|
|
221
221
|
y,
|
|
222
222
|
o(),
|
|
223
|
-
|
|
224
|
-
|
|
223
|
+
J,
|
|
224
|
+
ie
|
|
225
225
|
);
|
|
226
226
|
}
|
|
227
227
|
function u(s) {
|
|
228
|
-
|
|
228
|
+
p(s) ? s._store && (s._store.validated = 1) : typeof s == "object" && s !== null && s.$$typeof === F && (s._payload.status === "fulfilled" ? p(s._payload.value) && s._payload.value._store && (s._payload.value._store.validated = 1) : s._store && (s._store.validated = 1));
|
|
229
229
|
}
|
|
230
|
-
function
|
|
230
|
+
function p(s) {
|
|
231
231
|
return typeof s == "object" && s !== null && s.$$typeof === h;
|
|
232
232
|
}
|
|
233
|
-
var b =
|
|
233
|
+
var b = D, h = Symbol.for("react.transitional.element"), O = Symbol.for("react.portal"), x = Symbol.for("react.fragment"), R = Symbol.for("react.strict_mode"), w = Symbol.for("react.profiler"), _ = Symbol.for("react.consumer"), A = Symbol.for("react.context"), M = Symbol.for("react.forward_ref"), v = Symbol.for("react.suspense"), L = Symbol.for("react.suspense_list"), I = Symbol.for("react.memo"), F = Symbol.for("react.lazy"), Qe = Symbol.for("react.activity"), et = Symbol.for("react.client.reference"), oe = b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, pe = Object.prototype.hasOwnProperty, tt = Array.isArray, se = console.createTask ? console.createTask : function() {
|
|
234
234
|
return null;
|
|
235
235
|
};
|
|
236
236
|
b = {
|
|
@@ -238,55 +238,61 @@ React keys must be passed directly to JSX without using spread:
|
|
|
238
238
|
return s();
|
|
239
239
|
}
|
|
240
240
|
};
|
|
241
|
-
var
|
|
241
|
+
var be, he = {}, ve = b.react_stack_bottom_frame.bind(
|
|
242
242
|
b,
|
|
243
243
|
i
|
|
244
|
-
)(),
|
|
245
|
-
|
|
246
|
-
var T = 1e4 >
|
|
247
|
-
return
|
|
244
|
+
)(), ye = se(n(i)), we = {};
|
|
245
|
+
G.Fragment = x, G.jsx = function(s, f, y) {
|
|
246
|
+
var T = 1e4 > oe.recentlyCreatedOwnerStacks++;
|
|
247
|
+
return m(
|
|
248
248
|
s,
|
|
249
249
|
f,
|
|
250
250
|
y,
|
|
251
251
|
!1,
|
|
252
|
-
T ? Error("react-stack-top-frame") :
|
|
253
|
-
T ?
|
|
252
|
+
T ? Error("react-stack-top-frame") : ve,
|
|
253
|
+
T ? se(n(s)) : ye
|
|
254
254
|
);
|
|
255
|
-
},
|
|
256
|
-
var T = 1e4 >
|
|
257
|
-
return
|
|
255
|
+
}, G.jsxs = function(s, f, y) {
|
|
256
|
+
var T = 1e4 > oe.recentlyCreatedOwnerStacks++;
|
|
257
|
+
return m(
|
|
258
258
|
s,
|
|
259
259
|
f,
|
|
260
260
|
y,
|
|
261
261
|
!0,
|
|
262
|
-
T ? Error("react-stack-top-frame") :
|
|
263
|
-
T ?
|
|
262
|
+
T ? Error("react-stack-top-frame") : ve,
|
|
263
|
+
T ? se(n(s)) : ye
|
|
264
264
|
);
|
|
265
265
|
};
|
|
266
|
-
}()),
|
|
266
|
+
}()), G;
|
|
267
267
|
}
|
|
268
|
-
var
|
|
269
|
-
function
|
|
270
|
-
return
|
|
268
|
+
var ke;
|
|
269
|
+
function ft() {
|
|
270
|
+
return ke || (ke = 1, process.env.NODE_ENV === "production" ? q.exports = ut() : q.exports = dt()), q.exports;
|
|
271
271
|
}
|
|
272
|
-
var g =
|
|
273
|
-
const
|
|
272
|
+
var g = ft();
|
|
273
|
+
const Le = nt({
|
|
274
274
|
client: null,
|
|
275
275
|
insights: null
|
|
276
|
-
}),
|
|
277
|
-
const
|
|
276
|
+
}), gn = ({ children: e, client: t, insights: r = null }) => {
|
|
277
|
+
const n = {
|
|
278
|
+
client: t,
|
|
279
|
+
insights: r
|
|
280
|
+
};
|
|
281
|
+
return /* @__PURE__ */ g.jsx(Le.Provider, { value: n, children: e });
|
|
282
|
+
}, P = () => {
|
|
283
|
+
const e = Re(Le);
|
|
278
284
|
if (!e.client)
|
|
279
285
|
throw new Error(
|
|
280
286
|
"useLevo must be used within a LevoProvider. Please ensure you have wrapped your component tree with LevoProvider."
|
|
281
287
|
);
|
|
282
|
-
return e
|
|
283
|
-
},
|
|
284
|
-
const r =
|
|
288
|
+
return e;
|
|
289
|
+
}, mn = ({ id: e, properties: t = {} }) => {
|
|
290
|
+
const { insights: r } = P(), [n, o] = N(!1);
|
|
285
291
|
return k(() => {
|
|
286
292
|
if (n || typeof r?.track != "function") return;
|
|
287
293
|
const i = document.getElementById(e);
|
|
288
294
|
if (!i) return;
|
|
289
|
-
const
|
|
295
|
+
const c = () => {
|
|
290
296
|
n || (r?.track("block.view", {
|
|
291
297
|
...t,
|
|
292
298
|
resource: "block",
|
|
@@ -294,16 +300,16 @@ const pe = ot({
|
|
|
294
300
|
}), o(!0));
|
|
295
301
|
};
|
|
296
302
|
if (((d) => {
|
|
297
|
-
const
|
|
298
|
-
return
|
|
303
|
+
const m = d.getBoundingClientRect();
|
|
304
|
+
return m.top >= 0 && m.left >= 0 && m.bottom <= (window.innerHeight || document.documentElement.clientHeight) && m.right <= (window.innerWidth || document.documentElement.clientWidth);
|
|
299
305
|
})(i)) {
|
|
300
|
-
|
|
306
|
+
c();
|
|
301
307
|
return;
|
|
302
308
|
}
|
|
303
309
|
const a = new IntersectionObserver(
|
|
304
310
|
(d) => {
|
|
305
|
-
d.forEach((
|
|
306
|
-
|
|
311
|
+
d.forEach((m) => {
|
|
312
|
+
m.isIntersecting && (c(), a.disconnect());
|
|
307
313
|
});
|
|
308
314
|
},
|
|
309
315
|
{ threshold: 0 }
|
|
@@ -312,83 +318,83 @@ const pe = ot({
|
|
|
312
318
|
a.disconnect();
|
|
313
319
|
};
|
|
314
320
|
}, [r, e, t, n]), null;
|
|
315
|
-
},
|
|
316
|
-
const r =
|
|
321
|
+
}, pn = ({ event: e, properties: t }) => {
|
|
322
|
+
const { insights: r } = P();
|
|
317
323
|
return k(() => {
|
|
318
324
|
r?.instance && r?.track(e, t);
|
|
319
325
|
}, [r, e, t]), null;
|
|
320
|
-
},
|
|
321
|
-
const {
|
|
326
|
+
}, gt = ({ id: e }) => {
|
|
327
|
+
const { client: t, insights: r } = P(), { logger: n } = t, o = H(!1), i = Q(
|
|
322
328
|
(l) => {
|
|
323
|
-
if (!
|
|
324
|
-
|
|
329
|
+
if (!o.current) {
|
|
330
|
+
o.current = !0;
|
|
325
331
|
try {
|
|
326
332
|
r?.bounce({
|
|
327
333
|
resource: "page",
|
|
328
334
|
identifier: e,
|
|
329
335
|
...l
|
|
330
336
|
});
|
|
331
|
-
} catch (
|
|
332
|
-
|
|
337
|
+
} catch (a) {
|
|
338
|
+
n?.error("Failed to send bounce event", U(a));
|
|
333
339
|
}
|
|
334
340
|
}
|
|
335
341
|
},
|
|
336
|
-
[r, e,
|
|
342
|
+
[r, e, n]
|
|
337
343
|
);
|
|
338
344
|
k(() => {
|
|
339
|
-
|
|
345
|
+
o.current = !1;
|
|
340
346
|
const l = () => {
|
|
341
|
-
const
|
|
342
|
-
let
|
|
343
|
-
if (
|
|
344
|
-
|
|
347
|
+
const a = performance.getEntriesByType("navigation")?.[0];
|
|
348
|
+
let d = !1;
|
|
349
|
+
if (a)
|
|
350
|
+
a.type === "navigate" && (d = !0);
|
|
345
351
|
else
|
|
346
352
|
try {
|
|
347
|
-
const
|
|
348
|
-
|
|
353
|
+
const m = document.activeElement;
|
|
354
|
+
m?.tagName === "A" && m.href && new URL(m.href).origin !== window.location.origin && (d = !0);
|
|
349
355
|
} catch {
|
|
350
356
|
}
|
|
351
|
-
|
|
352
|
-
is_navigating_away:
|
|
353
|
-
navigation_type:
|
|
357
|
+
i({
|
|
358
|
+
is_navigating_away: d,
|
|
359
|
+
navigation_type: a?.type,
|
|
354
360
|
trigger: "beforeunload"
|
|
355
361
|
});
|
|
356
362
|
};
|
|
357
363
|
return window.addEventListener("beforeunload", l), () => {
|
|
358
364
|
window.removeEventListener("beforeunload", l);
|
|
359
365
|
};
|
|
360
|
-
}, [
|
|
361
|
-
const [
|
|
366
|
+
}, [i]);
|
|
367
|
+
const [c] = st();
|
|
362
368
|
k(() => {
|
|
363
|
-
(
|
|
364
|
-
state:
|
|
369
|
+
(c === xe.FROZEN || c === xe.TERMINATED) && i({
|
|
370
|
+
state: c,
|
|
365
371
|
trigger: "lifecycle"
|
|
366
372
|
});
|
|
367
|
-
}, [
|
|
368
|
-
},
|
|
369
|
-
const e =
|
|
373
|
+
}, [c, i]);
|
|
374
|
+
}, mt = () => {
|
|
375
|
+
const { insights: e } = P(), [t, r] = N(null);
|
|
370
376
|
return k(() => {
|
|
371
377
|
if (!e) return;
|
|
372
378
|
let n = sessionStorage.getItem(e.storage_keys.current_tab);
|
|
373
379
|
const o = JSON.parse(localStorage.getItem(e.storage_keys.all_tabs) || "[]");
|
|
374
380
|
n && o.includes(n) && (n = null), n || (n = `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, sessionStorage.setItem(e.storage_keys.current_tab, n)), o.includes(n) || (o.push(n), localStorage.setItem(e.storage_keys.all_tabs, JSON.stringify(o))), r(n);
|
|
375
381
|
const i = () => {
|
|
376
|
-
const
|
|
377
|
-
localStorage.setItem(e.storage_keys.all_tabs, JSON.stringify(
|
|
382
|
+
const c = o.filter((l) => l !== n);
|
|
383
|
+
localStorage.setItem(e.storage_keys.all_tabs, JSON.stringify(c));
|
|
378
384
|
};
|
|
379
385
|
return window.addEventListener("beforeunload", i), () => {
|
|
380
386
|
window.removeEventListener("beforeunload", i);
|
|
381
387
|
};
|
|
382
388
|
}, [e]), t;
|
|
383
|
-
},
|
|
389
|
+
}, pt = ({
|
|
384
390
|
id: e,
|
|
385
391
|
properties: t = {},
|
|
386
392
|
href: r
|
|
387
393
|
}) => {
|
|
388
|
-
const
|
|
394
|
+
const { client: n, insights: o } = P();
|
|
389
395
|
k(() => {
|
|
390
396
|
(() => {
|
|
391
|
-
o
|
|
397
|
+
o && n.workspace && r && (o?.instance ? o.instance.page({
|
|
392
398
|
resource: "page",
|
|
393
399
|
identifier: e
|
|
394
400
|
}) : o?.initiate({
|
|
@@ -397,169 +403,169 @@ const pe = ot({
|
|
|
397
403
|
created_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
398
404
|
}));
|
|
399
405
|
})();
|
|
400
|
-
}, [o,
|
|
401
|
-
},
|
|
402
|
-
const e =
|
|
406
|
+
}, [n, o, e, t, r]);
|
|
407
|
+
}, bt = () => {
|
|
408
|
+
const { insights: e } = P(), [t, r] = N(0);
|
|
403
409
|
return k(() => {
|
|
404
410
|
if (!e) return;
|
|
405
|
-
const n = Number(localStorage.getItem(e
|
|
406
|
-
r(n), localStorage.setItem(e
|
|
407
|
-
const o = (
|
|
408
|
-
|
|
411
|
+
const n = Number(localStorage.getItem(e.storage_keys.open_tabs)) || 0;
|
|
412
|
+
r(n), localStorage.setItem(e.storage_keys.open_tabs, (n + 1).toString());
|
|
413
|
+
const o = (c) => {
|
|
414
|
+
c.key === e.storage_keys.open_tabs && r(Number(c.newValue) || 0);
|
|
409
415
|
};
|
|
410
416
|
window.addEventListener("storage", o);
|
|
411
417
|
const i = () => {
|
|
412
|
-
const
|
|
413
|
-
|
|
418
|
+
const c = Number(localStorage.getItem(e.storage_keys.open_tabs)) || 0;
|
|
419
|
+
c > 0 && localStorage.setItem(e.storage_keys.open_tabs, (c - 1).toString());
|
|
414
420
|
};
|
|
415
421
|
return window.addEventListener("beforeunload", i), () => {
|
|
416
422
|
window.removeEventListener("storage", o), window.removeEventListener("beforeunload", i);
|
|
417
423
|
};
|
|
418
424
|
}, [e]), t;
|
|
419
425
|
};
|
|
420
|
-
function
|
|
426
|
+
function de(e) {
|
|
421
427
|
var t = typeof e;
|
|
422
428
|
return e != null && (t == "object" || t == "function");
|
|
423
429
|
}
|
|
424
|
-
var
|
|
425
|
-
return
|
|
426
|
-
},
|
|
427
|
-
function
|
|
428
|
-
for (var t = e.length; t-- &&
|
|
430
|
+
var ht = typeof global == "object" && global && global.Object === Object && global, vt = typeof self == "object" && self && self.Object === Object && self, Pe = ht || vt || Function("return this")(), ce = function() {
|
|
431
|
+
return Pe.Date.now();
|
|
432
|
+
}, yt = /\s/;
|
|
433
|
+
function wt(e) {
|
|
434
|
+
for (var t = e.length; t-- && yt.test(e.charAt(t)); )
|
|
429
435
|
;
|
|
430
436
|
return t;
|
|
431
437
|
}
|
|
432
|
-
var
|
|
433
|
-
function
|
|
434
|
-
return e && e.slice(0,
|
|
438
|
+
var xt = /^\s+/;
|
|
439
|
+
function Tt(e) {
|
|
440
|
+
return e && e.slice(0, wt(e) + 1).replace(xt, "");
|
|
435
441
|
}
|
|
436
|
-
var
|
|
437
|
-
function
|
|
438
|
-
var t =
|
|
442
|
+
var ee = Pe.Symbol, Ae = Object.prototype, Et = Ae.hasOwnProperty, kt = Ae.toString, X = ee ? ee.toStringTag : void 0;
|
|
443
|
+
function _t(e) {
|
|
444
|
+
var t = Et.call(e, X), r = e[X];
|
|
439
445
|
try {
|
|
440
|
-
e[
|
|
446
|
+
e[X] = void 0;
|
|
441
447
|
var n = !0;
|
|
442
448
|
} catch {
|
|
443
449
|
}
|
|
444
|
-
var o =
|
|
445
|
-
return n && (t ? e[
|
|
450
|
+
var o = kt.call(e);
|
|
451
|
+
return n && (t ? e[X] = r : delete e[X]), o;
|
|
446
452
|
}
|
|
447
|
-
var
|
|
448
|
-
function
|
|
449
|
-
return
|
|
453
|
+
var St = Object.prototype, Ot = St.toString;
|
|
454
|
+
function Nt(e) {
|
|
455
|
+
return Ot.call(e);
|
|
450
456
|
}
|
|
451
|
-
var
|
|
452
|
-
function
|
|
453
|
-
return e == null ? e === void 0 ? Rt :
|
|
457
|
+
var jt = "[object Null]", Rt = "[object Undefined]", _e = ee ? ee.toStringTag : void 0;
|
|
458
|
+
function Ct(e) {
|
|
459
|
+
return e == null ? e === void 0 ? Rt : jt : _e && _e in Object(e) ? _t(e) : Nt(e);
|
|
454
460
|
}
|
|
455
|
-
function
|
|
461
|
+
function Lt(e) {
|
|
456
462
|
return e != null && typeof e == "object";
|
|
457
463
|
}
|
|
458
|
-
var
|
|
459
|
-
function
|
|
460
|
-
return typeof e == "symbol" ||
|
|
464
|
+
var Pt = "[object Symbol]";
|
|
465
|
+
function At(e) {
|
|
466
|
+
return typeof e == "symbol" || Lt(e) && Ct(e) == Pt;
|
|
461
467
|
}
|
|
462
|
-
var
|
|
463
|
-
function
|
|
468
|
+
var Se = NaN, It = /^[-+]0x[0-9a-f]+$/i, Dt = /^0b[01]+$/i, $t = /^0o[0-7]+$/i, Mt = parseInt;
|
|
469
|
+
function Oe(e) {
|
|
464
470
|
if (typeof e == "number")
|
|
465
471
|
return e;
|
|
466
|
-
if (
|
|
467
|
-
return
|
|
468
|
-
if (
|
|
472
|
+
if (At(e))
|
|
473
|
+
return Se;
|
|
474
|
+
if (de(e)) {
|
|
469
475
|
var t = typeof e.valueOf == "function" ? e.valueOf() : e;
|
|
470
|
-
e =
|
|
476
|
+
e = de(t) ? t + "" : t;
|
|
471
477
|
}
|
|
472
478
|
if (typeof e != "string")
|
|
473
479
|
return e === 0 ? e : +e;
|
|
474
|
-
e =
|
|
475
|
-
var r =
|
|
476
|
-
return r ||
|
|
480
|
+
e = Tt(e);
|
|
481
|
+
var r = Dt.test(e);
|
|
482
|
+
return r || $t.test(e) ? Mt(e.slice(2), r ? 2 : 8) : It.test(e) ? Se : +e;
|
|
477
483
|
}
|
|
478
|
-
var
|
|
479
|
-
function
|
|
480
|
-
var n, o, i,
|
|
484
|
+
var Wt = "Expected a function", Ft = Math.max, Bt = Math.min;
|
|
485
|
+
function Ut(e, t, r) {
|
|
486
|
+
var n, o, i, c, l, a, d = 0, m = !1, u = !1, p = !0;
|
|
481
487
|
if (typeof e != "function")
|
|
482
|
-
throw new TypeError(
|
|
483
|
-
t =
|
|
488
|
+
throw new TypeError(Wt);
|
|
489
|
+
t = Oe(t) || 0, de(r) && (m = !!r.leading, u = "maxWait" in r, i = u ? Ft(Oe(r.maxWait) || 0, t) : i, p = "trailing" in r ? !!r.trailing : p);
|
|
484
490
|
function b(v) {
|
|
485
|
-
var L = n,
|
|
486
|
-
return n = o = void 0, d = v,
|
|
491
|
+
var L = n, I = o;
|
|
492
|
+
return n = o = void 0, d = v, c = e.apply(I, L), c;
|
|
487
493
|
}
|
|
488
494
|
function h(v) {
|
|
489
|
-
return d = v,
|
|
495
|
+
return d = v, l = setTimeout(R, t), m ? b(v) : c;
|
|
490
496
|
}
|
|
491
497
|
function O(v) {
|
|
492
|
-
var L = v - a,
|
|
493
|
-
return u ?
|
|
498
|
+
var L = v - a, I = v - d, F = t - L;
|
|
499
|
+
return u ? Bt(F, i - I) : F;
|
|
494
500
|
}
|
|
495
501
|
function x(v) {
|
|
496
|
-
var L = v - a,
|
|
497
|
-
return a === void 0 || L >= t || L < 0 || u &&
|
|
502
|
+
var L = v - a, I = v - d;
|
|
503
|
+
return a === void 0 || L >= t || L < 0 || u && I >= i;
|
|
498
504
|
}
|
|
499
|
-
function
|
|
500
|
-
var v =
|
|
505
|
+
function R() {
|
|
506
|
+
var v = ce();
|
|
501
507
|
if (x(v))
|
|
502
508
|
return w(v);
|
|
503
|
-
|
|
509
|
+
l = setTimeout(R, O(v));
|
|
504
510
|
}
|
|
505
511
|
function w(v) {
|
|
506
|
-
return
|
|
512
|
+
return l = void 0, p && n ? b(v) : (n = o = void 0, c);
|
|
507
513
|
}
|
|
508
514
|
function _() {
|
|
509
|
-
|
|
515
|
+
l !== void 0 && clearTimeout(l), d = 0, n = a = o = l = void 0;
|
|
510
516
|
}
|
|
511
|
-
function
|
|
512
|
-
return
|
|
517
|
+
function A() {
|
|
518
|
+
return l === void 0 ? c : w(ce());
|
|
513
519
|
}
|
|
514
520
|
function M() {
|
|
515
|
-
var v =
|
|
521
|
+
var v = ce(), L = x(v);
|
|
516
522
|
if (n = arguments, o = this, a = v, L) {
|
|
517
|
-
if (
|
|
523
|
+
if (l === void 0)
|
|
518
524
|
return h(a);
|
|
519
525
|
if (u)
|
|
520
|
-
return clearTimeout(
|
|
526
|
+
return clearTimeout(l), l = setTimeout(R, t), b(a);
|
|
521
527
|
}
|
|
522
|
-
return
|
|
528
|
+
return l === void 0 && (l = setTimeout(R, t)), c;
|
|
523
529
|
}
|
|
524
|
-
return M.cancel = _, M.flush =
|
|
530
|
+
return M.cancel = _, M.flush = A, M;
|
|
525
531
|
}
|
|
526
|
-
const
|
|
527
|
-
const [e, t] = N(0), [r, n] = N("read"), [o, i] = N("down"),
|
|
532
|
+
const Yt = () => {
|
|
533
|
+
const [e, t] = N(0), [r, n] = N("read"), [o, i] = N("down"), c = H({
|
|
528
534
|
prevMilestone: 0,
|
|
529
535
|
prevScrollY: 0,
|
|
530
536
|
prevTime: Date.now()
|
|
531
|
-
}),
|
|
532
|
-
|
|
533
|
-
const a =
|
|
534
|
-
() =>
|
|
535
|
-
const d = window.scrollY,
|
|
536
|
-
if (
|
|
537
|
-
const b = Math.round(d /
|
|
537
|
+
}), l = H({ setDepth: t, setSpeedCategory: n, setDirection: i });
|
|
538
|
+
l.current = { setDepth: t, setSpeedCategory: n, setDirection: i };
|
|
539
|
+
const a = fe(
|
|
540
|
+
() => Ut(() => {
|
|
541
|
+
const d = window.scrollY, m = document.documentElement.scrollHeight, u = window.innerHeight, p = m - u;
|
|
542
|
+
if (p <= 0) return;
|
|
543
|
+
const b = Math.round(d / p * 100), h = Math.max(0, Math.min(100, b)), O = Math.floor(h / 5) * 5, { prevMilestone: x, prevScrollY: R, prevTime: w } = c.current, _ = O > x ? "down" : "up";
|
|
538
544
|
if (O === x)
|
|
539
545
|
return;
|
|
540
|
-
const
|
|
541
|
-
|
|
546
|
+
const A = Date.now(), M = (A - w) / 1e3, v = Math.abs(d - R), I = (M > 0 ? v / M : 0) > 300 ? "scan" : "read";
|
|
547
|
+
c.current = {
|
|
542
548
|
prevMilestone: O,
|
|
543
549
|
prevScrollY: d,
|
|
544
|
-
prevTime:
|
|
545
|
-
},
|
|
550
|
+
prevTime: A
|
|
551
|
+
}, l.current.setDepth(O), l.current.setSpeedCategory(I), l.current.setDirection(_);
|
|
546
552
|
}, 250),
|
|
547
553
|
[]
|
|
548
554
|
);
|
|
549
555
|
return k(() => (window.addEventListener("scroll", a), () => {
|
|
550
556
|
window.removeEventListener("scroll", a), a.cancel();
|
|
551
557
|
}), [a]), { depth: e, speedCategory: r, direction: o };
|
|
552
|
-
},
|
|
553
|
-
function
|
|
558
|
+
}, te = (e) => Object.prototype.toString.call(e) == "[object String]", Ht = (e, t) => e.indexOf(t) !== -1, Y = (e) => e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""), Ie = (e) => e === void 0, zt = (e) => e === null, De = (e) => Ie(e) || zt(e), $e = (e) => !!e && e?.nodeType === 3;
|
|
559
|
+
function Vt(e) {
|
|
554
560
|
return !!e && e?.nodeType === 1;
|
|
555
561
|
}
|
|
556
|
-
function
|
|
562
|
+
function Gt(e, t) {
|
|
557
563
|
return !!e && !!e?.tagName && e?.tagName.toLowerCase() === t.toLowerCase();
|
|
558
564
|
}
|
|
559
|
-
function
|
|
565
|
+
function Xt(e) {
|
|
560
566
|
return e ? Y(e).split(/\s+/) : [];
|
|
561
567
|
}
|
|
562
|
-
function
|
|
568
|
+
function Jt(e) {
|
|
563
569
|
let t = "";
|
|
564
570
|
switch (typeof e?.className) {
|
|
565
571
|
case "string":
|
|
@@ -572,15 +578,27 @@ function qt(e) {
|
|
|
572
578
|
default:
|
|
573
579
|
t = "";
|
|
574
580
|
}
|
|
575
|
-
return
|
|
581
|
+
return Xt(t);
|
|
576
582
|
}
|
|
577
|
-
const S = (e, t = 255) =>
|
|
583
|
+
const S = (e, t = 255) => De(e) ? "" : Y(e).split(/(\s+)/).filter((r) => me(r)).join("").replace(/[\r\n]/g, " ").replace(/[ ]+/g, " ").substring(0, t), Me = [
|
|
584
|
+
"span",
|
|
585
|
+
"strong",
|
|
586
|
+
"em",
|
|
587
|
+
"i",
|
|
588
|
+
"b",
|
|
589
|
+
"mark",
|
|
590
|
+
"code",
|
|
591
|
+
"small",
|
|
592
|
+
"sub",
|
|
593
|
+
"sup",
|
|
594
|
+
"label"
|
|
595
|
+
], ge = (e) => {
|
|
578
596
|
let t = "";
|
|
579
|
-
if (
|
|
597
|
+
if (Qt(e) && e?.childNodes && e?.childNodes.length) {
|
|
580
598
|
for (const r of e?.childNodes)
|
|
581
|
-
|
|
599
|
+
$e(r) && r.textContent && (t += S(r.textContent) ?? "");
|
|
582
600
|
if (!Y(t)) {
|
|
583
|
-
const r = e.querySelectorAll(
|
|
601
|
+
const r = e.querySelectorAll(Me.join(", "));
|
|
584
602
|
for (const n of r) {
|
|
585
603
|
const o = n.textContent;
|
|
586
604
|
o && (t += `${S(o)} `);
|
|
@@ -592,8 +610,8 @@ const S = (e, t = 255) => $e(e) ? "" : Y(e).split(/(\s+)/).filter((r) => he(r)).
|
|
|
592
610
|
}
|
|
593
611
|
}
|
|
594
612
|
return Y(t);
|
|
595
|
-
},
|
|
596
|
-
if (!window || !e ||
|
|
613
|
+
}, qt = (e) => Ie(e.target) ? e?.srcElement || null : e?.target?.shadowRoot ? e?.composedPath()?.[0] || null : e?.target || null, Kt = (e, t) => {
|
|
614
|
+
if (!window || !e || Gt(e, "html") || !Vt(e))
|
|
597
615
|
return !1;
|
|
598
616
|
const r = window.getComputedStyle(e);
|
|
599
617
|
if (r && r.getPropertyValue("cursor") === "pointer" && t.type === "click")
|
|
@@ -610,7 +628,7 @@ const S = (e, t = 255) => $e(e) ? "" : Y(e).split(/(\s+)/).filter((r) => he(r)).
|
|
|
610
628
|
default:
|
|
611
629
|
return t.type === "click";
|
|
612
630
|
}
|
|
613
|
-
},
|
|
631
|
+
}, Zt = /* @__PURE__ */ new Set([
|
|
614
632
|
"password",
|
|
615
633
|
"passwd",
|
|
616
634
|
"pwd",
|
|
@@ -631,11 +649,11 @@ const S = (e, t = 255) => $e(e) ? "" : Y(e).split(/(\s+)/).filter((r) => he(r)).
|
|
|
631
649
|
"apikey",
|
|
632
650
|
"accesstoken"
|
|
633
651
|
]);
|
|
634
|
-
function
|
|
635
|
-
if (
|
|
652
|
+
function Qt(e) {
|
|
653
|
+
if (Ht(Jt(e), "ph-include"))
|
|
636
654
|
return !0;
|
|
637
655
|
const t = e.type || "";
|
|
638
|
-
if (
|
|
656
|
+
if (te(t))
|
|
639
657
|
switch (t.toLowerCase()) {
|
|
640
658
|
case "hidden":
|
|
641
659
|
return !1;
|
|
@@ -643,33 +661,33 @@ function er(e) {
|
|
|
643
661
|
return !1;
|
|
644
662
|
}
|
|
645
663
|
const r = e.name || e?.id || "";
|
|
646
|
-
if (
|
|
664
|
+
if (te(r)) {
|
|
647
665
|
const n = r.toLowerCase().replace(/[^a-z]/g, "");
|
|
648
|
-
if (
|
|
666
|
+
if (Zt.has(n))
|
|
649
667
|
return !1;
|
|
650
668
|
}
|
|
651
669
|
return !0;
|
|
652
670
|
}
|
|
653
|
-
const
|
|
654
|
-
let t =
|
|
655
|
-
return t = `${t} ${
|
|
671
|
+
const We = "(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})", er = new RegExp(`^(?:${We})$`), tr = new RegExp(We), Fe = "\\d{3}-?\\d{2}-?\\d{4}", rr = new RegExp(`^(${Fe})$`), nr = new RegExp(`(${Fe})`), me = (e, t = !0) => !(De(e) || te(e) && (e = Y(e), (t ? er : tr).test((e || "").replace(/[- ]/g, "")) || (t ? rr : nr).test(e))), or = (e) => te(e) ? e.substring(0, 10) === "_ngcontent" || e.substring(0, 7) === "_nghost" : !1, sr = (e) => {
|
|
672
|
+
let t = ge(e);
|
|
673
|
+
return t = `${t} ${Be(e)}`.trim(), me(t) ? t : "";
|
|
656
674
|
};
|
|
657
|
-
function
|
|
675
|
+
function Be(e) {
|
|
658
676
|
let t = "";
|
|
659
677
|
if (e?.childNodes.length)
|
|
660
678
|
for (const r of e.childNodes) {
|
|
661
679
|
const n = r.tagName?.toLowerCase();
|
|
662
|
-
if (r && n &&
|
|
680
|
+
if (r && n && Me.includes(n))
|
|
663
681
|
try {
|
|
664
|
-
const o =
|
|
665
|
-
t = `${t} ${o}`.trim(), r?.childNodes.length && (t = `${t} ${
|
|
682
|
+
const o = ge(r);
|
|
683
|
+
t = `${t} ${o}`.trim(), r?.childNodes.length && (t = `${t} ${Be(r)}`.trim());
|
|
666
684
|
} catch {
|
|
667
685
|
}
|
|
668
686
|
}
|
|
669
687
|
return t;
|
|
670
688
|
}
|
|
671
|
-
const
|
|
672
|
-
const t = e.tagName?.toLowerCase(), r = t === "a" || t === "button" ?
|
|
689
|
+
const ir = (e) => {
|
|
690
|
+
const t = e.tagName?.toLowerCase(), r = t === "a" || t === "button" ? sr(e) : ge(e);
|
|
673
691
|
if (r) return { text: r, source: "text" };
|
|
674
692
|
const n = e.getAttribute("aria-label");
|
|
675
693
|
if (n) return { text: S(n), source: "aria-label" };
|
|
@@ -677,35 +695,35 @@ const ar = (e) => {
|
|
|
677
695
|
if (o) return { text: S(o), source: "title" };
|
|
678
696
|
const i = e.getAttribute("data-track-label");
|
|
679
697
|
if (i) return { text: S(i), source: "data-track-label" };
|
|
680
|
-
const
|
|
681
|
-
if (
|
|
682
|
-
const a =
|
|
698
|
+
const c = e.querySelector("img[alt], svg[aria-label]");
|
|
699
|
+
if (c) {
|
|
700
|
+
const a = c.getAttribute("alt") || c.getAttribute("aria-label");
|
|
683
701
|
if (a) return { text: S(a), source: "alt" };
|
|
684
702
|
}
|
|
685
|
-
const
|
|
686
|
-
if (
|
|
703
|
+
const l = e.getAttribute("placeholder");
|
|
704
|
+
if (l) return { text: S(l), source: "placeholder" };
|
|
687
705
|
if (e instanceof HTMLElement && e.innerText) {
|
|
688
706
|
const a = e.innerText.substring(0, 500);
|
|
689
707
|
if (a.trim())
|
|
690
708
|
return { text: S(a), source: "innerText" };
|
|
691
709
|
}
|
|
692
710
|
return { text: "", source: "none" };
|
|
693
|
-
},
|
|
711
|
+
}, ar = ["input", "textarea", "select"], Ue = (e) => {
|
|
694
712
|
const t = e?.tagName?.toLowerCase(), r = {
|
|
695
713
|
element: t
|
|
696
|
-
}, n =
|
|
714
|
+
}, n = ir(e);
|
|
697
715
|
r.text = n.text, r.text_source = n.source;
|
|
698
716
|
const o = e.getAttribute("aria-label");
|
|
699
717
|
o && (r.aria_label = S(o));
|
|
700
718
|
const i = e.getAttribute("role");
|
|
701
719
|
i && (r.role = i);
|
|
702
|
-
const
|
|
720
|
+
const c = {};
|
|
703
721
|
for (const a of e.attributes)
|
|
704
|
-
(a.name.startsWith("data-track-") || a.name.startsWith("data-analytics-")) && (
|
|
705
|
-
Object.keys(
|
|
706
|
-
const
|
|
722
|
+
(a.name.startsWith("data-track-") || a.name.startsWith("data-analytics-")) && (c[a.name] = S(a.value));
|
|
723
|
+
Object.keys(c).length && (r.tracking_data = c);
|
|
724
|
+
const l = Array.from(e.attributes).reduce(
|
|
707
725
|
(a, d) => {
|
|
708
|
-
if (
|
|
726
|
+
if (me(d.value) && !or(d.name)) {
|
|
709
727
|
if (d.name === "class" || d.name.startsWith("data-track-") || d.name.startsWith("data-analytics-"))
|
|
710
728
|
return a;
|
|
711
729
|
a[d.name] = typeof d?.value == "string" ? S(d.value) : d.value;
|
|
@@ -714,32 +732,32 @@ const ar = (e) => {
|
|
|
714
732
|
},
|
|
715
733
|
{}
|
|
716
734
|
);
|
|
717
|
-
if (r.attributes =
|
|
735
|
+
if (r.attributes = l, ar.includes(t) || e?.getAttribute("contenteditable") === "true") {
|
|
718
736
|
let a;
|
|
719
737
|
e.matches('input[type="checkbox"], input[type="radio"]') ? a = e.checked : e.matches("input, select, textarea") && !e.matches('input[type="password"]') && (a = e.value), a !== void 0 && (r.value = typeof a == "string" || a === null ? S(a, 1024) : a);
|
|
720
738
|
let d = "";
|
|
721
739
|
r?.attributes.id && (d = S(
|
|
722
740
|
document.querySelector(`label[for="${r?.attributes.id}"]`)?.textContent?.trim() || ""
|
|
723
741
|
));
|
|
724
|
-
const
|
|
725
|
-
d || (d = S(
|
|
742
|
+
const m = e.closest("label");
|
|
743
|
+
d || (d = S(m?.textContent?.trim() || "")), d && (r.label = d);
|
|
726
744
|
}
|
|
727
745
|
return r;
|
|
728
|
-
},
|
|
729
|
-
let r =
|
|
730
|
-
|
|
746
|
+
}, cr = (e, t) => {
|
|
747
|
+
let r = qt(e);
|
|
748
|
+
$e(r) && (r = r.parentNode || null);
|
|
731
749
|
const n = ["copy", "cut"].includes(t);
|
|
732
|
-
if (r && (n ||
|
|
733
|
-
const o =
|
|
750
|
+
if (r && (n || Kt(r, e))) {
|
|
751
|
+
const o = Ue(r);
|
|
734
752
|
if (n) {
|
|
735
|
-
const i = S(window?.getSelection()?.toString()),
|
|
736
|
-
o.copy_text = i ?? "", o.copy_type =
|
|
753
|
+
const i = S(window?.getSelection()?.toString()), c = e?.type || "clipboard";
|
|
754
|
+
o.copy_text = i ?? "", o.copy_type = c;
|
|
737
755
|
}
|
|
738
756
|
return o;
|
|
739
757
|
}
|
|
740
758
|
return null;
|
|
741
|
-
},
|
|
742
|
-
const e =
|
|
759
|
+
}, lr = () => {
|
|
760
|
+
const { insights: e } = P();
|
|
743
761
|
k(() => {
|
|
744
762
|
let t;
|
|
745
763
|
const r = () => {
|
|
@@ -756,9 +774,9 @@ const ar = (e) => {
|
|
|
756
774
|
return document.addEventListener("selectionchange", r), () => {
|
|
757
775
|
clearTimeout(t), document.removeEventListener("selectionchange", r);
|
|
758
776
|
};
|
|
759
|
-
}, []);
|
|
760
|
-
},
|
|
761
|
-
class
|
|
777
|
+
}, [e]);
|
|
778
|
+
}, ur = 30, dr = 1e3, fr = 3;
|
|
779
|
+
class gr {
|
|
762
780
|
clicks;
|
|
763
781
|
constructor() {
|
|
764
782
|
this.clicks = [];
|
|
@@ -769,8 +787,8 @@ class mr {
|
|
|
769
787
|
*/
|
|
770
788
|
isRageClick(t, r, n) {
|
|
771
789
|
const o = this.clicks[this.clicks.length - 1];
|
|
772
|
-
if (o && Math.abs(t - o.x) + Math.abs(r - o.y) <
|
|
773
|
-
if (this.clicks.push({ x: t, y: r, timestamp: n }), this.clicks.length >=
|
|
790
|
+
if (o && Math.abs(t - o.x) + Math.abs(r - o.y) < ur && n - o.timestamp < dr) {
|
|
791
|
+
if (this.clicks.push({ x: t, y: r, timestamp: n }), this.clicks.length >= fr)
|
|
774
792
|
return !0;
|
|
775
793
|
} else
|
|
776
794
|
this.clicks = [{ x: t, y: r, timestamp: n }];
|
|
@@ -783,7 +801,7 @@ class mr {
|
|
|
783
801
|
this.clicks = [];
|
|
784
802
|
}
|
|
785
803
|
}
|
|
786
|
-
const
|
|
804
|
+
const mr = new gr(), pr = (e) => {
|
|
787
805
|
let t = e, r = 0;
|
|
788
806
|
for (; t && r < 10; ) {
|
|
789
807
|
const n = t.getAttribute?.("href");
|
|
@@ -792,8 +810,8 @@ const pr = new mr(), br = (e) => {
|
|
|
792
810
|
t = t.parentElement, r++;
|
|
793
811
|
}
|
|
794
812
|
return null;
|
|
795
|
-
},
|
|
796
|
-
const t = e.closest("a[href]"), r = t?.getAttribute("href") ||
|
|
813
|
+
}, le = (e) => {
|
|
814
|
+
const t = e.closest("a[href]"), r = t?.getAttribute("href") || pr(e);
|
|
797
815
|
if (!r) return { type: null, href: null };
|
|
798
816
|
if (t?.hasAttribute("download"))
|
|
799
817
|
return { type: "download", href: r };
|
|
@@ -808,11 +826,11 @@ const pr = new mr(), br = (e) => {
|
|
|
808
826
|
} catch {
|
|
809
827
|
return { type: "internal", href: r };
|
|
810
828
|
}
|
|
811
|
-
},
|
|
812
|
-
const e =
|
|
829
|
+
}, br = () => {
|
|
830
|
+
const { client: e, insights: t } = P(), { logger: r } = e, n = H(0);
|
|
813
831
|
k(() => {
|
|
814
832
|
let o = null;
|
|
815
|
-
const i = (u,
|
|
833
|
+
const i = (u, p = !1) => {
|
|
816
834
|
const b = u.target, h = "clientX" in u ? u.clientX : u.changedTouches?.[0]?.clientX ?? 0, O = "clientY" in u ? u.clientY : u.changedTouches?.[0]?.clientY ?? 0;
|
|
817
835
|
let x = {
|
|
818
836
|
hostname: window.location.hostname,
|
|
@@ -820,35 +838,35 @@ const pr = new mr(), br = (e) => {
|
|
|
820
838
|
page_title: document.title,
|
|
821
839
|
url: window.location.href,
|
|
822
840
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
823
|
-
event_type:
|
|
841
|
+
event_type: p ? "dblclick" : "click",
|
|
824
842
|
button_type: "button" in u ? u.button : 0
|
|
825
843
|
};
|
|
826
|
-
return b instanceof HTMLElement && (x.rage_click =
|
|
844
|
+
return b instanceof HTMLElement && (x.rage_click = mr?.isRageClick(h, O, Date.now()), x = {
|
|
827
845
|
...x,
|
|
828
|
-
...
|
|
846
|
+
...Ue(b)
|
|
829
847
|
}), x;
|
|
830
|
-
},
|
|
848
|
+
}, c = (u, p) => {
|
|
831
849
|
try {
|
|
832
850
|
if (Date.now() - n.current < 300) return;
|
|
833
851
|
const b = i(u);
|
|
834
|
-
if (!
|
|
835
|
-
r?.warn("Cannot track navigation click: missing
|
|
852
|
+
if (!t) {
|
|
853
|
+
r?.warn("Cannot track navigation click: missing insights");
|
|
836
854
|
return;
|
|
837
855
|
}
|
|
838
|
-
|
|
856
|
+
t?.track("page.click", {
|
|
839
857
|
...b,
|
|
840
|
-
href:
|
|
841
|
-
link_type:
|
|
858
|
+
href: p.href || void 0,
|
|
859
|
+
link_type: p.type,
|
|
842
860
|
is_navigation: !0
|
|
843
861
|
});
|
|
844
862
|
} catch (b) {
|
|
845
863
|
r?.error("Failed to track navigation click", U(b));
|
|
846
864
|
}
|
|
847
|
-
},
|
|
865
|
+
}, l = (u, p = !1) => {
|
|
848
866
|
try {
|
|
849
867
|
if (!(u.target instanceof HTMLElement) || Date.now() - n.current < 300) return;
|
|
850
|
-
const b = i(u,
|
|
851
|
-
|
|
868
|
+
const b = i(u, p), h = le(u.target);
|
|
869
|
+
t?.track("page.click", {
|
|
852
870
|
...b,
|
|
853
871
|
href: h.href || void 0,
|
|
854
872
|
link_type: h.type || void 0
|
|
@@ -858,9 +876,9 @@ const pr = new mr(), br = (e) => {
|
|
|
858
876
|
}
|
|
859
877
|
}, a = (u) => {
|
|
860
878
|
if (!(u.target instanceof HTMLElement)) return;
|
|
861
|
-
const
|
|
862
|
-
if (
|
|
863
|
-
|
|
879
|
+
const p = le(u.target);
|
|
880
|
+
if (p.type === "external" || p.type === "download") {
|
|
881
|
+
c(u, p);
|
|
864
882
|
return;
|
|
865
883
|
}
|
|
866
884
|
if (o) {
|
|
@@ -868,92 +886,92 @@ const pr = new mr(), br = (e) => {
|
|
|
868
886
|
return;
|
|
869
887
|
}
|
|
870
888
|
o = setTimeout(() => {
|
|
871
|
-
|
|
889
|
+
l(u, !1), o = null;
|
|
872
890
|
}, 250);
|
|
873
891
|
}, d = (u) => {
|
|
874
|
-
o && (clearTimeout(o), o = null),
|
|
875
|
-
},
|
|
892
|
+
o && (clearTimeout(o), o = null), l(u, !0);
|
|
893
|
+
}, m = (u) => {
|
|
876
894
|
try {
|
|
877
895
|
if (!(u.target instanceof HTMLElement)) return;
|
|
878
896
|
n.current = Date.now();
|
|
879
|
-
const
|
|
880
|
-
if (
|
|
897
|
+
const p = le(u.target);
|
|
898
|
+
if (p.type === "external" || p.type === "download") {
|
|
881
899
|
const h = i(u);
|
|
882
|
-
|
|
900
|
+
t?.track("page.click", {
|
|
883
901
|
...h,
|
|
884
|
-
href:
|
|
885
|
-
link_type:
|
|
902
|
+
href: p.href || void 0,
|
|
903
|
+
link_type: p.type,
|
|
886
904
|
is_navigation: !0,
|
|
887
905
|
is_touch: !0
|
|
888
906
|
});
|
|
889
907
|
return;
|
|
890
908
|
}
|
|
891
909
|
const b = i(u);
|
|
892
|
-
|
|
910
|
+
t?.track("page.click", {
|
|
893
911
|
...b,
|
|
894
|
-
href:
|
|
895
|
-
link_type:
|
|
912
|
+
href: p.href || void 0,
|
|
913
|
+
link_type: p.type || void 0,
|
|
896
914
|
is_touch: !0
|
|
897
915
|
});
|
|
898
|
-
} catch (
|
|
899
|
-
r?.error("Failed to track touch", U(
|
|
916
|
+
} catch (p) {
|
|
917
|
+
r?.error("Failed to track touch", U(p));
|
|
900
918
|
}
|
|
901
919
|
};
|
|
902
|
-
return document.addEventListener("click", a), document.addEventListener("dblclick", d), document.addEventListener("touchend",
|
|
903
|
-
document.removeEventListener("click", a), document.removeEventListener("dblclick", d), document.removeEventListener("touchend",
|
|
920
|
+
return document.addEventListener("click", a), document.addEventListener("dblclick", d), document.addEventListener("touchend", m, { passive: !0 }), () => {
|
|
921
|
+
document.removeEventListener("click", a), document.removeEventListener("dblclick", d), document.removeEventListener("touchend", m), o && clearTimeout(o);
|
|
904
922
|
};
|
|
905
|
-
}, [
|
|
906
|
-
},
|
|
907
|
-
const r = typeof window < "u" ? window.location.href : "",
|
|
923
|
+
}, [t, r]);
|
|
924
|
+
}, bn = ({ id: e, properties: t = {} }) => {
|
|
925
|
+
const r = typeof window < "u" ? window.location.href : "", { client: n, insights: o } = P();
|
|
908
926
|
k(() => {
|
|
909
927
|
n && typeof window < "u" && (window.levo_client = n);
|
|
910
928
|
}, [n]), k(() => {
|
|
911
|
-
o && typeof window < "u" && (window.
|
|
912
|
-
}, []),
|
|
913
|
-
const i =
|
|
929
|
+
o && typeof window < "u" && (window.levo_audience = o);
|
|
930
|
+
}, [o]), bt(), mt(), br();
|
|
931
|
+
const i = Yt();
|
|
914
932
|
return k(() => {
|
|
915
|
-
o?.instance && o
|
|
933
|
+
o?.instance && o.track("page.scroll", {
|
|
916
934
|
resource: "page",
|
|
917
935
|
identifier: e,
|
|
918
936
|
percent: i.depth,
|
|
919
937
|
speed_category: i.speedCategory
|
|
920
938
|
});
|
|
921
|
-
}, [o, i.depth, i.speedCategory, e]),
|
|
939
|
+
}, [o, i.depth, i.speedCategory, e]), lr(), pt({
|
|
922
940
|
href: r,
|
|
923
941
|
id: e,
|
|
924
942
|
properties: t
|
|
925
|
-
}),
|
|
926
|
-
const
|
|
943
|
+
}), gt({ id: e }), k(() => {
|
|
944
|
+
const c = {
|
|
927
945
|
change: "form.change",
|
|
928
946
|
submit: "form.submit",
|
|
929
947
|
copy: "page.copy",
|
|
930
948
|
cut: "page.copy"
|
|
931
|
-
},
|
|
932
|
-
const u =
|
|
933
|
-
u &&
|
|
949
|
+
}, l = (d) => (m) => {
|
|
950
|
+
const u = cr(m, d);
|
|
951
|
+
u && c[d] && o?.track(c[d], u);
|
|
934
952
|
}, a = {
|
|
935
|
-
change:
|
|
936
|
-
copy:
|
|
937
|
-
cut:
|
|
938
|
-
submit:
|
|
953
|
+
change: l("change"),
|
|
954
|
+
copy: l("copy"),
|
|
955
|
+
cut: l("cut"),
|
|
956
|
+
submit: l("submit")
|
|
939
957
|
};
|
|
940
958
|
return document.addEventListener("change", a.change), document.addEventListener("copy", a.copy), document.addEventListener("cut", a.cut), document.addEventListener("submit", a.submit), () => {
|
|
941
959
|
document.removeEventListener("change", a.change), document.removeEventListener("copy", a.copy), document.removeEventListener("cut", a.cut), document.removeEventListener("submit", a.submit);
|
|
942
960
|
};
|
|
943
|
-
}, []), (!o
|
|
961
|
+
}, []), (!o || !n.workspace || !n.workspace.startsWith("W")) && console.error(
|
|
944
962
|
"[@levo-so/react] The utility could not be initialized, due to missing workspace, or endpoint for insights."
|
|
945
963
|
), null;
|
|
946
964
|
};
|
|
947
|
-
var
|
|
965
|
+
var Ye = {
|
|
948
966
|
color: void 0,
|
|
949
967
|
size: void 0,
|
|
950
968
|
className: void 0,
|
|
951
969
|
style: void 0,
|
|
952
970
|
attr: void 0
|
|
953
|
-
},
|
|
954
|
-
function
|
|
971
|
+
}, Ne = D.createContext && /* @__PURE__ */ D.createContext(Ye), hr = ["attr", "size", "title"];
|
|
972
|
+
function vr(e, t) {
|
|
955
973
|
if (e == null) return {};
|
|
956
|
-
var r =
|
|
974
|
+
var r = yr(e, t), n, o;
|
|
957
975
|
if (Object.getOwnPropertySymbols) {
|
|
958
976
|
var i = Object.getOwnPropertySymbols(e);
|
|
959
977
|
for (o = 0; o < i.length; o++)
|
|
@@ -961,7 +979,7 @@ function yr(e, t) {
|
|
|
961
979
|
}
|
|
962
980
|
return r;
|
|
963
981
|
}
|
|
964
|
-
function
|
|
982
|
+
function yr(e, t) {
|
|
965
983
|
if (e == null) return {};
|
|
966
984
|
var r = {};
|
|
967
985
|
for (var n in e)
|
|
@@ -971,17 +989,17 @@ function wr(e, t) {
|
|
|
971
989
|
}
|
|
972
990
|
return r;
|
|
973
991
|
}
|
|
974
|
-
function
|
|
975
|
-
return
|
|
992
|
+
function re() {
|
|
993
|
+
return re = Object.assign ? Object.assign.bind() : function(e) {
|
|
976
994
|
for (var t = 1; t < arguments.length; t++) {
|
|
977
995
|
var r = arguments[t];
|
|
978
996
|
for (var n in r)
|
|
979
997
|
Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
980
998
|
}
|
|
981
999
|
return e;
|
|
982
|
-
},
|
|
1000
|
+
}, re.apply(this, arguments);
|
|
983
1001
|
}
|
|
984
|
-
function
|
|
1002
|
+
function je(e, t) {
|
|
985
1003
|
var r = Object.keys(e);
|
|
986
1004
|
if (Object.getOwnPropertySymbols) {
|
|
987
1005
|
var n = Object.getOwnPropertySymbols(e);
|
|
@@ -991,25 +1009,25 @@ function Le(e, t) {
|
|
|
991
1009
|
}
|
|
992
1010
|
return r;
|
|
993
1011
|
}
|
|
994
|
-
function
|
|
1012
|
+
function ne(e) {
|
|
995
1013
|
for (var t = 1; t < arguments.length; t++) {
|
|
996
1014
|
var r = arguments[t] != null ? arguments[t] : {};
|
|
997
|
-
t % 2 ?
|
|
998
|
-
|
|
999
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) :
|
|
1015
|
+
t % 2 ? je(Object(r), !0).forEach(function(n) {
|
|
1016
|
+
wr(e, n, r[n]);
|
|
1017
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : je(Object(r)).forEach(function(n) {
|
|
1000
1018
|
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
1001
1019
|
});
|
|
1002
1020
|
}
|
|
1003
1021
|
return e;
|
|
1004
1022
|
}
|
|
1005
|
-
function
|
|
1006
|
-
return t =
|
|
1023
|
+
function wr(e, t, r) {
|
|
1024
|
+
return t = xr(t), t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
|
|
1007
1025
|
}
|
|
1008
|
-
function
|
|
1009
|
-
var t =
|
|
1026
|
+
function xr(e) {
|
|
1027
|
+
var t = Tr(e, "string");
|
|
1010
1028
|
return typeof t == "symbol" ? t : t + "";
|
|
1011
1029
|
}
|
|
1012
|
-
function
|
|
1030
|
+
function Tr(e, t) {
|
|
1013
1031
|
if (typeof e != "object" || !e) return e;
|
|
1014
1032
|
var r = e[Symbol.toPrimitive];
|
|
1015
1033
|
if (r !== void 0) {
|
|
@@ -1019,43 +1037,43 @@ function Er(e, t) {
|
|
|
1019
1037
|
}
|
|
1020
1038
|
return (t === "string" ? String : Number)(e);
|
|
1021
1039
|
}
|
|
1022
|
-
function
|
|
1023
|
-
return e && e.map((t, r) => /* @__PURE__ */
|
|
1040
|
+
function He(e) {
|
|
1041
|
+
return e && e.map((t, r) => /* @__PURE__ */ D.createElement(t.tag, ne({
|
|
1024
1042
|
key: r
|
|
1025
|
-
}, t.attr),
|
|
1043
|
+
}, t.attr), He(t.child)));
|
|
1026
1044
|
}
|
|
1027
|
-
function
|
|
1028
|
-
return (t) => /* @__PURE__ */
|
|
1029
|
-
attr:
|
|
1030
|
-
}, t),
|
|
1045
|
+
function Er(e) {
|
|
1046
|
+
return (t) => /* @__PURE__ */ D.createElement(kr, re({
|
|
1047
|
+
attr: ne({}, e.attr)
|
|
1048
|
+
}, t), He(e.child));
|
|
1031
1049
|
}
|
|
1032
|
-
function
|
|
1050
|
+
function kr(e) {
|
|
1033
1051
|
var t = (r) => {
|
|
1034
1052
|
var {
|
|
1035
1053
|
attr: n,
|
|
1036
1054
|
size: o,
|
|
1037
1055
|
title: i
|
|
1038
|
-
} = e,
|
|
1039
|
-
return r.className && (a = r.className), e.className && (a = (a ? a + " " : "") + e.className), /* @__PURE__ */
|
|
1056
|
+
} = e, c = vr(e, hr), l = o || r.size || "1em", a;
|
|
1057
|
+
return r.className && (a = r.className), e.className && (a = (a ? a + " " : "") + e.className), /* @__PURE__ */ D.createElement("svg", re({
|
|
1040
1058
|
stroke: "currentColor",
|
|
1041
1059
|
fill: "currentColor",
|
|
1042
1060
|
strokeWidth: "0"
|
|
1043
|
-
}, r.attr, n,
|
|
1061
|
+
}, r.attr, n, c, {
|
|
1044
1062
|
className: a,
|
|
1045
|
-
style:
|
|
1063
|
+
style: ne(ne({
|
|
1046
1064
|
color: e.color || r.color
|
|
1047
1065
|
}, r.style), e.style),
|
|
1048
|
-
height:
|
|
1049
|
-
width:
|
|
1066
|
+
height: l,
|
|
1067
|
+
width: l,
|
|
1050
1068
|
xmlns: "http://www.w3.org/2000/svg"
|
|
1051
|
-
}), i && /* @__PURE__ */
|
|
1069
|
+
}), i && /* @__PURE__ */ D.createElement("title", null, i), e.children);
|
|
1052
1070
|
};
|
|
1053
|
-
return
|
|
1071
|
+
return Ne !== void 0 ? /* @__PURE__ */ D.createElement(Ne.Consumer, null, (r) => t(r)) : t(Ye);
|
|
1054
1072
|
}
|
|
1055
|
-
function
|
|
1056
|
-
return
|
|
1073
|
+
function ze(e) {
|
|
1074
|
+
return Er({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M12 22c5.421 0 10-4.579 10-10h-2c0 4.337-3.663 8-8 8s-8-3.663-8-8c0-4.336 3.663-8 8-8V2C6.579 2 2 6.58 2 12c0 5.421 4.579 10 10 10z" }, child: [] }] })(e);
|
|
1057
1075
|
}
|
|
1058
|
-
const
|
|
1076
|
+
const C = (...e) => Ce(ot(e)), _r = at(
|
|
1059
1077
|
"inline-flex items-center justify-center font-medium text-sm ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
1060
1078
|
{
|
|
1061
1079
|
variants: {
|
|
@@ -1090,7 +1108,7 @@ const R = (...e) => Pe(st(e)), Sr = ct(
|
|
|
1090
1108
|
rounded: "default"
|
|
1091
1109
|
}
|
|
1092
1110
|
}
|
|
1093
|
-
),
|
|
1111
|
+
), Sr = $.forwardRef(
|
|
1094
1112
|
({
|
|
1095
1113
|
className: e,
|
|
1096
1114
|
variant: t,
|
|
@@ -1098,45 +1116,45 @@ const R = (...e) => Pe(st(e)), Sr = ct(
|
|
|
1098
1116
|
rounded: n,
|
|
1099
1117
|
asChild: o = !1,
|
|
1100
1118
|
isLoading: i = !1,
|
|
1101
|
-
loadingText:
|
|
1102
|
-
disabled:
|
|
1119
|
+
loadingText: c,
|
|
1120
|
+
disabled: l,
|
|
1103
1121
|
...a
|
|
1104
1122
|
}, d) => {
|
|
1105
|
-
const
|
|
1123
|
+
const m = o ? it.Root : "button";
|
|
1106
1124
|
return /* @__PURE__ */ g.jsx(
|
|
1107
|
-
|
|
1125
|
+
m,
|
|
1108
1126
|
{
|
|
1109
|
-
className:
|
|
1127
|
+
className: C(_r({ variant: t, size: r, rounded: n, className: e })),
|
|
1110
1128
|
ref: d,
|
|
1111
|
-
disabled:
|
|
1129
|
+
disabled: l || i,
|
|
1112
1130
|
type: "button",
|
|
1113
1131
|
...a,
|
|
1114
1132
|
children: i ? /* @__PURE__ */ g.jsxs(g.Fragment, { children: [
|
|
1115
|
-
/* @__PURE__ */ g.jsx(
|
|
1116
|
-
|
|
1133
|
+
/* @__PURE__ */ g.jsx(ze, { className: Ce("h-4 w-4 animate-spin", c ? "mr-2" : "") }),
|
|
1134
|
+
c
|
|
1117
1135
|
] }) : a.children
|
|
1118
1136
|
}
|
|
1119
1137
|
);
|
|
1120
1138
|
}
|
|
1121
1139
|
);
|
|
1122
|
-
|
|
1123
|
-
const
|
|
1140
|
+
Sr.displayName = "Button";
|
|
1141
|
+
const Or = j.Root, hn = j.Trigger, Nr = j.Portal, vn = j.Close, Ve = $.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ g.jsx(
|
|
1124
1142
|
j.Overlay,
|
|
1125
1143
|
{
|
|
1126
1144
|
ref: r,
|
|
1127
|
-
className:
|
|
1145
|
+
className: C(
|
|
1128
1146
|
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 grid max-h-screen place-items-center overflow-y-auto bg-background/80 py-10 backdrop-blur-sm data-[state=closed]:animate-out data-[state=open]:animate-in",
|
|
1129
1147
|
e
|
|
1130
1148
|
),
|
|
1131
1149
|
...t
|
|
1132
1150
|
}
|
|
1133
1151
|
));
|
|
1134
|
-
|
|
1135
|
-
const
|
|
1152
|
+
Ve.displayName = j.Overlay.displayName;
|
|
1153
|
+
const Ge = $.forwardRef(({ className: e, children: t, container: r, hideCloseButton: n, overlayStyles: o, ...i }, c) => /* @__PURE__ */ g.jsx(Nr, { container: r, children: /* @__PURE__ */ g.jsx(Ve, { className: o, children: /* @__PURE__ */ g.jsxs(
|
|
1136
1154
|
j.Content,
|
|
1137
1155
|
{
|
|
1138
|
-
ref:
|
|
1139
|
-
className:
|
|
1156
|
+
ref: c,
|
|
1157
|
+
className: C(
|
|
1140
1158
|
"data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 relative z-50 grid w-full max-w-lg gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=open]:animate-in sm:rounded-lg",
|
|
1141
1159
|
e
|
|
1142
1160
|
),
|
|
@@ -1149,7 +1167,7 @@ const Xe = D.forwardRef(({ className: e, children: t, container: r, hideCloseBut
|
|
|
1149
1167
|
type: "button",
|
|
1150
1168
|
className: "absolute top-4 right-4 rounded-sm p-1 opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",
|
|
1151
1169
|
children: [
|
|
1152
|
-
/* @__PURE__ */ g.jsx(
|
|
1170
|
+
/* @__PURE__ */ g.jsx(ct, { className: "h-4 w-4" }),
|
|
1153
1171
|
/* @__PURE__ */ g.jsx("span", { className: "sr-only", children: "Close" })
|
|
1154
1172
|
]
|
|
1155
1173
|
}
|
|
@@ -1157,51 +1175,51 @@ const Xe = D.forwardRef(({ className: e, children: t, container: r, hideCloseBut
|
|
|
1157
1175
|
]
|
|
1158
1176
|
}
|
|
1159
1177
|
) }) }));
|
|
1160
|
-
|
|
1161
|
-
const
|
|
1162
|
-
|
|
1163
|
-
const
|
|
1178
|
+
Ge.displayName = j.Content.displayName;
|
|
1179
|
+
const Xe = ({ className: e, ...t }) => /* @__PURE__ */ g.jsx("div", { className: C("flex flex-col space-y-1.5 text-center sm:text-left", e), ...t });
|
|
1180
|
+
Xe.displayName = "DialogHeader";
|
|
1181
|
+
const jr = ({ className: e, ...t }) => /* @__PURE__ */ g.jsx(
|
|
1164
1182
|
"div",
|
|
1165
1183
|
{
|
|
1166
|
-
className:
|
|
1184
|
+
className: C("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e),
|
|
1167
1185
|
...t
|
|
1168
1186
|
}
|
|
1169
1187
|
);
|
|
1170
|
-
|
|
1171
|
-
const
|
|
1188
|
+
jr.displayName = "DialogFooter";
|
|
1189
|
+
const Je = $.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ g.jsx(
|
|
1172
1190
|
j.Title,
|
|
1173
1191
|
{
|
|
1174
1192
|
ref: r,
|
|
1175
|
-
className:
|
|
1193
|
+
className: C("font-semibold text-lg leading-none tracking-tight", e),
|
|
1176
1194
|
...t
|
|
1177
1195
|
}
|
|
1178
1196
|
));
|
|
1179
|
-
|
|
1180
|
-
const
|
|
1197
|
+
Je.displayName = j.Title.displayName;
|
|
1198
|
+
const qe = $.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ g.jsx(
|
|
1181
1199
|
j.Description,
|
|
1182
1200
|
{
|
|
1183
1201
|
ref: r,
|
|
1184
|
-
className:
|
|
1202
|
+
className: C("text-muted-foreground text-sm", e),
|
|
1185
1203
|
...t
|
|
1186
1204
|
}
|
|
1187
1205
|
));
|
|
1188
|
-
|
|
1189
|
-
const
|
|
1206
|
+
qe.displayName = j.Description.displayName;
|
|
1207
|
+
const yn = ({
|
|
1190
1208
|
isOpen: e,
|
|
1191
1209
|
onClose: t,
|
|
1192
1210
|
children: r,
|
|
1193
1211
|
title: n,
|
|
1194
1212
|
description: o = "",
|
|
1195
1213
|
contentClassName: i,
|
|
1196
|
-
modal:
|
|
1197
|
-
}) => /* @__PURE__ */ g.jsx(
|
|
1198
|
-
n && /* @__PURE__ */ g.jsxs(
|
|
1199
|
-
/* @__PURE__ */ g.jsx(
|
|
1200
|
-
/* @__PURE__ */ g.jsx(
|
|
1214
|
+
modal: c = !0
|
|
1215
|
+
}) => /* @__PURE__ */ g.jsx(Or, { open: e, onOpenChange: t, modal: c, children: /* @__PURE__ */ g.jsxs(Ge, { className: i, children: [
|
|
1216
|
+
n && /* @__PURE__ */ g.jsxs(Xe, { className: "flex-1 font-medium", children: [
|
|
1217
|
+
/* @__PURE__ */ g.jsx(Je, { children: n }),
|
|
1218
|
+
/* @__PURE__ */ g.jsx(qe, { children: o })
|
|
1201
1219
|
] }),
|
|
1202
1220
|
/* @__PURE__ */ g.jsx("div", { className: "w-full", children: r })
|
|
1203
|
-
] }) }),
|
|
1204
|
-
|
|
1221
|
+
] }) }), wn = ({ ...e }) => /* @__PURE__ */ g.jsx(
|
|
1222
|
+
lt,
|
|
1205
1223
|
{
|
|
1206
1224
|
closeButton: !0,
|
|
1207
1225
|
richColors: !0,
|
|
@@ -1217,36 +1235,36 @@ const wn = ({
|
|
|
1217
1235
|
...e
|
|
1218
1236
|
}
|
|
1219
1237
|
), Rr = (e, t = "Error", r = {}) => {
|
|
1220
|
-
|
|
1238
|
+
ue.error(t, {
|
|
1221
1239
|
description: e,
|
|
1222
1240
|
duration: 4e3,
|
|
1223
1241
|
position: "bottom-right",
|
|
1224
1242
|
...r
|
|
1225
1243
|
});
|
|
1226
|
-
},
|
|
1227
|
-
r?.id &&
|
|
1244
|
+
}, xn = (e, t = "Success", r = {}) => {
|
|
1245
|
+
r?.id && ue.dismiss(r?.id), ue.success(t, {
|
|
1228
1246
|
description: e,
|
|
1229
1247
|
duration: 4e3,
|
|
1230
1248
|
position: "bottom-right",
|
|
1231
1249
|
...r
|
|
1232
1250
|
});
|
|
1233
|
-
},
|
|
1251
|
+
}, Cr = ({ className: e }) => /* @__PURE__ */ g.jsx(ze, { className: C("h-8 w-8 animate-spin font-light", e) }), Tn = W.Root, Lr = $.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ g.jsx(
|
|
1234
1252
|
W.List,
|
|
1235
1253
|
{
|
|
1236
1254
|
ref: r,
|
|
1237
|
-
className:
|
|
1255
|
+
className: C(
|
|
1238
1256
|
"inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
|
|
1239
1257
|
e
|
|
1240
1258
|
),
|
|
1241
1259
|
...t
|
|
1242
1260
|
}
|
|
1243
1261
|
));
|
|
1244
|
-
|
|
1245
|
-
const
|
|
1262
|
+
Lr.displayName = W.List.displayName;
|
|
1263
|
+
const Pr = $.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ g.jsx(
|
|
1246
1264
|
W.Trigger,
|
|
1247
1265
|
{
|
|
1248
1266
|
ref: r,
|
|
1249
|
-
className:
|
|
1267
|
+
className: C(
|
|
1250
1268
|
"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 font-medium text-sm ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
|
|
1251
1269
|
e
|
|
1252
1270
|
),
|
|
@@ -1254,36 +1272,36 @@ const Ar = D.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ g.jsx(
|
|
|
1254
1272
|
...t
|
|
1255
1273
|
}
|
|
1256
1274
|
));
|
|
1257
|
-
|
|
1258
|
-
const
|
|
1275
|
+
Pr.displayName = W.Trigger.displayName;
|
|
1276
|
+
const Ar = $.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ g.jsx(
|
|
1259
1277
|
W.Content,
|
|
1260
1278
|
{
|
|
1261
1279
|
ref: r,
|
|
1262
|
-
className:
|
|
1280
|
+
className: C(
|
|
1263
1281
|
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
1264
1282
|
e
|
|
1265
1283
|
),
|
|
1266
1284
|
...t
|
|
1267
1285
|
}
|
|
1268
1286
|
));
|
|
1269
|
-
|
|
1270
|
-
const
|
|
1287
|
+
Ar.displayName = W.Content.displayName;
|
|
1288
|
+
const En = z.Provider, Ir = z.Root, Dr = z.Trigger, $r = z.Portal, Ke = $.forwardRef(({ className: e, sideOffset: t = 4, ...r }, n) => /* @__PURE__ */ g.jsx(
|
|
1271
1289
|
z.Content,
|
|
1272
1290
|
{
|
|
1273
1291
|
ref: n,
|
|
1274
1292
|
sideOffset: t,
|
|
1275
|
-
className:
|
|
1293
|
+
className: C(
|
|
1276
1294
|
"fade-in-0 zoom-in-95 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 animate-in overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-popover-foreground text-xs shadow-md data-[state=closed]:animate-out",
|
|
1277
1295
|
e
|
|
1278
1296
|
),
|
|
1279
1297
|
...r
|
|
1280
1298
|
}
|
|
1281
1299
|
));
|
|
1282
|
-
|
|
1283
|
-
const
|
|
1284
|
-
t && /* @__PURE__ */ g.jsx(
|
|
1285
|
-
/* @__PURE__ */ g.jsx(
|
|
1286
|
-
] }),
|
|
1300
|
+
Ke.displayName = z.Content.displayName;
|
|
1301
|
+
const kn = ({ children: e, label: t, labelClassName: r, asChild: n = !0, contentProps: o = {}, side: i }) => /* @__PURE__ */ g.jsxs(Ir, { children: [
|
|
1302
|
+
t && /* @__PURE__ */ g.jsx($r, { children: /* @__PURE__ */ g.jsx(Ke, { side: i, className: r, ...o, children: t }) }),
|
|
1303
|
+
/* @__PURE__ */ g.jsx(Dr, { asChild: n, children: e })
|
|
1304
|
+
] }), Mr = [
|
|
1287
1305
|
"pdf",
|
|
1288
1306
|
"txt",
|
|
1289
1307
|
"xml",
|
|
@@ -1297,7 +1315,7 @@ const _n = ({ children: e, label: t, labelClassName: r, asChild: n = !0, content
|
|
|
1297
1315
|
"odp",
|
|
1298
1316
|
"ppt",
|
|
1299
1317
|
"pptx"
|
|
1300
|
-
],
|
|
1318
|
+
], Wr = ["svg", "png", "jpg", "jpeg", "gif", "webp", "avif"], Fr = ["mp4", "ogv", "webm"], Br = ["mp3", "ogg", "opus"], Ur = {
|
|
1301
1319
|
"application/xml": [".xml"],
|
|
1302
1320
|
"text/plain": [".txt"],
|
|
1303
1321
|
"application/pdf": [".pdf"],
|
|
@@ -1306,7 +1324,7 @@ const _n = ({ children: e, label: t, labelClassName: r, asChild: n = !0, content
|
|
|
1306
1324
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": [".xlsx"],
|
|
1307
1325
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": [".docx"],
|
|
1308
1326
|
"text/csv": [".csv"]
|
|
1309
|
-
},
|
|
1327
|
+
}, Yr = {
|
|
1310
1328
|
"image/jpeg": [".jpeg", ".jpg"],
|
|
1311
1329
|
"image/jpg": [".jpg"],
|
|
1312
1330
|
"image/png": [".png"],
|
|
@@ -1315,35 +1333,35 @@ const _n = ({ children: e, label: t, labelClassName: r, asChild: n = !0, content
|
|
|
1315
1333
|
"image/svg+xml": [".svg"],
|
|
1316
1334
|
"image/webp": [".webp"],
|
|
1317
1335
|
"image/avif": [".avif"]
|
|
1318
|
-
},
|
|
1336
|
+
}, Hr = {
|
|
1319
1337
|
"video/mp4": [".mp4"],
|
|
1320
1338
|
"video/mpeg": [".mpeg"],
|
|
1321
1339
|
"video/webm": [".webm"]
|
|
1322
|
-
},
|
|
1340
|
+
}, zr = {
|
|
1323
1341
|
"audio/mpeg": [".mp3"],
|
|
1324
1342
|
"audio/ogg": [".oga"],
|
|
1325
1343
|
"audio/opus": [".opus"]
|
|
1344
|
+
}, K = {
|
|
1345
|
+
audio: zr,
|
|
1346
|
+
document: Ur,
|
|
1347
|
+
image: Yr,
|
|
1348
|
+
video: Hr
|
|
1326
1349
|
}, Z = {
|
|
1327
|
-
audio:
|
|
1328
|
-
document:
|
|
1329
|
-
image:
|
|
1330
|
-
video:
|
|
1331
|
-
},
|
|
1332
|
-
audio: Ur,
|
|
1333
|
-
document: Wr,
|
|
1334
|
-
image: Fr,
|
|
1335
|
-
video: Br
|
|
1336
|
-
}, Sn = [
|
|
1337
|
-
...Q.audio,
|
|
1338
|
-
...Q.document,
|
|
1339
|
-
...Q.image,
|
|
1340
|
-
...Q.video
|
|
1341
|
-
], On = {
|
|
1350
|
+
audio: Br,
|
|
1351
|
+
document: Mr,
|
|
1352
|
+
image: Wr,
|
|
1353
|
+
video: Fr
|
|
1354
|
+
}, _n = [
|
|
1342
1355
|
...Z.audio,
|
|
1343
1356
|
...Z.document,
|
|
1344
1357
|
...Z.image,
|
|
1345
1358
|
...Z.video
|
|
1346
|
-
|
|
1359
|
+
], Sn = {
|
|
1360
|
+
...K.audio,
|
|
1361
|
+
...K.document,
|
|
1362
|
+
...K.image,
|
|
1363
|
+
...K.video
|
|
1364
|
+
}, Ze = D.createContext({
|
|
1347
1365
|
urls: null,
|
|
1348
1366
|
title: "",
|
|
1349
1367
|
isLoading: !1,
|
|
@@ -1351,11 +1369,11 @@ const _n = ({ children: e, label: t, labelClassName: r, asChild: n = !0, content
|
|
|
1351
1369
|
},
|
|
1352
1370
|
onError: () => {
|
|
1353
1371
|
}
|
|
1354
|
-
}),
|
|
1355
|
-
const o =
|
|
1372
|
+
}), Vr = ({ title: e, onSuccess: t, onError: r, children: n }) => {
|
|
1373
|
+
const { client: o } = P(), i = typeof window < "u" ? window.location.href : "", [c, l] = N(null), [a, d] = N(!1);
|
|
1356
1374
|
k(() => {
|
|
1357
1375
|
o.membership && (d(!0), o.membership?.getOAuthURL().then((u) => {
|
|
1358
|
-
|
|
1376
|
+
l(u);
|
|
1359
1377
|
}).catch((u) => {
|
|
1360
1378
|
r({
|
|
1361
1379
|
code: u?.code || "SOMETHING_WENT_WRONG",
|
|
@@ -1364,49 +1382,49 @@ const _n = ({ children: e, label: t, labelClassName: r, asChild: n = !0, content
|
|
|
1364
1382
|
}).finally(() => {
|
|
1365
1383
|
d(!1);
|
|
1366
1384
|
}));
|
|
1367
|
-
}, []);
|
|
1368
|
-
const
|
|
1369
|
-
() => ({ title: e, urls:
|
|
1370
|
-
[e,
|
|
1385
|
+
}, [o]);
|
|
1386
|
+
const m = fe(
|
|
1387
|
+
() => ({ title: e, urls: c, isLoading: a, onSuccess: t, onError: r }),
|
|
1388
|
+
[e, c, t, r, a]
|
|
1371
1389
|
);
|
|
1372
1390
|
return k(() => {
|
|
1373
|
-
if (
|
|
1374
|
-
const u = {},
|
|
1375
|
-
for (const b of
|
|
1391
|
+
if (c && i) {
|
|
1392
|
+
const u = {}, p = Object.keys(c);
|
|
1393
|
+
for (const b of p)
|
|
1376
1394
|
try {
|
|
1377
|
-
const h =
|
|
1395
|
+
const h = c[b];
|
|
1378
1396
|
if (h) {
|
|
1379
1397
|
const O = new URL(h), x = O.searchParams;
|
|
1380
1398
|
x.set("redirect_uri", i);
|
|
1381
|
-
const
|
|
1382
|
-
|
|
1399
|
+
const R = o.pageContext;
|
|
1400
|
+
R && x.set("page_context", JSON.stringify(R)), u[b] = O.toString();
|
|
1383
1401
|
}
|
|
1384
1402
|
} catch {
|
|
1385
1403
|
}
|
|
1386
|
-
|
|
1404
|
+
l(u);
|
|
1387
1405
|
}
|
|
1388
|
-
}, [i]), /* @__PURE__ */ g.jsx(
|
|
1389
|
-
},
|
|
1406
|
+
}, [i]), /* @__PURE__ */ g.jsx(Ze.Provider, { value: m, children: n });
|
|
1407
|
+
}, Gr = () => Re(Ze), Xr = ({ url: e, title: t, height: r, width: n }) => {
|
|
1390
1408
|
const o = window.screenX + (window.outerWidth - n) / 2, i = window.screenY + (window.outerHeight - r) / 2.5;
|
|
1391
1409
|
return window.open(
|
|
1392
1410
|
e,
|
|
1393
1411
|
t,
|
|
1394
1412
|
`width=${n},height=${r},left=${o},top=${i}`
|
|
1395
1413
|
);
|
|
1396
|
-
},
|
|
1414
|
+
}, Jr = ({
|
|
1397
1415
|
title: e = "",
|
|
1398
1416
|
width: t = 500,
|
|
1399
1417
|
height: r = 500,
|
|
1400
1418
|
url: n,
|
|
1401
1419
|
children: o,
|
|
1402
1420
|
onCode: i,
|
|
1403
|
-
onClose:
|
|
1421
|
+
onClose: c
|
|
1404
1422
|
}) => {
|
|
1405
|
-
const [
|
|
1423
|
+
const [l, a] = N(), d = H(void 0), m = () => {
|
|
1406
1424
|
window.clearInterval(d.current);
|
|
1407
1425
|
}, u = () => {
|
|
1408
1426
|
a(
|
|
1409
|
-
|
|
1427
|
+
Xr({
|
|
1410
1428
|
url: n,
|
|
1411
1429
|
title: e,
|
|
1412
1430
|
width: t,
|
|
@@ -1414,19 +1432,19 @@ const _n = ({ children: e, label: t, labelClassName: r, asChild: n = !0, content
|
|
|
1414
1432
|
})
|
|
1415
1433
|
);
|
|
1416
1434
|
};
|
|
1417
|
-
return k(() => (
|
|
1435
|
+
return k(() => (l && (d.current = window.setInterval(() => {
|
|
1418
1436
|
try {
|
|
1419
|
-
const
|
|
1437
|
+
const p = l.location.href, b = new URL(p).searchParams, h = b.get("code");
|
|
1420
1438
|
if (!h)
|
|
1421
1439
|
return;
|
|
1422
|
-
i(h, b),
|
|
1440
|
+
i(h, b), m(), l.close();
|
|
1423
1441
|
} catch {
|
|
1424
1442
|
} finally {
|
|
1425
|
-
(!
|
|
1443
|
+
(!l || l.closed) && (c(), m());
|
|
1426
1444
|
}
|
|
1427
1445
|
}, 700)), () => {
|
|
1428
|
-
|
|
1429
|
-
}), [
|
|
1446
|
+
l && l.close(), c && c();
|
|
1447
|
+
}), [l]), /* @__PURE__ */ g.jsx(
|
|
1430
1448
|
"div",
|
|
1431
1449
|
{
|
|
1432
1450
|
onClick: () => {
|
|
@@ -1435,85 +1453,85 @@ const _n = ({ children: e, label: t, labelClassName: r, asChild: n = !0, content
|
|
|
1435
1453
|
children: o
|
|
1436
1454
|
}
|
|
1437
1455
|
);
|
|
1438
|
-
},
|
|
1456
|
+
}, qr = ({
|
|
1439
1457
|
title: e = "Levo",
|
|
1440
1458
|
url: t,
|
|
1441
1459
|
children: r,
|
|
1442
1460
|
onSuccess: n,
|
|
1443
1461
|
onError: o,
|
|
1444
1462
|
width: i = 500,
|
|
1445
|
-
height:
|
|
1463
|
+
height: c = 700
|
|
1446
1464
|
}) => {
|
|
1447
|
-
const
|
|
1465
|
+
const l = Q((a, d) => {
|
|
1448
1466
|
a.toLowerCase() === "success" ? n(d) : o(d);
|
|
1449
1467
|
}, []);
|
|
1450
1468
|
return /* @__PURE__ */ g.jsx(
|
|
1451
|
-
|
|
1469
|
+
Jr,
|
|
1452
1470
|
{
|
|
1453
1471
|
title: e,
|
|
1454
1472
|
width: i,
|
|
1455
|
-
height:
|
|
1473
|
+
height: c,
|
|
1456
1474
|
onClose: () => {
|
|
1457
1475
|
},
|
|
1458
1476
|
url: t,
|
|
1459
|
-
onCode:
|
|
1477
|
+
onCode: l,
|
|
1460
1478
|
children: r
|
|
1461
1479
|
}
|
|
1462
1480
|
);
|
|
1463
|
-
},
|
|
1464
|
-
const { title: r, urls: n, isLoading: o, onSuccess: i, onError:
|
|
1465
|
-
return
|
|
1466
|
-
},
|
|
1481
|
+
}, Kr = ({ children: e, provider: t }) => {
|
|
1482
|
+
const { title: r, urls: n, isLoading: o, onSuccess: i, onError: c } = Gr(), l = n?.[t];
|
|
1483
|
+
return l ? /* @__PURE__ */ g.jsx(qr, { title: r, provider: t, url: l, onSuccess: i, onError: c, children: o ? /* @__PURE__ */ g.jsx("div", { className: "w-full items-center justify-center", children: /* @__PURE__ */ g.jsx(Cr, { className: "h-5 w-5 bg-brand" }) }) : e }) : null;
|
|
1484
|
+
}, Zr = ({ url: e, title: t, height: r, width: n }) => {
|
|
1467
1485
|
const o = window.screenX + (window.outerWidth - n) / 2, i = window.screenY + (window.outerHeight - r) / 2.5;
|
|
1468
1486
|
return window.open(
|
|
1469
1487
|
e,
|
|
1470
1488
|
t,
|
|
1471
1489
|
`width=${n},height=${r},left=${o},top=${i}`
|
|
1472
1490
|
);
|
|
1473
|
-
},
|
|
1491
|
+
}, On = ({
|
|
1474
1492
|
title: e = "Levo",
|
|
1475
1493
|
width: t = 500,
|
|
1476
1494
|
height: r = 700,
|
|
1477
1495
|
onSuccess: n
|
|
1478
1496
|
}) => {
|
|
1479
|
-
const o =
|
|
1497
|
+
const { client: o } = P(), [i, c] = N(!1), [l, a] = N(null), [d, m] = N(null), [u, p] = N(), b = H(void 0), h = () => {
|
|
1480
1498
|
window.clearInterval(b.current);
|
|
1481
|
-
}, O =
|
|
1482
|
-
w.toLowerCase() === "success" ? (
|
|
1499
|
+
}, O = Q((w, _) => {
|
|
1500
|
+
w.toLowerCase() === "success" ? (m(null), n(_)) : m(_);
|
|
1483
1501
|
}, []);
|
|
1484
1502
|
k(() => {
|
|
1485
|
-
o.membership && (
|
|
1503
|
+
o.membership && (c(!0), o.membership?.getOAuthURL().then((w) => {
|
|
1486
1504
|
if (w)
|
|
1487
1505
|
return a(w), w;
|
|
1488
1506
|
throw new Error();
|
|
1489
1507
|
}).catch((w) => {
|
|
1490
1508
|
const _ = U(w);
|
|
1491
|
-
o.logger?.error("Failed to get OAuth URL", _.message),
|
|
1509
|
+
o.logger?.error("Failed to get OAuth URL", _.message), m({
|
|
1492
1510
|
code: _?.code || "SOMETHING_WENT_WRONG",
|
|
1493
1511
|
message: _?.message || "We could not connect with our service for your sign-in."
|
|
1494
1512
|
});
|
|
1495
1513
|
}).finally(() => {
|
|
1496
|
-
|
|
1514
|
+
c(!1);
|
|
1497
1515
|
}));
|
|
1498
1516
|
}, []), k(() => (u && (b.current = window.setInterval(() => {
|
|
1499
1517
|
try {
|
|
1500
|
-
const w = u.location.href, _ = new URL(w).searchParams,
|
|
1501
|
-
if (!
|
|
1518
|
+
const w = u.location.href, _ = new URL(w).searchParams, A = _.get("code");
|
|
1519
|
+
if (!A)
|
|
1502
1520
|
return;
|
|
1503
|
-
O(
|
|
1521
|
+
O(A, _), h(), u.close();
|
|
1504
1522
|
} catch {
|
|
1505
1523
|
} finally {
|
|
1506
|
-
(!u || u.closed) && (h(),
|
|
1524
|
+
(!u || u.closed) && (h(), m(null));
|
|
1507
1525
|
}
|
|
1508
1526
|
}, 700)), () => {
|
|
1509
1527
|
u && u.close();
|
|
1510
1528
|
}), [u]);
|
|
1511
|
-
const x =
|
|
1529
|
+
const x = Q(
|
|
1512
1530
|
(w) => {
|
|
1513
|
-
if (w &&
|
|
1514
|
-
const _ =
|
|
1515
|
-
_ && (u && u.close(),
|
|
1516
|
-
|
|
1531
|
+
if (w && l !== null) {
|
|
1532
|
+
const _ = l?.[w];
|
|
1533
|
+
_ && (u && u.close(), p(
|
|
1534
|
+
Zr({
|
|
1517
1535
|
url: _,
|
|
1518
1536
|
title: e,
|
|
1519
1537
|
width: t,
|
|
@@ -1522,22 +1540,22 @@ const _n = ({ children: e, label: t, labelClassName: r, asChild: n = !0, content
|
|
|
1522
1540
|
));
|
|
1523
1541
|
}
|
|
1524
1542
|
},
|
|
1525
|
-
[
|
|
1543
|
+
[l, u]
|
|
1526
1544
|
);
|
|
1527
1545
|
return {
|
|
1528
|
-
providers:
|
|
1529
|
-
(w) => !!
|
|
1530
|
-
) : [], [
|
|
1546
|
+
providers: fe(() => l !== null ? Object.keys(l).filter(
|
|
1547
|
+
(w) => !!l[w]
|
|
1548
|
+
) : [], [l]),
|
|
1531
1549
|
isLoading: i,
|
|
1532
1550
|
error: d,
|
|
1533
1551
|
launchPopup: x
|
|
1534
1552
|
};
|
|
1535
1553
|
};
|
|
1536
|
-
class
|
|
1537
|
-
static Container =
|
|
1538
|
-
static Button =
|
|
1554
|
+
class Nn {
|
|
1555
|
+
static Container = Vr;
|
|
1556
|
+
static Button = Kr;
|
|
1539
1557
|
}
|
|
1540
|
-
const
|
|
1558
|
+
const jn = (e, t = 2) => {
|
|
1541
1559
|
if (e === 0) return "0 B";
|
|
1542
1560
|
const r = 1024, n = t < 0 ? 0 : t, o = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], i = Math.floor(Math.log(e) / Math.log(r));
|
|
1543
1561
|
return `${Number.parseFloat((e / r ** i).toFixed(n))} ${o[i]}`;
|
|
@@ -1546,62 +1564,61 @@ const Cn = (e, t = 2) => {
|
|
|
1546
1564
|
return t?.code === "REQUEST_TIMEOUT" || t?.code === "NETWORK_ERROR" || t?.status === 408 || t?.status === 0 || Rr(t?.message || "", t?.title || "Error", {
|
|
1547
1565
|
id: `${t?.title || ""}-${t?.message || ""}`
|
|
1548
1566
|
}), t;
|
|
1549
|
-
},
|
|
1567
|
+
}, Qr = (e) => e instanceof Date, en = (e) => e == null, tn = (e) => typeof e == "object", rn = (e) => !en(e) && !Array.isArray(e) && tn(e) && !Qr(e), Cn = (e) => rn(e) && !Object.keys(e).length;
|
|
1550
1568
|
export {
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1569
|
+
Sr as Button,
|
|
1570
|
+
Or as Dialog,
|
|
1571
|
+
vn as DialogClose,
|
|
1572
|
+
Ge as DialogContent,
|
|
1573
|
+
qe as DialogDescription,
|
|
1574
|
+
jr as DialogFooter,
|
|
1575
|
+
Xe as DialogHeader,
|
|
1576
|
+
Ve as DialogOverlay,
|
|
1577
|
+
Nr as DialogPortal,
|
|
1578
|
+
Je as DialogTitle,
|
|
1579
|
+
hn as DialogTrigger,
|
|
1580
|
+
yn as DialogWrapper,
|
|
1581
|
+
mn as LevoInsightsBlock,
|
|
1582
|
+
pn as LevoInsightsComponent,
|
|
1583
|
+
bn as LevoInsightsPage,
|
|
1584
|
+
Nn as LevoOAuth,
|
|
1585
|
+
gn as LevoProvider,
|
|
1586
|
+
kn as SimpleTooltipWrapper,
|
|
1587
|
+
Cr as Spinner,
|
|
1588
|
+
Tn as Tabs,
|
|
1589
|
+
Ar as TabsContent,
|
|
1590
|
+
Lr as TabsList,
|
|
1591
|
+
Pr as TabsTrigger,
|
|
1592
|
+
wn as Toaster,
|
|
1593
|
+
Ir as Tooltip,
|
|
1594
|
+
Ke as TooltipContent,
|
|
1595
|
+
$r as TooltipPortal,
|
|
1596
|
+
En as TooltipProvider,
|
|
1597
|
+
Dr as TooltipTrigger,
|
|
1598
|
+
_n as allMediaFileExtensions,
|
|
1599
|
+
Sn as allMediaMimetypes,
|
|
1600
|
+
Br as audioFileExtensions,
|
|
1601
|
+
zr as audioMimetype,
|
|
1602
|
+
_r as buttonVariants,
|
|
1603
|
+
jn as byteToSize,
|
|
1604
|
+
C as cn,
|
|
1605
|
+
Mr as documentFileExtensions,
|
|
1606
|
+
Ur as documentMimetype,
|
|
1589
1607
|
Rn as errorHandler,
|
|
1590
1608
|
Rr as errorToast,
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
zr as videoMimetype
|
|
1609
|
+
Wr as imageFileExtensions,
|
|
1610
|
+
Yr as imageMimetype,
|
|
1611
|
+
Qr as isDateObject,
|
|
1612
|
+
Cn as isEmptyObject,
|
|
1613
|
+
en as isNullOrUndefined,
|
|
1614
|
+
rn as isObject,
|
|
1615
|
+
tn as isObjectType,
|
|
1616
|
+
Z as mediaExtensionsByKind,
|
|
1617
|
+
K as mediaMimetypeByKind,
|
|
1618
|
+
xn as successToast,
|
|
1619
|
+
An as toast,
|
|
1620
|
+
P as useLevo,
|
|
1621
|
+
On as useLevoOAuth,
|
|
1622
|
+
Fr as videoFileExtensions,
|
|
1623
|
+
Hr as videoMimetype
|
|
1607
1624
|
};
|