analytica-frontend-lib 1.2.17 → 1.2.19
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/AlertManager/index.d.mts +6 -2
- package/dist/AlertManager/index.d.ts +6 -2
- package/dist/AlertManager/index.js +66 -16
- package/dist/AlertManager/index.js.map +1 -1
- package/dist/AlertManager/index.mjs +66 -16
- package/dist/AlertManager/index.mjs.map +1 -1
- package/dist/AlertManagerView/index.d.mts +8 -3
- package/dist/AlertManagerView/index.d.ts +8 -3
- package/dist/AlertManagerView/index.js +4 -24
- package/dist/AlertManagerView/index.js.map +1 -1
- package/dist/AlertManagerView/index.mjs +4 -26
- package/dist/AlertManagerView/index.mjs.map +1 -1
- package/dist/DropdownMenu/index.d.mts +7 -1
- package/dist/DropdownMenu/index.d.ts +7 -1
- package/dist/DropdownMenu/index.js +51 -5
- package/dist/DropdownMenu/index.js.map +1 -1
- package/dist/DropdownMenu/index.mjs +50 -5
- package/dist/DropdownMenu/index.mjs.map +1 -1
- package/dist/NotificationCard/index.js +49 -5
- package/dist/NotificationCard/index.js.map +1 -1
- package/dist/NotificationCard/index.mjs +49 -5
- package/dist/NotificationCard/index.mjs.map +1 -1
- package/dist/Search/index.js +49 -5
- package/dist/Search/index.js.map +1 -1
- package/dist/Search/index.mjs +49 -5
- package/dist/Search/index.mjs.map +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +394 -361
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +164 -132
- package/dist/index.mjs.map +1 -1
- package/dist/{types-DMycdI4U.d.mts → types-BXzeefgf.d.mts} +1 -1
- package/dist/{types-DMycdI4U.d.ts → types-BXzeefgf.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/notification-TD7ZFRLL.png +0 -0
package/dist/index.js
CHANGED
|
@@ -87,6 +87,7 @@ __export(src_exports, {
|
|
|
87
87
|
NotificationEntityType: () => NotificationEntityType,
|
|
88
88
|
ProfileMenuFooter: () => ProfileMenuFooter,
|
|
89
89
|
ProfileMenuHeader: () => ProfileMenuHeader,
|
|
90
|
+
ProfileMenuInfo: () => ProfileMenuInfo,
|
|
90
91
|
ProfileMenuSection: () => ProfileMenuSection,
|
|
91
92
|
ProfileMenuTrigger: () => ProfileMenuTrigger,
|
|
92
93
|
ProfileToggleTheme: () => ProfileToggleTheme,
|
|
@@ -2088,6 +2089,7 @@ var MessageStep = ({
|
|
|
2088
2089
|
const handleRemoveFile = () => {
|
|
2089
2090
|
setImage(null);
|
|
2090
2091
|
};
|
|
2092
|
+
const isImageFile = image instanceof File;
|
|
2091
2093
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("section", { className: "flex flex-col gap-4", children: [
|
|
2092
2094
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2093
2095
|
Input_default,
|
|
@@ -2113,7 +2115,7 @@ var MessageStep = ({
|
|
|
2113
2115
|
allowImageAttachment && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2114
2116
|
ImageUpload,
|
|
2115
2117
|
{
|
|
2116
|
-
selectedFile: image,
|
|
2118
|
+
selectedFile: isImageFile ? image : null,
|
|
2117
2119
|
onFileSelect: handleFileSelect,
|
|
2118
2120
|
onRemoveFile: handleRemoveFile
|
|
2119
2121
|
}
|
|
@@ -2316,13 +2318,8 @@ var DateStep = ({
|
|
|
2316
2318
|
|
|
2317
2319
|
// src/components/AlertManager/AlertSteps/PreviewStep.tsx
|
|
2318
2320
|
var import_react12 = require("react");
|
|
2319
|
-
|
|
2320
|
-
// src/assets/img/notification.png
|
|
2321
|
-
var notification_default = "./notification-TD7ZFRLL.png";
|
|
2322
|
-
|
|
2323
|
-
// src/components/AlertManager/AlertSteps/PreviewStep.tsx
|
|
2324
2321
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2325
|
-
var PreviewStep = () => {
|
|
2322
|
+
var PreviewStep = ({ imageLink, defaultImage }) => {
|
|
2326
2323
|
const title = useAlertFormStore((state) => state.title);
|
|
2327
2324
|
const message = useAlertFormStore((state) => state.message);
|
|
2328
2325
|
const image = useAlertFormStore((state) => state.image);
|
|
@@ -2333,17 +2330,21 @@ var PreviewStep = () => {
|
|
|
2333
2330
|
if (image instanceof File) {
|
|
2334
2331
|
return globalThis.window.URL.createObjectURL(image);
|
|
2335
2332
|
}
|
|
2333
|
+
if (typeof image === "string") {
|
|
2334
|
+
return image;
|
|
2335
|
+
}
|
|
2336
2336
|
return void 0;
|
|
2337
2337
|
}, [image]);
|
|
2338
2338
|
(0, import_react12.useEffect)(() => {
|
|
2339
2339
|
return () => {
|
|
2340
|
-
if (
|
|
2340
|
+
if (globalThis.window !== void 0 && imageUrl && image instanceof File) {
|
|
2341
2341
|
URL.revokeObjectURL(imageUrl);
|
|
2342
2342
|
}
|
|
2343
2343
|
};
|
|
2344
|
-
}, [imageUrl]);
|
|
2344
|
+
}, [imageUrl, image]);
|
|
2345
|
+
const finalImageUrl = imageLink || imageUrl || defaultImage || void 0;
|
|
2345
2346
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("section", { className: "flex flex-col gap-4", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "bg-background-50 px-5 py-6 flex flex-col items-center gap-4 rounded-xl", children: [
|
|
2346
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("img", { src:
|
|
2347
|
+
finalImageUrl && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("img", { src: finalImageUrl, alt: title || "Imagem do alerta" }),
|
|
2347
2348
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col items-center text-center gap-3", children: [
|
|
2348
2349
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text_default, { size: "lg", weight: "semibold", children: title || "Nenhum T\xEDtulo de Alerta" }),
|
|
2349
2350
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text_default, { size: "sm", weight: "normal", className: "text-text-500", children: message || "Aqui aparecer\xE1 a mensagem do alerta definido pelo usu\xE1rio" })
|
|
@@ -2437,7 +2438,9 @@ var StepWrapper = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx
|
|
|
2437
2438
|
var AlertsManager = ({
|
|
2438
2439
|
config,
|
|
2439
2440
|
isOpen = false,
|
|
2440
|
-
onClose
|
|
2441
|
+
onClose,
|
|
2442
|
+
imageLink,
|
|
2443
|
+
defaultImage
|
|
2441
2444
|
}) => {
|
|
2442
2445
|
const [isModalOpen, setIsModalOpen] = (0, import_react13.useState)(isOpen);
|
|
2443
2446
|
const [currentStep, setCurrentStep] = (0, import_react13.useState)(0);
|
|
@@ -2596,7 +2599,7 @@ var AlertsManager = ({
|
|
|
2596
2599
|
}
|
|
2597
2600
|
) });
|
|
2598
2601
|
case 3:
|
|
2599
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(StepWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PreviewStep, {}) });
|
|
2602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(StepWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(PreviewStep, { imageLink, defaultImage }) });
|
|
2600
2603
|
default:
|
|
2601
2604
|
return null;
|
|
2602
2605
|
}
|
|
@@ -2607,7 +2610,9 @@ var AlertsManager = ({
|
|
|
2607
2610
|
labels,
|
|
2608
2611
|
behavior,
|
|
2609
2612
|
handleNext2,
|
|
2610
|
-
handlePrevious
|
|
2613
|
+
handlePrevious,
|
|
2614
|
+
imageLink,
|
|
2615
|
+
defaultImage
|
|
2611
2616
|
]);
|
|
2612
2617
|
const isFirstStep = currentStep === 0;
|
|
2613
2618
|
const isLastStep = currentStep === steps.length - 1;
|
|
@@ -2670,9 +2675,6 @@ var AlertsManager = ({
|
|
|
2670
2675
|
);
|
|
2671
2676
|
};
|
|
2672
2677
|
|
|
2673
|
-
// src/components/AlertManagerView/AlertsManagerView.tsx
|
|
2674
|
-
var import_react16 = require("react");
|
|
2675
|
-
|
|
2676
2678
|
// src/components/Modal/Modal.tsx
|
|
2677
2679
|
var import_react14 = require("react");
|
|
2678
2680
|
var import_phosphor_react9 = require("phosphor-react");
|
|
@@ -3459,27 +3461,13 @@ var AlertsManagerView = ({
|
|
|
3459
3461
|
alertData,
|
|
3460
3462
|
isOpen = false,
|
|
3461
3463
|
onClose,
|
|
3464
|
+
imageLink,
|
|
3465
|
+
defaultImage,
|
|
3462
3466
|
currentPage = 1,
|
|
3463
3467
|
totalPages: externalTotalPages,
|
|
3464
3468
|
onPageChange,
|
|
3465
3469
|
itemsPerPage = 10
|
|
3466
3470
|
}) => {
|
|
3467
|
-
const imageUrl = (0, import_react16.useMemo)(() => {
|
|
3468
|
-
if (globalThis.window == void 0) {
|
|
3469
|
-
return void 0;
|
|
3470
|
-
}
|
|
3471
|
-
if (alertData.image instanceof File) {
|
|
3472
|
-
return globalThis.window.URL.createObjectURL(alertData.image);
|
|
3473
|
-
}
|
|
3474
|
-
return void 0;
|
|
3475
|
-
}, [alertData.image]);
|
|
3476
|
-
(0, import_react16.useEffect)(() => {
|
|
3477
|
-
return () => {
|
|
3478
|
-
if (imageUrl && globalThis.window !== void 0) {
|
|
3479
|
-
URL.revokeObjectURL(imageUrl);
|
|
3480
|
-
}
|
|
3481
|
-
};
|
|
3482
|
-
}, [imageUrl]);
|
|
3483
3471
|
const totalPages = externalTotalPages ?? Math.ceil(alertData.recipients.length / itemsPerPage);
|
|
3484
3472
|
const effectiveCurrentPage = Math.min(totalPages, Math.max(1, currentPage));
|
|
3485
3473
|
const startIndex = (effectiveCurrentPage - 1) * itemsPerPage;
|
|
@@ -3507,10 +3495,10 @@ var AlertsManagerView = ({
|
|
|
3507
3495
|
contentClassName: "p-0",
|
|
3508
3496
|
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex flex-col h-[calc(100vh-8rem)] max-h-[700px]", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex-1 overflow-y-auto px-6 py-4", children: [
|
|
3509
3497
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "bg-background-50 px-5 py-6 flex flex-col items-center gap-4 rounded-xl mb-4", children: [
|
|
3510
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3498
|
+
(imageLink || alertData.image || defaultImage) && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3511
3499
|
"img",
|
|
3512
3500
|
{
|
|
3513
|
-
src:
|
|
3501
|
+
src: imageLink || alertData.image || defaultImage || void 0,
|
|
3514
3502
|
alt: alertData.title || "Imagem do alerta"
|
|
3515
3503
|
}
|
|
3516
3504
|
),
|
|
@@ -3599,7 +3587,7 @@ var AlertsManagerView = ({
|
|
|
3599
3587
|
};
|
|
3600
3588
|
|
|
3601
3589
|
// src/components/Radio/Radio.tsx
|
|
3602
|
-
var
|
|
3590
|
+
var import_react16 = require("react");
|
|
3603
3591
|
var import_zustand3 = require("zustand");
|
|
3604
3592
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
3605
3593
|
var SIZE_CLASSES7 = {
|
|
@@ -3666,7 +3654,7 @@ var DOT_CLASSES = {
|
|
|
3666
3654
|
invalid: "bg-primary-950",
|
|
3667
3655
|
disabled: "bg-primary-950"
|
|
3668
3656
|
};
|
|
3669
|
-
var Radio = (0,
|
|
3657
|
+
var Radio = (0, import_react16.forwardRef)(
|
|
3670
3658
|
({
|
|
3671
3659
|
label,
|
|
3672
3660
|
size = "medium",
|
|
@@ -3684,10 +3672,10 @@ var Radio = (0, import_react17.forwardRef)(
|
|
|
3684
3672
|
onChange,
|
|
3685
3673
|
...props
|
|
3686
3674
|
}, ref) => {
|
|
3687
|
-
const generatedId = (0,
|
|
3675
|
+
const generatedId = (0, import_react16.useId)();
|
|
3688
3676
|
const inputId = id ?? `radio-${generatedId}`;
|
|
3689
|
-
const inputRef = (0,
|
|
3690
|
-
const [internalChecked, setInternalChecked] = (0,
|
|
3677
|
+
const inputRef = (0, import_react16.useRef)(null);
|
|
3678
|
+
const [internalChecked, setInternalChecked] = (0, import_react16.useState)(defaultChecked);
|
|
3691
3679
|
const isControlled = checkedProp !== void 0;
|
|
3692
3680
|
const checked = isControlled ? checkedProp : internalChecked;
|
|
3693
3681
|
const handleChange = (event) => {
|
|
@@ -3873,16 +3861,16 @@ var useRadioGroupStore = (externalStore) => {
|
|
|
3873
3861
|
}
|
|
3874
3862
|
return externalStore;
|
|
3875
3863
|
};
|
|
3876
|
-
var injectStore2 = (children, store) =>
|
|
3877
|
-
if (!(0,
|
|
3864
|
+
var injectStore2 = (children, store) => import_react16.Children.map(children, (child) => {
|
|
3865
|
+
if (!(0, import_react16.isValidElement)(child)) return child;
|
|
3878
3866
|
const typedChild = child;
|
|
3879
3867
|
const shouldInject = typedChild.type === RadioGroupItem;
|
|
3880
|
-
return (0,
|
|
3868
|
+
return (0, import_react16.cloneElement)(typedChild, {
|
|
3881
3869
|
...shouldInject ? { store } : {},
|
|
3882
3870
|
...typedChild.props.children ? { children: injectStore2(typedChild.props.children, store) } : {}
|
|
3883
3871
|
});
|
|
3884
3872
|
});
|
|
3885
|
-
var RadioGroup = (0,
|
|
3873
|
+
var RadioGroup = (0, import_react16.forwardRef)(
|
|
3886
3874
|
({
|
|
3887
3875
|
value: propValue,
|
|
3888
3876
|
defaultValue = "",
|
|
@@ -3893,9 +3881,9 @@ var RadioGroup = (0, import_react17.forwardRef)(
|
|
|
3893
3881
|
children,
|
|
3894
3882
|
...props
|
|
3895
3883
|
}, ref) => {
|
|
3896
|
-
const generatedId = (0,
|
|
3884
|
+
const generatedId = (0, import_react16.useId)();
|
|
3897
3885
|
const name = propName || `radio-group-${generatedId}`;
|
|
3898
|
-
const storeRef = (0,
|
|
3886
|
+
const storeRef = (0, import_react16.useRef)(null);
|
|
3899
3887
|
storeRef.current ??= createRadioGroupStore(
|
|
3900
3888
|
name,
|
|
3901
3889
|
defaultValue,
|
|
@@ -3904,18 +3892,18 @@ var RadioGroup = (0, import_react17.forwardRef)(
|
|
|
3904
3892
|
);
|
|
3905
3893
|
const store = storeRef.current;
|
|
3906
3894
|
const { setValue } = (0, import_zustand3.useStore)(store, (s) => s);
|
|
3907
|
-
(0,
|
|
3895
|
+
(0, import_react16.useEffect)(() => {
|
|
3908
3896
|
const currentValue = store.getState().value;
|
|
3909
3897
|
if (currentValue && onValueChange) {
|
|
3910
3898
|
onValueChange(currentValue);
|
|
3911
3899
|
}
|
|
3912
3900
|
}, []);
|
|
3913
|
-
(0,
|
|
3901
|
+
(0, import_react16.useEffect)(() => {
|
|
3914
3902
|
if (propValue !== void 0) {
|
|
3915
3903
|
setValue(propValue);
|
|
3916
3904
|
}
|
|
3917
3905
|
}, [propValue, setValue]);
|
|
3918
|
-
(0,
|
|
3906
|
+
(0, import_react16.useEffect)(() => {
|
|
3919
3907
|
store.setState({ disabled });
|
|
3920
3908
|
}, [disabled, store]);
|
|
3921
3909
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
@@ -3932,7 +3920,7 @@ var RadioGroup = (0, import_react17.forwardRef)(
|
|
|
3932
3920
|
}
|
|
3933
3921
|
);
|
|
3934
3922
|
RadioGroup.displayName = "RadioGroup";
|
|
3935
|
-
var RadioGroupItem = (0,
|
|
3923
|
+
var RadioGroupItem = (0, import_react16.forwardRef)(
|
|
3936
3924
|
({
|
|
3937
3925
|
value,
|
|
3938
3926
|
store: externalStore,
|
|
@@ -3950,7 +3938,7 @@ var RadioGroupItem = (0, import_react17.forwardRef)(
|
|
|
3950
3938
|
disabled: groupDisabled,
|
|
3951
3939
|
name
|
|
3952
3940
|
} = (0, import_zustand3.useStore)(store);
|
|
3953
|
-
const generatedId = (0,
|
|
3941
|
+
const generatedId = (0, import_react16.useId)();
|
|
3954
3942
|
const inputId = id ?? `radio-item-${generatedId}`;
|
|
3955
3943
|
const isChecked = groupValue === value;
|
|
3956
3944
|
const isDisabled = groupDisabled || itemDisabled;
|
|
@@ -4098,19 +4086,19 @@ var Toaster_default = Toaster;
|
|
|
4098
4086
|
|
|
4099
4087
|
// src/components/Search/Search.tsx
|
|
4100
4088
|
var import_phosphor_react16 = require("phosphor-react");
|
|
4101
|
-
var
|
|
4089
|
+
var import_react20 = require("react");
|
|
4102
4090
|
|
|
4103
4091
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
4104
4092
|
var import_phosphor_react15 = require("phosphor-react");
|
|
4105
|
-
var
|
|
4093
|
+
var import_react19 = require("react");
|
|
4106
4094
|
var import_zustand6 = require("zustand");
|
|
4107
4095
|
|
|
4108
4096
|
// src/components/ThemeToggle/ThemeToggle.tsx
|
|
4109
4097
|
var import_phosphor_react14 = require("phosphor-react");
|
|
4110
|
-
var
|
|
4098
|
+
var import_react18 = require("react");
|
|
4111
4099
|
|
|
4112
4100
|
// src/hooks/useTheme.ts
|
|
4113
|
-
var
|
|
4101
|
+
var import_react17 = require("react");
|
|
4114
4102
|
|
|
4115
4103
|
// src/store/themeStore.ts
|
|
4116
4104
|
var import_zustand5 = require("zustand");
|
|
@@ -4214,7 +4202,7 @@ var useTheme = () => {
|
|
|
4214
4202
|
initializeTheme,
|
|
4215
4203
|
handleSystemThemeChange
|
|
4216
4204
|
} = useThemeStore();
|
|
4217
|
-
(0,
|
|
4205
|
+
(0, import_react17.useEffect)(() => {
|
|
4218
4206
|
initializeTheme();
|
|
4219
4207
|
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
4220
4208
|
mediaQuery.addEventListener("change", handleSystemThemeChange);
|
|
@@ -4237,8 +4225,8 @@ var ThemeToggle = ({
|
|
|
4237
4225
|
onToggle
|
|
4238
4226
|
}) => {
|
|
4239
4227
|
const { themeMode, setTheme } = useTheme();
|
|
4240
|
-
const [tempTheme, setTempTheme] = (0,
|
|
4241
|
-
(0,
|
|
4228
|
+
const [tempTheme, setTempTheme] = (0, import_react18.useState)(themeMode);
|
|
4229
|
+
(0, import_react18.useEffect)(() => {
|
|
4242
4230
|
setTempTheme(themeMode);
|
|
4243
4231
|
}, [themeMode]);
|
|
4244
4232
|
const problemTypes = [
|
|
@@ -4315,8 +4303,8 @@ var useDropdownStore = (externalStore) => {
|
|
|
4315
4303
|
return externalStore;
|
|
4316
4304
|
};
|
|
4317
4305
|
var injectStore3 = (children, store) => {
|
|
4318
|
-
return
|
|
4319
|
-
if ((0,
|
|
4306
|
+
return import_react19.Children.map(children, (child) => {
|
|
4307
|
+
if ((0, import_react19.isValidElement)(child)) {
|
|
4320
4308
|
const typedChild = child;
|
|
4321
4309
|
const displayName = typedChild.type.displayName;
|
|
4322
4310
|
const allowed = [
|
|
@@ -4338,7 +4326,7 @@ var injectStore3 = (children, store) => {
|
|
|
4338
4326
|
if (typedChild.props.children) {
|
|
4339
4327
|
newProps.children = injectStore3(typedChild.props.children, store);
|
|
4340
4328
|
}
|
|
4341
|
-
return (0,
|
|
4329
|
+
return (0, import_react19.cloneElement)(typedChild, newProps);
|
|
4342
4330
|
}
|
|
4343
4331
|
return child;
|
|
4344
4332
|
});
|
|
@@ -4348,14 +4336,14 @@ var DropdownMenu = ({
|
|
|
4348
4336
|
open: propOpen,
|
|
4349
4337
|
onOpenChange
|
|
4350
4338
|
}) => {
|
|
4351
|
-
const storeRef = (0,
|
|
4339
|
+
const storeRef = (0, import_react19.useRef)(null);
|
|
4352
4340
|
storeRef.current ??= createDropdownStore();
|
|
4353
4341
|
const store = storeRef.current;
|
|
4354
4342
|
const { open, setOpen: storeSetOpen } = (0, import_zustand6.useStore)(store, (s) => s);
|
|
4355
4343
|
const setOpen = (newOpen) => {
|
|
4356
4344
|
storeSetOpen(newOpen);
|
|
4357
4345
|
};
|
|
4358
|
-
const menuRef = (0,
|
|
4346
|
+
const menuRef = (0, import_react19.useRef)(null);
|
|
4359
4347
|
const handleArrowDownOrArrowUp = (event) => {
|
|
4360
4348
|
const menuContent = menuRef.current?.querySelector('[role="menu"]');
|
|
4361
4349
|
if (menuContent) {
|
|
@@ -4389,7 +4377,7 @@ var DropdownMenu = ({
|
|
|
4389
4377
|
setOpen(false);
|
|
4390
4378
|
}
|
|
4391
4379
|
};
|
|
4392
|
-
(0,
|
|
4380
|
+
(0, import_react19.useEffect)(() => {
|
|
4393
4381
|
if (open) {
|
|
4394
4382
|
document.addEventListener("pointerdown", handleClickOutside);
|
|
4395
4383
|
document.addEventListener("keydown", handleDownkey);
|
|
@@ -4399,10 +4387,10 @@ var DropdownMenu = ({
|
|
|
4399
4387
|
document.removeEventListener("keydown", handleDownkey);
|
|
4400
4388
|
};
|
|
4401
4389
|
}, [open]);
|
|
4402
|
-
(0,
|
|
4390
|
+
(0, import_react19.useEffect)(() => {
|
|
4403
4391
|
onOpenChange?.(open);
|
|
4404
4392
|
}, [open, onOpenChange]);
|
|
4405
|
-
(0,
|
|
4393
|
+
(0, import_react19.useEffect)(() => {
|
|
4406
4394
|
if (propOpen !== void 0) {
|
|
4407
4395
|
setOpen(propOpen);
|
|
4408
4396
|
}
|
|
@@ -4463,7 +4451,7 @@ var MENUCONTENT_VARIANT_CLASSES = {
|
|
|
4463
4451
|
menu: "p-1",
|
|
4464
4452
|
profile: "p-6"
|
|
4465
4453
|
};
|
|
4466
|
-
var MenuLabel = (0,
|
|
4454
|
+
var MenuLabel = (0, import_react19.forwardRef)(({ className, inset, store: _store, ...props }, ref) => {
|
|
4467
4455
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4468
4456
|
"div",
|
|
4469
4457
|
{
|
|
@@ -4474,7 +4462,7 @@ var MenuLabel = (0, import_react20.forwardRef)(({ className, inset, store: _stor
|
|
|
4474
4462
|
);
|
|
4475
4463
|
});
|
|
4476
4464
|
MenuLabel.displayName = "MenuLabel";
|
|
4477
|
-
var DropdownMenuContent = (0,
|
|
4465
|
+
var DropdownMenuContent = (0, import_react19.forwardRef)(
|
|
4478
4466
|
({
|
|
4479
4467
|
className,
|
|
4480
4468
|
align = "start",
|
|
@@ -4487,8 +4475,8 @@ var DropdownMenuContent = (0, import_react20.forwardRef)(
|
|
|
4487
4475
|
}, ref) => {
|
|
4488
4476
|
const store = useDropdownStore(externalStore);
|
|
4489
4477
|
const open = (0, import_zustand6.useStore)(store, (s) => s.open);
|
|
4490
|
-
const [isVisible, setIsVisible] = (0,
|
|
4491
|
-
(0,
|
|
4478
|
+
const [isVisible, setIsVisible] = (0, import_react19.useState)(open);
|
|
4479
|
+
(0, import_react19.useEffect)(() => {
|
|
4492
4480
|
if (open) {
|
|
4493
4481
|
setIsVisible(true);
|
|
4494
4482
|
} else {
|
|
@@ -4528,7 +4516,7 @@ var DropdownMenuContent = (0, import_react20.forwardRef)(
|
|
|
4528
4516
|
}
|
|
4529
4517
|
);
|
|
4530
4518
|
DropdownMenuContent.displayName = "DropdownMenuContent";
|
|
4531
|
-
var DropdownMenuItem = (0,
|
|
4519
|
+
var DropdownMenuItem = (0, import_react19.forwardRef)(
|
|
4532
4520
|
({
|
|
4533
4521
|
className,
|
|
4534
4522
|
size = "small",
|
|
@@ -4606,7 +4594,7 @@ var DropdownMenuItem = (0, import_react20.forwardRef)(
|
|
|
4606
4594
|
}
|
|
4607
4595
|
);
|
|
4608
4596
|
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
4609
|
-
var DropdownMenuSeparator = (0,
|
|
4597
|
+
var DropdownMenuSeparator = (0, import_react19.forwardRef)(({ className, store: _store, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4610
4598
|
"div",
|
|
4611
4599
|
{
|
|
4612
4600
|
ref,
|
|
@@ -4615,7 +4603,7 @@ var DropdownMenuSeparator = (0, import_react20.forwardRef)(({ className, store:
|
|
|
4615
4603
|
}
|
|
4616
4604
|
));
|
|
4617
4605
|
DropdownMenuSeparator.displayName = "DropdownMenuSeparator";
|
|
4618
|
-
var ProfileMenuTrigger = (0,
|
|
4606
|
+
var ProfileMenuTrigger = (0, import_react19.forwardRef)(({ className, onClick, store: externalStore, ...props }, ref) => {
|
|
4619
4607
|
const store = useDropdownStore(externalStore);
|
|
4620
4608
|
const open = (0, import_zustand6.useStore)(store, (s) => s.open);
|
|
4621
4609
|
const toggleOpen = () => store.setState({ open: !open });
|
|
@@ -4639,16 +4627,19 @@ var ProfileMenuTrigger = (0, import_react20.forwardRef)(({ className, onClick, s
|
|
|
4639
4627
|
);
|
|
4640
4628
|
});
|
|
4641
4629
|
ProfileMenuTrigger.displayName = "ProfileMenuTrigger";
|
|
4642
|
-
var ProfileMenuHeader = (0,
|
|
4630
|
+
var ProfileMenuHeader = (0, import_react19.forwardRef)(({ className, name, email, photoUrl, store: _store, ...props }, ref) => {
|
|
4643
4631
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
4644
4632
|
"div",
|
|
4645
4633
|
{
|
|
4646
4634
|
ref,
|
|
4647
4635
|
"data-component": "ProfileMenuHeader",
|
|
4648
|
-
className: cn(
|
|
4636
|
+
className: cn(
|
|
4637
|
+
"flex flex-row gap-4 items-center min-w-[280px]",
|
|
4638
|
+
className
|
|
4639
|
+
),
|
|
4649
4640
|
...props,
|
|
4650
4641
|
children: [
|
|
4651
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "w-16 h-16 bg-primary-100 rounded-full flex items-center justify-center overflow-hidden", children: photoUrl ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4642
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "w-16 h-16 bg-primary-100 rounded-full flex items-center justify-center overflow-hidden flex-shrink-0", children: photoUrl ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4652
4643
|
"img",
|
|
4653
4644
|
{
|
|
4654
4645
|
src: photoUrl,
|
|
@@ -4656,23 +4647,64 @@ var ProfileMenuHeader = (0, import_react20.forwardRef)(({ className, name, email
|
|
|
4656
4647
|
className: "w-full h-full object-cover"
|
|
4657
4648
|
}
|
|
4658
4649
|
) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_phosphor_react15.User, { size: 34, className: "text-primary-800" }) }),
|
|
4659
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex flex-col ", children: [
|
|
4660
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4661
|
-
|
|
4650
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex flex-col min-w-0", children: [
|
|
4651
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4652
|
+
Text_default,
|
|
4653
|
+
{
|
|
4654
|
+
size: "xl",
|
|
4655
|
+
weight: "bold",
|
|
4656
|
+
color: "text-text-950",
|
|
4657
|
+
className: "truncate",
|
|
4658
|
+
children: name
|
|
4659
|
+
}
|
|
4660
|
+
),
|
|
4661
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text_default, { size: "md", color: "text-text-600", className: "truncate", children: email })
|
|
4662
4662
|
] })
|
|
4663
4663
|
]
|
|
4664
4664
|
}
|
|
4665
4665
|
);
|
|
4666
4666
|
});
|
|
4667
4667
|
ProfileMenuHeader.displayName = "ProfileMenuHeader";
|
|
4668
|
+
var ProfileMenuInfo = (0, import_react19.forwardRef)(
|
|
4669
|
+
({
|
|
4670
|
+
className,
|
|
4671
|
+
schoolName,
|
|
4672
|
+
classYearName,
|
|
4673
|
+
schoolYearName,
|
|
4674
|
+
store: _store,
|
|
4675
|
+
...props
|
|
4676
|
+
}, ref) => {
|
|
4677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
4678
|
+
"div",
|
|
4679
|
+
{
|
|
4680
|
+
ref,
|
|
4681
|
+
"data-component": "ProfileMenuInfo",
|
|
4682
|
+
className: cn("flex flex-row gap-4 items-center", className),
|
|
4683
|
+
...props,
|
|
4684
|
+
children: [
|
|
4685
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "w-16 h-16" }),
|
|
4686
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex flex-col ", children: [
|
|
4687
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text_default, { size: "md", color: "text-text-600", children: schoolName }),
|
|
4688
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("span", { className: "flex flex-row items-center gap-2", children: [
|
|
4689
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text_default, { size: "md", color: "text-text-600", children: classYearName }),
|
|
4690
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-text-600 text-xs align-middle", children: "\u25CF" }),
|
|
4691
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Text_default, { size: "md", color: "text-text-600", children: schoolYearName })
|
|
4692
|
+
] })
|
|
4693
|
+
] })
|
|
4694
|
+
]
|
|
4695
|
+
}
|
|
4696
|
+
);
|
|
4697
|
+
}
|
|
4698
|
+
);
|
|
4699
|
+
ProfileMenuInfo.displayName = "ProfileMenuInfo";
|
|
4668
4700
|
var ProfileToggleTheme = ({
|
|
4669
4701
|
store: externalStore,
|
|
4670
4702
|
...props
|
|
4671
4703
|
}) => {
|
|
4672
4704
|
const { themeMode, setTheme } = useTheme();
|
|
4673
|
-
const [modalThemeToggle, setModalThemeToggle] = (0,
|
|
4674
|
-
const [selectedTheme, setSelectedTheme] = (0,
|
|
4675
|
-
const internalStoreRef = (0,
|
|
4705
|
+
const [modalThemeToggle, setModalThemeToggle] = (0, import_react19.useState)(false);
|
|
4706
|
+
const [selectedTheme, setSelectedTheme] = (0, import_react19.useState)(themeMode);
|
|
4707
|
+
const internalStoreRef = (0, import_react19.useRef)(null);
|
|
4676
4708
|
internalStoreRef.current ??= createDropdownStore();
|
|
4677
4709
|
const store = externalStore ?? internalStoreRef.current;
|
|
4678
4710
|
const setOpen = (0, import_zustand6.useStore)(store, (s) => s.setOpen);
|
|
@@ -4748,7 +4780,7 @@ var ProfileToggleTheme = ({
|
|
|
4748
4780
|
] });
|
|
4749
4781
|
};
|
|
4750
4782
|
ProfileToggleTheme.displayName = "ProfileToggleTheme";
|
|
4751
|
-
var ProfileMenuSection = (0,
|
|
4783
|
+
var ProfileMenuSection = (0, import_react19.forwardRef)(({ className, children, store: _store, ...props }, ref) => {
|
|
4752
4784
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { ref, className: cn("flex flex-col p-2", className), ...props, children });
|
|
4753
4785
|
});
|
|
4754
4786
|
ProfileMenuSection.displayName = "ProfileMenuSection";
|
|
@@ -4808,7 +4840,7 @@ var updateInputValue = (value, ref, onChange) => {
|
|
|
4808
4840
|
onChange(event);
|
|
4809
4841
|
}
|
|
4810
4842
|
};
|
|
4811
|
-
var Search = (0,
|
|
4843
|
+
var Search = (0, import_react20.forwardRef)(
|
|
4812
4844
|
({
|
|
4813
4845
|
options = [],
|
|
4814
4846
|
onSelect,
|
|
@@ -4829,13 +4861,13 @@ var Search = (0, import_react21.forwardRef)(
|
|
|
4829
4861
|
onKeyDown: userOnKeyDown,
|
|
4830
4862
|
...props
|
|
4831
4863
|
}, ref) => {
|
|
4832
|
-
const [dropdownOpen, setDropdownOpen] = (0,
|
|
4833
|
-
const [forceClose, setForceClose] = (0,
|
|
4834
|
-
const justSelectedRef = (0,
|
|
4835
|
-
const dropdownStore = (0,
|
|
4836
|
-
const dropdownRef = (0,
|
|
4837
|
-
const inputElRef = (0,
|
|
4838
|
-
const filteredOptions = (0,
|
|
4864
|
+
const [dropdownOpen, setDropdownOpen] = (0, import_react20.useState)(false);
|
|
4865
|
+
const [forceClose, setForceClose] = (0, import_react20.useState)(false);
|
|
4866
|
+
const justSelectedRef = (0, import_react20.useRef)(false);
|
|
4867
|
+
const dropdownStore = (0, import_react20.useRef)(createDropdownStore()).current;
|
|
4868
|
+
const dropdownRef = (0, import_react20.useRef)(null);
|
|
4869
|
+
const inputElRef = (0, import_react20.useRef)(null);
|
|
4870
|
+
const filteredOptions = (0, import_react20.useMemo)(() => {
|
|
4839
4871
|
if (!options.length) {
|
|
4840
4872
|
return [];
|
|
4841
4873
|
}
|
|
@@ -4848,7 +4880,7 @@ var Search = (0, import_react21.forwardRef)(
|
|
|
4848
4880
|
dropdownStore.setState({ open });
|
|
4849
4881
|
onDropdownChange?.(open);
|
|
4850
4882
|
};
|
|
4851
|
-
(0,
|
|
4883
|
+
(0, import_react20.useEffect)(() => {
|
|
4852
4884
|
if (justSelectedRef.current) {
|
|
4853
4885
|
justSelectedRef.current = false;
|
|
4854
4886
|
return;
|
|
@@ -4867,7 +4899,7 @@ var Search = (0, import_react21.forwardRef)(
|
|
|
4867
4899
|
setOpenAndNotify(false);
|
|
4868
4900
|
updateInputValue(option, ref, onChange);
|
|
4869
4901
|
};
|
|
4870
|
-
(0,
|
|
4902
|
+
(0, import_react20.useEffect)(() => {
|
|
4871
4903
|
const handleClickOutside = (event) => {
|
|
4872
4904
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
4873
4905
|
setOpenAndNotify(false);
|
|
@@ -4880,7 +4912,7 @@ var Search = (0, import_react21.forwardRef)(
|
|
|
4880
4912
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
4881
4913
|
};
|
|
4882
4914
|
}, [showDropdown, dropdownStore, onDropdownChange]);
|
|
4883
|
-
const generatedId = (0,
|
|
4915
|
+
const generatedId = (0, import_react20.useId)();
|
|
4884
4916
|
const inputId = id ?? `search-${generatedId}`;
|
|
4885
4917
|
const dropdownId = `${inputId}-dropdown`;
|
|
4886
4918
|
const handleClear = () => {
|
|
@@ -6008,7 +6040,7 @@ var Stepper = ({
|
|
|
6008
6040
|
var Stepper_default = Stepper;
|
|
6009
6041
|
|
|
6010
6042
|
// src/components/Calendar/Calendar.tsx
|
|
6011
|
-
var
|
|
6043
|
+
var import_react21 = require("react");
|
|
6012
6044
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
6013
6045
|
var WEEK_DAYS = ["SEG", "TER", "QUA", "QUI", "SEX", "S\xC1B", "DOM"];
|
|
6014
6046
|
var WEEK_DAYS_SHORT = ["S", "T", "Q", "Q", "S", "S", "D"];
|
|
@@ -6108,11 +6140,11 @@ var Calendar = ({
|
|
|
6108
6140
|
showActivities = true,
|
|
6109
6141
|
className = ""
|
|
6110
6142
|
}) => {
|
|
6111
|
-
const [currentDate, setCurrentDate] = (0,
|
|
6112
|
-
const [isMonthPickerOpen, setIsMonthPickerOpen] = (0,
|
|
6113
|
-
const monthPickerRef = (0,
|
|
6114
|
-
const monthPickerContainerRef = (0,
|
|
6115
|
-
(0,
|
|
6143
|
+
const [currentDate, setCurrentDate] = (0, import_react21.useState)(selectedDate || /* @__PURE__ */ new Date());
|
|
6144
|
+
const [isMonthPickerOpen, setIsMonthPickerOpen] = (0, import_react21.useState)(false);
|
|
6145
|
+
const monthPickerRef = (0, import_react21.useRef)(null);
|
|
6146
|
+
const monthPickerContainerRef = (0, import_react21.useRef)(null);
|
|
6147
|
+
(0, import_react21.useEffect)(() => {
|
|
6116
6148
|
const handleClickOutside = (event) => {
|
|
6117
6149
|
if (monthPickerContainerRef.current && !monthPickerContainerRef.current.contains(event.target)) {
|
|
6118
6150
|
setIsMonthPickerOpen(false);
|
|
@@ -6126,7 +6158,7 @@ var Calendar = ({
|
|
|
6126
6158
|
};
|
|
6127
6159
|
}, [isMonthPickerOpen]);
|
|
6128
6160
|
const today = /* @__PURE__ */ new Date();
|
|
6129
|
-
const availableYears = (0,
|
|
6161
|
+
const availableYears = (0, import_react21.useMemo)(() => {
|
|
6130
6162
|
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
6131
6163
|
const years = [];
|
|
6132
6164
|
for (let year = currentYear - 10; year <= currentYear + 10; year++) {
|
|
@@ -6134,7 +6166,7 @@ var Calendar = ({
|
|
|
6134
6166
|
}
|
|
6135
6167
|
return years;
|
|
6136
6168
|
}, []);
|
|
6137
|
-
const calendarData = (0,
|
|
6169
|
+
const calendarData = (0, import_react21.useMemo)(() => {
|
|
6138
6170
|
const year = currentDate.getFullYear();
|
|
6139
6171
|
const month = currentDate.getMonth();
|
|
6140
6172
|
const firstDay = new Date(year, month, 1);
|
|
@@ -6505,7 +6537,7 @@ var Calendar = ({
|
|
|
6505
6537
|
var Calendar_default = Calendar;
|
|
6506
6538
|
|
|
6507
6539
|
// src/components/AlertDialog/AlertDialog.tsx
|
|
6508
|
-
var
|
|
6540
|
+
var import_react22 = require("react");
|
|
6509
6541
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
6510
6542
|
var SIZE_CLASSES11 = {
|
|
6511
6543
|
"extra-small": "w-screen max-w-[324px]",
|
|
@@ -6514,7 +6546,7 @@ var SIZE_CLASSES11 = {
|
|
|
6514
6546
|
large: "w-screen max-w-[578px]",
|
|
6515
6547
|
"extra-large": "w-screen max-w-[912px]"
|
|
6516
6548
|
};
|
|
6517
|
-
var AlertDialog = (0,
|
|
6549
|
+
var AlertDialog = (0, import_react22.forwardRef)(
|
|
6518
6550
|
({
|
|
6519
6551
|
description,
|
|
6520
6552
|
cancelButtonLabel = "Cancelar",
|
|
@@ -6532,7 +6564,7 @@ var AlertDialog = (0, import_react23.forwardRef)(
|
|
|
6532
6564
|
size = "medium",
|
|
6533
6565
|
...props
|
|
6534
6566
|
}, ref) => {
|
|
6535
|
-
(0,
|
|
6567
|
+
(0, import_react22.useEffect)(() => {
|
|
6536
6568
|
if (!isOpen || !closeOnEscape) return;
|
|
6537
6569
|
const handleEscape = (event) => {
|
|
6538
6570
|
if (event.key === "Escape") {
|
|
@@ -6542,7 +6574,7 @@ var AlertDialog = (0, import_react23.forwardRef)(
|
|
|
6542
6574
|
document.addEventListener("keydown", handleEscape);
|
|
6543
6575
|
return () => document.removeEventListener("keydown", handleEscape);
|
|
6544
6576
|
}, [isOpen, closeOnEscape]);
|
|
6545
|
-
(0,
|
|
6577
|
+
(0, import_react22.useEffect)(() => {
|
|
6546
6578
|
if (isOpen) {
|
|
6547
6579
|
document.body.style.overflow = "hidden";
|
|
6548
6580
|
} else {
|
|
@@ -6628,9 +6660,9 @@ var AlertDialog = (0, import_react23.forwardRef)(
|
|
|
6628
6660
|
AlertDialog.displayName = "AlertDialog";
|
|
6629
6661
|
|
|
6630
6662
|
// src/components/LoadingModal/loadingModal.tsx
|
|
6631
|
-
var
|
|
6663
|
+
var import_react23 = require("react");
|
|
6632
6664
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
6633
|
-
var LoadingModal = (0,
|
|
6665
|
+
var LoadingModal = (0, import_react23.forwardRef)(
|
|
6634
6666
|
({ open, title = "Titulo...", subtitle = "Subtitulo...", ...props }, ref) => {
|
|
6635
6667
|
if (!open) return null;
|
|
6636
6668
|
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
@@ -6684,10 +6716,10 @@ var loadingModal_default = LoadingModal;
|
|
|
6684
6716
|
|
|
6685
6717
|
// src/components/NotificationCard/NotificationCard.tsx
|
|
6686
6718
|
var import_phosphor_react19 = require("phosphor-react");
|
|
6687
|
-
var
|
|
6719
|
+
var import_react26 = require("react");
|
|
6688
6720
|
|
|
6689
6721
|
// src/components/Skeleton/Skeleton.tsx
|
|
6690
|
-
var
|
|
6722
|
+
var import_react24 = require("react");
|
|
6691
6723
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
6692
6724
|
var SKELETON_ANIMATION_CLASSES = {
|
|
6693
6725
|
pulse: "animate-pulse",
|
|
@@ -6705,7 +6737,7 @@ var SPACING_CLASSES = {
|
|
|
6705
6737
|
medium: "space-y-2",
|
|
6706
6738
|
large: "space-y-3"
|
|
6707
6739
|
};
|
|
6708
|
-
var Skeleton = (0,
|
|
6740
|
+
var Skeleton = (0, import_react24.forwardRef)(
|
|
6709
6741
|
({
|
|
6710
6742
|
variant = "text",
|
|
6711
6743
|
width,
|
|
@@ -6754,13 +6786,13 @@ var Skeleton = (0, import_react25.forwardRef)(
|
|
|
6754
6786
|
);
|
|
6755
6787
|
}
|
|
6756
6788
|
);
|
|
6757
|
-
var SkeletonText = (0,
|
|
6789
|
+
var SkeletonText = (0, import_react24.forwardRef)(
|
|
6758
6790
|
(props, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Skeleton, { ref, variant: "text", ...props })
|
|
6759
6791
|
);
|
|
6760
|
-
var SkeletonCircle = (0,
|
|
6761
|
-
var SkeletonRectangle = (0,
|
|
6762
|
-
var SkeletonRounded = (0,
|
|
6763
|
-
var SkeletonCard = (0,
|
|
6792
|
+
var SkeletonCircle = (0, import_react24.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Skeleton, { ref, variant: "circular", ...props }));
|
|
6793
|
+
var SkeletonRectangle = (0, import_react24.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Skeleton, { ref, variant: "rectangular", ...props }));
|
|
6794
|
+
var SkeletonRounded = (0, import_react24.forwardRef)((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Skeleton, { ref, variant: "rounded", ...props }));
|
|
6795
|
+
var SkeletonCard = (0, import_react24.forwardRef)(
|
|
6764
6796
|
({
|
|
6765
6797
|
showAvatar = true,
|
|
6766
6798
|
showTitle = true,
|
|
@@ -6796,7 +6828,7 @@ var SkeletonCard = (0, import_react25.forwardRef)(
|
|
|
6796
6828
|
);
|
|
6797
6829
|
}
|
|
6798
6830
|
);
|
|
6799
|
-
var SkeletonList = (0,
|
|
6831
|
+
var SkeletonList = (0, import_react24.forwardRef)(
|
|
6800
6832
|
({
|
|
6801
6833
|
items = 3,
|
|
6802
6834
|
showAvatar = true,
|
|
@@ -6815,7 +6847,7 @@ var SkeletonList = (0, import_react25.forwardRef)(
|
|
|
6815
6847
|
] }, index)) });
|
|
6816
6848
|
}
|
|
6817
6849
|
);
|
|
6818
|
-
var SkeletonTable = (0,
|
|
6850
|
+
var SkeletonTable = (0, import_react24.forwardRef)(
|
|
6819
6851
|
({ rows = 5, columns = 4, showHeader = true, className = "", ...props }, ref) => {
|
|
6820
6852
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { ref, className: cn("w-full", className), ...props, children: [
|
|
6821
6853
|
showHeader && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "flex space-x-2 mb-3", children: Array.from({ length: columns }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
@@ -6839,7 +6871,7 @@ var SkeletonTable = (0, import_react25.forwardRef)(
|
|
|
6839
6871
|
);
|
|
6840
6872
|
|
|
6841
6873
|
// src/hooks/useMobile.ts
|
|
6842
|
-
var
|
|
6874
|
+
var import_react25 = require("react");
|
|
6843
6875
|
var MOBILE_WIDTH = 500;
|
|
6844
6876
|
var TABLET_WIDTH = 931;
|
|
6845
6877
|
var SMALL_MOBILE_WIDTH = 425;
|
|
@@ -6858,13 +6890,13 @@ var getDeviceType = () => {
|
|
|
6858
6890
|
return width < TABLET_WIDTH ? "responsive" : "desktop";
|
|
6859
6891
|
};
|
|
6860
6892
|
var useMobile = () => {
|
|
6861
|
-
const [isMobile, setIsMobile] = (0,
|
|
6862
|
-
const [isTablet, setIsTablet] = (0,
|
|
6863
|
-
const [isSmallMobile, setIsSmallMobile] = (0,
|
|
6864
|
-
const [isExtraSmallMobile, setIsExtraSmallMobile] = (0,
|
|
6865
|
-
const [isUltraSmallMobile, setIsUltraSmallMobile] = (0,
|
|
6866
|
-
const [isTinyMobile, setIsTinyMobile] = (0,
|
|
6867
|
-
(0,
|
|
6893
|
+
const [isMobile, setIsMobile] = (0, import_react25.useState)(false);
|
|
6894
|
+
const [isTablet, setIsTablet] = (0, import_react25.useState)(false);
|
|
6895
|
+
const [isSmallMobile, setIsSmallMobile] = (0, import_react25.useState)(false);
|
|
6896
|
+
const [isExtraSmallMobile, setIsExtraSmallMobile] = (0, import_react25.useState)(false);
|
|
6897
|
+
const [isUltraSmallMobile, setIsUltraSmallMobile] = (0, import_react25.useState)(false);
|
|
6898
|
+
const [isTinyMobile, setIsTinyMobile] = (0, import_react25.useState)(false);
|
|
6899
|
+
(0, import_react25.useEffect)(() => {
|
|
6868
6900
|
const checkScreenSize = () => {
|
|
6869
6901
|
const width = getWindowWidth();
|
|
6870
6902
|
setIsMobile(width < MOBILE_WIDTH);
|
|
@@ -7297,7 +7329,7 @@ var NotificationList = ({
|
|
|
7297
7329
|
className,
|
|
7298
7330
|
emptyStateImage
|
|
7299
7331
|
}) => {
|
|
7300
|
-
const [globalNotificationModal, setGlobalNotificationModal] = (0,
|
|
7332
|
+
const [globalNotificationModal, setGlobalNotificationModal] = (0, import_react26.useState)({ isOpen: false, notification: null });
|
|
7301
7333
|
const handleGlobalNotificationClick = (notification) => {
|
|
7302
7334
|
if (onGlobalNotificationClick) {
|
|
7303
7335
|
onGlobalNotificationClick(notification);
|
|
@@ -7411,8 +7443,8 @@ var NotificationCenter = ({
|
|
|
7411
7443
|
className
|
|
7412
7444
|
}) => {
|
|
7413
7445
|
const { isMobile } = useMobile();
|
|
7414
|
-
const [isModalOpen, setIsModalOpen] = (0,
|
|
7415
|
-
const [globalNotificationModal, setGlobalNotificationModal] = (0,
|
|
7446
|
+
const [isModalOpen, setIsModalOpen] = (0, import_react26.useState)(false);
|
|
7447
|
+
const [globalNotificationModal, setGlobalNotificationModal] = (0, import_react26.useState)({ isOpen: false, notification: null });
|
|
7416
7448
|
const handleMobileClick = () => {
|
|
7417
7449
|
setIsModalOpen(true);
|
|
7418
7450
|
onFetchNotifications?.();
|
|
@@ -7427,7 +7459,7 @@ var NotificationCenter = ({
|
|
|
7427
7459
|
onToggleActive?.();
|
|
7428
7460
|
}
|
|
7429
7461
|
};
|
|
7430
|
-
(0,
|
|
7462
|
+
(0, import_react26.useEffect)(() => {
|
|
7431
7463
|
if (isActive) {
|
|
7432
7464
|
onFetchNotifications?.();
|
|
7433
7465
|
}
|
|
@@ -7960,7 +7992,7 @@ var createUseNotificationStore = (apiClient) => {
|
|
|
7960
7992
|
};
|
|
7961
7993
|
|
|
7962
7994
|
// src/hooks/useNotifications.ts
|
|
7963
|
-
var
|
|
7995
|
+
var import_react27 = require("react");
|
|
7964
7996
|
var createUseNotifications = (apiClient) => {
|
|
7965
7997
|
const useNotificationStore = createUseNotificationStore(apiClient);
|
|
7966
7998
|
return () => {
|
|
@@ -7979,7 +8011,7 @@ var createUseNotifications = (apiClient) => {
|
|
|
7979
8011
|
resetError,
|
|
7980
8012
|
getGroupedNotifications
|
|
7981
8013
|
} = useNotificationStore();
|
|
7982
|
-
const handleNavigate = (0,
|
|
8014
|
+
const handleNavigate = (0, import_react27.useCallback)(
|
|
7983
8015
|
(entityType, entityId, onAfterNavigate) => {
|
|
7984
8016
|
if (entityType && entityId) {
|
|
7985
8017
|
switch (entityType.toUpperCase()) {
|
|
@@ -7997,7 +8029,7 @@ var createUseNotifications = (apiClient) => {
|
|
|
7997
8029
|
},
|
|
7998
8030
|
[]
|
|
7999
8031
|
);
|
|
8000
|
-
const getActionLabel = (0,
|
|
8032
|
+
const getActionLabel = (0, import_react27.useCallback)(
|
|
8001
8033
|
(entityType) => {
|
|
8002
8034
|
if (!entityType) return "Ver mais";
|
|
8003
8035
|
switch (entityType.toUpperCase()) {
|
|
@@ -8011,7 +8043,7 @@ var createUseNotifications = (apiClient) => {
|
|
|
8011
8043
|
},
|
|
8012
8044
|
[]
|
|
8013
8045
|
);
|
|
8014
|
-
const markAsReadAndNavigate = (0,
|
|
8046
|
+
const markAsReadAndNavigate = (0, import_react27.useCallback)(
|
|
8015
8047
|
async (id, entityType, entityId, onAfterNavigate) => {
|
|
8016
8048
|
await markAsRead(id);
|
|
8017
8049
|
if (entityType && entityId) {
|
|
@@ -8020,11 +8052,11 @@ var createUseNotifications = (apiClient) => {
|
|
|
8020
8052
|
},
|
|
8021
8053
|
[markAsRead, handleNavigate]
|
|
8022
8054
|
);
|
|
8023
|
-
const refreshNotifications = (0,
|
|
8055
|
+
const refreshNotifications = (0, import_react27.useCallback)(async () => {
|
|
8024
8056
|
resetError();
|
|
8025
8057
|
await fetchNotifications();
|
|
8026
8058
|
}, [resetError, fetchNotifications]);
|
|
8027
|
-
const formatNotification = (0,
|
|
8059
|
+
const formatNotification = (0, import_react27.useCallback)(
|
|
8028
8060
|
(notification) => ({
|
|
8029
8061
|
...notification,
|
|
8030
8062
|
time: formatTimeAgo(notification.createdAt),
|
|
@@ -8033,7 +8065,7 @@ var createUseNotifications = (apiClient) => {
|
|
|
8033
8065
|
}),
|
|
8034
8066
|
[]
|
|
8035
8067
|
);
|
|
8036
|
-
const getFormattedGroupedNotifications = (0,
|
|
8068
|
+
const getFormattedGroupedNotifications = (0, import_react27.useCallback)(() => {
|
|
8037
8069
|
const groups = getGroupedNotifications();
|
|
8038
8070
|
return groups.map((group) => ({
|
|
8039
8071
|
...group,
|
|
@@ -8213,10 +8245,10 @@ var FilterModal = ({
|
|
|
8213
8245
|
};
|
|
8214
8246
|
|
|
8215
8247
|
// src/components/Filter/useTableFilter.ts
|
|
8216
|
-
var
|
|
8248
|
+
var import_react28 = require("react");
|
|
8217
8249
|
var useTableFilter = (initialConfigs, options = {}) => {
|
|
8218
8250
|
const { syncWithUrl = false } = options;
|
|
8219
|
-
const getInitialState = (0,
|
|
8251
|
+
const getInitialState = (0, import_react28.useCallback)(() => {
|
|
8220
8252
|
if (!syncWithUrl || globalThis.window === void 0) {
|
|
8221
8253
|
return initialConfigs;
|
|
8222
8254
|
}
|
|
@@ -8234,8 +8266,8 @@ var useTableFilter = (initialConfigs, options = {}) => {
|
|
|
8234
8266
|
}));
|
|
8235
8267
|
return configsWithUrlState;
|
|
8236
8268
|
}, [initialConfigs, syncWithUrl]);
|
|
8237
|
-
const [filterConfigs, setFilterConfigs] = (0,
|
|
8238
|
-
const activeFilters = (0,
|
|
8269
|
+
const [filterConfigs, setFilterConfigs] = (0, import_react28.useState)(getInitialState);
|
|
8270
|
+
const activeFilters = (0, import_react28.useMemo)(() => {
|
|
8239
8271
|
const filters = {};
|
|
8240
8272
|
for (const config of filterConfigs) {
|
|
8241
8273
|
for (const category of config.categories) {
|
|
@@ -8247,10 +8279,10 @@ var useTableFilter = (initialConfigs, options = {}) => {
|
|
|
8247
8279
|
return filters;
|
|
8248
8280
|
}, [filterConfigs]);
|
|
8249
8281
|
const hasActiveFilters = Object.keys(activeFilters).length > 0;
|
|
8250
|
-
const updateFilters = (0,
|
|
8282
|
+
const updateFilters = (0, import_react28.useCallback)((configs) => {
|
|
8251
8283
|
setFilterConfigs(configs);
|
|
8252
8284
|
}, []);
|
|
8253
|
-
const applyFilters = (0,
|
|
8285
|
+
const applyFilters = (0, import_react28.useCallback)(() => {
|
|
8254
8286
|
if (!syncWithUrl || globalThis.window === void 0) {
|
|
8255
8287
|
return;
|
|
8256
8288
|
}
|
|
@@ -8268,7 +8300,7 @@ var useTableFilter = (initialConfigs, options = {}) => {
|
|
|
8268
8300
|
}
|
|
8269
8301
|
globalThis.window.history.replaceState({}, "", url.toString());
|
|
8270
8302
|
}, [filterConfigs, syncWithUrl]);
|
|
8271
|
-
const clearFilters = (0,
|
|
8303
|
+
const clearFilters = (0, import_react28.useCallback)(() => {
|
|
8272
8304
|
const clearedConfigs = filterConfigs.map((config) => ({
|
|
8273
8305
|
...config,
|
|
8274
8306
|
categories: config.categories.map((category) => ({
|
|
@@ -8288,7 +8320,7 @@ var useTableFilter = (initialConfigs, options = {}) => {
|
|
|
8288
8320
|
globalThis.window.history.replaceState({}, "", url.toString());
|
|
8289
8321
|
}
|
|
8290
8322
|
}, [filterConfigs, syncWithUrl]);
|
|
8291
|
-
(0,
|
|
8323
|
+
(0, import_react28.useEffect)(() => {
|
|
8292
8324
|
if (!syncWithUrl || globalThis.window === void 0) {
|
|
8293
8325
|
return;
|
|
8294
8326
|
}
|
|
@@ -8310,7 +8342,7 @@ var useTableFilter = (initialConfigs, options = {}) => {
|
|
|
8310
8342
|
|
|
8311
8343
|
// src/components/Select/Select.tsx
|
|
8312
8344
|
var import_zustand8 = require("zustand");
|
|
8313
|
-
var
|
|
8345
|
+
var import_react29 = require("react");
|
|
8314
8346
|
var import_phosphor_react21 = require("phosphor-react");
|
|
8315
8347
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
8316
8348
|
var VARIANT_CLASSES4 = {
|
|
@@ -8370,13 +8402,13 @@ function getLabelAsNode(children) {
|
|
|
8370
8402
|
if (typeof children === "string" || typeof children === "number") {
|
|
8371
8403
|
return children;
|
|
8372
8404
|
}
|
|
8373
|
-
const flattened =
|
|
8405
|
+
const flattened = import_react29.Children.toArray(children);
|
|
8374
8406
|
if (flattened.length === 1) return flattened[0];
|
|
8375
8407
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_jsx_runtime49.Fragment, { children: flattened });
|
|
8376
8408
|
}
|
|
8377
8409
|
var injectStore4 = (children, store, size, selectId) => {
|
|
8378
|
-
return
|
|
8379
|
-
if ((0,
|
|
8410
|
+
return import_react29.Children.map(children, (child) => {
|
|
8411
|
+
if ((0, import_react29.isValidElement)(child)) {
|
|
8380
8412
|
const typedChild = child;
|
|
8381
8413
|
const newProps = {
|
|
8382
8414
|
store
|
|
@@ -8393,7 +8425,7 @@ var injectStore4 = (children, store, size, selectId) => {
|
|
|
8393
8425
|
selectId
|
|
8394
8426
|
);
|
|
8395
8427
|
}
|
|
8396
|
-
return (0,
|
|
8428
|
+
return (0, import_react29.cloneElement)(typedChild, newProps);
|
|
8397
8429
|
}
|
|
8398
8430
|
return child;
|
|
8399
8431
|
});
|
|
@@ -8410,18 +8442,18 @@ var Select = ({
|
|
|
8410
8442
|
errorMessage,
|
|
8411
8443
|
id
|
|
8412
8444
|
}) => {
|
|
8413
|
-
const storeRef = (0,
|
|
8445
|
+
const storeRef = (0, import_react29.useRef)(null);
|
|
8414
8446
|
storeRef.current ??= createSelectStore(onValueChange);
|
|
8415
8447
|
const store = storeRef.current;
|
|
8416
|
-
const selectRef = (0,
|
|
8448
|
+
const selectRef = (0, import_react29.useRef)(null);
|
|
8417
8449
|
const { open, setOpen, setValue, selectedLabel } = (0, import_zustand8.useStore)(store, (s) => s);
|
|
8418
|
-
const generatedId = (0,
|
|
8450
|
+
const generatedId = (0, import_react29.useId)();
|
|
8419
8451
|
const selectId = id ?? `select-${generatedId}`;
|
|
8420
8452
|
const findLabelForValue = (children2, targetValue) => {
|
|
8421
8453
|
let found = null;
|
|
8422
8454
|
const search = (nodes) => {
|
|
8423
|
-
|
|
8424
|
-
if (!(0,
|
|
8455
|
+
import_react29.Children.forEach(nodes, (child) => {
|
|
8456
|
+
if (!(0, import_react29.isValidElement)(child)) return;
|
|
8425
8457
|
const typedChild = child;
|
|
8426
8458
|
if (typedChild.type === SelectItem && typedChild.props.value === targetValue) {
|
|
8427
8459
|
if (typeof typedChild.props.children === "string")
|
|
@@ -8434,13 +8466,13 @@ var Select = ({
|
|
|
8434
8466
|
search(children2);
|
|
8435
8467
|
return found;
|
|
8436
8468
|
};
|
|
8437
|
-
(0,
|
|
8469
|
+
(0, import_react29.useEffect)(() => {
|
|
8438
8470
|
if (!selectedLabel && defaultValue) {
|
|
8439
8471
|
const label2 = findLabelForValue(children, defaultValue);
|
|
8440
8472
|
if (label2) store.setState({ selectedLabel: label2 });
|
|
8441
8473
|
}
|
|
8442
8474
|
}, [children, defaultValue, selectedLabel]);
|
|
8443
|
-
(0,
|
|
8475
|
+
(0, import_react29.useEffect)(() => {
|
|
8444
8476
|
const handleClickOutside = (event) => {
|
|
8445
8477
|
if (selectRef.current && !selectRef.current.contains(event.target)) {
|
|
8446
8478
|
setOpen(false);
|
|
@@ -8475,7 +8507,7 @@ var Select = ({
|
|
|
8475
8507
|
document.removeEventListener("keydown", handleArrowKeys);
|
|
8476
8508
|
};
|
|
8477
8509
|
}, [open]);
|
|
8478
|
-
(0,
|
|
8510
|
+
(0, import_react29.useEffect)(() => {
|
|
8479
8511
|
if (propValue) {
|
|
8480
8512
|
setValue(propValue);
|
|
8481
8513
|
const label2 = findLabelForValue(children, propValue);
|
|
@@ -8512,7 +8544,7 @@ var SelectValue = ({
|
|
|
8512
8544
|
const value = (0, import_zustand8.useStore)(store, (s) => s.value);
|
|
8513
8545
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "text-inherit flex gap-2 items-center", children: selectedLabel || placeholder || value });
|
|
8514
8546
|
};
|
|
8515
|
-
var SelectTrigger = (0,
|
|
8547
|
+
var SelectTrigger = (0, import_react29.forwardRef)(
|
|
8516
8548
|
({
|
|
8517
8549
|
className,
|
|
8518
8550
|
invalid = false,
|
|
@@ -8566,7 +8598,7 @@ var SelectTrigger = (0, import_react30.forwardRef)(
|
|
|
8566
8598
|
}
|
|
8567
8599
|
);
|
|
8568
8600
|
SelectTrigger.displayName = "SelectTrigger";
|
|
8569
|
-
var SelectContent = (0,
|
|
8601
|
+
var SelectContent = (0, import_react29.forwardRef)(
|
|
8570
8602
|
({
|
|
8571
8603
|
children,
|
|
8572
8604
|
className,
|
|
@@ -8596,7 +8628,7 @@ var SelectContent = (0, import_react30.forwardRef)(
|
|
|
8596
8628
|
}
|
|
8597
8629
|
);
|
|
8598
8630
|
SelectContent.displayName = "SelectContent";
|
|
8599
|
-
var SelectItem = (0,
|
|
8631
|
+
var SelectItem = (0, import_react29.forwardRef)(
|
|
8600
8632
|
({
|
|
8601
8633
|
className,
|
|
8602
8634
|
children,
|
|
@@ -8655,7 +8687,7 @@ var Select_default = Select;
|
|
|
8655
8687
|
|
|
8656
8688
|
// src/components/Menu/Menu.tsx
|
|
8657
8689
|
var import_zustand9 = require("zustand");
|
|
8658
|
-
var
|
|
8690
|
+
var import_react30 = require("react");
|
|
8659
8691
|
var import_phosphor_react22 = require("phosphor-react");
|
|
8660
8692
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
8661
8693
|
var createMenuStore = (onValueChange) => (0, import_zustand9.create)((set) => ({
|
|
@@ -8676,7 +8708,7 @@ var VARIANT_CLASSES5 = {
|
|
|
8676
8708
|
"menu-overflow": "",
|
|
8677
8709
|
breadcrumb: "bg-transparent shadow-none !px-0"
|
|
8678
8710
|
};
|
|
8679
|
-
var Menu = (0,
|
|
8711
|
+
var Menu = (0, import_react30.forwardRef)(
|
|
8680
8712
|
({
|
|
8681
8713
|
className,
|
|
8682
8714
|
children,
|
|
@@ -8686,11 +8718,11 @@ var Menu = (0, import_react31.forwardRef)(
|
|
|
8686
8718
|
onValueChange,
|
|
8687
8719
|
...props
|
|
8688
8720
|
}, ref) => {
|
|
8689
|
-
const storeRef = (0,
|
|
8721
|
+
const storeRef = (0, import_react30.useRef)(null);
|
|
8690
8722
|
storeRef.current ??= createMenuStore(onValueChange);
|
|
8691
8723
|
const store = storeRef.current;
|
|
8692
8724
|
const { setValue } = (0, import_zustand9.useStore)(store, (s) => s);
|
|
8693
|
-
(0,
|
|
8725
|
+
(0, import_react30.useEffect)(() => {
|
|
8694
8726
|
setValue(propValue ?? defaultValue);
|
|
8695
8727
|
}, [defaultValue, propValue, setValue]);
|
|
8696
8728
|
const baseClasses = variant === "menu-overflow" ? "w-fit py-2 flex flex-row items-center justify-center" : "w-full py-2 flex flex-row items-center justify-center";
|
|
@@ -8711,7 +8743,7 @@ var Menu = (0, import_react31.forwardRef)(
|
|
|
8711
8743
|
}
|
|
8712
8744
|
);
|
|
8713
8745
|
Menu.displayName = "Menu";
|
|
8714
|
-
var MenuContent = (0,
|
|
8746
|
+
var MenuContent = (0, import_react30.forwardRef)(
|
|
8715
8747
|
({ className, children, variant = "menu", ...props }, ref) => {
|
|
8716
8748
|
const baseClasses = "w-full flex flex-row items-center gap-2";
|
|
8717
8749
|
const variantClasses = variant === "menu2" || variant === "menu-overflow" ? "overflow-x-auto scroll-smooth" : "";
|
|
@@ -8733,7 +8765,7 @@ var MenuContent = (0, import_react31.forwardRef)(
|
|
|
8733
8765
|
}
|
|
8734
8766
|
);
|
|
8735
8767
|
MenuContent.displayName = "MenuContent";
|
|
8736
|
-
var MenuItem = (0,
|
|
8768
|
+
var MenuItem = (0, import_react30.forwardRef)(
|
|
8737
8769
|
({
|
|
8738
8770
|
className,
|
|
8739
8771
|
children,
|
|
@@ -8891,10 +8923,10 @@ var MenuOverflow = ({
|
|
|
8891
8923
|
onValueChange,
|
|
8892
8924
|
...props
|
|
8893
8925
|
}) => {
|
|
8894
|
-
const containerRef = (0,
|
|
8895
|
-
const [showLeftArrow, setShowLeftArrow] = (0,
|
|
8896
|
-
const [showRightArrow, setShowRightArrow] = (0,
|
|
8897
|
-
(0,
|
|
8926
|
+
const containerRef = (0, import_react30.useRef)(null);
|
|
8927
|
+
const [showLeftArrow, setShowLeftArrow] = (0, import_react30.useState)(false);
|
|
8928
|
+
const [showRightArrow, setShowRightArrow] = (0, import_react30.useState)(false);
|
|
8929
|
+
(0, import_react30.useEffect)(() => {
|
|
8898
8930
|
const checkScroll = () => internalCheckScroll(
|
|
8899
8931
|
containerRef.current,
|
|
8900
8932
|
setShowLeftArrow,
|
|
@@ -8954,11 +8986,11 @@ var MenuOverflow = ({
|
|
|
8954
8986
|
}
|
|
8955
8987
|
);
|
|
8956
8988
|
};
|
|
8957
|
-
var injectStore5 = (children, store) =>
|
|
8958
|
-
if (!(0,
|
|
8989
|
+
var injectStore5 = (children, store) => import_react30.Children.map(children, (child) => {
|
|
8990
|
+
if (!(0, import_react30.isValidElement)(child)) return child;
|
|
8959
8991
|
const typedChild = child;
|
|
8960
8992
|
const shouldInject = typedChild.type === MenuItem;
|
|
8961
|
-
return (0,
|
|
8993
|
+
return (0, import_react30.cloneElement)(typedChild, {
|
|
8962
8994
|
...shouldInject ? { store } : {},
|
|
8963
8995
|
...typedChild.props.children ? { children: injectStore5(typedChild.props.children, store) } : {}
|
|
8964
8996
|
});
|
|
@@ -8966,11 +8998,11 @@ var injectStore5 = (children, store) => import_react31.Children.map(children, (c
|
|
|
8966
8998
|
var Menu_default = Menu;
|
|
8967
8999
|
|
|
8968
9000
|
// src/components/Card/Card.tsx
|
|
8969
|
-
var
|
|
9001
|
+
var import_react32 = require("react");
|
|
8970
9002
|
var import_phosphor_react23 = require("phosphor-react");
|
|
8971
9003
|
|
|
8972
9004
|
// src/components/IconRender/IconRender.tsx
|
|
8973
|
-
var
|
|
9005
|
+
var import_react31 = require("react");
|
|
8974
9006
|
var PhosphorIcons = __toESM(require("phosphor-react"));
|
|
8975
9007
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
8976
9008
|
var IconRender = ({
|
|
@@ -8993,7 +9025,7 @@ var IconRender = ({
|
|
|
8993
9025
|
}
|
|
8994
9026
|
}
|
|
8995
9027
|
} else {
|
|
8996
|
-
return (0,
|
|
9028
|
+
return (0, import_react31.cloneElement)(iconName, {
|
|
8997
9029
|
size,
|
|
8998
9030
|
color: "currentColor"
|
|
8999
9031
|
});
|
|
@@ -9028,7 +9060,7 @@ var CARD_CURSOR_CLASSES = {
|
|
|
9028
9060
|
default: "",
|
|
9029
9061
|
pointer: "cursor-pointer"
|
|
9030
9062
|
};
|
|
9031
|
-
var CardBase = (0,
|
|
9063
|
+
var CardBase = (0, import_react32.forwardRef)(
|
|
9032
9064
|
({
|
|
9033
9065
|
children,
|
|
9034
9066
|
variant = "default",
|
|
@@ -9086,7 +9118,7 @@ var ACTION_HEADER_CLASSES = {
|
|
|
9086
9118
|
error: "text-error-300",
|
|
9087
9119
|
info: "text-info-300"
|
|
9088
9120
|
};
|
|
9089
|
-
var CardActivitiesResults = (0,
|
|
9121
|
+
var CardActivitiesResults = (0, import_react32.forwardRef)(
|
|
9090
9122
|
({
|
|
9091
9123
|
icon,
|
|
9092
9124
|
title,
|
|
@@ -9168,7 +9200,7 @@ var CardActivitiesResults = (0, import_react33.forwardRef)(
|
|
|
9168
9200
|
);
|
|
9169
9201
|
}
|
|
9170
9202
|
);
|
|
9171
|
-
var CardQuestions = (0,
|
|
9203
|
+
var CardQuestions = (0, import_react32.forwardRef)(
|
|
9172
9204
|
({
|
|
9173
9205
|
header,
|
|
9174
9206
|
state = "undone",
|
|
@@ -9216,7 +9248,7 @@ var CardQuestions = (0, import_react33.forwardRef)(
|
|
|
9216
9248
|
);
|
|
9217
9249
|
}
|
|
9218
9250
|
);
|
|
9219
|
-
var CardProgress = (0,
|
|
9251
|
+
var CardProgress = (0, import_react32.forwardRef)(
|
|
9220
9252
|
({
|
|
9221
9253
|
header,
|
|
9222
9254
|
subhead,
|
|
@@ -9314,7 +9346,7 @@ var CardProgress = (0, import_react33.forwardRef)(
|
|
|
9314
9346
|
);
|
|
9315
9347
|
}
|
|
9316
9348
|
);
|
|
9317
|
-
var CardTopic = (0,
|
|
9349
|
+
var CardTopic = (0, import_react32.forwardRef)(
|
|
9318
9350
|
({
|
|
9319
9351
|
header,
|
|
9320
9352
|
subHead,
|
|
@@ -9335,7 +9367,7 @@ var CardTopic = (0, import_react33.forwardRef)(
|
|
|
9335
9367
|
className: cn("justify-center gap-2 py-2 px-4", className),
|
|
9336
9368
|
...props,
|
|
9337
9369
|
children: [
|
|
9338
|
-
subHead && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "text-text-600 text-2xs flex flex-row gap-1", children: subHead.map((text, index) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
9370
|
+
subHead && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "text-text-600 text-2xs flex flex-row gap-1", children: subHead.map((text, index) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_react32.Fragment, { children: [
|
|
9339
9371
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { children: text }),
|
|
9340
9372
|
index < subHead.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("p", { children: "\u2022" })
|
|
9341
9373
|
] }, `${text} - ${index}`)) }),
|
|
@@ -9370,7 +9402,7 @@ var CardTopic = (0, import_react33.forwardRef)(
|
|
|
9370
9402
|
);
|
|
9371
9403
|
}
|
|
9372
9404
|
);
|
|
9373
|
-
var CardPerformance = (0,
|
|
9405
|
+
var CardPerformance = (0, import_react32.forwardRef)(
|
|
9374
9406
|
({
|
|
9375
9407
|
header,
|
|
9376
9408
|
progress,
|
|
@@ -9433,7 +9465,7 @@ var CardPerformance = (0, import_react33.forwardRef)(
|
|
|
9433
9465
|
);
|
|
9434
9466
|
}
|
|
9435
9467
|
);
|
|
9436
|
-
var CardResults = (0,
|
|
9468
|
+
var CardResults = (0, import_react32.forwardRef)(
|
|
9437
9469
|
({
|
|
9438
9470
|
header,
|
|
9439
9471
|
correct_answers,
|
|
@@ -9515,7 +9547,7 @@ var CardResults = (0, import_react33.forwardRef)(
|
|
|
9515
9547
|
);
|
|
9516
9548
|
}
|
|
9517
9549
|
);
|
|
9518
|
-
var CardStatus = (0,
|
|
9550
|
+
var CardStatus = (0, import_react32.forwardRef)(
|
|
9519
9551
|
({ header, className, status, label, ...props }, ref) => {
|
|
9520
9552
|
const getLabelBadge = (status2) => {
|
|
9521
9553
|
switch (status2) {
|
|
@@ -9585,7 +9617,7 @@ var CardStatus = (0, import_react33.forwardRef)(
|
|
|
9585
9617
|
);
|
|
9586
9618
|
}
|
|
9587
9619
|
);
|
|
9588
|
-
var CardSettings = (0,
|
|
9620
|
+
var CardSettings = (0, import_react32.forwardRef)(
|
|
9589
9621
|
({ header, className, icon, ...props }, ref) => {
|
|
9590
9622
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
9591
9623
|
CardBase,
|
|
@@ -9608,7 +9640,7 @@ var CardSettings = (0, import_react33.forwardRef)(
|
|
|
9608
9640
|
);
|
|
9609
9641
|
}
|
|
9610
9642
|
);
|
|
9611
|
-
var CardSupport = (0,
|
|
9643
|
+
var CardSupport = (0, import_react32.forwardRef)(
|
|
9612
9644
|
({ header, className, direction = "col", children, ...props }, ref) => {
|
|
9613
9645
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
9614
9646
|
CardBase,
|
|
@@ -9642,7 +9674,7 @@ var CardSupport = (0, import_react33.forwardRef)(
|
|
|
9642
9674
|
);
|
|
9643
9675
|
}
|
|
9644
9676
|
);
|
|
9645
|
-
var CardForum = (0,
|
|
9677
|
+
var CardForum = (0, import_react32.forwardRef)(
|
|
9646
9678
|
({
|
|
9647
9679
|
title,
|
|
9648
9680
|
content,
|
|
@@ -9709,7 +9741,7 @@ var CardForum = (0, import_react33.forwardRef)(
|
|
|
9709
9741
|
);
|
|
9710
9742
|
}
|
|
9711
9743
|
);
|
|
9712
|
-
var CardAudio = (0,
|
|
9744
|
+
var CardAudio = (0, import_react32.forwardRef)(
|
|
9713
9745
|
({
|
|
9714
9746
|
src,
|
|
9715
9747
|
title,
|
|
@@ -9723,16 +9755,16 @@ var CardAudio = (0, import_react33.forwardRef)(
|
|
|
9723
9755
|
className,
|
|
9724
9756
|
...props
|
|
9725
9757
|
}, ref) => {
|
|
9726
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
9727
|
-
const [currentTime, setCurrentTime] = (0,
|
|
9728
|
-
const [duration, setDuration] = (0,
|
|
9729
|
-
const [volume, setVolume] = (0,
|
|
9730
|
-
const [showVolumeControl, setShowVolumeControl] = (0,
|
|
9731
|
-
const [showSpeedMenu, setShowSpeedMenu] = (0,
|
|
9732
|
-
const [playbackRate, setPlaybackRate] = (0,
|
|
9733
|
-
const audioRef = (0,
|
|
9734
|
-
const volumeControlRef = (0,
|
|
9735
|
-
const speedMenuRef = (0,
|
|
9758
|
+
const [isPlaying, setIsPlaying] = (0, import_react32.useState)(false);
|
|
9759
|
+
const [currentTime, setCurrentTime] = (0, import_react32.useState)(0);
|
|
9760
|
+
const [duration, setDuration] = (0, import_react32.useState)(0);
|
|
9761
|
+
const [volume, setVolume] = (0, import_react32.useState)(1);
|
|
9762
|
+
const [showVolumeControl, setShowVolumeControl] = (0, import_react32.useState)(false);
|
|
9763
|
+
const [showSpeedMenu, setShowSpeedMenu] = (0, import_react32.useState)(false);
|
|
9764
|
+
const [playbackRate, setPlaybackRate] = (0, import_react32.useState)(1);
|
|
9765
|
+
const audioRef = (0, import_react32.useRef)(null);
|
|
9766
|
+
const volumeControlRef = (0, import_react32.useRef)(null);
|
|
9767
|
+
const speedMenuRef = (0, import_react32.useRef)(null);
|
|
9736
9768
|
const formatTime2 = (time) => {
|
|
9737
9769
|
const minutes = Math.floor(time / 60);
|
|
9738
9770
|
const seconds = Math.floor(time % 60);
|
|
@@ -9806,7 +9838,7 @@ var CardAudio = (0, import_react33.forwardRef)(
|
|
|
9806
9838
|
}
|
|
9807
9839
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_phosphor_react23.SpeakerHigh, { size: 24 });
|
|
9808
9840
|
};
|
|
9809
|
-
(0,
|
|
9841
|
+
(0, import_react32.useEffect)(() => {
|
|
9810
9842
|
const handleClickOutside = (event) => {
|
|
9811
9843
|
if (volumeControlRef.current && !volumeControlRef.current.contains(event.target)) {
|
|
9812
9844
|
setShowVolumeControl(false);
|
|
@@ -10010,7 +10042,7 @@ var SIMULADO_BACKGROUND_CLASSES = {
|
|
|
10010
10042
|
simuladao: "bg-exam-3",
|
|
10011
10043
|
vestibular: "bg-exam-4"
|
|
10012
10044
|
};
|
|
10013
|
-
var CardSimulado = (0,
|
|
10045
|
+
var CardSimulado = (0, import_react32.forwardRef)(
|
|
10014
10046
|
({ title, duration, info, backgroundColor, className, ...props }, ref) => {
|
|
10015
10047
|
const backgroundClass = SIMULADO_BACKGROUND_CLASSES[backgroundColor];
|
|
10016
10048
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
@@ -10050,7 +10082,7 @@ var CardSimulado = (0, import_react33.forwardRef)(
|
|
|
10050
10082
|
);
|
|
10051
10083
|
}
|
|
10052
10084
|
);
|
|
10053
|
-
var CardTest = (0,
|
|
10085
|
+
var CardTest = (0, import_react32.forwardRef)(
|
|
10054
10086
|
({
|
|
10055
10087
|
title,
|
|
10056
10088
|
duration,
|
|
@@ -10193,7 +10225,7 @@ var SIMULATION_TYPE_STYLES = {
|
|
|
10193
10225
|
text: "Vestibular"
|
|
10194
10226
|
}
|
|
10195
10227
|
};
|
|
10196
|
-
var CardSimulationHistory = (0,
|
|
10228
|
+
var CardSimulationHistory = (0, import_react32.forwardRef)(({ data, onSimulationClick, className, ...props }, ref) => {
|
|
10197
10229
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
10198
10230
|
"div",
|
|
10199
10231
|
{
|
|
@@ -10530,12 +10562,12 @@ var NotFound = ({
|
|
|
10530
10562
|
var NotFound_default = NotFound;
|
|
10531
10563
|
|
|
10532
10564
|
// src/components/VideoPlayer/VideoPlayer.tsx
|
|
10533
|
-
var
|
|
10565
|
+
var import_react34 = require("react");
|
|
10534
10566
|
var import_react_dom = require("react-dom");
|
|
10535
10567
|
var import_phosphor_react26 = require("phosphor-react");
|
|
10536
10568
|
|
|
10537
10569
|
// src/components/DownloadButton/DownloadButton.tsx
|
|
10538
|
-
var
|
|
10570
|
+
var import_react33 = require("react");
|
|
10539
10571
|
var import_phosphor_react25 = require("phosphor-react");
|
|
10540
10572
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
10541
10573
|
var getMimeType = (url) => {
|
|
@@ -10612,13 +10644,13 @@ var DownloadButton = ({
|
|
|
10612
10644
|
lessonTitle = "aula",
|
|
10613
10645
|
disabled = false
|
|
10614
10646
|
}) => {
|
|
10615
|
-
const [isDownloading, setIsDownloading] = (0,
|
|
10616
|
-
const isValidUrl = (0,
|
|
10647
|
+
const [isDownloading, setIsDownloading] = (0, import_react33.useState)(false);
|
|
10648
|
+
const isValidUrl = (0, import_react33.useCallback)((url) => {
|
|
10617
10649
|
return Boolean(
|
|
10618
10650
|
url && url.trim() !== "" && url !== "undefined" && url !== "null"
|
|
10619
10651
|
);
|
|
10620
10652
|
}, []);
|
|
10621
|
-
const getAvailableContent = (0,
|
|
10653
|
+
const getAvailableContent = (0, import_react33.useCallback)(() => {
|
|
10622
10654
|
const downloads = [];
|
|
10623
10655
|
if (isValidUrl(content.urlDoc)) {
|
|
10624
10656
|
downloads.push({
|
|
@@ -10653,7 +10685,7 @@ var DownloadButton = ({
|
|
|
10653
10685
|
}
|
|
10654
10686
|
return downloads;
|
|
10655
10687
|
}, [content, isValidUrl]);
|
|
10656
|
-
const handleDownload = (0,
|
|
10688
|
+
const handleDownload = (0, import_react33.useCallback)(async () => {
|
|
10657
10689
|
if (disabled || isDownloading) return;
|
|
10658
10690
|
const availableContent = getAvailableContent();
|
|
10659
10691
|
if (availableContent.length === 0) {
|
|
@@ -10791,9 +10823,9 @@ var SpeedMenu = ({
|
|
|
10791
10823
|
iconSize = 24,
|
|
10792
10824
|
isTinyMobile = false
|
|
10793
10825
|
}) => {
|
|
10794
|
-
const buttonRef = (0,
|
|
10795
|
-
const speedMenuContainerRef = (0,
|
|
10796
|
-
const speedMenuRef = (0,
|
|
10826
|
+
const buttonRef = (0, import_react34.useRef)(null);
|
|
10827
|
+
const speedMenuContainerRef = (0, import_react34.useRef)(null);
|
|
10828
|
+
const speedMenuRef = (0, import_react34.useRef)(null);
|
|
10797
10829
|
const getMenuPosition = () => {
|
|
10798
10830
|
if (!buttonRef.current) return { top: 0, left: 0 };
|
|
10799
10831
|
const rect = buttonRef.current.getBoundingClientRect();
|
|
@@ -10807,7 +10839,7 @@ var SpeedMenu = ({
|
|
|
10807
10839
|
};
|
|
10808
10840
|
};
|
|
10809
10841
|
const position = getMenuPosition();
|
|
10810
|
-
(0,
|
|
10842
|
+
(0, import_react34.useEffect)(() => {
|
|
10811
10843
|
const handleClickOutside = (event) => {
|
|
10812
10844
|
const target = event.target;
|
|
10813
10845
|
const isOutsideContainer = speedMenuContainerRef.current && !speedMenuContainerRef.current.contains(target);
|
|
@@ -10886,28 +10918,28 @@ var VideoPlayer = ({
|
|
|
10886
10918
|
onDownloadComplete,
|
|
10887
10919
|
onDownloadError
|
|
10888
10920
|
}) => {
|
|
10889
|
-
const videoRef = (0,
|
|
10921
|
+
const videoRef = (0, import_react34.useRef)(null);
|
|
10890
10922
|
const { isUltraSmallMobile, isTinyMobile } = useMobile();
|
|
10891
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
10892
|
-
const [currentTime, setCurrentTime] = (0,
|
|
10893
|
-
const [duration, setDuration] = (0,
|
|
10894
|
-
const [isMuted, setIsMuted] = (0,
|
|
10895
|
-
const [volume, setVolume] = (0,
|
|
10896
|
-
const [isFullscreen, setIsFullscreen] = (0,
|
|
10897
|
-
const [showControls, setShowControls] = (0,
|
|
10898
|
-
const [hasCompleted, setHasCompleted] = (0,
|
|
10899
|
-
const [showCaptions, setShowCaptions] = (0,
|
|
10900
|
-
const [subtitlesValidation, setSubtitlesValidation] = (0,
|
|
10901
|
-
(0,
|
|
10923
|
+
const [isPlaying, setIsPlaying] = (0, import_react34.useState)(false);
|
|
10924
|
+
const [currentTime, setCurrentTime] = (0, import_react34.useState)(0);
|
|
10925
|
+
const [duration, setDuration] = (0, import_react34.useState)(0);
|
|
10926
|
+
const [isMuted, setIsMuted] = (0, import_react34.useState)(false);
|
|
10927
|
+
const [volume, setVolume] = (0, import_react34.useState)(1);
|
|
10928
|
+
const [isFullscreen, setIsFullscreen] = (0, import_react34.useState)(false);
|
|
10929
|
+
const [showControls, setShowControls] = (0, import_react34.useState)(true);
|
|
10930
|
+
const [hasCompleted, setHasCompleted] = (0, import_react34.useState)(false);
|
|
10931
|
+
const [showCaptions, setShowCaptions] = (0, import_react34.useState)(false);
|
|
10932
|
+
const [subtitlesValidation, setSubtitlesValidation] = (0, import_react34.useState)("idle");
|
|
10933
|
+
(0, import_react34.useEffect)(() => {
|
|
10902
10934
|
setHasCompleted(false);
|
|
10903
10935
|
}, [src]);
|
|
10904
|
-
const [playbackRate, setPlaybackRate] = (0,
|
|
10905
|
-
const [showSpeedMenu, setShowSpeedMenu] = (0,
|
|
10906
|
-
const lastSaveTimeRef = (0,
|
|
10907
|
-
const trackRef = (0,
|
|
10908
|
-
const controlsTimeoutRef = (0,
|
|
10909
|
-
const lastMousePositionRef = (0,
|
|
10910
|
-
const isUserInteracting = (0,
|
|
10936
|
+
const [playbackRate, setPlaybackRate] = (0, import_react34.useState)(1);
|
|
10937
|
+
const [showSpeedMenu, setShowSpeedMenu] = (0, import_react34.useState)(false);
|
|
10938
|
+
const lastSaveTimeRef = (0, import_react34.useRef)(0);
|
|
10939
|
+
const trackRef = (0, import_react34.useRef)(null);
|
|
10940
|
+
const controlsTimeoutRef = (0, import_react34.useRef)(null);
|
|
10941
|
+
const lastMousePositionRef = (0, import_react34.useRef)({ x: 0, y: 0 });
|
|
10942
|
+
const isUserInteracting = (0, import_react34.useCallback)(() => {
|
|
10911
10943
|
if (showSpeedMenu) {
|
|
10912
10944
|
return true;
|
|
10913
10945
|
}
|
|
@@ -10924,13 +10956,13 @@ var VideoPlayer = ({
|
|
|
10924
10956
|
}
|
|
10925
10957
|
return false;
|
|
10926
10958
|
}, [showSpeedMenu]);
|
|
10927
|
-
const clearControlsTimeout = (0,
|
|
10959
|
+
const clearControlsTimeout = (0, import_react34.useCallback)(() => {
|
|
10928
10960
|
if (controlsTimeoutRef.current) {
|
|
10929
10961
|
clearTimeout(controlsTimeoutRef.current);
|
|
10930
10962
|
controlsTimeoutRef.current = null;
|
|
10931
10963
|
}
|
|
10932
10964
|
}, []);
|
|
10933
|
-
const showControlsWithTimer = (0,
|
|
10965
|
+
const showControlsWithTimer = (0, import_react34.useCallback)(() => {
|
|
10934
10966
|
setShowControls(true);
|
|
10935
10967
|
clearControlsTimeout();
|
|
10936
10968
|
if (isFullscreen) {
|
|
@@ -10945,7 +10977,7 @@ var VideoPlayer = ({
|
|
|
10945
10977
|
}, CONTROLS_HIDE_TIMEOUT);
|
|
10946
10978
|
}
|
|
10947
10979
|
}, [isFullscreen, isPlaying, clearControlsTimeout]);
|
|
10948
|
-
const handleMouseMove = (0,
|
|
10980
|
+
const handleMouseMove = (0, import_react34.useCallback)(
|
|
10949
10981
|
(event) => {
|
|
10950
10982
|
const currentX = event.clientX;
|
|
10951
10983
|
const currentY = event.clientY;
|
|
@@ -10958,10 +10990,10 @@ var VideoPlayer = ({
|
|
|
10958
10990
|
},
|
|
10959
10991
|
[showControlsWithTimer]
|
|
10960
10992
|
);
|
|
10961
|
-
const handleMouseEnter = (0,
|
|
10993
|
+
const handleMouseEnter = (0, import_react34.useCallback)(() => {
|
|
10962
10994
|
showControlsWithTimer();
|
|
10963
10995
|
}, [showControlsWithTimer]);
|
|
10964
|
-
const handleMouseLeave = (0,
|
|
10996
|
+
const handleMouseLeave = (0, import_react34.useCallback)(() => {
|
|
10965
10997
|
const userInteracting = isUserInteracting();
|
|
10966
10998
|
clearControlsTimeout();
|
|
10967
10999
|
if (!isFullscreen && !userInteracting) {
|
|
@@ -10970,13 +11002,13 @@ var VideoPlayer = ({
|
|
|
10970
11002
|
}, LEAVE_HIDE_TIMEOUT);
|
|
10971
11003
|
}
|
|
10972
11004
|
}, [isFullscreen, clearControlsTimeout, isUserInteracting]);
|
|
10973
|
-
(0,
|
|
11005
|
+
(0, import_react34.useEffect)(() => {
|
|
10974
11006
|
if (videoRef.current) {
|
|
10975
11007
|
videoRef.current.volume = volume;
|
|
10976
11008
|
videoRef.current.muted = isMuted;
|
|
10977
11009
|
}
|
|
10978
11010
|
}, [volume, isMuted]);
|
|
10979
|
-
(0,
|
|
11011
|
+
(0, import_react34.useEffect)(() => {
|
|
10980
11012
|
const video = videoRef.current;
|
|
10981
11013
|
if (!video) return;
|
|
10982
11014
|
const onPlay = () => setIsPlaying(true);
|
|
@@ -10991,13 +11023,13 @@ var VideoPlayer = ({
|
|
|
10991
11023
|
video.removeEventListener("ended", onEnded);
|
|
10992
11024
|
};
|
|
10993
11025
|
}, []);
|
|
10994
|
-
(0,
|
|
11026
|
+
(0, import_react34.useEffect)(() => {
|
|
10995
11027
|
const video = videoRef.current;
|
|
10996
11028
|
if (!video) return;
|
|
10997
11029
|
video.setAttribute("playsinline", "");
|
|
10998
11030
|
video.setAttribute("webkit-playsinline", "");
|
|
10999
11031
|
}, []);
|
|
11000
|
-
(0,
|
|
11032
|
+
(0, import_react34.useEffect)(() => {
|
|
11001
11033
|
if (isPlaying) {
|
|
11002
11034
|
showControlsWithTimer();
|
|
11003
11035
|
} else {
|
|
@@ -11009,7 +11041,7 @@ var VideoPlayer = ({
|
|
|
11009
11041
|
}
|
|
11010
11042
|
}
|
|
11011
11043
|
}, [isPlaying, isFullscreen, showControlsWithTimer, clearControlsTimeout]);
|
|
11012
|
-
(0,
|
|
11044
|
+
(0, import_react34.useEffect)(() => {
|
|
11013
11045
|
const video = videoRef.current;
|
|
11014
11046
|
if (!video) return;
|
|
11015
11047
|
const handleFullscreenChange = () => {
|
|
@@ -11044,7 +11076,7 @@ var VideoPlayer = ({
|
|
|
11044
11076
|
);
|
|
11045
11077
|
};
|
|
11046
11078
|
}, [showControlsWithTimer]);
|
|
11047
|
-
(0,
|
|
11079
|
+
(0, import_react34.useEffect)(() => {
|
|
11048
11080
|
const init = () => {
|
|
11049
11081
|
if (!isFullscreen) {
|
|
11050
11082
|
showControlsWithTimer();
|
|
@@ -11066,7 +11098,7 @@ var VideoPlayer = ({
|
|
|
11066
11098
|
};
|
|
11067
11099
|
}
|
|
11068
11100
|
}, []);
|
|
11069
|
-
const getInitialTime = (0,
|
|
11101
|
+
const getInitialTime = (0, import_react34.useCallback)(() => {
|
|
11070
11102
|
if (!autoSave || !storageKey) {
|
|
11071
11103
|
return Number.isFinite(initialTime) && initialTime >= 0 ? initialTime : void 0;
|
|
11072
11104
|
}
|
|
@@ -11079,14 +11111,14 @@ var VideoPlayer = ({
|
|
|
11079
11111
|
if (hasValidSaved) return saved;
|
|
11080
11112
|
return void 0;
|
|
11081
11113
|
}, [autoSave, storageKey, src, initialTime]);
|
|
11082
|
-
(0,
|
|
11114
|
+
(0, import_react34.useEffect)(() => {
|
|
11083
11115
|
const start = getInitialTime();
|
|
11084
11116
|
if (start !== void 0 && videoRef.current) {
|
|
11085
11117
|
videoRef.current.currentTime = start;
|
|
11086
11118
|
setCurrentTime(start);
|
|
11087
11119
|
}
|
|
11088
11120
|
}, [getInitialTime]);
|
|
11089
|
-
const saveProgress = (0,
|
|
11121
|
+
const saveProgress = (0, import_react34.useCallback)(
|
|
11090
11122
|
(time) => {
|
|
11091
11123
|
if (!autoSave || !storageKey) return;
|
|
11092
11124
|
const now = Date.now();
|
|
@@ -11097,7 +11129,7 @@ var VideoPlayer = ({
|
|
|
11097
11129
|
},
|
|
11098
11130
|
[autoSave, storageKey, src]
|
|
11099
11131
|
);
|
|
11100
|
-
const togglePlayPause = (0,
|
|
11132
|
+
const togglePlayPause = (0, import_react34.useCallback)(async () => {
|
|
11101
11133
|
const video = videoRef.current;
|
|
11102
11134
|
if (!video) return;
|
|
11103
11135
|
if (!video.paused) {
|
|
@@ -11109,7 +11141,7 @@ var VideoPlayer = ({
|
|
|
11109
11141
|
} catch {
|
|
11110
11142
|
}
|
|
11111
11143
|
}, []);
|
|
11112
|
-
const handleVolumeChange = (0,
|
|
11144
|
+
const handleVolumeChange = (0, import_react34.useCallback)(
|
|
11113
11145
|
(newVolume) => {
|
|
11114
11146
|
const video = videoRef.current;
|
|
11115
11147
|
if (!video) return;
|
|
@@ -11128,7 +11160,7 @@ var VideoPlayer = ({
|
|
|
11128
11160
|
},
|
|
11129
11161
|
[isMuted]
|
|
11130
11162
|
);
|
|
11131
|
-
const toggleMute = (0,
|
|
11163
|
+
const toggleMute = (0, import_react34.useCallback)(() => {
|
|
11132
11164
|
const video = videoRef.current;
|
|
11133
11165
|
if (!video) return;
|
|
11134
11166
|
if (isMuted) {
|
|
@@ -11142,20 +11174,20 @@ var VideoPlayer = ({
|
|
|
11142
11174
|
setIsMuted(true);
|
|
11143
11175
|
}
|
|
11144
11176
|
}, [isMuted, volume]);
|
|
11145
|
-
const handleSeek = (0,
|
|
11177
|
+
const handleSeek = (0, import_react34.useCallback)((newTime) => {
|
|
11146
11178
|
const video = videoRef.current;
|
|
11147
11179
|
if (video) {
|
|
11148
11180
|
video.currentTime = newTime;
|
|
11149
11181
|
}
|
|
11150
11182
|
}, []);
|
|
11151
|
-
const isSafariIOS = (0,
|
|
11183
|
+
const isSafariIOS = (0, import_react34.useCallback)(() => {
|
|
11152
11184
|
const ua = navigator.userAgent;
|
|
11153
11185
|
const isIOS = /iPad|iPhone|iPod/.test(ua);
|
|
11154
11186
|
const isWebKit = /WebKit/.test(ua);
|
|
11155
11187
|
const isNotChrome = !/CriOS|Chrome/.test(ua);
|
|
11156
11188
|
return isIOS && isWebKit && isNotChrome;
|
|
11157
11189
|
}, []);
|
|
11158
|
-
const toggleFullscreen = (0,
|
|
11190
|
+
const toggleFullscreen = (0, import_react34.useCallback)(() => {
|
|
11159
11191
|
const video = videoRef.current;
|
|
11160
11192
|
const container = video?.parentElement;
|
|
11161
11193
|
if (!video || !container) return;
|
|
@@ -11172,24 +11204,24 @@ var VideoPlayer = ({
|
|
|
11172
11204
|
document.exitFullscreen();
|
|
11173
11205
|
}
|
|
11174
11206
|
}, [isFullscreen, isSafariIOS]);
|
|
11175
|
-
const handleSpeedChange = (0,
|
|
11207
|
+
const handleSpeedChange = (0, import_react34.useCallback)((speed) => {
|
|
11176
11208
|
if (videoRef.current) {
|
|
11177
11209
|
videoRef.current.playbackRate = speed;
|
|
11178
11210
|
setPlaybackRate(speed);
|
|
11179
11211
|
setShowSpeedMenu(false);
|
|
11180
11212
|
}
|
|
11181
11213
|
}, []);
|
|
11182
|
-
const toggleSpeedMenu = (0,
|
|
11214
|
+
const toggleSpeedMenu = (0, import_react34.useCallback)(() => {
|
|
11183
11215
|
setShowSpeedMenu(!showSpeedMenu);
|
|
11184
11216
|
}, [showSpeedMenu]);
|
|
11185
|
-
const toggleCaptions = (0,
|
|
11217
|
+
const toggleCaptions = (0, import_react34.useCallback)(() => {
|
|
11186
11218
|
if (!trackRef.current?.track || !subtitles || subtitlesValidation !== "valid")
|
|
11187
11219
|
return;
|
|
11188
11220
|
const newShowCaptions = !showCaptions;
|
|
11189
11221
|
setShowCaptions(newShowCaptions);
|
|
11190
11222
|
trackRef.current.track.mode = newShowCaptions ? "showing" : "hidden";
|
|
11191
11223
|
}, [showCaptions, subtitles, subtitlesValidation]);
|
|
11192
|
-
const checkVideoCompletion = (0,
|
|
11224
|
+
const checkVideoCompletion = (0, import_react34.useCallback)(
|
|
11193
11225
|
(progressPercent) => {
|
|
11194
11226
|
if (progressPercent >= 95 && !hasCompleted) {
|
|
11195
11227
|
setHasCompleted(true);
|
|
@@ -11198,7 +11230,7 @@ var VideoPlayer = ({
|
|
|
11198
11230
|
},
|
|
11199
11231
|
[hasCompleted, onVideoComplete]
|
|
11200
11232
|
);
|
|
11201
|
-
const handleTimeUpdate = (0,
|
|
11233
|
+
const handleTimeUpdate = (0, import_react34.useCallback)(() => {
|
|
11202
11234
|
const video = videoRef.current;
|
|
11203
11235
|
if (!video) return;
|
|
11204
11236
|
const current = video.currentTime;
|
|
@@ -11211,12 +11243,12 @@ var VideoPlayer = ({
|
|
|
11211
11243
|
checkVideoCompletion(progressPercent);
|
|
11212
11244
|
}
|
|
11213
11245
|
}, [duration, saveProgress, onTimeUpdate, onProgress, checkVideoCompletion]);
|
|
11214
|
-
const handleLoadedMetadata = (0,
|
|
11246
|
+
const handleLoadedMetadata = (0, import_react34.useCallback)(() => {
|
|
11215
11247
|
if (videoRef.current) {
|
|
11216
11248
|
setDuration(videoRef.current.duration);
|
|
11217
11249
|
}
|
|
11218
11250
|
}, []);
|
|
11219
|
-
(0,
|
|
11251
|
+
(0, import_react34.useEffect)(() => {
|
|
11220
11252
|
const controller = new AbortController();
|
|
11221
11253
|
const validateSubtitles = async () => {
|
|
11222
11254
|
if (!subtitles) {
|
|
@@ -11263,12 +11295,12 @@ var VideoPlayer = ({
|
|
|
11263
11295
|
controller.abort();
|
|
11264
11296
|
};
|
|
11265
11297
|
}, [subtitles]);
|
|
11266
|
-
(0,
|
|
11298
|
+
(0, import_react34.useEffect)(() => {
|
|
11267
11299
|
if (trackRef.current?.track) {
|
|
11268
11300
|
trackRef.current.track.mode = showCaptions && subtitles && subtitlesValidation === "valid" ? "showing" : "hidden";
|
|
11269
11301
|
}
|
|
11270
11302
|
}, [subtitles, showCaptions, subtitlesValidation]);
|
|
11271
|
-
(0,
|
|
11303
|
+
(0, import_react34.useEffect)(() => {
|
|
11272
11304
|
const handleVisibilityChange = () => {
|
|
11273
11305
|
if (document.hidden && isPlaying && videoRef.current) {
|
|
11274
11306
|
videoRef.current.pause();
|
|
@@ -11290,54 +11322,54 @@ var VideoPlayer = ({
|
|
|
11290
11322
|
};
|
|
11291
11323
|
}, [isPlaying, clearControlsTimeout]);
|
|
11292
11324
|
const progressPercentage = duration > 0 ? currentTime / duration * 100 : 0;
|
|
11293
|
-
const getIconSize2 = (0,
|
|
11325
|
+
const getIconSize2 = (0, import_react34.useCallback)(() => {
|
|
11294
11326
|
if (isTinyMobile) return 18;
|
|
11295
11327
|
if (isUltraSmallMobile) return 20;
|
|
11296
11328
|
return 24;
|
|
11297
11329
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
11298
|
-
const getControlsPadding = (0,
|
|
11330
|
+
const getControlsPadding = (0, import_react34.useCallback)(() => {
|
|
11299
11331
|
if (isTinyMobile) return "px-2 pb-2 pt-1";
|
|
11300
11332
|
if (isUltraSmallMobile) return "px-3 pb-3 pt-1";
|
|
11301
11333
|
return "px-4 pb-4";
|
|
11302
11334
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
11303
|
-
const getControlsGap = (0,
|
|
11335
|
+
const getControlsGap = (0, import_react34.useCallback)(() => {
|
|
11304
11336
|
if (isTinyMobile) return "gap-1";
|
|
11305
11337
|
if (isUltraSmallMobile) return "gap-2";
|
|
11306
11338
|
return "gap-4";
|
|
11307
11339
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
11308
|
-
const getProgressBarPadding = (0,
|
|
11340
|
+
const getProgressBarPadding = (0, import_react34.useCallback)(() => {
|
|
11309
11341
|
if (isTinyMobile) return "px-2 pb-1";
|
|
11310
11342
|
if (isUltraSmallMobile) return "px-3 pb-1";
|
|
11311
11343
|
return "px-4 pb-2";
|
|
11312
11344
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
11313
|
-
const getCenterPlayButtonPosition = (0,
|
|
11345
|
+
const getCenterPlayButtonPosition = (0, import_react34.useCallback)(() => {
|
|
11314
11346
|
if (isTinyMobile) return "items-center justify-center -translate-y-12";
|
|
11315
11347
|
if (isUltraSmallMobile) return "items-center justify-center -translate-y-8";
|
|
11316
11348
|
return "items-center justify-center";
|
|
11317
11349
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
11318
|
-
const getTopControlsOpacity = (0,
|
|
11350
|
+
const getTopControlsOpacity = (0, import_react34.useCallback)(() => {
|
|
11319
11351
|
return showControls ? "opacity-100" : "opacity-0";
|
|
11320
11352
|
}, [showControls]);
|
|
11321
|
-
const getBottomControlsOpacity = (0,
|
|
11353
|
+
const getBottomControlsOpacity = (0, import_react34.useCallback)(() => {
|
|
11322
11354
|
return showControls ? "opacity-100" : "opacity-0";
|
|
11323
11355
|
}, [showControls]);
|
|
11324
|
-
const seekBackward = (0,
|
|
11356
|
+
const seekBackward = (0, import_react34.useCallback)(() => {
|
|
11325
11357
|
if (videoRef.current) {
|
|
11326
11358
|
videoRef.current.currentTime -= 10;
|
|
11327
11359
|
}
|
|
11328
11360
|
}, []);
|
|
11329
|
-
const seekForward = (0,
|
|
11361
|
+
const seekForward = (0, import_react34.useCallback)(() => {
|
|
11330
11362
|
if (videoRef.current) {
|
|
11331
11363
|
videoRef.current.currentTime += 10;
|
|
11332
11364
|
}
|
|
11333
11365
|
}, []);
|
|
11334
|
-
const increaseVolume = (0,
|
|
11366
|
+
const increaseVolume = (0, import_react34.useCallback)(() => {
|
|
11335
11367
|
handleVolumeChange(Math.min(100, volume * 100 + 10));
|
|
11336
11368
|
}, [handleVolumeChange, volume]);
|
|
11337
|
-
const decreaseVolume = (0,
|
|
11369
|
+
const decreaseVolume = (0, import_react34.useCallback)(() => {
|
|
11338
11370
|
handleVolumeChange(Math.max(0, volume * 100 - 10));
|
|
11339
11371
|
}, [handleVolumeChange, volume]);
|
|
11340
|
-
const handleVideoKeyDown = (0,
|
|
11372
|
+
const handleVideoKeyDown = (0, import_react34.useCallback)(
|
|
11341
11373
|
(e) => {
|
|
11342
11374
|
if (!e.key) return;
|
|
11343
11375
|
e.stopPropagation();
|
|
@@ -11580,7 +11612,7 @@ var VideoPlayer = ({
|
|
|
11580
11612
|
var VideoPlayer_default = VideoPlayer;
|
|
11581
11613
|
|
|
11582
11614
|
// src/components/Whiteboard/Whiteboard.tsx
|
|
11583
|
-
var
|
|
11615
|
+
var import_react35 = require("react");
|
|
11584
11616
|
var import_phosphor_react27 = require("phosphor-react");
|
|
11585
11617
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
11586
11618
|
var IMAGE_WIDTH = 225;
|
|
@@ -11593,8 +11625,8 @@ var Whiteboard = ({
|
|
|
11593
11625
|
imagesPerRow = 2,
|
|
11594
11626
|
...rest
|
|
11595
11627
|
}) => {
|
|
11596
|
-
const [imageErrors, setImageErrors] = (0,
|
|
11597
|
-
const handleDownload = (0,
|
|
11628
|
+
const [imageErrors, setImageErrors] = (0, import_react35.useState)(/* @__PURE__ */ new Set());
|
|
11629
|
+
const handleDownload = (0, import_react35.useCallback)(
|
|
11598
11630
|
(image) => {
|
|
11599
11631
|
if (onDownload) {
|
|
11600
11632
|
onDownload(image);
|
|
@@ -11611,7 +11643,7 @@ var Whiteboard = ({
|
|
|
11611
11643
|
},
|
|
11612
11644
|
[onDownload]
|
|
11613
11645
|
);
|
|
11614
|
-
const handleImageError = (0,
|
|
11646
|
+
const handleImageError = (0, import_react35.useCallback)((imageId) => {
|
|
11615
11647
|
setImageErrors((prev) => new Set(prev).add(imageId));
|
|
11616
11648
|
}, []);
|
|
11617
11649
|
const gridColsClass = images?.length === 1 ? "grid-cols-1" : {
|
|
@@ -11698,10 +11730,10 @@ var Whiteboard = ({
|
|
|
11698
11730
|
var Whiteboard_default = Whiteboard;
|
|
11699
11731
|
|
|
11700
11732
|
// src/components/Auth/Auth.tsx
|
|
11701
|
-
var
|
|
11733
|
+
var import_react36 = require("react");
|
|
11702
11734
|
var import_react_router_dom = require("react-router-dom");
|
|
11703
11735
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
11704
|
-
var AuthContext = (0,
|
|
11736
|
+
var AuthContext = (0, import_react36.createContext)(void 0);
|
|
11705
11737
|
var AuthProvider = ({
|
|
11706
11738
|
children,
|
|
11707
11739
|
checkAuthFn,
|
|
@@ -11711,12 +11743,12 @@ var AuthProvider = ({
|
|
|
11711
11743
|
getSessionFn,
|
|
11712
11744
|
getTokensFn
|
|
11713
11745
|
}) => {
|
|
11714
|
-
const [authState, setAuthState] = (0,
|
|
11746
|
+
const [authState, setAuthState] = (0, import_react36.useState)({
|
|
11715
11747
|
isAuthenticated: false,
|
|
11716
11748
|
isLoading: true,
|
|
11717
11749
|
...initialAuthState
|
|
11718
11750
|
});
|
|
11719
|
-
const checkAuth = (0,
|
|
11751
|
+
const checkAuth = (0, import_react36.useCallback)(async () => {
|
|
11720
11752
|
try {
|
|
11721
11753
|
setAuthState((prev) => ({ ...prev, isLoading: true }));
|
|
11722
11754
|
if (!checkAuthFn) {
|
|
@@ -11747,7 +11779,7 @@ var AuthProvider = ({
|
|
|
11747
11779
|
return false;
|
|
11748
11780
|
}
|
|
11749
11781
|
}, [checkAuthFn, getUserFn, getSessionFn, getTokensFn]);
|
|
11750
|
-
const signOut = (0,
|
|
11782
|
+
const signOut = (0, import_react36.useCallback)(() => {
|
|
11751
11783
|
if (signOutFn) {
|
|
11752
11784
|
signOutFn();
|
|
11753
11785
|
}
|
|
@@ -11759,10 +11791,10 @@ var AuthProvider = ({
|
|
|
11759
11791
|
tokens: void 0
|
|
11760
11792
|
}));
|
|
11761
11793
|
}, [signOutFn]);
|
|
11762
|
-
(0,
|
|
11794
|
+
(0, import_react36.useEffect)(() => {
|
|
11763
11795
|
checkAuth();
|
|
11764
11796
|
}, [checkAuth]);
|
|
11765
|
-
const contextValue = (0,
|
|
11797
|
+
const contextValue = (0, import_react36.useMemo)(
|
|
11766
11798
|
() => ({
|
|
11767
11799
|
...authState,
|
|
11768
11800
|
checkAuth,
|
|
@@ -11773,7 +11805,7 @@ var AuthProvider = ({
|
|
|
11773
11805
|
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(AuthContext.Provider, { value: contextValue, children });
|
|
11774
11806
|
};
|
|
11775
11807
|
var useAuth = () => {
|
|
11776
|
-
const context = (0,
|
|
11808
|
+
const context = (0, import_react36.useContext)(AuthContext);
|
|
11777
11809
|
if (context === void 0) {
|
|
11778
11810
|
throw new Error("useAuth deve ser usado dentro de um AuthProvider");
|
|
11779
11811
|
}
|
|
@@ -11871,10 +11903,10 @@ var getRootDomain = () => {
|
|
|
11871
11903
|
};
|
|
11872
11904
|
|
|
11873
11905
|
// src/components/Accordation/Accordation.tsx
|
|
11874
|
-
var
|
|
11906
|
+
var import_react37 = require("react");
|
|
11875
11907
|
var import_phosphor_react28 = require("phosphor-react");
|
|
11876
11908
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
11877
|
-
var CardAccordation = (0,
|
|
11909
|
+
var CardAccordation = (0, import_react37.forwardRef)(
|
|
11878
11910
|
({
|
|
11879
11911
|
trigger,
|
|
11880
11912
|
children,
|
|
@@ -11886,13 +11918,13 @@ var CardAccordation = (0, import_react38.forwardRef)(
|
|
|
11886
11918
|
disabled = false,
|
|
11887
11919
|
...props
|
|
11888
11920
|
}, ref) => {
|
|
11889
|
-
const [internalExpanded, setInternalExpanded] = (0,
|
|
11890
|
-
const generatedId = (0,
|
|
11921
|
+
const [internalExpanded, setInternalExpanded] = (0, import_react37.useState)(defaultExpanded);
|
|
11922
|
+
const generatedId = (0, import_react37.useId)();
|
|
11891
11923
|
const contentId = value ? `accordion-content-${value}` : generatedId;
|
|
11892
11924
|
const headerId = value ? `accordion-header-${value}` : `${generatedId}-header`;
|
|
11893
11925
|
const isControlled = controlledExpanded !== void 0;
|
|
11894
11926
|
const isExpanded = isControlled ? controlledExpanded : internalExpanded;
|
|
11895
|
-
(0,
|
|
11927
|
+
(0, import_react37.useEffect)(() => {
|
|
11896
11928
|
if (isControlled) {
|
|
11897
11929
|
setInternalExpanded(controlledExpanded);
|
|
11898
11930
|
}
|
|
@@ -11978,7 +12010,7 @@ var CardAccordation = (0, import_react38.forwardRef)(
|
|
|
11978
12010
|
CardAccordation.displayName = "CardAccordation";
|
|
11979
12011
|
|
|
11980
12012
|
// src/components/Accordation/AccordionGroup.tsx
|
|
11981
|
-
var
|
|
12013
|
+
var import_react38 = require("react");
|
|
11982
12014
|
var import_zustand10 = require("zustand");
|
|
11983
12015
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
11984
12016
|
function createAccordionGroupStore(type, initialValue, collapsible) {
|
|
@@ -11998,8 +12030,8 @@ function createAccordionGroupStore(type, initialValue, collapsible) {
|
|
|
11998
12030
|
}));
|
|
11999
12031
|
}
|
|
12000
12032
|
var injectStore6 = (children, store, indexRef, onItemToggle) => {
|
|
12001
|
-
return
|
|
12002
|
-
if (!(0,
|
|
12033
|
+
return import_react38.Children.map(children, (child) => {
|
|
12034
|
+
if (!(0, import_react38.isValidElement)(child)) {
|
|
12003
12035
|
return child;
|
|
12004
12036
|
}
|
|
12005
12037
|
const typedChild = child;
|
|
@@ -12026,16 +12058,16 @@ var injectStore6 = (children, store, indexRef, onItemToggle) => {
|
|
|
12026
12058
|
if (displayName === "CardAccordation") {
|
|
12027
12059
|
newProps.children = processedChildren;
|
|
12028
12060
|
} else if (processedChildren !== typedChild.props.children) {
|
|
12029
|
-
return (0,
|
|
12061
|
+
return (0, import_react38.cloneElement)(typedChild, { children: processedChildren });
|
|
12030
12062
|
}
|
|
12031
12063
|
}
|
|
12032
12064
|
if (Object.keys(newProps).length > 0) {
|
|
12033
|
-
return (0,
|
|
12065
|
+
return (0, import_react38.cloneElement)(typedChild, newProps);
|
|
12034
12066
|
}
|
|
12035
12067
|
return child;
|
|
12036
12068
|
});
|
|
12037
12069
|
};
|
|
12038
|
-
var AccordionGroup = (0,
|
|
12070
|
+
var AccordionGroup = (0, import_react38.forwardRef)(
|
|
12039
12071
|
({
|
|
12040
12072
|
type = "single",
|
|
12041
12073
|
defaultValue,
|
|
@@ -12046,12 +12078,12 @@ var AccordionGroup = (0, import_react39.forwardRef)(
|
|
|
12046
12078
|
className,
|
|
12047
12079
|
...props
|
|
12048
12080
|
}, ref) => {
|
|
12049
|
-
const [internalValue, setInternalValue] = (0,
|
|
12081
|
+
const [internalValue, setInternalValue] = (0, import_react38.useState)(
|
|
12050
12082
|
defaultValue || (type === "single" ? "" : [])
|
|
12051
12083
|
);
|
|
12052
12084
|
const isControlled = controlledValue !== void 0;
|
|
12053
12085
|
const currentValue = isControlled ? controlledValue : internalValue;
|
|
12054
|
-
const storeRef = (0,
|
|
12086
|
+
const storeRef = (0, import_react38.useRef)(null);
|
|
12055
12087
|
if (storeRef.current) {
|
|
12056
12088
|
storeRef.current.setState((prev) => {
|
|
12057
12089
|
const nextState = {};
|
|
@@ -12071,10 +12103,10 @@ var AccordionGroup = (0, import_react39.forwardRef)(
|
|
|
12071
12103
|
);
|
|
12072
12104
|
}
|
|
12073
12105
|
const store = storeRef.current;
|
|
12074
|
-
(0,
|
|
12106
|
+
(0, import_react38.useEffect)(() => {
|
|
12075
12107
|
store.setState({ value: currentValue });
|
|
12076
12108
|
}, [currentValue, store]);
|
|
12077
|
-
(0,
|
|
12109
|
+
(0, import_react38.useEffect)(() => {
|
|
12078
12110
|
if (!isControlled) {
|
|
12079
12111
|
setInternalValue((prev) => {
|
|
12080
12112
|
if (type === "single") {
|
|
@@ -12127,7 +12159,7 @@ AccordionGroup.displayName = "AccordionGroup";
|
|
|
12127
12159
|
|
|
12128
12160
|
// src/components/Alternative/Alternative.tsx
|
|
12129
12161
|
var import_phosphor_react29 = require("phosphor-react");
|
|
12130
|
-
var
|
|
12162
|
+
var import_react39 = require("react");
|
|
12131
12163
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
12132
12164
|
var AlternativesList = ({
|
|
12133
12165
|
alternatives,
|
|
@@ -12141,9 +12173,9 @@ var AlternativesList = ({
|
|
|
12141
12173
|
mode = "interactive",
|
|
12142
12174
|
selectedValue
|
|
12143
12175
|
}) => {
|
|
12144
|
-
const uniqueId = (0,
|
|
12176
|
+
const uniqueId = (0, import_react39.useId)();
|
|
12145
12177
|
const groupName = name || `alternatives-${uniqueId}`;
|
|
12146
|
-
const [actualValue, setActualValue] = (0,
|
|
12178
|
+
const [actualValue, setActualValue] = (0, import_react39.useState)(value);
|
|
12147
12179
|
const isReadonly = mode === "readonly";
|
|
12148
12180
|
const getStatusStyles2 = (status, isReadonly2) => {
|
|
12149
12181
|
const hoverClass = isReadonly2 ? "" : "hover:bg-background-50";
|
|
@@ -12362,7 +12394,7 @@ var AlternativesList = ({
|
|
|
12362
12394
|
}
|
|
12363
12395
|
);
|
|
12364
12396
|
};
|
|
12365
|
-
var HeaderAlternative = (0,
|
|
12397
|
+
var HeaderAlternative = (0, import_react39.forwardRef)(
|
|
12366
12398
|
({ className, title, subTitle, content, ...props }, ref) => {
|
|
12367
12399
|
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
12368
12400
|
"div",
|
|
@@ -12428,7 +12460,7 @@ function createZustandAuthAdapter(useAuthStore2) {
|
|
|
12428
12460
|
}
|
|
12429
12461
|
|
|
12430
12462
|
// src/components/Auth/useUrlAuthentication.ts
|
|
12431
|
-
var
|
|
12463
|
+
var import_react40 = require("react");
|
|
12432
12464
|
var import_react_router_dom2 = require("react-router-dom");
|
|
12433
12465
|
var getAuthParams = (location, extractParams) => {
|
|
12434
12466
|
const searchParams = new URLSearchParams(location.search);
|
|
@@ -12476,8 +12508,8 @@ var handleUserData = (responseData, setUser) => {
|
|
|
12476
12508
|
};
|
|
12477
12509
|
function useUrlAuthentication(options) {
|
|
12478
12510
|
const location = (0, import_react_router_dom2.useLocation)();
|
|
12479
|
-
const processedRef = (0,
|
|
12480
|
-
(0,
|
|
12511
|
+
const processedRef = (0, import_react40.useRef)(false);
|
|
12512
|
+
(0, import_react40.useEffect)(() => {
|
|
12481
12513
|
const handleAuthentication = async () => {
|
|
12482
12514
|
if (processedRef.current) {
|
|
12483
12515
|
return;
|
|
@@ -12548,9 +12580,9 @@ function useUrlAuthentication(options) {
|
|
|
12548
12580
|
}
|
|
12549
12581
|
|
|
12550
12582
|
// src/components/Auth/useApiConfig.ts
|
|
12551
|
-
var
|
|
12583
|
+
var import_react41 = require("react");
|
|
12552
12584
|
function useApiConfig(api) {
|
|
12553
|
-
return (0,
|
|
12585
|
+
return (0, import_react41.useMemo)(
|
|
12554
12586
|
() => ({
|
|
12555
12587
|
get: (endpoint, config) => api.get(endpoint, config)
|
|
12556
12588
|
}),
|
|
@@ -12560,7 +12592,7 @@ function useApiConfig(api) {
|
|
|
12560
12592
|
|
|
12561
12593
|
// src/components/Quiz/Quiz.tsx
|
|
12562
12594
|
var import_phosphor_react32 = require("phosphor-react");
|
|
12563
|
-
var
|
|
12595
|
+
var import_react44 = require("react");
|
|
12564
12596
|
|
|
12565
12597
|
// src/components/Quiz/useQuizStore.ts
|
|
12566
12598
|
var import_zustand11 = require("zustand");
|
|
@@ -13170,10 +13202,10 @@ var useQuizStore = (0, import_zustand11.create)()(
|
|
|
13170
13202
|
);
|
|
13171
13203
|
|
|
13172
13204
|
// src/components/Quiz/QuizContent.tsx
|
|
13173
|
-
var
|
|
13205
|
+
var import_react43 = require("react");
|
|
13174
13206
|
|
|
13175
13207
|
// src/components/MultipleChoice/MultipleChoice.tsx
|
|
13176
|
-
var
|
|
13208
|
+
var import_react42 = require("react");
|
|
13177
13209
|
var import_phosphor_react30 = require("phosphor-react");
|
|
13178
13210
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
13179
13211
|
var MultipleChoiceList = ({
|
|
@@ -13185,8 +13217,8 @@ var MultipleChoiceList = ({
|
|
|
13185
13217
|
onHandleSelectedValues,
|
|
13186
13218
|
mode = "interactive"
|
|
13187
13219
|
}) => {
|
|
13188
|
-
const [actualValue, setActualValue] = (0,
|
|
13189
|
-
(0,
|
|
13220
|
+
const [actualValue, setActualValue] = (0, import_react42.useState)(selectedValues);
|
|
13221
|
+
(0, import_react42.useEffect)(() => {
|
|
13190
13222
|
setActualValue(selectedValues);
|
|
13191
13223
|
}, [selectedValues]);
|
|
13192
13224
|
const getStatusBadge2 = (status) => {
|
|
@@ -13331,12 +13363,12 @@ var getStatusStyles = (variantCorrect) => {
|
|
|
13331
13363
|
return "bg-error-background border-error-300";
|
|
13332
13364
|
}
|
|
13333
13365
|
};
|
|
13334
|
-
var QuizSubTitle = (0,
|
|
13366
|
+
var QuizSubTitle = (0, import_react43.forwardRef)(
|
|
13335
13367
|
({ subTitle, ...props }, ref) => {
|
|
13336
13368
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "px-4 pb-2 pt-6", ...props, ref, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { className: "font-bold text-lg text-text-950", children: subTitle }) });
|
|
13337
13369
|
}
|
|
13338
13370
|
);
|
|
13339
|
-
var QuizContainer = (0,
|
|
13371
|
+
var QuizContainer = (0, import_react43.forwardRef)(({ children, className, ...props }, ref) => {
|
|
13340
13372
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
13341
13373
|
"div",
|
|
13342
13374
|
{
|
|
@@ -13425,15 +13457,15 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
13425
13457
|
const currentQuestionResult = getQuestionResultByQuestionId(
|
|
13426
13458
|
currentQuestion?.id || ""
|
|
13427
13459
|
);
|
|
13428
|
-
const prevSelectedValuesRef = (0,
|
|
13429
|
-
const prevQuestionIdRef = (0,
|
|
13430
|
-
const allCurrentAnswerIds = (0,
|
|
13460
|
+
const prevSelectedValuesRef = (0, import_react43.useRef)([]);
|
|
13461
|
+
const prevQuestionIdRef = (0, import_react43.useRef)("");
|
|
13462
|
+
const allCurrentAnswerIds = (0, import_react43.useMemo)(() => {
|
|
13431
13463
|
return allCurrentAnswers?.map((answer) => answer.optionId) || [];
|
|
13432
13464
|
}, [allCurrentAnswers]);
|
|
13433
|
-
const selectedValues = (0,
|
|
13465
|
+
const selectedValues = (0, import_react43.useMemo)(() => {
|
|
13434
13466
|
return allCurrentAnswerIds?.filter((id) => id !== null) || [];
|
|
13435
13467
|
}, [allCurrentAnswerIds]);
|
|
13436
|
-
const stableSelectedValues = (0,
|
|
13468
|
+
const stableSelectedValues = (0, import_react43.useMemo)(() => {
|
|
13437
13469
|
const currentQuestionId = currentQuestion?.id || "";
|
|
13438
13470
|
const hasQuestionChanged = prevQuestionIdRef.current !== currentQuestionId;
|
|
13439
13471
|
if (hasQuestionChanged) {
|
|
@@ -13457,7 +13489,7 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
13457
13489
|
variant,
|
|
13458
13490
|
currentQuestionResult?.selectedOptions
|
|
13459
13491
|
]);
|
|
13460
|
-
const handleSelectedValues = (0,
|
|
13492
|
+
const handleSelectedValues = (0, import_react43.useCallback)(
|
|
13461
13493
|
(values) => {
|
|
13462
13494
|
if (currentQuestion) {
|
|
13463
13495
|
selectMultipleAnswer(currentQuestion.id, values);
|
|
@@ -13465,7 +13497,7 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
13465
13497
|
},
|
|
13466
13498
|
[currentQuestion, selectMultipleAnswer]
|
|
13467
13499
|
);
|
|
13468
|
-
const questionKey = (0,
|
|
13500
|
+
const questionKey = (0, import_react43.useMemo)(
|
|
13469
13501
|
() => `question-${currentQuestion?.id || "1"}`,
|
|
13470
13502
|
[currentQuestion?.id]
|
|
13471
13503
|
);
|
|
@@ -13526,14 +13558,14 @@ var QuizDissertative = ({ paddingBottom }) => {
|
|
|
13526
13558
|
currentQuestion?.id || ""
|
|
13527
13559
|
);
|
|
13528
13560
|
const currentAnswer = getCurrentAnswer();
|
|
13529
|
-
const textareaRef = (0,
|
|
13561
|
+
const textareaRef = (0, import_react43.useRef)(null);
|
|
13530
13562
|
const charLimit = getDissertativeCharLimit();
|
|
13531
13563
|
const handleAnswerChange = (value) => {
|
|
13532
13564
|
if (currentQuestion) {
|
|
13533
13565
|
selectDissertativeAnswer(currentQuestion.id, value);
|
|
13534
13566
|
}
|
|
13535
13567
|
};
|
|
13536
|
-
const adjustTextareaHeight = (0,
|
|
13568
|
+
const adjustTextareaHeight = (0, import_react43.useCallback)(() => {
|
|
13537
13569
|
if (textareaRef.current) {
|
|
13538
13570
|
textareaRef.current.style.height = "auto";
|
|
13539
13571
|
const scrollHeight = textareaRef.current.scrollHeight;
|
|
@@ -13543,7 +13575,7 @@ var QuizDissertative = ({ paddingBottom }) => {
|
|
|
13543
13575
|
textareaRef.current.style.height = `${newHeight}px`;
|
|
13544
13576
|
}
|
|
13545
13577
|
}, []);
|
|
13546
|
-
(0,
|
|
13578
|
+
(0, import_react43.useEffect)(() => {
|
|
13547
13579
|
adjustTextareaHeight();
|
|
13548
13580
|
}, [currentAnswer, adjustTextareaHeight]);
|
|
13549
13581
|
if (!currentQuestion) {
|
|
@@ -13684,7 +13716,7 @@ var QuizConnectDots = ({ paddingBottom }) => {
|
|
|
13684
13716
|
isCorrect: false
|
|
13685
13717
|
}
|
|
13686
13718
|
];
|
|
13687
|
-
const [userAnswers, setUserAnswers] = (0,
|
|
13719
|
+
const [userAnswers, setUserAnswers] = (0, import_react43.useState)(() => {
|
|
13688
13720
|
if (variant === "result") {
|
|
13689
13721
|
return mockUserAnswers;
|
|
13690
13722
|
}
|
|
@@ -13803,8 +13835,8 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
13803
13835
|
isCorrect: true
|
|
13804
13836
|
}
|
|
13805
13837
|
];
|
|
13806
|
-
const [answers, setAnswers] = (0,
|
|
13807
|
-
const baseId = (0,
|
|
13838
|
+
const [answers, setAnswers] = (0, import_react43.useState)({});
|
|
13839
|
+
const baseId = (0, import_react43.useId)();
|
|
13808
13840
|
const getAvailableOptionsForSelect = (selectId) => {
|
|
13809
13841
|
const usedOptions = new Set(
|
|
13810
13842
|
Object.entries(answers).filter(([key]) => key !== selectId).map(([, value]) => value)
|
|
@@ -13943,7 +13975,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
13943
13975
|
};
|
|
13944
13976
|
const correctRadiusRelative = calculateCorrectRadiusRelative();
|
|
13945
13977
|
const mockUserAnswerRelative = { x: 0.72, y: 0.348 };
|
|
13946
|
-
const [clickPositionRelative, setClickPositionRelative] = (0,
|
|
13978
|
+
const [clickPositionRelative, setClickPositionRelative] = (0, import_react43.useState)(variant == "result" ? mockUserAnswerRelative : null);
|
|
13947
13979
|
const convertToRelativeCoordinates = (x, y, rect) => {
|
|
13948
13980
|
const safeWidth = Math.max(rect.width, 1e-3);
|
|
13949
13981
|
const safeHeight = Math.max(rect.height, 1e-3);
|
|
@@ -14109,14 +14141,14 @@ var getFinishConfirmationText = (type) => {
|
|
|
14109
14141
|
const config = getQuizTypeConfig(type);
|
|
14110
14142
|
return `Tem certeza que deseja finalizar ${config.article} ${config.label.toLowerCase()}?`;
|
|
14111
14143
|
};
|
|
14112
|
-
var Quiz = (0,
|
|
14144
|
+
var Quiz = (0, import_react44.forwardRef)(({ children, className, variant = "default", ...props }, ref) => {
|
|
14113
14145
|
const { setVariant } = useQuizStore();
|
|
14114
|
-
(0,
|
|
14146
|
+
(0, import_react44.useEffect)(() => {
|
|
14115
14147
|
setVariant(variant);
|
|
14116
14148
|
}, [variant, setVariant]);
|
|
14117
14149
|
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { ref, className: cn("flex flex-col", className), ...props, children });
|
|
14118
14150
|
});
|
|
14119
|
-
var QuizTitle = (0,
|
|
14151
|
+
var QuizTitle = (0, import_react44.forwardRef)(({ className, onBack, ...props }, ref) => {
|
|
14120
14152
|
const {
|
|
14121
14153
|
quiz,
|
|
14122
14154
|
currentQuestionIndex,
|
|
@@ -14126,7 +14158,7 @@ var QuizTitle = (0, import_react45.forwardRef)(({ className, onBack, ...props },
|
|
|
14126
14158
|
formatTime: formatTime2,
|
|
14127
14159
|
isStarted
|
|
14128
14160
|
} = useQuizStore();
|
|
14129
|
-
const [showExitConfirmation, setShowExitConfirmation] = (0,
|
|
14161
|
+
const [showExitConfirmation, setShowExitConfirmation] = (0, import_react44.useState)(false);
|
|
14130
14162
|
const totalQuestions = getTotalQuestions();
|
|
14131
14163
|
const quizTitle = getQuizTitle();
|
|
14132
14164
|
const handleBackClick = () => {
|
|
@@ -14295,7 +14327,7 @@ var QuizQuestionList = ({
|
|
|
14295
14327
|
)
|
|
14296
14328
|
] });
|
|
14297
14329
|
};
|
|
14298
|
-
var QuizFooter = (0,
|
|
14330
|
+
var QuizFooter = (0, import_react44.forwardRef)(
|
|
14299
14331
|
({
|
|
14300
14332
|
className,
|
|
14301
14333
|
onGoToSimulated,
|
|
@@ -14329,8 +14361,8 @@ var QuizFooter = (0, import_react45.forwardRef)(
|
|
|
14329
14361
|
const currentAnswer = getCurrentAnswer();
|
|
14330
14362
|
const currentQuestion = getCurrentQuestion();
|
|
14331
14363
|
const isCurrentQuestionSkipped = currentQuestion ? getQuestionStatusFromUserAnswers(currentQuestion.id) === "skipped" : false;
|
|
14332
|
-
const [activeModal, setActiveModal] = (0,
|
|
14333
|
-
const [filterType, setFilterType] = (0,
|
|
14364
|
+
const [activeModal, setActiveModal] = (0, import_react44.useState)(null);
|
|
14365
|
+
const [filterType, setFilterType] = (0, import_react44.useState)("all");
|
|
14334
14366
|
const openModal = (modalName) => setActiveModal(modalName);
|
|
14335
14367
|
const closeModal = () => setActiveModal(null);
|
|
14336
14368
|
const isModalOpen = (modalName) => activeModal === modalName;
|
|
@@ -14672,7 +14704,7 @@ var QuizFooter = (0, import_react45.forwardRef)(
|
|
|
14672
14704
|
);
|
|
14673
14705
|
|
|
14674
14706
|
// src/components/Quiz/QuizResult.tsx
|
|
14675
|
-
var
|
|
14707
|
+
var import_react45 = require("react");
|
|
14676
14708
|
var import_phosphor_react33 = require("phosphor-react");
|
|
14677
14709
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
14678
14710
|
var QuizBadge = ({
|
|
@@ -14694,15 +14726,15 @@ var QuizBadge = ({
|
|
|
14694
14726
|
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Badge_default, { variant: "solid", action: "info", "data-testid": "quiz-badge", children: subtype });
|
|
14695
14727
|
}
|
|
14696
14728
|
};
|
|
14697
|
-
var QuizHeaderResult = (0,
|
|
14729
|
+
var QuizHeaderResult = (0, import_react45.forwardRef)(
|
|
14698
14730
|
({ className, ...props }, ref) => {
|
|
14699
14731
|
const {
|
|
14700
14732
|
getQuestionResultByQuestionId,
|
|
14701
14733
|
getCurrentQuestion,
|
|
14702
14734
|
questionsResult
|
|
14703
14735
|
} = useQuizStore();
|
|
14704
|
-
const [status, setStatus] = (0,
|
|
14705
|
-
(0,
|
|
14736
|
+
const [status, setStatus] = (0, import_react45.useState)(void 0);
|
|
14737
|
+
(0, import_react45.useEffect)(() => {
|
|
14706
14738
|
const cq = getCurrentQuestion();
|
|
14707
14739
|
if (!cq) {
|
|
14708
14740
|
setStatus(void 0);
|
|
@@ -14766,7 +14798,7 @@ var QuizHeaderResult = (0, import_react46.forwardRef)(
|
|
|
14766
14798
|
);
|
|
14767
14799
|
}
|
|
14768
14800
|
);
|
|
14769
|
-
var QuizResultHeaderTitle = (0,
|
|
14801
|
+
var QuizResultHeaderTitle = (0, import_react45.forwardRef)(({ className, showBadge = true, onRepeat, canRetry, ...props }, ref) => {
|
|
14770
14802
|
const { quiz } = useQuizStore();
|
|
14771
14803
|
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
14772
14804
|
"div",
|
|
@@ -14796,7 +14828,7 @@ var QuizResultHeaderTitle = (0, import_react46.forwardRef)(({ className, showBad
|
|
|
14796
14828
|
}
|
|
14797
14829
|
);
|
|
14798
14830
|
});
|
|
14799
|
-
var QuizResultTitle = (0,
|
|
14831
|
+
var QuizResultTitle = (0, import_react45.forwardRef)(({ className, ...props }, ref) => {
|
|
14800
14832
|
const { getQuizTitle } = useQuizStore();
|
|
14801
14833
|
const quizTitle = getQuizTitle();
|
|
14802
14834
|
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
@@ -14840,7 +14872,7 @@ var calculateAnswerStatistics = (answers) => {
|
|
|
14840
14872
|
}
|
|
14841
14873
|
return stats;
|
|
14842
14874
|
};
|
|
14843
|
-
var QuizResultPerformance = (0,
|
|
14875
|
+
var QuizResultPerformance = (0, import_react45.forwardRef)(({ showDetails = true, ...props }, ref) => {
|
|
14844
14876
|
const {
|
|
14845
14877
|
getTotalQuestions,
|
|
14846
14878
|
formatTime: formatTime2,
|
|
@@ -14945,7 +14977,7 @@ var QuizResultPerformance = (0, import_react46.forwardRef)(({ showDetails = true
|
|
|
14945
14977
|
}
|
|
14946
14978
|
);
|
|
14947
14979
|
});
|
|
14948
|
-
var QuizListResult = (0,
|
|
14980
|
+
var QuizListResult = (0, import_react45.forwardRef)(({ className, onSubjectClick, ...props }, ref) => {
|
|
14949
14981
|
const { getQuestionsGroupedBySubject } = useQuizStore();
|
|
14950
14982
|
const { isDark } = useTheme();
|
|
14951
14983
|
const groupedQuestions = getQuestionsGroupedBySubject();
|
|
@@ -15075,7 +15107,7 @@ var BreadcrumbMenu = ({
|
|
|
15075
15107
|
};
|
|
15076
15108
|
|
|
15077
15109
|
// src/components/BreadcrumbMenu/useBreadcrumbBuilder.ts
|
|
15078
|
-
var
|
|
15110
|
+
var import_react46 = require("react");
|
|
15079
15111
|
|
|
15080
15112
|
// src/components/BreadcrumbMenu/breadcrumbStore.ts
|
|
15081
15113
|
var import_zustand12 = require("zustand");
|
|
@@ -15204,7 +15236,7 @@ var useBreadcrumbBuilder = (config) => {
|
|
|
15204
15236
|
(level) => isBreadcrumbWithData(level) ? level.data : null
|
|
15205
15237
|
);
|
|
15206
15238
|
const levelUrlIds = levels.map((level) => level.urlId);
|
|
15207
|
-
(0,
|
|
15239
|
+
(0, import_react46.useEffect)(() => {
|
|
15208
15240
|
const newBreadcrumbs = [root];
|
|
15209
15241
|
const previousIds = [];
|
|
15210
15242
|
for (const level of levels) {
|
|
@@ -15236,11 +15268,11 @@ var useBreadcrumbBuilder = (config) => {
|
|
|
15236
15268
|
};
|
|
15237
15269
|
|
|
15238
15270
|
// src/components/BreadcrumbMenu/useUrlParams.ts
|
|
15239
|
-
var
|
|
15271
|
+
var import_react47 = require("react");
|
|
15240
15272
|
var import_react_router_dom4 = require("react-router-dom");
|
|
15241
15273
|
var useUrlParams = (config) => {
|
|
15242
15274
|
const location = (0, import_react_router_dom4.useLocation)();
|
|
15243
|
-
return (0,
|
|
15275
|
+
return (0, import_react47.useMemo)(() => {
|
|
15244
15276
|
const segments = location.pathname.split("/").filter(Boolean);
|
|
15245
15277
|
const params = {};
|
|
15246
15278
|
for (const [key, index] of Object.entries(config)) {
|
|
@@ -15251,15 +15283,15 @@ var useUrlParams = (config) => {
|
|
|
15251
15283
|
};
|
|
15252
15284
|
|
|
15253
15285
|
// src/hooks/useAppInitialization.ts
|
|
15254
|
-
var
|
|
15286
|
+
var import_react49 = require("react");
|
|
15255
15287
|
|
|
15256
15288
|
// src/hooks/useInstitution.ts
|
|
15257
|
-
var
|
|
15289
|
+
var import_react48 = require("react");
|
|
15258
15290
|
function useInstitutionId() {
|
|
15259
|
-
const [institutionId, setInstitutionId] = (0,
|
|
15291
|
+
const [institutionId, setInstitutionId] = (0, import_react48.useState)(() => {
|
|
15260
15292
|
return document.querySelector('meta[name="institution-id"]')?.getAttribute("content") ?? null;
|
|
15261
15293
|
});
|
|
15262
|
-
(0,
|
|
15294
|
+
(0, import_react48.useEffect)(() => {
|
|
15263
15295
|
const metaTag = document.querySelector('meta[name="institution-id"]');
|
|
15264
15296
|
if (!metaTag) return;
|
|
15265
15297
|
const observer = new MutationObserver(() => {
|
|
@@ -15426,7 +15458,7 @@ var useAuthStore = (0, import_zustand14.create)()(
|
|
|
15426
15458
|
function useAppInitialization() {
|
|
15427
15459
|
const getInstitutionId = useInstitutionId();
|
|
15428
15460
|
const { initialize, initialized, institutionId } = useAppStore();
|
|
15429
|
-
const authFunctions = (0,
|
|
15461
|
+
const authFunctions = (0, import_react49.useMemo)(
|
|
15430
15462
|
() => ({
|
|
15431
15463
|
checkAuth: async () => {
|
|
15432
15464
|
const { sessionInfo, tokens } = useAuthStore.getState();
|
|
@@ -15463,7 +15495,7 @@ function useAppInitialization() {
|
|
|
15463
15495
|
}
|
|
15464
15496
|
|
|
15465
15497
|
// src/hooks/useAppContent.ts
|
|
15466
|
-
var
|
|
15498
|
+
var import_react50 = require("react");
|
|
15467
15499
|
var import_react_router_dom5 = require("react-router-dom");
|
|
15468
15500
|
function useAppContent(config) {
|
|
15469
15501
|
const navigate = (0, import_react_router_dom5.useNavigate)();
|
|
@@ -15489,20 +15521,20 @@ function useAppContent(config) {
|
|
|
15489
15521
|
navigate("/painel");
|
|
15490
15522
|
}
|
|
15491
15523
|
};
|
|
15492
|
-
const handleSetSelectedProfile = (0,
|
|
15524
|
+
const handleSetSelectedProfile = (0, import_react50.useCallback)(
|
|
15493
15525
|
(profile) => {
|
|
15494
15526
|
setSelectedProfile(profile);
|
|
15495
15527
|
},
|
|
15496
15528
|
[setSelectedProfile]
|
|
15497
15529
|
);
|
|
15498
|
-
const handleClearParamsFromURL = (0,
|
|
15530
|
+
const handleClearParamsFromURL = (0, import_react50.useCallback)(() => {
|
|
15499
15531
|
if (onClearParamsFromURL) {
|
|
15500
15532
|
onClearParamsFromURL();
|
|
15501
15533
|
} else {
|
|
15502
15534
|
globalThis.location.replace("/painel");
|
|
15503
15535
|
}
|
|
15504
15536
|
}, [onClearParamsFromURL]);
|
|
15505
|
-
const handleError = (0,
|
|
15537
|
+
const handleError = (0, import_react50.useCallback)(
|
|
15506
15538
|
(error) => {
|
|
15507
15539
|
if (onError) {
|
|
15508
15540
|
onError(error);
|
|
@@ -15513,7 +15545,7 @@ function useAppContent(config) {
|
|
|
15513
15545
|
},
|
|
15514
15546
|
[navigate, onError]
|
|
15515
15547
|
);
|
|
15516
|
-
const urlAuthConfig = (0,
|
|
15548
|
+
const urlAuthConfig = (0, import_react50.useMemo)(
|
|
15517
15549
|
() => ({
|
|
15518
15550
|
setTokens,
|
|
15519
15551
|
setSessionInfo,
|
|
@@ -15539,10 +15571,10 @@ function useAppContent(config) {
|
|
|
15539
15571
|
);
|
|
15540
15572
|
useUrlAuthentication(urlAuthConfig);
|
|
15541
15573
|
const { sessionInfo } = useAuth();
|
|
15542
|
-
const institutionIdToUse = (0,
|
|
15574
|
+
const institutionIdToUse = (0, import_react50.useMemo)(() => {
|
|
15543
15575
|
return sessionInfo?.institutionId || getInstitutionId;
|
|
15544
15576
|
}, [sessionInfo?.institutionId, getInstitutionId]);
|
|
15545
|
-
(0,
|
|
15577
|
+
(0, import_react50.useEffect)(() => {
|
|
15546
15578
|
if (institutionIdToUse && !initialized) {
|
|
15547
15579
|
initialize(institutionIdToUse);
|
|
15548
15580
|
}
|
|
@@ -15612,6 +15644,7 @@ function useAppContent(config) {
|
|
|
15612
15644
|
NotificationEntityType,
|
|
15613
15645
|
ProfileMenuFooter,
|
|
15614
15646
|
ProfileMenuHeader,
|
|
15647
|
+
ProfileMenuInfo,
|
|
15615
15648
|
ProfileMenuSection,
|
|
15616
15649
|
ProfileMenuTrigger,
|
|
15617
15650
|
ProfileToggleTheme,
|