@carlonicora/nextjs-jsonapi 1.121.0 → 1.123.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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
- function Tabs({ className, orientation = "horizontal", ...props }) {
4421
- return /* @__PURE__ */ jsx45(
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 createContext9, useContext as useContext10, useState as useState34 } from "react";
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 useState7 } from "react";
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] = useState7(void 0);
6265
- const [total, setTotal] = useState7(void 0);
6266
- const [nextPage, setNextPage] = useState7(void 0);
6267
- const [previousPage, setPreviousPage] = useState7(void 0);
6268
- const [isLoaded, setIsLoaded] = useState7(false);
6269
- const [ready, setReady] = useState7(params.ready ?? true);
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 useState8 } from "react";
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] = useState8(null);
7384
- const [isConnected, setIsConnected] = useState8(false);
7385
- const [messages, setMessages] = useState8([]);
7386
- const [socketNotifications, setSocketNotifications] = useState8([]);
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 createContext6, useCallback as useCallback10, useContext as useContext7, useEffect as useEffect13, useRef as useRef10, useState as useState9 } from "react";
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 createContext5, useContext as useContext6 } from "react";
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 = createContext5(defaultContextValue);
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 = useContext6(SocketContext);
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 = createContext6(void 0);
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] = useState9(false);
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 = useContext7(CurrentUserContext);
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 createContext8, useContext as useContext9, useState as useState31 } from "react";
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 useState10 } from "react";
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] = useState10(false);
7732
- const [users, setUsers] = useState10([]);
7756
+ const [show, setShow] = useState11(false);
7757
+ const [users, setUsers] = useState11([]);
7733
7758
  const t = useTranslations();
7734
- const [existingUsers, setExistingUsers] = useState10(null);
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 useState11 } from "react";
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] = useState11(null);
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 useState12 } from "react";
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] = useState12([]);
7922
- const [file, setFile] = useState12(null);
7923
- const [contentType, setContentType] = useState12(null);
7924
- const [resetImage, setResetImage] = useState12(false);
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] = useState12(companyFromContext || userCompany);
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 useState13 } from "react";
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] = useState13(false);
8228
- const [searchTerm, setSearchTerm] = useState13("");
8229
- const [options, setOptions] = useState13([]);
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 useState14 } from "react";
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] = useState14(false);
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 useState15 } from "react";
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] = useState15(false);
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 useState30 } from "react";
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 useState16 } from "react";
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] = useState16("");
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 useState17 } from "react";
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] = useState17(forceShow || false);
8761
- const [isDeleting, setIsDeleting] = useState17(false);
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 useState18 } from "react";
8954
+ import { useCallback as useCallback14, useEffect as useEffect19, useState as useState19 } from "react";
8930
8955
  function useEditorDialog(isFormDirty, options) {
8931
- const [open, setOpen] = useState18(false);
8932
- const [showDiscardConfirm, setShowDiscardConfirm] = useState18(false);
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);
@@ -9023,6 +9048,7 @@ function EditorSheet({
9023
9048
  dialogOpen,
9024
9049
  onDialogOpenChange,
9025
9050
  renderFooter,
9051
+ actions,
9026
9052
  children
9027
9053
  }) {
9028
9054
  const t = useTranslations13();
@@ -9070,6 +9096,8 @@ function EditorSheet({
9070
9096
  },
9071
9097
  [onSubmit, setOpen, onSuccess, onSaved, onRevalidate, onNavigate, generateUrl, module, isEdit, propagateChanges, t]
9072
9098
  );
9099
+ const headerTitle = titleOverride ?? (isEdit ? t("common.edit.update.title", { type: entityType }) : t("common.edit.create.title", { type: entityType }));
9100
+ const headerDescription = descriptionOverride ?? (isEdit ? t("common.edit.update.description", { type: entityType, name: entityName ?? "" }) : t("common.edit.create.description", { type: entityType }));
9073
9101
  return /* @__PURE__ */ jsxs41(Fragment9, { children: [
9074
9102
  /* @__PURE__ */ jsxs41(Sheet, { open, onOpenChange: handleOpenChange, children: [
9075
9103
  dialogOpen === void 0 && forceShow === void 0 && (trigger ? (
@@ -9091,10 +9119,19 @@ function EditorSheet({
9091
9119
  }
9092
9120
  ) : /* @__PURE__ */ jsx71(Button, { render: /* @__PURE__ */ jsx71("div", {}), nativeButton: false, size: "sm", variant: "outline", children: t("ui.buttons.create") }) })),
9093
9121
  /* @__PURE__ */ jsxs41(SheetContent, { side: "right", className: sizeClasses[size], children: [
9094
- /* @__PURE__ */ jsxs41(SheetHeader, { className: "border-b px-6 py-4", children: [
9095
- /* @__PURE__ */ jsx71(SheetTitle, { children: titleOverride ?? (isEdit ? t("common.edit.update.title", { type: entityType }) : t("common.edit.create.title", { type: entityType })) }),
9096
- /* @__PURE__ */ jsx71(SheetDescription, { children: descriptionOverride ?? (isEdit ? t("common.edit.update.description", { type: entityType, name: entityName ?? "" }) : t("common.edit.create.description", { type: entityType })) })
9097
- ] }),
9122
+ /* @__PURE__ */ jsx71(SheetHeader, { className: "border-b px-6 py-4", children: actions ? (
9123
+ // pr-10 clears the SheetContent close button (absolute top-4 right-4).
9124
+ /* @__PURE__ */ jsxs41("div", { className: "flex items-start justify-between gap-x-4 pr-10", children: [
9125
+ /* @__PURE__ */ jsxs41("div", { className: "flex min-w-0 flex-col gap-y-1.5", children: [
9126
+ /* @__PURE__ */ jsx71(SheetTitle, { children: headerTitle }),
9127
+ /* @__PURE__ */ jsx71(SheetDescription, { children: headerDescription })
9128
+ ] }),
9129
+ /* @__PURE__ */ jsx71("div", { className: "flex shrink-0 items-center gap-x-2", children: actions })
9130
+ ] })
9131
+ ) : /* @__PURE__ */ jsxs41(Fragment9, { children: [
9132
+ /* @__PURE__ */ jsx71(SheetTitle, { children: headerTitle }),
9133
+ /* @__PURE__ */ jsx71(SheetDescription, { children: headerDescription })
9134
+ ] }) }),
9098
9135
  /* @__PURE__ */ jsx71(Form, { ...form, children: /* @__PURE__ */ jsxs41(
9099
9136
  "form",
9100
9137
  {
@@ -9129,7 +9166,7 @@ __name(EditorSheet, "EditorSheet");
9129
9166
  // src/components/forms/DatePickerPopover.tsx
9130
9167
  import { isValid, parse } from "date-fns";
9131
9168
  import { Calendar as CalendarIcon, CircleXIcon } from "lucide-react";
9132
- import { useMemo as useMemo11, useState as useState19 } from "react";
9169
+ import { useMemo as useMemo11, useState as useState20 } from "react";
9133
9170
  import { jsx as jsx72, jsxs as jsxs42 } from "react/jsx-runtime";
9134
9171
  var DatePickerPopover = /* @__PURE__ */ __name(({
9135
9172
  children,
@@ -9141,8 +9178,8 @@ var DatePickerPopover = /* @__PURE__ */ __name(({
9141
9178
  }) => {
9142
9179
  const locale = useI18nLocale();
9143
9180
  const dateFnsLocale = useI18nDateFnsLocale();
9144
- const [isOpen, setIsOpen] = useState19(false);
9145
- const [displayMonth, setDisplayMonth] = useState19(() => value || /* @__PURE__ */ new Date());
9181
+ const [isOpen, setIsOpen] = useState20(false);
9182
+ const [displayMonth, setDisplayMonth] = useState20(() => value || /* @__PURE__ */ new Date());
9146
9183
  const dateFormatter = useMemo11(
9147
9184
  () => new Intl.DateTimeFormat(locale, { day: "2-digit", month: "2-digit", year: "numeric" }),
9148
9185
  [locale]
@@ -9166,7 +9203,7 @@ var DatePickerPopover = /* @__PURE__ */ __name(({
9166
9203
  return part.value;
9167
9204
  }).join("");
9168
9205
  }, [dateFormatter]);
9169
- const [inputValue, setInputValue] = useState19(() => value ? formatDate(value) : "");
9206
+ const [inputValue, setInputValue] = useState20(() => value ? formatDate(value) : "");
9170
9207
  const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
9171
9208
  const yearOptions = Array.from({ length: currentYear - 1900 + 11 }, (_, i) => 1900 + i);
9172
9209
  const monthNames = useMemo11(() => {
@@ -9291,22 +9328,22 @@ var DatePickerPopover = /* @__PURE__ */ __name(({
9291
9328
  import { format } from "date-fns";
9292
9329
  import { CalendarIcon as CalendarIcon2 } from "lucide-react";
9293
9330
  import { useTranslations as useTranslations14 } from "next-intl";
9294
- import { useEffect as useEffect21, useState as useState20 } from "react";
9331
+ import { useEffect as useEffect21, useState as useState21 } from "react";
9295
9332
  import { Fragment as Fragment10, jsx as jsx73, jsxs as jsxs43 } from "react/jsx-runtime";
9296
9333
  function DateRangeSelector({ onDateChange, avoidSettingDates, showPreviousMonth }) {
9297
9334
  const t = useTranslations14();
9298
- const [date, setDate] = useState20(
9335
+ const [date, setDate] = useState21(
9299
9336
  avoidSettingDates ? void 0 : {
9300
9337
  from: new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1),
9301
9338
  to: new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth() + 1, 0)
9302
9339
  }
9303
9340
  );
9304
- const [open, setOpen] = useState20(false);
9305
- const [mounted, setMounted] = useState20(false);
9341
+ const [open, setOpen] = useState21(false);
9342
+ const [mounted, setMounted] = useState21(false);
9306
9343
  useEffect21(() => {
9307
9344
  setMounted(true);
9308
9345
  }, []);
9309
- const [prevRange, setPrevRange] = useState20(date);
9346
+ const [prevRange, setPrevRange] = useState21(date);
9310
9347
  useEffect21(() => {
9311
9348
  if (date?.from && date?.to && date.to > date.from && (prevRange?.from?.getTime() !== date.from.getTime() || prevRange?.to?.getTime() !== date.to.getTime())) {
9312
9349
  onDateChange(date);
@@ -9401,20 +9438,20 @@ __name(DateRangeSelector, "DateRangeSelector");
9401
9438
  import { Trash2 as RemoveIcon } from "lucide-react";
9402
9439
  import { useTranslations as useTranslations15 } from "next-intl";
9403
9440
  import {
9404
- createContext as createContext7,
9441
+ createContext as createContext8,
9405
9442
  forwardRef as forwardRef6,
9406
9443
  useCallback as useCallback16,
9407
- useContext as useContext8,
9444
+ useContext as useContext9,
9408
9445
  useEffect as useEffect22,
9409
9446
  useMemo as useMemo12,
9410
9447
  useRef as useRef14,
9411
- useState as useState21
9448
+ useState as useState22
9412
9449
  } from "react";
9413
9450
  import { useDropzone } from "react-dropzone";
9414
9451
  import { jsx as jsx74, jsxs as jsxs44 } from "react/jsx-runtime";
9415
- var FileUploaderContext = createContext7(null);
9452
+ var FileUploaderContext = createContext8(null);
9416
9453
  var useFileUpload = /* @__PURE__ */ __name(() => {
9417
- const context = useContext8(FileUploaderContext);
9454
+ const context = useContext9(FileUploaderContext);
9418
9455
  if (!context) {
9419
9456
  throw new Error("useFileUpload must be used within a FileUploaderProvider");
9420
9457
  }
@@ -9422,9 +9459,9 @@ var useFileUpload = /* @__PURE__ */ __name(() => {
9422
9459
  }, "useFileUpload");
9423
9460
  var FileUploader = forwardRef6(
9424
9461
  ({ className, dropzoneOptions, value, onValueChange, reSelect, orientation = "vertical", children, dir, ...props }, ref) => {
9425
- const [isFileTooBig, setIsFileTooBig] = useState21(false);
9426
- const [isLOF, setIsLOF] = useState21(false);
9427
- const [activeIndex, setActiveIndex] = useState21(-1);
9462
+ const [isFileTooBig, setIsFileTooBig] = useState22(false);
9463
+ const [isLOF, setIsLOF] = useState22(false);
9464
+ const [activeIndex, setActiveIndex] = useState22(-1);
9428
9465
  const { maxFiles = 1, maxSize = 4 * 1024 * 1024, multiple = true } = dropzoneOptions;
9429
9466
  const t = useTranslations15();
9430
9467
  const reSelectAll = maxFiles === 1 ? true : reSelect;
@@ -9693,7 +9730,7 @@ var FileInput = forwardRef6(
9693
9730
  FileInput.displayName = "FileInput";
9694
9731
 
9695
9732
  // src/components/forms/CurrencyInput.tsx
9696
- import { useState as useState22 } from "react";
9733
+ import { useState as useState23 } from "react";
9697
9734
  import { jsx as jsx75, jsxs as jsxs45 } from "react/jsx-runtime";
9698
9735
  function centsToInput(cents) {
9699
9736
  return (cents / 100).toFixed(2);
@@ -9739,7 +9776,7 @@ function CurrencyInput({
9739
9776
  className,
9740
9777
  testId
9741
9778
  }) {
9742
- const [draft, setDraft] = useState22(null);
9779
+ const [draft, setDraft] = useState23(null);
9743
9780
  const display = draft !== null ? draft : centsToInput(valueCents);
9744
9781
  const handleChange = /* @__PURE__ */ __name((e) => {
9745
9782
  setDraft(sanitizeKeystroke(e.target.value));
@@ -9801,7 +9838,7 @@ import { useRef as useRef15 } from "react";
9801
9838
  import dynamic from "next/dynamic";
9802
9839
  import React17 from "react";
9803
9840
  import { jsx as jsx77 } from "react/jsx-runtime";
9804
- var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-ZDSKVOWD.mjs"), {
9841
+ var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-4TXISWF2.mjs"), {
9805
9842
  ssr: false
9806
9843
  });
9807
9844
  var BlockNoteEditorContainer = React17.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
@@ -9895,7 +9932,7 @@ __name(FormBlockNote, "FormBlockNote");
9895
9932
  // src/components/forms/FormDate.tsx
9896
9933
  import { isValid as isValid2, parse as parse2 } from "date-fns";
9897
9934
  import { Calendar as CalendarIcon3, CircleXIcon as CircleXIcon2 } from "lucide-react";
9898
- import { useMemo as useMemo13, useState as useState23 } from "react";
9935
+ import { useMemo as useMemo13, useState as useState24 } from "react";
9899
9936
  import { jsx as jsx79, jsxs as jsxs47 } from "react/jsx-runtime";
9900
9937
  function FormDate({
9901
9938
  form,
@@ -9912,8 +9949,8 @@ function FormDate({
9912
9949
  const t = useI18nTranslations();
9913
9950
  const locale = useI18nLocale();
9914
9951
  const dateFnsLocale = useI18nDateFnsLocale();
9915
- const [open, setOpen] = useState23(false);
9916
- const [displayMonth, setDisplayMonth] = useState23(() => {
9952
+ const [open, setOpen] = useState24(false);
9953
+ const [displayMonth, setDisplayMonth] = useState24(() => {
9917
9954
  const currentValue = form.getValues(id);
9918
9955
  return currentValue || defaultMonth || /* @__PURE__ */ new Date();
9919
9956
  });
@@ -9940,7 +9977,7 @@ function FormDate({
9940
9977
  return part.value;
9941
9978
  }).join("");
9942
9979
  }, [dateFormatter]);
9943
- const [inputValue, setInputValue] = useState23(() => {
9980
+ const [inputValue, setInputValue] = useState24(() => {
9944
9981
  const currentValue = form.getValues(id);
9945
9982
  return currentValue ? formatDate(currentValue) : "";
9946
9983
  });
@@ -10036,7 +10073,7 @@ __name(FormDate, "FormDate");
10036
10073
 
10037
10074
  // src/components/forms/FormDateTime.tsx
10038
10075
  import { Calendar as CalendarIcon4, CircleXIcon as CircleXIcon3 } from "lucide-react";
10039
- import { useMemo as useMemo14, useState as useState24 } from "react";
10076
+ import { useMemo as useMemo14, useState as useState25 } from "react";
10040
10077
  import { jsx as jsx80, jsxs as jsxs48 } from "react/jsx-runtime";
10041
10078
  function FormDateTime({
10042
10079
  form,
@@ -10050,11 +10087,11 @@ function FormDateTime({
10050
10087
  isRequired,
10051
10088
  description
10052
10089
  }) {
10053
- const [open, setOpen] = useState24(false);
10090
+ const [open, setOpen] = useState25(false);
10054
10091
  const t = useI18nTranslations();
10055
10092
  const locale = useI18nLocale();
10056
10093
  const dateFnsLocale = useI18nDateFnsLocale();
10057
- const [displayMonth, setDisplayMonth] = useState24(() => {
10094
+ const [displayMonth, setDisplayMonth] = useState25(() => {
10058
10095
  const currentValue = form.getValues(id);
10059
10096
  return currentValue || defaultMonth || /* @__PURE__ */ new Date();
10060
10097
  });
@@ -10070,8 +10107,8 @@ function FormDateTime({
10070
10107
  [locale]
10071
10108
  );
10072
10109
  const formatDateTime = /* @__PURE__ */ __name((date) => dateTimeFormatter.format(date), "formatDateTime");
10073
- const [selectedHours, setSelectedHours] = useState24((/* @__PURE__ */ new Date()).getHours());
10074
- const [selectedMinutes, setSelectedMinutes] = useState24(roundToNearestFiveMinutes((/* @__PURE__ */ new Date()).getMinutes()));
10110
+ const [selectedHours, setSelectedHours] = useState25((/* @__PURE__ */ new Date()).getHours());
10111
+ const [selectedMinutes, setSelectedMinutes] = useState25(roundToNearestFiveMinutes((/* @__PURE__ */ new Date()).getMinutes()));
10075
10112
  const hoursOptions = Array.from({ length: 24 }, (_, i) => {
10076
10113
  const hour = i;
10077
10114
  return {
@@ -10404,7 +10441,7 @@ function FormPassword({
10404
10441
  __name(FormPassword, "FormPassword");
10405
10442
 
10406
10443
  // src/components/forms/FormPlaceAutocomplete.tsx
10407
- import { useEffect as useEffect23, useRef as useRef16, useState as useState26 } from "react";
10444
+ import { useEffect as useEffect23, useRef as useRef16, useState as useState27 } from "react";
10408
10445
  import { jsx as jsx84, jsxs as jsxs51 } from "react/jsx-runtime";
10409
10446
  function FormPlaceAutocomplete({
10410
10447
  form,
@@ -10420,12 +10457,12 @@ function FormPlaceAutocomplete({
10420
10457
  includeTypes,
10421
10458
  languageCode = "en"
10422
10459
  }) {
10423
- const [inputValue, setInputValue] = useState26("");
10424
- const [suggestions, setSuggestions] = useState26([]);
10425
- const [isLoading, setIsLoading] = useState26(false);
10426
- const [showSuggestions, setShowSuggestions] = useState26(false);
10427
- const [loadError, setLoadError] = useState26(false);
10428
- const [apiKey, setApiKey] = useState26(null);
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);
10429
10466
  const debounceRef = useRef16(null);
10430
10467
  const containerRef = useRef16(null);
10431
10468
  useEffect23(() => {
@@ -10661,7 +10698,7 @@ function FormSelect({
10661
10698
  field.onChange(actual);
10662
10699
  if (onChange) onChange(actual);
10663
10700
  },
10664
- value: field.value || (allowEmpty ? EMPTY_VALUE : field.value),
10701
+ value: field.value || (allowEmpty ? EMPTY_VALUE : ""),
10665
10702
  disabled,
10666
10703
  "data-testid": testId,
10667
10704
  children: [
@@ -10791,7 +10828,7 @@ __name(GdprConsentCheckbox, "GdprConsentCheckbox");
10791
10828
  // src/components/forms/MultiFileUploader.tsx
10792
10829
  import { FileIcon, FileImageIcon, FileSpreadsheetIcon, FileTextIcon, UploadIcon as UploadIcon2, XIcon as XIcon6 } from "lucide-react";
10793
10830
  import Image3 from "next/image";
10794
- import { useEffect as useEffect24, useState as useState27 } from "react";
10831
+ import { useEffect as useEffect24, useState as useState28 } from "react";
10795
10832
  import { jsx as jsx90, jsxs as jsxs56 } from "react/jsx-runtime";
10796
10833
  var dropzone = {
10797
10834
  multiple: false,
@@ -10903,14 +10940,14 @@ __name(UserAvatarList, "UserAvatarList");
10903
10940
  // src/features/user/components/widgets/UserSearchPopover.tsx
10904
10941
  import { RefreshCwIcon, SearchIcon as SearchIcon3, XIcon as XIcon7 } from "lucide-react";
10905
10942
  import { useTranslations as useTranslations19 } from "next-intl";
10906
- import { useEffect as useEffect26, useState as useState29 } from "react";
10943
+ import { useEffect as useEffect26, useState as useState30 } from "react";
10907
10944
 
10908
10945
  // src/features/user/hooks/useUserSearch.ts
10909
- import { useCallback as useCallback17, useEffect as useEffect25, useRef as useRef17, useState as useState28 } from "react";
10946
+ import { useCallback as useCallback17, useEffect as useEffect25, useRef as useRef17, useState as useState29 } from "react";
10910
10947
  var useUserSearch = /* @__PURE__ */ __name(() => {
10911
- const [users, setUsers] = useState28([]);
10912
- const [searchQuery, setSearchQuery] = useState28("");
10913
- const [isLoading, setIsLoading] = useState28(false);
10948
+ const [users, setUsers] = useState29([]);
10949
+ const [searchQuery, setSearchQuery] = useState29("");
10950
+ const [isLoading, setIsLoading] = useState29(false);
10914
10951
  const searchQueryRef = useRef17("");
10915
10952
  const loadUsers = useCallback17(
10916
10953
  async (search) => {
@@ -11052,7 +11089,7 @@ var useUserTableStructure = /* @__PURE__ */ __name((params) => {
11052
11089
  import { jsx as jsx95, jsxs as jsxs60 } from "react/jsx-runtime";
11053
11090
  var UserSearchPopover = /* @__PURE__ */ __name(({ children, onSelect, align = "start", className }) => {
11054
11091
  const t = useTranslations19();
11055
- const [isOpen, setIsOpen] = useState29(false);
11092
+ const [isOpen, setIsOpen] = useState30(false);
11056
11093
  const { users, searchQuery, setSearchQuery, isLoading, loadUsers, clearSearch } = useUserSearch();
11057
11094
  useEffect26(() => {
11058
11095
  if (isOpen && users.length === 0 && !searchQuery) {
@@ -11111,10 +11148,10 @@ var UserSearchPopover = /* @__PURE__ */ __name(({ children, onSelect, align = "s
11111
11148
  import { Fragment as Fragment12, jsx as jsx96, jsxs as jsxs61 } from "react/jsx-runtime";
11112
11149
  function UserSelector({ id, form, label, placeholder, onChange, isRequired = false }) {
11113
11150
  const t = useTranslations20();
11114
- const [open, setOpen] = useState30(false);
11151
+ const [open, setOpen] = useState31(false);
11115
11152
  const searchTermRef = useRef18("");
11116
- const [searchTerm, setSearchTerm] = useState30("");
11117
- const [isSearching, setIsSearching] = useState30(false);
11153
+ const [searchTerm, setSearchTerm] = useState31("");
11154
+ const [isSearching, setIsSearching] = useState31(false);
11118
11155
  const data = useDataListRetriever({
11119
11156
  retriever: /* @__PURE__ */ __name((params) => {
11120
11157
  return UserService.findMany(params);
@@ -11213,12 +11250,12 @@ __name(UserSelector, "UserSelector");
11213
11250
 
11214
11251
  // src/features/user/contexts/UserContext.tsx
11215
11252
  import { jsx as jsx97 } from "react/jsx-runtime";
11216
- var UserContext = createContext8(void 0);
11253
+ var UserContext = createContext9(void 0);
11217
11254
  var UserProvider = /* @__PURE__ */ __name(({ children, dehydratedUser }) => {
11218
11255
  const generateUrl = usePageUrlGenerator();
11219
11256
  const { hasPermissionToModule } = useCurrentUserContext();
11220
11257
  const t = useTranslations21();
11221
- const [user, setUser] = useState31(
11258
+ const [user, setUser] = useState32(
11222
11259
  dehydratedUser ? rehydrate(Modules.User, dehydratedUser) : void 0
11223
11260
  );
11224
11261
  const breadcrumb = /* @__PURE__ */ __name(() => {
@@ -11267,7 +11304,7 @@ var UserProvider = /* @__PURE__ */ __name(({ children, dehydratedUser }) => {
11267
11304
  ) });
11268
11305
  }, "UserProvider");
11269
11306
  var useUserContext = /* @__PURE__ */ __name(() => {
11270
- const context = useContext9(UserContext);
11307
+ const context = useContext10(UserContext);
11271
11308
  if (context === void 0) {
11272
11309
  throw new Error("useUserContext must be used within a UserProvider");
11273
11310
  }
@@ -11986,15 +12023,15 @@ __name(CompanyConfigurationEditor, "CompanyConfigurationEditor");
11986
12023
  // src/features/company/components/forms/CompanyDeleter.tsx
11987
12024
  import { LoaderCircleIcon as LoaderCircleIcon2, Trash2Icon as Trash2Icon2 } from "lucide-react";
11988
12025
  import { useTranslations as useTranslations35 } from "next-intl";
11989
- import { useState as useState32 } from "react";
12026
+ import { useState as useState33 } from "react";
11990
12027
  import { Fragment as Fragment17, jsx as jsx122, jsxs as jsxs74 } from "react/jsx-runtime";
11991
12028
  function CompanyDeleterInternal({ company, isAdministrator: isAdministrator2 }) {
11992
12029
  const t = useTranslations35();
11993
12030
  const generateUrl = usePageUrlGenerator();
11994
- const [open, setOpen] = useState32(false);
11995
- const [finalWarningOpen, setFinalWarningOpen] = useState32(false);
11996
- const [isDeleting, setIsDeleting] = useState32(false);
11997
- const [companyName, setCompanyName] = useState32("");
12031
+ const [open, setOpen] = useState33(false);
12032
+ const [finalWarningOpen, setFinalWarningOpen] = useState33(false);
12033
+ const [isDeleting, setIsDeleting] = useState33(false);
12034
+ const [companyName, setCompanyName] = useState33("");
11998
12035
  const handleProceedToFinalWarning = /* @__PURE__ */ __name(() => {
11999
12036
  setOpen(false);
12000
12037
  setFinalWarningOpen(true);
@@ -12127,7 +12164,7 @@ import { zodResolver as zodResolver3 } from "@hookform/resolvers/zod";
12127
12164
  import { UploadIcon as UploadIcon3 } from "lucide-react";
12128
12165
  import { useTranslations as useTranslations36 } from "next-intl";
12129
12166
  import Image6 from "next/image";
12130
- import { useCallback as useCallback19, useEffect as useEffect29, useMemo as useMemo16, useRef as useRef19, useState as useState33 } from "react";
12167
+ import { useCallback as useCallback19, useEffect as useEffect29, useMemo as useMemo16, useRef as useRef19, useState as useState34 } from "react";
12131
12168
  import { useForm as useForm3 } from "react-hook-form";
12132
12169
  import { v4 as v42 } from "uuid";
12133
12170
  import { z as z2 } from "zod";
@@ -12144,10 +12181,10 @@ function CompanyEditorInternal({
12144
12181
  }) {
12145
12182
  const { hasRole, setUser } = useCurrentUserContext();
12146
12183
  const router = useI18nRouter();
12147
- const [features, setFeatures] = useState33([]);
12148
- const [file, setFile] = useState33(null);
12149
- const [files, setFiles] = useState33(null);
12150
- const [contentType, setContentType] = useState33(null);
12184
+ const [features, setFeatures] = useState34([]);
12185
+ const [file, setFile] = useState34(null);
12186
+ const [files, setFiles] = useState34(null);
12187
+ const [contentType, setContentType] = useState34(null);
12151
12188
  const t = useTranslations36();
12152
12189
  const fiscalRef = useRef19(null);
12153
12190
  const addressComponentsRef = useRef19({});
@@ -12360,7 +12397,7 @@ __name(CompaniesList, "CompaniesList");
12360
12397
 
12361
12398
  // src/features/company/contexts/CompanyContext.tsx
12362
12399
  import { jsx as jsx125 } from "react/jsx-runtime";
12363
- var CompanyContext = createContext9(void 0);
12400
+ var CompanyContext = createContext10(void 0);
12364
12401
  var defaultContextValue2 = {
12365
12402
  company: void 0,
12366
12403
  setCompany: /* @__PURE__ */ __name(() => {
@@ -12370,7 +12407,7 @@ var CompanyProvider = /* @__PURE__ */ __name(({ children, dehydratedCompany, con
12370
12407
  const generateUrl = usePageUrlGenerator();
12371
12408
  const t = useTranslations38();
12372
12409
  const { hasPermissionToModule, hasRole } = useCurrentUserContext();
12373
- const [company, setCompany] = useState34(
12410
+ const [company, setCompany] = useState35(
12374
12411
  dehydratedCompany ? rehydrate(Modules.Company, dehydratedCompany) : void 0
12375
12412
  );
12376
12413
  const breadcrumb = /* @__PURE__ */ __name(() => {
@@ -12410,16 +12447,16 @@ var CompanyProvider = /* @__PURE__ */ __name(({ children, dehydratedCompany, con
12410
12447
  ) });
12411
12448
  }, "CompanyProvider");
12412
12449
  var useCompanyContext = /* @__PURE__ */ __name(() => {
12413
- return useContext10(CompanyContext) ?? defaultContextValue2;
12450
+ return useContext11(CompanyContext) ?? defaultContextValue2;
12414
12451
  }, "useCompanyContext");
12415
12452
 
12416
12453
  // src/features/notification/contexts/NotificationContext.tsx
12417
12454
  import { useTranslations as useTranslations40 } from "next-intl";
12418
- import { createContext as createContext10, useCallback as useCallback20, useContext as useContext11, useEffect as useEffect31, useRef as useRef20, useState as useState36 } from "react";
12455
+ import { createContext as createContext11, useCallback as useCallback20, useContext as useContext12, useEffect as useEffect31, useRef as useRef20, useState as useState37 } from "react";
12419
12456
 
12420
12457
  // src/features/notification/components/notifications/Notification.tsx
12421
12458
  import { useTranslations as useTranslations39 } from "next-intl";
12422
- import { useEffect as useEffect30, useState as useState35 } from "react";
12459
+ import { useEffect as useEffect30, useState as useState36 } from "react";
12423
12460
  import { jsx as jsx126, jsxs as jsxs76 } from "react/jsx-runtime";
12424
12461
  var generateNotificationData = /* @__PURE__ */ __name((params) => {
12425
12462
  const response = {};
@@ -12456,7 +12493,7 @@ function NotificationToast(notification, t, generateUrl, reouter) {
12456
12493
  __name(NotificationToast, "NotificationToast");
12457
12494
  function NotificationMenuItem({ notification, closePopover }) {
12458
12495
  const generateUrl = usePageUrlGenerator();
12459
- const [isRead, setIsRead] = useState35(false);
12496
+ const [isRead, setIsRead] = useState36(false);
12460
12497
  const t = useTranslations39();
12461
12498
  useEffect30(() => {
12462
12499
  setIsRead(notification.isRead);
@@ -12481,15 +12518,15 @@ __name(NotificationMenuItem, "NotificationMenuItem");
12481
12518
 
12482
12519
  // src/features/notification/contexts/NotificationContext.tsx
12483
12520
  import { jsx as jsx127 } from "react/jsx-runtime";
12484
- var NotificationContext = createContext10(void 0);
12521
+ var NotificationContext = createContext11(void 0);
12485
12522
  var NotificationContextProvider = /* @__PURE__ */ __name(({ children }) => {
12486
12523
  const t = useTranslations40();
12487
12524
  const router = useI18nRouter();
12488
- const [notifications, setNotifications] = useState36([]);
12489
- const [isLoading, setIsLoading] = useState36(false);
12490
- const [error, setError] = useState36(null);
12491
- const [lastLoaded, setLastLoaded] = useState36(0);
12492
- const [hasInitiallyLoaded, setHasInitiallyLoaded] = useState36(false);
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);
12493
12530
  const inFlightRef = useRef20(null);
12494
12531
  const { currentUser } = useCurrentUserContext();
12495
12532
  const shouldRefresh = Date.now() - lastLoaded > 5 * 60 * 1e3;
@@ -12608,7 +12645,7 @@ var NotificationContextProvider = /* @__PURE__ */ __name(({ children }) => {
12608
12645
  ) });
12609
12646
  }, "NotificationContextProvider");
12610
12647
  var useNotificationContext = /* @__PURE__ */ __name(() => {
12611
- const context = useContext11(NotificationContext);
12648
+ const context = useContext12(NotificationContext);
12612
12649
  if (context === void 0) {
12613
12650
  throw new Error(`Notification.messages.errors.use_context`);
12614
12651
  }
@@ -12616,7 +12653,7 @@ var useNotificationContext = /* @__PURE__ */ __name(() => {
12616
12653
  }, "useNotificationContext");
12617
12654
 
12618
12655
  // src/features/onboarding/contexts/OnboardingContext.tsx
12619
- import { createContext as createContext11, useCallback as useCallback21, useContext as useContext12, useEffect as useEffect32, useRef as useRef21, useState as useState37 } from "react";
12656
+ import { createContext as createContext12, useCallback as useCallback21, useContext as useContext13, useEffect as useEffect32, useRef as useRef21, useState as useState38 } from "react";
12620
12657
  import { createRoot } from "react-dom/client";
12621
12658
  import Shepherd from "shepherd.js";
12622
12659
  import "shepherd.js/dist/css/shepherd.css";
@@ -12674,7 +12711,7 @@ var DEFAULT_ONBOARDING_LABELS = {
12674
12711
 
12675
12712
  // src/features/onboarding/contexts/OnboardingContext.tsx
12676
12713
  import { jsx as jsx129 } from "react/jsx-runtime";
12677
- var OnboardingContext = createContext11(null);
12714
+ var OnboardingContext = createContext12(null);
12678
12715
  function OnboardingProvider({
12679
12716
  children,
12680
12717
  tours = [],
@@ -12683,10 +12720,10 @@ function OnboardingProvider({
12683
12720
  renderCard,
12684
12721
  zIndex: _zIndex = 9999
12685
12722
  }) {
12686
- const [isTourActive, setIsTourActive] = useState37(false);
12687
- const [activeTourId, setActiveTourId] = useState37(null);
12688
- const [currentStepIndex, setCurrentStepIndex] = useState37(0);
12689
- const [totalSteps, setTotalSteps] = useState37(0);
12723
+ const [isTourActive, setIsTourActive] = useState38(false);
12724
+ const [activeTourId, setActiveTourId] = useState38(null);
12725
+ const [currentStepIndex, setCurrentStepIndex] = useState38(0);
12726
+ const [totalSteps, setTotalSteps] = useState38(0);
12690
12727
  const tourRef = useRef21(null);
12691
12728
  const rootsRef = useRef21(/* @__PURE__ */ new Map());
12692
12729
  const cleanupRoots = useCallback21(() => {
@@ -12837,7 +12874,7 @@ function OnboardingProvider({
12837
12874
  }
12838
12875
  __name(OnboardingProvider, "OnboardingProvider");
12839
12876
  function useOnboarding() {
12840
- const context = useContext12(OnboardingContext);
12877
+ const context = useContext13(OnboardingContext);
12841
12878
  if (!context) {
12842
12879
  throw new Error("useOnboarding must be used within an OnboardingProvider");
12843
12880
  }
@@ -12847,13 +12884,13 @@ __name(useOnboarding, "useOnboarding");
12847
12884
 
12848
12885
  // src/features/role/contexts/RoleContext.tsx
12849
12886
  import { useTranslations as useTranslations41 } from "next-intl";
12850
- import { createContext as createContext12, useContext as useContext13, useState as useState38 } from "react";
12887
+ import { createContext as createContext13, useContext as useContext14, useState as useState39 } from "react";
12851
12888
  import { jsx as jsx130 } from "react/jsx-runtime";
12852
- var RoleContext = createContext12(void 0);
12889
+ var RoleContext = createContext13(void 0);
12853
12890
  var RoleProvider = /* @__PURE__ */ __name(({ children, dehydratedRole }) => {
12854
12891
  const generateUrl = usePageUrlGenerator();
12855
12892
  const t = useTranslations41();
12856
- const [role, setRole] = useState38(
12893
+ const [role, setRole] = useState39(
12857
12894
  dehydratedRole ? rehydrate(Modules.Role, dehydratedRole) : void 0
12858
12895
  );
12859
12896
  const breadcrumb = /* @__PURE__ */ __name(() => {
@@ -12892,7 +12929,7 @@ var RoleProvider = /* @__PURE__ */ __name(({ children, dehydratedRole }) => {
12892
12929
  ) });
12893
12930
  }, "RoleProvider");
12894
12931
  var useRoleContext = /* @__PURE__ */ __name(() => {
12895
- const context = useContext13(RoleContext);
12932
+ const context = useContext14(RoleContext);
12896
12933
  if (context === void 0) {
12897
12934
  throw new Error("useRoleContext must be used within a RoleProvider");
12898
12935
  }
@@ -12900,14 +12937,14 @@ var useRoleContext = /* @__PURE__ */ __name(() => {
12900
12937
  }, "useRoleContext");
12901
12938
 
12902
12939
  // src/contexts/SharedContext.tsx
12903
- import { createContext as createContext13, useContext as useContext14 } from "react";
12940
+ import { createContext as createContext14, useContext as useContext15 } from "react";
12904
12941
  import { jsx as jsx131 } from "react/jsx-runtime";
12905
- var SharedContext = createContext13(null);
12942
+ var SharedContext = createContext14(null);
12906
12943
  var SharedProvider = /* @__PURE__ */ __name(({ children, value }) => {
12907
12944
  return /* @__PURE__ */ jsx131(SharedContext.Provider, { value, children });
12908
12945
  }, "SharedProvider");
12909
12946
  var useSharedContext = /* @__PURE__ */ __name(() => {
12910
- const context = useContext14(SharedContext);
12947
+ const context = useContext15(SharedContext);
12911
12948
  if (!context) {
12912
12949
  throw new Error("useSharedContext must be used within a SharedProvider");
12913
12950
  }
@@ -12940,7 +12977,7 @@ __name(HowToDeleter, "HowToDeleter");
12940
12977
  import { zodResolver as zodResolver4 } from "@hookform/resolvers/zod";
12941
12978
  import { PlusIcon, SearchIcon as SearchIcon5, XIcon as XIcon9 } from "lucide-react";
12942
12979
  import { useTranslations as useTranslations44 } from "next-intl";
12943
- import { useCallback as useCallback22, useEffect as useEffect33, useMemo as useMemo17, useRef as useRef22, useState as useState39 } from "react";
12980
+ import { useCallback as useCallback22, useEffect as useEffect33, useMemo as useMemo17, useRef as useRef22, useState as useState40 } from "react";
12944
12981
  import { useForm as useForm4 } from "react-hook-form";
12945
12982
  import { v4 as v43 } from "uuid";
12946
12983
  import { z as z3 } from "zod";
@@ -12989,8 +13026,8 @@ function PageSelector({
12989
13026
  onSelect,
12990
13027
  onRemove
12991
13028
  }) {
12992
- const [open, setOpen] = useState39(false);
12993
- const [search, setSearch] = useState39("");
13029
+ const [open, setOpen] = useState40(false);
13030
+ const [search, setSearch] = useState40("");
12994
13031
  const selectedLabel = value ? allPageUrls.find((opt) => opt.id === value) : void 0;
12995
13032
  const filteredOptions = useMemo17(() => {
12996
13033
  const available = allPageUrls.filter((opt) => opt.id === value || !selectedPages.includes(opt.id));
@@ -13303,13 +13340,13 @@ __name(HowToEditor, "HowToEditor");
13303
13340
 
13304
13341
  // src/features/how-to/contexts/HowToContext.tsx
13305
13342
  import { useTranslations as useTranslations45 } from "next-intl";
13306
- import { createContext as createContext14, useContext as useContext15, useState as useState40 } from "react";
13343
+ import { createContext as createContext15, useContext as useContext16, useState as useState41 } from "react";
13307
13344
  import { jsx as jsx135 } from "react/jsx-runtime";
13308
- var HowToContext = createContext14(void 0);
13345
+ var HowToContext = createContext15(void 0);
13309
13346
  var HowToProvider = /* @__PURE__ */ __name(({ children, dehydratedHowTo }) => {
13310
13347
  const generateUrl = usePageUrlGenerator();
13311
13348
  const t = useTranslations45();
13312
- const [howTo, setHowTo] = useState40(
13349
+ const [howTo, setHowTo] = useState41(
13313
13350
  dehydratedHowTo ? rehydrate(Modules.HowTo, dehydratedHowTo) : void 0
13314
13351
  );
13315
13352
  const reloadHowTo = /* @__PURE__ */ __name(async () => {
@@ -13358,7 +13395,7 @@ var HowToProvider = /* @__PURE__ */ __name(({ children, dehydratedHowTo }) => {
13358
13395
  ) });
13359
13396
  }, "HowToProvider");
13360
13397
  var useHowToContext = /* @__PURE__ */ __name(() => {
13361
- const context = useContext15(HowToContext);
13398
+ const context = useContext16(HowToContext);
13362
13399
  if (context === void 0) {
13363
13400
  throw new Error("useHowToContext must be used within a HowToProvider");
13364
13401
  }
@@ -13368,7 +13405,7 @@ var useHowToContext = /* @__PURE__ */ __name(() => {
13368
13405
  // src/features/rbac/contexts/RbacContext.tsx
13369
13406
  import { DownloadIcon, Loader2Icon as Loader2Icon3 } from "lucide-react";
13370
13407
  import { useTranslations as useTranslations46 } from "next-intl";
13371
- import { createContext as createContext15, useCallback as useCallback23, useContext as useContext16, useEffect as useEffect34, useMemo as useMemo18, useState as useState41 } from "react";
13408
+ import { createContext as createContext16, useCallback as useCallback23, useContext as useContext17, useEffect as useEffect34, useMemo as useMemo18, useState as useState42 } from "react";
13372
13409
  import { jsx as jsx136, jsxs as jsxs79 } from "react/jsx-runtime";
13373
13410
  var DEFAULT_OUTPUT_PATH = "apps/api/src/rbac/permissions.ts";
13374
13411
  function upsertToken(tokens, action, scope) {
@@ -13382,7 +13419,7 @@ function removeToken(tokens, action) {
13382
13419
  return (tokens ?? []).filter((t) => t.action !== action);
13383
13420
  }
13384
13421
  __name(removeToken, "removeToken");
13385
- var RbacContext = createContext15(void 0);
13422
+ var RbacContext = createContext16(void 0);
13386
13423
  var RbacProvider = /* @__PURE__ */ __name(({
13387
13424
  children,
13388
13425
  roleNames,
@@ -13391,11 +13428,11 @@ var RbacProvider = /* @__PURE__ */ __name(({
13391
13428
  }) => {
13392
13429
  const generateUrl = usePageUrlGenerator();
13393
13430
  const t = useTranslations46();
13394
- const [matrix, setMatrix] = useState41(null);
13395
- const [modulePaths, setModulePaths] = useState41({});
13396
- const [loading, setLoading] = useState41(true);
13397
- const [error, setError] = useState41(null);
13398
- const [saving, setSaving] = useState41(false);
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);
13399
13436
  useEffect34(() => {
13400
13437
  let cancelled = false;
13401
13438
  setLoading(true);
@@ -13494,7 +13531,7 @@ var RbacProvider = /* @__PURE__ */ __name(({
13494
13531
  return /* @__PURE__ */ jsx136(SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ jsx136(RbacContext.Provider, { value: contextValue, children }) });
13495
13532
  }, "RbacProvider");
13496
13533
  var useRbacContext = /* @__PURE__ */ __name(() => {
13497
- const ctx = useContext16(RbacContext);
13534
+ const ctx = useContext17(RbacContext);
13498
13535
  if (!ctx) {
13499
13536
  throw new Error("useRbacContext must be used within an RbacProvider");
13500
13537
  }
@@ -13503,9 +13540,9 @@ var useRbacContext = /* @__PURE__ */ __name(() => {
13503
13540
 
13504
13541
  // src/features/assistant/contexts/AssistantContext.tsx
13505
13542
  import { useTranslations as useTranslations47 } from "next-intl";
13506
- import { createContext as createContext16, useCallback as useCallback24, useContext as useContext17, useEffect as useEffect35, useMemo as useMemo19, useState as useState42 } from "react";
13543
+ import { createContext as createContext17, useCallback as useCallback24, useContext as useContext18, useEffect as useEffect35, useMemo as useMemo19, useState as useState43 } from "react";
13507
13544
  import { jsx as jsx137 } from "react/jsx-runtime";
13508
- var AssistantContext = createContext16(void 0);
13545
+ var AssistantContext = createContext17(void 0);
13509
13546
  function stripOptimistic(list) {
13510
13547
  return list.filter((m) => !m.isOptimistic);
13511
13548
  }
@@ -13528,18 +13565,18 @@ __name(withPatchedTitle, "withPatchedTitle");
13528
13565
  function AssistantProvider({ children, dehydratedAssistant, dehydratedMessages, manageUrl = true }) {
13529
13566
  const t = useTranslations47();
13530
13567
  const generateUrl = usePageUrlGenerator();
13531
- const [assistant, setAssistant] = useState42(
13568
+ const [assistant, setAssistant] = useState43(
13532
13569
  () => dehydratedAssistant ? rehydrate(Modules.Assistant, dehydratedAssistant) : void 0
13533
13570
  );
13534
- const [messages, setMessages] = useState42(
13571
+ const [messages, setMessages] = useState43(
13535
13572
  () => dehydratedMessages ? rehydrateList(Modules.AssistantMessage, dehydratedMessages) : []
13536
13573
  );
13537
- const [threads, setThreads] = useState42([]);
13538
- const [threadsLoading, setThreadsLoading] = useState42(true);
13539
- const [sending, setSending] = useState42(false);
13540
- const [status, setStatus] = useState42(void 0);
13541
- const [failedMessageIds, setFailedMessageIds] = useState42(() => /* @__PURE__ */ new Set());
13542
- const [operatorMode, setOperatorMode] = useState42(
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(
13543
13580
  () => dehydratedAssistant?.jsonApi?.attributes?.engine === "operator"
13544
13581
  );
13545
13582
  const { socket } = useSocketContext();
@@ -13724,7 +13761,7 @@ function AssistantProvider({ children, dehydratedAssistant, dehydratedMessages,
13724
13761
  }
13725
13762
  __name(AssistantProvider, "AssistantProvider");
13726
13763
  function useAssistantContext() {
13727
- const ctx = useContext17(AssistantContext);
13764
+ const ctx = useContext18(AssistantContext);
13728
13765
  if (!ctx) throw new Error("useAssistantContext must be used within AssistantProvider");
13729
13766
  return ctx;
13730
13767
  }
@@ -13732,9 +13769,9 @@ __name(useAssistantContext, "useAssistantContext");
13732
13769
 
13733
13770
  // src/contexts/CommonContext.tsx
13734
13771
  import { useTranslations as useTranslations48 } from "next-intl";
13735
- import { createContext as createContext17, useContext as useContext18 } from "react";
13772
+ import { createContext as createContext18, useContext as useContext19 } from "react";
13736
13773
  import { jsx as jsx138 } from "react/jsx-runtime";
13737
- var CommonContext = createContext17(void 0);
13774
+ var CommonContext = createContext18(void 0);
13738
13775
  var CommonProvider = /* @__PURE__ */ __name(({ children }) => {
13739
13776
  const { company } = useCurrentUserContext();
13740
13777
  const t = useTranslations48();
@@ -13752,7 +13789,7 @@ var CommonProvider = /* @__PURE__ */ __name(({ children }) => {
13752
13789
  return /* @__PURE__ */ jsx138(SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ jsx138(CommonContext.Provider, { value: {}, children }) });
13753
13790
  }, "CommonProvider");
13754
13791
  var useCommonContext = /* @__PURE__ */ __name(() => {
13755
- const context = useContext18(CommonContext);
13792
+ const context = useContext19(CommonContext);
13756
13793
  if (context === void 0) {
13757
13794
  throw new Error("useCommonContext must be used within a CommonProvider");
13758
13795
  }
@@ -13760,9 +13797,9 @@ var useCommonContext = /* @__PURE__ */ __name(() => {
13760
13797
  }, "useCommonContext");
13761
13798
 
13762
13799
  // src/contexts/HeaderChildrenContext.tsx
13763
- import { createContext as createContext18, useContext as useContext19 } from "react";
13800
+ import { createContext as createContext19, useContext as useContext20 } from "react";
13764
13801
  import { jsx as jsx139 } from "react/jsx-runtime";
13765
- var HeaderChildrenContext = createContext18({
13802
+ var HeaderChildrenContext = createContext19({
13766
13803
  headerChildren: null
13767
13804
  });
13768
13805
  function HeaderChildrenProvider({ children, content }) {
@@ -13770,15 +13807,15 @@ function HeaderChildrenProvider({ children, content }) {
13770
13807
  }
13771
13808
  __name(HeaderChildrenProvider, "HeaderChildrenProvider");
13772
13809
  function useHeaderChildren() {
13773
- const context = useContext19(HeaderChildrenContext);
13810
+ const context = useContext20(HeaderChildrenContext);
13774
13811
  return context.headerChildren;
13775
13812
  }
13776
13813
  __name(useHeaderChildren, "useHeaderChildren");
13777
13814
 
13778
13815
  // src/contexts/HeaderLeftContentContext.tsx
13779
- import { createContext as createContext19, useContext as useContext20 } from "react";
13816
+ import { createContext as createContext20, useContext as useContext21 } from "react";
13780
13817
  import { jsx as jsx140 } from "react/jsx-runtime";
13781
- var HeaderLeftContentContext = createContext19({
13818
+ var HeaderLeftContentContext = createContext20({
13782
13819
  headerLeftContent: null
13783
13820
  });
13784
13821
  function HeaderLeftContentProvider({ children, content }) {
@@ -13786,7 +13823,7 @@ function HeaderLeftContentProvider({ children, content }) {
13786
13823
  }
13787
13824
  __name(HeaderLeftContentProvider, "HeaderLeftContentProvider");
13788
13825
  function useHeaderLeftContent() {
13789
- const context = useContext20(HeaderLeftContentContext);
13826
+ const context = useContext21(HeaderLeftContentContext);
13790
13827
  return context.headerLeftContent;
13791
13828
  }
13792
13829
  __name(useHeaderLeftContent, "useHeaderLeftContent");
@@ -13794,7 +13831,7 @@ __name(useHeaderLeftContent, "useHeaderLeftContent");
13794
13831
  // src/components/EditableAvatar.tsx
13795
13832
  import { PencilIcon as PencilIcon3, Trash2Icon as Trash2Icon3 } from "lucide-react";
13796
13833
  import { useTranslations as useTranslations49 } from "next-intl";
13797
- import { useCallback as useCallback25, useRef as useRef23, useState as useState43 } from "react";
13834
+ import { useCallback as useCallback25, useRef as useRef23, useState as useState44 } from "react";
13798
13835
  import { jsx as jsx141, jsxs as jsxs80 } from "react/jsx-runtime";
13799
13836
  function EditableAvatar({
13800
13837
  entityId,
@@ -13809,8 +13846,8 @@ function EditableAvatar({
13809
13846
  const { company } = useCurrentUserContext();
13810
13847
  const t = useTranslations49();
13811
13848
  const fileInputRef = useRef23(null);
13812
- const [optimisticImage, setOptimisticImage] = useState43(null);
13813
- const [isUploading, setIsUploading] = useState43(false);
13849
+ const [optimisticImage, setOptimisticImage] = useState44(null);
13850
+ const [isUploading, setIsUploading] = useState44(false);
13814
13851
  const displayImage = optimisticImage ?? image;
13815
13852
  const generateS3Key = useCallback25(
13816
13853
  (file) => {
@@ -13944,7 +13981,7 @@ __name(TableCellAvatar, "TableCellAvatar");
13944
13981
 
13945
13982
  // src/components/navigations/Breadcrumb.tsx
13946
13983
  import { useTranslations as useTranslations50 } from "next-intl";
13947
- import { Fragment as Fragment20, useState as useState44 } from "react";
13984
+ import { Fragment as Fragment20, useState as useState45 } from "react";
13948
13985
  import { ChevronDownIcon as ChevronDownIcon8 } from "lucide-react";
13949
13986
  import { Fragment as Fragment21, jsx as jsx143, jsxs as jsxs82 } from "react/jsx-runtime";
13950
13987
  var ITEMS_TO_DISPLAY = 4;
@@ -13953,7 +13990,7 @@ function BreadcrumbDesktop({
13953
13990
  generateUrl,
13954
13991
  t
13955
13992
  }) {
13956
- const [open, setOpen] = useState44(false);
13993
+ const [open, setOpen] = useState45(false);
13957
13994
  return /* @__PURE__ */ jsx143(Breadcrumb, { children: /* @__PURE__ */ jsxs82(BreadcrumbList, { children: [
13958
13995
  /* @__PURE__ */ jsx143(BreadcrumbItem, { children: /* @__PURE__ */ jsx143(Link, { href: generateUrl({ page: `/` }), children: t(`common.home`) }) }),
13959
13996
  items.length > 0 && /* @__PURE__ */ jsx143(BreadcrumbSeparator, {}),
@@ -13981,7 +14018,7 @@ function BreadcrumbMobile({
13981
14018
  generateUrl,
13982
14019
  t
13983
14020
  }) {
13984
- const [open, setOpen] = useState44(false);
14021
+ const [open, setOpen] = useState45(false);
13985
14022
  const lastItem = items[items.length - 1];
13986
14023
  const allItems = [{ name: t(`common.home`), href: generateUrl({ page: `/` }) }, ...items];
13987
14024
  if (!lastItem && items.length === 0) {
@@ -14008,11 +14045,11 @@ function BreadcrumbNavigation({ items }) {
14008
14045
  __name(BreadcrumbNavigation, "BreadcrumbNavigation");
14009
14046
 
14010
14047
  // src/components/navigations/ContentTitle.tsx
14011
- import { useEffect as useEffect36, useState as useState45 } from "react";
14048
+ import { useEffect as useEffect36, useState as useState46 } from "react";
14012
14049
  import { jsx as jsx144, jsxs as jsxs83 } from "react/jsx-runtime";
14013
14050
  function ContentTitle({ module, type, element, functions, className, prioritizeFunctions }) {
14014
- const [clientFunctions, setClientFunctions] = useState45(null);
14015
- const [isClient, setIsClient] = useState45(false);
14051
+ const [clientFunctions, setClientFunctions] = useState46(null);
14052
+ const [isClient, setIsClient] = useState46(false);
14016
14053
  useEffect36(() => {
14017
14054
  setIsClient(true);
14018
14055
  setClientFunctions(functions);
@@ -14069,12 +14106,12 @@ __name(ModeToggleSwitch, "ModeToggleSwitch");
14069
14106
 
14070
14107
  // src/components/navigations/PageSection.tsx
14071
14108
  import { ChevronDownIcon as ChevronDownIcon9, ChevronRightIcon as ChevronRightIcon6 } from "lucide-react";
14072
- import { useEffect as useEffect37, useState as useState46 } from "react";
14109
+ import { useEffect as useEffect37, useState as useState47 } from "react";
14073
14110
  import { v4 as v44 } from "uuid";
14074
14111
  import { jsx as jsx147, jsxs as jsxs85 } from "react/jsx-runtime";
14075
14112
  function PageSection({ children, title, options, open, small, onToggle }) {
14076
- const [isOpen, setIsOpen] = useState46(open ?? true);
14077
- const [shouldRender, setShouldRender] = useState46(open ?? true);
14113
+ const [isOpen, setIsOpen] = useState47(open ?? true);
14114
+ const [shouldRender, setShouldRender] = useState47(open ?? true);
14078
14115
  useEffect37(() => {
14079
14116
  if (onToggle) {
14080
14117
  onToggle(isOpen);
@@ -14182,7 +14219,7 @@ __name(partitionTabs, "partitionTabs");
14182
14219
  // src/components/containers/ReactMarkdownContainer.tsx
14183
14220
  import { ChevronDown as ChevronDown2, ChevronUp } from "lucide-react";
14184
14221
  import { useTranslations as useTranslations52 } from "next-intl";
14185
- import { useEffect as useEffect38, useRef as useRef24, useState as useState47 } from "react";
14222
+ import { useEffect as useEffect38, useRef as useRef24, useState as useState48 } from "react";
14186
14223
  import ReactMarkdown from "react-markdown";
14187
14224
  import remarkGfm from "remark-gfm";
14188
14225
  import { jsx as jsx150, jsxs as jsxs88 } from "react/jsx-runtime";
@@ -14193,8 +14230,8 @@ function ReactMarkdownContainer({
14193
14230
  size = "normal"
14194
14231
  }) {
14195
14232
  const t = useTranslations52("ui.buttons");
14196
- const [isExpanded, setIsExpanded] = useState47(false);
14197
- const [showExpandButton, setShowExpandButton] = useState47(false);
14233
+ const [isExpanded, setIsExpanded] = useState48(false);
14234
+ const [showExpandButton, setShowExpandButton] = useState48(false);
14198
14235
  const contentRef = useRef24(null);
14199
14236
  useEffect38(() => {
14200
14237
  if (collapsible && contentRef.current && !isExpanded) {
@@ -14299,7 +14336,7 @@ __name(RoundPageContainerTitle, "RoundPageContainerTitle");
14299
14336
 
14300
14337
  // src/components/containers/RoundPageContainer.tsx
14301
14338
  import { useSearchParams } from "next/navigation";
14302
- import { Fragment as Fragment22, useCallback as useCallback26, useEffect as useEffect39, useMemo as useMemo20, useState as useState48 } from "react";
14339
+ import { Fragment as Fragment22, useCallback as useCallback26, useEffect as useEffect39, useMemo as useMemo20, useState as useState49 } from "react";
14303
14340
  import { Fragment as Fragment23, jsx as jsx152, jsxs as jsxs90 } from "react/jsx-runtime";
14304
14341
  var DETAILS_COOKIE_NAME = "round_page_details_state";
14305
14342
  var DETAILS_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
@@ -14324,9 +14361,9 @@ function RoundPageContainer({
14324
14361
  }) {
14325
14362
  const headerChildren = useHeaderChildren();
14326
14363
  const headerLeftContent = useHeaderLeftContent();
14327
- const [showDetails, setShowDetailsState] = useState48(false);
14364
+ const [showDetails, setShowDetailsState] = useState49(false);
14328
14365
  const isMobile = useIsMobile();
14329
- const [mounted, setMounted] = useState48(false);
14366
+ const [mounted, setMounted] = useState49(false);
14330
14367
  useEffect39(() => {
14331
14368
  const match = document.cookie.split("; ").find((row) => row.startsWith(`${DETAILS_COOKIE_NAME}=`));
14332
14369
  if (match?.split("=")[1] === "true") setShowDetailsState(true);
@@ -14342,7 +14379,7 @@ function RoundPageContainer({
14342
14379
  const section = searchParams.get("section");
14343
14380
  const rewriteUrl = useUrlRewriter();
14344
14381
  const initialValue = tabs ? (section && tabs.find((i) => tabValue(i) === section) ? section : null) || tabValue(tabs[0]) : void 0;
14345
- const [activeTab, setActiveTab] = useState48(initialValue);
14382
+ const [activeTab, setActiveTab] = useState49(initialValue);
14346
14383
  useEffect39(() => {
14347
14384
  if (tabs && section) {
14348
14385
  const tab = tabs.find((i) => tabValue(i) === section);
@@ -14611,14 +14648,14 @@ function AllowedUsersDetails({ showTitle, content }) {
14611
14648
  __name(AllowedUsersDetails, "AllowedUsersDetails");
14612
14649
 
14613
14650
  // src/components/editors/BlockNoteEditorMentionHoverCard.tsx
14614
- import { useCallback as useCallback27, useEffect as useEffect40, useRef as useRef25, useState as useState49 } from "react";
14651
+ import { useCallback as useCallback27, useEffect as useEffect40, useRef as useRef25, useState as useState50 } from "react";
14615
14652
  import { createPortal as createPortal3 } from "react-dom";
14616
14653
  import { jsx as jsx155 } from "react/jsx-runtime";
14617
14654
  function BlockNoteEditorMentionHoverCard({
14618
14655
  containerRef,
14619
14656
  mentionResolveFn
14620
14657
  }) {
14621
- const [hovered, setHovered] = useState49(null);
14658
+ const [hovered, setHovered] = useState50(null);
14622
14659
  const closeTimeoutRef = useRef25(null);
14623
14660
  const scheduleClose = useCallback27(() => {
14624
14661
  closeTimeoutRef.current = setTimeout(() => setHovered(null), 200);
@@ -14876,11 +14913,11 @@ var BlockNoteViewerContainer = React26.memo(/* @__PURE__ */ __name(function View
14876
14913
  }, "ViewerContainer"));
14877
14914
 
14878
14915
  // src/components/pages/PageContainerContentDetails.tsx
14879
- import { useEffect as useEffect41, useRef as useRef26, useState as useState50 } from "react";
14916
+ import { useEffect as useEffect41, useRef as useRef26, useState as useState51 } from "react";
14880
14917
  import { jsx as jsx159, jsxs as jsxs94 } from "react/jsx-runtime";
14881
14918
  function PageContainerContentDetails({ items, section, module, id }) {
14882
14919
  const rewriteUrl = useUrlRewriter();
14883
- const [isScrolled, setIsScrolled] = useState50(false);
14920
+ const [isScrolled, setIsScrolled] = useState51(false);
14884
14921
  const sentinelRef = useRef26(null);
14885
14922
  useEffect41(() => {
14886
14923
  const sentinel = sentinelRef.current;
@@ -14915,11 +14952,11 @@ function PageContainerContentDetails({ items, section, module, id }) {
14915
14952
  __name(PageContainerContentDetails, "PageContainerContentDetails");
14916
14953
 
14917
14954
  // src/components/pages/PageContentContainer.tsx
14918
- import { useEffect as useEffect42, useState as useState51 } from "react";
14955
+ import { useEffect as useEffect42, useState as useState52 } from "react";
14919
14956
  import { useDefaultLayout } from "react-resizable-panels";
14920
14957
  import { jsx as jsx160, jsxs as jsxs95 } from "react/jsx-runtime";
14921
14958
  function PageContentContainer({ header, details, footer, content, fullBleed }) {
14922
- const [mounted, setMounted] = useState51(false);
14959
+ const [mounted, setMounted] = useState52(false);
14923
14960
  const isMobile = useIsMobile();
14924
14961
  useEffect42(() => {
14925
14962
  setMounted(true);
@@ -15088,12 +15125,12 @@ function JsonApiProvider({ config, children }) {
15088
15125
  __name(JsonApiProvider, "JsonApiProvider");
15089
15126
 
15090
15127
  // src/client/hooks/useJsonApiGet.ts
15091
- import { useState as useState52, useEffect as useEffect44, useCallback as useCallback29, useRef as useRef27 } from "react";
15128
+ import { useState as useState53, useEffect as useEffect44, useCallback as useCallback29, useRef as useRef27 } from "react";
15092
15129
  function useJsonApiGet(params) {
15093
- const [data, setData] = useState52(null);
15094
- const [loading, setLoading] = useState52(false);
15095
- const [error, setError] = useState52(null);
15096
- const [response, setResponse] = useState52(null);
15130
+ const [data, setData] = useState53(null);
15131
+ const [loading, setLoading] = useState53(false);
15132
+ const [error, setError] = useState53(null);
15133
+ const [response, setResponse] = useState53(null);
15097
15134
  const isMounted = useRef27(true);
15098
15135
  const fetchData = useCallback29(async () => {
15099
15136
  if (params.options?.enabled === false) return;
@@ -15188,12 +15225,12 @@ function useJsonApiGet(params) {
15188
15225
  __name(useJsonApiGet, "useJsonApiGet");
15189
15226
 
15190
15227
  // src/client/hooks/useJsonApiMutation.ts
15191
- import { useState as useState53, useCallback as useCallback30 } from "react";
15228
+ import { useState as useState54, useCallback as useCallback30 } from "react";
15192
15229
  function useJsonApiMutation(config) {
15193
- const [data, setData] = useState53(null);
15194
- const [loading, setLoading] = useState53(false);
15195
- const [error, setError] = useState53(null);
15196
- const [response, setResponse] = useState53(null);
15230
+ const [data, setData] = useState54(null);
15231
+ const [loading, setLoading] = useState54(false);
15232
+ const [error, setError] = useState54(null);
15233
+ const [response, setResponse] = useState54(null);
15197
15234
  const reset = useCallback30(() => {
15198
15235
  setData(null);
15199
15236
  setLoading(false);
@@ -15712,15 +15749,15 @@ __name(useOAuthClients, "useOAuthClients");
15712
15749
 
15713
15750
  // src/features/oauth/hooks/useOAuthClient.ts
15714
15751
  import { useAtomValue as useAtomValue2, useSetAtom as useSetAtom2 } from "jotai";
15715
- import { useCallback as useCallback32, useEffect as useEffect46, useState as useState54 } from "react";
15752
+ import { useCallback as useCallback32, useEffect as useEffect46, useState as useState55 } from "react";
15716
15753
  function useOAuthClient(clientId) {
15717
15754
  const storedClient = useAtomValue2(oauthClientByIdAtom(clientId));
15718
15755
  const updateClientInStore = useSetAtom2(updateOAuthClientAtom);
15719
15756
  const removeClientFromStore = useSetAtom2(removeOAuthClientAtom);
15720
15757
  const setNewClientSecret = useSetAtom2(setNewClientSecretAtom);
15721
- const [fetchedClient, setFetchedClient] = useState54(null);
15722
- const [isLoading, setIsLoading] = useState54(false);
15723
- const [error, setError] = useState54(null);
15758
+ const [fetchedClient, setFetchedClient] = useState55(null);
15759
+ const [isLoading, setIsLoading] = useState55(false);
15760
+ const [error, setError] = useState55(null);
15724
15761
  const client = storedClient || fetchedClient;
15725
15762
  const fetchClient = useCallback32(async () => {
15726
15763
  if (!clientId) return;
@@ -15810,12 +15847,12 @@ function useOAuthClient(clientId) {
15810
15847
  __name(useOAuthClient, "useOAuthClient");
15811
15848
 
15812
15849
  // src/features/oauth/hooks/useOAuthConsent.ts
15813
- import { useCallback as useCallback33, useEffect as useEffect47, useState as useState55 } from "react";
15850
+ import { useCallback as useCallback33, useEffect as useEffect47, useState as useState56 } from "react";
15814
15851
  function useOAuthConsent(params) {
15815
- const [clientInfo, setClientInfo] = useState55(null);
15816
- const [isLoading, setIsLoading] = useState55(true);
15817
- const [error, setError] = useState55(null);
15818
- const [isSubmitting, setIsSubmitting] = useState55(false);
15852
+ const [clientInfo, setClientInfo] = useState56(null);
15853
+ const [isLoading, setIsLoading] = useState56(true);
15854
+ const [error, setError] = useState56(null);
15855
+ const [isSubmitting, setIsSubmitting] = useState56(false);
15819
15856
  useEffect47(() => {
15820
15857
  const fetchInfo = /* @__PURE__ */ __name(async () => {
15821
15858
  if (!params.clientId || !params.redirectUri || !params.scope) {
@@ -15891,20 +15928,20 @@ registerTableGenerator("companies", useCompanyTableStructure);
15891
15928
  // src/components/tables/ContentListTable.tsx
15892
15929
  import { flexRender, getCoreRowModel, getExpandedRowModel, useReactTable } from "@tanstack/react-table";
15893
15930
  import { ChevronLeft, ChevronRight } from "lucide-react";
15894
- import React28, { memo, useMemo as useMemo28, useState as useState57 } from "react";
15931
+ import React28, { memo, useMemo as useMemo28, useState as useState58 } from "react";
15895
15932
 
15896
15933
  // src/components/tables/ContentTableSearch.tsx
15897
15934
  import { RefreshCw, Search, X as X3 } from "lucide-react";
15898
15935
  import { useTranslations as useTranslations57 } from "next-intl";
15899
- import { useCallback as useCallback34, useEffect as useEffect48, useRef as useRef28, useState as useState56 } from "react";
15936
+ import { useCallback as useCallback34, useEffect as useEffect48, useRef as useRef28, useState as useState57 } from "react";
15900
15937
  import { jsx as jsx170, jsxs as jsxs97 } from "react/jsx-runtime";
15901
15938
  function ContentTableSearch({ data }) {
15902
15939
  const t = useTranslations57();
15903
15940
  const searchTermRef = useRef28("");
15904
15941
  const inputRef = useRef28(null);
15905
- const [searchTerm, setSearchTerm] = useState56("");
15906
- const [isFocused, setIsFocused] = useState56(false);
15907
- const [isSearching, setIsSearching] = useState56(false);
15942
+ const [searchTerm, setSearchTerm] = useState57("");
15943
+ const [isFocused, setIsFocused] = useState57(false);
15944
+ const [isSearching, setIsSearching] = useState57(false);
15908
15945
  const isExpanded = isFocused || searchTerm.length > 0;
15909
15946
  const search = useCallback34(
15910
15947
  async (searchedTerm) => {
@@ -15999,7 +16036,7 @@ function getGroupKeys(item, field) {
15999
16036
  __name(getGroupKeys, "getGroupKeys");
16000
16037
  var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(props) {
16001
16038
  const { data, fields, checkedIds, toggleId, allowSearch, filters: _filters, fullWidth } = props;
16002
- const [expanded, setExpanded] = useState57(
16039
+ const [expanded, setExpanded] = useState58(
16003
16040
  props.defaultExpanded === true ? true : typeof props.defaultExpanded === "object" ? props.defaultExpanded : {}
16004
16041
  );
16005
16042
  const { data: tableData, columns: tableColumns } = useTableGenerator(props.tableGeneratorType, {
@@ -16245,15 +16282,15 @@ __name(validateItalianTaxCode, "validateItalianTaxCode");
16245
16282
 
16246
16283
  // src/components/fiscal/ItalianFiscalData.tsx
16247
16284
  import { useTranslations as useTranslations58 } from "next-intl";
16248
- import { forwardRef as forwardRef8, useCallback as useCallback35, useImperativeHandle as useImperativeHandle2, useRef as useRef30, useState as useState58 } from "react";
16285
+ import { forwardRef as forwardRef8, useCallback as useCallback35, useImperativeHandle as useImperativeHandle2, useRef as useRef30, useState as useState59 } from "react";
16249
16286
  import { z as z4 } from "zod";
16250
16287
  import { jsx as jsx173, jsxs as jsxs100 } from "react/jsx-runtime";
16251
16288
  var ItalianFiscalData = forwardRef8(/* @__PURE__ */ __name(function ItalianFiscalData2({ initialData }, ref) {
16252
16289
  const t = useTranslations58();
16253
16290
  const initialRef = useRef30(initialData);
16254
- const [fiscalData, setFiscalData] = useState58(initialData);
16291
+ const [fiscalData, setFiscalData] = useState59(initialData);
16255
16292
  const fiscalDataRef = useRef30(initialData);
16256
- const [fiscalErrors, setFiscalErrors] = useState58({});
16293
+ const [fiscalErrors, setFiscalErrors] = useState59({});
16257
16294
  const updateFiscalField = useCallback35((key, value) => {
16258
16295
  setFiscalData((prev) => {
16259
16296
  const next = { ...prev, [key]: value };
@@ -16358,7 +16395,7 @@ var ItalianFiscalData_default = ItalianFiscalData;
16358
16395
  import Image8 from "next/image";
16359
16396
 
16360
16397
  // src/features/auth/contexts/AuthContext.tsx
16361
- import { createContext as createContext20, useContext as useContext21, useMemo as useMemo29, useState as useState60 } from "react";
16398
+ import { createContext as createContext21, useContext as useContext22, useMemo as useMemo29, useState as useState61 } from "react";
16362
16399
 
16363
16400
  // src/features/auth/components/forms/Register.tsx
16364
16401
  import { zodResolver as zodResolver5 } from "@hookform/resolvers/zod";
@@ -16366,7 +16403,7 @@ import { Loader2 as Loader23 } from "lucide-react";
16366
16403
  import { useTranslations as useTranslations60 } from "next-intl";
16367
16404
  import Image7 from "next/image";
16368
16405
  import { useSearchParams as useSearchParams2 } from "next/navigation";
16369
- import { useEffect as useEffect50, useState as useState59 } from "react";
16406
+ import { useEffect as useEffect50, useState as useState60 } from "react";
16370
16407
  import { useForm as useForm5 } from "react-hook-form";
16371
16408
  import { v4 as v45 } from "uuid";
16372
16409
  import { z as z5 } from "zod";
@@ -16437,13 +16474,13 @@ function Register() {
16437
16474
  const searchParams = useSearchParams2();
16438
16475
  const inviteCode = searchParams.get("invite");
16439
16476
  const registrationMode = getRegistrationMode();
16440
- const [showConfirmation, setShowConfirmation] = useState59(false);
16441
- const [inviteValidated, setInviteValidated] = useState59(false);
16442
- const [inviteError, setInviteError] = useState59("");
16443
- const [isValidatingInvite, setIsValidatingInvite] = useState59(
16477
+ const [showConfirmation, setShowConfirmation] = useState60(false);
16478
+ const [inviteValidated, setInviteValidated] = useState60(false);
16479
+ const [inviteError, setInviteError] = useState60("");
16480
+ const [isValidatingInvite, setIsValidatingInvite] = useState60(
16444
16481
  registrationMode === "waitlist" && !!inviteCode
16445
16482
  );
16446
- const [referralCode, setReferralCode2] = useState59(null);
16483
+ const [referralCode, setReferralCode2] = useState60(null);
16447
16484
  useEffect50(() => {
16448
16485
  const code = getReferralCode();
16449
16486
  setReferralCode2(code);
@@ -16708,15 +16745,15 @@ __name(Register, "Register");
16708
16745
 
16709
16746
  // src/features/auth/contexts/AuthContext.tsx
16710
16747
  import { jsx as jsx176 } from "react/jsx-runtime";
16711
- var AuthContext = createContext20(void 0);
16748
+ var AuthContext = createContext21(void 0);
16712
16749
  var AuthContextProvider = /* @__PURE__ */ __name(({
16713
16750
  children,
16714
16751
  initialComponentType,
16715
16752
  initialParams
16716
16753
  }) => {
16717
- const [componentType, setComponentType] = useState60(initialComponentType);
16718
- const [params, setParams] = useState60(initialParams);
16719
- const [pendingTwoFactor, setPendingTwoFactor] = useState60();
16754
+ const [componentType, setComponentType] = useState61(initialComponentType);
16755
+ const [params, setParams] = useState61(initialParams);
16756
+ const [pendingTwoFactor, setPendingTwoFactor] = useState61();
16720
16757
  const activeComponent = useMemo29(() => {
16721
16758
  if (componentType === void 0) return null;
16722
16759
  switch (componentType) {
@@ -16754,7 +16791,7 @@ var AuthContextProvider = /* @__PURE__ */ __name(({
16754
16791
  );
16755
16792
  }, "AuthContextProvider");
16756
16793
  var useAuthContext = /* @__PURE__ */ __name(() => {
16757
- const context = useContext21(AuthContext);
16794
+ const context = useContext22(AuthContext);
16758
16795
  if (context === void 0) {
16759
16796
  throw new Error("useAuthContext must be used within a AuthComponentProvider");
16760
16797
  }
@@ -16778,20 +16815,20 @@ __name(InnerAuthContainer, "InnerAuthContainer");
16778
16815
  // src/features/auth/components/two-factor/TwoFactorSettings.tsx
16779
16816
  import { ShieldAlert, ShieldCheck } from "lucide-react";
16780
16817
  import { useTranslations as useTranslations67 } from "next-intl";
16781
- import { useCallback as useCallback36, useEffect as useEffect52, useState as useState68 } from "react";
16818
+ import { useCallback as useCallback36, useEffect as useEffect52, useState as useState69 } from "react";
16782
16819
  import { v4 as v48 } from "uuid";
16783
16820
 
16784
16821
  // src/features/auth/components/two-factor/BackupCodesDialog.tsx
16785
16822
  import { Copy, Download, RefreshCw as RefreshCw2 } from "lucide-react";
16786
16823
  import { useTranslations as useTranslations61 } from "next-intl";
16787
- import { useState as useState61 } from "react";
16824
+ import { useState as useState62 } from "react";
16788
16825
  import { jsx as jsx178, jsxs as jsxs103 } from "react/jsx-runtime";
16789
16826
  function BackupCodesDialog({ remainingCodes, onRegenerate, trigger }) {
16790
16827
  const t = useTranslations61();
16791
- const [open, setOpen] = useState61(false);
16792
- const [codes, setCodes] = useState61([]);
16793
- const [isLoading, setIsLoading] = useState61(false);
16794
- const [showCodes, setShowCodes] = useState61(false);
16828
+ const [open, setOpen] = useState62(false);
16829
+ const [codes, setCodes] = useState62([]);
16830
+ const [isLoading, setIsLoading] = useState62(false);
16831
+ const [showCodes, setShowCodes] = useState62(false);
16795
16832
  const handleGenerate = /* @__PURE__ */ __name(async () => {
16796
16833
  setIsLoading(true);
16797
16834
  try {
@@ -16886,13 +16923,13 @@ __name(BackupCodesDialog, "BackupCodesDialog");
16886
16923
 
16887
16924
  // src/features/auth/components/two-factor/DisableTwoFactorDialog.tsx
16888
16925
  import { useTranslations as useTranslations62 } from "next-intl";
16889
- import { useState as useState63 } from "react";
16926
+ import { useState as useState64 } from "react";
16890
16927
 
16891
16928
  // src/features/auth/components/two-factor/TotpInput.tsx
16892
- import { useEffect as useEffect51, useRef as useRef31, useState as useState62 } from "react";
16929
+ import { useEffect as useEffect51, useRef as useRef31, useState as useState63 } from "react";
16893
16930
  import { jsx as jsx179, jsxs as jsxs104 } from "react/jsx-runtime";
16894
16931
  function TotpInput({ onComplete, disabled = false, autoFocus = true, error }) {
16895
- const [digits, setDigits] = useState62(["", "", "", "", "", ""]);
16932
+ const [digits, setDigits] = useState63(["", "", "", "", "", ""]);
16896
16933
  const inputRefs = useRef31([]);
16897
16934
  useEffect51(() => {
16898
16935
  if (autoFocus && inputRefs.current[0]) {
@@ -16956,9 +16993,9 @@ __name(TotpInput, "TotpInput");
16956
16993
  import { jsx as jsx180, jsxs as jsxs105 } from "react/jsx-runtime";
16957
16994
  function DisableTwoFactorDialog({ onSuccess, trigger }) {
16958
16995
  const t = useTranslations62();
16959
- const [open, setOpen] = useState63(false);
16960
- const [isLoading, setIsLoading] = useState63(false);
16961
- const [error, setError] = useState63();
16996
+ const [open, setOpen] = useState64(false);
16997
+ const [isLoading, setIsLoading] = useState64(false);
16998
+ const [error, setError] = useState64();
16962
16999
  const handleVerify = /* @__PURE__ */ __name(async (code) => {
16963
17000
  setIsLoading(true);
16964
17001
  setError(void 0);
@@ -16999,14 +17036,14 @@ __name(DisableTwoFactorDialog, "DisableTwoFactorDialog");
16999
17036
  // src/features/auth/components/two-factor/PasskeyList.tsx
17000
17037
  import { Edit, Key, Trash2 } from "lucide-react";
17001
17038
  import { useTranslations as useTranslations63 } from "next-intl";
17002
- import { useState as useState64 } from "react";
17039
+ import { useState as useState65 } from "react";
17003
17040
  import { Fragment as Fragment31, jsx as jsx181, jsxs as jsxs106 } from "react/jsx-runtime";
17004
17041
  function PasskeyList({ passkeys, onRefresh }) {
17005
17042
  const t = useTranslations63();
17006
- const [renameDialogOpen, setRenameDialogOpen] = useState64(false);
17007
- const [selectedPasskey, setSelectedPasskey] = useState64(null);
17008
- const [newName, setNewName] = useState64("");
17009
- const [isLoading, setIsLoading] = useState64(false);
17043
+ const [renameDialogOpen, setRenameDialogOpen] = useState65(false);
17044
+ const [selectedPasskey, setSelectedPasskey] = useState65(null);
17045
+ const [newName, setNewName] = useState65("");
17046
+ const [isLoading, setIsLoading] = useState65(false);
17010
17047
  const handleDelete = /* @__PURE__ */ __name(async (passkey) => {
17011
17048
  setIsLoading(true);
17012
17049
  try {
@@ -17120,14 +17157,14 @@ __name(PasskeyList, "PasskeyList");
17120
17157
  // src/features/auth/components/two-factor/PasskeySetupDialog.tsx
17121
17158
  import { startRegistration } from "@simplewebauthn/browser";
17122
17159
  import { useTranslations as useTranslations64 } from "next-intl";
17123
- import { useState as useState65 } from "react";
17160
+ import { useState as useState66 } from "react";
17124
17161
  import { v4 as v46 } from "uuid";
17125
17162
  import { jsx as jsx182, jsxs as jsxs107 } from "react/jsx-runtime";
17126
17163
  function PasskeySetupDialog({ open, onOpenChange, onSuccess }) {
17127
17164
  const t = useTranslations64();
17128
17165
  const { currentUser } = useCurrentUserContext();
17129
- const [name, setName] = useState65("");
17130
- const [isLoading, setIsLoading] = useState65(false);
17166
+ const [name, setName] = useState66("");
17167
+ const [isLoading, setIsLoading] = useState66(false);
17131
17168
  const handleRegister = /* @__PURE__ */ __name(async () => {
17132
17169
  if (!name.trim()) return;
17133
17170
  setIsLoading(true);
@@ -17191,11 +17228,11 @@ __name(PasskeySetupDialog, "PasskeySetupDialog");
17191
17228
  // src/features/auth/components/two-factor/TotpAuthenticatorList.tsx
17192
17229
  import { Smartphone, Trash2 as Trash22 } from "lucide-react";
17193
17230
  import { useTranslations as useTranslations65 } from "next-intl";
17194
- import { useState as useState66 } from "react";
17231
+ import { useState as useState67 } from "react";
17195
17232
  import { jsx as jsx183, jsxs as jsxs108 } from "react/jsx-runtime";
17196
17233
  function TotpAuthenticatorList({ authenticators, onDelete }) {
17197
17234
  const t = useTranslations65();
17198
- const [deletingId, setDeletingId] = useState66(null);
17235
+ const [deletingId, setDeletingId] = useState67(null);
17199
17236
  const handleDelete = /* @__PURE__ */ __name(async (id) => {
17200
17237
  setDeletingId(id);
17201
17238
  try {
@@ -17266,19 +17303,19 @@ __name(TotpAuthenticatorList, "TotpAuthenticatorList");
17266
17303
  // src/features/auth/components/two-factor/TotpSetupDialog.tsx
17267
17304
  import { useTranslations as useTranslations66 } from "next-intl";
17268
17305
  import { QRCodeSVG } from "qrcode.react";
17269
- import { useState as useState67 } from "react";
17306
+ import { useState as useState68 } from "react";
17270
17307
  import { v4 as v47 } from "uuid";
17271
17308
  import { jsx as jsx184, jsxs as jsxs109 } from "react/jsx-runtime";
17272
17309
  function TotpSetupDialog({ onSuccess, trigger }) {
17273
17310
  const t = useTranslations66();
17274
17311
  const { currentUser } = useCurrentUserContext();
17275
- const [open, setOpen] = useState67(false);
17276
- const [step, setStep] = useState67("name");
17277
- const [name, setName] = useState67("");
17278
- const [qrCodeUri, setQrCodeUri] = useState67("");
17279
- const [authenticatorId, setAuthenticatorId] = useState67("");
17280
- const [isLoading, setIsLoading] = useState67(false);
17281
- const [verifyError, setVerifyError] = useState67();
17312
+ const [open, setOpen] = useState68(false);
17313
+ const [step, setStep] = useState68("name");
17314
+ const [name, setName] = useState68("");
17315
+ const [qrCodeUri, setQrCodeUri] = useState68("");
17316
+ const [authenticatorId, setAuthenticatorId] = useState68("");
17317
+ const [isLoading, setIsLoading] = useState68(false);
17318
+ const [verifyError, setVerifyError] = useState68();
17282
17319
  const handleStartSetup = /* @__PURE__ */ __name(async () => {
17283
17320
  if (!name.trim()) return;
17284
17321
  setIsLoading(true);
@@ -17376,12 +17413,12 @@ __name(TotpSetupDialog, "TotpSetupDialog");
17376
17413
  import { Fragment as Fragment32, jsx as jsx185, jsxs as jsxs110 } from "react/jsx-runtime";
17377
17414
  function TwoFactorSettings() {
17378
17415
  const t = useTranslations67();
17379
- const [status, setStatus] = useState68(null);
17380
- const [authenticators, setAuthenticators] = useState68([]);
17381
- const [passkeys, setPasskeys] = useState68([]);
17382
- const [isLoading, setIsLoading] = useState68(true);
17383
- const [isEnabling, setIsEnabling] = useState68(false);
17384
- const [passkeyDialogOpen, setPasskeyDialogOpen] = useState68(false);
17416
+ const [status, setStatus] = useState69(null);
17417
+ const [authenticators, setAuthenticators] = useState69([]);
17418
+ const [passkeys, setPasskeys] = useState69([]);
17419
+ const [isLoading, setIsLoading] = useState69(true);
17420
+ const [isEnabling, setIsEnabling] = useState69(false);
17421
+ const [passkeyDialogOpen, setPasskeyDialogOpen] = useState69(false);
17385
17422
  const loadStatus = useCallback36(async () => {
17386
17423
  try {
17387
17424
  const [statusData, authenticatorsList, passkeysList] = await Promise.all([
@@ -17588,14 +17625,14 @@ __name(LandingComponent, "LandingComponent");
17588
17625
  import { zodResolver as zodResolver6 } from "@hookform/resolvers/zod";
17589
17626
  import { useTranslations as useTranslations69 } from "next-intl";
17590
17627
  import Image10 from "next/image";
17591
- import { useEffect as useEffect53, useState as useState69 } from "react";
17628
+ import { useEffect as useEffect53, useState as useState70 } from "react";
17592
17629
  import { useForm as useForm6 } from "react-hook-form";
17593
17630
  import { z as z6 } from "zod";
17594
17631
  import { Fragment as Fragment34, jsx as jsx189, jsxs as jsxs113 } from "react/jsx-runtime";
17595
17632
  function AcceptInvitation() {
17596
17633
  const { setComponentType, params, setParams } = useAuthContext();
17597
- const [showConfirmation, setShowConfirmation] = useState69(false);
17598
- const [error, setError] = useState69(void 0);
17634
+ const [showConfirmation, setShowConfirmation] = useState70(false);
17635
+ const [error, setError] = useState70(void 0);
17599
17636
  const t = useTranslations69();
17600
17637
  useEffect53(() => {
17601
17638
  async function validateCode(code) {
@@ -17690,12 +17727,12 @@ __name(AcceptInvitation, "AcceptInvitation");
17690
17727
  // src/features/auth/components/forms/ActivateAccount.tsx
17691
17728
  import { useTranslations as useTranslations70 } from "next-intl";
17692
17729
  import Image11 from "next/image";
17693
- import { useEffect as useEffect54, useState as useState70 } from "react";
17730
+ import { useEffect as useEffect54, useState as useState71 } from "react";
17694
17731
  import { Fragment as Fragment35, jsx as jsx190, jsxs as jsxs114 } from "react/jsx-runtime";
17695
17732
  function ActivateAccount() {
17696
17733
  const { setComponentType, params, setParams } = useAuthContext();
17697
- const [showConfirmation, setShowConfirmation] = useState70(false);
17698
- const [error, setError] = useState70(void 0);
17734
+ const [showConfirmation, setShowConfirmation] = useState71(false);
17735
+ const [error, setError] = useState71(void 0);
17699
17736
  const t = useTranslations70();
17700
17737
  useEffect54(() => {
17701
17738
  async function ActivateAccount2(code) {
@@ -17738,11 +17775,11 @@ function ActivateAccount() {
17738
17775
  __name(ActivateAccount, "ActivateAccount");
17739
17776
 
17740
17777
  // src/features/auth/components/forms/Cookies.tsx
17741
- import { useEffect as useEffect55, useState as useState71 } from "react";
17778
+ import { useEffect as useEffect55, useState as useState72 } from "react";
17742
17779
  function Cookies({ dehydratedAuth, page }) {
17743
17780
  const { setUser } = useCurrentUserContext();
17744
17781
  const router = useI18nRouter();
17745
- const [hasSaved, setHasSaved] = useState71(false);
17782
+ const [hasSaved, setHasSaved] = useState72(false);
17746
17783
  useEffect55(() => {
17747
17784
  if (hasSaved) return;
17748
17785
  async function saveTokenOnServer() {
@@ -17766,14 +17803,14 @@ __name(Cookies, "Cookies");
17766
17803
  import { zodResolver as zodResolver7 } from "@hookform/resolvers/zod";
17767
17804
  import { useTranslations as useTranslations71 } from "next-intl";
17768
17805
  import Image12 from "next/image";
17769
- import { useState as useState72 } from "react";
17806
+ import { useState as useState73 } from "react";
17770
17807
  import { useForm as useForm7 } from "react-hook-form";
17771
17808
  import { z as z7 } from "zod";
17772
17809
  import { Fragment as Fragment36, jsx as jsx191, jsxs as jsxs115 } from "react/jsx-runtime";
17773
17810
  function ForgotPassword() {
17774
17811
  const t = useTranslations71();
17775
17812
  const { setComponentType } = useAuthContext();
17776
- const [showConfirmation, setShowConfirmation] = useState72(false);
17813
+ const [showConfirmation, setShowConfirmation] = useState73(false);
17777
17814
  const formSchema = z7.object({
17778
17815
  email: z7.string().email({
17779
17816
  message: t(`common.errors.invalid_email`)
@@ -17838,7 +17875,7 @@ import { zodResolver as zodResolver8 } from "@hookform/resolvers/zod";
17838
17875
  import { useTranslations as useTranslations72 } from "next-intl";
17839
17876
  import Image13 from "next/image";
17840
17877
  import { useRouter, useSearchParams as useSearchParams3 } from "next/navigation";
17841
- import { useEffect as useEffect56, useState as useState73 } from "react";
17878
+ import { useEffect as useEffect56, useState as useState74 } from "react";
17842
17879
  import { useForm as useForm8 } from "react-hook-form";
17843
17880
  import { z as z8 } from "zod";
17844
17881
  import { Fragment as Fragment37, jsx as jsx192, jsxs as jsxs116 } from "react/jsx-runtime";
@@ -17851,7 +17888,7 @@ function Login() {
17851
17888
  const nativeRouter = useRouter();
17852
17889
  const searchParams = useSearchParams3();
17853
17890
  const callbackUrl = searchParams.get("callbackUrl");
17854
- const [referralCode, setReferralCode2] = useState73(null);
17891
+ const [referralCode, setReferralCode2] = useState74(null);
17855
17892
  useEffect56(() => {
17856
17893
  const cookies = document.cookie.split("; ");
17857
17894
  for (const cookie of cookies) {
@@ -18034,14 +18071,14 @@ __name(RefreshUser, "RefreshUser");
18034
18071
  import { zodResolver as zodResolver9 } from "@hookform/resolvers/zod";
18035
18072
  import { useTranslations as useTranslations73 } from "next-intl";
18036
18073
  import Image14 from "next/image";
18037
- import { useEffect as useEffect59, useState as useState74 } from "react";
18074
+ import { useEffect as useEffect59, useState as useState75 } from "react";
18038
18075
  import { useForm as useForm9 } from "react-hook-form";
18039
18076
  import { z as z9 } from "zod";
18040
18077
  import { Fragment as Fragment39, jsx as jsx194, jsxs as jsxs117 } from "react/jsx-runtime";
18041
18078
  function ResetPassword() {
18042
18079
  const { setComponentType, params, setParams } = useAuthContext();
18043
- const [showConfirmation, setShowConfirmation] = useState74(false);
18044
- const [error, setError] = useState74(void 0);
18080
+ const [showConfirmation, setShowConfirmation] = useState75(false);
18081
+ const [error, setError] = useState75(void 0);
18045
18082
  const t = useTranslations73();
18046
18083
  useEffect59(() => {
18047
18084
  async function validateResetPasswordCode(code) {
@@ -18120,18 +18157,18 @@ __name(ResetPassword, "ResetPassword");
18120
18157
  // src/features/auth/components/forms/TwoFactorChallenge.tsx
18121
18158
  import { useTranslations as useTranslations75 } from "next-intl";
18122
18159
  import { useRouter as useRouter2, useSearchParams as useSearchParams4 } from "next/navigation";
18123
- import { useState as useState76 } from "react";
18160
+ import { useState as useState77 } from "react";
18124
18161
  import { v4 as v410 } from "uuid";
18125
18162
 
18126
18163
  // src/features/auth/components/two-factor/PasskeyButton.tsx
18127
18164
  import { startAuthentication } from "@simplewebauthn/browser";
18128
18165
  import { useTranslations as useTranslations74 } from "next-intl";
18129
- import { useState as useState75 } from "react";
18166
+ import { useState as useState76 } from "react";
18130
18167
  import { v4 as v49 } from "uuid";
18131
18168
  import { jsx as jsx195 } from "react/jsx-runtime";
18132
18169
  function PasskeyButton({ pendingToken, onSuccess, onError, disabled = false }) {
18133
18170
  const t = useTranslations74();
18134
- const [isLoading, setIsLoading] = useState75(false);
18171
+ const [isLoading, setIsLoading] = useState76(false);
18135
18172
  const handleClick = /* @__PURE__ */ __name(async () => {
18136
18173
  setIsLoading(true);
18137
18174
  try {
@@ -18176,10 +18213,10 @@ function TwoFactorChallenge() {
18176
18213
  const nativeRouter = useRouter2();
18177
18214
  const searchParams = useSearchParams4();
18178
18215
  const callbackUrl = searchParams.get("callbackUrl");
18179
- const [isVerifying, setIsVerifying] = useState76(false);
18180
- const [totpError, setTotpError] = useState76();
18181
- const [backupCode, setBackupCode] = useState76("");
18182
- const [backupError, setBackupError] = useState76();
18216
+ const [isVerifying, setIsVerifying] = useState77(false);
18217
+ const [totpError, setTotpError] = useState77();
18218
+ const [backupCode, setBackupCode] = useState77("");
18219
+ const [backupError, setBackupError] = useState77();
18183
18220
  if (!pendingTwoFactor) {
18184
18221
  return null;
18185
18222
  }
@@ -18382,7 +18419,7 @@ __name(RelevantContentsList, "RelevantContentsList");
18382
18419
  // src/features/how-to/components/containers/HowToCommand.tsx
18383
18420
  import { ArrowRight, LifeBuoyIcon } from "lucide-react";
18384
18421
  import { useTranslations as useTranslations80 } from "next-intl";
18385
- import { useCallback as useCallback37, useEffect as useEffect60, useMemo as useMemo31, useRef as useRef32, useState as useState77 } from "react";
18422
+ import { useCallback as useCallback37, useEffect as useEffect60, useMemo as useMemo31, useRef as useRef32, useState as useState78 } from "react";
18386
18423
 
18387
18424
  // src/features/how-to/components/containers/HowToCommandViewer.tsx
18388
18425
  import { ArrowLeft, BookOpen, MessageSquare } from "lucide-react";
@@ -18508,10 +18545,10 @@ function matchPage(pathname, pattern) {
18508
18545
  __name(matchPage, "matchPage");
18509
18546
  function HowToCommand({ pathname, extraGroups, onStartChat }) {
18510
18547
  const t = useTranslations80();
18511
- const [dialogOpen, setDialogOpen] = useState77(false);
18512
- const [selectedHowTo, setSelectedHowTo] = useState77(null);
18548
+ const [dialogOpen, setDialogOpen] = useState78(false);
18549
+ const [selectedHowTo, setSelectedHowTo] = useState78(null);
18513
18550
  const searchTermRef = useRef32("");
18514
- const [searchTerm, setSearchTerm] = useState77("");
18551
+ const [searchTerm, setSearchTerm] = useState78("");
18515
18552
  const data = useDataListRetriever({
18516
18553
  retriever: /* @__PURE__ */ __name((params) => {
18517
18554
  return HowToService.findMany(params);
@@ -18820,7 +18857,7 @@ __name(HowToListContainer, "HowToListContainer");
18820
18857
  // src/features/how-to/components/forms/HowToSelector.tsx
18821
18858
  import { CircleX as CircleX2, RefreshCwIcon as RefreshCwIcon3, SearchIcon as SearchIcon6, XIcon as XIcon10 } from "lucide-react";
18822
18859
  import { useTranslations as useTranslations84 } from "next-intl";
18823
- import { useCallback as useCallback38, useEffect as useEffect61, useRef as useRef33, useState as useState78 } from "react";
18860
+ import { useCallback as useCallback38, useEffect as useEffect61, useRef as useRef33, useState as useState79 } from "react";
18824
18861
  import { Fragment as Fragment43, jsx as jsx208, jsxs as jsxs123 } from "react/jsx-runtime";
18825
18862
  function HowToSelector({
18826
18863
  id,
@@ -18831,10 +18868,10 @@ function HowToSelector({
18831
18868
  isRequired = false
18832
18869
  }) {
18833
18870
  const t = useTranslations84();
18834
- const [open, setOpen] = useState78(false);
18871
+ const [open, setOpen] = useState79(false);
18835
18872
  const searchTermRef = useRef33("");
18836
- const [searchTerm, setSearchTerm] = useState78("");
18837
- const [isSearching, setIsSearching] = useState78(false);
18873
+ const [searchTerm, setSearchTerm] = useState79("");
18874
+ const [isSearching, setIsSearching] = useState79(false);
18838
18875
  const data = useDataListRetriever({
18839
18876
  retriever: /* @__PURE__ */ __name((params) => {
18840
18877
  return HowToService.findMany(params);
@@ -18983,18 +19020,18 @@ function AssistantSidebar({ threads, activeId, onSelect, onNew }) {
18983
19020
  __name(AssistantSidebar, "AssistantSidebar");
18984
19021
 
18985
19022
  // src/features/assistant/components/parts/AssistantEmptyState.tsx
18986
- import { useState as useState80 } from "react";
19023
+ import { useState as useState81 } from "react";
18987
19024
  import { useTranslations as useTranslations87 } from "next-intl";
18988
19025
  import { Sparkles } from "lucide-react";
18989
19026
 
18990
19027
  // src/features/assistant/components/parts/AssistantComposer.tsx
18991
- import { useState as useState79 } from "react";
19028
+ import { useState as useState80 } from "react";
18992
19029
  import { useTranslations as useTranslations86 } from "next-intl";
18993
19030
  import { ArrowUp } from "lucide-react";
18994
19031
  import { jsx as jsx210, jsxs as jsxs125 } from "react/jsx-runtime";
18995
19032
  function AssistantComposer({ onSend, disabled, value: controlled, onValueChange }) {
18996
19033
  const t = useTranslations86();
18997
- const [internal, setInternal] = useState79("");
19034
+ const [internal, setInternal] = useState80("");
18998
19035
  const value = controlled ?? internal;
18999
19036
  const setValue = onValueChange ?? setInternal;
19000
19037
  const canSend = value.trim().length > 0 && !disabled;
@@ -19040,7 +19077,7 @@ import { jsx as jsx211, jsxs as jsxs126 } from "react/jsx-runtime";
19040
19077
  var STARTER_KEYS = ["a", "b", "c", "d"];
19041
19078
  function AssistantEmptyState({ onSend, operatorMode = false, onOperatorModeChange }) {
19042
19079
  const t = useTranslations87();
19043
- const [draft, setDraft] = useState80("");
19080
+ const [draft, setDraft] = useState81("");
19044
19081
  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: [
19045
19082
  /* @__PURE__ */ jsxs126("div", { className: "text-center", children: [
19046
19083
  /* @__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" }) }),
@@ -19078,14 +19115,14 @@ function AssistantEmptyState({ onSend, operatorMode = false, onOperatorModeChang
19078
19115
  __name(AssistantEmptyState, "AssistantEmptyState");
19079
19116
 
19080
19117
  // src/features/assistant/components/parts/AssistantThreadHeader.tsx
19081
- import { useState as useState81 } from "react";
19118
+ import { useState as useState82 } from "react";
19082
19119
  import { useTranslations as useTranslations88 } from "next-intl";
19083
19120
  import { jsx as jsx212, jsxs as jsxs127 } from "react/jsx-runtime";
19084
19121
  function AssistantThreadHeader({ assistant, onRename, onDelete }) {
19085
19122
  const t = useTranslations88();
19086
- const [renameValue, setRenameValue] = useState81(assistant.title);
19087
- const [renameOpen, setRenameOpen] = useState81(false);
19088
- const [deleteOpen, setDeleteOpen] = useState81(false);
19123
+ const [renameValue, setRenameValue] = useState82(assistant.title);
19124
+ const [renameOpen, setRenameOpen] = useState82(false);
19125
+ const [deleteOpen, setDeleteOpen] = useState82(false);
19089
19126
  const handleRename = /* @__PURE__ */ __name(async () => {
19090
19127
  const trimmed = renameValue.trim() || assistant.title;
19091
19128
  await onRename(trimmed);
@@ -19147,10 +19184,10 @@ import ReactMarkdown3 from "react-markdown";
19147
19184
  import remarkGfm3 from "remark-gfm";
19148
19185
 
19149
19186
  // src/features/assistant-message/components/parts/MessageSourcesContainer.tsx
19150
- import { useEffect as useEffect62, useMemo as useMemo34, useState as useState84 } from "react";
19187
+ import { useEffect as useEffect62, useMemo as useMemo34, useState as useState85 } from "react";
19151
19188
 
19152
19189
  // src/features/assistant-message/components/parts/MessageSourcesPanel.tsx
19153
- import { useMemo as useMemo33, useState as useState83 } from "react";
19190
+ import { useMemo as useMemo33, useState as useState84 } from "react";
19154
19191
  import { useTranslations as useTranslations93 } from "next-intl";
19155
19192
  import { ChevronDown as ChevronDown4, ChevronRight as ChevronRight2 } from "lucide-react";
19156
19193
 
@@ -19187,7 +19224,7 @@ function ReferencesTab({ references }) {
19187
19224
  __name(ReferencesTab, "ReferencesTab");
19188
19225
 
19189
19226
  // src/features/assistant-message/components/parts/tabs/CitationsTab.tsx
19190
- import { Fragment as Fragment45, useState as useState82 } from "react";
19227
+ import { Fragment as Fragment45, useState as useState83 } from "react";
19191
19228
  import { useTranslations as useTranslations90 } from "next-intl";
19192
19229
  import { ChevronDown as ChevronDown3, HelpCircle } from "lucide-react";
19193
19230
  import ReactMarkdown2 from "react-markdown";
@@ -19226,7 +19263,7 @@ __name(RelevanceMeter, "RelevanceMeter");
19226
19263
  import { jsx as jsx215, jsxs as jsxs130 } from "react/jsx-runtime";
19227
19264
  function CitationsTab({ citations, sources }) {
19228
19265
  const t = useTranslations90();
19229
- const [expanded, setExpanded] = useState82(/* @__PURE__ */ new Set());
19266
+ const [expanded, setExpanded] = useState83(/* @__PURE__ */ new Set());
19230
19267
  if (citations.length === 0) return null;
19231
19268
  const sorted = [...citations].sort((a, b) => (b.relevance ?? 0) - (a.relevance ?? 0));
19232
19269
  const toggle = /* @__PURE__ */ __name((id) => {
@@ -19475,8 +19512,8 @@ function MessageSourcesPanel({ message, isLatestAssistant, onSelectFollowUp, sou
19475
19512
  if (usersCount > 0) visibleTabs.push("users");
19476
19513
  const autoOpen = isLatestAssistant && suggestionsCount > 0;
19477
19514
  const initialTab = autoOpen ? "suggested" : visibleTabs[0];
19478
- const [open, setOpen] = useState83(autoOpen);
19479
- const [active, setActive] = useState83(initialTab);
19515
+ const [open, setOpen] = useState84(autoOpen);
19516
+ const [active, setActive] = useState84(initialTab);
19480
19517
  if (total === 0) return null;
19481
19518
  const panelId = `sources-panel-${message.id}`;
19482
19519
  return /* @__PURE__ */ jsxs133("div", { className: "mt-2 w-full min-w-0", children: [
@@ -19555,7 +19592,7 @@ function MessageSourcesContainer({ message, isLatestAssistant, onSelectFollowUp
19555
19592
  }
19556
19593
  return parts.sort().join("|");
19557
19594
  }, [groups]);
19558
- const [resolved, setResolved] = useState84([]);
19595
+ const [resolved, setResolved] = useState85([]);
19559
19596
  useEffect62(() => {
19560
19597
  if (groups.size === 0) {
19561
19598
  setResolved([]);
@@ -19918,7 +19955,7 @@ __name(NotificationsListContainer, "NotificationsListContainer");
19918
19955
  // src/features/notification/components/modals/NotificationModal.tsx
19919
19956
  import { BellIcon } from "lucide-react";
19920
19957
  import { useTranslations as useTranslations98 } from "next-intl";
19921
- import { Fragment as Fragment48, useCallback as useCallback39, useEffect as useEffect64, useMemo as useMemo35, useRef as useRef35, useState as useState85 } from "react";
19958
+ import { Fragment as Fragment48, useCallback as useCallback39, useEffect as useEffect64, useMemo as useMemo35, useRef as useRef35, useState as useState86 } from "react";
19922
19959
  import { jsx as jsx229, jsxs as jsxs141 } from "react/jsx-runtime";
19923
19960
  function NotificationModalContent({ isOpen, setIsOpen }) {
19924
19961
  const _instanceId = useRef35(Math.random().toString(36).substr(2, 9));
@@ -19940,7 +19977,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
19940
19977
  } = useSocketContext();
19941
19978
  const t = useTranslations98();
19942
19979
  const generateUrl = usePageUrlGenerator();
19943
- const [newNotifications, setNewNotifications] = useState85(false);
19980
+ const [newNotifications, setNewNotifications] = useState86(false);
19944
19981
  const preventAutoClose = useRef35(false);
19945
19982
  const circuitBreakerRef = useRef35({
19946
19983
  count: 0,
@@ -20133,14 +20170,14 @@ __name(ReferralCodeCapture, "ReferralCodeCapture");
20133
20170
 
20134
20171
  // src/features/referral/components/ReferralWidget.tsx
20135
20172
  import { Copy as Copy2, Loader2 as Loader25, Mail, Users } from "lucide-react";
20136
- import { useCallback as useCallback40, useRef as useRef36, useState as useState88 } from "react";
20173
+ import { useCallback as useCallback40, useRef as useRef36, useState as useState89 } from "react";
20137
20174
 
20138
20175
  // src/features/referral/hooks/useReferralInvite.ts
20139
- import { useState as useState86 } from "react";
20176
+ import { useState as useState87 } from "react";
20140
20177
  function useReferralInvite() {
20141
- const [sending, setSending] = useState86(false);
20142
- const [error, setError] = useState86(null);
20143
- const [success, setSuccess] = useState86(false);
20178
+ const [sending, setSending] = useState87(false);
20179
+ const [error, setError] = useState87(null);
20180
+ const [success, setSuccess] = useState87(false);
20144
20181
  const sendInvite = /* @__PURE__ */ __name(async (email) => {
20145
20182
  if (!isReferralEnabled()) {
20146
20183
  return;
@@ -20162,11 +20199,11 @@ function useReferralInvite() {
20162
20199
  __name(useReferralInvite, "useReferralInvite");
20163
20200
 
20164
20201
  // src/features/referral/hooks/useReferralStats.ts
20165
- import { useEffect as useEffect66, useState as useState87 } from "react";
20202
+ import { useEffect as useEffect66, useState as useState88 } from "react";
20166
20203
  function useReferralStats() {
20167
- const [stats, setStats] = useState87(null);
20168
- const [loading, setLoading] = useState87(true);
20169
- const [error, setError] = useState87(null);
20204
+ const [stats, setStats] = useState88(null);
20205
+ const [loading, setLoading] = useState88(true);
20206
+ const [error, setError] = useState88(null);
20170
20207
  useEffect66(() => {
20171
20208
  if (!isReferralEnabled()) {
20172
20209
  setLoading(false);
@@ -20237,8 +20274,8 @@ function ReferralWidget({
20237
20274
  const t = { ...DEFAULT_TRANSLATIONS, ...translations };
20238
20275
  const { stats, loading, error } = useReferralStats();
20239
20276
  const { sendInvite, sending } = useReferralInvite();
20240
- const [email, setEmail] = useState88("");
20241
- const [copied, setCopied] = useState88(false);
20277
+ const [email, setEmail] = useState89("");
20278
+ const [copied, setCopied] = useState89(false);
20242
20279
  const linkInputRef = useRef36(null);
20243
20280
  const config = getReferralConfig();
20244
20281
  const baseUrl = config.referralUrlBase || (typeof window !== "undefined" ? window.location.origin : "");
@@ -20451,11 +20488,11 @@ __name(FormRoles, "FormRoles");
20451
20488
 
20452
20489
  // src/features/role/components/forms/RemoveUserFromRole.tsx
20453
20490
  import { useTranslations as useTranslations101 } from "next-intl";
20454
- import { useEffect as useEffect67, useState as useState89 } from "react";
20491
+ import { useEffect as useEffect67, useState as useState90 } from "react";
20455
20492
  import { Fragment as Fragment51, jsx as jsx236, jsxs as jsxs146 } from "react/jsx-runtime";
20456
20493
  function RemoveUserFromRole({ role, user, refresh }) {
20457
- const [open, setOpen] = useState89(false);
20458
- const [canRemove, setCanRemove] = useState89(false);
20494
+ const [open, setOpen] = useState90(false);
20495
+ const [canRemove, setCanRemove] = useState90(false);
20459
20496
  const t = useTranslations101();
20460
20497
  useEffect67(() => {
20461
20498
  async function checkCompanyAdminDeletability() {
@@ -20527,13 +20564,13 @@ __name(RemoveUserFromRole, "RemoveUserFromRole");
20527
20564
  // src/features/role/components/forms/UserRoleAdd.tsx
20528
20565
  import { PlusCircle as PlusCircle2 } from "lucide-react";
20529
20566
  import { useTranslations as useTranslations102 } from "next-intl";
20530
- import { useCallback as useCallback41, useEffect as useEffect68, useRef as useRef37, useState as useState90 } from "react";
20567
+ import { useCallback as useCallback41, useEffect as useEffect68, useRef as useRef37, useState as useState91 } from "react";
20531
20568
  import { Fragment as Fragment52, jsx as jsx237, jsxs as jsxs147 } from "react/jsx-runtime";
20532
20569
  function UserRoleAdd({ user, refresh }) {
20533
- const [open, setOpen] = useState90(false);
20570
+ const [open, setOpen] = useState91(false);
20534
20571
  const inputRef = useRef37(null);
20535
- const [searchTerm, setSearchTerm] = useState90("");
20536
- const [roles, setRoles] = useState90([]);
20572
+ const [searchTerm, setSearchTerm] = useState91("");
20573
+ const [roles, setRoles] = useState91([]);
20537
20574
  const t = useTranslations102();
20538
20575
  const addUserToRole = /* @__PURE__ */ __name(async (role) => {
20539
20576
  await RoleService.addUserToRole({
@@ -20839,11 +20876,11 @@ function OAuthScopeSelector({
20839
20876
  __name(OAuthScopeSelector, "OAuthScopeSelector");
20840
20877
 
20841
20878
  // src/features/oauth/components/OAuthClientSecretDisplay.tsx
20842
- import { useState as useState91, useCallback as useCallback44 } from "react";
20879
+ import { useState as useState92, useCallback as useCallback44 } from "react";
20843
20880
  import { Copy as Copy3, Check, AlertTriangle } from "lucide-react";
20844
20881
  import { jsx as jsx242, jsxs as jsxs150 } from "react/jsx-runtime";
20845
20882
  function OAuthClientSecretDisplay({ secret, onDismiss, open, clientName }) {
20846
- const [copied, setCopied] = useState91(false);
20883
+ const [copied, setCopied] = useState92(false);
20847
20884
  const handleCopy = useCallback44(async () => {
20848
20885
  try {
20849
20886
  await navigator.clipboard.writeText(secret);
@@ -21036,18 +21073,18 @@ function OAuthClientList({
21036
21073
  __name(OAuthClientList, "OAuthClientList");
21037
21074
 
21038
21075
  // src/features/oauth/components/OAuthClientForm.tsx
21039
- import { useState as useState92, useCallback as useCallback45 } from "react";
21076
+ import { useState as useState93, useCallback as useCallback45 } from "react";
21040
21077
  import { jsx as jsx245, jsxs as jsxs153 } from "react/jsx-runtime";
21041
21078
  function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
21042
21079
  const isEditMode = !!client;
21043
- const [formState, setFormState] = useState92({
21080
+ const [formState, setFormState] = useState93({
21044
21081
  name: client?.name || "",
21045
21082
  description: client?.description || "",
21046
21083
  redirectUris: client?.redirectUris?.length ? client.redirectUris : [""],
21047
21084
  allowedScopes: client?.allowedScopes || [],
21048
21085
  isConfidential: client?.isConfidential ?? true
21049
21086
  });
21050
- const [errors, setErrors] = useState92({});
21087
+ const [errors, setErrors] = useState93({});
21051
21088
  const validate = useCallback45(() => {
21052
21089
  const newErrors = {};
21053
21090
  if (!formState.name.trim()) {
@@ -21170,7 +21207,7 @@ function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
21170
21207
  __name(OAuthClientForm, "OAuthClientForm");
21171
21208
 
21172
21209
  // src/features/oauth/components/OAuthClientDetail.tsx
21173
- import { useState as useState93, useCallback as useCallback46 } from "react";
21210
+ import { useState as useState94, useCallback as useCallback46 } from "react";
21174
21211
  import { format as format2 } from "date-fns";
21175
21212
  import { Copy as Copy4, Check as Check2, RefreshCw as RefreshCw3, Pencil as Pencil2, Trash2 as Trash25, ExternalLink } from "lucide-react";
21176
21213
  import { Fragment as Fragment53, jsx as jsx246, jsxs as jsxs154 } from "react/jsx-runtime";
@@ -21181,11 +21218,11 @@ function OAuthClientDetail({
21181
21218
  onDelete,
21182
21219
  onRegenerateSecret
21183
21220
  }) {
21184
- const [copiedField, setCopiedField] = useState93(null);
21185
- const [showDeleteConfirm, setShowDeleteConfirm] = useState93(false);
21186
- const [showRegenerateConfirm, setShowRegenerateConfirm] = useState93(false);
21187
- const [isDeleting, setIsDeleting] = useState93(false);
21188
- const [isRegenerating, setIsRegenerating] = useState93(false);
21221
+ const [copiedField, setCopiedField] = useState94(null);
21222
+ const [showDeleteConfirm, setShowDeleteConfirm] = useState94(false);
21223
+ const [showRegenerateConfirm, setShowRegenerateConfirm] = useState94(false);
21224
+ const [isDeleting, setIsDeleting] = useState94(false);
21225
+ const [isRegenerating, setIsRegenerating] = useState94(false);
21189
21226
  const copyToClipboard2 = useCallback46(async (text, field) => {
21190
21227
  try {
21191
21228
  await navigator.clipboard.writeText(text);
@@ -21454,7 +21491,7 @@ __name(OAuthConsentScreen, "OAuthConsentScreen");
21454
21491
  import { zodResolver as zodResolver10 } from "@hookform/resolvers/zod";
21455
21492
  import { CheckCircle, Mail as Mail2 } from "lucide-react";
21456
21493
  import { useTranslations as useTranslations105 } from "next-intl";
21457
- import { useState as useState94 } from "react";
21494
+ import { useState as useState95 } from "react";
21458
21495
  import { useForm as useForm10 } from "react-hook-form";
21459
21496
  import { v4 as v411 } from "uuid";
21460
21497
  import { z as z10 } from "zod";
@@ -21555,8 +21592,8 @@ __name(WaitlistQuestionnaireRenderer, "WaitlistQuestionnaireRenderer");
21555
21592
  import { Fragment as Fragment54, jsx as jsx252, jsxs as jsxs160 } from "react/jsx-runtime";
21556
21593
  function WaitlistForm({ onSuccess }) {
21557
21594
  const t = useTranslations105();
21558
- const [isSubmitting, setIsSubmitting] = useState94(false);
21559
- const [isSuccess, setIsSuccess] = useState94(false);
21595
+ const [isSubmitting, setIsSubmitting] = useState95(false);
21596
+ const [isSuccess, setIsSuccess] = useState95(false);
21560
21597
  const config = getWaitlistConfig();
21561
21598
  const questionnaireFields = config.questionnaire ?? [];
21562
21599
  const questionnaireSchema = questionnaireFields.reduce(
@@ -21735,12 +21772,12 @@ __name(WaitlistSuccessState, "WaitlistSuccessState");
21735
21772
  // src/features/waitlist/components/sections/WaitlistConfirmation.tsx
21736
21773
  import { CheckCircle as CheckCircle4, Loader2 as Loader27, XCircle as XCircle2 } from "lucide-react";
21737
21774
  import { useTranslations as useTranslations107 } from "next-intl";
21738
- import { useEffect as useEffect69, useState as useState95 } from "react";
21775
+ import { useEffect as useEffect69, useState as useState96 } from "react";
21739
21776
  import { jsx as jsx255, jsxs as jsxs163 } from "react/jsx-runtime";
21740
21777
  function WaitlistConfirmation({ code }) {
21741
21778
  const t = useTranslations107();
21742
- const [state, setState] = useState95("loading");
21743
- const [errorMessage, setErrorMessage] = useState95("");
21779
+ const [state, setState] = useState96("loading");
21780
+ const [errorMessage, setErrorMessage] = useState96("");
21744
21781
  useEffect69(() => {
21745
21782
  async function confirmEmail() {
21746
21783
  try {
@@ -21781,7 +21818,7 @@ __name(WaitlistConfirmation, "WaitlistConfirmation");
21781
21818
  import { flexRender as flexRender2, getCoreRowModel as getCoreRowModel2, useReactTable as useReactTable2 } from "@tanstack/react-table";
21782
21819
  import { RefreshCw as RefreshCw4, Users as Users2 } from "lucide-react";
21783
21820
  import { useTranslations as useTranslations109 } from "next-intl";
21784
- import { useCallback as useCallback47, useEffect as useEffect70, useState as useState96 } from "react";
21821
+ import { useCallback as useCallback47, useEffect as useEffect70, useState as useState97 } from "react";
21785
21822
 
21786
21823
  // src/features/waitlist/hooks/useWaitlistTableStructure.tsx
21787
21824
  import { Send } from "lucide-react";
@@ -21878,10 +21915,10 @@ __name(useWaitlistTableStructure, "useWaitlistTableStructure");
21878
21915
  import { jsx as jsx257, jsxs as jsxs165 } from "react/jsx-runtime";
21879
21916
  function WaitlistList() {
21880
21917
  const t = useTranslations109();
21881
- const [entries, setEntries] = useState96([]);
21882
- const [total, setTotal] = useState96(0);
21883
- const [isLoading, setIsLoading] = useState96(true);
21884
- const [statusFilter, setStatusFilter] = useState96("all");
21918
+ const [entries, setEntries] = useState97([]);
21919
+ const [total, setTotal] = useState97(0);
21920
+ const [isLoading, setIsLoading] = useState97(true);
21921
+ const [statusFilter, setStatusFilter] = useState97("all");
21885
21922
  const loadEntries = useCallback47(async () => {
21886
21923
  setIsLoading(true);
21887
21924
  try {
@@ -21951,7 +21988,7 @@ __name(WaitlistList, "WaitlistList");
21951
21988
  // src/features/rbac/components/RbacContainer.tsx
21952
21989
  import { Loader2Icon as Loader2Icon4 } from "lucide-react";
21953
21990
  import { useTranslations as useTranslations111 } from "next-intl";
21954
- import { memo as memo2, useCallback as useCallback49, useEffect as useEffect72, useMemo as useMemo36, useRef as useRef38, useState as useState98 } from "react";
21991
+ import { memo as memo2, useCallback as useCallback49, useEffect as useEffect72, useMemo as useMemo36, useRef as useRef38, useState as useState99 } from "react";
21955
21992
 
21956
21993
  // src/features/rbac/components/RbacPermissionCell.tsx
21957
21994
  import { CheckIcon as CheckIcon9, MinusIcon as MinusIcon2, XIcon as XIcon11 } from "lucide-react";
@@ -22032,7 +22069,7 @@ __name(RbacPermissionCell, "RbacPermissionCell");
22032
22069
  import { Popover as PopoverPrimitive2 } from "@base-ui/react/popover";
22033
22070
  import { CheckIcon as CheckIcon10, MinusIcon as MinusIcon3, XIcon as XIcon12 } from "lucide-react";
22034
22071
  import { useTranslations as useTranslations110 } from "next-intl";
22035
- import { useCallback as useCallback48, useEffect as useEffect71, useState as useState97 } from "react";
22072
+ import { useCallback as useCallback48, useEffect as useEffect71, useState as useState98 } from "react";
22036
22073
  import { Fragment as Fragment55, jsx as jsx259, jsxs as jsxs167 } from "react/jsx-runtime";
22037
22074
  function RbacPermissionPicker({
22038
22075
  open,
@@ -22045,7 +22082,7 @@ function RbacPermissionPicker({
22045
22082
  onClose
22046
22083
  }) {
22047
22084
  const t = useTranslations110();
22048
- const [customSegment, setCustomSegment] = useState97("");
22085
+ const [customSegment, setCustomSegment] = useState98("");
22049
22086
  useEffect71(() => {
22050
22087
  if (!open) setCustomSegment("");
22051
22088
  }, [open]);
@@ -22294,8 +22331,8 @@ var ModuleEditor = memo2(/* @__PURE__ */ __name(function ModuleEditor2({
22294
22331
  function RbacContainer() {
22295
22332
  const t = useTranslations111();
22296
22333
  const { matrix, modulePaths, loading, error, roleNames, moduleNames, updateCell, clearCell } = useRbacContext();
22297
- const [selectedModuleId, setSelectedModuleId] = useState98(null);
22298
- const [activePicker, setActivePicker] = useState98(null);
22334
+ const [selectedModuleId, setSelectedModuleId] = useState99(null);
22335
+ const [activePicker, setActivePicker] = useState99(null);
22299
22336
  const openPicker = useCallback49((picker) => {
22300
22337
  setActivePicker(picker);
22301
22338
  }, []);
@@ -22406,7 +22443,7 @@ __name(RbacContainer, "RbacContainer");
22406
22443
  // src/features/rbac/components/RbacByRoleContainer.tsx
22407
22444
  import { Loader2Icon as Loader2Icon5 } from "lucide-react";
22408
22445
  import { useTranslations as useTranslations112 } from "next-intl";
22409
- import { Fragment as Fragment56, memo as memo3, useCallback as useCallback50, useEffect as useEffect73, useMemo as useMemo37, useRef as useRef39, useState as useState99 } from "react";
22446
+ import { Fragment as Fragment56, memo as memo3, useCallback as useCallback50, useEffect as useEffect73, useMemo as useMemo37, useRef as useRef39, useState as useState100 } from "react";
22410
22447
  import { jsx as jsx261, jsxs as jsxs169 } from "react/jsx-runtime";
22411
22448
  function findToken2(tokens, action) {
22412
22449
  if (!tokens) return void 0;
@@ -22444,8 +22481,8 @@ var ACTION_LABELS2 = {
22444
22481
  function RbacByRoleContainer() {
22445
22482
  const t = useTranslations112();
22446
22483
  const { matrix, modulePaths, loading, error, roleNames, moduleNames, updateCell, clearCell } = useRbacContext();
22447
- const [selectedRoleId, setSelectedRoleId] = useState99(null);
22448
- const [activePicker, setActivePicker] = useState99(null);
22484
+ const [selectedRoleId, setSelectedRoleId] = useState100(null);
22485
+ const [activePicker, setActivePicker] = useState100(null);
22449
22486
  const openPicker = useCallback50((picker) => {
22450
22487
  setActivePicker(picker);
22451
22488
  }, []);
@@ -23107,4 +23144,4 @@ export {
23107
23144
  useOAuthClients,
23108
23145
  useOAuthClient
23109
23146
  };
23110
- //# sourceMappingURL=chunk-DMG6R3Y4.mjs.map
23147
+ //# sourceMappingURL=chunk-BPGXWAKV.mjs.map