@carlonicora/nextjs-jsonapi 1.82.0 → 1.84.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.
@@ -9200,7 +9200,7 @@ __name(FormCheckbox, "FormCheckbox");
9200
9200
  import dynamic from "next/dynamic";
9201
9201
  import React14 from "react";
9202
9202
  import { jsx as jsx73 } from "react/jsx-runtime";
9203
- var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-N2L7X6OY.mjs"), {
9203
+ var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-ZNACEXKX.mjs"), {
9204
9204
  ssr: false
9205
9205
  });
9206
9206
  var BlockNoteEditorContainer = React14.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
@@ -13329,8 +13329,10 @@ __name(RoundPageContainerTitle, "RoundPageContainerTitle");
13329
13329
 
13330
13330
  // src/components/containers/RoundPageContainer.tsx
13331
13331
  import { useSearchParams } from "next/navigation";
13332
- import { useState as useState46 } from "react";
13332
+ import { useCallback as useCallback25, useEffect as useEffect38, useState as useState46 } from "react";
13333
13333
  import { Fragment as Fragment22, jsx as jsx147, jsxs as jsxs87 } from "react/jsx-runtime";
13334
+ var DETAILS_COOKIE_NAME = "round_page_details_state";
13335
+ var DETAILS_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
13334
13336
  function RoundPageContainer({
13335
13337
  module,
13336
13338
  id,
@@ -13342,7 +13344,15 @@ function RoundPageContainer({
13342
13344
  }) {
13343
13345
  const headerChildren = useHeaderChildren();
13344
13346
  const headerLeftContent = useHeaderLeftContent();
13345
- const [showDetails, setShowDetails] = useState46(false);
13347
+ const [showDetails, setShowDetailsState] = useState46(false);
13348
+ useEffect38(() => {
13349
+ const match = document.cookie.split("; ").find((row) => row.startsWith(`${DETAILS_COOKIE_NAME}=`));
13350
+ if (match?.split("=")[1] === "true") setShowDetailsState(true);
13351
+ }, []);
13352
+ const setShowDetails = useCallback25((value) => {
13353
+ setShowDetailsState(value);
13354
+ document.cookie = `${DETAILS_COOKIE_NAME}=${value}; path=/; max-age=${DETAILS_COOKIE_MAX_AGE}`;
13355
+ }, []);
13346
13356
  const searchParams = useSearchParams();
13347
13357
  const section = searchParams.get("section");
13348
13358
  const rewriteUrl = useUrlRewriter();
@@ -13362,21 +13372,25 @@ function RoundPageContainer({
13362
13372
  }
13363
13373
  ),
13364
13374
  /* @__PURE__ */ jsxs87("div", { className: "flex h-full w-full overflow-hidden", children: [
13365
- /* @__PURE__ */ jsx147("div", { className: cn(`grow overflow-y-auto p-4`, fullWidth && `p-0`), children: /* @__PURE__ */ jsx147("div", { className: cn(`mx-auto max-w-6xl space-y-8`, fullWidth && `max-w-full w-full p-0 h-full`), children: tabs ? /* @__PURE__ */ jsxs87(
13366
- Tabs,
13367
- {
13368
- value: activeTab,
13369
- className: "w-full",
13370
- onValueChange: (key) => {
13371
- setActiveTab(key);
13372
- if (module && id) rewriteUrl({ page: module, id, additionalParameters: { section: key } });
13373
- },
13374
- children: [
13375
- /* @__PURE__ */ jsx147("div", { className: "p-4", children: /* @__PURE__ */ jsx147(TabsList, { className: ``, children: tabs.map((tab) => /* @__PURE__ */ jsx147(TabsTrigger, { value: tab.key?.name ?? tab.label, className: `px-4`, children: tab.contentLabel ?? tab.label }, tab.label)) }) }),
13376
- /* @__PURE__ */ jsx147("div", { className: "flex w-full overflow-y-auto px-4", children: tabs.map((tab) => /* @__PURE__ */ jsx147(TabsContent, { value: tab.key?.name ?? tab.label, className: `pb-20`, children: tab.content }, tab.label)) })
13377
- ]
13378
- }
13379
- ) : children }) }),
13375
+ /* @__PURE__ */ jsx147("div", { className: cn(`grow overflow-y-auto p-4`, fullWidth && `p-0`), children: /* @__PURE__ */ jsx147("div", { className: cn(`mx-auto max-w-6xl space-y-8`, fullWidth && `max-w-full w-full p-0 h-full`), children: tabs ? /* @__PURE__ */ jsxs87(Fragment22, { children: [
13376
+ /* @__PURE__ */ jsxs87(
13377
+ Tabs,
13378
+ {
13379
+ value: activeTab,
13380
+ className: "w-full",
13381
+ onValueChange: (key) => {
13382
+ setActiveTab(key);
13383
+ if (module && id)
13384
+ rewriteUrl({ page: module, id, additionalParameters: { section: key } });
13385
+ },
13386
+ children: [
13387
+ /* @__PURE__ */ jsx147("div", { className: "p-4", children: /* @__PURE__ */ jsx147(TabsList, { className: ``, children: tabs.map((tab) => /* @__PURE__ */ jsx147(TabsTrigger, { value: tab.key?.name ?? tab.label, className: `px-4`, children: tab.contentLabel ?? tab.label }, tab.label)) }) }),
13388
+ /* @__PURE__ */ jsx147("div", { className: "flex w-full overflow-y-auto px-4", children: tabs.map((tab) => /* @__PURE__ */ jsx147(TabsContent, { value: tab.key?.name ?? tab.label, className: `pb-20`, children: tab.content }, tab.label)) })
13389
+ ]
13390
+ }
13391
+ ),
13392
+ children && /* @__PURE__ */ jsx147("div", { className: "flex px-4", children })
13393
+ ] }) : children }) }),
13380
13394
  details && /* @__PURE__ */ jsx147(
13381
13395
  "div",
13382
13396
  {
@@ -13456,13 +13470,13 @@ function AllowedUsersDetails({ showTitle, content }) {
13456
13470
  __name(AllowedUsersDetails, "AllowedUsersDetails");
13457
13471
 
13458
13472
  // src/components/pages/PageContainerContentDetails.tsx
13459
- import { useEffect as useEffect38, useRef as useRef22, useState as useState47 } from "react";
13473
+ import { useEffect as useEffect39, useRef as useRef22, useState as useState47 } from "react";
13460
13474
  import { jsx as jsx150, jsxs as jsxs90 } from "react/jsx-runtime";
13461
13475
  function PageContainerContentDetails({ items, section, module, id }) {
13462
13476
  const rewriteUrl = useUrlRewriter();
13463
13477
  const [isScrolled, setIsScrolled] = useState47(false);
13464
13478
  const sentinelRef = useRef22(null);
13465
- useEffect38(() => {
13479
+ useEffect39(() => {
13466
13480
  const sentinel = sentinelRef.current;
13467
13481
  if (!sentinel) return;
13468
13482
  const observer = new IntersectionObserver(
@@ -13495,13 +13509,13 @@ function PageContainerContentDetails({ items, section, module, id }) {
13495
13509
  __name(PageContainerContentDetails, "PageContainerContentDetails");
13496
13510
 
13497
13511
  // src/components/pages/PageContentContainer.tsx
13498
- import { useEffect as useEffect39, useState as useState48 } from "react";
13512
+ import { useEffect as useEffect40, useState as useState48 } from "react";
13499
13513
  import { useDefaultLayout } from "react-resizable-panels";
13500
13514
  import { jsx as jsx151, jsxs as jsxs91 } from "react/jsx-runtime";
13501
13515
  function PageContentContainer({ header, details, footer, content, fullBleed }) {
13502
13516
  const [mounted, setMounted] = useState48(false);
13503
13517
  const isMobile = useIsMobile();
13504
- useEffect39(() => {
13518
+ useEffect40(() => {
13505
13519
  setMounted(true);
13506
13520
  }, []);
13507
13521
  const isReady = mounted && isMobile !== void 0;
@@ -13637,10 +13651,10 @@ var cellUrl = /* @__PURE__ */ __name((params) => {
13637
13651
  }, "cellUrl");
13638
13652
 
13639
13653
  // src/client/context/JsonApiProvider.tsx
13640
- import { useEffect as useEffect40, useMemo as useMemo19 } from "react";
13654
+ import { useEffect as useEffect41, useMemo as useMemo19 } from "react";
13641
13655
  import { jsx as jsx156 } from "react/jsx-runtime";
13642
13656
  function JsonApiProvider({ config, children }) {
13643
- useEffect40(() => {
13657
+ useEffect41(() => {
13644
13658
  if (config.bootstrapper) {
13645
13659
  config.bootstrapper();
13646
13660
  }
@@ -13651,14 +13665,14 @@ function JsonApiProvider({ config, children }) {
13651
13665
  __name(JsonApiProvider, "JsonApiProvider");
13652
13666
 
13653
13667
  // src/client/hooks/useJsonApiGet.ts
13654
- import { useState as useState49, useEffect as useEffect41, useCallback as useCallback25, useRef as useRef23 } from "react";
13668
+ import { useState as useState49, useEffect as useEffect42, useCallback as useCallback26, useRef as useRef23 } from "react";
13655
13669
  function useJsonApiGet(params) {
13656
13670
  const [data, setData] = useState49(null);
13657
13671
  const [loading, setLoading] = useState49(false);
13658
13672
  const [error, setError] = useState49(null);
13659
13673
  const [response, setResponse] = useState49(null);
13660
13674
  const isMounted = useRef23(true);
13661
- const fetchData = useCallback25(async () => {
13675
+ const fetchData = useCallback26(async () => {
13662
13676
  if (params.options?.enabled === false) return;
13663
13677
  setLoading(true);
13664
13678
  setError(null);
@@ -13687,7 +13701,7 @@ function useJsonApiGet(params) {
13687
13701
  }
13688
13702
  }
13689
13703
  }, [params.classKey, params.endpoint, params.companyId, params.options?.enabled]);
13690
- const fetchNextPage = useCallback25(async () => {
13704
+ const fetchNextPage = useCallback26(async () => {
13691
13705
  if (!response?.nextPage) return;
13692
13706
  setLoading(true);
13693
13707
  try {
@@ -13708,7 +13722,7 @@ function useJsonApiGet(params) {
13708
13722
  }
13709
13723
  }
13710
13724
  }, [response]);
13711
- const fetchPreviousPage = useCallback25(async () => {
13725
+ const fetchPreviousPage = useCallback26(async () => {
13712
13726
  if (!response?.prevPage) return;
13713
13727
  setLoading(true);
13714
13728
  try {
@@ -13729,7 +13743,7 @@ function useJsonApiGet(params) {
13729
13743
  }
13730
13744
  }
13731
13745
  }, [response]);
13732
- useEffect41(() => {
13746
+ useEffect42(() => {
13733
13747
  isMounted.current = true;
13734
13748
  fetchData();
13735
13749
  return () => {
@@ -13751,19 +13765,19 @@ function useJsonApiGet(params) {
13751
13765
  __name(useJsonApiGet, "useJsonApiGet");
13752
13766
 
13753
13767
  // src/client/hooks/useJsonApiMutation.ts
13754
- import { useState as useState50, useCallback as useCallback26 } from "react";
13768
+ import { useState as useState50, useCallback as useCallback27 } from "react";
13755
13769
  function useJsonApiMutation(config) {
13756
13770
  const [data, setData] = useState50(null);
13757
13771
  const [loading, setLoading] = useState50(false);
13758
13772
  const [error, setError] = useState50(null);
13759
13773
  const [response, setResponse] = useState50(null);
13760
- const reset = useCallback26(() => {
13774
+ const reset = useCallback27(() => {
13761
13775
  setData(null);
13762
13776
  setLoading(false);
13763
13777
  setError(null);
13764
13778
  setResponse(null);
13765
13779
  }, []);
13766
- const mutate = useCallback26(
13780
+ const mutate = useCallback27(
13767
13781
  async (params) => {
13768
13782
  setLoading(true);
13769
13783
  setError(null);
@@ -14160,7 +14174,7 @@ var useContentTableStructure = /* @__PURE__ */ __name((params) => {
14160
14174
 
14161
14175
  // src/features/oauth/hooks/useOAuthClients.ts
14162
14176
  import { useAtom as useAtom3, useSetAtom } from "jotai";
14163
- import { useCallback as useCallback27, useEffect as useEffect42 } from "react";
14177
+ import { useCallback as useCallback28, useEffect as useEffect43 } from "react";
14164
14178
 
14165
14179
  // src/features/oauth/atoms/oauth.atoms.ts
14166
14180
  import { atom } from "jotai";
@@ -14222,7 +14236,7 @@ function useOAuthClients() {
14222
14236
  const [error, setError] = useAtom3(oauthClientsErrorAtom);
14223
14237
  const addClient = useSetAtom(addOAuthClientAtom);
14224
14238
  const setNewClientSecret = useSetAtom(setNewClientSecretAtom);
14225
- const fetchClients = useCallback27(async () => {
14239
+ const fetchClients = useCallback28(async () => {
14226
14240
  setIsLoading(true);
14227
14241
  setError(null);
14228
14242
  try {
@@ -14235,10 +14249,10 @@ function useOAuthClients() {
14235
14249
  setIsLoading(false);
14236
14250
  }
14237
14251
  }, [setClients, setIsLoading, setError]);
14238
- useEffect42(() => {
14252
+ useEffect43(() => {
14239
14253
  fetchClients();
14240
14254
  }, [fetchClients]);
14241
- const createClient = useCallback27(
14255
+ const createClient = useCallback28(
14242
14256
  async (data) => {
14243
14257
  setIsLoading(true);
14244
14258
  setError(null);
@@ -14275,7 +14289,7 @@ __name(useOAuthClients, "useOAuthClients");
14275
14289
 
14276
14290
  // src/features/oauth/hooks/useOAuthClient.ts
14277
14291
  import { useAtomValue as useAtomValue2, useSetAtom as useSetAtom2 } from "jotai";
14278
- import { useCallback as useCallback28, useEffect as useEffect43, useState as useState51 } from "react";
14292
+ import { useCallback as useCallback29, useEffect as useEffect44, useState as useState51 } from "react";
14279
14293
  function useOAuthClient(clientId) {
14280
14294
  const storedClient = useAtomValue2(oauthClientByIdAtom(clientId));
14281
14295
  const updateClientInStore = useSetAtom2(updateOAuthClientAtom);
@@ -14285,7 +14299,7 @@ function useOAuthClient(clientId) {
14285
14299
  const [isLoading, setIsLoading] = useState51(false);
14286
14300
  const [error, setError] = useState51(null);
14287
14301
  const client = storedClient || fetchedClient;
14288
- const fetchClient = useCallback28(async () => {
14302
+ const fetchClient = useCallback29(async () => {
14289
14303
  if (!clientId) return;
14290
14304
  setIsLoading(true);
14291
14305
  setError(null);
@@ -14299,12 +14313,12 @@ function useOAuthClient(clientId) {
14299
14313
  setIsLoading(false);
14300
14314
  }
14301
14315
  }, [clientId]);
14302
- useEffect43(() => {
14316
+ useEffect44(() => {
14303
14317
  if (!storedClient && clientId) {
14304
14318
  fetchClient();
14305
14319
  }
14306
14320
  }, [storedClient, clientId, fetchClient]);
14307
- const update = useCallback28(
14321
+ const update = useCallback29(
14308
14322
  async (data) => {
14309
14323
  if (!clientId) throw new Error("No client ID");
14310
14324
  setIsLoading(true);
@@ -14324,7 +14338,7 @@ function useOAuthClient(clientId) {
14324
14338
  },
14325
14339
  [clientId, updateClientInStore]
14326
14340
  );
14327
- const deleteClient = useCallback28(async () => {
14341
+ const deleteClient = useCallback29(async () => {
14328
14342
  if (!clientId) throw new Error("No client ID");
14329
14343
  setIsLoading(true);
14330
14344
  setError(null);
@@ -14340,7 +14354,7 @@ function useOAuthClient(clientId) {
14340
14354
  setIsLoading(false);
14341
14355
  }
14342
14356
  }, [clientId, removeClientFromStore]);
14343
- const regenerateSecret = useCallback28(async () => {
14357
+ const regenerateSecret = useCallback29(async () => {
14344
14358
  if (!clientId) throw new Error("No client ID");
14345
14359
  setIsLoading(true);
14346
14360
  setError(null);
@@ -14373,13 +14387,13 @@ function useOAuthClient(clientId) {
14373
14387
  __name(useOAuthClient, "useOAuthClient");
14374
14388
 
14375
14389
  // src/features/oauth/hooks/useOAuthConsent.ts
14376
- import { useCallback as useCallback29, useEffect as useEffect44, useState as useState52 } from "react";
14390
+ import { useCallback as useCallback30, useEffect as useEffect45, useState as useState52 } from "react";
14377
14391
  function useOAuthConsent(params) {
14378
14392
  const [clientInfo, setClientInfo] = useState52(null);
14379
14393
  const [isLoading, setIsLoading] = useState52(true);
14380
14394
  const [error, setError] = useState52(null);
14381
14395
  const [isSubmitting, setIsSubmitting] = useState52(false);
14382
- useEffect44(() => {
14396
+ useEffect45(() => {
14383
14397
  const fetchInfo = /* @__PURE__ */ __name(async () => {
14384
14398
  if (!params.clientId || !params.redirectUri || !params.scope) {
14385
14399
  setError(new Error("Missing required authorization parameters"));
@@ -14407,7 +14421,7 @@ function useOAuthConsent(params) {
14407
14421
  params.codeChallenge,
14408
14422
  params.codeChallengeMethod
14409
14423
  ]);
14410
- const approve = useCallback29(async () => {
14424
+ const approve = useCallback30(async () => {
14411
14425
  setIsSubmitting(true);
14412
14426
  setError(null);
14413
14427
  try {
@@ -14421,7 +14435,7 @@ function useOAuthConsent(params) {
14421
14435
  setIsSubmitting(false);
14422
14436
  }
14423
14437
  }, [params]);
14424
- const deny = useCallback29(async () => {
14438
+ const deny = useCallback30(async () => {
14425
14439
  setIsSubmitting(true);
14426
14440
  setError(null);
14427
14441
  try {
@@ -14459,7 +14473,7 @@ import { memo, useMemo as useMemo25, useState as useState54 } from "react";
14459
14473
  // src/components/tables/ContentTableSearch.tsx
14460
14474
  import { RefreshCw, Search, X as X3 } from "lucide-react";
14461
14475
  import { useTranslations as useTranslations55 } from "next-intl";
14462
- import { useCallback as useCallback30, useEffect as useEffect45, useRef as useRef24, useState as useState53 } from "react";
14476
+ import { useCallback as useCallback31, useEffect as useEffect46, useRef as useRef24, useState as useState53 } from "react";
14463
14477
  import { jsx as jsx160, jsxs as jsxs93 } from "react/jsx-runtime";
14464
14478
  function ContentTableSearch({ data }) {
14465
14479
  const t = useTranslations55();
@@ -14469,7 +14483,7 @@ function ContentTableSearch({ data }) {
14469
14483
  const [isFocused, setIsFocused] = useState53(false);
14470
14484
  const [isSearching, setIsSearching] = useState53(false);
14471
14485
  const isExpanded = isFocused || searchTerm.length > 0;
14472
- const search = useCallback30(
14486
+ const search = useCallback31(
14473
14487
  async (searchedTerm) => {
14474
14488
  try {
14475
14489
  if (searchedTerm === searchTermRef.current) return;
@@ -14482,7 +14496,7 @@ function ContentTableSearch({ data }) {
14482
14496
  [searchTermRef, data]
14483
14497
  );
14484
14498
  const updateSearchTerm = useDebounce2(search, 500);
14485
- useEffect45(() => {
14499
+ useEffect46(() => {
14486
14500
  setIsSearching(true);
14487
14501
  updateSearchTerm(searchTerm);
14488
14502
  }, [updateSearchTerm, searchTerm]);
@@ -14664,13 +14678,13 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
14664
14678
  }, "ContentListTable"));
14665
14679
 
14666
14680
  // src/components/grids/ContentListGrid.tsx
14667
- import { useEffect as useEffect46, useRef as useRef25 } from "react";
14681
+ import { useEffect as useEffect47, useRef as useRef25 } from "react";
14668
14682
  import { Fragment as Fragment27, jsx as jsx162, jsxs as jsxs95 } from "react/jsx-runtime";
14669
14683
  var DEFAULT_GRID_CLASSES = "grid grid-cols-2 gap-4 p-4 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5";
14670
14684
  function ContentListGrid(props) {
14671
14685
  const { data, ItemComponent, allowSearch, fullWidth, gridClassName } = props;
14672
14686
  const sentinelRef = useRef25(null);
14673
- useEffect46(() => {
14687
+ useEffect47(() => {
14674
14688
  if (!data.next || !sentinelRef.current) return;
14675
14689
  const observer = new IntersectionObserver(
14676
14690
  (entries) => {
@@ -14764,7 +14778,7 @@ __name(validateItalianTaxCode, "validateItalianTaxCode");
14764
14778
 
14765
14779
  // src/components/fiscal/ItalianFiscalData.tsx
14766
14780
  import { useTranslations as useTranslations56 } from "next-intl";
14767
- import { forwardRef as forwardRef8, useCallback as useCallback31, useImperativeHandle as useImperativeHandle2, useRef as useRef26, useState as useState55 } from "react";
14781
+ import { forwardRef as forwardRef8, useCallback as useCallback32, useImperativeHandle as useImperativeHandle2, useRef as useRef26, useState as useState55 } from "react";
14768
14782
  import { z as z4 } from "zod";
14769
14783
  import { jsx as jsx163, jsxs as jsxs96 } from "react/jsx-runtime";
14770
14784
  var ItalianFiscalData = forwardRef8(/* @__PURE__ */ __name(function ItalianFiscalData2({ initialData }, ref) {
@@ -14773,7 +14787,7 @@ var ItalianFiscalData = forwardRef8(/* @__PURE__ */ __name(function ItalianFisca
14773
14787
  const [fiscalData, setFiscalData] = useState55(initialData);
14774
14788
  const fiscalDataRef = useRef26(initialData);
14775
14789
  const [fiscalErrors, setFiscalErrors] = useState55({});
14776
- const updateFiscalField = useCallback31((key, value) => {
14790
+ const updateFiscalField = useCallback32((key, value) => {
14777
14791
  setFiscalData((prev) => {
14778
14792
  const next = { ...prev, [key]: value };
14779
14793
  fiscalDataRef.current = next;
@@ -14885,7 +14899,7 @@ import { Loader2 as Loader23 } from "lucide-react";
14885
14899
  import { useTranslations as useTranslations58 } from "next-intl";
14886
14900
  import Image7 from "next/image";
14887
14901
  import { useSearchParams as useSearchParams2 } from "next/navigation";
14888
- import { useEffect as useEffect47, useState as useState56 } from "react";
14902
+ import { useEffect as useEffect48, useState as useState56 } from "react";
14889
14903
  import { useForm as useForm5 } from "react-hook-form";
14890
14904
  import { v4 as v45 } from "uuid";
14891
14905
  import { z as z5 } from "zod";
@@ -14963,7 +14977,7 @@ function Register() {
14963
14977
  registrationMode === "waitlist" && !!inviteCode
14964
14978
  );
14965
14979
  const [referralCode, setReferralCode2] = useState56(null);
14966
- useEffect47(() => {
14980
+ useEffect48(() => {
14967
14981
  const code = getReferralCode();
14968
14982
  setReferralCode2(code);
14969
14983
  }, []);
@@ -14996,7 +15010,7 @@ function Register() {
14996
15010
  marketingConsent: false
14997
15011
  }
14998
15012
  });
14999
- useEffect47(() => {
15013
+ useEffect48(() => {
15000
15014
  async function validateInvite() {
15001
15015
  if (registrationMode !== "waitlist" || !inviteCode) {
15002
15016
  return;
@@ -15297,7 +15311,7 @@ __name(InnerAuthContainer, "InnerAuthContainer");
15297
15311
  // src/features/auth/components/two-factor/TwoFactorSettings.tsx
15298
15312
  import { ShieldAlert, ShieldCheck } from "lucide-react";
15299
15313
  import { useTranslations as useTranslations65 } from "next-intl";
15300
- import { useCallback as useCallback32, useEffect as useEffect49, useState as useState65 } from "react";
15314
+ import { useCallback as useCallback33, useEffect as useEffect50, useState as useState65 } from "react";
15301
15315
  import { v4 as v48 } from "uuid";
15302
15316
 
15303
15317
  // src/features/auth/components/two-factor/BackupCodesDialog.tsx
@@ -15408,12 +15422,12 @@ import { useTranslations as useTranslations60 } from "next-intl";
15408
15422
  import { useState as useState60 } from "react";
15409
15423
 
15410
15424
  // src/features/auth/components/two-factor/TotpInput.tsx
15411
- import { useEffect as useEffect48, useRef as useRef27, useState as useState59 } from "react";
15425
+ import { useEffect as useEffect49, useRef as useRef27, useState as useState59 } from "react";
15412
15426
  import { jsx as jsx169, jsxs as jsxs100 } from "react/jsx-runtime";
15413
15427
  function TotpInput({ onComplete, disabled = false, autoFocus = true, error }) {
15414
15428
  const [digits, setDigits] = useState59(["", "", "", "", "", ""]);
15415
15429
  const inputRefs = useRef27([]);
15416
- useEffect48(() => {
15430
+ useEffect49(() => {
15417
15431
  if (autoFocus && inputRefs.current[0]) {
15418
15432
  inputRefs.current[0].focus();
15419
15433
  }
@@ -15901,7 +15915,7 @@ function TwoFactorSettings() {
15901
15915
  const [isLoading, setIsLoading] = useState65(true);
15902
15916
  const [isEnabling, setIsEnabling] = useState65(false);
15903
15917
  const [passkeyDialogOpen, setPasskeyDialogOpen] = useState65(false);
15904
- const loadStatus = useCallback32(async () => {
15918
+ const loadStatus = useCallback33(async () => {
15905
15919
  try {
15906
15920
  const [statusData, authenticatorsList, passkeysList] = await Promise.all([
15907
15921
  TwoFactorService.getStatus(),
@@ -15917,7 +15931,7 @@ function TwoFactorSettings() {
15917
15931
  setIsLoading(false);
15918
15932
  }
15919
15933
  }, [t]);
15920
- useEffect49(() => {
15934
+ useEffect50(() => {
15921
15935
  loadStatus();
15922
15936
  }, [loadStatus]);
15923
15937
  const handleRefresh = /* @__PURE__ */ __name(() => {
@@ -16107,7 +16121,7 @@ __name(LandingComponent, "LandingComponent");
16107
16121
  import { zodResolver as zodResolver6 } from "@hookform/resolvers/zod";
16108
16122
  import { useTranslations as useTranslations67 } from "next-intl";
16109
16123
  import Image10 from "next/image";
16110
- import { useEffect as useEffect50, useState as useState66 } from "react";
16124
+ import { useEffect as useEffect51, useState as useState66 } from "react";
16111
16125
  import { useForm as useForm6 } from "react-hook-form";
16112
16126
  import { z as z6 } from "zod";
16113
16127
  import { Fragment as Fragment33, jsx as jsx179, jsxs as jsxs109 } from "react/jsx-runtime";
@@ -16116,7 +16130,7 @@ function AcceptInvitation() {
16116
16130
  const [showConfirmation, setShowConfirmation] = useState66(false);
16117
16131
  const [error, setError] = useState66(void 0);
16118
16132
  const t = useTranslations67();
16119
- useEffect50(() => {
16133
+ useEffect51(() => {
16120
16134
  async function validateCode(code) {
16121
16135
  try {
16122
16136
  const payload = {
@@ -16209,14 +16223,14 @@ __name(AcceptInvitation, "AcceptInvitation");
16209
16223
  // src/features/auth/components/forms/ActivateAccount.tsx
16210
16224
  import { useTranslations as useTranslations68 } from "next-intl";
16211
16225
  import Image11 from "next/image";
16212
- import { useEffect as useEffect51, useState as useState67 } from "react";
16226
+ import { useEffect as useEffect52, useState as useState67 } from "react";
16213
16227
  import { Fragment as Fragment34, jsx as jsx180, jsxs as jsxs110 } from "react/jsx-runtime";
16214
16228
  function ActivateAccount() {
16215
16229
  const { setComponentType, params, setParams } = useAuthContext();
16216
16230
  const [showConfirmation, setShowConfirmation] = useState67(false);
16217
16231
  const [error, setError] = useState67(void 0);
16218
16232
  const t = useTranslations68();
16219
- useEffect51(() => {
16233
+ useEffect52(() => {
16220
16234
  async function ActivateAccount2(code) {
16221
16235
  try {
16222
16236
  const payload = {
@@ -16257,12 +16271,12 @@ function ActivateAccount() {
16257
16271
  __name(ActivateAccount, "ActivateAccount");
16258
16272
 
16259
16273
  // src/features/auth/components/forms/Cookies.tsx
16260
- import { useEffect as useEffect52, useState as useState68 } from "react";
16274
+ import { useEffect as useEffect53, useState as useState68 } from "react";
16261
16275
  function Cookies({ dehydratedAuth, page }) {
16262
16276
  const { setUser } = useCurrentUserContext();
16263
16277
  const router = useI18nRouter();
16264
16278
  const [hasSaved, setHasSaved] = useState68(false);
16265
- useEffect52(() => {
16279
+ useEffect53(() => {
16266
16280
  if (hasSaved) return;
16267
16281
  async function saveTokenOnServer() {
16268
16282
  await AuthService.saveToken({ dehydratedAuth });
@@ -16357,7 +16371,7 @@ import { zodResolver as zodResolver8 } from "@hookform/resolvers/zod";
16357
16371
  import { useTranslations as useTranslations70 } from "next-intl";
16358
16372
  import Image13 from "next/image";
16359
16373
  import { useRouter, useSearchParams as useSearchParams3 } from "next/navigation";
16360
- import { useEffect as useEffect53, useState as useState70 } from "react";
16374
+ import { useEffect as useEffect54, useState as useState70 } from "react";
16361
16375
  import { useForm as useForm8 } from "react-hook-form";
16362
16376
  import { z as z8 } from "zod";
16363
16377
  import { Fragment as Fragment36, jsx as jsx182, jsxs as jsxs112 } from "react/jsx-runtime";
@@ -16371,7 +16385,7 @@ function Login() {
16371
16385
  const searchParams = useSearchParams3();
16372
16386
  const callbackUrl = searchParams.get("callbackUrl");
16373
16387
  const [referralCode, setReferralCode2] = useState70(null);
16374
- useEffect53(() => {
16388
+ useEffect54(() => {
16375
16389
  const cookies = document.cookie.split("; ");
16376
16390
  for (const cookie of cookies) {
16377
16391
  const [name, value] = cookie.split("=");
@@ -16490,7 +16504,7 @@ function Login() {
16490
16504
  __name(Login, "Login");
16491
16505
 
16492
16506
  // src/features/auth/components/forms/Logout.tsx
16493
- import { useEffect as useEffect54 } from "react";
16507
+ import { useEffect as useEffect55 } from "react";
16494
16508
 
16495
16509
  // src/features/auth/utils/clearClientStorage.ts
16496
16510
  function clearClientStorage(keys) {
@@ -16505,7 +16519,7 @@ __name(clearClientStorage, "clearClientStorage");
16505
16519
  import { Fragment as Fragment37, jsx as jsx183 } from "react/jsx-runtime";
16506
16520
  function Logout({ storageKeys }) {
16507
16521
  const generateUrl = usePageUrlGenerator();
16508
- useEffect54(() => {
16522
+ useEffect55(() => {
16509
16523
  const logOut = /* @__PURE__ */ __name(async () => {
16510
16524
  if (storageKeys?.length) {
16511
16525
  clearClientStorage(storageKeys);
@@ -16521,7 +16535,7 @@ __name(Logout, "Logout");
16521
16535
 
16522
16536
  // src/features/auth/components/forms/RefreshUser.tsx
16523
16537
  import { deleteCookie, getCookie } from "cookies-next";
16524
- import { useEffect as useEffect55 } from "react";
16538
+ import { useEffect as useEffect56 } from "react";
16525
16539
  function RefreshUser() {
16526
16540
  const { setUser } = useCurrentUserContext();
16527
16541
  const loadFullUser = /* @__PURE__ */ __name(async () => {
@@ -16541,7 +16555,7 @@ function RefreshUser() {
16541
16555
  deleteCookie("reloadData");
16542
16556
  }
16543
16557
  }, "loadFullUser");
16544
- useEffect55(() => {
16558
+ useEffect56(() => {
16545
16559
  const reloadData = getCookie("reloadData");
16546
16560
  if (reloadData !== void 0) loadFullUser();
16547
16561
  }, []);
@@ -16553,7 +16567,7 @@ __name(RefreshUser, "RefreshUser");
16553
16567
  import { zodResolver as zodResolver9 } from "@hookform/resolvers/zod";
16554
16568
  import { useTranslations as useTranslations71 } from "next-intl";
16555
16569
  import Image14 from "next/image";
16556
- import { useEffect as useEffect56, useState as useState71 } from "react";
16570
+ import { useEffect as useEffect57, useState as useState71 } from "react";
16557
16571
  import { useForm as useForm9 } from "react-hook-form";
16558
16572
  import { z as z9 } from "zod";
16559
16573
  import { Fragment as Fragment38, jsx as jsx184, jsxs as jsxs113 } from "react/jsx-runtime";
@@ -16562,7 +16576,7 @@ function ResetPassword() {
16562
16576
  const [showConfirmation, setShowConfirmation] = useState71(false);
16563
16577
  const [error, setError] = useState71(void 0);
16564
16578
  const t = useTranslations71();
16565
- useEffect56(() => {
16579
+ useEffect57(() => {
16566
16580
  async function validateResetPasswordCode(code) {
16567
16581
  try {
16568
16582
  const payload = {
@@ -16901,7 +16915,7 @@ __name(RelevantContentsList, "RelevantContentsList");
16901
16915
  // src/features/how-to/components/containers/HowToCommand.tsx
16902
16916
  import { ArrowRight, LifeBuoyIcon } from "lucide-react";
16903
16917
  import { useTranslations as useTranslations78 } from "next-intl";
16904
- import { useCallback as useCallback33, useEffect as useEffect57, useMemo as useMemo28, useRef as useRef28, useState as useState74 } from "react";
16918
+ import { useCallback as useCallback34, useEffect as useEffect58, useMemo as useMemo28, useRef as useRef28, useState as useState74 } from "react";
16905
16919
 
16906
16920
  // src/features/how-to/components/containers/HowToCommandViewer.tsx
16907
16921
  import { ArrowLeft, BookOpen, MessageSquare } from "lucide-react";
@@ -17053,7 +17067,7 @@ function HowToCommand({ pathname, extraGroups, onStartChat }) {
17053
17067
  });
17054
17068
  return { relevantHowTos: relevant, otherHowTos: other };
17055
17069
  }, [data.data, pathname]);
17056
- const search = useCallback33(
17070
+ const search = useCallback34(
17057
17071
  async (searchedTerm) => {
17058
17072
  if (searchedTerm === searchTermRef.current) return;
17059
17073
  searchTermRef.current = searchedTerm;
@@ -17062,16 +17076,16 @@ function HowToCommand({ pathname, extraGroups, onStartChat }) {
17062
17076
  [searchTermRef, data]
17063
17077
  );
17064
17078
  const updateSearchTerm = useDebounce2(search, 500);
17065
- useEffect57(() => {
17079
+ useEffect58(() => {
17066
17080
  updateSearchTerm(searchTerm);
17067
17081
  }, [updateSearchTerm, searchTerm]);
17068
- useEffect57(() => {
17082
+ useEffect58(() => {
17069
17083
  if (!dialogOpen) {
17070
17084
  setSearchTerm("");
17071
17085
  searchTermRef.current = "";
17072
17086
  }
17073
17087
  }, [dialogOpen]);
17074
- useEffect57(() => {
17088
+ useEffect58(() => {
17075
17089
  const down = /* @__PURE__ */ __name((e) => {
17076
17090
  if (e.key === "k" && (e.metaKey || e.ctrlKey)) {
17077
17091
  e.preventDefault();
@@ -17371,7 +17385,7 @@ __name(HowToMultiSelector, "HowToMultiSelector");
17371
17385
  // src/features/how-to/components/forms/HowToSelector.tsx
17372
17386
  import { CircleX as CircleX2, RefreshCwIcon as RefreshCwIcon3, SearchIcon as SearchIcon6, XIcon as XIcon10 } from "lucide-react";
17373
17387
  import { useTranslations as useTranslations83 } from "next-intl";
17374
- import { useCallback as useCallback34, useEffect as useEffect58, useRef as useRef29, useState as useState75 } from "react";
17388
+ import { useCallback as useCallback35, useEffect as useEffect59, useRef as useRef29, useState as useState75 } from "react";
17375
17389
  import { Fragment as Fragment42, jsx as jsx199, jsxs as jsxs119 } from "react/jsx-runtime";
17376
17390
  function HowToSelector({
17377
17391
  id,
@@ -17393,7 +17407,7 @@ function HowToSelector({
17393
17407
  retrieverParams: {},
17394
17408
  module: Modules.HowTo
17395
17409
  });
17396
- const search = useCallback34(
17410
+ const search = useCallback35(
17397
17411
  async (searchedTerm) => {
17398
17412
  try {
17399
17413
  if (searchedTerm === searchTermRef.current) return;
@@ -17407,7 +17421,7 @@ function HowToSelector({
17407
17421
  [searchTermRef, data]
17408
17422
  );
17409
17423
  const updateSearchTerm = useDebounce2(search, 500);
17410
- useEffect58(() => {
17424
+ useEffect59(() => {
17411
17425
  setIsSearching(true);
17412
17426
  updateSearchTerm(searchTerm);
17413
17427
  }, [updateSearchTerm, searchTerm]);
@@ -17677,7 +17691,7 @@ function AssistantThreadHeader({ assistant, onRename, onDelete }) {
17677
17691
  __name(AssistantThreadHeader, "AssistantThreadHeader");
17678
17692
 
17679
17693
  // src/features/assistant/components/parts/AssistantThread.tsx
17680
- import { useEffect as useEffect60, useRef as useRef30 } from "react";
17694
+ import { useEffect as useEffect61, useRef as useRef30 } from "react";
17681
17695
 
17682
17696
  // src/features/assistant-message/components/MessageItem.tsx
17683
17697
  import { useTranslations as useTranslations93 } from "next-intl";
@@ -17686,7 +17700,7 @@ import ReactMarkdown3 from "react-markdown";
17686
17700
  import remarkGfm3 from "remark-gfm";
17687
17701
 
17688
17702
  // src/features/assistant-message/components/parts/MessageSourcesContainer.tsx
17689
- import { useEffect as useEffect59, useMemo as useMemo31, useState as useState81 } from "react";
17703
+ import { useEffect as useEffect60, useMemo as useMemo31, useState as useState81 } from "react";
17690
17704
 
17691
17705
  // src/features/assistant-message/components/parts/MessageSourcesPanel.tsx
17692
17706
  import { useMemo as useMemo30, useState as useState80 } from "react";
@@ -18098,7 +18112,7 @@ function MessageSourcesContainer({ message, isLatestAssistant, onSelectFollowUp
18098
18112
  return parts.sort().join("|");
18099
18113
  }, [groups]);
18100
18114
  const [resolved, setResolved] = useState81([]);
18101
- useEffect59(() => {
18115
+ useEffect60(() => {
18102
18116
  if (groups.size === 0) {
18103
18117
  setResolved([]);
18104
18118
  return;
@@ -18241,7 +18255,7 @@ __name(AssistantStatusLine, "AssistantStatusLine");
18241
18255
  import { jsx as jsx215, jsxs as jsxs132 } from "react/jsx-runtime";
18242
18256
  function AssistantThread({ messages, sending, status, onSelectFollowUp, failedMessageIds, onRetry }) {
18243
18257
  const endRef = useRef30(null);
18244
- useEffect60(() => {
18258
+ useEffect61(() => {
18245
18259
  endRef.current?.scrollIntoView({ behavior: "smooth" });
18246
18260
  }, [messages.length, sending]);
18247
18261
  return /* @__PURE__ */ jsxs132("div", { className: "flex-1 min-w-0 overflow-x-hidden overflow-y-auto px-6 py-5", children: [
@@ -18434,7 +18448,7 @@ __name(NotificationsListContainer, "NotificationsListContainer");
18434
18448
  // src/features/notification/components/modals/NotificationModal.tsx
18435
18449
  import { BellIcon } from "lucide-react";
18436
18450
  import { useTranslations as useTranslations97 } from "next-intl";
18437
- import { Fragment as Fragment47, useCallback as useCallback35, useEffect as useEffect61, useMemo as useMemo32, useRef as useRef31, useState as useState82 } from "react";
18451
+ import { Fragment as Fragment47, useCallback as useCallback36, useEffect as useEffect62, useMemo as useMemo32, useRef as useRef31, useState as useState82 } from "react";
18438
18452
  import { jsx as jsx220, jsxs as jsxs137 } from "react/jsx-runtime";
18439
18453
  function NotificationModalContent({ isOpen, setIsOpen }) {
18440
18454
  const _instanceId = useRef31(Math.random().toString(36).substr(2, 9));
@@ -18464,7 +18478,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
18464
18478
  resetTime: 0,
18465
18479
  isOpen: false
18466
18480
  });
18467
- const checkCircuitBreaker = useCallback35(() => {
18481
+ const checkCircuitBreaker = useCallback36(() => {
18468
18482
  const now = Date.now();
18469
18483
  const breaker = circuitBreakerRef.current;
18470
18484
  if (now > breaker.resetTime) {
@@ -18486,14 +18500,14 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
18486
18500
  unreadIds: unreadNotifications2.map((notif) => notif.id)
18487
18501
  };
18488
18502
  }, [notifications]);
18489
- useEffect61(() => {
18503
+ useEffect62(() => {
18490
18504
  setNewNotifications(unreadCount > 0);
18491
18505
  }, [unreadCount]);
18492
- useEffect61(() => {
18506
+ useEffect62(() => {
18493
18507
  if (lastLoaded === 0) loadNotifications();
18494
18508
  }, [lastLoaded, loadNotifications]);
18495
18509
  const processSocketNotificationsRef = useRef31(null);
18496
- const processSocketNotifications = useCallback35(() => {
18510
+ const processSocketNotifications = useCallback36(() => {
18497
18511
  if (socketNotifications.length === 0) {
18498
18512
  return;
18499
18513
  }
@@ -18532,7 +18546,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
18532
18546
  generateUrl,
18533
18547
  checkCircuitBreaker
18534
18548
  ]);
18535
- useEffect61(() => {
18549
+ useEffect62(() => {
18536
18550
  if (processSocketNotificationsRef.current) {
18537
18551
  clearTimeout(processSocketNotificationsRef.current);
18538
18552
  }
@@ -18609,7 +18623,7 @@ __name(PushNotificationProvider, "PushNotificationProvider");
18609
18623
 
18610
18624
  // src/features/referral/components/ReferralCodeCapture.tsx
18611
18625
  import { useSearchParams as useSearchParams5 } from "next/navigation";
18612
- import { useEffect as useEffect62 } from "react";
18626
+ import { useEffect as useEffect63 } from "react";
18613
18627
 
18614
18628
  // src/features/referral/utils/referral-cookie.ts
18615
18629
  function setReferralCode(code) {
@@ -18634,7 +18648,7 @@ __name(getReferralCode2, "getReferralCode");
18634
18648
  // src/features/referral/components/ReferralCodeCapture.tsx
18635
18649
  function ReferralCodeCapture() {
18636
18650
  const searchParams = useSearchParams5();
18637
- useEffect62(() => {
18651
+ useEffect63(() => {
18638
18652
  if (!isReferralEnabled()) {
18639
18653
  return;
18640
18654
  }
@@ -18653,7 +18667,7 @@ __name(ReferralCodeCapture, "ReferralCodeCapture");
18653
18667
 
18654
18668
  // src/features/referral/components/ReferralWidget.tsx
18655
18669
  import { Copy as Copy2, Loader2 as Loader25, Mail, Users } from "lucide-react";
18656
- import { useCallback as useCallback36, useRef as useRef32, useState as useState85 } from "react";
18670
+ import { useCallback as useCallback37, useRef as useRef32, useState as useState85 } from "react";
18657
18671
 
18658
18672
  // src/features/referral/hooks/useReferralInvite.ts
18659
18673
  import { useState as useState83 } from "react";
@@ -18682,12 +18696,12 @@ function useReferralInvite() {
18682
18696
  __name(useReferralInvite, "useReferralInvite");
18683
18697
 
18684
18698
  // src/features/referral/hooks/useReferralStats.ts
18685
- import { useEffect as useEffect63, useState as useState84 } from "react";
18699
+ import { useEffect as useEffect64, useState as useState84 } from "react";
18686
18700
  function useReferralStats() {
18687
18701
  const [stats, setStats] = useState84(null);
18688
18702
  const [loading, setLoading] = useState84(true);
18689
18703
  const [error, setError] = useState84(null);
18690
- useEffect63(() => {
18704
+ useEffect64(() => {
18691
18705
  if (!isReferralEnabled()) {
18692
18706
  setLoading(false);
18693
18707
  return;
@@ -18766,7 +18780,7 @@ function ReferralWidget({
18766
18780
  if (!isReferralEnabled()) {
18767
18781
  return null;
18768
18782
  }
18769
- const handleCopyLink = useCallback36(async () => {
18783
+ const handleCopyLink = useCallback37(async () => {
18770
18784
  if (!referralUrl) return;
18771
18785
  const success = await copyToClipboard(referralUrl);
18772
18786
  if (success) {
@@ -18778,7 +18792,7 @@ function ReferralWidget({
18778
18792
  showError(t.copyError);
18779
18793
  }
18780
18794
  }, [referralUrl, t.copiedMessage, t.copyError, onLinkCopied]);
18781
- const handleSendInvite = useCallback36(async () => {
18795
+ const handleSendInvite = useCallback37(async () => {
18782
18796
  if (!email || !email.includes("@")) {
18783
18797
  showError(t.invalidEmail);
18784
18798
  return;
@@ -18794,7 +18808,7 @@ function ReferralWidget({
18794
18808
  onInviteError?.(error2);
18795
18809
  }
18796
18810
  }, [email, sendInvite, t.inviteSent, t.inviteError, t.invalidEmail, onInviteSent, onInviteError]);
18797
- const handleEmailKeyDown = useCallback36(
18811
+ const handleEmailKeyDown = useCallback37(
18798
18812
  (e) => {
18799
18813
  if (e.key === "Enter" && !sending) {
18800
18814
  e.preventDefault();
@@ -18971,13 +18985,13 @@ __name(FormRoles, "FormRoles");
18971
18985
 
18972
18986
  // src/features/role/components/forms/RemoveUserFromRole.tsx
18973
18987
  import { useTranslations as useTranslations100 } from "next-intl";
18974
- import { useEffect as useEffect64, useState as useState86 } from "react";
18988
+ import { useEffect as useEffect65, useState as useState86 } from "react";
18975
18989
  import { Fragment as Fragment50, jsx as jsx227, jsxs as jsxs142 } from "react/jsx-runtime";
18976
18990
  function RemoveUserFromRole({ role, user, refresh }) {
18977
18991
  const [open, setOpen] = useState86(false);
18978
18992
  const [canRemove, setCanRemove] = useState86(false);
18979
18993
  const t = useTranslations100();
18980
- useEffect64(() => {
18994
+ useEffect65(() => {
18981
18995
  async function checkCompanyAdminDeletability() {
18982
18996
  const roleUsers = await UserService.findAllUsersByRole({
18983
18997
  roleId: role.id
@@ -19047,7 +19061,7 @@ __name(RemoveUserFromRole, "RemoveUserFromRole");
19047
19061
  // src/features/role/components/forms/UserRoleAdd.tsx
19048
19062
  import { PlusCircle as PlusCircle2 } from "lucide-react";
19049
19063
  import { useTranslations as useTranslations101 } from "next-intl";
19050
- import { useCallback as useCallback37, useEffect as useEffect65, useRef as useRef33, useState as useState87 } from "react";
19064
+ import { useCallback as useCallback38, useEffect as useEffect66, useRef as useRef33, useState as useState87 } from "react";
19051
19065
  import { Fragment as Fragment51, jsx as jsx228, jsxs as jsxs143 } from "react/jsx-runtime";
19052
19066
  function UserRoleAdd({ user, refresh }) {
19053
19067
  const [open, setOpen] = useState87(false);
@@ -19077,7 +19091,7 @@ function UserRoleAdd({ user, refresh }) {
19077
19091
  );
19078
19092
  refresh();
19079
19093
  }, "addUserToRole");
19080
- const searchRoles = useCallback37(
19094
+ const searchRoles = useCallback38(
19081
19095
  async (term) => {
19082
19096
  setRoles(
19083
19097
  await RoleService.findAllRolesUserNotIn({
@@ -19089,10 +19103,10 @@ function UserRoleAdd({ user, refresh }) {
19089
19103
  [searchTerm, user]
19090
19104
  );
19091
19105
  const updateSearchTerm = useDebounce2(searchRoles, 500);
19092
- useEffect65(() => {
19106
+ useEffect66(() => {
19093
19107
  if (open) updateSearchTerm(searchTerm);
19094
19108
  }, [open, searchTerm]);
19095
- useEffect65(() => {
19109
+ useEffect66(() => {
19096
19110
  if (open) searchRoles("");
19097
19111
  }, [open]);
19098
19112
  return /* @__PURE__ */ jsxs143(Fragment51, { children: [
@@ -19187,7 +19201,7 @@ function UserRolesList({ user }) {
19187
19201
  __name(UserRolesList, "UserRolesList");
19188
19202
 
19189
19203
  // src/features/oauth/components/OAuthRedirectUriInput.tsx
19190
- import { useCallback as useCallback38 } from "react";
19204
+ import { useCallback as useCallback39 } from "react";
19191
19205
  import { Plus as Plus2, Trash2 as Trash23 } from "lucide-react";
19192
19206
  import { jsx as jsx231, jsxs as jsxs144 } from "react/jsx-runtime";
19193
19207
  function isValidRedirectUri(uri) {
@@ -19217,17 +19231,17 @@ function OAuthRedirectUriInput({
19217
19231
  disabled = false,
19218
19232
  label = "Redirect URIs"
19219
19233
  }) {
19220
- const handleAdd = useCallback38(() => {
19234
+ const handleAdd = useCallback39(() => {
19221
19235
  onChange([...value, ""]);
19222
19236
  }, [value, onChange]);
19223
- const handleRemove = useCallback38(
19237
+ const handleRemove = useCallback39(
19224
19238
  (index) => {
19225
19239
  const newUris = value.filter((_, i) => i !== index);
19226
19240
  onChange(newUris.length > 0 ? newUris : [""]);
19227
19241
  },
19228
19242
  [value, onChange]
19229
19243
  );
19230
- const handleChange = useCallback38(
19244
+ const handleChange = useCallback39(
19231
19245
  (index, newValue) => {
19232
19246
  const newUris = [...value];
19233
19247
  newUris[index] = newValue;
@@ -19281,7 +19295,7 @@ function OAuthRedirectUriInput({
19281
19295
  __name(OAuthRedirectUriInput, "OAuthRedirectUriInput");
19282
19296
 
19283
19297
  // src/features/oauth/components/OAuthScopeSelector.tsx
19284
- import { useCallback as useCallback39 } from "react";
19298
+ import { useCallback as useCallback40 } from "react";
19285
19299
  import { jsx as jsx232, jsxs as jsxs145 } from "react/jsx-runtime";
19286
19300
  function OAuthScopeSelector({
19287
19301
  value,
@@ -19291,7 +19305,7 @@ function OAuthScopeSelector({
19291
19305
  error,
19292
19306
  label = "Allowed Scopes"
19293
19307
  }) {
19294
- const handleToggle = useCallback39(
19308
+ const handleToggle = useCallback40(
19295
19309
  (scope, checked) => {
19296
19310
  if (checked) {
19297
19311
  onChange([...value, scope]);
@@ -19359,12 +19373,12 @@ function OAuthScopeSelector({
19359
19373
  __name(OAuthScopeSelector, "OAuthScopeSelector");
19360
19374
 
19361
19375
  // src/features/oauth/components/OAuthClientSecretDisplay.tsx
19362
- import { useState as useState88, useCallback as useCallback40 } from "react";
19376
+ import { useState as useState88, useCallback as useCallback41 } from "react";
19363
19377
  import { Copy as Copy3, Check, AlertTriangle } from "lucide-react";
19364
19378
  import { jsx as jsx233, jsxs as jsxs146 } from "react/jsx-runtime";
19365
19379
  function OAuthClientSecretDisplay({ secret, onDismiss, open, clientName }) {
19366
19380
  const [copied, setCopied] = useState88(false);
19367
- const handleCopy = useCallback40(async () => {
19381
+ const handleCopy = useCallback41(async () => {
19368
19382
  try {
19369
19383
  await navigator.clipboard.writeText(secret);
19370
19384
  setCopied(true);
@@ -19373,7 +19387,7 @@ function OAuthClientSecretDisplay({ secret, onDismiss, open, clientName }) {
19373
19387
  console.error("Failed to copy to clipboard:", err);
19374
19388
  }
19375
19389
  }, [secret]);
19376
- const handleDismiss = useCallback40(() => {
19390
+ const handleDismiss = useCallback41(() => {
19377
19391
  setCopied(false);
19378
19392
  onDismiss();
19379
19393
  }, [onDismiss]);
@@ -19556,7 +19570,7 @@ function OAuthClientList({
19556
19570
  __name(OAuthClientList, "OAuthClientList");
19557
19571
 
19558
19572
  // src/features/oauth/components/OAuthClientForm.tsx
19559
- import { useState as useState89, useCallback as useCallback41 } from "react";
19573
+ import { useState as useState89, useCallback as useCallback42 } from "react";
19560
19574
  import { jsx as jsx236, jsxs as jsxs149 } from "react/jsx-runtime";
19561
19575
  function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
19562
19576
  const isEditMode = !!client;
@@ -19568,7 +19582,7 @@ function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
19568
19582
  isConfidential: client?.isConfidential ?? true
19569
19583
  });
19570
19584
  const [errors, setErrors] = useState89({});
19571
- const validate = useCallback41(() => {
19585
+ const validate = useCallback42(() => {
19572
19586
  const newErrors = {};
19573
19587
  if (!formState.name.trim()) {
19574
19588
  newErrors.name = "Application name is required";
@@ -19583,7 +19597,7 @@ function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
19583
19597
  setErrors(newErrors);
19584
19598
  return Object.keys(newErrors).length === 0;
19585
19599
  }, [formState]);
19586
- const handleSubmit = useCallback41(
19600
+ const handleSubmit = useCallback42(
19587
19601
  async (e) => {
19588
19602
  e.preventDefault();
19589
19603
  if (!validate()) return;
@@ -19690,7 +19704,7 @@ function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
19690
19704
  __name(OAuthClientForm, "OAuthClientForm");
19691
19705
 
19692
19706
  // src/features/oauth/components/OAuthClientDetail.tsx
19693
- import { useState as useState90, useCallback as useCallback42 } from "react";
19707
+ import { useState as useState90, useCallback as useCallback43 } from "react";
19694
19708
  import { format as format2 } from "date-fns";
19695
19709
  import { Copy as Copy4, Check as Check2, RefreshCw as RefreshCw3, Pencil as Pencil2, Trash2 as Trash25, ExternalLink } from "lucide-react";
19696
19710
  import { Fragment as Fragment52, jsx as jsx237, jsxs as jsxs150 } from "react/jsx-runtime";
@@ -19706,7 +19720,7 @@ function OAuthClientDetail({
19706
19720
  const [showRegenerateConfirm, setShowRegenerateConfirm] = useState90(false);
19707
19721
  const [isDeleting, setIsDeleting] = useState90(false);
19708
19722
  const [isRegenerating, setIsRegenerating] = useState90(false);
19709
- const copyToClipboard2 = useCallback42(async (text, field) => {
19723
+ const copyToClipboard2 = useCallback43(async (text, field) => {
19710
19724
  try {
19711
19725
  await navigator.clipboard.writeText(text);
19712
19726
  setCopiedField(field);
@@ -19715,7 +19729,7 @@ function OAuthClientDetail({
19715
19729
  console.error("Failed to copy:", err);
19716
19730
  }
19717
19731
  }, []);
19718
- const handleDelete = useCallback42(async () => {
19732
+ const handleDelete = useCallback43(async () => {
19719
19733
  if (!onDelete) return;
19720
19734
  setIsDeleting(true);
19721
19735
  try {
@@ -19725,7 +19739,7 @@ function OAuthClientDetail({
19725
19739
  setShowDeleteConfirm(false);
19726
19740
  }
19727
19741
  }, [onDelete]);
19728
- const handleRegenerateSecret = useCallback42(async () => {
19742
+ const handleRegenerateSecret = useCallback43(async () => {
19729
19743
  if (!onRegenerateSecret) return;
19730
19744
  setIsRegenerating(true);
19731
19745
  try {
@@ -20255,13 +20269,13 @@ __name(WaitlistSuccessState, "WaitlistSuccessState");
20255
20269
  // src/features/waitlist/components/sections/WaitlistConfirmation.tsx
20256
20270
  import { CheckCircle as CheckCircle4, Loader2 as Loader27, XCircle as XCircle2 } from "lucide-react";
20257
20271
  import { useTranslations as useTranslations106 } from "next-intl";
20258
- import { useEffect as useEffect66, useState as useState92 } from "react";
20272
+ import { useEffect as useEffect67, useState as useState92 } from "react";
20259
20273
  import { jsx as jsx246, jsxs as jsxs159 } from "react/jsx-runtime";
20260
20274
  function WaitlistConfirmation({ code }) {
20261
20275
  const t = useTranslations106();
20262
20276
  const [state, setState] = useState92("loading");
20263
20277
  const [errorMessage, setErrorMessage] = useState92("");
20264
- useEffect66(() => {
20278
+ useEffect67(() => {
20265
20279
  async function confirmEmail() {
20266
20280
  try {
20267
20281
  await WaitlistService.confirm(code);
@@ -20301,7 +20315,7 @@ __name(WaitlistConfirmation, "WaitlistConfirmation");
20301
20315
  import { flexRender as flexRender2, getCoreRowModel as getCoreRowModel2, useReactTable as useReactTable2 } from "@tanstack/react-table";
20302
20316
  import { RefreshCw as RefreshCw4, Users as Users2 } from "lucide-react";
20303
20317
  import { useTranslations as useTranslations108 } from "next-intl";
20304
- import { useCallback as useCallback43, useEffect as useEffect67, useState as useState93 } from "react";
20318
+ import { useCallback as useCallback44, useEffect as useEffect68, useState as useState93 } from "react";
20305
20319
 
20306
20320
  // src/features/waitlist/hooks/useWaitlistTableStructure.tsx
20307
20321
  import { Send } from "lucide-react";
@@ -20402,7 +20416,7 @@ function WaitlistList() {
20402
20416
  const [total, setTotal] = useState93(0);
20403
20417
  const [isLoading, setIsLoading] = useState93(true);
20404
20418
  const [statusFilter, setStatusFilter] = useState93("all");
20405
- const loadEntries = useCallback43(async () => {
20419
+ const loadEntries = useCallback44(async () => {
20406
20420
  setIsLoading(true);
20407
20421
  try {
20408
20422
  const result = await WaitlistService.findMany({
@@ -20417,7 +20431,7 @@ function WaitlistList() {
20417
20431
  setIsLoading(false);
20418
20432
  }
20419
20433
  }, [statusFilter]);
20420
- useEffect67(() => {
20434
+ useEffect68(() => {
20421
20435
  loadEntries();
20422
20436
  }, [loadEntries]);
20423
20437
  const handleInvite = /* @__PURE__ */ __name(async (entry) => {
@@ -20471,7 +20485,7 @@ __name(WaitlistList, "WaitlistList");
20471
20485
  // src/features/rbac/components/RbacContainer.tsx
20472
20486
  import { Loader2Icon as Loader2Icon3 } from "lucide-react";
20473
20487
  import { useTranslations as useTranslations110 } from "next-intl";
20474
- import { memo as memo2, useCallback as useCallback45, useEffect as useEffect69, useMemo as useMemo33, useRef as useRef34, useState as useState95 } from "react";
20488
+ import { memo as memo2, useCallback as useCallback46, useEffect as useEffect70, useMemo as useMemo33, useRef as useRef34, useState as useState95 } from "react";
20475
20489
 
20476
20490
  // src/features/rbac/components/RbacPermissionCell.tsx
20477
20491
  import { CheckIcon as CheckIcon9, MinusIcon as MinusIcon2, XIcon as XIcon11 } from "lucide-react";
@@ -20552,7 +20566,7 @@ __name(RbacPermissionCell, "RbacPermissionCell");
20552
20566
  import { Popover as PopoverPrimitive2 } from "@base-ui/react/popover";
20553
20567
  import { CheckIcon as CheckIcon10, MinusIcon as MinusIcon3, XIcon as XIcon12 } from "lucide-react";
20554
20568
  import { useTranslations as useTranslations109 } from "next-intl";
20555
- import { useCallback as useCallback44, useEffect as useEffect68, useState as useState94 } from "react";
20569
+ import { useCallback as useCallback45, useEffect as useEffect69, useState as useState94 } from "react";
20556
20570
  import { Fragment as Fragment54, jsx as jsx250, jsxs as jsxs163 } from "react/jsx-runtime";
20557
20571
  function RbacPermissionPicker({
20558
20572
  open,
@@ -20566,11 +20580,11 @@ function RbacPermissionPicker({
20566
20580
  }) {
20567
20581
  const t = useTranslations109();
20568
20582
  const [customSegment, setCustomSegment] = useState94("");
20569
- useEffect68(() => {
20583
+ useEffect69(() => {
20570
20584
  if (!open) setCustomSegment("");
20571
20585
  }, [open]);
20572
20586
  const currentSegments = typeof value === "string" ? value.split("|").filter(Boolean) : [];
20573
- const toggleSegment = useCallback44(
20587
+ const toggleSegment = useCallback45(
20574
20588
  (segment) => {
20575
20589
  const next = currentSegments.includes(segment) ? currentSegments.filter((s) => s !== segment) : [...currentSegments, segment];
20576
20590
  if (next.length === 0) onSetValue(false);
@@ -20578,7 +20592,7 @@ function RbacPermissionPicker({
20578
20592
  },
20579
20593
  [currentSegments, onSetValue]
20580
20594
  );
20581
- const addCustomSegment = useCallback44(() => {
20595
+ const addCustomSegment = useCallback45(() => {
20582
20596
  const segment = customSegment.trim();
20583
20597
  if (!segment) return;
20584
20598
  if (!currentSegments.includes(segment)) {
@@ -20742,7 +20756,7 @@ var CellButton = memo2(/* @__PURE__ */ __name(function CellButton2({
20742
20756
  }) {
20743
20757
  const ref = useRef34(null);
20744
20758
  const value = cellValue(tokens, action);
20745
- const handleClick = useCallback45(() => {
20759
+ const handleClick = useCallback46(() => {
20746
20760
  if (!ref.current) return;
20747
20761
  onOpen({ moduleId, rowKey, action, isRoleColumn, anchor: ref.current });
20748
20762
  }, [onOpen, moduleId, rowKey, action, isRoleColumn]);
@@ -20816,13 +20830,13 @@ function RbacContainer() {
20816
20830
  const { matrix, modulePaths, loading, error, roleNames, moduleNames, updateCell, clearCell } = useRbacContext();
20817
20831
  const [selectedModuleId, setSelectedModuleId] = useState95(null);
20818
20832
  const [activePicker, setActivePicker] = useState95(null);
20819
- const openPicker = useCallback45((picker) => {
20833
+ const openPicker = useCallback46((picker) => {
20820
20834
  setActivePicker(picker);
20821
20835
  }, []);
20822
- const closePicker = useCallback45(() => {
20836
+ const closePicker = useCallback46(() => {
20823
20837
  setActivePicker(null);
20824
20838
  }, []);
20825
- const handleSelectModule = useCallback45((id) => {
20839
+ const handleSelectModule = useCallback46((id) => {
20826
20840
  setSelectedModuleId(id);
20827
20841
  setActivePicker(null);
20828
20842
  }, []);
@@ -20843,7 +20857,7 @@ function RbacContainer() {
20843
20857
  }
20844
20858
  return Array.from(set).sort();
20845
20859
  }, [matrix, roleNames]);
20846
- useEffect69(() => {
20860
+ useEffect70(() => {
20847
20861
  if (!selectedModuleId && sortedModuleIds.length > 0) {
20848
20862
  setSelectedModuleId(sortedModuleIds[0]);
20849
20863
  }
@@ -20859,14 +20873,14 @@ function RbacContainer() {
20859
20873
  if (!activePicker) return [];
20860
20874
  return modulePaths[activePicker.moduleId] ?? [];
20861
20875
  }, [activePicker, modulePaths]);
20862
- const handleSetValue = useCallback45(
20876
+ const handleSetValue = useCallback46(
20863
20877
  (value) => {
20864
20878
  if (!activePicker) return;
20865
20879
  updateCell(activePicker.moduleId, activePicker.rowKey, activePicker.action, value);
20866
20880
  },
20867
20881
  [activePicker, updateCell]
20868
20882
  );
20869
- const handleClear = useCallback45(() => {
20883
+ const handleClear = useCallback46(() => {
20870
20884
  if (!activePicker || !activePicker.isRoleColumn) return;
20871
20885
  clearCell(activePicker.moduleId, activePicker.rowKey, activePicker.action);
20872
20886
  }, [activePicker, clearCell]);
@@ -20926,7 +20940,7 @@ __name(RbacContainer, "RbacContainer");
20926
20940
  // src/features/rbac/components/RbacByRoleContainer.tsx
20927
20941
  import { Loader2Icon as Loader2Icon4 } from "lucide-react";
20928
20942
  import { useTranslations as useTranslations111 } from "next-intl";
20929
- import { Fragment as Fragment55, memo as memo3, useCallback as useCallback46, useEffect as useEffect70, useMemo as useMemo34, useRef as useRef35, useState as useState96 } from "react";
20943
+ import { Fragment as Fragment55, memo as memo3, useCallback as useCallback47, useEffect as useEffect71, useMemo as useMemo34, useRef as useRef35, useState as useState96 } from "react";
20930
20944
  import { jsx as jsx252, jsxs as jsxs165 } from "react/jsx-runtime";
20931
20945
  function findToken2(tokens, action) {
20932
20946
  if (!tokens) return void 0;
@@ -20949,7 +20963,7 @@ var CellButton3 = memo3(/* @__PURE__ */ __name(function CellButton4({
20949
20963
  }) {
20950
20964
  const ref = useRef35(null);
20951
20965
  const value = cellValue2(tokens, action);
20952
- const handleClick = useCallback46(() => {
20966
+ const handleClick = useCallback47(() => {
20953
20967
  if (!ref.current) return;
20954
20968
  onOpen({ moduleId, rowKey, action, isRoleColumn, anchor: ref.current });
20955
20969
  }, [onOpen, moduleId, rowKey, action, isRoleColumn]);
@@ -20966,13 +20980,13 @@ function RbacByRoleContainer() {
20966
20980
  const { matrix, modulePaths, loading, error, roleNames, moduleNames, updateCell, clearCell } = useRbacContext();
20967
20981
  const [selectedRoleId, setSelectedRoleId] = useState96(null);
20968
20982
  const [activePicker, setActivePicker] = useState96(null);
20969
- const openPicker = useCallback46((picker) => {
20983
+ const openPicker = useCallback47((picker) => {
20970
20984
  setActivePicker(picker);
20971
20985
  }, []);
20972
- const closePicker = useCallback46(() => {
20986
+ const closePicker = useCallback47(() => {
20973
20987
  setActivePicker(null);
20974
20988
  }, []);
20975
- const handleSelectRole = useCallback46((id) => {
20989
+ const handleSelectRole = useCallback47((id) => {
20976
20990
  setSelectedRoleId(id);
20977
20991
  setActivePicker(null);
20978
20992
  }, []);
@@ -20984,7 +20998,7 @@ function RbacByRoleContainer() {
20984
20998
  if (!matrix) return [];
20985
20999
  return Object.keys(matrix).sort((a, b) => (moduleNames?.[a] ?? a).localeCompare(moduleNames?.[b] ?? b));
20986
21000
  }, [matrix, moduleNames]);
20987
- useEffect70(() => {
21001
+ useEffect71(() => {
20988
21002
  if (!selectedRoleId && sortedRoleIds.length > 0) {
20989
21003
  setSelectedRoleId(sortedRoleIds[0]);
20990
21004
  }
@@ -21000,14 +21014,14 @@ function RbacByRoleContainer() {
21000
21014
  if (!activePicker) return [];
21001
21015
  return modulePaths[activePicker.moduleId] ?? [];
21002
21016
  }, [activePicker, modulePaths]);
21003
- const handleSetValue = useCallback46(
21017
+ const handleSetValue = useCallback47(
21004
21018
  (value) => {
21005
21019
  if (!activePicker) return;
21006
21020
  updateCell(activePicker.moduleId, activePicker.rowKey, activePicker.action, value);
21007
21021
  },
21008
21022
  [activePicker, updateCell]
21009
21023
  );
21010
- const handleClear = useCallback46(() => {
21024
+ const handleClear = useCallback47(() => {
21011
21025
  if (!activePicker || !activePicker.isRoleColumn) return;
21012
21026
  clearCell(activePicker.moduleId, activePicker.rowKey, activePicker.action);
21013
21027
  }, [activePicker, clearCell]);
@@ -21607,4 +21621,4 @@ export {
21607
21621
  useOAuthClients,
21608
21622
  useOAuthClient
21609
21623
  };
21610
- //# sourceMappingURL=chunk-KZRM55JX.mjs.map
21624
+ //# sourceMappingURL=chunk-CPXN5OGI.mjs.map