From 8809ea77090bb47b68e513c4892b9b27e5796242 Mon Sep 17 00:00:00 2001 From: nflnkr <105123049+nflnkr@users.noreply.github.com> Date: Tue, 23 Jan 2024 16:04:53 +0300 Subject: [PATCH 01/81] set build output dir to "build" instead of "dist" --- .dockerignore | 2 +- .gitignore | 2 +- vite.config.ts | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.dockerignore b/.dockerignore index b0542ba..83df8c7 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,4 @@ -/dist +/build /widget Makefile README.md diff --git a/.gitignore b/.gitignore index e698ff5..9ec1c51 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,7 @@ pnpm-debug.log* lerna-debug.log* node_modules -dist +build dist-ssr widget *.local diff --git a/vite.config.ts b/vite.config.ts index a12f50d..61fdf4f 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -19,4 +19,7 @@ export default defineConfig({ define: { "process.env": process.env, }, + build: { + outDir: "build", + }, }); From ffb3d0ea565dd733158387ee47ab0b91c92527cd Mon Sep 17 00:00:00 2001 From: nflnkr <105123049+nflnkr@users.noreply.github.com> Date: Mon, 29 Jan 2024 14:10:22 +0300 Subject: [PATCH 02/81] remove unused files --- src/model/quizSettings.ts | 202 ---------------------------- src/ui_kit/Accordion.tsx | 111 --------------- src/ui_kit/AddOrEditImageButton.tsx | 64 --------- src/ui_kit/ContactForm.tsx | 142 ------------------- src/ui_kit/CreationCard.tsx | 50 ------- src/ui_kit/CustomNumberField.tsx | 66 --------- src/ui_kit/CustomRadio.tsx | 15 --- src/ui_kit/CustomSwitch.tsx | 37 ----- src/ui_kit/CustomWrapper.tsx | 196 --------------------------- src/ui_kit/EmojiPicker.tsx | 26 ---- src/ui_kit/InputTextfield.tsx | 94 ------------- src/ui_kit/LabeledDatePicker.tsx | 69 ---------- src/ui_kit/LogoutButton.tsx | 38 ------ src/ui_kit/MenuItem.tsx | 48 ------- src/ui_kit/MiniButtonSetting.tsx | 18 --- src/ui_kit/PenaLogo.tsx | 34 ----- src/ui_kit/PenaLogo2.tsx | 35 ----- src/ui_kit/QuestionsMiniButton.tsx | 50 ------- src/ui_kit/SectionWrapper.tsx | 36 ----- src/ui_kit/SelectableButton.tsx | 31 ----- src/ui_kit/Stepper.tsx | 61 --------- src/ui_kit/UploadBox.tsx | 52 ------- src/ui_kit/passwordInput.tsx | 128 ------------------ src/utils/backendMessageHandler.ts | 35 ----- src/utils/hooks/useGetSettings.ts | 55 -------- src/utils/isAxiosCanceledError.ts | 6 - src/utils/requestQueue.ts | 35 ----- src/utils/useDisclosure.ts | 13 -- 28 files changed, 1747 deletions(-) delete mode 100644 src/model/quizSettings.ts delete mode 100644 src/ui_kit/Accordion.tsx delete mode 100644 src/ui_kit/AddOrEditImageButton.tsx delete mode 100644 src/ui_kit/ContactForm.tsx delete mode 100755 src/ui_kit/CreationCard.tsx delete mode 100644 src/ui_kit/CustomNumberField.tsx delete mode 100644 src/ui_kit/CustomRadio.tsx delete mode 100644 src/ui_kit/CustomSwitch.tsx delete mode 100644 src/ui_kit/CustomWrapper.tsx delete mode 100644 src/ui_kit/EmojiPicker.tsx delete mode 100644 src/ui_kit/InputTextfield.tsx delete mode 100644 src/ui_kit/LabeledDatePicker.tsx delete mode 100644 src/ui_kit/LogoutButton.tsx delete mode 100755 src/ui_kit/MenuItem.tsx delete mode 100755 src/ui_kit/MiniButtonSetting.tsx delete mode 100755 src/ui_kit/PenaLogo.tsx delete mode 100644 src/ui_kit/PenaLogo2.tsx delete mode 100755 src/ui_kit/QuestionsMiniButton.tsx delete mode 100755 src/ui_kit/SectionWrapper.tsx delete mode 100755 src/ui_kit/SelectableButton.tsx delete mode 100755 src/ui_kit/Stepper.tsx delete mode 100755 src/ui_kit/UploadBox.tsx delete mode 100644 src/ui_kit/passwordInput.tsx delete mode 100644 src/utils/backendMessageHandler.ts delete mode 100644 src/utils/hooks/useGetSettings.ts delete mode 100644 src/utils/isAxiosCanceledError.ts delete mode 100644 src/utils/requestQueue.ts delete mode 100644 src/utils/useDisclosure.ts diff --git a/src/model/quizSettings.ts b/src/model/quizSettings.ts deleted file mode 100644 index f50c516..0000000 --- a/src/model/quizSettings.ts +++ /dev/null @@ -1,202 +0,0 @@ -import ChartPieIcon from "@icons/ChartPieIcon"; -import ContactBookIcon from "@icons/ContactBookIcon"; -import FlowArrowIcon from "@icons/FlowArrowIcon"; -import LayoutIcon from "@icons/LayoutIcon"; -import MegaphoneIcon from "@icons/MegaphoneIcon"; -import QuestionIcon from "@icons/QuestionIcon"; -import QuestionsMapIcon from "@icons/QuestionsMapIcon"; - -export const quizSetupSteps = [ - { - stepperText: "Настройка стартовой страницы", - sidebarText: "Стартовая страница", - sidebarIcon: LayoutIcon, - }, - { - stepperText: "Задайте вопросы", - sidebarText: "Вопросы", - sidebarIcon: QuestionIcon, - }, - { - stepperText: "Настройте авторезультаты", - sidebarText: "Результаты", - sidebarIcon: ChartPieIcon, - }, - // { stepperText: "Оценка графа карты вопросов", sidebarText: "Карта вопросов", sidebarIcon: QuestionsMapIcon }, - { - stepperText: "Настройте форму контактов", - sidebarText: "Форма контактов", - sidebarIcon: ContactBookIcon, - }, - { - stepperText: "Установите квиз", - sidebarText: "Установка квиза", - sidebarIcon: FlowArrowIcon, - }, - // { stepperText: "Запустите рекламу", sidebarText: "Запуск рекламы", sidebarIcon: MegaphoneIcon }, -] as const; - -export const maxQuizSetupSteps = quizSetupSteps.length; - -export type QuizStartpageType = "standard" | "expanded" | "centered" | null; - -export type QuizStartpageAlignType = "left" | "right" | "center"; - -export type QuizType = "quiz" | "form" | null; - -export type QuizResultsType = true | null; - -export interface QuizConfig { - type: QuizType; - noStartPage: boolean; - startpageType: QuizStartpageType; - results: QuizResultsType; - haveRoot: string | null; - theme: - | "StandardTheme" - | "StandardDarkTheme" - | "PinkTheme" - | "PinkDarkTheme" - | "BlackWhiteTheme" - | "OliveTheme" - | "YellowTheme" - | "GoldDarkTheme" - | "PurpleTheme" - | "BlueTheme" - | "BlueDarkTheme"; - resultInfo: { - when: "email" | ""; - share: true | false; - replay: true | false; - theme: string; - reply: string; - replname: string; - showResultForm: "before" | "after"; - }; - startpage: { - description: string; - button: string; - position: QuizStartpageAlignType; - favIcon: string | null; - logo: string | null; - originalLogo: string | null; - background: { - type: null | "image" | "video"; - desktop: string | null; - originalDesktop: string | null; - mobile: string | null; - originalMobile: string | null; - video: string | null; - cycle: boolean; - }; - }; - formContact: { - title: string; - desc: string; - name: FCField; - email: FCField; - phone: FCField; - text: FCField; - address: FCField; - button: string; - }; - info: { - phonenumber: string; - clickable: boolean; - orgname: string; - site: string; - law?: string; - }; - meta: string; -} - -type FCField = { - text: string; - innerText: string; - key: string; - required: boolean; - used: boolean; -}; - -export const defaultQuizConfig: QuizConfig = { - type: null, - noStartPage: false, - startpageType: null, - results: null, - haveRoot: null, - theme: "StandardTheme", - resultInfo: { - when: "", - share: false, - replay: false, - theme: "", - reply: "", - replname: "", - showResultForm: "after", - }, - startpage: { - description: "", - button: "", - position: "left", - favIcon: null, - logo: null, - originalLogo: null, - background: { - type: null, - desktop: null, - originalDesktop: null, - mobile: null, - originalMobile: null, - video: null, - cycle: false, - }, - }, - info: { - phonenumber: "", - clickable: false, - orgname: "", - site: "", - law: "", - }, - formContact: { - title: "", - desc: "", - name: { - text: "", - innerText: "", - key: "", - required: false, - used: true, - }, - email: { - text: "", - innerText: "", - key: "", - required: false, - used: true, - }, - phone: { - text: "", - innerText: "", - key: "", - required: false, - used: true, - }, - text: { - text: "", - innerText: "", - key: "", - required: false, - used: false, - }, - address: { - text: "", - innerText: "", - key: "", - required: false, - used: false, - }, - button: "", - }, - meta: "", -}; diff --git a/src/ui_kit/Accordion.tsx b/src/ui_kit/Accordion.tsx deleted file mode 100644 index ca4307d..0000000 --- a/src/ui_kit/Accordion.tsx +++ /dev/null @@ -1,111 +0,0 @@ -import { Box, SxProps, Theme, Typography, useMediaQuery, useTheme } from "@mui/material"; -import React from "react"; - -interface Props { - children?: React.ReactNode; - isExpanded?: boolean; - onClick?: () => void; - sx?: SxProps; - header: string; -} - -export default function AccordMy({ children, isExpanded = false, onClick, sx, header }: Props) { - const theme = useTheme(); - const upMd = useMediaQuery(theme.breakpoints.up("md")); - const upSm = useMediaQuery(theme.breakpoints.up("sm")); - return ( - - - - - {header} - - - - - - - - - - - {isExpanded && ( - - {children} - - )} - - - ); -} diff --git a/src/ui_kit/AddOrEditImageButton.tsx b/src/ui_kit/AddOrEditImageButton.tsx deleted file mode 100644 index a7ba986..0000000 --- a/src/ui_kit/AddOrEditImageButton.tsx +++ /dev/null @@ -1,64 +0,0 @@ -import Plus from "@icons/questionsPage/plus"; -import { Box, Button, SxProps, Theme } from "@mui/material"; -import Image from "../assets/icons/questionsPage/image"; - - -interface Props { - sx?: SxProps; - imageSrc?: string; - onImageClick?: () => void; - onPlusClick?: () => void; -} - -export default function AddOrEditImageButton({ onImageClick, onPlusClick, sx, imageSrc }: Props) { - - return ( - - - - - ); -} diff --git a/src/ui_kit/ContactForm.tsx b/src/ui_kit/ContactForm.tsx deleted file mode 100644 index 99a5c49..0000000 --- a/src/ui_kit/ContactForm.tsx +++ /dev/null @@ -1,142 +0,0 @@ -import { Box, Button, IconButton, TextField, Typography, useMediaQuery, useTheme, Modal } from "@mui/material"; -// import { -// sendContactForm, -// setContactFormMailField, -// setIsContactFormOpen, -// useContactFormStore, -// } from "../stores/contactForm"; -import { enqueueSnackbar } from "notistack"; -import X from "../assets/icons/x"; -import PenaLogo from "../ui_kit/PenaLogo"; - -export default () => { - const theme = useTheme(); - const isMobile = useMediaQuery(theme.breakpoints.down("md")); - - // const isModalOpen = useContactFormStore((state) => state.isModalOpen); - // const isSubmitDisabled = useContactFormStore((state) => state.isSubmitDisabled); - // const mail = useContactFormStore((state) => state.mail); - // const upMd = useMediaQuery(theme.breakpoints.up("md")); - - // async function handleSendForm() { - // const message = await sendContactForm(); - - // if (message) enqueueSnackbar(message); - // } -return <> -// return ( -// setIsContactFormOpen(false)} -// aria-labelledby="modal-modal-title" -// aria-describedby="modal-modal-description" -// > -// -// setIsContactFormOpen(false)} -// sx={{ -// position: "absolute", -// right: "7px", -// top: "7px", -// }} -// > -// -// -// -// -// -// -// Предрегистрация -// -// E-mail -// ) => setContactFormMailField(e.target.value)} -// placeholder="username@penahaub.com" -// name="name" -// fullWidth -// sx={{ -// width: "100%", -// // mt: "25px", -// mb: "10px", -// "& .MuiInputBase-root": { -// backgroundColor: "#F2F3F7", -// height: "45px", -// borderRadius: "10px", -// }, -// }} -// inputProps={{ -// sx: { -// borderRadius: "10px", -// fontSize: "18px", -// lineHeight: "21px", -// py: 0, -// }, -// }} -// /> -// -// -// После запуска продукта вам придет сообщение -// на указанную электронную почту -// -// -// -// ); - }; diff --git a/src/ui_kit/CreationCard.tsx b/src/ui_kit/CreationCard.tsx deleted file mode 100755 index 75f4fe6..0000000 --- a/src/ui_kit/CreationCard.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import { Box, Typography } from "@mui/material"; - -interface Props { - header: string; - text: string; - image: any; - border?: string; -} - -export default function CreationCard({ header, text, image, border }: Props) { - return ( - - - {header} - - - {text} - - quiz creation - - ); -} diff --git a/src/ui_kit/CustomNumberField.tsx b/src/ui_kit/CustomNumberField.tsx deleted file mode 100644 index 8797d74..0000000 --- a/src/ui_kit/CustomNumberField.tsx +++ /dev/null @@ -1,66 +0,0 @@ -import CustomTextField from "./CustomTextField"; - -import type { ChangeEvent, KeyboardEvent, FocusEvent } from "react"; -import type { SxProps, Theme } from "@mui/material"; - -interface CustomNumberFieldProps { - placeholder: string; - onChange?: (event: ChangeEvent) => void; - onKeyDown?: (event: KeyboardEvent) => void; - onBlur?: (event: FocusEvent) => void; - error?: string; - value: string; - sx?: SxProps; - min?: number; - max?: number; -} - -export default function CustomNumberField({ - placeholder, - value, - sx, - error, - onChange, - onKeyDown, - onBlur, - min = -999999999, - max = 999999999, -}: CustomNumberFieldProps) { - const onInputChange = (event: ChangeEvent) => { - const inputValue = event.target.value; - - if ( - inputValue === "" || - inputValue.match(/^\d*$/) || - (inputValue[0] === "-" && inputValue.slice(1).match(/^\d*$/)) - ) { - onChange?.({ ...event, target: { ...event.target, value: inputValue } }); - } - }; - - const onInputBlur = (event: FocusEvent) => { - const inputValue = event.target.value; - - if (Number(inputValue) < min) { - onChange?.({ ...event, target: { ...event.target, value: String(min) } }); - } - - if (Number(inputValue) > max) { - onChange?.({ ...event, target: { ...event.target, value: String(max) } }); - } - - onBlur?.(event); - }; - - return ( - - ); -} diff --git a/src/ui_kit/CustomRadio.tsx b/src/ui_kit/CustomRadio.tsx deleted file mode 100644 index 8b5a3f0..0000000 --- a/src/ui_kit/CustomRadio.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import {IconButton} from "@mui/material"; -import {useState} from "react"; - - -export default function CustomRadio () { - const [active, setActive] = useState(false); - return ( - setActive(!active)}> - - - - - - ) -} \ No newline at end of file diff --git a/src/ui_kit/CustomSwitch.tsx b/src/ui_kit/CustomSwitch.tsx deleted file mode 100644 index 92ef383..0000000 --- a/src/ui_kit/CustomSwitch.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import {Switch, SwitchProps} from "@mui/material"; -import {styled} from "@mui/material/styles"; - -export default styled((props: SwitchProps) => ( - )) -(() => ({ - width: 52, - height: 31, - padding: 0, - '& .MuiSwitch-switchBase': { - padding: 0, - margin: 2, - transitionDuration: '300ms', - '&.Mui-checked': { - transform: 'translateX(21px)', - color: '#fff', - '& + .MuiSwitch-track': { - backgroundColor: '#7E2AEA', - opacity: 1, - border: 0, - }, - }, - '&.Mui-disabled .MuiSwitch-thumb': { - color: '#9A9AAF', - boxShadow: 'none' - }, - }, - '& .MuiSwitch-thumb': { - boxSizing: 'border-box', - width: 27, - height: 27, - }, - '& .MuiSwitch-track': { - borderRadius: 40 / 2, - backgroundColor: '#9A9AAF' - }, - })); \ No newline at end of file diff --git a/src/ui_kit/CustomWrapper.tsx b/src/ui_kit/CustomWrapper.tsx deleted file mode 100644 index b8624d2..0000000 --- a/src/ui_kit/CustomWrapper.tsx +++ /dev/null @@ -1,196 +0,0 @@ -import { useState } from "react"; -import { Box, IconButton, SxProps, Theme, Typography, useMediaQuery, useTheme } from "@mui/material"; - -import { CrossedEyeIcon } from "@icons/CrossedEyeIcon"; -import CopyIcon from "@icons/CopyIcon"; -import TrashIcon from "@icons/TrashIcon"; -import CountIcon from "@icons/CountIcon"; -import MenuIcon from "@icons/MenuIcon"; - -interface Props { - text: string; - sx?: SxProps; - result?: boolean; -} - -export default function CustomWrapper({ text, sx, result }: Props) { - const theme = useTheme(); - const upMd = useMediaQuery(theme.breakpoints.up("md")); - const upSm = useMediaQuery(theme.breakpoints.up("sm")); - const [isExpanded, setIsExpanded] = useState(false); - - return ( - - - setIsExpanded((prev) => !prev)} - sx={{ - height: "88px", - px: "20px", - border: "1px solid white", - display: "flex", - alignItems: "center", - justifyContent: "space-between", - cursor: "pointer", - userSelect: "none", - "&:hover": { - borderColor: "#7E2AEA", - borderRadius: `${isExpanded ? "" : "12px"}`, - borderTopLeftRadius: "12px", - borderTopRightRadius: "12px", - }, - }} - > - - {text} - - - - {result ? ( - <> - - - - - - - - - - - - - - - - - - - - - - - - - ) : ( - - - - - )} - - - {isExpanded && ( - - - desc - - - - 10 руб. - - - - )} - - - ); -} diff --git a/src/ui_kit/EmojiPicker.tsx b/src/ui_kit/EmojiPicker.tsx deleted file mode 100644 index 50714d4..0000000 --- a/src/ui_kit/EmojiPicker.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import EmojiPickerOriginal from "@emoji-mart/react"; -import { Box } from "@mui/material"; - -type Emoji = { - emoticons: string[]; - id: string; - keywords: string[]; - name: string; - native: string; - shortcodes: string; - unified: string; -}; - -type EmojiPickerProps = { - onEmojiSelect: (emoji: Emoji) => void; -}; - -export const EmojiPicker = ({ onEmojiSelect }: EmojiPickerProps) => ( - - - -); diff --git a/src/ui_kit/InputTextfield.tsx b/src/ui_kit/InputTextfield.tsx deleted file mode 100644 index 5a9e285..0000000 --- a/src/ui_kit/InputTextfield.tsx +++ /dev/null @@ -1,94 +0,0 @@ -import { - FormControl, - InputLabel, - SxProps, - TextField, - TextFieldProps, - Theme, - useMediaQuery, - useTheme, -} from "@mui/material"; - -interface Props { - id: string; - label?: string; - bold?: boolean; - gap?: string; - color?: string; - FormInputSx?: SxProps; - TextfieldProps: TextFieldProps; - onChange: (e: React.ChangeEvent) => void; -} - -export default function InputTextfield({ - id, - label, - bold = false, - gap = "10px", - onChange, - TextfieldProps, - color, - FormInputSx, -}: Props) { - const theme = useTheme(); - const upMd = useMediaQuery(theme.breakpoints.up("md")); - - const labelFont = upMd - ? bold - ? theme.typography.p1 - : { ...theme.typography.body1, fontWeight: 500 } - : theme.typography.body2; - - const placeholderFont = upMd ? undefined : { fontWeight: 400, fontSize: "16px", lineHeight: "19px" }; - - return ( - - {label && ( - - {label} - - )} - - - ); -} diff --git a/src/ui_kit/LabeledDatePicker.tsx b/src/ui_kit/LabeledDatePicker.tsx deleted file mode 100644 index e5e365f..0000000 --- a/src/ui_kit/LabeledDatePicker.tsx +++ /dev/null @@ -1,69 +0,0 @@ -import CalendarIcon from "@icons/CalendarIcon"; -import { Typography, Box, SxProps, Theme, useMediaQuery, useTheme } from "@mui/material"; -import { DatePicker } from "@mui/x-date-pickers"; -import { Dayjs } from "dayjs"; - - -interface Props { - label?: string; - sx?: SxProps; - value?: Dayjs | null; - onChange?: (value: Dayjs | null) => void; -} - -export default function LabeledDatePicker({ label, value, onChange, sx }: Props) { - const theme = useTheme(); - const upLg = useMediaQuery(theme.breakpoints.up("md")); - - return ( - - {label && ( - - {label} - - )} - , - }} - slotProps={{ - openPickerButton: { - sx: { - p: 0, - }, - "data-cy": "open-datepicker", - }, - }} - sx={{ - "& .MuiInputBase-root": { - backgroundColor: "#F2F3F7", - borderRadius: "10px", - pr: "22px", - "& input": { - py: "11px", - pl: upLg ? "20px" : "13px", - lineHeight: "19px", - }, - "& fieldset": { - borderColor: "#9A9AAF", - }, - }, - }} - /> - - ); -} diff --git a/src/ui_kit/LogoutButton.tsx b/src/ui_kit/LogoutButton.tsx deleted file mode 100644 index b9e4ae1..0000000 --- a/src/ui_kit/LogoutButton.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import { IconButton, IconButtonProps } from "@mui/material"; -import { deepmerge } from "@mui/utils"; - - -export function LogoutButton(props: IconButtonProps) { - - return ( - - - - - - ); -} diff --git a/src/ui_kit/MenuItem.tsx b/src/ui_kit/MenuItem.tsx deleted file mode 100755 index 3aec7c9..0000000 --- a/src/ui_kit/MenuItem.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import { ListItem, ListItemButton, ListItemIcon, ListItemText, useTheme } from "@mui/material"; - - -interface Props { - icon: any; - text: string; - isActive?: boolean; - isCollapsed: boolean; - onClick: () => void; -} - -export default function MenuItem({ icon, text, isActive = false, isCollapsed, onClick }: Props) { - const theme = useTheme(); - - return ( - - - - {icon} - - {!isCollapsed && - - } - - - ); -} \ No newline at end of file diff --git a/src/ui_kit/MiniButtonSetting.tsx b/src/ui_kit/MiniButtonSetting.tsx deleted file mode 100755 index 8cf46f6..0000000 --- a/src/ui_kit/MiniButtonSetting.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { Button, styled } from "@mui/material"; -import * as React from 'react'; -import { ButtonProps } from "@mui/material/Button"; - - -interface Props { - py?: string; -} -export default styled(Button)(props => ({ - fontWeight: 400, - fontSize: '14px', - lineHeight: '17px', - paddingTop: props.py || "6px", - paddingBottom: props.py || "6px", - borderRadius: "6px", - gap: '6px', - boxShadow: "none", -})); diff --git a/src/ui_kit/PenaLogo.tsx b/src/ui_kit/PenaLogo.tsx deleted file mode 100755 index 20d1e6a..0000000 --- a/src/ui_kit/PenaLogo.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { useTheme } from "@mui/material"; - - -interface Props { - width: number; -} - -export default function PenaLogo({ width }: Props) { - const theme = useTheme(); - - return ( - - - - - - - - - - - - - - - - - - - - - - ); -} \ No newline at end of file diff --git a/src/ui_kit/PenaLogo2.tsx b/src/ui_kit/PenaLogo2.tsx deleted file mode 100644 index 7d840f7..0000000 --- a/src/ui_kit/PenaLogo2.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import { useTheme } from "@mui/material"; - - -interface Props { - width: number; - color: string; -} - -export default function PenaLogo2({ width, color }: Props) { - const theme = useTheme(); - - return ( - - - - - - - - - - - - - - - - - - - - - - ); -} diff --git a/src/ui_kit/QuestionsMiniButton.tsx b/src/ui_kit/QuestionsMiniButton.tsx deleted file mode 100755 index 97c16e5..0000000 --- a/src/ui_kit/QuestionsMiniButton.tsx +++ /dev/null @@ -1,50 +0,0 @@ -import { Button, Typography, useTheme } from "@mui/material"; -import Answer from "../assets/icons/questionsPage/answer"; -import React from "react"; -import { ReactNode } from "react"; - -interface QuestionsMiniButtonProps { - icon: ReactNode; - text: string; - onClick: () => void; - dataCy?: string; -} - -export default function QuestionsMiniButton({ icon, text, onClick, dataCy }: QuestionsMiniButtonProps) { - const theme = useTheme(); - - return ( - <> - - - ); -} diff --git a/src/ui_kit/SectionWrapper.tsx b/src/ui_kit/SectionWrapper.tsx deleted file mode 100755 index 3fa3d3e..0000000 --- a/src/ui_kit/SectionWrapper.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { Breakpoint, Container, SxProps, Theme, useMediaQuery, useTheme } from "@mui/material"; -import React, { ElementType } from "react"; - - -interface Props { - component?: ElementType; - outerContainerSx?: SxProps; - sx?: SxProps; - maxWidth?: false | Breakpoint; - children?: React.ReactNode; -} - -export default function SectionWrapper({ component, outerContainerSx: sx, sx: innerSx, children, maxWidth }: Props) { - const theme = useTheme(); - const matchMd = useMediaQuery(theme.breakpoints.up("md")); - - return ( - - - {children} - - - ); -} \ No newline at end of file diff --git a/src/ui_kit/SelectableButton.tsx b/src/ui_kit/SelectableButton.tsx deleted file mode 100755 index e98bc7f..0000000 --- a/src/ui_kit/SelectableButton.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import {Button, SxProps, Theme, useTheme} from "@mui/material"; - - -interface Props { - children?: React.ReactNode; - isSelected?: boolean; - onClick: () => void; - sx?: SxProps; -} - -export default function SelectableButton({ children, isSelected = false, onClick, sx }: Props) { - const theme = useTheme(); - - return ( - - ); -} \ No newline at end of file diff --git a/src/ui_kit/Stepper.tsx b/src/ui_kit/Stepper.tsx deleted file mode 100755 index 152d741..0000000 --- a/src/ui_kit/Stepper.tsx +++ /dev/null @@ -1,61 +0,0 @@ -import { Box, Typography, useMediaQuery, useTheme } from "@mui/material"; -import MobileStepper from "@mui/material/MobileStepper"; -import { maxQuizSetupSteps, quizSetupSteps } from "@model/quizSettings"; - -interface Props { - activeStep: number; -} - -export default function ProgressMobileStepper({ - activeStep, -}: Props) { - const theme = useTheme(); - const isTablet = useMediaQuery(theme.breakpoints.down(1000)); - - return ( - - } - backButton={<>} - /> - - - {" "} - Шаг {activeStep + 1 } из {maxQuizSetupSteps} - - {quizSetupSteps[activeStep].stepperText} - - - ); -} diff --git a/src/ui_kit/UploadBox.tsx b/src/ui_kit/UploadBox.tsx deleted file mode 100755 index dfc6411..0000000 --- a/src/ui_kit/UploadBox.tsx +++ /dev/null @@ -1,52 +0,0 @@ -import { Box, Typography, useTheme } from "@mui/material"; -import { SxProps, Theme } from "@mui/material/styles"; - -import type { DragEvent } from "react"; - -interface Props { - sx?: SxProps; - icon: React.ReactNode; - handleDrop?: (event: DragEvent) => void; - text?: string; - ref?: any; -} - -export default function UploadBox({ sx, icon, text, ref, handleDrop }: Props) { - const theme = useTheme(); - - return ( - ) => event.preventDefault()} - onDrop={handleDrop} - ref={ref} - sx={{ - width: "100%", - height: "120px", - position: "relative", - display: "flex", - justifyContent: "center", - alignItems: "center", - backgroundColor: theme.palette.background.default, - border: `1px solid ${theme.palette.grey2.main}`, - borderRadius: "8px", - ...sx, - }} - > - {icon} - - - {text} - - - ); -} diff --git a/src/ui_kit/passwordInput.tsx b/src/ui_kit/passwordInput.tsx deleted file mode 100644 index bb31f0e..0000000 --- a/src/ui_kit/passwordInput.tsx +++ /dev/null @@ -1,128 +0,0 @@ -import { - FormControl, - IconButton, - InputLabel, - SxProps, - TextField, - TextFieldProps, - Theme, - useMediaQuery, - useTheme, -} from "@mui/material"; -import * as React from "react"; -import InputAdornment from "@mui/material/InputAdornment"; -import Visibility from "@mui/icons-material/Visibility"; -import VisibilityOff from "@mui/icons-material/VisibilityOff"; - -interface Props { - id: string; - label?: string; - bold?: boolean; - gap?: string; - color?: string; - FormInputSx?: SxProps; - TextfieldProps: TextFieldProps; - onChange: (e: React.ChangeEvent) => void; -} - -export default function PasswordInput({ - id, - label, - bold = false, - gap = "10px", - onChange, - TextfieldProps, - color, - FormInputSx, -}: Props) { - const theme = useTheme(); - const upMd = useMediaQuery(theme.breakpoints.up("md")); - - const labelFont = upMd - ? bold - ? theme.typography.p1 - : { ...theme.typography.body1, fontWeight: 500 } - : theme.typography.body2; - - const placeholderFont = upMd ? undefined : { fontWeight: 400, fontSize: "16px", lineHeight: "19px" }; - - const [showPassword, setShowPassword] = React.useState(false); - - const handleClickShowPassword = () => setShowPassword((show) => !show); - - const handleMouseDownPassword = (event: React.MouseEvent) => { - event.preventDefault(); - }; - - return ( - - - {label} - - - - {showPassword ? : } - - - ), - sx: { - padding: "0px", - border: "1px solid #9A9AAF", - backgroundColor: color, - borderRadius: "8px", - height: "48px", - color: "black", - ...placeholderFont, - "& .MuiInputBase-input": { - boxSizing: "border-box", - height: "100%", - padding: "14px", - }, - }, - }} - onChange={onChange} - type={showPassword ? "text" : "password"} - /> - - ); -} diff --git a/src/utils/backendMessageHandler.ts b/src/utils/backendMessageHandler.ts deleted file mode 100644 index 20c0f19..0000000 --- a/src/utils/backendMessageHandler.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { isAxiosError } from "axios"; - -const backendErrorMessage: Record = { - "user not found": "Пользователь не найден", - "invalid password": "Неправильный пароль", - "field is empty": 'Поле "Пароль" не заполнено', - "field is empty": 'Поле "Логин" не заполнено', - "field is empty": 'Поле "E-mail" не заполнено', - "field is empty": 'Поле "Номер телефона" не заполнено', - "user with this email or login is exist": "Пользователь уже существует", -}; - -const unknownErrorMessage = "Что-то пошло не так. Повторите попытку позже"; - -export function getMessageFromFetchError(error: any): string | null { - if (process.env.NODE_ENV !== "production") console.log(error); - - const message = backendErrorMessage[error.response?.data?.message]; - if (message) return message; - - if (error.message === "Failed to fetch") return "Ошибка сети"; - - if (isAxiosError(error)) { - switch (error.code) { - case "ERR_NETWORK": - return "Ошибка сети"; - case "ERR_CANCELED": - return null; - case "ERR_BAD_REQUEST": - return "Слишком много запросов"; - } - } - - return unknownErrorMessage; -} diff --git a/src/utils/hooks/useGetSettings.ts b/src/utils/hooks/useGetSettings.ts deleted file mode 100644 index cdba2c7..0000000 --- a/src/utils/hooks/useGetSettings.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { useEffect, useLayoutEffect, useRef, useState } from "react" -import { useQuestionsStore } from "@stores/quizData/store"; - -import { getData } from "@api/quizRelase" - -interface SettingsGetter { - quizId: string -} - -export function useGetSettings(quizId: string) { - - const [fetchState, setFetchState] = useState<"fetching" | "idle" | "all fetched">("idle") - - useEffect(() => { - async function get() { - const data = await getData(quizId) - //@ts-ignore - const settings = data.settings - const parseData = { - settings: { - fp: settings.fp, - rep: settings.rep, - name: settings.name, - cfg: JSON.parse(settings?.cfg), - lim: settings.lim, - due: settings.due, - delay: settings.delay, - pausable: settings.pausable - }, - //@ts-ignore - items: data.items.map((item) => { - const content = JSON.parse(item.c) - return { - description: item.desc, - id: item.id, - page: item.p, - required: item.req, - title: item.title, - type: item.typ, - content - } - }), - //@ts-ignore - cnt: data.cnt - } - useQuestionsStore.setState(parseData) - } - get() - // const controller = new AbortController() - - - }, []) - return - // return -} diff --git a/src/utils/isAxiosCanceledError.ts b/src/utils/isAxiosCanceledError.ts deleted file mode 100644 index a7a6f37..0000000 --- a/src/utils/isAxiosCanceledError.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { isAxiosError } from "axios"; - - -export function isAxiosCanceledError(error: unknown) { - return isAxiosError(error) && error.code === "ERR_CANCELED"; -} diff --git a/src/utils/requestQueue.ts b/src/utils/requestQueue.ts deleted file mode 100644 index 7f60316..0000000 --- a/src/utils/requestQueue.ts +++ /dev/null @@ -1,35 +0,0 @@ -export class RequestQueue { - private pendingPromise = false; - private items: Array<{ - action: () => Promise; - resolve: (value: T) => void; - reject: (reason?: any) => void; - }> = []; - - enqueue(action: () => Promise) { - return new Promise((resolve, reject) => { - this.items.push({ action, resolve, reject }); - this.dequeue(); - }); - } - - async dequeue() { - if (this.pendingPromise) return; - - const item = this.items.shift(); - if (!item) return; - - try { - this.pendingPromise = true; - const payload = await item.action(); - this.pendingPromise = false; - - item.resolve(payload); - } catch (e) { - this.pendingPromise = false; - item.reject(e); - } finally { - this.dequeue(); - } - } -} diff --git a/src/utils/useDisclosure.ts b/src/utils/useDisclosure.ts deleted file mode 100644 index 07ac2b9..0000000 --- a/src/utils/useDisclosure.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { useState, useCallback } from "react"; - - -export function useDisclosure(initialState = false) { - const [opened, setOpened] = useState(initialState); - - return [ - opened, - useCallback(() => setOpened(true), []), - useCallback(() => setOpened(false), []), - useCallback(() => setOpened(prev => !prev), []), - ] as const; -} From 138cc34133e17a04b58b1d807fbfbf958c5a3a8a Mon Sep 17 00:00:00 2001 From: nflnkr <105123049+nflnkr@users.noreply.github.com> Date: Mon, 29 Jan 2024 14:12:48 +0300 Subject: [PATCH 03/81] add content.id field to question interfaces --- src/model/questionTypes/date.ts | 1 + src/model/questionTypes/emoji.ts | 1 + src/model/questionTypes/file.ts | 1 + src/model/questionTypes/images.ts | 1 + src/model/questionTypes/number.ts | 1 + src/model/questionTypes/page.ts | 1 + src/model/questionTypes/rating.ts | 1 + src/model/questionTypes/result.ts | 1 + src/model/questionTypes/select.ts | 1 + src/model/questionTypes/shared.ts | 1 + src/model/questionTypes/text.ts | 2 +- src/model/questionTypes/variant.ts | 1 + src/model/questionTypes/varimg.ts | 1 + 13 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/model/questionTypes/date.ts b/src/model/questionTypes/date.ts index 2b905e8..651550e 100644 --- a/src/model/questionTypes/date.ts +++ b/src/model/questionTypes/date.ts @@ -7,6 +7,7 @@ import type { export interface QuizQuestionDate extends QuizQuestionBase { type: "date"; content: { + id: string; /** Чекбокс "Необязательный вопрос" */ required: boolean; /** Чекбокс "Внутреннее название вопроса" */ diff --git a/src/model/questionTypes/emoji.ts b/src/model/questionTypes/emoji.ts index 4a9f7ef..7fa34a1 100644 --- a/src/model/questionTypes/emoji.ts +++ b/src/model/questionTypes/emoji.ts @@ -8,6 +8,7 @@ import type { export interface QuizQuestionEmoji extends QuizQuestionBase { type: "emoji"; content: { + id: string; /** Чекбокс "Можно несколько" */ multi: boolean; /** Чекбокс "Вариант "свой ответ"" */ diff --git a/src/model/questionTypes/file.ts b/src/model/questionTypes/file.ts index d1a6981..51a748a 100644 --- a/src/model/questionTypes/file.ts +++ b/src/model/questionTypes/file.ts @@ -17,6 +17,7 @@ export type UploadFileType = keyof typeof UPLOAD_FILE_TYPES_MAP; export interface QuizQuestionFile extends QuizQuestionBase { type: "file"; content: { + id: string; /** Чекбокс "Необязательный вопрос" */ required: boolean; /** Чекбокс "Внутреннее название вопроса" */ diff --git a/src/model/questionTypes/images.ts b/src/model/questionTypes/images.ts index a65f6ba..02fc52b 100644 --- a/src/model/questionTypes/images.ts +++ b/src/model/questionTypes/images.ts @@ -8,6 +8,7 @@ import type { export interface QuizQuestionImages extends QuizQuestionBase { type: "images"; content: { + id: string; /** Чекбокс "Вариант "свой ответ"" */ own: boolean; /** Чекбокс "Можно несколько" */ diff --git a/src/model/questionTypes/number.ts b/src/model/questionTypes/number.ts index 68f1370..530db03 100644 --- a/src/model/questionTypes/number.ts +++ b/src/model/questionTypes/number.ts @@ -7,6 +7,7 @@ import type { export interface QuizQuestionNumber extends QuizQuestionBase { type: "number"; content: { + id: string; /** Чекбокс "Необязательный вопрос" */ required: boolean; /** Чекбокс "Внутреннее название вопроса" */ diff --git a/src/model/questionTypes/page.ts b/src/model/questionTypes/page.ts index 9f829c8..6b1d559 100644 --- a/src/model/questionTypes/page.ts +++ b/src/model/questionTypes/page.ts @@ -7,6 +7,7 @@ import type { export interface QuizQuestionPage extends QuizQuestionBase { type: "page"; content: { + id: string; /** Чекбокс "Внутреннее название вопроса" */ innerNameCheck: boolean; /** Поле "Внутреннее название вопроса" */ diff --git a/src/model/questionTypes/rating.ts b/src/model/questionTypes/rating.ts index 2f73ef1..2626077 100644 --- a/src/model/questionTypes/rating.ts +++ b/src/model/questionTypes/rating.ts @@ -7,6 +7,7 @@ import type { export interface QuizQuestionRating extends QuizQuestionBase { type: "rating"; content: { + id: string; /** Чекбокс "Необязательный вопрос" */ required: boolean; /** Чекбокс "Внутреннее название вопроса" */ diff --git a/src/model/questionTypes/result.ts b/src/model/questionTypes/result.ts index 844c1d1..44d0223 100644 --- a/src/model/questionTypes/result.ts +++ b/src/model/questionTypes/result.ts @@ -7,6 +7,7 @@ import type { export interface QuizQuestionResult extends QuizQuestionBase { type: "result"; content: { + id: string; back: string; originalBack: string; video: string; diff --git a/src/model/questionTypes/select.ts b/src/model/questionTypes/select.ts index f74cfdb..3145b80 100644 --- a/src/model/questionTypes/select.ts +++ b/src/model/questionTypes/select.ts @@ -8,6 +8,7 @@ import type { export interface QuizQuestionSelect extends QuizQuestionBase { type: "select"; content: { + id: string; /** Чекбокс "Можно несколько" */ multi: boolean; /** Чекбокс "Необязательный вопрос" */ diff --git a/src/model/questionTypes/shared.ts b/src/model/questionTypes/shared.ts index 85b563e..9545bf1 100644 --- a/src/model/questionTypes/shared.ts +++ b/src/model/questionTypes/shared.ts @@ -76,6 +76,7 @@ export interface QuizQuestionBase { required: boolean; deleteTimeoutId: number; content: { + id: string; hint: QuestionHint; rule: QuestionBranchingRule; back: string; diff --git a/src/model/questionTypes/text.ts b/src/model/questionTypes/text.ts index 351f732..610bad5 100644 --- a/src/model/questionTypes/text.ts +++ b/src/model/questionTypes/text.ts @@ -7,7 +7,7 @@ import type { export interface QuizQuestionText extends QuizQuestionBase { type: "text"; content: { - id: number; + id: string; placeholder: string; /** Чекбокс "Внутреннее название вопроса" */ innerNameCheck: boolean; diff --git a/src/model/questionTypes/variant.ts b/src/model/questionTypes/variant.ts index 32c0c4b..54f457d 100644 --- a/src/model/questionTypes/variant.ts +++ b/src/model/questionTypes/variant.ts @@ -8,6 +8,7 @@ import type { export interface QuizQuestionVariant extends QuizQuestionBase { type: "variant"; content: { + id: string; /** Чекбокс "Длинный текстовый ответ" */ largeCheck: boolean; /** Чекбокс "Можно несколько" */ diff --git a/src/model/questionTypes/varimg.ts b/src/model/questionTypes/varimg.ts index dd51c8d..6d274d3 100644 --- a/src/model/questionTypes/varimg.ts +++ b/src/model/questionTypes/varimg.ts @@ -8,6 +8,7 @@ import type { export interface QuizQuestionVarImg extends QuizQuestionBase { type: "varimg"; content: { + id: string; /** Чекбокс "Вариант "свой ответ"" */ own: boolean; /** Чекбокс "Внутреннее название вопроса" */ From 66eea161091f0ce94ed529ec214a1b9894f03f1a Mon Sep 17 00:00:00 2001 From: nflnkr <105123049+nflnkr@users.noreply.github.com> Date: Mon, 29 Jan 2024 14:13:07 +0300 Subject: [PATCH 04/81] fix jsx attribute names --- src/assets/icons/NameplateLogoFQ.tsx | 4 ++-- src/assets/icons/NameplateLogoFQDark.tsx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/assets/icons/NameplateLogoFQ.tsx b/src/assets/icons/NameplateLogoFQ.tsx index db350ab..1bbb299 100644 --- a/src/assets/icons/NameplateLogoFQ.tsx +++ b/src/assets/icons/NameplateLogoFQ.tsx @@ -4,8 +4,8 @@ export const NameplateLogoFQ: FC> = (props) => ( - - + + diff --git a/src/assets/icons/NameplateLogoFQDark.tsx b/src/assets/icons/NameplateLogoFQDark.tsx index 651c17b..9916f39 100644 --- a/src/assets/icons/NameplateLogoFQDark.tsx +++ b/src/assets/icons/NameplateLogoFQDark.tsx @@ -4,8 +4,8 @@ export const NameplateLogoFQDark: FC> = (props) => ( - - + + @@ -21,4 +21,4 @@ export const NameplateLogoFQDark: FC> = (props) => ( -); \ No newline at end of file +); From f56b9a967e06fdf7007acb5a83bb0d34a428871d Mon Sep 17 00:00:00 2001 From: nflnkr <105123049+nflnkr@users.noreply.github.com> Date: Mon, 29 Jan 2024 14:16:02 +0300 Subject: [PATCH 05/81] add App widget prop to determine if app is running as widget remove react-router-dom --- package.json | 1 - src/App.tsx | 38 ++++++++++++++++++++++++++------------ src/widget.tsx | 2 +- yarn.lock | 20 -------------------- 4 files changed, 27 insertions(+), 34 deletions(-) diff --git a/package.json b/package.json index e3acd6c..bef10bc 100755 --- a/package.json +++ b/package.json @@ -27,7 +27,6 @@ "notistack": "^3.0.1", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-router-dom": "^6.6.2", "swr": "^2.2.4", "typescript": "^5.2.2", "use-debounce": "^9.0.4", diff --git a/src/App.tsx b/src/App.tsx index 9a31b61..939a658 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,11 +1,10 @@ -import { CssBaseline, ThemeProvider } from "@mui/material"; +import { Box, CssBaseline, ThemeProvider } from "@mui/material"; import { LocalizationProvider } from "@mui/x-date-pickers"; import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs"; import { ruRU } from '@mui/x-date-pickers/locales'; import dayjs from "dayjs"; import "dayjs/locale/ru"; import { SnackbarProvider } from 'notistack'; -import { BrowserRouter } from "react-router-dom"; import { SWRConfig } from "swr"; import { ViewPage } from "./pages/ViewPublicationPage"; import lightTheme from "./utils/themes/light"; @@ -14,7 +13,11 @@ import lightTheme from "./utils/themes/light"; dayjs.locale("ru"); const localeText = ruRU.components.MuiLocalizationProvider.defaultProps.localeText; -export default function App() { +interface Props { + widget?: boolean; +} + +export default function App({ widget = false }: Props) { return ( - - - - - - + + + {widget ? + + + + : + + + + } + diff --git a/src/widget.tsx b/src/widget.tsx index df5bea6..7e9052d 100644 --- a/src/widget.tsx +++ b/src/widget.tsx @@ -13,7 +13,7 @@ const widget = { root = createRoot(element); - root.render(); + root.render(); }, unmount() { if (root) root.unmount(); diff --git a/yarn.lock b/yarn.lock index d663308..37778bc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -737,11 +737,6 @@ resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f" integrity sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A== -"@remix-run/router@1.14.2": - version "1.14.2" - resolved "https://registry.yarnpkg.com/@remix-run/router/-/router-1.14.2.tgz#4d58f59908d9197ba3179310077f25c88e49ed17" - integrity sha512-ACXpdMM9hmKZww21yEqWwiLws/UPLhNKvimN8RrYSqPSvB3ov7sLvAcfvaxePeLvccTQKGdkDIhLYApZVDFuKg== - "@rollup/rollup-android-arm-eabi@4.9.5": version "4.9.5" resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.5.tgz#b752b6c88a14ccfcbdf3f48c577ccc3a7f0e66b9" @@ -2724,21 +2719,6 @@ react-refresh@^0.14.0: resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.14.0.tgz#4e02825378a5f227079554d4284889354e5f553e" integrity sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ== -react-router-dom@^6.6.2: - version "6.21.3" - resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-6.21.3.tgz#ef3a7956a3699c7b82c21fcb3dbc63c313ed8c5d" - integrity sha512-kNzubk7n4YHSrErzjLK72j0B5i969GsuCGazRl3G6j1zqZBLjuSlYBdVdkDOgzGdPIffUOc9nmgiadTEVoq91g== - dependencies: - "@remix-run/router" "1.14.2" - react-router "6.21.3" - -react-router@6.21.3: - version "6.21.3" - resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.21.3.tgz#8086cea922c2bfebbb49c6594967418f1f167d70" - integrity sha512-a0H638ZXULv1OdkmiK6s6itNhoy33ywxmUFT/xtSoVyf9VnC7n7+VT4LjVzdIHSaF5TIh9ylUgxMXksHTgGrKg== - dependencies: - "@remix-run/router" "1.14.2" - react-transition-group@^4.4.5: version "4.4.5" resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-4.4.5.tgz#e53d4e3f3344da8521489fbef8f2581d42becdd1" From 9367a2178fb5a732416f4ede6ed2ef9a6b60d247 Mon Sep 17 00:00:00 2001 From: nflnkr <105123049+nflnkr@users.noreply.github.com> Date: Mon, 29 Jan 2024 14:16:21 +0300 Subject: [PATCH 06/81] mirror changes from main --- src/api/quizRelase.ts | 198 ++++++++++++++++++++++++++---------------- 1 file changed, 124 insertions(+), 74 deletions(-) diff --git a/src/api/quizRelase.ts b/src/api/quizRelase.ts index ebe8b12..237e604 100644 --- a/src/api/quizRelase.ts +++ b/src/api/quizRelase.ts @@ -1,98 +1,148 @@ -import { makeRequest } from "@frontend/kitui"; +import axios from "axios"; -export function getData(quizId: string) { - return makeRequest({ - url: `https://s.hbpn.link/answer/settings`, - body: { - quiz_id: quizId, - limit: 100, - page: 0, - need_config: true, +import type { AxiosError } from "axios"; +import type { GetDataResponse } from "../model/settingsData"; - }, +let SESSIONS = ""; + +export const publicationMakeRequest = ({ url, body }: any) => { + console.log(body); + return axios(url, { + //@ts-ignore + data: body, + headers: { + "X-Sessionkey": SESSIONS, + "Content-Type": "multipart/form-data", + }, + method: "POST", + }); +}; + +export async function getData(quizId: string): Promise<{ + data: GetDataResponse | null; + isRecentlyCompleted: boolean; + error?: string; +}> { + const QID = + process.env.NODE_ENV === "production" + ? window.location.pathname.replace(/\//g, "") + : "ef836ff8-35b1-4031-9acf-af5766bac2b2"; + + try { + const { data, headers } = await axios( + `https://s.hbpn.link/answer/settings`, + { method: "POST", - }); + // headers, + data: JSON.stringify({ + quiz_id: quizId, + limit: 100, + page: 0, + need_config: true, + }), + } + ); + const sessions = JSON.parse(localStorage.getItem("sessions") || "{}"); + + if (typeof sessions[QID] === "number") { + // unix время. Если меньше суток прошло - выводить ошибку, иначе пустить дальше + if (Date.now() - sessions[QID] < 86400000) { + return { data, isRecentlyCompleted: true }; + } + } + + SESSIONS = headers["x-sessionkey"]; + + return { data, isRecentlyCompleted: false }; + } catch (nativeError) { + const error = nativeError as AxiosError; + + return { data: null, isRecentlyCompleted: false, error: error.message }; + } } export function sendAnswer({ questionId, body, qid }: any) { - const formData = new FormData(); -console.log(qid) - const answers = [{ - question_id: questionId, - content: body, //тут массив с ответом - }] - formData.append("answers", JSON.stringify(answers)); - formData.append("qid", qid); + const formData = new FormData(); + console.log(qid); + const answers = [ + { + question_id: questionId, + content: body, //тут массив с ответом + }, + ]; + formData.append("answers", JSON.stringify(answers)); + formData.append("qid", qid); - return makeRequest({ - url: `https://s.hbpn.link/answer/answer`, - body: formData, - method: "POST", - }); + return publicationMakeRequest({ + url: `https://s.hbpn.link/answer/answer`, + body: formData, + method: "POST", + }); } //body ={file, filename} export function sendFile({ questionId, body, qid }: any) { - const formData = new FormData(); + console.log(body); + const formData = new FormData(); - const fd: any = { - question_id: questionId, - content: body.name, - } + const answers: any = [ + { + question_id: questionId, + content: "file:" + body.name, + }, + ]; - fd[body.name] = body.file //target.files[0] + formData.append("answers", JSON.stringify(answers)); + formData.append(body.name, body.file); + formData.append("qid", qid); - const answers = [fd] - formData.append("answers", JSON.stringify(answers)); - formData.append("qid", qid); - - return makeRequest({ - url: `https://s.hbpn.link/answer/answer`, - body: formData, - method: "POST", - }); + return publicationMakeRequest({ + url: `https://s.hbpn.link/answer/answer`, + body: formData, + method: "POST", + }); } - const fields = [ - "name", - "email", - "phone", - "adress", - "telegram", - "wechat", - "viber", - "vk", - "skype", - "whatsup", - "messenger", - "text" -] + "name", + "email", + "phone", + "adress", + "telegram", + "wechat", + "viber", + "vk", + "skype", + "whatsup", + "messenger", + "text", +]; //форма контактов export function sendFC({ questionId, body, qid }: any) { - const formData = new FormData(); + const formData = new FormData(); - // const keysBody = Object.keys(body) - // const content:any = {} - // fields.forEach((key) => { - // if (keysBody.includes(key)) content[key] = body.key - // }) + // const keysBody = Object.keys(body) + // const content:any = {} + // fields.forEach((key) => { + // if (keysBody.includes(key)) content[key] = body.key + // }) + const answers = [ + { + question_id: questionId, + content: JSON.stringify(body), + result: true, + qid, + }, + ]; - const answers = [{ - question_id: questionId, - content: JSON.stringify(body), - result: true, - qid - }] + formData.append("answers", JSON.stringify(answers)); + formData.append("qid", qid); - formData.append("answers", JSON.stringify(answers)); - formData.append("qid", qid); - - return makeRequest({ - url: `https://s.hbpn.link/answer/answer`, - body: formData, - method: "POST", - }); -} \ No newline at end of file + return publicationMakeRequest({ + url: `https://s.hbpn.link/answer/answer`, + body: formData, + method: "POST", + }); +} From 1bb3cdae2f5ae8447162ae1cb17dff714d6dd1a3 Mon Sep 17 00:00:00 2001 From: nflnkr <105123049+nflnkr@users.noreply.github.com> Date: Mon, 29 Jan 2024 14:17:11 +0300 Subject: [PATCH 07/81] disable eslint no-unused-vars for function args --- .eslintrc.cjs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index df269ee..1684a63 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -26,8 +26,10 @@ module.exports = { "@typescript-eslint/no-unsafe-assignment": "off", "@typescript-eslint/no-unsafe-call": "off", "@typescript-eslint/no-unsafe-member-access": "off", - "@typescript-eslint/no-unused-vars": "warn", - "@typescript-eslint/require-await": "warn", + "@typescript-eslint/no-unused-vars": [ + "warn", + { "vars": "all", "args": "none" } + ], "@typescript-eslint/restrict-template-expressions": "off", "no-debugger": "off", "no-empty-function": "off", From 7675aed2cde76a38fb4ce92e459bc1e7109f4ddd Mon Sep 17 00:00:00 2001 From: nflnkr <105123049+nflnkr@users.noreply.github.com> Date: Mon, 29 Jan 2024 14:17:38 +0300 Subject: [PATCH 08/81] add @utils import alias --- tsconfig.json | 3 +++ vite.config.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/tsconfig.json b/tsconfig.json index 54029d2..fa04a91 100755 --- a/tsconfig.json +++ b/tsconfig.json @@ -35,6 +35,9 @@ ], "@model/*": [ "./model/*" + ], + "@utils/*": [ + "./utils/*" ] } }, diff --git a/vite.config.ts b/vite.config.ts index a12f50d..f8ccd79 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -8,6 +8,7 @@ export const alias = { "@stores": resolve(__dirname, "./src/stores"), "@api": resolve(__dirname, "./src/api"), "@model": resolve(__dirname, "./src/model"), + "@utils": resolve(__dirname, "./src/utils"), }; // https://vitejs.dev/config/ From bbeaa376914448c43f9b437ae44f89cbce446e42 Mon Sep 17 00:00:00 2001 From: nflnkr <105123049+nflnkr@users.noreply.github.com> Date: Mon, 29 Jan 2024 14:26:10 +0300 Subject: [PATCH 09/81] temporary fix ts(2590) --- src/ui_kit/CustomTextField.tsx | 121 +++++++++++++++++---------------- 1 file changed, 62 insertions(+), 59 deletions(-) diff --git a/src/ui_kit/CustomTextField.tsx b/src/ui_kit/CustomTextField.tsx index b04df3b..44f22f2 100755 --- a/src/ui_kit/CustomTextField.tsx +++ b/src/ui_kit/CustomTextField.tsx @@ -1,68 +1,71 @@ -import { FormControl, TextField, useTheme, SxProps, Theme } from "@mui/material"; +import { FormControl, TextField as MuiTextField, SxProps, Theme, useTheme } from "@mui/material"; -import type { ChangeEvent, KeyboardEvent, FocusEvent } from "react"; -import type { InputProps } from "@mui/material"; +import type { InputProps, TextFieldProps } from "@mui/material"; +import type { ChangeEvent, FC, FocusEvent, KeyboardEvent } from "react"; + + +const TextField = MuiTextField as unknown as FC; // temporary fix ts(2590) interface CustomTextFieldProps { - placeholder: string; - value?: string; - error?: string; - onChange?: (event: ChangeEvent) => void; - onKeyDown?: (event: KeyboardEvent) => void; - onBlur?: (event: FocusEvent) => void; - text?: string; - sx?: SxProps; - InputProps?: Partial; + placeholder: string; + value?: string; + error?: string; + onChange?: (event: ChangeEvent) => void; + onKeyDown?: (event: KeyboardEvent) => void; + onBlur?: (event: FocusEvent) => void; + text?: string; + sx?: SxProps; + InputProps?: Partial; } export default function CustomTextField({ - placeholder, - value, - text, - sx, - error, - onChange, - onKeyDown, - onBlur, - InputProps, + placeholder, + value, + text, + sx, + error, + onChange, + onKeyDown, + onBlur, + InputProps, }: CustomTextFieldProps) { - const theme = useTheme(); + const theme = useTheme(); - return ( - - - - ); + return ( + + + + ); } From 606472d182c612a5b5a66efd516f2ba1b68d637b Mon Sep 17 00:00:00 2001 From: nflnkr <105123049+nflnkr@users.noreply.github.com> Date: Mon, 29 Jan 2024 14:37:04 +0300 Subject: [PATCH 10/81] remove console logs --- src/pages/ViewPublicationPage/tools/checkEmptyData.ts | 9 --------- .../tools/replaceSpacesToEmptyLines.ts | 1 - 2 files changed, 10 deletions(-) diff --git a/src/pages/ViewPublicationPage/tools/checkEmptyData.ts b/src/pages/ViewPublicationPage/tools/checkEmptyData.ts index 53f5a8b..e7069c7 100644 --- a/src/pages/ViewPublicationPage/tools/checkEmptyData.ts +++ b/src/pages/ViewPublicationPage/tools/checkEmptyData.ts @@ -2,15 +2,6 @@ import { QuizQuestionResult } from "@model/questionTypes/result" export const checkEmptyData = ({ resultData }: { resultData: QuizQuestionResult }) => { let check = true - console.log(resultData) - console.log(resultData.title.length, - resultData.description.length, - resultData.content.back.length, - resultData.content.originalBack.length, - resultData.content.innerName.length, - resultData.content.text.length, - resultData.content.video.length, - resultData.content.hint.text.length ) if ( (resultData.title.length > 0 && resultData.title !== " ") || (resultData.description.length > 0 && resultData.description !== " ") || diff --git a/src/pages/ViewPublicationPage/tools/replaceSpacesToEmptyLines.ts b/src/pages/ViewPublicationPage/tools/replaceSpacesToEmptyLines.ts index 8c90f65..534e03d 100644 --- a/src/pages/ViewPublicationPage/tools/replaceSpacesToEmptyLines.ts +++ b/src/pages/ViewPublicationPage/tools/replaceSpacesToEmptyLines.ts @@ -10,7 +10,6 @@ export const replaceSpacesToEmptyLines = (object: T): T => { const result: Record = {}; for (const [key, value] of Object.entries(object)) { - console.log(key, value) if (typeof value === "string") { result[key] = value.replace( From af1264a170b3d70ab9cf57e2d028e867b4c8ed3b Mon Sep 17 00:00:00 2001 From: nflnkr <105123049+nflnkr@users.noreply.github.com> Date: Tue, 30 Jan 2024 19:49:33 +0300 Subject: [PATCH 11/81] fix some types remove some ts-ignore's refactor stores --- src/api/quizRelase.ts | 6 +- src/model/api/getQuizData.ts | 55 ++ src/model/settingsData.ts | 91 +- src/pages/ViewPublicationPage/ContactForm.tsx | 644 +++++++------ src/pages/ViewPublicationPage/Footer.tsx | 581 ++++++------ src/pages/ViewPublicationPage/Question.tsx | 237 +++-- src/pages/ViewPublicationPage/ResultForm.tsx | 412 ++++----- .../StartPageViewPublication.tsx | 872 +++++++++--------- src/pages/ViewPublicationPage/index.tsx | 171 ++-- .../ViewPublicationPage/questions/Date.tsx | 10 +- .../ViewPublicationPage/questions/Emoji.tsx | 33 +- .../ViewPublicationPage/questions/File.tsx | 5 +- .../ViewPublicationPage/questions/Images.tsx | 5 +- .../ViewPublicationPage/questions/Number.tsx | 355 +++---- .../ViewPublicationPage/questions/Rating.tsx | 3 +- .../ViewPublicationPage/questions/Select.tsx | 7 +- .../ViewPublicationPage/questions/Text.tsx | 3 +- .../ViewPublicationPage/questions/Variant.tsx | 410 ++++---- .../ViewPublicationPage/questions/Varimg.tsx | 20 +- src/stores/quizData/actions.ts | 9 +- src/stores/quizData/store.ts | 32 +- src/stores/quizView/store.ts | 155 ++-- src/ui_kit/CustomCheckbox.tsx | 5 +- src/ui_kit/LoadingSkeleton.tsx | 17 + .../themes/Publication/themePublication.ts | 45 +- 25 files changed, 2061 insertions(+), 2122 deletions(-) create mode 100644 src/model/api/getQuizData.ts create mode 100644 src/ui_kit/LoadingSkeleton.tsx diff --git a/src/api/quizRelase.ts b/src/api/quizRelase.ts index 237e604..6b4448c 100644 --- a/src/api/quizRelase.ts +++ b/src/api/quizRelase.ts @@ -1,7 +1,7 @@ +import { GetQuizDataResponse } from "@model/api/getQuizData"; import axios from "axios"; import type { AxiosError } from "axios"; -import type { GetDataResponse } from "../model/settingsData"; let SESSIONS = ""; @@ -19,7 +19,7 @@ export const publicationMakeRequest = ({ url, body }: any) => { }; export async function getData(quizId: string): Promise<{ - data: GetDataResponse | null; + data: GetQuizDataResponse | null; isRecentlyCompleted: boolean; error?: string; }> { @@ -29,7 +29,7 @@ export async function getData(quizId: string): Promise<{ : "ef836ff8-35b1-4031-9acf-af5766bac2b2"; try { - const { data, headers } = await axios( + const { data, headers } = await axios( `https://s.hbpn.link/answer/settings`, { method: "POST", diff --git a/src/model/api/getQuizData.ts b/src/model/api/getQuizData.ts new file mode 100644 index 0000000..9fab68d --- /dev/null +++ b/src/model/api/getQuizData.ts @@ -0,0 +1,55 @@ +import { AnyTypedQuizQuestion } from "@model/questionTypes/shared"; +import { QuizSettings } from "@model/settingsData"; + +export interface GetQuizDataResponse { + cnt: number; + settings: { + fp: boolean; + rep: boolean; + name: string; + cfg: string; + lim: number; + due: number; + delay: number; + pausable: boolean; + }; + items: { + id: number; + title: string; + desc: string; + typ: string; + req: boolean; + p: number; + c: string; + }[]; +} + +export function parseQuizData(quizDataResponse: GetQuizDataResponse, quizId: string): QuizSettings { + const items: QuizSettings["items"] = quizDataResponse.items.map((item) => { + const content = JSON.parse(item.c); + + return { + description: item.desc, + id: item.id, + page: item.p, + required: item.req, + title: item.title, + type: item.typ, + content + } as unknown as AnyTypedQuizQuestion; + }); + + const settings: QuizSettings["settings"] = { + qid: quizId, + fp: quizDataResponse.settings.fp, + rep: quizDataResponse.settings.rep, + name: quizDataResponse.settings.name, + cfg: JSON.parse(quizDataResponse?.settings.cfg), + lim: quizDataResponse.settings.lim, + due: quizDataResponse.settings.due, + delay: quizDataResponse.settings.delay, + pausable: quizDataResponse.settings.pausable + }; + + return { cnt: quizDataResponse.cnt, settings, items }; +} diff --git a/src/model/settingsData.ts b/src/model/settingsData.ts index 7568888..c7009b2 100644 --- a/src/model/settingsData.ts +++ b/src/model/settingsData.ts @@ -1,5 +1,4 @@ -import { AnyTypedQuizQuestion } from "@model/questionTypes/shared"; -// import { QuizConfig } from "@model/quizSettings"; +import { AnyTypedQuizQuestion } from "./questionTypes/shared"; export type QuizStartpageType = "standard" | "expanded" | "centered" | null; @@ -9,55 +8,50 @@ export type QuizType = "quiz" | "form"; export type QuizResultsType = true | null; +export type QuizTheme = + | "StandardTheme" + | "StandardDarkTheme" + | "PinkTheme" + | "PinkDarkTheme" + | "BlackWhiteTheme" + | "OliveTheme" + | "YellowTheme" + | "GoldDarkTheme" + | "PurpleTheme" + | "BlueTheme" + | "BlueDarkTheme"; + export type FCField = { - text: string - innerText: string - key: string - required: boolean - used: boolean -} -export interface GetDataResponse { - cnt: number; + text: string; + innerText: string; + key: string; + required: boolean; + used: boolean; +}; + +export type QuizSettings = { + items: AnyTypedQuizQuestion[]; settings: { + qid: string; fp: boolean; rep: boolean; name: string; - cfg: string; lim: number; due: number; delay: number; pausable: boolean; + cfg: QuizConfig; }; - items: GetItems[]; -} - - - -export type QuestionsStore = { - items: (AnyTypedQuizQuestion)[]; - settings: Settings; cnt: number; }; -export interface Settings { - - fp: boolean; - rep: boolean; - name: string; - lim: number; - due: number; - delay: number; - pausable: boolean; - cfg: QuizConfig -} - export interface QuizConfig { type: QuizType; noStartPage: boolean; startpageType: QuizStartpageType; results: QuizResultsType; haveRoot: string; - theme: "StandardTheme" | "StandardDarkTheme" | "PinkTheme" | "PinkDarkTheme" | "BlackWhiteTheme" | "OliveTheme" | "YellowTheme" | "GoldDarkTheme" | "PurpleTheme" | "BlueTheme" | "BlueDarkTheme"; + theme: QuizTheme; resultInfo: { when: "email" | ""; share: boolean; @@ -84,7 +78,6 @@ export interface QuizConfig { cycle: boolean; }; }; - formContact: { title: string; desc: string; @@ -93,7 +86,7 @@ export interface QuizConfig { phone: FCField; text: FCField; address: FCField; - button: string + button: string; }; info: { phonenumber: string; @@ -105,26 +98,12 @@ export interface QuizConfig { meta: string; } -export interface GetItems { - id: number; - title: string; - desc: string; - typ: string; - req: boolean; - p: number; - c: string; -} - export interface QuizItems { - - description: string; - id: number; - page: number; - required: boolean; - title: string; - type: string; - content: QuizItemsContent -} -export interface QuizItemsContent { - -} \ No newline at end of file + description: string; + id: number; + page: number; + required: boolean; + title: string; + type: string; + content: unknown; +} diff --git a/src/pages/ViewPublicationPage/ContactForm.tsx b/src/pages/ViewPublicationPage/ContactForm.tsx index 2db30c1..ec3e9da 100644 --- a/src/pages/ViewPublicationPage/ContactForm.tsx +++ b/src/pages/ViewPublicationPage/ContactForm.tsx @@ -1,379 +1,363 @@ -import { Box, Typography, Button, useMediaQuery, TextField, Link, InputAdornment, useTheme } from "@mui/material"; -import NameIcon from "@icons/ContactFormIcon/NameIcon"; +import AddressIcon from "@icons/ContactFormIcon/AddressIcon"; import EmailIcon from "@icons/ContactFormIcon/EmailIcon"; +import NameIcon from "@icons/ContactFormIcon/NameIcon"; import PhoneIcon from "@icons/ContactFormIcon/PhoneIcon"; import TextIcon from "@icons/ContactFormIcon/TextIcon"; -import AddressIcon from "@icons/ContactFormIcon/AddressIcon"; -import { useDebouncedCallback } from "use-debounce"; +import { Box, Button, InputAdornment, Link, TextField as MuiTextField, TextFieldProps, Typography, useMediaQuery, useTheme } from "@mui/material"; + import CustomCheckbox from "@ui_kit/CustomCheckbox"; -import { useEffect, useRef, useState } from "react"; -import { useQuestionsStore } from "@stores/quizData/store"; +import { FC, useRef, useState } from "react"; -import { checkEmptyData } from "./tools/checkEmptyData"; -import type { AnyTypedQuizQuestion } from "../../model/questionTypes/shared"; -import { enqueueSnackbar } from "notistack"; import { sendFC } from "@api/quizRelase"; import { NameplateLogo } from "@icons/NameplateLogo"; -import { modes } from "../../utils/themes/Publication/themePublication"; import { QuizQuestionResult } from "@model/questionTypes/result"; +import { quizThemes } from "@utils/themes/Publication/themePublication"; +import { enqueueSnackbar } from "notistack"; import { ApologyPage } from "./ApologyPage"; +import { checkEmptyData } from "./tools/checkEmptyData"; +import { useQuestionsStore } from "@stores/quizData/store"; +const TextField = MuiTextField as unknown as FC; // temporary fix ts(2590) -const EMAIL_REGEXP = /^(([^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*)|(".+"))@(([^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{2,})$/iu; +const EMAIL_REGEXP = /^(([^<>()[\].,:\s@"]+(\.[^<>()[\].,:\s@"]+)*)|(".+"))@(([^<>()[\].,:\s@"]+\.)+[^<>()[\].,:\s@"]{2,})$/iu; + +type ContactType = + | "name" + | "email" + | "phone" + | "text" + | "adress"; type ContactFormProps = { - currentQuestion: any; - showResultForm: boolean; - setShowContactForm: (show: boolean) => void; - setShowResultForm: (show: boolean) => void; + currentQuestion: any; + showResultForm: boolean; + setShowContactForm: (show: boolean) => void; + setShowResultForm: (show: boolean) => void; }; -const icons = [ - { type: "name", icon: NameIcon, defaultText: "Введите имя", defaultTitle: "имя", backendName: "name" }, - { type: "email", icon: EmailIcon, defaultText: "Введите Email", defaultTitle: "Email", backendName: "email" }, - { type: "phone", icon: PhoneIcon, defaultText: "Введите номер телефона", defaultTitle: "номер телефона", backendName: "phone" }, - { type: "text", icon: TextIcon, defaultText: "Введите фамилию", defaultTitle: "фамилию", backendName: "adress" }, - { type: "address", icon: AddressIcon, defaultText: "Введите адрес", defaultTitle: "адрес", backendName: "adress" }, -] - export const ContactForm = ({ - currentQuestion, - showResultForm, - setShowContactForm, - setShowResultForm, + currentQuestion, + showResultForm, + setShowContactForm, + setShowResultForm, }: ContactFormProps) => { - const theme = useTheme(); - const { settings, items } = useQuestionsStore() + const theme = useTheme(); + const { settings, items } = useQuestionsStore() - const [ready, setReady] = useState(false) - const [name, setName] = useState("") - const [email, setEmail] = useState("") - const [phone, setPhone] = useState("") - const [text, setText] = useState("") - const [adress, setAdress] = useState("") + const [ready, setReady] = useState(false) + const [name, setName] = useState("") + const [email, setEmail] = useState("") + const [phone, setPhone] = useState("") + const [text, setText] = useState("") + const [adress, setAdress] = useState("") - const fireOnce = useRef(true) - const [fire, setFire] = useState(false) - const isMobile = useMediaQuery(theme.breakpoints.down(850)); + const fireOnce = useRef(true) + const [fire, setFire] = useState(false) + const isMobile = useMediaQuery(theme.breakpoints.down(850)); - const followNextForm = () => { - setShowContactForm(false); - setShowResultForm(true); - }; - const mode = modes; - //@ts-ignore - const resultQuestion: QuizQuestionResult = items.find((question) => { - if (settings?.cfg.haveRoot) { //ветвимся - return ( - question.type === "result" && - //@ts-ignore - question.content.rule.parentId === currentQuestion.content.id - ) - } else {// не ветвимся - return ( - question.type === "result" && - question.content.rule.parentId === "line" - ) + const resultQuestion: QuizQuestionResult = items.find((question): question is QuizQuestionResult => { + if (settings?.cfg.haveRoot) { //ветвимся + return ( + question.type === "result" && + question.content.rule.parentId === currentQuestion.content.id + ); + } else {// не ветвимся + return ( + question.type === "result" && + question.content.rule.parentId === "line" + ); + } + })!; + + const inputHC = async () => { + if (!settings) return; + + const body: Partial> = {}; + + if (name.length > 0) body.name = name; + if (email.length > 0) body.email = email; + if (phone.length > 0) body.phone = phone; + if (text.length > 0) body.text = text; + if (adress.length > 0) body.adress = adress; + + if (Object.keys(body).length > 0) { + try { + await sendFC({ + questionId: resultQuestion?.id, + body: body, + qid: settings.qid + }) + + } catch (e) { + enqueueSnackbar("ответ не был засчитан") + } + + } } - - } - ); - - const inputHC = async () => { - - const body = {} //@ts-ignore - if (name.length > 0) body.name = name - //@ts-ignore - if (email.length > 0) body.email = email - //@ts-ignore - if (phone.length > 0) body.phone = phone - //@ts-ignore - if (text.length > 0) body.text = text - //@ts-ignore - if (adress.length > 0) body.adress = adress - - if (Object.keys(body).length > 0) { - try { - await sendFC({ - questionId: resultQuestion?.id, - body: body, - //@ts-ignore - qid: settings.qid - }) - - } catch (e) { - enqueueSnackbar("ответ не был засчитан") - } + const FCcopy: any = settings?.cfg.formContact.fields || settings?.cfg.formContact; + const filteredFC: any = {}; + for (const i in FCcopy) { + const field = FCcopy[i]; + console.log(filteredFC); + if (field.used) { + filteredFC[i] = field; + } } - } - //@ts-ignore - let FCcopy: any = settings?.cfg.formContact.fields || settings?.cfg.formContact; + const isWide = Object.keys(filteredFC).length > 2; - let filteredFC: any = {} - for (let i in FCcopy) { - let field = FCcopy[i] - console.log(filteredFC) - if (field.used) { - filteredFC[i] = field - } - } - let isWide = Object.keys(filteredFC).length > 2 - console.log(isWide) + if (!settings) throw new Error("settings is null"); + if (!resultQuestion) return - if (!resultQuestion) return - - return ( - - + return ( - - {settings?.cfg.formContact.title || "Заполните форму, чтобы получить результаты теста"} - - - { - settings?.cfg.formContact.desc && - - {settings?.cfg.formContact.desc} - - } - - - - - - - - - - - - { - // resultQuestion && - // settings?.cfg.resultInfo.when === "after" && - ( - - )} + > + + + {settings?.cfg.formContact.title || "Заполните форму, чтобы получить результаты теста"} - - { setReady(target.checked) }} checked={ready} colorIcon={theme.palette.primary.main} /> - - С  - - Положением об обработке персональных данных -  и  - Политикой конфиденциальности -  ознакомлен - + + { + settings?.cfg.formContact.desc && + + {settings?.cfg.formContact.desc} + + } + - - - - - Сделано на PenaQuiz - - - - - - ); + + + + + + + + + + { + // resultQuestion && + // settings?.cfg.resultInfo.when === "after" && + ( + + )} + + + { setReady(target.checked) }} checked={ready} colorIcon={theme.palette.primary.main} /> + + С  + + Положением об обработке персональных данных +  и  + Политикой конфиденциальности +  ознакомлен + + + + + + + Сделано на PenaQuiz + + + + + + ); }; const Inputs = ({ - name, setName, - email, setEmail, - phone, setPhone, - text, setText, - adress, setAdress + name, setName, + email, setEmail, + phone, setPhone, + text, setText, + adress, setAdress }: any) => { - const { settings, items } = useQuestionsStore() + const { settings } = useQuestionsStore() - console.log("______________________EMAIL_REGEXP.test(email)") - console.log(EMAIL_REGEXP.test(email)) - //@ts-ignore - const FC: any = settings?.cfg.formContact.fields || settings?.cfg.formContact + //@ts-ignore + const FC: any = settings?.cfg.formContact.fields || settings?.cfg.formContact - //@ts-ignore - const Name = setName(target.value)} id={name} title={FC["name"].innerText || "Введите имя"} desc={FC["name"].text || "имя"} Icon={NameIcon} /> - //@ts-ignore - const Email = setName(target.value)} id={name} title={FC["name"].innerText || "Введите имя"} desc={FC["name"].text || "имя"} Icon={NameIcon} /> + //@ts-ignore + const Email = setEmail(target.value)} id={email} title={FC["email"].innerText || "Введите Email"} desc={FC["email"].text || "Email"} Icon={EmailIcon} /> - //@ts-ignore - const Phone = setPhone(target.value)} id={phone} title={FC["phone"].innerText || "Введите номер телефона"} desc={FC["phone"].text || "номер телефона"} Icon={PhoneIcon} /> - //@ts-ignore - const Text = setText(target.value)} id={text} title={FC["text"].innerText || "Введите фамилию"} desc={FC["text"].text || "фамилию"} Icon={TextIcon} /> - //@ts-ignore - const Adress = setAdress(target.value)} id={adress} title={FC["address"].innerText || "Введите адрес"} desc={FC["address"].text || "адрес"} Icon={AddressIcon} /> + error = {!EMAIL_REGEXP.test(email)} + label={!EMAIL_REGEXP.test(email) ? "" : "Некорректная почта"} + //@ts-ignore + onChange={({ target }) => setEmail(target.value)} id={email} title={FC["email"].innerText || "Введите Email"} desc={FC["email"].text || "Email"} Icon={EmailIcon} /> + //@ts-ignore + const Phone = setPhone(target.value)} id={phone} title={FC["phone"].innerText || "Введите номер телефона"} desc={FC["phone"].text || "номер телефона"} Icon={PhoneIcon} /> + //@ts-ignore + const Text = setText(target.value)} id={text} title={FC["text"].innerText || "Введите фамилию"} desc={FC["text"].text || "фамилию"} Icon={TextIcon} /> + //@ts-ignore + const Adress = setAdress(target.value)} id={adress} title={FC["address"].innerText || "Введите адрес"} desc={FC["address"].text || "адрес"} Icon={AddressIcon} /> - //@ts-ignore - if (Object.values(FC).some((data) => data.used)) { - return <> - {FC["name"].used ? Name : <>} - {FC["email"].used ? Email : <>} - {FC["phone"].used ? Phone : <>} - {FC["text"].used ? Text : <>} - {FC["address"].used ? Adress : <>} - - } else { - return <> - {Name} - {Email} - {Phone} - - } + //@ts-ignore + if (Object.values(FC).some((data) => data.used)) { + return <> + {FC["name"].used ? Name : <>} + {FC["email"].used ? Email : <>} + {FC["phone"].used ? Phone : <>} + {FC["text"].used ? Text : <>} + {FC["address"].used ? Adress : <>} + + } else { + return <> + {Name} + {Email} + {Phone} + + } } const CustomInput = ({ title, desc, Icon, onChange }: any) => { - const theme = useTheme(); - const isMobile = useMediaQuery(theme.breakpoints.down(600)); - //@ts-ignore - return - {title} + const theme = useTheme(); + const isMobile = useMediaQuery(theme.breakpoints.down(600)); - , - }} - /> - + return ( + + {title} + + , + }} + /> + + ) } diff --git a/src/pages/ViewPublicationPage/Footer.tsx b/src/pages/ViewPublicationPage/Footer.tsx index be92c3d..9dd9f3c 100644 --- a/src/pages/ViewPublicationPage/Footer.tsx +++ b/src/pages/ViewPublicationPage/Footer.tsx @@ -1,322 +1,298 @@ -import { useState, useEffect } from "react"; import { Box, Button, Typography, useMediaQuery, useTheme } from "@mui/material"; +import { useCallback, useMemo, useState } from "react"; -import type { AnyTypedQuizQuestion, QuizQuestionBase } from "../../model/questionTypes/shared"; -import { useQuestionsStore } from "@stores/quizData/store"; import { getQuestionById } from "@stores/quizData/actions"; -import { useQuizViewStore } from "@stores/quizView/store"; -import { enqueueSnackbar } from "notistack"; -import { NameplateLogoFQ } from "@icons/NameplateLogoFQ"; -import { NameplateLogoFQDark } from "@icons/NameplateLogoFQDark"; -import { modes } from "../../utils/themes/Publication/themePublication"; +import { enqueueSnackbar } from "notistack"; +import type { AnyTypedQuizQuestion, QuizQuestionBase } from "../../model/questionTypes/shared"; + import { checkEmptyData } from "./tools/checkEmptyData"; import type { QuizQuestionResult } from "@model/questionTypes/result"; +import { useQuestionsStore } from "@stores/quizData/store"; +import { useQuizViewStore } from "@stores/quizView/store"; type FooterProps = { - setCurrentQuestion: (step: AnyTypedQuizQuestion) => void; - question: AnyTypedQuizQuestion; - setShowContactForm: (show: boolean) => void; - setShowResultForm: (show: boolean) => void; + setCurrentQuestion: (step: AnyTypedQuizQuestion) => void; + question: AnyTypedQuizQuestion; + setShowContactForm: (show: boolean) => void; + setShowResultForm: (show: boolean) => void; }; export const Footer = ({ setCurrentQuestion, question, setShowContactForm, setShowResultForm }: FooterProps) => { - const theme = useTheme(); + const theme = useTheme(); - const { settings, items } = useQuestionsStore(); - const { answers } = useQuizViewStore(); + const { settings, items } = useQuestionsStore(); + const answers = useQuizViewStore(state => state.answers); - const mode = modes; + const [stepNumber, setStepNumber] = useState(1); - const [stepNumber, setStepNumber] = useState(1); - const [disablePreviousButton, setDisablePreviousButton] = useState(false); - const [disableNextButton, setDisableNextButton] = useState(false); + const isMobileMini = useMediaQuery(theme.breakpoints.down(382)); + const isLinear = !items.some(({ content }) => content.rule.parentId === "root"); - const isMobileMini = useMediaQuery(theme.breakpoints.down(382)); - const linear = !items.find(({ content }) => content.rule.parentId === "root"); + const getNextQuestionId = useCallback(() => { + console.log("Смотрим какой вопрос будет дальше. Что у нас сегодня вкусненького? Щя покажу от какого вопроса мы ищем следующий шаг"); + console.log(question); + console.log("От вот этого /|"); + let readyBeNextQuestion = ""; - useEffect(() => { - // Логика для аргумента disabled у кнопки "Назад" - if (linear) { - const questionIndex = items.findIndex(({ id }) => id === question.id); + //вопрос обязателен, анализируем ответ и условия ветвления + if (answers.length) { + const answer = answers.find(({ questionId }) => questionId === question.id); - const previousQuestion = items[questionIndex - 1]; - if (previousQuestion) { - setDisablePreviousButton(false); - } else { - setDisablePreviousButton(true); - } - } else { - if (question?.content.rule.parentId === "root") { - setDisablePreviousButton(true); - } else { - setDisablePreviousButton(false); - } - } + (question as QuizQuestionBase).content.rule.main.forEach(({ next, rules }) => { + const longerArray = Math.max( + rules[0].answers.length, + answer?.answer && Array.isArray(answer?.answer) ? answer?.answer.length : [answer?.answer].length + ); - // Логика для аргумента disabled у кнопки "Далее" - const answer = answers.find(({ questionId }) => questionId === question.id); + for ( + let i = 0; + i < longerArray; + i++ // Цикл по всем эле­мен­там бОльшего массива + ) { + if (Array.isArray(answer?.answer)) { + if (answer?.answer.find((item) => String(item === rules[0].answers[i]))) { + readyBeNextQuestion = next; // Ес­ли хоть один эле­мент от­ли­ча­ет­ся, мас­си­вы не рав­ны + } - if ("required" in question.content && question.content.required && answer) { - setDisableNextButton(false); + return; + } - return; - } + if (String(rules[0].answers[i]) === answer?.answer) { + readyBeNextQuestion = next; // Ес­ли хоть один эле­мент от­ли­ча­ет­ся, мас­си­вы не рав­ны + } + } + }); - if ("required" in question.content && question.content.required && !answer) { - setDisableNextButton(true); + if (readyBeNextQuestion) return readyBeNextQuestion; + } - return; - } + if (!question.required) {//вопрос не обязателен и не нашли совпадений между ответами и условиями ветвления + console.log("вопрос не обязателен ищем дальше"); + const defaultQ = question.content.rule.default; + if (defaultQ.length > 1 && defaultQ !== " ") return defaultQ; + //Вопросы типа страница, ползунок, своё поле для ввода и дата не могут иметь больше 1 ребёнка. Пользователь не может настроить там дефолт + //Кинуть на ребёнка надо даже если там нет дефолта + if ( + (question?.type === "date" || + question?.type === "text" || + question?.type === "number" || + question?.type === "page") && question.content.rule.children.length === 1 + ) return question.content.rule.children[0]; - if (linear) { - return; - } - - const nextQuestionId = getNextQuestionId(); - if (nextQuestionId) { - setDisableNextButton(false); - } else { - const nextQuestion = getQuestionById(question.content.rule.default); - - if (nextQuestion?.type) { - setDisableNextButton(false); - } - } - }, [question, answers]); - - const showResult = (nextQuestion: QuizQuestionResult) => { - const isEmpty = checkEmptyData({ resultData: nextQuestion }) - console.log("isEmpty", isEmpty) - - if (nextQuestion) { - if (nextQuestion && settings?.cfg.resultInfo.showResultForm === "before") { - if (isEmpty) { - setShowContactForm(true); //до+пустая = кидать на ФК - - } else { - setShowResultForm(true); //до+заполнена = показать } - } - if (nextQuestion && settings?.cfg.resultInfo.showResultForm === "after") { - if (isEmpty) { - setShowContactForm(true); //после+пустая + //ничё не нашли, ищем резулт + console.log("ничё не нашли, ищем резулт "); + return items.find(q => { + console.log('q.type === "result"', q.type === "result"); + console.log('q.content.rule.parentId', q.content.rule.parentId); + console.log('question.content.id', question.content.id); + return q.type === "result" && q.content.rule.parentId === question.content.id; + })?.id; + }, [answers, items, question]); + + const isPreviousButtonDisabled = useMemo(() => { + // Логика для аргумента disabled у кнопки "Назад" + if (isLinear) { + const questionIndex = items.findIndex(({ id }) => id === question.id); + + const previousQuestion = items[questionIndex - 1]; + + return previousQuestion ? false : true; } else { - setShowContactForm(true); //после+заполнена = показать ФК - + return question?.content.rule.parentId === "root" ? true : false; } - } - } + }, [items, isLinear, question?.content.rule.parentId, question.id]); - }; + const isNextButtonDisabled = useMemo(() => { + // Логика для аргумента disabled у кнопки "Далее" + const answer = answers.find(({ questionId }) => questionId === question.id); - const getNextQuestionId = () => { - console.log("Смотрим какой вопрос будет дальше. Что у нас сегодня вкусненького? Щя покажу от какого вопроса мы ищем следующий шаг") - console.log(question) - console.log("От вот этого /|") - let readyBeNextQuestion = ""; + if ("required" in question.content && question.content.required && answer) { + return false; + } - //вопрос обязателен, анализируем ответ и условия ветвления - if (answers.length) { - const answer = answers.find(({ questionId }) => questionId === question.id); + if ("required" in question.content && question.content.required && !answer) { + return true; + } + if (isLinear) { + return false; + } - (question as QuizQuestionBase).content.rule.main.forEach(({ next, rules }) => { - let longerArray = Math.max( - rules[0].answers.length, - answer?.answer && Array.isArray(answer?.answer) ? answer?.answer.length : [answer?.answer].length - ); + const nextQuestionId = getNextQuestionId(); + if (nextQuestionId) { + return false; + } else { + const nextQuestion = getQuestionById(question.content.rule.default); - for ( - var i = 0; - i < longerArray; - i++ // Цикл по всем эле­мен­там бОльшего массива - ) { - if (Array.isArray(answer?.answer)) { - if (answer?.answer.find((item) => String(item === rules[0].answers[i]))) { - readyBeNextQuestion = next; // Ес­ли хоть один эле­мент от­ли­ча­ет­ся, мас­си­вы не рав­ны + if (nextQuestion?.type) { + return false; + } + } + }, [answers, getNextQuestionId, isLinear, question.content, question.id]); + + const showResult = (nextQuestion: QuizQuestionResult) => { + if (!settings) return; + if (!nextQuestion) return; + + const isEmpty = checkEmptyData({ resultData: nextQuestion }); + + if (nextQuestion) { + if (nextQuestion && settings?.cfg.resultInfo.showResultForm === "before") { + if (isEmpty) { + setShowContactForm(true); //до+пустая = кидать на ФК + + } else { + setShowResultForm(true); //до+заполнена = показать + + } + } + if (nextQuestion && settings?.cfg.resultInfo.showResultForm === "after") { + if (isEmpty) { + setShowContactForm(true); //после+пустая + + } else { + setShowContactForm(true); //после+заполнена = показать ФК + + } + } + } + }; + + const followPreviousStep = () => { + if (isLinear) { + setStepNumber(q => q - 1); + + const questionIndex = items.findIndex(({ id }) => id === question.id); + + const previousQuestion = items[questionIndex - 1]; + + if (previousQuestion) { + setCurrentQuestion(previousQuestion); } return; - } - - if (String(rules[0].answers[i]) === answer?.answer) { - readyBeNextQuestion = next; // Ес­ли хоть один эле­мент от­ли­ча­ет­ся, мас­си­вы не рав­ны - } - } - }); - - if (readyBeNextQuestion) return readyBeNextQuestion; - } - - if (!question.required) {//вопрос не обязателен и не нашли совпадений между ответами и условиями ветвления - console.log("вопрос не обязателен ищем дальше") - const defaultQ = question.content.rule.default - if (defaultQ.length > 1 && defaultQ !== " ") return defaultQ - //Вопросы типа страница, ползунок, своё поле для ввода и дата не могут иметь больше 1 ребёнка. Пользователь не может настроить там дефолт - //Кинуть на ребёнка надо даже если там нет дефолта - if ( - (question?.type === "date" || - question?.type === "text" || - question?.type === "number" || - question?.type === "page") && question.content.rule.children.length === 1 - ) return question.content.rule.children[0] - - - } - //ничё не нашли, ищем резулт - console.log("ничё не нашли, ищем резулт ") - return items.find(q => { - console.log('q.type === "result"', q.type === "result") - console.log('q.content.rule.parentId', q.content.rule.parentId) - //@ts-ignore - console.log('question.content.id', question.content.id) - //@ts-ignore - return q.type === "result" && q.content.rule.parentId === question.content.id - })?.id - - }; - - - const followPreviousStep = () => { - if (linear) { - setStepNumber(q => q - 1) - - const questionIndex = items.findIndex(({ id }) => id === question.id); - - const previousQuestion = items[questionIndex - 1]; - - if (previousQuestion) { - setCurrentQuestion(previousQuestion); - } - - return; - } - - if (question?.content.rule.parentId !== "root") { - const parent = getQuestionById(question?.content.rule.parentId); - if (parent?.type) { - setCurrentQuestion(parent); - } else { - enqueueSnackbar("не могу получить предыдущий вопрос"); - } - } else { - enqueueSnackbar("вы находитесь на первом вопросе"); - } - }; - - const followNextStep = () => { - if (linear) { - setStepNumber(q => q + 1) - - const questionIndex = items.findIndex(({ id }) => id === question.id); - const nextQuestion = items[questionIndex + 1]; - - if (nextQuestion && nextQuestion.type !== "result") { - setCurrentQuestion(nextQuestion); - } else { - //@ts-ignore - showResult(items.find(q => q.content.rule.parentId === "line")); - } - - return; - } - - const nextQuestionId = getNextQuestionId(); - console.log(nextQuestionId) - - if (nextQuestionId) { - const nextQuestion = getQuestionById(nextQuestionId); - console.log(nextQuestion) - - if (nextQuestion?.type && nextQuestion.type === "result") { - showResult(nextQuestion); - } else { - //@ts-ignore - setCurrentQuestion(nextQuestion); - } - } else { - enqueueSnackbar("не могу получить последующий вопрос"); - } - - }; - - return ( - - - {/*{mode[settings.cfg.theme] ? (*/} - {/* */} - {/*):(*/} - {/* */} - {/*)}*/} - {linear && - <> - - Шаг - - {stepNumber} - - Из - - {items.filter(q => q.type !== "result").length} - - - } + if (question?.content.rule.parentId !== "root") { + const parent = getQuestionById(question?.content.rule.parentId); + if (parent?.type) { + setCurrentQuestion(parent); + } else { + enqueueSnackbar("не могу получить предыдущий вопрос"); + } + } else { + enqueueSnackbar("вы находитесь на первом вопросе"); + } + }; + + const followNextStep = () => { + if (isLinear) { + setStepNumber(q => q + 1); + + const questionIndex = items.findIndex(({ id }) => id === question.id); + const nextQuestion = items[questionIndex + 1]; + + if (nextQuestion && nextQuestion.type !== "result") { + setCurrentQuestion(nextQuestion); + } else { + //@ts-ignore + showResult(items.find(q => q.content.rule.parentId === "line")); + } + + return; + } + + const nextQuestionId = getNextQuestionId(); + + if (nextQuestionId) { + const nextQuestion = getQuestionById(nextQuestionId); + + if (nextQuestion?.type && nextQuestion.type === "result") { + showResult(nextQuestion); + } else { + //@ts-ignore + setCurrentQuestion(nextQuestion); + } + } else { + enqueueSnackbar("не могу получить последующий вопрос"); + } + }; + + return ( - {/* Шаг + + {/*{mode[settings.cfg.theme] ? (*/} + {/* */} + {/*):(*/} + {/* */} + {/*)}*/} + {isLinear && + + Шаг + + {stepNumber} + + Из + + {items.filter(q => q.type !== "result").length} + + + } + + + {/* Шаг {stepNumber} */} - {/* */} - {/* Из + {/* */} + {/* Из {questions.length} */} + + + + - - - - - ); - + ); }; diff --git a/src/pages/ViewPublicationPage/Question.tsx b/src/pages/ViewPublicationPage/Question.tsx index 39480c9..03f43ac 100644 --- a/src/pages/ViewPublicationPage/Question.tsx +++ b/src/pages/ViewPublicationPage/Question.tsx @@ -1,141 +1,140 @@ -import { useState, useEffect } from "react"; -import {Box, useMediaQuery, useTheme} from "@mui/material"; +import { Box, useMediaQuery, useTheme } from "@mui/material"; +import { useEffect, useState } from "react"; -import { useQuestionsStore } from "@stores/quizData/store" import { getQuestionById } from "@stores/quizData/actions"; -import { Variant } from "./questions/Variant"; -import { Images } from "./questions/Images"; -import { Varimg } from "./questions/Varimg"; -import { Emoji } from "./questions/Emoji"; -import { Text } from "./questions/Text"; -import { Select } from "./questions/Select"; +import { ContactForm } from "./ContactForm"; +import { Footer } from "./Footer"; +import { ResultForm } from "./ResultForm"; import { Date } from "./questions/Date"; -import { Number } from "./questions/Number"; +import { Emoji } from "./questions/Emoji"; import { File } from "./questions/File"; +import { Images } from "./questions/Images"; +import { Number } from "./questions/Number"; import { Page } from "./questions/Page"; import { Rating } from "./questions/Rating"; -import { Footer } from "./Footer"; -import { ContactForm } from "./ContactForm"; -import { ResultForm } from "./ResultForm"; +import { Select } from "./questions/Select"; +import { Text } from "./questions/Text"; +import { Variant } from "./questions/Variant"; +import { Varimg } from "./questions/Varimg"; -import type { QuestionType } from "@model/questionTypes/shared"; import type { AnyTypedQuizQuestion } from "../../model/questionTypes/shared"; -import {NameplateLogoFQ} from "@icons/NameplateLogoFQ"; -import {NameplateLogoFQDark} from "@icons/NameplateLogoFQDark"; -import {modes} from "../../utils/themes/Publication/themePublication"; +import { NameplateLogoFQ } from "@icons/NameplateLogoFQ"; +import { NameplateLogoFQDark } from "@icons/NameplateLogoFQDark"; +import { QuizQuestionResult } from "@model/questionTypes/result"; +import { useQuestionsStore } from "@stores/quizData/store"; +import { notReachable } from "@utils/notReachable"; +import { quizThemes } from "@utils/themes/Publication/themePublication"; -type QuestionProps = { - questions: AnyTypedQuizQuestion[]; -}; +export const Question = () => { + const theme = useTheme(); + const settings = useQuestionsStore(state => state.settings); + const questions = useQuestionsStore(state => state.items); + const [currentQuestion, setCurrentQuestion] = useState(); + const [showContactForm, setShowContactForm] = useState(false); + const [showResultForm, setShowResultForm] = useState(false); + const isMobile = useMediaQuery(theme.breakpoints.down(650)); -const QUESTIONS_MAP: any = { - variant: Variant, - images: Images, - varimg: Varimg, - emoji: Emoji, - text: Text, - select: Select, - date: Date, - number: Number, - file: File, - page: Page, - rating: Rating, -}; + useEffect(() => { -export const Question = ({ questions }: QuestionProps) => { - const { settings } = useQuestionsStore() - const theme = useTheme(); const isMobile = useMediaQuery(theme.breakpoints.down(650)); - const [currentQuestion, setCurrentQuestion] = useState(); - const [showContactForm, setShowContactForm] = useState(false); - const [showResultForm, setShowResultForm] = useState(false); - const mode = modes; - console.log("currentQuestion ", currentQuestion) - useEffect(() => { + if (settings?.cfg.haveRoot) {//ветвимся + const nextQuestion = getQuestionById(settings?.cfg.haveRoot || ""); - if (settings?.cfg.haveRoot) {//ветвимся - const nextQuestion = getQuestionById(settings?.cfg.haveRoot || ""); + if (nextQuestion?.type) { + setCurrentQuestion(nextQuestion); + return; + } - if (nextQuestion?.type) { - setCurrentQuestion(nextQuestion); - return; - } + } else {//идём прямо + setCurrentQuestion(questions[0]); + } - } else {//идём прямо - setCurrentQuestion(questions[0]); - } + }, []); - }, []); + if (!settings) throw new Error("settings is null"); + if (!currentQuestion || currentQuestion.type === "result") return "не смог отобразить вопрос"; - if (!currentQuestion) return <>не смог отобразить вопрос; - - const QuestionComponent = - QUESTIONS_MAP[currentQuestion.type as Exclude]; - - return ( - - {!showContactForm && !showResultForm && ( + return ( - - {mode[settings?.cfg.theme] ? ( - - ) : ( - - )} + {!showContactForm && !showResultForm && ( + + + {quizThemes[settings.cfg.theme].isLight ? ( + + ) : ( + + )} + + )} + {showResultForm && settings?.cfg.resultInfo.showResultForm === "before" && ( + + )} + {showContactForm && ( + + )} + {showResultForm && settings?.cfg.resultInfo.showResultForm === "after" && ( + + )} + {!showContactForm && !showResultForm && ( +
+ )}
- )} - {showResultForm && settings?.cfg.resultInfo.showResultForm === "before" && ( - - )} - {showContactForm && ( - - )} - {showResultForm && settings?.cfg.resultInfo.showResultForm === "after" && ( - - )} - {!showContactForm && !showResultForm && ( -
- )} -
- ); - + ); }; + +function QuestionByType({ question }: { + question: Exclude; +}) { + switch (question.type) { + case "variant": return ; + case "images": return ; + case "varimg": return ; + case "emoji": return ; + case "text": return ; + case "select": return ; + case "date": return ; + case "number": return ; + case "file": return ; + case "page": return ; + case "rating": return ; + default: return notReachable(question); + } +} diff --git a/src/pages/ViewPublicationPage/ResultForm.tsx b/src/pages/ViewPublicationPage/ResultForm.tsx index 320dab3..6666bd4 100644 --- a/src/pages/ViewPublicationPage/ResultForm.tsx +++ b/src/pages/ViewPublicationPage/ResultForm.tsx @@ -1,234 +1,228 @@ import { - Box, - Typography, - Button, - useMediaQuery, - useTheme, + Box, + Button, + Typography, + useMediaQuery, + useTheme, } from "@mui/material"; -import { useQuestionsStore } from "@stores/quizData/store"; - -import YoutubeEmbedIframe from "./tools/YoutubeEmbedIframe"; import { NameplateLogo } from "@icons/NameplateLogo"; -import { modes } from "../../utils/themes/Publication/themePublication"; +import YoutubeEmbedIframe from "./tools/YoutubeEmbedIframe"; +import { useQuestionsStore } from "@stores/quizData/store"; +import { quizThemes } from "@utils/themes/Publication/themePublication"; +import { useCallback, useEffect, useMemo } from "react"; import type { QuizQuestionResult } from "../../model/questionTypes/result"; + type ResultFormProps = { - currentQuestion: any; - showContactForm: boolean; - setShowContactForm: (show: boolean) => void; - setShowResultForm: (show: boolean) => void; + currentQuestion: any; + showContactForm: boolean; + setShowContactForm: (show: boolean) => void; + setShowResultForm: (show: boolean) => void; }; export const ResultForm = ({ - currentQuestion, - showContactForm, - setShowContactForm, - setShowResultForm, + currentQuestion, + showContactForm, + setShowContactForm, + setShowResultForm, }: ResultFormProps) => { - const theme = useTheme(); - const isMobile = useMediaQuery(theme.breakpoints.down(650)); - const { settings, items } = useQuestionsStore(); - const mode = modes; + const theme = useTheme(); + const isMobile = useMediaQuery(theme.breakpoints.down(650)); + const { settings, items } = useQuestionsStore(); + if (!settings) throw new Error("settings is null"); - const searchResult = (): QuizQuestionResult => { - if (Boolean(settings?.cfg.haveRoot)) { - //ищём для ветвления - return (items.find( - (question) => - question.type === "result" && - question.content.rule.parentId === currentQuestion.content.id - ) || - items.find( - (question) => - question.type === "result" && - question.content.rule.parentId === "line" - )) as QuizQuestionResult; - } else { - return items.find( - (question) => - question.type === "result" && - question.content.rule.parentId === "line" - ) as QuizQuestionResult; - } - }; - const resultQuestion = searchResult(); + const resultQuestion = useMemo(() => { + if (settings?.cfg.haveRoot) { + //ищём для ветвления + return (items.find( + (question): question is QuizQuestionResult => + question.type === "result" && + question.content.rule.parentId === currentQuestion.content.id + ) || items.find( + (question): question is QuizQuestionResult => + question.type === "result" && + question.content.rule.parentId === "line" + )); + } else { + return items.find( + (question): question is QuizQuestionResult => + question.type === "result" && + question.content.rule.parentId === "line" + ); + } + }, [currentQuestion.content.id, items, settings?.cfg.haveRoot]); + + const followNextForm = useCallback(() => { + setShowResultForm(false); + setShowContactForm(true); + },[setShowContactForm, setShowResultForm]); + + useEffect(() => { + if (!resultQuestion) { + followNextForm(); + } + }, [followNextForm, resultQuestion]); + + if (!resultQuestion) return null; - const followNextForm = () => { - setShowResultForm(false); - setShowContactForm(true); - }; - console.log(resultQuestion); - if (resultQuestion === null || resultQuestion === undefined) { - followNextForm(); - return <>; - } else { return ( - - { - //@ts-ignore - !resultQuestion?.content.useImage && - resultQuestion.content.video && ( - - ) - } - { - //@ts-ignore - resultQuestion?.content.useImage && resultQuestion.content.back && ( - - ) - } - {resultQuestion.description !== "" && - resultQuestion.description !== " " && ( - - {resultQuestion.description} - - )} - - - {resultQuestion.title} - - - { - //@ts-ignore - resultQuestion.content.text !== "" && - //@ts-ignore - resultQuestion.content.text !== " " && ( - - { - //@ts-ignore - resultQuestion.content.text - } - - ) - } - - - - - - - - Сделано на PenaQuiz - - - - - - {settings?.cfg.resultInfo.showResultForm === "before" && ( - - )} - {settings?.cfg.resultInfo.showResultForm === "after" && - resultQuestion.content.redirect && ( - - )} - + {resultQuestion.title} + + + { + resultQuestion.content.text !== "" && + resultQuestion.content.text !== " " && ( + + { + resultQuestion.content.text + } + + ) + } + + + + + + + + Сделано на PenaQuiz + + + + + + {settings?.cfg.resultInfo.showResultForm === "before" && ( + + )} + {settings?.cfg.resultInfo.showResultForm === "after" && + resultQuestion.content.redirect && ( + + )} + + - ); - } }; diff --git a/src/pages/ViewPublicationPage/StartPageViewPublication.tsx b/src/pages/ViewPublicationPage/StartPageViewPublication.tsx index 2f26f42..9546093 100644 --- a/src/pages/ViewPublicationPage/StartPageViewPublication.tsx +++ b/src/pages/ViewPublicationPage/StartPageViewPublication.tsx @@ -1,473 +1,471 @@ import { Box, Button, ButtonBase, Link, Paper, Typography, useMediaQuery, useTheme } from "@mui/material"; import YoutubeEmbedIframe from "./tools/YoutubeEmbedIframe"; -import { QuizStartpageAlignType, QuizStartpageType } from "@model/quizSettings"; import { notReachable } from "../../utils/notReachable"; import { useUADevice } from "../../utils/hooks/useUADevice"; -import { useQuestionsStore } from "@stores/quizData/store"; + import { NameplateLogo } from "@icons/NameplateLogo"; -import { modes } from "../../utils/themes/Publication/themePublication"; +import { quizThemes } from "@utils/themes/Publication/themePublication"; +import { QuizStartpageAlignType, QuizStartpageType } from "@model/settingsData"; +import { useQuestionsStore } from "@stores/quizData/store"; interface Props { - setVisualStartPage: (a: boolean) => void; + setVisualStartPage: (a: boolean) => void; } export const StartPageViewPublication = ({ setVisualStartPage }: Props) => { - const theme = useTheme(); - const { settings } = useQuestionsStore() - const mode = modes; - const { isMobileDevice } = useUADevice(); - const isMobile = useMediaQuery(theme.breakpoints.down(650)); - const isTablet = useMediaQuery(theme.breakpoints.down(1000)); + const theme = useTheme(); + const { settings } = useQuestionsStore(); + const { isMobileDevice } = useUADevice(); + const isMobile = useMediaQuery(theme.breakpoints.down(650)); - if (!settings) return null; + if (!settings) throw new Error("settings is null"); - console.log(settings); + const handleCopyNumber = () => { + navigator.clipboard.writeText(settings.cfg.info.phonenumber); + }; - const handleCopyNumber = () => { - navigator.clipboard.writeText(settings.cfg.info.phonenumber); - }; - - const background = - settings.cfg.startpage.background.type === "image" ? ( - settings.cfg.startpage.background.desktop ? ( -
- ) : null - ) : settings.cfg.startpage.background.type === "video" ? ( - settings.cfg.startpage.background.video ? ( - - ) : null - ) : null; - - return ( - - - - {settings.cfg.startpage.logo && ( + const background = + settings.cfg.startpage.background.type === "image" ? ( + settings.cfg.startpage.background.desktop ? ( - )} - {settings.cfg.info.orgname} - - - - {settings.cfg.info.site} - - - - } - quizMainBlock={ - <> - - - {settings.name} - - - {settings.cfg.startpage.description} - - - - - + ) : null + ) : settings.cfg.startpage.background.type === "video" ? ( + settings.cfg.startpage.background.video ? ( + + ) : null + ) : null; - - - {settings.cfg.info.clickable ? ( - isMobileDevice ? ( - - - {settings.cfg.info.phonenumber} - - - ) : ( - - - {settings.cfg.info.phonenumber} - - - ) - ) : ( - - {settings.cfg.info.phonenumber} - - )} - - {settings.cfg.info.law} - - + return ( + - - - Сделано на PenaQuiz - - - - - } - backgroundBlock={background} - startpageType={settings.cfg.startpageType} - alignType={settings.cfg.startpage.position} - /> - - ); + color: settings.cfg.startpageType === "expanded" ? "white" : "black", + }} + > + + + {settings.cfg.startpage.logo && ( + + )} + {settings.cfg.info.orgname} + + + + {settings.cfg.info.site} + + + + } + quizMainBlock={ + <> + + + {settings.name} + + + {settings.cfg.startpage.description} + + + + + + + + + {settings.cfg.info.clickable ? ( + isMobileDevice ? ( + + + {settings.cfg.info.phonenumber} + + + ) : ( + + + {settings.cfg.info.phonenumber} + + + ) + ) : ( + + {settings.cfg.info.phonenumber} + + )} + + {settings.cfg.info.law} + + + + + + + Сделано на PenaQuiz + + + + + } + backgroundBlock={background} + startpageType={settings.cfg.startpageType} + alignType={settings.cfg.startpage.position} + /> + + ); }; function QuizPreviewLayoutByType({ - quizHeaderBlock, - quizMainBlock, - backgroundBlock, - startpageType, - alignType, + quizHeaderBlock, + quizMainBlock, + backgroundBlock, + startpageType, + alignType, }: { - quizHeaderBlock: JSX.Element; - quizMainBlock: JSX.Element; - backgroundBlock: JSX.Element | null; - startpageType: QuizStartpageType; - alignType: QuizStartpageAlignType; + quizHeaderBlock: JSX.Element; + quizMainBlock: JSX.Element; + backgroundBlock: JSX.Element | null; + startpageType: QuizStartpageType; + alignType: QuizStartpageAlignType; }) { - const theme = useTheme(); - const isMobile = useMediaQuery(theme.breakpoints.down(650)); - function StartPageMobile() { - return ( - - - {quizHeaderBlock} - - {quizMainBlock} - - - - {backgroundBlock} - - - ) - } - - - - switch (startpageType) { - case null: - case "standard": { - return ( - <> - {isMobile ? ( - - ) : ( + const theme = useTheme(); + const isMobile = useMediaQuery(theme.breakpoints.down(650)); + function StartPageMobile() { + return ( - - {quizHeaderBlock} - {quizMainBlock} - - - - {backgroundBlock} - - - )} - - - - ); - } - case "expanded": { - return ( - <> - {isMobile ? ( - - ) : ( - - - {quizHeaderBlock} - {quizMainBlock} - - - {backgroundBlock} - - - ) - } - - - ); - } - case "centered": { - return ( - <> - {isMobile ? ( - - ) : ( - - {quizHeaderBlock} - {backgroundBlock && ( - + - {backgroundBlock} + {quizHeaderBlock} + + {quizMainBlock} + + + + {backgroundBlock} - )} - {quizMainBlock} - ) - } - - - ); + ); + } + + + + switch (startpageType) { + case null: + case "standard": { + return ( + <> + {isMobile ? ( + + ) : ( + + + {quizHeaderBlock} + {quizMainBlock} + + + + {backgroundBlock} + + + )} + + + + ); + } + case "expanded": { + return ( + <> + {isMobile ? ( + + ) : ( + + + {quizHeaderBlock} + {quizMainBlock} + + + {backgroundBlock} + + + ) + } + + + ); + } + case "centered": { + return ( + <> + {isMobile ? ( + + ) : ( + + {quizHeaderBlock} + {backgroundBlock && ( + + {backgroundBlock} + + )} + {quizMainBlock} + + ) + } + + + ); + } + default: + notReachable(startpageType); } - default: - notReachable(startpageType); - } } const startpageAlignTypeToJustifyContent: Record = { - left: "start", - center: "center", - right: "end", + left: "start", + center: "center", + right: "end", }; diff --git a/src/pages/ViewPublicationPage/index.tsx b/src/pages/ViewPublicationPage/index.tsx index 4057d8a..6c9cc9b 100644 --- a/src/pages/ViewPublicationPage/index.tsx +++ b/src/pages/ViewPublicationPage/index.tsx @@ -1,123 +1,84 @@ +import { getData } from "@api/quizRelase"; +import { QuizSettings } from "@model/settingsData"; +import { Box, ThemeProvider } from "@mui/material"; +import { setQuizData } from "@stores/quizData/actions"; +import { useQuestionsStore } from "@stores/quizData/store"; +import LoadingSkeleton from "@ui_kit/LoadingSkeleton"; +import { quizThemes } from "@utils/themes/Publication/themePublication"; +import { enqueueSnackbar } from "notistack"; import { useEffect, useState } from "react"; -import { Box, Skeleton, ThemeProvider } from "@mui/material"; - -import { StartPageViewPublication } from "./StartPageViewPublication"; +import useSWR from "swr"; +import { ApologyPage } from "./ApologyPage"; import { Question } from "./Question"; -import { ApologyPage } from "./ApologyPage" - -import { useQuestionsStore } from "@stores/quizData/store" -import { getData } from "@api/quizRelase" - -import type { AnyTypedQuizQuestion } from "@model/questionTypes/shared"; -import { useGetSettings } from "../../utils/hooks/useGetSettings"; -import { themesPublication } from "../../utils/themes/Publication/themePublication"; +import { StartPageViewPublication } from "./StartPageViewPublication"; import { replaceSpacesToEmptyLines } from "./tools/replaceSpacesToEmptyLines"; +import { parseQuizData } from "@model/api/getQuizData"; const QID = - process.env.NODE_ENV === "production" ? - window.location.pathname.replace(/\//g, '') - : - "0bed8483-3016-4bca-b8e0-a72c3146f18b" + import.meta.env.PROD ? + window.location.pathname.replace(/\//g, '') + : + "0bed8483-3016-4bca-b8e0-a72c3146f18b"; export const ViewPage = () => { - const { settings, cnt, items } = useQuestionsStore() - console.log("КВИЗ ", settings) - console.log("ВОПРОСЫ ", items) + const { isLoading, error } = useSWR(["quizData", QID], params => getQuizData(params[1]), { + onSuccess: setQuizData, + }); + const { settings, items, recentlyСompleted } = useQuestionsStore(); + const [visualStartPage, setVisualStartPage] = useState(); + useEffect(() => {//установка фавиконки + if (!settings) return; - const [visualStartPage, setVisualStartPage] = useState(); - const [errormessage, setErrormessage] = useState(""); - - useEffect(() => { - async function get() { - try { - let data = await getData(QID) - - console.log(data) - //@ts-ignore - const settings = data.settings - - console.log(data) - //@ts-ignore - data.settings = { - //@ts-ignore - qid: QID, - fp: settings.fp, - rep: settings.rep, - name: settings.name, - //@ts-ignore - cfg: JSON.parse(data?.settings.cfg), - lim: settings.lim, - due: settings.due, - delay: settings.delay, - pausable: settings.pausable + const link = document.querySelector('link[rel="icon"]'); + if (link && settings.cfg.startpage.favIcon) { + link.setAttribute("href", settings?.cfg.startpage.favIcon); } - console.log(data) - //@ts-ignore - data.items = data.items.map((item) => { - const content = JSON.parse(item.c) - return { - description: item.desc, - id: item.id, - page: item.p, - required: item.req, - title: item.title, - type: item.typ, - content - } - }), - console.log(data) - console.log(JSON.stringify({data: data}).replaceAll(/\\\" \\\"/g, '""').replaceAll(/\" \"/g, '""')) - console.log(JSON.parse(JSON.stringify({data: data}).replaceAll(/\\\" \\\"/g, '""').replaceAll(/\" \"/g, '""')).data) - data = replaceSpacesToEmptyLines(data) + setVisualStartPage(!settings.cfg.noStartPage); + }, [settings]); - useQuestionsStore.setState(JSON.parse(JSON.stringify({data: data}).replaceAll(/\\\" \\\"/g, '""').replaceAll(/\" \"/g, '""')).data) + const questionsCount = items.filter(({ type }) => type !== null && type !== "result").length; - } catch (e) { - - //@ts-ignore - if (e?.response?.status === 423) setErrormessage("квиз не активирован") - } + if (error) { + console.log(error); + return ; } - get() - }, []) + if (isLoading || !settings) return ; + if (questionsCount === 0) return ; - - useEffect(() => {//установка фавиконки - if (Object.values(settings).length > 0) { - - const link = document.querySelector('link[rel="icon"]'); - if (link && settings?.cfg.startpage.favIcon) { - link.setAttribute("href", settings?.cfg.startpage.favIcon); - } - - setVisualStartPage(!settings?.cfg.noStartPage); - } - }, [settings]); - - - const filteredQuestions = ( - items.filter(({ type }) => type) as AnyTypedQuizQuestion[] - ).sort((previousItem, item) => previousItem.page - item.page); - - - if (errormessage) return - if (visualStartPage === undefined) return ; - if (cnt === 0 || (cnt === 1 && items[0].type === "result")) return - return ( - - - { - visualStartPage ? - - : - - } - - - - ); + return ( + + {recentlyСompleted ? ( + + ) : ( + + {visualStartPage ? ( + + ) : ( + + )} + + )} + + ); }; + +async function getQuizData(quizId: string) { + const response = await getData(quizId); + const quizDataResponse = response.data; + + if (response.error) { + enqueueSnackbar(response.error); + throw new Error(response.error); + } + if (!quizDataResponse) { + throw new Error("Quiz not found"); + } + + const quizSettings = replaceSpacesToEmptyLines(parseQuizData(quizDataResponse, quizId)); + + return JSON.parse(JSON.stringify({ data: quizSettings }).replaceAll(/\\" \\"/g, '""').replaceAll(/" "/g, '""')).data as QuizSettings & { recentlyСompleted: boolean; }; +} diff --git a/src/pages/ViewPublicationPage/questions/Date.tsx b/src/pages/ViewPublicationPage/questions/Date.tsx index 30c660e..1d457cd 100644 --- a/src/pages/ViewPublicationPage/questions/Date.tsx +++ b/src/pages/ViewPublicationPage/questions/Date.tsx @@ -1,7 +1,6 @@ import dayjs from "dayjs"; import { DatePicker } from "@mui/x-date-pickers"; import { Box, Typography, useTheme } from "@mui/material"; -import { modes } from "../../../utils/themes/Publication/themePublication"; import { useQuizViewStore, updateAnswer } from "@stores/quizView/store"; @@ -9,6 +8,8 @@ import type { QuizQuestionDate } from "../../../model/questionTypes/date"; import CalendarIcon from "@icons/CalendarIcon"; import { enqueueSnackbar } from "notistack"; import { sendAnswer } from "@api/quizRelase"; + +import { quizThemes } from "@utils/themes/Publication/themePublication"; import { useQuestionsStore } from "@stores/quizData/store"; type DateProps = { @@ -17,7 +18,6 @@ type DateProps = { export const Date = ({ currentQuestion }: DateProps) => { const theme = useTheme(); - const mode = modes; const { settings } = useQuestionsStore(); const { answers } = useQuizViewStore(); @@ -26,6 +26,8 @@ export const Date = ({ currentQuestion }: DateProps) => { )?.answer as string; const [day, month, year] = answer?.split(".") || []; + if (!settings) throw new Error("settings is null"); + return ( @@ -41,7 +43,6 @@ export const Date = ({ currentQuestion }: DateProps) => { > ( { day: "2-digit", } ), - //@ts-ignore qid: settings.qid, }); @@ -103,7 +103,7 @@ export const Date = ({ currentQuestion }: DateProps) => { }} sx={{ "& .MuiInputBase-root": { - backgroundColor: mode[settings.cfg.theme] + backgroundColor: quizThemes[settings.cfg.theme].isLight ? "white" : theme.palette.background.default, borderRadius: "10px", diff --git a/src/pages/ViewPublicationPage/questions/Emoji.tsx b/src/pages/ViewPublicationPage/questions/Emoji.tsx index 0f21b65..ff7ae23 100644 --- a/src/pages/ViewPublicationPage/questions/Emoji.tsx +++ b/src/pages/ViewPublicationPage/questions/Emoji.tsx @@ -1,24 +1,23 @@ import { - Box, - Typography, - RadioGroup, - FormControlLabel, - Radio, - useTheme, - FormControl, - useMediaQuery + Box, + FormControl, + FormControlLabel, + Radio, + RadioGroup, + Typography, + useTheme } from "@mui/material"; -import { modes } from "../../../utils/themes/Publication/themePublication"; -import { useQuizViewStore, updateAnswer, deleteAnswer } from "@stores/quizView/store"; +import { deleteAnswer, updateAnswer, useQuizViewStore } from "@stores/quizView/store"; import RadioCheck from "@ui_kit/RadioCheck"; import RadioIcon from "@ui_kit/RadioIcon"; -import type { QuizQuestionEmoji } from "../../../model/questionTypes/emoji"; -import { enqueueSnackbar } from "notistack"; import { sendAnswer } from "@api/quizRelase"; -import { useQuestionsStore } from "@stores/quizData/store" + +import { enqueueSnackbar } from "notistack"; +import type { QuizQuestionEmoji } from "../../../model/questionTypes/emoji"; +import { useQuestionsStore } from "@stores/quizData/store"; type EmojiProps = { currentQuestion: QuizQuestionEmoji; @@ -26,9 +25,7 @@ type EmojiProps = { export const Emoji = ({ currentQuestion }: EmojiProps) => { const theme = useTheme(); - const mode = modes; - const isMobile = useMediaQuery(theme.breakpoints.down(650)); const { settings } = useQuestionsStore() const { answers } = useQuizViewStore(); const { answer } = @@ -36,6 +33,8 @@ export const Emoji = ({ currentQuestion }: EmojiProps) => { ({ questionId }) => questionId === currentQuestion.id ) ?? {}; + if (!settings) throw new Error("settings is null"); + return ( {currentQuestion.title} @@ -45,7 +44,6 @@ export const Emoji = ({ currentQuestion }: EmojiProps) => { ({ id }) => answer === id )} onChange={({ target }) =>{ - console.log(currentQuestion.content.variants[Number(target.value)]) updateAnswer( currentQuestion.id, currentQuestion.content.variants[Number(target.value)].answer @@ -114,7 +112,6 @@ export const Emoji = ({ currentQuestion }: EmojiProps) => { await sendAnswer({ questionId: currentQuestion.id, body: currentQuestion.content.variants[index].answer, - //@ts-ignore qid: settings.qid }) @@ -136,7 +133,6 @@ export const Emoji = ({ currentQuestion }: EmojiProps) => { await sendAnswer({ questionId: currentQuestion.id, body: "", - //@ts-ignore qid: settings.qid }) @@ -147,7 +143,6 @@ export const Emoji = ({ currentQuestion }: EmojiProps) => { }} control={ - //@ts-ignore } icon={} /> } label={ diff --git a/src/pages/ViewPublicationPage/questions/File.tsx b/src/pages/ViewPublicationPage/questions/File.tsx index de84658..5f059de 100644 --- a/src/pages/ViewPublicationPage/questions/File.tsx +++ b/src/pages/ViewPublicationPage/questions/File.tsx @@ -23,7 +23,7 @@ type FileProps = { currentQuestion: QuizQuestionFile; }; -export const UPLOAD_FILE_DESCRIPTIONS_MAP: Record< +const UPLOAD_FILE_DESCRIPTIONS_MAP: Record< UploadFileType, { title: string; description: string } > = { @@ -49,6 +49,8 @@ export const File = ({ currentQuestion }: FileProps) => { const theme = useTheme(); const isMobile = useMediaQuery(theme.breakpoints.down(500)); const uploadFile = async ({ target }: ChangeEvent) => { + if (!settings) return; + const file = target.files?.[0]; if (file) { @@ -60,7 +62,6 @@ export const File = ({ currentQuestion }: FileProps) => { file: `${file.name}|${URL.createObjectURL(file)}`, name: file.name }, - //@ts-ignore qid: settings.qid }) diff --git a/src/pages/ViewPublicationPage/questions/Images.tsx b/src/pages/ViewPublicationPage/questions/Images.tsx index 27dc2a2..e962955 100644 --- a/src/pages/ViewPublicationPage/questions/Images.tsx +++ b/src/pages/ViewPublicationPage/questions/Images.tsx @@ -32,6 +32,8 @@ export const Images = ({ currentQuestion }: ImagesProps) => { const isTablet = useMediaQuery(theme.breakpoints.down(1000)); const isMobile = useMediaQuery(theme.breakpoints.down(500)); + if (!settings) throw new Error("settings is null"); + return ( {currentQuestion.title} @@ -77,7 +79,6 @@ export const Images = ({ currentQuestion }: ImagesProps) => { await sendAnswer({ questionId: currentQuestion.id, body: currentQuestion.content.variants[index].answer, - //@ts-ignore qid: settings.qid }) @@ -98,7 +99,6 @@ export const Images = ({ currentQuestion }: ImagesProps) => { await sendAnswer({ questionId: currentQuestion.id, body: "", - //@ts-ignore qid: settings.qid }) @@ -138,7 +138,6 @@ export const Images = ({ currentQuestion }: ImagesProps) => { }} value={index} control={ - //@ts-ignore } icon={} /> } label={variant.answer} diff --git a/src/pages/ViewPublicationPage/questions/Number.tsx b/src/pages/ViewPublicationPage/questions/Number.tsx index 4351efa..5760c03 100644 --- a/src/pages/ViewPublicationPage/questions/Number.tsx +++ b/src/pages/ViewPublicationPage/questions/Number.tsx @@ -10,218 +10,221 @@ import { useQuizViewStore, updateAnswer } from "@stores/quizView/store"; import type { QuizQuestionNumber } from "../../../model/questionTypes/number"; import { enqueueSnackbar } from "notistack"; import { sendAnswer } from "@api/quizRelase"; -import { useQuestionsStore } from "@stores/quizData/store" -import { modes } from "../../../utils/themes/Publication/themePublication"; + +import { quizThemes } from "@utils/themes/Publication/themePublication"; +import { useQuestionsStore } from "@stores/quizData/store"; type NumberProps = { - currentQuestion: QuizQuestionNumber; + currentQuestion: QuizQuestionNumber; }; export const Number = ({ currentQuestion }: NumberProps) => { - const { settings } = useQuestionsStore() - const [minRange, setMinRange] = useState("0"); - const [maxRange, setMaxRange] = useState("100000000000"); - const theme = useTheme(); - const { answers } = useQuizViewStore(); + const { settings } = useQuestionsStore() + const [minRange, setMinRange] = useState("0"); + const [maxRange, setMaxRange] = useState("100000000000"); + const theme = useTheme(); + const { answers } = useQuizViewStore(); - const isMobile = useMediaQuery(theme.breakpoints.down(650)); + const isMobile = useMediaQuery(theme.breakpoints.down(650)); - const updateMinRangeDebounced = useDebouncedCallback(async (value, crowded = false) => { - if (crowded) { - setMinRange(maxRange); - } + const updateMinRangeDebounced = useDebouncedCallback(async (value, crowded = false) => { + if (!settings) return null; + + if (crowded) { + setMinRange(maxRange); + } - try { + try { - await sendAnswer({ - questionId: currentQuestion.id, - body: value, - //@ts-ignore - qid: settings.qid - }) + await sendAnswer({ + questionId: currentQuestion.id, + body: value, + qid: settings.qid + }) - updateAnswer(currentQuestion.id, value); + updateAnswer(currentQuestion.id, value); - } catch (e) { - enqueueSnackbar("ответ не был засчитан") - } + } catch (e) { + enqueueSnackbar("ответ не был засчитан") + } - }, 1000); - const updateMaxRangeDebounced = useDebouncedCallback(async (value, crowded = false) => { - if (crowded) { - setMaxRange(minRange); - } - try { + }, 1000); + const updateMaxRangeDebounced = useDebouncedCallback(async (value, crowded = false) => { + if (!settings) return null; + + if (crowded) { + setMaxRange(minRange); + } + try { - await sendAnswer({ - questionId: currentQuestion.id, - body: value, - //@ts-ignore - qid: settings.qid - }) + await sendAnswer({ + questionId: currentQuestion.id, + body: value, + qid: settings.qid + }) - updateAnswer(currentQuestion.id, value); + updateAnswer(currentQuestion.id, value); - } catch (e) { - enqueueSnackbar("ответ не был засчитан") - } + } catch (e) { + enqueueSnackbar("ответ не был засчитан") + } - }, 1000); - const answer = answers.find(({ questionId }) => questionId === currentQuestion.id)?.answer as string; + }, 1000); + const answer = answers.find(({ questionId }) => questionId === currentQuestion.id)?.answer as string; - const mode = modes; - const min = window.Number(currentQuestion.content.range.split("—")[0]); - const max = window.Number(currentQuestion.content.range.split("—")[1]); - const sliderValue = answer || currentQuestion.content.start + "—" + max; + const min = window.Number(currentQuestion.content.range.split("—")[0]); + const max = window.Number(currentQuestion.content.range.split("—")[1]); + const sliderValue = answer || currentQuestion.content.start + "—" + max; - useEffect(() => { - if (answer) { - setMinRange(answer.split("—")[0]); - setMaxRange(answer.split("—")[1]); - } + useEffect(() => { + if (answer) { + setMinRange(answer.split("—")[0]); + setMaxRange(answer.split("—")[1]); + } - if (!answer) { - setMinRange(String(currentQuestion.content.start)); - setMaxRange(String(max)); - } - }, []); + if (!answer) { + setMinRange(String(currentQuestion.content.start)); + setMaxRange(String(max)); + } + }, []); - return ( - - {currentQuestion.title} - - 1 - ? sliderValue.split("—").map((item) => window.Number(item)) - : [min, min + 1] - : window.Number(sliderValue.split("—")[0]) - } - min={min} - max={max} - step={currentQuestion.content.step || 1} - onChange={async (_, value) => { + if (!settings) throw new Error("settings is null"); + + return ( + + {currentQuestion.title} + + 1 + ? sliderValue.split("—").map((item) => window.Number(item)) + : [min, min + 1] + : window.Number(sliderValue.split("—")[0]) + } + min={min} + max={max} + step={currentQuestion.content.step || 1} + onChange={async (_, value) => { - const range = String(value).replace(",", "—").replace (/\D/, ''); + const range = String(value).replace(",", "—").replace (/\D/, ''); - updateAnswer(currentQuestion.id, range); - updateMinRangeDebounced(range, true); + updateAnswer(currentQuestion.id, range); + updateMinRangeDebounced(range, true); - }} - onChangeCommitted={(_, value) => { - if (currentQuestion.content.chooseRange) { - const range = value as number[]; + }} + onChangeCommitted={(_, value) => { + if (currentQuestion.content.chooseRange) { + const range = value as number[]; - setMinRange(String(range[0])); - setMaxRange(String(range[1])); - } - }} - //@ts-ignore - sx={{ - color: theme.palette.primary.main, - "& .MuiSlider-valueLabel": { - background: theme.palette.primary.main, - } - }} - /> + setMinRange(String(range[0])); + setMaxRange(String(range[1])); + } + }} + sx={{ + color: theme.palette.primary.main, + "& .MuiSlider-valueLabel": { + background: theme.palette.primary.main, + } + }} + /> - {!currentQuestion.content.chooseRange && ( - { - updateMinRangeDebounced(window.Number(target.value.replace (/\D/, '')) > max - ? String(max) - : window.Number(target.value) < min - ? String(min) - : target.value, true); - }} - sx={{ - maxWidth: "80px", - borderColor: theme.palette.text.primary, - "& .MuiInputBase-input": { - textAlign: "center", - backgroundColor: mode[settings.cfg.theme] ? "white" : theme.palette.background.default, - }, - }} - /> - )} + {!currentQuestion.content.chooseRange && ( + { + updateMinRangeDebounced(window.Number(target.value.replace (/\D/, '')) > max + ? String(max) + : window.Number(target.value) < min + ? String(min) + : target.value, true); + }} + sx={{ + maxWidth: "80px", + borderColor: theme.palette.text.primary, + "& .MuiInputBase-input": { + textAlign: "center", + backgroundColor: quizThemes[settings.cfg.theme].isLight ? "white" : theme.palette.background.default, + }, + }} + /> + )} - {currentQuestion.content.chooseRange && ( - - { - setMinRange(target.value.replace (/\D/, '')); + {currentQuestion.content.chooseRange && ( + + { + setMinRange(target.value.replace (/\D/, '')); - if (window.Number(target.value) >= window.Number(maxRange)) { - updateMinRangeDebounced(`${maxRange}—${maxRange}`, true); + if (window.Number(target.value) >= window.Number(maxRange)) { + updateMinRangeDebounced(`${maxRange}—${maxRange}`, true); - return; - } + return; + } - updateMinRangeDebounced(`${target.value}—${maxRange}`); - }} - sx={{ - maxWidth: "80px", - borderColor: theme.palette.text.primary, - "& .MuiInputBase-input": { - textAlign: "center", - backgroundColor: mode[settings.cfg.theme] ? "white" : theme.palette.background.default, - }, - }} - /> - до - { - setMaxRange(target.value.replace (/\D/, '')); + updateMinRangeDebounced(`${target.value}—${maxRange}`); + }} + sx={{ + maxWidth: "80px", + borderColor: theme.palette.text.primary, + "& .MuiInputBase-input": { + textAlign: "center", + backgroundColor: quizThemes[settings.cfg.theme].isLight ? "white" : theme.palette.background.default, + }, + }} + /> + до + { + setMaxRange(target.value.replace (/\D/, '')); - if (window.Number(target.value) <= window.Number(minRange)) { - updateMaxRangeDebounced(`${minRange}—${minRange}`, true); + if (window.Number(target.value) <= window.Number(minRange)) { + updateMaxRangeDebounced(`${minRange}—${minRange}`, true); - return; - } + return; + } - updateMaxRangeDebounced(`${minRange}—${target.value}`); - }} - sx={{ - maxWidth: "80px", - borderColor: theme.palette.text.primary, - "& .MuiInputBase-input": { - textAlign: "center", - backgroundColor: mode[settings.cfg.theme] ? "white" : theme.palette.background.default, - }, - }} - /> - - )} - - - ); + updateMaxRangeDebounced(`${minRange}—${target.value}`); + }} + sx={{ + maxWidth: "80px", + borderColor: theme.palette.text.primary, + "& .MuiInputBase-input": { + textAlign: "center", + backgroundColor: quizThemes[settings.cfg.theme].isLight ? "white" : theme.palette.background.default, + }, + }} + /> + + )} + + + ); }; diff --git a/src/pages/ViewPublicationPage/questions/Rating.tsx b/src/pages/ViewPublicationPage/questions/Rating.tsx index 9c2497f..e45c023 100644 --- a/src/pages/ViewPublicationPage/questions/Rating.tsx +++ b/src/pages/ViewPublicationPage/questions/Rating.tsx @@ -69,6 +69,8 @@ export const Rating = ({ currentQuestion }: RatingProps) => { ({ name }) => name === currentQuestion.content.form ); + if (!settings) throw new Error("settings is null"); + return ( {currentQuestion.title} @@ -98,7 +100,6 @@ export const Rating = ({ currentQuestion }: RatingProps) => { await sendAnswer({ questionId: currentQuestion.id, body: String(value), - //@ts-ignore qid: settings.qid }) diff --git a/src/pages/ViewPublicationPage/questions/Select.tsx b/src/pages/ViewPublicationPage/questions/Select.tsx index 1b75bc0..f990c5b 100644 --- a/src/pages/ViewPublicationPage/questions/Select.tsx +++ b/src/pages/ViewPublicationPage/questions/Select.tsx @@ -23,6 +23,8 @@ export const Select = ({ currentQuestion }: SelectProps) => { ({ questionId }) => questionId === currentQuestion.id ) ?? {}; + if (!settings) throw new Error("settings is null"); + return ( {currentQuestion.title} @@ -38,10 +40,7 @@ export const Select = ({ currentQuestion }: SelectProps) => { placeholder={currentQuestion.content.default} activeItemIndex={answer ? Number(answer) : -1} items={currentQuestion.content.variants.map(({ answer }) => answer)} - //@ts-ignore colorMain={theme.palette.primary.main} - //@ts-ignore - color={theme.palette.primary.main} onChange={async(_, value) => { if (value < 0) { deleteAnswer(currentQuestion.id); @@ -50,7 +49,6 @@ export const Select = ({ currentQuestion }: SelectProps) => { await sendAnswer({ questionId: currentQuestion.id, body: "", - //@ts-ignore qid: settings.qid }) @@ -65,7 +63,6 @@ export const Select = ({ currentQuestion }: SelectProps) => { await sendAnswer({ questionId: currentQuestion.id, body: String(currentQuestion.content.variants[Number(value)].answer), - //@ts-ignore qid: settings.qid }) diff --git a/src/pages/ViewPublicationPage/questions/Text.tsx b/src/pages/ViewPublicationPage/questions/Text.tsx index 195e124..5609f07 100644 --- a/src/pages/ViewPublicationPage/questions/Text.tsx +++ b/src/pages/ViewPublicationPage/questions/Text.tsx @@ -21,12 +21,13 @@ export const Text = ({ currentQuestion }: TextProps) => { const { answer } = answers.find(({ questionId }) => questionId === currentQuestion.id) ?? {}; const inputHC = useDebouncedCallback(async (text) => { + if (!settings) return; + try { await sendAnswer({ questionId: currentQuestion.id, body: text, - //@ts-ignore qid: settings.qid }) diff --git a/src/pages/ViewPublicationPage/questions/Variant.tsx b/src/pages/ViewPublicationPage/questions/Variant.tsx index 1b59084..0a46d0e 100644 --- a/src/pages/ViewPublicationPage/questions/Variant.tsx +++ b/src/pages/ViewPublicationPage/questions/Variant.tsx @@ -1,249 +1,245 @@ -import { useEffect } from "react"; import { - Box, - Typography, - RadioGroup, - FormGroup, - FormControlLabel, - Radio, - Checkbox, - TextField, - useTheme, + Box, + Checkbox, + FormControlLabel, + FormGroup, + Radio, + RadioGroup, + TextField as MuiTextField, + Typography, + useTheme, + TextFieldProps, } from "@mui/material"; +import { FC, useEffect } from "react"; import { - useQuizViewStore, - updateAnswer, - deleteAnswer, - updateOwnVariant, - deleteOwnVariant, + deleteAnswer, + updateAnswer, + updateOwnVariant, + useQuizViewStore } from "@stores/quizView/store"; +import { CheckboxIcon } from "@icons/Checkbox"; import RadioCheck from "@ui_kit/RadioCheck"; import RadioIcon from "@ui_kit/RadioIcon"; -import { CheckboxIcon } from "@icons/Checkbox"; -import type { QuizQuestionVariant } from "../../../model/questionTypes/variant"; -import type { QuestionVariant } from "../../../model/questionTypes/shared"; -import { enqueueSnackbar } from "notistack"; import { sendAnswer } from "@api/quizRelase"; -import { useQuestionsStore } from "@stores/quizData/store" -import { modes } from "../../../utils/themes/Publication/themePublication"; + +import { quizThemes } from "@utils/themes/Publication/themePublication"; +import { enqueueSnackbar } from "notistack"; +import type { QuestionVariant } from "../../../model/questionTypes/shared"; +import type { QuizQuestionVariant } from "../../../model/questionTypes/variant"; +import { useQuestionsStore } from "@stores/quizData/store"; + +const TextField = MuiTextField as unknown as FC; type VariantProps = { - stepNumber: number; - currentQuestion: QuizQuestionVariant; + currentQuestion: QuizQuestionVariant; }; type VariantItemProps = { - currentQuestion: QuizQuestionVariant; - variant: QuestionVariant; - answer: string | string[] | undefined; - index: number; - own?: boolean; + currentQuestion: QuizQuestionVariant; + variant: QuestionVariant; + answer: string | string[] | undefined; + index: number; + own?: boolean; }; export const Variant = ({ currentQuestion }: VariantProps) => { - const { settings } = useQuestionsStore() - const { answers, ownVariants } = useQuizViewStore(); - const mode = modes; - const { answer } = - answers.find( - ({ questionId }) => questionId === currentQuestion.id - ) ?? {}; - const ownVariant = ownVariants.find( - (variant) => variant.id === currentQuestion.id - ); + const theme = useTheme(); + const { answers, ownVariants } = useQuizViewStore(); + const { answer } = + answers.find( + ({ questionId }) => questionId === currentQuestion.id + ) ?? {}; + const ownVariant = ownVariants.find( + (variant) => variant.id === currentQuestion.id + ); - const Group = currentQuestion.content.multi ? FormGroup : RadioGroup; + const Group = currentQuestion.content.multi ? FormGroup : RadioGroup; - useEffect(() => { - if (!ownVariant) { - updateOwnVariant(currentQuestion.id, ""); - } - }, []); + useEffect(() => { + if (!ownVariant) { + updateOwnVariant(currentQuestion.id, ""); + } + }, []); - const theme = useTheme(); - return ( - - {currentQuestion.title} - - answer === id - )} - sx={{ - display: "flex", - flexWrap: "wrap", - flexDirection: "row", - justifyContent: "space-between", - flexBasis: "100%", - marginTop: "20px", - }} - > - - {currentQuestion.content.variants.map((variant, index) => ( - - ))} - {currentQuestion.content.own && ownVariant && ( - - )} - - - {currentQuestion.content.back && currentQuestion.content.back !== " " && ( - - - - )} - - - ); + return ( + + {currentQuestion.title} + + answer === id + )} + sx={{ + display: "flex", + flexWrap: "wrap", + flexDirection: "row", + justifyContent: "space-between", + flexBasis: "100%", + marginTop: "20px", + }} + > + + {currentQuestion.content.variants.map((variant, index) => ( + + ))} + {currentQuestion.content.own && ownVariant && ( + + )} + + + {currentQuestion.content.back && currentQuestion.content.back !== " " && ( + + + + )} + + + ); }; const VariantItem = ({ - currentQuestion, - variant, - answer, - index, - own = false, + currentQuestion, + variant, + answer, + index, + own = false, }: VariantItemProps) => { - const { settings } = useQuestionsStore() - const theme = useTheme(); - const mode = modes; + const { settings } = useQuestionsStore() + const theme = useTheme(); - return ( - } - icon={} - /> - ) : - //@ts-ignore - (} icon={} /> - ) - } - //@ts-ignore - label={own ? : variant.answer} - onClick={async (event) => { - event.preventDefault(); - const variantId = currentQuestion.content.variants[index].id; + if (!settings) throw new Error("settings is null"); - if (currentQuestion.content.multi) { - const currentAnswer = typeof answer !== "string" ? answer || [] : []; + return ( + } + icon={} + /> + : + } icon={} /> + } + label={own ? : variant.answer} + onClick={async (event) => { + event.preventDefault(); + const variantId = currentQuestion.content.variants[index].id; - try { + if (currentQuestion.content.multi) { + const currentAnswer = typeof answer !== "string" ? answer || [] : []; - await sendAnswer({ - questionId: currentQuestion.id, - body: currentAnswer.includes(variantId) - ? currentAnswer?.filter((item) => item !== variantId) - : [...currentAnswer, variantId], - //@ts-ignore - qid: settings.qid - }) + try { - updateAnswer( - currentQuestion.id, - currentAnswer.includes(variantId) - ? currentAnswer?.filter((item) => item !== variantId) - : [...currentAnswer, variantId] - ); + await sendAnswer({ + questionId: currentQuestion.id, + body: currentAnswer.includes(variantId) + ? currentAnswer?.filter((item) => item !== variantId) + : [...currentAnswer, variantId], + qid: settings.qid + }) - } catch (e) { - enqueueSnackbar("ответ не был засчитан") - } + updateAnswer( + currentQuestion.id, + currentAnswer.includes(variantId) + ? currentAnswer?.filter((item) => item !== variantId) + : [...currentAnswer, variantId] + ); + + } catch (e) { + enqueueSnackbar("ответ не был засчитан") + } - return; - } + return; + } - try { + try { - await sendAnswer({ - questionId: currentQuestion.id, - body: currentQuestion.content.variants[index].answer, - //@ts-ignore - qid: settings.qid - }) + await sendAnswer({ + questionId: currentQuestion.id, + body: currentQuestion.content.variants[index].answer, + qid: settings.qid + }) - updateAnswer(currentQuestion.id, variantId); + updateAnswer(currentQuestion.id, variantId); - } catch (e) { - enqueueSnackbar("ответ не был засчитан") - } + } catch (e) { + enqueueSnackbar("ответ не был засчитан") + } - if (answer === variantId) { - try { + if (answer === variantId) { + try { - await sendAnswer({ - questionId: currentQuestion.id, - body: "", - //@ts-ignore - qid: settings.qid - }) + await sendAnswer({ + questionId: currentQuestion.id, + body: "", + qid: settings.qid + }) - } catch (e) { - enqueueSnackbar("ответ не был засчитан") - } - deleteAnswer(currentQuestion.id); - } - }} + } catch (e) { + enqueueSnackbar("ответ не был засчитан") + } + deleteAnswer(currentQuestion.id); + } + }} - /> - ); + /> + ); }; diff --git a/src/pages/ViewPublicationPage/questions/Varimg.tsx b/src/pages/ViewPublicationPage/questions/Varimg.tsx index 66504cf..bf5eb1a 100644 --- a/src/pages/ViewPublicationPage/questions/Varimg.tsx +++ b/src/pages/ViewPublicationPage/questions/Varimg.tsx @@ -7,7 +7,6 @@ import { useTheme, useMediaQuery } from "@mui/material"; -import { modes } from "../../../utils/themes/Publication/themePublication"; import gag from "./gag.png" @@ -20,6 +19,7 @@ import RadioIcon from "@ui_kit/RadioIcon"; import type { QuizQuestionVarImg } from "../../../model/questionTypes/varimg"; import { enqueueSnackbar } from "notistack"; import { sendAnswer } from "@api/quizRelase"; +import { quizThemes } from "@utils/themes/Publication/themePublication"; type VarimgProps = { currentQuestion: QuizQuestionVarImg; @@ -30,7 +30,7 @@ export const Varimg = ({ currentQuestion }: VarimgProps) => { const { answers } = useQuizViewStore(); const theme = useTheme(); const isMobile = useMediaQuery(theme.breakpoints.down(650)); - const mode = modes; + const { answer } = answers.find( ({ questionId }) => questionId === currentQuestion.id @@ -38,6 +38,9 @@ export const Varimg = ({ currentQuestion }: VarimgProps) => { const variant = currentQuestion.content.variants.find( ({ id }) => answer === id ); + + if (!settings) throw new Error("settings is null"); + return ( {currentQuestion.title} @@ -70,7 +73,7 @@ export const Varimg = ({ currentQuestion }: VarimgProps) => { borderRadius: "5px", padding: "15px", color: theme.palette.text.primary, - backgroundColor: mode[settings.cfg.theme] ? "white" : theme.palette.background.default, + backgroundColor: quizThemes[settings.cfg.theme].isLight ? "white" : theme.palette.background.default, border: `1px solid`, borderColor: answer === variant.id ? theme.palette.primary.main : "#9A9AAF", display: "flex", @@ -82,15 +85,14 @@ export const Varimg = ({ currentQuestion }: VarimgProps) => { value={index} onClick={async(event) => { event.preventDefault(); - + try { - + await sendAnswer({ questionId: currentQuestion.id, body: currentQuestion.content.variants[index].answer, - //@ts-ignore qid: settings.qid }) @@ -98,11 +100,11 @@ export const Varimg = ({ currentQuestion }: VarimgProps) => { currentQuestion.id, currentQuestion.content.variants[index].id ); - + } catch (e) { enqueueSnackbar("ответ не был засчитан") } - + if (answer === currentQuestion.content.variants[index].id) { try { @@ -110,7 +112,6 @@ export const Varimg = ({ currentQuestion }: VarimgProps) => { await sendAnswer({ questionId: currentQuestion.id, body: "", - //@ts-ignore qid: settings.qid }) @@ -121,7 +122,6 @@ export const Varimg = ({ currentQuestion }: VarimgProps) => { } }} control={ - //@ts-ignore } icon={} /> } label={variant.answer} diff --git a/src/stores/quizData/actions.ts b/src/stores/quizData/actions.ts index 8c6f94b..17f826a 100644 --- a/src/stores/quizData/actions.ts +++ b/src/stores/quizData/actions.ts @@ -1,9 +1,12 @@ import { AnyTypedQuizQuestion } from "@model/questionTypes/shared"; import { useQuestionsStore } from "./store"; +import { QuizSettings } from "@model/settingsData"; -export const getQuestionById = (questionId: string | null):AnyTypedQuizQuestion | null => { +export const getQuestionById = (questionId: string | null): AnyTypedQuizQuestion | null => { if (questionId === null) return null; - //@ts-ignore + return useQuestionsStore.getState().items.find(q => q.id === questionId || q.content.id === questionId) || null; -}; \ No newline at end of file +}; + +export const setQuizData = (quizData: QuizSettings) => useQuestionsStore.setState(quizData); diff --git a/src/stores/quizData/store.ts b/src/stores/quizData/store.ts index cfed6dc..88f530b 100644 --- a/src/stores/quizData/store.ts +++ b/src/stores/quizData/store.ts @@ -1,25 +1,29 @@ -import { AnyTypedQuizQuestion } from "@model/questionTypes/shared"; -import { Settings, QuestionsStore } from "@model/settingsData"; -import { QuizConfig } from "@model/quizSettings"; +import { QuizSettings } from "@model/settingsData"; import { create } from "zustand"; import { devtools } from "zustand/middleware"; -const initialState: QuestionsStore = { - //@ts-ignore - settings: {}, - //@ts-ignore - items: [], - cnt: 0 + +type QuizDataStore = { + settings: QuizSettings["settings"] | null; + items: QuizSettings["items"]; + cnt: QuizSettings["cnt"]; + recentlyСompleted: boolean; }; -export const useQuestionsStore = create()( +const initialState: QuizDataStore = { + settings: null, + items: [], + cnt: 0, + recentlyСompleted: false, +}; + +export const useQuestionsStore = create()( devtools( () => initialState, { - name: "QuestionsStore", - enabled: process.env.NODE_ENV === "development", - trace: process.env.NODE_ENV === "development", - actionsBlacklist: "ignored", + name: "QuizDataStore", + enabled: import.meta.env.DEV, + trace: import.meta.env.DEV, } ) ); diff --git a/src/stores/quizView/store.ts b/src/stores/quizView/store.ts index 3c5d477..919b35e 100644 --- a/src/stores/quizView/store.ts +++ b/src/stores/quizView/store.ts @@ -1,95 +1,92 @@ +import { QuestionVariant } from "@model/questionTypes/shared"; +import { produce } from "immer"; +import { nanoid } from "nanoid"; import { create } from "zustand"; import { devtools } from "zustand/middleware"; - type Answer = { - questionId: string; - answer: string | string[]; + questionId: string; + answer: string | string[]; }; type OwnVariant = { - id: string; - variant: any; + id: string; + variant: QuestionVariant; }; interface QuizViewStore { - answers: Answer[]; - ownVariants: OwnVariant[]; + answers: Answer[]; + ownVariants: OwnVariant[]; } export const useQuizViewStore = create()( - devtools( - (set, get) => ({ - answers: [], - ownVariants: [], - }), - { - name: "quizView", - } - ) + devtools( + (set, get) => ({ + answers: [], + ownVariants: [], + }), + { + name: "quizView", + enabled: import.meta.env.DEV, + trace: import.meta.env.DEV, + } + ) ); -export const updateAnswer = (questionId: string, answer: string | string[]) => { - const answers = [...useQuizViewStore.getState().answers]; - const answerIndex = answers.findIndex( - (answer) => questionId === answer.questionId - ); - - if (answerIndex < 0) { - answers.push({ questionId, answer }); - } else { - answers[answerIndex] = { questionId, answer }; - } - - useQuizViewStore.setState({ answers }); -}; - -export const deleteAnswer = (questionId: string) => { - const answers = [...useQuizViewStore.getState().answers]; - const filteredItems = answers.filter( - (answer) => questionId !== answer.questionId - ); - - useQuizViewStore.setState({ answers: filteredItems }); -}; - -export const updateOwnVariant = (id: string, answer: string) => { - const ownVariants = [...useQuizViewStore.getState().ownVariants]; - const ownVariantIndex = ownVariants.findIndex( - (variant) => variant.id === id - ); - - if (ownVariantIndex < 0) { - ownVariants.push({ - id, - variant: { - id: getRandom(), - answer, - extendedText: "", - hints: "", - originalImageUrl: "", - }, - }); - } else { - ownVariants[ownVariantIndex].variant.answer = answer; - } - - useQuizViewStore.setState({ ownVariants }); -}; - -export const deleteOwnVariant = (id: string) => { - const ownVariants = [...useQuizViewStore.getState().ownVariants]; - - const filteredOwnVariants = ownVariants.filter( - (variant) => variant.id !== id - ); - - useQuizViewStore.setState({ ownVariants: filteredOwnVariants }); -}; - -function getRandom() { - const min = Math.ceil(1000000); - const max = Math.floor(10000000); - - return String(Math.floor(Math.random() * (max - min)) + min); +function setProducedState( + recipe: (state: QuizViewStore) => void, + action: A, +) { + useQuizViewStore.setState(state => produce(state, recipe), false, action); } + +export const updateAnswer = (questionId: string, answer: string | string[]) => setProducedState(state => { + const index = state.answers.findIndex(answer => questionId === answer.questionId); + + if (index < 0) { + state.answers.push({ questionId, answer }); + } else { + state.answers[index] = { questionId, answer }; + } +}, { + type: "updateAnswer", + questionId, + answer +}); + +export const deleteAnswer = (questionId: string) => useQuizViewStore.setState(state => ({ + answers: state.answers.filter(answer => questionId !== answer.questionId) +}), false, { + type: "deleteAnswer", + questionId +}); + +export const updateOwnVariant = (id: string, answer: string) => setProducedState(state => { + const index = state.ownVariants.findIndex((variant) => variant.id === id); + + if (index < 0) { + state.ownVariants.push({ + id, + variant: { + id: nanoid(), + answer, + extendedText: "", + hints: "", + originalImageUrl: "", + }, + }); + } else { + state.ownVariants[index].variant.answer = answer; + } +}, { + type: "updateOwnVariant", + id, + answer +}); + +export const deleteOwnVariant = (id: string) => useQuizViewStore.setState(state => ({ + ownVariants: state.ownVariants.filter((variant) => variant.id !== id) +}), false, { + type: "deleteOwnVariant", + id +}); diff --git a/src/ui_kit/CustomCheckbox.tsx b/src/ui_kit/CustomCheckbox.tsx index e264379..1937936 100755 --- a/src/ui_kit/CustomCheckbox.tsx +++ b/src/ui_kit/CustomCheckbox.tsx @@ -1,4 +1,4 @@ -import { FormControlLabel, Checkbox, useTheme, Box, useMediaQuery } from "@mui/material"; +import { Checkbox, FormControlLabel } from "@mui/material"; import React from "react"; import { CheckboxIcon } from "@icons/Checkbox"; @@ -15,8 +15,6 @@ interface Props { } export default function CustomCheckbox({ label, handleChange, checked, sx, dataCy, colorIcon }: Props) { - const theme = useTheme(); - const isMobile = useMediaQuery(theme.breakpoints.down(790)); return ( } - //@ts-ignore checkedIcon={} onChange={handleChange} checked={checked} diff --git a/src/ui_kit/LoadingSkeleton.tsx b/src/ui_kit/LoadingSkeleton.tsx new file mode 100644 index 0000000..813df2f --- /dev/null +++ b/src/ui_kit/LoadingSkeleton.tsx @@ -0,0 +1,17 @@ +import { Skeleton } from "@mui/material"; + + +export default function LoadingSkeleton() { + + return ( + + ); +} diff --git a/src/utils/themes/Publication/themePublication.ts b/src/utils/themes/Publication/themePublication.ts index 3c1a499..9ba9c3c 100644 --- a/src/utils/themes/Publication/themePublication.ts +++ b/src/utils/themes/Publication/themePublication.ts @@ -1,7 +1,6 @@ -import { createTheme } from "@mui/material"; +import { QuizTheme } from "@model/settingsData"; +import { Theme, createTheme } from "@mui/material"; import themePublic from "./genericPublication"; -import theme from "../generic"; - const StandardTheme = createTheme({ @@ -224,30 +223,16 @@ const BlueDarkTheme = createTheme({ } }) -export const modes = { - StandardTheme: true, - StandardDarkTheme: false, - PinkTheme: true, - PinkDarkTheme: false, - BlackWhiteTheme: true, - OliveTheme: true, - YellowTheme: true, - GoldDarkTheme: false, - PurpleTheme: true, - BlueTheme: true, - BlueDarkTheme: false -} - -export const themesPublication = { - StandardTheme, - StandardDarkTheme, - PinkTheme, - PinkDarkTheme, - BlackWhiteTheme, - OliveTheme, - YellowTheme, - GoldDarkTheme, - PurpleTheme, - BlueTheme, - BlueDarkTheme, -} \ No newline at end of file +export const quizThemes: Record = { + StandardTheme: { theme: StandardTheme, isLight: true }, + StandardDarkTheme: { theme: StandardDarkTheme, isLight: false }, + PinkTheme: { theme: PinkTheme, isLight: true }, + PinkDarkTheme: { theme: PinkDarkTheme, isLight: false }, + BlackWhiteTheme: { theme: BlackWhiteTheme, isLight: true }, + OliveTheme: { theme: OliveTheme, isLight: true }, + YellowTheme: { theme: YellowTheme, isLight: true }, + GoldDarkTheme: { theme: GoldDarkTheme, isLight: false }, + PurpleTheme: { theme: PurpleTheme, isLight: true }, + BlueTheme: { theme: BlueTheme, isLight: true }, + BlueDarkTheme: { theme: BlueDarkTheme, isLight: false }, +}; From 096977b57ce0cc915c0946447e07970c285ffe54 Mon Sep 17 00:00:00 2001 From: nflnkr <105123049+nflnkr@users.noreply.github.com> Date: Wed, 31 Jan 2024 15:06:32 +0300 Subject: [PATCH 12/81] Revert "set build output dir to "build" instead of "dist"" This reverts commit 8809ea77090bb47b68e513c4892b9b27e5796242. --- .dockerignore | 2 +- .gitignore | 2 +- vite.config.ts | 3 --- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.dockerignore b/.dockerignore index 83df8c7..b0542ba 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,4 @@ -/build +/dist /widget Makefile README.md diff --git a/.gitignore b/.gitignore index 9ec1c51..e698ff5 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,7 @@ pnpm-debug.log* lerna-debug.log* node_modules -build +dist dist-ssr widget *.local diff --git a/vite.config.ts b/vite.config.ts index 61fdf4f..a12f50d 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -19,7 +19,4 @@ export default defineConfig({ define: { "process.env": process.env, }, - build: { - outDir: "build", - }, }); From 3f43b1bfaabb3f06c04fc3a1fb6e87b5a941c1cc Mon Sep 17 00:00:00 2001 From: nflnkr <105123049+nflnkr@users.noreply.github.com> Date: Wed, 31 Jan 2024 17:39:50 +0300 Subject: [PATCH 13/81] add quizId as App prop and widget param --- src/App.tsx | 16 ++++++++++------ src/pages/ViewPublicationPage/index.tsx | 14 +++++--------- src/widget.tsx | 8 +++++--- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index e31e57d..52fd02e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -9,14 +9,18 @@ import { ViewPage } from "./pages/ViewPublicationPage"; import lightTheme from "./utils/themes/light"; +const defaultQuizId = "ef836ff8-35b1-4031-9acf-af5766bac2b2"; + moment.locale("ru"); const localeText = ruRU.components.MuiLocalizationProvider.defaultProps.localeText; interface Props { widget?: boolean; + quizId?: string; } -export default function App({ widget = false }: Props) { +export default function App({ widget = false, quizId }: Props) { + quizId ??= defaultQuizId; return ( - {widget ? + {widget ? ( - + - : + ) : ( - + - } + )} diff --git a/src/pages/ViewPublicationPage/index.tsx b/src/pages/ViewPublicationPage/index.tsx index 47e9727..1ba5bab 100644 --- a/src/pages/ViewPublicationPage/index.tsx +++ b/src/pages/ViewPublicationPage/index.tsx @@ -12,19 +12,15 @@ import { ApologyPage } from "./ApologyPage"; import { Question } from "./Question"; import { StartPageViewPublication } from "./StartPageViewPublication"; - import { parseQuizData } from "@model/api/getQuizData"; import { replaceSpacesToEmptyLines } from "./tools/replaceSpacesToEmptyLines"; -const QID = - import.meta.env.PROD ? - window.location.pathname.replace(/\//g, '') - : - "ef836ff8-35b1-4031-9acf-af5766bac2b2"; +type Props = { + quizId: string; +}; - -export const ViewPage = () => { - const { isLoading, error } = useSWR(["quizData", QID], params => getQuizData(params[1]), { +export const ViewPage = ({ quizId }: Props) => { + const { isLoading, error } = useSWR(["quizData", quizId], params => getQuizData(params[1]), { onSuccess: setQuizData, }); const { settings, items, recentlyСompleted } = useQuestionsStore(); diff --git a/src/widget.tsx b/src/widget.tsx index 7e9052d..f15b706 100644 --- a/src/widget.tsx +++ b/src/widget.tsx @@ -5,15 +5,16 @@ import App from "./App"; let root: Root | undefined = undefined; const widget = { - create({ selector }: { + create({ selector, quizId }: { selector: string; + quizId: string; }) { const element = document.getElementById(selector); if (!element) throw new Error("Element for widget doesn't exist"); root = createRoot(element); - root.render(); + root.render(); }, unmount() { if (root) root.unmount(); @@ -27,7 +28,8 @@ export default widget; import widget from ".../widget.js"; widget.create({ - selector: "widget-container" + selector: "widget-container", + quizId: "...", }) */ From a8b32e6aad493f2a1bceeca5f4d226f0fa1b6853 Mon Sep 17 00:00:00 2001 From: nflnkr <105123049+nflnkr@users.noreply.github.com> Date: Wed, 31 Jan 2024 17:58:16 +0300 Subject: [PATCH 14/81] build widget js file --- pub.js | 223 +++++++++++++++++- .../ViewPublicationPage/questions/Variant.tsx | 2 + 2 files changed, 224 insertions(+), 1 deletion(-) diff --git a/pub.js b/pub.js index f192725..33c31c0 100644 --- a/pub.js +++ b/pub.js @@ -1 +1,222 @@ -console.log("PEHA NUB") +function A4(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function Cd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var u5={exports:{}},bd={},d5={exports:{}},Be={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Vl=Symbol.for("react.element"),L4=Symbol.for("react.portal"),j4=Symbol.for("react.fragment"),N4=Symbol.for("react.strict_mode"),V4=Symbol.for("react.profiler"),z4=Symbol.for("react.provider"),B4=Symbol.for("react.context"),W4=Symbol.for("react.forward_ref"),H4=Symbol.for("react.suspense"),U4=Symbol.for("react.memo"),Y4=Symbol.for("react.lazy"),Rg=Symbol.iterator;function G4(e){return e===null||typeof e!="object"?null:(e=Rg&&e[Rg]||e["@@iterator"],typeof e=="function"?e:null)}var f5={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p5=Object.assign,h5={};function Ks(e,t,n){this.props=e,this.context=t,this.refs=h5,this.updater=n||f5}Ks.prototype.isReactComponent={};Ks.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ks.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function m5(){}m5.prototype=Ks.prototype;function a0(e,t,n){this.props=e,this.context=t,this.refs=h5,this.updater=n||f5}var l0=a0.prototype=new m5;l0.constructor=a0;p5(l0,Ks.prototype);l0.isPureReactComponent=!0;var _g=Array.isArray,g5=Object.prototype.hasOwnProperty,c0={current:null},y5={key:!0,ref:!0,__self:!0,__source:!0};function v5(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)g5.call(t,r)&&!y5.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1>>1,re=I[ae];if(0>>1;aeo(ne,z))peo(Y,ne)?(I[ae]=Y,I[pe]=z,ae=pe):(I[ae]=ne,I[W]=z,ae=W);else if(peo(Y,z))I[ae]=Y,I[pe]=z,ae=pe;else break e}}return F}function o(I,F){var z=I.sortIndex-F.sortIndex;return z!==0?z:I.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],c=[],u=1,f=null,p=3,x=!1,y=!1,g=!1,k=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(I){for(var F=n(c);F!==null;){if(F.callback===null)r(c);else if(F.startTime<=I)r(c),F.sortIndex=F.expirationTime,t(l,F);else break;F=n(c)}}function C(I){if(g=!1,v(I),!y)if(n(l)!==null)y=!0,L(S);else{var F=n(c);F!==null&&V(C,F.startTime-I)}}function S(I,F){y=!1,g&&(g=!1,h(M),M=-1),x=!0;var z=p;try{for(v(F),f=n(l);f!==null&&(!(f.expirationTime>F)||I&&!O());){var ae=f.callback;if(typeof ae=="function"){f.callback=null,p=f.priorityLevel;var re=ae(f.expirationTime<=F);F=e.unstable_now(),typeof re=="function"?f.callback=re:f===n(l)&&r(l),v(F)}else r(l);f=n(l)}if(f!==null)var de=!0;else{var W=n(c);W!==null&&V(C,W.startTime-F),de=!1}return de}finally{f=null,p=z,x=!1}}var E=!1,P=null,M=-1,T=5,R=-1;function O(){return!(e.unstable_now()-RI||125ae?(I.sortIndex=z,t(c,I),n(l)===null&&I===n(c)&&(g?(h(M),M=-1):g=!0,V(C,z-ae))):(I.sortIndex=re,t(l,I),y||x||(y=!0,L(S))),I},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(I){var F=p;return function(){var z=p;p=F;try{return I.apply(this,arguments)}finally{p=z}}}})(w5);b5.exports=w5;var oC=b5.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var S5=b,Rn=oC;function oe(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ch=Object.prototype.hasOwnProperty,iC=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Og={},Ig={};function sC(e){return Ch.call(Ig,e)?!0:Ch.call(Og,e)?!1:iC.test(e)?Ig[e]=!0:(Og[e]=!0,!1)}function aC(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function lC(e,t,n,r){if(t===null||typeof t>"u"||aC(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function un(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Yt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Yt[e]=new un(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Yt[t]=new un(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Yt[e]=new un(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Yt[e]=new un(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Yt[e]=new un(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Yt[e]=new un(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Yt[e]=new un(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Yt[e]=new un(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Yt[e]=new un(e,5,!1,e.toLowerCase(),null,!1,!1)});var d0=/[\-:]([a-z])/g;function f0(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(d0,f0);Yt[t]=new un(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(d0,f0);Yt[t]=new un(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(d0,f0);Yt[t]=new un(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Yt[e]=new un(e,1,!1,e.toLowerCase(),null,!1,!1)});Yt.xlinkHref=new un("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Yt[e]=new un(e,1,!1,e.toLowerCase(),null,!0,!0)});function p0(e,t,n,r){var o=Yt.hasOwnProperty(t)?Yt[t]:null;(o!==null?o.type!==0:r||!(2a||o[s]!==i[a]){var l=` +`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{mp=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?$a(e):""}function cC(e){switch(e.tag){case 5:return $a(e.type);case 16:return $a("Lazy");case 13:return $a("Suspense");case 19:return $a("SuspenseList");case 0:case 2:case 15:return e=gp(e.type,!1),e;case 11:return e=gp(e.type.render,!1),e;case 1:return e=gp(e.type,!0),e;default:return""}}function kh(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ns:return"Fragment";case ts:return"Portal";case bh:return"Profiler";case h0:return"StrictMode";case wh:return"Suspense";case Sh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case E5:return(e.displayName||"Context")+".Consumer";case P5:return(e._context.displayName||"Context")+".Provider";case m0:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case g0:return t=e.displayName||null,t!==null?t:kh(e.type)||"Memo";case wo:t=e._payload,e=e._init;try{return kh(e(t))}catch{}}return null}function uC(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return kh(t);case 8:return t===h0?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Vo(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function T5(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function dC(e){var t=T5(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function hc(e){e._valueTracker||(e._valueTracker=dC(e))}function R5(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=T5(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Tu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ph(e,t){var n=t.checked;return bt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Fg(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Vo(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function _5(e,t){t=t.checked,t!=null&&p0(e,"checked",t,!1)}function Eh(e,t){_5(e,t);var n=Vo(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Mh(e,t.type,n):t.hasOwnProperty("defaultValue")&&Mh(e,t.type,Vo(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ag(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Mh(e,t,n){(t!=="number"||Tu(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Fa=Array.isArray;function gs(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=mc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function al(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Va={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},fC=["Webkit","ms","Moz","O"];Object.keys(Va).forEach(function(e){fC.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Va[t]=Va[e]})});function $5(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Va.hasOwnProperty(e)&&Va[e]?(""+t).trim():t+"px"}function F5(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=$5(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var pC=bt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function _h(e,t){if(t){if(pC[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(oe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(oe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(oe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(oe(62))}}function Dh(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Oh=null;function y0(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ih=null,ys=null,vs=null;function Ng(e){if(e=Wl(e)){if(typeof Ih!="function")throw Error(oe(280));var t=e.stateNode;t&&(t=Ed(t),Ih(e.stateNode,e.type,t))}}function A5(e){ys?vs?vs.push(e):vs=[e]:ys=e}function L5(){if(ys){var e=ys,t=vs;if(vs=ys=null,Ng(e),t)for(e=0;e>>=0,e===0?32:31-(kC(e)/PC|0)|0}var gc=64,yc=4194304;function Aa(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ou(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=Aa(a):(i&=s,i!==0&&(r=Aa(i)))}else s=n&~o,s!==0?r=Aa(s):i!==0&&(r=Aa(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function zl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-dr(t),e[t]=n}function RC(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Ba),Kg=" ",Zg=!1;function r8(e,t){switch(e){case"keyup":return rb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function o8(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var rs=!1;function ib(e,t){switch(e){case"compositionend":return o8(t);case"keypress":return t.which!==32?null:(Zg=!0,Kg);case"textInput":return e=t.data,e===Kg&&Zg?null:e;default:return null}}function sb(e,t){if(rs)return e==="compositionend"||!P0&&r8(e,t)?(e=t8(),tu=w0=Eo=null,rs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Qg(n)}}function l8(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?l8(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function c8(){for(var e=window,t=Tu();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Tu(e.document)}return t}function E0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function mb(e){var t=c8(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&l8(n.ownerDocument.documentElement,n)){if(r!==null&&E0(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=e2(n,i);var s=e2(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,os=null,Nh=null,Ha=null,Vh=!1;function t2(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Vh||os==null||os!==Tu(r)||(r=os,"selectionStart"in r&&E0(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ha&&pl(Ha,r)||(Ha=r,r=Fu(Nh,"onSelect"),0as||(e.current=Yh[as],Yh[as]=null,as--)}function lt(e,t){as++,Yh[as]=e.current,e.current=t}var zo={},tn=Uo(zo),mn=Uo(!1),Ci=zo;function _s(e,t){var n=e.type.contextTypes;if(!n)return zo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function gn(e){return e=e.childContextTypes,e!=null}function Lu(){pt(mn),pt(tn)}function l2(e,t,n){if(tn.current!==zo)throw Error(oe(168));lt(tn,t),lt(mn,n)}function v8(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(oe(108,uC(e)||"Unknown",o));return bt({},n,r)}function ju(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||zo,Ci=tn.current,lt(tn,e),lt(mn,mn.current),!0}function c2(e,t,n){var r=e.stateNode;if(!r)throw Error(oe(169));n?(e=v8(e,t,Ci),r.__reactInternalMemoizedMergedChildContext=e,pt(mn),pt(tn),lt(tn,e)):pt(mn),lt(mn,n)}var Gr=null,Md=!1,_p=!1;function x8(e){Gr===null?Gr=[e]:Gr.push(e)}function Mb(e){Md=!0,x8(e)}function Yo(){if(!_p&&Gr!==null){_p=!0;var e=0,t=nt;try{var n=Gr;for(nt=1;e>=s,o-=s,qr=1<<32-dr(t)+o|n<M?(T=P,P=null):T=P.sibling;var R=p(h,P,v[M],C);if(R===null){P===null&&(P=T);break}e&&P&&R.alternate===null&&t(h,P),m=i(R,m,M),E===null?S=R:E.sibling=R,E=R,P=T}if(M===v.length)return n(h,P),vt&&ti(h,M),S;if(P===null){for(;MM?(T=P,P=null):T=P.sibling;var O=p(h,P,R.value,C);if(O===null){P===null&&(P=T);break}e&&P&&O.alternate===null&&t(h,P),m=i(O,m,M),E===null?S=O:E.sibling=O,E=O,P=T}if(R.done)return n(h,P),vt&&ti(h,M),S;if(P===null){for(;!R.done;M++,R=v.next())R=f(h,R.value,C),R!==null&&(m=i(R,m,M),E===null?S=R:E.sibling=R,E=R);return vt&&ti(h,M),S}for(P=r(h,P);!R.done;M++,R=v.next())R=x(P,h,M,R.value,C),R!==null&&(e&&R.alternate!==null&&P.delete(R.key===null?M:R.key),m=i(R,m,M),E===null?S=R:E.sibling=R,E=R);return e&&P.forEach(function(A){return t(h,A)}),vt&&ti(h,M),S}function k(h,m,v,C){if(typeof v=="object"&&v!==null&&v.type===ns&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case pc:e:{for(var S=v.key,E=m;E!==null;){if(E.key===S){if(S=v.type,S===ns){if(E.tag===7){n(h,E.sibling),m=o(E,v.props.children),m.return=h,h=m;break e}}else if(E.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===wo&&g2(S)===E.type){n(h,E.sibling),m=o(E,v.props),m.ref=fa(h,E,v),m.return=h,h=m;break e}n(h,E);break}else t(h,E);E=E.sibling}v.type===ns?(m=mi(v.props.children,h.mode,C,v.key),m.return=h,h=m):(C=cu(v.type,v.key,v.props,null,h.mode,C),C.ref=fa(h,m,v),C.return=h,h=C)}return s(h);case ts:e:{for(E=v.key;m!==null;){if(m.key===E)if(m.tag===4&&m.stateNode.containerInfo===v.containerInfo&&m.stateNode.implementation===v.implementation){n(h,m.sibling),m=o(m,v.children||[]),m.return=h,h=m;break e}else{n(h,m);break}else t(h,m);m=m.sibling}m=jp(v,h.mode,C),m.return=h,h=m}return s(h);case wo:return E=v._init,k(h,m,E(v._payload),C)}if(Fa(v))return y(h,m,v,C);if(aa(v))return g(h,m,v,C);kc(h,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,m!==null&&m.tag===6?(n(h,m.sibling),m=o(m,v),m.return=h,h=m):(n(h,m),m=Lp(v,h.mode,C),m.return=h,h=m),s(h)):n(h,m)}return k}var Os=M8(!0),T8=M8(!1),Hl={},_r=Uo(Hl),yl=Uo(Hl),vl=Uo(Hl);function di(e){if(e===Hl)throw Error(oe(174));return e}function F0(e,t){switch(lt(vl,t),lt(yl,e),lt(_r,Hl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Rh(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Rh(t,e)}pt(_r),lt(_r,t)}function Is(){pt(_r),pt(yl),pt(vl)}function R8(e){di(vl.current);var t=di(_r.current),n=Rh(t,e.type);t!==n&&(lt(yl,e),lt(_r,n))}function A0(e){yl.current===e&&(pt(_r),pt(yl))}var xt=Uo(0);function Hu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Dp=[];function L0(){for(var e=0;en?n:4,e(!0);var r=Op.transition;Op.transition={};try{e(!1),t()}finally{nt=n,Op.transition=r}}function U8(){return qn().memoizedState}function Db(e,t,n){var r=Lo(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Y8(e))G8(t,n);else if(n=S8(e,t,n,r),n!==null){var o=an();fr(n,e,r,o),K8(n,t,r)}}function Ob(e,t,n){var r=Lo(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Y8(e))G8(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,pr(a,s)){var l=t.interleaved;l===null?(o.next=o,I0(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=S8(e,t,o,r),n!==null&&(o=an(),fr(n,e,r,o),K8(n,t,r))}}function Y8(e){var t=e.alternate;return e===Ct||t!==null&&t===Ct}function G8(e,t){Ua=Uu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function K8(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,x0(e,n)}}var Yu={readContext:Zn,useCallback:Kt,useContext:Kt,useEffect:Kt,useImperativeHandle:Kt,useInsertionEffect:Kt,useLayoutEffect:Kt,useMemo:Kt,useReducer:Kt,useRef:Kt,useState:Kt,useDebugValue:Kt,useDeferredValue:Kt,useTransition:Kt,useMutableSource:Kt,useSyncExternalStore:Kt,useId:Kt,unstable_isNewReconciler:!1},Ib={readContext:Zn,useCallback:function(e,t){return Cr().memoizedState=[e,t===void 0?null:t],e},useContext:Zn,useEffect:v2,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,iu(4194308,4,V8.bind(null,t,e),n)},useLayoutEffect:function(e,t){return iu(4194308,4,e,t)},useInsertionEffect:function(e,t){return iu(4,2,e,t)},useMemo:function(e,t){var n=Cr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Cr();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Db.bind(null,Ct,e),[r.memoizedState,e]},useRef:function(e){var t=Cr();return e={current:e},t.memoizedState=e},useState:y2,useDebugValue:B0,useDeferredValue:function(e){return Cr().memoizedState=e},useTransition:function(){var e=y2(!1),t=e[0];return e=_b.bind(null,e[1]),Cr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ct,o=Cr();if(vt){if(n===void 0)throw Error(oe(407));n=n()}else{if(n=t(),Vt===null)throw Error(oe(349));wi&30||O8(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,v2($8.bind(null,r,i,e),[e]),r.flags|=2048,bl(9,I8.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Cr(),t=Vt.identifierPrefix;if(vt){var n=Xr,r=qr;n=(r&~(1<<32-dr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=xl++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[kr]=t,e[gl]=r,r3(e,t,!1,!1),t.stateNode=e;e:{switch(s=Dh(n,r),n){case"dialog":ft("cancel",e),ft("close",e),o=r;break;case"iframe":case"object":case"embed":ft("load",e),o=r;break;case"video":case"audio":for(o=0;oFs&&(t.flags|=128,r=!0,pa(i,!1),t.lanes=4194304)}else{if(!r)if(e=Hu(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),pa(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!vt)return Zt(t),null}else 2*Tt()-i.renderingStartTime>Fs&&n!==1073741824&&(t.flags|=128,r=!0,pa(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Tt(),t.sibling=null,n=xt.current,lt(xt,r?n&1|2:n&1),t):(Zt(t),null);case 22:case 23:return K0(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?kn&1073741824&&(Zt(t),t.subtreeFlags&6&&(t.flags|=8192)):Zt(t),null;case 24:return null;case 25:return null}throw Error(oe(156,t.tag))}function zb(e,t){switch(T0(t),t.tag){case 1:return gn(t.type)&&Lu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Is(),pt(mn),pt(tn),L0(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return A0(t),null;case 13:if(pt(xt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(oe(340));Ds()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return pt(xt),null;case 4:return Is(),null;case 10:return O0(t.type._context),null;case 22:case 23:return K0(),null;case 24:return null;default:return null}}var Ec=!1,Xt=!1,Bb=typeof WeakSet=="function"?WeakSet:Set,be=null;function ds(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Pt(e,t,r)}else n.current=null}function o1(e,t,n){try{n()}catch(r){Pt(e,t,r)}}var M2=!1;function Wb(e,t){if(zh=Iu,e=c8(),E0(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,f=e,p=null;t:for(;;){for(var x;f!==n||o!==0&&f.nodeType!==3||(a=s+o),f!==i||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(x=f.firstChild)!==null;)p=f,f=x;for(;;){if(f===e)break t;if(p===n&&++c===o&&(a=s),p===i&&++u===r&&(l=s),(x=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=x}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Bh={focusedElem:e,selectionRange:n},Iu=!1,be=t;be!==null;)if(t=be,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,be=e;else for(;be!==null;){t=be;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var g=y.memoizedProps,k=y.memoizedState,h=t.stateNode,m=h.getSnapshotBeforeUpdate(t.elementType===t.type?g:ir(t.type,g),k);h.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(oe(163))}}catch(C){Pt(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,be=e;break}be=t.return}return y=M2,M2=!1,y}function Ya(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&o1(t,n,i)}o=o.next}while(o!==r)}}function _d(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function i1(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function s3(e){var t=e.alternate;t!==null&&(e.alternate=null,s3(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[kr],delete t[gl],delete t[Uh],delete t[Pb],delete t[Eb])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function a3(e){return e.tag===5||e.tag===3||e.tag===4}function T2(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||a3(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function s1(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Au));else if(r!==4&&(e=e.child,e!==null))for(s1(e,t,n),e=e.sibling;e!==null;)s1(e,t,n),e=e.sibling}function a1(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(a1(e,t,n),e=e.sibling;e!==null;)a1(e,t,n),e=e.sibling}var Wt=null,sr=!1;function xo(e,t,n){for(n=n.child;n!==null;)l3(e,t,n),n=n.sibling}function l3(e,t,n){if(Rr&&typeof Rr.onCommitFiberUnmount=="function")try{Rr.onCommitFiberUnmount(wd,n)}catch{}switch(n.tag){case 5:Xt||ds(n,t);case 6:var r=Wt,o=sr;Wt=null,xo(e,t,n),Wt=r,sr=o,Wt!==null&&(sr?(e=Wt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Wt.removeChild(n.stateNode));break;case 18:Wt!==null&&(sr?(e=Wt,n=n.stateNode,e.nodeType===8?Rp(e.parentNode,n):e.nodeType===1&&Rp(e,n),dl(e)):Rp(Wt,n.stateNode));break;case 4:r=Wt,o=sr,Wt=n.stateNode.containerInfo,sr=!0,xo(e,t,n),Wt=r,sr=o;break;case 0:case 11:case 14:case 15:if(!Xt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&o1(n,t,s),o=o.next}while(o!==r)}xo(e,t,n);break;case 1:if(!Xt&&(ds(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Pt(n,t,a)}xo(e,t,n);break;case 21:xo(e,t,n);break;case 22:n.mode&1?(Xt=(r=Xt)||n.memoizedState!==null,xo(e,t,n),Xt=r):xo(e,t,n);break;default:xo(e,t,n)}}function R2(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Bb),t.forEach(function(r){var o=Jb.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function or(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=s),r&=~i}if(r=o,r=Tt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ub(r/1960))-r,10e?16:e,Mo===null)var r=!1;else{if(e=Mo,Mo=null,Zu=0,Ge&6)throw Error(oe(331));var o=Ge;for(Ge|=4,be=e.current;be!==null;){var i=be,s=i.child;if(be.flags&16){var a=i.deletions;if(a!==null){for(var l=0;lTt()-Y0?hi(e,0):U0|=n),yn(e,t)}function g3(e,t){t===0&&(e.mode&1?(t=yc,yc<<=1,!(yc&130023424)&&(yc=4194304)):t=1);var n=an();e=so(e,t),e!==null&&(zl(e,t,n),yn(e,n))}function Xb(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),g3(e,n)}function Jb(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(oe(314))}r!==null&&r.delete(t),g3(e,n)}var y3;y3=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||mn.current)hn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return hn=!1,Nb(e,t,n);hn=!!(e.flags&131072)}else hn=!1,vt&&t.flags&1048576&&C8(t,Vu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;su(e,t),e=t.pendingProps;var o=_s(t,tn.current);Cs(t,n),o=N0(null,t,r,e,o,n);var i=V0();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,gn(r)?(i=!0,ju(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,$0(t),o.updater=Td,t.stateNode=o,o._reactInternals=t,Xh(t,r,e,n),t=e1(null,t,r,!0,i,n)):(t.tag=0,vt&&i&&M0(t),on(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(su(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=e9(r),e=ir(r,e),o){case 0:t=Qh(null,t,r,e,n);break e;case 1:t=k2(null,t,r,e,n);break e;case 11:t=w2(null,t,r,e,n);break e;case 14:t=S2(null,t,r,ir(r.type,e),n);break e}throw Error(oe(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ir(r,o),Qh(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ir(r,o),k2(e,t,r,o,n);case 3:e:{if(e3(t),e===null)throw Error(oe(387));r=t.pendingProps,i=t.memoizedState,o=i.element,k8(e,t),Wu(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=$s(Error(oe(423)),t),t=P2(e,t,r,n,o);break e}else if(r!==o){o=$s(Error(oe(424)),t),t=P2(e,t,r,n,o);break e}else for(En=$o(t.stateNode.containerInfo.firstChild),Mn=t,vt=!0,ar=null,n=T8(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ds(),r===o){t=ao(e,t,n);break e}on(e,t,r,n)}t=t.child}return t;case 5:return R8(t),e===null&&Kh(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Wh(r,o)?s=null:i!==null&&Wh(r,i)&&(t.flags|=32),Q8(e,t),on(e,t,s,n),t.child;case 6:return e===null&&Kh(t),null;case 13:return t3(e,t,n);case 4:return F0(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Os(t,null,r,n):on(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ir(r,o),w2(e,t,r,o,n);case 7:return on(e,t,t.pendingProps,n),t.child;case 8:return on(e,t,t.pendingProps.children,n),t.child;case 12:return on(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,lt(zu,r._currentValue),r._currentValue=s,i!==null)if(pr(i.value,s)){if(i.children===o.children&&!mn.current){t=ao(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=eo(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Zh(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(oe(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Zh(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}on(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Cs(t,n),o=Zn(o),r=r(o),t.flags|=1,on(e,t,r,n),t.child;case 14:return r=t.type,o=ir(r,t.pendingProps),o=ir(r.type,o),S2(e,t,r,o,n);case 15:return X8(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ir(r,o),su(e,t),t.tag=1,gn(r)?(e=!0,ju(t)):e=!1,Cs(t,n),E8(t,r,o),Xh(t,r,o,n),e1(null,t,r,!0,e,n);case 19:return n3(e,t,n);case 22:return J8(e,t,n)}throw Error(oe(156,t.tag))};function v3(e,t){return H5(e,t)}function Qb(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Hn(e,t,n,r){return new Qb(e,t,n,r)}function q0(e){return e=e.prototype,!(!e||!e.isReactComponent)}function e9(e){if(typeof e=="function")return q0(e)?1:0;if(e!=null){if(e=e.$$typeof,e===m0)return 11;if(e===g0)return 14}return 2}function jo(e,t){var n=e.alternate;return n===null?(n=Hn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function cu(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")q0(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case ns:return mi(n.children,o,i,t);case h0:s=8,o|=8;break;case bh:return e=Hn(12,n,t,o|2),e.elementType=bh,e.lanes=i,e;case wh:return e=Hn(13,n,t,o),e.elementType=wh,e.lanes=i,e;case Sh:return e=Hn(19,n,t,o),e.elementType=Sh,e.lanes=i,e;case M5:return Od(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case P5:s=10;break e;case E5:s=9;break e;case m0:s=11;break e;case g0:s=14;break e;case wo:s=16,r=null;break e}throw Error(oe(130,e==null?e:typeof e,""))}return t=Hn(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function mi(e,t,n,r){return e=Hn(7,e,r,t),e.lanes=n,e}function Od(e,t,n,r){return e=Hn(22,e,r,t),e.elementType=M5,e.lanes=n,e.stateNode={isHidden:!1},e}function Lp(e,t,n){return e=Hn(6,e,null,t),e.lanes=n,e}function jp(e,t,n){return t=Hn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function t9(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=vp(0),this.expirationTimes=vp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vp(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function X0(e,t,n,r,o,i,s,a,l){return e=new t9(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Hn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},$0(i),e}function n9(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(w3)}catch(e){console.error(e)}}w3(),C5.exports=In;var Ul=C5.exports;const Rc=Cd(Ul);var S3,L2=Ul;S3=L2.createRoot,L2.hydrateRoot;const a9={black:"#000",white:"#fff"},Sl=a9,l9={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},zi=l9,c9={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},Bi=c9,u9={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Wi=u9,d9={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},Hi=d9,f9={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},Ui=f9,p9={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},ma=p9,h9={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},m9=h9;function Bo(e){let t="https://mui.com/production-error/?code="+e;for(let n=1;n=0)&&(n[o]=e[o]);return n}function k3(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var g9=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,y9=k3(function(e){return g9.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91});function v9(e){if(e.sheet)return e.sheet;for(var t=0;t0?Ht(Xs,--Cn):0,As--,Ot===10&&(As=1,jd--),Ot}function Tn(){return Ot=Cn2||Pl(Ot)>3?"":" "}function D9(e,t){for(;--t&&Tn()&&!(Ot<48||Ot>102||Ot>57&&Ot<65||Ot>70&&Ot<97););return Yl(e,uu()+(t<6&&Dr()==32&&Tn()==32))}function p1(e){for(;Tn();)switch(Ot){case e:return Cn;case 34:case 39:e!==34&&e!==39&&p1(Ot);break;case 40:e===41&&p1(e);break;case 92:Tn();break}return Cn}function O9(e,t){for(;Tn()&&e+Ot!==57;)if(e+Ot===84&&Dr()===47)break;return"/*"+Yl(t,Cn-1)+"*"+Ld(e===47?e:Tn())}function I9(e){for(;!Pl(Dr());)Tn();return Yl(e,Cn)}function $9(e){return _3(fu("",null,null,null,[""],e=R3(e),0,[0],e))}function fu(e,t,n,r,o,i,s,a,l){for(var c=0,u=0,f=s,p=0,x=0,y=0,g=1,k=1,h=1,m=0,v="",C=o,S=i,E=r,P=v;k;)switch(y=m,m=Tn()){case 40:if(y!=108&&Ht(P,f-1)==58){f1(P+=et(du(m),"&","&\f"),"&\f")!=-1&&(h=-1);break}case 34:case 39:case 91:P+=du(m);break;case 9:case 10:case 13:case 32:P+=_9(y);break;case 92:P+=D9(uu()-1,7);continue;case 47:switch(Dr()){case 42:case 47:_c(F9(O9(Tn(),uu()),t,n),l);break;default:P+="/"}break;case 123*g:a[c++]=br(P)*h;case 125*g:case 59:case 0:switch(m){case 0:case 125:k=0;case 59+u:h==-1&&(P=et(P,/\f/g,"")),x>0&&br(P)-f&&_c(x>32?N2(P+";",r,n,f-1):N2(et(P," ","")+";",r,n,f-2),l);break;case 59:P+=";";default:if(_c(E=j2(P,t,n,c,u,o,a,v,C=[],S=[],f),i),m===123)if(u===0)fu(P,t,E,E,C,i,f,a,S);else switch(p===99&&Ht(P,3)===110?100:p){case 100:case 108:case 109:case 115:fu(e,E,E,r&&_c(j2(e,E,E,0,0,o,a,v,o,C=[],f),S),o,S,f,a,r?C:S);break;default:fu(P,E,E,E,[""],S,0,a,S)}}c=u=x=0,g=h=1,v=P="",f=s;break;case 58:f=1+br(P),x=y;default:if(g<1){if(m==123)--g;else if(m==125&&g++==0&&R9()==125)continue}switch(P+=Ld(m),m*g){case 38:h=u>0?1:(P+="\f",-1);break;case 44:a[c++]=(br(P)-1)*h,h=1;break;case 64:Dr()===45&&(P+=du(Tn())),p=Dr(),u=f=br(v=P+=I9(uu())),m++;break;case 45:y===45&&br(P)==2&&(g=0)}}return i}function j2(e,t,n,r,o,i,s,a,l,c,u){for(var f=o-1,p=o===0?i:[""],x=rm(p),y=0,g=0,k=0;y0?p[h]+" "+m:et(m,/&\f/g,p[h])))&&(l[k++]=v);return Nd(e,t,n,o===0?tm:a,l,c,u)}function F9(e,t,n){return Nd(e,t,n,P3,Ld(T9()),kl(e,2,-2),0)}function N2(e,t,n,r){return Nd(e,t,n,nm,kl(e,0,r),kl(e,r+1,-1),r)}function ws(e,t){for(var n="",r=rm(e),o=0;o6)switch(Ht(e,t+1)){case 109:if(Ht(e,t+4)!==45)break;case 102:return et(e,/(.+:)(.+)-([^]+)/,"$1"+Qe+"$2-$3$1"+Ju+(Ht(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~f1(e,"stretch")?D3(et(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Ht(e,t+1)!==115)break;case 6444:switch(Ht(e,br(e)-3-(~f1(e,"!important")&&10))){case 107:return et(e,":",":"+Qe)+e;case 101:return et(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Qe+(Ht(e,14)===45?"inline-":"")+"box$3$1"+Qe+"$2$3$1"+qt+"$2box$3")+e}break;case 5936:switch(Ht(e,t+11)){case 114:return Qe+e+qt+et(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Qe+e+qt+et(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Qe+e+qt+et(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Qe+e+qt+e+e}return e}var H9=function(t,n,r,o){if(t.length>-1&&!t.return)switch(t.type){case nm:t.return=D3(t.value,t.length);break;case E3:return ws([ga(t,{value:et(t.value,"@","@"+Qe)})],o);case tm:if(t.length)return M9(t.props,function(i){switch(E9(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ws([ga(t,{props:[et(i,/:(read-\w+)/,":"+Ju+"$1")]})],o);case"::placeholder":return ws([ga(t,{props:[et(i,/:(plac\w+)/,":"+Qe+"input-$1")]}),ga(t,{props:[et(i,/:(plac\w+)/,":"+Ju+"$1")]}),ga(t,{props:[et(i,/:(plac\w+)/,qt+"input-$1")]})],o)}return""})}},U9=[H9],Y9=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(g){var k=g.getAttribute("data-emotion");k.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var o=t.stylisPlugins||U9,i={},s,a=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(g){for(var k=g.getAttribute("data-emotion").split(" "),h=1;h=4;++r,o-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var ow={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},iw=/[A-Z]|^ms/g,sw=/_EMO_([^_]+?)_([^]*?)_EMO_/g,j3=function(t){return t.charCodeAt(1)===45},z2=function(t){return t!=null&&typeof t!="boolean"},Np=k3(function(e){return j3(e)?e:e.replace(iw,"-$&").toLowerCase()}),B2=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(sw,function(r,o,i){return wr={name:o,styles:i,next:wr},o})}return ow[t]!==1&&!j3(t)&&typeof n=="number"&&n!==0?n+"px":n};function El(e,t,n){if(n==null)return"";if(n.__emotion_styles!==void 0)return n;switch(typeof n){case"boolean":return"";case"object":{if(n.anim===1)return wr={name:n.name,styles:n.styles,next:wr},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)wr={name:r.name,styles:r.styles,next:wr},r=r.next;var o=n.styles+";";return o}return aw(e,t,n)}case"function":{if(e!==void 0){var i=wr,s=n(e);return wr=i,El(e,t,s)}break}}if(t==null)return n;var a=t[n];return a!==void 0?a:n}function aw(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o96?dw:fw},Y2=function(t,n,r){var o;if(n){var i=n.shouldForwardProp;o=t.__emotion_forwardProp&&i?function(s){return t.__emotion_forwardProp(s)&&i(s)}:i}return typeof o!="function"&&r&&(o=t.__emotion_forwardProp),o},pw=function(t){var n=t.cache,r=t.serialized,o=t.isStringTag;return A3(n,r,o),cw(function(){return L3(n,r,o)}),null},hw=function e(t,n){var r=t.__emotion_real===t,o=r&&t.__emotion_base||t,i,s;n!==void 0&&(i=n.label,s=n.target);var a=Y2(t,n,r),l=a||U2(o),c=!l("as");return function(){var u=arguments,f=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(i!==void 0&&f.push("label:"+i+";"),u[0]==null||u[0].raw===void 0)f.push.apply(f,u);else{f.push(u[0][0]);for(var p=u.length,x=1;xt(bw(o)?n:o):t;return d.jsx(uw,{styles:r})}function U3(e,t){return m1(e,t)}const Sw=(e,t)=>{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))};function Kr(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Y3(e){if(!Kr(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=Y3(e[n])}),t}function Jt(e,t,n={clone:!0}){const r=n.clone?w({},e):e;return Kr(e)&&Kr(t)&&Object.keys(t).forEach(o=>{o!=="__proto__"&&(Kr(t[o])&&o in e&&Kr(e[o])?r[o]=Jt(e[o],t[o],n):n.clone?r[o]=Kr(t[o])?Y3(t[o]):t[o]:r[o]=t[o])}),r}const kw=N.oneOfType([N.func,N.object]),G3=kw;function te(e){if(typeof e!="string")throw new Error(Bo(7));return e.charAt(0).toUpperCase()+e.slice(1)}function g1(...e){return e.reduce((t,n)=>n==null?t:function(...o){t.apply(this,o),n.apply(this,o)},()=>{})}function K3(e,t=166){let n;function r(...o){const i=()=>{e.apply(this,o)};clearTimeout(n),n=setTimeout(i,t)}return r.clear=()=>{clearTimeout(n)},r}function pu(e,t){var n,r;return b.isValidElement(e)&&t.indexOf((n=e.type.muiName)!=null?n:(r=e.type)==null||(r=r._payload)==null||(r=r.value)==null?void 0:r.muiName)!==-1}function Et(e){return e&&e.ownerDocument||document}function Ei(e){return Et(e).defaultView||window}function y1(e,t){typeof e=="function"?e(t):e&&(e.current=t)}const jt=typeof window<"u"?b.useLayoutEffect:b.useEffect;let G2=0;function Pw(e){const[t,n]=b.useState(e),r=e||t;return b.useEffect(()=>{t==null&&(G2+=1,n(`mui-${G2}`))},[t]),r}const K2=xh.useId;function ho(e){if(K2!==void 0){const t=K2();return e??t}return Pw(e)}function bn({controlled:e,default:t,name:n,state:r="value"}){const{current:o}=b.useRef(e!==void 0),[i,s]=b.useState(t),a=o?e:i,l=b.useCallback(c=>{o||s(c)},[]);return[a,l]}function Me(e){const t=b.useRef(e);return jt(()=>{t.current=e}),b.useRef((...n)=>(0,t.current)(...n)).current}function tt(...e){return b.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{y1(n,t)})},e)}let Xd=!0,v1=!1,Z2;const Ew={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function Mw(e){const{type:t,tagName:n}=e;return!!(n==="INPUT"&&Ew[t]&&!e.readOnly||n==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function Tw(e){e.metaKey||e.altKey||e.ctrlKey||(Xd=!0)}function Vp(){Xd=!1}function Rw(){this.visibilityState==="hidden"&&v1&&(Xd=!0)}function _w(e){e.addEventListener("keydown",Tw,!0),e.addEventListener("mousedown",Vp,!0),e.addEventListener("pointerdown",Vp,!0),e.addEventListener("touchstart",Vp,!0),e.addEventListener("visibilitychange",Rw,!0)}function Dw(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return Xd||Mw(t)}function Jd(){const e=b.useCallback(o=>{o!=null&&_w(o.ownerDocument)},[]),t=b.useRef(!1);function n(){return t.current?(v1=!0,window.clearTimeout(Z2),Z2=window.setTimeout(()=>{v1=!1},100),t.current=!1,!0):!1}function r(o){return Dw(o)?(t.current=!0,!0):!1}return{isFocusVisibleRef:t,onFocus:r,onBlur:n,ref:e}}function Z3(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}const Ow={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},q3=Ow;function lm(e,t){const n=w({},t);return Object.keys(e).forEach(r=>{if(r.toString().match(/^(components|slots)$/))n[r]=w({},e[r],n[r]);else if(r.toString().match(/^(componentsProps|slotProps)$/)){const o=e[r]||{},i=t[r];n[r]={},!i||!Object.keys(i)?n[r]=o:!o||!Object.keys(o)?n[r]=i:(n[r]=w({},i),Object.keys(o).forEach(s=>{n[r][s]=lm(o[s],i[s])}))}else n[r]===void 0&&(n[r]=e[r])}),n}function _e(e,t,n=void 0){const r={};return Object.keys(e).forEach(o=>{r[o]=e[o].reduce((i,s)=>{if(s){const a=t(s);a!==""&&i.push(a),n&&n[s]&&i.push(n[s])}return i},[]).join(" ")}),r}const q2=e=>e,Iw=()=>{let e=q2;return{configure(t){e=t},generate(t){return e(t)},reset(){e=q2}}},$w=Iw(),X3=$w,J3={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function De(e,t,n="Mui"){const r=J3[t];return r?`${n}-${r}`:`${X3.generate(e)}-${t}`}function Ee(e,t,n="Mui"){const r={};return t.forEach(o=>{r[o]=De(e,o,n)}),r}function ai(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const Fw=["values","unit","step"],Aw=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>w({},n,{[r.key]:r.val}),{})};function Lw(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=e,o=Q(e,Fw),i=Aw(t),s=Object.keys(i);function a(p){return`@media (min-width:${typeof t[p]=="number"?t[p]:p}${n})`}function l(p){return`@media (max-width:${(typeof t[p]=="number"?t[p]:p)-r/100}${n})`}function c(p,x){const y=s.indexOf(x);return`@media (min-width:${typeof t[p]=="number"?t[p]:p}${n}) and (max-width:${(y!==-1&&typeof t[s[y]]=="number"?t[s[y]]:x)-r/100}${n})`}function u(p){return s.indexOf(p)+1`@media (min-width:${cm[e]}px)`};function hr(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const i=r.breakpoints||X2;return t.reduce((s,a,l)=>(s[i.up(i.keys[l])]=n(t[l]),s),{})}if(typeof t=="object"){const i=r.breakpoints||X2;return Object.keys(t).reduce((s,a)=>{if(Object.keys(i.values||cm).indexOf(a)!==-1){const l=i.up(a);s[l]=n(t[a],a)}else{const l=a;s[l]=t[l]}return s},{})}return n(t)}function Q3(e={}){var t;return((t=e.keys)==null?void 0:t.reduce((r,o)=>{const i=e.up(o);return r[i]={},r},{}))||{}}function e6(e,t){return e.reduce((n,r)=>{const o=n[r];return(!o||Object.keys(o).length===0)&&delete n[r],n},t)}function Vw(e,...t){const n=Q3(e),r=[n,...t].reduce((o,i)=>Jt(o,i),{});return e6(Object.keys(n),r)}function zw(e,t){if(typeof e!="object")return{};const n={},r=Object.keys(t);return Array.isArray(e)?r.forEach((o,i)=>{i{e[o]!=null&&(n[o]=!0)}),n}function zp({values:e,breakpoints:t,base:n}){const r=n||zw(e,t),o=Object.keys(r);if(o.length===0)return e;let i;return o.reduce((s,a,l)=>(Array.isArray(e)?(s[a]=e[l]!=null?e[l]:e[i],i=l):typeof e=="object"?(s[a]=e[a]!=null?e[a]:e[i],i=a):s[a]=e,s),{})}function Ls(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((o,i)=>o&&o[i]?o[i]:null,e);if(r!=null)return r}return t.split(".").reduce((r,o)=>r&&r[o]!=null?r[o]:null,e)}function Qu(e,t,n,r=n){let o;return typeof e=="function"?o=e(n):Array.isArray(e)?o=e[n]||r:o=Ls(e,n)||r,t&&(o=t(o,r,e)),o}function _t(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:o}=e,i=s=>{if(s[t]==null)return null;const a=s[t],l=s.theme,c=Ls(l,r)||{};return hr(s,a,f=>{let p=Qu(c,o,f);return f===p&&typeof f=="string"&&(p=Qu(c,o,`${t}${f==="default"?"":te(f)}`,f)),n===!1?p:{[n]:p}})};return i.propTypes={},i.filterProps=[t],i}function Bw(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const Ww={m:"margin",p:"padding"},Hw={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},J2={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Uw=Bw(e=>{if(e.length>2)if(J2[e])e=J2[e];else return[e];const[t,n]=e.split(""),r=Ww[t],o=Hw[n]||"";return Array.isArray(o)?o.map(i=>r+i):[r+o]}),um=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],dm=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...um,...dm];function Kl(e,t,n,r){var o;const i=(o=Ls(e,t,!1))!=null?o:n;return typeof i=="number"?s=>typeof s=="string"?s:i*s:Array.isArray(i)?s=>typeof s=="string"?s:i[s]:typeof i=="function"?i:()=>{}}function fm(e){return Kl(e,"spacing",8)}function Mi(e,t){if(typeof t=="string"||t==null)return t;const n=Math.abs(t),r=e(n);return t>=0?r:typeof r=="number"?-r:`-${r}`}function Yw(e,t){return n=>e.reduce((r,o)=>(r[o]=Mi(t,n),r),{})}function Gw(e,t,n,r){if(t.indexOf(n)===-1)return null;const o=Uw(n),i=Yw(o,r),s=e[n];return hr(e,s,i)}function t6(e,t){const n=fm(e.theme);return Object.keys(e).map(r=>Gw(e,t,r,n)).reduce(Za,{})}function St(e){return t6(e,um)}St.propTypes={};St.filterProps=um;function kt(e){return t6(e,dm)}kt.propTypes={};kt.filterProps=dm;function Kw(e=8){if(e.mui)return e;const t=fm({spacing:e}),n=(...r)=>(r.length===0?[1]:r).map(i=>{const s=t(i);return typeof s=="number"?`${s}px`:s}).join(" ");return n.mui=!0,n}function Qd(...e){const t=e.reduce((r,o)=>(o.filterProps.forEach(i=>{r[i]=o}),r),{}),n=r=>Object.keys(r).reduce((o,i)=>t[i]?Za(o,t[i](r)):o,{});return n.propTypes={},n.filterProps=e.reduce((r,o)=>r.concat(o.filterProps),[]),n}function Bn(e){return typeof e!="number"?e:`${e}px solid`}function er(e,t){return _t({prop:e,themeKey:"borders",transform:t})}const Zw=er("border",Bn),qw=er("borderTop",Bn),Xw=er("borderRight",Bn),Jw=er("borderBottom",Bn),Qw=er("borderLeft",Bn),eS=er("borderColor"),tS=er("borderTopColor"),nS=er("borderRightColor"),rS=er("borderBottomColor"),oS=er("borderLeftColor"),iS=er("outline",Bn),sS=er("outlineColor"),ef=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Kl(e.theme,"shape.borderRadius",4),n=r=>({borderRadius:Mi(t,r)});return hr(e,e.borderRadius,n)}return null};ef.propTypes={};ef.filterProps=["borderRadius"];Qd(Zw,qw,Xw,Jw,Qw,eS,tS,nS,rS,oS,ef,iS,sS);const tf=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Kl(e.theme,"spacing",8),n=r=>({gap:Mi(t,r)});return hr(e,e.gap,n)}return null};tf.propTypes={};tf.filterProps=["gap"];const nf=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Kl(e.theme,"spacing",8),n=r=>({columnGap:Mi(t,r)});return hr(e,e.columnGap,n)}return null};nf.propTypes={};nf.filterProps=["columnGap"];const rf=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Kl(e.theme,"spacing",8),n=r=>({rowGap:Mi(t,r)});return hr(e,e.rowGap,n)}return null};rf.propTypes={};rf.filterProps=["rowGap"];const aS=_t({prop:"gridColumn"}),lS=_t({prop:"gridRow"}),cS=_t({prop:"gridAutoFlow"}),uS=_t({prop:"gridAutoColumns"}),dS=_t({prop:"gridAutoRows"}),fS=_t({prop:"gridTemplateColumns"}),pS=_t({prop:"gridTemplateRows"}),hS=_t({prop:"gridTemplateAreas"}),mS=_t({prop:"gridArea"});Qd(tf,nf,rf,aS,lS,cS,uS,dS,fS,pS,hS,mS);function Ss(e,t){return t==="grey"?t:e}const gS=_t({prop:"color",themeKey:"palette",transform:Ss}),yS=_t({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Ss}),vS=_t({prop:"backgroundColor",themeKey:"palette",transform:Ss});Qd(gS,yS,vS);function Pn(e){return e<=1&&e!==0?`${e*100}%`:e}const xS=_t({prop:"width",transform:Pn}),pm=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var r,o;const i=((r=e.theme)==null||(r=r.breakpoints)==null||(r=r.values)==null?void 0:r[n])||cm[n];return i?((o=e.theme)==null||(o=o.breakpoints)==null?void 0:o.unit)!=="px"?{maxWidth:`${i}${e.theme.breakpoints.unit}`}:{maxWidth:i}:{maxWidth:Pn(n)}};return hr(e,e.maxWidth,t)}return null};pm.filterProps=["maxWidth"];const CS=_t({prop:"minWidth",transform:Pn}),bS=_t({prop:"height",transform:Pn}),wS=_t({prop:"maxHeight",transform:Pn}),SS=_t({prop:"minHeight",transform:Pn});_t({prop:"size",cssProperty:"width",transform:Pn});_t({prop:"size",cssProperty:"height",transform:Pn});const kS=_t({prop:"boxSizing"});Qd(xS,pm,CS,bS,wS,SS,kS);const PS={border:{themeKey:"borders",transform:Bn},borderTop:{themeKey:"borders",transform:Bn},borderRight:{themeKey:"borders",transform:Bn},borderBottom:{themeKey:"borders",transform:Bn},borderLeft:{themeKey:"borders",transform:Bn},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Bn},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:ef},color:{themeKey:"palette",transform:Ss},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Ss},backgroundColor:{themeKey:"palette",transform:Ss},p:{style:kt},pt:{style:kt},pr:{style:kt},pb:{style:kt},pl:{style:kt},px:{style:kt},py:{style:kt},padding:{style:kt},paddingTop:{style:kt},paddingRight:{style:kt},paddingBottom:{style:kt},paddingLeft:{style:kt},paddingX:{style:kt},paddingY:{style:kt},paddingInline:{style:kt},paddingInlineStart:{style:kt},paddingInlineEnd:{style:kt},paddingBlock:{style:kt},paddingBlockStart:{style:kt},paddingBlockEnd:{style:kt},m:{style:St},mt:{style:St},mr:{style:St},mb:{style:St},ml:{style:St},mx:{style:St},my:{style:St},margin:{style:St},marginTop:{style:St},marginRight:{style:St},marginBottom:{style:St},marginLeft:{style:St},marginX:{style:St},marginY:{style:St},marginInline:{style:St},marginInlineStart:{style:St},marginInlineEnd:{style:St},marginBlock:{style:St},marginBlockStart:{style:St},marginBlockEnd:{style:St},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:tf},rowGap:{style:rf},columnGap:{style:nf},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Pn},maxWidth:{style:pm},minWidth:{transform:Pn},height:{transform:Pn},maxHeight:{transform:Pn},minHeight:{transform:Pn},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}},of=PS;function ES(...e){const t=e.reduce((r,o)=>r.concat(Object.keys(o)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function MS(e,t){return typeof e=="function"?e(t):e}function TS(){function e(n,r,o,i){const s={[n]:r,theme:o},a=i[n];if(!a)return{[n]:r};const{cssProperty:l=n,themeKey:c,transform:u,style:f}=a;if(r==null)return null;if(c==="typography"&&r==="inherit")return{[n]:r};const p=Ls(o,c)||{};return f?f(s):hr(s,r,y=>{let g=Qu(p,u,y);return y===g&&typeof y=="string"&&(g=Qu(p,u,`${n}${y==="default"?"":te(y)}`,y)),l===!1?g:{[l]:g}})}function t(n){var r;const{sx:o,theme:i={}}=n||{};if(!o)return null;const s=(r=i.unstable_sxConfig)!=null?r:of;function a(l){let c=l;if(typeof l=="function")c=l(i);else if(typeof l!="object")return l;if(!c)return null;const u=Q3(i.breakpoints),f=Object.keys(u);let p=u;return Object.keys(c).forEach(x=>{const y=MS(c[x],i);if(y!=null)if(typeof y=="object")if(s[x])p=Za(p,e(x,y,i,s));else{const g=hr({theme:i},y,k=>({[x]:k}));ES(g,y)?p[x]=t({sx:y,theme:i}):p=Za(p,g)}else p=Za(p,e(x,y,i,s))}),e6(f,p)}return Array.isArray(o)?o.map(a):a(o)}return t}const Zl=TS();Zl.filterProps=["sx"];const RS=["breakpoints","palette","spacing","shape"];function sf(e={},...t){const{breakpoints:n={},palette:r={},spacing:o,shape:i={}}=e,s=Q(e,RS),a=Lw(n),l=Kw(o);let c=Jt({breakpoints:a,direction:"ltr",components:{},palette:w({mode:"light"},r),spacing:l,shape:w({},Nw,i)},s);return c=t.reduce((u,f)=>Jt(u,f),c),c.unstable_sxConfig=w({},of,s==null?void 0:s.unstable_sxConfig),c.unstable_sx=function(f){return Zl({sx:f,theme:this})},c}function _S(e){return Object.keys(e).length===0}function af(e=null){const t=b.useContext(qd);return!t||_S(t)?e:t}const DS=sf();function Js(e=DS){return af(e)}function OS({styles:e,themeId:t,defaultTheme:n={}}){const r=Js(n),o=typeof e=="function"?e(t&&r[t]||r):e;return d.jsx(ww,{styles:o})}const IS=["sx"],$S=e=>{var t,n;const r={systemProps:{},otherProps:{}},o=(t=e==null||(n=e.theme)==null?void 0:n.unstable_sxConfig)!=null?t:of;return Object.keys(e).forEach(i=>{o[i]?r.systemProps[i]=e[i]:r.otherProps[i]=e[i]}),r};function hm(e){const{sx:t}=e,n=Q(e,IS),{systemProps:r,otherProps:o}=$S(n);let i;return Array.isArray(t)?i=[r,...t]:typeof t=="function"?i=(...s)=>{const a=t(...s);return Kr(a)?w({},r,a):r}:i=w({},r,t),w({},o,{sx:i})}function n6(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;ta!=="theme"&&a!=="sx"&&a!=="as"})(Zl);return b.forwardRef(function(l,c){const u=Js(n),f=hm(l),{className:p,component:x="div"}=f,y=Q(f,FS);return d.jsx(i,w({as:x,ref:c,className:le(p,o?o(r):r),theme:t&&u[t]||u},y))})}const LS=["variant"];function Q2(e){return e.length===0}function r6(e){const{variant:t}=e,n=Q(e,LS);let r=t||"";return Object.keys(n).sort().forEach(o=>{o==="color"?r+=Q2(r)?e[o]:te(e[o]):r+=`${Q2(r)?o:te(o)}${te(e[o].toString())}`}),r}const jS=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function NS(e){return Object.keys(e).length===0}function VS(e){return typeof e=="string"&&e.charCodeAt(0)>96}const zS=(e,t)=>t.components&&t.components[e]&&t.components[e].styleOverrides?t.components[e].styleOverrides:null,ed=e=>{let t=0;const n={};return e&&e.forEach(r=>{let o="";typeof r.props=="function"?(o=`callback${t}`,t+=1):o=r6(r.props),n[o]=r.style}),n},BS=(e,t)=>{let n=[];return t&&t.components&&t.components[e]&&t.components[e].variants&&(n=t.components[e].variants),ed(n)},td=(e,t,n)=>{const{ownerState:r={}}=e,o=[];let i=0;return n&&n.forEach(s=>{let a=!0;if(typeof s.props=="function"){const l=w({},e,r);a=s.props(l)}else Object.keys(s.props).forEach(l=>{r[l]!==s.props[l]&&e[l]!==s.props[l]&&(a=!1)});a&&(typeof s.props=="function"?o.push(t[`callback${i}`]):o.push(t[r6(s.props)])),typeof s.props=="function"&&(i+=1)}),o},WS=(e,t,n,r)=>{var o;const i=n==null||(o=n.components)==null||(o=o[r])==null?void 0:o.variants;return td(e,t,i)};function qa(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const HS=sf(),US=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function hu({defaultTheme:e,theme:t,themeId:n}){return NS(t)?e:t[n]||t}function YS(e){return e?(t,n)=>n[e]:null}const ey=({styledArg:e,props:t,defaultTheme:n,themeId:r})=>{const o=e(w({},t,{theme:hu(w({},t,{defaultTheme:n,themeId:r}))}));let i;if(o&&o.variants&&(i=o.variants,delete o.variants),i){const s=td(t,ed(i),i);return[o,...s]}return o};function o6(e={}){const{themeId:t,defaultTheme:n=HS,rootShouldForwardProp:r=qa,slotShouldForwardProp:o=qa}=e,i=s=>Zl(w({},s,{theme:hu(w({},s,{defaultTheme:n,themeId:t}))}));return i.__mui_systemSx=!0,(s,a={})=>{Sw(s,C=>C.filter(S=>!(S!=null&&S.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:u,skipSx:f,overridesResolver:p=YS(US(c))}=a,x=Q(a,jS),y=u!==void 0?u:c&&c!=="Root"&&c!=="root"||!1,g=f||!1;let k,h=qa;c==="Root"||c==="root"?h=r:c?h=o:VS(s)&&(h=void 0);const m=U3(s,w({shouldForwardProp:h,label:k},x)),v=(C,...S)=>{const E=S?S.map(R=>{if(typeof R=="function"&&R.__emotion_real!==R)return O=>ey({styledArg:R,props:O,defaultTheme:n,themeId:t});if(Kr(R)){let O=R,A;return R&&R.variants&&(A=R.variants,delete O.variants,O=$=>{let _=R;return td($,ed(A),A).forEach(L=>{_=Jt(_,L)}),_}),O}return R}):[];let P=C;if(Kr(C)){let R;C&&C.variants&&(R=C.variants,delete P.variants,P=O=>{let A=C;return td(O,ed(R),R).forEach(_=>{A=Jt(A,_)}),A})}else typeof C=="function"&&C.__emotion_real!==C&&(P=R=>ey({styledArg:C,props:R,defaultTheme:n,themeId:t}));l&&p&&E.push(R=>{const O=hu(w({},R,{defaultTheme:n,themeId:t})),A=zS(l,O);if(A){const $={};return Object.entries(A).forEach(([_,D])=>{$[_]=typeof D=="function"?D(w({},R,{theme:O})):D}),p(R,$)}return null}),l&&!y&&E.push(R=>{const O=hu(w({},R,{defaultTheme:n,themeId:t}));return WS(R,BS(l,O),O,l)}),g||E.push(i);const M=E.length-S.length;if(Array.isArray(C)&&M>0){const R=new Array(M).fill("");P=[...C,...R],P.raw=[...C.raw,...R]}const T=m(P,...E);return s.muiName&&(T.muiName=s.muiName),T};return m.withConfig&&(v.withConfig=m.withConfig),v}}const GS=o6();function i6(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:lm(t.components[n].defaultProps,r)}function s6({props:e,name:t,defaultTheme:n,themeId:r}){let o=Js(n);return r&&(o=o[r]||o),i6({theme:o,name:t,props:e})}function mm(e,t=0,n=1){return ai(e,t,n)}function KS(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,o)=>o<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function Ti(e){if(e.type)return e;if(e.charAt(0)==="#")return Ti(KS(e));const t=e.indexOf("("),n=e.substring(0,t);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error(Bo(9,e));let r=e.substring(t+1,e.length-1),o;if(n==="color"){if(r=r.split(" "),o=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(o)===-1)throw new Error(Bo(10,o))}else r=r.split(",");return r=r.map(i=>parseFloat(i)),{type:n,values:r,colorSpace:o}}function lf(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.indexOf("rgb")!==-1?r=r.map((o,i)=>i<3?parseInt(o,10):o):t.indexOf("hsl")!==-1&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.indexOf("color")!==-1?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function ZS(e){e=Ti(e);const{values:t}=e,n=t[0],r=t[1]/100,o=t[2]/100,i=r*Math.min(o,1-o),s=(c,u=(c+n/30)%12)=>o-i*Math.max(Math.min(u-3,9-u,1),-1);let a="rgb";const l=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return e.type==="hsla"&&(a+="a",l.push(t[3])),lf({type:a,values:l})}function ty(e){e=Ti(e);let t=e.type==="hsl"||e.type==="hsla"?Ti(ZS(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function qS(e,t){const n=ty(e),r=ty(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Ne(e,t){return e=Ti(e),t=mm(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,lf(e)}function a6(e,t){if(e=Ti(e),t=mm(t),e.type.indexOf("hsl")!==-1)e.values[2]*=1-t;else if(e.type.indexOf("rgb")!==-1||e.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)e.values[n]*=1-t;return lf(e)}function l6(e,t){if(e=Ti(e),t=mm(t),e.type.indexOf("hsl")!==-1)e.values[2]+=(100-e.values[2])*t;else if(e.type.indexOf("rgb")!==-1)for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.indexOf("color")!==-1)for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return lf(e)}const XS=b.createContext(null),c6=XS;function u6(){return b.useContext(c6)}const JS=typeof Symbol=="function"&&Symbol.for,QS=JS?Symbol.for("mui.nested"):"__THEME_NESTED__";function ek(e,t){return typeof t=="function"?t(e):w({},e,t)}function tk(e){const{children:t,theme:n}=e,r=u6(),o=b.useMemo(()=>{const i=r===null?n:ek(r,n);return i!=null&&(i[QS]=r!==null),i},[n,r]);return d.jsx(c6.Provider,{value:o,children:t})}const ny={};function ry(e,t,n,r=!1){return b.useMemo(()=>{const o=e&&t[e]||t;if(typeof n=="function"){const i=n(o),s=e?w({},t,{[e]:i}):i;return r?()=>s:s}return e?w({},t,{[e]:n}):w({},t,n)},[e,t,n,r])}function nk(e){const{children:t,theme:n,themeId:r}=e,o=af(ny),i=u6()||ny,s=ry(r,o,n),a=ry(r,i,n,!0);return d.jsx(tk,{theme:a,children:d.jsx(qd.Provider,{value:s,children:t})})}const rk=["component","direction","spacing","divider","children","className","useFlexGap"],ok=sf(),ik=GS("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root});function sk(e){return s6({props:e,name:"MuiStack",defaultTheme:ok})}function ak(e,t){const n=b.Children.toArray(e).filter(Boolean);return n.reduce((r,o,i)=>(r.push(o),i({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],ck=({ownerState:e,theme:t})=>{let n=w({display:"flex",flexDirection:"column"},hr({theme:t},zp({values:e.direction,breakpoints:t.breakpoints.values}),r=>({flexDirection:r})));if(e.spacing){const r=fm(t),o=Object.keys(t.breakpoints.values).reduce((l,c)=>((typeof e.spacing=="object"&&e.spacing[c]!=null||typeof e.direction=="object"&&e.direction[c]!=null)&&(l[c]=!0),l),{}),i=zp({values:e.direction,base:o}),s=zp({values:e.spacing,base:o});typeof i=="object"&&Object.keys(i).forEach((l,c,u)=>{if(!i[l]){const p=c>0?i[u[c-1]]:"column";i[l]=p}}),n=Jt(n,hr({theme:t},s,(l,c)=>e.useFlexGap?{gap:Mi(r,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${lk(c?i[c]:e.direction)}`]:Mi(r,l)}}))}return n=Vw(t.breakpoints,n),n};function uk(e={}){const{createStyledComponent:t=ik,useThemeProps:n=sk,componentName:r="MuiStack"}=e,o=()=>_e({root:["root"]},l=>De(r,l),{}),i=t(ck);return b.forwardRef(function(l,c){const u=n(l),f=hm(u),{component:p="div",direction:x="column",spacing:y=0,divider:g,children:k,className:h,useFlexGap:m=!1}=f,v=Q(f,rk),C={direction:x,spacing:y,useFlexGap:m},S=o();return d.jsx(i,w({as:p,ownerState:C,ref:c,className:le(S.root,h)},v,{children:g?ak(k,g):k}))})}function dk(e,t){return w({toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}}},t)}const fk=["mode","contrastThreshold","tonalOffset"],oy={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Sl.white,default:Sl.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},Bp={text:{primary:Sl.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Sl.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function iy(e,t,n,r){const o=r.light||r,i=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=l6(e.main,o):t==="dark"&&(e.dark=a6(e.main,i)))}function pk(e="light"){return e==="dark"?{main:Wi[200],light:Wi[50],dark:Wi[400]}:{main:Wi[700],light:Wi[400],dark:Wi[800]}}function hk(e="light"){return e==="dark"?{main:Bi[200],light:Bi[50],dark:Bi[400]}:{main:Bi[500],light:Bi[300],dark:Bi[700]}}function mk(e="light"){return e==="dark"?{main:zi[500],light:zi[300],dark:zi[700]}:{main:zi[700],light:zi[400],dark:zi[800]}}function gk(e="light"){return e==="dark"?{main:Hi[400],light:Hi[300],dark:Hi[700]}:{main:Hi[700],light:Hi[500],dark:Hi[900]}}function yk(e="light"){return e==="dark"?{main:Ui[400],light:Ui[300],dark:Ui[700]}:{main:Ui[800],light:Ui[500],dark:Ui[900]}}function vk(e="light"){return e==="dark"?{main:ma[400],light:ma[300],dark:ma[700]}:{main:"#ed6c02",light:ma[500],dark:ma[900]}}function xk(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2}=e,o=Q(e,fk),i=e.primary||pk(t),s=e.secondary||hk(t),a=e.error||mk(t),l=e.info||gk(t),c=e.success||yk(t),u=e.warning||vk(t);function f(g){return qS(g,Bp.text.primary)>=n?Bp.text.primary:oy.text.primary}const p=({color:g,name:k,mainShade:h=500,lightShade:m=300,darkShade:v=700})=>{if(g=w({},g),!g.main&&g[h]&&(g.main=g[h]),!g.hasOwnProperty("main"))throw new Error(Bo(11,k?` (${k})`:"",h));if(typeof g.main!="string")throw new Error(Bo(12,k?` (${k})`:"",JSON.stringify(g.main)));return iy(g,"light",m,r),iy(g,"dark",v,r),g.contrastText||(g.contrastText=f(g.main)),g},x={dark:Bp,light:oy};return Jt(w({common:w({},Sl),mode:t,primary:p({color:i,name:"primary"}),secondary:p({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:p({color:a,name:"error"}),warning:p({color:u,name:"warning"}),info:p({color:l,name:"info"}),success:p({color:c,name:"success"}),grey:m9,contrastThreshold:n,getContrastText:f,augmentColor:p,tonalOffset:r},x[t]),o)}const Ck=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function bk(e){return Math.round(e*1e5)/1e5}const sy={textTransform:"uppercase"},ay='"Roboto", "Helvetica", "Arial", sans-serif';function wk(e,t){const n=typeof t=="function"?t(e):t,{fontFamily:r=ay,fontSize:o=14,fontWeightLight:i=300,fontWeightRegular:s=400,fontWeightMedium:a=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:u,pxToRem:f}=n,p=Q(n,Ck),x=o/14,y=f||(h=>`${h/c*x}rem`),g=(h,m,v,C,S)=>w({fontFamily:r,fontWeight:h,fontSize:y(m),lineHeight:v},r===ay?{letterSpacing:`${bk(C/m)}em`}:{},S,u),k={h1:g(i,96,1.167,-1.5),h2:g(i,60,1.2,-.5),h3:g(s,48,1.167,0),h4:g(s,34,1.235,.25),h5:g(s,24,1.334,0),h6:g(a,20,1.6,.15),subtitle1:g(s,16,1.75,.15),subtitle2:g(a,14,1.57,.1),body1:g(s,16,1.5,.15),body2:g(s,14,1.43,.15),button:g(a,14,1.75,.4,sy),caption:g(s,12,1.66,.4),overline:g(s,12,2.66,1,sy),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Jt(w({htmlFontSize:c,pxToRem:y,fontFamily:r,fontSize:o,fontWeightLight:i,fontWeightRegular:s,fontWeightMedium:a,fontWeightBold:l},k),p,{clone:!1})}const Sk=.2,kk=.14,Pk=.12;function gt(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${Sk})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${kk})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${Pk})`].join(",")}const Ek=["none",gt(0,2,1,-1,0,1,1,0,0,1,3,0),gt(0,3,1,-2,0,2,2,0,0,1,5,0),gt(0,3,3,-2,0,3,4,0,0,1,8,0),gt(0,2,4,-1,0,4,5,0,0,1,10,0),gt(0,3,5,-1,0,5,8,0,0,1,14,0),gt(0,3,5,-1,0,6,10,0,0,1,18,0),gt(0,4,5,-2,0,7,10,1,0,2,16,1),gt(0,5,5,-3,0,8,10,1,0,3,14,2),gt(0,5,6,-3,0,9,12,1,0,3,16,2),gt(0,6,6,-3,0,10,14,1,0,4,18,3),gt(0,6,7,-4,0,11,15,1,0,4,20,3),gt(0,7,8,-4,0,12,17,2,0,5,22,4),gt(0,7,8,-4,0,13,19,2,0,5,24,4),gt(0,7,9,-4,0,14,21,2,0,5,26,4),gt(0,8,9,-5,0,15,22,2,0,6,28,5),gt(0,8,10,-5,0,16,24,2,0,6,30,5),gt(0,8,11,-5,0,17,26,2,0,6,32,5),gt(0,9,11,-5,0,18,28,2,0,7,34,6),gt(0,9,12,-6,0,19,29,2,0,7,36,6),gt(0,10,13,-6,0,20,31,3,0,8,38,7),gt(0,10,13,-6,0,21,33,3,0,8,40,7),gt(0,10,14,-6,0,22,35,3,0,8,42,7),gt(0,11,14,-7,0,23,36,3,0,9,44,8),gt(0,11,15,-7,0,24,38,3,0,9,46,8)],Mk=["duration","easing","delay"],Tk={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},Rk={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function ly(e){return`${Math.round(e)}ms`}function _k(e){if(!e)return 0;const t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function Dk(e){const t=w({},Tk,e.easing),n=w({},Rk,e.duration);return w({getAutoHeightDuration:_k,create:(o=["all"],i={})=>{const{duration:s=n.standard,easing:a=t.easeInOut,delay:l=0}=i;return Q(i,Mk),(Array.isArray(o)?o:[o]).map(c=>`${c} ${typeof s=="string"?s:ly(s)} ${a} ${typeof l=="string"?l:ly(l)}`).join(",")}},e,{easing:t,duration:n})}const Ok={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},Ik=Ok,$k=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function nn(e={},...t){const{mixins:n={},palette:r={},transitions:o={},typography:i={}}=e,s=Q(e,$k);if(e.vars)throw new Error(Bo(18));const a=xk(r),l=sf(e);let c=Jt(l,{mixins:dk(l.breakpoints,n),palette:a,shadows:Ek.slice(),typography:wk(a,i),transitions:Dk(o),zIndex:w({},Ik)});return c=Jt(c,s),c=t.reduce((u,f)=>Jt(u,f),c),c.unstable_sxConfig=w({},of,s==null?void 0:s.unstable_sxConfig),c.unstable_sx=function(f){return Zl({sx:f,theme:this})},c}function Fk(e){return String(e).match(/[\d.\-+]*\s*(.*)/)[1]||""}function Ak(e){return parseFloat(e)}const Lk=nn(),cf=Lk;function Le(){const e=Js(cf);return e[Pi]||e}function Te({props:e,name:t}){return s6({props:e,name:t,defaultTheme:cf,themeId:Pi})}const rn=e=>qa(e)&&e!=="classes",uf=qa,H=o6({themeId:Pi,defaultTheme:cf,rootShouldForwardProp:rn}),jk=["theme"];function d6(e){let{theme:t}=e,n=Q(e,jk);const r=t[Pi];return d.jsx(nk,w({},n,{themeId:r?Pi:void 0,theme:r||t}))}const cy=e=>{let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,(t/100).toFixed(2)};function Nk(e){return De("MuiSvgIcon",e)}Ee("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Vk=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],zk=e=>{const{color:t,fontSize:n,classes:r}=e,o={root:["root",t!=="inherit"&&`color${te(t)}`,`fontSize${te(n)}`]};return _e(o,Nk,r)},Bk=H("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${te(n.color)}`],t[`fontSize${te(n.fontSize)}`]]}})(({theme:e,ownerState:t})=>{var n,r,o,i,s,a,l,c,u,f,p,x,y;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:t.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(n=e.transitions)==null||(r=n.create)==null?void 0:r.call(n,"fill",{duration:(o=e.transitions)==null||(o=o.duration)==null?void 0:o.shorter}),fontSize:{inherit:"inherit",small:((i=e.typography)==null||(s=i.pxToRem)==null?void 0:s.call(i,20))||"1.25rem",medium:((a=e.typography)==null||(l=a.pxToRem)==null?void 0:l.call(a,24))||"1.5rem",large:((c=e.typography)==null||(u=c.pxToRem)==null?void 0:u.call(c,35))||"2.1875rem"}[t.fontSize],color:(f=(p=(e.vars||e).palette)==null||(p=p[t.color])==null?void 0:p.main)!=null?f:{action:(x=(e.vars||e).palette)==null||(x=x.action)==null?void 0:x.active,disabled:(y=(e.vars||e).palette)==null||(y=y.action)==null?void 0:y.disabled,inherit:void 0}[t.color]}}),x1=b.forwardRef(function(t,n){const r=Te({props:t,name:"MuiSvgIcon"}),{children:o,className:i,color:s="inherit",component:a="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:u=!1,titleAccess:f,viewBox:p="0 0 24 24"}=r,x=Q(r,Vk),y=b.isValidElement(o)&&o.type==="svg",g=w({},r,{color:s,component:a,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:u,viewBox:p,hasSvgAsChild:y}),k={};u||(k.viewBox=p);const h=zk(g);return d.jsxs(Bk,w({as:a,className:le(h.root,i),focusable:"false",color:c,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n},k,x,y&&o.props,{ownerState:g,children:[y?o.props.children:o,f?d.jsx("title",{children:f}):null]}))});x1.muiName="SvgIcon";function Gt(e,t){function n(r,o){return d.jsx(x1,w({"data-testid":`${t}Icon`,ref:o},r,{children:e}))}return n.muiName=x1.muiName,b.memo(b.forwardRef(n))}var it={};/** + * @license React + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var gm=Symbol.for("react.element"),ym=Symbol.for("react.portal"),df=Symbol.for("react.fragment"),ff=Symbol.for("react.strict_mode"),pf=Symbol.for("react.profiler"),hf=Symbol.for("react.provider"),mf=Symbol.for("react.context"),Wk=Symbol.for("react.server_context"),gf=Symbol.for("react.forward_ref"),yf=Symbol.for("react.suspense"),vf=Symbol.for("react.suspense_list"),xf=Symbol.for("react.memo"),Cf=Symbol.for("react.lazy"),Hk=Symbol.for("react.offscreen"),f6;f6=Symbol.for("react.module.reference");function tr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case gm:switch(e=e.type,e){case df:case pf:case ff:case yf:case vf:return e;default:switch(e=e&&e.$$typeof,e){case Wk:case mf:case gf:case Cf:case xf:case hf:return e;default:return t}}case ym:return t}}}it.ContextConsumer=mf;it.ContextProvider=hf;it.Element=gm;it.ForwardRef=gf;it.Fragment=df;it.Lazy=Cf;it.Memo=xf;it.Portal=ym;it.Profiler=pf;it.StrictMode=ff;it.Suspense=yf;it.SuspenseList=vf;it.isAsyncMode=function(){return!1};it.isConcurrentMode=function(){return!1};it.isContextConsumer=function(e){return tr(e)===mf};it.isContextProvider=function(e){return tr(e)===hf};it.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===gm};it.isForwardRef=function(e){return tr(e)===gf};it.isFragment=function(e){return tr(e)===df};it.isLazy=function(e){return tr(e)===Cf};it.isMemo=function(e){return tr(e)===xf};it.isPortal=function(e){return tr(e)===ym};it.isProfiler=function(e){return tr(e)===pf};it.isStrictMode=function(e){return tr(e)===ff};it.isSuspense=function(e){return tr(e)===yf};it.isSuspenseList=function(e){return tr(e)===vf};it.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===df||e===pf||e===ff||e===yf||e===vf||e===Hk||typeof e=="object"&&e!==null&&(e.$$typeof===Cf||e.$$typeof===xf||e.$$typeof===hf||e.$$typeof===mf||e.$$typeof===gf||e.$$typeof===f6||e.getModuleId!==void 0)};it.typeOf=tr;function C1(e,t){return C1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},C1(e,t)}function vm(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,C1(e,t)}function Uk(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function Yk(e,t){e.classList?e.classList.add(t):Uk(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function uy(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function Gk(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=uy(e.className,t):e.setAttribute("class",uy(e.className&&e.className.baseVal||"",t))}const dy={disabled:!1},nd=Fe.createContext(null);var p6=function(t){return t.scrollTop},ja="unmounted",ri="exited",oi="entering",Ji="entered",b1="exiting",mo=function(e){vm(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var s=o,a=s&&!s.isMounting?r.enter:r.appear,l;return i.appearStatus=null,r.in?a?(l=ri,i.appearStatus=oi):l=Ji:r.unmountOnExit||r.mountOnEnter?l=ja:l=ri,i.state={status:l},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var s=o.in;return s&&i.status===ja?{status:ri}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var i=null;if(o!==this.props){var s=this.state.status;this.props.in?s!==oi&&s!==Ji&&(i=oi):(s===oi||s===Ji)&&(i=b1)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,i,s,a;return i=s=a=o,o!=null&&typeof o!="number"&&(i=o.exit,s=o.enter,a=o.appear!==void 0?o.appear:s),{exit:i,enter:s,appear:a}},n.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null)if(this.cancelNextCallback(),i===oi){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:Rc.findDOMNode(this);s&&p6(s)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ri&&this.setState({status:ja})},n.performEnter=function(o){var i=this,s=this.props.enter,a=this.context?this.context.isMounting:o,l=this.props.nodeRef?[a]:[Rc.findDOMNode(this),a],c=l[0],u=l[1],f=this.getTimeouts(),p=a?f.appear:f.enter;if(!o&&!s||dy.disabled){this.safeSetState({status:Ji},function(){i.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:oi},function(){i.props.onEntering(c,u),i.onTransitionEnd(p,function(){i.safeSetState({status:Ji},function(){i.props.onEntered(c,u)})})})},n.performExit=function(){var o=this,i=this.props.exit,s=this.getTimeouts(),a=this.props.nodeRef?void 0:Rc.findDOMNode(this);if(!i||dy.disabled){this.safeSetState({status:ri},function(){o.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:b1},function(){o.props.onExiting(a),o.onTransitionEnd(s.exit,function(){o.safeSetState({status:ri},function(){o.props.onExited(a)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},n.setNextCallback=function(o){var i=this,s=!0;return this.nextCallback=function(a){s&&(s=!1,i.nextCallback=null,o(a))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},n.onTransitionEnd=function(o,i){this.setNextCallback(i);var s=this.props.nodeRef?this.props.nodeRef.current:Rc.findDOMNode(this),a=o==null&&!this.props.addEndListener;if(!s||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===ja)return null;var i=this.props,s=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var a=Q(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Fe.createElement(nd.Provider,{value:null},typeof s=="function"?s(o,a):Fe.cloneElement(Fe.Children.only(s),a))},t}(Fe.Component);mo.contextType=nd;mo.propTypes={};function Yi(){}mo.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Yi,onEntering:Yi,onEntered:Yi,onExit:Yi,onExiting:Yi,onExited:Yi};mo.UNMOUNTED=ja;mo.EXITED=ri;mo.ENTERING=oi;mo.ENTERED=Ji;mo.EXITING=b1;const xm=mo;var Kk=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return Yk(t,r)})},Wp=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return Gk(t,r)})},Cm=function(e){vm(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;se.scrollTop;function rd(e,t){var n,r;const{timeout:o,easing:i,style:s={}}=e;return{duration:(n=s.transitionDuration)!=null?n:typeof o=="number"?o:o[t.mode]||0,easing:(r=s.transitionTimingFunction)!=null?r:typeof i=="object"?i[t.mode]:i,delay:s.transitionDelay}}function nP(e){return De("MuiPaper",e)}Ee("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const rP=["className","component","elevation","square","variant"],oP=e=>{const{square:t,elevation:n,variant:r,classes:o}=e,i={root:["root",r,!t&&"rounded",r==="elevation"&&`elevation${n}`]};return _e(i,nP,o)},iP=H("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant==="elevation"&&t[`elevation${n.elevation}`]]}})(({theme:e,ownerState:t})=>{var n;return w({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow")},!t.square&&{borderRadius:e.shape.borderRadius},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.divider}`},t.variant==="elevation"&&w({boxShadow:(e.vars||e).shadows[t.elevation]},!e.vars&&e.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${Ne("#fff",cy(t.elevation))}, ${Ne("#fff",cy(t.elevation))})`},e.vars&&{backgroundImage:(n=e.vars.overlays)==null?void 0:n[t.elevation]}))}),sP=b.forwardRef(function(t,n){const r=Te({props:t,name:"MuiPaper"}),{className:o,component:i="div",elevation:s=1,square:a=!1,variant:l="elevation"}=r,c=Q(r,rP),u=w({},r,{component:i,elevation:s,square:a,variant:l}),f=oP(u);return d.jsx(iP,w({as:i,ownerState:u,className:le(f.root,o),ref:n},c))}),ql=sP;function Or(e){return typeof e=="string"}function aP(e,t,n){return e===void 0||Or(e)?t:w({},t,{ownerState:w({},t.ownerState,n)})}function lP(e,t,n=(r,o)=>r===o){return e.length===t.length&&e.every((r,o)=>n(r,t[o]))}const cP={disableDefaultClasses:!1},uP=b.createContext(cP);function dP(e){const{disableDefaultClasses:t}=b.useContext(uP);return n=>t?"":e(n)}function Xa(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function km(e,t,n){return typeof e=="function"?e(t,n):e}function fy(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function fP(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:o,className:i}=e;if(!t){const x=le(n==null?void 0:n.className,i,o==null?void 0:o.className,r==null?void 0:r.className),y=w({},n==null?void 0:n.style,o==null?void 0:o.style,r==null?void 0:r.style),g=w({},n,o,r);return x.length>0&&(g.className=x),Object.keys(y).length>0&&(g.style=y),{props:g,internalRef:void 0}}const s=Xa(w({},o,r)),a=fy(r),l=fy(o),c=t(s),u=le(c==null?void 0:c.className,n==null?void 0:n.className,i,o==null?void 0:o.className,r==null?void 0:r.className),f=w({},c==null?void 0:c.style,n==null?void 0:n.style,o==null?void 0:o.style,r==null?void 0:r.style),p=w({},c,n,l,a);return u.length>0&&(p.className=u),Object.keys(f).length>0&&(p.style=f),{props:p,internalRef:c.ref}}const pP=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function We(e){var t;const{elementType:n,externalSlotProps:r,ownerState:o,skipResolvingSlotProps:i=!1}=e,s=Q(e,pP),a=i?{}:km(r,o),{props:l,internalRef:c}=fP(w({},s,{externalSlotProps:a})),u=tt(c,a==null?void 0:a.ref,(t=e.additionalProps)==null?void 0:t.ref);return aP(n,w({},l,{ref:u}),o)}function hP(e){const{className:t,classes:n,pulsate:r=!1,rippleX:o,rippleY:i,rippleSize:s,in:a,onExited:l,timeout:c}=e,[u,f]=b.useState(!1),p=le(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),x={width:s,height:s,top:-(s/2)+i,left:-(s/2)+o},y=le(n.child,u&&n.childLeaving,r&&n.childPulsate);return!a&&!u&&f(!0),b.useEffect(()=>{if(!a&&l!=null){const g=setTimeout(l,c);return()=>{clearTimeout(g)}}},[l,a,c]),d.jsx("span",{className:p,style:x,children:d.jsx("span",{className:y})})}const Nn=Ee("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),mP=["center","classes","className"];let bf=e=>e,py,hy,my,gy;const w1=550,gP=80,yP=Gl(py||(py=bf` + 0% { + transform: scale(0); + opacity: 0.1; + } + + 100% { + transform: scale(1); + opacity: 0.3; + } +`)),vP=Gl(hy||(hy=bf` + 0% { + opacity: 1; + } + + 100% { + opacity: 0; + } +`)),xP=Gl(my||(my=bf` + 0% { + transform: scale(1); + } + + 50% { + transform: scale(0.92); + } + + 100% { + transform: scale(1); + } +`)),CP=H("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),bP=H(hP,{name:"MuiTouchRipple",slot:"Ripple"})(gy||(gy=bf` + opacity: 0; + position: absolute; + + &.${0} { + opacity: 0.3; + transform: scale(1); + animation-name: ${0}; + animation-duration: ${0}ms; + animation-timing-function: ${0}; + } + + &.${0} { + animation-duration: ${0}ms; + } + + & .${0} { + opacity: 1; + display: block; + width: 100%; + height: 100%; + border-radius: 50%; + background-color: currentColor; + } + + & .${0} { + opacity: 0; + animation-name: ${0}; + animation-duration: ${0}ms; + animation-timing-function: ${0}; + } + + & .${0} { + position: absolute; + /* @noflip */ + left: 0px; + top: 0; + animation-name: ${0}; + animation-duration: 2500ms; + animation-timing-function: ${0}; + animation-iteration-count: infinite; + animation-delay: 200ms; + } +`),Nn.rippleVisible,yP,w1,({theme:e})=>e.transitions.easing.easeInOut,Nn.ripplePulsate,({theme:e})=>e.transitions.duration.shorter,Nn.child,Nn.childLeaving,vP,w1,({theme:e})=>e.transitions.easing.easeInOut,Nn.childPulsate,xP,({theme:e})=>e.transitions.easing.easeInOut),wP=b.forwardRef(function(t,n){const r=Te({props:t,name:"MuiTouchRipple"}),{center:o=!1,classes:i={},className:s}=r,a=Q(r,mP),[l,c]=b.useState([]),u=b.useRef(0),f=b.useRef(null);b.useEffect(()=>{f.current&&(f.current(),f.current=null)},[l]);const p=b.useRef(!1),x=b.useRef(0),y=b.useRef(null),g=b.useRef(null);b.useEffect(()=>()=>{x.current&&clearTimeout(x.current)},[]);const k=b.useCallback(C=>{const{pulsate:S,rippleX:E,rippleY:P,rippleSize:M,cb:T}=C;c(R=>[...R,d.jsx(bP,{classes:{ripple:le(i.ripple,Nn.ripple),rippleVisible:le(i.rippleVisible,Nn.rippleVisible),ripplePulsate:le(i.ripplePulsate,Nn.ripplePulsate),child:le(i.child,Nn.child),childLeaving:le(i.childLeaving,Nn.childLeaving),childPulsate:le(i.childPulsate,Nn.childPulsate)},timeout:w1,pulsate:S,rippleX:E,rippleY:P,rippleSize:M},u.current)]),u.current+=1,f.current=T},[i]),h=b.useCallback((C={},S={},E=()=>{})=>{const{pulsate:P=!1,center:M=o||S.pulsate,fakeElement:T=!1}=S;if((C==null?void 0:C.type)==="mousedown"&&p.current){p.current=!1;return}(C==null?void 0:C.type)==="touchstart"&&(p.current=!0);const R=T?null:g.current,O=R?R.getBoundingClientRect():{width:0,height:0,left:0,top:0};let A,$,_;if(M||C===void 0||C.clientX===0&&C.clientY===0||!C.clientX&&!C.touches)A=Math.round(O.width/2),$=Math.round(O.height/2);else{const{clientX:D,clientY:L}=C.touches&&C.touches.length>0?C.touches[0]:C;A=Math.round(D-O.left),$=Math.round(L-O.top)}if(M)_=Math.sqrt((2*O.width**2+O.height**2)/3),_%2===0&&(_+=1);else{const D=Math.max(Math.abs((R?R.clientWidth:0)-A),A)*2+2,L=Math.max(Math.abs((R?R.clientHeight:0)-$),$)*2+2;_=Math.sqrt(D**2+L**2)}C!=null&&C.touches?y.current===null&&(y.current=()=>{k({pulsate:P,rippleX:A,rippleY:$,rippleSize:_,cb:E})},x.current=setTimeout(()=>{y.current&&(y.current(),y.current=null)},gP)):k({pulsate:P,rippleX:A,rippleY:$,rippleSize:_,cb:E})},[o,k]),m=b.useCallback(()=>{h({},{pulsate:!0})},[h]),v=b.useCallback((C,S)=>{if(clearTimeout(x.current),(C==null?void 0:C.type)==="touchend"&&y.current){y.current(),y.current=null,x.current=setTimeout(()=>{v(C,S)});return}y.current=null,c(E=>E.length>0?E.slice(1):E),f.current=S},[]);return b.useImperativeHandle(n,()=>({pulsate:m,start:h,stop:v}),[m,h,v]),d.jsx(CP,w({className:le(Nn.root,i.root,s),ref:g},a,{children:d.jsx(Sm,{component:null,exit:!0,children:l})}))}),SP=wP;function kP(e){return De("MuiButtonBase",e)}const PP=Ee("MuiButtonBase",["root","disabled","focusVisible"]),EP=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],MP=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:o}=e,s=_e({root:["root",t&&"disabled",n&&"focusVisible"]},kP,o);return n&&r&&(s.root+=` ${r}`),s},TP=H("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${PP.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),RP=b.forwardRef(function(t,n){const r=Te({props:t,name:"MuiButtonBase"}),{action:o,centerRipple:i=!1,children:s,className:a,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:f=!1,focusRipple:p=!1,LinkComponent:x="a",onBlur:y,onClick:g,onContextMenu:k,onDragLeave:h,onFocus:m,onFocusVisible:v,onKeyDown:C,onKeyUp:S,onMouseDown:E,onMouseLeave:P,onMouseUp:M,onTouchEnd:T,onTouchMove:R,onTouchStart:O,tabIndex:A=0,TouchRippleProps:$,touchRippleRef:_,type:D}=r,L=Q(r,EP),V=b.useRef(null),I=b.useRef(null),F=tt(I,_),{isFocusVisibleRef:z,onFocus:ae,onBlur:re,ref:de}=Jd(),[W,ne]=b.useState(!1);c&&W&&ne(!1),b.useImperativeHandle(o,()=>({focusVisible:()=>{ne(!0),V.current.focus()}}),[]);const[pe,Y]=b.useState(!1);b.useEffect(()=>{Y(!0)},[]);const me=pe&&!u&&!c;b.useEffect(()=>{W&&p&&!u&&pe&&I.current.pulsate()},[u,p,W,pe]);function Se(ye,Ke,Ve=f){return Me(He=>(Ke&&Ke(He),!Ve&&I.current&&I.current[ye](He),!0))}const Pe=Se("start",E),ee=Se("stop",k),J=Se("stop",h),j=Se("stop",M),U=Se("stop",ye=>{W&&ye.preventDefault(),P&&P(ye)}),K=Se("start",O),xe=Se("stop",T),Ie=Se("stop",R),se=Se("stop",ye=>{re(ye),z.current===!1&&ne(!1),y&&y(ye)},!1),fe=Me(ye=>{V.current||(V.current=ye.currentTarget),ae(ye),z.current===!0&&(ne(!0),v&&v(ye)),m&&m(ye)}),B=()=>{const ye=V.current;return l&&l!=="button"&&!(ye.tagName==="A"&&ye.href)},q=b.useRef(!1),we=Me(ye=>{p&&!q.current&&W&&I.current&&ye.key===" "&&(q.current=!0,I.current.stop(ye,()=>{I.current.start(ye)})),ye.target===ye.currentTarget&&B()&&ye.key===" "&&ye.preventDefault(),C&&C(ye),ye.target===ye.currentTarget&&B()&&ye.key==="Enter"&&!c&&(ye.preventDefault(),g&&g(ye))}),$e=Me(ye=>{p&&ye.key===" "&&I.current&&W&&!ye.defaultPrevented&&(q.current=!1,I.current.stop(ye,()=>{I.current.pulsate(ye)})),S&&S(ye),g&&ye.target===ye.currentTarget&&B()&&ye.key===" "&&!ye.defaultPrevented&&g(ye)});let ke=l;ke==="button"&&(L.href||L.to)&&(ke=x);const Z={};ke==="button"?(Z.type=D===void 0?"button":D,Z.disabled=c):(!L.href&&!L.to&&(Z.role="button"),c&&(Z["aria-disabled"]=c));const he=tt(n,de,V),ve=w({},r,{centerRipple:i,component:l,disabled:c,disableRipple:u,disableTouchRipple:f,focusRipple:p,tabIndex:A,focusVisible:W}),ge=MP(ve);return d.jsxs(TP,w({as:ke,className:le(ge.root,a),ownerState:ve,onBlur:se,onClick:g,onContextMenu:ee,onFocus:fe,onKeyDown:we,onKeyUp:$e,onMouseDown:Pe,onMouseLeave:U,onMouseUp:j,onDragLeave:J,onTouchEnd:xe,onTouchMove:Ie,onTouchStart:K,ref:he,tabIndex:c?-1:A,type:D},Z,L,{children:[s,me?d.jsx(SP,w({ref:F,center:i},$)):null]}))}),$r=RP;function _P(e){return De("MuiIconButton",e)}const DP=Ee("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),OP=["edge","children","className","color","disabled","disableFocusRipple","size"],IP=e=>{const{classes:t,disabled:n,color:r,edge:o,size:i}=e,s={root:["root",n&&"disabled",r!=="default"&&`color${te(r)}`,o&&`edge${te(o)}`,`size${te(i)}`]};return _e(s,_P,t)},$P=H($r,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="default"&&t[`color${te(n.color)}`],n.edge&&t[`edge${te(n.edge)}`],t[`size${te(n.size)}`]]}})(({theme:e,ownerState:t})=>w({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest})},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Ne(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},t.edge==="start"&&{marginLeft:t.size==="small"?-3:-12},t.edge==="end"&&{marginRight:t.size==="small"?-3:-12}),({theme:e,ownerState:t})=>{var n;const r=(n=(e.vars||e).palette)==null?void 0:n[t.color];return w({},t.color==="inherit"&&{color:"inherit"},t.color!=="inherit"&&t.color!=="default"&&w({color:r==null?void 0:r.main},!t.disableRipple&&{"&:hover":w({},r&&{backgroundColor:e.vars?`rgba(${r.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Ne(r.main,e.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),t.size==="small"&&{padding:5,fontSize:e.typography.pxToRem(18)},t.size==="large"&&{padding:12,fontSize:e.typography.pxToRem(28)},{[`&.${DP.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled}})}),FP=b.forwardRef(function(t,n){const r=Te({props:t,name:"MuiIconButton"}),{edge:o=!1,children:i,className:s,color:a="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium"}=r,f=Q(r,OP),p=w({},r,{edge:o,color:a,disabled:l,disableFocusRipple:c,size:u}),x=IP(p);return d.jsx($P,w({className:le(x.root,s),centerRipple:!0,focusRipple:!c,disabled:l,ref:n,ownerState:p},f,{children:i}))}),Qs=FP;function AP(e){return De("MuiTypography",e)}Ee("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const LP=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],jP=e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:o,variant:i,classes:s}=e,a={root:["root",i,e.align!=="inherit"&&`align${te(t)}`,n&&"gutterBottom",r&&"noWrap",o&&"paragraph"]};return _e(a,AP,s)},NP=H("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],n.align!=="inherit"&&t[`align${te(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(({theme:e,ownerState:t})=>w({margin:0},t.variant==="inherit"&&{font:"inherit"},t.variant!=="inherit"&&e.typography[t.variant],t.align!=="inherit"&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),yy={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},VP={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},zP=e=>VP[e]||e,BP=b.forwardRef(function(t,n){const r=Te({props:t,name:"MuiTypography"}),o=zP(r.color),i=hm(w({},r,{color:o})),{align:s="inherit",className:a,component:l,gutterBottom:c=!1,noWrap:u=!1,paragraph:f=!1,variant:p="body1",variantMapping:x=yy}=i,y=Q(i,LP),g=w({},i,{align:s,color:o,className:a,component:l,gutterBottom:c,noWrap:u,paragraph:f,variant:p,variantMapping:x}),k=l||(f?"p":x[p]||yy[p])||"span",h=jP(g);return d.jsx(NP,w({as:k,ref:n,ownerState:g,className:le(h.root,a)},y))}),Re=BP,m6="base";function WP(e){return`${m6}--${e}`}function HP(e,t){return`${m6}-${e}-${t}`}function g6(e,t){const n=J3[t];return n?WP(n):HP(e,t)}function UP(e,t){const n={};return t.forEach(r=>{n[r]=g6(e,r)}),n}const YP=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function GP(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function KP(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=r=>e.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}function ZP(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||KP(e))}function qP(e){const t=[],n=[];return Array.from(e.querySelectorAll(YP)).forEach((r,o)=>{const i=GP(r);i===-1||!ZP(r)||(i===0?t.push(r):n.push({documentOrder:o,tabIndex:i,node:r}))}),n.sort((r,o)=>r.tabIndex===o.tabIndex?r.documentOrder-o.documentOrder:r.tabIndex-o.tabIndex).map(r=>r.node).concat(t)}function XP(){return!0}function y6(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:o=!1,getTabbable:i=qP,isEnabled:s=XP,open:a}=e,l=b.useRef(!1),c=b.useRef(null),u=b.useRef(null),f=b.useRef(null),p=b.useRef(null),x=b.useRef(!1),y=b.useRef(null),g=tt(t.ref,y),k=b.useRef(null);b.useEffect(()=>{!a||!y.current||(x.current=!n)},[n,a]),b.useEffect(()=>{if(!a||!y.current)return;const v=Et(y.current);return y.current.contains(v.activeElement)||(y.current.hasAttribute("tabIndex")||y.current.setAttribute("tabIndex","-1"),x.current&&y.current.focus()),()=>{o||(f.current&&f.current.focus&&(l.current=!0,f.current.focus()),f.current=null)}},[a]),b.useEffect(()=>{if(!a||!y.current)return;const v=Et(y.current),C=P=>{k.current=P,!(r||!s()||P.key!=="Tab")&&v.activeElement===y.current&&P.shiftKey&&(l.current=!0,u.current&&u.current.focus())},S=()=>{const P=y.current;if(P===null)return;if(!v.hasFocus()||!s()||l.current){l.current=!1;return}if(P.contains(v.activeElement)||r&&v.activeElement!==c.current&&v.activeElement!==u.current)return;if(v.activeElement!==p.current)p.current=null;else if(p.current!==null)return;if(!x.current)return;let M=[];if((v.activeElement===c.current||v.activeElement===u.current)&&(M=i(y.current)),M.length>0){var T,R;const O=!!((T=k.current)!=null&&T.shiftKey&&((R=k.current)==null?void 0:R.key)==="Tab"),A=M[0],$=M[M.length-1];typeof A!="string"&&typeof $!="string"&&(O?$.focus():A.focus())}else P.focus()};v.addEventListener("focusin",S),v.addEventListener("keydown",C,!0);const E=setInterval(()=>{v.activeElement&&v.activeElement.tagName==="BODY"&&S()},50);return()=>{clearInterval(E),v.removeEventListener("focusin",S),v.removeEventListener("keydown",C,!0)}},[n,r,o,s,a,i]);const h=v=>{f.current===null&&(f.current=v.relatedTarget),x.current=!0,p.current=v.target;const C=t.props.onFocus;C&&C(v)},m=v=>{f.current===null&&(f.current=v.relatedTarget),x.current=!0};return d.jsxs(b.Fragment,{children:[d.jsx("div",{tabIndex:a?0:-1,onFocus:m,ref:c,"data-testid":"sentinelStart"}),b.cloneElement(t,{ref:g,onFocus:h}),d.jsx("div",{tabIndex:a?0:-1,onFocus:m,ref:u,"data-testid":"sentinelEnd"})]})}var vn="top",Xn="bottom",Jn="right",xn="left",Pm="auto",Xl=[vn,Xn,Jn,xn],js="start",Ml="end",JP="clippingParents",v6="viewport",ya="popper",QP="reference",vy=Xl.reduce(function(e,t){return e.concat([t+"-"+js,t+"-"+Ml])},[]),x6=[].concat(Xl,[Pm]).reduce(function(e,t){return e.concat([t,t+"-"+js,t+"-"+Ml])},[]),eE="beforeRead",tE="read",nE="afterRead",rE="beforeMain",oE="main",iE="afterMain",sE="beforeWrite",aE="write",lE="afterWrite",cE=[eE,tE,nE,rE,oE,iE,sE,aE,lE];function Fr(e){return e?(e.nodeName||"").toLowerCase():null}function _n(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ri(e){var t=_n(e).Element;return e instanceof t||e instanceof Element}function Yn(e){var t=_n(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Em(e){if(typeof ShadowRoot>"u")return!1;var t=_n(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function uE(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},i=t.elements[n];!Yn(i)||!Fr(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(s){var a=o[s];a===!1?i.removeAttribute(s):i.setAttribute(s,a===!0?"":a)}))})}function dE(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],i=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),a=s.reduce(function(l,c){return l[c]="",l},{});!Yn(o)||!Fr(o)||(Object.assign(o.style,a),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const fE={name:"applyStyles",enabled:!0,phase:"write",fn:uE,effect:dE,requires:["computeStyles"]};function Ir(e){return e.split("-")[0]}var gi=Math.max,od=Math.min,Ns=Math.round;function S1(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function C6(){return!/^((?!chrome|android).)*safari/i.test(S1())}function Vs(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&Yn(e)&&(o=e.offsetWidth>0&&Ns(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Ns(r.height)/e.offsetHeight||1);var s=Ri(e)?_n(e):window,a=s.visualViewport,l=!C6()&&n,c=(r.left+(l&&a?a.offsetLeft:0))/o,u=(r.top+(l&&a?a.offsetTop:0))/i,f=r.width/o,p=r.height/i;return{width:f,height:p,top:u,right:c+f,bottom:u+p,left:c,x:c,y:u}}function Mm(e){var t=Vs(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function b6(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Em(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function lo(e){return _n(e).getComputedStyle(e)}function pE(e){return["table","td","th"].indexOf(Fr(e))>=0}function Go(e){return((Ri(e)?e.ownerDocument:e.document)||window.document).documentElement}function wf(e){return Fr(e)==="html"?e:e.assignedSlot||e.parentNode||(Em(e)?e.host:null)||Go(e)}function xy(e){return!Yn(e)||lo(e).position==="fixed"?null:e.offsetParent}function hE(e){var t=/firefox/i.test(S1()),n=/Trident/i.test(S1());if(n&&Yn(e)){var r=lo(e);if(r.position==="fixed")return null}var o=wf(e);for(Em(o)&&(o=o.host);Yn(o)&&["html","body"].indexOf(Fr(o))<0;){var i=lo(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function Jl(e){for(var t=_n(e),n=xy(e);n&&pE(n)&&lo(n).position==="static";)n=xy(n);return n&&(Fr(n)==="html"||Fr(n)==="body"&&lo(n).position==="static")?t:n||hE(e)||t}function Tm(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Ja(e,t,n){return gi(e,od(t,n))}function mE(e,t,n){var r=Ja(e,t,n);return r>n?n:r}function w6(){return{top:0,right:0,bottom:0,left:0}}function S6(e){return Object.assign({},w6(),e)}function k6(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var gE=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,S6(typeof t!="number"?t:k6(t,Xl))};function yE(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,a=Ir(n.placement),l=Tm(a),c=[xn,Jn].indexOf(a)>=0,u=c?"height":"width";if(!(!i||!s)){var f=gE(o.padding,n),p=Mm(i),x=l==="y"?vn:xn,y=l==="y"?Xn:Jn,g=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],k=s[l]-n.rects.reference[l],h=Jl(i),m=h?l==="y"?h.clientHeight||0:h.clientWidth||0:0,v=g/2-k/2,C=f[x],S=m-p[u]-f[y],E=m/2-p[u]/2+v,P=Ja(C,E,S),M=l;n.modifiersData[r]=(t={},t[M]=P,t.centerOffset=P-E,t)}}function vE(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||b6(t.elements.popper,o)&&(t.elements.arrow=o))}const xE={name:"arrow",enabled:!0,phase:"main",fn:yE,effect:vE,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function zs(e){return e.split("-")[1]}var CE={top:"auto",right:"auto",bottom:"auto",left:"auto"};function bE(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:Ns(n*o)/o||0,y:Ns(r*o)/o||0}}function Cy(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,s=e.offsets,a=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,f=e.isFixed,p=s.x,x=p===void 0?0:p,y=s.y,g=y===void 0?0:y,k=typeof u=="function"?u({x,y:g}):{x,y:g};x=k.x,g=k.y;var h=s.hasOwnProperty("x"),m=s.hasOwnProperty("y"),v=xn,C=vn,S=window;if(c){var E=Jl(n),P="clientHeight",M="clientWidth";if(E===_n(n)&&(E=Go(n),lo(E).position!=="static"&&a==="absolute"&&(P="scrollHeight",M="scrollWidth")),E=E,o===vn||(o===xn||o===Jn)&&i===Ml){C=Xn;var T=f&&E===S&&S.visualViewport?S.visualViewport.height:E[P];g-=T-r.height,g*=l?1:-1}if(o===xn||(o===vn||o===Xn)&&i===Ml){v=Jn;var R=f&&E===S&&S.visualViewport?S.visualViewport.width:E[M];x-=R-r.width,x*=l?1:-1}}var O=Object.assign({position:a},c&&CE),A=u===!0?bE({x,y:g},_n(n)):{x,y:g};if(x=A.x,g=A.y,l){var $;return Object.assign({},O,($={},$[C]=m?"0":"",$[v]=h?"0":"",$.transform=(S.devicePixelRatio||1)<=1?"translate("+x+"px, "+g+"px)":"translate3d("+x+"px, "+g+"px, 0)",$))}return Object.assign({},O,(t={},t[C]=m?g+"px":"",t[v]=h?x+"px":"",t.transform="",t))}function wE(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,s=i===void 0?!0:i,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:Ir(t.placement),variation:zs(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Cy(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Cy(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const SE={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:wE,data:{}};var Dc={passive:!0};function kE(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=o===void 0?!0:o,s=r.resize,a=s===void 0?!0:s,l=_n(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",n.update,Dc)}),a&&l.addEventListener("resize",n.update,Dc),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",n.update,Dc)}),a&&l.removeEventListener("resize",n.update,Dc)}}const PE={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:kE,data:{}};var EE={left:"right",right:"left",bottom:"top",top:"bottom"};function mu(e){return e.replace(/left|right|bottom|top/g,function(t){return EE[t]})}var ME={start:"end",end:"start"};function by(e){return e.replace(/start|end/g,function(t){return ME[t]})}function Rm(e){var t=_n(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function _m(e){return Vs(Go(e)).left+Rm(e).scrollLeft}function TE(e,t){var n=_n(e),r=Go(e),o=n.visualViewport,i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;var c=C6();(c||!c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a+_m(e),y:l}}function RE(e){var t,n=Go(e),r=Rm(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=gi(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=gi(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),a=-r.scrollLeft+_m(e),l=-r.scrollTop;return lo(o||n).direction==="rtl"&&(a+=gi(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:a,y:l}}function Dm(e){var t=lo(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function P6(e){return["html","body","#document"].indexOf(Fr(e))>=0?e.ownerDocument.body:Yn(e)&&Dm(e)?e:P6(wf(e))}function Qa(e,t){var n;t===void 0&&(t=[]);var r=P6(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=_n(r),s=o?[i].concat(i.visualViewport||[],Dm(r)?r:[]):r,a=t.concat(s);return o?a:a.concat(Qa(wf(s)))}function k1(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function _E(e,t){var n=Vs(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function wy(e,t,n){return t===v6?k1(TE(e,n)):Ri(t)?_E(t,n):k1(RE(Go(e)))}function DE(e){var t=Qa(wf(e)),n=["absolute","fixed"].indexOf(lo(e).position)>=0,r=n&&Yn(e)?Jl(e):e;return Ri(r)?t.filter(function(o){return Ri(o)&&b6(o,r)&&Fr(o)!=="body"}):[]}function OE(e,t,n,r){var o=t==="clippingParents"?DE(e):[].concat(t),i=[].concat(o,[n]),s=i[0],a=i.reduce(function(l,c){var u=wy(e,c,r);return l.top=gi(u.top,l.top),l.right=od(u.right,l.right),l.bottom=od(u.bottom,l.bottom),l.left=gi(u.left,l.left),l},wy(e,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function E6(e){var t=e.reference,n=e.element,r=e.placement,o=r?Ir(r):null,i=r?zs(r):null,s=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,l;switch(o){case vn:l={x:s,y:t.y-n.height};break;case Xn:l={x:s,y:t.y+t.height};break;case Jn:l={x:t.x+t.width,y:a};break;case xn:l={x:t.x-n.width,y:a};break;default:l={x:t.x,y:t.y}}var c=o?Tm(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case js:l[c]=l[c]-(t[u]/2-n[u]/2);break;case Ml:l[c]=l[c]+(t[u]/2-n[u]/2);break}}return l}function Tl(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,i=n.strategy,s=i===void 0?e.strategy:i,a=n.boundary,l=a===void 0?JP:a,c=n.rootBoundary,u=c===void 0?v6:c,f=n.elementContext,p=f===void 0?ya:f,x=n.altBoundary,y=x===void 0?!1:x,g=n.padding,k=g===void 0?0:g,h=S6(typeof k!="number"?k:k6(k,Xl)),m=p===ya?QP:ya,v=e.rects.popper,C=e.elements[y?m:p],S=OE(Ri(C)?C:C.contextElement||Go(e.elements.popper),l,u,s),E=Vs(e.elements.reference),P=E6({reference:E,element:v,strategy:"absolute",placement:o}),M=k1(Object.assign({},v,P)),T=p===ya?M:E,R={top:S.top-T.top+h.top,bottom:T.bottom-S.bottom+h.bottom,left:S.left-T.left+h.left,right:T.right-S.right+h.right},O=e.modifiersData.offset;if(p===ya&&O){var A=O[o];Object.keys(R).forEach(function($){var _=[Jn,Xn].indexOf($)>=0?1:-1,D=[vn,Xn].indexOf($)>=0?"y":"x";R[$]+=A[D]*_})}return R}function IE(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?x6:l,u=zs(r),f=u?a?vy:vy.filter(function(y){return zs(y)===u}):Xl,p=f.filter(function(y){return c.indexOf(y)>=0});p.length===0&&(p=f);var x=p.reduce(function(y,g){return y[g]=Tl(e,{placement:g,boundary:o,rootBoundary:i,padding:s})[Ir(g)],y},{});return Object.keys(x).sort(function(y,g){return x[y]-x[g]})}function $E(e){if(Ir(e)===Pm)return[];var t=mu(e);return[by(e),t,by(t)]}function FE(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,c=n.padding,u=n.boundary,f=n.rootBoundary,p=n.altBoundary,x=n.flipVariations,y=x===void 0?!0:x,g=n.allowedAutoPlacements,k=t.options.placement,h=Ir(k),m=h===k,v=l||(m||!y?[mu(k)]:$E(k)),C=[k].concat(v).reduce(function(W,ne){return W.concat(Ir(ne)===Pm?IE(t,{placement:ne,boundary:u,rootBoundary:f,padding:c,flipVariations:y,allowedAutoPlacements:g}):ne)},[]),S=t.rects.reference,E=t.rects.popper,P=new Map,M=!0,T=C[0],R=0;R=0,D=_?"width":"height",L=Tl(t,{placement:O,boundary:u,rootBoundary:f,altBoundary:p,padding:c}),V=_?$?Jn:xn:$?Xn:vn;S[D]>E[D]&&(V=mu(V));var I=mu(V),F=[];if(i&&F.push(L[A]<=0),a&&F.push(L[V]<=0,L[I]<=0),F.every(function(W){return W})){T=O,M=!1;break}P.set(O,F)}if(M)for(var z=y?3:1,ae=function(ne){var pe=C.find(function(Y){var me=P.get(Y);if(me)return me.slice(0,ne).every(function(Se){return Se})});if(pe)return T=pe,"break"},re=z;re>0;re--){var de=ae(re);if(de==="break")break}t.placement!==T&&(t.modifiersData[r]._skip=!0,t.placement=T,t.reset=!0)}}const AE={name:"flip",enabled:!0,phase:"main",fn:FE,requiresIfExists:["offset"],data:{_skip:!1}};function Sy(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ky(e){return[vn,Jn,Xn,xn].some(function(t){return e[t]>=0})}function LE(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,s=Tl(t,{elementContext:"reference"}),a=Tl(t,{altBoundary:!0}),l=Sy(s,r),c=Sy(a,o,i),u=ky(l),f=ky(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const jE={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:LE};function NE(e,t,n){var r=Ir(e),o=[xn,vn].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=i[0],a=i[1];return s=s||0,a=(a||0)*o,[xn,Jn].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function VE(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=o===void 0?[0,0]:o,s=x6.reduce(function(u,f){return u[f]=NE(f,t.rects,i),u},{}),a=s[t.placement],l=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=s}const zE={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:VE};function BE(e){var t=e.state,n=e.name;t.modifiersData[n]=E6({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const WE={name:"popperOffsets",enabled:!0,phase:"read",fn:BE,data:{}};function HE(e){return e==="x"?"y":"x"}function UE(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,f=n.padding,p=n.tether,x=p===void 0?!0:p,y=n.tetherOffset,g=y===void 0?0:y,k=Tl(t,{boundary:l,rootBoundary:c,padding:f,altBoundary:u}),h=Ir(t.placement),m=zs(t.placement),v=!m,C=Tm(h),S=HE(C),E=t.modifiersData.popperOffsets,P=t.rects.reference,M=t.rects.popper,T=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,R=typeof T=="number"?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),O=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,A={x:0,y:0};if(E){if(i){var $,_=C==="y"?vn:xn,D=C==="y"?Xn:Jn,L=C==="y"?"height":"width",V=E[C],I=V+k[_],F=V-k[D],z=x?-M[L]/2:0,ae=m===js?P[L]:M[L],re=m===js?-M[L]:-P[L],de=t.elements.arrow,W=x&&de?Mm(de):{width:0,height:0},ne=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:w6(),pe=ne[_],Y=ne[D],me=Ja(0,P[L],W[L]),Se=v?P[L]/2-z-me-pe-R.mainAxis:ae-me-pe-R.mainAxis,Pe=v?-P[L]/2+z+me+Y+R.mainAxis:re+me+Y+R.mainAxis,ee=t.elements.arrow&&Jl(t.elements.arrow),J=ee?C==="y"?ee.clientTop||0:ee.clientLeft||0:0,j=($=O==null?void 0:O[C])!=null?$:0,U=V+Se-j-J,K=V+Pe-j,xe=Ja(x?od(I,U):I,V,x?gi(F,K):F);E[C]=xe,A[C]=xe-V}if(a){var Ie,se=C==="x"?vn:xn,fe=C==="x"?Xn:Jn,B=E[S],q=S==="y"?"height":"width",we=B+k[se],$e=B-k[fe],ke=[vn,xn].indexOf(h)!==-1,Z=(Ie=O==null?void 0:O[S])!=null?Ie:0,he=ke?we:B-P[q]-M[q]-Z+R.altAxis,ve=ke?B+P[q]+M[q]-Z-R.altAxis:$e,ge=x&&ke?mE(he,B,ve):Ja(x?he:we,B,x?ve:$e);E[S]=ge,A[S]=ge-B}t.modifiersData[r]=A}}const YE={name:"preventOverflow",enabled:!0,phase:"main",fn:UE,requiresIfExists:["offset"]};function GE(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function KE(e){return e===_n(e)||!Yn(e)?Rm(e):GE(e)}function ZE(e){var t=e.getBoundingClientRect(),n=Ns(t.width)/e.offsetWidth||1,r=Ns(t.height)/e.offsetHeight||1;return n!==1||r!==1}function qE(e,t,n){n===void 0&&(n=!1);var r=Yn(t),o=Yn(t)&&ZE(t),i=Go(t),s=Vs(e,o,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Fr(t)!=="body"||Dm(i))&&(a=KE(t)),Yn(t)?(l=Vs(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=_m(i))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function XE(e){var t=new Map,n=new Set,r=[];e.forEach(function(i){t.set(i.name,i)});function o(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=t.get(a);l&&o(l)}}),r.push(i)}return e.forEach(function(i){n.has(i.name)||o(i)}),r}function JE(e){var t=XE(e);return cE.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function QE(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function eM(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Py={placement:"bottom",modifiers:[],strategy:"absolute"};function Ey(){for(var e=arguments.length,t=new Array(e),n=0;n{i||a(oM(o)||document.body)},[o,i]),jt(()=>{if(s&&!i)return y1(n,s),()=>{y1(n,null)}},[n,s,i]),i){if(b.isValidElement(r)){const c={ref:l};return b.cloneElement(r,c)}return d.jsx(b.Fragment,{children:r})}return d.jsx(b.Fragment,{children:s&&Ul.createPortal(r,s)})}),T6="Popper";function iM(e){return g6(T6,e)}UP(T6,["root"]);const sM=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],aM=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function lM(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function P1(e){return typeof e=="function"?e():e}function cM(e){return e.nodeType!==void 0}const uM=()=>_e({root:["root"]},dP(iM)),dM={},fM=b.forwardRef(function(t,n){var r;const{anchorEl:o,children:i,direction:s,disablePortal:a,modifiers:l,open:c,placement:u,popperOptions:f,popperRef:p,slotProps:x={},slots:y={},TransitionProps:g}=t,k=Q(t,sM),h=b.useRef(null),m=tt(h,n),v=b.useRef(null),C=tt(v,p),S=b.useRef(C);jt(()=>{S.current=C},[C]),b.useImperativeHandle(p,()=>v.current,[]);const E=lM(u,s),[P,M]=b.useState(E),[T,R]=b.useState(P1(o));b.useEffect(()=>{v.current&&v.current.forceUpdate()}),b.useEffect(()=>{o&&R(P1(o))},[o]),jt(()=>{if(!T||!c)return;const D=I=>{M(I.placement)};let L=[{name:"preventOverflow",options:{altBoundary:a}},{name:"flip",options:{altBoundary:a}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:I})=>{D(I)}}];l!=null&&(L=L.concat(l)),f&&f.modifiers!=null&&(L=L.concat(f.modifiers));const V=rM(T,h.current,w({placement:E},f,{modifiers:L}));return S.current(V),()=>{V.destroy(),S.current(null)}},[T,a,l,c,f,E]);const O={placement:P};g!==null&&(O.TransitionProps=g);const A=uM(),$=(r=y.root)!=null?r:"div",_=We({elementType:$,externalSlotProps:x.root,externalForwardedProps:k,additionalProps:{role:"tooltip",ref:m},ownerState:t,className:A.root});return d.jsx($,w({},_,{children:typeof i=="function"?i(O):i}))}),pM=b.forwardRef(function(t,n){const{anchorEl:r,children:o,container:i,direction:s="ltr",disablePortal:a=!1,keepMounted:l=!1,modifiers:c,open:u,placement:f="bottom",popperOptions:p=dM,popperRef:x,style:y,transition:g=!1,slotProps:k={},slots:h={}}=t,m=Q(t,aM),[v,C]=b.useState(!0),S=()=>{C(!1)},E=()=>{C(!0)};if(!l&&!u&&(!g||v))return null;let P;if(i)P=i;else if(r){const R=P1(r);P=R&&cM(R)?Et(R).body:Et(null).body}const M=!u&&l&&(!g||v)?"none":void 0,T=g?{in:u,onEnter:S,onExited:E}:void 0;return d.jsx(M6,{disablePortal:a,container:P,children:d.jsx(fM,w({anchorEl:r,direction:s,disablePortal:a,modifiers:c,ref:n,open:g?!v:u,placement:f,popperOptions:p,popperRef:x,slotProps:k,slots:h},m,{style:w({position:"fixed",top:0,left:0,display:M},y),TransitionProps:T,children:o}))})});function hM(e){const t=Et(e);return t.body===e?Ei(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function el(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function My(e){return parseInt(Ei(e).getComputedStyle(e).paddingRight,10)||0}function mM(e){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName)!==-1,r=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return n||r}function Ty(e,t,n,r,o){const i=[t,n,...r];[].forEach.call(e.children,s=>{const a=i.indexOf(s)===-1,l=!mM(s);a&&l&&el(s,o)})}function Hp(e,t){let n=-1;return e.some((r,o)=>t(r)?(n=o,!0):!1),n}function gM(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(hM(r)){const s=Z3(Et(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${My(r)+s}px`;const a=Et(r).querySelectorAll(".mui-fixed");[].forEach.call(a,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${My(l)+s}px`})}let i;if(r.parentNode instanceof DocumentFragment)i=Et(r).body;else{const s=r.parentElement,a=Ei(r);i=(s==null?void 0:s.nodeName)==="HTML"&&a.getComputedStyle(s).overflowY==="scroll"?s:r}n.push({value:i.style.overflow,property:"overflow",el:i},{value:i.style.overflowX,property:"overflow-x",el:i},{value:i.style.overflowY,property:"overflow-y",el:i}),i.style.overflow="hidden"}return()=>{n.forEach(({value:i,el:s,property:a})=>{i?s.style.setProperty(a,i):s.style.removeProperty(a)})}}function yM(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class vM{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(t,n){let r=this.modals.indexOf(t);if(r!==-1)return r;r=this.modals.length,this.modals.push(t),t.modalRef&&el(t.modalRef,!1);const o=yM(n);Ty(n,t.mount,t.modalRef,o,!0);const i=Hp(this.containers,s=>s.container===n);return i!==-1?(this.containers[i].modals.push(t),r):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:o}),r)}mount(t,n){const r=Hp(this.containers,i=>i.modals.indexOf(t)!==-1),o=this.containers[r];o.restore||(o.restore=gM(o,n))}remove(t,n=!0){const r=this.modals.indexOf(t);if(r===-1)return r;const o=Hp(this.containers,s=>s.modals.indexOf(t)!==-1),i=this.containers[o];if(i.modals.splice(i.modals.indexOf(t),1),this.modals.splice(r,1),i.modals.length===0)i.restore&&i.restore(),t.modalRef&&el(t.modalRef,n),Ty(i.container,t.mount,t.modalRef,i.hiddenSiblings,!1),this.containers.splice(o,1);else{const s=i.modals[i.modals.length-1];s.modalRef&&el(s.modalRef,!1)}return r}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function xM(e){return typeof e=="function"?e():e}function CM(e){return e?e.props.hasOwnProperty("in"):!1}const bM=new vM;function wM(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,manager:o=bM,closeAfterTransition:i=!1,onTransitionEnter:s,onTransitionExited:a,children:l,onClose:c,open:u,rootRef:f}=e,p=b.useRef({}),x=b.useRef(null),y=b.useRef(null),g=tt(y,f),[k,h]=b.useState(!u),m=CM(l);let v=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(v=!1);const C=()=>Et(x.current),S=()=>(p.current.modalRef=y.current,p.current.mount=x.current,p.current),E=()=>{o.mount(S(),{disableScrollLock:r}),y.current&&(y.current.scrollTop=0)},P=Me(()=>{const L=xM(t)||C().body;o.add(S(),L),y.current&&E()}),M=b.useCallback(()=>o.isTopModal(S()),[o]),T=Me(L=>{x.current=L,L&&(u&&M()?E():y.current&&el(y.current,v))}),R=b.useCallback(()=>{o.remove(S(),v)},[v,o]);b.useEffect(()=>()=>{R()},[R]),b.useEffect(()=>{u?P():(!m||!i)&&R()},[u,R,m,i,P]);const O=L=>V=>{var I;(I=L.onKeyDown)==null||I.call(L,V),!(V.key!=="Escape"||V.which===229||!M())&&(n||(V.stopPropagation(),c&&c(V,"escapeKeyDown")))},A=L=>V=>{var I;(I=L.onClick)==null||I.call(L,V),V.target===V.currentTarget&&c&&c(V,"backdropClick")};return{getRootProps:(L={})=>{const V=Xa(e);delete V.onTransitionEnter,delete V.onTransitionExited;const I=w({},V,L);return w({role:"presentation"},I,{onKeyDown:O(I),ref:g})},getBackdropProps:(L={})=>{const V=L;return w({"aria-hidden":!0},V,{onClick:A(V),open:u})},getTransitionProps:()=>{const L=()=>{h(!1),s&&s()},V=()=>{h(!0),a&&a(),i&&R()};return{onEnter:g1(L,l==null?void 0:l.props.onEnter),onExited:g1(V,l==null?void 0:l.props.onExited)}},rootRef:g,portalRef:T,isTopModal:M,exited:k,hasTransition:m}}const SM=2;function R6(e,t){return e-t}function Ry(e,t){var n;const{index:r}=(n=e.reduce((o,i,s)=>{const a=Math.abs(t-i);return o===null||a({left:`${e}%`}),leap:e=>({width:`${e}%`})},"horizontal-reverse":{offset:e=>({right:`${e}%`}),leap:e=>({width:`${e}%`})},vertical:{offset:e=>({bottom:`${e}%`}),leap:e=>({height:`${e}%`})}},TM=e=>e;let Fc;function Dy(){return Fc===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?Fc=CSS.supports("touch-action","none"):Fc=!0),Fc}function RM(e){const{"aria-labelledby":t,defaultValue:n,disabled:r=!1,disableSwap:o=!1,isRtl:i=!1,marks:s=!1,max:a=100,min:l=0,name:c,onChange:u,onChangeCommitted:f,orientation:p="horizontal",rootRef:x,scale:y=TM,step:g=1,tabIndex:k,value:h}=e,m=b.useRef(),[v,C]=b.useState(-1),[S,E]=b.useState(-1),[P,M]=b.useState(!1),T=b.useRef(0),[R,O]=bn({controlled:h,default:n??l,name:"Slider"}),A=u&&((Z,he,ve)=>{const ge=Z.nativeEvent||Z,ye=new ge.constructor(ge.type,ge);Object.defineProperty(ye,"target",{writable:!0,value:{value:he,name:c}}),u(ye,he,ve)}),$=Array.isArray(R);let _=$?R.slice().sort(R6):[R];_=_.map(Z=>Z==null?l:ai(Z,l,a));const D=s===!0&&g!==null?[...Array(Math.floor((a-l)/g)+1)].map((Z,he)=>({value:l+g*he})):s||[],L=D.map(Z=>Z.value),{isFocusVisibleRef:V,onBlur:I,onFocus:F,ref:z}=Jd(),[ae,re]=b.useState(-1),de=b.useRef(),W=tt(z,de),ne=tt(x,W),pe=Z=>he=>{var ve;const ge=Number(he.currentTarget.getAttribute("data-index"));F(he),V.current===!0&&re(ge),E(ge),Z==null||(ve=Z.onFocus)==null||ve.call(Z,he)},Y=Z=>he=>{var ve;I(he),V.current===!1&&re(-1),E(-1),Z==null||(ve=Z.onBlur)==null||ve.call(Z,he)};jt(()=>{if(r&&de.current.contains(document.activeElement)){var Z;(Z=document.activeElement)==null||Z.blur()}},[r]),r&&v!==-1&&C(-1),r&&ae!==-1&&re(-1);const me=Z=>he=>{var ve;(ve=Z.onChange)==null||ve.call(Z,he);const ge=Number(he.currentTarget.getAttribute("data-index")),ye=_[ge],Ke=L.indexOf(ye);let Ve=he.target.valueAsNumber;if(D&&g==null){const He=L[L.length-1];Ve>He?Ve=He:Ve{const{current:ve}=de,{width:ge,height:ye,bottom:Ke,left:Ve}=ve.getBoundingClientRect();let He;Pe.indexOf("vertical")===0?He=(Ke-Z.y)/ye:He=(Z.x-Ve)/ge,Pe.indexOf("-reverse")!==-1&&(He=1-He);let ue;if(ue=kM(He,l,a),g)ue=EM(ue,g,l);else{const dt=Ry(L,ue);ue=L[dt]}ue=ai(ue,l,a);let je=0;if($){he?je=Se.current:je=Ry(_,ue),o&&(ue=ai(ue,_[je-1]||-1/0,_[je+1]||1/0));const dt=ue;ue=_y({values:_,newValue:ue,index:je}),o&&he||(je=ue.indexOf(dt),Se.current=je)}return{newValue:ue,activeIndex:je}},J=Me(Z=>{const he=Oc(Z,m);if(!he)return;if(T.current+=1,Z.type==="mousemove"&&Z.buttons===0){j(Z);return}const{newValue:ve,activeIndex:ge}=ee({finger:he,move:!0});Ic({sliderRef:de,activeIndex:ge,setActive:C}),O(ve),!P&&T.current>SM&&M(!0),A&&!$c(ve,R)&&A(Z,ve,ge)}),j=Me(Z=>{const he=Oc(Z,m);if(M(!1),!he)return;const{newValue:ve}=ee({finger:he,move:!0});C(-1),Z.type==="touchend"&&E(-1),f&&f(Z,ve),m.current=void 0,K()}),U=Me(Z=>{if(r)return;Dy()||Z.preventDefault();const he=Z.changedTouches[0];he!=null&&(m.current=he.identifier);const ve=Oc(Z,m);if(ve!==!1){const{newValue:ye,activeIndex:Ke}=ee({finger:ve});Ic({sliderRef:de,activeIndex:Ke,setActive:C}),O(ye),A&&!$c(ye,R)&&A(Z,ye,Ke)}T.current=0;const ge=Et(de.current);ge.addEventListener("touchmove",J,{passive:!0}),ge.addEventListener("touchend",j,{passive:!0})}),K=b.useCallback(()=>{const Z=Et(de.current);Z.removeEventListener("mousemove",J),Z.removeEventListener("mouseup",j),Z.removeEventListener("touchmove",J),Z.removeEventListener("touchend",j)},[j,J]);b.useEffect(()=>{const{current:Z}=de;return Z.addEventListener("touchstart",U,{passive:Dy()}),()=>{Z.removeEventListener("touchstart",U),K()}},[K,U]),b.useEffect(()=>{r&&K()},[r,K]);const xe=Z=>he=>{var ve;if((ve=Z.onMouseDown)==null||ve.call(Z,he),r||he.defaultPrevented||he.button!==0)return;he.preventDefault();const ge=Oc(he,m);if(ge!==!1){const{newValue:Ke,activeIndex:Ve}=ee({finger:ge});Ic({sliderRef:de,activeIndex:Ve,setActive:C}),O(Ke),A&&!$c(Ke,R)&&A(he,Ke,Ve)}T.current=0;const ye=Et(de.current);ye.addEventListener("mousemove",J,{passive:!0}),ye.addEventListener("mouseup",j)},Ie=id($?_[0]:l,l,a),se=id(_[_.length-1],l,a)-Ie,fe=(Z={})=>{const he=Xa(Z),ve={onMouseDown:xe(he||{})},ge=w({},he,ve);return w({},Z,{ref:ne},ge)},B=Z=>he=>{var ve;(ve=Z.onMouseOver)==null||ve.call(Z,he);const ge=Number(he.currentTarget.getAttribute("data-index"));E(ge)},q=Z=>he=>{var ve;(ve=Z.onMouseLeave)==null||ve.call(Z,he),E(-1)};return{active:v,axis:Pe,axisProps:MM,dragging:P,focusedThumbIndex:ae,getHiddenInputProps:(Z={})=>{var he;const ve=Xa(Z),ge={onChange:me(ve||{}),onFocus:pe(ve||{}),onBlur:Y(ve||{})},ye=w({},ve,ge);return w({tabIndex:k,"aria-labelledby":t,"aria-orientation":p,"aria-valuemax":y(a),"aria-valuemin":y(l),name:c,type:"range",min:e.min,max:e.max,step:e.step===null&&e.marks?"any":(he=e.step)!=null?he:void 0,disabled:r},Z,ye,{style:w({},q3,{direction:i?"rtl":"ltr",width:"100%",height:"100%"})})},getRootProps:fe,getThumbProps:(Z={})=>{const he=Xa(Z),ve={onMouseOver:B(he||{}),onMouseLeave:q(he||{})};return w({},Z,he,ve)},marks:D,open:S,range:$,rootRef:ne,trackLeap:se,trackOffset:Ie,values:_,getThumbStyle:Z=>({pointerEvents:v!==-1&&v!==Z?"none":void 0})}}const _M=["onChange","maxRows","minRows","style","value"];function Ac(e){return parseInt(e,10)||0}const DM={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function Oy(e){return e==null||Object.keys(e).length===0||e.outerHeightStyle===0&&!e.overflow}const OM=b.forwardRef(function(t,n){const{onChange:r,maxRows:o,minRows:i=1,style:s,value:a}=t,l=Q(t,_M),{current:c}=b.useRef(a!=null),u=b.useRef(null),f=tt(n,u),p=b.useRef(null),x=b.useRef(0),[y,g]=b.useState({outerHeightStyle:0}),k=b.useCallback(()=>{const C=u.current,E=Ei(C).getComputedStyle(C);if(E.width==="0px")return{outerHeightStyle:0};const P=p.current;P.style.width=E.width,P.value=C.value||t.placeholder||"x",P.value.slice(-1)===` +`&&(P.value+=" ");const M=E.boxSizing,T=Ac(E.paddingBottom)+Ac(E.paddingTop),R=Ac(E.borderBottomWidth)+Ac(E.borderTopWidth),O=P.scrollHeight;P.value="x";const A=P.scrollHeight;let $=O;i&&($=Math.max(Number(i)*A,$)),o&&($=Math.min(Number(o)*A,$)),$=Math.max($,A);const _=$+(M==="border-box"?T+R:0),D=Math.abs($-O)<=1;return{outerHeightStyle:_,overflow:D}},[o,i,t.placeholder]),h=(C,S)=>{const{outerHeightStyle:E,overflow:P}=S;return x.current<20&&(E>0&&Math.abs((C.outerHeightStyle||0)-E)>1||C.overflow!==P)?(x.current+=1,{overflow:P,outerHeightStyle:E}):C},m=b.useCallback(()=>{const C=k();Oy(C)||g(S=>h(S,C))},[k]);jt(()=>{const C=()=>{const O=k();Oy(O)||Ul.flushSync(()=>{g(A=>h(A,O))})},S=()=>{x.current=0,C()};let E;const P=K3(S),M=u.current,T=Ei(M);T.addEventListener("resize",P);let R;return typeof ResizeObserver<"u"&&(R=new ResizeObserver(S),R.observe(M)),()=>{P.clear(),cancelAnimationFrame(E),T.removeEventListener("resize",P),R&&R.disconnect()}},[k]),jt(()=>{m()}),b.useEffect(()=>{x.current=0},[a]);const v=C=>{x.current=0,c||m(),r&&r(C)};return d.jsxs(b.Fragment,{children:[d.jsx("textarea",w({value:a,onChange:v,ref:f,rows:i,style:w({height:y.outerHeightStyle,overflow:y.overflow?"hidden":void 0},s)},l)),d.jsx("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:p,tabIndex:-1,style:w({},DM.shadow,s,{paddingTop:0,paddingBottom:0})})]})}),IM=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],$M=H(pM,{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),FM=b.forwardRef(function(t,n){var r;const o=af(),i=Te({props:t,name:"MuiPopper"}),{anchorEl:s,component:a,components:l,componentsProps:c,container:u,disablePortal:f,keepMounted:p,modifiers:x,open:y,placement:g,popperOptions:k,popperRef:h,transition:m,slots:v,slotProps:C}=i,S=Q(i,IM),E=(r=v==null?void 0:v.root)!=null?r:l==null?void 0:l.Root,P=w({anchorEl:s,container:u,disablePortal:f,keepMounted:p,modifiers:x,open:y,placement:g,popperOptions:k,popperRef:h,transition:m},S);return d.jsx($M,w({as:a,direction:o==null?void 0:o.direction,slots:{root:E},slotProps:C??c},P,{ref:n}))}),AM=FM,LM=Gt(d.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function jM(e){return De("MuiChip",e)}const NM=Ee("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),Ze=NM,VM=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],zM=e=>{const{classes:t,disabled:n,size:r,color:o,iconColor:i,onDelete:s,clickable:a,variant:l}=e,c={root:["root",l,n&&"disabled",`size${te(r)}`,`color${te(o)}`,a&&"clickable",a&&`clickableColor${te(o)}`,s&&"deletable",s&&`deletableColor${te(o)}`,`${l}${te(o)}`],label:["label",`label${te(r)}`],avatar:["avatar",`avatar${te(r)}`,`avatarColor${te(o)}`],icon:["icon",`icon${te(r)}`,`iconColor${te(i)}`],deleteIcon:["deleteIcon",`deleteIcon${te(r)}`,`deleteIconColor${te(o)}`,`deleteIcon${te(l)}Color${te(o)}`]};return _e(c,jM,t)},BM=H("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{color:r,iconColor:o,clickable:i,onDelete:s,size:a,variant:l}=n;return[{[`& .${Ze.avatar}`]:t.avatar},{[`& .${Ze.avatar}`]:t[`avatar${te(a)}`]},{[`& .${Ze.avatar}`]:t[`avatarColor${te(r)}`]},{[`& .${Ze.icon}`]:t.icon},{[`& .${Ze.icon}`]:t[`icon${te(a)}`]},{[`& .${Ze.icon}`]:t[`iconColor${te(o)}`]},{[`& .${Ze.deleteIcon}`]:t.deleteIcon},{[`& .${Ze.deleteIcon}`]:t[`deleteIcon${te(a)}`]},{[`& .${Ze.deleteIcon}`]:t[`deleteIconColor${te(r)}`]},{[`& .${Ze.deleteIcon}`]:t[`deleteIcon${te(l)}Color${te(r)}`]},t.root,t[`size${te(a)}`],t[`color${te(r)}`],i&&t.clickable,i&&r!=="default"&&t[`clickableColor${te(r)})`],s&&t.deletable,s&&r!=="default"&&t[`deletableColor${te(r)}`],t[l],t[`${l}${te(r)}`]]}})(({theme:e,ownerState:t})=>{const n=e.palette.mode==="light"?e.palette.grey[700]:e.palette.grey[300];return w({maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${Ze.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${Ze.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:n,fontSize:e.typography.pxToRem(12)},[`& .${Ze.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${Ze.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${Ze.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${Ze.icon}`]:w({marginLeft:5,marginRight:-6},t.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},t.iconColor===t.color&&w({color:e.vars?e.vars.palette.Chip.defaultIconColor:n},t.color!=="default"&&{color:"inherit"})),[`& .${Ze.deleteIcon}`]:w({WebkitTapHighlightColor:"transparent",color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.26)`:Ne(e.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.4)`:Ne(e.palette.text.primary,.4)}},t.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},t.color!=="default"&&{color:e.vars?`rgba(${e.vars.palette[t.color].contrastTextChannel} / 0.7)`:Ne(e.palette[t.color].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[t.color].contrastText}})},t.size==="small"&&{height:24},t.color!=="default"&&{backgroundColor:(e.vars||e).palette[t.color].main,color:(e.vars||e).palette[t.color].contrastText},t.onDelete&&{[`&.${Ze.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Ne(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},t.onDelete&&t.color!=="default"&&{[`&.${Ze.focusVisible}`]:{backgroundColor:(e.vars||e).palette[t.color].dark}})},({theme:e,ownerState:t})=>w({},t.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Ne(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)},[`&.${Ze.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Ne(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)},"&:active":{boxShadow:(e.vars||e).shadows[1]}},t.clickable&&t.color!=="default"&&{[`&:hover, &.${Ze.focusVisible}`]:{backgroundColor:(e.vars||e).palette[t.color].dark}}),({theme:e,ownerState:t})=>w({},t.variant==="outlined"&&{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${Ze.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${Ze.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${Ze.avatar}`]:{marginLeft:4},[`& .${Ze.avatarSmall}`]:{marginLeft:2},[`& .${Ze.icon}`]:{marginLeft:4},[`& .${Ze.iconSmall}`]:{marginLeft:2},[`& .${Ze.deleteIcon}`]:{marginRight:5},[`& .${Ze.deleteIconSmall}`]:{marginRight:3}},t.variant==="outlined"&&t.color!=="default"&&{color:(e.vars||e).palette[t.color].main,border:`1px solid ${e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.7)`:Ne(e.palette[t.color].main,.7)}`,[`&.${Ze.clickable}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Ne(e.palette[t.color].main,e.palette.action.hoverOpacity)},[`&.${Ze.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.focusOpacity})`:Ne(e.palette[t.color].main,e.palette.action.focusOpacity)},[`& .${Ze.deleteIcon}`]:{color:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.7)`:Ne(e.palette[t.color].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[t.color].main}}})),WM=H("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:n}=e,{size:r}=n;return[t.label,t[`label${te(r)}`]]}})(({ownerState:e})=>w({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},e.variant==="outlined"&&{paddingLeft:11,paddingRight:11},e.size==="small"&&{paddingLeft:8,paddingRight:8},e.size==="small"&&e.variant==="outlined"&&{paddingLeft:7,paddingRight:7}));function Iy(e){return e.key==="Backspace"||e.key==="Delete"}const HM=b.forwardRef(function(t,n){const r=Te({props:t,name:"MuiChip"}),{avatar:o,className:i,clickable:s,color:a="default",component:l,deleteIcon:c,disabled:u=!1,icon:f,label:p,onClick:x,onDelete:y,onKeyDown:g,onKeyUp:k,size:h="medium",variant:m="filled",tabIndex:v,skipFocusWhenDisabled:C=!1}=r,S=Q(r,VM),E=b.useRef(null),P=tt(E,n),M=F=>{F.stopPropagation(),y&&y(F)},T=F=>{F.currentTarget===F.target&&Iy(F)&&F.preventDefault(),g&&g(F)},R=F=>{F.currentTarget===F.target&&(y&&Iy(F)?y(F):F.key==="Escape"&&E.current&&E.current.blur()),k&&k(F)},O=s!==!1&&x?!0:s,A=O||y?$r:l||"div",$=w({},r,{component:A,disabled:u,size:h,color:a,iconColor:b.isValidElement(f)&&f.props.color||a,onDelete:!!y,clickable:O,variant:m}),_=zM($),D=A===$r?w({component:l||"div",focusVisibleClassName:_.focusVisible},y&&{disableRipple:!0}):{};let L=null;y&&(L=c&&b.isValidElement(c)?b.cloneElement(c,{className:le(c.props.className,_.deleteIcon),onClick:M}):d.jsx(LM,{className:le(_.deleteIcon),onClick:M}));let V=null;o&&b.isValidElement(o)&&(V=b.cloneElement(o,{className:le(_.avatar,o.props.className)}));let I=null;return f&&b.isValidElement(f)&&(I=b.cloneElement(f,{className:le(_.icon,f.props.className)})),d.jsxs(BM,w({as:A,className:le(_.root,i),disabled:O&&u?!0:void 0,onClick:x,onKeyDown:T,onKeyUp:R,ref:P,tabIndex:C&&u?-1:v,ownerState:$},D,S,{children:[V||I,d.jsx(WM,{className:le(_.label),ownerState:$,children:p}),L]}))}),UM=HM;function Ko({props:e,states:t,muiFormControl:n}){return t.reduce((r,o)=>(r[o]=e[o],n&&typeof e[o]>"u"&&(r[o]=n[o]),r),{})}const YM=b.createContext(void 0),Sf=YM;function Lr(){return b.useContext(Sf)}function _6(e){return d.jsx(OS,w({},e,{defaultTheme:cf,themeId:Pi}))}function $y(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function sd(e,t=!1){return e&&($y(e.value)&&e.value!==""||t&&$y(e.defaultValue)&&e.defaultValue!=="")}function GM(e){return e.startAdornment}function KM(e){return De("MuiInputBase",e)}const ZM=Ee("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),Bs=ZM,qM=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],kf=(e,t)=>{const{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size==="small"&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${te(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},Pf=(e,t)=>{const{ownerState:n}=e;return[t.input,n.size==="small"&&t.inputSizeSmall,n.multiline&&t.inputMultiline,n.type==="search"&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},XM=e=>{const{classes:t,color:n,disabled:r,error:o,endAdornment:i,focused:s,formControl:a,fullWidth:l,hiddenLabel:c,multiline:u,readOnly:f,size:p,startAdornment:x,type:y}=e,g={root:["root",`color${te(n)}`,r&&"disabled",o&&"error",l&&"fullWidth",s&&"focused",a&&"formControl",p&&p!=="medium"&&`size${te(p)}`,u&&"multiline",x&&"adornedStart",i&&"adornedEnd",c&&"hiddenLabel",f&&"readOnly"],input:["input",r&&"disabled",y==="search"&&"inputTypeSearch",u&&"inputMultiline",p==="small"&&"inputSizeSmall",c&&"inputHiddenLabel",x&&"inputAdornedStart",i&&"inputAdornedEnd",f&&"readOnly"]};return _e(g,KM,t)},Ef=H("div",{name:"MuiInputBase",slot:"Root",overridesResolver:kf})(({theme:e,ownerState:t})=>w({},e.typography.body1,{color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${Bs.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"}},t.multiline&&w({padding:"4px 0 5px"},t.size==="small"&&{paddingTop:1}),t.fullWidth&&{width:"100%"})),Mf=H("input",{name:"MuiInputBase",slot:"Input",overridesResolver:Pf})(({theme:e,ownerState:t})=>{const n=e.palette.mode==="light",r=w({color:"currentColor"},e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5},{transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})}),o={opacity:"0 !important"},i=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5};return w({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&:-ms-input-placeholder":r,"&::-ms-input-placeholder":r,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${Bs.formControl} &`]:{"&::-webkit-input-placeholder":o,"&::-moz-placeholder":o,"&:-ms-input-placeholder":o,"&::-ms-input-placeholder":o,"&:focus::-webkit-input-placeholder":i,"&:focus::-moz-placeholder":i,"&:focus:-ms-input-placeholder":i,"&:focus::-ms-input-placeholder":i},[`&.${Bs.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},t.size==="small"&&{paddingTop:1},t.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},t.type==="search"&&{MozAppearance:"textfield"})}),JM=d.jsx(_6,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),QM=b.forwardRef(function(t,n){var r;const o=Te({props:t,name:"MuiInputBase"}),{"aria-describedby":i,autoComplete:s,autoFocus:a,className:l,components:c={},componentsProps:u={},defaultValue:f,disabled:p,disableInjectingGlobalStyles:x,endAdornment:y,fullWidth:g=!1,id:k,inputComponent:h="input",inputProps:m={},inputRef:v,maxRows:C,minRows:S,multiline:E=!1,name:P,onBlur:M,onChange:T,onClick:R,onFocus:O,onKeyDown:A,onKeyUp:$,placeholder:_,readOnly:D,renderSuffix:L,rows:V,slotProps:I={},slots:F={},startAdornment:z,type:ae="text",value:re}=o,de=Q(o,qM),W=m.value!=null?m.value:re,{current:ne}=b.useRef(W!=null),pe=b.useRef(),Y=b.useCallback(ge=>{},[]),me=tt(pe,v,m.ref,Y),[Se,Pe]=b.useState(!1),ee=Lr(),J=Ko({props:o,muiFormControl:ee,states:["color","disabled","error","hiddenLabel","size","required","filled"]});J.focused=ee?ee.focused:Se,b.useEffect(()=>{!ee&&p&&Se&&(Pe(!1),M&&M())},[ee,p,Se,M]);const j=ee&&ee.onFilled,U=ee&&ee.onEmpty,K=b.useCallback(ge=>{sd(ge)?j&&j():U&&U()},[j,U]);jt(()=>{ne&&K({value:W})},[W,K,ne]);const xe=ge=>{if(J.disabled){ge.stopPropagation();return}O&&O(ge),m.onFocus&&m.onFocus(ge),ee&&ee.onFocus?ee.onFocus(ge):Pe(!0)},Ie=ge=>{M&&M(ge),m.onBlur&&m.onBlur(ge),ee&&ee.onBlur?ee.onBlur(ge):Pe(!1)},se=(ge,...ye)=>{if(!ne){const Ke=ge.target||pe.current;if(Ke==null)throw new Error(Bo(1));K({value:Ke.value})}m.onChange&&m.onChange(ge,...ye),T&&T(ge,...ye)};b.useEffect(()=>{K(pe.current)},[]);const fe=ge=>{pe.current&&ge.currentTarget===ge.target&&pe.current.focus(),R&&R(ge)};let B=h,q=m;E&&B==="input"&&(V?q=w({type:void 0,minRows:V,maxRows:V},q):q=w({type:void 0,maxRows:C,minRows:S},q),B=OM);const we=ge=>{K(ge.animationName==="mui-auto-fill-cancel"?pe.current:{value:"x"})};b.useEffect(()=>{ee&&ee.setAdornedStart(!!z)},[ee,z]);const $e=w({},o,{color:J.color||"primary",disabled:J.disabled,endAdornment:y,error:J.error,focused:J.focused,formControl:ee,fullWidth:g,hiddenLabel:J.hiddenLabel,multiline:E,size:J.size,startAdornment:z,type:ae}),ke=XM($e),Z=F.root||c.Root||Ef,he=I.root||u.root||{},ve=F.input||c.Input||Mf;return q=w({},q,(r=I.input)!=null?r:u.input),d.jsxs(b.Fragment,{children:[!x&&JM,d.jsxs(Z,w({},he,!Or(Z)&&{ownerState:w({},$e,he.ownerState)},{ref:n,onClick:fe},de,{className:le(ke.root,he.className,l,D&&"MuiInputBase-readOnly"),children:[z,d.jsx(Sf.Provider,{value:null,children:d.jsx(ve,w({ownerState:$e,"aria-invalid":J.error,"aria-describedby":i,autoComplete:s,autoFocus:a,defaultValue:f,disabled:J.disabled,id:k,onAnimationStart:we,name:P,placeholder:_,readOnly:D,required:J.required,rows:V,value:W,onKeyDown:A,onKeyUp:$,type:ae},q,!Or(ve)&&{as:B,ownerState:w({},$e,q.ownerState)},{ref:me,className:le(ke.input,q.className,D&&"MuiInputBase-readOnly"),onBlur:Ie,onChange:se,onFocus:xe}))}),y,L?L(w({},J,{startAdornment:z})):null]}))]})}),Om=QM;function eT(e){return De("MuiInput",e)}const tT=w({},Bs,Ee("MuiInput",["root","underline","input"])),va=tT;function nT(e){return De("MuiOutlinedInput",e)}const rT=w({},Bs,Ee("MuiOutlinedInput",["root","notchedOutline","input"])),Co=rT;function oT(e){return De("MuiFilledInput",e)}const iT=w({},Bs,Ee("MuiFilledInput",["root","underline","input"])),Jo=iT,sT=Gt(d.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),aT=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],lT={entering:{opacity:1},entered:{opacity:1}},cT=b.forwardRef(function(t,n){const r=Le(),o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:i,appear:s=!0,children:a,easing:l,in:c,onEnter:u,onEntered:f,onEntering:p,onExit:x,onExited:y,onExiting:g,style:k,timeout:h=o,TransitionComponent:m=xm}=t,v=Q(t,aT),C=b.useRef(null),S=tt(C,a.ref,n),E=_=>D=>{if(_){const L=C.current;D===void 0?_(L):_(L,D)}},P=E(p),M=E((_,D)=>{h6(_);const L=rd({style:k,timeout:h,easing:l},{mode:"enter"});_.style.webkitTransition=r.transitions.create("opacity",L),_.style.transition=r.transitions.create("opacity",L),u&&u(_,D)}),T=E(f),R=E(g),O=E(_=>{const D=rd({style:k,timeout:h,easing:l},{mode:"exit"});_.style.webkitTransition=r.transitions.create("opacity",D),_.style.transition=r.transitions.create("opacity",D),x&&x(_)}),A=E(y),$=_=>{i&&i(C.current,_)};return d.jsx(m,w({appear:s,in:c,nodeRef:C,onEnter:M,onEntered:T,onEntering:P,onExit:O,onExited:A,onExiting:R,addEndListener:$,timeout:h},v,{children:(_,D)=>b.cloneElement(a,w({style:w({opacity:0,visibility:_==="exited"&&!c?"hidden":void 0},lT[_],k,a.props.style),ref:S},D))}))}),ea=cT;function uT(e){return De("MuiBackdrop",e)}Ee("MuiBackdrop",["root","invisible"]);const dT=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],fT=e=>{const{classes:t,invisible:n}=e;return _e({root:["root",n&&"invisible"]},uT,t)},pT=H("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})(({ownerState:e})=>w({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},e.invisible&&{backgroundColor:"transparent"})),hT=b.forwardRef(function(t,n){var r,o,i;const s=Te({props:t,name:"MuiBackdrop"}),{children:a,className:l,component:c="div",components:u={},componentsProps:f={},invisible:p=!1,open:x,slotProps:y={},slots:g={},TransitionComponent:k=ea,transitionDuration:h}=s,m=Q(s,dT),v=w({},s,{component:c,invisible:p}),C=fT(v),S=(r=y.root)!=null?r:f.root;return d.jsx(k,w({in:x,timeout:h},m,{children:d.jsx(pT,w({"aria-hidden":!0},S,{as:(o=(i=g.root)!=null?i:u.Root)!=null?o:c,className:le(C.root,l,S==null?void 0:S.className),ownerState:w({},v,S==null?void 0:S.ownerState),classes:C,ref:n,children:a}))}))}),D6=hT,mT=Ee("MuiBox",["root"]),gT=mT,yT=nn(),vT=AS({themeId:Pi,defaultTheme:yT,defaultClassName:gT.root,generateClassName:X3.generate}),X=vT;function xT(e){return De("MuiButton",e)}const CT=Ee("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),Lc=CT,bT=b.createContext({}),wT=bT,ST=b.createContext(void 0),kT=ST,PT=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],ET=e=>{const{color:t,disableElevation:n,fullWidth:r,size:o,variant:i,classes:s}=e,a={root:["root",i,`${i}${te(t)}`,`size${te(o)}`,`${i}Size${te(o)}`,t==="inherit"&&"colorInherit",n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["startIcon",`iconSize${te(o)}`],endIcon:["endIcon",`iconSize${te(o)}`]},l=_e(a,xT,s);return w({},s,l)},O6=e=>w({},e.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},e.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},e.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),MT=H($r,{shouldForwardProp:e=>rn(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${te(n.color)}`],t[`size${te(n.size)}`],t[`${n.variant}Size${te(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth]}})(({theme:e,ownerState:t})=>{var n,r;const o=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],i=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return w({},e.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":w({textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:Ne(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="text"&&t.color!=="inherit"&&{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Ne(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="outlined"&&t.color!=="inherit"&&{border:`1px solid ${(e.vars||e).palette[t.color].main}`,backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Ne(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="contained"&&{backgroundColor:e.vars?e.vars.palette.Button.inheritContainedHoverBg:i,boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2],backgroundColor:(e.vars||e).palette.grey[300]}},t.variant==="contained"&&t.color!=="inherit"&&{backgroundColor:(e.vars||e).palette[t.color].dark,"@media (hover: none)":{backgroundColor:(e.vars||e).palette[t.color].main}}),"&:active":w({},t.variant==="contained"&&{boxShadow:(e.vars||e).shadows[8]}),[`&.${Lc.focusVisible}`]:w({},t.variant==="contained"&&{boxShadow:(e.vars||e).shadows[6]}),[`&.${Lc.disabled}`]:w({color:(e.vars||e).palette.action.disabled},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},t.variant==="contained"&&{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground})},t.variant==="text"&&{padding:"6px 8px"},t.variant==="text"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main},t.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},t.variant==="outlined"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main,border:e.vars?`1px solid rgba(${e.vars.palette[t.color].mainChannel} / 0.5)`:`1px solid ${Ne(e.palette[t.color].main,.5)}`},t.variant==="contained"&&{color:e.vars?e.vars.palette.text.primary:(n=(r=e.palette).getContrastText)==null?void 0:n.call(r,e.palette.grey[300]),backgroundColor:e.vars?e.vars.palette.Button.inheritContainedBg:o,boxShadow:(e.vars||e).shadows[2]},t.variant==="contained"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].contrastText,backgroundColor:(e.vars||e).palette[t.color].main},t.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},t.size==="small"&&t.variant==="text"&&{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="text"&&{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},t.size==="small"&&t.variant==="outlined"&&{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="outlined"&&{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},t.size==="small"&&t.variant==="contained"&&{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="contained"&&{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},t.fullWidth&&{width:"100%"})},({ownerState:e})=>e.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${Lc.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${Lc.disabled}`]:{boxShadow:"none"}}),TT=H("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,t[`iconSize${te(n.size)}`]]}})(({ownerState:e})=>w({display:"inherit",marginRight:8,marginLeft:-4},e.size==="small"&&{marginLeft:-2},O6(e))),RT=H("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,t[`iconSize${te(n.size)}`]]}})(({ownerState:e})=>w({display:"inherit",marginRight:-4,marginLeft:8},e.size==="small"&&{marginRight:-2},O6(e))),_T=b.forwardRef(function(t,n){const r=b.useContext(wT),o=b.useContext(kT),i=lm(r,t),s=Te({props:i,name:"MuiButton"}),{children:a,color:l="primary",component:c="button",className:u,disabled:f=!1,disableElevation:p=!1,disableFocusRipple:x=!1,endIcon:y,focusVisibleClassName:g,fullWidth:k=!1,size:h="medium",startIcon:m,type:v,variant:C="text"}=s,S=Q(s,PT),E=w({},s,{color:l,component:c,disabled:f,disableElevation:p,disableFocusRipple:x,fullWidth:k,size:h,type:v,variant:C}),P=ET(E),M=m&&d.jsx(TT,{className:P.startIcon,ownerState:E,children:m}),T=y&&d.jsx(RT,{className:P.endIcon,ownerState:E,children:y}),R=o||"";return d.jsxs(MT,w({ownerState:E,className:le(r.className,P.root,u,R),component:c,disabled:f,focusRipple:!x,focusVisibleClassName:le(P.focusVisible,g),ref:n,type:v},S,{classes:P,children:[M,a,T]}))}),Er=_T;function DT(e){return De("PrivateSwitchBase",e)}Ee("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const OT=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],IT=e=>{const{classes:t,checked:n,disabled:r,edge:o}=e,i={root:["root",n&&"checked",r&&"disabled",o&&`edge${te(o)}`],input:["input"]};return _e(i,DT,t)},$T=H($r)(({ownerState:e})=>w({padding:9,borderRadius:"50%"},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12})),FT=H("input",{shouldForwardProp:rn})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),AT=b.forwardRef(function(t,n){const{autoFocus:r,checked:o,checkedIcon:i,className:s,defaultChecked:a,disabled:l,disableFocusRipple:c=!1,edge:u=!1,icon:f,id:p,inputProps:x,inputRef:y,name:g,onBlur:k,onChange:h,onFocus:m,readOnly:v,required:C=!1,tabIndex:S,type:E,value:P}=t,M=Q(t,OT),[T,R]=bn({controlled:o,default:!!a,name:"SwitchBase",state:"checked"}),O=Lr(),A=F=>{m&&m(F),O&&O.onFocus&&O.onFocus(F)},$=F=>{k&&k(F),O&&O.onBlur&&O.onBlur(F)},_=F=>{if(F.nativeEvent.defaultPrevented)return;const z=F.target.checked;R(z),h&&h(F,z)};let D=l;O&&typeof D>"u"&&(D=O.disabled);const L=E==="checkbox"||E==="radio",V=w({},t,{checked:T,disabled:D,disableFocusRipple:c,edge:u}),I=IT(V);return d.jsxs($T,w({component:"span",className:le(I.root,s),centerRipple:!0,focusRipple:!c,disabled:D,tabIndex:null,role:void 0,onFocus:A,onBlur:$,ownerState:V,ref:n},M,{children:[d.jsx(FT,w({autoFocus:r,checked:o,defaultChecked:a,className:I.input,disabled:D,id:L?p:void 0,name:g,onChange:_,readOnly:v,ref:y,required:C,ownerState:V,tabIndex:S,type:E},E==="checkbox"&&P===void 0?{}:{value:P},x)),T?i:f]}))}),I6=AT,LT=Gt(d.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),jT=Gt(d.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),NT=Gt(d.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function VT(e){return De("MuiCheckbox",e)}const zT=Ee("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),Up=zT,BT=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],WT=e=>{const{classes:t,indeterminate:n,color:r,size:o}=e,i={root:["root",n&&"indeterminate",`color${te(r)}`,`size${te(o)}`]},s=_e(i,VT,t);return w({},t,s)},HT=H(I6,{shouldForwardProp:e=>rn(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${te(n.size)}`],n.color!=="default"&&t[`color${te(n.color)}`]]}})(({theme:e,ownerState:t})=>w({color:(e.vars||e).palette.text.secondary},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${t.color==="default"?e.vars.palette.action.activeChannel:e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Ne(t.color==="default"?e.palette.action.active:e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},t.color!=="default"&&{[`&.${Up.checked}, &.${Up.indeterminate}`]:{color:(e.vars||e).palette[t.color].main},[`&.${Up.disabled}`]:{color:(e.vars||e).palette.action.disabled}})),UT=d.jsx(jT,{}),YT=d.jsx(LT,{}),GT=d.jsx(NT,{}),KT=b.forwardRef(function(t,n){var r,o;const i=Te({props:t,name:"MuiCheckbox"}),{checkedIcon:s=UT,color:a="primary",icon:l=YT,indeterminate:c=!1,indeterminateIcon:u=GT,inputProps:f,size:p="medium",className:x}=i,y=Q(i,BT),g=c?u:l,k=c?u:s,h=w({},i,{color:a,indeterminate:c,size:p}),m=WT(h);return d.jsx(HT,w({type:"checkbox",inputProps:w({"data-indeterminate":c},f),icon:b.cloneElement(g,{fontSize:(r=g.props.fontSize)!=null?r:p}),checkedIcon:b.cloneElement(k,{fontSize:(o=k.props.fontSize)!=null?o:p}),ownerState:h,ref:n,className:le(m.root,x)},y,{classes:m}))}),$6=KT,ZT=(e,t)=>w({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%"},t&&!e.vars&&{colorScheme:e.palette.mode}),qT=e=>w({color:(e.vars||e).palette.text.primary},e.typography.body1,{backgroundColor:(e.vars||e).palette.background.default,"@media print":{backgroundColor:(e.vars||e).palette.common.white}}),XT=(e,t=!1)=>{var n;const r={};t&&e.colorSchemes&&Object.entries(e.colorSchemes).forEach(([s,a])=>{var l;r[e.getColorSchemeSelector(s).replace(/\s*&/,"")]={colorScheme:(l=a.palette)==null?void 0:l.mode}});let o=w({html:ZT(e,t),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:w({margin:0},qT(e),{"&::backdrop":{backgroundColor:(e.vars||e).palette.background.default}})},r);const i=(n=e.components)==null||(n=n.MuiCssBaseline)==null?void 0:n.styleOverrides;return i&&(o=[o,i]),o};function JT(e){const t=Te({props:e,name:"MuiCssBaseline"}),{children:n,enableColorScheme:r=!1}=t;return d.jsxs(b.Fragment,{children:[d.jsx(_6,{styles:o=>XT(o,r)}),n]})}function QT(e){return De("MuiModal",e)}Ee("MuiModal",["root","hidden","backdrop"]);const eR=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],tR=e=>{const{open:t,exited:n,classes:r}=e;return _e({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},QT,r)},nR=H("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(({theme:e,ownerState:t})=>w({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&t.exited&&{visibility:"hidden"})),rR=H(D6,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),oR=b.forwardRef(function(t,n){var r,o,i,s,a,l;const c=Te({name:"MuiModal",props:t}),{BackdropComponent:u=rR,BackdropProps:f,className:p,closeAfterTransition:x=!1,children:y,container:g,component:k,components:h={},componentsProps:m={},disableAutoFocus:v=!1,disableEnforceFocus:C=!1,disableEscapeKeyDown:S=!1,disablePortal:E=!1,disableRestoreFocus:P=!1,disableScrollLock:M=!1,hideBackdrop:T=!1,keepMounted:R=!1,onBackdropClick:O,open:A,slotProps:$,slots:_}=c,D=Q(c,eR),L=w({},c,{closeAfterTransition:x,disableAutoFocus:v,disableEnforceFocus:C,disableEscapeKeyDown:S,disablePortal:E,disableRestoreFocus:P,disableScrollLock:M,hideBackdrop:T,keepMounted:R}),{getRootProps:V,getBackdropProps:I,getTransitionProps:F,portalRef:z,isTopModal:ae,exited:re,hasTransition:de}=wM(w({},L,{rootRef:n})),W=w({},L,{exited:re}),ne=tR(W),pe={};if(y.props.tabIndex===void 0&&(pe.tabIndex="-1"),de){const{onEnter:j,onExited:U}=F();pe.onEnter=j,pe.onExited=U}const Y=(r=(o=_==null?void 0:_.root)!=null?o:h.Root)!=null?r:nR,me=(i=(s=_==null?void 0:_.backdrop)!=null?s:h.Backdrop)!=null?i:u,Se=(a=$==null?void 0:$.root)!=null?a:m.root,Pe=(l=$==null?void 0:$.backdrop)!=null?l:m.backdrop,ee=We({elementType:Y,externalSlotProps:Se,externalForwardedProps:D,getSlotProps:V,additionalProps:{ref:n,as:k},ownerState:W,className:le(p,Se==null?void 0:Se.className,ne==null?void 0:ne.root,!W.open&&W.exited&&(ne==null?void 0:ne.hidden))}),J=We({elementType:me,externalSlotProps:Pe,additionalProps:f,getSlotProps:j=>I(w({},j,{onClick:U=>{O&&O(U),j!=null&&j.onClick&&j.onClick(U)}})),className:le(Pe==null?void 0:Pe.className,f==null?void 0:f.className,ne==null?void 0:ne.backdrop),ownerState:W});return!R&&!A&&(!de||re)?null:d.jsx(M6,{ref:z,container:g,disablePortal:E,children:d.jsxs(Y,w({},ee,{children:[!T&&u?d.jsx(me,w({},J)):null,d.jsx(y6,{disableEnforceFocus:C,disableAutoFocus:v,disableRestoreFocus:P,isEnabled:ae,open:A,children:b.cloneElement(y,pe)})]}))})}),Im=oR;function iR(e){return De("MuiDialog",e)}const tl=Ee("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),sR=b.createContext({}),aR=sR,lR=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],cR=H(D6,{name:"MuiDialog",slot:"Backdrop",overrides:(e,t)=>t.backdrop})({zIndex:-1}),uR=e=>{const{classes:t,scroll:n,maxWidth:r,fullWidth:o,fullScreen:i}=e,s={root:["root"],container:["container",`scroll${te(n)}`],paper:["paper",`paperScroll${te(n)}`,`paperWidth${te(String(r))}`,o&&"paperFullWidth",i&&"paperFullScreen"]};return _e(s,iR,t)},dR=H(Im,{name:"MuiDialog",slot:"Root",overridesResolver:(e,t)=>t.root})({"@media print":{position:"absolute !important"}}),fR=H("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.container,t[`scroll${te(n.scroll)}`]]}})(({ownerState:e})=>w({height:"100%","@media print":{height:"auto"},outline:0},e.scroll==="paper"&&{display:"flex",justifyContent:"center",alignItems:"center"},e.scroll==="body"&&{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}})),pR=H(ql,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`scrollPaper${te(n.scroll)}`],t[`paperWidth${te(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})(({theme:e,ownerState:t})=>w({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},t.scroll==="paper"&&{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},t.scroll==="body"&&{display:"inline-block",verticalAlign:"middle",textAlign:"left"},!t.maxWidth&&{maxWidth:"calc(100% - 64px)"},t.maxWidth==="xs"&&{maxWidth:e.breakpoints.unit==="px"?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${tl.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}},t.maxWidth&&t.maxWidth!=="xs"&&{maxWidth:`${e.breakpoints.values[t.maxWidth]}${e.breakpoints.unit}`,[`&.${tl.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[t.maxWidth]+32*2)]:{maxWidth:"calc(100% - 64px)"}}},t.fullWidth&&{width:"calc(100% - 64px)"},t.fullScreen&&{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${tl.paperScrollBody}`]:{margin:0,maxWidth:"100%"}})),hR=b.forwardRef(function(t,n){const r=Te({props:t,name:"MuiDialog"}),o=Le(),i={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{"aria-describedby":s,"aria-labelledby":a,BackdropComponent:l,BackdropProps:c,children:u,className:f,disableEscapeKeyDown:p=!1,fullScreen:x=!1,fullWidth:y=!1,maxWidth:g="sm",onBackdropClick:k,onClose:h,open:m,PaperComponent:v=ql,PaperProps:C={},scroll:S="paper",TransitionComponent:E=ea,transitionDuration:P=i,TransitionProps:M}=r,T=Q(r,lR),R=w({},r,{disableEscapeKeyDown:p,fullScreen:x,fullWidth:y,maxWidth:g,scroll:S}),O=uR(R),A=b.useRef(),$=V=>{A.current=V.target===V.currentTarget},_=V=>{A.current&&(A.current=null,k&&k(V),h&&h(V,"backdropClick"))},D=ho(a),L=b.useMemo(()=>({titleId:D}),[D]);return d.jsx(dR,w({className:le(O.root,f),closeAfterTransition:!0,components:{Backdrop:cR},componentsProps:{backdrop:w({transitionDuration:P,as:l},c)},disableEscapeKeyDown:p,onClose:h,open:m,ref:n,onClick:_,ownerState:R},T,{children:d.jsx(E,w({appear:!0,in:m,timeout:P,role:"presentation"},M,{children:d.jsx(fR,{className:le(O.container),onMouseDown:$,ownerState:R,children:d.jsx(pR,w({as:v,elevation:24,role:"dialog","aria-describedby":s,"aria-labelledby":D},C,{className:le(O.paper,C.className),ownerState:R,children:d.jsx(aR.Provider,{value:L,children:u})}))})}))}))}),mR=hR;function gR(e){return De("MuiDialogActions",e)}Ee("MuiDialogActions",["root","spacing"]);const yR=["className","disableSpacing"],vR=e=>{const{classes:t,disableSpacing:n}=e;return _e({root:["root",!n&&"spacing"]},gR,t)},xR=H("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})(({ownerState:e})=>w({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},!e.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),CR=b.forwardRef(function(t,n){const r=Te({props:t,name:"MuiDialogActions"}),{className:o,disableSpacing:i=!1}=r,s=Q(r,yR),a=w({},r,{disableSpacing:i}),l=vR(a);return d.jsx(xR,w({className:le(l.root,o),ownerState:a,ref:n},s))}),bR=CR;function wR(e){return De("MuiDialogContent",e)}Ee("MuiDialogContent",["root","dividers"]);const SR=Ee("MuiDialogTitle",["root"]),kR=SR,PR=["className","dividers"],ER=e=>{const{classes:t,dividers:n}=e;return _e({root:["root",n&&"dividers"]},wR,t)},MR=H("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})(({theme:e,ownerState:t})=>w({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px"},t.dividers?{padding:"16px 24px",borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}:{[`.${kR.root} + &`]:{paddingTop:0}})),TR=b.forwardRef(function(t,n){const r=Te({props:t,name:"MuiDialogContent"}),{className:o,dividers:i=!1}=r,s=Q(r,PR),a=w({},r,{dividers:i}),l=ER(a);return d.jsx(MR,w({className:le(l.root,o),ownerState:a,ref:n},s))}),RR=TR,_R=Ee("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),Fy=_R,DR=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],OR=e=>{const{classes:t,disableUnderline:n}=e,o=_e({root:["root",!n&&"underline"],input:["input"]},oT,t);return w({},t,o)},IR=H(Ef,{shouldForwardProp:e=>rn(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...kf(e,t),!n.disableUnderline&&t.underline]}})(({theme:e,ownerState:t})=>{var n;const r=e.palette.mode==="light",o=r?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",i=r?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",s=r?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",a=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return w({position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:i,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:s,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:i}},[`&.${Jo.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:i},[`&.${Jo.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:a}},!t.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(n=(e.vars||e).palette[t.color||"primary"])==null?void 0:n.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Jo.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Jo.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:o}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Jo.disabled}, .${Jo.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${Jo.disabled}:before`]:{borderBottomStyle:"dotted"}},t.startAdornment&&{paddingLeft:12},t.endAdornment&&{paddingRight:12},t.multiline&&w({padding:"25px 12px 8px"},t.size==="small"&&{paddingTop:21,paddingBottom:4},t.hiddenLabel&&{paddingTop:16,paddingBottom:17},t.hiddenLabel&&t.size==="small"&&{paddingTop:8,paddingBottom:9}))}),$R=H(Mf,{name:"MuiFilledInput",slot:"Input",overridesResolver:Pf})(({theme:e,ownerState:t})=>w({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},t.size==="small"&&{paddingTop:21,paddingBottom:4},t.hiddenLabel&&{paddingTop:16,paddingBottom:17},t.startAdornment&&{paddingLeft:0},t.endAdornment&&{paddingRight:0},t.hiddenLabel&&t.size==="small"&&{paddingTop:8,paddingBottom:9},t.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),F6=b.forwardRef(function(t,n){var r,o,i,s;const a=Te({props:t,name:"MuiFilledInput"}),{components:l={},componentsProps:c,fullWidth:u=!1,inputComponent:f="input",multiline:p=!1,slotProps:x,slots:y={},type:g="text"}=a,k=Q(a,DR),h=w({},a,{fullWidth:u,inputComponent:f,multiline:p,type:g}),m=OR(a),v={root:{ownerState:h},input:{ownerState:h}},C=x??c?Jt(v,x??c):v,S=(r=(o=y.root)!=null?o:l.Root)!=null?r:IR,E=(i=(s=y.input)!=null?s:l.Input)!=null?i:$R;return d.jsx(Om,w({slots:{root:S,input:E},componentsProps:C,fullWidth:u,inputComponent:f,multiline:p,ref:n,type:g},k,{classes:m}))});F6.muiName="Input";const A6=F6;function FR(e){return De("MuiFormControl",e)}Ee("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const AR=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],LR=e=>{const{classes:t,margin:n,fullWidth:r}=e,o={root:["root",n!=="none"&&`margin${te(n)}`,r&&"fullWidth"]};return _e(o,FR,t)},jR=H("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:e},t)=>w({},t.root,t[`margin${te(e.margin)}`],e.fullWidth&&t.fullWidth)})(({ownerState:e})=>w({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},e.margin==="normal"&&{marginTop:16,marginBottom:8},e.margin==="dense"&&{marginTop:8,marginBottom:4},e.fullWidth&&{width:"100%"})),NR=b.forwardRef(function(t,n){const r=Te({props:t,name:"MuiFormControl"}),{children:o,className:i,color:s="primary",component:a="div",disabled:l=!1,error:c=!1,focused:u,fullWidth:f=!1,hiddenLabel:p=!1,margin:x="none",required:y=!1,size:g="medium",variant:k="outlined"}=r,h=Q(r,AR),m=w({},r,{color:s,component:a,disabled:l,error:c,fullWidth:f,hiddenLabel:p,margin:x,required:y,size:g,variant:k}),v=LR(m),[C,S]=b.useState(()=>{let $=!1;return o&&b.Children.forEach(o,_=>{if(!pu(_,["Input","Select"]))return;const D=pu(_,["Select"])?_.props.input:_;D&&GM(D.props)&&($=!0)}),$}),[E,P]=b.useState(()=>{let $=!1;return o&&b.Children.forEach(o,_=>{pu(_,["Input","Select"])&&(sd(_.props,!0)||sd(_.props.inputProps,!0))&&($=!0)}),$}),[M,T]=b.useState(!1);l&&M&&T(!1);const R=u!==void 0&&!l?u:M;let O;const A=b.useMemo(()=>({adornedStart:C,setAdornedStart:S,color:s,disabled:l,error:c,filled:E,focused:R,fullWidth:f,hiddenLabel:p,size:g,onBlur:()=>{T(!1)},onEmpty:()=>{P(!1)},onFilled:()=>{P(!0)},onFocus:()=>{T(!0)},registerEffect:O,required:y,variant:k}),[C,s,l,c,E,R,f,p,O,y,g,k]);return d.jsx(Sf.Provider,{value:A,children:d.jsx(jR,w({as:a,ownerState:m,className:le(v.root,i),ref:n},h,{children:o}))})}),Tf=NR,VR=uk({createStyledComponent:H("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>Te({props:e,name:"MuiStack"})}),zR=VR;function BR(e){return De("MuiFormControlLabel",e)}const WR=Ee("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),Na=WR,HR=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],UR=e=>{const{classes:t,disabled:n,labelPlacement:r,error:o,required:i}=e,s={root:["root",n&&"disabled",`labelPlacement${te(r)}`,o&&"error",i&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",o&&"error"]};return _e(s,BR,t)},YR=H("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Na.label}`]:t.label},t.root,t[`labelPlacement${te(n.labelPlacement)}`]]}})(({theme:e,ownerState:t})=>w({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${Na.disabled}`]:{cursor:"default"}},t.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},t.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},t.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${Na.label}`]:{[`&.${Na.disabled}`]:{color:(e.vars||e).palette.text.disabled}}})),GR=H("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(({theme:e})=>({[`&.${Na.error}`]:{color:(e.vars||e).palette.error.main}})),KR=b.forwardRef(function(t,n){var r,o;const i=Te({props:t,name:"MuiFormControlLabel"}),{className:s,componentsProps:a={},control:l,disabled:c,disableTypography:u,label:f,labelPlacement:p="end",required:x,slotProps:y={}}=i,g=Q(i,HR),k=Lr(),h=(r=c??l.props.disabled)!=null?r:k==null?void 0:k.disabled,m=x??l.props.required,v={disabled:h,required:m};["checked","name","onChange","value","inputRef"].forEach(T=>{typeof l.props[T]>"u"&&typeof i[T]<"u"&&(v[T]=i[T])});const C=Ko({props:i,muiFormControl:k,states:["error"]}),S=w({},i,{disabled:h,labelPlacement:p,required:m,error:C.error}),E=UR(S),P=(o=y.typography)!=null?o:a.typography;let M=f;return M!=null&&M.type!==Re&&!u&&(M=d.jsx(Re,w({component:"span"},P,{className:le(E.label,P==null?void 0:P.className),children:M}))),d.jsxs(YR,w({className:le(E.root,s),ownerState:S,ref:n},g,{children:[b.cloneElement(l,v),m?d.jsxs(zR,{display:"block",children:[M,d.jsxs(GR,{ownerState:S,"aria-hidden":!0,className:E.asterisk,children:[" ","*"]})]}):M]}))}),Ql=KR;function ZR(e){return De("MuiFormGroup",e)}Ee("MuiFormGroup",["root","row","error"]);const qR=["className","row"],XR=e=>{const{classes:t,row:n,error:r}=e;return _e({root:["root",n&&"row",r&&"error"]},ZR,t)},JR=H("div",{name:"MuiFormGroup",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.row&&t.row]}})(({ownerState:e})=>w({display:"flex",flexDirection:"column",flexWrap:"wrap"},e.row&&{flexDirection:"row"})),QR=b.forwardRef(function(t,n){const r=Te({props:t,name:"MuiFormGroup"}),{className:o,row:i=!1}=r,s=Q(r,qR),a=Lr(),l=Ko({props:r,muiFormControl:a,states:["error"]}),c=w({},r,{row:i,error:l.error}),u=XR(c);return d.jsx(JR,w({className:le(u.root,o),ownerState:c,ref:n},s))}),L6=QR;function e_(e){return De("MuiFormHelperText",e)}const t_=Ee("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]),Ay=t_;var Ly;const n_=["children","className","component","disabled","error","filled","focused","margin","required","variant"],r_=e=>{const{classes:t,contained:n,size:r,disabled:o,error:i,filled:s,focused:a,required:l}=e,c={root:["root",o&&"disabled",i&&"error",r&&`size${te(r)}`,n&&"contained",a&&"focused",s&&"filled",l&&"required"]};return _e(c,e_,t)},o_=H("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size&&t[`size${te(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(({theme:e,ownerState:t})=>w({color:(e.vars||e).palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${Ay.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${Ay.error}`]:{color:(e.vars||e).palette.error.main}},t.size==="small"&&{marginTop:4},t.contained&&{marginLeft:14,marginRight:14})),i_=b.forwardRef(function(t,n){const r=Te({props:t,name:"MuiFormHelperText"}),{children:o,className:i,component:s="p"}=r,a=Q(r,n_),l=Lr(),c=Ko({props:r,muiFormControl:l,states:["variant","size","disabled","error","filled","focused","required"]}),u=w({},r,{component:s,contained:c.variant==="filled"||c.variant==="outlined",variant:c.variant,size:c.size,disabled:c.disabled,error:c.error,filled:c.filled,focused:c.focused,required:c.required}),f=r_(u);return d.jsx(o_,w({as:s,ownerState:u,className:le(f.root,i),ref:n},a,{children:o===" "?Ly||(Ly=d.jsx("span",{className:"notranslate",children:"​"})):o}))}),s_=i_;function a_(e){return De("MuiFormLabel",e)}const l_=Ee("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),nl=l_,c_=["children","className","color","component","disabled","error","filled","focused","required"],u_=e=>{const{classes:t,color:n,focused:r,disabled:o,error:i,filled:s,required:a}=e,l={root:["root",`color${te(n)}`,o&&"disabled",i&&"error",s&&"filled",r&&"focused",a&&"required"],asterisk:["asterisk",i&&"error"]};return _e(l,a_,t)},d_=H("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:e},t)=>w({},t.root,e.color==="secondary"&&t.colorSecondary,e.filled&&t.filled)})(({theme:e,ownerState:t})=>w({color:(e.vars||e).palette.text.secondary},e.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${nl.focused}`]:{color:(e.vars||e).palette[t.color].main},[`&.${nl.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${nl.error}`]:{color:(e.vars||e).palette.error.main}})),f_=H("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(({theme:e})=>({[`&.${nl.error}`]:{color:(e.vars||e).palette.error.main}})),p_=b.forwardRef(function(t,n){const r=Te({props:t,name:"MuiFormLabel"}),{children:o,className:i,component:s="label"}=r,a=Q(r,c_),l=Lr(),c=Ko({props:r,muiFormControl:l,states:["color","required","focused","disabled","error","filled"]}),u=w({},r,{color:c.color||"primary",component:s,disabled:c.disabled,error:c.error,filled:c.filled,focused:c.focused,required:c.required}),f=u_(u);return d.jsxs(d_,w({as:s,ownerState:u,className:le(f.root,i),ref:n},a,{children:[o,c.required&&d.jsxs(f_,{ownerState:u,"aria-hidden":!0,className:f.asterisk,children:[" ","*"]})]}))}),h_=p_,m_=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function E1(e){return`scale(${e}, ${e**2})`}const g_={entering:{opacity:1,transform:E1(1)},entered:{opacity:1,transform:"none"}},Yp=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),j6=b.forwardRef(function(t,n){const{addEndListener:r,appear:o=!0,children:i,easing:s,in:a,onEnter:l,onEntered:c,onEntering:u,onExit:f,onExited:p,onExiting:x,style:y,timeout:g="auto",TransitionComponent:k=xm}=t,h=Q(t,m_),m=b.useRef(),v=b.useRef(),C=Le(),S=b.useRef(null),E=tt(S,i.ref,n),P=D=>L=>{if(D){const V=S.current;L===void 0?D(V):D(V,L)}},M=P(u),T=P((D,L)=>{h6(D);const{duration:V,delay:I,easing:F}=rd({style:y,timeout:g,easing:s},{mode:"enter"});let z;g==="auto"?(z=C.transitions.getAutoHeightDuration(D.clientHeight),v.current=z):z=V,D.style.transition=[C.transitions.create("opacity",{duration:z,delay:I}),C.transitions.create("transform",{duration:Yp?z:z*.666,delay:I,easing:F})].join(","),l&&l(D,L)}),R=P(c),O=P(x),A=P(D=>{const{duration:L,delay:V,easing:I}=rd({style:y,timeout:g,easing:s},{mode:"exit"});let F;g==="auto"?(F=C.transitions.getAutoHeightDuration(D.clientHeight),v.current=F):F=L,D.style.transition=[C.transitions.create("opacity",{duration:F,delay:V}),C.transitions.create("transform",{duration:Yp?F:F*.666,delay:Yp?V:V||F*.333,easing:I})].join(","),D.style.opacity=0,D.style.transform=E1(.75),f&&f(D)}),$=P(p),_=D=>{g==="auto"&&(m.current=setTimeout(D,v.current||0)),r&&r(S.current,D)};return b.useEffect(()=>()=>{clearTimeout(m.current)},[]),d.jsx(k,w({appear:o,in:a,nodeRef:S,onEnter:T,onEntered:R,onEntering:M,onExit:A,onExited:$,onExiting:O,addEndListener:_,timeout:g==="auto"?null:g},h,{children:(D,L)=>b.cloneElement(i,w({style:w({opacity:0,transform:E1(.75),visibility:D==="exited"&&!a?"hidden":void 0},g_[D],y,i.props.style),ref:E},L))}))});j6.muiSupportAuto=!0;const N6=j6;function y_(e,t,n,r,o){const[i,s]=b.useState(()=>o&&n?n(e).matches:r?r(e).matches:t);return jt(()=>{let a=!0;if(!n)return;const l=n(e),c=()=>{a&&s(l.matches)};return c(),l.addListener(c),()=>{a=!1,l.removeListener(c)}},[e,n]),i}const V6=b.useSyncExternalStore;function v_(e,t,n,r,o){const i=b.useCallback(()=>t,[t]),s=b.useMemo(()=>{if(o&&n)return()=>n(e).matches;if(r!==null){const{matches:u}=r(e);return()=>u}return i},[i,e,r,o,n]),[a,l]=b.useMemo(()=>{if(n===null)return[i,()=>()=>{}];const u=n(e);return[()=>u.matches,f=>(u.addListener(f),()=>{u.removeListener(f)})]},[i,n,e]);return V6(l,a,s)}function ln(e,t={}){const n=af(),r=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:o=!1,matchMedia:i=r?window.matchMedia:null,ssrMatchMedia:s=null,noSsr:a=!1}=i6({name:"MuiUseMediaQuery",props:t,theme:n});let l=typeof e=="function"?e(n):e;return l=l.replace(/^@media( ?)/m,""),(V6!==void 0?v_:y_)(l,o,i,s,a)}const x_=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],C_=e=>{const{classes:t,disableUnderline:n}=e,o=_e({root:["root",!n&&"underline"],input:["input"]},eT,t);return w({},t,o)},b_=H(Ef,{shouldForwardProp:e=>rn(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...kf(e,t),!n.disableUnderline&&t.underline]}})(({theme:e,ownerState:t})=>{let r=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(r=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),w({position:"relative"},t.formControl&&{"label + &":{marginTop:16}},!t.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[t.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${va.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${va.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${r}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${va.disabled}, .${va.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${va.disabled}:before`]:{borderBottomStyle:"dotted"}})}),w_=H(Mf,{name:"MuiInput",slot:"Input",overridesResolver:Pf})({}),z6=b.forwardRef(function(t,n){var r,o,i,s;const a=Te({props:t,name:"MuiInput"}),{disableUnderline:l,components:c={},componentsProps:u,fullWidth:f=!1,inputComponent:p="input",multiline:x=!1,slotProps:y,slots:g={},type:k="text"}=a,h=Q(a,x_),m=C_(a),C={root:{ownerState:{disableUnderline:l}}},S=y??u?Jt(y??u,C):C,E=(r=(o=g.root)!=null?o:c.Root)!=null?r:b_,P=(i=(s=g.input)!=null?s:c.Input)!=null?i:w_;return d.jsx(Om,w({slots:{root:E,input:P},slotProps:S,fullWidth:f,inputComponent:p,multiline:x,ref:n,type:k},h,{classes:m}))});z6.muiName="Input";const B6=z6;function S_(e){return De("MuiInputAdornment",e)}const k_=Ee("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]),jy=k_;var Ny;const P_=["children","className","component","disablePointerEvents","disableTypography","position","variant"],E_=(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${te(n.position)}`],n.disablePointerEvents===!0&&t.disablePointerEvents,t[n.variant]]},M_=e=>{const{classes:t,disablePointerEvents:n,hiddenLabel:r,position:o,size:i,variant:s}=e,a={root:["root",n&&"disablePointerEvents",o&&`position${te(o)}`,s,r&&"hiddenLabel",i&&`size${te(i)}`]};return _e(a,S_,t)},T_=H("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:E_})(({theme:e,ownerState:t})=>w({display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(e.vars||e).palette.action.active},t.variant==="filled"&&{[`&.${jy.positionStart}&:not(.${jy.hiddenLabel})`]:{marginTop:16}},t.position==="start"&&{marginRight:8},t.position==="end"&&{marginLeft:8},t.disablePointerEvents===!0&&{pointerEvents:"none"})),R_=b.forwardRef(function(t,n){const r=Te({props:t,name:"MuiInputAdornment"}),{children:o,className:i,component:s="div",disablePointerEvents:a=!1,disableTypography:l=!1,position:c,variant:u}=r,f=Q(r,P_),p=Lr()||{};let x=u;u&&p.variant,p&&!x&&(x=p.variant);const y=w({},r,{hiddenLabel:p.hiddenLabel,size:p.size,disablePointerEvents:a,position:c,variant:x}),g=M_(y);return d.jsx(Sf.Provider,{value:null,children:d.jsx(T_,w({as:s,ownerState:y,className:le(g.root,i),ref:n},f,{children:typeof o=="string"&&!l?d.jsx(Re,{color:"text.secondary",children:o}):d.jsxs(b.Fragment,{children:[c==="start"?Ny||(Ny=d.jsx("span",{className:"notranslate",children:"​"})):null,o]})}))})}),$m=R_;function __(e){return De("MuiInputLabel",e)}Ee("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const D_=["disableAnimation","margin","shrink","variant","className"],O_=e=>{const{classes:t,formControl:n,size:r,shrink:o,disableAnimation:i,variant:s,required:a}=e,l={root:["root",n&&"formControl",!i&&"animated",o&&"shrink",r&&r!=="normal"&&`size${te(r)}`,s],asterisk:[a&&"asterisk"]},c=_e(l,__,t);return w({},t,c)},I_=H(h_,{shouldForwardProp:e=>rn(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${nl.asterisk}`]:t.asterisk},t.root,n.formControl&&t.formControl,n.size==="small"&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,n.focused&&t.focused,t[n.variant]]}})(({theme:e,ownerState:t})=>w({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},t.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},t.size==="small"&&{transform:"translate(0, 17px) scale(1)"},t.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!t.disableAnimation&&{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},t.variant==="filled"&&w({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},t.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},t.shrink&&w({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},t.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),t.variant==="outlined"&&w({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},t.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},t.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),$_=b.forwardRef(function(t,n){const r=Te({name:"MuiInputLabel",props:t}),{disableAnimation:o=!1,shrink:i,className:s}=r,a=Q(r,D_),l=Lr();let c=i;typeof c>"u"&&l&&(c=l.filled||l.focused||l.adornedStart);const u=Ko({props:r,muiFormControl:l,states:["size","variant","required","focused"]}),f=w({},r,{disableAnimation:o,formControl:l,shrink:c,size:u.size,variant:u.variant,required:u.required,focused:u.focused}),p=O_(f);return d.jsx(I_,w({"data-shrink":c,ownerState:f,ref:n,className:le(p.root,s)},a,{classes:p}))}),F_=$_;function A_(e){return De("MuiLink",e)}const L_=Ee("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),j_=L_,W6={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},N_=e=>W6[e]||e,V_=({theme:e,ownerState:t})=>{const n=N_(t.color),r=Ls(e,`palette.${n}`,!1)||t.color,o=Ls(e,`palette.${n}Channel`);return"vars"in e&&o?`rgba(${o} / 0.4)`:Ne(r,.4)},z_=["className","color","component","onBlur","onFocus","TypographyClasses","underline","variant","sx"],B_=e=>{const{classes:t,component:n,focusVisible:r,underline:o}=e,i={root:["root",`underline${te(o)}`,n==="button"&&"button",r&&"focusVisible"]};return _e(i,A_,t)},W_=H(Re,{name:"MuiLink",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`underline${te(n.underline)}`],n.component==="button"&&t.button]}})(({theme:e,ownerState:t})=>w({},t.underline==="none"&&{textDecoration:"none"},t.underline==="hover"&&{textDecoration:"none","&:hover":{textDecoration:"underline"}},t.underline==="always"&&w({textDecoration:"underline"},t.color!=="inherit"&&{textDecorationColor:V_({theme:e,ownerState:t})},{"&:hover":{textDecorationColor:"inherit"}}),t.component==="button"&&{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${j_.focusVisible}`]:{outline:"auto"}})),H_=b.forwardRef(function(t,n){const r=Te({props:t,name:"MuiLink"}),{className:o,color:i="primary",component:s="a",onBlur:a,onFocus:l,TypographyClasses:c,underline:u="always",variant:f="inherit",sx:p}=r,x=Q(r,z_),{isFocusVisibleRef:y,onBlur:g,onFocus:k,ref:h}=Jd(),[m,v]=b.useState(!1),C=tt(n,h),S=T=>{g(T),y.current===!1&&v(!1),a&&a(T)},E=T=>{k(T),y.current===!0&&v(!0),l&&l(T)},P=w({},r,{color:i,component:s,focusVisible:m,underline:u,variant:f}),M=B_(P);return d.jsx(W_,w({color:i,className:le(M.root,o),classes:c,component:s,onBlur:S,onFocus:E,ref:C,ownerState:P,variant:f,sx:[...Object.keys(W6).includes(i)?[]:[{color:i}],...Array.isArray(p)?p:[p]]},x))}),ad=H_,U_=b.createContext({}),yi=U_;function Y_(e){return De("MuiList",e)}Ee("MuiList",["root","padding","dense","subheader"]);const G_=["children","className","component","dense","disablePadding","subheader"],K_=e=>{const{classes:t,disablePadding:n,dense:r,subheader:o}=e;return _e({root:["root",!n&&"padding",r&&"dense",o&&"subheader"]},Y_,t)},Z_=H("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})(({ownerState:e})=>w({listStyle:"none",margin:0,padding:0,position:"relative"},!e.disablePadding&&{paddingTop:8,paddingBottom:8},e.subheader&&{paddingTop:0})),q_=b.forwardRef(function(t,n){const r=Te({props:t,name:"MuiList"}),{children:o,className:i,component:s="ul",dense:a=!1,disablePadding:l=!1,subheader:c}=r,u=Q(r,G_),f=b.useMemo(()=>({dense:a}),[a]),p=w({},r,{component:s,dense:a,disablePadding:l}),x=K_(p);return d.jsx(yi.Provider,{value:f,children:d.jsxs(Z_,w({as:s,className:le(x.root,i),ref:n,ownerState:p},u,{children:[c,o]}))})}),H6=q_;function X_(e){return De("MuiListItem",e)}const J_=Ee("MuiListItem",["root","container","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","padding","button","secondaryAction","selected"]),Qi=J_,Q_=Ee("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]),eD=Q_;function tD(e){return De("MuiListItemSecondaryAction",e)}Ee("MuiListItemSecondaryAction",["root","disableGutters"]);const nD=["className"],rD=e=>{const{disableGutters:t,classes:n}=e;return _e({root:["root",t&&"disableGutters"]},tD,n)},oD=H("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.disableGutters&&t.disableGutters]}})(({ownerState:e})=>w({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)"},e.disableGutters&&{right:0})),U6=b.forwardRef(function(t,n){const r=Te({props:t,name:"MuiListItemSecondaryAction"}),{className:o}=r,i=Q(r,nD),s=b.useContext(yi),a=w({},r,{disableGutters:s.disableGutters}),l=rD(a);return d.jsx(oD,w({className:le(l.root,o),ownerState:a,ref:n},i))});U6.muiName="ListItemSecondaryAction";const iD=U6,sD=["className"],aD=["alignItems","autoFocus","button","children","className","component","components","componentsProps","ContainerComponent","ContainerProps","dense","disabled","disableGutters","disablePadding","divider","focusVisibleClassName","secondaryAction","selected","slotProps","slots"],lD=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.alignItems==="flex-start"&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters,!n.disablePadding&&t.padding,n.button&&t.button,n.hasSecondaryAction&&t.secondaryAction]},cD=e=>{const{alignItems:t,button:n,classes:r,dense:o,disabled:i,disableGutters:s,disablePadding:a,divider:l,hasSecondaryAction:c,selected:u}=e;return _e({root:["root",o&&"dense",!s&&"gutters",!a&&"padding",l&&"divider",i&&"disabled",n&&"button",t==="flex-start"&&"alignItemsFlexStart",c&&"secondaryAction",u&&"selected"],container:["container"]},X_,r)},uD=H("div",{name:"MuiListItem",slot:"Root",overridesResolver:lD})(({theme:e,ownerState:t})=>w({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left"},!t.disablePadding&&w({paddingTop:8,paddingBottom:8},t.dense&&{paddingTop:4,paddingBottom:4},!t.disableGutters&&{paddingLeft:16,paddingRight:16},!!t.secondaryAction&&{paddingRight:48}),!!t.secondaryAction&&{[`& > .${eD.root}`]:{paddingRight:48}},{[`&.${Qi.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Qi.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ne(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${Qi.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Ne(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${Qi.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}},t.alignItems==="flex-start"&&{alignItems:"flex-start"},t.divider&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"},t.button&&{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Qi.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Ne(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ne(e.palette.primary.main,e.palette.action.selectedOpacity)}}},t.hasSecondaryAction&&{paddingRight:48})),dD=H("li",{name:"MuiListItem",slot:"Container",overridesResolver:(e,t)=>t.container})({position:"relative"}),fD=b.forwardRef(function(t,n){const r=Te({props:t,name:"MuiListItem"}),{alignItems:o="center",autoFocus:i=!1,button:s=!1,children:a,className:l,component:c,components:u={},componentsProps:f={},ContainerComponent:p="li",ContainerProps:{className:x}={},dense:y=!1,disabled:g=!1,disableGutters:k=!1,disablePadding:h=!1,divider:m=!1,focusVisibleClassName:v,secondaryAction:C,selected:S=!1,slotProps:E={},slots:P={}}=r,M=Q(r.ContainerProps,sD),T=Q(r,aD),R=b.useContext(yi),O=b.useMemo(()=>({dense:y||R.dense||!1,alignItems:o,disableGutters:k}),[o,R.dense,y,k]),A=b.useRef(null);jt(()=>{i&&A.current&&A.current.focus()},[i]);const $=b.Children.toArray(a),_=$.length&&pu($[$.length-1],["ListItemSecondaryAction"]),D=w({},r,{alignItems:o,autoFocus:i,button:s,dense:O.dense,disabled:g,disableGutters:k,disablePadding:h,divider:m,hasSecondaryAction:_,selected:S}),L=cD(D),V=tt(A,n),I=P.root||u.Root||uD,F=E.root||f.root||{},z=w({className:le(L.root,F.className,l),disabled:g},T);let ae=c||"li";return s&&(z.component=c||"div",z.focusVisibleClassName=le(Qi.focusVisible,v),ae=$r),_?(ae=!z.component&&!c?"div":ae,p==="li"&&(ae==="li"?ae="div":z.component==="li"&&(z.component="div")),d.jsx(yi.Provider,{value:O,children:d.jsxs(dD,w({as:p,className:le(L.container,x),ref:V,ownerState:D},M,{children:[d.jsx(I,w({},F,!Or(I)&&{as:ae,ownerState:w({},D,F.ownerState)},z,{children:$})),$.pop()]}))})):d.jsx(yi.Provider,{value:O,children:d.jsxs(I,w({},F,{as:ae,ref:V},!Or(I)&&{ownerState:w({},D,F.ownerState)},z,{children:[$,C&&d.jsx(iD,{children:C})]}))})}),pD=fD,hD=Ee("MuiListItemIcon",["root","alignItemsFlexStart"]),Vy=hD,mD=Ee("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),zy=mD,gD=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function Gp(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function By(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function Y6(e,t){if(t===void 0)return!0;let n=e.innerText;return n===void 0&&(n=e.textContent),n=n.trim().toLowerCase(),n.length===0?!1:t.repeating?n[0]===t.keys[0]:n.indexOf(t.keys.join(""))===0}function xa(e,t,n,r,o,i){let s=!1,a=o(e,t,t?n:!1);for(;a;){if(a===e.firstChild){if(s)return!1;s=!0}const l=r?!1:a.disabled||a.getAttribute("aria-disabled")==="true";if(!a.hasAttribute("tabindex")||!Y6(a,i)||l)a=o(e,a,n);else return a.focus(),!0}return!1}const yD=b.forwardRef(function(t,n){const{actions:r,autoFocus:o=!1,autoFocusItem:i=!1,children:s,className:a,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:u,variant:f="selectedMenu"}=t,p=Q(t,gD),x=b.useRef(null),y=b.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});jt(()=>{o&&x.current.focus()},[o]),b.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(v,C)=>{const S=!x.current.style.width;if(v.clientHeight{const C=x.current,S=v.key,E=Et(C).activeElement;if(S==="ArrowDown")v.preventDefault(),xa(C,E,c,l,Gp);else if(S==="ArrowUp")v.preventDefault(),xa(C,E,c,l,By);else if(S==="Home")v.preventDefault(),xa(C,null,c,l,Gp);else if(S==="End")v.preventDefault(),xa(C,null,c,l,By);else if(S.length===1){const P=y.current,M=S.toLowerCase(),T=performance.now();P.keys.length>0&&(T-P.lastTime>500?(P.keys=[],P.repeating=!0,P.previousKeyMatched=!0):P.repeating&&M!==P.keys[0]&&(P.repeating=!1)),P.lastTime=T,P.keys.push(M);const R=E&&!P.repeating&&Y6(E,P);P.previousKeyMatched&&(R||xa(C,E,!1,l,Gp,P))?v.preventDefault():P.previousKeyMatched=!1}u&&u(v)},k=tt(x,n);let h=-1;b.Children.forEach(s,(v,C)=>{if(!b.isValidElement(v)){h===C&&(h+=1,h>=s.length&&(h=-1));return}v.props.disabled||(f==="selectedMenu"&&v.props.selected||h===-1)&&(h=C),h===C&&(v.props.disabled||v.props.muiSkipListHighlight||v.type.muiSkipListHighlight)&&(h+=1,h>=s.length&&(h=-1))});const m=b.Children.map(s,(v,C)=>{if(C===h){const S={};return i&&(S.autoFocus=!0),v.props.tabIndex===void 0&&f==="selectedMenu"&&(S.tabIndex=0),b.cloneElement(v,S)}return v});return d.jsx(H6,w({role:"menu",ref:k,className:a,onKeyDown:g,tabIndex:o?0:-1},p,{children:m}))}),vD=yD;function xD(e){return De("MuiPopover",e)}Ee("MuiPopover",["root","paper"]);const CD=["onEntering"],bD=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],wD=["slotProps"];function Wy(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.height/2:t==="bottom"&&(n=e.height),n}function Hy(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.width/2:t==="right"&&(n=e.width),n}function Uy(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function Kp(e){return typeof e=="function"?e():e}const SD=e=>{const{classes:t}=e;return _e({root:["root"],paper:["paper"]},xD,t)},kD=H(Im,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),G6=H(ql,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),PD=b.forwardRef(function(t,n){var r,o,i;const s=Te({props:t,name:"MuiPopover"}),{action:a,anchorEl:l,anchorOrigin:c={vertical:"top",horizontal:"left"},anchorPosition:u,anchorReference:f="anchorEl",children:p,className:x,container:y,elevation:g=8,marginThreshold:k=16,open:h,PaperProps:m={},slots:v,slotProps:C,transformOrigin:S={vertical:"top",horizontal:"left"},TransitionComponent:E=N6,transitionDuration:P="auto",TransitionProps:{onEntering:M}={},disableScrollLock:T=!1}=s,R=Q(s.TransitionProps,CD),O=Q(s,bD),A=(r=C==null?void 0:C.paper)!=null?r:m,$=b.useRef(),_=tt($,A.ref),D=w({},s,{anchorOrigin:c,anchorReference:f,elevation:g,marginThreshold:k,externalPaperSlotProps:A,transformOrigin:S,TransitionComponent:E,transitionDuration:P,TransitionProps:R}),L=SD(D),V=b.useCallback(()=>{if(f==="anchorPosition")return u;const j=Kp(l),K=(j&&j.nodeType===1?j:Et($.current).body).getBoundingClientRect();return{top:K.top+Wy(K,c.vertical),left:K.left+Hy(K,c.horizontal)}},[l,c.horizontal,c.vertical,u,f]),I=b.useCallback(j=>({vertical:Wy(j,S.vertical),horizontal:Hy(j,S.horizontal)}),[S.horizontal,S.vertical]),F=b.useCallback(j=>{const U={width:j.offsetWidth,height:j.offsetHeight},K=I(U);if(f==="none")return{top:null,left:null,transformOrigin:Uy(K)};const xe=V();let Ie=xe.top-K.vertical,se=xe.left-K.horizontal;const fe=Ie+U.height,B=se+U.width,q=Ei(Kp(l)),we=q.innerHeight-k,$e=q.innerWidth-k;if(k!==null&&Iewe){const ke=fe-we;Ie-=ke,K.vertical+=ke}if(k!==null&&se$e){const ke=B-$e;se-=ke,K.horizontal+=ke}return{top:`${Math.round(Ie)}px`,left:`${Math.round(se)}px`,transformOrigin:Uy(K)}},[l,f,V,I,k]),[z,ae]=b.useState(h),re=b.useCallback(()=>{const j=$.current;if(!j)return;const U=F(j);U.top!==null&&(j.style.top=U.top),U.left!==null&&(j.style.left=U.left),j.style.transformOrigin=U.transformOrigin,ae(!0)},[F]);b.useEffect(()=>(T&&window.addEventListener("scroll",re),()=>window.removeEventListener("scroll",re)),[l,T,re]);const de=(j,U)=>{M&&M(j,U),re()},W=()=>{ae(!1)};b.useEffect(()=>{h&&re()}),b.useImperativeHandle(a,()=>h?{updatePosition:()=>{re()}}:null,[h,re]),b.useEffect(()=>{if(!h)return;const j=K3(()=>{re()}),U=Ei(l);return U.addEventListener("resize",j),()=>{j.clear(),U.removeEventListener("resize",j)}},[l,h,re]);let ne=P;P==="auto"&&!E.muiSupportAuto&&(ne=void 0);const pe=y||(l?Et(Kp(l)).body:void 0),Y=(o=v==null?void 0:v.root)!=null?o:kD,me=(i=v==null?void 0:v.paper)!=null?i:G6,Se=We({elementType:me,externalSlotProps:w({},A,{style:z?A.style:w({},A.style,{opacity:0})}),additionalProps:{elevation:g,ref:_},ownerState:D,className:le(L.paper,A==null?void 0:A.className)}),Pe=We({elementType:Y,externalSlotProps:(C==null?void 0:C.root)||{},externalForwardedProps:O,additionalProps:{ref:n,slotProps:{backdrop:{invisible:!0}},container:pe,open:h},ownerState:D,className:le(L.root,x)}),{slotProps:ee}=Pe,J=Q(Pe,wD);return d.jsx(Y,w({},J,!Or(Y)&&{slotProps:ee,disableScrollLock:T},{children:d.jsx(E,w({appear:!0,in:h,onEntering:de,onExited:W,timeout:ne},R,{children:d.jsx(me,w({},Se,{children:p}))}))}))}),ED=PD;function MD(e){return De("MuiMenu",e)}Ee("MuiMenu",["root","paper","list"]);const TD=["onEntering"],RD=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],_D={vertical:"top",horizontal:"right"},DD={vertical:"top",horizontal:"left"},OD=e=>{const{classes:t}=e;return _e({root:["root"],paper:["paper"],list:["list"]},MD,t)},ID=H(ED,{shouldForwardProp:e=>rn(e)||e==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(e,t)=>t.root})({}),$D=H(G6,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,t)=>t.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),FD=H(vD,{name:"MuiMenu",slot:"List",overridesResolver:(e,t)=>t.list})({outline:0}),AD=b.forwardRef(function(t,n){var r,o;const i=Te({props:t,name:"MuiMenu"}),{autoFocus:s=!0,children:a,className:l,disableAutoFocusItem:c=!1,MenuListProps:u={},onClose:f,open:p,PaperProps:x={},PopoverClasses:y,transitionDuration:g="auto",TransitionProps:{onEntering:k}={},variant:h="selectedMenu",slots:m={},slotProps:v={}}=i,C=Q(i.TransitionProps,TD),S=Q(i,RD),E=Le(),P=E.direction==="rtl",M=w({},i,{autoFocus:s,disableAutoFocusItem:c,MenuListProps:u,onEntering:k,PaperProps:x,transitionDuration:g,TransitionProps:C,variant:h}),T=OD(M),R=s&&!c&&p,O=b.useRef(null),A=(F,z)=>{O.current&&O.current.adjustStyleForScrollbar(F,E),k&&k(F,z)},$=F=>{F.key==="Tab"&&(F.preventDefault(),f&&f(F,"tabKeyDown"))};let _=-1;b.Children.map(a,(F,z)=>{b.isValidElement(F)&&(F.props.disabled||(h==="selectedMenu"&&F.props.selected||_===-1)&&(_=z))});const D=(r=m.paper)!=null?r:$D,L=(o=v.paper)!=null?o:x,V=We({elementType:m.root,externalSlotProps:v.root,ownerState:M,className:[T.root,l]}),I=We({elementType:D,externalSlotProps:L,ownerState:M,className:T.paper});return d.jsx(ID,w({onClose:f,anchorOrigin:{vertical:"bottom",horizontal:P?"right":"left"},transformOrigin:P?_D:DD,slots:{paper:D,root:m.root},slotProps:{root:V,paper:I},open:p,ref:n,transitionDuration:g,TransitionProps:w({onEntering:A},C),ownerState:M},S,{classes:y,children:d.jsx(FD,w({onKeyDown:$,actions:O,autoFocus:s&&(_===-1||c),autoFocusItem:R,variant:h},u,{className:le(T.list,u.className),children:a}))}))}),LD=AD;function jD(e){return De("MuiMenuItem",e)}const ND=Ee("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),Ca=ND,VD=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],zD=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]},BD=e=>{const{disabled:t,dense:n,divider:r,disableGutters:o,selected:i,classes:s}=e,l=_e({root:["root",n&&"dense",t&&"disabled",!o&&"gutters",r&&"divider",i&&"selected"]},jD,s);return w({},s,l)},WD=H($r,{shouldForwardProp:e=>rn(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:zD})(({theme:e,ownerState:t})=>w({},e.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.divider&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Ca.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ne(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${Ca.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Ne(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${Ca.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Ne(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:Ne(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${Ca.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Ca.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${Fy.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${Fy.inset}`]:{marginLeft:52},[`& .${zy.root}`]:{marginTop:0,marginBottom:0},[`& .${zy.inset}`]:{paddingLeft:36},[`& .${Vy.root}`]:{minWidth:36}},!t.dense&&{[e.breakpoints.up("sm")]:{minHeight:"auto"}},t.dense&&w({minHeight:32,paddingTop:4,paddingBottom:4},e.typography.body2,{[`& .${Vy.root} svg`]:{fontSize:"1.25rem"}}))),HD=b.forwardRef(function(t,n){const r=Te({props:t,name:"MuiMenuItem"}),{autoFocus:o=!1,component:i="li",dense:s=!1,divider:a=!1,disableGutters:l=!1,focusVisibleClassName:c,role:u="menuitem",tabIndex:f,className:p}=r,x=Q(r,VD),y=b.useContext(yi),g=b.useMemo(()=>({dense:s||y.dense||!1,disableGutters:l}),[y.dense,s,l]),k=b.useRef(null);jt(()=>{o&&k.current&&k.current.focus()},[o]);const h=w({},r,{dense:g.dense,divider:a,disableGutters:l}),m=BD(r),v=tt(k,n);let C;return r.disabled||(C=f!==void 0?f:-1),d.jsx(yi.Provider,{value:g,children:d.jsx(WD,w({ref:v,role:u,tabIndex:C,component:i,focusVisibleClassName:le(m.focusVisible,c),className:le(m.root,p)},x,{ownerState:h,classes:m}))})}),UD=HD;function YD(e){return De("MuiNativeSelect",e)}const GD=Ee("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),Fm=GD,KD=["className","disabled","error","IconComponent","inputRef","variant"],ZD=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:i,error:s}=e,a={select:["select",n,r&&"disabled",o&&"multiple",s&&"error"],icon:["icon",`icon${te(n)}`,i&&"iconOpen",r&&"disabled"]};return _e(a,YD,t)},K6=({ownerState:e,theme:t})=>w({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":w({},t.vars?{backgroundColor:`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:t.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${Fm.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(t.vars||t).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},e.variant==="filled"&&{"&&&":{paddingRight:32}},e.variant==="outlined"&&{borderRadius:(t.vars||t).shape.borderRadius,"&:focus":{borderRadius:(t.vars||t).shape.borderRadius},"&&&":{paddingRight:32}}),qD=H("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:rn,overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${Fm.multiple}`]:t.multiple}]}})(K6),Z6=({ownerState:e,theme:t})=>w({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(t.vars||t).palette.action.active,[`&.${Fm.disabled}`]:{color:(t.vars||t).palette.action.disabled}},e.open&&{transform:"rotate(180deg)"},e.variant==="filled"&&{right:7},e.variant==="outlined"&&{right:7}),XD=H("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${te(n.variant)}`],n.open&&t.iconOpen]}})(Z6),JD=b.forwardRef(function(t,n){const{className:r,disabled:o,error:i,IconComponent:s,inputRef:a,variant:l="standard"}=t,c=Q(t,KD),u=w({},t,{disabled:o,variant:l,error:i}),f=ZD(u);return d.jsxs(b.Fragment,{children:[d.jsx(qD,w({ownerState:u,className:le(f.select,r),disabled:o,ref:a||n},c)),t.multiple?null:d.jsx(XD,{as:s,ownerState:u,className:f.icon})]})}),QD=JD;var Yy;const eO=["children","classes","className","label","notched"],tO=H("fieldset",{shouldForwardProp:rn})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),nO=H("legend",{shouldForwardProp:rn})(({ownerState:e,theme:t})=>w({float:"unset",width:"auto",overflow:"hidden"},!e.withLabel&&{padding:0,lineHeight:"11px",transition:t.transitions.create("width",{duration:150,easing:t.transitions.easing.easeOut})},e.withLabel&&w({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:t.transitions.create("max-width",{duration:50,easing:t.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},e.notched&&{maxWidth:"100%",transition:t.transitions.create("max-width",{duration:100,easing:t.transitions.easing.easeOut,delay:50})})));function rO(e){const{className:t,label:n,notched:r}=e,o=Q(e,eO),i=n!=null&&n!=="",s=w({},e,{notched:r,withLabel:i});return d.jsx(tO,w({"aria-hidden":!0,className:t,ownerState:s},o,{children:d.jsx(nO,{ownerState:s,children:i?d.jsx("span",{children:n}):Yy||(Yy=d.jsx("span",{className:"notranslate",children:"​"}))})}))}const oO=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],iO=e=>{const{classes:t}=e,r=_e({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},nT,t);return w({},t,r)},sO=H(Ef,{shouldForwardProp:e=>rn(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:kf})(({theme:e,ownerState:t})=>{const n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return w({position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${Co.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${Co.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:n}},[`&.${Co.focused} .${Co.notchedOutline}`]:{borderColor:(e.vars||e).palette[t.color].main,borderWidth:2},[`&.${Co.error} .${Co.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${Co.disabled} .${Co.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}},t.startAdornment&&{paddingLeft:14},t.endAdornment&&{paddingRight:14},t.multiline&&w({padding:"16.5px 14px"},t.size==="small"&&{padding:"8.5px 14px"}))}),aO=H(rO,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}}),lO=H(Mf,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:Pf})(({theme:e,ownerState:t})=>w({padding:"16.5px 14px"},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},t.size==="small"&&{padding:"8.5px 14px"},t.multiline&&{padding:0},t.startAdornment&&{paddingLeft:0},t.endAdornment&&{paddingRight:0})),q6=b.forwardRef(function(t,n){var r,o,i,s,a;const l=Te({props:t,name:"MuiOutlinedInput"}),{components:c={},fullWidth:u=!1,inputComponent:f="input",label:p,multiline:x=!1,notched:y,slots:g={},type:k="text"}=l,h=Q(l,oO),m=iO(l),v=Lr(),C=Ko({props:l,muiFormControl:v,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),S=w({},l,{color:C.color||"primary",disabled:C.disabled,error:C.error,focused:C.focused,formControl:v,fullWidth:u,hiddenLabel:C.hiddenLabel,multiline:x,size:C.size,type:k}),E=(r=(o=g.root)!=null?o:c.Root)!=null?r:sO,P=(i=(s=g.input)!=null?s:c.Input)!=null?i:lO;return d.jsx(Om,w({slots:{root:E,input:P},renderSuffix:M=>d.jsx(aO,{ownerState:S,className:m.notchedOutline,label:p!=null&&p!==""&&C.required?a||(a=d.jsxs(b.Fragment,{children:[p," ","*"]})):p,notched:typeof y<"u"?y:!!(M.startAdornment||M.filled||M.focused)}),fullWidth:u,inputComponent:f,multiline:x,ref:n,type:k},h,{classes:w({},m,{notchedOutline:null})}))});q6.muiName="Input";const X6=q6,cO=Gt(d.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),uO=Gt(d.jsx("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked"),dO=H("span",{shouldForwardProp:rn})({position:"relative",display:"flex"}),fO=H(cO)({transform:"scale(1)"}),pO=H(uO)(({theme:e,ownerState:t})=>w({left:0,position:"absolute",transform:"scale(0)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeIn,duration:e.transitions.duration.shortest})},t.checked&&{transform:"scale(1)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.shortest})}));function J6(e){const{checked:t=!1,classes:n={},fontSize:r}=e,o=w({},e,{checked:t});return d.jsxs(dO,{className:n.root,ownerState:o,children:[d.jsx(fO,{fontSize:r,className:n.background,ownerState:o}),d.jsx(pO,{fontSize:r,className:n.dot,ownerState:o})]})}const hO=b.createContext(void 0),Q6=hO;function mO(){return b.useContext(Q6)}function gO(e){return De("MuiRadio",e)}const Gy=Ee("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),yO=["checked","checkedIcon","color","icon","name","onChange","size","className"],vO=e=>{const{classes:t,color:n,size:r}=e,o={root:["root",`color${te(n)}`,r!=="medium"&&`size${te(r)}`]};return w({},t,_e(o,gO,t))},xO=H(I6,{shouldForwardProp:e=>rn(e)||e==="classes",name:"MuiRadio",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size!=="medium"&&t[`size${te(n.size)}`],t[`color${te(n.color)}`]]}})(({theme:e,ownerState:t})=>w({color:(e.vars||e).palette.text.secondary},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${t.color==="default"?e.vars.palette.action.activeChannel:e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Ne(t.color==="default"?e.palette.action.active:e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},t.color!=="default"&&{[`&.${Gy.checked}`]:{color:(e.vars||e).palette[t.color].main}},{[`&.${Gy.disabled}`]:{color:(e.vars||e).palette.action.disabled}}));function CO(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}const Ky=d.jsx(J6,{checked:!0}),Zy=d.jsx(J6,{}),bO=b.forwardRef(function(t,n){var r,o;const i=Te({props:t,name:"MuiRadio"}),{checked:s,checkedIcon:a=Ky,color:l="primary",icon:c=Zy,name:u,onChange:f,size:p="medium",className:x}=i,y=Q(i,yO),g=w({},i,{color:l,size:p}),k=vO(g),h=mO();let m=s;const v=g1(f,h&&h.onChange);let C=u;return h&&(typeof m>"u"&&(m=CO(h.value,i.value)),typeof C>"u"&&(C=h.name)),d.jsx(xO,w({type:"radio",icon:b.cloneElement(c,{fontSize:(r=Zy.props.fontSize)!=null?r:p}),checkedIcon:b.cloneElement(a,{fontSize:(o=Ky.props.fontSize)!=null?o:p}),ownerState:g,classes:k,name:C,checked:m,onChange:v,ref:n,className:le(k.root,x)},y))}),Rf=bO,wO=["actions","children","defaultValue","name","onChange","value"],SO=b.forwardRef(function(t,n){const{actions:r,children:o,defaultValue:i,name:s,onChange:a,value:l}=t,c=Q(t,wO),u=b.useRef(null),[f,p]=bn({controlled:l,default:i,name:"RadioGroup"});b.useImperativeHandle(r,()=>({focus:()=>{let k=u.current.querySelector("input:not(:disabled):checked");k||(k=u.current.querySelector("input:not(:disabled)")),k&&k.focus()}}),[]);const x=tt(n,u),y=ho(s),g=b.useMemo(()=>({name:y,onChange(k){p(k.target.value),a&&a(k,k.target.value)},value:f}),[y,a,p,f]);return d.jsx(Q6.Provider,{value:g,children:d.jsx(L6,w({role:"radiogroup",ref:x},c,{children:o}))})}),_f=SO,kO=Gt(d.jsx("path",{d:"M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"}),"Star"),PO=Gt(d.jsx("path",{d:"M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"}),"StarBorder");function EO(e){return De("MuiRating",e)}const MO=Ee("MuiRating",["root","sizeSmall","sizeMedium","sizeLarge","readOnly","disabled","focusVisible","visuallyHidden","pristine","label","labelEmptyValueActive","icon","iconEmpty","iconFilled","iconHover","iconFocus","iconActive","decimal"]),ba=MO,TO=["value"],RO=["className","defaultValue","disabled","emptyIcon","emptyLabelText","getLabelText","highlightSelectedOnly","icon","IconContainerComponent","max","name","onChange","onChangeActive","onMouseLeave","onMouseMove","precision","readOnly","size","value"];function _O(e){const t=e.toString().split(".")[1];return t?t.length:0}function Zp(e,t){if(e==null)return e;const n=Math.round(e/t)*t;return Number(n.toFixed(_O(t)))}const DO=e=>{const{classes:t,size:n,readOnly:r,disabled:o,emptyValueFocused:i,focusVisible:s}=e,a={root:["root",`size${te(n)}`,o&&"disabled",s&&"focusVisible",r&&"readOnly"],label:["label","pristine"],labelEmptyValue:[i&&"labelEmptyValueActive"],icon:["icon"],iconEmpty:["iconEmpty"],iconFilled:["iconFilled"],iconHover:["iconHover"],iconFocus:["iconFocus"],iconActive:["iconActive"],decimal:["decimal"],visuallyHidden:["visuallyHidden"]};return _e(a,EO,t)},OO=H("span",{name:"MuiRating",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${ba.visuallyHidden}`]:t.visuallyHidden},t.root,t[`size${te(n.size)}`],n.readOnly&&t.readOnly]}})(({theme:e,ownerState:t})=>w({display:"inline-flex",position:"relative",fontSize:e.typography.pxToRem(24),color:"#faaf00",cursor:"pointer",textAlign:"left",WebkitTapHighlightColor:"transparent",[`&.${ba.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${ba.focusVisible} .${ba.iconActive}`]:{outline:"1px solid #999"},[`& .${ba.visuallyHidden}`]:q3},t.size==="small"&&{fontSize:e.typography.pxToRem(18)},t.size==="large"&&{fontSize:e.typography.pxToRem(30)},t.readOnly&&{pointerEvents:"none"})),ex=H("label",{name:"MuiRating",slot:"Label",overridesResolver:({ownerState:e},t)=>[t.label,e.emptyValueFocused&&t.labelEmptyValueActive]})(({ownerState:e})=>w({cursor:"inherit"},e.emptyValueFocused&&{top:0,bottom:0,position:"absolute",outline:"1px solid #999",width:"100%"})),IO=H("span",{name:"MuiRating",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.iconEmpty&&t.iconEmpty,n.iconFilled&&t.iconFilled,n.iconHover&&t.iconHover,n.iconFocus&&t.iconFocus,n.iconActive&&t.iconActive]}})(({theme:e,ownerState:t})=>w({display:"flex",transition:e.transitions.create("transform",{duration:e.transitions.duration.shortest}),pointerEvents:"none"},t.iconActive&&{transform:"scale(1.2)"},t.iconEmpty&&{color:(e.vars||e).palette.action.disabled})),$O=H("span",{name:"MuiRating",slot:"Decimal",shouldForwardProp:e=>uf(e)&&e!=="iconActive",overridesResolver:(e,t)=>{const{iconActive:n}=e;return[t.decimal,n&&t.iconActive]}})(({iconActive:e})=>w({position:"relative"},e&&{transform:"scale(1.2)"}));function FO(e){const t=Q(e,TO);return d.jsx("span",w({},t))}function qy(e){const{classes:t,disabled:n,emptyIcon:r,focus:o,getLabelText:i,highlightSelectedOnly:s,hover:a,icon:l,IconContainerComponent:c,isActive:u,itemValue:f,labelProps:p,name:x,onBlur:y,onChange:g,onClick:k,onFocus:h,readOnly:m,ownerState:v,ratingValue:C,ratingValueRounded:S}=e,E=s?f===C:f<=C,P=f<=a,M=f<=o,T=f===S,R=ho(),O=d.jsx(IO,{as:c,value:f,className:le(t.icon,E?t.iconFilled:t.iconEmpty,P&&t.iconHover,M&&t.iconFocus,u&&t.iconActive),ownerState:w({},v,{iconEmpty:!E,iconFilled:E,iconHover:P,iconFocus:M,iconActive:u}),children:r&&!E?r:l});return m?d.jsx("span",w({},p,{children:O})):d.jsxs(b.Fragment,{children:[d.jsxs(ex,w({ownerState:w({},v,{emptyValueFocused:void 0}),htmlFor:R},p,{children:[O,d.jsx("span",{className:t.visuallyHidden,children:i(f)})]})),d.jsx("input",{className:t.visuallyHidden,onFocus:h,onBlur:y,onChange:g,onClick:k,disabled:n,value:f,id:R,type:"radio",name:x,checked:T})]})}const AO=d.jsx(kO,{fontSize:"inherit"}),LO=d.jsx(PO,{fontSize:"inherit"});function jO(e){return`${e} Star${e!==1?"s":""}`}const NO=b.forwardRef(function(t,n){const r=Te({name:"MuiRating",props:t}),{className:o,defaultValue:i=null,disabled:s=!1,emptyIcon:a=LO,emptyLabelText:l="Empty",getLabelText:c=jO,highlightSelectedOnly:u=!1,icon:f=AO,IconContainerComponent:p=FO,max:x=5,name:y,onChange:g,onChangeActive:k,onMouseLeave:h,onMouseMove:m,precision:v=1,readOnly:C=!1,size:S="medium",value:E}=r,P=Q(r,RO),M=ho(y),[T,R]=bn({controlled:E,default:i,name:"Rating"}),O=Zp(T,v),A=Le(),[{hover:$,focus:_},D]=b.useState({hover:-1,focus:-1});let L=O;$!==-1&&(L=$),_!==-1&&(L=_);const{isFocusVisibleRef:V,onBlur:I,onFocus:F,ref:z}=Jd(),[ae,re]=b.useState(!1),de=b.useRef(),W=tt(z,de,n),ne=K=>{m&&m(K);const xe=de.current,{right:Ie,left:se,width:fe}=xe.getBoundingClientRect();let B;A.direction==="rtl"?B=(Ie-K.clientX)/fe:B=(K.clientX-se)/fe;let q=Zp(x*B+v/2,v);q=ai(q,v,x),D(we=>we.hover===q&&we.focus===q?we:{hover:q,focus:q}),re(!1),k&&$!==q&&k(K,q)},pe=K=>{h&&h(K);const xe=-1;D({hover:xe,focus:xe}),k&&$!==xe&&k(K,xe)},Y=K=>{let xe=K.target.value===""?null:parseFloat(K.target.value);$!==-1&&(xe=$),R(xe),g&&g(K,xe)},me=K=>{K.clientX===0&&K.clientY===0||(D({hover:-1,focus:-1}),R(null),g&&parseFloat(K.target.value)===O&&g(K,null))},Se=K=>{F(K),V.current===!0&&re(!0);const xe=parseFloat(K.target.value);D(Ie=>({hover:Ie.hover,focus:xe}))},Pe=K=>{if($!==-1)return;I(K),V.current===!1&&re(!1);const xe=-1;D(Ie=>({hover:Ie.hover,focus:xe}))},[ee,J]=b.useState(!1),j=w({},r,{defaultValue:i,disabled:s,emptyIcon:a,emptyLabelText:l,emptyValueFocused:ee,focusVisible:ae,getLabelText:c,icon:f,IconContainerComponent:p,max:x,precision:v,readOnly:C,size:S}),U=DO(j);return d.jsxs(OO,w({ref:W,onMouseMove:ne,onMouseLeave:pe,className:le(U.root,o,C&&"MuiRating-readOnly"),ownerState:j,role:C?"img":null,"aria-label":C?c(L):null},P,{children:[Array.from(new Array(x)).map((K,xe)=>{const Ie=xe+1,se={classes:U,disabled:s,emptyIcon:a,focus:_,getLabelText:c,highlightSelectedOnly:u,hover:$,icon:f,IconContainerComponent:p,name:M,onBlur:Pe,onChange:Y,onClick:me,onFocus:Se,ratingValue:L,ratingValueRounded:O,readOnly:C,ownerState:j},fe=Ie===Math.ceil(L)&&($!==-1||_!==-1);if(v<1){const B=Array.from(new Array(1/v));return d.jsx($O,{className:le(U.decimal,fe&&U.iconActive),ownerState:j,iconActive:fe,children:B.map((q,we)=>{const $e=Zp(Ie-1+(we+1)*v,v);return d.jsx(qy,w({},se,{isActive:!1,itemValue:$e,labelProps:{style:B.length-1===we?{}:{width:$e===L?`${(we+1)*v*100}%`:"0%",overflow:"hidden",position:"absolute"}}}),$e)})},Ie)}return d.jsx(qy,w({},se,{isActive:fe,itemValue:Ie}),Ie)}),!C&&!s&&d.jsxs(ex,{className:le(U.label,U.labelEmptyValue),ownerState:j,children:[d.jsx("input",{className:U.visuallyHidden,value:"",id:`${M}-empty`,type:"radio",name:M,checked:O==null,onFocus:()=>J(!0),onBlur:()=>J(!1),onChange:Y}),d.jsx("span",{className:U.visuallyHidden,children:l})]})]}))}),VO=NO;function zO(e){return De("MuiSelect",e)}const wa=Ee("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var Xy;const BO=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],WO=H("div",{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`&.${wa.select}`]:t.select},{[`&.${wa.select}`]:t[n.variant]},{[`&.${wa.error}`]:t.error},{[`&.${wa.multiple}`]:t.multiple}]}})(K6,{[`&.${wa.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),HO=H("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${te(n.variant)}`],n.open&&t.iconOpen]}})(Z6),UO=H("input",{shouldForwardProp:e=>uf(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(e,t)=>t.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function Jy(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}function YO(e){return e==null||typeof e=="string"&&!e.trim()}const GO=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:i,error:s}=e,a={select:["select",n,r&&"disabled",o&&"multiple",s&&"error"],icon:["icon",`icon${te(n)}`,i&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return _e(a,zO,t)},KO=b.forwardRef(function(t,n){var r;const{"aria-describedby":o,"aria-label":i,autoFocus:s,autoWidth:a,children:l,className:c,defaultOpen:u,defaultValue:f,disabled:p,displayEmpty:x,error:y=!1,IconComponent:g,inputRef:k,labelId:h,MenuProps:m={},multiple:v,name:C,onBlur:S,onChange:E,onClose:P,onFocus:M,onOpen:T,open:R,readOnly:O,renderValue:A,SelectDisplayProps:$={},tabIndex:_,value:D,variant:L="standard"}=t,V=Q(t,BO),[I,F]=bn({controlled:D,default:f,name:"Select"}),[z,ae]=bn({controlled:R,default:u,name:"Select"}),re=b.useRef(null),de=b.useRef(null),[W,ne]=b.useState(null),{current:pe}=b.useRef(R!=null),[Y,me]=b.useState(),Se=tt(n,k),Pe=b.useCallback(ue=>{de.current=ue,ue&&ne(ue)},[]),ee=W==null?void 0:W.parentNode;b.useImperativeHandle(Se,()=>({focus:()=>{de.current.focus()},node:re.current,value:I}),[I]),b.useEffect(()=>{u&&z&&W&&!pe&&(me(a?null:ee.clientWidth),de.current.focus())},[W,a]),b.useEffect(()=>{s&&de.current.focus()},[s]),b.useEffect(()=>{if(!h)return;const ue=Et(de.current).getElementById(h);if(ue){const je=()=>{getSelection().isCollapsed&&de.current.focus()};return ue.addEventListener("click",je),()=>{ue.removeEventListener("click",je)}}},[h]);const J=(ue,je)=>{ue?T&&T(je):P&&P(je),pe||(me(a?null:ee.clientWidth),ae(ue))},j=ue=>{ue.button===0&&(ue.preventDefault(),de.current.focus(),J(!0,ue))},U=ue=>{J(!1,ue)},K=b.Children.toArray(l),xe=ue=>{const je=K.find(dt=>dt.props.value===ue.target.value);je!==void 0&&(F(je.props.value),E&&E(ue,je))},Ie=ue=>je=>{let dt;if(je.currentTarget.hasAttribute("tabindex")){if(v){dt=Array.isArray(I)?I.slice():[];const wt=I.indexOf(ue.props.value);wt===-1?dt.push(ue.props.value):dt.splice(wt,1)}else dt=ue.props.value;if(ue.props.onClick&&ue.props.onClick(je),I!==dt&&(F(dt),E)){const wt=je.nativeEvent||je,vo=new wt.constructor(wt.type,wt);Object.defineProperty(vo,"target",{writable:!0,value:{value:dt,name:C}}),E(vo,ue)}v||J(!1,je)}},se=ue=>{O||[" ","ArrowUp","ArrowDown","Enter"].indexOf(ue.key)!==-1&&(ue.preventDefault(),J(!0,ue))},fe=W!==null&&z,B=ue=>{!fe&&S&&(Object.defineProperty(ue,"target",{writable:!0,value:{value:I,name:C}}),S(ue))};delete V["aria-invalid"];let q,we;const $e=[];let ke=!1;(sd({value:I})||x)&&(A?q=A(I):ke=!0);const Z=K.map(ue=>{if(!b.isValidElement(ue))return null;let je;if(v){if(!Array.isArray(I))throw new Error(Bo(2));je=I.some(dt=>Jy(dt,ue.props.value)),je&&ke&&$e.push(ue.props.children)}else je=Jy(I,ue.props.value),je&&ke&&(we=ue.props.children);return b.cloneElement(ue,{"aria-selected":je?"true":"false",onClick:Ie(ue),onKeyUp:dt=>{dt.key===" "&&dt.preventDefault(),ue.props.onKeyUp&&ue.props.onKeyUp(dt)},role:"option",selected:je,value:void 0,"data-value":ue.props.value})});ke&&(v?$e.length===0?q=null:q=$e.reduce((ue,je,dt)=>(ue.push(je),dt<$e.length-1&&ue.push(", "),ue),[]):q=we);let he=Y;!a&&pe&&W&&(he=ee.clientWidth);let ve;typeof _<"u"?ve=_:ve=p?null:0;const ge=$.id||(C?`mui-component-select-${C}`:void 0),ye=w({},t,{variant:L,value:I,open:fe,error:y}),Ke=GO(ye),Ve=w({},m.PaperProps,(r=m.slotProps)==null?void 0:r.paper),He=ho();return d.jsxs(b.Fragment,{children:[d.jsx(WO,w({ref:Pe,tabIndex:ve,role:"combobox","aria-controls":He,"aria-disabled":p?"true":void 0,"aria-expanded":fe?"true":"false","aria-haspopup":"listbox","aria-label":i,"aria-labelledby":[h,ge].filter(Boolean).join(" ")||void 0,"aria-describedby":o,onKeyDown:se,onMouseDown:p||O?null:j,onBlur:B,onFocus:M},$,{ownerState:ye,className:le($.className,Ke.select,c),id:ge,children:YO(q)?Xy||(Xy=d.jsx("span",{className:"notranslate",children:"​"})):q})),d.jsx(UO,w({"aria-invalid":y,value:Array.isArray(I)?I.join(","):I,name:C,ref:re,"aria-hidden":!0,onChange:xe,tabIndex:-1,disabled:p,className:Ke.nativeInput,autoFocus:s,ownerState:ye},V)),d.jsx(HO,{as:g,className:Ke.icon,ownerState:ye}),d.jsx(LD,w({id:`menu-${C||""}`,anchorEl:ee,open:fe,onClose:U,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"}},m,{MenuListProps:w({"aria-labelledby":h,role:"listbox","aria-multiselectable":v?"true":void 0,disableListWrap:!0,id:He},m.MenuListProps),slotProps:w({},m.slotProps,{paper:w({},Ve,{style:w({minWidth:he},Ve!=null?Ve.style:null)})}),children:Z}))]})}),ZO=KO,qO=["autoWidth","children","classes","className","defaultOpen","displayEmpty","IconComponent","id","input","inputProps","label","labelId","MenuProps","multiple","native","onClose","onOpen","open","renderValue","SelectDisplayProps","variant"],XO=["root"],JO=e=>{const{classes:t}=e;return t},Am={name:"MuiSelect",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>rn(e)&&e!=="variant",slot:"Root"},QO=H(B6,Am)(""),eI=H(X6,Am)(""),tI=H(A6,Am)(""),tx=b.forwardRef(function(t,n){const r=Te({name:"MuiSelect",props:t}),{autoWidth:o=!1,children:i,classes:s={},className:a,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:u=sT,id:f,input:p,inputProps:x,label:y,labelId:g,MenuProps:k,multiple:h=!1,native:m=!1,onClose:v,onOpen:C,open:S,renderValue:E,SelectDisplayProps:P,variant:M="outlined"}=r,T=Q(r,qO),R=m?QD:ZO,O=Lr(),A=Ko({props:r,muiFormControl:O,states:["variant","error"]}),$=A.variant||M,_=w({},r,{variant:$,classes:s}),D=JO(_),L=Q(D,XO),V=p||{standard:d.jsx(QO,{ownerState:_}),outlined:d.jsx(eI,{label:y,ownerState:_}),filled:d.jsx(tI,{ownerState:_})}[$],I=tt(n,V.ref);return d.jsx(b.Fragment,{children:b.cloneElement(V,w({inputComponent:R,inputProps:w({children:i,error:A.error,IconComponent:u,variant:$,type:void 0,multiple:h},m?{id:f}:{autoWidth:o,defaultOpen:l,displayEmpty:c,labelId:g,MenuProps:k,onClose:v,onOpen:C,open:S,renderValue:E,SelectDisplayProps:w({id:f},P)},x,{classes:x?Jt(L,x.classes):L},p?p.props.inputProps:{})},h&&m&&$==="outlined"?{notched:!0}:{},{ref:I,className:le(V.props.className,a,D.root)},!p&&{variant:$},T))})});tx.muiName="Select";const nx=tx;function nI(e){return De("MuiSkeleton",e)}Ee("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);const rI=["animation","className","component","height","style","variant","width"];let ld=e=>e,Qy,ev,tv,nv;const oI=e=>{const{classes:t,variant:n,animation:r,hasChildren:o,width:i,height:s}=e;return _e({root:["root",n,r,o&&"withChildren",o&&!i&&"fitContent",o&&!s&&"heightAuto"]},nI,t)},iI=Gl(Qy||(Qy=ld` + 0% { + opacity: 1; + } + + 50% { + opacity: 0.4; + } + + 100% { + opacity: 1; + } +`)),sI=Gl(ev||(ev=ld` + 0% { + transform: translateX(-100%); + } + + 50% { + /* +0.5s of delay between each loop */ + transform: translateX(100%); + } + + 100% { + transform: translateX(100%); + } +`)),aI=H("span",{name:"MuiSkeleton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],n.animation!==!1&&t[n.animation],n.hasChildren&&t.withChildren,n.hasChildren&&!n.width&&t.fitContent,n.hasChildren&&!n.height&&t.heightAuto]}})(({theme:e,ownerState:t})=>{const n=Fk(e.shape.borderRadius)||"px",r=Ak(e.shape.borderRadius);return w({display:"block",backgroundColor:e.vars?e.vars.palette.Skeleton.bg:Ne(e.palette.text.primary,e.palette.mode==="light"?.11:.13),height:"1.2em"},t.variant==="text"&&{marginTop:0,marginBottom:0,height:"auto",transformOrigin:"0 55%",transform:"scale(1, 0.60)",borderRadius:`${r}${n}/${Math.round(r/.6*10)/10}${n}`,"&:empty:before":{content:'"\\00a0"'}},t.variant==="circular"&&{borderRadius:"50%"},t.variant==="rounded"&&{borderRadius:(e.vars||e).shape.borderRadius},t.hasChildren&&{"& > *":{visibility:"hidden"}},t.hasChildren&&!t.width&&{maxWidth:"fit-content"},t.hasChildren&&!t.height&&{height:"auto"})},({ownerState:e})=>e.animation==="pulse"&&h1(tv||(tv=ld` + animation: ${0} 2s ease-in-out 0.5s infinite; + `),iI),({ownerState:e,theme:t})=>e.animation==="wave"&&h1(nv||(nv=ld` + position: relative; + overflow: hidden; + + /* Fix bug in Safari https://bugs.webkit.org/show_bug.cgi?id=68196 */ + -webkit-mask-image: -webkit-radial-gradient(white, black); + + &::after { + animation: ${0} 2s linear 0.5s infinite; + background: linear-gradient( + 90deg, + transparent, + ${0}, + transparent + ); + content: ''; + position: absolute; + transform: translateX(-100%); /* Avoid flash during server-side hydration */ + bottom: 0; + left: 0; + right: 0; + top: 0; + } + `),sI,(t.vars||t).palette.action.hover)),lI=b.forwardRef(function(t,n){const r=Te({props:t,name:"MuiSkeleton"}),{animation:o="pulse",className:i,component:s="span",height:a,style:l,variant:c="text",width:u}=r,f=Q(r,rI),p=w({},r,{animation:o,component:s,variant:c,hasChildren:!!f.children}),x=oI(p);return d.jsx(aI,w({as:s,ref:n,className:le(x.root,i),ownerState:p},f,{style:w({width:u,height:a},l)}))}),cI=lI,uI=e=>!e||!Or(e);function dI(e){return De("MuiSlider",e)}const cr=Ee("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),fI=e=>{const{open:t}=e;return{offset:le(t&&cr.valueLabelOpen),circle:cr.valueLabelCircle,label:cr.valueLabelLabel}};function pI(e){const{children:t,className:n,value:r}=e,o=fI(e);return t?b.cloneElement(t,{className:le(t.props.className)},d.jsxs(b.Fragment,{children:[t.props.children,d.jsx("span",{className:le(o.offset,n),"aria-hidden":!0,children:d.jsx("span",{className:o.circle,children:d.jsx("span",{className:o.label,children:r})})})]})):null}const hI=["aria-label","aria-valuetext","aria-labelledby","component","components","componentsProps","color","classes","className","disableSwap","disabled","getAriaLabel","getAriaValueText","marks","max","min","name","onChange","onChangeCommitted","orientation","size","step","scale","slotProps","slots","tabIndex","track","value","valueLabelDisplay","valueLabelFormat"];function rv(e){return e}const mI=H("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`color${te(n.color)}`],n.size!=="medium"&&t[`size${te(n.size)}`],n.marked&&t.marked,n.orientation==="vertical"&&t.vertical,n.track==="inverted"&&t.trackInverted,n.track===!1&&t.trackFalse]}})(({theme:e,ownerState:t})=>w({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",color:(e.vars||e).palette[t.color].main,WebkitTapHighlightColor:"transparent"},t.orientation==="horizontal"&&w({height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}},t.size==="small"&&{height:2},t.marked&&{marginBottom:20}),t.orientation==="vertical"&&w({height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}},t.size==="small"&&{width:2},t.marked&&{marginRight:44}),{"@media print":{colorAdjust:"exact"},[`&.${cr.disabled}`]:{pointerEvents:"none",cursor:"default",color:(e.vars||e).palette.grey[400]},[`&.${cr.dragging}`]:{[`& .${cr.thumb}, & .${cr.track}`]:{transition:"none"}}})),gI=H("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(e,t)=>t.rail})(({ownerState:e})=>w({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38},e.orientation==="horizontal"&&{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"},e.orientation==="vertical"&&{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"},e.track==="inverted"&&{opacity:1})),yI=H("span",{name:"MuiSlider",slot:"Track",overridesResolver:(e,t)=>t.track})(({theme:e,ownerState:t})=>{const n=e.palette.mode==="light"?l6(e.palette[t.color].main,.62):a6(e.palette[t.color].main,.5);return w({display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:e.transitions.create(["left","width","bottom","height"],{duration:e.transitions.duration.shortest})},t.size==="small"&&{border:"none"},t.orientation==="horizontal"&&{height:"inherit",top:"50%",transform:"translateY(-50%)"},t.orientation==="vertical"&&{width:"inherit",left:"50%",transform:"translateX(-50%)"},t.track===!1&&{display:"none"},t.track==="inverted"&&{backgroundColor:e.vars?e.vars.palette.Slider[`${t.color}Track`]:n,borderColor:e.vars?e.vars.palette.Slider[`${t.color}Track`]:n})}),vI=H("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.thumb,t[`thumbColor${te(n.color)}`],n.size!=="medium"&&t[`thumbSize${te(n.size)}`]]}})(({theme:e,ownerState:t})=>w({position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:e.transitions.create(["box-shadow","left","bottom"],{duration:e.transitions.duration.shortest})},t.size==="small"&&{width:12,height:12},t.orientation==="horizontal"&&{top:"50%",transform:"translate(-50%, -50%)"},t.orientation==="vertical"&&{left:"50%",transform:"translate(-50%, 50%)"},{"&::before":w({position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(e.vars||e).shadows[2]},t.size==="small"&&{boxShadow:"none"}),"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&:hover, &.${cr.focusVisible}`]:{boxShadow:`0px 0px 0px 8px ${e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.16)`:Ne(e.palette[t.color].main,.16)}`,"@media (hover: none)":{boxShadow:"none"}},[`&.${cr.active}`]:{boxShadow:`0px 0px 0px 14px ${e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.16)`:Ne(e.palette[t.color].main,.16)}`},[`&.${cr.disabled}`]:{"&:hover":{boxShadow:"none"}}})),xI=H(pI,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(e,t)=>t.valueLabel})(({theme:e,ownerState:t})=>w({[`&.${cr.valueLabelOpen}`]:{transform:`${t.orientation==="vertical"?"translateY(-50%)":"translateY(-100%)"} scale(1)`},zIndex:1,whiteSpace:"nowrap"},e.typography.body2,{fontWeight:500,transition:e.transitions.create(["transform"],{duration:e.transitions.duration.shortest}),transform:`${t.orientation==="vertical"?"translateY(-50%)":"translateY(-100%)"} scale(0)`,position:"absolute",backgroundColor:(e.vars||e).palette.grey[600],borderRadius:2,color:(e.vars||e).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem"},t.orientation==="horizontal"&&{top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"}},t.orientation==="vertical"&&{right:t.size==="small"?"20px":"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"}},t.size==="small"&&{fontSize:e.typography.pxToRem(12),padding:"0.25rem 0.5rem"})),CI=H("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>uf(e)&&e!=="markActive",overridesResolver:(e,t)=>{const{markActive:n}=e;return[t.mark,n&&t.markActive]}})(({theme:e,ownerState:t,markActive:n})=>w({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor"},t.orientation==="horizontal"&&{top:"50%",transform:"translate(-1px, -50%)"},t.orientation==="vertical"&&{left:"50%",transform:"translate(-50%, 1px)"},n&&{backgroundColor:(e.vars||e).palette.background.paper,opacity:.8})),bI=H("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>uf(e)&&e!=="markLabelActive",overridesResolver:(e,t)=>t.markLabel})(({theme:e,ownerState:t,markLabelActive:n})=>w({},e.typography.body2,{color:(e.vars||e).palette.text.secondary,position:"absolute",whiteSpace:"nowrap"},t.orientation==="horizontal"&&{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}},t.orientation==="vertical"&&{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}},n&&{color:(e.vars||e).palette.text.primary})),wI=e=>{const{disabled:t,dragging:n,marked:r,orientation:o,track:i,classes:s,color:a,size:l}=e,c={root:["root",t&&"disabled",n&&"dragging",r&&"marked",o==="vertical"&&"vertical",i==="inverted"&&"trackInverted",i===!1&&"trackFalse",a&&`color${te(a)}`,l&&`size${te(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",l&&`thumbSize${te(l)}`,a&&`thumbColor${te(a)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return _e(c,dI,s)},SI=({children:e})=>e,kI=b.forwardRef(function(t,n){var r,o,i,s,a,l,c,u,f,p,x,y,g,k,h,m,v,C,S,E,P,M,T,R;const O=Te({props:t,name:"MuiSlider"}),$=Le().direction==="rtl",{"aria-label":_,"aria-valuetext":D,"aria-labelledby":L,component:V="span",components:I={},componentsProps:F={},color:z="primary",classes:ae,className:re,disableSwap:de=!1,disabled:W=!1,getAriaLabel:ne,getAriaValueText:pe,marks:Y=!1,max:me=100,min:Se=0,orientation:Pe="horizontal",size:ee="medium",step:J=1,scale:j=rv,slotProps:U,slots:K,track:xe="normal",valueLabelDisplay:Ie="off",valueLabelFormat:se=rv}=O,fe=Q(O,hI),B=w({},O,{isRtl:$,max:me,min:Se,classes:ae,disabled:W,disableSwap:de,orientation:Pe,marks:Y,color:z,size:ee,step:J,scale:j,track:xe,valueLabelDisplay:Ie,valueLabelFormat:se}),{axisProps:q,getRootProps:we,getHiddenInputProps:$e,getThumbProps:ke,open:Z,active:he,axis:ve,focusedThumbIndex:ge,range:ye,dragging:Ke,marks:Ve,values:He,trackOffset:ue,trackLeap:je,getThumbStyle:dt}=RM(w({},B,{rootRef:n}));B.marked=Ve.length>0&&Ve.some(Dt=>Dt.label),B.dragging=Ke,B.focusedThumbIndex=ge;const wt=wI(B),vo=(r=(o=K==null?void 0:K.root)!=null?o:I.Root)!=null?r:mI,Li=(i=(s=K==null?void 0:K.rail)!=null?s:I.Rail)!=null?i:gI,ia=(a=(l=K==null?void 0:K.track)!=null?l:I.Track)!=null?a:yI,ji=(c=(u=K==null?void 0:K.thumb)!=null?u:I.Thumb)!=null?c:vI,Ni=(f=(p=K==null?void 0:K.valueLabel)!=null?p:I.ValueLabel)!=null?f:xI,qo=(x=(y=K==null?void 0:K.mark)!=null?y:I.Mark)!=null?x:CI,sa=(g=(k=K==null?void 0:K.markLabel)!=null?k:I.MarkLabel)!=null?g:bI,at=(h=(m=K==null?void 0:K.input)!=null?m:I.Input)!=null?h:"input",dn=(v=U==null?void 0:U.root)!=null?v:F.root,Xo=(C=U==null?void 0:U.rail)!=null?C:F.rail,Ln=(S=U==null?void 0:U.track)!=null?S:F.track,ap=(E=U==null?void 0:U.thumb)!=null?E:F.thumb,lp=(P=U==null?void 0:U.valueLabel)!=null?P:F.valueLabel,T4=(M=U==null?void 0:U.mark)!=null?M:F.mark,R4=(T=U==null?void 0:U.markLabel)!=null?T:F.markLabel,_4=(R=U==null?void 0:U.input)!=null?R:F.input,D4=We({elementType:vo,getSlotProps:we,externalSlotProps:dn,externalForwardedProps:fe,additionalProps:w({},uI(vo)&&{as:V}),ownerState:w({},B,dn==null?void 0:dn.ownerState),className:[wt.root,re]}),O4=We({elementType:Li,externalSlotProps:Xo,ownerState:B,className:wt.rail}),I4=We({elementType:ia,externalSlotProps:Ln,additionalProps:{style:w({},q[ve].offset(ue),q[ve].leap(je))},ownerState:w({},B,Ln==null?void 0:Ln.ownerState),className:wt.track}),cp=We({elementType:ji,getSlotProps:ke,externalSlotProps:ap,ownerState:w({},B,ap==null?void 0:ap.ownerState),className:wt.thumb}),$4=We({elementType:Ni,externalSlotProps:lp,ownerState:w({},B,lp==null?void 0:lp.ownerState),className:wt.valueLabel}),up=We({elementType:qo,externalSlotProps:T4,ownerState:B,className:wt.mark}),dp=We({elementType:sa,externalSlotProps:R4,ownerState:B,className:wt.markLabel}),F4=We({elementType:at,getSlotProps:$e,externalSlotProps:_4,ownerState:B});return d.jsxs(vo,w({},D4,{children:[d.jsx(Li,w({},O4)),d.jsx(ia,w({},I4)),Ve.filter(Dt=>Dt.value>=Se&&Dt.value<=me).map((Dt,Bt)=>{const fp=id(Dt.value,Se,me),dc=q[ve].offset(fp);let zr;return xe===!1?zr=He.indexOf(Dt.value)!==-1:zr=xe==="normal"&&(ye?Dt.value>=He[0]&&Dt.value<=He[He.length-1]:Dt.value<=He[0])||xe==="inverted"&&(ye?Dt.value<=He[0]||Dt.value>=He[He.length-1]:Dt.value>=He[0]),d.jsxs(b.Fragment,{children:[d.jsx(qo,w({"data-index":Bt},up,!Or(qo)&&{markActive:zr},{style:w({},dc,up.style),className:le(up.className,zr&&wt.markActive)})),Dt.label!=null?d.jsx(sa,w({"aria-hidden":!0,"data-index":Bt},dp,!Or(sa)&&{markLabelActive:zr},{style:w({},dc,dp.style),className:le(wt.markLabel,dp.className,zr&&wt.markLabelActive),children:Dt.label})):null]},Bt)}),He.map((Dt,Bt)=>{const fp=id(Dt,Se,me),dc=q[ve].offset(fp),zr=Ie==="off"?SI:Ni;return d.jsx(zr,w({},!Or(zr)&&{valueLabelFormat:se,valueLabelDisplay:Ie,value:typeof se=="function"?se(j(Dt),Bt):se,index:Bt,open:Z===Bt||he===Bt||Ie==="on",disabled:W},$4,{children:d.jsx(ji,w({"data-index":Bt},cp,{className:le(wt.thumb,cp.className,he===Bt&&wt.active,ge===Bt&&wt.focusVisible),style:w({},dc,dt(Bt),cp.style),children:d.jsx(at,w({"data-index":Bt,"aria-label":ne?ne(Bt):_,"aria-valuenow":j(Dt),"aria-labelledby":L,"aria-valuetext":pe?pe(j(Dt),Bt):D,value:He[Bt]},F4))}))}),Bt)})]}))}),PI=kI;function EI(e){return De("MuiTextField",e)}Ee("MuiTextField",["root"]);const MI=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],TI={standard:B6,filled:A6,outlined:X6},RI=e=>{const{classes:t}=e;return _e({root:["root"]},EI,t)},_I=H(Tf,{name:"MuiTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({}),DI=b.forwardRef(function(t,n){const r=Te({props:t,name:"MuiTextField"}),{autoComplete:o,autoFocus:i=!1,children:s,className:a,color:l="primary",defaultValue:c,disabled:u=!1,error:f=!1,FormHelperTextProps:p,fullWidth:x=!1,helperText:y,id:g,InputLabelProps:k,inputProps:h,InputProps:m,inputRef:v,label:C,maxRows:S,minRows:E,multiline:P=!1,name:M,onBlur:T,onChange:R,onFocus:O,placeholder:A,required:$=!1,rows:_,select:D=!1,SelectProps:L,type:V,value:I,variant:F="outlined"}=r,z=Q(r,MI),ae=w({},r,{autoFocus:i,color:l,disabled:u,error:f,fullWidth:x,multiline:P,required:$,select:D,variant:F}),re=RI(ae),de={};F==="outlined"&&(k&&typeof k.shrink<"u"&&(de.notched=k.shrink),de.label=C),D&&((!L||!L.native)&&(de.id=void 0),de["aria-describedby"]=void 0);const W=ho(g),ne=y&&W?`${W}-helper-text`:void 0,pe=C&&W?`${W}-label`:void 0,Y=TI[F],me=d.jsx(Y,w({"aria-describedby":ne,autoComplete:o,autoFocus:i,defaultValue:c,fullWidth:x,multiline:P,name:M,rows:_,maxRows:S,minRows:E,type:V,value:I,id:W,inputRef:v,onBlur:T,onChange:R,onFocus:O,placeholder:A,inputProps:h},de,m));return d.jsxs(_I,w({className:le(re.root,a),disabled:u,error:f,fullWidth:x,ref:n,required:$,color:l,variant:F,ownerState:ae},z,{children:[C!=null&&C!==""&&d.jsx(F_,w({htmlFor:W,id:pe},k,{children:C})),D?d.jsx(nx,w({"aria-describedby":ne,id:W,labelId:pe,value:I,input:me},L,{children:s})):me,y&&d.jsx(s_,w({id:ne},p,{children:y}))]}))}),Df=DI,OI=["localeText"],M1=b.createContext(null),Lm=function(t){var n;const{localeText:r}=t,o=Q(t,OI),{utils:i,localeText:s}=(n=b.useContext(M1))!=null?n:{utils:void 0,localeText:void 0},a=Te({props:o,name:"MuiLocalizationProvider"}),{children:l,dateAdapter:c,dateFormats:u,dateLibInstance:f,adapterLocale:p,localeText:x}=a,y=b.useMemo(()=>w({},x,s,r),[x,s,r]),g=b.useMemo(()=>{if(!c)return i||null;const m=new c({locale:p,formats:u,instance:f});if(!m.isMUIAdapter)throw new Error(["MUI: The date adapter should be imported from `@mui/x-date-pickers` or `@mui/x-date-pickers-pro`, not from `@date-io`","For example, `import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'` instead of `import AdapterDayjs from '@date-io/dayjs'`","More information on the installation documentation: https://mui.com/x/react-date-pickers/getting-started/#installation"].join(` +`));return m},[c,p,u,f,i]),k=b.useMemo(()=>g?{minDate:g.date("1900-01-01T00:00:00.000"),maxDate:g.date("2099-12-31T00:00:00.000")}:null,[g]),h=b.useMemo(()=>({utils:g,defaultDates:k,localeText:y}),[k,g,y]);return d.jsx(M1.Provider,{value:h,children:l})},rx=e=>({components:{MuiLocalizationProvider:{defaultProps:{localeText:w({},e)}}}}),ox={previousMonth:"Previous month",nextMonth:"Next month",openPreviousView:"open previous view",openNextView:"open next view",calendarViewSwitchingButtonAriaLabel:e=>e==="year"?"year view is open, switch to calendar view":"calendar view is open, switch to year view",start:"Start",end:"End",cancelButtonLabel:"Cancel",clearButtonLabel:"Clear",okButtonLabel:"OK",todayButtonLabel:"Today",datePickerToolbarTitle:"Select date",dateTimePickerToolbarTitle:"Select date & time",timePickerToolbarTitle:"Select time",dateRangePickerToolbarTitle:"Select date range",clockLabelText:(e,t,n)=>`Select ${e}. ${t===null?"No time selected":`Selected time is ${n.format(t,"fullTime")}`}`,hoursClockNumberText:e=>`${e} hours`,minutesClockNumberText:e=>`${e} minutes`,secondsClockNumberText:e=>`${e} seconds`,selectViewText:e=>`Select ${e}`,calendarWeekNumberHeaderLabel:"Week number",calendarWeekNumberHeaderText:"#",calendarWeekNumberAriaLabelText:e=>`Week ${e}`,calendarWeekNumberText:e=>`${e}`,openDatePickerDialogue:(e,t)=>e!==null&&t.isValid(e)?`Choose date, selected date is ${t.format(e,"fullDate")}`:"Choose date",openTimePickerDialogue:(e,t)=>e!==null&&t.isValid(e)?`Choose time, selected time is ${t.format(e,"fullTime")}`:"Choose time",fieldClearLabel:"Clear value",timeTableLabel:"pick time",dateTableLabel:"pick date",fieldYearPlaceholder:e=>"Y".repeat(e.digitAmount),fieldMonthPlaceholder:e=>e.contentType==="letter"?"MMMM":"MM",fieldDayPlaceholder:()=>"DD",fieldWeekDayPlaceholder:e=>e.contentType==="letter"?"EEEE":"EE",fieldHoursPlaceholder:()=>"hh",fieldMinutesPlaceholder:()=>"mm",fieldSecondsPlaceholder:()=>"ss",fieldMeridiemPlaceholder:()=>"aa"},II=ox;rx(ox);const $i=()=>{const e=b.useContext(M1);if(e===null)throw new Error(["MUI: Can not find the date and time pickers localization context.","It looks like you forgot to wrap your component in LocalizationProvider.","This can also happen if you are bundling multiple versions of the `@mui/x-date-pickers` package"].join(` +`));if(e.utils===null)throw new Error(["MUI: Can not find the date and time pickers adapter from its localization context.","It looks like you forgot to pass a `dateAdapter` to your LocalizationProvider."].join(` +`));const t=b.useMemo(()=>w({},II,e.localeText),[e.localeText]);return b.useMemo(()=>w({},e,{localeText:t}),[e,t])},ut=()=>$i().utils,ec=()=>$i().defaultDates,Zo=()=>$i().localeText,tc=e=>{const t=ut(),n=b.useRef();return n.current===void 0&&(n.current=t.dateWithTimezone(void 0,e)),n.current},$I=Gt(d.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),FI=Gt(d.jsx("path",{d:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"}),"ArrowLeft"),AI=Gt(d.jsx("path",{d:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"}),"ArrowRight"),LI=Gt(d.jsx("path",{d:"M17 12h-5v5h5v-5zM16 1v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2h-1V1h-2zm3 18H5V8h14v11z"}),"Calendar");Gt(d.jsxs(b.Fragment,{children:[d.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),d.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Clock");Gt(d.jsx("path",{d:"M9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2zm2-7h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z"}),"DateRange");Gt(d.jsxs(b.Fragment,{children:[d.jsx("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),d.jsx("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"})]}),"Time");const jI=Gt(d.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear");function NI(e){return De("MuiPickersArrowSwitcher",e)}Ee("MuiPickersArrowSwitcher",["root","spacer","button"]);const VI=["children","className","slots","slotProps","isNextDisabled","isNextHidden","onGoToNext","nextLabel","isPreviousDisabled","isPreviousHidden","onGoToPrevious","previousLabel"],zI=["ownerState"],BI=["ownerState"],WI=H("div",{name:"MuiPickersArrowSwitcher",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex"}),HI=H("div",{name:"MuiPickersArrowSwitcher",slot:"Spacer",overridesResolver:(e,t)=>t.spacer})(({theme:e})=>({width:e.spacing(3)})),ov=H(Qs,{name:"MuiPickersArrowSwitcher",slot:"Button",overridesResolver:(e,t)=>t.button})(({ownerState:e})=>w({},e.hidden&&{visibility:"hidden"})),UI=e=>{const{classes:t}=e;return _e({root:["root"],spacer:["spacer"],button:["button"]},NI,t)},YI=b.forwardRef(function(t,n){var r,o,i,s;const l=Le().direction==="rtl",c=Te({props:t,name:"MuiPickersArrowSwitcher"}),{children:u,className:f,slots:p,slotProps:x,isNextDisabled:y,isNextHidden:g,onGoToNext:k,nextLabel:h,isPreviousDisabled:m,isPreviousHidden:v,onGoToPrevious:C,previousLabel:S}=c,E=Q(c,VI),P=c,M=UI(P),T={isDisabled:y,isHidden:g,goTo:k,label:h},R={isDisabled:m,isHidden:v,goTo:C,label:S},O=(r=p==null?void 0:p.previousIconButton)!=null?r:ov,A=We({elementType:O,externalSlotProps:x==null?void 0:x.previousIconButton,additionalProps:{size:"medium",title:R.label,"aria-label":R.label,disabled:R.isDisabled,edge:"end",onClick:R.goTo},ownerState:w({},P,{hidden:R.isHidden}),className:M.button}),$=(o=p==null?void 0:p.nextIconButton)!=null?o:ov,_=We({elementType:$,externalSlotProps:x==null?void 0:x.nextIconButton,additionalProps:{size:"medium",title:T.label,"aria-label":T.label,disabled:T.isDisabled,edge:"start",onClick:T.goTo},ownerState:w({},P,{hidden:T.isHidden}),className:M.button}),D=(i=p==null?void 0:p.leftArrowIcon)!=null?i:FI,L=We({elementType:D,externalSlotProps:x==null?void 0:x.leftArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:void 0}),V=Q(L,zI),I=(s=p==null?void 0:p.rightArrowIcon)!=null?s:AI,F=We({elementType:I,externalSlotProps:x==null?void 0:x.rightArrowIcon,additionalProps:{fontSize:"inherit"},ownerState:void 0}),z=Q(F,BI);return d.jsxs(WI,w({ref:n,className:le(M.root,f),ownerState:P},E,{children:[d.jsx(O,w({},A,{children:l?d.jsx(I,w({},z)):d.jsx(D,w({},V))})),u?d.jsx(Re,{variant:"subtitle1",component:"span",children:u}):d.jsx(HI,{className:M.spacer,ownerState:P}),d.jsx($,w({},_,{children:l?d.jsx(D,w({},V)):d.jsx(I,w({},z))}))]}))}),Sa=(e,t)=>e.length!==t.length?!1:t.every(n=>e.includes(n)),GI=({openTo:e,defaultOpenTo:t,views:n,defaultViews:r})=>{const o=n??r;let i;if(e!=null)i=e;else if(o.includes(t))i=t;else if(o.length>0)i=o[0];else throw new Error("MUI: The `views` prop must contain at least one view");return{views:o,openTo:i}},KI=["hours","minutes","seconds"],ZI=e=>KI.includes(e),iv=(e,t)=>t.getHours(e)*3600+t.getMinutes(e)*60+t.getSeconds(e),qI=(e,t)=>(n,r)=>e?t.isAfter(n,r):iv(n,t)>iv(r,t);function ix({onChange:e,onViewChange:t,openTo:n,view:r,views:o,autoFocus:i,focusedView:s,onFocusedViewChange:a}){var l,c;const u=b.useRef(n),f=b.useRef(o),p=b.useRef(o.includes(n)?n:o[0]),[x,y]=bn({name:"useViews",state:"view",controlled:r,default:p.current}),g=b.useRef(i?x:null),[k,h]=bn({name:"useViews",state:"focusedView",controlled:s,default:g.current});b.useEffect(()=>{(u.current&&u.current!==n||f.current&&f.current.some(T=>!o.includes(T)))&&(y(o.includes(n)?n:o[0]),f.current=o,u.current=n)},[n,y,x,o]);const m=o.indexOf(x),v=(l=o[m-1])!=null?l:null,C=(c=o[m+1])!=null?c:null,S=Me((T,R)=>{h(R?T:O=>T===O?null:O),a==null||a(T,R)}),E=Me(T=>{S(T,!0),T!==x&&(y(T),t&&t(T))}),P=Me(()=>{C&&E(C)}),M=Me((T,R,O)=>{const A=R==="finish",$=O?o.indexOf(O){const i=o.dateWithTimezone(void 0,r),s=o.startOfMonth(t&&o.isBefore(i,n)?i:n);return!o.isAfter(s,e)},[t,n,e,o,r])}function JI(e,{disablePast:t,minDate:n,timezone:r}){const o=ut();return b.useMemo(()=>{const i=o.dateWithTimezone(void 0,r),s=o.startOfMonth(t&&o.isAfter(i,n)?i:n);return!o.isBefore(s,e)},[t,n,e,o,r])}const Rl=36,Of=2,If=320,QI=280,jm=334,e$=H("div")({overflow:"hidden",width:If,maxHeight:jm,display:"flex",flexDirection:"column",margin:"0 auto"}),rl=({date:e,disableFuture:t,disablePast:n,maxDate:r,minDate:o,isDateDisabled:i,utils:s,timezone:a})=>{const l=s.startOfDay(s.dateWithTimezone(void 0,a));n&&s.isBefore(o,l)&&(o=l),t&&s.isAfter(r,l)&&(r=l);let c=e,u=e;for(s.isBefore(e,o)&&(c=o,u=null),s.isAfter(e,r)&&(u&&(u=r),c=null);c||u;){if(c&&s.isAfter(c,r)&&(c=null),u&&s.isBefore(u,o)&&(u=null),c){if(!i(c))return c;c=s.addDays(c,1)}if(u){if(!i(u))return u;u=s.addDays(u,-1)}}return null},t$=(e,t)=>t==null||!e.isValid(t)?null:t,Qn=(e,t,n)=>t==null||!e.isValid(t)?n:t,n$=(e,t,n)=>!e.isValid(t)&&t!=null&&!e.isValid(n)&&n!=null?!0:e.isEqual(t,n),Nm=(e,t)=>{const r=[e.startOfYear(t)];for(;r.length<12;){const o=r[r.length-1];r.push(e.addMonths(o,1))}return r},T1=(e,t,n)=>{let r=t;return r=e.setHours(r,e.getHours(n)),r=e.setMinutes(r,e.getMinutes(n)),r=e.setSeconds(r,e.getSeconds(n)),r},sx=(e,t,n)=>n==="date"?e.startOfDay(e.dateWithTimezone(void 0,t)):e.dateWithTimezone(void 0,t),r$=["year","month","day"],sv=e=>r$.includes(e),Vm=(e,{format:t,views:n},r)=>{if(t!=null)return t;const o=e.formats;return Sa(n,["year"])?o.year:Sa(n,["month"])?o.month:Sa(n,["day"])?o.dayOfMonth:Sa(n,["month","year"])?`${o.month} ${o.year}`:Sa(n,["day","month"])?`${o.month} ${o.dayOfMonth}`:r?/en/.test(e.getCurrentLocaleCode())?o.normalDateWithWeekday:o.normalDate:o.keyboardDate},o$=(e,t)=>{const n=e.startOfWeek(t);return[0,1,2,3,4,5,6].map(r=>e.addDays(n,r))},zm=({timezone:e,value:t,defaultValue:n,onChange:r,valueManager:o})=>{var i,s;const a=ut(),l=b.useRef(n),c=(i=t??l.current)!=null?i:o.emptyValue,u=b.useMemo(()=>o.getTimezone(a,c),[a,o,c]),f=Me(g=>u==null?g:o.setTimezone(a,u,g)),p=(s=e??u)!=null?s:"default",x=b.useMemo(()=>o.setTimezone(a,p,c),[o,a,p,c]),y=Me((g,...k)=>{const h=f(g);r==null||r(h,...k)});return{value:x,handleValueChange:y,timezone:p}},Bm=({name:e,timezone:t,value:n,defaultValue:r,onChange:o,valueManager:i})=>{const[s,a]=bn({name:e,state:"value",controlled:n,default:r??i.emptyValue}),l=Me((c,...u)=>{a(c),o==null||o(c,...u)});return zm({timezone:t,value:s,defaultValue:void 0,onChange:l,valueManager:i})},Sr={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},i$=e=>Math.max(...e.map(t=>{var n;return(n=Sr[t.type])!=null?n:1})),ka=(e,t,n)=>{if(t===Sr.year)return e.startOfYear(n);if(t===Sr.month)return e.startOfMonth(n);if(t===Sr.day)return e.startOfDay(n);let r=n;return t{var i;let s=o?o():ka(t,n,sx(t,r));e.minDate!=null&&t.isAfterDay(e.minDate,s)&&(s=ka(t,n,e.minDate)),e.maxDate!=null&&t.isBeforeDay(e.maxDate,s)&&(s=ka(t,n,e.maxDate));const a=qI((i=e.disableIgnoringDatePartForTimeValidation)!=null?i:!1,t);return e.minTime!=null&&a(e.minTime,s)&&(s=ka(t,n,e.disableIgnoringDatePartForTimeValidation?e.minTime:T1(t,s,e.minTime))),e.maxTime!=null&&a(s,e.maxTime)&&(s=ka(t,n,e.disableIgnoringDatePartForTimeValidation?e.maxTime:T1(t,s,e.maxTime))),s},ax=(e,t)=>{const n=e.formatTokenMap[t];if(n==null)throw new Error([`MUI: The token "${t}" is not supported by the Date and Time Pickers.`,"Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported."].join(` +`));return typeof n=="string"?{type:n,contentType:n==="meridiem"?"letter":"digit",maxLength:void 0}:{type:n.sectionType,contentType:n.contentType,maxLength:n.maxLength}},a$=e=>{switch(e){case"ArrowUp":return 1;case"ArrowDown":return-1;case"PageUp":return 5;case"PageDown":return-5;default:return 0}},$f=(e,t,n)=>{const r=[],o=e.dateWithTimezone(void 0,t),i=e.startOfWeek(o),s=e.endOfWeek(o);let a=i;for(;e.isBefore(a,s);)r.push(a),a=e.addDays(a,1);return r.map(l=>e.formatByString(l,n))},lx=(e,t,n,r)=>{switch(n){case"month":return Nm(e,e.dateWithTimezone(void 0,t)).map(o=>e.formatByString(o,r));case"weekDay":return $f(e,t,r);case"meridiem":{const o=e.dateWithTimezone(void 0,t);return[e.startOfDay(o),e.endOfDay(o)].map(i=>e.formatByString(i,r))}default:return[]}},cx=(e,t,n)=>{let r=t;for(r=Number(r).toString();r.length{if(o.type==="day"&&o.contentType==="digit-with-letter"){const s=e.setDate(r.longestMonth,n);return e.formatByString(s,o.format)}const i=n.toString();return o.hasLeadingZerosInInput?cx(e,i,o.maxLength):i},l$=(e,t,n,r,o,i,s)=>{const a=a$(r),l=r==="Home",c=r==="End",u=n.value===""||l||c,f=()=>{const x=o[n.type]({currentDate:i,format:n.format,contentType:n.contentType}),y=m=>ux(e,t,m,x,n),g=n.type==="minutes"&&s!=null&&s.minutesStep?s.minutesStep:1;let h=parseInt(n.value,10)+a*g;if(u){if(n.type==="year"&&!c&&!l)return e.formatByString(e.dateWithTimezone(void 0,t),n.format);a>0||l?h=x.minimum:h=x.maximum}return h%g!==0&&((a<0||l)&&(h+=g-(g+h)%g),(a>0||c)&&(h-=h%g)),h>x.maximum?y(x.minimum+(h-x.maximum-1)%(x.maximum-x.minimum+1)):h{const x=lx(e,t,n.type,n.format);if(x.length===0)return n.value;if(u)return a>0||l?x[0]:x[x.length-1];const g=(x.indexOf(n.value)+x.length+a)%x.length;return x[g]};return n.contentType==="digit"||n.contentType==="digit-with-letter"?f():p()},Wm=(e,t)=>{let n=e.value||e.placeholder;const r=t==="non-input"?e.hasLeadingZerosInFormat:e.hasLeadingZerosInInput;return t==="non-input"&&e.hasLeadingZerosInInput&&!e.hasLeadingZerosInFormat&&(n=Number(n).toString()),["input-rtl","input-ltr"].includes(t)&&e.contentType==="digit"&&!r&&n.length===1&&(n=`${n}‎`),t==="input-rtl"&&(n=`⁨${n}⁩`),n},ps=e=>e.replace(/[\u2066\u2067\u2068\u2069]/g,""),dx=(e,t)=>{let n=0,r=t?1:0;const o=[];for(let i=0;i{switch(r.type){case"year":return n.fieldYearPlaceholder({digitAmount:e.formatByString(e.dateWithTimezone(void 0,t),o).length,format:o});case"month":return n.fieldMonthPlaceholder({contentType:r.contentType,format:o});case"day":return n.fieldDayPlaceholder({format:o});case"weekDay":return n.fieldWeekDayPlaceholder({contentType:r.contentType,format:o});case"hours":return n.fieldHoursPlaceholder({format:o});case"minutes":return n.fieldMinutesPlaceholder({format:o});case"seconds":return n.fieldSecondsPlaceholder({format:o});case"meridiem":return n.fieldMeridiemPlaceholder({format:o});default:return o}},av=(e,t,n,r)=>e.formatByString(e.parse(t,n),r),fx=(e,t,n)=>e.formatByString(e.dateWithTimezone(void 0,t),n).length===4,px=(e,t,n,r,o)=>{if(n!=="digit")return!1;const i=e.dateWithTimezone(void 0,t);switch(r){case"year":return fx(e,t,o)?e.formatByString(e.setYear(i,1),o)==="0001":e.formatByString(e.setYear(i,2001),o)==="01";case"month":return e.formatByString(e.startOfYear(i),o).length>1;case"day":return e.formatByString(e.startOfMonth(i),o).length>1;case"weekDay":return e.formatByString(e.startOfWeek(i),o).length>1;case"hours":return e.formatByString(e.setHours(i,1),o).length>1;case"minutes":return e.formatByString(e.setMinutes(i,1),o).length>1;case"seconds":return e.formatByString(e.setSeconds(i,1),o).length>1;default:throw new Error("Invalid section type")}},u$=(e,t)=>{const n=[],{start:r,end:o}=e.escapedCharacters,i=new RegExp(`(\\${r}[^\\${o}]*\\${o})+`,"g");let s=null;for(;s=i.exec(t);)n.push({start:s.index,end:i.lastIndex-1});return n},lv=(e,t,n,r,o,i,s,a)=>{let l="";const c=[],u=e.date(),f=v=>{if(v==="")return null;const C=ax(e,v),S=px(e,t,C.contentType,C.type,v),E=s?S:C.contentType==="digit",P=o!=null&&e.isValid(o);let M=P?e.formatByString(o,v):"",T=null;if(E)if(S)T=M===""?e.formatByString(u,v).length:M.length;else{if(C.maxLength==null)throw new Error(`MUI: The token ${v} should have a 'maxDigitNumber' property on it's adapter`);T=C.maxLength,P&&(M=cx(e,M,T))}return c.push(w({},C,{format:v,maxLength:T,value:M,placeholder:c$(e,t,n,C,v),hasLeadingZeros:S,hasLeadingZerosInFormat:S,hasLeadingZerosInInput:E,startSeparator:c.length===0?l:"",endSeparator:"",modified:!1})),null};let p=10,x=r,y=e.expandFormat(r);for(;y!==x;)if(x=y,y=e.expandFormat(x),p-=1,p<0)throw new Error("MUI: The format expansion seems to be enter in an infinite loop. Please open an issue with the format passed to the picker component");const g=y,k=u$(e,g),h=new RegExp(`^(${Object.keys(e.formatTokenMap).sort((v,C)=>C.length-v.length).join("|")})`,"g");let m="";for(let v=0;vT.start<=v&&T.end>=v),S=g[v],E=C!=null,P=`${m}${g.slice(v)}`,M=h.test(P);!E&&S.match(/([A-Za-z]+)/)&&M?(m=P.slice(0,h.lastIndex),v+=h.lastIndex-1):E&&(C==null?void 0:C.start)===v||(C==null?void 0:C.end)===v||(f(m),m="",c.length===0?l+=S:c[c.length-1].endSeparator+=S)}return f(m),c.map(v=>{const C=S=>{let E=S;return a&&E!==null&&E.includes(" ")&&(E=`⁩${E}⁦`),i==="spacious"&&["/",".","-"].includes(E)&&(E=` ${E} `),E};return v.startSeparator=C(v.startSeparator),v.endSeparator=C(v.endSeparator),v})},d$=(e,t)=>{const n=t.some(a=>a.type==="day"),r=[],o=[];for(let a=0;a{const r=e.map(o=>{const i=Wm(o,t?"input-rtl":"input-ltr");return`${o.startSeparator}${i}${o.endSeparator}`}).join("");return t?`⁦${r}⁩`:r},p$=(e,t)=>{const n=e.dateWithTimezone(void 0,t),r=e.endOfYear(n),o=e.endOfDay(n),{maxDaysInMonth:i,longestMonth:s}=Nm(e,n).reduce((a,l)=>{const c=e.getDaysInMonth(l);return c>a.maxDaysInMonth?{maxDaysInMonth:c,longestMonth:l}:a},{maxDaysInMonth:0,longestMonth:null});return{year:({format:a})=>({minimum:0,maximum:fx(e,t,a)?9999:99}),month:()=>({minimum:1,maximum:e.getMonth(r)+1}),day:({currentDate:a})=>({minimum:1,maximum:a!=null&&e.isValid(a)?e.getDaysInMonth(a):i,longestMonth:s}),weekDay:({format:a,contentType:l})=>{if(l==="digit"){const c=$f(e,t,a).map(Number);return{minimum:Math.min(...c),maximum:Math.max(...c)}}return{minimum:1,maximum:7}},hours:({format:a})=>{const l=e.getHours(o);return e.formatByString(e.endOfDay(n),a)!==l.toString()?{minimum:1,maximum:Number(e.formatByString(e.startOfDay(n),a))}:{minimum:0,maximum:l}},minutes:()=>({minimum:0,maximum:e.getMinutes(o)}),seconds:()=>({minimum:0,maximum:e.getSeconds(o)}),meridiem:()=>({minimum:0,maximum:0})}},h$=(e,t,n,r,o)=>{switch(n.type){case"year":return e.setYear(o,e.getYear(r));case"month":return e.setMonth(o,e.getMonth(r));case"weekDay":{const i=$f(e,t,n.format),s=e.formatByString(r,n.format),a=i.indexOf(s),c=i.indexOf(n.value)-a;return e.addDays(r,c)}case"day":return e.setDate(o,e.getDate(r));case"meridiem":{const i=e.getHours(r)<12,s=e.getHours(o);return i&&s>=12?e.addHours(o,-12):!i&&s<12?e.addHours(o,12):o}case"hours":return e.setHours(o,e.getHours(r));case"minutes":return e.setMinutes(o,e.getMinutes(r));case"seconds":return e.setSeconds(o,e.getSeconds(r));default:return o}},cv={year:1,month:2,day:3,weekDay:4,hours:5,minutes:6,seconds:7,meridiem:8},uv=(e,t,n,r,o,i)=>[...r].sort((s,a)=>cv[s.type]-cv[a.type]).reduce((s,a)=>!i||a.modified?h$(e,t,a,n,s):s,o),m$=()=>navigator.userAgent.toLowerCase().indexOf("android")>-1,g$=(e,t)=>{const n={};if(!t)return e.forEach((l,c)=>{const u=c===0?null:c-1,f=c===e.length-1?null:c+1;n[c]={leftIndex:u,rightIndex:f}}),{neighbors:n,startIndex:0,endIndex:e.length-1};const r={},o={};let i=0,s=0,a=e.length-1;for(;a>=0;){s=e.findIndex((l,c)=>{var u;return c>=i&&((u=l.endSeparator)==null?void 0:u.includes(" "))&&l.endSeparator!==" / "}),s===-1&&(s=e.length-1);for(let l=s;l>=i;l-=1)o[l]=a,r[a]=l,a-=1;i=s+1}return e.forEach((l,c)=>{const u=o[c],f=u===0?null:r[u-1],p=u===e.length-1?null:r[u+1];n[c]={leftIndex:f,rightIndex:p}}),{neighbors:n,startIndex:r[0],endIndex:r[e.length-1]}},y$=["value","referenceDate"],co={emptyValue:null,getTodayValue:sx,getInitialReferenceValue:e=>{let{value:t,referenceDate:n}=e,r=Q(e,y$);return t!=null&&r.utils.isValid(t)?t:n??s$(r)},cleanValue:t$,areValuesEqual:n$,isSameError:(e,t)=>e===t,hasError:e=>e!=null,defaultErrorState:null,getTimezone:(e,t)=>t==null||!e.isValid(t)?null:e.getTimezone(t),setTimezone:(e,t,n)=>n==null?null:e.setTimezone(n,t)},v$={updateReferenceValue:(e,t,n)=>t==null||!e.isValid(t)?n:t,getSectionsFromValue:(e,t,n,r,o)=>!e.isValid(t)&&!!n?n:dx(o(t),r),getValueStrFromSections:f$,getActiveDateManager:(e,t)=>({date:t.value,referenceDate:t.referenceValue,getSections:n=>n,getNewValuesFromNewActiveDate:n=>({value:n,referenceValue:n==null||!e.isValid(n)?t.referenceValue:n})}),parseValueStr:(e,t,n)=>n(e.trim(),t)},hx=e=>{if(e!==void 0)return Object.keys(e).reduce((t,n)=>w({},t,{[`${n.slice(0,1).toLowerCase()}${n.slice(1)}`]:e[n]}),{})};function x$(e){return De("MuiPickersDay",e)}const Qo=Ee("MuiPickersDay",["root","dayWithMargin","dayOutsideMonth","hiddenDaySpacingFiller","today","selected","disabled"]),C$=["autoFocus","className","day","disabled","disableHighlightToday","disableMargin","hidden","isAnimating","onClick","onDaySelect","onFocus","onBlur","onKeyDown","onMouseDown","onMouseEnter","outsideCurrentMonth","selected","showDaysOutsideCurrentMonth","children","today","isFirstVisibleCell","isLastVisibleCell"],b$=e=>{const{selected:t,disableMargin:n,disableHighlightToday:r,today:o,disabled:i,outsideCurrentMonth:s,showDaysOutsideCurrentMonth:a,classes:l}=e,c=s&&!a;return _e({root:["root",t&&!c&&"selected",i&&"disabled",!n&&"dayWithMargin",!r&&o&&"today",s&&a&&"dayOutsideMonth",c&&"hiddenDaySpacingFiller"],hiddenDaySpacingFiller:["hiddenDaySpacingFiller"]},x$,l)},mx=({theme:e,ownerState:t})=>w({},e.typography.caption,{width:Rl,height:Rl,borderRadius:"50%",padding:0,backgroundColor:"transparent",transition:e.transitions.create("background-color",{duration:e.transitions.duration.short}),color:(e.vars||e).palette.text.primary,"@media (pointer: fine)":{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Ne(e.palette.primary.main,e.palette.action.hoverOpacity)}},"&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.focusOpacity})`:Ne(e.palette.primary.main,e.palette.action.focusOpacity),[`&.${Qo.selected}`]:{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${Qo.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,fontWeight:e.typography.fontWeightMedium,"&:hover":{willChange:"background-color",backgroundColor:(e.vars||e).palette.primary.dark}},[`&.${Qo.disabled}:not(.${Qo.selected})`]:{color:(e.vars||e).palette.text.disabled},[`&.${Qo.disabled}&.${Qo.selected}`]:{opacity:.6}},!t.disableMargin&&{margin:`0 ${Of}px`},t.outsideCurrentMonth&&t.showDaysOutsideCurrentMonth&&{color:(e.vars||e).palette.text.secondary},!t.disableHighlightToday&&t.today&&{[`&:not(.${Qo.selected})`]:{border:`1px solid ${(e.vars||e).palette.text.secondary}`}}),gx=(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableMargin&&t.dayWithMargin,!n.disableHighlightToday&&n.today&&t.today,!n.outsideCurrentMonth&&n.showDaysOutsideCurrentMonth&&t.dayOutsideMonth,n.outsideCurrentMonth&&!n.showDaysOutsideCurrentMonth&&t.hiddenDaySpacingFiller]},w$=H($r,{name:"MuiPickersDay",slot:"Root",overridesResolver:gx})(mx),S$=H("div",{name:"MuiPickersDay",slot:"Root",overridesResolver:gx})(({theme:e,ownerState:t})=>w({},mx({theme:e,ownerState:t}),{opacity:0,pointerEvents:"none"})),Pa=()=>{},k$=b.forwardRef(function(t,n){const r=Te({props:t,name:"MuiPickersDay"}),{autoFocus:o=!1,className:i,day:s,disabled:a=!1,disableHighlightToday:l=!1,disableMargin:c=!1,isAnimating:u,onClick:f,onDaySelect:p,onFocus:x=Pa,onBlur:y=Pa,onKeyDown:g=Pa,onMouseDown:k=Pa,onMouseEnter:h=Pa,outsideCurrentMonth:m,selected:v=!1,showDaysOutsideCurrentMonth:C=!1,children:S,today:E=!1}=r,P=Q(r,C$),M=w({},r,{autoFocus:o,disabled:a,disableHighlightToday:l,disableMargin:c,selected:v,showDaysOutsideCurrentMonth:C,today:E}),T=b$(M),R=ut(),O=b.useRef(null),A=tt(O,n);jt(()=>{o&&!a&&!u&&!m&&O.current.focus()},[o,a,u,m]);const $=D=>{k(D),m&&D.preventDefault()},_=D=>{a||p(s),m&&D.currentTarget.focus(),f&&f(D)};return m&&!C?d.jsx(S$,{className:le(T.root,T.hiddenDaySpacingFiller,i),ownerState:M,role:P.role}):d.jsx(w$,w({className:le(T.root,i),ref:A,centerRipple:!0,disabled:a,tabIndex:v?0:-1,onKeyDown:D=>g(D,s),onFocus:D=>x(D,s),onBlur:D=>y(D,s),onMouseEnter:D=>h(D,s),onClick:_,onMouseDown:$},P,{ownerState:M,children:S||R.format(s,"dayOfMonth")}))}),P$=b.memo(k$),dv={hours:"часы",minutes:"минуты",seconds:"секунды",meridiem:"меридием"},E$={previousMonth:"Предыдущий месяц",nextMonth:"Следующий месяц",openPreviousView:"открыть предыдущий вид",openNextView:"открыть следующий вид",calendarViewSwitchingButtonAriaLabel:e=>e==="year"?"открыт годовой вид, переключить на календарный вид":"открыт календарный вид, переключить на годовой вид",start:"Начало",end:"Конец",cancelButtonLabel:"Отмена",clearButtonLabel:"Очистить",okButtonLabel:"Ок",todayButtonLabel:"Сегодня",datePickerToolbarTitle:"Выбрать дату",dateTimePickerToolbarTitle:"Выбрать дату и время",timePickerToolbarTitle:"Выбрать время",dateRangePickerToolbarTitle:"Выбрать период",clockLabelText:(e,t,n)=>`Выбрать ${dv[e]}. ${t===null?"Время не выбрано":`Выбрано время ${n.format(t,"fullTime")}`}`,hoursClockNumberText:e=>`${e} часов`,minutesClockNumberText:e=>`${e} минут`,secondsClockNumberText:e=>`${e} секунд`,selectViewText:e=>`Выбрать ${dv[e]}`,calendarWeekNumberHeaderLabel:"Номер недели",calendarWeekNumberHeaderText:"№",calendarWeekNumberAriaLabelText:e=>`Неделя ${e}`,calendarWeekNumberText:e=>`${e}`,openDatePickerDialogue:(e,t)=>e!==null&&t.isValid(e)?`Выберите дату, выбрана дата ${t.format(e,"fullDate")}`:"Выберите дату",openTimePickerDialogue:(e,t)=>e!==null&&t.isValid(e)?`Выберите время, выбрано время ${t.format(e,"fullTime")}`:"Выберите время",fieldClearLabel:"Очистить значение",timeTableLabel:"выбрать время",dateTableLabel:"выбрать дату",fieldYearPlaceholder:e=>"Г".repeat(e.digitAmount),fieldMonthPlaceholder:e=>e.contentType==="letter"?"ММММ":"ММ",fieldDayPlaceholder:()=>"ДД",fieldHoursPlaceholder:()=>"чч",fieldMinutesPlaceholder:()=>"мм",fieldSecondsPlaceholder:()=>"сс",fieldMeridiemPlaceholder:()=>"(д|п)п"},M$=rx(E$);function yx(e,t,n,r){const{value:o,onError:i}=e,s=$i(),a=b.useRef(r),l=t({adapter:s,value:o,props:e});return b.useEffect(()=>{i&&!n(l,a.current)&&i(l,o),a.current=l},[n,i,a,l,o]),l}const T$=e=>{const t=ut(),n=Zo(),r=$i(),i=Le().direction==="rtl",{valueManager:s,fieldValueManager:a,valueType:l,validator:c,internalProps:u,internalProps:{value:f,defaultValue:p,referenceDate:x,onChange:y,format:g,formatDensity:k="dense",selectedSections:h,onSelectedSectionsChange:m,shouldRespectLeadingZeros:v=!1,timezone:C}}=e,{timezone:S,value:E,handleValueChange:P}=zm({timezone:C,value:f,defaultValue:p,onChange:y,valueManager:s}),M=b.useMemo(()=>p$(t,S),[t,S]),T=b.useCallback((W,ne=null)=>a.getSectionsFromValue(t,W,ne,i,pe=>lv(t,S,n,g,pe,k,v,i)),[a,g,n,i,v,t,k,S]),R=b.useMemo(()=>a.getValueStrFromSections(T(s.emptyValue),i),[a,T,s.emptyValue,i]),[O,A]=b.useState(()=>{const W=T(E),ne={sections:W,value:E,referenceValue:s.emptyValue,tempValueStrAndroid:null},pe=i$(W),Y=s.getInitialReferenceValue({referenceDate:x,value:E,utils:t,props:u,granularity:pe,timezone:S});return w({},ne,{referenceValue:Y})}),[$,_]=bn({controlled:h,default:null,name:"useField",state:"selectedSectionIndexes"}),D=W=>{_(W),m==null||m(W),A(ne=>w({},ne,{selectedSectionQuery:null}))},L=b.useMemo(()=>{if($==null)return null;if($==="all")return{startIndex:0,endIndex:O.sections.length-1,shouldSelectBoundarySelectors:!0};if(typeof $=="number")return{startIndex:$,endIndex:$};if(typeof $=="string"){const W=O.sections.findIndex(ne=>ne.type===$);return{startIndex:W,endIndex:W}}return $},[$,O.sections]),V=({value:W,referenceValue:ne,sections:pe})=>{if(A(me=>w({},me,{sections:pe,value:W,referenceValue:ne,tempValueStrAndroid:null})),s.areValuesEqual(t,O.value,W))return;const Y={validationError:c({adapter:r,value:W,props:w({},u,{value:W,timezone:S})})};P(W,Y)},I=(W,ne)=>{const pe=[...O.sections];return pe[W]=w({},pe[W],{value:ne,modified:!0}),dx(pe,i)},F=()=>{V({value:s.emptyValue,referenceValue:O.referenceValue,sections:T(s.emptyValue)})},z=()=>{if(L==null)return;const W=O.sections[L.startIndex],ne=a.getActiveDateManager(t,O,W),Y=ne.getSections(O.sections).filter(ee=>ee.value!=="").length===(W.value===""?0:1),me=I(L.startIndex,""),Se=Y?null:t.date(new Date("")),Pe=ne.getNewValuesFromNewActiveDate(Se);(Se!=null&&!t.isValid(Se))!=(ne.date!=null&&!t.isValid(ne.date))?V(w({},Pe,{sections:me})):A(ee=>w({},ee,Pe,{sections:me,tempValueStrAndroid:null}))},ae=W=>{const ne=(me,Se)=>{const Pe=t.parse(me,g);if(Pe==null||!t.isValid(Pe))return null;const ee=lv(t,S,n,g,Pe,k,v,i);return uv(t,S,Pe,ee,Se,!1)},pe=a.parseValueStr(W,O.referenceValue,ne),Y=a.updateReferenceValue(t,pe,O.referenceValue);V({value:pe,referenceValue:Y,sections:T(pe,O.sections)})},re=({activeSection:W,newSectionValue:ne,shouldGoToNextSection:pe})=>{pe&&L&&L.startIndexw({},j,ee,{sections:me,tempValueStrAndroid:null}))},de=W=>A(ne=>w({},ne,{tempValueStrAndroid:W}));return b.useEffect(()=>{const W=T(O.value);A(ne=>w({},ne,{sections:W}))},[g,t.locale]),b.useEffect(()=>{let W=!1;s.areValuesEqual(t,O.value,E)?W=s.getTimezone(t,O.value)!==s.getTimezone(t,E):W=!0,W&&A(ne=>w({},ne,{value:E,referenceValue:a.updateReferenceValue(t,E,ne.referenceValue),sections:T(E)}))},[E]),{state:O,selectedSectionIndexes:L,setSelectedSections:D,clearValue:F,clearActiveSection:z,updateSectionValue:re,updateValueFromValueStr:ae,setTempAndroidValueStr:de,sectionsValueBoundaries:M,placeholder:R,timezone:S}},R$=5e3,Gi=e=>e.saveQuery!=null,_$=({sections:e,updateSectionValue:t,sectionsValueBoundaries:n,setTempAndroidValueStr:r,timezone:o})=>{const i=ut(),[s,a]=b.useState(null),l=Me(()=>a(null));b.useEffect(()=>{var x;s!=null&&((x=e[s.sectionIndex])==null?void 0:x.type)!==s.sectionType&&l()},[e,s,l]),b.useEffect(()=>{if(s!=null){const x=setTimeout(()=>l(),R$);return()=>{window.clearTimeout(x)}}return()=>{}},[s,l]);const c=({keyPressed:x,sectionIndex:y},g,k)=>{const h=x.toLowerCase(),m=e[y];if(s!=null&&(!k||k(s.value))&&s.sectionIndex===y){const C=`${s.value}${h}`,S=g(C,m);if(!Gi(S))return a({sectionIndex:y,value:C,sectionType:m.type}),S}const v=g(h,m);return Gi(v)&&!v.saveQuery?(l(),null):(a({sectionIndex:y,value:h,sectionType:m.type}),Gi(v)?null:v)},u=x=>{const y=(h,m,v)=>{const C=m.filter(S=>S.toLowerCase().startsWith(v));return C.length===0?{saveQuery:!1}:{sectionValue:C[0],shouldGoToNextSection:C.length===1}},g=(h,m,v,C)=>{const S=E=>lx(i,o,m.type,E);if(m.contentType==="letter")return y(m.format,S(m.format),h);if(v&&C!=null&&ax(i,v).contentType==="letter"){const E=S(v),P=y(v,E,h);return Gi(P)?{saveQuery:!1}:w({},P,{sectionValue:C(P.sectionValue,E)})}return{saveQuery:!1}};return c(x,(h,m)=>{switch(m.type){case"month":{const v=C=>av(i,C,i.formats.month,m.format);return g(h,m,i.formats.month,v)}case"weekDay":{const v=(C,S)=>S.indexOf(C).toString();return g(h,m,i.formats.weekday,v)}case"meridiem":return g(h,m);default:return{saveQuery:!1}}})},f=x=>{const y=(k,h)=>{const m=+`${k}`,v=n[h.type]({currentDate:null,format:h.format,contentType:h.contentType});if(m>v.maximum)return{saveQuery:!1};if(mv.maximum||k.length===v.maximum.toString().length;return{sectionValue:ux(i,o,m,v,h),shouldGoToNextSection:C}};return c(x,(k,h)=>{if(h.contentType==="digit"||h.contentType==="digit-with-letter")return y(k,h);if(h.type==="month"){const m=px(i,o,"digit","month","MM"),v=y(k,{type:h.type,format:"MM",hasLeadingZerosInFormat:m,hasLeadingZerosInInput:!0,contentType:"digit",maxLength:2});if(Gi(v))return v;const C=av(i,v.sectionValue,"MM",h.format);return w({},v,{sectionValue:C})}if(h.type==="weekDay"){const m=y(k,h);if(Gi(m))return m;const v=$f(i,o,h.format)[Number(m.sectionValue)-1];return w({},m,{sectionValue:v})}return{saveQuery:!1}},k=>!Number.isNaN(Number(k)))};return{applyCharacterEditing:Me(x=>{const y=e[x.sectionIndex],k=!Number.isNaN(Number(x.keyPressed))?f(x):u(x);k==null?r(null):t({activeSection:y,newSectionValue:k.sectionValue,shouldGoToNextSection:k.shouldGoToNextSection})}),resetCharacterQuery:l}};function D$(e,t){return Array.isArray(t)?t.every(n=>e.indexOf(n)!==-1):e.indexOf(t)!==-1}const O$=(e,t)=>n=>{(n.key==="Enter"||n.key===" ")&&(e(n),n.preventDefault(),n.stopPropagation()),t&&t(n)},cd=(e=document)=>{const t=e.activeElement;return t?t.shadowRoot?cd(t.shadowRoot):t:null},I$="@media (pointer: fine)",$$=["onClick","onKeyDown","onFocus","onBlur","onMouseUp","onPaste","error","clearable","onClear","disabled"],F$=e=>{const t=ut(),{state:n,selectedSectionIndexes:r,setSelectedSections:o,clearValue:i,clearActiveSection:s,updateSectionValue:a,updateValueFromValueStr:l,setTempAndroidValueStr:c,sectionsValueBoundaries:u,placeholder:f,timezone:p}=T$(e),{inputRef:x,internalProps:y,internalProps:{readOnly:g=!1,unstableFieldRef:k,minutesStep:h},forwardedProps:{onClick:m,onKeyDown:v,onFocus:C,onBlur:S,onMouseUp:E,onPaste:P,error:M,clearable:T,onClear:R,disabled:O},fieldValueManager:A,valueManager:$,validator:_}=e,D=Q(e.forwardedProps,$$),{applyCharacterEditing:L,resetCharacterQuery:V}=_$({sections:n.sections,updateSectionValue:a,sectionsValueBoundaries:u,setTempAndroidValueStr:c,timezone:p}),I=b.useRef(null),F=tt(x,I),z=b.useRef(void 0),re=Le().direction==="rtl",de=b.useMemo(()=>g$(n.sections,re),[n.sections,re]),W=()=>{var B;if(g){o(null);return}const q=(B=I.current.selectionStart)!=null?B:0;let we;q<=n.sections[0].startInInput||q>=n.sections[n.sections.length-1].endInInput?we=1:we=n.sections.findIndex(ke=>ke.startInInput-ke.startSeparator.length>q);const $e=we===-1?n.sections.length-1:we-1;o($e)},ne=Me((B,...q)=>{B.isDefaultPrevented()||(m==null||m(B,...q),W())}),pe=Me(B=>{E==null||E(B),B.preventDefault()}),Y=Me((...B)=>{C==null||C(...B);const q=I.current;window.clearTimeout(z.current),z.current=setTimeout(()=>{!q||q!==I.current||r!=null||g||(q.value.length&&Number(q.selectionEnd)-Number(q.selectionStart)===q.value.length?o("all"):W())})}),me=Me((...B)=>{S==null||S(...B),o(null)}),Se=Me(B=>{if(P==null||P(B),g){B.preventDefault();return}const q=B.clipboardData.getData("text");if(r&&r.startIndex===r.endIndex){const we=n.sections[r.startIndex],$e=/^[a-zA-Z]+$/.test(q),ke=/^[0-9]+$/.test(q),Z=/^(([a-zA-Z]+)|)([0-9]+)(([a-zA-Z]+)|)$/.test(q);if(we.contentType==="letter"&&$e||we.contentType==="digit"&&ke||we.contentType==="digit-with-letter"&&Z){V(),a({activeSection:we,newSectionValue:q,shouldGoToNextSection:!0}),B.preventDefault();return}if($e||ke){B.preventDefault();return}}B.preventDefault(),V(),l(q)}),Pe=Me(B=>{if(g)return;const q=B.target.value;if(q===""){V(),i();return}const we=B.nativeEvent.data,$e=we&&we.length>1,ke=$e?we:q,Z=ps(ke);if(r==null||$e){l($e?we:Z);return}let he;if(r.startIndex===0&&r.endIndex===n.sections.length-1&&Z.length===1)he=Z;else{const ve=ps(A.getValueStrFromSections(n.sections,re));let ge=-1,ye=-1;for(let ue=0;ueKe.end)return;const He=Z.length-ve.length+Ke.end-ps(Ke.endSeparator||"").length;he=Z.slice(Ke.start+ps(Ke.startSeparator||"").length,He)}if(he.length===0){m$()?c(ke):(V(),s());return}L({keyPressed:he,sectionIndex:r.startIndex})}),ee=Me(B=>{switch(v==null||v(B),!0){case(B.key==="a"&&(B.ctrlKey||B.metaKey)):{B.preventDefault(),o("all");break}case B.key==="ArrowRight":{if(B.preventDefault(),r==null)o(de.startIndex);else if(r.startIndex!==r.endIndex)o(r.endIndex);else{const q=de.neighbors[r.startIndex].rightIndex;q!==null&&o(q)}break}case B.key==="ArrowLeft":{if(B.preventDefault(),r==null)o(de.endIndex);else if(r.startIndex!==r.endIndex)o(r.startIndex);else{const q=de.neighbors[r.startIndex].leftIndex;q!==null&&o(q)}break}case B.key==="Delete":{if(B.preventDefault(),g)break;r==null||r.startIndex===0&&r.endIndex===n.sections.length-1?i():s(),V();break}case["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(B.key):{if(B.preventDefault(),g||r==null)break;const q=n.sections[r.startIndex],we=A.getActiveDateManager(t,n,q),$e=l$(t,p,q,B.key,u,we.date,{minutesStep:h});a({activeSection:q,newSectionValue:$e,shouldGoToNextSection:!1});break}}});jt(()=>{if(!I.current)return;if(r==null){I.current.scrollLeft&&(I.current.scrollLeft=0);return}const B=n.sections[r.startIndex],q=n.sections[r.endIndex];let we=B.startInInput,$e=q.endInInput;if(r.shouldSelectBoundarySelectors&&(we-=B.startSeparator.length,$e+=q.endSeparator.length),we!==I.current.selectionStart||$e!==I.current.selectionEnd){const ke=I.current.scrollTop;I.current===cd(document)&&I.current.setSelectionRange(we,$e),I.current.scrollTop=ke}});const J=yx(w({},y,{value:n.value,timezone:p}),_,$.isSameError,$.defaultErrorState),j=b.useMemo(()=>M!==void 0?M:$.hasError(J),[$,J,M]);b.useEffect(()=>{!j&&!r&&V()},[n.referenceValue,r,j]),b.useEffect(()=>(I.current&&I.current===document.activeElement&&o("all"),()=>window.clearTimeout(z.current)),[]),b.useEffect(()=>{n.tempValueStrAndroid!=null&&r!=null&&(V(),s())},[n.tempValueStrAndroid]);const U=b.useMemo(()=>{var B;return(B=n.tempValueStrAndroid)!=null?B:A.getValueStrFromSections(n.sections,re)},[n.sections,A,n.tempValueStrAndroid,re]),K=b.useMemo(()=>r==null||n.sections[r.startIndex].contentType==="letter"?"text":"numeric",[r,n.sections]),xe=I.current&&I.current===cd(document),Ie=$.areValuesEqual(t,n.value,$.emptyValue),se=!xe&&Ie;b.useImperativeHandle(k,()=>({getSections:()=>n.sections,getActiveSectionIndex:()=>{var B,q;const we=(B=I.current.selectionStart)!=null?B:0,$e=(q=I.current.selectionEnd)!=null?q:0;if(we===0&&$e===0)return null;const ke=we<=n.sections[0].startInInput?1:n.sections.findIndex(Z=>Z.startInInput-Z.startSeparator.length>we);return ke===-1?n.sections.length-1:ke-1},setSelectedSections:B=>o(B)}));const fe=Me((B,...q)=>{var we;B.preventDefault(),R==null||R(B,...q),i(),I==null||(we=I.current)==null||we.focus(),o(0)});return w({placeholder:f,autoComplete:"off",disabled:!!O},D,{value:se?"":U,inputMode:K,readOnly:g,onClick:ne,onFocus:Y,onBlur:me,onPaste:Se,onChange:Pe,onKeyDown:ee,onMouseUp:pe,onClear:fe,error:j,ref:F,clearable:!!(T&&!Ie&&!g&&!O)})},Ff=({props:e,value:t,adapter:n})=>{if(t===null)return null;const{shouldDisableDate:r,shouldDisableMonth:o,shouldDisableYear:i,disablePast:s,disableFuture:a,timezone:l}=e,c=n.utils.dateWithTimezone(void 0,l),u=Qn(n.utils,e.minDate,n.defaultDates.minDate),f=Qn(n.utils,e.maxDate,n.defaultDates.maxDate);switch(!0){case!n.utils.isValid(t):return"invalidDate";case!!(r&&r(t)):return"shouldDisableDate";case!!(o&&o(t)):return"shouldDisableMonth";case!!(i&&i(t)):return"shouldDisableYear";case!!(a&&n.utils.isAfterDay(t,c)):return"disableFuture";case!!(s&&n.utils.isBeforeDay(t,c)):return"disablePast";case!!(u&&n.utils.isBeforeDay(t,u)):return"minDate";case!!(f&&n.utils.isAfterDay(t,f)):return"maxDate";default:return null}},R1=["disablePast","disableFuture","minDate","maxDate","shouldDisableDate","shouldDisableMonth","shouldDisableYear"],_1=["disablePast","disableFuture","minTime","maxTime","shouldDisableClock","shouldDisableTime","minutesStep","ampm","disableIgnoringDatePartForTimeValidation"],vx=["minDateTime","maxDateTime"],A$=[...R1,..._1,...vx],xx=e=>A$.reduce((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t),{}),L$=["value","defaultValue","referenceDate","format","formatDensity","onChange","timezone","readOnly","onError","shouldRespectLeadingZeros","selectedSections","onSelectedSectionsChange","unstableFieldRef"],j$=(e,t)=>{const n=w({},e),r={},o=i=>{n.hasOwnProperty(i)&&(r[i]=n[i],delete n[i])};return L$.forEach(o),t==="date"?R1.forEach(o):t==="time"?_1.forEach(o):t==="date-time"&&(R1.forEach(o),_1.forEach(o),vx.forEach(o)),{forwardedProps:n,internalProps:r}},N$=e=>{var t,n,r;const o=ut(),i=ec();return w({},e,{disablePast:(t=e.disablePast)!=null?t:!1,disableFuture:(n=e.disableFuture)!=null?n:!1,format:(r=e.format)!=null?r:o.formats.keyboardDate,minDate:Qn(o,e.minDate,i.minDate),maxDate:Qn(o,e.maxDate,i.maxDate)})},V$=({props:e,inputRef:t})=>{const n=N$(e),{forwardedProps:r,internalProps:o}=j$(n,"date");return F$({inputRef:t,forwardedProps:r,internalProps:o,valueManager:co,fieldValueManager:v$,validator:Ff,valueType:"date"})},z$=H(mR)({[`& .${tl.container}`]:{outline:0},[`& .${tl.paper}`]:{outline:0,minWidth:If}}),B$=H(RR)({"&:first-of-type":{padding:0}});function W$(e){var t,n;const{children:r,onDismiss:o,open:i,slots:s,slotProps:a}=e,l=(t=s==null?void 0:s.dialog)!=null?t:z$,c=(n=s==null?void 0:s.mobileTransition)!=null?n:ea;return d.jsx(l,w({open:i,onClose:o},a==null?void 0:a.dialog,{TransitionComponent:c,TransitionProps:a==null?void 0:a.mobileTransition,PaperComponent:s==null?void 0:s.mobilePaper,PaperProps:a==null?void 0:a.mobilePaper,children:d.jsx(B$,{children:r})}))}function H$(e){return De("MuiPickersPopper",e)}Ee("MuiPickersPopper",["root","paper"]);const U$="@media (prefers-reduced-motion: reduce)",ks=typeof navigator<"u"&&navigator.userAgent.match(/android\s(\d+)|OS\s(\d+)/i),fv=ks&&ks[1]?parseInt(ks[1],10):null,pv=ks&&ks[2]?parseInt(ks[2],10):null,Y$=fv&&fv<10||pv&&pv<13||!1,Cx=()=>ln(U$,{defaultMatches:!1})||Y$,G$=["PaperComponent","popperPlacement","ownerState","children","paperSlotProps","paperClasses","onPaperClick","onPaperTouchStart"],K$=e=>{const{classes:t}=e;return _e({root:["root"],paper:["paper"]},H$,t)},Z$=H(AM,{name:"MuiPickersPopper",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({zIndex:e.zIndex.modal})),q$=H(ql,{name:"MuiPickersPopper",slot:"Paper",overridesResolver:(e,t)=>t.paper})(({ownerState:e})=>w({outline:0,transformOrigin:"top center"},e.placement.includes("top")&&{transformOrigin:"bottom center"}));function X$(e,t){return t.documentElement.clientWidth{if(!e)return;function l(){i.current=!0}return document.addEventListener("mousedown",l,!0),document.addEventListener("touchstart",l,!0),()=>{document.removeEventListener("mousedown",l,!0),document.removeEventListener("touchstart",l,!0),i.current=!1}},[e]);const s=Me(l=>{if(!i.current)return;const c=r.current;r.current=!1;const u=Et(o.current);if(!o.current||"clientX"in l&&X$(l,u))return;if(n.current){n.current=!1;return}let f;l.composedPath?f=l.composedPath().indexOf(o.current)>-1:f=!u.documentElement.contains(l.target)||o.current.contains(l.target),!f&&!c&&t(l)}),a=()=>{r.current=!0};return b.useEffect(()=>{if(e){const l=Et(o.current),c=()=>{n.current=!0};return l.addEventListener("touchstart",s),l.addEventListener("touchmove",c),()=>{l.removeEventListener("touchstart",s),l.removeEventListener("touchmove",c)}}},[e,s]),b.useEffect(()=>{if(e){const l=Et(o.current);return l.addEventListener("click",s),()=>{l.removeEventListener("click",s),r.current=!1}}},[e,s]),[o,a,a]}const Q$=b.forwardRef((e,t)=>{const{PaperComponent:n,popperPlacement:r,ownerState:o,children:i,paperSlotProps:s,paperClasses:a,onPaperClick:l,onPaperTouchStart:c}=e,u=Q(e,G$),f=w({},o,{placement:r}),p=We({elementType:n,externalSlotProps:s,additionalProps:{tabIndex:-1,elevation:8,ref:t},className:a,ownerState:f});return d.jsx(n,w({},u,p,{onClick:x=>{var y;l(x),(y=p.onClick)==null||y.call(p,x)},onTouchStart:x=>{var y;c(x),(y=p.onTouchStart)==null||y.call(p,x)},ownerState:f,children:i}))});function eF(e){var t,n,r,o;const i=Te({props:e,name:"MuiPickersPopper"}),{anchorEl:s,children:a,containerRef:l=null,shouldRestoreFocus:c,onBlur:u,onDismiss:f,open:p,role:x,placement:y,slots:g,slotProps:k,reduceAnimations:h}=i;b.useEffect(()=>{function F(z){p&&(z.key==="Escape"||z.key==="Esc")&&f()}return document.addEventListener("keydown",F),()=>{document.removeEventListener("keydown",F)}},[f,p]);const m=b.useRef(null);b.useEffect(()=>{x==="tooltip"||c&&!c()||(p?m.current=cd(document):m.current&&m.current instanceof HTMLElement&&setTimeout(()=>{m.current instanceof HTMLElement&&m.current.focus()}))},[p,x,c]);const[v,C,S]=J$(p,u??f),E=b.useRef(null),P=tt(E,l),M=tt(P,v),T=i,R=K$(T),O=Cx(),A=h??O,$=F=>{F.key==="Escape"&&(F.stopPropagation(),f())},_=((t=g==null?void 0:g.desktopTransition)!=null?t:A)?ea:N6,D=(n=g==null?void 0:g.desktopTrapFocus)!=null?n:y6,L=(r=g==null?void 0:g.desktopPaper)!=null?r:q$,V=(o=g==null?void 0:g.popper)!=null?o:Z$,I=We({elementType:V,externalSlotProps:k==null?void 0:k.popper,additionalProps:{transition:!0,role:x,open:p,anchorEl:s,placement:y,onKeyDown:$},className:R.root,ownerState:i});return d.jsx(V,w({},I,{children:({TransitionProps:F,placement:z})=>d.jsx(D,w({open:p,disableAutoFocus:!0,disableRestoreFocus:!0,disableEnforceFocus:x==="tooltip",isEnabled:()=>!0},k==null?void 0:k.desktopTrapFocus,{children:d.jsx(_,w({},F,k==null?void 0:k.desktopTransition,{children:d.jsx(Q$,{PaperComponent:L,ownerState:T,popperPlacement:z,ref:M,onPaperClick:C,onPaperTouchStart:S,paperClasses:R.paper,paperSlotProps:k==null?void 0:k.desktopPaper,children:a})}))}))}))}function tF(e){return De("MuiPickersToolbar",e)}Ee("MuiPickersToolbar",["root","content"]);const nF=e=>{const{classes:t,isLandscape:n}=e;return _e({root:["root"],content:["content"],penIconButton:["penIconButton",n&&"penIconButtonLandscape"]},tF,t)},rF=H("div",{name:"MuiPickersToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>w({display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"space-between",padding:e.spacing(2,3)},t.isLandscape&&{height:"auto",maxWidth:160,padding:16,justifyContent:"flex-start",flexWrap:"wrap"})),oF=H("div",{name:"MuiPickersToolbar",slot:"Content",overridesResolver:(e,t)=>t.content})(({ownerState:e})=>{var t;return{display:"flex",flexWrap:"wrap",width:"100%",justifyContent:e.isLandscape?"flex-start":"space-between",flexDirection:e.isLandscape?(t=e.landscapeDirection)!=null?t:"column":"row",flex:1,alignItems:e.isLandscape?"flex-start":"center"}}),iF=b.forwardRef(function(t,n){const r=Te({props:t,name:"MuiPickersToolbar"}),{children:o,className:i,toolbarTitle:s,hidden:a,titleId:l}=r,c=r,u=nF(c);return a?null:d.jsxs(rF,{ref:n,className:le(u.root,i),ownerState:c,children:[d.jsx(Re,{color:"text.secondary",variant:"overline",id:l,children:s}),d.jsx(oF,{className:u.content,ownerState:c,children:o})]})}),sF=({open:e,onOpen:t,onClose:n})=>{const r=b.useRef(typeof e=="boolean").current,[o,i]=b.useState(!1);b.useEffect(()=>{if(r){if(typeof e!="boolean")throw new Error("You must not mix controlling and uncontrolled mode for `open` prop");i(e)}},[r,e]);const s=b.useCallback(a=>{r||i(a),a&&t&&t(),!a&&n&&n()},[r,t,n]);return{isOpen:o,setIsOpen:s}},aF=e=>{const{action:t,hasChanged:n,dateState:r,isControlled:o}=e,i=!o&&!r.hasBeenModifiedSinceMount;return t.name==="setValueFromField"?!0:t.name==="setValueFromAction"?i&&["accept","today","clear"].includes(t.pickerAction)?!0:n(r.lastPublishedValue):t.name==="setValueFromView"&&t.selectionState!=="shallow"||t.name==="setValueFromShortcut"?i?!0:n(r.lastPublishedValue):!1},lF=e=>{const{action:t,hasChanged:n,dateState:r,isControlled:o,closeOnSelect:i}=e,s=!o&&!r.hasBeenModifiedSinceMount;return t.name==="setValueFromAction"?s&&["accept","today","clear"].includes(t.pickerAction)?!0:n(r.lastCommittedValue):t.name==="setValueFromView"&&t.selectionState==="finish"&&i?s?!0:n(r.lastCommittedValue):t.name==="setValueFromShortcut"?t.changeImportance==="accept"&&n(r.lastCommittedValue):!1},cF=e=>{const{action:t,closeOnSelect:n}=e;return t.name==="setValueFromAction"?!0:t.name==="setValueFromView"?t.selectionState==="finish"&&n:t.name==="setValueFromShortcut"?t.changeImportance==="accept":!1},uF=({props:e,valueManager:t,valueType:n,wrapperVariant:r,validator:o})=>{const{onAccept:i,onChange:s,value:a,defaultValue:l,closeOnSelect:c=r==="desktop",selectedSections:u,onSelectedSectionsChange:f,timezone:p}=e,{current:x}=b.useRef(l),{current:y}=b.useRef(a!==void 0),g=ut(),k=$i(),[h,m]=bn({controlled:u,default:null,name:"usePickerValue",state:"selectedSections"}),{isOpen:v,setIsOpen:C}=sF(e),[S,E]=b.useState(()=>{let Y;return a!==void 0?Y=a:x!==void 0?Y=x:Y=t.emptyValue,{draft:Y,lastPublishedValue:Y,lastCommittedValue:Y,lastControlledValue:a,hasBeenModifiedSinceMount:!1}}),{timezone:P,handleValueChange:M}=zm({timezone:p,value:a,defaultValue:x,onChange:s,valueManager:t});yx(w({},e,{value:S.draft,timezone:P}),o,t.isSameError,t.defaultErrorState);const T=Me(Y=>{const me={action:Y,dateState:S,hasChanged:J=>!t.areValuesEqual(g,Y.value,J),isControlled:y,closeOnSelect:c},Se=aF(me),Pe=lF(me),ee=cF(me);if(E(J=>w({},J,{draft:Y.value,lastPublishedValue:Se?Y.value:J.lastPublishedValue,lastCommittedValue:Pe?Y.value:J.lastCommittedValue,hasBeenModifiedSinceMount:!0})),Se){const j={validationError:Y.name==="setValueFromField"?Y.context.validationError:o({adapter:k,value:Y.value,props:w({},e,{value:Y.value,timezone:P})})};Y.name==="setValueFromShortcut"&&Y.shortcut!=null&&(j.shortcut=Y.shortcut),M(Y.value,j)}Pe&&i&&i(Y.value),ee&&C(!1)});if(a!==void 0&&(S.lastControlledValue===void 0||!t.areValuesEqual(g,S.lastControlledValue,a))){const Y=t.areValuesEqual(g,S.draft,a);E(me=>w({},me,{lastControlledValue:a},Y?{}:{lastCommittedValue:a,lastPublishedValue:a,draft:a,hasBeenModifiedSinceMount:!0}))}const R=Me(()=>{T({value:t.emptyValue,name:"setValueFromAction",pickerAction:"clear"})}),O=Me(()=>{T({value:S.lastPublishedValue,name:"setValueFromAction",pickerAction:"accept"})}),A=Me(()=>{T({value:S.lastPublishedValue,name:"setValueFromAction",pickerAction:"dismiss"})}),$=Me(()=>{T({value:S.lastCommittedValue,name:"setValueFromAction",pickerAction:"cancel"})}),_=Me(()=>{T({value:t.getTodayValue(g,P,n),name:"setValueFromAction",pickerAction:"today"})}),D=Me(()=>C(!0)),L=Me(()=>C(!1)),V=Me((Y,me="partial")=>T({name:"setValueFromView",value:Y,selectionState:me})),I=Me((Y,me,Se)=>T({name:"setValueFromShortcut",value:Y,changeImportance:me??"accept",shortcut:Se})),F=Me((Y,me)=>T({name:"setValueFromField",value:Y,context:me})),z=Me(Y=>{m(Y),f==null||f(Y)}),ae={onClear:R,onAccept:O,onDismiss:A,onCancel:$,onSetToday:_,onOpen:D,onClose:L},re={value:S.draft,onChange:F,selectedSections:h,onSelectedSectionsChange:z},de=b.useMemo(()=>t.cleanValue(g,S.draft),[g,t,S.draft]),W={value:de,onChange:V,onClose:L,open:v,onSelectedSectionsChange:z},pe=w({},ae,{value:de,onChange:V,onSelectShortcut:I,isValid:Y=>{const me=o({adapter:k,value:Y,props:w({},e,{value:Y,timezone:P})});return!t.hasError(me)}});return{open:v,fieldProps:re,viewProps:W,layoutProps:pe,actions:ae}},dF=["className","sx"],fF=({props:e,propsFromPickerValue:t,additionalViewProps:n,inputRef:r,autoFocusView:o})=>{const{onChange:i,open:s,onSelectedSectionsChange:a,onClose:l}=t,{views:c,openTo:u,onViewChange:f,disableOpenPicker:p,viewRenderers:x,timezone:y}=e,g=Q(e,dF),{view:k,setView:h,defaultView:m,focusedView:v,setFocusedView:C,setValueAndGoToNextView:S}=ix({view:void 0,views:c,openTo:u,onChange:i,onViewChange:f,autoFocus:o}),{hasUIView:E,viewModeLookup:P}=b.useMemo(()=>c.reduce((_,D)=>{let L;return p?L="field":x[D]!=null?L="UI":L="field",_.viewModeLookup[D]=L,L==="UI"&&(_.hasUIView=!0),_},{hasUIView:!1,viewModeLookup:{}}),[p,x,c]),M=b.useMemo(()=>c.reduce((_,D)=>x[D]!=null&&ZI(D)?_+1:_,0),[x,c]),T=P[k],R=Me(()=>T==="UI"),[O,A]=b.useState(T==="UI"?k:null);return O!==k&&P[k]==="UI"&&A(k),jt(()=>{T==="field"&&s&&(l(),setTimeout(()=>{r==null||r.current.focus(),a(k)}))},[k]),jt(()=>{if(!s)return;let _=k;T==="field"&&O!=null&&(_=O),_!==m&&P[_]==="UI"&&P[m]==="UI"&&(_=m),_!==k&&h(_),C(_,!0)},[s]),{hasUIView:E,shouldRestoreFocus:R,layoutProps:{views:c,view:O,onViewChange:h},renderCurrentView:()=>{if(O==null)return null;const _=x[O];return _==null?null:_(w({},g,n,t,{views:c,timezone:y,onChange:S,view:O,onViewChange:h,focusedView:v,onFocusedViewChange:C,showViewSwitcher:M>1,timeViewsCount:M}))}}};function hv(){return typeof window>"u"?"portrait":window.screen&&window.screen.orientation&&window.screen.orientation.angle?Math.abs(window.screen.orientation.angle)===90?"landscape":"portrait":window.orientation&&Math.abs(Number(window.orientation))===90?"landscape":"portrait"}const pF=(e,t)=>{const[n,r]=b.useState(hv);return jt(()=>{const i=()=>{r(hv())};return window.addEventListener("orientationchange",i),()=>{window.removeEventListener("orientationchange",i)}},[]),D$(e,["hours","minutes","seconds"])?!1:(t||n)==="landscape"},hF=({props:e,propsFromPickerValue:t,propsFromPickerViews:n,wrapperVariant:r})=>{const{orientation:o}=e,i=pF(n.views,o);return{layoutProps:w({},n,t,{isLandscape:i,wrapperVariant:r,disabled:e.disabled,readOnly:e.readOnly})}},mF=(e,t="warning")=>{let n=!1;const r=Array.isArray(e)?e.join(` +`):e;return()=>{n||(n=!0,t==="error"?console.error(r):console.warn(r))}};mF(["The `renderInput` prop has been removed in version 6.0 of the Date and Time Pickers.","You can replace it with the `textField` component slot in most cases.","For more information, please have a look at the migration guide (https://mui.com/x/migration/migration-pickers-v5/#input-renderer-required-in-v5)."]);const bx=({props:e,valueManager:t,valueType:n,wrapperVariant:r,inputRef:o,additionalViewProps:i,validator:s,autoFocusView:a})=>{const l=uF({props:e,valueManager:t,valueType:n,wrapperVariant:r,validator:s}),c=fF({props:e,inputRef:o,additionalViewProps:i,autoFocusView:a,propsFromPickerValue:l.viewProps}),u=hF({props:e,wrapperVariant:r,propsFromPickerValue:l.layoutProps,propsFromPickerViews:c.layoutProps});return{open:l.open,actions:l.actions,fieldProps:l.fieldProps,renderCurrentView:c.renderCurrentView,hasUIView:c.hasUIView,shouldRestoreFocus:c.shouldRestoreFocus,layoutProps:u.layoutProps}};function wx(e){return De("MuiPickersLayout",e)}const qp=Ee("MuiPickersLayout",["root","landscape","contentWrapper","toolbar","actionBar","shortcuts"]),gF=["onAccept","onClear","onCancel","onSetToday","actions"];function yF(e){const{onAccept:t,onClear:n,onCancel:r,onSetToday:o,actions:i}=e,s=Q(e,gF),a=Zo();if(i==null||i.length===0)return null;const l=i==null?void 0:i.map(c=>{switch(c){case"clear":return d.jsx(Er,{onClick:n,children:a.clearButtonLabel},c);case"cancel":return d.jsx(Er,{onClick:r,children:a.cancelButtonLabel},c);case"accept":return d.jsx(Er,{onClick:t,children:a.okButtonLabel},c);case"today":return d.jsx(Er,{onClick:o,children:a.todayButtonLabel},c);default:return null}});return d.jsx(bR,w({},s,{children:l}))}const vF=["items","changeImportance","isLandscape","onChange","isValid"],xF=["getValue"];function CF(e){const{items:t,changeImportance:n,onChange:r,isValid:o}=e,i=Q(e,vF);if(t==null||t.length===0)return null;const s=t.map(a=>{let{getValue:l}=a,c=Q(a,xF);const u=l({isValid:o});return{label:c.label,onClick:()=>{r(u,n,c)},disabled:!o(u)}});return d.jsx(H6,w({dense:!0,sx:[{maxHeight:jm,maxWidth:200,overflow:"auto"},...Array.isArray(i.sx)?i.sx:[i.sx]]},i,{children:s.map(a=>d.jsx(pD,{children:d.jsx(UM,w({},a))},a.label))}))}function bF(e){return e.view!==null}const wF=e=>{const{classes:t,isLandscape:n}=e;return _e({root:["root",n&&"landscape"],contentWrapper:["contentWrapper"],toolbar:["toolbar"],actionBar:["actionBar"],tabs:["tabs"],landscape:["landscape"],shortcuts:["shortcuts"]},wx,t)},SF=e=>{var t,n;const{wrapperVariant:r,onAccept:o,onClear:i,onCancel:s,onSetToday:a,view:l,views:c,onViewChange:u,value:f,onChange:p,onSelectShortcut:x,isValid:y,isLandscape:g,disabled:k,readOnly:h,children:m,components:v,componentsProps:C,slots:S,slotProps:E}=e,P=S??hx(v),M=E??C,T=wF(e),R=(t=P==null?void 0:P.actionBar)!=null?t:yF,O=We({elementType:R,externalSlotProps:M==null?void 0:M.actionBar,additionalProps:{onAccept:o,onClear:i,onCancel:s,onSetToday:a,actions:r==="desktop"?[]:["cancel","accept"],className:T.actionBar},ownerState:w({},e,{wrapperVariant:r})}),A=d.jsx(R,w({},O)),$=P==null?void 0:P.toolbar,_=We({elementType:$,externalSlotProps:M==null?void 0:M.toolbar,additionalProps:{isLandscape:g,onChange:p,value:f,view:l,onViewChange:u,views:c,disabled:k,readOnly:h,className:T.toolbar},ownerState:w({},e,{wrapperVariant:r})}),D=bF(_)&&$?d.jsx($,w({},_)):null,L=m,V=P==null?void 0:P.tabs,I=l&&V?d.jsx(V,w({view:l,onViewChange:u},M==null?void 0:M.tabs)):null,F=(n=P==null?void 0:P.shortcuts)!=null?n:CF,z=We({elementType:F,externalSlotProps:M==null?void 0:M.shortcuts,additionalProps:{isValid:y,isLandscape:g,onChange:x,className:T.shortcuts},ownerState:{isValid:y,isLandscape:g,onChange:x,className:T.shortcuts,wrapperVariant:r}}),ae=l&&F?d.jsx(F,w({},z)):null;return{toolbar:D,content:L,tabs:I,actionBar:A,shortcuts:ae}},kF=e=>{const{isLandscape:t,classes:n}=e;return _e({root:["root",t&&"landscape"],contentWrapper:["contentWrapper"]},wx,n)},Sx=H("div",{name:"MuiPickersLayout",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>({display:"grid",gridAutoColumns:"max-content auto max-content",gridAutoRows:"max-content auto max-content",[`& .${qp.toolbar}`]:t.isLandscape?{gridColumn:e.direction==="rtl"?3:1,gridRow:"2 / 3"}:{gridColumn:"2 / 4",gridRow:1},[`.${qp.shortcuts}`]:t.isLandscape?{gridColumn:"2 / 4",gridRow:1}:{gridColumn:e.direction==="rtl"?3:1,gridRow:"2 / 3"},[`& .${qp.actionBar}`]:{gridColumn:"1 / 4",gridRow:3}}));Sx.propTypes={as:N.elementType,ownerState:N.shape({isLandscape:N.bool.isRequired}).isRequired,sx:N.oneOfType([N.arrayOf(N.oneOfType([N.func,N.object,N.bool])),N.func,N.object])};const PF=H("div",{name:"MuiPickersLayout",slot:"ContentWrapper",overridesResolver:(e,t)=>t.contentWrapper})({gridColumn:2,gridRow:2,display:"flex",flexDirection:"column"}),kx=function(t){const n=Te({props:t,name:"MuiPickersLayout"}),{toolbar:r,content:o,tabs:i,actionBar:s,shortcuts:a}=SF(n),{sx:l,className:c,isLandscape:u,ref:f,wrapperVariant:p}=n,x=n,y=kF(x);return d.jsxs(Sx,{ref:f,sx:l,className:le(c,y.root),ownerState:x,children:[u?a:r,u?r:a,d.jsx(PF,{className:y.contentWrapper,children:p==="desktop"?d.jsxs(b.Fragment,{children:[o,i]}):d.jsxs(b.Fragment,{children:[i,o]})}),s]})},EF=e=>De("MuiPickersSlideTransition",e),jn=Ee("MuiPickersSlideTransition",["root","slideEnter-left","slideEnter-right","slideEnterActive","slideExit","slideExitActiveLeft-left","slideExitActiveLeft-right"]),MF=["children","className","reduceAnimations","slideDirection","transKey","classes"],TF=e=>{const{classes:t,slideDirection:n}=e,r={root:["root"],exit:["slideExit"],enterActive:["slideEnterActive"],enter:[`slideEnter-${n}`],exitActive:[`slideExitActiveLeft-${n}`]};return _e(r,EF,t)},RF=H(Sm,{name:"MuiPickersSlideTransition",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`.${jn["slideEnter-left"]}`]:t["slideEnter-left"]},{[`.${jn["slideEnter-right"]}`]:t["slideEnter-right"]},{[`.${jn.slideEnterActive}`]:t.slideEnterActive},{[`.${jn.slideExit}`]:t.slideExit},{[`.${jn["slideExitActiveLeft-left"]}`]:t["slideExitActiveLeft-left"]},{[`.${jn["slideExitActiveLeft-right"]}`]:t["slideExitActiveLeft-right"]}]})(({theme:e})=>{const t=e.transitions.create("transform",{duration:e.transitions.duration.complex,easing:"cubic-bezier(0.35, 0.8, 0.4, 1)"});return{display:"block",position:"relative",overflowX:"hidden","& > *":{position:"absolute",top:0,right:0,left:0},[`& .${jn["slideEnter-left"]}`]:{willChange:"transform",transform:"translate(100%)",zIndex:1},[`& .${jn["slideEnter-right"]}`]:{willChange:"transform",transform:"translate(-100%)",zIndex:1},[`& .${jn.slideEnterActive}`]:{transform:"translate(0%)",transition:t},[`& .${jn.slideExit}`]:{transform:"translate(0%)"},[`& .${jn["slideExitActiveLeft-left"]}`]:{willChange:"transform",transform:"translate(-100%)",transition:t,zIndex:0},[`& .${jn["slideExitActiveLeft-right"]}`]:{willChange:"transform",transform:"translate(100%)",transition:t,zIndex:0}}});function _F(e){const t=Te({props:e,name:"MuiPickersSlideTransition"}),{children:n,className:r,reduceAnimations:o,transKey:i}=t,s=Q(t,MF),a=TF(t),l=Le();if(o)return d.jsx("div",{className:le(a.root,r),children:n});const c={exit:a.exit,enterActive:a.enterActive,enter:a.enter,exitActive:a.exitActive};return d.jsx(RF,{className:le(a.root,r),childFactory:u=>b.cloneElement(u,{classNames:c}),role:"presentation",children:d.jsx(Zk,w({mountOnEnter:!0,unmountOnExit:!0,timeout:l.transitions.duration.complex,classNames:c},s,{children:n}),i)})}const Px=({shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:o,disableFuture:i,disablePast:s,timezone:a})=>{const l=$i();return b.useCallback(c=>Ff({adapter:l,value:c,props:{shouldDisableDate:e,shouldDisableMonth:t,shouldDisableYear:n,minDate:r,maxDate:o,disableFuture:i,disablePast:s,timezone:a}})!==null,[l,e,t,n,r,o,i,s,a])},DF=e=>De("MuiDayCalendar",e);Ee("MuiDayCalendar",["root","header","weekDayLabel","loadingContainer","slideTransition","monthContainer","weekContainer","weekNumberLabel","weekNumber"]);const OF=["parentProps","day","focusableDay","selectedDays","isDateDisabled","currentMonthNumber","isViewFocused"],IF=["ownerState"],$F=e=>{const{classes:t}=e;return _e({root:["root"],header:["header"],weekDayLabel:["weekDayLabel"],loadingContainer:["loadingContainer"],slideTransition:["slideTransition"],monthContainer:["monthContainer"],weekContainer:["weekContainer"],weekNumberLabel:["weekNumberLabel"],weekNumber:["weekNumber"]},DF,t)},Ex=(Rl+Of*2)*6,FF=H("div",{name:"MuiDayCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),AF=H("div",{name:"MuiDayCalendar",slot:"Header",overridesResolver:(e,t)=>t.header})({display:"flex",justifyContent:"center",alignItems:"center"}),LF=H(Re,{name:"MuiDayCalendar",slot:"WeekDayLabel",overridesResolver:(e,t)=>t.weekDayLabel})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:(e.vars||e).palette.text.secondary})),jF=H(Re,{name:"MuiDayCalendar",slot:"WeekNumberLabel",overridesResolver:(e,t)=>t.weekNumberLabel})(({theme:e})=>({width:36,height:40,margin:"0 2px",textAlign:"center",display:"flex",justifyContent:"center",alignItems:"center",color:e.palette.text.disabled})),NF=H(Re,{name:"MuiDayCalendar",slot:"WeekNumber",overridesResolver:(e,t)=>t.weekNumber})(({theme:e})=>w({},e.typography.caption,{width:Rl,height:Rl,padding:0,margin:`0 ${Of}px`,color:e.palette.text.disabled,fontSize:"0.75rem",alignItems:"center",justifyContent:"center",display:"inline-flex"})),VF=H("div",{name:"MuiDayCalendar",slot:"LoadingContainer",overridesResolver:(e,t)=>t.loadingContainer})({display:"flex",justifyContent:"center",alignItems:"center",minHeight:Ex}),zF=H(_F,{name:"MuiDayCalendar",slot:"SlideTransition",overridesResolver:(e,t)=>t.slideTransition})({minHeight:Ex}),BF=H("div",{name:"MuiDayCalendar",slot:"MonthContainer",overridesResolver:(e,t)=>t.monthContainer})({overflow:"hidden"}),WF=H("div",{name:"MuiDayCalendar",slot:"WeekContainer",overridesResolver:(e,t)=>t.weekContainer})({margin:`${Of}px 0`,display:"flex",justifyContent:"center"});function HF(e){var t,n,r;let{parentProps:o,day:i,focusableDay:s,selectedDays:a,isDateDisabled:l,currentMonthNumber:c,isViewFocused:u}=e,f=Q(e,OF);const{disabled:p,disableHighlightToday:x,isMonthSwitchingAnimating:y,showDaysOutsideCurrentMonth:g,components:k,componentsProps:h,slots:m,slotProps:v,timezone:C}=o,S=ut(),E=tc(C),P=s!==null&&S.isSameDay(i,s),M=a.some(V=>S.isSameDay(V,i)),T=S.isSameDay(i,E),R=(t=(n=m==null?void 0:m.day)!=null?n:k==null?void 0:k.Day)!=null?t:P$,O=We({elementType:R,externalSlotProps:(r=v==null?void 0:v.day)!=null?r:h==null?void 0:h.day,additionalProps:w({disableHighlightToday:x,showDaysOutsideCurrentMonth:g,role:"gridcell",isAnimating:y,"data-timestamp":S.toJsDate(i).valueOf()},f),ownerState:w({},o,{day:i,selected:M})}),A=Q(O,IF),$=b.useMemo(()=>p||l(i),[p,l,i]),_=b.useMemo(()=>S.getMonth(i)!==c,[S,i,c]),D=b.useMemo(()=>{const V=S.startOfMonth(S.setMonth(i,c));return g?S.isSameDay(i,S.startOfWeek(V)):S.isSameDay(i,V)},[c,i,g,S]),L=b.useMemo(()=>{const V=S.endOfMonth(S.setMonth(i,c));return g?S.isSameDay(i,S.endOfWeek(V)):S.isSameDay(i,V)},[c,i,g,S]);return d.jsx(R,w({},A,{day:i,disabled:$,autoFocus:u&&P,today:T,outsideCurrentMonth:_,isFirstVisibleCell:D,isLastVisibleCell:L,selected:M,tabIndex:P?0:-1,"aria-selected":M,"aria-current":T?"date":void 0}))}function UF(e){const t=Te({props:e,name:"MuiDayCalendar"}),{onFocusedDayChange:n,className:r,currentMonth:o,selectedDays:i,focusedDay:s,loading:a,onSelectedDaysChange:l,onMonthSwitchingAnimationEnd:c,readOnly:u,reduceAnimations:f,renderLoading:p=()=>d.jsx("span",{children:"..."}),slideDirection:x,TransitionProps:y,disablePast:g,disableFuture:k,minDate:h,maxDate:m,shouldDisableDate:v,shouldDisableMonth:C,shouldDisableYear:S,dayOfWeekFormatter:E,hasFocus:P,onFocusedViewChange:M,gridLabelId:T,displayWeekNumber:R,fixedWeekNumber:O,autoFocus:A,timezone:$}=t,_=tc($),D=ut(),L=$F(t),I=Le().direction==="rtl",F=E||((se,fe)=>D.format(fe,"weekdayShort").charAt(0).toUpperCase()),z=Px({shouldDisableDate:v,shouldDisableMonth:C,shouldDisableYear:S,minDate:h,maxDate:m,disablePast:g,disableFuture:k,timezone:$}),ae=Zo(),[re,de]=bn({name:"DayCalendar",state:"hasFocus",controlled:P,default:A??!1}),[W,ne]=b.useState(()=>s||_),pe=Me(se=>{u||l(se)}),Y=se=>{z(se)||(n(se),ne(se),M==null||M(!0),de(!0))},me=Me((se,fe)=>{switch(se.key){case"ArrowUp":Y(D.addDays(fe,-7)),se.preventDefault();break;case"ArrowDown":Y(D.addDays(fe,7)),se.preventDefault();break;case"ArrowLeft":{const B=D.addDays(fe,I?1:-1),q=D.addMonths(fe,I?1:-1),we=rl({utils:D,date:B,minDate:I?B:D.startOfMonth(q),maxDate:I?D.endOfMonth(q):B,isDateDisabled:z,timezone:$});Y(we||B),se.preventDefault();break}case"ArrowRight":{const B=D.addDays(fe,I?-1:1),q=D.addMonths(fe,I?-1:1),we=rl({utils:D,date:B,minDate:I?D.startOfMonth(q):B,maxDate:I?B:D.endOfMonth(q),isDateDisabled:z,timezone:$});Y(we||B),se.preventDefault();break}case"Home":Y(D.startOfWeek(fe)),se.preventDefault();break;case"End":Y(D.endOfWeek(fe)),se.preventDefault();break;case"PageUp":Y(D.addMonths(fe,1)),se.preventDefault();break;case"PageDown":Y(D.addMonths(fe,-1)),se.preventDefault();break}}),Se=Me((se,fe)=>Y(fe)),Pe=Me((se,fe)=>{re&&D.isSameDay(W,fe)&&(M==null||M(!1))}),ee=D.getMonth(o),J=b.useMemo(()=>i.filter(se=>!!se).map(se=>D.startOfDay(se)),[D,i]),j=ee,U=b.useMemo(()=>b.createRef(),[j]),K=D.startOfWeek(_),xe=b.useMemo(()=>{const se=D.startOfMonth(o),fe=D.endOfMonth(o);return z(W)||D.isAfterDay(W,fe)||D.isBeforeDay(W,se)?rl({utils:D,date:W,minDate:se,maxDate:fe,disablePast:g,disableFuture:k,isDateDisabled:z,timezone:$}):W},[o,k,g,W,z,D,$]),Ie=b.useMemo(()=>{const se=D.setTimezone(o,$),fe=D.getWeekArray(se);let B=D.addMonths(se,1);for(;O&&fe.length{fe.length{var B;const q=D.format(se,"weekdayShort");return d.jsx(LF,{variant:"caption",role:"columnheader","aria-label":D.format(D.addDays(K,fe),"weekday"),className:L.weekDayLabel,children:(B=F==null?void 0:F(q,se))!=null?B:q},q+fe.toString())})]}),a?d.jsx(VF,{className:L.loadingContainer,children:p()}):d.jsx(zF,w({transKey:j,onExited:c,reduceAnimations:f,slideDirection:x,className:le(r,L.slideTransition)},y,{nodeRef:U,children:d.jsx(BF,{ref:U,role:"rowgroup",className:L.monthContainer,children:Ie.map((se,fe)=>d.jsxs(WF,{role:"row",className:L.weekContainer,"aria-rowindex":fe+1,children:[R&&d.jsx(NF,{className:L.weekNumber,role:"rowheader","aria-label":ae.calendarWeekNumberAriaLabelText(D.getWeekNumber(se[0])),children:ae.calendarWeekNumberText(D.getWeekNumber(se[0]))}),se.map((B,q)=>d.jsx(HF,{parentProps:t,day:B,selectedDays:J,focusableDay:xe,onKeyDown:me,onFocus:Se,onBlur:Pe,onDaySelect:pe,isDateDisabled:z,currentMonthNumber:ee,isViewFocused:re,"aria-colindex":q+1},B.toString()))]},`week-${se[0]}`))})}))]})}const YF=(e,t,n)=>(r,o)=>{switch(o.type){case"changeMonth":return w({},r,{slideDirection:o.direction,currentMonth:o.newMonth,isMonthSwitchingAnimating:!e});case"finishMonthSwitchingAnimation":return w({},r,{isMonthSwitchingAnimating:!1});case"changeFocusedDay":{if(r.focusedDay!=null&&o.focusedDay!=null&&n.isSameDay(o.focusedDay,r.focusedDay))return r;const i=o.focusedDay!=null&&!t&&!n.isSameMonth(r.currentMonth,o.focusedDay);return w({},r,{focusedDay:o.focusedDay,isMonthSwitchingAnimating:i&&!e&&!o.withoutMonthSwitchingAnimation,currentMonth:i?n.startOfMonth(o.focusedDay):r.currentMonth,slideDirection:o.focusedDay!=null&&n.isAfterDay(o.focusedDay,r.currentMonth)?"left":"right"})}default:throw new Error("missing support")}},GF=e=>{const{value:t,referenceDate:n,defaultCalendarMonth:r,disableFuture:o,disablePast:i,disableSwitchToMonthOnDayFocus:s=!1,maxDate:a,minDate:l,onMonthChange:c,reduceAnimations:u,shouldDisableDate:f,timezone:p}=e,x=tc(p),y=ut(),g=b.useRef(YF(!!u,s,y)).current,k=b.useMemo(()=>{let M=null;return n?M=n:r&&(M=y.startOfMonth(r)),co.getInitialReferenceValue({value:t,utils:y,timezone:p,props:e,referenceDate:M,granularity:Sr.day})},[]),[h,m]=b.useReducer(g,{isMonthSwitchingAnimating:!1,focusedDay:y.isValid(t)?t:x,currentMonth:y.startOfMonth(k),slideDirection:"left"}),v=b.useCallback(M=>{m(w({type:"changeMonth"},M)),c&&c(M.newMonth)},[c]),C=b.useCallback(M=>{const T=M;y.isSameMonth(T,h.currentMonth)||v({newMonth:y.startOfMonth(T),direction:y.isAfterDay(T,h.currentMonth)?"left":"right"})},[h.currentMonth,v,y]),S=Px({shouldDisableDate:f,minDate:l,maxDate:a,disableFuture:o,disablePast:i,timezone:p}),E=b.useCallback(()=>{m({type:"finishMonthSwitchingAnimation"})},[]),P=Me((M,T)=>{S(M)||m({type:"changeFocusedDay",focusedDay:M,withoutMonthSwitchingAnimation:T})});return{referenceDate:k,calendarState:h,changeMonth:C,changeFocusedDay:P,isDateDisabled:S,onMonthSwitchingAnimationEnd:E,handleChangeMonth:v}},KF=["ownerState"],ZF=({clearable:e,fieldProps:t,InputProps:n,onClear:r,slots:o,slotProps:i,components:s,componentsProps:a})=>{var l,c,u,f,p,x;const y=Zo(),g=(l=(c=o==null?void 0:o.clearButton)!=null?c:s==null?void 0:s.ClearButton)!=null?l:Qs,k=We({elementType:g,externalSlotProps:(u=i==null?void 0:i.clearButton)!=null?u:a==null?void 0:a.clearButton,ownerState:{},className:"clearButton",additionalProps:{title:y.fieldClearLabel}}),h=Q(k,KF),m=(f=(p=o==null?void 0:o.clearIcon)!=null?p:s==null?void 0:s.ClearIcon)!=null?f:jI,v=We({elementType:m,externalSlotProps:(x=i==null?void 0:i.clearIcon)!=null?x:a==null?void 0:a.clearIcon,ownerState:{}}),C=w({},n,{endAdornment:d.jsxs(b.Fragment,{children:[e&&d.jsx($m,{position:"end",sx:{marginRight:n!=null&&n.endAdornment?-1:-1.5},children:d.jsx(g,w({},h,{onClick:r,children:d.jsx(m,w({fontSize:"small"},v))}))}),n==null?void 0:n.endAdornment]})}),S=w({},t,{sx:[{"& .clearButton":{opacity:1},"@media (pointer: fine)":{"& .clearButton":{opacity:0},"&:hover, &:focus-within":{".clearButton":{opacity:1}}}},...Array.isArray(t.sx)?t.sx:[t.sx]]});return{InputProps:C,fieldProps:S}},qF=["components","componentsProps","slots","slotProps","InputProps","inputProps"],XF=["inputRef"],JF=["ref","onPaste","onKeyDown","inputMode","readOnly","clearable","onClear"],Mx=b.forwardRef(function(t,n){var r,o,i;const s=Te({props:t,name:"MuiDateField"}),{components:a,componentsProps:l,slots:c,slotProps:u,InputProps:f,inputProps:p}=s,x=Q(s,qF),y=s,g=(r=(o=c==null?void 0:c.textField)!=null?o:a==null?void 0:a.TextField)!=null?r:Df,k=We({elementType:g,externalSlotProps:(i=u==null?void 0:u.textField)!=null?i:l==null?void 0:l.textField,externalForwardedProps:x,ownerState:y}),{inputRef:h}=k,m=Q(k,XF);m.inputProps=w({},p,m.inputProps),m.InputProps=w({},f,m.InputProps);const v=V$({props:m,inputRef:h}),{ref:C,onPaste:S,onKeyDown:E,inputMode:P,readOnly:M,clearable:T,onClear:R}=v,O=Q(v,JF),{InputProps:A,fieldProps:$}=ZF({onClear:R,clearable:T,fieldProps:O,InputProps:O.InputProps,slots:c,slotProps:u,components:a,componentsProps:l});return d.jsx(g,w({ref:n},$,{InputProps:w({},A,{readOnly:M}),inputProps:w({},O.inputProps,{inputMode:P,onPaste:S,onKeyDown:E,ref:C})}))}),QF=e=>De("MuiPickersFadeTransitionGroup",e);Ee("MuiPickersFadeTransitionGroup",["root"]);const eA=e=>{const{classes:t}=e;return _e({root:["root"]},QF,t)},tA=H(Sm,{name:"MuiPickersFadeTransitionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"block",position:"relative"});function Tx(e){const t=Te({props:e,name:"MuiPickersFadeTransitionGroup"}),{children:n,className:r,reduceAnimations:o,transKey:i}=t,s=eA(t),a=Le();return o?n:d.jsx(tA,{className:le(s.root,r),children:d.jsx(ea,{appear:!1,mountOnEnter:!0,unmountOnExit:!0,timeout:{appear:a.transitions.duration.enteringScreen,enter:a.transitions.duration.enteringScreen,exit:0},children:n},i)})}function nA(e){return De("MuiPickersMonth",e)}const jc=Ee("MuiPickersMonth",["root","monthButton","disabled","selected"]),rA=["autoFocus","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","aria-label","monthsPerRow"],oA=e=>{const{disabled:t,selected:n,classes:r}=e;return _e({root:["root"],monthButton:["monthButton",t&&"disabled",n&&"selected"]},nA,r)},iA=H("div",{name:"MuiPickersMonth",slot:"Root",overridesResolver:(e,t)=>[t.root]})(({ownerState:e})=>({flexBasis:e.monthsPerRow===3?"33.3%":"25%",display:"flex",alignItems:"center",justifyContent:"center"})),sA=H("button",{name:"MuiPickersMonth",slot:"MonthButton",overridesResolver:(e,t)=>[t.monthButton,{[`&.${jc.disabled}`]:t.disabled},{[`&.${jc.selected}`]:t.selected}]})(({theme:e})=>w({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"8px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Ne(e.palette.action.active,e.palette.action.hoverOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Ne(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${jc.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${jc.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),aA=b.memo(function(t){const n=Te({props:t,name:"MuiPickersMonth"}),{autoFocus:r,children:o,disabled:i,selected:s,value:a,tabIndex:l,onClick:c,onKeyDown:u,onFocus:f,onBlur:p,"aria-current":x,"aria-label":y}=n,g=Q(n,rA),k=b.useRef(null),h=oA(n);return jt(()=>{if(r){var m;(m=k.current)==null||m.focus()}},[r]),d.jsx(iA,w({className:h.root,ownerState:n},g,{children:d.jsx(sA,{ref:k,disabled:i,type:"button",role:"radio",tabIndex:i?-1:l,"aria-current":x,"aria-checked":s,"aria-label":y,onClick:m=>c(m,a),onKeyDown:m=>u(m,a),onFocus:m=>f(m,a),onBlur:m=>p(m,a),className:h.monthButton,ownerState:n,children:o})}))});function lA(e){return De("MuiMonthCalendar",e)}Ee("MuiMonthCalendar",["root"]);const cA=["className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","shouldDisableMonth","readOnly","disableHighlightToday","autoFocus","onMonthFocus","hasFocus","onFocusedViewChange","monthsPerRow","timezone","gridLabelId"],uA=e=>{const{classes:t}=e;return _e({root:["root"]},lA,t)};function dA(e,t){const n=ut(),r=ec(),o=Te({props:e,name:t});return w({disableFuture:!1,disablePast:!1},o,{minDate:Qn(n,o.minDate,r.minDate),maxDate:Qn(n,o.maxDate,r.maxDate)})}const fA=H("div",{name:"MuiMonthCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexWrap:"wrap",alignContent:"stretch",padding:"0 4px",width:If,boxSizing:"border-box"}),pA=b.forwardRef(function(t,n){const r=dA(t,"MuiMonthCalendar"),{className:o,value:i,defaultValue:s,referenceDate:a,disabled:l,disableFuture:c,disablePast:u,maxDate:f,minDate:p,onChange:x,shouldDisableMonth:y,readOnly:g,disableHighlightToday:k,autoFocus:h=!1,onMonthFocus:m,hasFocus:v,onFocusedViewChange:C,monthsPerRow:S=3,timezone:E,gridLabelId:P}=r,M=Q(r,cA),{value:T,handleValueChange:R,timezone:O}=Bm({name:"MonthCalendar",timezone:E,value:i,defaultValue:s,onChange:x,valueManager:co}),A=tc(O),$=Js(),_=ut(),D=b.useMemo(()=>co.getInitialReferenceValue({value:T,utils:_,props:r,timezone:O,referenceDate:a,granularity:Sr.month}),[]),L=r,V=uA(L),I=b.useMemo(()=>_.getMonth(A),[_,A]),F=b.useMemo(()=>T!=null?_.getMonth(T):k?null:_.getMonth(D),[T,_,k,D]),[z,ae]=b.useState(()=>F||I),[re,de]=bn({name:"MonthCalendar",state:"hasFocus",controlled:v,default:h??!1}),W=Me(ee=>{de(ee),C&&C(ee)}),ne=b.useCallback(ee=>{const J=_.startOfMonth(u&&_.isAfter(A,p)?A:p),j=_.startOfMonth(c&&_.isBefore(A,f)?A:f),U=_.startOfMonth(ee);return _.isBefore(U,J)||_.isAfter(U,j)?!0:y?y(U):!1},[c,u,f,p,A,y,_]),pe=Me((ee,J)=>{if(g)return;const j=_.setMonth(T??D,J);R(j)}),Y=Me(ee=>{ne(_.setMonth(T??D,ee))||(ae(ee),W(!0),m&&m(ee))});b.useEffect(()=>{ae(ee=>F!==null&&ee!==F?F:ee)},[F]);const me=Me((ee,J)=>{switch(ee.key){case"ArrowUp":Y((12+J-3)%12),ee.preventDefault();break;case"ArrowDown":Y((12+J+3)%12),ee.preventDefault();break;case"ArrowLeft":Y((12+J+($.direction==="ltr"?-1:1))%12),ee.preventDefault();break;case"ArrowRight":Y((12+J+($.direction==="ltr"?1:-1))%12),ee.preventDefault();break}}),Se=Me((ee,J)=>{Y(J)}),Pe=Me((ee,J)=>{z===J&&W(!1)});return d.jsx(fA,w({ref:n,className:le(V.root,o),ownerState:L,role:"radiogroup","aria-labelledby":P},M,{children:Nm(_,T??D).map(ee=>{const J=_.getMonth(ee),j=_.format(ee,"monthShort"),U=_.format(ee,"month"),K=J===F,xe=l||ne(ee);return d.jsx(aA,{selected:K,value:J,onClick:pe,onKeyDown:me,autoFocus:re&&J===z,disabled:xe,tabIndex:J===z?0:-1,onFocus:Se,onBlur:Pe,"aria-current":I===J?"date":void 0,"aria-label":U,monthsPerRow:S,children:j},j)})}))});function hA(e){return De("MuiPickersYear",e)}const Nc=Ee("MuiPickersYear",["root","yearButton","selected","disabled"]),mA=["autoFocus","className","children","disabled","selected","value","tabIndex","onClick","onKeyDown","onFocus","onBlur","aria-current","yearsPerRow"],gA=e=>{const{disabled:t,selected:n,classes:r}=e;return _e({root:["root"],yearButton:["yearButton",t&&"disabled",n&&"selected"]},hA,r)},yA=H("div",{name:"MuiPickersYear",slot:"Root",overridesResolver:(e,t)=>[t.root]})(({ownerState:e})=>({flexBasis:e.yearsPerRow===3?"33.3%":"25%",display:"flex",alignItems:"center",justifyContent:"center"})),vA=H("button",{name:"MuiPickersYear",slot:"YearButton",overridesResolver:(e,t)=>[t.yearButton,{[`&.${Nc.disabled}`]:t.disabled},{[`&.${Nc.selected}`]:t.selected}]})(({theme:e})=>w({color:"unset",backgroundColor:"transparent",border:0,outline:0},e.typography.subtitle1,{margin:"6px 0",height:36,width:72,borderRadius:18,cursor:"pointer","&:focus":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.focusOpacity})`:Ne(e.palette.action.active,e.palette.action.focusOpacity)},"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Ne(e.palette.action.active,e.palette.action.hoverOpacity)},"&:disabled":{cursor:"auto",pointerEvents:"none"},[`&.${Nc.disabled}`]:{color:(e.vars||e).palette.text.secondary},[`&.${Nc.selected}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.main,"&:focus, &:hover":{backgroundColor:(e.vars||e).palette.primary.dark}}})),xA=b.memo(function(t){const n=Te({props:t,name:"MuiPickersYear"}),{autoFocus:r,className:o,children:i,disabled:s,selected:a,value:l,tabIndex:c,onClick:u,onKeyDown:f,onFocus:p,onBlur:x,"aria-current":y}=n,g=Q(n,mA),k=b.useRef(null),h=gA(n);return b.useEffect(()=>{r&&k.current.focus()},[r]),d.jsx(yA,w({className:le(h.root,o),ownerState:n},g,{children:d.jsx(vA,{ref:k,disabled:s,type:"button",role:"radio",tabIndex:s?-1:c,"aria-current":y,"aria-checked":a,onClick:m=>u(m,l),onKeyDown:m=>f(m,l),onFocus:m=>p(m,l),onBlur:m=>x(m,l),className:h.yearButton,ownerState:n,children:i})}))});function CA(e){return De("MuiYearCalendar",e)}Ee("MuiYearCalendar",["root"]);const bA=["autoFocus","className","value","defaultValue","referenceDate","disabled","disableFuture","disablePast","maxDate","minDate","onChange","readOnly","shouldDisableYear","disableHighlightToday","onYearFocus","hasFocus","onFocusedViewChange","yearsPerRow","timezone","gridLabelId"],wA=e=>{const{classes:t}=e;return _e({root:["root"]},CA,t)};function SA(e,t){var n;const r=ut(),o=ec(),i=Te({props:e,name:t});return w({disablePast:!1,disableFuture:!1},i,{yearsPerRow:(n=i.yearsPerRow)!=null?n:3,minDate:Qn(r,i.minDate,o.minDate),maxDate:Qn(r,i.maxDate,o.maxDate)})}const kA=H("div",{name:"MuiYearCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"row",flexWrap:"wrap",overflowY:"auto",height:"100%",padding:"0 4px",width:If,maxHeight:QI,boxSizing:"border-box",position:"relative"}),PA=b.forwardRef(function(t,n){const r=SA(t,"MuiYearCalendar"),{autoFocus:o,className:i,value:s,defaultValue:a,referenceDate:l,disabled:c,disableFuture:u,disablePast:f,maxDate:p,minDate:x,onChange:y,readOnly:g,shouldDisableYear:k,disableHighlightToday:h,onYearFocus:m,hasFocus:v,onFocusedViewChange:C,yearsPerRow:S,timezone:E,gridLabelId:P}=r,M=Q(r,bA),{value:T,handleValueChange:R,timezone:O}=Bm({name:"YearCalendar",timezone:E,value:s,defaultValue:a,onChange:y,valueManager:co}),A=tc(O),$=Js(),_=ut(),D=b.useMemo(()=>co.getInitialReferenceValue({value:T,utils:_,props:r,timezone:O,referenceDate:l,granularity:Sr.year}),[]),L=r,V=wA(L),I=b.useMemo(()=>_.getYear(A),[_,A]),F=b.useMemo(()=>T!=null?_.getYear(T):h?null:_.getYear(D),[T,_,h,D]),[z,ae]=b.useState(()=>F||I),[re,de]=bn({name:"YearCalendar",state:"hasFocus",controlled:v,default:o??!1}),W=Me(j=>{de(j),C&&C(j)}),ne=b.useCallback(j=>{if(f&&_.isBeforeYear(j,A)||u&&_.isAfterYear(j,A)||x&&_.isBeforeYear(j,x)||p&&_.isAfterYear(j,p))return!0;if(!k)return!1;const U=_.startOfYear(j);return k(U)},[u,f,p,x,A,k,_]),pe=Me((j,U)=>{if(g)return;const K=_.setYear(T??D,U);R(K)}),Y=Me(j=>{ne(_.setYear(T??D,j))||(ae(j),W(!0),m==null||m(j))});b.useEffect(()=>{ae(j=>F!==null&&j!==F?F:j)},[F]);const me=Me((j,U)=>{switch(j.key){case"ArrowUp":Y(U-S),j.preventDefault();break;case"ArrowDown":Y(U+S),j.preventDefault();break;case"ArrowLeft":Y(U+($.direction==="ltr"?-1:1)),j.preventDefault();break;case"ArrowRight":Y(U+($.direction==="ltr"?1:-1)),j.preventDefault();break}}),Se=Me((j,U)=>{Y(U)}),Pe=Me((j,U)=>{z===U&&W(!1)}),ee=b.useRef(null),J=tt(n,ee);return b.useEffect(()=>{if(o||ee.current===null)return;const j=ee.current.querySelector('[tabindex="0"]');if(!j)return;const U=j.offsetHeight,K=j.offsetTop,xe=ee.current.clientHeight,Ie=ee.current.scrollTop,se=K+U;U>xe||K{const U=_.getYear(j),K=U===F,xe=c||ne(j);return d.jsx(xA,{selected:K,value:U,onClick:pe,onKeyDown:me,autoFocus:re&&U===z,disabled:xe,tabIndex:U===z?0:-1,onFocus:Se,onBlur:Pe,"aria-current":I===U?"date":void 0,yearsPerRow:S,children:_.format(j,"year")},_.format(j,"year"))})}))}),EA=e=>De("MuiPickersCalendarHeader",e),MA=Ee("MuiPickersCalendarHeader",["root","labelContainer","label","switchViewButton","switchViewIcon"]),TA=["slots","slotProps","components","componentsProps","currentMonth","disabled","disableFuture","disablePast","maxDate","minDate","onMonthChange","onViewChange","view","reduceAnimations","views","labelId","className","timezone"],RA=["ownerState"],_A=e=>{const{classes:t}=e;return _e({root:["root"],labelContainer:["labelContainer"],label:["label"],switchViewButton:["switchViewButton"],switchViewIcon:["switchViewIcon"]},EA,t)},DA=H("div",{name:"MuiPickersCalendarHeader",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",alignItems:"center",marginTop:16,marginBottom:8,paddingLeft:24,paddingRight:12,maxHeight:30,minHeight:30}),OA=H("div",{name:"MuiPickersCalendarHeader",slot:"LabelContainer",overridesResolver:(e,t)=>t.labelContainer})(({theme:e})=>w({display:"flex",overflow:"hidden",alignItems:"center",cursor:"pointer",marginRight:"auto"},e.typography.body1,{fontWeight:e.typography.fontWeightMedium})),IA=H("div",{name:"MuiPickersCalendarHeader",slot:"Label",overridesResolver:(e,t)=>t.label})({marginRight:6}),$A=H(Qs,{name:"MuiPickersCalendarHeader",slot:"SwitchViewButton",overridesResolver:(e,t)=>t.switchViewButton})(({ownerState:e})=>w({marginRight:"auto"},e.view==="year"&&{[`.${MA.switchViewIcon}`]:{transform:"rotate(180deg)"}})),FA=H($I,{name:"MuiPickersCalendarHeader",slot:"SwitchViewIcon",overridesResolver:(e,t)=>t.switchViewIcon})(({theme:e})=>({willChange:"transform",transition:e.transitions.create("transform"),transform:"rotate(0deg)"})),AA=b.forwardRef(function(t,n){var r,o,i,s;const a=Zo(),l=ut(),c=Te({props:t,name:"MuiPickersCalendarHeader"}),{slots:u,slotProps:f,components:p,currentMonth:x,disabled:y,disableFuture:g,disablePast:k,maxDate:h,minDate:m,onMonthChange:v,onViewChange:C,view:S,reduceAnimations:E,views:P,labelId:M,className:T,timezone:R}=c,O=Q(c,TA),A=c,$=_A(c),_=(r=(o=u==null?void 0:u.switchViewButton)!=null?o:p==null?void 0:p.SwitchViewButton)!=null?r:$A,D=We({elementType:_,externalSlotProps:f==null?void 0:f.switchViewButton,additionalProps:{size:"small","aria-label":a.calendarViewSwitchingButtonAriaLabel(S)},ownerState:A,className:$.switchViewButton}),L=(i=(s=u==null?void 0:u.switchViewIcon)!=null?s:p==null?void 0:p.SwitchViewIcon)!=null?i:FA,V=We({elementType:L,externalSlotProps:f==null?void 0:f.switchViewIcon,ownerState:void 0,className:$.switchViewIcon}),I=Q(V,RA),F=()=>v(l.addMonths(x,1),"left"),z=()=>v(l.addMonths(x,-1),"right"),ae=XI(x,{disableFuture:g,maxDate:h,timezone:R}),re=JI(x,{disablePast:k,minDate:m,timezone:R}),de=()=>{if(!(P.length===1||!C||y))if(P.length===2)C(P.find(W=>W!==S)||P[0]);else{const W=P.indexOf(S)!==0?0:1;C(P[W])}};return P.length===1&&P[0]==="year"?null:d.jsxs(DA,w({},O,{ownerState:A,className:le(T,$.root),ref:n,children:[d.jsxs(OA,{role:"presentation",onClick:de,ownerState:A,"aria-live":"polite",className:$.labelContainer,children:[d.jsx(Tx,{reduceAnimations:E,transKey:l.format(x,"monthAndYear"),children:d.jsx(IA,{id:M,ownerState:A,className:$.label,children:l.format(x,"monthAndYear")})}),P.length>1&&!y&&d.jsx(_,w({},D,{children:d.jsx(L,w({},I))}))]}),d.jsx(ea,{in:S==="day",children:d.jsx(YI,{slots:u,slotProps:f,onGoToPrevious:z,isPreviousDisabled:re,previousLabel:a.previousMonth,onGoToNext:F,isNextDisabled:ae,nextLabel:a.nextMonth})})]}))}),LA=e=>De("MuiDateCalendar",e);Ee("MuiDateCalendar",["root","viewTransitionContainer"]);const jA=["autoFocus","onViewChange","value","defaultValue","referenceDate","disableFuture","disablePast","defaultCalendarMonth","onChange","onYearChange","onMonthChange","reduceAnimations","shouldDisableDate","shouldDisableMonth","shouldDisableYear","view","views","openTo","className","disabled","readOnly","minDate","maxDate","disableHighlightToday","focusedView","onFocusedViewChange","showDaysOutsideCurrentMonth","fixedWeekNumber","dayOfWeekFormatter","components","componentsProps","slots","slotProps","loading","renderLoading","displayWeekNumber","yearsPerRow","monthsPerRow","timezone"],NA=e=>{const{classes:t}=e;return _e({root:["root"],viewTransitionContainer:["viewTransitionContainer"]},LA,t)};function VA(e,t){var n,r,o,i,s,a,l;const c=ut(),u=ec(),f=Cx(),p=Te({props:e,name:t});return w({},p,{loading:(n=p.loading)!=null?n:!1,disablePast:(r=p.disablePast)!=null?r:!1,disableFuture:(o=p.disableFuture)!=null?o:!1,openTo:(i=p.openTo)!=null?i:"day",views:(s=p.views)!=null?s:["year","day"],reduceAnimations:(a=p.reduceAnimations)!=null?a:f,renderLoading:(l=p.renderLoading)!=null?l:()=>d.jsx("span",{children:"..."}),minDate:Qn(c,p.minDate,u.minDate),maxDate:Qn(c,p.maxDate,u.maxDate)})}const zA=H(e$,{name:"MuiDateCalendar",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",height:jm}),BA=H(Tx,{name:"MuiDateCalendar",slot:"ViewTransitionContainer",overridesResolver:(e,t)=>t.viewTransitionContainer})({}),WA=b.forwardRef(function(t,n){var r,o,i;const s=ut(),a=ho(),l=VA(t,"MuiDateCalendar"),{autoFocus:c,onViewChange:u,value:f,defaultValue:p,referenceDate:x,disableFuture:y,disablePast:g,defaultCalendarMonth:k,onChange:h,onYearChange:m,onMonthChange:v,reduceAnimations:C,shouldDisableDate:S,shouldDisableMonth:E,shouldDisableYear:P,view:M,views:T,openTo:R,className:O,disabled:A,readOnly:$,minDate:_,maxDate:D,disableHighlightToday:L,focusedView:V,onFocusedViewChange:I,showDaysOutsideCurrentMonth:F,fixedWeekNumber:z,dayOfWeekFormatter:ae,components:re,componentsProps:de,slots:W,slotProps:ne,loading:pe,renderLoading:Y,displayWeekNumber:me,yearsPerRow:Se,monthsPerRow:Pe,timezone:ee}=l,J=Q(l,jA),{value:j,handleValueChange:U,timezone:K}=Bm({name:"DateCalendar",timezone:ee,value:f,defaultValue:p,onChange:h,valueManager:co}),{view:xe,setView:Ie,focusedView:se,setFocusedView:fe,goToNextView:B,setValueAndGoToNextView:q}=ix({view:M,views:T,openTo:R,onChange:U,onViewChange:u,autoFocus:c,focusedView:V,onFocusedViewChange:I}),{referenceDate:we,calendarState:$e,changeFocusedDay:ke,changeMonth:Z,handleChangeMonth:he,isDateDisabled:ve,onMonthSwitchingAnimationEnd:ge}=GF({value:j,defaultCalendarMonth:k,referenceDate:x,reduceAnimations:C,onMonthChange:v,minDate:_,maxDate:D,shouldDisableDate:S,disablePast:g,disableFuture:y,timezone:K}),ye=A&&j||_,Ke=A&&j||D,Ve=`${a}-grid-label`,He=se!==null,ue=(r=(o=W==null?void 0:W.calendarHeader)!=null?o:re==null?void 0:re.CalendarHeader)!=null?r:AA,je=We({elementType:ue,externalSlotProps:(i=ne==null?void 0:ne.calendarHeader)!=null?i:de==null?void 0:de.calendarHeader,additionalProps:{views:T,view:xe,currentMonth:$e.currentMonth,onViewChange:Ie,onMonthChange:(at,dn)=>he({newMonth:at,direction:dn}),minDate:ye,maxDate:Ke,disabled:A,disablePast:g,disableFuture:y,reduceAnimations:C,timezone:K,labelId:Ve,slots:W,slotProps:ne},ownerState:l}),dt=Me(at=>{const dn=s.startOfMonth(at),Xo=s.endOfMonth(at),Ln=ve(at)?rl({utils:s,date:at,minDate:s.isBefore(_,dn)?dn:_,maxDate:s.isAfter(D,Xo)?Xo:D,disablePast:g,disableFuture:y,isDateDisabled:ve,timezone:K}):at;Ln?(q(Ln,"finish"),v==null||v(dn)):(B(),Z(dn)),ke(Ln,!0)}),wt=Me(at=>{const dn=s.startOfYear(at),Xo=s.endOfYear(at),Ln=ve(at)?rl({utils:s,date:at,minDate:s.isBefore(_,dn)?dn:_,maxDate:s.isAfter(D,Xo)?Xo:D,disablePast:g,disableFuture:y,isDateDisabled:ve,timezone:K}):at;Ln?(q(Ln,"finish"),m==null||m(Ln)):(B(),Z(dn)),ke(Ln,!0)}),vo=Me(at=>U(at&&T1(s,at,j??we),"finish",xe));b.useEffect(()=>{j!=null&&s.isValid(j)&&Z(j)},[j]);const Li=l,ia=NA(Li),ji={disablePast:g,disableFuture:y,maxDate:D,minDate:_},Ni={disableHighlightToday:L,readOnly:$,disabled:A,timezone:K,gridLabelId:Ve},qo=b.useRef(xe);b.useEffect(()=>{qo.current!==xe&&(se===qo.current&&fe(xe,!0),qo.current=xe)},[se,fe,xe]);const sa=b.useMemo(()=>[j],[j]);return d.jsxs(zA,w({ref:n,className:le(ia.root,O),ownerState:Li},J,{children:[d.jsx(ue,w({},je)),d.jsx(BA,{reduceAnimations:C,className:ia.viewTransitionContainer,transKey:xe,ownerState:Li,children:d.jsxs("div",{children:[xe==="year"&&d.jsx(PA,w({},ji,Ni,{value:j,onChange:wt,shouldDisableYear:P,hasFocus:He,onFocusedViewChange:at=>fe("year",at),yearsPerRow:Se,referenceDate:we})),xe==="month"&&d.jsx(pA,w({},ji,Ni,{hasFocus:He,className:O,value:j,onChange:dt,shouldDisableMonth:E,onFocusedViewChange:at=>fe("month",at),monthsPerRow:Pe,referenceDate:we})),xe==="day"&&d.jsx(UF,w({},$e,ji,Ni,{onMonthSwitchingAnimationEnd:ge,onFocusedDayChange:ke,reduceAnimations:C,selectedDays:sa,onSelectedDaysChange:vo,shouldDisableDate:S,shouldDisableMonth:E,shouldDisableYear:P,hasFocus:He,onFocusedViewChange:at=>fe("day",at),showDaysOutsideCurrentMonth:F,fixedWeekNumber:z,dayOfWeekFormatter:ae,displayWeekNumber:me,components:re,componentsProps:de,slots:W,slotProps:ne,loading:pe,renderLoading:Y}))]})})]}))});function HA(e){return De("MuiDatePickerToolbar",e)}Ee("MuiDatePickerToolbar",["root","title"]);const UA=["value","isLandscape","onChange","toolbarFormat","toolbarPlaceholder","views"],YA=e=>{const{classes:t}=e;return _e({root:["root"],title:["title"]},HA,t)},GA=H(iF,{name:"MuiDatePickerToolbar",slot:"Root",overridesResolver:(e,t)=>t.root})({}),KA=H(Re,{name:"MuiDatePickerToolbar",slot:"Title",overridesResolver:(e,t)=>t.title})(({ownerState:e})=>w({},e.isLandscape&&{margin:"auto 16px auto auto"})),ZA=b.forwardRef(function(t,n){const r=Te({props:t,name:"MuiDatePickerToolbar"}),{value:o,isLandscape:i,toolbarFormat:s,toolbarPlaceholder:a="––",views:l}=r,c=Q(r,UA),u=ut(),f=Zo(),p=YA(r),x=b.useMemo(()=>{if(!o)return a;const g=Vm(u,{format:s,views:l},!0);return u.formatByString(o,g)},[o,s,a,u,l]),y=r;return d.jsx(GA,w({ref:n,toolbarTitle:f.datePickerToolbarTitle,isLandscape:i,className:p.root},c,{children:d.jsx(KA,{variant:"h4",align:i?"left":"center",ownerState:y,className:p.title,children:x})}))});function Rx(e,t){var n,r,o,i;const s=ut(),a=ec(),l=Te({props:e,name:t}),c=b.useMemo(()=>{var f;return((f=l.localeText)==null?void 0:f.toolbarTitle)==null?l.localeText:w({},l.localeText,{datePickerToolbarTitle:l.localeText.toolbarTitle})},[l.localeText]),u=(n=l.slots)!=null?n:hx(l.components);return w({},l,{localeText:c},GI({views:l.views,openTo:l.openTo,defaultViews:["year","day"],defaultOpenTo:"day"}),{disableFuture:(r=l.disableFuture)!=null?r:!1,disablePast:(o=l.disablePast)!=null?o:!1,minDate:Qn(s,l.minDate,a.minDate),maxDate:Qn(s,l.maxDate,a.maxDate),slots:w({toolbar:ZA},u),slotProps:(i=l.slotProps)!=null?i:l.componentsProps})}const qA=["props","getOpenDialogAriaText"],XA=["ownerState"],JA=["ownerState"],QA=e=>{var t,n,r,o,i;let{props:s,getOpenDialogAriaText:a}=e,l=Q(e,qA);const{slots:c,slotProps:u,className:f,sx:p,format:x,formatDensity:y,timezone:g,name:k,label:h,inputRef:m,readOnly:v,disabled:C,autoFocus:S,localeText:E,reduceAnimations:P}=s,M=ut(),T=b.useRef(null),R=b.useRef(null),O=ho(),A=(t=u==null||(n=u.toolbar)==null?void 0:n.hidden)!=null?t:!1,{open:$,actions:_,hasUIView:D,layoutProps:L,renderCurrentView:V,shouldRestoreFocus:I,fieldProps:F}=bx(w({},l,{props:s,inputRef:T,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"desktop"})),z=(r=c.inputAdornment)!=null?r:$m,ae=We({elementType:z,externalSlotProps:u==null?void 0:u.inputAdornment,additionalProps:{position:"end"},ownerState:s}),re=Q(ae,XA),de=(o=c.openPickerButton)!=null?o:Qs,W=We({elementType:de,externalSlotProps:u==null?void 0:u.openPickerButton,additionalProps:{disabled:C||v,onClick:$?_.onClose:_.onOpen,"aria-label":a(F.value,M),edge:re.position},ownerState:s}),ne=Q(W,JA),pe=c.openPickerIcon,Y=c.field,me=We({elementType:Y,externalSlotProps:u==null?void 0:u.field,additionalProps:w({},F,A&&{id:O},{readOnly:v,disabled:C,className:f,sx:p,format:x,formatDensity:y,timezone:g,label:h,name:k,autoFocus:S&&!s.open,focused:$?!0:void 0}),ownerState:s});D&&(me.InputProps=w({},me.InputProps,{ref:R,[`${re.position}Adornment`]:d.jsx(z,w({},re,{children:d.jsx(de,w({},ne,{children:d.jsx(pe,w({},u==null?void 0:u.openPickerIcon))}))}))}));const Se=w({textField:c.textField,clearIcon:c.clearIcon,clearButton:c.clearButton},me.slots),Pe=(i=c.layout)!=null?i:kx,ee=tt(T,me.inputRef,m);let J=O;A&&(h?J=`${O}-label`:J=void 0);const j=w({},u,{toolbar:w({},u==null?void 0:u.toolbar,{titleId:O}),popper:w({"aria-labelledby":J},u==null?void 0:u.popper)});return{renderPicker:()=>d.jsxs(Lm,{localeText:E,children:[d.jsx(Y,w({},me,{slots:Se,slotProps:j,inputRef:ee})),d.jsx(eF,w({role:"dialog",placement:"bottom-start",anchorEl:R.current},_,{open:$,slots:c,slotProps:j,shouldRestoreFocus:I,reduceAnimations:P,children:d.jsx(Pe,w({},L,j==null?void 0:j.layout,{slots:c,slotProps:j,children:V()}))}))]})}},Ps=({view:e,onViewChange:t,views:n,focusedView:r,onFocusedViewChange:o,value:i,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:p,minDate:x,maxDate:y,shouldDisableDate:g,shouldDisableMonth:k,shouldDisableYear:h,reduceAnimations:m,onMonthChange:v,monthsPerRow:C,onYearChange:S,yearsPerRow:E,defaultCalendarMonth:P,components:M,componentsProps:T,slots:R,slotProps:O,loading:A,renderLoading:$,disableHighlightToday:_,readOnly:D,disabled:L,showDaysOutsideCurrentMonth:V,dayOfWeekFormatter:I,sx:F,autoFocus:z,fixedWeekNumber:ae,displayWeekNumber:re,timezone:de})=>d.jsx(WA,{view:e,onViewChange:t,views:n.filter(sv),focusedView:r&&sv(r)?r:null,onFocusedViewChange:o,value:i,defaultValue:s,referenceDate:a,onChange:l,className:c,classes:u,disableFuture:f,disablePast:p,minDate:x,maxDate:y,shouldDisableDate:g,shouldDisableMonth:k,shouldDisableYear:h,reduceAnimations:m,onMonthChange:v,monthsPerRow:C,onYearChange:S,yearsPerRow:E,defaultCalendarMonth:P,components:M,componentsProps:T,slots:R,slotProps:O,loading:A,renderLoading:$,disableHighlightToday:_,readOnly:D,disabled:L,showDaysOutsideCurrentMonth:V,dayOfWeekFormatter:I,sx:F,autoFocus:z,fixedWeekNumber:ae,displayWeekNumber:re,timezone:de}),_x=b.forwardRef(function(t,n){var r,o,i,s;const a=Zo(),l=ut(),c=Rx(t,"MuiDesktopDatePicker"),u=w({day:Ps,month:Ps,year:Ps},c.viewRenderers),f=w({},c,{viewRenderers:u,format:Vm(l,c,!1),yearsPerRow:(r=c.yearsPerRow)!=null?r:4,slots:w({openPickerIcon:LI,field:Mx},c.slots),slotProps:w({},c.slotProps,{field:x=>{var y;return w({},km((y=c.slotProps)==null?void 0:y.field,x),xx(c),{ref:n})},toolbar:w({hidden:!0},(o=c.slotProps)==null?void 0:o.toolbar)})}),{renderPicker:p}=QA({props:f,valueManager:co,valueType:"date",getOpenDialogAriaText:(i=(s=f.localeText)==null?void 0:s.openDatePickerDialogue)!=null?i:a.openDatePickerDialogue,validator:Ff});return p()});_x.propTypes={autoFocus:N.bool,className:N.string,closeOnSelect:N.bool,components:N.object,componentsProps:N.object,dayOfWeekFormatter:N.func,defaultCalendarMonth:N.any,defaultValue:N.any,disabled:N.bool,disableFuture:N.bool,disableHighlightToday:N.bool,disableOpenPicker:N.bool,disablePast:N.bool,displayWeekNumber:N.bool,fixedWeekNumber:N.number,format:N.string,formatDensity:N.oneOf(["dense","spacious"]),inputRef:G3,label:N.node,loading:N.bool,localeText:N.object,maxDate:N.any,minDate:N.any,monthsPerRow:N.oneOf([3,4]),name:N.string,onAccept:N.func,onChange:N.func,onClose:N.func,onError:N.func,onMonthChange:N.func,onOpen:N.func,onSelectedSectionsChange:N.func,onViewChange:N.func,onYearChange:N.func,open:N.bool,openTo:N.oneOf(["day","month","year"]),orientation:N.oneOf(["landscape","portrait"]),readOnly:N.bool,reduceAnimations:N.bool,referenceDate:N.any,renderLoading:N.func,selectedSections:N.oneOfType([N.oneOf(["all","day","hours","meridiem","minutes","month","seconds","weekDay","year"]),N.number,N.shape({endIndex:N.number.isRequired,startIndex:N.number.isRequired})]),shouldDisableDate:N.func,shouldDisableMonth:N.func,shouldDisableYear:N.func,showDaysOutsideCurrentMonth:N.bool,slotProps:N.object,slots:N.object,sx:N.oneOfType([N.arrayOf(N.oneOfType([N.func,N.object,N.bool])),N.func,N.object]),timezone:N.string,value:N.any,view:N.oneOf(["day","month","year"]),viewRenderers:N.shape({day:N.func,month:N.func,year:N.func}),views:N.arrayOf(N.oneOf(["day","month","year"]).isRequired),yearsPerRow:N.oneOf([3,4])};const eL=["props","getOpenDialogAriaText"],tL=e=>{var t,n,r;let{props:o,getOpenDialogAriaText:i}=e,s=Q(e,eL);const{slots:a,slotProps:l,className:c,sx:u,format:f,formatDensity:p,timezone:x,name:y,label:g,inputRef:k,readOnly:h,disabled:m,localeText:v}=o,C=ut(),S=b.useRef(null),E=ho(),P=(t=l==null||(n=l.toolbar)==null?void 0:n.hidden)!=null?t:!1,{open:M,actions:T,layoutProps:R,renderCurrentView:O,fieldProps:A}=bx(w({},s,{props:o,inputRef:S,autoFocusView:!0,additionalViewProps:{},wrapperVariant:"mobile"})),$=a.field,_=We({elementType:$,externalSlotProps:l==null?void 0:l.field,additionalProps:w({},A,P&&{id:E},!(m||h)&&{onClick:T.onOpen,onKeyDown:O$(T.onOpen)},{readOnly:h??!0,disabled:m,className:c,sx:u,format:f,formatDensity:p,timezone:x,label:g,name:y}),ownerState:o});_.inputProps=w({},_.inputProps,{"aria-label":i(A.value,C)});const D=w({textField:a.textField},_.slots),L=(r=a.layout)!=null?r:kx,V=tt(S,_.inputRef,k);let I=E;P&&(g?I=`${E}-label`:I=void 0);const F=w({},l,{toolbar:w({},l==null?void 0:l.toolbar,{titleId:E}),mobilePaper:w({"aria-labelledby":I},l==null?void 0:l.mobilePaper)});return{renderPicker:()=>d.jsxs(Lm,{localeText:v,children:[d.jsx($,w({},_,{slots:D,slotProps:F,inputRef:V})),d.jsx(W$,w({},T,{open:M,slots:a,slotProps:F,children:d.jsx(L,w({},R,F==null?void 0:F.layout,{slots:a,slotProps:F,children:O()}))}))]})}},Dx=b.forwardRef(function(t,n){var r,o,i;const s=Zo(),a=ut(),l=Rx(t,"MuiMobileDatePicker"),c=w({day:Ps,month:Ps,year:Ps},l.viewRenderers),u=w({},l,{viewRenderers:c,format:Vm(a,l,!1),slots:w({field:Mx},l.slots),slotProps:w({},l.slotProps,{field:p=>{var x;return w({},km((x=l.slotProps)==null?void 0:x.field,p),xx(l),{ref:n})},toolbar:w({hidden:!1},(r=l.slotProps)==null?void 0:r.toolbar)})}),{renderPicker:f}=tL({props:u,valueManager:co,valueType:"date",getOpenDialogAriaText:(o=(i=u.localeText)==null?void 0:i.openDatePickerDialogue)!=null?o:s.openDatePickerDialogue,validator:Ff});return f()});Dx.propTypes={autoFocus:N.bool,className:N.string,closeOnSelect:N.bool,components:N.object,componentsProps:N.object,dayOfWeekFormatter:N.func,defaultCalendarMonth:N.any,defaultValue:N.any,disabled:N.bool,disableFuture:N.bool,disableHighlightToday:N.bool,disableOpenPicker:N.bool,disablePast:N.bool,displayWeekNumber:N.bool,fixedWeekNumber:N.number,format:N.string,formatDensity:N.oneOf(["dense","spacious"]),inputRef:G3,label:N.node,loading:N.bool,localeText:N.object,maxDate:N.any,minDate:N.any,monthsPerRow:N.oneOf([3,4]),name:N.string,onAccept:N.func,onChange:N.func,onClose:N.func,onError:N.func,onMonthChange:N.func,onOpen:N.func,onSelectedSectionsChange:N.func,onViewChange:N.func,onYearChange:N.func,open:N.bool,openTo:N.oneOf(["day","month","year"]),orientation:N.oneOf(["landscape","portrait"]),readOnly:N.bool,reduceAnimations:N.bool,referenceDate:N.any,renderLoading:N.func,selectedSections:N.oneOfType([N.oneOf(["all","day","hours","meridiem","minutes","month","seconds","weekDay","year"]),N.number,N.shape({endIndex:N.number.isRequired,startIndex:N.number.isRequired})]),shouldDisableDate:N.func,shouldDisableMonth:N.func,shouldDisableYear:N.func,showDaysOutsideCurrentMonth:N.bool,slotProps:N.object,slots:N.object,sx:N.oneOfType([N.arrayOf(N.oneOfType([N.func,N.object,N.bool])),N.func,N.object]),timezone:N.string,value:N.any,view:N.oneOf(["day","month","year"]),viewRenderers:N.shape({day:N.func,month:N.func,year:N.func}),views:N.arrayOf(N.oneOf(["day","month","year"]).isRequired),yearsPerRow:N.oneOf([3,4])};const nL=["desktopModeMediaQuery"],rL=b.forwardRef(function(t,n){const r=Te({props:t,name:"MuiDatePicker"}),{desktopModeMediaQuery:o=I$}=r,i=Q(r,nL);return ln(o,{defaultMatches:!0})?d.jsx(_x,w({ref:n},i)):d.jsx(Dx,w({ref:n},i))});//! moment.js +//! version : 2.30.1 +//! authors : Tim Wood, Iskren Chernev, Moment.js contributors +//! license : MIT +//! momentjs.com +var Ox;function ce(){return Ox.apply(null,arguments)}function oL(e){Ox=e}function mr(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function vi(e){return e!=null&&Object.prototype.toString.call(e)==="[object Object]"}function Xe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Hm(e){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(e).length===0;var t;for(t in e)if(Xe(e,t))return!1;return!0}function fn(e){return e===void 0}function uo(e){return typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]"}function nc(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function Ix(e,t){var n=[],r,o=e.length;for(r=0;r>>0,r;for(r=0;r0)for(n=0;n=0;return(i?n?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+r}var Km=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Vc=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Jp={},Es={};function Oe(e,t,n,r){var o=r;typeof r=="string"&&(o=function(){return this[r]()}),e&&(Es[e]=o),t&&(Es[t[0]]=function(){return Ar(o.apply(this,arguments),t[1],t[2])}),n&&(Es[n]=function(){return this.localeData().ordinal(o.apply(this,arguments),e)})}function cL(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function uL(e){var t=e.match(Km),n,r;for(n=0,r=t.length;n=0&&Vc.test(e);)e=e.replace(Vc,r),Vc.lastIndex=0,n-=1;return e}var dL={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function fL(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(Km).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[e])}var pL="Invalid date";function hL(){return this._invalidDate}var mL="%d",gL=/\d{1,2}/;function yL(e){return this._ordinal.replace("%d",e)}var vL={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function xL(e,t,n,r){var o=this._relativeTime[n];return Nr(o)?o(e,t,n,r):o.replace(/%d/i,e)}function CL(e,t){var n=this._relativeTime[e>0?"future":"past"];return Nr(n)?n(t):n.replace(/%s/i,t)}var yv={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function rr(e){return typeof e=="string"?yv[e]||yv[e.toLowerCase()]:void 0}function Zm(e){var t={},n,r;for(r in e)Xe(e,r)&&(n=rr(r),n&&(t[n]=e[r]));return t}var bL={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function wL(e){var t=[],n;for(n in e)Xe(e,n)&&t.push({unit:n,priority:bL[n]});return t.sort(function(r,o){return r.priority-o.priority}),t}var Lx=/\d/,An=/\d\d/,jx=/\d{3}/,qm=/\d{4}/,Lf=/[+-]?\d{6}/,mt=/\d\d?/,Nx=/\d\d\d\d?/,Vx=/\d\d\d\d\d\d?/,jf=/\d{1,3}/,Xm=/\d{1,4}/,Nf=/[+-]?\d{1,6}/,ta=/\d+/,Vf=/[+-]?\d+/,SL=/Z|[+-]\d\d:?\d\d/gi,zf=/Z|[+-]\d\d(?::?\d\d)?/gi,kL=/[+-]?\d+(\.\d{1,3})?/,oc=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,na=/^[1-9]\d?/,Jm=/^([1-9]\d|\d)/,ud;ud={};function Ce(e,t,n){ud[e]=Nr(t)?t:function(r,o){return r&&n?n:t}}function PL(e,t){return Xe(ud,e)?ud[e](t._strict,t._locale):new RegExp(EL(e))}function EL(e){return to(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,n,r,o,i){return n||r||o||i}))}function to(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Wn(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function ze(e){var t=+e,n=0;return t!==0&&isFinite(t)&&(n=Wn(t)),n}var $1={};function st(e,t){var n,r=t,o;for(typeof e=="string"&&(e=[e]),uo(t)&&(r=function(i,s){s[t]=ze(i)}),o=e.length,n=0;n68?1900:2e3)};var zx=ra("FullYear",!0);function _L(){return Bf(this.year())}function ra(e,t){return function(n){return n!=null?(Bx(this,e,n),ce.updateOffset(this,t),this):_l(this,e)}}function _l(e,t){if(!e.isValid())return NaN;var n=e._d,r=e._isUTC;switch(t){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function Bx(e,t,n){var r,o,i,s,a;if(!(!e.isValid()||isNaN(n))){switch(r=e._d,o=e._isUTC,t){case"Milliseconds":return void(o?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(o?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(o?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(o?r.setUTCHours(n):r.setHours(n));case"Date":return void(o?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}i=n,s=e.month(),a=e.date(),a=a===29&&s===1&&!Bf(i)?28:a,o?r.setUTCFullYear(i,s,a):r.setFullYear(i,s,a)}}function DL(e){return e=rr(e),Nr(this[e])?this[e]():this}function OL(e,t){if(typeof e=="object"){e=Zm(e);var n=wL(e),r,o=n.length;for(r=0;r=0?(a=new Date(e+400,t,n,r,o,i,s),isFinite(a.getFullYear())&&a.setFullYear(e)):a=new Date(e,t,n,r,o,i,s),a}function Dl(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function dd(e,t,n){var r=7+t-n,o=(7+Dl(e,0,r).getUTCDay()-t)%7;return-o+r-1}function Kx(e,t,n,r,o){var i=(7+n-r)%7,s=dd(e,r,o),a=1+7*(t-1)+i+s,l,c;return a<=0?(l=e-1,c=ol(l)+a):a>ol(e)?(l=e+1,c=a-ol(e)):(l=e,c=a),{year:l,dayOfYear:c}}function Ol(e,t,n){var r=dd(e.year(),t,n),o=Math.floor((e.dayOfYear()-r-1)/7)+1,i,s;return o<1?(s=e.year()-1,i=o+no(s,t,n)):o>no(e.year(),t,n)?(i=o-no(e.year(),t,n),s=e.year()+1):(s=e.year(),i=o),{week:i,year:s}}function no(e,t,n){var r=dd(e,t,n),o=dd(e+1,t,n);return(ol(e)-r+o)/7}Oe("w",["ww",2],"wo","week");Oe("W",["WW",2],"Wo","isoWeek");Ce("w",mt,na);Ce("ww",mt,An);Ce("W",mt,na);Ce("WW",mt,An);ic(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=ze(e)});function UL(e){return Ol(e,this._week.dow,this._week.doy).week}var YL={dow:0,doy:6};function GL(){return this._week.dow}function KL(){return this._week.doy}function ZL(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function qL(e){var t=Ol(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}Oe("d",0,"do","day");Oe("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)});Oe("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)});Oe("dddd",0,0,function(e){return this.localeData().weekdays(this,e)});Oe("e",0,0,"weekday");Oe("E",0,0,"isoWeekday");Ce("d",mt);Ce("e",mt);Ce("E",mt);Ce("dd",function(e,t){return t.weekdaysMinRegex(e)});Ce("ddd",function(e,t){return t.weekdaysShortRegex(e)});Ce("dddd",function(e,t){return t.weekdaysRegex(e)});ic(["dd","ddd","dddd"],function(e,t,n,r){var o=n._locale.weekdaysParse(e,r,n._strict);o!=null?t.d=o:Ae(n).invalidWeekday=e});ic(["d","e","E"],function(e,t,n,r){t[r]=ze(e)});function XL(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function JL(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function eg(e,t){return e.slice(t,7).concat(e.slice(0,t))}var QL="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Zx="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),ej="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),tj=oc,nj=oc,rj=oc;function oj(e,t){var n=mr(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?eg(n,this._week.dow):e?n[e.day()]:n}function ij(e){return e===!0?eg(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function sj(e){return e===!0?eg(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function aj(e,t,n){var r,o,i,s=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)i=jr([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(i,"").toLocaleLowerCase();return n?t==="dddd"?(o=Mt.call(this._weekdaysParse,s),o!==-1?o:null):t==="ddd"?(o=Mt.call(this._shortWeekdaysParse,s),o!==-1?o:null):(o=Mt.call(this._minWeekdaysParse,s),o!==-1?o:null):t==="dddd"?(o=Mt.call(this._weekdaysParse,s),o!==-1||(o=Mt.call(this._shortWeekdaysParse,s),o!==-1)?o:(o=Mt.call(this._minWeekdaysParse,s),o!==-1?o:null)):t==="ddd"?(o=Mt.call(this._shortWeekdaysParse,s),o!==-1||(o=Mt.call(this._weekdaysParse,s),o!==-1)?o:(o=Mt.call(this._minWeekdaysParse,s),o!==-1?o:null)):(o=Mt.call(this._minWeekdaysParse,s),o!==-1||(o=Mt.call(this._weekdaysParse,s),o!==-1)?o:(o=Mt.call(this._shortWeekdaysParse,s),o!==-1?o:null))}function lj(e,t,n){var r,o,i;if(this._weekdaysParseExact)return aj.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(o=jr([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(o,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(o,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(o,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(i="^"+this.weekdays(o,"")+"|^"+this.weekdaysShort(o,"")+"|^"+this.weekdaysMin(o,""),this._weekdaysParse[r]=new RegExp(i.replace(".",""),"i")),n&&t==="dddd"&&this._fullWeekdaysParse[r].test(e))return r;if(n&&t==="ddd"&&this._shortWeekdaysParse[r].test(e))return r;if(n&&t==="dd"&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}}function cj(e){if(!this.isValid())return e!=null?this:NaN;var t=_l(this,"Day");return e!=null?(e=XL(e,this.localeData()),this.add(e-t,"d")):t}function uj(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function dj(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=JL(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function fj(e){return this._weekdaysParseExact?(Xe(this,"_weekdaysRegex")||tg.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(Xe(this,"_weekdaysRegex")||(this._weekdaysRegex=tj),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function pj(e){return this._weekdaysParseExact?(Xe(this,"_weekdaysRegex")||tg.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Xe(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=nj),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function hj(e){return this._weekdaysParseExact?(Xe(this,"_weekdaysRegex")||tg.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Xe(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=rj),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function tg(){function e(u,f){return f.length-u.length}var t=[],n=[],r=[],o=[],i,s,a,l,c;for(i=0;i<7;i++)s=jr([2e3,1]).day(i),a=to(this.weekdaysMin(s,"")),l=to(this.weekdaysShort(s,"")),c=to(this.weekdays(s,"")),t.push(a),n.push(l),r.push(c),o.push(a),o.push(l),o.push(c);t.sort(e),n.sort(e),r.sort(e),o.sort(e),this._weekdaysRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function ng(){return this.hours()%12||12}function mj(){return this.hours()||24}Oe("H",["HH",2],0,"hour");Oe("h",["hh",2],0,ng);Oe("k",["kk",2],0,mj);Oe("hmm",0,0,function(){return""+ng.apply(this)+Ar(this.minutes(),2)});Oe("hmmss",0,0,function(){return""+ng.apply(this)+Ar(this.minutes(),2)+Ar(this.seconds(),2)});Oe("Hmm",0,0,function(){return""+this.hours()+Ar(this.minutes(),2)});Oe("Hmmss",0,0,function(){return""+this.hours()+Ar(this.minutes(),2)+Ar(this.seconds(),2)});function qx(e,t){Oe(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}qx("a",!0);qx("A",!1);function Xx(e,t){return t._meridiemParse}Ce("a",Xx);Ce("A",Xx);Ce("H",mt,Jm);Ce("h",mt,na);Ce("k",mt,na);Ce("HH",mt,An);Ce("hh",mt,An);Ce("kk",mt,An);Ce("hmm",Nx);Ce("hmmss",Vx);Ce("Hmm",Nx);Ce("Hmmss",Vx);st(["H","HH"],Lt);st(["k","kk"],function(e,t,n){var r=ze(e);t[Lt]=r===24?0:r});st(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e});st(["h","hh"],function(e,t,n){t[Lt]=ze(e),Ae(n).bigHour=!0});st("hmm",function(e,t,n){var r=e.length-2;t[Lt]=ze(e.substr(0,r)),t[ur]=ze(e.substr(r)),Ae(n).bigHour=!0});st("hmmss",function(e,t,n){var r=e.length-4,o=e.length-2;t[Lt]=ze(e.substr(0,r)),t[ur]=ze(e.substr(r,2)),t[Qr]=ze(e.substr(o)),Ae(n).bigHour=!0});st("Hmm",function(e,t,n){var r=e.length-2;t[Lt]=ze(e.substr(0,r)),t[ur]=ze(e.substr(r))});st("Hmmss",function(e,t,n){var r=e.length-4,o=e.length-2;t[Lt]=ze(e.substr(0,r)),t[ur]=ze(e.substr(r,2)),t[Qr]=ze(e.substr(o))});function gj(e){return(e+"").toLowerCase().charAt(0)==="p"}var yj=/[ap]\.?m?\.?/i,vj=ra("Hours",!0);function xj(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}var Jx={calendar:aL,longDateFormat:dL,invalidDate:pL,ordinal:mL,dayOfMonthOrdinalParse:gL,relativeTime:vL,months:$L,monthsShort:Wx,week:YL,weekdays:QL,weekdaysMin:ej,weekdaysShort:Zx,meridiemParse:yj},yt={},Ea={},Il;function Cj(e,t){var n,r=Math.min(e.length,t.length);for(n=0;n0;){if(o=Wf(i.slice(0,n).join("-")),o)return o;if(r&&r.length>=n&&Cj(i,r)>=n-1)break;n--}t++}return Il}function wj(e){return!!(e&&e.match("^[^/\\\\]*$"))}function Wf(e){var t=null,n;if(yt[e]===void 0&&typeof module<"u"&&module&&module.exports&&wj(e))try{t=Il._abbr,n=require,n("./locale/"+e),No(t)}catch{yt[e]=null}return yt[e]}function No(e,t){var n;return e&&(fn(t)?n=go(e):n=rg(e,t),n?Il=n:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Il._abbr}function rg(e,t){if(t!==null){var n,r=Jx;if(t.abbr=e,yt[e]!=null)Fx("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=yt[e]._config;else if(t.parentLocale!=null)if(yt[t.parentLocale]!=null)r=yt[t.parentLocale]._config;else if(n=Wf(t.parentLocale),n!=null)r=n._config;else return Ea[t.parentLocale]||(Ea[t.parentLocale]=[]),Ea[t.parentLocale].push({name:e,config:t}),null;return yt[e]=new Gm(O1(r,t)),Ea[e]&&Ea[e].forEach(function(o){rg(o.name,o.config)}),No(e),yt[e]}else return delete yt[e],null}function Sj(e,t){if(t!=null){var n,r,o=Jx;yt[e]!=null&&yt[e].parentLocale!=null?yt[e].set(O1(yt[e]._config,t)):(r=Wf(e),r!=null&&(o=r._config),t=O1(o,t),r==null&&(t.abbr=e),n=new Gm(t),n.parentLocale=yt[e],yt[e]=n),No(e)}else yt[e]!=null&&(yt[e].parentLocale!=null?(yt[e]=yt[e].parentLocale,e===No()&&No(e)):yt[e]!=null&&delete yt[e]);return yt[e]}function go(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Il;if(!mr(e)){if(t=Wf(e),t)return t;e=[e]}return bj(e)}function kj(){return I1(yt)}function og(e){var t,n=e._a;return n&&Ae(e).overflow===-2&&(t=n[Jr]<0||n[Jr]>11?Jr:n[Pr]<1||n[Pr]>Qm(n[Qt],n[Jr])?Pr:n[Lt]<0||n[Lt]>24||n[Lt]===24&&(n[ur]!==0||n[Qr]!==0||n[pi]!==0)?Lt:n[ur]<0||n[ur]>59?ur:n[Qr]<0||n[Qr]>59?Qr:n[pi]<0||n[pi]>999?pi:-1,Ae(e)._overflowDayOfYear&&(tPr)&&(t=Pr),Ae(e)._overflowWeeks&&t===-1&&(t=TL),Ae(e)._overflowWeekday&&t===-1&&(t=RL),Ae(e).overflow=t),e}var Pj=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ej=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Mj=/Z|[+-]\d\d(?::?\d\d)?/,zc=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Qp=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Tj=/^\/?Date\((-?\d+)/i,Rj=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,_j={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Qx(e){var t,n,r=e._i,o=Pj.exec(r)||Ej.exec(r),i,s,a,l,c=zc.length,u=Qp.length;if(o){for(Ae(e).iso=!0,t=0,n=c;tol(s)||e._dayOfYear===0)&&(Ae(e)._overflowDayOfYear=!0),n=Dl(s,0,e._dayOfYear),e._a[Jr]=n.getUTCMonth(),e._a[Pr]=n.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=r[t]=o[t];for(;t<7;t++)e._a[t]=r[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[Lt]===24&&e._a[ur]===0&&e._a[Qr]===0&&e._a[pi]===0&&(e._nextDay=!0,e._a[Lt]=0),e._d=(e._useUTC?Dl:HL).apply(null,r),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Lt]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==i&&(Ae(e).weekdayMismatch=!0)}}function jj(e){var t,n,r,o,i,s,a,l,c;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(i=1,s=4,n=es(t.GG,e._a[Qt],Ol(ht(),1,4).year),r=es(t.W,1),o=es(t.E,1),(o<1||o>7)&&(l=!0)):(i=e._locale._week.dow,s=e._locale._week.doy,c=Ol(ht(),i,s),n=es(t.gg,e._a[Qt],c.year),r=es(t.w,c.week),t.d!=null?(o=t.d,(o<0||o>6)&&(l=!0)):t.e!=null?(o=t.e+i,(t.e<0||t.e>6)&&(l=!0)):o=i),r<1||r>no(n,i,s)?Ae(e)._overflowWeeks=!0:l!=null?Ae(e)._overflowWeekday=!0:(a=Kx(n,r,o,i,s),e._a[Qt]=a.year,e._dayOfYear=a.dayOfYear)}ce.ISO_8601=function(){};ce.RFC_2822=function(){};function sg(e){if(e._f===ce.ISO_8601){Qx(e);return}if(e._f===ce.RFC_2822){e7(e);return}e._a=[],Ae(e).empty=!0;var t=""+e._i,n,r,o,i,s,a=t.length,l=0,c,u;for(o=Ax(e._f,e._locale).match(Km)||[],u=o.length,n=0;n0&&Ae(e).unusedInput.push(s),t=t.slice(t.indexOf(r)+r.length),l+=r.length),Es[i]?(r?Ae(e).empty=!1:Ae(e).unusedTokens.push(i),ML(i,r,e)):e._strict&&!r&&Ae(e).unusedTokens.push(i);Ae(e).charsLeftOver=a-l,t.length>0&&Ae(e).unusedInput.push(t),e._a[Lt]<=12&&Ae(e).bigHour===!0&&e._a[Lt]>0&&(Ae(e).bigHour=void 0),Ae(e).parsedDateParts=e._a.slice(0),Ae(e).meridiem=e._meridiem,e._a[Lt]=Nj(e._locale,e._a[Lt],e._meridiem),c=Ae(e).era,c!==null&&(e._a[Qt]=e._locale.erasConvertYear(c,e._a[Qt])),ig(e),og(e)}function Nj(e,t,n){var r;return n==null?t:e.meridiemHour!=null?e.meridiemHour(t,n):(e.isPM!=null&&(r=e.isPM(n),r&&t<12&&(t+=12),!r&&t===12&&(t=0)),t)}function Vj(e){var t,n,r,o,i,s,a=!1,l=e._f.length;if(l===0){Ae(e).invalidFormat=!0,e._d=new Date(NaN);return}for(o=0;othis?this:e:Af()});function r7(e,t){var n,r;if(t.length===1&&mr(t[0])&&(t=t[0]),!t.length)return ht();for(n=t[0],r=1;rthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function aN(){if(!fn(this._isDSTShifted))return this._isDSTShifted;var e={},t;return Ym(e,this),e=t7(e),e._a?(t=e._isUTC?jr(e._a):ht(e._a),this._isDSTShifted=this.isValid()&&Jj(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function lN(){return this.isValid()?!this._isUTC:!1}function cN(){return this.isValid()?this._isUTC:!1}function i7(){return this.isValid()?this._isUTC&&this._offset===0:!1}var uN=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,dN=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function yr(e,t){var n=e,r=null,o,i,s;return yu(e)?n={ms:e._milliseconds,d:e._days,M:e._months}:uo(e)||!isNaN(+e)?(n={},t?n[t]=+e:n.milliseconds=+e):(r=uN.exec(e))?(o=r[1]==="-"?-1:1,n={y:0,d:ze(r[Pr])*o,h:ze(r[Lt])*o,m:ze(r[ur])*o,s:ze(r[Qr])*o,ms:ze(F1(r[pi]*1e3))*o}):(r=dN.exec(e))?(o=r[1]==="-"?-1:1,n={y:ei(r[2],o),M:ei(r[3],o),w:ei(r[4],o),d:ei(r[5],o),h:ei(r[6],o),m:ei(r[7],o),s:ei(r[8],o)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(s=fN(ht(n.from),ht(n.to)),n={},n.ms=s.milliseconds,n.M=s.months),i=new Hf(n),yu(e)&&Xe(e,"_locale")&&(i._locale=e._locale),yu(e)&&Xe(e,"_isValid")&&(i._isValid=e._isValid),i}yr.fn=Hf.prototype;yr.invalid=Xj;function ei(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function xv(e,t){var n={};return n.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function fN(e,t){var n;return e.isValid()&&t.isValid()?(t=lg(t,e),e.isBefore(t)?n=xv(e,t):(n=xv(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function s7(e,t){return function(n,r){var o,i;return r!==null&&!isNaN(+r)&&(Fx(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=n,n=r,r=i),o=yr(n,r),a7(this,o,e),this}}function a7(e,t,n,r){var o=t._milliseconds,i=F1(t._days),s=F1(t._months);e.isValid()&&(r=r??!0,s&&Ux(e,_l(e,"Month")+s*n),i&&Bx(e,"Date",_l(e,"Date")+i*n),o&&e._d.setTime(e._d.valueOf()+o*n),r&&ce.updateOffset(e,i||s))}var pN=s7(1,"add"),hN=s7(-1,"subtract");function l7(e){return typeof e=="string"||e instanceof String}function mN(e){return gr(e)||nc(e)||l7(e)||uo(e)||yN(e)||gN(e)||e===null||e===void 0}function gN(e){var t=vi(e)&&!Hm(e),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],o,i,s=r.length;for(o=0;on.valueOf():n.valueOf()9999?gu(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Nr(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",gu(n,"Z")):gu(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function DN(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",n,r,o,i;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),n="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",o="-MM-DD[T]HH:mm:ss.SSS",i=t+'[")]',this.format(n+r+o+i)}function ON(e){e||(e=this.isUtc()?ce.defaultFormatUtc:ce.defaultFormat);var t=gu(this,e);return this.localeData().postformat(t)}function IN(e,t){return this.isValid()&&(gr(e)&&e.isValid()||ht(e).isValid())?yr({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function $N(e){return this.from(ht(),e)}function FN(e,t){return this.isValid()&&(gr(e)&&e.isValid()||ht(e).isValid())?yr({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function AN(e){return this.to(ht(),e)}function c7(e){var t;return e===void 0?this._locale._abbr:(t=go(e),t!=null&&(this._locale=t),this)}var u7=nr("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function d7(){return this._locale}var fd=1e3,Ms=60*fd,pd=60*Ms,f7=(365*400+97)*24*pd;function Ts(e,t){return(e%t+t)%t}function p7(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-f7:new Date(e,t,n).valueOf()}function h7(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-f7:Date.UTC(e,t,n)}function LN(e){var t,n;if(e=rr(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?h7:p7,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=Ts(t+(this._isUTC?0:this.utcOffset()*Ms),pd);break;case"minute":t=this._d.valueOf(),t-=Ts(t,Ms);break;case"second":t=this._d.valueOf(),t-=Ts(t,fd);break}return this._d.setTime(t),ce.updateOffset(this,!0),this}function jN(e){var t,n;if(e=rr(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?h7:p7,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=pd-Ts(t+(this._isUTC?0:this.utcOffset()*Ms),pd)-1;break;case"minute":t=this._d.valueOf(),t+=Ms-Ts(t,Ms)-1;break;case"second":t=this._d.valueOf(),t+=fd-Ts(t,fd)-1;break}return this._d.setTime(t),ce.updateOffset(this,!0),this}function NN(){return this._d.valueOf()-(this._offset||0)*6e4}function VN(){return Math.floor(this.valueOf()/1e3)}function zN(){return new Date(this.valueOf())}function BN(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function WN(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function HN(){return this.isValid()?this.toISOString():null}function UN(){return Um(this)}function YN(){return To({},Ae(this))}function GN(){return Ae(this).overflow}function KN(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Oe("N",0,0,"eraAbbr");Oe("NN",0,0,"eraAbbr");Oe("NNN",0,0,"eraAbbr");Oe("NNNN",0,0,"eraName");Oe("NNNNN",0,0,"eraNarrow");Oe("y",["y",1],"yo","eraYear");Oe("y",["yy",2],0,"eraYear");Oe("y",["yyy",3],0,"eraYear");Oe("y",["yyyy",4],0,"eraYear");Ce("N",cg);Ce("NN",cg);Ce("NNN",cg);Ce("NNNN",iV);Ce("NNNNN",sV);st(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,r){var o=n._locale.erasParse(e,r,n._strict);o?Ae(n).era=o:Ae(n).invalidEra=e});Ce("y",ta);Ce("yy",ta);Ce("yyy",ta);Ce("yyyy",ta);Ce("yo",aV);st(["y","yy","yyy","yyyy"],Qt);st(["yo"],function(e,t,n,r){var o;n._locale._eraYearOrdinalRegex&&(o=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[Qt]=n._locale.eraYearOrdinalParse(e,o):t[Qt]=parseInt(e,10)});function ZN(e,t){var n,r,o,i=this._eras||go("en")._eras;for(n=0,r=i.length;n=0)return i[r]}function XN(e,t){var n=e.since<=e.until?1:-1;return t===void 0?ce(e.since).year():ce(e.since).year()+(t-e.offset)*n}function JN(){var e,t,n,r=this.localeData().eras();for(e=0,t=r.length;ei&&(t=i),hV.call(this,e,t,n,r,o))}function hV(e,t,n,r,o){var i=Kx(e,t,n,r,o),s=Dl(i.year,0,i.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}Oe("Q",0,"Qo","quarter");Ce("Q",Lx);st("Q",function(e,t){t[Jr]=(ze(e)-1)*3});function mV(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}Oe("D",["DD",2],"Do","date");Ce("D",mt,na);Ce("DD",mt,An);Ce("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient});st(["D","DD"],Pr);st("Do",function(e,t){t[Pr]=ze(e.match(mt)[0])});var g7=ra("Date",!0);Oe("DDD",["DDDD",3],"DDDo","dayOfYear");Ce("DDD",jf);Ce("DDDD",jx);st(["DDD","DDDD"],function(e,t,n){n._dayOfYear=ze(e)});function gV(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}Oe("m",["mm",2],0,"minute");Ce("m",mt,Jm);Ce("mm",mt,An);st(["m","mm"],ur);var yV=ra("Minutes",!1);Oe("s",["ss",2],0,"second");Ce("s",mt,Jm);Ce("ss",mt,An);st(["s","ss"],Qr);var vV=ra("Seconds",!1);Oe("S",0,0,function(){return~~(this.millisecond()/100)});Oe(0,["SS",2],0,function(){return~~(this.millisecond()/10)});Oe(0,["SSS",3],0,"millisecond");Oe(0,["SSSS",4],0,function(){return this.millisecond()*10});Oe(0,["SSSSS",5],0,function(){return this.millisecond()*100});Oe(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});Oe(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});Oe(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});Oe(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});Ce("S",jf,Lx);Ce("SS",jf,An);Ce("SSS",jf,jx);var Ro,y7;for(Ro="SSSS";Ro.length<=9;Ro+="S")Ce(Ro,ta);function xV(e,t){t[pi]=ze(("0."+e)*1e3)}for(Ro="S";Ro.length<=9;Ro+="S")st(Ro,xV);y7=ra("Milliseconds",!1);Oe("z",0,0,"zoneAbbr");Oe("zz",0,0,"zoneName");function CV(){return this._isUTC?"UTC":""}function bV(){return this._isUTC?"Coordinated Universal Time":""}var ie=rc.prototype;ie.add=pN;ie.calendar=CN;ie.clone=bN;ie.diff=TN;ie.endOf=jN;ie.format=ON;ie.from=IN;ie.fromNow=$N;ie.to=FN;ie.toNow=AN;ie.get=DL;ie.invalidAt=GN;ie.isAfter=wN;ie.isBefore=SN;ie.isBetween=kN;ie.isSame=PN;ie.isSameOrAfter=EN;ie.isSameOrBefore=MN;ie.isValid=UN;ie.lang=u7;ie.locale=c7;ie.localeData=d7;ie.max=Uj;ie.min=Hj;ie.parsingFlags=YN;ie.set=OL;ie.startOf=LN;ie.subtract=hN;ie.toArray=BN;ie.toObject=WN;ie.toDate=zN;ie.toISOString=_N;ie.inspect=DN;typeof Symbol<"u"&&Symbol.for!=null&&(ie[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});ie.toJSON=HN;ie.toString=RN;ie.unix=VN;ie.valueOf=NN;ie.creationData=KN;ie.eraName=JN;ie.eraNarrow=QN;ie.eraAbbr=eV;ie.eraYear=tV;ie.year=zx;ie.isLeapYear=_L;ie.weekYear=lV;ie.isoWeekYear=cV;ie.quarter=ie.quarters=mV;ie.month=Yx;ie.daysInMonth=zL;ie.week=ie.weeks=ZL;ie.isoWeek=ie.isoWeeks=qL;ie.weeksInYear=fV;ie.weeksInWeekYear=pV;ie.isoWeeksInYear=uV;ie.isoWeeksInISOWeekYear=dV;ie.date=g7;ie.day=ie.days=cj;ie.weekday=uj;ie.isoWeekday=dj;ie.dayOfYear=gV;ie.hour=ie.hours=vj;ie.minute=ie.minutes=yV;ie.second=ie.seconds=vV;ie.millisecond=ie.milliseconds=y7;ie.utcOffset=eN;ie.utc=nN;ie.local=rN;ie.parseZone=oN;ie.hasAlignedHourOffset=iN;ie.isDST=sN;ie.isLocal=lN;ie.isUtcOffset=cN;ie.isUtc=i7;ie.isUTC=i7;ie.zoneAbbr=CV;ie.zoneName=bV;ie.dates=nr("dates accessor is deprecated. Use date instead.",g7);ie.months=nr("months accessor is deprecated. Use month instead",Yx);ie.years=nr("years accessor is deprecated. Use year instead",zx);ie.zone=nr("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",tN);ie.isDSTShifted=nr("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",aN);function wV(e){return ht(e*1e3)}function SV(){return ht.apply(null,arguments).parseZone()}function v7(e){return e}var Je=Gm.prototype;Je.calendar=lL;Je.longDateFormat=fL;Je.invalidDate=hL;Je.ordinal=yL;Je.preparse=v7;Je.postformat=v7;Je.relativeTime=xL;Je.pastFuture=CL;Je.set=sL;Je.eras=ZN;Je.erasParse=qN;Je.erasConvertYear=XN;Je.erasAbbrRegex=rV;Je.erasNameRegex=nV;Je.erasNarrowRegex=oV;Je.months=LL;Je.monthsShort=jL;Je.monthsParse=VL;Je.monthsRegex=WL;Je.monthsShortRegex=BL;Je.week=UL;Je.firstDayOfYear=KL;Je.firstDayOfWeek=GL;Je.weekdays=oj;Je.weekdaysMin=sj;Je.weekdaysShort=ij;Je.weekdaysParse=lj;Je.weekdaysRegex=fj;Je.weekdaysShortRegex=pj;Je.weekdaysMinRegex=hj;Je.isPM=gj;Je.meridiem=xj;function hd(e,t,n,r){var o=go(),i=jr().set(r,t);return o[n](i,e)}function x7(e,t,n){if(uo(e)&&(t=e,e=void 0),e=e||"",t!=null)return hd(e,t,n,"month");var r,o=[];for(r=0;r<12;r++)o[r]=hd(e,r,n,"month");return o}function dg(e,t,n,r){typeof e=="boolean"?(uo(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,uo(t)&&(n=t,t=void 0),t=t||"");var o=go(),i=e?o._week.dow:0,s,a=[];if(n!=null)return hd(t,(n+i)%7,r,"day");for(s=0;s<7;s++)a[s]=hd(t,(s+i)%7,r,"day");return a}function kV(e,t){return x7(e,t,"months")}function PV(e,t){return x7(e,t,"monthsShort")}function EV(e,t,n){return dg(e,t,n,"weekdays")}function MV(e,t,n){return dg(e,t,n,"weekdaysShort")}function TV(e,t,n){return dg(e,t,n,"weekdaysMin")}No("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=ze(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+n}});ce.lang=nr("moment.lang is deprecated. Use moment.locale instead.",No);ce.langData=nr("moment.langData is deprecated. Use moment.localeData instead.",go);var Br=Math.abs;function RV(){var e=this._data;return this._milliseconds=Br(this._milliseconds),this._days=Br(this._days),this._months=Br(this._months),e.milliseconds=Br(e.milliseconds),e.seconds=Br(e.seconds),e.minutes=Br(e.minutes),e.hours=Br(e.hours),e.months=Br(e.months),e.years=Br(e.years),this}function C7(e,t,n,r){var o=yr(t,n);return e._milliseconds+=r*o._milliseconds,e._days+=r*o._days,e._months+=r*o._months,e._bubble()}function _V(e,t){return C7(this,e,t,1)}function DV(e,t){return C7(this,e,t,-1)}function Cv(e){return e<0?Math.floor(e):Math.ceil(e)}function OV(){var e=this._milliseconds,t=this._days,n=this._months,r=this._data,o,i,s,a,l;return e>=0&&t>=0&&n>=0||e<=0&&t<=0&&n<=0||(e+=Cv(L1(n)+t)*864e5,t=0,n=0),r.milliseconds=e%1e3,o=Wn(e/1e3),r.seconds=o%60,i=Wn(o/60),r.minutes=i%60,s=Wn(i/60),r.hours=s%24,t+=Wn(s/24),l=Wn(b7(t)),n+=l,t-=Cv(L1(l)),a=Wn(n/12),n%=12,r.days=t,r.months=n,r.years=a,this}function b7(e){return e*4800/146097}function L1(e){return e*146097/4800}function IV(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if(e=rr(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+r/864e5,n=this._months+b7(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(L1(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return t*24+r/36e5;case"minute":return t*1440+r/6e4;case"second":return t*86400+r/1e3;case"millisecond":return Math.floor(t*864e5)+r;default:throw new Error("Unknown unit "+e)}}function yo(e){return function(){return this.as(e)}}var w7=yo("ms"),$V=yo("s"),FV=yo("m"),AV=yo("h"),LV=yo("d"),jV=yo("w"),NV=yo("M"),VV=yo("Q"),zV=yo("y"),BV=w7;function WV(){return yr(this)}function HV(e){return e=rr(e),this.isValid()?this[e+"s"]():NaN}function Fi(e){return function(){return this.isValid()?this._data[e]:NaN}}var UV=Fi("milliseconds"),YV=Fi("seconds"),GV=Fi("minutes"),KV=Fi("hours"),ZV=Fi("days"),qV=Fi("months"),XV=Fi("years");function JV(){return Wn(this.days()/7)}var Yr=Math.round,hs={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function QV(e,t,n,r,o){return o.relativeTime(t||1,!!n,e,r)}function ez(e,t,n,r){var o=yr(e).abs(),i=Yr(o.as("s")),s=Yr(o.as("m")),a=Yr(o.as("h")),l=Yr(o.as("d")),c=Yr(o.as("M")),u=Yr(o.as("w")),f=Yr(o.as("y")),p=i<=n.ss&&["s",i]||i0,p[4]=r,QV.apply(null,p)}function tz(e){return e===void 0?Yr:typeof e=="function"?(Yr=e,!0):!1}function nz(e,t){return hs[e]===void 0?!1:t===void 0?hs[e]:(hs[e]=t,e==="s"&&(hs.ss=t-1),!0)}function rz(e,t){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=hs,o,i;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(n=e),typeof t=="object"&&(r=Object.assign({},hs,t),t.s!=null&&t.ss==null&&(r.ss=t.s-1)),o=this.localeData(),i=ez(this,!n,r,o),n&&(i=o.pastFuture(+this,i)),o.postformat(i)}var eh=Math.abs;function Ki(e){return(e>0)-(e<0)||+e}function Yf(){if(!this.isValid())return this.localeData().invalidDate();var e=eh(this._milliseconds)/1e3,t=eh(this._days),n=eh(this._months),r,o,i,s,a=this.asSeconds(),l,c,u,f;return a?(r=Wn(e/60),o=Wn(r/60),e%=60,r%=60,i=Wn(n/12),n%=12,s=e?e.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",c=Ki(this._months)!==Ki(a)?"-":"",u=Ki(this._days)!==Ki(a)?"-":"",f=Ki(this._milliseconds)!==Ki(a)?"-":"",l+"P"+(i?c+i+"Y":"")+(n?c+n+"M":"")+(t?u+t+"D":"")+(o||r||e?"T":"")+(o?f+o+"H":"")+(r?f+r+"M":"")+(e?f+s+"S":"")):"P0D"}var Ye=Hf.prototype;Ye.isValid=qj;Ye.abs=RV;Ye.add=_V;Ye.subtract=DV;Ye.as=IV;Ye.asMilliseconds=w7;Ye.asSeconds=$V;Ye.asMinutes=FV;Ye.asHours=AV;Ye.asDays=LV;Ye.asWeeks=jV;Ye.asMonths=NV;Ye.asQuarters=VV;Ye.asYears=zV;Ye.valueOf=BV;Ye._bubble=OV;Ye.clone=WV;Ye.get=HV;Ye.milliseconds=UV;Ye.seconds=YV;Ye.minutes=GV;Ye.hours=KV;Ye.days=ZV;Ye.weeks=JV;Ye.months=qV;Ye.years=XV;Ye.humanize=rz;Ye.toISOString=Yf;Ye.toString=Yf;Ye.toJSON=Yf;Ye.locale=c7;Ye.localeData=d7;Ye.toIsoString=nr("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Yf);Ye.lang=u7;Oe("X",0,0,"unix");Oe("x",0,0,"valueOf");Ce("x",Vf);Ce("X",kL);st("X",function(e,t,n){n._d=new Date(parseFloat(e)*1e3)});st("x",function(e,t,n){n._d=new Date(ze(e))});//! moment.js +ce.version="2.30.1";oL(ht);ce.fn=ie;ce.min=Yj;ce.max=Gj;ce.now=Kj;ce.utc=jr;ce.unix=wV;ce.months=kV;ce.isDate=nc;ce.locale=No;ce.invalid=Af;ce.duration=yr;ce.isMoment=gr;ce.weekdays=EV;ce.parseZone=SV;ce.localeData=go;ce.isDuration=yu;ce.monthsShort=PV;ce.weekdaysMin=TV;ce.defineLocale=rg;ce.updateLocale=Sj;ce.locales=kj;ce.weekdaysShort=MV;ce.normalizeUnits=rr;ce.relativeTimeRounding=tz;ce.relativeTimeThreshold=nz;ce.calendarFormat=xN;ce.prototype=ie;ce.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const oz={Y:"year",YY:"year",YYYY:{sectionType:"year",contentType:"digit",maxLength:4},M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMM:{sectionType:"month",contentType:"letter"},MMMM:{sectionType:"month",contentType:"letter"},D:{sectionType:"day",contentType:"digit",maxLength:2},DD:"day",Do:{sectionType:"day",contentType:"digit-with-letter"},E:{sectionType:"weekDay",contentType:"digit",maxLength:1},e:{sectionType:"weekDay",contentType:"digit",maxLength:1},d:{sectionType:"weekDay",contentType:"digit",maxLength:1},dd:{sectionType:"weekDay",contentType:"letter"},ddd:{sectionType:"weekDay",contentType:"letter"},dddd:{sectionType:"weekDay",contentType:"letter"},A:"meridiem",a:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},iz={year:"YYYY",month:"MMMM",monthShort:"MMM",dayOfMonth:"D",weekday:"dddd",weekdayShort:"ddd",hours24h:"HH",hours12h:"hh",meridiem:"A",minutes:"mm",seconds:"ss",fullDate:"ll",fullDateWithWeekday:"dddd, LL",keyboardDate:"L",shortDate:"MMM D",normalDate:"D MMMM",normalDateWithWeekday:"ddd, MMM D",monthAndYear:"MMMM YYYY",monthAndDate:"MMMM D",fullTime:"LT",fullTime12h:"hh:mm A",fullTime24h:"HH:mm",fullDateTime:"lll",fullDateTime12h:"ll hh:mm A",fullDateTime24h:"ll HH:mm",keyboardDateTime:"L LT",keyboardDateTime12h:"L hh:mm A",keyboardDateTime24h:"L HH:mm"},bv=["Missing timezone plugin","To be able to use timezones, you have to pass the default export from `moment-timezone` to the `dateLibInstance` prop of `LocalizationProvider`","Find more information on https://mui.com/x/react-date-pickers/timezone/#moment-and-timezone"].join(` +`);class sz{constructor({locale:t,formats:n,instance:r}={}){this.isMUIAdapter=!0,this.isTimezoneCompatible=!0,this.lib="moment",this.moment=void 0,this.locale=void 0,this.formats=void 0,this.escapedCharacters={start:"[",end:"]"},this.formatTokenMap=oz,this.setLocaleToValue=o=>{const i=this.getCurrentLocaleCode();return i===o.locale()?o:o.locale(i)},this.syncMomentLocale=o=>{var i;const s=ce.locale(),a=(i=this.locale)!=null?i:"en-us";if(s!==a){ce.locale(a);const l=o();return ce.locale(s),l}return o()},this.hasTimezonePlugin=()=>typeof this.moment.tz<"u",this.createSystemDate=o=>{const i=this.moment(o).local();return this.locale===void 0?i:i.locale(this.locale)},this.createUTCDate=o=>{const i=this.moment.utc(o);return this.locale===void 0?i:i.locale(this.locale)},this.createTZDate=(o,i)=>{if(!this.hasTimezonePlugin())throw new Error(bv);const s=i==="default"?this.moment(o):this.moment.tz(o,i);return this.locale===void 0?s:s.locale(this.locale)},this.date=o=>{if(o===null)return null;const i=this.moment(o);return i.locale(this.getCurrentLocaleCode()),i},this.dateWithTimezone=(o,i)=>o===null?null:i==="UTC"?this.createUTCDate(o):i==="system"||i==="default"&&!this.hasTimezonePlugin()?this.createSystemDate(o):this.createTZDate(o,i),this.getTimezone=o=>{var i,s,a;const l=(i=o._z)==null?void 0:i.name,c=o.isUTC()?"UTC":"system";return(s=l??((a=this.moment.defaultZone)==null?void 0:a.name))!=null?s:c},this.setTimezone=(o,i)=>{var s,a;if(this.getTimezone(o)===i)return o;if(i==="UTC")return o.clone().utc();if(i==="system")return o.clone().local();if(!this.hasTimezonePlugin()){if(i!=="default")throw new Error(bv);return o}const l=i==="default"?(s=(a=this.moment.defaultZone)==null?void 0:a.name)!=null?s:"system":i;if(l==="system")return o.clone().local();const c=o.clone();return c.tz(l),c},this.toJsDate=o=>o.toDate(),this.parseISO=o=>this.moment(o,!0),this.toISO=o=>o.toISOString(),this.parse=(o,i)=>o===""?null:this.locale?this.moment(o,i,this.locale,!0):this.moment(o,i,!0),this.getCurrentLocaleCode=()=>this.locale||ce.locale(),this.is12HourCycleInCurrentLocale=()=>/A|a/.test(ce.localeData(this.getCurrentLocaleCode()).longDateFormat("LT")),this.expandFormat=o=>{const i=/(\[[^[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})|./g;return o.match(i).map(s=>{const a=s[0];return a==="L"||a===";"?ce.localeData(this.getCurrentLocaleCode()).longDateFormat(s):s}).join("")},this.getFormatHelperText=o=>this.expandFormat(o).replace(/a/gi,"(a|p)m").toLocaleLowerCase(),this.isNull=o=>o===null,this.isValid=o=>this.moment(o).isValid(),this.format=(o,i)=>this.formatByString(o,this.formats[i]),this.formatByString=(o,i)=>{const s=o.clone();return s.locale(this.getCurrentLocaleCode()),s.format(i)},this.formatNumber=o=>o,this.getDiff=(o,i,s)=>o.diff(i,s),this.isEqual=(o,i)=>o===null&&i===null?!0:this.moment(o).isSame(i),this.isSameYear=(o,i)=>o.isSame(i,"year"),this.isSameMonth=(o,i)=>o.isSame(i,"month"),this.isSameDay=(o,i)=>o.isSame(i,"day"),this.isSameHour=(o,i)=>o.isSame(i,"hour"),this.isAfter=(o,i)=>o.isAfter(i),this.isAfterYear=(o,i)=>o.isAfter(i,"year"),this.isAfterDay=(o,i)=>o.isAfter(i,"day"),this.isBefore=(o,i)=>o.isBefore(i),this.isBeforeYear=(o,i)=>o.isBefore(i,"year"),this.isBeforeDay=(o,i)=>o.isBefore(i,"day"),this.isWithinRange=(o,[i,s])=>o.isBetween(i,s,null,"[]"),this.startOfYear=o=>o.clone().startOf("year"),this.startOfMonth=o=>o.clone().startOf("month"),this.startOfWeek=o=>o.clone().startOf("week"),this.startOfDay=o=>o.clone().startOf("day"),this.endOfYear=o=>o.clone().endOf("year"),this.endOfMonth=o=>o.clone().endOf("month"),this.endOfWeek=o=>o.clone().endOf("week"),this.endOfDay=o=>o.clone().endOf("day"),this.addYears=(o,i)=>i<0?o.clone().subtract(Math.abs(i),"years"):o.clone().add(i,"years"),this.addMonths=(o,i)=>i<0?o.clone().subtract(Math.abs(i),"months"):o.clone().add(i,"months"),this.addWeeks=(o,i)=>i<0?o.clone().subtract(Math.abs(i),"weeks"):o.clone().add(i,"weeks"),this.addDays=(o,i)=>i<0?o.clone().subtract(Math.abs(i),"days"):o.clone().add(i,"days"),this.addHours=(o,i)=>i<0?o.clone().subtract(Math.abs(i),"hours"):o.clone().add(i,"hours"),this.addMinutes=(o,i)=>i<0?o.clone().subtract(Math.abs(i),"minutes"):o.clone().add(i,"minutes"),this.addSeconds=(o,i)=>i<0?o.clone().subtract(Math.abs(i),"seconds"):o.clone().add(i,"seconds"),this.getYear=o=>o.get("year"),this.getMonth=o=>o.get("month"),this.getDate=o=>o.get("date"),this.getHours=o=>o.get("hours"),this.getMinutes=o=>o.get("minutes"),this.getSeconds=o=>o.get("seconds"),this.getMilliseconds=o=>o.get("milliseconds"),this.setYear=(o,i)=>o.clone().year(i),this.setMonth=(o,i)=>o.clone().month(i),this.setDate=(o,i)=>o.clone().date(i),this.setHours=(o,i)=>o.clone().hours(i),this.setMinutes=(o,i)=>o.clone().minutes(i),this.setSeconds=(o,i)=>o.clone().seconds(i),this.setMilliseconds=(o,i)=>o.clone().milliseconds(i),this.getDaysInMonth=o=>o.daysInMonth(),this.getNextMonth=o=>o.clone().add(1,"month"),this.getPreviousMonth=o=>o.clone().subtract(1,"month"),this.getMonthArray=o=>{const s=[this.startOfYear(o)];for(;s.length<12;){const a=s[s.length-1];s.push(this.getNextMonth(a))}return s},this.mergeDateAndTime=(o,i)=>o.clone().hour(i.hour()).minute(i.minute()).second(i.second()),this.getWeekdays=()=>this.syncMomentLocale(()=>ce.weekdaysShort(!0)),this.getWeekArray=o=>{const i=this.setLocaleToValue(o),s=i.clone().startOf("month").startOf("week"),a=i.clone().endOf("month").endOf("week");let l=0,c=s;const u=[];for(;c.isBefore(a);){const f=Math.floor(l/7);u[f]=u[f]||[],u[f].push(c),c=c.clone().add(1,"day"),l+=1}return u},this.getWeekNumber=o=>o.week(),this.getYearRange=(o,i)=>{const s=this.moment(o).startOf("year"),a=this.moment(i).endOf("year"),l=[];let c=s;for(;c.isBefore(a);)l.push(c),c=c.clone().add(1,"year");return l},this.getMeridiemText=o=>this.is12HourCycleInCurrentLocale()?ce.localeData(this.getCurrentLocaleCode()).meridiem(o==="am"?0:13,0,!1):o==="am"?"AM":"PM",this.moment=r||ce,this.locale=t,this.formats=w({},iz,n)}}function S7(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ttypeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||az,cz=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,uz=/\/\*[^]*?\*\/| +/g,wv=/\n+/g,li=(e,t)=>{let n="",r="",o="";for(let i in e){let s=e[i];i[0]=="@"?i[1]=="i"?n=i+" "+s+";":r+=i[1]=="f"?li(s,i):i+"{"+li(s,i[1]=="k"?"":t)+"}":typeof s=="object"?r+=li(s,t?t.replace(/([^,])+/g,a=>i.replace(/(^:.*)|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,a):a?a+" "+l:l)):i):s!=null&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=li.p?li.p(i,s):i+":"+s+";")}return n+(t&&o?t+"{"+o+"}":o)+r},Wr={},k7=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+k7(e[n]);return t}return e},dz=(e,t,n,r,o)=>{let i=k7(e),s=Wr[i]||(Wr[i]=(l=>{let c=0,u=11;for(;c>>0;return"go"+u})(i));if(!Wr[s]){let l=i!==e?e:(c=>{let u,f,p=[{}];for(;u=cz.exec(c.replace(uz,""));)u[4]?p.shift():u[3]?(f=u[3].replace(wv," ").trim(),p.unshift(p[0][f]=p[0][f]||{})):p[0][u[1]]=u[2].replace(wv," ").trim();return p[0]})(e);Wr[s]=li(o?{["@keyframes "+s]:l}:l,n?"":"."+s)}let a=n&&Wr.g?Wr.g:null;return n&&(Wr.g=Wr[s]),((l,c,u,f)=>{f?c.data=c.data.replace(f,l):c.data.indexOf(l)===-1&&(c.data=u?l+c.data:c.data+l)})(Wr[s],t,r,a),s},fz=(e,t,n)=>e.reduce((r,o,i)=>{let s=t[i];if(s&&s.call){let a=s(n),l=a&&a.props&&a.props.className||/^go/.test(a)&&a;s=l?"."+l:a&&typeof a=="object"?a.props?"":li(a,""):a===!1?"":a}return r+o+(s??"")},"");function fg(e){let t=this||{},n=e.call?e(t.p):e;return dz(n.unshift?n.raw?fz(n,[].slice.call(arguments,1),t.p):n.reduce((r,o)=>Object.assign(r,o&&o.call?o(t.p):o),{}):n,lz(t.target),t.g,t.o,t.k)}fg.bind({g:1});fg.bind({k:1});function Sv(e,t){for(var n=0;n=0)&&(n[o]=e[o]);return n}function kv(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var Pv=function(){return""},pz=Fe.createContext({enqueueSnackbar:Pv,closeSnackbar:Pv}),ii={downXs:"@media (max-width:599.95px)",upSm:"@media (min-width:600px)"},Ev=function(t){return t.charAt(0).toUpperCase()+t.slice(1)},pg=function(t){return""+Ev(t.vertical)+Ev(t.horizontal)},Bc=function(t){return!!t||t===0},Wc="unmounted",Zi="exited",qi="entering",Ta="entered",Mv="exiting",hg=function(e){E7(t,e);function t(r){var o;o=e.call(this,r)||this;var i=r.appear,s;return o.appearStatus=null,r.in?i?(s=Zi,o.appearStatus=qi):s=Ta:r.unmountOnExit||r.mountOnEnter?s=Wc:s=Zi,o.state={status:s},o.nextCallback=null,o}t.getDerivedStateFromProps=function(o,i){var s=o.in;return s&&i.status===Wc?{status:Zi}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var i=null;if(o!==this.props){var s=this.state.status;this.props.in?s!==qi&&s!==Ta&&(i=qi):(s===qi||s===Ta)&&(i=Mv)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,i=o,s=o;return o!=null&&typeof o!="number"&&typeof o!="string"&&(s=o.exit,i=o.enter),{exit:s,enter:i}},n.updateStatus=function(o,i){o===void 0&&(o=!1),i!==null?(this.cancelNextCallback(),i===qi?this.performEnter(o):this.performExit()):this.props.unmountOnExit&&this.state.status===Zi&&this.setState({status:Wc})},n.performEnter=function(o){var i=this,s=this.props.enter,a=o,l=this.getTimeouts();if(!o&&!s){this.safeSetState({status:Ta},function(){i.props.onEntered&&i.props.onEntered(i.node,a)});return}this.props.onEnter&&this.props.onEnter(this.node,a),this.safeSetState({status:qi},function(){i.props.onEntering&&i.props.onEntering(i.node,a),i.onTransitionEnd(l.enter,function(){i.safeSetState({status:Ta},function(){i.props.onEntered&&i.props.onEntered(i.node,a)})})})},n.performExit=function(){var o=this,i=this.props.exit,s=this.getTimeouts();if(!i){this.safeSetState({status:Zi},function(){o.props.onExited&&o.props.onExited(o.node)});return}this.props.onExit&&this.props.onExit(this.node),this.safeSetState({status:Mv},function(){o.props.onExiting&&o.props.onExiting(o.node),o.onTransitionEnd(s.exit,function(){o.safeSetState({status:Zi},function(){o.props.onExited&&o.props.onExited(o.node)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&this.nextCallback.cancel&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},n.setNextCallback=function(o){var i=this,s=!0;return this.nextCallback=function(){s&&(s=!1,i.nextCallback=null,o())},this.nextCallback.cancel=function(){s=!1},this.nextCallback},n.onTransitionEnd=function(o,i){this.setNextCallback(i);var s=o==null&&!this.props.addEndListener;if(!this.node||s){setTimeout(this.nextCallback,0);return}this.props.addEndListener&&this.props.addEndListener(this.node,this.nextCallback),o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===Wc)return null;var i=this.props,s=i.children,a=sc(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return s(o,a)},P7(t,[{key:"node",get:function(){var o,i=(o=this.props.nodeRef)===null||o===void 0?void 0:o.current;if(!i)throw new Error("notistack - Custom snackbar is not refForwarding");return i}}]),t}(Fe.Component);function Xi(){}hg.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Xi,onEntering:Xi,onEntered:Xi,onExit:Xi,onExiting:Xi,onExited:Xi};function Tv(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function j1(e,t){return b.useMemo(function(){return e==null&&t==null?null:function(n){Tv(e,n),Tv(t,n)}},[e,t])}function md(e){var t=e.timeout,n=e.style,r=n===void 0?{}:n,o=e.mode;return{duration:typeof t=="object"?t[o]||0:t,easing:r.transitionTimingFunction,delay:r.transitionDelay}}var N1={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},M7=function(t){t.scrollTop=t.scrollTop},Rv=function(t){return Math.round(t)+"ms"};function ms(e,t){e===void 0&&(e=["all"]);var n=t||{},r=n.duration,o=r===void 0?300:r,i=n.easing,s=i===void 0?N1.easeInOut:i,a=n.delay,l=a===void 0?0:a,c=Array.isArray(e)?e:[e];return c.map(function(u){var f=typeof o=="string"?o:Rv(o),p=typeof l=="string"?l:Rv(l);return u+" "+f+" "+s+" "+p}).join(",")}function hz(e){return e&&e.ownerDocument||document}function T7(e){var t=hz(e);return t.defaultView||window}function mz(e,t){t===void 0&&(t=166);var n;function r(){for(var o=this,i=arguments.length,s=new Array(i),a=0;a-1,v=k.snacks.findIndex(h)>-1;if(m||v)return k}return o.handleDisplaySnack(ot({},k,{queue:[].concat(k.queue,[g])}))}),x},o.handleDisplaySnack=function(i){var s=i.snacks;return s.length>=o.maxSnack?o.handleDismissOldest(i):o.processQueue(i)},o.processQueue=function(i){var s=i.queue,a=i.snacks;return s.length>0?ot({},i,{snacks:[].concat(a,[s[0]]),queue:s.slice(1,s.length)}):i},o.handleDismissOldest=function(i){if(i.snacks.some(function(u){return!u.open||u.requestClose}))return i;var s=!1,a=!1,l=i.snacks.reduce(function(u,f){return u+(f.open&&f.persist?1:0)},0);l===o.maxSnack&&(a=!0);var c=i.snacks.map(function(u){return!s&&(!u.persist||a)?(s=!0,u.entered?(u.onClose&&u.onClose(null,"maxsnack",u.id),o.props.onClose&&o.props.onClose(null,"maxsnack",u.id),ot({},u,{open:!1})):ot({},u,{requestClose:!0})):ot({},u)});return ot({},i,{snacks:c})},o.handleEnteredSnack=function(i,s,a){if(!Bc(a))throw new Error("handleEnteredSnack Cannot be called with undefined key");o.setState(function(l){var c=l.snacks;return{snacks:c.map(function(u){return u.id===a?ot({},u,{entered:!0}):ot({},u)})}})},o.handleCloseSnack=function(i,s,a){o.props.onClose&&o.props.onClose(i,s,a);var l=a===void 0;o.setState(function(c){var u=c.snacks,f=c.queue;return{snacks:u.map(function(p){return!l&&p.id!==a?ot({},p):p.entered?ot({},p,{open:!1}):ot({},p,{requestClose:!0})}),queue:f.filter(function(p){return p.id!==a})}})},o.closeSnackbar=function(i){var s=o.state.snacks.find(function(a){return a.id===i});Bc(i)&&s&&s.onClose&&s.onClose(null,"instructed",i),o.handleCloseSnack(null,"instructed",i)},o.handleExitedSnack=function(i,s){if(!Bc(s))throw new Error("handleExitedSnack Cannot be called with undefined key");o.setState(function(a){var l=o.processQueue(ot({},a,{snacks:a.snacks.filter(function(c){return c.id!==s})}));return l.queue.length===0?l:o.handleDismissOldest(l)})},ct=o.enqueueSnackbar,o.closeSnackbar,o.state={snacks:[],queue:[],contextValue:{enqueueSnackbar:o.enqueueSnackbar.bind(kv(o)),closeSnackbar:o.closeSnackbar.bind(kv(o))}},o}var n=t.prototype;return n.render=function(){var o=this,i=this.state.contextValue,s=this.props,a=s.domRoot,l=s.children,c=s.dense,u=c===void 0?!1:c,f=s.Components,p=f===void 0?{}:f,x=s.classes,y=this.state.snacks.reduce(function(k,h){var m,v=pg(h.anchorOrigin),C=k[v]||[];return ot({},k,(m={},m[v]=[].concat(C,[h]),m))},{}),g=Object.keys(y).map(function(k){var h=y[k],m=h[0];return Fe.createElement(Fz,{key:k,dense:u,anchorOrigin:m.anchorOrigin,classes:x},h.map(function(v){return Fe.createElement(Iz,{key:v.id,snack:v,classes:x,Component:p[v.variant],onClose:o.handleCloseSnack,onEnter:o.props.onEnter,onExit:o.props.onExit,onExited:il([o.handleExitedSnack,o.props.onExited],v.id),onEntered:il([o.handleEnteredSnack,o.props.onEntered],v.id)})}))});return Fe.createElement(pz.Provider,{value:i},l,a?Ul.createPortal(g,a):g)},P7(t,[{key:"maxSnack",get:function(){return this.props.maxSnack||xi.maxSnack}}]),t}(b.Component),$7={exports:{}},F7={};/** + * @license React + * use-sync-external-store-shim.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Hs=b;function Lz(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var jz=typeof Object.is=="function"?Object.is:Lz,Nz=Hs.useState,Vz=Hs.useEffect,zz=Hs.useLayoutEffect,Bz=Hs.useDebugValue;function Wz(e,t){var n=t(),r=Nz({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return zz(function(){o.value=n,o.getSnapshot=t,ah(o)&&i({inst:o})},[e,n,t]),Vz(function(){return ah(o)&&i({inst:o}),e(function(){ah(o)&&i({inst:o})})},[e]),Bz(n),n}function ah(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!jz(e,n)}catch{return!0}}function Hz(e,t){return t()}var Uz=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Hz:Wz;F7.useSyncExternalStore=Hs.useSyncExternalStore!==void 0?Hs.useSyncExternalStore:Uz;$7.exports=F7;var A7=$7.exports;const _o=()=>{},sn=_o(),xu=Object,qe=e=>e===sn,Mr=e=>typeof e=="function",fo=(e,t)=>({...e,...t}),Yz=e=>Mr(e.then),Kc=new WeakMap;let Gz=0;const $l=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let o,i;if(xu(e)===e&&!r&&n!=RegExp){if(o=Kc.get(e),o)return o;if(o=++Gz+"~",Kc.set(e,o),n==Array){for(o="@",i=0;iKf&&typeof window.requestAnimationFrame!=mg,L7=(e,t)=>{const n=Zr.get(e);return[()=>!qe(t)&&e.get(t)||lh,r=>{if(!qe(t)){const o=e.get(t);t in Zc||(Zc[t]=o),n[5](t,fo(o,r),o||lh)}},n[6],()=>!qe(t)&&t in Zc?Zc[t]:!qe(t)&&e.get(t)||lh]};let z1=!0;const Zz=()=>z1,[B1,W1]=Kf&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[_o,_o],qz=()=>{const e=V1&&document.visibilityState;return qe(e)||e!=="hidden"},Xz=e=>(V1&&document.addEventListener("visibilitychange",e),B1("focus",e),()=>{V1&&document.removeEventListener("visibilitychange",e),W1("focus",e)}),Jz=e=>{const t=()=>{z1=!0,e()},n=()=>{z1=!1};return B1("online",t),B1("offline",n),()=>{W1("online",t),W1("offline",n)}},Qz={isOnline:Zz,isVisible:qz},eB={initFocus:Xz,initReconnect:Jz},Av=!Fe.useId,Fl=!Kf||"Deno"in window,tB=e=>Kz()?window.requestAnimationFrame(e):setTimeout(e,1),Cu=Fl?b.useEffect:b.useLayoutEffect,ch=typeof navigator<"u"&&navigator.connection,Lv=!Fl&&ch&&(["slow-2g","2g"].includes(ch.effectiveType)||ch.saveData),gg=e=>{if(Mr(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?$l(e):"",[e,t]};let nB=0;const H1=()=>++nB,j7=0,N7=1,V7=2,rB=3;var Da={__proto__:null,ERROR_REVALIDATE_EVENT:rB,FOCUS_EVENT:j7,MUTATE_EVENT:V7,RECONNECT_EVENT:N7};async function z7(...e){const[t,n,r,o]=e,i=fo({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let s=i.populateCache;const a=i.rollbackOnError;let l=i.optimisticData;const c=i.revalidate!==!1,u=x=>typeof a=="function"?a(x):a!==!1,f=i.throwOnError;if(Mr(n)){const x=n,y=[],g=t.keys();for(const k of g)!/^\$(inf|sub)\$/.test(k)&&x(t.get(k)._k)&&y.push(k);return Promise.all(y.map(p))}return p(n);async function p(x){const[y]=gg(x);if(!y)return;const[g,k]=L7(t,y),[h,m,v,C]=Zr.get(t),S=()=>{const _=h[y];return c&&(delete v[y],delete C[y],_&&_[0])?_[0](V7).then(()=>g().data):g().data};if(e.length<3)return S();let E=r,P;const M=H1();m[y]=[M,0];const T=!qe(l),R=g(),O=R.data,A=R._c,$=qe(A)?O:A;if(T&&(l=Mr(l)?l($,O):l,k({data:l,_c:$})),Mr(E))try{E=E($)}catch(_){P=_}if(E&&Yz(E))if(E=await E.catch(_=>{P=_}),M!==m[y][0]){if(P)throw P;return E}else P&&T&&u(P)&&(s=!0,k({data:$,_c:sn}));if(s&&!P)if(Mr(s)){const _=s(E,$);k({data:_,error:sn,_c:sn})}else k({data:E,error:sn,_c:sn});if(m[y][1]=H1(),Promise.resolve(S()).then(()=>{k({_c:sn})}),P){if(f)throw P;return}return E}}const jv=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},B7=(e,t)=>{if(!Zr.has(e)){const n=fo(eB,t),r={},o=z7.bind(sn,e);let i=_o;const s={},a=(u,f)=>{const p=s[u]||[];return s[u]=p,p.push(f),()=>p.splice(p.indexOf(f),1)},l=(u,f,p)=>{e.set(u,f);const x=s[u];if(x)for(const y of x)y(f,p)},c=()=>{if(!Zr.has(e)&&(Zr.set(e,[r,{},{},{},o,l,a]),!Fl)){const u=n.initFocus(setTimeout.bind(sn,jv.bind(sn,r,j7))),f=n.initReconnect(setTimeout.bind(sn,jv.bind(sn,r,N7)));i=()=>{u&&u(),f&&f(),Zr.delete(e)}}};return c(),[e,o,c,i]}return[e,Zr.get(e)[4]]},oB=(e,t,n,r,o)=>{const i=n.errorRetryCount,s=o.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!qe(i)&&s>i||setTimeout(r,a,o)},iB=(e,t)=>$l(e)==$l(t),[yg,sB]=B7(new Map),W7=fo({onLoadingSlow:_o,onSuccess:_o,onError:_o,onErrorRetry:oB,onDiscarded:_o,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Lv?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:Lv?5e3:3e3,compare:iB,isPaused:()=>!1,cache:yg,mutate:sB,fallback:{}},Qz),H7=(e,t)=>{const n=fo(e,t);if(t){const{use:r,fallback:o}=e,{use:i,fallback:s}=t;r&&i&&(n.use=r.concat(i)),o&&s&&(n.fallback=fo(o,s))}return n},U1=b.createContext({}),aB=e=>{const{value:t}=e,n=b.useContext(U1),r=Mr(t),o=b.useMemo(()=>r?t(n):t,[r,n,t]),i=b.useMemo(()=>r?o:H7(n,o),[r,n,o]),s=o&&o.provider,a=b.useRef(sn);s&&!a.current&&(a.current=B7(s(i.cache||yg),o));const l=a.current;return l&&(i.cache=l[0],i.mutate=l[1]),Cu(()=>{if(l)return l[2]&&l[2](),l[3]},[]),b.createElement(U1.Provider,fo(e,{value:i}))},lB="$inf$",U7=Kf&&window.__SWR_DEVTOOLS_USE__,cB=U7?window.__SWR_DEVTOOLS_USE__:[],uB=()=>{U7&&(window.__SWR_DEVTOOLS_REACT__=Fe)},dB=e=>Mr(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],fB=()=>fo(W7,b.useContext(U1)),pB=e=>(t,n,r)=>e(t,n&&((...i)=>{const[s]=gg(t),[,,,a]=Zr.get(yg);if(s.startsWith(lB))return n(...i);const l=a[s];return qe(l)?n(...i):(delete a[s],l)}),r),hB=cB.concat(pB),mB=e=>function(...n){const r=fB(),[o,i,s]=dB(n),a=H7(r,s);let l=e;const{use:c}=a,u=(c||[]).concat(hB);for(let f=u.length;f--;)l=u[f](l);return l(o,i||a.fetcher||null,a)},gB=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const o=r.indexOf(n);o>=0&&(r[o]=r[r.length-1],r.pop())}};uB();const Nv=Fe.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)}),uh={dedupe:!0},yB=(e,t,n)=>{const{cache:r,compare:o,suspense:i,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:u,refreshWhenOffline:f,keepPreviousData:p}=n,[x,y,g,k]=Zr.get(r),[h,m]=gg(e),v=b.useRef(!1),C=b.useRef(!1),S=b.useRef(h),E=b.useRef(t),P=b.useRef(n),M=()=>P.current,T=()=>M().isVisible()&&M().isOnline(),[R,O,A,$]=L7(r,h),_=b.useRef({}).current,D=qe(s)?n.fallback[h]:s,L=(J,j)=>{for(const U in _){const K=U;if(K==="data"){if(!o(J[K],j[K])&&(!qe(J[K])||!o(ne,j[K])))return!1}else if(j[K]!==J[K])return!1}return!0},V=b.useMemo(()=>{const J=!h||!t?!1:qe(a)?M().isPaused()||i?!1:qe(l)?!0:l:a,j=fe=>{const B=fo(fe);return delete B._k,J?{isValidating:!0,isLoading:!0,...B}:B},U=R(),K=$(),xe=j(U),Ie=U===K?xe:j(K);let se=xe;return[()=>{const fe=j(R());return L(fe,se)?(se.data=fe.data,se.isLoading=fe.isLoading,se.isValidating=fe.isValidating,se.error=fe.error,se):(se=fe,fe)},()=>Ie]},[r,h]),I=A7.useSyncExternalStore(b.useCallback(J=>A(h,(j,U)=>{L(U,j)||J()}),[r,h]),V[0],V[1]),F=!v.current,z=x[h]&&x[h].length>0,ae=I.data,re=qe(ae)?D:ae,de=I.error,W=b.useRef(re),ne=p?qe(ae)?W.current:ae:re,pe=z&&!qe(de)?!1:F&&!qe(a)?a:M().isPaused()?!1:i?qe(re)?!1:l:qe(re)||l,Y=!!(h&&t&&F&&pe),me=qe(I.isValidating)?Y:I.isValidating,Se=qe(I.isLoading)?Y:I.isLoading,Pe=b.useCallback(async J=>{const j=E.current;if(!h||!j||C.current||M().isPaused())return!1;let U,K,xe=!0;const Ie=J||{},se=!g[h]||!Ie.dedupe,fe=()=>Av?!C.current&&h===S.current&&v.current:h===S.current,B={isValidating:!1,isLoading:!1},q=()=>{O(B)},we=()=>{const ke=g[h];ke&&ke[1]===K&&delete g[h]},$e={isValidating:!0};qe(R().data)&&($e.isLoading=!0);try{if(se&&(O($e),n.loadingTimeout&&qe(R().data)&&setTimeout(()=>{xe&&fe()&&M().onLoadingSlow(h,n)},n.loadingTimeout),g[h]=[j(m),H1()]),[U,K]=g[h],U=await U,se&&setTimeout(we,n.dedupingInterval),!g[h]||g[h][1]!==K)return se&&fe()&&M().onDiscarded(h),!1;B.error=sn;const ke=y[h];if(!qe(ke)&&(K<=ke[0]||K<=ke[1]||ke[1]===0))return q(),se&&fe()&&M().onDiscarded(h),!1;const Z=R().data;B.data=o(Z,U)?Z:U,se&&fe()&&M().onSuccess(U,h,n)}catch(ke){we();const Z=M(),{shouldRetryOnError:he}=Z;Z.isPaused()||(B.error=ke,se&&fe()&&(Z.onError(ke,h,Z),(he===!0||Mr(he)&&he(ke))&&T()&&Z.onErrorRetry(ke,h,Z,ve=>{const ge=x[h];ge&&ge[0]&&ge[0](Da.ERROR_REVALIDATE_EVENT,ve)},{retryCount:(Ie.retryCount||0)+1,dedupe:!0})))}return xe=!1,q(),!0},[h,r]),ee=b.useCallback((...J)=>z7(r,S.current,...J),[]);if(Cu(()=>{E.current=t,P.current=n,qe(ae)||(W.current=ae)}),Cu(()=>{if(!h)return;const J=Pe.bind(sn,uh);let j=0;const K=gB(h,x,(xe,Ie={})=>{if(xe==Da.FOCUS_EVENT){const se=Date.now();M().revalidateOnFocus&&se>j&&T()&&(j=se+M().focusThrottleInterval,J())}else if(xe==Da.RECONNECT_EVENT)M().revalidateOnReconnect&&T()&&J();else{if(xe==Da.MUTATE_EVENT)return Pe();if(xe==Da.ERROR_REVALIDATE_EVENT)return Pe(Ie)}});return C.current=!1,S.current=h,v.current=!0,O({_k:m}),pe&&(qe(re)||Fl?J():tB(J)),()=>{C.current=!0,K()}},[h]),Cu(()=>{let J;function j(){const K=Mr(c)?c(R().data):c;K&&J!==-1&&(J=setTimeout(U,K))}function U(){!R().error&&(u||M().isVisible())&&(f||M().isOnline())?Pe(uh).then(j):j()}return j(),()=>{J&&(clearTimeout(J),J=-1)}},[c,u,f,h]),b.useDebugValue(ne),i&&qe(re)&&h){if(!Av&&Fl)throw new Error("Fallback data is required when using suspense in SSR.");E.current=t,P.current=n,C.current=!1;const J=k[h];if(!qe(J)){const j=ee(J);Nv(j)}if(qe(de)){const j=Pe(uh);qe(ne)||(j.status="fulfilled",j.value=!0),Nv(j)}else throw de}return{mutate:ee,get data(){return _.data=!0,ne},get error(){return _.error=!0,de},get isValidating(){return _.isValidating=!0,me},get isLoading(){return _.isLoading=!0,Se}}},vB=xu.defineProperty(aB,"defaultValue",{value:W7}),xB=mB(yB);function Y7(e,t){return function(){return e.apply(t,arguments)}}const{toString:CB}=Object.prototype,{getPrototypeOf:vg}=Object,Zf=(e=>t=>{const n=CB.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Vr=e=>(e=e.toLowerCase(),t=>Zf(t)===e),qf=e=>t=>typeof t===e,{isArray:oa}=Array,Al=qf("undefined");function bB(e){return e!==null&&!Al(e)&&e.constructor!==null&&!Al(e.constructor)&&Gn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const G7=Vr("ArrayBuffer");function wB(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&G7(e.buffer),t}const SB=qf("string"),Gn=qf("function"),K7=qf("number"),Xf=e=>e!==null&&typeof e=="object",kB=e=>e===!0||e===!1,bu=e=>{if(Zf(e)!=="object")return!1;const t=vg(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},PB=Vr("Date"),EB=Vr("File"),MB=Vr("Blob"),TB=Vr("FileList"),RB=e=>Xf(e)&&Gn(e.pipe),_B=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Gn(e.append)&&((t=Zf(e))==="formdata"||t==="object"&&Gn(e.toString)&&e.toString()==="[object FormData]"))},DB=Vr("URLSearchParams"),OB=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function lc(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),oa(e))for(r=0,o=e.length;r0;)if(o=n[r],t===o.toLowerCase())return o;return null}const q7=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,X7=e=>!Al(e)&&e!==q7;function Y1(){const{caseless:e}=X7(this)&&this||{},t={},n=(r,o)=>{const i=e&&Z7(t,o)||o;bu(t[i])&&bu(r)?t[i]=Y1(t[i],r):bu(r)?t[i]=Y1({},r):oa(r)?t[i]=r.slice():t[i]=r};for(let r=0,o=arguments.length;r(lc(t,(o,i)=>{n&&Gn(o)?e[i]=Y7(o,n):e[i]=o},{allOwnKeys:r}),e),$B=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),FB=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},AB=(e,t,n,r)=>{let o,i,s;const a={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)s=o[i],(!r||r(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=n!==!1&&vg(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},LB=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},jB=e=>{if(!e)return null;if(oa(e))return e;let t=e.length;if(!K7(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},NB=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&vg(Uint8Array)),VB=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=r.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},zB=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},BB=Vr("HTMLFormElement"),WB=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),Vv=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),HB=Vr("RegExp"),J7=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};lc(n,(o,i)=>{let s;(s=t(o,i,e))!==!1&&(r[i]=s||o)}),Object.defineProperties(e,r)},UB=e=>{J7(e,(t,n)=>{if(Gn(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Gn(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},YB=(e,t)=>{const n={},r=o=>{o.forEach(i=>{n[i]=!0})};return oa(e)?r(e):r(String(e).split(t)),n},GB=()=>{},KB=(e,t)=>(e=+e,Number.isFinite(e)?e:t),dh="abcdefghijklmnopqrstuvwxyz",zv="0123456789",Q7={DIGIT:zv,ALPHA:dh,ALPHA_DIGIT:dh+dh.toUpperCase()+zv},ZB=(e=16,t=Q7.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function qB(e){return!!(e&&Gn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const XB=e=>{const t=new Array(10),n=(r,o)=>{if(Xf(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const i=oa(r)?[]:{};return lc(r,(s,a)=>{const l=n(s,o+1);!Al(l)&&(i[a]=l)}),t[o]=void 0,i}}return r};return n(e,0)},JB=Vr("AsyncFunction"),QB=e=>e&&(Xf(e)||Gn(e))&&Gn(e.then)&&Gn(e.catch),G={isArray:oa,isArrayBuffer:G7,isBuffer:bB,isFormData:_B,isArrayBufferView:wB,isString:SB,isNumber:K7,isBoolean:kB,isObject:Xf,isPlainObject:bu,isUndefined:Al,isDate:PB,isFile:EB,isBlob:MB,isRegExp:HB,isFunction:Gn,isStream:RB,isURLSearchParams:DB,isTypedArray:NB,isFileList:TB,forEach:lc,merge:Y1,extend:IB,trim:OB,stripBOM:$B,inherits:FB,toFlatObject:AB,kindOf:Zf,kindOfTest:Vr,endsWith:LB,toArray:jB,forEachEntry:VB,matchAll:zB,isHTMLForm:BB,hasOwnProperty:Vv,hasOwnProp:Vv,reduceDescriptors:J7,freezeMethods:UB,toObjectSet:YB,toCamelCase:WB,noop:GB,toFiniteNumber:KB,findKey:Z7,global:q7,isContextDefined:X7,ALPHABET:Q7,generateString:ZB,isSpecCompliantForm:qB,toJSONObject:XB,isAsyncFn:JB,isThenable:QB};function Ue(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}G.inherits(Ue,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:G.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const e4=Ue.prototype,t4={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{t4[e]={value:e}});Object.defineProperties(Ue,t4);Object.defineProperty(e4,"isAxiosError",{value:!0});Ue.from=(e,t,n,r,o,i)=>{const s=Object.create(e4);return G.toFlatObject(e,s,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),Ue.call(s,e.message,t,n,r,o),s.cause=e,s.name=e.name,i&&Object.assign(s,i),s};const eW=null;function G1(e){return G.isPlainObject(e)||G.isArray(e)}function n4(e){return G.endsWith(e,"[]")?e.slice(0,-2):e}function Bv(e,t,n){return e?e.concat(t).map(function(o,i){return o=n4(o),!n&&i?"["+o+"]":o}).join(n?".":""):t}function tW(e){return G.isArray(e)&&!e.some(G1)}const nW=G.toFlatObject(G,{},null,function(t){return/^is[A-Z]/.test(t)});function Jf(e,t,n){if(!G.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=G.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,k){return!G.isUndefined(k[g])});const r=n.metaTokens,o=n.visitor||u,i=n.dots,s=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&G.isSpecCompliantForm(t);if(!G.isFunction(o))throw new TypeError("visitor must be a function");function c(y){if(y===null)return"";if(G.isDate(y))return y.toISOString();if(!l&&G.isBlob(y))throw new Ue("Blob is not supported. Use a Buffer instead.");return G.isArrayBuffer(y)||G.isTypedArray(y)?l&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function u(y,g,k){let h=y;if(y&&!k&&typeof y=="object"){if(G.endsWith(g,"{}"))g=r?g:g.slice(0,-2),y=JSON.stringify(y);else if(G.isArray(y)&&tW(y)||(G.isFileList(y)||G.endsWith(g,"[]"))&&(h=G.toArray(y)))return g=n4(g),h.forEach(function(v,C){!(G.isUndefined(v)||v===null)&&t.append(s===!0?Bv([g],C,i):s===null?g:g+"[]",c(v))}),!1}return G1(y)?!0:(t.append(Bv(k,g,i),c(y)),!1)}const f=[],p=Object.assign(nW,{defaultVisitor:u,convertValue:c,isVisitable:G1});function x(y,g){if(!G.isUndefined(y)){if(f.indexOf(y)!==-1)throw Error("Circular reference detected in "+g.join("."));f.push(y),G.forEach(y,function(h,m){(!(G.isUndefined(h)||h===null)&&o.call(t,h,G.isString(m)?m.trim():m,g,p))===!0&&x(h,g?g.concat(m):[m])}),f.pop()}}if(!G.isObject(e))throw new TypeError("data must be an object");return x(e),t}function Wv(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function xg(e,t){this._pairs=[],e&&Jf(e,this,t)}const r4=xg.prototype;r4.append=function(t,n){this._pairs.push([t,n])};r4.toString=function(t){const n=t?function(r){return t.call(this,r,Wv)}:Wv;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function rW(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function o4(e,t,n){if(!t)return e;const r=n&&n.encode||rW,o=n&&n.serialize;let i;if(o?i=o(t,n):i=G.isURLSearchParams(t)?t.toString():new xg(t,n).toString(r),i){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Hv{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){G.forEach(this.handlers,function(r){r!==null&&t(r)})}}const i4={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},oW=typeof URLSearchParams<"u"?URLSearchParams:xg,iW=typeof FormData<"u"?FormData:null,sW=typeof Blob<"u"?Blob:null,aW={isBrowser:!0,classes:{URLSearchParams:oW,FormData:iW,Blob:sW},protocols:["http","https","file","blob","url","data"]},s4=typeof window<"u"&&typeof document<"u",lW=(e=>s4&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),cW=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",uW=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:s4,hasStandardBrowserEnv:lW,hasStandardBrowserWebWorkerEnv:cW},Symbol.toStringTag,{value:"Module"})),Tr={...uW,...aW};function dW(e,t){return Jf(e,new Tr.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,i){return Tr.isNode&&G.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function fW(e){return G.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function pW(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r=n.length;return s=!s&&G.isArray(o)?o.length:s,l?(G.hasOwnProp(o,s)?o[s]=[o[s],r]:o[s]=r,!a):((!o[s]||!G.isObject(o[s]))&&(o[s]=[]),t(n,r,o[s],i)&&G.isArray(o[s])&&(o[s]=pW(o[s])),!a)}if(G.isFormData(e)&&G.isFunction(e.entries)){const n={};return G.forEachEntry(e,(r,o)=>{t(fW(r),o,n,0)}),n}return null}function hW(e,t,n){if(G.isString(e))try{return(t||JSON.parse)(e),G.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Cg={transitional:i4,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,i=G.isObject(t);if(i&&G.isHTMLForm(t)&&(t=new FormData(t)),G.isFormData(t))return o&&o?JSON.stringify(a4(t)):t;if(G.isArrayBuffer(t)||G.isBuffer(t)||G.isStream(t)||G.isFile(t)||G.isBlob(t))return t;if(G.isArrayBufferView(t))return t.buffer;if(G.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return dW(t,this.formSerializer).toString();if((a=G.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Jf(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return i||o?(n.setContentType("application/json",!1),hW(t)):t}],transformResponse:[function(t){const n=this.transitional||Cg.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(t&&G.isString(t)&&(r&&!this.responseType||o)){const s=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?Ue.from(a,Ue.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Tr.classes.FormData,Blob:Tr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};G.forEach(["delete","get","head","post","put","patch"],e=>{Cg.headers[e]={}});const bg=Cg,mW=G.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),gW=e=>{const t={};let n,r,o;return e&&e.split(` +`).forEach(function(s){o=s.indexOf(":"),n=s.substring(0,o).trim().toLowerCase(),r=s.substring(o+1).trim(),!(!n||t[n]&&mW[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Uv=Symbol("internals");function Oa(e){return e&&String(e).trim().toLowerCase()}function wu(e){return e===!1||e==null?e:G.isArray(e)?e.map(wu):String(e)}function yW(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const vW=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function fh(e,t,n,r,o){if(G.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!G.isString(t)){if(G.isString(r))return t.indexOf(r)!==-1;if(G.isRegExp(r))return r.test(t)}}function xW(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function CW(e,t){const n=G.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,i,s){return this[r].call(this,t,o,i,s)},configurable:!0})})}class Qf{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function i(a,l,c){const u=Oa(l);if(!u)throw new Error("header name must be a non-empty string");const f=G.findKey(o,u);(!f||o[f]===void 0||c===!0||c===void 0&&o[f]!==!1)&&(o[f||l]=wu(a))}const s=(a,l)=>G.forEach(a,(c,u)=>i(c,u,l));return G.isPlainObject(t)||t instanceof this.constructor?s(t,n):G.isString(t)&&(t=t.trim())&&!vW(t)?s(gW(t),n):t!=null&&i(n,t,r),this}get(t,n){if(t=Oa(t),t){const r=G.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return yW(o);if(G.isFunction(n))return n.call(this,o,r);if(G.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Oa(t),t){const r=G.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||fh(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function i(s){if(s=Oa(s),s){const a=G.findKey(r,s);a&&(!n||fh(r,r[a],a,n))&&(delete r[a],o=!0)}}return G.isArray(t)?t.forEach(i):i(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const i=n[r];(!t||fh(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const n=this,r={};return G.forEach(this,(o,i)=>{const s=G.findKey(r,i);if(s){n[s]=wu(o),delete n[i];return}const a=t?xW(i):String(i).trim();a!==i&&delete n[i],n[a]=wu(o),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return G.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&G.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[Uv]=this[Uv]={accessors:{}}).accessors,o=this.prototype;function i(s){const a=Oa(s);r[a]||(CW(o,s),r[a]=!0)}return G.isArray(t)?t.forEach(i):i(t),this}}Qf.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);G.reduceDescriptors(Qf.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});G.freezeMethods(Qf);const ro=Qf;function ph(e,t){const n=this||bg,r=t||n,o=ro.from(r.headers);let i=r.data;return G.forEach(e,function(a){i=a.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function l4(e){return!!(e&&e.__CANCEL__)}function cc(e,t,n){Ue.call(this,e??"canceled",Ue.ERR_CANCELED,t,n),this.name="CanceledError"}G.inherits(cc,Ue,{__CANCEL__:!0});function bW(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Ue("Request failed with status code "+n.status,[Ue.ERR_BAD_REQUEST,Ue.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const wW=Tr.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const s=[e+"="+encodeURIComponent(t)];G.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),G.isString(r)&&s.push("path="+r),G.isString(o)&&s.push("domain="+o),i===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function SW(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function kW(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function c4(e,t){return e&&!SW(t)?kW(e,t):t}const PW=Tr.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function o(i){let s=i;return t&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=o(window.location.href),function(s){const a=G.isString(s)?o(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function EW(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function MW(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=r[i];s||(s=c),n[o]=l,r[o]=c;let f=i,p=0;for(;f!==o;)p+=n[f++],f=f%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-s{const i=o.loaded,s=o.lengthComputable?o.total:void 0,a=i-n,l=r(a),c=i<=s;n=i;const u={loaded:i,total:s,progress:s?i/s:void 0,bytes:a,rate:l||void 0,estimated:l&&s&&c?(s-i)/l:void 0,event:o};u[t?"download":"upload"]=!0,e(u)}}const TW=typeof XMLHttpRequest<"u",RW=TW&&function(e){return new Promise(function(n,r){let o=e.data;const i=ro.from(e.headers).normalize();let{responseType:s,withXSRFToken:a}=e,l;function c(){e.cancelToken&&e.cancelToken.unsubscribe(l),e.signal&&e.signal.removeEventListener("abort",l)}let u;if(G.isFormData(o)){if(Tr.hasStandardBrowserEnv||Tr.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if((u=i.getContentType())!==!1){const[g,...k]=u?u.split(";").map(h=>h.trim()).filter(Boolean):[];i.setContentType([g||"multipart/form-data",...k].join("; "))}}let f=new XMLHttpRequest;if(e.auth){const g=e.auth.username||"",k=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(g+":"+k))}const p=c4(e.baseURL,e.url);f.open(e.method.toUpperCase(),o4(p,e.params,e.paramsSerializer),!0),f.timeout=e.timeout;function x(){if(!f)return;const g=ro.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),h={data:!s||s==="text"||s==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:g,config:e,request:f};bW(function(v){n(v),c()},function(v){r(v),c()},h),f=null}if("onloadend"in f?f.onloadend=x:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(x)},f.onabort=function(){f&&(r(new Ue("Request aborted",Ue.ECONNABORTED,e,f)),f=null)},f.onerror=function(){r(new Ue("Network Error",Ue.ERR_NETWORK,e,f)),f=null},f.ontimeout=function(){let k=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const h=e.transitional||i4;e.timeoutErrorMessage&&(k=e.timeoutErrorMessage),r(new Ue(k,h.clarifyTimeoutError?Ue.ETIMEDOUT:Ue.ECONNABORTED,e,f)),f=null},Tr.hasStandardBrowserEnv&&(a&&G.isFunction(a)&&(a=a(e)),a||a!==!1&&PW(p))){const g=e.xsrfHeaderName&&e.xsrfCookieName&&wW.read(e.xsrfCookieName);g&&i.set(e.xsrfHeaderName,g)}o===void 0&&i.setContentType(null),"setRequestHeader"in f&&G.forEach(i.toJSON(),function(k,h){f.setRequestHeader(h,k)}),G.isUndefined(e.withCredentials)||(f.withCredentials=!!e.withCredentials),s&&s!=="json"&&(f.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&f.addEventListener("progress",Yv(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&f.upload&&f.upload.addEventListener("progress",Yv(e.onUploadProgress)),(e.cancelToken||e.signal)&&(l=g=>{f&&(r(!g||g.type?new cc(null,e,f):g),f.abort(),f=null)},e.cancelToken&&e.cancelToken.subscribe(l),e.signal&&(e.signal.aborted?l():e.signal.addEventListener("abort",l)));const y=EW(p);if(y&&Tr.protocols.indexOf(y)===-1){r(new Ue("Unsupported protocol "+y+":",Ue.ERR_BAD_REQUEST,e));return}f.send(o||null)})},K1={http:eW,xhr:RW};G.forEach(K1,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Gv=e=>`- ${e}`,_W=e=>G.isFunction(e)||e===null||e===!1,u4={getAdapter:e=>{e=G.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let s=t?i.length>1?`since : +`+i.map(Gv).join(` +`):" "+Gv(i[0]):"as no adapter specified";throw new Ue("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:K1};function hh(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new cc(null,e)}function Kv(e){return hh(e),e.headers=ro.from(e.headers),e.data=ph.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),u4.getAdapter(e.adapter||bg.adapter)(e).then(function(r){return hh(e),r.data=ph.call(e,e.transformResponse,r),r.headers=ro.from(r.headers),r},function(r){return l4(r)||(hh(e),r&&r.response&&(r.response.data=ph.call(e,e.transformResponse,r.response),r.response.headers=ro.from(r.response.headers))),Promise.reject(r)})}const Zv=e=>e instanceof ro?e.toJSON():e;function Us(e,t){t=t||{};const n={};function r(c,u,f){return G.isPlainObject(c)&&G.isPlainObject(u)?G.merge.call({caseless:f},c,u):G.isPlainObject(u)?G.merge({},u):G.isArray(u)?u.slice():u}function o(c,u,f){if(G.isUndefined(u)){if(!G.isUndefined(c))return r(void 0,c,f)}else return r(c,u,f)}function i(c,u){if(!G.isUndefined(u))return r(void 0,u)}function s(c,u){if(G.isUndefined(u)){if(!G.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,f){if(f in t)return r(c,u);if(f in e)return r(void 0,c)}const l={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(c,u)=>o(Zv(c),Zv(u),!0)};return G.forEach(Object.keys(Object.assign({},e,t)),function(u){const f=l[u]||o,p=f(e[u],t[u],u);G.isUndefined(p)&&f!==a||(n[u]=p)}),n}const d4="1.6.5",wg={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{wg[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const qv={};wg.transitional=function(t,n,r){function o(i,s){return"[Axios v"+d4+"] Transitional option '"+i+"'"+s+(r?". "+r:"")}return(i,s,a)=>{if(t===!1)throw new Ue(o(s," has been removed"+(n?" in "+n:"")),Ue.ERR_DEPRECATED);return n&&!qv[s]&&(qv[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,s,a):!0}};function DW(e,t,n){if(typeof e!="object")throw new Ue("options must be an object",Ue.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=t[i];if(s){const a=e[i],l=a===void 0||s(a,i,e);if(l!==!0)throw new Ue("option "+i+" must be "+l,Ue.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ue("Unknown option "+i,Ue.ERR_BAD_OPTION)}}const Z1={assertOptions:DW,validators:wg},bo=Z1.validators;class gd{constructor(t){this.defaults=t,this.interceptors={request:new Hv,response:new Hv}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Us(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&Z1.assertOptions(r,{silentJSONParsing:bo.transitional(bo.boolean),forcedJSONParsing:bo.transitional(bo.boolean),clarifyTimeoutError:bo.transitional(bo.boolean)},!1),o!=null&&(G.isFunction(o)?n.paramsSerializer={serialize:o}:Z1.assertOptions(o,{encode:bo.function,serialize:bo.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=i&&G.merge(i.common,i[n.method]);i&&G.forEach(["delete","get","head","post","put","patch","common"],y=>{delete i[y]}),n.headers=ro.concat(s,i);const a=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(l=l&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const c=[];this.interceptors.response.forEach(function(g){c.push(g.fulfilled,g.rejected)});let u,f=0,p;if(!l){const y=[Kv.bind(this),void 0];for(y.unshift.apply(y,a),y.push.apply(y,c),p=y.length,u=Promise.resolve(n);f{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(a=>{r.subscribe(a),i=a}).then(o);return s.cancel=function(){r.unsubscribe(i)},s},t(function(i,s,a){r.reason||(r.reason=new cc(i,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new Sg(function(o){t=o}),cancel:t}}}const OW=Sg;function IW(e){return function(n){return e.apply(null,n)}}function $W(e){return G.isObject(e)&&e.isAxiosError===!0}const q1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(q1).forEach(([e,t])=>{q1[t]=e});const FW=q1;function f4(e){const t=new Su(e),n=Y7(Su.prototype.request,t);return G.extend(n,Su.prototype,t,{allOwnKeys:!0}),G.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return f4(Us(e,o))},n}const Rt=f4(bg);Rt.Axios=Su;Rt.CanceledError=cc;Rt.CancelToken=OW;Rt.isCancel=l4;Rt.VERSION=d4;Rt.toFormData=Jf;Rt.AxiosError=Ue;Rt.Cancel=Rt.CanceledError;Rt.all=function(t){return Promise.all(t)};Rt.spread=IW;Rt.isAxiosError=$W;Rt.mergeConfig=Us;Rt.AxiosHeaders=ro;Rt.formToJSON=e=>a4(G.isHTMLForm(e)?new FormData(e):e);Rt.getAdapter=u4.getAdapter;Rt.HttpStatusCode=FW;Rt.default=Rt;let p4="";const kg=({url:e,body:t})=>(console.log(t),Rt(e,{data:t,headers:{"X-Sessionkey":p4,"Content-Type":"multipart/form-data"},method:"POST"}));async function AW(e){const t=window.location.pathname.replace(/\//g,"");try{const{data:n,headers:r}=await Rt("https://s.hbpn.link/answer/settings",{method:"POST",data:JSON.stringify({quiz_id:e,limit:100,page:0,need_config:!0})}),o=JSON.parse(localStorage.getItem("sessions")||"{}");return typeof o[t]=="number"&&Date.now()-o[t]<864e5?{data:n,isRecentlyCompleted:!0}:(p4=r["x-sessionkey"],{data:n,isRecentlyCompleted:!1})}catch(n){return{data:null,isRecentlyCompleted:!1,error:n.message}}}function en({questionId:e,body:t,qid:n}){const r=new FormData;console.log(n);const o=[{question_id:e,content:t}];return r.append("answers",JSON.stringify(o)),r.append("qid",n),kg({url:"https://s.hbpn.link/answer/answer",body:r,method:"POST"})}function LW({questionId:e,body:t,qid:n}){console.log(t);const r=new FormData,o=[{question_id:e,content:"file:"+t.name}];return r.append("answers",JSON.stringify(o)),r.append(t.name,t.file),r.append("qid",n),kg({url:"https://s.hbpn.link/answer/answer",body:r,method:"POST"})}function jW({questionId:e,body:t,qid:n}){const r=new FormData,o=[{question_id:e,content:JSON.stringify(t),result:!0,qid:n}];return r.append("answers",JSON.stringify(o)),r.append("qid",n),kg({url:"https://s.hbpn.link/answer/answer",body:r,method:"POST"})}var NW={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Xv=e=>{let t;const n=new Set,r=(u,f)=>{const p=typeof u=="function"?u(t):u;if(!Object.is(p,t)){const x=t;t=f??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(y=>y(t,x))}},o=()=>t,l={setState:r,getState:o,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(NW?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},c=t=e(r,o,l);return l},VW=e=>e?Xv(e):Xv;var h4={exports:{}},m4={};/** + * @license React + * use-sync-external-store-shim/with-selector.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ep=b,zW=A7;function BW(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var WW=typeof Object.is=="function"?Object.is:BW,HW=zW.useSyncExternalStore,UW=ep.useRef,YW=ep.useEffect,GW=ep.useMemo,KW=ep.useDebugValue;m4.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=UW(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=GW(function(){function l(x){if(!c){if(c=!0,u=x,x=r(x),o!==void 0&&s.hasValue){var y=s.value;if(o(y,x))return f=y}return f=x}if(y=f,WW(u,x))return y;var g=r(x);return o!==void 0&&o(y,g)?y:(u=x,f=g)}var c=!1,u,f,p=n===void 0?null:n;return[function(){return l(t())},p===null?void 0:function(){return l(p())}]},[t,n,r,o]);var a=HW(e,i[0],i[1]);return YW(function(){s.hasValue=!0,s.value=a},[a]),KW(a),a};h4.exports=m4;var ZW=h4.exports;const qW=Cd(ZW);var g4={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:XW}=Fe,{useSyncExternalStoreWithSelector:JW}=qW;let Jv=!1;const QW=e=>e;function eH(e,t=QW,n){(g4?"production":void 0)!=="production"&&n&&!Jv&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Jv=!0);const r=JW(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return XW(r),r}const Qv=e=>{(g4?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?VW(e):e,n=(r,o)=>eH(t,r,o);return Object.assign(n,t),n},y4=e=>e?Qv(e):Qv;var mh={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const X1=new Map,qc=e=>{const t=X1.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([n,r])=>[n,r.getState()])):{}},tH=(e,t,n)=>{if(e===void 0)return{type:"untracked",connection:t.connect(n)};const r=X1.get(n.name);if(r)return{type:"tracked",store:e,...r};const o={connection:t.connect(n),stores:{}};return X1.set(n.name,o),{type:"tracked",store:e,...o}},nH=(e,t={})=>(n,r,o)=>{const{enabled:i,anonymousActionType:s,store:a,...l}=t;let c;try{c=(i??(mh?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!c)return(mh?"production":void 0)!=="production"&&i&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),e(n,r,o);const{connection:u,...f}=tH(a,c,l);let p=!0;o.setState=(g,k,h)=>{const m=n(g,k);if(!p)return m;const v=h===void 0?{type:s||"anonymous"}:typeof h=="string"?{type:h}:h;return a===void 0?(u==null||u.send(v,r()),m):(u==null||u.send({...v,type:`${a}/${v.type}`},{...qc(l.name),[a]:o.getState()}),m)};const x=(...g)=>{const k=p;p=!1,n(...g),p=k},y=e(o.setState,r,o);if(f.type==="untracked"?u==null||u.init(y):(f.stores[f.store]=o,u==null||u.init(Object.fromEntries(Object.entries(f.stores).map(([g,k])=>[g,g===f.store?y:k.getState()])))),o.dispatchFromDevtools&&typeof o.dispatch=="function"){let g=!1;const k=o.dispatch;o.dispatch=(...h)=>{(mh?"production":void 0)!=="production"&&h[0].type==="__setState"&&!g&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),g=!0),k(...h)}}return u.subscribe(g=>{var k;switch(g.type){case"ACTION":if(typeof g.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return gh(g.payload,h=>{if(h.type==="__setState"){if(a===void 0){x(h.state);return}Object.keys(h.state).length!==1&&console.error(` + [zustand devtools middleware] Unsupported __setState action format. + When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(), + and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } } + `);const m=h.state[a];if(m==null)return;JSON.stringify(o.getState())!==JSON.stringify(m)&&x(m);return}o.dispatchFromDevtools&&typeof o.dispatch=="function"&&o.dispatch(h)});case"DISPATCH":switch(g.payload.type){case"RESET":return x(y),a===void 0?u==null?void 0:u.init(o.getState()):u==null?void 0:u.init(qc(l.name));case"COMMIT":if(a===void 0){u==null||u.init(o.getState());return}return u==null?void 0:u.init(qc(l.name));case"ROLLBACK":return gh(g.state,h=>{if(a===void 0){x(h),u==null||u.init(o.getState());return}x(h[a]),u==null||u.init(qc(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return gh(g.state,h=>{if(a===void 0){x(h);return}JSON.stringify(o.getState())!==JSON.stringify(h[a])&&x(h[a])});case"IMPORT_STATE":{const{nextLiftedState:h}=g.payload,m=(k=h.computedStates.slice(-1)[0])==null?void 0:k.state;if(!m)return;x(a===void 0?m:m[a]),u==null||u.send(null,h);return}case"PAUSE_RECORDING":return p=!p}return}}),y},v4=nH,gh=(e,t)=>{let n;try{n=JSON.parse(e)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}n!==void 0&&t(n)},rH={settings:null,items:[],cnt:0,recentlyСompleted:!1},$t=y4()(v4(()=>rH,{name:"QuizDataStore",enabled:!1,trace:!1})),ku=e=>e===null?null:$t.getState().items.find(t=>t.id===e||t.content.id===e)||null,oH=e=>$t.setState(e);function iH(){return d.jsx(cI,{component:"div",variant:"rectangular",sx:{bgcolor:"grey",width:"100%",height:"100%"}})}const Wo=nn({breakpoints:{values:{xs:0,sm:560,md:900,lg:1200,xl:1536}},components:{MuiTypography:{defaultProps:{variantMapping:{p1:"p"}}},MuiButton:{variants:[{props:{variant:"contained"},style:{backgroundColor:"#7E2AEA",padding:"13px 20px",borderRadius:"8px",color:"#ffffff",boxShadow:"none","&:hover":{backgroundColor:"#581CA7"}}},{props:{variant:"outlined"},style:{backgroundColor:"#F2F3F7",padding:"10px 20px",borderRadius:"8px",border:"1px solid #7E2AEA",color:"#9A9AAF","&:hover":{backgroundColor:"#581CA7",border:"1px solid #581CA7"}}}]}},typography:{h5:{fontSize:"24px",lineHeight:"28.44px",fontWeight:500},button:{fontSize:"18px",lineHeight:"24px",fontWeight:400,textTransform:"none"},body1:{fontSize:"18px",lineHeight:"21.33px",fontWeight:400},body2:{fontSize:"16px",lineHeight:"20px",fontWeight:500},p1:{fontSize:"20px",lineHeight:"24px",fontWeight:500},fontFamily:["Rubik","-apple-system","BlinkMacSystemFont",'"Segoe UI"','"Helvetica Neue"',"Arial","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"'].join(",")}});Wo.typography.h2={fontSize:"70px",lineHeight:"70px",fontWeight:500,[Wo.breakpoints.down("md")]:{fontSize:"42px",lineHeight:"50px"}};Wo.typography.h4={fontSize:"36px",lineHeight:"42.66px",fontWeight:500,[Wo.breakpoints.down("md")]:{fontSize:"24px",lineHeight:"28.44px"}};Wo.typography.infographic={fontSize:"80px",lineHeight:"94.8px",fontWeight:400,[Wo.breakpoints.down("md")]:{fontSize:"50px",lineHeight:"59px",fontWeight:400}};const vr=nn({...Wo,components:{MuiButton:{variants:[{props:{variant:"contained"},style:{padding:"13px 20px",borderRadius:"8px",boxShadow:"none"}},{props:{variant:"outlined"},style:{padding:"10px 20px",borderRadius:"8px","&:hover":{backgroundColor:"#581CA7",border:"1px solid #581CA7"}}}]}}}),sH=nn({...vr,palette:{primary:{main:"#7E2AEA"},secondary:{main:"#252734"},text:{primary:"#333647",secondary:"#7E2AEA"},background:{default:"#FFFFFF"}}}),aH=nn({...vr,palette:{primary:{main:"#7E2AEA"},secondary:{main:"#252734"},text:{primary:"#FFFFFF",secondary:"#7E2AEA"},background:{default:"#333647"}}}),lH=nn({...vr,palette:{primary:{main:"#D34085"},secondary:{main:"#252734"},text:{primary:"#333647",secondary:"#D34085"},background:{default:"#FFF9FC"}}}),cH=nn({...vr,palette:{primary:{main:"#D34085"},secondary:{main:"#252734"},text:{primary:"#FFFFFF",secondary:"#D34085"},background:{default:"#333647"}}}),uH=nn({...vr,palette:{primary:{main:"#4E4D51"},secondary:{main:"#252734"},text:{primary:"#333647",secondary:"#FFF9FC"},background:{default:"#FFFFFF"}}}),dH=nn({...vr,palette:{primary:{main:"#758E4F"},secondary:{main:"#252734"},text:{primary:"#333647",secondary:"#758E4F"},background:{default:"#F9FBF1"}}}),fH=nn({...vr,palette:{primary:{main:"#7E2AEA"},secondary:{main:"#252734"},text:{primary:"#333647",secondary:"#7E2AEA"},background:{default:"#FBF8FF"}}}),pH=nn({...vr,palette:{primary:{main:"#F2B133"},secondary:{main:"#252734"},text:{primary:"#333647",secondary:"#F2B133"},background:{default:"#FFFCF6"}}}),hH=nn({...vr,palette:{primary:{main:"#E6AA37"},secondary:{main:"#FFFCF6"},text:{primary:"#FFFFFF",secondary:"#F2B133"},background:{default:"#333647"}}}),mH=nn({...vr,palette:{primary:{main:"#4964ED"},secondary:{main:"#252734"},text:{primary:"#333647",secondary:"#4964ED"},background:{default:"#F5F7FF"}}}),gH=nn({...vr,palette:{primary:{main:"#07A0C3"},secondary:{main:"#252734"},text:{primary:"#FFFFFF",secondary:"#07A0C3"},background:{default:"#333647"}}}),Kn={StandardTheme:{theme:sH,isLight:!0},StandardDarkTheme:{theme:aH,isLight:!1},PinkTheme:{theme:lH,isLight:!0},PinkDarkTheme:{theme:cH,isLight:!1},BlackWhiteTheme:{theme:uH,isLight:!0},OliveTheme:{theme:dH,isLight:!0},YellowTheme:{theme:pH,isLight:!0},GoldDarkTheme:{theme:hH,isLight:!1},PurpleTheme:{theme:fH,isLight:!0},BlueTheme:{theme:mH,isLight:!0},BlueDarkTheme:{theme:gH,isLight:!1}},Pu=({message:e})=>d.jsx(X,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100vh"},children:d.jsx(Re,{sx:{textAlign:"center"},children:e||"что-то пошло не так"})});function yH({color:e}){return d.jsx(X,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:d.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("path",{d:"M7.5 7.96875C8.53553 7.96875 9.375 7.12928 9.375 6.09375C9.375 5.05822 8.53553 4.21875 7.5 4.21875C6.46447 4.21875 5.625 5.05822 5.625 6.09375C5.625 7.12928 6.46447 7.96875 7.5 7.96875Z",stroke:e,strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M12.1875 6.09375C12.1875 10.3125 7.5 13.5938 7.5 13.5938C7.5 13.5938 2.8125 10.3125 2.8125 6.09375C2.8125 4.85055 3.30636 3.65826 4.18544 2.77919C5.06451 1.90011 6.2568 1.40625 7.5 1.40625C8.7432 1.40625 9.93549 1.90011 10.8146 2.77919C11.6936 3.65826 12.1875 4.85055 12.1875 6.09375V6.09375Z",stroke:e,strokeLinecap:"round",strokeLinejoin:"round"})]})})}function vH({color:e}){return d.jsx(X,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:d.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("path",{d:"M6.5 8.375C8.57107 8.375 10.25 6.69607 10.25 4.625C10.25 2.55393 8.57107 0.875 6.5 0.875C4.42893 0.875 2.75 2.55393 2.75 4.625C2.75 6.69607 4.42893 8.375 6.5 8.375Z",stroke:e,strokeMiterlimit:"10"}),d.jsx("path",{d:"M0.8125 11.6568C1.38844 10.659 2.21689 9.83044 3.21458 9.25436C4.21227 8.67828 5.34403 8.375 6.49609 8.375C7.64816 8.375 8.77992 8.67828 9.77761 9.25436C10.7753 9.83044 11.6037 10.659 12.1797 11.6568",stroke:e,strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M0.765625 11.6914H11.9866",stroke:e,strokeLinecap:"round",strokeLinejoin:"round"})]})})}function xH({color:e}){return d.jsx(X,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:d.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("path",{d:"M1.875 3.28125H13.125V11.25C13.125 11.3743 13.0756 11.4935 12.9877 11.5815C12.8998 11.6694 12.7806 11.7188 12.6562 11.7188H2.34375C2.21943 11.7188 2.1002 11.6694 2.01229 11.5815C1.92439 11.4935 1.875 11.3743 1.875 11.25V3.28125Z",stroke:e,strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M13.125 3.28125L7.5 8.4375L1.875 3.28125",stroke:e,strokeLinecap:"round",strokeLinejoin:"round"})]})})}function CH({color:e}){return d.jsx(X,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:d.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d.jsx("path",{d:"M5.41992 7.31237C5.90228 8.30847 6.70774 9.11187 7.70508 9.59166C7.77865 9.6265 7.86002 9.64157 7.94118 9.63541C8.02235 9.62925 8.10051 9.60205 8.16797 9.55651L9.63281 8.57799C9.69753 8.5341 9.77232 8.50731 9.85019 8.50014C9.92806 8.49297 10.0065 8.50564 10.0781 8.53698L12.8203 9.71471C12.914 9.75372 12.9923 9.82245 13.0432 9.91033C13.094 9.9982 13.1145 10.1004 13.1016 10.201C13.0146 10.8794 12.6835 11.5029 12.1702 11.9547C11.6568 12.4066 10.9964 12.656 10.3125 12.6561C8.19906 12.6561 6.17217 11.8166 4.67774 10.3221C3.18331 8.82769 2.34375 6.80081 2.34375 4.68737C2.3439 4.00346 2.59325 3.34304 3.04513 2.82968C3.49701 2.31633 4.12047 1.98522 4.79883 1.8983C4.89951 1.88537 5.00166 1.90589 5.08954 1.95671C5.17741 2.00754 5.24615 2.08583 5.28516 2.17955L6.46289 4.9276C6.49352 4.99812 6.50633 5.07508 6.5002 5.15172C6.49407 5.22835 6.46918 5.3023 6.42773 5.36705L5.44922 6.85534C5.40565 6.92265 5.38009 7.00001 5.37496 7.08003C5.36983 7.16005 5.38531 7.24004 5.41992 7.31237V7.31237Z",stroke:e,strokeLinecap:"round",strokeLinejoin:"round"})})})}function bH({color:e}){return d.jsx(X,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:d.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("path",{d:"M8.67188 1.60156L8.67188 13.3838",stroke:e,strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M10.6016 4.21875H13.7768C13.8534 4.21875 13.9268 4.26814 13.9809 4.35604C14.035 4.44395 14.0655 4.56318 14.0655 4.6875V10.3125C14.0655 10.4368 14.035 10.556 13.9809 10.644C13.9268 10.7319 13.8534 10.7812 13.7768 10.7812H10.6016",stroke:e,strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M8.67081 10.7812H1.58194C1.41103 10.7812 1.24711 10.7319 1.12625 10.644C1.0054 10.556 0.9375 10.4368 0.9375 10.3125V4.6875C0.9375 4.56318 1.0054 4.44395 1.12625 4.35604C1.24711 4.26814 1.41103 4.21875 1.58194 4.21875H8.67081",stroke:e,strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M3.98438 6.5625H5.625",stroke:e,strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M7.85156 1.60156H9.49219",stroke:e,strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M7.85156 13.3828H9.49219",stroke:e,strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M4.80469 6.5625V8.67188",stroke:e,strokeLinecap:"round",strokeLinejoin:"round"})]})})}const yd=({checked:e=!1,color:t="#7E2AEA"})=>(Le(),d.jsx(X,{sx:{height:"24px",width:"24px",borderRadius:"6px",display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:e?t:"#F2F3F7",border:"1px solid #9A9AAF"},children:e&&d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",viewBox:"0 0 25 18",fill:"none",children:d.jsx("path",{d:"M2 9L10 16.5L22.5 1.5",stroke:"#ffffff",strokeWidth:"4",strokeLinecap:"round"})})}));function wH({label:e,handleChange:t,checked:n,sx:r,dataCy:o,colorIcon:i}){return d.jsx(Ql,{control:d.jsx($6,{sx:{padding:"0px 13px 1px 11px"},disableRipple:!0,icon:d.jsx(yd,{}),checkedIcon:d.jsx(yd,{checked:!0,color:i}),onChange:t,checked:n,"data-cy":o}),label:e,sx:{color:"#9A9AAF",height:"26px",...r}})}const Pg=e=>d.jsxs("svg",{...e,height:"1em",viewBox:"0 0 89 81",fill:"none",children:[d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M34.5604 0.0885217C24.3105 -1.09878 17.239 9.91147 10.6615 17.8703C4.88905 24.8549 0.590996 32.7441 0.0917664 41.7955C-0.439369 51.4255 1.3075 61.4545 7.86805 68.5172C14.6258 75.7923 24.7486 80.3889 34.5604 78.9028C43.5576 77.54 47.5388 67.6598 54.2372 61.4939C61.5105 54.799 75.061 51.6851 74.8731 41.7955C74.6848 31.8908 60.3836 29.952 53.5024 22.8328C46.3747 15.4585 44.7425 1.26797 34.5604 0.0885217Z",fill:"#7E2AEA"}),d.jsx("circle",{cx:"60.0543",cy:"75.1555",r:"5.65583",fill:"#7E2AEA"}),d.jsx("circle",{cx:"54.4046",cy:"12.3947",r:"2.1546",fill:"#7E2AEA"}),d.jsx("path",{d:"M88.866 39.4685C88.2378 33.3607 85.3643 27.7037 80.8025 23.594C76.2408 19.4843 70.3156 17.2146 64.1757 17.2248C63.3039 17.2252 62.4328 17.2708 61.5658 17.3614C55.4608 18.0025 49.8093 20.8814 45.7015 25.443C41.5937 30.0046 39.3205 35.9256 39.3203 42.0642V42.0642V77.549H49.9658V62.468C54.128 65.3636 59.0787 66.9119 64.1491 66.9036C65.0208 66.9033 65.8919 66.8577 66.759 66.767C70.0031 66.426 73.1483 65.4494 76.0151 63.8929C78.8818 62.3364 81.4138 60.2305 83.4667 57.6955C85.5195 55.1604 87.0529 52.2458 87.9793 49.1181C88.9058 45.9904 89.2071 42.7109 88.866 39.4667V39.4685ZM75.1937 51.0011C74.0243 52.4537 72.5783 53.6599 70.9395 54.5498C69.3007 55.4397 67.5017 55.9956 65.6465 56.1854C65.149 56.2371 64.6492 56.2631 64.1491 56.2635C60.9296 56.2605 57.8068 55.1631 55.2932 53.1515C52.7796 51.1398 51.0245 48.3334 50.3161 45.1929C49.6077 42.0523 49.988 38.7642 51.3945 35.8683C52.8011 32.9723 55.1504 30.6406 58.0568 29.2558C60.9632 27.871 64.2541 27.5154 67.3892 28.2473C70.5244 28.9793 73.3176 30.7553 75.3103 33.284C77.303 35.8126 78.3769 38.9436 78.3558 42.1629C78.3346 45.3823 77.2196 48.4989 75.1937 51.0011Z",fill:"#151515"})]}),x4=({resultData:e})=>{let t=!0;return(e.title.length>0&&e.title!==" "||e.description.length>0&&e.description!==" "||e.content.back.length>0&&e.content.back!==" "||e.content.originalBack.length>0&&e.content.originalBack!==" "||e.content.innerName.length>0&&e.content.innerName!==" "||e.content.text.length>0&&e.content.text!==" "||e.content.video.length>0&&e.content.video!==" "||e.content.hint.text.length>0&&e.content.hint.text!==" ")&&(t=!1),t},SH=Df,J1=/^(([^<>()[\].,:\s@"]+(\.[^<>()[\].,:\s@"]+)*)|(".+"))@(([^<>()[\].,:\s@"]+\.)+[^<>()[\].,:\s@"]{2,})$/iu,kH=({currentQuestion:e,showResultForm:t,setShowContactForm:n,setShowResultForm:r})=>{var A;const o=Le(),{settings:i,items:s}=$t(),[a,l]=b.useState(!1),[c,u]=b.useState(""),[f,p]=b.useState(""),[x,y]=b.useState(""),[g,k]=b.useState(""),[h,m]=b.useState(""),v=b.useRef(!0),[C,S]=b.useState(!1),E=ln(o.breakpoints.down(850)),P=s.find($=>i!=null&&i.cfg.haveRoot?$.type==="result"&&$.content.rule.parentId===e.content.id:$.type==="result"&&$.content.rule.parentId==="line"),M=async()=>{if(!i)return;const $=(i==null?void 0:i.cfg.formContact.fields)||(i==null?void 0:i.cfg.formContact),_={};if(c.length>0&&(_.name=c),f.length>0&&(_.email=f),x.length>0&&(_.phone=x),h.length>0&&(_.address=h),g.length>0&&(_.customs={[$.text.text||"Фамилия"]:g}),Object.keys(_).length>0)try{await jW({questionId:P==null?void 0:P.id,body:_,qid:i.qid});const D=JSON.parse(localStorage.getItem("sessions")||"{}");localStorage.setItem("sessions",JSON.stringify({...D,[i.qid]:new Date().getTime()}))}catch{ct("ответ не был засчитан")}};let T=(i==null?void 0:i.cfg.formContact.fields)||(i==null?void 0:i.cfg.formContact),R={};for(let $ in T){let _=T[$];console.log(R),_.used&&(R[$]=_)}let O=Object.keys(R).length>2;if(!i)throw new Error("settings is null");return P?d.jsx(X,{sx:{display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:o.palette.background.default,height:"100vh",overflow:"auto","&::-webkit-scrollbar":{width:"0",display:"none",msOverflowStyle:"none"},scrollbarWidth:"none",msOverflowStyle:"none"},children:d.jsxs(X,{sx:{width:O&&!E?"100%":E?void 0:"530px",borderRadius:"4px",height:"90vh",display:O&&!E?"flex":void 0},children:[d.jsxs(X,{sx:{width:O&&!E?"100%":void 0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",borderRight:O&&!E?"1px solid gray":void 0},children:[d.jsx(Re,{sx:{textAlign:"center",m:"20px 0",fontSize:"28px",color:o.palette.text.primary},children:(i==null?void 0:i.cfg.formContact.title)||"Заполните форму, чтобы получить результаты теста"}),(i==null?void 0:i.cfg.formContact.desc)&&d.jsx(Re,{sx:{color:o.palette.text.primary,textAlign:"center",m:"20px 0",fontSize:"18px"},children:i==null?void 0:i.cfg.formContact.desc})]}),d.jsxs(X,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",backgroundColor:o.palette.background.default,p:"30px"},children:[d.jsx(X,{sx:{display:"flex",flexDirection:"column",my:"20px"},children:d.jsx(PH,{name:c,setName:u,email:f,setEmail:p,phone:x,setPhone:y,text:g,setText:k,adress:h,setAdress:m})}),d.jsx(Er,{disabled:!(a&&!C),variant:"contained",onClick:async()=>{if(((i==null?void 0:i.cfg.formContact.fields)||(i==null?void 0:i.cfg.formContact)).email.used===J1.test(f)){if(S(!0),v.current)if(c.length>0||f.length>0||x.length>0||g.length>0||h.length>0){try{await M(),v.current=!1;const _=window.location.pathname.replace(/\//g,""),D=JSON.parse(localStorage.getItem("sessions")||"{}");D[_]=Date.now(),localStorage.setItem("sessions",JSON.stringify(D)),ct("Данные успешно отправлены")}catch{ct("повторите попытку позже")}(i==null?void 0:i.cfg.resultInfo.showResultForm)==="after"&&!x4({resultData:P})&&(n(!1),r(!0))}else ct("Пожалуйста, заполните поля");S(!1)}else ct("введена некорректная почта")},children:((A=i==null?void 0:i.cfg.formContact)==null?void 0:A.button)||"Получить результаты"}),d.jsxs(X,{sx:{display:"flex",mt:"20px",width:E?"300px":"450px"},children:[d.jsx(wH,{label:"",handleChange:({target:$})=>{l($.checked)},checked:a,colorIcon:o.palette.primary.main}),d.jsxs(Re,{sx:{color:o.palette.text.primary},children:["С ",d.jsxs(ad,{href:"https://shub.pena.digital/ppdd",target:"_blank",children:["Положением об обработке персональных данных"," "]})," и ",d.jsxs(ad,{href:"https://shub.pena.digital/docs/privacy",target:"_blank",children:[" ","Политикой конфиденциальности"," "]})," ознакомлен"]})]}),d.jsxs(X,{sx:{display:"flex",alignItems:"center",mt:"20px",gap:"15px"},children:[d.jsx(Pg,{style:{fontSize:"34px",color:mode[i.cfg.theme]?"#151515":"#FFFFFF"}}),d.jsx(Re,{sx:{fontSize:"20px",color:mode[i.cfg.theme]?"#4D4D4D":"#F5F7FF",whiteSpace:"nowrap"},children:"Сделано на PenaQuiz"})]})]})]})}):d.jsx(Pu,{message:"не получилось найти результат для этой ветки :("})},PH=({name:e,setName:t,email:n,setEmail:r,phone:o,setPhone:i,text:s,setText:a,adress:l,setAdress:c})=>{const{settings:u}=$t(),f=(u==null?void 0:u.cfg.formContact.fields)||(u==null?void 0:u.cfg.formContact);if(!f)return null;const p=d.jsx(Ia,{onChange:({target:h})=>t(h.value),id:e,title:f.name.innerText||"Введите имя",desc:f.name.text||"имя",Icon:vH}),x=d.jsx(Ia,{error:!J1.test(n),label:J1.test(n)?"Некорректная почта":"",onChange:({target:h})=>r(h.value),id:n,title:f.email.innerText||"Введите Email",desc:f.email.text||"Email",Icon:xH}),y=d.jsx(Ia,{onChange:({target:h})=>i(h.value),id:o,title:f.phone.innerText||"Введите номер телефона",desc:f.phone.text||"номер телефона",Icon:CH}),g=d.jsx(Ia,{onChange:({target:h})=>a(h.value),id:s,title:f.text.text||"Введите фамилию",desc:f.text.innerText||"фамилию",Icon:bH}),k=d.jsx(Ia,{onChange:({target:h})=>c(h.value),id:l,title:f.address.innerText||"Введите адрес",desc:f.address.text||"адрес",Icon:yH});return Object.values(f).some(h=>h.used)?d.jsxs(d.Fragment,{children:[f.name.used?p:d.jsx(d.Fragment,{}),f.email.used?x:d.jsx(d.Fragment,{}),f.phone.used?y:d.jsx(d.Fragment,{}),f.text.used?g:d.jsx(d.Fragment,{}),f.address.used?k:d.jsx(d.Fragment,{})]}):d.jsxs(d.Fragment,{children:[p,x,y]})},Ia=({title:e,desc:t,Icon:n,onChange:r})=>{const o=Le(),i=ln(o.breakpoints.down(600));return d.jsxs(X,{m:"15px 0",children:[d.jsx(Re,{mb:"7px",color:o.palette.text.primary,children:e}),d.jsx(SH,{onChange:r,sx:{width:i?"300px":"350px"},placeholder:t,InputProps:{startAdornment:d.jsx($m,{position:"start",children:d.jsx(n,{color:"gray"})})}})]})};var C4=Symbol.for("immer-nothing"),e5=Symbol.for("immer-draftable"),Dn=Symbol.for("immer-state");function lr(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ys=Object.getPrototypeOf;function Gs(e){return!!e&&!!e[Dn]}function _i(e){var t;return e?b4(e)||Array.isArray(e)||!!e[e5]||!!((t=e.constructor)!=null&&t[e5])||np(e)||rp(e):!1}var EH=Object.prototype.constructor.toString();function b4(e){if(!e||typeof e!="object")return!1;const t=Ys(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===EH}function Ll(e,t){tp(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function tp(e){const t=e[Dn];return t?t.type_:Array.isArray(e)?1:np(e)?2:rp(e)?3:0}function Q1(e,t){return tp(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function w4(e,t,n){const r=tp(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function MH(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function np(e){return e instanceof Map}function rp(e){return e instanceof Set}function si(e){return e.copy_||e.base_}function e0(e,t){if(np(e))return new Map(e);if(rp(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&b4(e))return Ys(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[Dn];let r=Reflect.ownKeys(n);for(let o=0;o1&&(e.set=e.add=e.clear=e.delete=TH),Object.freeze(e),t&&Ll(e,(n,r)=>Eg(r,!0))),e}function TH(){lr(2)}function op(e){return Object.isFrozen(e)}var RH={};function Di(e){const t=RH[e];return t||lr(0,e),t}var jl;function S4(){return jl}function _H(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function t5(e,t){t&&(Di("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function t0(e){n0(e),e.drafts_.forEach(DH),e.drafts_=null}function n0(e){e===jl&&(jl=e.parent_)}function n5(e){return jl=_H(jl,e)}function DH(e){const t=e[Dn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function r5(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Dn].modified_&&(t0(t),lr(4)),_i(e)&&(e=vd(t,e),t.parent_||xd(t,e)),t.patches_&&Di("Patches").generateReplacementPatches_(n[Dn].base_,e,t.patches_,t.inversePatches_)):e=vd(t,n,[]),t0(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==C4?e:void 0}function vd(e,t,n){if(op(t))return t;const r=t[Dn];if(!r)return Ll(t,(o,i)=>o5(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return xd(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const o=r.copy_;let i=o,s=!1;r.type_===3&&(i=new Set(o),o.clear(),s=!0),Ll(i,(a,l)=>o5(e,r,o,a,l,n,s)),xd(e,o,!1),n&&e.patches_&&Di("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function o5(e,t,n,r,o,i,s){if(Gs(o)){const a=i&&t&&t.type_!==3&&!Q1(t.assigned_,r)?i.concat(r):void 0,l=vd(e,o,a);if(w4(n,r,l),Gs(l))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(_i(o)&&!op(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;vd(e,o),(!t||!t.scope_.parent_)&&xd(e,o)}}function xd(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Eg(t,n)}function OH(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:S4(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=Mg;n&&(o=[r],i=Nl);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}var Mg={get(e,t){if(t===Dn)return e;const n=si(e);if(!Q1(n,t))return IH(e,n,t);const r=n[t];return e.finalized_||!_i(r)?r:r===yh(e.base_,t)?(vh(e),e.copy_[t]=o0(r,e)):r},has(e,t){return t in si(e)},ownKeys(e){return Reflect.ownKeys(si(e))},set(e,t,n){const r=k4(si(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=yh(si(e),t),i=o==null?void 0:o[Dn];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(MH(n,o)&&(n!==void 0||Q1(e.base_,t)))return!0;vh(e),r0(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return yh(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,vh(e),r0(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=si(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){lr(11)},getPrototypeOf(e){return Ys(e.base_)},setPrototypeOf(){lr(12)}},Nl={};Ll(Mg,(e,t)=>{Nl[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Nl.deleteProperty=function(e,t){return Nl.set.call(this,e,t,void 0)};Nl.set=function(e,t,n){return Mg.set.call(this,e[0],t,n,e[0])};function yh(e,t){const n=e[Dn];return(n?si(n):e)[t]}function IH(e,t,n){var o;const r=k4(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function k4(e,t){if(!(t in e))return;let n=Ys(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Ys(n)}}function r0(e){e.modified_||(e.modified_=!0,e.parent_&&r0(e.parent_))}function vh(e){e.copy_||(e.copy_=e0(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var $H=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const s=this;return function(l=i,...c){return s.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&lr(6),r!==void 0&&typeof r!="function"&&lr(7);let o;if(_i(t)){const i=n5(this),s=o0(t,void 0);let a=!0;try{o=n(s),a=!1}finally{a?t0(i):n0(i)}return t5(i,r),r5(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===C4&&(o=void 0),this.autoFreeze_&&Eg(o,!0),r){const i=[],s=[];Di("Patches").generateReplacementPatches_(t,o,i,s),r(i,s)}return o}else lr(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,o;return[this.produce(t,n,(s,a)=>{r=s,o=a}),r,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){_i(e)||lr(8),Gs(e)&&(e=FH(e));const t=n5(this),n=o0(e,void 0);return n[Dn].isManual_=!0,n0(t),n}finishDraft(e,t){const n=e&&e[Dn];(!n||!n.isManual_)&&lr(9);const{scope_:r}=n;return t5(r,t),r5(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));const r=Di("Patches").applyPatches_;return Gs(e)?r(e,t):this.produce(e,o=>r(o,t))}};function o0(e,t){const n=np(e)?Di("MapSet").proxyMap_(e,t):rp(e)?Di("MapSet").proxySet_(e,t):OH(e,t);return(t?t.scope_:S4()).drafts_.push(n),n}function FH(e){return Gs(e)||lr(10,e),P4(e)}function P4(e){if(!_i(e)||op(e))return e;const t=e[Dn];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=e0(e,t.scope_.immer_.useStrictShallowCopy_)}else n=e0(e,!0);return Ll(n,(r,o)=>{w4(n,r,P4(o))}),t&&(t.finalized_=!1),n}var On=new $H,AH=On.produce;On.produceWithPatches.bind(On);On.setAutoFreeze.bind(On);On.setUseStrictShallowCopy.bind(On);On.applyPatches.bind(On);On.createDraft.bind(On);On.finishDraft.bind(On);let LH=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");const Sn=y4()(v4((e,t)=>({answers:[],ownVariants:[]}),{name:"quizView",enabled:!1,trace:!1}));function E4(e,t){Sn.setState(n=>AH(n,e),!1,t)}const wn=(e,t)=>E4(n=>{const r=n.answers.findIndex(o=>e===o.questionId);r<0?n.answers.push({questionId:e,answer:t}):n.answers[r]={questionId:e,answer:t}},{type:"updateAnswer",questionId:e,answer:t}),uc=e=>Sn.setState(t=>({answers:t.answers.filter(n=>e!==n.questionId)}),!1,{type:"deleteAnswer",questionId:e}),jH=(e,t)=>E4(n=>{const r=n.ownVariants.findIndex(o=>o.id===e);r<0?n.ownVariants.push({id:e,variant:{id:LH(),answer:t,extendedText:"",hints:"",originalImageUrl:""}}):n.ownVariants[r].variant.answer=t},{type:"updateOwnVariant",id:e,answer:t}),NH=({setCurrentQuestion:e,question:t,setShowContactForm:n,setShowResultForm:r})=>{const o=Le(),{settings:i,items:s}=$t(),a=Sn(m=>m.answers),[l,c]=b.useState(1),u=ln(o.breakpoints.down(382)),f=!s.some(({content:m})=>m.rule.parentId==="root"),p=b.useCallback(()=>{var v;console.log("Смотрим какой вопрос будет дальше. Что у нас сегодня вкусненького? Щя покажу от какого вопроса мы ищем следующий шаг"),console.log(t),console.log("От вот этого /|");let m="";if(a.length){const C=a.find(({questionId:S})=>S===t.id);if(t.content.rule.main.forEach(({next:S,rules:E})=>{const P=Math.max(E[0].answers.length,C!=null&&C.answer&&Array.isArray(C==null?void 0:C.answer)?C==null?void 0:C.answer.length:[C==null?void 0:C.answer].length);for(let M=0;MString(T===E[0].answers[M]))&&(m=S);return}String(E[0].answers[M])===(C==null?void 0:C.answer)&&(m=S)}}),m)return m}if(!t.required){console.log("вопрос не обязателен ищем дальше");const C=t.content.rule.default;if(C.length>1&&C!==" ")return C;if(((t==null?void 0:t.type)==="date"||(t==null?void 0:t.type)==="text"||(t==null?void 0:t.type)==="number"||(t==null?void 0:t.type)==="page")&&t.content.rule.children.length===1)return t.content.rule.children[0]}return console.log("ничё не нашли, ищем резулт "),(v=s.find(C=>(console.log('q.type === "result"',C.type==="result"),console.log("q.content.rule.parentId",C.content.rule.parentId),console.log("question.content.id",t.content.id),C.type==="result"&&C.content.rule.parentId===t.content.id)))==null?void 0:v.id},[a,s,t]),x=b.useMemo(()=>{if(f){const m=s.findIndex(({id:C})=>C===t.id);return!s[m-1]}else return(t==null?void 0:t.content.rule.parentId)==="root"},[s,f,t==null?void 0:t.content.rule.parentId,t.id]),y=b.useMemo(()=>{const m=a.find(({questionId:C})=>C===t.id);if("required"in t.content&&t.content.required&&m)return!1;if("required"in t.content&&t.content.required&&!m)return!0;if(f||p())return!1;{const C=ku(t.content.rule.default);if(C!=null&&C.type)return!1}},[a,p,f,t.content,t.id]),g=m=>{if(!i||!m)return;const v=x4({resultData:m});m&&(m&&(i==null?void 0:i.cfg.resultInfo.showResultForm)==="before"&&(v?n(!0):r(!0)),m&&(i==null?void 0:i.cfg.resultInfo.showResultForm)==="after"&&n(!0))},k=()=>{if(f){c(C=>C-1);const m=s.findIndex(({id:C})=>C===t.id),v=s[m-1];v&&e(v);return}if((t==null?void 0:t.content.rule.parentId)!=="root"){const m=ku(t==null?void 0:t.content.rule.parentId);m!=null&&m.type?e(m):ct("не могу получить предыдущий вопрос")}else ct("вы находитесь на первом вопросе")},h=()=>{if(f){c(S=>S+1);const v=s.findIndex(({id:S})=>S===t.id),C=s[v+1];C&&C.type!=="result"?e(C):g(s.find(S=>S.content.rule.parentId==="line"));return}const m=p();if(m){const v=ku(m);v!=null&&v.type&&v.type==="result"?g(v):e(v)}else ct("не могу получить последующий вопрос")};return d.jsx(X,{sx:{position:"relative",padding:"15px 0",borderTop:`1px solid ${o.palette.grey[400]}`,height:"75px",display:"flex"},children:d.jsxs(X,{sx:{width:"100%",maxWidth:"1000px",padding:"0 10px",margin:"0 auto",display:"flex",alignItems:"center",gap:"10px"},children:[f&&d.jsxs(X,{sx:{display:"flex",alignItems:"center",gap:"10px",marginRight:"auto",color:o.palette.text.primary},children:[d.jsx(Re,{children:"Шаг"}),d.jsx(Re,{sx:{display:"flex",justifyContent:"center",alignItems:"center",fontWeight:"bold",borderRadius:"50%",width:"30px",height:"30px",color:"#FFF",background:o.palette.primary.main},children:l}),d.jsx(Re,{children:"Из"}),d.jsx(Re,{sx:{fontWeight:"bold"},children:s.filter(m=>m.type!=="result").length})]}),d.jsx(X,{sx:{display:"flex",alignItems:"center",gap:"10px",marginRight:"auto"}}),d.jsx(Er,{disabled:x,variant:"contained",sx:{fontSize:"16px",padding:"10px 15px"},onClick:k,children:u?"←":"← Назад"}),d.jsx(Er,{disabled:y,variant:"contained",sx:{fontSize:"16px",padding:"10px 15px"},onClick:h,children:"Далее →"})]})})};function Tg({videoUrl:e,containerSX:t}){var r;return(r=/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/gi.exec(e))==null||r[1],d.jsx(X,{sx:{width:"100%",height:"100%",pointerEvents:"none","& iframe":{width:"100%",height:"100%"},...t},children:d.jsx(X,{component:"video",sx:{width:"100%",height:"100%"},autoPlay:!0,muted:!0,src:e})})}const i5=({currentQuestion:e,showContactForm:t,setShowContactForm:n,setShowResultForm:r})=>{const o=Le(),i=ln(o.breakpoints.down(650)),{settings:s,items:a}=$t();if(!s)throw new Error("settings is null");const l=b.useMemo(()=>s!=null&&s.cfg.haveRoot?a.find(u=>u.type==="result"&&u.content.rule.parentId===e.content.id)||a.find(u=>u.type==="result"&&u.content.rule.parentId==="line"):a.find(u=>u.type==="result"&&u.content.rule.parentId==="line"),[e.content.id,a,s==null?void 0:s.cfg.haveRoot]),c=b.useCallback(()=>{r(!1),n(!0)},[n,r]);return b.useEffect(()=>{l||c()},[c,l]),l?d.jsxs(X,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",height:"100vh",width:"100vw",pt:"28px",overflow:"auto"},children:[d.jsxs(X,{sx:{display:"flex",flexDirection:"column",alignItems:"start",width:i?"100%":"490px",padding:i?"0 16px":void 0},children:[!(l!=null&&l.content.useImage)&&l.content.video&&d.jsx(Tg,{videoUrl:l.content.video,containerSX:{width:i?"100%":"490px",height:i?"100%":"280px"}}),(l==null?void 0:l.content.useImage)&&l.content.back&&d.jsx(X,{component:"img",src:l.content.back,sx:{width:i?"100%":"490px",height:i?"100%":"280px"}}),l.description!==""&&l.description!==" "&&d.jsx(Re,{sx:{fontSize:"23px",fontWeight:700,m:"20px 0",color:o.palette.text.primary},children:l.description}),d.jsx(Re,{sx:{m:"20px 0",color:o.palette.text.primary},children:l.title}),l.content.text!==""&&l.content.text!==" "&&d.jsx(Re,{sx:{fontSize:"18px",m:"20px 0",color:o.palette.text.primary},children:l.content.text})]}),d.jsxs(X,{width:"100%",children:[d.jsx(X,{sx:{display:"flex",width:"100%",justifyContent:"end",px:"20px"},children:d.jsxs(X,{sx:{display:"flex",alignItems:"center",mt:"15px",gap:"10px"},children:[d.jsx(Pg,{style:{fontSize:"34px",color:Kn[s.cfg.theme].isLight?"#000000":"#F5F7FF"}}),d.jsx(Re,{sx:{fontSize:"20px",color:Kn[s.cfg.theme].isLight?"#4D4D4D":"#F5F7FF",whiteSpace:"nowrap"},children:"Сделано на PenaQuiz"})]})}),d.jsxs(X,{sx:{boxShadow:"0 0 15px 0 rgba(0,0,0,.08)",width:"100%",flexDirection:"column",display:"flex",justifyContent:"center",alignItems:"center",p:"20px"},children:[(s==null?void 0:s.cfg.resultInfo.showResultForm)==="before"&&d.jsx(Er,{onClick:c,variant:"contained",sx:{p:"10px 20px",width:"210px",height:"50px"},children:l.content.hint.text||"Узнать подробнее"}),(s==null?void 0:s.cfg.resultInfo.showResultForm)==="after"&&l.content.redirect&&d.jsx(Er,{href:l.content.redirect,variant:"contained",sx:{p:"10px 20px",width:"210px",height:"50px"},children:l.content.hint.text||"Перейти на сайт"})]})]})]}):null};function VH({sx:e}){return d.jsx(X,{sx:{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,"&:hover path":{stroke:"#581CA7"},"&:active path":{stroke:"#FB5607"},"&:hover rect":{stroke:"#581CA7"},"&:active rect":{stroke:"#FB5607"},...e},children:d.jsxs("svg",{width:"20",height:"22",viewBox:"0 0 20 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("rect",{x:"1",y:"2.5",width:"18",height:"18",rx:"5",stroke:"#7E2AEA",strokeWidth:"1.5"}),d.jsx("path",{d:"M1 7.5H19",stroke:"#7E2AEA",strokeWidth:"1.5",strokeLinejoin:"round"}),d.jsx("path",{d:"M14.5 1L14.5 4",stroke:"#7E2AEA",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M5.5 1L5.5 4",stroke:"#7E2AEA",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M4.5 11.5H5.5",stroke:"#7E2AEA",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M9.5 11.5H10.5",stroke:"#7E2AEA",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M14.5 11.5H15.5",stroke:"#7E2AEA",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M4.5 15.5H5.5",stroke:"#7E2AEA",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M9.5 15.5H10.5",stroke:"#7E2AEA",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M14.5 15.5H15.5",stroke:"#7E2AEA",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})}const zH=({currentQuestion:e})=>{var s;const t=Le(),{settings:n}=$t(),{answers:r}=Sn(),o=(s=r.find(({questionId:a})=>a===e.id))==null?void 0:s.answer,i=ce(o)||ce();if(!n)throw new Error("settings is null");return d.jsxs(X,{children:[d.jsx(Re,{variant:"h5",color:t.palette.text.primary,children:e.title}),d.jsx(X,{sx:{display:"flex",flexDirection:"column",width:"100%",marginTop:"20px"},children:d.jsx(rL,{slots:{openPickerIcon:()=>d.jsx(VH,{sx:{"& path":{stroke:t.palette.primary.main},"& rect":{stroke:t.palette.primary.main}}})},value:i,onChange:async a=>{if(console.log(a),!!a)try{await en({questionId:e.id,body:ce(a).format("YYYY.MM.DD"),qid:n.qid}),wn(e.id,a)}catch{ct("ответ не был засчитан")}},slotProps:{openPickerButton:{sx:{p:0},"data-cy":"open-datepicker"},layout:{sx:{backgroundColor:t.palette.background.default}}},sx:{"& .MuiInputBase-root":{backgroundColor:Kn[n.cfg.theme].isLight?"white":t.palette.background.default,borderRadius:"10px",maxWidth:"250px",pr:"22px","& input":{py:"11px",pl:"20px",lineHeight:"19px"},"& fieldset":{borderColor:"#9A9AAF"}}}})})]})};function ip({color:e="#7E2AEA"}){return Le(),d.jsx(X,{sx:{height:"26px",width:"26px",display:"flex",alignItems:"center",justifyContent:"center"},children:d.jsxs("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("rect",{x:"0.5",y:"0.5",width:"25",height:"25",rx:"12.5",fill:e,stroke:e}),d.jsx("rect",{x:"8",y:"8",width:"10",height:"10",rx:"5",fill:"white"})]})})}function sp(){return Le(),d.jsx(X,{sx:{height:"26px",width:"26px",display:"flex",alignItems:"center",justifyContent:"center"},children:d.jsx("svg",{width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d.jsx("rect",{x:"0.5",y:"0.5",width:"25",height:"25",rx:"12.5",fill:"#F2F3F7",stroke:"#9A9AAF"})})})}const BH=({currentQuestion:e})=>{const t=Le(),{settings:n}=$t(),{answers:r}=Sn(),{answer:o}=r.find(({questionId:i})=>i===e.id)??{};if(!n)throw new Error("settings is null");return d.jsxs(X,{children:[d.jsx(Re,{variant:"h5",color:t.palette.text.primary,children:e.title}),d.jsx(_f,{name:e.id,value:e.content.variants.findIndex(({id:i})=>o===i),onChange:({target:i})=>{wn(e.id,e.content.variants[Number(i.value)].answer)},sx:{display:"flex",flexWrap:"wrap",flexDirection:"row",justifyContent:"space-between",marginTop:"20px"},children:d.jsx(X,{sx:{display:"flex",width:"100%",gap:"42px",flexWrap:"wrap"},children:e.content.variants.map((i,s)=>d.jsxs(Tf,{sx:{borderRadius:"12px",border:"1px solid",borderColor:o===i.id?t.palette.primary.main:"#9A9AAF",overflow:"hidden",maxWidth:"317px",width:"100%",height:"255px"},children:[d.jsx(X,{sx:{display:"flex",alignItems:"center",height:"193px",background:"#ffffff"},children:d.jsx(X,{sx:{width:"100%",display:"flex",justifyContent:"center"},children:i.extendedText&&d.jsx(Re,{fontSize:"100px",children:i.extendedText})})}),d.jsx(Ql,{sx:{margin:0,padding:"15px",color:t.palette.text.primary,display:"flex",gap:"10px"},value:s,onClick:async a=>{a.preventDefault();try{await en({questionId:e.id,body:e.content.variants[s].extendedText+" "+e.content.variants[s].answer,qid:n.qid}),wn(e.id,e.content.variants[s].id)}catch{ct("ответ не был засчитан")}if(o===e.content.variants[s].id){uc(e.id);try{await en({questionId:e.id,body:"",qid:n.qid})}catch{ct("ответ не был засчитан")}}},control:d.jsx(Rf,{checkedIcon:d.jsx(ip,{color:t.palette.primary.main}),icon:d.jsx(sp,{})}),label:d.jsx(X,{sx:{display:"flex",gap:"10px"},children:d.jsx(Re,{sx:{wordBreak:"break-word"},children:i.answer})})},i.id)]},i.id))})})]})};function WH({color:e="#9A9AAF"}){return Le(),d.jsx(X,{sx:{height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center"},children:d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",children:[d.jsx("path",{d:"M10.75 10.25L16 5L21.25 10.25",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M16 19V5",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M27 19V26C27 26.2652 26.8946 26.5196 26.7071 26.7071C26.5196 26.8946 26.2652 27 26 27H6C5.73478 27 5.48043 26.8946 5.29289 26.7071C5.10536 26.5196 5 26.2652 5 26V19",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function HH({width:e}){return Le(),d.jsxs("svg",{width:"35",height:"33",viewBox:"0 0 35 33",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsxs("g",{id:"Close",children:[d.jsx("g",{id:"Rectangle 57",opacity:"0.3",filter:"url(#filter0_d_4080_12482)",children:d.jsx("rect",{x:"6",y:"4",width:"24",height:"24",rx:"12",fill:"#9A9AAF"})}),d.jsxs("g",{id:"Group 331",children:[d.jsx("path",{id:"Vector 586",d:"M22.8516 10.9517L12.9521 20.8512",stroke:"#FDFDFF",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{id:"Vector 587",d:"M22.8516 20.8462L12.9521 10.9467",stroke:"#FDFDFF",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})]}),d.jsx("defs",{children:d.jsxs("filter",{id:"filter0_d_4080_12482",x:"0",y:"0",width:"36",height:"36",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[d.jsx("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),d.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),d.jsx("feMorphology",{radius:"1",operator:"dilate",in:"SourceAlpha",result:"effect1_dropShadow_4080_12482"}),d.jsx("feOffset",{dy:"2"}),d.jsx("feGaussianBlur",{stdDeviation:"2.5"}),d.jsx("feComposite",{in2:"hardAlpha",operator:"out"}),d.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.416562 0 0 0 0 0.452406 0 0 0 0 0.775 0 0 0 0.18 0"}),d.jsx("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_4080_12482"}),d.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_4080_12482",result:"shape"})]})})]})}function UH({width:e=20,height:t=20,sx:n,onClick:r,className:o,color:i="#7e2aea"}){return d.jsx(Qs,{sx:n,className:o,onClick:r,children:d.jsxs("svg",{width:e,height:t,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("path",{d:"M10 19C14.9706 19 19 14.9706 19 10C19 5.02944 14.9706 1 10 1C5.02944 1 1 5.02944 1 10C1 14.9706 5.02944 19 10 19Z",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M9.25 9.25H10V14.5H10.75",stroke:i,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M9.8125 7C10.4338 7 10.9375 6.49632 10.9375 5.875C10.9375 5.25368 10.4338 4.75 9.8125 4.75C9.19118 4.75 8.6875 5.25368 8.6875 5.875C8.6875 6.49632 9.19118 7 9.8125 7Z",fill:i})]})})}const YH=({status:e})=>{switch(e){case"errorType":return d.jsx(d.Fragment,{children:d.jsx(Re,{children:"Выбран некорректный тип файла"})});case"errorSize":return d.jsx(d.Fragment,{children:d.jsx(Re,{children:"Файл слишком большой. Максимальный размер 50 МБ"})});default:return d.jsxs(d.Fragment,{children:[d.jsx(Re,{children:"Допустимые расширения файлов:"}),d.jsx(Re,{children:i0[e].join(" ")})]})}},i0={picture:[".jpeg",".jpg",".png",".ico",".gif",".tiff",".webp",".eps",".svg"],video:[".mp4",".mov",".wmv",".avi",".avchd",".flv",".f4v",".swf",".mkv",".webm",".mpeg-2"],audio:[".aac",".aiff",".dsd",".flac",".mp3",".mqa",".ogg",".wav",".wma"],document:[".doc",".docx",".dotx",".rtf",".odt",".pdf",".txt",".xls",".ppt",".xlsx",".pptx",".pages"]},s5={picture:{title:"Добавить изображение",description:"Принимает изображения"},video:{title:"Добавить видео",description:"Принимает .mp4 и .mov формат — максимум 100мб"},audio:{title:"Добавить аудиофайл",description:"Принимает аудиофайлы"},document:{title:"Добавить документ",description:"Принимает документы"}},GH=({currentQuestion:e})=>{var c;const t=Le(),{settings:n}=$t(),{answers:r}=Sn(),[o,i]=b.useState(""),s=(c=r.find(({questionId:u})=>u===e.id))==null?void 0:c.answer,a=ln(t.breakpoints.down(500)),l=async({target:u})=>{var p;if(!n)return;const f=(p=u.files)==null?void 0:p[0];if(f)if(f.size<=52428800)if(console.log(f.name.toLowerCase()),i0[e.content.type].find(x=>(console.log(x),console.log(f.name.toLowerCase().endsWith(x)),f.name.toLowerCase().endsWith(x)))){console.log(f);try{const x=await LW({questionId:e.id,body:{file:f,name:f.name},qid:n.qid});console.log(x),await en({questionId:e.id,body:`https://storage.yandexcloud.net/squizanswer/${n.qid}/${e.id}/${x.data.fileIDMap[e.id]}`,qid:n.qid}),wn(e.id,`${f.name}|${URL.createObjectURL(f)}`)}catch(x){console.log(x),ct("ответ не был засчитан")}}else i("errorType");else i("errorSize")};return d.jsxs(d.Fragment,{children:[d.jsxs(X,{children:[d.jsx(Re,{variant:"h5",color:t.palette.text.primary,children:e.title}),d.jsxs(X,{sx:{display:"flex",flexDirection:"column",width:"100%",marginTop:"20px",maxWidth:s!=null&&s.split("|")[0]?"640px":"600px"},children:[(s==null?void 0:s.split("|")[0])&&d.jsxs(X,{sx:{display:"flex",alignItems:"center",gap:"15px"},children:[d.jsx(Re,{color:t.palette.text.primary,children:"Вы загрузили:"}),d.jsxs(X,{sx:{padding:"5px 5px 5px 16px",backgroundColor:t.palette.primary.main,borderRadius:"8px",color:"#FFFFFF",display:"flex",alignItems:"center",overflow:"hidden",gap:"15px"},children:[d.jsx(Re,{sx:{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden"},children:s==null?void 0:s.split("|")[0]}),d.jsx(Qs,{sx:{p:0},onClick:()=>{wn(e.id,"")},children:d.jsx(HH,{})})]})]}),!(s!=null&&s.split("|")[0])&&d.jsxs(X,{sx:{display:"flex",alignItems:"center"},children:[d.jsxs($r,{component:"label",sx:{justifyContent:"flex-start",width:"100%"},children:[d.jsx("input",{onChange:l,hidden:!0,accept:i0[e.content.type].join(","),multiple:!0,type:"file"}),d.jsxs(X,{onDragOver:u=>u.preventDefault(),sx:{width:"100%",height:a?void 0:"120px",display:"flex",gap:"50px",justifyContent:"flex-start",alignItems:"center",padding:"33px 44px 33px 55px",backgroundColor:t.palette.background.default,border:"1px solid #9A9AAF",borderRadius:"8px"},children:[d.jsx(WH,{}),d.jsxs(X,{children:[d.jsx(Re,{sx:{color:"#9A9AAF",fontWeight:500},children:s5[e.content.type].title}),d.jsx(Re,{sx:{color:"#9A9AAF",fontSize:"16px",lineHeight:"19px"},children:s5[e.content.type].description})]})]})]}),d.jsx(UH,{sx:{width:"40px",height:"40px"},color:t.palette.primary.main,onClick:()=>i(e.content.type)})]}),s&&e.content.type==="picture"&&d.jsx("img",{src:s.split("|")[1],alt:"",style:{marginTop:"15px",maxWidth:"300px",maxHeight:"300px"}}),s&&e.content.type==="video"&&d.jsx("video",{src:s.split("|")[1],style:{marginTop:"15px",maxWidth:"300px",maxHeight:"300px",objectFit:"cover"}})]})]}),d.jsx(Im,{open:!!o,onClose:()=>i(""),children:d.jsx(X,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:a?300:400,bgcolor:"background.paper",borderRadius:3,boxShadow:24,p:4},children:d.jsx(YH,{status:o})})})]})},KH=({currentQuestion:e})=>{const{settings:t}=$t(),{answers:n}=Sn(),r=Le(),{answer:o}=n.find(({questionId:a})=>a===e.id)??{},i=ln(r.breakpoints.down(1e3)),s=ln(r.breakpoints.down(500));if(!t)throw new Error("settings is null");return d.jsxs(X,{children:[d.jsx(Re,{variant:"h5",color:r.palette.text.primary,children:e.title}),d.jsx(_f,{name:e.id,value:e.content.variants.findIndex(({id:a})=>o===a),sx:{display:"flex",flexWrap:"wrap",flexDirection:"row",justifyContent:"space-between",marginTop:"20px"},children:d.jsx(X,{sx:{display:"grid",gap:"15px",gridTemplateColumns:i?s?"repeat(1, 1fr)":"repeat(2, 1fr)":"repeat(3, 1fr)",width:"100%"},children:e.content.variants.map((a,l)=>d.jsxs(X,{sx:{cursor:"pointer",borderRadius:"5px",border:"1px solid",borderColor:o===a.id?r.palette.primary.main:"#9A9AAF"},onClick:async c=>{c.preventDefault();try{await en({questionId:e.id,body:`${e.content.variants[l].answer} `,qid:t.qid}),wn(e.id,e.content.variants[l].id)}catch{ct("ответ не был засчитан")}if(o===e.content.variants[l].id){uc(e.id);try{await en({questionId:e.id,body:"",qid:t.qid})}catch{ct("ответ не был засчитан")}}},children:[d.jsx(X,{sx:{display:"flex",alignItems:"center",gap:"10px"},children:d.jsx(X,{sx:{width:"100%",height:"300px"},children:a.extendedText&&d.jsx("img",{src:a.extendedText,alt:"",style:{display:"block",width:"100%",height:"100%",objectFit:"cover"}})})}),d.jsx(Ql,{sx:{textAlign:"center",color:r.palette.text.primary,marginTop:"10px",marginLeft:0,padding:"10px","& .MuiFormControlLabel-label":{wordBreak:"break-word"}},value:l,control:d.jsx(Rf,{checkedIcon:d.jsx(ip,{color:r.palette.primary.main}),icon:d.jsx(sp,{})}),label:a.answer},a.id)]},l))})})]})};function Eu(e,t,n){var r=this,o=b.useRef(null),i=b.useRef(0),s=b.useRef(null),a=b.useRef([]),l=b.useRef(),c=b.useRef(),u=b.useRef(e),f=b.useRef(!0);b.useEffect(function(){u.current=e},[e]);var p=!t&&t!==0&&typeof window<"u";if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var x=!!(n=n||{}).leading,y=!("trailing"in n)||!!n.trailing,g="maxWait"in n,k=g?Math.max(+n.maxWait||0,t):null;b.useEffect(function(){return f.current=!0,function(){f.current=!1}},[]);var h=b.useMemo(function(){var m=function(M){var T=a.current,R=l.current;return a.current=l.current=null,i.current=M,c.current=u.current.apply(R,T)},v=function(M,T){p&&cancelAnimationFrame(s.current),s.current=p?requestAnimationFrame(M):setTimeout(M,T)},C=function(M){if(!f.current)return!1;var T=M-o.current;return!o.current||T>=t||T<0||g&&M-i.current>=k},S=function(M){return s.current=null,y&&a.current?m(M):(a.current=l.current=null,c.current)},E=function M(){var T=Date.now();if(C(T))return S(T);if(f.current){var R=t-(T-o.current),O=g?Math.min(R,k-(T-i.current)):R;v(M,O)}},P=function(){var M=Date.now(),T=C(M);if(a.current=[].slice.call(arguments),l.current=r,o.current=M,T){if(!s.current&&f.current)return i.current=o.current,v(E,t),x?m(o.current):c.current;if(g)return v(E,t),m(o.current)}return s.current||v(E,t),c.current};return P.cancel=function(){s.current&&(p?cancelAnimationFrame(s.current):clearTimeout(s.current)),i.current=0,a.current=o.current=l.current=s.current=null},P.isPending=function(){return!!s.current},P.flush=function(){return s.current?S(Date.now()):c.current},P},[x,g,t,k,y,p]);return h}const ZH=Df;function Mu({placeholder:e,value:t,text:n,sx:r,error:o,onChange:i,onKeyDown:s,onBlur:a,InputProps:l}){const c=Le();return d.jsx(Tf,{fullWidth:!0,variant:"standard",sx:{p:0},children:d.jsx(ZH,{defaultValue:n,fullWidth:!0,value:t,placeholder:e,error:!!o,label:o,onChange:i,onKeyDown:s,onBlur:a,sx:{"& .MuiInputBase-root":{backgroundColor:c.palette.background.default,height:"48px",borderRadius:"10px"},"& .MuiInputLabel-root":{fontSize:"13.5px",marginTop:"3px"},...r},InputProps:l,inputProps:{sx:{borderRadius:"10px",fontSize:"18px",lineHeight:"21px",py:0}},"data-cy":"textfield"})})}const qH=({defaultValue:e,value:t,min:n=0,max:r=100,step:o,onChange:i,onChangeCommitted:s,sx:a})=>(Le(),d.jsx(PI,{value:t,defaultValue:e,min:n,max:r,step:o,onChange:i,valueLabelDisplay:"on",onChangeCommitted:s,onMouseDown:l=>l.stopPropagation(),"data-cy":"slider",sx:{color:"#7E2AEA",padding:"0",marginTop:"75px","& .MuiSlider-valueLabel":{background:"#7E2AEA",borderRadius:"8px",minWidth:"60px",width:"auto",whiteSpace:"nowrap",textAlign:"center",height:"36px"},"& .MuiSlider-valueLabel::before":{width:"6px",height:"2px",transform:"translate(-50%, 50%) rotate(90deg)",bottom:"-5px"},"& .MuiSlider-rail":{backgroundColor:"#F2F3F7",border:"1px solid #9A9AAF",height:"12px"},"& .MuiSlider-thumb":{border:"3px #f2f3f7 solid",height:"23px",width:"23px"},"& .MuiSlider-track":{height:"12px"},...a}})),XH=({currentQuestion:e})=>{var v;const{settings:t}=$t(),[n,r]=b.useState("0"),[o,i]=b.useState("0"),[s,a]=b.useState("100000000000"),l=Le(),{answers:c}=Sn(),u=ln(l.breakpoints.down(650)),f=window.Number(e.content.range.split("—")[0]),p=window.Number(e.content.range.split("—")[1]),x=async C=>{try{await en({questionId:e.id,body:C,qid:t.qid}),wn(e.id,C)}catch{ct("ответ не был засчитан")}},y=Eu(async C=>{const S=window.Number(C)window.Number(s)?s:C;r(S),await x(S)},1e3),g=Eu(async(C,S=!1)=>{const E=S?s:window.Number(C.split("—")[0]){const E=S?o:window.Number(C.split("—")[1])>p?String(p):C.split("—")[1];a(E),await x(`${C.split("—")[0]}—${E}`)},1e3),h=(v=c.find(({questionId:C})=>C===e.id))==null?void 0:v.answer,m=h||e.content.start+"—"+p;if(b.useEffect(()=>{h&&(h.includes("—")?(i(h.split("—")[0]),a(h.split("—")[1])):r(h)),h||(i(String(e.content.start)),a(String(p)),r(String(e.content.start)))},[]),!t)throw new Error("settings is null");return d.jsxs(X,{children:[d.jsx(Re,{variant:"h5",color:l.palette.text.primary,children:e.title}),d.jsxs(X,{sx:{display:"flex",flexDirection:"column",width:"100%",marginTop:"20px",gap:"30px",paddingRight:u?"10px":void 0},children:[d.jsx(qH,{value:e.content.chooseRange?m.split("—").length||0>1?m.split("—").map(C=>window.Number(C)):[f,f+1]:window.Number(m.split("—")[0]),min:f,max:p,step:e.content.step||1,onChange:(C,S)=>{const E=Array.isArray(S)?`${S[0]}—${S[1]}`:String(S);wn(e.id,E)},onChangeCommitted:async(C,S)=>{if(e.content.chooseRange&&Array.isArray(S)){i(String(S[0])),a(String(S[1])),await x(`${S[0]}—${S[1]}`);return}r(String(S)),await x(String(S))},sx:{color:l.palette.primary.main,"& .MuiSlider-valueLabel":{background:l.palette.primary.main}}}),!e.content.chooseRange&&d.jsx(Mu,{placeholder:"0",value:n,onChange:({target:C})=>{const S=C.value.replace(/\D/g,"");r(S),y(S)},sx:{maxWidth:"80px",borderColor:l.palette.text.primary,"& .MuiInputBase-input":{textAlign:"center",backgroundColor:Kn[t.cfg.theme].isLight?"white":l.palette.background.default}}}),e.content.chooseRange&&d.jsxs(X,{sx:{display:"flex",gap:"15px",alignItems:"center","& .MuiFormControl-root":{width:"auto"}},children:[d.jsx(Mu,{placeholder:"0",value:o,onChange:({target:C})=>{const S=C.value.replace(/\D/g,"");if(i(S),window.Number(S)>=window.Number(s)){g(`${s}—${s}`,!0);return}g(`${S}—${s}`)},sx:{maxWidth:"80px",borderColor:l.palette.text.primary,"& .MuiInputBase-input":{textAlign:"center",backgroundColor:Kn[t.cfg.theme].isLight?"white":l.palette.background.default}}}),d.jsx(Re,{color:l.palette.text.primary,children:"до"}),d.jsx(Mu,{placeholder:"0",value:s,onChange:({target:C})=>{const S=C.value.replace(/\D/g,"");if(a(S),window.Number(S)<=window.Number(o)){k(`${o}—${o}`,!0);return}k(`${o}—${S}`)},sx:{maxWidth:"80px",borderColor:l.palette.text.primary,"& .MuiInputBase-input":{textAlign:"center",backgroundColor:Kn[t.cfg.theme].isLight?"white":l.palette.background.default}}})]})]})]})},JH=({currentQuestion:e})=>{const t=Le(),{answers:n}=Sn();return n.find(({questionId:r})=>r===e.id),d.jsxs(X,{children:[d.jsx(Re,{variant:"h5",sx:{paddingBottom:"25px",color:t.palette.text.primary},children:e.title}),d.jsx(Re,{color:t.palette.text.primary,children:e.content.text}),d.jsx(X,{sx:{display:"flex",flexDirection:"column",width:"100%",marginTop:"20px"},children:e.content.useImage?d.jsx(X,{sx:{borderRadius:"12px",border:"1px solid #9A9AAF",overflow:"hidden"},children:d.jsx("img",{src:e.content.back,alt:"",style:{display:"block",width:"100%",height:"100%",objectFit:"contain"}},e.id)}):d.jsx(Tg,{containerSX:{width:"100%",height:"calc( 100vh - 270px)",maxHeight:"80vh",objectFit:"contain"},videoUrl:e.content.video})})]})};function QH({color:e}){return d.jsx(X,{sx:{height:"30px",width:"30px",display:"flex",alignItems:"center",justifyContent:"center"},children:d.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("path",{d:"M7 7V13.8875C7 18.85 10.975 22.9625 15.9375 23C17.1246 23.0082 18.3017 22.7815 19.4008 22.3329C20.5 21.8843 21.4995 21.2227 22.3419 20.3862C23.1843 19.5496 23.8528 18.5547 24.309 17.4586C24.7652 16.3626 25 15.1872 25 14V7C25 6.73478 24.8946 6.48043 24.7071 6.29289C24.5196 6.10536 24.2652 6 24 6H8C7.73478 6 7.48043 6.10536 7.29289 6.29289C7.10536 6.48043 7 6.73478 7 7Z",fill:e,stroke:e,strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M12 28H20",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M16 23V28",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M24.7754 16H26.0004C27.0613 16 28.0787 15.5786 28.8288 14.8284C29.579 14.0783 30.0004 13.0609 30.0004 12V10C30.0004 9.73478 29.895 9.48043 29.7075 9.29289C29.52 9.10536 29.2656 9 29.0004 9H25.0004",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M7.25078 16H5.98828C4.92742 16 3.91 15.5786 3.15985 14.8284C2.40971 14.0783 1.98828 13.0609 1.98828 12V10C1.98828 9.73478 2.09364 9.48043 2.28117 9.29289C2.46871 9.10536 2.72306 9 2.98828 9H6.98828",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function eU({color:e}){return d.jsx(X,{sx:{height:"30px",width:"30px",display:"flex",alignItems:"center",justifyContent:"center"},children:d.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("path",{d:"M5 27V6",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M5 21.0016C13 15.0016 19 27.0016 27 21.0016V6.00158C19 12.0016 13 0.00158215 5 6.00158",fill:e}),d.jsx("path",{d:"M5 21.0016C13 15.0016 19 27.0016 27 21.0016V6.00158C19 12.0016 13 0.00158203 5 6.00158",stroke:e,strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function tU({color:e}){return d.jsx(X,{sx:{height:"30px",width:"30px",display:"flex",alignItems:"center",justifyContent:"center"},children:d.jsx("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d.jsx("path",{d:"M16 27C16 27 3.5 20 3.5 11.5C3.5 9.99737 4.02062 8.54114 4.97328 7.37908C5.92593 6.21703 7.25178 5.42093 8.72525 5.12624C10.1987 4.83154 11.7288 5.05646 13.0551 5.76272C14.3814 6.46898 15.4221 7.61296 16 9.00001C16.5779 7.61296 17.6186 6.46898 18.9449 5.76272C20.2712 5.05646 21.8013 4.83154 23.2748 5.12624C24.7482 5.42093 26.0741 6.21703 27.0267 7.37908C27.9794 8.54114 28.5 9.99737 28.5 11.5C28.5 20 16 27 16 27Z",fill:e,stroke:e,strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})})}function nU({color:e}){return d.jsx(X,{sx:{height:"30px",width:"30px",display:"flex",alignItems:"center",justifyContent:"center"},children:d.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("path",{d:"M8 17H14V30H8C7.73478 30 7.48043 29.8946 7.29289 29.7071C7.10536 29.5196 7 29.2652 7 29V18C7 17.7348 7.10536 17.4804 7.29289 17.2929C7.48043 17.1054 7.73478 17 8 17V17Z",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M14 17L19 7C20.0609 7 21.0783 7.42143 21.8284 8.17157C22.5786 8.92172 23 9.93913 23 11V14H30.7375C31.0211 13.9993 31.3015 14.0593 31.56 14.176C31.8185 14.2926 32.049 14.4632 32.2361 14.6764C32.4232 14.8895 32.5625 15.1402 32.6447 15.4116C32.7268 15.683 32.75 15.9689 32.7125 16.25L31.2125 28.25C31.1518 28.7317 30.918 29.1749 30.5546 29.4969C30.1912 29.8189 29.723 29.9977 29.2375 30H14",fill:e}),d.jsx("path",{d:"M14 17L19 7C20.0609 7 21.0783 7.42143 21.8284 8.17157C22.5786 8.92172 23 9.93913 23 11V14H30.7375C31.0211 13.9993 31.3015 14.0593 31.56 14.176C31.8185 14.2926 32.049 14.4632 32.2361 14.6764C32.4232 14.8895 32.5625 15.1402 32.6447 15.4116C32.7268 15.683 32.75 15.9689 32.7125 16.25L31.2125 28.25C31.1518 28.7317 30.918 29.1749 30.5546 29.4969C30.1912 29.8189 29.723 29.9977 29.2375 30H14",stroke:e,strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function rU({color:e}){return d.jsx(X,{sx:{height:"30px",width:"30px",display:"flex",alignItems:"center",justifyContent:"center"},children:d.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("path",{d:"M11 29H21",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{d:"M9.83761 20.8739C8.6471 19.9482 7.68288 18.7637 7.01801 17.4102C6.35313 16.0566 6.00504 14.5694 6.00011 13.0614C5.97511 7.6364 10.3376 3.1239 15.7626 2.9989C17.8622 2.94913 19.9242 3.56166 21.6561 4.74961C23.388 5.93756 24.7019 7.64064 25.4115 9.6173C26.1211 11.594 26.1904 13.7439 25.6094 15.7621C25.0285 17.7803 23.827 19.5644 22.1751 20.8614C21.8102 21.1435 21.5146 21.5052 21.311 21.919C21.1073 22.3328 21.001 22.7877 21.0001 23.2489V23.9989C21.0001 24.2641 20.8948 24.5185 20.7072 24.706C20.5197 24.8935 20.2653 24.9989 20.0001 24.9989H12.0001C11.7349 24.9989 11.4805 24.8935 11.293 24.706C11.1055 24.5185 11.0001 24.2641 11.0001 23.9989V23.2489C10.997 22.7912 10.8909 22.34 10.6896 21.9289C10.4884 21.5177 10.1972 21.1572 9.83761 20.8739V20.8739Z",stroke:e,strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.01801 17.4102C7.68288 18.7637 8.6471 19.9482 9.83761 20.8739C10.1972 21.1572 10.4884 21.5177 10.6896 21.9289C10.8909 22.34 10.997 22.7912 11.0001 23.2489V23.9989C11.0001 24.2641 11.1055 24.5185 11.293 24.706C11.4805 24.8935 11.7349 24.9989 12.0001 24.9989H20.0001C20.2653 24.9989 20.5197 24.8935 20.7072 24.706C20.8948 24.5185 21.0001 24.2641 21.0001 23.9989V23.2489C21.001 22.7877 21.1073 22.3328 21.311 21.919C21.5146 21.5052 21.8102 21.1435 22.1751 20.8614C23.827 19.5644 25.0285 17.7803 25.6094 15.7621C26.1904 13.7439 26.1211 11.594 25.4115 9.6173C24.7019 7.64064 23.388 5.93756 21.6561 4.74961C19.9242 3.56166 17.8622 2.94913 15.7626 2.9989C10.3376 3.1239 5.97511 7.6364 6.00011 13.0614C6.00504 14.5694 6.35313 16.0566 7.01801 17.4102ZM17.1464 6.31013C16.7108 6.23629 16.2978 6.52956 16.2239 6.96517C16.1501 7.40078 16.4434 7.81378 16.879 7.88762C17.9379 8.06713 18.915 8.57088 19.6754 9.32936C20.4358 10.0878 20.9421 11.0636 21.1243 12.1221C21.1992 12.5575 21.613 12.8497 22.0484 12.7748C22.4838 12.6998 22.7761 12.2861 22.7011 11.8507C22.4627 10.4657 21.8003 9.18896 20.8053 8.19655C19.8104 7.20413 18.5319 6.545 17.1464 6.31013Z",fill:e})]})})}function oU({color:e}){return d.jsx(X,{sx:{height:"30px",width:"30px",display:"flex",alignItems:"center",justifyContent:"center"},children:d.jsx("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d.jsx("path",{d:"M3 11.3333H29M3 20.6667H29M13.6364 2L8.90909 30M23.0909 2L18.3636 30",stroke:e,strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"})})})}function iU({color:e,width:t=30,sx:n}){return d.jsx(X,{sx:{height:"50px",width:t+"px",display:"flex",alignItems:"center",justifyContent:"center",...n},children:d.jsx("svg",{width:t,height:t,viewBox:"0 0 28 27",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d.jsx("path",{d:"M14.551 21.8375L20.851 25.8375C21.6635 26.35 22.6635 25.5875 22.426 24.65L20.601 17.475C20.5516 17.2762 20.5595 17.0674 20.6236 16.8728C20.6877 16.6781 20.8056 16.5056 20.9635 16.375L26.6135 11.6625C27.351 11.05 26.976 9.81253 26.0135 9.75003L18.6385 9.27503C18.4372 9.26332 18.2438 9.19325 18.0817 9.07338C17.9197 8.95351 17.7961 8.78902 17.726 8.60003L14.976 1.67503C14.9032 1.47491 14.7706 1.30204 14.5961 1.17988C14.4217 1.05772 14.2139 0.992188 14.001 0.992188C13.788 0.992188 13.5802 1.05772 13.4058 1.17988C13.2314 1.30204 13.0988 1.47491 13.026 1.67503L10.276 8.60003C10.2059 8.78902 10.0823 8.95351 9.92021 9.07338C9.75816 9.19325 9.5647 9.26332 9.36347 9.27503L1.98847 9.75003C1.02597 9.81253 0.650971 11.05 1.38847 11.6625L7.03847 16.375C7.19639 16.5056 7.3142 16.6781 7.37834 16.8728C7.44247 17.0674 7.45032 17.2762 7.40097 17.475L5.71347 24.125C5.42597 25.25 6.62597 26.1625 7.58847 25.55L13.451 21.8375C13.6154 21.733 13.8062 21.6775 14.001 21.6775C14.1958 21.6775 14.3866 21.733 14.551 21.8375Z",fill:e,stroke:e,strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})})}const sU=[{name:"star",icon:e=>d.jsx(iU,{width:50,color:e})},{name:"trophie",icon:e=>d.jsx(QH,{color:e})},{name:"flag",icon:e=>d.jsx(eU,{color:e})},{name:"heart",icon:e=>d.jsx(tU,{color:e})},{name:"like",icon:e=>d.jsx(nU,{color:e})},{name:"bubble",icon:e=>d.jsx(rU,{color:e})},{name:"hashtag",icon:e=>d.jsx(oU,{color:e})}],aU=({currentQuestion:e})=>{const{settings:t}=$t(),{answers:n}=Sn(),r=Le(),o=ln(r.breakpoints.down(650)),{answer:i}=n.find(({questionId:a})=>a===e.id)??{},s=sU.find(({name:a})=>a===e.content.form);if(!t)throw new Error("settings is null");return d.jsxs(X,{children:[d.jsx(Re,{variant:"h5",color:r.palette.text.primary,children:e.title}),d.jsxs(X,{sx:{display:"inline-flex",alignItems:"center",gap:"20px",marginTop:"20px",flexDirection:"column",width:o?"100%":void 0},children:[d.jsx(X,{sx:{display:"inline-block",width:"100%"},children:d.jsx(VO,{value:Number(i||0),onChange:async(a,l)=>{try{await en({questionId:e.id,body:String(l)+" из "+e.content.steps,qid:t.qid}),wn(e.id,String(l))}catch{ct("ответ не был засчитан")}},sx:{height:"50px",gap:o?void 0:"15px",justifyContent:o?"space-between":void 0,width:o?"100%":void 0},max:e.content.steps,icon:s==null?void 0:s.icon(r.palette.primary.main),emptyIcon:s==null?void 0:s.icon("#9A9AAF")})}),d.jsxs(X,{sx:{display:"flex",justifyContent:"space-between",gap:2,width:"100%"},children:[d.jsx(Re,{sx:{color:"#9A9AAF"},children:e.content.ratingNegativeDescription}),d.jsx(Re,{sx:{color:"#9A9AAF"},children:e.content.ratingPositiveDescription})]})]})]})};function lU(e,{color:t="#7E2AEA"}){return Le(),d.jsx(X,{...e,sx:{top:"25% !important",height:"24px",width:"24px",display:"flex",alignItems:"center",justifyContent:"center"},children:d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:d.jsx("path",{d:"M19.5 9L12 16.5L4.5 9",stroke:t,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})}const cU=({items:e,activeItemIndex:t=0,empty:n,onChange:r,sx:o,placeholder:i="",colorMain:s="#7E2AEA",colorPlaceholder:a="#9A9AAF"})=>{const[l,c]=b.useState(n?-1:t),u=Le();b.useEffect(()=>{c(t)},[t]);const f=p=>{const x=Number(p.target.value);if(x===l){c(-1),r==null||r("",-1);return}c(x),r==null||r(e[x],x)};return d.jsx(Tf,{fullWidth:!0,size:"small",sx:{width:"100%",height:"48px",...o},children:d.jsx(nx,{displayEmpty:!0,renderValue:p=>p?e[Number(p)]:d.jsx(Re,{sx:{color:a},children:i}),id:"display-select",variant:"outlined",value:l===-1?"":String(l),onChange:f,sx:{width:"100%",height:"48px",borderRadius:"8px","& .MuiOutlinedInput-notchedOutline":{border:`1px solid ${s} !important`,height:"48px",borderRadius:"10px"}},MenuProps:{PaperProps:{sx:{mt:"8px",p:"4px",borderRadius:"8px",border:"1px solid #EEE4FC",boxShadow:"0px 8px 24px rgba(210, 208, 225, 0.4)"}},MenuListProps:{sx:{py:0,display:"flex",flexDirection:"column",gap:"8px","& .Mui-selected":{backgroundColor:u.palette.background.default,color:s}}}},inputProps:{sx:{color:s,display:"block",px:"9px",gap:"20px","& .MuiTypography-root":{overflow:"hidden",textOverflow:"ellipsis"}}},IconComponent:p=>d.jsx(lU,{...p}),children:e.map((p,x)=>d.jsx(UD,{value:x,sx:{display:"flex",alignItems:"center",gap:"20px",padding:"10px",borderRadius:"5px",color:a,whiteSpace:"normal"},children:p},p+x))})})},uU=({currentQuestion:e})=>{const t=Le(),{settings:n}=$t(),{answers:r}=Sn(),{answer:o}=r.find(({questionId:i})=>i===e.id)??{};if(!n)throw new Error("settings is null");return d.jsxs(X,{children:[d.jsx(Re,{variant:"h5",color:t.palette.text.primary,children:e.title}),d.jsx(X,{sx:{display:"flex",flexDirection:"column",width:"100%",marginTop:"20px"},children:d.jsx(cU,{placeholder:e.content.default,activeItemIndex:o?Number(o):-1,items:e.content.variants.map(({answer:i})=>i),colorMain:t.palette.primary.main,onChange:async(i,s)=>{if(s<0){uc(e.id);try{await en({questionId:e.id,body:"",qid:n.qid})}catch{ct("ответ не был засчитан")}return}try{await en({questionId:e.id,body:String(e.content.variants[Number(s)].answer),qid:n.qid}),wn(e.id,String(s))}catch{ct("ответ не был засчитан")}}})})]})},dU=({currentQuestion:e})=>{const t=Le(),{settings:n}=$t(),{answers:r}=Sn(),{answer:o}=r.find(({questionId:s})=>s===e.id)??{},i=Eu(async s=>{if(n)try{await en({questionId:e.id,body:s,qid:n.qid})}catch{ct("ответ не был засчитан")}},400);return d.jsxs(X,{children:[d.jsx(Re,{variant:"h5",color:t.palette.text.primary,children:e.title}),d.jsx(X,{sx:{display:"flex",flexDirection:"column",width:"100%",marginTop:"20px"},children:d.jsx(Mu,{placeholder:e.content.placeholder,value:o||"",onChange:async({target:s})=>{wn(e.id,s.value),i(s.value)},sx:{"&:focus-visible":{borderColor:t.palette.primary.main}}})})]})},fU=Df,pU=({currentQuestion:e})=>{const t=Le(),{answers:n,ownVariants:r}=Sn(),{answer:o}=n.find(({questionId:a})=>a===e.id)??{},i=r.find(a=>a.id===e.id),s=e.content.multi?L6:_f;return b.useEffect(()=>{i||jH(e.id,"")},[]),d.jsxs(X,{children:[d.jsx(Re,{variant:"h5",color:t.palette.text.primary,children:e.title}),d.jsxs(X,{sx:{display:"flex"},children:[d.jsx(s,{name:e.id.toString(),value:e.content.variants.findIndex(({id:a})=>o===a),sx:{display:"flex",flexWrap:"wrap",flexDirection:"row",justifyContent:"space-between",flexBasis:"100%",marginTop:"20px"},children:d.jsxs(X,{sx:{display:"flex",flexDirection:"row",flexWrap:"wrap",width:"100%",gap:"20px"},children:[e.content.variants.map((a,l)=>d.jsx(a5,{currentQuestion:e,variant:a,answer:o,index:l},a.id)),e.content.own&&i&&d.jsx(a5,{own:!0,currentQuestion:e,variant:i.variant,answer:o,index:e.content.variants.length+2})]})}),e.content.back&&e.content.back!==" "&&d.jsx(X,{sx:{maxWidth:"400px",width:"100%",height:"300px"},children:d.jsx("img",{src:e.content.back,style:{width:"100%",height:"100%",objectFit:"cover"},alt:""},e.id)})]})]})},a5=({currentQuestion:e,variant:t,answer:n,index:r,own:o=!1})=>{const{settings:i}=$t(),s=Le();if(!i)throw new Error("settings is null");return d.jsx(Ql,{sx:{margin:"0",borderRadius:"12px",color:s.palette.text.primary,padding:"15px",border:"1px solid",borderColor:n===t.id?s.palette.primary.main:"#9A9AAF",backgroundColor:Kn[i.cfg.theme].isLight?"white":s.palette.background.default,display:"flex",maxWidth:"685px",maxHeight:"85px",justifyContent:"space-between",width:"100%","&.MuiFormControl-root":{width:"100%"},"& .MuiFormControlLabel-label":{wordBreak:"break-word"}},value:r,labelPlacement:"start",control:e.content.multi?d.jsx($6,{checked:!!(n!=null&&n.includes(t.id)),checkedIcon:d.jsx(yd,{checked:!0,color:s.palette.primary.main}),icon:d.jsx(yd,{})}):d.jsx(Rf,{checkedIcon:d.jsx(ip,{color:s.palette.primary.main}),icon:d.jsx(sp,{})}),label:o?d.jsx(fU,{label:"Другое..."}):t.answer,onClick:async a=>{a.preventDefault();const l=e.content.variants[r].id;if(e.content.multi){const c=typeof n!="string"?n||[]:[];try{await en({questionId:e.id,body:c.includes(l)?c==null?void 0:c.filter(u=>u!==l):[...c,l],qid:i.qid}),wn(e.id,c.includes(l)?c==null?void 0:c.filter(u=>u!==l):[...c,l])}catch{ct("ответ не был засчитан")}return}try{await en({questionId:e.id,body:e.content.variants[r].answer,qid:i.qid}),wn(e.id,l)}catch{ct("ответ не был засчитан")}if(n===l){try{await en({questionId:e.id,body:"",qid:i.qid})}catch{ct("ответ не был засчитан")}uc(e.id)}}},t.id)},hU="/gag.png",mU=({currentQuestion:e})=>{const{settings:t}=$t(),{answers:n}=Sn(),r=Le(),o=ln(r.breakpoints.down(650)),{answer:i}=n.find(({questionId:a})=>a===e.id)??{},s=e.content.variants.find(({id:a})=>i===a);if(!t)throw new Error("settings is null");return d.jsxs(X,{children:[d.jsx(Re,{variant:"h5",color:r.palette.text.primary,children:e.title}),d.jsxs(X,{sx:{display:"flex",marginTop:"20px",flexDirection:o?"column-reverse":void 0,gap:o?"30px":void 0},children:[d.jsx(_f,{name:e.id,value:e.content.variants.findIndex(({id:a})=>i===a),sx:{display:"flex",flexWrap:"wrap",flexDirection:"row",justifyContent:"space-between",flexBasis:"100%"},children:d.jsx(X,{sx:{display:"flex",flexDirection:"column",width:"100%",gap:o?"20px":void 0},children:e.content.variants.map((a,l)=>d.jsx(Ql,{sx:{marginBottom:"15px",borderRadius:"5px",padding:"15px",color:r.palette.text.primary,backgroundColor:Kn[t.cfg.theme].isLight?"white":r.palette.background.default,border:"1px solid",borderColor:i===a.id?r.palette.primary.main:"#9A9AAF",display:"flex",margin:o?0:void 0,"& .MuiFormControlLabel-label":{wordBreak:"break-word"}},value:l,onClick:async c=>{c.preventDefault();try{await en({questionId:e.id,body:`${e.content.variants[l].answer} `,qid:t.qid}),wn(e.id,e.content.variants[l].id)}catch{ct("ответ не был засчитан")}if(i===e.content.variants[l].id){try{await en({questionId:e.id,body:"",qid:t.qid})}catch{ct("ответ не был засчитан")}uc(e.id)}},control:d.jsx(Rf,{checkedIcon:d.jsx(ip,{color:r.palette.primary.main}),icon:d.jsx(sp,{})}),label:a.answer},a.id))})}),d.jsx(X,{sx:{maxWidth:"450px",width:"100%",height:"450px",border:"1px solid #9A9AAF",borderRadius:"12px",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#9A9AAF12",color:"#9A9AAF"},children:i?d.jsx("img",{src:(s==null?void 0:s.extendedText)||hU,style:{width:"100%",height:"100%",objectFit:"cover"},alt:""}):e.content.replText!==" "&&e.content.replText.length>0?e.content.replText:s!=null&&s.extendedText||o?"Выберите вариант ответа ниже":"Выберите вариант ответа слева"})]})]})},gU=e=>d.jsxs("svg",{...e,width:"750",height:"140",viewBox:"0 0 750 140",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("rect",{width:"750",height:"140",rx:"70",fill:"white"}),d.jsx("path",{d:"M129.645 88.55C126.272 88.55 123.467 87.9267 121.23 86.68C119.03 85.4333 117.362 83.6917 116.225 81.455C115.088 79.2183 114.465 76.615 114.355 73.645C114.318 72.1417 114.3 70.5283 114.3 68.805C114.3 67.0817 114.318 65.4317 114.355 63.855C114.465 60.885 115.088 58.2817 116.225 56.045C117.362 53.8083 119.03 52.0667 121.23 50.82C123.467 49.5733 126.272 48.95 129.645 48.95C132.175 48.95 134.393 49.2983 136.3 49.995C138.207 50.6917 139.783 51.6267 141.03 52.8C142.313 53.9733 143.285 55.2933 143.945 56.76C144.605 58.19 144.972 59.675 145.045 61.215C145.082 61.545 144.972 61.82 144.715 62.04C144.495 62.26 144.22 62.37 143.89 62.37H140.865C140.535 62.37 140.242 62.2783 139.985 62.095C139.765 61.9117 139.6 61.5817 139.49 61.105C138.867 58.245 137.693 56.2833 135.97 55.22C134.283 54.1567 132.157 53.625 129.59 53.625C126.657 53.625 124.328 54.4683 122.605 56.155C120.882 57.805 119.947 60.4633 119.8 64.13C119.69 67.1367 119.69 70.2167 119.8 73.37C119.947 77.0367 120.882 79.7133 122.605 81.4C124.328 83.05 126.657 83.875 129.59 83.875C132.157 83.875 134.283 83.3433 135.97 82.28C137.693 81.2167 138.867 79.255 139.49 76.395C139.6 75.9183 139.765 75.5883 139.985 75.405C140.242 75.2217 140.535 75.13 140.865 75.13H143.89C144.22 75.13 144.495 75.24 144.715 75.46C144.972 75.68 145.082 75.955 145.045 76.285C144.972 77.825 144.605 79.3283 143.945 80.795C143.285 82.225 142.313 83.5267 141.03 84.7C139.783 85.8733 138.207 86.8083 136.3 87.505C134.393 88.2017 132.175 88.55 129.645 88.55ZM150.051 94.05C149.684 94.05 149.373 93.9217 149.116 93.665C148.896 93.445 148.786 93.1517 148.786 92.785V84.865C148.786 84.4983 148.896 84.205 149.116 83.985C149.373 83.7283 149.684 83.6 150.051 83.6H150.326C151.316 83.5633 152.159 83.0133 152.856 81.95C153.553 80.85 154.084 79.145 154.451 76.835C154.818 74.4883 155.001 71.445 155.001 67.705V60.665C155.001 60.2983 155.111 60.005 155.331 59.785C155.588 59.5283 155.899 59.4 156.266 59.4H173.811C174.178 59.4 174.471 59.5283 174.691 59.785C174.948 60.005 175.076 60.2983 175.076 60.665V83.49H177.661C178.064 83.49 178.376 83.6183 178.596 83.875C178.816 84.095 178.926 84.3883 178.926 84.755V92.785C178.926 93.1517 178.816 93.445 178.596 93.665C178.376 93.9217 178.064 94.05 177.661 94.05H175.076C174.709 94.05 174.398 93.9217 174.141 93.665C173.921 93.445 173.811 93.1517 173.811 92.785V88H153.901V92.785C153.901 93.1517 153.773 93.445 153.516 93.665C153.296 93.9217 153.003 94.05 152.636 94.05H150.051ZM156.871 83.6L169.961 83.49V63.8H160.006V68.31C160.006 72.1967 159.731 75.3867 159.181 77.88C158.631 80.3367 157.861 82.2433 156.871 83.6ZM196.064 88.55C192.288 88.55 189.281 87.395 187.044 85.085C184.808 82.7383 183.579 79.5483 183.359 75.515C183.323 75.0383 183.304 74.4333 183.304 73.7C183.304 72.93 183.323 72.3067 183.359 71.83C183.506 69.2267 184.111 66.9533 185.174 65.01C186.238 63.03 187.686 61.5083 189.519 60.445C191.389 59.3817 193.571 58.85 196.064 58.85C198.851 58.85 201.179 59.4367 203.049 60.61C204.956 61.7833 206.404 63.4517 207.394 65.615C208.384 67.7783 208.879 70.3083 208.879 73.205V74.14C208.879 74.5433 208.751 74.855 208.494 75.075C208.274 75.295 207.981 75.405 207.614 75.405H188.584C188.584 75.4417 188.584 75.515 188.584 75.625C188.584 75.735 188.584 75.8267 188.584 75.9C188.658 77.4033 188.988 78.815 189.574 80.135C190.161 81.4183 191.004 82.4633 192.104 83.27C193.204 84.0767 194.524 84.48 196.064 84.48C197.384 84.48 198.484 84.2783 199.364 83.875C200.244 83.4717 200.959 83.0317 201.509 82.555C202.059 82.0417 202.426 81.6567 202.609 81.4C202.939 80.9233 203.196 80.6483 203.379 80.575C203.563 80.465 203.856 80.41 204.259 80.41H206.899C207.266 80.41 207.559 80.52 207.779 80.74C208.036 80.9233 208.146 81.1983 208.109 81.565C208.073 82.115 207.779 82.7933 207.229 83.6C206.679 84.37 205.891 85.14 204.864 85.91C203.838 86.68 202.591 87.3217 201.124 87.835C199.658 88.3117 197.971 88.55 196.064 88.55ZM188.584 71.61H203.654V71.445C203.654 69.795 203.343 68.3283 202.719 67.045C202.133 65.7617 201.271 64.7533 200.134 64.02C198.998 63.25 197.641 62.865 196.064 62.865C194.488 62.865 193.131 63.25 191.994 64.02C190.894 64.7533 190.051 65.7617 189.464 67.045C188.878 68.3283 188.584 69.795 188.584 71.445V71.61ZM214.081 88C213.714 88 213.402 87.8717 213.146 87.615C212.889 87.3583 212.761 87.0467 212.761 86.68V84.645C212.761 83.875 213.146 83.4717 213.916 83.435C215.052 83.3983 216.006 82.8667 216.776 81.84C217.546 80.7767 218.132 79.1083 218.536 76.835C218.939 74.525 219.141 71.4817 219.141 67.705V60.665C219.141 60.2983 219.251 60.005 219.471 59.785C219.727 59.5283 220.039 59.4 220.406 59.4H237.896C238.262 59.4 238.556 59.5283 238.776 59.785C239.032 60.005 239.161 60.2983 239.161 60.665V86.735C239.161 87.1017 239.032 87.4133 238.776 87.67C238.556 87.89 238.262 88 237.896 88H235.256C234.889 88 234.596 87.89 234.376 87.67C234.156 87.4133 234.046 87.1017 234.046 86.735V63.8H224.146V68.31C224.146 71.83 223.944 74.855 223.541 77.385C223.137 79.8783 222.514 81.9133 221.671 83.49C220.864 85.03 219.819 86.1667 218.536 86.9C217.289 87.6333 215.804 88 214.081 88ZM255.335 88.55C253.502 88.55 251.833 88.1833 250.33 87.45C248.827 86.7167 247.617 85.7267 246.7 84.48C245.783 83.2333 245.325 81.8217 245.325 80.245C245.325 77.715 246.352 75.6983 248.405 74.195C250.458 72.6917 253.135 71.7017 256.435 71.225L264.63 70.07V68.475C264.63 66.715 264.117 65.34 263.09 64.35C262.1 63.36 260.468 62.865 258.195 62.865C256.545 62.865 255.207 63.195 254.18 63.855C253.19 64.515 252.493 65.3583 252.09 66.385C251.87 66.935 251.485 67.21 250.935 67.21H248.46C248.057 67.21 247.745 67.1 247.525 66.88C247.342 66.6233 247.25 66.33 247.25 66C247.25 65.45 247.452 64.7717 247.855 63.965C248.295 63.1583 248.955 62.37 249.835 61.6C250.715 60.83 251.833 60.1883 253.19 59.675C254.583 59.125 256.27 58.85 258.25 58.85C260.45 58.85 262.302 59.1433 263.805 59.73C265.308 60.28 266.482 61.0317 267.325 61.985C268.205 62.9383 268.828 64.02 269.195 65.23C269.598 66.44 269.8 67.6683 269.8 68.915V86.735C269.8 87.1017 269.672 87.4133 269.415 87.67C269.195 87.89 268.902 88 268.535 88H266.005C265.602 88 265.29 87.89 265.07 87.67C264.85 87.4133 264.74 87.1017 264.74 86.735V84.37C264.263 85.03 263.622 85.69 262.815 86.35C262.008 86.9733 261 87.505 259.79 87.945C258.58 88.3483 257.095 88.55 255.335 88.55ZM256.49 84.425C257.993 84.425 259.368 84.1133 260.615 83.49C261.862 82.83 262.833 81.8217 263.53 80.465C264.263 79.1083 264.63 77.4033 264.63 75.35V73.81L258.25 74.745C255.647 75.1117 253.685 75.735 252.365 76.615C251.045 77.4583 250.385 78.54 250.385 79.86C250.385 80.8867 250.678 81.7483 251.265 82.445C251.888 83.105 252.658 83.6 253.575 83.93C254.528 84.26 255.5 84.425 256.49 84.425ZM278.972 88C278.605 88 278.293 87.89 278.037 87.67C277.817 87.4133 277.707 87.1017 277.707 86.735V60.665C277.707 60.2983 277.817 60.005 278.037 59.785C278.293 59.5283 278.605 59.4 278.972 59.4H281.612C281.978 59.4 282.272 59.5283 282.492 59.785C282.712 60.005 282.822 60.2983 282.822 60.665V71.225H297.837V60.665C297.837 60.2983 297.947 60.005 298.167 59.785C298.423 59.5283 298.735 59.4 299.102 59.4H301.687C302.053 59.4 302.347 59.5283 302.567 59.785C302.823 60.005 302.952 60.2983 302.952 60.665V86.735C302.952 87.1017 302.823 87.4133 302.567 87.67C302.347 87.89 302.053 88 301.687 88H299.102C298.735 88 298.423 87.89 298.167 87.67C297.947 87.4133 297.837 87.1017 297.837 86.735V75.625H282.822V86.735C282.822 87.1017 282.712 87.4133 282.492 87.67C282.272 87.89 281.978 88 281.612 88H278.972ZM322.937 88.55C320.151 88.55 317.822 88.0183 315.952 86.955C314.082 85.8917 312.652 84.425 311.662 82.555C310.672 80.6483 310.122 78.485 310.012 76.065C309.976 75.4417 309.957 74.6533 309.957 73.7C309.957 72.71 309.976 71.9217 310.012 71.335C310.122 68.8783 310.672 66.715 311.662 64.845C312.689 62.975 314.137 61.5083 316.007 60.445C317.877 59.3817 320.187 58.85 322.937 58.85C325.687 58.85 327.997 59.3817 329.867 60.445C331.737 61.5083 333.167 62.975 334.157 64.845C335.184 66.715 335.752 68.8783 335.862 71.335C335.899 71.9217 335.917 72.71 335.917 73.7C335.917 74.6533 335.899 75.4417 335.862 76.065C335.752 78.485 335.202 80.6483 334.212 82.555C333.222 84.425 331.792 85.8917 329.922 86.955C328.052 88.0183 325.724 88.55 322.937 88.55ZM322.937 84.315C325.211 84.315 327.026 83.6 328.382 82.17C329.739 80.7033 330.472 78.5767 330.582 75.79C330.619 75.24 330.637 74.5433 330.637 73.7C330.637 72.8567 330.619 72.16 330.582 71.61C330.472 68.8233 329.739 66.715 328.382 65.285C327.026 63.8183 325.211 63.085 322.937 63.085C320.664 63.085 318.831 63.8183 317.437 65.285C316.081 66.715 315.366 68.8233 315.292 71.61C315.256 72.16 315.237 72.8567 315.237 73.7C315.237 74.5433 315.256 75.24 315.292 75.79C315.366 78.5767 316.081 80.7033 317.437 82.17C318.831 83.6 320.664 84.315 322.937 84.315ZM357.551 88C357.184 88 356.872 87.89 356.616 87.67C356.396 87.4133 356.286 87.1017 356.286 86.735V60.665C356.286 60.2983 356.396 60.005 356.616 59.785C356.872 59.5283 357.184 59.4 357.551 59.4H360.191C360.557 59.4 360.851 59.5283 361.071 59.785C361.291 60.005 361.401 60.2983 361.401 60.665V71.225H376.416V60.665C376.416 60.2983 376.526 60.005 376.746 59.785C377.002 59.5283 377.314 59.4 377.681 59.4H380.266C380.632 59.4 380.926 59.5283 381.146 59.785C381.402 60.005 381.531 60.2983 381.531 60.665V86.735C381.531 87.1017 381.402 87.4133 381.146 87.67C380.926 87.89 380.632 88 380.266 88H377.681C377.314 88 377.002 87.89 376.746 87.67C376.526 87.4133 376.416 87.1017 376.416 86.735V75.625H361.401V86.735C361.401 87.1017 361.291 87.4133 361.071 87.67C360.851 87.89 360.557 88 360.191 88H357.551ZM397.776 88.55C395.943 88.55 394.275 88.1833 392.771 87.45C391.268 86.7167 390.058 85.7267 389.141 84.48C388.225 83.2333 387.766 81.8217 387.766 80.245C387.766 77.715 388.793 75.6983 390.846 74.195C392.9 72.6917 395.576 71.7017 398.876 71.225L407.071 70.07V68.475C407.071 66.715 406.558 65.34 405.531 64.35C404.541 63.36 402.91 62.865 400.636 62.865C398.986 62.865 397.648 63.195 396.621 63.855C395.631 64.515 394.935 65.3583 394.531 66.385C394.311 66.935 393.926 67.21 393.376 67.21H390.901C390.498 67.21 390.186 67.1 389.966 66.88C389.783 66.6233 389.691 66.33 389.691 66C389.691 65.45 389.893 64.7717 390.296 63.965C390.736 63.1583 391.396 62.37 392.276 61.6C393.156 60.83 394.275 60.1883 395.631 59.675C397.025 59.125 398.711 58.85 400.691 58.85C402.891 58.85 404.743 59.1433 406.246 59.73C407.75 60.28 408.923 61.0317 409.766 61.985C410.646 62.9383 411.27 64.02 411.636 65.23C412.04 66.44 412.241 67.6683 412.241 68.915V86.735C412.241 87.1017 412.113 87.4133 411.856 87.67C411.636 87.89 411.343 88 410.976 88H408.446C408.043 88 407.731 87.89 407.511 87.67C407.291 87.4133 407.181 87.1017 407.181 86.735V84.37C406.705 85.03 406.063 85.69 405.256 86.35C404.45 86.9733 403.441 87.505 402.231 87.945C401.021 88.3483 399.536 88.55 397.776 88.55ZM398.931 84.425C400.435 84.425 401.81 84.1133 403.056 83.49C404.303 82.83 405.275 81.8217 405.971 80.465C406.705 79.1083 407.071 77.4033 407.071 75.35V73.81L400.691 74.745C398.088 75.1117 396.126 75.735 394.806 76.615C393.486 77.4583 392.826 78.54 392.826 79.86C392.826 80.8867 393.12 81.7483 393.706 82.445C394.33 83.105 395.1 83.6 396.016 83.93C396.97 84.26 397.941 84.425 398.931 84.425Z",fill:"#4D4D4D"}),d.jsxs("g",{clipPath:"url(#clip0_4819_14395)",children:[d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M461.886 33.8256C453.446 32.8479 447.622 41.9149 442.205 48.4691C437.452 54.221 433.912 60.7178 433.501 68.1717C433.064 76.1021 434.502 84.3611 439.905 90.1773C445.47 96.1684 453.806 99.9538 461.886 98.7299C469.296 97.6077 472.574 89.4712 478.091 84.3936C484.08 78.8802 495.239 76.3159 495.084 68.1717C494.929 60.0151 483.152 58.4185 477.485 52.5557C471.616 46.483 470.272 34.7969 461.886 33.8256Z",fill:"#7E2AEA"}),d.jsx("circle",{cx:"482.884",cy:"95.6408",r:"4.65763",fill:"#7E2AEA"}),d.jsx("circle",{cx:"478.227",cy:"43.9516",r:"1.77434",fill:"#7E2AEA"}),d.jsx("path",{d:"M506.606 66.259C506.089 61.2292 503.722 56.5706 499.966 53.1862C496.209 49.8018 491.33 47.9327 486.273 47.9411C485.555 47.9414 484.838 47.979 484.124 48.0536C479.096 48.5815 474.443 50.9524 471.06 54.7089C467.677 58.4654 465.805 63.3414 465.805 68.3966V68.3966V97.6187H474.571V85.1993C477.999 87.5839 482.076 88.8589 486.251 88.8521C486.969 88.8518 487.687 88.8143 488.401 88.7396C491.072 88.4588 493.662 87.6546 496.023 86.3728C498.384 85.091 500.469 83.3568 502.16 81.2691C503.85 79.1814 505.113 76.7812 505.876 74.2056C506.639 71.6299 506.887 68.9291 506.606 66.2575V66.259ZM495.347 75.7562C494.384 76.9524 493.193 77.9458 491.843 78.6786C490.494 79.4115 489.012 79.8693 487.485 80.0255C487.075 80.0681 486.663 80.0895 486.251 80.0898C483.6 80.0874 481.028 79.1837 478.958 77.5271C476.889 75.8705 475.443 73.5593 474.86 70.9731C474.276 68.3868 474.59 65.679 475.748 63.2942C476.906 60.9093 478.841 58.9891 481.234 57.8487C483.628 56.7083 486.338 56.4155 488.92 57.0183C491.502 57.621 493.802 59.0836 495.443 61.166C497.084 63.2483 497.968 65.8267 497.951 68.4779C497.933 71.1291 497.015 73.6956 495.347 75.7562Z",fill:"#151515"}),d.jsx("path",{d:"M529.478 47.9411C528.76 47.9414 528.043 47.979 527.329 48.0536C522.119 48.6022 517.319 51.1284 513.917 55.1114C510.515 59.0944 508.771 64.2307 509.043 69.4618C509.316 74.6928 511.585 79.6198 515.383 83.2274C519.181 86.835 524.218 88.8482 529.456 88.8521C530.174 88.8518 530.891 88.8143 531.605 88.7396C535.361 88.3397 538.934 86.9109 541.93 84.6105C544.926 82.3101 547.229 79.2275 548.585 75.7021H538.592L538.551 75.7532C537.272 77.3353 535.601 78.5558 533.704 79.294C531.808 80.0322 529.752 80.2626 527.739 79.9622C525.726 79.6619 523.827 78.8412 522.229 77.5816C520.63 76.3219 519.389 74.6667 518.626 72.7799H549.456C550.105 69.7933 550.078 66.6993 549.376 63.7246C548.674 60.75 547.316 57.97 545.4 55.5884C543.485 53.2068 541.061 51.284 538.306 49.9607C535.551 48.6375 532.534 47.9474 529.478 47.9411V47.9411ZM518.626 64.0133C519.424 62.0489 520.741 60.338 522.434 59.0627C524.128 57.7875 526.136 56.9958 528.245 56.772C528.655 56.7295 529.066 56.708 529.478 56.7077C531.807 56.7038 534.083 57.3977 536.013 58.6999C537.943 60.0021 539.439 61.8528 540.308 64.0133H518.626Z",fill:"#151515"}),d.jsx("path",{d:"M571.115 47.9411C567.765 47.9358 564.478 48.8571 561.618 50.6033V47.9411H552.852V88.8521H561.618V66.2049C561.618 63.6861 562.619 61.2705 564.4 59.4894C566.181 57.7084 568.597 56.7078 571.115 56.7078C573.634 56.7078 576.05 57.7084 577.831 59.4894C579.612 61.2705 580.613 63.6861 580.613 66.2049V88.8521H589.379V66.2049C589.379 61.3611 587.455 56.7156 584.03 53.2905C580.605 49.8653 575.959 47.9411 571.115 47.9411Z",fill:"#151515"}),d.jsx("path",{d:"M633.214 71.0105V47.9411H624.447V51.5939C621.02 49.2083 616.943 47.9332 612.767 47.9411C612.049 47.9415 611.332 47.979 610.618 48.0536C605.408 48.6023 600.608 51.1284 597.206 55.1114C593.804 59.0944 592.06 64.2308 592.332 69.4618C592.605 74.6928 594.874 79.6199 598.672 83.2275C602.47 86.8351 607.507 88.8483 612.745 88.8521C613.463 88.8518 614.18 88.8143 614.894 88.7396C619.99 88.2181 624.7 85.7909 628.081 81.944C630.708 85.459 634.513 87.9111 638.8 88.8521V79.6617C637.136 78.9083 635.725 77.6919 634.734 76.1577C633.744 74.6236 633.216 72.8367 633.214 71.0105ZM621.841 75.7533C620.877 76.9493 619.687 77.9424 618.337 78.6753C616.987 79.4081 615.506 79.866 613.978 80.0226C613.569 80.0652 613.157 80.0866 612.745 80.0869C609.75 80.0868 606.869 78.9369 604.697 76.8746C602.525 74.8123 601.228 71.9949 601.073 69.0038C600.917 66.0127 601.916 63.0761 603.863 60.8001C605.81 58.524 608.556 57.0822 611.535 56.7721C611.945 56.7295 612.356 56.708 612.767 56.7078C614.974 56.7097 617.135 57.3363 619.001 58.5151C620.867 59.694 622.36 61.3769 623.31 63.3693C624.259 65.3617 624.625 67.582 624.365 69.7736C624.105 71.9651 623.23 74.0383 621.841 75.7533Z",fill:"#151515"}),d.jsx("path",{d:"M600.484 110.378V105.155C600.125 105.617 599.679 105.986 599.144 106.26C598.609 106.527 598.032 106.661 597.413 106.661C596.232 106.661 595.261 106.217 594.498 105.331C593.598 104.294 593.148 102.888 593.148 101.115C593.148 99.4454 593.569 98.1445 594.41 97.212C595.257 96.273 596.307 95.8035 597.559 95.8035C598.251 95.8035 598.847 95.9502 599.349 96.2437C599.858 96.5371 600.308 96.9805 600.699 97.5739V96.0383H603.233V110.378H600.484ZM600.572 101.105C600.572 100.042 600.354 99.2531 599.917 98.7379C599.486 98.2163 598.945 97.9554 598.293 97.9554C597.628 97.9554 597.07 98.2195 596.62 98.7477C596.177 99.2759 595.955 100.114 595.955 101.262C595.955 102.403 596.17 103.228 596.601 103.736C597.031 104.238 597.563 104.489 598.195 104.489C598.828 104.489 599.382 104.206 599.858 103.638C600.334 103.071 600.572 102.227 600.572 101.105ZM612.779 106.426V104.871C612.401 105.425 611.902 105.862 611.283 106.182C610.67 106.501 610.021 106.661 609.336 106.661C608.638 106.661 608.012 106.508 607.458 106.201C606.904 105.895 606.503 105.464 606.255 104.91C606.007 104.356 605.883 103.589 605.883 102.611V96.0383H608.632V100.812C608.632 102.272 608.681 103.169 608.779 103.501C608.883 103.828 609.069 104.088 609.336 104.284C609.603 104.473 609.943 104.568 610.353 104.568C610.823 104.568 611.243 104.44 611.615 104.186C611.987 103.925 612.241 103.606 612.378 103.228C612.515 102.843 612.584 101.907 612.584 100.42V96.0383H615.332V106.426H612.779ZM618.188 94.6297V92.0866H620.937V94.6297H618.188ZM618.188 106.426V96.0383H620.937V106.426H618.188ZM622.658 106.426V104.284L626.551 99.8139C627.19 99.0835 627.663 98.5651 627.97 98.2586C627.65 98.2782 627.229 98.2912 626.708 98.2978L623.04 98.3173V96.0383H631.628V97.9848L627.657 102.562L626.258 104.079C627.021 104.033 627.494 104.01 627.676 104.01H631.931V106.426H622.658Z",fill:"black"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_4819_14395",children:d.jsx("rect",{width:"207",height:"80.129",fill:"white",transform:"translate(432 30)"})})})]}),yU=e=>d.jsxs("svg",{...e,width:"750",height:"140",viewBox:"0 0 750 140",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("rect",{width:"750",height:"140",rx:"70",fill:"#444757"}),d.jsx("path",{d:"M129.645 88.55C126.272 88.55 123.467 87.9267 121.23 86.68C119.03 85.4333 117.362 83.6917 116.225 81.455C115.088 79.2183 114.465 76.615 114.355 73.645C114.318 72.1417 114.3 70.5283 114.3 68.805C114.3 67.0817 114.318 65.4317 114.355 63.855C114.465 60.885 115.088 58.2817 116.225 56.045C117.362 53.8083 119.03 52.0667 121.23 50.82C123.467 49.5733 126.272 48.95 129.645 48.95C132.175 48.95 134.393 49.2983 136.3 49.995C138.207 50.6917 139.783 51.6267 141.03 52.8C142.313 53.9733 143.285 55.2933 143.945 56.76C144.605 58.19 144.972 59.675 145.045 61.215C145.082 61.545 144.972 61.82 144.715 62.04C144.495 62.26 144.22 62.37 143.89 62.37H140.865C140.535 62.37 140.242 62.2783 139.985 62.095C139.765 61.9117 139.6 61.5817 139.49 61.105C138.867 58.245 137.693 56.2833 135.97 55.22C134.283 54.1567 132.157 53.625 129.59 53.625C126.657 53.625 124.328 54.4683 122.605 56.155C120.882 57.805 119.947 60.4633 119.8 64.13C119.69 67.1367 119.69 70.2167 119.8 73.37C119.947 77.0367 120.882 79.7133 122.605 81.4C124.328 83.05 126.657 83.875 129.59 83.875C132.157 83.875 134.283 83.3433 135.97 82.28C137.693 81.2167 138.867 79.255 139.49 76.395C139.6 75.9183 139.765 75.5883 139.985 75.405C140.242 75.2217 140.535 75.13 140.865 75.13H143.89C144.22 75.13 144.495 75.24 144.715 75.46C144.972 75.68 145.082 75.955 145.045 76.285C144.972 77.825 144.605 79.3283 143.945 80.795C143.285 82.225 142.313 83.5267 141.03 84.7C139.783 85.8733 138.207 86.8083 136.3 87.505C134.393 88.2017 132.175 88.55 129.645 88.55ZM150.051 94.05C149.684 94.05 149.373 93.9217 149.116 93.665C148.896 93.445 148.786 93.1517 148.786 92.785V84.865C148.786 84.4983 148.896 84.205 149.116 83.985C149.373 83.7283 149.684 83.6 150.051 83.6H150.326C151.316 83.5633 152.159 83.0133 152.856 81.95C153.553 80.85 154.084 79.145 154.451 76.835C154.818 74.4883 155.001 71.445 155.001 67.705V60.665C155.001 60.2983 155.111 60.005 155.331 59.785C155.588 59.5283 155.899 59.4 156.266 59.4H173.811C174.178 59.4 174.471 59.5283 174.691 59.785C174.948 60.005 175.076 60.2983 175.076 60.665V83.49H177.661C178.064 83.49 178.376 83.6183 178.596 83.875C178.816 84.095 178.926 84.3883 178.926 84.755V92.785C178.926 93.1517 178.816 93.445 178.596 93.665C178.376 93.9217 178.064 94.05 177.661 94.05H175.076C174.709 94.05 174.398 93.9217 174.141 93.665C173.921 93.445 173.811 93.1517 173.811 92.785V88H153.901V92.785C153.901 93.1517 153.773 93.445 153.516 93.665C153.296 93.9217 153.003 94.05 152.636 94.05H150.051ZM156.871 83.6L169.961 83.49V63.8H160.006V68.31C160.006 72.1967 159.731 75.3867 159.181 77.88C158.631 80.3367 157.861 82.2433 156.871 83.6ZM196.064 88.55C192.288 88.55 189.281 87.395 187.044 85.085C184.808 82.7383 183.579 79.5483 183.359 75.515C183.323 75.0383 183.304 74.4333 183.304 73.7C183.304 72.93 183.323 72.3067 183.359 71.83C183.506 69.2267 184.111 66.9533 185.174 65.01C186.238 63.03 187.686 61.5083 189.519 60.445C191.389 59.3817 193.571 58.85 196.064 58.85C198.851 58.85 201.179 59.4367 203.049 60.61C204.956 61.7833 206.404 63.4517 207.394 65.615C208.384 67.7783 208.879 70.3083 208.879 73.205V74.14C208.879 74.5433 208.751 74.855 208.494 75.075C208.274 75.295 207.981 75.405 207.614 75.405H188.584C188.584 75.4417 188.584 75.515 188.584 75.625C188.584 75.735 188.584 75.8267 188.584 75.9C188.658 77.4033 188.988 78.815 189.574 80.135C190.161 81.4183 191.004 82.4633 192.104 83.27C193.204 84.0767 194.524 84.48 196.064 84.48C197.384 84.48 198.484 84.2783 199.364 83.875C200.244 83.4717 200.959 83.0317 201.509 82.555C202.059 82.0417 202.426 81.6567 202.609 81.4C202.939 80.9233 203.196 80.6483 203.379 80.575C203.563 80.465 203.856 80.41 204.259 80.41H206.899C207.266 80.41 207.559 80.52 207.779 80.74C208.036 80.9233 208.146 81.1983 208.109 81.565C208.073 82.115 207.779 82.7933 207.229 83.6C206.679 84.37 205.891 85.14 204.864 85.91C203.838 86.68 202.591 87.3217 201.124 87.835C199.658 88.3117 197.971 88.55 196.064 88.55ZM188.584 71.61H203.654V71.445C203.654 69.795 203.343 68.3283 202.719 67.045C202.133 65.7617 201.271 64.7533 200.134 64.02C198.998 63.25 197.641 62.865 196.064 62.865C194.488 62.865 193.131 63.25 191.994 64.02C190.894 64.7533 190.051 65.7617 189.464 67.045C188.878 68.3283 188.584 69.795 188.584 71.445V71.61ZM214.081 88C213.714 88 213.402 87.8717 213.146 87.615C212.889 87.3583 212.761 87.0467 212.761 86.68V84.645C212.761 83.875 213.146 83.4717 213.916 83.435C215.052 83.3983 216.006 82.8667 216.776 81.84C217.546 80.7767 218.132 79.1083 218.536 76.835C218.939 74.525 219.141 71.4817 219.141 67.705V60.665C219.141 60.2983 219.251 60.005 219.471 59.785C219.727 59.5283 220.039 59.4 220.406 59.4H237.896C238.262 59.4 238.556 59.5283 238.776 59.785C239.032 60.005 239.161 60.2983 239.161 60.665V86.735C239.161 87.1017 239.032 87.4133 238.776 87.67C238.556 87.89 238.262 88 237.896 88H235.256C234.889 88 234.596 87.89 234.376 87.67C234.156 87.4133 234.046 87.1017 234.046 86.735V63.8H224.146V68.31C224.146 71.83 223.944 74.855 223.541 77.385C223.137 79.8783 222.514 81.9133 221.671 83.49C220.864 85.03 219.819 86.1667 218.536 86.9C217.289 87.6333 215.804 88 214.081 88ZM255.335 88.55C253.502 88.55 251.833 88.1833 250.33 87.45C248.827 86.7167 247.617 85.7267 246.7 84.48C245.783 83.2333 245.325 81.8217 245.325 80.245C245.325 77.715 246.352 75.6983 248.405 74.195C250.458 72.6917 253.135 71.7017 256.435 71.225L264.63 70.07V68.475C264.63 66.715 264.117 65.34 263.09 64.35C262.1 63.36 260.468 62.865 258.195 62.865C256.545 62.865 255.207 63.195 254.18 63.855C253.19 64.515 252.493 65.3583 252.09 66.385C251.87 66.935 251.485 67.21 250.935 67.21H248.46C248.057 67.21 247.745 67.1 247.525 66.88C247.342 66.6233 247.25 66.33 247.25 66C247.25 65.45 247.452 64.7717 247.855 63.965C248.295 63.1583 248.955 62.37 249.835 61.6C250.715 60.83 251.833 60.1883 253.19 59.675C254.583 59.125 256.27 58.85 258.25 58.85C260.45 58.85 262.302 59.1433 263.805 59.73C265.308 60.28 266.482 61.0317 267.325 61.985C268.205 62.9383 268.828 64.02 269.195 65.23C269.598 66.44 269.8 67.6683 269.8 68.915V86.735C269.8 87.1017 269.672 87.4133 269.415 87.67C269.195 87.89 268.902 88 268.535 88H266.005C265.602 88 265.29 87.89 265.07 87.67C264.85 87.4133 264.74 87.1017 264.74 86.735V84.37C264.263 85.03 263.622 85.69 262.815 86.35C262.008 86.9733 261 87.505 259.79 87.945C258.58 88.3483 257.095 88.55 255.335 88.55ZM256.49 84.425C257.993 84.425 259.368 84.1133 260.615 83.49C261.862 82.83 262.833 81.8217 263.53 80.465C264.263 79.1083 264.63 77.4033 264.63 75.35V73.81L258.25 74.745C255.647 75.1117 253.685 75.735 252.365 76.615C251.045 77.4583 250.385 78.54 250.385 79.86C250.385 80.8867 250.678 81.7483 251.265 82.445C251.888 83.105 252.658 83.6 253.575 83.93C254.528 84.26 255.5 84.425 256.49 84.425ZM278.972 88C278.605 88 278.293 87.89 278.037 87.67C277.817 87.4133 277.707 87.1017 277.707 86.735V60.665C277.707 60.2983 277.817 60.005 278.037 59.785C278.293 59.5283 278.605 59.4 278.972 59.4H281.612C281.978 59.4 282.272 59.5283 282.492 59.785C282.712 60.005 282.822 60.2983 282.822 60.665V71.225H297.837V60.665C297.837 60.2983 297.947 60.005 298.167 59.785C298.423 59.5283 298.735 59.4 299.102 59.4H301.687C302.053 59.4 302.347 59.5283 302.567 59.785C302.823 60.005 302.952 60.2983 302.952 60.665V86.735C302.952 87.1017 302.823 87.4133 302.567 87.67C302.347 87.89 302.053 88 301.687 88H299.102C298.735 88 298.423 87.89 298.167 87.67C297.947 87.4133 297.837 87.1017 297.837 86.735V75.625H282.822V86.735C282.822 87.1017 282.712 87.4133 282.492 87.67C282.272 87.89 281.978 88 281.612 88H278.972ZM322.937 88.55C320.151 88.55 317.822 88.0183 315.952 86.955C314.082 85.8917 312.652 84.425 311.662 82.555C310.672 80.6483 310.122 78.485 310.012 76.065C309.976 75.4417 309.957 74.6533 309.957 73.7C309.957 72.71 309.976 71.9217 310.012 71.335C310.122 68.8783 310.672 66.715 311.662 64.845C312.689 62.975 314.137 61.5083 316.007 60.445C317.877 59.3817 320.187 58.85 322.937 58.85C325.687 58.85 327.997 59.3817 329.867 60.445C331.737 61.5083 333.167 62.975 334.157 64.845C335.184 66.715 335.752 68.8783 335.862 71.335C335.899 71.9217 335.917 72.71 335.917 73.7C335.917 74.6533 335.899 75.4417 335.862 76.065C335.752 78.485 335.202 80.6483 334.212 82.555C333.222 84.425 331.792 85.8917 329.922 86.955C328.052 88.0183 325.724 88.55 322.937 88.55ZM322.937 84.315C325.211 84.315 327.026 83.6 328.382 82.17C329.739 80.7033 330.472 78.5767 330.582 75.79C330.619 75.24 330.637 74.5433 330.637 73.7C330.637 72.8567 330.619 72.16 330.582 71.61C330.472 68.8233 329.739 66.715 328.382 65.285C327.026 63.8183 325.211 63.085 322.937 63.085C320.664 63.085 318.831 63.8183 317.437 65.285C316.081 66.715 315.366 68.8233 315.292 71.61C315.256 72.16 315.237 72.8567 315.237 73.7C315.237 74.5433 315.256 75.24 315.292 75.79C315.366 78.5767 316.081 80.7033 317.437 82.17C318.831 83.6 320.664 84.315 322.937 84.315ZM357.551 88C357.184 88 356.872 87.89 356.616 87.67C356.396 87.4133 356.286 87.1017 356.286 86.735V60.665C356.286 60.2983 356.396 60.005 356.616 59.785C356.872 59.5283 357.184 59.4 357.551 59.4H360.191C360.557 59.4 360.851 59.5283 361.071 59.785C361.291 60.005 361.401 60.2983 361.401 60.665V71.225H376.416V60.665C376.416 60.2983 376.526 60.005 376.746 59.785C377.002 59.5283 377.314 59.4 377.681 59.4H380.266C380.632 59.4 380.926 59.5283 381.146 59.785C381.402 60.005 381.531 60.2983 381.531 60.665V86.735C381.531 87.1017 381.402 87.4133 381.146 87.67C380.926 87.89 380.632 88 380.266 88H377.681C377.314 88 377.002 87.89 376.746 87.67C376.526 87.4133 376.416 87.1017 376.416 86.735V75.625H361.401V86.735C361.401 87.1017 361.291 87.4133 361.071 87.67C360.851 87.89 360.557 88 360.191 88H357.551ZM397.776 88.55C395.943 88.55 394.275 88.1833 392.771 87.45C391.268 86.7167 390.058 85.7267 389.141 84.48C388.225 83.2333 387.766 81.8217 387.766 80.245C387.766 77.715 388.793 75.6983 390.846 74.195C392.9 72.6917 395.576 71.7017 398.876 71.225L407.071 70.07V68.475C407.071 66.715 406.558 65.34 405.531 64.35C404.541 63.36 402.91 62.865 400.636 62.865C398.986 62.865 397.648 63.195 396.621 63.855C395.631 64.515 394.935 65.3583 394.531 66.385C394.311 66.935 393.926 67.21 393.376 67.21H390.901C390.498 67.21 390.186 67.1 389.966 66.88C389.783 66.6233 389.691 66.33 389.691 66C389.691 65.45 389.893 64.7717 390.296 63.965C390.736 63.1583 391.396 62.37 392.276 61.6C393.156 60.83 394.275 60.1883 395.631 59.675C397.025 59.125 398.711 58.85 400.691 58.85C402.891 58.85 404.743 59.1433 406.246 59.73C407.75 60.28 408.923 61.0317 409.766 61.985C410.646 62.9383 411.27 64.02 411.636 65.23C412.04 66.44 412.241 67.6683 412.241 68.915V86.735C412.241 87.1017 412.113 87.4133 411.856 87.67C411.636 87.89 411.343 88 410.976 88H408.446C408.043 88 407.731 87.89 407.511 87.67C407.291 87.4133 407.181 87.1017 407.181 86.735V84.37C406.705 85.03 406.063 85.69 405.256 86.35C404.45 86.9733 403.441 87.505 402.231 87.945C401.021 88.3483 399.536 88.55 397.776 88.55ZM398.931 84.425C400.435 84.425 401.81 84.1133 403.056 83.49C404.303 82.83 405.275 81.8217 405.971 80.465C406.705 79.1083 407.071 77.4033 407.071 75.35V73.81L400.691 74.745C398.088 75.1117 396.126 75.735 394.806 76.615C393.486 77.4583 392.826 78.54 392.826 79.86C392.826 80.8867 393.12 81.7483 393.706 82.445C394.33 83.105 395.1 83.6 396.016 83.93C396.97 84.26 397.941 84.425 398.931 84.425Z",fill:"#F2F3F7"}),d.jsxs("g",{clipPath:"url(#clip0_4819_14374)",children:[d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M461.886 33.8256C453.446 32.8478 447.622 41.9149 442.205 48.4691C437.452 54.2209 433.912 60.7178 433.501 68.1717C433.064 76.1021 434.502 84.3611 439.905 90.1773C445.47 96.1684 453.806 99.9538 461.886 98.7299C469.296 97.6077 472.574 89.4712 478.091 84.3936C484.08 78.8802 495.239 76.3159 495.084 68.1717C494.929 60.0151 483.152 58.4185 477.485 52.5557C471.616 46.483 470.272 34.7969 461.886 33.8256Z",fill:"#7E2AEA"}),d.jsx("circle",{cx:"482.884",cy:"95.6408",r:"4.65763",fill:"#7E2AEA"}),d.jsx("circle",{cx:"478.227",cy:"43.9516",r:"1.77434",fill:"#7E2AEA"}),d.jsx("path",{d:"M506.606 66.259C506.089 61.2292 503.722 56.5706 499.966 53.1862C496.209 49.8018 491.33 47.9327 486.273 47.9411C485.555 47.9415 484.838 47.979 484.124 48.0536C479.096 48.5815 474.443 50.9524 471.06 54.7089C467.677 58.4654 465.805 63.3414 465.805 68.3966V68.3966V97.6187H474.571V85.1993C477.999 87.5839 482.076 88.8589 486.251 88.8521C486.969 88.8518 487.687 88.8143 488.401 88.7396C491.072 88.4588 493.662 87.6546 496.023 86.3728C498.384 85.091 500.469 83.3568 502.16 81.2691C503.85 79.1814 505.113 76.7812 505.876 74.2056C506.639 71.6299 506.887 68.9291 506.606 66.2576V66.259ZM495.347 75.7562C494.384 76.9525 493.193 77.9458 491.843 78.6786C490.494 79.4115 489.012 79.8693 487.485 80.0255C487.075 80.0681 486.663 80.0896 486.251 80.0898C483.6 80.0874 481.028 79.1837 478.958 77.5271C476.889 75.8705 475.443 73.5594 474.86 70.9731C474.276 68.3868 474.59 65.679 475.748 63.2942C476.906 60.9093 478.841 58.9891 481.234 57.8487C483.628 56.7083 486.338 56.4155 488.92 57.0183C491.502 57.6211 493.802 59.0836 495.443 61.166C497.084 63.2483 497.968 65.8267 497.951 68.4779C497.933 71.1291 497.015 73.6956 495.347 75.7562Z",fill:"#F9F9F9"}),d.jsx("path",{d:"M529.478 47.9411C528.76 47.9414 528.043 47.979 527.329 48.0536C522.119 48.6022 517.319 51.1284 513.917 55.1114C510.515 59.0944 508.771 64.2307 509.043 69.4618C509.316 74.6928 511.585 79.6199 515.383 83.2274C519.181 86.835 524.218 88.8482 529.456 88.8521C530.174 88.8518 530.891 88.8143 531.605 88.7396C535.361 88.3397 538.934 86.9109 541.93 84.6105C544.926 82.3102 547.229 79.2275 548.585 75.7021H538.592L538.551 75.7532C537.272 77.3353 535.601 78.5558 533.704 79.294C531.808 80.0322 529.752 80.2626 527.739 79.9622C525.726 79.6619 523.827 78.8413 522.229 77.5816C520.63 76.3219 519.389 74.6667 518.626 72.7799H549.456C550.105 69.7933 550.078 66.6993 549.376 63.7246C548.674 60.75 547.316 57.97 545.4 55.5884C543.485 53.2068 541.061 51.284 538.306 49.9607C535.551 48.6375 532.534 47.9474 529.478 47.9411V47.9411ZM518.626 64.0133C519.424 62.0489 520.741 60.338 522.434 59.0627C524.128 57.7875 526.136 56.9958 528.245 56.772C528.655 56.7295 529.066 56.708 529.478 56.7077C531.807 56.7038 534.083 57.3977 536.013 58.6999C537.943 60.0021 539.439 61.8528 540.308 64.0133H518.626Z",fill:"#F9F9F9"}),d.jsx("path",{d:"M571.115 47.9411C567.765 47.9358 564.478 48.8571 561.618 50.6033V47.9411H552.852V88.8521H561.618V66.205C561.618 63.6861 562.619 61.2705 564.4 59.4894C566.181 57.7084 568.597 56.7078 571.115 56.7078C573.634 56.7078 576.05 57.7084 577.831 59.4894C579.612 61.2705 580.613 63.6861 580.613 66.205V88.8521H589.379V66.205C589.379 61.3611 587.455 56.7156 584.03 53.2905C580.605 49.8653 575.959 47.9411 571.115 47.9411Z",fill:"#F9F9F9"}),d.jsx("path",{d:"M633.214 71.0105V47.9411H624.447V51.5939C621.02 49.2083 616.943 47.9332 612.767 47.9411C612.049 47.9415 611.332 47.979 610.618 48.0536C605.408 48.6023 600.608 51.1284 597.206 55.1114C593.804 59.0944 592.06 64.2308 592.332 69.4618C592.605 74.6928 594.874 79.6199 598.672 83.2275C602.47 86.8351 607.507 88.8483 612.745 88.8521C613.463 88.8518 614.18 88.8143 614.894 88.7396C619.99 88.2182 624.7 85.7909 628.081 81.944C630.708 85.459 634.513 87.9112 638.8 88.8521V79.6617C637.136 78.9083 635.725 77.6919 634.734 76.1577C633.744 74.6236 633.216 72.8367 633.214 71.0105ZM621.841 75.7533C620.877 76.9493 619.687 77.9424 618.337 78.6753C616.987 79.4081 615.506 79.866 613.978 80.0226C613.569 80.0652 613.157 80.0866 612.745 80.0869C609.75 80.0868 606.869 78.9369 604.697 76.8746C602.525 74.8123 601.228 71.9949 601.073 69.0038C600.917 66.0127 601.916 63.0761 603.863 60.8001C605.81 58.524 608.556 57.0822 611.535 56.7721C611.945 56.7295 612.356 56.708 612.767 56.7078C614.974 56.7097 617.135 57.3363 619.001 58.5151C620.867 59.694 622.36 61.3769 623.31 63.3693C624.259 65.3617 624.625 67.582 624.365 69.7736C624.105 71.9651 623.23 74.0383 621.841 75.7533Z",fill:"#F9F9F9"}),d.jsx("path",{d:"M600.484 110.378V105.155C600.125 105.617 599.679 105.986 599.144 106.26C598.609 106.527 598.032 106.661 597.413 106.661C596.232 106.661 595.261 106.217 594.498 105.331C593.598 104.294 593.148 102.888 593.148 101.115C593.148 99.4454 593.569 98.1445 594.41 97.212C595.257 96.273 596.307 95.8035 597.559 95.8035C598.251 95.8035 598.847 95.9502 599.349 96.2437C599.858 96.5371 600.308 96.9805 600.699 97.5739V96.0383H603.233V110.378H600.484ZM600.572 101.105C600.572 100.042 600.354 99.2531 599.917 98.7379C599.486 98.2162 598.945 97.9554 598.293 97.9554C597.628 97.9554 597.07 98.2195 596.62 98.7477C596.177 99.2759 595.955 100.114 595.955 101.262C595.955 102.403 596.17 103.228 596.601 103.736C597.031 104.238 597.563 104.489 598.195 104.489C598.828 104.489 599.382 104.206 599.858 103.638C600.334 103.071 600.572 102.227 600.572 101.105ZM612.779 106.426V104.871C612.401 105.425 611.902 105.862 611.283 106.182C610.67 106.501 610.021 106.661 609.336 106.661C608.638 106.661 608.012 106.508 607.458 106.201C606.904 105.895 606.503 105.464 606.255 104.91C606.007 104.356 605.883 103.589 605.883 102.611V96.0383H608.632V100.812C608.632 102.272 608.681 103.169 608.779 103.501C608.883 103.827 609.069 104.088 609.336 104.284C609.603 104.473 609.943 104.568 610.353 104.568C610.823 104.568 611.243 104.44 611.615 104.186C611.987 103.925 612.241 103.606 612.378 103.228C612.515 102.843 612.584 101.907 612.584 100.42V96.0383H615.332V106.426H612.779ZM618.188 94.6297V92.0866H620.937V94.6297H618.188ZM618.188 106.426V96.0383H620.937V106.426H618.188ZM622.658 106.426V104.284L626.551 99.8139C627.19 99.0835 627.663 98.5651 627.97 98.2586C627.65 98.2782 627.229 98.2912 626.708 98.2978L623.04 98.3173V96.0383H631.628V97.9848L627.657 102.562L626.258 104.079C627.021 104.033 627.494 104.01 627.676 104.01H631.931V106.426H622.658Z",fill:"#F7F7F7"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_4819_14374",children:d.jsx("rect",{width:"207",height:"80.129",fill:"white",transform:"translate(432 30)"})})})]});function M4(e){throw new Error(`Shouldn't reach here: ${e}`)}const vU=()=>{const e=Le(),t=$t(u=>u.settings),n=$t(u=>u.items),[r,o]=b.useState(),[i,s]=b.useState(!1),[a,l]=b.useState(!1),c=ln(e.breakpoints.down(650));if(b.useEffect(()=>{if(t!=null&&t.cfg.haveRoot){const u=ku((t==null?void 0:t.cfg.haveRoot)||"");if(u!=null&&u.type){o(u);return}}else o(n[0])},[]),!t)throw new Error("settings is null");return!r||r.type==="result"?"не смог отобразить вопрос":d.jsxs(X,{sx:{backgroundColor:e.palette.background.default,height:c?void 0:"100vh"},children:[!i&&!a&&d.jsxs(X,{sx:{height:"calc(100vh - 75px)",width:"100%",maxWidth:"1440px",padding:"40px 25px 20px",margin:"0 auto",overflow:"auto",display:"flex",flexDirection:"column",justifyContent:"space-between"},children:[d.jsx(xU,{question:r}),Kn[t.cfg.theme].isLight?d.jsx(gU,{style:{fontSize:"34px",width:"200px",height:"auto"}}):d.jsx(yU,{style:{fontSize:"34px",width:"200px",height:"auto"}})]}),a&&(t==null?void 0:t.cfg.resultInfo.showResultForm)==="before"&&d.jsx(i5,{currentQuestion:r,showContactForm:i,setShowContactForm:s,setShowResultForm:l}),i&&d.jsx(kH,{currentQuestion:r,showResultForm:a,setShowContactForm:s,setShowResultForm:l}),a&&(t==null?void 0:t.cfg.resultInfo.showResultForm)==="after"&&d.jsx(i5,{currentQuestion:r,showContactForm:i,setShowContactForm:s,setShowResultForm:l}),!i&&!a&&d.jsx(NH,{question:r,setCurrentQuestion:o,setShowContactForm:s,setShowResultForm:l})]})};function xU({question:e}){switch(e.type){case"variant":return d.jsx(pU,{currentQuestion:e});case"images":return d.jsx(KH,{currentQuestion:e});case"varimg":return d.jsx(mU,{currentQuestion:e});case"emoji":return d.jsx(BH,{currentQuestion:e});case"text":return d.jsx(dU,{currentQuestion:e});case"select":return d.jsx(uU,{currentQuestion:e});case"date":return d.jsx(zH,{currentQuestion:e});case"number":return d.jsx(XH,{currentQuestion:e});case"file":return d.jsx(GH,{currentQuestion:e});case"page":return d.jsx(JH,{currentQuestion:e});case"rating":return d.jsx(aU,{currentQuestion:e});default:return M4(e)}}function CU(){const[e,t]=b.useState(!1);return b.useEffect(()=>{const n=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);t(n)},[navigator.userAgent]),{isMobileDevice:e}}const bU=({setVisualStartPage:e})=>{const t=Le(),{settings:n}=$t(),{isMobileDevice:r}=CU(),o=ln(t.breakpoints.down(650));if(!n)throw new Error("settings is null");const i=()=>{navigator.clipboard.writeText(n.cfg.info.phonenumber)},s=n.cfg.startpage.background.type==="image"?n.cfg.startpage.background.desktop?d.jsx("img",{src:n.cfg.startpage.background.desktop,alt:"",style:{width:"100%",height:"100%",objectFit:"cover",overflow:"hidden"}}):null:n.cfg.startpage.background.type==="video"&&n.cfg.startpage.background.video?d.jsx(Tg,{videoUrl:n.cfg.startpage.background.video,containerSX:{width:n.cfg.startpageType==="centered"?"550px":n.cfg.startpageType==="expanded"?"100vw":"100%",height:n.cfg.startpageType==="centered"?"275px":n.cfg.startpageType==="expanded"?"100vh":"100%",borderRadius:n.cfg.startpageType==="centered"?"10px":"0",overflow:"hidden","& iframe":{width:"100%",height:"100%",transform:n.cfg.startpageType==="centered"?"":n.cfg.startpageType==="expanded"?"scale(1.5)":"scale(2.4)"}}}):null;return d.jsx(ql,{className:"settings-preview-draghandle",sx:{height:"100vh",width:"100vw",background:n.cfg.startpageType==="expanded"&&!o?n.cfg.startpage.position==="left"?"linear-gradient(90deg,#272626,transparent)":n.cfg.startpage.position==="center"?"linear-gradient(180deg,transparent,#272626)":"linear-gradient(270deg,#272626,transparent)":t.palette.background.default,color:n.cfg.startpageType==="expanded"?"white":"black"},children:d.jsx(wU,{quizHeaderBlock:d.jsxs(X,{p:n.cfg.startpageType==="standard"?"":"16px",children:[d.jsxs(X,{sx:{display:"flex",alignItems:"center",gap:"20px",mb:"7px"},children:[n.cfg.startpage.logo&&d.jsx("img",{src:n.cfg.startpage.logo,style:{height:"37px",maxWidth:"43px",objectFit:"cover"},alt:""}),d.jsx(Re,{sx:{fontSize:"14px",color:n.cfg.startpageType==="expanded"&&!o?"white":t.palette.text.primary},children:n.cfg.info.orgname})]}),d.jsx(ad,{mb:"16px",href:n.cfg.info.site,children:d.jsx(Re,{sx:{fontSize:"16px",color:t.palette.primary.main},children:n.cfg.info.site})})]}),quizMainBlock:d.jsxs(d.Fragment,{children:[d.jsxs(X,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:n.cfg.startpageType==="centered"||n.cfg.startpageType==="expanded"&&n.cfg.startpage.position==="center"?"center":"start",mt:"28px",width:"100%"},children:[d.jsx(Re,{sx:{fontWeight:"bold",fontSize:"26px",fontStyle:"normal",fontStretch:"normal",lineHeight:"1.2",overflowWrap:"break-word",width:"100%",textAlign:n.cfg.startpageType==="centered"?"center":"-moz-initial",color:n.cfg.startpageType==="expanded"&&!o?"white":t.palette.text.primary},children:n.name}),d.jsx(Re,{sx:{fontSize:"16px",m:"16px 0",overflowWrap:"break-word",width:"100%",textAlign:n.cfg.startpageType==="centered"?"center":"-moz-initial"},children:n.cfg.startpage.description}),d.jsx(X,{width:n.cfg.startpageType==="standard"?"100%":"auto",children:d.jsx(Er,{variant:"contained",sx:{fontSize:"16px",padding:"10px 15px",width:n.cfg.startpageType==="standard"?"100%":"auto"},onClick:()=>e(!1),children:n.cfg.startpage.button.trim()?n.cfg.startpage.button:"Пройти тест"})})]}),d.jsxs(X,{sx:{mt:"46px",display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",flexDirection:o?"column":"row"},children:[d.jsxs(X,{sx:{maxWidth:"300px"},children:[n.cfg.info.clickable?r?d.jsx(ad,{href:`tel:${n.cfg.info.phonenumber}`,children:d.jsx(Re,{sx:{fontSize:"16px",color:t.palette.primary.main},children:n.cfg.info.phonenumber})}):d.jsx($r,{onClick:i,children:d.jsx(Re,{sx:{fontSize:"16px",color:t.palette.primary.main},children:n.cfg.info.phonenumber})}):d.jsx(Re,{sx:{fontSize:"16px",color:t.palette.primary.main},children:n.cfg.info.phonenumber}),d.jsx(Re,{sx:{width:"100%",overflowWrap:"break-word",fontSize:"12px",textAlign:"end",color:n.cfg.startpageType==="expanded"&&!o?"white":t.palette.text.primary},children:n.cfg.info.law})]}),d.jsxs(X,{sx:{display:"flex",alignItems:"center",gap:"15px"},children:[d.jsx(Pg,{style:{fontSize:"34px",color:n.cfg.startpageType==="expanded"&&!o?"#FFFFFF":Kn[n.cfg.theme].isLight?"#151515":"#FFFFFF"}}),d.jsx(Re,{sx:{fontSize:"20px",color:n.cfg.startpageType==="expanded"&&!o?"#F5F7FF":Kn[n.cfg.theme].isLight?"#4D4D4D":"#F5F7FF",whiteSpace:"nowrap"},children:"Сделано на PenaQuiz"})]})]})]}),backgroundBlock:s,startpageType:n.cfg.startpageType,alignType:n.cfg.startpage.position})})};function wU({quizHeaderBlock:e,quizMainBlock:t,backgroundBlock:n,startpageType:r,alignType:o}){const i=Le(),s=ln(i.breakpoints.down(650));function a(){return d.jsxs(X,{sx:{display:"flex",flexDirection:"column-reverse",flexGrow:1,justifyContent:"flex-end",height:"100vh","&::-webkit-scrollbar":{width:0}},children:[d.jsxs(X,{sx:{width:"100%",display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",p:"25px",height:"80%"},children:[e,d.jsx(X,{sx:{height:"80%",display:"flex",flexDirection:"column",justifyContent:"space-between",width:"100%"},children:t})]}),d.jsx(X,{sx:{width:"100%",overflow:"hidden"},children:n})]})}switch(r){case null:case"standard":return d.jsx(d.Fragment,{children:s?d.jsx(a,{}):d.jsxs(X,{sx:{display:"flex",flexDirection:o==="left"?s?"column-reverse":"row":"row-reverse",flexGrow:1,justifyContent:s?"flex-end":void 0,height:"100vh","&::-webkit-scrollbar":{width:0}},children:[d.jsxs(X,{sx:{width:s?"100%":"40%",display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"flex-start",p:"25px",height:s?"80%":void 0},children:[e,t]}),d.jsx(X,{sx:{width:s?"100%":"60%",overflow:"hidden"},children:n})]})});case"expanded":return d.jsx(d.Fragment,{children:s?d.jsx(a,{}):d.jsxs(X,{sx:{position:"relative",display:"flex",justifyContent:SU[o],flexGrow:1,height:"100%","&::-webkit-scrollbar":{width:0}},children:[d.jsxs(X,{sx:{width:"40%",position:"relative",padding:"16px",zIndex:3,display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:o==="center"?"center":"start"},children:[e,t]}),d.jsx(X,{sx:{position:"absolute",zIndex:-1,left:0,top:0,height:"100%",width:"100%",overflow:"hidden"},children:n})]})});case"centered":return d.jsx(d.Fragment,{children:s?d.jsx(a,{}):d.jsxs(X,{sx:{padding:"16px",display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"center",height:"100%","&::-webkit-scrollbar":{width:0},overflow:"hidden"},children:[e,n&&d.jsx(X,{sx:{width:"60%",overflow:"hidden",display:"flex",justifyContent:"center"},children:n}),t]})});default:M4(r)}}const SU={left:"start",center:"center",right:"end"};function kU(e,t){const n=e.items.map(o=>{const i=JSON.parse(o.c);return{description:o.desc,id:o.id,page:o.p,required:o.req,title:o.title,type:o.typ,content:i}}),r={qid:t,fp:e.settings.fp,rep:e.settings.rep,name:e.settings.name,cfg:JSON.parse(e==null?void 0:e.settings.cfg),lim:e.settings.lim,due:e.settings.due,delay:e.settings.delay,pausable:e.settings.pausable};return{cnt:e.cnt,settings:r,items:n}}const s0=e=>{if(Array.isArray(e))return e.map(s0);if(!e||typeof e!="object")return e;const t={};for(const[n,r]of Object.entries(e)){if(typeof r=="string"){t[n]=r.replace("squiz.pena.digital","storage.yandexcloud.net");continue}if(typeof r=="object"){t[n]=s0(r);continue}t[n]=r}return t},l5=({quizId:e})=>{const{isLoading:t,error:n}=xB(["quizData",e],c=>PU(c[1]),{onSuccess:oH}),{settings:r,items:o,recentlyСompleted:i}=$t(),[s,a]=b.useState();b.useEffect(()=>{if(!r)return;const c=document.querySelector('link[rel="icon"]');c&&r.cfg.startpage.favIcon&&c.setAttribute("href",r==null?void 0:r.cfg.startpage.favIcon),document.title=r.name,a(!r.cfg.noStartPage)},[r]);const l=o.filter(({type:c})=>c!==null&&c!=="result").length;return n?(console.log(n),d.jsx(Pu,{message:"Что-то пошло не так"})):t||!r?d.jsx(iH,{}):l===0?d.jsx(Pu,{message:"Нет созданных вопросов"}):d.jsx(d6,{theme:Kn[r.cfg.theme||"StandardTheme"],children:i?d.jsx(Pu,{message:"Вы уже прошли этот опрос"}):d.jsx(X,{children:s?d.jsx(bU,{setVisualStartPage:a}):d.jsx(vU,{})})})};async function PU(e){const t=await AW(e),n=t.data;if(t.error)throw ct(t.error),new Error(t.error);if(!n)throw new Error("Quiz not found");const r=s0(kU(n,e));return JSON.parse(JSON.stringify({data:r}).replaceAll(/\\" \\"/g,'""').replaceAll(/" "/g,'""')).data}const c5=nn({...Wo,palette:{mode:"light",primary:{main:"#000000"},secondary:{main:"#252734"},text:{primary:"#000000",secondary:"#7E2AEA"},background:{default:"#F2F3F7"},lightPurple:{main:"#333647"},darkPurple:{main:"#252734"},brightPurple:{main:"#7E2AEA"},fadePurple:{main:"#C19AF5"},grey1:{main:"#434657"},grey2:{main:"#9A9AAF"},grey3:{main:"#4D4D4D"},grey4:{main:"#333647"},orange:{main:"#FB5607"},navbarbg:{main:"#FFFFFF"}}}),EU="ef836ff8-35b1-4031-9acf-af5766bac2b2";ce.locale("ru");const MU=M$.components.MuiLocalizationProvider.defaultProps.localeText;function TU({widget:e=!1,quizId:t}){return t??(t=EU),d.jsx(vB,{value:{revalidateOnFocus:!1,shouldRetryOnError:!1},children:d.jsx(Lm,{dateAdapter:sz,adapterLocale:"ru",localeText:MU,children:d.jsx(d6,{theme:c5,children:d.jsxs(Az,{preventDuplicate:!0,style:{backgroundColor:c5.palette.brightPurple.main},children:[d.jsx(JT,{}),e?d.jsx(X,{sx:{width:"100%",height:"100%"},children:d.jsx(l5,{quizId:t})}):d.jsx(X,{sx:{height:"100dvh"},children:d.jsx(l5,{quizId:t})})]})})})})}let Xc;const RU={create({selector:e,quizId:t}){const n=document.getElementById(e);if(!n)throw new Error("Element for widget doesn't exist");Xc=S3(n),Xc.render(d.jsx(TU,{widget:!0,quizId:t}))},unmount(){Xc&&Xc.unmount()}};export{RU as default}; diff --git a/src/pages/ViewPublicationPage/questions/Variant.tsx b/src/pages/ViewPublicationPage/questions/Variant.tsx index 0a46d0e..a552c01 100644 --- a/src/pages/ViewPublicationPage/questions/Variant.tsx +++ b/src/pages/ViewPublicationPage/questions/Variant.tsx @@ -96,6 +96,7 @@ export const Variant = ({ currentQuestion }: VariantProps) => { key={variant.id} currentQuestion={currentQuestion} variant={variant} + // @ts-ignore answer={answer} index={index} /> @@ -105,6 +106,7 @@ export const Variant = ({ currentQuestion }: VariantProps) => { own currentQuestion={currentQuestion} variant={ownVariant.variant} + // @ts-ignore answer={answer} index={currentQuestion.content.variants.length + 2} /> From db541d97efcf1e2893af84fd0d22ba48b54dce33 Mon Sep 17 00:00:00 2001 From: nflnkr <105123049+nflnkr@users.noreply.github.com> Date: Wed, 31 Jan 2024 18:08:01 +0300 Subject: [PATCH 15/81] rename component file to component's name --- src/App.tsx | 2 +- .../ViewPublicationPage/{index.tsx => ViewPublicationPage.tsx} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename src/pages/ViewPublicationPage/{index.tsx => ViewPublicationPage.tsx} (100%) diff --git a/src/App.tsx b/src/App.tsx index 52fd02e..de547f3 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -5,7 +5,7 @@ import { ruRU } from '@mui/x-date-pickers/locales'; import moment from "moment"; import { SnackbarProvider } from 'notistack'; import { SWRConfig } from "swr"; -import { ViewPage } from "./pages/ViewPublicationPage"; +import { ViewPage } from "./pages/ViewPublicationPage/ViewPublicationPage"; import lightTheme from "./utils/themes/light"; diff --git a/src/pages/ViewPublicationPage/index.tsx b/src/pages/ViewPublicationPage/ViewPublicationPage.tsx similarity index 100% rename from src/pages/ViewPublicationPage/index.tsx rename to src/pages/ViewPublicationPage/ViewPublicationPage.tsx From fb3d46110fb9f32e9722b28fd016c2a72741ac68 Mon Sep 17 00:00:00 2001 From: nflnkr <105123049+nflnkr@users.noreply.github.com> Date: Thu, 1 Feb 2024 16:18:16 +0300 Subject: [PATCH 16/81] split widget and default App components use router in default App for retrieving quizId from url add QuizIdContext --- package.json | 1 + src/App.tsx | 62 +++++-------------- src/ContextProviders.tsx | 38 ++++++++++++ src/WidgetApp.tsx | 25 ++++++++ src/contexts/QuizIdContext.ts | 11 ++++ src/main.tsx | 19 +++++- .../ViewPublicationPage.tsx | 7 +-- src/widget.tsx | 4 +- yarn.lock | 20 ++++++ 9 files changed, 133 insertions(+), 54 deletions(-) create mode 100644 src/ContextProviders.tsx create mode 100644 src/WidgetApp.tsx create mode 100644 src/contexts/QuizIdContext.ts diff --git a/package.json b/package.json index c46c491..8d65845 100755 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "notistack": "^3.0.1", "react": "^18.2.0", "react-dom": "^18.2.0", + "react-router-dom": "^6.21.3", "swr": "^2.2.4", "typescript": "^5.2.2", "use-debounce": "^9.0.4", diff --git a/src/App.tsx b/src/App.tsx index de547f3..37efdd9 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,56 +1,24 @@ -import { Box, CssBaseline, ThemeProvider } from "@mui/material"; -import { LocalizationProvider } from "@mui/x-date-pickers"; -import { AdapterMoment } from "@mui/x-date-pickers/AdapterMoment"; -import { ruRU } from '@mui/x-date-pickers/locales'; -import moment from "moment"; -import { SnackbarProvider } from 'notistack'; -import { SWRConfig } from "swr"; +import { Box } from "@mui/material"; +import ContextProviders from "ContextProviders"; +import { QuizIdContext } from "contexts/QuizIdContext"; +import { useParams } from "react-router-dom"; import { ViewPage } from "./pages/ViewPublicationPage/ViewPublicationPage"; -import lightTheme from "./utils/themes/light"; const defaultQuizId = "ef836ff8-35b1-4031-9acf-af5766bac2b2"; -moment.locale("ru"); -const localeText = ruRU.components.MuiLocalizationProvider.defaultProps.localeText; - -interface Props { - widget?: boolean; - quizId?: string; -} - -export default function App({ widget = false, quizId }: Props) { - quizId ??= defaultQuizId; +export default function App() { + const quizId = useParams().quizId ?? defaultQuizId; return ( - - - - - - {widget ? ( - - - - ) : ( - - - - )} - - - - + + + + + + + ); } diff --git a/src/ContextProviders.tsx b/src/ContextProviders.tsx new file mode 100644 index 0000000..ea17a51 --- /dev/null +++ b/src/ContextProviders.tsx @@ -0,0 +1,38 @@ +import { CssBaseline, ThemeProvider } from "@mui/material"; +import { LocalizationProvider } from "@mui/x-date-pickers"; +import { AdapterMoment } from "@mui/x-date-pickers/AdapterMoment"; +import { ruRU } from '@mui/x-date-pickers/locales'; +import moment from "moment"; +import { SnackbarProvider } from 'notistack'; +import { SWRConfig } from "swr"; +import lightTheme from "./utils/themes/light"; + + +moment.locale("ru"); +const localeText = ruRU.components.MuiLocalizationProvider.defaultProps.localeText; + +interface Props { + children: JSX.Element; +} + +export default function ContextProviders({ children }: Props) { + + return ( + + + + + + {children} + + + + + ); +} diff --git a/src/WidgetApp.tsx b/src/WidgetApp.tsx new file mode 100644 index 0000000..539445f --- /dev/null +++ b/src/WidgetApp.tsx @@ -0,0 +1,25 @@ +import { Box } from "@mui/material"; +import ContextProviders from "ContextProviders"; +import { QuizIdContext } from "contexts/QuizIdContext"; +import { ViewPage } from "./pages/ViewPublicationPage/ViewPublicationPage"; + + +interface Props { + quizId: string; +} + +export default function WidgetApp({ quizId }: Props) { + + return ( + + + + + + + + ); +} diff --git a/src/contexts/QuizIdContext.ts b/src/contexts/QuizIdContext.ts new file mode 100644 index 0000000..7bbbe13 --- /dev/null +++ b/src/contexts/QuizIdContext.ts @@ -0,0 +1,11 @@ +import { createContext, useContext } from "react"; + + +export const QuizIdContext = createContext(null); + +export const useQuizId = () => { + const quizId = useContext(QuizIdContext); + if (quizId === null) throw new Error("quizId context is null"); + + return quizId; +}; diff --git a/src/main.tsx b/src/main.tsx index e7b603b..de2d98e 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,7 +1,24 @@ import { createRoot } from "react-dom/client"; +import { RouterProvider, createBrowserRouter } from "react-router-dom"; import App from "./App"; +const router = createBrowserRouter([ + { + path: "/", + children: [ + { + index: true, + element: , + }, + { + path: ":quizId", + element: , + }, + ] + } +]); + const root = createRoot(document.getElementById("root")!); -root.render(); +root.render(); diff --git a/src/pages/ViewPublicationPage/ViewPublicationPage.tsx b/src/pages/ViewPublicationPage/ViewPublicationPage.tsx index 1ba5bab..5080749 100644 --- a/src/pages/ViewPublicationPage/ViewPublicationPage.tsx +++ b/src/pages/ViewPublicationPage/ViewPublicationPage.tsx @@ -13,13 +13,12 @@ import { Question } from "./Question"; import { StartPageViewPublication } from "./StartPageViewPublication"; import { parseQuizData } from "@model/api/getQuizData"; +import { useQuizId } from "contexts/QuizIdContext"; import { replaceSpacesToEmptyLines } from "./tools/replaceSpacesToEmptyLines"; -type Props = { - quizId: string; -}; -export const ViewPage = ({ quizId }: Props) => { +export const ViewPage = () => { + const quizId = useQuizId(); const { isLoading, error } = useSWR(["quizData", quizId], params => getQuizData(params[1]), { onSuccess: setQuizData, }); diff --git a/src/widget.tsx b/src/widget.tsx index f15b706..535ef4d 100644 --- a/src/widget.tsx +++ b/src/widget.tsx @@ -1,5 +1,5 @@ +import WidgetApp from "./WidgetApp"; import { Root, createRoot } from "react-dom/client"; -import App from "./App"; let root: Root | undefined = undefined; @@ -14,7 +14,7 @@ const widget = { root = createRoot(element); - root.render(); + root.render(); }, unmount() { if (root) root.unmount(); diff --git a/yarn.lock b/yarn.lock index bb372ad..e1e30ce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -737,6 +737,11 @@ resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f" integrity sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A== +"@remix-run/router@1.14.2": + version "1.14.2" + resolved "https://registry.yarnpkg.com/@remix-run/router/-/router-1.14.2.tgz#4d58f59908d9197ba3179310077f25c88e49ed17" + integrity sha512-ACXpdMM9hmKZww21yEqWwiLws/UPLhNKvimN8RrYSqPSvB3ov7sLvAcfvaxePeLvccTQKGdkDIhLYApZVDFuKg== + "@rollup/rollup-android-arm-eabi@4.9.5": version "4.9.5" resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.5.tgz#b752b6c88a14ccfcbdf3f48c577ccc3a7f0e66b9" @@ -2724,6 +2729,21 @@ react-refresh@^0.14.0: resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.14.0.tgz#4e02825378a5f227079554d4284889354e5f553e" integrity sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ== +react-router-dom@^6.21.3: + version "6.21.3" + resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-6.21.3.tgz#ef3a7956a3699c7b82c21fcb3dbc63c313ed8c5d" + integrity sha512-kNzubk7n4YHSrErzjLK72j0B5i969GsuCGazRl3G6j1zqZBLjuSlYBdVdkDOgzGdPIffUOc9nmgiadTEVoq91g== + dependencies: + "@remix-run/router" "1.14.2" + react-router "6.21.3" + +react-router@6.21.3: + version "6.21.3" + resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.21.3.tgz#8086cea922c2bfebbb49c6594967418f1f167d70" + integrity sha512-a0H638ZXULv1OdkmiK6s6itNhoy33ywxmUFT/xtSoVyf9VnC7n7+VT4LjVzdIHSaF5TIh9ylUgxMXksHTgGrKg== + dependencies: + "@remix-run/router" "1.14.2" + react-transition-group@^4.4.5: version "4.4.5" resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-4.4.5.tgz#e53d4e3f3344da8521489fbef8f2581d42becdd1" From 203a532d0a578641c77aa5cc3d0b1788accc538a Mon Sep 17 00:00:00 2001 From: nflnkr <105123049+nflnkr@users.noreply.github.com> Date: Thu, 1 Feb 2024 22:14:27 +0300 Subject: [PATCH 17/81] fix imports --- src/App.tsx | 4 ++-- src/WidgetApp.tsx | 4 ++-- src/pages/ViewPublicationPage/ViewPublicationPage.tsx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 37efdd9..398a58d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,6 +1,6 @@ import { Box } from "@mui/material"; -import ContextProviders from "ContextProviders"; -import { QuizIdContext } from "contexts/QuizIdContext"; +import ContextProviders from "./ContextProviders"; +import { QuizIdContext } from "./contexts/QuizIdContext"; import { useParams } from "react-router-dom"; import { ViewPage } from "./pages/ViewPublicationPage/ViewPublicationPage"; diff --git a/src/WidgetApp.tsx b/src/WidgetApp.tsx index 539445f..f13c684 100644 --- a/src/WidgetApp.tsx +++ b/src/WidgetApp.tsx @@ -1,6 +1,6 @@ import { Box } from "@mui/material"; -import ContextProviders from "ContextProviders"; -import { QuizIdContext } from "contexts/QuizIdContext"; +import ContextProviders from "./ContextProviders"; +import { QuizIdContext } from "./contexts/QuizIdContext"; import { ViewPage } from "./pages/ViewPublicationPage/ViewPublicationPage"; diff --git a/src/pages/ViewPublicationPage/ViewPublicationPage.tsx b/src/pages/ViewPublicationPage/ViewPublicationPage.tsx index 5080749..16ba51e 100644 --- a/src/pages/ViewPublicationPage/ViewPublicationPage.tsx +++ b/src/pages/ViewPublicationPage/ViewPublicationPage.tsx @@ -13,8 +13,8 @@ import { Question } from "./Question"; import { StartPageViewPublication } from "./StartPageViewPublication"; import { parseQuizData } from "@model/api/getQuizData"; -import { useQuizId } from "contexts/QuizIdContext"; import { replaceSpacesToEmptyLines } from "./tools/replaceSpacesToEmptyLines"; +import { useQuizId } from "../../contexts/QuizIdContext"; export const ViewPage = () => { From e6f87db9085817c1687813e5e54e52f53cbd4307 Mon Sep 17 00:00:00 2001 From: nflnkr <105123049+nflnkr@users.noreply.github.com> Date: Fri, 2 Feb 2024 01:34:10 +0300 Subject: [PATCH 18/81] fix autoimport --- tsconfig.json | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index fa04a91..111cf9e 100755 --- a/tsconfig.json +++ b/tsconfig.json @@ -19,25 +19,24 @@ /* Linting */ "strict": true, "noFallthroughCasesInSwitch": true, - "baseUrl": "./src", "paths": { "@ui_kit/*": [ - "./ui_kit/*" + "./src/ui_kit/*" ], "@icons/*": [ - "./assets/icons/*" + "./src/assets/icons/*" ], "@stores/*": [ - "./stores/*" + "./src/stores/*" ], "@api/*": [ - "./api/*" + "./src/api/*" ], "@model/*": [ - "./model/*" + "./src/model/*" ], "@utils/*": [ - "./utils/*" + "./src/utils/*" ] } }, From 1bb1fd0fa2b4d27ec0a86cb41a376eb5cde75593 Mon Sep 17 00:00:00 2001 From: nflnkr <105123049+nflnkr@users.noreply.github.com> Date: Fri, 2 Feb 2024 15:46:38 +0300 Subject: [PATCH 19/81] replace png image with svg --- src/assets/icons/BlankImage.tsx | 10 + .../ViewPublicationPage/questions/Varimg.tsx | 281 +++++++++--------- 2 files changed, 152 insertions(+), 139 deletions(-) create mode 100644 src/assets/icons/BlankImage.tsx diff --git a/src/assets/icons/BlankImage.tsx b/src/assets/icons/BlankImage.tsx new file mode 100644 index 0000000..6e976bc --- /dev/null +++ b/src/assets/icons/BlankImage.tsx @@ -0,0 +1,10 @@ +export default function BlankImage() { + + return ( + + + + + + ); +} diff --git a/src/pages/ViewPublicationPage/questions/Varimg.tsx b/src/pages/ViewPublicationPage/questions/Varimg.tsx index 57eb2b5..0a16837 100644 --- a/src/pages/ViewPublicationPage/questions/Varimg.tsx +++ b/src/pages/ViewPublicationPage/questions/Varimg.tsx @@ -1,16 +1,14 @@ import { - Box, - Typography, - RadioGroup, - FormControlLabel, - Radio, - useTheme, - useMediaQuery + Box, + Typography, + RadioGroup, + FormControlLabel, + Radio, + useTheme, + useMediaQuery } from "@mui/material"; -import gag from "./gag.png" - -import { useQuestionsStore } from "@stores/quizData/store" +import { useQuestionsStore } from "@stores/quizData/store"; import { useQuizViewStore, updateAnswer, deleteAnswer } from "@stores/quizView/store"; import RadioCheck from "@ui_kit/RadioCheck"; @@ -20,147 +18,152 @@ import type { QuizQuestionVarImg } from "../../../model/questionTypes/varimg"; import { enqueueSnackbar } from "notistack"; import { sendAnswer } from "@api/quizRelase"; import { quizThemes } from "@utils/themes/Publication/themePublication"; +import BlankImage from "@icons/BlankImage"; type VarimgProps = { - currentQuestion: QuizQuestionVarImg; + currentQuestion: QuizQuestionVarImg; }; export const Varimg = ({ currentQuestion }: VarimgProps) => { - const { settings } = useQuestionsStore() - const { answers } = useQuizViewStore(); - const theme = useTheme(); - const isMobile = useMediaQuery(theme.breakpoints.down(650)); + const { settings } = useQuestionsStore(); + const { answers } = useQuizViewStore(); + const theme = useTheme(); + const isMobile = useMediaQuery(theme.breakpoints.down(650)); - const { answer } = - answers.find( - ({ questionId }) => questionId === currentQuestion.id - ) ?? {}; - const variant = currentQuestion.content.variants.find( - ({ id }) => answer === id - ); + const { answer } = + answers.find( + ({ questionId }) => questionId === currentQuestion.id + ) ?? {}; + const variant = currentQuestion.content.variants.find( + ({ id }) => answer === id + ); - if (!settings) throw new Error("settings is null"); + if (!settings) throw new Error("settings is null"); - return ( - - {currentQuestion.title} - + {currentQuestion.title} + - answer === id - )} - sx={{ - display: "flex", - flexWrap: "wrap", - flexDirection: "row", - justifyContent: "space-between", - flexBasis: "100%", - }} - > - - {currentQuestion.content.variants.map((variant, index) => ( - { - event.preventDefault(); + }}> + answer === id + )} + sx={{ + display: "flex", + flexWrap: "wrap", + flexDirection: "row", + justifyContent: "space-between", + flexBasis: "100%", + }} + > + + {currentQuestion.content.variants.map((variant, index) => ( + { + event.preventDefault(); - - - try { - await sendAnswer({ - questionId: currentQuestion.id, - body: `${currentQuestion.content.variants[index].answer} `, - qid: settings.qid - }) - - updateAnswer( - currentQuestion.id, - currentQuestion.content.variants[index].id - ); - } catch (e) { - enqueueSnackbar("ответ не был засчитан") - } + try { - - if (answer === currentQuestion.content.variants[index].id) { - try { - - await sendAnswer({ - questionId: currentQuestion.id, - body: "", - qid: settings.qid - }) - - } catch (e) { - enqueueSnackbar("ответ не был засчитан") - } - deleteAnswer(currentQuestion.id); - } - }} - control={ - } icon={} /> - } - label={variant.answer} - /> - ))} - - - {/* {(variant?.extendedText || currentQuestion.content.back) && ( */} - - {answer ? ( - - ) : (currentQuestion.content.replText !== " " && currentQuestion.content.replText.length > 0) ? currentQuestion.content.replText : variant?.extendedText || isMobile ? ( - "Выберите вариант ответа ниже" - ) : ( - "Выберите вариант ответа слева" - )} - - - {/* )} */} - - - ); + await sendAnswer({ + questionId: currentQuestion.id, + body: `${currentQuestion.content.variants[index].answer} `, + qid: settings.qid + }); + + updateAnswer( + currentQuestion.id, + currentQuestion.content.variants[index].id + ); + + } catch (e) { + enqueueSnackbar("ответ не был засчитан"); + } + + + if (answer === currentQuestion.content.variants[index].id) { + try { + + await sendAnswer({ + questionId: currentQuestion.id, + body: "", + qid: settings.qid + }); + + } catch (e) { + enqueueSnackbar("ответ не был засчитан"); + } + deleteAnswer(currentQuestion.id); + } + }} + control={ + } icon={} /> + } + label={variant.answer} + /> + ))} + + + {/* {(variant?.extendedText || currentQuestion.content.back) && ( */} + + {answer ? ( + variant?.extendedText ? ( + + ) : ( + + ) + ) : (currentQuestion.content.replText !== " " && currentQuestion.content.replText.length > 0) ? currentQuestion.content.replText : variant?.extendedText || isMobile ? ( + "Выберите вариант ответа ниже" + ) : ( + "Выберите вариант ответа слева" + )} + + + {/* )} */} + + + ); }; From f6d4dfe826d2f0feffaa6b8bd5a5bb6ccc49988f Mon Sep 17 00:00:00 2001 From: nflnkr <105123049+nflnkr@users.noreply.github.com> Date: Fri, 2 Feb 2024 17:35:02 +0300 Subject: [PATCH 20/81] refator datafetching minor fixes --- package.json | 1 + src/App.tsx | 17 +- ...{ContextProviders.tsx => QuizAnswerer.tsx} | 23 +- src/WidgetApp.tsx | 17 +- src/model/api/getQuizData.ts | 6 +- src/model/settingsData.ts | 3 +- src/pages/ViewPublicationPage/ContactForm.tsx | 22 +- src/pages/ViewPublicationPage/Footer.tsx | 39 +- src/pages/ViewPublicationPage/Question.tsx | 13 +- src/pages/ViewPublicationPage/ResultForm.tsx | 15 +- .../StartPageViewPublication.tsx | 12 +- .../ViewPublicationPage.tsx | 53 +- .../ViewPublicationPage/questions/Date.tsx | 172 +++-- .../ViewPublicationPage/questions/Emoji.tsx | 262 ++++---- .../ViewPublicationPage/questions/File.tsx | 595 +++++++++--------- .../ViewPublicationPage/questions/Images.tsx | 260 ++++---- .../ViewPublicationPage/questions/Number.tsx | 6 +- .../ViewPublicationPage/questions/Rating.tsx | 222 ++++--- .../ViewPublicationPage/questions/Select.tsx | 114 ++-- .../ViewPublicationPage/questions/Text.tsx | 94 ++- .../ViewPublicationPage/questions/Variant.tsx | 18 +- .../ViewPublicationPage/questions/Varimg.tsx | 7 +- .../ViewPublicationPage/questions/gag.png | Bin 6050 -> 0 bytes src/pages/ViewPublicationPage/tools/File.tsx | 96 +-- src/stores/quizData/actions.ts | 12 - src/stores/quizData/hooks.ts | 0 src/stores/quizData/store.ts | 29 - src/utils/handleComponentError.ts | 43 ++ src/utils/hooks/useGetSettings.ts | 56 -- src/utils/hooks/useQuizData.ts | 34 + yarn.lock | 7 + 31 files changed, 1082 insertions(+), 1166 deletions(-) rename src/{ContextProviders.tsx => QuizAnswerer.tsx} (58%) delete mode 100644 src/pages/ViewPublicationPage/questions/gag.png delete mode 100644 src/stores/quizData/actions.ts delete mode 100644 src/stores/quizData/hooks.ts delete mode 100644 src/stores/quizData/store.ts create mode 100644 src/utils/handleComponentError.ts delete mode 100644 src/utils/hooks/useGetSettings.ts create mode 100644 src/utils/hooks/useQuizData.ts diff --git a/package.json b/package.json index 8d65845..5c14905 100755 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "notistack": "^3.0.1", "react": "^18.2.0", "react-dom": "^18.2.0", + "react-error-boundary": "^4.0.12", "react-router-dom": "^6.21.3", "swr": "^2.2.4", "typescript": "^5.2.2", diff --git a/src/App.tsx b/src/App.tsx index 398a58d..5e2e7ad 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,8 +1,7 @@ import { Box } from "@mui/material"; -import ContextProviders from "./ContextProviders"; -import { QuizIdContext } from "./contexts/QuizIdContext"; import { useParams } from "react-router-dom"; -import { ViewPage } from "./pages/ViewPublicationPage/ViewPublicationPage"; +import QuizAnswerer from "./QuizAnswerer"; +import { QuizIdContext } from "./contexts/QuizIdContext"; const defaultQuizId = "ef836ff8-35b1-4031-9acf-af5766bac2b2"; @@ -12,13 +11,11 @@ export default function App() { return ( - - - - - + + + ); } diff --git a/src/ContextProviders.tsx b/src/QuizAnswerer.tsx similarity index 58% rename from src/ContextProviders.tsx rename to src/QuizAnswerer.tsx index ea17a51..3d3e935 100644 --- a/src/ContextProviders.tsx +++ b/src/QuizAnswerer.tsx @@ -2,20 +2,22 @@ import { CssBaseline, ThemeProvider } from "@mui/material"; import { LocalizationProvider } from "@mui/x-date-pickers"; import { AdapterMoment } from "@mui/x-date-pickers/AdapterMoment"; import { ruRU } from '@mui/x-date-pickers/locales'; +import LoadingSkeleton from "@ui_kit/LoadingSkeleton"; +import { handleComponentError } from "@utils/handleComponentError"; import moment from "moment"; import { SnackbarProvider } from 'notistack'; +import { Suspense } from "react"; +import { ErrorBoundary } from "react-error-boundary"; import { SWRConfig } from "swr"; +import { ApologyPage } from "./pages/ViewPublicationPage/ApologyPage"; +import { ViewPage } from "./pages/ViewPublicationPage/ViewPublicationPage"; import lightTheme from "./utils/themes/light"; moment.locale("ru"); const localeText = ruRU.components.MuiLocalizationProvider.defaultProps.localeText; -interface Props { - children: JSX.Element; -} - -export default function ContextProviders({ children }: Props) { +export default function QuizAnswerer() { return ( - {children} + } + onError={handleComponentError} + > + }> + + + ); -} +} diff --git a/src/WidgetApp.tsx b/src/WidgetApp.tsx index f13c684..a6c7215 100644 --- a/src/WidgetApp.tsx +++ b/src/WidgetApp.tsx @@ -1,7 +1,6 @@ import { Box } from "@mui/material"; -import ContextProviders from "./ContextProviders"; +import QuizAnswerer from "./QuizAnswerer"; import { QuizIdContext } from "./contexts/QuizIdContext"; -import { ViewPage } from "./pages/ViewPublicationPage/ViewPublicationPage"; interface Props { @@ -12,14 +11,12 @@ export default function WidgetApp({ quizId }: Props) { return ( - - - - - + + + ); } diff --git a/src/model/api/getQuizData.ts b/src/model/api/getQuizData.ts index 9fab68d..96c44fd 100644 --- a/src/model/api/getQuizData.ts +++ b/src/model/api/getQuizData.ts @@ -24,8 +24,8 @@ export interface GetQuizDataResponse { }[]; } -export function parseQuizData(quizDataResponse: GetQuizDataResponse, quizId: string): QuizSettings { - const items: QuizSettings["items"] = quizDataResponse.items.map((item) => { +export function parseQuizData(quizDataResponse: GetQuizDataResponse, quizId: string): Omit { + const items: QuizSettings["questions"] = quizDataResponse.items.map((item) => { const content = JSON.parse(item.c); return { @@ -51,5 +51,5 @@ export function parseQuizData(quizDataResponse: GetQuizDataResponse, quizId: str pausable: quizDataResponse.settings.pausable }; - return { cnt: quizDataResponse.cnt, settings, items }; + return { cnt: quizDataResponse.cnt, settings, questions: items }; } diff --git a/src/model/settingsData.ts b/src/model/settingsData.ts index 29d7fb1..bfbbd1d 100644 --- a/src/model/settingsData.ts +++ b/src/model/settingsData.ts @@ -30,7 +30,7 @@ export type FCField = { }; export type QuizSettings = { - items: AnyTypedQuizQuestion[]; + questions: AnyTypedQuizQuestion[]; settings: { qid: string; fp: boolean; @@ -43,6 +43,7 @@ export type QuizSettings = { cfg: QuizConfig; }; cnt: number; + recentlyCompleted: boolean; }; export interface QuizConfig { diff --git a/src/pages/ViewPublicationPage/ContactForm.tsx b/src/pages/ViewPublicationPage/ContactForm.tsx index 572b991..321423a 100644 --- a/src/pages/ViewPublicationPage/ContactForm.tsx +++ b/src/pages/ViewPublicationPage/ContactForm.tsx @@ -1,22 +1,21 @@ import AddressIcon from "@icons/ContactFormIcon/AddressIcon"; -import NameIcon from "@icons/ContactFormIcon/NameIcon"; import EmailIcon from "@icons/ContactFormIcon/EmailIcon"; +import NameIcon from "@icons/ContactFormIcon/NameIcon"; import PhoneIcon from "@icons/ContactFormIcon/PhoneIcon"; import TextIcon from "@icons/ContactFormIcon/TextIcon"; import { Box, Button, InputAdornment, Link, TextField as MuiTextField, TextFieldProps, Typography, useMediaQuery, useTheme } from "@mui/material"; - import CustomCheckbox from "@ui_kit/CustomCheckbox"; import { FC, useRef, useState } from "react"; import { sendFC } from "@api/quizRelase"; import { NameplateLogo } from "@icons/NameplateLogo"; import { QuizQuestionResult } from "@model/questionTypes/result"; -import { quizThemes } from "@utils/themes/Publication/themePublication"; +import { useQuizData } from "@utils/hooks/useQuizData"; import { enqueueSnackbar } from "notistack"; import { ApologyPage } from "./ApologyPage"; import { checkEmptyData } from "./tools/checkEmptyData"; -import { useQuestionsStore } from "@stores/quizData/store"; +import { quizThemes } from "@utils/themes/Publication/themePublication"; const TextField = MuiTextField as unknown as FC; // temporary fix ts(2590) @@ -74,7 +73,7 @@ export const ContactForm = ({ setShowResultForm, }: ContactFormProps) => { const theme = useTheme(); - const { settings, items } = useQuestionsStore(); + const { settings, questions } = useQuizData(); const [ready, setReady] = useState(false); const [name, setName] = useState(""); @@ -93,7 +92,7 @@ export const ContactForm = ({ }; //@ts-ignore - const resultQuestion: QuizQuestionResult = items.find((question) => { + const resultQuestion: QuizQuestionResult = questions.find((question) => { if (settings?.cfg.haveRoot) { //ветвимся return ( @@ -110,8 +109,6 @@ export const ContactForm = ({ }); const inputHC = async () => { - if (!settings) return; - //@ts-ignore const FC = settings?.cfg.formContact.fields || settings?.cfg.formContact; const body = {}; @@ -157,7 +154,6 @@ export const ContactForm = ({ } let isWide = Object.keys(filteredFC).length > 2; - if (!settings) throw new Error("settings is null"); if (!resultQuestion) return ( @@ -360,15 +356,13 @@ export const ContactForm = ({ @@ -393,7 +387,7 @@ const Inputs = ({ adress, setAdress, }: any) => { - const { settings } = useQuestionsStore(); + const { settings } = useQuizData(); // @ts-ignore const FC = settings?.cfg.formContact.fields || settings?.cfg.formContact; diff --git a/src/pages/ViewPublicationPage/Footer.tsx b/src/pages/ViewPublicationPage/Footer.tsx index 9dd9f3c..34866ca 100644 --- a/src/pages/ViewPublicationPage/Footer.tsx +++ b/src/pages/ViewPublicationPage/Footer.tsx @@ -1,16 +1,14 @@ import { Box, Button, Typography, useMediaQuery, useTheme } from "@mui/material"; import { useCallback, useMemo, useState } from "react"; -import { getQuestionById } from "@stores/quizData/actions"; - import { enqueueSnackbar } from "notistack"; import type { AnyTypedQuizQuestion, QuizQuestionBase } from "../../model/questionTypes/shared"; import { checkEmptyData } from "./tools/checkEmptyData"; import type { QuizQuestionResult } from "@model/questionTypes/result"; -import { useQuestionsStore } from "@stores/quizData/store"; import { useQuizViewStore } from "@stores/quizView/store"; +import { useQuizData } from "@utils/hooks/useQuizData"; type FooterProps = { setCurrentQuestion: (step: AnyTypedQuizQuestion) => void; @@ -22,13 +20,13 @@ type FooterProps = { export const Footer = ({ setCurrentQuestion, question, setShowContactForm, setShowResultForm }: FooterProps) => { const theme = useTheme(); - const { settings, items } = useQuestionsStore(); + const { settings, questions } = useQuizData(); const answers = useQuizViewStore(state => state.answers); const [stepNumber, setStepNumber] = useState(1); const isMobileMini = useMediaQuery(theme.breakpoints.down(382)); - const isLinear = !items.some(({ content }) => content.rule.parentId === "root"); + const isLinear = !questions.some(({ content }) => content.rule.parentId === "root"); const getNextQuestionId = useCallback(() => { console.log("Смотрим какой вопрос будет дальше. Что у нас сегодня вкусненького? Щя покажу от какого вопроса мы ищем следующий шаг"); @@ -86,27 +84,27 @@ export const Footer = ({ setCurrentQuestion, question, setShowContactForm, setSh } //ничё не нашли, ищем резулт console.log("ничё не нашли, ищем резулт "); - return items.find(q => { + return questions.find(q => { console.log('q.type === "result"', q.type === "result"); console.log('q.content.rule.parentId', q.content.rule.parentId); console.log('question.content.id', question.content.id); return q.type === "result" && q.content.rule.parentId === question.content.id; })?.id; - }, [answers, items, question]); + }, [answers, questions, question]); const isPreviousButtonDisabled = useMemo(() => { // Логика для аргумента disabled у кнопки "Назад" if (isLinear) { - const questionIndex = items.findIndex(({ id }) => id === question.id); + const questionIndex = questions.findIndex(({ id }) => id === question.id); - const previousQuestion = items[questionIndex - 1]; + const previousQuestion = questions[questionIndex - 1]; return previousQuestion ? false : true; } else { return question?.content.rule.parentId === "root" ? true : false; } - }, [items, isLinear, question?.content.rule.parentId, question.id]); + }, [questions, isLinear, question?.content.rule.parentId, question.id]); const isNextButtonDisabled = useMemo(() => { // Логика для аргумента disabled у кнопки "Далее" @@ -128,7 +126,8 @@ export const Footer = ({ setCurrentQuestion, question, setShowContactForm, setSh if (nextQuestionId) { return false; } else { - const nextQuestion = getQuestionById(question.content.rule.default); + const questionId = question.content.rule.default; + const nextQuestion = questions.find(q => q.id === questionId || q.content.id === questionId) || null; if (nextQuestion?.type) { return false; @@ -137,7 +136,6 @@ export const Footer = ({ setCurrentQuestion, question, setShowContactForm, setSh }, [answers, getNextQuestionId, isLinear, question.content, question.id]); const showResult = (nextQuestion: QuizQuestionResult) => { - if (!settings) return; if (!nextQuestion) return; const isEmpty = checkEmptyData({ resultData: nextQuestion }); @@ -168,9 +166,9 @@ export const Footer = ({ setCurrentQuestion, question, setShowContactForm, setSh if (isLinear) { setStepNumber(q => q - 1); - const questionIndex = items.findIndex(({ id }) => id === question.id); + const questionIndex = questions.findIndex(({ id }) => id === question.id); - const previousQuestion = items[questionIndex - 1]; + const previousQuestion = questions[questionIndex - 1]; if (previousQuestion) { setCurrentQuestion(previousQuestion); @@ -180,7 +178,8 @@ export const Footer = ({ setCurrentQuestion, question, setShowContactForm, setSh } if (question?.content.rule.parentId !== "root") { - const parent = getQuestionById(question?.content.rule.parentId); + const questionId = question?.content.rule.parentId; + const parent = questions.find(q => q.id === questionId || q.content.id === questionId) || null; if (parent?.type) { setCurrentQuestion(parent); } else { @@ -195,14 +194,14 @@ export const Footer = ({ setCurrentQuestion, question, setShowContactForm, setSh if (isLinear) { setStepNumber(q => q + 1); - const questionIndex = items.findIndex(({ id }) => id === question.id); - const nextQuestion = items[questionIndex + 1]; + const questionIndex = questions.findIndex(({ id }) => id === question.id); + const nextQuestion = questions[questionIndex + 1]; if (nextQuestion && nextQuestion.type !== "result") { setCurrentQuestion(nextQuestion); } else { //@ts-ignore - showResult(items.find(q => q.content.rule.parentId === "line")); + showResult(questions.find(q => q.content.rule.parentId === "line")); } return; @@ -211,7 +210,7 @@ export const Footer = ({ setCurrentQuestion, question, setShowContactForm, setSh const nextQuestionId = getNextQuestionId(); if (nextQuestionId) { - const nextQuestion = getQuestionById(nextQuestionId); + const nextQuestion = questions.find(q => q.id === nextQuestionId || q.content.id === nextQuestionId) || null; if (nextQuestion?.type && nextQuestion.type === "result") { showResult(nextQuestion); @@ -278,7 +277,7 @@ export const Footer = ({ setCurrentQuestion, question, setShowContactForm, setSh Из - {items.filter(q => q.type !== "result").length} + {questions.filter(q => q.type !== "result").length} } diff --git a/src/pages/ViewPublicationPage/Question.tsx b/src/pages/ViewPublicationPage/Question.tsx index 03f43ac..d3fe759 100644 --- a/src/pages/ViewPublicationPage/Question.tsx +++ b/src/pages/ViewPublicationPage/Question.tsx @@ -1,8 +1,6 @@ import { Box, useMediaQuery, useTheme } from "@mui/material"; import { useEffect, useState } from "react"; -import { getQuestionById } from "@stores/quizData/actions"; - import { ContactForm } from "./ContactForm"; import { Footer } from "./Footer"; import { ResultForm } from "./ResultForm"; @@ -23,23 +21,22 @@ import type { AnyTypedQuizQuestion } from "../../model/questionTypes/shared"; import { NameplateLogoFQ } from "@icons/NameplateLogoFQ"; import { NameplateLogoFQDark } from "@icons/NameplateLogoFQDark"; import { QuizQuestionResult } from "@model/questionTypes/result"; -import { useQuestionsStore } from "@stores/quizData/store"; import { notReachable } from "@utils/notReachable"; import { quizThemes } from "@utils/themes/Publication/themePublication"; +import { useQuizData } from "@utils/hooks/useQuizData"; export const Question = () => { const theme = useTheme(); - const settings = useQuestionsStore(state => state.settings); - const questions = useQuestionsStore(state => state.items); + const { settings, questions } = useQuizData(); const [currentQuestion, setCurrentQuestion] = useState(); const [showContactForm, setShowContactForm] = useState(false); const [showResultForm, setShowResultForm] = useState(false); const isMobile = useMediaQuery(theme.breakpoints.down(650)); useEffect(() => { - if (settings?.cfg.haveRoot) {//ветвимся - const nextQuestion = getQuestionById(settings?.cfg.haveRoot || ""); + const questionId = settings?.cfg.haveRoot || ""; + const nextQuestion = questions.find(q => q.id === questionId || q.content.id === questionId) || null; if (nextQuestion?.type) { setCurrentQuestion(nextQuestion); @@ -49,10 +46,8 @@ export const Question = () => { } else {//идём прямо setCurrentQuestion(questions[0]); } - }, []); - if (!settings) throw new Error("settings is null"); if (!currentQuestion || currentQuestion.type === "result") return "не смог отобразить вопрос"; return ( diff --git a/src/pages/ViewPublicationPage/ResultForm.tsx b/src/pages/ViewPublicationPage/ResultForm.tsx index 6666bd4..335d9f3 100644 --- a/src/pages/ViewPublicationPage/ResultForm.tsx +++ b/src/pages/ViewPublicationPage/ResultForm.tsx @@ -9,10 +9,10 @@ import { import { NameplateLogo } from "@icons/NameplateLogo"; import YoutubeEmbedIframe from "./tools/YoutubeEmbedIframe"; -import { useQuestionsStore } from "@stores/quizData/store"; import { quizThemes } from "@utils/themes/Publication/themePublication"; import { useCallback, useEffect, useMemo } from "react"; import type { QuizQuestionResult } from "../../model/questionTypes/result"; +import { useQuizData } from "@utils/hooks/useQuizData"; type ResultFormProps = { @@ -29,34 +29,33 @@ export const ResultForm = ({ }: ResultFormProps) => { const theme = useTheme(); const isMobile = useMediaQuery(theme.breakpoints.down(650)); - const { settings, items } = useQuestionsStore(); - if (!settings) throw new Error("settings is null"); + const { settings, questions } = useQuizData(); const resultQuestion = useMemo(() => { if (settings?.cfg.haveRoot) { //ищём для ветвления - return (items.find( + return (questions.find( (question): question is QuizQuestionResult => question.type === "result" && question.content.rule.parentId === currentQuestion.content.id - ) || items.find( + ) || questions.find( (question): question is QuizQuestionResult => question.type === "result" && question.content.rule.parentId === "line" )); } else { - return items.find( + return questions.find( (question): question is QuizQuestionResult => question.type === "result" && question.content.rule.parentId === "line" ); } - }, [currentQuestion.content.id, items, settings?.cfg.haveRoot]); + }, [currentQuestion.content.id, questions, settings?.cfg.haveRoot]); const followNextForm = useCallback(() => { setShowResultForm(false); setShowContactForm(true); - },[setShowContactForm, setShowResultForm]); + }, [setShowContactForm, setShowResultForm]); useEffect(() => { if (!resultQuestion) { diff --git a/src/pages/ViewPublicationPage/StartPageViewPublication.tsx b/src/pages/ViewPublicationPage/StartPageViewPublication.tsx index 9546093..b80dba8 100644 --- a/src/pages/ViewPublicationPage/StartPageViewPublication.tsx +++ b/src/pages/ViewPublicationPage/StartPageViewPublication.tsx @@ -1,12 +1,12 @@ import { Box, Button, ButtonBase, Link, Paper, Typography, useMediaQuery, useTheme } from "@mui/material"; -import YoutubeEmbedIframe from "./tools/YoutubeEmbedIframe"; -import { notReachable } from "../../utils/notReachable"; import { useUADevice } from "../../utils/hooks/useUADevice"; +import { notReachable } from "../../utils/notReachable"; +import YoutubeEmbedIframe from "./tools/YoutubeEmbedIframe"; import { NameplateLogo } from "@icons/NameplateLogo"; -import { quizThemes } from "@utils/themes/Publication/themePublication"; import { QuizStartpageAlignType, QuizStartpageType } from "@model/settingsData"; -import { useQuestionsStore } from "@stores/quizData/store"; +import { useQuizData } from "@utils/hooks/useQuizData"; +import { quizThemes } from "@utils/themes/Publication/themePublication"; interface Props { @@ -15,12 +15,10 @@ interface Props { export const StartPageViewPublication = ({ setVisualStartPage }: Props) => { const theme = useTheme(); - const { settings } = useQuestionsStore(); + const { settings } = useQuizData(); const { isMobileDevice } = useUADevice(); const isMobile = useMediaQuery(theme.breakpoints.down(650)); - if (!settings) throw new Error("settings is null"); - const handleCopyNumber = () => { navigator.clipboard.writeText(settings.cfg.info.phonenumber); }; diff --git a/src/pages/ViewPublicationPage/ViewPublicationPage.tsx b/src/pages/ViewPublicationPage/ViewPublicationPage.tsx index 16ba51e..d2a9a0c 100644 --- a/src/pages/ViewPublicationPage/ViewPublicationPage.tsx +++ b/src/pages/ViewPublicationPage/ViewPublicationPage.tsx @@ -1,55 +1,33 @@ -import { getData } from "@api/quizRelase"; -import { QuizSettings } from "@model/settingsData"; import { Box, ThemeProvider } from "@mui/material"; -import { setQuizData } from "@stores/quizData/actions"; -import { useQuestionsStore } from "@stores/quizData/store"; -import LoadingSkeleton from "@ui_kit/LoadingSkeleton"; +import { useQuizData } from "@utils/hooks/useQuizData"; import { quizThemes } from "@utils/themes/Publication/themePublication"; -import { enqueueSnackbar } from "notistack"; import { useEffect, useState } from "react"; -import useSWR from "swr"; import { ApologyPage } from "./ApologyPage"; import { Question } from "./Question"; import { StartPageViewPublication } from "./StartPageViewPublication"; -import { parseQuizData } from "@model/api/getQuizData"; -import { replaceSpacesToEmptyLines } from "./tools/replaceSpacesToEmptyLines"; -import { useQuizId } from "../../contexts/QuizIdContext"; - export const ViewPage = () => { - const quizId = useQuizId(); - const { isLoading, error } = useSWR(["quizData", quizId], params => getQuizData(params[1]), { - onSuccess: setQuizData, - }); - const { settings, items, recentlyСompleted } = useQuestionsStore(); + const { settings, questions, recentlyCompleted } = useQuizData(); const [visualStartPage, setVisualStartPage] = useState(); - useEffect(() => {//установка фавиконки - if (!settings) return; - + useEffect(() => { const link = document.querySelector('link[rel="icon"]'); if (link && settings.cfg.startpage.favIcon) { link.setAttribute("href", settings?.cfg.startpage.favIcon); } - //установка заголовка страницы + document.title = settings.name; setVisualStartPage(!settings.cfg.noStartPage); }, [settings]); - const questionsCount = items.filter(({ type }) => type !== null && type !== "result").length; - - if (error) { - console.log(error); - return ; - } - if (isLoading || !settings) return ; + const questionsCount = questions.filter(({ type }) => type !== null && type !== "result").length; if (questionsCount === 0) return ; return ( - {recentlyСompleted ? ( + {recentlyCompleted ? ( ) : ( @@ -62,21 +40,4 @@ export const ViewPage = () => { )} ); -}; - -async function getQuizData(quizId: string) { - const response = await getData(quizId); - const quizDataResponse = response.data; - - if (response.error) { - enqueueSnackbar(response.error); - throw new Error(response.error); - } - if (!quizDataResponse) { - throw new Error("Quiz not found"); - } - - const quizSettings = replaceSpacesToEmptyLines(parseQuizData(quizDataResponse, quizId)); - - return JSON.parse(JSON.stringify({ data: quizSettings }).replaceAll(/\\" \\"/g, '""').replaceAll(/" "/g, '""')).data as QuizSettings & { recentlyСompleted: boolean; }; -} +}; diff --git a/src/pages/ViewPublicationPage/questions/Date.tsx b/src/pages/ViewPublicationPage/questions/Date.tsx index 6f80cd2..a85f769 100644 --- a/src/pages/ViewPublicationPage/questions/Date.tsx +++ b/src/pages/ViewPublicationPage/questions/Date.tsx @@ -8,103 +8,101 @@ import type { QuizQuestionDate } from "../../../model/questionTypes/date"; import CalendarIcon from "@icons/CalendarIcon"; import { enqueueSnackbar } from "notistack"; import { sendAnswer } from "@api/quizRelase"; - + import { quizThemes } from "@utils/themes/Publication/themePublication"; -import { useQuestionsStore } from "@stores/quizData/store"; +import { useQuizData } from "@utils/hooks/useQuizData"; type DateProps = { - currentQuestion: QuizQuestionDate; + currentQuestion: QuizQuestionDate; }; export const Date = ({ currentQuestion }: DateProps) => { - const theme = useTheme(); + const theme = useTheme(); - const { settings } = useQuestionsStore(); - const { answers } = useQuizViewStore(); - const answer = answers.find( - ({ questionId }) => questionId === currentQuestion.id - )?.answer as string; - const currentAnswer = moment(answer) || moment(); - - if (!settings) throw new Error("settings is null"); + const { settings } = useQuizData(); + const { answers } = useQuizViewStore(); + const answer = answers.find( + ({ questionId }) => questionId === currentQuestion.id + )?.answer as string; + const currentAnswer = moment(answer) || moment(); - return ( - - - {currentQuestion.title} - - - ( - + + {currentQuestion.title} + + - ), - }} - value={ currentAnswer } - onChange={async (date) => { - console.log(date) - if (!date) { - return; - } + > + ( + + ), + }} + value={currentAnswer} + onChange={async (date) => { + console.log(date); + if (!date) { + return; + } - try { - await sendAnswer({ - questionId: currentQuestion.id, - body: moment(date).format("YYYY.MM.DD"), - qid: settings.qid, - }); + try { + await sendAnswer({ + questionId: currentQuestion.id, + body: moment(date).format("YYYY.MM.DD"), + qid: settings.qid, + }); - updateAnswer( - currentQuestion.id, - date - ); - } catch (e) { - enqueueSnackbar("ответ не был засчитан"); - } - }} - slotProps={{ - openPickerButton: { - sx: { - p: 0, - }, - "data-cy": "open-datepicker", - }, - layout: { - sx: { backgroundColor: theme.palette.background.default }, - }, - }} - sx={{ - "& .MuiInputBase-root": { - backgroundColor: quizThemes[settings.cfg.theme].isLight - ? "white" - : theme.palette.background.default, - borderRadius: "10px", - maxWidth: "250px", - pr: "22px", - "& input": { - py: "11px", - pl: "20px", - lineHeight: "19px", - }, - "& fieldset": { - borderColor: "#9A9AAF", - }, - }, - }} - /> - - - ); + updateAnswer( + currentQuestion.id, + date + ); + } catch (e) { + enqueueSnackbar("ответ не был засчитан"); + } + }} + slotProps={{ + openPickerButton: { + sx: { + p: 0, + }, + "data-cy": "open-datepicker", + }, + layout: { + sx: { backgroundColor: theme.palette.background.default }, + }, + }} + sx={{ + "& .MuiInputBase-root": { + backgroundColor: quizThemes[settings.cfg.theme].isLight + ? "white" + : theme.palette.background.default, + borderRadius: "10px", + maxWidth: "250px", + pr: "22px", + "& input": { + py: "11px", + pl: "20px", + lineHeight: "19px", + }, + "& fieldset": { + borderColor: "#9A9AAF", + }, + }, + }} + /> + + + ); }; diff --git a/src/pages/ViewPublicationPage/questions/Emoji.tsx b/src/pages/ViewPublicationPage/questions/Emoji.tsx index dd8f12b..b6ba3eb 100644 --- a/src/pages/ViewPublicationPage/questions/Emoji.tsx +++ b/src/pages/ViewPublicationPage/questions/Emoji.tsx @@ -14,148 +14,146 @@ import RadioCheck from "@ui_kit/RadioCheck"; import RadioIcon from "@ui_kit/RadioIcon"; import { sendAnswer } from "@api/quizRelase"; - + import { enqueueSnackbar } from "notistack"; import type { QuizQuestionEmoji } from "../../../model/questionTypes/emoji"; -import { useQuestionsStore } from "@stores/quizData/store"; +import { useQuizData } from "@utils/hooks/useQuizData"; type EmojiProps = { - currentQuestion: QuizQuestionEmoji; + currentQuestion: QuizQuestionEmoji; }; export const Emoji = ({ currentQuestion }: EmojiProps) => { - const theme = useTheme(); - - const { settings } = useQuestionsStore() - const { answers } = useQuizViewStore(); - const { answer } = - answers.find( - ({ questionId }) => questionId === currentQuestion.id - ) ?? {}; + const theme = useTheme(); - if (!settings) throw new Error("settings is null"); + const { settings } = useQuizData(); + const { answers } = useQuizViewStore(); + const { answer } = + answers.find( + ({ questionId }) => questionId === currentQuestion.id + ) ?? {}; return ( - - {currentQuestion.title} - answer === id - )} - onChange={({ target }) =>{ - updateAnswer( - currentQuestion.id, - currentQuestion.content.variants[Number(target.value)].answer - ) - } - } - sx={{ - display: "flex", - flexWrap: "wrap", - flexDirection: "row", - justifyContent: "space-between", - marginTop: "20px", - }} - > - - {currentQuestion.content.variants.map((variant, index) => ( - - - - {variant.extendedText && ( - - {variant.extendedText} - - )} - - - { - event.preventDefault(); - - try { - - await sendAnswer({ - questionId: currentQuestion.id, - body: currentQuestion.content.variants[index].extendedText + " " + currentQuestion.content.variants[index].answer, - qid: settings.qid - }) - - updateAnswer( + + {currentQuestion.title} + answer === id + )} + onChange={({ target }) => { + updateAnswer( currentQuestion.id, - currentQuestion.content.variants[index].id - ); - - } catch (e) { - enqueueSnackbar("ответ не был засчитан") - } - - - - if (answer === currentQuestion.content.variants[index].id) { - deleteAnswer(currentQuestion.id); - try { - - await sendAnswer({ - questionId: currentQuestion.id, - body: "", - qid: settings.qid - }) - - } catch (e) { - enqueueSnackbar("ответ не был засчитан") - } - } - }} - - control={ - } icon={} /> - } - label={ - - {variant.answer} - - } - /> - - ))} - - - + currentQuestion.content.variants[Number(target.value)].answer + ); + } + } + sx={{ + display: "flex", + flexWrap: "wrap", + flexDirection: "row", + justifyContent: "space-between", + marginTop: "20px", + }} + > + + {currentQuestion.content.variants.map((variant, index) => ( + + + + {variant.extendedText && ( + + {variant.extendedText} + + )} + + + { + event.preventDefault(); + + try { + + await sendAnswer({ + questionId: currentQuestion.id, + body: currentQuestion.content.variants[index].extendedText + " " + currentQuestion.content.variants[index].answer, + qid: settings.qid + }); + + updateAnswer( + currentQuestion.id, + currentQuestion.content.variants[index].id + ); + + } catch (e) { + enqueueSnackbar("ответ не был засчитан"); + } + + + + if (answer === currentQuestion.content.variants[index].id) { + deleteAnswer(currentQuestion.id); + try { + + await sendAnswer({ + questionId: currentQuestion.id, + body: "", + qid: settings.qid + }); + + } catch (e) { + enqueueSnackbar("ответ не был засчитан"); + } + } + }} + + control={ + } icon={} /> + } + label={ + + {variant.answer} + + } + /> + + ))} + + + ); - + }; diff --git a/src/pages/ViewPublicationPage/questions/File.tsx b/src/pages/ViewPublicationPage/questions/File.tsx index cc4a53d..5336533 100644 --- a/src/pages/ViewPublicationPage/questions/File.tsx +++ b/src/pages/ViewPublicationPage/questions/File.tsx @@ -1,12 +1,11 @@ import { - Box, - Typography, - ButtonBase, - useTheme, - IconButton, useMediaQuery, Modal, + Box, + Typography, + ButtonBase, + useTheme, + IconButton, useMediaQuery, Modal, } from "@mui/material"; import { useQuizViewStore, updateAnswer } from "@stores/quizView/store"; -import { UPLOAD_FILE_TYPES_MAP } from "../tools/File"; import UploadIcon from "@icons/UploadIcon"; import CloseBold from "@icons/CloseBold"; @@ -17,328 +16,326 @@ import type { DragEvent } from "react"; import type { UploadFileType } from "@model/questionTypes/file"; import { enqueueSnackbar } from "notistack"; import { sendAnswer, sendFile } from "@api/quizRelase"; -import { useQuestionsStore } from "@stores/quizData/store" import Info from "@icons/Info"; +import { useQuizData } from "@utils/hooks/useQuizData"; type FileProps = { - currentQuestion: QuizQuestionFile; + currentQuestion: QuizQuestionFile; }; -const CurrentModal = ({ status }: { status: "errorType" | "errorSize" | "picture" | "video" | "audio" | "document" | "" }) => { - switch (status) { - case 'errorType': - return (<> - Выбран некорректный тип файла - ) - case 'errorSize': - return (<> - Файл слишком большой. Максимальный размер 50 МБ - ) - default: - return (<> - Допустимые расширения файлов: - { - //@ts-ignore - ACCEPT_SEND_FILE_TYPES_MAP[status].join(" ")} - ) - } -} +const CurrentModal = ({ status }: { status: "errorType" | "errorSize" | "picture" | "video" | "audio" | "document" | ""; }) => { + switch (status) { + case 'errorType': + return (<> + Выбран некорректный тип файла + ); + case 'errorSize': + return (<> + Файл слишком большой. Максимальный размер 50 МБ + ); + default: + return (<> + Допустимые расширения файлов: + { + //@ts-ignore + ACCEPT_SEND_FILE_TYPES_MAP[status].join(" ")} + ); + } +}; const ACCEPT_SEND_FILE_TYPES_MAP = { - picture: [ - ".jpeg", - ".jpg", - ".png", - ".ico", - ".gif", - ".tiff", - ".webp", - ".eps", - ".svg" - ], - video: [ - ".mp4", - ".mov", - ".wmv", - ".avi", - ".avchd", - ".flv", - ".f4v", - ".swf", - ".mkv", - ".webm", - ".mpeg-2" - ], - audio: [ - ".aac", - ".aiff", - ".dsd", - ".flac", - ".mp3", - ".mqa", - ".ogg", - ".wav", - ".wma" - ], - document: [ - ".doc", - ".docx", - ".dotx", - ".rtf", - ".odt", - ".pdf", - ".txt", - ".xls", - ".ppt", - ".xlsx", - ".pptx", - ".pages", - ], + picture: [ + ".jpeg", + ".jpg", + ".png", + ".ico", + ".gif", + ".tiff", + ".webp", + ".eps", + ".svg" + ], + video: [ + ".mp4", + ".mov", + ".wmv", + ".avi", + ".avchd", + ".flv", + ".f4v", + ".swf", + ".mkv", + ".webm", + ".mpeg-2" + ], + audio: [ + ".aac", + ".aiff", + ".dsd", + ".flac", + ".mp3", + ".mqa", + ".ogg", + ".wav", + ".wma" + ], + document: [ + ".doc", + ".docx", + ".dotx", + ".rtf", + ".odt", + ".pdf", + ".txt", + ".xls", + ".ppt", + ".xlsx", + ".pptx", + ".pages", + ], -} +}; const UPLOAD_FILE_DESCRIPTIONS_MAP: Record< - UploadFileType, - { title: string; description: string } + UploadFileType, + { title: string; description: string; } > = { - picture: { - title: "Добавить изображение", - description: "Принимает изображения", - }, - video: { - title: "Добавить видео", - description: "Принимает .mp4 и .mov формат — максимум 100мб", - }, - audio: { title: "Добавить аудиофайл", description: "Принимает аудиофайлы" }, - document: { title: "Добавить документ", description: "Принимает документы" }, + picture: { + title: "Добавить изображение", + description: "Принимает изображения", + }, + video: { + title: "Добавить видео", + description: "Принимает .mp4 и .mov формат — максимум 100мб", + }, + audio: { title: "Добавить аудиофайл", description: "Принимает аудиофайлы" }, + document: { title: "Добавить документ", description: "Принимает документы" }, } as const; export const File = ({ currentQuestion }: FileProps) => { - const theme = useTheme(); - const { settings } = useQuestionsStore() - const { answers } = useQuizViewStore(); + const theme = useTheme(); + const { settings } = useQuizData(); + const { answers } = useQuizViewStore(); - const [statusModal, setStatusModal] = useState<"errorType" | "errorSize" | "picture" | "video" | "audio" | "document" | "">("") + const [statusModal, setStatusModal] = useState<"errorType" | "errorSize" | "picture" | "video" | "audio" | "document" | "">(""); - const answer = answers.find( - ({ questionId }) => questionId === currentQuestion.id - )?.answer as string; - const isMobile = useMediaQuery(theme.breakpoints.down(500)); - const uploadFile = async ({ target }: ChangeEvent) => { - if (!settings) return; - - const file = target.files?.[0]; - if (file) { - if (file.size <= 52428800) { - //проверяем на соответствие - console.log(file.name.toLowerCase()) - if (ACCEPT_SEND_FILE_TYPES_MAP[currentQuestion.content.type].find((ednding => { - console.log(ednding) - console.log(file.name.toLowerCase().endsWith(ednding)) - return file.name.toLowerCase().endsWith(ednding) - }))) { + const answer = answers.find( + ({ questionId }) => questionId === currentQuestion.id + )?.answer as string; + const isMobile = useMediaQuery(theme.breakpoints.down(500)); + const uploadFile = async ({ target }: ChangeEvent) => { + const file = target.files?.[0]; + if (file) { + if (file.size <= 52428800) { + //проверяем на соответствие + console.log(file.name.toLowerCase()); + if (ACCEPT_SEND_FILE_TYPES_MAP[currentQuestion.content.type].find((ednding => { + console.log(ednding); + console.log(file.name.toLowerCase().endsWith(ednding)); + return file.name.toLowerCase().endsWith(ednding); + }))) { - //Нужный формат - console.log(file) - try { + //Нужный формат + console.log(file); + try { - const data = await sendFile({ - questionId: currentQuestion.id, - body: { - file: file, - name: file.name - }, - qid: settings.qid - }) - console.log(data) + const data = await sendFile({ + questionId: currentQuestion.id, + body: { + file: file, + name: file.name + }, + qid: settings.qid + }); + console.log(data); - await sendAnswer({ - questionId: currentQuestion.id, - //@ts-ignore - body: `https://storage.yandexcloud.net/squizanswer/${settings.qid}/${currentQuestion.id}/${data.data.fileIDMap[currentQuestion.id]}`, - //@ts-ignore - qid: settings.qid - }) + await sendAnswer({ + questionId: currentQuestion.id, + //@ts-ignore + body: `https://storage.yandexcloud.net/squizanswer/${settings.qid}/${currentQuestion.id}/${data.data.fileIDMap[currentQuestion.id]}`, + //@ts-ignore + qid: settings.qid + }); - updateAnswer( - currentQuestion.id, - `${file.name}|${URL.createObjectURL(file)}` - ); + updateAnswer( + currentQuestion.id, + `${file.name}|${URL.createObjectURL(file)}` + ); - } catch (e) { - console.log(e) - enqueueSnackbar("ответ не был засчитан") - } + } catch (e) { + console.log(e); + enqueueSnackbar("ответ не был засчитан"); + } - } else { + } else { + + //неподходящий формат + setStatusModal("errorType"); + } + } else { + + setStatusModal("errorSize"); + } - //неподходящий формат - setStatusModal("errorType") } - } else { + }; - setStatusModal("errorSize") - } - - } - }; - - return ( - <> - - {currentQuestion.title} - - {answer?.split("|")[0] && ( - - Вы загрузили: - - - {answer?.split("|")[0]} - { - updateAnswer(currentQuestion.id, ""); - }} - > - - - - - )} - - {!answer?.split("|")[0] && ( - - - + return ( + <> + + {currentQuestion.title} ) => - event.preventDefault() - } - sx={{ - width: "100%", - height: isMobile ? undefined : "120px", - display: "flex", - gap: "50px", - justifyContent: "flex-start", - alignItems: "center", - padding: "33px 44px 33px 55px", - backgroundColor: theme.palette.background.default, - border: `1px solid #9A9AAF`, - // border: `1px solid ${theme.palette.grey2.main}`, - borderRadius: "8px", - }} + sx={{ + display: "flex", + flexDirection: "column", + width: "100%", + marginTop: "20px", + maxWidth: answer?.split("|")[0] ? "640px" : "600px", + }} > - - - - { - UPLOAD_FILE_DESCRIPTIONS_MAP[currentQuestion.content.type] - .title - } - - - { - UPLOAD_FILE_DESCRIPTIONS_MAP[currentQuestion.content.type] - .description - } - - + {answer?.split("|")[0] && ( + + Вы загрузили: + + + {answer?.split("|")[0]} + { + updateAnswer(currentQuestion.id, ""); + }} + > + + + + + )} + + {!answer?.split("|")[0] && ( + + + + ) => + event.preventDefault() + } + sx={{ + width: "100%", + height: isMobile ? undefined : "120px", + display: "flex", + gap: "50px", + justifyContent: "flex-start", + alignItems: "center", + padding: "33px 44px 33px 55px", + backgroundColor: theme.palette.background.default, + border: `1px solid #9A9AAF`, + // border: `1px solid ${theme.palette.grey2.main}`, + borderRadius: "8px", + }} + > + + + + { + UPLOAD_FILE_DESCRIPTIONS_MAP[currentQuestion.content.type] + .title + } + + + { + UPLOAD_FILE_DESCRIPTIONS_MAP[currentQuestion.content.type] + .description + } + + + + + setStatusModal(currentQuestion.content.type)} /> + + )} + {answer && currentQuestion.content.type === "picture" && ( + + )} + {answer && currentQuestion.content.type === "video" && ( + - - setStatusModal(currentQuestion.content.type)} /> - )} - {answer && currentQuestion.content.type === "picture" && ( - - )} - {answer && currentQuestion.content.type === "video" && ( - - - setStatusModal("")} - > - - - - - - ); + setStatusModal("")} + > + + + + + + ); }; diff --git a/src/pages/ViewPublicationPage/questions/Images.tsx b/src/pages/ViewPublicationPage/questions/Images.tsx index cb7530a..6d0483c 100644 --- a/src/pages/ViewPublicationPage/questions/Images.tsx +++ b/src/pages/ViewPublicationPage/questions/Images.tsx @@ -1,11 +1,11 @@ import { - Box, - Typography, - RadioGroup, - FormControlLabel, - Radio, - useTheme, - useMediaQuery, + Box, + Typography, + RadioGroup, + FormControlLabel, + Radio, + useTheme, + useMediaQuery, } from "@mui/material"; import { useQuizViewStore, updateAnswer, deleteAnswer } from "@stores/quizView/store"; @@ -15,138 +15,136 @@ import RadioIcon from "@ui_kit/RadioIcon"; import type { QuizQuestionImages } from "../../../model/questionTypes/images"; import { enqueueSnackbar } from "notistack"; import { sendAnswer } from "@api/quizRelase"; -import { useQuestionsStore } from "@stores/quizData/store" +import { useQuizData } from "@utils/hooks/useQuizData"; type ImagesProps = { - currentQuestion: QuizQuestionImages; + currentQuestion: QuizQuestionImages; }; export const Images = ({ currentQuestion }: ImagesProps) => { - const { settings } = useQuestionsStore() - const { answers } = useQuizViewStore(); - const theme = useTheme(); - const { answer } = - answers.find( - ({ questionId }) => questionId === currentQuestion.id - ) ?? {}; - const isTablet = useMediaQuery(theme.breakpoints.down(1000)); - const isMobile = useMediaQuery(theme.breakpoints.down(500)); + const { settings } = useQuizData(); + const { answers } = useQuizViewStore(); + const theme = useTheme(); + const { answer } = + answers.find( + ({ questionId }) => questionId === currentQuestion.id + ) ?? {}; + const isTablet = useMediaQuery(theme.breakpoints.down(1000)); + const isMobile = useMediaQuery(theme.breakpoints.down(500)); - if (!settings) throw new Error("settings is null"); - - return ( - - {currentQuestion.title} - answer === id - )} - sx={{ - display: "flex", - flexWrap: "wrap", - flexDirection: "row", - justifyContent: "space-between", - marginTop: "20px", - }} - > - - {currentQuestion.content.variants.map((variant, index) => ( - { - event.preventDefault(); - - try { - - await sendAnswer({ - questionId: currentQuestion.id, - body: `${currentQuestion.content.variants[index].answer} `, - qid: settings.qid - }) - - updateAnswer( - currentQuestion.id, - currentQuestion.content.variants[index].id - ); - - } catch (e) { - enqueueSnackbar("ответ не был засчитан") - } - - - if (answer === currentQuestion.content.variants[index].id) { - deleteAnswer(currentQuestion.id); - try { - - await sendAnswer({ - questionId: currentQuestion.id, - body: "", - qid: settings.qid - }) - - } catch (e) { - enqueueSnackbar("ответ не был засчитан") - } - } - }} - > - - - {variant.extendedText && ( - - )} - - - + {currentQuestion.title} + answer === id + )} sx={{ - textAlign: "center", - color: theme.palette.text.primary, - marginTop: "10px", - marginLeft: 0, - padding: "10px", - "& .MuiFormControlLabel-label": { - wordBreak: "break-word", - }, + display: "flex", + flexWrap: "wrap", + flexDirection: "row", + justifyContent: "space-between", + marginTop: "20px", }} - value={index} - control={ - } icon={} /> - } - label={variant.answer} - /> - - ))} + > + + {currentQuestion.content.variants.map((variant, index) => ( + { + event.preventDefault(); + + try { + + await sendAnswer({ + questionId: currentQuestion.id, + body: `${currentQuestion.content.variants[index].answer} `, + qid: settings.qid + }); + + updateAnswer( + currentQuestion.id, + currentQuestion.content.variants[index].id + ); + + } catch (e) { + enqueueSnackbar("ответ не был засчитан"); + } + + + if (answer === currentQuestion.content.variants[index].id) { + deleteAnswer(currentQuestion.id); + try { + + await sendAnswer({ + questionId: currentQuestion.id, + body: "", + qid: settings.qid + }); + + } catch (e) { + enqueueSnackbar("ответ не был засчитан"); + } + } + }} + > + + + {variant.extendedText && ( + + )} + + + } icon={} /> + } + label={variant.answer} + /> + + ))} + + - - - ); + ); }; diff --git a/src/pages/ViewPublicationPage/questions/Number.tsx b/src/pages/ViewPublicationPage/questions/Number.tsx index e8d1025..1c1c920 100644 --- a/src/pages/ViewPublicationPage/questions/Number.tsx +++ b/src/pages/ViewPublicationPage/questions/Number.tsx @@ -12,14 +12,14 @@ import { enqueueSnackbar } from "notistack"; import { sendAnswer } from "@api/quizRelase"; import { quizThemes } from "@utils/themes/Publication/themePublication"; -import { useQuestionsStore } from "@stores/quizData/store"; +import { useQuizData } from "@utils/hooks/useQuizData"; type NumberProps = { currentQuestion: QuizQuestionNumber; }; export const Number = ({ currentQuestion }: NumberProps) => { - const { settings } = useQuestionsStore(); + const { settings } = useQuizData(); const [inputValue, setInputValue] = useState("0"); const [minRange, setMinRange] = useState("0"); const [maxRange, setMaxRange] = useState("100000000000"); @@ -105,8 +105,6 @@ export const Number = ({ currentQuestion }: NumberProps) => { } }, []); - if (!settings) throw new Error("settings is null"); - return ( diff --git a/src/pages/ViewPublicationPage/questions/Rating.tsx b/src/pages/ViewPublicationPage/questions/Rating.tsx index b22562b..bf89ab6 100644 --- a/src/pages/ViewPublicationPage/questions/Rating.tsx +++ b/src/pages/ViewPublicationPage/questions/Rating.tsx @@ -1,9 +1,9 @@ import { - Box, - Typography, - Rating as RatingComponent, - useTheme, - useMediaQuery + Box, + Typography, + Rating as RatingComponent, + useTheme, + useMediaQuery } from "@mui/material"; import { useQuizViewStore, updateAnswer } from "@stores/quizView/store"; @@ -19,127 +19,125 @@ import StarIconMini from "@icons/questionsPage/StarIconMini"; import type { QuizQuestionRating } from "../../../model/questionTypes/rating"; import { enqueueSnackbar } from "notistack"; import { sendAnswer } from "@api/quizRelase"; -import { useQuestionsStore } from "@stores/quizData/store"; +import { useQuizData } from "@utils/hooks/useQuizData"; type RatingProps = { - currentQuestion: QuizQuestionRating; + currentQuestion: QuizQuestionRating; }; const buttonRatingForm = [ - { - name: "star", - icon: (color: string) => , - }, - { - name: "trophie", - icon: (color: string) => , - }, - { - name: "flag", - icon: (color: string) => , - }, - { - name: "heart", - icon: (color: string) => , - }, - { - name: "like", - icon: (color: string) => , - }, - { - name: "bubble", - icon: (color: string) => , - }, - { - name: "hashtag", - icon: (color: string) => , - }, + { + name: "star", + icon: (color: string) => , + }, + { + name: "trophie", + icon: (color: string) => , + }, + { + name: "flag", + icon: (color: string) => , + }, + { + name: "heart", + icon: (color: string) => , + }, + { + name: "like", + icon: (color: string) => , + }, + { + name: "bubble", + icon: (color: string) => , + }, + { + name: "hashtag", + icon: (color: string) => , + }, ]; export const Rating = ({ currentQuestion }: RatingProps) => { - const { settings } = useQuestionsStore() - const { answers } = useQuizViewStore(); - const theme = useTheme(); - const isMobile = useMediaQuery(theme.breakpoints.down(650)); - const { answer } = - answers.find( - ({ questionId }) => questionId === currentQuestion.id - ) ?? {}; - const form = buttonRatingForm.find( - ({ name }) => name === currentQuestion.content.form - ); + const { settings } = useQuizData(); + const { answers } = useQuizViewStore(); + const theme = useTheme(); + const isMobile = useMediaQuery(theme.breakpoints.down(650)); + const { answer } = + answers.find( + ({ questionId }) => questionId === currentQuestion.id + ) ?? {}; + const form = buttonRatingForm.find( + ({ name }) => name === currentQuestion.content.form + ); - if (!settings) throw new Error("settings is null"); - - return ( - - {currentQuestion.title} - - - { + return ( + + {currentQuestion.title} + + + { - try { + try { - await sendAnswer({ - questionId: currentQuestion.id, - body: String(value) + " из " + currentQuestion.content.steps, - qid: settings.qid - }) + await sendAnswer({ + questionId: currentQuestion.id, + body: String(value) + " из " + currentQuestion.content.steps, + qid: settings.qid + }); - updateAnswer(currentQuestion.id, String(value)) + updateAnswer(currentQuestion.id, String(value)); - } catch (e) { - enqueueSnackbar("ответ не был засчитан") - } - }} - sx={{ - height: "50px", - gap: isMobile ? undefined : "15px", - justifyContent: isMobile ? "space-between" : undefined, - width: isMobile ? "100%" : undefined - }} - max={currentQuestion.content.steps} - icon={form?.icon(theme.palette.primary.main)} - emptyIcon={form?.icon("#9A9AAF")} - /> + } catch (e) { + enqueueSnackbar("ответ не был засчитан"); + } + }} + sx={{ + height: "50px", + gap: isMobile ? undefined : "15px", + justifyContent: isMobile ? "space-between" : undefined, + width: isMobile ? "100%" : undefined + }} + max={currentQuestion.content.steps} + icon={form?.icon(theme.palette.primary.main)} + emptyIcon={form?.icon("#9A9AAF")} + /> + + + + {currentQuestion.content.ratingNegativeDescription} + + + {currentQuestion.content.ratingPositiveDescription} + + + - - - {currentQuestion.content.ratingNegativeDescription} - - - {currentQuestion.content.ratingPositiveDescription} - - - - - ); + ); }; diff --git a/src/pages/ViewPublicationPage/questions/Select.tsx b/src/pages/ViewPublicationPage/questions/Select.tsx index f990c5b..14abd5b 100644 --- a/src/pages/ViewPublicationPage/questions/Select.tsx +++ b/src/pages/ViewPublicationPage/questions/Select.tsx @@ -7,75 +7,73 @@ import { useQuizViewStore, updateAnswer, deleteAnswer } from "@stores/quizView/s import type { QuizQuestionSelect } from "../../../model/questionTypes/select"; import { enqueueSnackbar } from "notistack"; import { sendAnswer } from "@api/quizRelase"; +import { useQuizData } from "@utils/hooks/useQuizData"; -import { useQuestionsStore } from "@stores/quizData/store" type SelectProps = { - currentQuestion: QuizQuestionSelect; + currentQuestion: QuizQuestionSelect; }; export const Select = ({ currentQuestion }: SelectProps) => { - const theme = useTheme(); + const theme = useTheme(); - const { settings } = useQuestionsStore() - const { answers } = useQuizViewStore(); - const { answer } = - answers.find( - ({ questionId }) => questionId === currentQuestion.id - ) ?? {}; + const { settings } = useQuizData(); + const { answers } = useQuizViewStore(); + const { answer } = + answers.find( + ({ questionId }) => questionId === currentQuestion.id + ) ?? {}; - if (!settings) throw new Error("settings is null"); + return ( + + {currentQuestion.title} + + answer)} + colorMain={theme.palette.primary.main} + onChange={async (_, value) => { + if (value < 0) { + deleteAnswer(currentQuestion.id); + try { - return ( - - {currentQuestion.title} - - answer)} - colorMain={theme.palette.primary.main} - onChange={async(_, value) => { - if (value < 0) { - deleteAnswer(currentQuestion.id); - try { - - await sendAnswer({ - questionId: currentQuestion.id, - body: "", - qid: settings.qid - }) - - } catch (e) { - enqueueSnackbar("ответ не был засчитан") - } - return; - } + await sendAnswer({ + questionId: currentQuestion.id, + body: "", + qid: settings.qid + }); - try { - - await sendAnswer({ - questionId: currentQuestion.id, - body: String(currentQuestion.content.variants[Number(value)].answer), - qid: settings.qid - }) + } catch (e) { + enqueueSnackbar("ответ не был засчитан"); + } + return; + } - updateAnswer(currentQuestion.id, String(value)); + try { - } catch (e) { - enqueueSnackbar("ответ не был засчитан") - } + await sendAnswer({ + questionId: currentQuestion.id, + body: String(currentQuestion.content.variants[Number(value)].answer), + qid: settings.qid + }); + + updateAnswer(currentQuestion.id, String(value)); + + } catch (e) { + enqueueSnackbar("ответ не был засчитан"); + } - }} - /> - - - ); + }} + /> + + + ); }; diff --git a/src/pages/ViewPublicationPage/questions/Text.tsx b/src/pages/ViewPublicationPage/questions/Text.tsx index 5609f07..e934418 100644 --- a/src/pages/ViewPublicationPage/questions/Text.tsx +++ b/src/pages/ViewPublicationPage/questions/Text.tsx @@ -6,63 +6,61 @@ import { useQuizViewStore, updateAnswer } from "@stores/quizView/store"; import type { QuizQuestionText } from "../../../model/questionTypes/text"; import { enqueueSnackbar } from "notistack"; -import { useQuestionsStore } from "@stores/quizData/store" import { sendAnswer } from "@api/quizRelase"; import { useDebouncedCallback } from "use-debounce"; +import { useQuizData } from "@utils/hooks/useQuizData"; type TextProps = { - currentQuestion: QuizQuestionText; + currentQuestion: QuizQuestionText; }; export const Text = ({ currentQuestion }: TextProps) => { - const theme = useTheme(); - const { settings } = useQuestionsStore() - const { answers } = useQuizViewStore(); - const { answer } = answers.find(({ questionId }) => questionId === currentQuestion.id) ?? {}; + const theme = useTheme(); + const { settings } = useQuizData(); + const { answers } = useQuizViewStore(); + const { answer } = answers.find(({ questionId }) => questionId === currentQuestion.id) ?? {}; - const inputHC = useDebouncedCallback(async (text) => { - if (!settings) return; - - try { + const inputHC = useDebouncedCallback(async (text) => { + try { - await sendAnswer({ - questionId: currentQuestion.id, - body: text, - qid: settings.qid - }) + await sendAnswer({ + questionId: currentQuestion.id, + body: text, + qid: settings.qid + }); - } catch (e) { - enqueueSnackbar("ответ не был засчитан") - } - }, 400); - return ( - - {currentQuestion.title} - - { - updateAnswer(currentQuestion.id, target.value) - inputHC(target.value) - } - } - sx={{ - "&:focus-visible": { - borderColor: theme.palette.primary.main - } - }} - /> - - - ); + } catch (e) { + enqueueSnackbar("ответ не был засчитан"); + } + }, 400); + return ( + + {currentQuestion.title} + + { + updateAnswer(currentQuestion.id, target.value); + inputHC(target.value); + } + } + sx={{ + "&:focus-visible": { + borderColor: theme.palette.primary.main + } + }} + /> + + + ); }; diff --git a/src/pages/ViewPublicationPage/questions/Variant.tsx b/src/pages/ViewPublicationPage/questions/Variant.tsx index a552c01..fee885a 100644 --- a/src/pages/ViewPublicationPage/questions/Variant.tsx +++ b/src/pages/ViewPublicationPage/questions/Variant.tsx @@ -29,7 +29,7 @@ import { quizThemes } from "@utils/themes/Publication/themePublication"; import { enqueueSnackbar } from "notistack"; import type { QuestionVariant } from "../../../model/questionTypes/shared"; import type { QuizQuestionVariant } from "../../../model/questionTypes/variant"; -import { useQuestionsStore } from "@stores/quizData/store"; +import { useQuizData } from "@utils/hooks/useQuizData"; const TextField = MuiTextField as unknown as FC; @@ -135,11 +135,9 @@ const VariantItem = ({ index, own = false, }: VariantItemProps) => { - const { settings } = useQuestionsStore() + const { settings } = useQuizData(); const theme = useTheme(); - if (!settings) throw new Error("settings is null"); - return ( item !== variantId) : [...currentAnswer, variantId], qid: settings.qid - }) + }); updateAnswer( currentQuestion.id, @@ -205,7 +203,7 @@ const VariantItem = ({ ); } catch (e) { - enqueueSnackbar("ответ не был засчитан") + enqueueSnackbar("ответ не был засчитан"); } @@ -218,12 +216,12 @@ const VariantItem = ({ questionId: currentQuestion.id, body: currentQuestion.content.variants[index].answer, qid: settings.qid - }) + }); updateAnswer(currentQuestion.id, variantId); } catch (e) { - enqueueSnackbar("ответ не был засчитан") + enqueueSnackbar("ответ не был засчитан"); } if (answer === variantId) { @@ -233,10 +231,10 @@ const VariantItem = ({ questionId: currentQuestion.id, body: "", qid: settings.qid - }) + }); } catch (e) { - enqueueSnackbar("ответ не был засчитан") + enqueueSnackbar("ответ не был засчитан"); } deleteAnswer(currentQuestion.id); } diff --git a/src/pages/ViewPublicationPage/questions/Varimg.tsx b/src/pages/ViewPublicationPage/questions/Varimg.tsx index 0a16837..ec8c79b 100644 --- a/src/pages/ViewPublicationPage/questions/Varimg.tsx +++ b/src/pages/ViewPublicationPage/questions/Varimg.tsx @@ -7,8 +7,6 @@ import { useTheme, useMediaQuery } from "@mui/material"; - -import { useQuestionsStore } from "@stores/quizData/store"; import { useQuizViewStore, updateAnswer, deleteAnswer } from "@stores/quizView/store"; import RadioCheck from "@ui_kit/RadioCheck"; @@ -19,13 +17,14 @@ import { enqueueSnackbar } from "notistack"; import { sendAnswer } from "@api/quizRelase"; import { quizThemes } from "@utils/themes/Publication/themePublication"; import BlankImage from "@icons/BlankImage"; +import { useQuizData } from "@utils/hooks/useQuizData"; type VarimgProps = { currentQuestion: QuizQuestionVarImg; }; export const Varimg = ({ currentQuestion }: VarimgProps) => { - const { settings } = useQuestionsStore(); + const { settings } = useQuizData(); const { answers } = useQuizViewStore(); const theme = useTheme(); const isMobile = useMediaQuery(theme.breakpoints.down(650)); @@ -38,8 +37,6 @@ export const Varimg = ({ currentQuestion }: VarimgProps) => { ({ id }) => answer === id ); - if (!settings) throw new Error("settings is null"); - return ( {currentQuestion.title} diff --git a/src/pages/ViewPublicationPage/questions/gag.png b/src/pages/ViewPublicationPage/questions/gag.png deleted file mode 100644 index 5bb379f7a237fbc170956968171a7bbd6f7ac5ba..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6050 zcmeHL`9G9h*dH3YX=KJaQJ9gX2*ZTOZY)uhWPOrlsEBM4vZgV1DrDah&yyKUHQD!F z5h`R~BiSO`jP1Rr=lvtzAKoAC&)ny_uJ3ie=X1j1oxplb?& zFf}tCfEBa^A-nXzA2v?|>jx0X32w&21j)!kf<~qXrk8M#(od%s!3OlMwy`z@@+R@b zz5@#c!mnhgt8M1bv@+h4cYEJr| zw{6aXT5h6GN-J_SJ$-CVZ9%Pf&CM)zcVfpjfWAqkkI(|PmY27>+x54MSRjiv>VXIN zZF+xQ-~dUses}*S|3PcK#KF`@*@lho`8!*6D=V(OAv4^ z-#sW{4$C^&UnsNG+#6o1= z*=}kr>f2q2x8l&)`Wk<9xRIJmg5*Jyx~TLf&ciAd&D_H-XKZmjvO^S-$1^%QRIDtd zoSqdNOnq}b7^IpYAWegZt~B^wH&$Nm2S|EF{)H)p~wZ*Een{njR)4AE$` zeO^UH#o~VF&8heA-(L*XwhP)~ijV3u7Ek&)H#eufDMJtN717z>SBX+pRsG!%DZ_@M zyZ~;tO52iDR8=!CVQoi8N5c*NA;7Jy39f2FcGb)_--qI^kPt0VXsR*rI7JsSWX)nL zZV}bd(eb-sb#>LEPaFk(!9{8)C@7#6m)u8;>;}6})c!T;bnLz-LdfdF^t6Kng4|Y= z0mxGIfX5MS-}@d_+)YK-t_SJ}f*lzIV_(WHtr|td0w~YIZ`9{FLa9mtK!W3@E_+$a zG8|U%Z2*!T^uYE&dh)LFU51EW?f1Dy;=~kAdM4+wW-=Q91E{Rx+j*Pp0&CYGI@!ewS=nirD+7e@HV$VjniiubFo*#GV3QbsK} ziu@?!m{gJ3!#wzB9u!pOeO=wHLVc*qb2xMA$nfxM)1;Z)=pZ(f=j%#r#^++WL+OO8 zeP`{A8&e+o`6X3aBAKWHuUx>foI|JK!e)ByFB*Ia(qlRi4QvHOV?)+>lvbZ=qM&>a z59nLA58c`W+IQ>nIdFjV_x5JVCW6nJ@Wc0m~^)_g~;FX11 z6>Kk-3-@1}s4KLL+R8t$VqzD$#f{5D_`+Kj7Z>-QmHfYL+@RO$dE9%fQ1~vVOF`*kF(9;fPksp-AaL8+pQwvZ9SwT%c-)J>@(WX zw<3gYzwMRDy3rr`KWJhD!!a9lY2rz}W9PV=o7<|&3R+rPWZ~*eBGwrRNDG|NVUR4Nh68N{ua(E%_>C? zIxA#5gbsfr&!ZzEhO>GaWl#7w5g2TR8^pu;(9PVb;&qmXPsg@bCL)KmBk0-~rj`5PnfRW6M znj;xrX4hcL z3(~2gB3ktXxf|!=ja)O4%=fvPVJXU$BNX?%3%IoO=a!f7096}Mkk1}JA*~MG5_4#& zeq01Nh~u69Rx4>b`9ag2D<-kcN&YotP>gUYO<1ni+1;5RO+3E0mt(_3HU_wrl0p8_ z9`K-`FyA!kBuarbv}0nf%t_-Mq)6zcIE;`8{rNy8;c~Q&O zWQe0_44~NC!DmH)Z#&}$KC6)KPo2koOG=CKp3<<8XoXkC!M7VbsjKSWp1E2n{X(La z)1J8;L?hcN?ii?$IN^*6SJOmW;SZ}*0)rf1jb1Ej)zXB7gap!GJgvl@$xR&}A7_`$ zgqM?TA1h1d<`fJoNvzW_&pAGb6D}058AjVzcT2DkC}QQy3p%iTH^q-sE$D9r&Cl{R zX6(rwF%$={Q(viRYT0oezk5d~CTv-fTVg2MZ^Z1Nzxh-H9W`F}qLOt0LHV2#@t+rH zb0xL|HB^q<@MhN5gF?}rR8~D${%KsLxab$+$07;IC-Bl~`-kVuppnKfhh2gvi!%aq)28U?u7SsU~HxI3uYq`m@838-eNY zF{zgie@w{1V!Gr{MDg0&@NsM3n@?)?1g3f8jAqezphbj`8WpJRbqXefCO*~N0c1@Q zjh>KnVVprFTIGaaY;i`8)?Qh6LPICTd^(@PHQGC|78kRP#;y@zY|}cR_tu-L^Pe(C z9AGqf^Up(STAIL29+ty%o@c`}2v~aN0`BlE#t5CxOZ_OUe7xcS21^$FY~cn3cU?8Owfte+DKfem*&)3a>c%uRj z%)cnS^I5@H1!-^<$!q7kB_gOiUWq19!}u~ogN`X3|2d9GT|F3Q4>e+fgZ|k$&Pd?` zF_|$l|E-|DMD0>Ak*LJFufUTt%TB})m<)llC;*wRub*{4;t+P8;0p!);4(Qt8iA3H zK+qYT9aaRcH_XwX6<(bZ3`pd#e}W8L)5nknM^d-e*+jn}-|o)K-&p~T%Z{NQt5I-;bIpscJJf8<$Zx_&+5ha2jY+jeBQOtS_?;bjpA{qsL zhXw`*2lw^~_)o^J*hj^*p8O~l@=P=e)utl`F4wd%Ut?z8g*1+34 zsc!&Nk(TN`?ny#xNt$@V9X%e=qIHAH%DFSzuk3~ia`parnF1F~vJtF?zbVG^VjW60 zq)w&OYk2f0Mbnx<32Cl)vLQme6$5D}8GBV>Cq~`JDp5pr!w{(?7tF5^aILBq-5k(^ zx~}(xjBR_t$ijw^CeUfTSEfB!7MXWXRL9vH!}gNg0OO%Bk}*fJvyCu<9POa_9G3sg zg`#{^hyAA)+*B!nT@i8*uhUNQznEqJKsSv7Q8g)MK*#L*{uJe!hV(U17m$p>b z(KJ7FIC{ksC_?EE@12l!x^Q?iLBeuwoAsyhQCE-+-@Avv(i)m0Ji;N3vvqQ^cfN~v zVp(=!_QCu2IAw6^X1*_6rMqV0Sf$td_gcW$}ov8}~c< zibPRcxpI@aY?XnKSyy8F{ zE8DesQT}*d8>p$Jaloz}%*FV&`$yXg%sj9*g)N}6HYsNWkU9RG(fNX;tZUp&)MTEP z0HBA1CBw(Zzw+y_Bf{v$IgHyf+ZKfLrjI}hP*g%dvZMMkNO;Nc0OTWB1l)Nb$m(d> zba7T!PF5!&AI@B&dMZ&kz&iq%clj4%v)EJ%`55CB?|1bYDSLcepL6m{i3(B4ee7Sx zKLQj54OQV@NJ&&*5ef8#MS8E=0FSS>Wjc3b_*!b)7GxE194I0V@VN?$bdbdG;PUwK z$}pWMu$#JQrGEdJx>FqiAJxH#O&JR!KCR->u^w#8!Z&u*Q$ke!Lf*V=j>hwwAWMVx zx-T~{r^CkZk_0W&R!^jN449(}(c;i42BOaz!Xi=lG`fv73i_NEgH6STzUH*%$BDSy zeP=%XwP|m;@U#x-@(X!*hrI{#N&sxUwLd#5_X^2)LlIk^{tfoh8G}5ja~Y&5qUsCl zk?6U3p7DMKqnxB1)u@9KW>%Tt`7!yON|f_;VX(XJ-c;!65sdTpLV!8ZPOL zvc$+kkOdMeI=nIT=S>aMZI{WA4FFR{P51X-pUnjc$DoL`*xp-T7#_)WRslh0*wQD< zKTU%in`af`U|y{^YE@_t<2I1@%XC~)g*ZdG^;S8LrFIj5={%-;Tm^)O?SU2&!y<&Y z@|&=T2Fa@3(IAgD?YRwLY&QMlz;+XD+4w6@Mo`iy141 zSdG-}?PMw{DM@W`W60JBW^$)NdF=or-9=D40^HshpQeO@I)@?WuK-K}GhMs^T(~gS zKawf?=ORE?+Bs|h0vE;?<)A@;=ZWFdj)TT$$f9ci)87^yeUw!!8%pbVtK2Od(1*HK zYLEzL_UY!ypaLi@&Q`fIpp_eA^aRelX#m@kAVAa=$TfC2;At3*;(mNB5JiAQD{HDM zL=+tdjd0Q7YA_}m(c%s!4R58Wf<{TqG7-*vRvN9GZ3J6#e+FlEYNV`ggZagc@?9dq zrYEQ6Kp#z{HA!S&9-M z$I!%&+_3x<3k!WkhKsye`KtZse+rx_w}y+f|TVH~^-a`cV^ zi?6RTE5`;Dor+FnV6~jE=Jne61=#V>*qp+In&VB$%zDse0ue zdpu~YO4ff1-YL}?F!lv457R$zQauB{DZ`keN2dla5FlqA59eYMI2mBWzgGMi(5G24 zml#mPpXV9Sx77^jQ))Q_dbX@b!V*A1tkW3tMpd+0WJW8e@CNzfl~=4*@}p0v{ggW~!Rc&E@zWRU7`?63Q`YRb(Zt{{PObWrBa zn*+{N`b2L(c;h)ZJzdEh<~GJT^?qd~MbzKl|8!`Tdd9)u9^+MkCQMozt836Y#TwY7 z0rx)Am>u*GZ9zDq*G!JThKSrQPzigNGIf53S$JnY)5CIM;ci*N9nuGngL$Pji!X~V zERfgHKib6lN{Gx>fji@xW_Rxv2*=lNq%3&!qIZ*y=vzk?kf$+^B%F0AT@a$(!Oxyb zEd7ArF6gj?cBVaWr?_mNKIAc3?!p>2aglxrR?HA+_FG23m4>bu#tfh*umYgO;TLA&bO{^4+9(C#(T z%Kb|qLf?%L9T-+1_D{2PLBdp1Q-2A+?e3_@pypxy$~XgmqlM(w&+VoH|o~gJv?%=vOb}A_bY^G3Tlf-n;Rd?)D#4=8+?AxZ-wr@ z<5V{fUUm$%9j|C^)pqP3@|pTGF$a_qa%{qE&09~MY->}wZ{ocN~?9hfF%lvjW6L1=^n2^zp;XaZiT OLk#t<>Xzc{!~X}8 = { - picture: "image/*", - video: "video/*", - audio: "audio/*", - document: - ".doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,.pdf", +const UPLOAD_FILE_TYPES_MAP: Record = { + picture: "image/*", + video: "video/*", + audio: "audio/*", + document: + ".doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,.pdf", } as const; interface Props { - question: QuizQuestionFile; + question: QuizQuestionFile; } export default function File({ question }: Props) { - const fileInputRef = useRef(null); - const [file, setFile] = useState(null); - const [acceptedType, setAcceptedType] = useState( - UPLOAD_FILE_TYPES_MAP.picture - ); + const fileInputRef = useRef(null); + const [file, setFile] = useState(null); + const [acceptedType, setAcceptedType] = useState( + UPLOAD_FILE_TYPES_MAP.picture + ); - useEffect(() => { - setAcceptedType(UPLOAD_FILE_TYPES_MAP[question.content.type]); - }, [question.content.type]); + useEffect(() => { + setAcceptedType(UPLOAD_FILE_TYPES_MAP[question.content.type]); + }, [question.content.type]); - function handleFileChange(event: ChangeEvent) { - if (!event.target.files?.[0]) return setFile(null); - setFile(event.target.files[0]); - } + function handleFileChange(event: ChangeEvent) { + if (!event.target.files?.[0]) return setFile(null); + setFile(event.target.files[0]); + } - return ( - - {question.title} - - {file && Выбран файл: {file.name}} - - ); + return ( + + {question.title} + + {file && Выбран файл: {file.name}} + + ); } diff --git a/src/stores/quizData/actions.ts b/src/stores/quizData/actions.ts deleted file mode 100644 index 17f826a..0000000 --- a/src/stores/quizData/actions.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { AnyTypedQuizQuestion } from "@model/questionTypes/shared"; -import { useQuestionsStore } from "./store"; -import { QuizSettings } from "@model/settingsData"; - - -export const getQuestionById = (questionId: string | null): AnyTypedQuizQuestion | null => { - if (questionId === null) return null; - - return useQuestionsStore.getState().items.find(q => q.id === questionId || q.content.id === questionId) || null; -}; - -export const setQuizData = (quizData: QuizSettings) => useQuestionsStore.setState(quizData); diff --git a/src/stores/quizData/hooks.ts b/src/stores/quizData/hooks.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/stores/quizData/store.ts b/src/stores/quizData/store.ts deleted file mode 100644 index 88f530b..0000000 --- a/src/stores/quizData/store.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { QuizSettings } from "@model/settingsData"; -import { create } from "zustand"; -import { devtools } from "zustand/middleware"; - - -type QuizDataStore = { - settings: QuizSettings["settings"] | null; - items: QuizSettings["items"]; - cnt: QuizSettings["cnt"]; - recentlyСompleted: boolean; -}; - -const initialState: QuizDataStore = { - settings: null, - items: [], - cnt: 0, - recentlyСompleted: false, -}; - -export const useQuestionsStore = create()( - devtools( - () => initialState, - { - name: "QuizDataStore", - enabled: import.meta.env.DEV, - trace: import.meta.env.DEV, - } - ) -); diff --git a/src/utils/handleComponentError.ts b/src/utils/handleComponentError.ts new file mode 100644 index 0000000..8d21fd7 --- /dev/null +++ b/src/utils/handleComponentError.ts @@ -0,0 +1,43 @@ +import { ErrorInfo } from "react"; + + +interface ComponentError { + timestamp: number; + message: string; + callStack: string | undefined; + componentStack: string | null | undefined; +} + +export function handleComponentError(error: Error, info: ErrorInfo) { + const componentError: ComponentError = { + timestamp: Math.floor(Date.now() / 1000), + message: error.message, + callStack: error.stack, + componentStack: info.componentStack, + }; + + queueErrorRequest(componentError); +} + +let errorsQueue: ComponentError[] = []; +let timeoutId: ReturnType; + +function queueErrorRequest(error: ComponentError) { + errorsQueue.push(error); + + clearTimeout(timeoutId); + timeoutId = setTimeout(() => { + sendErrorsToServer(); + }, 1000); +} + +async function sendErrorsToServer() { + // makeRequest({ + // url: "", + // method: "POST", + // body: errorsQueue, + // useToken: true, + // }); + console.log(`Fake-sending ${errorsQueue.length} errors to server`, errorsQueue); + errorsQueue = []; +} diff --git a/src/utils/hooks/useGetSettings.ts b/src/utils/hooks/useGetSettings.ts deleted file mode 100644 index 822cd40..0000000 --- a/src/utils/hooks/useGetSettings.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { useEffect, useLayoutEffect, useRef, useState } from "react" -import { useQuestionsStore } from "@stores/quizData/store"; - -import { getData } from "@api/quizRelase" - -interface SettingsGetter { - quizId: string -} - -export function useGetSettings(quizId: string) { - - const [fetchState, setFetchState] = useState<"fetching" | "idle" | "all fetched">("idle") - - useEffect(() => { - async function get() { - const data = await getData(quizId) - //@ts-ignore - const settings = data.settings - const parseData = { - settings: { - fp: settings.fp, - rep: settings.rep, - name: settings.name, - cfg: JSON.parse(settings?.cfg), - lim: settings.lim, - due: settings.due, - delay: settings.delay, - pausable: settings.pausable - }, - //@ts-ignore - items: data.items.map((item) => { - const content = JSON.parse(item.c) - return { - description: item.desc, - id: item.id, - page: item.p, - required: item.req, - title: item.title, - type: item.typ, - content - } - }), - //@ts-ignore - cnt: data.cnt - } - //@ts-ignore - useQuestionsStore.setState(parseData) - } - get() - // const controller = new AbortController() - - - }, []) - return - // return -} diff --git a/src/utils/hooks/useQuizData.ts b/src/utils/hooks/useQuizData.ts new file mode 100644 index 0000000..1e180c7 --- /dev/null +++ b/src/utils/hooks/useQuizData.ts @@ -0,0 +1,34 @@ +import { getData } from "@api/quizRelase"; +import { parseQuizData } from "@model/api/getQuizData"; +import { QuizSettings } from "@model/settingsData"; +import { enqueueSnackbar } from "notistack"; +import useSWR from "swr"; +import { useQuizId } from "../../contexts/QuizIdContext"; +import { replaceSpacesToEmptyLines } from "../../pages/ViewPublicationPage/tools/replaceSpacesToEmptyLines"; + + +export function useQuizData() { + const quizId = useQuizId(); + const { data } = useSWR(["quizData", quizId], params => getQuizData(params[1]), { + suspense: true, + }); + + return data; +} + +async function getQuizData(quizId: string) { + const response = await getData(quizId); + const quizDataResponse = response.data; + + if (response.error) { + enqueueSnackbar(response.error); + throw new Error(response.error); + } + if (!quizDataResponse) { + throw new Error("Quiz not found"); + } + + const quizSettings = replaceSpacesToEmptyLines(parseQuizData(quizDataResponse, quizId)); + + return JSON.parse(JSON.stringify({ data: quizSettings }).replaceAll(/\\" \\"/g, '""').replaceAll(/" "/g, '""')).data as QuizSettings; +} diff --git a/yarn.lock b/yarn.lock index e1e30ce..ef80ce4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2714,6 +2714,13 @@ react-dom@^18.2.0: loose-envify "^1.1.0" scheduler "^0.23.0" +react-error-boundary@^4.0.12: + version "4.0.12" + resolved "https://registry.yarnpkg.com/react-error-boundary/-/react-error-boundary-4.0.12.tgz#59f8f1dbc53bbbb34fc384c8db7cf4082cb63e2c" + integrity sha512-kJdxdEYlb7CPC1A0SeUY38cHpjuu6UkvzKiAmqmOFL21VRfMhOcWxTCBgLVCO0VEMh9JhFNcVaXlV4/BTpiwOA== + dependencies: + "@babel/runtime" "^7.12.5" + react-is@^16.13.1, react-is@^16.7.0: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" From ba547dcb55d0bd0e431e035a06b2b54df9ddc760 Mon Sep 17 00:00:00 2001 From: nflnkr <105123049+nflnkr@users.noreply.github.com> Date: Mon, 5 Feb 2024 13:10:02 +0300 Subject: [PATCH 21/81] add hook for retreiving root container width --- src/App.tsx | 30 +++-- src/WidgetApp.tsx | 38 ++++-- src/contexts/RootContainerWidthContext.ts | 11 ++ src/pages/ViewPublicationPage/ContactForm.tsx | 9 +- src/pages/ViewPublicationPage/Footer.tsx | 5 +- src/pages/ViewPublicationPage/Question.tsx | 7 +- src/pages/ViewPublicationPage/ResultForm.tsx | 8 +- .../StartPageViewPublication.tsx | 9 +- .../ViewPublicationPage/questions/File.tsx | 24 ++-- .../ViewPublicationPage/questions/Images.tsx | 23 ++-- .../ViewPublicationPage/questions/Number.tsx | 17 +-- .../ViewPublicationPage/questions/Rating.tsx | 24 ++-- .../ViewPublicationPage/questions/Varimg.tsx | 18 +-- src/ui_kit/LabeledDatePicker.tsx | 117 +++++++++--------- 14 files changed, 197 insertions(+), 143 deletions(-) create mode 100644 src/contexts/RootContainerWidthContext.ts diff --git a/src/App.tsx b/src/App.tsx index 5e2e7ad..c186a89 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,21 +1,37 @@ import { Box } from "@mui/material"; +import { useEffect, useState } from "react"; import { useParams } from "react-router-dom"; import QuizAnswerer from "./QuizAnswerer"; import { QuizIdContext } from "./contexts/QuizIdContext"; +import { RootContainerWidthContext } from "./contexts/RootContainerWidthContext"; const defaultQuizId = "ef836ff8-35b1-4031-9acf-af5766bac2b2"; export default function App() { const quizId = useParams().quizId ?? defaultQuizId; + const [rootContainerSize, setRootContainerSize] = useState(Infinity); + + useEffect(() => { + const handleWindowResize = () => { + setRootContainerSize(window.innerWidth); + }; + window.addEventListener("resize", handleWindowResize); + + return () => { + window.removeEventListener("resize", handleWindowResize); + }; + }, []); return ( - - - - - + + + + + + + ); } diff --git a/src/WidgetApp.tsx b/src/WidgetApp.tsx index a6c7215..142b00b 100644 --- a/src/WidgetApp.tsx +++ b/src/WidgetApp.tsx @@ -1,6 +1,8 @@ import { Box } from "@mui/material"; +import { useEffect, useRef, useState } from "react"; import QuizAnswerer from "./QuizAnswerer"; import { QuizIdContext } from "./contexts/QuizIdContext"; +import { RootContainerWidthContext } from "./contexts/RootContainerWidthContext"; interface Props { @@ -8,15 +10,35 @@ interface Props { } export default function WidgetApp({ quizId }: Props) { + const [rootContainerSize, setRootContainerSize] = useState(Infinity); + const rootContainerRef = useRef(null); + + useEffect(() => { + const handleWindowResize = () => { + if (!rootContainerRef.current) return; + + setRootContainerSize(rootContainerRef.current.clientWidth); + }; + window.addEventListener("resize", handleWindowResize); + + return () => { + window.removeEventListener("resize", handleWindowResize); + }; + }, []); return ( - - - - - + + + + + + + ); } diff --git a/src/contexts/RootContainerWidthContext.ts b/src/contexts/RootContainerWidthContext.ts new file mode 100644 index 0000000..e1987a7 --- /dev/null +++ b/src/contexts/RootContainerWidthContext.ts @@ -0,0 +1,11 @@ +import { createContext, useContext } from "react"; + + +export const RootContainerWidthContext = createContext(null); + +export const useRootContainerSize = () => { + const rootContainerSize = useContext(RootContainerWidthContext); + if (rootContainerSize === null) throw new Error("rootContainerSize context is null"); + + return rootContainerSize; +}; diff --git a/src/pages/ViewPublicationPage/ContactForm.tsx b/src/pages/ViewPublicationPage/ContactForm.tsx index 321423a..600d248 100644 --- a/src/pages/ViewPublicationPage/ContactForm.tsx +++ b/src/pages/ViewPublicationPage/ContactForm.tsx @@ -3,7 +3,7 @@ import EmailIcon from "@icons/ContactFormIcon/EmailIcon"; import NameIcon from "@icons/ContactFormIcon/NameIcon"; import PhoneIcon from "@icons/ContactFormIcon/PhoneIcon"; import TextIcon from "@icons/ContactFormIcon/TextIcon"; -import { Box, Button, InputAdornment, Link, TextField as MuiTextField, TextFieldProps, Typography, useMediaQuery, useTheme } from "@mui/material"; +import { Box, Button, InputAdornment, Link, TextField as MuiTextField, TextFieldProps, Typography, useTheme } from "@mui/material"; import CustomCheckbox from "@ui_kit/CustomCheckbox"; import { FC, useRef, useState } from "react"; @@ -12,10 +12,11 @@ import { sendFC } from "@api/quizRelase"; import { NameplateLogo } from "@icons/NameplateLogo"; import { QuizQuestionResult } from "@model/questionTypes/result"; import { useQuizData } from "@utils/hooks/useQuizData"; +import { quizThemes } from "@utils/themes/Publication/themePublication"; import { enqueueSnackbar } from "notistack"; +import { useRootContainerSize } from "../../contexts/RootContainerWidthContext"; import { ApologyPage } from "./ApologyPage"; import { checkEmptyData } from "./tools/checkEmptyData"; -import { quizThemes } from "@utils/themes/Publication/themePublication"; const TextField = MuiTextField as unknown as FC; // temporary fix ts(2590) @@ -84,7 +85,7 @@ export const ContactForm = ({ const fireOnce = useRef(true); const [fire, setFire] = useState(false); - const isMobile = useMediaQuery(theme.breakpoints.down(850)); + const isMobile = useRootContainerSize() < 850; const followNextForm = () => { setShowContactForm(false); @@ -475,7 +476,7 @@ const Inputs = ({ const CustomInput = ({ title, desc, Icon, onChange }: any) => { const theme = useTheme(); - const isMobile = useMediaQuery(theme.breakpoints.down(600)); + const isMobile = useRootContainerSize() < 600; //@ts-ignore return ( diff --git a/src/pages/ViewPublicationPage/Footer.tsx b/src/pages/ViewPublicationPage/Footer.tsx index 34866ca..5b89510 100644 --- a/src/pages/ViewPublicationPage/Footer.tsx +++ b/src/pages/ViewPublicationPage/Footer.tsx @@ -1,4 +1,4 @@ -import { Box, Button, Typography, useMediaQuery, useTheme } from "@mui/material"; +import { Box, Button, Typography, useTheme } from "@mui/material"; import { useCallback, useMemo, useState } from "react"; import { enqueueSnackbar } from "notistack"; @@ -9,6 +9,7 @@ import { checkEmptyData } from "./tools/checkEmptyData"; import type { QuizQuestionResult } from "@model/questionTypes/result"; import { useQuizViewStore } from "@stores/quizView/store"; import { useQuizData } from "@utils/hooks/useQuizData"; +import { useRootContainerSize } from "../../contexts/RootContainerWidthContext"; type FooterProps = { setCurrentQuestion: (step: AnyTypedQuizQuestion) => void; @@ -25,7 +26,7 @@ export const Footer = ({ setCurrentQuestion, question, setShowContactForm, setSh const [stepNumber, setStepNumber] = useState(1); - const isMobileMini = useMediaQuery(theme.breakpoints.down(382)); + const isMobileMini = useRootContainerSize() < 382; const isLinear = !questions.some(({ content }) => content.rule.parentId === "root"); const getNextQuestionId = useCallback(() => { diff --git a/src/pages/ViewPublicationPage/Question.tsx b/src/pages/ViewPublicationPage/Question.tsx index d3fe759..2d42501 100644 --- a/src/pages/ViewPublicationPage/Question.tsx +++ b/src/pages/ViewPublicationPage/Question.tsx @@ -1,4 +1,4 @@ -import { Box, useMediaQuery, useTheme } from "@mui/material"; +import { Box, useTheme } from "@mui/material"; import { useEffect, useState } from "react"; import { ContactForm } from "./ContactForm"; @@ -21,9 +21,10 @@ import type { AnyTypedQuizQuestion } from "../../model/questionTypes/shared"; import { NameplateLogoFQ } from "@icons/NameplateLogoFQ"; import { NameplateLogoFQDark } from "@icons/NameplateLogoFQDark"; import { QuizQuestionResult } from "@model/questionTypes/result"; +import { useQuizData } from "@utils/hooks/useQuizData"; import { notReachable } from "@utils/notReachable"; import { quizThemes } from "@utils/themes/Publication/themePublication"; -import { useQuizData } from "@utils/hooks/useQuizData"; +import { useRootContainerSize } from "../../contexts/RootContainerWidthContext"; export const Question = () => { const theme = useTheme(); @@ -31,7 +32,7 @@ export const Question = () => { const [currentQuestion, setCurrentQuestion] = useState(); const [showContactForm, setShowContactForm] = useState(false); const [showResultForm, setShowResultForm] = useState(false); - const isMobile = useMediaQuery(theme.breakpoints.down(650)); + const isMobile = useRootContainerSize() < 650; useEffect(() => { if (settings?.cfg.haveRoot) {//ветвимся diff --git a/src/pages/ViewPublicationPage/ResultForm.tsx b/src/pages/ViewPublicationPage/ResultForm.tsx index 335d9f3..b574ae1 100644 --- a/src/pages/ViewPublicationPage/ResultForm.tsx +++ b/src/pages/ViewPublicationPage/ResultForm.tsx @@ -2,17 +2,17 @@ import { Box, Button, Typography, - useMediaQuery, - useTheme, + useTheme } from "@mui/material"; import { NameplateLogo } from "@icons/NameplateLogo"; import YoutubeEmbedIframe from "./tools/YoutubeEmbedIframe"; +import { useQuizData } from "@utils/hooks/useQuizData"; import { quizThemes } from "@utils/themes/Publication/themePublication"; import { useCallback, useEffect, useMemo } from "react"; +import { useRootContainerSize } from "../../contexts/RootContainerWidthContext"; import type { QuizQuestionResult } from "../../model/questionTypes/result"; -import { useQuizData } from "@utils/hooks/useQuizData"; type ResultFormProps = { @@ -28,7 +28,7 @@ export const ResultForm = ({ setShowResultForm, }: ResultFormProps) => { const theme = useTheme(); - const isMobile = useMediaQuery(theme.breakpoints.down(650)); + const isMobile = useRootContainerSize() < 650; const { settings, questions } = useQuizData(); const resultQuestion = useMemo(() => { diff --git a/src/pages/ViewPublicationPage/StartPageViewPublication.tsx b/src/pages/ViewPublicationPage/StartPageViewPublication.tsx index b80dba8..f8f540b 100644 --- a/src/pages/ViewPublicationPage/StartPageViewPublication.tsx +++ b/src/pages/ViewPublicationPage/StartPageViewPublication.tsx @@ -1,4 +1,4 @@ -import { Box, Button, ButtonBase, Link, Paper, Typography, useMediaQuery, useTheme } from "@mui/material"; +import { Box, Button, ButtonBase, Link, Paper, Typography, useTheme } from "@mui/material"; import { useUADevice } from "../../utils/hooks/useUADevice"; import { notReachable } from "../../utils/notReachable"; import YoutubeEmbedIframe from "./tools/YoutubeEmbedIframe"; @@ -7,6 +7,7 @@ import { NameplateLogo } from "@icons/NameplateLogo"; import { QuizStartpageAlignType, QuizStartpageType } from "@model/settingsData"; import { useQuizData } from "@utils/hooks/useQuizData"; import { quizThemes } from "@utils/themes/Publication/themePublication"; +import { useRootContainerSize } from "../../contexts/RootContainerWidthContext"; interface Props { @@ -17,7 +18,7 @@ export const StartPageViewPublication = ({ setVisualStartPage }: Props) => { const theme = useTheme(); const { settings } = useQuizData(); const { isMobileDevice } = useUADevice(); - const isMobile = useMediaQuery(theme.breakpoints.down(650)); + const isMobile = useRootContainerSize() < 650; const handleCopyNumber = () => { navigator.clipboard.writeText(settings.cfg.info.phonenumber); @@ -266,8 +267,8 @@ function QuizPreviewLayoutByType({ startpageType: QuizStartpageType; alignType: QuizStartpageAlignType; }) { - const theme = useTheme(); - const isMobile = useMediaQuery(theme.breakpoints.down(650)); + const isMobile = useRootContainerSize() < 650; + function StartPageMobile() { return ( { const answer = answers.find( ({ questionId }) => questionId === currentQuestion.id )?.answer as string; - const isMobile = useMediaQuery(theme.breakpoints.down(500)); + const isMobile = useRootContainerSize() < 500; const uploadFile = async ({ target }: ChangeEvent) => { const file = target.files?.[0]; if (file) { diff --git a/src/pages/ViewPublicationPage/questions/Images.tsx b/src/pages/ViewPublicationPage/questions/Images.tsx index 6d0483c..4c65c49 100644 --- a/src/pages/ViewPublicationPage/questions/Images.tsx +++ b/src/pages/ViewPublicationPage/questions/Images.tsx @@ -1,21 +1,21 @@ import { Box, - Typography, - RadioGroup, FormControlLabel, Radio, - useTheme, - useMediaQuery, + RadioGroup, + Typography, + useTheme } from "@mui/material"; -import { useQuizViewStore, updateAnswer, deleteAnswer } from "@stores/quizView/store"; +import { deleteAnswer, updateAnswer, useQuizViewStore } from "@stores/quizView/store"; import RadioCheck from "@ui_kit/RadioCheck"; import RadioIcon from "@ui_kit/RadioIcon"; -import type { QuizQuestionImages } from "../../../model/questionTypes/images"; -import { enqueueSnackbar } from "notistack"; import { sendAnswer } from "@api/quizRelase"; import { useQuizData } from "@utils/hooks/useQuizData"; +import { enqueueSnackbar } from "notistack"; +import { useRootContainerSize } from "../../../contexts/RootContainerWidthContext"; +import type { QuizQuestionImages } from "../../../model/questionTypes/images"; type ImagesProps = { currentQuestion: QuizQuestionImages; @@ -25,12 +25,9 @@ export const Images = ({ currentQuestion }: ImagesProps) => { const { settings } = useQuizData(); const { answers } = useQuizViewStore(); const theme = useTheme(); - const { answer } = - answers.find( - ({ questionId }) => questionId === currentQuestion.id - ) ?? {}; - const isTablet = useMediaQuery(theme.breakpoints.down(1000)); - const isMobile = useMediaQuery(theme.breakpoints.down(500)); + const answer = answers.find(({ questionId }) => questionId === currentQuestion.id)?.answer; + const isTablet = useRootContainerSize() < 1000; + const isMobile = useRootContainerSize() < 500; return ( diff --git a/src/pages/ViewPublicationPage/questions/Number.tsx b/src/pages/ViewPublicationPage/questions/Number.tsx index 1c1c920..9ff810e 100644 --- a/src/pages/ViewPublicationPage/questions/Number.tsx +++ b/src/pages/ViewPublicationPage/questions/Number.tsx @@ -1,18 +1,19 @@ -import { useState, useEffect } from "react"; -import { Box, Typography, useMediaQuery, useTheme } from "@mui/material"; +import { Box, Typography, useTheme } from "@mui/material"; +import { useEffect, useState } from "react"; import { useDebouncedCallback } from "use-debounce"; -import CustomTextField from "@ui_kit/CustomTextField"; import { CustomSlider } from "@ui_kit/CustomSlider"; +import CustomTextField from "@ui_kit/CustomTextField"; -import { useQuizViewStore, updateAnswer } from "@stores/quizView/store"; +import { updateAnswer, useQuizViewStore } from "@stores/quizView/store"; -import type { QuizQuestionNumber } from "../../../model/questionTypes/number"; -import { enqueueSnackbar } from "notistack"; import { sendAnswer } from "@api/quizRelase"; +import { enqueueSnackbar } from "notistack"; +import type { QuizQuestionNumber } from "../../../model/questionTypes/number"; -import { quizThemes } from "@utils/themes/Publication/themePublication"; import { useQuizData } from "@utils/hooks/useQuizData"; +import { quizThemes } from "@utils/themes/Publication/themePublication"; +import { useRootContainerSize } from "../../../contexts/RootContainerWidthContext"; type NumberProps = { currentQuestion: QuizQuestionNumber; @@ -26,7 +27,7 @@ export const Number = ({ currentQuestion }: NumberProps) => { const theme = useTheme(); const { answers } = useQuizViewStore(); - const isMobile = useMediaQuery(theme.breakpoints.down(650)); + const isMobile = useRootContainerSize() < 650; const min = window.Number(currentQuestion.content.range.split("—")[0]); const max = window.Number(currentQuestion.content.range.split("—")[1]); diff --git a/src/pages/ViewPublicationPage/questions/Rating.tsx b/src/pages/ViewPublicationPage/questions/Rating.tsx index bf89ab6..1d6f5f7 100644 --- a/src/pages/ViewPublicationPage/questions/Rating.tsx +++ b/src/pages/ViewPublicationPage/questions/Rating.tsx @@ -1,25 +1,25 @@ import { Box, - Typography, Rating as RatingComponent, - useTheme, - useMediaQuery + Typography, + useTheme } from "@mui/material"; -import { useQuizViewStore, updateAnswer } from "@stores/quizView/store"; +import { updateAnswer, useQuizViewStore } from "@stores/quizView/store"; -import TropfyIcon from "@icons/questionsPage/tropfyIcon"; import FlagIcon from "@icons/questionsPage/FlagIcon"; -import HeartIcon from "@icons/questionsPage/heartIcon"; -import LikeIcon from "@icons/questionsPage/likeIcon"; -import LightbulbIcon from "@icons/questionsPage/lightbulbIcon"; -import HashtagIcon from "@icons/questionsPage/hashtagIcon"; import StarIconMini from "@icons/questionsPage/StarIconMini"; +import HashtagIcon from "@icons/questionsPage/hashtagIcon"; +import HeartIcon from "@icons/questionsPage/heartIcon"; +import LightbulbIcon from "@icons/questionsPage/lightbulbIcon"; +import LikeIcon from "@icons/questionsPage/likeIcon"; +import TropfyIcon from "@icons/questionsPage/tropfyIcon"; -import type { QuizQuestionRating } from "../../../model/questionTypes/rating"; -import { enqueueSnackbar } from "notistack"; import { sendAnswer } from "@api/quizRelase"; import { useQuizData } from "@utils/hooks/useQuizData"; +import { enqueueSnackbar } from "notistack"; +import { useRootContainerSize } from "../../../contexts/RootContainerWidthContext"; +import type { QuizQuestionRating } from "../../../model/questionTypes/rating"; type RatingProps = { currentQuestion: QuizQuestionRating; @@ -60,7 +60,7 @@ export const Rating = ({ currentQuestion }: RatingProps) => { const { settings } = useQuizData(); const { answers } = useQuizViewStore(); const theme = useTheme(); - const isMobile = useMediaQuery(theme.breakpoints.down(650)); + const isMobile = useRootContainerSize() < 650; const { answer } = answers.find( ({ questionId }) => questionId === currentQuestion.id diff --git a/src/pages/ViewPublicationPage/questions/Varimg.tsx b/src/pages/ViewPublicationPage/questions/Varimg.tsx index ec8c79b..bee631c 100644 --- a/src/pages/ViewPublicationPage/questions/Varimg.tsx +++ b/src/pages/ViewPublicationPage/questions/Varimg.tsx @@ -1,23 +1,23 @@ import { Box, - Typography, - RadioGroup, FormControlLabel, Radio, - useTheme, - useMediaQuery + RadioGroup, + Typography, + useTheme } from "@mui/material"; -import { useQuizViewStore, updateAnswer, deleteAnswer } from "@stores/quizView/store"; +import { deleteAnswer, updateAnswer, useQuizViewStore } from "@stores/quizView/store"; import RadioCheck from "@ui_kit/RadioCheck"; import RadioIcon from "@ui_kit/RadioIcon"; -import type { QuizQuestionVarImg } from "../../../model/questionTypes/varimg"; -import { enqueueSnackbar } from "notistack"; import { sendAnswer } from "@api/quizRelase"; -import { quizThemes } from "@utils/themes/Publication/themePublication"; import BlankImage from "@icons/BlankImage"; import { useQuizData } from "@utils/hooks/useQuizData"; +import { quizThemes } from "@utils/themes/Publication/themePublication"; +import { enqueueSnackbar } from "notistack"; +import { useRootContainerSize } from "../../../contexts/RootContainerWidthContext"; +import type { QuizQuestionVarImg } from "../../../model/questionTypes/varimg"; type VarimgProps = { currentQuestion: QuizQuestionVarImg; @@ -27,7 +27,7 @@ export const Varimg = ({ currentQuestion }: VarimgProps) => { const { settings } = useQuizData(); const { answers } = useQuizViewStore(); const theme = useTheme(); - const isMobile = useMediaQuery(theme.breakpoints.down(650)); + const isMobile = useRootContainerSize() < 650; const { answer } = answers.find( diff --git a/src/ui_kit/LabeledDatePicker.tsx b/src/ui_kit/LabeledDatePicker.tsx index ee8218c..3a68702 100644 --- a/src/ui_kit/LabeledDatePicker.tsx +++ b/src/ui_kit/LabeledDatePicker.tsx @@ -1,69 +1,70 @@ import CalendarIcon from "@icons/CalendarIcon"; -import { Typography, Box, SxProps, Theme, useMediaQuery, useTheme } from "@mui/material"; +import { Box, SxProps, Theme, Typography, useTheme } from "@mui/material"; import { DatePicker } from "@mui/x-date-pickers"; import moment from "moment"; +import { useRootContainerSize } from "../contexts/RootContainerWidthContext"; interface Props { - label?: string; - sx?: SxProps; - value?: moment.Moment; - onChange?: (value: string | null) => void; + label?: string; + sx?: SxProps; + value?: moment.Moment; + onChange?: (value: string | null) => void; } export default function LabeledDatePicker({ label, value = moment(), onChange, sx }: Props) { - const theme = useTheme(); - const upLg = useMediaQuery(theme.breakpoints.up("md")); + const theme = useTheme(); + const upLg = useRootContainerSize() > theme.breakpoints.values.md; - return ( - - {label && ( - - {label} - - )} - , - }} - slotProps={{ - openPickerButton: { - sx: { - p: 0, - }, - "data-cy": "open-datepicker", - }, - }} - sx={{ - "& .MuiInputBase-root": { - backgroundColor: "#F2F3F7", - borderRadius: "10px", - pr: "22px", - "& input": { - py: "11px", - pl: upLg ? "20px" : "13px", - lineHeight: "19px", - }, - "& fieldset": { - borderColor: "#9A9AAF", - }, - }, - }} - /> - - ); + {label && ( + + {label} + + )} + , + }} + slotProps={{ + openPickerButton: { + sx: { + p: 0, + }, + "data-cy": "open-datepicker", + }, + }} + sx={{ + "& .MuiInputBase-root": { + backgroundColor: "#F2F3F7", + borderRadius: "10px", + pr: "22px", + "& input": { + py: "11px", + pl: upLg ? "20px" : "13px", + lineHeight: "19px", + }, + "& fieldset": { + borderColor: "#9A9AAF", + }, + }, + }} + /> + + ); } From 9fe0c2fb094340407401b35abb1b1f102bf7efe8 Mon Sep 17 00:00:00 2001 From: skeris Date: Wed, 7 Feb 2024 00:52:18 +0300 Subject: [PATCH 22/81] fix get settiongs content type --- src/api/quizRelase.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/api/quizRelase.ts b/src/api/quizRelase.ts index 6b4448c..492b4e0 100644 --- a/src/api/quizRelase.ts +++ b/src/api/quizRelase.ts @@ -33,7 +33,9 @@ export async function getData(quizId: string): Promise<{ `https://s.hbpn.link/answer/settings`, { method: "POST", - // headers, + headers: { + "Content-Type": "application/json", + }, data: JSON.stringify({ quiz_id: quizId, limit: 100, From e4d90189629a7e1d63575ed01c3680049c76cc1a Mon Sep 17 00:00:00 2001 From: nflnkr <105123049+nflnkr@users.noreply.github.com> Date: Thu, 8 Feb 2024 16:42:31 +0300 Subject: [PATCH 23/81] refactor component hierarchy move logic to dedicated hook use quizId from context, not from settings add ErrorBoundaryFallback component --- src/App.tsx | 10 +- src/QuizAnswerer.tsx | 8 +- src/WidgetApp.tsx | 10 +- src/api/quizRelase.ts | 207 +++++++-------- src/model/api/getQuizData.ts | 3 +- src/model/questionTypes/shared.ts | 30 +-- src/model/settingsData.ts | 3 +- src/pages/ViewPublicationPage/ApologyPage.tsx | 17 +- src/pages/ViewPublicationPage/ContactForm.tsx | 232 ++++++---------- src/pages/ViewPublicationPage/Footer.tsx | 249 +----------------- src/pages/ViewPublicationPage/Question.tsx | 134 ++++------ src/pages/ViewPublicationPage/ResultForm.tsx | 59 +---- .../StartPageViewPublication.tsx | 21 +- .../ViewPublicationPage.tsx | 106 ++++++-- .../ViewPublicationPage/questions/Date.tsx | 5 +- .../ViewPublicationPage/questions/Emoji.tsx | 9 +- .../ViewPublicationPage/questions/File.tsx | 13 +- .../ViewPublicationPage/questions/Images.tsx | 8 +- .../ViewPublicationPage/questions/Number.tsx | 5 +- .../ViewPublicationPage/questions/Page.tsx | 6 +- .../ViewPublicationPage/questions/Rating.tsx | 6 +- .../ViewPublicationPage/questions/Select.tsx | 15 +- .../ViewPublicationPage/questions/Text.tsx | 12 +- .../ViewPublicationPage/questions/Variant.tsx | 15 +- .../ViewPublicationPage/questions/Varimg.tsx | 6 +- .../tools/checkEmptyData.ts | 29 +- src/stores/quizView/store.ts | 16 +- src/ui_kit/ErrorBoundaryFallback.tsx | 27 ++ src/utils/hooks/useQuestionFlowControl.ts | 213 +++++++++++++++ src/utils/hooks/useQuizData.ts | 4 +- 30 files changed, 685 insertions(+), 793 deletions(-) create mode 100644 src/ui_kit/ErrorBoundaryFallback.tsx create mode 100644 src/utils/hooks/useQuestionFlowControl.ts diff --git a/src/App.tsx b/src/App.tsx index c186a89..1247bea 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,20 +1,22 @@ import { Box } from "@mui/material"; -import { useEffect, useState } from "react"; +import { startTransition, useEffect, useState } from "react"; import { useParams } from "react-router-dom"; import QuizAnswerer from "./QuizAnswerer"; import { QuizIdContext } from "./contexts/QuizIdContext"; import { RootContainerWidthContext } from "./contexts/RootContainerWidthContext"; -const defaultQuizId = "ef836ff8-35b1-4031-9acf-af5766bac2b2"; +const defaultQuizId = "45ef7f9c-784d-4e58-badb-f6b337f08ba0"; export default function App() { const quizId = useParams().quizId ?? defaultQuizId; - const [rootContainerSize, setRootContainerSize] = useState(Infinity); + const [rootContainerSize, setRootContainerSize] = useState(() => window.innerWidth); useEffect(() => { const handleWindowResize = () => { - setRootContainerSize(window.innerWidth); + startTransition(() => { + setRootContainerSize(window.innerWidth); + }); }; window.addEventListener("resize", handleWindowResize); diff --git a/src/QuizAnswerer.tsx b/src/QuizAnswerer.tsx index 3d3e935..d39e206 100644 --- a/src/QuizAnswerer.tsx +++ b/src/QuizAnswerer.tsx @@ -2,6 +2,7 @@ import { CssBaseline, ThemeProvider } from "@mui/material"; import { LocalizationProvider } from "@mui/x-date-pickers"; import { AdapterMoment } from "@mui/x-date-pickers/AdapterMoment"; import { ruRU } from '@mui/x-date-pickers/locales'; +import ErrorBoundaryFallback from "@ui_kit/ErrorBoundaryFallback"; import LoadingSkeleton from "@ui_kit/LoadingSkeleton"; import { handleComponentError } from "@utils/handleComponentError"; import moment from "moment"; @@ -9,8 +10,7 @@ import { SnackbarProvider } from 'notistack'; import { Suspense } from "react"; import { ErrorBoundary } from "react-error-boundary"; import { SWRConfig } from "swr"; -import { ApologyPage } from "./pages/ViewPublicationPage/ApologyPage"; -import { ViewPage } from "./pages/ViewPublicationPage/ViewPublicationPage"; +import ViewPublicationPage from "./pages/ViewPublicationPage/ViewPublicationPage"; import lightTheme from "./utils/themes/light"; @@ -32,11 +32,11 @@ export default function QuizAnswerer() { > } + FallbackComponent={ErrorBoundaryFallback} onError={handleComponentError} > }> - + diff --git a/src/WidgetApp.tsx b/src/WidgetApp.tsx index 142b00b..f04d727 100644 --- a/src/WidgetApp.tsx +++ b/src/WidgetApp.tsx @@ -1,5 +1,5 @@ import { Box } from "@mui/material"; -import { useEffect, useRef, useState } from "react"; +import { startTransition, useEffect, useRef, useState } from "react"; import QuizAnswerer from "./QuizAnswerer"; import { QuizIdContext } from "./contexts/QuizIdContext"; import { RootContainerWidthContext } from "./contexts/RootContainerWidthContext"; @@ -10,14 +10,14 @@ interface Props { } export default function WidgetApp({ quizId }: Props) { - const [rootContainerSize, setRootContainerSize] = useState(Infinity); + const [rootContainerSize, setRootContainerSize] = useState(() => window.innerWidth); const rootContainerRef = useRef(null); useEffect(() => { const handleWindowResize = () => { - if (!rootContainerRef.current) return; - - setRootContainerSize(rootContainerRef.current.clientWidth); + startTransition(() => { + if (rootContainerRef.current) setRootContainerSize(rootContainerRef.current.clientWidth); + }); }; window.addEventListener("resize", handleWindowResize); diff --git a/src/api/quizRelase.ts b/src/api/quizRelase.ts index 6b4448c..6e63e2d 100644 --- a/src/api/quizRelase.ts +++ b/src/api/quizRelase.ts @@ -6,143 +6,124 @@ import type { AxiosError } from "axios"; let SESSIONS = ""; export const publicationMakeRequest = ({ url, body }: any) => { - console.log(body); - return axios(url, { - //@ts-ignore - data: body, - headers: { - "X-Sessionkey": SESSIONS, - "Content-Type": "multipart/form-data", - }, - method: "POST", - }); + console.log(body); + return axios(url, { + data: body, + headers: { + "X-Sessionkey": SESSIONS, + "Content-Type": "multipart/form-data", + }, + method: "POST", + }); }; export async function getData(quizId: string): Promise<{ - data: GetQuizDataResponse | null; - isRecentlyCompleted: boolean; - error?: string; + data: GetQuizDataResponse | null; + isRecentlyCompleted: boolean; + error?: string; }> { - const QID = - process.env.NODE_ENV === "production" - ? window.location.pathname.replace(/\//g, "") - : "ef836ff8-35b1-4031-9acf-af5766bac2b2"; + try { + const { data, headers } = await axios( + `https://s.hbpn.link/answer/settings`, + { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + data: { + quiz_id: quizId, + limit: 100, + page: 0, + need_config: true, + }, + } + ); + const sessions = JSON.parse(localStorage.getItem("sessions") || "{}"); - try { - const { data, headers } = await axios( - `https://s.hbpn.link/answer/settings`, - { - method: "POST", - // headers, - data: JSON.stringify({ - quiz_id: quizId, - limit: 100, - page: 0, - need_config: true, - }), - } - ); - const sessions = JSON.parse(localStorage.getItem("sessions") || "{}"); + if (typeof sessions[quizId] === "number") { + // unix время. Если меньше суток прошло - выводить ошибку, иначе пустить дальше + if (Date.now() - sessions[quizId] < 86400000) { + return { data, isRecentlyCompleted: true }; + } + } - if (typeof sessions[QID] === "number") { - // unix время. Если меньше суток прошло - выводить ошибку, иначе пустить дальше - if (Date.now() - sessions[QID] < 86400000) { - return { data, isRecentlyCompleted: true }; - } + SESSIONS = headers["x-sessionkey"]; + + return { data, isRecentlyCompleted: false }; + } catch (nativeError) { + const error = nativeError as AxiosError; + + return { data: null, isRecentlyCompleted: false, error: error.message }; } - - SESSIONS = headers["x-sessionkey"]; - - return { data, isRecentlyCompleted: false }; - } catch (nativeError) { - const error = nativeError as AxiosError; - - return { data: null, isRecentlyCompleted: false, error: error.message }; - } } export function sendAnswer({ questionId, body, qid }: any) { - const formData = new FormData(); - console.log(qid); - const answers = [ - { - question_id: questionId, - content: body, //тут массив с ответом - }, - ]; - formData.append("answers", JSON.stringify(answers)); - formData.append("qid", qid); + const formData = new FormData(); + console.log(qid); + const answers = [ + { + question_id: questionId, + content: body, //тут массив с ответом + }, + ]; + formData.append("answers", JSON.stringify(answers)); + formData.append("qid", qid); - return publicationMakeRequest({ - url: `https://s.hbpn.link/answer/answer`, - body: formData, - method: "POST", - }); + return publicationMakeRequest({ + url: `https://s.hbpn.link/answer/answer`, + body: formData, + method: "POST", + }); } //body ={file, filename} export function sendFile({ questionId, body, qid }: any) { - console.log(body); - const formData = new FormData(); + console.log(body); + const formData = new FormData(); - const answers: any = [ - { - question_id: questionId, - content: "file:" + body.name, - }, - ]; + const answers: any = [ + { + question_id: questionId, + content: "file:" + body.name, + }, + ]; - formData.append("answers", JSON.stringify(answers)); - formData.append(body.name, body.file); - formData.append("qid", qid); + formData.append("answers", JSON.stringify(answers)); + formData.append(body.name, body.file); + formData.append("qid", qid); - return publicationMakeRequest({ - url: `https://s.hbpn.link/answer/answer`, - body: formData, - method: "POST", - }); + return publicationMakeRequest({ + url: `https://s.hbpn.link/answer/answer`, + body: formData, + method: "POST", + }); } -const fields = [ - "name", - "email", - "phone", - "adress", - "telegram", - "wechat", - "viber", - "vk", - "skype", - "whatsup", - "messenger", - "text", -]; - //форма контактов export function sendFC({ questionId, body, qid }: any) { - const formData = new FormData(); + const formData = new FormData(); - // const keysBody = Object.keys(body) - // const content:any = {} - // fields.forEach((key) => { - // if (keysBody.includes(key)) content[key] = body.key - // }) + // const keysBody = Object.keys(body) + // const content:any = {} + // fields.forEach((key) => { + // if (keysBody.includes(key)) content[key] = body.key + // }) - const answers = [ - { - question_id: questionId, - content: JSON.stringify(body), - result: true, - qid, - }, - ]; + const answers = [ + { + question_id: questionId, + content: JSON.stringify(body), + result: true, + qid, + }, + ]; - formData.append("answers", JSON.stringify(answers)); - formData.append("qid", qid); + formData.append("answers", JSON.stringify(answers)); + formData.append("qid", qid); - return publicationMakeRequest({ - url: `https://s.hbpn.link/answer/answer`, - body: formData, - method: "POST", - }); + return publicationMakeRequest({ + url: `https://s.hbpn.link/answer/answer`, + body: formData, + method: "POST", + }); } diff --git a/src/model/api/getQuizData.ts b/src/model/api/getQuizData.ts index 96c44fd..b7385eb 100644 --- a/src/model/api/getQuizData.ts +++ b/src/model/api/getQuizData.ts @@ -24,7 +24,7 @@ export interface GetQuizDataResponse { }[]; } -export function parseQuizData(quizDataResponse: GetQuizDataResponse, quizId: string): Omit { +export function parseQuizData(quizDataResponse: GetQuizDataResponse): Omit { const items: QuizSettings["questions"] = quizDataResponse.items.map((item) => { const content = JSON.parse(item.c); @@ -40,7 +40,6 @@ export function parseQuizData(quizDataResponse: GetQuizDataResponse, quizId: str }); const settings: QuizSettings["settings"] = { - qid: quizId, fp: quizDataResponse.settings.fp, rep: quizDataResponse.settings.rep, name: quizDataResponse.settings.name, diff --git a/src/model/questionTypes/shared.ts b/src/model/questionTypes/shared.ts index 9545bf1..a8fa5b2 100644 --- a/src/model/questionTypes/shared.ts +++ b/src/model/questionTypes/shared.ts @@ -1,3 +1,4 @@ +import { nanoid } from "nanoid"; import type { QuizQuestionDate } from "./date"; import type { QuizQuestionEmoji } from "./emoji"; import type { QuizQuestionFile } from "./file"; @@ -5,24 +6,23 @@ import type { QuizQuestionImages } from "./images"; import type { QuizQuestionNumber } from "./number"; import type { QuizQuestionPage } from "./page"; import type { QuizQuestionRating } from "./rating"; +import type { QuizQuestionResult } from "./result"; import type { QuizQuestionSelect } from "./select"; import type { QuizQuestionText } from "./text"; import type { QuizQuestionVariant } from "./variant"; import type { QuizQuestionVarImg } from "./varimg"; -import type { QuizQuestionResult } from "./result"; -import { nanoid } from "nanoid"; export interface QuestionBranchingRuleMain { - next: string; - or: boolean; - rules: { - question: string; //id родителя (пока что) - answers: string[] - }[] + next: string; + or: boolean; + rules: { + question: string; //id родителя (пока что) + answers: string[]; + }[]; } -export interface QuestionBranchingRule { - children: string[], +export interface QuestionBranchingRule { + children: string[]; //список условий main: QuestionBranchingRuleMain[]; parentId: string | null | "root"; @@ -85,7 +85,6 @@ export interface QuizQuestionBase { }; } - export type AnyTypedQuizQuestion = | QuizQuestionVariant | QuizQuestionImages @@ -100,7 +99,7 @@ export type AnyTypedQuizQuestion = | QuizQuestionRating | QuizQuestionResult; - +export type RealTypedQuizQuestion = Exclude; type FilterQuestionsWithVariants = T extends { content: { variants: QuestionVariant[]; }; @@ -109,18 +108,19 @@ type FilterQuestionsWithVariants = T extends { export type QuizQuestionsWithVariants = FilterQuestionsWithVariants; -export const createBranchingRuleMain: (targetId:string, parentId:string) => QuestionBranchingRuleMain = (targetId, parentId) => ({ +export const createBranchingRuleMain: (targetId: string, parentId: string) => QuestionBranchingRuleMain = (targetId, parentId) => ({ next: targetId, or: false, rules: [{ question: parentId, answers: [] as string[], }] -}) +}); + export const createQuestionVariant: () => QuestionVariant = () => ({ id: nanoid(), answer: "", extendedText: "", hints: "", originalImageUrl: "", -}); +}); diff --git a/src/model/settingsData.ts b/src/model/settingsData.ts index bfbbd1d..06f1e18 100644 --- a/src/model/settingsData.ts +++ b/src/model/settingsData.ts @@ -8,6 +8,8 @@ export type QuizType = "quiz" | "form"; export type QuizResultsType = true | null; +export type QuizStep = "startpage" | "question" | "contactform"; + export type QuizTheme = | "StandardTheme" | "StandardDarkTheme" @@ -32,7 +34,6 @@ export type FCField = { export type QuizSettings = { questions: AnyTypedQuizQuestion[]; settings: { - qid: string; fp: boolean; rep: boolean; name: string; diff --git a/src/pages/ViewPublicationPage/ApologyPage.tsx b/src/pages/ViewPublicationPage/ApologyPage.tsx index ac27537..38b442a 100644 --- a/src/pages/ViewPublicationPage/ApologyPage.tsx +++ b/src/pages/ViewPublicationPage/ApologyPage.tsx @@ -1,22 +1,25 @@ import { Box, Typography } from "@mui/material"; -export const ApologyPage = ({message}:{message: string}) => { +type Props = { + message: string; +}; + +export const ApologyPage = ({ message }: Props) => { + return ( {message || "что-то пошло не так"} + >{message || "Что-то пошло не так"} - - - ) -} \ No newline at end of file + ); +}; diff --git a/src/pages/ViewPublicationPage/ContactForm.tsx b/src/pages/ViewPublicationPage/ContactForm.tsx index 600d248..9b2e05f 100644 --- a/src/pages/ViewPublicationPage/ContactForm.tsx +++ b/src/pages/ViewPublicationPage/ContactForm.tsx @@ -11,69 +11,25 @@ import { FC, useRef, useState } from "react"; import { sendFC } from "@api/quizRelase"; import { NameplateLogo } from "@icons/NameplateLogo"; import { QuizQuestionResult } from "@model/questionTypes/result"; +import { AnyTypedQuizQuestion } from "@model/questionTypes/shared"; import { useQuizData } from "@utils/hooks/useQuizData"; import { quizThemes } from "@utils/themes/Publication/themePublication"; import { enqueueSnackbar } from "notistack"; +import { useQuizId } from "../../contexts/QuizIdContext"; import { useRootContainerSize } from "../../contexts/RootContainerWidthContext"; -import { ApologyPage } from "./ApologyPage"; -import { checkEmptyData } from "./tools/checkEmptyData"; const TextField = MuiTextField as unknown as FC; // temporary fix ts(2590) const EMAIL_REGEXP = /^(([^<>()[\].,:\s@"]+(\.[^<>()[\].,:\s@"]+)*)|(".+"))@(([^<>()[\].,:\s@"]+\.)+[^<>()[\].,:\s@"]{2,})$/iu; -type ContactFormProps = { - currentQuestion: any; - showResultForm: boolean; - setShowContactForm: (show: boolean) => void; - setShowResultForm: (show: boolean) => void; +type Props = { + currentQuestion: AnyTypedQuizQuestion; + onShowResult: () => void; }; -const icons = [ - { - type: "name", - icon: NameIcon, - defaultText: "Введите имя", - defaultTitle: "имя", - backendName: "name", - }, - { - type: "email", - icon: EmailIcon, - defaultText: "Введите Email", - defaultTitle: "Email", - backendName: "email", - }, - { - type: "phone", - icon: PhoneIcon, - defaultText: "Введите номер телефона", - defaultTitle: "номер телефона", - backendName: "phone", - }, - { - type: "text", - icon: TextIcon, - defaultText: "Введите фамилию", - defaultTitle: "фамилию", - backendName: "adress", - }, - { - type: "address", - icon: AddressIcon, - defaultText: "Введите адрес", - defaultTitle: "адрес", - backendName: "adress", - }, -]; - -export const ContactForm = ({ - currentQuestion, - showResultForm, - setShowContactForm, - setShowResultForm, -}: ContactFormProps) => { +export const ContactForm = ({ currentQuestion, onShowResult }: Props) => { const theme = useTheme(); + const qid = useQuizId(); const { settings, questions } = useQuizData(); const [ready, setReady] = useState(false); @@ -87,78 +43,103 @@ export const ContactForm = ({ const [fire, setFire] = useState(false); const isMobile = useRootContainerSize() < 850; - const followNextForm = () => { - setShowContactForm(false); - setShowResultForm(true); - }; + const resultQuestion = currentQuestion.type === "result" + ? currentQuestion + : questions.find((question): question is QuizQuestionResult => { + if (settings?.cfg.haveRoot) { + return ( + question.type === "result" && + question.content.rule.parentId === currentQuestion.content.id + ); + } else { + return ( + question.type === "result" && question.content.rule.parentId === "line" + ); + } + }); - //@ts-ignore - const resultQuestion: QuizQuestionResult = questions.find((question) => { - if (settings?.cfg.haveRoot) { - //ветвимся - return ( - question.type === "result" && - //@ts-ignore - question.content.rule.parentId === currentQuestion.content.id - ); - } else { - // не ветвимся - return ( - question.type === "result" && question.content.rule.parentId === "line" - ); - } - }); + if (!resultQuestion) throw new Error("Result question not found"); const inputHC = async () => { - //@ts-ignore - const FC = settings?.cfg.formContact.fields || settings?.cfg.formContact; - const body = {}; - //@ts-ignore + const FC = settings.cfg.formContact.fields || settings.cfg.formContact; + const body = {} as any; if (name.length > 0) body.name = name; - //@ts-ignore if (email.length > 0) body.email = email; - //@ts-ignore if (phone.length > 0) body.phone = phone; - //@ts-ignore if (adress.length > 0) body.address = adress; - //@ts-ignore if (text.length > 0) body.customs = { [FC.text.text || "Фамилия"]: text }; if (Object.keys(body).length > 0) { try { await sendFC({ - questionId: resultQuestion?.id, + questionId: currentQuestion.id, body: body, - qid: settings.qid, + qid, }); const sessions = JSON.parse(localStorage.getItem("sessions") || "{}"); localStorage.setItem( "sessions", - JSON.stringify({ ...sessions, [settings.qid]: new Date().getTime() }) + JSON.stringify({ ...sessions, [qid]: new Date().getTime() }) ); } catch (e) { enqueueSnackbar("ответ не был засчитан"); } } }; - //@ts-ignore - let FCcopy: any = settings?.cfg.formContact.fields || settings?.cfg.formContact; - let filteredFC: any = {}; - for (let i in FCcopy) { - let field = FCcopy[i]; + const FCcopy: any = settings.cfg.formContact.fields || settings.cfg.formContact; + + const filteredFC: any = {}; + for (const i in FCcopy) { + const field = FCcopy[i]; console.log(filteredFC); if (field.used) { filteredFC[i] = field; } } - let isWide = Object.keys(filteredFC).length > 2; + const isWide = Object.keys(filteredFC).length > 2; - if (!resultQuestion) - return ( - - ); + async function handleShowResultsClick() { + //@ts-ignore + const FC: any = settings.cfg.formContact.fields || settings.cfg.formContact; + if (FC["email"].used !== EMAIL_REGEXP.test(email)) { + return enqueueSnackbar("введена некорректная почта"); + } + + //почта валидна + setFire(true); + + if (fireOnce.current) { + if ( + name.length === 0 + && email.length === 0 + && phone.length === 0 + && text.length === 0 + && adress.length === 0 + ) return enqueueSnackbar("Пожалуйста, заполните поля"); + + try { + await inputHC(); + fireOnce.current = false; + const sessions: any = JSON.parse( + localStorage.getItem("sessions") || "{}" + ); + sessions[qid] = Date.now(); + localStorage.setItem( + "sessions", + JSON.stringify(sessions) + ); + enqueueSnackbar("Данные успешно отправлены"); + } catch (e) { + enqueueSnackbar("повторите попытку позже"); + } + + onShowResult(); + } + + setFire(false); + } return ( - {settings?.cfg.formContact.title || + {settings.cfg.formContact.title || "Заполните форму, чтобы получить результаты теста"} - {settings?.cfg.formContact.desc && ( + {settings.cfg.formContact.desc && ( - {settings?.cfg.formContact.desc} + {settings.cfg.formContact.desc} )} @@ -254,64 +235,13 @@ export const ContactForm = ({ { // resultQuestion && - // settings?.cfg.resultInfo.when === "after" && + // settings.cfg.resultInfo.when === "after" && } @@ -391,7 +321,7 @@ const Inputs = ({ const { settings } = useQuizData(); // @ts-ignore - const FC = settings?.cfg.formContact.fields || settings?.cfg.formContact; + const FC = settings.cfg.formContact.fields || settings.cfg.formContact; if (!FC) return null; diff --git a/src/pages/ViewPublicationPage/Footer.tsx b/src/pages/ViewPublicationPage/Footer.tsx index 5b89510..6706e08 100644 --- a/src/pages/ViewPublicationPage/Footer.tsx +++ b/src/pages/ViewPublicationPage/Footer.tsx @@ -1,228 +1,17 @@ -import { Box, Button, Typography, useTheme } from "@mui/material"; -import { useCallback, useMemo, useState } from "react"; +import { Box, Typography, useTheme } from "@mui/material"; +import { ReactNode } from "react"; -import { enqueueSnackbar } from "notistack"; -import type { AnyTypedQuizQuestion, QuizQuestionBase } from "../../model/questionTypes/shared"; - -import { checkEmptyData } from "./tools/checkEmptyData"; - -import type { QuizQuestionResult } from "@model/questionTypes/result"; -import { useQuizViewStore } from "@stores/quizView/store"; import { useQuizData } from "@utils/hooks/useQuizData"; -import { useRootContainerSize } from "../../contexts/RootContainerWidthContext"; type FooterProps = { - setCurrentQuestion: (step: AnyTypedQuizQuestion) => void; - question: AnyTypedQuizQuestion; - setShowContactForm: (show: boolean) => void; - setShowResultForm: (show: boolean) => void; + stepNumber: number | null; + nextButton: ReactNode; + prevButton: ReactNode; }; -export const Footer = ({ setCurrentQuestion, question, setShowContactForm, setShowResultForm }: FooterProps) => { +export const Footer = ({ stepNumber, nextButton, prevButton }: FooterProps) => { const theme = useTheme(); - - const { settings, questions } = useQuizData(); - const answers = useQuizViewStore(state => state.answers); - - const [stepNumber, setStepNumber] = useState(1); - - const isMobileMini = useRootContainerSize() < 382; - const isLinear = !questions.some(({ content }) => content.rule.parentId === "root"); - - const getNextQuestionId = useCallback(() => { - console.log("Смотрим какой вопрос будет дальше. Что у нас сегодня вкусненького? Щя покажу от какого вопроса мы ищем следующий шаг"); - console.log(question); - console.log("От вот этого /|"); - let readyBeNextQuestion = ""; - - //вопрос обязателен, анализируем ответ и условия ветвления - if (answers.length) { - const answer = answers.find(({ questionId }) => questionId === question.id); - - - (question as QuizQuestionBase).content.rule.main.forEach(({ next, rules }) => { - const longerArray = Math.max( - rules[0].answers.length, - answer?.answer && Array.isArray(answer?.answer) ? answer?.answer.length : [answer?.answer].length - ); - - for ( - let i = 0; - i < longerArray; - i++ // Цикл по всем эле­мен­там бОльшего массива - ) { - if (Array.isArray(answer?.answer)) { - if (answer?.answer.find((item) => String(item === rules[0].answers[i]))) { - readyBeNextQuestion = next; // Ес­ли хоть один эле­мент от­ли­ча­ет­ся, мас­си­вы не рав­ны - } - - return; - } - - if (String(rules[0].answers[i]) === answer?.answer) { - readyBeNextQuestion = next; // Ес­ли хоть один эле­мент от­ли­ча­ет­ся, мас­си­вы не рав­ны - } - } - }); - - if (readyBeNextQuestion) return readyBeNextQuestion; - } - - if (!question.required) {//вопрос не обязателен и не нашли совпадений между ответами и условиями ветвления - console.log("вопрос не обязателен ищем дальше"); - const defaultQ = question.content.rule.default; - if (defaultQ.length > 1 && defaultQ !== " ") return defaultQ; - //Вопросы типа страница, ползунок, своё поле для ввода и дата не могут иметь больше 1 ребёнка. Пользователь не может настроить там дефолт - //Кинуть на ребёнка надо даже если там нет дефолта - if ( - (question?.type === "date" || - question?.type === "text" || - question?.type === "number" || - question?.type === "page") && question.content.rule.children.length === 1 - ) return question.content.rule.children[0]; - - - } - //ничё не нашли, ищем резулт - console.log("ничё не нашли, ищем резулт "); - return questions.find(q => { - console.log('q.type === "result"', q.type === "result"); - console.log('q.content.rule.parentId', q.content.rule.parentId); - console.log('question.content.id', question.content.id); - return q.type === "result" && q.content.rule.parentId === question.content.id; - })?.id; - - }, [answers, questions, question]); - - const isPreviousButtonDisabled = useMemo(() => { - // Логика для аргумента disabled у кнопки "Назад" - if (isLinear) { - const questionIndex = questions.findIndex(({ id }) => id === question.id); - - const previousQuestion = questions[questionIndex - 1]; - - return previousQuestion ? false : true; - } else { - return question?.content.rule.parentId === "root" ? true : false; - } - }, [questions, isLinear, question?.content.rule.parentId, question.id]); - - const isNextButtonDisabled = useMemo(() => { - // Логика для аргумента disabled у кнопки "Далее" - const answer = answers.find(({ questionId }) => questionId === question.id); - - if ("required" in question.content && question.content.required && answer) { - return false; - } - - if ("required" in question.content && question.content.required && !answer) { - return true; - } - - if (isLinear) { - return false; - } - - const nextQuestionId = getNextQuestionId(); - if (nextQuestionId) { - return false; - } else { - const questionId = question.content.rule.default; - const nextQuestion = questions.find(q => q.id === questionId || q.content.id === questionId) || null; - - if (nextQuestion?.type) { - return false; - } - } - }, [answers, getNextQuestionId, isLinear, question.content, question.id]); - - const showResult = (nextQuestion: QuizQuestionResult) => { - if (!nextQuestion) return; - - const isEmpty = checkEmptyData({ resultData: nextQuestion }); - - if (nextQuestion) { - if (nextQuestion && settings?.cfg.resultInfo.showResultForm === "before") { - if (isEmpty) { - setShowContactForm(true); //до+пустая = кидать на ФК - - } else { - setShowResultForm(true); //до+заполнена = показать - - } - } - if (nextQuestion && settings?.cfg.resultInfo.showResultForm === "after") { - if (isEmpty) { - setShowContactForm(true); //после+пустая - - } else { - setShowContactForm(true); //после+заполнена = показать ФК - - } - } - } - }; - - const followPreviousStep = () => { - if (isLinear) { - setStepNumber(q => q - 1); - - const questionIndex = questions.findIndex(({ id }) => id === question.id); - - const previousQuestion = questions[questionIndex - 1]; - - if (previousQuestion) { - setCurrentQuestion(previousQuestion); - } - - return; - } - - if (question?.content.rule.parentId !== "root") { - const questionId = question?.content.rule.parentId; - const parent = questions.find(q => q.id === questionId || q.content.id === questionId) || null; - if (parent?.type) { - setCurrentQuestion(parent); - } else { - enqueueSnackbar("не могу получить предыдущий вопрос"); - } - } else { - enqueueSnackbar("вы находитесь на первом вопросе"); - } - }; - - const followNextStep = () => { - if (isLinear) { - setStepNumber(q => q + 1); - - const questionIndex = questions.findIndex(({ id }) => id === question.id); - const nextQuestion = questions[questionIndex + 1]; - - if (nextQuestion && nextQuestion.type !== "result") { - setCurrentQuestion(nextQuestion); - } else { - //@ts-ignore - showResult(questions.find(q => q.content.rule.parentId === "line")); - } - - return; - } - - const nextQuestionId = getNextQuestionId(); - - if (nextQuestionId) { - const nextQuestion = questions.find(q => q.id === nextQuestionId || q.content.id === nextQuestionId) || null; - - if (nextQuestion?.type && nextQuestion.type === "result") { - showResult(nextQuestion); - } else { - //@ts-ignore - setCurrentQuestion(nextQuestion); - } - } else { - enqueueSnackbar("не могу получить последующий вопрос"); - } - }; + const { questions } = useQuizData(); return ( */} {/*)}*/} - {isLinear && + {stepNumber !== null && */} - - + {prevButton} + {nextButton} ); diff --git a/src/pages/ViewPublicationPage/Question.tsx b/src/pages/ViewPublicationPage/Question.tsx index 2d42501..9d73360 100644 --- a/src/pages/ViewPublicationPage/Question.tsx +++ b/src/pages/ViewPublicationPage/Question.tsx @@ -1,9 +1,6 @@ import { Box, useTheme } from "@mui/material"; -import { useEffect, useState } from "react"; -import { ContactForm } from "./ContactForm"; import { Footer } from "./Footer"; -import { ResultForm } from "./ResultForm"; import { Date } from "./questions/Date"; import { Emoji } from "./questions/Emoji"; import { File } from "./questions/File"; @@ -16,108 +13,67 @@ import { Text } from "./questions/Text"; import { Variant } from "./questions/Variant"; import { Varimg } from "./questions/Varimg"; -import type { AnyTypedQuizQuestion } from "../../model/questionTypes/shared"; +import type { RealTypedQuizQuestion } from "../../model/questionTypes/shared"; import { NameplateLogoFQ } from "@icons/NameplateLogoFQ"; import { NameplateLogoFQDark } from "@icons/NameplateLogoFQDark"; -import { QuizQuestionResult } from "@model/questionTypes/result"; import { useQuizData } from "@utils/hooks/useQuizData"; import { notReachable } from "@utils/notReachable"; import { quizThemes } from "@utils/themes/Publication/themePublication"; +import { ReactNode } from "react"; import { useRootContainerSize } from "../../contexts/RootContainerWidthContext"; -export const Question = () => { +type Props = { + currentQuestion: RealTypedQuizQuestion; + currentQuestionStepNumber: number | null; + nextButton: ReactNode; + prevButton: ReactNode; +}; + +export const Question = ({ + currentQuestion, + currentQuestionStepNumber, + nextButton, + prevButton, +}: Props) => { const theme = useTheme(); - const { settings, questions } = useQuizData(); - const [currentQuestion, setCurrentQuestion] = useState(); - const [showContactForm, setShowContactForm] = useState(false); - const [showResultForm, setShowResultForm] = useState(false); + const { settings } = useQuizData(); const isMobile = useRootContainerSize() < 650; - useEffect(() => { - if (settings?.cfg.haveRoot) {//ветвимся - const questionId = settings?.cfg.haveRoot || ""; - const nextQuestion = questions.find(q => q.id === questionId || q.content.id === questionId) || null; - - if (nextQuestion?.type) { - setCurrentQuestion(nextQuestion); - return; - } - - } else {//идём прямо - setCurrentQuestion(questions[0]); - } - }, []); - - if (!currentQuestion || currentQuestion.type === "result") return "не смог отобразить вопрос"; - return ( - - {!showContactForm && !showResultForm && ( - - - {quizThemes[settings.cfg.theme].isLight ? ( - - ) : ( - - )} - - )} - {showResultForm && settings?.cfg.resultInfo.showResultForm === "before" && ( - - )} - {showContactForm && ( - - )} - {showResultForm && settings?.cfg.resultInfo.showResultForm === "after" && ( - - )} - {!showContactForm && !showResultForm && ( -