@carlonicora/nextjs-jsonapi 5.6.0 → 5.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BlockNoteEditor-AE3ZTEEH.js → BlockNoteEditor-ARUXU5AV.js} +19 -19
- package/dist/{BlockNoteEditor-AE3ZTEEH.js.map → BlockNoteEditor-ARUXU5AV.js.map} +1 -1
- package/dist/{BlockNoteEditor-NEYG5L6W.mjs → BlockNoteEditor-MNNISNVN.mjs} +4 -4
- package/dist/{BlockNoteViewer-3OUT5UFY.mjs → BlockNoteViewer-BVVN6D3T.mjs} +2 -2
- package/dist/{BlockNoteViewer-4CFKQM7U.js → BlockNoteViewer-SD3ZFIXD.js} +3 -3
- package/dist/{BlockNoteViewer-4CFKQM7U.js.map → BlockNoteViewer-SD3ZFIXD.js.map} +1 -1
- package/dist/billing/index.d.mts +33 -43
- package/dist/billing/index.d.ts +33 -43
- package/dist/billing/index.js +591 -574
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +30 -13
- package/dist/billing/index.mjs.map +1 -1
- package/dist/{chunk-SFYPXCK4.mjs → chunk-2FNSDBJG.mjs} +641 -536
- package/dist/chunk-2FNSDBJG.mjs.map +1 -0
- package/dist/{chunk-3I5AAJXV.js → chunk-2TXE57LE.js} +3 -3
- package/dist/{chunk-3I5AAJXV.js.map → chunk-2TXE57LE.js.map} +1 -1
- package/dist/{chunk-LQ4DK4JF.js → chunk-2WK35GO2.js} +1317 -1212
- package/dist/chunk-2WK35GO2.js.map +1 -0
- package/dist/{chunk-HKZAESS6.js → chunk-5TH2DSAH.js} +17 -12
- package/dist/chunk-5TH2DSAH.js.map +1 -0
- package/dist/{chunk-EYA2F6AN.mjs → chunk-FK26NX3S.mjs} +16 -11
- package/dist/chunk-FK26NX3S.mjs.map +1 -0
- package/dist/{chunk-53BAULDP.js → chunk-IJME5SAM.js} +4 -4
- package/dist/{chunk-53BAULDP.js.map → chunk-IJME5SAM.js.map} +1 -1
- package/dist/{chunk-KQHBONL4.mjs → chunk-OKCV4GPJ.mjs} +2 -2
- package/dist/{chunk-BTPUYUQ3.mjs → chunk-RGQYFSJF.mjs} +2 -2
- package/dist/{chunk-Y7RR57EW.mjs → chunk-WCHLCOZG.mjs} +2 -2
- package/dist/{chunk-RL3PL3KV.js → chunk-XOSC3FFP.js} +8 -8
- package/dist/{chunk-RL3PL3KV.js.map → chunk-XOSC3FFP.js.map} +1 -1
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.js +4 -4
- package/dist/components/index.mjs +3 -3
- package/dist/contexts/index.js +4 -4
- package/dist/contexts/index.mjs +3 -3
- package/dist/core/index.d.mts +9 -3
- package/dist/core/index.d.ts +9 -3
- package/dist/core/index.js +10 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +9 -1
- package/dist/{format-options-D6c7FNDi.d.mts → currency-DT_dveBx.d.mts} +41 -8
- package/dist/{format-options-BtX3o0Yu.d.ts → currency-pK9eRYRC.d.ts} +41 -8
- package/dist/email-automations/index.js +92 -92
- package/dist/email-automations/index.mjs +3 -3
- package/dist/features/analytics/index.js +121 -121
- package/dist/features/analytics/index.mjs +4 -4
- package/dist/features/analytics/server.js +4 -4
- package/dist/features/analytics/server.mjs +2 -2
- package/dist/features/blog/index.js +150 -150
- package/dist/features/blog/index.mjs +3 -3
- package/dist/features/blog/server.js +16 -16
- package/dist/features/blog/server.mjs +1 -1
- package/dist/features/help/index.js +37 -37
- package/dist/features/help/index.mjs +3 -3
- package/dist/features/tokenusage/index.js +124 -124
- package/dist/features/tokenusage/index.mjs +4 -4
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -2
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +2 -2
- package/package.json +1 -1
- package/src/core/index.ts +3 -0
- package/src/features/billing/contexts/CouponContext.tsx +0 -2
- package/src/features/billing/stripe-coupon/components/containers/CouponContainer.tsx +2 -2
- package/src/features/billing/stripe-coupon/components/details/CouponDetails.tsx +5 -2
- package/src/features/billing/stripe-coupon/components/forms/CouponCodeEditor.tsx +6 -5
- package/src/features/billing/stripe-coupon/components/forms/CouponCodeFields.tsx +67 -45
- package/src/features/billing/stripe-coupon/components/forms/CouponEditor.tsx +294 -212
- package/src/features/billing/stripe-coupon/components/widgets/CouponCodeActions.tsx +4 -3
- package/src/features/billing/stripe-coupon/data/stripe-coupon.interface.ts +11 -7
- package/src/features/billing/stripe-coupon/data/stripe-coupon.ts +6 -4
- package/src/features/billing/stripe-coupon/hooks/useStripeCouponCodeTableStructure.tsx +14 -7
- package/src/features/billing/stripe-coupon/hooks/useStripeCouponTableStructure.tsx +2 -2
- package/src/features/billing/stripe-coupon/stripe-coupon-code.module.ts +3 -2
- package/src/features/billing/stripe-coupon/stripe-coupon.module.ts +11 -4
- package/src/features/billing/stripe-coupon/utils/__tests__/coupon-page-module.spec.ts +32 -0
- package/src/features/billing/stripe-coupon/utils/coupon-page-module.ts +13 -0
- package/src/features/billing/stripe-promotion-code/components/PromoCodeInput.tsx +1 -1
- package/src/features/billing/stripe-subscription/hooks/wizard-promotion.ts +15 -8
- package/dist/chunk-EYA2F6AN.mjs.map +0 -1
- package/dist/chunk-HKZAESS6.js.map +0 -1
- package/dist/chunk-LQ4DK4JF.js.map +0 -1
- package/dist/chunk-SFYPXCK4.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-NEYG5L6W.mjs.map → BlockNoteEditor-MNNISNVN.mjs.map} +0 -0
- /package/dist/{BlockNoteViewer-3OUT5UFY.mjs.map → BlockNoteViewer-BVVN6D3T.mjs.map} +0 -0
- /package/dist/{chunk-KQHBONL4.mjs.map → chunk-OKCV4GPJ.mjs.map} +0 -0
- /package/dist/{chunk-BTPUYUQ3.mjs.map → chunk-RGQYFSJF.mjs.map} +0 -0
- /package/dist/{chunk-Y7RR57EW.mjs.map → chunk-WCHLCOZG.mjs.map} +0 -0
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
isReferralEnabled,
|
|
17
17
|
isRegistrationAllowed,
|
|
18
18
|
useWaitlistText
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-WCHLCOZG.mjs";
|
|
20
20
|
import {
|
|
21
21
|
getRoleId,
|
|
22
22
|
isRolesConfigured
|
|
@@ -54,6 +54,7 @@ import {
|
|
|
54
54
|
RehydrationFactory,
|
|
55
55
|
RoleService,
|
|
56
56
|
S3Service,
|
|
57
|
+
STRIPE_COUPON_DETAIL_PAGE_URL,
|
|
57
58
|
StripeCouponCodeService,
|
|
58
59
|
StripeCouponService,
|
|
59
60
|
StripeProductService,
|
|
@@ -96,7 +97,7 @@ import {
|
|
|
96
97
|
useIsMobile,
|
|
97
98
|
validateItalianTaxCode,
|
|
98
99
|
validatePartitaIva
|
|
99
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-FK26NX3S.mjs";
|
|
100
101
|
import {
|
|
101
102
|
ENV
|
|
102
103
|
} from "./chunk-V5MI7RNB.mjs";
|
|
@@ -10710,7 +10711,7 @@ import { useRef as useRef18 } from "react";
|
|
|
10710
10711
|
import dynamic from "next/dynamic";
|
|
10711
10712
|
import React18 from "react";
|
|
10712
10713
|
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
10713
|
-
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-
|
|
10714
|
+
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-MNNISNVN.mjs"), {
|
|
10714
10715
|
ssr: false
|
|
10715
10716
|
});
|
|
10716
10717
|
var BlockNoteEditorContainer = React18.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
|
|
@@ -11771,14 +11772,14 @@ function GdprConsentCheckbox({
|
|
|
11771
11772
|
id,
|
|
11772
11773
|
label,
|
|
11773
11774
|
description,
|
|
11774
|
-
required
|
|
11775
|
+
required: required2
|
|
11775
11776
|
}) {
|
|
11776
11777
|
return /* @__PURE__ */ jsx104(FormFieldWrapper, { form, name: id, orientation: "horizontal", children: (field) => /* @__PURE__ */ jsxs61("div", { className: "flex flex-row items-start space-x-3 space-y-0", children: [
|
|
11777
|
-
/* @__PURE__ */ jsx104(Checkbox, { checked: field.value, onCheckedChange: field.onChange, "aria-required":
|
|
11778
|
+
/* @__PURE__ */ jsx104(Checkbox, { checked: field.value, onCheckedChange: field.onChange, "aria-required": required2 }),
|
|
11778
11779
|
/* @__PURE__ */ jsxs61("div", { className: "space-y-1 leading-none", children: [
|
|
11779
11780
|
/* @__PURE__ */ jsxs61("span", { className: "text-sm font-normal", children: [
|
|
11780
11781
|
label,
|
|
11781
|
-
|
|
11782
|
+
required2 && /* @__PURE__ */ jsx104("span", { className: "ms-1 text-destructive", children: "*" })
|
|
11782
11783
|
] }),
|
|
11783
11784
|
description && /* @__PURE__ */ jsx104(FieldDescription, { className: "text-xs", children: description })
|
|
11784
11785
|
] })
|
|
@@ -16917,7 +16918,7 @@ __name(BlockNoteEditorMentionSuggestionMenu, "BlockNoteEditorMentionSuggestionMe
|
|
|
16917
16918
|
import dynamic2 from "next/dynamic";
|
|
16918
16919
|
import React29 from "react";
|
|
16919
16920
|
import { jsx as jsx177 } from "react/jsx-runtime";
|
|
16920
|
-
var BlockNoteViewer = dynamic2(() => import("./BlockNoteViewer-
|
|
16921
|
+
var BlockNoteViewer = dynamic2(() => import("./BlockNoteViewer-BVVN6D3T.mjs").then((m) => m.BlockNoteViewer), { ssr: false });
|
|
16921
16922
|
var BlockNoteViewerContainer = React29.memo(/* @__PURE__ */ __name(function ViewerContainer(props) {
|
|
16922
16923
|
return /* @__PURE__ */ jsx177(BlockNoteViewer, { ...props });
|
|
16923
16924
|
}, "ViewerContainer"));
|
|
@@ -17856,7 +17857,7 @@ var useStripeCouponTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
17856
17857
|
header: t("billing.admin.coupons.fields.name"),
|
|
17857
17858
|
cell: /* @__PURE__ */ __name(({ row }) => {
|
|
17858
17859
|
const coupon = row.original.jsonApiData;
|
|
17859
|
-
return /* @__PURE__ */ jsx191(Link, { href: generateUrl({ page:
|
|
17860
|
+
return /* @__PURE__ */ jsx191(Link, { href: generateUrl({ page: STRIPE_COUPON_DETAIL_PAGE_URL, id: coupon.id }), children: coupon.name });
|
|
17860
17861
|
}, "cell"),
|
|
17861
17862
|
enableSorting: false,
|
|
17862
17863
|
enableHiding: false
|
|
@@ -17918,11 +17919,11 @@ registerTableGenerator("stripe-coupons", useStripeCouponTableStructure);
|
|
|
17918
17919
|
|
|
17919
17920
|
// src/features/billing/stripe-coupon/hooks/useStripeCouponCodeTableStructure.tsx
|
|
17920
17921
|
import { useTranslations as useTranslations76 } from "next-intl";
|
|
17921
|
-
import { useMemo as useMemo36 } from "react";
|
|
17922
|
+
import { useMemo as useMemo36, useState as useState66 } from "react";
|
|
17922
17923
|
|
|
17923
17924
|
// src/features/billing/contexts/CouponContext.tsx
|
|
17924
17925
|
import { useTranslations as useTranslations74 } from "next-intl";
|
|
17925
|
-
import { createContext as createContext28, useCallback as useCallback34, useContext as useContext28, useMemo as useMemo35, useState as
|
|
17926
|
+
import { createContext as createContext28, useCallback as useCallback34, useContext as useContext28, useMemo as useMemo35, useState as useState64 } from "react";
|
|
17926
17927
|
|
|
17927
17928
|
// src/features/billing/stripe-coupon/components/forms/CouponRefresher.tsx
|
|
17928
17929
|
import { RefreshCwIcon as RefreshCwIcon4 } from "lucide-react";
|
|
@@ -17961,24 +17962,51 @@ __name(CouponRefresher, "CouponRefresher");
|
|
|
17961
17962
|
// src/features/billing/stripe-coupon/components/forms/CouponEditor.tsx
|
|
17962
17963
|
import { zodResolver as zodResolver5 } from "@hookform/resolvers/zod";
|
|
17963
17964
|
import { useTranslations as useTranslations73 } from "next-intl";
|
|
17964
|
-
import { useCallback as useCallback33, useMemo as useMemo34 } from "react";
|
|
17965
|
+
import { useCallback as useCallback33, useMemo as useMemo34, useState as useState63 } from "react";
|
|
17965
17966
|
import { useForm as useForm5 } from "react-hook-form";
|
|
17966
17967
|
import { v4 as v45 } from "uuid";
|
|
17967
17968
|
import { z as z5 } from "zod";
|
|
17968
17969
|
|
|
17970
|
+
// src/features/billing/stripe-coupon/utils/coupon-page-module.ts
|
|
17971
|
+
function couponPageModule() {
|
|
17972
|
+
return { ...Modules.StripeCoupon, pageUrl: STRIPE_COUPON_DETAIL_PAGE_URL };
|
|
17973
|
+
}
|
|
17974
|
+
__name(couponPageModule, "couponPageModule");
|
|
17975
|
+
|
|
17969
17976
|
// src/features/billing/stripe-coupon/components/forms/CouponCodeFields.tsx
|
|
17970
17977
|
import { useTranslations as useTranslations72 } from "next-intl";
|
|
17978
|
+
import { useState as useState62 } from "react";
|
|
17971
17979
|
import { z as z4 } from "zod";
|
|
17972
17980
|
import { jsx as jsx193, jsxs as jsxs103 } from "react/jsx-runtime";
|
|
17973
|
-
var
|
|
17974
|
-
|
|
17975
|
-
|
|
17976
|
-
)
|
|
17977
|
-
|
|
17978
|
-
|
|
17979
|
-
|
|
17980
|
-
|
|
17981
|
-
|
|
17981
|
+
var rawNumber = /* @__PURE__ */ __name(() => z4.union([z4.string(), z4.number()]).nullish(), "rawNumber");
|
|
17982
|
+
function issueMessages(schema, value) {
|
|
17983
|
+
const result = schema.safeParse(value);
|
|
17984
|
+
return result.success ? [] : result.error.issues.map((issue) => issue.message);
|
|
17985
|
+
}
|
|
17986
|
+
__name(issueMessages, "issueMessages");
|
|
17987
|
+
function parseOptionalPositiveInt(value) {
|
|
17988
|
+
if (value === void 0 || value === null || value === "" || value === 0) return void 0;
|
|
17989
|
+
if (typeof value === "number") return Number.isNaN(value) ? void 0 : value;
|
|
17990
|
+
return parseInt(value, 10);
|
|
17991
|
+
}
|
|
17992
|
+
__name(parseOptionalPositiveInt, "parseOptionalPositiveInt");
|
|
17993
|
+
function parseOptionalDecimal(value) {
|
|
17994
|
+
if (typeof value === "string") return value.trim() === "" ? void 0 : parseFloat(value.replace(",", "."));
|
|
17995
|
+
if (value === void 0 || value === null || Number.isNaN(value)) return void 0;
|
|
17996
|
+
return value;
|
|
17997
|
+
}
|
|
17998
|
+
__name(parseOptionalDecimal, "parseOptionalDecimal");
|
|
17999
|
+
var positiveIntCheck = z4.number().int().min(1).optional();
|
|
18000
|
+
var decimalCheck = z4.number().optional();
|
|
18001
|
+
var optionalPositiveInt = /* @__PURE__ */ __name(() => rawNumber().superRefine((value, ctx) => {
|
|
18002
|
+
for (const message of issueMessages(positiveIntCheck, parseOptionalPositiveInt(value)))
|
|
18003
|
+
ctx.addIssue({ code: "custom", message });
|
|
18004
|
+
}), "optionalPositiveInt");
|
|
18005
|
+
var optionalDecimal = /* @__PURE__ */ __name(() => rawNumber().superRefine((value, ctx) => {
|
|
18006
|
+
for (const message of issueMessages(decimalCheck, parseOptionalDecimal(value)))
|
|
18007
|
+
ctx.addIssue({ code: "custom", message });
|
|
18008
|
+
}), "optionalDecimal");
|
|
18009
|
+
var optionalDate = /* @__PURE__ */ __name(() => z4.union([z4.date(), z4.literal("")]).nullish(), "optionalDate");
|
|
17982
18010
|
var couponCodeSchema = /* @__PURE__ */ __name((t) => z4.object({
|
|
17983
18011
|
code: z4.string().optional(),
|
|
17984
18012
|
firstTimeTransaction: z4.boolean(),
|
|
@@ -17989,7 +18017,8 @@ var couponCodeSchema = /* @__PURE__ */ __name((t) => z4.object({
|
|
|
17989
18017
|
maxRedemptions: optionalPositiveInt(),
|
|
17990
18018
|
automatic: z4.boolean()
|
|
17991
18019
|
}).superRefine((values, ctx) => {
|
|
17992
|
-
|
|
18020
|
+
const minimumAmount = parseOptionalDecimal(values.minimumAmount);
|
|
18021
|
+
if (minimumAmount !== void 0 && minimumAmount <= 0)
|
|
17993
18022
|
ctx.addIssue({
|
|
17994
18023
|
code: "custom",
|
|
17995
18024
|
path: ["minimumAmount"],
|
|
@@ -18012,13 +18041,15 @@ var toCouponCodeInput = /* @__PURE__ */ __name((values) => {
|
|
|
18012
18041
|
automatic: values.automatic
|
|
18013
18042
|
};
|
|
18014
18043
|
if (values.code?.trim()) input.code = values.code.trim();
|
|
18015
|
-
|
|
18016
|
-
|
|
18044
|
+
const minimumAmount = parseOptionalDecimal(values.minimumAmount);
|
|
18045
|
+
if (minimumAmount !== void 0) {
|
|
18046
|
+
input.minimumAmount = Math.round(minimumAmount * 100);
|
|
18017
18047
|
input.minimumAmountCurrency = values.minimumAmountCurrency;
|
|
18018
18048
|
}
|
|
18019
18049
|
if (values.stripeCustomerId?.trim()) input.stripeCustomerId = values.stripeCustomerId.trim();
|
|
18020
18050
|
if (values.expiresAt) input.expiresAt = values.expiresAt;
|
|
18021
|
-
|
|
18051
|
+
const maxRedemptions = parseOptionalPositiveInt(values.maxRedemptions);
|
|
18052
|
+
if (maxRedemptions !== void 0) input.maxRedemptions = maxRedemptions;
|
|
18022
18053
|
return input;
|
|
18023
18054
|
}, "toCouponCodeInput");
|
|
18024
18055
|
var couponCurrencyOptions = [
|
|
@@ -18028,6 +18059,7 @@ var couponCurrencyOptions = [
|
|
|
18028
18059
|
];
|
|
18029
18060
|
function CouponCodeFields({ form, prefix = "" }) {
|
|
18030
18061
|
const t = useTranslations72();
|
|
18062
|
+
const [now] = useState62(() => /* @__PURE__ */ new Date());
|
|
18031
18063
|
return /* @__PURE__ */ jsxs103("div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
18032
18064
|
/* @__PURE__ */ jsx193(
|
|
18033
18065
|
FormInput,
|
|
@@ -18085,7 +18117,7 @@ function CouponCodeFields({ form, prefix = "" }) {
|
|
|
18085
18117
|
form,
|
|
18086
18118
|
id: `${prefix}expiresAt`,
|
|
18087
18119
|
name: t("billing.admin.coupons.fields.expiresAt"),
|
|
18088
|
-
minDate:
|
|
18120
|
+
minDate: now,
|
|
18089
18121
|
allowEmpty: true
|
|
18090
18122
|
}
|
|
18091
18123
|
),
|
|
@@ -18113,8 +18145,85 @@ function CouponCodeFields({ form, prefix = "" }) {
|
|
|
18113
18145
|
__name(CouponCodeFields, "CouponCodeFields");
|
|
18114
18146
|
|
|
18115
18147
|
// src/features/billing/stripe-coupon/components/forms/CouponEditor.tsx
|
|
18116
|
-
import {
|
|
18117
|
-
|
|
18148
|
+
import { jsx as jsx194, jsxs as jsxs104 } from "react/jsx-runtime";
|
|
18149
|
+
var couponRenameSchema = /* @__PURE__ */ __name((t) => z5.object({ id: z5.string(), name: z5.string().min(1, { message: t("billing.admin.coupons.errors.name") }) }), "couponRenameSchema");
|
|
18150
|
+
var couponCreateSchema = /* @__PURE__ */ __name((t) => z5.object({
|
|
18151
|
+
id: z5.uuidv4(),
|
|
18152
|
+
name: z5.string().min(1, { message: t("billing.admin.coupons.errors.name") }),
|
|
18153
|
+
stripeCouponId: z5.string().optional(),
|
|
18154
|
+
discountType: z5.enum(["percent_off", "amount_off"]),
|
|
18155
|
+
percentOff: optionalDecimal(),
|
|
18156
|
+
amountOff: optionalDecimal(),
|
|
18157
|
+
currency: z5.string().min(1),
|
|
18158
|
+
duration: z5.enum(["once", "repeating", "forever"]),
|
|
18159
|
+
durationInMonths: optionalPositiveInt(),
|
|
18160
|
+
products: z5.array(z5.object({ id: z5.string(), name: z5.string().optional() })),
|
|
18161
|
+
redeemBy: optionalDate(),
|
|
18162
|
+
maxRedemptions: optionalPositiveInt(),
|
|
18163
|
+
firstCode: couponCodeSchema(t)
|
|
18164
|
+
}).superRefine((values, ctx) => {
|
|
18165
|
+
const percentOff = parseOptionalDecimal(values.percentOff);
|
|
18166
|
+
if (values.discountType === "percent_off" && (percentOff === void 0 || percentOff < 0.01 || percentOff > 100))
|
|
18167
|
+
ctx.addIssue({
|
|
18168
|
+
code: "custom",
|
|
18169
|
+
path: ["percentOff"],
|
|
18170
|
+
message: t("billing.admin.coupons.errors.percentOff")
|
|
18171
|
+
});
|
|
18172
|
+
const amountOff = parseOptionalDecimal(values.amountOff);
|
|
18173
|
+
if (values.discountType === "amount_off" && (amountOff === void 0 || amountOff <= 0))
|
|
18174
|
+
ctx.addIssue({
|
|
18175
|
+
code: "custom",
|
|
18176
|
+
path: ["amountOff"],
|
|
18177
|
+
message: t("billing.admin.coupons.errors.amountOff")
|
|
18178
|
+
});
|
|
18179
|
+
if (values.duration === "repeating" && parseOptionalPositiveInt(values.durationInMonths) === void 0)
|
|
18180
|
+
ctx.addIssue({
|
|
18181
|
+
code: "custom",
|
|
18182
|
+
path: ["durationInMonths"],
|
|
18183
|
+
message: t("billing.admin.coupons.errors.durationInMonths")
|
|
18184
|
+
});
|
|
18185
|
+
}), "couponCreateSchema");
|
|
18186
|
+
function required(value, field) {
|
|
18187
|
+
if (value === void 0) throw new Error(`${field} is not set`);
|
|
18188
|
+
return value;
|
|
18189
|
+
}
|
|
18190
|
+
__name(required, "required");
|
|
18191
|
+
function toDiscountInput(values) {
|
|
18192
|
+
if (values.discountType === "percent_off")
|
|
18193
|
+
return { discountType: "percent_off", percentOff: required(parseOptionalDecimal(values.percentOff), "percentOff") };
|
|
18194
|
+
return {
|
|
18195
|
+
discountType: "amount_off",
|
|
18196
|
+
amountOff: Math.round(required(parseOptionalDecimal(values.amountOff), "amountOff") * 100),
|
|
18197
|
+
currency: values.currency
|
|
18198
|
+
};
|
|
18199
|
+
}
|
|
18200
|
+
__name(toDiscountInput, "toDiscountInput");
|
|
18201
|
+
function toDurationInput(values) {
|
|
18202
|
+
if (values.duration === "repeating")
|
|
18203
|
+
return {
|
|
18204
|
+
duration: "repeating",
|
|
18205
|
+
durationInMonths: required(parseOptionalPositiveInt(values.durationInMonths), "durationInMonths")
|
|
18206
|
+
};
|
|
18207
|
+
return { duration: values.duration };
|
|
18208
|
+
}
|
|
18209
|
+
__name(toDurationInput, "toDurationInput");
|
|
18210
|
+
function toCouponInput(values) {
|
|
18211
|
+
const payload = {
|
|
18212
|
+
id: values.id,
|
|
18213
|
+
name: values.name,
|
|
18214
|
+
firstCode: toCouponCodeInput(values.firstCode),
|
|
18215
|
+
...toDiscountInput(values),
|
|
18216
|
+
...toDurationInput(values)
|
|
18217
|
+
};
|
|
18218
|
+
if (values.stripeCouponId?.trim()) payload.stripeCouponId = values.stripeCouponId.trim();
|
|
18219
|
+
if (values.products.length > 0) payload.productIds = values.products.map((product) => product.id);
|
|
18220
|
+
if (values.redeemBy) payload.redeemBy = values.redeemBy;
|
|
18221
|
+
const maxRedemptions = parseOptionalPositiveInt(values.maxRedemptions);
|
|
18222
|
+
if (maxRedemptions !== void 0) payload.maxRedemptions = maxRedemptions;
|
|
18223
|
+
return payload;
|
|
18224
|
+
}
|
|
18225
|
+
__name(toCouponInput, "toCouponInput");
|
|
18226
|
+
function CouponRenameEditor({
|
|
18118
18227
|
coupon,
|
|
18119
18228
|
propagateChanges,
|
|
18120
18229
|
onSuccess,
|
|
@@ -18127,48 +18236,95 @@ function CouponEditorInternal({
|
|
|
18127
18236
|
const t = useTranslations73();
|
|
18128
18237
|
const fmt = useBillingFormatOptions();
|
|
18129
18238
|
const router = useI18nRouter();
|
|
18130
|
-
const {
|
|
18131
|
-
const
|
|
18132
|
-
const
|
|
18133
|
-
|
|
18134
|
-
|
|
18135
|
-
|
|
18136
|
-
|
|
18137
|
-
|
|
18138
|
-
|
|
18139
|
-
|
|
18140
|
-
|
|
18141
|
-
|
|
18142
|
-
|
|
18143
|
-
|
|
18144
|
-
|
|
18145
|
-
|
|
18146
|
-
|
|
18147
|
-
|
|
18148
|
-
|
|
18149
|
-
|
|
18150
|
-
|
|
18151
|
-
|
|
18152
|
-
|
|
18153
|
-
|
|
18154
|
-
|
|
18155
|
-
|
|
18156
|
-
|
|
18157
|
-
|
|
18158
|
-
|
|
18159
|
-
|
|
18160
|
-
|
|
18161
|
-
|
|
18162
|
-
|
|
18163
|
-
|
|
18164
|
-
|
|
18165
|
-
|
|
18166
|
-
|
|
18167
|
-
|
|
18168
|
-
|
|
18169
|
-
|
|
18239
|
+
const { renameCoupon } = useCouponContext();
|
|
18240
|
+
const formSchema = useMemo34(() => couponRenameSchema(t), [t]);
|
|
18241
|
+
const getDefaultValues = useCallback33(() => ({ id: coupon.id, name: coupon.name }), [coupon]);
|
|
18242
|
+
const form = useForm5({
|
|
18243
|
+
resolver: zodResolver5(formSchema),
|
|
18244
|
+
defaultValues: getDefaultValues()
|
|
18245
|
+
});
|
|
18246
|
+
return /* @__PURE__ */ jsx194(
|
|
18247
|
+
EditorSheet,
|
|
18248
|
+
{
|
|
18249
|
+
form,
|
|
18250
|
+
entityType: t("billing.admin.coupons.entity"),
|
|
18251
|
+
entityName: coupon.name,
|
|
18252
|
+
isEdit: true,
|
|
18253
|
+
module: couponPageModule(),
|
|
18254
|
+
size: "lg",
|
|
18255
|
+
propagateChanges,
|
|
18256
|
+
onSuccess,
|
|
18257
|
+
onNavigate: (url) => router.push(url),
|
|
18258
|
+
onSubmit: async (values) => await renameCoupon({ id: coupon.id, name: values.name }),
|
|
18259
|
+
onReset: getDefaultValues,
|
|
18260
|
+
trigger,
|
|
18261
|
+
forceShow,
|
|
18262
|
+
onClose,
|
|
18263
|
+
dialogOpen,
|
|
18264
|
+
onDialogOpenChange,
|
|
18265
|
+
children: /* @__PURE__ */ jsxs104("div", { className: "flex w-full flex-col gap-y-4", children: [
|
|
18266
|
+
/* @__PURE__ */ jsx194(
|
|
18267
|
+
FormInput,
|
|
18268
|
+
{
|
|
18269
|
+
form,
|
|
18270
|
+
id: "name",
|
|
18271
|
+
name: t("billing.admin.coupons.fields.name"),
|
|
18272
|
+
placeholder: t("billing.admin.coupons.placeholders.name"),
|
|
18273
|
+
isRequired: true
|
|
18274
|
+
}
|
|
18275
|
+
),
|
|
18276
|
+
/* @__PURE__ */ jsxs104("div", { className: "grid grid-cols-1 gap-4 md:grid-cols-2", children: [
|
|
18277
|
+
/* @__PURE__ */ jsx194(
|
|
18278
|
+
DetailField,
|
|
18279
|
+
{
|
|
18280
|
+
label: t("billing.admin.coupons.fields.discount"),
|
|
18281
|
+
value: /* @__PURE__ */ jsx194("span", { className: "tabular-nums", children: formatCouponDiscount(coupon, t, fmt) })
|
|
18282
|
+
}
|
|
18283
|
+
),
|
|
18284
|
+
/* @__PURE__ */ jsx194(
|
|
18285
|
+
DetailField,
|
|
18286
|
+
{
|
|
18287
|
+
label: t("billing.admin.coupons.fields.redeemBy"),
|
|
18288
|
+
value: /* @__PURE__ */ jsx194("span", { className: "tabular-nums", children: coupon.redeemBy ? formatDate2(coupon.redeemBy, fmt) : "\u2014" })
|
|
18289
|
+
}
|
|
18290
|
+
),
|
|
18291
|
+
/* @__PURE__ */ jsx194(
|
|
18292
|
+
DetailField,
|
|
18293
|
+
{
|
|
18294
|
+
label: t("billing.admin.coupons.fields.maxRedemptions"),
|
|
18295
|
+
value: /* @__PURE__ */ jsx194("span", { className: "tabular-nums", children: coupon.maxRedemptions ?? t("billing.admin.coupons.places.no_limit") })
|
|
18296
|
+
}
|
|
18297
|
+
),
|
|
18298
|
+
/* @__PURE__ */ jsx194(
|
|
18299
|
+
DetailField,
|
|
18300
|
+
{
|
|
18301
|
+
label: t("billing.admin.coupons.fields.stripeId"),
|
|
18302
|
+
value: /* @__PURE__ */ jsx194("span", { className: "tabular-nums", children: coupon.stripeCouponId })
|
|
18303
|
+
}
|
|
18304
|
+
)
|
|
18305
|
+
] }),
|
|
18306
|
+
/* @__PURE__ */ jsx194("p", { className: "text-muted-foreground text-xs/relaxed", children: t("billing.admin.coupons.fixed_notice") })
|
|
18307
|
+
] })
|
|
18308
|
+
}
|
|
18309
|
+
);
|
|
18310
|
+
}
|
|
18311
|
+
__name(CouponRenameEditor, "CouponRenameEditor");
|
|
18312
|
+
function CouponCreateEditor({
|
|
18313
|
+
propagateChanges,
|
|
18314
|
+
onSuccess,
|
|
18315
|
+
trigger,
|
|
18316
|
+
forceShow,
|
|
18317
|
+
onClose,
|
|
18318
|
+
dialogOpen,
|
|
18319
|
+
onDialogOpenChange
|
|
18320
|
+
}) {
|
|
18321
|
+
const t = useTranslations73();
|
|
18322
|
+
const router = useI18nRouter();
|
|
18323
|
+
const { createCoupon } = useCouponContext();
|
|
18324
|
+
const [now] = useState63(() => /* @__PURE__ */ new Date());
|
|
18325
|
+
const formSchema = useMemo34(() => couponCreateSchema(t), [t]);
|
|
18170
18326
|
const getDefaultValues = useCallback33(
|
|
18171
|
-
() =>
|
|
18327
|
+
() => ({
|
|
18172
18328
|
id: v45(),
|
|
18173
18329
|
name: "",
|
|
18174
18330
|
stripeCouponId: "",
|
|
@@ -18183,8 +18339,8 @@ function CouponEditorInternal({
|
|
|
18183
18339
|
redeemBy: void 0,
|
|
18184
18340
|
maxRedemptions: "",
|
|
18185
18341
|
firstCode: couponCodeDefaults()
|
|
18186
|
-
},
|
|
18187
|
-
[
|
|
18342
|
+
}),
|
|
18343
|
+
[]
|
|
18188
18344
|
);
|
|
18189
18345
|
const form = useForm5({
|
|
18190
18346
|
resolver: zodResolver5(formSchema),
|
|
@@ -18206,34 +18362,13 @@ function CouponEditorInternal({
|
|
|
18206
18362
|
{
|
|
18207
18363
|
form,
|
|
18208
18364
|
entityType: t("billing.admin.coupons.entity"),
|
|
18209
|
-
|
|
18210
|
-
|
|
18211
|
-
module: Modules.StripeCoupon,
|
|
18365
|
+
isEdit: false,
|
|
18366
|
+
module: couponPageModule(),
|
|
18212
18367
|
size: "lg",
|
|
18213
18368
|
propagateChanges,
|
|
18214
18369
|
onSuccess,
|
|
18215
18370
|
onNavigate: (url) => router.push(url),
|
|
18216
|
-
onSubmit: async (values) =>
|
|
18217
|
-
if (isEdit) return await renameCoupon({ id: coupon.id, name: values.name });
|
|
18218
|
-
const payload = {
|
|
18219
|
-
id: values.id,
|
|
18220
|
-
name: values.name,
|
|
18221
|
-
discountType: values.discountType,
|
|
18222
|
-
duration: values.duration,
|
|
18223
|
-
firstCode: toCouponCodeInput(values.firstCode)
|
|
18224
|
-
};
|
|
18225
|
-
if (values.stripeCouponId?.trim()) payload.stripeCouponId = values.stripeCouponId.trim();
|
|
18226
|
-
if (values.discountType === "percent_off") payload.percentOff = values.percentOff;
|
|
18227
|
-
else {
|
|
18228
|
-
payload.amountOff = Math.round(values.amountOff * 100);
|
|
18229
|
-
payload.currency = values.currency;
|
|
18230
|
-
}
|
|
18231
|
-
if (values.duration === "repeating") payload.durationInMonths = values.durationInMonths;
|
|
18232
|
-
if (values.products.length > 0) payload.productIds = values.products.map((p) => p.id);
|
|
18233
|
-
if (values.redeemBy) payload.redeemBy = values.redeemBy;
|
|
18234
|
-
if (values.maxRedemptions !== void 0) payload.maxRedemptions = values.maxRedemptions;
|
|
18235
|
-
return await createCoupon(payload);
|
|
18236
|
-
},
|
|
18371
|
+
onSubmit: async (values) => await createCoupon(toCouponInput(values)),
|
|
18237
18372
|
onReset: getDefaultValues,
|
|
18238
18373
|
trigger,
|
|
18239
18374
|
forceShow,
|
|
@@ -18251,152 +18386,118 @@ function CouponEditorInternal({
|
|
|
18251
18386
|
isRequired: true
|
|
18252
18387
|
}
|
|
18253
18388
|
),
|
|
18254
|
-
|
|
18255
|
-
|
|
18256
|
-
|
|
18257
|
-
|
|
18258
|
-
|
|
18259
|
-
|
|
18260
|
-
|
|
18261
|
-
|
|
18262
|
-
|
|
18263
|
-
|
|
18264
|
-
|
|
18265
|
-
|
|
18266
|
-
|
|
18267
|
-
|
|
18268
|
-
|
|
18269
|
-
|
|
18270
|
-
|
|
18271
|
-
|
|
18272
|
-
|
|
18273
|
-
|
|
18274
|
-
|
|
18275
|
-
|
|
18276
|
-
|
|
18277
|
-
|
|
18278
|
-
|
|
18279
|
-
|
|
18280
|
-
|
|
18281
|
-
|
|
18282
|
-
|
|
18283
|
-
)
|
|
18284
|
-
] }),
|
|
18285
|
-
/* @__PURE__ */ jsx194("p", { className: "text-muted-foreground text-xs/relaxed", children: t("billing.admin.coupons.fixed_notice") })
|
|
18286
|
-
] }) : /* @__PURE__ */ jsxs104(Fragment29, { children: [
|
|
18389
|
+
/* @__PURE__ */ jsx194(
|
|
18390
|
+
FormInput,
|
|
18391
|
+
{
|
|
18392
|
+
form,
|
|
18393
|
+
id: "stripeCouponId",
|
|
18394
|
+
name: t("billing.admin.coupons.fields.stripeCouponId"),
|
|
18395
|
+
placeholder: t("billing.admin.coupons.placeholders.stripeCouponId")
|
|
18396
|
+
}
|
|
18397
|
+
),
|
|
18398
|
+
/* @__PURE__ */ jsx194(
|
|
18399
|
+
FormSelect,
|
|
18400
|
+
{
|
|
18401
|
+
form,
|
|
18402
|
+
id: "discountType",
|
|
18403
|
+
name: t("billing.admin.coupons.fields.discountType"),
|
|
18404
|
+
values: discountTypeOptions
|
|
18405
|
+
}
|
|
18406
|
+
),
|
|
18407
|
+
watchDiscountType === "percent_off" ? /* @__PURE__ */ jsx194(
|
|
18408
|
+
FormInput,
|
|
18409
|
+
{
|
|
18410
|
+
form,
|
|
18411
|
+
id: "percentOff",
|
|
18412
|
+
type: "decimal",
|
|
18413
|
+
name: t("billing.admin.coupons.fields.percentOff"),
|
|
18414
|
+
placeholder: t("billing.admin.coupons.placeholders.percentOff"),
|
|
18415
|
+
isRequired: true
|
|
18416
|
+
}
|
|
18417
|
+
) : /* @__PURE__ */ jsxs104("div", { className: "grid grid-cols-2 gap-x-4", children: [
|
|
18287
18418
|
/* @__PURE__ */ jsx194(
|
|
18288
18419
|
FormInput,
|
|
18289
18420
|
{
|
|
18290
18421
|
form,
|
|
18291
|
-
id: "
|
|
18292
|
-
name: t("billing.admin.coupons.fields.stripeCouponId"),
|
|
18293
|
-
placeholder: t("billing.admin.coupons.placeholders.stripeCouponId")
|
|
18294
|
-
}
|
|
18295
|
-
),
|
|
18296
|
-
/* @__PURE__ */ jsx194(
|
|
18297
|
-
FormSelect,
|
|
18298
|
-
{
|
|
18299
|
-
form,
|
|
18300
|
-
id: "discountType",
|
|
18301
|
-
name: t("billing.admin.coupons.fields.discountType"),
|
|
18302
|
-
values: discountTypeOptions
|
|
18303
|
-
}
|
|
18304
|
-
),
|
|
18305
|
-
watchDiscountType === "percent_off" ? /* @__PURE__ */ jsx194(
|
|
18306
|
-
FormInput,
|
|
18307
|
-
{
|
|
18308
|
-
form,
|
|
18309
|
-
id: "percentOff",
|
|
18422
|
+
id: "amountOff",
|
|
18310
18423
|
type: "decimal",
|
|
18311
|
-
name: t("billing.admin.coupons.fields.
|
|
18312
|
-
placeholder: t("billing.admin.coupons.placeholders.
|
|
18424
|
+
name: t("billing.admin.coupons.fields.amountOff"),
|
|
18425
|
+
placeholder: t("billing.admin.coupons.placeholders.amountOff"),
|
|
18313
18426
|
isRequired: true
|
|
18314
18427
|
}
|
|
18315
|
-
)
|
|
18316
|
-
/* @__PURE__ */ jsx194(
|
|
18317
|
-
FormInput,
|
|
18318
|
-
{
|
|
18319
|
-
form,
|
|
18320
|
-
id: "amountOff",
|
|
18321
|
-
type: "decimal",
|
|
18322
|
-
name: t("billing.admin.coupons.fields.amountOff"),
|
|
18323
|
-
placeholder: t("billing.admin.coupons.placeholders.amountOff"),
|
|
18324
|
-
isRequired: true
|
|
18325
|
-
}
|
|
18326
|
-
),
|
|
18327
|
-
/* @__PURE__ */ jsx194(
|
|
18328
|
-
FormSelect,
|
|
18329
|
-
{
|
|
18330
|
-
form,
|
|
18331
|
-
id: "currency",
|
|
18332
|
-
name: t("billing.admin.coupons.fields.currency"),
|
|
18333
|
-
values: couponCurrencyOptions,
|
|
18334
|
-
isRequired: true
|
|
18335
|
-
}
|
|
18336
|
-
)
|
|
18337
|
-
] }),
|
|
18428
|
+
),
|
|
18338
18429
|
/* @__PURE__ */ jsx194(
|
|
18339
18430
|
FormSelect,
|
|
18340
18431
|
{
|
|
18341
18432
|
form,
|
|
18342
|
-
id: "
|
|
18343
|
-
name: t("billing.admin.coupons.fields.
|
|
18344
|
-
values:
|
|
18345
|
-
}
|
|
18346
|
-
),
|
|
18347
|
-
watchDuration === "repeating" && /* @__PURE__ */ jsx194(
|
|
18348
|
-
FormInput,
|
|
18349
|
-
{
|
|
18350
|
-
form,
|
|
18351
|
-
id: "durationInMonths",
|
|
18352
|
-
type: "number",
|
|
18353
|
-
name: t("billing.admin.coupons.fields.durationInMonths"),
|
|
18354
|
-
placeholder: t("billing.admin.coupons.placeholders.durationInMonths"),
|
|
18433
|
+
id: "currency",
|
|
18434
|
+
name: t("billing.admin.coupons.fields.currency"),
|
|
18435
|
+
values: couponCurrencyOptions,
|
|
18355
18436
|
isRequired: true
|
|
18356
18437
|
}
|
|
18357
|
-
)
|
|
18358
|
-
|
|
18359
|
-
|
|
18360
|
-
|
|
18361
|
-
|
|
18362
|
-
|
|
18363
|
-
|
|
18364
|
-
|
|
18365
|
-
|
|
18366
|
-
|
|
18367
|
-
|
|
18368
|
-
|
|
18369
|
-
|
|
18370
|
-
|
|
18371
|
-
|
|
18372
|
-
|
|
18373
|
-
|
|
18374
|
-
|
|
18375
|
-
|
|
18376
|
-
|
|
18377
|
-
|
|
18378
|
-
|
|
18379
|
-
|
|
18380
|
-
|
|
18381
|
-
|
|
18382
|
-
|
|
18383
|
-
|
|
18384
|
-
|
|
18385
|
-
|
|
18386
|
-
|
|
18387
|
-
|
|
18388
|
-
|
|
18389
|
-
|
|
18390
|
-
|
|
18391
|
-
|
|
18392
|
-
|
|
18438
|
+
)
|
|
18439
|
+
] }),
|
|
18440
|
+
/* @__PURE__ */ jsx194(
|
|
18441
|
+
FormSelect,
|
|
18442
|
+
{
|
|
18443
|
+
form,
|
|
18444
|
+
id: "duration",
|
|
18445
|
+
name: t("billing.admin.coupons.fields.duration"),
|
|
18446
|
+
values: durationOptions
|
|
18447
|
+
}
|
|
18448
|
+
),
|
|
18449
|
+
watchDuration === "repeating" && /* @__PURE__ */ jsx194(
|
|
18450
|
+
FormInput,
|
|
18451
|
+
{
|
|
18452
|
+
form,
|
|
18453
|
+
id: "durationInMonths",
|
|
18454
|
+
type: "number",
|
|
18455
|
+
name: t("billing.admin.coupons.fields.durationInMonths"),
|
|
18456
|
+
placeholder: t("billing.admin.coupons.placeholders.durationInMonths"),
|
|
18457
|
+
isRequired: true
|
|
18458
|
+
}
|
|
18459
|
+
),
|
|
18460
|
+
/* @__PURE__ */ jsx194(
|
|
18461
|
+
EntityMultiSelector,
|
|
18462
|
+
{
|
|
18463
|
+
id: "products",
|
|
18464
|
+
form,
|
|
18465
|
+
label: t("billing.admin.coupons.fields.products"),
|
|
18466
|
+
description: t("billing.admin.coupons.help.products"),
|
|
18467
|
+
retriever: (params) => StripeProductService.listProducts(params),
|
|
18468
|
+
module: Modules.StripeProduct,
|
|
18469
|
+
getLabel: (product) => product.name
|
|
18470
|
+
}
|
|
18471
|
+
),
|
|
18472
|
+
/* @__PURE__ */ jsx194(
|
|
18473
|
+
FormDateTime,
|
|
18474
|
+
{
|
|
18475
|
+
form,
|
|
18476
|
+
id: "redeemBy",
|
|
18477
|
+
name: t("billing.admin.coupons.fields.redeemBy"),
|
|
18478
|
+
minDate: now,
|
|
18479
|
+
allowEmpty: true
|
|
18480
|
+
}
|
|
18481
|
+
),
|
|
18482
|
+
/* @__PURE__ */ jsx194(
|
|
18483
|
+
FormInput,
|
|
18484
|
+
{
|
|
18485
|
+
form,
|
|
18486
|
+
id: "maxRedemptions",
|
|
18487
|
+
type: "number",
|
|
18488
|
+
name: t("billing.admin.coupons.fields.maxRedemptions"),
|
|
18489
|
+
placeholder: t("billing.admin.coupons.placeholders.maxRedemptions")
|
|
18490
|
+
}
|
|
18491
|
+
),
|
|
18492
|
+
/* @__PURE__ */ jsx194(SectionHeader, { children: t("billing.admin.coupons.first_code") }),
|
|
18493
|
+
/* @__PURE__ */ jsx194(CouponCodeFields, { form, prefix: "firstCode." })
|
|
18393
18494
|
] })
|
|
18394
18495
|
}
|
|
18395
18496
|
);
|
|
18396
18497
|
}
|
|
18397
|
-
__name(
|
|
18498
|
+
__name(CouponCreateEditor, "CouponCreateEditor");
|
|
18398
18499
|
function CouponEditor(props) {
|
|
18399
|
-
return /* @__PURE__ */ jsx194(
|
|
18500
|
+
return props.coupon ? /* @__PURE__ */ jsx194(CouponRenameEditor, { ...props, coupon: props.coupon }) : /* @__PURE__ */ jsx194(CouponCreateEditor, { ...props });
|
|
18400
18501
|
}
|
|
18401
18502
|
__name(CouponEditor, "CouponEditor");
|
|
18402
18503
|
|
|
@@ -18431,10 +18532,10 @@ var CouponProvider = /* @__PURE__ */ __name(({ children, dehydratedCoupon, publi
|
|
|
18431
18532
|
const t = useTranslations74();
|
|
18432
18533
|
const generateUrl = usePageUrlGenerator();
|
|
18433
18534
|
const { hasRole } = useCurrentUserContext();
|
|
18434
|
-
const [coupon, setCoupon] =
|
|
18535
|
+
const [coupon, setCoupon] = useState64(
|
|
18435
18536
|
dehydratedCoupon ? rehydrate(Modules.StripeCoupon, dehydratedCoupon) : void 0
|
|
18436
18537
|
);
|
|
18437
|
-
const [catalogueVersion, setCatalogueVersion] =
|
|
18538
|
+
const [catalogueVersion, setCatalogueVersion] = useState64(0);
|
|
18438
18539
|
const refreshCatalogue = useCallback34(() => setCatalogueVersion((value2) => value2 + 1), []);
|
|
18439
18540
|
const reloadCoupon = useCallback34(async () => {
|
|
18440
18541
|
if (!coupon?.id) return;
|
|
@@ -18542,18 +18643,18 @@ var useCouponContext = /* @__PURE__ */ __name(() => useContext28(CouponContext)
|
|
|
18542
18643
|
// src/features/billing/stripe-coupon/components/widgets/CouponCodeActions.tsx
|
|
18543
18644
|
import { PowerIcon, RotateCcwIcon } from "lucide-react";
|
|
18544
18645
|
import { useTranslations as useTranslations75 } from "next-intl";
|
|
18545
|
-
import { useState as
|
|
18646
|
+
import { useState as useState65 } from "react";
|
|
18546
18647
|
import { jsx as jsx196, jsxs as jsxs105 } from "react/jsx-runtime";
|
|
18547
18648
|
function CouponCodeActions({ code, status }) {
|
|
18548
18649
|
const t = useTranslations75();
|
|
18549
18650
|
const { updateCodeFlags } = useCouponContext();
|
|
18550
|
-
const [open, setOpen] =
|
|
18551
|
-
const [pending, setPending] =
|
|
18651
|
+
const [open, setOpen] = useState65(false);
|
|
18652
|
+
const [pending, setPending] = useState65(false);
|
|
18552
18653
|
const isDead = status === "expired" || status === "used_up";
|
|
18553
18654
|
const isInactive = !code.active;
|
|
18554
18655
|
const scope = isInactive ? "reactivate" : "deactivate";
|
|
18555
18656
|
return /* @__PURE__ */ jsxs105("div", { className: "flex items-center justify-end gap-x-4", children: [
|
|
18556
|
-
/* @__PURE__ */ jsxs105(
|
|
18657
|
+
/* @__PURE__ */ jsxs105(FieldLabel, { children: [
|
|
18557
18658
|
/* @__PURE__ */ jsx196(
|
|
18558
18659
|
Switch,
|
|
18559
18660
|
{
|
|
@@ -18603,8 +18704,8 @@ __name(CouponCodeActions, "CouponCodeActions");
|
|
|
18603
18704
|
|
|
18604
18705
|
// src/features/billing/stripe-coupon/hooks/useStripeCouponCodeTableStructure.tsx
|
|
18605
18706
|
import { jsx as jsx197 } from "react/jsx-runtime";
|
|
18606
|
-
function couponCodeStatus(code, coupon) {
|
|
18607
|
-
if (code.expiresAt && code.expiresAt.getTime() <=
|
|
18707
|
+
function couponCodeStatus(code, coupon, now) {
|
|
18708
|
+
if (code.expiresAt && code.expiresAt.getTime() <= now.getTime()) return "expired";
|
|
18608
18709
|
const left = couponPlacesLeft(code, coupon ?? { maxRedemptions: void 0, timesRedeemed: 0 });
|
|
18609
18710
|
if (left === 0) return "used_up";
|
|
18610
18711
|
return code.active ? "active" : "inactive";
|
|
@@ -18620,6 +18721,7 @@ var useStripeCouponCodeTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
18620
18721
|
const t = useTranslations76();
|
|
18621
18722
|
const fmt = useBillingFormatOptions();
|
|
18622
18723
|
const { coupon } = useCouponContext();
|
|
18724
|
+
const [now] = useState66(() => /* @__PURE__ */ new Date());
|
|
18623
18725
|
const tableData = useMemo36(() => {
|
|
18624
18726
|
return params.data.map((code) => {
|
|
18625
18727
|
const entry = { jsonApiData: code };
|
|
@@ -18636,7 +18738,7 @@ var useStripeCouponCodeTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
18636
18738
|
header: t("billing.admin.coupons.fields.code"),
|
|
18637
18739
|
cell: /* @__PURE__ */ __name(({ row }) => {
|
|
18638
18740
|
const code = row.original.jsonApiData;
|
|
18639
|
-
return /* @__PURE__ */ jsx197("span", { className: "text-xs
|
|
18741
|
+
return /* @__PURE__ */ jsx197("span", { className: "text-xs", children: code.code });
|
|
18640
18742
|
}, "cell"),
|
|
18641
18743
|
enableSorting: false,
|
|
18642
18744
|
enableHiding: false
|
|
@@ -18683,7 +18785,7 @@ var useStripeCouponCodeTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
18683
18785
|
header: t("billing.admin.coupons.fields.status"),
|
|
18684
18786
|
cell: /* @__PURE__ */ __name(({ row }) => {
|
|
18685
18787
|
const code = row.original.jsonApiData;
|
|
18686
|
-
const status = couponCodeStatus(code, code.coupon ?? coupon);
|
|
18788
|
+
const status = couponCodeStatus(code, code.coupon ?? coupon, now);
|
|
18687
18789
|
return /* @__PURE__ */ jsx197(Badge, { variant: STATUS_VARIANT[status], children: t(`billing.admin.coupons.codes.status.${status}`) });
|
|
18688
18790
|
}, "cell"),
|
|
18689
18791
|
enableSorting: false,
|
|
@@ -18695,7 +18797,7 @@ var useStripeCouponCodeTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
18695
18797
|
header: "",
|
|
18696
18798
|
cell: /* @__PURE__ */ __name(({ row }) => {
|
|
18697
18799
|
const code = row.original.jsonApiData;
|
|
18698
|
-
return /* @__PURE__ */ jsx197(CouponCodeActions, { code, status: couponCodeStatus(code, code.coupon ?? coupon) });
|
|
18800
|
+
return /* @__PURE__ */ jsx197(CouponCodeActions, { code, status: couponCodeStatus(code, code.coupon ?? coupon, now) });
|
|
18699
18801
|
}, "cell"),
|
|
18700
18802
|
enableSorting: false,
|
|
18701
18803
|
enableHiding: false
|
|
@@ -18703,7 +18805,7 @@ var useStripeCouponCodeTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
18703
18805
|
};
|
|
18704
18806
|
const columns = useMemo36(() => {
|
|
18705
18807
|
return params.fields.map((field) => fieldColumnMap[field]?.()).filter((col) => col !== void 0);
|
|
18706
|
-
}, [params.fields, fieldColumnMap, t, coupon]);
|
|
18808
|
+
}, [params.fields, fieldColumnMap, t, coupon, now]);
|
|
18707
18809
|
return useMemo36(() => ({ data: tableData, columns }), [tableData, columns]);
|
|
18708
18810
|
}, "useStripeCouponCodeTableStructure");
|
|
18709
18811
|
registerTableGenerator("stripe-coupon-codes", useStripeCouponCodeTableStructure);
|
|
@@ -18849,7 +18951,7 @@ var useWaitlistTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
18849
18951
|
// src/features/content/hooks/useContentTableStructure.tsx
|
|
18850
18952
|
import { useTranslations as useTranslations78 } from "next-intl";
|
|
18851
18953
|
import { useMemo as useMemo38 } from "react";
|
|
18852
|
-
import { Fragment as
|
|
18954
|
+
import { Fragment as Fragment29, jsx as jsx199, jsxs as jsxs107 } from "react/jsx-runtime";
|
|
18853
18955
|
var useContentTableStructure = /* @__PURE__ */ __name((params) => {
|
|
18854
18956
|
const t = useTranslations78();
|
|
18855
18957
|
const generateUrl = usePageUrlGenerator();
|
|
@@ -18880,7 +18982,7 @@ var useContentTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
18880
18982
|
const contentModule = content.contentType ? Modules.findByModelName(content.contentType) : void 0;
|
|
18881
18983
|
const link = contentModule ? generateUrl({ page: contentModule, id: content.id }) : "#";
|
|
18882
18984
|
return /* @__PURE__ */ jsxs107(Tooltip2, { children: [
|
|
18883
|
-
/* @__PURE__ */ jsx199(TooltipTrigger, { className: "flex items-center justify-start space-x-2", children: /* @__PURE__ */ jsxs107(
|
|
18985
|
+
/* @__PURE__ */ jsx199(TooltipTrigger, { className: "flex items-center justify-start space-x-2", children: /* @__PURE__ */ jsxs107(Fragment29, { children: [
|
|
18884
18986
|
contentModule && getIconByModule({ module: contentModule, className: "h-4 w-4" }),
|
|
18885
18987
|
/* @__PURE__ */ jsx199(Link, { href: link, children: content.name })
|
|
18886
18988
|
] }) }),
|
|
@@ -18896,7 +18998,7 @@ var useContentTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
18896
18998
|
header: t(`common.relevance`),
|
|
18897
18999
|
cell: /* @__PURE__ */ __name(({ row }) => {
|
|
18898
19000
|
const content = row.original.jsonApiData;
|
|
18899
|
-
if (!content.relevance) return /* @__PURE__ */ jsx199(
|
|
19001
|
+
if (!content.relevance) return /* @__PURE__ */ jsx199(Fragment29, {});
|
|
18900
19002
|
const response = `${content.relevance.toFixed(0)}%`;
|
|
18901
19003
|
return /* @__PURE__ */ jsxs107("div", { className: "relative flex h-5 w-20 items-center justify-center overflow-clip rounded border text-center", children: [
|
|
18902
19004
|
/* @__PURE__ */ jsx199(
|
|
@@ -19072,7 +19174,7 @@ __name(useOAuthClients, "useOAuthClients");
|
|
|
19072
19174
|
// src/features/oauth/hooks/useOAuthClient.ts
|
|
19073
19175
|
import { useTranslations as useTranslations80 } from "next-intl";
|
|
19074
19176
|
import { useAtomValue as useAtomValue2, useSetAtom as useSetAtom2 } from "jotai";
|
|
19075
|
-
import { useCallback as useCallback36, useEffect as useEffect52, useRef as useRef34, useState as
|
|
19177
|
+
import { useCallback as useCallback36, useEffect as useEffect52, useRef as useRef34, useState as useState67 } from "react";
|
|
19076
19178
|
function useOAuthClient(clientId) {
|
|
19077
19179
|
const storedClient = useAtomValue2(oauthClientByIdAtom(clientId));
|
|
19078
19180
|
const updateClientInStore = useSetAtom2(updateOAuthClientAtom);
|
|
@@ -19081,9 +19183,9 @@ function useOAuthClient(clientId) {
|
|
|
19081
19183
|
const t = useTranslations80();
|
|
19082
19184
|
const tRef = useRef34(t);
|
|
19083
19185
|
tRef.current = t;
|
|
19084
|
-
const [fetchedClient, setFetchedClient] =
|
|
19085
|
-
const [isLoading, setIsLoading] =
|
|
19086
|
-
const [error, setError] =
|
|
19186
|
+
const [fetchedClient, setFetchedClient] = useState67(null);
|
|
19187
|
+
const [isLoading, setIsLoading] = useState67(false);
|
|
19188
|
+
const [error, setError] = useState67(null);
|
|
19087
19189
|
const client = storedClient || fetchedClient;
|
|
19088
19190
|
const fetchClient = useCallback36(async () => {
|
|
19089
19191
|
if (!clientId) return;
|
|
@@ -19174,13 +19276,13 @@ __name(useOAuthClient, "useOAuthClient");
|
|
|
19174
19276
|
|
|
19175
19277
|
// src/features/oauth/hooks/useOAuthConsent.ts
|
|
19176
19278
|
import { useTranslations as useTranslations81 } from "next-intl";
|
|
19177
|
-
import { useCallback as useCallback37, useEffect as useEffect53, useRef as useRef35, useState as
|
|
19279
|
+
import { useCallback as useCallback37, useEffect as useEffect53, useRef as useRef35, useState as useState68 } from "react";
|
|
19178
19280
|
function useOAuthConsent(params, options) {
|
|
19179
|
-
const [clientInfo, setClientInfo] =
|
|
19180
|
-
const [isLoading, setIsLoading] =
|
|
19181
|
-
const [error, setError] =
|
|
19182
|
-
const [isSubmitting, setIsSubmitting] =
|
|
19183
|
-
const [companyId, setCompanyId] =
|
|
19281
|
+
const [clientInfo, setClientInfo] = useState68(null);
|
|
19282
|
+
const [isLoading, setIsLoading] = useState68(true);
|
|
19283
|
+
const [error, setError] = useState68(null);
|
|
19284
|
+
const [isSubmitting, setIsSubmitting] = useState68(false);
|
|
19285
|
+
const [companyId, setCompanyId] = useState68(void 0);
|
|
19184
19286
|
const contextCompanyId = useCurrentUserContextOptional()?.company?.id;
|
|
19185
19287
|
const currentCompanyId = options?.defaultCompanyId ?? contextCompanyId;
|
|
19186
19288
|
const t = useTranslations81();
|
|
@@ -19298,20 +19400,20 @@ registerTableGenerator("waitlists", useWaitlistTableStructure);
|
|
|
19298
19400
|
import { flexRender, getCoreRowModel, getExpandedRowModel, useReactTable } from "@tanstack/react-table";
|
|
19299
19401
|
import { ChevronLeft, ChevronRight, Loader2 as Loader23 } from "lucide-react";
|
|
19300
19402
|
import { useTranslations as useTranslations84 } from "next-intl";
|
|
19301
|
-
import React31, { memo, useMemo as useMemo39, useState as
|
|
19403
|
+
import React31, { memo, useMemo as useMemo39, useState as useState70 } from "react";
|
|
19302
19404
|
|
|
19303
19405
|
// src/components/tables/ContentTableSearch.tsx
|
|
19304
19406
|
import { RefreshCw, Search, X as X3 } from "lucide-react";
|
|
19305
19407
|
import { useTranslations as useTranslations83 } from "next-intl";
|
|
19306
|
-
import { useCallback as useCallback39, useEffect as useEffect54, useRef as useRef36, useState as
|
|
19408
|
+
import { useCallback as useCallback39, useEffect as useEffect54, useRef as useRef36, useState as useState69 } from "react";
|
|
19307
19409
|
import { jsx as jsx200, jsxs as jsxs108 } from "react/jsx-runtime";
|
|
19308
19410
|
function ContentTableSearch({ data }) {
|
|
19309
19411
|
const t = useTranslations83();
|
|
19310
19412
|
const searchTermRef = useRef36("");
|
|
19311
19413
|
const inputRef = useRef36(null);
|
|
19312
|
-
const [searchTerm, setSearchTerm] =
|
|
19313
|
-
const [isFocused, setIsFocused] =
|
|
19314
|
-
const [isSearching, setIsSearching] =
|
|
19414
|
+
const [searchTerm, setSearchTerm] = useState69("");
|
|
19415
|
+
const [isFocused, setIsFocused] = useState69(false);
|
|
19416
|
+
const [isSearching, setIsSearching] = useState69(false);
|
|
19315
19417
|
const isExpanded = isFocused || searchTerm.length > 0;
|
|
19316
19418
|
const search = useCallback39(
|
|
19317
19419
|
async (searchedTerm) => {
|
|
@@ -19406,7 +19508,7 @@ function ContentTableSearch({ data }) {
|
|
|
19406
19508
|
__name(ContentTableSearch, "ContentTableSearch");
|
|
19407
19509
|
|
|
19408
19510
|
// src/components/tables/ContentListTable.tsx
|
|
19409
|
-
import { Fragment as
|
|
19511
|
+
import { Fragment as Fragment30, jsx as jsx201, jsxs as jsxs109 } from "react/jsx-runtime";
|
|
19410
19512
|
var EMPTY_ARRAY = [];
|
|
19411
19513
|
function getGroupKeys(item, field) {
|
|
19412
19514
|
const value = item.jsonApiData[field];
|
|
@@ -19421,7 +19523,7 @@ function getGroupKeys(item, field) {
|
|
|
19421
19523
|
__name(getGroupKeys, "getGroupKeys");
|
|
19422
19524
|
var isClassComponent = /* @__PURE__ */ __name((component) => typeof component === "function" && !!component.prototype?.isReactComponent, "isClassComponent");
|
|
19423
19525
|
function StableCell({ render, context }) {
|
|
19424
|
-
return /* @__PURE__ */ jsx201(
|
|
19526
|
+
return /* @__PURE__ */ jsx201(Fragment30, { children: render(context) });
|
|
19425
19527
|
}
|
|
19426
19528
|
__name(StableCell, "StableCell");
|
|
19427
19529
|
function renderCell(cellDef, context) {
|
|
@@ -19435,10 +19537,10 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
|
|
|
19435
19537
|
const { data, fields, checkedIds, toggleId, allowSearch, filters: _filters, fullWidth, onRowClick } = props;
|
|
19436
19538
|
const t = useTranslations84();
|
|
19437
19539
|
const isMobile = useIsMobile();
|
|
19438
|
-
const [expanded, setExpanded] =
|
|
19540
|
+
const [expanded, setExpanded] = useState70(
|
|
19439
19541
|
props.defaultExpanded === true ? true : typeof props.defaultExpanded === "object" ? props.defaultExpanded : {}
|
|
19440
19542
|
);
|
|
19441
|
-
const [pendingDirection, setPendingDirection] =
|
|
19543
|
+
const [pendingDirection, setPendingDirection] = useState70(null);
|
|
19442
19544
|
React31.useEffect(() => {
|
|
19443
19545
|
if (data.isLoaded) setPendingDirection(null);
|
|
19444
19546
|
}, [data.isLoaded]);
|
|
@@ -19537,7 +19639,7 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
|
|
|
19537
19639
|
}
|
|
19538
19640
|
);
|
|
19539
19641
|
const hasTitleControls = !!(props.functions || props.filters || allowSearch);
|
|
19540
|
-
const titleControls = /* @__PURE__ */ jsxs109(
|
|
19642
|
+
const titleControls = /* @__PURE__ */ jsxs109(Fragment30, { children: [
|
|
19541
19643
|
props.filters,
|
|
19542
19644
|
props.functions,
|
|
19543
19645
|
allowSearch !== false && /* @__PURE__ */ jsx201(ContentTableSearch, { data })
|
|
@@ -19639,7 +19741,7 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
|
|
|
19639
19741
|
|
|
19640
19742
|
// src/components/grids/ContentListGrid.tsx
|
|
19641
19743
|
import { useEffect as useEffect55, useRef as useRef37 } from "react";
|
|
19642
|
-
import { Fragment as
|
|
19744
|
+
import { Fragment as Fragment31, jsx as jsx202, jsxs as jsxs110 } from "react/jsx-runtime";
|
|
19643
19745
|
var DEFAULT_GRID_CLASSES = "grid grid-cols-2 gap-4 p-4 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5";
|
|
19644
19746
|
function ContentListGrid(props) {
|
|
19645
19747
|
const { data, ItemComponent, allowSearch, fullWidth, gridClassName } = props;
|
|
@@ -19670,7 +19772,7 @@ function ContentListGrid(props) {
|
|
|
19670
19772
|
]
|
|
19671
19773
|
}
|
|
19672
19774
|
) }),
|
|
19673
|
-
(props.functions || props.filters || allowSearch) && /* @__PURE__ */ jsxs110(
|
|
19775
|
+
(props.functions || props.filters || allowSearch) && /* @__PURE__ */ jsxs110(Fragment31, { children: [
|
|
19674
19776
|
props.functions,
|
|
19675
19777
|
props.filters,
|
|
19676
19778
|
allowSearch && /* @__PURE__ */ jsx202(ContentTableSearch, { data })
|
|
@@ -19687,15 +19789,15 @@ __name(ContentListGrid, "ContentListGrid");
|
|
|
19687
19789
|
|
|
19688
19790
|
// src/components/fiscal/ItalianFiscalData.tsx
|
|
19689
19791
|
import { useTranslations as useTranslations85 } from "next-intl";
|
|
19690
|
-
import { forwardRef as forwardRef8, useCallback as useCallback40, useImperativeHandle as useImperativeHandle2, useRef as useRef38, useState as
|
|
19792
|
+
import { forwardRef as forwardRef8, useCallback as useCallback40, useImperativeHandle as useImperativeHandle2, useRef as useRef38, useState as useState71 } from "react";
|
|
19691
19793
|
import { z as z6 } from "zod";
|
|
19692
19794
|
import { jsx as jsx203, jsxs as jsxs111 } from "react/jsx-runtime";
|
|
19693
19795
|
var ItalianFiscalData = forwardRef8(/* @__PURE__ */ __name(function ItalianFiscalData2({ initialData }, ref) {
|
|
19694
19796
|
const t = useTranslations85();
|
|
19695
19797
|
const initialRef = useRef38(initialData);
|
|
19696
|
-
const [fiscalData, setFiscalData] =
|
|
19798
|
+
const [fiscalData, setFiscalData] = useState71(initialData);
|
|
19697
19799
|
const fiscalDataRef = useRef38(initialData);
|
|
19698
|
-
const [fiscalErrors, setFiscalErrors] =
|
|
19800
|
+
const [fiscalErrors, setFiscalErrors] = useState71({});
|
|
19699
19801
|
const updateFiscalField = useCallback40((key, value) => {
|
|
19700
19802
|
setFiscalData((prev) => {
|
|
19701
19803
|
const next = { ...prev, [key]: value };
|
|
@@ -19888,7 +19990,7 @@ __name(EntitySection, "EntitySection");
|
|
|
19888
19990
|
import Image8 from "next/image";
|
|
19889
19991
|
|
|
19890
19992
|
// src/features/auth/contexts/AuthContext.tsx
|
|
19891
|
-
import { createContext as createContext29, useContext as useContext29, useMemo as useMemo40, useState as
|
|
19993
|
+
import { createContext as createContext29, useContext as useContext29, useMemo as useMemo40, useState as useState73 } from "react";
|
|
19892
19994
|
|
|
19893
19995
|
// src/features/auth/components/forms/Register.tsx
|
|
19894
19996
|
import { zodResolver as zodResolver6 } from "@hookform/resolvers/zod";
|
|
@@ -19896,21 +19998,21 @@ import { Loader2 as Loader24 } from "lucide-react";
|
|
|
19896
19998
|
import { useTranslations as useTranslations87 } from "next-intl";
|
|
19897
19999
|
import Image7 from "next/image";
|
|
19898
20000
|
import { useSearchParams as useSearchParams2 } from "next/navigation";
|
|
19899
|
-
import { useEffect as useEffect56, useState as
|
|
20001
|
+
import { useEffect as useEffect56, useState as useState72 } from "react";
|
|
19900
20002
|
import { useForm as useForm6 } from "react-hook-form";
|
|
19901
20003
|
import { v4 as v46 } from "uuid";
|
|
19902
20004
|
import { z as z7 } from "zod";
|
|
19903
20005
|
|
|
19904
20006
|
// src/features/auth/components/GdprConsentSection.tsx
|
|
19905
20007
|
import { useTranslations as useTranslations86 } from "next-intl";
|
|
19906
|
-
import { Fragment as
|
|
20008
|
+
import { Fragment as Fragment32, jsx as jsx209, jsxs as jsxs115 } from "react/jsx-runtime";
|
|
19907
20009
|
function GdprConsentSection({
|
|
19908
20010
|
form,
|
|
19909
20011
|
termsCheckboxId = "termsAccepted",
|
|
19910
20012
|
marketingCheckboxId = "marketingConsent"
|
|
19911
20013
|
}) {
|
|
19912
20014
|
const t = useTranslations86("auth.gdpr");
|
|
19913
|
-
const termsLabel = /* @__PURE__ */ jsxs115(
|
|
20015
|
+
const termsLabel = /* @__PURE__ */ jsxs115(Fragment32, { children: [
|
|
19914
20016
|
t("terms_prefix"),
|
|
19915
20017
|
" ",
|
|
19916
20018
|
/* @__PURE__ */ jsx209(Link, { href: "/terms", target: "_blank", rel: "noopener", children: t("terms_of_service") }),
|
|
@@ -19935,7 +20037,7 @@ function GdprConsentSection({
|
|
|
19935
20037
|
__name(GdprConsentSection, "GdprConsentSection");
|
|
19936
20038
|
|
|
19937
20039
|
// src/features/auth/components/forms/Register.tsx
|
|
19938
|
-
import { Fragment as
|
|
20040
|
+
import { Fragment as Fragment33, jsx as jsx210, jsxs as jsxs116 } from "react/jsx-runtime";
|
|
19939
20041
|
var REFERRAL_COOKIE_NAME = "referral_code";
|
|
19940
20042
|
function getReferralCode() {
|
|
19941
20043
|
if (typeof document === "undefined") return null;
|
|
@@ -19968,14 +20070,14 @@ function Register() {
|
|
|
19968
20070
|
const searchParams = useSearchParams2();
|
|
19969
20071
|
const inviteCode = searchParams.get("invite");
|
|
19970
20072
|
const registrationMode = getRegistrationMode();
|
|
19971
|
-
const [showConfirmation, setShowConfirmation] =
|
|
19972
|
-
const [inviteValidated, setInviteValidated] =
|
|
19973
|
-
const [inviteError, setInviteError] =
|
|
19974
|
-
const [isValidatingInvite, setIsValidatingInvite] =
|
|
20073
|
+
const [showConfirmation, setShowConfirmation] = useState72(false);
|
|
20074
|
+
const [inviteValidated, setInviteValidated] = useState72(false);
|
|
20075
|
+
const [inviteError, setInviteError] = useState72("");
|
|
20076
|
+
const [isValidatingInvite, setIsValidatingInvite] = useState72(
|
|
19975
20077
|
registrationMode === "waitlist" && !!inviteCode
|
|
19976
20078
|
);
|
|
19977
|
-
const [referralCode, setReferralCode2] =
|
|
19978
|
-
const [signupSource, setSignupSource] =
|
|
20079
|
+
const [referralCode, setReferralCode2] = useState72(null);
|
|
20080
|
+
const [signupSource, setSignupSource] = useState72(void 0);
|
|
19979
20081
|
useEffect56(() => {
|
|
19980
20082
|
const code = getReferralCode();
|
|
19981
20083
|
setReferralCode2(code);
|
|
@@ -20057,7 +20159,7 @@ function Register() {
|
|
|
20057
20159
|
}
|
|
20058
20160
|
}, "onSubmit");
|
|
20059
20161
|
if (registrationMode === "waitlist" && inviteCode && isValidatingInvite) {
|
|
20060
|
-
return /* @__PURE__ */ jsxs116(
|
|
20162
|
+
return /* @__PURE__ */ jsxs116(Fragment33, { children: [
|
|
20061
20163
|
/* @__PURE__ */ jsx210(CardHeader, { children: /* @__PURE__ */ jsxs116(CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
20062
20164
|
/* @__PURE__ */ jsx210(Image7, { src: "/logo.webp", alt: "Logo", width: 100, height: 100, priority: true }),
|
|
20063
20165
|
t("waitlist.invite.validating_title")
|
|
@@ -20069,7 +20171,7 @@ function Register() {
|
|
|
20069
20171
|
] });
|
|
20070
20172
|
}
|
|
20071
20173
|
if (registrationMode === "waitlist" && inviteCode && inviteError) {
|
|
20072
|
-
return /* @__PURE__ */ jsxs116(
|
|
20174
|
+
return /* @__PURE__ */ jsxs116(Fragment33, { children: [
|
|
20073
20175
|
/* @__PURE__ */ jsx210(CardHeader, { children: /* @__PURE__ */ jsxs116(CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
20074
20176
|
/* @__PURE__ */ jsx210(Image7, { src: "/logo.webp", alt: "Logo", width: 100, height: 100, priority: true }),
|
|
20075
20177
|
t("waitlist.invite.invalid_title")
|
|
@@ -20082,7 +20184,7 @@ function Register() {
|
|
|
20082
20184
|
] });
|
|
20083
20185
|
}
|
|
20084
20186
|
if (registrationMode === "waitlist" && !inviteCode) {
|
|
20085
|
-
return /* @__PURE__ */ jsxs116(
|
|
20187
|
+
return /* @__PURE__ */ jsxs116(Fragment33, { children: [
|
|
20086
20188
|
/* @__PURE__ */ jsx210(CardHeader, { children: /* @__PURE__ */ jsxs116(CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
20087
20189
|
/* @__PURE__ */ jsx210(Image7, { src: "/logo.webp", alt: "Logo", width: 100, height: 100, priority: true }),
|
|
20088
20190
|
t("waitlist.invite.registration_title")
|
|
@@ -20095,13 +20197,13 @@ function Register() {
|
|
|
20095
20197
|
/* @__PURE__ */ jsx210(CardFooter, { className: "flex w-full flex-row justify-between", children: /* @__PURE__ */ jsx210(Link, { href: "#", className: "flex w-full justify-start", onClick: () => setComponentType(0 /* Login */), children: t("auth.buttons.login") }) })
|
|
20096
20198
|
] });
|
|
20097
20199
|
}
|
|
20098
|
-
return /* @__PURE__ */ jsxs116(
|
|
20200
|
+
return /* @__PURE__ */ jsxs116(Fragment33, { children: [
|
|
20099
20201
|
/* @__PURE__ */ jsxs116(CardHeader, { children: [
|
|
20100
20202
|
/* @__PURE__ */ jsxs116(CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
20101
20203
|
/* @__PURE__ */ jsx210(Image7, { src: "/logo.webp", alt: "Logo", width: 100, height: 100, priority: true }),
|
|
20102
20204
|
t(`auth.buttons.register`)
|
|
20103
20205
|
] }),
|
|
20104
|
-
/* @__PURE__ */ jsx210(CardDescription, { className: "text-sm", children: showConfirmation ? /* @__PURE__ */ jsx210(
|
|
20206
|
+
/* @__PURE__ */ jsx210(CardDescription, { className: "text-sm", children: showConfirmation ? /* @__PURE__ */ jsx210(Fragment33, { children: " " }) : /* @__PURE__ */ jsx210(Fragment33, { children: t(`auth.register_description`) }) })
|
|
20105
20207
|
] }),
|
|
20106
20208
|
showConfirmation ? /* @__PURE__ */ jsx210(CardContent, { children: /* @__PURE__ */ jsx210(CardDescription, { className: "text-center text-xl", children: t("auth.register_confirmation") }) }) : /* @__PURE__ */ jsx210(Form, { ...form, children: /* @__PURE__ */ jsxs116("form", { onSubmit: form.handleSubmit(onSubmit), children: [
|
|
20107
20209
|
/* @__PURE__ */ jsxs116(CardContent, { children: [
|
|
@@ -20250,9 +20352,9 @@ var AuthContextProvider = /* @__PURE__ */ __name(({
|
|
|
20250
20352
|
initialComponentType,
|
|
20251
20353
|
initialParams
|
|
20252
20354
|
}) => {
|
|
20253
|
-
const [componentType, setComponentType] =
|
|
20254
|
-
const [params, setParams] =
|
|
20255
|
-
const [pendingTwoFactor, setPendingTwoFactor] =
|
|
20355
|
+
const [componentType, setComponentType] = useState73(initialComponentType);
|
|
20356
|
+
const [params, setParams] = useState73(initialParams);
|
|
20357
|
+
const [pendingTwoFactor, setPendingTwoFactor] = useState73();
|
|
20256
20358
|
const activeComponent = useMemo40(() => {
|
|
20257
20359
|
if (componentType === void 0) return null;
|
|
20258
20360
|
switch (componentType) {
|
|
@@ -20314,20 +20416,20 @@ __name(InnerAuthContainer, "InnerAuthContainer");
|
|
|
20314
20416
|
// src/features/auth/components/two-factor/TwoFactorSettings.tsx
|
|
20315
20417
|
import { ShieldAlert, ShieldCheck } from "lucide-react";
|
|
20316
20418
|
import { useTranslations as useTranslations94 } from "next-intl";
|
|
20317
|
-
import { useCallback as useCallback41, useEffect as useEffect58, useState as
|
|
20419
|
+
import { useCallback as useCallback41, useEffect as useEffect58, useState as useState81 } from "react";
|
|
20318
20420
|
import { v4 as v49 } from "uuid";
|
|
20319
20421
|
|
|
20320
20422
|
// src/features/auth/components/two-factor/BackupCodesDialog.tsx
|
|
20321
20423
|
import { Copy, Download, RefreshCw as RefreshCw2 } from "lucide-react";
|
|
20322
20424
|
import { useTranslations as useTranslations88 } from "next-intl";
|
|
20323
|
-
import { useState as
|
|
20425
|
+
import { useState as useState74 } from "react";
|
|
20324
20426
|
import { jsx as jsx213, jsxs as jsxs117 } from "react/jsx-runtime";
|
|
20325
20427
|
function BackupCodesDialog({ remainingCodes, onRegenerate, trigger }) {
|
|
20326
20428
|
const t = useTranslations88();
|
|
20327
|
-
const [open, setOpen] =
|
|
20328
|
-
const [codes, setCodes] =
|
|
20329
|
-
const [isLoading, setIsLoading] =
|
|
20330
|
-
const [showCodes, setShowCodes] =
|
|
20429
|
+
const [open, setOpen] = useState74(false);
|
|
20430
|
+
const [codes, setCodes] = useState74([]);
|
|
20431
|
+
const [isLoading, setIsLoading] = useState74(false);
|
|
20432
|
+
const [showCodes, setShowCodes] = useState74(false);
|
|
20331
20433
|
const handleGenerate = /* @__PURE__ */ __name(async () => {
|
|
20332
20434
|
setIsLoading(true);
|
|
20333
20435
|
try {
|
|
@@ -20422,13 +20524,13 @@ __name(BackupCodesDialog, "BackupCodesDialog");
|
|
|
20422
20524
|
|
|
20423
20525
|
// src/features/auth/components/two-factor/DisableTwoFactorDialog.tsx
|
|
20424
20526
|
import { useTranslations as useTranslations89 } from "next-intl";
|
|
20425
|
-
import { useState as
|
|
20527
|
+
import { useState as useState76 } from "react";
|
|
20426
20528
|
|
|
20427
20529
|
// src/features/auth/components/two-factor/TotpInput.tsx
|
|
20428
|
-
import { useEffect as useEffect57, useRef as useRef39, useState as
|
|
20530
|
+
import { useEffect as useEffect57, useRef as useRef39, useState as useState75 } from "react";
|
|
20429
20531
|
import { jsx as jsx214, jsxs as jsxs118 } from "react/jsx-runtime";
|
|
20430
20532
|
function TotpInput({ onComplete, disabled = false, autoFocus = true, error }) {
|
|
20431
|
-
const [digits, setDigits] =
|
|
20533
|
+
const [digits, setDigits] = useState75(["", "", "", "", "", ""]);
|
|
20432
20534
|
const inputRefs = useRef39([]);
|
|
20433
20535
|
useEffect57(() => {
|
|
20434
20536
|
if (autoFocus && inputRefs.current[0]) {
|
|
@@ -20492,9 +20594,9 @@ __name(TotpInput, "TotpInput");
|
|
|
20492
20594
|
import { jsx as jsx215, jsxs as jsxs119 } from "react/jsx-runtime";
|
|
20493
20595
|
function DisableTwoFactorDialog({ onSuccess, trigger }) {
|
|
20494
20596
|
const t = useTranslations89();
|
|
20495
|
-
const [open, setOpen] =
|
|
20496
|
-
const [isLoading, setIsLoading] =
|
|
20497
|
-
const [error, setError] =
|
|
20597
|
+
const [open, setOpen] = useState76(false);
|
|
20598
|
+
const [isLoading, setIsLoading] = useState76(false);
|
|
20599
|
+
const [error, setError] = useState76();
|
|
20498
20600
|
const handleVerify = /* @__PURE__ */ __name(async (code) => {
|
|
20499
20601
|
setIsLoading(true);
|
|
20500
20602
|
setError(void 0);
|
|
@@ -20535,15 +20637,15 @@ __name(DisableTwoFactorDialog, "DisableTwoFactorDialog");
|
|
|
20535
20637
|
// src/features/auth/components/two-factor/PasskeyList.tsx
|
|
20536
20638
|
import { Edit, Key, Trash2 } from "lucide-react";
|
|
20537
20639
|
import { useTranslations as useTranslations90 } from "next-intl";
|
|
20538
|
-
import { useState as
|
|
20539
|
-
import { Fragment as
|
|
20640
|
+
import { useState as useState77 } from "react";
|
|
20641
|
+
import { Fragment as Fragment34, jsx as jsx216, jsxs as jsxs120 } from "react/jsx-runtime";
|
|
20540
20642
|
function PasskeyList({ passkeys, onRefresh }) {
|
|
20541
20643
|
const t = useTranslations90();
|
|
20542
20644
|
const locale = useI18nLocale();
|
|
20543
|
-
const [renameDialogOpen, setRenameDialogOpen] =
|
|
20544
|
-
const [selectedPasskey, setSelectedPasskey] =
|
|
20545
|
-
const [newName, setNewName] =
|
|
20546
|
-
const [isLoading, setIsLoading] =
|
|
20645
|
+
const [renameDialogOpen, setRenameDialogOpen] = useState77(false);
|
|
20646
|
+
const [selectedPasskey, setSelectedPasskey] = useState77(null);
|
|
20647
|
+
const [newName, setNewName] = useState77("");
|
|
20648
|
+
const [isLoading, setIsLoading] = useState77(false);
|
|
20547
20649
|
const handleDelete = /* @__PURE__ */ __name(async (passkey) => {
|
|
20548
20650
|
setIsLoading(true);
|
|
20549
20651
|
try {
|
|
@@ -20593,7 +20695,7 @@ function PasskeyList({ passkeys, onRefresh }) {
|
|
|
20593
20695
|
if (passkeys.length === 0) {
|
|
20594
20696
|
return /* @__PURE__ */ jsx216("p", { className: "text-sm text-muted-foreground text-center py-4", children: t("auth.two_factor.no_passkeys") });
|
|
20595
20697
|
}
|
|
20596
|
-
return /* @__PURE__ */ jsxs120(
|
|
20698
|
+
return /* @__PURE__ */ jsxs120(Fragment34, { children: [
|
|
20597
20699
|
/* @__PURE__ */ jsx216("div", { className: "space-y-2", children: passkeys.map((passkey) => /* @__PURE__ */ jsxs120("div", { className: "flex items-center justify-between p-3 border rounded-lg", children: [
|
|
20598
20700
|
/* @__PURE__ */ jsxs120("div", { className: "flex items-center gap-3", children: [
|
|
20599
20701
|
/* @__PURE__ */ jsx216(Key, { className: "h-5 w-5 text-muted-foreground" }),
|
|
@@ -20657,14 +20759,14 @@ __name(PasskeyList, "PasskeyList");
|
|
|
20657
20759
|
// src/features/auth/components/two-factor/PasskeySetupDialog.tsx
|
|
20658
20760
|
import { startRegistration } from "@simplewebauthn/browser";
|
|
20659
20761
|
import { useTranslations as useTranslations91 } from "next-intl";
|
|
20660
|
-
import { useState as
|
|
20762
|
+
import { useState as useState78 } from "react";
|
|
20661
20763
|
import { v4 as v47 } from "uuid";
|
|
20662
20764
|
import { jsx as jsx217, jsxs as jsxs121 } from "react/jsx-runtime";
|
|
20663
20765
|
function PasskeySetupDialog({ open, onOpenChange, onSuccess }) {
|
|
20664
20766
|
const t = useTranslations91();
|
|
20665
20767
|
const { currentUser } = useCurrentUserContext();
|
|
20666
|
-
const [name, setName] =
|
|
20667
|
-
const [isLoading, setIsLoading] =
|
|
20768
|
+
const [name, setName] = useState78("");
|
|
20769
|
+
const [isLoading, setIsLoading] = useState78(false);
|
|
20668
20770
|
const handleRegister = /* @__PURE__ */ __name(async () => {
|
|
20669
20771
|
if (!name.trim()) return;
|
|
20670
20772
|
setIsLoading(true);
|
|
@@ -20728,12 +20830,12 @@ __name(PasskeySetupDialog, "PasskeySetupDialog");
|
|
|
20728
20830
|
// src/features/auth/components/two-factor/TotpAuthenticatorList.tsx
|
|
20729
20831
|
import { Smartphone, Trash2 as Trash22 } from "lucide-react";
|
|
20730
20832
|
import { useTranslations as useTranslations92 } from "next-intl";
|
|
20731
|
-
import { useState as
|
|
20833
|
+
import { useState as useState79 } from "react";
|
|
20732
20834
|
import { jsx as jsx218, jsxs as jsxs122 } from "react/jsx-runtime";
|
|
20733
20835
|
function TotpAuthenticatorList({ authenticators, onDelete }) {
|
|
20734
20836
|
const t = useTranslations92();
|
|
20735
20837
|
const locale = useI18nLocale();
|
|
20736
|
-
const [deletingId, setDeletingId] =
|
|
20838
|
+
const [deletingId, setDeletingId] = useState79(null);
|
|
20737
20839
|
const handleDelete = /* @__PURE__ */ __name(async (id) => {
|
|
20738
20840
|
setDeletingId(id);
|
|
20739
20841
|
try {
|
|
@@ -20804,19 +20906,19 @@ __name(TotpAuthenticatorList, "TotpAuthenticatorList");
|
|
|
20804
20906
|
// src/features/auth/components/two-factor/TotpSetupDialog.tsx
|
|
20805
20907
|
import { useTranslations as useTranslations93 } from "next-intl";
|
|
20806
20908
|
import { QRCodeSVG } from "qrcode.react";
|
|
20807
|
-
import { useState as
|
|
20909
|
+
import { useState as useState80 } from "react";
|
|
20808
20910
|
import { v4 as v48 } from "uuid";
|
|
20809
20911
|
import { jsx as jsx219, jsxs as jsxs123 } from "react/jsx-runtime";
|
|
20810
20912
|
function TotpSetupDialog({ onSuccess, trigger }) {
|
|
20811
20913
|
const t = useTranslations93();
|
|
20812
20914
|
const { currentUser } = useCurrentUserContext();
|
|
20813
|
-
const [open, setOpen] =
|
|
20814
|
-
const [step, setStep] =
|
|
20815
|
-
const [name, setName] =
|
|
20816
|
-
const [qrCodeUri, setQrCodeUri] =
|
|
20817
|
-
const [authenticatorId, setAuthenticatorId] =
|
|
20818
|
-
const [isLoading, setIsLoading] =
|
|
20819
|
-
const [verifyError, setVerifyError] =
|
|
20915
|
+
const [open, setOpen] = useState80(false);
|
|
20916
|
+
const [step, setStep] = useState80("name");
|
|
20917
|
+
const [name, setName] = useState80("");
|
|
20918
|
+
const [qrCodeUri, setQrCodeUri] = useState80("");
|
|
20919
|
+
const [authenticatorId, setAuthenticatorId] = useState80("");
|
|
20920
|
+
const [isLoading, setIsLoading] = useState80(false);
|
|
20921
|
+
const [verifyError, setVerifyError] = useState80();
|
|
20820
20922
|
const handleStartSetup = /* @__PURE__ */ __name(async () => {
|
|
20821
20923
|
if (!name.trim()) return;
|
|
20822
20924
|
setIsLoading(true);
|
|
@@ -20911,15 +21013,15 @@ function TotpSetupDialog({ onSuccess, trigger }) {
|
|
|
20911
21013
|
__name(TotpSetupDialog, "TotpSetupDialog");
|
|
20912
21014
|
|
|
20913
21015
|
// src/features/auth/components/two-factor/TwoFactorSettings.tsx
|
|
20914
|
-
import { Fragment as
|
|
21016
|
+
import { Fragment as Fragment35, jsx as jsx220, jsxs as jsxs124 } from "react/jsx-runtime";
|
|
20915
21017
|
function TwoFactorSettings() {
|
|
20916
21018
|
const t = useTranslations94();
|
|
20917
|
-
const [status, setStatus] =
|
|
20918
|
-
const [authenticators, setAuthenticators] =
|
|
20919
|
-
const [passkeys, setPasskeys] =
|
|
20920
|
-
const [isLoading, setIsLoading] =
|
|
20921
|
-
const [isEnabling, setIsEnabling] =
|
|
20922
|
-
const [passkeyDialogOpen, setPasskeyDialogOpen] =
|
|
21019
|
+
const [status, setStatus] = useState81(null);
|
|
21020
|
+
const [authenticators, setAuthenticators] = useState81([]);
|
|
21021
|
+
const [passkeys, setPasskeys] = useState81([]);
|
|
21022
|
+
const [isLoading, setIsLoading] = useState81(true);
|
|
21023
|
+
const [isEnabling, setIsEnabling] = useState81(false);
|
|
21024
|
+
const [passkeyDialogOpen, setPasskeyDialogOpen] = useState81(false);
|
|
20923
21025
|
const loadStatus = useCallback41(async () => {
|
|
20924
21026
|
try {
|
|
20925
21027
|
const [statusData, authenticatorsList, passkeysList] = await Promise.all([
|
|
@@ -20998,7 +21100,7 @@ function TwoFactorSettings() {
|
|
|
20998
21100
|
] }),
|
|
20999
21101
|
/* @__PURE__ */ jsx220(BackupCodesDialog, { remainingCodes: status?.backupCodesCount ?? 0, onRegenerate: handleRefresh })
|
|
21000
21102
|
] }) }),
|
|
21001
|
-
!isEnabled && (authenticators.length > 0 || passkeys.length > 0) && /* @__PURE__ */ jsxs124(
|
|
21103
|
+
!isEnabled && (authenticators.length > 0 || passkeys.length > 0) && /* @__PURE__ */ jsxs124(Fragment35, { children: [
|
|
21002
21104
|
/* @__PURE__ */ jsx220(Separator, {}),
|
|
21003
21105
|
/* @__PURE__ */ jsxs124("div", { className: "flex items-center justify-between", children: [
|
|
21004
21106
|
/* @__PURE__ */ jsxs124("div", { children: [
|
|
@@ -21008,7 +21110,7 @@ function TwoFactorSettings() {
|
|
|
21008
21110
|
/* @__PURE__ */ jsx220(Button, { onClick: handleEnable2FA, disabled: isEnabling, children: isEnabling ? t("common.loading") : t("auth.two_factor.enable_button") })
|
|
21009
21111
|
] })
|
|
21010
21112
|
] }),
|
|
21011
|
-
isEnabled && /* @__PURE__ */ jsxs124(
|
|
21113
|
+
isEnabled && /* @__PURE__ */ jsxs124(Fragment35, { children: [
|
|
21012
21114
|
/* @__PURE__ */ jsx220(Separator, {}),
|
|
21013
21115
|
/* @__PURE__ */ jsxs124("div", { className: "flex items-center justify-between", children: [
|
|
21014
21116
|
/* @__PURE__ */ jsxs124("div", { children: [
|
|
@@ -21094,11 +21196,11 @@ function GoogleSignInButton({ referralCode, source }) {
|
|
|
21094
21196
|
__name(GoogleSignInButton, "GoogleSignInButton");
|
|
21095
21197
|
|
|
21096
21198
|
// src/features/auth/components/details/LandingComponent.tsx
|
|
21097
|
-
import { Fragment as
|
|
21199
|
+
import { Fragment as Fragment36, jsx as jsx223, jsxs as jsxs126 } from "react/jsx-runtime";
|
|
21098
21200
|
function LandingComponent() {
|
|
21099
21201
|
const t = useTranslations96();
|
|
21100
21202
|
const { setComponentType } = useAuthContext();
|
|
21101
|
-
return /* @__PURE__ */ jsxs126(
|
|
21203
|
+
return /* @__PURE__ */ jsxs126(Fragment36, { children: [
|
|
21102
21204
|
/* @__PURE__ */ jsxs126(CardHeader, { className: "mb-4", "data-testid": "page-pre-login-container", children: [
|
|
21103
21205
|
/* @__PURE__ */ jsxs126(CardTitle, { className: "text-primary flex flex-col items-center gap-y-8 pb-8 text-4xl", children: [
|
|
21104
21206
|
/* @__PURE__ */ jsx223(Image9, { src: "/logo.webp", alt: "Logo", width: 100, height: 100, priority: true }),
|
|
@@ -21107,7 +21209,7 @@ function LandingComponent() {
|
|
|
21107
21209
|
/* @__PURE__ */ jsx223(CardDescription, { className: "flex w-full justify-center text-center text-sm", children: t(`common.description`) })
|
|
21108
21210
|
] }),
|
|
21109
21211
|
/* @__PURE__ */ jsxs126(CardFooter, { className: "mt-4 flex w-full flex-col justify-between gap-y-4", children: [
|
|
21110
|
-
isInternalAuthEnabled() && /* @__PURE__ */ jsxs126(
|
|
21212
|
+
isInternalAuthEnabled() && /* @__PURE__ */ jsxs126(Fragment36, { children: [
|
|
21111
21213
|
isRegistrationAllowed() && /* @__PURE__ */ jsx223(
|
|
21112
21214
|
Link,
|
|
21113
21215
|
{
|
|
@@ -21130,14 +21232,14 @@ __name(LandingComponent, "LandingComponent");
|
|
|
21130
21232
|
import { zodResolver as zodResolver7 } from "@hookform/resolvers/zod";
|
|
21131
21233
|
import { useTranslations as useTranslations97 } from "next-intl";
|
|
21132
21234
|
import Image10 from "next/image";
|
|
21133
|
-
import { useEffect as useEffect59, useState as
|
|
21235
|
+
import { useEffect as useEffect59, useState as useState82 } from "react";
|
|
21134
21236
|
import { useForm as useForm7 } from "react-hook-form";
|
|
21135
21237
|
import { z as z8 } from "zod";
|
|
21136
|
-
import { Fragment as
|
|
21238
|
+
import { Fragment as Fragment37, jsx as jsx224, jsxs as jsxs127 } from "react/jsx-runtime";
|
|
21137
21239
|
function AcceptInvitation() {
|
|
21138
21240
|
const { setComponentType, params, setParams } = useAuthContext();
|
|
21139
|
-
const [showConfirmation, setShowConfirmation] =
|
|
21140
|
-
const [error, setError] =
|
|
21241
|
+
const [showConfirmation, setShowConfirmation] = useState82(false);
|
|
21242
|
+
const [error, setError] = useState82(void 0);
|
|
21141
21243
|
const t = useTranslations97();
|
|
21142
21244
|
useEffect59(() => {
|
|
21143
21245
|
async function validateCode(code) {
|
|
@@ -21196,13 +21298,13 @@ function AcceptInvitation() {
|
|
|
21196
21298
|
errorToast({ title: t(`common.errors.error`), error });
|
|
21197
21299
|
}
|
|
21198
21300
|
}, "onSubmit");
|
|
21199
|
-
return /* @__PURE__ */ jsxs127(
|
|
21301
|
+
return /* @__PURE__ */ jsxs127(Fragment37, { children: [
|
|
21200
21302
|
/* @__PURE__ */ jsxs127(CardHeader, { children: [
|
|
21201
21303
|
/* @__PURE__ */ jsxs127(CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
21202
21304
|
/* @__PURE__ */ jsx224(Image10, { src: "/logo.webp", alt: "Logo", width: 100, height: 100, priority: true }),
|
|
21203
21305
|
t("auth.accept_invitation")
|
|
21204
21306
|
] }),
|
|
21205
|
-
/* @__PURE__ */ jsx224(CardDescription, { className: "text-center text-sm", children: error ? /* @__PURE__ */ jsx224(
|
|
21307
|
+
/* @__PURE__ */ jsx224(CardDescription, { className: "text-center text-sm", children: error ? /* @__PURE__ */ jsx224(Fragment37, { children: t("auth.errors.activating_account") }) : /* @__PURE__ */ jsx224(Fragment37, { children: t("auth.select_password") }) })
|
|
21206
21308
|
] }),
|
|
21207
21309
|
/* @__PURE__ */ jsx224(CardContent, { children: showConfirmation ? /* @__PURE__ */ jsx224(CardDescription, { className: "text-center text-xl", children: t("auth.activation_description") }) : error ? /* @__PURE__ */ jsx224(CardDescription, { className: "text-center text-xl", children: error }) : /* @__PURE__ */ jsx224(Form, { ...form, children: /* @__PURE__ */ jsxs127("form", { onSubmit: form.handleSubmit(onSubmit), children: [
|
|
21208
21310
|
/* @__PURE__ */ jsx224(
|
|
@@ -21232,12 +21334,12 @@ __name(AcceptInvitation, "AcceptInvitation");
|
|
|
21232
21334
|
// src/features/auth/components/forms/ActivateAccount.tsx
|
|
21233
21335
|
import { useTranslations as useTranslations98 } from "next-intl";
|
|
21234
21336
|
import Image11 from "next/image";
|
|
21235
|
-
import { useEffect as useEffect60, useState as
|
|
21236
|
-
import { Fragment as
|
|
21337
|
+
import { useEffect as useEffect60, useState as useState83 } from "react";
|
|
21338
|
+
import { Fragment as Fragment38, jsx as jsx225, jsxs as jsxs128 } from "react/jsx-runtime";
|
|
21237
21339
|
function ActivateAccount() {
|
|
21238
21340
|
const { setComponentType, params, setParams } = useAuthContext();
|
|
21239
|
-
const [showConfirmation, setShowConfirmation] =
|
|
21240
|
-
const [error, setError] =
|
|
21341
|
+
const [showConfirmation, setShowConfirmation] = useState83(false);
|
|
21342
|
+
const [error, setError] = useState83(void 0);
|
|
21241
21343
|
const t = useTranslations98();
|
|
21242
21344
|
useEffect60(() => {
|
|
21243
21345
|
async function ActivateAccount2(code) {
|
|
@@ -21266,25 +21368,25 @@ function ActivateAccount() {
|
|
|
21266
21368
|
setError(t(`auth.errors.invalid_invitation_code`));
|
|
21267
21369
|
}
|
|
21268
21370
|
}, []);
|
|
21269
|
-
return /* @__PURE__ */ jsxs128(
|
|
21371
|
+
return /* @__PURE__ */ jsxs128(Fragment38, { children: [
|
|
21270
21372
|
/* @__PURE__ */ jsxs128(CardHeader, { children: [
|
|
21271
21373
|
/* @__PURE__ */ jsxs128(CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
21272
21374
|
/* @__PURE__ */ jsx225(Image11, { src: "/logo.webp", alt: "Logo", width: 100, height: 100, priority: true }),
|
|
21273
21375
|
t("auth.accept_invitation")
|
|
21274
21376
|
] }),
|
|
21275
|
-
/* @__PURE__ */ jsx225(CardDescription, { className: "text-center text-sm", children: error ? /* @__PURE__ */ jsx225(
|
|
21377
|
+
/* @__PURE__ */ jsx225(CardDescription, { className: "text-center text-sm", children: error ? /* @__PURE__ */ jsx225(Fragment38, { children: t("auth.errors.activating_account") }) : /* @__PURE__ */ jsx225(Fragment38, { children: " " }) })
|
|
21276
21378
|
] }),
|
|
21277
|
-
/* @__PURE__ */ jsx225(CardContent, { children: /* @__PURE__ */ jsx225(CardDescription, { className: "text-center text-xl", children: showConfirmation ? /* @__PURE__ */ jsx225(
|
|
21379
|
+
/* @__PURE__ */ jsx225(CardContent, { children: /* @__PURE__ */ jsx225(CardDescription, { className: "text-center text-xl", children: showConfirmation ? /* @__PURE__ */ jsx225(Fragment38, { children: t("auth.activation_description") }) : error ? /* @__PURE__ */ jsx225(Fragment38, { children: error }) : /* @__PURE__ */ jsx225(Fragment38, { children: t("auth.activation_wait") }) }) })
|
|
21278
21380
|
] });
|
|
21279
21381
|
}
|
|
21280
21382
|
__name(ActivateAccount, "ActivateAccount");
|
|
21281
21383
|
|
|
21282
21384
|
// src/features/auth/components/forms/Cookies.tsx
|
|
21283
|
-
import { useEffect as useEffect61, useState as
|
|
21385
|
+
import { useEffect as useEffect61, useState as useState84 } from "react";
|
|
21284
21386
|
function Cookies({ dehydratedAuth, page }) {
|
|
21285
21387
|
const { setUser } = useCurrentUserContext();
|
|
21286
21388
|
const router = useI18nRouter();
|
|
21287
|
-
const [hasSaved, setHasSaved] =
|
|
21389
|
+
const [hasSaved, setHasSaved] = useState84(false);
|
|
21288
21390
|
useEffect61(() => {
|
|
21289
21391
|
if (hasSaved) return;
|
|
21290
21392
|
async function saveTokenOnServer() {
|
|
@@ -21308,14 +21410,14 @@ __name(Cookies, "Cookies");
|
|
|
21308
21410
|
import { zodResolver as zodResolver8 } from "@hookform/resolvers/zod";
|
|
21309
21411
|
import { useTranslations as useTranslations99 } from "next-intl";
|
|
21310
21412
|
import Image12 from "next/image";
|
|
21311
|
-
import { useState as
|
|
21413
|
+
import { useState as useState85 } from "react";
|
|
21312
21414
|
import { useForm as useForm8 } from "react-hook-form";
|
|
21313
21415
|
import { z as z9 } from "zod";
|
|
21314
|
-
import { Fragment as
|
|
21416
|
+
import { Fragment as Fragment39, jsx as jsx226, jsxs as jsxs129 } from "react/jsx-runtime";
|
|
21315
21417
|
function ForgotPassword() {
|
|
21316
21418
|
const t = useTranslations99();
|
|
21317
21419
|
const { setComponentType } = useAuthContext();
|
|
21318
|
-
const [showConfirmation, setShowConfirmation] =
|
|
21420
|
+
const [showConfirmation, setShowConfirmation] = useState85(false);
|
|
21319
21421
|
const formSchema = z9.object({
|
|
21320
21422
|
email: z9.string().email({
|
|
21321
21423
|
message: t(`common.errors.invalid_email`)
|
|
@@ -21338,13 +21440,13 @@ function ForgotPassword() {
|
|
|
21338
21440
|
errorToast({ title: t("common.errors.error"), error: e });
|
|
21339
21441
|
}
|
|
21340
21442
|
}, "onSubmit");
|
|
21341
|
-
return /* @__PURE__ */ jsxs129(
|
|
21443
|
+
return /* @__PURE__ */ jsxs129(Fragment39, { children: [
|
|
21342
21444
|
/* @__PURE__ */ jsxs129(CardHeader, { "data-testid": "page-forgot-password-container", children: [
|
|
21343
21445
|
/* @__PURE__ */ jsxs129(CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
21344
21446
|
/* @__PURE__ */ jsx226(Image12, { src: "/logo.webp", alt: "Logo", width: 100, height: 100, priority: true }),
|
|
21345
21447
|
t("auth.buttons.forgot_password")
|
|
21346
21448
|
] }),
|
|
21347
|
-
/* @__PURE__ */ jsx226(CardDescription, { className: "text-sm", children: showConfirmation ? /* @__PURE__ */ jsx226(
|
|
21449
|
+
/* @__PURE__ */ jsx226(CardDescription, { className: "text-sm", children: showConfirmation ? /* @__PURE__ */ jsx226(Fragment39, { children: " " }) : /* @__PURE__ */ jsx226(Fragment39, { children: t(`auth.add_email_to_reset`) }) })
|
|
21348
21450
|
] }),
|
|
21349
21451
|
showConfirmation ? /* @__PURE__ */ jsx226(CardContent, { children: /* @__PURE__ */ jsx226(CardDescription, { className: "text-center text-xl", children: t(`auth.reset_confirmation`) }) }) : /* @__PURE__ */ jsx226(Form, { ...form, children: /* @__PURE__ */ jsxs129("form", { onSubmit: form.handleSubmit(onSubmit), children: [
|
|
21350
21452
|
/* @__PURE__ */ jsxs129(CardContent, { children: [
|
|
@@ -21380,10 +21482,10 @@ import { zodResolver as zodResolver9 } from "@hookform/resolvers/zod";
|
|
|
21380
21482
|
import { useTranslations as useTranslations100 } from "next-intl";
|
|
21381
21483
|
import Image13 from "next/image";
|
|
21382
21484
|
import { useRouter, useSearchParams as useSearchParams3 } from "next/navigation";
|
|
21383
|
-
import { useEffect as useEffect62, useState as
|
|
21485
|
+
import { useEffect as useEffect62, useState as useState86 } from "react";
|
|
21384
21486
|
import { useForm as useForm9 } from "react-hook-form";
|
|
21385
21487
|
import { z as z10 } from "zod";
|
|
21386
|
-
import { Fragment as
|
|
21488
|
+
import { Fragment as Fragment40, jsx as jsx227, jsxs as jsxs130 } from "react/jsx-runtime";
|
|
21387
21489
|
function Login() {
|
|
21388
21490
|
const t = useTranslations100();
|
|
21389
21491
|
const { setUser } = useCurrentUserContext();
|
|
@@ -21393,7 +21495,7 @@ function Login() {
|
|
|
21393
21495
|
const nativeRouter = useRouter();
|
|
21394
21496
|
const searchParams = useSearchParams3();
|
|
21395
21497
|
const callbackUrl = searchParams.get("callbackUrl");
|
|
21396
|
-
const [referralCode, setReferralCode2] =
|
|
21498
|
+
const [referralCode, setReferralCode2] = useState86(null);
|
|
21397
21499
|
useEffect62(() => {
|
|
21398
21500
|
const cookies = document.cookie.split("; ");
|
|
21399
21501
|
for (const cookie of cookies) {
|
|
@@ -21449,7 +21551,7 @@ function Login() {
|
|
|
21449
21551
|
});
|
|
21450
21552
|
}
|
|
21451
21553
|
}, "onSubmit");
|
|
21452
|
-
return /* @__PURE__ */ jsxs130(
|
|
21554
|
+
return /* @__PURE__ */ jsxs130(Fragment40, { children: [
|
|
21453
21555
|
/* @__PURE__ */ jsxs130(CardHeader, { "data-testid": "page-login-container", children: [
|
|
21454
21556
|
/* @__PURE__ */ jsxs130(CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
21455
21557
|
/* @__PURE__ */ jsx227(Image13, { src: "/logo.webp", alt: "Logo", width: 100, height: 100, priority: true }),
|
|
@@ -21458,7 +21560,7 @@ function Login() {
|
|
|
21458
21560
|
/* @__PURE__ */ jsx227(CardDescription, { className: "text-sm", children: t(`auth.login_description`) })
|
|
21459
21561
|
] }),
|
|
21460
21562
|
/* @__PURE__ */ jsx227(Form, { ...form, children: /* @__PURE__ */ jsxs130("form", { onSubmit: form.handleSubmit(onSubmit), children: [
|
|
21461
|
-
/* @__PURE__ */ jsx227(CardContent, { children: isInternalAuthEnabled() && /* @__PURE__ */ jsxs130(
|
|
21563
|
+
/* @__PURE__ */ jsx227(CardContent, { children: isInternalAuthEnabled() && /* @__PURE__ */ jsxs130(Fragment40, { children: [
|
|
21462
21564
|
/* @__PURE__ */ jsx227(
|
|
21463
21565
|
FormInput,
|
|
21464
21566
|
{
|
|
@@ -21525,7 +21627,7 @@ function clearClientStorage(keys) {
|
|
|
21525
21627
|
__name(clearClientStorage, "clearClientStorage");
|
|
21526
21628
|
|
|
21527
21629
|
// src/features/auth/components/forms/Logout.tsx
|
|
21528
|
-
import { Fragment as
|
|
21630
|
+
import { Fragment as Fragment41, jsx as jsx228 } from "react/jsx-runtime";
|
|
21529
21631
|
function Logout({ storageKeys }) {
|
|
21530
21632
|
const generateUrl = usePageUrlGenerator();
|
|
21531
21633
|
useEffect63(() => {
|
|
@@ -21536,7 +21638,7 @@ function Logout({ storageKeys }) {
|
|
|
21536
21638
|
}, "logOut");
|
|
21537
21639
|
logOut();
|
|
21538
21640
|
}, []);
|
|
21539
|
-
return /* @__PURE__ */ jsx228(
|
|
21641
|
+
return /* @__PURE__ */ jsx228(Fragment41, {});
|
|
21540
21642
|
}
|
|
21541
21643
|
__name(Logout, "Logout");
|
|
21542
21644
|
|
|
@@ -21574,14 +21676,14 @@ __name(RefreshUser, "RefreshUser");
|
|
|
21574
21676
|
import { zodResolver as zodResolver10 } from "@hookform/resolvers/zod";
|
|
21575
21677
|
import { useTranslations as useTranslations101 } from "next-intl";
|
|
21576
21678
|
import Image14 from "next/image";
|
|
21577
|
-
import { useEffect as useEffect65, useState as
|
|
21679
|
+
import { useEffect as useEffect65, useState as useState87 } from "react";
|
|
21578
21680
|
import { useForm as useForm10 } from "react-hook-form";
|
|
21579
21681
|
import { z as z11 } from "zod";
|
|
21580
|
-
import { Fragment as
|
|
21682
|
+
import { Fragment as Fragment42, jsx as jsx229, jsxs as jsxs131 } from "react/jsx-runtime";
|
|
21581
21683
|
function ResetPassword() {
|
|
21582
21684
|
const { setComponentType, params, setParams } = useAuthContext();
|
|
21583
|
-
const [showConfirmation, setShowConfirmation] =
|
|
21584
|
-
const [error, setError] =
|
|
21685
|
+
const [showConfirmation, setShowConfirmation] = useState87(false);
|
|
21686
|
+
const [error, setError] = useState87(void 0);
|
|
21585
21687
|
const t = useTranslations101();
|
|
21586
21688
|
useEffect65(() => {
|
|
21587
21689
|
async function validateResetPasswordCode(code) {
|
|
@@ -21640,13 +21742,13 @@ function ResetPassword() {
|
|
|
21640
21742
|
errorToast({ title: t(`common.errors.error`), error });
|
|
21641
21743
|
}
|
|
21642
21744
|
}, "onSubmit");
|
|
21643
|
-
return /* @__PURE__ */ jsxs131(
|
|
21745
|
+
return /* @__PURE__ */ jsxs131(Fragment42, { children: [
|
|
21644
21746
|
/* @__PURE__ */ jsxs131(CardHeader, { children: [
|
|
21645
21747
|
/* @__PURE__ */ jsxs131(CardTitle, { className: "text-primary flex flex-col items-center pb-10 text-4xl", children: [
|
|
21646
21748
|
/* @__PURE__ */ jsx229(Image14, { src: "/logo.webp", alt: "Logo", width: 100, height: 100, priority: true }),
|
|
21647
21749
|
t(`auth.password_reset`)
|
|
21648
21750
|
] }),
|
|
21649
|
-
/* @__PURE__ */ jsx229(CardDescription, { className: "text-center text-sm", children: error ? /* @__PURE__ */ jsx229(
|
|
21751
|
+
/* @__PURE__ */ jsx229(CardDescription, { className: "text-center text-sm", children: error ? /* @__PURE__ */ jsx229(Fragment42, { children: t(`auth.errors.password_reset_error`) }) : /* @__PURE__ */ jsx229(Fragment42, { children: t(`auth.reset_password`) }) })
|
|
21650
21752
|
] }),
|
|
21651
21753
|
/* @__PURE__ */ jsx229(CardContent, { children: showConfirmation ? /* @__PURE__ */ jsx229(CardDescription, { className: "text-center text-xl", children: t(`auth.reset_success_description`) }) : error ? /* @__PURE__ */ jsx229(CardDescription, { className: "text-center text-xl", children: error }) : /* @__PURE__ */ jsx229(Form, { ...form, children: /* @__PURE__ */ jsxs131("form", { onSubmit: form.handleSubmit(onSubmit), children: [
|
|
21652
21754
|
/* @__PURE__ */ jsx229(FormPassword, { form, id: "password", name: t(`user.fields.password.label`) }),
|
|
@@ -21660,18 +21762,18 @@ __name(ResetPassword, "ResetPassword");
|
|
|
21660
21762
|
// src/features/auth/components/forms/TwoFactorChallenge.tsx
|
|
21661
21763
|
import { useTranslations as useTranslations103 } from "next-intl";
|
|
21662
21764
|
import { useRouter as useRouter2, useSearchParams as useSearchParams4 } from "next/navigation";
|
|
21663
|
-
import { useState as
|
|
21765
|
+
import { useState as useState89 } from "react";
|
|
21664
21766
|
import { v4 as v411 } from "uuid";
|
|
21665
21767
|
|
|
21666
21768
|
// src/features/auth/components/two-factor/PasskeyButton.tsx
|
|
21667
21769
|
import { startAuthentication } from "@simplewebauthn/browser";
|
|
21668
21770
|
import { useTranslations as useTranslations102 } from "next-intl";
|
|
21669
|
-
import { useState as
|
|
21771
|
+
import { useState as useState88 } from "react";
|
|
21670
21772
|
import { v4 as v410 } from "uuid";
|
|
21671
21773
|
import { jsx as jsx230 } from "react/jsx-runtime";
|
|
21672
21774
|
function PasskeyButton({ pendingToken, onSuccess, onError, disabled = false }) {
|
|
21673
21775
|
const t = useTranslations102();
|
|
21674
|
-
const [isLoading, setIsLoading] =
|
|
21776
|
+
const [isLoading, setIsLoading] = useState88(false);
|
|
21675
21777
|
const handleClick = /* @__PURE__ */ __name(async () => {
|
|
21676
21778
|
setIsLoading(true);
|
|
21677
21779
|
try {
|
|
@@ -21706,7 +21808,7 @@ function PasskeyButton({ pendingToken, onSuccess, onError, disabled = false }) {
|
|
|
21706
21808
|
__name(PasskeyButton, "PasskeyButton");
|
|
21707
21809
|
|
|
21708
21810
|
// src/features/auth/components/forms/TwoFactorChallenge.tsx
|
|
21709
|
-
import { Fragment as
|
|
21811
|
+
import { Fragment as Fragment43, jsx as jsx231, jsxs as jsxs132 } from "react/jsx-runtime";
|
|
21710
21812
|
function TwoFactorChallenge() {
|
|
21711
21813
|
const t = useTranslations103();
|
|
21712
21814
|
const { setUser } = useCurrentUserContext();
|
|
@@ -21716,10 +21818,10 @@ function TwoFactorChallenge() {
|
|
|
21716
21818
|
const nativeRouter = useRouter2();
|
|
21717
21819
|
const searchParams = useSearchParams4();
|
|
21718
21820
|
const callbackUrl = searchParams.get("callbackUrl");
|
|
21719
|
-
const [isVerifying, setIsVerifying] =
|
|
21720
|
-
const [totpError, setTotpError] =
|
|
21721
|
-
const [backupCode, setBackupCode] =
|
|
21722
|
-
const [backupError, setBackupError] =
|
|
21821
|
+
const [isVerifying, setIsVerifying] = useState89(false);
|
|
21822
|
+
const [totpError, setTotpError] = useState89();
|
|
21823
|
+
const [backupCode, setBackupCode] = useState89("");
|
|
21824
|
+
const [backupError, setBackupError] = useState89();
|
|
21723
21825
|
if (!pendingTwoFactor) {
|
|
21724
21826
|
return null;
|
|
21725
21827
|
}
|
|
@@ -21786,7 +21888,7 @@ function TwoFactorChallenge() {
|
|
|
21786
21888
|
const hasTotp = availableMethods.includes("totp");
|
|
21787
21889
|
const hasPasskey = availableMethods.includes("passkey");
|
|
21788
21890
|
const hasBackup = availableMethods.includes("backup");
|
|
21789
|
-
return /* @__PURE__ */ jsxs132(
|
|
21891
|
+
return /* @__PURE__ */ jsxs132(Fragment43, { children: [
|
|
21790
21892
|
/* @__PURE__ */ jsxs132(CardHeader, { "data-testid": "page-2fa-challenge", children: [
|
|
21791
21893
|
/* @__PURE__ */ jsx231(CardTitle, { className: "text-primary", children: t("auth.two_factor.verification_required") }),
|
|
21792
21894
|
/* @__PURE__ */ jsx231(CardDescription, { children: t("auth.two_factor.enter_verification_code") })
|
|
@@ -22025,7 +22127,7 @@ var AI_CONNECTIONS_I18N_KEYS = [
|
|
|
22025
22127
|
|
|
22026
22128
|
// src/features/ai-connection/contexts/AiConnectionsContext.tsx
|
|
22027
22129
|
import { useTranslations as useTranslations105 } from "next-intl";
|
|
22028
|
-
import { createContext as createContext30, useCallback as useCallback42, useContext as useContext30, useEffect as useEffect66, useMemo as useMemo41, useState as
|
|
22130
|
+
import { createContext as createContext30, useCallback as useCallback42, useContext as useContext30, useEffect as useEffect66, useMemo as useMemo41, useState as useState90 } from "react";
|
|
22029
22131
|
import { jsx as jsx233 } from "react/jsx-runtime";
|
|
22030
22132
|
var defaultContextValue4 = {
|
|
22031
22133
|
connections: [],
|
|
@@ -22041,11 +22143,11 @@ var defaultContextValue4 = {
|
|
|
22041
22143
|
var AiConnectionsContext = createContext30(void 0);
|
|
22042
22144
|
var AiConnectionsProvider = /* @__PURE__ */ __name(({ children }) => {
|
|
22043
22145
|
const t = useTranslations105();
|
|
22044
|
-
const [connections, setConnections] =
|
|
22045
|
-
const [providerRegistry, setProviderRegistry] =
|
|
22046
|
-
const [envDefaults, setEnvDefaults] =
|
|
22047
|
-
const [scopeCompanyId, setScopeCompanyId] =
|
|
22048
|
-
const [isLoading, setIsLoading] =
|
|
22146
|
+
const [connections, setConnections] = useState90([]);
|
|
22147
|
+
const [providerRegistry, setProviderRegistry] = useState90({});
|
|
22148
|
+
const [envDefaults, setEnvDefaults] = useState90({});
|
|
22149
|
+
const [scopeCompanyId, setScopeCompanyId] = useState90(null);
|
|
22150
|
+
const [isLoading, setIsLoading] = useState90(true);
|
|
22049
22151
|
const refresh = useCallback42(async () => {
|
|
22050
22152
|
setIsLoading(true);
|
|
22051
22153
|
try {
|
|
@@ -22079,7 +22181,7 @@ var useAiConnections = /* @__PURE__ */ __name(() => useContext30(AiConnectionsCo
|
|
|
22079
22181
|
|
|
22080
22182
|
// src/features/ai-connection/components/containers/AiConnectionsContainer.tsx
|
|
22081
22183
|
import { useTranslations as useTranslations109 } from "next-intl";
|
|
22082
|
-
import { useEffect as useEffect68, useMemo as useMemo44, useState as
|
|
22184
|
+
import { useEffect as useEffect68, useMemo as useMemo44, useState as useState92 } from "react";
|
|
22083
22185
|
|
|
22084
22186
|
// src/features/ai-connection/components/lists/AiConnectionTypeCard.tsx
|
|
22085
22187
|
import { ChevronDownIcon as ChevronDownIcon10, ChevronUpIcon as ChevronUpIcon3, PlusIcon as PlusIcon2 } from "lucide-react";
|
|
@@ -22089,13 +22191,13 @@ import { useMemo as useMemo43 } from "react";
|
|
|
22089
22191
|
// src/features/ai-connection/components/forms/AiConnectionDeleter.tsx
|
|
22090
22192
|
import { TrashIcon } from "lucide-react";
|
|
22091
22193
|
import { useTranslations as useTranslations106 } from "next-intl";
|
|
22092
|
-
import { useState as
|
|
22093
|
-
import { Fragment as
|
|
22194
|
+
import { useState as useState91 } from "react";
|
|
22195
|
+
import { Fragment as Fragment44, jsx as jsx234, jsxs as jsxs134 } from "react/jsx-runtime";
|
|
22094
22196
|
function AiConnectionDeleter({ connection }) {
|
|
22095
22197
|
const t = useTranslations106();
|
|
22096
22198
|
const { refresh } = useAiConnections();
|
|
22097
|
-
const [open, setOpen] =
|
|
22098
|
-
return /* @__PURE__ */ jsxs134(
|
|
22199
|
+
const [open, setOpen] = useState91(false);
|
|
22200
|
+
return /* @__PURE__ */ jsxs134(Fragment44, { children: [
|
|
22099
22201
|
/* @__PURE__ */ jsx234(
|
|
22100
22202
|
Button,
|
|
22101
22203
|
{
|
|
@@ -22375,7 +22477,7 @@ function AiConnectionEditor({
|
|
|
22375
22477
|
__name(AiConnectionEditor, "AiConnectionEditor");
|
|
22376
22478
|
|
|
22377
22479
|
// src/features/ai-connection/components/lists/AiConnectionTypeCard.tsx
|
|
22378
|
-
import { Fragment as
|
|
22480
|
+
import { Fragment as Fragment45, jsx as jsx236, jsxs as jsxs136 } from "react/jsx-runtime";
|
|
22379
22481
|
function toInput(connection, overrides) {
|
|
22380
22482
|
return {
|
|
22381
22483
|
id: connection.id,
|
|
@@ -22498,7 +22600,7 @@ function AiConnectionTypeCard({ connectionType }) {
|
|
|
22498
22600
|
children: /* @__PURE__ */ jsx236(ChevronDownIcon10, {})
|
|
22499
22601
|
}
|
|
22500
22602
|
),
|
|
22501
|
-
!readOnly && /* @__PURE__ */ jsxs136(
|
|
22603
|
+
!readOnly && /* @__PURE__ */ jsxs136(Fragment45, { children: [
|
|
22502
22604
|
/* @__PURE__ */ jsx236(
|
|
22503
22605
|
AiConnectionEditor,
|
|
22504
22606
|
{
|
|
@@ -22573,7 +22675,7 @@ __name(AiConnectionsContainer, "AiConnectionsContainer");
|
|
|
22573
22675
|
function AiConnectionsBody() {
|
|
22574
22676
|
const t = useTranslations109();
|
|
22575
22677
|
const { scopeCompanyId, setScopeCompanyId } = useAiConnections();
|
|
22576
|
-
const [companies, setCompanies] =
|
|
22678
|
+
const [companies, setCompanies] = useState92([]);
|
|
22577
22679
|
useEffect68(() => {
|
|
22578
22680
|
let active = true;
|
|
22579
22681
|
CompanyService.findMany({}).then((response) => {
|
|
@@ -22691,7 +22793,7 @@ __name(RelevantContentsList, "RelevantContentsList");
|
|
|
22691
22793
|
// src/features/how-to/components/containers/HowToCommand.tsx
|
|
22692
22794
|
import { ArrowRight, LifeBuoyIcon } from "lucide-react";
|
|
22693
22795
|
import { useTranslations as useTranslations114 } from "next-intl";
|
|
22694
|
-
import { useCallback as useCallback44, useEffect as useEffect69, useMemo as useMemo46, useRef as useRef40, useState as
|
|
22796
|
+
import { useCallback as useCallback44, useEffect as useEffect69, useMemo as useMemo46, useRef as useRef40, useState as useState93 } from "react";
|
|
22695
22797
|
|
|
22696
22798
|
// src/features/how-to/components/containers/HowToCommandViewer.tsx
|
|
22697
22799
|
import { ArrowLeft, BookOpen, MessageSquare } from "lucide-react";
|
|
@@ -22804,7 +22906,7 @@ function HowToCommandViewer({ howTo, onBack, onStartChat }) {
|
|
|
22804
22906
|
__name(HowToCommandViewer, "HowToCommandViewer");
|
|
22805
22907
|
|
|
22806
22908
|
// src/features/how-to/components/containers/HowToCommand.tsx
|
|
22807
|
-
import { Fragment as
|
|
22909
|
+
import { Fragment as Fragment46, jsx as jsx242, jsxs as jsxs140 } from "react/jsx-runtime";
|
|
22808
22910
|
function matchPage(pathname, pattern) {
|
|
22809
22911
|
if (pattern.includes(":")) {
|
|
22810
22912
|
const pathSegments = pathname.split("/").filter(Boolean);
|
|
@@ -22817,10 +22919,10 @@ function matchPage(pathname, pattern) {
|
|
|
22817
22919
|
__name(matchPage, "matchPage");
|
|
22818
22920
|
function HowToCommand({ pathname, contextKeys, extraGroups, onStartChat }) {
|
|
22819
22921
|
const t = useTranslations114();
|
|
22820
|
-
const [dialogOpen, setDialogOpen] =
|
|
22821
|
-
const [selectedHowTo, setSelectedHowTo] =
|
|
22922
|
+
const [dialogOpen, setDialogOpen] = useState93(false);
|
|
22923
|
+
const [selectedHowTo, setSelectedHowTo] = useState93(null);
|
|
22822
22924
|
const searchTermRef = useRef40("");
|
|
22823
|
-
const [searchTerm, setSearchTerm] =
|
|
22925
|
+
const [searchTerm, setSearchTerm] = useState93("");
|
|
22824
22926
|
const data = useDataListRetriever({
|
|
22825
22927
|
retriever: /* @__PURE__ */ __name((params) => {
|
|
22826
22928
|
return HowToService.findMany(params);
|
|
@@ -22875,7 +22977,7 @@ function HowToCommand({ pathname, contextKeys, extraGroups, onStartChat }) {
|
|
|
22875
22977
|
setSelectedHowTo(null);
|
|
22876
22978
|
if (onStartChat) onStartChat();
|
|
22877
22979
|
}, "handleStartChat");
|
|
22878
|
-
return /* @__PURE__ */ jsxs140(
|
|
22980
|
+
return /* @__PURE__ */ jsxs140(Fragment46, { children: [
|
|
22879
22981
|
/* @__PURE__ */ jsxs140(
|
|
22880
22982
|
SidebarMenuButton,
|
|
22881
22983
|
{
|
|
@@ -23043,7 +23145,7 @@ import { useTranslations as useTranslations118 } from "next-intl";
|
|
|
23043
23145
|
// src/features/how-to/hooks/useHowToTableStructure.tsx
|
|
23044
23146
|
import { useTranslations as useTranslations116 } from "next-intl";
|
|
23045
23147
|
import { useMemo as useMemo47 } from "react";
|
|
23046
|
-
import { Fragment as
|
|
23148
|
+
import { Fragment as Fragment47, jsx as jsx246 } from "react/jsx-runtime";
|
|
23047
23149
|
var useHowToTableStructure = /* @__PURE__ */ __name((params) => {
|
|
23048
23150
|
const t = useTranslations116();
|
|
23049
23151
|
const generateUrl = usePageUrlGenerator();
|
|
@@ -23080,7 +23182,7 @@ var useHowToTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
23080
23182
|
id: "description",
|
|
23081
23183
|
accessorKey: "description",
|
|
23082
23184
|
header: t(`howto.fields.description.label`),
|
|
23083
|
-
cell: /* @__PURE__ */ __name(({ row }) => /* @__PURE__ */ jsx246(
|
|
23185
|
+
cell: /* @__PURE__ */ __name(({ row }) => /* @__PURE__ */ jsx246(Fragment47, { children: row.getValue("description") }), "cell"),
|
|
23084
23186
|
enableSorting: false,
|
|
23085
23187
|
enableHiding: false
|
|
23086
23188
|
}),
|
|
@@ -23088,7 +23190,7 @@ var useHowToTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
23088
23190
|
id: "pages",
|
|
23089
23191
|
accessorKey: "pages",
|
|
23090
23192
|
header: t(`howto.fields.pages.label`),
|
|
23091
|
-
cell: /* @__PURE__ */ __name(({ row }) => /* @__PURE__ */ jsx246(
|
|
23193
|
+
cell: /* @__PURE__ */ __name(({ row }) => /* @__PURE__ */ jsx246(Fragment47, { children: row.getValue("pages") }), "cell"),
|
|
23092
23194
|
enableSorting: false,
|
|
23093
23195
|
enableHiding: false
|
|
23094
23196
|
}),
|
|
@@ -23110,11 +23212,11 @@ registerTableGenerator("howtos", useHowToTableStructure);
|
|
|
23110
23212
|
|
|
23111
23213
|
// src/features/how-to/components/forms/HowToReindexButton.tsx
|
|
23112
23214
|
import { useTranslations as useTranslations117 } from "next-intl";
|
|
23113
|
-
import { useState as
|
|
23215
|
+
import { useState as useState94 } from "react";
|
|
23114
23216
|
import { jsx as jsx247 } from "react/jsx-runtime";
|
|
23115
23217
|
function HowToReindexButton({ refresh }) {
|
|
23116
23218
|
const t = useTranslations117();
|
|
23117
|
-
const [isReindexing, setIsReindexing] =
|
|
23219
|
+
const [isReindexing, setIsReindexing] = useState94(false);
|
|
23118
23220
|
const onReindex = /* @__PURE__ */ __name(async () => {
|
|
23119
23221
|
setIsReindexing(true);
|
|
23120
23222
|
try {
|
|
@@ -23173,8 +23275,8 @@ __name(HowToListContainer, "HowToListContainer");
|
|
|
23173
23275
|
// src/features/how-to/components/forms/HowToSelector.tsx
|
|
23174
23276
|
import { CircleX as CircleX3, RefreshCwIcon as RefreshCwIcon5, SearchIcon as SearchIcon7, XIcon as XIcon11 } from "lucide-react";
|
|
23175
23277
|
import { useTranslations as useTranslations119 } from "next-intl";
|
|
23176
|
-
import { useCallback as useCallback45, useEffect as useEffect70, useRef as useRef41, useState as
|
|
23177
|
-
import { Fragment as
|
|
23278
|
+
import { useCallback as useCallback45, useEffect as useEffect70, useRef as useRef41, useState as useState95 } from "react";
|
|
23279
|
+
import { Fragment as Fragment48, jsx as jsx250, jsxs as jsxs142 } from "react/jsx-runtime";
|
|
23178
23280
|
function HowToSelector({
|
|
23179
23281
|
id,
|
|
23180
23282
|
form,
|
|
@@ -23184,10 +23286,10 @@ function HowToSelector({
|
|
|
23184
23286
|
isRequired = false
|
|
23185
23287
|
}) {
|
|
23186
23288
|
const t = useTranslations119();
|
|
23187
|
-
const [open, setOpen] =
|
|
23289
|
+
const [open, setOpen] = useState95(false);
|
|
23188
23290
|
const searchTermRef = useRef41("");
|
|
23189
|
-
const [searchTerm, setSearchTerm] =
|
|
23190
|
-
const [isSearching, setIsSearching] =
|
|
23291
|
+
const [searchTerm, setSearchTerm] = useState95("");
|
|
23292
|
+
const [isSearching, setIsSearching] = useState95(false);
|
|
23191
23293
|
const data = useDataListRetriever({
|
|
23192
23294
|
retriever: /* @__PURE__ */ __name((params) => {
|
|
23193
23295
|
return HowToService.findMany(params);
|
|
@@ -23259,7 +23361,7 @@ function HowToSelector({
|
|
|
23259
23361
|
search("");
|
|
23260
23362
|
}
|
|
23261
23363
|
}
|
|
23262
|
-
) : /* @__PURE__ */ jsx250(
|
|
23364
|
+
) : /* @__PURE__ */ jsx250(Fragment48, {})
|
|
23263
23365
|
] }),
|
|
23264
23366
|
/* @__PURE__ */ jsx250(CommandList, { children: data.data && data.data.length > 0 && data.data.map((howTo) => /* @__PURE__ */ jsx250(
|
|
23265
23367
|
CommandItem,
|
|
@@ -23278,7 +23380,7 @@ __name(HowToSelector, "HowToSelector");
|
|
|
23278
23380
|
|
|
23279
23381
|
// src/features/handbook/components/lists/HandbookContents.tsx
|
|
23280
23382
|
import { useTranslations as useTranslations135 } from "next-intl";
|
|
23281
|
-
import { useCallback as useCallback49, useEffect as useEffect74, useMemo as useMemo53, useState as
|
|
23383
|
+
import { useCallback as useCallback49, useEffect as useEffect74, useMemo as useMemo53, useState as useState103 } from "react";
|
|
23282
23384
|
|
|
23283
23385
|
// src/features/handbook/contexts/HandbookContext.tsx
|
|
23284
23386
|
import { useTranslations as useTranslations120 } from "next-intl";
|
|
@@ -23333,10 +23435,10 @@ var HandbookProvider = /* @__PURE__ */ __name(({ children, page, section, functi
|
|
|
23333
23435
|
import { MessagesSquareIcon, Sparkles as Sparkles2 } from "lucide-react";
|
|
23334
23436
|
import { useTranslations as useTranslations132 } from "next-intl";
|
|
23335
23437
|
import Link5 from "next/link";
|
|
23336
|
-
import { useCallback as useCallback48, useState as
|
|
23438
|
+
import { useCallback as useCallback48, useState as useState101 } from "react";
|
|
23337
23439
|
|
|
23338
23440
|
// src/features/assistant/components/parts/AssistantComposer.tsx
|
|
23339
|
-
import { useState as
|
|
23441
|
+
import { useState as useState96 } from "react";
|
|
23340
23442
|
import { useTranslations as useTranslations121 } from "next-intl";
|
|
23341
23443
|
import { ArrowUp } from "lucide-react";
|
|
23342
23444
|
import { jsx as jsx252, jsxs as jsxs143 } from "react/jsx-runtime";
|
|
@@ -23350,7 +23452,7 @@ function AssistantComposer({
|
|
|
23350
23452
|
leading
|
|
23351
23453
|
}) {
|
|
23352
23454
|
const t = useTranslations121();
|
|
23353
|
-
const [internal, setInternal] =
|
|
23455
|
+
const [internal, setInternal] = useState96("");
|
|
23354
23456
|
const value = controlled ?? internal;
|
|
23355
23457
|
const setValue = onValueChange ?? setInternal;
|
|
23356
23458
|
const canSend = value.trim().length > 0 && !disabled;
|
|
@@ -23410,10 +23512,10 @@ import ReactMarkdown3, { defaultUrlTransform } from "react-markdown";
|
|
|
23410
23512
|
import remarkGfm3 from "remark-gfm";
|
|
23411
23513
|
|
|
23412
23514
|
// src/features/assistant-message/components/parts/MessageSourcesContainer.tsx
|
|
23413
|
-
import { useEffect as useEffect71, useMemo as useMemo49, useState as
|
|
23515
|
+
import { useEffect as useEffect71, useMemo as useMemo49, useState as useState99 } from "react";
|
|
23414
23516
|
|
|
23415
23517
|
// src/features/assistant-message/components/parts/MessageSourcesPanel.tsx
|
|
23416
|
-
import { useMemo as useMemo48, useState as
|
|
23518
|
+
import { useMemo as useMemo48, useState as useState98 } from "react";
|
|
23417
23519
|
import { useTranslations as useTranslations128 } from "next-intl";
|
|
23418
23520
|
import { ChevronDown as ChevronDown4, ChevronRight as ChevronRight2 } from "lucide-react";
|
|
23419
23521
|
|
|
@@ -23472,7 +23574,7 @@ function ReferencesTab({ references }) {
|
|
|
23472
23574
|
__name(ReferencesTab, "ReferencesTab");
|
|
23473
23575
|
|
|
23474
23576
|
// src/features/assistant-message/components/parts/tabs/CitationsTab.tsx
|
|
23475
|
-
import { Fragment as
|
|
23577
|
+
import { Fragment as Fragment49, useState as useState97 } from "react";
|
|
23476
23578
|
import { useTranslations as useTranslations125 } from "next-intl";
|
|
23477
23579
|
import { ChevronDown as ChevronDown3, HelpCircle } from "lucide-react";
|
|
23478
23580
|
import ReactMarkdown2 from "react-markdown";
|
|
@@ -23515,7 +23617,7 @@ function CitationsTab({ citations, sources }) {
|
|
|
23515
23617
|
const t = useTranslations125();
|
|
23516
23618
|
const entityLabel = useEntityLabel();
|
|
23517
23619
|
const isMobile = useIsMobile();
|
|
23518
|
-
const [expanded, setExpanded] =
|
|
23620
|
+
const [expanded, setExpanded] = useState97(/* @__PURE__ */ new Set());
|
|
23519
23621
|
if (citations.length === 0) return null;
|
|
23520
23622
|
const sorted = [...citations].sort((a, b) => (b.relevance ?? 0) - (a.relevance ?? 0));
|
|
23521
23623
|
const toggle = /* @__PURE__ */ __name((id) => {
|
|
@@ -23537,7 +23639,7 @@ function CitationsTab({ citations, sources }) {
|
|
|
23537
23639
|
const typeLabel = chunk.nodeType ? entityLabel(chunk.nodeType) : t("features.assistant.message.sources.source");
|
|
23538
23640
|
const fallbackName = chunk.nodeId ? `${typeLabel} ${chunk.nodeId.slice(0, 8)}` : typeLabel;
|
|
23539
23641
|
const sourceName = resolved?.name ?? fallbackName;
|
|
23540
|
-
return /* @__PURE__ */ jsxs146(
|
|
23642
|
+
return /* @__PURE__ */ jsxs146(Fragment49, { children: [
|
|
23541
23643
|
/* @__PURE__ */ jsxs146(TableRow, { children: [
|
|
23542
23644
|
/* @__PURE__ */ jsx255(TableCell, { children: /* @__PURE__ */ jsxs146(
|
|
23543
23645
|
"div",
|
|
@@ -23782,8 +23884,8 @@ function MessageSourcesPanel({ message, isLatestAssistant, onSelectFollowUp, sou
|
|
|
23782
23884
|
if (usersCount > 0) visibleTabs.push("users");
|
|
23783
23885
|
const autoOpen = isLatestAssistant && suggestionsCount > 0;
|
|
23784
23886
|
const initialTab = autoOpen ? "suggested" : visibleTabs[0];
|
|
23785
|
-
const [open, setOpen] =
|
|
23786
|
-
const [active, setActive] =
|
|
23887
|
+
const [open, setOpen] = useState98(autoOpen);
|
|
23888
|
+
const [active, setActive] = useState98(initialTab);
|
|
23787
23889
|
if (total === 0) return null;
|
|
23788
23890
|
const panelId = `sources-panel-${message.id}`;
|
|
23789
23891
|
return /* @__PURE__ */ jsxs149("div", { className: "mt-2 w-full min-w-0", children: [
|
|
@@ -23865,7 +23967,7 @@ function MessageSourcesContainer({ message, isLatestAssistant, onSelectFollowUp
|
|
|
23865
23967
|
}
|
|
23866
23968
|
return parts.sort().join("|");
|
|
23867
23969
|
}, [groups]);
|
|
23868
|
-
const [resolved, setResolved] =
|
|
23970
|
+
const [resolved, setResolved] = useState99([]);
|
|
23869
23971
|
useEffect71(() => {
|
|
23870
23972
|
if (groups.size === 0) {
|
|
23871
23973
|
setResolved((current) => current.length === 0 ? current : []);
|
|
@@ -23933,7 +24035,7 @@ function MessageSourcesContainer({ message, isLatestAssistant, onSelectFollowUp
|
|
|
23933
24035
|
__name(MessageSourcesContainer, "MessageSourcesContainer");
|
|
23934
24036
|
|
|
23935
24037
|
// src/features/assistant-message/components/MessageItem.tsx
|
|
23936
|
-
import { Fragment as
|
|
24038
|
+
import { Fragment as Fragment50, jsx as jsx261, jsxs as jsxs150 } from "react/jsx-runtime";
|
|
23937
24039
|
var MENTION_HREF = /^mention:\/\/([^/]+)\/(.+)$/;
|
|
23938
24040
|
function mentionUrlTransform(url) {
|
|
23939
24041
|
return MENTION_HREF.test(url) ? url : defaultUrlTransform(url);
|
|
@@ -23956,7 +24058,7 @@ function MessageItem({
|
|
|
23956
24058
|
a: /* @__PURE__ */ __name(({ href, children }) => {
|
|
23957
24059
|
const match = href ? MENTION_HREF.exec(href) : null;
|
|
23958
24060
|
if (!match || !renderMention) return /* @__PURE__ */ jsx261("a", { href, children });
|
|
23959
|
-
return /* @__PURE__ */ jsx261(
|
|
24061
|
+
return /* @__PURE__ */ jsx261(Fragment50, { children: renderMention({ type: match[1], id: match[2], alias: String(children ?? "") }) });
|
|
23960
24062
|
}, "a")
|
|
23961
24063
|
}),
|
|
23962
24064
|
[renderMention]
|
|
@@ -24080,7 +24182,7 @@ __name(AssistantThread, "AssistantThread");
|
|
|
24080
24182
|
|
|
24081
24183
|
// src/features/handbook/hooks/useHandbookAsk.ts
|
|
24082
24184
|
import { useTranslations as useTranslations131 } from "next-intl";
|
|
24083
|
-
import { useCallback as useCallback47, useEffect as useEffect73, useState as
|
|
24185
|
+
import { useCallback as useCallback47, useEffect as useEffect73, useState as useState100 } from "react";
|
|
24084
24186
|
import { v4 as v413 } from "uuid";
|
|
24085
24187
|
function withSources(messages, label) {
|
|
24086
24188
|
return messages.map((message) => withSourcesInContent(message, label));
|
|
@@ -24108,10 +24210,10 @@ function useHandbookAsk(params) {
|
|
|
24108
24210
|
const generateUrl = usePageUrlGenerator();
|
|
24109
24211
|
const shouldSyncUrl = params?.syncUrl ?? true;
|
|
24110
24212
|
const handbookThreadId = params?.handbookThreadId;
|
|
24111
|
-
const [threads, setThreads] =
|
|
24112
|
-
const [thread, setThread] =
|
|
24113
|
-
const [messages, setMessages] =
|
|
24114
|
-
const [sending, setSending] =
|
|
24213
|
+
const [threads, setThreads] = useState100([]);
|
|
24214
|
+
const [thread, setThread] = useState100(void 0);
|
|
24215
|
+
const [messages, setMessages] = useState100([]);
|
|
24216
|
+
const [sending, setSending] = useState100(false);
|
|
24115
24217
|
const sourcesLabel = t("handbook.chat.sources");
|
|
24116
24218
|
useEffect73(() => {
|
|
24117
24219
|
let cancelled = false;
|
|
@@ -24216,7 +24318,7 @@ function HandbookAskSheet({ handbookPageId } = {}) {
|
|
|
24216
24318
|
const t = useTranslations132();
|
|
24217
24319
|
const generateUrl = usePageUrlGenerator();
|
|
24218
24320
|
const { threads, thread, messages, sending, ask, selectThread } = useHandbookAsk({ syncUrl: false });
|
|
24219
|
-
const [scoped, setScoped] =
|
|
24321
|
+
const [scoped, setScoped] = useState101(false);
|
|
24220
24322
|
const chatUrl = `${generateUrl({ page: Modules.HandbookPage })}/chat`;
|
|
24221
24323
|
const showThread = !!thread || sending || messages.length > 0;
|
|
24222
24324
|
const send = useCallback48(
|
|
@@ -24277,11 +24379,11 @@ __name(HandbookAskSheet, "HandbookAskSheet");
|
|
|
24277
24379
|
|
|
24278
24380
|
// src/features/handbook/components/forms/HandbookSyncButton.tsx
|
|
24279
24381
|
import { useTranslations as useTranslations133 } from "next-intl";
|
|
24280
|
-
import { useState as
|
|
24382
|
+
import { useState as useState102 } from "react";
|
|
24281
24383
|
import { jsx as jsx266 } from "react/jsx-runtime";
|
|
24282
24384
|
function HandbookSyncButton({ refresh }) {
|
|
24283
24385
|
const t = useTranslations133();
|
|
24284
|
-
const [isSyncing, setIsSyncing] =
|
|
24386
|
+
const [isSyncing, setIsSyncing] = useState102(false);
|
|
24285
24387
|
const onSync = /* @__PURE__ */ __name(async () => {
|
|
24286
24388
|
setIsSyncing(true);
|
|
24287
24389
|
try {
|
|
@@ -24395,13 +24497,13 @@ function splitByNesting(pages) {
|
|
|
24395
24497
|
__name(splitByNesting, "splitByNesting");
|
|
24396
24498
|
|
|
24397
24499
|
// src/features/handbook/components/lists/HandbookContents.tsx
|
|
24398
|
-
import { Fragment as
|
|
24500
|
+
import { Fragment as Fragment51, jsx as jsx269, jsxs as jsxs156 } from "react/jsx-runtime";
|
|
24399
24501
|
function HandbookContents() {
|
|
24400
24502
|
const t = useTranslations135();
|
|
24401
|
-
const [pages, setPages] =
|
|
24402
|
-
const [sections, setSections] =
|
|
24403
|
-
const [isLoading, setIsLoading] =
|
|
24404
|
-
const [reloadToken, setReloadToken] =
|
|
24503
|
+
const [pages, setPages] = useState103([]);
|
|
24504
|
+
const [sections, setSections] = useState103([]);
|
|
24505
|
+
const [isLoading, setIsLoading] = useState103(true);
|
|
24506
|
+
const [reloadToken, setReloadToken] = useState103(0);
|
|
24405
24507
|
useEffect74(() => {
|
|
24406
24508
|
let cancelled = false;
|
|
24407
24509
|
const load = /* @__PURE__ */ __name(async () => {
|
|
@@ -24434,7 +24536,7 @@ function HandbookContents() {
|
|
|
24434
24536
|
return /* @__PURE__ */ jsx269(
|
|
24435
24537
|
HandbookProvider,
|
|
24436
24538
|
{
|
|
24437
|
-
functions: /* @__PURE__ */ jsxs156(
|
|
24539
|
+
functions: /* @__PURE__ */ jsxs156(Fragment51, { children: [
|
|
24438
24540
|
/* @__PURE__ */ jsx269(HandbookAskSheet, {}),
|
|
24439
24541
|
/* @__PURE__ */ jsx269(HandbookSyncButton, { refresh }),
|
|
24440
24542
|
/* @__PURE__ */ jsx269(HandbookIndexStatus, { pages })
|
|
@@ -24492,7 +24594,7 @@ __name(HandbookAdminContainer, "HandbookAdminContainer");
|
|
|
24492
24594
|
|
|
24493
24595
|
// src/features/handbook/components/containers/HandbookPageContainer.tsx
|
|
24494
24596
|
import { useTranslations as useTranslations139 } from "next-intl";
|
|
24495
|
-
import { useEffect as useEffect77, useMemo as useMemo56, useState as
|
|
24597
|
+
import { useEffect as useEffect77, useMemo as useMemo56, useState as useState105 } from "react";
|
|
24496
24598
|
|
|
24497
24599
|
// src/features/handbook/components/details/HandbookPageDetails.tsx
|
|
24498
24600
|
import { jsx as jsx271 } from "react/jsx-runtime";
|
|
@@ -24548,13 +24650,13 @@ __name(HandbookPageNeighbours, "HandbookPageNeighbours");
|
|
|
24548
24650
|
// src/features/handbook/components/details/HandbookPageToc.tsx
|
|
24549
24651
|
import { List } from "lucide-react";
|
|
24550
24652
|
import { useTranslations as useTranslations137 } from "next-intl";
|
|
24551
|
-
import { useCallback as useCallback50, useEffect as useEffect75, useState as
|
|
24653
|
+
import { useCallback as useCallback50, useEffect as useEffect75, useState as useState104 } from "react";
|
|
24552
24654
|
import { jsx as jsx273, jsxs as jsxs158 } from "react/jsx-runtime";
|
|
24553
24655
|
function HandbookPageToc({ containerId }) {
|
|
24554
24656
|
const t = useTranslations137();
|
|
24555
|
-
const [activeId, setActiveId] =
|
|
24556
|
-
const [headings, setHeadings] =
|
|
24557
|
-
const [headingsWithIds, setHeadingsWithIds] =
|
|
24657
|
+
const [activeId, setActiveId] = useState104(null);
|
|
24658
|
+
const [headings, setHeadings] = useState104([]);
|
|
24659
|
+
const [headingsWithIds, setHeadingsWithIds] = useState104(/* @__PURE__ */ new Map());
|
|
24558
24660
|
useEffect75(() => {
|
|
24559
24661
|
const contentPanel = document.getElementById(containerId);
|
|
24560
24662
|
if (!contentPanel) return;
|
|
@@ -24719,10 +24821,10 @@ import { jsx as jsx275, jsxs as jsxs160 } from "react/jsx-runtime";
|
|
|
24719
24821
|
var CONTENT_CONTAINER_ID = "handbook-page-content";
|
|
24720
24822
|
function HandbookPageContainer({ handbookPageId }) {
|
|
24721
24823
|
const t = useTranslations139();
|
|
24722
|
-
const [handbookPage, setHandbookPage] =
|
|
24723
|
-
const [pages, setPages] =
|
|
24724
|
-
const [sections, setSections] =
|
|
24725
|
-
const [isLoading, setIsLoading] =
|
|
24824
|
+
const [handbookPage, setHandbookPage] = useState105(void 0);
|
|
24825
|
+
const [pages, setPages] = useState105([]);
|
|
24826
|
+
const [sections, setSections] = useState105([]);
|
|
24827
|
+
const [isLoading, setIsLoading] = useState105(true);
|
|
24726
24828
|
useEffect77(() => {
|
|
24727
24829
|
let cancelled = false;
|
|
24728
24830
|
const load = /* @__PURE__ */ __name(async () => {
|
|
@@ -24825,7 +24927,7 @@ function groupThreadsByBucket(threads) {
|
|
|
24825
24927
|
__name(groupThreadsByBucket, "groupThreadsByBucket");
|
|
24826
24928
|
|
|
24827
24929
|
// src/features/assistant/components/parts/AssistantSidebar.tsx
|
|
24828
|
-
import { Fragment as
|
|
24930
|
+
import { Fragment as Fragment52, jsx as jsx276, jsxs as jsxs161 } from "react/jsx-runtime";
|
|
24829
24931
|
function AssistantSidebar({
|
|
24830
24932
|
threads,
|
|
24831
24933
|
activeId,
|
|
@@ -24862,7 +24964,7 @@ function AssistantSidebar({
|
|
|
24862
24964
|
" ",
|
|
24863
24965
|
newLabel ?? t("features.assistant.new")
|
|
24864
24966
|
] }) }),
|
|
24865
|
-
/* @__PURE__ */ jsx276("div", { className: "flex-1 overflow-y-auto p-2", children: threads.length === 0 ? /* @__PURE__ */ jsx276("div", { className: "text-muted-foreground mt-6 text-center text-xs", children: emptyLabel ?? t("features.assistant.empty_sidebar") }) : /* @__PURE__ */ jsxs161(
|
|
24967
|
+
/* @__PURE__ */ jsx276("div", { className: "flex-1 overflow-y-auto p-2", children: threads.length === 0 ? /* @__PURE__ */ jsx276("div", { className: "text-muted-foreground mt-6 text-center text-xs", children: emptyLabel ?? t("features.assistant.empty_sidebar") }) : /* @__PURE__ */ jsxs161(Fragment52, { children: [
|
|
24866
24968
|
renderSection(t("features.assistant.bucket_today"), groups.today),
|
|
24867
24969
|
renderSection(t("features.assistant.bucket_week"), groups.thisWeek),
|
|
24868
24970
|
renderSection(t("features.assistant.bucket_earlier"), groups.earlier)
|
|
@@ -24872,7 +24974,7 @@ function AssistantSidebar({
|
|
|
24872
24974
|
__name(AssistantSidebar, "AssistantSidebar");
|
|
24873
24975
|
|
|
24874
24976
|
// src/features/handbook/components/containers/HandbookAskContainer.tsx
|
|
24875
|
-
import { Fragment as
|
|
24977
|
+
import { Fragment as Fragment53, jsx as jsx277, jsxs as jsxs162 } from "react/jsx-runtime";
|
|
24876
24978
|
function HandbookAskContainer({ handbookThreadId } = {}) {
|
|
24877
24979
|
const t = useTranslations141();
|
|
24878
24980
|
const { threads, thread, messages, sending, ask, selectThread, startNew } = useHandbookAsk({ handbookThreadId });
|
|
@@ -24913,7 +25015,7 @@ function HandbookAskContainer({ handbookThreadId } = {}) {
|
|
|
24913
25015
|
detailsIcon: /* @__PURE__ */ jsx277(MessagesSquareIcon2, {}),
|
|
24914
25016
|
details,
|
|
24915
25017
|
children: /* @__PURE__ */ jsxs162("div", { className: "flex h-full min-h-0 w-full flex-col overflow-hidden", children: [
|
|
24916
|
-
showThread ? /* @__PURE__ */ jsx277(
|
|
25018
|
+
showThread ? /* @__PURE__ */ jsx277(Fragment53, { children: /* @__PURE__ */ jsx277(
|
|
24917
25019
|
AssistantThread,
|
|
24918
25020
|
{
|
|
24919
25021
|
messages,
|
|
@@ -24948,30 +25050,30 @@ import { useTranslations as useTranslations144 } from "next-intl";
|
|
|
24948
25050
|
import { useMemo as useMemo58 } from "react";
|
|
24949
25051
|
|
|
24950
25052
|
// src/features/assistant-message/components/EntityMentionLink.tsx
|
|
24951
|
-
import { Fragment as
|
|
25053
|
+
import { Fragment as Fragment54, jsx as jsx278 } from "react/jsx-runtime";
|
|
24952
25054
|
function EntityMentionLinkView({ type, id, alias }) {
|
|
24953
25055
|
const generate = usePageUrlGenerator();
|
|
24954
25056
|
let module;
|
|
24955
25057
|
try {
|
|
24956
25058
|
module = ModuleRegistry.findByName(type);
|
|
24957
25059
|
} catch {
|
|
24958
|
-
return /* @__PURE__ */ jsx278(
|
|
25060
|
+
return /* @__PURE__ */ jsx278(Fragment54, { children: alias });
|
|
24959
25061
|
}
|
|
24960
|
-
if (!module?.pageUrl) return /* @__PURE__ */ jsx278(
|
|
25062
|
+
if (!module?.pageUrl) return /* @__PURE__ */ jsx278(Fragment54, { children: alias });
|
|
24961
25063
|
return /* @__PURE__ */ jsx278(Link, { href: generate({ page: module, id }), children: alias });
|
|
24962
25064
|
}
|
|
24963
25065
|
__name(EntityMentionLinkView, "EntityMentionLinkView");
|
|
24964
25066
|
var EntityMentionLink = /* @__PURE__ */ __name((p) => /* @__PURE__ */ jsx278(EntityMentionLinkView, { ...p }), "EntityMentionLink");
|
|
24965
25067
|
|
|
24966
25068
|
// src/features/assistant/components/parts/AssistantEmptyState.tsx
|
|
24967
|
-
import { useState as
|
|
25069
|
+
import { useState as useState106 } from "react";
|
|
24968
25070
|
import { useTranslations as useTranslations142 } from "next-intl";
|
|
24969
25071
|
import { Sparkles as Sparkles4 } from "lucide-react";
|
|
24970
25072
|
import { jsx as jsx279, jsxs as jsxs163 } from "react/jsx-runtime";
|
|
24971
25073
|
var STARTER_KEYS = ["a", "b", "c", "d"];
|
|
24972
25074
|
function AssistantEmptyState({ onSend, operatorMode = false, onOperatorModeChange, composerLeading }) {
|
|
24973
25075
|
const t = useTranslations142();
|
|
24974
|
-
const [draft, setDraft] =
|
|
25076
|
+
const [draft, setDraft] = useState106("");
|
|
24975
25077
|
return /* @__PURE__ */ jsx279("div", { className: "flex h-full w-full items-center justify-center p-10", children: /* @__PURE__ */ jsxs163("div", { className: "flex w-full max-w-2xl flex-col gap-6", children: [
|
|
24976
25078
|
/* @__PURE__ */ jsxs163("div", { className: "text-center", children: [
|
|
24977
25079
|
/* @__PURE__ */ jsx279("div", { className: "mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-full bg-gradient-to-br from-blue-400 to-violet-500 text-white", children: /* @__PURE__ */ jsx279(Sparkles4, { className: "h-5 w-5" }) }),
|
|
@@ -25009,14 +25111,14 @@ function AssistantEmptyState({ onSend, operatorMode = false, onOperatorModeChang
|
|
|
25009
25111
|
__name(AssistantEmptyState, "AssistantEmptyState");
|
|
25010
25112
|
|
|
25011
25113
|
// src/features/assistant/components/parts/AssistantThreadHeader.tsx
|
|
25012
|
-
import { useState as
|
|
25114
|
+
import { useState as useState107 } from "react";
|
|
25013
25115
|
import { useTranslations as useTranslations143 } from "next-intl";
|
|
25014
25116
|
import { jsx as jsx280, jsxs as jsxs164 } from "react/jsx-runtime";
|
|
25015
25117
|
function AssistantThreadHeader({ assistant, onRename, onDelete, renamePlaceholder, deleteConfirmLabel }) {
|
|
25016
25118
|
const t = useTranslations143();
|
|
25017
|
-
const [renameValue, setRenameValue] =
|
|
25018
|
-
const [renameOpen, setRenameOpen] =
|
|
25019
|
-
const [deleteOpen, setDeleteOpen] =
|
|
25119
|
+
const [renameValue, setRenameValue] = useState107(assistant.title);
|
|
25120
|
+
const [renameOpen, setRenameOpen] = useState107(false);
|
|
25121
|
+
const [deleteOpen, setDeleteOpen] = useState107(false);
|
|
25020
25122
|
const handleRename = /* @__PURE__ */ __name(async () => {
|
|
25021
25123
|
const trimmed = renameValue.trim() || assistant.title;
|
|
25022
25124
|
await onRename(trimmed);
|
|
@@ -25069,7 +25171,7 @@ function AssistantThreadHeader({ assistant, onRename, onDelete, renamePlaceholde
|
|
|
25069
25171
|
__name(AssistantThreadHeader, "AssistantThreadHeader");
|
|
25070
25172
|
|
|
25071
25173
|
// src/features/assistant/components/containers/AssistantContainer.tsx
|
|
25072
|
-
import { Fragment as
|
|
25174
|
+
import { Fragment as Fragment55, jsx as jsx281, jsxs as jsxs165 } from "react/jsx-runtime";
|
|
25073
25175
|
function AssistantContainer({
|
|
25074
25176
|
renderApprovalAction,
|
|
25075
25177
|
renderMention,
|
|
@@ -25097,7 +25199,7 @@ function AssistantContainer({
|
|
|
25097
25199
|
),
|
|
25098
25200
|
[ctx.threads, ctx.assistant?.id, ctx.selectThread, renderThreadBadge]
|
|
25099
25201
|
);
|
|
25100
|
-
const thread = /* @__PURE__ */ jsx281(
|
|
25202
|
+
const thread = /* @__PURE__ */ jsx281(Fragment55, { children: !showThread ? /* @__PURE__ */ jsx281(
|
|
25101
25203
|
AssistantEmptyState,
|
|
25102
25204
|
{
|
|
25103
25205
|
onSend: ctx.sendMessage,
|
|
@@ -25105,7 +25207,7 @@ function AssistantContainer({
|
|
|
25105
25207
|
onOperatorModeChange: showOperatorToggle ? ctx.setOperatorMode : void 0,
|
|
25106
25208
|
composerLeading: renderScopePicker?.()
|
|
25107
25209
|
}
|
|
25108
|
-
) : /* @__PURE__ */ jsxs165(
|
|
25210
|
+
) : /* @__PURE__ */ jsxs165(Fragment55, { children: [
|
|
25109
25211
|
ctx.assistant ? /* @__PURE__ */ jsx281(
|
|
25110
25212
|
AssistantThreadHeader,
|
|
25111
25213
|
{
|
|
@@ -25168,7 +25270,7 @@ import { useTranslations as useTranslations146 } from "next-intl";
|
|
|
25168
25270
|
// src/features/assistant/components/parts/AssistantBlockNoteComposer.tsx
|
|
25169
25271
|
import { ArrowUp as ArrowUp2 } from "lucide-react";
|
|
25170
25272
|
import { useTranslations as useTranslations145 } from "next-intl";
|
|
25171
|
-
import { useCallback as useCallback51, useId as useId5, useState as
|
|
25273
|
+
import { useCallback as useCallback51, useId as useId5, useState as useState108 } from "react";
|
|
25172
25274
|
import { jsx as jsx282, jsxs as jsxs166 } from "react/jsx-runtime";
|
|
25173
25275
|
function flattenBlocks(blocks) {
|
|
25174
25276
|
const lines = [];
|
|
@@ -25206,9 +25308,9 @@ function AssistantBlockNoteComposer({
|
|
|
25206
25308
|
}) {
|
|
25207
25309
|
const t = useTranslations145();
|
|
25208
25310
|
const editorId = useId5().replace(/[^a-zA-Z0-9]/g, "");
|
|
25209
|
-
const [blocks, setBlocks] =
|
|
25210
|
-
const [isEmpty, setIsEmpty] =
|
|
25211
|
-
const [resetKey, setResetKey] =
|
|
25311
|
+
const [blocks, setBlocks] = useState108([]);
|
|
25312
|
+
const [isEmpty, setIsEmpty] = useState108(true);
|
|
25313
|
+
const [resetKey, setResetKey] = useState108(0);
|
|
25212
25314
|
const canSend = !isEmpty && !disabled;
|
|
25213
25315
|
const submit = useCallback51(async () => {
|
|
25214
25316
|
if (isEmpty || disabled) return;
|
|
@@ -25261,7 +25363,7 @@ function AssistantBlockNoteComposer({
|
|
|
25261
25363
|
__name(AssistantBlockNoteComposer, "AssistantBlockNoteComposer");
|
|
25262
25364
|
|
|
25263
25365
|
// src/features/assistant/components/containers/AssistantPageContainer.tsx
|
|
25264
|
-
import { Fragment as
|
|
25366
|
+
import { Fragment as Fragment56, jsx as jsx283, jsxs as jsxs167 } from "react/jsx-runtime";
|
|
25265
25367
|
function AssistantPageContainer({
|
|
25266
25368
|
renderApprovalAction,
|
|
25267
25369
|
renderMention,
|
|
@@ -25299,7 +25401,7 @@ function AssistantPageContainer({
|
|
|
25299
25401
|
) })
|
|
25300
25402
|
),
|
|
25301
25403
|
children: /* @__PURE__ */ jsxs167("div", { className: "bg-background flex h-full w-full flex-col overflow-hidden rounded-lg border", children: [
|
|
25302
|
-
showThread ? /* @__PURE__ */ jsxs167(
|
|
25404
|
+
showThread ? /* @__PURE__ */ jsxs167(Fragment56, { children: [
|
|
25303
25405
|
ctx.assistant ? /* @__PURE__ */ jsx283(
|
|
25304
25406
|
AssistantThreadHeader,
|
|
25305
25407
|
{
|
|
@@ -25346,7 +25448,7 @@ __name(AssistantPageContainer, "AssistantPageContainer");
|
|
|
25346
25448
|
// src/features/assistant-action/components/ApprovalActionCard.tsx
|
|
25347
25449
|
import { ShieldAlert as ShieldAlert2 } from "lucide-react";
|
|
25348
25450
|
import { useTranslations as useTranslations147 } from "next-intl";
|
|
25349
|
-
import { Fragment as
|
|
25451
|
+
import { Fragment as Fragment57, useEffect as useEffect78, useMemo as useMemo59, useState as useState109 } from "react";
|
|
25350
25452
|
import { jsx as jsx284, jsxs as jsxs168 } from "react/jsx-runtime";
|
|
25351
25453
|
var STATUS_VARIANT2 = {
|
|
25352
25454
|
pending: "softBlue",
|
|
@@ -25538,13 +25640,13 @@ function parseLegacyProposal(toolArgs) {
|
|
|
25538
25640
|
__name(parseLegacyProposal, "parseLegacyProposal");
|
|
25539
25641
|
function ApprovalActionCard({ actionId, summary, onResolved, hiddenRelationshipKeys }) {
|
|
25540
25642
|
const t = useTranslations147();
|
|
25541
|
-
const [status, setStatus] =
|
|
25542
|
-
const [actionSummary, setActionSummary] =
|
|
25543
|
-
const [toolName, setToolName] =
|
|
25544
|
-
const [toolArgs, setToolArgs] =
|
|
25545
|
-
const [actionProposal, setActionProposal] =
|
|
25546
|
-
const [busy, setBusy] =
|
|
25547
|
-
const [failed, setFailed] =
|
|
25643
|
+
const [status, setStatus] = useState109(void 0);
|
|
25644
|
+
const [actionSummary, setActionSummary] = useState109(void 0);
|
|
25645
|
+
const [toolName, setToolName] = useState109(void 0);
|
|
25646
|
+
const [toolArgs, setToolArgs] = useState109(void 0);
|
|
25647
|
+
const [actionProposal, setActionProposal] = useState109(void 0);
|
|
25648
|
+
const [busy, setBusy] = useState109(false);
|
|
25649
|
+
const [failed, setFailed] = useState109(false);
|
|
25548
25650
|
useEffect78(() => {
|
|
25549
25651
|
let cancelled = false;
|
|
25550
25652
|
(async () => {
|
|
@@ -25633,7 +25735,7 @@ function ApprovalActionCard({ actionId, summary, onResolved, hiddenRelationshipK
|
|
|
25633
25735
|
/* @__PURE__ */ jsx284("span", { children: isUpdate ? t("features.assistant.approval.proposal.updateHeading", { entity: entityLabel }) : t("features.assistant.approval.proposal.heading", { entity: entityLabel }) }),
|
|
25634
25736
|
targetLabel !== "" && /* @__PURE__ */ jsx284("span", { className: "text-foreground tracking-normal normal-case", children: targetLabel })
|
|
25635
25737
|
] }),
|
|
25636
|
-
/* @__PURE__ */ jsx284("dl", { className: "grid grid-cols-1 gap-x-4 gap-y-1.5 sm:grid-cols-[minmax(0,10rem)_minmax(0,1fr)]", children: rows.map((row) => /* @__PURE__ */ jsxs168(
|
|
25738
|
+
/* @__PURE__ */ jsx284("dl", { className: "grid grid-cols-1 gap-x-4 gap-y-1.5 sm:grid-cols-[minmax(0,10rem)_minmax(0,1fr)]", children: rows.map((row) => /* @__PURE__ */ jsxs168(Fragment57, { children: [
|
|
25637
25739
|
/* @__PURE__ */ jsx284("dt", { className: "text-muted-foreground text-xs leading-relaxed break-words sm:text-sm", children: row.label }),
|
|
25638
25740
|
/* @__PURE__ */ jsx284("dd", { className: "text-foreground text-sm leading-relaxed break-words whitespace-pre-wrap", children: row.value })
|
|
25639
25741
|
] }, row.key)) })
|
|
@@ -25715,7 +25817,7 @@ var NotificationErrorBoundary = class extends Component {
|
|
|
25715
25817
|
// src/features/notification/components/containers/NotificationsListContainer.tsx
|
|
25716
25818
|
import { useTranslations as useTranslations152 } from "next-intl";
|
|
25717
25819
|
import { useSearchParams as useSearchParams5 } from "next/navigation";
|
|
25718
|
-
import { useState as
|
|
25820
|
+
import { useState as useState110 } from "react";
|
|
25719
25821
|
|
|
25720
25822
|
// src/features/notification/components/filters/NotificationViewSwitcher.tsx
|
|
25721
25823
|
import { useTranslations as useTranslations149 } from "next-intl";
|
|
@@ -25915,7 +26017,7 @@ function NotificationsListContainerContent() {
|
|
|
25915
26017
|
const searchParams = useSearchParams5();
|
|
25916
26018
|
const { error } = useNotificationContext();
|
|
25917
26019
|
const tabParam = searchParams.get("tab");
|
|
25918
|
-
const [mode, setMode] =
|
|
26020
|
+
const [mode, setMode] = useState110(tabParam === "archived" ? "archived" : "inbox");
|
|
25919
26021
|
if (error) {
|
|
25920
26022
|
return /* @__PURE__ */ jsx290("div", { className: "flex items-center justify-center p-8 text-center", children: /* @__PURE__ */ jsxs171("div", { className: "text-destructive text-xs/relaxed", children: [
|
|
25921
26023
|
/* @__PURE__ */ jsx290("p", { children: t("notification.ui.list.error_loading", { error }) }),
|
|
@@ -25952,7 +26054,7 @@ __name(NotificationsListContainer, "NotificationsListContainer");
|
|
|
25952
26054
|
// src/features/notification/components/modals/NotificationModal.tsx
|
|
25953
26055
|
import { BellIcon as BellIcon2, ExternalLinkIcon } from "lucide-react";
|
|
25954
26056
|
import { useTranslations as useTranslations153 } from "next-intl";
|
|
25955
|
-
import { Fragment as
|
|
26057
|
+
import { Fragment as Fragment58, useCallback as useCallback52, useEffect as useEffect80, useMemo as useMemo61, useRef as useRef45, useState as useState111 } from "react";
|
|
25956
26058
|
import { jsx as jsx291, jsxs as jsxs172 } from "react/jsx-runtime";
|
|
25957
26059
|
function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
25958
26060
|
const _instanceId = useRef45(Math.random().toString(36).substr(2, 9));
|
|
@@ -25974,7 +26076,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
25974
26076
|
} = useSocketContext();
|
|
25975
26077
|
const t = useTranslations153();
|
|
25976
26078
|
const generateUrl = usePageUrlGenerator();
|
|
25977
|
-
const [newNotifications, setNewNotifications] =
|
|
26079
|
+
const [newNotifications, setNewNotifications] = useState111(false);
|
|
25978
26080
|
const preventAutoClose = useRef45(false);
|
|
25979
26081
|
const circuitBreakerRef = useRef45({
|
|
25980
26082
|
count: 0,
|
|
@@ -26141,7 +26243,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
26141
26243
|
] }),
|
|
26142
26244
|
isLoading && /* @__PURE__ */ jsx291("div", { className: "text-muted-foreground px-3 py-2 text-xs", children: t(`common.loading`) }),
|
|
26143
26245
|
error && /* @__PURE__ */ jsx291("div", { className: "text-destructive px-3 py-2 text-xs", children: error }),
|
|
26144
|
-
/* @__PURE__ */ jsx291(ScrollArea, { className: "[&_[data-slot=scroll-area-scrollbar]]:w-2.5 [&_[data-slot=scroll-area-thumb]]:bg-muted-foreground/40 [&>[data-slot=scroll-area-viewport]]:max-h-[min(32rem,calc(var(--available-height,32rem)-3.5rem))]", children: notifications.length > 0 ? /* @__PURE__ */ jsx291("div", { className: "divide-border divide-y", children: notifications.map((notification) => /* @__PURE__ */ jsx291(
|
|
26246
|
+
/* @__PURE__ */ jsx291(ScrollArea, { className: "[&_[data-slot=scroll-area-scrollbar]]:w-2.5 [&_[data-slot=scroll-area-thumb]]:bg-muted-foreground/40 [&>[data-slot=scroll-area-viewport]]:max-h-[min(32rem,calc(var(--available-height,32rem)-3.5rem))]", children: notifications.length > 0 ? /* @__PURE__ */ jsx291("div", { className: "divide-border divide-y", children: notifications.map((notification) => /* @__PURE__ */ jsx291(Fragment58, { children: generateNotification(notification, () => setIsOpen(false)) }, notification.id)) }) : /* @__PURE__ */ jsx291("div", { className: "text-muted-foreground p-6 text-center text-sm", children: t(`notification.empty`) }) })
|
|
26145
26247
|
] })
|
|
26146
26248
|
] });
|
|
26147
26249
|
}
|
|
@@ -26152,11 +26254,11 @@ function NotificationModal(props) {
|
|
|
26152
26254
|
__name(NotificationModal, "NotificationModal");
|
|
26153
26255
|
|
|
26154
26256
|
// src/features/notification/components/notifications/PushNotificationProvider.tsx
|
|
26155
|
-
import { Fragment as
|
|
26257
|
+
import { Fragment as Fragment59, jsx as jsx292 } from "react/jsx-runtime";
|
|
26156
26258
|
function PushNotificationProvider({ children }) {
|
|
26157
26259
|
const { currentUser, hasRole } = useCurrentUserContext();
|
|
26158
26260
|
usePushNotifications_default({ currentUser: currentUser ?? void 0, canSubscribe: !hasRole(getRoleId().Administrator) });
|
|
26159
|
-
return /* @__PURE__ */ jsx292(
|
|
26261
|
+
return /* @__PURE__ */ jsx292(Fragment59, { children });
|
|
26160
26262
|
}
|
|
26161
26263
|
__name(PushNotificationProvider, "PushNotificationProvider");
|
|
26162
26264
|
|
|
@@ -26206,14 +26308,14 @@ __name(ReferralCodeCapture, "ReferralCodeCapture");
|
|
|
26206
26308
|
|
|
26207
26309
|
// src/features/referral/components/ReferralWidget.tsx
|
|
26208
26310
|
import { Copy as Copy2, Loader2 as Loader26, Mail, Users } from "lucide-react";
|
|
26209
|
-
import { useCallback as useCallback53, useRef as useRef46, useState as
|
|
26311
|
+
import { useCallback as useCallback53, useRef as useRef46, useState as useState114 } from "react";
|
|
26210
26312
|
|
|
26211
26313
|
// src/features/referral/hooks/useReferralInvite.ts
|
|
26212
|
-
import { useState as
|
|
26314
|
+
import { useState as useState112 } from "react";
|
|
26213
26315
|
function useReferralInvite() {
|
|
26214
|
-
const [sending, setSending] =
|
|
26215
|
-
const [error, setError] =
|
|
26216
|
-
const [success, setSuccess] =
|
|
26316
|
+
const [sending, setSending] = useState112(false);
|
|
26317
|
+
const [error, setError] = useState112(null);
|
|
26318
|
+
const [success, setSuccess] = useState112(false);
|
|
26217
26319
|
const sendInvite = /* @__PURE__ */ __name(async (email) => {
|
|
26218
26320
|
if (!isReferralEnabled()) {
|
|
26219
26321
|
return;
|
|
@@ -26235,11 +26337,11 @@ function useReferralInvite() {
|
|
|
26235
26337
|
__name(useReferralInvite, "useReferralInvite");
|
|
26236
26338
|
|
|
26237
26339
|
// src/features/referral/hooks/useReferralStats.ts
|
|
26238
|
-
import { useEffect as useEffect82, useState as
|
|
26340
|
+
import { useEffect as useEffect82, useState as useState113 } from "react";
|
|
26239
26341
|
function useReferralStats() {
|
|
26240
|
-
const [stats, setStats] =
|
|
26241
|
-
const [loading, setLoading] =
|
|
26242
|
-
const [error, setError] =
|
|
26342
|
+
const [stats, setStats] = useState113(null);
|
|
26343
|
+
const [loading, setLoading] = useState113(true);
|
|
26344
|
+
const [error, setError] = useState113(null);
|
|
26243
26345
|
useEffect82(() => {
|
|
26244
26346
|
if (!isReferralEnabled()) {
|
|
26245
26347
|
setLoading(false);
|
|
@@ -26310,8 +26412,8 @@ function ReferralWidget({
|
|
|
26310
26412
|
const t = { ...DEFAULT_TRANSLATIONS, ...translations };
|
|
26311
26413
|
const { stats, loading, error } = useReferralStats();
|
|
26312
26414
|
const { sendInvite, sending } = useReferralInvite();
|
|
26313
|
-
const [email, setEmail] =
|
|
26314
|
-
const [copied, setCopied] =
|
|
26415
|
+
const [email, setEmail] = useState114("");
|
|
26416
|
+
const [copied, setCopied] = useState114(false);
|
|
26315
26417
|
const linkInputRef = useRef46(null);
|
|
26316
26418
|
const config = getReferralConfig();
|
|
26317
26419
|
const baseUrl = config.referralUrlBase || (typeof window !== "undefined" ? window.location.origin : "");
|
|
@@ -26489,11 +26591,11 @@ function RoleDetails() {
|
|
|
26489
26591
|
__name(RoleDetails, "RoleDetails");
|
|
26490
26592
|
|
|
26491
26593
|
// src/features/role/components/containers/RoleContainer.tsx
|
|
26492
|
-
import { Fragment as
|
|
26594
|
+
import { Fragment as Fragment60, jsx as jsx296, jsxs as jsxs175 } from "react/jsx-runtime";
|
|
26493
26595
|
function RoleContainer() {
|
|
26494
26596
|
const { role } = useRoleContext();
|
|
26495
26597
|
if (!role) return null;
|
|
26496
|
-
return /* @__PURE__ */ jsxs175(
|
|
26598
|
+
return /* @__PURE__ */ jsxs175(Fragment60, { children: [
|
|
26497
26599
|
/* @__PURE__ */ jsx296(RoleDetails, {}),
|
|
26498
26600
|
/* @__PURE__ */ jsx296(RoleUsersList, { role })
|
|
26499
26601
|
] });
|
|
@@ -26537,11 +26639,11 @@ __name(FormRoles, "FormRoles");
|
|
|
26537
26639
|
|
|
26538
26640
|
// src/features/role/components/forms/RemoveUserFromRole.tsx
|
|
26539
26641
|
import { useTranslations as useTranslations156 } from "next-intl";
|
|
26540
|
-
import { useEffect as useEffect84, useState as
|
|
26541
|
-
import { Fragment as
|
|
26642
|
+
import { useEffect as useEffect84, useState as useState115 } from "react";
|
|
26643
|
+
import { Fragment as Fragment61, jsx as jsx298, jsxs as jsxs177 } from "react/jsx-runtime";
|
|
26542
26644
|
function RemoveUserFromRole({ role, user, refresh }) {
|
|
26543
|
-
const [open, setOpen] =
|
|
26544
|
-
const [canRemove, setCanRemove] =
|
|
26645
|
+
const [open, setOpen] = useState115(false);
|
|
26646
|
+
const [canRemove, setCanRemove] = useState115(false);
|
|
26545
26647
|
const t = useTranslations156();
|
|
26546
26648
|
useEffect84(() => {
|
|
26547
26649
|
async function checkCompanyAdminDeletability() {
|
|
@@ -26587,7 +26689,7 @@ function RemoveUserFromRole({ role, user, refresh }) {
|
|
|
26587
26689
|
/* @__PURE__ */ jsx298(DialogTitle, { children: t(`role.remove_user.title`) }),
|
|
26588
26690
|
/* @__PURE__ */ jsx298(DialogDescription, { children: canRemove ? t(`role.remove_user.subtitle_allowed`) : t(`role.remove_user.subtitle_not_allowed`) })
|
|
26589
26691
|
] }),
|
|
26590
|
-
canRemove ? /* @__PURE__ */ jsxs177(
|
|
26692
|
+
canRemove ? /* @__PURE__ */ jsxs177(Fragment61, { children: [
|
|
26591
26693
|
t(`role.remove_user.description_allowed`, { role: roleName, user: user.name }),
|
|
26592
26694
|
/* @__PURE__ */ jsxs177("div", { className: "flex justify-end", children: [
|
|
26593
26695
|
/* @__PURE__ */ jsx298(Button, { className: "me-2", variant: "outline", type: `button`, onClick: () => setOpen(false), children: t(`ui.buttons.cancel`) }),
|
|
@@ -26604,7 +26706,7 @@ function RemoveUserFromRole({ role, user, refresh }) {
|
|
|
26604
26706
|
}
|
|
26605
26707
|
)
|
|
26606
26708
|
] })
|
|
26607
|
-
] }) : /* @__PURE__ */ jsx298(
|
|
26709
|
+
] }) : /* @__PURE__ */ jsx298(Fragment61, { children: t(`role.remove_user.description_not_allowed`, { role: roleName, user: user.name }) })
|
|
26608
26710
|
] })
|
|
26609
26711
|
] });
|
|
26610
26712
|
}
|
|
@@ -26613,13 +26715,13 @@ __name(RemoveUserFromRole, "RemoveUserFromRole");
|
|
|
26613
26715
|
// src/features/role/components/forms/UserRoleAdd.tsx
|
|
26614
26716
|
import { PlusCircle as PlusCircle2 } from "lucide-react";
|
|
26615
26717
|
import { useTranslations as useTranslations157 } from "next-intl";
|
|
26616
|
-
import { useCallback as useCallback54, useEffect as useEffect85, useRef as useRef47, useState as
|
|
26617
|
-
import { Fragment as
|
|
26718
|
+
import { useCallback as useCallback54, useEffect as useEffect85, useRef as useRef47, useState as useState116 } from "react";
|
|
26719
|
+
import { Fragment as Fragment62, jsx as jsx299, jsxs as jsxs178 } from "react/jsx-runtime";
|
|
26618
26720
|
function UserRoleAdd({ user, refresh }) {
|
|
26619
|
-
const [open, setOpen] =
|
|
26721
|
+
const [open, setOpen] = useState116(false);
|
|
26620
26722
|
const inputRef = useRef47(null);
|
|
26621
|
-
const [searchTerm, setSearchTerm] =
|
|
26622
|
-
const [roles, setRoles] =
|
|
26723
|
+
const [searchTerm, setSearchTerm] = useState116("");
|
|
26724
|
+
const [roles, setRoles] = useState116([]);
|
|
26623
26725
|
const t = useTranslations157();
|
|
26624
26726
|
const addUserToRole = /* @__PURE__ */ __name(async (role) => {
|
|
26625
26727
|
await RoleService.addUserToRole({
|
|
@@ -26661,7 +26763,7 @@ function UserRoleAdd({ user, refresh }) {
|
|
|
26661
26763
|
useEffect85(() => {
|
|
26662
26764
|
if (open) searchRoles("");
|
|
26663
26765
|
}, [open]);
|
|
26664
|
-
return /* @__PURE__ */ jsxs178(
|
|
26766
|
+
return /* @__PURE__ */ jsxs178(Fragment62, { children: [
|
|
26665
26767
|
/* @__PURE__ */ jsxs178(Button, { size: "sm", onClick: () => setOpen(true), children: [
|
|
26666
26768
|
/* @__PURE__ */ jsx299(PlusCircle2, { className: "me-3 h-3.5 w-3.5" }),
|
|
26667
26769
|
t(`common.association.label`, {
|
|
@@ -26934,12 +27036,12 @@ __name(OAuthScopeSelector, "OAuthScopeSelector");
|
|
|
26934
27036
|
|
|
26935
27037
|
// src/features/oauth/components/OAuthClientSecretDisplay.tsx
|
|
26936
27038
|
import { useTranslations as useTranslations162 } from "next-intl";
|
|
26937
|
-
import { useState as
|
|
27039
|
+
import { useState as useState117, useCallback as useCallback57 } from "react";
|
|
26938
27040
|
import { Copy as Copy3, Check, AlertTriangle } from "lucide-react";
|
|
26939
27041
|
import { jsx as jsx304, jsxs as jsxs181 } from "react/jsx-runtime";
|
|
26940
27042
|
function OAuthClientSecretDisplay({ secret, onDismiss, open, clientName }) {
|
|
26941
27043
|
const t = useTranslations162();
|
|
26942
|
-
const [copied, setCopied] =
|
|
27044
|
+
const [copied, setCopied] = useState117(false);
|
|
26943
27045
|
const handleCopy = useCallback57(async () => {
|
|
26944
27046
|
try {
|
|
26945
27047
|
await navigator.clipboard.writeText(secret);
|
|
@@ -27137,7 +27239,7 @@ __name(OAuthClientList, "OAuthClientList");
|
|
|
27137
27239
|
|
|
27138
27240
|
// src/features/oauth/components/OAuthClientForm.tsx
|
|
27139
27241
|
import { useTranslations as useTranslations165 } from "next-intl";
|
|
27140
|
-
import { useState as
|
|
27242
|
+
import { useState as useState118, useCallback as useCallback58 } from "react";
|
|
27141
27243
|
import { jsx as jsx307, jsxs as jsxs184 } from "react/jsx-runtime";
|
|
27142
27244
|
function OAuthClientForm({
|
|
27143
27245
|
client,
|
|
@@ -27149,14 +27251,14 @@ function OAuthClientForm({
|
|
|
27149
27251
|
}) {
|
|
27150
27252
|
const t = useTranslations165();
|
|
27151
27253
|
const isEditMode = !!client;
|
|
27152
|
-
const [formState, setFormState] =
|
|
27254
|
+
const [formState, setFormState] = useState118({
|
|
27153
27255
|
name: client?.name || "",
|
|
27154
27256
|
description: client?.description || "",
|
|
27155
27257
|
redirectUris: client?.redirectUris?.length ? client.redirectUris : [""],
|
|
27156
27258
|
allowedScopes: client ? client.allowedScopes || [] : defaultScopes,
|
|
27157
27259
|
isConfidential: client?.isConfidential ?? true
|
|
27158
27260
|
});
|
|
27159
|
-
const [errors, setErrors] =
|
|
27261
|
+
const [errors, setErrors] = useState118({});
|
|
27160
27262
|
const validate = useCallback58(() => {
|
|
27161
27263
|
const newErrors = {};
|
|
27162
27264
|
if (!formState.name.trim()) {
|
|
@@ -27284,9 +27386,9 @@ __name(OAuthClientForm, "OAuthClientForm");
|
|
|
27284
27386
|
|
|
27285
27387
|
// src/features/oauth/components/OAuthClientDetail.tsx
|
|
27286
27388
|
import { useTranslations as useTranslations166 } from "next-intl";
|
|
27287
|
-
import { useState as
|
|
27389
|
+
import { useState as useState119, useCallback as useCallback59 } from "react";
|
|
27288
27390
|
import { Copy as Copy4, Check as Check2, RefreshCw as RefreshCw3, Pencil as Pencil2, Trash2 as Trash25, ExternalLink } from "lucide-react";
|
|
27289
|
-
import { Fragment as
|
|
27391
|
+
import { Fragment as Fragment63, jsx as jsx308, jsxs as jsxs185 } from "react/jsx-runtime";
|
|
27290
27392
|
function OAuthClientDetail({
|
|
27291
27393
|
client,
|
|
27292
27394
|
isLoading = false,
|
|
@@ -27297,11 +27399,11 @@ function OAuthClientDetail({
|
|
|
27297
27399
|
const t = useTranslations166();
|
|
27298
27400
|
const locale = useI18nLocale();
|
|
27299
27401
|
const scopeText = useOAuthScopeText();
|
|
27300
|
-
const [copiedField, setCopiedField] =
|
|
27301
|
-
const [showDeleteConfirm, setShowDeleteConfirm] =
|
|
27302
|
-
const [showRegenerateConfirm, setShowRegenerateConfirm] =
|
|
27303
|
-
const [isDeleting, setIsDeleting] =
|
|
27304
|
-
const [isRegenerating, setIsRegenerating] =
|
|
27402
|
+
const [copiedField, setCopiedField] = useState119(null);
|
|
27403
|
+
const [showDeleteConfirm, setShowDeleteConfirm] = useState119(false);
|
|
27404
|
+
const [showRegenerateConfirm, setShowRegenerateConfirm] = useState119(false);
|
|
27405
|
+
const [isDeleting, setIsDeleting] = useState119(false);
|
|
27406
|
+
const [isRegenerating, setIsRegenerating] = useState119(false);
|
|
27305
27407
|
const copyToClipboard2 = useCallback59(async (text, field) => {
|
|
27306
27408
|
try {
|
|
27307
27409
|
await navigator.clipboard.writeText(text);
|
|
@@ -27332,7 +27434,7 @@ function OAuthClientDetail({
|
|
|
27332
27434
|
}
|
|
27333
27435
|
}, [onRegenerateSecret]);
|
|
27334
27436
|
const createdDate = client.createdAt ? new Date(client.createdAt).toLocaleDateString(locale, { dateStyle: "long" }) : t("oauth.ui.card.unknown");
|
|
27335
|
-
return /* @__PURE__ */ jsxs185(
|
|
27437
|
+
return /* @__PURE__ */ jsxs185(Fragment63, { children: [
|
|
27336
27438
|
/* @__PURE__ */ jsxs185(Card, { children: [
|
|
27337
27439
|
/* @__PURE__ */ jsx308(CardHeader, { children: /* @__PURE__ */ jsxs185("div", { className: "flex items-start justify-between", children: [
|
|
27338
27440
|
/* @__PURE__ */ jsxs185("div", { children: [
|
|
@@ -27541,7 +27643,7 @@ function OAuthCompanySelector({ companies, value, onChange }) {
|
|
|
27541
27643
|
__name(OAuthCompanySelector, "OAuthCompanySelector");
|
|
27542
27644
|
|
|
27543
27645
|
// src/features/oauth/components/consent/OAuthConsentScreen.tsx
|
|
27544
|
-
import { Fragment as
|
|
27646
|
+
import { Fragment as Fragment64, jsx as jsx313, jsxs as jsxs190 } from "react/jsx-runtime";
|
|
27545
27647
|
function OAuthConsentScreen({
|
|
27546
27648
|
params,
|
|
27547
27649
|
logoUrl,
|
|
@@ -27575,7 +27677,7 @@ function OAuthConsentScreen({
|
|
|
27575
27677
|
/* @__PURE__ */ jsx313(Separator, {}),
|
|
27576
27678
|
/* @__PURE__ */ jsx313(OAuthScopeList, { scopes }),
|
|
27577
27679
|
/* @__PURE__ */ jsx313(Separator, {}),
|
|
27578
|
-
companies.length > 1 && /* @__PURE__ */ jsxs190(
|
|
27680
|
+
companies.length > 1 && /* @__PURE__ */ jsxs190(Fragment64, { children: [
|
|
27579
27681
|
/* @__PURE__ */ jsx313(OAuthCompanySelector, { companies, value: companyId, onChange: setCompanyId }),
|
|
27580
27682
|
/* @__PURE__ */ jsx313(Separator, {})
|
|
27581
27683
|
] }),
|
|
@@ -27606,7 +27708,7 @@ __name(OAuthConsentScreen, "OAuthConsentScreen");
|
|
|
27606
27708
|
import { zodResolver as zodResolver12 } from "@hookform/resolvers/zod";
|
|
27607
27709
|
import { CheckCircle, Mail as Mail2 } from "lucide-react";
|
|
27608
27710
|
import { useTranslations as useTranslations172 } from "next-intl";
|
|
27609
|
-
import { useState as
|
|
27711
|
+
import { useState as useState120 } from "react";
|
|
27610
27712
|
import { useForm as useForm12 } from "react-hook-form";
|
|
27611
27713
|
import { v4 as v414 } from "uuid";
|
|
27612
27714
|
import { z as z13 } from "zod";
|
|
@@ -27705,11 +27807,11 @@ function WaitlistQuestionnaireRenderer({
|
|
|
27705
27807
|
__name(WaitlistQuestionnaireRenderer, "WaitlistQuestionnaireRenderer");
|
|
27706
27808
|
|
|
27707
27809
|
// src/features/waitlist/components/forms/WaitlistForm.tsx
|
|
27708
|
-
import { Fragment as
|
|
27810
|
+
import { Fragment as Fragment65, jsx as jsx315, jsxs as jsxs192 } from "react/jsx-runtime";
|
|
27709
27811
|
function WaitlistForm({ onSuccess }) {
|
|
27710
27812
|
const t = useTranslations172();
|
|
27711
|
-
const [isSubmitting, setIsSubmitting] =
|
|
27712
|
-
const [isSuccess, setIsSuccess] =
|
|
27813
|
+
const [isSubmitting, setIsSubmitting] = useState120(false);
|
|
27814
|
+
const [isSuccess, setIsSuccess] = useState120(false);
|
|
27713
27815
|
const config = getWaitlistConfig();
|
|
27714
27816
|
const questionnaireFields = config.questionnaire ?? [];
|
|
27715
27817
|
const questionnaireSchema = questionnaireFields.reduce(
|
|
@@ -27825,7 +27927,7 @@ function WaitlistForm({ onSuccess }) {
|
|
|
27825
27927
|
{
|
|
27826
27928
|
form,
|
|
27827
27929
|
id: "gdprConsent",
|
|
27828
|
-
label: /* @__PURE__ */ jsxs192(
|
|
27930
|
+
label: /* @__PURE__ */ jsxs192(Fragment65, { children: [
|
|
27829
27931
|
t("auth.gdpr.terms_prefix"),
|
|
27830
27932
|
/* @__PURE__ */ jsx315(Link, { href: "/terms", target: "_blank", rel: "noopener", children: t("auth.gdpr.terms_of_service") }),
|
|
27831
27933
|
t("auth.gdpr.and"),
|
|
@@ -27890,12 +27992,12 @@ __name(WaitlistSuccessState, "WaitlistSuccessState");
|
|
|
27890
27992
|
// src/features/waitlist/components/sections/WaitlistConfirmation.tsx
|
|
27891
27993
|
import { CheckCircle as CheckCircle4, Loader2 as Loader28, XCircle as XCircle2 } from "lucide-react";
|
|
27892
27994
|
import { useTranslations as useTranslations174 } from "next-intl";
|
|
27893
|
-
import { useEffect as useEffect86, useState as
|
|
27995
|
+
import { useEffect as useEffect86, useState as useState121 } from "react";
|
|
27894
27996
|
import { jsx as jsx318, jsxs as jsxs195 } from "react/jsx-runtime";
|
|
27895
27997
|
function WaitlistConfirmation({ code }) {
|
|
27896
27998
|
const t = useTranslations174();
|
|
27897
|
-
const [state, setState] =
|
|
27898
|
-
const [errorMessage, setErrorMessage] =
|
|
27999
|
+
const [state, setState] = useState121("loading");
|
|
28000
|
+
const [errorMessage, setErrorMessage] = useState121("");
|
|
27899
28001
|
useEffect86(() => {
|
|
27900
28002
|
async function confirmEmail() {
|
|
27901
28003
|
try {
|
|
@@ -27935,12 +28037,12 @@ __name(WaitlistConfirmation, "WaitlistConfirmation");
|
|
|
27935
28037
|
// src/features/waitlist/components/lists/WaitlistList.tsx
|
|
27936
28038
|
import { RefreshCw as RefreshCw4 } from "lucide-react";
|
|
27937
28039
|
import { useTranslations as useTranslations175 } from "next-intl";
|
|
27938
|
-
import { useCallback as useCallback60, useEffect as useEffect87, useMemo as useMemo63, useState as
|
|
28040
|
+
import { useCallback as useCallback60, useEffect as useEffect87, useMemo as useMemo63, useState as useState122 } from "react";
|
|
27939
28041
|
import { jsx as jsx319, jsxs as jsxs196 } from "react/jsx-runtime";
|
|
27940
28042
|
function WaitlistList({ fullWidth } = {}) {
|
|
27941
28043
|
const t = useTranslations175();
|
|
27942
|
-
const [statusFilter, setStatusFilter] =
|
|
27943
|
-
const [stats, setStats] =
|
|
28044
|
+
const [statusFilter, setStatusFilter] = useState122("all");
|
|
28045
|
+
const [stats, setStats] = useState122(void 0);
|
|
27944
28046
|
const data = useDataListRetriever({
|
|
27945
28047
|
retriever: /* @__PURE__ */ __name((params) => WaitlistService.findMany(params), "retriever"),
|
|
27946
28048
|
retrieverParams: {},
|
|
@@ -28037,7 +28139,7 @@ __name(WaitlistList, "WaitlistList");
|
|
|
28037
28139
|
// src/features/rbac/components/RbacContainer.tsx
|
|
28038
28140
|
import { Loader2Icon as Loader2Icon4 } from "lucide-react";
|
|
28039
28141
|
import { useTranslations as useTranslations177 } from "next-intl";
|
|
28040
|
-
import { memo as memo2, useCallback as useCallback62, useEffect as useEffect89, useMemo as useMemo64, useRef as useRef48, useState as
|
|
28142
|
+
import { memo as memo2, useCallback as useCallback62, useEffect as useEffect89, useMemo as useMemo64, useRef as useRef48, useState as useState124 } from "react";
|
|
28041
28143
|
|
|
28042
28144
|
// src/features/rbac/components/RbacPermissionCell.tsx
|
|
28043
28145
|
import { CheckIcon as CheckIcon9, MinusIcon as MinusIcon2, XIcon as XIcon12 } from "lucide-react";
|
|
@@ -28118,8 +28220,8 @@ __name(RbacPermissionCell, "RbacPermissionCell");
|
|
|
28118
28220
|
import { Popover as PopoverPrimitive2 } from "@base-ui/react/popover";
|
|
28119
28221
|
import { CheckIcon as CheckIcon10, MinusIcon as MinusIcon3, XIcon as XIcon13 } from "lucide-react";
|
|
28120
28222
|
import { useTranslations as useTranslations176 } from "next-intl";
|
|
28121
|
-
import { useCallback as useCallback61, useEffect as useEffect88, useState as
|
|
28122
|
-
import { Fragment as
|
|
28223
|
+
import { useCallback as useCallback61, useEffect as useEffect88, useState as useState123 } from "react";
|
|
28224
|
+
import { Fragment as Fragment66, jsx as jsx321, jsxs as jsxs198 } from "react/jsx-runtime";
|
|
28123
28225
|
function RbacPermissionPicker({
|
|
28124
28226
|
open,
|
|
28125
28227
|
anchor,
|
|
@@ -28131,7 +28233,7 @@ function RbacPermissionPicker({
|
|
|
28131
28233
|
onClose
|
|
28132
28234
|
}) {
|
|
28133
28235
|
const t = useTranslations176();
|
|
28134
|
-
const [customSegment, setCustomSegment] =
|
|
28236
|
+
const [customSegment, setCustomSegment] = useState123("");
|
|
28135
28237
|
useEffect88(() => {
|
|
28136
28238
|
if (!open) setCustomSegment("");
|
|
28137
28239
|
}, [open]);
|
|
@@ -28205,7 +28307,7 @@ function RbacPermissionPicker({
|
|
|
28205
28307
|
)
|
|
28206
28308
|
] })
|
|
28207
28309
|
] }),
|
|
28208
|
-
isRoleColumn && onClear && /* @__PURE__ */ jsxs198(
|
|
28310
|
+
isRoleColumn && onClear && /* @__PURE__ */ jsxs198(Fragment66, { children: [
|
|
28209
28311
|
/* @__PURE__ */ jsx321(Separator, {}),
|
|
28210
28312
|
/* @__PURE__ */ jsxs198(
|
|
28211
28313
|
Button,
|
|
@@ -28380,8 +28482,8 @@ var ModuleEditor = memo2(/* @__PURE__ */ __name(function ModuleEditor2({
|
|
|
28380
28482
|
function RbacContainer() {
|
|
28381
28483
|
const t = useTranslations177();
|
|
28382
28484
|
const { matrix, modulePaths, loading, error, roleNames, moduleNames, updateCell, clearCell } = useRbacContext();
|
|
28383
|
-
const [selectedModuleId, setSelectedModuleId] =
|
|
28384
|
-
const [activePicker, setActivePicker] =
|
|
28485
|
+
const [selectedModuleId, setSelectedModuleId] = useState124(null);
|
|
28486
|
+
const [activePicker, setActivePicker] = useState124(null);
|
|
28385
28487
|
const openPicker = useCallback62((picker) => {
|
|
28386
28488
|
setActivePicker(picker);
|
|
28387
28489
|
}, []);
|
|
@@ -28492,7 +28594,7 @@ __name(RbacContainer, "RbacContainer");
|
|
|
28492
28594
|
// src/features/rbac/components/RbacByRoleContainer.tsx
|
|
28493
28595
|
import { Loader2Icon as Loader2Icon5 } from "lucide-react";
|
|
28494
28596
|
import { useTranslations as useTranslations178 } from "next-intl";
|
|
28495
|
-
import { Fragment as
|
|
28597
|
+
import { Fragment as Fragment67, memo as memo3, useCallback as useCallback63, useEffect as useEffect90, useMemo as useMemo65, useRef as useRef49, useState as useState125 } from "react";
|
|
28496
28598
|
import { jsx as jsx323, jsxs as jsxs200 } from "react/jsx-runtime";
|
|
28497
28599
|
function findToken2(tokens, action) {
|
|
28498
28600
|
if (!tokens) return void 0;
|
|
@@ -28530,8 +28632,8 @@ var ACTION_LABEL_KEYS2 = {
|
|
|
28530
28632
|
function RbacByRoleContainer() {
|
|
28531
28633
|
const t = useTranslations178();
|
|
28532
28634
|
const { matrix, modulePaths, loading, error, roleNames, moduleNames, updateCell, clearCell } = useRbacContext();
|
|
28533
|
-
const [selectedRoleId, setSelectedRoleId] =
|
|
28534
|
-
const [activePicker, setActivePicker] =
|
|
28635
|
+
const [selectedRoleId, setSelectedRoleId] = useState125(null);
|
|
28636
|
+
const [activePicker, setActivePicker] = useState125(null);
|
|
28535
28637
|
const openPicker = useCallback63((picker) => {
|
|
28536
28638
|
setActivePicker(picker);
|
|
28537
28639
|
}, []);
|
|
@@ -28618,7 +28720,7 @@ function RbacByRoleContainer() {
|
|
|
28618
28720
|
const defaultTokens = block.default ?? [];
|
|
28619
28721
|
const roleTokens = block[selectedRoleId];
|
|
28620
28722
|
const moduleLabel = moduleNames?.[moduleId] ?? moduleId;
|
|
28621
|
-
return /* @__PURE__ */ jsxs200(
|
|
28723
|
+
return /* @__PURE__ */ jsxs200(Fragment67, { children: [
|
|
28622
28724
|
/* @__PURE__ */ jsx323("tr", { className: "border-b bg-muted/40", children: /* @__PURE__ */ jsx323(
|
|
28623
28725
|
"td",
|
|
28624
28726
|
{
|
|
@@ -29276,6 +29378,9 @@ export {
|
|
|
29276
29378
|
subscriptionDiscount,
|
|
29277
29379
|
applyDiscount,
|
|
29278
29380
|
CouponRefresher,
|
|
29381
|
+
couponPageModule,
|
|
29382
|
+
parseOptionalPositiveInt,
|
|
29383
|
+
parseOptionalDecimal,
|
|
29279
29384
|
optionalPositiveInt,
|
|
29280
29385
|
optionalDecimal,
|
|
29281
29386
|
optionalDate,
|
|
@@ -29292,4 +29397,4 @@ export {
|
|
|
29292
29397
|
useOAuthClients,
|
|
29293
29398
|
useOAuthClient
|
|
29294
29399
|
};
|
|
29295
|
-
//# sourceMappingURL=chunk-
|
|
29400
|
+
//# sourceMappingURL=chunk-2FNSDBJG.mjs.map
|