@decafhub/decaf-react-webapp 0.0.15 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -0
- package/dist/components/Breadcrumb.d.ts +16 -0
- package/dist/components/Breadcrumb.d.ts.map +1 -0
- package/dist/components/DocumentationButton.d.ts +3 -0
- package/dist/components/DocumentationButton.d.ts.map +1 -0
- package/dist/components/Error.d.ts +5 -5
- package/dist/components/Layout.d.ts +16 -17
- package/dist/components/Layout.d.ts.map +1 -1
- package/dist/components/Logo.d.ts +2 -2
- package/dist/components/Menu.d.ts +9 -0
- package/dist/components/Menu.d.ts.map +1 -0
- package/dist/components/PageAbout.d.ts +8 -8
- package/dist/components/PageAbout.d.ts.map +1 -1
- package/dist/components/PageLayout.d.ts +10 -0
- package/dist/components/PageLayout.d.ts.map +1 -0
- package/dist/components/PageScroller.d.ts +2 -2
- package/dist/components/PageScroller.d.ts.map +1 -1
- package/dist/components/Screenshotter.d.ts +5 -5
- package/dist/components/Screenshotter.d.ts.map +1 -1
- package/dist/components/ThemeSwitcher.d.ts +7 -7
- package/dist/components/ThemeSwitcher.d.ts.map +1 -1
- package/dist/components/UserProfileDropdown.d.ts +3 -0
- package/dist/components/UserProfileDropdown.d.ts.map +1 -0
- package/dist/components/VersionSelector.d.ts +11 -11
- package/dist/components/VersionSelector.d.ts.map +1 -1
- package/dist/components/ZendeskWidget.d.ts +8 -8
- package/dist/components/ZendeskWidget.d.ts.map +1 -1
- package/dist/index.d.ts +7 -51
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.mjs +2 -2
- package/dist/index.modern.mjs.map +1 -1
- package/dist/index.module.js +1 -1
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/machinery/-plausible.d.ts +2 -0
- package/dist/machinery/-plausible.d.ts.map +1 -0
- package/dist/machinery/index.d.ts +91 -0
- package/dist/machinery/index.d.ts.map +1 -0
- package/dist/style.d.ts +4 -4
- package/dist/style.d.ts.map +1 -1
- package/dist/theme/-styles.d.ts +7 -0
- package/dist/theme/-styles.d.ts.map +1 -0
- package/dist/theme/-theme-context.d.ts +7 -0
- package/dist/theme/-theme-context.d.ts.map +1 -0
- package/dist/theme/-theme-hooks.d.ts +2 -0
- package/dist/theme/-theme-hooks.d.ts.map +1 -0
- package/dist/theme/-theme-provider.d.ts +9 -0
- package/dist/theme/-theme-provider.d.ts.map +1 -0
- package/dist/theme/index.d.ts +6 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme.d.ts +17 -17
- package/dist/theme.d.ts.map +1 -1
- package/dist/types.d.ts +12 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils.d.ts +58 -24
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.spec.d.ts +2 -0
- package/dist/utils.spec.d.ts.map +1 -0
- package/package.json +36 -31
package/dist/index.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.js","sources":["../src/components/Error.tsx","../src/utils.tsx","../src/style.ts","../src/theme.tsx","../src/components/Logo.tsx","../src/components/PageScroller.tsx","../src/components/Screenshotter.tsx","../src/components/ThemeSwitcher.tsx","../src/components/VersionSelector.tsx","../src/components/ZendeskWidget.tsx","../src/components/Layout.tsx","../src/components/PageAbout.tsx","../src/index.tsx"],"sourcesContent":["import { LockFilled } from '@ant-design/icons';\nimport { Button, Result, Typography } from 'antd';\nimport React from 'react';\nimport { Link } from 'react-router-dom';\n\nfunction ErrorPageSubtitle({ message }: { message: string }) {\n return (\n <>\n <Typography>{message}</Typography>\n <Link to=\"/\">\n <Button style={{ marginTop: 20 }}>Home Page</Button>\n </Link>\n </>\n );\n}\n\nexport function Page401() {\n return (\n <Result\n icon={<LockFilled style={{ color: '#ff603b' }} />}\n title={'Authentication Error'}\n subTitle={<ErrorPageSubtitle message={'Your credentials are invalid. Please try to log in again.'} />}\n />\n );\n}\n\nexport function Page403() {\n return (\n <Result\n status=\"403\"\n title={'Access Denied'}\n subTitle={<ErrorPageSubtitle message={'You are not authorized to access this content.'} />}\n />\n );\n}\n\nexport function Page404() {\n return (\n <Result\n status=\"404\"\n title={'Page Not Found'}\n subTitle={<ErrorPageSubtitle message={'Sorry, the page you visited does not exist.'} />}\n />\n );\n}\n\nexport function PageError() {\n return (\n <Result\n status=\"500\"\n title={'Error'}\n subTitle={\n <ErrorPageSubtitle\n message={\n 'Something went wrong. Please try again later. If the problem persists, please contact the administrator.'\n }\n />\n }\n />\n );\n}\n","import { useLayoutEffect, useState } from 'react';\n\n/**\n * This hook is used to calculate the max possible height of a table.\n * It is used to set the height of the table to make it scrollable\n * when the content is too large.\n * @param elementId the id of the element that contains the table.\n * @param bottomSpace extra space to be added to the bottom of the table container.\n * @returns the max height of the table.\n * @example\n * ```tsx\n * const maxHeight = useTableMaxHeight('table-container', 50);\n * return (\n * <Table\n {...tableProps}\n id={'table-container'}\n scroll={{\n x: 'max-content',\n y: maxHeight,\n }}\n />\n* );\n* ```\n**/\nexport function useTableMaxHeight(elementId: string, bottomSpace?: number): string | number {\n const [maxHeight, setMaxHeight] = useState<string | number>(400);\n const w = document.getElementById(elementId);\n\n useLayoutEffect(() => {\n const calculate = () => {\n if (!w) {\n return;\n }\n const footerHeight = 50; // height of the footer with some padding\n let parentPaddingBottom = 80; // default padding bottom of the container element\n const closestContainer = w.parentElement; // get the closest container element\n if (closestContainer) {\n parentPaddingBottom = parseFloat(getComputedStyle(closestContainer, null).paddingBottom);\n parentPaddingBottom = isNaN(parentPaddingBottom) || parentPaddingBottom < 10 ? 80 : parentPaddingBottom;\n }\n const bottomMargin = parentPaddingBottom + footerHeight + (bottomSpace || 0);\n const boundingRect = w.getBoundingClientRect(); // get area and offset information.\n const max = window.innerHeight - boundingRect.top - bottomMargin; // this is the height of the our table content.\n setMaxHeight(max > 350 ? max : '100%');\n };\n\n calculate();\n w?.addEventListener('resize', calculate);\n window.addEventListener('resize', calculate);\n\n return () => {\n window.removeEventListener('resize', calculate);\n w?.removeEventListener('resize', calculate);\n };\n }, [elementId, w, bottomSpace]);\n\n return maxHeight;\n}\n\nexport function lightenDarkenColor(col: string, amt: number) {\n let usePound = false;\n\n if (col[0] === '#') {\n col = col.slice(1);\n usePound = true;\n }\n\n const num = parseInt(col, 16);\n\n let r = (num >> 16) + amt;\n\n if (r > 255) r = 255;\n else if (r < 0) r = 0;\n\n let b = ((num >> 8) & 0x00ff) + amt;\n\n if (b > 255) b = 255;\n else if (b < 0) b = 0;\n\n let g = (num & 0x0000ff) + amt;\n\n if (g > 255) g = 255;\n else if (g < 0) g = 0;\n\n return (usePound ? '#' : '') + String('000000' + (g | (b << 8) | (r << 16)).toString(16)).slice(-6);\n}\n","import { Interpolation, Theme } from '@emotion/react';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\nimport { lightenDarkenColor } from './utils';\n\nfunction getBaseStyles(theme: ThemeConfig): Interpolation<Theme> {\n return {\n body: {\n background: theme.token?.colorBgBase,\n fontFamily: 'Inter, sans-serif',\n margin: 0,\n },\n button: {\n boxShadow: 'none !important',\n },\n '.ant-table-body': {\n overflow: 'auto !important',\n },\n '#decaf-header': {\n position: 'fixed',\n zIndex: 999,\n right: 0,\n left: 0,\n paddingInline: 0,\n },\n '#decaf-content': {\n paddingInline: 20,\n paddingTop: '5rem',\n paddingBottom: '5rem',\n },\n '#decaf-footer': {\n position: 'fixed',\n bottom: 0,\n right: 0,\n left: 0,\n background: theme.components?.Layout?.colorBgHeader,\n paddingBlock: 0,\n paddingInline: 0,\n zIndex: 999,\n\n button: {\n height: 34,\n },\n },\n '.dot': {\n borderRadius: '50%',\n width: 10,\n height: 10,\n display: 'inline-block',\n backgroundColor: 'rgba(255,255,255,.25)',\n '&.green': {\n backgroundColor: `#80ff00 !important`,\n },\n '&.yellow': {\n backgroundColor: `#ff0 !important`,\n },\n '&.orange': {\n backgroundColor: `#ff7000 !important`,\n },\n '&.red': {\n backgroundColor: `#ff0000 !important`,\n },\n },\n };\n}\n\nexport function getLightStyles(theme: ThemeConfig): Interpolation<Theme> {\n const baseStyles = getBaseStyles(theme) as any;\n\n return {\n ...(baseStyles as any),\n };\n}\n\nexport function getDarkStyles(theme: ThemeConfig): Interpolation<Theme> {\n const baseStyles = getBaseStyles(theme) as any;\n\n return {\n ...baseStyles,\n '*': {\n '&::-webkit-scrollbar': {\n width: 10,\n height: 10,\n },\n '&::-webkit-scrollbar-track': {\n background: theme.token?.colorBgContainer,\n },\n '&::-webkit-scrollbar-thumb': {\n background: theme.token?.colorPrimary,\n },\n },\n '.ant-page-header-back-button, .ant-page-header-heading-title': {\n color: `${theme.token?.colorWhite} !important`,\n },\n '.ant-badge-count': {\n color: `${theme.token?.colorWhite} !important`,\n },\n '.ant-table-thead > tr > th': {\n background: `${lightenDarkenColor(theme.token?.colorBgContainer || '', -5)} !important`,\n '&:hover': {\n background: `${theme.token?.colorBgContainer} !important`,\n },\n },\n '.ant-table-filter-dropdown': {\n 'input, .ant-table-filter-dropdown-search-input': {\n background: `${theme.token?.colorBgBase} !important`,\n },\n '.ant-dropdown-menu-item, .ant-dropdown-menu': {\n background: `${theme.token?.colorBgContainer} !important`,\n },\n },\n '.ant-menu-light.ant-menu-horizontal >.ant-menu-item-selected': {\n color: `${theme.token?.colorWhite} !important`,\n },\n '.ant-tabs-tab-active': {\n '.ant-tabs-tab-btn': {\n color: `${theme.token?.colorWhite} !important`,\n },\n },\n '.ant-radio-button-wrapper-checked': {\n backgroundColor: `${theme.components?.Button?.colorBgContainer} !important`,\n color: `${theme.token?.colorWhite} !important`,\n },\n '.ant-picker-date-panel': {\n '.ant-picker-cell-in-range, .ant-picker-cell-range-start, .ant-picker-cell-range-end': {\n '&::before': {\n background: `${theme.token?.colorBgBase} !important`,\n },\n '.ant-picker-cell-inner': {\n background: `${theme.token?.colorBgBase} !important`,\n },\n },\n '.ant-picker-cell-range-start, .ant-picker-cell-range-end': {\n '.ant-picker-cell-inner': {\n background: `${theme.token?.colorPrimary} !important`,\n },\n },\n },\n };\n}\n","import { css, Global } from '@emotion/react';\nimport { ConfigProvider, theme } from 'antd';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\nimport React from 'react';\nimport { getDarkStyles, getLightStyles } from './style';\n\nconst MAIN_BLACK = '#10161d';\nconst INPUT_BG_COLOR = '#2c3d50';\n\nconst BORDER_COLORS_TRANSPARENT = {\n colorBorder: 'transparent',\n colorBorderSecondary: 'transparent',\n colorBorderBg: 'transparent',\n};\n\nexport const decafThemeLight: ThemeConfig = {\n hashed: true,\n algorithm: [theme.defaultAlgorithm],\n components: {\n Layout: {\n colorBgHeader: '#ededed',\n },\n },\n token: {\n borderRadius: 0,\n colorBgContainer: '#f8f8f8',\n colorBgBase: '#f8f8f8',\n colorBgLayout: '#f8f8f8',\n },\n};\n\nexport const decafThemeDark: ThemeConfig = {\n hashed: true,\n components: {\n Layout: {\n colorBgHeader: MAIN_BLACK,\n },\n Button: {\n boxShadow: 'none',\n boxShadowSecondary: 'none',\n colorBgContainer: INPUT_BG_COLOR,\n },\n Input: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Select: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Checkbox: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Dropdown: {\n ...BORDER_COLORS_TRANSPARENT,\n },\n DatePicker: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n colorBgElevated: INPUT_BG_COLOR,\n },\n InputNumber: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Menu: {\n colorItemText: 'rgba(255, 255, 255, 0.5)',\n },\n },\n token: {\n fontFamily: 'Inter, sans-serif',\n colorPrimary: '#344961',\n colorBgBase: '#1a242f',\n colorBgContainer: MAIN_BLACK,\n colorBgElevated: '#1a242f',\n colorBorderSecondary: '#1a242f',\n colorBorder: '#1a242f',\n colorBgLayout: '#1a242f',\n borderRadius: 0,\n green: '#48734d',\n red: '#b03a38',\n blue: '#0d6efd',\n yellow: '#ffc107',\n orange: '#fd7e14',\n colorWhite: '#fff',\n colorLink: '#a4bfff',\n colorLinkHover: '#7199fb',\n colorLinkActive: '#7199fb',\n },\n\n algorithm: [theme.darkAlgorithm],\n};\n\ninterface ThemeContextProps {\n theme: 'dark' | 'light';\n toggleTheme: () => void;\n}\nexport const ThemeContext = React.createContext<ThemeContextProps>({\n theme: 'dark',\n toggleTheme: () => {},\n});\n\ninterface ThemeProviderProps {\n children: React.ReactNode;\n themeConfig?: ThemeConfig;\n theme?: 'dark' | 'light';\n}\nexport function ThemeProvider(props: ThemeProviderProps) {\n const [value, setValue] = React.useState<'dark' | 'light'>(() => {\n const theme = props.theme || localStorage.getItem('decafAppTheme');\n if (theme === 'dark' || theme === 'light') {\n return theme;\n }\n return 'dark';\n });\n\n function setTheme() {\n const t = value === 'dark' ? 'light' : 'dark';\n setValue(t);\n localStorage.setItem('decafAppTheme', t);\n }\n\n let theme = value === 'light' ? decafThemeLight : decafThemeDark;\n theme = { ...theme, ...(props.themeConfig || {}) };\n theme = { ...theme, token: { ...theme.token, fontFamily: 'Inter, sans-serif' } };\n\n const globalStyles = value === 'light' ? getLightStyles(theme) : getDarkStyles(theme);\n\n return (\n <ThemeContext.Provider\n value={{\n theme: value,\n toggleTheme: setTheme,\n }}\n >\n <ConfigProvider theme={theme}>\n <Global\n styles={css`\n @import url(https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap);\n `}\n />\n <Global styles={globalStyles} />\n\n {props.children}\n </ConfigProvider>\n </ThemeContext.Provider>\n );\n}\n\nexport const useDecafTheme = () => React.useContext(ThemeContext);\n","import React from 'react';\n\nexport default function Logo() {\n return (\n <svg\n version=\"1.1\"\n id=\"Layer_1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlnsXlink=\"http://www.w3.org/1999/xlink\"\n x=\"0px\"\n y=\"0px\"\n viewBox=\"0 0 649.6 767.9\"\n enableBackground={'new 0 0 649.6 767.9'}\n xmlSpace=\"preserve\"\n width={50}\n height={50}\n >\n <g>\n <path\n fill=\"#52CEF4\"\n d=\"M324,767.9c-6.6-5.1-14.2-8.6-21.3-12.9c-22-13-44.3-25.6-66.4-38.5c-21.3-12.4-42.5-25-63.8-37.4\n c-33.5-19.5-67.1-39-100.7-58.5c-22.7-13.2-45.3-26.5-68-39.6c-2.8-1.6-3.8-3.3-3.8-6.5c0.2-58.6-0.2-117.3,0.4-175.9\n C1,333,0.7,267.3,1,201.6c0-1.8-0.6-3.7,0.6-5.4c6.4,3.8,12.7,7.6,19.1,11.3c23.8,13.9,47.7,27.9,71.5,41.8\n c4.9,2.9,9.6,6.2,14.9,8.4c-1.2,5.2-0.2,10.3-0.1,15.5c0.5,56.1-0.2,112.2,0.9,168.3c0.3,18.4,0.2,36.8,0.2,55.2\n c0,3,0.7,4.9,3.5,6.4c6.3,3.4,12.3,7.3,18.5,11c26.1,15.7,52.3,31.5,78.4,47.2c33,19.8,66,39.6,99,59.3c5.7,3.4,10.9,7.5,17.2,9.7\n c0,1.5,0.1,2.9,0.1,4.4c0,42.4,0,84.8,0,127.3c0,1.8-0.7,3.7,0.8,5.3c0,0.2,0,0.4,0,0.7C325.1,767.9,324.5,767.9,324,767.9z\"\n />\n <path\n fill=\"#227EC3\"\n d=\"M107.1,257.6c-5.3-2.2-10-5.5-14.9-8.4c-23.8-13.9-47.7-27.8-71.5-41.8c-6.4-3.7-12.7-7.6-19.1-11.3\n c8.2-6,17.1-10.7,25.7-16c28.7-17.5,57.5-34.9,86.3-52.4c39.2-23.8,78.5-47.6,117.7-71.4c27-16.3,53.9-32.7,80.9-49\n c4-2.4,8.1-4.6,11.7-7.4c1.3,0,2.7,0,4,0c0.3,1.6,1.9,1.8,2.9,2.4c31,18.9,62,37.8,93.1,56.4c4.2,2.5,5.9,5.2,5.9,10.3\n c-0.3,38.3-0.1,76.7-0.1,115c0,2.7-0.1,5.3-0.2,8c-10.5-6.3-21-12.5-31.4-18.9c-23.1-14-46.2-28-69.3-42c-1.6-1-2.8-1.6-5-0.4\n c-26.8,15.8-53.7,31.5-80.6,47.2c-26.1,15.2-52.2,30.4-78.3,45.7C145.7,235,126.4,246.3,107.1,257.6z\"\n />\n <path\n fill=\"#409DD5\"\n d=\"M324.7,630.2c5.2-4.2,11-7.4,16.7-10.9c32.6-20.3,65.3-40.6,98-60.8c30.8-19,61.6-38,92.4-57\n c7.5-4.6,7.5-4.6,7.5-13.6c0-58.6,0.1-117.3,0.1-175.9c0-1.6-0.1-3.2-0.1-4.8c0.8-1.5,0.4-3.1,0.4-4.7c0.1-14.7,0.2-29.5,0.3-44.2\n c1.3,0.1,2.4-0.4,3.4-1c8.7-5.1,17.4-10.2,26.1-15.3c15.8-9.2,31.7-18.3,47.6-27.5c10.5-6.1,21.1-12.3,31.6-18.4\n c1.5,0.9,0.8,2.4,0.8,3.6c0,124.2,0,248.4,0.1,372.6c0,2.7-0.9,4-3.1,5.3c-35.3,20.8-70.5,41.7-105.8,62.6\n c-27.2,16.1-54.5,32.2-81.7,48.4c-27,16-54,32.1-81,48c-17.4,10.3-34.8,20.4-52.3,30.7c-1.5-1.6-0.8-3.5-0.8-5.3\n c0-42.4,0-84.8,0-127.3C324.8,633.2,324.7,631.7,324.7,630.2z\"\n />\n <path\n fill=\"#227EC3\"\n d=\"M648.7,196.1c-10.5,6.1-21,12.3-31.6,18.4c-15.8,9.2-31.7,18.3-47.6,27.5c-8.7,5.1-17.4,10.2-26.1,15.3\n c-1,0.6-2.1,1.1-3.4,1c0-12.4-0.1-24.8-0.1-37.2c0-30.2,0-60.5,0-91c2.8,0.3,4.5,2,6.5,3.1c28.4,17.3,56.8,34.7,85.2,52\n C637.3,188.8,643.4,191.8,648.7,196.1z\"\n />\n <path\n fill=\"#227EC3\"\n d=\"M216.2,322.3c-0.3-1.6-0.4-2.9,1.4-4c29.2-18,58.4-36.1,87.5-54.1c4.7-2.9,9.5-5.8,14.2-8.9\n c1.5-1,2.7-1.1,4.3-0.2c26.9,15.9,53.8,31.8,80.7,47.7c7.1,4.2,14.1,8.5,21.4,12.4c3.5,1.9,4.8,4.3,3.9,8c-1.7,1.1-3.3,2.2-5,3.2\n c-20.5,11.9-41.1,23.8-61.6,35.7c-13,7.6-26.1,15.2-39.1,22.8c-7-4-14-8.1-21-12.1c-21.7-12.7-43.2-25.5-65-38\n C230.7,330.5,223.8,325.8,216.2,322.3z\"\n />\n <path\n fill=\"#52CEF4\"\n d=\"M216.2,322.3c7.6,3.5,14.5,8.2,21.8,12.4c21.7,12.5,43.3,25.3,65,38c7,4.1,14,8.1,21,12.1\n c0,39.3,0.1,78.6,0.1,117.9c-1.5,0.9-2.5-0.4-3.6-1c-21.3-12.8-42.5-25.5-63.7-38.3c-13.3-8-26.5-16.1-39.8-24\n c-1.8-1.1-2.5-2.3-2.5-4.4c0.4-26.9,0.4-53.8,1.1-80.7C215.8,343.6,215.4,332.9,216.2,322.3z\"\n />\n <path\n fill=\"#409DD5\"\n d=\"M324,502.6c0-39.3-0.1-78.6-0.1-117.9c13-7.6,26.1-15.2,39.1-22.8c20.5-11.9,41.1-23.8,61.6-35.7\n c1.7-1,3.3-2.1,5-3.2c0.1,7.6,0.1,15.2,0.1,22.8c0,30.5,0,61,0,91.5c0,2.6-0.4,4.4-2.9,5.8c-31.6,18.2-63,36.5-94.5,54.8\n C329.6,499.6,327.2,501.8,324,502.6z\"\n />\n </g>\n </svg>\n );\n}\n","import { DownOutlined, UpOutlined } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport React from 'react';\n\nexport default function PageScroller() {\n return (\n <div>\n <Button\n title=\"Scroll to top\"\n type=\"text\"\n size=\"small\"\n onClick={() => window.scrollTo({ top: 0, behavior: 'smooth' })}\n icon={<UpOutlined />}\n />\n <Button\n title=\"Scroll to bottom\"\n type=\"text\"\n size=\"small\"\n onClick={() => window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' })}\n icon={<DownOutlined />}\n />\n </div>\n );\n}\n","import { CameraOutlined } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport html2canvas from 'html2canvas';\nimport React from 'react';\n\nexport interface ScreenShotterProps {\n triggerNode?: React.ReactNode;\n}\nexport default function ScreenShotter(props: ScreenShotterProps) {\n async function handleScreenshot() {\n // hide footer before taking screenshot\n const footer = document.getElementById('decaf-footer');\n footer?.style.setProperty('display', 'none');\n\n const canvas = await html2canvas(document.body);\n const dataUrl = canvas.toDataURL('image/png');\n\n // show footer after taking screenshot\n footer?.style.setProperty('display', 'block');\n\n const link = document.createElement('a');\n link.download = 'screenshot.png';\n link.href = dataUrl;\n link.click();\n link.remove();\n }\n\n if (props.triggerNode) {\n return React.cloneElement(props.triggerNode as React.ReactElement, {\n onClick: handleScreenshot,\n });\n } else {\n return (\n <Button\n title=\"Take a screenshot of the current page\"\n type=\"text\"\n size=\"small\"\n icon={<CameraOutlined />}\n onClick={handleScreenshot}\n />\n );\n }\n}\n","import { BulbFilled } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport React from 'react';\n\ninterface ThemeSwitcherProps {\n theme: 'dark' | 'light';\n onChange: () => void;\n}\nexport default function ThemeSwitcher(props: ThemeSwitcherProps) {\n return (\n <Button\n title={props.theme === 'dark' ? 'switch to light theme' : 'switch to dark theme'}\n type=\"text\"\n size=\"small\"\n icon={\n <BulbFilled\n style={{\n color: props.theme === 'dark' ? 'white' : 'black',\n }}\n />\n }\n onClick={() => props.onChange()}\n />\n );\n}\n","import { CaretUpOutlined } from '@ant-design/icons';\nimport { Button, Dropdown } from 'antd';\nimport React from 'react';\n\ntype VersionCode = 'production' | 'staging' | 'testing' | 'development' | 'preview' | 'release';\nexport type Version = {\n code: VersionCode;\n name: string;\n color: string;\n url: string;\n show: boolean;\n};\n\nfunction getAppNameFromUrl(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts[indexOfWebapps + 1];\n }\n}\n\nfunction getAppVersionFromUrl(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts[indexOfWebapps + 2];\n }\n}\n\nfunction isPreviewVersion(version: string) {\n return version.startsWith('preview-') && version.length > 8;\n}\n\nfunction isReleaseVersion(version: string) {\n return version.startsWith('v') && version.length > 1;\n}\n\nfunction getAppVersionCode(version: string) {\n if (isPreviewVersion(version)) {\n return 'preview';\n } else if (isReleaseVersion(version)) {\n return 'release';\n } else {\n return version;\n }\n}\n\nfunction getCurrentAppPath(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts.slice(indexOfWebapps + 3).join('/');\n }\n}\n\nexport default function VersionSelector() {\n const appName = getAppNameFromUrl(window.location.href);\n const appVersion = getAppVersionFromUrl(window.location.href); // development, staging, preview-123, v1.0.0\n const appVersionCode = getAppVersionCode(appVersion); // development, staging, preview, release\n\n const versions: Version[] = [\n {\n code: 'development',\n name: 'Development Version',\n color: 'red',\n url: `/webapps/${appName}/development/${getCurrentAppPath(window.location.href)}`,\n show: process.env.NODE_ENV === 'development',\n },\n {\n code: 'testing',\n name: 'Testing Version',\n color: 'orange',\n url: `/webapps/${appName}/testing/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'staging',\n name: 'Staging Version',\n color: 'yellow',\n url: `/webapps/${appName}/staging/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'production',\n name: 'Production Version',\n color: 'green',\n url: `/webapps/${appName}/production/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'preview',\n name: 'Preview Version',\n color: 'grey',\n url: `/`,\n show: false,\n },\n {\n code: 'release',\n name: 'Release Version',\n color: 'grey',\n url: `/`,\n show: false,\n },\n ];\n\n const currentVersion = versions.find((v) => v.code === appVersionCode);\n\n if (!currentVersion) {\n return null;\n }\n\n return (\n <Dropdown\n placement=\"top\"\n arrow\n menu={{\n items: versions\n .filter((v) => v.show)\n .map((version) => ({\n key: version.name,\n label: (\n <span>\n <i className={`dot ${version.color}`} /> {version.name}\n </span>\n ),\n onClick: () => {\n window.location.href = version.url;\n },\n })),\n }}\n >\n <Button type=\"text\" size=\"small\">\n <div style={{ display: 'flex', alignItems: 'center' }}>\n <i className={`dot ${currentVersion?.color}`} style={{ marginRight: 5 }} />\n {currentVersion.code !== 'production' && (\n <span style={{ marginRight: 5 }}>\n You are on <b>{currentVersion.name}</b>\n </span>\n )}\n <CaretUpOutlined />\n </div>\n </Button>\n </Dropdown>\n );\n}\n","import { QuestionCircleOutlined } from '@ant-design/icons';\nimport { useDecaf } from '@decafhub/decaf-react';\nimport { Button } from 'antd';\nimport React, { useEffect, useState } from 'react';\n\nconst ZENDESK_WIDGET_SCRIPT = 'https://static.zdassets.com/ekr/snippet.js';\n\ndeclare global {\n // eslint-disable-next-line no-unused-vars\n interface Window {\n zE: any;\n zESettings: any;\n }\n}\n\nexport default function ZendeskWidget() {\n const { me, publicConfig } = useDecaf();\n const [open, setOpen] = useState(false);\n\n useEffect(() => {\n if (!publicConfig.zendesk || typeof document === 'undefined') return;\n const script = document.createElement('script');\n script.src = ZENDESK_WIDGET_SCRIPT + '?key=' + publicConfig.zendesk;\n script.async = true;\n script.id = 'ze-snippet'; // do not change this. zendesk expects this to be ze-snippet\n script.onload = () => {\n window.zE('webWidget', 'hide');\n window.zE('webWidget:on', 'open', () => {\n window.zE('webWidget', 'show');\n setOpen(true);\n });\n window.zE('webWidget:on', 'close', () => {\n window.zE('webWidget', 'hide');\n setOpen(false);\n });\n };\n\n document.body.appendChild(script);\n window.zESettings = {\n webWidget: {\n offset: {\n horizontal: -7,\n vertical: 20,\n },\n },\n contactForm: {\n subject: true,\n fields: [\n {\n id: 'name',\n prefill: { '*': me.fullname },\n },\n {\n id: 'email',\n prefill: { '*': me.email },\n },\n ],\n },\n };\n\n return () => {\n document.body.removeChild(script);\n };\n }, [publicConfig, me]);\n\n function toggle() {\n if (open) {\n window.zE?.('webWidget', 'close');\n } else {\n window.zE?.('webWidget', 'open');\n }\n setOpen(!open);\n }\n\n if (!publicConfig.zendesk) return null;\n\n return (\n <Button size=\"small\" icon={<QuestionCircleOutlined />} onClick={toggle}>\n Support\n </Button>\n );\n}\n","import { UserOutlined } from '@ant-design/icons';\nimport { useDecaf } from '@decafhub/decaf-react';\nimport { Button, Col, Layout, Menu, Row, Typography } from 'antd';\nimport { ItemType, SubMenuType } from 'antd/es/menu/hooks/useItems';\nimport React from 'react';\nimport { Link, NavLink, Outlet, useLocation, useMatches } from 'react-router-dom';\nimport { useDecafTheme } from '../theme';\nimport Logo from './Logo';\nimport PageScroller from './PageScroller';\nimport ScreenShotter from './Screenshotter';\nimport ThemeSwitcher from './ThemeSwitcher';\nimport VersionSelector from './VersionSelector';\nimport ZendeskWidget from './ZendeskWidget';\n\ninterface BaseDecafMenuItem {\n label: any;\n icon?: React.ReactNode;\n children?: DecafMenuItem[];\n}\n\nexport type DecafMenuItem = BaseDecafMenuItem & ({ to?: string } | { href?: string });\n\nexport interface DecafLayoutProps {\n menu: DecafMenuItem[];\n appName: string;\n}\n\nfunction buildAntMenuFromDecafMenu(routes: DecafMenuItem[]): ItemType[] {\n const result: ItemType[] = [];\n routes.forEach((route) => {\n const item: ItemType = {\n key: 'to' in route ? route.to : route.label,\n label: route.label,\n icon: route.icon,\n };\n if ('to' in route && route.to) {\n item.label = (\n <NavLink to={route.to} end={route.to === '/'}>\n {route.label}\n </NavLink>\n );\n } else if ('href' in route && route.href) {\n item.label = <a href={route.href}>{route.label}</a>;\n } else if (route.children) {\n item.label = route.label;\n (item as SubMenuType).children = buildAntMenuFromDecafMenu(route.children || []);\n }\n result.push(item);\n });\n\n return result;\n}\n\nexport default function DecafLayout(props: DecafLayoutProps) {\n const menuItems = buildAntMenuFromDecafMenu(props.menu);\n const matches = useMatches();\n const location = useLocation();\n const matchedMenuItems = matches\n .map((match) => match.pathname)\n .filter((pathname) => (location.pathname !== '/' ? pathname !== '/' : true)); // WORKAROUND: the root path always matches. We don't want that.\n const { me } = useDecaf();\n const { theme, toggleTheme: setTheme } = useDecafTheme();\n\n return (\n <Layout style={{ height: '100%' }}>\n <Layout.Header id=\"decaf-header\">\n <div style={{ paddingInline: 20, display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>\n <Link to=\"/\" style={{ display: 'flex', alignItems: 'center', gap: 10 }}>\n <Logo />\n <Typography.Title level={4} style={{ margin: 0 }}>\n {props.appName}\n </Typography.Title>\n </Link>\n <Menu\n style={{ justifyContent: 'flex-end', backgroundColor: 'transparent', border: 'none', flex: 1 }}\n mode=\"horizontal\"\n items={menuItems}\n selectedKeys={matchedMenuItems}\n />\n </div>\n </Layout.Header>\n <Layout.Content id=\"decaf-content\">\n <Outlet />\n </Layout.Content>\n <Layout.Footer id=\"decaf-footer\">\n <Row justify=\"space-between\" align={'middle'}>\n <Col span={10}>\n <ZendeskWidget />\n </Col>\n <Col span={4} style={{ textAlign: 'center' }}>\n <Typography.Text type=\"secondary\">\n Powered by{' '}\n <b>\n <a href=\"https://teloscube.com\" target=\"_blank\" rel=\"noreferrer\">\n Teloscube\n </a>\n </b>\n </Typography.Text>\n </Col>\n <Col span={10} style={{ justifyContent: 'flex-end', display: 'flex', gap: 10 }}>\n <Button size=\"small\" icon={<UserOutlined />}>\n {me.username}\n </Button>\n <VersionSelector />\n <ThemeSwitcher theme={theme} onChange={setTheme} />\n <ScreenShotter />\n <PageScroller />\n </Col>\n </Row>\n </Layout.Footer>\n </Layout>\n );\n}\n","import { useDecaf } from '@decafhub/decaf-react';\nimport { Descriptions, Space } from 'antd';\nimport React, { useEffect, useState } from 'react';\n\nexport interface AboutPageProps {\n appName?: string;\n appVersion?: string;\n appDescription?: string;\n content?: React.ReactNode;\n}\nexport default function PageAbout(props: AboutPageProps) {\n const { client } = useDecaf();\n const [versionBarista, setVersionBarista] = useState<string | undefined>(undefined);\n\n useEffect(() => {\n client.barista.get<{ version: string }>('/version/').then(({ data }) => setVersionBarista(data.version));\n }, [client]);\n\n return (\n <Space direction=\"vertical\" size=\"middle\" style={{ width: '100%' }}>\n <Descriptions title=\"About\" column={1} bordered style={{ maxWidth: 700, width: '100%' }}>\n <Descriptions.Item label=\"Application Name\">{props.appName}</Descriptions.Item>\n <Descriptions.Item label=\"Application Description\">{props.appDescription}</Descriptions.Item>\n <Descriptions.Item label=\"Application Version\">{`v${props.appVersion}`}</Descriptions.Item>\n <Descriptions.Item label=\"DECAF Barista Version\">{`v${versionBarista}`}</Descriptions.Item>\n </Descriptions>\n {props.content}\n </Space>\n );\n}\n","import { InfoCircleOutlined } from '@ant-design/icons';\nimport { DecafApp, DecafAppConfig, DecafAppController, DecafWebappController } from '@decafhub/decaf-react';\nimport { css, Global } from '@emotion/react';\nimport styled from '@emotion/styled';\nimport 'antd/dist/reset.css';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\nimport React, { useEffect } from 'react';\nimport { createBrowserRouter, RouteObject, RouterProvider } from 'react-router-dom';\nimport { Page401, Page403, Page404, PageError } from './components/Error';\nimport DecafLayout, { DecafMenuItem } from './components/Layout';\nimport PageAbout from './components/PageAbout';\nimport { decafThemeDark, decafThemeLight, ThemeProvider } from './theme';\nimport { useTableMaxHeight } from './utils';\n\nexport type DecafRoute = RouteObject;\n\nexport interface DecafWebappProps {\n config?: DecafAppConfig;\n controller?: DecafAppController;\n /**\n * The theme of the app.\n *\n * Defaults to `dark`.\n */\n theme?: 'dark' | 'light';\n /**\n * The theme config of the app.\n *\n * This will be merged with the default theme config (dark or light).\n *\n * See https://ant.design/docs/react/customize-theme\n */\n themeConfig?: ThemeConfig;\n /**\n * App routes.\n *\n * About page and 404 page will be added automatically.\n *\n * See https://reactrouter.com/en/main/routers/create-browser-router#routes\n */\n routes: DecafRoute[];\n /**\n * App menu.<br />\n * About page will be added automatically.\n */\n menuItems: DecafMenuItem[];\n appName: string;\n appDescription?: string;\n /**\n * The extra content to show on the about page.\n */\n aboutPageContent?: React.ReactNode;\n}\n\nfunction addTo<T>(array: T[], items: T[], key: keyof T): T[] {\n const result: T[] = [...array];\n items.forEach((item) => {\n const index = result.findIndex((r) => r[key] === item[key]);\n if (index >= 0) {\n result[index] = item;\n } else {\n result.push(item);\n }\n });\n return result;\n}\n\nfunction DecafWebapp(props: DecafWebappProps) {\n useEffect(() => {\n // add plausible analytics\n const script = document.createElement('script');\n script.defer = true;\n script.setAttribute('data-domain', location.hostname);\n script.src = 'https://webax.svc.sys.decafhub.com/js/plausible.js';\n document.body.appendChild(script);\n\n return () => {\n document.body.removeChild(script);\n };\n }, []);\n\n let routes = addTo<RouteObject>(\n props.routes,\n [\n {\n path: '/about',\n element: (\n <PageAbout\n appName={props.appName}\n appVersion={props.config?.currentVersion}\n appDescription={props.appDescription}\n content={props.aboutPageContent}\n />\n ),\n },\n { path: '*', element: <Page404 /> },\n ],\n 'path'\n );\n\n const menuWithAboutPage = addTo(\n props.menuItems,\n [\n {\n label: 'About',\n to: '/about',\n icon: <InfoCircleOutlined />,\n },\n ],\n 'to' as any\n );\n\n routes = [\n {\n element: <DecafLayout menu={menuWithAboutPage} appName={props.appName} />,\n path: '/',\n children: routes,\n errorElement: <PageError />,\n },\n ];\n\n const router = createBrowserRouter(routes, {\n basename: props.config?.basePath,\n });\n\n const controller = props.controller || DecafWebappController;\n controller.disableZendeskWidget = true;\n\n return (\n <ThemeProvider themeConfig={props.themeConfig} theme={props.theme}>\n <DecafApp config={props.config} controller={controller}>\n <RouterProvider router={router} />\n </DecafApp>\n </ThemeProvider>\n );\n}\n\nexport {\n DecafWebapp,\n Global as GlobalStyle,\n css,\n styled,\n decafThemeDark,\n decafThemeLight,\n useTableMaxHeight,\n Page401,\n Page403,\n Page404,\n PageError,\n};\n"],"names":["ErrorPageSubtitle","_ref","React","createElement","Fragment","Typography","message","Link","to","Button","style","marginTop","Page401","Result","icon","LockFilled","color","title","subTitle","Page403","status","Page404","PageError","useTableMaxHeight","elementId","bottomSpace","useState","maxHeight","setMaxHeight","w","document","getElementById","useLayoutEffect","calculate","parentPaddingBottom","closestContainer","parentElement","parseFloat","getComputedStyle","paddingBottom","isNaN","getBoundingClientRect","max","window","innerHeight","boundingRect","top","bottomMargin","addEventListener","removeEventListener","lightenDarkenColor","col","amt","usePound","slice","num","parseInt","r","b","g","String","toString","getBaseStyles","theme","_theme$token","_theme$components","_theme$components$Lay","body","background","token","colorBgBase","fontFamily","margin","button","boxShadow","overflow","position","zIndex","right","left","paddingInline","paddingTop","bottom","components","Layout","colorBgHeader","paddingBlock","height","borderRadius","width","display","backgroundColor","_templateObject","MAIN_BLACK","INPUT_BG_COLOR","BORDER_COLORS_TRANSPARENT","colorBorder","colorBorderSecondary","colorBorderBg","decafThemeLight","hashed","algorithm","defaultAlgorithm","colorBgContainer","colorBgLayout","decafThemeDark","boxShadowSecondary","Input","Select","_extends","Checkbox","Dropdown","DatePicker","colorBgElevated","InputNumber","Menu","colorItemText","colorPrimary","green","red","blue","yellow","orange","colorWhite","colorLink","colorLinkHover","colorLinkActive","darkAlgorithm","ThemeContext","createContext","toggleTheme","ThemeProvider","props","_React$useState","localStorage","getItem","value","setValue","themeConfig","globalStyles","getLightStyles","_theme$token2","_theme$token3","_theme$token4","_theme$token5","_theme$token6","_theme$token7","_theme$token8","_theme$token9","_theme$token10","_theme$token11","_theme$components2","_theme$components2$Bu","_theme$token12","_theme$token13","_theme$token14","_theme$token15","getDarkStyles","Provider","t","setItem","ConfigProvider","Global","styles","css","children","useDecafTheme","useContext","Logo","version","id","xmlns","xmlnsXlink","x","y","viewBox","enableBackground","xmlSpace","fill","d","PageScroller","type","size","onClick","scrollTo","behavior","UpOutlined","scrollHeight","DownOutlined","ScreenShotter","handleScreenshot","footer","setProperty","Promise","resolve","html2canvas","canvas","dataUrl","toDataURL","link","download","href","click","remove","e","reject","triggerNode","cloneElement","CameraOutlined","ThemeSwitcher","BulbFilled","onChange","url","parts","split","indexOfWebapps","indexOf","join","VersionSelector","appName","location","appVersion","getAppVersionFromUrl","startsWith","length","isPreviewVersion","isReleaseVersion","versions","code","name","getCurrentAppPath","show","process","env","NODE_ENV","currentVersion","find","v","appVersionCode","placement","arrow","menu","items","filter","map","key","label","className","alignItems","marginRight","CaretUpOutlined","ZENDESK_WIDGET_SCRIPT","ZendeskWidget","useDecaf","me","_useDecaf","publicConfig","open","_useState","setOpen","useEffect","zendesk","script","src","async","onload","zE","appendChild","zESettings","webWidget","offset","horizontal","vertical","contactForm","subject","fields","prefill","fullname","email","removeChild","QuestionCircleOutlined","buildAntMenuFromDecafMenu","routes","result","forEach","route","item","NavLink","end","push","matches","useMatches","useLocation","matchedMenuItems","match","pathname","setTheme","Header","justifyContent","gap","Title","level","border","flex","mode","menuItems","selectedKeys","Content","Outlet","Footer","Row","justify","align","Col","span","textAlign","Text","target","rel","UserOutlined","username","PageAbout","client","undefined","versionBarista","setVersionBarista","barista","get","then","data","Space","direction","Descriptions","column","bordered","maxWidth","Item","appDescription","content","addTo","array","index","findIndex","DecafWebapp","defer","setAttribute","hostname","path","element","_props$config","config","aboutPageContent","menuWithAboutPage","InfoCircleOutlined","DecafLayout","errorElement","router","createBrowserRouter","basename","_props$config2","basePath","controller","DecafWebappController","disableZendeskWidget","DecafApp","RouterProvider"],"mappings":"03BAKA,SAASA,EAAkDC,GACzD,OACEC,EAAAC,cAAAD,EAAAE,SAAA,KACEF,EAACC,cAAAE,EAAY,KAHiBJ,EAAPK,SAIvBJ,EAAAC,cAACI,EAAI,CAACC,GAAG,KACPN,EAAAC,cAACM,EAAM,CAACC,MAAO,CAAEC,UAAW,KAAI,cAIxC,CAEgBC,SAAAA,IACd,OACEV,EAAAC,cAACU,EAAM,CACLC,KAAMZ,EAAAC,cAACY,EAAU,CAACL,MAAO,CAAEM,MAAO,aAClCC,MAAO,uBACPC,SAAUhB,EAA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,OACN,CACE,CACEiE,KAAM,SACNC,QACE1V,EAACC,cAAA8T,GACC,CAAAtG,QAASvF,EAAMuF,QACfE,WAAwB,OAAdgI,EAAEzN,EAAM0N,aAAM,EAAZD,EAAclH,eAC1BsG,eAAgB7M,EAAM6M,eACtBC,QAAS9M,EAAM2N,oBAIrB,CAAEJ,KAAM,IAAKC,QAAS1V,EAAAC,cAACkB,EAAO,QAEhC,QAGqB2U,EAAGb,GACxB/M,EAAM6K,UACN,CACE,CACE3D,MAAO,QACP9O,GAAI,SACJM,KAAMZ,EAACC,cAAA8V,EAAqB,QAGhC,MAGFvE,EAAS,CACP,CACEkE,QAAS1V,EAAAC,cAAC+V,GAAW,CAACjH,KAAM+G,EAAmBrI,QAASvF,EAAMuF,UAC9DgI,KAAM,IACNtL,SAAUqH,EACVyE,aAAcjW,EAACC,cAAAmB,EAAY,QAI/B,IAAM8U,EAASC,EAAoB3E,EAAQ,CACzC4E,SAAU,OAAAlO,EAAAA,EAAM0N,aAAN,EAAAS,EAAcC,WAGpBC,EAAarO,EAAMqO,YAAcC,EAGvC,OAFAD,EAAWE,sBAAuB,EAGhCzW,EAAAC,cAACgI,GAAa,CAACO,YAAaN,EAAMM,YAAa3E,MAAOqE,EAAMrE,OAC1D7D,EAACC,cAAAyW,EAAS,CAAAd,OAAQ1N,EAAM0N,OAAQW,WAAYA,GAC1CvW,EAACC,cAAA0W,GAAeT,OAAQA,KAIhC"}
|
|
1
|
+
{"version":3,"file":"index.module.js","sources":["../src/components/Error.tsx","../src/utils.tsx","../src/theme/-styles.tsx","../src/theme/-theme-context.tsx","../src/theme/-theme-provider.tsx","../src/theme/-theme-hooks.tsx","../src/components/Breadcrumb.tsx","../src/components/DocumentationButton.tsx","../src/components/Logo.tsx","../src/components/Menu.tsx","../src/components/PageScroller.tsx","../src/components/Screenshotter.tsx","../src/components/ThemeSwitcher.tsx","../src/components/UserProfileDropdown.tsx","../src/components/VersionSelector.tsx","../src/components/ZendeskWidget.tsx","../src/components/Layout.tsx","../src/components/PageAbout.tsx","../src/machinery/index.tsx","../src/machinery/-plausible.tsx"],"sourcesContent":["import { LockFilled } from '@ant-design/icons';\nimport { Button, Result, Typography } from 'antd';\nimport React from 'react';\nimport { Link } from 'react-router-dom';\n\nfunction ErrorPageSubtitle({ message }: { message: string }) {\n return (\n <>\n <Typography>{message}</Typography>\n <Link to=\"/\">\n <Button style={{ marginTop: 20 }}>Home Page</Button>\n </Link>\n </>\n );\n}\n\nexport function Page401() {\n return (\n <Result\n icon={<LockFilled style={{ color: '#ff603b' }} />}\n title={'Authentication Error'}\n subTitle={<ErrorPageSubtitle message={'Your credentials are invalid. Please try to log in again.'} />}\n />\n );\n}\n\nexport function Page403() {\n return (\n <Result\n status=\"403\"\n title={'Access Denied'}\n subTitle={<ErrorPageSubtitle message={'You are not authorized to access this content.'} />}\n />\n );\n}\n\nexport function Page404() {\n return (\n <Result\n status=\"404\"\n title={'Page Not Found'}\n subTitle={<ErrorPageSubtitle message={'Sorry, the page you visited does not exist.'} />}\n />\n );\n}\n\nexport function PageError() {\n return (\n <Result\n status=\"500\"\n title={'Error'}\n subTitle={\n <ErrorPageSubtitle\n message={\n 'Something went wrong. Please try again later. If the problem persists, please contact the administrator.'\n }\n />\n }\n />\n );\n}\n","import { DecafClient } from '@decafhub/decaf-client';\nimport Decimal from 'decimal.js';\nimport Cookies from 'js-cookie';\nimport md5 from 'md5';\nimport { useLayoutEffect, useState } from 'react';\n\nconst FOOTER_HEIGHT = 32;\nconst FOOTER_PADDING = 16;\nconst PAGINATION_PADDING = 32;\n\n/**\n * This hook is used to calculate the remaining height of an element.\n * It takes into account the footer height and padding.\n *\n * @param elementId the id of the element to calculate the available height.\n * @returns the remaining height of the element.\n */\nexport function useRemaningHeight(elementId: string): number {\n const [remainingHeight, setRemainingHeight] = useState<number>(0);\n\n useLayoutEffect(() => {\n const e = document.getElementById(elementId);\n\n const calculate = () => {\n if (!e) {\n return;\n }\n\n const elementTop = e.getBoundingClientRect().top;\n const elementHeight = window.innerHeight - elementTop - FOOTER_HEIGHT - FOOTER_PADDING;\n setRemainingHeight(elementHeight);\n };\n\n calculate();\n e?.addEventListener('resize', calculate);\n window.addEventListener('resize', calculate);\n\n return () => {\n window.removeEventListener('resize', calculate);\n e?.removeEventListener('resize', calculate);\n };\n }, [elementId]);\n\n return remainingHeight;\n}\n\n/**\n * This hook is used to calculate the max possible height of a table.\n * It is used to set the height of the table to make it scrollable\n * when the content is too large.\n * @param elementId the id of the element that contains the table.\n * @param bottomSpace extra space to be added to the bottom of the table container.\n * @returns the max height of the table.\n * @example\n * ```tsx\n * const maxHeight = useTableMaxHeight('table-container', 50);\n * return (\n * <Table\n {...tableProps}\n id={'table-container'}\n scroll={{\n x: 'max-content',\n y: maxHeight,\n }}\n />\n* );\n* ```\n**/\nexport function useTableMaxHeight(elementId: string, bottomSpace?: number): string | number {\n const [maxHeight, setMaxHeight] = useState<string | number>(400);\n const remaining = useRemaningHeight(elementId);\n\n const w = document.getElementById(elementId);\n\n useLayoutEffect(() => {\n if (w) {\n const tableWrapper = w?.closest('.ant-table-wrapper');\n const observer = new ResizeObserver(() => {\n const tableHeaderHeight = tableWrapper?.querySelector('.ant-table-header')?.getBoundingClientRect().height ?? 0;\n const tableFooterHeight = tableWrapper?.querySelector('.ant-table-footer')?.getBoundingClientRect().height ?? 0;\n const paginations = tableWrapper?.querySelectorAll('.ant-pagination') ?? [];\n const paginationPaddings = paginations.length * PAGINATION_PADDING;\n const paginationHeights = Array.from(paginations).reduce(\n (acc, cur) => acc + cur.getBoundingClientRect().height,\n 0\n );\n\n const max =\n remaining -\n tableHeaderHeight -\n tableFooterHeight -\n paginationHeights -\n paginationPaddings -\n (bottomSpace || 0);\n\n setMaxHeight(remaining > 350 ? max : '100%');\n });\n\n observer.observe(tableWrapper!, { box: 'content-box' });\n\n return () => {\n observer.disconnect();\n };\n }\n }, [bottomSpace, remaining, w]);\n\n return maxHeight;\n}\n\nexport function lightenDarkenColor(col: string, amt: number) {\n let usePound = false;\n\n if (col[0] === '#') {\n col = col.slice(1);\n usePound = true;\n }\n\n const num = parseInt(col, 16);\n\n let r = (num >> 16) + amt;\n\n if (r > 255) r = 255;\n else if (r < 0) r = 0;\n\n let b = ((num >> 8) & 0x00ff) + amt;\n\n if (b > 255) b = 255;\n else if (b < 0) b = 0;\n\n let g = (num & 0x0000ff) + amt;\n\n if (g > 255) g = 255;\n else if (g < 0) g = 0;\n\n return (usePound ? '#' : '') + String('000000' + (g | (b << 8) | (r << 16)).toString(16)).slice(-6);\n}\n\nexport function logout(client: DecafClient, fromAll?: boolean) {\n client.barista\n .get(`/auth/${fromAll ? 'logoutall' : 'logout'}`, { timeout: 3000 })\n .catch((e) => {\n if (fromAll) {\n console.error(e);\n alert('Failed to logout from all devices. Please try to logout from each device individually.');\n }\n })\n .finally(() => {\n const DECAF_AUTH_COOKIE_NAME = 'ember_simple_auth-session';\n Cookies.remove(DECAF_AUTH_COOKIE_NAME);\n window.location.reload();\n });\n}\n\nexport function getGravatarUrl(email: string): Promise<string | undefined> {\n const url = `https://www.gravatar.com/avatar/${md5(email)}`;\n\n return fetch(`${url}?d=404`, { method: 'HEAD' })\n .then((response) => (response.status !== 200 ? undefined : url))\n .catch(() => undefined);\n}\n\nexport type BooleanMap<T> = { True: T; False: T };\n\nexport function booleanMap<T>(map: BooleanMap<T>): (x: boolean) => T {\n return (x) => (x ? map.True : map.False);\n}\n\nexport type NullableBooleanMap<T> = { Null: T } & BooleanMap<T>;\n\nexport function nullableBooleanMap<T>(map: NullableBooleanMap<T>): (x?: boolean | undefined | null) => T {\n return (x) => (x == null ? map.Null : booleanMap(map)(x));\n}\n\nexport enum Direction {\n Short = -1,\n Square = 0,\n Long = 1,\n}\n\nexport function toDirection(x: number | Decimal | Direction): Direction {\n switch (new Decimal(0).comparedTo(x)) {\n case 1:\n return Direction.Short;\n case 0:\n return Direction.Square;\n case -1:\n return Direction.Long;\n }\n return Direction.Square;\n}\n\nexport type DirectionMap<T> = { Short: T; Square: T; Long: T };\n\nexport function directionMap<T>(map: DirectionMap<T>): (x: number | Decimal | Direction) => T {\n return (x) => {\n switch (toDirection(x)) {\n case Direction.Short:\n return map.Short;\n case Direction.Square:\n return map.Square;\n case Direction.Long:\n return map.Long;\n }\n };\n}\n\nexport function setAtKey<T>(array: T[], items: T[], key: keyof T): T[] {\n const result: T[] = [...array];\n\n items.forEach((item) => {\n const index = result.findIndex((r) => r[key] === item[key]);\n\n if (index >= 0) {\n result[index] = item;\n } else {\n result.push(item);\n }\n });\n\n return result;\n}\n","import { Interpolation, Theme } from '@emotion/react';\nimport { theme } from 'antd';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\nimport { lightenDarkenColor } from '../utils';\n\nconst DARK_BLACK_PRIMARY = '#10161d';\nconst DARK_BLACK_SECONDARY = 'rgb(31, 41, 55)';\nconst DARK_BLACK_ELEVATED = 'rgb(20, 29, 41)';\nconst LIGHT_WHITE_PRIMARY = '#f3f4f6';\nconst LIGHT_WHITE_SECONDARY = 'white';\nconst LIGHT_BLACK_ELEVATED = '#fafbfc';\nconst INPUT_BG_COLOR = '#2c3d50';\nconst BORDER_COLORS_TRANSPARENT = {\n colorBorder: 'transparent',\n colorBorderSecondary: 'transparent',\n colorBorderBg: 'transparent',\n};\n\nexport const decafThemeLight: ThemeConfig = {\n hashed: true,\n algorithm: [theme.defaultAlgorithm],\n components: {\n Layout: {\n colorBgHeader: '#ededed',\n },\n },\n token: {\n borderRadius: 0,\n colorBgContainer: LIGHT_WHITE_SECONDARY,\n colorBgBase: LIGHT_WHITE_PRIMARY,\n colorBgLayout: LIGHT_WHITE_PRIMARY,\n colorBgElevated: LIGHT_BLACK_ELEVATED,\n },\n};\n\nexport const decafThemeDark: ThemeConfig = {\n hashed: true,\n components: {\n Layout: {\n colorBgHeader: DARK_BLACK_PRIMARY,\n },\n Button: {\n boxShadow: 'none',\n boxShadowSecondary: 'none',\n colorBgContainer: INPUT_BG_COLOR,\n },\n Input: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Select: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Checkbox: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Dropdown: {\n ...BORDER_COLORS_TRANSPARENT,\n },\n DatePicker: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n colorBgElevated: INPUT_BG_COLOR,\n },\n InputNumber: {\n ...BORDER_COLORS_TRANSPARENT,\n colorBgContainer: INPUT_BG_COLOR,\n },\n Menu: {\n colorItemText: 'rgba(255, 255, 255, 0.5)',\n },\n },\n token: {\n fontFamily: 'Inter, sans-serif',\n colorPrimary: '#344961',\n colorBgBase: DARK_BLACK_SECONDARY,\n colorBgContainer: DARK_BLACK_PRIMARY,\n colorBgElevated: DARK_BLACK_ELEVATED,\n colorBorderSecondary: DARK_BLACK_SECONDARY,\n colorBorder: DARK_BLACK_SECONDARY,\n colorBgLayout: DARK_BLACK_SECONDARY,\n borderRadius: 0,\n green: '#48734d',\n red: '#b03a38',\n blue: '#0d6efd',\n yellow: '#ffc107',\n orange: '#fd7e14',\n colorWhite: '#fff',\n colorLink: '#a4bfff',\n colorLinkHover: '#7199fb',\n colorLinkActive: '#7199fb',\n },\n\n algorithm: [theme.darkAlgorithm],\n};\n\nfunction getBaseStyles(theme: ThemeConfig): Interpolation<Theme> {\n const menuOverride = {\n color: `white !important`,\n ':after': {\n borderBottomColor: 'white',\n },\n };\n\n return {\n body: {\n background: theme.token?.colorBgBase,\n fontFamily: 'Inter, sans-serif',\n margin: 0,\n },\n '#root': {\n minHeight: '100%',\n },\n button: {\n boxShadow: 'none !important',\n },\n '.ant-table-body': {\n overflow: 'auto !important',\n },\n '#decaf-header': {\n position: 'fixed',\n zIndex: 999,\n right: 0,\n left: 0,\n paddingInline: 16,\n display: 'flex',\n alignItems: 'center',\n },\n '#decaf-content': {\n paddingTop: 64,\n paddingBottom: 32,\n '#decaf-layout-breadcrumb': {\n backgroundColor: theme.token?.colorBgElevated,\n display: 'flex',\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n width: '100%',\n height: 50,\n paddingInline: 16,\n boxShadow: '0px 1px 2px rgba(0, 0, 0, 0.10)',\n ...breadcrumbStyles(),\n },\n '#decaf-layout-content-outlet': {\n minHeight: '100%',\n padding: 16,\n '&.full-screen': {\n padding: '0 !important',\n },\n },\n },\n '#decaf-footer': {\n position: 'fixed',\n bottom: 0,\n right: 0,\n left: 0,\n paddingBlock: 0,\n paddingInline: 0,\n zIndex: 999,\n boxShadow: '0px -2px 4px rgba(0, 0, 0, 0.15)',\n backgroundColor: decafThemeDark.components?.Layout?.colorBgHeader,\n },\n '.dot': {\n borderRadius: '50%',\n width: 10,\n height: 10,\n display: 'inline-block',\n backgroundColor: 'rgba(255,255,255,.25)',\n '&.green': {\n backgroundColor: `#80ff00 !important`,\n },\n '&.yellow': {\n backgroundColor: `#ff0 !important`,\n },\n '&.orange': {\n backgroundColor: `#ff7000 !important`,\n },\n '&.red': {\n backgroundColor: `#ff0000 !important`,\n },\n },\n '.ant-menu-light.ant-menu-horizontal >.ant-menu-item-selected': menuOverride,\n '.ant-menu-light.ant-menu-horizontal >.ant-menu-submenu-selected, .ant-menu-light .ant-menu-submenu-selected >.ant-menu-submenu-title':\n menuOverride,\n };\n}\n\nexport function getLightStyles(theme: ThemeConfig): Interpolation<Theme> {\n const baseStyles = getBaseStyles(theme) as any;\n\n return {\n ...(baseStyles as any),\n };\n}\n\nexport function getDarkStyles(theme: ThemeConfig): Interpolation<Theme> {\n const baseStyles = getBaseStyles(theme) as any;\n\n return {\n ...baseStyles,\n '*': {\n '&::-webkit-scrollbar': {\n width: 10,\n height: 10,\n },\n '&::-webkit-scrollbar-track': {\n background: theme.token?.colorBgContainer,\n },\n '&::-webkit-scrollbar-thumb': {\n background: theme.token?.colorPrimary,\n },\n },\n '.ant-page-header-back-button, .ant-page-header-heading-title': {\n color: `${theme.token?.colorWhite} !important`,\n },\n '.ant-badge-count': {\n color: `${theme.token?.colorWhite} !important`,\n },\n '.ant-table-thead > tr > th': {\n background: `${lightenDarkenColor(theme.token?.colorBgContainer || '', -5)} !important`,\n '&:hover': {\n background: `${theme.token?.colorBgContainer} !important`,\n },\n },\n '.ant-table-filter-dropdown': {\n 'input, .ant-table-filter-dropdown-search-input': {\n background: `${theme.token?.colorBgBase} !important`,\n },\n '.ant-dropdown-menu-item, .ant-dropdown-menu': {\n background: `${theme.token?.colorBgContainer} !important`,\n },\n },\n '.ant-tabs-tab-active': {\n '.ant-tabs-tab-btn': {\n color: `${theme.token?.colorWhite} !important`,\n },\n },\n '.ant-radio-button-wrapper-checked': {\n backgroundColor: `${theme.components?.Button?.colorBgContainer} !important`,\n color: `${theme.token?.colorWhite} !important`,\n },\n '.ant-picker-date-panel': {\n '.ant-picker-cell-in-range, .ant-picker-cell-range-start, .ant-picker-cell-range-end': {\n '&::before': {\n background: `${theme.token?.colorBgBase} !important`,\n },\n '.ant-picker-cell-inner': {\n background: `${theme.token?.colorBgBase} !important`,\n },\n },\n '.ant-picker-cell-range-start, .ant-picker-cell-range-end': {\n '.ant-picker-cell-inner': {\n background: `${theme.token?.colorPrimary} !important`,\n },\n },\n },\n };\n}\n\nfunction breadcrumbStyles() {\n const getCrumbColor = (theme: 'dark' | 'light') => {\n const colorBase = theme === 'dark' ? '255, 255, 255' : '0, 0, 0';\n return {\n color: `rgba(${colorBase}, 0.5) !important`,\n '&:hover': {\n color: `rgba(${colorBase}, 0.75) !important`,\n },\n };\n };\n\n const darkColors = {\n ...getCrumbColor('dark'),\n '&:last-child': {\n color: 'rgba(255, 255, 255, 0.85) !important',\n },\n };\n\n const lightColors = {\n ...getCrumbColor('light'),\n '&:last-child': {\n color: 'rgba(0, 0, 0, 0.85) !important',\n },\n };\n\n return {\n '.decaf-breadcrumb': {\n display: 'flex',\n alignItems: 'center',\n listStyle: 'none',\n margin: 0,\n padding: 0,\n '>li': {\n '&.separator': {\n paddingInline: 3,\n marginInline: 3,\n },\n 'a, span': {\n ...getCrumbColor('light'),\n },\n display: 'flex',\n alignItems: 'center',\n transition: 'color 0.2s',\n ...lightColors,\n },\n '&.dark': {\n '>li': {\n 'a, span': {\n ...getCrumbColor('dark'),\n },\n ...darkColors,\n },\n },\n },\n };\n}\n","import React from 'react';\n\nexport interface ThemeContextProps {\n theme: 'dark' | 'light';\n toggleTheme: () => void;\n}\n\nexport const ThemeContext = React.createContext<ThemeContextProps>({\n theme: 'dark',\n toggleTheme: () => {},\n});\n","import { css, Global } from '@emotion/react';\nimport { ConfigProvider } from 'antd';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\nimport React from 'react';\nimport { decafThemeDark, decafThemeLight, getDarkStyles, getLightStyles } from './-styles';\nimport { ThemeContext } from './-theme-context';\n\nexport interface ThemeProviderProps {\n children: React.ReactNode;\n themeConfig?: ThemeConfig;\n theme?: 'dark' | 'light';\n}\n\nexport function ThemeProvider(props: ThemeProviderProps) {\n const [value, setValue] = React.useState<'dark' | 'light'>(() => {\n const theme = props.theme || localStorage.getItem('decafAppTheme');\n if (theme === 'dark' || theme === 'light') {\n return theme;\n }\n return 'dark';\n });\n\n function setTheme() {\n const t = value === 'dark' ? 'light' : 'dark';\n setValue(t);\n localStorage.setItem('decafAppTheme', t);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n let theme = value === 'light' ? decafThemeLight : decafThemeDark;\n theme = { ...theme, ...(props.themeConfig || {}) };\n theme = { ...theme, token: { ...theme.token, fontFamily: 'Inter, sans-serif' } };\n\n const globalStyles = value === 'light' ? getLightStyles(theme) : getDarkStyles(theme);\n\n return (\n <ThemeContext.Provider\n value={{\n theme: value,\n toggleTheme: setTheme,\n }}\n >\n <ConfigProvider theme={theme}>\n <Global\n styles={css`\n @import url(https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap);\n `}\n />\n <Global styles={globalStyles} />\n\n {props.children}\n </ConfigProvider>\n </ThemeContext.Provider>\n );\n}\n","import React from 'react';\nimport { ThemeContext } from './-theme-context';\n\nexport const useDecafTheme = () => React.useContext(ThemeContext);\n","import { DownOutlined, RightOutlined } from '@ant-design/icons';\nimport { Dropdown, Grid } from 'antd';\nimport React, { ReactNode } from 'react';\nimport { Link } from 'react-router-dom';\nimport { useDecafTheme } from 'theme';\n\nexport interface BreadcrumbItem {\n title: ReactNode;\n href?: string;\n children?: { title: ReactNode; href?: string }[];\n}\n\nexport interface BreadcrumbProps {\n items: BreadcrumbItem[];\n itemRender?: (item: BreadcrumbItem) => ReactNode;\n separator?: ReactNode;\n}\n\nexport function Breadcrumb(props: BreadcrumbProps) {\n const { items, itemRender, separator } = props;\n const { theme } = useDecafTheme();\n const breakpoints = Grid.useBreakpoint();\n\n const firstAndLAst = items.slice(0, 1).concat(items.slice(-1));\n const _items = breakpoints.lg ? items : firstAndLAst;\n\n return (\n <ul className={`decaf-breadcrumb ${theme}`}>\n {renderBreadcrumbs(_items, separator || <RightOutlined />, itemRender)}\n </ul>\n );\n}\n\nfunction renderBreadcrumbs(\n items: BreadcrumbItem[],\n separator: ReactNode,\n itemRender?: (item: BreadcrumbItem) => ReactNode\n) {\n const result: ReactNode[] = [];\n\n items.forEach((item, i) => {\n const isLast = i === items.length - 1;\n\n if (item.href && !isLast) {\n result.push(\n <li key={i}>\n {itemRender ? (\n itemRender(item)\n ) : (\n <Link className=\"decaf-breadcrumb-link\" to={item.href}>\n {item.title}\n </Link>\n )}\n </li>\n );\n } else if (item.children) {\n const dmenu = item.children.map((child, j) => ({\n key: j,\n label: (\n <Link className=\"decaf-breadcrumb-link\" to={child.href!}>\n {child.title}\n </Link>\n ),\n }));\n\n result.push(\n <li key={i}>\n <Dropdown menu={{ items: dmenu }}>\n <div style={{ display: 'flex', cursor: 'pointer', gap: 3 }}>\n <span>{item.title}</span>\n <DownOutlined style={{ fontSize: 12 }} />\n </div>\n </Dropdown>\n </li>\n );\n } else {\n result.push(<li key={i}>{item.title}</li>);\n }\n if (i < items.length - 1) {\n result.push(\n <li key={`sep-${i}`} className=\"separator\">\n {separator}\n </li>\n );\n }\n });\n\n return result;\n}\n","import { QuestionCircleOutlined } from '@ant-design/icons';\nimport { Button, Grid, theme } from 'antd';\nimport React from 'react';\n\nexport default function DocumentationButton() {\n const { token } = theme.useToken();\n const breakpoints = Grid.useBreakpoint();\n\n return (\n <Button\n type=\"link\"\n href=\"https://docs.decafhub.com\"\n target=\"_blank\"\n rel=\"noreferrer\"\n icon={<QuestionCircleOutlined />}\n style={{ backgroundColor: token.colorBgElevated }}\n >\n {!breakpoints.xs && 'Documentation'}\n </Button>\n );\n}\n","import React from 'react';\n\nexport default function Logo() {\n return (\n <svg\n version=\"1.1\"\n id=\"Layer_1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlnsXlink=\"http://www.w3.org/1999/xlink\"\n x=\"0px\"\n y=\"0px\"\n viewBox=\"0 0 649.6 767.9\"\n enableBackground={'new 0 0 649.6 767.9'}\n xmlSpace=\"preserve\"\n width={32}\n height={32}\n >\n <g>\n <path\n fill=\"#52CEF4\"\n d=\"M324,767.9c-6.6-5.1-14.2-8.6-21.3-12.9c-22-13-44.3-25.6-66.4-38.5c-21.3-12.4-42.5-25-63.8-37.4\n c-33.5-19.5-67.1-39-100.7-58.5c-22.7-13.2-45.3-26.5-68-39.6c-2.8-1.6-3.8-3.3-3.8-6.5c0.2-58.6-0.2-117.3,0.4-175.9\n C1,333,0.7,267.3,1,201.6c0-1.8-0.6-3.7,0.6-5.4c6.4,3.8,12.7,7.6,19.1,11.3c23.8,13.9,47.7,27.9,71.5,41.8\n c4.9,2.9,9.6,6.2,14.9,8.4c-1.2,5.2-0.2,10.3-0.1,15.5c0.5,56.1-0.2,112.2,0.9,168.3c0.3,18.4,0.2,36.8,0.2,55.2\n c0,3,0.7,4.9,3.5,6.4c6.3,3.4,12.3,7.3,18.5,11c26.1,15.7,52.3,31.5,78.4,47.2c33,19.8,66,39.6,99,59.3c5.7,3.4,10.9,7.5,17.2,9.7\n c0,1.5,0.1,2.9,0.1,4.4c0,42.4,0,84.8,0,127.3c0,1.8-0.7,3.7,0.8,5.3c0,0.2,0,0.4,0,0.7C325.1,767.9,324.5,767.9,324,767.9z\"\n />\n <path\n fill=\"#227EC3\"\n d=\"M107.1,257.6c-5.3-2.2-10-5.5-14.9-8.4c-23.8-13.9-47.7-27.8-71.5-41.8c-6.4-3.7-12.7-7.6-19.1-11.3\n c8.2-6,17.1-10.7,25.7-16c28.7-17.5,57.5-34.9,86.3-52.4c39.2-23.8,78.5-47.6,117.7-71.4c27-16.3,53.9-32.7,80.9-49\n c4-2.4,8.1-4.6,11.7-7.4c1.3,0,2.7,0,4,0c0.3,1.6,1.9,1.8,2.9,2.4c31,18.9,62,37.8,93.1,56.4c4.2,2.5,5.9,5.2,5.9,10.3\n c-0.3,38.3-0.1,76.7-0.1,115c0,2.7-0.1,5.3-0.2,8c-10.5-6.3-21-12.5-31.4-18.9c-23.1-14-46.2-28-69.3-42c-1.6-1-2.8-1.6-5-0.4\n c-26.8,15.8-53.7,31.5-80.6,47.2c-26.1,15.2-52.2,30.4-78.3,45.7C145.7,235,126.4,246.3,107.1,257.6z\"\n />\n <path\n fill=\"#409DD5\"\n d=\"M324.7,630.2c5.2-4.2,11-7.4,16.7-10.9c32.6-20.3,65.3-40.6,98-60.8c30.8-19,61.6-38,92.4-57\n c7.5-4.6,7.5-4.6,7.5-13.6c0-58.6,0.1-117.3,0.1-175.9c0-1.6-0.1-3.2-0.1-4.8c0.8-1.5,0.4-3.1,0.4-4.7c0.1-14.7,0.2-29.5,0.3-44.2\n c1.3,0.1,2.4-0.4,3.4-1c8.7-5.1,17.4-10.2,26.1-15.3c15.8-9.2,31.7-18.3,47.6-27.5c10.5-6.1,21.1-12.3,31.6-18.4\n c1.5,0.9,0.8,2.4,0.8,3.6c0,124.2,0,248.4,0.1,372.6c0,2.7-0.9,4-3.1,5.3c-35.3,20.8-70.5,41.7-105.8,62.6\n c-27.2,16.1-54.5,32.2-81.7,48.4c-27,16-54,32.1-81,48c-17.4,10.3-34.8,20.4-52.3,30.7c-1.5-1.6-0.8-3.5-0.8-5.3\n c0-42.4,0-84.8,0-127.3C324.8,633.2,324.7,631.7,324.7,630.2z\"\n />\n <path\n fill=\"#227EC3\"\n d=\"M648.7,196.1c-10.5,6.1-21,12.3-31.6,18.4c-15.8,9.2-31.7,18.3-47.6,27.5c-8.7,5.1-17.4,10.2-26.1,15.3\n c-1,0.6-2.1,1.1-3.4,1c0-12.4-0.1-24.8-0.1-37.2c0-30.2,0-60.5,0-91c2.8,0.3,4.5,2,6.5,3.1c28.4,17.3,56.8,34.7,85.2,52\n C637.3,188.8,643.4,191.8,648.7,196.1z\"\n />\n <path\n fill=\"#227EC3\"\n d=\"M216.2,322.3c-0.3-1.6-0.4-2.9,1.4-4c29.2-18,58.4-36.1,87.5-54.1c4.7-2.9,9.5-5.8,14.2-8.9\n c1.5-1,2.7-1.1,4.3-0.2c26.9,15.9,53.8,31.8,80.7,47.7c7.1,4.2,14.1,8.5,21.4,12.4c3.5,1.9,4.8,4.3,3.9,8c-1.7,1.1-3.3,2.2-5,3.2\n c-20.5,11.9-41.1,23.8-61.6,35.7c-13,7.6-26.1,15.2-39.1,22.8c-7-4-14-8.1-21-12.1c-21.7-12.7-43.2-25.5-65-38\n C230.7,330.5,223.8,325.8,216.2,322.3z\"\n />\n <path\n fill=\"#52CEF4\"\n d=\"M216.2,322.3c7.6,3.5,14.5,8.2,21.8,12.4c21.7,12.5,43.3,25.3,65,38c7,4.1,14,8.1,21,12.1\n c0,39.3,0.1,78.6,0.1,117.9c-1.5,0.9-2.5-0.4-3.6-1c-21.3-12.8-42.5-25.5-63.7-38.3c-13.3-8-26.5-16.1-39.8-24\n c-1.8-1.1-2.5-2.3-2.5-4.4c0.4-26.9,0.4-53.8,1.1-80.7C215.8,343.6,215.4,332.9,216.2,322.3z\"\n />\n <path\n fill=\"#409DD5\"\n d=\"M324,502.6c0-39.3-0.1-78.6-0.1-117.9c13-7.6,26.1-15.2,39.1-22.8c20.5-11.9,41.1-23.8,61.6-35.7\n c1.7-1,3.3-2.1,5-3.2c0.1,7.6,0.1,15.2,0.1,22.8c0,30.5,0,61,0,91.5c0,2.6-0.4,4.4-2.9,5.8c-31.6,18.2-63,36.5-94.5,54.8\n C329.6,499.6,327.2,501.8,324,502.6z\"\n />\n </g>\n </svg>\n );\n}\n","import { EllipsisOutlined, MenuOutlined } from '@ant-design/icons';\nimport { Drawer, Grid, Menu, Typography } from 'antd';\nimport { ItemType, SubMenuType } from 'antd/es/menu/hooks/useItems';\nimport React, { useEffect } from 'react';\nimport { NavLink, useLocation, useMatches } from 'react-router-dom';\nimport { DecafMenuItem } from '../types';\n\nfunction buildAntMenuFromDecafMenu(routes: DecafMenuItem[]): ItemType[] {\n const result: ItemType[] = [];\n\n routes.forEach((route) => {\n const item: ItemType = {\n key: 'to' in route ? route.to : route.label,\n label: route.label,\n icon: route.icon,\n };\n\n if ('to' in route && route.to) {\n item.label = (\n <NavLink to={route.to} end={route.to === '/'}>\n {route.label}\n </NavLink>\n );\n } else if ('href' in route && route.href) {\n item.label = <a href={route.href}>{route.label}</a>;\n } else if (route.children) {\n item.label = route.label;\n (item as SubMenuType).children = buildAntMenuFromDecafMenu(route.children || []);\n }\n\n result.push(item);\n });\n\n return result;\n}\n\nexport function DecafPoweredBy() {\n return (\n <Typography.Text type=\"secondary\">\n Powered by{' '}\n <a href=\"https://teloscube.com\" target=\"_blank\" rel=\"noreferrer\">\n Teloscube\n </a>\n </Typography.Text>\n );\n}\n\nexport interface MenuProps {\n title: string;\n menu: DecafMenuItem[];\n}\n\nexport default function DecafMenu(props: MenuProps) {\n const [drawerOpen, setDrawerOpen] = React.useState(false);\n const matches = useMatches();\n const location = useLocation();\n const { md } = Grid.useBreakpoint();\n\n const menuItems = buildAntMenuFromDecafMenu(props.menu);\n const matchedMenuItems = matches\n .map((match) => match.pathname)\n .filter((pathname) => (location.pathname !== '/' ? pathname !== '/' : true)); // WORKAROUND: the root path always matches. We don't want that.\n\n useEffect(() => {\n if (!md) {\n setDrawerOpen(false);\n }\n }, [location.pathname, md]);\n\n const menu = (\n <Menu\n items={[...menuItems]}\n selectedKeys={matchedMenuItems}\n mode={md ? 'horizontal' : 'inline'}\n overflowedIndicator={<EllipsisOutlined style={{ fontSize: 20, color: 'white' }} />}\n style={{ flex: 'auto', justifyContent: 'flex-end', backgroundColor: 'transparent', border: 'none', minWidth: 0 }}\n />\n );\n\n if (md) {\n return menu;\n }\n\n return (\n <div style={{ display: 'flex', flex: 'auto', justifyContent: 'flex-end' }}>\n <MenuOutlined style={{ fontSize: 20, marginRight: 20 }} onClick={() => setDrawerOpen(!drawerOpen)} />\n\n <Drawer\n open={drawerOpen}\n footer={<DecafPoweredBy />}\n onClose={() => setDrawerOpen(false)}\n bodyStyle={{ padding: 10 }}\n width={document.body.clientWidth - 50 > 350 ? 350 : document.body.clientWidth * 0.85}\n >\n {menu}\n </Drawer>\n </div>\n );\n}\n","import { DownOutlined, UpOutlined } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport React from 'react';\n\nexport default function PageScroller() {\n return (\n <div style={{ display: 'flex' }}>\n <Button\n type=\"text\"\n icon={<UpOutlined />}\n title=\"Scroll to top\"\n onClick={() => window.scrollTo({ top: 0, behavior: 'smooth' })}\n />\n <Button\n type=\"text\"\n icon={<DownOutlined />}\n title=\"Scroll to bottom\"\n onClick={() => window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' })}\n />\n </div>\n );\n}\n","import { CameraOutlined } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport html2canvas from 'html2canvas';\nimport React from 'react';\n\nexport interface ScreenShotterProps {\n triggerNode?: React.ReactNode;\n}\n\nexport default function ScreenShotter(props: ScreenShotterProps) {\n async function handleScreenshot() {\n // hide footer before taking screenshot\n const footer = document.getElementById('decaf-footer');\n footer?.style.setProperty('display', 'none');\n\n const canvas = await html2canvas(document.body);\n const dataUrl = canvas.toDataURL('image/png');\n\n // show footer after taking screenshot\n footer?.style.setProperty('display', 'block');\n\n const link = document.createElement('a');\n link.download = 'screenshot.png';\n link.href = dataUrl;\n link.click();\n link.remove();\n }\n\n if (props.triggerNode) {\n return React.cloneElement(props.triggerNode as React.ReactElement, {\n onClick: handleScreenshot,\n });\n }\n\n return (\n <Button\n type=\"text\"\n icon={<CameraOutlined />}\n title=\"Take a screenshot of the current page\"\n onClick={handleScreenshot}\n />\n );\n}\n","import { BulbFilled, BulbOutlined } from '@ant-design/icons';\nimport { Button } from 'antd';\nimport React from 'react';\n\ninterface ThemeSwitcherProps {\n theme: 'dark' | 'light';\n onChange: () => void;\n}\nexport default function ThemeSwitcher(props: ThemeSwitcherProps) {\n return (\n <Button\n type=\"text\"\n icon={props.theme === 'dark' ? <BulbFilled /> : <BulbOutlined />}\n title={props.theme === 'dark' ? 'Switch to light theme' : 'Switch to dark theme'}\n onClick={() => props.onChange()}\n />\n );\n}\n","import { InfoCircleOutlined, LogoutOutlined, UserOutlined } from '@ant-design/icons';\nimport { useDecaf } from '@decafhub/decaf-react';\nimport { Avatar, Dropdown } from 'antd';\nimport React, { useEffect, useState } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { getGravatarUrl, logout } from '../utils';\n\nexport function UserProfileDropdown() {\n const [gravatar, setGravatar] = useState<string | undefined>(undefined);\n const decaf = useDecaf();\n const navigate = useNavigate();\n\n useEffect(() => {\n if (!decaf.me.email) {\n return;\n }\n\n getGravatarUrl(decaf.me.email).then(setGravatar);\n }, [decaf.me.email]);\n\n const doLogout = () => logout(decaf.client, false);\n const doLogoutAll = () => window.confirm('Logout from all sessions?') && logout(decaf.client, true);\n const doGoToAbout = () => navigate('/about');\n\n const items = [\n {\n key: 'me',\n label: decaf.me.fullname || decaf.me.username,\n title: decaf.me.email,\n disabled: true,\n icon: <UserOutlined />,\n style: { cursor: 'default' },\n },\n { key: 'divider-1', dashed: true, type: 'divider' },\n { key: 'logout', label: 'Logout', icon: <LogoutOutlined />, onClick: doLogout },\n { key: 'logout-all', label: 'Logout All Sessions', icon: <LogoutOutlined />, onClick: doLogoutAll },\n { key: 'divider-2', dashed: true, type: 'divider' },\n { key: 'about', label: 'About', icon: <InfoCircleOutlined />, onClick: doGoToAbout },\n ];\n\n const propsAvatar: any = gravatar\n ? { src: gravatar }\n : {\n icon: <UserOutlined style={{ color: 'rgba(255,255,255, 0.5)' }} />,\n style: { backgroundColor: 'transparent', border: '1px solid rgba(255,255,255, 0.5)' },\n };\n\n return (\n <Dropdown trigger={['click']} menu={{ items }}>\n <Avatar {...propsAvatar} style={{ ...propsAvatar.style, cursor: 'pointer' }} />\n </Dropdown>\n );\n}\n","import { CaretUpOutlined } from '@ant-design/icons';\nimport { Button, Dropdown, Grid } from 'antd';\nimport React from 'react';\n\ntype VersionCode = 'production' | 'staging' | 'testing' | 'development' | 'preview' | 'release';\n\nexport type Version = {\n code: VersionCode;\n name: string;\n color: string;\n url: string;\n show: boolean;\n};\n\nfunction getAppNameFromUrl(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts[indexOfWebapps + 1];\n }\n}\n\nfunction getAppVersionFromUrl(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts[indexOfWebapps + 2];\n }\n}\n\nfunction isPreviewVersion(version: string) {\n return version.startsWith('preview-') && version.length > 8;\n}\n\nfunction isReleaseVersion(version: string) {\n return version.startsWith('v') && version.length > 1;\n}\n\nfunction getAppVersionCode(version: string) {\n if (isPreviewVersion(version)) {\n return 'preview';\n } else if (isReleaseVersion(version)) {\n return 'release';\n } else {\n return version;\n }\n}\n\nfunction getCurrentAppPath(url: string) {\n const parts = url.split('/');\n const indexOfWebapps = parts.indexOf('webapps');\n if (indexOfWebapps === -1) {\n return '';\n } else {\n return parts.slice(indexOfWebapps + 3).join('/');\n }\n}\n\nexport default function VersionSelector() {\n const appName = getAppNameFromUrl(window.location.href);\n const appVersion = getAppVersionFromUrl(window.location.href); // development, staging, preview-123, v1.0.0\n const appVersionCode = getAppVersionCode(appVersion); // development, staging, preview, release\n const { md } = Grid.useBreakpoint();\n\n const versions: Version[] = [\n {\n code: 'development',\n name: 'Development Version',\n color: 'red',\n url: `/webapps/${appName}/development/${getCurrentAppPath(window.location.href)}`,\n show: process.env.NODE_ENV === 'development',\n },\n {\n code: 'testing',\n name: 'Testing Version',\n color: 'orange',\n url: `/webapps/${appName}/testing/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'staging',\n name: 'Staging Version',\n color: 'yellow',\n url: `/webapps/${appName}/staging/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'production',\n name: 'Production Version',\n color: 'green',\n url: `/webapps/${appName}/production/${getCurrentAppPath(window.location.href)}`,\n show: true,\n },\n {\n code: 'preview',\n name: 'Preview Version',\n color: 'grey',\n url: `/`,\n show: false,\n },\n {\n code: 'release',\n name: 'Release Version',\n color: 'grey',\n url: `/`,\n show: false,\n },\n ];\n\n const currentVersion = versions.find((v) => v.code === appVersionCode);\n const isProd = currentVersion?.code === 'production';\n\n if (!currentVersion) {\n return null;\n }\n\n return (\n <Dropdown\n placement=\"top\"\n arrow\n menu={{\n items: versions\n .filter((v) => v.show)\n .map((version) => ({\n key: version.name,\n label: (\n <span>\n <i className={`dot ${version.color}`} /> {version.name}\n </span>\n ),\n onClick: () => {\n window.location.href = version.url;\n },\n })),\n }}\n >\n <Button\n type=\"text\"\n style={{\n width: isProd ? 32 : 'initial',\n padding: isProd ? 0 : 'revert',\n display: 'flex',\n alignItems: 'center',\n }}\n icon={<i className={`dot ${currentVersion?.color}`} />}\n >\n <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}>\n {!isProd && md && (\n <>\n <span style={{ marginInline: 5 }}>\n You are on <b>{currentVersion.name}</b>\n </span>\n <CaretUpOutlined />\n </>\n )}\n </div>\n </Button>\n </Dropdown>\n );\n}\n","import { MessageOutlined } from '@ant-design/icons';\nimport { useDecaf } from '@decafhub/decaf-react';\nimport { Button, Grid, theme } from 'antd';\nimport React, { useEffect, useState } from 'react';\n\nconst ZENDESK_WIDGET_SCRIPT = 'https://static.zdassets.com/ekr/snippet.js';\n\ndeclare global {\n // eslint-disable-next-line no-unused-vars\n interface Window {\n zE: any;\n zESettings: any;\n }\n}\n\nexport default function ZendeskWidget() {\n const { me, publicConfig } = useDecaf();\n const [open, setOpen] = useState(false);\n const { token } = theme.useToken();\n const breakpoints = Grid.useBreakpoint();\n\n useEffect(() => {\n if (!publicConfig.zendesk || typeof document === 'undefined') return;\n const script = document.createElement('script');\n script.src = ZENDESK_WIDGET_SCRIPT + '?key=' + publicConfig.zendesk;\n script.async = true;\n script.id = 'ze-snippet'; // do not change this. zendesk expects this to be ze-snippet\n script.onload = () => {\n window.zE('webWidget', 'hide');\n window.zE('webWidget:on', 'open', () => {\n window.zE('webWidget', 'show');\n setOpen(true);\n });\n window.zE('webWidget:on', 'close', () => {\n window.zE('webWidget', 'hide');\n setOpen(false);\n });\n };\n\n document.body.appendChild(script);\n window.zESettings = {\n webWidget: {\n offset: {\n horizontal: -7,\n vertical: 20,\n },\n },\n contactForm: {\n subject: true,\n fields: [\n {\n id: 'name',\n prefill: { '*': me.fullname },\n },\n {\n id: 'email',\n prefill: { '*': me.email },\n },\n ],\n },\n };\n\n return () => {\n document.body.removeChild(script);\n };\n }, [publicConfig, me]);\n\n function toggle() {\n if (open) {\n window.zE?.('webWidget', 'close');\n } else {\n window.zE?.('webWidget', 'open');\n }\n setOpen(!open);\n }\n\n if (!publicConfig.zendesk) return null;\n\n return (\n <Button type=\"link\" icon={<MessageOutlined />} style={{ backgroundColor: token.colorBgElevated }} onClick={toggle}>\n {!breakpoints.xs && 'Support'}\n </Button>\n );\n}\n","import { HomeOutlined } from '@ant-design/icons';\nimport { useNProgress } from '@tanem/react-nprogress';\nimport { Col, ConfigProvider, Grid, Layout, Row, Typography } from 'antd';\nimport React from 'react';\nimport { Link, Outlet, useLocation, useMatches, useNavigation } from 'react-router-dom';\nimport { decafThemeDark, useDecafTheme } from '../theme';\nimport { DecafMenuItem } from '../types';\nimport { Breadcrumb, BreadcrumbItem } from './Breadcrumb';\nimport DocumentationButton from './DocumentationButton';\nimport Logo from './Logo';\nimport DecafMenu, { DecafPoweredBy } from './Menu';\nimport PageScroller from './PageScroller';\nimport ScreenShotter from './Screenshotter';\nimport ThemeSwitcher from './ThemeSwitcher';\nimport { UserProfileDropdown } from './UserProfileDropdown';\nimport VersionSelector from './VersionSelector';\nimport ZendeskWidget from './ZendeskWidget';\n\nexport interface DecafLayoutProps {\n menu: DecafMenuItem[];\n appName: string;\n}\n\nexport default function DecafLayout(props: DecafLayoutProps) {\n const location = useLocation();\n const navigation = useNavigation();\n const matches: any = useMatches();\n const breakpoints = Grid.useBreakpoint();\n const { theme: currentTheme, toggleTheme: setCurrentTheme } = useDecafTheme();\n const match = matches?.[matches?.length - 1];\n const isFullScreen = !!match?.handle.fullScreen;\n const extras: React.ReactNode | undefined = match?.handle.extras;\n\n return (\n <Layout style={{ height: '100%' }}>\n <DecafLayoutProgress isAnimating={navigation.state === 'loading'} key={location.key} />\n\n <ConfigProvider theme={decafThemeDark}>\n <Layout.Header id=\"decaf-header\">\n <DecafLayoutBrand title={props.appName} />\n <DecafMenu title={props.appName} menu={props.menu} />\n <UserProfileDropdown />\n </Layout.Header>\n </ConfigProvider>\n\n <Layout.Content id=\"decaf-content\" style={{ flex: 1, minHeight: '100%' }}>\n <DecafLayoutBreadcrumb>{extras}</DecafLayoutBreadcrumb>\n\n <div id=\"decaf-layout-content-outlet\" className={isFullScreen ? 'full-screen' : ''}>\n <Outlet />\n </div>\n </Layout.Content>\n\n <ConfigProvider theme={decafThemeDark}>\n <Layout.Footer id=\"decaf-footer\">\n <Row justify=\"space-between\" align={'middle'}>\n <Col span={breakpoints.lg ? 10 : 12}>\n <ZendeskWidget />\n <span style={{ display: 'inline-block', width: 1 }} />\n <DocumentationButton />\n </Col>\n\n <Col span={breakpoints.lg ? 4 : 0} style={{ textAlign: 'center' }}>\n <DecafPoweredBy />\n </Col>\n\n <Col span={breakpoints.lg ? 10 : 12} style={{ justifyContent: 'flex-end', display: 'flex', gap: 10 }}>\n <VersionSelector />\n <ThemeSwitcher theme={currentTheme} onChange={setCurrentTheme} />\n <ScreenShotter />\n <PageScroller />\n </Col>\n </Row>\n </Layout.Footer>\n </ConfigProvider>\n </Layout>\n );\n}\n\nexport function DecafLayoutBrand({ title }: { title: string }) {\n const breakpoints = Grid.useBreakpoint();\n\n return (\n <Link to=\"/\" style={{ display: 'flex', alignItems: 'center', gap: 10 }}>\n <Logo />\n\n {breakpoints.lg && (\n <Typography.Title\n level={1}\n style={{\n margin: 0,\n fontWeight: 'normal',\n fontSize: 20,\n color: 'rgba(255, 255, 255, 0.75)',\n whiteSpace: 'nowrap',\n }}\n >\n {title}\n </Typography.Title>\n )}\n </Link>\n );\n}\n\nexport function DecafLayoutProgress({ isAnimating }: { isAnimating: boolean }) {\n const { animationDuration, isFinished, progress } = useNProgress({ isAnimating });\n\n return (\n <div\n style={{\n opacity: isFinished ? 0 : 1,\n pointerEvents: 'none',\n transition: `opacity ${animationDuration}ms linear`,\n }}\n >\n <div\n style={{\n background: '#29d',\n height: 2,\n left: 0,\n marginLeft: `${(-1 + progress) * 100}%`,\n position: 'fixed',\n top: 0,\n transition: `margin-left ${animationDuration}ms linear`,\n width: '100%',\n zIndex: 1031,\n }}\n >\n <div\n style={{\n boxShadow: '0 0 10px #29d, 0 0 5px #29d',\n display: 'block',\n height: '100%',\n opacity: 1,\n position: 'absolute',\n right: 0,\n transform: 'rotate(3deg) translate(0px, -4px)',\n width: 100,\n }}\n />\n </div>\n </div>\n );\n}\n\nexport function DecafLayoutBreadcrumb(props: { children?: React.ReactNode }) {\n const matches = useMatches();\n\n const crumbs = matches\n .filter((match: any) => Boolean(match.handle?.crumb))\n .map((match: any) => match.handle.crumb(match.data));\n\n const breadcrumb: BreadcrumbItem[] = [{ href: '/', title: <HomeOutlined /> }, ...crumbs].map((x, i) => ({\n ...x,\n _key: i,\n }));\n\n if (breadcrumb.length < 2) {\n return <></>;\n }\n\n return (\n <div id=\"decaf-layout-breadcrumb\">\n <Breadcrumb items={breadcrumb} />\n <div>{props.children}</div>\n </div>\n );\n}\n","import { useDecaf } from '@decafhub/decaf-react';\nimport { Card, Col, Row, Statistic } from 'antd';\nimport React, { useEffect, useState } from 'react';\n\nexport interface AboutPageProps {\n appName?: string;\n appVersion?: string;\n appDescription?: string;\n content?: React.ReactNode;\n}\n\nexport default function PageAbout(props: AboutPageProps) {\n const { client } = useDecaf();\n const [versionCultproxy, setVersionCultproxy] = useState<string | undefined>(undefined);\n const [versionBarista, setVersionBarista] = useState<string | undefined>(undefined);\n const [versionEstate, setVersionEstate] = useState<string | undefined>(undefined);\n\n useEffect(() => {\n client.bare.get<{ version: string }>('/_cultproxy').then(({ data }) => setVersionCultproxy(data.version));\n client.barista.get<{ version: string }>('/version/').then(({ data }) => setVersionBarista(data.version));\n client.bare.get<string>('/apis/estate/version').then(({ data }) => setVersionEstate(data));\n }, [client]);\n\n return (\n <Row gutter={[16, 16]}>\n <Col xs={{ span: 24 }} sm={{ span: 24 }} md={{ span: 24 }} lg={{ span: 12 }} xl={{ span: 8 }} xxl={{ span: 6 }}>\n <Card bordered={false}>\n <Statistic title=\"Application Name\" value={props.appName} />\n </Card>\n </Col>\n\n <Col xs={{ span: 24 }} lg={{ span: 12 }} xl={{ span: 16 }} xxl={{ span: 18 }}>\n <Card bordered={false}>\n <Statistic title=\"Application Description\" value={props.appDescription} />\n </Card>\n </Col>\n\n <Col xs={{ span: 24 }} sm={{ span: 24 }} md={{ span: 12 }} lg={{ span: 12 }} xl={{ span: 6 }} xxl={{ span: 6 }}>\n <Card bordered={false}>\n <Statistic title=\"Application Version\" value={props.appVersion} prefix=\"v\" />\n </Card>\n </Col>\n\n <Col xs={{ span: 24 }} sm={{ span: 24 }} md={{ span: 12 }} lg={{ span: 12 }} xl={{ span: 6 }} xxl={{ span: 6 }}>\n <Card bordered={false}>\n <Statistic title=\"DECAF Cultproxy Version\" value={versionCultproxy} prefix=\"v\" />\n </Card>\n </Col>\n\n <Col xs={{ span: 24 }} sm={{ span: 24 }} md={{ span: 12 }} lg={{ span: 12 }} xl={{ span: 6 }} xxl={{ span: 6 }}>\n <Card bordered={false}>\n <Statistic title=\"DECAF Barista Version\" value={versionBarista} prefix=\"v\" />\n </Card>\n </Col>\n\n <Col xs={{ span: 24 }} sm={{ span: 24 }} md={{ span: 12 }} lg={{ span: 12 }} xl={{ span: 6 }} xxl={{ span: 6 }}>\n <Card bordered={false}>\n <Statistic title=\"DECAF Estate Version\" value={versionEstate} prefix=\"v\" />\n </Card>\n </Col>\n\n <Col span={24}>{props.content}</Col>\n </Row>\n );\n}\n","import {\n DecafApp,\n DecafAppConfig,\n DecafAppController,\n DecafContextType,\n DecafWebappController,\n useDecaf,\n} from '@decafhub/decaf-react';\nimport 'antd/dist/reset.css';\nimport { ThemeConfig } from 'antd/es/config-provider/context';\nimport React, { useEffect } from 'react';\nimport { RouteObject, RouterProvider, createBrowserRouter } from 'react-router-dom';\nimport { BreadcrumbItem } from '../components/Breadcrumb';\nimport { Page404, PageError } from '../components/Error';\nimport DecafLayout from '../components/Layout';\nimport PageAbout from '../components/PageAbout';\nimport { ThemeProvider } from '../theme';\nimport { DecafMenuItem } from '../types';\nimport { setAtKey } from '../utils';\nimport { getPlausibleScript } from './-plausible';\n\n/**\n * DECAF Web appliaction route type.\n */\nexport type DecafRoute = Omit<RouteObject, 'children'> & {\n crumb?: (data: any) => BreadcrumbItem;\n /** When true, removes paddings from the content area. */\n fullScreen?: boolean;\n extras?: React.ReactNode;\n children?: DecafRoute[];\n};\n\n/**\n * DECAF Web application route items builder.\n */\nexport type DecafRouteItemsBuilder = (context: DecafContextType) => DecafRoute[];\n\n/**\n * DECAF Web application menu items builder.\n */\nexport type DecafMenuItemsBuilder = (context: DecafContextType) => DecafMenuItem[];\n\n/**\n * DECAF Web application properties.\n */\nexport interface DecafWebappProps {\n /**\n * DECAF application name.\n */\n appName: string;\n\n /**\n * DECAF application description.\n */\n appDescription?: string;\n\n /**\n * DECAF application configuration.\n */\n config?: DecafAppConfig;\n\n /**\n * DECAF application controller.\n */\n controller?: DecafAppController;\n\n /**\n * The theme of the app.\n *\n * Defaults to `dark`.\n */\n theme?: 'dark' | 'light';\n\n /**\n * The theme config of the app.\n *\n * This will be merged with the default theme config (dark or light).\n *\n * See https://ant.design/docs/react/customize-theme\n */\n themeConfig?: ThemeConfig;\n\n /**\n * Builds a collection of DECAF route items.\n *\n * About page and 404 page will be added automatically.\n *\n * See https://reactrouter.com/en/main/routers/create-browser-router#routes\n */\n buildRouteItems: DecafRouteItemsBuilder;\n\n /**\n * Builds a collection of DECAF menu items.\n *\n * About page will be added automatically.\n */\n buildMenuItems: DecafMenuItemsBuilder;\n\n /**\n * The extra content to show on the about page.\n */\n buildAboutPageContent?: (context: DecafContextType) => React.ReactNode;\n}\n\nexport function DecafWebapp(props: DecafWebappProps) {\n // Manage Plausible script:\n useEffect(() => {\n const script = getPlausibleScript();\n document.body.appendChild(script);\n return () => {\n document.body.removeChild(script);\n };\n }, []);\n\n // Get or create the DECAF Webapp controller:\n const controller = props.controller || DecafWebappController;\n controller.disableZendeskWidget = true;\n\n // Prepare the DECAF Web application and return:\n return (\n <ThemeProvider themeConfig={props.themeConfig} theme={props.theme}>\n <DecafApp config={props.config} controller={controller}>\n <DecafWebappInternal {...props} />\n </DecafApp>\n </ThemeProvider>\n );\n}\n\n/**\n * Auxiliary DECAF Webapp component.\n */\nexport function DecafWebappInternal(props: DecafWebappProps) {\n const decaf = useDecaf();\n\n const defaultRoutes = [\n {\n path: '/about',\n element: (\n <PageAbout\n appName={props.appName}\n appVersion={props.config?.currentVersion}\n appDescription={props.appDescription}\n content={props.buildAboutPageContent?.(decaf)}\n />\n ),\n crumb: () => ({ title: 'About' }),\n },\n { path: '*', element: <Page404 />, crumb: () => ({ title: 'Error: Page Not Found' }) },\n ];\n\n const routes = setAtKey<DecafRoute>(props.buildRouteItems(decaf), defaultRoutes, 'path');\n\n const router = createBrowserRouter(compileRoutes(props, decaf, routes), { basename: props.config?.basePath });\n\n return <RouterProvider router={router} />;\n}\n\nexport function compileRoutes(props: DecafWebappProps, context: DecafContextType, routes: DecafRoute[]) {\n return [\n {\n element: <DecafLayout menu={props.buildMenuItems(context)} appName={props.appName} />,\n path: '/',\n children: routes.map(decafRouteToReactRoute),\n errorElement: <PageError />,\n },\n ];\n}\n\nexport function decafRouteToReactRoute(route: DecafRoute): RouteObject {\n const { crumb, fullScreen, extras, children, ...rest } = route;\n\n if (children) {\n // @ts-expect-error\n return { ...rest, handle: { crumb, fullScreen, extras }, children: children.map(decafRouteToReactRoute) };\n } else {\n return { ...rest, handle: { crumb, fullScreen, extras } };\n }\n}\n","export function getPlausibleScript(): HTMLScriptElement {\n const script = document.createElement('script');\n\n script.defer = true;\n script.setAttribute('data-domain', location.hostname);\n script.src = 'https://webax.svc.sys.decafhub.com/js/plausible.js';\n\n return script;\n}\n"],"names":["ErrorPageSubtitle","_ref","React","createElement","Fragment","Typography","message","Link","to","Button","style","marginTop","Page401","Result","icon","LockFilled","color","title","subTitle","Page403","status","Page404","PageError","Direction","FOOTER_HEIGHT","FOOTER_PADDING","useRemaningHeight","elementId","_useState","useState","remainingHeight","setRemainingHeight","useLayoutEffect","e","document","getElementById","calculate","elementTop","getBoundingClientRect","top","elementHeight","window","innerHeight","addEventListener","removeEventListener","useTableMaxHeight","bottomSpace","_useState2","maxHeight","setMaxHeight","remaining","w","tableWrapper","closest","observer","ResizeObserver","_tableWrapper$querySe","_tableWrapper$querySe2","_tableWrapper$querySe3","_tableWrapper$querySe4","_tableWrapper$querySe5","tableHeaderHeight","querySelector","height","tableFooterHeight","paginations","querySelectorAll","paginationPaddings","length","paginationHeights","Array","from","reduce","acc","cur","observe","box","disconnect","lightenDarkenColor","col","amt","usePound","slice","num","parseInt","r","b","g","String","toString","logout","client","fromAll","barista","get","timeout","console","error","alert","Cookies","remove","location","reload","booleanMap","map","x","True","False","nullableBooleanMap","Null","toDirection","Decimal","comparedTo","Short","Square","Long","directionMap","setAtKey","array","items","key","result","concat","forEach","item","index","findIndex","push","DARK_BLACK_PRIMARY","DARK_BLACK_SECONDARY","LIGHT_WHITE_PRIMARY","INPUT_BG_COLOR","BORDER_COLORS_TRANSPARENT","colorBorder","colorBorderSecondary","colorBorderBg","decafThemeLight","hashed","algorithm","theme","defaultAlgorithm","components","Layout","colorBgHeader","token","borderRadius","colorBgContainer","colorBgBase","colorBgLayout","colorBgElevated","decafThemeDark","boxShadow","boxShadowSecondary","Input","_extends","Select","Checkbox","Dropdown","DatePicker","InputNumber","Menu","colorItemText","fontFamily","colorPrimary","green","red","blue","yellow","orange","colorWhite","colorLink","colorLinkHover","colorLinkActive","darkAlgorithm","getBaseStyles","_theme$token","_theme$token2","_decafThemeDark$compo","_decafThemeDark$compo2","getCrumbColor","darkColors","lightColors","menuOverride","borderBottomColor","body","background","margin","minHeight","button","overflow","position","zIndex","right","left","paddingInline","display","alignItems","paddingTop","paddingBottom","backgroundColor","flexDirection","justifyContent","width","colorBase","listStyle","padding","marginInline","transition","bottom","paddingBlock","_templateObject","ThemeContext","createContext","toggleTheme","useDecafTheme","useContext","ThemeProvider","props","_React$useState","localStorage","getItem","value","setValue","themeConfig","globalStyles","getLightStyles","_theme$token3","_theme$token4","_theme$token5","_theme$token6","_theme$token7","_theme$token8","_theme$token9","_theme$token10","_theme$token11","_theme$components","_theme$components$But","_theme$token12","_theme$token13","_theme$token14","_theme$token15","getDarkStyles","Provider","t","setItem","ConfigProvider","Global","styles","css","children","Breadcrumb","itemRender","separator","breakpoints","Grid","useBreakpoint","firstAndLAst","className","i","href","dmenu","child","j","label","menu","cursor","gap","DownOutlined","fontSize","renderBreadcrumbs","lg","RightOutlined","DocumentationButton","useToken","type","target","rel","QuestionCircleOutlined","xs","Logo","version","id","xmlns","xmlnsXlink","y","viewBox","enableBackground","xmlSpace","fill","d","buildAntMenuFromDecafMenu","routes","route","NavLink","end","DecafPoweredBy","Text","DecafMenu","drawerOpen","setDrawerOpen","matches","useMatches","useLocation","md","menuItems","matchedMenuItems","match","pathname","filter","useEffect","selectedKeys","mode","overflowedIndicator","EllipsisOutlined","flex","border","minWidth","MenuOutlined","marginRight","onClick","Drawer","open","footer","onClose","bodyStyle","clientWidth","PageScroller","UpOutlined","scrollTo","behavior","scrollHeight","ScreenShotter","handleScreenshot","setProperty","Promise","resolve","html2canvas","then","canvas","dataUrl","toDataURL","link","download","click","reject","triggerNode","cloneElement","CameraOutlined","ThemeSwitcher","BulbFilled","BulbOutlined","onChange","UserProfileDropdown","undefined","gravatar","setGravatar","decaf","useDecaf","navigate","useNavigate","email","url","me","md5","fetch","method","response","fullname","username","disabled","UserOutlined","dashed","LogoutOutlined","confirm","InfoCircleOutlined","propsAvatar","src","trigger","Avatar","getCurrentAppPath","parts","split","indexOfWebapps","indexOf","join","VersionSelector","appName","appVersion","getAppVersionFromUrl","appVersionCode","startsWith","isPreviewVersion","isReleaseVersion","versions","code","name","show","process","env","NODE_ENV","currentVersion","find","v","isProd","placement","arrow","CaretUpOutlined","ZENDESK_WIDGET_SCRIPT","ZendeskWidget","_useDecaf","publicConfig","setOpen","zendesk","script","async","onload","zE","appendChild","zESettings","webWidget","offset","horizontal","vertical","contactForm","subject","fields","prefill","removeChild","MessageOutlined","DecafLayout","navigation","useNavigation","_useDecafTheme","currentTheme","setCurrentTheme","isFullScreen","handle","fullScreen","extras","DecafLayoutProgress","isAnimating","state","Header","DecafLayoutBrand","Content","DecafLayoutBreadcrumb","Outlet","Footer","Row","justify","align","Col","span","textAlign","Title","level","fontWeight","whiteSpace","_ref2","_useNProgress","useNProgress","animationDuration","opacity","isFinished","pointerEvents","marginLeft","progress","transform","crumbs","_match$handle","Boolean","crumb","data","breadcrumb","HomeOutlined","_key","PageAbout","versionCultproxy","setVersionCultproxy","versionBarista","setVersionBarista","_useState3","versionEstate","setVersionEstate","bare","_ref3","gutter","sm","xl","xxl","Card","bordered","Statistic","appDescription","prefix","content","_excluded","DecafWebapp","defer","setAttribute","hostname","getPlausibleScript","controller","DecafWebappController","disableZendeskWidget","DecafApp","config","DecafWebappInternal","_props$config","_props$config2","defaultRoutes","path","element","buildAboutPageContent","buildRouteItems","router","createBrowserRouter","context","buildMenuItems","decafRouteToReactRoute","errorElement","compileRoutes","basename","basePath","RouterProvider","rest","_objectWithoutPropertiesLoose"],"mappings":"gsCAKA,SAASA,GAAiBC,GACxB,OACEC,EAAAC,cAAAD,EAAAE,SAAA,KACEF,EAACC,cAAAE,EAAY,KAHiBJ,EAAPK,SAIvBJ,EAAAC,cAACI,EAAI,CAACC,GAAG,KACPN,EAAAC,cAACM,EAAM,CAACC,MAAO,CAAEC,UAAW,KAAI,cAIxC,CAEgB,SAAAC,KACd,OACEV,EAAAC,cAACU,EAAM,CACLC,KAAMZ,EAAAC,cAACY,EAAU,CAACL,MAAO,CAAEM,MAAO,aAClCC,MAAO,uBACPC,SAAUhB,EAAAC,cAACH,GAAiB,CAACM,QAAS,+DAG5C,UAEgBa,KACd,OACEjB,gBAACW,EAAM,CACLO,OAAO,MACPH,MAAO,gBACPC,SAAUhB,EAACC,cAAAH,GAAkB,CAAAM,QAAS,oDAG5C,UAEgBe,KACd,OACEnB,gBAACW,EAAM,CACLO,OAAO,MACPH,MAAO,iBACPC,SAAUhB,EAACC,cAAAH,GAAkB,CAAAM,QAAS,iDAG5C,CAEgB,SAAAgB,KACd,OACEpB,gBAACW,EAAM,CACLO,OAAO,MACPH,MAAO,QACPC,SACEhB,EAACC,cAAAH,GACC,CAAAM,QACE,8GAMZ,wOCtDA,IAuKYiB,GAvKNC,GAAgB,GAChBC,GAAiB,GAUP,SAAAC,GAAkBC,GAChC,IAAAC,EAA8CC,EAAiB,GAAxDC,EAAe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eof exports&&"undefined"!=typeof module?t(exports,require("@ant-design/icons"),require("@decafhub/decaf-react"),require("@emotion/react"),require("@emotion/styled"),require("antd/dist/reset.css"),require("react"),require("react-router-dom"),require("antd"),require("html2canvas")):"function"==typeof define&&define.amd?define(["exports","@ant-design/icons","@decafhub/decaf-react","@emotion/react","@emotion/styled","antd/dist/reset.css","react","react-router-dom","antd","html2canvas"],t):t((e||self).decafReactWebapp={},e.icons,e.decafReact,e.react,e.styled,0,e.react,e.reactRouterDom,e.antd,e.html2Canvas)}(this,function(e,t,n,o,r,a,l,c,i,d){function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s,f=/*#__PURE__*/u(r),m=/*#__PURE__*/u(l),p=/*#__PURE__*/u(d);function g(e){return m.default.createElement(m.default.Fragment,null,m.default.createElement(i.Typography,null,e.message),m.default.createElement(c.Link,{to:"/"},m.default.createElement(i.Button,{style:{marginTop:20}},"Home Page")))}function h(){return m.default.createElement(i.Result,{status:"404",title:"Page Not Found",subTitle:m.default.createElement(g,{message:"Sorry, the page you visited does not exist."})})}function b(){return m.default.createElement(i.Result,{status:"500",title:"Error",subTitle:m.default.createElement(g,{message:"Something went wrong. Please try again later. If the problem persists, please contact the administrator."})})}function E(){return E=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},E.apply(this,arguments)}function w(e,t){var n=!1;"#"===e[0]&&(e=e.slice(1),n=!0);var o=parseInt(e,16),r=(o>>16)+t;r>255?r=255:r<0&&(r=0);var a=(o>>8&255)+t;a>255?a=255:a<0&&(a=0);var l=(255&o)+t;return l>255?l=255:l<0&&(l=0),(n?"#":"")+String("000000"+(l|a<<8|r<<16).toString(16)).slice(-6)}function v(e){var t,n,o;return{body:{background:null==(t=e.token)?void 0:t.colorBgBase,fontFamily:"Inter, sans-serif",margin:0},button:{boxShadow:"none !important"},".ant-table-body":{overflow:"auto !important"},"#decaf-header":{position:"fixed",zIndex:999,right:0,left:0,paddingInline:0},"#decaf-content":{paddingInline:20,paddingTop:"5rem",paddingBottom:"5rem"},"#decaf-footer":{position:"fixed",bottom:0,right:0,left:0,background:null==(n=e.components)||null==(o=n.Layout)?void 0:o.colorBgHeader,paddingBlock:0,paddingInline:0,zIndex:999,button:{height:34}},".dot":{borderRadius:"50%",width:10,height:10,display:"inline-block",backgroundColor:"rgba(255,255,255,.25)","&.green":{backgroundColor:"#80ff00 !important"},"&.yellow":{backgroundColor:"#ff0 !important"},"&.orange":{backgroundColor:"#ff7000 !important"},"&.red":{backgroundColor:"#ff0000 !important"}}}}var y="#10161d",k="#2c3d50",C={colorBorder:"transparent",colorBorderSecondary:"transparent",colorBorderBg:"transparent"},B={hashed:!0,algorithm:[i.theme.defaultAlgorithm],components:{Layout:{colorBgHeader:"#ededed"}},token:{borderRadius:0,colorBgContainer:"#f8f8f8",colorBgBase:"#f8f8f8",colorBgLayout:"#f8f8f8"}},x={hashed:!0,components:{Layout:{colorBgHeader:y},Button:{boxShadow:"none",boxShadowSecondary:"none",colorBgContainer:k},Input:E({},C,{colorBgContainer:k}),Select:E({},C,{colorBgContainer:k}),Checkbox:E({},C,{colorBgContainer:k}),Dropdown:E({},C),DatePicker:E({},C,{colorBgContainer:k,colorBgElevated:k}),InputNumber:E({},C,{colorBgContainer:k}),Menu:{colorItemText:"rgba(255, 255, 255, 0.5)"}},token:{fontFamily:"Inter, sans-serif",colorPrimary:"#344961",colorBgBase:"#1a242f",colorBgContainer:y,colorBgElevated:"#1a242f",colorBorderSecondary:"#1a242f",colorBorder:"#1a242f",colorBgLayout:"#1a242f",borderRadius:0,green:"#48734d",red:"#b03a38",blue:"#0d6efd",yellow:"#ffc107",orange:"#fd7e14",colorWhite:"#fff",colorLink:"#a4bfff",colorLinkHover:"#7199fb",colorLinkActive:"#7199fb"},algorithm:[i.theme.darkAlgorithm]},z=m.default.createContext({theme:"dark",toggleTheme:function(){}});function D(e){var t=m.default.useState(function(){var t=e.theme||localStorage.getItem("decafAppTheme");return"dark"===t||"light"===t?t:"dark"}),n=t[0],r=t[1],a="light"===n?B:x;a=E({},a,e.themeConfig||{}),a=E({},a,{token:E({},a.token,{fontFamily:"Inter, sans-serif"})});var l,c,d="light"===n?function(e){return E({},v(e))}(a):function(e){var t,n,o,r,a,l,c,i,d,u,s,f,m,p,g,h;return E({},v(e),{"*":{"&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-track":{background:null==(t=e.token)?void 0:t.colorBgContainer},"&::-webkit-scrollbar-thumb":{background:null==(n=e.token)?void 0:n.colorPrimary}},".ant-page-header-back-button, .ant-page-header-heading-title":{color:(null==(o=e.token)?void 0:o.colorWhite)+" !important"},".ant-badge-count":{color:(null==(r=e.token)?void 0:r.colorWhite)+" !important"},".ant-table-thead > tr > th":{background:w((null==(a=e.token)?void 0:a.colorBgContainer)||"",-5)+" !important","&:hover":{background:(null==(l=e.token)?void 0:l.colorBgContainer)+" !important"}},".ant-table-filter-dropdown":{"input, .ant-table-filter-dropdown-search-input":{background:(null==(c=e.token)?void 0:c.colorBgBase)+" !important"},".ant-dropdown-menu-item, .ant-dropdown-menu":{background:(null==(i=e.token)?void 0:i.colorBgContainer)+" !important"}},".ant-menu-light.ant-menu-horizontal >.ant-menu-item-selected":{color:(null==(d=e.token)?void 0:d.colorWhite)+" !important"},".ant-tabs-tab-active":{".ant-tabs-tab-btn":{color:(null==(u=e.token)?void 0:u.colorWhite)+" !important"}},".ant-radio-button-wrapper-checked":{backgroundColor:(null==(s=e.components)||null==(f=s.Button)?void 0:f.colorBgContainer)+" !important",color:(null==(m=e.token)?void 0:m.colorWhite)+" !important"},".ant-picker-date-panel":{".ant-picker-cell-in-range, .ant-picker-cell-range-start, .ant-picker-cell-range-end":{"&::before":{background:(null==(p=e.token)?void 0:p.colorBgBase)+" !important"},".ant-picker-cell-inner":{background:(null==(g=e.token)?void 0:g.colorBgBase)+" !important"}},".ant-picker-cell-range-start, .ant-picker-cell-range-end":{".ant-picker-cell-inner":{background:(null==(h=e.token)?void 0:h.colorPrimary)+" !important"}}}})}(a);return m.default.createElement(z.Provider,{value:{theme:n,toggleTheme:function(){var e="dark"===n?"light":"dark";r(e),localStorage.setItem("decafAppTheme",e)}}},m.default.createElement(i.ConfigProvider,{theme:a},m.default.createElement(o.Global,{styles:o.css(s||(l=["\n @import url(https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap);\n "],c||(c=l.slice(0)),l.raw=c,s=l))}),m.default.createElement(o.Global,{styles:d}),e.children))}var I=function(){return m.default.useContext(z)};function P(){return m.default.createElement("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 649.6 767.9",enableBackground:"new 0 0 649.6 767.9",xmlSpace:"preserve",width:50,height:50},m.default.createElement("g",null,m.default.createElement("path",{fill:"#52CEF4",d:"M324,767.9c-6.6-5.1-14.2-8.6-21.3-12.9c-22-13-44.3-25.6-66.4-38.5c-21.3-12.4-42.5-25-63.8-37.4\n c-33.5-19.5-67.1-39-100.7-58.5c-22.7-13.2-45.3-26.5-68-39.6c-2.8-1.6-3.8-3.3-3.8-6.5c0.2-58.6-0.2-117.3,0.4-175.9\n C1,333,0.7,267.3,1,201.6c0-1.8-0.6-3.7,0.6-5.4c6.4,3.8,12.7,7.6,19.1,11.3c23.8,13.9,47.7,27.9,71.5,41.8\n c4.9,2.9,9.6,6.2,14.9,8.4c-1.2,5.2-0.2,10.3-0.1,15.5c0.5,56.1-0.2,112.2,0.9,168.3c0.3,18.4,0.2,36.8,0.2,55.2\n c0,3,0.7,4.9,3.5,6.4c6.3,3.4,12.3,7.3,18.5,11c26.1,15.7,52.3,31.5,78.4,47.2c33,19.8,66,39.6,99,59.3c5.7,3.4,10.9,7.5,17.2,9.7\n c0,1.5,0.1,2.9,0.1,4.4c0,42.4,0,84.8,0,127.3c0,1.8-0.7,3.7,0.8,5.3c0,0.2,0,0.4,0,0.7C325.1,767.9,324.5,767.9,324,767.9z"}),m.default.createElement("path",{fill:"#227EC3",d:"M107.1,257.6c-5.3-2.2-10-5.5-14.9-8.4c-23.8-13.9-47.7-27.8-71.5-41.8c-6.4-3.7-12.7-7.6-19.1-11.3\n c8.2-6,17.1-10.7,25.7-16c28.7-17.5,57.5-34.9,86.3-52.4c39.2-23.8,78.5-47.6,117.7-71.4c27-16.3,53.9-32.7,80.9-49\n c4-2.4,8.1-4.6,11.7-7.4c1.3,0,2.7,0,4,0c0.3,1.6,1.9,1.8,2.9,2.4c31,18.9,62,37.8,93.1,56.4c4.2,2.5,5.9,5.2,5.9,10.3\n c-0.3,38.3-0.1,76.7-0.1,115c0,2.7-0.1,5.3-0.2,8c-10.5-6.3-21-12.5-31.4-18.9c-23.1-14-46.2-28-69.3-42c-1.6-1-2.8-1.6-5-0.4\n c-26.8,15.8-53.7,31.5-80.6,47.2c-26.1,15.2-52.2,30.4-78.3,45.7C145.7,235,126.4,246.3,107.1,257.6z"}),m.default.createElement("path",{fill:"#409DD5",d:"M324.7,630.2c5.2-4.2,11-7.4,16.7-10.9c32.6-20.3,65.3-40.6,98-60.8c30.8-19,61.6-38,92.4-57\n c7.5-4.6,7.5-4.6,7.5-13.6c0-58.6,0.1-117.3,0.1-175.9c0-1.6-0.1-3.2-0.1-4.8c0.8-1.5,0.4-3.1,0.4-4.7c0.1-14.7,0.2-29.5,0.3-44.2\n c1.3,0.1,2.4-0.4,3.4-1c8.7-5.1,17.4-10.2,26.1-15.3c15.8-9.2,31.7-18.3,47.6-27.5c10.5-6.1,21.1-12.3,31.6-18.4\n c1.5,0.9,0.8,2.4,0.8,3.6c0,124.2,0,248.4,0.1,372.6c0,2.7-0.9,4-3.1,5.3c-35.3,20.8-70.5,41.7-105.8,62.6\n c-27.2,16.1-54.5,32.2-81.7,48.4c-27,16-54,32.1-81,48c-17.4,10.3-34.8,20.4-52.3,30.7c-1.5-1.6-0.8-3.5-0.8-5.3\n c0-42.4,0-84.8,0-127.3C324.8,633.2,324.7,631.7,324.7,630.2z"}),m.default.createElement("path",{fill:"#227EC3",d:"M648.7,196.1c-10.5,6.1-21,12.3-31.6,18.4c-15.8,9.2-31.7,18.3-47.6,27.5c-8.7,5.1-17.4,10.2-26.1,15.3\n c-1,0.6-2.1,1.1-3.4,1c0-12.4-0.1-24.8-0.1-37.2c0-30.2,0-60.5,0-91c2.8,0.3,4.5,2,6.5,3.1c28.4,17.3,56.8,34.7,85.2,52\n C637.3,188.8,643.4,191.8,648.7,196.1z"}),m.default.createElement("path",{fill:"#227EC3",d:"M216.2,322.3c-0.3-1.6-0.4-2.9,1.4-4c29.2-18,58.4-36.1,87.5-54.1c4.7-2.9,9.5-5.8,14.2-8.9\n c1.5-1,2.7-1.1,4.3-0.2c26.9,15.9,53.8,31.8,80.7,47.7c7.1,4.2,14.1,8.5,21.4,12.4c3.5,1.9,4.8,4.3,3.9,8c-1.7,1.1-3.3,2.2-5,3.2\n c-20.5,11.9-41.1,23.8-61.6,35.7c-13,7.6-26.1,15.2-39.1,22.8c-7-4-14-8.1-21-12.1c-21.7-12.7-43.2-25.5-65-38\n C230.7,330.5,223.8,325.8,216.2,322.3z"}),m.default.createElement("path",{fill:"#52CEF4",d:"M216.2,322.3c7.6,3.5,14.5,8.2,21.8,12.4c21.7,12.5,43.3,25.3,65,38c7,4.1,14,8.1,21,12.1\n c0,39.3,0.1,78.6,0.1,117.9c-1.5,0.9-2.5-0.4-3.6-1c-21.3-12.8-42.5-25.5-63.7-38.3c-13.3-8-26.5-16.1-39.8-24\n c-1.8-1.1-2.5-2.3-2.5-4.4c0.4-26.9,0.4-53.8,1.1-80.7C215.8,343.6,215.4,332.9,216.2,322.3z"}),m.default.createElement("path",{fill:"#409DD5",d:"M324,502.6c0-39.3-0.1-78.6-0.1-117.9c13-7.6,26.1-15.2,39.1-22.8c20.5-11.9,41.1-23.8,61.6-35.7\n c1.7-1,3.3-2.1,5-3.2c0.1,7.6,0.1,15.2,0.1,22.8c0,30.5,0,61,0,91.5c0,2.6-0.4,4.4-2.9,5.8c-31.6,18.2-63,36.5-94.5,54.8\n C329.6,499.6,327.2,501.8,324,502.6z"})))}function T(){return m.default.createElement("div",null,m.default.createElement(i.Button,{title:"Scroll to top",type:"text",size:"small",onClick:function(){return window.scrollTo({top:0,behavior:"smooth"})},icon:m.default.createElement(t.UpOutlined,null)}),m.default.createElement(i.Button,{title:"Scroll to bottom",type:"text",size:"small",onClick:function(){return window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"})},icon:m.default.createElement(t.DownOutlined,null)}))}function S(e){var n=function(){try{var e=document.getElementById("decaf-footer");return null==e||e.style.setProperty("display","none"),Promise.resolve(p.default(document.body)).then(function(t){var n=t.toDataURL("image/png");null==e||e.style.setProperty("display","block");var o=document.createElement("a");o.download="screenshot.png",o.href=n,o.click(),o.remove()})}catch(e){return Promise.reject(e)}};return e.triggerNode?m.default.cloneElement(e.triggerNode,{onClick:n}):m.default.createElement(i.Button,{title:"Take a screenshot of the current page",type:"text",size:"small",icon:m.default.createElement(t.CameraOutlined,null),onClick:n})}function L(e){return m.default.createElement(i.Button,{title:"dark"===e.theme?"switch to light theme":"switch to dark theme",type:"text",size:"small",icon:m.default.createElement(t.BulbFilled,{style:{color:"dark"===e.theme?"white":"black"}}),onClick:function(){return e.onChange()}})}function W(e){var t=e.split("/"),n=t.indexOf("webapps");return-1===n?"":t.slice(n+3).join("/")}function O(){var e,n,o,r=-1===(n=(e=window.location.href.split("/")).indexOf("webapps"))?"":e[n+1],a=function(e){var t=window.location.href.split("/"),n=t.indexOf("webapps");return-1===n?"":t[n+2]}(),l=function(e){return e.startsWith("preview-")&&e.length>8}(o=a)?"preview":function(e){return e.startsWith("v")&&e.length>1}(o)?"release":o,c=[{code:"development",name:"Development Version",color:"red",url:"/webapps/"+r+"/development/"+W(window.location.href),show:"development"===process.env.NODE_ENV},{code:"testing",name:"Testing Version",color:"orange",url:"/webapps/"+r+"/testing/"+W(window.location.href),show:!0},{code:"staging",name:"Staging Version",color:"yellow",url:"/webapps/"+r+"/staging/"+W(window.location.href),show:!0},{code:"production",name:"Production Version",color:"green",url:"/webapps/"+r+"/production/"+W(window.location.href),show:!0},{code:"preview",name:"Preview Version",color:"grey",url:"/",show:!1},{code:"release",name:"Release Version",color:"grey",url:"/",show:!1}],d=c.find(function(e){return e.code===l});return d?m.default.createElement(i.Dropdown,{placement:"top",arrow:!0,menu:{items:c.filter(function(e){return e.show}).map(function(e){return{key:e.name,label:m.default.createElement("span",null,m.default.createElement("i",{className:"dot "+e.color})," ",e.name),onClick:function(){window.location.href=e.url}}})}},m.default.createElement(i.Button,{type:"text",size:"small"},m.default.createElement("div",{style:{display:"flex",alignItems:"center"}},m.default.createElement("i",{className:"dot "+(null==d?void 0:d.color),style:{marginRight:5}}),"production"!==d.code&&m.default.createElement("span",{style:{marginRight:5}},"You are on ",m.default.createElement("b",null,d.name)),m.default.createElement(t.CaretUpOutlined,null)))):null}var j="https://static.zdassets.com/ekr/snippet.js";function N(){var e=n.useDecaf(),o=e.me,r=e.publicConfig,a=l.useState(!1),c=a[0],d=a[1];return l.useEffect(function(){if(r.zendesk&&"undefined"!=typeof document){var e=document.createElement("script");return e.src=j+"?key="+r.zendesk,e.async=!0,e.id="ze-snippet",e.onload=function(){window.zE("webWidget","hide"),window.zE("webWidget:on","open",function(){window.zE("webWidget","show"),d(!0)}),window.zE("webWidget:on","close",function(){window.zE("webWidget","hide"),d(!1)})},document.body.appendChild(e),window.zESettings={webWidget:{offset:{horizontal:-7,vertical:20}},contactForm:{subject:!0,fields:[{id:"name",prefill:{"*":o.fullname}},{id:"email",prefill:{"*":o.email}}]}},function(){document.body.removeChild(e)}}},[r,o]),r.zendesk?m.default.createElement(i.Button,{size:"small",icon:m.default.createElement(t.QuestionCircleOutlined,null),onClick:function(){c?null==window.zE||window.zE("webWidget","close"):null==window.zE||window.zE("webWidget","open"),d(!c)}},"Support"):null}function R(e){var t=[];return e.forEach(function(e){var n={key:"to"in e?e.to:e.label,label:e.label,icon:e.icon};"to"in e&&e.to?n.label=m.default.createElement(c.NavLink,{to:e.to,end:"/"===e.to},e.label):"href"in e&&e.href?n.label=m.default.createElement("a",{href:e.href},e.label):e.children&&(n.label=e.label,n.children=R(e.children||[])),t.push(n)}),t}function A(e){var o=R(e.menu),r=c.useMatches(),a=c.useLocation(),l=r.map(function(e){return e.pathname}).filter(function(e){return"/"===a.pathname||"/"!==e}),d=n.useDecaf().me,u=I(),s=u.theme,f=u.toggleTheme;return m.default.createElement(i.Layout,{style:{height:"100%"}},m.default.createElement(i.Layout.Header,{id:"decaf-header"},m.default.createElement("div",{style:{paddingInline:20,display:"flex",justifyContent:"space-between",alignItems:"center"}},m.default.createElement(c.Link,{to:"/",style:{display:"flex",alignItems:"center",gap:10}},m.default.createElement(P,null),m.default.createElement(i.Typography.Title,{level:4,style:{margin:0}},e.appName)),m.default.createElement(i.Menu,{style:{justifyContent:"flex-end",backgroundColor:"transparent",border:"none",flex:1},mode:"horizontal",items:o,selectedKeys:l}))),m.default.createElement(i.Layout.Content,{id:"decaf-content"},m.default.createElement(c.Outlet,null)),m.default.createElement(i.Layout.Footer,{id:"decaf-footer"},m.default.createElement(i.Row,{justify:"space-between",align:"middle"},m.default.createElement(i.Col,{span:10},m.default.createElement(N,null)),m.default.createElement(i.Col,{span:4,style:{textAlign:"center"}},m.default.createElement(i.Typography.Text,{type:"secondary"},"Powered by"," ",m.default.createElement("b",null,m.default.createElement("a",{href:"https://teloscube.com",target:"_blank",rel:"noreferrer"},"Teloscube")))),m.default.createElement(i.Col,{span:10,style:{justifyContent:"flex-end",display:"flex",gap:10}},m.default.createElement(i.Button,{size:"small",icon:m.default.createElement(t.UserOutlined,null)},d.username),m.default.createElement(O,null),m.default.createElement(L,{theme:s,onChange:f}),m.default.createElement(S,null),m.default.createElement(T,null)))))}function F(e){var t=n.useDecaf().client,o=l.useState(void 0),r=o[0],a=o[1];return l.useEffect(function(){t.barista.get("/version/").then(function(e){return a(e.data.version)})},[t]),m.default.createElement(i.Space,{direction:"vertical",size:"middle",style:{width:"100%"}},m.default.createElement(i.Descriptions,{title:"About",column:1,bordered:!0,style:{maxWidth:700,width:"100%"}},m.default.createElement(i.Descriptions.Item,{label:"Application Name"},e.appName),m.default.createElement(i.Descriptions.Item,{label:"Application Description"},e.appDescription),m.default.createElement(i.Descriptions.Item,{label:"Application Version"},"v"+e.appVersion),m.default.createElement(i.Descriptions.Item,{label:"DECAF Barista Version"},"v"+r)),e.content)}function V(e,t,n){var o=[].concat(e);return t.forEach(function(e){var t=o.findIndex(function(t){return t[n]===e[n]});t>=0?o[t]=e:o.push(e)}),o}Object.defineProperty(e,"GlobalStyle",{enumerable:!0,get:function(){return o.Global}}),Object.defineProperty(e,"css",{enumerable:!0,get:function(){return o.css}}),Object.defineProperty(e,"styled",{enumerable:!0,get:function(){return f.default}}),e.DecafWebapp=function(e){var o,r;l.useEffect(function(){var e=document.createElement("script");return e.defer=!0,e.setAttribute("data-domain",location.hostname),e.src="https://webax.svc.sys.decafhub.com/js/plausible.js",document.body.appendChild(e),function(){document.body.removeChild(e)}},[]);var a=V(e.routes,[{path:"/about",element:m.default.createElement(F,{appName:e.appName,appVersion:null==(o=e.config)?void 0:o.currentVersion,appDescription:e.appDescription,content:e.aboutPageContent})},{path:"*",element:m.default.createElement(h,null)}],"path"),i=V(e.menuItems,[{label:"About",to:"/about",icon:m.default.createElement(t.InfoCircleOutlined,null)}],"to");a=[{element:m.default.createElement(A,{menu:i,appName:e.appName}),path:"/",children:a,errorElement:m.default.createElement(b,null)}];var d=c.createBrowserRouter(a,{basename:null==(r=e.config)?void 0:r.basePath}),u=e.controller||n.DecafWebappController;return u.disableZendeskWidget=!0,m.default.createElement(D,{themeConfig:e.themeConfig,theme:e.theme},m.default.createElement(n.DecafApp,{config:e.config,controller:u},m.default.createElement(c.RouterProvider,{router:d})))},e.Page401=function(){return m.default.createElement(i.Result,{icon:m.default.createElement(t.LockFilled,{style:{color:"#ff603b"}}),title:"Authentication Error",subTitle:m.default.createElement(g,{message:"Your credentials are invalid. Please try to log in again."})})},e.Page403=function(){return m.default.createElement(i.Result,{status:"403",title:"Access Denied",subTitle:m.default.createElement(g,{message:"You are not authorized to access this content."})})},e.Page404=h,e.PageError=b,e.decafThemeDark=x,e.decafThemeLight=B,e.useTableMaxHeight=function(e,t){var n=l.useState(400),o=n[0],r=n[1],a=document.getElementById(e);return l.useLayoutEffect(function(){var e=function(){if(a){var e=80,n=a.parentElement;n&&(e=parseFloat(getComputedStyle(n,null).paddingBottom),e=isNaN(e)||e<10?80:e);var o=e+50+(t||0),l=a.getBoundingClientRect(),c=window.innerHeight-l.top-o;r(c>350?c:"100%")}};return e(),null==a||a.addEventListener("resize",e),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e),null==a||a.removeEventListener("resize",e)}},[e,a,t]),o}});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@emotion/react"),require("@emotion/styled"),require("@ant-design/icons"),require("antd"),require("react"),require("react-router-dom"),require("@decafhub/decaf-react"),require("antd/dist/reset.css"),require("@tanem/react-nprogress"),require("decimal.js"),require("js-cookie"),require("md5"),require("html2canvas")):"function"==typeof define&&define.amd?define(["exports","@emotion/react","@emotion/styled","@ant-design/icons","antd","react","react-router-dom","@decafhub/decaf-react","antd/dist/reset.css","@tanem/react-nprogress","decimal.js","js-cookie","md5","html2canvas"],t):t((e||self).decafReactWebapp={},e.react,e.styled,e.icons,e.antd,e.react,e.reactRouterDom,e.decafReact,0,e.reactNprogress,e.Decimal,e.jsCookie,e.md5,e.html2Canvas)}(this,function(e,t,n,a,r,l,o,i,c,u,d,s,f,m){function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g,h=/*#__PURE__*/p(n),b=/*#__PURE__*/p(l),E=/*#__PURE__*/p(d),v=/*#__PURE__*/p(s),y=/*#__PURE__*/p(f),w=/*#__PURE__*/p(m);function k(e){return b.default.createElement(b.default.Fragment,null,b.default.createElement(r.Typography,null,e.message),b.default.createElement(o.Link,{to:"/"},b.default.createElement(r.Button,{style:{marginTop:20}},"Home Page")))}function x(){return b.default.createElement(r.Result,{status:"404",title:"Page Not Found",subTitle:b.default.createElement(k,{message:"Sorry, the page you visited does not exist."})})}function C(){return b.default.createElement(r.Result,{status:"500",title:"Error",subTitle:b.default.createElement(k,{message:"Something went wrong. Please try again later. If the problem persists, please contact the administrator."})})}function B(){return B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},B.apply(this,arguments)}function S(e){var t=l.useState(0),n=t[0],a=t[1];return l.useLayoutEffect(function(){var t=document.getElementById(e),n=function(){if(t){var e=t.getBoundingClientRect().top,n=window.innerHeight-e-32-16;a(n)}};return n(),null==t||t.addEventListener("resize",n),window.addEventListener("resize",n),function(){window.removeEventListener("resize",n),null==t||t.removeEventListener("resize",n)}},[e]),n}function D(e,t){var n=!1;"#"===e[0]&&(e=e.slice(1),n=!0);var a=parseInt(e,16),r=(a>>16)+t;r>255?r=255:r<0&&(r=0);var l=(a>>8&255)+t;l>255?l=255:l<0&&(l=0);var o=(255&a)+t;return o>255?o=255:o<0&&(o=0),(n?"#":"")+String("000000"+(o|l<<8|r<<16).toString(16)).slice(-6)}function L(e,t){e.barista.get("/auth/"+(t?"logoutall":"logout"),{timeout:3e3}).catch(function(e){t&&(console.error(e),alert("Failed to logout from all devices. Please try to logout from each device individually."))}).finally(function(){v.default.remove("ember_simple_auth-session"),window.location.reload()})}function z(e){return function(t){return t?e.True:e.False}}function I(t){switch(new E.default(0).comparedTo(t)){case 1:return e.Direction.Short;case 0:return e.Direction.Square;case-1:return e.Direction.Long}return e.Direction.Square}function P(e,t,n){var a=[].concat(e);return t.forEach(function(e){var t=a.findIndex(function(t){return t[n]===e[n]});t>=0?a[t]=e:a.push(e)}),a}e.Direction=void 0,(g=e.Direction||(e.Direction={}))[g.Short=-1]="Short",g[g.Square=0]="Square",g[g.Long=1]="Long";var O="#10161d",T="rgb(31, 41, 55)",A="#f3f4f6",N="#2c3d50",j={colorBorder:"transparent",colorBorderSecondary:"transparent",colorBorderBg:"transparent"},R={hashed:!0,algorithm:[r.theme.defaultAlgorithm],components:{Layout:{colorBgHeader:"#ededed"}},token:{borderRadius:0,colorBgContainer:"white",colorBgBase:A,colorBgLayout:A,colorBgElevated:"#fafbfc"}},W={hashed:!0,components:{Layout:{colorBgHeader:O},Button:{boxShadow:"none",boxShadowSecondary:"none",colorBgContainer:N},Input:B({},j,{colorBgContainer:N}),Select:B({},j,{colorBgContainer:N}),Checkbox:B({},j,{colorBgContainer:N}),Dropdown:B({},j),DatePicker:B({},j,{colorBgContainer:N,colorBgElevated:N}),InputNumber:B({},j,{colorBgContainer:N}),Menu:{colorItemText:"rgba(255, 255, 255, 0.5)"}},token:{fontFamily:"Inter, sans-serif",colorPrimary:"#344961",colorBgBase:T,colorBgContainer:O,colorBgElevated:"rgb(20, 29, 41)",colorBorderSecondary:T,colorBorder:T,colorBgLayout:T,borderRadius:0,green:"#48734d",red:"#b03a38",blue:"#0d6efd",yellow:"#ffc107",orange:"#fd7e14",colorWhite:"#fff",colorLink:"#a4bfff",colorLinkHover:"#7199fb",colorLinkActive:"#7199fb"},algorithm:[r.theme.darkAlgorithm]};function q(e){var t,n,a,r,l,o,i,c={color:"white !important",":after":{borderBottomColor:"white"}};return{body:{background:null==(t=e.token)?void 0:t.colorBgBase,fontFamily:"Inter, sans-serif",margin:0},"#root":{minHeight:"100%"},button:{boxShadow:"none !important"},".ant-table-body":{overflow:"auto !important"},"#decaf-header":{position:"fixed",zIndex:999,right:0,left:0,paddingInline:16,display:"flex",alignItems:"center"},"#decaf-content":{paddingTop:64,paddingBottom:32,"#decaf-layout-breadcrumb":B({backgroundColor:null==(n=e.token)?void 0:n.colorBgElevated,display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",height:50,paddingInline:16,boxShadow:"0px 1px 2px rgba(0, 0, 0, 0.10)"},(l=function(e){var t="dark"===e?"255, 255, 255":"0, 0, 0";return{color:"rgba("+t+", 0.5) !important","&:hover":{color:"rgba("+t+", 0.75) !important"}}},o=B({},l("dark"),{"&:last-child":{color:"rgba(255, 255, 255, 0.85) !important"}}),i=B({},l("light"),{"&:last-child":{color:"rgba(0, 0, 0, 0.85) !important"}}),{".decaf-breadcrumb":{display:"flex",alignItems:"center",listStyle:"none",margin:0,padding:0,">li":B({"&.separator":{paddingInline:3,marginInline:3},"a, span":B({},l("light")),display:"flex",alignItems:"center",transition:"color 0.2s"},i),"&.dark":{">li":B({"a, span":B({},l("dark"))},o)}}})),"#decaf-layout-content-outlet":{minHeight:"100%",padding:16,"&.full-screen":{padding:"0 !important"}}},"#decaf-footer":{position:"fixed",bottom:0,right:0,left:0,paddingBlock:0,paddingInline:0,zIndex:999,boxShadow:"0px -2px 4px rgba(0, 0, 0, 0.15)",backgroundColor:null==(a=W.components)||null==(r=a.Layout)?void 0:r.colorBgHeader},".dot":{borderRadius:"50%",width:10,height:10,display:"inline-block",backgroundColor:"rgba(255,255,255,.25)","&.green":{backgroundColor:"#80ff00 !important"},"&.yellow":{backgroundColor:"#ff0 !important"},"&.orange":{backgroundColor:"#ff7000 !important"},"&.red":{backgroundColor:"#ff0000 !important"}},".ant-menu-light.ant-menu-horizontal >.ant-menu-item-selected":c,".ant-menu-light.ant-menu-horizontal >.ant-menu-submenu-selected, .ant-menu-light .ant-menu-submenu-selected >.ant-menu-submenu-title":c}}var F,M=b.default.createContext({theme:"dark",toggleTheme:function(){}}),H=function(){return b.default.useContext(M)};function V(e){var n=b.default.useState(function(){var t=e.theme||localStorage.getItem("decafAppTheme");return"dark"===t||"light"===t?t:"dark"}),a=n[0],l=n[1],o="light"===a?R:W;o=B({},o,e.themeConfig||{}),o=B({},o,{token:B({},o.token,{fontFamily:"Inter, sans-serif"})});var i,c,u="light"===a?function(e){return B({},q(e))}(o):function(e){var t,n,a,r,l,o,i,c,u,d,s,f,m,p,g;return B({},q(e),{"*":{"&::-webkit-scrollbar":{width:10,height:10},"&::-webkit-scrollbar-track":{background:null==(t=e.token)?void 0:t.colorBgContainer},"&::-webkit-scrollbar-thumb":{background:null==(n=e.token)?void 0:n.colorPrimary}},".ant-page-header-back-button, .ant-page-header-heading-title":{color:(null==(a=e.token)?void 0:a.colorWhite)+" !important"},".ant-badge-count":{color:(null==(r=e.token)?void 0:r.colorWhite)+" !important"},".ant-table-thead > tr > th":{background:D((null==(l=e.token)?void 0:l.colorBgContainer)||"",-5)+" !important","&:hover":{background:(null==(o=e.token)?void 0:o.colorBgContainer)+" !important"}},".ant-table-filter-dropdown":{"input, .ant-table-filter-dropdown-search-input":{background:(null==(i=e.token)?void 0:i.colorBgBase)+" !important"},".ant-dropdown-menu-item, .ant-dropdown-menu":{background:(null==(c=e.token)?void 0:c.colorBgContainer)+" !important"}},".ant-tabs-tab-active":{".ant-tabs-tab-btn":{color:(null==(u=e.token)?void 0:u.colorWhite)+" !important"}},".ant-radio-button-wrapper-checked":{backgroundColor:(null==(d=e.components)||null==(s=d.Button)?void 0:s.colorBgContainer)+" !important",color:(null==(f=e.token)?void 0:f.colorWhite)+" !important"},".ant-picker-date-panel":{".ant-picker-cell-in-range, .ant-picker-cell-range-start, .ant-picker-cell-range-end":{"&::before":{background:(null==(m=e.token)?void 0:m.colorBgBase)+" !important"},".ant-picker-cell-inner":{background:(null==(p=e.token)?void 0:p.colorBgBase)+" !important"}},".ant-picker-cell-range-start, .ant-picker-cell-range-end":{".ant-picker-cell-inner":{background:(null==(g=e.token)?void 0:g.colorPrimary)+" !important"}}}})}(o);return b.default.createElement(M.Provider,{value:{theme:a,toggleTheme:function(){var e="dark"===a?"light":"dark";l(e),localStorage.setItem("decafAppTheme",e)}}},b.default.createElement(r.ConfigProvider,{theme:o},b.default.createElement(t.Global,{styles:t.css(F||(i=["\n @import url(https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap);\n "],c||(c=i.slice(0)),i.raw=c,F=i))}),b.default.createElement(t.Global,{styles:u}),e.children))}function G(e){var t=e.items,n=e.itemRender,l=e.separator,i=H().theme,c=r.Grid.useBreakpoint(),u=t.slice(0,1).concat(t.slice(-1));return b.default.createElement("ul",{className:"decaf-breadcrumb "+i},function(e,t,n){var l=[];return e.forEach(function(i,c){if(i.href&&c!==e.length-1)l.push(b.default.createElement("li",{key:c},n?n(i):b.default.createElement(o.Link,{className:"decaf-breadcrumb-link",to:i.href},i.title)));else if(i.children){var u=i.children.map(function(e,t){return{key:t,label:b.default.createElement(o.Link,{className:"decaf-breadcrumb-link",to:e.href},e.title)}});l.push(b.default.createElement("li",{key:c},b.default.createElement(r.Dropdown,{menu:{items:u}},b.default.createElement("div",{style:{display:"flex",cursor:"pointer",gap:3}},b.default.createElement("span",null,i.title),b.default.createElement(a.DownOutlined,{style:{fontSize:12}})))))}else l.push(b.default.createElement("li",{key:c},i.title));c<e.length-1&&l.push(b.default.createElement("li",{key:"sep-"+c,className:"separator"},t))}),l}(c.lg?t:u,l||b.default.createElement(a.RightOutlined,null),n))}function _(){var e=r.theme.useToken().token,t=r.Grid.useBreakpoint();return b.default.createElement(r.Button,{type:"link",href:"https://docs.decafhub.com",target:"_blank",rel:"noreferrer",icon:b.default.createElement(a.QuestionCircleOutlined,null),style:{backgroundColor:e.colorBgElevated}},!t.xs&&"Documentation")}function U(){return b.default.createElement("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 649.6 767.9",enableBackground:"new 0 0 649.6 767.9",xmlSpace:"preserve",width:32,height:32},b.default.createElement("g",null,b.default.createElement("path",{fill:"#52CEF4",d:"M324,767.9c-6.6-5.1-14.2-8.6-21.3-12.9c-22-13-44.3-25.6-66.4-38.5c-21.3-12.4-42.5-25-63.8-37.4\n c-33.5-19.5-67.1-39-100.7-58.5c-22.7-13.2-45.3-26.5-68-39.6c-2.8-1.6-3.8-3.3-3.8-6.5c0.2-58.6-0.2-117.3,0.4-175.9\n C1,333,0.7,267.3,1,201.6c0-1.8-0.6-3.7,0.6-5.4c6.4,3.8,12.7,7.6,19.1,11.3c23.8,13.9,47.7,27.9,71.5,41.8\n c4.9,2.9,9.6,6.2,14.9,8.4c-1.2,5.2-0.2,10.3-0.1,15.5c0.5,56.1-0.2,112.2,0.9,168.3c0.3,18.4,0.2,36.8,0.2,55.2\n c0,3,0.7,4.9,3.5,6.4c6.3,3.4,12.3,7.3,18.5,11c26.1,15.7,52.3,31.5,78.4,47.2c33,19.8,66,39.6,99,59.3c5.7,3.4,10.9,7.5,17.2,9.7\n c0,1.5,0.1,2.9,0.1,4.4c0,42.4,0,84.8,0,127.3c0,1.8-0.7,3.7,0.8,5.3c0,0.2,0,0.4,0,0.7C325.1,767.9,324.5,767.9,324,767.9z"}),b.default.createElement("path",{fill:"#227EC3",d:"M107.1,257.6c-5.3-2.2-10-5.5-14.9-8.4c-23.8-13.9-47.7-27.8-71.5-41.8c-6.4-3.7-12.7-7.6-19.1-11.3\n c8.2-6,17.1-10.7,25.7-16c28.7-17.5,57.5-34.9,86.3-52.4c39.2-23.8,78.5-47.6,117.7-71.4c27-16.3,53.9-32.7,80.9-49\n c4-2.4,8.1-4.6,11.7-7.4c1.3,0,2.7,0,4,0c0.3,1.6,1.9,1.8,2.9,2.4c31,18.9,62,37.8,93.1,56.4c4.2,2.5,5.9,5.2,5.9,10.3\n c-0.3,38.3-0.1,76.7-0.1,115c0,2.7-0.1,5.3-0.2,8c-10.5-6.3-21-12.5-31.4-18.9c-23.1-14-46.2-28-69.3-42c-1.6-1-2.8-1.6-5-0.4\n c-26.8,15.8-53.7,31.5-80.6,47.2c-26.1,15.2-52.2,30.4-78.3,45.7C145.7,235,126.4,246.3,107.1,257.6z"}),b.default.createElement("path",{fill:"#409DD5",d:"M324.7,630.2c5.2-4.2,11-7.4,16.7-10.9c32.6-20.3,65.3-40.6,98-60.8c30.8-19,61.6-38,92.4-57\n c7.5-4.6,7.5-4.6,7.5-13.6c0-58.6,0.1-117.3,0.1-175.9c0-1.6-0.1-3.2-0.1-4.8c0.8-1.5,0.4-3.1,0.4-4.7c0.1-14.7,0.2-29.5,0.3-44.2\n c1.3,0.1,2.4-0.4,3.4-1c8.7-5.1,17.4-10.2,26.1-15.3c15.8-9.2,31.7-18.3,47.6-27.5c10.5-6.1,21.1-12.3,31.6-18.4\n c1.5,0.9,0.8,2.4,0.8,3.6c0,124.2,0,248.4,0.1,372.6c0,2.7-0.9,4-3.1,5.3c-35.3,20.8-70.5,41.7-105.8,62.6\n c-27.2,16.1-54.5,32.2-81.7,48.4c-27,16-54,32.1-81,48c-17.4,10.3-34.8,20.4-52.3,30.7c-1.5-1.6-0.8-3.5-0.8-5.3\n c0-42.4,0-84.8,0-127.3C324.8,633.2,324.7,631.7,324.7,630.2z"}),b.default.createElement("path",{fill:"#227EC3",d:"M648.7,196.1c-10.5,6.1-21,12.3-31.6,18.4c-15.8,9.2-31.7,18.3-47.6,27.5c-8.7,5.1-17.4,10.2-26.1,15.3\n c-1,0.6-2.1,1.1-3.4,1c0-12.4-0.1-24.8-0.1-37.2c0-30.2,0-60.5,0-91c2.8,0.3,4.5,2,6.5,3.1c28.4,17.3,56.8,34.7,85.2,52\n C637.3,188.8,643.4,191.8,648.7,196.1z"}),b.default.createElement("path",{fill:"#227EC3",d:"M216.2,322.3c-0.3-1.6-0.4-2.9,1.4-4c29.2-18,58.4-36.1,87.5-54.1c4.7-2.9,9.5-5.8,14.2-8.9\n c1.5-1,2.7-1.1,4.3-0.2c26.9,15.9,53.8,31.8,80.7,47.7c7.1,4.2,14.1,8.5,21.4,12.4c3.5,1.9,4.8,4.3,3.9,8c-1.7,1.1-3.3,2.2-5,3.2\n c-20.5,11.9-41.1,23.8-61.6,35.7c-13,7.6-26.1,15.2-39.1,22.8c-7-4-14-8.1-21-12.1c-21.7-12.7-43.2-25.5-65-38\n C230.7,330.5,223.8,325.8,216.2,322.3z"}),b.default.createElement("path",{fill:"#52CEF4",d:"M216.2,322.3c7.6,3.5,14.5,8.2,21.8,12.4c21.7,12.5,43.3,25.3,65,38c7,4.1,14,8.1,21,12.1\n c0,39.3,0.1,78.6,0.1,117.9c-1.5,0.9-2.5-0.4-3.6-1c-21.3-12.8-42.5-25.5-63.7-38.3c-13.3-8-26.5-16.1-39.8-24\n c-1.8-1.1-2.5-2.3-2.5-4.4c0.4-26.9,0.4-53.8,1.1-80.7C215.8,343.6,215.4,332.9,216.2,322.3z"}),b.default.createElement("path",{fill:"#409DD5",d:"M324,502.6c0-39.3-0.1-78.6-0.1-117.9c13-7.6,26.1-15.2,39.1-22.8c20.5-11.9,41.1-23.8,61.6-35.7\n c1.7-1,3.3-2.1,5-3.2c0.1,7.6,0.1,15.2,0.1,22.8c0,30.5,0,61,0,91.5c0,2.6-0.4,4.4-2.9,5.8c-31.6,18.2-63,36.5-94.5,54.8\n C329.6,499.6,327.2,501.8,324,502.6z"})))}function Y(e){var t=[];return e.forEach(function(e){var n={key:"to"in e?e.to:e.label,label:e.label,icon:e.icon};"to"in e&&e.to?n.label=b.default.createElement(o.NavLink,{to:e.to,end:"/"===e.to},e.label):"href"in e&&e.href?n.label=b.default.createElement("a",{href:e.href},e.label):e.children&&(n.label=e.label,n.children=Y(e.children||[])),t.push(n)}),t}function K(){return b.default.createElement(r.Typography.Text,{type:"secondary"},"Powered by"," ",b.default.createElement("a",{href:"https://teloscube.com",target:"_blank",rel:"noreferrer"},"Teloscube"))}function Q(e){var t=b.default.useState(!1),n=t[0],i=t[1],c=o.useMatches(),u=o.useLocation(),d=r.Grid.useBreakpoint().md,s=Y(e.menu),f=c.map(function(e){return e.pathname}).filter(function(e){return"/"===u.pathname||"/"!==e});l.useEffect(function(){d||i(!1)},[u.pathname,d]);var m=b.default.createElement(r.Menu,{items:[].concat(s),selectedKeys:f,mode:d?"horizontal":"inline",overflowedIndicator:b.default.createElement(a.EllipsisOutlined,{style:{fontSize:20,color:"white"}}),style:{flex:"auto",justifyContent:"flex-end",backgroundColor:"transparent",border:"none",minWidth:0}});return d?m:b.default.createElement("div",{style:{display:"flex",flex:"auto",justifyContent:"flex-end"}},b.default.createElement(a.MenuOutlined,{style:{fontSize:20,marginRight:20},onClick:function(){return i(!n)}}),b.default.createElement(r.Drawer,{open:n,footer:b.default.createElement(K,null),onClose:function(){return i(!1)},bodyStyle:{padding:10},width:document.body.clientWidth-50>350?350:.85*document.body.clientWidth},m))}function X(){return b.default.createElement("div",{style:{display:"flex"}},b.default.createElement(r.Button,{type:"text",icon:b.default.createElement(a.UpOutlined,null),title:"Scroll to top",onClick:function(){return window.scrollTo({top:0,behavior:"smooth"})}}),b.default.createElement(r.Button,{type:"text",icon:b.default.createElement(a.DownOutlined,null),title:"Scroll to bottom",onClick:function(){return window.scrollTo({top:document.body.scrollHeight,behavior:"smooth"})}}))}function Z(e){var t=function(){try{var e=document.getElementById("decaf-footer");return null==e||e.style.setProperty("display","none"),Promise.resolve(w.default(document.body)).then(function(t){var n=t.toDataURL("image/png");null==e||e.style.setProperty("display","block");var a=document.createElement("a");a.download="screenshot.png",a.href=n,a.click(),a.remove()})}catch(e){return Promise.reject(e)}};return e.triggerNode?b.default.cloneElement(e.triggerNode,{onClick:t}):b.default.createElement(r.Button,{type:"text",icon:b.default.createElement(a.CameraOutlined,null),title:"Take a screenshot of the current page",onClick:t})}function J(e){return b.default.createElement(r.Button,{type:"text",icon:b.default.createElement("dark"===e.theme?a.BulbFilled:a.BulbOutlined,null),title:"dark"===e.theme?"Switch to light theme":"Switch to dark theme",onClick:function(){return e.onChange()}})}function $(){var e=l.useState(void 0),t=e[0],n=e[1],c=i.useDecaf(),u=o.useNavigate();l.useEffect(function(){var e,t;c.me.email&&(e=c.me.email,t="https://www.gravatar.com/avatar/"+y.default(e),fetch(t+"?d=404",{method:"HEAD"}).then(function(e){return 200!==e.status?void 0:t}).catch(function(){})).then(n)},[c.me.email]);var d=[{key:"me",label:c.me.fullname||c.me.username,title:c.me.email,disabled:!0,icon:b.default.createElement(a.UserOutlined,null),style:{cursor:"default"}},{key:"divider-1",dashed:!0,type:"divider"},{key:"logout",label:"Logout",icon:b.default.createElement(a.LogoutOutlined,null),onClick:function(){return L(c.client,!1)}},{key:"logout-all",label:"Logout All Sessions",icon:b.default.createElement(a.LogoutOutlined,null),onClick:function(){return window.confirm("Logout from all sessions?")&&L(c.client,!0)}},{key:"divider-2",dashed:!0,type:"divider"},{key:"about",label:"About",icon:b.default.createElement(a.InfoCircleOutlined,null),onClick:function(){return u("/about")}}],s=t?{src:t}:{icon:b.default.createElement(a.UserOutlined,{style:{color:"rgba(255,255,255, 0.5)"}}),style:{backgroundColor:"transparent",border:"1px solid rgba(255,255,255, 0.5)"}};return b.default.createElement(r.Dropdown,{trigger:["click"],menu:{items:d}},b.default.createElement(r.Avatar,B({},s,{style:B({},s.style,{cursor:"pointer"})})))}function ee(e){var t=e.split("/"),n=t.indexOf("webapps");return-1===n?"":t.slice(n+3).join("/")}function te(){var e,t,n,l=-1===(t=(e=window.location.href.split("/")).indexOf("webapps"))?"":e[t+1],o=function(e){var t=window.location.href.split("/"),n=t.indexOf("webapps");return-1===n?"":t[n+2]}(),i=function(e){return e.startsWith("preview-")&&e.length>8}(n=o)?"preview":function(e){return e.startsWith("v")&&e.length>1}(n)?"release":n,c=r.Grid.useBreakpoint().md,u=[{code:"development",name:"Development Version",color:"red",url:"/webapps/"+l+"/development/"+ee(window.location.href),show:"development"===process.env.NODE_ENV},{code:"testing",name:"Testing Version",color:"orange",url:"/webapps/"+l+"/testing/"+ee(window.location.href),show:!0},{code:"staging",name:"Staging Version",color:"yellow",url:"/webapps/"+l+"/staging/"+ee(window.location.href),show:!0},{code:"production",name:"Production Version",color:"green",url:"/webapps/"+l+"/production/"+ee(window.location.href),show:!0},{code:"preview",name:"Preview Version",color:"grey",url:"/",show:!1},{code:"release",name:"Release Version",color:"grey",url:"/",show:!1}],d=u.find(function(e){return e.code===i}),s="production"===(null==d?void 0:d.code);return d?b.default.createElement(r.Dropdown,{placement:"top",arrow:!0,menu:{items:u.filter(function(e){return e.show}).map(function(e){return{key:e.name,label:b.default.createElement("span",null,b.default.createElement("i",{className:"dot "+e.color})," ",e.name),onClick:function(){window.location.href=e.url}}})}},b.default.createElement(r.Button,{type:"text",style:{width:s?32:"initial",padding:s?0:"revert",display:"flex",alignItems:"center"},icon:b.default.createElement("i",{className:"dot "+(null==d?void 0:d.color)})},b.default.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"}},!s&&c&&b.default.createElement(b.default.Fragment,null,b.default.createElement("span",{style:{marginInline:5}},"You are on ",b.default.createElement("b",null,d.name)),b.default.createElement(a.CaretUpOutlined,null))))):null}var ne="https://static.zdassets.com/ekr/snippet.js";function ae(){var e=i.useDecaf(),t=e.me,n=e.publicConfig,o=l.useState(!1),c=o[0],u=o[1],d=r.theme.useToken().token,s=r.Grid.useBreakpoint();return l.useEffect(function(){if(n.zendesk&&"undefined"!=typeof document){var e=document.createElement("script");return e.src=ne+"?key="+n.zendesk,e.async=!0,e.id="ze-snippet",e.onload=function(){window.zE("webWidget","hide"),window.zE("webWidget:on","open",function(){window.zE("webWidget","show"),u(!0)}),window.zE("webWidget:on","close",function(){window.zE("webWidget","hide"),u(!1)})},document.body.appendChild(e),window.zESettings={webWidget:{offset:{horizontal:-7,vertical:20}},contactForm:{subject:!0,fields:[{id:"name",prefill:{"*":t.fullname}},{id:"email",prefill:{"*":t.email}}]}},function(){document.body.removeChild(e)}}},[n,t]),n.zendesk?b.default.createElement(r.Button,{type:"link",icon:b.default.createElement(a.MessageOutlined,null),style:{backgroundColor:d.colorBgElevated},onClick:function(){c?null==window.zE||window.zE("webWidget","close"):null==window.zE||window.zE("webWidget","open"),u(!c)}},!s.xs&&"Support"):null}function re(e){var t=o.useLocation(),n=o.useNavigation(),a=o.useMatches(),l=r.Grid.useBreakpoint(),i=H(),c=i.theme,u=i.toggleTheme,d=null==a?void 0:a[(null==a?void 0:a.length)-1],s=!(null==d||!d.handle.fullScreen),f=null==d?void 0:d.handle.extras;return b.default.createElement(r.Layout,{style:{height:"100%"}},b.default.createElement(oe,{isAnimating:"loading"===n.state,key:t.key}),b.default.createElement(r.ConfigProvider,{theme:W},b.default.createElement(r.Layout.Header,{id:"decaf-header"},b.default.createElement(le,{title:e.appName}),b.default.createElement(Q,{title:e.appName,menu:e.menu}),b.default.createElement($,null))),b.default.createElement(r.Layout.Content,{id:"decaf-content",style:{flex:1,minHeight:"100%"}},b.default.createElement(ie,null,f),b.default.createElement("div",{id:"decaf-layout-content-outlet",className:s?"full-screen":""},b.default.createElement(o.Outlet,null))),b.default.createElement(r.ConfigProvider,{theme:W},b.default.createElement(r.Layout.Footer,{id:"decaf-footer"},b.default.createElement(r.Row,{justify:"space-between",align:"middle"},b.default.createElement(r.Col,{span:l.lg?10:12},b.default.createElement(ae,null),b.default.createElement("span",{style:{display:"inline-block",width:1}}),b.default.createElement(_,null)),b.default.createElement(r.Col,{span:l.lg?4:0,style:{textAlign:"center"}},b.default.createElement(K,null)),b.default.createElement(r.Col,{span:l.lg?10:12,style:{justifyContent:"flex-end",display:"flex",gap:10}},b.default.createElement(te,null),b.default.createElement(J,{theme:c,onChange:u}),b.default.createElement(Z,null),b.default.createElement(X,null))))))}function le(e){var t=e.title,n=r.Grid.useBreakpoint();return b.default.createElement(o.Link,{to:"/",style:{display:"flex",alignItems:"center",gap:10}},b.default.createElement(U,null),n.lg&&b.default.createElement(r.Typography.Title,{level:1,style:{margin:0,fontWeight:"normal",fontSize:20,color:"rgba(255, 255, 255, 0.75)",whiteSpace:"nowrap"}},t))}function oe(e){var t=u.useNProgress({isAnimating:e.isAnimating}),n=t.animationDuration;return b.default.createElement("div",{style:{opacity:t.isFinished?0:1,pointerEvents:"none",transition:"opacity "+n+"ms linear"}},b.default.createElement("div",{style:{background:"#29d",height:2,left:0,marginLeft:100*(-1+t.progress)+"%",position:"fixed",top:0,transition:"margin-left "+n+"ms linear",width:"100%",zIndex:1031}},b.default.createElement("div",{style:{boxShadow:"0 0 10px #29d, 0 0 5px #29d",display:"block",height:"100%",opacity:1,position:"absolute",right:0,transform:"rotate(3deg) translate(0px, -4px)",width:100}})))}function ie(e){var t=o.useMatches().filter(function(e){var t;return Boolean(null==(t=e.handle)?void 0:t.crumb)}).map(function(e){return e.handle.crumb(e.data)}),n=[{href:"/",title:b.default.createElement(a.HomeOutlined,null)}].concat(t).map(function(e,t){return B({},e,{_key:t})});return n.length<2?b.default.createElement(b.default.Fragment,null):b.default.createElement("div",{id:"decaf-layout-breadcrumb"},b.default.createElement(G,{items:n}),b.default.createElement("div",null,e.children))}function ce(e){var t=i.useDecaf().client,n=l.useState(void 0),a=n[0],o=n[1],c=l.useState(void 0),u=c[0],d=c[1],s=l.useState(void 0),f=s[0],m=s[1];return l.useEffect(function(){t.bare.get("/_cultproxy").then(function(e){return o(e.data.version)}),t.barista.get("/version/").then(function(e){return d(e.data.version)}),t.bare.get("/apis/estate/version").then(function(e){return m(e.data)})},[t]),b.default.createElement(r.Row,{gutter:[16,16]},b.default.createElement(r.Col,{xs:{span:24},sm:{span:24},md:{span:24},lg:{span:12},xl:{span:8},xxl:{span:6}},b.default.createElement(r.Card,{bordered:!1},b.default.createElement(r.Statistic,{title:"Application Name",value:e.appName}))),b.default.createElement(r.Col,{xs:{span:24},lg:{span:12},xl:{span:16},xxl:{span:18}},b.default.createElement(r.Card,{bordered:!1},b.default.createElement(r.Statistic,{title:"Application Description",value:e.appDescription}))),b.default.createElement(r.Col,{xs:{span:24},sm:{span:24},md:{span:12},lg:{span:12},xl:{span:6},xxl:{span:6}},b.default.createElement(r.Card,{bordered:!1},b.default.createElement(r.Statistic,{title:"Application Version",value:e.appVersion,prefix:"v"}))),b.default.createElement(r.Col,{xs:{span:24},sm:{span:24},md:{span:12},lg:{span:12},xl:{span:6},xxl:{span:6}},b.default.createElement(r.Card,{bordered:!1},b.default.createElement(r.Statistic,{title:"DECAF Cultproxy Version",value:a,prefix:"v"}))),b.default.createElement(r.Col,{xs:{span:24},sm:{span:24},md:{span:12},lg:{span:12},xl:{span:6},xxl:{span:6}},b.default.createElement(r.Card,{bordered:!1},b.default.createElement(r.Statistic,{title:"DECAF Barista Version",value:u,prefix:"v"}))),b.default.createElement(r.Col,{xs:{span:24},sm:{span:24},md:{span:12},lg:{span:12},xl:{span:6},xxl:{span:6}},b.default.createElement(r.Card,{bordered:!1},b.default.createElement(r.Statistic,{title:"DECAF Estate Version",value:f,prefix:"v"}))),b.default.createElement(r.Col,{span:24},e.content))}var ue=["crumb","fullScreen","extras","children"];function de(e){var t,n,a=i.useDecaf(),r=[{path:"/about",element:b.default.createElement(ce,{appName:e.appName,appVersion:null==(t=e.config)?void 0:t.currentVersion,appDescription:e.appDescription,content:null==e.buildAboutPageContent?void 0:e.buildAboutPageContent(a)}),crumb:function(){return{title:"About"}}},{path:"*",element:b.default.createElement(x,null),crumb:function(){return{title:"Error: Page Not Found"}}}],l=P(e.buildRouteItems(a),r,"path"),c=o.createBrowserRouter(function(e,t,n){return[{element:b.default.createElement(re,{menu:e.buildMenuItems(t),appName:e.appName}),path:"/",children:n.map(se),errorElement:b.default.createElement(C,null)}]}(e,a,l),{basename:null==(n=e.config)?void 0:n.basePath});return b.default.createElement(o.RouterProvider,{router:c})}function se(e){var t=e.crumb,n=e.fullScreen,a=e.extras,r=e.children;return B({},function(e,t){if(null==e)return{};var n,a,r={},l=Object.keys(e);for(a=0;a<l.length;a++)t.indexOf(n=l[a])>=0||(r[n]=e[n]);return r}(e,ue),r?{handle:{crumb:t,fullScreen:n,extras:a},children:r.map(se)}:{handle:{crumb:t,fullScreen:n,extras:a}})}Object.defineProperty(e,"GlobalStyle",{enumerable:!0,get:function(){return t.Global}}),Object.defineProperty(e,"css",{enumerable:!0,get:function(){return t.css}}),Object.defineProperty(e,"styled",{enumerable:!0,get:function(){return h.default}}),e.DecafWebapp=function(e){l.useEffect(function(){var e=function(){var e=document.createElement("script");return e.defer=!0,e.setAttribute("data-domain",location.hostname),e.src="https://webax.svc.sys.decafhub.com/js/plausible.js",e}();return document.body.appendChild(e),function(){document.body.removeChild(e)}},[]);var t=e.controller||i.DecafWebappController;return t.disableZendeskWidget=!0,b.default.createElement(V,{themeConfig:e.themeConfig,theme:e.theme},b.default.createElement(i.DecafApp,{config:e.config,controller:t},b.default.createElement(de,B({},e))))},e.Page401=function(){return b.default.createElement(r.Result,{icon:b.default.createElement(a.LockFilled,{style:{color:"#ff603b"}}),title:"Authentication Error",subTitle:b.default.createElement(k,{message:"Your credentials are invalid. Please try to log in again."})})},e.Page403=function(){return b.default.createElement(r.Result,{status:"403",title:"Access Denied",subTitle:b.default.createElement(k,{message:"You are not authorized to access this content."})})},e.Page404=x,e.PageError=C,e.booleanMap=z,e.decafThemeDark=W,e.decafThemeLight=R,e.directionMap=function(t){return function(n){switch(I(n)){case e.Direction.Short:return t.Short;case e.Direction.Square:return t.Square;case e.Direction.Long:return t.Long}}},e.nullableBooleanMap=function(e){return function(t){return null==t?e.Null:z(e)(t)}},e.setAtKey=P,e.toDirection=I,e.useDecafTheme=H,e.useRemaningHeight=S,e.useTableMaxHeight=function(e,t){var n=l.useState(400),a=n[0],r=n[1],o=S(e),i=document.getElementById(e);return l.useLayoutEffect(function(){if(i){var e=null==i?void 0:i.closest(".ant-table-wrapper"),n=new ResizeObserver(function(){var n,a,l,i,c,u=null!=(n=null==e||null==(a=e.querySelector(".ant-table-header"))?void 0:a.getBoundingClientRect().height)?n:0,d=null!=(l=null==e||null==(i=e.querySelector(".ant-table-footer"))?void 0:i.getBoundingClientRect().height)?l:0,s=null!=(c=null==e?void 0:e.querySelectorAll(".ant-pagination"))?c:[],f=32*s.length,m=Array.from(s).reduce(function(e,t){return e+t.getBoundingClientRect().height},0);r(o>350?o-u-d-m-f-(t||0):"100%")});return n.observe(e,{box:"content-box"}),function(){n.disconnect()}}},[t,o,i]),a}});
|
|
2
2
|
//# sourceMappingURL=index.umd.js.map
|