analytica-frontend-lib 1.2.19 → 1.2.21
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.css +10 -0
- package/dist/AlertManager/index.css.map +1 -1
- package/dist/AlertManager/index.d.mts +2 -1
- package/dist/AlertManager/index.d.ts +2 -1
- package/dist/AlertManagerView/index.d.mts +2 -1
- package/dist/AlertManagerView/index.d.ts +2 -1
- package/dist/CheckBoxGroup-9n5C0OH4.d.mts +24 -0
- package/dist/CheckBoxGroup-9n5C0OH4.d.ts +24 -0
- package/dist/Radio/index.d.mts +1 -1
- package/dist/Radio/index.d.ts +1 -1
- package/dist/TableProvider/index.css +19143 -0
- package/dist/TableProvider/index.css.map +1 -0
- package/dist/TableProvider/index.d.mts +4 -0
- package/dist/TableProvider/index.d.ts +4 -0
- package/dist/TableProvider/index.js +5365 -0
- package/dist/TableProvider/index.js.map +1 -0
- package/dist/TableProvider/index.mjs +5387 -0
- package/dist/TableProvider/index.mjs.map +1 -0
- package/dist/TableProvider-CDcL1tDj.d.mts +192 -0
- package/dist/TableProvider-D4Ak7ofz.d.ts +192 -0
- package/dist/index.css +10 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +6 -43
- package/dist/index.d.ts +6 -43
- package/dist/index.js +1069 -780
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +988 -700
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +10 -0
- package/dist/styles.css.map +1 -1
- package/dist/{types-BXzeefgf.d.mts → types-DqZRjqxh.d.ts} +2 -23
- package/dist/{types-BXzeefgf.d.ts → types-pd3QVhSu.d.mts} +2 -23
- package/package.json +2 -1
package/dist/index.mjs
CHANGED
|
@@ -8220,10 +8220,297 @@ var useTableFilter = (initialConfigs, options = {}) => {
|
|
|
8220
8220
|
};
|
|
8221
8221
|
};
|
|
8222
8222
|
|
|
8223
|
+
// src/components/TableProvider/TableProvider.tsx
|
|
8224
|
+
import { useState as useState17, useEffect as useEffect18, useMemo as useMemo10, useCallback as useCallback4 } from "react";
|
|
8225
|
+
import { Funnel } from "phosphor-react";
|
|
8226
|
+
import { Fragment as Fragment7, jsx as jsx49, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
8227
|
+
function TableProvider({
|
|
8228
|
+
data,
|
|
8229
|
+
headers,
|
|
8230
|
+
loading = false,
|
|
8231
|
+
variant = "default",
|
|
8232
|
+
enableSearch = false,
|
|
8233
|
+
enableFilters = false,
|
|
8234
|
+
enableTableSort = false,
|
|
8235
|
+
enablePagination = false,
|
|
8236
|
+
enableRowClick = false,
|
|
8237
|
+
initialFilters = [],
|
|
8238
|
+
paginationConfig = {},
|
|
8239
|
+
searchPlaceholder = "Buscar...",
|
|
8240
|
+
noSearchResultImage,
|
|
8241
|
+
rowKey,
|
|
8242
|
+
onParamsChange,
|
|
8243
|
+
onRowClick,
|
|
8244
|
+
children
|
|
8245
|
+
}) {
|
|
8246
|
+
const [searchQuery, setSearchQuery] = useState17("");
|
|
8247
|
+
const sortResultRaw = useTableSort(data, { syncWithUrl: true });
|
|
8248
|
+
const sortResult = enableTableSort ? sortResultRaw : {
|
|
8249
|
+
sortedData: data,
|
|
8250
|
+
sortColumn: null,
|
|
8251
|
+
sortDirection: null,
|
|
8252
|
+
handleSort: () => {
|
|
8253
|
+
}
|
|
8254
|
+
};
|
|
8255
|
+
const { sortedData, sortColumn, sortDirection, handleSort } = sortResult;
|
|
8256
|
+
const filterResultRaw = useTableFilter(initialFilters, { syncWithUrl: true });
|
|
8257
|
+
const disabledFilterResult = useMemo10(
|
|
8258
|
+
() => ({
|
|
8259
|
+
filterConfigs: [],
|
|
8260
|
+
activeFilters: {},
|
|
8261
|
+
hasActiveFilters: false,
|
|
8262
|
+
updateFilters: () => {
|
|
8263
|
+
},
|
|
8264
|
+
applyFilters: () => {
|
|
8265
|
+
},
|
|
8266
|
+
clearFilters: () => {
|
|
8267
|
+
}
|
|
8268
|
+
}),
|
|
8269
|
+
[]
|
|
8270
|
+
);
|
|
8271
|
+
const filterResult = enableFilters ? filterResultRaw : disabledFilterResult;
|
|
8272
|
+
const {
|
|
8273
|
+
filterConfigs,
|
|
8274
|
+
activeFilters,
|
|
8275
|
+
hasActiveFilters,
|
|
8276
|
+
updateFilters,
|
|
8277
|
+
applyFilters,
|
|
8278
|
+
clearFilters
|
|
8279
|
+
} = filterResult;
|
|
8280
|
+
const {
|
|
8281
|
+
defaultItemsPerPage = 10,
|
|
8282
|
+
itemsPerPageOptions = [10, 20, 50, 100],
|
|
8283
|
+
itemLabel = "itens",
|
|
8284
|
+
totalItems,
|
|
8285
|
+
totalPages
|
|
8286
|
+
} = paginationConfig;
|
|
8287
|
+
const [currentPage, setCurrentPage] = useState17(1);
|
|
8288
|
+
const [itemsPerPage, setItemsPerPage] = useState17(defaultItemsPerPage);
|
|
8289
|
+
const [isFilterModalOpen, setIsFilterModalOpen] = useState17(false);
|
|
8290
|
+
const combinedParams = useMemo10(() => {
|
|
8291
|
+
const params = {
|
|
8292
|
+
page: currentPage,
|
|
8293
|
+
limit: itemsPerPage
|
|
8294
|
+
};
|
|
8295
|
+
if (enableSearch && searchQuery) {
|
|
8296
|
+
params.search = searchQuery;
|
|
8297
|
+
}
|
|
8298
|
+
if (enableFilters) {
|
|
8299
|
+
Object.assign(params, activeFilters);
|
|
8300
|
+
}
|
|
8301
|
+
if (enableTableSort && sortColumn && sortDirection) {
|
|
8302
|
+
params.sortBy = sortColumn;
|
|
8303
|
+
params.sortOrder = sortDirection;
|
|
8304
|
+
}
|
|
8305
|
+
return params;
|
|
8306
|
+
}, [
|
|
8307
|
+
currentPage,
|
|
8308
|
+
itemsPerPage,
|
|
8309
|
+
searchQuery,
|
|
8310
|
+
activeFilters,
|
|
8311
|
+
sortColumn,
|
|
8312
|
+
sortDirection,
|
|
8313
|
+
enableSearch,
|
|
8314
|
+
enableFilters,
|
|
8315
|
+
enableTableSort
|
|
8316
|
+
]);
|
|
8317
|
+
useEffect18(() => {
|
|
8318
|
+
onParamsChange?.(combinedParams);
|
|
8319
|
+
}, [combinedParams]);
|
|
8320
|
+
const handleSearchChange = useCallback4((value) => {
|
|
8321
|
+
setSearchQuery(value);
|
|
8322
|
+
setCurrentPage(1);
|
|
8323
|
+
}, []);
|
|
8324
|
+
const handleFilterApply = useCallback4(() => {
|
|
8325
|
+
applyFilters();
|
|
8326
|
+
setIsFilterModalOpen(false);
|
|
8327
|
+
setCurrentPage(1);
|
|
8328
|
+
}, [applyFilters]);
|
|
8329
|
+
const handlePageChange = useCallback4((page) => {
|
|
8330
|
+
setCurrentPage(page);
|
|
8331
|
+
}, []);
|
|
8332
|
+
const handleItemsPerPageChange = useCallback4((items) => {
|
|
8333
|
+
setItemsPerPage(items);
|
|
8334
|
+
setCurrentPage(1);
|
|
8335
|
+
}, []);
|
|
8336
|
+
const handleRowClickInternal = useCallback4(
|
|
8337
|
+
(row, index) => {
|
|
8338
|
+
if (enableRowClick && onRowClick) {
|
|
8339
|
+
onRowClick(row, index);
|
|
8340
|
+
}
|
|
8341
|
+
},
|
|
8342
|
+
[enableRowClick, onRowClick]
|
|
8343
|
+
);
|
|
8344
|
+
const useInternalPagination = useMemo10(
|
|
8345
|
+
() => enablePagination && !onParamsChange && totalItems === void 0 && totalPages === void 0,
|
|
8346
|
+
[enablePagination, onParamsChange, totalItems, totalPages]
|
|
8347
|
+
);
|
|
8348
|
+
const calculatedTotalPages = totalPages ?? Math.ceil(
|
|
8349
|
+
(totalItems ?? (useInternalPagination ? sortedData.length : data.length)) / itemsPerPage
|
|
8350
|
+
);
|
|
8351
|
+
const calculatedTotalItems = totalItems ?? (useInternalPagination ? sortedData.length : data.length);
|
|
8352
|
+
const displayData = useMemo10(() => {
|
|
8353
|
+
if (!useInternalPagination) {
|
|
8354
|
+
return sortedData;
|
|
8355
|
+
}
|
|
8356
|
+
const start = (currentPage - 1) * itemsPerPage;
|
|
8357
|
+
return sortedData.slice(start, start + itemsPerPage);
|
|
8358
|
+
}, [useInternalPagination, sortedData, currentPage, itemsPerPage]);
|
|
8359
|
+
const isEmpty = sortedData.length === 0;
|
|
8360
|
+
const controls = (enableSearch || enableFilters) && /* @__PURE__ */ jsxs38("div", { className: "flex items-center gap-4", children: [
|
|
8361
|
+
enableFilters && /* @__PURE__ */ jsxs38(
|
|
8362
|
+
Button_default,
|
|
8363
|
+
{
|
|
8364
|
+
variant: "outline",
|
|
8365
|
+
size: "medium",
|
|
8366
|
+
onClick: () => setIsFilterModalOpen(true),
|
|
8367
|
+
children: [
|
|
8368
|
+
/* @__PURE__ */ jsx49(Funnel, { size: 20 }),
|
|
8369
|
+
"Filtros",
|
|
8370
|
+
hasActiveFilters && /* @__PURE__ */ jsx49("span", { className: "ml-2 rounded-full bg-primary-500 px-2 py-0.5 text-xs text-white", children: Object.keys(activeFilters).length })
|
|
8371
|
+
]
|
|
8372
|
+
}
|
|
8373
|
+
),
|
|
8374
|
+
enableSearch && /* @__PURE__ */ jsx49("div", { className: "flex-1", children: /* @__PURE__ */ jsx49(
|
|
8375
|
+
Search_default,
|
|
8376
|
+
{
|
|
8377
|
+
value: searchQuery,
|
|
8378
|
+
onSearch: handleSearchChange,
|
|
8379
|
+
onClear: () => handleSearchChange(""),
|
|
8380
|
+
options: [],
|
|
8381
|
+
placeholder: searchPlaceholder
|
|
8382
|
+
}
|
|
8383
|
+
) })
|
|
8384
|
+
] });
|
|
8385
|
+
const table = /* @__PURE__ */ jsx49("div", { className: "w-full overflow-x-auto", children: /* @__PURE__ */ jsxs38(
|
|
8386
|
+
Table_default,
|
|
8387
|
+
{
|
|
8388
|
+
variant,
|
|
8389
|
+
searchTerm: enableSearch ? searchQuery : void 0,
|
|
8390
|
+
noSearchResultImage,
|
|
8391
|
+
children: [
|
|
8392
|
+
/* @__PURE__ */ jsx49("thead", { children: /* @__PURE__ */ jsx49(
|
|
8393
|
+
TableRow,
|
|
8394
|
+
{
|
|
8395
|
+
variant: variant === "borderless" ? "defaultBorderless" : "default",
|
|
8396
|
+
children: headers.map((header, index) => /* @__PURE__ */ jsx49(
|
|
8397
|
+
TableHead,
|
|
8398
|
+
{
|
|
8399
|
+
sortable: enableTableSort && header.sortable,
|
|
8400
|
+
sortDirection: enableTableSort && sortColumn === header.key ? sortDirection : null,
|
|
8401
|
+
onSort: () => enableTableSort && header.sortable && handleSort(header.key),
|
|
8402
|
+
className: header.className,
|
|
8403
|
+
style: header.width ? { width: header.width } : void 0,
|
|
8404
|
+
children: header.label
|
|
8405
|
+
},
|
|
8406
|
+
`header-${header.key}-${index}`
|
|
8407
|
+
))
|
|
8408
|
+
}
|
|
8409
|
+
) }),
|
|
8410
|
+
/* @__PURE__ */ jsx49(TableBody, { children: loading ? /* @__PURE__ */ jsx49(TableRow, { children: /* @__PURE__ */ jsx49(TableCell, { colSpan: headers.length, className: "text-center py-8", children: /* @__PURE__ */ jsx49("span", { className: "text-text-400 text-sm", children: "Carregando..." }) }) }) : displayData.map((row, rowIndex) => {
|
|
8411
|
+
const effectiveIndex = useInternalPagination ? (currentPage - 1) * itemsPerPage + rowIndex : rowIndex;
|
|
8412
|
+
const rowKeyValue = rowKey ? (() => {
|
|
8413
|
+
const keyValue = row[rowKey];
|
|
8414
|
+
if (keyValue === null || keyValue === void 0) {
|
|
8415
|
+
return `row-${effectiveIndex}`;
|
|
8416
|
+
}
|
|
8417
|
+
if (typeof keyValue === "object") {
|
|
8418
|
+
return JSON.stringify(keyValue);
|
|
8419
|
+
}
|
|
8420
|
+
return String(keyValue);
|
|
8421
|
+
})() : `row-${effectiveIndex}`;
|
|
8422
|
+
return /* @__PURE__ */ jsx49(
|
|
8423
|
+
TableRow,
|
|
8424
|
+
{
|
|
8425
|
+
variant: variant === "borderless" ? "defaultBorderless" : "default",
|
|
8426
|
+
clickable: enableRowClick,
|
|
8427
|
+
onClick: () => handleRowClickInternal(row, effectiveIndex),
|
|
8428
|
+
children: headers.map((header, cellIndex) => {
|
|
8429
|
+
const value = row[header.key];
|
|
8430
|
+
let defaultContent = "";
|
|
8431
|
+
if (value !== null && value !== void 0) {
|
|
8432
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") {
|
|
8433
|
+
defaultContent = String(value);
|
|
8434
|
+
} else if (typeof value === "object") {
|
|
8435
|
+
defaultContent = JSON.stringify(value);
|
|
8436
|
+
} else if (typeof value === "function") {
|
|
8437
|
+
defaultContent = "[Function]";
|
|
8438
|
+
} else if (typeof value === "symbol") {
|
|
8439
|
+
defaultContent = String(value);
|
|
8440
|
+
}
|
|
8441
|
+
}
|
|
8442
|
+
const content = header.render ? header.render(value, row, effectiveIndex) : defaultContent;
|
|
8443
|
+
return /* @__PURE__ */ jsx49(
|
|
8444
|
+
TableCell,
|
|
8445
|
+
{
|
|
8446
|
+
className: header.className,
|
|
8447
|
+
style: {
|
|
8448
|
+
textAlign: header.align
|
|
8449
|
+
},
|
|
8450
|
+
children: content
|
|
8451
|
+
},
|
|
8452
|
+
`cell-${effectiveIndex}-${cellIndex}`
|
|
8453
|
+
);
|
|
8454
|
+
})
|
|
8455
|
+
},
|
|
8456
|
+
rowKeyValue
|
|
8457
|
+
);
|
|
8458
|
+
}) })
|
|
8459
|
+
]
|
|
8460
|
+
}
|
|
8461
|
+
) });
|
|
8462
|
+
const pagination = enablePagination && !isEmpty && /* @__PURE__ */ jsx49("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx49(
|
|
8463
|
+
TablePagination_default,
|
|
8464
|
+
{
|
|
8465
|
+
currentPage,
|
|
8466
|
+
totalPages: calculatedTotalPages,
|
|
8467
|
+
totalItems: calculatedTotalItems,
|
|
8468
|
+
itemsPerPage,
|
|
8469
|
+
itemsPerPageOptions,
|
|
8470
|
+
onPageChange: handlePageChange,
|
|
8471
|
+
onItemsPerPageChange: handleItemsPerPageChange,
|
|
8472
|
+
itemLabel
|
|
8473
|
+
}
|
|
8474
|
+
) });
|
|
8475
|
+
if (children) {
|
|
8476
|
+
return /* @__PURE__ */ jsxs38(Fragment7, { children: [
|
|
8477
|
+
children({ controls, table, pagination }),
|
|
8478
|
+
enableFilters && /* @__PURE__ */ jsx49(
|
|
8479
|
+
FilterModal,
|
|
8480
|
+
{
|
|
8481
|
+
isOpen: isFilterModalOpen,
|
|
8482
|
+
onClose: () => setIsFilterModalOpen(false),
|
|
8483
|
+
filterConfigs,
|
|
8484
|
+
onFiltersChange: updateFilters,
|
|
8485
|
+
onApply: handleFilterApply,
|
|
8486
|
+
onClear: clearFilters
|
|
8487
|
+
}
|
|
8488
|
+
)
|
|
8489
|
+
] });
|
|
8490
|
+
}
|
|
8491
|
+
return /* @__PURE__ */ jsxs38("div", { className: "w-full space-y-4", children: [
|
|
8492
|
+
controls,
|
|
8493
|
+
table,
|
|
8494
|
+
pagination,
|
|
8495
|
+
enableFilters && /* @__PURE__ */ jsx49(
|
|
8496
|
+
FilterModal,
|
|
8497
|
+
{
|
|
8498
|
+
isOpen: isFilterModalOpen,
|
|
8499
|
+
onClose: () => setIsFilterModalOpen(false),
|
|
8500
|
+
filterConfigs,
|
|
8501
|
+
onFiltersChange: updateFilters,
|
|
8502
|
+
onApply: handleFilterApply,
|
|
8503
|
+
onClear: clearFilters
|
|
8504
|
+
}
|
|
8505
|
+
)
|
|
8506
|
+
] });
|
|
8507
|
+
}
|
|
8508
|
+
var TableProvider_default = TableProvider;
|
|
8509
|
+
|
|
8223
8510
|
// src/components/Select/Select.tsx
|
|
8224
8511
|
import { create as create8, useStore as useStore4 } from "zustand";
|
|
8225
8512
|
import {
|
|
8226
|
-
useEffect as
|
|
8513
|
+
useEffect as useEffect19,
|
|
8227
8514
|
useRef as useRef8,
|
|
8228
8515
|
forwardRef as forwardRef15,
|
|
8229
8516
|
isValidElement as isValidElement5,
|
|
@@ -8232,7 +8519,7 @@ import {
|
|
|
8232
8519
|
useId as useId8
|
|
8233
8520
|
} from "react";
|
|
8234
8521
|
import { CaretDown as CaretDown3, Check as Check4, WarningCircle as WarningCircle5 } from "phosphor-react";
|
|
8235
|
-
import { Fragment as
|
|
8522
|
+
import { Fragment as Fragment8, jsx as jsx50, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
8236
8523
|
var VARIANT_CLASSES4 = {
|
|
8237
8524
|
outlined: "border-2 rounded-lg focus:border-primary-950",
|
|
8238
8525
|
underlined: "border-b-2 focus:border-primary-950",
|
|
@@ -8292,7 +8579,7 @@ function getLabelAsNode(children) {
|
|
|
8292
8579
|
}
|
|
8293
8580
|
const flattened = Children5.toArray(children);
|
|
8294
8581
|
if (flattened.length === 1) return flattened[0];
|
|
8295
|
-
return /* @__PURE__ */
|
|
8582
|
+
return /* @__PURE__ */ jsx50(Fragment8, { children: flattened });
|
|
8296
8583
|
}
|
|
8297
8584
|
var injectStore4 = (children, store, size, selectId) => {
|
|
8298
8585
|
return Children5.map(children, (child) => {
|
|
@@ -8354,13 +8641,13 @@ var Select = ({
|
|
|
8354
8641
|
search(children2);
|
|
8355
8642
|
return found;
|
|
8356
8643
|
};
|
|
8357
|
-
|
|
8644
|
+
useEffect19(() => {
|
|
8358
8645
|
if (!selectedLabel && defaultValue) {
|
|
8359
8646
|
const label2 = findLabelForValue(children, defaultValue);
|
|
8360
8647
|
if (label2) store.setState({ selectedLabel: label2 });
|
|
8361
8648
|
}
|
|
8362
8649
|
}, [children, defaultValue, selectedLabel]);
|
|
8363
|
-
|
|
8650
|
+
useEffect19(() => {
|
|
8364
8651
|
const handleClickOutside = (event) => {
|
|
8365
8652
|
if (selectRef.current && !selectRef.current.contains(event.target)) {
|
|
8366
8653
|
setOpen(false);
|
|
@@ -8395,7 +8682,7 @@ var Select = ({
|
|
|
8395
8682
|
document.removeEventListener("keydown", handleArrowKeys);
|
|
8396
8683
|
};
|
|
8397
8684
|
}, [open]);
|
|
8398
|
-
|
|
8685
|
+
useEffect19(() => {
|
|
8399
8686
|
if (propValue) {
|
|
8400
8687
|
setValue(propValue);
|
|
8401
8688
|
const label2 = findLabelForValue(children, propValue);
|
|
@@ -8403,8 +8690,8 @@ var Select = ({
|
|
|
8403
8690
|
}
|
|
8404
8691
|
}, [propValue]);
|
|
8405
8692
|
const sizeClasses = SIZE_CLASSES12[size];
|
|
8406
|
-
return /* @__PURE__ */
|
|
8407
|
-
label && /* @__PURE__ */
|
|
8693
|
+
return /* @__PURE__ */ jsxs39("div", { className: cn("w-full", className), children: [
|
|
8694
|
+
label && /* @__PURE__ */ jsx50(
|
|
8408
8695
|
"label",
|
|
8409
8696
|
{
|
|
8410
8697
|
htmlFor: selectId,
|
|
@@ -8412,11 +8699,11 @@ var Select = ({
|
|
|
8412
8699
|
children: label
|
|
8413
8700
|
}
|
|
8414
8701
|
),
|
|
8415
|
-
/* @__PURE__ */
|
|
8416
|
-
(helperText || errorMessage) && /* @__PURE__ */
|
|
8417
|
-
helperText && /* @__PURE__ */
|
|
8418
|
-
errorMessage && /* @__PURE__ */
|
|
8419
|
-
/* @__PURE__ */
|
|
8702
|
+
/* @__PURE__ */ jsx50("div", { className: cn("relative w-full"), ref: selectRef, children: injectStore4(children, store, size, selectId) }),
|
|
8703
|
+
(helperText || errorMessage) && /* @__PURE__ */ jsxs39("div", { className: "mt-1.5 gap-1.5", children: [
|
|
8704
|
+
helperText && /* @__PURE__ */ jsx50("p", { className: "text-sm text-text-500", children: helperText }),
|
|
8705
|
+
errorMessage && /* @__PURE__ */ jsxs39("p", { className: "flex gap-1 items-center text-sm text-indicator-error", children: [
|
|
8706
|
+
/* @__PURE__ */ jsx50(WarningCircle5, { size: 16 }),
|
|
8420
8707
|
" ",
|
|
8421
8708
|
errorMessage
|
|
8422
8709
|
] })
|
|
@@ -8430,7 +8717,7 @@ var SelectValue = ({
|
|
|
8430
8717
|
const store = useSelectStore(externalStore);
|
|
8431
8718
|
const selectedLabel = useStore4(store, (s) => s.selectedLabel);
|
|
8432
8719
|
const value = useStore4(store, (s) => s.value);
|
|
8433
|
-
return /* @__PURE__ */
|
|
8720
|
+
return /* @__PURE__ */ jsx50("span", { className: "text-inherit flex gap-2 items-center", children: selectedLabel || placeholder || value });
|
|
8434
8721
|
};
|
|
8435
8722
|
var SelectTrigger = forwardRef15(
|
|
8436
8723
|
({
|
|
@@ -8449,7 +8736,7 @@ var SelectTrigger = forwardRef15(
|
|
|
8449
8736
|
const variantClasses = VARIANT_CLASSES4[variant];
|
|
8450
8737
|
const heightClasses = HEIGHT_CLASSES[size];
|
|
8451
8738
|
const paddingClasses = PADDING_CLASSES[size];
|
|
8452
|
-
return /* @__PURE__ */
|
|
8739
|
+
return /* @__PURE__ */ jsxs39(
|
|
8453
8740
|
"button",
|
|
8454
8741
|
{
|
|
8455
8742
|
ref,
|
|
@@ -8471,7 +8758,7 @@ var SelectTrigger = forwardRef15(
|
|
|
8471
8758
|
...props,
|
|
8472
8759
|
children: [
|
|
8473
8760
|
props.children,
|
|
8474
|
-
/* @__PURE__ */
|
|
8761
|
+
/* @__PURE__ */ jsx50(
|
|
8475
8762
|
CaretDown3,
|
|
8476
8763
|
{
|
|
8477
8764
|
className: cn(
|
|
@@ -8499,7 +8786,7 @@ var SelectContent = forwardRef15(
|
|
|
8499
8786
|
const open = useStore4(store, (s) => s.open);
|
|
8500
8787
|
if (!open) return null;
|
|
8501
8788
|
const getPositionClasses = () => `w-full min-w-full absolute ${SIDE_CLASSES2[side]} ${ALIGN_CLASSES2[align]}`;
|
|
8502
|
-
return /* @__PURE__ */
|
|
8789
|
+
return /* @__PURE__ */ jsx50(
|
|
8503
8790
|
"div",
|
|
8504
8791
|
{
|
|
8505
8792
|
role: "menu",
|
|
@@ -8543,7 +8830,7 @@ var SelectItem = forwardRef15(
|
|
|
8543
8830
|
}
|
|
8544
8831
|
props.onClick?.(e);
|
|
8545
8832
|
};
|
|
8546
|
-
return /* @__PURE__ */
|
|
8833
|
+
return /* @__PURE__ */ jsxs39(
|
|
8547
8834
|
"div",
|
|
8548
8835
|
{
|
|
8549
8836
|
role: "menuitem",
|
|
@@ -8563,7 +8850,7 @@ var SelectItem = forwardRef15(
|
|
|
8563
8850
|
tabIndex: disabled ? -1 : 0,
|
|
8564
8851
|
...props,
|
|
8565
8852
|
children: [
|
|
8566
|
-
/* @__PURE__ */
|
|
8853
|
+
/* @__PURE__ */ jsx50("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: selectedValue === value && /* @__PURE__ */ jsx50(Check4, { className: "" }) }),
|
|
8567
8854
|
children
|
|
8568
8855
|
]
|
|
8569
8856
|
}
|
|
@@ -8576,16 +8863,16 @@ var Select_default = Select;
|
|
|
8576
8863
|
// src/components/Menu/Menu.tsx
|
|
8577
8864
|
import { create as create9, useStore as useStore5 } from "zustand";
|
|
8578
8865
|
import {
|
|
8579
|
-
useEffect as
|
|
8866
|
+
useEffect as useEffect20,
|
|
8580
8867
|
useRef as useRef9,
|
|
8581
8868
|
forwardRef as forwardRef16,
|
|
8582
8869
|
isValidElement as isValidElement6,
|
|
8583
8870
|
Children as Children6,
|
|
8584
8871
|
cloneElement as cloneElement6,
|
|
8585
|
-
useState as
|
|
8872
|
+
useState as useState18
|
|
8586
8873
|
} from "react";
|
|
8587
8874
|
import { CaretLeft as CaretLeft4, CaretRight as CaretRight5 } from "phosphor-react";
|
|
8588
|
-
import { jsx as
|
|
8875
|
+
import { jsx as jsx51, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
8589
8876
|
var createMenuStore = (onValueChange) => create9((set) => ({
|
|
8590
8877
|
value: "",
|
|
8591
8878
|
setValue: (value) => {
|
|
@@ -8618,12 +8905,12 @@ var Menu = forwardRef16(
|
|
|
8618
8905
|
storeRef.current ??= createMenuStore(onValueChange);
|
|
8619
8906
|
const store = storeRef.current;
|
|
8620
8907
|
const { setValue } = useStore5(store, (s) => s);
|
|
8621
|
-
|
|
8908
|
+
useEffect20(() => {
|
|
8622
8909
|
setValue(propValue ?? defaultValue);
|
|
8623
8910
|
}, [defaultValue, propValue, setValue]);
|
|
8624
8911
|
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";
|
|
8625
8912
|
const variantClasses = VARIANT_CLASSES5[variant];
|
|
8626
|
-
return /* @__PURE__ */
|
|
8913
|
+
return /* @__PURE__ */ jsx51(
|
|
8627
8914
|
"div",
|
|
8628
8915
|
{
|
|
8629
8916
|
ref,
|
|
@@ -8643,7 +8930,7 @@ var MenuContent = forwardRef16(
|
|
|
8643
8930
|
({ className, children, variant = "menu", ...props }, ref) => {
|
|
8644
8931
|
const baseClasses = "w-full flex flex-row items-center gap-2";
|
|
8645
8932
|
const variantClasses = variant === "menu2" || variant === "menu-overflow" ? "overflow-x-auto scroll-smooth" : "";
|
|
8646
|
-
return /* @__PURE__ */
|
|
8933
|
+
return /* @__PURE__ */ jsx51(
|
|
8647
8934
|
"ul",
|
|
8648
8935
|
{
|
|
8649
8936
|
ref,
|
|
@@ -8695,7 +8982,7 @@ var MenuItem = forwardRef16(
|
|
|
8695
8982
|
...props
|
|
8696
8983
|
};
|
|
8697
8984
|
const variants = {
|
|
8698
|
-
menu: /* @__PURE__ */
|
|
8985
|
+
menu: /* @__PURE__ */ jsx51(
|
|
8699
8986
|
"li",
|
|
8700
8987
|
{
|
|
8701
8988
|
"data-variant": "menu",
|
|
@@ -8710,7 +8997,7 @@ var MenuItem = forwardRef16(
|
|
|
8710
8997
|
children
|
|
8711
8998
|
}
|
|
8712
8999
|
),
|
|
8713
|
-
menu2: /* @__PURE__ */
|
|
9000
|
+
menu2: /* @__PURE__ */ jsxs40(
|
|
8714
9001
|
"li",
|
|
8715
9002
|
{
|
|
8716
9003
|
"data-variant": "menu2",
|
|
@@ -8721,7 +9008,7 @@ var MenuItem = forwardRef16(
|
|
|
8721
9008
|
`,
|
|
8722
9009
|
...commonProps,
|
|
8723
9010
|
children: [
|
|
8724
|
-
/* @__PURE__ */
|
|
9011
|
+
/* @__PURE__ */ jsx51(
|
|
8725
9012
|
"span",
|
|
8726
9013
|
{
|
|
8727
9014
|
className: cn(
|
|
@@ -8731,11 +9018,11 @@ var MenuItem = forwardRef16(
|
|
|
8731
9018
|
children
|
|
8732
9019
|
}
|
|
8733
9020
|
),
|
|
8734
|
-
selectedValue === value && /* @__PURE__ */
|
|
9021
|
+
selectedValue === value && /* @__PURE__ */ jsx51("div", { className: "h-1 w-full bg-primary-950 rounded-lg" })
|
|
8735
9022
|
]
|
|
8736
9023
|
}
|
|
8737
9024
|
),
|
|
8738
|
-
"menu-overflow": /* @__PURE__ */
|
|
9025
|
+
"menu-overflow": /* @__PURE__ */ jsxs40(
|
|
8739
9026
|
"li",
|
|
8740
9027
|
{
|
|
8741
9028
|
"data-variant": "menu-overflow",
|
|
@@ -8746,7 +9033,7 @@ var MenuItem = forwardRef16(
|
|
|
8746
9033
|
`,
|
|
8747
9034
|
...commonProps,
|
|
8748
9035
|
children: [
|
|
8749
|
-
/* @__PURE__ */
|
|
9036
|
+
/* @__PURE__ */ jsx51(
|
|
8750
9037
|
"span",
|
|
8751
9038
|
{
|
|
8752
9039
|
className: cn(
|
|
@@ -8756,11 +9043,11 @@ var MenuItem = forwardRef16(
|
|
|
8756
9043
|
children
|
|
8757
9044
|
}
|
|
8758
9045
|
),
|
|
8759
|
-
selectedValue === value && /* @__PURE__ */
|
|
9046
|
+
selectedValue === value && /* @__PURE__ */ jsx51("div", { className: "h-1 w-full bg-primary-950 rounded-lg" })
|
|
8760
9047
|
]
|
|
8761
9048
|
}
|
|
8762
9049
|
),
|
|
8763
|
-
breadcrumb: /* @__PURE__ */
|
|
9050
|
+
breadcrumb: /* @__PURE__ */ jsxs40(
|
|
8764
9051
|
"li",
|
|
8765
9052
|
{
|
|
8766
9053
|
"data-variant": "breadcrumb",
|
|
@@ -8772,7 +9059,7 @@ var MenuItem = forwardRef16(
|
|
|
8772
9059
|
`,
|
|
8773
9060
|
...commonProps,
|
|
8774
9061
|
children: [
|
|
8775
|
-
/* @__PURE__ */
|
|
9062
|
+
/* @__PURE__ */ jsx51(
|
|
8776
9063
|
"span",
|
|
8777
9064
|
{
|
|
8778
9065
|
className: cn(
|
|
@@ -8782,7 +9069,7 @@ var MenuItem = forwardRef16(
|
|
|
8782
9069
|
children
|
|
8783
9070
|
}
|
|
8784
9071
|
),
|
|
8785
|
-
separator && /* @__PURE__ */
|
|
9072
|
+
separator && /* @__PURE__ */ jsx51(
|
|
8786
9073
|
CaretRight5,
|
|
8787
9074
|
{
|
|
8788
9075
|
size: 16,
|
|
@@ -8820,9 +9107,9 @@ var MenuOverflow = ({
|
|
|
8820
9107
|
...props
|
|
8821
9108
|
}) => {
|
|
8822
9109
|
const containerRef = useRef9(null);
|
|
8823
|
-
const [showLeftArrow, setShowLeftArrow] =
|
|
8824
|
-
const [showRightArrow, setShowRightArrow] =
|
|
8825
|
-
|
|
9110
|
+
const [showLeftArrow, setShowLeftArrow] = useState18(false);
|
|
9111
|
+
const [showRightArrow, setShowRightArrow] = useState18(false);
|
|
9112
|
+
useEffect20(() => {
|
|
8826
9113
|
const checkScroll = () => internalCheckScroll(
|
|
8827
9114
|
containerRef.current,
|
|
8828
9115
|
setShowLeftArrow,
|
|
@@ -8837,25 +9124,25 @@ var MenuOverflow = ({
|
|
|
8837
9124
|
window.removeEventListener("resize", checkScroll);
|
|
8838
9125
|
};
|
|
8839
9126
|
}, []);
|
|
8840
|
-
return /* @__PURE__ */
|
|
9127
|
+
return /* @__PURE__ */ jsxs40(
|
|
8841
9128
|
"div",
|
|
8842
9129
|
{
|
|
8843
9130
|
"data-testid": "menu-overflow-wrapper",
|
|
8844
9131
|
className: cn("relative w-full overflow-hidden", className),
|
|
8845
9132
|
children: [
|
|
8846
|
-
showLeftArrow && /* @__PURE__ */
|
|
9133
|
+
showLeftArrow && /* @__PURE__ */ jsxs40(
|
|
8847
9134
|
"button",
|
|
8848
9135
|
{
|
|
8849
9136
|
onClick: () => internalScroll(containerRef.current, "left"),
|
|
8850
9137
|
className: "absolute left-0 top-1/2 -translate-y-1/2 z-10 flex h-8 w-8 items-center justify-center rounded-full bg-white shadow-md cursor-pointer",
|
|
8851
9138
|
"data-testid": "scroll-left-button",
|
|
8852
9139
|
children: [
|
|
8853
|
-
/* @__PURE__ */
|
|
8854
|
-
/* @__PURE__ */
|
|
9140
|
+
/* @__PURE__ */ jsx51(CaretLeft4, { size: 16 }),
|
|
9141
|
+
/* @__PURE__ */ jsx51("span", { className: "sr-only", children: "Scroll left" })
|
|
8855
9142
|
]
|
|
8856
9143
|
}
|
|
8857
9144
|
),
|
|
8858
|
-
/* @__PURE__ */
|
|
9145
|
+
/* @__PURE__ */ jsx51(
|
|
8859
9146
|
Menu,
|
|
8860
9147
|
{
|
|
8861
9148
|
defaultValue,
|
|
@@ -8863,18 +9150,18 @@ var MenuOverflow = ({
|
|
|
8863
9150
|
value,
|
|
8864
9151
|
variant: "menu2",
|
|
8865
9152
|
...props,
|
|
8866
|
-
children: /* @__PURE__ */
|
|
9153
|
+
children: /* @__PURE__ */ jsx51(MenuContent, { ref: containerRef, variant: "menu2", children })
|
|
8867
9154
|
}
|
|
8868
9155
|
),
|
|
8869
|
-
showRightArrow && /* @__PURE__ */
|
|
9156
|
+
showRightArrow && /* @__PURE__ */ jsxs40(
|
|
8870
9157
|
"button",
|
|
8871
9158
|
{
|
|
8872
9159
|
onClick: () => internalScroll(containerRef.current, "right"),
|
|
8873
9160
|
className: "absolute right-0 top-1/2 -translate-y-1/2 z-10 flex h-8 w-8 items-center justify-center rounded-full bg-white shadow-md cursor-pointer",
|
|
8874
9161
|
"data-testid": "scroll-right-button",
|
|
8875
9162
|
children: [
|
|
8876
|
-
/* @__PURE__ */
|
|
8877
|
-
/* @__PURE__ */
|
|
9163
|
+
/* @__PURE__ */ jsx51(CaretRight5, { size: 16 }),
|
|
9164
|
+
/* @__PURE__ */ jsx51("span", { className: "sr-only", children: "Scroll right" })
|
|
8878
9165
|
]
|
|
8879
9166
|
}
|
|
8880
9167
|
)
|
|
@@ -8896,10 +9183,10 @@ var Menu_default = Menu;
|
|
|
8896
9183
|
// src/components/Card/Card.tsx
|
|
8897
9184
|
import {
|
|
8898
9185
|
forwardRef as forwardRef17,
|
|
8899
|
-
Fragment as
|
|
8900
|
-
useState as
|
|
9186
|
+
Fragment as Fragment9,
|
|
9187
|
+
useState as useState19,
|
|
8901
9188
|
useRef as useRef10,
|
|
8902
|
-
useEffect as
|
|
9189
|
+
useEffect as useEffect21
|
|
8903
9190
|
} from "react";
|
|
8904
9191
|
import {
|
|
8905
9192
|
CaretRight as CaretRight6,
|
|
@@ -8917,7 +9204,7 @@ import {
|
|
|
8917
9204
|
// src/components/IconRender/IconRender.tsx
|
|
8918
9205
|
import { cloneElement as cloneElement7 } from "react";
|
|
8919
9206
|
import * as PhosphorIcons from "phosphor-react";
|
|
8920
|
-
import { jsx as
|
|
9207
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
8921
9208
|
var IconRender = ({
|
|
8922
9209
|
iconName,
|
|
8923
9210
|
color = "#000000",
|
|
@@ -8927,14 +9214,14 @@ var IconRender = ({
|
|
|
8927
9214
|
if (typeof iconName === "string") {
|
|
8928
9215
|
switch (iconName) {
|
|
8929
9216
|
case "Chat_PT":
|
|
8930
|
-
return /* @__PURE__ */
|
|
9217
|
+
return /* @__PURE__ */ jsx52(ChatPT, { size, color });
|
|
8931
9218
|
case "Chat_EN":
|
|
8932
|
-
return /* @__PURE__ */
|
|
9219
|
+
return /* @__PURE__ */ jsx52(ChatEN, { size, color });
|
|
8933
9220
|
case "Chat_ES":
|
|
8934
|
-
return /* @__PURE__ */
|
|
9221
|
+
return /* @__PURE__ */ jsx52(ChatES, { size, color });
|
|
8935
9222
|
default: {
|
|
8936
9223
|
const IconComponent = PhosphorIcons[iconName] || PhosphorIcons.Question;
|
|
8937
|
-
return /* @__PURE__ */
|
|
9224
|
+
return /* @__PURE__ */ jsx52(IconComponent, { size, color, weight });
|
|
8938
9225
|
}
|
|
8939
9226
|
}
|
|
8940
9227
|
} else {
|
|
@@ -8947,7 +9234,7 @@ var IconRender = ({
|
|
|
8947
9234
|
var IconRender_default = IconRender;
|
|
8948
9235
|
|
|
8949
9236
|
// src/components/Card/Card.tsx
|
|
8950
|
-
import { Fragment as
|
|
9237
|
+
import { Fragment as Fragment10, jsx as jsx53, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
8951
9238
|
var CARD_BASE_CLASSES = {
|
|
8952
9239
|
default: "w-full bg-background border border-border-50 rounded-xl",
|
|
8953
9240
|
compact: "w-full bg-background border border-border-50 rounded-lg",
|
|
@@ -8989,7 +9276,7 @@ var CardBase = forwardRef17(
|
|
|
8989
9276
|
const minHeightClasses = CARD_MIN_HEIGHT_CLASSES[minHeight];
|
|
8990
9277
|
const layoutClasses = CARD_LAYOUT_CLASSES[layout];
|
|
8991
9278
|
const cursorClasses = CARD_CURSOR_CLASSES[cursor];
|
|
8992
|
-
return /* @__PURE__ */
|
|
9279
|
+
return /* @__PURE__ */ jsx53(
|
|
8993
9280
|
"div",
|
|
8994
9281
|
{
|
|
8995
9282
|
ref,
|
|
@@ -9047,7 +9334,7 @@ var CardActivitiesResults = forwardRef17(
|
|
|
9047
9334
|
const actionIconClasses = ACTION_ICON_CLASSES[action];
|
|
9048
9335
|
const actionSubTitleClasses = ACTION_SUBTITLE_CLASSES[action];
|
|
9049
9336
|
const actionHeaderClasses = ACTION_HEADER_CLASSES[action];
|
|
9050
|
-
return /* @__PURE__ */
|
|
9337
|
+
return /* @__PURE__ */ jsxs41(
|
|
9051
9338
|
"div",
|
|
9052
9339
|
{
|
|
9053
9340
|
ref,
|
|
@@ -9057,7 +9344,7 @@ var CardActivitiesResults = forwardRef17(
|
|
|
9057
9344
|
),
|
|
9058
9345
|
...props,
|
|
9059
9346
|
children: [
|
|
9060
|
-
/* @__PURE__ */
|
|
9347
|
+
/* @__PURE__ */ jsxs41(
|
|
9061
9348
|
"div",
|
|
9062
9349
|
{
|
|
9063
9350
|
className: cn(
|
|
@@ -9066,7 +9353,7 @@ var CardActivitiesResults = forwardRef17(
|
|
|
9066
9353
|
extended ? "rounded-t-xl" : "rounded-xl"
|
|
9067
9354
|
),
|
|
9068
9355
|
children: [
|
|
9069
|
-
/* @__PURE__ */
|
|
9356
|
+
/* @__PURE__ */ jsx53(
|
|
9070
9357
|
"span",
|
|
9071
9358
|
{
|
|
9072
9359
|
className: cn(
|
|
@@ -9076,7 +9363,7 @@ var CardActivitiesResults = forwardRef17(
|
|
|
9076
9363
|
children: icon
|
|
9077
9364
|
}
|
|
9078
9365
|
),
|
|
9079
|
-
/* @__PURE__ */
|
|
9366
|
+
/* @__PURE__ */ jsx53(
|
|
9080
9367
|
Text_default,
|
|
9081
9368
|
{
|
|
9082
9369
|
size: "2xs",
|
|
@@ -9085,7 +9372,7 @@ var CardActivitiesResults = forwardRef17(
|
|
|
9085
9372
|
children: title
|
|
9086
9373
|
}
|
|
9087
9374
|
),
|
|
9088
|
-
/* @__PURE__ */
|
|
9375
|
+
/* @__PURE__ */ jsx53(
|
|
9089
9376
|
"p",
|
|
9090
9377
|
{
|
|
9091
9378
|
className: cn("text-lg font-bold truncate", actionSubTitleClasses),
|
|
@@ -9095,8 +9382,8 @@ var CardActivitiesResults = forwardRef17(
|
|
|
9095
9382
|
]
|
|
9096
9383
|
}
|
|
9097
9384
|
),
|
|
9098
|
-
extended && /* @__PURE__ */
|
|
9099
|
-
/* @__PURE__ */
|
|
9385
|
+
extended && /* @__PURE__ */ jsxs41("div", { className: "flex flex-col items-center gap-2.5 pb-9.5 pt-2.5", children: [
|
|
9386
|
+
/* @__PURE__ */ jsx53(
|
|
9100
9387
|
"p",
|
|
9101
9388
|
{
|
|
9102
9389
|
className: cn(
|
|
@@ -9106,7 +9393,7 @@ var CardActivitiesResults = forwardRef17(
|
|
|
9106
9393
|
children: header
|
|
9107
9394
|
}
|
|
9108
9395
|
),
|
|
9109
|
-
/* @__PURE__ */
|
|
9396
|
+
/* @__PURE__ */ jsx53(Badge_default, { size: "large", action: "info", children: description })
|
|
9110
9397
|
] })
|
|
9111
9398
|
]
|
|
9112
9399
|
}
|
|
@@ -9125,7 +9412,7 @@ var CardQuestions = forwardRef17(
|
|
|
9125
9412
|
const isDone = state === "done";
|
|
9126
9413
|
const stateLabel = isDone ? "Realizado" : "N\xE3o Realizado";
|
|
9127
9414
|
const buttonLabel = isDone ? "Ver Resultado" : "Responder";
|
|
9128
|
-
return /* @__PURE__ */
|
|
9415
|
+
return /* @__PURE__ */ jsxs41(
|
|
9129
9416
|
CardBase,
|
|
9130
9417
|
{
|
|
9131
9418
|
ref,
|
|
@@ -9135,9 +9422,9 @@ var CardQuestions = forwardRef17(
|
|
|
9135
9422
|
className: cn("justify-between gap-4", className),
|
|
9136
9423
|
...props,
|
|
9137
9424
|
children: [
|
|
9138
|
-
/* @__PURE__ */
|
|
9139
|
-
/* @__PURE__ */
|
|
9140
|
-
/* @__PURE__ */
|
|
9425
|
+
/* @__PURE__ */ jsxs41("section", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
|
|
9426
|
+
/* @__PURE__ */ jsx53("p", { className: "font-bold text-xs text-text-950 truncate", children: header }),
|
|
9427
|
+
/* @__PURE__ */ jsx53("div", { className: "flex flex-row gap-6 items-center", children: /* @__PURE__ */ jsx53(
|
|
9141
9428
|
Badge_default,
|
|
9142
9429
|
{
|
|
9143
9430
|
size: "medium",
|
|
@@ -9147,7 +9434,7 @@ var CardQuestions = forwardRef17(
|
|
|
9147
9434
|
}
|
|
9148
9435
|
) })
|
|
9149
9436
|
] }),
|
|
9150
|
-
/* @__PURE__ */
|
|
9437
|
+
/* @__PURE__ */ jsx53("span", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx53(
|
|
9151
9438
|
Button_default,
|
|
9152
9439
|
{
|
|
9153
9440
|
size: "extra-small",
|
|
@@ -9178,19 +9465,19 @@ var CardProgress = forwardRef17(
|
|
|
9178
9465
|
}, ref) => {
|
|
9179
9466
|
const isHorizontal = direction === "horizontal";
|
|
9180
9467
|
const contentComponent = {
|
|
9181
|
-
horizontal: /* @__PURE__ */
|
|
9182
|
-
showDates && /* @__PURE__ */
|
|
9183
|
-
initialDate && /* @__PURE__ */
|
|
9184
|
-
/* @__PURE__ */
|
|
9185
|
-
/* @__PURE__ */
|
|
9468
|
+
horizontal: /* @__PURE__ */ jsxs41(Fragment10, { children: [
|
|
9469
|
+
showDates && /* @__PURE__ */ jsxs41("div", { className: "flex flex-row gap-6 items-center", children: [
|
|
9470
|
+
initialDate && /* @__PURE__ */ jsxs41("span", { className: "flex flex-row gap-1 items-center text-2xs", children: [
|
|
9471
|
+
/* @__PURE__ */ jsx53("p", { className: "text-text-800 font-semibold", children: "In\xEDcio" }),
|
|
9472
|
+
/* @__PURE__ */ jsx53("p", { className: "text-text-600", children: initialDate })
|
|
9186
9473
|
] }),
|
|
9187
|
-
endDate && /* @__PURE__ */
|
|
9188
|
-
/* @__PURE__ */
|
|
9189
|
-
/* @__PURE__ */
|
|
9474
|
+
endDate && /* @__PURE__ */ jsxs41("span", { className: "flex flex-row gap-1 items-center text-2xs", children: [
|
|
9475
|
+
/* @__PURE__ */ jsx53("p", { className: "text-text-800 font-semibold", children: "Fim" }),
|
|
9476
|
+
/* @__PURE__ */ jsx53("p", { className: "text-text-600", children: endDate })
|
|
9190
9477
|
] })
|
|
9191
9478
|
] }),
|
|
9192
|
-
/* @__PURE__ */
|
|
9193
|
-
/* @__PURE__ */
|
|
9479
|
+
/* @__PURE__ */ jsxs41("span", { className: "grid grid-cols-[1fr_auto] items-center gap-2", children: [
|
|
9480
|
+
/* @__PURE__ */ jsx53(
|
|
9194
9481
|
ProgressBar_default,
|
|
9195
9482
|
{
|
|
9196
9483
|
size: "small",
|
|
@@ -9199,7 +9486,7 @@ var CardProgress = forwardRef17(
|
|
|
9199
9486
|
"data-testid": "progress-bar"
|
|
9200
9487
|
}
|
|
9201
9488
|
),
|
|
9202
|
-
/* @__PURE__ */
|
|
9489
|
+
/* @__PURE__ */ jsxs41(
|
|
9203
9490
|
Text_default,
|
|
9204
9491
|
{
|
|
9205
9492
|
size: "xs",
|
|
@@ -9215,9 +9502,9 @@ var CardProgress = forwardRef17(
|
|
|
9215
9502
|
)
|
|
9216
9503
|
] })
|
|
9217
9504
|
] }),
|
|
9218
|
-
vertical: /* @__PURE__ */
|
|
9505
|
+
vertical: /* @__PURE__ */ jsx53("p", { className: "text-sm text-text-800", children: subhead })
|
|
9219
9506
|
};
|
|
9220
|
-
return /* @__PURE__ */
|
|
9507
|
+
return /* @__PURE__ */ jsxs41(
|
|
9221
9508
|
CardBase,
|
|
9222
9509
|
{
|
|
9223
9510
|
ref,
|
|
@@ -9228,7 +9515,7 @@ var CardProgress = forwardRef17(
|
|
|
9228
9515
|
className: cn(isHorizontal ? "h-20" : "", className),
|
|
9229
9516
|
...props,
|
|
9230
9517
|
children: [
|
|
9231
|
-
/* @__PURE__ */
|
|
9518
|
+
/* @__PURE__ */ jsx53(
|
|
9232
9519
|
"div",
|
|
9233
9520
|
{
|
|
9234
9521
|
className: cn(
|
|
@@ -9241,7 +9528,7 @@ var CardProgress = forwardRef17(
|
|
|
9241
9528
|
children: icon
|
|
9242
9529
|
}
|
|
9243
9530
|
),
|
|
9244
|
-
/* @__PURE__ */
|
|
9531
|
+
/* @__PURE__ */ jsxs41(
|
|
9245
9532
|
"div",
|
|
9246
9533
|
{
|
|
9247
9534
|
className: cn(
|
|
@@ -9249,7 +9536,7 @@ var CardProgress = forwardRef17(
|
|
|
9249
9536
|
!isHorizontal && "gap-4"
|
|
9250
9537
|
),
|
|
9251
9538
|
children: [
|
|
9252
|
-
/* @__PURE__ */
|
|
9539
|
+
/* @__PURE__ */ jsx53(Text_default, { size: "sm", weight: "bold", className: "text-text-950 truncate", children: header }),
|
|
9253
9540
|
contentComponent[direction]
|
|
9254
9541
|
]
|
|
9255
9542
|
}
|
|
@@ -9269,7 +9556,7 @@ var CardTopic = forwardRef17(
|
|
|
9269
9556
|
className = "",
|
|
9270
9557
|
...props
|
|
9271
9558
|
}, ref) => {
|
|
9272
|
-
return /* @__PURE__ */
|
|
9559
|
+
return /* @__PURE__ */ jsxs41(
|
|
9273
9560
|
CardBase,
|
|
9274
9561
|
{
|
|
9275
9562
|
ref,
|
|
@@ -9280,13 +9567,13 @@ var CardTopic = forwardRef17(
|
|
|
9280
9567
|
className: cn("justify-center gap-2 py-2 px-4", className),
|
|
9281
9568
|
...props,
|
|
9282
9569
|
children: [
|
|
9283
|
-
subHead && /* @__PURE__ */
|
|
9284
|
-
/* @__PURE__ */
|
|
9285
|
-
index < subHead.length - 1 && /* @__PURE__ */
|
|
9570
|
+
subHead && /* @__PURE__ */ jsx53("span", { className: "text-text-600 text-2xs flex flex-row gap-1", children: subHead.map((text, index) => /* @__PURE__ */ jsxs41(Fragment9, { children: [
|
|
9571
|
+
/* @__PURE__ */ jsx53("p", { children: text }),
|
|
9572
|
+
index < subHead.length - 1 && /* @__PURE__ */ jsx53("p", { children: "\u2022" })
|
|
9286
9573
|
] }, `${text} - ${index}`)) }),
|
|
9287
|
-
/* @__PURE__ */
|
|
9288
|
-
/* @__PURE__ */
|
|
9289
|
-
/* @__PURE__ */
|
|
9574
|
+
/* @__PURE__ */ jsx53("p", { className: "text-sm text-text-950 font-bold truncate", children: header }),
|
|
9575
|
+
/* @__PURE__ */ jsxs41("span", { className: "grid grid-cols-[1fr_auto] items-center gap-2", children: [
|
|
9576
|
+
/* @__PURE__ */ jsx53(
|
|
9290
9577
|
ProgressBar_default,
|
|
9291
9578
|
{
|
|
9292
9579
|
size: "small",
|
|
@@ -9295,7 +9582,7 @@ var CardTopic = forwardRef17(
|
|
|
9295
9582
|
"data-testid": "progress-bar"
|
|
9296
9583
|
}
|
|
9297
9584
|
),
|
|
9298
|
-
showPercentage && /* @__PURE__ */
|
|
9585
|
+
showPercentage && /* @__PURE__ */ jsxs41(
|
|
9299
9586
|
Text_default,
|
|
9300
9587
|
{
|
|
9301
9588
|
size: "xs",
|
|
@@ -9329,7 +9616,7 @@ var CardPerformance = forwardRef17(
|
|
|
9329
9616
|
...props
|
|
9330
9617
|
}, ref) => {
|
|
9331
9618
|
const hasProgress = progress !== void 0;
|
|
9332
|
-
return /* @__PURE__ */
|
|
9619
|
+
return /* @__PURE__ */ jsxs41(
|
|
9333
9620
|
CardBase,
|
|
9334
9621
|
{
|
|
9335
9622
|
ref,
|
|
@@ -9343,10 +9630,10 @@ var CardPerformance = forwardRef17(
|
|
|
9343
9630
|
onClick: () => actionVariant == "caret" && onClickButton?.(valueButton),
|
|
9344
9631
|
...props,
|
|
9345
9632
|
children: [
|
|
9346
|
-
/* @__PURE__ */
|
|
9347
|
-
/* @__PURE__ */
|
|
9348
|
-
/* @__PURE__ */
|
|
9349
|
-
actionVariant === "button" && /* @__PURE__ */
|
|
9633
|
+
/* @__PURE__ */ jsxs41("div", { className: "w-full flex flex-col justify-between gap-2", children: [
|
|
9634
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex flex-row justify-between items-center gap-2", children: [
|
|
9635
|
+
/* @__PURE__ */ jsx53("p", { className: "text-lg font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
|
|
9636
|
+
actionVariant === "button" && /* @__PURE__ */ jsx53(
|
|
9350
9637
|
Button_default,
|
|
9351
9638
|
{
|
|
9352
9639
|
variant: "outline",
|
|
@@ -9357,16 +9644,16 @@ var CardPerformance = forwardRef17(
|
|
|
9357
9644
|
}
|
|
9358
9645
|
)
|
|
9359
9646
|
] }),
|
|
9360
|
-
/* @__PURE__ */
|
|
9647
|
+
/* @__PURE__ */ jsx53("div", { className: "w-full", children: hasProgress ? /* @__PURE__ */ jsx53(
|
|
9361
9648
|
ProgressBar_default,
|
|
9362
9649
|
{
|
|
9363
9650
|
value: progress,
|
|
9364
9651
|
label: `${progress}% ${labelProgress}`,
|
|
9365
9652
|
variant: progressVariant
|
|
9366
9653
|
}
|
|
9367
|
-
) : /* @__PURE__ */
|
|
9654
|
+
) : /* @__PURE__ */ jsx53("p", { className: "text-xs text-text-600 truncate", children: description }) })
|
|
9368
9655
|
] }),
|
|
9369
|
-
actionVariant == "caret" && /* @__PURE__ */
|
|
9656
|
+
actionVariant == "caret" && /* @__PURE__ */ jsx53(
|
|
9370
9657
|
CaretRight6,
|
|
9371
9658
|
{
|
|
9372
9659
|
className: "size-4.5 text-text-800 cursor-pointer",
|
|
@@ -9390,7 +9677,7 @@ var CardResults = forwardRef17(
|
|
|
9390
9677
|
...props
|
|
9391
9678
|
}, ref) => {
|
|
9392
9679
|
const isRow = direction == "row";
|
|
9393
|
-
return /* @__PURE__ */
|
|
9680
|
+
return /* @__PURE__ */ jsxs41(
|
|
9394
9681
|
CardBase,
|
|
9395
9682
|
{
|
|
9396
9683
|
ref,
|
|
@@ -9400,7 +9687,7 @@ var CardResults = forwardRef17(
|
|
|
9400
9687
|
className: cn("items-stretch cursor-pointer pr-4", className),
|
|
9401
9688
|
...props,
|
|
9402
9689
|
children: [
|
|
9403
|
-
/* @__PURE__ */
|
|
9690
|
+
/* @__PURE__ */ jsx53(
|
|
9404
9691
|
"div",
|
|
9405
9692
|
{
|
|
9406
9693
|
className: cn(
|
|
@@ -9409,11 +9696,11 @@ var CardResults = forwardRef17(
|
|
|
9409
9696
|
style: {
|
|
9410
9697
|
backgroundColor: color
|
|
9411
9698
|
},
|
|
9412
|
-
children: /* @__PURE__ */
|
|
9699
|
+
children: /* @__PURE__ */ jsx53(IconRender_default, { iconName: icon, color: "currentColor", size: 20 })
|
|
9413
9700
|
}
|
|
9414
9701
|
),
|
|
9415
|
-
/* @__PURE__ */
|
|
9416
|
-
/* @__PURE__ */
|
|
9702
|
+
/* @__PURE__ */ jsxs41("div", { className: "w-full flex flex-row justify-between items-center", children: [
|
|
9703
|
+
/* @__PURE__ */ jsxs41(
|
|
9417
9704
|
"div",
|
|
9418
9705
|
{
|
|
9419
9706
|
className: cn(
|
|
@@ -9421,28 +9708,28 @@ var CardResults = forwardRef17(
|
|
|
9421
9708
|
isRow ? "flex-row items-center gap-2" : "flex-col"
|
|
9422
9709
|
),
|
|
9423
9710
|
children: [
|
|
9424
|
-
/* @__PURE__ */
|
|
9425
|
-
/* @__PURE__ */
|
|
9426
|
-
/* @__PURE__ */
|
|
9711
|
+
/* @__PURE__ */ jsx53("p", { className: "text-sm font-bold text-text-950 flex-1", children: header }),
|
|
9712
|
+
/* @__PURE__ */ jsxs41("span", { className: "flex flex-wrap flex-row gap-1 items-center", children: [
|
|
9713
|
+
/* @__PURE__ */ jsxs41(
|
|
9427
9714
|
Badge_default,
|
|
9428
9715
|
{
|
|
9429
9716
|
action: "success",
|
|
9430
9717
|
variant: "solid",
|
|
9431
9718
|
size: "large",
|
|
9432
|
-
iconLeft: /* @__PURE__ */
|
|
9719
|
+
iconLeft: /* @__PURE__ */ jsx53(CheckCircle3, {}),
|
|
9433
9720
|
children: [
|
|
9434
9721
|
correct_answers,
|
|
9435
9722
|
" Corretas"
|
|
9436
9723
|
]
|
|
9437
9724
|
}
|
|
9438
9725
|
),
|
|
9439
|
-
/* @__PURE__ */
|
|
9726
|
+
/* @__PURE__ */ jsxs41(
|
|
9440
9727
|
Badge_default,
|
|
9441
9728
|
{
|
|
9442
9729
|
action: "error",
|
|
9443
9730
|
variant: "solid",
|
|
9444
9731
|
size: "large",
|
|
9445
|
-
iconLeft: /* @__PURE__ */
|
|
9732
|
+
iconLeft: /* @__PURE__ */ jsx53(XCircle2, {}),
|
|
9446
9733
|
children: [
|
|
9447
9734
|
incorrect_answers,
|
|
9448
9735
|
" Incorretas"
|
|
@@ -9453,7 +9740,7 @@ var CardResults = forwardRef17(
|
|
|
9453
9740
|
]
|
|
9454
9741
|
}
|
|
9455
9742
|
),
|
|
9456
|
-
/* @__PURE__ */
|
|
9743
|
+
/* @__PURE__ */ jsx53(CaretRight6, { className: "min-w-6 min-h-6 text-text-800" })
|
|
9457
9744
|
] })
|
|
9458
9745
|
]
|
|
9459
9746
|
}
|
|
@@ -9479,13 +9766,13 @@ var CardStatus = forwardRef17(
|
|
|
9479
9766
|
const getIconBadge = (status2) => {
|
|
9480
9767
|
switch (status2) {
|
|
9481
9768
|
case "correct":
|
|
9482
|
-
return /* @__PURE__ */
|
|
9769
|
+
return /* @__PURE__ */ jsx53(CheckCircle3, {});
|
|
9483
9770
|
case "incorrect":
|
|
9484
|
-
return /* @__PURE__ */
|
|
9771
|
+
return /* @__PURE__ */ jsx53(XCircle2, {});
|
|
9485
9772
|
case "pending":
|
|
9486
|
-
return /* @__PURE__ */
|
|
9773
|
+
return /* @__PURE__ */ jsx53(Clock, {});
|
|
9487
9774
|
default:
|
|
9488
|
-
return /* @__PURE__ */
|
|
9775
|
+
return /* @__PURE__ */ jsx53(XCircle2, {});
|
|
9489
9776
|
}
|
|
9490
9777
|
};
|
|
9491
9778
|
const getActionBadge = (status2) => {
|
|
@@ -9500,7 +9787,7 @@ var CardStatus = forwardRef17(
|
|
|
9500
9787
|
return "info";
|
|
9501
9788
|
}
|
|
9502
9789
|
};
|
|
9503
|
-
return /* @__PURE__ */
|
|
9790
|
+
return /* @__PURE__ */ jsx53(
|
|
9504
9791
|
CardBase,
|
|
9505
9792
|
{
|
|
9506
9793
|
ref,
|
|
@@ -9509,10 +9796,10 @@ var CardStatus = forwardRef17(
|
|
|
9509
9796
|
minHeight: "medium",
|
|
9510
9797
|
className: cn("items-center cursor-pointer", className),
|
|
9511
9798
|
...props,
|
|
9512
|
-
children: /* @__PURE__ */
|
|
9513
|
-
/* @__PURE__ */
|
|
9514
|
-
/* @__PURE__ */
|
|
9515
|
-
status && /* @__PURE__ */
|
|
9799
|
+
children: /* @__PURE__ */ jsxs41("div", { className: "flex justify-between w-full h-full flex-row items-center gap-2", children: [
|
|
9800
|
+
/* @__PURE__ */ jsx53("p", { className: "text-sm font-bold text-text-950 truncate flex-1 min-w-0", children: header }),
|
|
9801
|
+
/* @__PURE__ */ jsxs41("span", { className: "flex flex-row gap-1 items-center flex-shrink-0", children: [
|
|
9802
|
+
status && /* @__PURE__ */ jsx53(
|
|
9516
9803
|
Badge_default,
|
|
9517
9804
|
{
|
|
9518
9805
|
action: getActionBadge(status),
|
|
@@ -9522,9 +9809,9 @@ var CardStatus = forwardRef17(
|
|
|
9522
9809
|
children: getLabelBadge(status)
|
|
9523
9810
|
}
|
|
9524
9811
|
),
|
|
9525
|
-
label && /* @__PURE__ */
|
|
9812
|
+
label && /* @__PURE__ */ jsx53("p", { className: "text-sm text-text-800", children: label })
|
|
9526
9813
|
] }),
|
|
9527
|
-
/* @__PURE__ */
|
|
9814
|
+
/* @__PURE__ */ jsx53(CaretRight6, { className: "min-w-6 min-h-6 text-text-800 cursor-pointer flex-shrink-0 ml-2" })
|
|
9528
9815
|
] })
|
|
9529
9816
|
}
|
|
9530
9817
|
);
|
|
@@ -9532,7 +9819,7 @@ var CardStatus = forwardRef17(
|
|
|
9532
9819
|
);
|
|
9533
9820
|
var CardSettings = forwardRef17(
|
|
9534
9821
|
({ header, className, icon, ...props }, ref) => {
|
|
9535
|
-
return /* @__PURE__ */
|
|
9822
|
+
return /* @__PURE__ */ jsxs41(
|
|
9536
9823
|
CardBase,
|
|
9537
9824
|
{
|
|
9538
9825
|
ref,
|
|
@@ -9545,9 +9832,9 @@ var CardSettings = forwardRef17(
|
|
|
9545
9832
|
),
|
|
9546
9833
|
...props,
|
|
9547
9834
|
children: [
|
|
9548
|
-
/* @__PURE__ */
|
|
9549
|
-
/* @__PURE__ */
|
|
9550
|
-
/* @__PURE__ */
|
|
9835
|
+
/* @__PURE__ */ jsx53("span", { className: "[&>svg]:size-6", children: icon }),
|
|
9836
|
+
/* @__PURE__ */ jsx53("p", { className: "w-full text-sm truncate", children: header }),
|
|
9837
|
+
/* @__PURE__ */ jsx53(CaretRight6, { size: 24, className: "cursor-pointer" })
|
|
9551
9838
|
]
|
|
9552
9839
|
}
|
|
9553
9840
|
);
|
|
@@ -9555,7 +9842,7 @@ var CardSettings = forwardRef17(
|
|
|
9555
9842
|
);
|
|
9556
9843
|
var CardSupport = forwardRef17(
|
|
9557
9844
|
({ header, className, direction = "col", children, ...props }, ref) => {
|
|
9558
|
-
return /* @__PURE__ */
|
|
9845
|
+
return /* @__PURE__ */ jsxs41(
|
|
9559
9846
|
CardBase,
|
|
9560
9847
|
{
|
|
9561
9848
|
ref,
|
|
@@ -9568,7 +9855,7 @@ var CardSupport = forwardRef17(
|
|
|
9568
9855
|
),
|
|
9569
9856
|
...props,
|
|
9570
9857
|
children: [
|
|
9571
|
-
/* @__PURE__ */
|
|
9858
|
+
/* @__PURE__ */ jsxs41(
|
|
9572
9859
|
"div",
|
|
9573
9860
|
{
|
|
9574
9861
|
className: cn(
|
|
@@ -9576,12 +9863,12 @@ var CardSupport = forwardRef17(
|
|
|
9576
9863
|
direction == "col" ? "flex-col" : "flex-row items-center"
|
|
9577
9864
|
),
|
|
9578
9865
|
children: [
|
|
9579
|
-
/* @__PURE__ */
|
|
9580
|
-
/* @__PURE__ */
|
|
9866
|
+
/* @__PURE__ */ jsx53("span", { className: "w-full min-w-0", children: /* @__PURE__ */ jsx53("p", { className: "text-sm text-text-950 font-bold truncate", children: header }) }),
|
|
9867
|
+
/* @__PURE__ */ jsx53("span", { className: "flex flex-row gap-1", children })
|
|
9581
9868
|
]
|
|
9582
9869
|
}
|
|
9583
9870
|
),
|
|
9584
|
-
/* @__PURE__ */
|
|
9871
|
+
/* @__PURE__ */ jsx53(CaretRight6, { className: "text-text-800 cursor-pointer", size: 24 })
|
|
9585
9872
|
]
|
|
9586
9873
|
}
|
|
9587
9874
|
);
|
|
@@ -9601,7 +9888,7 @@ var CardForum = forwardRef17(
|
|
|
9601
9888
|
hour,
|
|
9602
9889
|
...props
|
|
9603
9890
|
}, ref) => {
|
|
9604
|
-
return /* @__PURE__ */
|
|
9891
|
+
return /* @__PURE__ */ jsxs41(
|
|
9605
9892
|
CardBase,
|
|
9606
9893
|
{
|
|
9607
9894
|
ref,
|
|
@@ -9612,7 +9899,7 @@ var CardForum = forwardRef17(
|
|
|
9612
9899
|
className: cn("w-auto h-auto gap-3", className),
|
|
9613
9900
|
...props,
|
|
9614
9901
|
children: [
|
|
9615
|
-
/* @__PURE__ */
|
|
9902
|
+
/* @__PURE__ */ jsx53(
|
|
9616
9903
|
"button",
|
|
9617
9904
|
{
|
|
9618
9905
|
type: "button",
|
|
@@ -9621,18 +9908,18 @@ var CardForum = forwardRef17(
|
|
|
9621
9908
|
className: "min-w-8 h-8 rounded-full bg-background-950"
|
|
9622
9909
|
}
|
|
9623
9910
|
),
|
|
9624
|
-
/* @__PURE__ */
|
|
9625
|
-
/* @__PURE__ */
|
|
9626
|
-
/* @__PURE__ */
|
|
9627
|
-
/* @__PURE__ */
|
|
9911
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex flex-col gap-2 flex-1 min-w-0", children: [
|
|
9912
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex flex-row gap-1 items-center flex-wrap", children: [
|
|
9913
|
+
/* @__PURE__ */ jsx53("p", { className: "text-xs font-semibold text-primary-700 truncate", children: title }),
|
|
9914
|
+
/* @__PURE__ */ jsxs41("p", { className: "text-xs text-text-600", children: [
|
|
9628
9915
|
"\u2022 ",
|
|
9629
9916
|
date,
|
|
9630
9917
|
" \u2022 ",
|
|
9631
9918
|
hour
|
|
9632
9919
|
] })
|
|
9633
9920
|
] }),
|
|
9634
|
-
/* @__PURE__ */
|
|
9635
|
-
/* @__PURE__ */
|
|
9921
|
+
/* @__PURE__ */ jsx53("p", { className: "text-text-950 text-sm line-clamp-2 truncate", children: content }),
|
|
9922
|
+
/* @__PURE__ */ jsxs41(
|
|
9636
9923
|
"button",
|
|
9637
9924
|
{
|
|
9638
9925
|
type: "button",
|
|
@@ -9640,8 +9927,8 @@ var CardForum = forwardRef17(
|
|
|
9640
9927
|
onClick: () => onClickComments?.(valueComments),
|
|
9641
9928
|
className: "text-text-600 flex flex-row gap-2 items-center",
|
|
9642
9929
|
children: [
|
|
9643
|
-
/* @__PURE__ */
|
|
9644
|
-
/* @__PURE__ */
|
|
9930
|
+
/* @__PURE__ */ jsx53(ChatCircleText, { "aria-hidden": "true", size: 16 }),
|
|
9931
|
+
/* @__PURE__ */ jsxs41("p", { className: "text-xs", children: [
|
|
9645
9932
|
comments,
|
|
9646
9933
|
" respostas"
|
|
9647
9934
|
] })
|
|
@@ -9668,13 +9955,13 @@ var CardAudio = forwardRef17(
|
|
|
9668
9955
|
className,
|
|
9669
9956
|
...props
|
|
9670
9957
|
}, ref) => {
|
|
9671
|
-
const [isPlaying, setIsPlaying] =
|
|
9672
|
-
const [currentTime, setCurrentTime] =
|
|
9673
|
-
const [duration, setDuration] =
|
|
9674
|
-
const [volume, setVolume] =
|
|
9675
|
-
const [showVolumeControl, setShowVolumeControl] =
|
|
9676
|
-
const [showSpeedMenu, setShowSpeedMenu] =
|
|
9677
|
-
const [playbackRate, setPlaybackRate] =
|
|
9958
|
+
const [isPlaying, setIsPlaying] = useState19(false);
|
|
9959
|
+
const [currentTime, setCurrentTime] = useState19(0);
|
|
9960
|
+
const [duration, setDuration] = useState19(0);
|
|
9961
|
+
const [volume, setVolume] = useState19(1);
|
|
9962
|
+
const [showVolumeControl, setShowVolumeControl] = useState19(false);
|
|
9963
|
+
const [showSpeedMenu, setShowSpeedMenu] = useState19(false);
|
|
9964
|
+
const [playbackRate, setPlaybackRate] = useState19(1);
|
|
9678
9965
|
const audioRef = useRef10(null);
|
|
9679
9966
|
const volumeControlRef = useRef10(null);
|
|
9680
9967
|
const speedMenuRef = useRef10(null);
|
|
@@ -9744,14 +10031,14 @@ var CardAudio = forwardRef17(
|
|
|
9744
10031
|
};
|
|
9745
10032
|
const getVolumeIcon = () => {
|
|
9746
10033
|
if (volume === 0) {
|
|
9747
|
-
return /* @__PURE__ */
|
|
10034
|
+
return /* @__PURE__ */ jsx53(SpeakerSimpleX, { size: 24 });
|
|
9748
10035
|
}
|
|
9749
10036
|
if (volume < 0.5) {
|
|
9750
|
-
return /* @__PURE__ */
|
|
10037
|
+
return /* @__PURE__ */ jsx53(SpeakerLow, { size: 24 });
|
|
9751
10038
|
}
|
|
9752
|
-
return /* @__PURE__ */
|
|
10039
|
+
return /* @__PURE__ */ jsx53(SpeakerHigh, { size: 24 });
|
|
9753
10040
|
};
|
|
9754
|
-
|
|
10041
|
+
useEffect21(() => {
|
|
9755
10042
|
const handleClickOutside = (event) => {
|
|
9756
10043
|
if (volumeControlRef.current && !volumeControlRef.current.contains(event.target)) {
|
|
9757
10044
|
setShowVolumeControl(false);
|
|
@@ -9765,7 +10052,7 @@ var CardAudio = forwardRef17(
|
|
|
9765
10052
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
9766
10053
|
};
|
|
9767
10054
|
}, []);
|
|
9768
|
-
return /* @__PURE__ */
|
|
10055
|
+
return /* @__PURE__ */ jsxs41(
|
|
9769
10056
|
CardBase,
|
|
9770
10057
|
{
|
|
9771
10058
|
ref,
|
|
@@ -9778,7 +10065,7 @@ var CardAudio = forwardRef17(
|
|
|
9778
10065
|
),
|
|
9779
10066
|
...props,
|
|
9780
10067
|
children: [
|
|
9781
|
-
/* @__PURE__ */
|
|
10068
|
+
/* @__PURE__ */ jsx53(
|
|
9782
10069
|
"audio",
|
|
9783
10070
|
{
|
|
9784
10071
|
ref: audioRef,
|
|
@@ -9790,7 +10077,7 @@ var CardAudio = forwardRef17(
|
|
|
9790
10077
|
onEnded: handleEnded,
|
|
9791
10078
|
"data-testid": "audio-element",
|
|
9792
10079
|
"aria-label": title,
|
|
9793
|
-
children: tracks ? tracks.map((track) => /* @__PURE__ */
|
|
10080
|
+
children: tracks ? tracks.map((track) => /* @__PURE__ */ jsx53(
|
|
9794
10081
|
"track",
|
|
9795
10082
|
{
|
|
9796
10083
|
kind: track.kind,
|
|
@@ -9800,7 +10087,7 @@ var CardAudio = forwardRef17(
|
|
|
9800
10087
|
default: track.default
|
|
9801
10088
|
},
|
|
9802
10089
|
track.src
|
|
9803
|
-
)) : /* @__PURE__ */
|
|
10090
|
+
)) : /* @__PURE__ */ jsx53(
|
|
9804
10091
|
"track",
|
|
9805
10092
|
{
|
|
9806
10093
|
kind: "captions",
|
|
@@ -9811,7 +10098,7 @@ var CardAudio = forwardRef17(
|
|
|
9811
10098
|
)
|
|
9812
10099
|
}
|
|
9813
10100
|
),
|
|
9814
|
-
/* @__PURE__ */
|
|
10101
|
+
/* @__PURE__ */ jsx53(
|
|
9815
10102
|
"button",
|
|
9816
10103
|
{
|
|
9817
10104
|
type: "button",
|
|
@@ -9819,14 +10106,14 @@ var CardAudio = forwardRef17(
|
|
|
9819
10106
|
disabled: !src,
|
|
9820
10107
|
className: "cursor-pointer text-text-950 hover:text-primary-600 disabled:text-text-400 disabled:cursor-not-allowed",
|
|
9821
10108
|
"aria-label": isPlaying ? "Pausar" : "Reproduzir",
|
|
9822
|
-
children: isPlaying ? /* @__PURE__ */
|
|
9823
|
-
/* @__PURE__ */
|
|
9824
|
-
/* @__PURE__ */
|
|
9825
|
-
] }) }) : /* @__PURE__ */
|
|
10109
|
+
children: isPlaying ? /* @__PURE__ */ jsx53("div", { className: "w-6 h-6 flex items-center justify-center", children: /* @__PURE__ */ jsxs41("div", { className: "flex gap-0.5", children: [
|
|
10110
|
+
/* @__PURE__ */ jsx53("div", { className: "w-1 h-4 bg-current rounded-sm" }),
|
|
10111
|
+
/* @__PURE__ */ jsx53("div", { className: "w-1 h-4 bg-current rounded-sm" })
|
|
10112
|
+
] }) }) : /* @__PURE__ */ jsx53(Play, { size: 24 })
|
|
9826
10113
|
}
|
|
9827
10114
|
),
|
|
9828
|
-
/* @__PURE__ */
|
|
9829
|
-
/* @__PURE__ */
|
|
10115
|
+
/* @__PURE__ */ jsx53("p", { className: "text-text-800 text-md font-medium min-w-[2.5rem]", children: formatTime2(currentTime) }),
|
|
10116
|
+
/* @__PURE__ */ jsx53("div", { className: "flex-1 relative", "data-testid": "progress-bar", children: /* @__PURE__ */ jsx53(
|
|
9830
10117
|
"button",
|
|
9831
10118
|
{
|
|
9832
10119
|
type: "button",
|
|
@@ -9841,7 +10128,7 @@ var CardAudio = forwardRef17(
|
|
|
9841
10128
|
}
|
|
9842
10129
|
},
|
|
9843
10130
|
"aria-label": "Barra de progresso do \xE1udio",
|
|
9844
|
-
children: /* @__PURE__ */
|
|
10131
|
+
children: /* @__PURE__ */ jsx53(
|
|
9845
10132
|
"div",
|
|
9846
10133
|
{
|
|
9847
10134
|
className: "h-full bg-primary-600 rounded-full transition-all duration-100",
|
|
@@ -9852,19 +10139,19 @@ var CardAudio = forwardRef17(
|
|
|
9852
10139
|
)
|
|
9853
10140
|
}
|
|
9854
10141
|
) }),
|
|
9855
|
-
/* @__PURE__ */
|
|
9856
|
-
/* @__PURE__ */
|
|
9857
|
-
/* @__PURE__ */
|
|
10142
|
+
/* @__PURE__ */ jsx53("p", { className: "text-text-800 text-md font-medium min-w-[2.5rem]", children: formatTime2(duration) }),
|
|
10143
|
+
/* @__PURE__ */ jsxs41("div", { className: "relative h-6", ref: volumeControlRef, children: [
|
|
10144
|
+
/* @__PURE__ */ jsx53(
|
|
9858
10145
|
"button",
|
|
9859
10146
|
{
|
|
9860
10147
|
type: "button",
|
|
9861
10148
|
onClick: toggleVolumeControl,
|
|
9862
10149
|
className: "cursor-pointer text-text-950 hover:text-primary-600",
|
|
9863
10150
|
"aria-label": "Controle de volume",
|
|
9864
|
-
children: /* @__PURE__ */
|
|
10151
|
+
children: /* @__PURE__ */ jsx53("div", { className: "w-6 h-6 flex items-center justify-center", children: getVolumeIcon() })
|
|
9865
10152
|
}
|
|
9866
10153
|
),
|
|
9867
|
-
showVolumeControl && /* @__PURE__ */
|
|
10154
|
+
showVolumeControl && /* @__PURE__ */ jsx53(
|
|
9868
10155
|
"button",
|
|
9869
10156
|
{
|
|
9870
10157
|
type: "button",
|
|
@@ -9874,7 +10161,7 @@ var CardAudio = forwardRef17(
|
|
|
9874
10161
|
setShowVolumeControl(false);
|
|
9875
10162
|
}
|
|
9876
10163
|
},
|
|
9877
|
-
children: /* @__PURE__ */
|
|
10164
|
+
children: /* @__PURE__ */ jsx53(
|
|
9878
10165
|
"input",
|
|
9879
10166
|
{
|
|
9880
10167
|
type: "range",
|
|
@@ -9915,22 +10202,22 @@ var CardAudio = forwardRef17(
|
|
|
9915
10202
|
}
|
|
9916
10203
|
)
|
|
9917
10204
|
] }),
|
|
9918
|
-
/* @__PURE__ */
|
|
9919
|
-
/* @__PURE__ */
|
|
10205
|
+
/* @__PURE__ */ jsxs41("div", { className: "relative h-6", ref: speedMenuRef, children: [
|
|
10206
|
+
/* @__PURE__ */ jsx53(
|
|
9920
10207
|
"button",
|
|
9921
10208
|
{
|
|
9922
10209
|
type: "button",
|
|
9923
10210
|
onClick: toggleSpeedMenu,
|
|
9924
10211
|
className: "cursor-pointer text-text-950 hover:text-primary-600",
|
|
9925
10212
|
"aria-label": "Op\xE7\xF5es de velocidade",
|
|
9926
|
-
children: /* @__PURE__ */
|
|
10213
|
+
children: /* @__PURE__ */ jsx53(DotsThreeVertical2, { size: 24 })
|
|
9927
10214
|
}
|
|
9928
10215
|
),
|
|
9929
|
-
showSpeedMenu && /* @__PURE__ */
|
|
10216
|
+
showSpeedMenu && /* @__PURE__ */ jsx53("div", { className: "absolute bottom-full right-0 mb-2 p-2 bg-background border border-border-100 rounded-lg shadow-lg min-w-24 z-10", children: /* @__PURE__ */ jsx53("div", { className: "flex flex-col gap-1", children: [
|
|
9930
10217
|
{ speed: 1, label: "1x" },
|
|
9931
10218
|
{ speed: 1.5, label: "1.5x" },
|
|
9932
10219
|
{ speed: 2, label: "2x" }
|
|
9933
|
-
].map(({ speed, label }) => /* @__PURE__ */
|
|
10220
|
+
].map(({ speed, label }) => /* @__PURE__ */ jsx53(
|
|
9934
10221
|
"button",
|
|
9935
10222
|
{
|
|
9936
10223
|
type: "button",
|
|
@@ -9958,7 +10245,7 @@ var SIMULADO_BACKGROUND_CLASSES = {
|
|
|
9958
10245
|
var CardSimulado = forwardRef17(
|
|
9959
10246
|
({ title, duration, info, backgroundColor, className, ...props }, ref) => {
|
|
9960
10247
|
const backgroundClass = SIMULADO_BACKGROUND_CLASSES[backgroundColor];
|
|
9961
|
-
return /* @__PURE__ */
|
|
10248
|
+
return /* @__PURE__ */ jsx53(
|
|
9962
10249
|
CardBase,
|
|
9963
10250
|
{
|
|
9964
10251
|
ref,
|
|
@@ -9971,18 +10258,18 @@ var CardSimulado = forwardRef17(
|
|
|
9971
10258
|
className
|
|
9972
10259
|
),
|
|
9973
10260
|
...props,
|
|
9974
|
-
children: /* @__PURE__ */
|
|
9975
|
-
/* @__PURE__ */
|
|
9976
|
-
/* @__PURE__ */
|
|
9977
|
-
/* @__PURE__ */
|
|
9978
|
-
duration && /* @__PURE__ */
|
|
9979
|
-
/* @__PURE__ */
|
|
9980
|
-
/* @__PURE__ */
|
|
10261
|
+
children: /* @__PURE__ */ jsxs41("div", { className: "flex justify-between items-center w-full gap-4", children: [
|
|
10262
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex flex-col gap-1 flex-1 min-w-0", children: [
|
|
10263
|
+
/* @__PURE__ */ jsx53(Text_default, { size: "lg", weight: "bold", className: "text-text-950 truncate", children: title }),
|
|
10264
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-4 text-text-700", children: [
|
|
10265
|
+
duration && /* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-1", children: [
|
|
10266
|
+
/* @__PURE__ */ jsx53(Clock, { size: 16, className: "flex-shrink-0" }),
|
|
10267
|
+
/* @__PURE__ */ jsx53(Text_default, { size: "sm", children: duration })
|
|
9981
10268
|
] }),
|
|
9982
|
-
/* @__PURE__ */
|
|
10269
|
+
/* @__PURE__ */ jsx53(Text_default, { size: "sm", className: "truncate", children: info })
|
|
9983
10270
|
] })
|
|
9984
10271
|
] }),
|
|
9985
|
-
/* @__PURE__ */
|
|
10272
|
+
/* @__PURE__ */ jsx53(
|
|
9986
10273
|
CaretRight6,
|
|
9987
10274
|
{
|
|
9988
10275
|
size: 24,
|
|
@@ -10027,7 +10314,7 @@ var CardTest = forwardRef17(
|
|
|
10027
10314
|
const interactiveClasses = isSelectable ? "cursor-pointer focus:outline-none focus:ring-2 focus:ring-primary-950 focus:ring-offset-2" : "";
|
|
10028
10315
|
const selectedClasses = selected ? "ring-2 ring-primary-950 ring-offset-2" : "";
|
|
10029
10316
|
if (isSelectable) {
|
|
10030
|
-
return /* @__PURE__ */
|
|
10317
|
+
return /* @__PURE__ */ jsx53(
|
|
10031
10318
|
"button",
|
|
10032
10319
|
{
|
|
10033
10320
|
ref,
|
|
@@ -10039,8 +10326,8 @@ var CardTest = forwardRef17(
|
|
|
10039
10326
|
onKeyDown: handleKeyDown,
|
|
10040
10327
|
"aria-pressed": selected,
|
|
10041
10328
|
...props,
|
|
10042
|
-
children: /* @__PURE__ */
|
|
10043
|
-
/* @__PURE__ */
|
|
10329
|
+
children: /* @__PURE__ */ jsxs41("div", { className: "flex flex-col justify-between gap-[27px] flex-grow min-h-[67px] w-full min-w-0", children: [
|
|
10330
|
+
/* @__PURE__ */ jsx53(
|
|
10044
10331
|
Text_default,
|
|
10045
10332
|
{
|
|
10046
10333
|
size: "md",
|
|
@@ -10049,10 +10336,10 @@ var CardTest = forwardRef17(
|
|
|
10049
10336
|
children: title
|
|
10050
10337
|
}
|
|
10051
10338
|
),
|
|
10052
|
-
/* @__PURE__ */
|
|
10053
|
-
duration && /* @__PURE__ */
|
|
10054
|
-
/* @__PURE__ */
|
|
10055
|
-
/* @__PURE__ */
|
|
10339
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex flex-row justify-start items-end gap-4 w-full", children: [
|
|
10340
|
+
duration && /* @__PURE__ */ jsxs41("div", { className: "flex flex-row items-center gap-1 flex-shrink-0", children: [
|
|
10341
|
+
/* @__PURE__ */ jsx53(Clock, { size: 16, className: "text-text-700" }),
|
|
10342
|
+
/* @__PURE__ */ jsx53(
|
|
10056
10343
|
Text_default,
|
|
10057
10344
|
{
|
|
10058
10345
|
size: "sm",
|
|
@@ -10061,7 +10348,7 @@ var CardTest = forwardRef17(
|
|
|
10061
10348
|
}
|
|
10062
10349
|
)
|
|
10063
10350
|
] }),
|
|
10064
|
-
/* @__PURE__ */
|
|
10351
|
+
/* @__PURE__ */ jsx53(
|
|
10065
10352
|
Text_default,
|
|
10066
10353
|
{
|
|
10067
10354
|
size: "sm",
|
|
@@ -10074,14 +10361,14 @@ var CardTest = forwardRef17(
|
|
|
10074
10361
|
}
|
|
10075
10362
|
);
|
|
10076
10363
|
}
|
|
10077
|
-
return /* @__PURE__ */
|
|
10364
|
+
return /* @__PURE__ */ jsx53(
|
|
10078
10365
|
"div",
|
|
10079
10366
|
{
|
|
10080
10367
|
ref,
|
|
10081
10368
|
className: cn(`${baseClasses} ${className}`.trim()),
|
|
10082
10369
|
...props,
|
|
10083
|
-
children: /* @__PURE__ */
|
|
10084
|
-
/* @__PURE__ */
|
|
10370
|
+
children: /* @__PURE__ */ jsxs41("div", { className: "flex flex-col justify-between gap-[27px] flex-grow min-h-[67px] w-full min-w-0", children: [
|
|
10371
|
+
/* @__PURE__ */ jsx53(
|
|
10085
10372
|
Text_default,
|
|
10086
10373
|
{
|
|
10087
10374
|
size: "md",
|
|
@@ -10090,10 +10377,10 @@ var CardTest = forwardRef17(
|
|
|
10090
10377
|
children: title
|
|
10091
10378
|
}
|
|
10092
10379
|
),
|
|
10093
|
-
/* @__PURE__ */
|
|
10094
|
-
duration && /* @__PURE__ */
|
|
10095
|
-
/* @__PURE__ */
|
|
10096
|
-
/* @__PURE__ */
|
|
10380
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex flex-row justify-start items-end gap-4 w-full", children: [
|
|
10381
|
+
duration && /* @__PURE__ */ jsxs41("div", { className: "flex flex-row items-center gap-1 flex-shrink-0", children: [
|
|
10382
|
+
/* @__PURE__ */ jsx53(Clock, { size: 16, className: "text-text-700" }),
|
|
10383
|
+
/* @__PURE__ */ jsx53(
|
|
10097
10384
|
Text_default,
|
|
10098
10385
|
{
|
|
10099
10386
|
size: "sm",
|
|
@@ -10102,7 +10389,7 @@ var CardTest = forwardRef17(
|
|
|
10102
10389
|
}
|
|
10103
10390
|
)
|
|
10104
10391
|
] }),
|
|
10105
|
-
/* @__PURE__ */
|
|
10392
|
+
/* @__PURE__ */ jsx53(
|
|
10106
10393
|
Text_default,
|
|
10107
10394
|
{
|
|
10108
10395
|
size: "sm",
|
|
@@ -10139,14 +10426,14 @@ var SIMULATION_TYPE_STYLES = {
|
|
|
10139
10426
|
}
|
|
10140
10427
|
};
|
|
10141
10428
|
var CardSimulationHistory = forwardRef17(({ data, onSimulationClick, className, ...props }, ref) => {
|
|
10142
|
-
return /* @__PURE__ */
|
|
10429
|
+
return /* @__PURE__ */ jsx53(
|
|
10143
10430
|
"div",
|
|
10144
10431
|
{
|
|
10145
10432
|
ref,
|
|
10146
10433
|
className: cn("w-full max-w-[992px] h-auto", className),
|
|
10147
10434
|
...props,
|
|
10148
|
-
children: /* @__PURE__ */
|
|
10149
|
-
data.map((section, sectionIndex) => /* @__PURE__ */
|
|
10435
|
+
children: /* @__PURE__ */ jsxs41("div", { className: "flex flex-col gap-0", children: [
|
|
10436
|
+
data.map((section, sectionIndex) => /* @__PURE__ */ jsx53("div", { className: "flex flex-col", children: /* @__PURE__ */ jsxs41(
|
|
10150
10437
|
"div",
|
|
10151
10438
|
{
|
|
10152
10439
|
className: cn(
|
|
@@ -10154,7 +10441,7 @@ var CardSimulationHistory = forwardRef17(({ data, onSimulationClick, className,
|
|
|
10154
10441
|
sectionIndex === 0 ? "rounded-t-3xl" : ""
|
|
10155
10442
|
),
|
|
10156
10443
|
children: [
|
|
10157
|
-
/* @__PURE__ */
|
|
10444
|
+
/* @__PURE__ */ jsx53(
|
|
10158
10445
|
Text_default,
|
|
10159
10446
|
{
|
|
10160
10447
|
size: "xs",
|
|
@@ -10163,9 +10450,9 @@ var CardSimulationHistory = forwardRef17(({ data, onSimulationClick, className,
|
|
|
10163
10450
|
children: section.date
|
|
10164
10451
|
}
|
|
10165
10452
|
),
|
|
10166
|
-
/* @__PURE__ */
|
|
10453
|
+
/* @__PURE__ */ jsx53("div", { className: "flex flex-col gap-2 flex-1", children: section.simulations.map((simulation) => {
|
|
10167
10454
|
const typeStyles = SIMULATION_TYPE_STYLES[simulation.type];
|
|
10168
|
-
return /* @__PURE__ */
|
|
10455
|
+
return /* @__PURE__ */ jsx53(
|
|
10169
10456
|
CardBase,
|
|
10170
10457
|
{
|
|
10171
10458
|
layout: "horizontal",
|
|
@@ -10177,9 +10464,9 @@ var CardSimulationHistory = forwardRef17(({ data, onSimulationClick, className,
|
|
|
10177
10464
|
transition-shadow duration-200 h-auto min-h-[61px]`
|
|
10178
10465
|
),
|
|
10179
10466
|
onClick: () => onSimulationClick?.(simulation),
|
|
10180
|
-
children: /* @__PURE__ */
|
|
10181
|
-
/* @__PURE__ */
|
|
10182
|
-
/* @__PURE__ */
|
|
10467
|
+
children: /* @__PURE__ */ jsxs41("div", { className: "flex justify-between items-center w-full gap-2", children: [
|
|
10468
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex flex-wrap flex-col justify-between sm:flex-row gap-2 flex-1 min-w-0", children: [
|
|
10469
|
+
/* @__PURE__ */ jsx53(
|
|
10183
10470
|
Text_default,
|
|
10184
10471
|
{
|
|
10185
10472
|
size: "lg",
|
|
@@ -10188,8 +10475,8 @@ var CardSimulationHistory = forwardRef17(({ data, onSimulationClick, className,
|
|
|
10188
10475
|
children: simulation.title
|
|
10189
10476
|
}
|
|
10190
10477
|
),
|
|
10191
|
-
/* @__PURE__ */
|
|
10192
|
-
/* @__PURE__ */
|
|
10478
|
+
/* @__PURE__ */ jsxs41("div", { className: "flex items-center gap-2", children: [
|
|
10479
|
+
/* @__PURE__ */ jsx53(
|
|
10193
10480
|
Badge_default,
|
|
10194
10481
|
{
|
|
10195
10482
|
variant: "examsOutlined",
|
|
@@ -10198,10 +10485,10 @@ var CardSimulationHistory = forwardRef17(({ data, onSimulationClick, className,
|
|
|
10198
10485
|
children: typeStyles.text
|
|
10199
10486
|
}
|
|
10200
10487
|
),
|
|
10201
|
-
/* @__PURE__ */
|
|
10488
|
+
/* @__PURE__ */ jsx53(Text_default, { size: "sm", className: "text-text-800 truncate", children: simulation.info })
|
|
10202
10489
|
] })
|
|
10203
10490
|
] }),
|
|
10204
|
-
/* @__PURE__ */
|
|
10491
|
+
/* @__PURE__ */ jsx53(
|
|
10205
10492
|
CaretRight6,
|
|
10206
10493
|
{
|
|
10207
10494
|
size: 24,
|
|
@@ -10217,7 +10504,7 @@ var CardSimulationHistory = forwardRef17(({ data, onSimulationClick, className,
|
|
|
10217
10504
|
]
|
|
10218
10505
|
}
|
|
10219
10506
|
) }, section.date)),
|
|
10220
|
-
data.length > 0 && /* @__PURE__ */
|
|
10507
|
+
data.length > 0 && /* @__PURE__ */ jsx53("div", { className: "w-full h-6 bg-background rounded-b-3xl" })
|
|
10221
10508
|
] })
|
|
10222
10509
|
}
|
|
10223
10510
|
);
|
|
@@ -10225,7 +10512,7 @@ var CardSimulationHistory = forwardRef17(({ data, onSimulationClick, className,
|
|
|
10225
10512
|
|
|
10226
10513
|
// src/components/StatisticsCard/StatisticsCard.tsx
|
|
10227
10514
|
import { Plus } from "phosphor-react";
|
|
10228
|
-
import { jsx as
|
|
10515
|
+
import { jsx as jsx54, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
10229
10516
|
var VARIANT_STYLES = {
|
|
10230
10517
|
high: "bg-success-background",
|
|
10231
10518
|
medium: "bg-warning-background",
|
|
@@ -10239,12 +10526,12 @@ var VALUE_TEXT_COLORS = {
|
|
|
10239
10526
|
total: "text-info-700"
|
|
10240
10527
|
};
|
|
10241
10528
|
var StatCard = ({ item, showPlaceholder = false }) => {
|
|
10242
|
-
return /* @__PURE__ */
|
|
10529
|
+
return /* @__PURE__ */ jsxs42(
|
|
10243
10530
|
"div",
|
|
10244
10531
|
{
|
|
10245
10532
|
className: `rounded-xl py-[17px] px-6 min-h-[105px] flex flex-col justify-center items-start gap-1 ${VARIANT_STYLES[item.variant]}`,
|
|
10246
10533
|
children: [
|
|
10247
|
-
/* @__PURE__ */
|
|
10534
|
+
/* @__PURE__ */ jsx54(
|
|
10248
10535
|
Text_default,
|
|
10249
10536
|
{
|
|
10250
10537
|
size: "4xl",
|
|
@@ -10253,7 +10540,7 @@ var StatCard = ({ item, showPlaceholder = false }) => {
|
|
|
10253
10540
|
children: showPlaceholder ? "-" : item.value
|
|
10254
10541
|
}
|
|
10255
10542
|
),
|
|
10256
|
-
/* @__PURE__ */
|
|
10543
|
+
/* @__PURE__ */ jsx54(
|
|
10257
10544
|
Text_default,
|
|
10258
10545
|
{
|
|
10259
10546
|
size: "xs",
|
|
@@ -10288,13 +10575,13 @@ var StatisticsCard = ({
|
|
|
10288
10575
|
}) => {
|
|
10289
10576
|
const hasData = data && data.length > 0;
|
|
10290
10577
|
const gridColumnsClass = hasData ? getGridColumnsClass(data.length) : "";
|
|
10291
|
-
return /* @__PURE__ */
|
|
10578
|
+
return /* @__PURE__ */ jsxs42(
|
|
10292
10579
|
"div",
|
|
10293
10580
|
{
|
|
10294
10581
|
className: `bg-background rounded-xl p-4 h-auto lg:h-[185px] flex flex-col gap-2 ${className}`,
|
|
10295
10582
|
children: [
|
|
10296
|
-
/* @__PURE__ */
|
|
10297
|
-
/* @__PURE__ */
|
|
10583
|
+
/* @__PURE__ */ jsxs42("div", { className: "flex flex-row justify-between items-center gap-4", children: [
|
|
10584
|
+
/* @__PURE__ */ jsx54(
|
|
10298
10585
|
Text_default,
|
|
10299
10586
|
{
|
|
10300
10587
|
as: "h3",
|
|
@@ -10305,22 +10592,22 @@ var StatisticsCard = ({
|
|
|
10305
10592
|
children: title
|
|
10306
10593
|
}
|
|
10307
10594
|
),
|
|
10308
|
-
dropdownOptions && dropdownOptions.length > 0 && /* @__PURE__ */
|
|
10595
|
+
dropdownOptions && dropdownOptions.length > 0 && /* @__PURE__ */ jsx54("div", { className: "w-[120px] min-w-[90px] sm:shrink-0", children: /* @__PURE__ */ jsxs42(
|
|
10309
10596
|
Select_default,
|
|
10310
10597
|
{
|
|
10311
10598
|
value: selectedDropdownValue,
|
|
10312
10599
|
onValueChange: onDropdownChange,
|
|
10313
10600
|
size: "medium",
|
|
10314
10601
|
children: [
|
|
10315
|
-
/* @__PURE__ */
|
|
10602
|
+
/* @__PURE__ */ jsx54(
|
|
10316
10603
|
SelectTrigger,
|
|
10317
10604
|
{
|
|
10318
10605
|
className: "border border-border-300 rounded [&>span]:whitespace-nowrap [&>span]:overflow-hidden [&>span]:text-ellipsis",
|
|
10319
10606
|
"aria-label": dropdownAriaLabel,
|
|
10320
|
-
children: /* @__PURE__ */
|
|
10607
|
+
children: /* @__PURE__ */ jsx54(SelectValue, { placeholder: selectPlaceholder })
|
|
10321
10608
|
}
|
|
10322
10609
|
),
|
|
10323
|
-
/* @__PURE__ */
|
|
10610
|
+
/* @__PURE__ */ jsx54(SelectContent, { className: "min-w-[120px]", children: dropdownOptions.map((option) => /* @__PURE__ */ jsx54(
|
|
10324
10611
|
SelectItem,
|
|
10325
10612
|
{
|
|
10326
10613
|
value: option.value,
|
|
@@ -10333,11 +10620,11 @@ var StatisticsCard = ({
|
|
|
10333
10620
|
}
|
|
10334
10621
|
) })
|
|
10335
10622
|
] }),
|
|
10336
|
-
hasData ? /* @__PURE__ */
|
|
10623
|
+
hasData ? /* @__PURE__ */ jsx54(
|
|
10337
10624
|
"div",
|
|
10338
10625
|
{
|
|
10339
10626
|
className: `grid grid-cols-1 sm:grid-cols-2 gap-[13px] ${gridColumnsClass}`,
|
|
10340
|
-
children: data.map((item, index) => /* @__PURE__ */
|
|
10627
|
+
children: data.map((item, index) => /* @__PURE__ */ jsx54(
|
|
10341
10628
|
StatCard,
|
|
10342
10629
|
{
|
|
10343
10630
|
item,
|
|
@@ -10346,8 +10633,8 @@ var StatisticsCard = ({
|
|
|
10346
10633
|
`${item.variant}-${item.label}-${index}`
|
|
10347
10634
|
))
|
|
10348
10635
|
}
|
|
10349
|
-
) : /* @__PURE__ */
|
|
10350
|
-
/* @__PURE__ */
|
|
10636
|
+
) : /* @__PURE__ */ jsxs42("div", { className: "border border-dashed border-border-300 rounded-lg p-6 min-h-[105px] flex flex-col items-center justify-center gap-2", children: [
|
|
10637
|
+
/* @__PURE__ */ jsx54(
|
|
10351
10638
|
Text_default,
|
|
10352
10639
|
{
|
|
10353
10640
|
size: "sm",
|
|
@@ -10356,14 +10643,14 @@ var StatisticsCard = ({
|
|
|
10356
10643
|
children: emptyStateMessage
|
|
10357
10644
|
}
|
|
10358
10645
|
),
|
|
10359
|
-
onEmptyStateButtonClick && /* @__PURE__ */
|
|
10646
|
+
onEmptyStateButtonClick && /* @__PURE__ */ jsx54(
|
|
10360
10647
|
Button_default,
|
|
10361
10648
|
{
|
|
10362
10649
|
variant: "outline",
|
|
10363
10650
|
action: "primary",
|
|
10364
10651
|
size: "small",
|
|
10365
10652
|
onClick: onEmptyStateButtonClick,
|
|
10366
|
-
iconLeft: /* @__PURE__ */
|
|
10653
|
+
iconLeft: /* @__PURE__ */ jsx54(Plus, { size: 16, weight: "bold" }),
|
|
10367
10654
|
children: emptyStateButtonText
|
|
10368
10655
|
}
|
|
10369
10656
|
)
|
|
@@ -10374,7 +10661,7 @@ var StatisticsCard = ({
|
|
|
10374
10661
|
};
|
|
10375
10662
|
|
|
10376
10663
|
// src/components/NotFound/NotFound.tsx
|
|
10377
|
-
import { jsx as
|
|
10664
|
+
import { jsx as jsx55, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
10378
10665
|
var NotFound = ({
|
|
10379
10666
|
title,
|
|
10380
10667
|
description,
|
|
@@ -10417,22 +10704,22 @@ var NotFound = ({
|
|
|
10417
10704
|
const errorTitle = title || getDefaultTitle();
|
|
10418
10705
|
const errorDescription = description || getDefaultDescription();
|
|
10419
10706
|
const errorCode = getErrorCode();
|
|
10420
|
-
return /* @__PURE__ */
|
|
10707
|
+
return /* @__PURE__ */ jsx55(
|
|
10421
10708
|
"div",
|
|
10422
10709
|
{
|
|
10423
10710
|
className: cn(
|
|
10424
10711
|
"flex flex-col w-full h-screen items-center justify-center bg-background-50 px-4",
|
|
10425
10712
|
className
|
|
10426
10713
|
),
|
|
10427
|
-
children: /* @__PURE__ */
|
|
10714
|
+
children: /* @__PURE__ */ jsx55(
|
|
10428
10715
|
"main",
|
|
10429
10716
|
{
|
|
10430
10717
|
role: "main",
|
|
10431
10718
|
"aria-labelledby": "error-title",
|
|
10432
10719
|
"aria-describedby": "error-description",
|
|
10433
10720
|
className: "flex flex-col items-center text-center max-w-md space-y-6",
|
|
10434
|
-
children: /* @__PURE__ */
|
|
10435
|
-
/* @__PURE__ */
|
|
10721
|
+
children: /* @__PURE__ */ jsxs43("section", { "aria-label": `Erro ${errorCode}`, children: [
|
|
10722
|
+
/* @__PURE__ */ jsx55(
|
|
10436
10723
|
"div",
|
|
10437
10724
|
{
|
|
10438
10725
|
className: "text-8xl font-bold text-primary-300 select-none",
|
|
@@ -10440,8 +10727,8 @@ var NotFound = ({
|
|
|
10440
10727
|
children: errorCode
|
|
10441
10728
|
}
|
|
10442
10729
|
),
|
|
10443
|
-
/* @__PURE__ */
|
|
10444
|
-
/* @__PURE__ */
|
|
10730
|
+
/* @__PURE__ */ jsxs43("header", { className: "space-y-2", children: [
|
|
10731
|
+
/* @__PURE__ */ jsx55(
|
|
10445
10732
|
Text_default,
|
|
10446
10733
|
{
|
|
10447
10734
|
size: "xl",
|
|
@@ -10452,9 +10739,9 @@ var NotFound = ({
|
|
|
10452
10739
|
children: errorTitle
|
|
10453
10740
|
}
|
|
10454
10741
|
),
|
|
10455
|
-
/* @__PURE__ */
|
|
10742
|
+
/* @__PURE__ */ jsx55(Text_default, { size: "md", className: "text-text-600", id: "error-description", children: errorDescription })
|
|
10456
10743
|
] }),
|
|
10457
|
-
onButtonClick && /* @__PURE__ */
|
|
10744
|
+
onButtonClick && /* @__PURE__ */ jsx55("nav", { "aria-label": "Navega\xE7\xE3o de erro", children: /* @__PURE__ */ jsx55(
|
|
10458
10745
|
Button_default,
|
|
10459
10746
|
{
|
|
10460
10747
|
onClick: handleButtonClick,
|
|
@@ -10477,9 +10764,9 @@ var NotFound_default = NotFound;
|
|
|
10477
10764
|
// src/components/VideoPlayer/VideoPlayer.tsx
|
|
10478
10765
|
import {
|
|
10479
10766
|
useRef as useRef11,
|
|
10480
|
-
useState as
|
|
10481
|
-
useEffect as
|
|
10482
|
-
useCallback as
|
|
10767
|
+
useState as useState21,
|
|
10768
|
+
useEffect as useEffect22,
|
|
10769
|
+
useCallback as useCallback6
|
|
10483
10770
|
} from "react";
|
|
10484
10771
|
import { createPortal } from "react-dom";
|
|
10485
10772
|
import {
|
|
@@ -10494,9 +10781,9 @@ import {
|
|
|
10494
10781
|
} from "phosphor-react";
|
|
10495
10782
|
|
|
10496
10783
|
// src/components/DownloadButton/DownloadButton.tsx
|
|
10497
|
-
import { useCallback as
|
|
10784
|
+
import { useCallback as useCallback5, useState as useState20 } from "react";
|
|
10498
10785
|
import { DownloadSimple } from "phosphor-react";
|
|
10499
|
-
import { jsx as
|
|
10786
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
10500
10787
|
var getMimeType = (url) => {
|
|
10501
10788
|
const extension = getFileExtension(url);
|
|
10502
10789
|
const mimeTypes = {
|
|
@@ -10571,13 +10858,13 @@ var DownloadButton = ({
|
|
|
10571
10858
|
lessonTitle = "aula",
|
|
10572
10859
|
disabled = false
|
|
10573
10860
|
}) => {
|
|
10574
|
-
const [isDownloading, setIsDownloading] =
|
|
10575
|
-
const isValidUrl =
|
|
10861
|
+
const [isDownloading, setIsDownloading] = useState20(false);
|
|
10862
|
+
const isValidUrl = useCallback5((url) => {
|
|
10576
10863
|
return Boolean(
|
|
10577
10864
|
url && url.trim() !== "" && url !== "undefined" && url !== "null"
|
|
10578
10865
|
);
|
|
10579
10866
|
}, []);
|
|
10580
|
-
const getAvailableContent =
|
|
10867
|
+
const getAvailableContent = useCallback5(() => {
|
|
10581
10868
|
const downloads = [];
|
|
10582
10869
|
if (isValidUrl(content.urlDoc)) {
|
|
10583
10870
|
downloads.push({
|
|
@@ -10612,7 +10899,7 @@ var DownloadButton = ({
|
|
|
10612
10899
|
}
|
|
10613
10900
|
return downloads;
|
|
10614
10901
|
}, [content, isValidUrl]);
|
|
10615
|
-
const handleDownload =
|
|
10902
|
+
const handleDownload = useCallback5(async () => {
|
|
10616
10903
|
if (disabled || isDownloading) return;
|
|
10617
10904
|
const availableContent = getAvailableContent();
|
|
10618
10905
|
if (availableContent.length === 0) {
|
|
@@ -10653,10 +10940,10 @@ var DownloadButton = ({
|
|
|
10653
10940
|
if (!hasContent) {
|
|
10654
10941
|
return null;
|
|
10655
10942
|
}
|
|
10656
|
-
return /* @__PURE__ */
|
|
10943
|
+
return /* @__PURE__ */ jsx56("div", { className: cn("flex items-center", className), children: /* @__PURE__ */ jsx56(
|
|
10657
10944
|
IconButton_default,
|
|
10658
10945
|
{
|
|
10659
|
-
icon: /* @__PURE__ */
|
|
10946
|
+
icon: /* @__PURE__ */ jsx56(DownloadSimple, { size: 24 }),
|
|
10660
10947
|
onClick: handleDownload,
|
|
10661
10948
|
disabled: disabled || isDownloading,
|
|
10662
10949
|
"aria-label": (() => {
|
|
@@ -10677,7 +10964,7 @@ var DownloadButton = ({
|
|
|
10677
10964
|
var DownloadButton_default = DownloadButton;
|
|
10678
10965
|
|
|
10679
10966
|
// src/components/VideoPlayer/VideoPlayer.tsx
|
|
10680
|
-
import { jsx as
|
|
10967
|
+
import { jsx as jsx57, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
10681
10968
|
var CONTROLS_HIDE_TIMEOUT = 3e3;
|
|
10682
10969
|
var LEAVE_HIDE_TIMEOUT = 1e3;
|
|
10683
10970
|
var INIT_DELAY = 100;
|
|
@@ -10693,7 +10980,7 @@ var ProgressBar2 = ({
|
|
|
10693
10980
|
progressPercentage,
|
|
10694
10981
|
onSeek,
|
|
10695
10982
|
className = "px-4 pb-2"
|
|
10696
|
-
}) => /* @__PURE__ */
|
|
10983
|
+
}) => /* @__PURE__ */ jsx57("div", { className, children: /* @__PURE__ */ jsx57(
|
|
10697
10984
|
"input",
|
|
10698
10985
|
{
|
|
10699
10986
|
type: "range",
|
|
@@ -10715,17 +11002,17 @@ var VolumeControls = ({
|
|
|
10715
11002
|
onToggleMute,
|
|
10716
11003
|
iconSize = 24,
|
|
10717
11004
|
showSlider = true
|
|
10718
|
-
}) => /* @__PURE__ */
|
|
10719
|
-
/* @__PURE__ */
|
|
11005
|
+
}) => /* @__PURE__ */ jsxs44("div", { className: "flex items-center gap-2", children: [
|
|
11006
|
+
/* @__PURE__ */ jsx57(
|
|
10720
11007
|
IconButton_default,
|
|
10721
11008
|
{
|
|
10722
|
-
icon: isMuted ? /* @__PURE__ */
|
|
11009
|
+
icon: isMuted ? /* @__PURE__ */ jsx57(SpeakerSlash, { size: iconSize }) : /* @__PURE__ */ jsx57(SpeakerHigh2, { size: iconSize }),
|
|
10723
11010
|
onClick: onToggleMute,
|
|
10724
11011
|
"aria-label": isMuted ? "Unmute" : "Mute",
|
|
10725
11012
|
className: "!bg-transparent !text-white hover:!bg-white/20"
|
|
10726
11013
|
}
|
|
10727
11014
|
),
|
|
10728
|
-
showSlider && /* @__PURE__ */
|
|
11015
|
+
showSlider && /* @__PURE__ */ jsx57(
|
|
10729
11016
|
"input",
|
|
10730
11017
|
{
|
|
10731
11018
|
type: "range",
|
|
@@ -10766,7 +11053,7 @@ var SpeedMenu = ({
|
|
|
10766
11053
|
};
|
|
10767
11054
|
};
|
|
10768
11055
|
const position = getMenuPosition();
|
|
10769
|
-
|
|
11056
|
+
useEffect22(() => {
|
|
10770
11057
|
const handleClickOutside = (event) => {
|
|
10771
11058
|
const target = event.target;
|
|
10772
11059
|
const isOutsideContainer = speedMenuContainerRef.current && !speedMenuContainerRef.current.contains(target);
|
|
@@ -10782,7 +11069,7 @@ var SpeedMenu = ({
|
|
|
10782
11069
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
10783
11070
|
};
|
|
10784
11071
|
}, [showSpeedMenu, onToggleMenu]);
|
|
10785
|
-
const menuContent = /* @__PURE__ */
|
|
11072
|
+
const menuContent = /* @__PURE__ */ jsx57(
|
|
10786
11073
|
"div",
|
|
10787
11074
|
{
|
|
10788
11075
|
ref: speedMenuRef,
|
|
@@ -10793,7 +11080,7 @@ var SpeedMenu = ({
|
|
|
10793
11080
|
top: `${position.top}px`,
|
|
10794
11081
|
left: `${position.left}px`
|
|
10795
11082
|
},
|
|
10796
|
-
children: [0.5, 0.75, 1, 1.25, 1.5, 2].map((speed) => /* @__PURE__ */
|
|
11083
|
+
children: [0.5, 0.75, 1, 1.25, 1.5, 2].map((speed) => /* @__PURE__ */ jsxs44(
|
|
10797
11084
|
"button",
|
|
10798
11085
|
{
|
|
10799
11086
|
role: "menuitemradio",
|
|
@@ -10810,12 +11097,12 @@ var SpeedMenu = ({
|
|
|
10810
11097
|
}
|
|
10811
11098
|
);
|
|
10812
11099
|
const portalContent = showSpeedMenu && globalThis.window !== void 0 && globalThis.document !== void 0 && !!globalThis.document?.body ? createPortal(menuContent, globalThis.document.body) : null;
|
|
10813
|
-
return /* @__PURE__ */
|
|
10814
|
-
/* @__PURE__ */
|
|
11100
|
+
return /* @__PURE__ */ jsxs44("div", { className: "relative", ref: speedMenuContainerRef, children: [
|
|
11101
|
+
/* @__PURE__ */ jsx57(
|
|
10815
11102
|
IconButton_default,
|
|
10816
11103
|
{
|
|
10817
11104
|
ref: buttonRef,
|
|
10818
|
-
icon: /* @__PURE__ */
|
|
11105
|
+
icon: /* @__PURE__ */ jsx57(DotsThreeVertical3, { size: iconSize }),
|
|
10819
11106
|
onClick: onToggleMenu,
|
|
10820
11107
|
"aria-label": "Playback speed",
|
|
10821
11108
|
"aria-haspopup": "menu",
|
|
@@ -10847,26 +11134,26 @@ var VideoPlayer = ({
|
|
|
10847
11134
|
}) => {
|
|
10848
11135
|
const videoRef = useRef11(null);
|
|
10849
11136
|
const { isUltraSmallMobile, isTinyMobile } = useMobile();
|
|
10850
|
-
const [isPlaying, setIsPlaying] =
|
|
10851
|
-
const [currentTime, setCurrentTime] =
|
|
10852
|
-
const [duration, setDuration] =
|
|
10853
|
-
const [isMuted, setIsMuted] =
|
|
10854
|
-
const [volume, setVolume] =
|
|
10855
|
-
const [isFullscreen, setIsFullscreen] =
|
|
10856
|
-
const [showControls, setShowControls] =
|
|
10857
|
-
const [hasCompleted, setHasCompleted] =
|
|
10858
|
-
const [showCaptions, setShowCaptions] =
|
|
10859
|
-
const [subtitlesValidation, setSubtitlesValidation] =
|
|
10860
|
-
|
|
11137
|
+
const [isPlaying, setIsPlaying] = useState21(false);
|
|
11138
|
+
const [currentTime, setCurrentTime] = useState21(0);
|
|
11139
|
+
const [duration, setDuration] = useState21(0);
|
|
11140
|
+
const [isMuted, setIsMuted] = useState21(false);
|
|
11141
|
+
const [volume, setVolume] = useState21(1);
|
|
11142
|
+
const [isFullscreen, setIsFullscreen] = useState21(false);
|
|
11143
|
+
const [showControls, setShowControls] = useState21(true);
|
|
11144
|
+
const [hasCompleted, setHasCompleted] = useState21(false);
|
|
11145
|
+
const [showCaptions, setShowCaptions] = useState21(false);
|
|
11146
|
+
const [subtitlesValidation, setSubtitlesValidation] = useState21("idle");
|
|
11147
|
+
useEffect22(() => {
|
|
10861
11148
|
setHasCompleted(false);
|
|
10862
11149
|
}, [src]);
|
|
10863
|
-
const [playbackRate, setPlaybackRate] =
|
|
10864
|
-
const [showSpeedMenu, setShowSpeedMenu] =
|
|
11150
|
+
const [playbackRate, setPlaybackRate] = useState21(1);
|
|
11151
|
+
const [showSpeedMenu, setShowSpeedMenu] = useState21(false);
|
|
10865
11152
|
const lastSaveTimeRef = useRef11(0);
|
|
10866
11153
|
const trackRef = useRef11(null);
|
|
10867
11154
|
const controlsTimeoutRef = useRef11(null);
|
|
10868
11155
|
const lastMousePositionRef = useRef11({ x: 0, y: 0 });
|
|
10869
|
-
const isUserInteracting =
|
|
11156
|
+
const isUserInteracting = useCallback6(() => {
|
|
10870
11157
|
if (showSpeedMenu) {
|
|
10871
11158
|
return true;
|
|
10872
11159
|
}
|
|
@@ -10883,13 +11170,13 @@ var VideoPlayer = ({
|
|
|
10883
11170
|
}
|
|
10884
11171
|
return false;
|
|
10885
11172
|
}, [showSpeedMenu]);
|
|
10886
|
-
const clearControlsTimeout =
|
|
11173
|
+
const clearControlsTimeout = useCallback6(() => {
|
|
10887
11174
|
if (controlsTimeoutRef.current) {
|
|
10888
11175
|
clearTimeout(controlsTimeoutRef.current);
|
|
10889
11176
|
controlsTimeoutRef.current = null;
|
|
10890
11177
|
}
|
|
10891
11178
|
}, []);
|
|
10892
|
-
const showControlsWithTimer =
|
|
11179
|
+
const showControlsWithTimer = useCallback6(() => {
|
|
10893
11180
|
setShowControls(true);
|
|
10894
11181
|
clearControlsTimeout();
|
|
10895
11182
|
if (isFullscreen) {
|
|
@@ -10904,7 +11191,7 @@ var VideoPlayer = ({
|
|
|
10904
11191
|
}, CONTROLS_HIDE_TIMEOUT);
|
|
10905
11192
|
}
|
|
10906
11193
|
}, [isFullscreen, isPlaying, clearControlsTimeout]);
|
|
10907
|
-
const handleMouseMove =
|
|
11194
|
+
const handleMouseMove = useCallback6(
|
|
10908
11195
|
(event) => {
|
|
10909
11196
|
const currentX = event.clientX;
|
|
10910
11197
|
const currentY = event.clientY;
|
|
@@ -10917,10 +11204,10 @@ var VideoPlayer = ({
|
|
|
10917
11204
|
},
|
|
10918
11205
|
[showControlsWithTimer]
|
|
10919
11206
|
);
|
|
10920
|
-
const handleMouseEnter =
|
|
11207
|
+
const handleMouseEnter = useCallback6(() => {
|
|
10921
11208
|
showControlsWithTimer();
|
|
10922
11209
|
}, [showControlsWithTimer]);
|
|
10923
|
-
const handleMouseLeave =
|
|
11210
|
+
const handleMouseLeave = useCallback6(() => {
|
|
10924
11211
|
const userInteracting = isUserInteracting();
|
|
10925
11212
|
clearControlsTimeout();
|
|
10926
11213
|
if (!isFullscreen && !userInteracting) {
|
|
@@ -10929,13 +11216,13 @@ var VideoPlayer = ({
|
|
|
10929
11216
|
}, LEAVE_HIDE_TIMEOUT);
|
|
10930
11217
|
}
|
|
10931
11218
|
}, [isFullscreen, clearControlsTimeout, isUserInteracting]);
|
|
10932
|
-
|
|
11219
|
+
useEffect22(() => {
|
|
10933
11220
|
if (videoRef.current) {
|
|
10934
11221
|
videoRef.current.volume = volume;
|
|
10935
11222
|
videoRef.current.muted = isMuted;
|
|
10936
11223
|
}
|
|
10937
11224
|
}, [volume, isMuted]);
|
|
10938
|
-
|
|
11225
|
+
useEffect22(() => {
|
|
10939
11226
|
const video = videoRef.current;
|
|
10940
11227
|
if (!video) return;
|
|
10941
11228
|
const onPlay = () => setIsPlaying(true);
|
|
@@ -10950,13 +11237,13 @@ var VideoPlayer = ({
|
|
|
10950
11237
|
video.removeEventListener("ended", onEnded);
|
|
10951
11238
|
};
|
|
10952
11239
|
}, []);
|
|
10953
|
-
|
|
11240
|
+
useEffect22(() => {
|
|
10954
11241
|
const video = videoRef.current;
|
|
10955
11242
|
if (!video) return;
|
|
10956
11243
|
video.setAttribute("playsinline", "");
|
|
10957
11244
|
video.setAttribute("webkit-playsinline", "");
|
|
10958
11245
|
}, []);
|
|
10959
|
-
|
|
11246
|
+
useEffect22(() => {
|
|
10960
11247
|
if (isPlaying) {
|
|
10961
11248
|
showControlsWithTimer();
|
|
10962
11249
|
} else {
|
|
@@ -10968,7 +11255,7 @@ var VideoPlayer = ({
|
|
|
10968
11255
|
}
|
|
10969
11256
|
}
|
|
10970
11257
|
}, [isPlaying, isFullscreen, showControlsWithTimer, clearControlsTimeout]);
|
|
10971
|
-
|
|
11258
|
+
useEffect22(() => {
|
|
10972
11259
|
const video = videoRef.current;
|
|
10973
11260
|
if (!video) return;
|
|
10974
11261
|
const handleFullscreenChange = () => {
|
|
@@ -11003,7 +11290,7 @@ var VideoPlayer = ({
|
|
|
11003
11290
|
);
|
|
11004
11291
|
};
|
|
11005
11292
|
}, [showControlsWithTimer]);
|
|
11006
|
-
|
|
11293
|
+
useEffect22(() => {
|
|
11007
11294
|
const init = () => {
|
|
11008
11295
|
if (!isFullscreen) {
|
|
11009
11296
|
showControlsWithTimer();
|
|
@@ -11025,7 +11312,7 @@ var VideoPlayer = ({
|
|
|
11025
11312
|
};
|
|
11026
11313
|
}
|
|
11027
11314
|
}, []);
|
|
11028
|
-
const getInitialTime =
|
|
11315
|
+
const getInitialTime = useCallback6(() => {
|
|
11029
11316
|
if (!autoSave || !storageKey) {
|
|
11030
11317
|
return Number.isFinite(initialTime) && initialTime >= 0 ? initialTime : void 0;
|
|
11031
11318
|
}
|
|
@@ -11038,14 +11325,14 @@ var VideoPlayer = ({
|
|
|
11038
11325
|
if (hasValidSaved) return saved;
|
|
11039
11326
|
return void 0;
|
|
11040
11327
|
}, [autoSave, storageKey, src, initialTime]);
|
|
11041
|
-
|
|
11328
|
+
useEffect22(() => {
|
|
11042
11329
|
const start = getInitialTime();
|
|
11043
11330
|
if (start !== void 0 && videoRef.current) {
|
|
11044
11331
|
videoRef.current.currentTime = start;
|
|
11045
11332
|
setCurrentTime(start);
|
|
11046
11333
|
}
|
|
11047
11334
|
}, [getInitialTime]);
|
|
11048
|
-
const saveProgress =
|
|
11335
|
+
const saveProgress = useCallback6(
|
|
11049
11336
|
(time) => {
|
|
11050
11337
|
if (!autoSave || !storageKey) return;
|
|
11051
11338
|
const now = Date.now();
|
|
@@ -11056,7 +11343,7 @@ var VideoPlayer = ({
|
|
|
11056
11343
|
},
|
|
11057
11344
|
[autoSave, storageKey, src]
|
|
11058
11345
|
);
|
|
11059
|
-
const togglePlayPause =
|
|
11346
|
+
const togglePlayPause = useCallback6(async () => {
|
|
11060
11347
|
const video = videoRef.current;
|
|
11061
11348
|
if (!video) return;
|
|
11062
11349
|
if (!video.paused) {
|
|
@@ -11068,7 +11355,7 @@ var VideoPlayer = ({
|
|
|
11068
11355
|
} catch {
|
|
11069
11356
|
}
|
|
11070
11357
|
}, []);
|
|
11071
|
-
const handleVolumeChange =
|
|
11358
|
+
const handleVolumeChange = useCallback6(
|
|
11072
11359
|
(newVolume) => {
|
|
11073
11360
|
const video = videoRef.current;
|
|
11074
11361
|
if (!video) return;
|
|
@@ -11087,7 +11374,7 @@ var VideoPlayer = ({
|
|
|
11087
11374
|
},
|
|
11088
11375
|
[isMuted]
|
|
11089
11376
|
);
|
|
11090
|
-
const toggleMute =
|
|
11377
|
+
const toggleMute = useCallback6(() => {
|
|
11091
11378
|
const video = videoRef.current;
|
|
11092
11379
|
if (!video) return;
|
|
11093
11380
|
if (isMuted) {
|
|
@@ -11101,20 +11388,20 @@ var VideoPlayer = ({
|
|
|
11101
11388
|
setIsMuted(true);
|
|
11102
11389
|
}
|
|
11103
11390
|
}, [isMuted, volume]);
|
|
11104
|
-
const handleSeek =
|
|
11391
|
+
const handleSeek = useCallback6((newTime) => {
|
|
11105
11392
|
const video = videoRef.current;
|
|
11106
11393
|
if (video) {
|
|
11107
11394
|
video.currentTime = newTime;
|
|
11108
11395
|
}
|
|
11109
11396
|
}, []);
|
|
11110
|
-
const isSafariIOS =
|
|
11397
|
+
const isSafariIOS = useCallback6(() => {
|
|
11111
11398
|
const ua = navigator.userAgent;
|
|
11112
11399
|
const isIOS = /iPad|iPhone|iPod/.test(ua);
|
|
11113
11400
|
const isWebKit = /WebKit/.test(ua);
|
|
11114
11401
|
const isNotChrome = !/CriOS|Chrome/.test(ua);
|
|
11115
11402
|
return isIOS && isWebKit && isNotChrome;
|
|
11116
11403
|
}, []);
|
|
11117
|
-
const toggleFullscreen =
|
|
11404
|
+
const toggleFullscreen = useCallback6(() => {
|
|
11118
11405
|
const video = videoRef.current;
|
|
11119
11406
|
const container = video?.parentElement;
|
|
11120
11407
|
if (!video || !container) return;
|
|
@@ -11131,24 +11418,24 @@ var VideoPlayer = ({
|
|
|
11131
11418
|
document.exitFullscreen();
|
|
11132
11419
|
}
|
|
11133
11420
|
}, [isFullscreen, isSafariIOS]);
|
|
11134
|
-
const handleSpeedChange =
|
|
11421
|
+
const handleSpeedChange = useCallback6((speed) => {
|
|
11135
11422
|
if (videoRef.current) {
|
|
11136
11423
|
videoRef.current.playbackRate = speed;
|
|
11137
11424
|
setPlaybackRate(speed);
|
|
11138
11425
|
setShowSpeedMenu(false);
|
|
11139
11426
|
}
|
|
11140
11427
|
}, []);
|
|
11141
|
-
const toggleSpeedMenu =
|
|
11428
|
+
const toggleSpeedMenu = useCallback6(() => {
|
|
11142
11429
|
setShowSpeedMenu(!showSpeedMenu);
|
|
11143
11430
|
}, [showSpeedMenu]);
|
|
11144
|
-
const toggleCaptions =
|
|
11431
|
+
const toggleCaptions = useCallback6(() => {
|
|
11145
11432
|
if (!trackRef.current?.track || !subtitles || subtitlesValidation !== "valid")
|
|
11146
11433
|
return;
|
|
11147
11434
|
const newShowCaptions = !showCaptions;
|
|
11148
11435
|
setShowCaptions(newShowCaptions);
|
|
11149
11436
|
trackRef.current.track.mode = newShowCaptions ? "showing" : "hidden";
|
|
11150
11437
|
}, [showCaptions, subtitles, subtitlesValidation]);
|
|
11151
|
-
const checkVideoCompletion =
|
|
11438
|
+
const checkVideoCompletion = useCallback6(
|
|
11152
11439
|
(progressPercent) => {
|
|
11153
11440
|
if (progressPercent >= 95 && !hasCompleted) {
|
|
11154
11441
|
setHasCompleted(true);
|
|
@@ -11157,7 +11444,7 @@ var VideoPlayer = ({
|
|
|
11157
11444
|
},
|
|
11158
11445
|
[hasCompleted, onVideoComplete]
|
|
11159
11446
|
);
|
|
11160
|
-
const handleTimeUpdate =
|
|
11447
|
+
const handleTimeUpdate = useCallback6(() => {
|
|
11161
11448
|
const video = videoRef.current;
|
|
11162
11449
|
if (!video) return;
|
|
11163
11450
|
const current = video.currentTime;
|
|
@@ -11170,12 +11457,12 @@ var VideoPlayer = ({
|
|
|
11170
11457
|
checkVideoCompletion(progressPercent);
|
|
11171
11458
|
}
|
|
11172
11459
|
}, [duration, saveProgress, onTimeUpdate, onProgress, checkVideoCompletion]);
|
|
11173
|
-
const handleLoadedMetadata =
|
|
11460
|
+
const handleLoadedMetadata = useCallback6(() => {
|
|
11174
11461
|
if (videoRef.current) {
|
|
11175
11462
|
setDuration(videoRef.current.duration);
|
|
11176
11463
|
}
|
|
11177
11464
|
}, []);
|
|
11178
|
-
|
|
11465
|
+
useEffect22(() => {
|
|
11179
11466
|
const controller = new AbortController();
|
|
11180
11467
|
const validateSubtitles = async () => {
|
|
11181
11468
|
if (!subtitles) {
|
|
@@ -11222,12 +11509,12 @@ var VideoPlayer = ({
|
|
|
11222
11509
|
controller.abort();
|
|
11223
11510
|
};
|
|
11224
11511
|
}, [subtitles]);
|
|
11225
|
-
|
|
11512
|
+
useEffect22(() => {
|
|
11226
11513
|
if (trackRef.current?.track) {
|
|
11227
11514
|
trackRef.current.track.mode = showCaptions && subtitles && subtitlesValidation === "valid" ? "showing" : "hidden";
|
|
11228
11515
|
}
|
|
11229
11516
|
}, [subtitles, showCaptions, subtitlesValidation]);
|
|
11230
|
-
|
|
11517
|
+
useEffect22(() => {
|
|
11231
11518
|
const handleVisibilityChange = () => {
|
|
11232
11519
|
if (document.hidden && isPlaying && videoRef.current) {
|
|
11233
11520
|
videoRef.current.pause();
|
|
@@ -11249,54 +11536,54 @@ var VideoPlayer = ({
|
|
|
11249
11536
|
};
|
|
11250
11537
|
}, [isPlaying, clearControlsTimeout]);
|
|
11251
11538
|
const progressPercentage = duration > 0 ? currentTime / duration * 100 : 0;
|
|
11252
|
-
const getIconSize2 =
|
|
11539
|
+
const getIconSize2 = useCallback6(() => {
|
|
11253
11540
|
if (isTinyMobile) return 18;
|
|
11254
11541
|
if (isUltraSmallMobile) return 20;
|
|
11255
11542
|
return 24;
|
|
11256
11543
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
11257
|
-
const getControlsPadding =
|
|
11544
|
+
const getControlsPadding = useCallback6(() => {
|
|
11258
11545
|
if (isTinyMobile) return "px-2 pb-2 pt-1";
|
|
11259
11546
|
if (isUltraSmallMobile) return "px-3 pb-3 pt-1";
|
|
11260
11547
|
return "px-4 pb-4";
|
|
11261
11548
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
11262
|
-
const getControlsGap =
|
|
11549
|
+
const getControlsGap = useCallback6(() => {
|
|
11263
11550
|
if (isTinyMobile) return "gap-1";
|
|
11264
11551
|
if (isUltraSmallMobile) return "gap-2";
|
|
11265
11552
|
return "gap-4";
|
|
11266
11553
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
11267
|
-
const getProgressBarPadding =
|
|
11554
|
+
const getProgressBarPadding = useCallback6(() => {
|
|
11268
11555
|
if (isTinyMobile) return "px-2 pb-1";
|
|
11269
11556
|
if (isUltraSmallMobile) return "px-3 pb-1";
|
|
11270
11557
|
return "px-4 pb-2";
|
|
11271
11558
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
11272
|
-
const getCenterPlayButtonPosition =
|
|
11559
|
+
const getCenterPlayButtonPosition = useCallback6(() => {
|
|
11273
11560
|
if (isTinyMobile) return "items-center justify-center -translate-y-12";
|
|
11274
11561
|
if (isUltraSmallMobile) return "items-center justify-center -translate-y-8";
|
|
11275
11562
|
return "items-center justify-center";
|
|
11276
11563
|
}, [isTinyMobile, isUltraSmallMobile]);
|
|
11277
|
-
const getTopControlsOpacity =
|
|
11564
|
+
const getTopControlsOpacity = useCallback6(() => {
|
|
11278
11565
|
return showControls ? "opacity-100" : "opacity-0";
|
|
11279
11566
|
}, [showControls]);
|
|
11280
|
-
const getBottomControlsOpacity =
|
|
11567
|
+
const getBottomControlsOpacity = useCallback6(() => {
|
|
11281
11568
|
return showControls ? "opacity-100" : "opacity-0";
|
|
11282
11569
|
}, [showControls]);
|
|
11283
|
-
const seekBackward =
|
|
11570
|
+
const seekBackward = useCallback6(() => {
|
|
11284
11571
|
if (videoRef.current) {
|
|
11285
11572
|
videoRef.current.currentTime -= 10;
|
|
11286
11573
|
}
|
|
11287
11574
|
}, []);
|
|
11288
|
-
const seekForward =
|
|
11575
|
+
const seekForward = useCallback6(() => {
|
|
11289
11576
|
if (videoRef.current) {
|
|
11290
11577
|
videoRef.current.currentTime += 10;
|
|
11291
11578
|
}
|
|
11292
11579
|
}, []);
|
|
11293
|
-
const increaseVolume =
|
|
11580
|
+
const increaseVolume = useCallback6(() => {
|
|
11294
11581
|
handleVolumeChange(Math.min(100, volume * 100 + 10));
|
|
11295
11582
|
}, [handleVolumeChange, volume]);
|
|
11296
|
-
const decreaseVolume =
|
|
11583
|
+
const decreaseVolume = useCallback6(() => {
|
|
11297
11584
|
handleVolumeChange(Math.max(0, volume * 100 - 10));
|
|
11298
11585
|
}, [handleVolumeChange, volume]);
|
|
11299
|
-
const handleVideoKeyDown =
|
|
11586
|
+
const handleVideoKeyDown = useCallback6(
|
|
11300
11587
|
(e) => {
|
|
11301
11588
|
if (!e.key) return;
|
|
11302
11589
|
e.stopPropagation();
|
|
@@ -11331,10 +11618,10 @@ var VideoPlayer = ({
|
|
|
11331
11618
|
]
|
|
11332
11619
|
);
|
|
11333
11620
|
const groupedSubTitleValid = subtitles && subtitlesValidation === "valid";
|
|
11334
|
-
return /* @__PURE__ */
|
|
11335
|
-
(title || subtitleText) && /* @__PURE__ */
|
|
11336
|
-
/* @__PURE__ */
|
|
11337
|
-
title && /* @__PURE__ */
|
|
11621
|
+
return /* @__PURE__ */ jsxs44("div", { className: cn("flex flex-col", className), children: [
|
|
11622
|
+
(title || subtitleText) && /* @__PURE__ */ jsxs44("div", { className: "bg-subject-1 px-8 py-4 flex items-end justify-between min-h-20", children: [
|
|
11623
|
+
/* @__PURE__ */ jsxs44("div", { className: "flex flex-col gap-1", children: [
|
|
11624
|
+
title && /* @__PURE__ */ jsx57(
|
|
11338
11625
|
Text_default,
|
|
11339
11626
|
{
|
|
11340
11627
|
as: "h2",
|
|
@@ -11345,7 +11632,7 @@ var VideoPlayer = ({
|
|
|
11345
11632
|
children: title
|
|
11346
11633
|
}
|
|
11347
11634
|
),
|
|
11348
|
-
subtitleText && /* @__PURE__ */
|
|
11635
|
+
subtitleText && /* @__PURE__ */ jsx57(
|
|
11349
11636
|
Text_default,
|
|
11350
11637
|
{
|
|
11351
11638
|
as: "p",
|
|
@@ -11357,7 +11644,7 @@ var VideoPlayer = ({
|
|
|
11357
11644
|
}
|
|
11358
11645
|
)
|
|
11359
11646
|
] }),
|
|
11360
|
-
showDownloadButton && downloadContent && /* @__PURE__ */
|
|
11647
|
+
showDownloadButton && downloadContent && /* @__PURE__ */ jsx57(
|
|
11361
11648
|
DownloadButton_default,
|
|
11362
11649
|
{
|
|
11363
11650
|
content: downloadContent,
|
|
@@ -11369,7 +11656,7 @@ var VideoPlayer = ({
|
|
|
11369
11656
|
}
|
|
11370
11657
|
)
|
|
11371
11658
|
] }),
|
|
11372
|
-
/* @__PURE__ */
|
|
11659
|
+
/* @__PURE__ */ jsxs44(
|
|
11373
11660
|
"section",
|
|
11374
11661
|
{
|
|
11375
11662
|
className: cn(
|
|
@@ -11384,7 +11671,7 @@ var VideoPlayer = ({
|
|
|
11384
11671
|
onTouchStart: handleMouseEnter,
|
|
11385
11672
|
onMouseLeave: handleMouseLeave,
|
|
11386
11673
|
children: [
|
|
11387
|
-
/* @__PURE__ */
|
|
11674
|
+
/* @__PURE__ */ jsx57(
|
|
11388
11675
|
"video",
|
|
11389
11676
|
{
|
|
11390
11677
|
ref: videoRef,
|
|
@@ -11399,7 +11686,7 @@ var VideoPlayer = ({
|
|
|
11399
11686
|
onKeyDown: handleVideoKeyDown,
|
|
11400
11687
|
tabIndex: 0,
|
|
11401
11688
|
"aria-label": title ? `Video: ${title}` : "Video player",
|
|
11402
|
-
children: /* @__PURE__ */
|
|
11689
|
+
children: /* @__PURE__ */ jsx57(
|
|
11403
11690
|
"track",
|
|
11404
11691
|
{
|
|
11405
11692
|
ref: trackRef,
|
|
@@ -11412,17 +11699,17 @@ var VideoPlayer = ({
|
|
|
11412
11699
|
)
|
|
11413
11700
|
}
|
|
11414
11701
|
),
|
|
11415
|
-
!isPlaying && /* @__PURE__ */
|
|
11702
|
+
!isPlaying && /* @__PURE__ */ jsx57(
|
|
11416
11703
|
"div",
|
|
11417
11704
|
{
|
|
11418
11705
|
className: cn(
|
|
11419
11706
|
"absolute inset-0 flex bg-black/30 transition-opacity",
|
|
11420
11707
|
getCenterPlayButtonPosition()
|
|
11421
11708
|
),
|
|
11422
|
-
children: /* @__PURE__ */
|
|
11709
|
+
children: /* @__PURE__ */ jsx57(
|
|
11423
11710
|
IconButton_default,
|
|
11424
11711
|
{
|
|
11425
|
-
icon: /* @__PURE__ */
|
|
11712
|
+
icon: /* @__PURE__ */ jsx57(Play2, { size: 32, weight: "regular", className: "ml-1" }),
|
|
11426
11713
|
onClick: togglePlayPause,
|
|
11427
11714
|
"aria-label": "Play video",
|
|
11428
11715
|
className: "!bg-transparent !text-white !w-auto !h-auto hover:!bg-transparent hover:!text-gray-200"
|
|
@@ -11430,17 +11717,17 @@ var VideoPlayer = ({
|
|
|
11430
11717
|
)
|
|
11431
11718
|
}
|
|
11432
11719
|
),
|
|
11433
|
-
/* @__PURE__ */
|
|
11720
|
+
/* @__PURE__ */ jsx57(
|
|
11434
11721
|
"div",
|
|
11435
11722
|
{
|
|
11436
11723
|
className: cn(
|
|
11437
11724
|
"absolute top-0 left-0 right-0 p-4 bg-gradient-to-b from-black/70 to-transparent transition-opacity",
|
|
11438
11725
|
getTopControlsOpacity()
|
|
11439
11726
|
),
|
|
11440
|
-
children: /* @__PURE__ */
|
|
11727
|
+
children: /* @__PURE__ */ jsx57("div", { className: "flex justify-start", children: /* @__PURE__ */ jsx57(
|
|
11441
11728
|
IconButton_default,
|
|
11442
11729
|
{
|
|
11443
|
-
icon: isFullscreen ? /* @__PURE__ */
|
|
11730
|
+
icon: isFullscreen ? /* @__PURE__ */ jsx57(ArrowsInSimple, { size: 24 }) : /* @__PURE__ */ jsx57(ArrowsOutSimple, { size: 24 }),
|
|
11444
11731
|
onClick: toggleFullscreen,
|
|
11445
11732
|
"aria-label": isFullscreen ? "Exit fullscreen" : "Enter fullscreen",
|
|
11446
11733
|
className: "!bg-transparent !text-white hover:!bg-white/20"
|
|
@@ -11448,7 +11735,7 @@ var VideoPlayer = ({
|
|
|
11448
11735
|
) })
|
|
11449
11736
|
}
|
|
11450
11737
|
),
|
|
11451
|
-
/* @__PURE__ */
|
|
11738
|
+
/* @__PURE__ */ jsxs44(
|
|
11452
11739
|
"div",
|
|
11453
11740
|
{
|
|
11454
11741
|
className: cn(
|
|
@@ -11456,7 +11743,7 @@ var VideoPlayer = ({
|
|
|
11456
11743
|
getBottomControlsOpacity()
|
|
11457
11744
|
),
|
|
11458
11745
|
children: [
|
|
11459
|
-
/* @__PURE__ */
|
|
11746
|
+
/* @__PURE__ */ jsx57(
|
|
11460
11747
|
ProgressBar2,
|
|
11461
11748
|
{
|
|
11462
11749
|
currentTime,
|
|
@@ -11466,7 +11753,7 @@ var VideoPlayer = ({
|
|
|
11466
11753
|
className: getProgressBarPadding()
|
|
11467
11754
|
}
|
|
11468
11755
|
),
|
|
11469
|
-
/* @__PURE__ */
|
|
11756
|
+
/* @__PURE__ */ jsxs44(
|
|
11470
11757
|
"div",
|
|
11471
11758
|
{
|
|
11472
11759
|
className: cn(
|
|
@@ -11474,17 +11761,17 @@ var VideoPlayer = ({
|
|
|
11474
11761
|
getControlsPadding()
|
|
11475
11762
|
),
|
|
11476
11763
|
children: [
|
|
11477
|
-
/* @__PURE__ */
|
|
11478
|
-
/* @__PURE__ */
|
|
11764
|
+
/* @__PURE__ */ jsxs44("div", { className: cn("flex items-center", getControlsGap()), children: [
|
|
11765
|
+
/* @__PURE__ */ jsx57(
|
|
11479
11766
|
IconButton_default,
|
|
11480
11767
|
{
|
|
11481
|
-
icon: isPlaying ? /* @__PURE__ */
|
|
11768
|
+
icon: isPlaying ? /* @__PURE__ */ jsx57(Pause, { size: getIconSize2() }) : /* @__PURE__ */ jsx57(Play2, { size: getIconSize2() }),
|
|
11482
11769
|
onClick: togglePlayPause,
|
|
11483
11770
|
"aria-label": isPlaying ? "Pause" : "Play",
|
|
11484
11771
|
className: "!bg-transparent !text-white hover:!bg-white/20"
|
|
11485
11772
|
}
|
|
11486
11773
|
),
|
|
11487
|
-
/* @__PURE__ */
|
|
11774
|
+
/* @__PURE__ */ jsx57(
|
|
11488
11775
|
VolumeControls,
|
|
11489
11776
|
{
|
|
11490
11777
|
volume,
|
|
@@ -11495,10 +11782,10 @@ var VideoPlayer = ({
|
|
|
11495
11782
|
showSlider: !isUltraSmallMobile
|
|
11496
11783
|
}
|
|
11497
11784
|
),
|
|
11498
|
-
groupedSubTitleValid && /* @__PURE__ */
|
|
11785
|
+
groupedSubTitleValid && /* @__PURE__ */ jsx57(
|
|
11499
11786
|
IconButton_default,
|
|
11500
11787
|
{
|
|
11501
|
-
icon: /* @__PURE__ */
|
|
11788
|
+
icon: /* @__PURE__ */ jsx57(ClosedCaptioning, { size: getIconSize2() }),
|
|
11502
11789
|
onClick: toggleCaptions,
|
|
11503
11790
|
"aria-label": showCaptions ? "Hide captions" : "Show captions",
|
|
11504
11791
|
className: cn(
|
|
@@ -11507,13 +11794,13 @@ var VideoPlayer = ({
|
|
|
11507
11794
|
)
|
|
11508
11795
|
}
|
|
11509
11796
|
),
|
|
11510
|
-
/* @__PURE__ */
|
|
11797
|
+
/* @__PURE__ */ jsxs44(Text_default, { size: "sm", weight: "medium", color: "text-white", children: [
|
|
11511
11798
|
formatTime(currentTime),
|
|
11512
11799
|
" / ",
|
|
11513
11800
|
formatTime(duration)
|
|
11514
11801
|
] })
|
|
11515
11802
|
] }),
|
|
11516
|
-
/* @__PURE__ */
|
|
11803
|
+
/* @__PURE__ */ jsx57("div", { className: "flex items-center gap-4", children: /* @__PURE__ */ jsx57(
|
|
11517
11804
|
SpeedMenu,
|
|
11518
11805
|
{
|
|
11519
11806
|
showSpeedMenu,
|
|
@@ -11539,9 +11826,9 @@ var VideoPlayer = ({
|
|
|
11539
11826
|
var VideoPlayer_default = VideoPlayer;
|
|
11540
11827
|
|
|
11541
11828
|
// src/components/Whiteboard/Whiteboard.tsx
|
|
11542
|
-
import { useCallback as
|
|
11829
|
+
import { useCallback as useCallback7, useState as useState22 } from "react";
|
|
11543
11830
|
import { ArrowsOut } from "phosphor-react";
|
|
11544
|
-
import { Fragment as
|
|
11831
|
+
import { Fragment as Fragment11, jsx as jsx58, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
11545
11832
|
var IMAGE_WIDTH = 225;
|
|
11546
11833
|
var IMAGE_HEIGHT = 90;
|
|
11547
11834
|
var Whiteboard = ({
|
|
@@ -11552,8 +11839,8 @@ var Whiteboard = ({
|
|
|
11552
11839
|
imagesPerRow = 2,
|
|
11553
11840
|
...rest
|
|
11554
11841
|
}) => {
|
|
11555
|
-
const [imageErrors, setImageErrors] =
|
|
11556
|
-
const handleDownload =
|
|
11842
|
+
const [imageErrors, setImageErrors] = useState22(/* @__PURE__ */ new Set());
|
|
11843
|
+
const handleDownload = useCallback7(
|
|
11557
11844
|
(image) => {
|
|
11558
11845
|
if (onDownload) {
|
|
11559
11846
|
onDownload(image);
|
|
@@ -11570,7 +11857,7 @@ var Whiteboard = ({
|
|
|
11570
11857
|
},
|
|
11571
11858
|
[onDownload]
|
|
11572
11859
|
);
|
|
11573
|
-
const handleImageError =
|
|
11860
|
+
const handleImageError = useCallback7((imageId) => {
|
|
11574
11861
|
setImageErrors((prev) => new Set(prev).add(imageId));
|
|
11575
11862
|
}, []);
|
|
11576
11863
|
const gridColsClass = images?.length === 1 ? "grid-cols-1" : {
|
|
@@ -11579,7 +11866,7 @@ var Whiteboard = ({
|
|
|
11579
11866
|
4: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4"
|
|
11580
11867
|
}[imagesPerRow];
|
|
11581
11868
|
if (!images || images.length === 0) {
|
|
11582
|
-
return /* @__PURE__ */
|
|
11869
|
+
return /* @__PURE__ */ jsx58(
|
|
11583
11870
|
"div",
|
|
11584
11871
|
{
|
|
11585
11872
|
className: cn(
|
|
@@ -11587,11 +11874,11 @@ var Whiteboard = ({
|
|
|
11587
11874
|
className
|
|
11588
11875
|
),
|
|
11589
11876
|
...rest,
|
|
11590
|
-
children: /* @__PURE__ */
|
|
11877
|
+
children: /* @__PURE__ */ jsx58("p", { className: "text-gray-400 text-sm", children: "Nenhuma imagem dispon\xEDvel" })
|
|
11591
11878
|
}
|
|
11592
11879
|
);
|
|
11593
11880
|
}
|
|
11594
|
-
return /* @__PURE__ */
|
|
11881
|
+
return /* @__PURE__ */ jsx58(
|
|
11595
11882
|
"div",
|
|
11596
11883
|
{
|
|
11597
11884
|
className: cn(
|
|
@@ -11599,7 +11886,7 @@ var Whiteboard = ({
|
|
|
11599
11886
|
className
|
|
11600
11887
|
),
|
|
11601
11888
|
...rest,
|
|
11602
|
-
children: /* @__PURE__ */
|
|
11889
|
+
children: /* @__PURE__ */ jsx58("div", { className: cn("grid gap-4", gridColsClass), children: images.map((image) => /* @__PURE__ */ jsxs45(
|
|
11603
11890
|
"div",
|
|
11604
11891
|
{
|
|
11605
11892
|
className: "relative group overflow-hidden bg-gray-100 rounded-lg",
|
|
@@ -11607,7 +11894,7 @@ var Whiteboard = ({
|
|
|
11607
11894
|
width: `${IMAGE_WIDTH}px`
|
|
11608
11895
|
},
|
|
11609
11896
|
children: [
|
|
11610
|
-
/* @__PURE__ */
|
|
11897
|
+
/* @__PURE__ */ jsx58(
|
|
11611
11898
|
"div",
|
|
11612
11899
|
{
|
|
11613
11900
|
className: "relative",
|
|
@@ -11615,8 +11902,8 @@ var Whiteboard = ({
|
|
|
11615
11902
|
width: `${IMAGE_WIDTH}px`,
|
|
11616
11903
|
height: `${IMAGE_HEIGHT}px`
|
|
11617
11904
|
},
|
|
11618
|
-
children: imageErrors.has(image.id) ? /* @__PURE__ */
|
|
11619
|
-
/* @__PURE__ */
|
|
11905
|
+
children: imageErrors.has(image.id) ? /* @__PURE__ */ jsx58("div", { className: "absolute inset-0 flex items-center justify-center bg-gray-200", children: /* @__PURE__ */ jsx58("p", { className: "text-gray-500 text-sm text-center px-2", children: "Imagem indispon\xEDvel" }) }) : /* @__PURE__ */ jsxs45(Fragment11, { children: [
|
|
11906
|
+
/* @__PURE__ */ jsx58(
|
|
11620
11907
|
"img",
|
|
11621
11908
|
{
|
|
11622
11909
|
src: image.imageUrl,
|
|
@@ -11626,18 +11913,18 @@ var Whiteboard = ({
|
|
|
11626
11913
|
onError: () => handleImageError(image.id)
|
|
11627
11914
|
}
|
|
11628
11915
|
),
|
|
11629
|
-
/* @__PURE__ */
|
|
11916
|
+
/* @__PURE__ */ jsx58("div", { className: "absolute inset-0 bg-gradient-to-t from-black/20 to-transparent" })
|
|
11630
11917
|
] })
|
|
11631
11918
|
}
|
|
11632
11919
|
),
|
|
11633
|
-
showDownload && /* @__PURE__ */
|
|
11920
|
+
showDownload && /* @__PURE__ */ jsx58(
|
|
11634
11921
|
"button",
|
|
11635
11922
|
{
|
|
11636
11923
|
type: "button",
|
|
11637
11924
|
onClick: () => handleDownload(image),
|
|
11638
11925
|
className: "cursor-pointer absolute bottom-3 right-3 flex items-center justify-center bg-black/20 backdrop-blur-sm rounded hover:bg-black/30 transition-colors duration-200 group/button w-6 h-6",
|
|
11639
11926
|
"aria-label": `Download ${image.title || "imagem"}`,
|
|
11640
|
-
children: /* @__PURE__ */
|
|
11927
|
+
children: /* @__PURE__ */ jsx58(
|
|
11641
11928
|
ArrowsOut,
|
|
11642
11929
|
{
|
|
11643
11930
|
size: 24,
|
|
@@ -11660,13 +11947,13 @@ var Whiteboard_default = Whiteboard;
|
|
|
11660
11947
|
import {
|
|
11661
11948
|
createContext,
|
|
11662
11949
|
useContext,
|
|
11663
|
-
useEffect as
|
|
11664
|
-
useState as
|
|
11665
|
-
useCallback as
|
|
11666
|
-
useMemo as
|
|
11950
|
+
useEffect as useEffect23,
|
|
11951
|
+
useState as useState23,
|
|
11952
|
+
useCallback as useCallback8,
|
|
11953
|
+
useMemo as useMemo11
|
|
11667
11954
|
} from "react";
|
|
11668
11955
|
import { useLocation, Navigate } from "react-router-dom";
|
|
11669
|
-
import { Fragment as
|
|
11956
|
+
import { Fragment as Fragment12, jsx as jsx59 } from "react/jsx-runtime";
|
|
11670
11957
|
var AuthContext = createContext(void 0);
|
|
11671
11958
|
var AuthProvider = ({
|
|
11672
11959
|
children,
|
|
@@ -11677,12 +11964,12 @@ var AuthProvider = ({
|
|
|
11677
11964
|
getSessionFn,
|
|
11678
11965
|
getTokensFn
|
|
11679
11966
|
}) => {
|
|
11680
|
-
const [authState, setAuthState] =
|
|
11967
|
+
const [authState, setAuthState] = useState23({
|
|
11681
11968
|
isAuthenticated: false,
|
|
11682
11969
|
isLoading: true,
|
|
11683
11970
|
...initialAuthState
|
|
11684
11971
|
});
|
|
11685
|
-
const checkAuth =
|
|
11972
|
+
const checkAuth = useCallback8(async () => {
|
|
11686
11973
|
try {
|
|
11687
11974
|
setAuthState((prev) => ({ ...prev, isLoading: true }));
|
|
11688
11975
|
if (!checkAuthFn) {
|
|
@@ -11713,7 +12000,7 @@ var AuthProvider = ({
|
|
|
11713
12000
|
return false;
|
|
11714
12001
|
}
|
|
11715
12002
|
}, [checkAuthFn, getUserFn, getSessionFn, getTokensFn]);
|
|
11716
|
-
const signOut =
|
|
12003
|
+
const signOut = useCallback8(() => {
|
|
11717
12004
|
if (signOutFn) {
|
|
11718
12005
|
signOutFn();
|
|
11719
12006
|
}
|
|
@@ -11725,10 +12012,10 @@ var AuthProvider = ({
|
|
|
11725
12012
|
tokens: void 0
|
|
11726
12013
|
}));
|
|
11727
12014
|
}, [signOutFn]);
|
|
11728
|
-
|
|
12015
|
+
useEffect23(() => {
|
|
11729
12016
|
checkAuth();
|
|
11730
12017
|
}, [checkAuth]);
|
|
11731
|
-
const contextValue =
|
|
12018
|
+
const contextValue = useMemo11(
|
|
11732
12019
|
() => ({
|
|
11733
12020
|
...authState,
|
|
11734
12021
|
checkAuth,
|
|
@@ -11736,7 +12023,7 @@ var AuthProvider = ({
|
|
|
11736
12023
|
}),
|
|
11737
12024
|
[authState, checkAuth, signOut]
|
|
11738
12025
|
);
|
|
11739
|
-
return /* @__PURE__ */
|
|
12026
|
+
return /* @__PURE__ */ jsx59(AuthContext.Provider, { value: contextValue, children });
|
|
11740
12027
|
};
|
|
11741
12028
|
var useAuth = () => {
|
|
11742
12029
|
const context = useContext(AuthContext);
|
|
@@ -11752,9 +12039,9 @@ var ProtectedRoute = ({
|
|
|
11752
12039
|
additionalCheck
|
|
11753
12040
|
}) => {
|
|
11754
12041
|
const { isAuthenticated, isLoading, ...authState } = useAuth();
|
|
11755
|
-
const defaultLoadingComponent = /* @__PURE__ */
|
|
12042
|
+
const defaultLoadingComponent = /* @__PURE__ */ jsx59("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsx59("div", { className: "text-text-950 text-lg", children: "Carregando..." }) });
|
|
11756
12043
|
if (isLoading) {
|
|
11757
|
-
return /* @__PURE__ */
|
|
12044
|
+
return /* @__PURE__ */ jsx59(Fragment12, { children: loadingComponent || defaultLoadingComponent });
|
|
11758
12045
|
}
|
|
11759
12046
|
if (!isAuthenticated) {
|
|
11760
12047
|
if (typeof window !== "undefined") {
|
|
@@ -11765,12 +12052,12 @@ var ProtectedRoute = ({
|
|
|
11765
12052
|
return null;
|
|
11766
12053
|
}
|
|
11767
12054
|
}
|
|
11768
|
-
return /* @__PURE__ */
|
|
12055
|
+
return /* @__PURE__ */ jsx59(Navigate, { to: redirectTo, replace: true });
|
|
11769
12056
|
}
|
|
11770
12057
|
if (additionalCheck && !additionalCheck({ isAuthenticated, isLoading, ...authState })) {
|
|
11771
|
-
return /* @__PURE__ */
|
|
12058
|
+
return /* @__PURE__ */ jsx59(Navigate, { to: redirectTo, replace: true });
|
|
11772
12059
|
}
|
|
11773
|
-
return /* @__PURE__ */
|
|
12060
|
+
return /* @__PURE__ */ jsx59(Fragment12, { children });
|
|
11774
12061
|
};
|
|
11775
12062
|
var PublicRoute = ({
|
|
11776
12063
|
children,
|
|
@@ -11780,15 +12067,15 @@ var PublicRoute = ({
|
|
|
11780
12067
|
}) => {
|
|
11781
12068
|
const { isAuthenticated, isLoading } = useAuth();
|
|
11782
12069
|
if (checkAuthBeforeRender && isLoading) {
|
|
11783
|
-
return /* @__PURE__ */
|
|
12070
|
+
return /* @__PURE__ */ jsx59("div", { className: "flex items-center justify-center min-h-screen", children: /* @__PURE__ */ jsx59("div", { className: "text-text-950 text-lg", children: "Carregando..." }) });
|
|
11784
12071
|
}
|
|
11785
12072
|
if (isAuthenticated && redirectIfAuthenticated) {
|
|
11786
|
-
return /* @__PURE__ */
|
|
12073
|
+
return /* @__PURE__ */ jsx59(Navigate, { to: redirectTo, replace: true });
|
|
11787
12074
|
}
|
|
11788
|
-
return /* @__PURE__ */
|
|
12075
|
+
return /* @__PURE__ */ jsx59(Fragment12, { children });
|
|
11789
12076
|
};
|
|
11790
12077
|
var withAuth = (Component, options = {}) => {
|
|
11791
|
-
return (props) => /* @__PURE__ */
|
|
12078
|
+
return (props) => /* @__PURE__ */ jsx59(ProtectedRoute, { ...options, children: /* @__PURE__ */ jsx59(Component, { ...props }) });
|
|
11792
12079
|
};
|
|
11793
12080
|
var useAuthGuard = (options = {}) => {
|
|
11794
12081
|
const authState = useAuth();
|
|
@@ -11803,7 +12090,7 @@ var useAuthGuard = (options = {}) => {
|
|
|
11803
12090
|
var useRouteAuth = (fallbackPath = "/") => {
|
|
11804
12091
|
const { isAuthenticated, isLoading } = useAuth();
|
|
11805
12092
|
const location = useLocation();
|
|
11806
|
-
const redirectToLogin = () => /* @__PURE__ */
|
|
12093
|
+
const redirectToLogin = () => /* @__PURE__ */ jsx59(Navigate, { to: fallbackPath, state: { from: location }, replace: true });
|
|
11807
12094
|
return {
|
|
11808
12095
|
isAuthenticated,
|
|
11809
12096
|
isLoading,
|
|
@@ -11840,11 +12127,11 @@ var getRootDomain = () => {
|
|
|
11840
12127
|
import {
|
|
11841
12128
|
forwardRef as forwardRef18,
|
|
11842
12129
|
useId as useId9,
|
|
11843
|
-
useState as
|
|
11844
|
-
useEffect as
|
|
12130
|
+
useState as useState24,
|
|
12131
|
+
useEffect as useEffect24
|
|
11845
12132
|
} from "react";
|
|
11846
12133
|
import { CaretRight as CaretRight7 } from "phosphor-react";
|
|
11847
|
-
import { jsx as
|
|
12134
|
+
import { jsx as jsx60, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
11848
12135
|
var CardAccordation = forwardRef18(
|
|
11849
12136
|
({
|
|
11850
12137
|
trigger,
|
|
@@ -11857,13 +12144,13 @@ var CardAccordation = forwardRef18(
|
|
|
11857
12144
|
disabled = false,
|
|
11858
12145
|
...props
|
|
11859
12146
|
}, ref) => {
|
|
11860
|
-
const [internalExpanded, setInternalExpanded] =
|
|
12147
|
+
const [internalExpanded, setInternalExpanded] = useState24(defaultExpanded);
|
|
11861
12148
|
const generatedId = useId9();
|
|
11862
12149
|
const contentId = value ? `accordion-content-${value}` : generatedId;
|
|
11863
12150
|
const headerId = value ? `accordion-header-${value}` : `${generatedId}-header`;
|
|
11864
12151
|
const isControlled = controlledExpanded !== void 0;
|
|
11865
12152
|
const isExpanded = isControlled ? controlledExpanded : internalExpanded;
|
|
11866
|
-
|
|
12153
|
+
useEffect24(() => {
|
|
11867
12154
|
if (isControlled) {
|
|
11868
12155
|
setInternalExpanded(controlledExpanded);
|
|
11869
12156
|
}
|
|
@@ -11883,7 +12170,7 @@ var CardAccordation = forwardRef18(
|
|
|
11883
12170
|
handleToggle();
|
|
11884
12171
|
}
|
|
11885
12172
|
};
|
|
11886
|
-
return /* @__PURE__ */
|
|
12173
|
+
return /* @__PURE__ */ jsxs46(
|
|
11887
12174
|
CardBase,
|
|
11888
12175
|
{
|
|
11889
12176
|
ref,
|
|
@@ -11893,7 +12180,7 @@ var CardAccordation = forwardRef18(
|
|
|
11893
12180
|
className: cn("overflow-hidden", className),
|
|
11894
12181
|
...props,
|
|
11895
12182
|
children: [
|
|
11896
|
-
/* @__PURE__ */
|
|
12183
|
+
/* @__PURE__ */ jsxs46(
|
|
11897
12184
|
"button",
|
|
11898
12185
|
{
|
|
11899
12186
|
id: headerId,
|
|
@@ -11911,7 +12198,7 @@ var CardAccordation = forwardRef18(
|
|
|
11911
12198
|
"data-value": value,
|
|
11912
12199
|
children: [
|
|
11913
12200
|
trigger,
|
|
11914
|
-
/* @__PURE__ */
|
|
12201
|
+
/* @__PURE__ */ jsx60(
|
|
11915
12202
|
CaretRight7,
|
|
11916
12203
|
{
|
|
11917
12204
|
size: 20,
|
|
@@ -11926,7 +12213,7 @@ var CardAccordation = forwardRef18(
|
|
|
11926
12213
|
]
|
|
11927
12214
|
}
|
|
11928
12215
|
),
|
|
11929
|
-
/* @__PURE__ */
|
|
12216
|
+
/* @__PURE__ */ jsx60(
|
|
11930
12217
|
"section",
|
|
11931
12218
|
{
|
|
11932
12219
|
id: contentId,
|
|
@@ -11938,7 +12225,7 @@ var CardAccordation = forwardRef18(
|
|
|
11938
12225
|
),
|
|
11939
12226
|
"data-testid": "accordion-content",
|
|
11940
12227
|
"data-value": value,
|
|
11941
|
-
children: /* @__PURE__ */
|
|
12228
|
+
children: /* @__PURE__ */ jsx60("div", { className: "p-4 pt-0", children })
|
|
11942
12229
|
}
|
|
11943
12230
|
)
|
|
11944
12231
|
]
|
|
@@ -11954,12 +12241,12 @@ import {
|
|
|
11954
12241
|
cloneElement as cloneElement8,
|
|
11955
12242
|
forwardRef as forwardRef19,
|
|
11956
12243
|
isValidElement as isValidElement7,
|
|
11957
|
-
useEffect as
|
|
12244
|
+
useEffect as useEffect25,
|
|
11958
12245
|
useRef as useRef12,
|
|
11959
|
-
useState as
|
|
12246
|
+
useState as useState25
|
|
11960
12247
|
} from "react";
|
|
11961
12248
|
import { create as create10 } from "zustand";
|
|
11962
|
-
import { jsx as
|
|
12249
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
11963
12250
|
function createAccordionGroupStore(type, initialValue, collapsible) {
|
|
11964
12251
|
return create10((set, get) => ({
|
|
11965
12252
|
type,
|
|
@@ -12025,7 +12312,7 @@ var AccordionGroup = forwardRef19(
|
|
|
12025
12312
|
className,
|
|
12026
12313
|
...props
|
|
12027
12314
|
}, ref) => {
|
|
12028
|
-
const [internalValue, setInternalValue] =
|
|
12315
|
+
const [internalValue, setInternalValue] = useState25(
|
|
12029
12316
|
defaultValue || (type === "single" ? "" : [])
|
|
12030
12317
|
);
|
|
12031
12318
|
const isControlled = controlledValue !== void 0;
|
|
@@ -12050,10 +12337,10 @@ var AccordionGroup = forwardRef19(
|
|
|
12050
12337
|
);
|
|
12051
12338
|
}
|
|
12052
12339
|
const store = storeRef.current;
|
|
12053
|
-
|
|
12340
|
+
useEffect25(() => {
|
|
12054
12341
|
store.setState({ value: currentValue });
|
|
12055
12342
|
}, [currentValue, store]);
|
|
12056
|
-
|
|
12343
|
+
useEffect25(() => {
|
|
12057
12344
|
if (!isControlled) {
|
|
12058
12345
|
setInternalValue((prev) => {
|
|
12059
12346
|
if (type === "single") {
|
|
@@ -12099,15 +12386,15 @@ var AccordionGroup = forwardRef19(
|
|
|
12099
12386
|
indexRef,
|
|
12100
12387
|
handleItemToggle
|
|
12101
12388
|
);
|
|
12102
|
-
return /* @__PURE__ */
|
|
12389
|
+
return /* @__PURE__ */ jsx61("div", { ref, className, ...props, children: enhancedChildren });
|
|
12103
12390
|
}
|
|
12104
12391
|
);
|
|
12105
12392
|
AccordionGroup.displayName = "AccordionGroup";
|
|
12106
12393
|
|
|
12107
12394
|
// src/components/Alternative/Alternative.tsx
|
|
12108
12395
|
import { CheckCircle as CheckCircle4, XCircle as XCircle3 } from "phosphor-react";
|
|
12109
|
-
import { forwardRef as forwardRef20, useId as useId10, useState as
|
|
12110
|
-
import { jsx as
|
|
12396
|
+
import { forwardRef as forwardRef20, useId as useId10, useState as useState26 } from "react";
|
|
12397
|
+
import { jsx as jsx62, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
12111
12398
|
var AlternativesList = ({
|
|
12112
12399
|
alternatives,
|
|
12113
12400
|
name,
|
|
@@ -12122,7 +12409,7 @@ var AlternativesList = ({
|
|
|
12122
12409
|
}) => {
|
|
12123
12410
|
const uniqueId = useId10();
|
|
12124
12411
|
const groupName = name || `alternatives-${uniqueId}`;
|
|
12125
|
-
const [actualValue, setActualValue] =
|
|
12412
|
+
const [actualValue, setActualValue] = useState26(value);
|
|
12126
12413
|
const isReadonly = mode === "readonly";
|
|
12127
12414
|
const getStatusStyles2 = (status, isReadonly2) => {
|
|
12128
12415
|
const hoverClass = isReadonly2 ? "" : "hover:bg-background-50";
|
|
@@ -12138,9 +12425,9 @@ var AlternativesList = ({
|
|
|
12138
12425
|
const getStatusBadge2 = (status) => {
|
|
12139
12426
|
switch (status) {
|
|
12140
12427
|
case "correct":
|
|
12141
|
-
return /* @__PURE__ */
|
|
12428
|
+
return /* @__PURE__ */ jsx62(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ jsx62(CheckCircle4, {}), children: "Resposta correta" });
|
|
12142
12429
|
case "incorrect":
|
|
12143
|
-
return /* @__PURE__ */
|
|
12430
|
+
return /* @__PURE__ */ jsx62(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ jsx62(XCircle3, {}), children: "Resposta incorreta" });
|
|
12144
12431
|
default:
|
|
12145
12432
|
return null;
|
|
12146
12433
|
}
|
|
@@ -12170,10 +12457,10 @@ var AlternativesList = ({
|
|
|
12170
12457
|
const renderRadio = () => {
|
|
12171
12458
|
const radioClasses = `w-6 h-6 rounded-full border-2 cursor-default transition-all duration-200 flex items-center justify-center ${isUserSelected ? "border-primary-950 bg-background" : "border-border-400 bg-background"}`;
|
|
12172
12459
|
const dotClasses = "w-3 h-3 rounded-full bg-primary-950 transition-all duration-200";
|
|
12173
|
-
return /* @__PURE__ */
|
|
12460
|
+
return /* @__PURE__ */ jsx62("div", { className: radioClasses, children: isUserSelected && /* @__PURE__ */ jsx62("div", { className: dotClasses }) });
|
|
12174
12461
|
};
|
|
12175
12462
|
if (layout === "detailed") {
|
|
12176
|
-
return /* @__PURE__ */
|
|
12463
|
+
return /* @__PURE__ */ jsx62(
|
|
12177
12464
|
"div",
|
|
12178
12465
|
{
|
|
12179
12466
|
className: cn(
|
|
@@ -12181,11 +12468,11 @@ var AlternativesList = ({
|
|
|
12181
12468
|
statusStyles,
|
|
12182
12469
|
alternative.disabled ? "opacity-50" : ""
|
|
12183
12470
|
),
|
|
12184
|
-
children: /* @__PURE__ */
|
|
12185
|
-
/* @__PURE__ */
|
|
12186
|
-
/* @__PURE__ */
|
|
12187
|
-
/* @__PURE__ */
|
|
12188
|
-
/* @__PURE__ */
|
|
12471
|
+
children: /* @__PURE__ */ jsxs47("div", { className: "flex items-start justify-between gap-3", children: [
|
|
12472
|
+
/* @__PURE__ */ jsxs47("div", { className: "flex items-start gap-3 flex-1", children: [
|
|
12473
|
+
/* @__PURE__ */ jsx62("div", { className: "mt-1", children: renderRadio() }),
|
|
12474
|
+
/* @__PURE__ */ jsxs47("div", { className: "flex-1", children: [
|
|
12475
|
+
/* @__PURE__ */ jsx62(
|
|
12189
12476
|
"p",
|
|
12190
12477
|
{
|
|
12191
12478
|
className: cn(
|
|
@@ -12195,16 +12482,16 @@ var AlternativesList = ({
|
|
|
12195
12482
|
children: alternative.label
|
|
12196
12483
|
}
|
|
12197
12484
|
),
|
|
12198
|
-
alternative.description && /* @__PURE__ */
|
|
12485
|
+
alternative.description && /* @__PURE__ */ jsx62("p", { className: "text-sm text-text-600 mt-1", children: alternative.description })
|
|
12199
12486
|
] })
|
|
12200
12487
|
] }),
|
|
12201
|
-
statusBadge && /* @__PURE__ */
|
|
12488
|
+
statusBadge && /* @__PURE__ */ jsx62("div", { className: "flex-shrink-0", children: statusBadge })
|
|
12202
12489
|
] })
|
|
12203
12490
|
},
|
|
12204
12491
|
alternativeId
|
|
12205
12492
|
);
|
|
12206
12493
|
}
|
|
12207
|
-
return /* @__PURE__ */
|
|
12494
|
+
return /* @__PURE__ */ jsxs47(
|
|
12208
12495
|
"div",
|
|
12209
12496
|
{
|
|
12210
12497
|
className: cn(
|
|
@@ -12213,9 +12500,9 @@ var AlternativesList = ({
|
|
|
12213
12500
|
alternative.disabled ? "opacity-50" : ""
|
|
12214
12501
|
),
|
|
12215
12502
|
children: [
|
|
12216
|
-
/* @__PURE__ */
|
|
12503
|
+
/* @__PURE__ */ jsxs47("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
12217
12504
|
renderRadio(),
|
|
12218
|
-
/* @__PURE__ */
|
|
12505
|
+
/* @__PURE__ */ jsx62(
|
|
12219
12506
|
"span",
|
|
12220
12507
|
{
|
|
12221
12508
|
className: cn(
|
|
@@ -12226,14 +12513,14 @@ var AlternativesList = ({
|
|
|
12226
12513
|
}
|
|
12227
12514
|
)
|
|
12228
12515
|
] }),
|
|
12229
|
-
statusBadge && /* @__PURE__ */
|
|
12516
|
+
statusBadge && /* @__PURE__ */ jsx62("div", { className: "flex-shrink-0", children: statusBadge })
|
|
12230
12517
|
]
|
|
12231
12518
|
},
|
|
12232
12519
|
alternativeId
|
|
12233
12520
|
);
|
|
12234
12521
|
};
|
|
12235
12522
|
if (isReadonly) {
|
|
12236
|
-
return /* @__PURE__ */
|
|
12523
|
+
return /* @__PURE__ */ jsx62(
|
|
12237
12524
|
"div",
|
|
12238
12525
|
{
|
|
12239
12526
|
className: cn("flex flex-col", getLayoutClasses(), "w-full", className),
|
|
@@ -12243,7 +12530,7 @@ var AlternativesList = ({
|
|
|
12243
12530
|
}
|
|
12244
12531
|
);
|
|
12245
12532
|
}
|
|
12246
|
-
return /* @__PURE__ */
|
|
12533
|
+
return /* @__PURE__ */ jsx62(
|
|
12247
12534
|
RadioGroup,
|
|
12248
12535
|
{
|
|
12249
12536
|
name: groupName,
|
|
@@ -12260,7 +12547,7 @@ var AlternativesList = ({
|
|
|
12260
12547
|
const statusStyles = getStatusStyles2(alternative.status, false);
|
|
12261
12548
|
const statusBadge = getStatusBadge2(alternative.status);
|
|
12262
12549
|
if (layout === "detailed") {
|
|
12263
|
-
return /* @__PURE__ */
|
|
12550
|
+
return /* @__PURE__ */ jsx62(
|
|
12264
12551
|
"div",
|
|
12265
12552
|
{
|
|
12266
12553
|
className: cn(
|
|
@@ -12268,9 +12555,9 @@ var AlternativesList = ({
|
|
|
12268
12555
|
statusStyles,
|
|
12269
12556
|
alternative.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"
|
|
12270
12557
|
),
|
|
12271
|
-
children: /* @__PURE__ */
|
|
12272
|
-
/* @__PURE__ */
|
|
12273
|
-
/* @__PURE__ */
|
|
12558
|
+
children: /* @__PURE__ */ jsxs47("div", { className: "flex items-start justify-between gap-3", children: [
|
|
12559
|
+
/* @__PURE__ */ jsxs47("div", { className: "flex items-start gap-3 flex-1", children: [
|
|
12560
|
+
/* @__PURE__ */ jsx62(
|
|
12274
12561
|
RadioGroupItem,
|
|
12275
12562
|
{
|
|
12276
12563
|
value: alternative.value,
|
|
@@ -12279,8 +12566,8 @@ var AlternativesList = ({
|
|
|
12279
12566
|
className: "mt-1"
|
|
12280
12567
|
}
|
|
12281
12568
|
),
|
|
12282
|
-
/* @__PURE__ */
|
|
12283
|
-
/* @__PURE__ */
|
|
12569
|
+
/* @__PURE__ */ jsxs47("div", { className: "flex-1", children: [
|
|
12570
|
+
/* @__PURE__ */ jsx62(
|
|
12284
12571
|
"label",
|
|
12285
12572
|
{
|
|
12286
12573
|
htmlFor: alternativeId,
|
|
@@ -12292,16 +12579,16 @@ var AlternativesList = ({
|
|
|
12292
12579
|
children: alternative.label
|
|
12293
12580
|
}
|
|
12294
12581
|
),
|
|
12295
|
-
alternative.description && /* @__PURE__ */
|
|
12582
|
+
alternative.description && /* @__PURE__ */ jsx62("p", { className: "text-sm text-text-600 mt-1", children: alternative.description })
|
|
12296
12583
|
] })
|
|
12297
12584
|
] }),
|
|
12298
|
-
statusBadge && /* @__PURE__ */
|
|
12585
|
+
statusBadge && /* @__PURE__ */ jsx62("div", { className: "flex-shrink-0", children: statusBadge })
|
|
12299
12586
|
] })
|
|
12300
12587
|
},
|
|
12301
12588
|
alternativeId
|
|
12302
12589
|
);
|
|
12303
12590
|
}
|
|
12304
|
-
return /* @__PURE__ */
|
|
12591
|
+
return /* @__PURE__ */ jsxs47(
|
|
12305
12592
|
"div",
|
|
12306
12593
|
{
|
|
12307
12594
|
className: cn(
|
|
@@ -12310,8 +12597,8 @@ var AlternativesList = ({
|
|
|
12310
12597
|
alternative.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
12311
12598
|
),
|
|
12312
12599
|
children: [
|
|
12313
|
-
/* @__PURE__ */
|
|
12314
|
-
/* @__PURE__ */
|
|
12600
|
+
/* @__PURE__ */ jsxs47("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
12601
|
+
/* @__PURE__ */ jsx62(
|
|
12315
12602
|
RadioGroupItem,
|
|
12316
12603
|
{
|
|
12317
12604
|
value: alternative.value,
|
|
@@ -12319,7 +12606,7 @@ var AlternativesList = ({
|
|
|
12319
12606
|
disabled: alternative.disabled
|
|
12320
12607
|
}
|
|
12321
12608
|
),
|
|
12322
|
-
/* @__PURE__ */
|
|
12609
|
+
/* @__PURE__ */ jsx62(
|
|
12323
12610
|
"label",
|
|
12324
12611
|
{
|
|
12325
12612
|
htmlFor: alternativeId,
|
|
@@ -12332,7 +12619,7 @@ var AlternativesList = ({
|
|
|
12332
12619
|
}
|
|
12333
12620
|
)
|
|
12334
12621
|
] }),
|
|
12335
|
-
statusBadge && /* @__PURE__ */
|
|
12622
|
+
statusBadge && /* @__PURE__ */ jsx62("div", { className: "flex-shrink-0", children: statusBadge })
|
|
12336
12623
|
]
|
|
12337
12624
|
},
|
|
12338
12625
|
alternativeId
|
|
@@ -12343,7 +12630,7 @@ var AlternativesList = ({
|
|
|
12343
12630
|
};
|
|
12344
12631
|
var HeaderAlternative = forwardRef20(
|
|
12345
12632
|
({ className, title, subTitle, content, ...props }, ref) => {
|
|
12346
|
-
return /* @__PURE__ */
|
|
12633
|
+
return /* @__PURE__ */ jsxs47(
|
|
12347
12634
|
"div",
|
|
12348
12635
|
{
|
|
12349
12636
|
ref,
|
|
@@ -12353,11 +12640,11 @@ var HeaderAlternative = forwardRef20(
|
|
|
12353
12640
|
),
|
|
12354
12641
|
...props,
|
|
12355
12642
|
children: [
|
|
12356
|
-
/* @__PURE__ */
|
|
12357
|
-
/* @__PURE__ */
|
|
12358
|
-
/* @__PURE__ */
|
|
12643
|
+
/* @__PURE__ */ jsxs47("span", { className: "flex flex-col", children: [
|
|
12644
|
+
/* @__PURE__ */ jsx62("p", { className: "text-text-950 font-bold text-lg", children: title }),
|
|
12645
|
+
/* @__PURE__ */ jsx62("p", { className: "text-text-700 text-sm ", children: subTitle })
|
|
12359
12646
|
] }),
|
|
12360
|
-
/* @__PURE__ */
|
|
12647
|
+
/* @__PURE__ */ jsx62("p", { className: "text-text-950 text-md", children: content })
|
|
12361
12648
|
]
|
|
12362
12649
|
}
|
|
12363
12650
|
);
|
|
@@ -12407,7 +12694,7 @@ function createZustandAuthAdapter(useAuthStore2) {
|
|
|
12407
12694
|
}
|
|
12408
12695
|
|
|
12409
12696
|
// src/components/Auth/useUrlAuthentication.ts
|
|
12410
|
-
import { useEffect as
|
|
12697
|
+
import { useEffect as useEffect26, useRef as useRef13 } from "react";
|
|
12411
12698
|
import { useLocation as useLocation2 } from "react-router-dom";
|
|
12412
12699
|
var getAuthParams = (location, extractParams) => {
|
|
12413
12700
|
const searchParams = new URLSearchParams(location.search);
|
|
@@ -12456,7 +12743,7 @@ var handleUserData = (responseData, setUser) => {
|
|
|
12456
12743
|
function useUrlAuthentication(options) {
|
|
12457
12744
|
const location = useLocation2();
|
|
12458
12745
|
const processedRef = useRef13(false);
|
|
12459
|
-
|
|
12746
|
+
useEffect26(() => {
|
|
12460
12747
|
const handleAuthentication = async () => {
|
|
12461
12748
|
if (processedRef.current) {
|
|
12462
12749
|
return;
|
|
@@ -12527,9 +12814,9 @@ function useUrlAuthentication(options) {
|
|
|
12527
12814
|
}
|
|
12528
12815
|
|
|
12529
12816
|
// src/components/Auth/useApiConfig.ts
|
|
12530
|
-
import { useMemo as
|
|
12817
|
+
import { useMemo as useMemo12 } from "react";
|
|
12531
12818
|
function useApiConfig(api) {
|
|
12532
|
-
return
|
|
12819
|
+
return useMemo12(
|
|
12533
12820
|
() => ({
|
|
12534
12821
|
get: (endpoint, config) => api.get(endpoint, config)
|
|
12535
12822
|
}),
|
|
@@ -12547,8 +12834,8 @@ import {
|
|
|
12547
12834
|
} from "phosphor-react";
|
|
12548
12835
|
import {
|
|
12549
12836
|
forwardRef as forwardRef22,
|
|
12550
|
-
useEffect as
|
|
12551
|
-
useState as
|
|
12837
|
+
useEffect as useEffect29,
|
|
12838
|
+
useState as useState29
|
|
12552
12839
|
} from "react";
|
|
12553
12840
|
|
|
12554
12841
|
// src/components/Quiz/useQuizStore.ts
|
|
@@ -13161,18 +13448,18 @@ var useQuizStore = create11()(
|
|
|
13161
13448
|
// src/components/Quiz/QuizContent.tsx
|
|
13162
13449
|
import {
|
|
13163
13450
|
forwardRef as forwardRef21,
|
|
13164
|
-
useCallback as
|
|
13165
|
-
useEffect as
|
|
13451
|
+
useCallback as useCallback9,
|
|
13452
|
+
useEffect as useEffect28,
|
|
13166
13453
|
useId as useId11,
|
|
13167
|
-
useMemo as
|
|
13454
|
+
useMemo as useMemo13,
|
|
13168
13455
|
useRef as useRef14,
|
|
13169
|
-
useState as
|
|
13456
|
+
useState as useState28
|
|
13170
13457
|
} from "react";
|
|
13171
13458
|
|
|
13172
13459
|
// src/components/MultipleChoice/MultipleChoice.tsx
|
|
13173
|
-
import { useEffect as
|
|
13460
|
+
import { useEffect as useEffect27, useState as useState27 } from "react";
|
|
13174
13461
|
import { CheckCircle as CheckCircle5, XCircle as XCircle4, Check as Check5 } from "phosphor-react";
|
|
13175
|
-
import { jsx as
|
|
13462
|
+
import { jsx as jsx63, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
13176
13463
|
var MultipleChoiceList = ({
|
|
13177
13464
|
disabled = false,
|
|
13178
13465
|
className = "",
|
|
@@ -13182,16 +13469,16 @@ var MultipleChoiceList = ({
|
|
|
13182
13469
|
onHandleSelectedValues,
|
|
13183
13470
|
mode = "interactive"
|
|
13184
13471
|
}) => {
|
|
13185
|
-
const [actualValue, setActualValue] =
|
|
13186
|
-
|
|
13472
|
+
const [actualValue, setActualValue] = useState27(selectedValues);
|
|
13473
|
+
useEffect27(() => {
|
|
13187
13474
|
setActualValue(selectedValues);
|
|
13188
13475
|
}, [selectedValues]);
|
|
13189
13476
|
const getStatusBadge2 = (status) => {
|
|
13190
13477
|
switch (status) {
|
|
13191
13478
|
case "correct":
|
|
13192
|
-
return /* @__PURE__ */
|
|
13479
|
+
return /* @__PURE__ */ jsx63(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ jsx63(CheckCircle5, {}), children: "Resposta correta" });
|
|
13193
13480
|
case "incorrect":
|
|
13194
|
-
return /* @__PURE__ */
|
|
13481
|
+
return /* @__PURE__ */ jsx63(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ jsx63(XCircle4, {}), children: "Resposta incorreta" });
|
|
13195
13482
|
default:
|
|
13196
13483
|
return null;
|
|
13197
13484
|
}
|
|
@@ -13212,14 +13499,14 @@ var MultipleChoiceList = ({
|
|
|
13212
13499
|
isSelected ? "border-primary-950 bg-primary-950 text-text" : "border-border-400 bg-background",
|
|
13213
13500
|
isDisabled && "opacity-40 cursor-not-allowed"
|
|
13214
13501
|
);
|
|
13215
|
-
return /* @__PURE__ */
|
|
13502
|
+
return /* @__PURE__ */ jsx63("div", { className: checkboxClasses, children: isSelected && /* @__PURE__ */ jsx63(Check5, { size: 16, weight: "bold" }) });
|
|
13216
13503
|
};
|
|
13217
13504
|
if (mode === "readonly") {
|
|
13218
|
-
return /* @__PURE__ */
|
|
13505
|
+
return /* @__PURE__ */ jsx63("div", { className: cn("flex flex-col gap-2", className), children: choices.map((choice, i) => {
|
|
13219
13506
|
const isSelected = actualValue?.includes(choice.value) || false;
|
|
13220
13507
|
const statusStyles = getStatusStyles2(choice.status);
|
|
13221
13508
|
const statusBadge = getStatusBadge2(choice.status);
|
|
13222
|
-
return /* @__PURE__ */
|
|
13509
|
+
return /* @__PURE__ */ jsxs48(
|
|
13223
13510
|
"div",
|
|
13224
13511
|
{
|
|
13225
13512
|
className: cn(
|
|
@@ -13228,9 +13515,9 @@ var MultipleChoiceList = ({
|
|
|
13228
13515
|
choice.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
13229
13516
|
),
|
|
13230
13517
|
children: [
|
|
13231
|
-
/* @__PURE__ */
|
|
13518
|
+
/* @__PURE__ */ jsxs48("div", { className: "flex items-center gap-2 flex-1", children: [
|
|
13232
13519
|
renderVisualCheckbox(isSelected, choice.disabled || disabled),
|
|
13233
|
-
/* @__PURE__ */
|
|
13520
|
+
/* @__PURE__ */ jsx63(
|
|
13234
13521
|
"span",
|
|
13235
13522
|
{
|
|
13236
13523
|
className: cn(
|
|
@@ -13242,14 +13529,14 @@ var MultipleChoiceList = ({
|
|
|
13242
13529
|
}
|
|
13243
13530
|
)
|
|
13244
13531
|
] }),
|
|
13245
|
-
statusBadge && /* @__PURE__ */
|
|
13532
|
+
statusBadge && /* @__PURE__ */ jsx63("div", { className: "flex-shrink-0", children: statusBadge })
|
|
13246
13533
|
]
|
|
13247
13534
|
},
|
|
13248
13535
|
`readonly-${choice.value}-${i}`
|
|
13249
13536
|
);
|
|
13250
13537
|
}) });
|
|
13251
13538
|
}
|
|
13252
|
-
return /* @__PURE__ */
|
|
13539
|
+
return /* @__PURE__ */ jsx63(
|
|
13253
13540
|
"div",
|
|
13254
13541
|
{
|
|
13255
13542
|
className: cn(
|
|
@@ -13257,7 +13544,7 @@ var MultipleChoiceList = ({
|
|
|
13257
13544
|
disabled ? "opacity-50 cursor-not-allowed" : "",
|
|
13258
13545
|
className
|
|
13259
13546
|
),
|
|
13260
|
-
children: /* @__PURE__ */
|
|
13547
|
+
children: /* @__PURE__ */ jsx63(
|
|
13261
13548
|
CheckboxList_default,
|
|
13262
13549
|
{
|
|
13263
13550
|
name,
|
|
@@ -13267,12 +13554,12 @@ var MultipleChoiceList = ({
|
|
|
13267
13554
|
onHandleSelectedValues?.(v);
|
|
13268
13555
|
},
|
|
13269
13556
|
disabled,
|
|
13270
|
-
children: choices.map((choice, i) => /* @__PURE__ */
|
|
13557
|
+
children: choices.map((choice, i) => /* @__PURE__ */ jsxs48(
|
|
13271
13558
|
"div",
|
|
13272
13559
|
{
|
|
13273
13560
|
className: "flex flex-row gap-2 items-center",
|
|
13274
13561
|
children: [
|
|
13275
|
-
/* @__PURE__ */
|
|
13562
|
+
/* @__PURE__ */ jsx63(
|
|
13276
13563
|
CheckboxListItem,
|
|
13277
13564
|
{
|
|
13278
13565
|
value: choice.value,
|
|
@@ -13280,7 +13567,7 @@ var MultipleChoiceList = ({
|
|
|
13280
13567
|
disabled: choice.disabled || disabled
|
|
13281
13568
|
}
|
|
13282
13569
|
),
|
|
13283
|
-
/* @__PURE__ */
|
|
13570
|
+
/* @__PURE__ */ jsx63(
|
|
13284
13571
|
"label",
|
|
13285
13572
|
{
|
|
13286
13573
|
htmlFor: `interactive-${choice.value}-${i}`,
|
|
@@ -13309,13 +13596,13 @@ import { CheckCircle as CheckCircle6, XCircle as XCircle5 } from "phosphor-react
|
|
|
13309
13596
|
var mock_image_question_default = "./mock-image-question-HEZCLFDL.png";
|
|
13310
13597
|
|
|
13311
13598
|
// src/components/Quiz/QuizContent.tsx
|
|
13312
|
-
import { Fragment as
|
|
13599
|
+
import { Fragment as Fragment13, jsx as jsx64, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
13313
13600
|
var getStatusBadge = (status) => {
|
|
13314
13601
|
switch (status) {
|
|
13315
13602
|
case "correct":
|
|
13316
|
-
return /* @__PURE__ */
|
|
13603
|
+
return /* @__PURE__ */ jsx64(Badge_default, { variant: "solid", action: "success", iconLeft: /* @__PURE__ */ jsx64(CheckCircle6, {}), children: "Resposta correta" });
|
|
13317
13604
|
case "incorrect":
|
|
13318
|
-
return /* @__PURE__ */
|
|
13605
|
+
return /* @__PURE__ */ jsx64(Badge_default, { variant: "solid", action: "error", iconLeft: /* @__PURE__ */ jsx64(XCircle5, {}), children: "Resposta incorreta" });
|
|
13319
13606
|
default:
|
|
13320
13607
|
return null;
|
|
13321
13608
|
}
|
|
@@ -13330,11 +13617,11 @@ var getStatusStyles = (variantCorrect) => {
|
|
|
13330
13617
|
};
|
|
13331
13618
|
var QuizSubTitle = forwardRef21(
|
|
13332
13619
|
({ subTitle, ...props }, ref) => {
|
|
13333
|
-
return /* @__PURE__ */
|
|
13620
|
+
return /* @__PURE__ */ jsx64("div", { className: "px-4 pb-2 pt-6", ...props, ref, children: /* @__PURE__ */ jsx64("p", { className: "font-bold text-lg text-text-950", children: subTitle }) });
|
|
13334
13621
|
}
|
|
13335
13622
|
);
|
|
13336
13623
|
var QuizContainer = forwardRef21(({ children, className, ...props }, ref) => {
|
|
13337
|
-
return /* @__PURE__ */
|
|
13624
|
+
return /* @__PURE__ */ jsx64(
|
|
13338
13625
|
"div",
|
|
13339
13626
|
{
|
|
13340
13627
|
ref,
|
|
@@ -13387,10 +13674,10 @@ var QuizAlternative = ({ paddingBottom }) => {
|
|
|
13387
13674
|
};
|
|
13388
13675
|
});
|
|
13389
13676
|
if (!alternatives)
|
|
13390
|
-
return /* @__PURE__ */
|
|
13391
|
-
return /* @__PURE__ */
|
|
13392
|
-
/* @__PURE__ */
|
|
13393
|
-
/* @__PURE__ */
|
|
13677
|
+
return /* @__PURE__ */ jsx64("div", { children: /* @__PURE__ */ jsx64("p", { children: "N\xE3o h\xE1 Alternativas" }) });
|
|
13678
|
+
return /* @__PURE__ */ jsxs49(Fragment13, { children: [
|
|
13679
|
+
/* @__PURE__ */ jsx64(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
13680
|
+
/* @__PURE__ */ jsx64(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ jsx64("div", { className: "space-y-4", children: /* @__PURE__ */ jsx64(
|
|
13394
13681
|
AlternativesList,
|
|
13395
13682
|
{
|
|
13396
13683
|
mode: variant === "default" ? "interactive" : "readonly",
|
|
@@ -13424,13 +13711,13 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
13424
13711
|
);
|
|
13425
13712
|
const prevSelectedValuesRef = useRef14([]);
|
|
13426
13713
|
const prevQuestionIdRef = useRef14("");
|
|
13427
|
-
const allCurrentAnswerIds =
|
|
13714
|
+
const allCurrentAnswerIds = useMemo13(() => {
|
|
13428
13715
|
return allCurrentAnswers?.map((answer) => answer.optionId) || [];
|
|
13429
13716
|
}, [allCurrentAnswers]);
|
|
13430
|
-
const selectedValues =
|
|
13717
|
+
const selectedValues = useMemo13(() => {
|
|
13431
13718
|
return allCurrentAnswerIds?.filter((id) => id !== null) || [];
|
|
13432
13719
|
}, [allCurrentAnswerIds]);
|
|
13433
|
-
const stableSelectedValues =
|
|
13720
|
+
const stableSelectedValues = useMemo13(() => {
|
|
13434
13721
|
const currentQuestionId = currentQuestion?.id || "";
|
|
13435
13722
|
const hasQuestionChanged = prevQuestionIdRef.current !== currentQuestionId;
|
|
13436
13723
|
if (hasQuestionChanged) {
|
|
@@ -13454,7 +13741,7 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
13454
13741
|
variant,
|
|
13455
13742
|
currentQuestionResult?.selectedOptions
|
|
13456
13743
|
]);
|
|
13457
|
-
const handleSelectedValues =
|
|
13744
|
+
const handleSelectedValues = useCallback9(
|
|
13458
13745
|
(values) => {
|
|
13459
13746
|
if (currentQuestion) {
|
|
13460
13747
|
selectMultipleAnswer(currentQuestion.id, values);
|
|
@@ -13462,7 +13749,7 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
13462
13749
|
},
|
|
13463
13750
|
[currentQuestion, selectMultipleAnswer]
|
|
13464
13751
|
);
|
|
13465
|
-
const questionKey =
|
|
13752
|
+
const questionKey = useMemo13(
|
|
13466
13753
|
() => `question-${currentQuestion?.id || "1"}`,
|
|
13467
13754
|
[currentQuestion?.id]
|
|
13468
13755
|
);
|
|
@@ -13493,10 +13780,10 @@ var QuizMultipleChoice = ({ paddingBottom }) => {
|
|
|
13493
13780
|
};
|
|
13494
13781
|
});
|
|
13495
13782
|
if (!choices)
|
|
13496
|
-
return /* @__PURE__ */
|
|
13497
|
-
return /* @__PURE__ */
|
|
13498
|
-
/* @__PURE__ */
|
|
13499
|
-
/* @__PURE__ */
|
|
13783
|
+
return /* @__PURE__ */ jsx64("div", { children: /* @__PURE__ */ jsx64("p", { children: "N\xE3o h\xE1 Escolhas Multiplas" }) });
|
|
13784
|
+
return /* @__PURE__ */ jsxs49(Fragment13, { children: [
|
|
13785
|
+
/* @__PURE__ */ jsx64(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
13786
|
+
/* @__PURE__ */ jsx64(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ jsx64("div", { className: "space-y-4", children: /* @__PURE__ */ jsx64(
|
|
13500
13787
|
MultipleChoiceList,
|
|
13501
13788
|
{
|
|
13502
13789
|
choices,
|
|
@@ -13530,7 +13817,7 @@ var QuizDissertative = ({ paddingBottom }) => {
|
|
|
13530
13817
|
selectDissertativeAnswer(currentQuestion.id, value);
|
|
13531
13818
|
}
|
|
13532
13819
|
};
|
|
13533
|
-
const adjustTextareaHeight =
|
|
13820
|
+
const adjustTextareaHeight = useCallback9(() => {
|
|
13534
13821
|
if (textareaRef.current) {
|
|
13535
13822
|
textareaRef.current.style.height = "auto";
|
|
13536
13823
|
const scrollHeight = textareaRef.current.scrollHeight;
|
|
@@ -13540,16 +13827,16 @@ var QuizDissertative = ({ paddingBottom }) => {
|
|
|
13540
13827
|
textareaRef.current.style.height = `${newHeight}px`;
|
|
13541
13828
|
}
|
|
13542
13829
|
}, []);
|
|
13543
|
-
|
|
13830
|
+
useEffect28(() => {
|
|
13544
13831
|
adjustTextareaHeight();
|
|
13545
13832
|
}, [currentAnswer, adjustTextareaHeight]);
|
|
13546
13833
|
if (!currentQuestion) {
|
|
13547
|
-
return /* @__PURE__ */
|
|
13834
|
+
return /* @__PURE__ */ jsx64("div", { className: "space-y-4", children: /* @__PURE__ */ jsx64("p", { className: "text-text-600 text-md", children: "Nenhuma quest\xE3o dispon\xEDvel" }) });
|
|
13548
13835
|
}
|
|
13549
13836
|
const localAnswer = (variant == "result" ? currentQuestionResult?.answer : currentAnswer?.answer) || "";
|
|
13550
|
-
return /* @__PURE__ */
|
|
13551
|
-
/* @__PURE__ */
|
|
13552
|
-
/* @__PURE__ */
|
|
13837
|
+
return /* @__PURE__ */ jsxs49(Fragment13, { children: [
|
|
13838
|
+
/* @__PURE__ */ jsx64(QuizSubTitle, { subTitle: "Resposta" }),
|
|
13839
|
+
/* @__PURE__ */ jsx64(QuizContainer, { className: cn(variant != "result" && paddingBottom), children: /* @__PURE__ */ jsx64("div", { className: "space-y-4 max-h-[600px] overflow-y-auto", children: variant === "default" ? /* @__PURE__ */ jsx64("div", { className: "space-y-4", children: /* @__PURE__ */ jsx64(
|
|
13553
13840
|
TextArea_default,
|
|
13554
13841
|
{
|
|
13555
13842
|
ref: textareaRef,
|
|
@@ -13561,10 +13848,10 @@ var QuizDissertative = ({ paddingBottom }) => {
|
|
|
13561
13848
|
maxLength: charLimit,
|
|
13562
13849
|
showCharacterCount: !!charLimit
|
|
13563
13850
|
}
|
|
13564
|
-
) }) : /* @__PURE__ */
|
|
13565
|
-
variant === "result" && currentQuestionResult?.answerStatus == "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */ && /* @__PURE__ */
|
|
13566
|
-
/* @__PURE__ */
|
|
13567
|
-
/* @__PURE__ */
|
|
13851
|
+
) }) : /* @__PURE__ */ jsx64("div", { className: "space-y-4", children: /* @__PURE__ */ jsx64("p", { className: "text-text-600 text-md whitespace-pre-wrap", children: localAnswer || "Nenhuma resposta fornecida" }) }) }) }),
|
|
13852
|
+
variant === "result" && currentQuestionResult?.answerStatus == "RESPOSTA_INCORRETA" /* RESPOSTA_INCORRETA */ && /* @__PURE__ */ jsxs49(Fragment13, { children: [
|
|
13853
|
+
/* @__PURE__ */ jsx64(QuizSubTitle, { subTitle: "Observa\xE7\xE3o do professor" }),
|
|
13854
|
+
/* @__PURE__ */ jsx64(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ jsx64("p", { className: "text-text-600 text-md whitespace-pre-wrap", children: currentQuestionResult?.teacherFeedback }) })
|
|
13568
13855
|
] })
|
|
13569
13856
|
] });
|
|
13570
13857
|
};
|
|
@@ -13590,16 +13877,16 @@ var QuizTrueOrFalse = ({ paddingBottom }) => {
|
|
|
13590
13877
|
];
|
|
13591
13878
|
const getLetterByIndex = (index) => String.fromCodePoint(97 + index);
|
|
13592
13879
|
const isDefaultVariant = variant === "default";
|
|
13593
|
-
return /* @__PURE__ */
|
|
13594
|
-
/* @__PURE__ */
|
|
13595
|
-
/* @__PURE__ */
|
|
13880
|
+
return /* @__PURE__ */ jsxs49(Fragment13, { children: [
|
|
13881
|
+
/* @__PURE__ */ jsx64(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
13882
|
+
/* @__PURE__ */ jsx64(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ jsx64("div", { className: "flex flex-col gap-3.5", children: options.map((option, index) => {
|
|
13596
13883
|
const variantCorrect = option.isCorrect ? "correct" : "incorrect";
|
|
13597
|
-
return /* @__PURE__ */
|
|
13884
|
+
return /* @__PURE__ */ jsxs49(
|
|
13598
13885
|
"section",
|
|
13599
13886
|
{
|
|
13600
13887
|
className: "flex flex-col gap-2",
|
|
13601
13888
|
children: [
|
|
13602
|
-
/* @__PURE__ */
|
|
13889
|
+
/* @__PURE__ */ jsxs49(
|
|
13603
13890
|
"div",
|
|
13604
13891
|
{
|
|
13605
13892
|
className: cn(
|
|
@@ -13607,20 +13894,20 @@ var QuizTrueOrFalse = ({ paddingBottom }) => {
|
|
|
13607
13894
|
isDefaultVariant ? "" : getStatusStyles(variantCorrect)
|
|
13608
13895
|
),
|
|
13609
13896
|
children: [
|
|
13610
|
-
/* @__PURE__ */
|
|
13611
|
-
isDefaultVariant ? /* @__PURE__ */
|
|
13612
|
-
/* @__PURE__ */
|
|
13613
|
-
/* @__PURE__ */
|
|
13614
|
-
/* @__PURE__ */
|
|
13615
|
-
/* @__PURE__ */
|
|
13897
|
+
/* @__PURE__ */ jsx64("p", { className: "text-text-900 text-sm", children: getLetterByIndex(index).concat(") ").concat(option.label) }),
|
|
13898
|
+
isDefaultVariant ? /* @__PURE__ */ jsxs49(Select_default, { size: "medium", children: [
|
|
13899
|
+
/* @__PURE__ */ jsx64(SelectTrigger, { className: "w-[180px]", children: /* @__PURE__ */ jsx64(SelectValue, { placeholder: "Selecione opc\xE3o" }) }),
|
|
13900
|
+
/* @__PURE__ */ jsxs49(SelectContent, { children: [
|
|
13901
|
+
/* @__PURE__ */ jsx64(SelectItem, { value: "V", children: "Verdadeiro" }),
|
|
13902
|
+
/* @__PURE__ */ jsx64(SelectItem, { value: "F", children: "Falso" })
|
|
13616
13903
|
] })
|
|
13617
|
-
] }) : /* @__PURE__ */
|
|
13904
|
+
] }) : /* @__PURE__ */ jsx64("div", { className: "flex-shrink-0", children: getStatusBadge(variantCorrect) })
|
|
13618
13905
|
]
|
|
13619
13906
|
}
|
|
13620
13907
|
),
|
|
13621
|
-
!isDefaultVariant && /* @__PURE__ */
|
|
13622
|
-
/* @__PURE__ */
|
|
13623
|
-
!option.isCorrect && /* @__PURE__ */
|
|
13908
|
+
!isDefaultVariant && /* @__PURE__ */ jsxs49("span", { className: "flex flex-row gap-2 items-center", children: [
|
|
13909
|
+
/* @__PURE__ */ jsx64("p", { className: "text-text-800 text-2xs", children: "Resposta selecionada: V" }),
|
|
13910
|
+
!option.isCorrect && /* @__PURE__ */ jsx64("p", { className: "text-text-800 text-2xs", children: "Resposta correta: F" })
|
|
13624
13911
|
] })
|
|
13625
13912
|
]
|
|
13626
13913
|
},
|
|
@@ -13681,7 +13968,7 @@ var QuizConnectDots = ({ paddingBottom }) => {
|
|
|
13681
13968
|
isCorrect: false
|
|
13682
13969
|
}
|
|
13683
13970
|
];
|
|
13684
|
-
const [userAnswers, setUserAnswers] =
|
|
13971
|
+
const [userAnswers, setUserAnswers] = useState28(() => {
|
|
13685
13972
|
if (variant === "result") {
|
|
13686
13973
|
return mockUserAnswers;
|
|
13687
13974
|
}
|
|
@@ -13710,13 +13997,13 @@ var QuizConnectDots = ({ paddingBottom }) => {
|
|
|
13710
13997
|
const assignedDots = new Set(
|
|
13711
13998
|
userAnswers.map((a) => a.dotOption).filter(Boolean)
|
|
13712
13999
|
);
|
|
13713
|
-
return /* @__PURE__ */
|
|
13714
|
-
/* @__PURE__ */
|
|
13715
|
-
/* @__PURE__ */
|
|
14000
|
+
return /* @__PURE__ */ jsxs49(Fragment13, { children: [
|
|
14001
|
+
/* @__PURE__ */ jsx64(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
14002
|
+
/* @__PURE__ */ jsx64(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ jsx64("div", { className: "flex flex-col gap-3.5", children: options.map((option, index) => {
|
|
13716
14003
|
const answer = userAnswers[index];
|
|
13717
14004
|
const variantCorrect = answer.isCorrect ? "correct" : "incorrect";
|
|
13718
|
-
return /* @__PURE__ */
|
|
13719
|
-
/* @__PURE__ */
|
|
14005
|
+
return /* @__PURE__ */ jsxs49("section", { className: "flex flex-col gap-2", children: [
|
|
14006
|
+
/* @__PURE__ */ jsxs49(
|
|
13720
14007
|
"div",
|
|
13721
14008
|
{
|
|
13722
14009
|
className: cn(
|
|
@@ -13724,30 +14011,30 @@ var QuizConnectDots = ({ paddingBottom }) => {
|
|
|
13724
14011
|
isDefaultVariant ? "" : getStatusStyles(variantCorrect)
|
|
13725
14012
|
),
|
|
13726
14013
|
children: [
|
|
13727
|
-
/* @__PURE__ */
|
|
13728
|
-
isDefaultVariant ? /* @__PURE__ */
|
|
14014
|
+
/* @__PURE__ */ jsx64("p", { className: "text-text-900 text-sm", children: getLetterByIndex(index) + ") " + option.label }),
|
|
14015
|
+
isDefaultVariant ? /* @__PURE__ */ jsxs49(
|
|
13729
14016
|
Select_default,
|
|
13730
14017
|
{
|
|
13731
14018
|
size: "medium",
|
|
13732
14019
|
value: answer.dotOption || void 0,
|
|
13733
14020
|
onValueChange: (value) => handleSelectDot(index, value),
|
|
13734
14021
|
children: [
|
|
13735
|
-
/* @__PURE__ */
|
|
13736
|
-
/* @__PURE__ */
|
|
14022
|
+
/* @__PURE__ */ jsx64(SelectTrigger, { className: "w-[180px]", children: /* @__PURE__ */ jsx64(SelectValue, { placeholder: "Selecione op\xE7\xE3o" }) }),
|
|
14023
|
+
/* @__PURE__ */ jsx64(SelectContent, { children: dotsOptions.filter(
|
|
13737
14024
|
(dot) => !assignedDots.has(dot.label) || answer.dotOption === dot.label
|
|
13738
|
-
).map((dot) => /* @__PURE__ */
|
|
14025
|
+
).map((dot) => /* @__PURE__ */ jsx64(SelectItem, { value: dot.label, children: dot.label }, dot.label)) })
|
|
13739
14026
|
]
|
|
13740
14027
|
}
|
|
13741
|
-
) : /* @__PURE__ */
|
|
14028
|
+
) : /* @__PURE__ */ jsx64("div", { className: "flex-shrink-0", children: answer.isCorrect === null ? null : getStatusBadge(variantCorrect) })
|
|
13742
14029
|
]
|
|
13743
14030
|
}
|
|
13744
14031
|
),
|
|
13745
|
-
!isDefaultVariant && /* @__PURE__ */
|
|
13746
|
-
/* @__PURE__ */
|
|
14032
|
+
!isDefaultVariant && /* @__PURE__ */ jsxs49("span", { className: "flex flex-row gap-2 items-center", children: [
|
|
14033
|
+
/* @__PURE__ */ jsxs49("p", { className: "text-text-800 text-2xs", children: [
|
|
13747
14034
|
"Resposta selecionada: ",
|
|
13748
14035
|
answer.dotOption || "Nenhuma"
|
|
13749
14036
|
] }),
|
|
13750
|
-
!answer.isCorrect && /* @__PURE__ */
|
|
14037
|
+
!answer.isCorrect && /* @__PURE__ */ jsxs49("p", { className: "text-text-800 text-2xs", children: [
|
|
13751
14038
|
"Resposta correta: ",
|
|
13752
14039
|
answer.correctOption
|
|
13753
14040
|
] })
|
|
@@ -13800,7 +14087,7 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
13800
14087
|
isCorrect: true
|
|
13801
14088
|
}
|
|
13802
14089
|
];
|
|
13803
|
-
const [answers, setAnswers] =
|
|
14090
|
+
const [answers, setAnswers] = useState28({});
|
|
13804
14091
|
const baseId = useId11();
|
|
13805
14092
|
const getAvailableOptionsForSelect = (selectId) => {
|
|
13806
14093
|
const usedOptions = new Set(
|
|
@@ -13816,18 +14103,18 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
13816
14103
|
const mockAnswer = mockUserAnswers.find(
|
|
13817
14104
|
(answer) => answer.selectId === selectId
|
|
13818
14105
|
);
|
|
13819
|
-
return /* @__PURE__ */
|
|
14106
|
+
return /* @__PURE__ */ jsx64("p", { className: "inline-flex mb-2.5 text-success-600 font-semibold text-md border-b-2 border-success-600", children: mockAnswer?.correctAnswer });
|
|
13820
14107
|
};
|
|
13821
14108
|
const renderDefaultElement = (selectId, startIndex, selectedValue, availableOptionsForThisSelect) => {
|
|
13822
|
-
return /* @__PURE__ */
|
|
14109
|
+
return /* @__PURE__ */ jsxs49(
|
|
13823
14110
|
Select_default,
|
|
13824
14111
|
{
|
|
13825
14112
|
value: selectedValue,
|
|
13826
14113
|
onValueChange: (value) => handleSelectChange(selectId, value),
|
|
13827
14114
|
className: "inline-flex mb-2.5",
|
|
13828
14115
|
children: [
|
|
13829
|
-
/* @__PURE__ */
|
|
13830
|
-
/* @__PURE__ */
|
|
14116
|
+
/* @__PURE__ */ jsx64(SelectTrigger, { className: "inline-flex w-auto min-w-[140px] h-8 mx-1 bg-background border-gray-300", children: /* @__PURE__ */ jsx64(SelectValue, { placeholder: "Selecione op\xE7\xE3o" }) }),
|
|
14117
|
+
/* @__PURE__ */ jsx64(SelectContent, { children: availableOptionsForThisSelect.map((option, index) => /* @__PURE__ */ jsx64(SelectItem, { value: option, children: option }, `${option}-${index}`)) })
|
|
13831
14118
|
]
|
|
13832
14119
|
},
|
|
13833
14120
|
`${selectId}-${startIndex}`
|
|
@@ -13839,8 +14126,8 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
13839
14126
|
);
|
|
13840
14127
|
if (!mockAnswer) return null;
|
|
13841
14128
|
const action = mockAnswer.isCorrect ? "success" : "error";
|
|
13842
|
-
const icon = mockAnswer.isCorrect ? /* @__PURE__ */
|
|
13843
|
-
return /* @__PURE__ */
|
|
14129
|
+
const icon = mockAnswer.isCorrect ? /* @__PURE__ */ jsx64(CheckCircle6, {}) : /* @__PURE__ */ jsx64(XCircle5, {});
|
|
14130
|
+
return /* @__PURE__ */ jsx64(
|
|
13844
14131
|
Badge_default,
|
|
13845
14132
|
{
|
|
13846
14133
|
variant: "solid",
|
|
@@ -13848,7 +14135,7 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
13848
14135
|
iconRight: icon,
|
|
13849
14136
|
size: "large",
|
|
13850
14137
|
className: "py-3 w-[180px] justify-between mb-2.5",
|
|
13851
|
-
children: /* @__PURE__ */
|
|
14138
|
+
children: /* @__PURE__ */ jsx64("span", { className: "text-text-900", children: mockAnswer.userAnswer })
|
|
13852
14139
|
},
|
|
13853
14140
|
selectId
|
|
13854
14141
|
);
|
|
@@ -13904,25 +14191,25 @@ var QuizFill = ({ paddingBottom }) => {
|
|
|
13904
14191
|
}
|
|
13905
14192
|
return elements;
|
|
13906
14193
|
};
|
|
13907
|
-
return /* @__PURE__ */
|
|
13908
|
-
/* @__PURE__ */
|
|
13909
|
-
/* @__PURE__ */
|
|
14194
|
+
return /* @__PURE__ */ jsxs49(Fragment13, { children: [
|
|
14195
|
+
/* @__PURE__ */ jsx64(QuizSubTitle, { subTitle: "Alternativas" }),
|
|
14196
|
+
/* @__PURE__ */ jsx64(QuizContainer, { className: "h-auto pb-0", children: /* @__PURE__ */ jsx64("div", { className: "space-y-6 px-4 h-auto", children: /* @__PURE__ */ jsx64(
|
|
13910
14197
|
"div",
|
|
13911
14198
|
{
|
|
13912
14199
|
className: cn(
|
|
13913
14200
|
"text-lg text-text-900 leading-8 h-auto",
|
|
13914
14201
|
variant != "result" && paddingBottom
|
|
13915
14202
|
),
|
|
13916
|
-
children: renderTextWithSelects(exampleText).map((element) => /* @__PURE__ */
|
|
14203
|
+
children: renderTextWithSelects(exampleText).map((element) => /* @__PURE__ */ jsx64("span", { children: element.element }, element.id))
|
|
13917
14204
|
}
|
|
13918
14205
|
) }) }),
|
|
13919
|
-
variant === "result" && /* @__PURE__ */
|
|
13920
|
-
/* @__PURE__ */
|
|
13921
|
-
/* @__PURE__ */
|
|
14206
|
+
variant === "result" && /* @__PURE__ */ jsxs49(Fragment13, { children: [
|
|
14207
|
+
/* @__PURE__ */ jsx64(QuizSubTitle, { subTitle: "Resultado" }),
|
|
14208
|
+
/* @__PURE__ */ jsx64(QuizContainer, { className: "h-auto pb-0", children: /* @__PURE__ */ jsx64("div", { className: "space-y-6 px-4", children: /* @__PURE__ */ jsx64(
|
|
13922
14209
|
"div",
|
|
13923
14210
|
{
|
|
13924
14211
|
className: cn("text-lg text-text-900 leading-8", paddingBottom),
|
|
13925
|
-
children: renderTextWithSelects(exampleText, true).map((element) => /* @__PURE__ */
|
|
14212
|
+
children: renderTextWithSelects(exampleText, true).map((element) => /* @__PURE__ */ jsx64("span", { children: element.element }, element.id))
|
|
13926
14213
|
}
|
|
13927
14214
|
) }) })
|
|
13928
14215
|
] })
|
|
@@ -13940,7 +14227,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
13940
14227
|
};
|
|
13941
14228
|
const correctRadiusRelative = calculateCorrectRadiusRelative();
|
|
13942
14229
|
const mockUserAnswerRelative = { x: 0.72, y: 0.348 };
|
|
13943
|
-
const [clickPositionRelative, setClickPositionRelative] =
|
|
14230
|
+
const [clickPositionRelative, setClickPositionRelative] = useState28(variant == "result" ? mockUserAnswerRelative : null);
|
|
13944
14231
|
const convertToRelativeCoordinates = (x, y, rect) => {
|
|
13945
14232
|
const safeWidth = Math.max(rect.width, 1e-3);
|
|
13946
14233
|
const safeHeight = Math.max(rect.height, 1e-3);
|
|
@@ -13976,36 +14263,36 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
13976
14263
|
}
|
|
13977
14264
|
return "bg-success-600/70 border-white";
|
|
13978
14265
|
};
|
|
13979
|
-
return /* @__PURE__ */
|
|
13980
|
-
/* @__PURE__ */
|
|
13981
|
-
/* @__PURE__ */
|
|
14266
|
+
return /* @__PURE__ */ jsxs49(Fragment13, { children: [
|
|
14267
|
+
/* @__PURE__ */ jsx64(QuizSubTitle, { subTitle: "Clique na \xE1rea correta" }),
|
|
14268
|
+
/* @__PURE__ */ jsx64(QuizContainer, { className: cn("", paddingBottom), children: /* @__PURE__ */ jsxs49(
|
|
13982
14269
|
"div",
|
|
13983
14270
|
{
|
|
13984
14271
|
"data-testid": "quiz-image-container",
|
|
13985
14272
|
className: "space-y-6 p-3 relative inline-block",
|
|
13986
14273
|
children: [
|
|
13987
|
-
variant == "result" && /* @__PURE__ */
|
|
14274
|
+
variant == "result" && /* @__PURE__ */ jsxs49(
|
|
13988
14275
|
"div",
|
|
13989
14276
|
{
|
|
13990
14277
|
"data-testid": "quiz-legend",
|
|
13991
14278
|
className: "flex items-center gap-4 text-xs",
|
|
13992
14279
|
children: [
|
|
13993
|
-
/* @__PURE__ */
|
|
13994
|
-
/* @__PURE__ */
|
|
13995
|
-
/* @__PURE__ */
|
|
14280
|
+
/* @__PURE__ */ jsxs49("div", { className: "flex items-center gap-2", children: [
|
|
14281
|
+
/* @__PURE__ */ jsx64("div", { className: "w-3 h-3 rounded-full bg-indicator-primary/70 border border-[#F8CC2E]" }),
|
|
14282
|
+
/* @__PURE__ */ jsx64("span", { className: "text-text-600 font-medium text-sm", children: "\xC1rea correta" })
|
|
13996
14283
|
] }),
|
|
13997
|
-
/* @__PURE__ */
|
|
13998
|
-
/* @__PURE__ */
|
|
13999
|
-
/* @__PURE__ */
|
|
14284
|
+
/* @__PURE__ */ jsxs49("div", { className: "flex items-center gap-2", children: [
|
|
14285
|
+
/* @__PURE__ */ jsx64("div", { className: "w-3 h-3 rounded-full bg-success-600/70 border border-white" }),
|
|
14286
|
+
/* @__PURE__ */ jsx64("span", { className: "text-text-600 font-medium text-sm", children: "Resposta correta" })
|
|
14000
14287
|
] }),
|
|
14001
|
-
/* @__PURE__ */
|
|
14002
|
-
/* @__PURE__ */
|
|
14003
|
-
/* @__PURE__ */
|
|
14288
|
+
/* @__PURE__ */ jsxs49("div", { className: "flex items-center gap-2", children: [
|
|
14289
|
+
/* @__PURE__ */ jsx64("div", { className: "w-3 h-3 rounded-full bg-indicator-error/70 border border-white" }),
|
|
14290
|
+
/* @__PURE__ */ jsx64("span", { className: "text-text-600 font-medium text-sm", children: "Resposta incorreta" })
|
|
14004
14291
|
] })
|
|
14005
14292
|
]
|
|
14006
14293
|
}
|
|
14007
14294
|
),
|
|
14008
|
-
/* @__PURE__ */
|
|
14295
|
+
/* @__PURE__ */ jsxs49(
|
|
14009
14296
|
"button",
|
|
14010
14297
|
{
|
|
14011
14298
|
"data-testid": "quiz-image-button",
|
|
@@ -14020,7 +14307,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
14020
14307
|
},
|
|
14021
14308
|
"aria-label": "\xC1rea da imagem interativa",
|
|
14022
14309
|
children: [
|
|
14023
|
-
/* @__PURE__ */
|
|
14310
|
+
/* @__PURE__ */ jsx64(
|
|
14024
14311
|
"img",
|
|
14025
14312
|
{
|
|
14026
14313
|
"data-testid": "quiz-image",
|
|
@@ -14029,7 +14316,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
14029
14316
|
className: "w-full h-auto rounded-md"
|
|
14030
14317
|
}
|
|
14031
14318
|
),
|
|
14032
|
-
variant === "result" && /* @__PURE__ */
|
|
14319
|
+
variant === "result" && /* @__PURE__ */ jsx64(
|
|
14033
14320
|
"div",
|
|
14034
14321
|
{
|
|
14035
14322
|
"data-testid": "quiz-correct-circle",
|
|
@@ -14044,7 +14331,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
14044
14331
|
}
|
|
14045
14332
|
}
|
|
14046
14333
|
),
|
|
14047
|
-
clickPositionRelative && /* @__PURE__ */
|
|
14334
|
+
clickPositionRelative && /* @__PURE__ */ jsx64(
|
|
14048
14335
|
"div",
|
|
14049
14336
|
{
|
|
14050
14337
|
"data-testid": "quiz-user-circle",
|
|
@@ -14069,7 +14356,7 @@ var QuizImageQuestion = ({ paddingBottom }) => {
|
|
|
14069
14356
|
};
|
|
14070
14357
|
|
|
14071
14358
|
// src/components/Quiz/Quiz.tsx
|
|
14072
|
-
import { Fragment as
|
|
14359
|
+
import { Fragment as Fragment14, jsx as jsx65, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
14073
14360
|
var getQuizTypeConfig = (type) => {
|
|
14074
14361
|
const QUIZ_TYPE_CONFIG = {
|
|
14075
14362
|
["SIMULADO" /* SIMULADO */]: {
|
|
@@ -14108,10 +14395,10 @@ var getFinishConfirmationText = (type) => {
|
|
|
14108
14395
|
};
|
|
14109
14396
|
var Quiz = forwardRef22(({ children, className, variant = "default", ...props }, ref) => {
|
|
14110
14397
|
const { setVariant } = useQuizStore();
|
|
14111
|
-
|
|
14398
|
+
useEffect29(() => {
|
|
14112
14399
|
setVariant(variant);
|
|
14113
14400
|
}, [variant, setVariant]);
|
|
14114
|
-
return /* @__PURE__ */
|
|
14401
|
+
return /* @__PURE__ */ jsx65("div", { ref, className: cn("flex flex-col", className), ...props, children });
|
|
14115
14402
|
});
|
|
14116
14403
|
var QuizTitle = forwardRef22(({ className, onBack, ...props }, ref) => {
|
|
14117
14404
|
const {
|
|
@@ -14123,7 +14410,7 @@ var QuizTitle = forwardRef22(({ className, onBack, ...props }, ref) => {
|
|
|
14123
14410
|
formatTime: formatTime2,
|
|
14124
14411
|
isStarted
|
|
14125
14412
|
} = useQuizStore();
|
|
14126
|
-
const [showExitConfirmation, setShowExitConfirmation] =
|
|
14413
|
+
const [showExitConfirmation, setShowExitConfirmation] = useState29(false);
|
|
14127
14414
|
const totalQuestions = getTotalQuestions();
|
|
14128
14415
|
const quizTitle = getQuizTitle();
|
|
14129
14416
|
const handleBackClick = () => {
|
|
@@ -14147,8 +14434,8 @@ var QuizTitle = forwardRef22(({ className, onBack, ...props }, ref) => {
|
|
|
14147
14434
|
const handleCancelExit = () => {
|
|
14148
14435
|
setShowExitConfirmation(false);
|
|
14149
14436
|
};
|
|
14150
|
-
return /* @__PURE__ */
|
|
14151
|
-
/* @__PURE__ */
|
|
14437
|
+
return /* @__PURE__ */ jsxs50(Fragment14, { children: [
|
|
14438
|
+
/* @__PURE__ */ jsxs50(
|
|
14152
14439
|
"div",
|
|
14153
14440
|
{
|
|
14154
14441
|
ref,
|
|
@@ -14158,24 +14445,24 @@ var QuizTitle = forwardRef22(({ className, onBack, ...props }, ref) => {
|
|
|
14158
14445
|
),
|
|
14159
14446
|
...props,
|
|
14160
14447
|
children: [
|
|
14161
|
-
/* @__PURE__ */
|
|
14448
|
+
/* @__PURE__ */ jsx65(
|
|
14162
14449
|
IconButton_default,
|
|
14163
14450
|
{
|
|
14164
|
-
icon: /* @__PURE__ */
|
|
14451
|
+
icon: /* @__PURE__ */ jsx65(CaretLeft5, { size: 24 }),
|
|
14165
14452
|
size: "md",
|
|
14166
14453
|
"aria-label": "Voltar",
|
|
14167
14454
|
onClick: handleBackClick
|
|
14168
14455
|
}
|
|
14169
14456
|
),
|
|
14170
|
-
/* @__PURE__ */
|
|
14171
|
-
/* @__PURE__ */
|
|
14172
|
-
/* @__PURE__ */
|
|
14457
|
+
/* @__PURE__ */ jsxs50("span", { className: "flex flex-col gap-2 text-center", children: [
|
|
14458
|
+
/* @__PURE__ */ jsx65("p", { className: "text-text-950 font-bold text-md", children: quizTitle }),
|
|
14459
|
+
/* @__PURE__ */ jsx65("p", { className: "text-text-600 text-xs", children: totalQuestions > 0 ? `${currentQuestionIndex + 1} de ${totalQuestions}` : "0 de 0" })
|
|
14173
14460
|
] }),
|
|
14174
|
-
/* @__PURE__ */
|
|
14461
|
+
/* @__PURE__ */ jsx65("span", { className: "flex flex-row items-center justify-center", children: /* @__PURE__ */ jsx65(Badge_default, { variant: "outlined", action: "info", iconLeft: /* @__PURE__ */ jsx65(Clock2, {}), children: isStarted ? formatTime2(timeElapsed) : "00:00" }) })
|
|
14175
14462
|
]
|
|
14176
14463
|
}
|
|
14177
14464
|
),
|
|
14178
|
-
/* @__PURE__ */
|
|
14465
|
+
/* @__PURE__ */ jsx65(
|
|
14179
14466
|
AlertDialog,
|
|
14180
14467
|
{
|
|
14181
14468
|
isOpen: showExitConfirmation,
|
|
@@ -14195,7 +14482,7 @@ var QuizHeader = () => {
|
|
|
14195
14482
|
const currentQuestion = getCurrentQuestion();
|
|
14196
14483
|
let currentId = currentQuestion && "questionId" in currentQuestion ? currentQuestion.questionId : currentQuestion?.id;
|
|
14197
14484
|
const questionIndex = getQuestionIndex(currentId);
|
|
14198
|
-
return /* @__PURE__ */
|
|
14485
|
+
return /* @__PURE__ */ jsx65(
|
|
14199
14486
|
HeaderAlternative,
|
|
14200
14487
|
{
|
|
14201
14488
|
title: currentQuestion ? `Quest\xE3o ${questionIndex.toString().padStart(2, "0")}` : "Quest\xE3o",
|
|
@@ -14217,7 +14504,7 @@ var QuizContent = ({ paddingBottom }) => {
|
|
|
14217
14504
|
["IMAGEM" /* IMAGEM */]: QuizImageQuestion
|
|
14218
14505
|
};
|
|
14219
14506
|
const QuestionComponent = currentQuestion ? questionComponents[currentQuestion.questionType] : null;
|
|
14220
|
-
return QuestionComponent ? /* @__PURE__ */
|
|
14507
|
+
return QuestionComponent ? /* @__PURE__ */ jsx65(QuestionComponent, { paddingBottom }) : null;
|
|
14221
14508
|
};
|
|
14222
14509
|
var QuizQuestionList = ({
|
|
14223
14510
|
filterType = "all",
|
|
@@ -14264,18 +14551,18 @@ var QuizQuestionList = ({
|
|
|
14264
14551
|
return "Em branco";
|
|
14265
14552
|
}
|
|
14266
14553
|
};
|
|
14267
|
-
return /* @__PURE__ */
|
|
14268
|
-
Object.entries(filteredGroupedQuestions).length == 0 && /* @__PURE__ */
|
|
14554
|
+
return /* @__PURE__ */ jsxs50("div", { className: "space-y-6 px-4 h-full", children: [
|
|
14555
|
+
Object.entries(filteredGroupedQuestions).length == 0 && /* @__PURE__ */ jsx65("div", { className: "flex items-center justify-center text-gray-500 py-8 h-full", children: /* @__PURE__ */ jsx65("p", { className: "text-lg", children: "Nenhum resultado" }) }),
|
|
14269
14556
|
Object.entries(filteredGroupedQuestions).map(
|
|
14270
|
-
([subjectId, questions]) => /* @__PURE__ */
|
|
14271
|
-
/* @__PURE__ */
|
|
14272
|
-
/* @__PURE__ */
|
|
14273
|
-
/* @__PURE__ */
|
|
14557
|
+
([subjectId, questions]) => /* @__PURE__ */ jsxs50("section", { className: "flex flex-col gap-2", children: [
|
|
14558
|
+
/* @__PURE__ */ jsxs50("span", { className: "pt-6 pb-4 flex flex-row gap-2", children: [
|
|
14559
|
+
/* @__PURE__ */ jsx65("div", { className: "bg-primary-500 p-1 rounded-sm flex items-center justify-center", children: /* @__PURE__ */ jsx65(BookOpen, { size: 17, className: "text-white" }) }),
|
|
14560
|
+
/* @__PURE__ */ jsx65("p", { className: "text-text-800 font-bold text-lg", children: questions?.[0]?.knowledgeMatrix?.[0]?.subject?.name ?? "Sem mat\xE9ria" })
|
|
14274
14561
|
] }),
|
|
14275
|
-
/* @__PURE__ */
|
|
14562
|
+
/* @__PURE__ */ jsx65("ul", { className: "flex flex-col gap-2", children: questions.map((question) => {
|
|
14276
14563
|
const status = getQuestionStatus(question.id);
|
|
14277
14564
|
const questionNumber = getQuestionIndex(question.id);
|
|
14278
|
-
return /* @__PURE__ */
|
|
14565
|
+
return /* @__PURE__ */ jsx65(
|
|
14279
14566
|
CardStatus,
|
|
14280
14567
|
{
|
|
14281
14568
|
header: `Quest\xE3o ${questionNumber.toString().padStart(2, "0")}`,
|
|
@@ -14326,8 +14613,8 @@ var QuizFooter = forwardRef22(
|
|
|
14326
14613
|
const currentAnswer = getCurrentAnswer();
|
|
14327
14614
|
const currentQuestion = getCurrentQuestion();
|
|
14328
14615
|
const isCurrentQuestionSkipped = currentQuestion ? getQuestionStatusFromUserAnswers(currentQuestion.id) === "skipped" : false;
|
|
14329
|
-
const [activeModal, setActiveModal] =
|
|
14330
|
-
const [filterType, setFilterType] =
|
|
14616
|
+
const [activeModal, setActiveModal] = useState29(null);
|
|
14617
|
+
const [filterType, setFilterType] = useState29("all");
|
|
14331
14618
|
const openModal = (modalName) => setActiveModal(modalName);
|
|
14332
14619
|
const closeModal = () => setActiveModal(null);
|
|
14333
14620
|
const isModalOpen = (modalName) => activeModal === modalName;
|
|
@@ -14382,8 +14669,8 @@ var QuizFooter = forwardRef22(
|
|
|
14382
14669
|
return;
|
|
14383
14670
|
}
|
|
14384
14671
|
};
|
|
14385
|
-
return /* @__PURE__ */
|
|
14386
|
-
/* @__PURE__ */
|
|
14672
|
+
return /* @__PURE__ */ jsxs50(Fragment14, { children: [
|
|
14673
|
+
/* @__PURE__ */ jsx65(
|
|
14387
14674
|
"footer",
|
|
14388
14675
|
{
|
|
14389
14676
|
ref,
|
|
@@ -14392,17 +14679,17 @@ var QuizFooter = forwardRef22(
|
|
|
14392
14679
|
className
|
|
14393
14680
|
),
|
|
14394
14681
|
...props,
|
|
14395
|
-
children: variant === "default" ? /* @__PURE__ */
|
|
14396
|
-
/* @__PURE__ */
|
|
14397
|
-
/* @__PURE__ */
|
|
14682
|
+
children: variant === "default" ? /* @__PURE__ */ jsxs50(Fragment14, { children: [
|
|
14683
|
+
/* @__PURE__ */ jsxs50("div", { className: "flex flex-row items-center gap-1", children: [
|
|
14684
|
+
/* @__PURE__ */ jsx65(
|
|
14398
14685
|
IconButton_default,
|
|
14399
14686
|
{
|
|
14400
|
-
icon: /* @__PURE__ */
|
|
14687
|
+
icon: /* @__PURE__ */ jsx65(SquaresFour, { size: 24, className: "text-text-950" }),
|
|
14401
14688
|
size: "md",
|
|
14402
14689
|
onClick: () => openModal("modalNavigate")
|
|
14403
14690
|
}
|
|
14404
14691
|
),
|
|
14405
|
-
isFirstQuestion ? /* @__PURE__ */
|
|
14692
|
+
isFirstQuestion ? /* @__PURE__ */ jsx65(
|
|
14406
14693
|
Button_default,
|
|
14407
14694
|
{
|
|
14408
14695
|
variant: "outline",
|
|
@@ -14413,13 +14700,13 @@ var QuizFooter = forwardRef22(
|
|
|
14413
14700
|
},
|
|
14414
14701
|
children: "Pular"
|
|
14415
14702
|
}
|
|
14416
|
-
) : /* @__PURE__ */
|
|
14703
|
+
) : /* @__PURE__ */ jsx65(
|
|
14417
14704
|
Button_default,
|
|
14418
14705
|
{
|
|
14419
14706
|
size: "medium",
|
|
14420
14707
|
variant: "link",
|
|
14421
14708
|
action: "primary",
|
|
14422
|
-
iconLeft: /* @__PURE__ */
|
|
14709
|
+
iconLeft: /* @__PURE__ */ jsx65(CaretLeft5, { size: 18 }),
|
|
14423
14710
|
onClick: () => {
|
|
14424
14711
|
goToPreviousQuestion();
|
|
14425
14712
|
},
|
|
@@ -14427,7 +14714,7 @@ var QuizFooter = forwardRef22(
|
|
|
14427
14714
|
}
|
|
14428
14715
|
)
|
|
14429
14716
|
] }),
|
|
14430
|
-
!isFirstQuestion && !isLastQuestion && /* @__PURE__ */
|
|
14717
|
+
!isFirstQuestion && !isLastQuestion && /* @__PURE__ */ jsx65(
|
|
14431
14718
|
Button_default,
|
|
14432
14719
|
{
|
|
14433
14720
|
size: "small",
|
|
@@ -14440,7 +14727,7 @@ var QuizFooter = forwardRef22(
|
|
|
14440
14727
|
children: "Pular"
|
|
14441
14728
|
}
|
|
14442
14729
|
),
|
|
14443
|
-
isLastQuestion ? /* @__PURE__ */
|
|
14730
|
+
isLastQuestion ? /* @__PURE__ */ jsx65(
|
|
14444
14731
|
Button_default,
|
|
14445
14732
|
{
|
|
14446
14733
|
size: "medium",
|
|
@@ -14449,13 +14736,13 @@ var QuizFooter = forwardRef22(
|
|
|
14449
14736
|
onClick: handleFinishQuiz,
|
|
14450
14737
|
children: "Finalizar"
|
|
14451
14738
|
}
|
|
14452
|
-
) : /* @__PURE__ */
|
|
14739
|
+
) : /* @__PURE__ */ jsx65(
|
|
14453
14740
|
Button_default,
|
|
14454
14741
|
{
|
|
14455
14742
|
size: "medium",
|
|
14456
14743
|
variant: "link",
|
|
14457
14744
|
action: "primary",
|
|
14458
|
-
iconRight: /* @__PURE__ */
|
|
14745
|
+
iconRight: /* @__PURE__ */ jsx65(CaretRight8, { size: 18 }),
|
|
14459
14746
|
disabled: !currentAnswer && !isCurrentQuestionSkipped,
|
|
14460
14747
|
onClick: () => {
|
|
14461
14748
|
goToNextQuestion();
|
|
@@ -14463,7 +14750,7 @@ var QuizFooter = forwardRef22(
|
|
|
14463
14750
|
children: "Avan\xE7ar"
|
|
14464
14751
|
}
|
|
14465
14752
|
)
|
|
14466
|
-
] }) : /* @__PURE__ */
|
|
14753
|
+
] }) : /* @__PURE__ */ jsx65("div", { className: "flex flex-row items-center justify-center w-full", children: /* @__PURE__ */ jsx65(
|
|
14467
14754
|
Button_default,
|
|
14468
14755
|
{
|
|
14469
14756
|
variant: "link",
|
|
@@ -14475,7 +14762,7 @@ var QuizFooter = forwardRef22(
|
|
|
14475
14762
|
) })
|
|
14476
14763
|
}
|
|
14477
14764
|
),
|
|
14478
|
-
/* @__PURE__ */
|
|
14765
|
+
/* @__PURE__ */ jsx65(
|
|
14479
14766
|
AlertDialog,
|
|
14480
14767
|
{
|
|
14481
14768
|
isOpen: isModalOpen("alertDialog"),
|
|
@@ -14487,7 +14774,7 @@ var QuizFooter = forwardRef22(
|
|
|
14487
14774
|
onSubmit: handleAlertSubmit
|
|
14488
14775
|
}
|
|
14489
14776
|
),
|
|
14490
|
-
/* @__PURE__ */
|
|
14777
|
+
/* @__PURE__ */ jsx65(
|
|
14491
14778
|
Modal_default,
|
|
14492
14779
|
{
|
|
14493
14780
|
isOpen: isModalOpen("modalResult"),
|
|
@@ -14496,11 +14783,11 @@ var QuizFooter = forwardRef22(
|
|
|
14496
14783
|
closeOnEscape: false,
|
|
14497
14784
|
hideCloseButton: true,
|
|
14498
14785
|
size: "md",
|
|
14499
|
-
children: /* @__PURE__ */
|
|
14500
|
-
resultImageComponent ? /* @__PURE__ */
|
|
14501
|
-
/* @__PURE__ */
|
|
14502
|
-
/* @__PURE__ */
|
|
14503
|
-
/* @__PURE__ */
|
|
14786
|
+
children: /* @__PURE__ */ jsxs50("div", { className: "flex flex-col w-full h-full items-center justify-center gap-4", children: [
|
|
14787
|
+
resultImageComponent ? /* @__PURE__ */ jsx65("div", { className: "w-[282px] h-auto", children: resultImageComponent }) : /* @__PURE__ */ jsx65("div", { className: "w-[282px] h-[200px] bg-gray-100 rounded-md flex items-center justify-center", children: /* @__PURE__ */ jsx65("span", { className: "text-gray-500 text-sm", children: "Imagem de resultado" }) }),
|
|
14788
|
+
/* @__PURE__ */ jsxs50("div", { className: "flex flex-col gap-2 text-center", children: [
|
|
14789
|
+
/* @__PURE__ */ jsx65("h2", { className: "text-text-950 font-bold text-lg", children: getCompletionTitle(quizType) }),
|
|
14790
|
+
/* @__PURE__ */ jsxs50("p", { className: "text-text-500 font-sm", children: [
|
|
14504
14791
|
"Voc\xEA acertou ",
|
|
14505
14792
|
correctAnswers ?? "--",
|
|
14506
14793
|
" de ",
|
|
@@ -14509,8 +14796,8 @@ var QuizFooter = forwardRef22(
|
|
|
14509
14796
|
"quest\xF5es."
|
|
14510
14797
|
] })
|
|
14511
14798
|
] }),
|
|
14512
|
-
/* @__PURE__ */
|
|
14513
|
-
/* @__PURE__ */
|
|
14799
|
+
/* @__PURE__ */ jsxs50("div", { className: "px-6 flex flex-row items-center gap-2 w-full", children: [
|
|
14800
|
+
/* @__PURE__ */ jsx65(
|
|
14514
14801
|
Button_default,
|
|
14515
14802
|
{
|
|
14516
14803
|
variant: "outline",
|
|
@@ -14520,38 +14807,38 @@ var QuizFooter = forwardRef22(
|
|
|
14520
14807
|
children: quizTypeLabel === "Question\xE1rio" ? "Ir para aulas" : `Ir para ${quizTypeLabel.toLocaleLowerCase()}s`
|
|
14521
14808
|
}
|
|
14522
14809
|
),
|
|
14523
|
-
/* @__PURE__ */
|
|
14810
|
+
/* @__PURE__ */ jsx65(Button_default, { className: "w-full", onClick: onDetailResult, children: "Detalhar resultado" })
|
|
14524
14811
|
] })
|
|
14525
14812
|
] })
|
|
14526
14813
|
}
|
|
14527
14814
|
),
|
|
14528
|
-
/* @__PURE__ */
|
|
14815
|
+
/* @__PURE__ */ jsx65(
|
|
14529
14816
|
Modal_default,
|
|
14530
14817
|
{
|
|
14531
14818
|
isOpen: isModalOpen("modalNavigate"),
|
|
14532
14819
|
onClose: closeModal,
|
|
14533
14820
|
title: "Quest\xF5es",
|
|
14534
14821
|
size: "lg",
|
|
14535
|
-
children: /* @__PURE__ */
|
|
14536
|
-
/* @__PURE__ */
|
|
14537
|
-
/* @__PURE__ */
|
|
14538
|
-
/* @__PURE__ */
|
|
14539
|
-
/* @__PURE__ */
|
|
14822
|
+
children: /* @__PURE__ */ jsxs50("div", { className: "flex flex-col w-full not-lg:h-[calc(100vh-200px)] lg:max-h-[687px] lg:h-[687px]", children: [
|
|
14823
|
+
/* @__PURE__ */ jsxs50("div", { className: "flex flex-row justify-between items-center py-6 pt-6 pb-4 border-b border-border-200 flex-shrink-0", children: [
|
|
14824
|
+
/* @__PURE__ */ jsx65("p", { className: "text-text-950 font-bold text-lg", children: "Filtrar por" }),
|
|
14825
|
+
/* @__PURE__ */ jsx65("span", { className: "max-w-[266px]", children: /* @__PURE__ */ jsxs50(Select_default, { value: filterType, onValueChange: setFilterType, children: [
|
|
14826
|
+
/* @__PURE__ */ jsx65(
|
|
14540
14827
|
SelectTrigger,
|
|
14541
14828
|
{
|
|
14542
14829
|
variant: "rounded",
|
|
14543
14830
|
className: "max-w-[266px] min-w-[160px]",
|
|
14544
|
-
children: /* @__PURE__ */
|
|
14831
|
+
children: /* @__PURE__ */ jsx65(SelectValue, { placeholder: "Selecione uma op\xE7\xE3o" })
|
|
14545
14832
|
}
|
|
14546
14833
|
),
|
|
14547
|
-
/* @__PURE__ */
|
|
14548
|
-
/* @__PURE__ */
|
|
14549
|
-
/* @__PURE__ */
|
|
14550
|
-
/* @__PURE__ */
|
|
14834
|
+
/* @__PURE__ */ jsxs50(SelectContent, { children: [
|
|
14835
|
+
/* @__PURE__ */ jsx65(SelectItem, { value: "all", children: "Todas" }),
|
|
14836
|
+
/* @__PURE__ */ jsx65(SelectItem, { value: "unanswered", children: "Em branco" }),
|
|
14837
|
+
/* @__PURE__ */ jsx65(SelectItem, { value: "answered", children: "Respondidas" })
|
|
14551
14838
|
] })
|
|
14552
14839
|
] }) })
|
|
14553
14840
|
] }),
|
|
14554
|
-
/* @__PURE__ */
|
|
14841
|
+
/* @__PURE__ */ jsx65("div", { className: "flex flex-col gap-2 flex-1 min-h-0 overflow-y-auto", children: /* @__PURE__ */ jsx65(
|
|
14555
14842
|
QuizQuestionList,
|
|
14556
14843
|
{
|
|
14557
14844
|
filterType,
|
|
@@ -14561,7 +14848,7 @@ var QuizFooter = forwardRef22(
|
|
|
14561
14848
|
] })
|
|
14562
14849
|
}
|
|
14563
14850
|
),
|
|
14564
|
-
/* @__PURE__ */
|
|
14851
|
+
/* @__PURE__ */ jsx65(
|
|
14565
14852
|
Modal_default,
|
|
14566
14853
|
{
|
|
14567
14854
|
isOpen: isModalOpen("modalResolution"),
|
|
@@ -14571,7 +14858,7 @@ var QuizFooter = forwardRef22(
|
|
|
14571
14858
|
children: currentQuestion?.solutionExplanation
|
|
14572
14859
|
}
|
|
14573
14860
|
),
|
|
14574
|
-
/* @__PURE__ */
|
|
14861
|
+
/* @__PURE__ */ jsx65(
|
|
14575
14862
|
Modal_default,
|
|
14576
14863
|
{
|
|
14577
14864
|
isOpen: isModalOpen("modalQuestionnaireAllCorrect"),
|
|
@@ -14580,17 +14867,17 @@ var QuizFooter = forwardRef22(
|
|
|
14580
14867
|
closeOnEscape: false,
|
|
14581
14868
|
hideCloseButton: true,
|
|
14582
14869
|
size: "md",
|
|
14583
|
-
children: /* @__PURE__ */
|
|
14584
|
-
resultImageComponent ? /* @__PURE__ */
|
|
14585
|
-
/* @__PURE__ */
|
|
14586
|
-
/* @__PURE__ */
|
|
14587
|
-
/* @__PURE__ */
|
|
14870
|
+
children: /* @__PURE__ */ jsxs50("div", { className: "flex flex-col w-full h-full items-center justify-center gap-4", children: [
|
|
14871
|
+
resultImageComponent ? /* @__PURE__ */ jsx65("div", { className: "w-[282px] h-auto", children: resultImageComponent }) : /* @__PURE__ */ jsx65("div", { className: "w-[282px] h-[200px] bg-gray-100 rounded-md flex items-center justify-center", children: /* @__PURE__ */ jsx65("span", { className: "text-gray-500 text-sm", children: "Imagem de resultado" }) }),
|
|
14872
|
+
/* @__PURE__ */ jsxs50("div", { className: "flex flex-col gap-2 text-center", children: [
|
|
14873
|
+
/* @__PURE__ */ jsx65("h2", { className: "text-text-950 font-bold text-lg", children: "\u{1F389} Parab\xE9ns!" }),
|
|
14874
|
+
/* @__PURE__ */ jsx65("p", { className: "text-text-500 font-sm", children: "Voc\xEA concluiu o m\xF3dulo Movimento Uniforme." })
|
|
14588
14875
|
] }),
|
|
14589
|
-
/* @__PURE__ */
|
|
14876
|
+
/* @__PURE__ */ jsx65("div", { className: "px-6 flex flex-row items-center gap-2 w-full", children: /* @__PURE__ */ jsx65(Button_default, { className: "w-full", onClick: onGoToNextModule, children: "Pr\xF3ximo m\xF3dulo" }) })
|
|
14590
14877
|
] })
|
|
14591
14878
|
}
|
|
14592
14879
|
),
|
|
14593
|
-
/* @__PURE__ */
|
|
14880
|
+
/* @__PURE__ */ jsx65(
|
|
14594
14881
|
Modal_default,
|
|
14595
14882
|
{
|
|
14596
14883
|
isOpen: isModalOpen("modalQuestionnaireAllIncorrect"),
|
|
@@ -14599,16 +14886,16 @@ var QuizFooter = forwardRef22(
|
|
|
14599
14886
|
closeOnEscape: false,
|
|
14600
14887
|
hideCloseButton: true,
|
|
14601
14888
|
size: "md",
|
|
14602
|
-
children: /* @__PURE__ */
|
|
14603
|
-
resultIncorrectImageComponent ? /* @__PURE__ */
|
|
14604
|
-
/* @__PURE__ */
|
|
14605
|
-
/* @__PURE__ */
|
|
14606
|
-
/* @__PURE__ */
|
|
14607
|
-
/* @__PURE__ */
|
|
14608
|
-
/* @__PURE__ */
|
|
14889
|
+
children: /* @__PURE__ */ jsxs50("div", { className: "flex flex-col w-full h-full items-center justify-center gap-4", children: [
|
|
14890
|
+
resultIncorrectImageComponent ? /* @__PURE__ */ jsx65("div", { className: "w-[282px] h-auto", children: resultIncorrectImageComponent }) : /* @__PURE__ */ jsx65("div", { className: "w-[282px] h-[200px] bg-gray-100 rounded-md flex items-center justify-center", children: /* @__PURE__ */ jsx65("span", { className: "text-gray-500 text-sm", children: "Imagem de resultado" }) }),
|
|
14891
|
+
/* @__PURE__ */ jsxs50("div", { className: "flex flex-col gap-2 text-center", children: [
|
|
14892
|
+
/* @__PURE__ */ jsx65("h2", { className: "text-text-950 font-bold text-lg", children: "\u{1F615} N\xE3o foi dessa vez..." }),
|
|
14893
|
+
/* @__PURE__ */ jsx65("p", { className: "text-text-500 font-sm", children: "Voc\xEA tirou 0 no question\xE1rio, mas n\xE3o se preocupe! Isso \xE9 apenas uma oportunidade de aprendizado." }),
|
|
14894
|
+
/* @__PURE__ */ jsx65("p", { className: "text-text-500 font-sm", children: "Que tal tentar novamente para melhorar sua nota? Estamos aqui para te ajudar a entender o conte\xFAdo e evoluir." }),
|
|
14895
|
+
/* @__PURE__ */ jsx65("p", { className: "text-text-500 font-sm", children: "Clique em Repetir Question\xE1rio e mostre do que voc\xEA \xE9 capaz! \u{1F4AA}" })
|
|
14609
14896
|
] }),
|
|
14610
|
-
/* @__PURE__ */
|
|
14611
|
-
/* @__PURE__ */
|
|
14897
|
+
/* @__PURE__ */ jsxs50("div", { className: "flex flex-row justify-center items-center gap-2 w-full", children: [
|
|
14898
|
+
/* @__PURE__ */ jsx65(
|
|
14612
14899
|
Button_default,
|
|
14613
14900
|
{
|
|
14614
14901
|
type: "button",
|
|
@@ -14622,7 +14909,7 @@ var QuizFooter = forwardRef22(
|
|
|
14622
14909
|
children: "Tentar depois"
|
|
14623
14910
|
}
|
|
14624
14911
|
),
|
|
14625
|
-
/* @__PURE__ */
|
|
14912
|
+
/* @__PURE__ */ jsx65(
|
|
14626
14913
|
Button_default,
|
|
14627
14914
|
{
|
|
14628
14915
|
variant: "outline",
|
|
@@ -14632,7 +14919,7 @@ var QuizFooter = forwardRef22(
|
|
|
14632
14919
|
children: "Detalhar resultado"
|
|
14633
14920
|
}
|
|
14634
14921
|
),
|
|
14635
|
-
/* @__PURE__ */
|
|
14922
|
+
/* @__PURE__ */ jsx65(
|
|
14636
14923
|
Button_default,
|
|
14637
14924
|
{
|
|
14638
14925
|
className: "w-auto",
|
|
@@ -14645,7 +14932,7 @@ var QuizFooter = forwardRef22(
|
|
|
14645
14932
|
] })
|
|
14646
14933
|
}
|
|
14647
14934
|
),
|
|
14648
|
-
/* @__PURE__ */
|
|
14935
|
+
/* @__PURE__ */ jsx65(
|
|
14649
14936
|
AlertDialog,
|
|
14650
14937
|
{
|
|
14651
14938
|
isOpen: isModalOpen("alertDialogTryLater"),
|
|
@@ -14669,26 +14956,26 @@ var QuizFooter = forwardRef22(
|
|
|
14669
14956
|
);
|
|
14670
14957
|
|
|
14671
14958
|
// src/components/Quiz/QuizResult.tsx
|
|
14672
|
-
import { forwardRef as forwardRef23, useEffect as
|
|
14959
|
+
import { forwardRef as forwardRef23, useEffect as useEffect30, useState as useState30 } from "react";
|
|
14673
14960
|
import { Clock as Clock3 } from "phosphor-react";
|
|
14674
|
-
import { jsx as
|
|
14961
|
+
import { jsx as jsx66, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
14675
14962
|
var QuizBadge = ({
|
|
14676
14963
|
subtype
|
|
14677
14964
|
}) => {
|
|
14678
14965
|
switch (subtype) {
|
|
14679
14966
|
case "PROVA" /* PROVA */:
|
|
14680
|
-
return /* @__PURE__ */
|
|
14967
|
+
return /* @__PURE__ */ jsx66(Badge_default, { variant: "examsOutlined", action: "exam2", "data-testid": "quiz-badge", children: "Prova" });
|
|
14681
14968
|
case "ENEM_PROVA_1" /* ENEM_PROVA_1 */:
|
|
14682
14969
|
case "ENEM_PROVA_2" /* ENEM_PROVA_2 */:
|
|
14683
|
-
return /* @__PURE__ */
|
|
14970
|
+
return /* @__PURE__ */ jsx66(Badge_default, { variant: "examsOutlined", action: "exam1", "data-testid": "quiz-badge", children: "Enem" });
|
|
14684
14971
|
case "VESTIBULAR" /* VESTIBULAR */:
|
|
14685
|
-
return /* @__PURE__ */
|
|
14972
|
+
return /* @__PURE__ */ jsx66(Badge_default, { variant: "examsOutlined", action: "exam4", "data-testid": "quiz-badge", children: "Vestibular" });
|
|
14686
14973
|
case "SIMULADO" /* SIMULADO */:
|
|
14687
14974
|
case "SIMULADAO" /* SIMULADAO */:
|
|
14688
14975
|
case void 0:
|
|
14689
|
-
return /* @__PURE__ */
|
|
14976
|
+
return /* @__PURE__ */ jsx66(Badge_default, { variant: "examsOutlined", action: "exam3", "data-testid": "quiz-badge", children: "Simulad\xE3o" });
|
|
14690
14977
|
default:
|
|
14691
|
-
return /* @__PURE__ */
|
|
14978
|
+
return /* @__PURE__ */ jsx66(Badge_default, { variant: "solid", action: "info", "data-testid": "quiz-badge", children: subtype });
|
|
14692
14979
|
}
|
|
14693
14980
|
};
|
|
14694
14981
|
var QuizHeaderResult = forwardRef23(
|
|
@@ -14698,8 +14985,8 @@ var QuizHeaderResult = forwardRef23(
|
|
|
14698
14985
|
getCurrentQuestion,
|
|
14699
14986
|
questionsResult
|
|
14700
14987
|
} = useQuizStore();
|
|
14701
|
-
const [status, setStatus] =
|
|
14702
|
-
|
|
14988
|
+
const [status, setStatus] = useState30(void 0);
|
|
14989
|
+
useEffect30(() => {
|
|
14703
14990
|
const cq = getCurrentQuestion();
|
|
14704
14991
|
if (!cq) {
|
|
14705
14992
|
setStatus(void 0);
|
|
@@ -14745,7 +15032,7 @@ var QuizHeaderResult = forwardRef23(
|
|
|
14745
15032
|
return "N\xE3o foi dessa vez...voc\xEA deixou a resposta em branco";
|
|
14746
15033
|
}
|
|
14747
15034
|
};
|
|
14748
|
-
return /* @__PURE__ */
|
|
15035
|
+
return /* @__PURE__ */ jsxs51(
|
|
14749
15036
|
"div",
|
|
14750
15037
|
{
|
|
14751
15038
|
ref,
|
|
@@ -14756,8 +15043,8 @@ var QuizHeaderResult = forwardRef23(
|
|
|
14756
15043
|
),
|
|
14757
15044
|
...props,
|
|
14758
15045
|
children: [
|
|
14759
|
-
/* @__PURE__ */
|
|
14760
|
-
/* @__PURE__ */
|
|
15046
|
+
/* @__PURE__ */ jsx66("p", { className: "text-text-950 font-bold text-lg", children: "Resultado" }),
|
|
15047
|
+
/* @__PURE__ */ jsx66("p", { className: "text-text-700 text-md", children: getLabelByAnswersStatus() })
|
|
14761
15048
|
]
|
|
14762
15049
|
}
|
|
14763
15050
|
);
|
|
@@ -14765,7 +15052,7 @@ var QuizHeaderResult = forwardRef23(
|
|
|
14765
15052
|
);
|
|
14766
15053
|
var QuizResultHeaderTitle = forwardRef23(({ className, showBadge = true, onRepeat, canRetry, ...props }, ref) => {
|
|
14767
15054
|
const { quiz } = useQuizStore();
|
|
14768
|
-
return /* @__PURE__ */
|
|
15055
|
+
return /* @__PURE__ */ jsxs51(
|
|
14769
15056
|
"div",
|
|
14770
15057
|
{
|
|
14771
15058
|
ref,
|
|
@@ -14775,9 +15062,9 @@ var QuizResultHeaderTitle = forwardRef23(({ className, showBadge = true, onRepea
|
|
|
14775
15062
|
),
|
|
14776
15063
|
...props,
|
|
14777
15064
|
children: [
|
|
14778
|
-
/* @__PURE__ */
|
|
14779
|
-
/* @__PURE__ */
|
|
14780
|
-
canRetry && onRepeat && /* @__PURE__ */
|
|
15065
|
+
/* @__PURE__ */ jsx66("p", { className: "text-text-950 font-bold text-2xl", children: "Resultado" }),
|
|
15066
|
+
/* @__PURE__ */ jsxs51("div", { className: "flex flex-row gap-3 items-center", children: [
|
|
15067
|
+
canRetry && onRepeat && /* @__PURE__ */ jsx66(
|
|
14781
15068
|
Button_default,
|
|
14782
15069
|
{
|
|
14783
15070
|
variant: "solid",
|
|
@@ -14787,7 +15074,7 @@ var QuizResultHeaderTitle = forwardRef23(({ className, showBadge = true, onRepea
|
|
|
14787
15074
|
children: "Repetir question\xE1rio"
|
|
14788
15075
|
}
|
|
14789
15076
|
),
|
|
14790
|
-
showBadge && /* @__PURE__ */
|
|
15077
|
+
showBadge && /* @__PURE__ */ jsx66(QuizBadge, { subtype: quiz?.subtype || void 0 })
|
|
14791
15078
|
] })
|
|
14792
15079
|
]
|
|
14793
15080
|
}
|
|
@@ -14796,7 +15083,7 @@ var QuizResultHeaderTitle = forwardRef23(({ className, showBadge = true, onRepea
|
|
|
14796
15083
|
var QuizResultTitle = forwardRef23(({ className, ...props }, ref) => {
|
|
14797
15084
|
const { getQuizTitle } = useQuizStore();
|
|
14798
15085
|
const quizTitle = getQuizTitle();
|
|
14799
|
-
return /* @__PURE__ */
|
|
15086
|
+
return /* @__PURE__ */ jsx66(
|
|
14800
15087
|
"p",
|
|
14801
15088
|
{
|
|
14802
15089
|
className: cn("pt-6 pb-4 text-text-950 font-bold text-lg", className),
|
|
@@ -14857,7 +15144,7 @@ var QuizResultPerformance = forwardRef23(({ showDetails = true, ...props }, ref)
|
|
|
14857
15144
|
};
|
|
14858
15145
|
const percentage = totalQuestions > 0 ? Math.round(stats.correctAnswers / totalQuestions * 100) : 0;
|
|
14859
15146
|
const classesJustifyBetween = showDetails ? "justify-between" : "justify-center";
|
|
14860
|
-
return /* @__PURE__ */
|
|
15147
|
+
return /* @__PURE__ */ jsxs51(
|
|
14861
15148
|
"div",
|
|
14862
15149
|
{
|
|
14863
15150
|
className: cn(
|
|
@@ -14867,8 +15154,8 @@ var QuizResultPerformance = forwardRef23(({ showDetails = true, ...props }, ref)
|
|
|
14867
15154
|
ref,
|
|
14868
15155
|
...props,
|
|
14869
15156
|
children: [
|
|
14870
|
-
/* @__PURE__ */
|
|
14871
|
-
/* @__PURE__ */
|
|
15157
|
+
/* @__PURE__ */ jsxs51("div", { className: "relative", children: [
|
|
15158
|
+
/* @__PURE__ */ jsx66(
|
|
14872
15159
|
ProgressCircle_default,
|
|
14873
15160
|
{
|
|
14874
15161
|
size: "medium",
|
|
@@ -14878,24 +15165,24 @@ var QuizResultPerformance = forwardRef23(({ showDetails = true, ...props }, ref)
|
|
|
14878
15165
|
label: ""
|
|
14879
15166
|
}
|
|
14880
15167
|
),
|
|
14881
|
-
/* @__PURE__ */
|
|
14882
|
-
showDetails && /* @__PURE__ */
|
|
14883
|
-
/* @__PURE__ */
|
|
14884
|
-
/* @__PURE__ */
|
|
15168
|
+
/* @__PURE__ */ jsxs51("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
|
|
15169
|
+
showDetails && /* @__PURE__ */ jsxs51("div", { className: "flex items-center gap-1 mb-1", children: [
|
|
15170
|
+
/* @__PURE__ */ jsx66(Clock3, { size: 12, weight: "regular", className: "text-text-800" }),
|
|
15171
|
+
/* @__PURE__ */ jsx66("span", { className: "text-2xs font-medium text-text-800", children: formatTime2(
|
|
14885
15172
|
(getQuestionResultStatistics()?.timeSpent ?? 0) * 60
|
|
14886
15173
|
) })
|
|
14887
15174
|
] }),
|
|
14888
|
-
/* @__PURE__ */
|
|
15175
|
+
/* @__PURE__ */ jsxs51("div", { className: "text-2xl font-medium text-text-800 leading-7", children: [
|
|
14889
15176
|
getQuestionResultStatistics()?.correctAnswers ?? "--",
|
|
14890
15177
|
" de",
|
|
14891
15178
|
" ",
|
|
14892
15179
|
totalQuestions
|
|
14893
15180
|
] }),
|
|
14894
|
-
/* @__PURE__ */
|
|
15181
|
+
/* @__PURE__ */ jsx66("div", { className: "text-2xs font-medium text-text-600 mt-1", children: "Corretas" })
|
|
14895
15182
|
] })
|
|
14896
15183
|
] }),
|
|
14897
|
-
showDetails && /* @__PURE__ */
|
|
14898
|
-
/* @__PURE__ */
|
|
15184
|
+
showDetails && /* @__PURE__ */ jsxs51("div", { className: "flex flex-col gap-4 w-full", children: [
|
|
15185
|
+
/* @__PURE__ */ jsx66(
|
|
14899
15186
|
ProgressBar_default,
|
|
14900
15187
|
{
|
|
14901
15188
|
className: "w-full",
|
|
@@ -14909,7 +15196,7 @@ var QuizResultPerformance = forwardRef23(({ showDetails = true, ...props }, ref)
|
|
|
14909
15196
|
percentageClassName: "text-xs font-medium leading-[14px] text-right"
|
|
14910
15197
|
}
|
|
14911
15198
|
),
|
|
14912
|
-
/* @__PURE__ */
|
|
15199
|
+
/* @__PURE__ */ jsx66(
|
|
14913
15200
|
ProgressBar_default,
|
|
14914
15201
|
{
|
|
14915
15202
|
className: "w-full",
|
|
@@ -14923,7 +15210,7 @@ var QuizResultPerformance = forwardRef23(({ showDetails = true, ...props }, ref)
|
|
|
14923
15210
|
percentageClassName: "text-xs font-medium leading-[14px] text-right"
|
|
14924
15211
|
}
|
|
14925
15212
|
),
|
|
14926
|
-
/* @__PURE__ */
|
|
15213
|
+
/* @__PURE__ */ jsx66(
|
|
14927
15214
|
ProgressBar_default,
|
|
14928
15215
|
{
|
|
14929
15216
|
className: "w-full",
|
|
@@ -14970,9 +15257,9 @@ var QuizListResult = forwardRef23(({ className, onSubjectClick, ...props }, ref)
|
|
|
14970
15257
|
};
|
|
14971
15258
|
}
|
|
14972
15259
|
);
|
|
14973
|
-
return /* @__PURE__ */
|
|
14974
|
-
/* @__PURE__ */
|
|
14975
|
-
/* @__PURE__ */
|
|
15260
|
+
return /* @__PURE__ */ jsxs51("section", { ref, className, ...props, children: [
|
|
15261
|
+
/* @__PURE__ */ jsx66("p", { className: "pt-6 pb-4 text-text-950 font-bold text-lg", children: "Mat\xE9rias" }),
|
|
15262
|
+
/* @__PURE__ */ jsx66("ul", { className: "flex flex-col gap-2", children: subjectsStats.map((subject) => /* @__PURE__ */ jsx66("li", { children: /* @__PURE__ */ jsx66(
|
|
14976
15263
|
CardResults,
|
|
14977
15264
|
{
|
|
14978
15265
|
onClick: () => onSubjectClick?.(subject.subject.id),
|
|
@@ -14996,16 +15283,16 @@ var QuizListResultByMateria = ({
|
|
|
14996
15283
|
const groupedQuestions = getQuestionsGroupedBySubject();
|
|
14997
15284
|
const answeredQuestions = groupedQuestions[subject] || [];
|
|
14998
15285
|
const formattedQuestions = subject == "all" ? Object.values(groupedQuestions).flat() : answeredQuestions;
|
|
14999
|
-
return /* @__PURE__ */
|
|
15000
|
-
/* @__PURE__ */
|
|
15001
|
-
/* @__PURE__ */
|
|
15002
|
-
/* @__PURE__ */
|
|
15003
|
-
/* @__PURE__ */
|
|
15286
|
+
return /* @__PURE__ */ jsxs51("div", { className: "flex flex-col", children: [
|
|
15287
|
+
/* @__PURE__ */ jsx66("div", { className: "flex flex-row pt-4 justify-between", children: /* @__PURE__ */ jsx66("p", { className: "text-text-950 font-bold text-2xl", children: subjectName || formattedQuestions?.[0]?.knowledgeMatrix?.[0]?.subject?.name || "Sem mat\xE9ria" }) }),
|
|
15288
|
+
/* @__PURE__ */ jsxs51("section", { className: "flex flex-col ", children: [
|
|
15289
|
+
/* @__PURE__ */ jsx66("p", { className: "pt-6 pb-4 text-text-950 font-bold text-lg", children: "Resultado das quest\xF5es" }),
|
|
15290
|
+
/* @__PURE__ */ jsx66("ul", { className: "flex flex-col gap-2 pt-4", children: formattedQuestions.map((question) => {
|
|
15004
15291
|
const questionIndex = getQuestionIndex(
|
|
15005
15292
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15006
15293
|
question.questionId ?? question.id
|
|
15007
15294
|
);
|
|
15008
|
-
return /* @__PURE__ */
|
|
15295
|
+
return /* @__PURE__ */ jsx66("li", { children: /* @__PURE__ */ jsx66(
|
|
15009
15296
|
CardStatus,
|
|
15010
15297
|
{
|
|
15011
15298
|
className: "max-w-full",
|
|
@@ -15031,7 +15318,7 @@ var QuizListResultByMateria = ({
|
|
|
15031
15318
|
|
|
15032
15319
|
// src/components/BreadcrumbMenu/BreadcrumbMenu.tsx
|
|
15033
15320
|
import { useNavigate } from "react-router-dom";
|
|
15034
|
-
import { jsx as
|
|
15321
|
+
import { jsx as jsx67 } from "react/jsx-runtime";
|
|
15035
15322
|
var BreadcrumbMenu = ({
|
|
15036
15323
|
breadcrumbs,
|
|
15037
15324
|
onBreadcrumbClick,
|
|
@@ -15044,17 +15331,17 @@ var BreadcrumbMenu = ({
|
|
|
15044
15331
|
}
|
|
15045
15332
|
navigate(breadcrumb.url);
|
|
15046
15333
|
};
|
|
15047
|
-
return /* @__PURE__ */
|
|
15334
|
+
return /* @__PURE__ */ jsx67(
|
|
15048
15335
|
Menu,
|
|
15049
15336
|
{
|
|
15050
15337
|
value: `breadcrumb-${breadcrumbs.length - 1}`,
|
|
15051
15338
|
defaultValue: "breadcrumb-0",
|
|
15052
15339
|
variant: "breadcrumb",
|
|
15053
15340
|
className,
|
|
15054
|
-
children: /* @__PURE__ */
|
|
15341
|
+
children: /* @__PURE__ */ jsx67(MenuContent, { className: "w-full flex flex-row flex-wrap gap-2 !px-0", children: breadcrumbs.map((breadcrumb, index) => {
|
|
15055
15342
|
const isLast = index === breadcrumbs.length - 1;
|
|
15056
15343
|
const hasSeparator = !isLast;
|
|
15057
|
-
return /* @__PURE__ */
|
|
15344
|
+
return /* @__PURE__ */ jsx67(
|
|
15058
15345
|
MenuItem,
|
|
15059
15346
|
{
|
|
15060
15347
|
variant: "breadcrumb",
|
|
@@ -15072,7 +15359,7 @@ var BreadcrumbMenu = ({
|
|
|
15072
15359
|
};
|
|
15073
15360
|
|
|
15074
15361
|
// src/components/BreadcrumbMenu/useBreadcrumbBuilder.ts
|
|
15075
|
-
import { useEffect as
|
|
15362
|
+
import { useEffect as useEffect31 } from "react";
|
|
15076
15363
|
|
|
15077
15364
|
// src/components/BreadcrumbMenu/breadcrumbStore.ts
|
|
15078
15365
|
import { create as create12 } from "zustand";
|
|
@@ -15201,7 +15488,7 @@ var useBreadcrumbBuilder = (config) => {
|
|
|
15201
15488
|
(level) => isBreadcrumbWithData(level) ? level.data : null
|
|
15202
15489
|
);
|
|
15203
15490
|
const levelUrlIds = levels.map((level) => level.urlId);
|
|
15204
|
-
|
|
15491
|
+
useEffect31(() => {
|
|
15205
15492
|
const newBreadcrumbs = [root];
|
|
15206
15493
|
const previousIds = [];
|
|
15207
15494
|
for (const level of levels) {
|
|
@@ -15233,11 +15520,11 @@ var useBreadcrumbBuilder = (config) => {
|
|
|
15233
15520
|
};
|
|
15234
15521
|
|
|
15235
15522
|
// src/components/BreadcrumbMenu/useUrlParams.ts
|
|
15236
|
-
import { useMemo as
|
|
15523
|
+
import { useMemo as useMemo14 } from "react";
|
|
15237
15524
|
import { useLocation as useLocation3 } from "react-router-dom";
|
|
15238
15525
|
var useUrlParams = (config) => {
|
|
15239
15526
|
const location = useLocation3();
|
|
15240
|
-
return
|
|
15527
|
+
return useMemo14(() => {
|
|
15241
15528
|
const segments = location.pathname.split("/").filter(Boolean);
|
|
15242
15529
|
const params = {};
|
|
15243
15530
|
for (const [key, index] of Object.entries(config)) {
|
|
@@ -15248,15 +15535,15 @@ var useUrlParams = (config) => {
|
|
|
15248
15535
|
};
|
|
15249
15536
|
|
|
15250
15537
|
// src/hooks/useAppInitialization.ts
|
|
15251
|
-
import { useMemo as
|
|
15538
|
+
import { useMemo as useMemo15 } from "react";
|
|
15252
15539
|
|
|
15253
15540
|
// src/hooks/useInstitution.ts
|
|
15254
|
-
import { useEffect as
|
|
15541
|
+
import { useEffect as useEffect32, useState as useState31 } from "react";
|
|
15255
15542
|
function useInstitutionId() {
|
|
15256
|
-
const [institutionId, setInstitutionId] =
|
|
15543
|
+
const [institutionId, setInstitutionId] = useState31(() => {
|
|
15257
15544
|
return document.querySelector('meta[name="institution-id"]')?.getAttribute("content") ?? null;
|
|
15258
15545
|
});
|
|
15259
|
-
|
|
15546
|
+
useEffect32(() => {
|
|
15260
15547
|
const metaTag = document.querySelector('meta[name="institution-id"]');
|
|
15261
15548
|
if (!metaTag) return;
|
|
15262
15549
|
const observer = new MutationObserver(() => {
|
|
@@ -15423,7 +15710,7 @@ var useAuthStore = create14()(
|
|
|
15423
15710
|
function useAppInitialization() {
|
|
15424
15711
|
const getInstitutionId = useInstitutionId();
|
|
15425
15712
|
const { initialize, initialized, institutionId } = useAppStore();
|
|
15426
|
-
const authFunctions =
|
|
15713
|
+
const authFunctions = useMemo15(
|
|
15427
15714
|
() => ({
|
|
15428
15715
|
checkAuth: async () => {
|
|
15429
15716
|
const { sessionInfo, tokens } = useAuthStore.getState();
|
|
@@ -15460,7 +15747,7 @@ function useAppInitialization() {
|
|
|
15460
15747
|
}
|
|
15461
15748
|
|
|
15462
15749
|
// src/hooks/useAppContent.ts
|
|
15463
|
-
import { useCallback as
|
|
15750
|
+
import { useCallback as useCallback10, useEffect as useEffect33, useMemo as useMemo16 } from "react";
|
|
15464
15751
|
import { useNavigate as useNavigate2 } from "react-router-dom";
|
|
15465
15752
|
function useAppContent(config) {
|
|
15466
15753
|
const navigate = useNavigate2();
|
|
@@ -15486,20 +15773,20 @@ function useAppContent(config) {
|
|
|
15486
15773
|
navigate("/painel");
|
|
15487
15774
|
}
|
|
15488
15775
|
};
|
|
15489
|
-
const handleSetSelectedProfile =
|
|
15776
|
+
const handleSetSelectedProfile = useCallback10(
|
|
15490
15777
|
(profile) => {
|
|
15491
15778
|
setSelectedProfile(profile);
|
|
15492
15779
|
},
|
|
15493
15780
|
[setSelectedProfile]
|
|
15494
15781
|
);
|
|
15495
|
-
const handleClearParamsFromURL =
|
|
15782
|
+
const handleClearParamsFromURL = useCallback10(() => {
|
|
15496
15783
|
if (onClearParamsFromURL) {
|
|
15497
15784
|
onClearParamsFromURL();
|
|
15498
15785
|
} else {
|
|
15499
15786
|
globalThis.location.replace("/painel");
|
|
15500
15787
|
}
|
|
15501
15788
|
}, [onClearParamsFromURL]);
|
|
15502
|
-
const handleError =
|
|
15789
|
+
const handleError = useCallback10(
|
|
15503
15790
|
(error) => {
|
|
15504
15791
|
if (onError) {
|
|
15505
15792
|
onError(error);
|
|
@@ -15510,7 +15797,7 @@ function useAppContent(config) {
|
|
|
15510
15797
|
},
|
|
15511
15798
|
[navigate, onError]
|
|
15512
15799
|
);
|
|
15513
|
-
const urlAuthConfig =
|
|
15800
|
+
const urlAuthConfig = useMemo16(
|
|
15514
15801
|
() => ({
|
|
15515
15802
|
setTokens,
|
|
15516
15803
|
setSessionInfo,
|
|
@@ -15536,10 +15823,10 @@ function useAppContent(config) {
|
|
|
15536
15823
|
);
|
|
15537
15824
|
useUrlAuthentication(urlAuthConfig);
|
|
15538
15825
|
const { sessionInfo } = useAuth();
|
|
15539
|
-
const institutionIdToUse =
|
|
15826
|
+
const institutionIdToUse = useMemo16(() => {
|
|
15540
15827
|
return sessionInfo?.institutionId || getInstitutionId;
|
|
15541
15828
|
}, [sessionInfo?.institutionId, getInstitutionId]);
|
|
15542
|
-
|
|
15829
|
+
useEffect33(() => {
|
|
15543
15830
|
if (institutionIdToUse && !initialized) {
|
|
15544
15831
|
initialize(institutionIdToUse);
|
|
15545
15832
|
}
|
|
@@ -15669,6 +15956,7 @@ export {
|
|
|
15669
15956
|
TableHead,
|
|
15670
15957
|
TableHeader,
|
|
15671
15958
|
TablePagination_default as TablePagination,
|
|
15959
|
+
TableProvider_default as TableProvider,
|
|
15672
15960
|
TableRow,
|
|
15673
15961
|
Text_default as Text,
|
|
15674
15962
|
TextArea_default as TextArea,
|