@carlonicora/nextjs-jsonapi 1.83.0 → 1.85.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.
@@ -8415,7 +8415,7 @@ __name(CommonDeleter, "CommonDeleter");
8415
8415
  // src/components/forms/CommonEditorButtons.tsx
8416
8416
  import { useTranslations as useTranslations9 } from "next-intl";
8417
8417
  import { jsx as jsx64, jsxs as jsxs36 } from "react/jsx-runtime";
8418
- function CommonEditorButtons({ isEdit, form, disabled, setOpen }) {
8418
+ function CommonEditorButtons({ isEdit, form, disabled, setOpen, hideSubmit }) {
8419
8419
  const t = useTranslations9();
8420
8420
  return /* @__PURE__ */ jsxs36("div", { className: "flex justify-end", children: [
8421
8421
  /* @__PURE__ */ jsx64(
@@ -8429,7 +8429,7 @@ function CommonEditorButtons({ isEdit, form, disabled, setOpen }) {
8429
8429
  children: t(`ui.buttons.cancel`)
8430
8430
  }
8431
8431
  ),
8432
- /* @__PURE__ */ jsx64(Button, { type: "submit", disabled: form.formState.isSubmitting || disabled, "data-testid": `modal-button-create`, children: isEdit ? t(`ui.buttons.confirm_update`) : t(`ui.buttons.confirm_create`) })
8432
+ !hideSubmit && /* @__PURE__ */ jsx64(Button, { type: "submit", disabled: form.formState.isSubmitting || disabled, "data-testid": `modal-button-create`, children: isEdit ? t(`ui.buttons.confirm_update`) : t(`ui.buttons.confirm_create`) })
8433
8433
  ] });
8434
8434
  }
8435
8435
  __name(CommonEditorButtons, "CommonEditorButtons");
@@ -8580,6 +8580,7 @@ function EditorSheet({
8580
8580
  onNavigate,
8581
8581
  size = "xl",
8582
8582
  disabled,
8583
+ hideSubmit,
8583
8584
  trigger,
8584
8585
  forceShow,
8585
8586
  onClose,
@@ -8649,7 +8650,16 @@ function EditorSheet({
8649
8650
  ] }),
8650
8651
  /* @__PURE__ */ jsx68(Form, { ...form, children: /* @__PURE__ */ jsxs39("form", { onSubmit: form.handleSubmit(wrappedOnSubmit), className: "flex min-h-0 flex-1 flex-col", children: [
8651
8652
  /* @__PURE__ */ jsx68("div", { className: "flex-1 overflow-y-auto px-6 py-4", children }),
8652
- /* @__PURE__ */ jsx68(SheetFooter, { className: "shrink-0 border-t px-6 py-4", children: /* @__PURE__ */ jsx68(CommonEditorButtons, { form, setOpen: handleOpenChange, isEdit, disabled }) })
8653
+ /* @__PURE__ */ jsx68(SheetFooter, { className: "shrink-0 border-t px-6 py-4", children: /* @__PURE__ */ jsx68(
8654
+ CommonEditorButtons,
8655
+ {
8656
+ form,
8657
+ setOpen: handleOpenChange,
8658
+ isEdit,
8659
+ disabled,
8660
+ hideSubmit
8661
+ }
8662
+ ) })
8653
8663
  ] }) })
8654
8664
  ] })
8655
8665
  ] }),
@@ -9200,7 +9210,7 @@ __name(FormCheckbox, "FormCheckbox");
9200
9210
  import dynamic from "next/dynamic";
9201
9211
  import React14 from "react";
9202
9212
  import { jsx as jsx73 } from "react/jsx-runtime";
9203
- var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-MA3MRV74.mjs"), {
9213
+ var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-UKGNL227.mjs"), {
9204
9214
  ssr: false
9205
9215
  });
9206
9216
  var BlockNoteEditorContainer = React14.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
@@ -13329,8 +13339,10 @@ __name(RoundPageContainerTitle, "RoundPageContainerTitle");
13329
13339
 
13330
13340
  // src/components/containers/RoundPageContainer.tsx
13331
13341
  import { useSearchParams } from "next/navigation";
13332
- import { useState as useState46 } from "react";
13342
+ import { useCallback as useCallback25, useEffect as useEffect38, useState as useState46 } from "react";
13333
13343
  import { Fragment as Fragment22, jsx as jsx147, jsxs as jsxs87 } from "react/jsx-runtime";
13344
+ var DETAILS_COOKIE_NAME = "round_page_details_state";
13345
+ var DETAILS_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
13334
13346
  function RoundPageContainer({
13335
13347
  module,
13336
13348
  id,
@@ -13342,7 +13354,15 @@ function RoundPageContainer({
13342
13354
  }) {
13343
13355
  const headerChildren = useHeaderChildren();
13344
13356
  const headerLeftContent = useHeaderLeftContent();
13345
- const [showDetails, setShowDetails] = useState46(false);
13357
+ const [showDetails, setShowDetailsState] = useState46(false);
13358
+ useEffect38(() => {
13359
+ const match = document.cookie.split("; ").find((row) => row.startsWith(`${DETAILS_COOKIE_NAME}=`));
13360
+ if (match?.split("=")[1] === "true") setShowDetailsState(true);
13361
+ }, []);
13362
+ const setShowDetails = useCallback25((value) => {
13363
+ setShowDetailsState(value);
13364
+ document.cookie = `${DETAILS_COOKIE_NAME}=${value}; path=/; max-age=${DETAILS_COOKIE_MAX_AGE}`;
13365
+ }, []);
13346
13366
  const searchParams = useSearchParams();
13347
13367
  const section = searchParams.get("section");
13348
13368
  const rewriteUrl = useUrlRewriter();
@@ -13460,13 +13480,13 @@ function AllowedUsersDetails({ showTitle, content }) {
13460
13480
  __name(AllowedUsersDetails, "AllowedUsersDetails");
13461
13481
 
13462
13482
  // src/components/pages/PageContainerContentDetails.tsx
13463
- import { useEffect as useEffect38, useRef as useRef22, useState as useState47 } from "react";
13483
+ import { useEffect as useEffect39, useRef as useRef22, useState as useState47 } from "react";
13464
13484
  import { jsx as jsx150, jsxs as jsxs90 } from "react/jsx-runtime";
13465
13485
  function PageContainerContentDetails({ items, section, module, id }) {
13466
13486
  const rewriteUrl = useUrlRewriter();
13467
13487
  const [isScrolled, setIsScrolled] = useState47(false);
13468
13488
  const sentinelRef = useRef22(null);
13469
- useEffect38(() => {
13489
+ useEffect39(() => {
13470
13490
  const sentinel = sentinelRef.current;
13471
13491
  if (!sentinel) return;
13472
13492
  const observer = new IntersectionObserver(
@@ -13499,13 +13519,13 @@ function PageContainerContentDetails({ items, section, module, id }) {
13499
13519
  __name(PageContainerContentDetails, "PageContainerContentDetails");
13500
13520
 
13501
13521
  // src/components/pages/PageContentContainer.tsx
13502
- import { useEffect as useEffect39, useState as useState48 } from "react";
13522
+ import { useEffect as useEffect40, useState as useState48 } from "react";
13503
13523
  import { useDefaultLayout } from "react-resizable-panels";
13504
13524
  import { jsx as jsx151, jsxs as jsxs91 } from "react/jsx-runtime";
13505
13525
  function PageContentContainer({ header, details, footer, content, fullBleed }) {
13506
13526
  const [mounted, setMounted] = useState48(false);
13507
13527
  const isMobile = useIsMobile();
13508
- useEffect39(() => {
13528
+ useEffect40(() => {
13509
13529
  setMounted(true);
13510
13530
  }, []);
13511
13531
  const isReady = mounted && isMobile !== void 0;
@@ -13641,10 +13661,10 @@ var cellUrl = /* @__PURE__ */ __name((params) => {
13641
13661
  }, "cellUrl");
13642
13662
 
13643
13663
  // src/client/context/JsonApiProvider.tsx
13644
- import { useEffect as useEffect40, useMemo as useMemo19 } from "react";
13664
+ import { useEffect as useEffect41, useMemo as useMemo19 } from "react";
13645
13665
  import { jsx as jsx156 } from "react/jsx-runtime";
13646
13666
  function JsonApiProvider({ config, children }) {
13647
- useEffect40(() => {
13667
+ useEffect41(() => {
13648
13668
  if (config.bootstrapper) {
13649
13669
  config.bootstrapper();
13650
13670
  }
@@ -13655,14 +13675,14 @@ function JsonApiProvider({ config, children }) {
13655
13675
  __name(JsonApiProvider, "JsonApiProvider");
13656
13676
 
13657
13677
  // src/client/hooks/useJsonApiGet.ts
13658
- import { useState as useState49, useEffect as useEffect41, useCallback as useCallback25, useRef as useRef23 } from "react";
13678
+ import { useState as useState49, useEffect as useEffect42, useCallback as useCallback26, useRef as useRef23 } from "react";
13659
13679
  function useJsonApiGet(params) {
13660
13680
  const [data, setData] = useState49(null);
13661
13681
  const [loading, setLoading] = useState49(false);
13662
13682
  const [error, setError] = useState49(null);
13663
13683
  const [response, setResponse] = useState49(null);
13664
13684
  const isMounted = useRef23(true);
13665
- const fetchData = useCallback25(async () => {
13685
+ const fetchData = useCallback26(async () => {
13666
13686
  if (params.options?.enabled === false) return;
13667
13687
  setLoading(true);
13668
13688
  setError(null);
@@ -13691,7 +13711,7 @@ function useJsonApiGet(params) {
13691
13711
  }
13692
13712
  }
13693
13713
  }, [params.classKey, params.endpoint, params.companyId, params.options?.enabled]);
13694
- const fetchNextPage = useCallback25(async () => {
13714
+ const fetchNextPage = useCallback26(async () => {
13695
13715
  if (!response?.nextPage) return;
13696
13716
  setLoading(true);
13697
13717
  try {
@@ -13712,7 +13732,7 @@ function useJsonApiGet(params) {
13712
13732
  }
13713
13733
  }
13714
13734
  }, [response]);
13715
- const fetchPreviousPage = useCallback25(async () => {
13735
+ const fetchPreviousPage = useCallback26(async () => {
13716
13736
  if (!response?.prevPage) return;
13717
13737
  setLoading(true);
13718
13738
  try {
@@ -13733,7 +13753,7 @@ function useJsonApiGet(params) {
13733
13753
  }
13734
13754
  }
13735
13755
  }, [response]);
13736
- useEffect41(() => {
13756
+ useEffect42(() => {
13737
13757
  isMounted.current = true;
13738
13758
  fetchData();
13739
13759
  return () => {
@@ -13755,19 +13775,19 @@ function useJsonApiGet(params) {
13755
13775
  __name(useJsonApiGet, "useJsonApiGet");
13756
13776
 
13757
13777
  // src/client/hooks/useJsonApiMutation.ts
13758
- import { useState as useState50, useCallback as useCallback26 } from "react";
13778
+ import { useState as useState50, useCallback as useCallback27 } from "react";
13759
13779
  function useJsonApiMutation(config) {
13760
13780
  const [data, setData] = useState50(null);
13761
13781
  const [loading, setLoading] = useState50(false);
13762
13782
  const [error, setError] = useState50(null);
13763
13783
  const [response, setResponse] = useState50(null);
13764
- const reset = useCallback26(() => {
13784
+ const reset = useCallback27(() => {
13765
13785
  setData(null);
13766
13786
  setLoading(false);
13767
13787
  setError(null);
13768
13788
  setResponse(null);
13769
13789
  }, []);
13770
- const mutate = useCallback26(
13790
+ const mutate = useCallback27(
13771
13791
  async (params) => {
13772
13792
  setLoading(true);
13773
13793
  setError(null);
@@ -14164,7 +14184,7 @@ var useContentTableStructure = /* @__PURE__ */ __name((params) => {
14164
14184
 
14165
14185
  // src/features/oauth/hooks/useOAuthClients.ts
14166
14186
  import { useAtom as useAtom3, useSetAtom } from "jotai";
14167
- import { useCallback as useCallback27, useEffect as useEffect42 } from "react";
14187
+ import { useCallback as useCallback28, useEffect as useEffect43 } from "react";
14168
14188
 
14169
14189
  // src/features/oauth/atoms/oauth.atoms.ts
14170
14190
  import { atom } from "jotai";
@@ -14226,7 +14246,7 @@ function useOAuthClients() {
14226
14246
  const [error, setError] = useAtom3(oauthClientsErrorAtom);
14227
14247
  const addClient = useSetAtom(addOAuthClientAtom);
14228
14248
  const setNewClientSecret = useSetAtom(setNewClientSecretAtom);
14229
- const fetchClients = useCallback27(async () => {
14249
+ const fetchClients = useCallback28(async () => {
14230
14250
  setIsLoading(true);
14231
14251
  setError(null);
14232
14252
  try {
@@ -14239,10 +14259,10 @@ function useOAuthClients() {
14239
14259
  setIsLoading(false);
14240
14260
  }
14241
14261
  }, [setClients, setIsLoading, setError]);
14242
- useEffect42(() => {
14262
+ useEffect43(() => {
14243
14263
  fetchClients();
14244
14264
  }, [fetchClients]);
14245
- const createClient = useCallback27(
14265
+ const createClient = useCallback28(
14246
14266
  async (data) => {
14247
14267
  setIsLoading(true);
14248
14268
  setError(null);
@@ -14279,7 +14299,7 @@ __name(useOAuthClients, "useOAuthClients");
14279
14299
 
14280
14300
  // src/features/oauth/hooks/useOAuthClient.ts
14281
14301
  import { useAtomValue as useAtomValue2, useSetAtom as useSetAtom2 } from "jotai";
14282
- import { useCallback as useCallback28, useEffect as useEffect43, useState as useState51 } from "react";
14302
+ import { useCallback as useCallback29, useEffect as useEffect44, useState as useState51 } from "react";
14283
14303
  function useOAuthClient(clientId) {
14284
14304
  const storedClient = useAtomValue2(oauthClientByIdAtom(clientId));
14285
14305
  const updateClientInStore = useSetAtom2(updateOAuthClientAtom);
@@ -14289,7 +14309,7 @@ function useOAuthClient(clientId) {
14289
14309
  const [isLoading, setIsLoading] = useState51(false);
14290
14310
  const [error, setError] = useState51(null);
14291
14311
  const client = storedClient || fetchedClient;
14292
- const fetchClient = useCallback28(async () => {
14312
+ const fetchClient = useCallback29(async () => {
14293
14313
  if (!clientId) return;
14294
14314
  setIsLoading(true);
14295
14315
  setError(null);
@@ -14303,12 +14323,12 @@ function useOAuthClient(clientId) {
14303
14323
  setIsLoading(false);
14304
14324
  }
14305
14325
  }, [clientId]);
14306
- useEffect43(() => {
14326
+ useEffect44(() => {
14307
14327
  if (!storedClient && clientId) {
14308
14328
  fetchClient();
14309
14329
  }
14310
14330
  }, [storedClient, clientId, fetchClient]);
14311
- const update = useCallback28(
14331
+ const update = useCallback29(
14312
14332
  async (data) => {
14313
14333
  if (!clientId) throw new Error("No client ID");
14314
14334
  setIsLoading(true);
@@ -14328,7 +14348,7 @@ function useOAuthClient(clientId) {
14328
14348
  },
14329
14349
  [clientId, updateClientInStore]
14330
14350
  );
14331
- const deleteClient = useCallback28(async () => {
14351
+ const deleteClient = useCallback29(async () => {
14332
14352
  if (!clientId) throw new Error("No client ID");
14333
14353
  setIsLoading(true);
14334
14354
  setError(null);
@@ -14344,7 +14364,7 @@ function useOAuthClient(clientId) {
14344
14364
  setIsLoading(false);
14345
14365
  }
14346
14366
  }, [clientId, removeClientFromStore]);
14347
- const regenerateSecret = useCallback28(async () => {
14367
+ const regenerateSecret = useCallback29(async () => {
14348
14368
  if (!clientId) throw new Error("No client ID");
14349
14369
  setIsLoading(true);
14350
14370
  setError(null);
@@ -14377,13 +14397,13 @@ function useOAuthClient(clientId) {
14377
14397
  __name(useOAuthClient, "useOAuthClient");
14378
14398
 
14379
14399
  // src/features/oauth/hooks/useOAuthConsent.ts
14380
- import { useCallback as useCallback29, useEffect as useEffect44, useState as useState52 } from "react";
14400
+ import { useCallback as useCallback30, useEffect as useEffect45, useState as useState52 } from "react";
14381
14401
  function useOAuthConsent(params) {
14382
14402
  const [clientInfo, setClientInfo] = useState52(null);
14383
14403
  const [isLoading, setIsLoading] = useState52(true);
14384
14404
  const [error, setError] = useState52(null);
14385
14405
  const [isSubmitting, setIsSubmitting] = useState52(false);
14386
- useEffect44(() => {
14406
+ useEffect45(() => {
14387
14407
  const fetchInfo = /* @__PURE__ */ __name(async () => {
14388
14408
  if (!params.clientId || !params.redirectUri || !params.scope) {
14389
14409
  setError(new Error("Missing required authorization parameters"));
@@ -14411,7 +14431,7 @@ function useOAuthConsent(params) {
14411
14431
  params.codeChallenge,
14412
14432
  params.codeChallengeMethod
14413
14433
  ]);
14414
- const approve = useCallback29(async () => {
14434
+ const approve = useCallback30(async () => {
14415
14435
  setIsSubmitting(true);
14416
14436
  setError(null);
14417
14437
  try {
@@ -14425,7 +14445,7 @@ function useOAuthConsent(params) {
14425
14445
  setIsSubmitting(false);
14426
14446
  }
14427
14447
  }, [params]);
14428
- const deny = useCallback29(async () => {
14448
+ const deny = useCallback30(async () => {
14429
14449
  setIsSubmitting(true);
14430
14450
  setError(null);
14431
14451
  try {
@@ -14463,7 +14483,7 @@ import { memo, useMemo as useMemo25, useState as useState54 } from "react";
14463
14483
  // src/components/tables/ContentTableSearch.tsx
14464
14484
  import { RefreshCw, Search, X as X3 } from "lucide-react";
14465
14485
  import { useTranslations as useTranslations55 } from "next-intl";
14466
- import { useCallback as useCallback30, useEffect as useEffect45, useRef as useRef24, useState as useState53 } from "react";
14486
+ import { useCallback as useCallback31, useEffect as useEffect46, useRef as useRef24, useState as useState53 } from "react";
14467
14487
  import { jsx as jsx160, jsxs as jsxs93 } from "react/jsx-runtime";
14468
14488
  function ContentTableSearch({ data }) {
14469
14489
  const t = useTranslations55();
@@ -14473,7 +14493,7 @@ function ContentTableSearch({ data }) {
14473
14493
  const [isFocused, setIsFocused] = useState53(false);
14474
14494
  const [isSearching, setIsSearching] = useState53(false);
14475
14495
  const isExpanded = isFocused || searchTerm.length > 0;
14476
- const search = useCallback30(
14496
+ const search = useCallback31(
14477
14497
  async (searchedTerm) => {
14478
14498
  try {
14479
14499
  if (searchedTerm === searchTermRef.current) return;
@@ -14486,7 +14506,7 @@ function ContentTableSearch({ data }) {
14486
14506
  [searchTermRef, data]
14487
14507
  );
14488
14508
  const updateSearchTerm = useDebounce2(search, 500);
14489
- useEffect45(() => {
14509
+ useEffect46(() => {
14490
14510
  setIsSearching(true);
14491
14511
  updateSearchTerm(searchTerm);
14492
14512
  }, [updateSearchTerm, searchTerm]);
@@ -14668,13 +14688,13 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
14668
14688
  }, "ContentListTable"));
14669
14689
 
14670
14690
  // src/components/grids/ContentListGrid.tsx
14671
- import { useEffect as useEffect46, useRef as useRef25 } from "react";
14691
+ import { useEffect as useEffect47, useRef as useRef25 } from "react";
14672
14692
  import { Fragment as Fragment27, jsx as jsx162, jsxs as jsxs95 } from "react/jsx-runtime";
14673
14693
  var DEFAULT_GRID_CLASSES = "grid grid-cols-2 gap-4 p-4 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5";
14674
14694
  function ContentListGrid(props) {
14675
14695
  const { data, ItemComponent, allowSearch, fullWidth, gridClassName } = props;
14676
14696
  const sentinelRef = useRef25(null);
14677
- useEffect46(() => {
14697
+ useEffect47(() => {
14678
14698
  if (!data.next || !sentinelRef.current) return;
14679
14699
  const observer = new IntersectionObserver(
14680
14700
  (entries) => {
@@ -14768,7 +14788,7 @@ __name(validateItalianTaxCode, "validateItalianTaxCode");
14768
14788
 
14769
14789
  // src/components/fiscal/ItalianFiscalData.tsx
14770
14790
  import { useTranslations as useTranslations56 } from "next-intl";
14771
- import { forwardRef as forwardRef8, useCallback as useCallback31, useImperativeHandle as useImperativeHandle2, useRef as useRef26, useState as useState55 } from "react";
14791
+ import { forwardRef as forwardRef8, useCallback as useCallback32, useImperativeHandle as useImperativeHandle2, useRef as useRef26, useState as useState55 } from "react";
14772
14792
  import { z as z4 } from "zod";
14773
14793
  import { jsx as jsx163, jsxs as jsxs96 } from "react/jsx-runtime";
14774
14794
  var ItalianFiscalData = forwardRef8(/* @__PURE__ */ __name(function ItalianFiscalData2({ initialData }, ref) {
@@ -14777,7 +14797,7 @@ var ItalianFiscalData = forwardRef8(/* @__PURE__ */ __name(function ItalianFisca
14777
14797
  const [fiscalData, setFiscalData] = useState55(initialData);
14778
14798
  const fiscalDataRef = useRef26(initialData);
14779
14799
  const [fiscalErrors, setFiscalErrors] = useState55({});
14780
- const updateFiscalField = useCallback31((key, value) => {
14800
+ const updateFiscalField = useCallback32((key, value) => {
14781
14801
  setFiscalData((prev) => {
14782
14802
  const next = { ...prev, [key]: value };
14783
14803
  fiscalDataRef.current = next;
@@ -14889,7 +14909,7 @@ import { Loader2 as Loader23 } from "lucide-react";
14889
14909
  import { useTranslations as useTranslations58 } from "next-intl";
14890
14910
  import Image7 from "next/image";
14891
14911
  import { useSearchParams as useSearchParams2 } from "next/navigation";
14892
- import { useEffect as useEffect47, useState as useState56 } from "react";
14912
+ import { useEffect as useEffect48, useState as useState56 } from "react";
14893
14913
  import { useForm as useForm5 } from "react-hook-form";
14894
14914
  import { v4 as v45 } from "uuid";
14895
14915
  import { z as z5 } from "zod";
@@ -14967,7 +14987,7 @@ function Register() {
14967
14987
  registrationMode === "waitlist" && !!inviteCode
14968
14988
  );
14969
14989
  const [referralCode, setReferralCode2] = useState56(null);
14970
- useEffect47(() => {
14990
+ useEffect48(() => {
14971
14991
  const code = getReferralCode();
14972
14992
  setReferralCode2(code);
14973
14993
  }, []);
@@ -15000,7 +15020,7 @@ function Register() {
15000
15020
  marketingConsent: false
15001
15021
  }
15002
15022
  });
15003
- useEffect47(() => {
15023
+ useEffect48(() => {
15004
15024
  async function validateInvite() {
15005
15025
  if (registrationMode !== "waitlist" || !inviteCode) {
15006
15026
  return;
@@ -15301,7 +15321,7 @@ __name(InnerAuthContainer, "InnerAuthContainer");
15301
15321
  // src/features/auth/components/two-factor/TwoFactorSettings.tsx
15302
15322
  import { ShieldAlert, ShieldCheck } from "lucide-react";
15303
15323
  import { useTranslations as useTranslations65 } from "next-intl";
15304
- import { useCallback as useCallback32, useEffect as useEffect49, useState as useState65 } from "react";
15324
+ import { useCallback as useCallback33, useEffect as useEffect50, useState as useState65 } from "react";
15305
15325
  import { v4 as v48 } from "uuid";
15306
15326
 
15307
15327
  // src/features/auth/components/two-factor/BackupCodesDialog.tsx
@@ -15412,12 +15432,12 @@ import { useTranslations as useTranslations60 } from "next-intl";
15412
15432
  import { useState as useState60 } from "react";
15413
15433
 
15414
15434
  // src/features/auth/components/two-factor/TotpInput.tsx
15415
- import { useEffect as useEffect48, useRef as useRef27, useState as useState59 } from "react";
15435
+ import { useEffect as useEffect49, useRef as useRef27, useState as useState59 } from "react";
15416
15436
  import { jsx as jsx169, jsxs as jsxs100 } from "react/jsx-runtime";
15417
15437
  function TotpInput({ onComplete, disabled = false, autoFocus = true, error }) {
15418
15438
  const [digits, setDigits] = useState59(["", "", "", "", "", ""]);
15419
15439
  const inputRefs = useRef27([]);
15420
- useEffect48(() => {
15440
+ useEffect49(() => {
15421
15441
  if (autoFocus && inputRefs.current[0]) {
15422
15442
  inputRefs.current[0].focus();
15423
15443
  }
@@ -15905,7 +15925,7 @@ function TwoFactorSettings() {
15905
15925
  const [isLoading, setIsLoading] = useState65(true);
15906
15926
  const [isEnabling, setIsEnabling] = useState65(false);
15907
15927
  const [passkeyDialogOpen, setPasskeyDialogOpen] = useState65(false);
15908
- const loadStatus = useCallback32(async () => {
15928
+ const loadStatus = useCallback33(async () => {
15909
15929
  try {
15910
15930
  const [statusData, authenticatorsList, passkeysList] = await Promise.all([
15911
15931
  TwoFactorService.getStatus(),
@@ -15921,7 +15941,7 @@ function TwoFactorSettings() {
15921
15941
  setIsLoading(false);
15922
15942
  }
15923
15943
  }, [t]);
15924
- useEffect49(() => {
15944
+ useEffect50(() => {
15925
15945
  loadStatus();
15926
15946
  }, [loadStatus]);
15927
15947
  const handleRefresh = /* @__PURE__ */ __name(() => {
@@ -16111,7 +16131,7 @@ __name(LandingComponent, "LandingComponent");
16111
16131
  import { zodResolver as zodResolver6 } from "@hookform/resolvers/zod";
16112
16132
  import { useTranslations as useTranslations67 } from "next-intl";
16113
16133
  import Image10 from "next/image";
16114
- import { useEffect as useEffect50, useState as useState66 } from "react";
16134
+ import { useEffect as useEffect51, useState as useState66 } from "react";
16115
16135
  import { useForm as useForm6 } from "react-hook-form";
16116
16136
  import { z as z6 } from "zod";
16117
16137
  import { Fragment as Fragment33, jsx as jsx179, jsxs as jsxs109 } from "react/jsx-runtime";
@@ -16120,7 +16140,7 @@ function AcceptInvitation() {
16120
16140
  const [showConfirmation, setShowConfirmation] = useState66(false);
16121
16141
  const [error, setError] = useState66(void 0);
16122
16142
  const t = useTranslations67();
16123
- useEffect50(() => {
16143
+ useEffect51(() => {
16124
16144
  async function validateCode(code) {
16125
16145
  try {
16126
16146
  const payload = {
@@ -16213,14 +16233,14 @@ __name(AcceptInvitation, "AcceptInvitation");
16213
16233
  // src/features/auth/components/forms/ActivateAccount.tsx
16214
16234
  import { useTranslations as useTranslations68 } from "next-intl";
16215
16235
  import Image11 from "next/image";
16216
- import { useEffect as useEffect51, useState as useState67 } from "react";
16236
+ import { useEffect as useEffect52, useState as useState67 } from "react";
16217
16237
  import { Fragment as Fragment34, jsx as jsx180, jsxs as jsxs110 } from "react/jsx-runtime";
16218
16238
  function ActivateAccount() {
16219
16239
  const { setComponentType, params, setParams } = useAuthContext();
16220
16240
  const [showConfirmation, setShowConfirmation] = useState67(false);
16221
16241
  const [error, setError] = useState67(void 0);
16222
16242
  const t = useTranslations68();
16223
- useEffect51(() => {
16243
+ useEffect52(() => {
16224
16244
  async function ActivateAccount2(code) {
16225
16245
  try {
16226
16246
  const payload = {
@@ -16261,12 +16281,12 @@ function ActivateAccount() {
16261
16281
  __name(ActivateAccount, "ActivateAccount");
16262
16282
 
16263
16283
  // src/features/auth/components/forms/Cookies.tsx
16264
- import { useEffect as useEffect52, useState as useState68 } from "react";
16284
+ import { useEffect as useEffect53, useState as useState68 } from "react";
16265
16285
  function Cookies({ dehydratedAuth, page }) {
16266
16286
  const { setUser } = useCurrentUserContext();
16267
16287
  const router = useI18nRouter();
16268
16288
  const [hasSaved, setHasSaved] = useState68(false);
16269
- useEffect52(() => {
16289
+ useEffect53(() => {
16270
16290
  if (hasSaved) return;
16271
16291
  async function saveTokenOnServer() {
16272
16292
  await AuthService.saveToken({ dehydratedAuth });
@@ -16361,7 +16381,7 @@ import { zodResolver as zodResolver8 } from "@hookform/resolvers/zod";
16361
16381
  import { useTranslations as useTranslations70 } from "next-intl";
16362
16382
  import Image13 from "next/image";
16363
16383
  import { useRouter, useSearchParams as useSearchParams3 } from "next/navigation";
16364
- import { useEffect as useEffect53, useState as useState70 } from "react";
16384
+ import { useEffect as useEffect54, useState as useState70 } from "react";
16365
16385
  import { useForm as useForm8 } from "react-hook-form";
16366
16386
  import { z as z8 } from "zod";
16367
16387
  import { Fragment as Fragment36, jsx as jsx182, jsxs as jsxs112 } from "react/jsx-runtime";
@@ -16375,7 +16395,7 @@ function Login() {
16375
16395
  const searchParams = useSearchParams3();
16376
16396
  const callbackUrl = searchParams.get("callbackUrl");
16377
16397
  const [referralCode, setReferralCode2] = useState70(null);
16378
- useEffect53(() => {
16398
+ useEffect54(() => {
16379
16399
  const cookies = document.cookie.split("; ");
16380
16400
  for (const cookie of cookies) {
16381
16401
  const [name, value] = cookie.split("=");
@@ -16494,7 +16514,7 @@ function Login() {
16494
16514
  __name(Login, "Login");
16495
16515
 
16496
16516
  // src/features/auth/components/forms/Logout.tsx
16497
- import { useEffect as useEffect54 } from "react";
16517
+ import { useEffect as useEffect55 } from "react";
16498
16518
 
16499
16519
  // src/features/auth/utils/clearClientStorage.ts
16500
16520
  function clearClientStorage(keys) {
@@ -16509,7 +16529,7 @@ __name(clearClientStorage, "clearClientStorage");
16509
16529
  import { Fragment as Fragment37, jsx as jsx183 } from "react/jsx-runtime";
16510
16530
  function Logout({ storageKeys }) {
16511
16531
  const generateUrl = usePageUrlGenerator();
16512
- useEffect54(() => {
16532
+ useEffect55(() => {
16513
16533
  const logOut = /* @__PURE__ */ __name(async () => {
16514
16534
  if (storageKeys?.length) {
16515
16535
  clearClientStorage(storageKeys);
@@ -16525,7 +16545,7 @@ __name(Logout, "Logout");
16525
16545
 
16526
16546
  // src/features/auth/components/forms/RefreshUser.tsx
16527
16547
  import { deleteCookie, getCookie } from "cookies-next";
16528
- import { useEffect as useEffect55 } from "react";
16548
+ import { useEffect as useEffect56 } from "react";
16529
16549
  function RefreshUser() {
16530
16550
  const { setUser } = useCurrentUserContext();
16531
16551
  const loadFullUser = /* @__PURE__ */ __name(async () => {
@@ -16545,7 +16565,7 @@ function RefreshUser() {
16545
16565
  deleteCookie("reloadData");
16546
16566
  }
16547
16567
  }, "loadFullUser");
16548
- useEffect55(() => {
16568
+ useEffect56(() => {
16549
16569
  const reloadData = getCookie("reloadData");
16550
16570
  if (reloadData !== void 0) loadFullUser();
16551
16571
  }, []);
@@ -16557,7 +16577,7 @@ __name(RefreshUser, "RefreshUser");
16557
16577
  import { zodResolver as zodResolver9 } from "@hookform/resolvers/zod";
16558
16578
  import { useTranslations as useTranslations71 } from "next-intl";
16559
16579
  import Image14 from "next/image";
16560
- import { useEffect as useEffect56, useState as useState71 } from "react";
16580
+ import { useEffect as useEffect57, useState as useState71 } from "react";
16561
16581
  import { useForm as useForm9 } from "react-hook-form";
16562
16582
  import { z as z9 } from "zod";
16563
16583
  import { Fragment as Fragment38, jsx as jsx184, jsxs as jsxs113 } from "react/jsx-runtime";
@@ -16566,7 +16586,7 @@ function ResetPassword() {
16566
16586
  const [showConfirmation, setShowConfirmation] = useState71(false);
16567
16587
  const [error, setError] = useState71(void 0);
16568
16588
  const t = useTranslations71();
16569
- useEffect56(() => {
16589
+ useEffect57(() => {
16570
16590
  async function validateResetPasswordCode(code) {
16571
16591
  try {
16572
16592
  const payload = {
@@ -16905,7 +16925,7 @@ __name(RelevantContentsList, "RelevantContentsList");
16905
16925
  // src/features/how-to/components/containers/HowToCommand.tsx
16906
16926
  import { ArrowRight, LifeBuoyIcon } from "lucide-react";
16907
16927
  import { useTranslations as useTranslations78 } from "next-intl";
16908
- import { useCallback as useCallback33, useEffect as useEffect57, useMemo as useMemo28, useRef as useRef28, useState as useState74 } from "react";
16928
+ import { useCallback as useCallback34, useEffect as useEffect58, useMemo as useMemo28, useRef as useRef28, useState as useState74 } from "react";
16909
16929
 
16910
16930
  // src/features/how-to/components/containers/HowToCommandViewer.tsx
16911
16931
  import { ArrowLeft, BookOpen, MessageSquare } from "lucide-react";
@@ -17057,7 +17077,7 @@ function HowToCommand({ pathname, extraGroups, onStartChat }) {
17057
17077
  });
17058
17078
  return { relevantHowTos: relevant, otherHowTos: other };
17059
17079
  }, [data.data, pathname]);
17060
- const search = useCallback33(
17080
+ const search = useCallback34(
17061
17081
  async (searchedTerm) => {
17062
17082
  if (searchedTerm === searchTermRef.current) return;
17063
17083
  searchTermRef.current = searchedTerm;
@@ -17066,16 +17086,16 @@ function HowToCommand({ pathname, extraGroups, onStartChat }) {
17066
17086
  [searchTermRef, data]
17067
17087
  );
17068
17088
  const updateSearchTerm = useDebounce2(search, 500);
17069
- useEffect57(() => {
17089
+ useEffect58(() => {
17070
17090
  updateSearchTerm(searchTerm);
17071
17091
  }, [updateSearchTerm, searchTerm]);
17072
- useEffect57(() => {
17092
+ useEffect58(() => {
17073
17093
  if (!dialogOpen) {
17074
17094
  setSearchTerm("");
17075
17095
  searchTermRef.current = "";
17076
17096
  }
17077
17097
  }, [dialogOpen]);
17078
- useEffect57(() => {
17098
+ useEffect58(() => {
17079
17099
  const down = /* @__PURE__ */ __name((e) => {
17080
17100
  if (e.key === "k" && (e.metaKey || e.ctrlKey)) {
17081
17101
  e.preventDefault();
@@ -17375,7 +17395,7 @@ __name(HowToMultiSelector, "HowToMultiSelector");
17375
17395
  // src/features/how-to/components/forms/HowToSelector.tsx
17376
17396
  import { CircleX as CircleX2, RefreshCwIcon as RefreshCwIcon3, SearchIcon as SearchIcon6, XIcon as XIcon10 } from "lucide-react";
17377
17397
  import { useTranslations as useTranslations83 } from "next-intl";
17378
- import { useCallback as useCallback34, useEffect as useEffect58, useRef as useRef29, useState as useState75 } from "react";
17398
+ import { useCallback as useCallback35, useEffect as useEffect59, useRef as useRef29, useState as useState75 } from "react";
17379
17399
  import { Fragment as Fragment42, jsx as jsx199, jsxs as jsxs119 } from "react/jsx-runtime";
17380
17400
  function HowToSelector({
17381
17401
  id,
@@ -17397,7 +17417,7 @@ function HowToSelector({
17397
17417
  retrieverParams: {},
17398
17418
  module: Modules.HowTo
17399
17419
  });
17400
- const search = useCallback34(
17420
+ const search = useCallback35(
17401
17421
  async (searchedTerm) => {
17402
17422
  try {
17403
17423
  if (searchedTerm === searchTermRef.current) return;
@@ -17411,7 +17431,7 @@ function HowToSelector({
17411
17431
  [searchTermRef, data]
17412
17432
  );
17413
17433
  const updateSearchTerm = useDebounce2(search, 500);
17414
- useEffect58(() => {
17434
+ useEffect59(() => {
17415
17435
  setIsSearching(true);
17416
17436
  updateSearchTerm(searchTerm);
17417
17437
  }, [updateSearchTerm, searchTerm]);
@@ -17681,7 +17701,7 @@ function AssistantThreadHeader({ assistant, onRename, onDelete }) {
17681
17701
  __name(AssistantThreadHeader, "AssistantThreadHeader");
17682
17702
 
17683
17703
  // src/features/assistant/components/parts/AssistantThread.tsx
17684
- import { useEffect as useEffect60, useRef as useRef30 } from "react";
17704
+ import { useEffect as useEffect61, useRef as useRef30 } from "react";
17685
17705
 
17686
17706
  // src/features/assistant-message/components/MessageItem.tsx
17687
17707
  import { useTranslations as useTranslations93 } from "next-intl";
@@ -17690,7 +17710,7 @@ import ReactMarkdown3 from "react-markdown";
17690
17710
  import remarkGfm3 from "remark-gfm";
17691
17711
 
17692
17712
  // src/features/assistant-message/components/parts/MessageSourcesContainer.tsx
17693
- import { useEffect as useEffect59, useMemo as useMemo31, useState as useState81 } from "react";
17713
+ import { useEffect as useEffect60, useMemo as useMemo31, useState as useState81 } from "react";
17694
17714
 
17695
17715
  // src/features/assistant-message/components/parts/MessageSourcesPanel.tsx
17696
17716
  import { useMemo as useMemo30, useState as useState80 } from "react";
@@ -18102,7 +18122,7 @@ function MessageSourcesContainer({ message, isLatestAssistant, onSelectFollowUp
18102
18122
  return parts.sort().join("|");
18103
18123
  }, [groups]);
18104
18124
  const [resolved, setResolved] = useState81([]);
18105
- useEffect59(() => {
18125
+ useEffect60(() => {
18106
18126
  if (groups.size === 0) {
18107
18127
  setResolved([]);
18108
18128
  return;
@@ -18245,7 +18265,7 @@ __name(AssistantStatusLine, "AssistantStatusLine");
18245
18265
  import { jsx as jsx215, jsxs as jsxs132 } from "react/jsx-runtime";
18246
18266
  function AssistantThread({ messages, sending, status, onSelectFollowUp, failedMessageIds, onRetry }) {
18247
18267
  const endRef = useRef30(null);
18248
- useEffect60(() => {
18268
+ useEffect61(() => {
18249
18269
  endRef.current?.scrollIntoView({ behavior: "smooth" });
18250
18270
  }, [messages.length, sending]);
18251
18271
  return /* @__PURE__ */ jsxs132("div", { className: "flex-1 min-w-0 overflow-x-hidden overflow-y-auto px-6 py-5", children: [
@@ -18438,7 +18458,7 @@ __name(NotificationsListContainer, "NotificationsListContainer");
18438
18458
  // src/features/notification/components/modals/NotificationModal.tsx
18439
18459
  import { BellIcon } from "lucide-react";
18440
18460
  import { useTranslations as useTranslations97 } from "next-intl";
18441
- import { Fragment as Fragment47, useCallback as useCallback35, useEffect as useEffect61, useMemo as useMemo32, useRef as useRef31, useState as useState82 } from "react";
18461
+ import { Fragment as Fragment47, useCallback as useCallback36, useEffect as useEffect62, useMemo as useMemo32, useRef as useRef31, useState as useState82 } from "react";
18442
18462
  import { jsx as jsx220, jsxs as jsxs137 } from "react/jsx-runtime";
18443
18463
  function NotificationModalContent({ isOpen, setIsOpen }) {
18444
18464
  const _instanceId = useRef31(Math.random().toString(36).substr(2, 9));
@@ -18468,7 +18488,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
18468
18488
  resetTime: 0,
18469
18489
  isOpen: false
18470
18490
  });
18471
- const checkCircuitBreaker = useCallback35(() => {
18491
+ const checkCircuitBreaker = useCallback36(() => {
18472
18492
  const now = Date.now();
18473
18493
  const breaker = circuitBreakerRef.current;
18474
18494
  if (now > breaker.resetTime) {
@@ -18490,14 +18510,14 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
18490
18510
  unreadIds: unreadNotifications2.map((notif) => notif.id)
18491
18511
  };
18492
18512
  }, [notifications]);
18493
- useEffect61(() => {
18513
+ useEffect62(() => {
18494
18514
  setNewNotifications(unreadCount > 0);
18495
18515
  }, [unreadCount]);
18496
- useEffect61(() => {
18516
+ useEffect62(() => {
18497
18517
  if (lastLoaded === 0) loadNotifications();
18498
18518
  }, [lastLoaded, loadNotifications]);
18499
18519
  const processSocketNotificationsRef = useRef31(null);
18500
- const processSocketNotifications = useCallback35(() => {
18520
+ const processSocketNotifications = useCallback36(() => {
18501
18521
  if (socketNotifications.length === 0) {
18502
18522
  return;
18503
18523
  }
@@ -18536,7 +18556,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
18536
18556
  generateUrl,
18537
18557
  checkCircuitBreaker
18538
18558
  ]);
18539
- useEffect61(() => {
18559
+ useEffect62(() => {
18540
18560
  if (processSocketNotificationsRef.current) {
18541
18561
  clearTimeout(processSocketNotificationsRef.current);
18542
18562
  }
@@ -18613,7 +18633,7 @@ __name(PushNotificationProvider, "PushNotificationProvider");
18613
18633
 
18614
18634
  // src/features/referral/components/ReferralCodeCapture.tsx
18615
18635
  import { useSearchParams as useSearchParams5 } from "next/navigation";
18616
- import { useEffect as useEffect62 } from "react";
18636
+ import { useEffect as useEffect63 } from "react";
18617
18637
 
18618
18638
  // src/features/referral/utils/referral-cookie.ts
18619
18639
  function setReferralCode(code) {
@@ -18638,7 +18658,7 @@ __name(getReferralCode2, "getReferralCode");
18638
18658
  // src/features/referral/components/ReferralCodeCapture.tsx
18639
18659
  function ReferralCodeCapture() {
18640
18660
  const searchParams = useSearchParams5();
18641
- useEffect62(() => {
18661
+ useEffect63(() => {
18642
18662
  if (!isReferralEnabled()) {
18643
18663
  return;
18644
18664
  }
@@ -18657,7 +18677,7 @@ __name(ReferralCodeCapture, "ReferralCodeCapture");
18657
18677
 
18658
18678
  // src/features/referral/components/ReferralWidget.tsx
18659
18679
  import { Copy as Copy2, Loader2 as Loader25, Mail, Users } from "lucide-react";
18660
- import { useCallback as useCallback36, useRef as useRef32, useState as useState85 } from "react";
18680
+ import { useCallback as useCallback37, useRef as useRef32, useState as useState85 } from "react";
18661
18681
 
18662
18682
  // src/features/referral/hooks/useReferralInvite.ts
18663
18683
  import { useState as useState83 } from "react";
@@ -18686,12 +18706,12 @@ function useReferralInvite() {
18686
18706
  __name(useReferralInvite, "useReferralInvite");
18687
18707
 
18688
18708
  // src/features/referral/hooks/useReferralStats.ts
18689
- import { useEffect as useEffect63, useState as useState84 } from "react";
18709
+ import { useEffect as useEffect64, useState as useState84 } from "react";
18690
18710
  function useReferralStats() {
18691
18711
  const [stats, setStats] = useState84(null);
18692
18712
  const [loading, setLoading] = useState84(true);
18693
18713
  const [error, setError] = useState84(null);
18694
- useEffect63(() => {
18714
+ useEffect64(() => {
18695
18715
  if (!isReferralEnabled()) {
18696
18716
  setLoading(false);
18697
18717
  return;
@@ -18770,7 +18790,7 @@ function ReferralWidget({
18770
18790
  if (!isReferralEnabled()) {
18771
18791
  return null;
18772
18792
  }
18773
- const handleCopyLink = useCallback36(async () => {
18793
+ const handleCopyLink = useCallback37(async () => {
18774
18794
  if (!referralUrl) return;
18775
18795
  const success = await copyToClipboard(referralUrl);
18776
18796
  if (success) {
@@ -18782,7 +18802,7 @@ function ReferralWidget({
18782
18802
  showError(t.copyError);
18783
18803
  }
18784
18804
  }, [referralUrl, t.copiedMessage, t.copyError, onLinkCopied]);
18785
- const handleSendInvite = useCallback36(async () => {
18805
+ const handleSendInvite = useCallback37(async () => {
18786
18806
  if (!email || !email.includes("@")) {
18787
18807
  showError(t.invalidEmail);
18788
18808
  return;
@@ -18798,7 +18818,7 @@ function ReferralWidget({
18798
18818
  onInviteError?.(error2);
18799
18819
  }
18800
18820
  }, [email, sendInvite, t.inviteSent, t.inviteError, t.invalidEmail, onInviteSent, onInviteError]);
18801
- const handleEmailKeyDown = useCallback36(
18821
+ const handleEmailKeyDown = useCallback37(
18802
18822
  (e) => {
18803
18823
  if (e.key === "Enter" && !sending) {
18804
18824
  e.preventDefault();
@@ -18975,13 +18995,13 @@ __name(FormRoles, "FormRoles");
18975
18995
 
18976
18996
  // src/features/role/components/forms/RemoveUserFromRole.tsx
18977
18997
  import { useTranslations as useTranslations100 } from "next-intl";
18978
- import { useEffect as useEffect64, useState as useState86 } from "react";
18998
+ import { useEffect as useEffect65, useState as useState86 } from "react";
18979
18999
  import { Fragment as Fragment50, jsx as jsx227, jsxs as jsxs142 } from "react/jsx-runtime";
18980
19000
  function RemoveUserFromRole({ role, user, refresh }) {
18981
19001
  const [open, setOpen] = useState86(false);
18982
19002
  const [canRemove, setCanRemove] = useState86(false);
18983
19003
  const t = useTranslations100();
18984
- useEffect64(() => {
19004
+ useEffect65(() => {
18985
19005
  async function checkCompanyAdminDeletability() {
18986
19006
  const roleUsers = await UserService.findAllUsersByRole({
18987
19007
  roleId: role.id
@@ -19051,7 +19071,7 @@ __name(RemoveUserFromRole, "RemoveUserFromRole");
19051
19071
  // src/features/role/components/forms/UserRoleAdd.tsx
19052
19072
  import { PlusCircle as PlusCircle2 } from "lucide-react";
19053
19073
  import { useTranslations as useTranslations101 } from "next-intl";
19054
- import { useCallback as useCallback37, useEffect as useEffect65, useRef as useRef33, useState as useState87 } from "react";
19074
+ import { useCallback as useCallback38, useEffect as useEffect66, useRef as useRef33, useState as useState87 } from "react";
19055
19075
  import { Fragment as Fragment51, jsx as jsx228, jsxs as jsxs143 } from "react/jsx-runtime";
19056
19076
  function UserRoleAdd({ user, refresh }) {
19057
19077
  const [open, setOpen] = useState87(false);
@@ -19081,7 +19101,7 @@ function UserRoleAdd({ user, refresh }) {
19081
19101
  );
19082
19102
  refresh();
19083
19103
  }, "addUserToRole");
19084
- const searchRoles = useCallback37(
19104
+ const searchRoles = useCallback38(
19085
19105
  async (term) => {
19086
19106
  setRoles(
19087
19107
  await RoleService.findAllRolesUserNotIn({
@@ -19093,10 +19113,10 @@ function UserRoleAdd({ user, refresh }) {
19093
19113
  [searchTerm, user]
19094
19114
  );
19095
19115
  const updateSearchTerm = useDebounce2(searchRoles, 500);
19096
- useEffect65(() => {
19116
+ useEffect66(() => {
19097
19117
  if (open) updateSearchTerm(searchTerm);
19098
19118
  }, [open, searchTerm]);
19099
- useEffect65(() => {
19119
+ useEffect66(() => {
19100
19120
  if (open) searchRoles("");
19101
19121
  }, [open]);
19102
19122
  return /* @__PURE__ */ jsxs143(Fragment51, { children: [
@@ -19191,7 +19211,7 @@ function UserRolesList({ user }) {
19191
19211
  __name(UserRolesList, "UserRolesList");
19192
19212
 
19193
19213
  // src/features/oauth/components/OAuthRedirectUriInput.tsx
19194
- import { useCallback as useCallback38 } from "react";
19214
+ import { useCallback as useCallback39 } from "react";
19195
19215
  import { Plus as Plus2, Trash2 as Trash23 } from "lucide-react";
19196
19216
  import { jsx as jsx231, jsxs as jsxs144 } from "react/jsx-runtime";
19197
19217
  function isValidRedirectUri(uri) {
@@ -19221,17 +19241,17 @@ function OAuthRedirectUriInput({
19221
19241
  disabled = false,
19222
19242
  label = "Redirect URIs"
19223
19243
  }) {
19224
- const handleAdd = useCallback38(() => {
19244
+ const handleAdd = useCallback39(() => {
19225
19245
  onChange([...value, ""]);
19226
19246
  }, [value, onChange]);
19227
- const handleRemove = useCallback38(
19247
+ const handleRemove = useCallback39(
19228
19248
  (index) => {
19229
19249
  const newUris = value.filter((_, i) => i !== index);
19230
19250
  onChange(newUris.length > 0 ? newUris : [""]);
19231
19251
  },
19232
19252
  [value, onChange]
19233
19253
  );
19234
- const handleChange = useCallback38(
19254
+ const handleChange = useCallback39(
19235
19255
  (index, newValue) => {
19236
19256
  const newUris = [...value];
19237
19257
  newUris[index] = newValue;
@@ -19285,7 +19305,7 @@ function OAuthRedirectUriInput({
19285
19305
  __name(OAuthRedirectUriInput, "OAuthRedirectUriInput");
19286
19306
 
19287
19307
  // src/features/oauth/components/OAuthScopeSelector.tsx
19288
- import { useCallback as useCallback39 } from "react";
19308
+ import { useCallback as useCallback40 } from "react";
19289
19309
  import { jsx as jsx232, jsxs as jsxs145 } from "react/jsx-runtime";
19290
19310
  function OAuthScopeSelector({
19291
19311
  value,
@@ -19295,7 +19315,7 @@ function OAuthScopeSelector({
19295
19315
  error,
19296
19316
  label = "Allowed Scopes"
19297
19317
  }) {
19298
- const handleToggle = useCallback39(
19318
+ const handleToggle = useCallback40(
19299
19319
  (scope, checked) => {
19300
19320
  if (checked) {
19301
19321
  onChange([...value, scope]);
@@ -19363,12 +19383,12 @@ function OAuthScopeSelector({
19363
19383
  __name(OAuthScopeSelector, "OAuthScopeSelector");
19364
19384
 
19365
19385
  // src/features/oauth/components/OAuthClientSecretDisplay.tsx
19366
- import { useState as useState88, useCallback as useCallback40 } from "react";
19386
+ import { useState as useState88, useCallback as useCallback41 } from "react";
19367
19387
  import { Copy as Copy3, Check, AlertTriangle } from "lucide-react";
19368
19388
  import { jsx as jsx233, jsxs as jsxs146 } from "react/jsx-runtime";
19369
19389
  function OAuthClientSecretDisplay({ secret, onDismiss, open, clientName }) {
19370
19390
  const [copied, setCopied] = useState88(false);
19371
- const handleCopy = useCallback40(async () => {
19391
+ const handleCopy = useCallback41(async () => {
19372
19392
  try {
19373
19393
  await navigator.clipboard.writeText(secret);
19374
19394
  setCopied(true);
@@ -19377,7 +19397,7 @@ function OAuthClientSecretDisplay({ secret, onDismiss, open, clientName }) {
19377
19397
  console.error("Failed to copy to clipboard:", err);
19378
19398
  }
19379
19399
  }, [secret]);
19380
- const handleDismiss = useCallback40(() => {
19400
+ const handleDismiss = useCallback41(() => {
19381
19401
  setCopied(false);
19382
19402
  onDismiss();
19383
19403
  }, [onDismiss]);
@@ -19560,7 +19580,7 @@ function OAuthClientList({
19560
19580
  __name(OAuthClientList, "OAuthClientList");
19561
19581
 
19562
19582
  // src/features/oauth/components/OAuthClientForm.tsx
19563
- import { useState as useState89, useCallback as useCallback41 } from "react";
19583
+ import { useState as useState89, useCallback as useCallback42 } from "react";
19564
19584
  import { jsx as jsx236, jsxs as jsxs149 } from "react/jsx-runtime";
19565
19585
  function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
19566
19586
  const isEditMode = !!client;
@@ -19572,7 +19592,7 @@ function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
19572
19592
  isConfidential: client?.isConfidential ?? true
19573
19593
  });
19574
19594
  const [errors, setErrors] = useState89({});
19575
- const validate = useCallback41(() => {
19595
+ const validate = useCallback42(() => {
19576
19596
  const newErrors = {};
19577
19597
  if (!formState.name.trim()) {
19578
19598
  newErrors.name = "Application name is required";
@@ -19587,7 +19607,7 @@ function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
19587
19607
  setErrors(newErrors);
19588
19608
  return Object.keys(newErrors).length === 0;
19589
19609
  }, [formState]);
19590
- const handleSubmit = useCallback41(
19610
+ const handleSubmit = useCallback42(
19591
19611
  async (e) => {
19592
19612
  e.preventDefault();
19593
19613
  if (!validate()) return;
@@ -19694,7 +19714,7 @@ function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
19694
19714
  __name(OAuthClientForm, "OAuthClientForm");
19695
19715
 
19696
19716
  // src/features/oauth/components/OAuthClientDetail.tsx
19697
- import { useState as useState90, useCallback as useCallback42 } from "react";
19717
+ import { useState as useState90, useCallback as useCallback43 } from "react";
19698
19718
  import { format as format2 } from "date-fns";
19699
19719
  import { Copy as Copy4, Check as Check2, RefreshCw as RefreshCw3, Pencil as Pencil2, Trash2 as Trash25, ExternalLink } from "lucide-react";
19700
19720
  import { Fragment as Fragment52, jsx as jsx237, jsxs as jsxs150 } from "react/jsx-runtime";
@@ -19710,7 +19730,7 @@ function OAuthClientDetail({
19710
19730
  const [showRegenerateConfirm, setShowRegenerateConfirm] = useState90(false);
19711
19731
  const [isDeleting, setIsDeleting] = useState90(false);
19712
19732
  const [isRegenerating, setIsRegenerating] = useState90(false);
19713
- const copyToClipboard2 = useCallback42(async (text, field) => {
19733
+ const copyToClipboard2 = useCallback43(async (text, field) => {
19714
19734
  try {
19715
19735
  await navigator.clipboard.writeText(text);
19716
19736
  setCopiedField(field);
@@ -19719,7 +19739,7 @@ function OAuthClientDetail({
19719
19739
  console.error("Failed to copy:", err);
19720
19740
  }
19721
19741
  }, []);
19722
- const handleDelete = useCallback42(async () => {
19742
+ const handleDelete = useCallback43(async () => {
19723
19743
  if (!onDelete) return;
19724
19744
  setIsDeleting(true);
19725
19745
  try {
@@ -19729,7 +19749,7 @@ function OAuthClientDetail({
19729
19749
  setShowDeleteConfirm(false);
19730
19750
  }
19731
19751
  }, [onDelete]);
19732
- const handleRegenerateSecret = useCallback42(async () => {
19752
+ const handleRegenerateSecret = useCallback43(async () => {
19733
19753
  if (!onRegenerateSecret) return;
19734
19754
  setIsRegenerating(true);
19735
19755
  try {
@@ -20259,13 +20279,13 @@ __name(WaitlistSuccessState, "WaitlistSuccessState");
20259
20279
  // src/features/waitlist/components/sections/WaitlistConfirmation.tsx
20260
20280
  import { CheckCircle as CheckCircle4, Loader2 as Loader27, XCircle as XCircle2 } from "lucide-react";
20261
20281
  import { useTranslations as useTranslations106 } from "next-intl";
20262
- import { useEffect as useEffect66, useState as useState92 } from "react";
20282
+ import { useEffect as useEffect67, useState as useState92 } from "react";
20263
20283
  import { jsx as jsx246, jsxs as jsxs159 } from "react/jsx-runtime";
20264
20284
  function WaitlistConfirmation({ code }) {
20265
20285
  const t = useTranslations106();
20266
20286
  const [state, setState] = useState92("loading");
20267
20287
  const [errorMessage, setErrorMessage] = useState92("");
20268
- useEffect66(() => {
20288
+ useEffect67(() => {
20269
20289
  async function confirmEmail() {
20270
20290
  try {
20271
20291
  await WaitlistService.confirm(code);
@@ -20305,7 +20325,7 @@ __name(WaitlistConfirmation, "WaitlistConfirmation");
20305
20325
  import { flexRender as flexRender2, getCoreRowModel as getCoreRowModel2, useReactTable as useReactTable2 } from "@tanstack/react-table";
20306
20326
  import { RefreshCw as RefreshCw4, Users as Users2 } from "lucide-react";
20307
20327
  import { useTranslations as useTranslations108 } from "next-intl";
20308
- import { useCallback as useCallback43, useEffect as useEffect67, useState as useState93 } from "react";
20328
+ import { useCallback as useCallback44, useEffect as useEffect68, useState as useState93 } from "react";
20309
20329
 
20310
20330
  // src/features/waitlist/hooks/useWaitlistTableStructure.tsx
20311
20331
  import { Send } from "lucide-react";
@@ -20406,7 +20426,7 @@ function WaitlistList() {
20406
20426
  const [total, setTotal] = useState93(0);
20407
20427
  const [isLoading, setIsLoading] = useState93(true);
20408
20428
  const [statusFilter, setStatusFilter] = useState93("all");
20409
- const loadEntries = useCallback43(async () => {
20429
+ const loadEntries = useCallback44(async () => {
20410
20430
  setIsLoading(true);
20411
20431
  try {
20412
20432
  const result = await WaitlistService.findMany({
@@ -20421,7 +20441,7 @@ function WaitlistList() {
20421
20441
  setIsLoading(false);
20422
20442
  }
20423
20443
  }, [statusFilter]);
20424
- useEffect67(() => {
20444
+ useEffect68(() => {
20425
20445
  loadEntries();
20426
20446
  }, [loadEntries]);
20427
20447
  const handleInvite = /* @__PURE__ */ __name(async (entry) => {
@@ -20475,7 +20495,7 @@ __name(WaitlistList, "WaitlistList");
20475
20495
  // src/features/rbac/components/RbacContainer.tsx
20476
20496
  import { Loader2Icon as Loader2Icon3 } from "lucide-react";
20477
20497
  import { useTranslations as useTranslations110 } from "next-intl";
20478
- import { memo as memo2, useCallback as useCallback45, useEffect as useEffect69, useMemo as useMemo33, useRef as useRef34, useState as useState95 } from "react";
20498
+ import { memo as memo2, useCallback as useCallback46, useEffect as useEffect70, useMemo as useMemo33, useRef as useRef34, useState as useState95 } from "react";
20479
20499
 
20480
20500
  // src/features/rbac/components/RbacPermissionCell.tsx
20481
20501
  import { CheckIcon as CheckIcon9, MinusIcon as MinusIcon2, XIcon as XIcon11 } from "lucide-react";
@@ -20556,7 +20576,7 @@ __name(RbacPermissionCell, "RbacPermissionCell");
20556
20576
  import { Popover as PopoverPrimitive2 } from "@base-ui/react/popover";
20557
20577
  import { CheckIcon as CheckIcon10, MinusIcon as MinusIcon3, XIcon as XIcon12 } from "lucide-react";
20558
20578
  import { useTranslations as useTranslations109 } from "next-intl";
20559
- import { useCallback as useCallback44, useEffect as useEffect68, useState as useState94 } from "react";
20579
+ import { useCallback as useCallback45, useEffect as useEffect69, useState as useState94 } from "react";
20560
20580
  import { Fragment as Fragment54, jsx as jsx250, jsxs as jsxs163 } from "react/jsx-runtime";
20561
20581
  function RbacPermissionPicker({
20562
20582
  open,
@@ -20570,11 +20590,11 @@ function RbacPermissionPicker({
20570
20590
  }) {
20571
20591
  const t = useTranslations109();
20572
20592
  const [customSegment, setCustomSegment] = useState94("");
20573
- useEffect68(() => {
20593
+ useEffect69(() => {
20574
20594
  if (!open) setCustomSegment("");
20575
20595
  }, [open]);
20576
20596
  const currentSegments = typeof value === "string" ? value.split("|").filter(Boolean) : [];
20577
- const toggleSegment = useCallback44(
20597
+ const toggleSegment = useCallback45(
20578
20598
  (segment) => {
20579
20599
  const next = currentSegments.includes(segment) ? currentSegments.filter((s) => s !== segment) : [...currentSegments, segment];
20580
20600
  if (next.length === 0) onSetValue(false);
@@ -20582,7 +20602,7 @@ function RbacPermissionPicker({
20582
20602
  },
20583
20603
  [currentSegments, onSetValue]
20584
20604
  );
20585
- const addCustomSegment = useCallback44(() => {
20605
+ const addCustomSegment = useCallback45(() => {
20586
20606
  const segment = customSegment.trim();
20587
20607
  if (!segment) return;
20588
20608
  if (!currentSegments.includes(segment)) {
@@ -20746,7 +20766,7 @@ var CellButton = memo2(/* @__PURE__ */ __name(function CellButton2({
20746
20766
  }) {
20747
20767
  const ref = useRef34(null);
20748
20768
  const value = cellValue(tokens, action);
20749
- const handleClick = useCallback45(() => {
20769
+ const handleClick = useCallback46(() => {
20750
20770
  if (!ref.current) return;
20751
20771
  onOpen({ moduleId, rowKey, action, isRoleColumn, anchor: ref.current });
20752
20772
  }, [onOpen, moduleId, rowKey, action, isRoleColumn]);
@@ -20820,13 +20840,13 @@ function RbacContainer() {
20820
20840
  const { matrix, modulePaths, loading, error, roleNames, moduleNames, updateCell, clearCell } = useRbacContext();
20821
20841
  const [selectedModuleId, setSelectedModuleId] = useState95(null);
20822
20842
  const [activePicker, setActivePicker] = useState95(null);
20823
- const openPicker = useCallback45((picker) => {
20843
+ const openPicker = useCallback46((picker) => {
20824
20844
  setActivePicker(picker);
20825
20845
  }, []);
20826
- const closePicker = useCallback45(() => {
20846
+ const closePicker = useCallback46(() => {
20827
20847
  setActivePicker(null);
20828
20848
  }, []);
20829
- const handleSelectModule = useCallback45((id) => {
20849
+ const handleSelectModule = useCallback46((id) => {
20830
20850
  setSelectedModuleId(id);
20831
20851
  setActivePicker(null);
20832
20852
  }, []);
@@ -20847,7 +20867,7 @@ function RbacContainer() {
20847
20867
  }
20848
20868
  return Array.from(set).sort();
20849
20869
  }, [matrix, roleNames]);
20850
- useEffect69(() => {
20870
+ useEffect70(() => {
20851
20871
  if (!selectedModuleId && sortedModuleIds.length > 0) {
20852
20872
  setSelectedModuleId(sortedModuleIds[0]);
20853
20873
  }
@@ -20863,14 +20883,14 @@ function RbacContainer() {
20863
20883
  if (!activePicker) return [];
20864
20884
  return modulePaths[activePicker.moduleId] ?? [];
20865
20885
  }, [activePicker, modulePaths]);
20866
- const handleSetValue = useCallback45(
20886
+ const handleSetValue = useCallback46(
20867
20887
  (value) => {
20868
20888
  if (!activePicker) return;
20869
20889
  updateCell(activePicker.moduleId, activePicker.rowKey, activePicker.action, value);
20870
20890
  },
20871
20891
  [activePicker, updateCell]
20872
20892
  );
20873
- const handleClear = useCallback45(() => {
20893
+ const handleClear = useCallback46(() => {
20874
20894
  if (!activePicker || !activePicker.isRoleColumn) return;
20875
20895
  clearCell(activePicker.moduleId, activePicker.rowKey, activePicker.action);
20876
20896
  }, [activePicker, clearCell]);
@@ -20930,7 +20950,7 @@ __name(RbacContainer, "RbacContainer");
20930
20950
  // src/features/rbac/components/RbacByRoleContainer.tsx
20931
20951
  import { Loader2Icon as Loader2Icon4 } from "lucide-react";
20932
20952
  import { useTranslations as useTranslations111 } from "next-intl";
20933
- import { Fragment as Fragment55, memo as memo3, useCallback as useCallback46, useEffect as useEffect70, useMemo as useMemo34, useRef as useRef35, useState as useState96 } from "react";
20953
+ import { Fragment as Fragment55, memo as memo3, useCallback as useCallback47, useEffect as useEffect71, useMemo as useMemo34, useRef as useRef35, useState as useState96 } from "react";
20934
20954
  import { jsx as jsx252, jsxs as jsxs165 } from "react/jsx-runtime";
20935
20955
  function findToken2(tokens, action) {
20936
20956
  if (!tokens) return void 0;
@@ -20953,7 +20973,7 @@ var CellButton3 = memo3(/* @__PURE__ */ __name(function CellButton4({
20953
20973
  }) {
20954
20974
  const ref = useRef35(null);
20955
20975
  const value = cellValue2(tokens, action);
20956
- const handleClick = useCallback46(() => {
20976
+ const handleClick = useCallback47(() => {
20957
20977
  if (!ref.current) return;
20958
20978
  onOpen({ moduleId, rowKey, action, isRoleColumn, anchor: ref.current });
20959
20979
  }, [onOpen, moduleId, rowKey, action, isRoleColumn]);
@@ -20970,13 +20990,13 @@ function RbacByRoleContainer() {
20970
20990
  const { matrix, modulePaths, loading, error, roleNames, moduleNames, updateCell, clearCell } = useRbacContext();
20971
20991
  const [selectedRoleId, setSelectedRoleId] = useState96(null);
20972
20992
  const [activePicker, setActivePicker] = useState96(null);
20973
- const openPicker = useCallback46((picker) => {
20993
+ const openPicker = useCallback47((picker) => {
20974
20994
  setActivePicker(picker);
20975
20995
  }, []);
20976
- const closePicker = useCallback46(() => {
20996
+ const closePicker = useCallback47(() => {
20977
20997
  setActivePicker(null);
20978
20998
  }, []);
20979
- const handleSelectRole = useCallback46((id) => {
20999
+ const handleSelectRole = useCallback47((id) => {
20980
21000
  setSelectedRoleId(id);
20981
21001
  setActivePicker(null);
20982
21002
  }, []);
@@ -20988,7 +21008,7 @@ function RbacByRoleContainer() {
20988
21008
  if (!matrix) return [];
20989
21009
  return Object.keys(matrix).sort((a, b) => (moduleNames?.[a] ?? a).localeCompare(moduleNames?.[b] ?? b));
20990
21010
  }, [matrix, moduleNames]);
20991
- useEffect70(() => {
21011
+ useEffect71(() => {
20992
21012
  if (!selectedRoleId && sortedRoleIds.length > 0) {
20993
21013
  setSelectedRoleId(sortedRoleIds[0]);
20994
21014
  }
@@ -21004,14 +21024,14 @@ function RbacByRoleContainer() {
21004
21024
  if (!activePicker) return [];
21005
21025
  return modulePaths[activePicker.moduleId] ?? [];
21006
21026
  }, [activePicker, modulePaths]);
21007
- const handleSetValue = useCallback46(
21027
+ const handleSetValue = useCallback47(
21008
21028
  (value) => {
21009
21029
  if (!activePicker) return;
21010
21030
  updateCell(activePicker.moduleId, activePicker.rowKey, activePicker.action, value);
21011
21031
  },
21012
21032
  [activePicker, updateCell]
21013
21033
  );
21014
- const handleClear = useCallback46(() => {
21034
+ const handleClear = useCallback47(() => {
21015
21035
  if (!activePicker || !activePicker.isRoleColumn) return;
21016
21036
  clearCell(activePicker.moduleId, activePicker.rowKey, activePicker.action);
21017
21037
  }, [activePicker, clearCell]);
@@ -21611,4 +21631,4 @@ export {
21611
21631
  useOAuthClients,
21612
21632
  useOAuthClient
21613
21633
  };
21614
- //# sourceMappingURL=chunk-M4KMRVEE.mjs.map
21634
+ //# sourceMappingURL=chunk-TTVVHFS4.mjs.map