@carlonicora/nextjs-jsonapi 1.79.0 → 1.80.0
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/{AssistantMessageInterface-DWnbd6J7.d.ts → AssistantMessageInterface-BpEhx2pC.d.ts} +18 -1
- package/dist/{AssistantMessageInterface-Mla6kgPe.d.mts → AssistantMessageInterface-DJ3Me16Y.d.mts} +18 -1
- package/dist/{BlockNoteEditor-6CBDTVKV.mjs → BlockNoteEditor-3M5PD3BZ.mjs} +4 -4
- package/dist/{BlockNoteEditor-EH4HWI7H.js → BlockNoteEditor-YLTPJPTV.js} +14 -14
- package/dist/{BlockNoteEditor-EH4HWI7H.js.map → BlockNoteEditor-YLTPJPTV.js.map} +1 -1
- package/dist/billing/index.js +346 -346
- package/dist/billing/index.mjs +3 -3
- package/dist/{chunk-ZDP3MBUI.js → chunk-4NOQNTFI.js} +1151 -740
- package/dist/chunk-4NOQNTFI.js.map +1 -0
- package/dist/{chunk-BKM5U3DE.mjs → chunk-6UMB5LTQ.mjs} +98 -7
- package/dist/chunk-6UMB5LTQ.mjs.map +1 -0
- package/dist/{chunk-5IEWLLLD.js → chunk-N4YZ45SK.js} +115 -24
- package/dist/chunk-N4YZ45SK.js.map +1 -0
- package/dist/{chunk-ENRSFVOS.mjs → chunk-NQV5RDCK.mjs} +1112 -701
- package/dist/chunk-NQV5RDCK.mjs.map +1 -0
- package/dist/{chunk-MEWXQEVE.mjs → chunk-PV5V6CVW.mjs} +2 -2
- package/dist/{chunk-TWDSDTHU.js → chunk-ZEJSPTHS.js} +7 -7
- package/dist/{chunk-TWDSDTHU.js.map → chunk-ZEJSPTHS.js.map} +1 -1
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.d.mts +25 -7
- package/dist/components/index.d.ts +25 -7
- package/dist/components/index.js +6 -4
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +5 -3
- package/dist/contexts/index.d.mts +1 -1
- package/dist/contexts/index.d.ts +1 -1
- package/dist/contexts/index.js +4 -4
- package/dist/contexts/index.mjs +3 -3
- package/dist/core/index.d.mts +35 -3
- package/dist/core/index.d.ts +35 -3
- package/dist/core/index.js +6 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +5 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -2
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +1 -1
- package/package.json +1 -1
- package/src/core/index.ts +2 -0
- package/src/core/registry/ModuleRegistry.ts +1 -0
- package/src/features/assistant/components/parts/AssistantThread.tsx +1 -1
- package/src/features/assistant-message/AssistantMessageModule.ts +4 -0
- package/src/features/assistant-message/components/MessageItem.tsx +7 -7
- package/src/features/assistant-message/components/MessageList.tsx +1 -1
- package/src/features/assistant-message/components/__tests__/MessageItem.spec.tsx +11 -7
- package/src/features/assistant-message/components/index.ts +1 -0
- package/src/features/assistant-message/components/parts/MessageSourcesContainer.tsx +135 -0
- package/src/features/assistant-message/components/parts/MessageSourcesPanel.tsx +151 -0
- package/src/features/assistant-message/components/parts/RelevanceMeter.tsx +29 -0
- package/src/features/assistant-message/components/parts/__tests__/MessageSourcesPanel.spec.tsx +70 -0
- package/src/features/assistant-message/components/parts/tabs/CitationsTab.tsx +105 -0
- package/src/features/assistant-message/components/parts/tabs/ContentsTab.tsx +88 -0
- package/src/features/assistant-message/components/parts/tabs/ReferencesTab.tsx +51 -0
- package/src/features/assistant-message/components/parts/tabs/SuggestedQuestionsTab.tsx +24 -0
- package/src/features/assistant-message/components/parts/tabs/UsersTab.tsx +142 -0
- package/src/features/assistant-message/data/AssistantMessage.ts +20 -0
- package/src/features/assistant-message/data/AssistantMessageInterface.ts +2 -0
- package/src/features/assistant-message/data/AssistantMessageService.ts +13 -4
- package/src/features/assistant-message/data/__tests__/AssistantMessage.citations.spec.ts +65 -0
- package/src/features/assistant-message/data/__tests__/AssistantMessage.spec.ts +8 -0
- package/src/features/chunk/ChunkModule.ts +18 -0
- package/src/features/chunk/data/Chunk.ts +49 -0
- package/src/features/chunk/data/ChunkInput.ts +3 -0
- package/src/features/chunk/data/ChunkInterface.ts +18 -0
- package/src/features/chunk/data/__tests__/Chunk.spec.ts +83 -0
- package/src/features/chunk/data/index.ts +3 -0
- package/src/features/chunk/index.ts +2 -0
- package/dist/chunk-5IEWLLLD.js.map +0 -1
- package/dist/chunk-BKM5U3DE.mjs.map +0 -1
- package/dist/chunk-ENRSFVOS.mjs.map +0 -1
- package/dist/chunk-ZDP3MBUI.js.map +0 -1
- package/src/features/assistant-message/components/parts/ReferenceBadges.tsx +0 -46
- package/src/features/assistant-message/components/parts/SuggestedFollowUps.tsx +0 -52
- package/src/features/assistant-message/components/parts/__tests__/ReferenceBadges.spec.tsx +0 -59
- package/src/features/assistant-message/components/parts/__tests__/SuggestedFollowUps.spec.tsx +0 -29
- /package/dist/{BlockNoteEditor-6CBDTVKV.mjs.map → BlockNoteEditor-3M5PD3BZ.mjs.map} +0 -0
- /package/dist/{chunk-MEWXQEVE.mjs.map → chunk-PV5V6CVW.mjs.map} +0 -0
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
useI18nLocale,
|
|
21
21
|
useI18nRouter,
|
|
22
22
|
useI18nTranslations
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-PV5V6CVW.mjs";
|
|
24
24
|
import {
|
|
25
25
|
AVAILABLE_OAUTH_SCOPES,
|
|
26
26
|
AssistantMessage,
|
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
CompanyService,
|
|
32
32
|
ContentService,
|
|
33
33
|
DEFAULT_GRANT_TYPES,
|
|
34
|
+
EndpointCreator,
|
|
34
35
|
FeatureService,
|
|
35
36
|
HowTo,
|
|
36
37
|
HowToService,
|
|
@@ -59,7 +60,7 @@ import {
|
|
|
59
60
|
showToast,
|
|
60
61
|
useComposedRefs,
|
|
61
62
|
useIsMobile
|
|
62
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-6UMB5LTQ.mjs";
|
|
63
64
|
import {
|
|
64
65
|
JsonApiContext
|
|
65
66
|
} from "./chunk-VOXD3ZLY.mjs";
|
|
@@ -9198,7 +9199,7 @@ __name(FormCheckbox, "FormCheckbox");
|
|
|
9198
9199
|
import dynamic from "next/dynamic";
|
|
9199
9200
|
import React14 from "react";
|
|
9200
9201
|
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
9201
|
-
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-
|
|
9202
|
+
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-3M5PD3BZ.mjs"), {
|
|
9202
9203
|
ssr: false
|
|
9203
9204
|
});
|
|
9204
9205
|
var BlockNoteEditorContainer = React14.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
|
|
@@ -10113,7 +10114,7 @@ function UserAvatar({ user, className, showFull, showLink, showTooltip = true })
|
|
|
10113
10114
|
if (!param) return "";
|
|
10114
10115
|
return param[0].toUpperCase();
|
|
10115
10116
|
}, "getInitial");
|
|
10116
|
-
const
|
|
10117
|
+
const getInitials3 = /* @__PURE__ */ __name((name) => {
|
|
10117
10118
|
const words = name.split(" ");
|
|
10118
10119
|
const initials = words.length > 1 ? getInitial(words[0][0]) + getInitial(words[words.length - 1][0]) : getInitial(words[0][0]);
|
|
10119
10120
|
return initials ?? "";
|
|
@@ -10121,7 +10122,7 @@ function UserAvatar({ user, className, showFull, showLink, showTooltip = true })
|
|
|
10121
10122
|
const getAvatar = /* @__PURE__ */ __name(() => {
|
|
10122
10123
|
return /* @__PURE__ */ jsx88("div", { className: "*:ring-border *:ring-1", children: /* @__PURE__ */ jsxs55(Avatar, { className: `h-6 w-6 ${className}`, children: [
|
|
10123
10124
|
/* @__PURE__ */ jsx88(AvatarImage, { className: "object-cover", src: user?.avatar }),
|
|
10124
|
-
/* @__PURE__ */ jsx88(AvatarFallback, { children:
|
|
10125
|
+
/* @__PURE__ */ jsx88(AvatarFallback, { children: getInitials3(user.name) })
|
|
10125
10126
|
] }) });
|
|
10126
10127
|
}, "getAvatar");
|
|
10127
10128
|
const content = showLink === false ? (
|
|
@@ -17627,25 +17628,36 @@ function AssistantThreadHeader({ assistant, onRename, onDelete }) {
|
|
|
17627
17628
|
__name(AssistantThreadHeader, "AssistantThreadHeader");
|
|
17628
17629
|
|
|
17629
17630
|
// src/features/assistant/components/parts/AssistantThread.tsx
|
|
17630
|
-
import { useEffect as
|
|
17631
|
+
import { useEffect as useEffect59, useRef as useRef29 } from "react";
|
|
17631
17632
|
|
|
17632
17633
|
// src/features/assistant-message/components/MessageItem.tsx
|
|
17633
|
-
import { useTranslations as
|
|
17634
|
+
import { useTranslations as useTranslations93 } from "next-intl";
|
|
17634
17635
|
import { Sparkles as Sparkles2, AlertCircle } from "lucide-react";
|
|
17635
|
-
import
|
|
17636
|
-
import
|
|
17636
|
+
import ReactMarkdown3 from "react-markdown";
|
|
17637
|
+
import remarkGfm3 from "remark-gfm";
|
|
17638
|
+
|
|
17639
|
+
// src/features/assistant-message/components/parts/MessageSourcesContainer.tsx
|
|
17640
|
+
import { useEffect as useEffect58, useMemo as useMemo31, useState as useState81 } from "react";
|
|
17637
17641
|
|
|
17638
|
-
// src/features/assistant-message/components/parts/
|
|
17642
|
+
// src/features/assistant-message/components/parts/MessageSourcesPanel.tsx
|
|
17643
|
+
import { useMemo as useMemo30, useState as useState80 } from "react";
|
|
17644
|
+
import { useTranslations as useTranslations92 } from "next-intl";
|
|
17645
|
+
import { ChevronDown as ChevronDown4, ChevronRight as ChevronRight2 } from "lucide-react";
|
|
17646
|
+
|
|
17647
|
+
// src/features/assistant-message/components/parts/tabs/ReferencesTab.tsx
|
|
17639
17648
|
import Link3 from "next/link";
|
|
17640
17649
|
import { useTranslations as useTranslations88 } from "next-intl";
|
|
17641
17650
|
import { jsx as jsx203, jsxs as jsxs123 } from "react/jsx-runtime";
|
|
17642
|
-
function
|
|
17651
|
+
function ReferencesTab({ references }) {
|
|
17643
17652
|
const t = useTranslations88();
|
|
17644
17653
|
const generate = usePageUrlGenerator();
|
|
17645
17654
|
if (references.length === 0) return null;
|
|
17646
|
-
return /* @__PURE__ */ jsxs123(
|
|
17647
|
-
/* @__PURE__ */ jsx203(
|
|
17648
|
-
|
|
17655
|
+
return /* @__PURE__ */ jsxs123(Table, { children: [
|
|
17656
|
+
/* @__PURE__ */ jsx203(TableHeader, { children: /* @__PURE__ */ jsxs123(TableRow, { children: [
|
|
17657
|
+
/* @__PURE__ */ jsx203(TableHead, { children: t("features.assistant.message.sources.source") }),
|
|
17658
|
+
/* @__PURE__ */ jsx203(TableHead, { className: "w-32", children: t("features.assistant.message.sources.type") })
|
|
17659
|
+
] }) }),
|
|
17660
|
+
/* @__PURE__ */ jsx203(TableBody, { children: references.map((ref) => {
|
|
17649
17661
|
let module;
|
|
17650
17662
|
try {
|
|
17651
17663
|
module = ModuleRegistry.findByName(ref.type);
|
|
@@ -17653,94 +17665,492 @@ function ReferenceBadges({ references }) {
|
|
|
17653
17665
|
return null;
|
|
17654
17666
|
}
|
|
17655
17667
|
const href = generate({ page: module, id: ref.id });
|
|
17656
|
-
return /* @__PURE__ */ jsxs123(
|
|
17657
|
-
Link3,
|
|
17658
|
-
{
|
|
17659
|
-
|
|
17660
|
-
|
|
17661
|
-
rel: "noopener noreferrer",
|
|
17662
|
-
className: "bg-background border-border text-foreground hover:bg-accent inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 text-xs",
|
|
17663
|
-
children: [
|
|
17664
|
-
/* @__PURE__ */ jsx203("span", { className: "text-muted-foreground text-[10px]", children: module.name }),
|
|
17665
|
-
/* @__PURE__ */ jsx203("span", { className: "font-medium", children: ref.identifier })
|
|
17666
|
-
]
|
|
17667
|
-
},
|
|
17668
|
-
`${ref.type}/${ref.id}`
|
|
17669
|
-
);
|
|
17670
|
-
})
|
|
17668
|
+
return /* @__PURE__ */ jsxs123(TableRow, { children: [
|
|
17669
|
+
/* @__PURE__ */ jsx203(TableCell, { children: /* @__PURE__ */ jsx203(Link3, { href, target: "_blank", rel: "noopener noreferrer", className: "font-medium hover:underline", children: ref.identifier }) }),
|
|
17670
|
+
/* @__PURE__ */ jsx203(TableCell, { className: "text-muted-foreground text-xs", children: module.name })
|
|
17671
|
+
] }, `${ref.type}/${ref.id}`);
|
|
17672
|
+
}) })
|
|
17671
17673
|
] });
|
|
17672
17674
|
}
|
|
17673
|
-
__name(
|
|
17675
|
+
__name(ReferencesTab, "ReferencesTab");
|
|
17674
17676
|
|
|
17675
|
-
// src/features/assistant-message/components/parts/
|
|
17676
|
-
import { useState as useState79 } from "react";
|
|
17677
|
+
// src/features/assistant-message/components/parts/tabs/CitationsTab.tsx
|
|
17678
|
+
import { Fragment as Fragment43, useState as useState79 } from "react";
|
|
17677
17679
|
import { useTranslations as useTranslations89 } from "next-intl";
|
|
17678
|
-
import {
|
|
17679
|
-
import
|
|
17680
|
-
|
|
17680
|
+
import { ChevronDown as ChevronDown3, HelpCircle } from "lucide-react";
|
|
17681
|
+
import ReactMarkdown2 from "react-markdown";
|
|
17682
|
+
import remarkGfm2 from "remark-gfm";
|
|
17683
|
+
|
|
17684
|
+
// src/features/assistant-message/components/parts/RelevanceMeter.tsx
|
|
17685
|
+
import { jsx as jsx204, jsxs as jsxs124 } from "react/jsx-runtime";
|
|
17686
|
+
function RelevanceMeter({ value, className = "" }) {
|
|
17687
|
+
const pct = Math.max(0, Math.min(100, value <= 1 ? value * 100 : value));
|
|
17688
|
+
const label = `${Math.round(pct)}%`;
|
|
17689
|
+
return /* @__PURE__ */ jsxs124(
|
|
17690
|
+
"div",
|
|
17691
|
+
{
|
|
17692
|
+
role: "meter",
|
|
17693
|
+
"aria-valuenow": Math.round(pct),
|
|
17694
|
+
"aria-valuemin": 0,
|
|
17695
|
+
"aria-valuemax": 100,
|
|
17696
|
+
"aria-label": `Relevance ${label}`,
|
|
17697
|
+
className: `bg-muted relative mx-auto flex h-5 w-20 items-center justify-center overflow-hidden rounded border ${className}`,
|
|
17698
|
+
children: [
|
|
17699
|
+
/* @__PURE__ */ jsx204("div", { className: "bg-accent absolute top-0 left-0 h-full", style: { width: `${pct}%` } }),
|
|
17700
|
+
/* @__PURE__ */ jsx204(
|
|
17701
|
+
"span",
|
|
17702
|
+
{
|
|
17703
|
+
className: `relative text-xs ${pct < 40 ? "text-muted-foreground" : "text-accent-foreground font-semibold"}`,
|
|
17704
|
+
children: label
|
|
17705
|
+
}
|
|
17706
|
+
)
|
|
17707
|
+
]
|
|
17708
|
+
}
|
|
17709
|
+
);
|
|
17710
|
+
}
|
|
17711
|
+
__name(RelevanceMeter, "RelevanceMeter");
|
|
17712
|
+
|
|
17713
|
+
// src/features/assistant-message/components/parts/tabs/CitationsTab.tsx
|
|
17714
|
+
import { jsx as jsx205, jsxs as jsxs125 } from "react/jsx-runtime";
|
|
17715
|
+
function CitationsTab({ citations, sources }) {
|
|
17681
17716
|
const t = useTranslations89();
|
|
17682
|
-
const [
|
|
17717
|
+
const [expanded, setExpanded] = useState79(/* @__PURE__ */ new Set());
|
|
17718
|
+
if (citations.length === 0) return null;
|
|
17719
|
+
const sorted = [...citations].sort((a, b) => (b.relevance ?? 0) - (a.relevance ?? 0));
|
|
17720
|
+
const toggle = /* @__PURE__ */ __name((id) => {
|
|
17721
|
+
setExpanded((prev) => {
|
|
17722
|
+
const next = new Set(prev);
|
|
17723
|
+
if (next.has(id)) next.delete(id);
|
|
17724
|
+
else next.add(id);
|
|
17725
|
+
return next;
|
|
17726
|
+
});
|
|
17727
|
+
}, "toggle");
|
|
17728
|
+
return /* @__PURE__ */ jsxs125(Table, { className: "table-fixed", children: [
|
|
17729
|
+
/* @__PURE__ */ jsx205(TableHeader, { children: /* @__PURE__ */ jsxs125(TableRow, { children: [
|
|
17730
|
+
/* @__PURE__ */ jsx205(TableHead, { children: t("features.assistant.message.sources.source") }),
|
|
17731
|
+
/* @__PURE__ */ jsx205(TableHead, { className: "w-28 text-center", children: t("features.assistant.message.sources.relevance") })
|
|
17732
|
+
] }) }),
|
|
17733
|
+
/* @__PURE__ */ jsx205(TableBody, { children: sorted.map((chunk) => {
|
|
17734
|
+
const isOpen = expanded.has(chunk.id);
|
|
17735
|
+
const resolved = chunk.nodeId ? sources?.get(chunk.nodeId) : void 0;
|
|
17736
|
+
const fallbackName = chunk.nodeId ? `${chunk.nodeType ?? t("features.assistant.message.sources.source")} ${chunk.nodeId.slice(0, 8)}` : chunk.nodeType ?? t("features.assistant.message.sources.source");
|
|
17737
|
+
const sourceName = resolved?.name ?? fallbackName;
|
|
17738
|
+
return /* @__PURE__ */ jsxs125(Fragment43, { children: [
|
|
17739
|
+
/* @__PURE__ */ jsxs125(TableRow, { children: [
|
|
17740
|
+
/* @__PURE__ */ jsx205(TableCell, { children: /* @__PURE__ */ jsxs125(
|
|
17741
|
+
"div",
|
|
17742
|
+
{
|
|
17743
|
+
role: "button",
|
|
17744
|
+
tabIndex: 0,
|
|
17745
|
+
onClick: () => toggle(chunk.id),
|
|
17746
|
+
onKeyDown: (e) => {
|
|
17747
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
17748
|
+
e.preventDefault();
|
|
17749
|
+
toggle(chunk.id);
|
|
17750
|
+
}
|
|
17751
|
+
},
|
|
17752
|
+
"aria-expanded": isOpen,
|
|
17753
|
+
className: "flex w-full cursor-pointer items-center justify-start gap-x-2",
|
|
17754
|
+
children: [
|
|
17755
|
+
/* @__PURE__ */ jsx205(ChevronDown3, { className: cn("h-4 w-4 transition-transform", !isOpen && "-rotate-90") }),
|
|
17756
|
+
/* @__PURE__ */ jsx205("span", { className: "font-semibold", children: sourceName }),
|
|
17757
|
+
chunk.reason && /* @__PURE__ */ jsxs125(Tooltip2, { children: [
|
|
17758
|
+
/* @__PURE__ */ jsx205(TooltipTrigger, { className: "text-muted-foreground inline-flex", children: /* @__PURE__ */ jsx205(HelpCircle, { className: "h-3.5 w-3.5" }) }),
|
|
17759
|
+
/* @__PURE__ */ jsx205(TooltipContent, { className: "max-w-64 text-xs", children: chunk.reason })
|
|
17760
|
+
] })
|
|
17761
|
+
]
|
|
17762
|
+
}
|
|
17763
|
+
) }),
|
|
17764
|
+
/* @__PURE__ */ jsx205(TableCell, { className: "text-center", children: /* @__PURE__ */ jsx205(RelevanceMeter, { value: chunk.relevance ?? 0 }) })
|
|
17765
|
+
] }),
|
|
17766
|
+
isOpen && /* @__PURE__ */ jsx205(TableRow, { children: /* @__PURE__ */ jsx205(TableCell, { colSpan: 2, className: "border-t-0 p-4", children: /* @__PURE__ */ jsx205("div", { className: "bg-card w-full max-w-full overflow-x-auto rounded border p-4 text-sm break-words", children: /* @__PURE__ */ jsx205(ReactMarkdown2, { remarkPlugins: [remarkGfm2], children: chunk.content }) }) }) })
|
|
17767
|
+
] }, chunk.id);
|
|
17768
|
+
}) })
|
|
17769
|
+
] });
|
|
17770
|
+
}
|
|
17771
|
+
__name(CitationsTab, "CitationsTab");
|
|
17772
|
+
|
|
17773
|
+
// src/features/assistant-message/components/parts/tabs/ContentsTab.tsx
|
|
17774
|
+
import Link4 from "next/link";
|
|
17775
|
+
import { useTranslations as useTranslations90 } from "next-intl";
|
|
17776
|
+
import { jsx as jsx206, jsxs as jsxs126 } from "react/jsx-runtime";
|
|
17777
|
+
function ContentsTab({ citations, sources }) {
|
|
17778
|
+
const t = useTranslations90();
|
|
17779
|
+
const generate = usePageUrlGenerator();
|
|
17780
|
+
const map = /* @__PURE__ */ new Map();
|
|
17781
|
+
for (const c of citations) {
|
|
17782
|
+
const id = c.nodeId;
|
|
17783
|
+
if (!id) continue;
|
|
17784
|
+
const source = sources?.get(id);
|
|
17785
|
+
if (!source) continue;
|
|
17786
|
+
const existing = map.get(id);
|
|
17787
|
+
if (existing) {
|
|
17788
|
+
existing.citationCount++;
|
|
17789
|
+
existing.maxRelevance = Math.max(existing.maxRelevance, c.relevance ?? 0);
|
|
17790
|
+
} else {
|
|
17791
|
+
map.set(id, { source, citationCount: 1, maxRelevance: c.relevance ?? 0 });
|
|
17792
|
+
}
|
|
17793
|
+
}
|
|
17794
|
+
const rows = Array.from(map.values()).sort(
|
|
17795
|
+
(a, b) => b.maxRelevance - a.maxRelevance || (a.source.name ?? "").localeCompare(b.source.name ?? "")
|
|
17796
|
+
);
|
|
17797
|
+
if (rows.length === 0) return null;
|
|
17798
|
+
return /* @__PURE__ */ jsxs126(Table, { children: [
|
|
17799
|
+
/* @__PURE__ */ jsx206(TableHeader, { children: /* @__PURE__ */ jsxs126(TableRow, { children: [
|
|
17800
|
+
/* @__PURE__ */ jsx206(TableHead, { children: t("features.assistant.message.sources.source") }),
|
|
17801
|
+
/* @__PURE__ */ jsx206(TableHead, { className: "w-32", children: t("features.assistant.message.sources.type") })
|
|
17802
|
+
] }) }),
|
|
17803
|
+
/* @__PURE__ */ jsx206(TableBody, { children: rows.map(({ source, citationCount }) => {
|
|
17804
|
+
let module;
|
|
17805
|
+
try {
|
|
17806
|
+
module = ModuleRegistry.findByName(source.type);
|
|
17807
|
+
} catch {
|
|
17808
|
+
return null;
|
|
17809
|
+
}
|
|
17810
|
+
const href = generate({ page: module, id: source.id });
|
|
17811
|
+
const name = source.name ?? source.identifier;
|
|
17812
|
+
return /* @__PURE__ */ jsxs126(TableRow, { children: [
|
|
17813
|
+
/* @__PURE__ */ jsx206(TableCell, { children: /* @__PURE__ */ jsxs126(Link4, { href, target: "_blank", rel: "noopener noreferrer", className: "hover:underline", children: [
|
|
17814
|
+
/* @__PURE__ */ jsx206("span", { className: "font-medium", children: name }),
|
|
17815
|
+
" ",
|
|
17816
|
+
/* @__PURE__ */ jsx206("span", { className: "text-muted-foreground text-xs", children: t("features.assistant.message.sources.citations_count", {
|
|
17817
|
+
count: citationCount
|
|
17818
|
+
}) })
|
|
17819
|
+
] }) }),
|
|
17820
|
+
/* @__PURE__ */ jsx206(TableCell, { className: "text-muted-foreground text-xs", children: module.name })
|
|
17821
|
+
] }, `${source.type}/${source.id}`);
|
|
17822
|
+
}) })
|
|
17823
|
+
] });
|
|
17824
|
+
}
|
|
17825
|
+
__name(ContentsTab, "ContentsTab");
|
|
17826
|
+
|
|
17827
|
+
// src/features/assistant-message/components/parts/tabs/UsersTab.tsx
|
|
17828
|
+
import Link5 from "next/link";
|
|
17829
|
+
import { useTranslations as useTranslations91 } from "next-intl";
|
|
17830
|
+
import { jsx as jsx207, jsxs as jsxs127 } from "react/jsx-runtime";
|
|
17831
|
+
function getInitials2(name) {
|
|
17832
|
+
return name.split(/\s+/).map((p) => p.charAt(0)).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
17833
|
+
}
|
|
17834
|
+
__name(getInitials2, "getInitials");
|
|
17835
|
+
function readAuthor(source) {
|
|
17836
|
+
try {
|
|
17837
|
+
const a = source.author;
|
|
17838
|
+
return a && a.id ? a : void 0;
|
|
17839
|
+
} catch {
|
|
17840
|
+
return void 0;
|
|
17841
|
+
}
|
|
17842
|
+
}
|
|
17843
|
+
__name(readAuthor, "readAuthor");
|
|
17844
|
+
function UsersTab({ users, citations, sources }) {
|
|
17845
|
+
const t = useTranslations91();
|
|
17846
|
+
const generate = usePageUrlGenerator();
|
|
17847
|
+
const userMap = /* @__PURE__ */ new Map();
|
|
17848
|
+
for (const u of users) {
|
|
17849
|
+
if (!u?.id) continue;
|
|
17850
|
+
userMap.set(u.id, { user: u, contentCount: 0, citationCount: 0 });
|
|
17851
|
+
}
|
|
17852
|
+
if (citations && sources) {
|
|
17853
|
+
const sourceUserPairs = /* @__PURE__ */ new Set();
|
|
17854
|
+
for (const c of citations) {
|
|
17855
|
+
const id = c.nodeId;
|
|
17856
|
+
if (!id) continue;
|
|
17857
|
+
const source = sources.get(id);
|
|
17858
|
+
if (!source) continue;
|
|
17859
|
+
const author = readAuthor(source);
|
|
17860
|
+
if (!author) continue;
|
|
17861
|
+
let row = userMap.get(author.id);
|
|
17862
|
+
if (!row) {
|
|
17863
|
+
row = { user: author, contentCount: 0, citationCount: 0 };
|
|
17864
|
+
userMap.set(author.id, row);
|
|
17865
|
+
}
|
|
17866
|
+
const sourceUserKey = `${source.id}:${author.id}`;
|
|
17867
|
+
if (!sourceUserPairs.has(sourceUserKey)) {
|
|
17868
|
+
sourceUserPairs.add(sourceUserKey);
|
|
17869
|
+
row.contentCount++;
|
|
17870
|
+
}
|
|
17871
|
+
row.citationCount++;
|
|
17872
|
+
}
|
|
17873
|
+
}
|
|
17874
|
+
const rows = Array.from(userMap.values()).sort(
|
|
17875
|
+
(a, b) => b.citationCount - a.citationCount || (a.user.name ?? "").localeCompare(b.user.name ?? "")
|
|
17876
|
+
);
|
|
17877
|
+
if (rows.length === 0) return null;
|
|
17878
|
+
return /* @__PURE__ */ jsx207(Table, { children: /* @__PURE__ */ jsx207(TableBody, { children: rows.map(({ user, contentCount, citationCount }) => {
|
|
17879
|
+
let module;
|
|
17880
|
+
try {
|
|
17881
|
+
module = ModuleRegistry.findByName(user.type);
|
|
17882
|
+
} catch {
|
|
17883
|
+
return null;
|
|
17884
|
+
}
|
|
17885
|
+
const href = generate({ page: module, id: user.id });
|
|
17886
|
+
const name = user.name ?? user.fullName ?? user.identifier ?? "User";
|
|
17887
|
+
const avatarUrl = user.avatar;
|
|
17888
|
+
const showCounts = citationCount > 0 || contentCount > 0;
|
|
17889
|
+
return /* @__PURE__ */ jsx207(TableRow, { children: /* @__PURE__ */ jsx207(TableCell, { children: /* @__PURE__ */ jsxs127(
|
|
17890
|
+
Link5,
|
|
17891
|
+
{
|
|
17892
|
+
href,
|
|
17893
|
+
target: "_blank",
|
|
17894
|
+
rel: "noopener noreferrer",
|
|
17895
|
+
className: "flex items-center gap-3 hover:underline",
|
|
17896
|
+
children: [
|
|
17897
|
+
/* @__PURE__ */ jsxs127(Avatar, { className: "h-7 w-7", children: [
|
|
17898
|
+
/* @__PURE__ */ jsx207(AvatarImage, { src: avatarUrl, "aria-label": name }),
|
|
17899
|
+
/* @__PURE__ */ jsx207(AvatarFallback, { "aria-label": name, children: getInitials2(name) })
|
|
17900
|
+
] }),
|
|
17901
|
+
/* @__PURE__ */ jsxs127("span", { className: "flex flex-col", children: [
|
|
17902
|
+
/* @__PURE__ */ jsx207("span", { className: "font-medium", children: name }),
|
|
17903
|
+
showCounts && /* @__PURE__ */ jsxs127("span", { className: "text-muted-foreground text-xs", children: [
|
|
17904
|
+
t("features.assistant.message.sources.contents_count", {
|
|
17905
|
+
count: contentCount
|
|
17906
|
+
}),
|
|
17907
|
+
" \xB7 ",
|
|
17908
|
+
t("features.assistant.message.sources.citations_count", {
|
|
17909
|
+
count: citationCount
|
|
17910
|
+
})
|
|
17911
|
+
] })
|
|
17912
|
+
] })
|
|
17913
|
+
]
|
|
17914
|
+
}
|
|
17915
|
+
) }) }, user.id);
|
|
17916
|
+
}) }) });
|
|
17917
|
+
}
|
|
17918
|
+
__name(UsersTab, "UsersTab");
|
|
17919
|
+
|
|
17920
|
+
// src/features/assistant-message/components/parts/tabs/SuggestedQuestionsTab.tsx
|
|
17921
|
+
import { jsx as jsx208 } from "react/jsx-runtime";
|
|
17922
|
+
function SuggestedQuestionsTab({ questions, onSelect }) {
|
|
17683
17923
|
if (questions.length === 0) return null;
|
|
17684
|
-
return /* @__PURE__ */
|
|
17685
|
-
|
|
17924
|
+
return /* @__PURE__ */ jsx208("div", { className: "flex flex-col gap-1", children: questions.map((q) => /* @__PURE__ */ jsx208(
|
|
17925
|
+
"button",
|
|
17926
|
+
{
|
|
17927
|
+
type: "button",
|
|
17928
|
+
onClick: () => onSelect(q),
|
|
17929
|
+
className: "border-border bg-muted/30 hover:bg-muted rounded-md border px-3 py-1.5 text-left text-sm",
|
|
17930
|
+
children: q
|
|
17931
|
+
},
|
|
17932
|
+
q
|
|
17933
|
+
)) });
|
|
17934
|
+
}
|
|
17935
|
+
__name(SuggestedQuestionsTab, "SuggestedQuestionsTab");
|
|
17936
|
+
|
|
17937
|
+
// src/features/assistant-message/components/parts/MessageSourcesPanel.tsx
|
|
17938
|
+
import { jsx as jsx209, jsxs as jsxs128 } from "react/jsx-runtime";
|
|
17939
|
+
function MessageSourcesPanel({ message, isLatestAssistant, onSelectFollowUp, sources, users }) {
|
|
17940
|
+
const t = useTranslations92();
|
|
17941
|
+
const visibleReferences = useMemo30(
|
|
17942
|
+
() => message.references.filter((ref) => {
|
|
17943
|
+
try {
|
|
17944
|
+
return !!ModuleRegistry.findByName(ref.type).pageUrl;
|
|
17945
|
+
} catch {
|
|
17946
|
+
return false;
|
|
17947
|
+
}
|
|
17948
|
+
}),
|
|
17949
|
+
[message.references]
|
|
17950
|
+
);
|
|
17951
|
+
const refsCount = visibleReferences.length;
|
|
17952
|
+
const citationsCount = message.citations.length;
|
|
17953
|
+
const suggestionsCount = isLatestAssistant ? message.suggestedQuestions.length : 0;
|
|
17954
|
+
const contentsCount = useMemo30(() => {
|
|
17955
|
+
if (sources) return sources.size;
|
|
17956
|
+
const ids = /* @__PURE__ */ new Set();
|
|
17957
|
+
for (const c of message.citations) {
|
|
17958
|
+
if (c.nodeId) ids.add(c.nodeId);
|
|
17959
|
+
}
|
|
17960
|
+
return ids.size;
|
|
17961
|
+
}, [message.citations, sources]);
|
|
17962
|
+
const usersCount = users?.length ?? 0;
|
|
17963
|
+
const total = refsCount + citationsCount + contentsCount + usersCount + suggestionsCount;
|
|
17964
|
+
const visibleTabs = [];
|
|
17965
|
+
if (suggestionsCount > 0) visibleTabs.push("suggested");
|
|
17966
|
+
if (refsCount > 0) visibleTabs.push("references");
|
|
17967
|
+
if (citationsCount > 0) visibleTabs.push("citations");
|
|
17968
|
+
if (contentsCount > 0) visibleTabs.push("contents");
|
|
17969
|
+
if (usersCount > 0) visibleTabs.push("users");
|
|
17970
|
+
const autoOpen = isLatestAssistant && suggestionsCount > 0;
|
|
17971
|
+
const initialTab = autoOpen ? "suggested" : visibleTabs[0];
|
|
17972
|
+
const [open, setOpen] = useState80(autoOpen);
|
|
17973
|
+
const [active, setActive] = useState80(initialTab);
|
|
17974
|
+
if (total === 0) return null;
|
|
17975
|
+
const panelId = `sources-panel-${message.id}`;
|
|
17976
|
+
return /* @__PURE__ */ jsxs128("div", { className: "mt-2 w-full min-w-0", children: [
|
|
17977
|
+
/* @__PURE__ */ jsxs128(
|
|
17686
17978
|
"button",
|
|
17687
17979
|
{
|
|
17688
17980
|
type: "button",
|
|
17689
17981
|
onClick: () => setOpen((v) => !v),
|
|
17982
|
+
"aria-expanded": open,
|
|
17983
|
+
"aria-controls": panelId,
|
|
17690
17984
|
className: "text-primary inline-flex items-center gap-1 text-xs font-medium",
|
|
17691
|
-
children:
|
|
17692
|
-
/* @__PURE__ */
|
|
17693
|
-
t("features.assistant.
|
|
17694
|
-
]
|
|
17695
|
-
/* @__PURE__ */ jsx204(ChevronRight2, { className: "h-3 w-3" }),
|
|
17696
|
-
t("features.assistant.show_suggestions", { count: questions.length })
|
|
17697
|
-
] })
|
|
17985
|
+
children: [
|
|
17986
|
+
open ? /* @__PURE__ */ jsx209(ChevronDown4, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx209(ChevronRight2, { className: "h-3 w-3" }),
|
|
17987
|
+
open ? t("features.assistant.message.sources.toggle_hide") : t("features.assistant.message.sources.toggle", { count: total })
|
|
17988
|
+
]
|
|
17698
17989
|
}
|
|
17699
17990
|
),
|
|
17700
|
-
open && /* @__PURE__ */
|
|
17701
|
-
|
|
17702
|
-
|
|
17703
|
-
|
|
17704
|
-
|
|
17705
|
-
|
|
17706
|
-
|
|
17707
|
-
|
|
17708
|
-
|
|
17709
|
-
|
|
17991
|
+
open && /* @__PURE__ */ jsx209("div", { id: panelId, className: "mt-2 w-full min-w-0", children: /* @__PURE__ */ jsxs128(Tabs, { value: active, onValueChange: (v) => setActive(v), children: [
|
|
17992
|
+
/* @__PURE__ */ jsx209(TabsList, { children: visibleTabs.map((key) => /* @__PURE__ */ jsxs128(TabsTrigger, { value: key, children: [
|
|
17993
|
+
t(`features.assistant.message.sources.tabs.${key === "suggested" ? "suggested_questions" : key}`),
|
|
17994
|
+
/* @__PURE__ */ jsxs128("span", { className: "text-muted-foreground ml-1.5 text-[10px]", children: [
|
|
17995
|
+
key === "suggested" && suggestionsCount,
|
|
17996
|
+
key === "references" && refsCount,
|
|
17997
|
+
key === "citations" && citationsCount,
|
|
17998
|
+
key === "contents" && contentsCount,
|
|
17999
|
+
key === "users" && usersCount
|
|
18000
|
+
] })
|
|
18001
|
+
] }, key)) }),
|
|
18002
|
+
suggestionsCount > 0 && /* @__PURE__ */ jsx209(TabsContent, { value: "suggested", children: /* @__PURE__ */ jsx209(SuggestedQuestionsTab, { questions: message.suggestedQuestions, onSelect: onSelectFollowUp }) }),
|
|
18003
|
+
refsCount > 0 && /* @__PURE__ */ jsx209(TabsContent, { value: "references", children: /* @__PURE__ */ jsx209(ReferencesTab, { references: visibleReferences }) }),
|
|
18004
|
+
citationsCount > 0 && /* @__PURE__ */ jsx209(TabsContent, { value: "citations", children: /* @__PURE__ */ jsx209(CitationsTab, { citations: message.citations, sources }) }),
|
|
18005
|
+
contentsCount > 0 && /* @__PURE__ */ jsx209(TabsContent, { value: "contents", children: /* @__PURE__ */ jsx209(ContentsTab, { citations: message.citations, sources }) }),
|
|
18006
|
+
usersCount > 0 && /* @__PURE__ */ jsx209(TabsContent, { value: "users", children: /* @__PURE__ */ jsx209(UsersTab, { users: users ?? [], citations: message.citations, sources }) })
|
|
18007
|
+
] }) })
|
|
17710
18008
|
] });
|
|
17711
18009
|
}
|
|
17712
|
-
__name(
|
|
18010
|
+
__name(MessageSourcesPanel, "MessageSourcesPanel");
|
|
18011
|
+
|
|
18012
|
+
// src/features/assistant-message/components/parts/MessageSourcesContainer.tsx
|
|
18013
|
+
import { jsx as jsx210 } from "react/jsx-runtime";
|
|
18014
|
+
var SourcesFetcher = class extends ClientAbstractService {
|
|
18015
|
+
static {
|
|
18016
|
+
__name(this, "SourcesFetcher");
|
|
18017
|
+
}
|
|
18018
|
+
static async findManyByIds(params) {
|
|
18019
|
+
const endpoint = new EndpointCreator({ endpoint: params.module });
|
|
18020
|
+
endpoint.addAdditionalParam(params.idsParam, params.ids.join(","));
|
|
18021
|
+
if (params.module.inclusions?.lists?.fields) endpoint.limitToFields(params.module.inclusions.lists.fields);
|
|
18022
|
+
if (params.module.inclusions?.lists?.types) endpoint.limitToType(params.module.inclusions.lists.types);
|
|
18023
|
+
return this.callApi({
|
|
18024
|
+
type: params.module,
|
|
18025
|
+
method: "GET" /* GET */,
|
|
18026
|
+
endpoint: endpoint.generate()
|
|
18027
|
+
});
|
|
18028
|
+
}
|
|
18029
|
+
};
|
|
18030
|
+
function MessageSourcesContainer({ message, isLatestAssistant, onSelectFollowUp }) {
|
|
18031
|
+
const groups = useMemo31(() => {
|
|
18032
|
+
const map = /* @__PURE__ */ new Map();
|
|
18033
|
+
for (const chunk of message.citations) {
|
|
18034
|
+
if (!chunk.nodeType || !chunk.nodeId) continue;
|
|
18035
|
+
let bucket = map.get(chunk.nodeType);
|
|
18036
|
+
if (!bucket) {
|
|
18037
|
+
bucket = /* @__PURE__ */ new Set();
|
|
18038
|
+
map.set(chunk.nodeType, bucket);
|
|
18039
|
+
}
|
|
18040
|
+
bucket.add(chunk.nodeId);
|
|
18041
|
+
}
|
|
18042
|
+
return map;
|
|
18043
|
+
}, [message.citations]);
|
|
18044
|
+
const groupsKey = useMemo31(() => {
|
|
18045
|
+
const parts = [];
|
|
18046
|
+
for (const [nodeType, ids] of groups) {
|
|
18047
|
+
parts.push(`${nodeType}:${Array.from(ids).sort().join(",")}`);
|
|
18048
|
+
}
|
|
18049
|
+
return parts.sort().join("|");
|
|
18050
|
+
}, [groups]);
|
|
18051
|
+
const [resolved, setResolved] = useState81([]);
|
|
18052
|
+
useEffect58(() => {
|
|
18053
|
+
if (groups.size === 0) {
|
|
18054
|
+
setResolved([]);
|
|
18055
|
+
return;
|
|
18056
|
+
}
|
|
18057
|
+
let cancelled = false;
|
|
18058
|
+
const requests = [];
|
|
18059
|
+
for (const [nodeType, idSet] of groups) {
|
|
18060
|
+
let module;
|
|
18061
|
+
try {
|
|
18062
|
+
module = ModuleRegistry.findByModelName(nodeType);
|
|
18063
|
+
} catch {
|
|
18064
|
+
continue;
|
|
18065
|
+
}
|
|
18066
|
+
const idsParam = `${module.nodeName ?? module.name.replace(/s$/, "")}Ids`;
|
|
18067
|
+
requests.push(
|
|
18068
|
+
SourcesFetcher.findManyByIds({
|
|
18069
|
+
module,
|
|
18070
|
+
idsParam,
|
|
18071
|
+
ids: Array.from(idSet)
|
|
18072
|
+
}).catch((error) => {
|
|
18073
|
+
console.error(`Failed to load sources for ${nodeType}:`, error);
|
|
18074
|
+
return [];
|
|
18075
|
+
})
|
|
18076
|
+
);
|
|
18077
|
+
}
|
|
18078
|
+
Promise.all(requests).then((results) => {
|
|
18079
|
+
if (cancelled) return;
|
|
18080
|
+
setResolved(results.flat());
|
|
18081
|
+
});
|
|
18082
|
+
return () => {
|
|
18083
|
+
cancelled = true;
|
|
18084
|
+
};
|
|
18085
|
+
}, [groupsKey, groups]);
|
|
18086
|
+
const sources = useMemo31(() => {
|
|
18087
|
+
const map = /* @__PURE__ */ new Map();
|
|
18088
|
+
for (const entity of resolved) map.set(entity.id, entity);
|
|
18089
|
+
return map;
|
|
18090
|
+
}, [resolved]);
|
|
18091
|
+
const users = useMemo31(() => {
|
|
18092
|
+
const userMap = /* @__PURE__ */ new Map();
|
|
18093
|
+
for (const entity of resolved) {
|
|
18094
|
+
const author = entity._author ?? (() => {
|
|
18095
|
+
try {
|
|
18096
|
+
return entity.author;
|
|
18097
|
+
} catch {
|
|
18098
|
+
return void 0;
|
|
18099
|
+
}
|
|
18100
|
+
})();
|
|
18101
|
+
if (author?.id) userMap.set(author.id, author);
|
|
18102
|
+
}
|
|
18103
|
+
return Array.from(userMap.values());
|
|
18104
|
+
}, [resolved]);
|
|
18105
|
+
return /* @__PURE__ */ jsx210(
|
|
18106
|
+
MessageSourcesPanel,
|
|
18107
|
+
{
|
|
18108
|
+
message,
|
|
18109
|
+
isLatestAssistant,
|
|
18110
|
+
onSelectFollowUp,
|
|
18111
|
+
sources,
|
|
18112
|
+
users
|
|
18113
|
+
}
|
|
18114
|
+
);
|
|
18115
|
+
}
|
|
18116
|
+
__name(MessageSourcesContainer, "MessageSourcesContainer");
|
|
17713
18117
|
|
|
17714
18118
|
// src/features/assistant-message/components/MessageItem.tsx
|
|
17715
|
-
import { jsx as
|
|
18119
|
+
import { jsx as jsx211, jsxs as jsxs129 } from "react/jsx-runtime";
|
|
17716
18120
|
function MessageItem({ message, isLatestAssistant, onSelectFollowUp, failedMessageIds, onRetry }) {
|
|
17717
|
-
const t =
|
|
18121
|
+
const t = useTranslations93();
|
|
17718
18122
|
const isUser = message.role === "user";
|
|
17719
18123
|
const isFailed = isUser && !!failedMessageIds?.has(message.id);
|
|
17720
18124
|
if (isUser) {
|
|
17721
|
-
return /* @__PURE__ */
|
|
17722
|
-
/* @__PURE__ */
|
|
17723
|
-
isFailed && /* @__PURE__ */
|
|
17724
|
-
/* @__PURE__ */
|
|
17725
|
-
/* @__PURE__ */
|
|
17726
|
-
/* @__PURE__ */
|
|
18125
|
+
return /* @__PURE__ */ jsxs129("div", { className: "flex flex-col items-end gap-1", children: [
|
|
18126
|
+
/* @__PURE__ */ jsx211("div", { className: "bg-primary text-primary-foreground max-w-[72%] rounded-2xl rounded-br-sm px-3.5 py-2 text-sm", children: message.content }),
|
|
18127
|
+
isFailed && /* @__PURE__ */ jsxs129("div", { className: "text-destructive flex items-center gap-2 text-xs", children: [
|
|
18128
|
+
/* @__PURE__ */ jsx211(AlertCircle, { className: "h-3.5 w-3.5" }),
|
|
18129
|
+
/* @__PURE__ */ jsx211("span", { children: t("features.assistant.send_failed") }),
|
|
18130
|
+
/* @__PURE__ */ jsx211("button", { type: "button", className: "underline", onClick: () => onRetry?.(message.id), children: t("features.assistant.retry") })
|
|
17727
18131
|
] })
|
|
17728
18132
|
] });
|
|
17729
18133
|
}
|
|
17730
|
-
return /* @__PURE__ */
|
|
17731
|
-
/* @__PURE__ */
|
|
17732
|
-
/* @__PURE__ */
|
|
17733
|
-
/* @__PURE__ */
|
|
18134
|
+
return /* @__PURE__ */ jsxs129("div", { className: "flex min-w-0 max-w-[78%] flex-col gap-1.5", children: [
|
|
18135
|
+
/* @__PURE__ */ jsxs129("div", { className: "text-muted-foreground flex items-center gap-2 pl-1 text-xs", children: [
|
|
18136
|
+
/* @__PURE__ */ jsx211("span", { className: "flex h-4 w-4 items-center justify-center rounded-full bg-gradient-to-br from-blue-400 to-violet-500 text-white", children: /* @__PURE__ */ jsx211(Sparkles2, { className: "h-2.5 w-2.5" }) }),
|
|
18137
|
+
/* @__PURE__ */ jsx211("span", { children: t("features.assistant.agent_name") })
|
|
17734
18138
|
] }),
|
|
17735
|
-
/* @__PURE__ */
|
|
17736
|
-
/* @__PURE__ */
|
|
17737
|
-
|
|
18139
|
+
/* @__PURE__ */ jsx211("div", { className: "bg-muted text-foreground rounded-2xl rounded-bl-sm px-3.5 py-2.5 text-sm leading-relaxed", children: /* @__PURE__ */ jsx211(ReactMarkdown3, { remarkPlugins: [remarkGfm3], children: message.content }) }),
|
|
18140
|
+
/* @__PURE__ */ jsx211(
|
|
18141
|
+
MessageSourcesContainer,
|
|
18142
|
+
{
|
|
18143
|
+
message,
|
|
18144
|
+
isLatestAssistant,
|
|
18145
|
+
onSelectFollowUp
|
|
18146
|
+
}
|
|
18147
|
+
)
|
|
17738
18148
|
] });
|
|
17739
18149
|
}
|
|
17740
18150
|
__name(MessageItem, "MessageItem");
|
|
17741
18151
|
|
|
17742
18152
|
// src/features/assistant-message/components/MessageList.tsx
|
|
17743
|
-
import { jsx as
|
|
18153
|
+
import { jsx as jsx212 } from "react/jsx-runtime";
|
|
17744
18154
|
function MessageList({ messages, onSelectFollowUp, failedMessageIds, onRetry }) {
|
|
17745
18155
|
const ordered = [...messages].sort((a, b) => a.position - b.position);
|
|
17746
18156
|
let lastAssistantIndex = -1;
|
|
@@ -17750,7 +18160,7 @@ function MessageList({ messages, onSelectFollowUp, failedMessageIds, onRetry })
|
|
|
17750
18160
|
break;
|
|
17751
18161
|
}
|
|
17752
18162
|
}
|
|
17753
|
-
return /* @__PURE__ */
|
|
18163
|
+
return /* @__PURE__ */ jsx212("div", { className: "flex min-w-0 flex-col gap-y-3", children: ordered.map((m, i) => /* @__PURE__ */ jsx212(
|
|
17754
18164
|
MessageItem,
|
|
17755
18165
|
{
|
|
17756
18166
|
message: m,
|
|
@@ -17765,28 +18175,28 @@ function MessageList({ messages, onSelectFollowUp, failedMessageIds, onRetry })
|
|
|
17765
18175
|
__name(MessageList, "MessageList");
|
|
17766
18176
|
|
|
17767
18177
|
// src/features/assistant/components/parts/AssistantStatusLine.tsx
|
|
17768
|
-
import { useTranslations as
|
|
18178
|
+
import { useTranslations as useTranslations94 } from "next-intl";
|
|
17769
18179
|
import { Loader2 as Loader24 } from "lucide-react";
|
|
17770
|
-
import { jsx as
|
|
18180
|
+
import { jsx as jsx213, jsxs as jsxs130 } from "react/jsx-runtime";
|
|
17771
18181
|
function AssistantStatusLine({ status }) {
|
|
17772
|
-
const t =
|
|
18182
|
+
const t = useTranslations94();
|
|
17773
18183
|
const text = status ?? t("features.assistant.thinking");
|
|
17774
|
-
return /* @__PURE__ */
|
|
17775
|
-
/* @__PURE__ */
|
|
17776
|
-
/* @__PURE__ */
|
|
18184
|
+
return /* @__PURE__ */ jsxs130("div", { className: "text-muted-foreground flex items-center gap-2 px-4 py-2 text-sm", children: [
|
|
18185
|
+
/* @__PURE__ */ jsx213(Loader24, { className: "h-4 w-4 animate-spin" }),
|
|
18186
|
+
/* @__PURE__ */ jsx213("span", { children: text })
|
|
17777
18187
|
] });
|
|
17778
18188
|
}
|
|
17779
18189
|
__name(AssistantStatusLine, "AssistantStatusLine");
|
|
17780
18190
|
|
|
17781
18191
|
// src/features/assistant/components/parts/AssistantThread.tsx
|
|
17782
|
-
import { jsx as
|
|
18192
|
+
import { jsx as jsx214, jsxs as jsxs131 } from "react/jsx-runtime";
|
|
17783
18193
|
function AssistantThread({ messages, sending, status, onSelectFollowUp, failedMessageIds, onRetry }) {
|
|
17784
18194
|
const endRef = useRef29(null);
|
|
17785
|
-
|
|
18195
|
+
useEffect59(() => {
|
|
17786
18196
|
endRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
17787
18197
|
}, [messages.length, sending]);
|
|
17788
|
-
return /* @__PURE__ */
|
|
17789
|
-
/* @__PURE__ */
|
|
18198
|
+
return /* @__PURE__ */ jsxs131("div", { className: "flex-1 min-w-0 overflow-x-hidden overflow-y-auto px-6 py-5", children: [
|
|
18199
|
+
/* @__PURE__ */ jsx214(
|
|
17790
18200
|
MessageList,
|
|
17791
18201
|
{
|
|
17792
18202
|
messages,
|
|
@@ -17795,19 +18205,19 @@ function AssistantThread({ messages, sending, status, onSelectFollowUp, failedMe
|
|
|
17795
18205
|
onRetry
|
|
17796
18206
|
}
|
|
17797
18207
|
),
|
|
17798
|
-
sending && /* @__PURE__ */
|
|
17799
|
-
/* @__PURE__ */
|
|
18208
|
+
sending && /* @__PURE__ */ jsx214(AssistantStatusLine, { status }),
|
|
18209
|
+
/* @__PURE__ */ jsx214("div", { ref: endRef })
|
|
17800
18210
|
] });
|
|
17801
18211
|
}
|
|
17802
18212
|
__name(AssistantThread, "AssistantThread");
|
|
17803
18213
|
|
|
17804
18214
|
// src/features/assistant/components/containers/AssistantContainer.tsx
|
|
17805
|
-
import { Fragment as Fragment44, jsx as
|
|
18215
|
+
import { Fragment as Fragment44, jsx as jsx215, jsxs as jsxs132 } from "react/jsx-runtime";
|
|
17806
18216
|
function AssistantContainer() {
|
|
17807
18217
|
const ctx = useAssistantContext();
|
|
17808
18218
|
const showThread = !!ctx.assistant || ctx.sending || ctx.messages.length > 0;
|
|
17809
|
-
return /* @__PURE__ */
|
|
17810
|
-
/* @__PURE__ */
|
|
18219
|
+
return /* @__PURE__ */ jsx215(RoundPageContainer, { module: Modules.Assistant, fullWidth: true, children: /* @__PURE__ */ jsxs132("div", { className: "bg-background flex h-full w-full overflow-hidden rounded-lg border", children: [
|
|
18220
|
+
/* @__PURE__ */ jsx215(
|
|
17811
18221
|
AssistantSidebar,
|
|
17812
18222
|
{
|
|
17813
18223
|
threads: ctx.threads,
|
|
@@ -17816,16 +18226,16 @@ function AssistantContainer() {
|
|
|
17816
18226
|
onNew: ctx.startNew
|
|
17817
18227
|
}
|
|
17818
18228
|
),
|
|
17819
|
-
/* @__PURE__ */
|
|
17820
|
-
ctx.assistant ? /* @__PURE__ */
|
|
18229
|
+
/* @__PURE__ */ jsx215("main", { className: "flex flex-1 flex-col", children: !showThread ? /* @__PURE__ */ jsx215(AssistantEmptyState, { onSend: ctx.sendMessage }) : /* @__PURE__ */ jsxs132(Fragment44, { children: [
|
|
18230
|
+
ctx.assistant ? /* @__PURE__ */ jsx215(
|
|
17821
18231
|
AssistantThreadHeader,
|
|
17822
18232
|
{
|
|
17823
18233
|
assistant: ctx.assistant,
|
|
17824
18234
|
onRename: (title) => ctx.renameThread(ctx.assistant.id, title),
|
|
17825
18235
|
onDelete: () => ctx.deleteThread(ctx.assistant.id)
|
|
17826
18236
|
}
|
|
17827
|
-
) : /* @__PURE__ */
|
|
17828
|
-
/* @__PURE__ */
|
|
18237
|
+
) : /* @__PURE__ */ jsx215("div", { className: "flex items-center justify-between border-b px-5 py-3", "aria-hidden": true, children: /* @__PURE__ */ jsx215("div", { className: "h-5" }) }),
|
|
18238
|
+
/* @__PURE__ */ jsx215(
|
|
17829
18239
|
AssistantThread,
|
|
17830
18240
|
{
|
|
17831
18241
|
messages: ctx.messages,
|
|
@@ -17836,7 +18246,7 @@ function AssistantContainer() {
|
|
|
17836
18246
|
onRetry: ctx.retrySend
|
|
17837
18247
|
}
|
|
17838
18248
|
),
|
|
17839
|
-
/* @__PURE__ */
|
|
18249
|
+
/* @__PURE__ */ jsx215(AssistantComposer, { onSend: ctx.sendMessage, disabled: ctx.sending })
|
|
17840
18250
|
] }) })
|
|
17841
18251
|
] }) });
|
|
17842
18252
|
}
|
|
@@ -17844,7 +18254,7 @@ __name(AssistantContainer, "AssistantContainer");
|
|
|
17844
18254
|
|
|
17845
18255
|
// src/features/notification/components/common/NotificationErrorBoundary.tsx
|
|
17846
18256
|
import { Component } from "react";
|
|
17847
|
-
import { jsx as
|
|
18257
|
+
import { jsx as jsx216, jsxs as jsxs133 } from "react/jsx-runtime";
|
|
17848
18258
|
var NotificationErrorBoundary = class extends Component {
|
|
17849
18259
|
static {
|
|
17850
18260
|
__name(this, "NotificationErrorBoundary");
|
|
@@ -17861,9 +18271,9 @@ var NotificationErrorBoundary = class extends Component {
|
|
|
17861
18271
|
}
|
|
17862
18272
|
render() {
|
|
17863
18273
|
if (this.state.hasError) {
|
|
17864
|
-
return this.props.fallback || /* @__PURE__ */
|
|
17865
|
-
/* @__PURE__ */
|
|
17866
|
-
/* @__PURE__ */
|
|
18274
|
+
return this.props.fallback || /* @__PURE__ */ jsx216("div", { className: "flex items-center justify-center p-4 text-center", children: /* @__PURE__ */ jsxs133("div", { className: "text-muted-foreground text-sm", children: [
|
|
18275
|
+
/* @__PURE__ */ jsx216("p", { children: "Something went wrong with notifications." }),
|
|
18276
|
+
/* @__PURE__ */ jsx216(
|
|
17867
18277
|
"button",
|
|
17868
18278
|
{
|
|
17869
18279
|
onClick: () => this.setState({ hasError: false }),
|
|
@@ -17878,14 +18288,14 @@ var NotificationErrorBoundary = class extends Component {
|
|
|
17878
18288
|
};
|
|
17879
18289
|
|
|
17880
18290
|
// src/features/notification/components/containers/NotificationsListContainer.tsx
|
|
17881
|
-
import { useTranslations as
|
|
18291
|
+
import { useTranslations as useTranslations96 } from "next-intl";
|
|
17882
18292
|
|
|
17883
18293
|
// src/features/notification/components/lists/NotificationsList.tsx
|
|
17884
18294
|
import { ArchiveIcon } from "lucide-react";
|
|
17885
|
-
import { useTranslations as
|
|
17886
|
-
import { Fragment as Fragment45, jsx as
|
|
18295
|
+
import { useTranslations as useTranslations95 } from "next-intl";
|
|
18296
|
+
import { Fragment as Fragment45, jsx as jsx217, jsxs as jsxs134 } from "react/jsx-runtime";
|
|
17887
18297
|
function NotificationsList({ archived }) {
|
|
17888
|
-
const t =
|
|
18298
|
+
const t = useTranslations95();
|
|
17889
18299
|
const generateUrl = usePageUrlGenerator();
|
|
17890
18300
|
const data = useDataListRetriever({
|
|
17891
18301
|
retriever: /* @__PURE__ */ __name((params) => NotificationService.findMany(params), "retriever"),
|
|
@@ -17896,30 +18306,30 @@ function NotificationsList({ archived }) {
|
|
|
17896
18306
|
await NotificationService.archive({ id: notification.id });
|
|
17897
18307
|
data.removeElement(notification);
|
|
17898
18308
|
}, "archiveNotification");
|
|
17899
|
-
const LoadingSkeleton = /* @__PURE__ */ __name(() => /* @__PURE__ */
|
|
17900
|
-
/* @__PURE__ */
|
|
17901
|
-
/* @__PURE__ */
|
|
17902
|
-
/* @__PURE__ */
|
|
17903
|
-
/* @__PURE__ */
|
|
18309
|
+
const LoadingSkeleton = /* @__PURE__ */ __name(() => /* @__PURE__ */ jsx217("div", { className: "space-y-4", children: Array.from({ length: 3 }).map((_, i) => /* @__PURE__ */ jsx217(Card, { children: /* @__PURE__ */ jsx217(CardContent, { className: "p-2", children: /* @__PURE__ */ jsxs134("div", { className: "flex w-full flex-row items-center", children: [
|
|
18310
|
+
/* @__PURE__ */ jsx217(Skeleton, { className: "mr-4 h-8 w-8 rounded-full" }),
|
|
18311
|
+
/* @__PURE__ */ jsxs134("div", { className: "flex-1 space-y-2", children: [
|
|
18312
|
+
/* @__PURE__ */ jsx217(Skeleton, { className: "h-4 w-3/4" }),
|
|
18313
|
+
/* @__PURE__ */ jsx217(Skeleton, { className: "h-3 w-1/2" })
|
|
17904
18314
|
] }),
|
|
17905
|
-
/* @__PURE__ */
|
|
18315
|
+
/* @__PURE__ */ jsx217(Skeleton, { className: "h-8 w-20" })
|
|
17906
18316
|
] }) }) }, i)) }), "LoadingSkeleton");
|
|
17907
|
-
return /* @__PURE__ */
|
|
18317
|
+
return /* @__PURE__ */ jsx217("div", { className: "space-y-4", children: data.isLoaded ? data.data?.map((notification) => {
|
|
17908
18318
|
const notificationData = generateNotificationData({ notification, generateUrl });
|
|
17909
|
-
return /* @__PURE__ */
|
|
17910
|
-
notificationData.actor ? /* @__PURE__ */
|
|
17911
|
-
/* @__PURE__ */
|
|
17912
|
-
/* @__PURE__ */
|
|
17913
|
-
strong: /* @__PURE__ */ __name((chunks) => /* @__PURE__ */
|
|
18319
|
+
return /* @__PURE__ */ jsx217(Card, { children: /* @__PURE__ */ jsx217(CardContent, { className: "p-0", children: /* @__PURE__ */ jsxs134("div", { className: `flex w-full flex-row items-center p-2`, children: [
|
|
18320
|
+
notificationData.actor ? /* @__PURE__ */ jsx217("div", { className: "flex w-12 max-w-12 px-2", children: /* @__PURE__ */ jsx217(Link, { href: generateUrl({ page: Modules.User, id: notificationData.actor.id }), children: /* @__PURE__ */ jsx217(UserAvatar, { user: notificationData.actor, className: "h-8 w-8" }) }) }) : /* @__PURE__ */ jsx217("div", { className: "flex w-14 max-w-14 px-2" }),
|
|
18321
|
+
/* @__PURE__ */ jsxs134("div", { className: "flex w-full flex-col", children: [
|
|
18322
|
+
/* @__PURE__ */ jsx217("p", { className: "text-sm", children: t.rich(`notification.${notification.notificationType}.description`, {
|
|
18323
|
+
strong: /* @__PURE__ */ __name((chunks) => /* @__PURE__ */ jsx217("strong", { children: chunks }), "strong"),
|
|
17914
18324
|
actor: notificationData.actor?.name ?? "",
|
|
17915
18325
|
title: notificationData.title
|
|
17916
18326
|
}) }),
|
|
17917
|
-
/* @__PURE__ */
|
|
18327
|
+
/* @__PURE__ */ jsx217("div", { className: "text-muted-foreground mt-1 w-full text-xs", children: new Date(notification.createdAt).toLocaleString() })
|
|
17918
18328
|
] }),
|
|
17919
|
-
/* @__PURE__ */
|
|
17920
|
-
notificationData.url ? /* @__PURE__ */
|
|
17921
|
-
!archived && /* @__PURE__ */
|
|
17922
|
-
/* @__PURE__ */
|
|
18329
|
+
/* @__PURE__ */ jsxs134("div", { className: "flex flex-row items-center", children: [
|
|
18330
|
+
notificationData.url ? /* @__PURE__ */ jsx217(Link, { href: notificationData.url, children: /* @__PURE__ */ jsx217(Button, { variant: `outline`, size: `sm`, onClick: (e) => e.stopPropagation(), children: t(`notification.${notification.notificationType}.buttons.action`) }) }) : /* @__PURE__ */ jsx217(Fragment45, {}),
|
|
18331
|
+
!archived && /* @__PURE__ */ jsxs134(Tooltip2, { children: [
|
|
18332
|
+
/* @__PURE__ */ jsx217(TooltipTrigger, { children: /* @__PURE__ */ jsx217(
|
|
17923
18333
|
Button,
|
|
17924
18334
|
{
|
|
17925
18335
|
variant: `link`,
|
|
@@ -17929,54 +18339,54 @@ function NotificationsList({ archived }) {
|
|
|
17929
18339
|
archiveNotification(notification);
|
|
17930
18340
|
},
|
|
17931
18341
|
className: "text-muted-foreground hover:text-destructive ml-2",
|
|
17932
|
-
children: /* @__PURE__ */
|
|
18342
|
+
children: /* @__PURE__ */ jsx217(ArchiveIcon, { className: "h-4 w-4 cursor-pointer" })
|
|
17933
18343
|
}
|
|
17934
18344
|
) }),
|
|
17935
|
-
/* @__PURE__ */
|
|
18345
|
+
/* @__PURE__ */ jsx217(TooltipContent, { children: t(`notification.buttons.archive`) })
|
|
17936
18346
|
] })
|
|
17937
18347
|
] })
|
|
17938
18348
|
] }) }) }, notification.id);
|
|
17939
|
-
}) : /* @__PURE__ */
|
|
18349
|
+
}) : /* @__PURE__ */ jsx217(LoadingSkeleton, {}) });
|
|
17940
18350
|
}
|
|
17941
18351
|
__name(NotificationsList, "NotificationsList");
|
|
17942
18352
|
|
|
17943
18353
|
// src/features/notification/components/containers/NotificationsListContainer.tsx
|
|
17944
|
-
import { jsx as
|
|
18354
|
+
import { jsx as jsx218, jsxs as jsxs135 } from "react/jsx-runtime";
|
|
17945
18355
|
function NotificationsListContainerContent() {
|
|
17946
|
-
const t =
|
|
18356
|
+
const t = useTranslations96();
|
|
17947
18357
|
const { notifications: _notifications, isLoading: _isLoading, error } = useNotificationContext();
|
|
17948
18358
|
if (error) {
|
|
17949
|
-
return /* @__PURE__ */
|
|
17950
|
-
/* @__PURE__ */
|
|
18359
|
+
return /* @__PURE__ */ jsx218("div", { className: "flex items-center justify-center p-8 text-center", children: /* @__PURE__ */ jsxs135("div", { className: "text-destructive text-sm", children: [
|
|
18360
|
+
/* @__PURE__ */ jsxs135("p", { children: [
|
|
17951
18361
|
"Error loading notifications: ",
|
|
17952
18362
|
error
|
|
17953
18363
|
] }),
|
|
17954
|
-
/* @__PURE__ */
|
|
18364
|
+
/* @__PURE__ */ jsx218("p", { className: "text-muted-foreground mt-2", children: "Please try refreshing the page." })
|
|
17955
18365
|
] }) });
|
|
17956
18366
|
}
|
|
17957
18367
|
const tabs = [
|
|
17958
18368
|
{
|
|
17959
18369
|
label: t(`notification.inbox`),
|
|
17960
|
-
content: /* @__PURE__ */
|
|
18370
|
+
content: /* @__PURE__ */ jsx218(NotificationsList, { archived: false })
|
|
17961
18371
|
},
|
|
17962
18372
|
{
|
|
17963
18373
|
label: t(`notification.archived`),
|
|
17964
|
-
content: /* @__PURE__ */
|
|
18374
|
+
content: /* @__PURE__ */ jsx218(NotificationsList, { archived: true })
|
|
17965
18375
|
}
|
|
17966
18376
|
];
|
|
17967
|
-
return /* @__PURE__ */
|
|
18377
|
+
return /* @__PURE__ */ jsx218(TabsContainer, { tabs });
|
|
17968
18378
|
}
|
|
17969
18379
|
__name(NotificationsListContainerContent, "NotificationsListContainerContent");
|
|
17970
18380
|
function NotificationsListContainer() {
|
|
17971
|
-
return /* @__PURE__ */
|
|
18381
|
+
return /* @__PURE__ */ jsx218(NotificationErrorBoundary, { children: /* @__PURE__ */ jsx218(NotificationsListContainerContent, {}) });
|
|
17972
18382
|
}
|
|
17973
18383
|
__name(NotificationsListContainer, "NotificationsListContainer");
|
|
17974
18384
|
|
|
17975
18385
|
// src/features/notification/components/modals/NotificationModal.tsx
|
|
17976
18386
|
import { BellIcon } from "lucide-react";
|
|
17977
|
-
import { useTranslations as
|
|
17978
|
-
import { Fragment as Fragment46, useCallback as useCallback35, useEffect as
|
|
17979
|
-
import { jsx as
|
|
18387
|
+
import { useTranslations as useTranslations97 } from "next-intl";
|
|
18388
|
+
import { Fragment as Fragment46, useCallback as useCallback35, useEffect as useEffect60, useMemo as useMemo32, useRef as useRef30, useState as useState82 } from "react";
|
|
18389
|
+
import { jsx as jsx219, jsxs as jsxs136 } from "react/jsx-runtime";
|
|
17980
18390
|
function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
17981
18391
|
const _instanceId = useRef30(Math.random().toString(36).substr(2, 9));
|
|
17982
18392
|
const {
|
|
@@ -17996,9 +18406,9 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
17996
18406
|
removeSocketNotification: _removeSocketNotification,
|
|
17997
18407
|
clearSocketNotifications
|
|
17998
18408
|
} = useSocketContext();
|
|
17999
|
-
const t =
|
|
18409
|
+
const t = useTranslations97();
|
|
18000
18410
|
const generateUrl = usePageUrlGenerator();
|
|
18001
|
-
const [newNotifications, setNewNotifications] =
|
|
18411
|
+
const [newNotifications, setNewNotifications] = useState82(false);
|
|
18002
18412
|
const preventAutoClose = useRef30(false);
|
|
18003
18413
|
const circuitBreakerRef = useRef30({
|
|
18004
18414
|
count: 0,
|
|
@@ -18020,17 +18430,17 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
18020
18430
|
}
|
|
18021
18431
|
return !breaker.isOpen;
|
|
18022
18432
|
}, []);
|
|
18023
|
-
const { unreadCount, unreadIds } =
|
|
18433
|
+
const { unreadCount, unreadIds } = useMemo32(() => {
|
|
18024
18434
|
const unreadNotifications2 = notifications.filter((notif) => !notif.isRead);
|
|
18025
18435
|
return {
|
|
18026
18436
|
unreadCount: unreadNotifications2.length,
|
|
18027
18437
|
unreadIds: unreadNotifications2.map((notif) => notif.id)
|
|
18028
18438
|
};
|
|
18029
18439
|
}, [notifications]);
|
|
18030
|
-
|
|
18440
|
+
useEffect60(() => {
|
|
18031
18441
|
setNewNotifications(unreadCount > 0);
|
|
18032
18442
|
}, [unreadCount]);
|
|
18033
|
-
|
|
18443
|
+
useEffect60(() => {
|
|
18034
18444
|
if (lastLoaded === 0) loadNotifications();
|
|
18035
18445
|
}, [lastLoaded, loadNotifications]);
|
|
18036
18446
|
const processSocketNotificationsRef = useRef30(null);
|
|
@@ -18073,7 +18483,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
18073
18483
|
generateUrl,
|
|
18074
18484
|
checkCircuitBreaker
|
|
18075
18485
|
]);
|
|
18076
|
-
|
|
18486
|
+
useEffect60(() => {
|
|
18077
18487
|
if (processSocketNotificationsRef.current) {
|
|
18078
18488
|
clearTimeout(processSocketNotificationsRef.current);
|
|
18079
18489
|
}
|
|
@@ -18110,9 +18520,9 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
18110
18520
|
}
|
|
18111
18521
|
}, "handleOpenChange");
|
|
18112
18522
|
const unreadNotifications = newNotifications && unreadCount > 0;
|
|
18113
|
-
return /* @__PURE__ */
|
|
18114
|
-
/* @__PURE__ */
|
|
18115
|
-
/* @__PURE__ */
|
|
18523
|
+
return /* @__PURE__ */ jsxs136(Popover, { open: isOpen, onOpenChange: handleOpenChange, "data-testid": `sidebar-notification button`, children: [
|
|
18524
|
+
/* @__PURE__ */ jsx219(PopoverTrigger, { children: /* @__PURE__ */ jsxs136(SidebarMenuButton, { render: /* @__PURE__ */ jsx219("div", {}), className: "text-muted-foreground h-6", disabled: isLoading, children: [
|
|
18525
|
+
/* @__PURE__ */ jsx219(
|
|
18116
18526
|
BellIcon,
|
|
18117
18527
|
{
|
|
18118
18528
|
className: `h-5 w-5 cursor-pointer ${unreadNotifications ? "text-destructive" : ""} ${isLoading ? "animate-pulse" : ""}`
|
|
@@ -18120,37 +18530,37 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
18120
18530
|
),
|
|
18121
18531
|
t(`entities.notifications`, { count: 2 })
|
|
18122
18532
|
] }) }),
|
|
18123
|
-
/* @__PURE__ */
|
|
18124
|
-
/* @__PURE__ */
|
|
18125
|
-
/* @__PURE__ */
|
|
18126
|
-
isLoading && /* @__PURE__ */
|
|
18127
|
-
error && /* @__PURE__ */
|
|
18533
|
+
/* @__PURE__ */ jsx219(PopoverContent, { className: "relative left-10 w-80 border-0 p-0 shadow-none", children: /* @__PURE__ */ jsxs136(Card, { children: [
|
|
18534
|
+
/* @__PURE__ */ jsxs136(CardHeader, { className: "p-4", children: [
|
|
18535
|
+
/* @__PURE__ */ jsx219(CardTitle, { children: t(`entities.notifications`, { count: 2 }) }),
|
|
18536
|
+
isLoading && /* @__PURE__ */ jsx219("div", { className: "text-muted-foreground text-xs", children: "Loading..." }),
|
|
18537
|
+
error && /* @__PURE__ */ jsxs136("div", { className: "text-destructive text-xs", children: [
|
|
18128
18538
|
"Error: ",
|
|
18129
18539
|
error
|
|
18130
18540
|
] })
|
|
18131
18541
|
] }),
|
|
18132
|
-
/* @__PURE__ */
|
|
18133
|
-
/* @__PURE__ */
|
|
18542
|
+
/* @__PURE__ */ jsx219(Separator, {}),
|
|
18543
|
+
/* @__PURE__ */ jsx219(ScrollArea, { className: "h-96", children: notifications.length > 0 ? notifications.map((notification) => /* @__PURE__ */ jsx219(Fragment46, { children: generateNotification(notification, () => setIsOpen(false)) }, notification.id)) : /* @__PURE__ */ jsx219("div", { className: "p-4 text-center text-sm text-gray-500", children: t(`notification.empty`) }) })
|
|
18134
18544
|
] }) })
|
|
18135
18545
|
] });
|
|
18136
18546
|
}
|
|
18137
18547
|
__name(NotificationModalContent, "NotificationModalContent");
|
|
18138
18548
|
function NotificationModal(props) {
|
|
18139
|
-
return /* @__PURE__ */
|
|
18549
|
+
return /* @__PURE__ */ jsx219(NotificationErrorBoundary, { children: /* @__PURE__ */ jsx219(NotificationModalContent, { ...props }) });
|
|
18140
18550
|
}
|
|
18141
18551
|
__name(NotificationModal, "NotificationModal");
|
|
18142
18552
|
|
|
18143
18553
|
// src/features/notification/components/notifications/PushNotificationProvider.tsx
|
|
18144
|
-
import { Fragment as Fragment47, jsx as
|
|
18554
|
+
import { Fragment as Fragment47, jsx as jsx220 } from "react/jsx-runtime";
|
|
18145
18555
|
function PushNotificationProvider({ children }) {
|
|
18146
18556
|
usePushNotifications();
|
|
18147
|
-
return /* @__PURE__ */
|
|
18557
|
+
return /* @__PURE__ */ jsx220(Fragment47, { children });
|
|
18148
18558
|
}
|
|
18149
18559
|
__name(PushNotificationProvider, "PushNotificationProvider");
|
|
18150
18560
|
|
|
18151
18561
|
// src/features/referral/components/ReferralCodeCapture.tsx
|
|
18152
18562
|
import { useSearchParams as useSearchParams5 } from "next/navigation";
|
|
18153
|
-
import { useEffect as
|
|
18563
|
+
import { useEffect as useEffect61 } from "react";
|
|
18154
18564
|
|
|
18155
18565
|
// src/features/referral/utils/referral-cookie.ts
|
|
18156
18566
|
function setReferralCode(code) {
|
|
@@ -18175,7 +18585,7 @@ __name(getReferralCode2, "getReferralCode");
|
|
|
18175
18585
|
// src/features/referral/components/ReferralCodeCapture.tsx
|
|
18176
18586
|
function ReferralCodeCapture() {
|
|
18177
18587
|
const searchParams = useSearchParams5();
|
|
18178
|
-
|
|
18588
|
+
useEffect61(() => {
|
|
18179
18589
|
if (!isReferralEnabled()) {
|
|
18180
18590
|
return;
|
|
18181
18591
|
}
|
|
@@ -18194,14 +18604,14 @@ __name(ReferralCodeCapture, "ReferralCodeCapture");
|
|
|
18194
18604
|
|
|
18195
18605
|
// src/features/referral/components/ReferralWidget.tsx
|
|
18196
18606
|
import { Copy as Copy2, Loader2 as Loader25, Mail, Users } from "lucide-react";
|
|
18197
|
-
import { useCallback as useCallback36, useRef as useRef31, useState as
|
|
18607
|
+
import { useCallback as useCallback36, useRef as useRef31, useState as useState85 } from "react";
|
|
18198
18608
|
|
|
18199
18609
|
// src/features/referral/hooks/useReferralInvite.ts
|
|
18200
|
-
import { useState as
|
|
18610
|
+
import { useState as useState83 } from "react";
|
|
18201
18611
|
function useReferralInvite() {
|
|
18202
|
-
const [sending, setSending] =
|
|
18203
|
-
const [error, setError] =
|
|
18204
|
-
const [success, setSuccess] =
|
|
18612
|
+
const [sending, setSending] = useState83(false);
|
|
18613
|
+
const [error, setError] = useState83(null);
|
|
18614
|
+
const [success, setSuccess] = useState83(false);
|
|
18205
18615
|
const sendInvite = /* @__PURE__ */ __name(async (email) => {
|
|
18206
18616
|
if (!isReferralEnabled()) {
|
|
18207
18617
|
return;
|
|
@@ -18223,12 +18633,12 @@ function useReferralInvite() {
|
|
|
18223
18633
|
__name(useReferralInvite, "useReferralInvite");
|
|
18224
18634
|
|
|
18225
18635
|
// src/features/referral/hooks/useReferralStats.ts
|
|
18226
|
-
import { useEffect as
|
|
18636
|
+
import { useEffect as useEffect62, useState as useState84 } from "react";
|
|
18227
18637
|
function useReferralStats() {
|
|
18228
|
-
const [stats, setStats] =
|
|
18229
|
-
const [loading, setLoading] =
|
|
18230
|
-
const [error, setError] =
|
|
18231
|
-
|
|
18638
|
+
const [stats, setStats] = useState84(null);
|
|
18639
|
+
const [loading, setLoading] = useState84(true);
|
|
18640
|
+
const [error, setError] = useState84(null);
|
|
18641
|
+
useEffect62(() => {
|
|
18232
18642
|
if (!isReferralEnabled()) {
|
|
18233
18643
|
setLoading(false);
|
|
18234
18644
|
return;
|
|
@@ -18240,7 +18650,7 @@ function useReferralStats() {
|
|
|
18240
18650
|
__name(useReferralStats, "useReferralStats");
|
|
18241
18651
|
|
|
18242
18652
|
// src/features/referral/components/ReferralWidget.tsx
|
|
18243
|
-
import { jsx as
|
|
18653
|
+
import { jsx as jsx221, jsxs as jsxs137 } from "react/jsx-runtime";
|
|
18244
18654
|
var DEFAULT_TRANSLATIONS = {
|
|
18245
18655
|
title: "Invite Friends",
|
|
18246
18656
|
description: "Share your referral link and earn rewards when your friends subscribe.",
|
|
@@ -18298,8 +18708,8 @@ function ReferralWidget({
|
|
|
18298
18708
|
const t = { ...DEFAULT_TRANSLATIONS, ...translations };
|
|
18299
18709
|
const { stats, loading, error } = useReferralStats();
|
|
18300
18710
|
const { sendInvite, sending } = useReferralInvite();
|
|
18301
|
-
const [email, setEmail] =
|
|
18302
|
-
const [copied, setCopied] =
|
|
18711
|
+
const [email, setEmail] = useState85("");
|
|
18712
|
+
const [copied, setCopied] = useState85(false);
|
|
18303
18713
|
const linkInputRef = useRef31(null);
|
|
18304
18714
|
const config = getReferralConfig();
|
|
18305
18715
|
const baseUrl = config.referralUrlBase || (typeof window !== "undefined" ? window.location.origin : "");
|
|
@@ -18346,30 +18756,30 @@ function ReferralWidget({
|
|
|
18346
18756
|
);
|
|
18347
18757
|
if (loading) {
|
|
18348
18758
|
if (isDialog) {
|
|
18349
|
-
return /* @__PURE__ */
|
|
18759
|
+
return /* @__PURE__ */ jsx221("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ jsx221(Loader25, { className: "text-muted-foreground h-6 w-6 animate-spin" }) });
|
|
18350
18760
|
}
|
|
18351
|
-
return /* @__PURE__ */
|
|
18761
|
+
return /* @__PURE__ */ jsx221(Card, { className: `p-6 ${className ?? ""}`, children: /* @__PURE__ */ jsx221("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ jsx221(Loader25, { className: "text-muted-foreground h-6 w-6 animate-spin" }) }) });
|
|
18352
18762
|
}
|
|
18353
18763
|
if (error) {
|
|
18354
18764
|
const errorMessage = error instanceof Error ? error.message : "Failed to load referral data";
|
|
18355
18765
|
if (isDialog) {
|
|
18356
|
-
return /* @__PURE__ */
|
|
18766
|
+
return /* @__PURE__ */ jsx221("div", { className: "text-destructive text-center text-sm", children: errorMessage });
|
|
18357
18767
|
}
|
|
18358
|
-
return /* @__PURE__ */
|
|
18768
|
+
return /* @__PURE__ */ jsx221(Card, { className: `p-6 ${className ?? ""}`, children: /* @__PURE__ */ jsx221("div", { className: "text-destructive text-center text-sm", children: errorMessage }) });
|
|
18359
18769
|
}
|
|
18360
|
-
const content = /* @__PURE__ */
|
|
18361
|
-
!isDialog && /* @__PURE__ */
|
|
18362
|
-
/* @__PURE__ */
|
|
18363
|
-
/* @__PURE__ */
|
|
18364
|
-
/* @__PURE__ */
|
|
18365
|
-
/* @__PURE__ */
|
|
18770
|
+
const content = /* @__PURE__ */ jsxs137("div", { className: "flex flex-col gap-4", children: [
|
|
18771
|
+
!isDialog && /* @__PURE__ */ jsxs137("div", { className: "flex items-start gap-3", children: [
|
|
18772
|
+
/* @__PURE__ */ jsx221("div", { className: "bg-primary/10 rounded-full p-2", children: /* @__PURE__ */ jsx221(Users, { className: "text-primary h-5 w-5" }) }),
|
|
18773
|
+
/* @__PURE__ */ jsxs137("div", { className: "flex flex-col gap-1", children: [
|
|
18774
|
+
/* @__PURE__ */ jsx221("h3", { className: "text-lg font-semibold", children: t.title }),
|
|
18775
|
+
/* @__PURE__ */ jsx221("p", { className: "text-muted-foreground text-sm", children: t.description })
|
|
18366
18776
|
] })
|
|
18367
18777
|
] }),
|
|
18368
|
-
/* @__PURE__ */
|
|
18369
|
-
/* @__PURE__ */
|
|
18370
|
-
/* @__PURE__ */
|
|
18371
|
-
/* @__PURE__ */
|
|
18372
|
-
/* @__PURE__ */
|
|
18778
|
+
/* @__PURE__ */ jsxs137("div", { className: "flex flex-col gap-2", children: [
|
|
18779
|
+
/* @__PURE__ */ jsx221(Label, { className: "text-sm font-medium", children: t.yourLink }),
|
|
18780
|
+
/* @__PURE__ */ jsxs137("div", { className: "flex gap-2", children: [
|
|
18781
|
+
/* @__PURE__ */ jsx221(Input, { ref: linkInputRef, value: referralUrl, readOnly: true, className: "font-mono text-sm" }),
|
|
18782
|
+
/* @__PURE__ */ jsx221(
|
|
18373
18783
|
Button,
|
|
18374
18784
|
{
|
|
18375
18785
|
type: "button",
|
|
@@ -18378,16 +18788,16 @@ function ReferralWidget({
|
|
|
18378
18788
|
onClick: handleCopyLink,
|
|
18379
18789
|
disabled: !referralUrl,
|
|
18380
18790
|
"aria-label": t.copyButton,
|
|
18381
|
-
children: /* @__PURE__ */
|
|
18791
|
+
children: /* @__PURE__ */ jsx221(Copy2, { className: `h-4 w-4 ${copied ? "text-green-500" : ""}` })
|
|
18382
18792
|
}
|
|
18383
18793
|
)
|
|
18384
18794
|
] })
|
|
18385
18795
|
] }),
|
|
18386
|
-
/* @__PURE__ */
|
|
18387
|
-
/* @__PURE__ */
|
|
18388
|
-
/* @__PURE__ */
|
|
18389
|
-
/* @__PURE__ */
|
|
18390
|
-
/* @__PURE__ */
|
|
18796
|
+
/* @__PURE__ */ jsxs137("div", { className: "flex flex-col gap-2", children: [
|
|
18797
|
+
/* @__PURE__ */ jsx221(Label, { className: "text-sm font-medium", children: t.inviteTitle }),
|
|
18798
|
+
/* @__PURE__ */ jsx221("p", { className: "text-muted-foreground text-sm", children: t.inviteDescription }),
|
|
18799
|
+
/* @__PURE__ */ jsxs137("div", { className: "flex gap-2", children: [
|
|
18800
|
+
/* @__PURE__ */ jsx221(
|
|
18391
18801
|
Input,
|
|
18392
18802
|
{
|
|
18393
18803
|
type: "email",
|
|
@@ -18398,7 +18808,7 @@ function ReferralWidget({
|
|
|
18398
18808
|
disabled: sending
|
|
18399
18809
|
}
|
|
18400
18810
|
),
|
|
18401
|
-
/* @__PURE__ */
|
|
18811
|
+
/* @__PURE__ */ jsx221(
|
|
18402
18812
|
Button,
|
|
18403
18813
|
{
|
|
18404
18814
|
type: "button",
|
|
@@ -18407,12 +18817,12 @@ function ReferralWidget({
|
|
|
18407
18817
|
onClick: handleSendInvite,
|
|
18408
18818
|
disabled: sending || !email,
|
|
18409
18819
|
"aria-label": sending ? t.sendingButton : t.sendButton,
|
|
18410
|
-
children: sending ? /* @__PURE__ */
|
|
18820
|
+
children: sending ? /* @__PURE__ */ jsx221(Loader25, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx221(Mail, { className: "h-4 w-4" })
|
|
18411
18821
|
}
|
|
18412
18822
|
)
|
|
18413
18823
|
] })
|
|
18414
18824
|
] }),
|
|
18415
|
-
stats && stats.completedReferrals > 0 && /* @__PURE__ */
|
|
18825
|
+
stats && stats.completedReferrals > 0 && /* @__PURE__ */ jsx221("div", { className: "border-border border-t pt-3", children: /* @__PURE__ */ jsxs137("p", { className: "text-muted-foreground text-sm", children: [
|
|
18416
18826
|
t.completedLabel,
|
|
18417
18827
|
": ",
|
|
18418
18828
|
stats.completedReferrals
|
|
@@ -18421,12 +18831,12 @@ function ReferralWidget({
|
|
|
18421
18831
|
if (isDialog) {
|
|
18422
18832
|
return content;
|
|
18423
18833
|
}
|
|
18424
|
-
return /* @__PURE__ */
|
|
18834
|
+
return /* @__PURE__ */ jsx221(Card, { className: `p-6 ${className ?? ""}`, children: content });
|
|
18425
18835
|
}
|
|
18426
18836
|
__name(ReferralWidget, "ReferralWidget");
|
|
18427
18837
|
|
|
18428
18838
|
// src/features/referral/components/ReferralDialog.tsx
|
|
18429
|
-
import { jsx as
|
|
18839
|
+
import { jsx as jsx222, jsxs as jsxs138 } from "react/jsx-runtime";
|
|
18430
18840
|
var DEFAULT_DIALOG_TRANSLATIONS = {
|
|
18431
18841
|
dialogTitle: "Invite Friends",
|
|
18432
18842
|
dialogDescription: "Share your referral link and earn rewards when your friends subscribe."
|
|
@@ -18442,49 +18852,49 @@ function ReferralDialog({
|
|
|
18442
18852
|
return null;
|
|
18443
18853
|
}
|
|
18444
18854
|
const t = { ...DEFAULT_DIALOG_TRANSLATIONS, ...translations };
|
|
18445
|
-
return /* @__PURE__ */
|
|
18446
|
-
/* @__PURE__ */
|
|
18447
|
-
/* @__PURE__ */
|
|
18448
|
-
/* @__PURE__ */
|
|
18855
|
+
return /* @__PURE__ */ jsx222(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs138(DialogContent, { className: dialogClassName ?? "max-w-md", children: [
|
|
18856
|
+
/* @__PURE__ */ jsxs138(DialogHeader, { children: [
|
|
18857
|
+
/* @__PURE__ */ jsx222(DialogTitle, { children: t.dialogTitle }),
|
|
18858
|
+
/* @__PURE__ */ jsx222(DialogDescription, { children: t.dialogDescription })
|
|
18449
18859
|
] }),
|
|
18450
|
-
/* @__PURE__ */
|
|
18860
|
+
/* @__PURE__ */ jsx222(ReferralWidget, { ...widgetProps, translations, isDialog: true })
|
|
18451
18861
|
] }) });
|
|
18452
18862
|
}
|
|
18453
18863
|
__name(ReferralDialog, "ReferralDialog");
|
|
18454
18864
|
|
|
18455
18865
|
// src/features/role/components/details/RoleDetails.tsx
|
|
18456
|
-
import { useTranslations as
|
|
18457
|
-
import { jsx as
|
|
18866
|
+
import { useTranslations as useTranslations98 } from "next-intl";
|
|
18867
|
+
import { jsx as jsx223 } from "react/jsx-runtime";
|
|
18458
18868
|
function RoleDetails() {
|
|
18459
18869
|
const { role } = useRoleContext();
|
|
18460
|
-
const t =
|
|
18870
|
+
const t = useTranslations98();
|
|
18461
18871
|
if (!role) return null;
|
|
18462
|
-
return /* @__PURE__ */
|
|
18872
|
+
return /* @__PURE__ */ jsx223(Card, { className: "w-full", children: /* @__PURE__ */ jsx223(CardContent, { className: "p-4", children: /* @__PURE__ */ jsx223(AttributeElement, { title: t(`role.fields.description.label`), value: role.description }) }) });
|
|
18463
18873
|
}
|
|
18464
18874
|
__name(RoleDetails, "RoleDetails");
|
|
18465
18875
|
|
|
18466
18876
|
// src/features/role/components/containers/RoleContainer.tsx
|
|
18467
|
-
import { Fragment as Fragment48, jsx as
|
|
18877
|
+
import { Fragment as Fragment48, jsx as jsx224, jsxs as jsxs139 } from "react/jsx-runtime";
|
|
18468
18878
|
function RoleContainer() {
|
|
18469
18879
|
const { role } = useRoleContext();
|
|
18470
18880
|
if (!role) return null;
|
|
18471
|
-
return /* @__PURE__ */
|
|
18472
|
-
/* @__PURE__ */
|
|
18473
|
-
/* @__PURE__ */
|
|
18881
|
+
return /* @__PURE__ */ jsxs139(Fragment48, { children: [
|
|
18882
|
+
/* @__PURE__ */ jsx224(RoleDetails, {}),
|
|
18883
|
+
/* @__PURE__ */ jsx224(RoleUsersList, { role })
|
|
18474
18884
|
] });
|
|
18475
18885
|
}
|
|
18476
18886
|
__name(RoleContainer, "RoleContainer");
|
|
18477
18887
|
|
|
18478
18888
|
// src/features/role/components/forms/FormRoles.tsx
|
|
18479
|
-
import { useTranslations as
|
|
18480
|
-
import { jsx as
|
|
18889
|
+
import { useTranslations as useTranslations99 } from "next-intl";
|
|
18890
|
+
import { jsx as jsx225, jsxs as jsxs140 } from "react/jsx-runtime";
|
|
18481
18891
|
function FormRoles({ form, id, name, roles }) {
|
|
18482
|
-
const t =
|
|
18892
|
+
const t = useTranslations99();
|
|
18483
18893
|
const { hasAccesToFeature } = useCurrentUserContext();
|
|
18484
|
-
return /* @__PURE__ */
|
|
18894
|
+
return /* @__PURE__ */ jsx225("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ jsx225(FormFieldWrapper, { form, name: id, label: name, children: (field) => /* @__PURE__ */ jsx225("div", { className: "flex w-full flex-col gap-y-1", children: roles.filter((role) => role.isSelectable).sort((a, b) => a.name.localeCompare(b.name)).map((role) => {
|
|
18485
18895
|
if (role.requiredFeature && !hasAccesToFeature(role.requiredFeature.id)) return null;
|
|
18486
|
-
return /* @__PURE__ */
|
|
18487
|
-
/* @__PURE__ */
|
|
18896
|
+
return /* @__PURE__ */ jsxs140("div", { className: "flex w-full items-center", children: [
|
|
18897
|
+
/* @__PURE__ */ jsx225(
|
|
18488
18898
|
Checkbox,
|
|
18489
18899
|
{
|
|
18490
18900
|
id: `role-${role.id}`,
|
|
@@ -18501,9 +18911,9 @@ function FormRoles({ form, id, name, roles }) {
|
|
|
18501
18911
|
}
|
|
18502
18912
|
}
|
|
18503
18913
|
),
|
|
18504
|
-
/* @__PURE__ */
|
|
18505
|
-
/* @__PURE__ */
|
|
18506
|
-
/* @__PURE__ */
|
|
18914
|
+
/* @__PURE__ */ jsxs140(Tooltip2, { children: [
|
|
18915
|
+
/* @__PURE__ */ jsx225(TooltipTrigger, { children: /* @__PURE__ */ jsx225(FieldLabel, { htmlFor: `role-${role.id}`, className: "ml-3 cursor-pointer font-normal", children: t(`role.roles`, { role: role.id.replaceAll(`-`, ``) }) }) }),
|
|
18916
|
+
/* @__PURE__ */ jsx225(TooltipContent, { children: t(`role.roles_descriptions`, { role: role.id.replaceAll(`-`, ``) }) })
|
|
18507
18917
|
] })
|
|
18508
18918
|
] }, role.id);
|
|
18509
18919
|
}) }) }) });
|
|
@@ -18511,14 +18921,14 @@ function FormRoles({ form, id, name, roles }) {
|
|
|
18511
18921
|
__name(FormRoles, "FormRoles");
|
|
18512
18922
|
|
|
18513
18923
|
// src/features/role/components/forms/RemoveUserFromRole.tsx
|
|
18514
|
-
import { useTranslations as
|
|
18515
|
-
import { useEffect as
|
|
18516
|
-
import { Fragment as Fragment49, jsx as
|
|
18924
|
+
import { useTranslations as useTranslations100 } from "next-intl";
|
|
18925
|
+
import { useEffect as useEffect63, useState as useState86 } from "react";
|
|
18926
|
+
import { Fragment as Fragment49, jsx as jsx226, jsxs as jsxs141 } from "react/jsx-runtime";
|
|
18517
18927
|
function RemoveUserFromRole({ role, user, refresh }) {
|
|
18518
|
-
const [open, setOpen] =
|
|
18519
|
-
const [canRemove, setCanRemove] =
|
|
18520
|
-
const t =
|
|
18521
|
-
|
|
18928
|
+
const [open, setOpen] = useState86(false);
|
|
18929
|
+
const [canRemove, setCanRemove] = useState86(false);
|
|
18930
|
+
const t = useTranslations100();
|
|
18931
|
+
useEffect63(() => {
|
|
18522
18932
|
async function checkCompanyAdminDeletability() {
|
|
18523
18933
|
const roleUsers = await UserService.findAllUsersByRole({
|
|
18524
18934
|
roleId: role.id
|
|
@@ -18545,8 +18955,8 @@ function RemoveUserFromRole({ role, user, refresh }) {
|
|
|
18545
18955
|
}
|
|
18546
18956
|
}, "remove");
|
|
18547
18957
|
const roleName = t(`role.roles`, { role: role.id.replaceAll(`-`, ``) });
|
|
18548
|
-
return /* @__PURE__ */
|
|
18549
|
-
/* @__PURE__ */
|
|
18958
|
+
return /* @__PURE__ */ jsxs141(Dialog, { open, onOpenChange: setOpen, children: [
|
|
18959
|
+
/* @__PURE__ */ jsx226(
|
|
18550
18960
|
DialogTrigger,
|
|
18551
18961
|
{
|
|
18552
18962
|
onClick: (e) => {
|
|
@@ -18554,19 +18964,19 @@ function RemoveUserFromRole({ role, user, refresh }) {
|
|
|
18554
18964
|
e.preventDefault();
|
|
18555
18965
|
setOpen(true);
|
|
18556
18966
|
},
|
|
18557
|
-
children: /* @__PURE__ */
|
|
18967
|
+
children: /* @__PURE__ */ jsx226("span", { className: "hover:text-destructive cursor-pointer", children: t(`role.remove_user.title`) })
|
|
18558
18968
|
}
|
|
18559
18969
|
),
|
|
18560
|
-
/* @__PURE__ */
|
|
18561
|
-
/* @__PURE__ */
|
|
18562
|
-
/* @__PURE__ */
|
|
18563
|
-
/* @__PURE__ */
|
|
18970
|
+
/* @__PURE__ */ jsxs141(DialogContent, { className: `flex max-h-[70vh] max-w-3xl flex-col overflow-y-auto`, children: [
|
|
18971
|
+
/* @__PURE__ */ jsxs141(DialogHeader, { children: [
|
|
18972
|
+
/* @__PURE__ */ jsx226(DialogTitle, { children: t(`role.remove_user.title`) }),
|
|
18973
|
+
/* @__PURE__ */ jsx226(DialogDescription, { children: canRemove ? t(`role.remove_user.subtitle_allowed`) : t(`role.remove_user.subtitle_not_allowed`) })
|
|
18564
18974
|
] }),
|
|
18565
|
-
canRemove ? /* @__PURE__ */
|
|
18975
|
+
canRemove ? /* @__PURE__ */ jsxs141(Fragment49, { children: [
|
|
18566
18976
|
t(`role.remove_user.description_allowed`, { role: roleName, user: user.name }),
|
|
18567
|
-
/* @__PURE__ */
|
|
18568
|
-
/* @__PURE__ */
|
|
18569
|
-
/* @__PURE__ */
|
|
18977
|
+
/* @__PURE__ */ jsxs141("div", { className: "flex justify-end", children: [
|
|
18978
|
+
/* @__PURE__ */ jsx226(Button, { className: "mr-2", variant: "outline", type: `button`, onClick: () => setOpen(false), children: t(`ui.buttons.cancel`) }),
|
|
18979
|
+
/* @__PURE__ */ jsx226(
|
|
18570
18980
|
Button,
|
|
18571
18981
|
{
|
|
18572
18982
|
type: "submit",
|
|
@@ -18579,7 +18989,7 @@ function RemoveUserFromRole({ role, user, refresh }) {
|
|
|
18579
18989
|
}
|
|
18580
18990
|
)
|
|
18581
18991
|
] })
|
|
18582
|
-
] }) : /* @__PURE__ */
|
|
18992
|
+
] }) : /* @__PURE__ */ jsx226(Fragment49, { children: t(`role.remove_user.description_not_allowed`, { role: roleName, user: user.name }) })
|
|
18583
18993
|
] })
|
|
18584
18994
|
] });
|
|
18585
18995
|
}
|
|
@@ -18587,15 +18997,15 @@ __name(RemoveUserFromRole, "RemoveUserFromRole");
|
|
|
18587
18997
|
|
|
18588
18998
|
// src/features/role/components/forms/UserRoleAdd.tsx
|
|
18589
18999
|
import { PlusCircle as PlusCircle2 } from "lucide-react";
|
|
18590
|
-
import { useTranslations as
|
|
18591
|
-
import { useCallback as useCallback37, useEffect as
|
|
18592
|
-
import { Fragment as Fragment50, jsx as
|
|
19000
|
+
import { useTranslations as useTranslations101 } from "next-intl";
|
|
19001
|
+
import { useCallback as useCallback37, useEffect as useEffect64, useRef as useRef32, useState as useState87 } from "react";
|
|
19002
|
+
import { Fragment as Fragment50, jsx as jsx227, jsxs as jsxs142 } from "react/jsx-runtime";
|
|
18593
19003
|
function UserRoleAdd({ user, refresh }) {
|
|
18594
|
-
const [open, setOpen] =
|
|
19004
|
+
const [open, setOpen] = useState87(false);
|
|
18595
19005
|
const inputRef = useRef32(null);
|
|
18596
|
-
const [searchTerm, setSearchTerm] =
|
|
18597
|
-
const [roles, setRoles] =
|
|
18598
|
-
const t =
|
|
19006
|
+
const [searchTerm, setSearchTerm] = useState87("");
|
|
19007
|
+
const [roles, setRoles] = useState87([]);
|
|
19008
|
+
const t = useTranslations101();
|
|
18599
19009
|
const addUserToRole = /* @__PURE__ */ __name(async (role) => {
|
|
18600
19010
|
await RoleService.addUserToRole({
|
|
18601
19011
|
roleId: role.id,
|
|
@@ -18630,32 +19040,32 @@ function UserRoleAdd({ user, refresh }) {
|
|
|
18630
19040
|
[searchTerm, user]
|
|
18631
19041
|
);
|
|
18632
19042
|
const updateSearchTerm = useDebounce2(searchRoles, 500);
|
|
18633
|
-
|
|
19043
|
+
useEffect64(() => {
|
|
18634
19044
|
if (open) updateSearchTerm(searchTerm);
|
|
18635
19045
|
}, [open, searchTerm]);
|
|
18636
|
-
|
|
19046
|
+
useEffect64(() => {
|
|
18637
19047
|
if (open) searchRoles("");
|
|
18638
19048
|
}, [open]);
|
|
18639
|
-
return /* @__PURE__ */
|
|
18640
|
-
/* @__PURE__ */
|
|
18641
|
-
/* @__PURE__ */
|
|
19049
|
+
return /* @__PURE__ */ jsxs142(Fragment50, { children: [
|
|
19050
|
+
/* @__PURE__ */ jsxs142(Button, { size: "sm", onClick: () => setOpen(true), children: [
|
|
19051
|
+
/* @__PURE__ */ jsx227(PlusCircle2, { className: "mr-3 h-3.5 w-3.5" }),
|
|
18642
19052
|
t(`common.association.label`, {
|
|
18643
19053
|
source: t(`entities.roles`, { count: 1 }),
|
|
18644
19054
|
destination: t(`entities.users`, { count: 1 })
|
|
18645
19055
|
})
|
|
18646
19056
|
] }),
|
|
18647
|
-
/* @__PURE__ */
|
|
18648
|
-
/* @__PURE__ */
|
|
19057
|
+
/* @__PURE__ */ jsxs142(CommandDialog, { open, onOpenChange: setOpen, children: [
|
|
19058
|
+
/* @__PURE__ */ jsx227(DialogTitle, { children: t(`common.association.label`, {
|
|
18649
19059
|
source: t(`entities.roles`, { count: 1 }),
|
|
18650
19060
|
destination: t(`entities.users`, { count: 1 })
|
|
18651
19061
|
}) }),
|
|
18652
|
-
/* @__PURE__ */
|
|
19062
|
+
/* @__PURE__ */ jsx227(DialogDescription, { children: t(`common.association.description`, {
|
|
18653
19063
|
source: t(`entities.roles`, { count: 1 }),
|
|
18654
19064
|
destination: t(`entities.users`, { count: 1 }),
|
|
18655
19065
|
destination_name: user.name
|
|
18656
19066
|
}) }),
|
|
18657
|
-
/* @__PURE__ */
|
|
18658
|
-
/* @__PURE__ */
|
|
19067
|
+
/* @__PURE__ */ jsxs142(Command, { shouldFilter: false, children: [
|
|
19068
|
+
/* @__PURE__ */ jsx227(
|
|
18659
19069
|
CommandInput,
|
|
18660
19070
|
{
|
|
18661
19071
|
placeholder: t(`ui.search.placeholder`, { type: t(`entities.roles`, { count: 1 }) }),
|
|
@@ -18664,9 +19074,9 @@ function UserRoleAdd({ user, refresh }) {
|
|
|
18664
19074
|
ref: inputRef
|
|
18665
19075
|
}
|
|
18666
19076
|
),
|
|
18667
|
-
/* @__PURE__ */
|
|
18668
|
-
/* @__PURE__ */
|
|
18669
|
-
roles.map((role) => /* @__PURE__ */
|
|
19077
|
+
/* @__PURE__ */ jsxs142(CommandList, { className: "mt-3 h-auto max-h-96 min-h-96 max-w-full overflow-x-hidden overflow-y-auto", children: [
|
|
19078
|
+
/* @__PURE__ */ jsx227(CommandEmpty, { children: t(`ui.search.no_results`, { type: t(`entities.roles`, { count: 1 }) }) }),
|
|
19079
|
+
roles.map((role) => /* @__PURE__ */ jsx227(
|
|
18670
19080
|
CommandItem,
|
|
18671
19081
|
{
|
|
18672
19082
|
className: "cursor-pointer hover:bg-muted data-selected:hover:bg-muted bg-transparent data-selected:bg-transparent",
|
|
@@ -18684,16 +19094,16 @@ function UserRoleAdd({ user, refresh }) {
|
|
|
18684
19094
|
__name(UserRoleAdd, "UserRoleAdd");
|
|
18685
19095
|
|
|
18686
19096
|
// src/features/role/components/lists/RolesList.tsx
|
|
18687
|
-
import { useTranslations as
|
|
18688
|
-
import { jsx as
|
|
19097
|
+
import { useTranslations as useTranslations102 } from "next-intl";
|
|
19098
|
+
import { jsx as jsx228 } from "react/jsx-runtime";
|
|
18689
19099
|
function RolesList() {
|
|
18690
|
-
const t =
|
|
19100
|
+
const t = useTranslations102();
|
|
18691
19101
|
const data = useDataListRetriever({
|
|
18692
19102
|
retriever: /* @__PURE__ */ __name((params) => RoleService.findAllRoles(params), "retriever"),
|
|
18693
19103
|
retrieverParams: {},
|
|
18694
19104
|
module: Modules.Role
|
|
18695
19105
|
});
|
|
18696
|
-
return /* @__PURE__ */
|
|
19106
|
+
return /* @__PURE__ */ jsx228(
|
|
18697
19107
|
ContentListTable,
|
|
18698
19108
|
{
|
|
18699
19109
|
data,
|
|
@@ -18706,16 +19116,16 @@ function RolesList() {
|
|
|
18706
19116
|
__name(RolesList, "RolesList");
|
|
18707
19117
|
|
|
18708
19118
|
// src/features/role/components/lists/UserRolesList.tsx
|
|
18709
|
-
import { useTranslations as
|
|
18710
|
-
import { jsx as
|
|
19119
|
+
import { useTranslations as useTranslations103 } from "next-intl";
|
|
19120
|
+
import { jsx as jsx229 } from "react/jsx-runtime";
|
|
18711
19121
|
function UserRolesList({ user }) {
|
|
18712
|
-
const t =
|
|
19122
|
+
const t = useTranslations103();
|
|
18713
19123
|
const data = useDataListRetriever({
|
|
18714
19124
|
retriever: /* @__PURE__ */ __name((params) => RoleService.findAllRolesByUser(params), "retriever"),
|
|
18715
19125
|
retrieverParams: { userId: user.id },
|
|
18716
19126
|
module: Modules.Role
|
|
18717
19127
|
});
|
|
18718
|
-
return /* @__PURE__ */
|
|
19128
|
+
return /* @__PURE__ */ jsx229(
|
|
18719
19129
|
ContentListTable,
|
|
18720
19130
|
{
|
|
18721
19131
|
data,
|
|
@@ -18730,7 +19140,7 @@ __name(UserRolesList, "UserRolesList");
|
|
|
18730
19140
|
// src/features/oauth/components/OAuthRedirectUriInput.tsx
|
|
18731
19141
|
import { useCallback as useCallback38 } from "react";
|
|
18732
19142
|
import { Plus as Plus2, Trash2 as Trash23 } from "lucide-react";
|
|
18733
|
-
import { jsx as
|
|
19143
|
+
import { jsx as jsx230, jsxs as jsxs143 } from "react/jsx-runtime";
|
|
18734
19144
|
function isValidRedirectUri(uri) {
|
|
18735
19145
|
if (!uri.trim()) return false;
|
|
18736
19146
|
if (uri.startsWith("http://localhost") || uri.startsWith("http://127.0.0.1")) {
|
|
@@ -18776,17 +19186,17 @@ function OAuthRedirectUriInput({
|
|
|
18776
19186
|
},
|
|
18777
19187
|
[value, onChange]
|
|
18778
19188
|
);
|
|
18779
|
-
return /* @__PURE__ */
|
|
18780
|
-
/* @__PURE__ */
|
|
19189
|
+
return /* @__PURE__ */ jsxs143("div", { className: "space-y-2", children: [
|
|
19190
|
+
/* @__PURE__ */ jsxs143(Label, { children: [
|
|
18781
19191
|
label,
|
|
18782
19192
|
" *"
|
|
18783
19193
|
] }),
|
|
18784
|
-
/* @__PURE__ */
|
|
18785
|
-
/* @__PURE__ */
|
|
19194
|
+
/* @__PURE__ */ jsx230("p", { className: "text-sm text-muted-foreground", children: "Enter the URIs where users will be redirected after authorization. Use https:// for production, or custom schemes for mobile apps." }),
|
|
19195
|
+
/* @__PURE__ */ jsx230("div", { className: "space-y-2", children: value.map((uri, index) => {
|
|
18786
19196
|
const isValid3 = !uri || isValidRedirectUri(uri);
|
|
18787
|
-
return /* @__PURE__ */
|
|
18788
|
-
/* @__PURE__ */
|
|
18789
|
-
/* @__PURE__ */
|
|
19197
|
+
return /* @__PURE__ */ jsxs143("div", { className: "flex gap-2", children: [
|
|
19198
|
+
/* @__PURE__ */ jsxs143("div", { className: "flex-1", children: [
|
|
19199
|
+
/* @__PURE__ */ jsx230(
|
|
18790
19200
|
Input,
|
|
18791
19201
|
{
|
|
18792
19202
|
value: uri,
|
|
@@ -18796,9 +19206,9 @@ function OAuthRedirectUriInput({
|
|
|
18796
19206
|
className: !isValid3 ? "border-destructive" : ""
|
|
18797
19207
|
}
|
|
18798
19208
|
),
|
|
18799
|
-
!isValid3 && /* @__PURE__ */
|
|
19209
|
+
!isValid3 && /* @__PURE__ */ jsx230("p", { className: "text-xs text-destructive mt-1", children: "Must be https://, http://localhost, or a custom scheme (app://)" })
|
|
18800
19210
|
] }),
|
|
18801
|
-
/* @__PURE__ */
|
|
19211
|
+
/* @__PURE__ */ jsx230(
|
|
18802
19212
|
Button,
|
|
18803
19213
|
{
|
|
18804
19214
|
type: "button",
|
|
@@ -18807,23 +19217,23 @@ function OAuthRedirectUriInput({
|
|
|
18807
19217
|
onClick: () => handleRemove(index),
|
|
18808
19218
|
disabled: disabled || value.length === 1,
|
|
18809
19219
|
title: "Remove URI",
|
|
18810
|
-
children: /* @__PURE__ */
|
|
19220
|
+
children: /* @__PURE__ */ jsx230(Trash23, { className: "h-4 w-4" })
|
|
18811
19221
|
}
|
|
18812
19222
|
)
|
|
18813
19223
|
] }, index);
|
|
18814
19224
|
}) }),
|
|
18815
|
-
/* @__PURE__ */
|
|
18816
|
-
/* @__PURE__ */
|
|
19225
|
+
/* @__PURE__ */ jsxs143(Button, { type: "button", variant: "outline", size: "sm", onClick: handleAdd, disabled, className: "mt-2", children: [
|
|
19226
|
+
/* @__PURE__ */ jsx230(Plus2, { className: "h-4 w-4 mr-2" }),
|
|
18817
19227
|
"Add Redirect URI"
|
|
18818
19228
|
] }),
|
|
18819
|
-
error && /* @__PURE__ */
|
|
19229
|
+
error && /* @__PURE__ */ jsx230("p", { className: "text-sm text-destructive", children: error })
|
|
18820
19230
|
] });
|
|
18821
19231
|
}
|
|
18822
19232
|
__name(OAuthRedirectUriInput, "OAuthRedirectUriInput");
|
|
18823
19233
|
|
|
18824
19234
|
// src/features/oauth/components/OAuthScopeSelector.tsx
|
|
18825
19235
|
import { useCallback as useCallback39 } from "react";
|
|
18826
|
-
import { jsx as
|
|
19236
|
+
import { jsx as jsx231, jsxs as jsxs144 } from "react/jsx-runtime";
|
|
18827
19237
|
function OAuthScopeSelector({
|
|
18828
19238
|
value,
|
|
18829
19239
|
onChange,
|
|
@@ -18854,25 +19264,25 @@ function OAuthScopeSelector({
|
|
|
18854
19264
|
},
|
|
18855
19265
|
{}
|
|
18856
19266
|
);
|
|
18857
|
-
return /* @__PURE__ */
|
|
18858
|
-
/* @__PURE__ */
|
|
18859
|
-
/* @__PURE__ */
|
|
19267
|
+
return /* @__PURE__ */ jsxs144("div", { className: "space-y-4", children: [
|
|
19268
|
+
/* @__PURE__ */ jsxs144("div", { children: [
|
|
19269
|
+
/* @__PURE__ */ jsxs144(Label, { children: [
|
|
18860
19270
|
label,
|
|
18861
19271
|
" *"
|
|
18862
19272
|
] }),
|
|
18863
|
-
/* @__PURE__ */
|
|
19273
|
+
/* @__PURE__ */ jsx231("p", { className: "text-sm text-muted-foreground", children: "Select the permissions your application needs." })
|
|
18864
19274
|
] }),
|
|
18865
|
-
/* @__PURE__ */
|
|
18866
|
-
/* @__PURE__ */
|
|
18867
|
-
/* @__PURE__ */
|
|
19275
|
+
/* @__PURE__ */ jsx231("div", { className: "space-y-4", children: Object.entries(groupedScopes).map(([groupName, scopes]) => /* @__PURE__ */ jsxs144("div", { className: "space-y-2", children: [
|
|
19276
|
+
/* @__PURE__ */ jsx231("h4", { className: "text-sm font-medium capitalize", children: groupName }),
|
|
19277
|
+
/* @__PURE__ */ jsx231("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-2 pl-2", children: scopes.map((scopeInfo) => {
|
|
18868
19278
|
const isChecked = value.includes(scopeInfo.scope);
|
|
18869
19279
|
const isAdmin = scopeInfo.scope === "admin";
|
|
18870
|
-
return /* @__PURE__ */
|
|
19280
|
+
return /* @__PURE__ */ jsxs144(
|
|
18871
19281
|
"div",
|
|
18872
19282
|
{
|
|
18873
19283
|
className: `flex items-start space-x-3 p-2 rounded-md border ${isChecked ? "bg-primary/5 border-primary/20" : "border-transparent"} ${isAdmin ? "bg-destructive/5" : ""}`,
|
|
18874
19284
|
children: [
|
|
18875
|
-
/* @__PURE__ */
|
|
19285
|
+
/* @__PURE__ */ jsx231(
|
|
18876
19286
|
Checkbox,
|
|
18877
19287
|
{
|
|
18878
19288
|
id: `scope-${scopeInfo.scope}`,
|
|
@@ -18881,12 +19291,12 @@ function OAuthScopeSelector({
|
|
|
18881
19291
|
disabled
|
|
18882
19292
|
}
|
|
18883
19293
|
),
|
|
18884
|
-
/* @__PURE__ */
|
|
18885
|
-
/* @__PURE__ */
|
|
19294
|
+
/* @__PURE__ */ jsxs144("div", { className: "flex-1", children: [
|
|
19295
|
+
/* @__PURE__ */ jsxs144(Label, { htmlFor: `scope-${scopeInfo.scope}`, className: "text-sm font-medium cursor-pointer", children: [
|
|
18886
19296
|
scopeInfo.name,
|
|
18887
|
-
isAdmin && /* @__PURE__ */
|
|
19297
|
+
isAdmin && /* @__PURE__ */ jsx231("span", { className: "ml-2 text-xs text-destructive", children: "(Dangerous)" })
|
|
18888
19298
|
] }),
|
|
18889
|
-
/* @__PURE__ */
|
|
19299
|
+
/* @__PURE__ */ jsx231("p", { className: "text-xs text-muted-foreground", children: scopeInfo.description })
|
|
18890
19300
|
] })
|
|
18891
19301
|
]
|
|
18892
19302
|
},
|
|
@@ -18894,17 +19304,17 @@ function OAuthScopeSelector({
|
|
|
18894
19304
|
);
|
|
18895
19305
|
}) })
|
|
18896
19306
|
] }, groupName)) }),
|
|
18897
|
-
error && /* @__PURE__ */
|
|
19307
|
+
error && /* @__PURE__ */ jsx231("p", { className: "text-sm text-destructive", children: error })
|
|
18898
19308
|
] });
|
|
18899
19309
|
}
|
|
18900
19310
|
__name(OAuthScopeSelector, "OAuthScopeSelector");
|
|
18901
19311
|
|
|
18902
19312
|
// src/features/oauth/components/OAuthClientSecretDisplay.tsx
|
|
18903
|
-
import { useState as
|
|
19313
|
+
import { useState as useState88, useCallback as useCallback40 } from "react";
|
|
18904
19314
|
import { Copy as Copy3, Check, AlertTriangle } from "lucide-react";
|
|
18905
|
-
import { jsx as
|
|
19315
|
+
import { jsx as jsx232, jsxs as jsxs145 } from "react/jsx-runtime";
|
|
18906
19316
|
function OAuthClientSecretDisplay({ secret, onDismiss, open, clientName }) {
|
|
18907
|
-
const [copied, setCopied] =
|
|
19317
|
+
const [copied, setCopied] = useState88(false);
|
|
18908
19318
|
const handleCopy = useCallback40(async () => {
|
|
18909
19319
|
try {
|
|
18910
19320
|
await navigator.clipboard.writeText(secret);
|
|
@@ -18918,25 +19328,25 @@ function OAuthClientSecretDisplay({ secret, onDismiss, open, clientName }) {
|
|
|
18918
19328
|
setCopied(false);
|
|
18919
19329
|
onDismiss();
|
|
18920
19330
|
}, [onDismiss]);
|
|
18921
|
-
return /* @__PURE__ */
|
|
18922
|
-
/* @__PURE__ */
|
|
18923
|
-
/* @__PURE__ */
|
|
18924
|
-
/* @__PURE__ */
|
|
19331
|
+
return /* @__PURE__ */ jsx232(Dialog, { open, onOpenChange: (isOpen) => !isOpen && handleDismiss(), children: /* @__PURE__ */ jsxs145(DialogContent, { className: "sm:max-w-md", children: [
|
|
19332
|
+
/* @__PURE__ */ jsxs145(DialogHeader, { children: [
|
|
19333
|
+
/* @__PURE__ */ jsxs145(DialogTitle, { className: "flex items-center gap-2", children: [
|
|
19334
|
+
/* @__PURE__ */ jsx232(AlertTriangle, { className: "h-5 w-5 text-warning" }),
|
|
18925
19335
|
"Save Your Client Secret"
|
|
18926
19336
|
] }),
|
|
18927
|
-
/* @__PURE__ */
|
|
19337
|
+
/* @__PURE__ */ jsx232(DialogDescription, { children: clientName ? `Your client secret for "${clientName}" is shown below.` : "Your client secret is shown below." })
|
|
18928
19338
|
] }),
|
|
18929
|
-
/* @__PURE__ */
|
|
18930
|
-
/* @__PURE__ */
|
|
18931
|
-
/* @__PURE__ */
|
|
18932
|
-
/* @__PURE__ */
|
|
18933
|
-
/* @__PURE__ */
|
|
19339
|
+
/* @__PURE__ */ jsxs145(Alert, { variant: "destructive", className: "my-4", children: [
|
|
19340
|
+
/* @__PURE__ */ jsx232(AlertTriangle, { className: "h-4 w-4" }),
|
|
19341
|
+
/* @__PURE__ */ jsxs145(AlertDescription, { children: [
|
|
19342
|
+
/* @__PURE__ */ jsx232("strong", { children: "This is the only time your client secret will be displayed." }),
|
|
19343
|
+
/* @__PURE__ */ jsx232("br", {}),
|
|
18934
19344
|
"Copy it now and store it securely. You will not be able to retrieve it later."
|
|
18935
19345
|
] })
|
|
18936
19346
|
] }),
|
|
18937
|
-
/* @__PURE__ */
|
|
18938
|
-
/* @__PURE__ */
|
|
18939
|
-
/* @__PURE__ */
|
|
19347
|
+
/* @__PURE__ */ jsxs145("div", { className: "flex items-center space-x-2", children: [
|
|
19348
|
+
/* @__PURE__ */ jsx232("div", { className: "flex-1", children: /* @__PURE__ */ jsx232(Input, { value: secret, readOnly: true, className: "font-mono text-sm", onClick: (e) => e.currentTarget.select() }) }),
|
|
19349
|
+
/* @__PURE__ */ jsx232(
|
|
18940
19350
|
Button,
|
|
18941
19351
|
{
|
|
18942
19352
|
type: "button",
|
|
@@ -18944,12 +19354,12 @@ function OAuthClientSecretDisplay({ secret, onDismiss, open, clientName }) {
|
|
|
18944
19354
|
size: "icon",
|
|
18945
19355
|
onClick: handleCopy,
|
|
18946
19356
|
title: copied ? "Copied!" : "Copy to clipboard",
|
|
18947
|
-
children: copied ? /* @__PURE__ */
|
|
19357
|
+
children: copied ? /* @__PURE__ */ jsx232(Check, { className: "h-4 w-4 text-green-600" }) : /* @__PURE__ */ jsx232(Copy3, { className: "h-4 w-4" })
|
|
18948
19358
|
}
|
|
18949
19359
|
)
|
|
18950
19360
|
] }),
|
|
18951
|
-
copied && /* @__PURE__ */
|
|
18952
|
-
/* @__PURE__ */
|
|
19361
|
+
copied && /* @__PURE__ */ jsx232("p", { className: "text-sm text-green-600 text-center", children: "Copied to clipboard!" }),
|
|
19362
|
+
/* @__PURE__ */ jsx232(DialogFooter, { className: "mt-4", children: /* @__PURE__ */ jsx232(Button, { onClick: handleDismiss, className: "w-full", children: "I've Saved My Secret" }) })
|
|
18953
19363
|
] }) });
|
|
18954
19364
|
}
|
|
18955
19365
|
__name(OAuthClientSecretDisplay, "OAuthClientSecretDisplay");
|
|
@@ -18957,28 +19367,28 @@ __name(OAuthClientSecretDisplay, "OAuthClientSecretDisplay");
|
|
|
18957
19367
|
// src/features/oauth/components/OAuthClientCard.tsx
|
|
18958
19368
|
import { formatDistanceToNow } from "date-fns";
|
|
18959
19369
|
import { Key as Key2, MoreVertical, Pencil, Trash2 as Trash24 } from "lucide-react";
|
|
18960
|
-
import { jsx as
|
|
19370
|
+
import { jsx as jsx233, jsxs as jsxs146 } from "react/jsx-runtime";
|
|
18961
19371
|
function OAuthClientCard({ client, onClick, onEdit, onDelete }) {
|
|
18962
19372
|
const truncatedId = client.clientId.length > 12 ? `${client.clientId.slice(0, 8)}...${client.clientId.slice(-4)}` : client.clientId;
|
|
18963
19373
|
const createdAgo = client.createdAt ? formatDistanceToNow(new Date(client.createdAt), { addSuffix: true }) : "Unknown";
|
|
18964
|
-
return /* @__PURE__ */
|
|
19374
|
+
return /* @__PURE__ */ jsxs146(
|
|
18965
19375
|
Card,
|
|
18966
19376
|
{
|
|
18967
19377
|
className: `cursor-pointer transition-colors hover:bg-accent/50 ${!client.isActive ? "opacity-60" : ""}`,
|
|
18968
19378
|
onClick,
|
|
18969
19379
|
children: [
|
|
18970
|
-
/* @__PURE__ */
|
|
18971
|
-
/* @__PURE__ */
|
|
18972
|
-
/* @__PURE__ */
|
|
18973
|
-
/* @__PURE__ */
|
|
18974
|
-
/* @__PURE__ */
|
|
19380
|
+
/* @__PURE__ */ jsxs146(CardHeader, { className: "pb-2", children: [
|
|
19381
|
+
/* @__PURE__ */ jsxs146("div", { className: "flex items-start justify-between", children: [
|
|
19382
|
+
/* @__PURE__ */ jsxs146("div", { className: "flex items-center gap-2", children: [
|
|
19383
|
+
/* @__PURE__ */ jsx233(Key2, { className: "h-5 w-5 text-muted-foreground" }),
|
|
19384
|
+
/* @__PURE__ */ jsx233(CardTitle, { className: "text-lg", children: client.name })
|
|
18975
19385
|
] }),
|
|
18976
|
-
/* @__PURE__ */
|
|
18977
|
-
/* @__PURE__ */
|
|
18978
|
-
(onEdit || onDelete) && /* @__PURE__ */
|
|
18979
|
-
/* @__PURE__ */
|
|
18980
|
-
/* @__PURE__ */
|
|
18981
|
-
onEdit && /* @__PURE__ */
|
|
19386
|
+
/* @__PURE__ */ jsxs146("div", { className: "flex items-center gap-2", children: [
|
|
19387
|
+
/* @__PURE__ */ jsx233(Badge, { variant: client.isActive ? "default" : "secondary", children: client.isActive ? "Active" : "Inactive" }),
|
|
19388
|
+
(onEdit || onDelete) && /* @__PURE__ */ jsxs146(DropdownMenu, { children: [
|
|
19389
|
+
/* @__PURE__ */ jsx233(DropdownMenuTrigger, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx233(Button, { render: /* @__PURE__ */ jsx233("div", {}), nativeButton: false, variant: "ghost", size: "icon", className: "h-8 w-8", children: /* @__PURE__ */ jsx233(MoreVertical, { className: "h-4 w-4" }) }) }),
|
|
19390
|
+
/* @__PURE__ */ jsxs146(DropdownMenuContent, { align: "end", children: [
|
|
19391
|
+
onEdit && /* @__PURE__ */ jsxs146(
|
|
18982
19392
|
DropdownMenuItem,
|
|
18983
19393
|
{
|
|
18984
19394
|
onClick: (e) => {
|
|
@@ -18986,12 +19396,12 @@ function OAuthClientCard({ client, onClick, onEdit, onDelete }) {
|
|
|
18986
19396
|
onEdit();
|
|
18987
19397
|
},
|
|
18988
19398
|
children: [
|
|
18989
|
-
/* @__PURE__ */
|
|
19399
|
+
/* @__PURE__ */ jsx233(Pencil, { className: "h-4 w-4 mr-2" }),
|
|
18990
19400
|
"Edit"
|
|
18991
19401
|
]
|
|
18992
19402
|
}
|
|
18993
19403
|
),
|
|
18994
|
-
onDelete && /* @__PURE__ */
|
|
19404
|
+
onDelete && /* @__PURE__ */ jsxs146(
|
|
18995
19405
|
DropdownMenuItem,
|
|
18996
19406
|
{
|
|
18997
19407
|
onClick: (e) => {
|
|
@@ -19000,7 +19410,7 @@ function OAuthClientCard({ client, onClick, onEdit, onDelete }) {
|
|
|
19000
19410
|
},
|
|
19001
19411
|
className: "text-destructive",
|
|
19002
19412
|
children: [
|
|
19003
|
-
/* @__PURE__ */
|
|
19413
|
+
/* @__PURE__ */ jsx233(Trash24, { className: "h-4 w-4 mr-2" }),
|
|
19004
19414
|
"Delete"
|
|
19005
19415
|
]
|
|
19006
19416
|
}
|
|
@@ -19009,15 +19419,15 @@ function OAuthClientCard({ client, onClick, onEdit, onDelete }) {
|
|
|
19009
19419
|
] })
|
|
19010
19420
|
] })
|
|
19011
19421
|
] }),
|
|
19012
|
-
client.description && /* @__PURE__ */
|
|
19422
|
+
client.description && /* @__PURE__ */ jsx233(CardDescription, { className: "line-clamp-2", children: client.description })
|
|
19013
19423
|
] }),
|
|
19014
|
-
/* @__PURE__ */
|
|
19015
|
-
/* @__PURE__ */
|
|
19016
|
-
/* @__PURE__ */
|
|
19424
|
+
/* @__PURE__ */ jsx233(CardContent, { children: /* @__PURE__ */ jsxs146("div", { className: "flex flex-wrap gap-x-4 gap-y-1 text-sm text-muted-foreground", children: [
|
|
19425
|
+
/* @__PURE__ */ jsx233("span", { className: "font-mono", children: truncatedId }),
|
|
19426
|
+
/* @__PURE__ */ jsxs146("span", { children: [
|
|
19017
19427
|
"Created ",
|
|
19018
19428
|
createdAgo
|
|
19019
19429
|
] }),
|
|
19020
|
-
/* @__PURE__ */
|
|
19430
|
+
/* @__PURE__ */ jsx233("span", { children: client.isConfidential ? "Confidential" : "Public" })
|
|
19021
19431
|
] }) })
|
|
19022
19432
|
]
|
|
19023
19433
|
}
|
|
@@ -19027,7 +19437,7 @@ __name(OAuthClientCard, "OAuthClientCard");
|
|
|
19027
19437
|
|
|
19028
19438
|
// src/features/oauth/components/OAuthClientList.tsx
|
|
19029
19439
|
import { Plus as Plus3, Key as Key3 } from "lucide-react";
|
|
19030
|
-
import { jsx as
|
|
19440
|
+
import { jsx as jsx234, jsxs as jsxs147 } from "react/jsx-runtime";
|
|
19031
19441
|
function OAuthClientList({
|
|
19032
19442
|
clients,
|
|
19033
19443
|
isLoading = false,
|
|
@@ -19040,49 +19450,49 @@ function OAuthClientList({
|
|
|
19040
19450
|
title = "OAuth Applications"
|
|
19041
19451
|
}) {
|
|
19042
19452
|
if (isLoading && clients.length === 0) {
|
|
19043
|
-
return /* @__PURE__ */
|
|
19044
|
-
/* @__PURE__ */
|
|
19045
|
-
/* @__PURE__ */
|
|
19046
|
-
/* @__PURE__ */
|
|
19453
|
+
return /* @__PURE__ */ jsxs147("div", { className: "space-y-4", children: [
|
|
19454
|
+
/* @__PURE__ */ jsxs147("div", { className: "flex items-center justify-between", children: [
|
|
19455
|
+
/* @__PURE__ */ jsx234("h2", { className: "text-2xl font-bold", children: title }),
|
|
19456
|
+
/* @__PURE__ */ jsx234(Skeleton, { className: "h-10 w-32" })
|
|
19047
19457
|
] }),
|
|
19048
|
-
/* @__PURE__ */
|
|
19458
|
+
/* @__PURE__ */ jsx234("div", { className: "space-y-3", children: [1, 2, 3].map((i) => /* @__PURE__ */ jsx234(Skeleton, { className: "h-32 w-full" }, i)) })
|
|
19049
19459
|
] });
|
|
19050
19460
|
}
|
|
19051
19461
|
if (error) {
|
|
19052
|
-
return /* @__PURE__ */
|
|
19053
|
-
/* @__PURE__ */
|
|
19054
|
-
/* @__PURE__ */
|
|
19462
|
+
return /* @__PURE__ */ jsxs147("div", { className: "space-y-4", children: [
|
|
19463
|
+
/* @__PURE__ */ jsx234("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsx234("h2", { className: "text-2xl font-bold", children: title }) }),
|
|
19464
|
+
/* @__PURE__ */ jsx234("div", { className: "rounded-lg border border-destructive/50 bg-destructive/10 p-6 text-center", children: /* @__PURE__ */ jsx234("p", { className: "text-destructive", children: error.message }) })
|
|
19055
19465
|
] });
|
|
19056
19466
|
}
|
|
19057
19467
|
if (clients.length === 0) {
|
|
19058
|
-
return /* @__PURE__ */
|
|
19059
|
-
/* @__PURE__ */
|
|
19060
|
-
/* @__PURE__ */
|
|
19061
|
-
onCreateClick && /* @__PURE__ */
|
|
19062
|
-
/* @__PURE__ */
|
|
19468
|
+
return /* @__PURE__ */ jsxs147("div", { className: "space-y-4", children: [
|
|
19469
|
+
/* @__PURE__ */ jsxs147("div", { className: "flex items-center justify-between", children: [
|
|
19470
|
+
/* @__PURE__ */ jsx234("h2", { className: "text-2xl font-bold", children: title }),
|
|
19471
|
+
onCreateClick && /* @__PURE__ */ jsxs147(Button, { onClick: onCreateClick, children: [
|
|
19472
|
+
/* @__PURE__ */ jsx234(Plus3, { className: "h-4 w-4 mr-2" }),
|
|
19063
19473
|
"New App"
|
|
19064
19474
|
] })
|
|
19065
19475
|
] }),
|
|
19066
|
-
/* @__PURE__ */
|
|
19067
|
-
/* @__PURE__ */
|
|
19068
|
-
/* @__PURE__ */
|
|
19069
|
-
/* @__PURE__ */
|
|
19070
|
-
onCreateClick && /* @__PURE__ */
|
|
19071
|
-
/* @__PURE__ */
|
|
19476
|
+
/* @__PURE__ */ jsxs147("div", { className: "rounded-lg border border-dashed p-12 text-center", children: [
|
|
19477
|
+
/* @__PURE__ */ jsx234(Key3, { className: "h-12 w-12 mx-auto text-muted-foreground mb-4" }),
|
|
19478
|
+
/* @__PURE__ */ jsx234("h3", { className: "text-lg font-medium mb-2", children: "No OAuth Applications" }),
|
|
19479
|
+
/* @__PURE__ */ jsx234("p", { className: "text-muted-foreground mb-4", children: emptyStateMessage }),
|
|
19480
|
+
onCreateClick && /* @__PURE__ */ jsxs147(Button, { onClick: onCreateClick, children: [
|
|
19481
|
+
/* @__PURE__ */ jsx234(Plus3, { className: "h-4 w-4 mr-2" }),
|
|
19072
19482
|
"Create Application"
|
|
19073
19483
|
] })
|
|
19074
19484
|
] })
|
|
19075
19485
|
] });
|
|
19076
19486
|
}
|
|
19077
|
-
return /* @__PURE__ */
|
|
19078
|
-
/* @__PURE__ */
|
|
19079
|
-
/* @__PURE__ */
|
|
19080
|
-
onCreateClick && /* @__PURE__ */
|
|
19081
|
-
/* @__PURE__ */
|
|
19487
|
+
return /* @__PURE__ */ jsxs147("div", { className: "space-y-4", children: [
|
|
19488
|
+
/* @__PURE__ */ jsxs147("div", { className: "flex items-center justify-between", children: [
|
|
19489
|
+
/* @__PURE__ */ jsx234("h2", { className: "text-2xl font-bold", children: title }),
|
|
19490
|
+
onCreateClick && /* @__PURE__ */ jsxs147(Button, { onClick: onCreateClick, children: [
|
|
19491
|
+
/* @__PURE__ */ jsx234(Plus3, { className: "h-4 w-4 mr-2" }),
|
|
19082
19492
|
"New App"
|
|
19083
19493
|
] })
|
|
19084
19494
|
] }),
|
|
19085
|
-
/* @__PURE__ */
|
|
19495
|
+
/* @__PURE__ */ jsx234("div", { className: "space-y-3", children: clients.map((client) => /* @__PURE__ */ jsx234(
|
|
19086
19496
|
OAuthClientCard,
|
|
19087
19497
|
{
|
|
19088
19498
|
client,
|
|
@@ -19097,18 +19507,18 @@ function OAuthClientList({
|
|
|
19097
19507
|
__name(OAuthClientList, "OAuthClientList");
|
|
19098
19508
|
|
|
19099
19509
|
// src/features/oauth/components/OAuthClientForm.tsx
|
|
19100
|
-
import { useState as
|
|
19101
|
-
import { jsx as
|
|
19510
|
+
import { useState as useState89, useCallback as useCallback41 } from "react";
|
|
19511
|
+
import { jsx as jsx235, jsxs as jsxs148 } from "react/jsx-runtime";
|
|
19102
19512
|
function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
|
|
19103
19513
|
const isEditMode = !!client;
|
|
19104
|
-
const [formState, setFormState] =
|
|
19514
|
+
const [formState, setFormState] = useState89({
|
|
19105
19515
|
name: client?.name || "",
|
|
19106
19516
|
description: client?.description || "",
|
|
19107
19517
|
redirectUris: client?.redirectUris?.length ? client.redirectUris : [""],
|
|
19108
19518
|
allowedScopes: client?.allowedScopes || [],
|
|
19109
19519
|
isConfidential: client?.isConfidential ?? true
|
|
19110
19520
|
});
|
|
19111
|
-
const [errors, setErrors] =
|
|
19521
|
+
const [errors, setErrors] = useState89({});
|
|
19112
19522
|
const validate = useCallback41(() => {
|
|
19113
19523
|
const newErrors = {};
|
|
19114
19524
|
if (!formState.name.trim()) {
|
|
@@ -19140,15 +19550,15 @@ function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
|
|
|
19140
19550
|
},
|
|
19141
19551
|
[formState, validate, onSubmit]
|
|
19142
19552
|
);
|
|
19143
|
-
return /* @__PURE__ */
|
|
19144
|
-
/* @__PURE__ */
|
|
19145
|
-
/* @__PURE__ */
|
|
19146
|
-
/* @__PURE__ */
|
|
19553
|
+
return /* @__PURE__ */ jsx235(Card, { children: /* @__PURE__ */ jsxs148("form", { onSubmit: handleSubmit, children: [
|
|
19554
|
+
/* @__PURE__ */ jsxs148(CardHeader, { children: [
|
|
19555
|
+
/* @__PURE__ */ jsx235(CardTitle, { children: isEditMode ? "Edit Application" : "Create OAuth Application" }),
|
|
19556
|
+
/* @__PURE__ */ jsx235(CardDescription, { children: isEditMode ? "Update your OAuth application settings." : "Register a new application to access the API." })
|
|
19147
19557
|
] }),
|
|
19148
|
-
/* @__PURE__ */
|
|
19149
|
-
/* @__PURE__ */
|
|
19150
|
-
/* @__PURE__ */
|
|
19151
|
-
/* @__PURE__ */
|
|
19558
|
+
/* @__PURE__ */ jsxs148(CardContent, { className: "space-y-6", children: [
|
|
19559
|
+
/* @__PURE__ */ jsxs148("div", { className: "space-y-2", children: [
|
|
19560
|
+
/* @__PURE__ */ jsx235(Label, { htmlFor: "name", children: "Application Name *" }),
|
|
19561
|
+
/* @__PURE__ */ jsx235(
|
|
19152
19562
|
Input,
|
|
19153
19563
|
{
|
|
19154
19564
|
id: "name",
|
|
@@ -19159,11 +19569,11 @@ function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
|
|
|
19159
19569
|
className: errors.name ? "border-destructive" : ""
|
|
19160
19570
|
}
|
|
19161
19571
|
),
|
|
19162
|
-
errors.name && /* @__PURE__ */
|
|
19572
|
+
errors.name && /* @__PURE__ */ jsx235("p", { className: "text-sm text-destructive", children: errors.name })
|
|
19163
19573
|
] }),
|
|
19164
|
-
/* @__PURE__ */
|
|
19165
|
-
/* @__PURE__ */
|
|
19166
|
-
/* @__PURE__ */
|
|
19574
|
+
/* @__PURE__ */ jsxs148("div", { className: "space-y-2", children: [
|
|
19575
|
+
/* @__PURE__ */ jsx235(Label, { htmlFor: "description", children: "Description" }),
|
|
19576
|
+
/* @__PURE__ */ jsx235(
|
|
19167
19577
|
Textarea,
|
|
19168
19578
|
{
|
|
19169
19579
|
id: "description",
|
|
@@ -19175,7 +19585,7 @@ function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
|
|
|
19175
19585
|
}
|
|
19176
19586
|
)
|
|
19177
19587
|
] }),
|
|
19178
|
-
/* @__PURE__ */
|
|
19588
|
+
/* @__PURE__ */ jsx235(
|
|
19179
19589
|
OAuthRedirectUriInput,
|
|
19180
19590
|
{
|
|
19181
19591
|
value: formState.redirectUris,
|
|
@@ -19184,7 +19594,7 @@ function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
|
|
|
19184
19594
|
disabled: isLoading
|
|
19185
19595
|
}
|
|
19186
19596
|
),
|
|
19187
|
-
/* @__PURE__ */
|
|
19597
|
+
/* @__PURE__ */ jsx235(
|
|
19188
19598
|
OAuthScopeSelector,
|
|
19189
19599
|
{
|
|
19190
19600
|
value: formState.allowedScopes,
|
|
@@ -19193,48 +19603,48 @@ function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
|
|
|
19193
19603
|
disabled: isLoading
|
|
19194
19604
|
}
|
|
19195
19605
|
),
|
|
19196
|
-
/* @__PURE__ */
|
|
19197
|
-
/* @__PURE__ */
|
|
19198
|
-
/* @__PURE__ */
|
|
19606
|
+
/* @__PURE__ */ jsxs148("div", { className: "space-y-3", children: [
|
|
19607
|
+
/* @__PURE__ */ jsx235(Label, { children: "Client Type" }),
|
|
19608
|
+
/* @__PURE__ */ jsxs148(
|
|
19199
19609
|
RadioGroup,
|
|
19200
19610
|
{
|
|
19201
19611
|
value: formState.isConfidential ? "confidential" : "public",
|
|
19202
19612
|
onValueChange: (v) => setFormState((s) => ({ ...s, isConfidential: v === "confidential" })),
|
|
19203
19613
|
disabled: isLoading || isEditMode,
|
|
19204
19614
|
children: [
|
|
19205
|
-
/* @__PURE__ */
|
|
19206
|
-
/* @__PURE__ */
|
|
19207
|
-
/* @__PURE__ */
|
|
19208
|
-
/* @__PURE__ */
|
|
19209
|
-
/* @__PURE__ */
|
|
19615
|
+
/* @__PURE__ */ jsxs148("div", { className: "flex items-start space-x-3 p-3 rounded-md border", children: [
|
|
19616
|
+
/* @__PURE__ */ jsx235(RadioGroupItem, { value: "confidential", id: "confidential", className: "mt-1" }),
|
|
19617
|
+
/* @__PURE__ */ jsxs148("div", { children: [
|
|
19618
|
+
/* @__PURE__ */ jsx235(Label, { htmlFor: "confidential", className: "font-medium cursor-pointer", children: "Confidential" }),
|
|
19619
|
+
/* @__PURE__ */ jsx235("p", { className: "text-sm text-muted-foreground", children: "Server-side application that can securely store the client secret." })
|
|
19210
19620
|
] })
|
|
19211
19621
|
] }),
|
|
19212
|
-
/* @__PURE__ */
|
|
19213
|
-
/* @__PURE__ */
|
|
19214
|
-
/* @__PURE__ */
|
|
19215
|
-
/* @__PURE__ */
|
|
19216
|
-
/* @__PURE__ */
|
|
19622
|
+
/* @__PURE__ */ jsxs148("div", { className: "flex items-start space-x-3 p-3 rounded-md border", children: [
|
|
19623
|
+
/* @__PURE__ */ jsx235(RadioGroupItem, { value: "public", id: "public", className: "mt-1" }),
|
|
19624
|
+
/* @__PURE__ */ jsxs148("div", { children: [
|
|
19625
|
+
/* @__PURE__ */ jsx235(Label, { htmlFor: "public", className: "font-medium cursor-pointer", children: "Public" }),
|
|
19626
|
+
/* @__PURE__ */ jsx235("p", { className: "text-sm text-muted-foreground", children: "Mobile or desktop application. Requires PKCE for authorization." })
|
|
19217
19627
|
] })
|
|
19218
19628
|
] })
|
|
19219
19629
|
]
|
|
19220
19630
|
}
|
|
19221
19631
|
),
|
|
19222
|
-
isEditMode && /* @__PURE__ */
|
|
19632
|
+
isEditMode && /* @__PURE__ */ jsx235("p", { className: "text-sm text-muted-foreground", children: "Client type cannot be changed after creation." })
|
|
19223
19633
|
] })
|
|
19224
19634
|
] }),
|
|
19225
|
-
/* @__PURE__ */
|
|
19226
|
-
/* @__PURE__ */
|
|
19227
|
-
/* @__PURE__ */
|
|
19635
|
+
/* @__PURE__ */ jsxs148(CardFooter, { className: "flex justify-end gap-3", children: [
|
|
19636
|
+
/* @__PURE__ */ jsx235(Button, { type: "button", variant: "outline", onClick: onCancel, disabled: isLoading, children: "Cancel" }),
|
|
19637
|
+
/* @__PURE__ */ jsx235(Button, { type: "submit", disabled: isLoading, children: isLoading ? "Saving..." : isEditMode ? "Save Changes" : "Create Application" })
|
|
19228
19638
|
] })
|
|
19229
19639
|
] }) });
|
|
19230
19640
|
}
|
|
19231
19641
|
__name(OAuthClientForm, "OAuthClientForm");
|
|
19232
19642
|
|
|
19233
19643
|
// src/features/oauth/components/OAuthClientDetail.tsx
|
|
19234
|
-
import { useState as
|
|
19644
|
+
import { useState as useState90, useCallback as useCallback42 } from "react";
|
|
19235
19645
|
import { format as format2 } from "date-fns";
|
|
19236
19646
|
import { Copy as Copy4, Check as Check2, RefreshCw as RefreshCw3, Pencil as Pencil2, Trash2 as Trash25, ExternalLink } from "lucide-react";
|
|
19237
|
-
import { Fragment as Fragment51, jsx as
|
|
19647
|
+
import { Fragment as Fragment51, jsx as jsx236, jsxs as jsxs149 } from "react/jsx-runtime";
|
|
19238
19648
|
function OAuthClientDetail({
|
|
19239
19649
|
client,
|
|
19240
19650
|
isLoading = false,
|
|
@@ -19242,11 +19652,11 @@ function OAuthClientDetail({
|
|
|
19242
19652
|
onDelete,
|
|
19243
19653
|
onRegenerateSecret
|
|
19244
19654
|
}) {
|
|
19245
|
-
const [copiedField, setCopiedField] =
|
|
19246
|
-
const [showDeleteConfirm, setShowDeleteConfirm] =
|
|
19247
|
-
const [showRegenerateConfirm, setShowRegenerateConfirm] =
|
|
19248
|
-
const [isDeleting, setIsDeleting] =
|
|
19249
|
-
const [isRegenerating, setIsRegenerating] =
|
|
19655
|
+
const [copiedField, setCopiedField] = useState90(null);
|
|
19656
|
+
const [showDeleteConfirm, setShowDeleteConfirm] = useState90(false);
|
|
19657
|
+
const [showRegenerateConfirm, setShowRegenerateConfirm] = useState90(false);
|
|
19658
|
+
const [isDeleting, setIsDeleting] = useState90(false);
|
|
19659
|
+
const [isRegenerating, setIsRegenerating] = useState90(false);
|
|
19250
19660
|
const copyToClipboard2 = useCallback42(async (text, field) => {
|
|
19251
19661
|
try {
|
|
19252
19662
|
await navigator.clipboard.writeText(text);
|
|
@@ -19277,40 +19687,40 @@ function OAuthClientDetail({
|
|
|
19277
19687
|
}
|
|
19278
19688
|
}, [onRegenerateSecret]);
|
|
19279
19689
|
const createdDate = client.createdAt ? format2(new Date(client.createdAt), "MMMM d, yyyy") : "Unknown";
|
|
19280
|
-
return /* @__PURE__ */
|
|
19281
|
-
/* @__PURE__ */
|
|
19282
|
-
/* @__PURE__ */
|
|
19283
|
-
/* @__PURE__ */
|
|
19284
|
-
/* @__PURE__ */
|
|
19285
|
-
client.description && /* @__PURE__ */
|
|
19690
|
+
return /* @__PURE__ */ jsxs149(Fragment51, { children: [
|
|
19691
|
+
/* @__PURE__ */ jsxs149(Card, { children: [
|
|
19692
|
+
/* @__PURE__ */ jsx236(CardHeader, { children: /* @__PURE__ */ jsxs149("div", { className: "flex items-start justify-between", children: [
|
|
19693
|
+
/* @__PURE__ */ jsxs149("div", { children: [
|
|
19694
|
+
/* @__PURE__ */ jsx236(CardTitle, { className: "text-2xl", children: client.name }),
|
|
19695
|
+
client.description && /* @__PURE__ */ jsx236(CardDescription, { className: "mt-1", children: client.description })
|
|
19286
19696
|
] }),
|
|
19287
|
-
/* @__PURE__ */
|
|
19288
|
-
/* @__PURE__ */
|
|
19289
|
-
/* @__PURE__ */
|
|
19697
|
+
/* @__PURE__ */ jsxs149("div", { className: "flex items-center gap-2", children: [
|
|
19698
|
+
/* @__PURE__ */ jsx236(Badge, { variant: client.isActive ? "default" : "secondary", children: client.isActive ? "Active" : "Inactive" }),
|
|
19699
|
+
/* @__PURE__ */ jsx236(Badge, { variant: "outline", children: client.isConfidential ? "Confidential" : "Public" })
|
|
19290
19700
|
] })
|
|
19291
19701
|
] }) }),
|
|
19292
|
-
/* @__PURE__ */
|
|
19293
|
-
/* @__PURE__ */
|
|
19294
|
-
/* @__PURE__ */
|
|
19295
|
-
/* @__PURE__ */
|
|
19296
|
-
/* @__PURE__ */
|
|
19297
|
-
/* @__PURE__ */
|
|
19702
|
+
/* @__PURE__ */ jsxs149(CardContent, { className: "space-y-6", children: [
|
|
19703
|
+
/* @__PURE__ */ jsxs149("div", { className: "space-y-2", children: [
|
|
19704
|
+
/* @__PURE__ */ jsx236(Label, { children: "Client ID" }),
|
|
19705
|
+
/* @__PURE__ */ jsxs149("div", { className: "flex gap-2", children: [
|
|
19706
|
+
/* @__PURE__ */ jsx236(Input, { value: client.clientId, readOnly: true, className: "font-mono" }),
|
|
19707
|
+
/* @__PURE__ */ jsx236(
|
|
19298
19708
|
Button,
|
|
19299
19709
|
{
|
|
19300
19710
|
variant: "outline",
|
|
19301
19711
|
size: "icon",
|
|
19302
19712
|
onClick: () => copyToClipboard2(client.clientId, "clientId"),
|
|
19303
19713
|
title: "Copy Client ID",
|
|
19304
|
-
children: copiedField === "clientId" ? /* @__PURE__ */
|
|
19714
|
+
children: copiedField === "clientId" ? /* @__PURE__ */ jsx236(Check2, { className: "h-4 w-4 text-green-600" }) : /* @__PURE__ */ jsx236(Copy4, { className: "h-4 w-4" })
|
|
19305
19715
|
}
|
|
19306
19716
|
)
|
|
19307
19717
|
] })
|
|
19308
19718
|
] }),
|
|
19309
|
-
/* @__PURE__ */
|
|
19310
|
-
/* @__PURE__ */
|
|
19311
|
-
/* @__PURE__ */
|
|
19312
|
-
/* @__PURE__ */
|
|
19313
|
-
onRegenerateSecret && /* @__PURE__ */
|
|
19719
|
+
/* @__PURE__ */ jsxs149("div", { className: "space-y-2", children: [
|
|
19720
|
+
/* @__PURE__ */ jsx236(Label, { children: "Client Secret" }),
|
|
19721
|
+
/* @__PURE__ */ jsxs149("div", { className: "flex gap-2", children: [
|
|
19722
|
+
/* @__PURE__ */ jsx236(Input, { value: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022", readOnly: true, className: "font-mono" }),
|
|
19723
|
+
onRegenerateSecret && /* @__PURE__ */ jsx236(
|
|
19314
19724
|
Button,
|
|
19315
19725
|
{
|
|
19316
19726
|
variant: "outline",
|
|
@@ -19318,57 +19728,57 @@ function OAuthClientDetail({
|
|
|
19318
19728
|
onClick: () => setShowRegenerateConfirm(true),
|
|
19319
19729
|
title: "Regenerate Secret",
|
|
19320
19730
|
disabled: isLoading,
|
|
19321
|
-
children: /* @__PURE__ */
|
|
19731
|
+
children: /* @__PURE__ */ jsx236(RefreshCw3, { className: "h-4 w-4" })
|
|
19322
19732
|
}
|
|
19323
19733
|
)
|
|
19324
19734
|
] }),
|
|
19325
|
-
/* @__PURE__ */
|
|
19735
|
+
/* @__PURE__ */ jsx236("p", { className: "text-xs text-muted-foreground", children: "Regenerating will invalidate the current secret and all existing tokens." })
|
|
19326
19736
|
] }),
|
|
19327
|
-
/* @__PURE__ */
|
|
19328
|
-
/* @__PURE__ */
|
|
19329
|
-
/* @__PURE__ */
|
|
19330
|
-
/* @__PURE__ */
|
|
19331
|
-
/* @__PURE__ */
|
|
19737
|
+
/* @__PURE__ */ jsx236(Separator, {}),
|
|
19738
|
+
/* @__PURE__ */ jsxs149("div", { className: "space-y-2", children: [
|
|
19739
|
+
/* @__PURE__ */ jsx236(Label, { children: "Redirect URIs" }),
|
|
19740
|
+
/* @__PURE__ */ jsx236("ul", { className: "space-y-1", children: client.redirectUris.map((uri, index) => /* @__PURE__ */ jsxs149("li", { className: "flex items-center gap-2 text-sm font-mono", children: [
|
|
19741
|
+
/* @__PURE__ */ jsx236(ExternalLink, { className: "h-3 w-3 text-muted-foreground" }),
|
|
19332
19742
|
uri
|
|
19333
19743
|
] }, index)) })
|
|
19334
19744
|
] }),
|
|
19335
|
-
/* @__PURE__ */
|
|
19336
|
-
/* @__PURE__ */
|
|
19337
|
-
/* @__PURE__ */
|
|
19745
|
+
/* @__PURE__ */ jsxs149("div", { className: "space-y-2", children: [
|
|
19746
|
+
/* @__PURE__ */ jsx236(Label, { children: "Allowed Scopes" }),
|
|
19747
|
+
/* @__PURE__ */ jsx236("div", { className: "flex flex-wrap gap-2", children: client.allowedScopes.map((scope) => /* @__PURE__ */ jsx236(Badge, { variant: "secondary", children: OAUTH_SCOPE_DISPLAY[scope]?.name || scope }, scope)) })
|
|
19338
19748
|
] }),
|
|
19339
|
-
/* @__PURE__ */
|
|
19340
|
-
/* @__PURE__ */
|
|
19341
|
-
/* @__PURE__ */
|
|
19749
|
+
/* @__PURE__ */ jsxs149("div", { className: "space-y-2", children: [
|
|
19750
|
+
/* @__PURE__ */ jsx236(Label, { children: "Grant Types" }),
|
|
19751
|
+
/* @__PURE__ */ jsx236("div", { className: "flex flex-wrap gap-2", children: client.allowedGrantTypes.map((grant) => /* @__PURE__ */ jsx236(Badge, { variant: "outline", children: grant.replace(/_/g, " ") }, grant)) })
|
|
19342
19752
|
] }),
|
|
19343
|
-
/* @__PURE__ */
|
|
19344
|
-
/* @__PURE__ */
|
|
19753
|
+
/* @__PURE__ */ jsx236(Separator, {}),
|
|
19754
|
+
/* @__PURE__ */ jsx236("div", { className: "flex flex-wrap gap-x-6 gap-y-2 text-sm text-muted-foreground", children: /* @__PURE__ */ jsxs149("span", { children: [
|
|
19345
19755
|
"Created: ",
|
|
19346
19756
|
createdDate
|
|
19347
19757
|
] }) }),
|
|
19348
|
-
/* @__PURE__ */
|
|
19349
|
-
onEdit && /* @__PURE__ */
|
|
19350
|
-
/* @__PURE__ */
|
|
19758
|
+
/* @__PURE__ */ jsxs149("div", { className: "flex gap-3 pt-4", children: [
|
|
19759
|
+
onEdit && /* @__PURE__ */ jsxs149(Button, { variant: "outline", onClick: onEdit, disabled: isLoading, children: [
|
|
19760
|
+
/* @__PURE__ */ jsx236(Pencil2, { className: "h-4 w-4 mr-2" }),
|
|
19351
19761
|
"Edit"
|
|
19352
19762
|
] }),
|
|
19353
|
-
onDelete && /* @__PURE__ */
|
|
19354
|
-
/* @__PURE__ */
|
|
19763
|
+
onDelete && /* @__PURE__ */ jsxs149(Button, { variant: "destructive", onClick: () => setShowDeleteConfirm(true), disabled: isLoading, children: [
|
|
19764
|
+
/* @__PURE__ */ jsx236(Trash25, { className: "h-4 w-4 mr-2" }),
|
|
19355
19765
|
"Delete"
|
|
19356
19766
|
] })
|
|
19357
19767
|
] })
|
|
19358
19768
|
] })
|
|
19359
19769
|
] }),
|
|
19360
|
-
/* @__PURE__ */
|
|
19361
|
-
/* @__PURE__ */
|
|
19362
|
-
/* @__PURE__ */
|
|
19363
|
-
/* @__PURE__ */
|
|
19770
|
+
/* @__PURE__ */ jsx236(AlertDialog, { open: showDeleteConfirm, onOpenChange: setShowDeleteConfirm, children: /* @__PURE__ */ jsxs149(AlertDialogContent, { children: [
|
|
19771
|
+
/* @__PURE__ */ jsxs149(AlertDialogHeader, { children: [
|
|
19772
|
+
/* @__PURE__ */ jsx236(AlertDialogTitle, { children: "Delete OAuth Application?" }),
|
|
19773
|
+
/* @__PURE__ */ jsxs149(AlertDialogDescription, { children: [
|
|
19364
19774
|
'This will permanently delete "',
|
|
19365
19775
|
client.name,
|
|
19366
19776
|
'" and revoke all access tokens. This action cannot be undone.'
|
|
19367
19777
|
] })
|
|
19368
19778
|
] }),
|
|
19369
|
-
/* @__PURE__ */
|
|
19370
|
-
/* @__PURE__ */
|
|
19371
|
-
/* @__PURE__ */
|
|
19779
|
+
/* @__PURE__ */ jsxs149(AlertDialogFooter, { children: [
|
|
19780
|
+
/* @__PURE__ */ jsx236(AlertDialogCancel, { disabled: isDeleting, children: "Cancel" }),
|
|
19781
|
+
/* @__PURE__ */ jsx236(
|
|
19372
19782
|
AlertDialogAction,
|
|
19373
19783
|
{
|
|
19374
19784
|
onClick: handleDelete,
|
|
@@ -19379,14 +19789,14 @@ function OAuthClientDetail({
|
|
|
19379
19789
|
)
|
|
19380
19790
|
] })
|
|
19381
19791
|
] }) }),
|
|
19382
|
-
/* @__PURE__ */
|
|
19383
|
-
/* @__PURE__ */
|
|
19384
|
-
/* @__PURE__ */
|
|
19385
|
-
/* @__PURE__ */
|
|
19792
|
+
/* @__PURE__ */ jsx236(AlertDialog, { open: showRegenerateConfirm, onOpenChange: setShowRegenerateConfirm, children: /* @__PURE__ */ jsxs149(AlertDialogContent, { children: [
|
|
19793
|
+
/* @__PURE__ */ jsxs149(AlertDialogHeader, { children: [
|
|
19794
|
+
/* @__PURE__ */ jsx236(AlertDialogTitle, { children: "Regenerate Client Secret?" }),
|
|
19795
|
+
/* @__PURE__ */ jsx236(AlertDialogDescription, { children: "This will generate a new client secret and invalidate the old one. All existing tokens will be revoked. You will need to update your application with the new secret." })
|
|
19386
19796
|
] }),
|
|
19387
|
-
/* @__PURE__ */
|
|
19388
|
-
/* @__PURE__ */
|
|
19389
|
-
/* @__PURE__ */
|
|
19797
|
+
/* @__PURE__ */ jsxs149(AlertDialogFooter, { children: [
|
|
19798
|
+
/* @__PURE__ */ jsx236(AlertDialogCancel, { disabled: isRegenerating, children: "Cancel" }),
|
|
19799
|
+
/* @__PURE__ */ jsx236(AlertDialogAction, { onClick: handleRegenerateSecret, disabled: isRegenerating, children: isRegenerating ? "Regenerating..." : "Regenerate" })
|
|
19390
19800
|
] })
|
|
19391
19801
|
] }) })
|
|
19392
19802
|
] });
|
|
@@ -19395,17 +19805,17 @@ __name(OAuthClientDetail, "OAuthClientDetail");
|
|
|
19395
19805
|
|
|
19396
19806
|
// src/features/oauth/components/consent/OAuthConsentHeader.tsx
|
|
19397
19807
|
import { Shield } from "lucide-react";
|
|
19398
|
-
import { jsx as
|
|
19808
|
+
import { jsx as jsx237, jsxs as jsxs150 } from "react/jsx-runtime";
|
|
19399
19809
|
function OAuthConsentHeader({ client, logoUrl, appName = "Only35" }) {
|
|
19400
|
-
return /* @__PURE__ */
|
|
19401
|
-
/* @__PURE__ */
|
|
19402
|
-
/* @__PURE__ */
|
|
19403
|
-
/* @__PURE__ */
|
|
19810
|
+
return /* @__PURE__ */ jsxs150("div", { className: "text-center space-y-4", children: [
|
|
19811
|
+
/* @__PURE__ */ jsx237("div", { className: "flex justify-center", children: logoUrl ? /* @__PURE__ */ jsx237("img", { src: logoUrl, alt: appName, className: "h-12 w-auto" }) : /* @__PURE__ */ jsx237("div", { className: "h-12 w-12 rounded-full bg-primary flex items-center justify-center", children: /* @__PURE__ */ jsx237(Shield, { className: "h-6 w-6 text-primary-foreground" }) }) }),
|
|
19812
|
+
/* @__PURE__ */ jsxs150("div", { className: "space-y-2", children: [
|
|
19813
|
+
/* @__PURE__ */ jsxs150("h1", { className: "text-2xl font-bold", children: [
|
|
19404
19814
|
"Authorize ",
|
|
19405
19815
|
client.name
|
|
19406
19816
|
] }),
|
|
19407
|
-
/* @__PURE__ */
|
|
19408
|
-
/* @__PURE__ */
|
|
19817
|
+
/* @__PURE__ */ jsxs150("p", { className: "text-muted-foreground", children: [
|
|
19818
|
+
/* @__PURE__ */ jsx237("span", { className: "font-medium text-foreground", children: client.name }),
|
|
19409
19819
|
" wants to access your ",
|
|
19410
19820
|
appName,
|
|
19411
19821
|
" account"
|
|
@@ -19417,7 +19827,7 @@ __name(OAuthConsentHeader, "OAuthConsentHeader");
|
|
|
19417
19827
|
|
|
19418
19828
|
// src/features/oauth/components/consent/OAuthScopeList.tsx
|
|
19419
19829
|
import { Eye, Pencil as Pencil3, Image as Image15, Upload, Film, FolderPlus, User, Shield as Shield2 } from "lucide-react";
|
|
19420
|
-
import { jsx as
|
|
19830
|
+
import { jsx as jsx238, jsxs as jsxs151 } from "react/jsx-runtime";
|
|
19421
19831
|
var SCOPE_ICONS = {
|
|
19422
19832
|
eye: Eye,
|
|
19423
19833
|
pencil: Pencil3,
|
|
@@ -19432,15 +19842,15 @@ function OAuthScopeList({ scopes }) {
|
|
|
19432
19842
|
if (scopes.length === 0) {
|
|
19433
19843
|
return null;
|
|
19434
19844
|
}
|
|
19435
|
-
return /* @__PURE__ */
|
|
19436
|
-
/* @__PURE__ */
|
|
19437
|
-
/* @__PURE__ */
|
|
19845
|
+
return /* @__PURE__ */ jsxs151("div", { className: "space-y-3", children: [
|
|
19846
|
+
/* @__PURE__ */ jsx238("h2", { className: "text-sm font-medium text-muted-foreground uppercase tracking-wide", children: "This will allow the application to:" }),
|
|
19847
|
+
/* @__PURE__ */ jsx238("ul", { className: "space-y-3", children: scopes.map((scope) => {
|
|
19438
19848
|
const IconComponent = scope.icon ? SCOPE_ICONS[scope.icon] : Eye;
|
|
19439
|
-
return /* @__PURE__ */
|
|
19440
|
-
/* @__PURE__ */
|
|
19441
|
-
/* @__PURE__ */
|
|
19442
|
-
/* @__PURE__ */
|
|
19443
|
-
/* @__PURE__ */
|
|
19849
|
+
return /* @__PURE__ */ jsxs151("li", { className: "flex items-start gap-3 p-3 rounded-lg bg-muted/50", children: [
|
|
19850
|
+
/* @__PURE__ */ jsx238("div", { className: "flex-shrink-0 mt-0.5", children: /* @__PURE__ */ jsx238("div", { className: "h-8 w-8 rounded-full bg-primary/10 flex items-center justify-center", children: IconComponent && /* @__PURE__ */ jsx238(IconComponent, { className: "h-4 w-4 text-primary" }) }) }),
|
|
19851
|
+
/* @__PURE__ */ jsxs151("div", { className: "flex-1", children: [
|
|
19852
|
+
/* @__PURE__ */ jsx238("p", { className: "font-medium", children: scope.name }),
|
|
19853
|
+
/* @__PURE__ */ jsx238("p", { className: "text-sm text-muted-foreground", children: scope.description })
|
|
19444
19854
|
] })
|
|
19445
19855
|
] }, scope.scope);
|
|
19446
19856
|
}) })
|
|
@@ -19449,18 +19859,18 @@ function OAuthScopeList({ scopes }) {
|
|
|
19449
19859
|
__name(OAuthScopeList, "OAuthScopeList");
|
|
19450
19860
|
|
|
19451
19861
|
// src/features/oauth/components/consent/OAuthConsentActions.tsx
|
|
19452
|
-
import { jsx as
|
|
19862
|
+
import { jsx as jsx239, jsxs as jsxs152 } from "react/jsx-runtime";
|
|
19453
19863
|
function OAuthConsentActions({ onApprove, onDeny, isLoading = false }) {
|
|
19454
|
-
return /* @__PURE__ */
|
|
19455
|
-
/* @__PURE__ */
|
|
19456
|
-
/* @__PURE__ */
|
|
19864
|
+
return /* @__PURE__ */ jsxs152("div", { className: "flex flex-col sm:flex-row gap-3", children: [
|
|
19865
|
+
/* @__PURE__ */ jsx239(Button, { variant: "outline", onClick: onDeny, disabled: isLoading, className: "flex-1", children: "Deny" }),
|
|
19866
|
+
/* @__PURE__ */ jsx239(Button, { onClick: onApprove, disabled: isLoading, className: "flex-1", children: isLoading ? "Authorizing..." : "Authorize" })
|
|
19457
19867
|
] });
|
|
19458
19868
|
}
|
|
19459
19869
|
__name(OAuthConsentActions, "OAuthConsentActions");
|
|
19460
19870
|
|
|
19461
19871
|
// src/features/oauth/components/consent/OAuthConsentScreen.tsx
|
|
19462
19872
|
import { ExternalLink as ExternalLink2, AlertTriangle as AlertTriangle2, Loader2 as Loader26 } from "lucide-react";
|
|
19463
|
-
import { jsx as
|
|
19873
|
+
import { jsx as jsx240, jsxs as jsxs153 } from "react/jsx-runtime";
|
|
19464
19874
|
function OAuthConsentScreen({
|
|
19465
19875
|
params,
|
|
19466
19876
|
logoUrl,
|
|
@@ -19470,41 +19880,41 @@ function OAuthConsentScreen({
|
|
|
19470
19880
|
}) {
|
|
19471
19881
|
const { clientInfo, isLoading, error, approve, deny, isSubmitting } = useOAuthConsent(params);
|
|
19472
19882
|
if (isLoading) {
|
|
19473
|
-
return /* @__PURE__ */
|
|
19474
|
-
/* @__PURE__ */
|
|
19475
|
-
/* @__PURE__ */
|
|
19883
|
+
return /* @__PURE__ */ jsx240("div", { className: "min-h-screen flex items-center justify-center p-4", children: /* @__PURE__ */ jsx240(Card, { className: "w-full max-w-md", children: /* @__PURE__ */ jsxs153(CardContent, { className: "flex flex-col items-center justify-center py-12", children: [
|
|
19884
|
+
/* @__PURE__ */ jsx240(Loader26, { className: "h-8 w-8 animate-spin text-muted-foreground" }),
|
|
19885
|
+
/* @__PURE__ */ jsx240("p", { className: "mt-4 text-muted-foreground", children: "Loading authorization request..." })
|
|
19476
19886
|
] }) }) });
|
|
19477
19887
|
}
|
|
19478
19888
|
if (error || !clientInfo) {
|
|
19479
|
-
return /* @__PURE__ */
|
|
19480
|
-
/* @__PURE__ */
|
|
19481
|
-
/* @__PURE__ */
|
|
19889
|
+
return /* @__PURE__ */ jsx240("div", { className: "min-h-screen flex items-center justify-center p-4", children: /* @__PURE__ */ jsx240(Card, { className: "w-full max-w-md", children: /* @__PURE__ */ jsx240(CardContent, { className: "py-8", children: /* @__PURE__ */ jsxs153(Alert, { variant: "destructive", children: [
|
|
19890
|
+
/* @__PURE__ */ jsx240(AlertTriangle2, { className: "h-4 w-4" }),
|
|
19891
|
+
/* @__PURE__ */ jsx240(AlertDescription, { children: error?.message || "Invalid authorization request. Please try again." })
|
|
19482
19892
|
] }) }) }) });
|
|
19483
19893
|
}
|
|
19484
19894
|
const { client, scopes } = clientInfo;
|
|
19485
|
-
return /* @__PURE__ */
|
|
19486
|
-
/* @__PURE__ */
|
|
19487
|
-
/* @__PURE__ */
|
|
19488
|
-
/* @__PURE__ */
|
|
19489
|
-
/* @__PURE__ */
|
|
19490
|
-
/* @__PURE__ */
|
|
19491
|
-
/* @__PURE__ */
|
|
19492
|
-
/* @__PURE__ */
|
|
19493
|
-
/* @__PURE__ */
|
|
19494
|
-
/* @__PURE__ */
|
|
19495
|
-
/* @__PURE__ */
|
|
19895
|
+
return /* @__PURE__ */ jsx240("div", { className: "min-h-screen flex items-center justify-center p-4 bg-muted/30", children: /* @__PURE__ */ jsxs153(Card, { className: "w-full max-w-md", children: [
|
|
19896
|
+
/* @__PURE__ */ jsxs153(CardContent, { className: "pt-6 space-y-6", children: [
|
|
19897
|
+
/* @__PURE__ */ jsx240(OAuthConsentHeader, { client, logoUrl, appName }),
|
|
19898
|
+
/* @__PURE__ */ jsx240(Separator, {}),
|
|
19899
|
+
/* @__PURE__ */ jsx240(OAuthScopeList, { scopes }),
|
|
19900
|
+
/* @__PURE__ */ jsx240(Separator, {}),
|
|
19901
|
+
/* @__PURE__ */ jsxs153("div", { className: "flex items-start gap-2 text-sm text-muted-foreground", children: [
|
|
19902
|
+
/* @__PURE__ */ jsx240(ExternalLink2, { className: "h-4 w-4 mt-0.5 flex-shrink-0" }),
|
|
19903
|
+
/* @__PURE__ */ jsxs153("div", { children: [
|
|
19904
|
+
/* @__PURE__ */ jsx240("span", { children: "Authorizing will redirect you to:" }),
|
|
19905
|
+
/* @__PURE__ */ jsx240("p", { className: "font-mono text-xs mt-1 break-all", children: params.redirectUri })
|
|
19496
19906
|
] })
|
|
19497
19907
|
] }),
|
|
19498
|
-
/* @__PURE__ */
|
|
19908
|
+
/* @__PURE__ */ jsx240(OAuthConsentActions, { onApprove: approve, onDeny: deny, isLoading: isSubmitting })
|
|
19499
19909
|
] }),
|
|
19500
|
-
/* @__PURE__ */
|
|
19910
|
+
/* @__PURE__ */ jsx240(CardFooter, { className: "justify-center", children: /* @__PURE__ */ jsxs153("p", { className: "text-xs text-center text-muted-foreground", children: [
|
|
19501
19911
|
"By authorizing, you agree to the app's",
|
|
19502
19912
|
" ",
|
|
19503
|
-
/* @__PURE__ */
|
|
19913
|
+
/* @__PURE__ */ jsx240("a", { href: termsUrl, className: "underline hover:text-foreground", target: "_blank", rel: "noopener", children: "Terms of Service" }),
|
|
19504
19914
|
" ",
|
|
19505
19915
|
"and",
|
|
19506
19916
|
" ",
|
|
19507
|
-
/* @__PURE__ */
|
|
19917
|
+
/* @__PURE__ */ jsx240("a", { href: privacyUrl, className: "underline hover:text-foreground", target: "_blank", rel: "noopener", children: "Privacy Policy" }),
|
|
19508
19918
|
"."
|
|
19509
19919
|
] }) })
|
|
19510
19920
|
] }) });
|
|
@@ -19514,14 +19924,14 @@ __name(OAuthConsentScreen, "OAuthConsentScreen");
|
|
|
19514
19924
|
// src/features/waitlist/components/forms/WaitlistForm.tsx
|
|
19515
19925
|
import { zodResolver as zodResolver10 } from "@hookform/resolvers/zod";
|
|
19516
19926
|
import { CheckCircle, Mail as Mail2 } from "lucide-react";
|
|
19517
|
-
import { useTranslations as
|
|
19518
|
-
import { useState as
|
|
19927
|
+
import { useTranslations as useTranslations104 } from "next-intl";
|
|
19928
|
+
import { useState as useState91 } from "react";
|
|
19519
19929
|
import { useForm as useForm10 } from "react-hook-form";
|
|
19520
19930
|
import { v4 as v411 } from "uuid";
|
|
19521
19931
|
import { z as z10 } from "zod";
|
|
19522
19932
|
|
|
19523
19933
|
// src/features/waitlist/components/forms/WaitlistQuestionnaireRenderer.tsx
|
|
19524
|
-
import { jsx as
|
|
19934
|
+
import { jsx as jsx241, jsxs as jsxs154 } from "react/jsx-runtime";
|
|
19525
19935
|
function WaitlistQuestionnaireRenderer({
|
|
19526
19936
|
form,
|
|
19527
19937
|
fields,
|
|
@@ -19530,11 +19940,11 @@ function WaitlistQuestionnaireRenderer({
|
|
|
19530
19940
|
if (!fields || fields.length === 0) {
|
|
19531
19941
|
return null;
|
|
19532
19942
|
}
|
|
19533
|
-
return /* @__PURE__ */
|
|
19943
|
+
return /* @__PURE__ */ jsx241("div", { className: "space-y-4", children: fields.map((field) => {
|
|
19534
19944
|
const fieldId = `${fieldPrefix}.${field.id}`;
|
|
19535
19945
|
switch (field.type) {
|
|
19536
19946
|
case "text":
|
|
19537
|
-
return /* @__PURE__ */
|
|
19947
|
+
return /* @__PURE__ */ jsx241(
|
|
19538
19948
|
FormInput,
|
|
19539
19949
|
{
|
|
19540
19950
|
form,
|
|
@@ -19546,7 +19956,7 @@ function WaitlistQuestionnaireRenderer({
|
|
|
19546
19956
|
field.id
|
|
19547
19957
|
);
|
|
19548
19958
|
case "textarea":
|
|
19549
|
-
return /* @__PURE__ */
|
|
19959
|
+
return /* @__PURE__ */ jsx241(
|
|
19550
19960
|
FormTextarea,
|
|
19551
19961
|
{
|
|
19552
19962
|
form,
|
|
@@ -19561,7 +19971,7 @@ function WaitlistQuestionnaireRenderer({
|
|
|
19561
19971
|
if (!field.options || field.options.length === 0) {
|
|
19562
19972
|
return null;
|
|
19563
19973
|
}
|
|
19564
|
-
return /* @__PURE__ */
|
|
19974
|
+
return /* @__PURE__ */ jsx241(
|
|
19565
19975
|
FormSelect,
|
|
19566
19976
|
{
|
|
19567
19977
|
form,
|
|
@@ -19576,7 +19986,7 @@ function WaitlistQuestionnaireRenderer({
|
|
|
19576
19986
|
);
|
|
19577
19987
|
case "checkbox":
|
|
19578
19988
|
if (!field.options || field.options.length === 0) {
|
|
19579
|
-
return /* @__PURE__ */
|
|
19989
|
+
return /* @__PURE__ */ jsx241(
|
|
19580
19990
|
FormCheckbox,
|
|
19581
19991
|
{
|
|
19582
19992
|
form,
|
|
@@ -19588,13 +19998,13 @@ function WaitlistQuestionnaireRenderer({
|
|
|
19588
19998
|
field.id
|
|
19589
19999
|
);
|
|
19590
20000
|
}
|
|
19591
|
-
return /* @__PURE__ */
|
|
19592
|
-
/* @__PURE__ */
|
|
20001
|
+
return /* @__PURE__ */ jsxs154("div", { className: "space-y-2", children: [
|
|
20002
|
+
/* @__PURE__ */ jsxs154("span", { className: "text-sm font-medium", children: [
|
|
19593
20003
|
field.label,
|
|
19594
|
-
field.required && /* @__PURE__ */
|
|
20004
|
+
field.required && /* @__PURE__ */ jsx241("span", { className: "text-destructive ml-1", children: "*" })
|
|
19595
20005
|
] }),
|
|
19596
|
-
field.description && /* @__PURE__ */
|
|
19597
|
-
/* @__PURE__ */
|
|
20006
|
+
field.description && /* @__PURE__ */ jsx241("p", { className: "text-muted-foreground text-xs", children: field.description }),
|
|
20007
|
+
/* @__PURE__ */ jsx241("div", { className: "space-y-2", children: field.options.map((option) => /* @__PURE__ */ jsx241(
|
|
19598
20008
|
FormCheckbox,
|
|
19599
20009
|
{
|
|
19600
20010
|
form,
|
|
@@ -19613,11 +20023,11 @@ function WaitlistQuestionnaireRenderer({
|
|
|
19613
20023
|
__name(WaitlistQuestionnaireRenderer, "WaitlistQuestionnaireRenderer");
|
|
19614
20024
|
|
|
19615
20025
|
// src/features/waitlist/components/forms/WaitlistForm.tsx
|
|
19616
|
-
import { Fragment as Fragment52, jsx as
|
|
20026
|
+
import { Fragment as Fragment52, jsx as jsx242, jsxs as jsxs155 } from "react/jsx-runtime";
|
|
19617
20027
|
function WaitlistForm({ onSuccess }) {
|
|
19618
|
-
const t =
|
|
19619
|
-
const [isSubmitting, setIsSubmitting] =
|
|
19620
|
-
const [isSuccess, setIsSuccess] =
|
|
20028
|
+
const t = useTranslations104();
|
|
20029
|
+
const [isSubmitting, setIsSubmitting] = useState91(false);
|
|
20030
|
+
const [isSuccess, setIsSuccess] = useState91(false);
|
|
19621
20031
|
const config = getWaitlistConfig();
|
|
19622
20032
|
const questionnaireFields = config.questionnaire ?? [];
|
|
19623
20033
|
const questionnaireSchema = questionnaireFields.reduce(
|
|
@@ -19702,20 +20112,20 @@ function WaitlistForm({ onSuccess }) {
|
|
|
19702
20112
|
}
|
|
19703
20113
|
}, "onSubmit");
|
|
19704
20114
|
if (isSuccess) {
|
|
19705
|
-
return /* @__PURE__ */
|
|
19706
|
-
/* @__PURE__ */
|
|
19707
|
-
/* @__PURE__ */
|
|
19708
|
-
/* @__PURE__ */
|
|
19709
|
-
/* @__PURE__ */
|
|
20115
|
+
return /* @__PURE__ */ jsxs155("div", { className: "space-y-6 text-center", children: [
|
|
20116
|
+
/* @__PURE__ */ jsx242("div", { className: "mx-auto flex h-16 w-16 items-center justify-center rounded-full bg-green-100", children: /* @__PURE__ */ jsx242(CheckCircle, { className: "h-8 w-8 text-green-600" }) }),
|
|
20117
|
+
/* @__PURE__ */ jsxs155("div", { className: "space-y-2", children: [
|
|
20118
|
+
/* @__PURE__ */ jsx242("h3", { className: "text-xl font-semibold", children: t("waitlist.success.title") }),
|
|
20119
|
+
/* @__PURE__ */ jsx242("p", { className: "text-muted-foreground", children: t("waitlist.success.description") })
|
|
19710
20120
|
] }),
|
|
19711
|
-
/* @__PURE__ */
|
|
19712
|
-
/* @__PURE__ */
|
|
19713
|
-
/* @__PURE__ */
|
|
20121
|
+
/* @__PURE__ */ jsxs155("div", { className: "flex items-center justify-center gap-2 text-muted-foreground text-sm", children: [
|
|
20122
|
+
/* @__PURE__ */ jsx242(Mail2, { className: "h-4 w-4" }),
|
|
20123
|
+
/* @__PURE__ */ jsx242("span", { children: t("waitlist.success.hint") })
|
|
19714
20124
|
] })
|
|
19715
20125
|
] });
|
|
19716
20126
|
}
|
|
19717
|
-
return /* @__PURE__ */
|
|
19718
|
-
/* @__PURE__ */
|
|
20127
|
+
return /* @__PURE__ */ jsx242(Form, { ...form, children: /* @__PURE__ */ jsxs155("form", { onSubmit: form.handleSubmit(onSubmit), className: "space-y-4", children: [
|
|
20128
|
+
/* @__PURE__ */ jsx242(
|
|
19719
20129
|
FormInput,
|
|
19720
20130
|
{
|
|
19721
20131
|
isRequired: true,
|
|
@@ -19725,23 +20135,23 @@ function WaitlistForm({ onSuccess }) {
|
|
|
19725
20135
|
placeholder: t("common.fields.email.placeholder")
|
|
19726
20136
|
}
|
|
19727
20137
|
),
|
|
19728
|
-
questionnaireFields.length > 0 && /* @__PURE__ */
|
|
19729
|
-
/* @__PURE__ */
|
|
19730
|
-
/* @__PURE__ */
|
|
20138
|
+
questionnaireFields.length > 0 && /* @__PURE__ */ jsx242(WaitlistQuestionnaireRenderer, { form, fields: questionnaireFields }),
|
|
20139
|
+
/* @__PURE__ */ jsxs155("div", { className: "space-y-4 py-4", children: [
|
|
20140
|
+
/* @__PURE__ */ jsx242(
|
|
19731
20141
|
GdprConsentCheckbox,
|
|
19732
20142
|
{
|
|
19733
20143
|
form,
|
|
19734
20144
|
id: "gdprConsent",
|
|
19735
|
-
label: /* @__PURE__ */
|
|
20145
|
+
label: /* @__PURE__ */ jsxs155(Fragment52, { children: [
|
|
19736
20146
|
t("auth.gdpr.terms_prefix"),
|
|
19737
|
-
/* @__PURE__ */
|
|
20147
|
+
/* @__PURE__ */ jsx242(Link, { href: "/terms", target: "_blank", rel: "noopener", className: "underline", children: t("auth.gdpr.terms_of_service") }),
|
|
19738
20148
|
t("auth.gdpr.and"),
|
|
19739
|
-
/* @__PURE__ */
|
|
20149
|
+
/* @__PURE__ */ jsx242(Link, { href: "/privacy", target: "_blank", rel: "noopener", className: "underline", children: t("auth.gdpr.privacy_policy") })
|
|
19740
20150
|
] }),
|
|
19741
20151
|
required: true
|
|
19742
20152
|
}
|
|
19743
20153
|
),
|
|
19744
|
-
/* @__PURE__ */
|
|
20154
|
+
/* @__PURE__ */ jsx242(
|
|
19745
20155
|
GdprConsentCheckbox,
|
|
19746
20156
|
{
|
|
19747
20157
|
form,
|
|
@@ -19751,58 +20161,58 @@ function WaitlistForm({ onSuccess }) {
|
|
|
19751
20161
|
}
|
|
19752
20162
|
)
|
|
19753
20163
|
] }),
|
|
19754
|
-
/* @__PURE__ */
|
|
20164
|
+
/* @__PURE__ */ jsx242(Button, { type: "submit", className: "w-full", disabled: isSubmitting, children: isSubmitting ? t("common.actions.submitting") : t("waitlist.buttons.join") })
|
|
19755
20165
|
] }) });
|
|
19756
20166
|
}
|
|
19757
20167
|
__name(WaitlistForm, "WaitlistForm");
|
|
19758
20168
|
|
|
19759
20169
|
// src/features/waitlist/components/sections/WaitlistHeroSection.tsx
|
|
19760
20170
|
import { CheckCircle as CheckCircle2 } from "lucide-react";
|
|
19761
|
-
import { jsx as
|
|
20171
|
+
import { jsx as jsx243, jsxs as jsxs156 } from "react/jsx-runtime";
|
|
19762
20172
|
function WaitlistHeroSection() {
|
|
19763
20173
|
const config = getWaitlistConfig();
|
|
19764
|
-
return /* @__PURE__ */
|
|
19765
|
-
/* @__PURE__ */
|
|
19766
|
-
/* @__PURE__ */
|
|
19767
|
-
config.heroTitle && /* @__PURE__ */
|
|
19768
|
-
config.heroSubtitle && /* @__PURE__ */
|
|
19769
|
-
config.heroDescription && /* @__PURE__ */
|
|
20174
|
+
return /* @__PURE__ */ jsx243("section", { className: "relative overflow-hidden py-16 md:py-24", children: /* @__PURE__ */ jsx243("div", { className: "container mx-auto px-4", children: /* @__PURE__ */ jsxs156("div", { className: "grid gap-12 lg:grid-cols-2 lg:items-center", children: [
|
|
20175
|
+
/* @__PURE__ */ jsxs156("div", { className: "space-y-8", children: [
|
|
20176
|
+
/* @__PURE__ */ jsxs156("div", { className: "space-y-4", children: [
|
|
20177
|
+
config.heroTitle && /* @__PURE__ */ jsx243("h1", { className: "text-4xl font-bold tracking-tight md:text-5xl lg:text-6xl", children: config.heroTitle }),
|
|
20178
|
+
config.heroSubtitle && /* @__PURE__ */ jsx243("p", { className: "text-muted-foreground text-xl md:text-2xl", children: config.heroSubtitle }),
|
|
20179
|
+
config.heroDescription && /* @__PURE__ */ jsx243("p", { className: "text-muted-foreground", children: config.heroDescription })
|
|
19770
20180
|
] }),
|
|
19771
|
-
config.benefits && config.benefits.length > 0 && /* @__PURE__ */
|
|
19772
|
-
/* @__PURE__ */
|
|
19773
|
-
/* @__PURE__ */
|
|
20181
|
+
config.benefits && config.benefits.length > 0 && /* @__PURE__ */ jsx243("ul", { className: "space-y-3", children: config.benefits.map((benefit, index) => /* @__PURE__ */ jsxs156("li", { className: "flex items-start gap-3", children: [
|
|
20182
|
+
/* @__PURE__ */ jsx243(CheckCircle2, { className: "text-primary mt-0.5 h-5 w-5 shrink-0" }),
|
|
20183
|
+
/* @__PURE__ */ jsx243("span", { children: benefit })
|
|
19774
20184
|
] }, index)) })
|
|
19775
20185
|
] }),
|
|
19776
|
-
/* @__PURE__ */
|
|
20186
|
+
/* @__PURE__ */ jsx243("div", { className: "lg:pl-8", children: /* @__PURE__ */ jsx243("div", { className: "bg-card rounded-lg border p-6 shadow-lg md:p-8", children: /* @__PURE__ */ jsx243(WaitlistForm, {}) }) })
|
|
19777
20187
|
] }) }) });
|
|
19778
20188
|
}
|
|
19779
20189
|
__name(WaitlistHeroSection, "WaitlistHeroSection");
|
|
19780
20190
|
|
|
19781
20191
|
// src/features/waitlist/components/sections/WaitlistSuccessState.tsx
|
|
19782
20192
|
import { CheckCircle as CheckCircle3 } from "lucide-react";
|
|
19783
|
-
import { useTranslations as
|
|
19784
|
-
import { jsx as
|
|
20193
|
+
import { useTranslations as useTranslations105 } from "next-intl";
|
|
20194
|
+
import { jsx as jsx244, jsxs as jsxs157 } from "react/jsx-runtime";
|
|
19785
20195
|
function WaitlistSuccessState() {
|
|
19786
|
-
const t =
|
|
19787
|
-
return /* @__PURE__ */
|
|
19788
|
-
/* @__PURE__ */
|
|
19789
|
-
/* @__PURE__ */
|
|
19790
|
-
/* @__PURE__ */
|
|
19791
|
-
/* @__PURE__ */
|
|
20196
|
+
const t = useTranslations105();
|
|
20197
|
+
return /* @__PURE__ */ jsxs157("div", { className: "flex flex-col items-center justify-center space-y-4 py-8 text-center", children: [
|
|
20198
|
+
/* @__PURE__ */ jsx244("div", { className: "bg-primary/10 rounded-full p-4", children: /* @__PURE__ */ jsx244(CheckCircle3, { className: "text-primary h-12 w-12" }) }),
|
|
20199
|
+
/* @__PURE__ */ jsx244("h2", { className: "text-2xl font-bold", children: t("waitlist.success.title") }),
|
|
20200
|
+
/* @__PURE__ */ jsx244("p", { className: "text-muted-foreground max-w-md", children: t("waitlist.success.description") }),
|
|
20201
|
+
/* @__PURE__ */ jsx244("p", { className: "text-muted-foreground text-sm", children: t("waitlist.success.hint") })
|
|
19792
20202
|
] });
|
|
19793
20203
|
}
|
|
19794
20204
|
__name(WaitlistSuccessState, "WaitlistSuccessState");
|
|
19795
20205
|
|
|
19796
20206
|
// src/features/waitlist/components/sections/WaitlistConfirmation.tsx
|
|
19797
20207
|
import { CheckCircle as CheckCircle4, Loader2 as Loader27, XCircle as XCircle2 } from "lucide-react";
|
|
19798
|
-
import { useTranslations as
|
|
19799
|
-
import { useEffect as
|
|
19800
|
-
import { jsx as
|
|
20208
|
+
import { useTranslations as useTranslations106 } from "next-intl";
|
|
20209
|
+
import { useEffect as useEffect65, useState as useState92 } from "react";
|
|
20210
|
+
import { jsx as jsx245, jsxs as jsxs158 } from "react/jsx-runtime";
|
|
19801
20211
|
function WaitlistConfirmation({ code }) {
|
|
19802
|
-
const t =
|
|
19803
|
-
const [state, setState] =
|
|
19804
|
-
const [errorMessage, setErrorMessage] =
|
|
19805
|
-
|
|
20212
|
+
const t = useTranslations106();
|
|
20213
|
+
const [state, setState] = useState92("loading");
|
|
20214
|
+
const [errorMessage, setErrorMessage] = useState92("");
|
|
20215
|
+
useEffect65(() => {
|
|
19806
20216
|
async function confirmEmail() {
|
|
19807
20217
|
try {
|
|
19808
20218
|
await WaitlistService.confirm(code);
|
|
@@ -19816,24 +20226,24 @@ function WaitlistConfirmation({ code }) {
|
|
|
19816
20226
|
confirmEmail();
|
|
19817
20227
|
}, [code, t]);
|
|
19818
20228
|
if (state === "loading") {
|
|
19819
|
-
return /* @__PURE__ */
|
|
19820
|
-
/* @__PURE__ */
|
|
19821
|
-
/* @__PURE__ */
|
|
20229
|
+
return /* @__PURE__ */ jsxs158("div", { className: "flex flex-col items-center justify-center space-y-4 py-16 text-center", children: [
|
|
20230
|
+
/* @__PURE__ */ jsx245(Loader27, { className: "text-primary h-12 w-12 animate-spin" }),
|
|
20231
|
+
/* @__PURE__ */ jsx245("p", { className: "text-muted-foreground", children: t("waitlist.confirmation.loading") })
|
|
19822
20232
|
] });
|
|
19823
20233
|
}
|
|
19824
20234
|
if (state === "error") {
|
|
19825
|
-
return /* @__PURE__ */
|
|
19826
|
-
/* @__PURE__ */
|
|
19827
|
-
/* @__PURE__ */
|
|
19828
|
-
/* @__PURE__ */
|
|
19829
|
-
/* @__PURE__ */
|
|
20235
|
+
return /* @__PURE__ */ jsxs158("div", { className: "flex flex-col items-center justify-center space-y-4 py-16 text-center", children: [
|
|
20236
|
+
/* @__PURE__ */ jsx245("div", { className: "bg-destructive/10 rounded-full p-4", children: /* @__PURE__ */ jsx245(XCircle2, { className: "text-destructive h-12 w-12" }) }),
|
|
20237
|
+
/* @__PURE__ */ jsx245("h2", { className: "text-2xl font-bold", children: t("waitlist.confirmation.error_title") }),
|
|
20238
|
+
/* @__PURE__ */ jsx245("p", { className: "text-muted-foreground max-w-md", children: errorMessage }),
|
|
20239
|
+
/* @__PURE__ */ jsx245(Link, { href: "/waitlist", className: buttonVariants({ variant: "outline" }), children: t("waitlist.buttons.return") })
|
|
19830
20240
|
] });
|
|
19831
20241
|
}
|
|
19832
|
-
return /* @__PURE__ */
|
|
19833
|
-
/* @__PURE__ */
|
|
19834
|
-
/* @__PURE__ */
|
|
19835
|
-
/* @__PURE__ */
|
|
19836
|
-
/* @__PURE__ */
|
|
20242
|
+
return /* @__PURE__ */ jsxs158("div", { className: "flex flex-col items-center justify-center space-y-4 py-16 text-center", children: [
|
|
20243
|
+
/* @__PURE__ */ jsx245("div", { className: "bg-primary/10 rounded-full p-4", children: /* @__PURE__ */ jsx245(CheckCircle4, { className: "text-primary h-12 w-12" }) }),
|
|
20244
|
+
/* @__PURE__ */ jsx245("h2", { className: "text-2xl font-bold", children: t("waitlist.confirmation.success_title") }),
|
|
20245
|
+
/* @__PURE__ */ jsx245("p", { className: "text-muted-foreground max-w-md", children: t("waitlist.confirmation.success_description") }),
|
|
20246
|
+
/* @__PURE__ */ jsx245("p", { className: "text-muted-foreground text-sm", children: t("waitlist.confirmation.success_hint") })
|
|
19837
20247
|
] });
|
|
19838
20248
|
}
|
|
19839
20249
|
__name(WaitlistConfirmation, "WaitlistConfirmation");
|
|
@@ -19841,13 +20251,13 @@ __name(WaitlistConfirmation, "WaitlistConfirmation");
|
|
|
19841
20251
|
// src/features/waitlist/components/lists/WaitlistList.tsx
|
|
19842
20252
|
import { flexRender as flexRender2, getCoreRowModel as getCoreRowModel2, useReactTable as useReactTable2 } from "@tanstack/react-table";
|
|
19843
20253
|
import { RefreshCw as RefreshCw4, Users as Users2 } from "lucide-react";
|
|
19844
|
-
import { useTranslations as
|
|
19845
|
-
import { useCallback as useCallback43, useEffect as
|
|
20254
|
+
import { useTranslations as useTranslations108 } from "next-intl";
|
|
20255
|
+
import { useCallback as useCallback43, useEffect as useEffect66, useState as useState93 } from "react";
|
|
19846
20256
|
|
|
19847
20257
|
// src/features/waitlist/hooks/useWaitlistTableStructure.tsx
|
|
19848
20258
|
import { Send } from "lucide-react";
|
|
19849
|
-
import { useTranslations as
|
|
19850
|
-
import { jsx as
|
|
20259
|
+
import { useTranslations as useTranslations107 } from "next-intl";
|
|
20260
|
+
import { jsx as jsx246, jsxs as jsxs159 } from "react/jsx-runtime";
|
|
19851
20261
|
function parseQuestionnaire(questionnaire) {
|
|
19852
20262
|
if (!questionnaire) return null;
|
|
19853
20263
|
try {
|
|
@@ -19860,7 +20270,7 @@ __name(parseQuestionnaire, "parseQuestionnaire");
|
|
|
19860
20270
|
function useWaitlistTableStructure({
|
|
19861
20271
|
onInvite
|
|
19862
20272
|
}) {
|
|
19863
|
-
const t =
|
|
20273
|
+
const t = useTranslations107();
|
|
19864
20274
|
const getStatusBadge = /* @__PURE__ */ __name((status) => {
|
|
19865
20275
|
const variants = {
|
|
19866
20276
|
pending: { variant: "secondary" },
|
|
@@ -19869,13 +20279,13 @@ function useWaitlistTableStructure({
|
|
|
19869
20279
|
registered: { variant: "default" }
|
|
19870
20280
|
};
|
|
19871
20281
|
const config = variants[status];
|
|
19872
|
-
return /* @__PURE__ */
|
|
20282
|
+
return /* @__PURE__ */ jsx246(Badge, { variant: config.variant, children: t(`waitlist.admin.status.${status}`) });
|
|
19873
20283
|
}, "getStatusBadge");
|
|
19874
20284
|
return [
|
|
19875
20285
|
{
|
|
19876
20286
|
accessorKey: "email",
|
|
19877
20287
|
header: t("waitlist.admin.columns.email"),
|
|
19878
|
-
cell: /* @__PURE__ */ __name(({ row }) => /* @__PURE__ */
|
|
20288
|
+
cell: /* @__PURE__ */ __name(({ row }) => /* @__PURE__ */ jsx246("span", { className: "font-medium", children: row.original.email }), "cell")
|
|
19879
20289
|
},
|
|
19880
20290
|
{
|
|
19881
20291
|
accessorKey: "status",
|
|
@@ -19896,17 +20306,17 @@ function useWaitlistTableStructure({
|
|
|
19896
20306
|
cell: /* @__PURE__ */ __name(({ row }) => {
|
|
19897
20307
|
const questionnaire = parseQuestionnaire(row.original.questionnaire);
|
|
19898
20308
|
if (!questionnaire || Object.keys(questionnaire).length === 0) {
|
|
19899
|
-
return /* @__PURE__ */
|
|
20309
|
+
return /* @__PURE__ */ jsx246("span", { className: "text-muted-foreground", children: "-" });
|
|
19900
20310
|
}
|
|
19901
|
-
return /* @__PURE__ */
|
|
19902
|
-
/* @__PURE__ */
|
|
19903
|
-
/* @__PURE__ */
|
|
19904
|
-
/* @__PURE__ */
|
|
20311
|
+
return /* @__PURE__ */ jsxs159("details", { className: "cursor-pointer", children: [
|
|
20312
|
+
/* @__PURE__ */ jsx246("summary", { className: "text-primary text-sm", children: t("waitlist.admin.questionnaire.view_answers") }),
|
|
20313
|
+
/* @__PURE__ */ jsx246("div", { className: "bg-muted mt-2 rounded p-2 text-sm", children: Object.entries(questionnaire).map(([key, value]) => /* @__PURE__ */ jsxs159("div", { className: "mb-1", children: [
|
|
20314
|
+
/* @__PURE__ */ jsxs159("span", { className: "font-medium", children: [
|
|
19905
20315
|
key,
|
|
19906
20316
|
":"
|
|
19907
20317
|
] }),
|
|
19908
20318
|
" ",
|
|
19909
|
-
/* @__PURE__ */
|
|
20319
|
+
/* @__PURE__ */ jsx246("span", { className: "text-muted-foreground", children: Array.isArray(value) ? value.join(", ") : String(value) })
|
|
19910
20320
|
] }, key)) })
|
|
19911
20321
|
] });
|
|
19912
20322
|
}, "cell")
|
|
@@ -19917,18 +20327,18 @@ function useWaitlistTableStructure({
|
|
|
19917
20327
|
cell: /* @__PURE__ */ __name(({ row }) => {
|
|
19918
20328
|
const entry = row.original;
|
|
19919
20329
|
if (entry.status === "confirmed") {
|
|
19920
|
-
return /* @__PURE__ */
|
|
19921
|
-
/* @__PURE__ */
|
|
20330
|
+
return /* @__PURE__ */ jsxs159(Button, { size: "sm", variant: "outline", onClick: () => onInvite(entry), children: [
|
|
20331
|
+
/* @__PURE__ */ jsx246(Send, { className: "mr-2 h-4 w-4" }),
|
|
19922
20332
|
t("waitlist.admin.actions.invite")
|
|
19923
20333
|
] });
|
|
19924
20334
|
}
|
|
19925
20335
|
if (entry.status === "invited" && entry.invitedAt) {
|
|
19926
|
-
return /* @__PURE__ */
|
|
20336
|
+
return /* @__PURE__ */ jsx246("span", { className: "text-muted-foreground text-sm", children: t("waitlist.admin.actions.invited_on", { date: new Date(entry.invitedAt).toLocaleDateString() }) });
|
|
19927
20337
|
}
|
|
19928
20338
|
if (entry.status === "registered") {
|
|
19929
|
-
return /* @__PURE__ */
|
|
20339
|
+
return /* @__PURE__ */ jsx246("span", { className: "text-muted-foreground text-sm", children: t("waitlist.admin.actions.registered") });
|
|
19930
20340
|
}
|
|
19931
|
-
return /* @__PURE__ */
|
|
20341
|
+
return /* @__PURE__ */ jsx246("span", { className: "text-muted-foreground text-sm", children: t("waitlist.admin.actions.awaiting_confirmation") });
|
|
19932
20342
|
}, "cell")
|
|
19933
20343
|
}
|
|
19934
20344
|
];
|
|
@@ -19936,13 +20346,13 @@ function useWaitlistTableStructure({
|
|
|
19936
20346
|
__name(useWaitlistTableStructure, "useWaitlistTableStructure");
|
|
19937
20347
|
|
|
19938
20348
|
// src/features/waitlist/components/lists/WaitlistList.tsx
|
|
19939
|
-
import { jsx as
|
|
20349
|
+
import { jsx as jsx247, jsxs as jsxs160 } from "react/jsx-runtime";
|
|
19940
20350
|
function WaitlistList() {
|
|
19941
|
-
const t =
|
|
19942
|
-
const [entries, setEntries] =
|
|
19943
|
-
const [total, setTotal] =
|
|
19944
|
-
const [isLoading, setIsLoading] =
|
|
19945
|
-
const [statusFilter, setStatusFilter] =
|
|
20351
|
+
const t = useTranslations108();
|
|
20352
|
+
const [entries, setEntries] = useState93([]);
|
|
20353
|
+
const [total, setTotal] = useState93(0);
|
|
20354
|
+
const [isLoading, setIsLoading] = useState93(true);
|
|
20355
|
+
const [statusFilter, setStatusFilter] = useState93("all");
|
|
19946
20356
|
const loadEntries = useCallback43(async () => {
|
|
19947
20357
|
setIsLoading(true);
|
|
19948
20358
|
try {
|
|
@@ -19958,7 +20368,7 @@ function WaitlistList() {
|
|
|
19958
20368
|
setIsLoading(false);
|
|
19959
20369
|
}
|
|
19960
20370
|
}, [statusFilter]);
|
|
19961
|
-
|
|
20371
|
+
useEffect66(() => {
|
|
19962
20372
|
loadEntries();
|
|
19963
20373
|
}, [loadEntries]);
|
|
19964
20374
|
const handleInvite = /* @__PURE__ */ __name(async (entry) => {
|
|
@@ -19976,34 +20386,34 @@ function WaitlistList() {
|
|
|
19976
20386
|
columns,
|
|
19977
20387
|
getCoreRowModel: getCoreRowModel2()
|
|
19978
20388
|
});
|
|
19979
|
-
return /* @__PURE__ */
|
|
19980
|
-
/* @__PURE__ */
|
|
19981
|
-
/* @__PURE__ */
|
|
19982
|
-
/* @__PURE__ */
|
|
19983
|
-
/* @__PURE__ */
|
|
19984
|
-
/* @__PURE__ */
|
|
20389
|
+
return /* @__PURE__ */ jsxs160("div", { className: "space-y-4", children: [
|
|
20390
|
+
/* @__PURE__ */ jsxs160("div", { className: "flex items-center justify-between", children: [
|
|
20391
|
+
/* @__PURE__ */ jsxs160("div", { className: "flex items-center gap-2", children: [
|
|
20392
|
+
/* @__PURE__ */ jsx247(Users2, { className: "h-5 w-5" }),
|
|
20393
|
+
/* @__PURE__ */ jsx247("h2", { className: "text-xl font-semibold", children: t("waitlist.admin.title") }),
|
|
20394
|
+
/* @__PURE__ */ jsxs160("span", { className: "text-muted-foreground", children: [
|
|
19985
20395
|
"(",
|
|
19986
20396
|
t("waitlist.admin.entries_count", { count: total }),
|
|
19987
20397
|
")"
|
|
19988
20398
|
] })
|
|
19989
20399
|
] }),
|
|
19990
|
-
/* @__PURE__ */
|
|
19991
|
-
/* @__PURE__ */
|
|
19992
|
-
/* @__PURE__ */
|
|
19993
|
-
/* @__PURE__ */
|
|
19994
|
-
/* @__PURE__ */
|
|
19995
|
-
/* @__PURE__ */
|
|
19996
|
-
/* @__PURE__ */
|
|
19997
|
-
/* @__PURE__ */
|
|
19998
|
-
/* @__PURE__ */
|
|
20400
|
+
/* @__PURE__ */ jsxs160("div", { className: "flex items-center gap-4", children: [
|
|
20401
|
+
/* @__PURE__ */ jsxs160(Select, { value: statusFilter, onValueChange: (value) => setStatusFilter(value ?? "all"), children: [
|
|
20402
|
+
/* @__PURE__ */ jsx247(SelectTrigger, { className: "w-40", children: /* @__PURE__ */ jsx247(SelectValue, { placeholder: t("waitlist.admin.filter_placeholder") }) }),
|
|
20403
|
+
/* @__PURE__ */ jsxs160(SelectContent, { children: [
|
|
20404
|
+
/* @__PURE__ */ jsx247(SelectItem, { value: "all", children: t("waitlist.admin.all_statuses") }),
|
|
20405
|
+
/* @__PURE__ */ jsx247(SelectItem, { value: "pending", children: t("waitlist.admin.status.pending") }),
|
|
20406
|
+
/* @__PURE__ */ jsx247(SelectItem, { value: "confirmed", children: t("waitlist.admin.status.confirmed") }),
|
|
20407
|
+
/* @__PURE__ */ jsx247(SelectItem, { value: "invited", children: t("waitlist.admin.status.invited") }),
|
|
20408
|
+
/* @__PURE__ */ jsx247(SelectItem, { value: "registered", children: t("waitlist.admin.status.registered") })
|
|
19999
20409
|
] })
|
|
20000
20410
|
] }),
|
|
20001
|
-
/* @__PURE__ */
|
|
20411
|
+
/* @__PURE__ */ jsx247(Button, { variant: "outline", size: "icon", onClick: loadEntries, disabled: isLoading, children: /* @__PURE__ */ jsx247(RefreshCw4, { className: `h-4 w-4 ${isLoading ? "animate-spin" : ""}` }) })
|
|
20002
20412
|
] })
|
|
20003
20413
|
] }),
|
|
20004
|
-
/* @__PURE__ */
|
|
20005
|
-
/* @__PURE__ */
|
|
20006
|
-
/* @__PURE__ */
|
|
20414
|
+
/* @__PURE__ */ jsx247("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxs160(Table, { children: [
|
|
20415
|
+
/* @__PURE__ */ jsx247(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx247(TableRow, { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx247(TableHead, { children: header.isPlaceholder ? null : flexRender2(header.column.columnDef.header, header.getContext()) }, header.id)) }, headerGroup.id)) }),
|
|
20416
|
+
/* @__PURE__ */ jsx247(TableBody, { children: isLoading ? /* @__PURE__ */ jsx247(TableRow, { children: /* @__PURE__ */ jsx247(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: t("waitlist.admin.loading") }) }) : entries.length === 0 ? /* @__PURE__ */ jsx247(TableRow, { children: /* @__PURE__ */ jsx247(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: t("waitlist.admin.empty") }) }) : table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx247(TableRow, { children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx247(TableCell, { children: flexRender2(cell.column.columnDef.cell, cell.getContext()) }, cell.id)) }, row.id)) })
|
|
20007
20417
|
] }) })
|
|
20008
20418
|
] });
|
|
20009
20419
|
}
|
|
@@ -20011,12 +20421,12 @@ __name(WaitlistList, "WaitlistList");
|
|
|
20011
20421
|
|
|
20012
20422
|
// src/features/rbac/components/RbacContainer.tsx
|
|
20013
20423
|
import { Loader2Icon as Loader2Icon3 } from "lucide-react";
|
|
20014
|
-
import { useTranslations as
|
|
20015
|
-
import { memo as memo2, useCallback as useCallback45, useEffect as
|
|
20424
|
+
import { useTranslations as useTranslations110 } from "next-intl";
|
|
20425
|
+
import { memo as memo2, useCallback as useCallback45, useEffect as useEffect68, useMemo as useMemo33, useRef as useRef33, useState as useState95 } from "react";
|
|
20016
20426
|
|
|
20017
20427
|
// src/features/rbac/components/RbacPermissionCell.tsx
|
|
20018
20428
|
import { CheckIcon as CheckIcon9, MinusIcon as MinusIcon2, XIcon as XIcon11 } from "lucide-react";
|
|
20019
|
-
import { jsx as
|
|
20429
|
+
import { jsx as jsx248, jsxs as jsxs161 } from "react/jsx-runtime";
|
|
20020
20430
|
function RbacPermissionCell({
|
|
20021
20431
|
value,
|
|
20022
20432
|
originalValue,
|
|
@@ -20025,7 +20435,7 @@ function RbacPermissionCell({
|
|
|
20025
20435
|
}) {
|
|
20026
20436
|
const isDirty = originalValue !== void 0 && value !== originalValue;
|
|
20027
20437
|
if (isRoleColumn && (value === null || value === void 0)) {
|
|
20028
|
-
return /* @__PURE__ */
|
|
20438
|
+
return /* @__PURE__ */ jsx248(
|
|
20029
20439
|
"div",
|
|
20030
20440
|
{
|
|
20031
20441
|
onClick,
|
|
@@ -20033,12 +20443,12 @@ function RbacPermissionCell({
|
|
|
20033
20443
|
"flex h-8 w-full items-center justify-center rounded px-2 transition-colors hover:bg-muted cursor-pointer",
|
|
20034
20444
|
isDirty && "ring-2 ring-amber-400/50"
|
|
20035
20445
|
),
|
|
20036
|
-
children: /* @__PURE__ */
|
|
20446
|
+
children: /* @__PURE__ */ jsx248(MinusIcon2, { className: "h-3.5 w-3.5 text-muted-foreground" })
|
|
20037
20447
|
}
|
|
20038
20448
|
);
|
|
20039
20449
|
}
|
|
20040
20450
|
if (value === true) {
|
|
20041
|
-
return /* @__PURE__ */
|
|
20451
|
+
return /* @__PURE__ */ jsx248(
|
|
20042
20452
|
"div",
|
|
20043
20453
|
{
|
|
20044
20454
|
onClick,
|
|
@@ -20046,15 +20456,15 @@ function RbacPermissionCell({
|
|
|
20046
20456
|
"flex h-8 w-full items-center justify-center rounded px-2 transition-colors hover:bg-muted cursor-pointer",
|
|
20047
20457
|
isDirty && "ring-2 ring-amber-400/50"
|
|
20048
20458
|
),
|
|
20049
|
-
children: /* @__PURE__ */
|
|
20050
|
-
/* @__PURE__ */
|
|
20051
|
-
/* @__PURE__ */
|
|
20459
|
+
children: /* @__PURE__ */ jsxs161(Badge, { variant: "default", className: "bg-emerald-600 hover:bg-emerald-700 gap-1 text-xs", children: [
|
|
20460
|
+
/* @__PURE__ */ jsx248(CheckIcon9, { className: "h-3 w-3" }),
|
|
20461
|
+
/* @__PURE__ */ jsx248("span", { children: "true" })
|
|
20052
20462
|
] })
|
|
20053
20463
|
}
|
|
20054
20464
|
);
|
|
20055
20465
|
}
|
|
20056
20466
|
if (value === false) {
|
|
20057
|
-
return /* @__PURE__ */
|
|
20467
|
+
return /* @__PURE__ */ jsx248(
|
|
20058
20468
|
"div",
|
|
20059
20469
|
{
|
|
20060
20470
|
onClick,
|
|
@@ -20062,17 +20472,17 @@ function RbacPermissionCell({
|
|
|
20062
20472
|
"flex h-8 w-full items-center justify-center rounded px-2 transition-colors hover:bg-muted cursor-pointer",
|
|
20063
20473
|
isDirty && "ring-2 ring-amber-400/50"
|
|
20064
20474
|
),
|
|
20065
|
-
children: /* @__PURE__ */
|
|
20066
|
-
/* @__PURE__ */
|
|
20067
|
-
/* @__PURE__ */
|
|
20475
|
+
children: /* @__PURE__ */ jsxs161(Badge, { variant: "destructive", className: "gap-1 text-xs", children: [
|
|
20476
|
+
/* @__PURE__ */ jsx248(XIcon11, { className: "h-3 w-3" }),
|
|
20477
|
+
/* @__PURE__ */ jsx248("span", { children: "false" })
|
|
20068
20478
|
] })
|
|
20069
20479
|
}
|
|
20070
20480
|
);
|
|
20071
20481
|
}
|
|
20072
20482
|
const displayValue = typeof value === "string" ? value : String(value);
|
|
20073
20483
|
const truncated = displayValue.length > 20 ? displayValue.substring(0, 18) + "..." : displayValue;
|
|
20074
|
-
return /* @__PURE__ */
|
|
20075
|
-
/* @__PURE__ */
|
|
20484
|
+
return /* @__PURE__ */ jsxs161(Tooltip2, { children: [
|
|
20485
|
+
/* @__PURE__ */ jsx248(
|
|
20076
20486
|
TooltipTrigger,
|
|
20077
20487
|
{
|
|
20078
20488
|
onClick,
|
|
@@ -20080,11 +20490,11 @@ function RbacPermissionCell({
|
|
|
20080
20490
|
"flex h-8 w-full items-center justify-center rounded px-2 transition-colors hover:bg-muted cursor-pointer",
|
|
20081
20491
|
isDirty && "ring-2 ring-amber-400/50"
|
|
20082
20492
|
),
|
|
20083
|
-
render: /* @__PURE__ */
|
|
20084
|
-
children: /* @__PURE__ */
|
|
20493
|
+
render: /* @__PURE__ */ jsx248("div", {}),
|
|
20494
|
+
children: /* @__PURE__ */ jsx248(Badge, { variant: "outline", className: "max-w-full truncate text-xs font-mono", children: truncated })
|
|
20085
20495
|
}
|
|
20086
20496
|
),
|
|
20087
|
-
/* @__PURE__ */
|
|
20497
|
+
/* @__PURE__ */ jsx248(TooltipContent, { side: "top", className: "max-w-xs", children: /* @__PURE__ */ jsx248("p", { className: "font-mono text-xs break-all", children: displayValue }) })
|
|
20088
20498
|
] });
|
|
20089
20499
|
}
|
|
20090
20500
|
__name(RbacPermissionCell, "RbacPermissionCell");
|
|
@@ -20092,9 +20502,9 @@ __name(RbacPermissionCell, "RbacPermissionCell");
|
|
|
20092
20502
|
// src/features/rbac/components/RbacPermissionPicker.tsx
|
|
20093
20503
|
import { Popover as PopoverPrimitive2 } from "@base-ui/react/popover";
|
|
20094
20504
|
import { CheckIcon as CheckIcon10, MinusIcon as MinusIcon3, XIcon as XIcon12 } from "lucide-react";
|
|
20095
|
-
import { useTranslations as
|
|
20096
|
-
import { useCallback as useCallback44, useEffect as
|
|
20097
|
-
import { Fragment as Fragment53, jsx as
|
|
20505
|
+
import { useTranslations as useTranslations109 } from "next-intl";
|
|
20506
|
+
import { useCallback as useCallback44, useEffect as useEffect67, useState as useState94 } from "react";
|
|
20507
|
+
import { Fragment as Fragment53, jsx as jsx249, jsxs as jsxs162 } from "react/jsx-runtime";
|
|
20098
20508
|
function RbacPermissionPicker({
|
|
20099
20509
|
open,
|
|
20100
20510
|
anchor,
|
|
@@ -20105,9 +20515,9 @@ function RbacPermissionPicker({
|
|
|
20105
20515
|
onClear,
|
|
20106
20516
|
onClose
|
|
20107
20517
|
}) {
|
|
20108
|
-
const t =
|
|
20109
|
-
const [customSegment, setCustomSegment] =
|
|
20110
|
-
|
|
20518
|
+
const t = useTranslations109();
|
|
20519
|
+
const [customSegment, setCustomSegment] = useState94("");
|
|
20520
|
+
useEffect67(() => {
|
|
20111
20521
|
if (!open) setCustomSegment("");
|
|
20112
20522
|
}, [open]);
|
|
20113
20523
|
const currentSegments = typeof value === "string" ? value.split("|").filter(Boolean) : [];
|
|
@@ -20127,14 +20537,14 @@ function RbacPermissionPicker({
|
|
|
20127
20537
|
}
|
|
20128
20538
|
setCustomSegment("");
|
|
20129
20539
|
}, [customSegment, currentSegments, onSetValue]);
|
|
20130
|
-
return /* @__PURE__ */
|
|
20540
|
+
return /* @__PURE__ */ jsx249(
|
|
20131
20541
|
PopoverPrimitive2.Root,
|
|
20132
20542
|
{
|
|
20133
20543
|
open,
|
|
20134
20544
|
onOpenChange: (next) => {
|
|
20135
20545
|
if (!next) onClose();
|
|
20136
20546
|
},
|
|
20137
|
-
children: /* @__PURE__ */
|
|
20547
|
+
children: /* @__PURE__ */ jsx249(PopoverPrimitive2.Portal, { children: /* @__PURE__ */ jsx249(
|
|
20138
20548
|
PopoverPrimitive2.Positioner,
|
|
20139
20549
|
{
|
|
20140
20550
|
anchor: anchor ?? void 0,
|
|
@@ -20142,11 +20552,11 @@ function RbacPermissionPicker({
|
|
|
20142
20552
|
align: "center",
|
|
20143
20553
|
sideOffset: 4,
|
|
20144
20554
|
className: "isolate z-50",
|
|
20145
|
-
children: /* @__PURE__ */
|
|
20146
|
-
/* @__PURE__ */
|
|
20147
|
-
/* @__PURE__ */
|
|
20148
|
-
/* @__PURE__ */
|
|
20149
|
-
/* @__PURE__ */
|
|
20555
|
+
children: /* @__PURE__ */ jsxs162(PopoverPrimitive2.Popup, { className: "bg-popover text-popover-foreground ring-foreground/10 z-50 flex w-96 flex-col gap-3 rounded-lg p-3 text-xs shadow-md outline-hidden ring-1 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 duration-100", children: [
|
|
20556
|
+
/* @__PURE__ */ jsxs162("div", { children: [
|
|
20557
|
+
/* @__PURE__ */ jsx249("p", { className: "text-muted-foreground mb-2 text-xs font-medium", children: t("rbac.quick_value") }),
|
|
20558
|
+
/* @__PURE__ */ jsxs162("div", { className: "flex gap-2", children: [
|
|
20559
|
+
/* @__PURE__ */ jsxs162(
|
|
20150
20560
|
Button,
|
|
20151
20561
|
{
|
|
20152
20562
|
size: "sm",
|
|
@@ -20157,12 +20567,12 @@ function RbacPermissionPicker({
|
|
|
20157
20567
|
onClose();
|
|
20158
20568
|
},
|
|
20159
20569
|
children: [
|
|
20160
|
-
/* @__PURE__ */
|
|
20161
|
-
/* @__PURE__ */
|
|
20570
|
+
/* @__PURE__ */ jsx249(CheckIcon10, { className: "h-3 w-3" }),
|
|
20571
|
+
/* @__PURE__ */ jsx249("span", { children: "true" })
|
|
20162
20572
|
]
|
|
20163
20573
|
}
|
|
20164
20574
|
),
|
|
20165
|
-
/* @__PURE__ */
|
|
20575
|
+
/* @__PURE__ */ jsxs162(
|
|
20166
20576
|
Button,
|
|
20167
20577
|
{
|
|
20168
20578
|
size: "sm",
|
|
@@ -20173,16 +20583,16 @@ function RbacPermissionPicker({
|
|
|
20173
20583
|
onClose();
|
|
20174
20584
|
},
|
|
20175
20585
|
children: [
|
|
20176
|
-
/* @__PURE__ */
|
|
20177
|
-
/* @__PURE__ */
|
|
20586
|
+
/* @__PURE__ */ jsx249(XIcon12, { className: "h-3 w-3" }),
|
|
20587
|
+
/* @__PURE__ */ jsx249("span", { children: "false" })
|
|
20178
20588
|
]
|
|
20179
20589
|
}
|
|
20180
20590
|
)
|
|
20181
20591
|
] })
|
|
20182
20592
|
] }),
|
|
20183
|
-
isRoleColumn && onClear && /* @__PURE__ */
|
|
20184
|
-
/* @__PURE__ */
|
|
20185
|
-
/* @__PURE__ */
|
|
20593
|
+
isRoleColumn && onClear && /* @__PURE__ */ jsxs162(Fragment53, { children: [
|
|
20594
|
+
/* @__PURE__ */ jsx249(Separator, {}),
|
|
20595
|
+
/* @__PURE__ */ jsxs162(
|
|
20186
20596
|
Button,
|
|
20187
20597
|
{
|
|
20188
20598
|
size: "sm",
|
|
@@ -20193,34 +20603,34 @@ function RbacPermissionPicker({
|
|
|
20193
20603
|
onClose();
|
|
20194
20604
|
},
|
|
20195
20605
|
children: [
|
|
20196
|
-
/* @__PURE__ */
|
|
20606
|
+
/* @__PURE__ */ jsx249(MinusIcon3, { className: "h-3 w-3" }),
|
|
20197
20607
|
t("rbac.inherit_from_defaults")
|
|
20198
20608
|
]
|
|
20199
20609
|
}
|
|
20200
20610
|
)
|
|
20201
20611
|
] }),
|
|
20202
|
-
/* @__PURE__ */
|
|
20203
|
-
/* @__PURE__ */
|
|
20204
|
-
/* @__PURE__ */
|
|
20205
|
-
knownSegments.length > 0 && /* @__PURE__ */
|
|
20612
|
+
/* @__PURE__ */ jsx249(Separator, {}),
|
|
20613
|
+
/* @__PURE__ */ jsxs162("div", { children: [
|
|
20614
|
+
/* @__PURE__ */ jsx249("p", { className: "text-muted-foreground mb-2 text-xs font-medium", children: t("rbac.relationships") }),
|
|
20615
|
+
knownSegments.length > 0 && /* @__PURE__ */ jsx249("div", { className: "max-h-40 space-y-1 overflow-y-auto", children: knownSegments.map((segment) => /* @__PURE__ */ jsxs162(
|
|
20206
20616
|
"label",
|
|
20207
20617
|
{
|
|
20208
20618
|
className: "hover:bg-muted flex cursor-pointer items-center gap-2 rounded px-1 py-0.5 text-sm",
|
|
20209
20619
|
children: [
|
|
20210
|
-
/* @__PURE__ */
|
|
20620
|
+
/* @__PURE__ */ jsx249(
|
|
20211
20621
|
Checkbox,
|
|
20212
20622
|
{
|
|
20213
20623
|
checked: currentSegments.includes(segment),
|
|
20214
20624
|
onCheckedChange: () => toggleSegment(segment)
|
|
20215
20625
|
}
|
|
20216
20626
|
),
|
|
20217
|
-
/* @__PURE__ */
|
|
20627
|
+
/* @__PURE__ */ jsx249("span", { className: "font-mono text-xs", children: segment })
|
|
20218
20628
|
]
|
|
20219
20629
|
},
|
|
20220
20630
|
segment
|
|
20221
20631
|
)) }),
|
|
20222
|
-
/* @__PURE__ */
|
|
20223
|
-
/* @__PURE__ */
|
|
20632
|
+
/* @__PURE__ */ jsxs162("div", { className: "mt-2 flex gap-1", children: [
|
|
20633
|
+
/* @__PURE__ */ jsx249(
|
|
20224
20634
|
Input,
|
|
20225
20635
|
{
|
|
20226
20636
|
value: customSegment,
|
|
@@ -20235,7 +20645,7 @@ function RbacPermissionPicker({
|
|
|
20235
20645
|
}
|
|
20236
20646
|
}
|
|
20237
20647
|
),
|
|
20238
|
-
/* @__PURE__ */
|
|
20648
|
+
/* @__PURE__ */ jsx249(
|
|
20239
20649
|
Button,
|
|
20240
20650
|
{
|
|
20241
20651
|
size: "sm",
|
|
@@ -20247,9 +20657,9 @@ function RbacPermissionPicker({
|
|
|
20247
20657
|
}
|
|
20248
20658
|
)
|
|
20249
20659
|
] }),
|
|
20250
|
-
currentSegments.length > 0 && /* @__PURE__ */
|
|
20251
|
-
/* @__PURE__ */
|
|
20252
|
-
/* @__PURE__ */
|
|
20660
|
+
currentSegments.length > 0 && /* @__PURE__ */ jsxs162("div", { className: "bg-muted mt-2 rounded p-2", children: [
|
|
20661
|
+
/* @__PURE__ */ jsx249("p", { className: "text-muted-foreground mb-1 text-xs", children: t("rbac.preview") }),
|
|
20662
|
+
/* @__PURE__ */ jsx249("p", { className: "font-mono text-xs break-all", children: currentSegments.join("|") })
|
|
20253
20663
|
] })
|
|
20254
20664
|
] })
|
|
20255
20665
|
] })
|
|
@@ -20261,7 +20671,7 @@ function RbacPermissionPicker({
|
|
|
20261
20671
|
__name(RbacPermissionPicker, "RbacPermissionPicker");
|
|
20262
20672
|
|
|
20263
20673
|
// src/features/rbac/components/RbacContainer.tsx
|
|
20264
|
-
import { jsx as
|
|
20674
|
+
import { jsx as jsx250, jsxs as jsxs163 } from "react/jsx-runtime";
|
|
20265
20675
|
function findToken(tokens, action) {
|
|
20266
20676
|
if (!tokens) return void 0;
|
|
20267
20677
|
return tokens.find((t) => t.action === action);
|
|
@@ -20287,7 +20697,7 @@ var CellButton = memo2(/* @__PURE__ */ __name(function CellButton2({
|
|
|
20287
20697
|
if (!ref.current) return;
|
|
20288
20698
|
onOpen({ moduleId, rowKey, action, isRoleColumn, anchor: ref.current });
|
|
20289
20699
|
}, [onOpen, moduleId, rowKey, action, isRoleColumn]);
|
|
20290
|
-
return /* @__PURE__ */
|
|
20700
|
+
return /* @__PURE__ */ jsx250("div", { ref, children: /* @__PURE__ */ jsx250(RbacPermissionCell, { value, isRoleColumn, onClick: handleClick }) });
|
|
20291
20701
|
}, "CellButton"));
|
|
20292
20702
|
var ACTION_LABELS = {
|
|
20293
20703
|
read: "Read",
|
|
@@ -20303,22 +20713,22 @@ var ModuleEditor = memo2(/* @__PURE__ */ __name(function ModuleEditor2({
|
|
|
20303
20713
|
roleNames,
|
|
20304
20714
|
onOpenPicker
|
|
20305
20715
|
}) {
|
|
20306
|
-
const t =
|
|
20716
|
+
const t = useTranslations110();
|
|
20307
20717
|
const defaultTokens = block.default ?? [];
|
|
20308
|
-
return /* @__PURE__ */
|
|
20309
|
-
/* @__PURE__ */
|
|
20310
|
-
/* @__PURE__ */
|
|
20311
|
-
/* @__PURE__ */
|
|
20718
|
+
return /* @__PURE__ */ jsxs163("div", { className: "rounded-lg border border-accent bg-card", children: [
|
|
20719
|
+
/* @__PURE__ */ jsxs163("div", { className: "flex items-center justify-between border-b px-4 py-2", children: [
|
|
20720
|
+
/* @__PURE__ */ jsx250("h4", { className: "text-sm font-medium", children: moduleLabel }),
|
|
20721
|
+
/* @__PURE__ */ jsx250("span", { className: "font-mono text-[10px] text-muted-foreground", children: moduleId })
|
|
20312
20722
|
] }),
|
|
20313
|
-
/* @__PURE__ */
|
|
20314
|
-
/* @__PURE__ */
|
|
20315
|
-
/* @__PURE__ */
|
|
20316
|
-
ACTION_TYPES.map((action) => /* @__PURE__ */
|
|
20723
|
+
/* @__PURE__ */ jsx250("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs163("table", { className: "w-full text-sm", children: [
|
|
20724
|
+
/* @__PURE__ */ jsx250("thead", { children: /* @__PURE__ */ jsxs163("tr", { className: "border-b bg-muted/50", children: [
|
|
20725
|
+
/* @__PURE__ */ jsx250("th", { className: "w-40 px-4 py-2 text-left text-xs font-medium text-muted-foreground", children: t("rbac.role") }),
|
|
20726
|
+
ACTION_TYPES.map((action) => /* @__PURE__ */ jsx250("th", { className: "min-w-28 px-2 py-2 text-center text-xs font-medium text-muted-foreground", children: ACTION_LABELS[action] }, action))
|
|
20317
20727
|
] }) }),
|
|
20318
|
-
/* @__PURE__ */
|
|
20319
|
-
/* @__PURE__ */
|
|
20320
|
-
/* @__PURE__ */
|
|
20321
|
-
ACTION_TYPES.map((action) => /* @__PURE__ */
|
|
20728
|
+
/* @__PURE__ */ jsxs163("tbody", { children: [
|
|
20729
|
+
/* @__PURE__ */ jsxs163("tr", { className: cn("border-b bg-muted/30"), children: [
|
|
20730
|
+
/* @__PURE__ */ jsx250("td", { className: "px-4 py-1 text-xs font-bold text-muted-foreground", children: t("rbac.defaults") }),
|
|
20731
|
+
ACTION_TYPES.map((action) => /* @__PURE__ */ jsx250("td", { className: "px-2 py-1", children: /* @__PURE__ */ jsx250(
|
|
20322
20732
|
CellButton,
|
|
20323
20733
|
{
|
|
20324
20734
|
moduleId,
|
|
@@ -20333,9 +20743,9 @@ var ModuleEditor = memo2(/* @__PURE__ */ __name(function ModuleEditor2({
|
|
|
20333
20743
|
roleIds.map((roleId) => {
|
|
20334
20744
|
const roleTokens = block[roleId];
|
|
20335
20745
|
const roleLabel = roleNames?.[roleId] ?? roleId;
|
|
20336
|
-
return /* @__PURE__ */
|
|
20337
|
-
/* @__PURE__ */
|
|
20338
|
-
ACTION_TYPES.map((action) => /* @__PURE__ */
|
|
20746
|
+
return /* @__PURE__ */ jsxs163("tr", { className: "border-b last:border-b-0", children: [
|
|
20747
|
+
/* @__PURE__ */ jsx250("td", { className: "px-4 py-1 text-xs font-medium text-muted-foreground", children: roleLabel }),
|
|
20748
|
+
ACTION_TYPES.map((action) => /* @__PURE__ */ jsx250("td", { className: "px-2 py-1", children: /* @__PURE__ */ jsx250(
|
|
20339
20749
|
CellButton,
|
|
20340
20750
|
{
|
|
20341
20751
|
moduleId,
|
|
@@ -20353,10 +20763,10 @@ var ModuleEditor = memo2(/* @__PURE__ */ __name(function ModuleEditor2({
|
|
|
20353
20763
|
] });
|
|
20354
20764
|
}, "ModuleEditor"));
|
|
20355
20765
|
function RbacContainer() {
|
|
20356
|
-
const t =
|
|
20766
|
+
const t = useTranslations110();
|
|
20357
20767
|
const { matrix, modulePaths, loading, error, roleNames, moduleNames, updateCell, clearCell } = useRbacContext();
|
|
20358
|
-
const [selectedModuleId, setSelectedModuleId] =
|
|
20359
|
-
const [activePicker, setActivePicker] =
|
|
20768
|
+
const [selectedModuleId, setSelectedModuleId] = useState95(null);
|
|
20769
|
+
const [activePicker, setActivePicker] = useState95(null);
|
|
20360
20770
|
const openPicker = useCallback45((picker) => {
|
|
20361
20771
|
setActivePicker(picker);
|
|
20362
20772
|
}, []);
|
|
@@ -20367,11 +20777,11 @@ function RbacContainer() {
|
|
|
20367
20777
|
setSelectedModuleId(id);
|
|
20368
20778
|
setActivePicker(null);
|
|
20369
20779
|
}, []);
|
|
20370
|
-
const sortedModuleIds =
|
|
20780
|
+
const sortedModuleIds = useMemo33(() => {
|
|
20371
20781
|
if (!matrix) return [];
|
|
20372
20782
|
return Object.keys(matrix).sort((a, b) => (moduleNames?.[a] ?? a).localeCompare(moduleNames?.[b] ?? b));
|
|
20373
20783
|
}, [matrix, moduleNames]);
|
|
20374
|
-
const roleIds =
|
|
20784
|
+
const roleIds = useMemo33(() => {
|
|
20375
20785
|
if (roleNames) {
|
|
20376
20786
|
return Object.keys(roleNames).sort((a, b) => (roleNames[a] ?? a).localeCompare(roleNames[b] ?? b));
|
|
20377
20787
|
}
|
|
@@ -20384,19 +20794,19 @@ function RbacContainer() {
|
|
|
20384
20794
|
}
|
|
20385
20795
|
return Array.from(set).sort();
|
|
20386
20796
|
}, [matrix, roleNames]);
|
|
20387
|
-
|
|
20797
|
+
useEffect68(() => {
|
|
20388
20798
|
if (!selectedModuleId && sortedModuleIds.length > 0) {
|
|
20389
20799
|
setSelectedModuleId(sortedModuleIds[0]);
|
|
20390
20800
|
}
|
|
20391
20801
|
}, [selectedModuleId, sortedModuleIds]);
|
|
20392
|
-
const activeValue =
|
|
20802
|
+
const activeValue = useMemo33(() => {
|
|
20393
20803
|
if (!activePicker || !matrix) return void 0;
|
|
20394
20804
|
const block = matrix[activePicker.moduleId];
|
|
20395
20805
|
if (!block) return void 0;
|
|
20396
20806
|
const tokens = activePicker.rowKey === "default" ? block.default : block[activePicker.rowKey];
|
|
20397
20807
|
return cellValue(tokens, activePicker.action);
|
|
20398
20808
|
}, [activePicker, matrix]);
|
|
20399
|
-
const activeSegments =
|
|
20809
|
+
const activeSegments = useMemo33(() => {
|
|
20400
20810
|
if (!activePicker) return [];
|
|
20401
20811
|
return modulePaths[activePicker.moduleId] ?? [];
|
|
20402
20812
|
}, [activePicker, modulePaths]);
|
|
@@ -20412,16 +20822,16 @@ function RbacContainer() {
|
|
|
20412
20822
|
clearCell(activePicker.moduleId, activePicker.rowKey, activePicker.action);
|
|
20413
20823
|
}, [activePicker, clearCell]);
|
|
20414
20824
|
if (loading) {
|
|
20415
|
-
return /* @__PURE__ */
|
|
20825
|
+
return /* @__PURE__ */ jsx250(RoundPageContainer, { fullWidth: true, children: /* @__PURE__ */ jsx250("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsx250(Loader2Icon3, { className: "h-8 w-8 animate-spin text-muted-foreground" }) }) });
|
|
20416
20826
|
}
|
|
20417
20827
|
if (error) {
|
|
20418
|
-
return /* @__PURE__ */
|
|
20828
|
+
return /* @__PURE__ */ jsx250(RoundPageContainer, { fullWidth: true, children: /* @__PURE__ */ jsx250("div", { className: "flex h-full items-center justify-center", children: /* @__PURE__ */ jsx250("p", { className: "text-destructive", children: error }) }) });
|
|
20419
20829
|
}
|
|
20420
20830
|
if (!matrix) return null;
|
|
20421
20831
|
const selectedBlock = selectedModuleId ? matrix[selectedModuleId] : void 0;
|
|
20422
|
-
return /* @__PURE__ */
|
|
20423
|
-
/* @__PURE__ */
|
|
20424
|
-
/* @__PURE__ */
|
|
20832
|
+
return /* @__PURE__ */ jsxs163(RoundPageContainer, { fullWidth: true, forceHeader: true, children: [
|
|
20833
|
+
/* @__PURE__ */ jsxs163("div", { className: "flex h-full w-full", children: [
|
|
20834
|
+
/* @__PURE__ */ jsx250("aside", { className: "w-60 shrink-0 overflow-y-auto border-r bg-muted/20", children: /* @__PURE__ */ jsx250("ul", { className: "py-1", children: sortedModuleIds.map((id) => /* @__PURE__ */ jsx250("li", { children: /* @__PURE__ */ jsx250(
|
|
20425
20835
|
"button",
|
|
20426
20836
|
{
|
|
20427
20837
|
type: "button",
|
|
@@ -20435,7 +20845,7 @@ function RbacContainer() {
|
|
|
20435
20845
|
children: moduleNames?.[id] ?? id
|
|
20436
20846
|
}
|
|
20437
20847
|
) }, id)) }) }),
|
|
20438
|
-
/* @__PURE__ */
|
|
20848
|
+
/* @__PURE__ */ jsx250("section", { className: "flex-1 overflow-y-auto p-4", children: selectedModuleId && selectedBlock ? /* @__PURE__ */ jsx250(
|
|
20439
20849
|
ModuleEditor,
|
|
20440
20850
|
{
|
|
20441
20851
|
moduleId: selectedModuleId,
|
|
@@ -20445,9 +20855,9 @@ function RbacContainer() {
|
|
|
20445
20855
|
roleNames,
|
|
20446
20856
|
onOpenPicker: openPicker
|
|
20447
20857
|
}
|
|
20448
|
-
) : /* @__PURE__ */
|
|
20858
|
+
) : /* @__PURE__ */ jsx250("p", { className: "text-muted-foreground text-sm", children: t("rbac.select_module_prompt") }) })
|
|
20449
20859
|
] }),
|
|
20450
|
-
/* @__PURE__ */
|
|
20860
|
+
/* @__PURE__ */ jsx250(
|
|
20451
20861
|
RbacPermissionPicker,
|
|
20452
20862
|
{
|
|
20453
20863
|
open: !!activePicker,
|
|
@@ -20893,6 +21303,7 @@ export {
|
|
|
20893
21303
|
HowToSelector,
|
|
20894
21304
|
AssistantProvider,
|
|
20895
21305
|
useAssistantContext,
|
|
21306
|
+
MessageSourcesPanel,
|
|
20896
21307
|
MessageItem,
|
|
20897
21308
|
MessageList,
|
|
20898
21309
|
AssistantContainer,
|
|
@@ -20968,4 +21379,4 @@ export {
|
|
|
20968
21379
|
useOAuthClients,
|
|
20969
21380
|
useOAuthClient
|
|
20970
21381
|
};
|
|
20971
|
-
//# sourceMappingURL=chunk-
|
|
21382
|
+
//# sourceMappingURL=chunk-NQV5RDCK.mjs.map
|