@carlonicora/nextjs-jsonapi 4.0.5 → 4.0.7
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/{BlockNoteEditor-H6EXQD46.js → BlockNoteEditor-J7EF7BRX.js} +9 -9
- package/dist/{BlockNoteEditor-H6EXQD46.js.map → BlockNoteEditor-J7EF7BRX.js.map} +1 -1
- package/dist/{BlockNoteEditor-L3STMBP2.mjs → BlockNoteEditor-KOHN3SSR.mjs} +2 -2
- package/dist/billing/index.js +335 -335
- package/dist/billing/index.mjs +1 -1
- package/dist/{chunk-3JET3LL7.js → chunk-3M7D6NXU.js} +20 -13
- package/dist/chunk-3M7D6NXU.js.map +1 -0
- package/dist/{chunk-KX2776OK.mjs → chunk-3W3VVX2N.mjs} +322 -315
- package/dist/chunk-3W3VVX2N.mjs.map +1 -0
- package/dist/client/index.js +2 -2
- package/dist/client/index.mjs +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/index.mjs +1 -1
- package/dist/contexts/index.js +2 -2
- package/dist/contexts/index.mjs +1 -1
- package/dist/features/analytics/index.js +88 -88
- package/dist/features/analytics/index.mjs +1 -1
- package/dist/features/help/index.js +31 -31
- package/dist/features/help/index.mjs +1 -1
- package/dist/features/tokenusage/index.js +75 -75
- package/dist/features/tokenusage/index.mjs +1 -1
- package/package.json +1 -1
- package/src/components/navigations/RecentPagesNavigator.tsx +11 -1
- package/src/components/navigations/__tests__/RecentPagesNavigator.spec.tsx +19 -0
- package/src/shadcnui/ui/__tests__/sidebar.session.test.tsx +136 -0
- package/src/shadcnui/ui/sidebar.tsx +21 -13
- package/dist/chunk-3JET3LL7.js.map +0 -1
- package/dist/chunk-KX2776OK.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-L3STMBP2.mjs.map → BlockNoteEditor-KOHN3SSR.mjs.map} +0 -0
|
@@ -3773,26 +3773,28 @@ function SidebarProviderCore({
|
|
|
3773
3773
|
children,
|
|
3774
3774
|
...props
|
|
3775
3775
|
}) {
|
|
3776
|
+
const viewport = React8.useContext(getViewportContext());
|
|
3777
|
+
const hasViewport = viewport !== void 0;
|
|
3776
3778
|
const sessionIsMobile = React8.useMemo(
|
|
3777
|
-
() => session ? mapThenable(session, (s) => s.isMobile) : void 0,
|
|
3778
|
-
[session]
|
|
3779
|
+
() => session && !hasViewport ? mapThenable(session, (s) => s.isMobile) : void 0,
|
|
3780
|
+
[session, hasViewport]
|
|
3779
3781
|
);
|
|
3780
|
-
const isMobile =
|
|
3781
|
-
const isMobileRef = React8.useRef(
|
|
3782
|
+
const isMobile = session ? viewport ?? sessionIsMobile : viewportIsMobile;
|
|
3783
|
+
const isMobileRef = React8.useRef(typeof isMobile === "boolean" ? isMobile : false);
|
|
3782
3784
|
React8.useEffect(() => {
|
|
3783
|
-
if (!
|
|
3784
|
-
isMobileRef.current =
|
|
3785
|
+
if (!(isMobile instanceof Promise)) {
|
|
3786
|
+
isMobileRef.current = isMobile;
|
|
3785
3787
|
return;
|
|
3786
3788
|
}
|
|
3787
3789
|
let cancelled = false;
|
|
3788
|
-
|
|
3790
|
+
isMobile.then((value) => {
|
|
3789
3791
|
if (!cancelled) isMobileRef.current = value;
|
|
3790
3792
|
}).catch(() => {
|
|
3791
3793
|
});
|
|
3792
3794
|
return () => {
|
|
3793
3795
|
cancelled = true;
|
|
3794
3796
|
};
|
|
3795
|
-
}, [
|
|
3797
|
+
}, [isMobile]);
|
|
3796
3798
|
const [openMobile, setOpenMobile] = React8.useState(false);
|
|
3797
3799
|
const [_open, _setOpen] = React8.useState(defaultOpen);
|
|
3798
3800
|
const open = openProp ?? _open;
|
|
@@ -3826,9 +3828,9 @@ function SidebarProviderCore({
|
|
|
3826
3828
|
[setOpenProp, open]
|
|
3827
3829
|
);
|
|
3828
3830
|
const toggleSidebar = React8.useCallback(() => {
|
|
3829
|
-
const mobile =
|
|
3831
|
+
const mobile = typeof isMobile === "boolean" ? isMobile : isMobileRef.current;
|
|
3830
3832
|
return mobile ? setOpenMobile((open2) => !open2) : setOpen((open2) => !open2);
|
|
3831
|
-
}, [
|
|
3833
|
+
}, [isMobile, setOpen, setOpenMobile]);
|
|
3832
3834
|
React8.useEffect(() => {
|
|
3833
3835
|
const handleKeyDown = /* @__PURE__ */ __name((event) => {
|
|
3834
3836
|
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
@@ -10559,7 +10561,7 @@ import { useRef as useRef18 } from "react";
|
|
|
10559
10561
|
import dynamic from "next/dynamic";
|
|
10560
10562
|
import React18 from "react";
|
|
10561
10563
|
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
10562
|
-
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-
|
|
10564
|
+
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-KOHN3SSR.mjs"), {
|
|
10563
10565
|
ssr: false
|
|
10564
10566
|
});
|
|
10565
10567
|
var BlockNoteEditorContainer = React18.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
|
|
@@ -15550,15 +15552,20 @@ import { useAtomValue } from "jotai";
|
|
|
15550
15552
|
import { HistoryIcon } from "lucide-react";
|
|
15551
15553
|
import { useTranslations as useTranslations52 } from "next-intl";
|
|
15552
15554
|
import { usePathname as usePathname3 } from "next/navigation";
|
|
15555
|
+
import { useEffect as useEffect41, useState as useState51 } from "react";
|
|
15553
15556
|
import { jsx as jsx166, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
15554
15557
|
function RecentPagesNavigator() {
|
|
15555
15558
|
const recentPages = useAtomValue(recentPagesAtom);
|
|
15556
15559
|
const t = useTranslations52();
|
|
15557
15560
|
const { isMobile } = useSidebar();
|
|
15558
15561
|
const pathname = usePathname3();
|
|
15562
|
+
const [mounted, setMounted] = useState51(false);
|
|
15563
|
+
useEffect41(() => {
|
|
15564
|
+
setMounted(true);
|
|
15565
|
+
}, []);
|
|
15559
15566
|
const isCurrentPage = /* @__PURE__ */ __name((url) => !!pathname && (pathname === url || pathname.startsWith(`${url}/`)), "isCurrentPage");
|
|
15560
15567
|
const pages = recentPages.filter((page) => !isCurrentPage(page.url));
|
|
15561
|
-
if (pages.length === 0) return null;
|
|
15568
|
+
if (!mounted || pages.length === 0) return null;
|
|
15562
15569
|
return /* @__PURE__ */ jsx166(SidebarMenuItem, { children: /* @__PURE__ */ jsxs91(DropdownMenu, { children: [
|
|
15563
15570
|
/* @__PURE__ */ jsxs91(
|
|
15564
15571
|
DropdownMenuTrigger,
|
|
@@ -15638,14 +15645,14 @@ __name(partitionTabs, "partitionTabs");
|
|
|
15638
15645
|
|
|
15639
15646
|
// src/components/containers/MermaidDiagram.tsx
|
|
15640
15647
|
import { useTheme as useTheme3 } from "next-themes";
|
|
15641
|
-
import { useEffect as
|
|
15648
|
+
import { useEffect as useEffect42, useId as useId4, useState as useState52 } from "react";
|
|
15642
15649
|
import { jsx as jsx168 } from "react/jsx-runtime";
|
|
15643
15650
|
function MermaidDiagram({ chart }) {
|
|
15644
15651
|
const reactId = useId4();
|
|
15645
15652
|
const { resolvedTheme } = useTheme3();
|
|
15646
|
-
const [svg, setSvg] =
|
|
15647
|
-
const [failed, setFailed] =
|
|
15648
|
-
|
|
15653
|
+
const [svg, setSvg] = useState52(void 0);
|
|
15654
|
+
const [failed, setFailed] = useState52(false);
|
|
15655
|
+
useEffect42(() => {
|
|
15649
15656
|
let cancelled = false;
|
|
15650
15657
|
const draw = /* @__PURE__ */ __name(async () => {
|
|
15651
15658
|
try {
|
|
@@ -15707,7 +15714,7 @@ __name(MermaidDiagram, "MermaidDiagram");
|
|
|
15707
15714
|
// src/components/containers/ReactMarkdownContainer.tsx
|
|
15708
15715
|
import { ChevronDown as ChevronDown2, ChevronUp } from "lucide-react";
|
|
15709
15716
|
import { useTranslations as useTranslations53 } from "next-intl";
|
|
15710
|
-
import { useEffect as
|
|
15717
|
+
import { useEffect as useEffect43, useRef as useRef28, useState as useState53 } from "react";
|
|
15711
15718
|
import ReactMarkdown from "react-markdown";
|
|
15712
15719
|
import rehypeSlug from "rehype-slug";
|
|
15713
15720
|
import remarkGfm from "remark-gfm";
|
|
@@ -15730,10 +15737,10 @@ function ReactMarkdownContainer({
|
|
|
15730
15737
|
size = "normal"
|
|
15731
15738
|
}) {
|
|
15732
15739
|
const t = useTranslations53("ui.buttons");
|
|
15733
|
-
const [isExpanded, setIsExpanded] =
|
|
15734
|
-
const [showExpandButton, setShowExpandButton] =
|
|
15740
|
+
const [isExpanded, setIsExpanded] = useState53(false);
|
|
15741
|
+
const [showExpandButton, setShowExpandButton] = useState53(false);
|
|
15735
15742
|
const contentRef = useRef28(null);
|
|
15736
|
-
|
|
15743
|
+
useEffect43(() => {
|
|
15737
15744
|
if (collapsible && contentRef.current && !isExpanded) {
|
|
15738
15745
|
const isOverflowing = contentRef.current.scrollHeight > contentRef.current.clientHeight;
|
|
15739
15746
|
setShowExpandButton(isOverflowing);
|
|
@@ -15955,7 +15962,7 @@ __name(RoundPageContainerTitle, "RoundPageContainerTitle");
|
|
|
15955
15962
|
|
|
15956
15963
|
// src/components/containers/RoundPageContainer.tsx
|
|
15957
15964
|
import { useSearchParams } from "next/navigation";
|
|
15958
|
-
import { Fragment as Fragment25, useCallback as useCallback27, useEffect as
|
|
15965
|
+
import { Fragment as Fragment25, useCallback as useCallback27, useEffect as useEffect44, useMemo as useMemo23, useRef as useRef29, useState as useState54 } from "react";
|
|
15959
15966
|
import { Fragment as Fragment26, jsx as jsx171, jsxs as jsxs95 } from "react/jsx-runtime";
|
|
15960
15967
|
var DETAILS_COOKIE_NAME = "round_page_details_state";
|
|
15961
15968
|
var DETAILS_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
@@ -15995,22 +16002,22 @@ function RoundPageContainer({
|
|
|
15995
16002
|
const headerLeftContent = useHeaderLeftContent();
|
|
15996
16003
|
const headerLogo = useHeaderLogo();
|
|
15997
16004
|
const headerMobileChildren = useHeaderMobileChildren();
|
|
15998
|
-
const [showDetails, setShowDetailsState] =
|
|
15999
|
-
const [showDetailsMobile, setShowDetailsMobile] =
|
|
16005
|
+
const [showDetails, setShowDetailsState] = useState54(defaultDetailsOpen);
|
|
16006
|
+
const [showDetailsMobile, setShowDetailsMobile] = useState54(false);
|
|
16000
16007
|
const isMobile = useIsMobile();
|
|
16001
16008
|
const hasMobileNavigation = useMobileNavigationItems().length > 0;
|
|
16002
16009
|
const hasSidebar = useOptionalSidebar() !== null;
|
|
16003
|
-
const [mounted, setMounted] =
|
|
16004
|
-
|
|
16010
|
+
const [mounted, setMounted] = useState54(false);
|
|
16011
|
+
useEffect44(() => {
|
|
16005
16012
|
const match = document.cookie.split("; ").find((row) => row.startsWith(`${detailsCookieName}=`));
|
|
16006
16013
|
const stored = match?.split("=")[1];
|
|
16007
16014
|
if (stored === "true") setShowDetailsState(true);
|
|
16008
16015
|
else if (stored === "false") setShowDetailsState(false);
|
|
16009
16016
|
}, []);
|
|
16010
|
-
|
|
16017
|
+
useEffect44(() => {
|
|
16011
16018
|
setMounted(true);
|
|
16012
16019
|
}, []);
|
|
16013
|
-
|
|
16020
|
+
useEffect44(() => {
|
|
16014
16021
|
document.documentElement.dataset.scrollMode = scroll;
|
|
16015
16022
|
}, [scroll]);
|
|
16016
16023
|
const isFixed = scroll === "fixed";
|
|
@@ -16030,9 +16037,9 @@ function RoundPageContainer({
|
|
|
16030
16037
|
const section = searchParams.get("section");
|
|
16031
16038
|
const rewriteUrl = useUrlRewriter();
|
|
16032
16039
|
const initialValue = tabs ? (section && tabs.find((i) => tabValue(i) === section) ? section : null) || tabValue(tabs[0]) : void 0;
|
|
16033
|
-
const [activeTab, setActiveTab] =
|
|
16040
|
+
const [activeTab, setActiveTab] = useState54(initialValue);
|
|
16034
16041
|
const previousSection = useRef29(section);
|
|
16035
|
-
|
|
16042
|
+
useEffect44(() => {
|
|
16036
16043
|
if (tabs && section) {
|
|
16037
16044
|
const tab = tabs.find((i) => tabValue(i) === section);
|
|
16038
16045
|
if (tab) {
|
|
@@ -16439,14 +16446,14 @@ function AllowedUsersDetails({ showTitle, content }) {
|
|
|
16439
16446
|
__name(AllowedUsersDetails, "AllowedUsersDetails");
|
|
16440
16447
|
|
|
16441
16448
|
// src/components/editors/BlockNoteEditorMentionHoverCard.tsx
|
|
16442
|
-
import { useCallback as useCallback28, useEffect as
|
|
16449
|
+
import { useCallback as useCallback28, useEffect as useEffect45, useRef as useRef30, useState as useState55 } from "react";
|
|
16443
16450
|
import { createPortal as createPortal3 } from "react-dom";
|
|
16444
16451
|
import { jsx as jsx174 } from "react/jsx-runtime";
|
|
16445
16452
|
function BlockNoteEditorMentionHoverCard({
|
|
16446
16453
|
containerRef,
|
|
16447
16454
|
mentionResolveFn
|
|
16448
16455
|
}) {
|
|
16449
|
-
const [hovered, setHovered] =
|
|
16456
|
+
const [hovered, setHovered] = useState55(null);
|
|
16450
16457
|
const closeTimeoutRef = useRef30(null);
|
|
16451
16458
|
const scheduleClose = useCallback28(() => {
|
|
16452
16459
|
closeTimeoutRef.current = setTimeout(() => setHovered(null), 200);
|
|
@@ -16457,7 +16464,7 @@ function BlockNoteEditorMentionHoverCard({
|
|
|
16457
16464
|
closeTimeoutRef.current = null;
|
|
16458
16465
|
}
|
|
16459
16466
|
}, []);
|
|
16460
|
-
|
|
16467
|
+
useEffect45(() => {
|
|
16461
16468
|
const container = containerRef.current;
|
|
16462
16469
|
if (!container || !mentionResolveFn) return;
|
|
16463
16470
|
const handleMouseOver = /* @__PURE__ */ __name((e) => {
|
|
@@ -16707,13 +16714,13 @@ var BlockNoteViewerContainer = React29.memo(/* @__PURE__ */ __name(function View
|
|
|
16707
16714
|
}, "ViewerContainer"));
|
|
16708
16715
|
|
|
16709
16716
|
// src/components/pages/PageContainerContentDetails.tsx
|
|
16710
|
-
import { useEffect as
|
|
16717
|
+
import { useEffect as useEffect46, useRef as useRef31, useState as useState56 } from "react";
|
|
16711
16718
|
import { jsx as jsx178, jsxs as jsxs99 } from "react/jsx-runtime";
|
|
16712
16719
|
function PageContainerContentDetails({ items, section, module, id }) {
|
|
16713
16720
|
const rewriteUrl = useUrlRewriter();
|
|
16714
|
-
const [isScrolled, setIsScrolled] =
|
|
16721
|
+
const [isScrolled, setIsScrolled] = useState56(false);
|
|
16715
16722
|
const sentinelRef = useRef31(null);
|
|
16716
|
-
|
|
16723
|
+
useEffect46(() => {
|
|
16717
16724
|
const sentinel = sentinelRef.current;
|
|
16718
16725
|
if (!sentinel) return;
|
|
16719
16726
|
const observer = new IntersectionObserver(
|
|
@@ -16746,13 +16753,13 @@ function PageContainerContentDetails({ items, section, module, id }) {
|
|
|
16746
16753
|
__name(PageContainerContentDetails, "PageContainerContentDetails");
|
|
16747
16754
|
|
|
16748
16755
|
// src/components/pages/PageContentContainer.tsx
|
|
16749
|
-
import { useEffect as
|
|
16756
|
+
import { useEffect as useEffect47, useState as useState57 } from "react";
|
|
16750
16757
|
import { useDefaultLayout } from "react-resizable-panels";
|
|
16751
16758
|
import { jsx as jsx179, jsxs as jsxs100 } from "react/jsx-runtime";
|
|
16752
16759
|
function PageContentContainer({ header, details, footer, content, fullBleed }) {
|
|
16753
|
-
const [mounted, setMounted] =
|
|
16760
|
+
const [mounted, setMounted] = useState57(false);
|
|
16754
16761
|
const isMobile = useIsMobile();
|
|
16755
|
-
|
|
16762
|
+
useEffect47(() => {
|
|
16756
16763
|
setMounted(true);
|
|
16757
16764
|
}, []);
|
|
16758
16765
|
const isReady = mounted;
|
|
@@ -16916,10 +16923,10 @@ var cellUrl = /* @__PURE__ */ __name((params) => {
|
|
|
16916
16923
|
}, "cellUrl");
|
|
16917
16924
|
|
|
16918
16925
|
// src/client/context/JsonApiProvider.tsx
|
|
16919
|
-
import { useEffect as
|
|
16926
|
+
import { useEffect as useEffect48, useMemo as useMemo25 } from "react";
|
|
16920
16927
|
import { jsx as jsx185 } from "react/jsx-runtime";
|
|
16921
16928
|
function JsonApiProvider({ config, children }) {
|
|
16922
|
-
|
|
16929
|
+
useEffect48(() => {
|
|
16923
16930
|
if (config.bootstrapper) {
|
|
16924
16931
|
config.bootstrapper();
|
|
16925
16932
|
}
|
|
@@ -16930,12 +16937,12 @@ function JsonApiProvider({ config, children }) {
|
|
|
16930
16937
|
__name(JsonApiProvider, "JsonApiProvider");
|
|
16931
16938
|
|
|
16932
16939
|
// src/client/hooks/useJsonApiGet.ts
|
|
16933
|
-
import { useState as
|
|
16940
|
+
import { useState as useState58, useEffect as useEffect49, useCallback as useCallback30, useRef as useRef32 } from "react";
|
|
16934
16941
|
function useJsonApiGet(params) {
|
|
16935
|
-
const [data, setData] =
|
|
16936
|
-
const [loading, setLoading] =
|
|
16937
|
-
const [error, setError] =
|
|
16938
|
-
const [response, setResponse] =
|
|
16942
|
+
const [data, setData] = useState58(null);
|
|
16943
|
+
const [loading, setLoading] = useState58(false);
|
|
16944
|
+
const [error, setError] = useState58(null);
|
|
16945
|
+
const [response, setResponse] = useState58(null);
|
|
16939
16946
|
const isMounted = useRef32(true);
|
|
16940
16947
|
const fetchData = useCallback30(async () => {
|
|
16941
16948
|
if (params.options?.enabled === false) return;
|
|
@@ -17008,7 +17015,7 @@ function useJsonApiGet(params) {
|
|
|
17008
17015
|
}
|
|
17009
17016
|
}
|
|
17010
17017
|
}, [response]);
|
|
17011
|
-
|
|
17018
|
+
useEffect49(() => {
|
|
17012
17019
|
isMounted.current = true;
|
|
17013
17020
|
fetchData();
|
|
17014
17021
|
return () => {
|
|
@@ -17030,12 +17037,12 @@ function useJsonApiGet(params) {
|
|
|
17030
17037
|
__name(useJsonApiGet, "useJsonApiGet");
|
|
17031
17038
|
|
|
17032
17039
|
// src/client/hooks/useJsonApiMutation.ts
|
|
17033
|
-
import { useState as
|
|
17040
|
+
import { useState as useState59, useCallback as useCallback31 } from "react";
|
|
17034
17041
|
function useJsonApiMutation(config) {
|
|
17035
|
-
const [data, setData] =
|
|
17036
|
-
const [loading, setLoading] =
|
|
17037
|
-
const [error, setError] =
|
|
17038
|
-
const [response, setResponse] =
|
|
17042
|
+
const [data, setData] = useState59(null);
|
|
17043
|
+
const [loading, setLoading] = useState59(false);
|
|
17044
|
+
const [error, setError] = useState59(null);
|
|
17045
|
+
const [response, setResponse] = useState59(null);
|
|
17039
17046
|
const reset = useCallback31(() => {
|
|
17040
17047
|
setData(null);
|
|
17041
17048
|
setLoading(false);
|
|
@@ -17780,7 +17787,7 @@ var useContentTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
17780
17787
|
|
|
17781
17788
|
// src/features/oauth/hooks/useOAuthClients.ts
|
|
17782
17789
|
import { useAtom as useAtom3, useSetAtom } from "jotai";
|
|
17783
|
-
import { useCallback as useCallback32, useEffect as
|
|
17790
|
+
import { useCallback as useCallback32, useEffect as useEffect50 } from "react";
|
|
17784
17791
|
|
|
17785
17792
|
// src/features/oauth/atoms/oauth.atoms.ts
|
|
17786
17793
|
import { atom } from "jotai";
|
|
@@ -17855,7 +17862,7 @@ function useOAuthClients() {
|
|
|
17855
17862
|
setIsLoading(false);
|
|
17856
17863
|
}
|
|
17857
17864
|
}, [setClients, setIsLoading, setError]);
|
|
17858
|
-
|
|
17865
|
+
useEffect50(() => {
|
|
17859
17866
|
fetchClients();
|
|
17860
17867
|
}, [fetchClients]);
|
|
17861
17868
|
const createClient = useCallback32(
|
|
@@ -17895,15 +17902,15 @@ __name(useOAuthClients, "useOAuthClients");
|
|
|
17895
17902
|
|
|
17896
17903
|
// src/features/oauth/hooks/useOAuthClient.ts
|
|
17897
17904
|
import { useAtomValue as useAtomValue2, useSetAtom as useSetAtom2 } from "jotai";
|
|
17898
|
-
import { useCallback as useCallback33, useEffect as
|
|
17905
|
+
import { useCallback as useCallback33, useEffect as useEffect51, useState as useState60 } from "react";
|
|
17899
17906
|
function useOAuthClient(clientId) {
|
|
17900
17907
|
const storedClient = useAtomValue2(oauthClientByIdAtom(clientId));
|
|
17901
17908
|
const updateClientInStore = useSetAtom2(updateOAuthClientAtom);
|
|
17902
17909
|
const removeClientFromStore = useSetAtom2(removeOAuthClientAtom);
|
|
17903
17910
|
const setNewClientSecret = useSetAtom2(setNewClientSecretAtom);
|
|
17904
|
-
const [fetchedClient, setFetchedClient] =
|
|
17905
|
-
const [isLoading, setIsLoading] =
|
|
17906
|
-
const [error, setError] =
|
|
17911
|
+
const [fetchedClient, setFetchedClient] = useState60(null);
|
|
17912
|
+
const [isLoading, setIsLoading] = useState60(false);
|
|
17913
|
+
const [error, setError] = useState60(null);
|
|
17907
17914
|
const client = storedClient || fetchedClient;
|
|
17908
17915
|
const fetchClient = useCallback33(async () => {
|
|
17909
17916
|
if (!clientId) return;
|
|
@@ -17919,7 +17926,7 @@ function useOAuthClient(clientId) {
|
|
|
17919
17926
|
setIsLoading(false);
|
|
17920
17927
|
}
|
|
17921
17928
|
}, [clientId]);
|
|
17922
|
-
|
|
17929
|
+
useEffect51(() => {
|
|
17923
17930
|
if (!storedClient && clientId) {
|
|
17924
17931
|
fetchClient();
|
|
17925
17932
|
}
|
|
@@ -17993,23 +18000,23 @@ function useOAuthClient(clientId) {
|
|
|
17993
18000
|
__name(useOAuthClient, "useOAuthClient");
|
|
17994
18001
|
|
|
17995
18002
|
// src/features/oauth/hooks/useOAuthConsent.ts
|
|
17996
|
-
import { useCallback as useCallback34, useEffect as
|
|
18003
|
+
import { useCallback as useCallback34, useEffect as useEffect52, useState as useState61 } from "react";
|
|
17997
18004
|
function useOAuthConsent(params, options) {
|
|
17998
|
-
const [clientInfo, setClientInfo] =
|
|
17999
|
-
const [isLoading, setIsLoading] =
|
|
18000
|
-
const [error, setError] =
|
|
18001
|
-
const [isSubmitting, setIsSubmitting] =
|
|
18002
|
-
const [companyId, setCompanyId] =
|
|
18005
|
+
const [clientInfo, setClientInfo] = useState61(null);
|
|
18006
|
+
const [isLoading, setIsLoading] = useState61(true);
|
|
18007
|
+
const [error, setError] = useState61(null);
|
|
18008
|
+
const [isSubmitting, setIsSubmitting] = useState61(false);
|
|
18009
|
+
const [companyId, setCompanyId] = useState61(void 0);
|
|
18003
18010
|
const contextCompanyId = useCurrentUserContextOptional()?.company?.id;
|
|
18004
18011
|
const currentCompanyId = options?.defaultCompanyId ?? contextCompanyId;
|
|
18005
|
-
|
|
18012
|
+
useEffect52(() => {
|
|
18006
18013
|
const companies = clientInfo?.companies ?? [];
|
|
18007
18014
|
if (companies.length === 0) return;
|
|
18008
18015
|
if (companyId && companies.some((company) => company.id === companyId)) return;
|
|
18009
18016
|
const current = currentCompanyId ? companies.find((company) => company.id === currentCompanyId) : void 0;
|
|
18010
18017
|
setCompanyId(current?.id ?? companies[0]?.id);
|
|
18011
18018
|
}, [clientInfo, currentCompanyId, companyId]);
|
|
18012
|
-
|
|
18019
|
+
useEffect52(() => {
|
|
18013
18020
|
const fetchInfo = /* @__PURE__ */ __name(async () => {
|
|
18014
18021
|
if (!params.clientId || !params.redirectUri) {
|
|
18015
18022
|
setError(new Error("Missing required authorization parameters"));
|
|
@@ -18090,20 +18097,20 @@ registerTableGenerator("waitlists", useWaitlistTableStructure);
|
|
|
18090
18097
|
import { flexRender, getCoreRowModel, getExpandedRowModel, useReactTable } from "@tanstack/react-table";
|
|
18091
18098
|
import { ChevronLeft, ChevronRight, Loader2 as Loader23 } from "lucide-react";
|
|
18092
18099
|
import { useTranslations as useTranslations62 } from "next-intl";
|
|
18093
|
-
import React31, { memo, useMemo as useMemo34, useState as
|
|
18100
|
+
import React31, { memo, useMemo as useMemo34, useState as useState63 } from "react";
|
|
18094
18101
|
|
|
18095
18102
|
// src/components/tables/ContentTableSearch.tsx
|
|
18096
18103
|
import { RefreshCw, Search, X as X3 } from "lucide-react";
|
|
18097
18104
|
import { useTranslations as useTranslations61 } from "next-intl";
|
|
18098
|
-
import { useCallback as useCallback35, useEffect as
|
|
18105
|
+
import { useCallback as useCallback35, useEffect as useEffect53, useRef as useRef33, useState as useState62 } from "react";
|
|
18099
18106
|
import { jsx as jsx192, jsxs as jsxs104 } from "react/jsx-runtime";
|
|
18100
18107
|
function ContentTableSearch({ data }) {
|
|
18101
18108
|
const t = useTranslations61();
|
|
18102
18109
|
const searchTermRef = useRef33("");
|
|
18103
18110
|
const inputRef = useRef33(null);
|
|
18104
|
-
const [searchTerm, setSearchTerm] =
|
|
18105
|
-
const [isFocused, setIsFocused] =
|
|
18106
|
-
const [isSearching, setIsSearching] =
|
|
18111
|
+
const [searchTerm, setSearchTerm] = useState62("");
|
|
18112
|
+
const [isFocused, setIsFocused] = useState62(false);
|
|
18113
|
+
const [isSearching, setIsSearching] = useState62(false);
|
|
18107
18114
|
const isExpanded = isFocused || searchTerm.length > 0;
|
|
18108
18115
|
const search = useCallback35(
|
|
18109
18116
|
async (searchedTerm) => {
|
|
@@ -18118,7 +18125,7 @@ function ContentTableSearch({ data }) {
|
|
|
18118
18125
|
[searchTermRef, data]
|
|
18119
18126
|
);
|
|
18120
18127
|
const updateSearchTerm = useDebounce2(search, 500);
|
|
18121
|
-
|
|
18128
|
+
useEffect53(() => {
|
|
18122
18129
|
setIsSearching(true);
|
|
18123
18130
|
updateSearchTerm(searchTerm);
|
|
18124
18131
|
}, [updateSearchTerm, searchTerm]);
|
|
@@ -18227,10 +18234,10 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
|
|
|
18227
18234
|
const { data, fields, checkedIds, toggleId, allowSearch, filters: _filters, fullWidth, onRowClick } = props;
|
|
18228
18235
|
const t = useTranslations62();
|
|
18229
18236
|
const isMobile = useIsMobile();
|
|
18230
|
-
const [expanded, setExpanded] =
|
|
18237
|
+
const [expanded, setExpanded] = useState63(
|
|
18231
18238
|
props.defaultExpanded === true ? true : typeof props.defaultExpanded === "object" ? props.defaultExpanded : {}
|
|
18232
18239
|
);
|
|
18233
|
-
const [pendingDirection, setPendingDirection] =
|
|
18240
|
+
const [pendingDirection, setPendingDirection] = useState63(null);
|
|
18234
18241
|
React31.useEffect(() => {
|
|
18235
18242
|
if (data.isLoaded) setPendingDirection(null);
|
|
18236
18243
|
}, [data.isLoaded]);
|
|
@@ -18424,13 +18431,13 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
|
|
|
18424
18431
|
}, "ContentListTable"));
|
|
18425
18432
|
|
|
18426
18433
|
// src/components/grids/ContentListGrid.tsx
|
|
18427
|
-
import { useEffect as
|
|
18434
|
+
import { useEffect as useEffect54, useRef as useRef34 } from "react";
|
|
18428
18435
|
import { Fragment as Fragment31, jsx as jsx194, jsxs as jsxs106 } from "react/jsx-runtime";
|
|
18429
18436
|
var DEFAULT_GRID_CLASSES = "grid grid-cols-2 gap-4 p-4 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5";
|
|
18430
18437
|
function ContentListGrid(props) {
|
|
18431
18438
|
const { data, ItemComponent, allowSearch, fullWidth, gridClassName } = props;
|
|
18432
18439
|
const sentinelRef = useRef34(null);
|
|
18433
|
-
|
|
18440
|
+
useEffect54(() => {
|
|
18434
18441
|
if (!data.next || !sentinelRef.current) return;
|
|
18435
18442
|
const observer = new IntersectionObserver(
|
|
18436
18443
|
(entries) => {
|
|
@@ -18473,15 +18480,15 @@ __name(ContentListGrid, "ContentListGrid");
|
|
|
18473
18480
|
|
|
18474
18481
|
// src/components/fiscal/ItalianFiscalData.tsx
|
|
18475
18482
|
import { useTranslations as useTranslations63 } from "next-intl";
|
|
18476
|
-
import { forwardRef as forwardRef8, useCallback as useCallback36, useImperativeHandle as useImperativeHandle2, useRef as useRef35, useState as
|
|
18483
|
+
import { forwardRef as forwardRef8, useCallback as useCallback36, useImperativeHandle as useImperativeHandle2, useRef as useRef35, useState as useState64 } from "react";
|
|
18477
18484
|
import { z as z4 } from "zod";
|
|
18478
18485
|
import { jsx as jsx195, jsxs as jsxs107 } from "react/jsx-runtime";
|
|
18479
18486
|
var ItalianFiscalData = forwardRef8(/* @__PURE__ */ __name(function ItalianFiscalData2({ initialData }, ref) {
|
|
18480
18487
|
const t = useTranslations63();
|
|
18481
18488
|
const initialRef = useRef35(initialData);
|
|
18482
|
-
const [fiscalData, setFiscalData] =
|
|
18489
|
+
const [fiscalData, setFiscalData] = useState64(initialData);
|
|
18483
18490
|
const fiscalDataRef = useRef35(initialData);
|
|
18484
|
-
const [fiscalErrors, setFiscalErrors] =
|
|
18491
|
+
const [fiscalErrors, setFiscalErrors] = useState64({});
|
|
18485
18492
|
const updateFiscalField = useCallback36((key, value) => {
|
|
18486
18493
|
setFiscalData((prev) => {
|
|
18487
18494
|
const next = { ...prev, [key]: value };
|
|
@@ -18674,7 +18681,7 @@ __name(EntitySection, "EntitySection");
|
|
|
18674
18681
|
import Image8 from "next/image";
|
|
18675
18682
|
|
|
18676
18683
|
// src/features/auth/contexts/AuthContext.tsx
|
|
18677
|
-
import { createContext as createContext28, useContext as useContext28, useMemo as useMemo35, useState as
|
|
18684
|
+
import { createContext as createContext28, useContext as useContext28, useMemo as useMemo35, useState as useState66 } from "react";
|
|
18678
18685
|
|
|
18679
18686
|
// src/features/auth/components/forms/Register.tsx
|
|
18680
18687
|
import { zodResolver as zodResolver5 } from "@hookform/resolvers/zod";
|
|
@@ -18682,7 +18689,7 @@ import { Loader2 as Loader24 } from "lucide-react";
|
|
|
18682
18689
|
import { useTranslations as useTranslations65 } from "next-intl";
|
|
18683
18690
|
import Image7 from "next/image";
|
|
18684
18691
|
import { useSearchParams as useSearchParams2 } from "next/navigation";
|
|
18685
|
-
import { useEffect as
|
|
18692
|
+
import { useEffect as useEffect55, useState as useState65 } from "react";
|
|
18686
18693
|
import { useForm as useForm5 } from "react-hook-form";
|
|
18687
18694
|
import { v4 as v45 } from "uuid";
|
|
18688
18695
|
import { z as z5 } from "zod";
|
|
@@ -18753,14 +18760,14 @@ function Register() {
|
|
|
18753
18760
|
const searchParams = useSearchParams2();
|
|
18754
18761
|
const inviteCode = searchParams.get("invite");
|
|
18755
18762
|
const registrationMode = getRegistrationMode();
|
|
18756
|
-
const [showConfirmation, setShowConfirmation] =
|
|
18757
|
-
const [inviteValidated, setInviteValidated] =
|
|
18758
|
-
const [inviteError, setInviteError] =
|
|
18759
|
-
const [isValidatingInvite, setIsValidatingInvite] =
|
|
18763
|
+
const [showConfirmation, setShowConfirmation] = useState65(false);
|
|
18764
|
+
const [inviteValidated, setInviteValidated] = useState65(false);
|
|
18765
|
+
const [inviteError, setInviteError] = useState65("");
|
|
18766
|
+
const [isValidatingInvite, setIsValidatingInvite] = useState65(
|
|
18760
18767
|
registrationMode === "waitlist" && !!inviteCode
|
|
18761
18768
|
);
|
|
18762
|
-
const [referralCode, setReferralCode2] =
|
|
18763
|
-
|
|
18769
|
+
const [referralCode, setReferralCode2] = useState65(null);
|
|
18770
|
+
useEffect55(() => {
|
|
18764
18771
|
const code = getReferralCode();
|
|
18765
18772
|
setReferralCode2(code);
|
|
18766
18773
|
}, []);
|
|
@@ -18793,7 +18800,7 @@ function Register() {
|
|
|
18793
18800
|
marketingConsent: false
|
|
18794
18801
|
}
|
|
18795
18802
|
});
|
|
18796
|
-
|
|
18803
|
+
useEffect55(() => {
|
|
18797
18804
|
async function validateInvite() {
|
|
18798
18805
|
if (registrationMode !== "waitlist" || !inviteCode) {
|
|
18799
18806
|
return;
|
|
@@ -19030,9 +19037,9 @@ var AuthContextProvider = /* @__PURE__ */ __name(({
|
|
|
19030
19037
|
initialComponentType,
|
|
19031
19038
|
initialParams
|
|
19032
19039
|
}) => {
|
|
19033
|
-
const [componentType, setComponentType] =
|
|
19034
|
-
const [params, setParams] =
|
|
19035
|
-
const [pendingTwoFactor, setPendingTwoFactor] =
|
|
19040
|
+
const [componentType, setComponentType] = useState66(initialComponentType);
|
|
19041
|
+
const [params, setParams] = useState66(initialParams);
|
|
19042
|
+
const [pendingTwoFactor, setPendingTwoFactor] = useState66();
|
|
19036
19043
|
const activeComponent = useMemo35(() => {
|
|
19037
19044
|
if (componentType === void 0) return null;
|
|
19038
19045
|
switch (componentType) {
|
|
@@ -19094,20 +19101,20 @@ __name(InnerAuthContainer, "InnerAuthContainer");
|
|
|
19094
19101
|
// src/features/auth/components/two-factor/TwoFactorSettings.tsx
|
|
19095
19102
|
import { ShieldAlert, ShieldCheck } from "lucide-react";
|
|
19096
19103
|
import { useTranslations as useTranslations72 } from "next-intl";
|
|
19097
|
-
import { useCallback as useCallback37, useEffect as
|
|
19104
|
+
import { useCallback as useCallback37, useEffect as useEffect57, useState as useState74 } from "react";
|
|
19098
19105
|
import { v4 as v48 } from "uuid";
|
|
19099
19106
|
|
|
19100
19107
|
// src/features/auth/components/two-factor/BackupCodesDialog.tsx
|
|
19101
19108
|
import { Copy, Download, RefreshCw as RefreshCw2 } from "lucide-react";
|
|
19102
19109
|
import { useTranslations as useTranslations66 } from "next-intl";
|
|
19103
|
-
import { useState as
|
|
19110
|
+
import { useState as useState67 } from "react";
|
|
19104
19111
|
import { jsx as jsx205, jsxs as jsxs113 } from "react/jsx-runtime";
|
|
19105
19112
|
function BackupCodesDialog({ remainingCodes, onRegenerate, trigger }) {
|
|
19106
19113
|
const t = useTranslations66();
|
|
19107
|
-
const [open, setOpen] =
|
|
19108
|
-
const [codes, setCodes] =
|
|
19109
|
-
const [isLoading, setIsLoading] =
|
|
19110
|
-
const [showCodes, setShowCodes] =
|
|
19114
|
+
const [open, setOpen] = useState67(false);
|
|
19115
|
+
const [codes, setCodes] = useState67([]);
|
|
19116
|
+
const [isLoading, setIsLoading] = useState67(false);
|
|
19117
|
+
const [showCodes, setShowCodes] = useState67(false);
|
|
19111
19118
|
const handleGenerate = /* @__PURE__ */ __name(async () => {
|
|
19112
19119
|
setIsLoading(true);
|
|
19113
19120
|
try {
|
|
@@ -19202,15 +19209,15 @@ __name(BackupCodesDialog, "BackupCodesDialog");
|
|
|
19202
19209
|
|
|
19203
19210
|
// src/features/auth/components/two-factor/DisableTwoFactorDialog.tsx
|
|
19204
19211
|
import { useTranslations as useTranslations67 } from "next-intl";
|
|
19205
|
-
import { useState as
|
|
19212
|
+
import { useState as useState69 } from "react";
|
|
19206
19213
|
|
|
19207
19214
|
// src/features/auth/components/two-factor/TotpInput.tsx
|
|
19208
|
-
import { useEffect as
|
|
19215
|
+
import { useEffect as useEffect56, useRef as useRef36, useState as useState68 } from "react";
|
|
19209
19216
|
import { jsx as jsx206, jsxs as jsxs114 } from "react/jsx-runtime";
|
|
19210
19217
|
function TotpInput({ onComplete, disabled = false, autoFocus = true, error }) {
|
|
19211
|
-
const [digits, setDigits] =
|
|
19218
|
+
const [digits, setDigits] = useState68(["", "", "", "", "", ""]);
|
|
19212
19219
|
const inputRefs = useRef36([]);
|
|
19213
|
-
|
|
19220
|
+
useEffect56(() => {
|
|
19214
19221
|
if (autoFocus && inputRefs.current[0]) {
|
|
19215
19222
|
inputRefs.current[0].focus();
|
|
19216
19223
|
}
|
|
@@ -19272,9 +19279,9 @@ __name(TotpInput, "TotpInput");
|
|
|
19272
19279
|
import { jsx as jsx207, jsxs as jsxs115 } from "react/jsx-runtime";
|
|
19273
19280
|
function DisableTwoFactorDialog({ onSuccess, trigger }) {
|
|
19274
19281
|
const t = useTranslations67();
|
|
19275
|
-
const [open, setOpen] =
|
|
19276
|
-
const [isLoading, setIsLoading] =
|
|
19277
|
-
const [error, setError] =
|
|
19282
|
+
const [open, setOpen] = useState69(false);
|
|
19283
|
+
const [isLoading, setIsLoading] = useState69(false);
|
|
19284
|
+
const [error, setError] = useState69();
|
|
19278
19285
|
const handleVerify = /* @__PURE__ */ __name(async (code) => {
|
|
19279
19286
|
setIsLoading(true);
|
|
19280
19287
|
setError(void 0);
|
|
@@ -19315,15 +19322,15 @@ __name(DisableTwoFactorDialog, "DisableTwoFactorDialog");
|
|
|
19315
19322
|
// src/features/auth/components/two-factor/PasskeyList.tsx
|
|
19316
19323
|
import { Edit, Key, Trash2 } from "lucide-react";
|
|
19317
19324
|
import { useTranslations as useTranslations68 } from "next-intl";
|
|
19318
|
-
import { useState as
|
|
19325
|
+
import { useState as useState70 } from "react";
|
|
19319
19326
|
import { Fragment as Fragment34, jsx as jsx208, jsxs as jsxs116 } from "react/jsx-runtime";
|
|
19320
19327
|
function PasskeyList({ passkeys, onRefresh }) {
|
|
19321
19328
|
const t = useTranslations68();
|
|
19322
19329
|
const locale = useI18nLocale();
|
|
19323
|
-
const [renameDialogOpen, setRenameDialogOpen] =
|
|
19324
|
-
const [selectedPasskey, setSelectedPasskey] =
|
|
19325
|
-
const [newName, setNewName] =
|
|
19326
|
-
const [isLoading, setIsLoading] =
|
|
19330
|
+
const [renameDialogOpen, setRenameDialogOpen] = useState70(false);
|
|
19331
|
+
const [selectedPasskey, setSelectedPasskey] = useState70(null);
|
|
19332
|
+
const [newName, setNewName] = useState70("");
|
|
19333
|
+
const [isLoading, setIsLoading] = useState70(false);
|
|
19327
19334
|
const handleDelete = /* @__PURE__ */ __name(async (passkey) => {
|
|
19328
19335
|
setIsLoading(true);
|
|
19329
19336
|
try {
|
|
@@ -19437,14 +19444,14 @@ __name(PasskeyList, "PasskeyList");
|
|
|
19437
19444
|
// src/features/auth/components/two-factor/PasskeySetupDialog.tsx
|
|
19438
19445
|
import { startRegistration } from "@simplewebauthn/browser";
|
|
19439
19446
|
import { useTranslations as useTranslations69 } from "next-intl";
|
|
19440
|
-
import { useState as
|
|
19447
|
+
import { useState as useState71 } from "react";
|
|
19441
19448
|
import { v4 as v46 } from "uuid";
|
|
19442
19449
|
import { jsx as jsx209, jsxs as jsxs117 } from "react/jsx-runtime";
|
|
19443
19450
|
function PasskeySetupDialog({ open, onOpenChange, onSuccess }) {
|
|
19444
19451
|
const t = useTranslations69();
|
|
19445
19452
|
const { currentUser } = useCurrentUserContext();
|
|
19446
|
-
const [name, setName] =
|
|
19447
|
-
const [isLoading, setIsLoading] =
|
|
19453
|
+
const [name, setName] = useState71("");
|
|
19454
|
+
const [isLoading, setIsLoading] = useState71(false);
|
|
19448
19455
|
const handleRegister = /* @__PURE__ */ __name(async () => {
|
|
19449
19456
|
if (!name.trim()) return;
|
|
19450
19457
|
setIsLoading(true);
|
|
@@ -19508,12 +19515,12 @@ __name(PasskeySetupDialog, "PasskeySetupDialog");
|
|
|
19508
19515
|
// src/features/auth/components/two-factor/TotpAuthenticatorList.tsx
|
|
19509
19516
|
import { Smartphone, Trash2 as Trash22 } from "lucide-react";
|
|
19510
19517
|
import { useTranslations as useTranslations70 } from "next-intl";
|
|
19511
|
-
import { useState as
|
|
19518
|
+
import { useState as useState72 } from "react";
|
|
19512
19519
|
import { jsx as jsx210, jsxs as jsxs118 } from "react/jsx-runtime";
|
|
19513
19520
|
function TotpAuthenticatorList({ authenticators, onDelete }) {
|
|
19514
19521
|
const t = useTranslations70();
|
|
19515
19522
|
const locale = useI18nLocale();
|
|
19516
|
-
const [deletingId, setDeletingId] =
|
|
19523
|
+
const [deletingId, setDeletingId] = useState72(null);
|
|
19517
19524
|
const handleDelete = /* @__PURE__ */ __name(async (id) => {
|
|
19518
19525
|
setDeletingId(id);
|
|
19519
19526
|
try {
|
|
@@ -19584,19 +19591,19 @@ __name(TotpAuthenticatorList, "TotpAuthenticatorList");
|
|
|
19584
19591
|
// src/features/auth/components/two-factor/TotpSetupDialog.tsx
|
|
19585
19592
|
import { useTranslations as useTranslations71 } from "next-intl";
|
|
19586
19593
|
import { QRCodeSVG } from "qrcode.react";
|
|
19587
|
-
import { useState as
|
|
19594
|
+
import { useState as useState73 } from "react";
|
|
19588
19595
|
import { v4 as v47 } from "uuid";
|
|
19589
19596
|
import { jsx as jsx211, jsxs as jsxs119 } from "react/jsx-runtime";
|
|
19590
19597
|
function TotpSetupDialog({ onSuccess, trigger }) {
|
|
19591
19598
|
const t = useTranslations71();
|
|
19592
19599
|
const { currentUser } = useCurrentUserContext();
|
|
19593
|
-
const [open, setOpen] =
|
|
19594
|
-
const [step, setStep] =
|
|
19595
|
-
const [name, setName] =
|
|
19596
|
-
const [qrCodeUri, setQrCodeUri] =
|
|
19597
|
-
const [authenticatorId, setAuthenticatorId] =
|
|
19598
|
-
const [isLoading, setIsLoading] =
|
|
19599
|
-
const [verifyError, setVerifyError] =
|
|
19600
|
+
const [open, setOpen] = useState73(false);
|
|
19601
|
+
const [step, setStep] = useState73("name");
|
|
19602
|
+
const [name, setName] = useState73("");
|
|
19603
|
+
const [qrCodeUri, setQrCodeUri] = useState73("");
|
|
19604
|
+
const [authenticatorId, setAuthenticatorId] = useState73("");
|
|
19605
|
+
const [isLoading, setIsLoading] = useState73(false);
|
|
19606
|
+
const [verifyError, setVerifyError] = useState73();
|
|
19600
19607
|
const handleStartSetup = /* @__PURE__ */ __name(async () => {
|
|
19601
19608
|
if (!name.trim()) return;
|
|
19602
19609
|
setIsLoading(true);
|
|
@@ -19694,12 +19701,12 @@ __name(TotpSetupDialog, "TotpSetupDialog");
|
|
|
19694
19701
|
import { Fragment as Fragment35, jsx as jsx212, jsxs as jsxs120 } from "react/jsx-runtime";
|
|
19695
19702
|
function TwoFactorSettings() {
|
|
19696
19703
|
const t = useTranslations72();
|
|
19697
|
-
const [status, setStatus] =
|
|
19698
|
-
const [authenticators, setAuthenticators] =
|
|
19699
|
-
const [passkeys, setPasskeys] =
|
|
19700
|
-
const [isLoading, setIsLoading] =
|
|
19701
|
-
const [isEnabling, setIsEnabling] =
|
|
19702
|
-
const [passkeyDialogOpen, setPasskeyDialogOpen] =
|
|
19704
|
+
const [status, setStatus] = useState74(null);
|
|
19705
|
+
const [authenticators, setAuthenticators] = useState74([]);
|
|
19706
|
+
const [passkeys, setPasskeys] = useState74([]);
|
|
19707
|
+
const [isLoading, setIsLoading] = useState74(true);
|
|
19708
|
+
const [isEnabling, setIsEnabling] = useState74(false);
|
|
19709
|
+
const [passkeyDialogOpen, setPasskeyDialogOpen] = useState74(false);
|
|
19703
19710
|
const loadStatus = useCallback37(async () => {
|
|
19704
19711
|
try {
|
|
19705
19712
|
const [statusData, authenticatorsList, passkeysList] = await Promise.all([
|
|
@@ -19716,7 +19723,7 @@ function TwoFactorSettings() {
|
|
|
19716
19723
|
setIsLoading(false);
|
|
19717
19724
|
}
|
|
19718
19725
|
}, [t]);
|
|
19719
|
-
|
|
19726
|
+
useEffect57(() => {
|
|
19720
19727
|
loadStatus();
|
|
19721
19728
|
}, [loadStatus]);
|
|
19722
19729
|
const handleRefresh = /* @__PURE__ */ __name(() => {
|
|
@@ -19906,16 +19913,16 @@ __name(LandingComponent, "LandingComponent");
|
|
|
19906
19913
|
import { zodResolver as zodResolver6 } from "@hookform/resolvers/zod";
|
|
19907
19914
|
import { useTranslations as useTranslations74 } from "next-intl";
|
|
19908
19915
|
import Image10 from "next/image";
|
|
19909
|
-
import { useEffect as
|
|
19916
|
+
import { useEffect as useEffect58, useState as useState75 } from "react";
|
|
19910
19917
|
import { useForm as useForm6 } from "react-hook-form";
|
|
19911
19918
|
import { z as z6 } from "zod";
|
|
19912
19919
|
import { Fragment as Fragment37, jsx as jsx216, jsxs as jsxs123 } from "react/jsx-runtime";
|
|
19913
19920
|
function AcceptInvitation() {
|
|
19914
19921
|
const { setComponentType, params, setParams } = useAuthContext();
|
|
19915
|
-
const [showConfirmation, setShowConfirmation] =
|
|
19916
|
-
const [error, setError] =
|
|
19922
|
+
const [showConfirmation, setShowConfirmation] = useState75(false);
|
|
19923
|
+
const [error, setError] = useState75(void 0);
|
|
19917
19924
|
const t = useTranslations74();
|
|
19918
|
-
|
|
19925
|
+
useEffect58(() => {
|
|
19919
19926
|
async function validateCode(code) {
|
|
19920
19927
|
try {
|
|
19921
19928
|
const payload = {
|
|
@@ -20008,14 +20015,14 @@ __name(AcceptInvitation, "AcceptInvitation");
|
|
|
20008
20015
|
// src/features/auth/components/forms/ActivateAccount.tsx
|
|
20009
20016
|
import { useTranslations as useTranslations75 } from "next-intl";
|
|
20010
20017
|
import Image11 from "next/image";
|
|
20011
|
-
import { useEffect as
|
|
20018
|
+
import { useEffect as useEffect59, useState as useState76 } from "react";
|
|
20012
20019
|
import { Fragment as Fragment38, jsx as jsx217, jsxs as jsxs124 } from "react/jsx-runtime";
|
|
20013
20020
|
function ActivateAccount() {
|
|
20014
20021
|
const { setComponentType, params, setParams } = useAuthContext();
|
|
20015
|
-
const [showConfirmation, setShowConfirmation] =
|
|
20016
|
-
const [error, setError] =
|
|
20022
|
+
const [showConfirmation, setShowConfirmation] = useState76(false);
|
|
20023
|
+
const [error, setError] = useState76(void 0);
|
|
20017
20024
|
const t = useTranslations75();
|
|
20018
|
-
|
|
20025
|
+
useEffect59(() => {
|
|
20019
20026
|
async function ActivateAccount2(code) {
|
|
20020
20027
|
try {
|
|
20021
20028
|
const payload = {
|
|
@@ -20056,12 +20063,12 @@ function ActivateAccount() {
|
|
|
20056
20063
|
__name(ActivateAccount, "ActivateAccount");
|
|
20057
20064
|
|
|
20058
20065
|
// src/features/auth/components/forms/Cookies.tsx
|
|
20059
|
-
import { useEffect as
|
|
20066
|
+
import { useEffect as useEffect60, useState as useState77 } from "react";
|
|
20060
20067
|
function Cookies({ dehydratedAuth, page }) {
|
|
20061
20068
|
const { setUser } = useCurrentUserContext();
|
|
20062
20069
|
const router = useI18nRouter();
|
|
20063
|
-
const [hasSaved, setHasSaved] =
|
|
20064
|
-
|
|
20070
|
+
const [hasSaved, setHasSaved] = useState77(false);
|
|
20071
|
+
useEffect60(() => {
|
|
20065
20072
|
if (hasSaved) return;
|
|
20066
20073
|
async function saveTokenOnServer() {
|
|
20067
20074
|
await AuthService.saveToken({ dehydratedAuth });
|
|
@@ -20084,14 +20091,14 @@ __name(Cookies, "Cookies");
|
|
|
20084
20091
|
import { zodResolver as zodResolver7 } from "@hookform/resolvers/zod";
|
|
20085
20092
|
import { useTranslations as useTranslations76 } from "next-intl";
|
|
20086
20093
|
import Image12 from "next/image";
|
|
20087
|
-
import { useState as
|
|
20094
|
+
import { useState as useState78 } from "react";
|
|
20088
20095
|
import { useForm as useForm7 } from "react-hook-form";
|
|
20089
20096
|
import { z as z7 } from "zod";
|
|
20090
20097
|
import { Fragment as Fragment39, jsx as jsx218, jsxs as jsxs125 } from "react/jsx-runtime";
|
|
20091
20098
|
function ForgotPassword() {
|
|
20092
20099
|
const t = useTranslations76();
|
|
20093
20100
|
const { setComponentType } = useAuthContext();
|
|
20094
|
-
const [showConfirmation, setShowConfirmation] =
|
|
20101
|
+
const [showConfirmation, setShowConfirmation] = useState78(false);
|
|
20095
20102
|
const formSchema = z7.object({
|
|
20096
20103
|
email: z7.string().email({
|
|
20097
20104
|
message: t(`common.errors.invalid_email`)
|
|
@@ -20156,7 +20163,7 @@ import { zodResolver as zodResolver8 } from "@hookform/resolvers/zod";
|
|
|
20156
20163
|
import { useTranslations as useTranslations77 } from "next-intl";
|
|
20157
20164
|
import Image13 from "next/image";
|
|
20158
20165
|
import { useRouter, useSearchParams as useSearchParams3 } from "next/navigation";
|
|
20159
|
-
import { useEffect as
|
|
20166
|
+
import { useEffect as useEffect61, useState as useState79 } from "react";
|
|
20160
20167
|
import { useForm as useForm8 } from "react-hook-form";
|
|
20161
20168
|
import { z as z8 } from "zod";
|
|
20162
20169
|
import { Fragment as Fragment40, jsx as jsx219, jsxs as jsxs126 } from "react/jsx-runtime";
|
|
@@ -20169,8 +20176,8 @@ function Login() {
|
|
|
20169
20176
|
const nativeRouter = useRouter();
|
|
20170
20177
|
const searchParams = useSearchParams3();
|
|
20171
20178
|
const callbackUrl = searchParams.get("callbackUrl");
|
|
20172
|
-
const [referralCode, setReferralCode2] =
|
|
20173
|
-
|
|
20179
|
+
const [referralCode, setReferralCode2] = useState79(null);
|
|
20180
|
+
useEffect61(() => {
|
|
20174
20181
|
const cookies = document.cookie.split("; ");
|
|
20175
20182
|
for (const cookie of cookies) {
|
|
20176
20183
|
const [name, value] = cookie.split("=");
|
|
@@ -20289,7 +20296,7 @@ function Login() {
|
|
|
20289
20296
|
__name(Login, "Login");
|
|
20290
20297
|
|
|
20291
20298
|
// src/features/auth/components/forms/Logout.tsx
|
|
20292
|
-
import { useEffect as
|
|
20299
|
+
import { useEffect as useEffect62 } from "react";
|
|
20293
20300
|
|
|
20294
20301
|
// src/features/auth/utils/clearClientStorage.ts
|
|
20295
20302
|
function clearClientStorage(keys) {
|
|
@@ -20304,7 +20311,7 @@ __name(clearClientStorage, "clearClientStorage");
|
|
|
20304
20311
|
import { Fragment as Fragment41, jsx as jsx220 } from "react/jsx-runtime";
|
|
20305
20312
|
function Logout({ storageKeys }) {
|
|
20306
20313
|
const generateUrl = usePageUrlGenerator();
|
|
20307
|
-
|
|
20314
|
+
useEffect62(() => {
|
|
20308
20315
|
const logOut = /* @__PURE__ */ __name(async () => {
|
|
20309
20316
|
clearClientStorage([CURRENT_USER_STORAGE_KEY, ...storageKeys ?? []]);
|
|
20310
20317
|
await AuthService.logout();
|
|
@@ -20318,7 +20325,7 @@ __name(Logout, "Logout");
|
|
|
20318
20325
|
|
|
20319
20326
|
// src/features/auth/components/forms/RefreshUser.tsx
|
|
20320
20327
|
import { deleteCookie, getCookie as getCookie2 } from "cookies-next";
|
|
20321
|
-
import { useEffect as
|
|
20328
|
+
import { useEffect as useEffect63 } from "react";
|
|
20322
20329
|
function RefreshUser() {
|
|
20323
20330
|
const { setUser } = useCurrentUserContext();
|
|
20324
20331
|
const loadFullUser = /* @__PURE__ */ __name(async () => {
|
|
@@ -20338,7 +20345,7 @@ function RefreshUser() {
|
|
|
20338
20345
|
deleteCookie("reloadData");
|
|
20339
20346
|
}
|
|
20340
20347
|
}, "loadFullUser");
|
|
20341
|
-
|
|
20348
|
+
useEffect63(() => {
|
|
20342
20349
|
const reloadData = getCookie2("reloadData");
|
|
20343
20350
|
if (reloadData !== void 0) loadFullUser();
|
|
20344
20351
|
}, []);
|
|
@@ -20350,16 +20357,16 @@ __name(RefreshUser, "RefreshUser");
|
|
|
20350
20357
|
import { zodResolver as zodResolver9 } from "@hookform/resolvers/zod";
|
|
20351
20358
|
import { useTranslations as useTranslations78 } from "next-intl";
|
|
20352
20359
|
import Image14 from "next/image";
|
|
20353
|
-
import { useEffect as
|
|
20360
|
+
import { useEffect as useEffect64, useState as useState80 } from "react";
|
|
20354
20361
|
import { useForm as useForm9 } from "react-hook-form";
|
|
20355
20362
|
import { z as z9 } from "zod";
|
|
20356
20363
|
import { Fragment as Fragment42, jsx as jsx221, jsxs as jsxs127 } from "react/jsx-runtime";
|
|
20357
20364
|
function ResetPassword() {
|
|
20358
20365
|
const { setComponentType, params, setParams } = useAuthContext();
|
|
20359
|
-
const [showConfirmation, setShowConfirmation] =
|
|
20360
|
-
const [error, setError] =
|
|
20366
|
+
const [showConfirmation, setShowConfirmation] = useState80(false);
|
|
20367
|
+
const [error, setError] = useState80(void 0);
|
|
20361
20368
|
const t = useTranslations78();
|
|
20362
|
-
|
|
20369
|
+
useEffect64(() => {
|
|
20363
20370
|
async function validateResetPasswordCode(code) {
|
|
20364
20371
|
try {
|
|
20365
20372
|
const payload = {
|
|
@@ -20436,18 +20443,18 @@ __name(ResetPassword, "ResetPassword");
|
|
|
20436
20443
|
// src/features/auth/components/forms/TwoFactorChallenge.tsx
|
|
20437
20444
|
import { useTranslations as useTranslations80 } from "next-intl";
|
|
20438
20445
|
import { useRouter as useRouter2, useSearchParams as useSearchParams4 } from "next/navigation";
|
|
20439
|
-
import { useState as
|
|
20446
|
+
import { useState as useState82 } from "react";
|
|
20440
20447
|
import { v4 as v410 } from "uuid";
|
|
20441
20448
|
|
|
20442
20449
|
// src/features/auth/components/two-factor/PasskeyButton.tsx
|
|
20443
20450
|
import { startAuthentication } from "@simplewebauthn/browser";
|
|
20444
20451
|
import { useTranslations as useTranslations79 } from "next-intl";
|
|
20445
|
-
import { useState as
|
|
20452
|
+
import { useState as useState81 } from "react";
|
|
20446
20453
|
import { v4 as v49 } from "uuid";
|
|
20447
20454
|
import { jsx as jsx222 } from "react/jsx-runtime";
|
|
20448
20455
|
function PasskeyButton({ pendingToken, onSuccess, onError, disabled = false }) {
|
|
20449
20456
|
const t = useTranslations79();
|
|
20450
|
-
const [isLoading, setIsLoading] =
|
|
20457
|
+
const [isLoading, setIsLoading] = useState81(false);
|
|
20451
20458
|
const handleClick = /* @__PURE__ */ __name(async () => {
|
|
20452
20459
|
setIsLoading(true);
|
|
20453
20460
|
try {
|
|
@@ -20492,10 +20499,10 @@ function TwoFactorChallenge() {
|
|
|
20492
20499
|
const nativeRouter = useRouter2();
|
|
20493
20500
|
const searchParams = useSearchParams4();
|
|
20494
20501
|
const callbackUrl = searchParams.get("callbackUrl");
|
|
20495
|
-
const [isVerifying, setIsVerifying] =
|
|
20496
|
-
const [totpError, setTotpError] =
|
|
20497
|
-
const [backupCode, setBackupCode] =
|
|
20498
|
-
const [backupError, setBackupError] =
|
|
20502
|
+
const [isVerifying, setIsVerifying] = useState82(false);
|
|
20503
|
+
const [totpError, setTotpError] = useState82();
|
|
20504
|
+
const [backupCode, setBackupCode] = useState82("");
|
|
20505
|
+
const [backupError, setBackupError] = useState82();
|
|
20499
20506
|
if (!pendingTwoFactor) {
|
|
20500
20507
|
return null;
|
|
20501
20508
|
}
|
|
@@ -20790,7 +20797,7 @@ var AI_CONNECTIONS_I18N_KEYS = [
|
|
|
20790
20797
|
|
|
20791
20798
|
// src/features/ai-connection/contexts/AiConnectionsContext.tsx
|
|
20792
20799
|
import { useTranslations as useTranslations82 } from "next-intl";
|
|
20793
|
-
import { createContext as createContext29, useCallback as useCallback38, useContext as useContext29, useEffect as
|
|
20800
|
+
import { createContext as createContext29, useCallback as useCallback38, useContext as useContext29, useEffect as useEffect65, useMemo as useMemo36, useState as useState83 } from "react";
|
|
20794
20801
|
import { jsx as jsx225 } from "react/jsx-runtime";
|
|
20795
20802
|
var AI_CONNECTIONS_ADMIN_PAGE_URL = "/administration/ai-connections";
|
|
20796
20803
|
var defaultContextValue3 = {
|
|
@@ -20808,11 +20815,11 @@ var AiConnectionsContext = createContext29(void 0);
|
|
|
20808
20815
|
var AiConnectionsProvider = /* @__PURE__ */ __name(({ children }) => {
|
|
20809
20816
|
const t = useTranslations82();
|
|
20810
20817
|
const generateUrl = usePageUrlGenerator();
|
|
20811
|
-
const [connections, setConnections] =
|
|
20812
|
-
const [providerRegistry, setProviderRegistry] =
|
|
20813
|
-
const [envDefaults, setEnvDefaults] =
|
|
20814
|
-
const [scopeCompanyId, setScopeCompanyId] =
|
|
20815
|
-
const [isLoading, setIsLoading] =
|
|
20818
|
+
const [connections, setConnections] = useState83([]);
|
|
20819
|
+
const [providerRegistry, setProviderRegistry] = useState83({});
|
|
20820
|
+
const [envDefaults, setEnvDefaults] = useState83({});
|
|
20821
|
+
const [scopeCompanyId, setScopeCompanyId] = useState83(null);
|
|
20822
|
+
const [isLoading, setIsLoading] = useState83(true);
|
|
20816
20823
|
const refresh = useCallback38(async () => {
|
|
20817
20824
|
setIsLoading(true);
|
|
20818
20825
|
try {
|
|
@@ -20824,7 +20831,7 @@ var AiConnectionsProvider = /* @__PURE__ */ __name(({ children }) => {
|
|
|
20824
20831
|
setIsLoading(false);
|
|
20825
20832
|
}
|
|
20826
20833
|
}, []);
|
|
20827
|
-
|
|
20834
|
+
useEffect65(() => {
|
|
20828
20835
|
void refresh();
|
|
20829
20836
|
}, [refresh]);
|
|
20830
20837
|
const value = useMemo36(
|
|
@@ -20851,7 +20858,7 @@ var useAiConnections = /* @__PURE__ */ __name(() => useContext29(AiConnectionsCo
|
|
|
20851
20858
|
|
|
20852
20859
|
// src/features/ai-connection/components/containers/AiConnectionsContainer.tsx
|
|
20853
20860
|
import { useTranslations as useTranslations86 } from "next-intl";
|
|
20854
|
-
import { useEffect as
|
|
20861
|
+
import { useEffect as useEffect67, useMemo as useMemo39, useState as useState85 } from "react";
|
|
20855
20862
|
|
|
20856
20863
|
// src/features/ai-connection/components/lists/AiConnectionTypeCard.tsx
|
|
20857
20864
|
import { ChevronDownIcon as ChevronDownIcon10, ChevronUpIcon as ChevronUpIcon3, PlusIcon as PlusIcon2 } from "lucide-react";
|
|
@@ -20861,12 +20868,12 @@ import { useMemo as useMemo38 } from "react";
|
|
|
20861
20868
|
// src/features/ai-connection/components/forms/AiConnectionDeleter.tsx
|
|
20862
20869
|
import { TrashIcon } from "lucide-react";
|
|
20863
20870
|
import { useTranslations as useTranslations83 } from "next-intl";
|
|
20864
|
-
import { useState as
|
|
20871
|
+
import { useState as useState84 } from "react";
|
|
20865
20872
|
import { Fragment as Fragment44, jsx as jsx226, jsxs as jsxs130 } from "react/jsx-runtime";
|
|
20866
20873
|
function AiConnectionDeleter({ connection }) {
|
|
20867
20874
|
const t = useTranslations83();
|
|
20868
20875
|
const { refresh } = useAiConnections();
|
|
20869
|
-
const [open, setOpen] =
|
|
20876
|
+
const [open, setOpen] = useState84(false);
|
|
20870
20877
|
return /* @__PURE__ */ jsxs130(Fragment44, { children: [
|
|
20871
20878
|
/* @__PURE__ */ jsx226(
|
|
20872
20879
|
Button,
|
|
@@ -20907,7 +20914,7 @@ __name(AiConnectionDeleter, "AiConnectionDeleter");
|
|
|
20907
20914
|
// src/features/ai-connection/components/forms/AiConnectionEditor.tsx
|
|
20908
20915
|
import { zodResolver as zodResolver10 } from "@hookform/resolvers/zod";
|
|
20909
20916
|
import { useTranslations as useTranslations84 } from "next-intl";
|
|
20910
|
-
import { useCallback as useCallback39, useEffect as
|
|
20917
|
+
import { useCallback as useCallback39, useEffect as useEffect66, useMemo as useMemo37 } from "react";
|
|
20911
20918
|
import { useForm as useForm10 } from "react-hook-form";
|
|
20912
20919
|
import { v4 as v411 } from "uuid";
|
|
20913
20920
|
import { z as z10 } from "zod";
|
|
@@ -21004,7 +21011,7 @@ function AiConnectionEditor({
|
|
|
21004
21011
|
resolver: zodResolver10(formSchema),
|
|
21005
21012
|
defaultValues: getDefaultValues()
|
|
21006
21013
|
});
|
|
21007
|
-
|
|
21014
|
+
useEffect66(() => {
|
|
21008
21015
|
if (registryRows.length === 0) return;
|
|
21009
21016
|
const currentProvider = form.getValues("provider");
|
|
21010
21017
|
const provider = currentProvider || connection?.provider || providers[0] || "";
|
|
@@ -21345,8 +21352,8 @@ __name(AiConnectionsContainer, "AiConnectionsContainer");
|
|
|
21345
21352
|
function AiConnectionsBody() {
|
|
21346
21353
|
const t = useTranslations86();
|
|
21347
21354
|
const { scopeCompanyId, setScopeCompanyId } = useAiConnections();
|
|
21348
|
-
const [companies, setCompanies] =
|
|
21349
|
-
|
|
21355
|
+
const [companies, setCompanies] = useState85([]);
|
|
21356
|
+
useEffect67(() => {
|
|
21350
21357
|
let active = true;
|
|
21351
21358
|
CompanyService.findMany({}).then((response) => {
|
|
21352
21359
|
if (active) setCompanies(response ?? []);
|
|
@@ -21463,7 +21470,7 @@ __name(RelevantContentsList, "RelevantContentsList");
|
|
|
21463
21470
|
// src/features/how-to/components/containers/HowToCommand.tsx
|
|
21464
21471
|
import { ArrowRight, LifeBuoyIcon } from "lucide-react";
|
|
21465
21472
|
import { useTranslations as useTranslations91 } from "next-intl";
|
|
21466
|
-
import { useCallback as useCallback40, useEffect as
|
|
21473
|
+
import { useCallback as useCallback40, useEffect as useEffect68, useMemo as useMemo41, useRef as useRef37, useState as useState86 } from "react";
|
|
21467
21474
|
|
|
21468
21475
|
// src/features/how-to/components/containers/HowToCommandViewer.tsx
|
|
21469
21476
|
import { ArrowLeft, BookOpen, MessageSquare } from "lucide-react";
|
|
@@ -21589,10 +21596,10 @@ function matchPage(pathname, pattern) {
|
|
|
21589
21596
|
__name(matchPage, "matchPage");
|
|
21590
21597
|
function HowToCommand({ pathname, contextKeys, extraGroups, onStartChat }) {
|
|
21591
21598
|
const t = useTranslations91();
|
|
21592
|
-
const [dialogOpen, setDialogOpen] =
|
|
21593
|
-
const [selectedHowTo, setSelectedHowTo] =
|
|
21599
|
+
const [dialogOpen, setDialogOpen] = useState86(false);
|
|
21600
|
+
const [selectedHowTo, setSelectedHowTo] = useState86(null);
|
|
21594
21601
|
const searchTermRef = useRef37("");
|
|
21595
|
-
const [searchTerm, setSearchTerm] =
|
|
21602
|
+
const [searchTerm, setSearchTerm] = useState86("");
|
|
21596
21603
|
const data = useDataListRetriever({
|
|
21597
21604
|
retriever: /* @__PURE__ */ __name((params) => {
|
|
21598
21605
|
return HowToService.findMany(params);
|
|
@@ -21623,16 +21630,16 @@ function HowToCommand({ pathname, contextKeys, extraGroups, onStartChat }) {
|
|
|
21623
21630
|
[searchTermRef, data]
|
|
21624
21631
|
);
|
|
21625
21632
|
const updateSearchTerm = useDebounce2(search, 500);
|
|
21626
|
-
|
|
21633
|
+
useEffect68(() => {
|
|
21627
21634
|
updateSearchTerm(searchTerm);
|
|
21628
21635
|
}, [updateSearchTerm, searchTerm]);
|
|
21629
|
-
|
|
21636
|
+
useEffect68(() => {
|
|
21630
21637
|
if (!dialogOpen) {
|
|
21631
21638
|
setSearchTerm("");
|
|
21632
21639
|
searchTermRef.current = "";
|
|
21633
21640
|
}
|
|
21634
21641
|
}, [dialogOpen]);
|
|
21635
|
-
|
|
21642
|
+
useEffect68(() => {
|
|
21636
21643
|
const down = /* @__PURE__ */ __name((e) => {
|
|
21637
21644
|
if (e.key === "k" && (e.metaKey || e.ctrlKey)) {
|
|
21638
21645
|
e.preventDefault();
|
|
@@ -21864,11 +21871,11 @@ registerTableGenerator("howtos", useHowToTableStructure);
|
|
|
21864
21871
|
|
|
21865
21872
|
// src/features/how-to/components/forms/HowToReindexButton.tsx
|
|
21866
21873
|
import { useTranslations as useTranslations94 } from "next-intl";
|
|
21867
|
-
import { useState as
|
|
21874
|
+
import { useState as useState87 } from "react";
|
|
21868
21875
|
import { jsx as jsx239 } from "react/jsx-runtime";
|
|
21869
21876
|
function HowToReindexButton({ refresh }) {
|
|
21870
21877
|
const t = useTranslations94();
|
|
21871
|
-
const [isReindexing, setIsReindexing] =
|
|
21878
|
+
const [isReindexing, setIsReindexing] = useState87(false);
|
|
21872
21879
|
const onReindex = /* @__PURE__ */ __name(async () => {
|
|
21873
21880
|
setIsReindexing(true);
|
|
21874
21881
|
try {
|
|
@@ -21927,7 +21934,7 @@ __name(HowToListContainer, "HowToListContainer");
|
|
|
21927
21934
|
// src/features/how-to/components/forms/HowToSelector.tsx
|
|
21928
21935
|
import { CircleX as CircleX3, RefreshCwIcon as RefreshCwIcon4, SearchIcon as SearchIcon7, XIcon as XIcon11 } from "lucide-react";
|
|
21929
21936
|
import { useTranslations as useTranslations96 } from "next-intl";
|
|
21930
|
-
import { useCallback as useCallback41, useEffect as
|
|
21937
|
+
import { useCallback as useCallback41, useEffect as useEffect69, useRef as useRef38, useState as useState88 } from "react";
|
|
21931
21938
|
import { Fragment as Fragment48, jsx as jsx242, jsxs as jsxs138 } from "react/jsx-runtime";
|
|
21932
21939
|
function HowToSelector({
|
|
21933
21940
|
id,
|
|
@@ -21938,10 +21945,10 @@ function HowToSelector({
|
|
|
21938
21945
|
isRequired = false
|
|
21939
21946
|
}) {
|
|
21940
21947
|
const t = useTranslations96();
|
|
21941
|
-
const [open, setOpen] =
|
|
21948
|
+
const [open, setOpen] = useState88(false);
|
|
21942
21949
|
const searchTermRef = useRef38("");
|
|
21943
|
-
const [searchTerm, setSearchTerm] =
|
|
21944
|
-
const [isSearching, setIsSearching] =
|
|
21950
|
+
const [searchTerm, setSearchTerm] = useState88("");
|
|
21951
|
+
const [isSearching, setIsSearching] = useState88(false);
|
|
21945
21952
|
const data = useDataListRetriever({
|
|
21946
21953
|
retriever: /* @__PURE__ */ __name((params) => {
|
|
21947
21954
|
return HowToService.findMany(params);
|
|
@@ -21963,7 +21970,7 @@ function HowToSelector({
|
|
|
21963
21970
|
[searchTermRef, data]
|
|
21964
21971
|
);
|
|
21965
21972
|
const updateSearchTerm = useDebounce2(search, 500);
|
|
21966
|
-
|
|
21973
|
+
useEffect69(() => {
|
|
21967
21974
|
setIsSearching(true);
|
|
21968
21975
|
updateSearchTerm(searchTerm);
|
|
21969
21976
|
}, [updateSearchTerm, searchTerm]);
|
|
@@ -22031,7 +22038,7 @@ __name(HowToSelector, "HowToSelector");
|
|
|
22031
22038
|
|
|
22032
22039
|
// src/features/handbook/components/lists/HandbookContents.tsx
|
|
22033
22040
|
import { useTranslations as useTranslations111 } from "next-intl";
|
|
22034
|
-
import { useCallback as useCallback45, useEffect as
|
|
22041
|
+
import { useCallback as useCallback45, useEffect as useEffect73, useMemo as useMemo48, useState as useState96 } from "react";
|
|
22035
22042
|
|
|
22036
22043
|
// src/features/handbook/contexts/HandbookContext.tsx
|
|
22037
22044
|
import { useTranslations as useTranslations97 } from "next-intl";
|
|
@@ -22086,10 +22093,10 @@ var HandbookProvider = /* @__PURE__ */ __name(({ children, page, section, functi
|
|
|
22086
22093
|
import { MessagesSquareIcon, Sparkles as Sparkles2 } from "lucide-react";
|
|
22087
22094
|
import { useTranslations as useTranslations108 } from "next-intl";
|
|
22088
22095
|
import Link5 from "next/link";
|
|
22089
|
-
import { useCallback as useCallback44, useState as
|
|
22096
|
+
import { useCallback as useCallback44, useState as useState94 } from "react";
|
|
22090
22097
|
|
|
22091
22098
|
// src/features/assistant/components/parts/AssistantComposer.tsx
|
|
22092
|
-
import { useState as
|
|
22099
|
+
import { useState as useState89 } from "react";
|
|
22093
22100
|
import { useTranslations as useTranslations98 } from "next-intl";
|
|
22094
22101
|
import { ArrowUp } from "lucide-react";
|
|
22095
22102
|
import { jsx as jsx244, jsxs as jsxs139 } from "react/jsx-runtime";
|
|
@@ -22103,7 +22110,7 @@ function AssistantComposer({
|
|
|
22103
22110
|
leading
|
|
22104
22111
|
}) {
|
|
22105
22112
|
const t = useTranslations98();
|
|
22106
|
-
const [internal, setInternal] =
|
|
22113
|
+
const [internal, setInternal] = useState89("");
|
|
22107
22114
|
const value = controlled ?? internal;
|
|
22108
22115
|
const setValue = onValueChange ?? setInternal;
|
|
22109
22116
|
const canSend = value.trim().length > 0 && !disabled;
|
|
@@ -22153,7 +22160,7 @@ function AssistantComposer({
|
|
|
22153
22160
|
__name(AssistantComposer, "AssistantComposer");
|
|
22154
22161
|
|
|
22155
22162
|
// src/features/assistant/components/parts/AssistantThread.tsx
|
|
22156
|
-
import { useEffect as
|
|
22163
|
+
import { useEffect as useEffect71, useRef as useRef39 } from "react";
|
|
22157
22164
|
|
|
22158
22165
|
// src/features/assistant-message/components/MessageItem.tsx
|
|
22159
22166
|
import { useTranslations as useTranslations105 } from "next-intl";
|
|
@@ -22163,10 +22170,10 @@ import ReactMarkdown3, { defaultUrlTransform } from "react-markdown";
|
|
|
22163
22170
|
import remarkGfm3 from "remark-gfm";
|
|
22164
22171
|
|
|
22165
22172
|
// src/features/assistant-message/components/parts/MessageSourcesContainer.tsx
|
|
22166
|
-
import { useEffect as
|
|
22173
|
+
import { useEffect as useEffect70, useMemo as useMemo44, useState as useState92 } from "react";
|
|
22167
22174
|
|
|
22168
22175
|
// src/features/assistant-message/components/parts/MessageSourcesPanel.tsx
|
|
22169
|
-
import { useMemo as useMemo43, useState as
|
|
22176
|
+
import { useMemo as useMemo43, useState as useState91 } from "react";
|
|
22170
22177
|
import { useTranslations as useTranslations104 } from "next-intl";
|
|
22171
22178
|
import { ChevronDown as ChevronDown4, ChevronRight as ChevronRight2 } from "lucide-react";
|
|
22172
22179
|
|
|
@@ -22225,7 +22232,7 @@ function ReferencesTab({ references }) {
|
|
|
22225
22232
|
__name(ReferencesTab, "ReferencesTab");
|
|
22226
22233
|
|
|
22227
22234
|
// src/features/assistant-message/components/parts/tabs/CitationsTab.tsx
|
|
22228
|
-
import { Fragment as Fragment49, useState as
|
|
22235
|
+
import { Fragment as Fragment49, useState as useState90 } from "react";
|
|
22229
22236
|
import { useTranslations as useTranslations101 } from "next-intl";
|
|
22230
22237
|
import { ChevronDown as ChevronDown3, HelpCircle } from "lucide-react";
|
|
22231
22238
|
import ReactMarkdown2 from "react-markdown";
|
|
@@ -22266,7 +22273,7 @@ function CitationsTab({ citations, sources }) {
|
|
|
22266
22273
|
const t = useTranslations101();
|
|
22267
22274
|
const entityLabel = useEntityLabel();
|
|
22268
22275
|
const isMobile = useIsMobile();
|
|
22269
|
-
const [expanded, setExpanded] =
|
|
22276
|
+
const [expanded, setExpanded] = useState90(/* @__PURE__ */ new Set());
|
|
22270
22277
|
if (citations.length === 0) return null;
|
|
22271
22278
|
const sorted = [...citations].sort((a, b) => (b.relevance ?? 0) - (a.relevance ?? 0));
|
|
22272
22279
|
const toggle = /* @__PURE__ */ __name((id) => {
|
|
@@ -22533,8 +22540,8 @@ function MessageSourcesPanel({ message, isLatestAssistant, onSelectFollowUp, sou
|
|
|
22533
22540
|
if (usersCount > 0) visibleTabs.push("users");
|
|
22534
22541
|
const autoOpen = isLatestAssistant && suggestionsCount > 0;
|
|
22535
22542
|
const initialTab = autoOpen ? "suggested" : visibleTabs[0];
|
|
22536
|
-
const [open, setOpen] =
|
|
22537
|
-
const [active, setActive] =
|
|
22543
|
+
const [open, setOpen] = useState91(autoOpen);
|
|
22544
|
+
const [active, setActive] = useState91(initialTab);
|
|
22538
22545
|
if (total === 0) return null;
|
|
22539
22546
|
const panelId = `sources-panel-${message.id}`;
|
|
22540
22547
|
return /* @__PURE__ */ jsxs145("div", { className: "mt-2 w-full min-w-0", children: [
|
|
@@ -22616,8 +22623,8 @@ function MessageSourcesContainer({ message, isLatestAssistant, onSelectFollowUp
|
|
|
22616
22623
|
}
|
|
22617
22624
|
return parts.sort().join("|");
|
|
22618
22625
|
}, [groups]);
|
|
22619
|
-
const [resolved, setResolved] =
|
|
22620
|
-
|
|
22626
|
+
const [resolved, setResolved] = useState92([]);
|
|
22627
|
+
useEffect70(() => {
|
|
22621
22628
|
if (groups.size === 0) {
|
|
22622
22629
|
setResolved((current) => current.length === 0 ? current : []);
|
|
22623
22630
|
return;
|
|
@@ -22808,7 +22815,7 @@ function AssistantThread({
|
|
|
22808
22815
|
renderMention
|
|
22809
22816
|
}) {
|
|
22810
22817
|
const lastMessageRef = useRef39(null);
|
|
22811
|
-
|
|
22818
|
+
useEffect71(() => {
|
|
22812
22819
|
lastMessageRef.current?.scrollIntoView({ block: "start", behavior: "smooth" });
|
|
22813
22820
|
}, [messages.length, sending]);
|
|
22814
22821
|
return /* @__PURE__ */ jsxs148("div", { className: "flex-1 min-w-0 overflow-x-hidden overflow-y-auto px-6 py-5", children: [
|
|
@@ -22831,7 +22838,7 @@ __name(AssistantThread, "AssistantThread");
|
|
|
22831
22838
|
|
|
22832
22839
|
// src/features/handbook/hooks/useHandbookAsk.ts
|
|
22833
22840
|
import { useTranslations as useTranslations107 } from "next-intl";
|
|
22834
|
-
import { useCallback as useCallback43, useEffect as
|
|
22841
|
+
import { useCallback as useCallback43, useEffect as useEffect72, useState as useState93 } from "react";
|
|
22835
22842
|
import { v4 as v412 } from "uuid";
|
|
22836
22843
|
function withSources(messages, label) {
|
|
22837
22844
|
return messages.map((message) => withSourcesInContent(message, label));
|
|
@@ -22859,12 +22866,12 @@ function useHandbookAsk(params) {
|
|
|
22859
22866
|
const generateUrl = usePageUrlGenerator();
|
|
22860
22867
|
const shouldSyncUrl = params?.syncUrl ?? true;
|
|
22861
22868
|
const handbookThreadId = params?.handbookThreadId;
|
|
22862
|
-
const [threads, setThreads] =
|
|
22863
|
-
const [thread, setThread] =
|
|
22864
|
-
const [messages, setMessages] =
|
|
22865
|
-
const [sending, setSending] =
|
|
22869
|
+
const [threads, setThreads] = useState93([]);
|
|
22870
|
+
const [thread, setThread] = useState93(void 0);
|
|
22871
|
+
const [messages, setMessages] = useState93([]);
|
|
22872
|
+
const [sending, setSending] = useState93(false);
|
|
22866
22873
|
const sourcesLabel = t("handbook.chat.sources");
|
|
22867
|
-
|
|
22874
|
+
useEffect72(() => {
|
|
22868
22875
|
let cancelled = false;
|
|
22869
22876
|
(async () => {
|
|
22870
22877
|
const loaded = await HandbookThreadService.findMany();
|
|
@@ -22874,7 +22881,7 @@ function useHandbookAsk(params) {
|
|
|
22874
22881
|
cancelled = true;
|
|
22875
22882
|
};
|
|
22876
22883
|
}, []);
|
|
22877
|
-
|
|
22884
|
+
useEffect72(() => {
|
|
22878
22885
|
if (!handbookThreadId) return;
|
|
22879
22886
|
let cancelled = false;
|
|
22880
22887
|
(async () => {
|
|
@@ -22967,7 +22974,7 @@ function HandbookAskSheet({ handbookPageId } = {}) {
|
|
|
22967
22974
|
const t = useTranslations108();
|
|
22968
22975
|
const generateUrl = usePageUrlGenerator();
|
|
22969
22976
|
const { threads, thread, messages, sending, ask, selectThread } = useHandbookAsk({ syncUrl: false });
|
|
22970
|
-
const [scoped, setScoped] =
|
|
22977
|
+
const [scoped, setScoped] = useState94(false);
|
|
22971
22978
|
const chatUrl = `${generateUrl({ page: Modules.HandbookPage })}/chat`;
|
|
22972
22979
|
const showThread = !!thread || sending || messages.length > 0;
|
|
22973
22980
|
const send = useCallback44(
|
|
@@ -23028,11 +23035,11 @@ __name(HandbookAskSheet, "HandbookAskSheet");
|
|
|
23028
23035
|
|
|
23029
23036
|
// src/features/handbook/components/forms/HandbookSyncButton.tsx
|
|
23030
23037
|
import { useTranslations as useTranslations109 } from "next-intl";
|
|
23031
|
-
import { useState as
|
|
23038
|
+
import { useState as useState95 } from "react";
|
|
23032
23039
|
import { jsx as jsx258 } from "react/jsx-runtime";
|
|
23033
23040
|
function HandbookSyncButton({ refresh }) {
|
|
23034
23041
|
const t = useTranslations109();
|
|
23035
|
-
const [isSyncing, setIsSyncing] =
|
|
23042
|
+
const [isSyncing, setIsSyncing] = useState95(false);
|
|
23036
23043
|
const onSync = /* @__PURE__ */ __name(async () => {
|
|
23037
23044
|
setIsSyncing(true);
|
|
23038
23045
|
try {
|
|
@@ -23149,11 +23156,11 @@ __name(splitByNesting, "splitByNesting");
|
|
|
23149
23156
|
import { Fragment as Fragment51, jsx as jsx261, jsxs as jsxs152 } from "react/jsx-runtime";
|
|
23150
23157
|
function HandbookContents() {
|
|
23151
23158
|
const t = useTranslations111();
|
|
23152
|
-
const [pages, setPages] =
|
|
23153
|
-
const [sections, setSections] =
|
|
23154
|
-
const [isLoading, setIsLoading] =
|
|
23155
|
-
const [reloadToken, setReloadToken] =
|
|
23156
|
-
|
|
23159
|
+
const [pages, setPages] = useState96([]);
|
|
23160
|
+
const [sections, setSections] = useState96([]);
|
|
23161
|
+
const [isLoading, setIsLoading] = useState96(true);
|
|
23162
|
+
const [reloadToken, setReloadToken] = useState96(0);
|
|
23163
|
+
useEffect73(() => {
|
|
23157
23164
|
let cancelled = false;
|
|
23158
23165
|
const load = /* @__PURE__ */ __name(async () => {
|
|
23159
23166
|
setIsLoading(true);
|
|
@@ -23243,7 +23250,7 @@ __name(HandbookAdminContainer, "HandbookAdminContainer");
|
|
|
23243
23250
|
|
|
23244
23251
|
// src/features/handbook/components/containers/HandbookPageContainer.tsx
|
|
23245
23252
|
import { useTranslations as useTranslations115 } from "next-intl";
|
|
23246
|
-
import { useEffect as
|
|
23253
|
+
import { useEffect as useEffect76, useMemo as useMemo51, useState as useState98 } from "react";
|
|
23247
23254
|
|
|
23248
23255
|
// src/features/handbook/components/details/HandbookPageDetails.tsx
|
|
23249
23256
|
import { jsx as jsx263 } from "react/jsx-runtime";
|
|
@@ -23299,14 +23306,14 @@ __name(HandbookPageNeighbours, "HandbookPageNeighbours");
|
|
|
23299
23306
|
// src/features/handbook/components/details/HandbookPageToc.tsx
|
|
23300
23307
|
import { List } from "lucide-react";
|
|
23301
23308
|
import { useTranslations as useTranslations113 } from "next-intl";
|
|
23302
|
-
import { useCallback as useCallback46, useEffect as
|
|
23309
|
+
import { useCallback as useCallback46, useEffect as useEffect74, useState as useState97 } from "react";
|
|
23303
23310
|
import { jsx as jsx265, jsxs as jsxs154 } from "react/jsx-runtime";
|
|
23304
23311
|
function HandbookPageToc({ containerId }) {
|
|
23305
23312
|
const t = useTranslations113();
|
|
23306
|
-
const [activeId, setActiveId] =
|
|
23307
|
-
const [headings, setHeadings] =
|
|
23308
|
-
const [headingsWithIds, setHeadingsWithIds] =
|
|
23309
|
-
|
|
23313
|
+
const [activeId, setActiveId] = useState97(null);
|
|
23314
|
+
const [headings, setHeadings] = useState97([]);
|
|
23315
|
+
const [headingsWithIds, setHeadingsWithIds] = useState97(/* @__PURE__ */ new Map());
|
|
23316
|
+
useEffect74(() => {
|
|
23310
23317
|
const contentPanel = document.getElementById(containerId);
|
|
23311
23318
|
if (!contentPanel) return;
|
|
23312
23319
|
const collect = /* @__PURE__ */ __name(() => {
|
|
@@ -23330,7 +23337,7 @@ function HandbookPageToc({ containerId }) {
|
|
|
23330
23337
|
observer.observe(contentPanel, { childList: true, subtree: true });
|
|
23331
23338
|
return () => observer.disconnect();
|
|
23332
23339
|
}, [containerId]);
|
|
23333
|
-
|
|
23340
|
+
useEffect74(() => {
|
|
23334
23341
|
if (headingsWithIds.size === 0) return;
|
|
23335
23342
|
const observer = new IntersectionObserver(
|
|
23336
23343
|
(entries) => {
|
|
@@ -23396,7 +23403,7 @@ __name(HandbookPageToc, "HandbookPageToc");
|
|
|
23396
23403
|
// src/features/handbook/components/parts/HandbookPageNavigator.tsx
|
|
23397
23404
|
import { BookOpenIcon } from "lucide-react";
|
|
23398
23405
|
import { useTranslations as useTranslations114 } from "next-intl";
|
|
23399
|
-
import { useEffect as
|
|
23406
|
+
import { useEffect as useEffect75, useMemo as useMemo50, useRef as useRef40 } from "react";
|
|
23400
23407
|
import { jsx as jsx266, jsxs as jsxs155 } from "react/jsx-runtime";
|
|
23401
23408
|
function HandbookPageNavigator({ pages, sections, currentId }) {
|
|
23402
23409
|
const t = useTranslations114();
|
|
@@ -23428,7 +23435,7 @@ function HandbookPageNavigator({ pages, sections, currentId }) {
|
|
|
23428
23435
|
return ordered;
|
|
23429
23436
|
}, [pages, sections, t]);
|
|
23430
23437
|
const currentRef = useRef40(null);
|
|
23431
|
-
|
|
23438
|
+
useEffect75(() => {
|
|
23432
23439
|
const link = currentRef.current;
|
|
23433
23440
|
if (!link) return;
|
|
23434
23441
|
const rail = link.closest(".overflow-y-auto");
|
|
@@ -23470,11 +23477,11 @@ import { jsx as jsx267, jsxs as jsxs156 } from "react/jsx-runtime";
|
|
|
23470
23477
|
var CONTENT_CONTAINER_ID = "handbook-page-content";
|
|
23471
23478
|
function HandbookPageContainer({ handbookPageId }) {
|
|
23472
23479
|
const t = useTranslations115();
|
|
23473
|
-
const [handbookPage, setHandbookPage] =
|
|
23474
|
-
const [pages, setPages] =
|
|
23475
|
-
const [sections, setSections] =
|
|
23476
|
-
const [isLoading, setIsLoading] =
|
|
23477
|
-
|
|
23480
|
+
const [handbookPage, setHandbookPage] = useState98(void 0);
|
|
23481
|
+
const [pages, setPages] = useState98([]);
|
|
23482
|
+
const [sections, setSections] = useState98([]);
|
|
23483
|
+
const [isLoading, setIsLoading] = useState98(true);
|
|
23484
|
+
useEffect76(() => {
|
|
23478
23485
|
let cancelled = false;
|
|
23479
23486
|
const load = /* @__PURE__ */ __name(async () => {
|
|
23480
23487
|
setIsLoading(true);
|
|
@@ -23490,7 +23497,7 @@ function HandbookPageContainer({ handbookPageId }) {
|
|
|
23490
23497
|
cancelled = true;
|
|
23491
23498
|
};
|
|
23492
23499
|
}, [handbookPageId]);
|
|
23493
|
-
|
|
23500
|
+
useEffect76(() => {
|
|
23494
23501
|
let cancelled = false;
|
|
23495
23502
|
const loadPages = /* @__PURE__ */ __name(async () => {
|
|
23496
23503
|
const allPages = await HandbookPageService.findMany({ fetchAll: true });
|
|
@@ -23715,14 +23722,14 @@ __name(EntityMentionLinkView, "EntityMentionLinkView");
|
|
|
23715
23722
|
var EntityMentionLink = /* @__PURE__ */ __name((p) => /* @__PURE__ */ jsx270(EntityMentionLinkView, { ...p }), "EntityMentionLink");
|
|
23716
23723
|
|
|
23717
23724
|
// src/features/assistant/components/parts/AssistantEmptyState.tsx
|
|
23718
|
-
import { useState as
|
|
23725
|
+
import { useState as useState99 } from "react";
|
|
23719
23726
|
import { useTranslations as useTranslations118 } from "next-intl";
|
|
23720
23727
|
import { Sparkles as Sparkles4 } from "lucide-react";
|
|
23721
23728
|
import { jsx as jsx271, jsxs as jsxs159 } from "react/jsx-runtime";
|
|
23722
23729
|
var STARTER_KEYS = ["a", "b", "c", "d"];
|
|
23723
23730
|
function AssistantEmptyState({ onSend, operatorMode = false, onOperatorModeChange, composerLeading }) {
|
|
23724
23731
|
const t = useTranslations118();
|
|
23725
|
-
const [draft, setDraft] =
|
|
23732
|
+
const [draft, setDraft] = useState99("");
|
|
23726
23733
|
return /* @__PURE__ */ jsx271("div", { className: "flex h-full w-full items-center justify-center p-10", children: /* @__PURE__ */ jsxs159("div", { className: "flex w-full max-w-2xl flex-col gap-6", children: [
|
|
23727
23734
|
/* @__PURE__ */ jsxs159("div", { className: "text-center", children: [
|
|
23728
23735
|
/* @__PURE__ */ jsx271("div", { className: "mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-full bg-gradient-to-br from-blue-400 to-violet-500 text-white", children: /* @__PURE__ */ jsx271(Sparkles4, { className: "h-5 w-5" }) }),
|
|
@@ -23760,14 +23767,14 @@ function AssistantEmptyState({ onSend, operatorMode = false, onOperatorModeChang
|
|
|
23760
23767
|
__name(AssistantEmptyState, "AssistantEmptyState");
|
|
23761
23768
|
|
|
23762
23769
|
// src/features/assistant/components/parts/AssistantThreadHeader.tsx
|
|
23763
|
-
import { useState as
|
|
23770
|
+
import { useState as useState100 } from "react";
|
|
23764
23771
|
import { useTranslations as useTranslations119 } from "next-intl";
|
|
23765
23772
|
import { jsx as jsx272, jsxs as jsxs160 } from "react/jsx-runtime";
|
|
23766
23773
|
function AssistantThreadHeader({ assistant, onRename, onDelete, renamePlaceholder, deleteConfirmLabel }) {
|
|
23767
23774
|
const t = useTranslations119();
|
|
23768
|
-
const [renameValue, setRenameValue] =
|
|
23769
|
-
const [renameOpen, setRenameOpen] =
|
|
23770
|
-
const [deleteOpen, setDeleteOpen] =
|
|
23775
|
+
const [renameValue, setRenameValue] = useState100(assistant.title);
|
|
23776
|
+
const [renameOpen, setRenameOpen] = useState100(false);
|
|
23777
|
+
const [deleteOpen, setDeleteOpen] = useState100(false);
|
|
23771
23778
|
const handleRename = /* @__PURE__ */ __name(async () => {
|
|
23772
23779
|
const trimmed = renameValue.trim() || assistant.title;
|
|
23773
23780
|
await onRename(trimmed);
|
|
@@ -23919,7 +23926,7 @@ import { useTranslations as useTranslations122 } from "next-intl";
|
|
|
23919
23926
|
// src/features/assistant/components/parts/AssistantBlockNoteComposer.tsx
|
|
23920
23927
|
import { ArrowUp as ArrowUp2 } from "lucide-react";
|
|
23921
23928
|
import { useTranslations as useTranslations121 } from "next-intl";
|
|
23922
|
-
import { useCallback as useCallback47, useId as useId5, useState as
|
|
23929
|
+
import { useCallback as useCallback47, useId as useId5, useState as useState101 } from "react";
|
|
23923
23930
|
import { jsx as jsx274, jsxs as jsxs162 } from "react/jsx-runtime";
|
|
23924
23931
|
function flattenBlocks(blocks) {
|
|
23925
23932
|
const lines = [];
|
|
@@ -23957,9 +23964,9 @@ function AssistantBlockNoteComposer({
|
|
|
23957
23964
|
}) {
|
|
23958
23965
|
const t = useTranslations121();
|
|
23959
23966
|
const editorId = useId5().replace(/[^a-zA-Z0-9]/g, "");
|
|
23960
|
-
const [blocks, setBlocks] =
|
|
23961
|
-
const [isEmpty, setIsEmpty] =
|
|
23962
|
-
const [resetKey, setResetKey] =
|
|
23967
|
+
const [blocks, setBlocks] = useState101([]);
|
|
23968
|
+
const [isEmpty, setIsEmpty] = useState101(true);
|
|
23969
|
+
const [resetKey, setResetKey] = useState101(0);
|
|
23963
23970
|
const canSend = !isEmpty && !disabled;
|
|
23964
23971
|
const submit = useCallback47(async () => {
|
|
23965
23972
|
if (isEmpty || disabled) return;
|
|
@@ -24097,7 +24104,7 @@ __name(AssistantPageContainer, "AssistantPageContainer");
|
|
|
24097
24104
|
// src/features/assistant-action/components/ApprovalActionCard.tsx
|
|
24098
24105
|
import { ShieldAlert as ShieldAlert2 } from "lucide-react";
|
|
24099
24106
|
import { useTranslations as useTranslations123 } from "next-intl";
|
|
24100
|
-
import { Fragment as Fragment57, useEffect as
|
|
24107
|
+
import { Fragment as Fragment57, useEffect as useEffect77, useMemo as useMemo54, useState as useState102 } from "react";
|
|
24101
24108
|
import { jsx as jsx276, jsxs as jsxs164 } from "react/jsx-runtime";
|
|
24102
24109
|
var STATUS_VARIANT = {
|
|
24103
24110
|
pending: "softBlue",
|
|
@@ -24252,14 +24259,14 @@ function parseLegacyProposal(toolArgs) {
|
|
|
24252
24259
|
__name(parseLegacyProposal, "parseLegacyProposal");
|
|
24253
24260
|
function ApprovalActionCard({ actionId, summary, onResolved, hiddenRelationshipKeys }) {
|
|
24254
24261
|
const t = useTranslations123();
|
|
24255
|
-
const [status, setStatus] =
|
|
24256
|
-
const [actionSummary, setActionSummary] =
|
|
24257
|
-
const [toolName, setToolName] =
|
|
24258
|
-
const [toolArgs, setToolArgs] =
|
|
24259
|
-
const [actionProposal, setActionProposal] =
|
|
24260
|
-
const [busy, setBusy] =
|
|
24261
|
-
const [failed, setFailed] =
|
|
24262
|
-
|
|
24262
|
+
const [status, setStatus] = useState102(void 0);
|
|
24263
|
+
const [actionSummary, setActionSummary] = useState102(void 0);
|
|
24264
|
+
const [toolName, setToolName] = useState102(void 0);
|
|
24265
|
+
const [toolArgs, setToolArgs] = useState102(void 0);
|
|
24266
|
+
const [actionProposal, setActionProposal] = useState102(void 0);
|
|
24267
|
+
const [busy, setBusy] = useState102(false);
|
|
24268
|
+
const [failed, setFailed] = useState102(false);
|
|
24269
|
+
useEffect77(() => {
|
|
24263
24270
|
let cancelled = false;
|
|
24264
24271
|
(async () => {
|
|
24265
24272
|
try {
|
|
@@ -24420,7 +24427,7 @@ var NotificationErrorBoundary = class extends Component {
|
|
|
24420
24427
|
|
|
24421
24428
|
// src/features/notification/components/containers/NotificationsListContainer.tsx
|
|
24422
24429
|
import { useSearchParams as useSearchParams5 } from "next/navigation";
|
|
24423
|
-
import { useState as
|
|
24430
|
+
import { useState as useState103 } from "react";
|
|
24424
24431
|
|
|
24425
24432
|
// src/features/notification/components/filters/NotificationViewSwitcher.tsx
|
|
24426
24433
|
import { useTranslations as useTranslations124 } from "next-intl";
|
|
@@ -24450,7 +24457,7 @@ __name(NotificationViewSwitcher, "NotificationViewSwitcher");
|
|
|
24450
24457
|
|
|
24451
24458
|
// src/features/notification/components/lists/NotificationsList.tsx
|
|
24452
24459
|
import { useTranslations as useTranslations126 } from "next-intl";
|
|
24453
|
-
import { useEffect as
|
|
24460
|
+
import { useEffect as useEffect78, useRef as useRef41 } from "react";
|
|
24454
24461
|
|
|
24455
24462
|
// src/features/notification/hooks/useNotificationTableStructure.tsx
|
|
24456
24463
|
import { ArchiveIcon as ArchiveIcon2 } from "lucide-react";
|
|
@@ -24578,7 +24585,7 @@ function NotificationsList({ archived, headerControl, fullWidth }) {
|
|
|
24578
24585
|
retrieverParams: { isArchived: archived }
|
|
24579
24586
|
});
|
|
24580
24587
|
const markedRef = useRef41(/* @__PURE__ */ new Set());
|
|
24581
|
-
|
|
24588
|
+
useEffect78(() => {
|
|
24582
24589
|
if (!data.isLoaded || !data.data) return;
|
|
24583
24590
|
const unreadIds = data.data.filter((notification) => !notification.isRead && !markedRef.current.has(notification.id)).map((notification) => notification.id);
|
|
24584
24591
|
if (unreadIds.length === 0) return;
|
|
@@ -24618,7 +24625,7 @@ function NotificationsListContainerContent() {
|
|
|
24618
24625
|
const searchParams = useSearchParams5();
|
|
24619
24626
|
const { error } = useNotificationContext();
|
|
24620
24627
|
const tabParam = searchParams.get("tab");
|
|
24621
|
-
const [mode, setMode] =
|
|
24628
|
+
const [mode, setMode] = useState103(tabParam === "archived" ? "archived" : "inbox");
|
|
24622
24629
|
if (error) {
|
|
24623
24630
|
return /* @__PURE__ */ jsx282("div", { className: "flex items-center justify-center p-8 text-center", children: /* @__PURE__ */ jsxs167("div", { className: "text-destructive text-xs/relaxed", children: [
|
|
24624
24631
|
/* @__PURE__ */ jsxs167("p", { children: [
|
|
@@ -24658,7 +24665,7 @@ __name(NotificationsListContainer, "NotificationsListContainer");
|
|
|
24658
24665
|
// src/features/notification/components/modals/NotificationModal.tsx
|
|
24659
24666
|
import { BellIcon as BellIcon2, ExternalLinkIcon } from "lucide-react";
|
|
24660
24667
|
import { useTranslations as useTranslations127 } from "next-intl";
|
|
24661
|
-
import { Fragment as Fragment58, useCallback as useCallback48, useEffect as
|
|
24668
|
+
import { Fragment as Fragment58, useCallback as useCallback48, useEffect as useEffect79, useMemo as useMemo56, useRef as useRef42, useState as useState104 } from "react";
|
|
24662
24669
|
import { jsx as jsx283, jsxs as jsxs168 } from "react/jsx-runtime";
|
|
24663
24670
|
function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
24664
24671
|
const _instanceId = useRef42(Math.random().toString(36).substr(2, 9));
|
|
@@ -24680,7 +24687,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
24680
24687
|
} = useSocketContext();
|
|
24681
24688
|
const t = useTranslations127();
|
|
24682
24689
|
const generateUrl = usePageUrlGenerator();
|
|
24683
|
-
const [newNotifications, setNewNotifications] =
|
|
24690
|
+
const [newNotifications, setNewNotifications] = useState104(false);
|
|
24684
24691
|
const preventAutoClose = useRef42(false);
|
|
24685
24692
|
const circuitBreakerRef = useRef42({
|
|
24686
24693
|
count: 0,
|
|
@@ -24709,7 +24716,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
24709
24716
|
unreadIds: unreadNotifications2.map((notif) => notif.id)
|
|
24710
24717
|
};
|
|
24711
24718
|
}, [notifications]);
|
|
24712
|
-
|
|
24719
|
+
useEffect79(() => {
|
|
24713
24720
|
setNewNotifications(unreadCount > 0);
|
|
24714
24721
|
}, [unreadCount]);
|
|
24715
24722
|
const processSocketNotifications = useCallback48(() => {
|
|
@@ -24754,7 +24761,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
24754
24761
|
generateUrl,
|
|
24755
24762
|
checkCircuitBreaker
|
|
24756
24763
|
]);
|
|
24757
|
-
|
|
24764
|
+
useEffect79(() => {
|
|
24758
24765
|
processSocketNotifications();
|
|
24759
24766
|
}, [processSocketNotifications]);
|
|
24760
24767
|
const handleOpenChange = /* @__PURE__ */ __name((newlyRequestedOpenState) => {
|
|
@@ -24867,7 +24874,7 @@ __name(PushNotificationProvider, "PushNotificationProvider");
|
|
|
24867
24874
|
|
|
24868
24875
|
// src/features/referral/components/ReferralCodeCapture.tsx
|
|
24869
24876
|
import { useSearchParams as useSearchParams6 } from "next/navigation";
|
|
24870
|
-
import { useEffect as
|
|
24877
|
+
import { useEffect as useEffect80 } from "react";
|
|
24871
24878
|
|
|
24872
24879
|
// src/features/referral/utils/referral-cookie.ts
|
|
24873
24880
|
function setReferralCode(code) {
|
|
@@ -24892,7 +24899,7 @@ __name(getReferralCode2, "getReferralCode");
|
|
|
24892
24899
|
// src/features/referral/components/ReferralCodeCapture.tsx
|
|
24893
24900
|
function ReferralCodeCapture() {
|
|
24894
24901
|
const searchParams = useSearchParams6();
|
|
24895
|
-
|
|
24902
|
+
useEffect80(() => {
|
|
24896
24903
|
if (!isReferralEnabled()) {
|
|
24897
24904
|
return;
|
|
24898
24905
|
}
|
|
@@ -24911,14 +24918,14 @@ __name(ReferralCodeCapture, "ReferralCodeCapture");
|
|
|
24911
24918
|
|
|
24912
24919
|
// src/features/referral/components/ReferralWidget.tsx
|
|
24913
24920
|
import { Copy as Copy2, Loader2 as Loader26, Mail, Users } from "lucide-react";
|
|
24914
|
-
import { useCallback as useCallback49, useRef as useRef43, useState as
|
|
24921
|
+
import { useCallback as useCallback49, useRef as useRef43, useState as useState107 } from "react";
|
|
24915
24922
|
|
|
24916
24923
|
// src/features/referral/hooks/useReferralInvite.ts
|
|
24917
|
-
import { useState as
|
|
24924
|
+
import { useState as useState105 } from "react";
|
|
24918
24925
|
function useReferralInvite() {
|
|
24919
|
-
const [sending, setSending] =
|
|
24920
|
-
const [error, setError] =
|
|
24921
|
-
const [success, setSuccess] =
|
|
24926
|
+
const [sending, setSending] = useState105(false);
|
|
24927
|
+
const [error, setError] = useState105(null);
|
|
24928
|
+
const [success, setSuccess] = useState105(false);
|
|
24922
24929
|
const sendInvite = /* @__PURE__ */ __name(async (email) => {
|
|
24923
24930
|
if (!isReferralEnabled()) {
|
|
24924
24931
|
return;
|
|
@@ -24940,12 +24947,12 @@ function useReferralInvite() {
|
|
|
24940
24947
|
__name(useReferralInvite, "useReferralInvite");
|
|
24941
24948
|
|
|
24942
24949
|
// src/features/referral/hooks/useReferralStats.ts
|
|
24943
|
-
import { useEffect as
|
|
24950
|
+
import { useEffect as useEffect81, useState as useState106 } from "react";
|
|
24944
24951
|
function useReferralStats() {
|
|
24945
|
-
const [stats, setStats] =
|
|
24946
|
-
const [loading, setLoading] =
|
|
24947
|
-
const [error, setError] =
|
|
24948
|
-
|
|
24952
|
+
const [stats, setStats] = useState106(null);
|
|
24953
|
+
const [loading, setLoading] = useState106(true);
|
|
24954
|
+
const [error, setError] = useState106(null);
|
|
24955
|
+
useEffect81(() => {
|
|
24949
24956
|
if (!isReferralEnabled()) {
|
|
24950
24957
|
setLoading(false);
|
|
24951
24958
|
return;
|
|
@@ -25015,8 +25022,8 @@ function ReferralWidget({
|
|
|
25015
25022
|
const t = { ...DEFAULT_TRANSLATIONS, ...translations };
|
|
25016
25023
|
const { stats, loading, error } = useReferralStats();
|
|
25017
25024
|
const { sendInvite, sending } = useReferralInvite();
|
|
25018
|
-
const [email, setEmail] =
|
|
25019
|
-
const [copied, setCopied] =
|
|
25025
|
+
const [email, setEmail] = useState107("");
|
|
25026
|
+
const [copied, setCopied] = useState107(false);
|
|
25020
25027
|
const linkInputRef = useRef43(null);
|
|
25021
25028
|
const config = getReferralConfig();
|
|
25022
25029
|
const baseUrl = config.referralUrlBase || (typeof window !== "undefined" ? window.location.origin : "");
|
|
@@ -25229,13 +25236,13 @@ __name(FormRoles, "FormRoles");
|
|
|
25229
25236
|
|
|
25230
25237
|
// src/features/role/components/forms/RemoveUserFromRole.tsx
|
|
25231
25238
|
import { useTranslations as useTranslations130 } from "next-intl";
|
|
25232
|
-
import { useEffect as
|
|
25239
|
+
import { useEffect as useEffect82, useState as useState108 } from "react";
|
|
25233
25240
|
import { Fragment as Fragment61, jsx as jsx290, jsxs as jsxs173 } from "react/jsx-runtime";
|
|
25234
25241
|
function RemoveUserFromRole({ role, user, refresh }) {
|
|
25235
|
-
const [open, setOpen] =
|
|
25236
|
-
const [canRemove, setCanRemove] =
|
|
25242
|
+
const [open, setOpen] = useState108(false);
|
|
25243
|
+
const [canRemove, setCanRemove] = useState108(false);
|
|
25237
25244
|
const t = useTranslations130();
|
|
25238
|
-
|
|
25245
|
+
useEffect82(() => {
|
|
25239
25246
|
async function checkCompanyAdminDeletability() {
|
|
25240
25247
|
const roleUsers = await UserService.findAllUsersByRole({
|
|
25241
25248
|
roleId: role.id
|
|
@@ -25305,13 +25312,13 @@ __name(RemoveUserFromRole, "RemoveUserFromRole");
|
|
|
25305
25312
|
// src/features/role/components/forms/UserRoleAdd.tsx
|
|
25306
25313
|
import { PlusCircle as PlusCircle2 } from "lucide-react";
|
|
25307
25314
|
import { useTranslations as useTranslations131 } from "next-intl";
|
|
25308
|
-
import { useCallback as useCallback50, useEffect as
|
|
25315
|
+
import { useCallback as useCallback50, useEffect as useEffect83, useRef as useRef44, useState as useState109 } from "react";
|
|
25309
25316
|
import { Fragment as Fragment62, jsx as jsx291, jsxs as jsxs174 } from "react/jsx-runtime";
|
|
25310
25317
|
function UserRoleAdd({ user, refresh }) {
|
|
25311
|
-
const [open, setOpen] =
|
|
25318
|
+
const [open, setOpen] = useState109(false);
|
|
25312
25319
|
const inputRef = useRef44(null);
|
|
25313
|
-
const [searchTerm, setSearchTerm] =
|
|
25314
|
-
const [roles, setRoles] =
|
|
25320
|
+
const [searchTerm, setSearchTerm] = useState109("");
|
|
25321
|
+
const [roles, setRoles] = useState109([]);
|
|
25315
25322
|
const t = useTranslations131();
|
|
25316
25323
|
const addUserToRole = /* @__PURE__ */ __name(async (role) => {
|
|
25317
25324
|
await RoleService.addUserToRole({
|
|
@@ -25347,10 +25354,10 @@ function UserRoleAdd({ user, refresh }) {
|
|
|
25347
25354
|
[searchTerm, user]
|
|
25348
25355
|
);
|
|
25349
25356
|
const updateSearchTerm = useDebounce2(searchRoles, 500);
|
|
25350
|
-
|
|
25357
|
+
useEffect83(() => {
|
|
25351
25358
|
if (open) updateSearchTerm(searchTerm);
|
|
25352
25359
|
}, [open, searchTerm]);
|
|
25353
|
-
|
|
25360
|
+
useEffect83(() => {
|
|
25354
25361
|
if (open) searchRoles("");
|
|
25355
25362
|
}, [open]);
|
|
25356
25363
|
return /* @__PURE__ */ jsxs174(Fragment62, { children: [
|
|
@@ -25617,11 +25624,11 @@ function OAuthScopeSelector({
|
|
|
25617
25624
|
__name(OAuthScopeSelector, "OAuthScopeSelector");
|
|
25618
25625
|
|
|
25619
25626
|
// src/features/oauth/components/OAuthClientSecretDisplay.tsx
|
|
25620
|
-
import { useState as
|
|
25627
|
+
import { useState as useState110, useCallback as useCallback53 } from "react";
|
|
25621
25628
|
import { Copy as Copy3, Check, AlertTriangle } from "lucide-react";
|
|
25622
25629
|
import { jsx as jsx296, jsxs as jsxs177 } from "react/jsx-runtime";
|
|
25623
25630
|
function OAuthClientSecretDisplay({ secret, onDismiss, open, clientName }) {
|
|
25624
|
-
const [copied, setCopied] =
|
|
25631
|
+
const [copied, setCopied] = useState110(false);
|
|
25625
25632
|
const handleCopy = useCallback53(async () => {
|
|
25626
25633
|
try {
|
|
25627
25634
|
await navigator.clipboard.writeText(secret);
|
|
@@ -25814,7 +25821,7 @@ function OAuthClientList({
|
|
|
25814
25821
|
__name(OAuthClientList, "OAuthClientList");
|
|
25815
25822
|
|
|
25816
25823
|
// src/features/oauth/components/OAuthClientForm.tsx
|
|
25817
|
-
import { useState as
|
|
25824
|
+
import { useState as useState111, useCallback as useCallback54 } from "react";
|
|
25818
25825
|
import { jsx as jsx299, jsxs as jsxs180 } from "react/jsx-runtime";
|
|
25819
25826
|
function OAuthClientForm({
|
|
25820
25827
|
client,
|
|
@@ -25825,14 +25832,14 @@ function OAuthClientForm({
|
|
|
25825
25832
|
defaultScopes = []
|
|
25826
25833
|
}) {
|
|
25827
25834
|
const isEditMode = !!client;
|
|
25828
|
-
const [formState, setFormState] =
|
|
25835
|
+
const [formState, setFormState] = useState111({
|
|
25829
25836
|
name: client?.name || "",
|
|
25830
25837
|
description: client?.description || "",
|
|
25831
25838
|
redirectUris: client?.redirectUris?.length ? client.redirectUris : [""],
|
|
25832
25839
|
allowedScopes: client ? client.allowedScopes || [] : defaultScopes,
|
|
25833
25840
|
isConfidential: client?.isConfidential ?? true
|
|
25834
25841
|
});
|
|
25835
|
-
const [errors, setErrors] =
|
|
25842
|
+
const [errors, setErrors] = useState111({});
|
|
25836
25843
|
const validate = useCallback54(() => {
|
|
25837
25844
|
const newErrors = {};
|
|
25838
25845
|
if (!formState.name.trim()) {
|
|
@@ -25956,7 +25963,7 @@ function OAuthClientForm({
|
|
|
25956
25963
|
__name(OAuthClientForm, "OAuthClientForm");
|
|
25957
25964
|
|
|
25958
25965
|
// src/features/oauth/components/OAuthClientDetail.tsx
|
|
25959
|
-
import { useState as
|
|
25966
|
+
import { useState as useState112, useCallback as useCallback55 } from "react";
|
|
25960
25967
|
import { format as format2 } from "date-fns";
|
|
25961
25968
|
import { Copy as Copy4, Check as Check2, RefreshCw as RefreshCw3, Pencil as Pencil2, Trash2 as Trash25, ExternalLink } from "lucide-react";
|
|
25962
25969
|
import { Fragment as Fragment63, jsx as jsx300, jsxs as jsxs181 } from "react/jsx-runtime";
|
|
@@ -25967,11 +25974,11 @@ function OAuthClientDetail({
|
|
|
25967
25974
|
onDelete,
|
|
25968
25975
|
onRegenerateSecret
|
|
25969
25976
|
}) {
|
|
25970
|
-
const [copiedField, setCopiedField] =
|
|
25971
|
-
const [showDeleteConfirm, setShowDeleteConfirm] =
|
|
25972
|
-
const [showRegenerateConfirm, setShowRegenerateConfirm] =
|
|
25973
|
-
const [isDeleting, setIsDeleting] =
|
|
25974
|
-
const [isRegenerating, setIsRegenerating] =
|
|
25977
|
+
const [copiedField, setCopiedField] = useState112(null);
|
|
25978
|
+
const [showDeleteConfirm, setShowDeleteConfirm] = useState112(false);
|
|
25979
|
+
const [showRegenerateConfirm, setShowRegenerateConfirm] = useState112(false);
|
|
25980
|
+
const [isDeleting, setIsDeleting] = useState112(false);
|
|
25981
|
+
const [isRegenerating, setIsRegenerating] = useState112(false);
|
|
25975
25982
|
const copyToClipboard2 = useCallback55(async (text, field) => {
|
|
25976
25983
|
try {
|
|
25977
25984
|
await navigator.clipboard.writeText(text);
|
|
@@ -26282,7 +26289,7 @@ __name(OAuthConsentScreen, "OAuthConsentScreen");
|
|
|
26282
26289
|
import { zodResolver as zodResolver11 } from "@hookform/resolvers/zod";
|
|
26283
26290
|
import { CheckCircle, Mail as Mail2 } from "lucide-react";
|
|
26284
26291
|
import { useTranslations as useTranslations139 } from "next-intl";
|
|
26285
|
-
import { useState as
|
|
26292
|
+
import { useState as useState113 } from "react";
|
|
26286
26293
|
import { useForm as useForm11 } from "react-hook-form";
|
|
26287
26294
|
import { v4 as v413 } from "uuid";
|
|
26288
26295
|
import { z as z11 } from "zod";
|
|
@@ -26383,8 +26390,8 @@ __name(WaitlistQuestionnaireRenderer, "WaitlistQuestionnaireRenderer");
|
|
|
26383
26390
|
import { Fragment as Fragment65, jsx as jsx307, jsxs as jsxs188 } from "react/jsx-runtime";
|
|
26384
26391
|
function WaitlistForm({ onSuccess }) {
|
|
26385
26392
|
const t = useTranslations139();
|
|
26386
|
-
const [isSubmitting, setIsSubmitting] =
|
|
26387
|
-
const [isSuccess, setIsSuccess] =
|
|
26393
|
+
const [isSubmitting, setIsSubmitting] = useState113(false);
|
|
26394
|
+
const [isSuccess, setIsSuccess] = useState113(false);
|
|
26388
26395
|
const config = getWaitlistConfig();
|
|
26389
26396
|
const questionnaireFields = config.questionnaire ?? [];
|
|
26390
26397
|
const questionnaireSchema = questionnaireFields.reduce(
|
|
@@ -26563,13 +26570,13 @@ __name(WaitlistSuccessState, "WaitlistSuccessState");
|
|
|
26563
26570
|
// src/features/waitlist/components/sections/WaitlistConfirmation.tsx
|
|
26564
26571
|
import { CheckCircle as CheckCircle4, Loader2 as Loader28, XCircle as XCircle2 } from "lucide-react";
|
|
26565
26572
|
import { useTranslations as useTranslations141 } from "next-intl";
|
|
26566
|
-
import { useEffect as
|
|
26573
|
+
import { useEffect as useEffect84, useState as useState114 } from "react";
|
|
26567
26574
|
import { jsx as jsx310, jsxs as jsxs191 } from "react/jsx-runtime";
|
|
26568
26575
|
function WaitlistConfirmation({ code }) {
|
|
26569
26576
|
const t = useTranslations141();
|
|
26570
|
-
const [state, setState] =
|
|
26571
|
-
const [errorMessage, setErrorMessage] =
|
|
26572
|
-
|
|
26577
|
+
const [state, setState] = useState114("loading");
|
|
26578
|
+
const [errorMessage, setErrorMessage] = useState114("");
|
|
26579
|
+
useEffect84(() => {
|
|
26573
26580
|
async function confirmEmail() {
|
|
26574
26581
|
try {
|
|
26575
26582
|
await WaitlistService.confirm(code);
|
|
@@ -26608,11 +26615,11 @@ __name(WaitlistConfirmation, "WaitlistConfirmation");
|
|
|
26608
26615
|
// src/features/waitlist/components/lists/WaitlistList.tsx
|
|
26609
26616
|
import { RefreshCw as RefreshCw4 } from "lucide-react";
|
|
26610
26617
|
import { useTranslations as useTranslations142 } from "next-intl";
|
|
26611
|
-
import { useMemo as useMemo58, useState as
|
|
26618
|
+
import { useMemo as useMemo58, useState as useState115 } from "react";
|
|
26612
26619
|
import { jsx as jsx311, jsxs as jsxs192 } from "react/jsx-runtime";
|
|
26613
26620
|
function WaitlistList({ fullWidth } = {}) {
|
|
26614
26621
|
const t = useTranslations142();
|
|
26615
|
-
const [statusFilter, setStatusFilter] =
|
|
26622
|
+
const [statusFilter, setStatusFilter] = useState115("all");
|
|
26616
26623
|
const data = useDataListRetriever({
|
|
26617
26624
|
retriever: /* @__PURE__ */ __name((params) => WaitlistService.findMany(params), "retriever"),
|
|
26618
26625
|
retrieverParams: {},
|
|
@@ -26681,7 +26688,7 @@ __name(WaitlistList, "WaitlistList");
|
|
|
26681
26688
|
// src/features/rbac/components/RbacContainer.tsx
|
|
26682
26689
|
import { Loader2Icon as Loader2Icon4 } from "lucide-react";
|
|
26683
26690
|
import { useTranslations as useTranslations144 } from "next-intl";
|
|
26684
|
-
import { memo as memo2, useCallback as useCallback57, useEffect as
|
|
26691
|
+
import { memo as memo2, useCallback as useCallback57, useEffect as useEffect86, useMemo as useMemo59, useRef as useRef45, useState as useState117 } from "react";
|
|
26685
26692
|
|
|
26686
26693
|
// src/features/rbac/components/RbacPermissionCell.tsx
|
|
26687
26694
|
import { CheckIcon as CheckIcon9, MinusIcon as MinusIcon2, XIcon as XIcon12 } from "lucide-react";
|
|
@@ -26762,7 +26769,7 @@ __name(RbacPermissionCell, "RbacPermissionCell");
|
|
|
26762
26769
|
import { Popover as PopoverPrimitive2 } from "@base-ui/react/popover";
|
|
26763
26770
|
import { CheckIcon as CheckIcon10, MinusIcon as MinusIcon3, XIcon as XIcon13 } from "lucide-react";
|
|
26764
26771
|
import { useTranslations as useTranslations143 } from "next-intl";
|
|
26765
|
-
import { useCallback as useCallback56, useEffect as
|
|
26772
|
+
import { useCallback as useCallback56, useEffect as useEffect85, useState as useState116 } from "react";
|
|
26766
26773
|
import { Fragment as Fragment66, jsx as jsx313, jsxs as jsxs194 } from "react/jsx-runtime";
|
|
26767
26774
|
function RbacPermissionPicker({
|
|
26768
26775
|
open,
|
|
@@ -26775,8 +26782,8 @@ function RbacPermissionPicker({
|
|
|
26775
26782
|
onClose
|
|
26776
26783
|
}) {
|
|
26777
26784
|
const t = useTranslations143();
|
|
26778
|
-
const [customSegment, setCustomSegment] =
|
|
26779
|
-
|
|
26785
|
+
const [customSegment, setCustomSegment] = useState116("");
|
|
26786
|
+
useEffect85(() => {
|
|
26780
26787
|
if (!open) setCustomSegment("");
|
|
26781
26788
|
}, [open]);
|
|
26782
26789
|
const currentSegments = typeof value === "string" ? value.split("|").filter(Boolean) : [];
|
|
@@ -27024,8 +27031,8 @@ var ModuleEditor = memo2(/* @__PURE__ */ __name(function ModuleEditor2({
|
|
|
27024
27031
|
function RbacContainer() {
|
|
27025
27032
|
const t = useTranslations144();
|
|
27026
27033
|
const { matrix, modulePaths, loading, error, roleNames, moduleNames, updateCell, clearCell } = useRbacContext();
|
|
27027
|
-
const [selectedModuleId, setSelectedModuleId] =
|
|
27028
|
-
const [activePicker, setActivePicker] =
|
|
27034
|
+
const [selectedModuleId, setSelectedModuleId] = useState117(null);
|
|
27035
|
+
const [activePicker, setActivePicker] = useState117(null);
|
|
27029
27036
|
const openPicker = useCallback57((picker) => {
|
|
27030
27037
|
setActivePicker(picker);
|
|
27031
27038
|
}, []);
|
|
@@ -27053,7 +27060,7 @@ function RbacContainer() {
|
|
|
27053
27060
|
}
|
|
27054
27061
|
return Array.from(set).sort();
|
|
27055
27062
|
}, [matrix, roleNames]);
|
|
27056
|
-
|
|
27063
|
+
useEffect86(() => {
|
|
27057
27064
|
if (!selectedModuleId && sortedModuleIds.length > 0) {
|
|
27058
27065
|
setSelectedModuleId(sortedModuleIds[0]);
|
|
27059
27066
|
}
|
|
@@ -27136,7 +27143,7 @@ __name(RbacContainer, "RbacContainer");
|
|
|
27136
27143
|
// src/features/rbac/components/RbacByRoleContainer.tsx
|
|
27137
27144
|
import { Loader2Icon as Loader2Icon5 } from "lucide-react";
|
|
27138
27145
|
import { useTranslations as useTranslations145 } from "next-intl";
|
|
27139
|
-
import { Fragment as Fragment67, memo as memo3, useCallback as useCallback58, useEffect as
|
|
27146
|
+
import { Fragment as Fragment67, memo as memo3, useCallback as useCallback58, useEffect as useEffect87, useMemo as useMemo60, useRef as useRef46, useState as useState118 } from "react";
|
|
27140
27147
|
import { jsx as jsx315, jsxs as jsxs196 } from "react/jsx-runtime";
|
|
27141
27148
|
function findToken2(tokens, action) {
|
|
27142
27149
|
if (!tokens) return void 0;
|
|
@@ -27174,8 +27181,8 @@ var ACTION_LABELS2 = {
|
|
|
27174
27181
|
function RbacByRoleContainer() {
|
|
27175
27182
|
const t = useTranslations145();
|
|
27176
27183
|
const { matrix, modulePaths, loading, error, roleNames, moduleNames, updateCell, clearCell } = useRbacContext();
|
|
27177
|
-
const [selectedRoleId, setSelectedRoleId] =
|
|
27178
|
-
const [activePicker, setActivePicker] =
|
|
27184
|
+
const [selectedRoleId, setSelectedRoleId] = useState118(null);
|
|
27185
|
+
const [activePicker, setActivePicker] = useState118(null);
|
|
27179
27186
|
const openPicker = useCallback58((picker) => {
|
|
27180
27187
|
setActivePicker(picker);
|
|
27181
27188
|
}, []);
|
|
@@ -27194,7 +27201,7 @@ function RbacByRoleContainer() {
|
|
|
27194
27201
|
if (!matrix) return [];
|
|
27195
27202
|
return Object.keys(matrix).sort((a, b) => (moduleNames?.[a] ?? a).localeCompare(moduleNames?.[b] ?? b));
|
|
27196
27203
|
}, [matrix, moduleNames]);
|
|
27197
|
-
|
|
27204
|
+
useEffect87(() => {
|
|
27198
27205
|
if (!selectedRoleId && sortedRoleIds.length > 0) {
|
|
27199
27206
|
setSelectedRoleId(sortedRoleIds[0]);
|
|
27200
27207
|
}
|
|
@@ -27915,4 +27922,4 @@ export {
|
|
|
27915
27922
|
useOAuthClients,
|
|
27916
27923
|
useOAuthClient
|
|
27917
27924
|
};
|
|
27918
|
-
//# sourceMappingURL=chunk-
|
|
27925
|
+
//# sourceMappingURL=chunk-3W3VVX2N.mjs.map
|