@pautena/react-design-system 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/placeholders/placeholder/placeholder.d.ts +2 -1
- package/dist/cjs/types/layouts/header-layout/header-layout.d.ts +9 -2
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/placeholders/placeholder/placeholder.d.ts +2 -1
- package/dist/esm/types/layouts/header-layout/header-layout.d.ts +9 -2
- package/dist/index.d.ts +11 -3
- package/package.json +1 -1
- package/src/components/feedback/feedback.stories.mdx +1 -0
- package/src/components/placeholders/placeholder/placeholder.tsx +3 -1
- package/src/layouts/header-layout/header-layout.stories.tsx +28 -0
- package/src/layouts/header-layout/header-layout.test.tsx +73 -8
- package/src/layouts/header-layout/header-layout.tsx +36 -4
|
@@ -10,11 +10,12 @@ export interface PlaceholderIconArgs {
|
|
|
10
10
|
size: number;
|
|
11
11
|
color: IconColor;
|
|
12
12
|
}
|
|
13
|
+
export type PlaceholderIcon = ({ size, color }: PlaceholderIconArgs) => ReactElement;
|
|
13
14
|
export interface PlaceholderProps {
|
|
14
15
|
title: string;
|
|
15
16
|
subtitle: string;
|
|
16
17
|
iconSize?: number;
|
|
17
|
-
icon?:
|
|
18
|
+
icon?: PlaceholderIcon;
|
|
18
19
|
actions?: PlaceholderAction[];
|
|
19
20
|
}
|
|
20
21
|
export declare const Placeholder: ({ title, subtitle, icon, iconSize, actions, }: PlaceholderProps) => JSX.Element;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import { ContentElement, HeaderElement } from "../../components";
|
|
1
|
+
import { ContentElement, HeaderElement, PlaceholderIcon } from "../../components";
|
|
2
|
+
export interface HeaderLayoutError {
|
|
3
|
+
icon?: PlaceholderIcon;
|
|
4
|
+
title?: string;
|
|
5
|
+
message: string;
|
|
6
|
+
}
|
|
2
7
|
export interface HeaderLayoutProps {
|
|
3
8
|
loading?: boolean;
|
|
9
|
+
fetching?: boolean;
|
|
10
|
+
error?: HeaderLayoutError;
|
|
4
11
|
children: [HeaderElement, ContentElement];
|
|
5
12
|
}
|
|
6
|
-
export declare const HeaderLayout: ({ loading, children }: HeaderLayoutProps) => JSX.Element;
|
|
13
|
+
export declare const HeaderLayout: ({ loading, children, fetching, error }: HeaderLayoutProps) => JSX.Element;
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{InputAdornment as e,Button as t,useTheme as n,Box as r,Typography as o,Tooltip as a,TextField as i,IconButton as l,Paper as c,Switch as u,Grid as s,Rating as d,CircularProgress as m,Alert as f,AlertTitle as p,Badge as v,Link as y,Snackbar as h,Container as g,Breadcrumbs as E,Tabs as b,Tab as x,styled as S,drawerClasses as w,Drawer as C,Divider as k,paperClasses as O,ListSubheader as I,List as $,ListItemButton as T,ListItemIcon as P,ListItemText as j,Collapse as z,Popover as R,ListItemAvatar as N,Avatar as W,AppBar as A,Toolbar as M,FormControl as D,InputLabel as F,Select as V,LinearProgress as _,Stack as q,outlinedInputClasses as L,inputLabelClasses as B,circularProgressClasses as H,linearProgressClasses as U,autocompleteClasses as Y,iconButtonClasses as J,OutlinedInput as X,FormHelperText as G,Autocomplete as K,tabsClasses as Q,TableHead as Z,TableRow as ee,TableCell as te,TableSortLabel as ne,TableContainer as re,Table as oe,TableBody as ae,Skeleton as ie,alertClasses as le,Dialog as ce,DialogTitle as ue,DialogContent as se,DialogActions as de,FormControlLabel as me,Checkbox as fe,MenuItem as pe,Menu as ve}from"@mui/material";import*as ye from"react";import he,{useState as ge,forwardRef as Ee,useRef as be,useEffect as xe,createContext as Se,useContext as we,useId as Ce,useMemo as ke}from"react";import Oe from"@mui/icons-material/Check";import Ie from"@mui/icons-material/Clear";import $e from"@mui/icons-material/Edit";import Te from"@mui/icons-material/Close";import{format as Pe}from"date-fns";import{DateTimePicker as je,TimePicker as ze,DatePicker as Re,DesktopDatePicker as Ne}from"@mui/x-date-pickers";import{Link as We,useLocation as Ae,useNavigate as Me,useParams as De,Routes as Fe,Route as Ve}from"react-router-dom";import{blueGrey as _e}from"@mui/material/colors";import qe from"markdown-to-jsx";import Le from"@mui/icons-material/ChevronLeft";import Be from"@mui/icons-material/ExpandMore";import He from"@mui/icons-material/ChevronRight";import Ue from"@mui/icons-material/Menu";import{LoadingButton as Ye}from"@mui/lab";import Je from"@mui/icons-material/Search";import{loremIpsum as Xe}from"lorem-ipsum";import Ge from"@mui/icons-material/ExpandLess";import{DataGrid as Ke}from"@mui/x-data-grid";import Qe from"@mui/icons-material/MoreVert";var Ze=function(n){var r=n.onClickCancel,o=n.onSubmitEdit,a=n.sx;return he.createElement(e,{position:"end",sx:a},he.createElement(t,{variant:"contained",size:"small",color:"error",startIcon:he.createElement(Ie,null),onClick:r,sx:{paddingRight:0,minWidth:0,marginRight:1}}),he.createElement(t,{variant:"contained",size:"small",color:"primary",startIcon:he.createElement(Oe,null),onClick:o,sx:{paddingRight:0,minWidth:0}}))},et=function(e,t){var n=ge(!1),r=n[0],o=n[1],a=ge(e),i=a[0],l=a[1],c=function(){o(!1),l(e)};return{isEditing:r,cancelEdit:c,editValue:i,setEditValue:l,startEdit:function(){o(!0)},submitEdit:function(){t(i),c()}}},tt="-",nt=function(e){return"label-".concat(e.replace(/ /g,"-"))},rt=function(e){var t=e.label,i=e.tooltip,l=e.tooltipEnterDelay,c=void 0===l?2e3:l,u=e.children,s=e.dense,d=n().typography,m=nt(t);return he.createElement(r,{width:1,lineHeight:s?0:void 0},he.createElement(o,{variant:s?"caption":"subtitle2",role:"label",id:m,lineHeight:s?d.pxToRem(15):void 0},t),i?he.createElement(a,{title:i,placement:"top",enterDelay:c},u):u)},ot=function(e){var t=e.label,n=e.value,r=e.placeholder,a=void 0===r?tt:r,c=e.editable,u=e.dense,s=e.onEdit,d=void 0===s?function(){return null}:s,m=et(null==n?void 0:n.toString(),d),f=m.isEditing,p=m.editValue,v=m.startEdit,y=m.cancelEdit,h=m.setEditValue,g=m.submitEdit,E=nt(t),b=(null==n?void 0:n.toString())||a;return he.createElement(rt,{label:t,tooltip:b,dense:u},f?he.createElement(i,{value:p,size:"small",onChange:function(e){return h(e.target.value)},InputProps:{endAdornment:he.createElement(Ze,{onClickCancel:y,onSubmitEdit:g})}}):he.createElement(o,{variant:u?"body1":"h5",noWrap:!0,"aria-labelledby":E},b,c&&he.createElement(l,{size:"small",onClick:v,sx:{ml:1}},he.createElement($e,null))))},at=function(e){var t=e.children;return he.createElement(c,{sx:{p:2}},t)},it=function(e){var t=e.label,a=e.value,i=e.placeholder,c=void 0===i?tt:i,s=e.editable,d=e.dense,m=e.onEdit,f=void 0===m?function(){return null}:m,p=n().typography,v=et(a,f),y=v.isEditing,h=v.editValue,g=v.startEdit,E=v.cancelEdit,b=v.setEditValue,x=v.submitEdit,S={fontSize:d?p.h6.fontSize:p.h5.fontSize};return he.createElement(rt,{label:t,dense:d},y?he.createElement(r,{display:"flex",alignItems:"center"},he.createElement(u,{checked:h,onChange:function(e){return b(e.target.checked)}}),he.createElement(Ze,{onClickCancel:E,onSubmitEdit:x})):he.createElement(r,{display:"flex",alignItems:"center"},void 0===a?he.createElement(o,{variant:"h5"},c):a?he.createElement(Oe,{color:"success",sx:S}):he.createElement(Te,{color:"error",sx:S}),s&&he.createElement(l,{size:"small",onClick:g,sx:{ml:1}},he.createElement($e,null))))},lt=function(){return lt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},lt.apply(this,arguments)};function ct(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function ut(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}var st=function(e){var t=e.label,n=e.value,a=e.format,c=e.placeholder,u=void 0===c?tt:c,s=e.editable,d=e.editInputType,m=void 0===d?"datetime":d,f=e.dense,p=e.onEdit,v=et(n,void 0===p?function(){return null}:p),y=v.isEditing,h=v.editValue,g=v.startEdit,E=v.cancelEdit,b=v.setEditValue,x=v.submitEdit,S=nt(t),w=n&&Pe(n,a)||u,C="datetime"===m?je:"time"===m?ze:Re;return he.createElement(rt,{label:t,tooltip:w,dense:f},y?he.createElement(C,{value:h,format:a,onChange:function(e){return b(e||void 0)},slots:{textField:function(e){var t;return he.createElement(i,lt({},e,{InputProps:lt(lt({},e.InputProps),{endAdornment:he.createElement(he.Fragment,null,null===(t=e.InputProps)||void 0===t?void 0:t.endAdornment,he.createElement(Ze,{onClickCancel:E,onSubmitEdit:x,sx:{ml:2}}))})}))}}}):he.createElement(r,{display:"flex",alignItems:"center"},he.createElement(o,{variant:f?"body1":"h5",noWrap:!0,"aria-labelledby":S},w),s&&he.createElement(l,{size:"small",onClick:g,sx:{ml:1}},he.createElement($e,null))))},dt=function(e){var t=void 0===e?{}:e,r=t.lightWeight,o=void 0===r?100:r,a=t.darkWeight,i=void 0===a?900:a,l=n().palette;return"light"===l.mode?l.grey[o]:l.grey[i]},mt=function(e){var t=e.title,a=e.subtitle,i=e.centered,l=e.children,u=e.dense,d=n().typography,m=dt({lightWeight:200,darkWeight:800});return he.createElement(c,{sx:{paddingBottom:u?0:1}},he.createElement(r,{bgcolor:m,px:u?1:2,py:u?.5:1,lineHeight:u?0:void 0},he.createElement(o,{variant:u?"body1":"h6",role:"heading","aria-level":1},t),a&&he.createElement(o,{variant:u?"caption":"body2",role:"heading","aria-level":2,lineHeight:u?d.pxToRem(15):void 0},a)),he.createElement(s,{container:!0,padding:1,rowSpacing:u?1:2,justifyContent:i?"center":"flex-start"},l))},ft=function(e){var t=e.label,n=e.value,o=void 0===n?0:n,a=e.maxRating,i=void 0===a?5:a,c=e.editable,u=e.dense,s=e.onEdit,m=et(o,void 0===s?function(){return null}:s),f=m.isEditing,p=m.editValue,v=m.startEdit,y=m.cancelEdit,h=m.setEditValue,g=m.submitEdit,E=nt(t);return he.createElement(rt,{label:t,tooltip:o.toString(),dense:u},he.createElement(r,{display:"flex",alignItems:"center"},he.createElement(d,{"aria-labelledby":E,readOnly:!f,max:i,size:u?"small":"medium",value:f?p:o,onChange:function(e,t){return t&&h(t)}}),c&&!f&&he.createElement(l,{size:"small",onClick:v,sx:{ml:1}},he.createElement($e,null)),f&&he.createElement(Ze,{onClickCancel:y,onSubmitEdit:g})))},pt=function(e,t){return new Array(e).fill(t)},vt=function(e){var t=Math.floor(Math.random()*e.length);return{index:t,item:e[t]}},yt=function(e){void 0===e&&(e=12);var t=function(t,n,r){var o=t[n];return t[n]+=r,t[n]>e?(t[n]=r,!1):(t[n]==e&&(t[n]=0),o>0)};return{xs:0,sm:0,md:0,lg:0,xl:0,increment:function(e){var n=e.xs,r=void 0===n?0:n,o=e.sm,a=void 0===o?0:o,i=e.md,l=void 0===i?0:i,c=e.lg,u=void 0===c?0:c,s=e.xl,d=a||r,m=l||d,f=u||m,p=(void 0===s?0:s)||f;return{xs:t(this,"xs",r),sm:t(this,"sm",d),md:t(this,"md",m),lg:t(this,"lg",f),xl:t(this,"xl",p)}}}},ht=function(e){var t=new FormData(e.currentTarget),n={};return t.forEach((function(e,t){n[t]=e})),n},gt={root:"RdsValueItem-root",content:"RdsValueItem-content"},Et=function(e){var t=e.children,n=e.bordered,o=void 0===n||n,a=ct(e,["children","bordered"]),i=function(e,t){var n="solid ".concat(t," 1px"),r="none";if(e){if(Array.isArray(e))return e.map((function(e){return e?n:r}));if("object"==typeof e){var o={};return Object.entries(e).forEach((function(e){var t=e[0],a=e[1];o[t]=a?n:r})),o}return n}}(o,dt({lightWeight:200,darkWeight:800}));return he.createElement(s,lt({item:!0,className:gt.root},a),he.createElement(r,{className:gt.content,px:1,borderLeft:i},t))},bt=function(){return he.createElement(r,{width:1,height:1,display:"flex",justifyContent:"center",alignItems:"center"},he.createElement(m,null))};function xt(e){var t=e.isFetching,n=e.error,o=e.success,a=e.children;return t?he.createElement(bt,null):n?he.createElement(f,{severity:"error",role:"alert","aria-describedby":"error"},n.name&&he.createElement(p,{role:"heading"},n.name),n.message):he.createElement(r,null,o&&he.createElement(f,{severity:"success",role:"alert","aria-describedby":"success",sx:{mb:2}},o.name&&he.createElement(p,{role:"heading"},o.name),o.message),a)}var St={root:"RdsBullet-root"},wt=function(e){var t=e.variant,n=void 0===t?"primary":t,r=e.sx;return he.createElement(v,{color:n,variant:"dot",className:St.root,role:"bullet","aria-describedby":n,sx:r})},Ct={root:"RdsLabel-root"},kt=function(e){var t=e.text,a=e.variant,i=void 0===a?"default":a,l=e.sx,c=n().palette,u={default:"light"===c.mode?c.grey[100]:c.grey[900],primary:c.primary.main,secondary:c.secondary.main,info:c.info.main,warning:c.warning.main,error:c.error.main},s={default:c.getContrastText(u.default),primary:c.primary.contrastText,secondary:c.secondary.contrastText,info:c.info.contrastText,warning:c.warning.contrastText,error:c.error.contrastText};return he.createElement(r,{px:1,sx:lt({backgroundColor:u[i]},l),borderRadius:1,color:s[i],className:Ct.root,role:"label","aria-describedby":i},he.createElement(o,{variant:"caption",fontWeight:700},t.toUpperCase()))},Ot=Ee((function(e,t){var n=e.href,r=ct(e,["href"]);return he.createElement(We,lt({ref:t,to:n},r))})),It=Ee((function(e,t){return he.createElement(y,lt({},e,{component:Ot}))})),$t=new Error("NotificationCenterContext.Provider is required and was undefined"),Tt=he.createContext(void 0),Pt=function(){var e=he.useContext(Tt);if(void 0===e)throw $t;return e},jt=function(e){var t=e.children,n=e.autoHideDuration,r=void 0===n?6e3:n,o=ge(void 0),a=o[0],i=o[1],l=ge(!1),c=l[0],u=l[1],s=function(){u(!1)};return he.createElement(Tt.Provider,{value:{show:function(e){i(e),u(!0)},hide:s}},he.createElement(h,{open:c,autoHideDuration:r,onClose:s,anchorOrigin:{vertical:"top",horizontal:"right"}},he.createElement(f,{onClose:s,severity:null==a?void 0:a.severity,"aria-label":null==a?void 0:a.severity,sx:{width:"100%"}},(null==a?void 0:a.title)&&he.createElement(p,null,null==a?void 0:a.title),null==a?void 0:a.message)),t)},zt=function(e,t,n){var r=n.from,o=n.to,a=be(),i=Pt().show;xe((function(){a.current===r&&t===o&&i(e),a.current=t}),[t])},Rt=Se([0,function(){return null}]),Nt=Rt.Provider,Wt=function(){return we(Rt)},At=function(e){var t=e.children,n=e.initialValue,r=ge(void 0===n?0:n);return he.createElement(Nt,{value:r},t)},Mt=function(e){var a=e.title,i=e.subtitle,l=e.preset,c=void 0===l?"default":l,u=e.actionsVariant,s=void 0===u?"outlined":u,d=e.breadcrumbs,m=e.actions,f=e.tabs,p=e.tabsMode,v=void 0===p?"panel":p,y=e.navigationButton,h=Ae(),S=n().palette,w=dt(),C=Wt(),k=C[0],O=C[1],I={default:w,primary:S.primary.main,secondary:S.secondary.main,inherit:"inherit",transparent:"transparent"},$=I[c],T={default:S.getContrastText(I.default),primary:S.primary.contrastText,secondary:S.secondary.contrastText,inherit:"inherit",transparent:S.text.primary}[c],P="panel"===v?k:null==f?void 0:f.findIndex((function(e){return e.href===h.pathname}));return he.createElement(r,{bgcolor:$,color:T},he.createElement(g,null,he.createElement(r,{sx:{py:3,display:"flex",flexDirection:"row",justifyContent:"space-between"}},he.createElement(r,null,y&&he.createElement(t,{href:y.href,size:"small",color:"inherit",LinkComponent:It,startIcon:y.icon,sx:{mb:1}},y.text),(null==d?void 0:d.length)&&he.createElement(E,{color:"inherit",separator:"›","aria-label":"breadcrumb",sx:{marginTop:1}},d.map((function(e){var t=e.id,n=e.link,r=e.text;return he.createElement(It,{key:t,underline:"hover",color:"inherit",href:n,variant:"body2",role:"link"},r)}))),he.createElement(o,{variant:"h4",role:"heading","aria-level":1},a),i&&he.createElement(o,{variant:"body1",role:"heading","aria-level":2},i)),m&&he.createElement(r,null,m.map((function(e,n){var r=e.disabled,o=e.id,a=e.href,i=e.onClick,l=e.text;return he.createElement(t,{component:a?It:"button",role:"button",color:"inherit",disabled:r,key:o,variant:s,size:"small",href:a,onClick:i,sx:{mr:n!=m.length-1?1:0}},l)})))),f&&he.createElement(b,{value:P,textColor:"inherit",onChange:"panel"===v?function(e,t){return O(t)}:void 0},f.map((function(e){var t=e.id,n=e.label,r=e.disabled,o=e.href,a={label:n,disabled:r};return"panel"===v?he.createElement(x,lt({key:t},a)):he.createElement(x,lt({key:t},a,{component:It,href:o}))})))))},Dt={overrides:{h1:{component:o,props:{gutterBottom:!0,variant:"h5"}},h2:{component:o,props:{gutterBottom:!0,variant:"h6"}},h3:{component:o,props:{gutterBottom:!0,variant:"subtitle1"}},h4:{component:o,props:{gutterBottom:!0,variant:"caption",paragraph:!0}},p:{component:o,props:{paragraph:!0}},a:{component:y},li:{component:"li"}}},Ft=function(e){var t=e.content,n=e.options,r=void 0===n?Dt:n;return he.createElement(qe,{options:r},t)},Vt=function(e){var n,a,i=e.markdown,l=e.content,u=e.spacing,s=void 0===u?0:u,d=e.timeoutCopyText,m=void 0===d?2e3:d,f=e.children,p=e.sx,v=ge("Copy"),y=v[0],h=v[1];i?n=i||"":Array.isArray(l)?(a=l.map((function(e,t){return he.createElement(o,{key:t,sx:{pb:s}},e)})),n=l.join("\n")):(a=he.createElement(o,null,l),n=l||"");var g=i&&he.createElement(Ft,{content:i});return he.createElement(c,{sx:lt({p:2,backgroundColor:_e[800],color:"white"},p)},he.createElement(r,{display:"flex",flexDirection:"row"},he.createElement(r,{width:1},f||g||a),he.createElement(r,{width:100,sx:{ml:1}},n&&he.createElement(t,{fullWidth:!0,color:"inherit",size:"small",variant:"outlined",onClick:function(){navigator.clipboard.writeText(n),h("Copied!"),setTimeout((function(){return h("Copy")}),m)}},y))))},_t=function(e){var t=e.children;return he.createElement(g,{component:"main",sx:{py:3,flexGrow:1}},t)};function qt(e){var t=e.children,n=e.centerVertical,o=void 0===n||n,a=e.centerHorizontal,i=void 0===a||a,l=e.sx;return he.createElement(r,{width:1,height:1,sx:lt(lt({},l),{display:"flex",flexDirection:"column",justifyContent:o?"center":"flex-start",alignItems:i?"center":"flex-start"})},t)}var Lt=Se(void 0),Bt=new Error("DrawerContext.Provider is required and was undefined"),Ht=function(){var e=we(Lt);if(void 0===e)throw Bt;return e},Ut=function(e){return{width:240,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:"hidden"}},Yt=function(e){var t;return(t={transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),overflowX:"hidden",width:"calc(".concat(e.spacing(7)," + 1px)")})[e.breakpoints.up("sm")]={width:"calc(".concat(e.spacing(8)," + 1px)")},t},Jt=S("div")((function(e){var t=e.theme;return lt({display:"flex",alignItems:"center",justifyContent:"flex-end",padding:t.spacing(0,1)},t.mixins.toolbar)})),Xt={temporary:!0,mini:!0,persistent:!0,clipped:!1},Gt={temporary:"temporary",mini:"permanent",clipped:"permanent",persistent:"persistent"},Kt=function(){return{}},Qt={mini:function(e,t){var n;return(n={boxSizing:"border-box"})["& .".concat(O.root)]={zIndex:t.zIndex.drawer-1},n},temporary:Kt,clipped:Kt,persistent:Kt},Zt=function(e){var t,r,o=e.children,a=ct(e,["children"]),i=n(),c=Ht(),u=c.state,s=c.switchState,d=c.underAppBar,m=c.close,f=c.drawerWidth,p=c.variant,v=lt(lt(lt({width:f,flexShrink:0,whiteSpace:"nowrap"},"open"===u&<(lt({},Ut(i)),((t={})["& .".concat(w.paper)]=Ut(i),t))),"open"!==u&<(lt({},Yt(i)),((r={})["& .".concat(w.paper)]=Yt(i),r))),Qt[p](u,i));return he.createElement(C,lt({open:"open"===u,variant:Gt[p],role:"menu","aria-hidden":"close"===u,onClose:m,sx:v},a),he.createElement(Jt,null,!d&&Xt[p]&&he.createElement(l,{onClick:s},he.createElement(Le,null))),he.createElement(k,null),o)},en={temporary:"close",mini:"collapse",clipped:"open",persistent:"close"},tn={temporary:["close","open"],mini:["collapse","open"],clipped:["open","open"],persistent:["close","open"]},nn=function(e){var t=e.children,n=e.initialState,r=e.variant,o=void 0===r?"temporary":r,a=e.drawerWidth,i=void 0===a?240:a,l=e.underAppBar,c=void 0!==l&&l,u=e.selectedItemId,s=e.onStateChange,d=void 0===s?function(){return null}:s,m=ge(n||en[o]),f=m[0],p=m[1],v=function(e){d(e),p(e)};return he.createElement(Lt.Provider,{value:{state:f,variant:o,selectedItemId:u,underAppBar:c,drawerWidth:i,switchState:function(){return v(tn[o]["open"===f?0:1])},collapse:function(){return v("collapse")},close:function(){return v("close")},open:function(){return v("open")},setState:p}},t)},rn=S(I,{shouldForwardProp:function(e){return"size"!==e}})((function(e){var t=e.size,n=e.theme;return{lineHeight:"small"===t?n.typography.pxToRem(40):void 0}})),on=function(e,t){return{color:t?e.palette.primary.main:void 0,fontWeight:t?e.typography.fontWeightBold:e.typography.fontWeightMedium}},an=function(e){var t=e.text,r=e.icon,o=e.selected,a=e.items,i=e.size,l=void 0===i?"medium":i,c=e.level,u=e.sx,s=void 0===u?{}:u,d=Ht().state,m=be(null),f=n(),p=f.palette,v=f.spacing,y=ge(!1),h=y[0],g=y[1],E=on(n(),o),b=E.color,x=E.fontWeight,S=he.createElement($,{component:"div",disablePadding:!0},a.map((function(e){return he.createElement(sn,{key:e.id,level:c+1,item:e,size:l})}))),w="collapse"===d&&0===c?{position:"absolute",right:0}:{};return he.createElement(he.Fragment,null,he.createElement(T,{ref:m,selected:o,"aria-label":t,onClick:function(){return g((function(e){return!e}))},dense:"small"===l,sx:lt(lt({},s),{pl:"open"===d?v(2+1.5*c):void 0,backgroundColor:h?p.action.hover:void 0})},r&&he.createElement(P,{sx:{color:b}},r),he.createElement(j,{disableTypography:!0,primary:t,sx:{color:b,fontWeight:x,opacity:"collapse"===d&&0===c?0:void 0}}),h&&"open"===d?he.createElement(Be,{sx:[{color:b,ml:2},w]}):he.createElement(He,{sx:[{color:b,ml:2},w]})),"open"===d?he.createElement(z,{in:h,timeout:"auto",unmountOnExit:!0,"aria-label":"".concat(t," collapse submenu")},S):he.createElement(R,{open:h,PaperProps:{elevation:0,variant:"outlined"},"aria-label":"".concat(t," popover submenu"),anchorEl:m.current,onClose:function(){return g(!1)},anchorOrigin:{vertical:"top",horizontal:"right"}},S))},ln=S(It)((function(e){return{color:e.theme.palette.text.primary}})),cn={minWidth:0,justifyContent:"center",marginRight:"auto"},un=function(e){var t=e.text,r=e.icon,o=e.avatar,a=e.label,i=e.bullet,l=e.href,c=e.selected,u=e.size,s=void 0===u?"medium":u,d=e.level,m=e.sx,f=Ht().state,p=n(),v=on(p,c),y=v.color,h=v.fontWeight;return he.createElement(T,{LinkComponent:ln,dense:"small"===s,"aria-label":t,href:l,selected:c,sx:lt(lt(lt({},m),{pl:"open"===f?p.spacing(2+1.5*d):void 0}),"collapse"===f&&{paddingHorizontal:p.spacing(2.5),justifyContent:"center"})},r&&he.createElement(P,{sx:lt({color:y},"collapse"===f&&0===d&&cn)},r),o&&he.createElement(N,{sx:lt({},"collapse"===f&&0===d&&cn)},he.createElement(W,{alt:o.alt,src:o.src,sx:lt(lt({},"small"===s&&{width:24,height:24}),"collapse"===f&&{width:30,height:30})})),he.createElement(j,{disableTypography:!0,primary:t,sx:{color:y,fontWeight:h,opacity:"collapse"===f&&0===d?0:void 0}}),a&&"open"===f&&he.createElement(kt,{text:a.text,variant:a.variant,sx:{ml:2}}),i&&"open"===f&&he.createElement(wt,{variant:i.variant,sx:{ml:2}}))},sn=function(e){var t=e.item,n=e.size,r=void 0===n?"medium":n,o=e.level,a=void 0===o?0:o,i=Ht().selectedItemId;if("items"in t){var l=t.id,c=t.text,u=t.icon,s=t.items,d=s.some((function(e){return e.id===i}));return he.createElement(an,{size:r,selected:l===i||d,text:c,icon:u,items:s,level:a})}l=t.id,c=t.text,u=t.icon;var m=t.avatar,f=t.label,p=t.bullet,v=t.href;return he.createElement(un,{selected:l===i,size:r,text:c,icon:u,avatar:m,label:f,bullet:p,href:v,level:a})},dn=function(e){var t=e.title,r=e.items,o=e.size,a=void 0===o?"medium":o,i=Ht().state,l=n().spacing;return he.createElement(he.Fragment,null,t&&"open"===i&&he.createElement(rn,{size:a,role:"heading"},t),he.createElement($,{sx:{paddingTop:"small"===a?l(0):void 0,paddingY:"collapse"===i?0:void 0}},r.map((function(e){return he.createElement(sn,{key:e.id,item:e,size:a})}))))},mn=function(e){var t=e.nav.items,n=e.size,r=void 0===n?"medium":n;return he.createElement(he.Fragment,null,t.map((function(e,t){var n=e.title,o=e.items;return he.createElement(dn,{key:t,title:n,items:o,size:r})})))},fn={temporary:!1,mini:!0,persistent:!0,clipped:!0},pn={temporary:function(){return!0},mini:function(e){return"open"!==e},persistent:function(){return!0},clipped:function(){return!1}},vn=function(e){var t=e.title,r=e.sx,a=e.children,i=ct(e,["title","sx","children"]),c=n(),u=Ht(),s=u.state,d=u.variant,m=u.switchState,f=u.drawerWidth,p=u.underAppBar,v=fn[d]&&!p&<({transition:c.transitions.create(["width","margin"],{easing:c.transitions.easing.sharp,duration:c.transitions.duration.leavingScreen})},"open"===s&&{marginLeft:f,width:"calc(100% - ".concat(f,"px)"),transition:c.transitions.create(["width","margin"],{easing:c.transitions.easing.sharp,duration:c.transitions.duration.enteringScreen})})||{};return ye.createElement(A,lt({position:p?"fixed":void 0},i,{sx:lt(lt(lt({},r),v),{zIndex:function(e){return e.zIndex.drawer+(p?1:0)}})}),ye.createElement(M,null,ye.createElement(l,{color:"inherit","aria-label":"open drawer",onClick:m,edge:"start",sx:{marginRight:5,display:pn[d](s)?void 0:"none"}},ye.createElement(Ue,null)),t&&ye.createElement(o,{variant:"h6",component:"h1",role:"heading","aria-level":1,noWrap:!0},t),a))},yn={temporary:!1,mini:!0,clipped:!0,persistent:!0},hn=S("div")((function(e){var t=e.theme,r=n().spacing,o=Ht(),a=o.drawerWidth,i=o.state,l=o.variant;return{marginLeft:yn[l]?"open"===i?a:"collapse"===i?r(8):0:0,transition:t.transitions.create("margin",{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen})}})),gn=function(e){var t=e.children;return he.createElement(hn,null,he.createElement(Jt,null),t)},En={small:15,medium:20},bn=function(e){var t=e.label,n=e.value,o=e.loading,a=void 0!==o&&o,i=e.fetching,l=void 0!==i&&i,c=e.size,u=void 0===c?"medium":c,s=e.fullWidth,d=void 0!==s&&s,f=e.color,p=e.children,v=e.onChange,y=Ce(),h=S(D)((function(){return f?{label:{color:f},".MuiOutlinedInput-notchedOutline":{borderColor:"".concat(f," !important")},".MuiInputBase-root":{color:f},".MuiSelect-icon":{fill:f}}:{}}));return he.createElement(h,{fullWidth:d},he.createElement(F,{id:y},t),he.createElement(V,{labelId:y,id:y,value:n,label:t,onChange:v,disabled:l,size:u,renderValue:function(e){return l?he.createElement(qt,{centerVertical:!0,centerHorizontal:!0},he.createElement(m,{color:"inherit",size:En[u]})):a?he.createElement(r,{display:"flex",flexDirection:"column"},e,he.createElement(_,{color:"inherit",sx:{position:"absolute",left:0,right:0,bottom:0}})):e}},p))},xn=function(e){var t=e.title,n=e.subtitle,a=e.loading,l=e.error,c=e.onSubmitSignIn,u=ge(""),s=u[0],d=u[1],m=ge(""),p=m[0],v=m[1];return he.createElement(he.Fragment,null,he.createElement(r,{marginBottom:2},he.createElement(o,{component:"h1",variant:"h4"},t),he.createElement(o,{variant:"body1"},n)),he.createElement(r,{component:"form",onSubmit:function(e){var t,n;e.preventDefault(),d(""),v("");var r=new FormData(e.currentTarget),o=null===(t=r.get("email"))||void 0===t?void 0:t.toString(),a=null===(n=r.get("password"))||void 0===n?void 0:n.toString();o||d("Please fill out this field"),a||v("Please fill out this field"),o&&a&&c(o,a)}},l&&he.createElement(q,{width:"100%",marginTop:1},he.createElement(f,{variant:"filled",severity:"error"},l.message)),he.createElement(i,{margin:"normal",fullWidth:!0,id:"email",label:"Email Address",name:"email",autoComplete:"email",autoFocus:!0,disabled:a,type:"email",inputProps:{role:"input"},error:!!s,helperText:s}),he.createElement(i,{margin:"normal",fullWidth:!0,role:"input",name:"password",label:"Password",type:"password",id:"password",disabled:a,autoComplete:"current-password",inputProps:{role:"input"},error:!!p,helperText:p}),he.createElement(Ye,{type:"submit",fullWidth:!0,variant:"contained",loading:a,disabled:a,role:"button",sx:{mt:2}},"Sign In")))};function Sn(e,t){return"production"===process.env.NODE_ENV?()=>null:function(...n){return e(...n)||t(...n)}}var wn,Cn={exports:{}},kn={exports:{}},On={};var In,$n,Tn,Pn,jn,zn,Rn,Nn,Wn,An,Mn,Dn,Fn,Vn,_n={};
|
|
1
|
+
import{InputAdornment as e,Button as t,useTheme as n,Box as r,Typography as o,Tooltip as a,TextField as i,IconButton as l,Paper as c,Switch as u,Grid as s,Rating as d,CircularProgress as m,Alert as f,AlertTitle as p,Badge as v,Link as y,Snackbar as h,Container as g,Breadcrumbs as E,Tabs as b,Tab as x,styled as w,drawerClasses as S,Drawer as C,Divider as k,paperClasses as O,ListSubheader as I,List as $,ListItemButton as T,ListItemIcon as P,ListItemText as j,Collapse as z,Popover as R,ListItemAvatar as N,Avatar as W,AppBar as A,Toolbar as M,FormControl as D,InputLabel as F,Select as V,LinearProgress as _,Stack as q,outlinedInputClasses as L,inputLabelClasses as B,circularProgressClasses as H,linearProgressClasses as U,autocompleteClasses as Y,iconButtonClasses as J,OutlinedInput as X,FormHelperText as G,Autocomplete as K,tabsClasses as Q,TableHead as Z,TableRow as ee,TableCell as te,TableSortLabel as ne,TableContainer as re,Table as oe,TableBody as ae,Skeleton as ie,alertClasses as le,Dialog as ce,DialogTitle as ue,DialogContent as se,DialogActions as de,FormControlLabel as me,Checkbox as fe,MenuItem as pe,Menu as ve}from"@mui/material";import*as ye from"react";import he,{useState as ge,forwardRef as Ee,useRef as be,useEffect as xe,createContext as we,useContext as Se,useId as Ce,useMemo as ke}from"react";import Oe from"@mui/icons-material/Check";import Ie from"@mui/icons-material/Clear";import $e from"@mui/icons-material/Edit";import Te from"@mui/icons-material/Close";import{format as Pe}from"date-fns";import{DateTimePicker as je,TimePicker as ze,DatePicker as Re,DesktopDatePicker as Ne}from"@mui/x-date-pickers";import{Link as We,useLocation as Ae,useNavigate as Me,useParams as De,Routes as Fe,Route as Ve}from"react-router-dom";import{blueGrey as _e}from"@mui/material/colors";import qe from"markdown-to-jsx";import Le from"@mui/icons-material/ChevronLeft";import Be from"@mui/icons-material/ExpandMore";import He from"@mui/icons-material/ChevronRight";import Ue from"@mui/icons-material/Menu";import{LoadingButton as Ye}from"@mui/lab";import Je from"@mui/icons-material/Search";import{loremIpsum as Xe}from"lorem-ipsum";import Ge from"@mui/icons-material/ExpandLess";import Ke from"@mui/icons-material/ReportProblem";import{DataGrid as Qe}from"@mui/x-data-grid";import Ze from"@mui/icons-material/MoreVert";var et=function(n){var r=n.onClickCancel,o=n.onSubmitEdit,a=n.sx;return he.createElement(e,{position:"end",sx:a},he.createElement(t,{variant:"contained",size:"small",color:"error",startIcon:he.createElement(Ie,null),onClick:r,sx:{paddingRight:0,minWidth:0,marginRight:1}}),he.createElement(t,{variant:"contained",size:"small",color:"primary",startIcon:he.createElement(Oe,null),onClick:o,sx:{paddingRight:0,minWidth:0}}))},tt=function(e,t){var n=ge(!1),r=n[0],o=n[1],a=ge(e),i=a[0],l=a[1],c=function(){o(!1),l(e)};return{isEditing:r,cancelEdit:c,editValue:i,setEditValue:l,startEdit:function(){o(!0)},submitEdit:function(){t(i),c()}}},nt="-",rt=function(e){return"label-".concat(e.replace(/ /g,"-"))},ot=function(e){var t=e.label,i=e.tooltip,l=e.tooltipEnterDelay,c=void 0===l?2e3:l,u=e.children,s=e.dense,d=n().typography,m=rt(t);return he.createElement(r,{width:1,lineHeight:s?0:void 0},he.createElement(o,{variant:s?"caption":"subtitle2",role:"label",id:m,lineHeight:s?d.pxToRem(15):void 0},t),i?he.createElement(a,{title:i,placement:"top",enterDelay:c},u):u)},at=function(e){var t=e.label,n=e.value,r=e.placeholder,a=void 0===r?nt:r,c=e.editable,u=e.dense,s=e.onEdit,d=void 0===s?function(){return null}:s,m=tt(null==n?void 0:n.toString(),d),f=m.isEditing,p=m.editValue,v=m.startEdit,y=m.cancelEdit,h=m.setEditValue,g=m.submitEdit,E=rt(t),b=(null==n?void 0:n.toString())||a;return he.createElement(ot,{label:t,tooltip:b,dense:u},f?he.createElement(i,{value:p,size:"small",onChange:function(e){return h(e.target.value)},InputProps:{endAdornment:he.createElement(et,{onClickCancel:y,onSubmitEdit:g})}}):he.createElement(o,{variant:u?"body1":"h5",noWrap:!0,"aria-labelledby":E},b,c&&he.createElement(l,{size:"small",onClick:v,sx:{ml:1}},he.createElement($e,null))))},it=function(e){var t=e.children;return he.createElement(c,{sx:{p:2}},t)},lt=function(e){var t=e.label,a=e.value,i=e.placeholder,c=void 0===i?nt:i,s=e.editable,d=e.dense,m=e.onEdit,f=void 0===m?function(){return null}:m,p=n().typography,v=tt(a,f),y=v.isEditing,h=v.editValue,g=v.startEdit,E=v.cancelEdit,b=v.setEditValue,x=v.submitEdit,w={fontSize:d?p.h6.fontSize:p.h5.fontSize};return he.createElement(ot,{label:t,dense:d},y?he.createElement(r,{display:"flex",alignItems:"center"},he.createElement(u,{checked:h,onChange:function(e){return b(e.target.checked)}}),he.createElement(et,{onClickCancel:E,onSubmitEdit:x})):he.createElement(r,{display:"flex",alignItems:"center"},void 0===a?he.createElement(o,{variant:"h5"},c):a?he.createElement(Oe,{color:"success",sx:w}):he.createElement(Te,{color:"error",sx:w}),s&&he.createElement(l,{size:"small",onClick:g,sx:{ml:1}},he.createElement($e,null))))},ct=function(){return ct=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ct.apply(this,arguments)};function ut(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function st(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}var dt=function(e){var t=e.label,n=e.value,a=e.format,c=e.placeholder,u=void 0===c?nt:c,s=e.editable,d=e.editInputType,m=void 0===d?"datetime":d,f=e.dense,p=e.onEdit,v=tt(n,void 0===p?function(){return null}:p),y=v.isEditing,h=v.editValue,g=v.startEdit,E=v.cancelEdit,b=v.setEditValue,x=v.submitEdit,w=rt(t),S=n&&Pe(n,a)||u,C="datetime"===m?je:"time"===m?ze:Re;return he.createElement(ot,{label:t,tooltip:S,dense:f},y?he.createElement(C,{value:h,format:a,onChange:function(e){return b(e||void 0)},slots:{textField:function(e){var t;return he.createElement(i,ct({},e,{InputProps:ct(ct({},e.InputProps),{endAdornment:he.createElement(he.Fragment,null,null===(t=e.InputProps)||void 0===t?void 0:t.endAdornment,he.createElement(et,{onClickCancel:E,onSubmitEdit:x,sx:{ml:2}}))})}))}}}):he.createElement(r,{display:"flex",alignItems:"center"},he.createElement(o,{variant:f?"body1":"h5",noWrap:!0,"aria-labelledby":w},S),s&&he.createElement(l,{size:"small",onClick:g,sx:{ml:1}},he.createElement($e,null))))},mt=function(e){var t=void 0===e?{}:e,r=t.lightWeight,o=void 0===r?100:r,a=t.darkWeight,i=void 0===a?900:a,l=n().palette;return"light"===l.mode?l.grey[o]:l.grey[i]},ft=function(e){var t=e.title,a=e.subtitle,i=e.centered,l=e.children,u=e.dense,d=n().typography,m=mt({lightWeight:200,darkWeight:800});return he.createElement(c,{sx:{paddingBottom:u?0:1}},he.createElement(r,{bgcolor:m,px:u?1:2,py:u?.5:1,lineHeight:u?0:void 0},he.createElement(o,{variant:u?"body1":"h6",role:"heading","aria-level":1},t),a&&he.createElement(o,{variant:u?"caption":"body2",role:"heading","aria-level":2,lineHeight:u?d.pxToRem(15):void 0},a)),he.createElement(s,{container:!0,padding:1,rowSpacing:u?1:2,justifyContent:i?"center":"flex-start"},l))},pt=function(e){var t=e.label,n=e.value,o=void 0===n?0:n,a=e.maxRating,i=void 0===a?5:a,c=e.editable,u=e.dense,s=e.onEdit,m=tt(o,void 0===s?function(){return null}:s),f=m.isEditing,p=m.editValue,v=m.startEdit,y=m.cancelEdit,h=m.setEditValue,g=m.submitEdit,E=rt(t);return he.createElement(ot,{label:t,tooltip:o.toString(),dense:u},he.createElement(r,{display:"flex",alignItems:"center"},he.createElement(d,{"aria-labelledby":E,readOnly:!f,max:i,size:u?"small":"medium",value:f?p:o,onChange:function(e,t){return t&&h(t)}}),c&&!f&&he.createElement(l,{size:"small",onClick:v,sx:{ml:1}},he.createElement($e,null)),f&&he.createElement(et,{onClickCancel:y,onSubmitEdit:g})))},vt=function(e,t){return new Array(e).fill(t)},yt=function(e){var t=Math.floor(Math.random()*e.length);return{index:t,item:e[t]}},ht=function(e){void 0===e&&(e=12);var t=function(t,n,r){var o=t[n];return t[n]+=r,t[n]>e?(t[n]=r,!1):(t[n]==e&&(t[n]=0),o>0)};return{xs:0,sm:0,md:0,lg:0,xl:0,increment:function(e){var n=e.xs,r=void 0===n?0:n,o=e.sm,a=void 0===o?0:o,i=e.md,l=void 0===i?0:i,c=e.lg,u=void 0===c?0:c,s=e.xl,d=a||r,m=l||d,f=u||m,p=(void 0===s?0:s)||f;return{xs:t(this,"xs",r),sm:t(this,"sm",d),md:t(this,"md",m),lg:t(this,"lg",f),xl:t(this,"xl",p)}}}},gt=function(e){var t=new FormData(e.currentTarget),n={};return t.forEach((function(e,t){n[t]=e})),n},Et={root:"RdsValueItem-root",content:"RdsValueItem-content"},bt=function(e){var t=e.children,n=e.bordered,o=void 0===n||n,a=ut(e,["children","bordered"]),i=function(e,t){var n="solid ".concat(t," 1px"),r="none";if(e){if(Array.isArray(e))return e.map((function(e){return e?n:r}));if("object"==typeof e){var o={};return Object.entries(e).forEach((function(e){var t=e[0],a=e[1];o[t]=a?n:r})),o}return n}}(o,mt({lightWeight:200,darkWeight:800}));return he.createElement(s,ct({item:!0,className:Et.root},a),he.createElement(r,{className:Et.content,px:1,borderLeft:i},t))},xt=function(){return he.createElement(r,{width:1,height:1,display:"flex",justifyContent:"center",alignItems:"center"},he.createElement(m,null))};function wt(e){var t=e.isFetching,n=e.error,o=e.success,a=e.children;return t?he.createElement(xt,null):n?he.createElement(f,{severity:"error",role:"alert","aria-describedby":"error"},n.name&&he.createElement(p,{role:"heading"},n.name),n.message):he.createElement(r,null,o&&he.createElement(f,{severity:"success",role:"alert","aria-describedby":"success",sx:{mb:2}},o.name&&he.createElement(p,{role:"heading"},o.name),o.message),a)}var St={root:"RdsBullet-root"},Ct=function(e){var t=e.variant,n=void 0===t?"primary":t,r=e.sx;return he.createElement(v,{color:n,variant:"dot",className:St.root,role:"bullet","aria-describedby":n,sx:r})},kt={root:"RdsLabel-root"},Ot=function(e){var t=e.text,a=e.variant,i=void 0===a?"default":a,l=e.sx,c=n().palette,u={default:"light"===c.mode?c.grey[100]:c.grey[900],primary:c.primary.main,secondary:c.secondary.main,info:c.info.main,warning:c.warning.main,error:c.error.main},s={default:c.getContrastText(u.default),primary:c.primary.contrastText,secondary:c.secondary.contrastText,info:c.info.contrastText,warning:c.warning.contrastText,error:c.error.contrastText};return he.createElement(r,{px:1,sx:ct({backgroundColor:u[i]},l),borderRadius:1,color:s[i],className:kt.root,role:"label","aria-describedby":i},he.createElement(o,{variant:"caption",fontWeight:700},t.toUpperCase()))},It=Ee((function(e,t){var n=e.href,r=ut(e,["href"]);return he.createElement(We,ct({ref:t,to:n},r))})),$t=Ee((function(e,t){return he.createElement(y,ct({},e,{component:It}))})),Tt=new Error("NotificationCenterContext.Provider is required and was undefined"),Pt=he.createContext(void 0),jt=function(){var e=he.useContext(Pt);if(void 0===e)throw Tt;return e},zt=function(e){var t=e.children,n=e.autoHideDuration,r=void 0===n?6e3:n,o=ge(void 0),a=o[0],i=o[1],l=ge(!1),c=l[0],u=l[1],s=function(){u(!1)};return he.createElement(Pt.Provider,{value:{show:function(e){i(e),u(!0)},hide:s}},he.createElement(h,{open:c,autoHideDuration:r,onClose:s,anchorOrigin:{vertical:"top",horizontal:"right"}},he.createElement(f,{onClose:s,severity:null==a?void 0:a.severity,"aria-label":null==a?void 0:a.severity,sx:{width:"100%"}},(null==a?void 0:a.title)&&he.createElement(p,null,null==a?void 0:a.title),null==a?void 0:a.message)),t)},Rt=function(e,t,n){var r=n.from,o=n.to,a=be(),i=jt().show;xe((function(){a.current===r&&t===o&&i(e),a.current=t}),[t])},Nt=we([0,function(){return null}]),Wt=Nt.Provider,At=function(){return Se(Nt)},Mt=function(e){var t=e.children,n=e.initialValue,r=ge(void 0===n?0:n);return he.createElement(Wt,{value:r},t)},Dt=function(e){var a=e.title,i=e.subtitle,l=e.preset,c=void 0===l?"default":l,u=e.actionsVariant,s=void 0===u?"outlined":u,d=e.breadcrumbs,m=e.actions,f=e.tabs,p=e.tabsMode,v=void 0===p?"panel":p,y=e.navigationButton,h=Ae(),w=n().palette,S=mt(),C=At(),k=C[0],O=C[1],I={default:S,primary:w.primary.main,secondary:w.secondary.main,inherit:"inherit",transparent:"transparent"},$=I[c],T={default:w.getContrastText(I.default),primary:w.primary.contrastText,secondary:w.secondary.contrastText,inherit:"inherit",transparent:w.text.primary}[c],P="panel"===v?k:null==f?void 0:f.findIndex((function(e){return e.href===h.pathname}));return he.createElement(r,{bgcolor:$,color:T},he.createElement(g,null,he.createElement(r,{sx:{py:3,display:"flex",flexDirection:"row",justifyContent:"space-between"}},he.createElement(r,null,y&&he.createElement(t,{href:y.href,size:"small",color:"inherit",LinkComponent:$t,startIcon:y.icon,sx:{mb:1}},y.text),(null==d?void 0:d.length)&&he.createElement(E,{color:"inherit",separator:"›","aria-label":"breadcrumb",sx:{marginTop:1}},d.map((function(e){var t=e.id,n=e.link,r=e.text;return he.createElement($t,{key:t,underline:"hover",color:"inherit",href:n,variant:"body2",role:"link"},r)}))),he.createElement(o,{variant:"h4",role:"heading","aria-level":1},a),i&&he.createElement(o,{variant:"body1",role:"heading","aria-level":2},i)),m&&he.createElement(r,null,m.map((function(e,n){var r=e.disabled,o=e.id,a=e.href,i=e.onClick,l=e.text;return he.createElement(t,{component:a?$t:"button",role:"button",color:"inherit",disabled:r,key:o,variant:s,size:"small",href:a,onClick:i,sx:{mr:n!=m.length-1?1:0}},l)})))),f&&he.createElement(b,{value:P,textColor:"inherit",onChange:"panel"===v?function(e,t){return O(t)}:void 0},f.map((function(e){var t=e.id,n=e.label,r=e.disabled,o=e.href,a={label:n,disabled:r};return"panel"===v?he.createElement(x,ct({key:t},a)):he.createElement(x,ct({key:t},a,{component:$t,href:o}))})))))},Ft={overrides:{h1:{component:o,props:{gutterBottom:!0,variant:"h5"}},h2:{component:o,props:{gutterBottom:!0,variant:"h6"}},h3:{component:o,props:{gutterBottom:!0,variant:"subtitle1"}},h4:{component:o,props:{gutterBottom:!0,variant:"caption",paragraph:!0}},p:{component:o,props:{paragraph:!0}},a:{component:y},li:{component:"li"}}},Vt=function(e){var t=e.content,n=e.options,r=void 0===n?Ft:n;return he.createElement(qe,{options:r},t)},_t=function(e){var n,a,i=e.markdown,l=e.content,u=e.spacing,s=void 0===u?0:u,d=e.timeoutCopyText,m=void 0===d?2e3:d,f=e.children,p=e.sx,v=ge("Copy"),y=v[0],h=v[1];i?n=i||"":Array.isArray(l)?(a=l.map((function(e,t){return he.createElement(o,{key:t,sx:{pb:s}},e)})),n=l.join("\n")):(a=he.createElement(o,null,l),n=l||"");var g=i&&he.createElement(Vt,{content:i});return he.createElement(c,{sx:ct({p:2,backgroundColor:_e[800],color:"white"},p)},he.createElement(r,{display:"flex",flexDirection:"row"},he.createElement(r,{width:1},f||g||a),he.createElement(r,{width:100,sx:{ml:1}},n&&he.createElement(t,{fullWidth:!0,color:"inherit",size:"small",variant:"outlined",onClick:function(){navigator.clipboard.writeText(n),h("Copied!"),setTimeout((function(){return h("Copy")}),m)}},y))))},qt=function(e){var t=e.children;return he.createElement(g,{component:"main",sx:{py:3,flexGrow:1}},t)};function Lt(e){var t=e.children,n=e.centerVertical,o=void 0===n||n,a=e.centerHorizontal,i=void 0===a||a,l=e.sx;return he.createElement(r,{width:1,height:1,sx:ct(ct({},l),{display:"flex",flexDirection:"column",justifyContent:o?"center":"flex-start",alignItems:i?"center":"flex-start"})},t)}var Bt=we(void 0),Ht=new Error("DrawerContext.Provider is required and was undefined"),Ut=function(){var e=Se(Bt);if(void 0===e)throw Ht;return e},Yt=function(e){return{width:240,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:"hidden"}},Jt=function(e){var t;return(t={transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),overflowX:"hidden",width:"calc(".concat(e.spacing(7)," + 1px)")})[e.breakpoints.up("sm")]={width:"calc(".concat(e.spacing(8)," + 1px)")},t},Xt=w("div")((function(e){var t=e.theme;return ct({display:"flex",alignItems:"center",justifyContent:"flex-end",padding:t.spacing(0,1)},t.mixins.toolbar)})),Gt={temporary:!0,mini:!0,persistent:!0,clipped:!1},Kt={temporary:"temporary",mini:"permanent",clipped:"permanent",persistent:"persistent"},Qt=function(){return{}},Zt={mini:function(e,t){var n;return(n={boxSizing:"border-box"})["& .".concat(O.root)]={zIndex:t.zIndex.drawer-1},n},temporary:Qt,clipped:Qt,persistent:Qt},en=function(e){var t,r,o=e.children,a=ut(e,["children"]),i=n(),c=Ut(),u=c.state,s=c.switchState,d=c.underAppBar,m=c.close,f=c.drawerWidth,p=c.variant,v=ct(ct(ct({width:f,flexShrink:0,whiteSpace:"nowrap"},"open"===u&&ct(ct({},Yt(i)),((t={})["& .".concat(S.paper)]=Yt(i),t))),"open"!==u&&ct(ct({},Jt(i)),((r={})["& .".concat(S.paper)]=Jt(i),r))),Zt[p](u,i));return he.createElement(C,ct({open:"open"===u,variant:Kt[p],role:"menu","aria-hidden":"close"===u,onClose:m,sx:v},a),he.createElement(Xt,null,!d&&Gt[p]&&he.createElement(l,{onClick:s},he.createElement(Le,null))),he.createElement(k,null),o)},tn={temporary:"close",mini:"collapse",clipped:"open",persistent:"close"},nn={temporary:["close","open"],mini:["collapse","open"],clipped:["open","open"],persistent:["close","open"]},rn=function(e){var t=e.children,n=e.initialState,r=e.variant,o=void 0===r?"temporary":r,a=e.drawerWidth,i=void 0===a?240:a,l=e.underAppBar,c=void 0!==l&&l,u=e.selectedItemId,s=e.onStateChange,d=void 0===s?function(){return null}:s,m=ge(n||tn[o]),f=m[0],p=m[1],v=function(e){d(e),p(e)};return he.createElement(Bt.Provider,{value:{state:f,variant:o,selectedItemId:u,underAppBar:c,drawerWidth:i,switchState:function(){return v(nn[o]["open"===f?0:1])},collapse:function(){return v("collapse")},close:function(){return v("close")},open:function(){return v("open")},setState:p}},t)},on=w(I,{shouldForwardProp:function(e){return"size"!==e}})((function(e){var t=e.size,n=e.theme;return{lineHeight:"small"===t?n.typography.pxToRem(40):void 0}})),an=function(e,t){return{color:t?e.palette.primary.main:void 0,fontWeight:t?e.typography.fontWeightBold:e.typography.fontWeightMedium}},ln=function(e){var t=e.text,r=e.icon,o=e.selected,a=e.items,i=e.size,l=void 0===i?"medium":i,c=e.level,u=e.sx,s=void 0===u?{}:u,d=Ut().state,m=be(null),f=n(),p=f.palette,v=f.spacing,y=ge(!1),h=y[0],g=y[1],E=an(n(),o),b=E.color,x=E.fontWeight,w=he.createElement($,{component:"div",disablePadding:!0},a.map((function(e){return he.createElement(dn,{key:e.id,level:c+1,item:e,size:l})}))),S="collapse"===d&&0===c?{position:"absolute",right:0}:{};return he.createElement(he.Fragment,null,he.createElement(T,{ref:m,selected:o,"aria-label":t,onClick:function(){return g((function(e){return!e}))},dense:"small"===l,sx:ct(ct({},s),{pl:"open"===d?v(2+1.5*c):void 0,backgroundColor:h?p.action.hover:void 0})},r&&he.createElement(P,{sx:{color:b}},r),he.createElement(j,{disableTypography:!0,primary:t,sx:{color:b,fontWeight:x,opacity:"collapse"===d&&0===c?0:void 0}}),h&&"open"===d?he.createElement(Be,{sx:[{color:b,ml:2},S]}):he.createElement(He,{sx:[{color:b,ml:2},S]})),"open"===d?he.createElement(z,{in:h,timeout:"auto",unmountOnExit:!0,"aria-label":"".concat(t," collapse submenu")},w):he.createElement(R,{open:h,PaperProps:{elevation:0,variant:"outlined"},"aria-label":"".concat(t," popover submenu"),anchorEl:m.current,onClose:function(){return g(!1)},anchorOrigin:{vertical:"top",horizontal:"right"}},w))},cn=w($t)((function(e){return{color:e.theme.palette.text.primary}})),un={minWidth:0,justifyContent:"center",marginRight:"auto"},sn=function(e){var t=e.text,r=e.icon,o=e.avatar,a=e.label,i=e.bullet,l=e.href,c=e.selected,u=e.size,s=void 0===u?"medium":u,d=e.level,m=e.sx,f=Ut().state,p=n(),v=an(p,c),y=v.color,h=v.fontWeight;return he.createElement(T,{LinkComponent:cn,dense:"small"===s,"aria-label":t,href:l,selected:c,sx:ct(ct(ct({},m),{pl:"open"===f?p.spacing(2+1.5*d):void 0}),"collapse"===f&&{paddingHorizontal:p.spacing(2.5),justifyContent:"center"})},r&&he.createElement(P,{sx:ct({color:y},"collapse"===f&&0===d&&un)},r),o&&he.createElement(N,{sx:ct({},"collapse"===f&&0===d&&un)},he.createElement(W,{alt:o.alt,src:o.src,sx:ct(ct({},"small"===s&&{width:24,height:24}),"collapse"===f&&{width:30,height:30})})),he.createElement(j,{disableTypography:!0,primary:t,sx:{color:y,fontWeight:h,opacity:"collapse"===f&&0===d?0:void 0}}),a&&"open"===f&&he.createElement(Ot,{text:a.text,variant:a.variant,sx:{ml:2}}),i&&"open"===f&&he.createElement(Ct,{variant:i.variant,sx:{ml:2}}))},dn=function(e){var t=e.item,n=e.size,r=void 0===n?"medium":n,o=e.level,a=void 0===o?0:o,i=Ut().selectedItemId;if("items"in t){var l=t.id,c=t.text,u=t.icon,s=t.items,d=s.some((function(e){return e.id===i}));return he.createElement(ln,{size:r,selected:l===i||d,text:c,icon:u,items:s,level:a})}l=t.id,c=t.text,u=t.icon;var m=t.avatar,f=t.label,p=t.bullet,v=t.href;return he.createElement(sn,{selected:l===i,size:r,text:c,icon:u,avatar:m,label:f,bullet:p,href:v,level:a})},mn=function(e){var t=e.title,r=e.items,o=e.size,a=void 0===o?"medium":o,i=Ut().state,l=n().spacing;return he.createElement(he.Fragment,null,t&&"open"===i&&he.createElement(on,{size:a,role:"heading"},t),he.createElement($,{sx:{paddingTop:"small"===a?l(0):void 0,paddingY:"collapse"===i?0:void 0}},r.map((function(e){return he.createElement(dn,{key:e.id,item:e,size:a})}))))},fn=function(e){var t=e.nav.items,n=e.size,r=void 0===n?"medium":n;return he.createElement(he.Fragment,null,t.map((function(e,t){var n=e.title,o=e.items;return he.createElement(mn,{key:t,title:n,items:o,size:r})})))},pn={temporary:!1,mini:!0,persistent:!0,clipped:!0},vn={temporary:function(){return!0},mini:function(e){return"open"!==e},persistent:function(){return!0},clipped:function(){return!1}},yn=function(e){var t=e.title,r=e.sx,a=e.children,i=ut(e,["title","sx","children"]),c=n(),u=Ut(),s=u.state,d=u.variant,m=u.switchState,f=u.drawerWidth,p=u.underAppBar,v=pn[d]&&!p&&ct({transition:c.transitions.create(["width","margin"],{easing:c.transitions.easing.sharp,duration:c.transitions.duration.leavingScreen})},"open"===s&&{marginLeft:f,width:"calc(100% - ".concat(f,"px)"),transition:c.transitions.create(["width","margin"],{easing:c.transitions.easing.sharp,duration:c.transitions.duration.enteringScreen})})||{};return ye.createElement(A,ct({position:p?"fixed":void 0},i,{sx:ct(ct(ct({},r),v),{zIndex:function(e){return e.zIndex.drawer+(p?1:0)}})}),ye.createElement(M,null,ye.createElement(l,{color:"inherit","aria-label":"open drawer",onClick:m,edge:"start",sx:{marginRight:5,display:vn[d](s)?void 0:"none"}},ye.createElement(Ue,null)),t&&ye.createElement(o,{variant:"h6",component:"h1",role:"heading","aria-level":1,noWrap:!0},t),a))},hn={temporary:!1,mini:!0,clipped:!0,persistent:!0},gn=w("div")((function(e){var t=e.theme,r=n().spacing,o=Ut(),a=o.drawerWidth,i=o.state,l=o.variant;return{marginLeft:hn[l]?"open"===i?a:"collapse"===i?r(8):0:0,transition:t.transitions.create("margin",{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen})}})),En=function(e){var t=e.children;return he.createElement(gn,null,he.createElement(Xt,null),t)},bn={small:15,medium:20},xn=function(e){var t=e.label,n=e.value,o=e.loading,a=void 0!==o&&o,i=e.fetching,l=void 0!==i&&i,c=e.size,u=void 0===c?"medium":c,s=e.fullWidth,d=void 0!==s&&s,f=e.color,p=e.children,v=e.onChange,y=Ce(),h=w(D)((function(){return f?{label:{color:f},".MuiOutlinedInput-notchedOutline":{borderColor:"".concat(f," !important")},".MuiInputBase-root":{color:f},".MuiSelect-icon":{fill:f}}:{}}));return he.createElement(h,{fullWidth:d},he.createElement(F,{id:y},t),he.createElement(V,{labelId:y,id:y,value:n,label:t,onChange:v,disabled:l,size:u,renderValue:function(e){return l?he.createElement(Lt,{centerVertical:!0,centerHorizontal:!0},he.createElement(m,{color:"inherit",size:bn[u]})):a?he.createElement(r,{display:"flex",flexDirection:"column"},e,he.createElement(_,{color:"inherit",sx:{position:"absolute",left:0,right:0,bottom:0}})):e}},p))},wn=function(e){var t=e.title,n=e.subtitle,a=e.loading,l=e.error,c=e.onSubmitSignIn,u=ge(""),s=u[0],d=u[1],m=ge(""),p=m[0],v=m[1];return he.createElement(he.Fragment,null,he.createElement(r,{marginBottom:2},he.createElement(o,{component:"h1",variant:"h4"},t),he.createElement(o,{variant:"body1"},n)),he.createElement(r,{component:"form",onSubmit:function(e){var t,n;e.preventDefault(),d(""),v("");var r=new FormData(e.currentTarget),o=null===(t=r.get("email"))||void 0===t?void 0:t.toString(),a=null===(n=r.get("password"))||void 0===n?void 0:n.toString();o||d("Please fill out this field"),a||v("Please fill out this field"),o&&a&&c(o,a)}},l&&he.createElement(q,{width:"100%",marginTop:1},he.createElement(f,{variant:"filled",severity:"error"},l.message)),he.createElement(i,{margin:"normal",fullWidth:!0,id:"email",label:"Email Address",name:"email",autoComplete:"email",autoFocus:!0,disabled:a,type:"email",inputProps:{role:"input"},error:!!s,helperText:s}),he.createElement(i,{margin:"normal",fullWidth:!0,role:"input",name:"password",label:"Password",type:"password",id:"password",disabled:a,autoComplete:"current-password",inputProps:{role:"input"},error:!!p,helperText:p}),he.createElement(Ye,{type:"submit",fullWidth:!0,variant:"contained",loading:a,disabled:a,role:"button",sx:{mt:2}},"Sign In")))};function Sn(e,t){return"production"===process.env.NODE_ENV?()=>null:function(...n){return e(...n)||t(...n)}}var Cn,kn={exports:{}},On={exports:{}},In={};var $n,Tn,Pn,jn,zn,Rn,Nn,Wn,An,Mn,Dn,Fn,Vn,_n,qn={};
|
|
2
2
|
/** @license React v16.13.1
|
|
3
3
|
* react-is.development.js
|
|
4
4
|
*
|
|
@@ -6,12 +6,12 @@ import{InputAdornment as e,Button as t,useTheme as n,Box as r,Typography as o,To
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/function
|
|
9
|
+
*/function Ln(){return Tn||(Tn=1,e=On,"production"===process.env.NODE_ENV?e.exports=function(){if(Cn)return In;Cn=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,s=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function E(e){if("object"==typeof e&&null!==e){var m=e.$$typeof;switch(m){case t:switch(e=e.type){case c:case u:case r:case a:case o:case d:return e;default:switch(e=e&&e.$$typeof){case l:case s:case p:case f:case i:return e;default:return m}}case n:return m}}}function b(e){return E(e)===u}return In.AsyncMode=c,In.ConcurrentMode=u,In.ContextConsumer=l,In.ContextProvider=i,In.Element=t,In.ForwardRef=s,In.Fragment=r,In.Lazy=p,In.Memo=f,In.Portal=n,In.Profiler=a,In.StrictMode=o,In.Suspense=d,In.isAsyncMode=function(e){return b(e)||E(e)===c},In.isConcurrentMode=b,In.isContextConsumer=function(e){return E(e)===l},In.isContextProvider=function(e){return E(e)===i},In.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},In.isForwardRef=function(e){return E(e)===s},In.isFragment=function(e){return E(e)===r},In.isLazy=function(e){return E(e)===p},In.isMemo=function(e){return E(e)===f},In.isPortal=function(e){return E(e)===n},In.isProfiler=function(e){return E(e)===a},In.isStrictMode=function(e){return E(e)===o},In.isSuspense=function(e){return E(e)===d},In.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===u||e===a||e===o||e===d||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===f||e.$$typeof===i||e.$$typeof===l||e.$$typeof===s||e.$$typeof===y||e.$$typeof===h||e.$$typeof===g||e.$$typeof===v)},In.typeOf=E,In}():e.exports=($n||($n=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,l=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,s=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,m=e?Symbol.for("react.suspense_list"):60120,f=e?Symbol.for("react.memo"):60115,p=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,h=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119;function E(e){if("object"==typeof e&&null!==e){var m=e.$$typeof;switch(m){case t:var v=e.type;switch(v){case c:case u:case r:case a:case o:case d:return v;default:var y=v&&v.$$typeof;switch(y){case l:case s:case p:case f:case i:return y;default:return m}}case n:return m}}}var b=c,x=u,w=l,S=i,C=t,k=s,O=r,I=p,$=f,T=n,P=a,j=o,z=d,R=!1;function N(e){return E(e)===u}qn.AsyncMode=b,qn.ConcurrentMode=x,qn.ContextConsumer=w,qn.ContextProvider=S,qn.Element=C,qn.ForwardRef=k,qn.Fragment=O,qn.Lazy=I,qn.Memo=$,qn.Portal=T,qn.Profiler=P,qn.StrictMode=j,qn.Suspense=z,qn.isAsyncMode=function(e){return R||(R=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),N(e)||E(e)===c},qn.isConcurrentMode=N,qn.isContextConsumer=function(e){return E(e)===l},qn.isContextProvider=function(e){return E(e)===i},qn.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},qn.isForwardRef=function(e){return E(e)===s},qn.isFragment=function(e){return E(e)===r},qn.isLazy=function(e){return E(e)===p},qn.isMemo=function(e){return E(e)===f},qn.isPortal=function(e){return E(e)===n},qn.isProfiler=function(e){return E(e)===a},qn.isStrictMode=function(e){return E(e)===o},qn.isSuspense=function(e){return E(e)===d},qn.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===u||e===a||e===o||e===d||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===f||e.$$typeof===i||e.$$typeof===l||e.$$typeof===s||e.$$typeof===y||e.$$typeof===h||e.$$typeof===g||e.$$typeof===v)},qn.typeOf=E}()),qn)),On.exports;var e}
|
|
10
10
|
/*
|
|
11
11
|
object-assign
|
|
12
12
|
(c) Sindre Sorhus
|
|
13
13
|
@license MIT
|
|
14
|
-
*/function Ln(){if(Pn)return Tn;Pn=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return Tn=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(r,o){for(var a,i,l=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(r),c=1;c<arguments.length;c++){for(var u in a=Object(arguments[c]))t.call(a,u)&&(l[u]=a[u]);if(e){i=e(a);for(var s=0;s<i.length;s++)n.call(a,i[s])&&(l[i[s]]=a[i[s]])}}return l},Tn}function Bn(){if(zn)return jn;zn=1;return jn="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Hn(){return Nn?Rn:(Nn=1,Rn=Function.call.bind(Object.prototype.hasOwnProperty))}if("production"!==process.env.NODE_ENV){var Un=qn();Cn.exports=function(){if(Dn)return Mn;Dn=1;var e=qn(),t=Ln(),n=Bn(),r=Hn(),o=function(){if(An)return Wn;An=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=Bn(),n={},r=Hn();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function o(o,a,i,l,c){if("production"!==process.env.NODE_ENV)for(var u in o)if(r(o,u)){var s;try{if("function"!=typeof o[u]){var d=Error((l||"React class")+": "+i+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}s=o[u](a,u,l,i,null,t)}catch(e){s=e}if(!s||s instanceof Error||e((l||"React class")+": type specification of "+i+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof s+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),s instanceof Error&&!(s.message in n)){n[s.message]=!0;var m=c?c():"";e("Failed "+i+" type: "+s.message+(null!=m?m:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(n={})},Wn=o}(),a=function(){};function i(){return null}return"production"!==process.env.NODE_ENV&&(a=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),Mn=function(l,c){var u="function"==typeof Symbol&&Symbol.iterator,s="@@iterator",d="<<anonymous>>",m={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:v(i),arrayOf:function(e){return v((function(t,r,o,a,i){if("function"!=typeof e)return new p("Property `"+i+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var l=t[r];if(!Array.isArray(l))return new p("Invalid "+a+" `"+i+"` of type `"+E(l)+"` supplied to `"+o+"`, expected an array.");for(var c=0;c<l.length;c++){var u=e(l,c,o,a,i+"["+c+"]",n);if(u instanceof Error)return u}return null}))},element:v((function(e,t,n,r,o){var a=e[t];return l(a)?null:new p("Invalid "+r+" `"+o+"` of type `"+E(a)+"` supplied to `"+n+"`, expected a single ReactElement.")})),elementType:v((function(t,n,r,o,a){var i=t[n];return e.isValidElementType(i)?null:new p("Invalid "+o+" `"+a+"` of type `"+E(i)+"` supplied to `"+r+"`, expected a single ReactElement type.")})),instanceOf:function(e){return v((function(t,n,r,o,a){if(!(t[n]instanceof e)){var i=e.name||d;return new p("Invalid "+o+" `"+a+"` of type `"+((l=t[n]).constructor&&l.constructor.name?l.constructor.name:d)+"` supplied to `"+r+"`, expected instance of `"+i+"`.")}var l;return null}))},node:v((function(e,t,n,r,o){return g(e[t])?null:new p("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")})),objectOf:function(e){return v((function(t,o,a,i,l){if("function"!=typeof e)return new p("Property `"+l+"` of component `"+a+"` has invalid PropType notation inside objectOf.");var c=t[o],u=E(c);if("object"!==u)return new p("Invalid "+i+" `"+l+"` of type `"+u+"` supplied to `"+a+"`, expected an object.");for(var s in c)if(r(c,s)){var d=e(c,s,a,i,l+"."+s,n);if(d instanceof Error)return d}return null}))},oneOf:function(e){return Array.isArray(e)?v((function(t,n,r,o,a){for(var i=t[n],l=0;l<e.length;l++)if(f(i,e[l]))return null;var c=JSON.stringify(e,(function(e,t){return"symbol"===b(t)?String(t):t}));return new p("Invalid "+o+" `"+a+"` of value `"+String(i)+"` supplied to `"+r+"`, expected one of "+c+".")})):("production"!==process.env.NODE_ENV&&a(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),i)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&a("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var t=0;t<e.length;t++){var o=e[t];if("function"!=typeof o)return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+x(o)+" at index "+t+"."),i}return v((function(t,o,a,i,l){for(var c=[],u=0;u<e.length;u++){var s=(0,e[u])(t,o,a,i,l,n);if(null==s)return null;s.data&&r(s.data,"expectedType")&&c.push(s.data.expectedType)}return new p("Invalid "+i+" `"+l+"` supplied to `"+a+"`"+(c.length>0?", expected one of type ["+c.join(", ")+"]":"")+".")}))},shape:function(e){return v((function(t,r,o,a,i){var l=t[r],c=E(l);if("object"!==c)return new p("Invalid "+a+" `"+i+"` of type `"+c+"` supplied to `"+o+"`, expected `object`.");for(var u in e){var s=e[u];if("function"!=typeof s)return h(o,a,i,u,b(s));var d=s(l,u,o,a,i+"."+u,n);if(d)return d}return null}))},exact:function(e){return v((function(o,a,i,l,c){var u=o[a],s=E(u);if("object"!==s)return new p("Invalid "+l+" `"+c+"` of type `"+s+"` supplied to `"+i+"`, expected `object`.");var d=t({},o[a],e);for(var m in d){var f=e[m];if(r(e,m)&&"function"!=typeof f)return h(i,l,c,m,b(f));if(!f)return new p("Invalid "+l+" `"+c+"` key `"+m+"` supplied to `"+i+"`.\nBad object: "+JSON.stringify(o[a],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var v=f(u,m,i,l,c+"."+m,n);if(v)return v}return null}))}};function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function p(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function v(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function o(o,i,l,u,s,m,f){if(u=u||d,m=m||l,f!==n){if(c){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var y=u+":"+l;!t[y]&&r<3&&(a("You are manually calling a React.PropTypes validation function for the `"+m+"` prop on `"+u+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[y]=!0,r++)}}return null==i[l]?o?null===i[l]?new p("The "+s+" `"+m+"` is marked as required in `"+u+"`, but its value is `null`."):new p("The "+s+" `"+m+"` is marked as required in `"+u+"`, but its value is `undefined`."):null:e(i,l,u,s,m)}var i=o.bind(null,!1);return i.isRequired=o.bind(null,!0),i}function y(e){return v((function(t,n,r,o,a,i){var l=t[n];return E(l)!==e?new p("Invalid "+o+" `"+a+"` of type `"+b(l)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function h(e,t,n,r,o){return new p((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function g(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(g);if(null===e||l(e))return!0;var t=function(e){var t=e&&(u&&e[u]||e[s]);if("function"==typeof t)return t}(e);if(!t)return!1;var n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!g(n.value))return!1}else for(;!(n=r.next()).done;){var o=n.value;if(o&&!g(o[1]))return!1}return!0;default:return!1}}function E(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function b(e){if(null==e)return""+e;var t=E(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function x(e){var t=b(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return p.prototype=Error.prototype,m.checkPropTypes=o,m.resetWarningCache=o.resetWarningCache,m.PropTypes=m,m},Mn}()(Un.isElement,!0)}else Cn.exports=function(){if(Vn)return Fn;Vn=1;var e=Bn();function t(){}function n(){}return n.resetWarningCache=t,Fn=function(){function r(t,n,r,o,a,i){if(i!==e){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function o(){return r}r.isRequired=r;var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a}}()();function Yn(e,t,n,r,o){const a=e[t],i=o||t;if(null==a||"undefined"==typeof window)return null;let l;const c=a.type;return"function"!=typeof c||function(e){const{prototype:t={}}=e;return Boolean(t.isReactComponent)}(c)||(l="Did you accidentally use a plain function component for an element instead?"),void 0!==l?new Error(`Invalid ${r} \`${i}\` supplied to \`${n}\`. Expected an element that can hold a ref. ${l} For more information see https://mui.com/r/caveat-with-refs-guide`):null}Sn(Cn.exports.element,Yn).isRequired=Sn(Cn.exports.element.isRequired,Yn),Sn(Cn.exports.elementType,(function(e,t,n,r,o){const a=e[t],i=o||t;if(null==a||"undefined"==typeof window)return null;let l;return"function"!=typeof a||function(e){const{prototype:t={}}=e;return Boolean(t.isReactComponent)}(a)||(l="Did you accidentally provide a plain function component instead?"),void 0!==l?new Error(`Invalid ${r} \`${i}\` supplied to \`${n}\`. Expected an element type that can hold a ref. ${l} For more information see https://mui.com/r/caveat-with-refs-guide`):null}));var Jn,Xn={};var Gn,Kn,Qn={};
|
|
14
|
+
*/function Bn(){if(jn)return Pn;jn=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return Pn=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(r,o){for(var a,i,l=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(r),c=1;c<arguments.length;c++){for(var u in a=Object(arguments[c]))t.call(a,u)&&(l[u]=a[u]);if(e){i=e(a);for(var s=0;s<i.length;s++)n.call(a,i[s])&&(l[i[s]]=a[i[s]])}}return l},Pn}function Hn(){if(Rn)return zn;Rn=1;return zn="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Un(){return Wn?Nn:(Wn=1,Nn=Function.call.bind(Object.prototype.hasOwnProperty))}if("production"!==process.env.NODE_ENV){var Yn=Ln();kn.exports=function(){if(Fn)return Dn;Fn=1;var e=Ln(),t=Bn(),n=Hn(),r=Un(),o=function(){if(Mn)return An;Mn=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=Hn(),n={},r=Un();e=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}}function o(o,a,i,l,c){if("production"!==process.env.NODE_ENV)for(var u in o)if(r(o,u)){var s;try{if("function"!=typeof o[u]){var d=Error((l||"React class")+": "+i+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}s=o[u](a,u,l,i,null,t)}catch(e){s=e}if(!s||s instanceof Error||e((l||"React class")+": type specification of "+i+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof s+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),s instanceof Error&&!(s.message in n)){n[s.message]=!0;var m=c?c():"";e("Failed "+i+" type: "+s.message+(null!=m?m:""))}}}return o.resetWarningCache=function(){"production"!==process.env.NODE_ENV&&(n={})},An=o}(),a=function(){};function i(){return null}return"production"!==process.env.NODE_ENV&&(a=function(e){var t="Warning: "+e;"undefined"!=typeof console&&console.error(t);try{throw new Error(t)}catch(e){}}),Dn=function(l,c){var u="function"==typeof Symbol&&Symbol.iterator,s="@@iterator",d="<<anonymous>>",m={array:y("array"),bigint:y("bigint"),bool:y("boolean"),func:y("function"),number:y("number"),object:y("object"),string:y("string"),symbol:y("symbol"),any:v(i),arrayOf:function(e){return v((function(t,r,o,a,i){if("function"!=typeof e)return new p("Property `"+i+"` of component `"+o+"` has invalid PropType notation inside arrayOf.");var l=t[r];if(!Array.isArray(l))return new p("Invalid "+a+" `"+i+"` of type `"+E(l)+"` supplied to `"+o+"`, expected an array.");for(var c=0;c<l.length;c++){var u=e(l,c,o,a,i+"["+c+"]",n);if(u instanceof Error)return u}return null}))},element:v((function(e,t,n,r,o){var a=e[t];return l(a)?null:new p("Invalid "+r+" `"+o+"` of type `"+E(a)+"` supplied to `"+n+"`, expected a single ReactElement.")})),elementType:v((function(t,n,r,o,a){var i=t[n];return e.isValidElementType(i)?null:new p("Invalid "+o+" `"+a+"` of type `"+E(i)+"` supplied to `"+r+"`, expected a single ReactElement type.")})),instanceOf:function(e){return v((function(t,n,r,o,a){if(!(t[n]instanceof e)){var i=e.name||d;return new p("Invalid "+o+" `"+a+"` of type `"+((l=t[n]).constructor&&l.constructor.name?l.constructor.name:d)+"` supplied to `"+r+"`, expected instance of `"+i+"`.")}var l;return null}))},node:v((function(e,t,n,r,o){return g(e[t])?null:new p("Invalid "+r+" `"+o+"` supplied to `"+n+"`, expected a ReactNode.")})),objectOf:function(e){return v((function(t,o,a,i,l){if("function"!=typeof e)return new p("Property `"+l+"` of component `"+a+"` has invalid PropType notation inside objectOf.");var c=t[o],u=E(c);if("object"!==u)return new p("Invalid "+i+" `"+l+"` of type `"+u+"` supplied to `"+a+"`, expected an object.");for(var s in c)if(r(c,s)){var d=e(c,s,a,i,l+"."+s,n);if(d instanceof Error)return d}return null}))},oneOf:function(e){return Array.isArray(e)?v((function(t,n,r,o,a){for(var i=t[n],l=0;l<e.length;l++)if(f(i,e[l]))return null;var c=JSON.stringify(e,(function(e,t){return"symbol"===b(t)?String(t):t}));return new p("Invalid "+o+" `"+a+"` of value `"+String(i)+"` supplied to `"+r+"`, expected one of "+c+".")})):("production"!==process.env.NODE_ENV&&a(arguments.length>1?"Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).":"Invalid argument supplied to oneOf, expected an array."),i)},oneOfType:function(e){if(!Array.isArray(e))return"production"!==process.env.NODE_ENV&&a("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var t=0;t<e.length;t++){var o=e[t];if("function"!=typeof o)return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+x(o)+" at index "+t+"."),i}return v((function(t,o,a,i,l){for(var c=[],u=0;u<e.length;u++){var s=(0,e[u])(t,o,a,i,l,n);if(null==s)return null;s.data&&r(s.data,"expectedType")&&c.push(s.data.expectedType)}return new p("Invalid "+i+" `"+l+"` supplied to `"+a+"`"+(c.length>0?", expected one of type ["+c.join(", ")+"]":"")+".")}))},shape:function(e){return v((function(t,r,o,a,i){var l=t[r],c=E(l);if("object"!==c)return new p("Invalid "+a+" `"+i+"` of type `"+c+"` supplied to `"+o+"`, expected `object`.");for(var u in e){var s=e[u];if("function"!=typeof s)return h(o,a,i,u,b(s));var d=s(l,u,o,a,i+"."+u,n);if(d)return d}return null}))},exact:function(e){return v((function(o,a,i,l,c){var u=o[a],s=E(u);if("object"!==s)return new p("Invalid "+l+" `"+c+"` of type `"+s+"` supplied to `"+i+"`, expected `object`.");var d=t({},o[a],e);for(var m in d){var f=e[m];if(r(e,m)&&"function"!=typeof f)return h(i,l,c,m,b(f));if(!f)return new p("Invalid "+l+" `"+c+"` key `"+m+"` supplied to `"+i+"`.\nBad object: "+JSON.stringify(o[a],null," ")+"\nValid keys: "+JSON.stringify(Object.keys(e),null," "));var v=f(u,m,i,l,c+"."+m,n);if(v)return v}return null}))}};function f(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function p(e,t){this.message=e,this.data=t&&"object"==typeof t?t:{},this.stack=""}function v(e){if("production"!==process.env.NODE_ENV)var t={},r=0;function o(o,i,l,u,s,m,f){if(u=u||d,m=m||l,f!==n){if(c){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}if("production"!==process.env.NODE_ENV&&"undefined"!=typeof console){var y=u+":"+l;!t[y]&&r<3&&(a("You are manually calling a React.PropTypes validation function for the `"+m+"` prop on `"+u+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),t[y]=!0,r++)}}return null==i[l]?o?null===i[l]?new p("The "+s+" `"+m+"` is marked as required in `"+u+"`, but its value is `null`."):new p("The "+s+" `"+m+"` is marked as required in `"+u+"`, but its value is `undefined`."):null:e(i,l,u,s,m)}var i=o.bind(null,!1);return i.isRequired=o.bind(null,!0),i}function y(e){return v((function(t,n,r,o,a,i){var l=t[n];return E(l)!==e?new p("Invalid "+o+" `"+a+"` of type `"+b(l)+"` supplied to `"+r+"`, expected `"+e+"`.",{expectedType:e}):null}))}function h(e,t,n,r,o){return new p((e||"React class")+": "+t+" type `"+n+"."+r+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+o+"`.")}function g(e){switch(typeof e){case"number":case"string":case"undefined":return!0;case"boolean":return!e;case"object":if(Array.isArray(e))return e.every(g);if(null===e||l(e))return!0;var t=function(e){var t=e&&(u&&e[u]||e[s]);if("function"==typeof t)return t}(e);if(!t)return!1;var n,r=t.call(e);if(t!==e.entries){for(;!(n=r.next()).done;)if(!g(n.value))return!1}else for(;!(n=r.next()).done;){var o=n.value;if(o&&!g(o[1]))return!1}return!0;default:return!1}}function E(e){var t=typeof e;return Array.isArray(e)?"array":e instanceof RegExp?"object":function(e,t){return"symbol"===e||!!t&&("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}(t,e)?"symbol":t}function b(e){if(null==e)return""+e;var t=E(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function x(e){var t=b(e);switch(t){case"array":case"object":return"an "+t;case"boolean":case"date":case"regexp":return"a "+t;default:return t}}return p.prototype=Error.prototype,m.checkPropTypes=o,m.resetWarningCache=o.resetWarningCache,m.PropTypes=m,m},Dn}()(Yn.isElement,!0)}else kn.exports=function(){if(_n)return Vn;_n=1;var e=Hn();function t(){}function n(){}return n.resetWarningCache=t,Vn=function(){function r(t,n,r,o,a,i){if(i!==e){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function o(){return r}r.isRequired=r;var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return a.PropTypes=a,a}}()();function Jn(e,t,n,r,o){const a=e[t],i=o||t;if(null==a||"undefined"==typeof window)return null;let l;const c=a.type;return"function"!=typeof c||function(e){const{prototype:t={}}=e;return Boolean(t.isReactComponent)}(c)||(l="Did you accidentally use a plain function component for an element instead?"),void 0!==l?new Error(`Invalid ${r} \`${i}\` supplied to \`${n}\`. Expected an element that can hold a ref. ${l} For more information see https://mui.com/r/caveat-with-refs-guide`):null}Sn(kn.exports.element,Jn).isRequired=Sn(kn.exports.element.isRequired,Jn),Sn(kn.exports.elementType,(function(e,t,n,r,o){const a=e[t],i=o||t;if(null==a||"undefined"==typeof window)return null;let l;return"function"!=typeof a||function(e){const{prototype:t={}}=e;return Boolean(t.isReactComponent)}(a)||(l="Did you accidentally provide a plain function component instead?"),void 0!==l?new Error(`Invalid ${r} \`${i}\` supplied to \`${n}\`. Expected an element type that can hold a ref. ${l} For more information see https://mui.com/r/caveat-with-refs-guide`):null}));var Xn,Gn={};var Kn,Qn,Zn={};
|
|
15
15
|
/**
|
|
16
16
|
* @license React
|
|
17
17
|
* react-is.development.js
|
|
@@ -20,5 +20,5 @@ object-assign
|
|
|
20
20
|
*
|
|
21
21
|
* This source code is licensed under the MIT license found in the
|
|
22
22
|
* LICENSE file in the root directory of this source tree.
|
|
23
|
-
*/Kn={exports:{}},"production"===process.env.NODE_ENV?Kn.exports=function(){if(Jn)return Xn;Jn=1;var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen");function v(e){if("object"==typeof e&&null!==e){var p=e.$$typeof;switch(p){case t:switch(e=e.type){case r:case a:case o:case s:case d:return e;default:switch(e=e&&e.$$typeof){case c:case l:case u:case f:case m:case i:return e;default:return p}}case n:return p}}}return e=Symbol.for("react.module.reference"),Xn.ContextConsumer=l,Xn.ContextProvider=i,Xn.Element=t,Xn.ForwardRef=u,Xn.Fragment=r,Xn.Lazy=f,Xn.Memo=m,Xn.Portal=n,Xn.Profiler=a,Xn.StrictMode=o,Xn.Suspense=s,Xn.SuspenseList=d,Xn.isAsyncMode=function(){return!1},Xn.isConcurrentMode=function(){return!1},Xn.isContextConsumer=function(e){return v(e)===l},Xn.isContextProvider=function(e){return v(e)===i},Xn.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Xn.isForwardRef=function(e){return v(e)===u},Xn.isFragment=function(e){return v(e)===r},Xn.isLazy=function(e){return v(e)===f},Xn.isMemo=function(e){return v(e)===m},Xn.isPortal=function(e){return v(e)===n},Xn.isProfiler=function(e){return v(e)===a},Xn.isStrictMode=function(e){return v(e)===o},Xn.isSuspense=function(e){return v(e)===s},Xn.isSuspenseList=function(e){return v(e)===d},Xn.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===r||t===a||t===o||t===s||t===d||t===p||"object"==typeof t&&null!==t&&(t.$$typeof===f||t.$$typeof===m||t.$$typeof===i||t.$$typeof===l||t.$$typeof===u||t.$$typeof===e||void 0!==t.getModuleId)},Xn.typeOf=v,Xn}():Kn.exports=(Gn||(Gn=1,"production"!==process.env.NODE_ENV&&function(){var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen");function v(e){if("object"==typeof e&&null!==e){var p=e.$$typeof;switch(p){case t:var v=e.type;switch(v){case r:case a:case o:case s:case d:return v;default:var y=v&&v.$$typeof;switch(y){case c:case l:case u:case f:case m:case i:return y;default:return p}}case n:return p}}}e=Symbol.for("react.module.reference");var y=l,h=i,g=t,E=u,b=r,x=f,S=m,w=n,C=a,k=o,O=s,I=d,$=!1,T=!1;Qn.ContextConsumer=y,Qn.ContextProvider=h,Qn.Element=g,Qn.ForwardRef=E,Qn.Fragment=b,Qn.Lazy=x,Qn.Memo=S,Qn.Portal=w,Qn.Profiler=C,Qn.StrictMode=k,Qn.Suspense=O,Qn.SuspenseList=I,Qn.isAsyncMode=function(e){return $||($=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},Qn.isConcurrentMode=function(e){return T||(T=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1},Qn.isContextConsumer=function(e){return v(e)===l},Qn.isContextProvider=function(e){return v(e)===i},Qn.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Qn.isForwardRef=function(e){return v(e)===u},Qn.isFragment=function(e){return v(e)===r},Qn.isLazy=function(e){return v(e)===f},Qn.isMemo=function(e){return v(e)===m},Qn.isPortal=function(e){return v(e)===n},Qn.isProfiler=function(e){return v(e)===a},Qn.isStrictMode=function(e){return v(e)===o},Qn.isSuspense=function(e){return v(e)===s},Qn.isSuspenseList=function(e){return v(e)===d},Qn.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===r||t===a||t===o||t===s||t===d||t===p||"object"==typeof t&&null!==t&&(t.$$typeof===f||t.$$typeof===m||t.$$typeof===i||t.$$typeof===l||t.$$typeof===u||t.$$typeof===e||void 0!==t.getModuleId)},Qn.typeOf=v}()),Qn),"undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),Cn.exports.oneOfType([Cn.exports.func,Cn.exports.object]);let Zn=0;const er=ye.useId;function tr(e){if(void 0!==er){const t=er();return null!=e?e:t}return function(e){const[t,n]=ye.useState(e),r=e||t;return ye.useEffect((()=>{null==t&&(Zn+=1,n(`mui-${Zn}`))}),[t]),r}(e)}const nr={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};const rr=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function or(e,t,n,r){const o=e[t];if(null==o||!rr(o)){const e=function(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":Number.isFinite(e)?e!==Math.floor(e)?"float":"number":"Infinity";case"object":return null===e?"null":e.constructor.name;default:return t}}(o);return new RangeError(`Invalid ${r} \`${t}\` of type \`${e}\` supplied to \`${n}\`, expected \`integer\`.`)}return null}function ar(e,t,...n){return void 0===e[t]?null:or(e,t,...n)}function ir(){return null}ar.isRequired=or,ir.isRequired=ir,process.env.NODE_ENV;var lr=function(t){var n,r=t.id,o=t.label,a=t.InputLabelProps,i=t.InputProps,l=t.fetching,c=t.loading,u=t.helperText,s=t.hexColor,d=t.size,f=t.fullWidth,p=t.sx,v=ct(t,["id","label","InputLabelProps","InputProps","fetching","loading","helperText","hexColor","size","fullWidth","sx"]),y=tr(r),h=u&&y?"".concat(y,"-helper-text"):void 0,g=o&&y?"".concat(y,"-label"):void 0,E=s?((n={})["& .".concat(L.notchedOutline)]={borderColor:"".concat(s," !important")},n["& .".concat(B.root)]={color:s},n["& .".concat(L.input)]={color:s},n["& .".concat(H.root)]={color:s},n["& .".concat(U.bar)]={backgroundColor:s},n["& .".concat(Y.endAdornment," .").concat(J.root)]={color:s},n):{};return he.createElement(D,{sx:E,fullWidth:f},he.createElement(F,lt({size:"small"===d?"small":"normal",id:g,htmlFor:y},a),o),he.createElement(X,lt({},i,{id:y,label:o,size:d,fullWidth:f,endAdornment:he.createElement(e,{position:"end"},null==i?void 0:i.endAdornment,l?he.createElement(m,{color:"inherit",size:20,sx:{ml:1}}):null),sx:p},v)),c&&he.createElement(_,{color:"inherit",sx:{position:"absolute",left:0,right:0,bottom:0}}),u&&he.createElement(G,{id:h},u))},cr=function(e){var t=e.label,n=e.loading,r=e.fetching,o=e.options,a=e.helperText,i=e.color,l=e.onChangeValue,c=void 0===l?function(){return null}:l,u=e.sx,s=ct(e,["label","loading","fetching","options","helperText","color","onChangeValue","sx"]),d=n||r;return he.createElement(K,lt({loading:d,options:r?[]:o,onChange:function(e,t){return c(t)}},s,{renderInput:function(e){return he.createElement(lr,lt({},e,{label:t,fullWidth:!0,fetching:r,loading:n,hexColor:i,helperText:a}))},sx:u}))};function ur(e){var t=e.children,n=e.index,o=Wt()[0],a=o===n;return Array.isArray(n)&&(a=n.includes(o)),he.createElement("div",{role:"tabpanel",hidden:!a,id:"simple-tabpanel-".concat(n),"aria-labelledby":"simple-tab-".concat(n)},a&&he.createElement(r,{sx:{p:3}},t))}var sr=S(b)((function(e){var t,n=e.theme;return(t={})["&.".concat(Q.root)]={backgroundColor:n.palette.grey[100]},t})),dr=function(e){var t=e.children,n=e.tabs,r=Wt(),o=r[0],a=r[1];return he.createElement(c,null,he.createElement(sr,{value:o,onChange:function(e,t){return a(t)}},n.map((function(e){return he.createElement(x,{key:e,label:e})}))),t)},mr=function(e){var t=e.order,n=e.orderBy,o=e.headCells,a=e.onRequestSort;return he.createElement(Z,null,he.createElement(ee,null,o.map((function(e){return he.createElement(te,{variant:"head",key:String(e.id),padding:e.disablePadding?"none":"normal",sortDirection:n===e.id&&t,sx:{fontWeight:"bold"}},e.sort?he.createElement(ne,{active:n===e.id,direction:n===e.id?t:"asc",onClick:(o=e.id,function(){a(o)})},e.label,n===e.id?he.createElement(r,{component:"span",sx:nr},"desc"===t?"sorted descending":"sorted ascending"):null):e.label);var o}))))};function fr(e,t,n){return t[n]<e[n]?-1:t[n]>e[n]?1:0}var pr=function(t){var n=t.children,o=t.data,a=t.search,l=t.columns,c=t.defaultSort,u=t.defaultOrder,s=void 0===u?"asc":u,d=t.loading,f=void 0!==d&&d,p=ge(""),v=p[0],y=p[1],h=ge(s),g=h[0],E=h[1],b=ge(c),x=b[0],S=b[1],w=o.slice().filter(function(e,t){return function(n){return!t||e.some((function(e){var r=n[e.id];return(null==r?void 0:r.toLowerCase)&&(r=r.toLowerCase()),null==r?void 0:r.toString().includes(t.toLowerCase())}))}}(l,v)).sort(function(e,t){return"desc"===e?function(e,n){return fr(e,n,t)}:function(e,n){return-fr(e,n,t)}}(g,x));return he.createElement(he.Fragment,null,he.createElement(r,{sx:{paddingX:1,paddingBottom:2}},a&&he.createElement(r,{paddingY:2},he.createElement(i,{fullWidth:!0,placeholder:"Search",InputProps:{role:"search",startAdornment:he.createElement(e,{position:"start"},he.createElement(Je,null))},onChange:function(e){return y(e.target.value)}})),he.createElement(re,null,he.createElement(oe,null,he.createElement(mr,{order:g,orderBy:x,headCells:l,onRequestSort:function(e){E(x===e&&"asc"===g?"desc":"asc"),S(e)}}),he.createElement(ae,null,f?he.createElement(ee,null,he.createElement(te,{colSpan:l.length,sx:{textAlign:"center"}},he.createElement(m,null))):0===w.length?he.createElement(ee,null,he.createElement(te,{colSpan:l.length,sx:{textAlign:"center"}},"No data")):n(w))))))};pr.defaultProps={defaultOrder:"asc"};var vr,yr=function(e){var t=e.children,n=e.data,r=e.loading,o=e.columns,a=e.defaultSort,i=e.defaultOrder,l=e.onRequestSort,c=ge({orderBy:a,order:i||"asc"}),u=c[0],s=c[1];return he.createElement(he.Fragment,null,he.createElement(re,null,he.createElement(oe,null,he.createElement(mr,{order:u.order,orderBy:u.orderBy,headCells:o,onRequestSort:function(e){s((function(t){var n=t.orderBy,r=t.order,o=n===e&&"asc"===r?"desc":"asc";return l(e,o),{orderBy:e,order:o}}))}}),he.createElement(ae,null,r?he.createElement(ee,null,he.createElement(te,{colSpan:o.length,sx:{textAlign:"center"}},he.createElement(m,null))):n.map((function(e,n){return t(e,n)}))))))},hr=function(e){var n=e.title,a=e.subtitle,i=e.icon,l=e.iconSize,c=void 0===l?200:l,u=e.actions;return he.createElement(r,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center"},i&&i({size:c,color:"primary"}),he.createElement(o,{variant:"h4",role:"heading","aria-level":1},n),he.createElement(o,{variant:"subtitle1",role:"heading","aria-level":2,sx:{mt:2}},a),u&&he.createElement(r,{sx:{pt:2}},u.map((function(e,n){var r=e.id,o=e.text,a=e.href,i=e.onClick;return he.createElement(t,{key:r,role:"button",variant:"contained",href:a,onClick:i,sx:{mr:n<u.length-1?2:0}},o)}))))},gr=function(e){var t=e.width,n=void 0===t?"100%":t,o=e.animation,a=void 0!==o&&o;return he.createElement(r,{width:n},he.createElement(ie,{animation:a,variant:"rectangular",height:118}),he.createElement(ie,{animation:a,variant:"rectangular",height:16,sx:{my:1}}),he.createElement(ie,{animation:a,variant:"rectangular",width:"80%",height:16}))},Er=function(e){var t=e.size,n=void 0===t?20:t;return he.createElement(s,{container:!0,spacing:2},pt(n,0).map((function(e,t){return he.createElement(s,{item:!0,key:t,xs:4},he.createElement(gr,{width:1}))})))},br=function(e){var t=e.size,n=void 0===t?20:t,r=e.children,o=e.p;return he.createElement(g,{component:"main",sx:{p:o},"data-testid":"content-placeholder-test"},r,he.createElement(Er,{size:n}))},xr=function(e){var t=e.count,n=void 0===t?3:t,r=e.units,a=void 0===r?"paragraph":r,i=e.variant,l=void 0===i?"body1":i;return he.createElement(o,{variant:l},Xe({count:n,units:a}))},Sr=((vr={})["& .".concat(le.message)]={width:1},vr),wr=Ee((function(e,t){var n=e.severity,o=e.iconMapping,a=e.title,i=e.message,c=e.metadata,u=e.onClose,s=ge(!1),d=s[0],m=s[1];return he.createElement(f,{ref:t,severity:n,iconMapping:o,onClose:u,action:he.createElement(r,{display:"flex",flexDirection:"column"},he.createElement(l,{color:"inherit",onClick:u},he.createElement(Te,{fontSize:"small"})),c&&he.createElement(l,{color:"inherit",onClick:function(){return m((function(e){return!e}))}},d?he.createElement(Ge,{fontSize:"small"}):he.createElement(Be,{fontSize:"small"}))),sx:Sr},he.createElement(r,{sx:{w:1}},a&&he.createElement(p,null,a),i,c&&he.createElement(z,{in:d,sx:{mt:2}},he.createElement(Vt,{content:c}))))})),Cr=function(e){var n=e.open,o=e.title,a=e.component,i=e.componentProps,c=void 0===i?{}:i,u=e.disabled,s=e.actions,d=void 0===s?[]:s,f=e.children,p=e.loading,v=e.cancelable,y=e.callCloseWhenCancel,h=void 0===y||y,g=e.acceptable,E=e.acceptText,b=void 0===E?"Accept":E,x=e.cancelText,S=void 0===x?"Cancel":x,w=e.onAccept,C=e.onCancel,k=void 0===C?function(){return null}:C,O=e.onClose,I=e.acceptType,$=void 0===I?"button":I,T=d.length>0||g||v;return he.createElement(ce,{open:n,onClose:O},he.createElement(ue,{sx:{display:"flex",alignItems:"center"}},o,p&&!g&&he.createElement(m,{size:20,sx:{ml:2,color:function(e){return e.palette.grey[500]}}}),he.createElement(l,{disabled:u,"aria-label":"close",onClick:O,sx:{position:"absolute",right:8,top:8,color:function(e){return e.palette.grey[500]}}},he.createElement(Te,null))),he.createElement(r,lt({component:a},c),he.createElement(se,{dividers:!0},f),T&&he.createElement(de,null,d.map((function(e){var n=e.id,r=e.text,o=e.type,a=void 0===o?"button":o,i=e.onClick,l=e.color,c=void 0===l?"primary":l;return he.createElement(t,{key:n,type:a,disabled:u,onClick:i,color:c},r)})),v&&he.createElement(t,{color:"error",disabled:u,onClick:function(){k(),h&&O()}},S),g&&he.createElement(Ye,{type:$,loading:p,disabled:u,onClick:w},b))))},kr=function(e){var t=e.open,n=e.title,r=e.loading,o=e.disabled,a=e.confirmText,i=void 0===a?"Confirm":a,l=e.cancelText,c=void 0===l?"Cancel":l,u=e.children,s=e.onConfirm,d=e.onCancel;return he.createElement(Cr,{title:n,loading:r,disabled:r||o,open:t,onClose:d,acceptable:!0,cancelable:!0,callCloseWhenCancel:!1,acceptText:i,cancelText:c,onCancel:d,onAccept:s},u)},Or=function(e){var t=e.open,n=e.title,r=e.loading,o=e.disabled,a=e.submitText,i=void 0===a?"Submit":a,l=e.cancelText,c=void 0===l?"Cancel":l,u=e.children,s=e.onSubmit,d=e.onCancel;return he.createElement(Cr,{component:"form",componentProps:{onSubmit:function(e){e.preventDefault(),s(ht(e))}},title:n,loading:r,disabled:r||o,open:t,onClose:d,callCloseWhenCancel:!1,cancelable:!0,acceptable:!0,cancelText:c,onCancel:d,acceptText:i,acceptType:"submit"},u)},Ir=function(e){void 0===e&&(e=!1);var t=ge(e),n=t[0],r=t[1];return{isOpen:n,open:function(){return r(!0)},close:function(){return r(!1)},setIsOpen:r}},$r=function(e){var t=e.drawerProviderProps,n=e.children,r=n[0],o=n[1],a=n[2];return he.createElement(nn,lt({},t),r,o,he.createElement(gn,null,a))},Tr=function(e){var t=e.loading,n=e.children,o=n[0],a=n[1];return he.createElement(At,null,he.createElement(r,{display:"flex",flexDirection:"column",height:1},o,t?he.createElement(bt,null):a))},Pr=function(e,t,n){var r=(void 0===n?{}:n).dense,o=e.id,a=e.name,i=e.type,l=t[o];return"boolean"===i?he.createElement(it,{dense:r,label:a,value:l}):"date"===i||"time"===i||"datetime"===i?he.createElement(st,{dense:r,label:a,value:l,format:e.format}):"object"!=typeof l||Array.isArray(l)?he.createElement(ot,{dense:r,label:a,value:null==l?void 0:l.toString()}):he.createElement(ot,{dense:r,label:a,value:JSON.stringify(l)})},jr=function(e){var t=e.field,n=t.name,r=t.description,o=t.value,a=e.instance,i=e.dense,l=[{field:"id",headerName:"ID",width:70}];o.forEach((function(e){l.push({field:e.id,headerName:e.name})}));var c=a.map((function(e,t){return lt({id:t},e)}));return he.createElement(mt,{title:n,subtitle:r,dense:i},he.createElement(s,{item:!0,xs:12},he.createElement(Ke,{rows:c,columns:l,density:i?"compact":"standard",disableRowSelectionOnClick:!0,pageSizeOptions:[5],initialState:{pagination:{paginationModel:{pageSize:5}}},sx:{height:400}})))},zr=function(e){var t=e.field,n=t.name,r=t.description,o=t.value,a=e.instance,i=e.dense,l=yt();return he.createElement(mt,{title:n,subtitle:r,dense:i},o.map((function(e){var t=e.id,n=e.xs,r=e.sm,o=e.md,c=e.lg,u=e.xl,s=l.increment(e);return he.createElement(Et,{key:t,xs:n,sm:r,md:o,lg:c,xl:u,bordered:s},Pr(e,a,{dense:i}))})))},Rr=function(e){var t=e.model,n=e.instance,r=e.dense,o=yt();return he.createElement(s,{container:!0,spacing:r?1:2},t.fields.map((function(e){var t=e.id,a=e.type,i=e.xs,l=void 0===i?3:i,c=e.sm,u=void 0===c?0:c,d=e.md,m=void 0===d?0:d,f=e.lg,p=void 0===f?0:f,v=e.xl,y=void 0===v?0:v;if("group"===a)return o.increment({xs:12}),he.createElement(s,{item:!0,key:t,xs:12},he.createElement(zr,{field:e,instance:n[t],dense:r}));if("group[]"===a)return o.increment({xs:12}),he.createElement(s,{item:!0,key:t,xs:12},he.createElement(jr,{field:e,instance:n[t],dense:r}));var h=o.increment(e);return he.createElement(Et,{key:t,xs:l,sm:u,md:m,lg:p,xl:y,bordered:h},Pr(e,n,{dense:r}))})))},Nr={string:"",number:0,boolean:!1,enum:"",multienum:[],date:new Date(1970,0,1,0,0),time:new Date(1970,0,1,0,0),datetime:new Date(1970,0,1,0,0),group:{},"group[]":[],"string[]":[],"number[]":[]},Wr=function(e,t){return t&&t[e.id]||"default"in e&&e.default||Nr[e.type]},Ar=function(e,t){void 0===t&&(t=void 0);var n={};return e.fields.forEach((function(e){if("group"===e.type){var r={};e.value.forEach((function(n){r[n.id]=Wr(n,t&&t[e.id])})),n[e.id]=r}else n[e.id]=Wr(e,t)})),n},Mr=function(e){var n=e.model,a=e.saveButtonText,l=e.onSubmit,u=e.initialValues,d=ke((function(){return Ar(n,u)}),[n,u]),m=ge(d),f=m[0],p=m[1],v=function(e,t,n){p((function(r){var o,a={};return t?a[t]=lt(lt({},r[t]),((o={})[e]=n,o)):a[e]=n,lt(lt({},r),a)}))},y=function(e,t,n){e.preventDefault();var r=e.target.value;"number"===n&&"string"==typeof r?r=parseInt(e.target.value,10):n.includes("[]")&&(r=e.target.value.split(",")),v(e.target.name,t,r)},h=function(e,t,n){v(n,t,e)},g=function(e,t){void 0===t&&(t=void 0);var n,a=dt({lightWeight:200,darkWeight:800}),l=e.id,u=e.type,d=e.name,m=e.description,p=e.xs,E=e.sm,b=e.md,x=e.lg,S=e.xl,w=t?f[t][l]:f[l];if("group"===u)n=he.createElement(c,null,he.createElement(r,{bgcolor:a,px:2,py:1,mb:2},he.createElement(o,{variant:"h6",role:"heading","aria-level":1},d),he.createElement(o,{variant:"body2",role:"heading","aria-level":2},m)),he.createElement(s,{container:!0,spacing:2,sx:{p:2}},e.value.map((function(e){return g(e,l)}))));else if("boolean"===u)n=he.createElement(r,{sx:{height:1,display:"flex",alignItems:"center"}},he.createElement(me,{control:he.createElement(fe,{name:l,onChange:function(e){return function(e,t){e.preventDefault(),v(e.target.name,t,e.target.checked)}(e,t)},checked:w}),label:d}));else if("enum"===u)n=he.createElement(D,{fullWidth:!0},he.createElement(F,{id:"".concat(l,"-select-label")},d),he.createElement(V,{labelId:"".concat(l,"-select-label"),id:"".concat(l,"-select"),value:w,label:d,name:l,onChange:function(e){return function(e,t){e.preventDefault(),v(e.target.name,t,e.target.value)}(e,t)},required:!0},e.value.map((function(e){return he.createElement(pe,{key:e,value:e},e)}))));else if("multienum"===u)n=he.createElement(D,{fullWidth:!0},he.createElement(F,{id:"".concat(l,"-select-label")},d),he.createElement(V,{labelId:"".concat(l,"-select-label"),id:"".concat(l,"-select"),value:w||[],renderValue:function(e){return e.join(", ")},label:d,name:l,onChange:function(e){return function(e,t){e.preventDefault();var n=e.target.value,r="string"==typeof n?n.split(","):n;v(e.target.name,t,r)}(e,t)},required:!0,multiple:!0},e.value.map((function(e){return he.createElement(pe,{key:e,value:e},he.createElement(fe,{checked:(w||[]).includes(e)}),he.createElement(j,{primary:e}))}))));else if("date"===u)n=he.createElement(Ne,{label:d,format:e.format,value:w,onChange:function(e){return h(e,t,l)}});else if("time"===u)n=he.createElement(ze,{label:d,format:e.format,value:w,onChange:function(e){return h(e,t,l)}});else if("datetime"===u)n=he.createElement(je,{label:d,format:e.format,value:w,onChange:function(e){return h(e,t,l)}});else{if("group[]"===u)return null;n=u.includes("[]")?he.createElement(i,{required:!0,type:"text",label:d,name:l,variant:"outlined",helperText:"Use comas to separate multiple values",fullWidth:!0,value:w.join(","),onChange:function(e){return y(e,t,u)}}):he.createElement(i,{required:!0,type:u,label:d,name:l,variant:"outlined",fullWidth:!0,value:w,onChange:function(e){return y(e,t,u)}})}return he.createElement(s,{item:!0,key:l,xs:p,sm:E,md:b,lg:x,xl:S},n)};return he.createElement(s,{container:!0,component:"form",spacing:2,onSubmit:function(e){e.preventDefault(),l(f)}},n.fields.map((function(e){return g(e)})),he.createElement(s,{item:!0,xs:12},he.createElement(t,{type:"submit",variant:"contained"},a)))},Dr=function(e,t,n){var r=n.from,o=n.to,a=be(),i=Me();xe((function(){a.current===r&&t===o&&i(e),a.current=t}),[t])},Fr=function(e){var t=e.model,n=e.modelName,r=e.basePath,o=void 0===r?"":r,a=e.submitUpdateItemRequest,i=e.updateItemRequest,l=e.updateItem,c=e.onSubmitUpdateItem,u=e.onRequestUpdateItem,s=De().id,d=void 0===s?"":s,m=i.loading||a.loading;return xe((function(){u(d)}),[d]),zt({title:"Item updated",message:"The item ".concat(d," has been updated successfully"),severity:"success"},!!a.success,{from:!1,to:!0}),Dr("".concat(o,"/"),!!a.success,{from:!1,to:!0}),zt({title:"We had an error",message:a.error||"",severity:"error"},!!a.error,{from:!1,to:!0}),he.createElement(Tr,{loading:m},he.createElement(Mt,{title:"Edit ".concat(d),preset:"default",breadcrumbs:[{id:"list",text:n,link:"".concat(o,"/")},{id:"update",text:"Edit ".concat(d),link:"".concat(o,"/").concat(d,"/update")}]}),he.createElement(_t,null,he.createElement(Mr,{model:t,initialValues:l,saveButtonText:"Save",onSubmit:c})))},Vr=function(e){var t=e.columns,n=e.options,r=e.data,o=e.onClick,a=e.search,i=e.defaultSort,c=e.defaultOrder,u=e.loading,s=ut(ut([],t,!0),[{id:"__options",label:"",disablePadding:!1,numeric:!1,sort:!1}],!1),d=he.useState(null),m=d[0],f=d[1];return he.createElement(he.Fragment,null,he.createElement(pr,{columns:s,data:r,search:a,defaultSort:i,defaultOrder:c,loading:u},(function(e){return e.map((function(e,t){return he.createElement(ee,{key:e.id,onClick:function(){return o&&o(e)},role:"row","aria-rowindex":t,sx:{cursor:o&&"pointer"}},s.map((function(n,r){var o=n.id;return he.createElement(te,{role:"cell",scope:"row",key:o.toString(),"aria-rowindex":t,"aria-colindex":r},e[o])})),n&&he.createElement(te,null,he.createElement(l,{"data-testid":"options-".concat(e.id),onClick:function(t){t.stopPropagation(),f({item:e,anchor:t.currentTarget})}},he.createElement(Qe,null))))}))})),n&&he.createElement(ve,{anchorEl:null==m?void 0:m.anchor,open:!!m,onClose:function(){return f(null)},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"}},n.map((function(e){var t=e.id,n=e.label,r=e.onClick;return he.createElement(pe,{key:t,onClick:function(){m&&r(null==m?void 0:m.item),f(null)}},n)}))))},_r=function(e){var t=e.model,n=e.modelName,r=e.listData,o=e.listRequest,a=e.deleteRequest,i=e.basePath,l=void 0===i?"":i,c=e.deleteFeature,u=void 0===c||c,s=e.updateFeature,d=void 0===s||s,m=e.addFeature,f=void 0===m||m,p=e.detailsFeature,v=void 0===p||p,y=e.onRequestList,h=e.onClickDeleteItem,g=Me();xe((function(){y()}),[]),zt({title:"Item deleted",message:"The item has been deleted successfully",severity:"success"},!!a.success,{from:!1,to:!0}),zt({title:"We had an error",message:a.error||"",severity:"error"},!!a.error,{from:!1,to:!0});var E=v?function(e){g("".concat(l,"/").concat(e.id))}:void 0,b=function(e,t){"edit"===e?g("".concat(l,"/").concat(t.id,"/update")):h(t)},x=[];d&&x.push({id:"edit",label:"Edit",onClick:function(e){return b("edit",e)}}),u&&x.push({id:"remove",label:"Remove",onClick:function(e){return b("remove",e)}});var S=[];return f&&S.push({id:"add",text:"Add",href:"".concat(l,"/add")}),he.createElement(Tr,{loading:o.loading||a.loading},he.createElement(Mt,{title:n,preset:"default",actions:S.length>0?S:void 0}),he.createElement(_t,null,he.createElement(Vr,{columns:t.fields.filter((function(e){return e.listable})).map((function(e){return{disablePadding:!1,id:e.id,label:e.name,numeric:"number"===e.type,sort:!1}})),data:r,defaultSort:t.fields[0].id,onClick:E,options:x.length>0?x:void 0})))},qr=function(e){var t=e.model,n=e.modelName,r=e.basePath,o=void 0===r?"":r,a=e.onSubmitNewItem,i=e.newItemRequest;return zt({message:"Item added successfully",severity:"success"},!!i.success,{from:!1,to:!0}),Dr("".concat(o,"/"),!!i.success,{from:!1,to:!0}),zt({title:"We had an error",message:i.error||"",severity:"error"},!!i.error,{from:!1,to:!0}),he.createElement(Tr,{loading:i.loading},he.createElement(Mt,{title:"Add ".concat(n),preset:"default",breadcrumbs:[{id:"list",text:n,link:"".concat(o,"/")},{id:"add",text:"Add new ".concat(n),link:"".concat(o,"/add")}]}),he.createElement(_t,null,he.createElement(Mr,{model:t,saveButtonText:"Save",onSubmit:a})))},Lr=function(e){var t=e.model,n=e.modelName,r=e.basePath,o=void 0===r?"":r,a=e.onRequestItem,i=e.itemRequest,l=e.detailsItem,c=De().id,u=void 0===c?"":c;return xe((function(){a(u)}),[u]),he.createElement(Tr,{loading:i.loading},he.createElement(Mt,{title:u,preset:"default",breadcrumbs:[{id:"list",text:n,link:"".concat(o,"/")},{id:"detail",text:u,link:"".concat(o,"/").concat(u)}]}),he.createElement(_t,null,l&&he.createElement(Rr,{model:t,instance:l})))},Br=function(e){var t=e.updateFeature,n=void 0===t||t,r=e.addFeature,o=void 0===r||r,a=e.detailsFeature,i=void 0===a||a;return he.createElement(Fe,null,he.createElement(Ve,{path:"",element:he.createElement(_r,lt({},e))}),i&&he.createElement(Ve,{path:":id",element:he.createElement(Lr,lt({},e))}),o&&he.createElement(Ve,{path:"add",element:he.createElement(qr,lt({},e))}),n&&he.createElement(Ve,{path:":id/update",element:he.createElement(Fr,lt({},e))}))},Hr={idle:!0},Ur={loading:!0},Yr={success:!0};export{cr as Autocomplete,Vt as Board,Cr as BootstrapDialog,wt as Bullet,qt as CenterContainer,kr as ConfirmDialog,_t as Content,br as ContentPlaceholder,tt as DefaultPlaceholder,Zt as Drawer,vn as DrawerAppBar,mn as DrawerContent,Lt as DrawerContext,Jt as DrawerHeader,$r as DrawerLayout,gn as DrawerMain,nn as DrawerProvider,dn as DrawerSection,rn as DrawerSubheader,yr as EnhancedRemoteTable,pr as EnhancedTable,mr as EnhancedTableHead,wr as ExpandableAlert,Or as FormDialog,mt as GroupValueCard,Mt as Header,Tr as HeaderLayout,Hr as IdleRequest,kt as Label,bt as LoadingArea,Ur as LoadingRequest,xr as LoremIpsumPlaceholder,Ft as Markdown,Mr as ModelForm,Br as ModelRouter,Tt as NotificationCenterContext,jt as NotificationCenterProvider,$t as NotificationCenterProviderUndefinedError,Rr as ObjectDetails,hr as Placeholder,xt as QueryContainer,bn as Select,xn as SignIn,gr as SkeletonCard,Er as SkeletonGrid,Yr as SuccessRequest,dr as TabCard,Rt as TabContext,Nt as TabContextProvider,ur as TabPanel,At as TabProvider,Vr as TableList,Bt as UndefinedProvider,it as ValueBoolean,at as ValueCard,st as ValueDatetime,Ze as ValueEditButtons,Et as ValueItem,ft as ValueRating,ot as ValueText,St as bulletClasses,on as getDrawerItemColors,ht as getFormData,vt as getRandomItem,Ct as labelClasses,Dt as markdownDefaultOptions,pt as newArrayWithSize,yt as newBreakpointsCounter,Ar as newInstanceFromValuesOrZeroValue,Ir as useDialog,Ht as useDrawer,et as useEditableValueDisplay,dt as useGetDefaultThemeColor,Pt as useNotificationCenter,zt as useNotifyWhenValueChanges,Wt as useTab,gt as valueItemClasses};
|
|
23
|
+
*/Qn={exports:{}},"production"===process.env.NODE_ENV?Qn.exports=function(){if(Xn)return Gn;Xn=1;var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen");function v(e){if("object"==typeof e&&null!==e){var p=e.$$typeof;switch(p){case t:switch(e=e.type){case r:case a:case o:case s:case d:return e;default:switch(e=e&&e.$$typeof){case c:case l:case u:case f:case m:case i:return e;default:return p}}case n:return p}}}return e=Symbol.for("react.module.reference"),Gn.ContextConsumer=l,Gn.ContextProvider=i,Gn.Element=t,Gn.ForwardRef=u,Gn.Fragment=r,Gn.Lazy=f,Gn.Memo=m,Gn.Portal=n,Gn.Profiler=a,Gn.StrictMode=o,Gn.Suspense=s,Gn.SuspenseList=d,Gn.isAsyncMode=function(){return!1},Gn.isConcurrentMode=function(){return!1},Gn.isContextConsumer=function(e){return v(e)===l},Gn.isContextProvider=function(e){return v(e)===i},Gn.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Gn.isForwardRef=function(e){return v(e)===u},Gn.isFragment=function(e){return v(e)===r},Gn.isLazy=function(e){return v(e)===f},Gn.isMemo=function(e){return v(e)===m},Gn.isPortal=function(e){return v(e)===n},Gn.isProfiler=function(e){return v(e)===a},Gn.isStrictMode=function(e){return v(e)===o},Gn.isSuspense=function(e){return v(e)===s},Gn.isSuspenseList=function(e){return v(e)===d},Gn.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===r||t===a||t===o||t===s||t===d||t===p||"object"==typeof t&&null!==t&&(t.$$typeof===f||t.$$typeof===m||t.$$typeof===i||t.$$typeof===l||t.$$typeof===u||t.$$typeof===e||void 0!==t.getModuleId)},Gn.typeOf=v,Gn}():Qn.exports=(Kn||(Kn=1,"production"!==process.env.NODE_ENV&&function(){var e,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen");function v(e){if("object"==typeof e&&null!==e){var p=e.$$typeof;switch(p){case t:var v=e.type;switch(v){case r:case a:case o:case s:case d:return v;default:var y=v&&v.$$typeof;switch(y){case c:case l:case u:case f:case m:case i:return y;default:return p}}case n:return p}}}e=Symbol.for("react.module.reference");var y=l,h=i,g=t,E=u,b=r,x=f,w=m,S=n,C=a,k=o,O=s,I=d,$=!1,T=!1;Zn.ContextConsumer=y,Zn.ContextProvider=h,Zn.Element=g,Zn.ForwardRef=E,Zn.Fragment=b,Zn.Lazy=x,Zn.Memo=w,Zn.Portal=S,Zn.Profiler=C,Zn.StrictMode=k,Zn.Suspense=O,Zn.SuspenseList=I,Zn.isAsyncMode=function(e){return $||($=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},Zn.isConcurrentMode=function(e){return T||(T=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!1},Zn.isContextConsumer=function(e){return v(e)===l},Zn.isContextProvider=function(e){return v(e)===i},Zn.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Zn.isForwardRef=function(e){return v(e)===u},Zn.isFragment=function(e){return v(e)===r},Zn.isLazy=function(e){return v(e)===f},Zn.isMemo=function(e){return v(e)===m},Zn.isPortal=function(e){return v(e)===n},Zn.isProfiler=function(e){return v(e)===a},Zn.isStrictMode=function(e){return v(e)===o},Zn.isSuspense=function(e){return v(e)===s},Zn.isSuspenseList=function(e){return v(e)===d},Zn.isValidElementType=function(t){return"string"==typeof t||"function"==typeof t||t===r||t===a||t===o||t===s||t===d||t===p||"object"==typeof t&&null!==t&&(t.$$typeof===f||t.$$typeof===m||t.$$typeof===i||t.$$typeof===l||t.$$typeof===u||t.$$typeof===e||void 0!==t.getModuleId)},Zn.typeOf=v}()),Zn),"undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),kn.exports.oneOfType([kn.exports.func,kn.exports.object]);let er=0;const tr=ye.useId;function nr(e){if(void 0!==tr){const t=tr();return null!=e?e:t}return function(e){const[t,n]=ye.useState(e),r=e||t;return ye.useEffect((()=>{null==t&&(er+=1,n(`mui-${er}`))}),[t]),r}(e)}const rr={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};const or=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function ar(e,t,n,r){const o=e[t];if(null==o||!or(o)){const e=function(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":Number.isFinite(e)?e!==Math.floor(e)?"float":"number":"Infinity";case"object":return null===e?"null":e.constructor.name;default:return t}}(o);return new RangeError(`Invalid ${r} \`${t}\` of type \`${e}\` supplied to \`${n}\`, expected \`integer\`.`)}return null}function ir(e,t,...n){return void 0===e[t]?null:ar(e,t,...n)}function lr(){return null}ir.isRequired=ar,lr.isRequired=lr,process.env.NODE_ENV;var cr=function(t){var n,r=t.id,o=t.label,a=t.InputLabelProps,i=t.InputProps,l=t.fetching,c=t.loading,u=t.helperText,s=t.hexColor,d=t.size,f=t.fullWidth,p=t.sx,v=ut(t,["id","label","InputLabelProps","InputProps","fetching","loading","helperText","hexColor","size","fullWidth","sx"]),y=nr(r),h=u&&y?"".concat(y,"-helper-text"):void 0,g=o&&y?"".concat(y,"-label"):void 0,E=s?((n={})["& .".concat(L.notchedOutline)]={borderColor:"".concat(s," !important")},n["& .".concat(B.root)]={color:s},n["& .".concat(L.input)]={color:s},n["& .".concat(H.root)]={color:s},n["& .".concat(U.bar)]={backgroundColor:s},n["& .".concat(Y.endAdornment," .").concat(J.root)]={color:s},n):{};return he.createElement(D,{sx:E,fullWidth:f},he.createElement(F,ct({size:"small"===d?"small":"normal",id:g,htmlFor:y},a),o),he.createElement(X,ct({},i,{id:y,label:o,size:d,fullWidth:f,endAdornment:he.createElement(e,{position:"end"},null==i?void 0:i.endAdornment,l?he.createElement(m,{color:"inherit",size:20,sx:{ml:1}}):null),sx:p},v)),c&&he.createElement(_,{color:"inherit",sx:{position:"absolute",left:0,right:0,bottom:0}}),u&&he.createElement(G,{id:h},u))},ur=function(e){var t=e.label,n=e.loading,r=e.fetching,o=e.options,a=e.helperText,i=e.color,l=e.onChangeValue,c=void 0===l?function(){return null}:l,u=e.sx,s=ut(e,["label","loading","fetching","options","helperText","color","onChangeValue","sx"]),d=n||r;return he.createElement(K,ct({loading:d,options:r?[]:o,onChange:function(e,t){return c(t)}},s,{renderInput:function(e){return he.createElement(cr,ct({},e,{label:t,fullWidth:!0,fetching:r,loading:n,hexColor:i,helperText:a}))},sx:u}))};function sr(e){var t=e.children,n=e.index,o=At()[0],a=o===n;return Array.isArray(n)&&(a=n.includes(o)),he.createElement("div",{role:"tabpanel",hidden:!a,id:"simple-tabpanel-".concat(n),"aria-labelledby":"simple-tab-".concat(n)},a&&he.createElement(r,{sx:{p:3}},t))}var dr=w(b)((function(e){var t,n=e.theme;return(t={})["&.".concat(Q.root)]={backgroundColor:n.palette.grey[100]},t})),mr=function(e){var t=e.children,n=e.tabs,r=At(),o=r[0],a=r[1];return he.createElement(c,null,he.createElement(dr,{value:o,onChange:function(e,t){return a(t)}},n.map((function(e){return he.createElement(x,{key:e,label:e})}))),t)},fr=function(e){var t=e.order,n=e.orderBy,o=e.headCells,a=e.onRequestSort;return he.createElement(Z,null,he.createElement(ee,null,o.map((function(e){return he.createElement(te,{variant:"head",key:String(e.id),padding:e.disablePadding?"none":"normal",sortDirection:n===e.id&&t,sx:{fontWeight:"bold"}},e.sort?he.createElement(ne,{active:n===e.id,direction:n===e.id?t:"asc",onClick:(o=e.id,function(){a(o)})},e.label,n===e.id?he.createElement(r,{component:"span",sx:rr},"desc"===t?"sorted descending":"sorted ascending"):null):e.label);var o}))))};function pr(e,t,n){return t[n]<e[n]?-1:t[n]>e[n]?1:0}var vr=function(t){var n=t.children,o=t.data,a=t.search,l=t.columns,c=t.defaultSort,u=t.defaultOrder,s=void 0===u?"asc":u,d=t.loading,f=void 0!==d&&d,p=ge(""),v=p[0],y=p[1],h=ge(s),g=h[0],E=h[1],b=ge(c),x=b[0],w=b[1],S=o.slice().filter(function(e,t){return function(n){return!t||e.some((function(e){var r=n[e.id];return(null==r?void 0:r.toLowerCase)&&(r=r.toLowerCase()),null==r?void 0:r.toString().includes(t.toLowerCase())}))}}(l,v)).sort(function(e,t){return"desc"===e?function(e,n){return pr(e,n,t)}:function(e,n){return-pr(e,n,t)}}(g,x));return he.createElement(he.Fragment,null,he.createElement(r,{sx:{paddingX:1,paddingBottom:2}},a&&he.createElement(r,{paddingY:2},he.createElement(i,{fullWidth:!0,placeholder:"Search",InputProps:{role:"search",startAdornment:he.createElement(e,{position:"start"},he.createElement(Je,null))},onChange:function(e){return y(e.target.value)}})),he.createElement(re,null,he.createElement(oe,null,he.createElement(fr,{order:g,orderBy:x,headCells:l,onRequestSort:function(e){E(x===e&&"asc"===g?"desc":"asc"),w(e)}}),he.createElement(ae,null,f?he.createElement(ee,null,he.createElement(te,{colSpan:l.length,sx:{textAlign:"center"}},he.createElement(m,null))):0===S.length?he.createElement(ee,null,he.createElement(te,{colSpan:l.length,sx:{textAlign:"center"}},"No data")):n(S))))))};vr.defaultProps={defaultOrder:"asc"};var yr,hr=function(e){var t=e.children,n=e.data,r=e.loading,o=e.columns,a=e.defaultSort,i=e.defaultOrder,l=e.onRequestSort,c=ge({orderBy:a,order:i||"asc"}),u=c[0],s=c[1];return he.createElement(he.Fragment,null,he.createElement(re,null,he.createElement(oe,null,he.createElement(fr,{order:u.order,orderBy:u.orderBy,headCells:o,onRequestSort:function(e){s((function(t){var n=t.orderBy,r=t.order,o=n===e&&"asc"===r?"desc":"asc";return l(e,o),{orderBy:e,order:o}}))}}),he.createElement(ae,null,r?he.createElement(ee,null,he.createElement(te,{colSpan:o.length,sx:{textAlign:"center"}},he.createElement(m,null))):n.map((function(e,n){return t(e,n)}))))))},gr=function(e){var n=e.title,a=e.subtitle,i=e.icon,l=e.iconSize,c=void 0===l?200:l,u=e.actions;return he.createElement(r,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center"},i&&i({size:c,color:"primary"}),he.createElement(o,{variant:"h4",role:"heading","aria-level":1},n),he.createElement(o,{variant:"subtitle1",role:"heading","aria-level":2,sx:{mt:2}},a),u&&he.createElement(r,{sx:{pt:2}},u.map((function(e,n){var r=e.id,o=e.text,a=e.href,i=e.onClick;return he.createElement(t,{key:r,role:"button",variant:"contained",href:a,onClick:i,sx:{mr:n<u.length-1?2:0}},o)}))))},Er=function(e){var t=e.width,n=void 0===t?"100%":t,o=e.animation,a=void 0!==o&&o;return he.createElement(r,{width:n},he.createElement(ie,{animation:a,variant:"rectangular",height:118}),he.createElement(ie,{animation:a,variant:"rectangular",height:16,sx:{my:1}}),he.createElement(ie,{animation:a,variant:"rectangular",width:"80%",height:16}))},br=function(e){var t=e.size,n=void 0===t?20:t;return he.createElement(s,{container:!0,spacing:2},vt(n,0).map((function(e,t){return he.createElement(s,{item:!0,key:t,xs:4},he.createElement(Er,{width:1}))})))},xr=function(e){var t=e.size,n=void 0===t?20:t,r=e.children,o=e.p;return he.createElement(g,{component:"main",sx:{p:o},"data-testid":"content-placeholder-test"},r,he.createElement(br,{size:n}))},wr=function(e){var t=e.count,n=void 0===t?3:t,r=e.units,a=void 0===r?"paragraph":r,i=e.variant,l=void 0===i?"body1":i;return he.createElement(o,{variant:l},Xe({count:n,units:a}))},Sr=((yr={})["& .".concat(le.message)]={width:1},yr),Cr=Ee((function(e,t){var n=e.severity,o=e.iconMapping,a=e.title,i=e.message,c=e.metadata,u=e.onClose,s=ge(!1),d=s[0],m=s[1];return he.createElement(f,{ref:t,severity:n,iconMapping:o,onClose:u,action:he.createElement(r,{display:"flex",flexDirection:"column"},he.createElement(l,{color:"inherit",onClick:u},he.createElement(Te,{fontSize:"small"})),c&&he.createElement(l,{color:"inherit",onClick:function(){return m((function(e){return!e}))}},d?he.createElement(Ge,{fontSize:"small"}):he.createElement(Be,{fontSize:"small"}))),sx:Sr},he.createElement(r,{sx:{w:1}},a&&he.createElement(p,null,a),i,c&&he.createElement(z,{in:d,sx:{mt:2}},he.createElement(_t,{content:c}))))})),kr=function(e){var n=e.open,o=e.title,a=e.component,i=e.componentProps,c=void 0===i?{}:i,u=e.disabled,s=e.actions,d=void 0===s?[]:s,f=e.children,p=e.loading,v=e.cancelable,y=e.callCloseWhenCancel,h=void 0===y||y,g=e.acceptable,E=e.acceptText,b=void 0===E?"Accept":E,x=e.cancelText,w=void 0===x?"Cancel":x,S=e.onAccept,C=e.onCancel,k=void 0===C?function(){return null}:C,O=e.onClose,I=e.acceptType,$=void 0===I?"button":I,T=d.length>0||g||v;return he.createElement(ce,{open:n,onClose:O},he.createElement(ue,{sx:{display:"flex",alignItems:"center"}},o,p&&!g&&he.createElement(m,{size:20,sx:{ml:2,color:function(e){return e.palette.grey[500]}}}),he.createElement(l,{disabled:u,"aria-label":"close",onClick:O,sx:{position:"absolute",right:8,top:8,color:function(e){return e.palette.grey[500]}}},he.createElement(Te,null))),he.createElement(r,ct({component:a},c),he.createElement(se,{dividers:!0},f),T&&he.createElement(de,null,d.map((function(e){var n=e.id,r=e.text,o=e.type,a=void 0===o?"button":o,i=e.onClick,l=e.color,c=void 0===l?"primary":l;return he.createElement(t,{key:n,type:a,disabled:u,onClick:i,color:c},r)})),v&&he.createElement(t,{color:"error",disabled:u,onClick:function(){k(),h&&O()}},w),g&&he.createElement(Ye,{type:$,loading:p,disabled:u,onClick:S},b))))},Or=function(e){var t=e.open,n=e.title,r=e.loading,o=e.disabled,a=e.confirmText,i=void 0===a?"Confirm":a,l=e.cancelText,c=void 0===l?"Cancel":l,u=e.children,s=e.onConfirm,d=e.onCancel;return he.createElement(kr,{title:n,loading:r,disabled:r||o,open:t,onClose:d,acceptable:!0,cancelable:!0,callCloseWhenCancel:!1,acceptText:i,cancelText:c,onCancel:d,onAccept:s},u)},Ir=function(e){var t=e.open,n=e.title,r=e.loading,o=e.disabled,a=e.submitText,i=void 0===a?"Submit":a,l=e.cancelText,c=void 0===l?"Cancel":l,u=e.children,s=e.onSubmit,d=e.onCancel;return he.createElement(kr,{component:"form",componentProps:{onSubmit:function(e){e.preventDefault(),s(gt(e))}},title:n,loading:r,disabled:r||o,open:t,onClose:d,callCloseWhenCancel:!1,cancelable:!0,acceptable:!0,cancelText:c,onCancel:d,acceptText:i,acceptType:"submit"},u)},$r=function(e){void 0===e&&(e=!1);var t=ge(e),n=t[0],r=t[1];return{isOpen:n,open:function(){return r(!0)},close:function(){return r(!1)},setIsOpen:r}},Tr=function(e){var t=e.drawerProviderProps,n=e.children,r=n[0],o=n[1],a=n[2];return he.createElement(rn,ct({},t),r,o,he.createElement(En,null,a))},Pr=function(){return he.createElement(Ke,{color:"error",sx:{width:200,height:200}})},jr=function(e){var t=e.loading,n=e.children,o=e.fetching,a=e.error,i=n[0],l=n[1];return he.createElement(Mt,null,he.createElement(r,{display:"flex",flexDirection:"column",height:1},i,o&&he.createElement(r,{width:1},he.createElement(_,null)),t&&he.createElement(xt,null),a&&he.createElement(r,{mt:4},he.createElement(gr,{icon:a.icon||Pr,title:a.title||"There has been an error",subtitle:a.message})),!t&&!a&&l))},zr=function(e,t,n){var r=(void 0===n?{}:n).dense,o=e.id,a=e.name,i=e.type,l=t[o];return"boolean"===i?he.createElement(lt,{dense:r,label:a,value:l}):"date"===i||"time"===i||"datetime"===i?he.createElement(dt,{dense:r,label:a,value:l,format:e.format}):"object"!=typeof l||Array.isArray(l)?he.createElement(at,{dense:r,label:a,value:null==l?void 0:l.toString()}):he.createElement(at,{dense:r,label:a,value:JSON.stringify(l)})},Rr=function(e){var t=e.field,n=t.name,r=t.description,o=t.value,a=e.instance,i=e.dense,l=[{field:"id",headerName:"ID",width:70}];o.forEach((function(e){l.push({field:e.id,headerName:e.name})}));var c=a.map((function(e,t){return ct({id:t},e)}));return he.createElement(ft,{title:n,subtitle:r,dense:i},he.createElement(s,{item:!0,xs:12},he.createElement(Qe,{rows:c,columns:l,density:i?"compact":"standard",disableRowSelectionOnClick:!0,pageSizeOptions:[5],initialState:{pagination:{paginationModel:{pageSize:5}}},sx:{height:400}})))},Nr=function(e){var t=e.field,n=t.name,r=t.description,o=t.value,a=e.instance,i=e.dense,l=ht();return he.createElement(ft,{title:n,subtitle:r,dense:i},o.map((function(e){var t=e.id,n=e.xs,r=e.sm,o=e.md,c=e.lg,u=e.xl,s=l.increment(e);return he.createElement(bt,{key:t,xs:n,sm:r,md:o,lg:c,xl:u,bordered:s},zr(e,a,{dense:i}))})))},Wr=function(e){var t=e.model,n=e.instance,r=e.dense,o=ht();return he.createElement(s,{container:!0,spacing:r?1:2},t.fields.map((function(e){var t=e.id,a=e.type,i=e.xs,l=void 0===i?3:i,c=e.sm,u=void 0===c?0:c,d=e.md,m=void 0===d?0:d,f=e.lg,p=void 0===f?0:f,v=e.xl,y=void 0===v?0:v;if("group"===a)return o.increment({xs:12}),he.createElement(s,{item:!0,key:t,xs:12},he.createElement(Nr,{field:e,instance:n[t],dense:r}));if("group[]"===a)return o.increment({xs:12}),he.createElement(s,{item:!0,key:t,xs:12},he.createElement(Rr,{field:e,instance:n[t],dense:r}));var h=o.increment(e);return he.createElement(bt,{key:t,xs:l,sm:u,md:m,lg:p,xl:y,bordered:h},zr(e,n,{dense:r}))})))},Ar={string:"",number:0,boolean:!1,enum:"",multienum:[],date:new Date(1970,0,1,0,0),time:new Date(1970,0,1,0,0),datetime:new Date(1970,0,1,0,0),group:{},"group[]":[],"string[]":[],"number[]":[]},Mr=function(e,t){return t&&t[e.id]||"default"in e&&e.default||Ar[e.type]},Dr=function(e,t){void 0===t&&(t=void 0);var n={};return e.fields.forEach((function(e){if("group"===e.type){var r={};e.value.forEach((function(n){r[n.id]=Mr(n,t&&t[e.id])})),n[e.id]=r}else n[e.id]=Mr(e,t)})),n},Fr=function(e){var n=e.model,a=e.saveButtonText,l=e.onSubmit,u=e.initialValues,d=ke((function(){return Dr(n,u)}),[n,u]),m=ge(d),f=m[0],p=m[1],v=function(e,t,n){p((function(r){var o,a={};return t?a[t]=ct(ct({},r[t]),((o={})[e]=n,o)):a[e]=n,ct(ct({},r),a)}))},y=function(e,t,n){e.preventDefault();var r=e.target.value;"number"===n&&"string"==typeof r?r=parseInt(e.target.value,10):n.includes("[]")&&(r=e.target.value.split(",")),v(e.target.name,t,r)},h=function(e,t,n){v(n,t,e)},g=function(e,t){void 0===t&&(t=void 0);var n,a=mt({lightWeight:200,darkWeight:800}),l=e.id,u=e.type,d=e.name,m=e.description,p=e.xs,E=e.sm,b=e.md,x=e.lg,w=e.xl,S=t?f[t][l]:f[l];if("group"===u)n=he.createElement(c,null,he.createElement(r,{bgcolor:a,px:2,py:1,mb:2},he.createElement(o,{variant:"h6",role:"heading","aria-level":1},d),he.createElement(o,{variant:"body2",role:"heading","aria-level":2},m)),he.createElement(s,{container:!0,spacing:2,sx:{p:2}},e.value.map((function(e){return g(e,l)}))));else if("boolean"===u)n=he.createElement(r,{sx:{height:1,display:"flex",alignItems:"center"}},he.createElement(me,{control:he.createElement(fe,{name:l,onChange:function(e){return function(e,t){e.preventDefault(),v(e.target.name,t,e.target.checked)}(e,t)},checked:S}),label:d}));else if("enum"===u)n=he.createElement(D,{fullWidth:!0},he.createElement(F,{id:"".concat(l,"-select-label")},d),he.createElement(V,{labelId:"".concat(l,"-select-label"),id:"".concat(l,"-select"),value:S,label:d,name:l,onChange:function(e){return function(e,t){e.preventDefault(),v(e.target.name,t,e.target.value)}(e,t)},required:!0},e.value.map((function(e){return he.createElement(pe,{key:e,value:e},e)}))));else if("multienum"===u)n=he.createElement(D,{fullWidth:!0},he.createElement(F,{id:"".concat(l,"-select-label")},d),he.createElement(V,{labelId:"".concat(l,"-select-label"),id:"".concat(l,"-select"),value:S||[],renderValue:function(e){return e.join(", ")},label:d,name:l,onChange:function(e){return function(e,t){e.preventDefault();var n=e.target.value,r="string"==typeof n?n.split(","):n;v(e.target.name,t,r)}(e,t)},required:!0,multiple:!0},e.value.map((function(e){return he.createElement(pe,{key:e,value:e},he.createElement(fe,{checked:(S||[]).includes(e)}),he.createElement(j,{primary:e}))}))));else if("date"===u)n=he.createElement(Ne,{label:d,format:e.format,value:S,onChange:function(e){return h(e,t,l)}});else if("time"===u)n=he.createElement(ze,{label:d,format:e.format,value:S,onChange:function(e){return h(e,t,l)}});else if("datetime"===u)n=he.createElement(je,{label:d,format:e.format,value:S,onChange:function(e){return h(e,t,l)}});else{if("group[]"===u)return null;n=u.includes("[]")?he.createElement(i,{required:!0,type:"text",label:d,name:l,variant:"outlined",helperText:"Use comas to separate multiple values",fullWidth:!0,value:S.join(","),onChange:function(e){return y(e,t,u)}}):he.createElement(i,{required:!0,type:u,label:d,name:l,variant:"outlined",fullWidth:!0,value:S,onChange:function(e){return y(e,t,u)}})}return he.createElement(s,{item:!0,key:l,xs:p,sm:E,md:b,lg:x,xl:w},n)};return he.createElement(s,{container:!0,component:"form",spacing:2,onSubmit:function(e){e.preventDefault(),l(f)}},n.fields.map((function(e){return g(e)})),he.createElement(s,{item:!0,xs:12},he.createElement(t,{type:"submit",variant:"contained"},a)))},Vr=function(e,t,n){var r=n.from,o=n.to,a=be(),i=Me();xe((function(){a.current===r&&t===o&&i(e),a.current=t}),[t])},_r=function(e){var t=e.model,n=e.modelName,r=e.basePath,o=void 0===r?"":r,a=e.submitUpdateItemRequest,i=e.updateItemRequest,l=e.updateItem,c=e.onSubmitUpdateItem,u=e.onRequestUpdateItem,s=De().id,d=void 0===s?"":s,m=i.loading||a.loading;return xe((function(){u(d)}),[d]),Rt({title:"Item updated",message:"The item ".concat(d," has been updated successfully"),severity:"success"},!!a.success,{from:!1,to:!0}),Vr("".concat(o,"/"),!!a.success,{from:!1,to:!0}),Rt({title:"We had an error",message:a.error||"",severity:"error"},!!a.error,{from:!1,to:!0}),he.createElement(jr,{loading:m},he.createElement(Dt,{title:"Edit ".concat(d),preset:"default",breadcrumbs:[{id:"list",text:n,link:"".concat(o,"/")},{id:"update",text:"Edit ".concat(d),link:"".concat(o,"/").concat(d,"/update")}]}),he.createElement(qt,null,he.createElement(Fr,{model:t,initialValues:l,saveButtonText:"Save",onSubmit:c})))},qr=function(e){var t=e.columns,n=e.options,r=e.data,o=e.onClick,a=e.search,i=e.defaultSort,c=e.defaultOrder,u=e.loading,s=st(st([],t,!0),[{id:"__options",label:"",disablePadding:!1,numeric:!1,sort:!1}],!1),d=he.useState(null),m=d[0],f=d[1];return he.createElement(he.Fragment,null,he.createElement(vr,{columns:s,data:r,search:a,defaultSort:i,defaultOrder:c,loading:u},(function(e){return e.map((function(e,t){return he.createElement(ee,{key:e.id,onClick:function(){return o&&o(e)},role:"row","aria-rowindex":t,sx:{cursor:o&&"pointer"}},s.map((function(n,r){var o=n.id;return he.createElement(te,{role:"cell",scope:"row",key:o.toString(),"aria-rowindex":t,"aria-colindex":r},e[o])})),n&&he.createElement(te,null,he.createElement(l,{"data-testid":"options-".concat(e.id),onClick:function(t){t.stopPropagation(),f({item:e,anchor:t.currentTarget})}},he.createElement(Ze,null))))}))})),n&&he.createElement(ve,{anchorEl:null==m?void 0:m.anchor,open:!!m,onClose:function(){return f(null)},anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"}},n.map((function(e){var t=e.id,n=e.label,r=e.onClick;return he.createElement(pe,{key:t,onClick:function(){m&&r(null==m?void 0:m.item),f(null)}},n)}))))},Lr=function(e){var t=e.model,n=e.modelName,r=e.listData,o=e.listRequest,a=e.deleteRequest,i=e.basePath,l=void 0===i?"":i,c=e.deleteFeature,u=void 0===c||c,s=e.updateFeature,d=void 0===s||s,m=e.addFeature,f=void 0===m||m,p=e.detailsFeature,v=void 0===p||p,y=e.onRequestList,h=e.onClickDeleteItem,g=Me();xe((function(){y()}),[]),Rt({title:"Item deleted",message:"The item has been deleted successfully",severity:"success"},!!a.success,{from:!1,to:!0}),Rt({title:"We had an error",message:a.error||"",severity:"error"},!!a.error,{from:!1,to:!0});var E=v?function(e){g("".concat(l,"/").concat(e.id))}:void 0,b=function(e,t){"edit"===e?g("".concat(l,"/").concat(t.id,"/update")):h(t)},x=[];d&&x.push({id:"edit",label:"Edit",onClick:function(e){return b("edit",e)}}),u&&x.push({id:"remove",label:"Remove",onClick:function(e){return b("remove",e)}});var w=[];return f&&w.push({id:"add",text:"Add",href:"".concat(l,"/add")}),he.createElement(jr,{loading:o.loading||a.loading},he.createElement(Dt,{title:n,preset:"default",actions:w.length>0?w:void 0}),he.createElement(qt,null,he.createElement(qr,{columns:t.fields.filter((function(e){return e.listable})).map((function(e){return{disablePadding:!1,id:e.id,label:e.name,numeric:"number"===e.type,sort:!1}})),data:r,defaultSort:t.fields[0].id,onClick:E,options:x.length>0?x:void 0})))},Br=function(e){var t=e.model,n=e.modelName,r=e.basePath,o=void 0===r?"":r,a=e.onSubmitNewItem,i=e.newItemRequest;return Rt({message:"Item added successfully",severity:"success"},!!i.success,{from:!1,to:!0}),Vr("".concat(o,"/"),!!i.success,{from:!1,to:!0}),Rt({title:"We had an error",message:i.error||"",severity:"error"},!!i.error,{from:!1,to:!0}),he.createElement(jr,{loading:i.loading},he.createElement(Dt,{title:"Add ".concat(n),preset:"default",breadcrumbs:[{id:"list",text:n,link:"".concat(o,"/")},{id:"add",text:"Add new ".concat(n),link:"".concat(o,"/add")}]}),he.createElement(qt,null,he.createElement(Fr,{model:t,saveButtonText:"Save",onSubmit:a})))},Hr=function(e){var t=e.model,n=e.modelName,r=e.basePath,o=void 0===r?"":r,a=e.onRequestItem,i=e.itemRequest,l=e.detailsItem,c=De().id,u=void 0===c?"":c;return xe((function(){a(u)}),[u]),he.createElement(jr,{loading:i.loading},he.createElement(Dt,{title:u,preset:"default",breadcrumbs:[{id:"list",text:n,link:"".concat(o,"/")},{id:"detail",text:u,link:"".concat(o,"/").concat(u)}]}),he.createElement(qt,null,l&&he.createElement(Wr,{model:t,instance:l})))},Ur=function(e){var t=e.updateFeature,n=void 0===t||t,r=e.addFeature,o=void 0===r||r,a=e.detailsFeature,i=void 0===a||a;return he.createElement(Fe,null,he.createElement(Ve,{path:"",element:he.createElement(Lr,ct({},e))}),i&&he.createElement(Ve,{path:":id",element:he.createElement(Hr,ct({},e))}),o&&he.createElement(Ve,{path:"add",element:he.createElement(Br,ct({},e))}),n&&he.createElement(Ve,{path:":id/update",element:he.createElement(_r,ct({},e))}))},Yr={idle:!0},Jr={loading:!0},Xr={success:!0};export{ur as Autocomplete,_t as Board,kr as BootstrapDialog,Ct as Bullet,Lt as CenterContainer,Or as ConfirmDialog,qt as Content,xr as ContentPlaceholder,nt as DefaultPlaceholder,en as Drawer,yn as DrawerAppBar,fn as DrawerContent,Bt as DrawerContext,Xt as DrawerHeader,Tr as DrawerLayout,En as DrawerMain,rn as DrawerProvider,mn as DrawerSection,on as DrawerSubheader,hr as EnhancedRemoteTable,vr as EnhancedTable,fr as EnhancedTableHead,Cr as ExpandableAlert,Ir as FormDialog,ft as GroupValueCard,Dt as Header,jr as HeaderLayout,Yr as IdleRequest,Ot as Label,xt as LoadingArea,Jr as LoadingRequest,wr as LoremIpsumPlaceholder,Vt as Markdown,Fr as ModelForm,Ur as ModelRouter,Pt as NotificationCenterContext,zt as NotificationCenterProvider,Tt as NotificationCenterProviderUndefinedError,Wr as ObjectDetails,gr as Placeholder,wt as QueryContainer,xn as Select,wn as SignIn,Er as SkeletonCard,br as SkeletonGrid,Xr as SuccessRequest,mr as TabCard,Nt as TabContext,Wt as TabContextProvider,sr as TabPanel,Mt as TabProvider,qr as TableList,Ht as UndefinedProvider,lt as ValueBoolean,it as ValueCard,dt as ValueDatetime,et as ValueEditButtons,bt as ValueItem,pt as ValueRating,at as ValueText,St as bulletClasses,an as getDrawerItemColors,gt as getFormData,yt as getRandomItem,kt as labelClasses,Ft as markdownDefaultOptions,vt as newArrayWithSize,ht as newBreakpointsCounter,Dr as newInstanceFromValuesOrZeroValue,$r as useDialog,Ut as useDrawer,tt as useEditableValueDisplay,mt as useGetDefaultThemeColor,jt as useNotificationCenter,Rt as useNotifyWhenValueChanges,At as useTab,Et as valueItemClasses};
|
|
24
24
|
//# sourceMappingURL=index.js.map
|