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