genericsuite
Version:
The GenericSuite for ReactJS (frontend version)
963 lines (905 loc) • 911 kB
JavaScript
import React, { useContext, createContext, useReducer, useCallback, useEffect, useMemo, useState, useRef } from 'react';
import ReactMarkdown from 'react-markdown';
import { createBrowserHistory } from 'history';
import { Link, Routes, Route, HashRouter, RouterProvider, createBrowserRouter, Navigate } from 'react-router-dom';
import { Buffer } from 'buffer';
import { BehaviorSubject } from 'rxjs';
import axios, { AxiosError } from 'axios';
import { ObjectId } from 'bson';
import { md5 } from 'js-md5';
import { useFormikContext, Formik, Form, Field, ErrorMessage } from 'formik';
import * as Yup from 'yup';
import { useCombobox } from 'downshift';
const defaultTheme = {
light: {
primary: 'bg-blue-600 defaultThemeLightPrimary',
secondary: 'bg-gray-200 defaultThemeLightSecondary',
text: 'text-gray-800 defaultThemeLightText',
label: 'text-gray-700 defaultThemeLightLabel',
input: 'text-gray-800 defaultThemeLightInput',
textHoverTop: 'hover:bg-blue-400 defaultThemeLightTextHoverTop',
textHoverTopSubMenu: 'hover:bg-gray-200 defaultThemeLightTextHoverTopSubMenu',
textHoverSide: 'hover:bg-gray-300 defaultThemeLightTextHoverSide',
background: 'bg-gray-100 defaultThemeLightBackground',
contentBg: 'bg-gray-300 defaultThemeLightContentBg'
},
dark: {
primary: 'bg-blue-800 defaultThemeDarkPrimary',
secondary: 'bg-gray-700 defaultThemeDarkSecondary',
text: 'text-gray-200 defaultThemeDarkText',
label: 'text-white defaultThemeDarkLabel',
input: 'text-black defaultThemeDarkInput',
textHoverTop: 'hover:bg-blue-400 defaultThemeDarkTextHoverTop',
textHoverTopSubMenu: 'hover:bg-gray-200 defaultThemeDarkTextHoverTopSubMenu',
textHoverSide: 'hover:bg-gray-400 defaultThemeDarkTextHoverSide',
background: 'bg-gray-900 defaultThemeDarkBackground',
contentBg: 'bg-slate-500 defaultThemeDarkContentBg'
}
};
// Navlib
const MAIN_CONTAINER_FOR_TOP_MENU_CLASS = "flex flex-col min-h-screen mainContainerForTopMenuClass";
const MAIN_CONTAINER_FOR_SIDE_MENU_CLASS = "flex min-h-screen mainContainerForSideMenuClass";
const APP_SECTION_CONTAINER_FOR_TOP_MENU_CLASS = "grow appSectionContainerForTopMenuClass";
const APP_SECTION_CONTAINER_FOR_SIDE_MENU_CLASS = "grow flex flex-col appSectionContainerForSideMenuClass";
const APP_SECTION_CONTAINER_FOR_SIDE_MENU_MAIN_CLASS = "grow appSectionContainerForSideMenuMainClass";
const APP_FOOTER_CONTAINER_CLASS = "p-1 text-white text-center appFooterContainerClass";
const CENTERED_BOX_CONTAINER_DIV_1_CLASS = "z-50 overflow-auto centeredBoxContainerDiv1Class";
const CENTERED_BOX_CONTAINER_DIV_2_CLASS = "1-relative w-fit max-w-md m-auto flex-col flex rounded-lg centeredBoxContainerDiv2Class";
const CENTERED_BOX_CONTAINER_DIV_3_CLASS = "flex flex-col items-center pt-1 pb-4 p-6 centeredBoxContainerDiv3Class";
const NAVBAR_HEADER_FOR_TOP_MENU_CLASS = "flex items-center justify-between p-1 text-white navbarHeaderForTopMenuClass";
const NAVBAR_HEADER_FOR_SIDE_MENU_CLASS = "top-0 left-0 w-64 p-2 overflow-y-auto transition-transform duration-300 ease-in-out 1-md:translate-x-0 lg:translate-x-0 z-20 navbarHeaderForSideMenuClass";
const NAVBAR_HEADER_FOR_SIDE_MENU_MOBILE_OPEN_CLASS = 'translate-x-0 navbarHeaderForSideMenuMobileOpenClass';
const NAVBAR_HEADER_FOR_SIDE_MENU_MOBILE_CLOSE_CLASS = 'navbarHeaderForSideMenuMobileCloseClass';
const NAVBAR_TOP_FOR_SIDE_MENU_CLASS = "flex items-center justify-between p-1 text-white navbarTopForSideMenuClass";
const NAVBAR_BRAND_ELEMENTS_FOR_TOP_MENU_CLASS = "flex items-center space-x-2 navbarBrandElementsForTopMenuClass";
const NAVBAR_BRAND_ELEMENTS_FOR_SIDE_MENU_CLASS = "flex justify-between items-center mb-4 navbarBrandElementsForSideMenuClass";
const NAVBAR_BRAND_NAME_CLASS = "text-2xl ml-2 font-bold navbarBrandNameClass";
const NAVBAR_BRAND_APP_VERSION_CLASS = "text-xs navbarBrandAppVersionClass";
const NAVBAR_BRAND_APP_LOGO_CLASS = "mx-auto my-0 navbarBrandAppLogoClass";
const NAVBAR_TOP_CENTER_MENU_ON_TOP_CLASS = "flex space-x-4 navbarTopCenterMenuOnTopClass";
const NAVBAR_TOP_CENTER_MENU_ON_LEFT_CLASS = 'space-y-2 navbarTopCenterMenuOnLeftClass';
const NAVBAR_TOP_RIGHT_MENU_FOR_TOP_MENU_CLASS = "flex items-center space-x-4 navbarTopRightMenuForTopMenuClass";
const NAVBAR_TOP_RIGHT_MENU_FOR_SIDE_MENU_CLASS = "flex items-center space-x-4 ml-auto navbarTopRightMenuForSideMenuClass";
const NAVBAR_TOP_RIGHT_MENU_UNAUTHENTICATED_MARGIN_RIGHT_CLASS = "mr-2 navbarTopRightMenuUnauthenticatedMarginRightClass";
const NAVBAR_MOBILE_MENU_DIV_1_CLASS = "fixed inset-0 bg-black bg-opacity-50 z-50 navbarMobileMenuDiv1Class";
const NAVBAR_MOBILE_MENU_DIV_2_CLASS = "fixed inset-y-0 left-0 w-64 p-4 overflow-y-auto navbarMobileMenuDiv2Class";
const NAVBAR_MOBILE_MENU_DIV_3_CLASS = "flex justify-between items-center mb-4 navbarMobileMenuDiv3Class";
const NAVBAR_MOBILE_MENU_H2_CLASS = "text-xl font-bold navbarMobileMenuH2Class";
const NAVBAR_MOBILE_CLOSE_BUTTON_CLASS = "p-2 rounded-full hover:bg-opacity-80 navbarMobileCloseButtonClass";
const NAVBAR_MOBILE_CLOSE_BUTTON_ICON_CLASS = "h-6 w-6 navbarMobileCloseButtonIconClass";
const NAVBAR_MOBILE_NAV_CLASS = "flex flex-col space-y-2 navbarMobileNavClass";
const NAVBAR_TOGGLE_BUTTON_CLASS = "1-md:hidden 1-lg:hidden p-2 rounded-full hover:bg-opacity-80 navbarToggleButtonClass";
const NAVBAR_TOGGLE_IMAGE_CLASS = "h-6 w-6 navbarToggleImageClass";
const NAVBAR_TEXT_CLASS = 'flex items-center navbarTextClass';
const NAV_LINK_TOP_DIV_TOP_MENU_CLASS = "relative group navLinkTopDivTopMenuClass";
const NAV_LINK_TOP_DIV_HAMBURGER_CLASS = "block relative group navLinkTopDivHamburgerClass";
const NAV_LINK_TOP_DIV_SIDE_MENU_CLASS = "navLinkTopDivSideMenuClass";
const NAV_LINK_TOP_DIV_MOBILE_MENU_CLASS = "1-flex 1-flex-col 1-space-y-2 navLinkTopDivMobileMenuClass";
const NAV_LINK_BUTTON_TOP_MENU_CLASS = "rounded-sm p-1 flex items-center navLinkButtonsTopMenuClass";
const NAV_LINK_BUTTON_HAMBURGER_CLASS = "block py-1 navLinkButtonsHamburgerClass";
const NAV_LINK_BUTTON_SIDE_MENU_CLASS = "py-2 px-2 rounded-sm navLinkButtonsSideMenuClass";
const NAV_LINK_BUTTON_MOBILE_MENU_CLASS = "1-w-full 1-text-left 1-flex 1-justify-between 1-items-center py-2 px-2 rounded-sm navLinkButtonsMobileMenuClass";
const NAV_LINK_ICON_CLASS = "w-8 h-8 navLinkIconClass";
const ROUNDED_ICON_CLASS = "rounded-full roundedIconClass";
const ML2_ICON_CLASS = "ml-2 overflow-visible";
const STROKE_WHITE_ICON_CLASS = "stroke-white";
const VERTICAL_SLIDER_ICON_CLASS = "h-8 w-1.5 rounded-full bg-slate-400";
const NAV_DROPDOWN_TOP_DIV_TOP_MENU_CLASS = "relative group navDropdownTopDivTopMenuClass";
const NAV_DROPDOWN_TOP_DIV_HAMBURGER_CLASS = "block relative group navDropdownTopDivHamburgerClass";
const NAV_DROPDOWN_TOP_DIV_SIDE_MENU_CLASS = "1-space-x-4 navDropdownTopDivSideMenuClass";
const NAV_DROPDOWN_TOP_DIV_MOBILE_MENU_CLASS = "1-space-y-2 navDropdownTopDivMobileMenuClass";
const NAV_DROPDOWN_INNER_DIV_TOP_MENU_CLASS = "absolute hidden z-50 bg-white text-gray-800 p-2 rounded-sm shadow-lg navDropdownInnerDivTopMenuClass";
const NAV_DROPDOWN_INNER_DIV_HAMBURGER_CLASS = "absolute right-0 hidden z-50 1-group-hover:block bg-white text-gray-800 p-2 rounded-sm shadow-lg navDropdownInnerDivHamburgerClass";
const NAV_DROPDOWN_INNER_DIV_SIDE_MENU_CLASS = "ml-2 space-y-2 navDropdownInnerDivSideMenuClass";
const NAV_DROPDOWN_INNER_DIV_MOBILE_MENU_CLASS = "ml-2 space-y-2 navDropdownInnerDivMobileMenuClass";
const NAV_DROPDOWN_BUTTON_TOP_MENU_CLASS = "rounded-sm p-1 flex items-center navDropdownButtonTopMenuClass";
const NAV_DROPDOWN_BUTTON_HAMBURGER_CLASS = "rounded-sm p-2 block py-1 flex items-center navDropdownButtonHamburgerClass";
const NAV_DROPDOWN_BUTTON_SIDE_MENU_CLASS = "1-w-full text-left flex justify-between items-center py-2 px-2 rounded-sm navDropdownButtonSideMenuClass";
const NAV_DROPDOWN_BUTTON_MOBILE_MENU_CLASS = "1-w-full text-left flex justify-between items-center py-2 px-2 rounded-sm navDropdownButtonMobileMenuClass";
const NAV_DROPDOWN_IMAGE_TOP_MENU_CLASS = "navDropdownImageTopMenuClass";
const NAV_DROPDOWN_IMAGE_HAMBURGER_CLASS = "navDropdownImageHamburgerClass";
const NAV_DROPDOWN_IMAGE_SIDE_MENU_CLASS = "navDropdownImageSideMenuClass";
const NAV_DROPDOWN_IMAGE_MOBILE_MENU_CLASS = "h-4 w-4 transform transition-transform navDropdownImageMobileMenuClass";
const NAV_DROPDOWN_ITEM_TOP_DIV_TOP_MENU_CLASS = "block py-1 navDropdownItemTopDivTopMenuClass";
const NAV_DROPDOWN_ITEM_TOP_DIV_HAMBURGER_CLASS = "block py-1 navDropdownItemTopDivHamburgerClass";
const NAV_DROPDOWN_ITEM_TOP_DIV_SIDE_MENU_CLASS = "block rounded-sm navDropdownItemTopDivSideMenuClass";
const NAV_DROPDOWN_ITEM_TOP_DIV_MOBILE_MENU_CLASS = "block rounded-sm navDropdownItemTopDivMobileMenuClass";
const NAV_DROPDOWN_ITEM_BUTTON_TOP_MENU_CLASS = "rounded-sm px-2 flex items-center navDropDownItemButtonsTopMenuClass";
const NAV_DROPDOWN_ITEM_BUTTON_HAMBURGER_CLASS = "rounded-sm block px-2 navDropDownItemButtonsHamburgerClass";
const NAV_DROPDOWN_ITEM_BUTTON_SIDE_MENU_CLASS = "rounded-sm px-2 py-2 navDropDownItemButtonsSideMenuClass";
const NAV_DROPDOWN_ITEM_BUTTON_MOBILE_MENU_CLASS = "1-w-full 1-text-left 1-flex 1-justify-between 1-items-center rounded-sm py-2 px-2 navDropDownItemButtonsMobileMenuClass";
// Alert messages and message boxes
const ALERT_BASE_CLASS = "1-relative p-3 border border-transparent rounded-sm alertBaseClass";
const ALERT_DANGER_CLASS = "".concat(ALERT_BASE_CLASS, " text-red-800 bg-red-100 border-red-200 alertDangerClass");
const ALERT_WARNING_CLASS = "".concat(ALERT_BASE_CLASS, " text-yellow-800 bg-yellow-100 border-yellow-200 alertWarningClass");
const ALERT_INFO_CLASS = "".concat(ALERT_BASE_CLASS, " text-cyan-800 bg-cyan-100 border-cyan-200 alertInfoClass");
const ALERT_SUCCESS_CLASS = "".concat(ALERT_BASE_CLASS, " text-green-800 bg-green-100 border-green-200 alertSuccessClass");
const ERROR_MSG_CLASS = "".concat(ALERT_DANGER_CLASS, " mt-4 p-2 rounded-md errorMsgClass");
const WARNING_MSG_CLASS = "".concat(ALERT_WARNING_CLASS, " mt-4 p-2 rounded-md warningMsgClass");
const INFO_MSG_CLASS = "".concat(ALERT_INFO_CLASS, " mt-4 mb-4 p-2 rounded-md flex justify-between align-middle infoMsgClass");
const INFO_MSG_BUTTON_CLASS = "rounded-full p-1 bg-gray-100 hover:bg-gray-200 transition-colors duration-200 text-gray-600 hover:text-gray-800 infoMsgButtonClass";
const SUCCESS_MSG_CLASS = "".concat(ALERT_SUCCESS_CLASS, " mt-4 p-2 rounded-md successMsgClass");
const GRAY_BOX_MSG_CLASS = "".concat(ALERT_BASE_CLASS, " text-black bg-gray-200 mt-4 p-2 rounded-md grayBoxMsgClass");
// Forms
const FORM_GROUP_CLASS = "mb-4 formGroupClass";
const FORM_CONTROL_CLASS = "w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-hidden focus:ring-2 focus:ring-blue-500 bg-white formControlClass";
const INVALID_FEEDBACK_CLASS = "text-red-800 text-sm mt-1 invalidFeedbackClass";
const IS_INVALID_CLASS = "border-red-500 isInvalidClass";
const DISABLE_FIELD_BACKGROUND_COLOR_CLASS = 'bg-gray-200 disableFieldBackgroundColorClass';
// Other general classes
const HIDDEN_CLASS = 'hidden hiddenClass';
const VISIBLE_CLASS = 'visible visibleClass';
const INLINE_CLASS = 'inline inlineClass';
const HORIZONTALLY_CENTERED_CLASS = "flex flex-col items-center horizontallyCenteredClass";
const VERTICALLY_CENTERED_CLASS = "flex items-center justify-center verticallyCenteredClass";
const TOP0_Z50_CLASS = "top-0 z-50 top0z50Class";
// Buttons
const BUTTON_PRIMARY_CLASS = "bg-blue-500 text-white font-medium py-2 px-4 rounded-xl hover:bg-blue-600 focus:outline-hidden focus:ring-2 focus:ring-blue-500 buttonPrimaryClass";
const BUTTON_SECONDARY_CLASS = "bg-gray-200 text-gray-700 font-medium py-2 px-4 rounded-xl hover:bg-gray-400 focus:outline-hidden focus:ring-2 focus:ring-gray-500 buttonSecondaryClass";
// Special buttons
const BUTTON_COMPOSED_LABEL_CLASS = "flex items-center buttonComposedLabelClass";
const MENU_MODE_BUTTON_TOP_DIV_CLASS = "mt-1 menuModeButtonTopDivClass";
const DARK_MODE_BUTTON_TOP_DIV_CLASS = "mt-1 darkModeButtonTopDivClass";
const DARK_MODE_BUTTON_SVG_CLASS = "w-6 h-6 darkModeButtonSvgClass";
const DARK_MODE_BUTTON_DARK_HIDDEN_CLASS = "dark:hidden darkModeButtonDarkHiddenClass";
const DARK_MODE_BUTTON_DARK_INLINE_CLASS = "hidden dark:inline darkModeButtonDarkInlineClass";
// Generic CRUD editor (GCE_RFC) - BEGIN
// Listing page buttons (GCE_RFC)
const BUTTON_LISTING_CLASS = "bg-blue-500 text-white p-2 rounded-xl text-sm buttonListingClass";
const BUTTON_LISTING_DISABLED_CLASS = "".concat(BUTTON_LISTING_CLASS, " opacity-50 buttonListingDisabledClass");
const BUTTON_LISTING_NEW_CLASS = "".concat(BUTTON_LISTING_CLASS, " buttonListingNewClass");
const BUTTON_LISTING_REFRESH_CLASS = "".concat(BUTTON_LISTING_CLASS, " text-xs buttonListingRefreshClass");
// General app section (GCE_RFC)
const APP_GENERAL_MARGINS_CLASS = 'mt-2 mb-2 ml-2 mr-2 p-2 rounded-lg appGeneralMarginsClass';
const APP_TOP_DIV_CLASS = "".concat(APP_GENERAL_MARGINS_CLASS, " rounded-lg appTopDivClass");
const APP_LEVEL2_DIV_CLASS = "overflow-x-auto appLevel2DivClass";
const APP_TITLE_H1_CLASS = 'text-xl font-bold mb-4 appTitleH1Class';
const APP_TITLE_RECYCLE_BUTTON_CLASS = "pl-2 align-bottom appTitleRecycleButtonClass";
const APP_SIDE_MENU_BG_COLOR_CLASS = "bg-white dark:bg-gray-800 appSideMenuBgColorClass";
// Listing page (GCE_RFC)
const APP_LISTING_TABLE_CLASS = "w-full text-sm appListingTableClass";
const APP_LISTING_TABLE_HDR_THEAD_CLASS = "bg-white dark:bg-black appListingTableHdrTheadClass";
const APP_LISTING_TABLE_HDR_TR_CLASS = "appListingTableHdrTrClass";
const APP_LISTING_TABLE_HDR_TH_CLASS = "text-left p-2 appListingTableHdrThClass";
const APP_LISTING_TABLE_HRD_ACTIONS_COL_CLASS = 'appListingTableHrdActionsColClass';
const APP_LISTING_TABLE_BODY_TBODY_CLASS = "appListingTableBodyTbodyClass";
const APP_LISTING_TABLE_BODY_TR_ODD_CLASS = 'hover:bg-opacity-80 appListingTableBodyTrOddClass';
const APP_LISTING_TABLE_BODY_TR_EVEN_CLASS = 'hover:bg-opacity-80 appListingTableBodyTrEvenClass';
const APP_LISTING_TABLE_BODY_TR_ACTIONS_ODD_CLASS = 'appListingTableBodyTrActionsOddClass';
const APP_LISTING_TABLE_BODY_TR_ACTIONS_EVEN_CLASS = 'appListingTableBodyTrActionsEvenClass';
const APP_LISTING_TABLE_BODY_TD_BASE_ODD_CLASS = "p-2 appListingTableBodyTdBaseOddClass";
const APP_LISTING_TABLE_BODY_TD_BASE_EVEN_CLASS = "p-2 appListingTableBodyTdBaseEvenClass";
const APP_LISTING_TABLE_BODY_TD_ODD_CLASS = "".concat(APP_LISTING_TABLE_BODY_TD_BASE_ODD_CLASS, " break-words appListingTableBodyTdOddClass");
const APP_LISTING_TABLE_BODY_TD_EVEN_CLASS = "".concat(APP_LISTING_TABLE_BODY_TD_BASE_EVEN_CLASS, " break-words appListingTableBodyTdEvenClass");
const APP_LISTING_TABLE_BODY_TD_ACTIONS_ODD_CLASS = "".concat(APP_LISTING_TABLE_BODY_TD_BASE_ODD_CLASS, " bg-opacity-80 whitespace-nowrap text-sm space-x-2 appListingTableBodyTdActionsOddClass");
const APP_LISTING_TABLE_BODY_TD_ACTIONS_EVEN_CLASS = "".concat(APP_LISTING_TABLE_BODY_TD_BASE_EVEN_CLASS, " bg-opacity-80 whitespace-nowrap text-sm space-x-2 appListingTableBodyTdActionsEvenClass");
// Listing page search box (GCE_RFC)
const APP_LISTING_SEARCH_BOX_TOP_DIV_CLASS = "flex items-center space-x-2 appListingSearchBoxTopDivClass";
const APP_LISTING_SEARCH_BOX_LABEL_CLASS = "mr-2 text-sm appListingSearchBoxLabelClass";
const APP_LISTING_SEARCH_BOX_INPUT_CLASS = "p-2 rounded-xl border border-gray-300 bg-white w-40 text-sm appListingSearchBoxInputClass";
const APP_LISTING_SEARCH_BOX_SUBMIT_BUTTON_CLASS = "".concat(BUTTON_LISTING_CLASS, " ml-2 mr-2 text-xs appListingSearchBoxSubmitButtonClass");
const APP_LISTING_SEARCH_BOX_STOP_BUTTON_CLASS = "".concat(BUTTON_LISTING_CLASS, " mr-2 text-xs appListingSearchBoxStopButtonClass");
const SEARCH_ENGINE_BUTTON_TOP_DIV_CLASS = 'ml-2 searchEngineButtonTopDivClass';
// Listing page bottom toolbar (next and previous page, lines per page, search) (GCE_RFC)
const APP_LISTING_TOOLBAR_TOP_DIV_CLASS = "flex items-center mt-4 space-x-4 1-sm:space-y-0 appListingToolbarTopDivClass";
const APP_LISTING_TOOLBAR_TOP_DIV_WIDE_CLASS = "flex-row appListingToolbarTopDivWideClass";
const APP_LISTING_TOOLBAR_TOP_DIV_NOT_WIDE_CLASS = "flex-col appListingToolbarTopDivNotWideClass";
const APP_LISTING_TOOLBAR_PAGINATION_SECTION_CLASS = "text-sm flex items-center space-x-2 appListingToolbarPaginationSectionClass";
const APP_LISTING_TOOLBAR_PAGE_NUM_SECTION_CLASS = "text-sm flex items-center appListingToolbarPageNumSectionClass";
const APP_LISTING_TOOLBAR_ROW_PER_PAGE_SECTION_CLASS = "text-sm flex items-center appListingToolbarRowPerPageSectionClass";
const APP_LISTING_TOOLBAR_ROW_PER_PAGE_LABEL_CLASS = "mr-2 text-sm appListingToolbarRowPerPageLabelClass";
const APP_LISTING_TOOLBAR_ROW_PER_PAGE_INPUT_CLASS = "p-2 rounded-xl border border-gray-300 bg-white appListingToolbarRowPerPageInputClass";
const APP_LISTING_TOOLBAR_WAIT_ANIMATION_CLASS = "ml-3 mr-3 hidden appListingToolbarWaitAnimationClass";
// Data page (GCE_RFC)
const APP_FORMPAGE_LABEL_CLASS = "font-medium appFormPageLabelClass";
const APP_FORMPAGE_LABEL_REQUIRED_CLASS = "font-medium text-red-700 appFormPageLabelRequiredClass";
const APP_FORMPAGE_FORM_BUTTON_BAR_CLASS = "flex align-middle space-x-4 appFormPageFormButtonBarClass";
const APP_FORMPAGE_FIELD_CLASS = "flex flex-col ".concat(FORM_GROUP_CLASS, " appFormPageFieldClass");
const APP_FORMPAGE_FIELD_BASE_CLASS = "".concat(FORM_CONTROL_CLASS, " border border-gray-300 p-2 rounded-md focus:outline-hidden focus:ring-2 focus:ring-blue-500 appFormPageFieldBaseClass");
const APP_FORMPAGE_FIELD_GOOD_CLASS = "".concat(APP_FORMPAGE_FIELD_BASE_CLASS, " appFormPageFieldGoodClass");
const APP_FORMPAGE_FIELD_INVALID_CLASS = "".concat(APP_FORMPAGE_FIELD_BASE_CLASS, " is-invalid appFormPageFieldInvalidClass");
const APP_FORMPAGE_SPECIAL_BUTTON_DIV_CLASS = "align-middle flex appFormPageSpecialButtonDivClass";
const APP_FORMPAGE_CHILD_COMPONENTS_TOP_DIV_CLASS = "mt-6 appFormPageChildComponentsTopDivClass";
// Generic CRUD editor (GCE_RFC) - END
// Pop-ups
const POPUP_TOP_MARGIN_CLASS = "pt-4 popupTopMarginClass";
// ModalLib
const MODALIB_MODAL_DIV_1_CLASS = "z-50 fixed inset-0 1-bg-black 1-bg-opacity-50 flex items-center justify-center p-4 modalibModalDiv1Class";
const MODALIB_MODAL_DIV_2_CLASS = "rounded-lg shadow-xl w-full max-w-md modalibModalDiv2Class";
const MODALIB_MODAL_DIV_3_CLASS = "p-6 modalibModalDiv3Class";
const MODALIB_MODAL_ICON_1_CLASS = "flex justify-center mb-4 modalibModalIcon1Class";
const MODALIB_MODAL_ICON_2_CLASS = "rounded-full p-2 modalibModalIcon2Class";
const MODALIB_MODAL_ICON_3_CLASS = "w-6 h-6 modalibModalIcon3Class";
const MODALIB_MODAL_HEADER_CLASS = "modalibModalHeaderClass";
const MODALIB_MODAL_TITLE_CLASS = "text-xl font-semibold text-center mb-2 modalibModalTitleClass";
const MODALIB_MODAL_BODY_CLASS = "text-center mb-6 max-h-80 overflow-auto modalibModalBodyClass";
const MODALIB_MODAL_FOOTER_CLASS = "flex mt-4 modalibModalFooterClass";
const MODALIB_MODAL_FOOTER_WIDE_CLASS = "flex-row space-x-4 modalibModalFooterWideClass";
const MODALIB_MODAL_FOOTER_NOT_WIDE_CLASS = "flex-col-reverse space-y-4 space-y-reverse modalibModalFooterNotWideClass";
const MODALIB_BUTTON_BASESTYLE_CLASS = 'px-4 py-2 border rounded-xl text-sm font-medium focus:outline-hidden focus:ring-2 focus:ring-offset-2 modalibButtonBaseStyleClass';
const MODALIB_BUTTON_BASESTYLE_WIDE_CLASS = 'flex-1 modalibButtonBaseStyleWideClass';
const MODALIB_BUTTON_BASESTYLE_NOT_WIDE_CLASS = 'w-full flex justify-center modalibButtonBaseStyleNotWideClass';
const MODALIB_BUTTON_PRIMARY_CLASS = "".concat(BUTTON_PRIMARY_CLASS, " modalibButtonPrimaryClass");
const MODALIB_BUTTON_SECONDARY_CLASS = "".concat(BUTTON_SECONDARY_CLASS, " modalibButtonSecondaryClass");
const MODALIB_BUTTON_SUCCESS_CLASS = 'bg-green-500 hover:bg-green-600 text-white focus:ring-green-400 modalibButtonSuccessClass';
const MODALIB_BUTTON_DANGER_CLASS = 'bg-red-500 hover:bg-red-600 text-white focus:ring-red-400 modalibButtonDangerClass';
// Login page
const LOGIN_PAGE_APP_LOGO_CLASS = "pb-4 mx-auto my-0 loginPageAppLogoClass";
const LOGIN_PAGE_EXTRA_PT = "pt-6 loginPageExtraPtClass";
// Login button
const LOGIN_BUTTON_IN_APP_COMPONENT_CLASS = "".concat(HORIZONTALLY_CENTERED_CLASS, " p-4 loginButtonInAppComponentClass");
// Components
const SUGGESTION_DROPDOWN_CLASS = "align-middle flex";
const SUGGESTION_DROPDOWN_WRAPPER_CLASS = "flex flex-col suggestionDropdownWrapperClass";
// Wait animation
const WAIT_ANIMATION_CLASS = "flex items-center justify-center waitAnimationClass";
const WAIT_ANIMATION_MARGIN_TOP_CLASS = "mt-3 waitAnimationWithMarginClass";
const WAIT_ANIMATION_ENABLED_CLASS = "ml-3 mr-3 waitAnimationEnabledClass";
const WAIT_ANIMATION_DISABLED_CLASS = "ml-3 mr-3 hidden waitAnimationDisabledClass";
// Markdown formatting (check renderMarkdownContent())
const MARKDOWN_P_CLASS = "my-2 markdown-p-class";
const MARKDOWN_BOLD_CLASS = "font-bold markdown-bold-class";
const MARKDOWN_ITALIC_CLASS = "italic markdown-italic-class";
const MARKDOWN_UNDERLINE_CLASS = "underline markdown-underline-class";
// AI Assistant and conversation pages
// Flexible input type text that grows according to its content (e.g. for the AI Assistant conversation)
const INPUT_FLEXIBLE_CLASS = "pl-1 pb-1 pt-1 pr-1 block w-full border border-gray-400 focus:outline-hidden focus:ring-2 focus:ring-blue-500 rounded-md resize-none overflow-hidden inputFlexibleClass";
var class_name_constants = /*#__PURE__*/Object.freeze({
__proto__: null,
ALERT_BASE_CLASS: ALERT_BASE_CLASS,
ALERT_DANGER_CLASS: ALERT_DANGER_CLASS,
ALERT_INFO_CLASS: ALERT_INFO_CLASS,
ALERT_SUCCESS_CLASS: ALERT_SUCCESS_CLASS,
ALERT_WARNING_CLASS: ALERT_WARNING_CLASS,
APP_FOOTER_CONTAINER_CLASS: APP_FOOTER_CONTAINER_CLASS,
APP_FORMPAGE_CHILD_COMPONENTS_TOP_DIV_CLASS: APP_FORMPAGE_CHILD_COMPONENTS_TOP_DIV_CLASS,
APP_FORMPAGE_FIELD_BASE_CLASS: APP_FORMPAGE_FIELD_BASE_CLASS,
APP_FORMPAGE_FIELD_CLASS: APP_FORMPAGE_FIELD_CLASS,
APP_FORMPAGE_FIELD_GOOD_CLASS: APP_FORMPAGE_FIELD_GOOD_CLASS,
APP_FORMPAGE_FIELD_INVALID_CLASS: APP_FORMPAGE_FIELD_INVALID_CLASS,
APP_FORMPAGE_FORM_BUTTON_BAR_CLASS: APP_FORMPAGE_FORM_BUTTON_BAR_CLASS,
APP_FORMPAGE_LABEL_CLASS: APP_FORMPAGE_LABEL_CLASS,
APP_FORMPAGE_LABEL_REQUIRED_CLASS: APP_FORMPAGE_LABEL_REQUIRED_CLASS,
APP_FORMPAGE_SPECIAL_BUTTON_DIV_CLASS: APP_FORMPAGE_SPECIAL_BUTTON_DIV_CLASS,
APP_GENERAL_MARGINS_CLASS: APP_GENERAL_MARGINS_CLASS,
APP_LEVEL2_DIV_CLASS: APP_LEVEL2_DIV_CLASS,
APP_LISTING_SEARCH_BOX_INPUT_CLASS: APP_LISTING_SEARCH_BOX_INPUT_CLASS,
APP_LISTING_SEARCH_BOX_LABEL_CLASS: APP_LISTING_SEARCH_BOX_LABEL_CLASS,
APP_LISTING_SEARCH_BOX_STOP_BUTTON_CLASS: APP_LISTING_SEARCH_BOX_STOP_BUTTON_CLASS,
APP_LISTING_SEARCH_BOX_SUBMIT_BUTTON_CLASS: APP_LISTING_SEARCH_BOX_SUBMIT_BUTTON_CLASS,
APP_LISTING_SEARCH_BOX_TOP_DIV_CLASS: APP_LISTING_SEARCH_BOX_TOP_DIV_CLASS,
APP_LISTING_TABLE_BODY_TBODY_CLASS: APP_LISTING_TABLE_BODY_TBODY_CLASS,
APP_LISTING_TABLE_BODY_TD_ACTIONS_EVEN_CLASS: APP_LISTING_TABLE_BODY_TD_ACTIONS_EVEN_CLASS,
APP_LISTING_TABLE_BODY_TD_ACTIONS_ODD_CLASS: APP_LISTING_TABLE_BODY_TD_ACTIONS_ODD_CLASS,
APP_LISTING_TABLE_BODY_TD_BASE_EVEN_CLASS: APP_LISTING_TABLE_BODY_TD_BASE_EVEN_CLASS,
APP_LISTING_TABLE_BODY_TD_BASE_ODD_CLASS: APP_LISTING_TABLE_BODY_TD_BASE_ODD_CLASS,
APP_LISTING_TABLE_BODY_TD_EVEN_CLASS: APP_LISTING_TABLE_BODY_TD_EVEN_CLASS,
APP_LISTING_TABLE_BODY_TD_ODD_CLASS: APP_LISTING_TABLE_BODY_TD_ODD_CLASS,
APP_LISTING_TABLE_BODY_TR_ACTIONS_EVEN_CLASS: APP_LISTING_TABLE_BODY_TR_ACTIONS_EVEN_CLASS,
APP_LISTING_TABLE_BODY_TR_ACTIONS_ODD_CLASS: APP_LISTING_TABLE_BODY_TR_ACTIONS_ODD_CLASS,
APP_LISTING_TABLE_BODY_TR_EVEN_CLASS: APP_LISTING_TABLE_BODY_TR_EVEN_CLASS,
APP_LISTING_TABLE_BODY_TR_ODD_CLASS: APP_LISTING_TABLE_BODY_TR_ODD_CLASS,
APP_LISTING_TABLE_CLASS: APP_LISTING_TABLE_CLASS,
APP_LISTING_TABLE_HDR_THEAD_CLASS: APP_LISTING_TABLE_HDR_THEAD_CLASS,
APP_LISTING_TABLE_HDR_TH_CLASS: APP_LISTING_TABLE_HDR_TH_CLASS,
APP_LISTING_TABLE_HDR_TR_CLASS: APP_LISTING_TABLE_HDR_TR_CLASS,
APP_LISTING_TABLE_HRD_ACTIONS_COL_CLASS: APP_LISTING_TABLE_HRD_ACTIONS_COL_CLASS,
APP_LISTING_TOOLBAR_PAGE_NUM_SECTION_CLASS: APP_LISTING_TOOLBAR_PAGE_NUM_SECTION_CLASS,
APP_LISTING_TOOLBAR_PAGINATION_SECTION_CLASS: APP_LISTING_TOOLBAR_PAGINATION_SECTION_CLASS,
APP_LISTING_TOOLBAR_ROW_PER_PAGE_INPUT_CLASS: APP_LISTING_TOOLBAR_ROW_PER_PAGE_INPUT_CLASS,
APP_LISTING_TOOLBAR_ROW_PER_PAGE_LABEL_CLASS: APP_LISTING_TOOLBAR_ROW_PER_PAGE_LABEL_CLASS,
APP_LISTING_TOOLBAR_ROW_PER_PAGE_SECTION_CLASS: APP_LISTING_TOOLBAR_ROW_PER_PAGE_SECTION_CLASS,
APP_LISTING_TOOLBAR_TOP_DIV_CLASS: APP_LISTING_TOOLBAR_TOP_DIV_CLASS,
APP_LISTING_TOOLBAR_TOP_DIV_NOT_WIDE_CLASS: APP_LISTING_TOOLBAR_TOP_DIV_NOT_WIDE_CLASS,
APP_LISTING_TOOLBAR_TOP_DIV_WIDE_CLASS: APP_LISTING_TOOLBAR_TOP_DIV_WIDE_CLASS,
APP_LISTING_TOOLBAR_WAIT_ANIMATION_CLASS: APP_LISTING_TOOLBAR_WAIT_ANIMATION_CLASS,
APP_SECTION_CONTAINER_FOR_SIDE_MENU_CLASS: APP_SECTION_CONTAINER_FOR_SIDE_MENU_CLASS,
APP_SECTION_CONTAINER_FOR_SIDE_MENU_MAIN_CLASS: APP_SECTION_CONTAINER_FOR_SIDE_MENU_MAIN_CLASS,
APP_SECTION_CONTAINER_FOR_TOP_MENU_CLASS: APP_SECTION_CONTAINER_FOR_TOP_MENU_CLASS,
APP_SIDE_MENU_BG_COLOR_CLASS: APP_SIDE_MENU_BG_COLOR_CLASS,
APP_TITLE_H1_CLASS: APP_TITLE_H1_CLASS,
APP_TITLE_RECYCLE_BUTTON_CLASS: APP_TITLE_RECYCLE_BUTTON_CLASS,
APP_TOP_DIV_CLASS: APP_TOP_DIV_CLASS,
BUTTON_COMPOSED_LABEL_CLASS: BUTTON_COMPOSED_LABEL_CLASS,
BUTTON_LISTING_CLASS: BUTTON_LISTING_CLASS,
BUTTON_LISTING_DISABLED_CLASS: BUTTON_LISTING_DISABLED_CLASS,
BUTTON_LISTING_NEW_CLASS: BUTTON_LISTING_NEW_CLASS,
BUTTON_LISTING_REFRESH_CLASS: BUTTON_LISTING_REFRESH_CLASS,
BUTTON_PRIMARY_CLASS: BUTTON_PRIMARY_CLASS,
BUTTON_SECONDARY_CLASS: BUTTON_SECONDARY_CLASS,
CENTERED_BOX_CONTAINER_DIV_1_CLASS: CENTERED_BOX_CONTAINER_DIV_1_CLASS,
CENTERED_BOX_CONTAINER_DIV_2_CLASS: CENTERED_BOX_CONTAINER_DIV_2_CLASS,
CENTERED_BOX_CONTAINER_DIV_3_CLASS: CENTERED_BOX_CONTAINER_DIV_3_CLASS,
DARK_MODE_BUTTON_DARK_HIDDEN_CLASS: DARK_MODE_BUTTON_DARK_HIDDEN_CLASS,
DARK_MODE_BUTTON_DARK_INLINE_CLASS: DARK_MODE_BUTTON_DARK_INLINE_CLASS,
DARK_MODE_BUTTON_SVG_CLASS: DARK_MODE_BUTTON_SVG_CLASS,
DARK_MODE_BUTTON_TOP_DIV_CLASS: DARK_MODE_BUTTON_TOP_DIV_CLASS,
DISABLE_FIELD_BACKGROUND_COLOR_CLASS: DISABLE_FIELD_BACKGROUND_COLOR_CLASS,
ERROR_MSG_CLASS: ERROR_MSG_CLASS,
FORM_CONTROL_CLASS: FORM_CONTROL_CLASS,
FORM_GROUP_CLASS: FORM_GROUP_CLASS,
GRAY_BOX_MSG_CLASS: GRAY_BOX_MSG_CLASS,
HIDDEN_CLASS: HIDDEN_CLASS,
HORIZONTALLY_CENTERED_CLASS: HORIZONTALLY_CENTERED_CLASS,
INFO_MSG_BUTTON_CLASS: INFO_MSG_BUTTON_CLASS,
INFO_MSG_CLASS: INFO_MSG_CLASS,
INLINE_CLASS: INLINE_CLASS,
INPUT_FLEXIBLE_CLASS: INPUT_FLEXIBLE_CLASS,
INVALID_FEEDBACK_CLASS: INVALID_FEEDBACK_CLASS,
IS_INVALID_CLASS: IS_INVALID_CLASS,
LOGIN_BUTTON_IN_APP_COMPONENT_CLASS: LOGIN_BUTTON_IN_APP_COMPONENT_CLASS,
LOGIN_PAGE_APP_LOGO_CLASS: LOGIN_PAGE_APP_LOGO_CLASS,
LOGIN_PAGE_EXTRA_PT: LOGIN_PAGE_EXTRA_PT,
MAIN_CONTAINER_FOR_SIDE_MENU_CLASS: MAIN_CONTAINER_FOR_SIDE_MENU_CLASS,
MAIN_CONTAINER_FOR_TOP_MENU_CLASS: MAIN_CONTAINER_FOR_TOP_MENU_CLASS,
MARKDOWN_BOLD_CLASS: MARKDOWN_BOLD_CLASS,
MARKDOWN_ITALIC_CLASS: MARKDOWN_ITALIC_CLASS,
MARKDOWN_P_CLASS: MARKDOWN_P_CLASS,
MARKDOWN_UNDERLINE_CLASS: MARKDOWN_UNDERLINE_CLASS,
MENU_MODE_BUTTON_TOP_DIV_CLASS: MENU_MODE_BUTTON_TOP_DIV_CLASS,
ML2_ICON_CLASS: ML2_ICON_CLASS,
MODALIB_BUTTON_BASESTYLE_CLASS: MODALIB_BUTTON_BASESTYLE_CLASS,
MODALIB_BUTTON_BASESTYLE_NOT_WIDE_CLASS: MODALIB_BUTTON_BASESTYLE_NOT_WIDE_CLASS,
MODALIB_BUTTON_BASESTYLE_WIDE_CLASS: MODALIB_BUTTON_BASESTYLE_WIDE_CLASS,
MODALIB_BUTTON_DANGER_CLASS: MODALIB_BUTTON_DANGER_CLASS,
MODALIB_BUTTON_PRIMARY_CLASS: MODALIB_BUTTON_PRIMARY_CLASS,
MODALIB_BUTTON_SECONDARY_CLASS: MODALIB_BUTTON_SECONDARY_CLASS,
MODALIB_BUTTON_SUCCESS_CLASS: MODALIB_BUTTON_SUCCESS_CLASS,
MODALIB_MODAL_BODY_CLASS: MODALIB_MODAL_BODY_CLASS,
MODALIB_MODAL_DIV_1_CLASS: MODALIB_MODAL_DIV_1_CLASS,
MODALIB_MODAL_DIV_2_CLASS: MODALIB_MODAL_DIV_2_CLASS,
MODALIB_MODAL_DIV_3_CLASS: MODALIB_MODAL_DIV_3_CLASS,
MODALIB_MODAL_FOOTER_CLASS: MODALIB_MODAL_FOOTER_CLASS,
MODALIB_MODAL_FOOTER_NOT_WIDE_CLASS: MODALIB_MODAL_FOOTER_NOT_WIDE_CLASS,
MODALIB_MODAL_FOOTER_WIDE_CLASS: MODALIB_MODAL_FOOTER_WIDE_CLASS,
MODALIB_MODAL_HEADER_CLASS: MODALIB_MODAL_HEADER_CLASS,
MODALIB_MODAL_ICON_1_CLASS: MODALIB_MODAL_ICON_1_CLASS,
MODALIB_MODAL_ICON_2_CLASS: MODALIB_MODAL_ICON_2_CLASS,
MODALIB_MODAL_ICON_3_CLASS: MODALIB_MODAL_ICON_3_CLASS,
MODALIB_MODAL_TITLE_CLASS: MODALIB_MODAL_TITLE_CLASS,
NAVBAR_BRAND_APP_LOGO_CLASS: NAVBAR_BRAND_APP_LOGO_CLASS,
NAVBAR_BRAND_APP_VERSION_CLASS: NAVBAR_BRAND_APP_VERSION_CLASS,
NAVBAR_BRAND_ELEMENTS_FOR_SIDE_MENU_CLASS: NAVBAR_BRAND_ELEMENTS_FOR_SIDE_MENU_CLASS,
NAVBAR_BRAND_ELEMENTS_FOR_TOP_MENU_CLASS: NAVBAR_BRAND_ELEMENTS_FOR_TOP_MENU_CLASS,
NAVBAR_BRAND_NAME_CLASS: NAVBAR_BRAND_NAME_CLASS,
NAVBAR_HEADER_FOR_SIDE_MENU_CLASS: NAVBAR_HEADER_FOR_SIDE_MENU_CLASS,
NAVBAR_HEADER_FOR_SIDE_MENU_MOBILE_CLOSE_CLASS: NAVBAR_HEADER_FOR_SIDE_MENU_MOBILE_CLOSE_CLASS,
NAVBAR_HEADER_FOR_SIDE_MENU_MOBILE_OPEN_CLASS: NAVBAR_HEADER_FOR_SIDE_MENU_MOBILE_OPEN_CLASS,
NAVBAR_HEADER_FOR_TOP_MENU_CLASS: NAVBAR_HEADER_FOR_TOP_MENU_CLASS,
NAVBAR_MOBILE_CLOSE_BUTTON_CLASS: NAVBAR_MOBILE_CLOSE_BUTTON_CLASS,
NAVBAR_MOBILE_CLOSE_BUTTON_ICON_CLASS: NAVBAR_MOBILE_CLOSE_BUTTON_ICON_CLASS,
NAVBAR_MOBILE_MENU_DIV_1_CLASS: NAVBAR_MOBILE_MENU_DIV_1_CLASS,
NAVBAR_MOBILE_MENU_DIV_2_CLASS: NAVBAR_MOBILE_MENU_DIV_2_CLASS,
NAVBAR_MOBILE_MENU_DIV_3_CLASS: NAVBAR_MOBILE_MENU_DIV_3_CLASS,
NAVBAR_MOBILE_MENU_H2_CLASS: NAVBAR_MOBILE_MENU_H2_CLASS,
NAVBAR_MOBILE_NAV_CLASS: NAVBAR_MOBILE_NAV_CLASS,
NAVBAR_TEXT_CLASS: NAVBAR_TEXT_CLASS,
NAVBAR_TOGGLE_BUTTON_CLASS: NAVBAR_TOGGLE_BUTTON_CLASS,
NAVBAR_TOGGLE_IMAGE_CLASS: NAVBAR_TOGGLE_IMAGE_CLASS,
NAVBAR_TOP_CENTER_MENU_ON_LEFT_CLASS: NAVBAR_TOP_CENTER_MENU_ON_LEFT_CLASS,
NAVBAR_TOP_CENTER_MENU_ON_TOP_CLASS: NAVBAR_TOP_CENTER_MENU_ON_TOP_CLASS,
NAVBAR_TOP_FOR_SIDE_MENU_CLASS: NAVBAR_TOP_FOR_SIDE_MENU_CLASS,
NAVBAR_TOP_RIGHT_MENU_FOR_SIDE_MENU_CLASS: NAVBAR_TOP_RIGHT_MENU_FOR_SIDE_MENU_CLASS,
NAVBAR_TOP_RIGHT_MENU_FOR_TOP_MENU_CLASS: NAVBAR_TOP_RIGHT_MENU_FOR_TOP_MENU_CLASS,
NAVBAR_TOP_RIGHT_MENU_UNAUTHENTICATED_MARGIN_RIGHT_CLASS: NAVBAR_TOP_RIGHT_MENU_UNAUTHENTICATED_MARGIN_RIGHT_CLASS,
NAV_DROPDOWN_BUTTON_HAMBURGER_CLASS: NAV_DROPDOWN_BUTTON_HAMBURGER_CLASS,
NAV_DROPDOWN_BUTTON_MOBILE_MENU_CLASS: NAV_DROPDOWN_BUTTON_MOBILE_MENU_CLASS,
NAV_DROPDOWN_BUTTON_SIDE_MENU_CLASS: NAV_DROPDOWN_BUTTON_SIDE_MENU_CLASS,
NAV_DROPDOWN_BUTTON_TOP_MENU_CLASS: NAV_DROPDOWN_BUTTON_TOP_MENU_CLASS,
NAV_DROPDOWN_IMAGE_HAMBURGER_CLASS: NAV_DROPDOWN_IMAGE_HAMBURGER_CLASS,
NAV_DROPDOWN_IMAGE_MOBILE_MENU_CLASS: NAV_DROPDOWN_IMAGE_MOBILE_MENU_CLASS,
NAV_DROPDOWN_IMAGE_SIDE_MENU_CLASS: NAV_DROPDOWN_IMAGE_SIDE_MENU_CLASS,
NAV_DROPDOWN_IMAGE_TOP_MENU_CLASS: NAV_DROPDOWN_IMAGE_TOP_MENU_CLASS,
NAV_DROPDOWN_INNER_DIV_HAMBURGER_CLASS: NAV_DROPDOWN_INNER_DIV_HAMBURGER_CLASS,
NAV_DROPDOWN_INNER_DIV_MOBILE_MENU_CLASS: NAV_DROPDOWN_INNER_DIV_MOBILE_MENU_CLASS,
NAV_DROPDOWN_INNER_DIV_SIDE_MENU_CLASS: NAV_DROPDOWN_INNER_DIV_SIDE_MENU_CLASS,
NAV_DROPDOWN_INNER_DIV_TOP_MENU_CLASS: NAV_DROPDOWN_INNER_DIV_TOP_MENU_CLASS,
NAV_DROPDOWN_ITEM_BUTTON_HAMBURGER_CLASS: NAV_DROPDOWN_ITEM_BUTTON_HAMBURGER_CLASS,
NAV_DROPDOWN_ITEM_BUTTON_MOBILE_MENU_CLASS: NAV_DROPDOWN_ITEM_BUTTON_MOBILE_MENU_CLASS,
NAV_DROPDOWN_ITEM_BUTTON_SIDE_MENU_CLASS: NAV_DROPDOWN_ITEM_BUTTON_SIDE_MENU_CLASS,
NAV_DROPDOWN_ITEM_BUTTON_TOP_MENU_CLASS: NAV_DROPDOWN_ITEM_BUTTON_TOP_MENU_CLASS,
NAV_DROPDOWN_ITEM_TOP_DIV_HAMBURGER_CLASS: NAV_DROPDOWN_ITEM_TOP_DIV_HAMBURGER_CLASS,
NAV_DROPDOWN_ITEM_TOP_DIV_MOBILE_MENU_CLASS: NAV_DROPDOWN_ITEM_TOP_DIV_MOBILE_MENU_CLASS,
NAV_DROPDOWN_ITEM_TOP_DIV_SIDE_MENU_CLASS: NAV_DROPDOWN_ITEM_TOP_DIV_SIDE_MENU_CLASS,
NAV_DROPDOWN_ITEM_TOP_DIV_TOP_MENU_CLASS: NAV_DROPDOWN_ITEM_TOP_DIV_TOP_MENU_CLASS,
NAV_DROPDOWN_TOP_DIV_HAMBURGER_CLASS: NAV_DROPDOWN_TOP_DIV_HAMBURGER_CLASS,
NAV_DROPDOWN_TOP_DIV_MOBILE_MENU_CLASS: NAV_DROPDOWN_TOP_DIV_MOBILE_MENU_CLASS,
NAV_DROPDOWN_TOP_DIV_SIDE_MENU_CLASS: NAV_DROPDOWN_TOP_DIV_SIDE_MENU_CLASS,
NAV_DROPDOWN_TOP_DIV_TOP_MENU_CLASS: NAV_DROPDOWN_TOP_DIV_TOP_MENU_CLASS,
NAV_LINK_BUTTON_HAMBURGER_CLASS: NAV_LINK_BUTTON_HAMBURGER_CLASS,
NAV_LINK_BUTTON_MOBILE_MENU_CLASS: NAV_LINK_BUTTON_MOBILE_MENU_CLASS,
NAV_LINK_BUTTON_SIDE_MENU_CLASS: NAV_LINK_BUTTON_SIDE_MENU_CLASS,
NAV_LINK_BUTTON_TOP_MENU_CLASS: NAV_LINK_BUTTON_TOP_MENU_CLASS,
NAV_LINK_ICON_CLASS: NAV_LINK_ICON_CLASS,
NAV_LINK_TOP_DIV_HAMBURGER_CLASS: NAV_LINK_TOP_DIV_HAMBURGER_CLASS,
NAV_LINK_TOP_DIV_MOBILE_MENU_CLASS: NAV_LINK_TOP_DIV_MOBILE_MENU_CLASS,
NAV_LINK_TOP_DIV_SIDE_MENU_CLASS: NAV_LINK_TOP_DIV_SIDE_MENU_CLASS,
NAV_LINK_TOP_DIV_TOP_MENU_CLASS: NAV_LINK_TOP_DIV_TOP_MENU_CLASS,
POPUP_TOP_MARGIN_CLASS: POPUP_TOP_MARGIN_CLASS,
ROUNDED_ICON_CLASS: ROUNDED_ICON_CLASS,
SEARCH_ENGINE_BUTTON_TOP_DIV_CLASS: SEARCH_ENGINE_BUTTON_TOP_DIV_CLASS,
STROKE_WHITE_ICON_CLASS: STROKE_WHITE_ICON_CLASS,
SUCCESS_MSG_CLASS: SUCCESS_MSG_CLASS,
SUGGESTION_DROPDOWN_CLASS: SUGGESTION_DROPDOWN_CLASS,
SUGGESTION_DROPDOWN_WRAPPER_CLASS: SUGGESTION_DROPDOWN_WRAPPER_CLASS,
TOP0_Z50_CLASS: TOP0_Z50_CLASS,
VERTICALLY_CENTERED_CLASS: VERTICALLY_CENTERED_CLASS,
VERTICAL_SLIDER_ICON_CLASS: VERTICAL_SLIDER_ICON_CLASS,
VISIBLE_CLASS: VISIBLE_CLASS,
WAIT_ANIMATION_CLASS: WAIT_ANIMATION_CLASS,
WAIT_ANIMATION_DISABLED_CLASS: WAIT_ANIMATION_DISABLED_CLASS,
WAIT_ANIMATION_ENABLED_CLASS: WAIT_ANIMATION_ENABLED_CLASS,
WAIT_ANIMATION_MARGIN_TOP_CLASS: WAIT_ANIMATION_MARGIN_TOP_CLASS,
WARNING_MSG_CLASS: WARNING_MSG_CLASS,
defaultTheme: defaultTheme
});
const saveRawItemToLocalStorage = (lsItemName, lsData) => {
localStorage.setItem(lsItemName, lsData);
};
const getRawItemFromLocalStorage = lsItemName => {
return localStorage.getItem(lsItemName);
};
const removeItemFromLocalStorage = lsItemName => {
localStorage.removeItem(lsItemName);
};
const saveItemToLocalStorage = (lsItemName, lsDataDict) => {
saveRawItemToLocalStorage(lsItemName, JSON.stringify(lsDataDict));
};
const getItemFromLocalStorage = lsItemName => {
return JSON.parse(getRawItemFromLocalStorage(lsItemName));
};
// Navigation helpers to allow better testability by mocking these functions
// instead of direct window.location access which is non-configurable in JSDOM.
const getWindowLocationOrigin = () => window.location.origin;
const getWindowLocationHref = () => window.location.href;
const windowLocationReload = function () {
let hardReload = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
return window.location.reload(hardReload);
};
const setWindowLocationHref = url => {
window.location.href = url;
};
var _process$env$REACT_AP;
const history = createBrowserHistory();
const hasHashRouter = (_process$env$REACT_AP = process.env.REACT_APP_HASH_ROUTER) !== null && _process$env$REACT_AP !== void 0 ? _process$env$REACT_AP : true;
const getUrlForRouter = url => {
if (!url.startsWith('/')) {
url = '/' + url;
}
return "".concat(hasHashRouter ? '/#' : '').concat(getPrefix()).concat(url);
};
function getPrefix() {
let hardPrefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
if (hardPrefix) {
var _process$env$REACT_AP2;
const prefix = (_process$env$REACT_AP2 = process.env.REACT_APP_URI_PREFIX) !== null && _process$env$REACT_AP2 !== void 0 ? _process$env$REACT_AP2 : '';
return "/".concat(prefix);
}
return '';
}
const setLastUrl = function () {
let lastURL = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
if (!lastURL) {
lastURL = getWindowLocationHref();
}
if (lastURL.indexOf('/login') === -1) {
saveRawItemToLocalStorage('lastURL', lastURL);
}
};
const removeLastUrl = () => {
localStorage.removeItem('lastURL');
removeItemFromLocalStorage('lastURL');
};
const getLastUrl = () => {
let lastUrl = getRawItemFromLocalStorage('lastURL');
if (lastUrl === null || lastUrl === '' || lastUrl === "null") {
lastUrl = '/';
}
return lastUrl;
};
var history$1 = /*#__PURE__*/Object.freeze({
__proto__: null,
getLastUrl: getLastUrl,
getPrefix: getPrefix,
getUrlForRouter: getUrlForRouter,
hasHashRouter: hasHashRouter,
history: history,
removeLastUrl: removeLastUrl,
setLastUrl: setLastUrl
});
function _defineProperty(e, r, t) {
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
value: t,
enumerable: true,
configurable: true,
writable: true
}) : e[r] = t, e;
}
function _extends() {
return _extends = Object.assign ? Object.assign.bind() : function (n) {
for (var e = 1; e < arguments.length; e++) {
var t = arguments[e];
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
}
return n;
}, _extends.apply(null, arguments);
}
function ownKeys(e, r) {
var t = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
r && (o = o.filter(function (r) {
return Object.getOwnPropertyDescriptor(e, r).enumerable;
})), t.push.apply(t, o);
}
return t;
}
function _objectSpread2(e) {
for (var r = 1; r < arguments.length; r++) {
var t = null != arguments[r] ? arguments[r] : {};
r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
_defineProperty(e, r, t[r]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
});
}
return e;
}
function _objectWithoutProperties(e, t) {
if (null == e) return {};
var o,
r,
i = _objectWithoutPropertiesLoose(e, t);
if (Object.getOwnPropertySymbols) {
var n = Object.getOwnPropertySymbols(e);
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
}
return i;
}
function _objectWithoutPropertiesLoose(r, e) {
if (null == r) return {};
var t = {};
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
if (-1 !== e.indexOf(n)) continue;
t[n] = r[n];
}
return t;
}
function _toPrimitive(t, r) {
if ("object" != typeof t || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r);
if ("object" != typeof i) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
function _toPropertyKey(t) {
var i = _toPrimitive(t, "string");
return "symbol" == typeof i ? i : i + "";
}
function console_debug_log(debug_message) {
if (get_debug_flag() === true) {
console.log(debug_message);
for (var i = 1; i < arguments.length; i++) console.log(arguments[i]);
}
}
function get_debug_flag() {
if (typeof window.app_local_debug === 'undefined') {
if (process.env.hasOwnProperty('REACT_APP_DEBUG')) {
window.app_local_debug = process.env.REACT_APP_DEBUG === '1';
} else {
window.app_local_debug = false;
}
}
return window.app_local_debug;
}
var logging_service = /*#__PURE__*/Object.freeze({
__proto__: null,
console_debug_log: console_debug_log,
get_debug_flag: get_debug_flag
});
const randomKey = () => Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
var ramdomize = /*#__PURE__*/Object.freeze({
__proto__: null,
randomKey: randomKey
});
const textareaMinHeightDefault = 40;
const toggleIdVisibility = (onOff, ids) => {
ids.forEach(id => {
const element = document.getElementById(id);
if (element) {
element.style.display = onOff === 'on' ? '' : 'none';
}
});
};
const getElementWithErrorHandling = elementId => {
try {
const elementObj = document.getElementById(elementId);
return elementObj;
} catch (error) {
// Element not found or stil loading...
return null;
}
};
const growUpTextAreaInner = function (textAreaId, conversationBlockId, sectionViewportHeight, maxOffsetHeight) {
let textareaMinHeight = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : textareaMinHeightDefault;
const textarea = getElementWithErrorHandling(textAreaId);
if (textarea) {
// Grow upwards
// Adjust the height of the textarea to grow as the user types
textarea.style.height = 'auto';
textarea.style.height = textarea.scrollHeight + 'px';
// If the content goes beyond its height, adjust the scroll to grow upwards
const conversationObj = document.getElementById(conversationBlockId);
// Calculate the height based on the viewport height (82vh, ".conversation-block.height" in FynBot.css)
const viewportHeight = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0);
// Ensure the textarea does not exceed its max-height...
if (textarea.scrollHeight > maxOffsetHeight) {
textarea.style.height = "".concat(maxOffsetHeight, "px");
}
// Set conversation height to make textarea to scroll up according its height
const sectionViewportHeightInPx = sectionViewportHeight / 100 * viewportHeight;
const conversationHeight = sectionViewportHeightInPx - textarea.clientHeight + textareaMinHeight;
conversationObj.style.height = "".concat(conversationHeight, "px");
}
};
const growUpTextArea = function (textAreaId, conversationBlockId, sectionViewportHeight, maxOffsetHeight) {
let textareaMinHeight = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : textareaMinHeightDefault;
const textarea = getElementWithErrorHandling(textAreaId);
if (textarea) {
textarea.addEventListener('input', event => growUpTextAreaInner(textAreaId, conversationBlockId, sectionViewportHeight, maxOffsetHeight, textareaMinHeight));
}
};
const resetTextArea = function (textAreaId, conversationBlockId, sectionViewportHeight, maxOffsetHeight) {
let textareaMinHeight = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : textareaMinHeightDefault;
const textarea = getElementWithErrorHandling(textAreaId);
if (textarea) {
growUpTextAreaInner(textAreaId, conversationBlockId, sectionViewportHeight, maxOffsetHeight, textareaMinHeight);
}
};
const LinkifyText = _ref => {
let {
children
} = _ref;
// Detect links in the text.
// Example: [Carlos Jose Ramirez Divo - Sitio web oficial](https://www.carlosjramirez.com/en/about-carlos-jose-ramirez-divo/)
const regex = /\[[^\]]+\]\([^)]+\)/g;
const matches = children.match(regex);
const links = !matches ? [] : matches.map(match => {
const title = match.substring(1, match.indexOf(']'));
const url = match.substring(match.indexOf('(') + 1, match.length - 1);
return /*#__PURE__*/React.createElement("a", {
key: url,
href: url,
target: "_blank",
rel: "noopener noreferrer"
}, title);
});
const formattedText = children.split(regex).reduce((acc, textChunk, index) => {
if (index === 0) {
return [textChunk];
}
acc.push(links[index - 1]);
acc.push(textChunk);
return acc;
}, []);
return /*#__PURE__*/React.createElement("div", null, formattedText.map((chunck, index) => {
if (typeof chunck !== 'string') {
return chunck;
}
return chunck.split('\n').map((line, index) => {
return /*#__PURE__*/React.createElement("p", {
key: randomKey()
}, line);
});
}));
};
const renderMarkdownContent = text => {
if (!text || typeof text !== 'string') {
return null;
}
return /*#__PURE__*/React.createElement(ReactMarkdown, {
components: {
p: _ref2 => {
let {
children
} = _ref2;
return /*#__PURE__*/React.createElement("p", {
className: MARKDOWN_P_CLASS
}, children);
},
strong: _ref3 => {
let {
children
} = _ref3;
return /*#__PURE__*/React.createElement("strong", {
className: MARKDOWN_BOLD_CLASS
}, children);
},
em: _ref4 => {
let {
children
} = _ref4;
return /*#__PURE__*/React.createElement("em", {
className: MARKDOWN_ITALIC_CLASS
}, children);
},
a: _ref5 => {
let {
children,
href
} = _ref5;
return /*#__PURE__*/React.createElement("a", {
href: href,
target: "_blank",
rel: "noopener noreferrer",
className: MARKDOWN_UNDERLINE_CLASS
}, children);
}
// Add more markdown components as needed
}
}, text);
};
const CopyButton = _ref6 => {
let {
text
} = _ref6;
const showCopiedMessage = e => {
const copiedMessage = document.createElement('div');
copiedMessage.textContent = 'Copied!';
copiedMessage.style.position = 'absolute';
copiedMessage.style.bottom = '-40px'; // Position under the button
copiedMessage.style.left = '-20px'; // Align with the button's left edge
copiedMessage.style.padding = '5px';
copiedMessage.style.borderRadius = '5px';
copiedMessage.style.border = 'none';
copiedMessage.style.background = 'grey';
copiedMessage.style.color = 'white';
copiedMessage.style.fontSize = '0.75rem';
copiedMessage.style.zIndex = '1000';
copiedMessage.style.opacity = '0';
copiedMessage.style.transition = 'opacity 0.3s';
e.currentTarget.appendChild(copiedMessage); // Append to the button's parent
setTimeout(() => {
copiedMessage.style.opacity = '1';
}, 100);
setTimeout(() => {
copiedMessage.style.opacity = '0';
setTimeout(() => copiedMessage.remove(), 2000);
}, 2000);
};
const securedCopyToClipboard = text => {
navigator.clipboard.writeText(text);
};
const unsecuredCopyToClipboard = text => {
const textArea = document.createElement("textarea");
textArea.value = text;
document.body.appendChild(textArea);
textArea.focus();
textArea.select();
try {
document.execCommand('copy');
} catch (err) {
console.error('Unable to copy to clipboard', err);
}
document.body.removeChild(textArea);
};
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("button", {
id: "copyButton",
style: {
position: 'absolute',
top: '10px',
right: '20px',
padding: '3px',
borderRadius: '5px',
border: 'none',
background: 'grey',
color: 'white',
cursor: 'pointer',
fontSize: '12px'
},
onClick: e => {
if (window.isSecureContext && navigator.clipboard) {
securedCopyToClipboard(text);
} else {
unsecuredCopyToClipboard(text);
}
showCopiedMessage(e);
}
}, "Copy"));
};
const isMobileDevice = () => {
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
};
const isWindowWide = () => window.innerWidth >= 640;
const resizeManager = callback => {
const handleResize = () => {
callback();
};
const addListener = () => {
window.addEventListener('resize', handleResize);
};
const removeListener = () => {
window.removeEventListener('resize', handleResize);
};
return {
addListener,
removeListener
};
};
var ui = /*#__PURE__*/Object.freeze({
__proto__: null,
CopyButton: CopyButton,
LinkifyText: LinkifyText,
getElementWithErrorHandling: getElementWithErrorHandling,
growUpTextArea: growUpTextArea,
growUpTextAreaInner: growUpTextAreaInner,
isMobileDevice: isMobileDevice,
isWindowWide: isWindowWide,
renderMarkdownContent: renderMarkdownContent,
resetTextArea: resetTextArea,
resizeManager: resizeManager,
toggleIdVisibility: toggleIdVisibility
});
const AppContext = /*#__PURE__*/createContext();
const appReducer = (state, action) => {
switch (action.type) {
case 'SET_APP_LOGO':
return _objectSpread2(_objectSpread2({}, state), {}, {
appLogo: action.payload
});
case 'SET_APP_LOGO_HEADER':
return _objectSpread2(_objectSpread2({}, state), {}, {
appLogoHeader: action.payload
});
case 'SET_COMPONENT_MAP':
return _objectSpread2(_objectSpread2({}, state), {}, {
componentMap: action.payload
});
case 'SET_STATE':
return _objectSpread2(_objectSpread2({}, state), {}, {
state: action.payload
});
case 'SET_MENU_OPTIONS':
return _objectSpread2(_objectSpread2({}, state), {}, {
menuOptions: action.payload
});
case 'SET_SIDE_MENU':
return _objectSpread2(_objectSpread2({}, state), {}, {
sideMenu: action.payload
});
case 'TOGGLE_SIDE_MENU':
return _objectSpread2(_objectSpread2({}, state), {}, {
sideMenu: !state.sideMenu
});
case 'SET_DARK_MODE':
return _objectSpread2(_objectSpread2({}, state), {}, {
isDarkMode: action.payload
});
case 'TOGGLE_DARK_MODE':
return _objectSpread2(_objectSpread2({}, state), {}, {
isDarkMode: !state.isDarkMode
});
case 'SET_MOBILE_MENU':
return _objectSpread2(_objectSpread2({}, state), {}, {
isMobileMenuOpen: action.payload
});
case 'TOGGLE_MOBILE_MENU':
return _objectSpread2(_objectSpread2({}, state), {}, {
isMobileMenuOpen: !state.isMobileMenuOpen
});
case 'SET_EXPANDED_MENUS':
return _objectSpread2(_objectSpread2({}, state), {}, {
expandedMenus: action.payload
});
case 'SET_WIDE':
return _objectSpread2(_objectSpread2({}, state), {}, {
isWide: action.payload
});
default:
return state;
}
};
const AppProvider = _ref => {