@carlonicora/nextjs-jsonapi 1.122.0 → 1.123.1
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-AY23XLHO.mjs → BlockNoteEditor-4UBKHQHZ.mjs} +2 -2
- package/dist/{BlockNoteEditor-ICKHUZYK.js → BlockNoteEditor-JWE5R6TH.js} +9 -9
- package/dist/{BlockNoteEditor-ICKHUZYK.js.map → BlockNoteEditor-JWE5R6TH.js.map} +1 -1
- package/dist/billing/index.js +299 -299
- package/dist/billing/index.mjs +1 -1
- package/dist/{chunk-5RS7Z4YW.js → chunk-NHTN4LWQ.js} +337 -311
- package/dist/chunk-NHTN4LWQ.js.map +1 -0
- package/dist/{chunk-IRVHKT5I.mjs → chunk-WDWU5VJ5.mjs} +402 -376
- package/dist/chunk-WDWU5VJ5.mjs.map +1 -0
- package/dist/client/index.js +2 -2
- package/dist/client/index.mjs +1 -1
- package/dist/components/index.d.mts +2 -2
- package/dist/components/index.d.ts +2 -2
- 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/help/index.js +30 -30
- package/dist/features/help/index.mjs +1 -1
- package/package.json +1 -1
- package/src/components/containers/RoundPageContainerTitle.tsx +7 -4
- package/src/shadcnui/ui/tabs.tsx +48 -10
- package/dist/chunk-5RS7Z4YW.js.map +0 -1
- package/dist/chunk-IRVHKT5I.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-AY23XLHO.mjs.map → BlockNoteEditor-4UBKHQHZ.mjs.map} +0 -0
|
@@ -4416,17 +4416,34 @@ __name(TableCaption, "TableCaption");
|
|
|
4416
4416
|
// src/shadcnui/ui/tabs.tsx
|
|
4417
4417
|
import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
|
|
4418
4418
|
import { cva as cva9 } from "class-variance-authority";
|
|
4419
|
+
import { createContext as createContext4, useContext as useContext5, useState as useState4 } from "react";
|
|
4419
4420
|
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
4420
|
-
|
|
4421
|
-
|
|
4421
|
+
var TabsActiveValueContext = createContext4(void 0);
|
|
4422
|
+
function Tabs({
|
|
4423
|
+
className,
|
|
4424
|
+
orientation = "horizontal",
|
|
4425
|
+
value,
|
|
4426
|
+
defaultValue,
|
|
4427
|
+
onValueChange,
|
|
4428
|
+
...props
|
|
4429
|
+
}) {
|
|
4430
|
+
const [uncontrolledValue, setUncontrolledValue] = useState4(defaultValue);
|
|
4431
|
+
const activeValue = value !== void 0 ? value : uncontrolledValue;
|
|
4432
|
+
return /* @__PURE__ */ jsx45(TabsActiveValueContext.Provider, { value: activeValue, children: /* @__PURE__ */ jsx45(
|
|
4422
4433
|
TabsPrimitive.Root,
|
|
4423
4434
|
{
|
|
4424
4435
|
"data-slot": "tabs",
|
|
4425
4436
|
"data-orientation": orientation,
|
|
4426
4437
|
className: cn("gap-2 group/tabs flex data-[orientation=horizontal]:flex-col", className),
|
|
4438
|
+
value,
|
|
4439
|
+
defaultValue,
|
|
4440
|
+
onValueChange: (newValue, eventDetails) => {
|
|
4441
|
+
setUncontrolledValue(newValue);
|
|
4442
|
+
onValueChange?.(newValue, eventDetails);
|
|
4443
|
+
},
|
|
4427
4444
|
...props
|
|
4428
4445
|
}
|
|
4429
|
-
);
|
|
4446
|
+
) });
|
|
4430
4447
|
}
|
|
4431
4448
|
__name(Tabs, "Tabs");
|
|
4432
4449
|
var tabsListVariants = cva9(
|
|
@@ -4476,13 +4493,21 @@ function TabsTrigger({ className, ...props }) {
|
|
|
4476
4493
|
);
|
|
4477
4494
|
}
|
|
4478
4495
|
__name(TabsTrigger, "TabsTrigger");
|
|
4479
|
-
function TabsContent({ className, ...props }) {
|
|
4496
|
+
function TabsContent({ className, value, keepMounted, children, ...props }) {
|
|
4497
|
+
const activeValue = useContext5(TabsActiveValueContext);
|
|
4498
|
+
const isActive = activeValue !== void 0 && activeValue === value;
|
|
4499
|
+
const [hasBeenActive, setHasBeenActive] = useState4(isActive);
|
|
4500
|
+
if (isActive && !hasBeenActive) setHasBeenActive(true);
|
|
4501
|
+
const shouldRenderChildren = !keepMounted || activeValue === void 0 || hasBeenActive;
|
|
4480
4502
|
return /* @__PURE__ */ jsx45(
|
|
4481
4503
|
TabsPrimitive.Panel,
|
|
4482
4504
|
{
|
|
4483
4505
|
"data-slot": "tabs-content",
|
|
4506
|
+
value,
|
|
4507
|
+
keepMounted,
|
|
4484
4508
|
className: cn("text-xs/relaxed flex-1 outline-none", className),
|
|
4485
|
-
...props
|
|
4509
|
+
...props,
|
|
4510
|
+
children: shouldRenderChildren ? children : null
|
|
4486
4511
|
}
|
|
4487
4512
|
);
|
|
4488
4513
|
}
|
|
@@ -6151,7 +6176,7 @@ __name(EntityAvatar, "EntityAvatar");
|
|
|
6151
6176
|
|
|
6152
6177
|
// src/features/company/contexts/CompanyContext.tsx
|
|
6153
6178
|
import { useTranslations as useTranslations38 } from "next-intl";
|
|
6154
|
-
import { Fragment as Fragment19, createContext as
|
|
6179
|
+
import { Fragment as Fragment19, createContext as createContext10, useContext as useContext11, useState as useState35 } from "react";
|
|
6155
6180
|
|
|
6156
6181
|
// src/hooks/TableGeneratorRegistry.ts
|
|
6157
6182
|
var TableGeneratorRegistry = class _TableGeneratorRegistry {
|
|
@@ -6259,14 +6284,14 @@ function useUrlRewriter() {
|
|
|
6259
6284
|
__name(useUrlRewriter, "useUrlRewriter");
|
|
6260
6285
|
|
|
6261
6286
|
// src/hooks/useDataListRetriever.ts
|
|
6262
|
-
import { useCallback as useCallback7, useEffect as useEffect6, useMemo as useMemo7, useRef as useRef6, useState as
|
|
6287
|
+
import { useCallback as useCallback7, useEffect as useEffect6, useMemo as useMemo7, useRef as useRef6, useState as useState8 } from "react";
|
|
6263
6288
|
function useDataListRetriever(params) {
|
|
6264
|
-
const [data, setData] =
|
|
6265
|
-
const [total, setTotal] =
|
|
6266
|
-
const [nextPage, setNextPage] =
|
|
6267
|
-
const [previousPage, setPreviousPage] =
|
|
6268
|
-
const [isLoaded, setIsLoaded] =
|
|
6269
|
-
const [ready, setReady] =
|
|
6289
|
+
const [data, setData] = useState8(void 0);
|
|
6290
|
+
const [total, setTotal] = useState8(void 0);
|
|
6291
|
+
const [nextPage, setNextPage] = useState8(void 0);
|
|
6292
|
+
const [previousPage, setPreviousPage] = useState8(void 0);
|
|
6293
|
+
const [isLoaded, setIsLoaded] = useState8(false);
|
|
6294
|
+
const [ready, setReady] = useState8(params.ready ?? true);
|
|
6270
6295
|
const searchTermRef = useRef6("");
|
|
6271
6296
|
const additionalParamsRef = useRef6({});
|
|
6272
6297
|
const requestIdRef = useRef6(0);
|
|
@@ -7374,16 +7399,16 @@ function usePushNotifications() {
|
|
|
7374
7399
|
__name(usePushNotifications, "usePushNotifications");
|
|
7375
7400
|
|
|
7376
7401
|
// src/hooks/useSocket.ts
|
|
7377
|
-
import { useEffect as useEffect12, useRef as useRef9, useState as
|
|
7402
|
+
import { useEffect as useEffect12, useRef as useRef9, useState as useState9 } from "react";
|
|
7378
7403
|
import io from "socket.io-client";
|
|
7379
7404
|
function useSocket({ token }) {
|
|
7380
7405
|
const _errorCount = useRef9(0);
|
|
7381
7406
|
const shouldConnect = useRef9(true);
|
|
7382
7407
|
const _hookInstanceId = useRef9(Math.random().toString(36).substring(2, 11));
|
|
7383
|
-
const [socket, setSocket] =
|
|
7384
|
-
const [isConnected, setIsConnected] =
|
|
7385
|
-
const [messages, setMessages] =
|
|
7386
|
-
const [socketNotifications, setSocketNotifications] =
|
|
7408
|
+
const [socket, setSocket] = useState9(null);
|
|
7409
|
+
const [isConnected, setIsConnected] = useState9(false);
|
|
7410
|
+
const [messages, setMessages] = useState9([]);
|
|
7411
|
+
const [socketNotifications, setSocketNotifications] = useState9([]);
|
|
7387
7412
|
const socketRef = useRef9(null);
|
|
7388
7413
|
useEffect12(() => {
|
|
7389
7414
|
if (!token) return;
|
|
@@ -7529,10 +7554,10 @@ __name(useSocket, "useSocket");
|
|
|
7529
7554
|
import { useAtom as useAtom2 } from "jotai";
|
|
7530
7555
|
import { atomWithStorage as atomWithStorage2 } from "jotai/utils";
|
|
7531
7556
|
import { usePathname as usePathname2 } from "next/navigation";
|
|
7532
|
-
import { createContext as
|
|
7557
|
+
import { createContext as createContext7, useCallback as useCallback10, useContext as useContext8, useEffect as useEffect13, useRef as useRef10, useState as useState10 } from "react";
|
|
7533
7558
|
|
|
7534
7559
|
// src/contexts/SocketContext.tsx
|
|
7535
|
-
import { createContext as
|
|
7560
|
+
import { createContext as createContext6, useContext as useContext7 } from "react";
|
|
7536
7561
|
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
7537
7562
|
var defaultContextValue = {
|
|
7538
7563
|
socket: null,
|
|
@@ -7550,7 +7575,7 @@ var defaultContextValue = {
|
|
|
7550
7575
|
clearSocketNotifications: /* @__PURE__ */ __name(() => {
|
|
7551
7576
|
}, "clearSocketNotifications")
|
|
7552
7577
|
};
|
|
7553
|
-
var SocketContext =
|
|
7578
|
+
var SocketContext = createContext6(defaultContextValue);
|
|
7554
7579
|
var SocketProvider = /* @__PURE__ */ __name(({ token, children }) => {
|
|
7555
7580
|
const socketHookData = token ? useSocket({ token }) : null;
|
|
7556
7581
|
const sendMessage = /* @__PURE__ */ __name((event, data) => {
|
|
@@ -7568,7 +7593,7 @@ var SocketProvider = /* @__PURE__ */ __name(({ token, children }) => {
|
|
|
7568
7593
|
return /* @__PURE__ */ jsx53(SocketContext.Provider, { value, children });
|
|
7569
7594
|
}, "SocketProvider");
|
|
7570
7595
|
var useSocketContext = /* @__PURE__ */ __name(() => {
|
|
7571
|
-
const context =
|
|
7596
|
+
const context = useContext7(SocketContext);
|
|
7572
7597
|
if (!context) {
|
|
7573
7598
|
throw new Error("useSocketContext must be used within a SocketProvider");
|
|
7574
7599
|
}
|
|
@@ -7578,7 +7603,7 @@ var useSocketContext = /* @__PURE__ */ __name(() => {
|
|
|
7578
7603
|
// src/features/user/contexts/CurrentUserContext.tsx
|
|
7579
7604
|
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
7580
7605
|
var userAtom = atomWithStorage2("user", null);
|
|
7581
|
-
var CurrentUserContext =
|
|
7606
|
+
var CurrentUserContext = createContext7(void 0);
|
|
7582
7607
|
var CurrentUserProvider = /* @__PURE__ */ __name(({ children }) => {
|
|
7583
7608
|
const path = usePathname2();
|
|
7584
7609
|
const [dehydratedUser, setDehydratedUser] = useAtom2(userAtom);
|
|
@@ -7634,7 +7659,7 @@ var CurrentUserProvider = /* @__PURE__ */ __name(({ children }) => {
|
|
|
7634
7659
|
return response;
|
|
7635
7660
|
}
|
|
7636
7661
|
__name(hasPermissionToPath, "hasPermissionToPath");
|
|
7637
|
-
const [isRefreshing, setIsRefreshing] =
|
|
7662
|
+
const [isRefreshing, setIsRefreshing] = useState10(false);
|
|
7638
7663
|
const refreshUser = useCallback10(
|
|
7639
7664
|
async (options) => {
|
|
7640
7665
|
if (isRefreshing) {
|
|
@@ -7710,7 +7735,7 @@ var CurrentUserProvider = /* @__PURE__ */ __name(({ children }) => {
|
|
|
7710
7735
|
);
|
|
7711
7736
|
}, "CurrentUserProvider");
|
|
7712
7737
|
function useCurrentUserContext() {
|
|
7713
|
-
const context =
|
|
7738
|
+
const context = useContext8(CurrentUserContext);
|
|
7714
7739
|
if (context === void 0) {
|
|
7715
7740
|
throw new Error("useCurrentUserContext must be used within a UserProvider");
|
|
7716
7741
|
}
|
|
@@ -7720,18 +7745,18 @@ __name(useCurrentUserContext, "useCurrentUserContext");
|
|
|
7720
7745
|
|
|
7721
7746
|
// src/features/user/contexts/UserContext.tsx
|
|
7722
7747
|
import { useTranslations as useTranslations21 } from "next-intl";
|
|
7723
|
-
import { createContext as
|
|
7748
|
+
import { createContext as createContext9, useContext as useContext10, useState as useState32 } from "react";
|
|
7724
7749
|
|
|
7725
7750
|
// src/features/user/components/forms/RoleUserAdd.tsx
|
|
7726
7751
|
import { useTranslations } from "next-intl";
|
|
7727
|
-
import { useEffect as useEffect14, useState as
|
|
7752
|
+
import { useEffect as useEffect14, useState as useState11 } from "react";
|
|
7728
7753
|
import { Fragment as Fragment5, jsx as jsx55, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
7729
7754
|
function AddUserToRoleInternal({ role, refresh }) {
|
|
7730
7755
|
const { company } = useCurrentUserContext();
|
|
7731
|
-
const [show, setShow] =
|
|
7732
|
-
const [users, setUsers] =
|
|
7756
|
+
const [show, setShow] = useState11(false);
|
|
7757
|
+
const [users, setUsers] = useState11([]);
|
|
7733
7758
|
const t = useTranslations();
|
|
7734
|
-
const [existingUsers, setExistingUsers] =
|
|
7759
|
+
const [existingUsers, setExistingUsers] = useState11(null);
|
|
7735
7760
|
useEffect14(() => {
|
|
7736
7761
|
const fetchExistingUsers = /* @__PURE__ */ __name(async () => {
|
|
7737
7762
|
setExistingUsers(await UserService.findMany({ roleId: role.id, fetchAll: true }));
|
|
@@ -7800,10 +7825,10 @@ __name(AddUserToRole, "AddUserToRole");
|
|
|
7800
7825
|
import { UploadIcon } from "lucide-react";
|
|
7801
7826
|
import { useTranslations as useTranslations2 } from "next-intl";
|
|
7802
7827
|
import Image from "next/image";
|
|
7803
|
-
import { useEffect as useEffect15, useState as
|
|
7828
|
+
import { useEffect as useEffect15, useState as useState12 } from "react";
|
|
7804
7829
|
import { jsx as jsx56, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
7805
7830
|
function UserAvatarEditor({ user, file, setFile, resetImage, setResetImage }) {
|
|
7806
|
-
const [files, setFiles] =
|
|
7831
|
+
const [files, setFiles] = useState12(null);
|
|
7807
7832
|
const t = useTranslations2();
|
|
7808
7833
|
useEffect15(() => {
|
|
7809
7834
|
if (files && files.length > 0) {
|
|
@@ -7893,7 +7918,7 @@ __name(UserDeleter, "UserDeleter");
|
|
|
7893
7918
|
// src/features/user/components/forms/UserEditor.tsx
|
|
7894
7919
|
import { zodResolver } from "@hookform/resolvers/zod";
|
|
7895
7920
|
import { useTranslations as useTranslations4 } from "next-intl";
|
|
7896
|
-
import { useCallback as useCallback11, useEffect as useEffect16, useMemo as useMemo9, useState as
|
|
7921
|
+
import { useCallback as useCallback11, useEffect as useEffect16, useMemo as useMemo9, useState as useState13 } from "react";
|
|
7897
7922
|
import { useForm } from "react-hook-form";
|
|
7898
7923
|
import { v4 } from "uuid";
|
|
7899
7924
|
import { z } from "zod";
|
|
@@ -7918,12 +7943,12 @@ function UserEditorInternal({
|
|
|
7918
7943
|
} = useCurrentUserContext();
|
|
7919
7944
|
const { company: companyFromContext } = useCompanyContext();
|
|
7920
7945
|
const router = useI18nRouter();
|
|
7921
|
-
const [roles, setRoles] =
|
|
7922
|
-
const [file, setFile] =
|
|
7923
|
-
const [contentType, setContentType] =
|
|
7924
|
-
const [resetImage, setResetImage] =
|
|
7946
|
+
const [roles, setRoles] = useState13([]);
|
|
7947
|
+
const [file, setFile] = useState13(null);
|
|
7948
|
+
const [contentType, setContentType] = useState13(null);
|
|
7949
|
+
const [resetImage, setResetImage] = useState13(false);
|
|
7925
7950
|
const t = useTranslations4();
|
|
7926
|
-
const [company, setCompany] =
|
|
7951
|
+
const [company, setCompany] = useState13(companyFromContext || userCompany);
|
|
7927
7952
|
useEffect16(() => {
|
|
7928
7953
|
if (!companyFromContext && userCompany) setCompany(userCompany);
|
|
7929
7954
|
}, [company]);
|
|
@@ -8165,7 +8190,7 @@ __name(UserEditor, "UserEditor");
|
|
|
8165
8190
|
import { useTranslations as useTranslations5 } from "next-intl";
|
|
8166
8191
|
|
|
8167
8192
|
// src/components/forms/EntityMultiSelector.tsx
|
|
8168
|
-
import { useCallback as useCallback12, useEffect as useEffect17, useMemo as useMemo10, useRef as useRef11, useState as
|
|
8193
|
+
import { useCallback as useCallback12, useEffect as useEffect17, useMemo as useMemo10, useRef as useRef11, useState as useState14 } from "react";
|
|
8169
8194
|
import { useWatch } from "react-hook-form";
|
|
8170
8195
|
import { CheckIcon as CheckIcon8, ChevronDownIcon as ChevronDownIcon7, SearchIcon as SearchIcon2, XIcon as XIcon5 } from "lucide-react";
|
|
8171
8196
|
|
|
@@ -8224,9 +8249,9 @@ function EntityMultiSelector({
|
|
|
8224
8249
|
onChange,
|
|
8225
8250
|
renderOption
|
|
8226
8251
|
}) {
|
|
8227
|
-
const [open, setOpen] =
|
|
8228
|
-
const [searchTerm, setSearchTerm] =
|
|
8229
|
-
const [options, setOptions] =
|
|
8252
|
+
const [open, setOpen] = useState14(false);
|
|
8253
|
+
const [searchTerm, setSearchTerm] = useState14("");
|
|
8254
|
+
const [options, setOptions] = useState14([]);
|
|
8230
8255
|
const searchInputRef = useRef11(null);
|
|
8231
8256
|
const getLabelRef = useRef11(getLabel);
|
|
8232
8257
|
const toFormValueRef = useRef11(toFormValue);
|
|
@@ -8482,10 +8507,10 @@ __name(UserMultiSelect, "UserMultiSelect");
|
|
|
8482
8507
|
// src/features/user/components/forms/UserReactivator.tsx
|
|
8483
8508
|
import { UserCheckIcon } from "lucide-react";
|
|
8484
8509
|
import { useTranslations as useTranslations6 } from "next-intl";
|
|
8485
|
-
import { useState as
|
|
8510
|
+
import { useState as useState15 } from "react";
|
|
8486
8511
|
import { jsx as jsx62, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
8487
8512
|
function UserReactivatorInterface({ user, propagateChanges }) {
|
|
8488
|
-
const [open, setOpen] =
|
|
8513
|
+
const [open, setOpen] = useState15(false);
|
|
8489
8514
|
const t = useTranslations6();
|
|
8490
8515
|
const reactivateUser = /* @__PURE__ */ __name(async () => {
|
|
8491
8516
|
try {
|
|
@@ -8535,10 +8560,10 @@ __name(UserReactivator, "UserReactivator");
|
|
|
8535
8560
|
// src/features/user/components/forms/UserResentInvitationEmail.tsx
|
|
8536
8561
|
import { MailIcon } from "lucide-react";
|
|
8537
8562
|
import { useTranslations as useTranslations7 } from "next-intl";
|
|
8538
|
-
import { useState as
|
|
8563
|
+
import { useState as useState16 } from "react";
|
|
8539
8564
|
import { jsx as jsx63, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
8540
8565
|
function UserResentInvitationEmailInternal({ user }) {
|
|
8541
|
-
const [open, setOpen] =
|
|
8566
|
+
const [open, setOpen] = useState16(false);
|
|
8542
8567
|
const t = useTranslations7();
|
|
8543
8568
|
const sendInvitationEmail = /* @__PURE__ */ __name(async () => {
|
|
8544
8569
|
try {
|
|
@@ -8590,11 +8615,11 @@ __name(UserResentInvitationEmail, "UserResentInvitationEmail");
|
|
|
8590
8615
|
// src/features/user/components/forms/UserSelector.tsx
|
|
8591
8616
|
import { CircleX, RefreshCwIcon as RefreshCwIcon2, SearchIcon as SearchIcon4, XIcon as XIcon8 } from "lucide-react";
|
|
8592
8617
|
import { useTranslations as useTranslations20 } from "next-intl";
|
|
8593
|
-
import { useCallback as useCallback18, useEffect as useEffect27, useRef as useRef18, useState as
|
|
8618
|
+
import { useCallback as useCallback18, useEffect as useEffect27, useRef as useRef18, useState as useState31 } from "react";
|
|
8594
8619
|
|
|
8595
8620
|
// src/components/forms/CommonAssociationForm.tsx
|
|
8596
8621
|
import { useTranslations as useTranslations8 } from "next-intl";
|
|
8597
|
-
import { useCallback as useCallback13, useEffect as useEffect18, useRef as useRef12, useState as
|
|
8622
|
+
import { useCallback as useCallback13, useEffect as useEffect18, useRef as useRef12, useState as useState17 } from "react";
|
|
8598
8623
|
import { jsx as jsx64, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
8599
8624
|
function CommonAssociationTrigger({
|
|
8600
8625
|
sourceType,
|
|
@@ -8622,7 +8647,7 @@ function CommonAssociationCommandDialog({
|
|
|
8622
8647
|
}) {
|
|
8623
8648
|
const t = useTranslations8();
|
|
8624
8649
|
const searchTermRef = useRef12("");
|
|
8625
|
-
const [searchTerm, setSearchTerm] =
|
|
8650
|
+
const [searchTerm, setSearchTerm] = useState17("");
|
|
8626
8651
|
const refreshList = useCallback13(
|
|
8627
8652
|
async (searchedTerm) => {
|
|
8628
8653
|
if (searchedTerm === searchTermRef.current) return;
|
|
@@ -8701,7 +8726,7 @@ var triggerAssociationToast = /* @__PURE__ */ __name((params) => {
|
|
|
8701
8726
|
|
|
8702
8727
|
// src/components/forms/CommonDeleter.tsx
|
|
8703
8728
|
import { LoaderCircleIcon, Trash2Icon } from "lucide-react";
|
|
8704
|
-
import { useState as
|
|
8729
|
+
import { useState as useState18 } from "react";
|
|
8705
8730
|
|
|
8706
8731
|
// src/components/errors/ErrorDetails.tsx
|
|
8707
8732
|
import Image2 from "next/image";
|
|
@@ -8757,8 +8782,8 @@ function CommonDeleter({
|
|
|
8757
8782
|
}) {
|
|
8758
8783
|
const t = useI18nTranslations();
|
|
8759
8784
|
const router = useI18nRouter();
|
|
8760
|
-
const [open, setOpen] =
|
|
8761
|
-
const [isDeleting, setIsDeleting] =
|
|
8785
|
+
const [open, setOpen] = useState18(forceShow || false);
|
|
8786
|
+
const [isDeleting, setIsDeleting] = useState18(false);
|
|
8762
8787
|
const handleDelete = /* @__PURE__ */ __name(async () => {
|
|
8763
8788
|
setIsDeleting(true);
|
|
8764
8789
|
try {
|
|
@@ -8926,10 +8951,10 @@ var CommonAddTrigger = React15.forwardRef(
|
|
|
8926
8951
|
CommonAddTrigger.displayName = "CommonAddTrigger";
|
|
8927
8952
|
|
|
8928
8953
|
// src/components/forms/useEditorDialog.ts
|
|
8929
|
-
import { useCallback as useCallback14, useEffect as useEffect19, useState as
|
|
8954
|
+
import { useCallback as useCallback14, useEffect as useEffect19, useState as useState19 } from "react";
|
|
8930
8955
|
function useEditorDialog(isFormDirty, options) {
|
|
8931
|
-
const [open, setOpen] =
|
|
8932
|
-
const [showDiscardConfirm, setShowDiscardConfirm] =
|
|
8956
|
+
const [open, setOpen] = useState19(false);
|
|
8957
|
+
const [showDiscardConfirm, setShowDiscardConfirm] = useState19(false);
|
|
8933
8958
|
useEffect19(() => {
|
|
8934
8959
|
if (options?.dialogOpen !== void 0) {
|
|
8935
8960
|
setOpen(options.dialogOpen);
|
|
@@ -9141,7 +9166,7 @@ __name(EditorSheet, "EditorSheet");
|
|
|
9141
9166
|
// src/components/forms/DatePickerPopover.tsx
|
|
9142
9167
|
import { isValid, parse } from "date-fns";
|
|
9143
9168
|
import { Calendar as CalendarIcon, CircleXIcon } from "lucide-react";
|
|
9144
|
-
import { useMemo as useMemo11, useState as
|
|
9169
|
+
import { useMemo as useMemo11, useState as useState20 } from "react";
|
|
9145
9170
|
import { jsx as jsx72, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
9146
9171
|
var DatePickerPopover = /* @__PURE__ */ __name(({
|
|
9147
9172
|
children,
|
|
@@ -9153,8 +9178,8 @@ var DatePickerPopover = /* @__PURE__ */ __name(({
|
|
|
9153
9178
|
}) => {
|
|
9154
9179
|
const locale = useI18nLocale();
|
|
9155
9180
|
const dateFnsLocale = useI18nDateFnsLocale();
|
|
9156
|
-
const [isOpen, setIsOpen] =
|
|
9157
|
-
const [displayMonth, setDisplayMonth] =
|
|
9181
|
+
const [isOpen, setIsOpen] = useState20(false);
|
|
9182
|
+
const [displayMonth, setDisplayMonth] = useState20(() => value || /* @__PURE__ */ new Date());
|
|
9158
9183
|
const dateFormatter = useMemo11(
|
|
9159
9184
|
() => new Intl.DateTimeFormat(locale, { day: "2-digit", month: "2-digit", year: "numeric" }),
|
|
9160
9185
|
[locale]
|
|
@@ -9178,7 +9203,7 @@ var DatePickerPopover = /* @__PURE__ */ __name(({
|
|
|
9178
9203
|
return part.value;
|
|
9179
9204
|
}).join("");
|
|
9180
9205
|
}, [dateFormatter]);
|
|
9181
|
-
const [inputValue, setInputValue] =
|
|
9206
|
+
const [inputValue, setInputValue] = useState20(() => value ? formatDate(value) : "");
|
|
9182
9207
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
9183
9208
|
const yearOptions = Array.from({ length: currentYear - 1900 + 11 }, (_, i) => 1900 + i);
|
|
9184
9209
|
const monthNames = useMemo11(() => {
|
|
@@ -9303,22 +9328,22 @@ var DatePickerPopover = /* @__PURE__ */ __name(({
|
|
|
9303
9328
|
import { format } from "date-fns";
|
|
9304
9329
|
import { CalendarIcon as CalendarIcon2 } from "lucide-react";
|
|
9305
9330
|
import { useTranslations as useTranslations14 } from "next-intl";
|
|
9306
|
-
import { useEffect as useEffect21, useState as
|
|
9331
|
+
import { useEffect as useEffect21, useState as useState21 } from "react";
|
|
9307
9332
|
import { Fragment as Fragment10, jsx as jsx73, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
9308
9333
|
function DateRangeSelector({ onDateChange, avoidSettingDates, showPreviousMonth }) {
|
|
9309
9334
|
const t = useTranslations14();
|
|
9310
|
-
const [date, setDate] =
|
|
9335
|
+
const [date, setDate] = useState21(
|
|
9311
9336
|
avoidSettingDates ? void 0 : {
|
|
9312
9337
|
from: new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1),
|
|
9313
9338
|
to: new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth() + 1, 0)
|
|
9314
9339
|
}
|
|
9315
9340
|
);
|
|
9316
|
-
const [open, setOpen] =
|
|
9317
|
-
const [mounted, setMounted] =
|
|
9341
|
+
const [open, setOpen] = useState21(false);
|
|
9342
|
+
const [mounted, setMounted] = useState21(false);
|
|
9318
9343
|
useEffect21(() => {
|
|
9319
9344
|
setMounted(true);
|
|
9320
9345
|
}, []);
|
|
9321
|
-
const [prevRange, setPrevRange] =
|
|
9346
|
+
const [prevRange, setPrevRange] = useState21(date);
|
|
9322
9347
|
useEffect21(() => {
|
|
9323
9348
|
if (date?.from && date?.to && date.to > date.from && (prevRange?.from?.getTime() !== date.from.getTime() || prevRange?.to?.getTime() !== date.to.getTime())) {
|
|
9324
9349
|
onDateChange(date);
|
|
@@ -9413,20 +9438,20 @@ __name(DateRangeSelector, "DateRangeSelector");
|
|
|
9413
9438
|
import { Trash2 as RemoveIcon } from "lucide-react";
|
|
9414
9439
|
import { useTranslations as useTranslations15 } from "next-intl";
|
|
9415
9440
|
import {
|
|
9416
|
-
createContext as
|
|
9441
|
+
createContext as createContext8,
|
|
9417
9442
|
forwardRef as forwardRef6,
|
|
9418
9443
|
useCallback as useCallback16,
|
|
9419
|
-
useContext as
|
|
9444
|
+
useContext as useContext9,
|
|
9420
9445
|
useEffect as useEffect22,
|
|
9421
9446
|
useMemo as useMemo12,
|
|
9422
9447
|
useRef as useRef14,
|
|
9423
|
-
useState as
|
|
9448
|
+
useState as useState22
|
|
9424
9449
|
} from "react";
|
|
9425
9450
|
import { useDropzone } from "react-dropzone";
|
|
9426
9451
|
import { jsx as jsx74, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
9427
|
-
var FileUploaderContext =
|
|
9452
|
+
var FileUploaderContext = createContext8(null);
|
|
9428
9453
|
var useFileUpload = /* @__PURE__ */ __name(() => {
|
|
9429
|
-
const context =
|
|
9454
|
+
const context = useContext9(FileUploaderContext);
|
|
9430
9455
|
if (!context) {
|
|
9431
9456
|
throw new Error("useFileUpload must be used within a FileUploaderProvider");
|
|
9432
9457
|
}
|
|
@@ -9434,9 +9459,9 @@ var useFileUpload = /* @__PURE__ */ __name(() => {
|
|
|
9434
9459
|
}, "useFileUpload");
|
|
9435
9460
|
var FileUploader = forwardRef6(
|
|
9436
9461
|
({ className, dropzoneOptions, value, onValueChange, reSelect, orientation = "vertical", children, dir, ...props }, ref) => {
|
|
9437
|
-
const [isFileTooBig, setIsFileTooBig] =
|
|
9438
|
-
const [isLOF, setIsLOF] =
|
|
9439
|
-
const [activeIndex, setActiveIndex] =
|
|
9462
|
+
const [isFileTooBig, setIsFileTooBig] = useState22(false);
|
|
9463
|
+
const [isLOF, setIsLOF] = useState22(false);
|
|
9464
|
+
const [activeIndex, setActiveIndex] = useState22(-1);
|
|
9440
9465
|
const { maxFiles = 1, maxSize = 4 * 1024 * 1024, multiple = true } = dropzoneOptions;
|
|
9441
9466
|
const t = useTranslations15();
|
|
9442
9467
|
const reSelectAll = maxFiles === 1 ? true : reSelect;
|
|
@@ -9705,7 +9730,7 @@ var FileInput = forwardRef6(
|
|
|
9705
9730
|
FileInput.displayName = "FileInput";
|
|
9706
9731
|
|
|
9707
9732
|
// src/components/forms/CurrencyInput.tsx
|
|
9708
|
-
import { useState as
|
|
9733
|
+
import { useState as useState23 } from "react";
|
|
9709
9734
|
import { jsx as jsx75, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
9710
9735
|
function centsToInput(cents) {
|
|
9711
9736
|
return (cents / 100).toFixed(2);
|
|
@@ -9751,7 +9776,7 @@ function CurrencyInput({
|
|
|
9751
9776
|
className,
|
|
9752
9777
|
testId
|
|
9753
9778
|
}) {
|
|
9754
|
-
const [draft, setDraft] =
|
|
9779
|
+
const [draft, setDraft] = useState23(null);
|
|
9755
9780
|
const display = draft !== null ? draft : centsToInput(valueCents);
|
|
9756
9781
|
const handleChange = /* @__PURE__ */ __name((e) => {
|
|
9757
9782
|
setDraft(sanitizeKeystroke(e.target.value));
|
|
@@ -9813,7 +9838,7 @@ import { useRef as useRef15 } from "react";
|
|
|
9813
9838
|
import dynamic from "next/dynamic";
|
|
9814
9839
|
import React17 from "react";
|
|
9815
9840
|
import { jsx as jsx77 } from "react/jsx-runtime";
|
|
9816
|
-
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-
|
|
9841
|
+
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-4UBKHQHZ.mjs"), {
|
|
9817
9842
|
ssr: false
|
|
9818
9843
|
});
|
|
9819
9844
|
var BlockNoteEditorContainer = React17.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
|
|
@@ -9907,7 +9932,7 @@ __name(FormBlockNote, "FormBlockNote");
|
|
|
9907
9932
|
// src/components/forms/FormDate.tsx
|
|
9908
9933
|
import { isValid as isValid2, parse as parse2 } from "date-fns";
|
|
9909
9934
|
import { Calendar as CalendarIcon3, CircleXIcon as CircleXIcon2 } from "lucide-react";
|
|
9910
|
-
import { useMemo as useMemo13, useState as
|
|
9935
|
+
import { useMemo as useMemo13, useState as useState24 } from "react";
|
|
9911
9936
|
import { jsx as jsx79, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
9912
9937
|
function FormDate({
|
|
9913
9938
|
form,
|
|
@@ -9924,8 +9949,8 @@ function FormDate({
|
|
|
9924
9949
|
const t = useI18nTranslations();
|
|
9925
9950
|
const locale = useI18nLocale();
|
|
9926
9951
|
const dateFnsLocale = useI18nDateFnsLocale();
|
|
9927
|
-
const [open, setOpen] =
|
|
9928
|
-
const [displayMonth, setDisplayMonth] =
|
|
9952
|
+
const [open, setOpen] = useState24(false);
|
|
9953
|
+
const [displayMonth, setDisplayMonth] = useState24(() => {
|
|
9929
9954
|
const currentValue = form.getValues(id);
|
|
9930
9955
|
return currentValue || defaultMonth || /* @__PURE__ */ new Date();
|
|
9931
9956
|
});
|
|
@@ -9952,7 +9977,7 @@ function FormDate({
|
|
|
9952
9977
|
return part.value;
|
|
9953
9978
|
}).join("");
|
|
9954
9979
|
}, [dateFormatter]);
|
|
9955
|
-
const [inputValue, setInputValue] =
|
|
9980
|
+
const [inputValue, setInputValue] = useState24(() => {
|
|
9956
9981
|
const currentValue = form.getValues(id);
|
|
9957
9982
|
return currentValue ? formatDate(currentValue) : "";
|
|
9958
9983
|
});
|
|
@@ -10048,7 +10073,7 @@ __name(FormDate, "FormDate");
|
|
|
10048
10073
|
|
|
10049
10074
|
// src/components/forms/FormDateTime.tsx
|
|
10050
10075
|
import { Calendar as CalendarIcon4, CircleXIcon as CircleXIcon3 } from "lucide-react";
|
|
10051
|
-
import { useMemo as useMemo14, useState as
|
|
10076
|
+
import { useMemo as useMemo14, useState as useState25 } from "react";
|
|
10052
10077
|
import { jsx as jsx80, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
10053
10078
|
function FormDateTime({
|
|
10054
10079
|
form,
|
|
@@ -10062,11 +10087,11 @@ function FormDateTime({
|
|
|
10062
10087
|
isRequired,
|
|
10063
10088
|
description
|
|
10064
10089
|
}) {
|
|
10065
|
-
const [open, setOpen] =
|
|
10090
|
+
const [open, setOpen] = useState25(false);
|
|
10066
10091
|
const t = useI18nTranslations();
|
|
10067
10092
|
const locale = useI18nLocale();
|
|
10068
10093
|
const dateFnsLocale = useI18nDateFnsLocale();
|
|
10069
|
-
const [displayMonth, setDisplayMonth] =
|
|
10094
|
+
const [displayMonth, setDisplayMonth] = useState25(() => {
|
|
10070
10095
|
const currentValue = form.getValues(id);
|
|
10071
10096
|
return currentValue || defaultMonth || /* @__PURE__ */ new Date();
|
|
10072
10097
|
});
|
|
@@ -10082,8 +10107,8 @@ function FormDateTime({
|
|
|
10082
10107
|
[locale]
|
|
10083
10108
|
);
|
|
10084
10109
|
const formatDateTime = /* @__PURE__ */ __name((date) => dateTimeFormatter.format(date), "formatDateTime");
|
|
10085
|
-
const [selectedHours, setSelectedHours] =
|
|
10086
|
-
const [selectedMinutes, setSelectedMinutes] =
|
|
10110
|
+
const [selectedHours, setSelectedHours] = useState25((/* @__PURE__ */ new Date()).getHours());
|
|
10111
|
+
const [selectedMinutes, setSelectedMinutes] = useState25(roundToNearestFiveMinutes((/* @__PURE__ */ new Date()).getMinutes()));
|
|
10087
10112
|
const hoursOptions = Array.from({ length: 24 }, (_, i) => {
|
|
10088
10113
|
const hour = i;
|
|
10089
10114
|
return {
|
|
@@ -10416,7 +10441,7 @@ function FormPassword({
|
|
|
10416
10441
|
__name(FormPassword, "FormPassword");
|
|
10417
10442
|
|
|
10418
10443
|
// src/components/forms/FormPlaceAutocomplete.tsx
|
|
10419
|
-
import { useEffect as useEffect23, useRef as useRef16, useState as
|
|
10444
|
+
import { useEffect as useEffect23, useRef as useRef16, useState as useState27 } from "react";
|
|
10420
10445
|
import { jsx as jsx84, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
10421
10446
|
function FormPlaceAutocomplete({
|
|
10422
10447
|
form,
|
|
@@ -10432,12 +10457,12 @@ function FormPlaceAutocomplete({
|
|
|
10432
10457
|
includeTypes,
|
|
10433
10458
|
languageCode = "en"
|
|
10434
10459
|
}) {
|
|
10435
|
-
const [inputValue, setInputValue] =
|
|
10436
|
-
const [suggestions, setSuggestions] =
|
|
10437
|
-
const [isLoading, setIsLoading] =
|
|
10438
|
-
const [showSuggestions, setShowSuggestions] =
|
|
10439
|
-
const [loadError, setLoadError] =
|
|
10440
|
-
const [apiKey, setApiKey] =
|
|
10460
|
+
const [inputValue, setInputValue] = useState27("");
|
|
10461
|
+
const [suggestions, setSuggestions] = useState27([]);
|
|
10462
|
+
const [isLoading, setIsLoading] = useState27(false);
|
|
10463
|
+
const [showSuggestions, setShowSuggestions] = useState27(false);
|
|
10464
|
+
const [loadError, setLoadError] = useState27(false);
|
|
10465
|
+
const [apiKey, setApiKey] = useState27(null);
|
|
10441
10466
|
const debounceRef = useRef16(null);
|
|
10442
10467
|
const containerRef = useRef16(null);
|
|
10443
10468
|
useEffect23(() => {
|
|
@@ -10803,7 +10828,7 @@ __name(GdprConsentCheckbox, "GdprConsentCheckbox");
|
|
|
10803
10828
|
// src/components/forms/MultiFileUploader.tsx
|
|
10804
10829
|
import { FileIcon, FileImageIcon, FileSpreadsheetIcon, FileTextIcon, UploadIcon as UploadIcon2, XIcon as XIcon6 } from "lucide-react";
|
|
10805
10830
|
import Image3 from "next/image";
|
|
10806
|
-
import { useEffect as useEffect24, useState as
|
|
10831
|
+
import { useEffect as useEffect24, useState as useState28 } from "react";
|
|
10807
10832
|
import { jsx as jsx90, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
10808
10833
|
var dropzone = {
|
|
10809
10834
|
multiple: false,
|
|
@@ -10915,14 +10940,14 @@ __name(UserAvatarList, "UserAvatarList");
|
|
|
10915
10940
|
// src/features/user/components/widgets/UserSearchPopover.tsx
|
|
10916
10941
|
import { RefreshCwIcon, SearchIcon as SearchIcon3, XIcon as XIcon7 } from "lucide-react";
|
|
10917
10942
|
import { useTranslations as useTranslations19 } from "next-intl";
|
|
10918
|
-
import { useEffect as useEffect26, useState as
|
|
10943
|
+
import { useEffect as useEffect26, useState as useState30 } from "react";
|
|
10919
10944
|
|
|
10920
10945
|
// src/features/user/hooks/useUserSearch.ts
|
|
10921
|
-
import { useCallback as useCallback17, useEffect as useEffect25, useRef as useRef17, useState as
|
|
10946
|
+
import { useCallback as useCallback17, useEffect as useEffect25, useRef as useRef17, useState as useState29 } from "react";
|
|
10922
10947
|
var useUserSearch = /* @__PURE__ */ __name(() => {
|
|
10923
|
-
const [users, setUsers] =
|
|
10924
|
-
const [searchQuery, setSearchQuery] =
|
|
10925
|
-
const [isLoading, setIsLoading] =
|
|
10948
|
+
const [users, setUsers] = useState29([]);
|
|
10949
|
+
const [searchQuery, setSearchQuery] = useState29("");
|
|
10950
|
+
const [isLoading, setIsLoading] = useState29(false);
|
|
10926
10951
|
const searchQueryRef = useRef17("");
|
|
10927
10952
|
const loadUsers = useCallback17(
|
|
10928
10953
|
async (search) => {
|
|
@@ -11064,7 +11089,7 @@ var useUserTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
11064
11089
|
import { jsx as jsx95, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
11065
11090
|
var UserSearchPopover = /* @__PURE__ */ __name(({ children, onSelect, align = "start", className }) => {
|
|
11066
11091
|
const t = useTranslations19();
|
|
11067
|
-
const [isOpen, setIsOpen] =
|
|
11092
|
+
const [isOpen, setIsOpen] = useState30(false);
|
|
11068
11093
|
const { users, searchQuery, setSearchQuery, isLoading, loadUsers, clearSearch } = useUserSearch();
|
|
11069
11094
|
useEffect26(() => {
|
|
11070
11095
|
if (isOpen && users.length === 0 && !searchQuery) {
|
|
@@ -11123,10 +11148,10 @@ var UserSearchPopover = /* @__PURE__ */ __name(({ children, onSelect, align = "s
|
|
|
11123
11148
|
import { Fragment as Fragment12, jsx as jsx96, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
11124
11149
|
function UserSelector({ id, form, label, placeholder, onChange, isRequired = false }) {
|
|
11125
11150
|
const t = useTranslations20();
|
|
11126
|
-
const [open, setOpen] =
|
|
11151
|
+
const [open, setOpen] = useState31(false);
|
|
11127
11152
|
const searchTermRef = useRef18("");
|
|
11128
|
-
const [searchTerm, setSearchTerm] =
|
|
11129
|
-
const [isSearching, setIsSearching] =
|
|
11153
|
+
const [searchTerm, setSearchTerm] = useState31("");
|
|
11154
|
+
const [isSearching, setIsSearching] = useState31(false);
|
|
11130
11155
|
const data = useDataListRetriever({
|
|
11131
11156
|
retriever: /* @__PURE__ */ __name((params) => {
|
|
11132
11157
|
return UserService.findMany(params);
|
|
@@ -11225,12 +11250,12 @@ __name(UserSelector, "UserSelector");
|
|
|
11225
11250
|
|
|
11226
11251
|
// src/features/user/contexts/UserContext.tsx
|
|
11227
11252
|
import { jsx as jsx97 } from "react/jsx-runtime";
|
|
11228
|
-
var UserContext =
|
|
11253
|
+
var UserContext = createContext9(void 0);
|
|
11229
11254
|
var UserProvider = /* @__PURE__ */ __name(({ children, dehydratedUser }) => {
|
|
11230
11255
|
const generateUrl = usePageUrlGenerator();
|
|
11231
11256
|
const { hasPermissionToModule } = useCurrentUserContext();
|
|
11232
11257
|
const t = useTranslations21();
|
|
11233
|
-
const [user, setUser] =
|
|
11258
|
+
const [user, setUser] = useState32(
|
|
11234
11259
|
dehydratedUser ? rehydrate(Modules.User, dehydratedUser) : void 0
|
|
11235
11260
|
);
|
|
11236
11261
|
const breadcrumb = /* @__PURE__ */ __name(() => {
|
|
@@ -11279,7 +11304,7 @@ var UserProvider = /* @__PURE__ */ __name(({ children, dehydratedUser }) => {
|
|
|
11279
11304
|
) });
|
|
11280
11305
|
}, "UserProvider");
|
|
11281
11306
|
var useUserContext = /* @__PURE__ */ __name(() => {
|
|
11282
|
-
const context =
|
|
11307
|
+
const context = useContext10(UserContext);
|
|
11283
11308
|
if (context === void 0) {
|
|
11284
11309
|
throw new Error("useUserContext must be used within a UserProvider");
|
|
11285
11310
|
}
|
|
@@ -11998,15 +12023,15 @@ __name(CompanyConfigurationEditor, "CompanyConfigurationEditor");
|
|
|
11998
12023
|
// src/features/company/components/forms/CompanyDeleter.tsx
|
|
11999
12024
|
import { LoaderCircleIcon as LoaderCircleIcon2, Trash2Icon as Trash2Icon2 } from "lucide-react";
|
|
12000
12025
|
import { useTranslations as useTranslations35 } from "next-intl";
|
|
12001
|
-
import { useState as
|
|
12026
|
+
import { useState as useState33 } from "react";
|
|
12002
12027
|
import { Fragment as Fragment17, jsx as jsx122, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
12003
12028
|
function CompanyDeleterInternal({ company, isAdministrator: isAdministrator2 }) {
|
|
12004
12029
|
const t = useTranslations35();
|
|
12005
12030
|
const generateUrl = usePageUrlGenerator();
|
|
12006
|
-
const [open, setOpen] =
|
|
12007
|
-
const [finalWarningOpen, setFinalWarningOpen] =
|
|
12008
|
-
const [isDeleting, setIsDeleting] =
|
|
12009
|
-
const [companyName, setCompanyName] =
|
|
12031
|
+
const [open, setOpen] = useState33(false);
|
|
12032
|
+
const [finalWarningOpen, setFinalWarningOpen] = useState33(false);
|
|
12033
|
+
const [isDeleting, setIsDeleting] = useState33(false);
|
|
12034
|
+
const [companyName, setCompanyName] = useState33("");
|
|
12010
12035
|
const handleProceedToFinalWarning = /* @__PURE__ */ __name(() => {
|
|
12011
12036
|
setOpen(false);
|
|
12012
12037
|
setFinalWarningOpen(true);
|
|
@@ -12139,7 +12164,7 @@ import { zodResolver as zodResolver3 } from "@hookform/resolvers/zod";
|
|
|
12139
12164
|
import { UploadIcon as UploadIcon3 } from "lucide-react";
|
|
12140
12165
|
import { useTranslations as useTranslations36 } from "next-intl";
|
|
12141
12166
|
import Image6 from "next/image";
|
|
12142
|
-
import { useCallback as useCallback19, useEffect as useEffect29, useMemo as useMemo16, useRef as useRef19, useState as
|
|
12167
|
+
import { useCallback as useCallback19, useEffect as useEffect29, useMemo as useMemo16, useRef as useRef19, useState as useState34 } from "react";
|
|
12143
12168
|
import { useForm as useForm3 } from "react-hook-form";
|
|
12144
12169
|
import { v4 as v42 } from "uuid";
|
|
12145
12170
|
import { z as z2 } from "zod";
|
|
@@ -12156,10 +12181,10 @@ function CompanyEditorInternal({
|
|
|
12156
12181
|
}) {
|
|
12157
12182
|
const { hasRole, setUser } = useCurrentUserContext();
|
|
12158
12183
|
const router = useI18nRouter();
|
|
12159
|
-
const [features, setFeatures] =
|
|
12160
|
-
const [file, setFile] =
|
|
12161
|
-
const [files, setFiles] =
|
|
12162
|
-
const [contentType, setContentType] =
|
|
12184
|
+
const [features, setFeatures] = useState34([]);
|
|
12185
|
+
const [file, setFile] = useState34(null);
|
|
12186
|
+
const [files, setFiles] = useState34(null);
|
|
12187
|
+
const [contentType, setContentType] = useState34(null);
|
|
12163
12188
|
const t = useTranslations36();
|
|
12164
12189
|
const fiscalRef = useRef19(null);
|
|
12165
12190
|
const addressComponentsRef = useRef19({});
|
|
@@ -12372,7 +12397,7 @@ __name(CompaniesList, "CompaniesList");
|
|
|
12372
12397
|
|
|
12373
12398
|
// src/features/company/contexts/CompanyContext.tsx
|
|
12374
12399
|
import { jsx as jsx125 } from "react/jsx-runtime";
|
|
12375
|
-
var CompanyContext =
|
|
12400
|
+
var CompanyContext = createContext10(void 0);
|
|
12376
12401
|
var defaultContextValue2 = {
|
|
12377
12402
|
company: void 0,
|
|
12378
12403
|
setCompany: /* @__PURE__ */ __name(() => {
|
|
@@ -12382,7 +12407,7 @@ var CompanyProvider = /* @__PURE__ */ __name(({ children, dehydratedCompany, con
|
|
|
12382
12407
|
const generateUrl = usePageUrlGenerator();
|
|
12383
12408
|
const t = useTranslations38();
|
|
12384
12409
|
const { hasPermissionToModule, hasRole } = useCurrentUserContext();
|
|
12385
|
-
const [company, setCompany] =
|
|
12410
|
+
const [company, setCompany] = useState35(
|
|
12386
12411
|
dehydratedCompany ? rehydrate(Modules.Company, dehydratedCompany) : void 0
|
|
12387
12412
|
);
|
|
12388
12413
|
const breadcrumb = /* @__PURE__ */ __name(() => {
|
|
@@ -12422,16 +12447,16 @@ var CompanyProvider = /* @__PURE__ */ __name(({ children, dehydratedCompany, con
|
|
|
12422
12447
|
) });
|
|
12423
12448
|
}, "CompanyProvider");
|
|
12424
12449
|
var useCompanyContext = /* @__PURE__ */ __name(() => {
|
|
12425
|
-
return
|
|
12450
|
+
return useContext11(CompanyContext) ?? defaultContextValue2;
|
|
12426
12451
|
}, "useCompanyContext");
|
|
12427
12452
|
|
|
12428
12453
|
// src/features/notification/contexts/NotificationContext.tsx
|
|
12429
12454
|
import { useTranslations as useTranslations40 } from "next-intl";
|
|
12430
|
-
import { createContext as
|
|
12455
|
+
import { createContext as createContext11, useCallback as useCallback20, useContext as useContext12, useEffect as useEffect31, useRef as useRef20, useState as useState37 } from "react";
|
|
12431
12456
|
|
|
12432
12457
|
// src/features/notification/components/notifications/Notification.tsx
|
|
12433
12458
|
import { useTranslations as useTranslations39 } from "next-intl";
|
|
12434
|
-
import { useEffect as useEffect30, useState as
|
|
12459
|
+
import { useEffect as useEffect30, useState as useState36 } from "react";
|
|
12435
12460
|
import { jsx as jsx126, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
12436
12461
|
var generateNotificationData = /* @__PURE__ */ __name((params) => {
|
|
12437
12462
|
const response = {};
|
|
@@ -12468,7 +12493,7 @@ function NotificationToast(notification, t, generateUrl, reouter) {
|
|
|
12468
12493
|
__name(NotificationToast, "NotificationToast");
|
|
12469
12494
|
function NotificationMenuItem({ notification, closePopover }) {
|
|
12470
12495
|
const generateUrl = usePageUrlGenerator();
|
|
12471
|
-
const [isRead, setIsRead] =
|
|
12496
|
+
const [isRead, setIsRead] = useState36(false);
|
|
12472
12497
|
const t = useTranslations39();
|
|
12473
12498
|
useEffect30(() => {
|
|
12474
12499
|
setIsRead(notification.isRead);
|
|
@@ -12493,15 +12518,15 @@ __name(NotificationMenuItem, "NotificationMenuItem");
|
|
|
12493
12518
|
|
|
12494
12519
|
// src/features/notification/contexts/NotificationContext.tsx
|
|
12495
12520
|
import { jsx as jsx127 } from "react/jsx-runtime";
|
|
12496
|
-
var NotificationContext =
|
|
12521
|
+
var NotificationContext = createContext11(void 0);
|
|
12497
12522
|
var NotificationContextProvider = /* @__PURE__ */ __name(({ children }) => {
|
|
12498
12523
|
const t = useTranslations40();
|
|
12499
12524
|
const router = useI18nRouter();
|
|
12500
|
-
const [notifications, setNotifications] =
|
|
12501
|
-
const [isLoading, setIsLoading] =
|
|
12502
|
-
const [error, setError] =
|
|
12503
|
-
const [lastLoaded, setLastLoaded] =
|
|
12504
|
-
const [hasInitiallyLoaded, setHasInitiallyLoaded] =
|
|
12525
|
+
const [notifications, setNotifications] = useState37([]);
|
|
12526
|
+
const [isLoading, setIsLoading] = useState37(false);
|
|
12527
|
+
const [error, setError] = useState37(null);
|
|
12528
|
+
const [lastLoaded, setLastLoaded] = useState37(0);
|
|
12529
|
+
const [hasInitiallyLoaded, setHasInitiallyLoaded] = useState37(false);
|
|
12505
12530
|
const inFlightRef = useRef20(null);
|
|
12506
12531
|
const { currentUser } = useCurrentUserContext();
|
|
12507
12532
|
const shouldRefresh = Date.now() - lastLoaded > 5 * 60 * 1e3;
|
|
@@ -12620,7 +12645,7 @@ var NotificationContextProvider = /* @__PURE__ */ __name(({ children }) => {
|
|
|
12620
12645
|
) });
|
|
12621
12646
|
}, "NotificationContextProvider");
|
|
12622
12647
|
var useNotificationContext = /* @__PURE__ */ __name(() => {
|
|
12623
|
-
const context =
|
|
12648
|
+
const context = useContext12(NotificationContext);
|
|
12624
12649
|
if (context === void 0) {
|
|
12625
12650
|
throw new Error(`Notification.messages.errors.use_context`);
|
|
12626
12651
|
}
|
|
@@ -12628,7 +12653,7 @@ var useNotificationContext = /* @__PURE__ */ __name(() => {
|
|
|
12628
12653
|
}, "useNotificationContext");
|
|
12629
12654
|
|
|
12630
12655
|
// src/features/onboarding/contexts/OnboardingContext.tsx
|
|
12631
|
-
import { createContext as
|
|
12656
|
+
import { createContext as createContext12, useCallback as useCallback21, useContext as useContext13, useEffect as useEffect32, useRef as useRef21, useState as useState38 } from "react";
|
|
12632
12657
|
import { createRoot } from "react-dom/client";
|
|
12633
12658
|
import Shepherd from "shepherd.js";
|
|
12634
12659
|
import "shepherd.js/dist/css/shepherd.css";
|
|
@@ -12686,7 +12711,7 @@ var DEFAULT_ONBOARDING_LABELS = {
|
|
|
12686
12711
|
|
|
12687
12712
|
// src/features/onboarding/contexts/OnboardingContext.tsx
|
|
12688
12713
|
import { jsx as jsx129 } from "react/jsx-runtime";
|
|
12689
|
-
var OnboardingContext =
|
|
12714
|
+
var OnboardingContext = createContext12(null);
|
|
12690
12715
|
function OnboardingProvider({
|
|
12691
12716
|
children,
|
|
12692
12717
|
tours = [],
|
|
@@ -12695,10 +12720,10 @@ function OnboardingProvider({
|
|
|
12695
12720
|
renderCard,
|
|
12696
12721
|
zIndex: _zIndex = 9999
|
|
12697
12722
|
}) {
|
|
12698
|
-
const [isTourActive, setIsTourActive] =
|
|
12699
|
-
const [activeTourId, setActiveTourId] =
|
|
12700
|
-
const [currentStepIndex, setCurrentStepIndex] =
|
|
12701
|
-
const [totalSteps, setTotalSteps] =
|
|
12723
|
+
const [isTourActive, setIsTourActive] = useState38(false);
|
|
12724
|
+
const [activeTourId, setActiveTourId] = useState38(null);
|
|
12725
|
+
const [currentStepIndex, setCurrentStepIndex] = useState38(0);
|
|
12726
|
+
const [totalSteps, setTotalSteps] = useState38(0);
|
|
12702
12727
|
const tourRef = useRef21(null);
|
|
12703
12728
|
const rootsRef = useRef21(/* @__PURE__ */ new Map());
|
|
12704
12729
|
const cleanupRoots = useCallback21(() => {
|
|
@@ -12849,7 +12874,7 @@ function OnboardingProvider({
|
|
|
12849
12874
|
}
|
|
12850
12875
|
__name(OnboardingProvider, "OnboardingProvider");
|
|
12851
12876
|
function useOnboarding() {
|
|
12852
|
-
const context =
|
|
12877
|
+
const context = useContext13(OnboardingContext);
|
|
12853
12878
|
if (!context) {
|
|
12854
12879
|
throw new Error("useOnboarding must be used within an OnboardingProvider");
|
|
12855
12880
|
}
|
|
@@ -12859,13 +12884,13 @@ __name(useOnboarding, "useOnboarding");
|
|
|
12859
12884
|
|
|
12860
12885
|
// src/features/role/contexts/RoleContext.tsx
|
|
12861
12886
|
import { useTranslations as useTranslations41 } from "next-intl";
|
|
12862
|
-
import { createContext as
|
|
12887
|
+
import { createContext as createContext13, useContext as useContext14, useState as useState39 } from "react";
|
|
12863
12888
|
import { jsx as jsx130 } from "react/jsx-runtime";
|
|
12864
|
-
var RoleContext =
|
|
12889
|
+
var RoleContext = createContext13(void 0);
|
|
12865
12890
|
var RoleProvider = /* @__PURE__ */ __name(({ children, dehydratedRole }) => {
|
|
12866
12891
|
const generateUrl = usePageUrlGenerator();
|
|
12867
12892
|
const t = useTranslations41();
|
|
12868
|
-
const [role, setRole] =
|
|
12893
|
+
const [role, setRole] = useState39(
|
|
12869
12894
|
dehydratedRole ? rehydrate(Modules.Role, dehydratedRole) : void 0
|
|
12870
12895
|
);
|
|
12871
12896
|
const breadcrumb = /* @__PURE__ */ __name(() => {
|
|
@@ -12904,7 +12929,7 @@ var RoleProvider = /* @__PURE__ */ __name(({ children, dehydratedRole }) => {
|
|
|
12904
12929
|
) });
|
|
12905
12930
|
}, "RoleProvider");
|
|
12906
12931
|
var useRoleContext = /* @__PURE__ */ __name(() => {
|
|
12907
|
-
const context =
|
|
12932
|
+
const context = useContext14(RoleContext);
|
|
12908
12933
|
if (context === void 0) {
|
|
12909
12934
|
throw new Error("useRoleContext must be used within a RoleProvider");
|
|
12910
12935
|
}
|
|
@@ -12912,14 +12937,14 @@ var useRoleContext = /* @__PURE__ */ __name(() => {
|
|
|
12912
12937
|
}, "useRoleContext");
|
|
12913
12938
|
|
|
12914
12939
|
// src/contexts/SharedContext.tsx
|
|
12915
|
-
import { createContext as
|
|
12940
|
+
import { createContext as createContext14, useContext as useContext15 } from "react";
|
|
12916
12941
|
import { jsx as jsx131 } from "react/jsx-runtime";
|
|
12917
|
-
var SharedContext =
|
|
12942
|
+
var SharedContext = createContext14(null);
|
|
12918
12943
|
var SharedProvider = /* @__PURE__ */ __name(({ children, value }) => {
|
|
12919
12944
|
return /* @__PURE__ */ jsx131(SharedContext.Provider, { value, children });
|
|
12920
12945
|
}, "SharedProvider");
|
|
12921
12946
|
var useSharedContext = /* @__PURE__ */ __name(() => {
|
|
12922
|
-
const context =
|
|
12947
|
+
const context = useContext15(SharedContext);
|
|
12923
12948
|
if (!context) {
|
|
12924
12949
|
throw new Error("useSharedContext must be used within a SharedProvider");
|
|
12925
12950
|
}
|
|
@@ -12952,7 +12977,7 @@ __name(HowToDeleter, "HowToDeleter");
|
|
|
12952
12977
|
import { zodResolver as zodResolver4 } from "@hookform/resolvers/zod";
|
|
12953
12978
|
import { PlusIcon, SearchIcon as SearchIcon5, XIcon as XIcon9 } from "lucide-react";
|
|
12954
12979
|
import { useTranslations as useTranslations44 } from "next-intl";
|
|
12955
|
-
import { useCallback as useCallback22, useEffect as useEffect33, useMemo as useMemo17, useRef as useRef22, useState as
|
|
12980
|
+
import { useCallback as useCallback22, useEffect as useEffect33, useMemo as useMemo17, useRef as useRef22, useState as useState40 } from "react";
|
|
12956
12981
|
import { useForm as useForm4 } from "react-hook-form";
|
|
12957
12982
|
import { v4 as v43 } from "uuid";
|
|
12958
12983
|
import { z as z3 } from "zod";
|
|
@@ -13001,8 +13026,8 @@ function PageSelector({
|
|
|
13001
13026
|
onSelect,
|
|
13002
13027
|
onRemove
|
|
13003
13028
|
}) {
|
|
13004
|
-
const [open, setOpen] =
|
|
13005
|
-
const [search, setSearch] =
|
|
13029
|
+
const [open, setOpen] = useState40(false);
|
|
13030
|
+
const [search, setSearch] = useState40("");
|
|
13006
13031
|
const selectedLabel = value ? allPageUrls.find((opt) => opt.id === value) : void 0;
|
|
13007
13032
|
const filteredOptions = useMemo17(() => {
|
|
13008
13033
|
const available = allPageUrls.filter((opt) => opt.id === value || !selectedPages.includes(opt.id));
|
|
@@ -13315,13 +13340,13 @@ __name(HowToEditor, "HowToEditor");
|
|
|
13315
13340
|
|
|
13316
13341
|
// src/features/how-to/contexts/HowToContext.tsx
|
|
13317
13342
|
import { useTranslations as useTranslations45 } from "next-intl";
|
|
13318
|
-
import { createContext as
|
|
13343
|
+
import { createContext as createContext15, useContext as useContext16, useState as useState41 } from "react";
|
|
13319
13344
|
import { jsx as jsx135 } from "react/jsx-runtime";
|
|
13320
|
-
var HowToContext =
|
|
13345
|
+
var HowToContext = createContext15(void 0);
|
|
13321
13346
|
var HowToProvider = /* @__PURE__ */ __name(({ children, dehydratedHowTo }) => {
|
|
13322
13347
|
const generateUrl = usePageUrlGenerator();
|
|
13323
13348
|
const t = useTranslations45();
|
|
13324
|
-
const [howTo, setHowTo] =
|
|
13349
|
+
const [howTo, setHowTo] = useState41(
|
|
13325
13350
|
dehydratedHowTo ? rehydrate(Modules.HowTo, dehydratedHowTo) : void 0
|
|
13326
13351
|
);
|
|
13327
13352
|
const reloadHowTo = /* @__PURE__ */ __name(async () => {
|
|
@@ -13370,7 +13395,7 @@ var HowToProvider = /* @__PURE__ */ __name(({ children, dehydratedHowTo }) => {
|
|
|
13370
13395
|
) });
|
|
13371
13396
|
}, "HowToProvider");
|
|
13372
13397
|
var useHowToContext = /* @__PURE__ */ __name(() => {
|
|
13373
|
-
const context =
|
|
13398
|
+
const context = useContext16(HowToContext);
|
|
13374
13399
|
if (context === void 0) {
|
|
13375
13400
|
throw new Error("useHowToContext must be used within a HowToProvider");
|
|
13376
13401
|
}
|
|
@@ -13380,7 +13405,7 @@ var useHowToContext = /* @__PURE__ */ __name(() => {
|
|
|
13380
13405
|
// src/features/rbac/contexts/RbacContext.tsx
|
|
13381
13406
|
import { DownloadIcon, Loader2Icon as Loader2Icon3 } from "lucide-react";
|
|
13382
13407
|
import { useTranslations as useTranslations46 } from "next-intl";
|
|
13383
|
-
import { createContext as
|
|
13408
|
+
import { createContext as createContext16, useCallback as useCallback23, useContext as useContext17, useEffect as useEffect34, useMemo as useMemo18, useState as useState42 } from "react";
|
|
13384
13409
|
import { jsx as jsx136, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
13385
13410
|
var DEFAULT_OUTPUT_PATH = "apps/api/src/rbac/permissions.ts";
|
|
13386
13411
|
function upsertToken(tokens, action, scope) {
|
|
@@ -13394,7 +13419,7 @@ function removeToken(tokens, action) {
|
|
|
13394
13419
|
return (tokens ?? []).filter((t) => t.action !== action);
|
|
13395
13420
|
}
|
|
13396
13421
|
__name(removeToken, "removeToken");
|
|
13397
|
-
var RbacContext =
|
|
13422
|
+
var RbacContext = createContext16(void 0);
|
|
13398
13423
|
var RbacProvider = /* @__PURE__ */ __name(({
|
|
13399
13424
|
children,
|
|
13400
13425
|
roleNames,
|
|
@@ -13403,11 +13428,11 @@ var RbacProvider = /* @__PURE__ */ __name(({
|
|
|
13403
13428
|
}) => {
|
|
13404
13429
|
const generateUrl = usePageUrlGenerator();
|
|
13405
13430
|
const t = useTranslations46();
|
|
13406
|
-
const [matrix, setMatrix] =
|
|
13407
|
-
const [modulePaths, setModulePaths] =
|
|
13408
|
-
const [loading, setLoading] =
|
|
13409
|
-
const [error, setError] =
|
|
13410
|
-
const [saving, setSaving] =
|
|
13431
|
+
const [matrix, setMatrix] = useState42(null);
|
|
13432
|
+
const [modulePaths, setModulePaths] = useState42({});
|
|
13433
|
+
const [loading, setLoading] = useState42(true);
|
|
13434
|
+
const [error, setError] = useState42(null);
|
|
13435
|
+
const [saving, setSaving] = useState42(false);
|
|
13411
13436
|
useEffect34(() => {
|
|
13412
13437
|
let cancelled = false;
|
|
13413
13438
|
setLoading(true);
|
|
@@ -13506,7 +13531,7 @@ var RbacProvider = /* @__PURE__ */ __name(({
|
|
|
13506
13531
|
return /* @__PURE__ */ jsx136(SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ jsx136(RbacContext.Provider, { value: contextValue, children }) });
|
|
13507
13532
|
}, "RbacProvider");
|
|
13508
13533
|
var useRbacContext = /* @__PURE__ */ __name(() => {
|
|
13509
|
-
const ctx =
|
|
13534
|
+
const ctx = useContext17(RbacContext);
|
|
13510
13535
|
if (!ctx) {
|
|
13511
13536
|
throw new Error("useRbacContext must be used within an RbacProvider");
|
|
13512
13537
|
}
|
|
@@ -13515,9 +13540,9 @@ var useRbacContext = /* @__PURE__ */ __name(() => {
|
|
|
13515
13540
|
|
|
13516
13541
|
// src/features/assistant/contexts/AssistantContext.tsx
|
|
13517
13542
|
import { useTranslations as useTranslations47 } from "next-intl";
|
|
13518
|
-
import { createContext as
|
|
13543
|
+
import { createContext as createContext17, useCallback as useCallback24, useContext as useContext18, useEffect as useEffect35, useMemo as useMemo19, useState as useState43 } from "react";
|
|
13519
13544
|
import { jsx as jsx137 } from "react/jsx-runtime";
|
|
13520
|
-
var AssistantContext =
|
|
13545
|
+
var AssistantContext = createContext17(void 0);
|
|
13521
13546
|
function stripOptimistic(list) {
|
|
13522
13547
|
return list.filter((m) => !m.isOptimistic);
|
|
13523
13548
|
}
|
|
@@ -13540,18 +13565,18 @@ __name(withPatchedTitle, "withPatchedTitle");
|
|
|
13540
13565
|
function AssistantProvider({ children, dehydratedAssistant, dehydratedMessages, manageUrl = true }) {
|
|
13541
13566
|
const t = useTranslations47();
|
|
13542
13567
|
const generateUrl = usePageUrlGenerator();
|
|
13543
|
-
const [assistant, setAssistant] =
|
|
13568
|
+
const [assistant, setAssistant] = useState43(
|
|
13544
13569
|
() => dehydratedAssistant ? rehydrate(Modules.Assistant, dehydratedAssistant) : void 0
|
|
13545
13570
|
);
|
|
13546
|
-
const [messages, setMessages] =
|
|
13571
|
+
const [messages, setMessages] = useState43(
|
|
13547
13572
|
() => dehydratedMessages ? rehydrateList(Modules.AssistantMessage, dehydratedMessages) : []
|
|
13548
13573
|
);
|
|
13549
|
-
const [threads, setThreads] =
|
|
13550
|
-
const [threadsLoading, setThreadsLoading] =
|
|
13551
|
-
const [sending, setSending] =
|
|
13552
|
-
const [status, setStatus] =
|
|
13553
|
-
const [failedMessageIds, setFailedMessageIds] =
|
|
13554
|
-
const [operatorMode, setOperatorMode] =
|
|
13574
|
+
const [threads, setThreads] = useState43([]);
|
|
13575
|
+
const [threadsLoading, setThreadsLoading] = useState43(true);
|
|
13576
|
+
const [sending, setSending] = useState43(false);
|
|
13577
|
+
const [status, setStatus] = useState43(void 0);
|
|
13578
|
+
const [failedMessageIds, setFailedMessageIds] = useState43(() => /* @__PURE__ */ new Set());
|
|
13579
|
+
const [operatorMode, setOperatorMode] = useState43(
|
|
13555
13580
|
() => dehydratedAssistant?.jsonApi?.attributes?.engine === "operator"
|
|
13556
13581
|
);
|
|
13557
13582
|
const { socket } = useSocketContext();
|
|
@@ -13736,7 +13761,7 @@ function AssistantProvider({ children, dehydratedAssistant, dehydratedMessages,
|
|
|
13736
13761
|
}
|
|
13737
13762
|
__name(AssistantProvider, "AssistantProvider");
|
|
13738
13763
|
function useAssistantContext() {
|
|
13739
|
-
const ctx =
|
|
13764
|
+
const ctx = useContext18(AssistantContext);
|
|
13740
13765
|
if (!ctx) throw new Error("useAssistantContext must be used within AssistantProvider");
|
|
13741
13766
|
return ctx;
|
|
13742
13767
|
}
|
|
@@ -13744,9 +13769,9 @@ __name(useAssistantContext, "useAssistantContext");
|
|
|
13744
13769
|
|
|
13745
13770
|
// src/contexts/CommonContext.tsx
|
|
13746
13771
|
import { useTranslations as useTranslations48 } from "next-intl";
|
|
13747
|
-
import { createContext as
|
|
13772
|
+
import { createContext as createContext18, useContext as useContext19 } from "react";
|
|
13748
13773
|
import { jsx as jsx138 } from "react/jsx-runtime";
|
|
13749
|
-
var CommonContext =
|
|
13774
|
+
var CommonContext = createContext18(void 0);
|
|
13750
13775
|
var CommonProvider = /* @__PURE__ */ __name(({ children }) => {
|
|
13751
13776
|
const { company } = useCurrentUserContext();
|
|
13752
13777
|
const t = useTranslations48();
|
|
@@ -13764,7 +13789,7 @@ var CommonProvider = /* @__PURE__ */ __name(({ children }) => {
|
|
|
13764
13789
|
return /* @__PURE__ */ jsx138(SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ jsx138(CommonContext.Provider, { value: {}, children }) });
|
|
13765
13790
|
}, "CommonProvider");
|
|
13766
13791
|
var useCommonContext = /* @__PURE__ */ __name(() => {
|
|
13767
|
-
const context =
|
|
13792
|
+
const context = useContext19(CommonContext);
|
|
13768
13793
|
if (context === void 0) {
|
|
13769
13794
|
throw new Error("useCommonContext must be used within a CommonProvider");
|
|
13770
13795
|
}
|
|
@@ -13772,9 +13797,9 @@ var useCommonContext = /* @__PURE__ */ __name(() => {
|
|
|
13772
13797
|
}, "useCommonContext");
|
|
13773
13798
|
|
|
13774
13799
|
// src/contexts/HeaderChildrenContext.tsx
|
|
13775
|
-
import { createContext as
|
|
13800
|
+
import { createContext as createContext19, useContext as useContext20 } from "react";
|
|
13776
13801
|
import { jsx as jsx139 } from "react/jsx-runtime";
|
|
13777
|
-
var HeaderChildrenContext =
|
|
13802
|
+
var HeaderChildrenContext = createContext19({
|
|
13778
13803
|
headerChildren: null
|
|
13779
13804
|
});
|
|
13780
13805
|
function HeaderChildrenProvider({ children, content }) {
|
|
@@ -13782,15 +13807,15 @@ function HeaderChildrenProvider({ children, content }) {
|
|
|
13782
13807
|
}
|
|
13783
13808
|
__name(HeaderChildrenProvider, "HeaderChildrenProvider");
|
|
13784
13809
|
function useHeaderChildren() {
|
|
13785
|
-
const context =
|
|
13810
|
+
const context = useContext20(HeaderChildrenContext);
|
|
13786
13811
|
return context.headerChildren;
|
|
13787
13812
|
}
|
|
13788
13813
|
__name(useHeaderChildren, "useHeaderChildren");
|
|
13789
13814
|
|
|
13790
13815
|
// src/contexts/HeaderLeftContentContext.tsx
|
|
13791
|
-
import { createContext as
|
|
13816
|
+
import { createContext as createContext20, useContext as useContext21 } from "react";
|
|
13792
13817
|
import { jsx as jsx140 } from "react/jsx-runtime";
|
|
13793
|
-
var HeaderLeftContentContext =
|
|
13818
|
+
var HeaderLeftContentContext = createContext20({
|
|
13794
13819
|
headerLeftContent: null
|
|
13795
13820
|
});
|
|
13796
13821
|
function HeaderLeftContentProvider({ children, content }) {
|
|
@@ -13798,7 +13823,7 @@ function HeaderLeftContentProvider({ children, content }) {
|
|
|
13798
13823
|
}
|
|
13799
13824
|
__name(HeaderLeftContentProvider, "HeaderLeftContentProvider");
|
|
13800
13825
|
function useHeaderLeftContent() {
|
|
13801
|
-
const context =
|
|
13826
|
+
const context = useContext21(HeaderLeftContentContext);
|
|
13802
13827
|
return context.headerLeftContent;
|
|
13803
13828
|
}
|
|
13804
13829
|
__name(useHeaderLeftContent, "useHeaderLeftContent");
|
|
@@ -13806,7 +13831,7 @@ __name(useHeaderLeftContent, "useHeaderLeftContent");
|
|
|
13806
13831
|
// src/components/EditableAvatar.tsx
|
|
13807
13832
|
import { PencilIcon as PencilIcon3, Trash2Icon as Trash2Icon3 } from "lucide-react";
|
|
13808
13833
|
import { useTranslations as useTranslations49 } from "next-intl";
|
|
13809
|
-
import { useCallback as useCallback25, useRef as useRef23, useState as
|
|
13834
|
+
import { useCallback as useCallback25, useRef as useRef23, useState as useState44 } from "react";
|
|
13810
13835
|
import { jsx as jsx141, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
13811
13836
|
function EditableAvatar({
|
|
13812
13837
|
entityId,
|
|
@@ -13821,8 +13846,8 @@ function EditableAvatar({
|
|
|
13821
13846
|
const { company } = useCurrentUserContext();
|
|
13822
13847
|
const t = useTranslations49();
|
|
13823
13848
|
const fileInputRef = useRef23(null);
|
|
13824
|
-
const [optimisticImage, setOptimisticImage] =
|
|
13825
|
-
const [isUploading, setIsUploading] =
|
|
13849
|
+
const [optimisticImage, setOptimisticImage] = useState44(null);
|
|
13850
|
+
const [isUploading, setIsUploading] = useState44(false);
|
|
13826
13851
|
const displayImage = optimisticImage ?? image;
|
|
13827
13852
|
const generateS3Key = useCallback25(
|
|
13828
13853
|
(file) => {
|
|
@@ -13956,7 +13981,7 @@ __name(TableCellAvatar, "TableCellAvatar");
|
|
|
13956
13981
|
|
|
13957
13982
|
// src/components/navigations/Breadcrumb.tsx
|
|
13958
13983
|
import { useTranslations as useTranslations50 } from "next-intl";
|
|
13959
|
-
import { Fragment as Fragment20, useState as
|
|
13984
|
+
import { Fragment as Fragment20, useState as useState45 } from "react";
|
|
13960
13985
|
import { ChevronDownIcon as ChevronDownIcon8 } from "lucide-react";
|
|
13961
13986
|
import { Fragment as Fragment21, jsx as jsx143, jsxs as jsxs82 } from "react/jsx-runtime";
|
|
13962
13987
|
var ITEMS_TO_DISPLAY = 4;
|
|
@@ -13965,7 +13990,7 @@ function BreadcrumbDesktop({
|
|
|
13965
13990
|
generateUrl,
|
|
13966
13991
|
t
|
|
13967
13992
|
}) {
|
|
13968
|
-
const [open, setOpen] =
|
|
13993
|
+
const [open, setOpen] = useState45(false);
|
|
13969
13994
|
return /* @__PURE__ */ jsx143(Breadcrumb, { children: /* @__PURE__ */ jsxs82(BreadcrumbList, { children: [
|
|
13970
13995
|
/* @__PURE__ */ jsx143(BreadcrumbItem, { children: /* @__PURE__ */ jsx143(Link, { href: generateUrl({ page: `/` }), children: t(`common.home`) }) }),
|
|
13971
13996
|
items.length > 0 && /* @__PURE__ */ jsx143(BreadcrumbSeparator, {}),
|
|
@@ -13993,7 +14018,7 @@ function BreadcrumbMobile({
|
|
|
13993
14018
|
generateUrl,
|
|
13994
14019
|
t
|
|
13995
14020
|
}) {
|
|
13996
|
-
const [open, setOpen] =
|
|
14021
|
+
const [open, setOpen] = useState45(false);
|
|
13997
14022
|
const lastItem = items[items.length - 1];
|
|
13998
14023
|
const allItems = [{ name: t(`common.home`), href: generateUrl({ page: `/` }) }, ...items];
|
|
13999
14024
|
if (!lastItem && items.length === 0) {
|
|
@@ -14020,11 +14045,11 @@ function BreadcrumbNavigation({ items }) {
|
|
|
14020
14045
|
__name(BreadcrumbNavigation, "BreadcrumbNavigation");
|
|
14021
14046
|
|
|
14022
14047
|
// src/components/navigations/ContentTitle.tsx
|
|
14023
|
-
import { useEffect as useEffect36, useState as
|
|
14048
|
+
import { useEffect as useEffect36, useState as useState46 } from "react";
|
|
14024
14049
|
import { jsx as jsx144, jsxs as jsxs83 } from "react/jsx-runtime";
|
|
14025
14050
|
function ContentTitle({ module, type, element, functions, className, prioritizeFunctions }) {
|
|
14026
|
-
const [clientFunctions, setClientFunctions] =
|
|
14027
|
-
const [isClient, setIsClient] =
|
|
14051
|
+
const [clientFunctions, setClientFunctions] = useState46(null);
|
|
14052
|
+
const [isClient, setIsClient] = useState46(false);
|
|
14028
14053
|
useEffect36(() => {
|
|
14029
14054
|
setIsClient(true);
|
|
14030
14055
|
setClientFunctions(functions);
|
|
@@ -14081,12 +14106,12 @@ __name(ModeToggleSwitch, "ModeToggleSwitch");
|
|
|
14081
14106
|
|
|
14082
14107
|
// src/components/navigations/PageSection.tsx
|
|
14083
14108
|
import { ChevronDownIcon as ChevronDownIcon9, ChevronRightIcon as ChevronRightIcon6 } from "lucide-react";
|
|
14084
|
-
import { useEffect as useEffect37, useState as
|
|
14109
|
+
import { useEffect as useEffect37, useState as useState47 } from "react";
|
|
14085
14110
|
import { v4 as v44 } from "uuid";
|
|
14086
14111
|
import { jsx as jsx147, jsxs as jsxs85 } from "react/jsx-runtime";
|
|
14087
14112
|
function PageSection({ children, title, options, open, small, onToggle }) {
|
|
14088
|
-
const [isOpen, setIsOpen] =
|
|
14089
|
-
const [shouldRender, setShouldRender] =
|
|
14113
|
+
const [isOpen, setIsOpen] = useState47(open ?? true);
|
|
14114
|
+
const [shouldRender, setShouldRender] = useState47(open ?? true);
|
|
14090
14115
|
useEffect37(() => {
|
|
14091
14116
|
if (onToggle) {
|
|
14092
14117
|
onToggle(isOpen);
|
|
@@ -14194,7 +14219,7 @@ __name(partitionTabs, "partitionTabs");
|
|
|
14194
14219
|
// src/components/containers/ReactMarkdownContainer.tsx
|
|
14195
14220
|
import { ChevronDown as ChevronDown2, ChevronUp } from "lucide-react";
|
|
14196
14221
|
import { useTranslations as useTranslations52 } from "next-intl";
|
|
14197
|
-
import { useEffect as useEffect38, useRef as useRef24, useState as
|
|
14222
|
+
import { useEffect as useEffect38, useRef as useRef24, useState as useState48 } from "react";
|
|
14198
14223
|
import ReactMarkdown from "react-markdown";
|
|
14199
14224
|
import remarkGfm from "remark-gfm";
|
|
14200
14225
|
import { jsx as jsx150, jsxs as jsxs88 } from "react/jsx-runtime";
|
|
@@ -14205,8 +14230,8 @@ function ReactMarkdownContainer({
|
|
|
14205
14230
|
size = "normal"
|
|
14206
14231
|
}) {
|
|
14207
14232
|
const t = useTranslations52("ui.buttons");
|
|
14208
|
-
const [isExpanded, setIsExpanded] =
|
|
14209
|
-
const [showExpandButton, setShowExpandButton] =
|
|
14233
|
+
const [isExpanded, setIsExpanded] = useState48(false);
|
|
14234
|
+
const [showExpandButton, setShowExpandButton] = useState48(false);
|
|
14210
14235
|
const contentRef = useRef24(null);
|
|
14211
14236
|
useEffect38(() => {
|
|
14212
14237
|
if (collapsible && contentRef.current && !isExpanded) {
|
|
@@ -14271,7 +14296,7 @@ function ReactMarkdownContainer({
|
|
|
14271
14296
|
__name(ReactMarkdownContainer, "ReactMarkdownContainer");
|
|
14272
14297
|
|
|
14273
14298
|
// src/components/containers/RoundPageContainerTitle.tsx
|
|
14274
|
-
import {
|
|
14299
|
+
import { InfoIcon as InfoIcon2 } from "lucide-react";
|
|
14275
14300
|
import { jsx as jsx151, jsxs as jsxs89 } from "react/jsx-runtime";
|
|
14276
14301
|
function RoundPageContainerTitle({
|
|
14277
14302
|
module,
|
|
@@ -14297,9 +14322,10 @@ function RoundPageContainerTitle({
|
|
|
14297
14322
|
{
|
|
14298
14323
|
render: /* @__PURE__ */ jsx151("div", {}),
|
|
14299
14324
|
nativeButton: false,
|
|
14300
|
-
variant: `ghost`,
|
|
14325
|
+
variant: showDetails ? `ghost` : `default`,
|
|
14301
14326
|
onClick: () => setShowDetails(!showDetails),
|
|
14302
|
-
|
|
14327
|
+
className: cn(`cursor-pointer`),
|
|
14328
|
+
children: /* @__PURE__ */ jsx151(InfoIcon2, {})
|
|
14303
14329
|
}
|
|
14304
14330
|
) }),
|
|
14305
14331
|
/* @__PURE__ */ jsx151(TooltipContent, { children: showDetails ? "Hide details" : "Show details" })
|
|
@@ -14311,7 +14337,7 @@ __name(RoundPageContainerTitle, "RoundPageContainerTitle");
|
|
|
14311
14337
|
|
|
14312
14338
|
// src/components/containers/RoundPageContainer.tsx
|
|
14313
14339
|
import { useSearchParams } from "next/navigation";
|
|
14314
|
-
import { Fragment as Fragment22, useCallback as useCallback26, useEffect as useEffect39, useMemo as useMemo20, useState as
|
|
14340
|
+
import { Fragment as Fragment22, useCallback as useCallback26, useEffect as useEffect39, useMemo as useMemo20, useState as useState49 } from "react";
|
|
14315
14341
|
import { Fragment as Fragment23, jsx as jsx152, jsxs as jsxs90 } from "react/jsx-runtime";
|
|
14316
14342
|
var DETAILS_COOKIE_NAME = "round_page_details_state";
|
|
14317
14343
|
var DETAILS_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
@@ -14336,9 +14362,9 @@ function RoundPageContainer({
|
|
|
14336
14362
|
}) {
|
|
14337
14363
|
const headerChildren = useHeaderChildren();
|
|
14338
14364
|
const headerLeftContent = useHeaderLeftContent();
|
|
14339
|
-
const [showDetails, setShowDetailsState] =
|
|
14365
|
+
const [showDetails, setShowDetailsState] = useState49(false);
|
|
14340
14366
|
const isMobile = useIsMobile();
|
|
14341
|
-
const [mounted, setMounted] =
|
|
14367
|
+
const [mounted, setMounted] = useState49(false);
|
|
14342
14368
|
useEffect39(() => {
|
|
14343
14369
|
const match = document.cookie.split("; ").find((row) => row.startsWith(`${DETAILS_COOKIE_NAME}=`));
|
|
14344
14370
|
if (match?.split("=")[1] === "true") setShowDetailsState(true);
|
|
@@ -14354,7 +14380,7 @@ function RoundPageContainer({
|
|
|
14354
14380
|
const section = searchParams.get("section");
|
|
14355
14381
|
const rewriteUrl = useUrlRewriter();
|
|
14356
14382
|
const initialValue = tabs ? (section && tabs.find((i) => tabValue(i) === section) ? section : null) || tabValue(tabs[0]) : void 0;
|
|
14357
|
-
const [activeTab, setActiveTab] =
|
|
14383
|
+
const [activeTab, setActiveTab] = useState49(initialValue);
|
|
14358
14384
|
useEffect39(() => {
|
|
14359
14385
|
if (tabs && section) {
|
|
14360
14386
|
const tab = tabs.find((i) => tabValue(i) === section);
|
|
@@ -14623,14 +14649,14 @@ function AllowedUsersDetails({ showTitle, content }) {
|
|
|
14623
14649
|
__name(AllowedUsersDetails, "AllowedUsersDetails");
|
|
14624
14650
|
|
|
14625
14651
|
// src/components/editors/BlockNoteEditorMentionHoverCard.tsx
|
|
14626
|
-
import { useCallback as useCallback27, useEffect as useEffect40, useRef as useRef25, useState as
|
|
14652
|
+
import { useCallback as useCallback27, useEffect as useEffect40, useRef as useRef25, useState as useState50 } from "react";
|
|
14627
14653
|
import { createPortal as createPortal3 } from "react-dom";
|
|
14628
14654
|
import { jsx as jsx155 } from "react/jsx-runtime";
|
|
14629
14655
|
function BlockNoteEditorMentionHoverCard({
|
|
14630
14656
|
containerRef,
|
|
14631
14657
|
mentionResolveFn
|
|
14632
14658
|
}) {
|
|
14633
|
-
const [hovered, setHovered] =
|
|
14659
|
+
const [hovered, setHovered] = useState50(null);
|
|
14634
14660
|
const closeTimeoutRef = useRef25(null);
|
|
14635
14661
|
const scheduleClose = useCallback27(() => {
|
|
14636
14662
|
closeTimeoutRef.current = setTimeout(() => setHovered(null), 200);
|
|
@@ -14888,11 +14914,11 @@ var BlockNoteViewerContainer = React26.memo(/* @__PURE__ */ __name(function View
|
|
|
14888
14914
|
}, "ViewerContainer"));
|
|
14889
14915
|
|
|
14890
14916
|
// src/components/pages/PageContainerContentDetails.tsx
|
|
14891
|
-
import { useEffect as useEffect41, useRef as useRef26, useState as
|
|
14917
|
+
import { useEffect as useEffect41, useRef as useRef26, useState as useState51 } from "react";
|
|
14892
14918
|
import { jsx as jsx159, jsxs as jsxs94 } from "react/jsx-runtime";
|
|
14893
14919
|
function PageContainerContentDetails({ items, section, module, id }) {
|
|
14894
14920
|
const rewriteUrl = useUrlRewriter();
|
|
14895
|
-
const [isScrolled, setIsScrolled] =
|
|
14921
|
+
const [isScrolled, setIsScrolled] = useState51(false);
|
|
14896
14922
|
const sentinelRef = useRef26(null);
|
|
14897
14923
|
useEffect41(() => {
|
|
14898
14924
|
const sentinel = sentinelRef.current;
|
|
@@ -14927,11 +14953,11 @@ function PageContainerContentDetails({ items, section, module, id }) {
|
|
|
14927
14953
|
__name(PageContainerContentDetails, "PageContainerContentDetails");
|
|
14928
14954
|
|
|
14929
14955
|
// src/components/pages/PageContentContainer.tsx
|
|
14930
|
-
import { useEffect as useEffect42, useState as
|
|
14956
|
+
import { useEffect as useEffect42, useState as useState52 } from "react";
|
|
14931
14957
|
import { useDefaultLayout } from "react-resizable-panels";
|
|
14932
14958
|
import { jsx as jsx160, jsxs as jsxs95 } from "react/jsx-runtime";
|
|
14933
14959
|
function PageContentContainer({ header, details, footer, content, fullBleed }) {
|
|
14934
|
-
const [mounted, setMounted] =
|
|
14960
|
+
const [mounted, setMounted] = useState52(false);
|
|
14935
14961
|
const isMobile = useIsMobile();
|
|
14936
14962
|
useEffect42(() => {
|
|
14937
14963
|
setMounted(true);
|
|
@@ -15100,12 +15126,12 @@ function JsonApiProvider({ config, children }) {
|
|
|
15100
15126
|
__name(JsonApiProvider, "JsonApiProvider");
|
|
15101
15127
|
|
|
15102
15128
|
// src/client/hooks/useJsonApiGet.ts
|
|
15103
|
-
import { useState as
|
|
15129
|
+
import { useState as useState53, useEffect as useEffect44, useCallback as useCallback29, useRef as useRef27 } from "react";
|
|
15104
15130
|
function useJsonApiGet(params) {
|
|
15105
|
-
const [data, setData] =
|
|
15106
|
-
const [loading, setLoading] =
|
|
15107
|
-
const [error, setError] =
|
|
15108
|
-
const [response, setResponse] =
|
|
15131
|
+
const [data, setData] = useState53(null);
|
|
15132
|
+
const [loading, setLoading] = useState53(false);
|
|
15133
|
+
const [error, setError] = useState53(null);
|
|
15134
|
+
const [response, setResponse] = useState53(null);
|
|
15109
15135
|
const isMounted = useRef27(true);
|
|
15110
15136
|
const fetchData = useCallback29(async () => {
|
|
15111
15137
|
if (params.options?.enabled === false) return;
|
|
@@ -15200,12 +15226,12 @@ function useJsonApiGet(params) {
|
|
|
15200
15226
|
__name(useJsonApiGet, "useJsonApiGet");
|
|
15201
15227
|
|
|
15202
15228
|
// src/client/hooks/useJsonApiMutation.ts
|
|
15203
|
-
import { useState as
|
|
15229
|
+
import { useState as useState54, useCallback as useCallback30 } from "react";
|
|
15204
15230
|
function useJsonApiMutation(config) {
|
|
15205
|
-
const [data, setData] =
|
|
15206
|
-
const [loading, setLoading] =
|
|
15207
|
-
const [error, setError] =
|
|
15208
|
-
const [response, setResponse] =
|
|
15231
|
+
const [data, setData] = useState54(null);
|
|
15232
|
+
const [loading, setLoading] = useState54(false);
|
|
15233
|
+
const [error, setError] = useState54(null);
|
|
15234
|
+
const [response, setResponse] = useState54(null);
|
|
15209
15235
|
const reset = useCallback30(() => {
|
|
15210
15236
|
setData(null);
|
|
15211
15237
|
setLoading(false);
|
|
@@ -15724,15 +15750,15 @@ __name(useOAuthClients, "useOAuthClients");
|
|
|
15724
15750
|
|
|
15725
15751
|
// src/features/oauth/hooks/useOAuthClient.ts
|
|
15726
15752
|
import { useAtomValue as useAtomValue2, useSetAtom as useSetAtom2 } from "jotai";
|
|
15727
|
-
import { useCallback as useCallback32, useEffect as useEffect46, useState as
|
|
15753
|
+
import { useCallback as useCallback32, useEffect as useEffect46, useState as useState55 } from "react";
|
|
15728
15754
|
function useOAuthClient(clientId) {
|
|
15729
15755
|
const storedClient = useAtomValue2(oauthClientByIdAtom(clientId));
|
|
15730
15756
|
const updateClientInStore = useSetAtom2(updateOAuthClientAtom);
|
|
15731
15757
|
const removeClientFromStore = useSetAtom2(removeOAuthClientAtom);
|
|
15732
15758
|
const setNewClientSecret = useSetAtom2(setNewClientSecretAtom);
|
|
15733
|
-
const [fetchedClient, setFetchedClient] =
|
|
15734
|
-
const [isLoading, setIsLoading] =
|
|
15735
|
-
const [error, setError] =
|
|
15759
|
+
const [fetchedClient, setFetchedClient] = useState55(null);
|
|
15760
|
+
const [isLoading, setIsLoading] = useState55(false);
|
|
15761
|
+
const [error, setError] = useState55(null);
|
|
15736
15762
|
const client = storedClient || fetchedClient;
|
|
15737
15763
|
const fetchClient = useCallback32(async () => {
|
|
15738
15764
|
if (!clientId) return;
|
|
@@ -15822,12 +15848,12 @@ function useOAuthClient(clientId) {
|
|
|
15822
15848
|
__name(useOAuthClient, "useOAuthClient");
|
|
15823
15849
|
|
|
15824
15850
|
// src/features/oauth/hooks/useOAuthConsent.ts
|
|
15825
|
-
import { useCallback as useCallback33, useEffect as useEffect47, useState as
|
|
15851
|
+
import { useCallback as useCallback33, useEffect as useEffect47, useState as useState56 } from "react";
|
|
15826
15852
|
function useOAuthConsent(params) {
|
|
15827
|
-
const [clientInfo, setClientInfo] =
|
|
15828
|
-
const [isLoading, setIsLoading] =
|
|
15829
|
-
const [error, setError] =
|
|
15830
|
-
const [isSubmitting, setIsSubmitting] =
|
|
15853
|
+
const [clientInfo, setClientInfo] = useState56(null);
|
|
15854
|
+
const [isLoading, setIsLoading] = useState56(true);
|
|
15855
|
+
const [error, setError] = useState56(null);
|
|
15856
|
+
const [isSubmitting, setIsSubmitting] = useState56(false);
|
|
15831
15857
|
useEffect47(() => {
|
|
15832
15858
|
const fetchInfo = /* @__PURE__ */ __name(async () => {
|
|
15833
15859
|
if (!params.clientId || !params.redirectUri || !params.scope) {
|
|
@@ -15903,20 +15929,20 @@ registerTableGenerator("companies", useCompanyTableStructure);
|
|
|
15903
15929
|
// src/components/tables/ContentListTable.tsx
|
|
15904
15930
|
import { flexRender, getCoreRowModel, getExpandedRowModel, useReactTable } from "@tanstack/react-table";
|
|
15905
15931
|
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
15906
|
-
import React28, { memo, useMemo as useMemo28, useState as
|
|
15932
|
+
import React28, { memo, useMemo as useMemo28, useState as useState58 } from "react";
|
|
15907
15933
|
|
|
15908
15934
|
// src/components/tables/ContentTableSearch.tsx
|
|
15909
15935
|
import { RefreshCw, Search, X as X3 } from "lucide-react";
|
|
15910
15936
|
import { useTranslations as useTranslations57 } from "next-intl";
|
|
15911
|
-
import { useCallback as useCallback34, useEffect as useEffect48, useRef as useRef28, useState as
|
|
15937
|
+
import { useCallback as useCallback34, useEffect as useEffect48, useRef as useRef28, useState as useState57 } from "react";
|
|
15912
15938
|
import { jsx as jsx170, jsxs as jsxs97 } from "react/jsx-runtime";
|
|
15913
15939
|
function ContentTableSearch({ data }) {
|
|
15914
15940
|
const t = useTranslations57();
|
|
15915
15941
|
const searchTermRef = useRef28("");
|
|
15916
15942
|
const inputRef = useRef28(null);
|
|
15917
|
-
const [searchTerm, setSearchTerm] =
|
|
15918
|
-
const [isFocused, setIsFocused] =
|
|
15919
|
-
const [isSearching, setIsSearching] =
|
|
15943
|
+
const [searchTerm, setSearchTerm] = useState57("");
|
|
15944
|
+
const [isFocused, setIsFocused] = useState57(false);
|
|
15945
|
+
const [isSearching, setIsSearching] = useState57(false);
|
|
15920
15946
|
const isExpanded = isFocused || searchTerm.length > 0;
|
|
15921
15947
|
const search = useCallback34(
|
|
15922
15948
|
async (searchedTerm) => {
|
|
@@ -16011,7 +16037,7 @@ function getGroupKeys(item, field) {
|
|
|
16011
16037
|
__name(getGroupKeys, "getGroupKeys");
|
|
16012
16038
|
var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(props) {
|
|
16013
16039
|
const { data, fields, checkedIds, toggleId, allowSearch, filters: _filters, fullWidth } = props;
|
|
16014
|
-
const [expanded, setExpanded] =
|
|
16040
|
+
const [expanded, setExpanded] = useState58(
|
|
16015
16041
|
props.defaultExpanded === true ? true : typeof props.defaultExpanded === "object" ? props.defaultExpanded : {}
|
|
16016
16042
|
);
|
|
16017
16043
|
const { data: tableData, columns: tableColumns } = useTableGenerator(props.tableGeneratorType, {
|
|
@@ -16257,15 +16283,15 @@ __name(validateItalianTaxCode, "validateItalianTaxCode");
|
|
|
16257
16283
|
|
|
16258
16284
|
// src/components/fiscal/ItalianFiscalData.tsx
|
|
16259
16285
|
import { useTranslations as useTranslations58 } from "next-intl";
|
|
16260
|
-
import { forwardRef as forwardRef8, useCallback as useCallback35, useImperativeHandle as useImperativeHandle2, useRef as useRef30, useState as
|
|
16286
|
+
import { forwardRef as forwardRef8, useCallback as useCallback35, useImperativeHandle as useImperativeHandle2, useRef as useRef30, useState as useState59 } from "react";
|
|
16261
16287
|
import { z as z4 } from "zod";
|
|
16262
16288
|
import { jsx as jsx173, jsxs as jsxs100 } from "react/jsx-runtime";
|
|
16263
16289
|
var ItalianFiscalData = forwardRef8(/* @__PURE__ */ __name(function ItalianFiscalData2({ initialData }, ref) {
|
|
16264
16290
|
const t = useTranslations58();
|
|
16265
16291
|
const initialRef = useRef30(initialData);
|
|
16266
|
-
const [fiscalData, setFiscalData] =
|
|
16292
|
+
const [fiscalData, setFiscalData] = useState59(initialData);
|
|
16267
16293
|
const fiscalDataRef = useRef30(initialData);
|
|
16268
|
-
const [fiscalErrors, setFiscalErrors] =
|
|
16294
|
+
const [fiscalErrors, setFiscalErrors] = useState59({});
|
|
16269
16295
|
const updateFiscalField = useCallback35((key, value) => {
|
|
16270
16296
|
setFiscalData((prev) => {
|
|
16271
16297
|
const next = { ...prev, [key]: value };
|
|
@@ -16370,7 +16396,7 @@ var ItalianFiscalData_default = ItalianFiscalData;
|
|
|
16370
16396
|
import Image8 from "next/image";
|
|
16371
16397
|
|
|
16372
16398
|
// src/features/auth/contexts/AuthContext.tsx
|
|
16373
|
-
import { createContext as
|
|
16399
|
+
import { createContext as createContext21, useContext as useContext22, useMemo as useMemo29, useState as useState61 } from "react";
|
|
16374
16400
|
|
|
16375
16401
|
// src/features/auth/components/forms/Register.tsx
|
|
16376
16402
|
import { zodResolver as zodResolver5 } from "@hookform/resolvers/zod";
|
|
@@ -16378,7 +16404,7 @@ import { Loader2 as Loader23 } from "lucide-react";
|
|
|
16378
16404
|
import { useTranslations as useTranslations60 } from "next-intl";
|
|
16379
16405
|
import Image7 from "next/image";
|
|
16380
16406
|
import { useSearchParams as useSearchParams2 } from "next/navigation";
|
|
16381
|
-
import { useEffect as useEffect50, useState as
|
|
16407
|
+
import { useEffect as useEffect50, useState as useState60 } from "react";
|
|
16382
16408
|
import { useForm as useForm5 } from "react-hook-form";
|
|
16383
16409
|
import { v4 as v45 } from "uuid";
|
|
16384
16410
|
import { z as z5 } from "zod";
|
|
@@ -16449,13 +16475,13 @@ function Register() {
|
|
|
16449
16475
|
const searchParams = useSearchParams2();
|
|
16450
16476
|
const inviteCode = searchParams.get("invite");
|
|
16451
16477
|
const registrationMode = getRegistrationMode();
|
|
16452
|
-
const [showConfirmation, setShowConfirmation] =
|
|
16453
|
-
const [inviteValidated, setInviteValidated] =
|
|
16454
|
-
const [inviteError, setInviteError] =
|
|
16455
|
-
const [isValidatingInvite, setIsValidatingInvite] =
|
|
16478
|
+
const [showConfirmation, setShowConfirmation] = useState60(false);
|
|
16479
|
+
const [inviteValidated, setInviteValidated] = useState60(false);
|
|
16480
|
+
const [inviteError, setInviteError] = useState60("");
|
|
16481
|
+
const [isValidatingInvite, setIsValidatingInvite] = useState60(
|
|
16456
16482
|
registrationMode === "waitlist" && !!inviteCode
|
|
16457
16483
|
);
|
|
16458
|
-
const [referralCode, setReferralCode2] =
|
|
16484
|
+
const [referralCode, setReferralCode2] = useState60(null);
|
|
16459
16485
|
useEffect50(() => {
|
|
16460
16486
|
const code = getReferralCode();
|
|
16461
16487
|
setReferralCode2(code);
|
|
@@ -16720,15 +16746,15 @@ __name(Register, "Register");
|
|
|
16720
16746
|
|
|
16721
16747
|
// src/features/auth/contexts/AuthContext.tsx
|
|
16722
16748
|
import { jsx as jsx176 } from "react/jsx-runtime";
|
|
16723
|
-
var AuthContext =
|
|
16749
|
+
var AuthContext = createContext21(void 0);
|
|
16724
16750
|
var AuthContextProvider = /* @__PURE__ */ __name(({
|
|
16725
16751
|
children,
|
|
16726
16752
|
initialComponentType,
|
|
16727
16753
|
initialParams
|
|
16728
16754
|
}) => {
|
|
16729
|
-
const [componentType, setComponentType] =
|
|
16730
|
-
const [params, setParams] =
|
|
16731
|
-
const [pendingTwoFactor, setPendingTwoFactor] =
|
|
16755
|
+
const [componentType, setComponentType] = useState61(initialComponentType);
|
|
16756
|
+
const [params, setParams] = useState61(initialParams);
|
|
16757
|
+
const [pendingTwoFactor, setPendingTwoFactor] = useState61();
|
|
16732
16758
|
const activeComponent = useMemo29(() => {
|
|
16733
16759
|
if (componentType === void 0) return null;
|
|
16734
16760
|
switch (componentType) {
|
|
@@ -16766,7 +16792,7 @@ var AuthContextProvider = /* @__PURE__ */ __name(({
|
|
|
16766
16792
|
);
|
|
16767
16793
|
}, "AuthContextProvider");
|
|
16768
16794
|
var useAuthContext = /* @__PURE__ */ __name(() => {
|
|
16769
|
-
const context =
|
|
16795
|
+
const context = useContext22(AuthContext);
|
|
16770
16796
|
if (context === void 0) {
|
|
16771
16797
|
throw new Error("useAuthContext must be used within a AuthComponentProvider");
|
|
16772
16798
|
}
|
|
@@ -16790,20 +16816,20 @@ __name(InnerAuthContainer, "InnerAuthContainer");
|
|
|
16790
16816
|
// src/features/auth/components/two-factor/TwoFactorSettings.tsx
|
|
16791
16817
|
import { ShieldAlert, ShieldCheck } from "lucide-react";
|
|
16792
16818
|
import { useTranslations as useTranslations67 } from "next-intl";
|
|
16793
|
-
import { useCallback as useCallback36, useEffect as useEffect52, useState as
|
|
16819
|
+
import { useCallback as useCallback36, useEffect as useEffect52, useState as useState69 } from "react";
|
|
16794
16820
|
import { v4 as v48 } from "uuid";
|
|
16795
16821
|
|
|
16796
16822
|
// src/features/auth/components/two-factor/BackupCodesDialog.tsx
|
|
16797
16823
|
import { Copy, Download, RefreshCw as RefreshCw2 } from "lucide-react";
|
|
16798
16824
|
import { useTranslations as useTranslations61 } from "next-intl";
|
|
16799
|
-
import { useState as
|
|
16825
|
+
import { useState as useState62 } from "react";
|
|
16800
16826
|
import { jsx as jsx178, jsxs as jsxs103 } from "react/jsx-runtime";
|
|
16801
16827
|
function BackupCodesDialog({ remainingCodes, onRegenerate, trigger }) {
|
|
16802
16828
|
const t = useTranslations61();
|
|
16803
|
-
const [open, setOpen] =
|
|
16804
|
-
const [codes, setCodes] =
|
|
16805
|
-
const [isLoading, setIsLoading] =
|
|
16806
|
-
const [showCodes, setShowCodes] =
|
|
16829
|
+
const [open, setOpen] = useState62(false);
|
|
16830
|
+
const [codes, setCodes] = useState62([]);
|
|
16831
|
+
const [isLoading, setIsLoading] = useState62(false);
|
|
16832
|
+
const [showCodes, setShowCodes] = useState62(false);
|
|
16807
16833
|
const handleGenerate = /* @__PURE__ */ __name(async () => {
|
|
16808
16834
|
setIsLoading(true);
|
|
16809
16835
|
try {
|
|
@@ -16898,13 +16924,13 @@ __name(BackupCodesDialog, "BackupCodesDialog");
|
|
|
16898
16924
|
|
|
16899
16925
|
// src/features/auth/components/two-factor/DisableTwoFactorDialog.tsx
|
|
16900
16926
|
import { useTranslations as useTranslations62 } from "next-intl";
|
|
16901
|
-
import { useState as
|
|
16927
|
+
import { useState as useState64 } from "react";
|
|
16902
16928
|
|
|
16903
16929
|
// src/features/auth/components/two-factor/TotpInput.tsx
|
|
16904
|
-
import { useEffect as useEffect51, useRef as useRef31, useState as
|
|
16930
|
+
import { useEffect as useEffect51, useRef as useRef31, useState as useState63 } from "react";
|
|
16905
16931
|
import { jsx as jsx179, jsxs as jsxs104 } from "react/jsx-runtime";
|
|
16906
16932
|
function TotpInput({ onComplete, disabled = false, autoFocus = true, error }) {
|
|
16907
|
-
const [digits, setDigits] =
|
|
16933
|
+
const [digits, setDigits] = useState63(["", "", "", "", "", ""]);
|
|
16908
16934
|
const inputRefs = useRef31([]);
|
|
16909
16935
|
useEffect51(() => {
|
|
16910
16936
|
if (autoFocus && inputRefs.current[0]) {
|
|
@@ -16968,9 +16994,9 @@ __name(TotpInput, "TotpInput");
|
|
|
16968
16994
|
import { jsx as jsx180, jsxs as jsxs105 } from "react/jsx-runtime";
|
|
16969
16995
|
function DisableTwoFactorDialog({ onSuccess, trigger }) {
|
|
16970
16996
|
const t = useTranslations62();
|
|
16971
|
-
const [open, setOpen] =
|
|
16972
|
-
const [isLoading, setIsLoading] =
|
|
16973
|
-
const [error, setError] =
|
|
16997
|
+
const [open, setOpen] = useState64(false);
|
|
16998
|
+
const [isLoading, setIsLoading] = useState64(false);
|
|
16999
|
+
const [error, setError] = useState64();
|
|
16974
17000
|
const handleVerify = /* @__PURE__ */ __name(async (code) => {
|
|
16975
17001
|
setIsLoading(true);
|
|
16976
17002
|
setError(void 0);
|
|
@@ -17011,14 +17037,14 @@ __name(DisableTwoFactorDialog, "DisableTwoFactorDialog");
|
|
|
17011
17037
|
// src/features/auth/components/two-factor/PasskeyList.tsx
|
|
17012
17038
|
import { Edit, Key, Trash2 } from "lucide-react";
|
|
17013
17039
|
import { useTranslations as useTranslations63 } from "next-intl";
|
|
17014
|
-
import { useState as
|
|
17040
|
+
import { useState as useState65 } from "react";
|
|
17015
17041
|
import { Fragment as Fragment31, jsx as jsx181, jsxs as jsxs106 } from "react/jsx-runtime";
|
|
17016
17042
|
function PasskeyList({ passkeys, onRefresh }) {
|
|
17017
17043
|
const t = useTranslations63();
|
|
17018
|
-
const [renameDialogOpen, setRenameDialogOpen] =
|
|
17019
|
-
const [selectedPasskey, setSelectedPasskey] =
|
|
17020
|
-
const [newName, setNewName] =
|
|
17021
|
-
const [isLoading, setIsLoading] =
|
|
17044
|
+
const [renameDialogOpen, setRenameDialogOpen] = useState65(false);
|
|
17045
|
+
const [selectedPasskey, setSelectedPasskey] = useState65(null);
|
|
17046
|
+
const [newName, setNewName] = useState65("");
|
|
17047
|
+
const [isLoading, setIsLoading] = useState65(false);
|
|
17022
17048
|
const handleDelete = /* @__PURE__ */ __name(async (passkey) => {
|
|
17023
17049
|
setIsLoading(true);
|
|
17024
17050
|
try {
|
|
@@ -17132,14 +17158,14 @@ __name(PasskeyList, "PasskeyList");
|
|
|
17132
17158
|
// src/features/auth/components/two-factor/PasskeySetupDialog.tsx
|
|
17133
17159
|
import { startRegistration } from "@simplewebauthn/browser";
|
|
17134
17160
|
import { useTranslations as useTranslations64 } from "next-intl";
|
|
17135
|
-
import { useState as
|
|
17161
|
+
import { useState as useState66 } from "react";
|
|
17136
17162
|
import { v4 as v46 } from "uuid";
|
|
17137
17163
|
import { jsx as jsx182, jsxs as jsxs107 } from "react/jsx-runtime";
|
|
17138
17164
|
function PasskeySetupDialog({ open, onOpenChange, onSuccess }) {
|
|
17139
17165
|
const t = useTranslations64();
|
|
17140
17166
|
const { currentUser } = useCurrentUserContext();
|
|
17141
|
-
const [name, setName] =
|
|
17142
|
-
const [isLoading, setIsLoading] =
|
|
17167
|
+
const [name, setName] = useState66("");
|
|
17168
|
+
const [isLoading, setIsLoading] = useState66(false);
|
|
17143
17169
|
const handleRegister = /* @__PURE__ */ __name(async () => {
|
|
17144
17170
|
if (!name.trim()) return;
|
|
17145
17171
|
setIsLoading(true);
|
|
@@ -17203,11 +17229,11 @@ __name(PasskeySetupDialog, "PasskeySetupDialog");
|
|
|
17203
17229
|
// src/features/auth/components/two-factor/TotpAuthenticatorList.tsx
|
|
17204
17230
|
import { Smartphone, Trash2 as Trash22 } from "lucide-react";
|
|
17205
17231
|
import { useTranslations as useTranslations65 } from "next-intl";
|
|
17206
|
-
import { useState as
|
|
17232
|
+
import { useState as useState67 } from "react";
|
|
17207
17233
|
import { jsx as jsx183, jsxs as jsxs108 } from "react/jsx-runtime";
|
|
17208
17234
|
function TotpAuthenticatorList({ authenticators, onDelete }) {
|
|
17209
17235
|
const t = useTranslations65();
|
|
17210
|
-
const [deletingId, setDeletingId] =
|
|
17236
|
+
const [deletingId, setDeletingId] = useState67(null);
|
|
17211
17237
|
const handleDelete = /* @__PURE__ */ __name(async (id) => {
|
|
17212
17238
|
setDeletingId(id);
|
|
17213
17239
|
try {
|
|
@@ -17278,19 +17304,19 @@ __name(TotpAuthenticatorList, "TotpAuthenticatorList");
|
|
|
17278
17304
|
// src/features/auth/components/two-factor/TotpSetupDialog.tsx
|
|
17279
17305
|
import { useTranslations as useTranslations66 } from "next-intl";
|
|
17280
17306
|
import { QRCodeSVG } from "qrcode.react";
|
|
17281
|
-
import { useState as
|
|
17307
|
+
import { useState as useState68 } from "react";
|
|
17282
17308
|
import { v4 as v47 } from "uuid";
|
|
17283
17309
|
import { jsx as jsx184, jsxs as jsxs109 } from "react/jsx-runtime";
|
|
17284
17310
|
function TotpSetupDialog({ onSuccess, trigger }) {
|
|
17285
17311
|
const t = useTranslations66();
|
|
17286
17312
|
const { currentUser } = useCurrentUserContext();
|
|
17287
|
-
const [open, setOpen] =
|
|
17288
|
-
const [step, setStep] =
|
|
17289
|
-
const [name, setName] =
|
|
17290
|
-
const [qrCodeUri, setQrCodeUri] =
|
|
17291
|
-
const [authenticatorId, setAuthenticatorId] =
|
|
17292
|
-
const [isLoading, setIsLoading] =
|
|
17293
|
-
const [verifyError, setVerifyError] =
|
|
17313
|
+
const [open, setOpen] = useState68(false);
|
|
17314
|
+
const [step, setStep] = useState68("name");
|
|
17315
|
+
const [name, setName] = useState68("");
|
|
17316
|
+
const [qrCodeUri, setQrCodeUri] = useState68("");
|
|
17317
|
+
const [authenticatorId, setAuthenticatorId] = useState68("");
|
|
17318
|
+
const [isLoading, setIsLoading] = useState68(false);
|
|
17319
|
+
const [verifyError, setVerifyError] = useState68();
|
|
17294
17320
|
const handleStartSetup = /* @__PURE__ */ __name(async () => {
|
|
17295
17321
|
if (!name.trim()) return;
|
|
17296
17322
|
setIsLoading(true);
|
|
@@ -17388,12 +17414,12 @@ __name(TotpSetupDialog, "TotpSetupDialog");
|
|
|
17388
17414
|
import { Fragment as Fragment32, jsx as jsx185, jsxs as jsxs110 } from "react/jsx-runtime";
|
|
17389
17415
|
function TwoFactorSettings() {
|
|
17390
17416
|
const t = useTranslations67();
|
|
17391
|
-
const [status, setStatus] =
|
|
17392
|
-
const [authenticators, setAuthenticators] =
|
|
17393
|
-
const [passkeys, setPasskeys] =
|
|
17394
|
-
const [isLoading, setIsLoading] =
|
|
17395
|
-
const [isEnabling, setIsEnabling] =
|
|
17396
|
-
const [passkeyDialogOpen, setPasskeyDialogOpen] =
|
|
17417
|
+
const [status, setStatus] = useState69(null);
|
|
17418
|
+
const [authenticators, setAuthenticators] = useState69([]);
|
|
17419
|
+
const [passkeys, setPasskeys] = useState69([]);
|
|
17420
|
+
const [isLoading, setIsLoading] = useState69(true);
|
|
17421
|
+
const [isEnabling, setIsEnabling] = useState69(false);
|
|
17422
|
+
const [passkeyDialogOpen, setPasskeyDialogOpen] = useState69(false);
|
|
17397
17423
|
const loadStatus = useCallback36(async () => {
|
|
17398
17424
|
try {
|
|
17399
17425
|
const [statusData, authenticatorsList, passkeysList] = await Promise.all([
|
|
@@ -17600,14 +17626,14 @@ __name(LandingComponent, "LandingComponent");
|
|
|
17600
17626
|
import { zodResolver as zodResolver6 } from "@hookform/resolvers/zod";
|
|
17601
17627
|
import { useTranslations as useTranslations69 } from "next-intl";
|
|
17602
17628
|
import Image10 from "next/image";
|
|
17603
|
-
import { useEffect as useEffect53, useState as
|
|
17629
|
+
import { useEffect as useEffect53, useState as useState70 } from "react";
|
|
17604
17630
|
import { useForm as useForm6 } from "react-hook-form";
|
|
17605
17631
|
import { z as z6 } from "zod";
|
|
17606
17632
|
import { Fragment as Fragment34, jsx as jsx189, jsxs as jsxs113 } from "react/jsx-runtime";
|
|
17607
17633
|
function AcceptInvitation() {
|
|
17608
17634
|
const { setComponentType, params, setParams } = useAuthContext();
|
|
17609
|
-
const [showConfirmation, setShowConfirmation] =
|
|
17610
|
-
const [error, setError] =
|
|
17635
|
+
const [showConfirmation, setShowConfirmation] = useState70(false);
|
|
17636
|
+
const [error, setError] = useState70(void 0);
|
|
17611
17637
|
const t = useTranslations69();
|
|
17612
17638
|
useEffect53(() => {
|
|
17613
17639
|
async function validateCode(code) {
|
|
@@ -17702,12 +17728,12 @@ __name(AcceptInvitation, "AcceptInvitation");
|
|
|
17702
17728
|
// src/features/auth/components/forms/ActivateAccount.tsx
|
|
17703
17729
|
import { useTranslations as useTranslations70 } from "next-intl";
|
|
17704
17730
|
import Image11 from "next/image";
|
|
17705
|
-
import { useEffect as useEffect54, useState as
|
|
17731
|
+
import { useEffect as useEffect54, useState as useState71 } from "react";
|
|
17706
17732
|
import { Fragment as Fragment35, jsx as jsx190, jsxs as jsxs114 } from "react/jsx-runtime";
|
|
17707
17733
|
function ActivateAccount() {
|
|
17708
17734
|
const { setComponentType, params, setParams } = useAuthContext();
|
|
17709
|
-
const [showConfirmation, setShowConfirmation] =
|
|
17710
|
-
const [error, setError] =
|
|
17735
|
+
const [showConfirmation, setShowConfirmation] = useState71(false);
|
|
17736
|
+
const [error, setError] = useState71(void 0);
|
|
17711
17737
|
const t = useTranslations70();
|
|
17712
17738
|
useEffect54(() => {
|
|
17713
17739
|
async function ActivateAccount2(code) {
|
|
@@ -17750,11 +17776,11 @@ function ActivateAccount() {
|
|
|
17750
17776
|
__name(ActivateAccount, "ActivateAccount");
|
|
17751
17777
|
|
|
17752
17778
|
// src/features/auth/components/forms/Cookies.tsx
|
|
17753
|
-
import { useEffect as useEffect55, useState as
|
|
17779
|
+
import { useEffect as useEffect55, useState as useState72 } from "react";
|
|
17754
17780
|
function Cookies({ dehydratedAuth, page }) {
|
|
17755
17781
|
const { setUser } = useCurrentUserContext();
|
|
17756
17782
|
const router = useI18nRouter();
|
|
17757
|
-
const [hasSaved, setHasSaved] =
|
|
17783
|
+
const [hasSaved, setHasSaved] = useState72(false);
|
|
17758
17784
|
useEffect55(() => {
|
|
17759
17785
|
if (hasSaved) return;
|
|
17760
17786
|
async function saveTokenOnServer() {
|
|
@@ -17778,14 +17804,14 @@ __name(Cookies, "Cookies");
|
|
|
17778
17804
|
import { zodResolver as zodResolver7 } from "@hookform/resolvers/zod";
|
|
17779
17805
|
import { useTranslations as useTranslations71 } from "next-intl";
|
|
17780
17806
|
import Image12 from "next/image";
|
|
17781
|
-
import { useState as
|
|
17807
|
+
import { useState as useState73 } from "react";
|
|
17782
17808
|
import { useForm as useForm7 } from "react-hook-form";
|
|
17783
17809
|
import { z as z7 } from "zod";
|
|
17784
17810
|
import { Fragment as Fragment36, jsx as jsx191, jsxs as jsxs115 } from "react/jsx-runtime";
|
|
17785
17811
|
function ForgotPassword() {
|
|
17786
17812
|
const t = useTranslations71();
|
|
17787
17813
|
const { setComponentType } = useAuthContext();
|
|
17788
|
-
const [showConfirmation, setShowConfirmation] =
|
|
17814
|
+
const [showConfirmation, setShowConfirmation] = useState73(false);
|
|
17789
17815
|
const formSchema = z7.object({
|
|
17790
17816
|
email: z7.string().email({
|
|
17791
17817
|
message: t(`common.errors.invalid_email`)
|
|
@@ -17850,7 +17876,7 @@ import { zodResolver as zodResolver8 } from "@hookform/resolvers/zod";
|
|
|
17850
17876
|
import { useTranslations as useTranslations72 } from "next-intl";
|
|
17851
17877
|
import Image13 from "next/image";
|
|
17852
17878
|
import { useRouter, useSearchParams as useSearchParams3 } from "next/navigation";
|
|
17853
|
-
import { useEffect as useEffect56, useState as
|
|
17879
|
+
import { useEffect as useEffect56, useState as useState74 } from "react";
|
|
17854
17880
|
import { useForm as useForm8 } from "react-hook-form";
|
|
17855
17881
|
import { z as z8 } from "zod";
|
|
17856
17882
|
import { Fragment as Fragment37, jsx as jsx192, jsxs as jsxs116 } from "react/jsx-runtime";
|
|
@@ -17863,7 +17889,7 @@ function Login() {
|
|
|
17863
17889
|
const nativeRouter = useRouter();
|
|
17864
17890
|
const searchParams = useSearchParams3();
|
|
17865
17891
|
const callbackUrl = searchParams.get("callbackUrl");
|
|
17866
|
-
const [referralCode, setReferralCode2] =
|
|
17892
|
+
const [referralCode, setReferralCode2] = useState74(null);
|
|
17867
17893
|
useEffect56(() => {
|
|
17868
17894
|
const cookies = document.cookie.split("; ");
|
|
17869
17895
|
for (const cookie of cookies) {
|
|
@@ -18046,14 +18072,14 @@ __name(RefreshUser, "RefreshUser");
|
|
|
18046
18072
|
import { zodResolver as zodResolver9 } from "@hookform/resolvers/zod";
|
|
18047
18073
|
import { useTranslations as useTranslations73 } from "next-intl";
|
|
18048
18074
|
import Image14 from "next/image";
|
|
18049
|
-
import { useEffect as useEffect59, useState as
|
|
18075
|
+
import { useEffect as useEffect59, useState as useState75 } from "react";
|
|
18050
18076
|
import { useForm as useForm9 } from "react-hook-form";
|
|
18051
18077
|
import { z as z9 } from "zod";
|
|
18052
18078
|
import { Fragment as Fragment39, jsx as jsx194, jsxs as jsxs117 } from "react/jsx-runtime";
|
|
18053
18079
|
function ResetPassword() {
|
|
18054
18080
|
const { setComponentType, params, setParams } = useAuthContext();
|
|
18055
|
-
const [showConfirmation, setShowConfirmation] =
|
|
18056
|
-
const [error, setError] =
|
|
18081
|
+
const [showConfirmation, setShowConfirmation] = useState75(false);
|
|
18082
|
+
const [error, setError] = useState75(void 0);
|
|
18057
18083
|
const t = useTranslations73();
|
|
18058
18084
|
useEffect59(() => {
|
|
18059
18085
|
async function validateResetPasswordCode(code) {
|
|
@@ -18132,18 +18158,18 @@ __name(ResetPassword, "ResetPassword");
|
|
|
18132
18158
|
// src/features/auth/components/forms/TwoFactorChallenge.tsx
|
|
18133
18159
|
import { useTranslations as useTranslations75 } from "next-intl";
|
|
18134
18160
|
import { useRouter as useRouter2, useSearchParams as useSearchParams4 } from "next/navigation";
|
|
18135
|
-
import { useState as
|
|
18161
|
+
import { useState as useState77 } from "react";
|
|
18136
18162
|
import { v4 as v410 } from "uuid";
|
|
18137
18163
|
|
|
18138
18164
|
// src/features/auth/components/two-factor/PasskeyButton.tsx
|
|
18139
18165
|
import { startAuthentication } from "@simplewebauthn/browser";
|
|
18140
18166
|
import { useTranslations as useTranslations74 } from "next-intl";
|
|
18141
|
-
import { useState as
|
|
18167
|
+
import { useState as useState76 } from "react";
|
|
18142
18168
|
import { v4 as v49 } from "uuid";
|
|
18143
18169
|
import { jsx as jsx195 } from "react/jsx-runtime";
|
|
18144
18170
|
function PasskeyButton({ pendingToken, onSuccess, onError, disabled = false }) {
|
|
18145
18171
|
const t = useTranslations74();
|
|
18146
|
-
const [isLoading, setIsLoading] =
|
|
18172
|
+
const [isLoading, setIsLoading] = useState76(false);
|
|
18147
18173
|
const handleClick = /* @__PURE__ */ __name(async () => {
|
|
18148
18174
|
setIsLoading(true);
|
|
18149
18175
|
try {
|
|
@@ -18188,10 +18214,10 @@ function TwoFactorChallenge() {
|
|
|
18188
18214
|
const nativeRouter = useRouter2();
|
|
18189
18215
|
const searchParams = useSearchParams4();
|
|
18190
18216
|
const callbackUrl = searchParams.get("callbackUrl");
|
|
18191
|
-
const [isVerifying, setIsVerifying] =
|
|
18192
|
-
const [totpError, setTotpError] =
|
|
18193
|
-
const [backupCode, setBackupCode] =
|
|
18194
|
-
const [backupError, setBackupError] =
|
|
18217
|
+
const [isVerifying, setIsVerifying] = useState77(false);
|
|
18218
|
+
const [totpError, setTotpError] = useState77();
|
|
18219
|
+
const [backupCode, setBackupCode] = useState77("");
|
|
18220
|
+
const [backupError, setBackupError] = useState77();
|
|
18195
18221
|
if (!pendingTwoFactor) {
|
|
18196
18222
|
return null;
|
|
18197
18223
|
}
|
|
@@ -18394,7 +18420,7 @@ __name(RelevantContentsList, "RelevantContentsList");
|
|
|
18394
18420
|
// src/features/how-to/components/containers/HowToCommand.tsx
|
|
18395
18421
|
import { ArrowRight, LifeBuoyIcon } from "lucide-react";
|
|
18396
18422
|
import { useTranslations as useTranslations80 } from "next-intl";
|
|
18397
|
-
import { useCallback as useCallback37, useEffect as useEffect60, useMemo as useMemo31, useRef as useRef32, useState as
|
|
18423
|
+
import { useCallback as useCallback37, useEffect as useEffect60, useMemo as useMemo31, useRef as useRef32, useState as useState78 } from "react";
|
|
18398
18424
|
|
|
18399
18425
|
// src/features/how-to/components/containers/HowToCommandViewer.tsx
|
|
18400
18426
|
import { ArrowLeft, BookOpen, MessageSquare } from "lucide-react";
|
|
@@ -18520,10 +18546,10 @@ function matchPage(pathname, pattern) {
|
|
|
18520
18546
|
__name(matchPage, "matchPage");
|
|
18521
18547
|
function HowToCommand({ pathname, extraGroups, onStartChat }) {
|
|
18522
18548
|
const t = useTranslations80();
|
|
18523
|
-
const [dialogOpen, setDialogOpen] =
|
|
18524
|
-
const [selectedHowTo, setSelectedHowTo] =
|
|
18549
|
+
const [dialogOpen, setDialogOpen] = useState78(false);
|
|
18550
|
+
const [selectedHowTo, setSelectedHowTo] = useState78(null);
|
|
18525
18551
|
const searchTermRef = useRef32("");
|
|
18526
|
-
const [searchTerm, setSearchTerm] =
|
|
18552
|
+
const [searchTerm, setSearchTerm] = useState78("");
|
|
18527
18553
|
const data = useDataListRetriever({
|
|
18528
18554
|
retriever: /* @__PURE__ */ __name((params) => {
|
|
18529
18555
|
return HowToService.findMany(params);
|
|
@@ -18832,7 +18858,7 @@ __name(HowToListContainer, "HowToListContainer");
|
|
|
18832
18858
|
// src/features/how-to/components/forms/HowToSelector.tsx
|
|
18833
18859
|
import { CircleX as CircleX2, RefreshCwIcon as RefreshCwIcon3, SearchIcon as SearchIcon6, XIcon as XIcon10 } from "lucide-react";
|
|
18834
18860
|
import { useTranslations as useTranslations84 } from "next-intl";
|
|
18835
|
-
import { useCallback as useCallback38, useEffect as useEffect61, useRef as useRef33, useState as
|
|
18861
|
+
import { useCallback as useCallback38, useEffect as useEffect61, useRef as useRef33, useState as useState79 } from "react";
|
|
18836
18862
|
import { Fragment as Fragment43, jsx as jsx208, jsxs as jsxs123 } from "react/jsx-runtime";
|
|
18837
18863
|
function HowToSelector({
|
|
18838
18864
|
id,
|
|
@@ -18843,10 +18869,10 @@ function HowToSelector({
|
|
|
18843
18869
|
isRequired = false
|
|
18844
18870
|
}) {
|
|
18845
18871
|
const t = useTranslations84();
|
|
18846
|
-
const [open, setOpen] =
|
|
18872
|
+
const [open, setOpen] = useState79(false);
|
|
18847
18873
|
const searchTermRef = useRef33("");
|
|
18848
|
-
const [searchTerm, setSearchTerm] =
|
|
18849
|
-
const [isSearching, setIsSearching] =
|
|
18874
|
+
const [searchTerm, setSearchTerm] = useState79("");
|
|
18875
|
+
const [isSearching, setIsSearching] = useState79(false);
|
|
18850
18876
|
const data = useDataListRetriever({
|
|
18851
18877
|
retriever: /* @__PURE__ */ __name((params) => {
|
|
18852
18878
|
return HowToService.findMany(params);
|
|
@@ -18995,18 +19021,18 @@ function AssistantSidebar({ threads, activeId, onSelect, onNew }) {
|
|
|
18995
19021
|
__name(AssistantSidebar, "AssistantSidebar");
|
|
18996
19022
|
|
|
18997
19023
|
// src/features/assistant/components/parts/AssistantEmptyState.tsx
|
|
18998
|
-
import { useState as
|
|
19024
|
+
import { useState as useState81 } from "react";
|
|
18999
19025
|
import { useTranslations as useTranslations87 } from "next-intl";
|
|
19000
19026
|
import { Sparkles } from "lucide-react";
|
|
19001
19027
|
|
|
19002
19028
|
// src/features/assistant/components/parts/AssistantComposer.tsx
|
|
19003
|
-
import { useState as
|
|
19029
|
+
import { useState as useState80 } from "react";
|
|
19004
19030
|
import { useTranslations as useTranslations86 } from "next-intl";
|
|
19005
19031
|
import { ArrowUp } from "lucide-react";
|
|
19006
19032
|
import { jsx as jsx210, jsxs as jsxs125 } from "react/jsx-runtime";
|
|
19007
19033
|
function AssistantComposer({ onSend, disabled, value: controlled, onValueChange }) {
|
|
19008
19034
|
const t = useTranslations86();
|
|
19009
|
-
const [internal, setInternal] =
|
|
19035
|
+
const [internal, setInternal] = useState80("");
|
|
19010
19036
|
const value = controlled ?? internal;
|
|
19011
19037
|
const setValue = onValueChange ?? setInternal;
|
|
19012
19038
|
const canSend = value.trim().length > 0 && !disabled;
|
|
@@ -19052,7 +19078,7 @@ import { jsx as jsx211, jsxs as jsxs126 } from "react/jsx-runtime";
|
|
|
19052
19078
|
var STARTER_KEYS = ["a", "b", "c", "d"];
|
|
19053
19079
|
function AssistantEmptyState({ onSend, operatorMode = false, onOperatorModeChange }) {
|
|
19054
19080
|
const t = useTranslations87();
|
|
19055
|
-
const [draft, setDraft] =
|
|
19081
|
+
const [draft, setDraft] = useState81("");
|
|
19056
19082
|
return /* @__PURE__ */ jsx211("div", { className: "flex h-full w-full items-center justify-center p-10", children: /* @__PURE__ */ jsxs126("div", { className: "flex w-full max-w-2xl flex-col gap-6", children: [
|
|
19057
19083
|
/* @__PURE__ */ jsxs126("div", { className: "text-center", children: [
|
|
19058
19084
|
/* @__PURE__ */ jsx211("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__ */ jsx211(Sparkles, { className: "h-5 w-5" }) }),
|
|
@@ -19090,14 +19116,14 @@ function AssistantEmptyState({ onSend, operatorMode = false, onOperatorModeChang
|
|
|
19090
19116
|
__name(AssistantEmptyState, "AssistantEmptyState");
|
|
19091
19117
|
|
|
19092
19118
|
// src/features/assistant/components/parts/AssistantThreadHeader.tsx
|
|
19093
|
-
import { useState as
|
|
19119
|
+
import { useState as useState82 } from "react";
|
|
19094
19120
|
import { useTranslations as useTranslations88 } from "next-intl";
|
|
19095
19121
|
import { jsx as jsx212, jsxs as jsxs127 } from "react/jsx-runtime";
|
|
19096
19122
|
function AssistantThreadHeader({ assistant, onRename, onDelete }) {
|
|
19097
19123
|
const t = useTranslations88();
|
|
19098
|
-
const [renameValue, setRenameValue] =
|
|
19099
|
-
const [renameOpen, setRenameOpen] =
|
|
19100
|
-
const [deleteOpen, setDeleteOpen] =
|
|
19124
|
+
const [renameValue, setRenameValue] = useState82(assistant.title);
|
|
19125
|
+
const [renameOpen, setRenameOpen] = useState82(false);
|
|
19126
|
+
const [deleteOpen, setDeleteOpen] = useState82(false);
|
|
19101
19127
|
const handleRename = /* @__PURE__ */ __name(async () => {
|
|
19102
19128
|
const trimmed = renameValue.trim() || assistant.title;
|
|
19103
19129
|
await onRename(trimmed);
|
|
@@ -19159,10 +19185,10 @@ import ReactMarkdown3 from "react-markdown";
|
|
|
19159
19185
|
import remarkGfm3 from "remark-gfm";
|
|
19160
19186
|
|
|
19161
19187
|
// src/features/assistant-message/components/parts/MessageSourcesContainer.tsx
|
|
19162
|
-
import { useEffect as useEffect62, useMemo as useMemo34, useState as
|
|
19188
|
+
import { useEffect as useEffect62, useMemo as useMemo34, useState as useState85 } from "react";
|
|
19163
19189
|
|
|
19164
19190
|
// src/features/assistant-message/components/parts/MessageSourcesPanel.tsx
|
|
19165
|
-
import { useMemo as useMemo33, useState as
|
|
19191
|
+
import { useMemo as useMemo33, useState as useState84 } from "react";
|
|
19166
19192
|
import { useTranslations as useTranslations93 } from "next-intl";
|
|
19167
19193
|
import { ChevronDown as ChevronDown4, ChevronRight as ChevronRight2 } from "lucide-react";
|
|
19168
19194
|
|
|
@@ -19199,7 +19225,7 @@ function ReferencesTab({ references }) {
|
|
|
19199
19225
|
__name(ReferencesTab, "ReferencesTab");
|
|
19200
19226
|
|
|
19201
19227
|
// src/features/assistant-message/components/parts/tabs/CitationsTab.tsx
|
|
19202
|
-
import { Fragment as Fragment45, useState as
|
|
19228
|
+
import { Fragment as Fragment45, useState as useState83 } from "react";
|
|
19203
19229
|
import { useTranslations as useTranslations90 } from "next-intl";
|
|
19204
19230
|
import { ChevronDown as ChevronDown3, HelpCircle } from "lucide-react";
|
|
19205
19231
|
import ReactMarkdown2 from "react-markdown";
|
|
@@ -19238,7 +19264,7 @@ __name(RelevanceMeter, "RelevanceMeter");
|
|
|
19238
19264
|
import { jsx as jsx215, jsxs as jsxs130 } from "react/jsx-runtime";
|
|
19239
19265
|
function CitationsTab({ citations, sources }) {
|
|
19240
19266
|
const t = useTranslations90();
|
|
19241
|
-
const [expanded, setExpanded] =
|
|
19267
|
+
const [expanded, setExpanded] = useState83(/* @__PURE__ */ new Set());
|
|
19242
19268
|
if (citations.length === 0) return null;
|
|
19243
19269
|
const sorted = [...citations].sort((a, b) => (b.relevance ?? 0) - (a.relevance ?? 0));
|
|
19244
19270
|
const toggle = /* @__PURE__ */ __name((id) => {
|
|
@@ -19487,8 +19513,8 @@ function MessageSourcesPanel({ message, isLatestAssistant, onSelectFollowUp, sou
|
|
|
19487
19513
|
if (usersCount > 0) visibleTabs.push("users");
|
|
19488
19514
|
const autoOpen = isLatestAssistant && suggestionsCount > 0;
|
|
19489
19515
|
const initialTab = autoOpen ? "suggested" : visibleTabs[0];
|
|
19490
|
-
const [open, setOpen] =
|
|
19491
|
-
const [active, setActive] =
|
|
19516
|
+
const [open, setOpen] = useState84(autoOpen);
|
|
19517
|
+
const [active, setActive] = useState84(initialTab);
|
|
19492
19518
|
if (total === 0) return null;
|
|
19493
19519
|
const panelId = `sources-panel-${message.id}`;
|
|
19494
19520
|
return /* @__PURE__ */ jsxs133("div", { className: "mt-2 w-full min-w-0", children: [
|
|
@@ -19567,7 +19593,7 @@ function MessageSourcesContainer({ message, isLatestAssistant, onSelectFollowUp
|
|
|
19567
19593
|
}
|
|
19568
19594
|
return parts.sort().join("|");
|
|
19569
19595
|
}, [groups]);
|
|
19570
|
-
const [resolved, setResolved] =
|
|
19596
|
+
const [resolved, setResolved] = useState85([]);
|
|
19571
19597
|
useEffect62(() => {
|
|
19572
19598
|
if (groups.size === 0) {
|
|
19573
19599
|
setResolved([]);
|
|
@@ -19930,7 +19956,7 @@ __name(NotificationsListContainer, "NotificationsListContainer");
|
|
|
19930
19956
|
// src/features/notification/components/modals/NotificationModal.tsx
|
|
19931
19957
|
import { BellIcon } from "lucide-react";
|
|
19932
19958
|
import { useTranslations as useTranslations98 } from "next-intl";
|
|
19933
|
-
import { Fragment as Fragment48, useCallback as useCallback39, useEffect as useEffect64, useMemo as useMemo35, useRef as useRef35, useState as
|
|
19959
|
+
import { Fragment as Fragment48, useCallback as useCallback39, useEffect as useEffect64, useMemo as useMemo35, useRef as useRef35, useState as useState86 } from "react";
|
|
19934
19960
|
import { jsx as jsx229, jsxs as jsxs141 } from "react/jsx-runtime";
|
|
19935
19961
|
function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
19936
19962
|
const _instanceId = useRef35(Math.random().toString(36).substr(2, 9));
|
|
@@ -19952,7 +19978,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
19952
19978
|
} = useSocketContext();
|
|
19953
19979
|
const t = useTranslations98();
|
|
19954
19980
|
const generateUrl = usePageUrlGenerator();
|
|
19955
|
-
const [newNotifications, setNewNotifications] =
|
|
19981
|
+
const [newNotifications, setNewNotifications] = useState86(false);
|
|
19956
19982
|
const preventAutoClose = useRef35(false);
|
|
19957
19983
|
const circuitBreakerRef = useRef35({
|
|
19958
19984
|
count: 0,
|
|
@@ -20145,14 +20171,14 @@ __name(ReferralCodeCapture, "ReferralCodeCapture");
|
|
|
20145
20171
|
|
|
20146
20172
|
// src/features/referral/components/ReferralWidget.tsx
|
|
20147
20173
|
import { Copy as Copy2, Loader2 as Loader25, Mail, Users } from "lucide-react";
|
|
20148
|
-
import { useCallback as useCallback40, useRef as useRef36, useState as
|
|
20174
|
+
import { useCallback as useCallback40, useRef as useRef36, useState as useState89 } from "react";
|
|
20149
20175
|
|
|
20150
20176
|
// src/features/referral/hooks/useReferralInvite.ts
|
|
20151
|
-
import { useState as
|
|
20177
|
+
import { useState as useState87 } from "react";
|
|
20152
20178
|
function useReferralInvite() {
|
|
20153
|
-
const [sending, setSending] =
|
|
20154
|
-
const [error, setError] =
|
|
20155
|
-
const [success, setSuccess] =
|
|
20179
|
+
const [sending, setSending] = useState87(false);
|
|
20180
|
+
const [error, setError] = useState87(null);
|
|
20181
|
+
const [success, setSuccess] = useState87(false);
|
|
20156
20182
|
const sendInvite = /* @__PURE__ */ __name(async (email) => {
|
|
20157
20183
|
if (!isReferralEnabled()) {
|
|
20158
20184
|
return;
|
|
@@ -20174,11 +20200,11 @@ function useReferralInvite() {
|
|
|
20174
20200
|
__name(useReferralInvite, "useReferralInvite");
|
|
20175
20201
|
|
|
20176
20202
|
// src/features/referral/hooks/useReferralStats.ts
|
|
20177
|
-
import { useEffect as useEffect66, useState as
|
|
20203
|
+
import { useEffect as useEffect66, useState as useState88 } from "react";
|
|
20178
20204
|
function useReferralStats() {
|
|
20179
|
-
const [stats, setStats] =
|
|
20180
|
-
const [loading, setLoading] =
|
|
20181
|
-
const [error, setError] =
|
|
20205
|
+
const [stats, setStats] = useState88(null);
|
|
20206
|
+
const [loading, setLoading] = useState88(true);
|
|
20207
|
+
const [error, setError] = useState88(null);
|
|
20182
20208
|
useEffect66(() => {
|
|
20183
20209
|
if (!isReferralEnabled()) {
|
|
20184
20210
|
setLoading(false);
|
|
@@ -20249,8 +20275,8 @@ function ReferralWidget({
|
|
|
20249
20275
|
const t = { ...DEFAULT_TRANSLATIONS, ...translations };
|
|
20250
20276
|
const { stats, loading, error } = useReferralStats();
|
|
20251
20277
|
const { sendInvite, sending } = useReferralInvite();
|
|
20252
|
-
const [email, setEmail] =
|
|
20253
|
-
const [copied, setCopied] =
|
|
20278
|
+
const [email, setEmail] = useState89("");
|
|
20279
|
+
const [copied, setCopied] = useState89(false);
|
|
20254
20280
|
const linkInputRef = useRef36(null);
|
|
20255
20281
|
const config = getReferralConfig();
|
|
20256
20282
|
const baseUrl = config.referralUrlBase || (typeof window !== "undefined" ? window.location.origin : "");
|
|
@@ -20463,11 +20489,11 @@ __name(FormRoles, "FormRoles");
|
|
|
20463
20489
|
|
|
20464
20490
|
// src/features/role/components/forms/RemoveUserFromRole.tsx
|
|
20465
20491
|
import { useTranslations as useTranslations101 } from "next-intl";
|
|
20466
|
-
import { useEffect as useEffect67, useState as
|
|
20492
|
+
import { useEffect as useEffect67, useState as useState90 } from "react";
|
|
20467
20493
|
import { Fragment as Fragment51, jsx as jsx236, jsxs as jsxs146 } from "react/jsx-runtime";
|
|
20468
20494
|
function RemoveUserFromRole({ role, user, refresh }) {
|
|
20469
|
-
const [open, setOpen] =
|
|
20470
|
-
const [canRemove, setCanRemove] =
|
|
20495
|
+
const [open, setOpen] = useState90(false);
|
|
20496
|
+
const [canRemove, setCanRemove] = useState90(false);
|
|
20471
20497
|
const t = useTranslations101();
|
|
20472
20498
|
useEffect67(() => {
|
|
20473
20499
|
async function checkCompanyAdminDeletability() {
|
|
@@ -20539,13 +20565,13 @@ __name(RemoveUserFromRole, "RemoveUserFromRole");
|
|
|
20539
20565
|
// src/features/role/components/forms/UserRoleAdd.tsx
|
|
20540
20566
|
import { PlusCircle as PlusCircle2 } from "lucide-react";
|
|
20541
20567
|
import { useTranslations as useTranslations102 } from "next-intl";
|
|
20542
|
-
import { useCallback as useCallback41, useEffect as useEffect68, useRef as useRef37, useState as
|
|
20568
|
+
import { useCallback as useCallback41, useEffect as useEffect68, useRef as useRef37, useState as useState91 } from "react";
|
|
20543
20569
|
import { Fragment as Fragment52, jsx as jsx237, jsxs as jsxs147 } from "react/jsx-runtime";
|
|
20544
20570
|
function UserRoleAdd({ user, refresh }) {
|
|
20545
|
-
const [open, setOpen] =
|
|
20571
|
+
const [open, setOpen] = useState91(false);
|
|
20546
20572
|
const inputRef = useRef37(null);
|
|
20547
|
-
const [searchTerm, setSearchTerm] =
|
|
20548
|
-
const [roles, setRoles] =
|
|
20573
|
+
const [searchTerm, setSearchTerm] = useState91("");
|
|
20574
|
+
const [roles, setRoles] = useState91([]);
|
|
20549
20575
|
const t = useTranslations102();
|
|
20550
20576
|
const addUserToRole = /* @__PURE__ */ __name(async (role) => {
|
|
20551
20577
|
await RoleService.addUserToRole({
|
|
@@ -20851,11 +20877,11 @@ function OAuthScopeSelector({
|
|
|
20851
20877
|
__name(OAuthScopeSelector, "OAuthScopeSelector");
|
|
20852
20878
|
|
|
20853
20879
|
// src/features/oauth/components/OAuthClientSecretDisplay.tsx
|
|
20854
|
-
import { useState as
|
|
20880
|
+
import { useState as useState92, useCallback as useCallback44 } from "react";
|
|
20855
20881
|
import { Copy as Copy3, Check, AlertTriangle } from "lucide-react";
|
|
20856
20882
|
import { jsx as jsx242, jsxs as jsxs150 } from "react/jsx-runtime";
|
|
20857
20883
|
function OAuthClientSecretDisplay({ secret, onDismiss, open, clientName }) {
|
|
20858
|
-
const [copied, setCopied] =
|
|
20884
|
+
const [copied, setCopied] = useState92(false);
|
|
20859
20885
|
const handleCopy = useCallback44(async () => {
|
|
20860
20886
|
try {
|
|
20861
20887
|
await navigator.clipboard.writeText(secret);
|
|
@@ -21048,18 +21074,18 @@ function OAuthClientList({
|
|
|
21048
21074
|
__name(OAuthClientList, "OAuthClientList");
|
|
21049
21075
|
|
|
21050
21076
|
// src/features/oauth/components/OAuthClientForm.tsx
|
|
21051
|
-
import { useState as
|
|
21077
|
+
import { useState as useState93, useCallback as useCallback45 } from "react";
|
|
21052
21078
|
import { jsx as jsx245, jsxs as jsxs153 } from "react/jsx-runtime";
|
|
21053
21079
|
function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
|
|
21054
21080
|
const isEditMode = !!client;
|
|
21055
|
-
const [formState, setFormState] =
|
|
21081
|
+
const [formState, setFormState] = useState93({
|
|
21056
21082
|
name: client?.name || "",
|
|
21057
21083
|
description: client?.description || "",
|
|
21058
21084
|
redirectUris: client?.redirectUris?.length ? client.redirectUris : [""],
|
|
21059
21085
|
allowedScopes: client?.allowedScopes || [],
|
|
21060
21086
|
isConfidential: client?.isConfidential ?? true
|
|
21061
21087
|
});
|
|
21062
|
-
const [errors, setErrors] =
|
|
21088
|
+
const [errors, setErrors] = useState93({});
|
|
21063
21089
|
const validate = useCallback45(() => {
|
|
21064
21090
|
const newErrors = {};
|
|
21065
21091
|
if (!formState.name.trim()) {
|
|
@@ -21182,7 +21208,7 @@ function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
|
|
|
21182
21208
|
__name(OAuthClientForm, "OAuthClientForm");
|
|
21183
21209
|
|
|
21184
21210
|
// src/features/oauth/components/OAuthClientDetail.tsx
|
|
21185
|
-
import { useState as
|
|
21211
|
+
import { useState as useState94, useCallback as useCallback46 } from "react";
|
|
21186
21212
|
import { format as format2 } from "date-fns";
|
|
21187
21213
|
import { Copy as Copy4, Check as Check2, RefreshCw as RefreshCw3, Pencil as Pencil2, Trash2 as Trash25, ExternalLink } from "lucide-react";
|
|
21188
21214
|
import { Fragment as Fragment53, jsx as jsx246, jsxs as jsxs154 } from "react/jsx-runtime";
|
|
@@ -21193,11 +21219,11 @@ function OAuthClientDetail({
|
|
|
21193
21219
|
onDelete,
|
|
21194
21220
|
onRegenerateSecret
|
|
21195
21221
|
}) {
|
|
21196
|
-
const [copiedField, setCopiedField] =
|
|
21197
|
-
const [showDeleteConfirm, setShowDeleteConfirm] =
|
|
21198
|
-
const [showRegenerateConfirm, setShowRegenerateConfirm] =
|
|
21199
|
-
const [isDeleting, setIsDeleting] =
|
|
21200
|
-
const [isRegenerating, setIsRegenerating] =
|
|
21222
|
+
const [copiedField, setCopiedField] = useState94(null);
|
|
21223
|
+
const [showDeleteConfirm, setShowDeleteConfirm] = useState94(false);
|
|
21224
|
+
const [showRegenerateConfirm, setShowRegenerateConfirm] = useState94(false);
|
|
21225
|
+
const [isDeleting, setIsDeleting] = useState94(false);
|
|
21226
|
+
const [isRegenerating, setIsRegenerating] = useState94(false);
|
|
21201
21227
|
const copyToClipboard2 = useCallback46(async (text, field) => {
|
|
21202
21228
|
try {
|
|
21203
21229
|
await navigator.clipboard.writeText(text);
|
|
@@ -21466,7 +21492,7 @@ __name(OAuthConsentScreen, "OAuthConsentScreen");
|
|
|
21466
21492
|
import { zodResolver as zodResolver10 } from "@hookform/resolvers/zod";
|
|
21467
21493
|
import { CheckCircle, Mail as Mail2 } from "lucide-react";
|
|
21468
21494
|
import { useTranslations as useTranslations105 } from "next-intl";
|
|
21469
|
-
import { useState as
|
|
21495
|
+
import { useState as useState95 } from "react";
|
|
21470
21496
|
import { useForm as useForm10 } from "react-hook-form";
|
|
21471
21497
|
import { v4 as v411 } from "uuid";
|
|
21472
21498
|
import { z as z10 } from "zod";
|
|
@@ -21567,8 +21593,8 @@ __name(WaitlistQuestionnaireRenderer, "WaitlistQuestionnaireRenderer");
|
|
|
21567
21593
|
import { Fragment as Fragment54, jsx as jsx252, jsxs as jsxs160 } from "react/jsx-runtime";
|
|
21568
21594
|
function WaitlistForm({ onSuccess }) {
|
|
21569
21595
|
const t = useTranslations105();
|
|
21570
|
-
const [isSubmitting, setIsSubmitting] =
|
|
21571
|
-
const [isSuccess, setIsSuccess] =
|
|
21596
|
+
const [isSubmitting, setIsSubmitting] = useState95(false);
|
|
21597
|
+
const [isSuccess, setIsSuccess] = useState95(false);
|
|
21572
21598
|
const config = getWaitlistConfig();
|
|
21573
21599
|
const questionnaireFields = config.questionnaire ?? [];
|
|
21574
21600
|
const questionnaireSchema = questionnaireFields.reduce(
|
|
@@ -21747,12 +21773,12 @@ __name(WaitlistSuccessState, "WaitlistSuccessState");
|
|
|
21747
21773
|
// src/features/waitlist/components/sections/WaitlistConfirmation.tsx
|
|
21748
21774
|
import { CheckCircle as CheckCircle4, Loader2 as Loader27, XCircle as XCircle2 } from "lucide-react";
|
|
21749
21775
|
import { useTranslations as useTranslations107 } from "next-intl";
|
|
21750
|
-
import { useEffect as useEffect69, useState as
|
|
21776
|
+
import { useEffect as useEffect69, useState as useState96 } from "react";
|
|
21751
21777
|
import { jsx as jsx255, jsxs as jsxs163 } from "react/jsx-runtime";
|
|
21752
21778
|
function WaitlistConfirmation({ code }) {
|
|
21753
21779
|
const t = useTranslations107();
|
|
21754
|
-
const [state, setState] =
|
|
21755
|
-
const [errorMessage, setErrorMessage] =
|
|
21780
|
+
const [state, setState] = useState96("loading");
|
|
21781
|
+
const [errorMessage, setErrorMessage] = useState96("");
|
|
21756
21782
|
useEffect69(() => {
|
|
21757
21783
|
async function confirmEmail() {
|
|
21758
21784
|
try {
|
|
@@ -21793,7 +21819,7 @@ __name(WaitlistConfirmation, "WaitlistConfirmation");
|
|
|
21793
21819
|
import { flexRender as flexRender2, getCoreRowModel as getCoreRowModel2, useReactTable as useReactTable2 } from "@tanstack/react-table";
|
|
21794
21820
|
import { RefreshCw as RefreshCw4, Users as Users2 } from "lucide-react";
|
|
21795
21821
|
import { useTranslations as useTranslations109 } from "next-intl";
|
|
21796
|
-
import { useCallback as useCallback47, useEffect as useEffect70, useState as
|
|
21822
|
+
import { useCallback as useCallback47, useEffect as useEffect70, useState as useState97 } from "react";
|
|
21797
21823
|
|
|
21798
21824
|
// src/features/waitlist/hooks/useWaitlistTableStructure.tsx
|
|
21799
21825
|
import { Send } from "lucide-react";
|
|
@@ -21890,10 +21916,10 @@ __name(useWaitlistTableStructure, "useWaitlistTableStructure");
|
|
|
21890
21916
|
import { jsx as jsx257, jsxs as jsxs165 } from "react/jsx-runtime";
|
|
21891
21917
|
function WaitlistList() {
|
|
21892
21918
|
const t = useTranslations109();
|
|
21893
|
-
const [entries, setEntries] =
|
|
21894
|
-
const [total, setTotal] =
|
|
21895
|
-
const [isLoading, setIsLoading] =
|
|
21896
|
-
const [statusFilter, setStatusFilter] =
|
|
21919
|
+
const [entries, setEntries] = useState97([]);
|
|
21920
|
+
const [total, setTotal] = useState97(0);
|
|
21921
|
+
const [isLoading, setIsLoading] = useState97(true);
|
|
21922
|
+
const [statusFilter, setStatusFilter] = useState97("all");
|
|
21897
21923
|
const loadEntries = useCallback47(async () => {
|
|
21898
21924
|
setIsLoading(true);
|
|
21899
21925
|
try {
|
|
@@ -21963,7 +21989,7 @@ __name(WaitlistList, "WaitlistList");
|
|
|
21963
21989
|
// src/features/rbac/components/RbacContainer.tsx
|
|
21964
21990
|
import { Loader2Icon as Loader2Icon4 } from "lucide-react";
|
|
21965
21991
|
import { useTranslations as useTranslations111 } from "next-intl";
|
|
21966
|
-
import { memo as memo2, useCallback as useCallback49, useEffect as useEffect72, useMemo as useMemo36, useRef as useRef38, useState as
|
|
21992
|
+
import { memo as memo2, useCallback as useCallback49, useEffect as useEffect72, useMemo as useMemo36, useRef as useRef38, useState as useState99 } from "react";
|
|
21967
21993
|
|
|
21968
21994
|
// src/features/rbac/components/RbacPermissionCell.tsx
|
|
21969
21995
|
import { CheckIcon as CheckIcon9, MinusIcon as MinusIcon2, XIcon as XIcon11 } from "lucide-react";
|
|
@@ -22044,7 +22070,7 @@ __name(RbacPermissionCell, "RbacPermissionCell");
|
|
|
22044
22070
|
import { Popover as PopoverPrimitive2 } from "@base-ui/react/popover";
|
|
22045
22071
|
import { CheckIcon as CheckIcon10, MinusIcon as MinusIcon3, XIcon as XIcon12 } from "lucide-react";
|
|
22046
22072
|
import { useTranslations as useTranslations110 } from "next-intl";
|
|
22047
|
-
import { useCallback as useCallback48, useEffect as useEffect71, useState as
|
|
22073
|
+
import { useCallback as useCallback48, useEffect as useEffect71, useState as useState98 } from "react";
|
|
22048
22074
|
import { Fragment as Fragment55, jsx as jsx259, jsxs as jsxs167 } from "react/jsx-runtime";
|
|
22049
22075
|
function RbacPermissionPicker({
|
|
22050
22076
|
open,
|
|
@@ -22057,7 +22083,7 @@ function RbacPermissionPicker({
|
|
|
22057
22083
|
onClose
|
|
22058
22084
|
}) {
|
|
22059
22085
|
const t = useTranslations110();
|
|
22060
|
-
const [customSegment, setCustomSegment] =
|
|
22086
|
+
const [customSegment, setCustomSegment] = useState98("");
|
|
22061
22087
|
useEffect71(() => {
|
|
22062
22088
|
if (!open) setCustomSegment("");
|
|
22063
22089
|
}, [open]);
|
|
@@ -22306,8 +22332,8 @@ var ModuleEditor = memo2(/* @__PURE__ */ __name(function ModuleEditor2({
|
|
|
22306
22332
|
function RbacContainer() {
|
|
22307
22333
|
const t = useTranslations111();
|
|
22308
22334
|
const { matrix, modulePaths, loading, error, roleNames, moduleNames, updateCell, clearCell } = useRbacContext();
|
|
22309
|
-
const [selectedModuleId, setSelectedModuleId] =
|
|
22310
|
-
const [activePicker, setActivePicker] =
|
|
22335
|
+
const [selectedModuleId, setSelectedModuleId] = useState99(null);
|
|
22336
|
+
const [activePicker, setActivePicker] = useState99(null);
|
|
22311
22337
|
const openPicker = useCallback49((picker) => {
|
|
22312
22338
|
setActivePicker(picker);
|
|
22313
22339
|
}, []);
|
|
@@ -22418,7 +22444,7 @@ __name(RbacContainer, "RbacContainer");
|
|
|
22418
22444
|
// src/features/rbac/components/RbacByRoleContainer.tsx
|
|
22419
22445
|
import { Loader2Icon as Loader2Icon5 } from "lucide-react";
|
|
22420
22446
|
import { useTranslations as useTranslations112 } from "next-intl";
|
|
22421
|
-
import { Fragment as Fragment56, memo as memo3, useCallback as useCallback50, useEffect as useEffect73, useMemo as useMemo37, useRef as useRef39, useState as
|
|
22447
|
+
import { Fragment as Fragment56, memo as memo3, useCallback as useCallback50, useEffect as useEffect73, useMemo as useMemo37, useRef as useRef39, useState as useState100 } from "react";
|
|
22422
22448
|
import { jsx as jsx261, jsxs as jsxs169 } from "react/jsx-runtime";
|
|
22423
22449
|
function findToken2(tokens, action) {
|
|
22424
22450
|
if (!tokens) return void 0;
|
|
@@ -22456,8 +22482,8 @@ var ACTION_LABELS2 = {
|
|
|
22456
22482
|
function RbacByRoleContainer() {
|
|
22457
22483
|
const t = useTranslations112();
|
|
22458
22484
|
const { matrix, modulePaths, loading, error, roleNames, moduleNames, updateCell, clearCell } = useRbacContext();
|
|
22459
|
-
const [selectedRoleId, setSelectedRoleId] =
|
|
22460
|
-
const [activePicker, setActivePicker] =
|
|
22485
|
+
const [selectedRoleId, setSelectedRoleId] = useState100(null);
|
|
22486
|
+
const [activePicker, setActivePicker] = useState100(null);
|
|
22461
22487
|
const openPicker = useCallback50((picker) => {
|
|
22462
22488
|
setActivePicker(picker);
|
|
22463
22489
|
}, []);
|
|
@@ -23119,4 +23145,4 @@ export {
|
|
|
23119
23145
|
useOAuthClients,
|
|
23120
23146
|
useOAuthClient
|
|
23121
23147
|
};
|
|
23122
|
-
//# sourceMappingURL=chunk-
|
|
23148
|
+
//# sourceMappingURL=chunk-WDWU5VJ5.mjs.map
|