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