@saas-support/react 0.7.2 → 0.7.5
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/index.cjs +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +29 -20
- package/dist/react.cjs +25 -2
- package/dist/react.d.ts +6 -1
- package/dist/react.js +1215 -1181
- package/package.json +1 -1
package/dist/react.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { jsx as e, jsxs as t, Fragment as
|
|
2
|
-
import { createContext as ma, useContext as fa, useState as
|
|
3
|
-
import { SaaSSupport as
|
|
4
|
-
import { SaaSError as
|
|
5
|
-
import { createPortal as
|
|
1
|
+
import { jsx as e, jsxs as t, Fragment as H } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as ma, useContext as fa, useState as h, useEffect as U, useRef as W, useCallback as $, forwardRef as ba, useImperativeHandle as xa, useMemo as G } from "react";
|
|
3
|
+
import { SaaSSupport as ya, isMfaRequired as va, BillingClient as wa, Transport as Q, ReportClient as ta } from "./index.js";
|
|
4
|
+
import { SaaSError as $e } from "./index.js";
|
|
5
|
+
import { createPortal as Na } from "react-dom";
|
|
6
6
|
const ra = ma(null);
|
|
7
|
-
function
|
|
7
|
+
function D() {
|
|
8
8
|
const a = fa(ra);
|
|
9
9
|
if (!a)
|
|
10
10
|
throw new Error("useSaaSContext must be used within a <SaaSProvider>");
|
|
11
11
|
return a;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
const [u] =
|
|
13
|
+
function re({ publishableKey: a, apiKey: r, baseUrl: s, appearance: l, children: n }) {
|
|
14
|
+
const [u] = h(() => new ya({ publishableKey: a, apiKey: r, baseUrl: s })), [c, d] = h(null), [i, o] = h(!1), [m, p] = h(null);
|
|
15
15
|
return U(() => {
|
|
16
|
-
let
|
|
16
|
+
let g = !1;
|
|
17
17
|
u.load().then(async () => {
|
|
18
|
-
if (
|
|
19
|
-
const
|
|
20
|
-
|
|
18
|
+
if (g) return;
|
|
19
|
+
const x = await u.auth.getUser(), y = await u.auth.getSettings();
|
|
20
|
+
d(x), p(y), o(!0);
|
|
21
21
|
});
|
|
22
|
-
const
|
|
23
|
-
|
|
22
|
+
const v = u.auth.onAuthStateChange((x) => {
|
|
23
|
+
g || d(x);
|
|
24
24
|
});
|
|
25
25
|
return () => {
|
|
26
|
-
|
|
26
|
+
g = !0, v(), u.destroy();
|
|
27
27
|
};
|
|
28
|
-
}, [u]), /* @__PURE__ */ e(ra.Provider, { value: { client: u, user:
|
|
28
|
+
}, [u]), /* @__PURE__ */ e(ra.Provider, { value: { client: u, user: c, isLoaded: i, appearance: l, settings: m }, children: n });
|
|
29
29
|
}
|
|
30
|
-
const
|
|
30
|
+
const Sa = {
|
|
31
31
|
// Legacy (unchanged)
|
|
32
32
|
colorPrimary: "#6366f1",
|
|
33
33
|
colorPrimaryHover: "#4f46e5",
|
|
@@ -61,7 +61,7 @@ const wa = {
|
|
|
61
61
|
authSuccess: "#22c55e",
|
|
62
62
|
authFontHeadline: "'Manrope', sans-serif",
|
|
63
63
|
authFontBody: "'Inter', sans-serif"
|
|
64
|
-
},
|
|
64
|
+
}, $a = {
|
|
65
65
|
// Legacy (unchanged)
|
|
66
66
|
colorPrimary: "#818cf8",
|
|
67
67
|
colorPrimaryHover: "#6366f1",
|
|
@@ -97,50 +97,50 @@ const wa = {
|
|
|
97
97
|
authFontBody: "'Inter', sans-serif"
|
|
98
98
|
};
|
|
99
99
|
function aa(a) {
|
|
100
|
-
const
|
|
100
|
+
const r = (a == null ? void 0 : a.baseTheme) === "dark" ? $a : Sa, s = a == null ? void 0 : a.variables, l = (s == null ? void 0 : s.colorPrimary) ?? r.authPrimary;
|
|
101
101
|
return {
|
|
102
102
|
// Legacy
|
|
103
|
-
colorPrimary: (
|
|
104
|
-
colorPrimaryHover:
|
|
105
|
-
colorBackground: (
|
|
106
|
-
colorText: (
|
|
107
|
-
colorTextSecondary:
|
|
108
|
-
colorInputBackground: (
|
|
109
|
-
colorInputBorder: (
|
|
110
|
-
colorError: (
|
|
111
|
-
colorSuccess: (
|
|
112
|
-
colorWarning: (
|
|
113
|
-
fontFamily: (
|
|
114
|
-
borderRadius: (
|
|
103
|
+
colorPrimary: (s == null ? void 0 : s.colorPrimary) ?? r.colorPrimary,
|
|
104
|
+
colorPrimaryHover: s != null && s.colorPrimary ? ka(s.colorPrimary, 10) : r.colorPrimaryHover,
|
|
105
|
+
colorBackground: (s == null ? void 0 : s.colorBackground) ?? r.colorBackground,
|
|
106
|
+
colorText: (s == null ? void 0 : s.colorText) ?? r.colorText,
|
|
107
|
+
colorTextSecondary: r.colorTextSecondary,
|
|
108
|
+
colorInputBackground: (s == null ? void 0 : s.colorInputBackground) ?? r.colorInputBackground,
|
|
109
|
+
colorInputBorder: (s == null ? void 0 : s.colorInputBorder) ?? r.colorInputBorder,
|
|
110
|
+
colorError: (s == null ? void 0 : s.colorError) ?? r.colorError,
|
|
111
|
+
colorSuccess: (s == null ? void 0 : s.colorSuccess) ?? r.colorSuccess,
|
|
112
|
+
colorWarning: (s == null ? void 0 : s.colorWarning) ?? r.colorWarning,
|
|
113
|
+
fontFamily: (s == null ? void 0 : s.fontFamily) ?? r.fontFamily,
|
|
114
|
+
borderRadius: (s == null ? void 0 : s.borderRadius) ?? r.borderRadius,
|
|
115
115
|
// MD3 auth — derive from user overrides where applicable
|
|
116
|
-
authPrimary:
|
|
117
|
-
authPrimaryContainer:
|
|
118
|
-
authOnPrimary:
|
|
119
|
-
authPrimaryFixed:
|
|
120
|
-
authSurface: (
|
|
121
|
-
authSurfaceContainerLowest:
|
|
122
|
-
authSurfaceContainerLow: (
|
|
123
|
-
authSurfaceContainer:
|
|
124
|
-
authSurfaceContainerHigh:
|
|
125
|
-
authSurfaceContainerHighest:
|
|
126
|
-
authOnSurface: (
|
|
127
|
-
authOnSurfaceVariant:
|
|
128
|
-
authOutline:
|
|
129
|
-
authOutlineVariant: (
|
|
130
|
-
authError: (
|
|
131
|
-
authErrorContainer:
|
|
132
|
-
authSuccess: (
|
|
133
|
-
authFontHeadline: (
|
|
134
|
-
authFontBody: (
|
|
116
|
+
authPrimary: l,
|
|
117
|
+
authPrimaryContainer: s != null && s.colorPrimary ? Ca(l, 15) : r.authPrimaryContainer,
|
|
118
|
+
authOnPrimary: r.authOnPrimary,
|
|
119
|
+
authPrimaryFixed: r.authPrimaryFixed,
|
|
120
|
+
authSurface: (s == null ? void 0 : s.colorBackground) ?? r.authSurface,
|
|
121
|
+
authSurfaceContainerLowest: r.authSurfaceContainerLowest,
|
|
122
|
+
authSurfaceContainerLow: (s == null ? void 0 : s.colorInputBackground) ?? r.authSurfaceContainerLow,
|
|
123
|
+
authSurfaceContainer: r.authSurfaceContainer,
|
|
124
|
+
authSurfaceContainerHigh: r.authSurfaceContainerHigh,
|
|
125
|
+
authSurfaceContainerHighest: r.authSurfaceContainerHighest,
|
|
126
|
+
authOnSurface: (s == null ? void 0 : s.colorText) ?? r.authOnSurface,
|
|
127
|
+
authOnSurfaceVariant: r.authOnSurfaceVariant,
|
|
128
|
+
authOutline: r.authOutline,
|
|
129
|
+
authOutlineVariant: (s == null ? void 0 : s.colorInputBorder) ?? r.authOutlineVariant,
|
|
130
|
+
authError: (s == null ? void 0 : s.colorError) ?? r.authError,
|
|
131
|
+
authErrorContainer: r.authErrorContainer,
|
|
132
|
+
authSuccess: (s == null ? void 0 : s.colorSuccess) ?? r.authSuccess,
|
|
133
|
+
authFontHeadline: (s == null ? void 0 : s.fontFamily) ?? r.authFontHeadline,
|
|
134
|
+
authFontBody: (s == null ? void 0 : s.fontFamily) ?? r.authFontBody
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
const
|
|
139
|
-
return `#${(
|
|
137
|
+
function ka(a, r) {
|
|
138
|
+
const s = parseInt(a.replace("#", ""), 16), l = Math.max(0, (s >> 16) - Math.round(2.55 * r)), n = Math.max(0, (s >> 8 & 255) - Math.round(2.55 * r)), u = Math.max(0, (s & 255) - Math.round(2.55 * r));
|
|
139
|
+
return `#${(l << 16 | n << 8 | u).toString(16).padStart(6, "0")}`;
|
|
140
140
|
}
|
|
141
|
-
function
|
|
142
|
-
const
|
|
143
|
-
return `#${(
|
|
141
|
+
function Ca(a, r) {
|
|
142
|
+
const s = parseInt(a.replace("#", ""), 16), l = Math.min(255, (s >> 16) + Math.round(2.55 * r)), n = Math.min(255, (s >> 8 & 255) + Math.round(2.55 * r)), u = Math.min(255, (s & 255) + Math.round(2.55 * r));
|
|
143
|
+
return `#${(l << 16 | n << 8 | u).toString(16).padStart(6, "0")}`;
|
|
144
144
|
}
|
|
145
145
|
function ea(a) {
|
|
146
146
|
return `
|
|
@@ -1424,6 +1424,7 @@ function ea(a) {
|
|
|
1424
1424
|
cursor: pointer;
|
|
1425
1425
|
transition: background 0.15s, box-shadow 0.15s;
|
|
1426
1426
|
font-family: ${a.authFontBody};
|
|
1427
|
+
max-width: 200px;
|
|
1427
1428
|
}
|
|
1428
1429
|
|
|
1429
1430
|
.ss-auth-user-trigger:hover {
|
|
@@ -2243,6 +2244,25 @@ function ea(a) {
|
|
|
2243
2244
|
margin: 0;
|
|
2244
2245
|
}
|
|
2245
2246
|
|
|
2247
|
+
.ss-auth-settings-back {
|
|
2248
|
+
display: flex;
|
|
2249
|
+
align-items: center;
|
|
2250
|
+
justify-content: center;
|
|
2251
|
+
width: 36px;
|
|
2252
|
+
height: 36px;
|
|
2253
|
+
border-radius: 8px;
|
|
2254
|
+
border: none;
|
|
2255
|
+
background: none;
|
|
2256
|
+
cursor: pointer;
|
|
2257
|
+
color: ${a.authOnSurfaceVariant};
|
|
2258
|
+
transition: background 0.15s, color 0.15s;
|
|
2259
|
+
}
|
|
2260
|
+
.ss-auth-settings-back:hover {
|
|
2261
|
+
background: ${a.authSurfaceContainer};
|
|
2262
|
+
color: ${a.authOnSurface};
|
|
2263
|
+
}
|
|
2264
|
+
.ss-auth-settings-back .material-symbols-outlined { font-size: 22px; }
|
|
2265
|
+
|
|
2246
2266
|
.ss-auth-settings-layout {
|
|
2247
2267
|
display: flex;
|
|
2248
2268
|
flex: 1;
|
|
@@ -2301,6 +2321,9 @@ function ea(a) {
|
|
|
2301
2321
|
flex: 1;
|
|
2302
2322
|
overflow-y: auto;
|
|
2303
2323
|
padding: 32px;
|
|
2324
|
+
max-width: 720px;
|
|
2325
|
+
margin: 0 auto;
|
|
2326
|
+
width: 100%;
|
|
2304
2327
|
}
|
|
2305
2328
|
|
|
2306
2329
|
.ss-auth-settings-content h3 {
|
|
@@ -2478,280 +2501,280 @@ function ea(a) {
|
|
|
2478
2501
|
}
|
|
2479
2502
|
`;
|
|
2480
2503
|
}
|
|
2481
|
-
function
|
|
2482
|
-
const
|
|
2504
|
+
function j({ children: a, appearance: r }) {
|
|
2505
|
+
const s = W(null), [l, n] = h(null);
|
|
2483
2506
|
U(() => {
|
|
2484
|
-
var
|
|
2485
|
-
if (!
|
|
2486
|
-
n(((
|
|
2507
|
+
var m;
|
|
2508
|
+
if (!s.current || s.current.shadowRoot) {
|
|
2509
|
+
n(((m = s.current) == null ? void 0 : m.shadowRoot) ?? null);
|
|
2487
2510
|
return;
|
|
2488
2511
|
}
|
|
2489
|
-
const
|
|
2490
|
-
if ((
|
|
2491
|
-
const p = (
|
|
2512
|
+
const c = s.current.attachShadow({ mode: "open" });
|
|
2513
|
+
if ((r == null ? void 0 : r.fontUrl) !== null) {
|
|
2514
|
+
const p = (r == null ? void 0 : r.fontUrl) ?? "https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Inter:wght@400;500;600&family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap";
|
|
2492
2515
|
if (!document.querySelector(`link[href="${p}"]`)) {
|
|
2493
|
-
const
|
|
2494
|
-
|
|
2516
|
+
const v = document.createElement("link");
|
|
2517
|
+
v.rel = "stylesheet", v.href = p, document.head.appendChild(v);
|
|
2495
2518
|
}
|
|
2496
|
-
const
|
|
2497
|
-
|
|
2519
|
+
const g = document.createElement("link");
|
|
2520
|
+
g.rel = "stylesheet", g.href = p, c.appendChild(g);
|
|
2498
2521
|
}
|
|
2499
|
-
const
|
|
2500
|
-
|
|
2501
|
-
const
|
|
2502
|
-
|
|
2522
|
+
const d = aa(r), i = document.createElement("style");
|
|
2523
|
+
i.textContent = ea(d), c.appendChild(i);
|
|
2524
|
+
const o = document.createElement("div");
|
|
2525
|
+
c.appendChild(o), n(c);
|
|
2503
2526
|
}, []), U(() => {
|
|
2504
|
-
if (!
|
|
2505
|
-
const
|
|
2506
|
-
if (
|
|
2507
|
-
const
|
|
2508
|
-
|
|
2509
|
-
}
|
|
2510
|
-
}, [
|
|
2511
|
-
const u = (
|
|
2512
|
-
return /* @__PURE__ */ e("div", { ref:
|
|
2527
|
+
if (!l) return;
|
|
2528
|
+
const c = l.querySelector("style");
|
|
2529
|
+
if (c) {
|
|
2530
|
+
const d = aa(r);
|
|
2531
|
+
c.textContent = ea(d);
|
|
2532
|
+
}
|
|
2533
|
+
}, [r, l]);
|
|
2534
|
+
const u = (l == null ? void 0 : l.querySelector("div")) ?? null;
|
|
2535
|
+
return /* @__PURE__ */ e("div", { ref: s, style: { display: "contents" }, children: u && Na(a, u) });
|
|
2513
2536
|
}
|
|
2514
2537
|
function sa() {
|
|
2515
|
-
const { client: a, user:
|
|
2538
|
+
const { client: a, user: r, isLoaded: s } = D();
|
|
2516
2539
|
return {
|
|
2517
|
-
isLoaded:
|
|
2518
|
-
isSignedIn: !!
|
|
2519
|
-
user:
|
|
2520
|
-
signOut:
|
|
2521
|
-
getToken:
|
|
2522
|
-
refreshUser:
|
|
2540
|
+
isLoaded: s,
|
|
2541
|
+
isSignedIn: !!r,
|
|
2542
|
+
user: r,
|
|
2543
|
+
signOut: $(() => a.auth.signOut(), [a]),
|
|
2544
|
+
getToken: $(() => a.auth.getToken(), [a]),
|
|
2545
|
+
refreshUser: $(() => a.auth.refreshUser(), [a])
|
|
2523
2546
|
};
|
|
2524
2547
|
}
|
|
2525
|
-
function
|
|
2526
|
-
const { user: a, isLoaded:
|
|
2527
|
-
return { user: a, isLoaded:
|
|
2548
|
+
function ne() {
|
|
2549
|
+
const { user: a, isLoaded: r } = D();
|
|
2550
|
+
return { user: a, isLoaded: r };
|
|
2528
2551
|
}
|
|
2529
2552
|
function na() {
|
|
2530
|
-
const { client: a } =
|
|
2531
|
-
async (
|
|
2532
|
-
|
|
2553
|
+
const { client: a } = D(), [r, s] = h(!1), [l, n] = h(null), u = $(
|
|
2554
|
+
async (i, o) => {
|
|
2555
|
+
s(!0), n(null);
|
|
2533
2556
|
try {
|
|
2534
|
-
return await a.auth.signIn(
|
|
2535
|
-
} catch (
|
|
2536
|
-
return n(
|
|
2557
|
+
return await a.auth.signIn(i, o);
|
|
2558
|
+
} catch (m) {
|
|
2559
|
+
return n(m instanceof Error ? m.message : "Sign in failed"), null;
|
|
2537
2560
|
} finally {
|
|
2538
|
-
|
|
2561
|
+
s(!1);
|
|
2539
2562
|
}
|
|
2540
2563
|
},
|
|
2541
2564
|
[a]
|
|
2542
|
-
),
|
|
2543
|
-
async (
|
|
2544
|
-
|
|
2565
|
+
), c = $(
|
|
2566
|
+
async (i) => {
|
|
2567
|
+
s(!0), n(null);
|
|
2545
2568
|
try {
|
|
2546
|
-
return await a.auth.signInWithOAuth(
|
|
2547
|
-
} catch (
|
|
2548
|
-
return n(
|
|
2569
|
+
return await a.auth.signInWithOAuth(i);
|
|
2570
|
+
} catch (o) {
|
|
2571
|
+
return n(o instanceof Error ? o.message : "OAuth sign in failed"), null;
|
|
2549
2572
|
} finally {
|
|
2550
|
-
|
|
2573
|
+
s(!1);
|
|
2551
2574
|
}
|
|
2552
2575
|
},
|
|
2553
2576
|
[a]
|
|
2554
|
-
),
|
|
2555
|
-
async (
|
|
2556
|
-
|
|
2577
|
+
), d = $(
|
|
2578
|
+
async (i, o) => {
|
|
2579
|
+
s(!0), n(null);
|
|
2557
2580
|
try {
|
|
2558
|
-
return await a.auth.submitMfaCode(
|
|
2559
|
-
} catch (
|
|
2560
|
-
return n(
|
|
2581
|
+
return await a.auth.submitMfaCode(i, o);
|
|
2582
|
+
} catch (m) {
|
|
2583
|
+
return n(m instanceof Error ? m.message : "MFA verification failed"), null;
|
|
2561
2584
|
} finally {
|
|
2562
|
-
|
|
2585
|
+
s(!1);
|
|
2563
2586
|
}
|
|
2564
2587
|
},
|
|
2565
2588
|
[a]
|
|
2566
2589
|
);
|
|
2567
|
-
return { signIn: u, signInWithOAuth:
|
|
2590
|
+
return { signIn: u, signInWithOAuth: c, submitMfaCode: d, isLoading: r, error: l, setError: n };
|
|
2568
2591
|
}
|
|
2569
|
-
function
|
|
2570
|
-
const { client: a } =
|
|
2571
|
-
return { signUp:
|
|
2572
|
-
async (
|
|
2573
|
-
|
|
2592
|
+
function za() {
|
|
2593
|
+
const { client: a } = D(), [r, s] = h(!1), [l, n] = h(null);
|
|
2594
|
+
return { signUp: $(
|
|
2595
|
+
async (c, d) => {
|
|
2596
|
+
s(!0), n(null);
|
|
2574
2597
|
try {
|
|
2575
|
-
return await a.auth.signUp(
|
|
2576
|
-
} catch (
|
|
2577
|
-
return n(
|
|
2598
|
+
return await a.auth.signUp(c, d);
|
|
2599
|
+
} catch (i) {
|
|
2600
|
+
return n(i instanceof Error ? i.message : "Sign up failed"), null;
|
|
2578
2601
|
} finally {
|
|
2579
|
-
|
|
2602
|
+
s(!1);
|
|
2580
2603
|
}
|
|
2581
2604
|
},
|
|
2582
2605
|
[a]
|
|
2583
|
-
), isLoading:
|
|
2606
|
+
), isLoading: r, error: l, setError: n };
|
|
2584
2607
|
}
|
|
2585
2608
|
function Y() {
|
|
2586
|
-
const { client: a } =
|
|
2587
|
-
|
|
2609
|
+
const { client: a } = D(), [r, s] = h([]), [l, n] = h(null), [u, c] = h([]), [d, i] = h([]), [o, m] = h(!1), [p, g] = h(null), v = W(!1), x = $(async () => {
|
|
2610
|
+
m(!0), g(null);
|
|
2588
2611
|
try {
|
|
2589
|
-
const
|
|
2590
|
-
if (
|
|
2591
|
-
const
|
|
2592
|
-
if (
|
|
2593
|
-
n(
|
|
2612
|
+
const b = await a.auth.listOrgs();
|
|
2613
|
+
if (s(b), !v.current && b.length > 0) {
|
|
2614
|
+
const w = typeof window < "u" ? localStorage.getItem("ss_selected_org") : null, z = (w ? b.find((M) => M.id === w) : null) ?? (b.length === 1 ? b[0] : null);
|
|
2615
|
+
if (z) {
|
|
2616
|
+
v.current = !0, n(z), typeof window < "u" && localStorage.setItem("ss_selected_org", z.id);
|
|
2594
2617
|
try {
|
|
2595
|
-
const
|
|
2596
|
-
|
|
2618
|
+
const M = await a.auth.listMembers(z.id);
|
|
2619
|
+
c(M);
|
|
2597
2620
|
} catch {
|
|
2598
2621
|
}
|
|
2599
2622
|
}
|
|
2600
2623
|
}
|
|
2601
|
-
} catch (
|
|
2602
|
-
|
|
2624
|
+
} catch (b) {
|
|
2625
|
+
g(b instanceof Error ? b.message : "Failed to load organizations");
|
|
2603
2626
|
} finally {
|
|
2604
|
-
|
|
2627
|
+
m(!1);
|
|
2605
2628
|
}
|
|
2606
|
-
}, [a
|
|
2629
|
+
}, [a]);
|
|
2607
2630
|
U(() => {
|
|
2608
|
-
|
|
2609
|
-
}, [
|
|
2610
|
-
const
|
|
2631
|
+
x();
|
|
2632
|
+
}, [x]);
|
|
2633
|
+
const y = $(async (b) => {
|
|
2611
2634
|
try {
|
|
2612
|
-
const
|
|
2613
|
-
n(
|
|
2614
|
-
const
|
|
2615
|
-
|
|
2616
|
-
} catch (
|
|
2617
|
-
|
|
2618
|
-
}
|
|
2619
|
-
}, [a]),
|
|
2635
|
+
const w = await a.auth.getOrg(b);
|
|
2636
|
+
n(w), typeof window < "u" && localStorage.setItem("ss_selected_org", b);
|
|
2637
|
+
const B = await a.auth.listMembers(b);
|
|
2638
|
+
c(B);
|
|
2639
|
+
} catch (w) {
|
|
2640
|
+
g(w instanceof Error ? w.message : "Failed to load organization");
|
|
2641
|
+
}
|
|
2642
|
+
}, [a]), P = $(async (b, w) => {
|
|
2620
2643
|
try {
|
|
2621
|
-
const
|
|
2622
|
-
return
|
|
2623
|
-
} catch (
|
|
2624
|
-
return
|
|
2644
|
+
const B = await a.auth.createOrg(b, w);
|
|
2645
|
+
return s((z) => [...z, B]), B;
|
|
2646
|
+
} catch (B) {
|
|
2647
|
+
return g(B instanceof Error ? B.message : "Failed to create organization"), null;
|
|
2625
2648
|
}
|
|
2626
|
-
}, [a]),
|
|
2649
|
+
}, [a]), N = $(async (b, w) => {
|
|
2627
2650
|
try {
|
|
2628
|
-
const
|
|
2629
|
-
return
|
|
2630
|
-
} catch (
|
|
2631
|
-
return
|
|
2651
|
+
const B = await a.auth.updateOrg(b, w);
|
|
2652
|
+
return s((z) => z.map((M) => M.id === b ? B : M)), (l == null ? void 0 : l.id) === b && n(B), B;
|
|
2653
|
+
} catch (B) {
|
|
2654
|
+
return g(B instanceof Error ? B.message : "Failed to update organization"), null;
|
|
2632
2655
|
}
|
|
2633
|
-
}, [a,
|
|
2656
|
+
}, [a, l]), E = $(async (b) => {
|
|
2634
2657
|
try {
|
|
2635
|
-
return await a.auth.deleteOrg(
|
|
2636
|
-
} catch (
|
|
2637
|
-
return
|
|
2658
|
+
return await a.auth.deleteOrg(b), s((w) => w.filter((B) => B.id !== b)), (l == null ? void 0 : l.id) === b && (n(null), c([]), i([]), typeof window < "u" && localStorage.removeItem("ss_selected_org")), !0;
|
|
2659
|
+
} catch (w) {
|
|
2660
|
+
return g(w instanceof Error ? w.message : "Failed to delete organization"), !1;
|
|
2638
2661
|
}
|
|
2639
|
-
}, [a,
|
|
2662
|
+
}, [a, l]), C = $(async (b, w, B) => {
|
|
2640
2663
|
try {
|
|
2641
|
-
return await a.auth.sendInvite(
|
|
2642
|
-
} catch (
|
|
2643
|
-
return
|
|
2664
|
+
return await a.auth.sendInvite(b, w, B);
|
|
2665
|
+
} catch (z) {
|
|
2666
|
+
return g(z instanceof Error ? z.message : "Failed to send invite"), null;
|
|
2644
2667
|
}
|
|
2645
|
-
}, [a]),
|
|
2668
|
+
}, [a]), f = $(async (b) => {
|
|
2646
2669
|
try {
|
|
2647
|
-
const
|
|
2648
|
-
|
|
2649
|
-
} catch (
|
|
2650
|
-
|
|
2670
|
+
const w = await a.auth.listInvites(b);
|
|
2671
|
+
i(w);
|
|
2672
|
+
} catch (w) {
|
|
2673
|
+
g(w instanceof Error ? w.message : "Failed to load invites");
|
|
2651
2674
|
}
|
|
2652
|
-
}, [a]),
|
|
2675
|
+
}, [a]), O = $(async (b, w) => {
|
|
2653
2676
|
try {
|
|
2654
|
-
return await a.auth.revokeInvite(
|
|
2655
|
-
} catch (
|
|
2656
|
-
return
|
|
2677
|
+
return await a.auth.revokeInvite(b, w), i((B) => B.filter((z) => z.id !== w)), !0;
|
|
2678
|
+
} catch (B) {
|
|
2679
|
+
return g(B instanceof Error ? B.message : "Failed to revoke invite"), !1;
|
|
2657
2680
|
}
|
|
2658
|
-
}, [a]), I =
|
|
2681
|
+
}, [a]), I = $(async (b, w, B) => {
|
|
2659
2682
|
try {
|
|
2660
|
-
return await a.auth.updateMemberRole(
|
|
2661
|
-
} catch (
|
|
2662
|
-
return
|
|
2683
|
+
return await a.auth.updateMemberRole(b, w, B), c((z) => z.map((M) => M.userId === w ? { ...M, role: B } : M)), !0;
|
|
2684
|
+
} catch (z) {
|
|
2685
|
+
return g(z instanceof Error ? z.message : "Failed to update member role"), !1;
|
|
2663
2686
|
}
|
|
2664
|
-
}, [a]), F =
|
|
2687
|
+
}, [a]), F = $(async (b, w) => {
|
|
2665
2688
|
try {
|
|
2666
|
-
return await a.auth.removeMember(
|
|
2667
|
-
} catch (
|
|
2668
|
-
return
|
|
2689
|
+
return await a.auth.removeMember(b, w), c((B) => B.filter((z) => z.userId !== w)), !0;
|
|
2690
|
+
} catch (B) {
|
|
2691
|
+
return g(B instanceof Error ? B.message : "Failed to remove member"), !1;
|
|
2669
2692
|
}
|
|
2670
|
-
}, [a]),
|
|
2693
|
+
}, [a]), A = $(async (b) => {
|
|
2671
2694
|
try {
|
|
2672
|
-
const
|
|
2673
|
-
|
|
2674
|
-
} catch (
|
|
2675
|
-
|
|
2695
|
+
const w = await a.auth.listMembers(b);
|
|
2696
|
+
c(w);
|
|
2697
|
+
} catch (w) {
|
|
2698
|
+
g(w instanceof Error ? w.message : "Failed to load members");
|
|
2676
2699
|
}
|
|
2677
2700
|
}, [a]);
|
|
2678
2701
|
return {
|
|
2679
|
-
orgs:
|
|
2680
|
-
selectedOrg:
|
|
2702
|
+
orgs: r,
|
|
2703
|
+
selectedOrg: l,
|
|
2681
2704
|
members: u,
|
|
2682
|
-
invites:
|
|
2683
|
-
isLoading:
|
|
2705
|
+
invites: d,
|
|
2706
|
+
isLoading: o,
|
|
2684
2707
|
error: p,
|
|
2685
|
-
setError:
|
|
2686
|
-
refresh:
|
|
2687
|
-
selectOrg:
|
|
2688
|
-
createOrg:
|
|
2689
|
-
updateOrg:
|
|
2690
|
-
deleteOrg:
|
|
2691
|
-
sendInvite:
|
|
2692
|
-
refreshInvites:
|
|
2693
|
-
revokeInvite:
|
|
2708
|
+
setError: g,
|
|
2709
|
+
refresh: x,
|
|
2710
|
+
selectOrg: y,
|
|
2711
|
+
createOrg: P,
|
|
2712
|
+
updateOrg: N,
|
|
2713
|
+
deleteOrg: E,
|
|
2714
|
+
sendInvite: C,
|
|
2715
|
+
refreshInvites: f,
|
|
2716
|
+
revokeInvite: O,
|
|
2694
2717
|
updateMemberRole: I,
|
|
2695
2718
|
removeMember: F,
|
|
2696
|
-
refreshMembers:
|
|
2719
|
+
refreshMembers: A
|
|
2697
2720
|
};
|
|
2698
2721
|
}
|
|
2699
|
-
function
|
|
2700
|
-
const { client: a } =
|
|
2701
|
-
return { deleteAccount:
|
|
2702
|
-
|
|
2722
|
+
function Pa() {
|
|
2723
|
+
const { client: a } = D(), [r, s] = h(!1), [l, n] = h(null);
|
|
2724
|
+
return { deleteAccount: $(async () => {
|
|
2725
|
+
s(!0), n(null);
|
|
2703
2726
|
try {
|
|
2704
2727
|
return await a.auth.deleteAccount(), !0;
|
|
2705
|
-
} catch (
|
|
2706
|
-
return n(
|
|
2728
|
+
} catch (c) {
|
|
2729
|
+
return n(c instanceof Error ? c.message : "Failed to delete account"), !1;
|
|
2707
2730
|
} finally {
|
|
2708
|
-
|
|
2731
|
+
s(!1);
|
|
2709
2732
|
}
|
|
2710
|
-
}, [a]), isLoading:
|
|
2733
|
+
}, [a]), isLoading: r, error: l, setError: n };
|
|
2711
2734
|
}
|
|
2712
2735
|
function oa() {
|
|
2713
|
-
const { client: a, user:
|
|
2736
|
+
const { client: a, user: r } = D(), [s, l] = h(!1), [n, u] = h(null), [c, d] = h(null), i = $(
|
|
2714
2737
|
async (p) => {
|
|
2715
|
-
|
|
2738
|
+
l(!0), u(null), d(null);
|
|
2716
2739
|
try {
|
|
2717
|
-
const
|
|
2718
|
-
return
|
|
2719
|
-
} catch (
|
|
2720
|
-
return u(
|
|
2740
|
+
const g = await a.auth.updateProfile(p);
|
|
2741
|
+
return d("Profile updated"), g;
|
|
2742
|
+
} catch (g) {
|
|
2743
|
+
return u(g instanceof Error ? g.message : "Failed to update profile"), null;
|
|
2721
2744
|
} finally {
|
|
2722
|
-
|
|
2745
|
+
l(!1);
|
|
2723
2746
|
}
|
|
2724
2747
|
},
|
|
2725
2748
|
[a]
|
|
2726
|
-
),
|
|
2727
|
-
async (p,
|
|
2728
|
-
|
|
2749
|
+
), o = $(
|
|
2750
|
+
async (p, g) => {
|
|
2751
|
+
l(!0), u(null), d(null);
|
|
2729
2752
|
try {
|
|
2730
|
-
return await a.auth.changePassword(p,
|
|
2731
|
-
} catch (
|
|
2732
|
-
return u(
|
|
2753
|
+
return await a.auth.changePassword(p, g), d("Password changed successfully"), !0;
|
|
2754
|
+
} catch (v) {
|
|
2755
|
+
return u(v instanceof Error ? v.message : "Failed to change password"), !1;
|
|
2733
2756
|
} finally {
|
|
2734
|
-
|
|
2757
|
+
l(!1);
|
|
2735
2758
|
}
|
|
2736
2759
|
},
|
|
2737
2760
|
[a]
|
|
2738
|
-
),
|
|
2761
|
+
), m = $(
|
|
2739
2762
|
async (p) => {
|
|
2740
|
-
|
|
2763
|
+
l(!0), u(null), d(null);
|
|
2741
2764
|
try {
|
|
2742
|
-
const
|
|
2743
|
-
return
|
|
2744
|
-
} catch (
|
|
2745
|
-
return u(
|
|
2765
|
+
const g = await a.auth.uploadAvatar(p);
|
|
2766
|
+
return d("Avatar updated"), g;
|
|
2767
|
+
} catch (g) {
|
|
2768
|
+
return u(g instanceof Error ? g.message : "Failed to upload avatar"), null;
|
|
2746
2769
|
} finally {
|
|
2747
|
-
|
|
2770
|
+
l(!1);
|
|
2748
2771
|
}
|
|
2749
2772
|
},
|
|
2750
2773
|
[a]
|
|
2751
2774
|
);
|
|
2752
|
-
return { user:
|
|
2775
|
+
return { user: r, updateProfile: i, uploadAvatar: m, changePassword: o, isLoading: s, error: n, success: c, setError: u, setSuccess: d };
|
|
2753
2776
|
}
|
|
2754
|
-
const ia = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z" fill="#4285F4"/><path d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z" fill="#34A853"/><path d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z" fill="#FBBC05"/><path d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z" fill="#EA4335"/></svg>', la = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z" fill="currentColor"/></svg>',
|
|
2777
|
+
const ia = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z" fill="#4285F4"/><path d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z" fill="#34A853"/><path d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z" fill="#FBBC05"/><path d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z" fill="#EA4335"/></svg>', la = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z" fill="currentColor"/></svg>', S = {
|
|
2755
2778
|
close: "close",
|
|
2756
2779
|
person: "person",
|
|
2757
2780
|
logout: "logout",
|
|
@@ -2769,6 +2792,7 @@ const ia = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d=
|
|
|
2769
2792
|
security: "security",
|
|
2770
2793
|
errorOutline: "error_outline",
|
|
2771
2794
|
info: "info",
|
|
2795
|
+
arrowBack: "arrow_back",
|
|
2772
2796
|
arrowForward: "arrow_forward",
|
|
2773
2797
|
verified: "verified",
|
|
2774
2798
|
token: "token",
|
|
@@ -2784,49 +2808,49 @@ const ia = '<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d=
|
|
|
2784
2808
|
send: "send",
|
|
2785
2809
|
personRemove: "person_remove"
|
|
2786
2810
|
};
|
|
2787
|
-
function
|
|
2788
|
-
const { appearance:
|
|
2789
|
-
async (
|
|
2790
|
-
if (
|
|
2791
|
-
await
|
|
2811
|
+
function oe({ appearance: a, signUpUrl: r, onSignUp: s }) {
|
|
2812
|
+
const { appearance: l, settings: n } = D(), { signIn: u, signInWithOAuth: c, submitMfaCode: d, isLoading: i, error: o, setError: m } = na(), p = a ?? l, [g, v] = h(""), [x, y] = h(""), [P, N] = h(!1), [E, C] = h(!1), [f, O] = h(""), [I, F] = h(["", "", "", "", "", ""]), A = W([]), b = $(
|
|
2813
|
+
async (L) => {
|
|
2814
|
+
if (L.preventDefault(), E) {
|
|
2815
|
+
await d(f, I.join(""));
|
|
2792
2816
|
return;
|
|
2793
2817
|
}
|
|
2794
|
-
const
|
|
2795
|
-
|
|
2818
|
+
const k = await u(g, x);
|
|
2819
|
+
k && va(k) && (O(k.mfaToken), C(!0), m(null));
|
|
2796
2820
|
},
|
|
2797
|
-
[
|
|
2798
|
-
),
|
|
2799
|
-
async (
|
|
2800
|
-
await
|
|
2821
|
+
[g, x, E, f, I, u, d, m]
|
|
2822
|
+
), w = $(
|
|
2823
|
+
async (L) => {
|
|
2824
|
+
await c(L);
|
|
2801
2825
|
},
|
|
2802
|
-
[
|
|
2803
|
-
),
|
|
2804
|
-
var
|
|
2805
|
-
if (!/^\d*$/.test(
|
|
2806
|
-
const
|
|
2807
|
-
|
|
2826
|
+
[c]
|
|
2827
|
+
), B = $((L, k) => {
|
|
2828
|
+
var _;
|
|
2829
|
+
if (!/^\d*$/.test(k)) return;
|
|
2830
|
+
const T = k.slice(-1);
|
|
2831
|
+
F((K) => {
|
|
2808
2832
|
const J = [...K];
|
|
2809
|
-
return J[
|
|
2810
|
-
}),
|
|
2811
|
-
}, []),
|
|
2812
|
-
var
|
|
2813
|
-
|
|
2814
|
-
}, [
|
|
2815
|
-
return /* @__PURE__ */ e(
|
|
2833
|
+
return J[L] = T, J;
|
|
2834
|
+
}), T && L < 5 && ((_ = A.current[L + 1]) == null || _.focus());
|
|
2835
|
+
}, []), z = $((L, k) => {
|
|
2836
|
+
var T;
|
|
2837
|
+
k.key === "Backspace" && !I[L] && L > 0 && ((T = A.current[L - 1]) == null || T.focus());
|
|
2838
|
+
}, [I]), M = (n == null ? void 0 : n.googleEnabled) || (n == null ? void 0 : n.githubEnabled);
|
|
2839
|
+
return /* @__PURE__ */ e(j, { appearance: p, children: /* @__PURE__ */ e("div", { className: "ss-auth-card", children: /* @__PURE__ */ t("div", { className: "ss-auth-card-body", children: [
|
|
2816
2840
|
/* @__PURE__ */ t("div", { className: "ss-auth-header", children: [
|
|
2817
|
-
/* @__PURE__ */ e("div", { className: "ss-auth-brand-icon", children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
2841
|
+
/* @__PURE__ */ e("div", { className: "ss-auth-brand-icon", children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.token }) }),
|
|
2818
2842
|
/* @__PURE__ */ e("h1", { className: "ss-auth-title", children: "Sign in to your account" }),
|
|
2819
2843
|
/* @__PURE__ */ e("p", { className: "ss-auth-subtitle", children: "Welcome back to your workspace" })
|
|
2820
2844
|
] }),
|
|
2821
|
-
!
|
|
2845
|
+
!E && M && /* @__PURE__ */ t(H, { children: [
|
|
2822
2846
|
/* @__PURE__ */ t("div", { className: "ss-auth-oauth-grid", children: [
|
|
2823
2847
|
(n == null ? void 0 : n.googleEnabled) && /* @__PURE__ */ t(
|
|
2824
2848
|
"button",
|
|
2825
2849
|
{
|
|
2826
2850
|
type: "button",
|
|
2827
2851
|
className: "ss-auth-btn-social",
|
|
2828
|
-
onClick: () =>
|
|
2829
|
-
disabled:
|
|
2852
|
+
onClick: () => w("google"),
|
|
2853
|
+
disabled: i,
|
|
2830
2854
|
children: [
|
|
2831
2855
|
/* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: ia } }),
|
|
2832
2856
|
"Google"
|
|
@@ -2838,8 +2862,8 @@ function re({ appearance: a, signUpUrl: s, onSignUp: r }) {
|
|
|
2838
2862
|
{
|
|
2839
2863
|
type: "button",
|
|
2840
2864
|
className: "ss-auth-btn-social",
|
|
2841
|
-
onClick: () =>
|
|
2842
|
-
disabled:
|
|
2865
|
+
onClick: () => w("github"),
|
|
2866
|
+
disabled: i,
|
|
2843
2867
|
children: [
|
|
2844
2868
|
/* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: la } }),
|
|
2845
2869
|
"GitHub"
|
|
@@ -2849,35 +2873,35 @@ function re({ appearance: a, signUpUrl: s, onSignUp: r }) {
|
|
|
2849
2873
|
] }),
|
|
2850
2874
|
/* @__PURE__ */ e("div", { className: "ss-auth-divider", children: "or continue with" })
|
|
2851
2875
|
] }),
|
|
2852
|
-
|
|
2853
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
2854
|
-
/* @__PURE__ */ e("span", { children:
|
|
2876
|
+
o && /* @__PURE__ */ t("div", { className: "ss-auth-error", children: [
|
|
2877
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.errorOutline }),
|
|
2878
|
+
/* @__PURE__ */ e("span", { children: o })
|
|
2855
2879
|
] }),
|
|
2856
|
-
/* @__PURE__ */ t("form", { onSubmit:
|
|
2857
|
-
|
|
2880
|
+
/* @__PURE__ */ t("form", { onSubmit: b, children: [
|
|
2881
|
+
E ? /* @__PURE__ */ t(H, { children: [
|
|
2858
2882
|
/* @__PURE__ */ e("div", { className: "ss-auth-mfa-divider", children: /* @__PURE__ */ e("span", { children: "Verification Required" }) }),
|
|
2859
2883
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
2860
2884
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "6-Digit Code" }),
|
|
2861
|
-
/* @__PURE__ */ e("div", { className: "ss-auth-mfa-group", children:
|
|
2885
|
+
/* @__PURE__ */ e("div", { className: "ss-auth-mfa-group", children: I.map((L, k) => /* @__PURE__ */ e(
|
|
2862
2886
|
"input",
|
|
2863
2887
|
{
|
|
2864
|
-
ref: (
|
|
2865
|
-
|
|
2888
|
+
ref: (T) => {
|
|
2889
|
+
A.current[k] = T;
|
|
2866
2890
|
},
|
|
2867
2891
|
className: "ss-auth-mfa-digit",
|
|
2868
2892
|
type: "text",
|
|
2869
2893
|
inputMode: "numeric",
|
|
2870
2894
|
maxLength: 1,
|
|
2871
|
-
value:
|
|
2872
|
-
onChange: (
|
|
2873
|
-
onKeyDown: (
|
|
2874
|
-
autoFocus:
|
|
2895
|
+
value: L,
|
|
2896
|
+
onChange: (T) => B(k, T.target.value),
|
|
2897
|
+
onKeyDown: (T) => z(k, T),
|
|
2898
|
+
autoFocus: k === 0
|
|
2875
2899
|
},
|
|
2876
|
-
|
|
2900
|
+
k
|
|
2877
2901
|
)) }),
|
|
2878
2902
|
/* @__PURE__ */ e("p", { className: "ss-auth-mfa-hint", children: "We sent a 6-digit code to your registered email." })
|
|
2879
2903
|
] })
|
|
2880
|
-
] }) : /* @__PURE__ */ t(
|
|
2904
|
+
] }) : /* @__PURE__ */ t(H, { children: [
|
|
2881
2905
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
2882
2906
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", htmlFor: "ss-email", children: "Email Address" }),
|
|
2883
2907
|
/* @__PURE__ */ e(
|
|
@@ -2888,8 +2912,8 @@ function re({ appearance: a, signUpUrl: s, onSignUp: r }) {
|
|
|
2888
2912
|
type: "email",
|
|
2889
2913
|
autoComplete: "email",
|
|
2890
2914
|
placeholder: "name@company.com",
|
|
2891
|
-
value:
|
|
2892
|
-
onChange: (
|
|
2915
|
+
value: g,
|
|
2916
|
+
onChange: (L) => v(L.target.value),
|
|
2893
2917
|
required: !0
|
|
2894
2918
|
}
|
|
2895
2919
|
)
|
|
@@ -2905,11 +2929,11 @@ function re({ appearance: a, signUpUrl: s, onSignUp: r }) {
|
|
|
2905
2929
|
{
|
|
2906
2930
|
id: "ss-password",
|
|
2907
2931
|
className: "ss-auth-input",
|
|
2908
|
-
type:
|
|
2932
|
+
type: P ? "text" : "password",
|
|
2909
2933
|
autoComplete: "current-password",
|
|
2910
2934
|
placeholder: "••••••••",
|
|
2911
|
-
value:
|
|
2912
|
-
onChange: (
|
|
2935
|
+
value: x,
|
|
2936
|
+
onChange: (L) => y(L.target.value),
|
|
2913
2937
|
required: !0
|
|
2914
2938
|
}
|
|
2915
2939
|
),
|
|
@@ -2918,72 +2942,72 @@ function re({ appearance: a, signUpUrl: s, onSignUp: r }) {
|
|
|
2918
2942
|
{
|
|
2919
2943
|
type: "button",
|
|
2920
2944
|
className: "ss-auth-visibility-toggle",
|
|
2921
|
-
onClick: () =>
|
|
2922
|
-
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
2945
|
+
onClick: () => N(!P),
|
|
2946
|
+
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: P ? S.visibilityOff : S.visibility })
|
|
2923
2947
|
}
|
|
2924
2948
|
)
|
|
2925
2949
|
] })
|
|
2926
2950
|
] })
|
|
2927
2951
|
] }),
|
|
2928
|
-
/* @__PURE__ */ t("button", { type: "submit", className: "ss-auth-btn-primary", disabled:
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
!
|
|
2952
|
+
/* @__PURE__ */ t("button", { type: "submit", className: "ss-auth-btn-primary", disabled: i, children: [
|
|
2953
|
+
i && /* @__PURE__ */ e("span", { className: "ss-auth-spinner" }),
|
|
2954
|
+
E ? "Verify" : "Sign in",
|
|
2955
|
+
!i && /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.arrowForward })
|
|
2932
2956
|
] })
|
|
2933
2957
|
] }),
|
|
2934
|
-
|
|
2958
|
+
E ? /* @__PURE__ */ e("div", { className: "ss-auth-footer", children: /* @__PURE__ */ e(
|
|
2935
2959
|
"span",
|
|
2936
2960
|
{
|
|
2937
2961
|
className: "ss-auth-link",
|
|
2938
2962
|
onClick: () => {
|
|
2939
|
-
C(!1),
|
|
2963
|
+
C(!1), F(["", "", "", "", "", ""]), m(null);
|
|
2940
2964
|
},
|
|
2941
2965
|
children: "Back to sign in"
|
|
2942
2966
|
}
|
|
2943
2967
|
) }) : /* @__PURE__ */ t("div", { className: "ss-auth-footer", children: [
|
|
2944
2968
|
"Don't have an account?",
|
|
2945
2969
|
" ",
|
|
2946
|
-
|
|
2970
|
+
s ? /* @__PURE__ */ e("span", { className: "ss-auth-link", onClick: s, children: "Sign up" }) : r ? /* @__PURE__ */ e("a", { className: "ss-auth-link", href: r, children: "Sign up" }) : /* @__PURE__ */ e("span", { className: "ss-auth-link", children: "Sign up" })
|
|
2947
2971
|
] })
|
|
2948
2972
|
] }) }) });
|
|
2949
2973
|
}
|
|
2950
|
-
function
|
|
2951
|
-
const { appearance:
|
|
2952
|
-
async (
|
|
2953
|
-
if (
|
|
2954
|
-
|
|
2974
|
+
function ie({ appearance: a, signInUrl: r, onSignIn: s }) {
|
|
2975
|
+
const { appearance: l, settings: n } = D(), { signUp: u, isLoading: c, error: d, setError: i } = za(), { signInWithOAuth: o } = na(), m = a ?? l, [p, g] = h(""), [v, x] = h(""), [y, P] = h(""), [N, E] = h(!1), [C, f] = h(null), O = $(
|
|
2976
|
+
async (b) => {
|
|
2977
|
+
if (b.preventDefault(), f(null), v !== y) {
|
|
2978
|
+
f("Passwords do not match");
|
|
2955
2979
|
return;
|
|
2956
2980
|
}
|
|
2957
|
-
const
|
|
2958
|
-
if (
|
|
2959
|
-
|
|
2981
|
+
const w = (n == null ? void 0 : n.passwordMinLength) ?? 8;
|
|
2982
|
+
if (v.length < w) {
|
|
2983
|
+
f(`Password must be at least ${w} characters`);
|
|
2960
2984
|
return;
|
|
2961
2985
|
}
|
|
2962
|
-
await u(p,
|
|
2986
|
+
await u(p, v);
|
|
2963
2987
|
},
|
|
2964
|
-
[p,
|
|
2965
|
-
),
|
|
2966
|
-
async (
|
|
2967
|
-
await
|
|
2988
|
+
[p, v, y, n, u]
|
|
2989
|
+
), I = $(
|
|
2990
|
+
async (b) => {
|
|
2991
|
+
await o(b);
|
|
2968
2992
|
},
|
|
2969
|
-
[
|
|
2970
|
-
),
|
|
2971
|
-
return /* @__PURE__ */ e(
|
|
2993
|
+
[o]
|
|
2994
|
+
), F = (n == null ? void 0 : n.googleEnabled) || (n == null ? void 0 : n.githubEnabled), A = C || d;
|
|
2995
|
+
return /* @__PURE__ */ e(j, { appearance: m, children: /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", width: "100%", maxWidth: "520px" }, children: [
|
|
2972
2996
|
/* @__PURE__ */ t("div", { className: "ss-auth-header", children: [
|
|
2973
|
-
/* @__PURE__ */ e("div", { className: "ss-auth-brand-icon-gradient", children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
2997
|
+
/* @__PURE__ */ e("div", { className: "ss-auth-brand-icon-gradient", children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.autoAwesome }) }),
|
|
2974
2998
|
/* @__PURE__ */ e("h1", { className: "ss-auth-title ss-auth-title-lg", children: "Create your account" }),
|
|
2975
2999
|
/* @__PURE__ */ e("p", { className: "ss-auth-subtitle", children: "Join the ecosystem" })
|
|
2976
3000
|
] }),
|
|
2977
3001
|
/* @__PURE__ */ e("div", { className: "ss-auth-card", children: /* @__PURE__ */ t("div", { className: "ss-auth-card-body", children: [
|
|
2978
|
-
|
|
3002
|
+
F && /* @__PURE__ */ t(H, { children: [
|
|
2979
3003
|
/* @__PURE__ */ t("div", { className: "ss-auth-oauth-grid", children: [
|
|
2980
3004
|
(n == null ? void 0 : n.googleEnabled) && /* @__PURE__ */ t(
|
|
2981
3005
|
"button",
|
|
2982
3006
|
{
|
|
2983
3007
|
type: "button",
|
|
2984
3008
|
className: "ss-auth-btn-social",
|
|
2985
|
-
onClick: () =>
|
|
2986
|
-
disabled:
|
|
3009
|
+
onClick: () => I("google"),
|
|
3010
|
+
disabled: c,
|
|
2987
3011
|
children: [
|
|
2988
3012
|
/* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: ia } }),
|
|
2989
3013
|
"Google"
|
|
@@ -2995,8 +3019,8 @@ function ne({ appearance: a, signInUrl: s, onSignIn: r }) {
|
|
|
2995
3019
|
{
|
|
2996
3020
|
type: "button",
|
|
2997
3021
|
className: "ss-auth-btn-social",
|
|
2998
|
-
onClick: () =>
|
|
2999
|
-
disabled:
|
|
3022
|
+
onClick: () => I("github"),
|
|
3023
|
+
disabled: c,
|
|
3000
3024
|
children: [
|
|
3001
3025
|
/* @__PURE__ */ e("span", { dangerouslySetInnerHTML: { __html: la } }),
|
|
3002
3026
|
"GitHub"
|
|
@@ -3006,11 +3030,11 @@ function ne({ appearance: a, signInUrl: s, onSignIn: r }) {
|
|
|
3006
3030
|
] }),
|
|
3007
3031
|
/* @__PURE__ */ e("div", { className: "ss-auth-divider", children: "or sign up with email" })
|
|
3008
3032
|
] }),
|
|
3009
|
-
|
|
3010
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3011
|
-
/* @__PURE__ */ e("span", { children:
|
|
3033
|
+
A && /* @__PURE__ */ t("div", { className: "ss-auth-error", children: [
|
|
3034
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.errorOutline }),
|
|
3035
|
+
/* @__PURE__ */ e("span", { children: A })
|
|
3012
3036
|
] }),
|
|
3013
|
-
/* @__PURE__ */ t("form", { onSubmit:
|
|
3037
|
+
/* @__PURE__ */ t("form", { onSubmit: O, children: [
|
|
3014
3038
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
3015
3039
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", htmlFor: "ss-signup-email", children: "Email" }),
|
|
3016
3040
|
/* @__PURE__ */ e(
|
|
@@ -3022,7 +3046,7 @@ function ne({ appearance: a, signInUrl: s, onSignIn: r }) {
|
|
|
3022
3046
|
autoComplete: "email",
|
|
3023
3047
|
placeholder: "name@company.com",
|
|
3024
3048
|
value: p,
|
|
3025
|
-
onChange: (
|
|
3049
|
+
onChange: (b) => g(b.target.value),
|
|
3026
3050
|
required: !0
|
|
3027
3051
|
}
|
|
3028
3052
|
)
|
|
@@ -3035,12 +3059,12 @@ function ne({ appearance: a, signInUrl: s, onSignIn: r }) {
|
|
|
3035
3059
|
{
|
|
3036
3060
|
id: "ss-signup-password",
|
|
3037
3061
|
className: "ss-auth-input",
|
|
3038
|
-
type:
|
|
3062
|
+
type: N ? "text" : "password",
|
|
3039
3063
|
autoComplete: "new-password",
|
|
3040
3064
|
placeholder: "••••••••",
|
|
3041
|
-
value:
|
|
3042
|
-
onChange: (
|
|
3043
|
-
|
|
3065
|
+
value: v,
|
|
3066
|
+
onChange: (b) => {
|
|
3067
|
+
x(b.target.value), f(null);
|
|
3044
3068
|
},
|
|
3045
3069
|
required: !0
|
|
3046
3070
|
}
|
|
@@ -3050,8 +3074,8 @@ function ne({ appearance: a, signInUrl: s, onSignIn: r }) {
|
|
|
3050
3074
|
{
|
|
3051
3075
|
type: "button",
|
|
3052
3076
|
className: "ss-auth-visibility-toggle",
|
|
3053
|
-
onClick: () =>
|
|
3054
|
-
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3077
|
+
onClick: () => E(!N),
|
|
3078
|
+
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: N ? S.visibilityOff : S.visibility })
|
|
3055
3079
|
}
|
|
3056
3080
|
)
|
|
3057
3081
|
] })
|
|
@@ -3067,86 +3091,85 @@ function ne({ appearance: a, signInUrl: s, onSignIn: r }) {
|
|
|
3067
3091
|
autoComplete: "new-password",
|
|
3068
3092
|
placeholder: "••••••••",
|
|
3069
3093
|
value: y,
|
|
3070
|
-
onChange: (
|
|
3071
|
-
|
|
3094
|
+
onChange: (b) => {
|
|
3095
|
+
P(b.target.value), f(null);
|
|
3072
3096
|
},
|
|
3073
3097
|
required: !0
|
|
3074
3098
|
}
|
|
3075
3099
|
)
|
|
3076
3100
|
] }),
|
|
3077
|
-
/* @__PURE__ */ t("button", { type: "submit", className: "ss-auth-btn-primary", disabled:
|
|
3078
|
-
|
|
3101
|
+
/* @__PURE__ */ t("button", { type: "submit", className: "ss-auth-btn-primary", disabled: c, children: [
|
|
3102
|
+
c && /* @__PURE__ */ e("span", { className: "ss-auth-spinner" }),
|
|
3079
3103
|
"Sign up",
|
|
3080
|
-
!
|
|
3104
|
+
!c && /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.arrowForward })
|
|
3081
3105
|
] })
|
|
3082
3106
|
] }),
|
|
3083
3107
|
/* @__PURE__ */ t("div", { className: "ss-auth-footer", children: [
|
|
3084
3108
|
"Already have an account?",
|
|
3085
3109
|
" ",
|
|
3086
|
-
|
|
3110
|
+
s ? /* @__PURE__ */ e("span", { className: "ss-auth-link", onClick: s, children: "Sign in" }) : r ? /* @__PURE__ */ e("a", { className: "ss-auth-link", href: r, children: "Sign in" }) : /* @__PURE__ */ e("span", { className: "ss-auth-link", children: "Sign in" })
|
|
3087
3111
|
] })
|
|
3088
3112
|
] }) })
|
|
3089
3113
|
] }) });
|
|
3090
3114
|
}
|
|
3091
|
-
const
|
|
3092
|
-
|
|
3093
|
-
const o = _(null), n = _(null), [u, i] = g(1), [l, d] = g({ x: 0, y: 0 }), [c, f] = g(!1), p = _({ x: 0, y: 0, ox: 0, oy: 0 }), [m, b] = g(!1);
|
|
3115
|
+
const V = 320, q = 128, Oa = ba(function({ file: r, onCrop: s, onCancel: l }, n) {
|
|
3116
|
+
const u = W(null), c = W(null), [d, i] = h(1), [o, m] = h({ x: 0, y: 0 }), [p, g] = h(!1), v = W({ x: 0, y: 0, ox: 0, oy: 0 }), [x, y] = h(!1);
|
|
3094
3117
|
U(() => {
|
|
3095
|
-
const
|
|
3096
|
-
return
|
|
3097
|
-
|
|
3098
|
-
},
|
|
3099
|
-
}, [
|
|
3100
|
-
if (!
|
|
3101
|
-
const
|
|
3102
|
-
if (!
|
|
3103
|
-
const
|
|
3104
|
-
|
|
3105
|
-
const
|
|
3106
|
-
|
|
3107
|
-
}, [
|
|
3108
|
-
const
|
|
3109
|
-
(
|
|
3110
|
-
|
|
3118
|
+
const f = new Image(), O = URL.createObjectURL(r);
|
|
3119
|
+
return f.onload = () => {
|
|
3120
|
+
c.current = f, y(!0), m({ x: 0, y: 0 }), i(1);
|
|
3121
|
+
}, f.src = O, () => URL.revokeObjectURL(O);
|
|
3122
|
+
}, [r]), U(() => {
|
|
3123
|
+
if (!x || !c.current || !u.current) return;
|
|
3124
|
+
const f = u.current.getContext("2d");
|
|
3125
|
+
if (!f) return;
|
|
3126
|
+
const O = c.current;
|
|
3127
|
+
f.clearRect(0, 0, V, V), f.fillStyle = "#111", f.fillRect(0, 0, V, V);
|
|
3128
|
+
const I = Math.max(V / O.width, V / O.height) * d, F = O.width * I, A = O.height * I, b = (V - F) / 2 + o.x, w = (V - A) / 2 + o.y;
|
|
3129
|
+
f.save(), f.beginPath(), f.arc(V / 2, V / 2, q, 0, Math.PI * 2), f.clip(), f.drawImage(O, b, w, F, A), f.restore(), f.save(), f.fillStyle = "rgba(0, 0, 0, 0.6)", f.fillRect(0, 0, V, V), f.globalCompositeOperation = "destination-out", f.beginPath(), f.arc(V / 2, V / 2, q, 0, Math.PI * 2), f.fill(), f.restore(), f.save(), f.beginPath(), f.arc(V / 2, V / 2, q, 0, Math.PI * 2), f.clip(), f.drawImage(O, b, w, F, A), f.restore(), f.strokeStyle = "rgba(255, 255, 255, 0.4)", f.lineWidth = 2, f.beginPath(), f.arc(V / 2, V / 2, q, 0, Math.PI * 2), f.stroke();
|
|
3130
|
+
}, [d, o, x]);
|
|
3131
|
+
const P = $(
|
|
3132
|
+
(f) => {
|
|
3133
|
+
g(!0), v.current = { x: f.clientX, y: f.clientY, ox: o.x, oy: o.y }, f.target.setPointerCapture(f.pointerId);
|
|
3111
3134
|
},
|
|
3112
|
-
[
|
|
3113
|
-
),
|
|
3114
|
-
(
|
|
3115
|
-
|
|
3116
|
-
x:
|
|
3117
|
-
y:
|
|
3135
|
+
[o]
|
|
3136
|
+
), N = $(
|
|
3137
|
+
(f) => {
|
|
3138
|
+
p && m({
|
|
3139
|
+
x: v.current.ox + (f.clientX - v.current.x),
|
|
3140
|
+
y: v.current.oy + (f.clientY - v.current.y)
|
|
3118
3141
|
});
|
|
3119
3142
|
},
|
|
3120
|
-
[
|
|
3121
|
-
),
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
S && s(S);
|
|
3143
|
+
[p]
|
|
3144
|
+
), E = $(() => g(!1), []), C = $(() => {
|
|
3145
|
+
if (!c.current) return;
|
|
3146
|
+
const f = document.createElement("canvas"), O = q * 2;
|
|
3147
|
+
f.width = O, f.height = O;
|
|
3148
|
+
const I = f.getContext("2d");
|
|
3149
|
+
if (!I) return;
|
|
3150
|
+
const F = c.current, A = Math.max(V / F.width, V / F.height) * d, b = F.width * A, w = F.height * A, B = (V - b) / 2 + o.x - (V / 2 - q), z = (V - w) / 2 + o.y - (V / 2 - q);
|
|
3151
|
+
I.beginPath(), I.arc(q, q, q, 0, Math.PI * 2), I.clip(), I.drawImage(F, B, z, b, w), f.toBlob((M) => {
|
|
3152
|
+
M && s(M);
|
|
3131
3153
|
}, "image/png");
|
|
3132
|
-
}, [
|
|
3154
|
+
}, [d, o, s]);
|
|
3155
|
+
return xa(n, () => ({ triggerCrop: () => C() }), [C]), /* @__PURE__ */ t("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", gap: "24px" }, children: [
|
|
3133
3156
|
/* @__PURE__ */ t("div", { className: "ss-auth-crop-area", children: [
|
|
3134
3157
|
/* @__PURE__ */ e(
|
|
3135
3158
|
"canvas",
|
|
3136
3159
|
{
|
|
3137
|
-
ref:
|
|
3138
|
-
width:
|
|
3139
|
-
height:
|
|
3140
|
-
style: { cursor:
|
|
3141
|
-
onPointerDown:
|
|
3142
|
-
onPointerMove:
|
|
3143
|
-
onPointerUp:
|
|
3160
|
+
ref: u,
|
|
3161
|
+
width: V,
|
|
3162
|
+
height: V,
|
|
3163
|
+
style: { cursor: p ? "grabbing" : "grab", width: "100%", height: "100%" },
|
|
3164
|
+
onPointerDown: P,
|
|
3165
|
+
onPointerMove: N,
|
|
3166
|
+
onPointerUp: E
|
|
3144
3167
|
}
|
|
3145
3168
|
),
|
|
3146
3169
|
/* @__PURE__ */ e("div", { className: "ss-auth-crop-size-badge", children: "256 x 256 px" })
|
|
3147
3170
|
] }),
|
|
3148
3171
|
/* @__PURE__ */ t("div", { className: "ss-auth-zoom-control", style: { width: "100%", maxWidth: "280px" }, children: [
|
|
3149
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3172
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.zoomOut }),
|
|
3150
3173
|
/* @__PURE__ */ e(
|
|
3151
3174
|
"input",
|
|
3152
3175
|
{
|
|
@@ -3154,158 +3177,158 @@ function za({ file: a, onCrop: s, onCancel: r }) {
|
|
|
3154
3177
|
min: "1",
|
|
3155
3178
|
max: "3",
|
|
3156
3179
|
step: "0.01",
|
|
3157
|
-
value:
|
|
3158
|
-
onChange: (
|
|
3180
|
+
value: d,
|
|
3181
|
+
onChange: (f) => i(parseFloat(f.target.value)),
|
|
3159
3182
|
className: "ss-auth-zoom-slider"
|
|
3160
3183
|
}
|
|
3161
3184
|
),
|
|
3162
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3185
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.zoomIn })
|
|
3163
3186
|
] })
|
|
3164
3187
|
] });
|
|
3165
|
-
}
|
|
3166
|
-
function ca({ onUpload: a, onClose:
|
|
3167
|
-
const [
|
|
3168
|
-
if (!
|
|
3169
|
-
|
|
3188
|
+
});
|
|
3189
|
+
function ca({ onUpload: a, onClose: r, isLoading: s }) {
|
|
3190
|
+
const [l, n] = h(null), [u, c] = h(!1), [d, i] = h(null), o = W(null), m = W(null), p = $((x) => {
|
|
3191
|
+
if (!x.type.startsWith("image/")) {
|
|
3192
|
+
i("Please select an image file");
|
|
3170
3193
|
return;
|
|
3171
3194
|
}
|
|
3172
|
-
if (
|
|
3173
|
-
|
|
3195
|
+
if (x.size > 5 * 1024 * 1024) {
|
|
3196
|
+
i("Image must be smaller than 5 MB");
|
|
3174
3197
|
return;
|
|
3175
3198
|
}
|
|
3176
|
-
|
|
3177
|
-
}, []),
|
|
3178
|
-
(
|
|
3179
|
-
|
|
3180
|
-
const
|
|
3181
|
-
|
|
3199
|
+
i(null), n(x);
|
|
3200
|
+
}, []), g = $(
|
|
3201
|
+
(x) => {
|
|
3202
|
+
x.preventDefault(), c(!1);
|
|
3203
|
+
const y = x.dataTransfer.files[0];
|
|
3204
|
+
y && p(y);
|
|
3182
3205
|
},
|
|
3183
|
-
[
|
|
3184
|
-
),
|
|
3185
|
-
async (
|
|
3186
|
-
await a(
|
|
3206
|
+
[p]
|
|
3207
|
+
), v = $(
|
|
3208
|
+
async (x) => {
|
|
3209
|
+
await a(x);
|
|
3187
3210
|
},
|
|
3188
3211
|
[a]
|
|
3189
3212
|
);
|
|
3190
|
-
return /* @__PURE__ */ e("div", { className: "ss-auth-modal-overlay", onClick: (
|
|
3191
|
-
|
|
3192
|
-
}, children: /* @__PURE__ */ t("div", { className: "ss-auth-modal
|
|
3213
|
+
return /* @__PURE__ */ e("div", { className: "ss-auth-modal-overlay", onClick: (x) => {
|
|
3214
|
+
x.target === x.currentTarget && r();
|
|
3215
|
+
}, children: /* @__PURE__ */ t("div", { className: "ss-auth-modal", style: { maxWidth: "480px" }, children: [
|
|
3193
3216
|
/* @__PURE__ */ t("div", { className: "ss-auth-modal-header", children: [
|
|
3194
3217
|
/* @__PURE__ */ e("h2", { children: "Upload avatar" }),
|
|
3195
|
-
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-modal-close", onClick:
|
|
3218
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-modal-close", onClick: r, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.close }) })
|
|
3196
3219
|
] }),
|
|
3197
3220
|
/* @__PURE__ */ t("div", { className: "ss-auth-modal-body", children: [
|
|
3198
|
-
|
|
3199
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3200
|
-
/* @__PURE__ */ e("span", { children:
|
|
3221
|
+
d && /* @__PURE__ */ t("div", { className: "ss-auth-error", style: { marginBottom: "16px" }, children: [
|
|
3222
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.errorOutline }),
|
|
3223
|
+
/* @__PURE__ */ e("span", { children: d })
|
|
3201
3224
|
] }),
|
|
3202
|
-
/* @__PURE__ */ t(
|
|
3203
|
-
/* @__PURE__ */ e(
|
|
3204
|
-
|
|
3225
|
+
l ? /* @__PURE__ */ t(H, { children: [
|
|
3226
|
+
/* @__PURE__ */ e(Oa, { ref: m, file: l, onCrop: v, onCancel: () => n(null) }),
|
|
3227
|
+
/* @__PURE__ */ e("div", { style: { textAlign: "center", marginTop: "8px" }, children: /* @__PURE__ */ t(
|
|
3228
|
+
"button",
|
|
3205
3229
|
{
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
gap: "8px",
|
|
3213
|
-
width: "100%",
|
|
3214
|
-
aspectRatio: "1"
|
|
3230
|
+
type: "button",
|
|
3231
|
+
className: "ss-auth-btn-ghost",
|
|
3232
|
+
style: { fontSize: "13px" },
|
|
3233
|
+
onClick: () => {
|
|
3234
|
+
var x;
|
|
3235
|
+
return (x = o.current) == null ? void 0 : x.click();
|
|
3215
3236
|
},
|
|
3216
3237
|
children: [
|
|
3217
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "
|
|
3218
|
-
|
|
3238
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "16px" }, children: S.image }),
|
|
3239
|
+
"Change image"
|
|
3219
3240
|
]
|
|
3220
3241
|
}
|
|
3221
|
-
) })
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
/* @__PURE__ */ e("span", { children: "Your profile photo will be visible to all members of your organization." })
|
|
3265
|
-
] })
|
|
3266
|
-
] })
|
|
3242
|
+
) })
|
|
3243
|
+
] }) : /* @__PURE__ */ t(
|
|
3244
|
+
"div",
|
|
3245
|
+
{
|
|
3246
|
+
className: `ss-auth-dropzone${u ? " ss-auth-dropzone-active" : ""}`,
|
|
3247
|
+
onDragOver: (x) => {
|
|
3248
|
+
x.preventDefault(), c(!0);
|
|
3249
|
+
},
|
|
3250
|
+
onDragLeave: () => c(!1),
|
|
3251
|
+
onDrop: g,
|
|
3252
|
+
onClick: () => {
|
|
3253
|
+
var x;
|
|
3254
|
+
return (x = o.current) == null ? void 0 : x.click();
|
|
3255
|
+
},
|
|
3256
|
+
style: { minHeight: "240px" },
|
|
3257
|
+
children: [
|
|
3258
|
+
/* @__PURE__ */ e("div", { className: "ss-auth-dropzone-icon", children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.cloudUpload }) }),
|
|
3259
|
+
/* @__PURE__ */ e("span", { className: "ss-auth-dropzone-title", children: "Drag and drop" }),
|
|
3260
|
+
/* @__PURE__ */ t("span", { className: "ss-auth-dropzone-desc", children: [
|
|
3261
|
+
"JPG, PNG or WEBP",
|
|
3262
|
+
/* @__PURE__ */ e("br", {}),
|
|
3263
|
+
"Max file size 5 MB"
|
|
3264
|
+
] }),
|
|
3265
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-dropzone-btn", children: "Choose File" })
|
|
3266
|
+
]
|
|
3267
|
+
}
|
|
3268
|
+
),
|
|
3269
|
+
/* @__PURE__ */ e(
|
|
3270
|
+
"input",
|
|
3271
|
+
{
|
|
3272
|
+
ref: o,
|
|
3273
|
+
type: "file",
|
|
3274
|
+
accept: "image/*",
|
|
3275
|
+
style: { display: "none" },
|
|
3276
|
+
onChange: (x) => {
|
|
3277
|
+
var y;
|
|
3278
|
+
(y = x.target.files) != null && y[0] && p(x.target.files[0]);
|
|
3279
|
+
}
|
|
3280
|
+
}
|
|
3281
|
+
),
|
|
3282
|
+
/* @__PURE__ */ t("div", { className: "ss-auth-info-box", style: { marginTop: "16px" }, children: [
|
|
3283
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.info }),
|
|
3284
|
+
/* @__PURE__ */ e("span", { children: "Your profile photo will be visible to all members of your organization." })
|
|
3267
3285
|
] })
|
|
3268
3286
|
] }),
|
|
3269
3287
|
/* @__PURE__ */ t("div", { className: "ss-auth-modal-footer", children: [
|
|
3270
|
-
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-btn-ghost", onClick:
|
|
3288
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-btn-ghost", onClick: r, children: "Cancel" }),
|
|
3271
3289
|
/* @__PURE__ */ t(
|
|
3272
3290
|
"button",
|
|
3273
3291
|
{
|
|
3274
3292
|
type: "button",
|
|
3275
3293
|
className: "ss-auth-btn-primary ss-auth-btn-sm",
|
|
3276
3294
|
onClick: () => {
|
|
3295
|
+
var x;
|
|
3296
|
+
return (x = m.current) == null ? void 0 : x.triggerCrop();
|
|
3277
3297
|
},
|
|
3278
|
-
disabled: !
|
|
3298
|
+
disabled: !l || s,
|
|
3279
3299
|
style: { width: "auto" },
|
|
3280
3300
|
children: [
|
|
3281
|
-
|
|
3301
|
+
s && /* @__PURE__ */ e("span", { className: "ss-auth-spinner" }),
|
|
3282
3302
|
"Save Profile",
|
|
3283
|
-
!
|
|
3303
|
+
!s && /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.check })
|
|
3284
3304
|
]
|
|
3285
3305
|
}
|
|
3286
3306
|
)
|
|
3287
3307
|
] })
|
|
3288
3308
|
] }) });
|
|
3289
3309
|
}
|
|
3290
|
-
function
|
|
3291
|
-
const [
|
|
3292
|
-
{ key: "profile", label: "Profile", icon:
|
|
3293
|
-
{ key: "organization", label: "Organization", icon:
|
|
3294
|
-
{ key: "people", label: "People", icon:
|
|
3295
|
-
{ key: "billing", label: "Billing", icon:
|
|
3310
|
+
function Ea({ onClose: a, afterDeleteAccountUrl: r, defaultTab: s = "profile", onOrgDeleted: l, onOrgUpdated: n }) {
|
|
3311
|
+
const [u, c] = h(s), d = [
|
|
3312
|
+
{ key: "profile", label: "Profile", icon: S.person },
|
|
3313
|
+
{ key: "organization", label: "Organization", icon: S.corporateFare },
|
|
3314
|
+
{ key: "people", label: "People", icon: S.group },
|
|
3315
|
+
{ key: "billing", label: "Billing", icon: S.creditCard }
|
|
3296
3316
|
];
|
|
3297
3317
|
return /* @__PURE__ */ t("div", { className: "ss-auth-settings-page", children: [
|
|
3298
3318
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-header", children: [
|
|
3299
|
-
/* @__PURE__ */
|
|
3300
|
-
|
|
3319
|
+
/* @__PURE__ */ t("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
|
|
3320
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-settings-back", onClick: a, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.arrowBack }) }),
|
|
3321
|
+
/* @__PURE__ */ e("h2", { children: "Settings" })
|
|
3322
|
+
] }),
|
|
3323
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-modal-close", onClick: a, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.close }) })
|
|
3301
3324
|
] }),
|
|
3302
3325
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-layout", children: [
|
|
3303
|
-
/* @__PURE__ */ e("nav", { className: "ss-auth-settings-nav", children:
|
|
3326
|
+
/* @__PURE__ */ e("nav", { className: "ss-auth-settings-nav", children: d.map((i) => /* @__PURE__ */ t(
|
|
3304
3327
|
"button",
|
|
3305
3328
|
{
|
|
3306
3329
|
type: "button",
|
|
3307
|
-
className: `ss-auth-settings-nav-item${
|
|
3308
|
-
onClick: () =>
|
|
3330
|
+
className: `ss-auth-settings-nav-item${u === i.key ? " ss-auth-settings-nav-item-active" : ""}`,
|
|
3331
|
+
onClick: () => c(i.key),
|
|
3309
3332
|
children: [
|
|
3310
3333
|
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: i.icon }),
|
|
3311
3334
|
i.label
|
|
@@ -3314,48 +3337,48 @@ function Pa({ onClose: a, afterDeleteAccountUrl: s, defaultTab: r = "profile" })
|
|
|
3314
3337
|
i.key
|
|
3315
3338
|
)) }),
|
|
3316
3339
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-content", children: [
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3340
|
+
u === "profile" && /* @__PURE__ */ e(Ia, { afterDeleteAccountUrl: r }),
|
|
3341
|
+
u === "organization" && /* @__PURE__ */ e(Ba, { onOrgDeleted: l, onOrgUpdated: n }),
|
|
3342
|
+
u === "people" && /* @__PURE__ */ e(Fa, {}),
|
|
3343
|
+
u === "billing" && /* @__PURE__ */ e(La, {})
|
|
3321
3344
|
] })
|
|
3322
3345
|
] })
|
|
3323
3346
|
] });
|
|
3324
3347
|
}
|
|
3325
|
-
function
|
|
3326
|
-
const { user:
|
|
3348
|
+
function Ia({ afterDeleteAccountUrl: a }) {
|
|
3349
|
+
const { user: r, updateProfile: s, uploadAvatar: l, changePassword: n, isLoading: u, error: c, success: d, setError: i, setSuccess: o } = oa(), { signOut: m } = sa(), { deleteAccount: p, isLoading: g, error: v, setError: x } = Pa(), [y, P] = h((r == null ? void 0 : r.name) ?? ""), [N, E] = h((r == null ? void 0 : r.avatarUrl) ?? ""), [C, f] = h(!1), [O, I] = h(""), [F, A] = h(""), [b, w] = h(""), [B, z] = h(null), [M, L] = h(!1), [k, T] = h(""), _ = $(
|
|
3327
3350
|
async (R) => {
|
|
3328
|
-
R.preventDefault(),
|
|
3351
|
+
R.preventDefault(), i(null), o(null), await s({ name: y, avatarUrl: N || void 0 });
|
|
3329
3352
|
},
|
|
3330
|
-
[y,
|
|
3331
|
-
), K =
|
|
3353
|
+
[y, N, s, i, o]
|
|
3354
|
+
), K = $(
|
|
3332
3355
|
async (R) => {
|
|
3333
|
-
const X = await
|
|
3334
|
-
X && (
|
|
3356
|
+
const X = await l(R);
|
|
3357
|
+
X && (E(X.avatarUrl), f(!1));
|
|
3335
3358
|
},
|
|
3336
|
-
[
|
|
3337
|
-
), J =
|
|
3359
|
+
[l]
|
|
3360
|
+
), J = $(
|
|
3338
3361
|
async (R) => {
|
|
3339
|
-
if (R.preventDefault(),
|
|
3340
|
-
|
|
3362
|
+
if (R.preventDefault(), z(null), i(null), o(null), F !== b) {
|
|
3363
|
+
z("Passwords do not match");
|
|
3341
3364
|
return;
|
|
3342
3365
|
}
|
|
3343
|
-
if (
|
|
3344
|
-
|
|
3366
|
+
if (F.length < 8) {
|
|
3367
|
+
z("Password must be at least 8 characters");
|
|
3345
3368
|
return;
|
|
3346
3369
|
}
|
|
3347
|
-
await n(
|
|
3370
|
+
await n(O, F) && (I(""), A(""), w(""));
|
|
3348
3371
|
},
|
|
3349
|
-
[
|
|
3350
|
-
), ua =
|
|
3351
|
-
await p() && (await
|
|
3352
|
-
}, [p,
|
|
3353
|
-
return /* @__PURE__ */ t(
|
|
3372
|
+
[O, F, b, n, i, o]
|
|
3373
|
+
), ua = $(async () => {
|
|
3374
|
+
await p() && (await m(), a && (window.location.href = a));
|
|
3375
|
+
}, [p, m, a]), pa = (r == null ? void 0 : r.provider) === "email", ha = k === (r == null ? void 0 : r.email), ga = ((r == null ? void 0 : r.name) || (r == null ? void 0 : r.email) || "?").charAt(0).toUpperCase();
|
|
3376
|
+
return /* @__PURE__ */ t(H, { children: [
|
|
3354
3377
|
/* @__PURE__ */ e("h3", { children: "Profile" }),
|
|
3355
3378
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-card", children: [
|
|
3356
3379
|
/* @__PURE__ */ t("div", { className: "ss-auth-profile-header", style: { border: "none", background: "none", padding: 0, marginBottom: 16 }, children: [
|
|
3357
|
-
/* @__PURE__ */ t("div", { className: "ss-auth-avatar-lg", onClick: () =>
|
|
3358
|
-
|
|
3380
|
+
/* @__PURE__ */ t("div", { className: "ss-auth-avatar-lg", onClick: () => f(!0), children: [
|
|
3381
|
+
N ? /* @__PURE__ */ e("img", { src: N, alt: "" }) : /* @__PURE__ */ e("div", { style: {
|
|
3359
3382
|
width: "100%",
|
|
3360
3383
|
height: "100%",
|
|
3361
3384
|
display: "flex",
|
|
@@ -3366,30 +3389,30 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3366
3389
|
opacity: 0.4
|
|
3367
3390
|
}, children: ga }),
|
|
3368
3391
|
/* @__PURE__ */ t("div", { className: "ss-auth-avatar-overlay", children: [
|
|
3369
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3392
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.camera }),
|
|
3370
3393
|
/* @__PURE__ */ e("span", { children: "Edit" })
|
|
3371
3394
|
] })
|
|
3372
3395
|
] }),
|
|
3373
3396
|
/* @__PURE__ */ t("div", { className: "ss-auth-profile-info", children: [
|
|
3374
3397
|
/* @__PURE__ */ t("h2", { className: "ss-auth-profile-name", children: [
|
|
3375
|
-
(
|
|
3376
|
-
(
|
|
3377
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "12px", fontVariationSettings: "'FILL' 1" }, children:
|
|
3398
|
+
(r == null ? void 0 : r.name) || "Unnamed User",
|
|
3399
|
+
(r == null ? void 0 : r.emailVerified) && /* @__PURE__ */ t("span", { className: "ss-auth-badge ss-auth-badge-success", children: [
|
|
3400
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "12px", fontVariationSettings: "'FILL' 1" }, children: S.verified }),
|
|
3378
3401
|
"Verified"
|
|
3379
3402
|
] })
|
|
3380
3403
|
] }),
|
|
3381
|
-
/* @__PURE__ */ e("p", { className: "ss-auth-profile-desc", children:
|
|
3404
|
+
/* @__PURE__ */ e("p", { className: "ss-auth-profile-desc", children: r == null ? void 0 : r.email })
|
|
3382
3405
|
] })
|
|
3383
3406
|
] }),
|
|
3384
|
-
|
|
3385
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3386
|
-
/* @__PURE__ */ e("span", { children:
|
|
3407
|
+
c && /* @__PURE__ */ t("div", { className: "ss-auth-error", children: [
|
|
3408
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.errorOutline }),
|
|
3409
|
+
/* @__PURE__ */ e("span", { children: c })
|
|
3387
3410
|
] }),
|
|
3388
|
-
|
|
3389
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3390
|
-
/* @__PURE__ */ e("span", { children:
|
|
3411
|
+
d && /* @__PURE__ */ t("div", { className: "ss-auth-info-box", style: { marginBottom: "16px" }, children: [
|
|
3412
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.check }),
|
|
3413
|
+
/* @__PURE__ */ e("span", { children: d })
|
|
3391
3414
|
] }),
|
|
3392
|
-
/* @__PURE__ */ t("form", { onSubmit:
|
|
3415
|
+
/* @__PURE__ */ t("form", { onSubmit: _, children: [
|
|
3393
3416
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
3394
3417
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Full Name" }),
|
|
3395
3418
|
/* @__PURE__ */ e(
|
|
@@ -3399,7 +3422,7 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3399
3422
|
type: "text",
|
|
3400
3423
|
placeholder: "Your name",
|
|
3401
3424
|
value: y,
|
|
3402
|
-
onChange: (R) =>
|
|
3425
|
+
onChange: (R) => P(R.target.value)
|
|
3403
3426
|
}
|
|
3404
3427
|
)
|
|
3405
3428
|
] }),
|
|
@@ -3407,13 +3430,13 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3407
3430
|
/* @__PURE__ */ t("div", { children: [
|
|
3408
3431
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Email Address" }),
|
|
3409
3432
|
/* @__PURE__ */ t("div", { style: { position: "relative" }, children: [
|
|
3410
|
-
/* @__PURE__ */ e("input", { className: "ss-auth-input ss-auth-input-readonly", type: "email", value: (
|
|
3411
|
-
/* @__PURE__ */ e("span", { className: "ss-auth-visibility-toggle", style: { cursor: "default" }, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "18px" }, children:
|
|
3433
|
+
/* @__PURE__ */ e("input", { className: "ss-auth-input ss-auth-input-readonly", type: "email", value: (r == null ? void 0 : r.email) ?? "", readOnly: !0 }),
|
|
3434
|
+
/* @__PURE__ */ e("span", { className: "ss-auth-visibility-toggle", style: { cursor: "default" }, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "18px" }, children: S.lock }) })
|
|
3412
3435
|
] })
|
|
3413
3436
|
] }),
|
|
3414
3437
|
/* @__PURE__ */ t("div", { children: [
|
|
3415
3438
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Auth Provider" }),
|
|
3416
|
-
/* @__PURE__ */ e("input", { className: "ss-auth-input ss-auth-input-readonly", type: "text", value: (
|
|
3439
|
+
/* @__PURE__ */ e("input", { className: "ss-auth-input ss-auth-input-readonly", type: "text", value: (r == null ? void 0 : r.provider) ?? "", readOnly: !0 })
|
|
3417
3440
|
] })
|
|
3418
3441
|
] }),
|
|
3419
3442
|
/* @__PURE__ */ e("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ t("button", { type: "submit", className: "ss-auth-btn-primary ss-auth-btn-sm", disabled: u, style: { width: "auto" }, children: [
|
|
@@ -3424,26 +3447,26 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3424
3447
|
] }),
|
|
3425
3448
|
pa && /* @__PURE__ */ t("div", { className: "ss-auth-settings-card", children: [
|
|
3426
3449
|
/* @__PURE__ */ t("h4", { children: [
|
|
3427
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3450
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.security }),
|
|
3428
3451
|
"Security Credentials"
|
|
3429
3452
|
] }),
|
|
3430
|
-
|
|
3431
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3432
|
-
/* @__PURE__ */ e("span", { children:
|
|
3453
|
+
B && /* @__PURE__ */ t("div", { className: "ss-auth-error", style: { marginBottom: "16px" }, children: [
|
|
3454
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.errorOutline }),
|
|
3455
|
+
/* @__PURE__ */ e("span", { children: B })
|
|
3433
3456
|
] }),
|
|
3434
3457
|
/* @__PURE__ */ t("form", { onSubmit: J, children: [
|
|
3435
3458
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
3436
3459
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Current Password" }),
|
|
3437
|
-
/* @__PURE__ */ e("input", { className: "ss-auth-input", type: "password", placeholder: "••••••••••••", value:
|
|
3460
|
+
/* @__PURE__ */ e("input", { className: "ss-auth-input", type: "password", placeholder: "••••••••••••", value: O, onChange: (R) => I(R.target.value), required: !0 })
|
|
3438
3461
|
] }),
|
|
3439
3462
|
/* @__PURE__ */ t("div", { className: "ss-auth-profile-grid", style: { marginBottom: "16px" }, children: [
|
|
3440
3463
|
/* @__PURE__ */ t("div", { children: [
|
|
3441
3464
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "New Password" }),
|
|
3442
|
-
/* @__PURE__ */ e("input", { className: "ss-auth-input", type: "password", placeholder: "Min. 8 characters", value:
|
|
3465
|
+
/* @__PURE__ */ e("input", { className: "ss-auth-input", type: "password", placeholder: "Min. 8 characters", value: F, onChange: (R) => A(R.target.value), required: !0 })
|
|
3443
3466
|
] }),
|
|
3444
3467
|
/* @__PURE__ */ t("div", { children: [
|
|
3445
3468
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Confirm New Password" }),
|
|
3446
|
-
/* @__PURE__ */ e("input", { className: "ss-auth-input", type: "password", placeholder: "Repeat new password", value:
|
|
3469
|
+
/* @__PURE__ */ e("input", { className: "ss-auth-input", type: "password", placeholder: "Repeat new password", value: b, onChange: (R) => w(R.target.value), required: !0 })
|
|
3447
3470
|
] })
|
|
3448
3471
|
] }),
|
|
3449
3472
|
/* @__PURE__ */ e("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ e("button", { type: "submit", className: "ss-auth-btn-ghost", disabled: u, children: "Update Security" }) })
|
|
@@ -3452,11 +3475,11 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3452
3475
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-card ss-auth-settings-danger", children: [
|
|
3453
3476
|
/* @__PURE__ */ e("h4", { children: "Danger Zone" }),
|
|
3454
3477
|
/* @__PURE__ */ e("p", { className: "ss-auth-section-desc", style: { marginBottom: "16px" }, children: "Deleting your account is permanent. All organizations you own will also be deleted." }),
|
|
3455
|
-
|
|
3456
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3457
|
-
/* @__PURE__ */ e("span", { children:
|
|
3478
|
+
v && /* @__PURE__ */ t("div", { className: "ss-auth-error", children: [
|
|
3479
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.errorOutline }),
|
|
3480
|
+
/* @__PURE__ */ e("span", { children: v })
|
|
3458
3481
|
] }),
|
|
3459
|
-
|
|
3482
|
+
M ? /* @__PURE__ */ t("div", { children: [
|
|
3460
3483
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
3461
3484
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Type your email to confirm" }),
|
|
3462
3485
|
/* @__PURE__ */ e(
|
|
@@ -3464,9 +3487,9 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3464
3487
|
{
|
|
3465
3488
|
className: "ss-auth-input",
|
|
3466
3489
|
type: "email",
|
|
3467
|
-
placeholder:
|
|
3468
|
-
value:
|
|
3469
|
-
onChange: (R) =>
|
|
3490
|
+
placeholder: r == null ? void 0 : r.email,
|
|
3491
|
+
value: k,
|
|
3492
|
+
onChange: (R) => T(R.target.value),
|
|
3470
3493
|
autoFocus: !0
|
|
3471
3494
|
}
|
|
3472
3495
|
)
|
|
@@ -3478,7 +3501,7 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3478
3501
|
type: "button",
|
|
3479
3502
|
className: "ss-auth-btn-ghost",
|
|
3480
3503
|
onClick: () => {
|
|
3481
|
-
|
|
3504
|
+
L(!1), T(""), x(null);
|
|
3482
3505
|
},
|
|
3483
3506
|
children: "Cancel"
|
|
3484
3507
|
}
|
|
@@ -3489,10 +3512,10 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3489
3512
|
type: "button",
|
|
3490
3513
|
className: "ss-auth-btn-primary ss-auth-btn-sm",
|
|
3491
3514
|
style: { width: "auto", background: "linear-gradient(135deg, #ef4444, #dc2626)" },
|
|
3492
|
-
disabled: !ha ||
|
|
3515
|
+
disabled: !ha || g,
|
|
3493
3516
|
onClick: ua,
|
|
3494
3517
|
children: [
|
|
3495
|
-
|
|
3518
|
+
g && /* @__PURE__ */ e("span", { className: "ss-auth-spinner" }),
|
|
3496
3519
|
"Delete account"
|
|
3497
3520
|
]
|
|
3498
3521
|
}
|
|
@@ -3504,7 +3527,7 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3504
3527
|
type: "button",
|
|
3505
3528
|
className: "ss-auth-btn-outline",
|
|
3506
3529
|
style: { borderColor: "currentColor", width: "auto" },
|
|
3507
|
-
onClick: () =>
|
|
3530
|
+
onClick: () => L(!0),
|
|
3508
3531
|
children: "Delete my account"
|
|
3509
3532
|
}
|
|
3510
3533
|
)
|
|
@@ -3513,48 +3536,57 @@ function Oa({ afterDeleteAccountUrl: a }) {
|
|
|
3513
3536
|
ca,
|
|
3514
3537
|
{
|
|
3515
3538
|
onUpload: K,
|
|
3516
|
-
onClose: () =>
|
|
3539
|
+
onClose: () => f(!1),
|
|
3517
3540
|
isLoading: u
|
|
3518
3541
|
}
|
|
3519
3542
|
)
|
|
3520
3543
|
] });
|
|
3521
3544
|
}
|
|
3522
|
-
function
|
|
3523
|
-
const { selectedOrg:
|
|
3545
|
+
function Ba({ onOrgDeleted: a, onOrgUpdated: r }) {
|
|
3546
|
+
const { selectedOrg: s, updateOrg: l, deleteOrg: n, isLoading: u, error: c, setError: d } = Y(), [i, o] = h((s == null ? void 0 : s.name) ?? ""), [m, p] = h(!1), [g, v] = h(!1), [x, y] = h(!1), [P, N] = h(!1), [E, C] = h("");
|
|
3524
3547
|
if (U(() => {
|
|
3525
|
-
|
|
3526
|
-
}, [
|
|
3527
|
-
return /* @__PURE__ */ t(
|
|
3548
|
+
s && (o(s.name), y(!1));
|
|
3549
|
+
}, [s]), x)
|
|
3550
|
+
return /* @__PURE__ */ t(H, { children: [
|
|
3551
|
+
/* @__PURE__ */ e("h3", { children: "Organization" }),
|
|
3552
|
+
/* @__PURE__ */ t("div", { className: "ss-auth-settings-card", style: { textAlign: "center", padding: "48px 24px" }, children: [
|
|
3553
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "48px", opacity: 0.4, marginBottom: "16px", display: "block" }, children: S.check }),
|
|
3554
|
+
/* @__PURE__ */ e("h4", { style: { margin: "0 0 8px" }, children: "Organization deleted" }),
|
|
3555
|
+
/* @__PURE__ */ e("p", { className: "ss-auth-section-desc", children: "The organization has been permanently deleted." })
|
|
3556
|
+
] })
|
|
3557
|
+
] });
|
|
3558
|
+
if (!s)
|
|
3559
|
+
return /* @__PURE__ */ t(H, { children: [
|
|
3528
3560
|
/* @__PURE__ */ e("h3", { children: "Organization" }),
|
|
3529
3561
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-empty", children: [
|
|
3530
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3562
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.corporateFare }),
|
|
3531
3563
|
/* @__PURE__ */ e("div", { children: "Select an organization from the user menu to manage its settings." })
|
|
3532
3564
|
] })
|
|
3533
3565
|
] });
|
|
3534
|
-
const
|
|
3535
|
-
if (
|
|
3536
|
-
|
|
3537
|
-
const
|
|
3538
|
-
|
|
3539
|
-
},
|
|
3540
|
-
await
|
|
3566
|
+
const f = async (I) => {
|
|
3567
|
+
if (I.preventDefault(), !i.trim()) return;
|
|
3568
|
+
p(!0), v(!1);
|
|
3569
|
+
const F = await l(s.id, { name: i.trim() });
|
|
3570
|
+
p(!1), F && (v(!0), r == null || r());
|
|
3571
|
+
}, O = async () => {
|
|
3572
|
+
await n(s.id) && (N(!1), y(!0), a == null || a());
|
|
3541
3573
|
};
|
|
3542
|
-
return /* @__PURE__ */ t(
|
|
3574
|
+
return /* @__PURE__ */ t(H, { children: [
|
|
3543
3575
|
/* @__PURE__ */ e("h3", { children: "Organization" }),
|
|
3544
3576
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-card", children: [
|
|
3545
3577
|
/* @__PURE__ */ t("h4", { children: [
|
|
3546
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3578
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.corporateFare }),
|
|
3547
3579
|
"General"
|
|
3548
3580
|
] }),
|
|
3549
|
-
|
|
3550
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3551
|
-
/* @__PURE__ */ e("span", { children:
|
|
3581
|
+
c && /* @__PURE__ */ t("div", { className: "ss-auth-error", style: { marginBottom: "16px" }, children: [
|
|
3582
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.errorOutline }),
|
|
3583
|
+
/* @__PURE__ */ e("span", { children: c })
|
|
3552
3584
|
] }),
|
|
3553
|
-
|
|
3554
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3585
|
+
g && /* @__PURE__ */ t("div", { className: "ss-auth-info-box", style: { marginBottom: "16px" }, children: [
|
|
3586
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.check }),
|
|
3555
3587
|
/* @__PURE__ */ e("span", { children: "Organization updated" })
|
|
3556
3588
|
] }),
|
|
3557
|
-
/* @__PURE__ */ t("form", { onSubmit:
|
|
3589
|
+
/* @__PURE__ */ t("form", { onSubmit: f, children: [
|
|
3558
3590
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
3559
3591
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Organization Name" }),
|
|
3560
3592
|
/* @__PURE__ */ e(
|
|
@@ -3563,18 +3595,18 @@ function Ea() {
|
|
|
3563
3595
|
className: "ss-auth-input",
|
|
3564
3596
|
type: "text",
|
|
3565
3597
|
value: i,
|
|
3566
|
-
onChange: (
|
|
3567
|
-
|
|
3598
|
+
onChange: (I) => {
|
|
3599
|
+
o(I.target.value), v(!1);
|
|
3568
3600
|
}
|
|
3569
3601
|
}
|
|
3570
3602
|
)
|
|
3571
3603
|
] }),
|
|
3572
3604
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
3573
3605
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Slug" }),
|
|
3574
|
-
/* @__PURE__ */ e("input", { className: "ss-auth-input ss-auth-input-readonly", type: "text", value:
|
|
3606
|
+
/* @__PURE__ */ e("input", { className: "ss-auth-input ss-auth-input-readonly", type: "text", value: s.slug, readOnly: !0 })
|
|
3575
3607
|
] }),
|
|
3576
|
-
/* @__PURE__ */ e("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ t("button", { type: "submit", className: "ss-auth-btn-primary ss-auth-btn-sm", disabled:
|
|
3577
|
-
|
|
3608
|
+
/* @__PURE__ */ e("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ t("button", { type: "submit", className: "ss-auth-btn-primary ss-auth-btn-sm", disabled: m, style: { width: "auto" }, children: [
|
|
3609
|
+
m && /* @__PURE__ */ e("span", { className: "ss-auth-spinner" }),
|
|
3578
3610
|
"Save"
|
|
3579
3611
|
] }) })
|
|
3580
3612
|
] })
|
|
@@ -3582,7 +3614,7 @@ function Ea() {
|
|
|
3582
3614
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-card ss-auth-settings-danger", children: [
|
|
3583
3615
|
/* @__PURE__ */ e("h4", { children: "Danger Zone" }),
|
|
3584
3616
|
/* @__PURE__ */ e("p", { className: "ss-auth-section-desc", style: { marginBottom: "16px" }, children: "Deleting this organization is permanent and will remove all members." }),
|
|
3585
|
-
|
|
3617
|
+
P ? /* @__PURE__ */ t("div", { children: [
|
|
3586
3618
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
3587
3619
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Type the organization name to confirm" }),
|
|
3588
3620
|
/* @__PURE__ */ e(
|
|
@@ -3590,16 +3622,16 @@ function Ea() {
|
|
|
3590
3622
|
{
|
|
3591
3623
|
className: "ss-auth-input",
|
|
3592
3624
|
type: "text",
|
|
3593
|
-
placeholder:
|
|
3594
|
-
value:
|
|
3595
|
-
onChange: (
|
|
3625
|
+
placeholder: s.name,
|
|
3626
|
+
value: E,
|
|
3627
|
+
onChange: (I) => C(I.target.value),
|
|
3596
3628
|
autoFocus: !0
|
|
3597
3629
|
}
|
|
3598
3630
|
)
|
|
3599
3631
|
] }),
|
|
3600
3632
|
/* @__PURE__ */ t("div", { style: { display: "flex", gap: "8px", justifyContent: "flex-end" }, children: [
|
|
3601
3633
|
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-btn-ghost", onClick: () => {
|
|
3602
|
-
|
|
3634
|
+
N(!1), C("");
|
|
3603
3635
|
}, children: "Cancel" }),
|
|
3604
3636
|
/* @__PURE__ */ t(
|
|
3605
3637
|
"button",
|
|
@@ -3607,10 +3639,10 @@ function Ea() {
|
|
|
3607
3639
|
type: "button",
|
|
3608
3640
|
className: "ss-auth-btn-primary ss-auth-btn-sm",
|
|
3609
3641
|
style: { width: "auto", background: "linear-gradient(135deg, #ef4444, #dc2626)" },
|
|
3610
|
-
disabled:
|
|
3611
|
-
onClick:
|
|
3642
|
+
disabled: E !== s.name || u,
|
|
3643
|
+
onClick: O,
|
|
3612
3644
|
children: [
|
|
3613
|
-
|
|
3645
|
+
u && /* @__PURE__ */ e("span", { className: "ss-auth-spinner" }),
|
|
3614
3646
|
"Delete organization"
|
|
3615
3647
|
]
|
|
3616
3648
|
}
|
|
@@ -3622,63 +3654,63 @@ function Ea() {
|
|
|
3622
3654
|
type: "button",
|
|
3623
3655
|
className: "ss-auth-btn-outline",
|
|
3624
3656
|
style: { borderColor: "currentColor", width: "auto" },
|
|
3625
|
-
onClick: () =>
|
|
3657
|
+
onClick: () => N(!0),
|
|
3626
3658
|
children: "Delete this organization"
|
|
3627
3659
|
}
|
|
3628
3660
|
)
|
|
3629
3661
|
] })
|
|
3630
3662
|
] });
|
|
3631
3663
|
}
|
|
3632
|
-
function
|
|
3664
|
+
function Fa() {
|
|
3633
3665
|
const {
|
|
3634
3666
|
selectedOrg: a,
|
|
3635
|
-
members:
|
|
3636
|
-
invites:
|
|
3637
|
-
isLoading:
|
|
3667
|
+
members: r,
|
|
3668
|
+
invites: s,
|
|
3669
|
+
isLoading: l,
|
|
3638
3670
|
error: n,
|
|
3639
3671
|
setError: u,
|
|
3640
|
-
sendInvite:
|
|
3641
|
-
refreshInvites:
|
|
3642
|
-
revokeInvite:
|
|
3643
|
-
updateMemberRole:
|
|
3644
|
-
removeMember:
|
|
3672
|
+
sendInvite: c,
|
|
3673
|
+
refreshInvites: d,
|
|
3674
|
+
revokeInvite: i,
|
|
3675
|
+
updateMemberRole: o,
|
|
3676
|
+
removeMember: m,
|
|
3645
3677
|
refreshMembers: p
|
|
3646
|
-
} = Y(), [
|
|
3678
|
+
} = Y(), [g, v] = h(""), [x, y] = h("member"), [P, N] = h(!1), [E, C] = h(!1), [f, O] = h(null), [I, F] = h(""), [A, b] = h(null);
|
|
3647
3679
|
if (U(() => {
|
|
3648
|
-
a && (p(a.id),
|
|
3649
|
-
}, [a, p,
|
|
3650
|
-
return /* @__PURE__ */ t(
|
|
3680
|
+
a && (p(a.id), d(a.id));
|
|
3681
|
+
}, [a, p, d]), !a)
|
|
3682
|
+
return /* @__PURE__ */ t(H, { children: [
|
|
3651
3683
|
/* @__PURE__ */ e("h3", { children: "People" }),
|
|
3652
3684
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-empty", children: [
|
|
3653
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3685
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.group }),
|
|
3654
3686
|
/* @__PURE__ */ e("div", { children: "Select an organization from the user menu to manage members." })
|
|
3655
3687
|
] })
|
|
3656
3688
|
] });
|
|
3657
|
-
const
|
|
3658
|
-
|
|
3659
|
-
},
|
|
3660
|
-
if (!
|
|
3661
|
-
await
|
|
3662
|
-
},
|
|
3663
|
-
if (
|
|
3664
|
-
await
|
|
3665
|
-
},
|
|
3666
|
-
await
|
|
3667
|
-
},
|
|
3668
|
-
return /* @__PURE__ */ t(
|
|
3689
|
+
const w = async (k) => {
|
|
3690
|
+
k.preventDefault(), C(!1), await c(a.id, g, x) && (v(""), y("member"), C(!0), N(!1), d(a.id));
|
|
3691
|
+
}, B = async () => {
|
|
3692
|
+
if (!f) return;
|
|
3693
|
+
await o(a.id, f.userId, I) && O(null);
|
|
3694
|
+
}, z = async () => {
|
|
3695
|
+
if (!A) return;
|
|
3696
|
+
await m(a.id, A.userId) && b(null);
|
|
3697
|
+
}, M = async (k) => {
|
|
3698
|
+
await i(a.id, k);
|
|
3699
|
+
}, L = (k) => k === "owner" ? "ss-auth-role-badge ss-auth-role-badge-owner" : k === "admin" ? "ss-auth-role-badge ss-auth-role-badge-admin" : "ss-auth-role-badge ss-auth-role-badge-member";
|
|
3700
|
+
return /* @__PURE__ */ t(H, { children: [
|
|
3669
3701
|
/* @__PURE__ */ e("h3", { children: "People" }),
|
|
3670
3702
|
n && /* @__PURE__ */ t("div", { className: "ss-auth-error", style: { marginBottom: "16px" }, children: [
|
|
3671
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3703
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.errorOutline }),
|
|
3672
3704
|
/* @__PURE__ */ e("span", { children: n })
|
|
3673
3705
|
] }),
|
|
3674
|
-
|
|
3675
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3706
|
+
E && /* @__PURE__ */ t("div", { className: "ss-auth-info-box", style: { marginBottom: "16px" }, children: [
|
|
3707
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.check }),
|
|
3676
3708
|
/* @__PURE__ */ e("span", { children: "Invitation sent" })
|
|
3677
3709
|
] }),
|
|
3678
3710
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-card", children: [
|
|
3679
3711
|
/* @__PURE__ */ t("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: "16px" }, children: [
|
|
3680
3712
|
/* @__PURE__ */ t("h4", { style: { margin: 0 }, children: [
|
|
3681
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3713
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.group }),
|
|
3682
3714
|
"Members"
|
|
3683
3715
|
] }),
|
|
3684
3716
|
/* @__PURE__ */ t(
|
|
@@ -3687,15 +3719,15 @@ function Ia() {
|
|
|
3687
3719
|
type: "button",
|
|
3688
3720
|
className: "ss-auth-btn-primary ss-auth-btn-sm",
|
|
3689
3721
|
style: { width: "auto" },
|
|
3690
|
-
onClick: () =>
|
|
3722
|
+
onClick: () => N(!P),
|
|
3691
3723
|
children: [
|
|
3692
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "16px" }, children:
|
|
3724
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "16px" }, children: S.add }),
|
|
3693
3725
|
"Invite"
|
|
3694
3726
|
]
|
|
3695
3727
|
}
|
|
3696
3728
|
)
|
|
3697
3729
|
] }),
|
|
3698
|
-
|
|
3730
|
+
P && /* @__PURE__ */ e("form", { onSubmit: w, style: { marginBottom: "16px", padding: "16px", background: "rgba(0,0,0,0.05)", borderRadius: "8px" }, children: /* @__PURE__ */ t("div", { style: { display: "flex", gap: "8px", alignItems: "flex-end" }, children: [
|
|
3699
3731
|
/* @__PURE__ */ t("div", { style: { flex: 1 }, children: [
|
|
3700
3732
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Email" }),
|
|
3701
3733
|
/* @__PURE__ */ e(
|
|
@@ -3704,8 +3736,8 @@ function Ia() {
|
|
|
3704
3736
|
className: "ss-auth-input",
|
|
3705
3737
|
type: "email",
|
|
3706
3738
|
placeholder: "member@example.com",
|
|
3707
|
-
value:
|
|
3708
|
-
onChange: (
|
|
3739
|
+
value: g,
|
|
3740
|
+
onChange: (k) => v(k.target.value),
|
|
3709
3741
|
required: !0
|
|
3710
3742
|
}
|
|
3711
3743
|
)
|
|
@@ -3716,8 +3748,8 @@ function Ia() {
|
|
|
3716
3748
|
"select",
|
|
3717
3749
|
{
|
|
3718
3750
|
className: "ss-auth-input",
|
|
3719
|
-
value:
|
|
3720
|
-
onChange: (
|
|
3751
|
+
value: x,
|
|
3752
|
+
onChange: (k) => y(k.target.value),
|
|
3721
3753
|
style: { cursor: "pointer" },
|
|
3722
3754
|
children: [
|
|
3723
3755
|
/* @__PURE__ */ e("option", { value: "admin", children: "Admin" }),
|
|
@@ -3726,18 +3758,18 @@ function Ia() {
|
|
|
3726
3758
|
}
|
|
3727
3759
|
)
|
|
3728
3760
|
] }),
|
|
3729
|
-
/* @__PURE__ */ e("button", { type: "submit", className: "ss-auth-btn-primary ss-auth-btn-sm", disabled:
|
|
3761
|
+
/* @__PURE__ */ e("button", { type: "submit", className: "ss-auth-btn-primary ss-auth-btn-sm", disabled: l, style: { width: "auto", marginBottom: "0" }, children: "Send" })
|
|
3730
3762
|
] }) }),
|
|
3731
|
-
|
|
3763
|
+
r.length === 0 ? /* @__PURE__ */ e("div", { className: "ss-auth-settings-empty", style: { padding: "20px" }, children: /* @__PURE__ */ e("div", { children: "No members yet." }) }) : /* @__PURE__ */ t("table", { className: "ss-auth-settings-table", children: [
|
|
3732
3764
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ t("tr", { children: [
|
|
3733
3765
|
/* @__PURE__ */ e("th", { children: "Email" }),
|
|
3734
3766
|
/* @__PURE__ */ e("th", { children: "Role" }),
|
|
3735
3767
|
/* @__PURE__ */ e("th", { style: { width: "80px" }, children: "Actions" })
|
|
3736
3768
|
] }) }),
|
|
3737
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
3738
|
-
/* @__PURE__ */ e("td", { children:
|
|
3739
|
-
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className:
|
|
3740
|
-
/* @__PURE__ */ e("td", { children:
|
|
3769
|
+
/* @__PURE__ */ e("tbody", { children: r.map((k) => /* @__PURE__ */ t("tr", { children: [
|
|
3770
|
+
/* @__PURE__ */ e("td", { children: k.email }),
|
|
3771
|
+
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: L(k.role), children: k.role }) }),
|
|
3772
|
+
/* @__PURE__ */ e("td", { children: k.role === "owner" ? /* @__PURE__ */ e("span", { style: { fontSize: "12px", opacity: 0.4 }, children: "—" }) : /* @__PURE__ */ t("div", { className: "ss-auth-settings-actions", children: [
|
|
3741
3773
|
/* @__PURE__ */ e(
|
|
3742
3774
|
"button",
|
|
3743
3775
|
{
|
|
@@ -3745,9 +3777,9 @@ function Ia() {
|
|
|
3745
3777
|
className: "ss-auth-icon-btn",
|
|
3746
3778
|
title: "Edit role",
|
|
3747
3779
|
onClick: () => {
|
|
3748
|
-
|
|
3780
|
+
O(k), F(k.role);
|
|
3749
3781
|
},
|
|
3750
|
-
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3782
|
+
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.edit })
|
|
3751
3783
|
}
|
|
3752
3784
|
),
|
|
3753
3785
|
/* @__PURE__ */ e(
|
|
@@ -3756,17 +3788,17 @@ function Ia() {
|
|
|
3756
3788
|
type: "button",
|
|
3757
3789
|
className: "ss-auth-icon-btn ss-auth-icon-btn-danger",
|
|
3758
3790
|
title: "Remove member",
|
|
3759
|
-
onClick: () =>
|
|
3760
|
-
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3791
|
+
onClick: () => b(k),
|
|
3792
|
+
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.personRemove })
|
|
3761
3793
|
}
|
|
3762
3794
|
)
|
|
3763
3795
|
] }) })
|
|
3764
|
-
] },
|
|
3796
|
+
] }, k.userId)) })
|
|
3765
3797
|
] })
|
|
3766
3798
|
] }),
|
|
3767
|
-
|
|
3799
|
+
s.length > 0 && /* @__PURE__ */ t("div", { className: "ss-auth-settings-card", children: [
|
|
3768
3800
|
/* @__PURE__ */ t("h4", { children: [
|
|
3769
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3801
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.send }),
|
|
3770
3802
|
"Pending Invites"
|
|
3771
3803
|
] }),
|
|
3772
3804
|
/* @__PURE__ */ t("table", { className: "ss-auth-settings-table", children: [
|
|
@@ -3775,33 +3807,33 @@ function Ia() {
|
|
|
3775
3807
|
/* @__PURE__ */ e("th", { children: "Role" }),
|
|
3776
3808
|
/* @__PURE__ */ e("th", { style: { width: "80px" }, children: "Actions" })
|
|
3777
3809
|
] }) }),
|
|
3778
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
3779
|
-
/* @__PURE__ */ e("td", { children:
|
|
3780
|
-
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className:
|
|
3810
|
+
/* @__PURE__ */ e("tbody", { children: s.map((k) => /* @__PURE__ */ t("tr", { children: [
|
|
3811
|
+
/* @__PURE__ */ e("td", { children: k.email }),
|
|
3812
|
+
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e("span", { className: L(k.role), children: k.role }) }),
|
|
3781
3813
|
/* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
|
|
3782
3814
|
"button",
|
|
3783
3815
|
{
|
|
3784
3816
|
type: "button",
|
|
3785
3817
|
className: "ss-auth-icon-btn ss-auth-icon-btn-danger",
|
|
3786
3818
|
title: "Revoke invite",
|
|
3787
|
-
onClick: () =>
|
|
3788
|
-
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3819
|
+
onClick: () => M(k.id),
|
|
3820
|
+
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.close })
|
|
3789
3821
|
}
|
|
3790
3822
|
) })
|
|
3791
|
-
] },
|
|
3823
|
+
] }, k.id)) })
|
|
3792
3824
|
] })
|
|
3793
3825
|
] }),
|
|
3794
|
-
|
|
3795
|
-
|
|
3826
|
+
f && /* @__PURE__ */ e("div", { className: "ss-auth-modal-overlay", onClick: (k) => {
|
|
3827
|
+
k.target === k.currentTarget && O(null);
|
|
3796
3828
|
}, children: /* @__PURE__ */ t("div", { className: "ss-auth-modal", style: { maxWidth: "400px" }, children: [
|
|
3797
3829
|
/* @__PURE__ */ t("div", { className: "ss-auth-modal-header", children: [
|
|
3798
3830
|
/* @__PURE__ */ e("h2", { children: "Edit Role" }),
|
|
3799
|
-
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-modal-close", onClick: () =>
|
|
3831
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-modal-close", onClick: () => O(null), children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.close }) })
|
|
3800
3832
|
] }),
|
|
3801
3833
|
/* @__PURE__ */ t("div", { className: "ss-auth-modal-body", children: [
|
|
3802
3834
|
/* @__PURE__ */ t("p", { style: { fontSize: "14px", marginBottom: "16px", margin: "0 0 16px 0" }, children: [
|
|
3803
3835
|
"Change role for ",
|
|
3804
|
-
/* @__PURE__ */ e("strong", { children:
|
|
3836
|
+
/* @__PURE__ */ e("strong", { children: f.email })
|
|
3805
3837
|
] }),
|
|
3806
3838
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
3807
3839
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Role" }),
|
|
@@ -3809,8 +3841,8 @@ function Ia() {
|
|
|
3809
3841
|
"select",
|
|
3810
3842
|
{
|
|
3811
3843
|
className: "ss-auth-input",
|
|
3812
|
-
value:
|
|
3813
|
-
onChange: (
|
|
3844
|
+
value: I,
|
|
3845
|
+
onChange: (k) => F(k.target.value),
|
|
3814
3846
|
style: { cursor: "pointer" },
|
|
3815
3847
|
children: [
|
|
3816
3848
|
/* @__PURE__ */ e("option", { value: "admin", children: "Admin" }),
|
|
@@ -3820,33 +3852,33 @@ function Ia() {
|
|
|
3820
3852
|
)
|
|
3821
3853
|
] }),
|
|
3822
3854
|
/* @__PURE__ */ t("div", { style: { display: "flex", gap: "8px", justifyContent: "flex-end" }, children: [
|
|
3823
|
-
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-btn-ghost", onClick: () =>
|
|
3824
|
-
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-btn-primary ss-auth-btn-sm", style: { width: "auto" }, onClick:
|
|
3855
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-btn-ghost", onClick: () => O(null), children: "Cancel" }),
|
|
3856
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-btn-primary ss-auth-btn-sm", style: { width: "auto" }, onClick: B, children: "Save" })
|
|
3825
3857
|
] })
|
|
3826
3858
|
] })
|
|
3827
3859
|
] }) }),
|
|
3828
|
-
|
|
3829
|
-
|
|
3860
|
+
A && /* @__PURE__ */ e("div", { className: "ss-auth-modal-overlay", onClick: (k) => {
|
|
3861
|
+
k.target === k.currentTarget && b(null);
|
|
3830
3862
|
}, children: /* @__PURE__ */ t("div", { className: "ss-auth-modal", style: { maxWidth: "400px" }, children: [
|
|
3831
3863
|
/* @__PURE__ */ t("div", { className: "ss-auth-modal-header", children: [
|
|
3832
3864
|
/* @__PURE__ */ e("h2", { children: "Remove Member" }),
|
|
3833
|
-
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-modal-close", onClick: () =>
|
|
3865
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-modal-close", onClick: () => b(null), children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.close }) })
|
|
3834
3866
|
] }),
|
|
3835
3867
|
/* @__PURE__ */ t("div", { className: "ss-auth-modal-body", children: [
|
|
3836
3868
|
/* @__PURE__ */ t("p", { style: { fontSize: "14px", margin: "0 0 16px 0" }, children: [
|
|
3837
3869
|
"Are you sure you want to remove ",
|
|
3838
|
-
/* @__PURE__ */ e("strong", { children:
|
|
3870
|
+
/* @__PURE__ */ e("strong", { children: A.email }),
|
|
3839
3871
|
" from the organization?"
|
|
3840
3872
|
] }),
|
|
3841
3873
|
/* @__PURE__ */ t("div", { style: { display: "flex", gap: "8px", justifyContent: "flex-end" }, children: [
|
|
3842
|
-
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-btn-ghost", onClick: () =>
|
|
3874
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ss-auth-btn-ghost", onClick: () => b(null), children: "Cancel" }),
|
|
3843
3875
|
/* @__PURE__ */ e(
|
|
3844
3876
|
"button",
|
|
3845
3877
|
{
|
|
3846
3878
|
type: "button",
|
|
3847
3879
|
className: "ss-auth-btn-primary ss-auth-btn-sm",
|
|
3848
3880
|
style: { width: "auto", background: "linear-gradient(135deg, #ef4444, #dc2626)" },
|
|
3849
|
-
onClick:
|
|
3881
|
+
onClick: z,
|
|
3850
3882
|
children: "Remove"
|
|
3851
3883
|
}
|
|
3852
3884
|
)
|
|
@@ -3855,71 +3887,71 @@ function Ia() {
|
|
|
3855
3887
|
] }) })
|
|
3856
3888
|
] });
|
|
3857
3889
|
}
|
|
3858
|
-
function
|
|
3890
|
+
function La() {
|
|
3859
3891
|
const { selectedOrg: a } = Y();
|
|
3860
|
-
return a ? /* @__PURE__ */ t(
|
|
3892
|
+
return a ? /* @__PURE__ */ t(H, { children: [
|
|
3861
3893
|
/* @__PURE__ */ e("h3", { children: "Billing" }),
|
|
3862
3894
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-card", children: [
|
|
3863
3895
|
/* @__PURE__ */ t("h4", { children: [
|
|
3864
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3896
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.creditCard }),
|
|
3865
3897
|
"Plan & Billing"
|
|
3866
3898
|
] }),
|
|
3867
3899
|
/* @__PURE__ */ e("div", { className: "ss-auth-settings-empty", style: { padding: "20px" }, children: /* @__PURE__ */ e("div", { children: "No billing plan configured for this organization." }) })
|
|
3868
3900
|
] })
|
|
3869
|
-
] }) : /* @__PURE__ */ t(
|
|
3901
|
+
] }) : /* @__PURE__ */ t(H, { children: [
|
|
3870
3902
|
/* @__PURE__ */ e("h3", { children: "Billing" }),
|
|
3871
3903
|
/* @__PURE__ */ t("div", { className: "ss-auth-settings-empty", children: [
|
|
3872
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3904
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.creditCard }),
|
|
3873
3905
|
/* @__PURE__ */ e("div", { children: "Select an organization from the user menu to manage billing." })
|
|
3874
3906
|
] })
|
|
3875
3907
|
] });
|
|
3876
3908
|
}
|
|
3877
|
-
function
|
|
3909
|
+
function le({
|
|
3878
3910
|
appearance: a,
|
|
3879
|
-
afterSignOutUrl:
|
|
3880
|
-
afterDeleteAccountUrl:
|
|
3881
|
-
showOrgSwitcher:
|
|
3911
|
+
afterSignOutUrl: r,
|
|
3912
|
+
afterDeleteAccountUrl: s,
|
|
3913
|
+
showOrgSwitcher: l = !0,
|
|
3882
3914
|
onOrgChange: n,
|
|
3883
3915
|
onOrgSettingsClick: u
|
|
3884
3916
|
}) {
|
|
3885
|
-
const { appearance:
|
|
3886
|
-
|
|
3917
|
+
const { appearance: c } = D(), { user: d, signOut: i } = sa(), o = a ?? c, [m, p] = h(!1), [g, v] = h(!1), [x, y] = h(""), [P, N] = h(null), [E, C] = h(!1), f = W(null), { orgs: O, selectedOrg: I, selectOrg: F, createOrg: A, refresh: b } = Y(), w = $((z) => {
|
|
3918
|
+
f.current && !z.composedPath().includes(f.current) && p(!1);
|
|
3887
3919
|
}, []);
|
|
3888
3920
|
U(() => {
|
|
3889
|
-
if (
|
|
3890
|
-
const
|
|
3891
|
-
document.addEventListener("click",
|
|
3921
|
+
if (m) {
|
|
3922
|
+
const z = setTimeout(() => {
|
|
3923
|
+
document.addEventListener("click", w);
|
|
3892
3924
|
}, 0);
|
|
3893
3925
|
return () => {
|
|
3894
|
-
clearTimeout(
|
|
3926
|
+
clearTimeout(z), document.removeEventListener("click", w);
|
|
3895
3927
|
};
|
|
3896
3928
|
}
|
|
3897
|
-
}, [
|
|
3898
|
-
const
|
|
3899
|
-
async (
|
|
3900
|
-
|
|
3901
|
-
const
|
|
3929
|
+
}, [m, w]);
|
|
3930
|
+
const B = $(
|
|
3931
|
+
async (z) => {
|
|
3932
|
+
z.preventDefault(), N(null), C(!0);
|
|
3933
|
+
const M = x.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
3902
3934
|
try {
|
|
3903
|
-
const
|
|
3904
|
-
|
|
3905
|
-
} catch (
|
|
3906
|
-
|
|
3935
|
+
const L = await A(x, M);
|
|
3936
|
+
L && (await F(L.id), n == null || n(L), y(""), p(!1));
|
|
3937
|
+
} catch (L) {
|
|
3938
|
+
N(L instanceof Error ? L.message : "Failed to create organization");
|
|
3907
3939
|
} finally {
|
|
3908
3940
|
C(!1);
|
|
3909
3941
|
}
|
|
3910
3942
|
},
|
|
3911
|
-
[
|
|
3943
|
+
[x, A, F, n]
|
|
3912
3944
|
);
|
|
3913
|
-
return
|
|
3945
|
+
return d ? /* @__PURE__ */ e(j, { appearance: o, children: /* @__PURE__ */ t("div", { style: { position: "relative", display: "inline-block" }, ref: f, children: [
|
|
3914
3946
|
/* @__PURE__ */ t(
|
|
3915
3947
|
"button",
|
|
3916
3948
|
{
|
|
3917
3949
|
type: "button",
|
|
3918
3950
|
className: "ss-auth-user-trigger",
|
|
3919
|
-
onClick: () => p(!
|
|
3951
|
+
onClick: () => p(!m),
|
|
3920
3952
|
"aria-label": "User menu",
|
|
3921
3953
|
children: [
|
|
3922
|
-
/* @__PURE__ */ e("span", { className: "ss-auth-avatar-trigger", children:
|
|
3954
|
+
/* @__PURE__ */ e("span", { className: "ss-auth-avatar-trigger", children: d.avatarUrl ? /* @__PURE__ */ e("img", { src: d.avatarUrl, alt: "" }) : /* @__PURE__ */ e("div", { style: {
|
|
3923
3955
|
width: "100%",
|
|
3924
3956
|
height: "100%",
|
|
3925
3957
|
display: "flex",
|
|
@@ -3927,14 +3959,14 @@ function oe({
|
|
|
3927
3959
|
justifyContent: "center",
|
|
3928
3960
|
fontSize: "16px",
|
|
3929
3961
|
fontWeight: 700
|
|
3930
|
-
}, children: (
|
|
3931
|
-
|
|
3962
|
+
}, children: (d.name || d.email).charAt(0).toUpperCase() }) }),
|
|
3963
|
+
I && /* @__PURE__ */ e("span", { className: "ss-auth-trigger-org-name", children: I.name })
|
|
3932
3964
|
]
|
|
3933
3965
|
}
|
|
3934
3966
|
),
|
|
3935
|
-
|
|
3967
|
+
m && /* @__PURE__ */ t("div", { className: "ss-auth-dropdown ss-auth-glass-panel", style: { minWidth: "320px" }, children: [
|
|
3936
3968
|
/* @__PURE__ */ t("div", { className: "ss-auth-dropdown-header", children: [
|
|
3937
|
-
/* @__PURE__ */ e("div", { className: "ss-auth-dropdown-avatar", children:
|
|
3969
|
+
/* @__PURE__ */ e("div", { className: "ss-auth-dropdown-avatar", children: d.avatarUrl ? /* @__PURE__ */ e("img", { src: d.avatarUrl, alt: "" }) : /* @__PURE__ */ e("div", { style: {
|
|
3938
3970
|
width: "100%",
|
|
3939
3971
|
height: "100%",
|
|
3940
3972
|
display: "flex",
|
|
@@ -3942,10 +3974,10 @@ function oe({
|
|
|
3942
3974
|
justifyContent: "center",
|
|
3943
3975
|
fontSize: "20px",
|
|
3944
3976
|
fontWeight: 800
|
|
3945
|
-
}, children: (
|
|
3977
|
+
}, children: (d.name || d.email).charAt(0).toUpperCase() }) }),
|
|
3946
3978
|
/* @__PURE__ */ t("div", { children: [
|
|
3947
|
-
|
|
3948
|
-
/* @__PURE__ */ e("div", { className: "ss-auth-dropdown-email", children:
|
|
3979
|
+
d.name && /* @__PURE__ */ e("div", { className: "ss-auth-dropdown-name", children: d.name }),
|
|
3980
|
+
/* @__PURE__ */ e("div", { className: "ss-auth-dropdown-email", children: d.email })
|
|
3949
3981
|
] })
|
|
3950
3982
|
] }),
|
|
3951
3983
|
/* @__PURE__ */ e("div", { style: { padding: "4px 8px" }, children: /* @__PURE__ */ t(
|
|
@@ -3954,49 +3986,49 @@ function oe({
|
|
|
3954
3986
|
type: "button",
|
|
3955
3987
|
className: "ss-auth-dropdown-action",
|
|
3956
3988
|
onClick: () => {
|
|
3957
|
-
p(!1),
|
|
3989
|
+
p(!1), v(!0);
|
|
3958
3990
|
},
|
|
3959
3991
|
children: [
|
|
3960
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
3992
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.settings }),
|
|
3961
3993
|
"Settings"
|
|
3962
3994
|
]
|
|
3963
3995
|
}
|
|
3964
3996
|
) }),
|
|
3965
|
-
|
|
3997
|
+
l && /* @__PURE__ */ t(H, { children: [
|
|
3966
3998
|
/* @__PURE__ */ e("div", { className: "ss-auth-section-label", children: "Organizations" }),
|
|
3967
|
-
/* @__PURE__ */ e("div", { style: { padding: "0 8px 4px" }, children:
|
|
3968
|
-
const
|
|
3999
|
+
/* @__PURE__ */ e("div", { style: { padding: "0 8px 4px" }, children: O.map((z) => {
|
|
4000
|
+
const M = (I == null ? void 0 : I.id) === z.id, L = z.name.split(" ").map((k) => k[0]).join("").slice(0, 2).toUpperCase();
|
|
3969
4001
|
return /* @__PURE__ */ t(
|
|
3970
4002
|
"button",
|
|
3971
4003
|
{
|
|
3972
4004
|
type: "button",
|
|
3973
|
-
className: `ss-auth-org-item${
|
|
4005
|
+
className: `ss-auth-org-item${M ? " ss-auth-org-item-active" : ""}`,
|
|
3974
4006
|
onClick: async () => {
|
|
3975
|
-
p(!1), await
|
|
4007
|
+
p(!1), await F(z.id), n == null || n(z);
|
|
3976
4008
|
},
|
|
3977
4009
|
children: [
|
|
3978
4010
|
/* @__PURE__ */ t("div", { className: "ss-auth-org-item-inner", children: [
|
|
3979
|
-
/* @__PURE__ */ e("div", { className: `ss-auth-org-avatar${
|
|
3980
|
-
/* @__PURE__ */ e("span", { style: { fontFamily: "'Manrope', sans-serif", letterSpacing: "-0.01em" }, children:
|
|
3981
|
-
|
|
4011
|
+
/* @__PURE__ */ e("div", { className: `ss-auth-org-avatar${M ? "" : " ss-auth-org-avatar-inactive"}`, children: L }),
|
|
4012
|
+
/* @__PURE__ */ e("span", { style: { fontFamily: "'Manrope', sans-serif", letterSpacing: "-0.01em" }, children: z.name }),
|
|
4013
|
+
z.planName && /* @__PURE__ */ e("span", { className: "ss-auth-plan-badge", children: z.planName })
|
|
3982
4014
|
] }),
|
|
3983
|
-
|
|
4015
|
+
M && /* @__PURE__ */ e("span", { className: "material-symbols-outlined ss-auth-org-check", style: { fontSize: "18px" }, children: S.checkCircle })
|
|
3984
4016
|
]
|
|
3985
4017
|
},
|
|
3986
|
-
|
|
4018
|
+
z.id
|
|
3987
4019
|
);
|
|
3988
4020
|
}) }),
|
|
3989
4021
|
/* @__PURE__ */ t("div", { className: "ss-auth-inline-create", children: [
|
|
3990
|
-
|
|
3991
|
-
/* @__PURE__ */ e("form", { onSubmit:
|
|
4022
|
+
P && /* @__PURE__ */ e("div", { className: "ss-auth-error", style: { marginBottom: "8px", fontSize: "12px" }, children: /* @__PURE__ */ e("span", { children: P }) }),
|
|
4023
|
+
/* @__PURE__ */ e("form", { onSubmit: B, children: /* @__PURE__ */ t("div", { className: "ss-auth-inline-create-input", children: [
|
|
3992
4024
|
/* @__PURE__ */ e(
|
|
3993
4025
|
"input",
|
|
3994
4026
|
{
|
|
3995
4027
|
className: "ss-auth-input",
|
|
3996
4028
|
type: "text",
|
|
3997
4029
|
placeholder: "New organization name",
|
|
3998
|
-
value:
|
|
3999
|
-
onChange: (
|
|
4030
|
+
value: x,
|
|
4031
|
+
onChange: (z) => y(z.target.value),
|
|
4000
4032
|
required: !0,
|
|
4001
4033
|
style: { fontSize: "13px", padding: "10px 40px 10px 12px" }
|
|
4002
4034
|
}
|
|
@@ -4006,22 +4038,22 @@ function oe({
|
|
|
4006
4038
|
{
|
|
4007
4039
|
type: "submit",
|
|
4008
4040
|
className: "ss-auth-inline-create-btn",
|
|
4009
|
-
disabled:
|
|
4010
|
-
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "20px" }, children:
|
|
4041
|
+
disabled: E || !x.trim(),
|
|
4042
|
+
children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "20px" }, children: S.add })
|
|
4011
4043
|
}
|
|
4012
4044
|
)
|
|
4013
4045
|
] }) })
|
|
4014
4046
|
] }),
|
|
4015
|
-
|
|
4047
|
+
I && u && /* @__PURE__ */ e("div", { style: { padding: "0 8px 4px" }, children: /* @__PURE__ */ t(
|
|
4016
4048
|
"button",
|
|
4017
4049
|
{
|
|
4018
4050
|
type: "button",
|
|
4019
4051
|
className: "ss-auth-dropdown-action",
|
|
4020
4052
|
onClick: () => {
|
|
4021
|
-
p(!1), u(
|
|
4053
|
+
p(!1), u(I);
|
|
4022
4054
|
},
|
|
4023
4055
|
children: [
|
|
4024
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4056
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.corporateFare }),
|
|
4025
4057
|
"Org settings"
|
|
4026
4058
|
]
|
|
4027
4059
|
}
|
|
@@ -4033,56 +4065,58 @@ function oe({
|
|
|
4033
4065
|
type: "button",
|
|
4034
4066
|
className: "ss-auth-dropdown-action",
|
|
4035
4067
|
onClick: async () => {
|
|
4036
|
-
p(!1), await
|
|
4068
|
+
p(!1), await i(), r && (window.location.href = r);
|
|
4037
4069
|
},
|
|
4038
4070
|
style: { color: "inherit" },
|
|
4039
4071
|
children: [
|
|
4040
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { color: "inherit" }, children:
|
|
4072
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { color: "inherit" }, children: S.logout }),
|
|
4041
4073
|
"Sign out"
|
|
4042
4074
|
]
|
|
4043
4075
|
}
|
|
4044
4076
|
) })
|
|
4045
4077
|
] }),
|
|
4046
|
-
|
|
4047
|
-
|
|
4078
|
+
g && /* @__PURE__ */ e(
|
|
4079
|
+
Ea,
|
|
4048
4080
|
{
|
|
4049
|
-
onClose: () =>
|
|
4050
|
-
afterDeleteAccountUrl:
|
|
4081
|
+
onClose: () => v(!1),
|
|
4082
|
+
afterDeleteAccountUrl: s,
|
|
4083
|
+
onOrgDeleted: b,
|
|
4084
|
+
onOrgUpdated: b
|
|
4051
4085
|
}
|
|
4052
4086
|
)
|
|
4053
4087
|
] }) }) : null;
|
|
4054
4088
|
}
|
|
4055
|
-
function
|
|
4056
|
-
const { appearance:
|
|
4057
|
-
async (
|
|
4058
|
-
|
|
4089
|
+
function ce({ appearance: a }) {
|
|
4090
|
+
const { appearance: r } = D(), { user: s, signOut: l } = sa(), { updateProfile: n, uploadAvatar: u, changePassword: c, isLoading: d, error: i, success: o, setError: m, setSuccess: p } = oa(), g = a ?? r, [v, x] = h((s == null ? void 0 : s.name) ?? ""), [y, P] = h((s == null ? void 0 : s.avatarUrl) ?? ""), [N, E] = h(!1), [C, f] = h(""), [O, I] = h(""), [F, A] = h(""), [b, w] = h(null), B = $(
|
|
4091
|
+
async (T) => {
|
|
4092
|
+
T.preventDefault(), m(null), p(null), await n({ name: v, avatarUrl: y || void 0 });
|
|
4059
4093
|
},
|
|
4060
|
-
[
|
|
4061
|
-
),
|
|
4062
|
-
async (
|
|
4063
|
-
const
|
|
4064
|
-
|
|
4094
|
+
[v, y, n, m, p]
|
|
4095
|
+
), z = $(
|
|
4096
|
+
async (T) => {
|
|
4097
|
+
const _ = await u(T);
|
|
4098
|
+
_ && (P(_.avatarUrl), E(!1));
|
|
4065
4099
|
},
|
|
4066
4100
|
[u]
|
|
4067
|
-
),
|
|
4068
|
-
async (
|
|
4069
|
-
if (
|
|
4070
|
-
|
|
4101
|
+
), M = $(
|
|
4102
|
+
async (T) => {
|
|
4103
|
+
if (T.preventDefault(), w(null), m(null), p(null), O !== F) {
|
|
4104
|
+
w("Passwords do not match");
|
|
4071
4105
|
return;
|
|
4072
4106
|
}
|
|
4073
|
-
if (
|
|
4074
|
-
|
|
4107
|
+
if (O.length < 8) {
|
|
4108
|
+
w("Password must be at least 8 characters");
|
|
4075
4109
|
return;
|
|
4076
4110
|
}
|
|
4077
|
-
await
|
|
4111
|
+
await c(C, O) && (f(""), I(""), A(""));
|
|
4078
4112
|
},
|
|
4079
|
-
[C,
|
|
4113
|
+
[C, O, F, c, m, p]
|
|
4080
4114
|
);
|
|
4081
|
-
if (!
|
|
4082
|
-
const
|
|
4083
|
-
return /* @__PURE__ */ e(
|
|
4115
|
+
if (!s) return null;
|
|
4116
|
+
const L = s.provider === "email", k = (s.name || s.email).charAt(0).toUpperCase();
|
|
4117
|
+
return /* @__PURE__ */ e(j, { appearance: g, children: /* @__PURE__ */ t("div", { className: "ss-auth-card", style: { maxWidth: "640px" }, children: [
|
|
4084
4118
|
/* @__PURE__ */ t("div", { className: "ss-auth-profile-header", children: [
|
|
4085
|
-
/* @__PURE__ */ t("div", { className: "ss-auth-avatar-lg", onClick: () =>
|
|
4119
|
+
/* @__PURE__ */ t("div", { className: "ss-auth-avatar-lg", onClick: () => E(!0), children: [
|
|
4086
4120
|
y ? /* @__PURE__ */ e("img", { src: y, alt: "" }) : /* @__PURE__ */ e("div", { style: {
|
|
4087
4121
|
width: "100%",
|
|
4088
4122
|
height: "100%",
|
|
@@ -4092,33 +4126,33 @@ function ie({ appearance: a }) {
|
|
|
4092
4126
|
fontSize: "48px",
|
|
4093
4127
|
fontWeight: 800,
|
|
4094
4128
|
opacity: 0.4
|
|
4095
|
-
}, children:
|
|
4129
|
+
}, children: k }),
|
|
4096
4130
|
/* @__PURE__ */ t("div", { className: "ss-auth-avatar-overlay", children: [
|
|
4097
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4131
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.camera }),
|
|
4098
4132
|
/* @__PURE__ */ e("span", { children: "Edit" })
|
|
4099
4133
|
] })
|
|
4100
4134
|
] }),
|
|
4101
4135
|
/* @__PURE__ */ t("div", { className: "ss-auth-profile-info", children: [
|
|
4102
4136
|
/* @__PURE__ */ t("h2", { className: "ss-auth-profile-name", children: [
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "12px", fontVariationSettings: "'FILL' 1" }, children:
|
|
4137
|
+
s.name || "Unnamed User",
|
|
4138
|
+
s.emailVerified && /* @__PURE__ */ t("span", { className: "ss-auth-badge ss-auth-badge-success", children: [
|
|
4139
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "12px", fontVariationSettings: "'FILL' 1" }, children: S.verified }),
|
|
4106
4140
|
"Verified"
|
|
4107
4141
|
] })
|
|
4108
4142
|
] }),
|
|
4109
|
-
/* @__PURE__ */ e("p", { className: "ss-auth-profile-desc", children:
|
|
4143
|
+
/* @__PURE__ */ e("p", { className: "ss-auth-profile-desc", children: s.email })
|
|
4110
4144
|
] })
|
|
4111
4145
|
] }),
|
|
4112
4146
|
/* @__PURE__ */ t("div", { className: "ss-auth-card-body", children: [
|
|
4113
|
-
|
|
4114
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4115
|
-
/* @__PURE__ */ e("span", { children:
|
|
4147
|
+
i && /* @__PURE__ */ t("div", { className: "ss-auth-error", children: [
|
|
4148
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.errorOutline }),
|
|
4149
|
+
/* @__PURE__ */ e("span", { children: i })
|
|
4116
4150
|
] }),
|
|
4117
|
-
|
|
4118
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4119
|
-
/* @__PURE__ */ e("span", { children:
|
|
4151
|
+
o && /* @__PURE__ */ t("div", { className: "ss-auth-info-box", style: { marginBottom: "16px" }, children: [
|
|
4152
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.check }),
|
|
4153
|
+
/* @__PURE__ */ e("span", { children: o })
|
|
4120
4154
|
] }),
|
|
4121
|
-
/* @__PURE__ */ t("form", { onSubmit:
|
|
4155
|
+
/* @__PURE__ */ t("form", { onSubmit: B, children: [
|
|
4122
4156
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
4123
4157
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Full Name" }),
|
|
4124
4158
|
/* @__PURE__ */ e(
|
|
@@ -4127,8 +4161,8 @@ function ie({ appearance: a }) {
|
|
|
4127
4161
|
className: "ss-auth-input",
|
|
4128
4162
|
type: "text",
|
|
4129
4163
|
placeholder: "Your name",
|
|
4130
|
-
value:
|
|
4131
|
-
onChange: (
|
|
4164
|
+
value: v,
|
|
4165
|
+
onChange: (T) => x(T.target.value)
|
|
4132
4166
|
}
|
|
4133
4167
|
)
|
|
4134
4168
|
] }),
|
|
@@ -4136,34 +4170,34 @@ function ie({ appearance: a }) {
|
|
|
4136
4170
|
/* @__PURE__ */ t("div", { children: [
|
|
4137
4171
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Email Address" }),
|
|
4138
4172
|
/* @__PURE__ */ t("div", { style: { position: "relative" }, children: [
|
|
4139
|
-
/* @__PURE__ */ e("input", { className: "ss-auth-input ss-auth-input-readonly", type: "email", value:
|
|
4140
|
-
/* @__PURE__ */ e("span", { className: "ss-auth-visibility-toggle", style: { cursor: "default" }, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "18px" }, children:
|
|
4173
|
+
/* @__PURE__ */ e("input", { className: "ss-auth-input ss-auth-input-readonly", type: "email", value: s.email, readOnly: !0 }),
|
|
4174
|
+
/* @__PURE__ */ e("span", { className: "ss-auth-visibility-toggle", style: { cursor: "default" }, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "18px" }, children: S.lock }) })
|
|
4141
4175
|
] })
|
|
4142
4176
|
] }),
|
|
4143
4177
|
/* @__PURE__ */ t("div", { children: [
|
|
4144
4178
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Auth Provider" }),
|
|
4145
4179
|
/* @__PURE__ */ t("div", { style: { position: "relative" }, children: [
|
|
4146
|
-
/* @__PURE__ */ e("input", { className: "ss-auth-input ss-auth-input-readonly", type: "text", value:
|
|
4147
|
-
/* @__PURE__ */ e("span", { className: "ss-auth-visibility-toggle", style: { cursor: "default" }, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "18px" }, children:
|
|
4180
|
+
/* @__PURE__ */ e("input", { className: "ss-auth-input ss-auth-input-readonly", type: "text", value: s.provider, readOnly: !0 }),
|
|
4181
|
+
/* @__PURE__ */ e("span", { className: "ss-auth-visibility-toggle", style: { cursor: "default" }, children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", style: { fontSize: "18px" }, children: S.cloudDone }) })
|
|
4148
4182
|
] })
|
|
4149
4183
|
] })
|
|
4150
4184
|
] }),
|
|
4151
|
-
/* @__PURE__ */ e("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ t("button", { type: "submit", className: "ss-auth-btn-primary ss-auth-btn-sm", disabled:
|
|
4152
|
-
|
|
4185
|
+
/* @__PURE__ */ e("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ t("button", { type: "submit", className: "ss-auth-btn-primary ss-auth-btn-sm", disabled: d, style: { width: "auto" }, children: [
|
|
4186
|
+
d && /* @__PURE__ */ e("span", { className: "ss-auth-spinner" }),
|
|
4153
4187
|
"Save changes"
|
|
4154
4188
|
] }) })
|
|
4155
4189
|
] }),
|
|
4156
|
-
|
|
4190
|
+
L && /* @__PURE__ */ t("div", { className: "ss-auth-section", children: [
|
|
4157
4191
|
/* @__PURE__ */ t("div", { className: "ss-auth-section-title", children: [
|
|
4158
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4192
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.security }),
|
|
4159
4193
|
"Security Credentials"
|
|
4160
4194
|
] }),
|
|
4161
4195
|
/* @__PURE__ */ e("p", { className: "ss-auth-section-desc", style: { marginBottom: "24px" }, children: "Update your password to keep your account secure." }),
|
|
4162
|
-
|
|
4163
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4164
|
-
/* @__PURE__ */ e("span", { children:
|
|
4196
|
+
b && /* @__PURE__ */ t("div", { className: "ss-auth-error", children: [
|
|
4197
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.errorOutline }),
|
|
4198
|
+
/* @__PURE__ */ e("span", { children: b })
|
|
4165
4199
|
] }),
|
|
4166
|
-
/* @__PURE__ */ t("form", { onSubmit:
|
|
4200
|
+
/* @__PURE__ */ t("form", { onSubmit: M, children: [
|
|
4167
4201
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
4168
4202
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", children: "Current Password" }),
|
|
4169
4203
|
/* @__PURE__ */ e(
|
|
@@ -4173,7 +4207,7 @@ function ie({ appearance: a }) {
|
|
|
4173
4207
|
type: "password",
|
|
4174
4208
|
placeholder: "••••••••••••",
|
|
4175
4209
|
value: C,
|
|
4176
|
-
onChange: (
|
|
4210
|
+
onChange: (T) => f(T.target.value),
|
|
4177
4211
|
required: !0
|
|
4178
4212
|
}
|
|
4179
4213
|
)
|
|
@@ -4187,8 +4221,8 @@ function ie({ appearance: a }) {
|
|
|
4187
4221
|
className: "ss-auth-input",
|
|
4188
4222
|
type: "password",
|
|
4189
4223
|
placeholder: "Min. 8 characters",
|
|
4190
|
-
value:
|
|
4191
|
-
onChange: (
|
|
4224
|
+
value: O,
|
|
4225
|
+
onChange: (T) => I(T.target.value),
|
|
4192
4226
|
required: !0
|
|
4193
4227
|
}
|
|
4194
4228
|
)
|
|
@@ -4201,23 +4235,23 @@ function ie({ appearance: a }) {
|
|
|
4201
4235
|
className: "ss-auth-input",
|
|
4202
4236
|
type: "password",
|
|
4203
4237
|
placeholder: "Repeat new password",
|
|
4204
|
-
value:
|
|
4205
|
-
onChange: (
|
|
4238
|
+
value: F,
|
|
4239
|
+
onChange: (T) => A(T.target.value),
|
|
4206
4240
|
required: !0
|
|
4207
4241
|
}
|
|
4208
4242
|
)
|
|
4209
4243
|
] })
|
|
4210
4244
|
] }),
|
|
4211
4245
|
/* @__PURE__ */ t("div", { className: "ss-auth-info-box", style: { marginBottom: "16px" }, children: [
|
|
4212
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4246
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.info }),
|
|
4213
4247
|
/* @__PURE__ */ e("span", { children: "Password must be at least 8 characters long." })
|
|
4214
4248
|
] }),
|
|
4215
|
-
/* @__PURE__ */ e("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ e("button", { type: "submit", className: "ss-auth-btn-ghost", disabled:
|
|
4249
|
+
/* @__PURE__ */ e("div", { style: { display: "flex", justifyContent: "flex-end" }, children: /* @__PURE__ */ e("button", { type: "submit", className: "ss-auth-btn-ghost", disabled: d, children: "Update Security" }) })
|
|
4216
4250
|
] })
|
|
4217
4251
|
] }),
|
|
4218
4252
|
/* @__PURE__ */ e("div", { className: "ss-auth-section", style: { borderTop: "none", paddingTop: 0, marginTop: "24px" }, children: /* @__PURE__ */ e("div", { className: "ss-auth-signout-section", style: { borderRadius: "12px", padding: "16px 20px" }, children: /* @__PURE__ */ t("div", { className: "ss-auth-signout-row", children: [
|
|
4219
4253
|
/* @__PURE__ */ t("div", { className: "ss-auth-signout-info", children: [
|
|
4220
|
-
/* @__PURE__ */ e("div", { className: "ss-auth-signout-icon", children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4254
|
+
/* @__PURE__ */ e("div", { className: "ss-auth-signout-icon", children: /* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.logout }) }),
|
|
4221
4255
|
/* @__PURE__ */ t("div", { children: [
|
|
4222
4256
|
/* @__PURE__ */ e("div", { className: "ss-auth-signout-title", children: "End Session" }),
|
|
4223
4257
|
/* @__PURE__ */ e("div", { className: "ss-auth-signout-desc", children: "Terminate your active session" })
|
|
@@ -4228,104 +4262,104 @@ function ie({ appearance: a }) {
|
|
|
4228
4262
|
{
|
|
4229
4263
|
type: "button",
|
|
4230
4264
|
className: "ss-auth-btn-outline",
|
|
4231
|
-
onClick: () =>
|
|
4265
|
+
onClick: () => l(),
|
|
4232
4266
|
style: { width: "auto", flexShrink: 0 },
|
|
4233
4267
|
children: "Sign out"
|
|
4234
4268
|
}
|
|
4235
4269
|
)
|
|
4236
4270
|
] }) }) })
|
|
4237
4271
|
] }),
|
|
4238
|
-
|
|
4272
|
+
N && /* @__PURE__ */ e(
|
|
4239
4273
|
ca,
|
|
4240
4274
|
{
|
|
4241
|
-
onUpload:
|
|
4242
|
-
onClose: () =>
|
|
4243
|
-
isLoading:
|
|
4275
|
+
onUpload: z,
|
|
4276
|
+
onClose: () => E(!1),
|
|
4277
|
+
isLoading: d
|
|
4244
4278
|
}
|
|
4245
4279
|
)
|
|
4246
4280
|
] }) });
|
|
4247
4281
|
}
|
|
4248
|
-
function
|
|
4249
|
-
const { appearance:
|
|
4250
|
-
C.current && !
|
|
4282
|
+
function de({ appearance: a, onOrgChange: r }) {
|
|
4283
|
+
const { appearance: s } = D(), { orgs: l, selectedOrg: n, selectOrg: u, createOrg: c, isLoading: d } = Y(), i = a ?? s, [o, m] = h(!1), [p, g] = h(""), [v, x] = h(""), [y, P] = h(null), [N, E] = h(!1), C = W(null), f = $((b) => {
|
|
4284
|
+
C.current && !b.composedPath().includes(C.current) && m(!1);
|
|
4251
4285
|
}, []);
|
|
4252
4286
|
U(() => {
|
|
4253
|
-
if (
|
|
4254
|
-
const
|
|
4255
|
-
document.addEventListener("click",
|
|
4287
|
+
if (o) {
|
|
4288
|
+
const b = setTimeout(() => {
|
|
4289
|
+
document.addEventListener("click", f);
|
|
4256
4290
|
}, 0);
|
|
4257
4291
|
return () => {
|
|
4258
|
-
clearTimeout(
|
|
4292
|
+
clearTimeout(b), document.removeEventListener("click", f);
|
|
4259
4293
|
};
|
|
4260
4294
|
}
|
|
4261
|
-
}, [
|
|
4262
|
-
const
|
|
4263
|
-
|
|
4264
|
-
}, []),
|
|
4265
|
-
async (
|
|
4266
|
-
|
|
4295
|
+
}, [o, f]);
|
|
4296
|
+
const O = $((b) => {
|
|
4297
|
+
g(b), x(b.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, ""));
|
|
4298
|
+
}, []), I = $(
|
|
4299
|
+
async (b) => {
|
|
4300
|
+
b.preventDefault(), P(null), E(!0);
|
|
4267
4301
|
try {
|
|
4268
|
-
const
|
|
4269
|
-
|
|
4270
|
-
} catch (
|
|
4271
|
-
|
|
4302
|
+
const w = await c(p, v);
|
|
4303
|
+
w && (await u(w.id), r == null || r(w), g(""), x(""), m(!1));
|
|
4304
|
+
} catch (w) {
|
|
4305
|
+
P(w instanceof Error ? w.message : "Failed to create organization");
|
|
4272
4306
|
} finally {
|
|
4273
|
-
|
|
4307
|
+
E(!1);
|
|
4274
4308
|
}
|
|
4275
4309
|
},
|
|
4276
|
-
[p,
|
|
4310
|
+
[p, v, c, u, r]
|
|
4277
4311
|
);
|
|
4278
|
-
if (
|
|
4279
|
-
const
|
|
4280
|
-
return /* @__PURE__ */ e(
|
|
4312
|
+
if (d) return null;
|
|
4313
|
+
const F = (n == null ? void 0 : n.name) ?? (l.length === 0 ? "No organization" : "Select organization"), A = n ? n.name.split(" ").map((b) => b[0]).join("").slice(0, 2).toUpperCase() : "--";
|
|
4314
|
+
return /* @__PURE__ */ e(j, { appearance: i, children: /* @__PURE__ */ t("div", { style: { position: "relative", display: "inline-block", width: "100%", maxWidth: "360px" }, ref: C, children: [
|
|
4281
4315
|
/* @__PURE__ */ t(
|
|
4282
4316
|
"button",
|
|
4283
4317
|
{
|
|
4284
4318
|
type: "button",
|
|
4285
4319
|
className: "ss-auth-org-trigger",
|
|
4286
|
-
onClick: () =>
|
|
4320
|
+
onClick: () => m(!o),
|
|
4287
4321
|
children: [
|
|
4288
4322
|
/* @__PURE__ */ t("div", { className: "ss-auth-org-trigger-inner", children: [
|
|
4289
|
-
/* @__PURE__ */ e("div", { className: "ss-auth-org-avatar", children:
|
|
4323
|
+
/* @__PURE__ */ e("div", { className: "ss-auth-org-avatar", children: A }),
|
|
4290
4324
|
/* @__PURE__ */ t("div", { style: { textAlign: "left" }, children: [
|
|
4291
4325
|
/* @__PURE__ */ e("div", { className: "ss-auth-org-trigger-label", children: "Current Organization" }),
|
|
4292
|
-
/* @__PURE__ */ e("div", { className: "ss-auth-org-trigger-name", children:
|
|
4326
|
+
/* @__PURE__ */ e("div", { className: "ss-auth-org-trigger-name", children: F })
|
|
4293
4327
|
] })
|
|
4294
4328
|
] }),
|
|
4295
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4329
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.unfoldMore })
|
|
4296
4330
|
]
|
|
4297
4331
|
}
|
|
4298
4332
|
),
|
|
4299
|
-
|
|
4333
|
+
o && /* @__PURE__ */ t("div", { className: "ss-auth-dropdown ss-auth-dropdown-left ss-auth-glass-panel", style: { width: "100%" }, children: [
|
|
4300
4334
|
/* @__PURE__ */ e("div", { className: "ss-auth-section-label", children: "Your Organizations" }),
|
|
4301
|
-
/* @__PURE__ */ e("div", { style: { padding: "0 8px 4px" }, children:
|
|
4302
|
-
const
|
|
4335
|
+
/* @__PURE__ */ e("div", { style: { padding: "0 8px 4px" }, children: l.map((b) => {
|
|
4336
|
+
const w = (n == null ? void 0 : n.id) === b.id, B = b.name.split(" ").map((z) => z[0]).join("").slice(0, 2).toUpperCase();
|
|
4303
4337
|
return /* @__PURE__ */ t(
|
|
4304
4338
|
"button",
|
|
4305
4339
|
{
|
|
4306
4340
|
type: "button",
|
|
4307
|
-
className: `ss-auth-org-item${
|
|
4341
|
+
className: `ss-auth-org-item${w ? " ss-auth-org-item-active" : ""}`,
|
|
4308
4342
|
onClick: async () => {
|
|
4309
|
-
|
|
4343
|
+
m(!1), await u(b.id), r == null || r(b);
|
|
4310
4344
|
},
|
|
4311
4345
|
children: [
|
|
4312
4346
|
/* @__PURE__ */ t("div", { className: "ss-auth-org-item-inner", children: [
|
|
4313
|
-
/* @__PURE__ */ e("div", { className: `ss-auth-org-avatar${
|
|
4314
|
-
/* @__PURE__ */ e("span", { style: { fontFamily: "'Manrope', sans-serif", letterSpacing: "-0.01em" }, children:
|
|
4347
|
+
/* @__PURE__ */ e("div", { className: `ss-auth-org-avatar${w ? "" : " ss-auth-org-avatar-inactive"}`, children: B }),
|
|
4348
|
+
/* @__PURE__ */ e("span", { style: { fontFamily: "'Manrope', sans-serif", letterSpacing: "-0.01em" }, children: b.name })
|
|
4315
4349
|
] }),
|
|
4316
|
-
|
|
4350
|
+
w && /* @__PURE__ */ e("span", { className: "material-symbols-outlined ss-auth-org-check", style: { fontSize: "18px" }, children: S.checkCircle })
|
|
4317
4351
|
]
|
|
4318
4352
|
},
|
|
4319
|
-
|
|
4353
|
+
b.id
|
|
4320
4354
|
);
|
|
4321
4355
|
}) }),
|
|
4322
4356
|
/* @__PURE__ */ t("div", { className: "ss-auth-org-create", children: [
|
|
4323
4357
|
/* @__PURE__ */ t("div", { className: "ss-auth-org-create-header", children: [
|
|
4324
|
-
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children:
|
|
4358
|
+
/* @__PURE__ */ e("span", { className: "material-symbols-outlined", children: S.addCircle }),
|
|
4325
4359
|
/* @__PURE__ */ e("span", { children: "Create organization" })
|
|
4326
4360
|
] }),
|
|
4327
4361
|
y && /* @__PURE__ */ e("div", { className: "ss-auth-error", style: { marginBottom: "12px", fontSize: "12px" }, children: /* @__PURE__ */ e("span", { children: y }) }),
|
|
4328
|
-
/* @__PURE__ */ t("form", { onSubmit:
|
|
4362
|
+
/* @__PURE__ */ t("form", { onSubmit: I, children: [
|
|
4329
4363
|
/* @__PURE__ */ t("div", { className: "ss-auth-field", children: [
|
|
4330
4364
|
/* @__PURE__ */ e("label", { className: "ss-auth-label", style: { fontSize: "10px" }, children: "Org Name" }),
|
|
4331
4365
|
/* @__PURE__ */ e(
|
|
@@ -4335,7 +4369,7 @@ function le({ appearance: a, onOrgChange: s }) {
|
|
|
4335
4369
|
type: "text",
|
|
4336
4370
|
placeholder: "e.g. Nexus Dynamics",
|
|
4337
4371
|
value: p,
|
|
4338
|
-
onChange: (
|
|
4372
|
+
onChange: (b) => O(b.target.value),
|
|
4339
4373
|
required: !0,
|
|
4340
4374
|
style: { fontSize: "13px", padding: "10px 12px" }
|
|
4341
4375
|
}
|
|
@@ -4351,8 +4385,8 @@ function le({ appearance: a, onOrgChange: s }) {
|
|
|
4351
4385
|
className: "ss-auth-input",
|
|
4352
4386
|
type: "text",
|
|
4353
4387
|
placeholder: "nexus-dynamics",
|
|
4354
|
-
value:
|
|
4355
|
-
onChange: (
|
|
4388
|
+
value: v,
|
|
4389
|
+
onChange: (b) => x(b.target.value),
|
|
4356
4390
|
required: !0,
|
|
4357
4391
|
style: { fontSize: "13px", padding: "10px 12px 10px 22px" }
|
|
4358
4392
|
}
|
|
@@ -4364,10 +4398,10 @@ function le({ appearance: a, onOrgChange: s }) {
|
|
|
4364
4398
|
{
|
|
4365
4399
|
type: "submit",
|
|
4366
4400
|
className: "ss-auth-btn-primary",
|
|
4367
|
-
disabled:
|
|
4401
|
+
disabled: N || !p.trim(),
|
|
4368
4402
|
style: { marginTop: "8px" },
|
|
4369
4403
|
children: [
|
|
4370
|
-
|
|
4404
|
+
N && /* @__PURE__ */ e("span", { className: "ss-auth-spinner" }),
|
|
4371
4405
|
"Initialize Organization"
|
|
4372
4406
|
]
|
|
4373
4407
|
}
|
|
@@ -4377,205 +4411,205 @@ function le({ appearance: a, onOrgChange: s }) {
|
|
|
4377
4411
|
] })
|
|
4378
4412
|
] }) });
|
|
4379
4413
|
}
|
|
4380
|
-
function
|
|
4414
|
+
function Aa(a, r = "USD") {
|
|
4381
4415
|
return new Intl.NumberFormat("en-US", {
|
|
4382
4416
|
style: "currency",
|
|
4383
|
-
currency:
|
|
4417
|
+
currency: r,
|
|
4384
4418
|
minimumFractionDigits: a % 100 === 0 ? 0 : 2
|
|
4385
4419
|
}).format(a / 100);
|
|
4386
4420
|
}
|
|
4387
|
-
function
|
|
4388
|
-
const { appearance: u } =
|
|
4389
|
-
return /* @__PURE__ */ e(
|
|
4390
|
-
const
|
|
4391
|
-
return /* @__PURE__ */ t("div", { className: `ss-pricing-card ${
|
|
4421
|
+
function ue({ plans: a, currentPlanId: r, onSelectPlan: s, interval: l, appearance: n }) {
|
|
4422
|
+
const { appearance: u } = D(), c = n ?? u, d = l ? a.filter((i) => i.interval === l || i.isFree) : a;
|
|
4423
|
+
return /* @__PURE__ */ e(j, { appearance: c, children: /* @__PURE__ */ e("div", { className: "ss-pricing-grid", children: d.map((i) => {
|
|
4424
|
+
const o = i.id === r;
|
|
4425
|
+
return /* @__PURE__ */ t("div", { className: `ss-pricing-card ${o ? "ss-pricing-card-current" : ""}`, children: [
|
|
4392
4426
|
/* @__PURE__ */ t("div", { className: "ss-pricing-header", children: [
|
|
4393
|
-
/* @__PURE__ */ e("h3", { className: "ss-pricing-name", children:
|
|
4394
|
-
|
|
4395
|
-
|
|
4427
|
+
/* @__PURE__ */ e("h3", { className: "ss-pricing-name", children: i.name }),
|
|
4428
|
+
i.trialDays > 0 && /* @__PURE__ */ t("span", { className: "ss-badge ss-badge-trialing", children: [
|
|
4429
|
+
i.trialDays,
|
|
4396
4430
|
"-day trial"
|
|
4397
4431
|
] }),
|
|
4398
|
-
|
|
4432
|
+
i.isFree && /* @__PURE__ */ e("span", { className: "ss-badge ss-badge-active", children: "Free" })
|
|
4399
4433
|
] }),
|
|
4400
|
-
/* @__PURE__ */ e("div", { className: "ss-pricing-price", children:
|
|
4401
|
-
/* @__PURE__ */ e("span", { className: "ss-pricing-amount", children:
|
|
4434
|
+
/* @__PURE__ */ e("div", { className: "ss-pricing-price", children: i.isFree ? /* @__PURE__ */ e("span", { className: "ss-pricing-amount", children: "Free" }) : /* @__PURE__ */ t(H, { children: [
|
|
4435
|
+
/* @__PURE__ */ e("span", { className: "ss-pricing-amount", children: Aa(i.amountCents, i.currency) }),
|
|
4402
4436
|
/* @__PURE__ */ t("span", { className: "ss-pricing-interval", children: [
|
|
4403
4437
|
"/",
|
|
4404
|
-
|
|
4438
|
+
i.interval
|
|
4405
4439
|
] })
|
|
4406
4440
|
] }) }),
|
|
4407
|
-
|
|
4408
|
-
|
|
4441
|
+
i.description && /* @__PURE__ */ e("p", { className: "ss-pricing-desc", children: i.description }),
|
|
4442
|
+
i.features.length > 0 && /* @__PURE__ */ e("ul", { className: "ss-pricing-features", children: i.features.map((m, p) => /* @__PURE__ */ t("li", { className: "ss-pricing-feature", children: [
|
|
4409
4443
|
/* @__PURE__ */ e("span", { className: "ss-check", children: "✓" }),
|
|
4410
4444
|
" ",
|
|
4411
|
-
|
|
4445
|
+
m
|
|
4412
4446
|
] }, p)) }),
|
|
4413
4447
|
/* @__PURE__ */ e(
|
|
4414
4448
|
"button",
|
|
4415
4449
|
{
|
|
4416
4450
|
type: "button",
|
|
4417
|
-
className: `ss-btn ${
|
|
4418
|
-
disabled:
|
|
4419
|
-
onClick: () =>
|
|
4420
|
-
children:
|
|
4451
|
+
className: `ss-btn ${o ? "ss-btn-current" : "ss-btn-primary"}`,
|
|
4452
|
+
disabled: o,
|
|
4453
|
+
onClick: () => s(i.id),
|
|
4454
|
+
children: o ? "Current plan" : "Select plan"
|
|
4421
4455
|
}
|
|
4422
4456
|
)
|
|
4423
|
-
] },
|
|
4457
|
+
] }, i.id);
|
|
4424
4458
|
}) }) });
|
|
4425
4459
|
}
|
|
4426
|
-
function
|
|
4427
|
-
const { client: a } =
|
|
4460
|
+
function pe() {
|
|
4461
|
+
const { client: a } = D();
|
|
4428
4462
|
return { billing: a.billing };
|
|
4429
4463
|
}
|
|
4430
4464
|
function Z(a) {
|
|
4431
|
-
const { client:
|
|
4465
|
+
const { client: r } = D();
|
|
4432
4466
|
return G(() => {
|
|
4433
4467
|
if (a) {
|
|
4434
|
-
const
|
|
4435
|
-
return new
|
|
4468
|
+
const s = new Q("https://api.saas-support.com/v1", { type: "portalToken", token: a });
|
|
4469
|
+
return new wa(s);
|
|
4436
4470
|
}
|
|
4437
|
-
return
|
|
4438
|
-
}, [
|
|
4471
|
+
return r.billing;
|
|
4472
|
+
}, [r, a]);
|
|
4439
4473
|
}
|
|
4440
|
-
function
|
|
4441
|
-
const
|
|
4442
|
-
|
|
4474
|
+
function Ta(a, r) {
|
|
4475
|
+
const s = Z(r), [l, n] = h(null), [u, c] = h(!0), [d, i] = h(null), o = $(async () => {
|
|
4476
|
+
c(!0), i(null);
|
|
4443
4477
|
try {
|
|
4444
|
-
const
|
|
4445
|
-
n(
|
|
4446
|
-
} catch (
|
|
4447
|
-
|
|
4478
|
+
const m = await s.getCustomer(a);
|
|
4479
|
+
n(m);
|
|
4480
|
+
} catch (m) {
|
|
4481
|
+
i(m instanceof Error ? m.message : "Failed to load subscription");
|
|
4448
4482
|
} finally {
|
|
4449
|
-
|
|
4483
|
+
c(!1);
|
|
4450
4484
|
}
|
|
4451
|
-
}, [
|
|
4485
|
+
}, [s, a]);
|
|
4452
4486
|
return U(() => {
|
|
4453
|
-
|
|
4454
|
-
}, [
|
|
4487
|
+
o();
|
|
4488
|
+
}, [o]), { customer: l, isLoading: u, error: d, refresh: o };
|
|
4455
4489
|
}
|
|
4456
|
-
function
|
|
4457
|
-
const
|
|
4458
|
-
|
|
4490
|
+
function Da(a, r) {
|
|
4491
|
+
const s = Z(r), [l, n] = h([]), [u, c] = h(!0), [d, i] = h(null), o = $(async () => {
|
|
4492
|
+
c(!0), i(null);
|
|
4459
4493
|
try {
|
|
4460
|
-
const
|
|
4461
|
-
n(
|
|
4462
|
-
} catch (
|
|
4463
|
-
|
|
4494
|
+
const m = await s.getInvoices(a);
|
|
4495
|
+
n(m);
|
|
4496
|
+
} catch (m) {
|
|
4497
|
+
i(m instanceof Error ? m.message : "Failed to load invoices");
|
|
4464
4498
|
} finally {
|
|
4465
|
-
|
|
4499
|
+
c(!1);
|
|
4466
4500
|
}
|
|
4467
|
-
}, [
|
|
4501
|
+
}, [s, a]);
|
|
4468
4502
|
return U(() => {
|
|
4469
|
-
|
|
4470
|
-
}, [
|
|
4503
|
+
o();
|
|
4504
|
+
}, [o]), { invoices: l, isLoading: u, error: d, refresh: o };
|
|
4471
4505
|
}
|
|
4472
|
-
function
|
|
4473
|
-
const
|
|
4474
|
-
|
|
4506
|
+
function Ma(a, r) {
|
|
4507
|
+
const s = Z(r), [l, n] = h([]), [u, c] = h(!0), [d, i] = h(null), o = $(async () => {
|
|
4508
|
+
c(!0), i(null);
|
|
4475
4509
|
try {
|
|
4476
|
-
const
|
|
4477
|
-
n(
|
|
4478
|
-
} catch (
|
|
4479
|
-
|
|
4510
|
+
const m = await s.getCurrentUsage(a);
|
|
4511
|
+
n(m);
|
|
4512
|
+
} catch (m) {
|
|
4513
|
+
i(m instanceof Error ? m.message : "Failed to load usage");
|
|
4480
4514
|
} finally {
|
|
4481
|
-
|
|
4515
|
+
c(!1);
|
|
4482
4516
|
}
|
|
4483
|
-
}, [
|
|
4517
|
+
}, [s, a]);
|
|
4484
4518
|
return U(() => {
|
|
4485
|
-
|
|
4486
|
-
}, [
|
|
4519
|
+
o();
|
|
4520
|
+
}, [o]), { usage: l, isLoading: u, error: d, refresh: o };
|
|
4487
4521
|
}
|
|
4488
|
-
const
|
|
4522
|
+
const Va = {
|
|
4489
4523
|
active: "ss-badge-active"
|
|
4490
4524
|
};
|
|
4491
|
-
function
|
|
4525
|
+
function Ua({
|
|
4492
4526
|
customerId: a,
|
|
4493
|
-
portalToken:
|
|
4494
|
-
onChangePlan:
|
|
4495
|
-
onCancel:
|
|
4527
|
+
portalToken: r,
|
|
4528
|
+
onChangePlan: s,
|
|
4529
|
+
onCancel: l,
|
|
4496
4530
|
appearance: n
|
|
4497
4531
|
}) {
|
|
4498
|
-
const { appearance: u } =
|
|
4499
|
-
return /* @__PURE__ */ e(
|
|
4532
|
+
const { appearance: u } = D(), { customer: c, isLoading: d, error: i } = Ta(a, r);
|
|
4533
|
+
return /* @__PURE__ */ e(j, { appearance: n ?? u, children: /* @__PURE__ */ t("div", { className: "ss-card", children: [
|
|
4500
4534
|
/* @__PURE__ */ e("h2", { className: "ss-title", children: "Subscription" }),
|
|
4501
|
-
|
|
4535
|
+
d && /* @__PURE__ */ t("div", { className: "ss-loading", children: [
|
|
4502
4536
|
/* @__PURE__ */ e("span", { className: "ss-spinner" }),
|
|
4503
4537
|
" Loading..."
|
|
4504
4538
|
] }),
|
|
4505
|
-
|
|
4506
|
-
|
|
4539
|
+
i && /* @__PURE__ */ e("div", { className: "ss-global-error", children: i }),
|
|
4540
|
+
c && !d && /* @__PURE__ */ t(H, { children: [
|
|
4507
4541
|
/* @__PURE__ */ t("div", { className: "ss-field", children: [
|
|
4508
4542
|
/* @__PURE__ */ e("label", { className: "ss-label", children: "Customer" }),
|
|
4509
|
-
/* @__PURE__ */ e("input", { className: "ss-input", value:
|
|
4543
|
+
/* @__PURE__ */ e("input", { className: "ss-input", value: c.name || c.email, disabled: !0, readOnly: !0 })
|
|
4510
4544
|
] }),
|
|
4511
4545
|
/* @__PURE__ */ t("div", { className: "ss-field", children: [
|
|
4512
4546
|
/* @__PURE__ */ e("label", { className: "ss-label", children: "Status" }),
|
|
4513
|
-
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("span", { className: `ss-badge ${
|
|
4547
|
+
/* @__PURE__ */ e("div", { children: /* @__PURE__ */ e("span", { className: `ss-badge ${Va.active}`, children: "Active" }) })
|
|
4514
4548
|
] }),
|
|
4515
4549
|
/* @__PURE__ */ t("div", { className: "ss-btn-group", children: [
|
|
4516
|
-
|
|
4517
|
-
|
|
4550
|
+
s && /* @__PURE__ */ e("button", { type: "button", className: "ss-btn ss-btn-primary", onClick: s, children: "Change plan" }),
|
|
4551
|
+
l && /* @__PURE__ */ e("button", { type: "button", className: "ss-btn ss-btn-danger", onClick: l, children: "Cancel subscription" })
|
|
4518
4552
|
] })
|
|
4519
4553
|
] })
|
|
4520
4554
|
] }) });
|
|
4521
4555
|
}
|
|
4522
|
-
const
|
|
4556
|
+
const Ra = {
|
|
4523
4557
|
paid: "ss-badge-active",
|
|
4524
4558
|
open: "ss-badge-trialing",
|
|
4525
4559
|
draft: "ss-badge-paused",
|
|
4526
4560
|
void: "ss-badge-canceled",
|
|
4527
4561
|
uncollectible: "ss-badge-past-due"
|
|
4528
4562
|
};
|
|
4529
|
-
function
|
|
4563
|
+
function Ha(a) {
|
|
4530
4564
|
return new Date(a).toLocaleDateString("en-US", { year: "numeric", month: "short", day: "numeric" });
|
|
4531
4565
|
}
|
|
4532
|
-
function
|
|
4566
|
+
function ja(a) {
|
|
4533
4567
|
return new Intl.NumberFormat("en-US", { style: "currency", currency: "USD", minimumFractionDigits: 2 }).format(a / 100);
|
|
4534
4568
|
}
|
|
4535
|
-
function
|
|
4536
|
-
const { appearance:
|
|
4537
|
-
return /* @__PURE__ */ e(
|
|
4569
|
+
function qa({ customerId: a, portalToken: r, appearance: s }) {
|
|
4570
|
+
const { appearance: l } = D(), { invoices: n, isLoading: u, error: c } = Da(a, r), d = s ?? l, i = [...n].sort((o, m) => new Date(m.createdAt).getTime() - new Date(o.createdAt).getTime());
|
|
4571
|
+
return /* @__PURE__ */ e(j, { appearance: d, children: /* @__PURE__ */ t("div", { className: "ss-card ss-card-wide", children: [
|
|
4538
4572
|
/* @__PURE__ */ e("h2", { className: "ss-title", children: "Invoices" }),
|
|
4539
4573
|
u && /* @__PURE__ */ t("div", { className: "ss-loading", children: [
|
|
4540
4574
|
/* @__PURE__ */ e("span", { className: "ss-spinner" }),
|
|
4541
4575
|
" Loading..."
|
|
4542
4576
|
] }),
|
|
4543
|
-
|
|
4544
|
-
!u &&
|
|
4545
|
-
!u &&
|
|
4577
|
+
c && /* @__PURE__ */ e("div", { className: "ss-global-error", children: c }),
|
|
4578
|
+
!u && i.length === 0 && /* @__PURE__ */ e("p", { className: "ss-empty", children: "No invoices yet." }),
|
|
4579
|
+
!u && i.length > 0 && /* @__PURE__ */ t("table", { className: "ss-table", children: [
|
|
4546
4580
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ t("tr", { children: [
|
|
4547
4581
|
/* @__PURE__ */ e("th", { className: "ss-th", children: "Date" }),
|
|
4548
4582
|
/* @__PURE__ */ e("th", { className: "ss-th", children: "Amount" }),
|
|
4549
4583
|
/* @__PURE__ */ e("th", { className: "ss-th", children: "Status" }),
|
|
4550
4584
|
/* @__PURE__ */ e("th", { className: "ss-th", children: "PDF" })
|
|
4551
4585
|
] }) }),
|
|
4552
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
4553
|
-
/* @__PURE__ */ e("td", { className: "ss-td", children:
|
|
4554
|
-
/* @__PURE__ */ e("td", { className: "ss-td", children:
|
|
4555
|
-
/* @__PURE__ */ e("td", { className: "ss-td", children: /* @__PURE__ */ e("span", { className: `ss-badge ${
|
|
4556
|
-
/* @__PURE__ */ e("td", { className: "ss-td", children:
|
|
4557
|
-
] },
|
|
4586
|
+
/* @__PURE__ */ e("tbody", { children: i.map((o) => /* @__PURE__ */ t("tr", { className: "ss-tr", children: [
|
|
4587
|
+
/* @__PURE__ */ e("td", { className: "ss-td", children: Ha(o.createdAt) }),
|
|
4588
|
+
/* @__PURE__ */ e("td", { className: "ss-td", children: ja(o.amountCents) }),
|
|
4589
|
+
/* @__PURE__ */ e("td", { className: "ss-td", children: /* @__PURE__ */ e("span", { className: `ss-badge ${Ra[o.status] || ""}`, children: o.status }) }),
|
|
4590
|
+
/* @__PURE__ */ e("td", { className: "ss-td", children: o.pdfUrl ? /* @__PURE__ */ e("a", { className: "ss-link", href: o.pdfUrl, target: "_blank", rel: "noopener noreferrer", children: "Download" }) : "—" })
|
|
4591
|
+
] }, o.id)) })
|
|
4558
4592
|
] })
|
|
4559
4593
|
] }) });
|
|
4560
4594
|
}
|
|
4561
|
-
function
|
|
4562
|
-
const { appearance: n } =
|
|
4563
|
-
return /* @__PURE__ */ e(
|
|
4595
|
+
function Wa({ customerId: a, limits: r, portalToken: s, appearance: l }) {
|
|
4596
|
+
const { appearance: n } = D(), { usage: u, isLoading: c, error: d } = Ma(a, s);
|
|
4597
|
+
return /* @__PURE__ */ e(j, { appearance: l ?? n, children: /* @__PURE__ */ t("div", { className: "ss-card", children: [
|
|
4564
4598
|
/* @__PURE__ */ e("h2", { className: "ss-title", children: "Usage" }),
|
|
4565
|
-
|
|
4599
|
+
c && /* @__PURE__ */ t("div", { className: "ss-loading", children: [
|
|
4566
4600
|
/* @__PURE__ */ e("span", { className: "ss-spinner" }),
|
|
4567
4601
|
" Loading..."
|
|
4568
4602
|
] }),
|
|
4569
|
-
|
|
4570
|
-
!
|
|
4571
|
-
!
|
|
4572
|
-
const
|
|
4603
|
+
d && /* @__PURE__ */ e("div", { className: "ss-global-error", children: d }),
|
|
4604
|
+
!c && u.length === 0 && /* @__PURE__ */ e("p", { className: "ss-empty", children: "No usage data." }),
|
|
4605
|
+
!c && u.map((o) => {
|
|
4606
|
+
const m = r == null ? void 0 : r[o.metric], p = m ? Math.min(100, o.total / m * 100) : null;
|
|
4573
4607
|
return /* @__PURE__ */ t("div", { className: "ss-usage-item", children: [
|
|
4574
4608
|
/* @__PURE__ */ t("div", { className: "ss-usage-header", children: [
|
|
4575
|
-
/* @__PURE__ */ e("span", { className: "ss-usage-metric", children:
|
|
4609
|
+
/* @__PURE__ */ e("span", { className: "ss-usage-metric", children: o.metric }),
|
|
4576
4610
|
/* @__PURE__ */ t("span", { className: "ss-usage-value", children: [
|
|
4577
|
-
|
|
4578
|
-
|
|
4611
|
+
o.total.toLocaleString(),
|
|
4612
|
+
m ? ` / ${m.toLocaleString()}` : ""
|
|
4579
4613
|
] })
|
|
4580
4614
|
] }),
|
|
4581
4615
|
p !== null && /* @__PURE__ */ e("div", { className: "ss-progress-bar", children: /* @__PURE__ */ e(
|
|
@@ -4585,20 +4619,20 @@ function ja({ customerId: a, limits: s, portalToken: r, appearance: o }) {
|
|
|
4585
4619
|
style: { width: `${p}%` }
|
|
4586
4620
|
}
|
|
4587
4621
|
) })
|
|
4588
|
-
] },
|
|
4622
|
+
] }, o.metric);
|
|
4589
4623
|
})
|
|
4590
4624
|
] }) });
|
|
4591
4625
|
}
|
|
4592
|
-
function
|
|
4626
|
+
function he({
|
|
4593
4627
|
customerId: a,
|
|
4594
|
-
portalToken:
|
|
4595
|
-
limits:
|
|
4596
|
-
onChangePlan:
|
|
4628
|
+
portalToken: r,
|
|
4629
|
+
limits: s,
|
|
4630
|
+
onChangePlan: l,
|
|
4597
4631
|
onCancel: n,
|
|
4598
4632
|
appearance: u
|
|
4599
4633
|
}) {
|
|
4600
|
-
const { appearance:
|
|
4601
|
-
return /* @__PURE__ */ e(
|
|
4634
|
+
const { appearance: c } = D(), d = u ?? c, [i, o] = h("subscription");
|
|
4635
|
+
return /* @__PURE__ */ e(j, { appearance: d, children: /* @__PURE__ */ t("div", { className: "ss-card ss-card-wide", children: [
|
|
4602
4636
|
/* @__PURE__ */ e("h2", { className: "ss-title", children: "Billing" }),
|
|
4603
4637
|
/* @__PURE__ */ e("div", { className: "ss-tab-group", children: [
|
|
4604
4638
|
{ id: "subscription", label: "Subscription" },
|
|
@@ -4608,45 +4642,45 @@ function ue({
|
|
|
4608
4642
|
"button",
|
|
4609
4643
|
{
|
|
4610
4644
|
type: "button",
|
|
4611
|
-
className: `ss-tab ${
|
|
4612
|
-
onClick: () =>
|
|
4645
|
+
className: `ss-tab ${i === p.id ? "ss-tab-active" : ""}`,
|
|
4646
|
+
onClick: () => o(p.id),
|
|
4613
4647
|
children: p.label
|
|
4614
4648
|
},
|
|
4615
4649
|
p.id
|
|
4616
4650
|
)) }),
|
|
4617
4651
|
/* @__PURE__ */ t("div", { className: "ss-tab-content", children: [
|
|
4618
|
-
|
|
4619
|
-
|
|
4652
|
+
i === "subscription" && /* @__PURE__ */ e(
|
|
4653
|
+
Ua,
|
|
4620
4654
|
{
|
|
4621
4655
|
customerId: a,
|
|
4622
|
-
portalToken:
|
|
4623
|
-
onChangePlan:
|
|
4656
|
+
portalToken: r,
|
|
4657
|
+
onChangePlan: l,
|
|
4624
4658
|
onCancel: n
|
|
4625
4659
|
}
|
|
4626
4660
|
),
|
|
4627
|
-
|
|
4628
|
-
|
|
4661
|
+
i === "invoices" && /* @__PURE__ */ e(qa, { customerId: a, portalToken: r }),
|
|
4662
|
+
i === "usage" && /* @__PURE__ */ e(Wa, { customerId: a, portalToken: r, limits: s })
|
|
4629
4663
|
] })
|
|
4630
4664
|
] }) });
|
|
4631
4665
|
}
|
|
4632
|
-
function
|
|
4633
|
-
const { appearance: n } =
|
|
4634
|
-
if (
|
|
4635
|
-
|
|
4666
|
+
function ge({ customerId: a, portalToken: r, onApplied: s, appearance: l }) {
|
|
4667
|
+
const { appearance: n } = D(), u = Z(r), c = l ?? n, [d, i] = h(""), [o, m] = h(!1), [p, g] = h(null), [v, x] = h(null), y = $(async (P) => {
|
|
4668
|
+
if (P.preventDefault(), !!d.trim()) {
|
|
4669
|
+
m(!0), g(null), x(null);
|
|
4636
4670
|
try {
|
|
4637
|
-
const
|
|
4638
|
-
|
|
4639
|
-
} catch (
|
|
4640
|
-
|
|
4671
|
+
const N = await u.applyCoupon(a, d.trim());
|
|
4672
|
+
x(`Coupon applied! ${N.discountType === "percent" ? `${N.amount}% off` : `$${(N.amount / 100).toFixed(2)} off`}`), i(""), s == null || s(N);
|
|
4673
|
+
} catch (N) {
|
|
4674
|
+
g(N instanceof Error ? N.message : "Invalid coupon code");
|
|
4641
4675
|
} finally {
|
|
4642
|
-
|
|
4676
|
+
m(!1);
|
|
4643
4677
|
}
|
|
4644
4678
|
}
|
|
4645
|
-
}, [u, a,
|
|
4646
|
-
return /* @__PURE__ */ e(
|
|
4679
|
+
}, [u, a, d, s]);
|
|
4680
|
+
return /* @__PURE__ */ e(j, { appearance: c, children: /* @__PURE__ */ t("div", { className: "ss-card", children: [
|
|
4647
4681
|
/* @__PURE__ */ e("h2", { className: "ss-title", children: "Apply coupon" }),
|
|
4648
4682
|
p && /* @__PURE__ */ e("div", { className: "ss-global-error", children: p }),
|
|
4649
|
-
|
|
4683
|
+
v && /* @__PURE__ */ e("div", { className: "ss-success-msg", children: v }),
|
|
4650
4684
|
/* @__PURE__ */ t("form", { onSubmit: y, children: [
|
|
4651
4685
|
/* @__PURE__ */ t("div", { className: "ss-field", children: [
|
|
4652
4686
|
/* @__PURE__ */ e("label", { className: "ss-label", htmlFor: "ss-coupon-code", children: "Coupon code" }),
|
|
@@ -4657,102 +4691,102 @@ function pe({ customerId: a, portalToken: s, onApplied: r, appearance: o }) {
|
|
|
4657
4691
|
className: "ss-input",
|
|
4658
4692
|
type: "text",
|
|
4659
4693
|
placeholder: "Enter coupon code",
|
|
4660
|
-
value:
|
|
4661
|
-
onChange: (
|
|
4694
|
+
value: d,
|
|
4695
|
+
onChange: (P) => i(P.target.value),
|
|
4662
4696
|
required: !0
|
|
4663
4697
|
}
|
|
4664
4698
|
)
|
|
4665
4699
|
] }),
|
|
4666
|
-
/* @__PURE__ */ t("button", { type: "submit", className: "ss-btn ss-btn-primary", disabled:
|
|
4667
|
-
|
|
4700
|
+
/* @__PURE__ */ t("button", { type: "submit", className: "ss-btn ss-btn-primary", disabled: o || !d.trim(), children: [
|
|
4701
|
+
o && /* @__PURE__ */ e("span", { className: "ss-spinner" }),
|
|
4668
4702
|
"Apply"
|
|
4669
4703
|
] })
|
|
4670
4704
|
] })
|
|
4671
4705
|
] }) });
|
|
4672
4706
|
}
|
|
4673
|
-
function
|
|
4674
|
-
const { client: a } =
|
|
4707
|
+
function me() {
|
|
4708
|
+
const { client: a } = D();
|
|
4675
4709
|
return { report: a.report };
|
|
4676
4710
|
}
|
|
4677
4711
|
function da() {
|
|
4678
|
-
const { client: a } =
|
|
4679
|
-
n(!0),
|
|
4712
|
+
const { client: a } = D(), [r, s] = h(null), [l, n] = h(!1), [u, c] = h(null), d = $(async (i) => {
|
|
4713
|
+
n(!0), c(null);
|
|
4680
4714
|
try {
|
|
4681
|
-
const
|
|
4682
|
-
return
|
|
4683
|
-
} catch (
|
|
4684
|
-
return
|
|
4715
|
+
const o = await a.report.executeQuery(i);
|
|
4716
|
+
return s(o), o;
|
|
4717
|
+
} catch (o) {
|
|
4718
|
+
return c(o instanceof Error ? o.message : "Query failed"), null;
|
|
4685
4719
|
} finally {
|
|
4686
4720
|
n(!1);
|
|
4687
4721
|
}
|
|
4688
4722
|
}, [a]);
|
|
4689
|
-
return { result:
|
|
4723
|
+
return { result: r, execute: d, isLoading: l, error: u };
|
|
4690
4724
|
}
|
|
4691
|
-
function
|
|
4692
|
-
const { client:
|
|
4693
|
-
u(!0),
|
|
4725
|
+
function _a(a) {
|
|
4726
|
+
const { client: r } = D(), [s, l] = h(null), [n, u] = h(!0), [c, d] = h(null), i = $(async () => {
|
|
4727
|
+
u(!0), d(null);
|
|
4694
4728
|
try {
|
|
4695
|
-
const
|
|
4696
|
-
o
|
|
4697
|
-
} catch (
|
|
4698
|
-
|
|
4729
|
+
const o = await r.report.listQueries(a);
|
|
4730
|
+
l(o);
|
|
4731
|
+
} catch (o) {
|
|
4732
|
+
d(o instanceof Error ? o.message : "Failed to load queries");
|
|
4699
4733
|
} finally {
|
|
4700
4734
|
u(!1);
|
|
4701
4735
|
}
|
|
4702
|
-
}, [
|
|
4736
|
+
}, [r, a]);
|
|
4703
4737
|
return U(() => {
|
|
4704
|
-
|
|
4705
|
-
}, [
|
|
4738
|
+
i();
|
|
4739
|
+
}, [i]), { queries: (s == null ? void 0 : s.data) ?? [], meta: s == null ? void 0 : s.meta, isLoading: n, error: c, refresh: i };
|
|
4706
4740
|
}
|
|
4707
|
-
function
|
|
4708
|
-
const { client:
|
|
4709
|
-
u(!0),
|
|
4741
|
+
function fe(a) {
|
|
4742
|
+
const { client: r } = D(), [s, l] = h(null), [n, u] = h(!0), [c, d] = h(null), i = $(async () => {
|
|
4743
|
+
u(!0), d(null);
|
|
4710
4744
|
try {
|
|
4711
|
-
const
|
|
4712
|
-
o
|
|
4713
|
-
} catch (
|
|
4714
|
-
|
|
4745
|
+
const o = await r.report.getDashboard(a);
|
|
4746
|
+
l(o);
|
|
4747
|
+
} catch (o) {
|
|
4748
|
+
d(o instanceof Error ? o.message : "Failed to load dashboard");
|
|
4715
4749
|
} finally {
|
|
4716
4750
|
u(!1);
|
|
4717
4751
|
}
|
|
4718
|
-
}, [
|
|
4752
|
+
}, [r, a]);
|
|
4719
4753
|
return U(() => {
|
|
4720
|
-
|
|
4721
|
-
}, [
|
|
4754
|
+
i();
|
|
4755
|
+
}, [i]), { dashboard: s, isLoading: n, error: c, refresh: i };
|
|
4722
4756
|
}
|
|
4723
|
-
function
|
|
4724
|
-
const
|
|
4725
|
-
const p = new Q(
|
|
4757
|
+
function be(a, r, s = "https://api.saas-support.com/v1") {
|
|
4758
|
+
const l = G(() => {
|
|
4759
|
+
const p = new Q(s, { type: "embedToken", token: a });
|
|
4726
4760
|
return new ta(p);
|
|
4727
|
-
}, [a,
|
|
4728
|
-
|
|
4761
|
+
}, [a, s]), [n, u] = h(null), [c, d] = h(!0), [i, o] = h(null), m = $(async () => {
|
|
4762
|
+
d(!0), o(null);
|
|
4729
4763
|
try {
|
|
4730
|
-
const p = await
|
|
4764
|
+
const p = await l.getDashboard(r);
|
|
4731
4765
|
u(p);
|
|
4732
4766
|
} catch (p) {
|
|
4733
|
-
|
|
4767
|
+
o(p instanceof Error ? p.message : "Failed to load dashboard");
|
|
4734
4768
|
} finally {
|
|
4735
|
-
|
|
4769
|
+
d(!1);
|
|
4736
4770
|
}
|
|
4737
|
-
}, [
|
|
4771
|
+
}, [l, r]);
|
|
4738
4772
|
return U(() => {
|
|
4739
|
-
|
|
4740
|
-
}, [
|
|
4773
|
+
m();
|
|
4774
|
+
}, [m]), { dashboard: n, reportClient: l, isLoading: c, error: i, refresh: m };
|
|
4741
4775
|
}
|
|
4742
|
-
function
|
|
4743
|
-
const { appearance: n } =
|
|
4744
|
-
if (
|
|
4745
|
-
const
|
|
4746
|
-
|
|
4747
|
-
}, [
|
|
4748
|
-
return /* @__PURE__ */ e(
|
|
4749
|
-
|
|
4776
|
+
function xe({ onResult: a, mode: r = "both", placeholder: s, appearance: l }) {
|
|
4777
|
+
const { appearance: n } = D(), { execute: u, isLoading: c, error: d } = da(), i = l ?? n, [o, m] = h(""), [p, g] = h(r === "sql" ? "sql" : "nl"), v = $(async (x) => {
|
|
4778
|
+
if (x.preventDefault(), !o.trim()) return;
|
|
4779
|
+
const P = await u(p === "sql" ? { sql: o } : { naturalLanguage: o });
|
|
4780
|
+
P && (a == null || a(P));
|
|
4781
|
+
}, [o, p, u, a]);
|
|
4782
|
+
return /* @__PURE__ */ e(j, { appearance: i, children: /* @__PURE__ */ t("div", { className: "ss-card ss-card-wide", children: [
|
|
4783
|
+
r === "both" && /* @__PURE__ */ t("div", { className: "ss-tab-group ss-tab-group-sm", children: [
|
|
4750
4784
|
/* @__PURE__ */ e(
|
|
4751
4785
|
"button",
|
|
4752
4786
|
{
|
|
4753
4787
|
type: "button",
|
|
4754
4788
|
className: `ss-tab ${p === "nl" ? "ss-tab-active" : ""}`,
|
|
4755
|
-
onClick: () =>
|
|
4789
|
+
onClick: () => g("nl"),
|
|
4756
4790
|
children: "Natural Language"
|
|
4757
4791
|
}
|
|
4758
4792
|
),
|
|
@@ -4761,228 +4795,228 @@ function fe({ onResult: a, mode: s = "both", placeholder: r, appearance: o }) {
|
|
|
4761
4795
|
{
|
|
4762
4796
|
type: "button",
|
|
4763
4797
|
className: `ss-tab ${p === "sql" ? "ss-tab-active" : ""}`,
|
|
4764
|
-
onClick: () =>
|
|
4798
|
+
onClick: () => g("sql"),
|
|
4765
4799
|
children: "SQL"
|
|
4766
4800
|
}
|
|
4767
4801
|
)
|
|
4768
4802
|
] }),
|
|
4769
|
-
|
|
4770
|
-
/* @__PURE__ */ t("form", { onSubmit:
|
|
4803
|
+
d && /* @__PURE__ */ e("div", { className: "ss-global-error", children: d }),
|
|
4804
|
+
/* @__PURE__ */ t("form", { onSubmit: v, children: [
|
|
4771
4805
|
/* @__PURE__ */ e("div", { className: "ss-field", children: /* @__PURE__ */ e(
|
|
4772
4806
|
"textarea",
|
|
4773
4807
|
{
|
|
4774
4808
|
className: "ss-input ss-query-textarea",
|
|
4775
|
-
placeholder:
|
|
4776
|
-
value:
|
|
4777
|
-
onChange: (
|
|
4809
|
+
placeholder: s ?? (p === "sql" ? "SELECT ..." : "Ask a question about your data..."),
|
|
4810
|
+
value: o,
|
|
4811
|
+
onChange: (x) => m(x.target.value),
|
|
4778
4812
|
rows: 3
|
|
4779
4813
|
}
|
|
4780
4814
|
) }),
|
|
4781
|
-
/* @__PURE__ */ t("button", { type: "submit", className: "ss-btn ss-btn-primary", disabled:
|
|
4782
|
-
|
|
4815
|
+
/* @__PURE__ */ t("button", { type: "submit", className: "ss-btn ss-btn-primary", disabled: c || !o.trim(), children: [
|
|
4816
|
+
c && /* @__PURE__ */ e("span", { className: "ss-spinner" }),
|
|
4783
4817
|
"Run query"
|
|
4784
4818
|
] })
|
|
4785
4819
|
] })
|
|
4786
4820
|
] }) });
|
|
4787
4821
|
}
|
|
4788
|
-
function
|
|
4789
|
-
const { appearance: u } =
|
|
4790
|
-
const
|
|
4791
|
-
if (
|
|
4792
|
-
if (
|
|
4793
|
-
if (
|
|
4794
|
-
if (typeof
|
|
4795
|
-
return
|
|
4796
|
-
const C = String(
|
|
4797
|
-
return
|
|
4798
|
-
}) :
|
|
4799
|
-
|
|
4822
|
+
function Ga({ columns: a, rows: r, sortable: s = !0, maxRows: l, appearance: n }) {
|
|
4823
|
+
const { appearance: u } = D(), c = n ?? u, [d, i] = h(null), [o, m] = h("asc"), p = G(() => d ? [...r].sort((y, P) => {
|
|
4824
|
+
const N = y[d], E = P[d];
|
|
4825
|
+
if (N == null && E == null) return 0;
|
|
4826
|
+
if (N == null) return 1;
|
|
4827
|
+
if (E == null) return -1;
|
|
4828
|
+
if (typeof N == "number" && typeof E == "number")
|
|
4829
|
+
return o === "asc" ? N - E : E - N;
|
|
4830
|
+
const C = String(N), f = String(E);
|
|
4831
|
+
return o === "asc" ? C.localeCompare(f) : f.localeCompare(C);
|
|
4832
|
+
}) : r, [r, d, o]), g = l ? p.slice(0, l) : p, v = (y) => {
|
|
4833
|
+
s && (d === y ? m((P) => P === "asc" ? "desc" : "asc") : (i(y), m("asc")));
|
|
4800
4834
|
};
|
|
4801
|
-
function
|
|
4835
|
+
function x(y) {
|
|
4802
4836
|
return y == null ? "" : typeof y == "object" ? JSON.stringify(y) : String(y);
|
|
4803
4837
|
}
|
|
4804
|
-
return /* @__PURE__ */ e(
|
|
4838
|
+
return /* @__PURE__ */ e(j, { appearance: c, children: /* @__PURE__ */ t("div", { className: "ss-table-container", children: [
|
|
4805
4839
|
/* @__PURE__ */ t("table", { className: "ss-table", children: [
|
|
4806
4840
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { children: a.map((y) => /* @__PURE__ */ t(
|
|
4807
4841
|
"th",
|
|
4808
4842
|
{
|
|
4809
|
-
className: `ss-th ${
|
|
4810
|
-
onClick: () =>
|
|
4843
|
+
className: `ss-th ${s ? "ss-th-sortable" : ""} ${d === y ? o === "asc" ? "ss-sorted-asc" : "ss-sorted-desc" : ""}`,
|
|
4844
|
+
onClick: () => v(y),
|
|
4811
4845
|
children: [
|
|
4812
4846
|
y,
|
|
4813
|
-
|
|
4847
|
+
d === y && /* @__PURE__ */ e("span", { className: "ss-sort-indicator", children: o === "asc" ? " ▲" : " ▼" })
|
|
4814
4848
|
]
|
|
4815
4849
|
},
|
|
4816
4850
|
y
|
|
4817
4851
|
)) }) }),
|
|
4818
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
4852
|
+
/* @__PURE__ */ e("tbody", { children: g.map((y, P) => /* @__PURE__ */ e("tr", { className: "ss-tr", children: a.map((N) => /* @__PURE__ */ e("td", { className: "ss-td", children: x(y[N]) }, N)) }, P)) })
|
|
4819
4853
|
] }),
|
|
4820
|
-
|
|
4854
|
+
l && r.length > l && /* @__PURE__ */ t("div", { className: "ss-table-footer", children: [
|
|
4821
4855
|
"Showing ",
|
|
4822
|
-
|
|
4856
|
+
l,
|
|
4823
4857
|
" of ",
|
|
4824
|
-
|
|
4858
|
+
r.length,
|
|
4825
4859
|
" rows"
|
|
4826
4860
|
] })
|
|
4827
4861
|
] }) });
|
|
4828
4862
|
}
|
|
4829
|
-
function
|
|
4830
|
-
const
|
|
4863
|
+
function Ya(a, r = "#6366f1") {
|
|
4864
|
+
const s = parseInt(r.replace("#", "").slice(0, 2), 16), l = [];
|
|
4831
4865
|
for (let n = 0; n < a; n++) {
|
|
4832
|
-
const u = (
|
|
4833
|
-
|
|
4866
|
+
const u = (s + n * Math.floor(360 / Math.max(a, 1))) % 360;
|
|
4867
|
+
l.push(`hsl(${u}, 65%, 55%)`);
|
|
4834
4868
|
}
|
|
4835
|
-
return
|
|
4869
|
+
return l;
|
|
4836
4870
|
}
|
|
4837
|
-
function
|
|
4838
|
-
const u = Math.max(...
|
|
4871
|
+
function Ja({ labels: a, values: r, w: s, h: l, colors: n }) {
|
|
4872
|
+
const u = Math.max(...r, 1), c = 40, d = s - c * 2, i = l - c * 2, o = Math.max(1, d / a.length - 4);
|
|
4839
4873
|
return /* @__PURE__ */ t("g", { children: [
|
|
4840
|
-
/* @__PURE__ */ e("line", { x1:
|
|
4841
|
-
|
|
4842
|
-
const
|
|
4874
|
+
/* @__PURE__ */ e("line", { x1: c, y1: l - c, x2: s - c, y2: l - c, stroke: "#ccc", strokeWidth: 1 }),
|
|
4875
|
+
r.map((m, p) => {
|
|
4876
|
+
const g = m / u * i, v = c + d / a.length * p + 2, x = l - c - g;
|
|
4843
4877
|
return /* @__PURE__ */ t("g", { children: [
|
|
4844
|
-
/* @__PURE__ */ e("rect", { x:
|
|
4845
|
-
/* @__PURE__ */ e("text", { x:
|
|
4878
|
+
/* @__PURE__ */ e("rect", { x: v, y: x, width: o, height: g, fill: n[p % n.length], rx: 2 }),
|
|
4879
|
+
/* @__PURE__ */ e("text", { x: v + o / 2, y: l - c + 14, textAnchor: "middle", fontSize: 10, fill: "#666", children: a[p].length > 8 ? a[p].slice(0, 8) + "..." : a[p] })
|
|
4846
4880
|
] }, p);
|
|
4847
4881
|
})
|
|
4848
4882
|
] });
|
|
4849
4883
|
}
|
|
4850
|
-
function
|
|
4851
|
-
const u = Math.max(...
|
|
4852
|
-
const
|
|
4853
|
-
return `${
|
|
4884
|
+
function Qa({ labels: a, values: r, w: s, h: l, colors: n }) {
|
|
4885
|
+
const u = Math.max(...r, 1), c = 40, d = s - c * 2, i = l - c * 2, o = a.length > 1 ? d / (a.length - 1) : 0, m = r.map((p, g) => {
|
|
4886
|
+
const v = c + o * g, x = l - c - p / u * i;
|
|
4887
|
+
return `${v},${x}`;
|
|
4854
4888
|
});
|
|
4855
4889
|
return /* @__PURE__ */ t("g", { children: [
|
|
4856
4890
|
[0.25, 0.5, 0.75, 1].map((p) => {
|
|
4857
|
-
const
|
|
4858
|
-
return /* @__PURE__ */ e("line", { x1:
|
|
4891
|
+
const g = l - c - p * i;
|
|
4892
|
+
return /* @__PURE__ */ e("line", { x1: c, y1: g, x2: s - c, y2: g, stroke: "#eee", strokeWidth: 1 }, p);
|
|
4859
4893
|
}),
|
|
4860
|
-
/* @__PURE__ */ e("polyline", { points:
|
|
4861
|
-
|
|
4862
|
-
const
|
|
4863
|
-
return /* @__PURE__ */ e("circle", { cx:
|
|
4894
|
+
/* @__PURE__ */ e("polyline", { points: m.join(" "), fill: "none", stroke: n[0], strokeWidth: 2 }),
|
|
4895
|
+
r.map((p, g) => {
|
|
4896
|
+
const v = c + o * g, x = l - c - p / u * i;
|
|
4897
|
+
return /* @__PURE__ */ e("circle", { cx: v, cy: x, r: 4, fill: n[0] }, g);
|
|
4864
4898
|
})
|
|
4865
4899
|
] });
|
|
4866
4900
|
}
|
|
4867
|
-
function
|
|
4868
|
-
const u =
|
|
4869
|
-
let
|
|
4870
|
-
const p =
|
|
4871
|
-
const
|
|
4872
|
-
return
|
|
4901
|
+
function Za({ labels: a, values: r, w: s, h: l, colors: n }) {
|
|
4902
|
+
const u = r.reduce((g, v) => g + v, 0) || 1, c = s / 2, d = l / 2 - 20, i = Math.min(s, l) / 2 - 40, o = 2 * Math.PI * i;
|
|
4903
|
+
let m = 0;
|
|
4904
|
+
const p = r.map((g, v) => {
|
|
4905
|
+
const x = g / u, y = x * o, P = { dash: y, offset: m, color: n[v % n.length], label: a[v], pct: x };
|
|
4906
|
+
return m += y, P;
|
|
4873
4907
|
});
|
|
4874
4908
|
return /* @__PURE__ */ t("g", { children: [
|
|
4875
|
-
p.map((
|
|
4909
|
+
p.map((g, v) => /* @__PURE__ */ e(
|
|
4876
4910
|
"circle",
|
|
4877
4911
|
{
|
|
4878
|
-
cx:
|
|
4879
|
-
cy:
|
|
4880
|
-
r:
|
|
4912
|
+
cx: c,
|
|
4913
|
+
cy: d,
|
|
4914
|
+
r: i,
|
|
4881
4915
|
fill: "none",
|
|
4882
|
-
stroke:
|
|
4883
|
-
strokeWidth:
|
|
4884
|
-
strokeDasharray: `${
|
|
4885
|
-
strokeDashoffset: -
|
|
4886
|
-
transform: `rotate(-90 ${
|
|
4916
|
+
stroke: g.color,
|
|
4917
|
+
strokeWidth: i * 0.6,
|
|
4918
|
+
strokeDasharray: `${g.dash} ${o - g.dash}`,
|
|
4919
|
+
strokeDashoffset: -g.offset,
|
|
4920
|
+
transform: `rotate(-90 ${c} ${d})`
|
|
4887
4921
|
},
|
|
4888
|
-
|
|
4922
|
+
v
|
|
4889
4923
|
)),
|
|
4890
|
-
/* @__PURE__ */ e("g", { transform: `translate(${
|
|
4891
|
-
/* @__PURE__ */ e("rect", { width: 10, height: 10, fill:
|
|
4892
|
-
/* @__PURE__ */ e("text", { x: 14, y: 9, fontSize: 9, fill: "#666", children:
|
|
4893
|
-
] },
|
|
4924
|
+
/* @__PURE__ */ e("g", { transform: `translate(${c - a.length * 30}, ${l - 20})`, children: p.slice(0, 6).map((g, v) => /* @__PURE__ */ t("g", { transform: `translate(${v * 60}, 0)`, children: [
|
|
4925
|
+
/* @__PURE__ */ e("rect", { width: 10, height: 10, fill: g.color, rx: 2 }),
|
|
4926
|
+
/* @__PURE__ */ e("text", { x: 14, y: 9, fontSize: 9, fill: "#666", children: g.label.length > 6 ? g.label.slice(0, 6) + ".." : g.label })
|
|
4927
|
+
] }, v)) })
|
|
4894
4928
|
] });
|
|
4895
4929
|
}
|
|
4896
|
-
function
|
|
4897
|
-
const { appearance:
|
|
4898
|
-
return /* @__PURE__ */ e(
|
|
4899
|
-
|
|
4900
|
-
/* @__PURE__ */ t("svg", { viewBox: `0 0 ${
|
|
4901
|
-
a === "bar" && /* @__PURE__ */ e(
|
|
4902
|
-
a === "line" && /* @__PURE__ */ e(
|
|
4903
|
-
a === "pie" && /* @__PURE__ */ e(
|
|
4930
|
+
function Ka({ type: a, data: r, title: s, width: l = 400, height: n = 300, appearance: u }) {
|
|
4931
|
+
const { appearance: c } = D(), d = u ?? c, i = G(() => Ya(r.labels.length), [r.labels.length]);
|
|
4932
|
+
return /* @__PURE__ */ e(j, { appearance: d, children: /* @__PURE__ */ t("div", { className: "ss-chart-container", children: [
|
|
4933
|
+
s && /* @__PURE__ */ e("h3", { className: "ss-chart-title", children: s }),
|
|
4934
|
+
/* @__PURE__ */ t("svg", { viewBox: `0 0 ${l} ${n}`, width: "100%", style: { maxWidth: l }, children: [
|
|
4935
|
+
a === "bar" && /* @__PURE__ */ e(Ja, { labels: r.labels, values: r.values, w: l, h: n, colors: i }),
|
|
4936
|
+
a === "line" && /* @__PURE__ */ e(Qa, { labels: r.labels, values: r.values, w: l, h: n, colors: i }),
|
|
4937
|
+
a === "pie" && /* @__PURE__ */ e(Za, { labels: r.labels, values: r.values, w: l, h: n, colors: i })
|
|
4904
4938
|
] })
|
|
4905
4939
|
] }) });
|
|
4906
4940
|
}
|
|
4907
|
-
function
|
|
4908
|
-
const u =
|
|
4909
|
-
if (
|
|
4910
|
-
const
|
|
4911
|
-
return new ta(
|
|
4941
|
+
function ye({ dashboardId: a, embedToken: r, baseUrl: s, refreshInterval: l, appearance: n }) {
|
|
4942
|
+
const u = D(), c = n ?? (u == null ? void 0 : u.appearance), d = G(() => {
|
|
4943
|
+
if (r) {
|
|
4944
|
+
const N = s ?? "https://api.saas-support.com/v1", E = new Q(N, { type: "embedToken", token: r });
|
|
4945
|
+
return new ta(E);
|
|
4912
4946
|
}
|
|
4913
4947
|
return u.client.report;
|
|
4914
|
-
}, [
|
|
4915
|
-
|
|
4948
|
+
}, [r, s, u]), [i, o] = h([]), [m, p] = h({}), [g, v] = h(!0), [x, y] = h(null), P = $(async () => {
|
|
4949
|
+
v(!0), y(null);
|
|
4916
4950
|
try {
|
|
4917
|
-
const
|
|
4918
|
-
|
|
4951
|
+
const N = await d.getDashboard(a), E = JSON.parse(N.layoutJson || "[]");
|
|
4952
|
+
o(E);
|
|
4919
4953
|
const C = {};
|
|
4920
|
-
for (const
|
|
4954
|
+
for (const f of E)
|
|
4921
4955
|
try {
|
|
4922
|
-
const
|
|
4923
|
-
if (
|
|
4924
|
-
const
|
|
4925
|
-
C[
|
|
4956
|
+
const O = await d.listQueries({ search: f.queryId, perPage: 1 });
|
|
4957
|
+
if (O.data.length > 0 && O.data[0].generatedSql) {
|
|
4958
|
+
const I = await d.executeQuery({ sql: O.data[0].generatedSql });
|
|
4959
|
+
C[f.queryId] = I;
|
|
4926
4960
|
}
|
|
4927
4961
|
} catch {
|
|
4928
4962
|
}
|
|
4929
4963
|
p(C);
|
|
4930
|
-
} catch (
|
|
4931
|
-
y(
|
|
4964
|
+
} catch (N) {
|
|
4965
|
+
y(N instanceof Error ? N.message : "Failed to load dashboard");
|
|
4932
4966
|
} finally {
|
|
4933
|
-
|
|
4967
|
+
v(!1);
|
|
4934
4968
|
}
|
|
4935
|
-
}, [
|
|
4969
|
+
}, [d, a]);
|
|
4936
4970
|
return U(() => {
|
|
4937
|
-
|
|
4938
|
-
}, [
|
|
4939
|
-
if (!
|
|
4940
|
-
const
|
|
4941
|
-
return () => clearInterval(
|
|
4942
|
-
}, [
|
|
4943
|
-
|
|
4971
|
+
P();
|
|
4972
|
+
}, [P]), U(() => {
|
|
4973
|
+
if (!l || l <= 0) return;
|
|
4974
|
+
const N = setInterval(P, l * 1e3);
|
|
4975
|
+
return () => clearInterval(N);
|
|
4976
|
+
}, [l, P]), /* @__PURE__ */ e(j, { appearance: c, children: /* @__PURE__ */ t("div", { className: "ss-dashboard-grid", children: [
|
|
4977
|
+
g && /* @__PURE__ */ t("div", { className: "ss-loading", children: [
|
|
4944
4978
|
/* @__PURE__ */ e("span", { className: "ss-spinner" }),
|
|
4945
4979
|
" Loading dashboard..."
|
|
4946
4980
|
] }),
|
|
4947
|
-
|
|
4948
|
-
!
|
|
4949
|
-
const C =
|
|
4981
|
+
x && /* @__PURE__ */ e("div", { className: "ss-global-error", children: x }),
|
|
4982
|
+
!g && i.map((N, E) => {
|
|
4983
|
+
const C = m[N.queryId];
|
|
4950
4984
|
if (!C) return null;
|
|
4951
|
-
const
|
|
4952
|
-
labels: C.rows.map((
|
|
4953
|
-
values: C.rows.map((
|
|
4985
|
+
const f = C.columns.length >= 2 ? {
|
|
4986
|
+
labels: C.rows.map((O) => String(O[C.columns[0]] ?? "")),
|
|
4987
|
+
values: C.rows.map((O) => Number(O[C.columns[1]] ?? 0))
|
|
4954
4988
|
} : { labels: [], values: [] };
|
|
4955
4989
|
return /* @__PURE__ */ t("div", { className: "ss-widget", children: [
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4990
|
+
N.title && /* @__PURE__ */ e("h4", { className: "ss-widget-header", children: N.title }),
|
|
4991
|
+
N.chartType === "table" ? /* @__PURE__ */ e(Ga, { columns: C.columns, rows: C.rows, maxRows: 50 }) : /* @__PURE__ */ e(
|
|
4992
|
+
Ka,
|
|
4959
4993
|
{
|
|
4960
|
-
type:
|
|
4961
|
-
data:
|
|
4962
|
-
width:
|
|
4963
|
-
height:
|
|
4994
|
+
type: N.chartType || "bar",
|
|
4995
|
+
data: f,
|
|
4996
|
+
width: N.w,
|
|
4997
|
+
height: N.h
|
|
4964
4998
|
}
|
|
4965
4999
|
)
|
|
4966
|
-
] },
|
|
5000
|
+
] }, E);
|
|
4967
5001
|
})
|
|
4968
5002
|
] }) });
|
|
4969
5003
|
}
|
|
4970
|
-
function
|
|
5004
|
+
function Xa(a) {
|
|
4971
5005
|
return new Date(a).toLocaleDateString("en-US", { year: "numeric", month: "short", day: "numeric" });
|
|
4972
5006
|
}
|
|
4973
|
-
function
|
|
4974
|
-
const { appearance:
|
|
5007
|
+
function ve({ onSelectQuery: a, onRunQuery: r, appearance: s }) {
|
|
5008
|
+
const { appearance: l } = D(), { queries: n, isLoading: u, error: c } = _a(), { execute: d, isLoading: i } = da(), o = s ?? l, m = $(async (p) => {
|
|
4975
5009
|
if (!p.generatedSql) return;
|
|
4976
|
-
const
|
|
4977
|
-
|
|
4978
|
-
}, [
|
|
4979
|
-
return /* @__PURE__ */ e(
|
|
5010
|
+
const g = await d({ sql: p.generatedSql });
|
|
5011
|
+
g && (r == null || r(g));
|
|
5012
|
+
}, [d, r]);
|
|
5013
|
+
return /* @__PURE__ */ e(j, { appearance: o, children: /* @__PURE__ */ t("div", { className: "ss-card ss-card-wide", children: [
|
|
4980
5014
|
/* @__PURE__ */ e("h2", { className: "ss-title", children: "Saved Queries" }),
|
|
4981
5015
|
u && /* @__PURE__ */ t("div", { className: "ss-loading", children: [
|
|
4982
5016
|
/* @__PURE__ */ e("span", { className: "ss-spinner" }),
|
|
4983
5017
|
" Loading..."
|
|
4984
5018
|
] }),
|
|
4985
|
-
|
|
5019
|
+
c && /* @__PURE__ */ e("div", { className: "ss-global-error", children: c }),
|
|
4986
5020
|
!u && n.length === 0 && /* @__PURE__ */ e("p", { className: "ss-empty", children: "No saved queries." }),
|
|
4987
5021
|
!u && n.map((p) => /* @__PURE__ */ t(
|
|
4988
5022
|
"div",
|
|
@@ -4996,17 +5030,17 @@ function xe({ onSelectQuery: a, onRunQuery: s, appearance: r }) {
|
|
|
4996
5030
|
] }),
|
|
4997
5031
|
p.naturalLanguage && /* @__PURE__ */ e("p", { className: "ss-saved-query-desc", children: p.naturalLanguage }),
|
|
4998
5032
|
/* @__PURE__ */ t("div", { className: "ss-saved-query-footer", children: [
|
|
4999
|
-
/* @__PURE__ */ e("span", { className: "ss-saved-query-date", children:
|
|
5033
|
+
/* @__PURE__ */ e("span", { className: "ss-saved-query-date", children: Xa(p.createdAt) }),
|
|
5000
5034
|
/* @__PURE__ */ e(
|
|
5001
5035
|
"button",
|
|
5002
5036
|
{
|
|
5003
5037
|
type: "button",
|
|
5004
5038
|
className: "ss-btn ss-btn-sm ss-btn-primary",
|
|
5005
|
-
disabled:
|
|
5006
|
-
onClick: (
|
|
5007
|
-
|
|
5039
|
+
disabled: i || !p.generatedSql,
|
|
5040
|
+
onClick: (g) => {
|
|
5041
|
+
g.stopPropagation(), m(p);
|
|
5008
5042
|
},
|
|
5009
|
-
children:
|
|
5043
|
+
children: i ? /* @__PURE__ */ e("span", { className: "ss-spinner" }) : "Run"
|
|
5010
5044
|
}
|
|
5011
5045
|
)
|
|
5012
5046
|
] })
|
|
@@ -5016,107 +5050,107 @@ function xe({ onSelectQuery: a, onRunQuery: s, appearance: r }) {
|
|
|
5016
5050
|
))
|
|
5017
5051
|
] }) });
|
|
5018
5052
|
}
|
|
5019
|
-
function
|
|
5053
|
+
function we({ embedToken: a, dashboardId: r, baseUrl: s = "https://api.saas-support.com/v1", refreshInterval: l, appearance: n }) {
|
|
5020
5054
|
const u = G(() => {
|
|
5021
|
-
const y = new Q(
|
|
5055
|
+
const y = new Q(s, { type: "embedToken", token: a });
|
|
5022
5056
|
return new ta(y);
|
|
5023
|
-
}, [a,
|
|
5024
|
-
|
|
5057
|
+
}, [a, s]), [c, d] = h([]), [i, o] = h(!0), [m, p] = h(null), g = G(() => aa(n), [n]), v = G(() => ea(g), [g]), x = $(async () => {
|
|
5058
|
+
o(!0), p(null);
|
|
5025
5059
|
try {
|
|
5026
|
-
const y = await u.getDashboard(
|
|
5027
|
-
|
|
5060
|
+
const y = await u.getDashboard(r), P = JSON.parse(y.layoutJson || "[]"), N = await Promise.all(
|
|
5061
|
+
P.map(async (E) => {
|
|
5028
5062
|
try {
|
|
5029
|
-
const C = await u.listQueries({ search:
|
|
5063
|
+
const C = await u.listQueries({ search: E.queryId, perPage: 1 });
|
|
5030
5064
|
if (C.data.length > 0 && C.data[0].generatedSql) {
|
|
5031
|
-
const
|
|
5032
|
-
return { ...
|
|
5065
|
+
const f = await u.executeQuery({ sql: C.data[0].generatedSql });
|
|
5066
|
+
return { ...E, result: f };
|
|
5033
5067
|
}
|
|
5034
5068
|
} catch {
|
|
5035
5069
|
}
|
|
5036
|
-
return
|
|
5070
|
+
return E;
|
|
5037
5071
|
})
|
|
5038
5072
|
);
|
|
5039
|
-
|
|
5073
|
+
d(N);
|
|
5040
5074
|
} catch (y) {
|
|
5041
5075
|
p(y instanceof Error ? y.message : "Failed to load dashboard");
|
|
5042
5076
|
} finally {
|
|
5043
|
-
|
|
5077
|
+
o(!1);
|
|
5044
5078
|
}
|
|
5045
|
-
}, [u,
|
|
5079
|
+
}, [u, r]);
|
|
5046
5080
|
return U(() => {
|
|
5047
|
-
|
|
5048
|
-
}, [
|
|
5049
|
-
if (!
|
|
5050
|
-
const y = setInterval(
|
|
5081
|
+
x();
|
|
5082
|
+
}, [x]), U(() => {
|
|
5083
|
+
if (!l || l <= 0) return;
|
|
5084
|
+
const y = setInterval(x, l * 1e3);
|
|
5051
5085
|
return () => clearInterval(y);
|
|
5052
|
-
}, [
|
|
5086
|
+
}, [l, x]), /* @__PURE__ */ e(
|
|
5053
5087
|
"div",
|
|
5054
5088
|
{
|
|
5055
5089
|
ref: (y) => {
|
|
5056
5090
|
if (!y || y.shadowRoot) return;
|
|
5057
|
-
const
|
|
5058
|
-
|
|
5059
|
-
const
|
|
5060
|
-
|
|
5091
|
+
const P = y.attachShadow({ mode: "open" }), N = document.createElement("style");
|
|
5092
|
+
N.textContent = v, P.appendChild(N);
|
|
5093
|
+
const E = document.createElement("div");
|
|
5094
|
+
P.appendChild(E);
|
|
5061
5095
|
},
|
|
5062
5096
|
style: { display: "contents" },
|
|
5063
5097
|
children: /* @__PURE__ */ t("div", { className: "ss-dashboard-grid", children: [
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
!
|
|
5098
|
+
i && /* @__PURE__ */ e("div", { className: "ss-loading", children: "Loading dashboard..." }),
|
|
5099
|
+
m && /* @__PURE__ */ e("div", { className: "ss-global-error", children: m }),
|
|
5100
|
+
!i && c.map((y, P) => {
|
|
5067
5101
|
if (!y.result) return null;
|
|
5068
|
-
const { columns:
|
|
5102
|
+
const { columns: N, rows: E } = y.result;
|
|
5069
5103
|
return /* @__PURE__ */ t("div", { className: "ss-widget", children: [
|
|
5070
5104
|
y.title && /* @__PURE__ */ e("h4", { className: "ss-widget-header", children: y.title }),
|
|
5071
5105
|
/* @__PURE__ */ t("table", { className: "ss-table", children: [
|
|
5072
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { children:
|
|
5073
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
5106
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { children: N.map((C) => /* @__PURE__ */ e("th", { className: "ss-th", children: C }, C)) }) }),
|
|
5107
|
+
/* @__PURE__ */ e("tbody", { children: E.slice(0, 50).map((C, f) => /* @__PURE__ */ e("tr", { className: "ss-tr", children: N.map((O) => /* @__PURE__ */ e("td", { className: "ss-td", children: String(C[O] ?? "") }, O)) }, f)) })
|
|
5074
5108
|
] })
|
|
5075
|
-
] },
|
|
5109
|
+
] }, P);
|
|
5076
5110
|
})
|
|
5077
5111
|
] })
|
|
5078
5112
|
}
|
|
5079
5113
|
);
|
|
5080
5114
|
}
|
|
5081
5115
|
export {
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5116
|
+
Ka as Chart,
|
|
5117
|
+
ge as CouponInput,
|
|
5118
|
+
ye as DashboardView,
|
|
5119
|
+
Ga as DataTable,
|
|
5120
|
+
qa as InvoiceHistory,
|
|
5121
|
+
de as OrgSwitcher,
|
|
5122
|
+
he as PaymentPortal,
|
|
5123
|
+
ue as PricingTable,
|
|
5124
|
+
xe as QueryInput,
|
|
5125
|
+
we as ReportEmbed,
|
|
5092
5126
|
ra as SaaSContext,
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5127
|
+
$e as SaaSError,
|
|
5128
|
+
re as SaaSProvider,
|
|
5129
|
+
ya as SaaSSupport,
|
|
5130
|
+
ve as SavedQueryList,
|
|
5131
|
+
Ea as SettingsPanel,
|
|
5132
|
+
oe as SignIn,
|
|
5133
|
+
ie as SignUp,
|
|
5134
|
+
Ua as SubscriptionStatus,
|
|
5135
|
+
Wa as UsageDisplay,
|
|
5136
|
+
le as UserButton,
|
|
5137
|
+
ce as UserProfile,
|
|
5138
|
+
va as isMfaRequired,
|
|
5105
5139
|
sa as useAuth,
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5140
|
+
pe as useBilling,
|
|
5141
|
+
fe as useDashboard,
|
|
5142
|
+
Pa as useDeleteAccount,
|
|
5143
|
+
be as useEmbedDashboard,
|
|
5144
|
+
Da as useInvoices,
|
|
5111
5145
|
Y as useOrg,
|
|
5112
5146
|
oa as useProfile,
|
|
5113
5147
|
da as useQuery,
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5148
|
+
me as useReport,
|
|
5149
|
+
D as useSaaSContext,
|
|
5150
|
+
_a as useSavedQueries,
|
|
5117
5151
|
na as useSignIn,
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5152
|
+
za as useSignUp,
|
|
5153
|
+
Ta as useSubscription,
|
|
5154
|
+
Ma as useUsage,
|
|
5155
|
+
ne as useUser
|
|
5122
5156
|
};
|