@pautena/react-design-system 0.6.1 → 0.6.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 +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/drawers/drawer-provider/drawer.provider.d.ts +2 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/drawers/drawer-provider/drawer.provider.d.ts +2 -1
- package/dist/index.d.ts +2 -1
- package/package.json +1 -1
- package/src/components/drawers/drawer-provider/drawer-provider.test.tsx +16 -1
- package/src/components/drawers/drawer-provider/drawer.provider.tsx +11 -4
|
@@ -6,5 +6,6 @@ export type DrawerProviderProps = PropsWithChildren<{
|
|
|
6
6
|
drawerWidth?: number;
|
|
7
7
|
variant?: DrawerVariant;
|
|
8
8
|
selectedItemId?: string;
|
|
9
|
+
onStateChange?: (newState: DrawerState) => void;
|
|
9
10
|
}>;
|
|
10
|
-
export declare const DrawerProvider: ({ children, initialState: initialStateProp, variant, drawerWidth: drawerWidthProp, underAppBar, selectedItemId, }: DrawerProviderProps) => JSX.Element;
|
|
11
|
+
export declare const DrawerProvider: ({ children, initialState: initialStateProp, variant, drawerWidth: drawerWidthProp, underAppBar, selectedItemId, onStateChange, }: DrawerProviderProps) => JSX.Element;
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{InputAdornment as e,Button as t,Box as n,Typography as r,Tooltip as o,TextField as a,IconButton as i,Paper as l,useTheme 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 E,Breadcrumbs as b,Tabs as g,Tab as x,styled as w,drawerClasses as S,Drawer as C,Divider as k,paperClasses as I,ListSubheader as O,List as $,ListItemButton as T,ListItemIcon as P,ListItemText as j,Collapse as z,Popover as R,ListItemAvatar as W,Avatar as N,AppBar as M,Toolbar as A,FormControl as D,InputLabel as F,Select as V,LinearProgress as _,Stack as L,outlinedInputClasses as q,inputLabelClasses as B,circularProgressClasses as U,linearProgressClasses as H,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 Ee,forwardRef as be,useRef as ge,useEffect as xe,createContext as we,useContext as Se,useId as Ce,useMemo as ke}from"react";import Ie from"@mui/icons-material/Check";import Oe 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 We}from"@mui/x-date-pickers";import{Link as Ne,useLocation as Me,useNavigate as Ae,useParams as De,Routes as Fe,Route as Ve}from"react-router-dom";import{blueGrey as _e}from"@mui/material/colors";import Le from"markdown-to-jsx";import qe from"@mui/icons-material/ChevronLeft";import Be from"@mui/icons-material/ExpandMore";import Ue from"@mui/icons-material/ChevronRight";import He 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/MoreVert";var Qe=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(Oe,null),onClick:r,sx:{paddingRight:0,minWidth:0,marginRight:1}}),he.createElement(t,{variant:"contained",size:"small",color:"primary",startIcon:he.createElement(Ie,null),onClick:o,sx:{paddingRight:0,minWidth:0}}))},Ze=function(e,t){var n=Ee(!1),r=n[0],o=n[1],a=Ee(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()}}},et="-",tt=function(e){return"label-".concat(e.replace(/ /g,"-"))},nt=function(e){var t=e.label,a=e.tooltip,i=e.tooltipEnterDelay,l=void 0===i?2e3:i,c=e.children,u=tt(t);return he.createElement(n,{width:1},he.createElement(r,{variant:"subtitle2",role:"label",id:u},t),a?he.createElement(o,{title:a,placement:"top",enterDelay:l},c):c)},rt=function(e){var t=e.label,n=e.value,o=e.placeholder,l=void 0===o?et:o,c=e.editable,u=e.onEdit,s=void 0===u?function(){return null}:u,d=Ze(null==n?void 0:n.toString(),s),m=d.isEditing,f=d.editValue,p=d.startEdit,v=d.cancelEdit,y=d.setEditValue,h=d.submitEdit,E=tt(t),b=(null==n?void 0:n.toString())||l;return he.createElement(nt,{label:t,tooltip:b},m?he.createElement(a,{value:f,size:"small",onChange:function(e){return y(e.target.value)},InputProps:{endAdornment:he.createElement(Qe,{onClickCancel:v,onSubmitEdit:h})}}):he.createElement(r,{variant:"h5",noWrap:!0,"aria-labelledby":E},b,c&&he.createElement(i,{size:"small",onClick:p,sx:{ml:1}},he.createElement($e,null))))},ot=function(e){var t=e.children;return he.createElement(l,{sx:{p:2}},t)},at=function(e){var t=e.label,o=e.value,a=e.placeholder,l=void 0===a?et:a,s=e.editable,d=e.onEdit,m=void 0===d?function(){return null}:d,f=c().typography,p=Ze(o,m),v=p.isEditing,y=p.editValue,h=p.startEdit,E=p.cancelEdit,b=p.setEditValue,g=p.submitEdit,x={fontSize:f.h5.fontSize};return he.createElement(nt,{label:t},v?he.createElement(n,{display:"flex",alignItems:"center"},he.createElement(u,{checked:y,onChange:function(e){return b(e.target.checked)}}),he.createElement(Qe,{onClickCancel:E,onSubmitEdit:g})):he.createElement(n,{display:"flex",alignItems:"center"},void 0===o?he.createElement(r,{variant:"h5"},l):o?he.createElement(Ie,{color:"success",sx:x}):he.createElement(Te,{color:"error",sx:x}),s&&he.createElement(i,{size:"small",onClick:h,sx:{ml:1}},he.createElement($e,null))))},it=function(){return it=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},it.apply(this,arguments)};function lt(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 ct(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 ut=function(e){var t=e.label,o=e.value,l=e.format,c=e.placeholder,u=void 0===c?et:c,s=e.editable,d=e.editInputType,m=void 0===d?"datetime":d,f=e.onEdit,p=Ze(o,void 0===f?function(){return null}:f),v=p.isEditing,y=p.editValue,h=p.startEdit,E=p.cancelEdit,b=p.setEditValue,g=p.submitEdit,x=tt(t),w=o&&Pe(o,l)||u,S="datetime"===m?je:"time"===m?ze:Re;return he.createElement(nt,{label:t,tooltip:w},v?he.createElement(S,{value:y,format:l,onChange:function(e){return b(e||void 0)},slots:{textField:function(e){var t;return he.createElement(a,it({},e,{InputProps:it(it({},e.InputProps),{endAdornment:he.createElement(he.Fragment,null,null===(t=e.InputProps)||void 0===t?void 0:t.endAdornment,he.createElement(Qe,{onClickCancel:E,onSubmitEdit:g,sx:{ml:2}}))})}))}}}):he.createElement(n,{display:"flex",alignItems:"center"},he.createElement(r,{variant:"h5",noWrap:!0,"aria-labelledby":x},w),s&&he.createElement(i,{size:"small",onClick:h,sx:{ml:1}},he.createElement($e,null))))},st=function(e){var t=void 0===e?{}:e,n=t.lightWeight,r=void 0===n?100:n,o=t.darkWeight,a=void 0===o?900:o,i=c().palette;return"light"===i.mode?i.grey[r]:i.grey[a]},dt={root:"RdsGroupValueItem-root"},mt=function(e){var t=e.children,r=e.bordered,o=void 0===r||r,a=lt(e,["children","bordered"]),i=st({lightWeight:200,darkWeight:800});return he.createElement(s,it({item:!0,className:dt.root},a),he.createElement(n,{px:1,sx:{borderLeft:o?"solid ".concat(i," 1px"):"none"}},t))},ft=function(e){var t=e.title,o=e.subtitle,a=e.centered,i=e.children,c=st({lightWeight:200,darkWeight:800});return he.createElement(l,{sx:{paddingBottom:1}},he.createElement(n,{bgcolor:c,px:2,py:1},he.createElement(r,{variant:"h6",role:"heading","aria-level":1},t),o&&he.createElement(r,{variant:"body2",role:"heading","aria-level":2},o)),he.createElement(s,{container:!0,padding:1,rowSpacing:2,justifyContent:a?"center":"flex-start"},i))},pt=function(e){var t=e.label,r=e.value,o=void 0===r?0:r,a=e.maxRating,l=void 0===a?5:a,c=e.editable,u=e.onEdit,s=Ze(o,void 0===u?function(){return null}:u),m=s.isEditing,f=s.editValue,p=s.startEdit,v=s.cancelEdit,y=s.setEditValue,h=s.submitEdit,E=tt(t);return he.createElement(nt,{label:t,tooltip:o.toString()},he.createElement(n,{display:"flex",alignItems:"center"},he.createElement(d,{"aria-labelledby":E,readOnly:!m,max:l,value:m?f:o,onChange:function(e,t){return y(t)}}),c&&!m&&he.createElement(i,{size:"small",onClick:p,sx:{ml:1}},he.createElement($e,null)),m&&he.createElement(Qe,{onClickCancel:v,onSubmitEdit:h})))},vt=function(){return he.createElement(n,{width:1,height:1,display:"flex",justifyContent:"center",alignItems:"center"},he.createElement(m,null))};function yt(e){var t=e.isFetching,r=e.error,o=e.success,a=e.children;return t?he.createElement(vt,null):r?he.createElement(f,{severity:"error",role:"alert","aria-describedby":"error"},r.name&&he.createElement(p,{role:"heading"},r.name),r.message):he.createElement(n,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 ht={root:"RdsBullet-root"},Et=function(e){var t=e.variant,n=void 0===t?"primary":t,r=e.sx;return he.createElement(v,{color:n,variant:"dot",className:ht.root,role:"bullet","aria-describedby":n,sx:r})},bt={root:"RdsLabel-root"},gt=function(e){var t=e.text,o=e.variant,a=void 0===o?"default":o,i=e.sx,l=c().palette,u={default:"light"===l.mode?l.grey[100]:l.grey[900],primary:l.primary.main,secondary:l.secondary.main,info:l.info.main,warning:l.warning.main,error:l.error.main},s={default:l.getContrastText(u.default),primary:l.primary.contrastText,secondary:l.secondary.contrastText,info:l.info.contrastText,warning:l.warning.contrastText,error:l.error.contrastText};return he.createElement(n,{px:1,sx:it({backgroundColor:u[a]},i),borderRadius:1,color:s[a],className:bt.root,role:"label","aria-describedby":a},he.createElement(r,{variant:"caption",fontWeight:700},t.toUpperCase()))},xt=be((function(e,t){var n=e.href,r=lt(e,["href"]);return he.createElement(Ne,it({ref:t,to:n},r))})),wt=be((function(e,t){return he.createElement(y,it({},e,{component:xt}))})),St=function(e,t){return new Array(e).fill(t)},Ct=function(e){var t=Math.floor(Math.random()*e.length);return{index:t,item:e[t]}},kt=new Error("NotificationCenterContext.Provider is required and was undefined"),It=he.createContext(void 0),Ot=function(){var e=he.useContext(It);if(void 0===e)throw kt;return e},$t=function(e){var t=e.children,n=e.autoHideDuration,r=void 0===n?6e3:n,o=Ee(void 0),a=o[0],i=o[1],l=Ee(!1),c=l[0],u=l[1],s=function(){u(!1)};return he.createElement(It.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)},Tt=function(e,t,n){var r=n.from,o=n.to,a=ge(),i=Ot().show;xe((function(){a.current===r&&t===o&&i(e),a.current=t}),[t])},Pt=we([0,function(){return null}]),jt=Pt.Provider,zt=function(){return Se(Pt)},Rt=function(e){var t=e.children,n=e.initialValue,r=Ee(void 0===n?0:n);return he.createElement(jt,{value:r},t)},Wt=function(e){var o=e.title,a=e.subtitle,i=e.preset,l=void 0===i?"default":i,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=Me(),w=c().palette,S=st(),C=zt(),k=C[0],I=C[1],O={default:S,primary:w.primary.main,secondary:w.secondary.main,inherit:"inherit",transparent:"transparent"},$=O[l],T={default:w.getContrastText(O.default),primary:w.primary.contrastText,secondary:w.secondary.contrastText,inherit:"inherit",transparent:w.text.primary}[l],P="panel"===v?k:null==f?void 0:f.findIndex((function(e){return e.href===h.pathname}));return he.createElement(n,{bgcolor:$,color:T},he.createElement(E,null,he.createElement(n,{sx:{py:3,display:"flex",flexDirection:"row",justifyContent:"space-between"}},he.createElement(n,null,y&&he.createElement(t,{href:y.href,size:"small",color:"inherit",LinkComponent:wt,startIcon:y.icon,sx:{mb:1}},y.text),(null==d?void 0:d.length)&&he.createElement(b,{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(wt,{key:t,underline:"hover",color:"inherit",href:n,variant:"body2",role:"link"},r)}))),he.createElement(r,{variant:"h4",role:"heading","aria-level":1},o),a&&he.createElement(r,{variant:"body1",role:"heading","aria-level":2},a)),m&&he.createElement(n,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?wt:"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(g,{value:P,textColor:"inherit",onChange:"panel"===v?function(e,t){return I(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,it({key:t},a)):he.createElement(x,it({key:t},a,{component:wt,href:o}))})))))},Nt={overrides:{h1:{component:r,props:{gutterBottom:!0,variant:"h5"}},h2:{component:r,props:{gutterBottom:!0,variant:"h6"}},h3:{component:r,props:{gutterBottom:!0,variant:"subtitle1"}},h4:{component:r,props:{gutterBottom:!0,variant:"caption",paragraph:!0}},p:{component:r,props:{paragraph:!0}},a:{component:y},li:{component:"li"}}},Mt=function(e){var t=e.content,n=e.options,r=void 0===n?Nt:n;return he.createElement(Le,{options:r},t)},At=function(e){var o,a,i=e.markdown,c=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=Ee("Copy"),y=v[0],h=v[1];i?o=i||"":Array.isArray(c)?(a=c.map((function(e,t){return he.createElement(r,{key:t,sx:{pb:s}},e)})),o=c.join("\n")):(a=he.createElement(r,null,c),o=c||"");var E=i&&he.createElement(Mt,{content:i});return he.createElement(l,{sx:it({p:2,backgroundColor:_e[800],color:"white"},p)},he.createElement(n,{display:"flex",flexDirection:"row"},he.createElement(n,{width:1},f||E||a),he.createElement(n,{width:100,sx:{ml:1}},o&&he.createElement(t,{fullWidth:!0,color:"inherit",size:"small",variant:"outlined",onClick:function(){navigator.clipboard.writeText(o),h("Copied!"),setTimeout((function(){return h("Copy")}),m)}},y))))},Dt=function(e){var t=e.children;return he.createElement(E,{component:"main",sx:{py:3,flexGrow:1}},t)};function Ft(e){var t=e.children,r=e.centerVertical,o=void 0===r||r,a=e.centerHorizontal,i=void 0===a||a,l=e.sx;return he.createElement(n,{width:1,height:1,sx:it(it({},l),{display:"flex",flexDirection:"column",justifyContent:o?"center":"flex-start",alignItems:i?"center":"flex-start"})},t)}var Vt=we(void 0),_t=new Error("DrawerContext.Provider is required and was undefined"),Lt=function(){var e=Se(Vt);if(void 0===e)throw _t;return e},qt=function(e){return{width:240,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:"hidden"}},Bt=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},Ut=w("div")((function(e){var t=e.theme;return it({display:"flex",alignItems:"center",justifyContent:"flex-end",padding:t.spacing(0,1)},t.mixins.toolbar)})),Ht={temporary:!0,mini:!0,persistent:!0,clipped:!1},Yt={temporary:"temporary",mini:"permanent",clipped:"permanent",persistent:"persistent"},Jt=function(){return{}},Xt={mini:function(e,t){var n;return(n={boxSizing:"border-box"})["& .".concat(I.root)]={zIndex:t.zIndex.drawer-1},n},temporary:Jt,clipped:Jt,persistent:Jt},Gt=function(e){var t,n,r=e.children,o=lt(e,["children"]),a=c(),l=Lt(),u=l.state,s=l.switchState,d=l.underAppBar,m=l.close,f=l.drawerWidth,p=l.variant,v=it(it(it({width:f,flexShrink:0,whiteSpace:"nowrap"},"open"===u&&it(it({},qt(a)),((t={})["& .".concat(S.paper)]=qt(a),t))),"open"!==u&&it(it({},Bt(a)),((n={})["& .".concat(S.paper)]=Bt(a),n))),Xt[p](u,a));return he.createElement(C,it({open:"open"===u,variant:Yt[p],role:"menu","aria-hidden":"close"===u,onClose:m,sx:v},o),he.createElement(Ut,null,!d&&Ht[p]&&he.createElement(i,{onClick:s},he.createElement(qe,null))),he.createElement(k,null),r)},Kt={temporary:"close",mini:"collapse",clipped:"open",persistent:"close"},Qt={temporary:["close","open"],mini:["collapse","open"],clipped:["open","open"],persistent:["close","open"]},Zt=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=Ee(n||Kt[o]),d=s[0],m=s[1];return he.createElement(Vt.Provider,{value:{state:d,variant:o,selectedItemId:u,underAppBar:c,drawerWidth:i,switchState:function(){return m((function(e){return Qt[o]["open"===e?0:1]}))},collapse:function(){return m("collapse")},close:function(){return m("close")},open:function(){return m("open")},setState:m}},t)},en=w(O,{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}})),tn=function(e,t){return{color:t?e.palette.primary.main:void 0,fontWeight:t?e.typography.fontWeightBold:e.typography.fontWeightMedium}},nn=function(e){var t=e.text,n=e.icon,r=e.selected,o=e.items,a=e.size,i=void 0===a?"medium":a,l=e.level,u=e.sx,s=void 0===u?{}:u,d=Lt().state,m=ge(null),f=c(),p=f.palette,v=f.spacing,y=Ee(!1),h=y[0],E=y[1],b=tn(c(),r),g=b.color,x=b.fontWeight,w=he.createElement($,{component:"div",disablePadding:!0},o.map((function(e){return he.createElement(ln,{key:e.id,level:l+1,item:e,size:i})}))),S="collapse"===d&&0===l?{position:"absolute",right:0}:{};return he.createElement(he.Fragment,null,he.createElement(T,{ref:m,selected:r,"aria-label":t,onClick:function(){return E((function(e){return!e}))},dense:"small"===i,sx:it(it({},s),{pl:"open"===d?v(2+1.5*l):void 0,backgroundColor:h?p.action.hover:void 0})},n&&he.createElement(P,{sx:{color:g}},n),he.createElement(j,{disableTypography:!0,primary:t,sx:{color:g,fontWeight:x,opacity:"collapse"===d&&0===l?0:void 0}}),h&&"open"===d?he.createElement(Be,{sx:[{color:g,ml:2},S]}):he.createElement(Ue,{sx:[{color:g,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 E(!1)},anchorOrigin:{vertical:"top",horizontal:"right"}},w))},rn=w(wt)((function(e){return{color:e.theme.palette.text.primary}})),on={minWidth:0,justifyContent:"center",marginRight:"auto"},an=function(e){var t=e.text,n=e.icon,r=e.avatar,o=e.label,a=e.bullet,i=e.href,l=e.selected,u=e.size,s=void 0===u?"medium":u,d=e.level,m=e.sx,f=Lt().state,p=c(),v=tn(p,l),y=v.color,h=v.fontWeight;return he.createElement(T,{LinkComponent:rn,dense:"small"===s,"aria-label":t,href:i,selected:l,sx:it(it(it({},m),{pl:"open"===f?p.spacing(2+1.5*d):void 0}),"collapse"===f&&{paddingHorizontal:p.spacing(2.5),justifyContent:"center"})},n&&he.createElement(P,{sx:it({color:y},"collapse"===f&&0===d&&on)},n),r&&he.createElement(W,{sx:it({},"collapse"===f&&0===d&&on)},he.createElement(N,{alt:r.alt,src:r.src,sx:it(it({},"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}}),o&&"open"===f&&he.createElement(gt,{text:o.text,variant:o.variant,sx:{ml:2}}),a&&"open"===f&&he.createElement(Et,{variant:a.variant,sx:{ml:2}}))},ln=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=Lt().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(nn,{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(an,{selected:l===i,size:r,text:c,icon:u,avatar:m,label:f,bullet:p,href:v,level:a})},cn=function(e){var t=e.title,n=e.items,r=e.size,o=void 0===r?"medium":r,a=Lt().state,i=c().spacing;return he.createElement(he.Fragment,null,t&&"open"===a&&he.createElement(en,{size:o,role:"heading"},t),he.createElement($,{sx:{paddingTop:"small"===o?i(0):void 0,paddingY:"collapse"===a?0:void 0}},n.map((function(e){return he.createElement(ln,{key:e.id,item:e,size:o})}))))},un=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(cn,{key:t,title:n,items:o,size:r})})))},sn={temporary:!1,mini:!0,persistent:!0,clipped:!0},dn={temporary:function(){return!0},mini:function(e){return"open"!==e},persistent:function(){return!0},clipped:function(){return!1}},mn=function(e){var t=e.title,n=e.sx,o=e.children,a=lt(e,["title","sx","children"]),l=c(),u=Lt(),s=u.state,d=u.variant,m=u.switchState,f=u.drawerWidth,p=u.underAppBar,v=sn[d]&&!p&&it({transition:l.transitions.create(["width","margin"],{easing:l.transitions.easing.sharp,duration:l.transitions.duration.leavingScreen})},"open"===s&&{marginLeft:f,width:"calc(100% - ".concat(f,"px)"),transition:l.transitions.create(["width","margin"],{easing:l.transitions.easing.sharp,duration:l.transitions.duration.enteringScreen})})||{};return ye.createElement(M,it({position:p?"fixed":void 0},a,{sx:it(it(it({},n),v),{zIndex:function(e){return e.zIndex.drawer+(p?1:0)}})}),ye.createElement(A,null,ye.createElement(i,{color:"inherit","aria-label":"open drawer",onClick:m,edge:"start",sx:{marginRight:5,display:dn[d](s)?void 0:"none"}},ye.createElement(He,null)),t&&ye.createElement(r,{variant:"h6",component:"h1",role:"heading","aria-level":1,noWrap:!0},t),o))},fn={temporary:!1,mini:!0,clipped:!0,persistent:!0},pn=w("div")((function(e){var t=e.theme,n=c().spacing,r=Lt(),o=r.drawerWidth,a=r.state,i=r.variant;return{marginLeft:fn[i]?"open"===a?o:"collapse"===a?n(8):0:0,transition:t.transitions.create("margin",{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen})}})),vn=function(e){var t=e.children;return he.createElement(pn,null,he.createElement(Ut,null),t)},yn={small:15,medium:20},hn=function(e){var t=e.label,r=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:r,label:t,onChange:v,disabled:l,size:u,renderValue:function(e){return l?he.createElement(Ft,{centerVertical:!0,centerHorizontal:!0},he.createElement(m,{color:"inherit",size:yn[u]})):a?he.createElement(n,{display:"flex",flexDirection:"column"},e,he.createElement(_,{color:"inherit",sx:{position:"absolute",left:0,right:0,bottom:0}})):e}},p))},En=function(e){var t=e.title,o=e.subtitle,i=e.loading,l=e.error,c=e.onSubmitSignIn,u=Ee(""),s=u[0],d=u[1],m=Ee(""),p=m[0],v=m[1];return he.createElement(he.Fragment,null,he.createElement(n,{marginBottom:2},he.createElement(r,{component:"h1",variant:"h4"},t),he.createElement(r,{variant:"body1"},o)),he.createElement(n,{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(L,{width:"100%",marginTop:1},he.createElement(f,{variant:"filled",severity:"error"},l.message)),he.createElement(a,{margin:"normal",fullWidth:!0,id:"email",label:"Email Address",name:"email",autoComplete:"email",autoFocus:!0,disabled:i,type:"email",inputProps:{role:"input"},error:!!s,helperText:s}),he.createElement(a,{margin:"normal",fullWidth:!0,role:"input",name:"password",label:"Password",type:"password",id:"password",disabled:i,autoComplete:"current-password",inputProps:{role:"input"},error:!!p,helperText:p}),he.createElement(Ye,{type:"submit",fullWidth:!0,variant:"contained",loading:i,disabled:i,role:"button",sx:{mt:2}},"Sign In")))};function bn(e,t){return"production"===process.env.NODE_ENV?()=>null:function(...n){return e(...n)||t(...n)}}var gn,xn={exports:{}},wn={exports:{}},Sn={};var Cn,kn,In,On,$n,Tn,Pn,jn,zn,Rn,Wn,Nn,Mn,An,Dn={};
|
|
1
|
+
import{InputAdornment as e,Button as t,Box as n,Typography as r,Tooltip as o,TextField as a,IconButton as i,Paper as l,useTheme 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 E,Breadcrumbs as g,Tabs as b,Tab as x,styled as w,drawerClasses as S,Drawer as C,Divider as k,paperClasses as I,ListSubheader as O,List as $,ListItemButton as T,ListItemIcon as P,ListItemText as j,Collapse as z,Popover as R,ListItemAvatar as W,Avatar as N,AppBar as M,Toolbar as A,FormControl as D,InputLabel as F,Select as V,LinearProgress as _,Stack as L,outlinedInputClasses as q,inputLabelClasses as B,circularProgressClasses as U,linearProgressClasses as H,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 Ee,forwardRef as ge,useRef as be,useEffect as xe,createContext as we,useContext as Se,useId as Ce,useMemo as ke}from"react";import Ie from"@mui/icons-material/Check";import Oe 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 We}from"@mui/x-date-pickers";import{Link as Ne,useLocation as Me,useNavigate as Ae,useParams as De,Routes as Fe,Route as Ve}from"react-router-dom";import{blueGrey as _e}from"@mui/material/colors";import Le from"markdown-to-jsx";import qe from"@mui/icons-material/ChevronLeft";import Be from"@mui/icons-material/ExpandMore";import Ue from"@mui/icons-material/ChevronRight";import He 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/MoreVert";var Qe=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(Oe,null),onClick:r,sx:{paddingRight:0,minWidth:0,marginRight:1}}),he.createElement(t,{variant:"contained",size:"small",color:"primary",startIcon:he.createElement(Ie,null),onClick:o,sx:{paddingRight:0,minWidth:0}}))},Ze=function(e,t){var n=Ee(!1),r=n[0],o=n[1],a=Ee(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()}}},et="-",tt=function(e){return"label-".concat(e.replace(/ /g,"-"))},nt=function(e){var t=e.label,a=e.tooltip,i=e.tooltipEnterDelay,l=void 0===i?2e3:i,c=e.children,u=tt(t);return he.createElement(n,{width:1},he.createElement(r,{variant:"subtitle2",role:"label",id:u},t),a?he.createElement(o,{title:a,placement:"top",enterDelay:l},c):c)},rt=function(e){var t=e.label,n=e.value,o=e.placeholder,l=void 0===o?et:o,c=e.editable,u=e.onEdit,s=void 0===u?function(){return null}:u,d=Ze(null==n?void 0:n.toString(),s),m=d.isEditing,f=d.editValue,p=d.startEdit,v=d.cancelEdit,y=d.setEditValue,h=d.submitEdit,E=tt(t),g=(null==n?void 0:n.toString())||l;return he.createElement(nt,{label:t,tooltip:g},m?he.createElement(a,{value:f,size:"small",onChange:function(e){return y(e.target.value)},InputProps:{endAdornment:he.createElement(Qe,{onClickCancel:v,onSubmitEdit:h})}}):he.createElement(r,{variant:"h5",noWrap:!0,"aria-labelledby":E},g,c&&he.createElement(i,{size:"small",onClick:p,sx:{ml:1}},he.createElement($e,null))))},ot=function(e){var t=e.children;return he.createElement(l,{sx:{p:2}},t)},at=function(e){var t=e.label,o=e.value,a=e.placeholder,l=void 0===a?et:a,s=e.editable,d=e.onEdit,m=void 0===d?function(){return null}:d,f=c().typography,p=Ze(o,m),v=p.isEditing,y=p.editValue,h=p.startEdit,E=p.cancelEdit,g=p.setEditValue,b=p.submitEdit,x={fontSize:f.h5.fontSize};return he.createElement(nt,{label:t},v?he.createElement(n,{display:"flex",alignItems:"center"},he.createElement(u,{checked:y,onChange:function(e){return g(e.target.checked)}}),he.createElement(Qe,{onClickCancel:E,onSubmitEdit:b})):he.createElement(n,{display:"flex",alignItems:"center"},void 0===o?he.createElement(r,{variant:"h5"},l):o?he.createElement(Ie,{color:"success",sx:x}):he.createElement(Te,{color:"error",sx:x}),s&&he.createElement(i,{size:"small",onClick:h,sx:{ml:1}},he.createElement($e,null))))},it=function(){return it=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},it.apply(this,arguments)};function lt(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 ct(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 ut=function(e){var t=e.label,o=e.value,l=e.format,c=e.placeholder,u=void 0===c?et:c,s=e.editable,d=e.editInputType,m=void 0===d?"datetime":d,f=e.onEdit,p=Ze(o,void 0===f?function(){return null}:f),v=p.isEditing,y=p.editValue,h=p.startEdit,E=p.cancelEdit,g=p.setEditValue,b=p.submitEdit,x=tt(t),w=o&&Pe(o,l)||u,S="datetime"===m?je:"time"===m?ze:Re;return he.createElement(nt,{label:t,tooltip:w},v?he.createElement(S,{value:y,format:l,onChange:function(e){return g(e||void 0)},slots:{textField:function(e){var t;return he.createElement(a,it({},e,{InputProps:it(it({},e.InputProps),{endAdornment:he.createElement(he.Fragment,null,null===(t=e.InputProps)||void 0===t?void 0:t.endAdornment,he.createElement(Qe,{onClickCancel:E,onSubmitEdit:b,sx:{ml:2}}))})}))}}}):he.createElement(n,{display:"flex",alignItems:"center"},he.createElement(r,{variant:"h5",noWrap:!0,"aria-labelledby":x},w),s&&he.createElement(i,{size:"small",onClick:h,sx:{ml:1}},he.createElement($e,null))))},st=function(e){var t=void 0===e?{}:e,n=t.lightWeight,r=void 0===n?100:n,o=t.darkWeight,a=void 0===o?900:o,i=c().palette;return"light"===i.mode?i.grey[r]:i.grey[a]},dt={root:"RdsGroupValueItem-root"},mt=function(e){var t=e.children,r=e.bordered,o=void 0===r||r,a=lt(e,["children","bordered"]),i=st({lightWeight:200,darkWeight:800});return he.createElement(s,it({item:!0,className:dt.root},a),he.createElement(n,{px:1,sx:{borderLeft:o?"solid ".concat(i," 1px"):"none"}},t))},ft=function(e){var t=e.title,o=e.subtitle,a=e.centered,i=e.children,c=st({lightWeight:200,darkWeight:800});return he.createElement(l,{sx:{paddingBottom:1}},he.createElement(n,{bgcolor:c,px:2,py:1},he.createElement(r,{variant:"h6",role:"heading","aria-level":1},t),o&&he.createElement(r,{variant:"body2",role:"heading","aria-level":2},o)),he.createElement(s,{container:!0,padding:1,rowSpacing:2,justifyContent:a?"center":"flex-start"},i))},pt=function(e){var t=e.label,r=e.value,o=void 0===r?0:r,a=e.maxRating,l=void 0===a?5:a,c=e.editable,u=e.onEdit,s=Ze(o,void 0===u?function(){return null}:u),m=s.isEditing,f=s.editValue,p=s.startEdit,v=s.cancelEdit,y=s.setEditValue,h=s.submitEdit,E=tt(t);return he.createElement(nt,{label:t,tooltip:o.toString()},he.createElement(n,{display:"flex",alignItems:"center"},he.createElement(d,{"aria-labelledby":E,readOnly:!m,max:l,value:m?f:o,onChange:function(e,t){return y(t)}}),c&&!m&&he.createElement(i,{size:"small",onClick:p,sx:{ml:1}},he.createElement($e,null)),m&&he.createElement(Qe,{onClickCancel:v,onSubmitEdit:h})))},vt=function(){return he.createElement(n,{width:1,height:1,display:"flex",justifyContent:"center",alignItems:"center"},he.createElement(m,null))};function yt(e){var t=e.isFetching,r=e.error,o=e.success,a=e.children;return t?he.createElement(vt,null):r?he.createElement(f,{severity:"error",role:"alert","aria-describedby":"error"},r.name&&he.createElement(p,{role:"heading"},r.name),r.message):he.createElement(n,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 ht={root:"RdsBullet-root"},Et=function(e){var t=e.variant,n=void 0===t?"primary":t,r=e.sx;return he.createElement(v,{color:n,variant:"dot",className:ht.root,role:"bullet","aria-describedby":n,sx:r})},gt={root:"RdsLabel-root"},bt=function(e){var t=e.text,o=e.variant,a=void 0===o?"default":o,i=e.sx,l=c().palette,u={default:"light"===l.mode?l.grey[100]:l.grey[900],primary:l.primary.main,secondary:l.secondary.main,info:l.info.main,warning:l.warning.main,error:l.error.main},s={default:l.getContrastText(u.default),primary:l.primary.contrastText,secondary:l.secondary.contrastText,info:l.info.contrastText,warning:l.warning.contrastText,error:l.error.contrastText};return he.createElement(n,{px:1,sx:it({backgroundColor:u[a]},i),borderRadius:1,color:s[a],className:gt.root,role:"label","aria-describedby":a},he.createElement(r,{variant:"caption",fontWeight:700},t.toUpperCase()))},xt=ge((function(e,t){var n=e.href,r=lt(e,["href"]);return he.createElement(Ne,it({ref:t,to:n},r))})),wt=ge((function(e,t){return he.createElement(y,it({},e,{component:xt}))})),St=function(e,t){return new Array(e).fill(t)},Ct=function(e){var t=Math.floor(Math.random()*e.length);return{index:t,item:e[t]}},kt=new Error("NotificationCenterContext.Provider is required and was undefined"),It=he.createContext(void 0),Ot=function(){var e=he.useContext(It);if(void 0===e)throw kt;return e},$t=function(e){var t=e.children,n=e.autoHideDuration,r=void 0===n?6e3:n,o=Ee(void 0),a=o[0],i=o[1],l=Ee(!1),c=l[0],u=l[1],s=function(){u(!1)};return he.createElement(It.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)},Tt=function(e,t,n){var r=n.from,o=n.to,a=be(),i=Ot().show;xe((function(){a.current===r&&t===o&&i(e),a.current=t}),[t])},Pt=we([0,function(){return null}]),jt=Pt.Provider,zt=function(){return Se(Pt)},Rt=function(e){var t=e.children,n=e.initialValue,r=Ee(void 0===n?0:n);return he.createElement(jt,{value:r},t)},Wt=function(e){var o=e.title,a=e.subtitle,i=e.preset,l=void 0===i?"default":i,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=Me(),w=c().palette,S=st(),C=zt(),k=C[0],I=C[1],O={default:S,primary:w.primary.main,secondary:w.secondary.main,inherit:"inherit",transparent:"transparent"},$=O[l],T={default:w.getContrastText(O.default),primary:w.primary.contrastText,secondary:w.secondary.contrastText,inherit:"inherit",transparent:w.text.primary}[l],P="panel"===v?k:null==f?void 0:f.findIndex((function(e){return e.href===h.pathname}));return he.createElement(n,{bgcolor:$,color:T},he.createElement(E,null,he.createElement(n,{sx:{py:3,display:"flex",flexDirection:"row",justifyContent:"space-between"}},he.createElement(n,null,y&&he.createElement(t,{href:y.href,size:"small",color:"inherit",LinkComponent:wt,startIcon:y.icon,sx:{mb:1}},y.text),(null==d?void 0:d.length)&&he.createElement(g,{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(wt,{key:t,underline:"hover",color:"inherit",href:n,variant:"body2",role:"link"},r)}))),he.createElement(r,{variant:"h4",role:"heading","aria-level":1},o),a&&he.createElement(r,{variant:"body1",role:"heading","aria-level":2},a)),m&&he.createElement(n,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?wt:"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 I(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,it({key:t},a)):he.createElement(x,it({key:t},a,{component:wt,href:o}))})))))},Nt={overrides:{h1:{component:r,props:{gutterBottom:!0,variant:"h5"}},h2:{component:r,props:{gutterBottom:!0,variant:"h6"}},h3:{component:r,props:{gutterBottom:!0,variant:"subtitle1"}},h4:{component:r,props:{gutterBottom:!0,variant:"caption",paragraph:!0}},p:{component:r,props:{paragraph:!0}},a:{component:y},li:{component:"li"}}},Mt=function(e){var t=e.content,n=e.options,r=void 0===n?Nt:n;return he.createElement(Le,{options:r},t)},At=function(e){var o,a,i=e.markdown,c=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=Ee("Copy"),y=v[0],h=v[1];i?o=i||"":Array.isArray(c)?(a=c.map((function(e,t){return he.createElement(r,{key:t,sx:{pb:s}},e)})),o=c.join("\n")):(a=he.createElement(r,null,c),o=c||"");var E=i&&he.createElement(Mt,{content:i});return he.createElement(l,{sx:it({p:2,backgroundColor:_e[800],color:"white"},p)},he.createElement(n,{display:"flex",flexDirection:"row"},he.createElement(n,{width:1},f||E||a),he.createElement(n,{width:100,sx:{ml:1}},o&&he.createElement(t,{fullWidth:!0,color:"inherit",size:"small",variant:"outlined",onClick:function(){navigator.clipboard.writeText(o),h("Copied!"),setTimeout((function(){return h("Copy")}),m)}},y))))},Dt=function(e){var t=e.children;return he.createElement(E,{component:"main",sx:{py:3,flexGrow:1}},t)};function Ft(e){var t=e.children,r=e.centerVertical,o=void 0===r||r,a=e.centerHorizontal,i=void 0===a||a,l=e.sx;return he.createElement(n,{width:1,height:1,sx:it(it({},l),{display:"flex",flexDirection:"column",justifyContent:o?"center":"flex-start",alignItems:i?"center":"flex-start"})},t)}var Vt=we(void 0),_t=new Error("DrawerContext.Provider is required and was undefined"),Lt=function(){var e=Se(Vt);if(void 0===e)throw _t;return e},qt=function(e){return{width:240,transition:e.transitions.create("width",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.enteringScreen}),overflowX:"hidden"}},Bt=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},Ut=w("div")((function(e){var t=e.theme;return it({display:"flex",alignItems:"center",justifyContent:"flex-end",padding:t.spacing(0,1)},t.mixins.toolbar)})),Ht={temporary:!0,mini:!0,persistent:!0,clipped:!1},Yt={temporary:"temporary",mini:"permanent",clipped:"permanent",persistent:"persistent"},Jt=function(){return{}},Xt={mini:function(e,t){var n;return(n={boxSizing:"border-box"})["& .".concat(I.root)]={zIndex:t.zIndex.drawer-1},n},temporary:Jt,clipped:Jt,persistent:Jt},Gt=function(e){var t,n,r=e.children,o=lt(e,["children"]),a=c(),l=Lt(),u=l.state,s=l.switchState,d=l.underAppBar,m=l.close,f=l.drawerWidth,p=l.variant,v=it(it(it({width:f,flexShrink:0,whiteSpace:"nowrap"},"open"===u&&it(it({},qt(a)),((t={})["& .".concat(S.paper)]=qt(a),t))),"open"!==u&&it(it({},Bt(a)),((n={})["& .".concat(S.paper)]=Bt(a),n))),Xt[p](u,a));return he.createElement(C,it({open:"open"===u,variant:Yt[p],role:"menu","aria-hidden":"close"===u,onClose:m,sx:v},o),he.createElement(Ut,null,!d&&Ht[p]&&he.createElement(i,{onClick:s},he.createElement(qe,null))),he.createElement(k,null),r)},Kt={temporary:"close",mini:"collapse",clipped:"open",persistent:"close"},Qt={temporary:["close","open"],mini:["collapse","open"],clipped:["open","open"],persistent:["close","open"]},Zt=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=Ee(n||Kt[o]),f=m[0],p=m[1],v=function(e){d(e),p(e)};return he.createElement(Vt.Provider,{value:{state:f,variant:o,selectedItemId:u,underAppBar:c,drawerWidth:i,switchState:function(){return v(Qt[o]["open"===f?0:1])},collapse:function(){return v("collapse")},close:function(){return v("close")},open:function(){return v("open")},setState:p}},t)},en=w(O,{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}})),tn=function(e,t){return{color:t?e.palette.primary.main:void 0,fontWeight:t?e.typography.fontWeightBold:e.typography.fontWeightMedium}},nn=function(e){var t=e.text,n=e.icon,r=e.selected,o=e.items,a=e.size,i=void 0===a?"medium":a,l=e.level,u=e.sx,s=void 0===u?{}:u,d=Lt().state,m=be(null),f=c(),p=f.palette,v=f.spacing,y=Ee(!1),h=y[0],E=y[1],g=tn(c(),r),b=g.color,x=g.fontWeight,w=he.createElement($,{component:"div",disablePadding:!0},o.map((function(e){return he.createElement(ln,{key:e.id,level:l+1,item:e,size:i})}))),S="collapse"===d&&0===l?{position:"absolute",right:0}:{};return he.createElement(he.Fragment,null,he.createElement(T,{ref:m,selected:r,"aria-label":t,onClick:function(){return E((function(e){return!e}))},dense:"small"===i,sx:it(it({},s),{pl:"open"===d?v(2+1.5*l):void 0,backgroundColor:h?p.action.hover:void 0})},n&&he.createElement(P,{sx:{color:b}},n),he.createElement(j,{disableTypography:!0,primary:t,sx:{color:b,fontWeight:x,opacity:"collapse"===d&&0===l?0:void 0}}),h&&"open"===d?he.createElement(Be,{sx:[{color:b,ml:2},S]}):he.createElement(Ue,{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 E(!1)},anchorOrigin:{vertical:"top",horizontal:"right"}},w))},rn=w(wt)((function(e){return{color:e.theme.palette.text.primary}})),on={minWidth:0,justifyContent:"center",marginRight:"auto"},an=function(e){var t=e.text,n=e.icon,r=e.avatar,o=e.label,a=e.bullet,i=e.href,l=e.selected,u=e.size,s=void 0===u?"medium":u,d=e.level,m=e.sx,f=Lt().state,p=c(),v=tn(p,l),y=v.color,h=v.fontWeight;return he.createElement(T,{LinkComponent:rn,dense:"small"===s,"aria-label":t,href:i,selected:l,sx:it(it(it({},m),{pl:"open"===f?p.spacing(2+1.5*d):void 0}),"collapse"===f&&{paddingHorizontal:p.spacing(2.5),justifyContent:"center"})},n&&he.createElement(P,{sx:it({color:y},"collapse"===f&&0===d&&on)},n),r&&he.createElement(W,{sx:it({},"collapse"===f&&0===d&&on)},he.createElement(N,{alt:r.alt,src:r.src,sx:it(it({},"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}}),o&&"open"===f&&he.createElement(bt,{text:o.text,variant:o.variant,sx:{ml:2}}),a&&"open"===f&&he.createElement(Et,{variant:a.variant,sx:{ml:2}}))},ln=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=Lt().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(nn,{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(an,{selected:l===i,size:r,text:c,icon:u,avatar:m,label:f,bullet:p,href:v,level:a})},cn=function(e){var t=e.title,n=e.items,r=e.size,o=void 0===r?"medium":r,a=Lt().state,i=c().spacing;return he.createElement(he.Fragment,null,t&&"open"===a&&he.createElement(en,{size:o,role:"heading"},t),he.createElement($,{sx:{paddingTop:"small"===o?i(0):void 0,paddingY:"collapse"===a?0:void 0}},n.map((function(e){return he.createElement(ln,{key:e.id,item:e,size:o})}))))},un=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(cn,{key:t,title:n,items:o,size:r})})))},sn={temporary:!1,mini:!0,persistent:!0,clipped:!0},dn={temporary:function(){return!0},mini:function(e){return"open"!==e},persistent:function(){return!0},clipped:function(){return!1}},mn=function(e){var t=e.title,n=e.sx,o=e.children,a=lt(e,["title","sx","children"]),l=c(),u=Lt(),s=u.state,d=u.variant,m=u.switchState,f=u.drawerWidth,p=u.underAppBar,v=sn[d]&&!p&&it({transition:l.transitions.create(["width","margin"],{easing:l.transitions.easing.sharp,duration:l.transitions.duration.leavingScreen})},"open"===s&&{marginLeft:f,width:"calc(100% - ".concat(f,"px)"),transition:l.transitions.create(["width","margin"],{easing:l.transitions.easing.sharp,duration:l.transitions.duration.enteringScreen})})||{};return ye.createElement(M,it({position:p?"fixed":void 0},a,{sx:it(it(it({},n),v),{zIndex:function(e){return e.zIndex.drawer+(p?1:0)}})}),ye.createElement(A,null,ye.createElement(i,{color:"inherit","aria-label":"open drawer",onClick:m,edge:"start",sx:{marginRight:5,display:dn[d](s)?void 0:"none"}},ye.createElement(He,null)),t&&ye.createElement(r,{variant:"h6",component:"h1",role:"heading","aria-level":1,noWrap:!0},t),o))},fn={temporary:!1,mini:!0,clipped:!0,persistent:!0},pn=w("div")((function(e){var t=e.theme,n=c().spacing,r=Lt(),o=r.drawerWidth,a=r.state,i=r.variant;return{marginLeft:fn[i]?"open"===a?o:"collapse"===a?n(8):0:0,transition:t.transitions.create("margin",{easing:t.transitions.easing.sharp,duration:t.transitions.duration.leavingScreen})}})),vn=function(e){var t=e.children;return he.createElement(pn,null,he.createElement(Ut,null),t)},yn={small:15,medium:20},hn=function(e){var t=e.label,r=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:r,label:t,onChange:v,disabled:l,size:u,renderValue:function(e){return l?he.createElement(Ft,{centerVertical:!0,centerHorizontal:!0},he.createElement(m,{color:"inherit",size:yn[u]})):a?he.createElement(n,{display:"flex",flexDirection:"column"},e,he.createElement(_,{color:"inherit",sx:{position:"absolute",left:0,right:0,bottom:0}})):e}},p))},En=function(e){var t=e.title,o=e.subtitle,i=e.loading,l=e.error,c=e.onSubmitSignIn,u=Ee(""),s=u[0],d=u[1],m=Ee(""),p=m[0],v=m[1];return he.createElement(he.Fragment,null,he.createElement(n,{marginBottom:2},he.createElement(r,{component:"h1",variant:"h4"},t),he.createElement(r,{variant:"body1"},o)),he.createElement(n,{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(L,{width:"100%",marginTop:1},he.createElement(f,{variant:"filled",severity:"error"},l.message)),he.createElement(a,{margin:"normal",fullWidth:!0,id:"email",label:"Email Address",name:"email",autoComplete:"email",autoFocus:!0,disabled:i,type:"email",inputProps:{role:"input"},error:!!s,helperText:s}),he.createElement(a,{margin:"normal",fullWidth:!0,role:"input",name:"password",label:"Password",type:"password",id:"password",disabled:i,autoComplete:"current-password",inputProps:{role:"input"},error:!!p,helperText:p}),he.createElement(Ye,{type:"submit",fullWidth:!0,variant:"contained",loading:i,disabled:i,role:"button",sx:{mt:2}},"Sign In")))};function gn(e,t){return"production"===process.env.NODE_ENV?()=>null:function(...n){return e(...n)||t(...n)}}var bn,xn={exports:{}},wn={exports:{}},Sn={};var Cn,kn,In,On,$n,Tn,Pn,jn,zn,Rn,Wn,Nn,Mn,An,Dn={};
|
|
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,Box as n,Typography as r,Tooltip as o,Tex
|
|
|
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 Fn(){return kn||(kn=1,e=wn,"production"===process.env.NODE_ENV?e.exports=function(){if(
|
|
9
|
+
*/function Fn(){return kn||(kn=1,e=wn,"production"===process.env.NODE_ENV?e.exports=function(){if(bn)return Sn;bn=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,E=e?Symbol.for("react.scope"):60119;function g(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 g(e)===u}return Sn.AsyncMode=c,Sn.ConcurrentMode=u,Sn.ContextConsumer=l,Sn.ContextProvider=i,Sn.Element=t,Sn.ForwardRef=s,Sn.Fragment=r,Sn.Lazy=p,Sn.Memo=f,Sn.Portal=n,Sn.Profiler=a,Sn.StrictMode=o,Sn.Suspense=d,Sn.isAsyncMode=function(e){return b(e)||g(e)===c},Sn.isConcurrentMode=b,Sn.isContextConsumer=function(e){return g(e)===l},Sn.isContextProvider=function(e){return g(e)===i},Sn.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Sn.isForwardRef=function(e){return g(e)===s},Sn.isFragment=function(e){return g(e)===r},Sn.isLazy=function(e){return g(e)===p},Sn.isMemo=function(e){return g(e)===f},Sn.isPortal=function(e){return g(e)===n},Sn.isProfiler=function(e){return g(e)===a},Sn.isStrictMode=function(e){return g(e)===o},Sn.isSuspense=function(e){return g(e)===d},Sn.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===E||e.$$typeof===v)},Sn.typeOf=g,Sn}():e.exports=(Cn||(Cn=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,E=e?Symbol.for("react.scope"):60119;function g(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,I=r,O=p,$=f,T=n,P=a,j=o,z=d,R=!1;function W(e){return g(e)===u}Dn.AsyncMode=b,Dn.ConcurrentMode=x,Dn.ContextConsumer=w,Dn.ContextProvider=S,Dn.Element=C,Dn.ForwardRef=k,Dn.Fragment=I,Dn.Lazy=O,Dn.Memo=$,Dn.Portal=T,Dn.Profiler=P,Dn.StrictMode=j,Dn.Suspense=z,Dn.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.")),W(e)||g(e)===c},Dn.isConcurrentMode=W,Dn.isContextConsumer=function(e){return g(e)===l},Dn.isContextProvider=function(e){return g(e)===i},Dn.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Dn.isForwardRef=function(e){return g(e)===s},Dn.isFragment=function(e){return g(e)===r},Dn.isLazy=function(e){return g(e)===p},Dn.isMemo=function(e){return g(e)===f},Dn.isPortal=function(e){return g(e)===n},Dn.isProfiler=function(e){return g(e)===a},Dn.isStrictMode=function(e){return g(e)===o},Dn.isSuspense=function(e){return g(e)===d},Dn.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===E||e.$$typeof===v)},Dn.typeOf=g}()),Dn)),wn.exports;var e}
|
|
10
10
|
/*
|
|
11
11
|
object-assign
|
|
12
12
|
(c) Sindre Sorhus
|
|
13
13
|
@license MIT
|
|
14
|
-
*/function Vn(){if(On)return In;On=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return In=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},In}function _n(){if(Tn)return $n;Tn=1;return $n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Ln(){return jn?Pn:(jn=1,Pn=Function.call.bind(Object.prototype.hasOwnProperty))}if("production"!==process.env.NODE_ENV){var qn=Fn();xn.exports=function(){if(Nn)return Wn;Nn=1;var e=Fn(),t=Vn(),n=_n(),r=Ln(),o=function(){if(Rn)return zn;Rn=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=_n(),n={},r=Ln();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={})},zn=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){}}),Wn=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 `"+b(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 `"+b(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 `"+b(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 E(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=b(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"===g(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=b(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,g(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=b(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,g(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 b(l)!==e?new p("Invalid "+o+" `"+a+"` of type `"+g(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 E(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(E);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(!E(n.value))return!1}else for(;!(n=r.next()).done;){var o=n.value;if(o&&!E(o[1]))return!1}return!0;default:return!1}}function b(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 g(e){if(null==e)return""+e;var t=b(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function x(e){var t=g(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},Wn}()(qn.isElement,!0)}else xn.exports=function(){if(An)return Mn;An=1;var e=_n();function t(){}function n(){}return n.resetWarningCache=t,Mn=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 Bn(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}bn(xn.exports.element,Bn).isRequired=bn(xn.exports.element.isRequired,Bn),bn(xn.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 Un,Hn={};var Yn,Jn,Xn={};
|
|
14
|
+
*/function Vn(){if(On)return In;On=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;return In=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},In}function _n(){if(Tn)return $n;Tn=1;return $n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"}function Ln(){return jn?Pn:(jn=1,Pn=Function.call.bind(Object.prototype.hasOwnProperty))}if("production"!==process.env.NODE_ENV){var qn=Fn();xn.exports=function(){if(Nn)return Wn;Nn=1;var e=Fn(),t=Vn(),n=_n(),r=Ln(),o=function(){if(Rn)return zn;Rn=1;var e=function(){};if("production"!==process.env.NODE_ENV){var t=_n(),n={},r=Ln();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={})},zn=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){}}),Wn=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 `"+g(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 `"+g(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 `"+g(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 E(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=g(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=g(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=g(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 g(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 E(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(E);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(!E(n.value))return!1}else for(;!(n=r.next()).done;){var o=n.value;if(o&&!E(o[1]))return!1}return!0;default:return!1}}function g(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=g(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},Wn}()(qn.isElement,!0)}else xn.exports=function(){if(An)return Mn;An=1;var e=_n();function t(){}function n(){}return n.resetWarningCache=t,Mn=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 Bn(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}gn(xn.exports.element,Bn).isRequired=gn(xn.exports.element.isRequired,Bn),gn(xn.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 Un,Hn={};var Yn,Jn,Xn={};
|
|
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
|
-
*/Jn={exports:{}},"production"===process.env.NODE_ENV?Jn.exports=function(){if(Un)return Hn;Un=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"),Hn.ContextConsumer=l,Hn.ContextProvider=i,Hn.Element=t,Hn.ForwardRef=u,Hn.Fragment=r,Hn.Lazy=f,Hn.Memo=m,Hn.Portal=n,Hn.Profiler=a,Hn.StrictMode=o,Hn.Suspense=s,Hn.SuspenseList=d,Hn.isAsyncMode=function(){return!1},Hn.isConcurrentMode=function(){return!1},Hn.isContextConsumer=function(e){return v(e)===l},Hn.isContextProvider=function(e){return v(e)===i},Hn.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Hn.isForwardRef=function(e){return v(e)===u},Hn.isFragment=function(e){return v(e)===r},Hn.isLazy=function(e){return v(e)===f},Hn.isMemo=function(e){return v(e)===m},Hn.isPortal=function(e){return v(e)===n},Hn.isProfiler=function(e){return v(e)===a},Hn.isStrictMode=function(e){return v(e)===o},Hn.isSuspense=function(e){return v(e)===s},Hn.isSuspenseList=function(e){return v(e)===d},Hn.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)},Hn.typeOf=v,Hn}():Jn.exports=(Yn||(Yn=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,E=t,b=u,g=r,x=f,w=m,S=n,C=a,k=o,I=s,O=d,$=!1,T=!1;Xn.ContextConsumer=y,Xn.ContextProvider=h,Xn.Element=E,Xn.ForwardRef=b,Xn.Fragment=g,Xn.Lazy=x,Xn.Memo=w,Xn.Portal=S,Xn.Profiler=C,Xn.StrictMode=k,Xn.Suspense=I,Xn.SuspenseList=O,Xn.isAsyncMode=function(e){return $||($=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},Xn.isConcurrentMode=function(e){return T||(T=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!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),"undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),xn.exports.oneOfType([xn.exports.func,xn.exports.object]);let Gn=0;const Kn=ye.useId;function Qn(e){if(void 0!==Kn){const t=Kn();return null!=e?e:t}return function(e){const[t,n]=ye.useState(e),r=e||t;return ye.useEffect((()=>{null==t&&(Gn+=1,n(`mui-${Gn}`))}),[t]),r}(e)}const Zn={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};const er=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function tr(e,t,n,r){const o=e[t];if(null==o||!er(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 nr(e,t,...n){return void 0===e[t]?null:tr(e,t,...n)}function rr(){return null}nr.isRequired=tr,rr.isRequired=rr,process.env.NODE_ENV;var or=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=lt(t,["id","label","InputLabelProps","InputProps","fetching","loading","helperText","hexColor","size","fullWidth","sx"]),y=Qn(r),h=u&&y?"".concat(y,"-helper-text"):void 0,E=o&&y?"".concat(y,"-label"):void 0,b=s?((n={})["& .".concat(q.notchedOutline)]={borderColor:"".concat(s," !important")},n["& .".concat(B.root)]={color:s},n["& .".concat(q.input)]={color:s},n["& .".concat(U.root)]={color:s},n["& .".concat(H.bar)]={backgroundColor:s},n["& .".concat(Y.endAdornment," .").concat(J.root)]={color:s},n):{};return he.createElement(D,{sx:b,fullWidth:f},he.createElement(F,it({size:"small"===d?"small":"normal",id:E,htmlFor:y},a),o),he.createElement(X,it({},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))},ar=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=lt(e,["label","loading","fetching","options","helperText","color","onChangeValue","sx"]),d=n||r;return he.createElement(K,it({loading:d,options:r?[]:o,onChange:function(e,t){return c(t)}},s,{renderInput:function(e){return he.createElement(or,it({},e,{label:t,fullWidth:!0,fetching:r,loading:n,hexColor:i,helperText:a}))},sx:u}))};function ir(e){var t=e.children,r=e.index,o=zt()[0],a=o===r;return Array.isArray(r)&&(a=r.includes(o)),he.createElement("div",{role:"tabpanel",hidden:!a,id:"simple-tabpanel-".concat(r),"aria-labelledby":"simple-tab-".concat(r)},a&&he.createElement(n,{sx:{p:3}},t))}var lr=w(g)((function(e){var t,n=e.theme;return(t={})["&.".concat(Q.root)]={backgroundColor:n.palette.grey[100]},t})),cr=function(e){var t=e.children,n=e.tabs,r=zt(),o=r[0],a=r[1];return he.createElement(l,null,he.createElement(lr,{value:o,onChange:function(e,t){return a(t)}},n.map((function(e){return he.createElement(x,{key:e,label:e})}))),t)},ur=function(e){var t=e.order,r=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:r===e.id&&t,sx:{fontWeight:"bold"}},e.sort?he.createElement(ne,{active:r===e.id,direction:r===e.id?t:"asc",onClick:(o=e.id,function(){a(o)})},e.label,r===e.id?he.createElement(n,{component:"span",sx:Zn},"desc"===t?"sorted descending":"sorted ascending"):null):e.label);var o}))))};function sr(e,t,n){return t[n]<e[n]?-1:t[n]>e[n]?1:0}var dr=function(t){var r=t.children,o=t.data,i=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=Ee(""),v=p[0],y=p[1],h=Ee(s),E=h[0],b=h[1],g=Ee(c),x=g[0],w=g[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 sr(e,n,t)}:function(e,n){return-sr(e,n,t)}}(E,x));return he.createElement(he.Fragment,null,he.createElement(n,{sx:{paddingX:1,paddingBottom:2}},i&&he.createElement(n,{paddingY:2},he.createElement(a,{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(ur,{order:E,orderBy:x,headCells:l,onRequestSort:function(e){b(x===e&&"asc"===E?"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")):r(S))))))};dr.defaultProps={defaultOrder:"asc"};var mr,fr=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=Ee({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(ur,{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)}))))))},pr=function(e){var o=e.title,a=e.subtitle,i=e.icon,l=e.iconSize,c=void 0===l?200:l,u=e.actions;return he.createElement(n,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center"},i&&i({size:c,color:"primary"}),he.createElement(r,{variant:"h4",role:"heading","aria-level":1},o),he.createElement(r,{variant:"subtitle1",role:"heading","aria-level":2,sx:{mt:2}},a),u&&he.createElement(n,{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)}))))},vr=function(e){var t=e.width,r=void 0===t?"100%":t,o=e.animation,a=void 0!==o&&o;return he.createElement(n,{width:r},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}))},yr=function(e){var t=e.size,n=void 0===t?20:t;return he.createElement(s,{container:!0,spacing:2},St(n,0).map((function(e,t){return he.createElement(s,{item:!0,key:t,xs:4},he.createElement(vr,{width:1}))})))},hr=function(e){var t=e.size,n=void 0===t?20:t,r=e.children,o=e.p;return he.createElement(E,{component:"main",sx:{p:o},"data-testid":"content-placeholder-test"},r,he.createElement(yr,{size:n}))},Er=function(e){var t=e.count,n=void 0===t?3:t,o=e.units,a=void 0===o?"paragraph":o,i=e.variant,l=void 0===i?"body1":i;return he.createElement(r,{variant:l},Xe({count:n,units:a}))},br=((mr={})["& .".concat(le.message)]={width:1},mr),gr=be((function(e,t){var r=e.severity,o=e.iconMapping,a=e.title,l=e.message,c=e.metadata,u=e.onClose,s=Ee(!1),d=s[0],m=s[1];return he.createElement(f,{ref:t,severity:r,iconMapping:o,onClose:u,action:he.createElement(n,{display:"flex",flexDirection:"column"},he.createElement(i,{color:"inherit",onClick:u},he.createElement(Te,{fontSize:"small"})),c&&he.createElement(i,{color:"inherit",onClick:function(){return m((function(e){return!e}))}},d?he.createElement(Ge,{fontSize:"small"}):he.createElement(Be,{fontSize:"small"}))),sx:br},he.createElement(n,{sx:{w:1}},a&&he.createElement(p,null,a),l,c&&he.createElement(z,{in:d,sx:{mt:2}},he.createElement(At,{content:c}))))})),xr=function(e){var r=e.open,o=e.title,a=e.component,l=e.componentProps,c=void 0===l?{}:l,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,E=e.acceptable,b=e.acceptText,g=void 0===b?"Accept":b,x=e.cancelText,w=void 0===x?"Cancel":x,S=e.onAccept,C=e.onCancel,k=void 0===C?function(){return null}:C,I=e.onClose,O=e.acceptType,$=void 0===O?"button":O,T=d.length>0||E||v;return he.createElement(ce,{open:r,onClose:I},he.createElement(ue,{sx:{display:"flex",alignItems:"center"}},o,p&&!E&&he.createElement(m,{size:20,sx:{ml:2,color:function(e){return e.palette.grey[500]}}}),he.createElement(i,{disabled:u,"aria-label":"close",onClick:I,sx:{position:"absolute",right:8,top:8,color:function(e){return e.palette.grey[500]}}},he.createElement(Te,null))),he.createElement(n,it({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&&I()}},w),E&&he.createElement(Ye,{type:$,loading:p,disabled:u,onClick:S},g))))},wr=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(xr,{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)},Sr=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(xr,{component:"form",componentProps:{onSubmit:function(e){e.preventDefault(),s(function(e){var t=new FormData(e.currentTarget),n={};return t.forEach((function(e,t){n[t]=e})),n}(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)},Cr=function(e){void 0===e&&(e=!1);var t=Ee(e),n=t[0],r=t[1];return{isOpen:n,open:function(){return r(!0)},close:function(){return r(!1)},setIsOpen:r}},kr=function(e){var t=e.drawerProviderProps,n=e.children,r=n[0],o=n[1],a=n[2];return he.createElement(Zt,it({},t),r,o,he.createElement(vn,null,a))},Ir=function(e){var t=e.loading,r=e.children,o=r[0],a=r[1];return he.createElement(Rt,null,he.createElement(n,{display:"flex",flexDirection:"column",height:1},o,t?he.createElement(vt,null):a))},Or=function(e,t){var n=e.id,r=e.name,o=e.type,a=t[n];return"boolean"===o?he.createElement(at,{label:r,value:a}):"date"===o||"time"===o||"datetime"===o?he.createElement(ut,{label:r,value:a,format:e.format}):he.createElement(rt,{label:r,value:null==a?void 0:a.toString()})},$r=function(e){var t=e.field,n=t.name,r=t.description,o=t.value,a=e.instance;return he.createElement(ft,{title:n,subtitle:r},o.map((function(e){var t=e.id,n=e.xs,r=e.sm,o=e.md,i=e.lg,l=e.xl;return he.createElement(mt,{key:t,xs:n,sm:r,md:o,lg:i,xl:l},Or(e,a))})))},Tr=function(e){var t=e.model,n=e.instance;return he.createElement(s,{container:!0,spacing:2},t.fields.map((function(e){var t=e.id,r=e.type,o=e.xs,a=void 0===o?3:o,i=e.sm,l=e.md,c=e.lg,u=e.xl;return"group"===r?he.createElement(s,{item:!0,key:t,xs:12},he.createElement($r,{field:e,instance:n[t]})):he.createElement(s,{item:!0,key:t,xs:a,sm:i,md:l,lg:c,xl:u},he.createElement(ot,null,Or(e,n)))})))},Pr={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:{}},jr=function(e,t){return t&&t[e.id]||"default"in e&&e.default||Pr[e.type]},zr=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]=jr(n,t&&t[e.id])})),n[e.id]=r}else n[e.id]=jr(e,t)})),n},Rr=function(e){var o=e.model,i=e.saveButtonText,c=e.onSubmit,u=e.initialValues,d=ke((function(){return zr(o,u)}),[o,u]),m=Ee(d),f=m[0],p=m[1],v=function(e,t,n){p((function(r){var o,a={};return t?a[t]=it(it({},r[t]),((o={})[e]=n,o)):a[e]=n,it(it({},r),a)}))},y=function(e,t,n){v(n,t,e)},h=function(e,t){void 0===t&&(t=void 0);var o,i=st({lightWeight:200,darkWeight:800}),c=e.id,u=e.type,d=e.name,m=e.description,p=e.xs,E=e.sm,b=e.md,g=e.lg,x=e.xl,w=t?f[t][c]:f[c];return o="group"===u?he.createElement(l,null,he.createElement(n,{bgcolor:i,px:2,py:1,mb:2},he.createElement(r,{variant:"h6",role:"heading","aria-level":1},d),he.createElement(r,{variant:"body2",role:"heading","aria-level":2},m)),he.createElement(s,{container:!0,spacing:2,sx:{p:2}},e.value.map((function(e){return h(e,c)})))):"boolean"===u?he.createElement(n,{sx:{height:1,display:"flex",alignItems:"center"}},he.createElement(me,{control:he.createElement(fe,{name:c,onChange:function(e){return function(e,t){e.preventDefault(),v(e.target.name,t,e.target.checked)}(e,t)},checked:w}),label:d})):"enum"===u?he.createElement(D,{fullWidth:!0},he.createElement(F,{id:"".concat(c,"-select-label")},d),he.createElement(V,{labelId:"".concat(c,"-select-label"),id:"".concat(c,"-select"),value:w,label:d,name:c,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)})))):"multienum"===u?he.createElement(D,{fullWidth:!0},he.createElement(F,{id:"".concat(c,"-select-label")},d),he.createElement(V,{labelId:"".concat(c,"-select-label"),id:"".concat(c,"-select"),value:w||[],renderValue:function(e){return e.join(", ")},label:d,name:c,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}))})))):"date"===u?he.createElement(We,{label:d,format:e.format,value:w,onChange:function(e){return y(e,t,c)}}):"time"===u?he.createElement(ze,{label:d,format:e.format,value:w,onChange:function(e){return y(e,t,c)}}):"datetime"===u?he.createElement(je,{label:d,format:e.format,value:w,onChange:function(e){return y(e,t,c)}}):he.createElement(a,{required:!0,type:u,label:d,name:c,variant:"outlined",fullWidth:!0,value:w,onChange:function(e){return function(e,t,n){e.preventDefault();var r=e.target.value;"number"===n&&"string"==typeof r&&(r=parseInt(e.target.value)),v(e.target.name,t,r)}(e,t,u)}}),he.createElement(s,{item:!0,key:c,xs:p,sm:E,md:b,lg:g,xl:x},o)};return he.createElement(s,{container:!0,component:"form",spacing:2,onSubmit:function(e){e.preventDefault(),c(f)}},o.fields.map((function(e){return h(e)})),he.createElement(s,{item:!0,xs:12},he.createElement(t,{type:"submit",variant:"contained"},i)))},Wr=function(e,t,n){var r=n.from,o=n.to,a=ge(),i=Ae();xe((function(){a.current===r&&t===o&&i(e),a.current=t}),[t])},Nr=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]),Tt({title:"Item updated",message:"The item ".concat(d," has been updated successfully"),severity:"success"},!!a.success,{from:!1,to:!0}),Wr("".concat(o,"/"),!!a.success,{from:!1,to:!0}),Tt({title:"We had an error",message:a.error||"",severity:"error"},!!a.error,{from:!1,to:!0}),he.createElement(Ir,{loading:m},he.createElement(Wt,{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(Dt,null,he.createElement(Rr,{model:t,initialValues:l,saveButtonText:"Save",onSubmit:c})))},Mr=function(e){var t=e.columns,n=e.options,r=e.data,o=e.onClick,a=e.search,l=e.defaultSort,c=e.defaultOrder,u=e.loading,s=ct(ct([],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(dr,{columns:s,data:r,search:a,defaultSort:l,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(i,{"data-testid":"options-".concat(e.id),onClick:function(t){t.stopPropagation(),f({item:e,anchor:t.currentTarget})}},he.createElement(Ke,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)}))))},Ar=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,E=Ae();xe((function(){y()}),[]),Tt({title:"Item deleted",message:"The item has been deleted successfully",severity:"success"},!!a.success,{from:!1,to:!0}),Tt({title:"We had an error",message:a.error||"",severity:"error"},!!a.error,{from:!1,to:!0});var b=v?function(e){E("".concat(l,"/").concat(e.id))}:void 0,g=function(e,t){"edit"===e?E("".concat(l,"/").concat(t.id,"/update")):h(t)},x=[];d&&x.push({id:"edit",label:"Edit",onClick:function(e){return g("edit",e)}}),u&&x.push({id:"remove",label:"Remove",onClick:function(e){return g("remove",e)}});var w=[];return f&&w.push({id:"add",text:"Add",href:"".concat(l,"/add")}),he.createElement(Ir,{loading:o.loading||a.loading},he.createElement(Wt,{title:n,preset:"default",actions:w.length>0?w:void 0}),he.createElement(Dt,null,he.createElement(Mr,{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:b,options:x.length>0?x:void 0})))},Dr=function(e){var t=e.model,n=e.modelName,r=e.basePath,o=void 0===r?"":r,a=e.onSubmitNewItem,i=e.newItemRequest;return Tt({message:"Item added successfully",severity:"success"},!!i.success,{from:!1,to:!0}),Wr("".concat(o,"/"),!!i.success,{from:!1,to:!0}),Tt({title:"We had an error",message:i.error||"",severity:"error"},!!i.error,{from:!1,to:!0}),he.createElement(Ir,{loading:i.loading},he.createElement(Wt,{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(Dt,null,he.createElement(Rr,{model:t,saveButtonText:"Save",onSubmit:a})))},Fr=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(Ir,{loading:i.loading},he.createElement(Wt,{title:u,preset:"default",breadcrumbs:[{id:"list",text:n,link:"".concat(o,"/")},{id:"detail",text:u,link:"".concat(o,"/").concat(u)}]}),he.createElement(Dt,null,l&&he.createElement(Tr,{model:t,instance:l})))},Vr=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(Ar,it({},e))}),i&&he.createElement(Ve,{path:":id",element:he.createElement(Fr,it({},e))}),o&&he.createElement(Ve,{path:"add",element:he.createElement(Dr,it({},e))}),n&&he.createElement(Ve,{path:":id/update",element:he.createElement(Nr,it({},e))}))},_r={idle:!0},Lr={loading:!0},qr={success:!0};export{ar as Autocomplete,At as Board,xr as BootstrapDialog,Et as Bullet,Ft as CenterContainer,wr as ConfirmDialog,Dt as Content,hr as ContentPlaceholder,et as DefaultPlaceholder,Gt as Drawer,mn as DrawerAppBar,un as DrawerContent,Vt as DrawerContext,Ut as DrawerHeader,kr as DrawerLayout,vn as DrawerMain,Zt as DrawerProvider,cn as DrawerSection,en as DrawerSubheader,fr as EnhancedRemoteTable,dr as EnhancedTable,ur as EnhancedTableHead,gr as ExpandableAlert,Sr as FormDialog,ft as GroupValueCard,mt as GroupValueItem,Wt as Header,Ir as HeaderLayout,_r as IdleRequest,gt as Label,vt as LoadingArea,Lr as LoadingRequest,Er as LoremIpsumPlaceholder,Mt as Markdown,Rr as ModelForm,Vr as ModelRouter,It as NotificationCenterContext,$t as NotificationCenterProvider,kt as NotificationCenterProviderUndefinedError,Tr as ObjectDetails,pr as Placeholder,yt as QueryContainer,hn as Select,En as SignIn,vr as SkeletonCard,yr as SkeletonGrid,qr as SuccessRequest,cr as TabCard,Pt as TabContext,jt as TabContextProvider,ir as TabPanel,Rt as TabProvider,Mr as TableList,_t as UndefinedProvider,at as ValueBoolean,ot as ValueCard,ut as ValueDatetime,Qe as ValueEditButtons,pt as ValueRating,rt as ValueText,ht as bulletClasses,tn as getDrawerItemColors,Ct as getRandomItem,dt as groupValueItemClasses,bt as labelClasses,Nt as markdownDefaultOptions,St as newArrayWithSize,zr as newInstanceFromValuesOrZeroValue,Cr as useDialog,Lt as useDrawer,Ze as useEditableValueDisplay,st as useGetDefaultThemeColor,Ot as useNotificationCenter,Tt as useNotifyWhenValueChanges,zt as useTab};
|
|
23
|
+
*/Jn={exports:{}},"production"===process.env.NODE_ENV?Jn.exports=function(){if(Un)return Hn;Un=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"),Hn.ContextConsumer=l,Hn.ContextProvider=i,Hn.Element=t,Hn.ForwardRef=u,Hn.Fragment=r,Hn.Lazy=f,Hn.Memo=m,Hn.Portal=n,Hn.Profiler=a,Hn.StrictMode=o,Hn.Suspense=s,Hn.SuspenseList=d,Hn.isAsyncMode=function(){return!1},Hn.isConcurrentMode=function(){return!1},Hn.isContextConsumer=function(e){return v(e)===l},Hn.isContextProvider=function(e){return v(e)===i},Hn.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Hn.isForwardRef=function(e){return v(e)===u},Hn.isFragment=function(e){return v(e)===r},Hn.isLazy=function(e){return v(e)===f},Hn.isMemo=function(e){return v(e)===m},Hn.isPortal=function(e){return v(e)===n},Hn.isProfiler=function(e){return v(e)===a},Hn.isStrictMode=function(e){return v(e)===o},Hn.isSuspense=function(e){return v(e)===s},Hn.isSuspenseList=function(e){return v(e)===d},Hn.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)},Hn.typeOf=v,Hn}():Jn.exports=(Yn||(Yn=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,E=t,g=u,b=r,x=f,w=m,S=n,C=a,k=o,I=s,O=d,$=!1,T=!1;Xn.ContextConsumer=y,Xn.ContextProvider=h,Xn.Element=E,Xn.ForwardRef=g,Xn.Fragment=b,Xn.Lazy=x,Xn.Memo=w,Xn.Portal=S,Xn.Profiler=C,Xn.StrictMode=k,Xn.Suspense=I,Xn.SuspenseList=O,Xn.isAsyncMode=function(e){return $||($=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")),!1},Xn.isConcurrentMode=function(e){return T||(T=!0,console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")),!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),"undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),xn.exports.oneOfType([xn.exports.func,xn.exports.object]);let Gn=0;const Kn=ye.useId;function Qn(e){if(void 0!==Kn){const t=Kn();return null!=e?e:t}return function(e){const[t,n]=ye.useState(e),r=e||t;return ye.useEffect((()=>{null==t&&(Gn+=1,n(`mui-${Gn}`))}),[t]),r}(e)}const Zn={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};const er=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};function tr(e,t,n,r){const o=e[t];if(null==o||!er(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 nr(e,t,...n){return void 0===e[t]?null:tr(e,t,...n)}function rr(){return null}nr.isRequired=tr,rr.isRequired=rr,process.env.NODE_ENV;var or=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=lt(t,["id","label","InputLabelProps","InputProps","fetching","loading","helperText","hexColor","size","fullWidth","sx"]),y=Qn(r),h=u&&y?"".concat(y,"-helper-text"):void 0,E=o&&y?"".concat(y,"-label"):void 0,g=s?((n={})["& .".concat(q.notchedOutline)]={borderColor:"".concat(s," !important")},n["& .".concat(B.root)]={color:s},n["& .".concat(q.input)]={color:s},n["& .".concat(U.root)]={color:s},n["& .".concat(H.bar)]={backgroundColor:s},n["& .".concat(Y.endAdornment," .").concat(J.root)]={color:s},n):{};return he.createElement(D,{sx:g,fullWidth:f},he.createElement(F,it({size:"small"===d?"small":"normal",id:E,htmlFor:y},a),o),he.createElement(X,it({},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))},ar=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=lt(e,["label","loading","fetching","options","helperText","color","onChangeValue","sx"]),d=n||r;return he.createElement(K,it({loading:d,options:r?[]:o,onChange:function(e,t){return c(t)}},s,{renderInput:function(e){return he.createElement(or,it({},e,{label:t,fullWidth:!0,fetching:r,loading:n,hexColor:i,helperText:a}))},sx:u}))};function ir(e){var t=e.children,r=e.index,o=zt()[0],a=o===r;return Array.isArray(r)&&(a=r.includes(o)),he.createElement("div",{role:"tabpanel",hidden:!a,id:"simple-tabpanel-".concat(r),"aria-labelledby":"simple-tab-".concat(r)},a&&he.createElement(n,{sx:{p:3}},t))}var lr=w(b)((function(e){var t,n=e.theme;return(t={})["&.".concat(Q.root)]={backgroundColor:n.palette.grey[100]},t})),cr=function(e){var t=e.children,n=e.tabs,r=zt(),o=r[0],a=r[1];return he.createElement(l,null,he.createElement(lr,{value:o,onChange:function(e,t){return a(t)}},n.map((function(e){return he.createElement(x,{key:e,label:e})}))),t)},ur=function(e){var t=e.order,r=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:r===e.id&&t,sx:{fontWeight:"bold"}},e.sort?he.createElement(ne,{active:r===e.id,direction:r===e.id?t:"asc",onClick:(o=e.id,function(){a(o)})},e.label,r===e.id?he.createElement(n,{component:"span",sx:Zn},"desc"===t?"sorted descending":"sorted ascending"):null):e.label);var o}))))};function sr(e,t,n){return t[n]<e[n]?-1:t[n]>e[n]?1:0}var dr=function(t){var r=t.children,o=t.data,i=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=Ee(""),v=p[0],y=p[1],h=Ee(s),E=h[0],g=h[1],b=Ee(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 sr(e,n,t)}:function(e,n){return-sr(e,n,t)}}(E,x));return he.createElement(he.Fragment,null,he.createElement(n,{sx:{paddingX:1,paddingBottom:2}},i&&he.createElement(n,{paddingY:2},he.createElement(a,{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(ur,{order:E,orderBy:x,headCells:l,onRequestSort:function(e){g(x===e&&"asc"===E?"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")):r(S))))))};dr.defaultProps={defaultOrder:"asc"};var mr,fr=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=Ee({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(ur,{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)}))))))},pr=function(e){var o=e.title,a=e.subtitle,i=e.icon,l=e.iconSize,c=void 0===l?200:l,u=e.actions;return he.createElement(n,{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center"},i&&i({size:c,color:"primary"}),he.createElement(r,{variant:"h4",role:"heading","aria-level":1},o),he.createElement(r,{variant:"subtitle1",role:"heading","aria-level":2,sx:{mt:2}},a),u&&he.createElement(n,{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)}))))},vr=function(e){var t=e.width,r=void 0===t?"100%":t,o=e.animation,a=void 0!==o&&o;return he.createElement(n,{width:r},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}))},yr=function(e){var t=e.size,n=void 0===t?20:t;return he.createElement(s,{container:!0,spacing:2},St(n,0).map((function(e,t){return he.createElement(s,{item:!0,key:t,xs:4},he.createElement(vr,{width:1}))})))},hr=function(e){var t=e.size,n=void 0===t?20:t,r=e.children,o=e.p;return he.createElement(E,{component:"main",sx:{p:o},"data-testid":"content-placeholder-test"},r,he.createElement(yr,{size:n}))},Er=function(e){var t=e.count,n=void 0===t?3:t,o=e.units,a=void 0===o?"paragraph":o,i=e.variant,l=void 0===i?"body1":i;return he.createElement(r,{variant:l},Xe({count:n,units:a}))},gr=((mr={})["& .".concat(le.message)]={width:1},mr),br=ge((function(e,t){var r=e.severity,o=e.iconMapping,a=e.title,l=e.message,c=e.metadata,u=e.onClose,s=Ee(!1),d=s[0],m=s[1];return he.createElement(f,{ref:t,severity:r,iconMapping:o,onClose:u,action:he.createElement(n,{display:"flex",flexDirection:"column"},he.createElement(i,{color:"inherit",onClick:u},he.createElement(Te,{fontSize:"small"})),c&&he.createElement(i,{color:"inherit",onClick:function(){return m((function(e){return!e}))}},d?he.createElement(Ge,{fontSize:"small"}):he.createElement(Be,{fontSize:"small"}))),sx:gr},he.createElement(n,{sx:{w:1}},a&&he.createElement(p,null,a),l,c&&he.createElement(z,{in:d,sx:{mt:2}},he.createElement(At,{content:c}))))})),xr=function(e){var r=e.open,o=e.title,a=e.component,l=e.componentProps,c=void 0===l?{}:l,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,E=e.acceptable,g=e.acceptText,b=void 0===g?"Accept":g,x=e.cancelText,w=void 0===x?"Cancel":x,S=e.onAccept,C=e.onCancel,k=void 0===C?function(){return null}:C,I=e.onClose,O=e.acceptType,$=void 0===O?"button":O,T=d.length>0||E||v;return he.createElement(ce,{open:r,onClose:I},he.createElement(ue,{sx:{display:"flex",alignItems:"center"}},o,p&&!E&&he.createElement(m,{size:20,sx:{ml:2,color:function(e){return e.palette.grey[500]}}}),he.createElement(i,{disabled:u,"aria-label":"close",onClick:I,sx:{position:"absolute",right:8,top:8,color:function(e){return e.palette.grey[500]}}},he.createElement(Te,null))),he.createElement(n,it({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&&I()}},w),E&&he.createElement(Ye,{type:$,loading:p,disabled:u,onClick:S},b))))},wr=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(xr,{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)},Sr=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(xr,{component:"form",componentProps:{onSubmit:function(e){e.preventDefault(),s(function(e){var t=new FormData(e.currentTarget),n={};return t.forEach((function(e,t){n[t]=e})),n}(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)},Cr=function(e){void 0===e&&(e=!1);var t=Ee(e),n=t[0],r=t[1];return{isOpen:n,open:function(){return r(!0)},close:function(){return r(!1)},setIsOpen:r}},kr=function(e){var t=e.drawerProviderProps,n=e.children,r=n[0],o=n[1],a=n[2];return he.createElement(Zt,it({},t),r,o,he.createElement(vn,null,a))},Ir=function(e){var t=e.loading,r=e.children,o=r[0],a=r[1];return he.createElement(Rt,null,he.createElement(n,{display:"flex",flexDirection:"column",height:1},o,t?he.createElement(vt,null):a))},Or=function(e,t){var n=e.id,r=e.name,o=e.type,a=t[n];return"boolean"===o?he.createElement(at,{label:r,value:a}):"date"===o||"time"===o||"datetime"===o?he.createElement(ut,{label:r,value:a,format:e.format}):he.createElement(rt,{label:r,value:null==a?void 0:a.toString()})},$r=function(e){var t=e.field,n=t.name,r=t.description,o=t.value,a=e.instance;return he.createElement(ft,{title:n,subtitle:r},o.map((function(e){var t=e.id,n=e.xs,r=e.sm,o=e.md,i=e.lg,l=e.xl;return he.createElement(mt,{key:t,xs:n,sm:r,md:o,lg:i,xl:l},Or(e,a))})))},Tr=function(e){var t=e.model,n=e.instance;return he.createElement(s,{container:!0,spacing:2},t.fields.map((function(e){var t=e.id,r=e.type,o=e.xs,a=void 0===o?3:o,i=e.sm,l=e.md,c=e.lg,u=e.xl;return"group"===r?he.createElement(s,{item:!0,key:t,xs:12},he.createElement($r,{field:e,instance:n[t]})):he.createElement(s,{item:!0,key:t,xs:a,sm:i,md:l,lg:c,xl:u},he.createElement(ot,null,Or(e,n)))})))},Pr={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:{}},jr=function(e,t){return t&&t[e.id]||"default"in e&&e.default||Pr[e.type]},zr=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]=jr(n,t&&t[e.id])})),n[e.id]=r}else n[e.id]=jr(e,t)})),n},Rr=function(e){var o=e.model,i=e.saveButtonText,c=e.onSubmit,u=e.initialValues,d=ke((function(){return zr(o,u)}),[o,u]),m=Ee(d),f=m[0],p=m[1],v=function(e,t,n){p((function(r){var o,a={};return t?a[t]=it(it({},r[t]),((o={})[e]=n,o)):a[e]=n,it(it({},r),a)}))},y=function(e,t,n){v(n,t,e)},h=function(e,t){void 0===t&&(t=void 0);var o,i=st({lightWeight:200,darkWeight:800}),c=e.id,u=e.type,d=e.name,m=e.description,p=e.xs,E=e.sm,g=e.md,b=e.lg,x=e.xl,w=t?f[t][c]:f[c];return o="group"===u?he.createElement(l,null,he.createElement(n,{bgcolor:i,px:2,py:1,mb:2},he.createElement(r,{variant:"h6",role:"heading","aria-level":1},d),he.createElement(r,{variant:"body2",role:"heading","aria-level":2},m)),he.createElement(s,{container:!0,spacing:2,sx:{p:2}},e.value.map((function(e){return h(e,c)})))):"boolean"===u?he.createElement(n,{sx:{height:1,display:"flex",alignItems:"center"}},he.createElement(me,{control:he.createElement(fe,{name:c,onChange:function(e){return function(e,t){e.preventDefault(),v(e.target.name,t,e.target.checked)}(e,t)},checked:w}),label:d})):"enum"===u?he.createElement(D,{fullWidth:!0},he.createElement(F,{id:"".concat(c,"-select-label")},d),he.createElement(V,{labelId:"".concat(c,"-select-label"),id:"".concat(c,"-select"),value:w,label:d,name:c,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)})))):"multienum"===u?he.createElement(D,{fullWidth:!0},he.createElement(F,{id:"".concat(c,"-select-label")},d),he.createElement(V,{labelId:"".concat(c,"-select-label"),id:"".concat(c,"-select"),value:w||[],renderValue:function(e){return e.join(", ")},label:d,name:c,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}))})))):"date"===u?he.createElement(We,{label:d,format:e.format,value:w,onChange:function(e){return y(e,t,c)}}):"time"===u?he.createElement(ze,{label:d,format:e.format,value:w,onChange:function(e){return y(e,t,c)}}):"datetime"===u?he.createElement(je,{label:d,format:e.format,value:w,onChange:function(e){return y(e,t,c)}}):he.createElement(a,{required:!0,type:u,label:d,name:c,variant:"outlined",fullWidth:!0,value:w,onChange:function(e){return function(e,t,n){e.preventDefault();var r=e.target.value;"number"===n&&"string"==typeof r&&(r=parseInt(e.target.value)),v(e.target.name,t,r)}(e,t,u)}}),he.createElement(s,{item:!0,key:c,xs:p,sm:E,md:g,lg:b,xl:x},o)};return he.createElement(s,{container:!0,component:"form",spacing:2,onSubmit:function(e){e.preventDefault(),c(f)}},o.fields.map((function(e){return h(e)})),he.createElement(s,{item:!0,xs:12},he.createElement(t,{type:"submit",variant:"contained"},i)))},Wr=function(e,t,n){var r=n.from,o=n.to,a=be(),i=Ae();xe((function(){a.current===r&&t===o&&i(e),a.current=t}),[t])},Nr=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]),Tt({title:"Item updated",message:"The item ".concat(d," has been updated successfully"),severity:"success"},!!a.success,{from:!1,to:!0}),Wr("".concat(o,"/"),!!a.success,{from:!1,to:!0}),Tt({title:"We had an error",message:a.error||"",severity:"error"},!!a.error,{from:!1,to:!0}),he.createElement(Ir,{loading:m},he.createElement(Wt,{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(Dt,null,he.createElement(Rr,{model:t,initialValues:l,saveButtonText:"Save",onSubmit:c})))},Mr=function(e){var t=e.columns,n=e.options,r=e.data,o=e.onClick,a=e.search,l=e.defaultSort,c=e.defaultOrder,u=e.loading,s=ct(ct([],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(dr,{columns:s,data:r,search:a,defaultSort:l,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(i,{"data-testid":"options-".concat(e.id),onClick:function(t){t.stopPropagation(),f({item:e,anchor:t.currentTarget})}},he.createElement(Ke,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)}))))},Ar=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,E=Ae();xe((function(){y()}),[]),Tt({title:"Item deleted",message:"The item has been deleted successfully",severity:"success"},!!a.success,{from:!1,to:!0}),Tt({title:"We had an error",message:a.error||"",severity:"error"},!!a.error,{from:!1,to:!0});var g=v?function(e){E("".concat(l,"/").concat(e.id))}:void 0,b=function(e,t){"edit"===e?E("".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(Ir,{loading:o.loading||a.loading},he.createElement(Wt,{title:n,preset:"default",actions:w.length>0?w:void 0}),he.createElement(Dt,null,he.createElement(Mr,{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:g,options:x.length>0?x:void 0})))},Dr=function(e){var t=e.model,n=e.modelName,r=e.basePath,o=void 0===r?"":r,a=e.onSubmitNewItem,i=e.newItemRequest;return Tt({message:"Item added successfully",severity:"success"},!!i.success,{from:!1,to:!0}),Wr("".concat(o,"/"),!!i.success,{from:!1,to:!0}),Tt({title:"We had an error",message:i.error||"",severity:"error"},!!i.error,{from:!1,to:!0}),he.createElement(Ir,{loading:i.loading},he.createElement(Wt,{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(Dt,null,he.createElement(Rr,{model:t,saveButtonText:"Save",onSubmit:a})))},Fr=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(Ir,{loading:i.loading},he.createElement(Wt,{title:u,preset:"default",breadcrumbs:[{id:"list",text:n,link:"".concat(o,"/")},{id:"detail",text:u,link:"".concat(o,"/").concat(u)}]}),he.createElement(Dt,null,l&&he.createElement(Tr,{model:t,instance:l})))},Vr=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(Ar,it({},e))}),i&&he.createElement(Ve,{path:":id",element:he.createElement(Fr,it({},e))}),o&&he.createElement(Ve,{path:"add",element:he.createElement(Dr,it({},e))}),n&&he.createElement(Ve,{path:":id/update",element:he.createElement(Nr,it({},e))}))},_r={idle:!0},Lr={loading:!0},qr={success:!0};export{ar as Autocomplete,At as Board,xr as BootstrapDialog,Et as Bullet,Ft as CenterContainer,wr as ConfirmDialog,Dt as Content,hr as ContentPlaceholder,et as DefaultPlaceholder,Gt as Drawer,mn as DrawerAppBar,un as DrawerContent,Vt as DrawerContext,Ut as DrawerHeader,kr as DrawerLayout,vn as DrawerMain,Zt as DrawerProvider,cn as DrawerSection,en as DrawerSubheader,fr as EnhancedRemoteTable,dr as EnhancedTable,ur as EnhancedTableHead,br as ExpandableAlert,Sr as FormDialog,ft as GroupValueCard,mt as GroupValueItem,Wt as Header,Ir as HeaderLayout,_r as IdleRequest,bt as Label,vt as LoadingArea,Lr as LoadingRequest,Er as LoremIpsumPlaceholder,Mt as Markdown,Rr as ModelForm,Vr as ModelRouter,It as NotificationCenterContext,$t as NotificationCenterProvider,kt as NotificationCenterProviderUndefinedError,Tr as ObjectDetails,pr as Placeholder,yt as QueryContainer,hn as Select,En as SignIn,vr as SkeletonCard,yr as SkeletonGrid,qr as SuccessRequest,cr as TabCard,Pt as TabContext,jt as TabContextProvider,ir as TabPanel,Rt as TabProvider,Mr as TableList,_t as UndefinedProvider,at as ValueBoolean,ot as ValueCard,ut as ValueDatetime,Qe as ValueEditButtons,pt as ValueRating,rt as ValueText,ht as bulletClasses,tn as getDrawerItemColors,Ct as getRandomItem,dt as groupValueItemClasses,gt as labelClasses,Nt as markdownDefaultOptions,St as newArrayWithSize,zr as newInstanceFromValuesOrZeroValue,Cr as useDialog,Lt as useDrawer,Ze as useEditableValueDisplay,st as useGetDefaultThemeColor,Ot as useNotificationCenter,Tt as useNotifyWhenValueChanges,zt as useTab};
|
|
24
24
|
//# sourceMappingURL=index.js.map
|