biblio-react 1.6.15 → 1.7.1

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/index.js CHANGED
@@ -1 +1 @@
1
- function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("react"),r=e(require("@material-ui/icons/Lock")),n=e(require("@material-ui/icons/VpnLock")),a=require("react-admin"),o=require("react-redux"),i=require("prop-types"),l=e(i),s=require("@material-ui/core"),c=e(require("@material-ui/core/Dialog")),u=e(require("@material-ui/core/DialogActions")),d=e(require("@material-ui/core/DialogContent")),m=e(require("@material-ui/core/DialogContentText")),p=e(require("@material-ui/core/DialogTitle")),f=e(require("@material-ui/core/Paper")),h=require("@material-ui/core/styles"),g=e(require("@material-ui/core/Typography")),v=require("@material-ui/data-grid"),b=e(require("@material-ui/icons/Add")),E=e(require("@material-ui/icons/Cancel")),y=e(require("@material-ui/icons/Delete")),C=e(require("@material-ui/icons/Edit")),x=e(require("@material-ui/core/TableContainer")),k=require("react-final-form"),S=e(require("@material-ui/core/Divider")),F=e(require("@material-ui/core/Tab")),T=e(require("@material-ui/core/Tabs")),N=e(require("@material-ui/core/styles/makeStyles")),w=e(require("@material-ui/icons/ChevronLeft")),R=e(require("date-fns/locale/en-US")),I=e(require("date-fns/locale/es")),P=e(require("moment")),q=e(require("@material-ui/core/IconButton")),M=require("@material-ui/core/styles/colorManipulator"),L=e(require("@material-ui/core/Tooltip")),D=e(require("classnames")),B=e(require("@material-ui/core/Button")),O=e(require("@material-ui/icons/Settings")),_=e(require("@material-ui/core/Collapse")),V=e(require("@material-ui/core/List")),A=e(require("@material-ui/core/ListItemIcon")),G=e(require("@material-ui/core/MenuItem")),W=e(require("@material-ui/icons/ExpandMore")),z=e(require("@material-ui/core/Avatar")),j=e(require("@material-ui/core/Card")),H=e(require("@material-ui/core/CardActions")),U=e(require("@material-ui/core/CircularProgress")),J=e(require("@material-ui/core/TextField")),Q=require("@material-ui/styles"),Z=require("react-router-dom"),K=e(require("@material-ui/core/Menu")),Y=e(require("ra-language-english")),X=e(require("@blackbox-vision/ra-language-spanish")),$=require("react-admin-date-inputs");function ee(){return(ee=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function te(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)t.indexOf(r=o[n])>=0||(a[r]=e[r]);return a}var re=t.forwardRef(function(e,i){var l=a.useTranslate(),s=o.useSelector(function(e){return[e.admin.resources.form_275?1:0,e.admin.resources.form_59?1:0]}),c=s[1];return[s[0]?t.createElement(a.MenuItemLink,{ref:i,key:"/form_275",to:"/form_275",primaryText:l("pos.change_pin"),leftIcon:t.createElement(r,null),onClick:e.onClick}):null,c?t.createElement(a.MenuItemLink,{ref:i,key:"/form_59",to:"/form_59",primaryText:l("pos.change_password"),leftIcon:t.createElement(n,null),onClick:e.onClick}):null]}),ne=function(e){return t.createElement(a.UserMenu,e,t.createElement(re,null))},ae=function(e){return t.createElement(a.AppBar,ee({},e,{elevation:1,userMenu:t.createElement(ne,null)}))},oe=function(e,t){return a.useGetOne(e,"-1",t)},ie=h.makeStyles(function(e){return{root:{"& .MuiDataGrid-columnsContainer":{backgroundColor:"light"===e.palette.type?"#fafafa":"#1d1d1d"},"& .MuiDataGrid-iconSeparator":{display:"none"}},header:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.light},rootPaper:{width:"100%",height:"40vh",borderRadius:0,marginTop:e.spacing(1)},rootOverlay:{flexDirection:"column","& .ant-empty-img-1":{fill:"light"===e.palette.type?"#aeb8c2":"#262626"},"& .ant-empty-img-2":{fill:"light"===e.palette.type?"#f5f5f7":"#595959"},"& .ant-empty-img-3":{fill:"light"===e.palette.type?"#dce0e6":"#434343"},"& .ant-empty-img-4":{fill:"light"===e.palette.type?"#ffffff":"#1c1c1c"},"& .ant-empty-img-5":{fillOpacity:"light"===e.palette.type?"0.8":"0.08",fill:"light"===e.palette.type?"#f5f5f5":"#ffffff"}},label:{marginTop:e.spacing(1)},deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:s.alpha(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}},{name:"GE"}),le=function(){var e=ie();return t.createElement(v.GridOverlay,{className:e.rootOverlay},t.createElement("svg",{width:"120",height:"100",viewBox:"0 0 184 152","aria-hidden":!0,focusable:"false"},t.createElement("g",{fill:"none",fillRule:"evenodd"},t.createElement("g",{transform:"translate(24 31.67)"},t.createElement("ellipse",{className:"ant-empty-img-5",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),t.createElement("path",{className:"ant-empty-img-1",d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z"}),t.createElement("path",{className:"ant-empty-img-2",d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z"}),t.createElement("path",{className:"ant-empty-img-3",d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z"})),t.createElement("path",{className:"ant-empty-img-3",d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z"}),t.createElement("g",{className:"ant-empty-img-4",transform:"translate(149.65 15.383)"},t.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),t.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"})))),t.createElement("div",{className:e.label},"No hay registros"))},se=function(e,t,r){return a.useMutation({type:"deleteEtrRow",resource:e,payload:{params:t}},r)},ce=function(e,t,r,n){return a.useMutation({type:e,resource:t,payload:{params:r}},n)},ue=["api","basePath","classes","className","confirmTitle","confirmContent","icon","record","redirect","onSuccess","onFailure","source","camposClaveFila"],de=["filterBy","claves","sortModel","columns","reference","allowAdd","allowRemove","etrResource","enableLoad"],me=h.makeStyles(function(e){return{root:{"& .MuiDataGrid-columnsContainer":{backgroundColor:"light"===e.palette.type?"#fafafa":"#1d1d1d"},"& .MuiDataGrid-iconSeparator":{display:"none"}},header:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.light},rootPaper:{width:"100%",height:"40vh",borderRadius:0,marginTop:e.spacing(1)},rootOverlay:{flexDirection:"column","& .ant-empty-img-1":{fill:"light"===e.palette.type?"#aeb8c2":"#262626"},"& .ant-empty-img-2":{fill:"light"===e.palette.type?"#f5f5f7":"#595959"},"& .ant-empty-img-3":{fill:"light"===e.palette.type?"#dce0e6":"#434343"},"& .ant-empty-img-4":{fill:"light"===e.palette.type?"#ffffff":"#1c1c1c"},"& .ant-empty-img-5":{fillOpacity:"light"===e.palette.type?"0.8":"0.08",fill:"light"===e.palette.type?"#f5f5f5":"#ffffff"}},label:{marginTop:e.spacing(1)},deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:s.alpha(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}},{name:"EtrGrid"}),pe={marginLeft:"1.6rem",fontWeight:"bold"},fe=t.createElement(y,null),he=function(e){var r=e.basePath,n=e.confirmTitle,o=void 0===n?"ra.message.delete_title":n,i=e.confirmContent,l=void 0===i?"ra.message.delete_content":i,s=e.icon,c=void 0===s?fe:s,u=e.record,d=e.redirect,m=void 0!==d&&d,p=e.onSuccess,f=e.onFailure,h=e.source,g=e.camposClaveFila,v=te(e,ue),b=me(e),E=a.useNotify(),y=a.useDeleteWithConfirmController({record:u,redirect:m,basePath:r,onSuccess:p,onFailure:f}),C=y.open,x=y.loading,k=y.handleDialogOpen,S=y.handleDialogClose,F=se(e.resource,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);E("ra.notification.deleted","info",{smart_count:1})},onFailure:function(e){E(e.message,"warning")}})[0],T=Object.keys(u).filter(function(e){return g.split(",").includes(e)}).reduce(function(e,t){return e[t]=u[t],e},{}),N=t.useCallback(function(e){F({payload:{ge:h,clavesFila:T}})},[u]);return t.createElement(t.Fragment,null,t.createElement(a.Button,ee({key:"button",onClick:k,className:b.deleteButton},v),c),t.createElement(a.Confirm,{isOpen:C,loading:x,title:o,content:l,onConfirm:N,onClose:S}))},ge=function(e){return t.createElement(c,{open:e.open,onClose:e.onClose,fullWidth:!0},t.createElement(p,null,e.labelEstado+" "+e.label),t.createElement(m,null,t.createElement(g,{component:"span",display:"block",variant:"subtitle1",style:ee({},pe)},e.msgTitle),e.msgDesc),t.createElement(a.FormWithRedirect,{resource:e.resource,save:e.save,render:e.render,initialValues:e.initialValues}))};ge.propTypes={label:i.string,onClick:i.func,icon:i.any,open:i.bool,onClose:i.func,labelEstado:i.string,msgTitle:i.any,msgDesc:i.any,resource:i.any,save:i.func,render:i.func};var ve=function(e){return t.createElement(he,{api:!0,confirmTitle:"ra.action.delete",source:e.source,record:e.row,resource:e.resource,camposClaveFila:e.camposClaveFila})},be=function(e){var r=e.editors,n=e.record,o=e.clavesFila,i=e.camposClaveFila,l=e.resource,s=e.label,c=e.source,m=e.etrResource,p=a.useSafeSetState(!1),f=p[0],h=p[1],g=oe(m,{enabled:f}).data,v=ce("createEtrRow",l,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);h(!1),x("ra.notification.created","info")},onFailure:function(e){x(e.message,"warning")}}),y=v[0],C=v[1].loading,x=a.useNotify(),k=a.useTranslate()("ra.action.create"),S=function(e){y({payload:{data:ee({},e,o),ge:c,camposClaveFila:i,estado:"N"}})},F=t.useMemo(function(){return{save:S,setOnFailure:function(e){return console.log(e)}}},[S]);return t.createElement(t.Fragment,null,t.createElement(a.Button,{onClick:function(e){h(!0),e.stopPropagation()}},t.createElement(b,null)),t.createElement(a.SaveContextProvider,{value:F},t.createElement(ge,{open:f,onClose:function(e){h(!1),e.stopPropagation()},labelEstado:k,label:s,msgTitle:e.msgTitle,msgDesc:e.msgDesc,resource:l,save:S,initialValues:g,render:function(e){var o=e.handleSubmitWithRedirect,i=e.pristine,s=e.saving;return t.createElement(t.Fragment,null,t.createElement(d,null,t.Children.map(r,function(e,r){return t.cloneElement(e,{resource:l,estado:"N",initialValue:n[e.props.source],fullWidth:!0,disabled:void 0!==e.props.disabled&&e.props.disabled,InputLabelProps:{shrink:!0}})})),t.createElement(u,null,t.createElement(a.SaveButton,{handleSubmitWithRedirect:o,pristine:i,saving:s,disabled:C}),t.createElement(a.Button,{label:"ra.action.cancel",onClick:function(e){h(!1),e.stopPropagation()},disabled:C},t.createElement(E,null))))}})))},Ee=function(e){var r=e.editors,n=e.clavesFila,o=e.camposClaveFila,i=e.resource,l=e.label,s=e.source,c=e.row,m=a.useNotify(),p=a.useTranslate(),f=a.useSafeSetState(!1),h=f[0],g=f[1],v=ce("updateEtrRow",i,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);g(!1),m("ra.notification.updated","info",{smart_count:1})},onFailure:function(e){m(e.message,"warning")}}),b=v[0],y=v[1].loading,x=p("ra.action.edit");return t.createElement(t.Fragment,null,t.createElement(a.Button,{onClick:function(e){g(!0),e.stopPropagation()}},t.createElement(C,null)),t.createElement(ge,{open:h,onClose:function(e){g(!1),e.stopPropagation()},labelEstado:x,label:l,msgTitle:e.msgTitle,msgDesc:e.msgDesc,resource:i,save:function(e){b({payload:{data:ee({},n,e),ge:s,camposClaveFila:o,estado:"M"}})},render:function(e){var n=e.handleSubmitWithRedirect,l=e.pristine,s=e.saving;return t.createElement(t.Fragment,null,t.createElement(d,null,t.Children.map(r,function(e,r){return t.cloneElement(e,{resource:i,estado:"M",initialValue:c[e.props.source],fullWidth:!0,disabled:-1!=o.indexOf(e.props.source),InputLabelProps:{shrink:!0}})})),t.createElement(u,null,t.createElement(a.SaveButton,{handleSubmitWithRedirect:n,pristine:l,saving:s,disabled:y}),t.createElement(a.Button,{label:"ra.action.cancel",onClick:function(e){g(!1),e.stopPropagation()},disabled:y},t.createElement(E,null))))}}))},ye=s.createTheme({},v.esES),Ce=["filterBy","sortModel","columns","reference","filter","enableLoad"],xe=s.createTheme({},v.esES),ke=t.createContext(),Se=function(e){var r=e.children,n=t.useState(!1),a=n[0],o=n[1],i=t.useMemo(function(){return{open:a,show:function(){return o(!0)},hide:function(){return o(!1)}}},[a]);return t.createElement(ke.Provider,{value:i},r)},Fe=function(){return t.useContext(ke)},Te=function(e,t,r,n){return a.useMutation({type:"getJson",resource:e,payload:{method:t,params:r}},n)},Ne=function(e){var r=Te(e),n=r[0],a=r[1].loading;return[t.useCallback(function(e,t,r){return n({payload:{params:t,method:e}},{returnPromise:!0,onSuccess:r,onFailure:r})},[]),a]},we=function(e,t,r,n){return{type:"RELOAD_CB",payload:{id:e,method:t,params:r,callback:n}}},Re=function(e,t){return{type:"RELOAD_CB_SUCCESS",payload:{id:e,callback:t}}},Ie=function(e,t){return{type:"HIDE_INPUT",payload:{id:e,hidden:t}}},Pe=function(e,t){return{type:"DISABLE_INPUT",payload:{id:e,disabled:t}}},qe=function(e,t){return{type:"REQUIRE_INPUT",payload:{id:e,required:t}}},Me=function(){var e=o.useDispatch();return t.useCallback(function(t,r,n,a){e(we(t,r,n,a))},[e])},Le=function(){var e=o.useDispatch();return t.useCallback(function(t,r){e(Ie(t,r))},[e])},De=function(){var e=o.useDispatch();return t.useCallback(function(t,r){e(Pe(t,r))},[e])},Be=function(){var e=o.useDispatch();return t.useCallback(function(t,r){e(qe(t,r))},[e])},Oe=function(e){return{}},_e=function(e){var t=a.useListContext(e),r=a.useNotify(),n=a.useRedirect(),o=a.useRefresh(),i=a.useUnselectAll(e.resource);return{ajax:Ne(e.resource)[0],data:t,notify:r,redirect:n,refresh:o,unselectAll:i}},Ve=function(e){var t=Me(),r=Le(),n=De(),o=Be(),i=Fe(),l=a.useNotify(),s=a.useRedirect();return{ajax:Ne(e.resource)[0],notify:l,redirect:s,recargarComboBox:t,progress:i,setHidden:r,setDisable:n,setRequire:o}},Ae=function(e){var t=Me(),r=Le(),n=De(),o=Be(),i=Fe(),l=a.useNotify(),s=a.useRedirect();return{form:k.useForm(),ajax:Ne(e.resource)[0],notify:l,redirect:s,recargarComboBox:t,progress:i,setHidden:r,setDisable:n,setRequire:o}},Ge=["isRowEditable"],We=["isRowEditable","primaryText","secondaryText","desktopSize","onRenderGrilla","onLoadGrilla","hasEdit"],ze=h.makeStyles(function(e){return{container:{maxHeight:"70vh"},rowOdd:{backgroundColor:e.palette.action.hover}}},{name:"GrillaEtriek"}),je=function(e,t){return void 0===t||"function"==typeof t&&t(e)},He=function(e){var r=e.isRowEditable,n=te(e,Ge);return je(e.record,r)?t.createElement(a.EditButton,n):null},Ue=function(e){!function(e){var r=e.onRenderGrilla,n=e.onLoadGrilla,o=a.useVersion(),i=_e(e);t.useEffect(function(){r&&r(i)},[]),t.useEffect(function(){n&&n(i)},[o])}(e);var r=s.useMediaQuery(function(e){return e.breakpoints.down("sm")}),n=ze(e),o=a.useResourceDefinition(e).hasEdit,i=e.isRowEditable,l=e.primaryText,c=e.secondaryText,u=e.desktopSize,d=void 0!==u&&u,m=te(e,We),p=e.children,f=t.Children.count(e.children),h=l,g=c;return l||(f>=4||f>=3||f>=2?h=function(e){return e[p[0].props.source]+" - "+e[p[1].props.source]}:1==f&&(h=function(e){return e[p[0].props.source]})),c||(f>=4?g=function(e){return e[p[2].props.source]+" - "+e[p[3].props.source]}:f>=3?g=function(e){return e[p[2].props.source]}:f>=2?h=function(e){return e[p[0].props.source]+" - "+e[p[1].props.source]}:1==f&&(h=function(e){return e[p[0].props.source]})),r&&!1===d?t.createElement(a.SimpleList,{linkType:function(e){return!(!o||!je(e,i))&&"edit"},primaryText:h,secondaryText:g}):t.createElement(x,{className:n.container},t.createElement(a.Datagrid,ee({stickyHeader:!0},m),t.Children.map(p,function(e){return e.props.hidden?null:e}),o&&t.createElement(He,{isRowEditable:i})))},Je=["ids"],Qe=["filterValues","setFilters","tabs","GridComponent"],Ze=["useFormulario"],Ke=function(e){var t=e.useFormulario;return{fichaProps:(void 0===t?Oe:t)(te(e,Ze))}},Ye=["basePath","className","record","hasEdit","hasShow","hasList","resource","totalPages","showFilter","setSort","setPerPage","perPage","defaultTitle","setPage","setFilters","selectedIds","onUnselectItems","onToggleItem","loaded","loading","exporter","hideFilter","hasCreate","filterValues","displayedFilters","currentSort"],Xe=["children","basePath","className","data","hasShow","hasList"],$e=function(e){return e.split("_")[1]},et=N(function(e){var t;return{form:{maxHeight:"70vh",overflow:"auto"},tab:{display:"block",maxHeight:"65vh",overflow:"auto"},contenido:(t={},t[e.breakpoints.up("md")]={width:"20vw"},t)}}),tt=a.required(),rt=[tt,a.minValue(1)],nt=t.createContext({}),at=["useFormulario","enableLoad"],ot=function(e){var r=e.enableLoad,n=void 0===r||r,o=te(e,at),i=a.useResourceContext(e),l=oe(i,{enabled:n}),s=l.data,c=l.loading,u=Ke(e).fichaProps,d=t.useMemo(function(){return{estado:"N",initialValues:s,loading:c,fichaProps:u}},[s,c,u]);return t.createElement(Se,null,t.createElement(nt.Provider,{value:d},t.createElement(a.Create,ee({},o,null==u?void 0:u.panel))))};ot.propTypes={useFormulario:l.func};var it=["basePath","classes","filterValues","handleSubmit","handleSubmitWithRedirect","invalid","label","pristine","resource","saving","selectedIds","submitOnEnter","redirect"],lt=["resource","record","basePath","redirect","className","icon","label"],st=h.makeStyles(function(e){return{deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:M.alpha(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}}),ct=function(e){var r=st(e),n=a.useTranslate(),o=e.resource,i=e.record,l=e.className,s=e.icon,c=e.label,u=void 0===c?"ra.action.delete":c,d=te(e,lt),m=a.useDelete(o,i.id),p=m[0],f=m[1].loading;return t.createElement(L,{title:n("ra.action.delete")},t.createElement(q,ee({disabled:f,onClick:p,label:u,className:D("ra-delete-button",r.deleteButton,l),key:"button"},te(d,it)),s))};ct.defaultProps={redirect:"list",icon:t.createElement(y,null)};var ut=["useFormulario"],dt=h.makeStyles(function(e){return{snackbarContent:{whiteSpace:"pre-wrap"}}}),mt=function(e){var r=dt(e);return t.createElement(a.Notification,ee({},e,{className:r.snackbarContent}))},pt=N(function(e){return{button:{margin:e.spacing(1)},input:{display:"none"}}}),ft=t.forwardRef(function(e,r){var n=e.isOpen,a=e.onConfirm,o=e.onClose,i=e.title,l=e.dialogText,s=e.children,f=e.hasAccept,h=void 0===f||f,g=e.hasCancel,v=void 0===g||g,b=e.loading,E=void 0!==b&&b,y=pt(e),C=function(e){o&&o(e)};return t.createElement(c,{ref:r,open:n,fullWidth:!0,onClose:C,"aria-labelledby":"form-dialog-title"},t.createElement(p,{id:"form-dialog-title"},i),t.createElement(d,null,t.createElement(m,null,l),s),(h||v)&&t.createElement(u,null,v&&t.createElement(B,{onClick:C,variant:"contained",color:"secondary",className:y.button,disabled:E},"Cancelar"),h&&t.createElement(B,{onClick:function(e){a&&a(e)},variant:"contained",color:"primary",className:y.button,disabled:E},"Ok")))}),ht=N(function(e){return{block:{pointerEvents:"none",backgroundColor:"#ffffff",opacity:.6,position:"relative"},progress:{position:"absolute",left:"50%",top:"50%"}}}),gt=function(e){var r=ht(e),n=Fe(),o=a.useResourceContext(e),i=t.useContext(nt),l=i.estado,c=i.loading,u=i.fichaProps,d=Ae({resource:o});return t.useEffect(function(){u.onRenderFicha&&u.onRenderFicha(d,l)},[]),t.useEffect(function(){c||u.onLoadFicha&&u.onLoadFicha(d,l)},[c]),t.createElement(a.CardContentInner,{className:n.open?r.block:""},n.open&&t.createElement(s.CircularProgress,{className:r.progress,thickness:4,size:50}),e.children)},vt=function(e){return t.createElement(gt,e)},bt=["mutators"],Et={setError:function(e,t){t.fields[e[0]].data=e[1]}},yt=function(e){var r=t.useContext(nt),n=r.initialValues,o=r.fichaProps,i=o.onBeforeSubmitFicha,l=o.config,s=(l=void 0===l?{}:l).mutators,c=void 0===s?{}:s,u=te(l,bt),d=c===Et?c:ee({},Et,c),m=Ve(e),p=a.useNotify(),f=t.useCallback(function(t,r,n){var a=i&&i(ee({form:{values:t}},m),"N");return"string"==typeof a?void p(a,"warning"):void 0===a||a?e.save(t,r,n):void 0},[i,m]);return t.createElement(a.FormWithRedirect,ee({},e,u,{save:f,mutators:d,initialValues:n,render:function(e){return t.createElement(a.SimpleFormView,ee({component:vt},e))}}))};yt.propTypes=ee({},a.SimpleForm.propTypes),yt.defaultProps={margin:"normal",variant:"outlined"};var Ct=h.makeStyles(function(e){return{icon:{minWidth:e.spacing(5)},sidebarIsOpen:{paddingLeft:25,transition:"padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms"},sidebarIsClosed:{paddingLeft:0,transition:"padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms"}}}),xt=function(e){var r=e.handleToggle,n=e.sidebarIsOpen,o=e.isOpen,i=e.name,l=e.icon,s=e.children,c=e.dense,u=a.useTranslate(),d=Ct(),m=t.createElement(G,{dense:c,button:!0,onClick:r},t.createElement(A,{className:d.icon},o?t.createElement(W,null):l),t.createElement(g,{variant:"inherit",color:"textSecondary"},u(i)));return t.createElement(t.Fragment,null,n||o?m:t.createElement(L,{title:u(i),placement:"right"},m),t.createElement(_,{in:o,timeout:"auto",unmountOnExit:!0},t.createElement(V,{dense:c,component:"div",disablePadding:!0,className:n?d.sidebarIsOpen:d.sidebarIsClosed},s),t.createElement(S,null)))},kt=["items","translate"],St={marginTop:"1.5em"},Ft=function(e){var r=e.onMenuClick,n=e.dense,i=e.logout,l=a.useTranslate(),c=t.useState({mnuPrueba:!1}),u=c[0],d=c[1],m=s.useMediaQuery(function(e){return e.breakpoints.down("sm")}),p=s.useMediaQuery(function(e){return e.breakpoints.down("xs")}),f=o.useSelector(function(e){return e.admin.ui.sidebarOpen}),h=function e(r){var n=r.items,o=r.translate,i=te(r,kt),l=i.state,s=i.onMenuClick,c=i.handleToggle,u=i.dense,d=i.open;return n&&t.createElement(t.Fragment,null,n.map(function(r){var n=r.name,m=r.menu,p=r.label;return m?t.createElement(xt,{key:n,name:p,handleToggle:function(){return c(n)},isOpen:l[n],sidebarIsOpen:d,icon:t.createElement(O,null),dense:u},e(ee({items:m,translate:o},i))):t.createElement(a.MenuItemLink,{key:n,to:"/"+n,primaryText:o("resources."+n+".name",{_:p}),onClick:s,sidebarIsOpen:d,dense:u,leftIcon:t.createElement(O,null)})}))}({items:JSON.parse(localStorage.getItem("menus")),handleToggle:function(e){d(function(t){var r;return ee({},t,((r={})[e]=!t[e],r))})},state:u,activeClassName:"",iconClass:"",className:"",open:f,dense:n,onMenuClick:r,translate:l});return t.createElement(a.Menu,{style:St},t.createElement(a.DashboardMenuItem,{primaryText:l("ra.page.dashboard"),onClick:r,sidebarIsOpen:f}),h,p&&t.createElement(a.MenuItemLink,{to:"/configuration",primaryText:l("pos.configuration"),leftIcon:t.createElement(O,null),onClick:r,sidebarIsOpen:f,dense:n}),p&&i,!p&&m&&i)},Tt=ee({},a.defaultTheme);Tt.palette.type="dark",Tt.overrides.RaSidebar={drawerPaper:{position:"sticky"}},Tt.overrides.RaRichTextInput={"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}};var Nt=ee({},a.defaultTheme);Nt.palette.type="light",Nt.overrides.RaSidebar={drawerPaper:{position:"sticky"}},Nt.overrides.RaRichTextInput={"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}};var wt={__proto__:null,lightTheme:Nt,darkTheme:Tt},Rt=["apiFolder"],It=function(e){return t.createElement(a.Sidebar,e)},Pt=["className","exporter","filters","children"],qt=["meta","input","render"],Mt=h.makeStyles(function(e){return{main:{display:"flex",flexDirection:"column",minHeight:"100vh",alignItems:"center",justifyContent:"flex-start",backgroundImage:function(e){return e.loginBackgroundImage},backgroundRepeat:"no-repeat",backgroundSize:"cover"},card:{minWidth:300,marginTop:"6em"},avatar:{margin:"1em",display:"flex",justifyContent:"center"},avatarIcon:{backgroundColor:e.palette.secondary.main},icon:function(t){return{position:"absolute",left:e.spacing(14-Math.ceil(t.textLength/2)-1)}},hint:{marginTop:"1em",display:"flex",justifyContent:"center",color:e.palette.grey[500]},form:{padding:"0 1em 1em 1em"},input:{marginTop:"1em"},actions:{padding:"0 1em 1em 1em"}}}),Lt=function(e){var r=e.meta,n=(r=void 0===r?{touched:!1,error:void 0}:r).touched,a=r.error,o=ee({},e.input),i=te(e,qt);return t.createElement(J,ee({error:!(!n||!a),helperText:n&&a},o,i,{fullWidth:!0}))},Dt=function(e){var n=e.loginBackgroundImage,o=e.nameSource,i=void 0===o?"username":o,l=e.passwordSource,s=void 0===l?"password":l,c=t.useState(!1),u=c[0],d=c[1],m=a.useTranslate(),p=m("ra.auth.sign_in"),f=Mt({loginBackgroundImage:n,textLength:p.length}),h=a.useNotify(),g=a.useLogin(),v=Z.useLocation();return t.createElement(k.Form,{onSubmit:function(e){d(!0),g(e,v.state?v.state.nextPathname:"/").catch(function(e){d(!1),h("string"==typeof e?e:void 0!==e&&e.message?e.message:"ra.auth.sign_in_error","warning")})},validate:function(e){var t={};return e[i]||(t[i]=m("ra.validation.required")),e[s]||(t[s]=m("ra.validation.required")),t},render:function(e){return t.createElement("form",{onSubmit:e.handleSubmit},t.createElement("div",{className:f.main},t.createElement(j,{className:f.card},t.createElement("div",{className:f.avatar},t.createElement(z,{className:f.avatarIcon},t.createElement(r,null))),t.createElement("div",{className:f.hint},"Inicio de Sesión"),t.createElement("div",{className:f.form},t.createElement("div",{className:f.input},t.createElement(k.Field,{autoFocus:!0,name:i,component:Lt,label:m("ra.auth.username"),disabled:u})),t.createElement("div",{className:f.input},t.createElement(k.Field,{name:s,component:Lt,label:m("ra.auth.password"),type:"password",disabled:u}))),t.createElement(H,{className:f.actions},t.createElement(B,{variant:"contained",type:"submit",color:"primary",disabled:u,fullWidth:!0},u&&t.createElement(U,{className:f.icon,size:18,thickness:2}),p))),t.createElement(a.Notification,null)))}})},Bt=["displayedFilters","filterValues","showFilter"],Ot=["className","options","icon"],_t=h.makeStyles({root:{display:"inline-block"}}),Vt=["fields","className","basePath","record","textAlign","sortable"],At=["useFormulario"],Gt=["basePath","children","className","classes","component","form","handleSubmit","handleSubmitWithRedirect","invalid","mutationMode","pristine","record","redirect","resource","saving","submitOnEnter","syncWithLocation","tabs","toolbar","undoable","variant","margin"],Wt=["active","dirty","dirtyFields","dirtyFieldsSinceLastSubmit","dirtySinceLastSubmit","error","errors","hasSubmitErrors","hasValidationErrors","initialValues","modified","modifiedSinceLastSubmit","save","submitError","submitErrors","submitFailed","submitSucceeded","submitting","touched","valid","validating","values","visited","__versions"],zt=["mutators"],jt=function(e){var r=e.basePath,n=e.children,o=e.className,i=e.component,l=e.handleSubmit,c=e.handleSubmitWithRedirect,u=e.invalid,d=e.mutationMode,m=e.pristine,p=e.record,f=e.redirect,h=e.resource,g=e.saving,v=e.submitOnEnter,b=e.syncWithLocation,E=void 0===b||b,y=e.tabs,C=e.toolbar,x=e.undoable,k=e.variant,S=e.margin,F=te(e,Gt),T=Ht(e),N=Z.useRouteMatch(),w=Z.useLocation(),R=N?N.url:w.pathname,I=t.useState(0),P=I[0],q=I[1];return t.createElement("form",ee({className:D("tabbed-form",o)},Ut(F)),t.cloneElement(y,{classes:T,url:R,syncWithLocation:E,onChange:function(e,t){E||q(t)},value:P},n),t.createElement(s.Divider,null),t.createElement(i,{className:T.content},t.Children.map(n,function(e,n){if(e){var o=a.getTabFullPath(e,n,R);return t.createElement(Z.Route,{exact:!0,path:a.escapePath(o)},function(a){return t.isValidElement(e)?t.cloneElement(e,{intent:"content",classes:T,resource:h,record:p,basePath:r,hidden:E?!a.match:P!==n,variant:e.props.variant||k,margin:e.props.margin||S,value:E?o:n}):null})}})),C&&t.cloneElement(C,{basePath:r,className:"toolbar",handleSubmitWithRedirect:c,handleSubmit:l,invalid:u,mutationMode:d,pristine:m,record:p,redirect:f,resource:h,saving:g,submitOnEnter:v,undoable:x}))},Ht=h.makeStyles(function(e){return{errorTabButton:{color:e.palette.error.main},content:{paddingTop:e.spacing(1),paddingLeft:e.spacing(2),paddingRight:e.spacing(2)}}},{name:"RaTabbedForm"});jt.defaultProps={submitOnEnter:!0,tabs:t.createElement(a.TabbedFormTabs,null),toolbar:t.createElement(a.Toolbar,null),component:function(e){return t.createElement("div",{className:e.className},e.children)}};var Ut=function(e){return te(e,Wt)},Jt={setError:function(e,t){t.fields[e[0]].data=e[1]}},Qt=function(e){var r=t.useContext(nt),n=r.initialValues,o=r.fichaProps,i=o.onBeforeSubmitFicha,l=o.config,s=(l=void 0===l?{}:l).mutators,c=void 0===s?{}:s,u=te(l,zt),d=c===Jt?c:ee({},Jt,c),m=Ve(e),p=a.useNotify(),f=t.useCallback(function(t,r,n){var a=i&&i(ee({form:{values:t}},m),"N");return"string"==typeof a?void p(a,"warning"):void 0===a||a?e.save(t,r,n):void 0},[i,m]);return t.createElement(a.FormWithRedirect,ee({},e,u,{save:f,mutators:d,initialValues:n,render:function(e){return t.createElement(jt,ee({component:vt},e))}}))};Qt.defaultProps={margin:"normal",variant:"outlined",syncWithLocation:!1},Y.ra.page.empty="No records yet";var Zt=ee({},Y,{login:{id:"ID",hint:"Login",required:"Insert Username or ID",send:"Send",email:"Enter your email address",check_email:"Check your email inbox, we just send you a verification code!",must_enter_credentials:"You must first enter Username or ID",restore_password:"Restore Password",punch_in:"Punch In"},pos:{search:"Search",change_pin:"Change Pin",change_password:"Change Password",configuration:"Configuration",language:"Language",theme:{name:"Theme",light:"Light",dark:"Dark"},dashboard:{welcome:{title:"Welcome",subtitle:"Employee Management",aor_button:"Metiri WebSite"}}},validation:{greater_or_equal:"Must be greater than or equal to %{menor}"}});X.ra.notification.created="Datos guardados correctamente",X.ra.action.bulk_actions="1 seleccionado |||| %{smart_count} selecccionados",X.ra.page.dashboard="Inicio",X.ra.page.empty="Sin registros todavía",X.ra.page.invite="¿Quiere agregar uno?",X.ra.page.list="%{name}",X.ra.page.edit="Editar %{name}",X.ra.action.back="Volver";var Kt=ee({},X,{login:{id:"Cédula",hint:"Inicio de Sesión",required:"Ingrese Usuario o Cédula",email:"Ingrese su email aquí",send:"Enviar",check_email:"Revisa tu correo electrónico, te enviaremos un código de verificación!",must_enter_credentials:"Debe ingresar Nº de Usuario o Cédula y Contraseña primero",restore_password:"Restablecer Contraseña",punch_in:"Generar Marcas"},pos:{search:"Búsqueda",change_pin:"Cambiar Pin",change_password:"Cambiar Contraseña",configuration:"Configuración",language:"Lenguaje",theme:{name:"Tema Visual",light:"Light",dark:"Dark"},dashboard:{welcome:{title:"Bienvenid@",subtitle:"Gestión de Funcionarios",aor_button:"Sitio de Metiri"}}},validation:{greater_or_equal:"Debe ser mayor o igual a %{menor}"}}),Yt=["hidden"],Xt=["hidden","useContenido"],$t=["hidden"],er=function(e){var r=t.useContext(nt),n=r.estado,a=r.loading,o=r.fichaProps,i=(void 0===o?{}:o)[e.source],l=void 0===i?{}:i,s=e.hidden,c=void 0!==s&&s,u=te(e,Yt),d=l.hidden,m=l.useContenido,p=void 0===m?Oe:m,f=te(l,Xt),h=void 0!==d?d:c,g=p(ee({},u,{estado:n,hidden:h,loading:a},f)),v=g.hidden,b=te(g,$t);if(void 0===g)throw new Error("useContenido está devolviendo undefined para el contenido "+e.source+"\n Asegúrese de incluir una instrucción return al final de la función");return{propsContenido:ee({},u,f,b),hidden:void 0!==v?v:h}},tr=["onFocus","onChange","onBlur","hidden","disabled","validate"],rr=["onFocus","onBlur","onChange","hidden","disabled","useContenido","validate"],nr=["hidden","disabled","onFocus","onChnage","onBlur","validate"],ar=function(e,t,r){return"string"==typeof(null==r?void 0:r.data)?r.data:void 0},or=function(e){var r=t.useContext(nt),n=r.estado,i=r.loading,l=r.fichaProps,s=void 0===l?{}:l,c=o.useSelector(function(t){var r=t.configInputs?t.configInputs.filter(function(t){return t.id===e.source}):[];return r[0]?r[0]:null})||{},u=c.disabled,d=c.hidden,m=!0===c.required?tt:void 0,p=s[e.source],f=void 0===p?{}:p,h=e.onFocus,g=e.onChange,v=e.onBlur,b=e.hidden,E=void 0!==b&&b,y=e.disabled,C=void 0!==y&&y,x=e.validate,k=te(e,tr),S=a.useInput({source:e.source}).input,F=f.onFocus,T=f.onBlur,N=f.onChange,w=f.hidden,R=f.disabled,I=f.useContenido,P=void 0===I?Oe:I,q=f.validate,M=te(f,rr),L=void 0!==w?w:E,D=void 0!==R?R:C,B=void 0!==F?F:h,O=void 0!==T?T:v,_=void 0!==N?N:g,V=Ae(e),A=P(ee({},k,{estado:n,hidden:L,loading:i,utils:V},M)),G=t.useRef(S.value);if(void 0===A)throw new Error("useContenido está devolviendo undefined para el contenido "+e.source+"\n Asegúrese de incluir una instrucción return al final de la función");var W=A.hidden,z=A.disabled,j=A.onFocus,H=A.onChnage,U=A.onBlur,J=A.validate,Q=te(A,nr),Z=j||B,K=U||O,Y=H||_,X=ee({},V,{prev:G.current}),$=Array.isArray(x)?x:[x],re=Array.isArray(q)?q:[q],ne=Array.isArray(J)?J:[J];return{propsContenido:ee({onFocus:function(e){Z&&B(V,n,e),G.current=e.target.value},onBlur:function(e){return K&&K(X,n,e)},onChange:function(e){return Y&&Y(X,n,e)},helperText:!1,validate:[].concat($,re,ne,[ar,m]).filter(function(e){return void 0!==e})},k,M,Q,{disabled:void 0!==u?u:void 0!==z?z:D}),hidden:void 0!==d?d:void 0!==W?W:L}},ir=["callback"],lr=["helperText"],sr=["callback"],cr=function(e){var r=e.callback,n=te(e,ir),o=a.useListContext(n),i=o.loading,l=o.data;return t.useEffect(function(){i||"function"==typeof r&&r(Object.values(l))},[i]),t.createElement(a.SelectInput,n)},ur=["helperText"],dr=["helperText"],mr=["tipo"],pr=["tipo","value"];exports.AppBar=ae,exports.BooleanField=function(e){var r=er(e),n=r.propsContenido,o=r.hidden,i=JSON.parse(JSON.stringify(e.record)),l=i[e.source];return i[e.source]=""!=l&&"0"!=l,!o&&t.createElement(a.BooleanField,ee({},n,{record:i}))},exports.Camino=function(e){var r=or(e);return!r.hidden&&t.createElement(a.FileInput,ee({accept:"",maxSize:5e6},r.propsContenido),t.createElement(a.ImageField,{source:"src"}))},exports.CheckBox=function(e){var r=or(e);return!r.hidden&&t.createElement(a.BooleanInput,r.propsContenido)},exports.ComboBox=function(e){var r,n,i=or(e),l=i.propsContenido,s=i.hidden,c=t.useRef(!1),u=o.useDispatch(),d=a.useVersion(),m=l.helperText,p=te(l,lr),f=o.useSelector(function(t){var r=t.reload_cb?t.reload_cb.filter(function(t){return t.id===e.source}):[];return r[0]?r[0]:null}),h=t.useRef(f),g=null===f&&h.current?h.current:f;return g&&(r=g.callback,n=te(g,sr)),t.useEffect(function(){null!==f&&(h.current=f,u(Re(e.source)))},[JSON.stringify(f)]),t.useEffect(function(){c.current=!0},[d]),c.current?!s&&t.createElement(a.ReferenceInput,ee({},p,{perPage:250,filter:n}),t.createElement(cr,{callback:r,helperText:m,optionText:"etiqueta",optionValue:e.source})):t.createElement(a.Labeled,{id:e.id,label:e.label,source:e.source,resource:e.resource,className:e.className,isRequired:e.isRequired,meta:e.meta,input:e.input,margin:e.margin},t.createElement(a.LinearProgress,{timeout:1}))},exports.ComboBoxManual=function(e){var r=or(e);return!r.hidden&&t.createElement(a.SelectInput,r.propsContenido)},exports.CreateEtriek=ot,exports.DeleteButtonNoWarning=ct,exports.EditEtriek=function(e){var r=te(e,ut),n=a.useEditController(r),o=n.record,i=n.loading,l=Ke(e).fichaProps,s=t.useMemo(function(){return{estado:"M",initialValues:o,loading:i,fichaProps:l}},[o,i,l]);return t.createElement(Se,null,t.createElement(nt.Provider,{value:s},t.createElement(a.Edit,ee({},r,null==l?void 0:l.panel))))},exports.EtrGrid=function(e){var r=e.filterBy,n=void 0===r?"":r,o=e.claves,i=e.sortModel,l=e.columns,c=e.reference,u=e.allowAdd,d=void 0===u||u,m=e.allowRemove,p=void 0===m||m,h=e.etrResource,g=e.enableLoad,b=void 0===g||g,E=te(e,de),y=e.record,C=t.useRef(!1),x=me(e),k=a.useVersion(),S=t.useState(i)[1],F=i[0],T=F.field,N=F.sort;t.useEffect(function(){C.current=!0},[k]);var w=Object.keys(y).filter(function(e){return o.split(",").includes(e)}).reduce(function(e,t){return e[t]=y[t],e},{}),R={};n.split(",").forEach(function(e){e&&(R[e]=[{type:"string",comparison:"eq",value:y[e],field:e}])});var I=a.useGetList(c,{page:1,perPage:200},{field:T,order:N},R,{enabled:b&&C.current}),P=I.data,q=I.ids,M=I.loading,L=t.useMemo(function(){return q.map(function(e){return P[e]})},[q,P]),D=[d?{field:"BTN",headerName:"",sortable:!1,renderHeader:function(e){return t.createElement(be,ee({},E,{etrResource:h,camposClaveFila:o,clavesFila:w,api:e.api}))}}:{}].concat(l,[{field:" ",width:80,headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:function(e){return t.createElement(Ee,ee({},E,{camposClaveFila:o,clavesFila:w,api:e.api,row:e.row}))}},p?{field:" ",headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:function(e){return t.createElement(ve,ee({},E,{camposClaveFila:o,api:e.api,row:e.row}))}}:{}]),B=t.useMemo(function(){return D},[JSON.stringify(D)]);return M?t.createElement(a.Loading,null):t.createElement(f,{className:x.rootPaper},t.createElement(s.ThemeProvider,{theme:ye},t.createElement(v.DataGrid,ee({className:x.root,disableSelectionOnClick:!0,pageSize:50,hideFooter:!0,sortModel:i,rows:L,columns:B,onSortModelChange:function(e){return S(e)},components:{NoRowsOverlay:le}},E))))},exports.EtriekNotification=mt,exports.FichaActions=function(e){var r=e.children,n=e.basePath,o=e.className,i=e.data,l=e.hasShow,s=te(e,Xe);return t.createElement(a.TopToolbar,ee({className:o},te(s,Ye)),r,t.createElement(a.ListButton,{label:"ra.action.back",basePath:n,icon:t.createElement(w,null)}),l&&t.createElement(a.ShowButton,{basePath:n,record:i}))},exports.FichaContext=nt,exports.FormDialog=ft,exports.FormEtriek=yt,exports.GE=function(e){var r=e.filterBy,n=void 0===r?"":r,o=e.sortModel,i=e.columns,l=e.reference,c=e.filter,u=void 0===c?[]:c,d=e.enableLoad,m=void 0===d||d,p=te(e,Ce),h=e.record,g=t.useRef(!1),b=ie(e),E=a.useVersion(),y=t.useState(o),C=y[0],x=y[1],k=o[0],S=k.field,F=k.sort,T=t.useMemo(function(){return[].concat(i)},[JSON.stringify(i)]);t.useEffect(function(){g.current=!0},[E]);var N=[];n.split(",").forEach(function(e){e&&N.push({type:"string",comparison:"eq",value:h[e],field:e})});var w=ee({},N.concat(u)),R=a.useGetList(l,{page:1,perPage:200},{field:S,order:F},w,{enabled:m&&g.current}),I=R.data,P=R.ids,q=R.loading,M=t.useMemo(function(){return P.map(function(e){return I[e]})},[P,I]);return q?t.createElement(a.Loading,null):t.createElement(f,{className:b.rootPaper},t.createElement(s.ThemeProvider,{theme:xe},t.createElement(v.DataGrid,ee({className:b.root,disableSelectionOnClick:!0,pageSize:50,hideFooter:!0,rows:M,columns:T,sortModel:C,onSortModelChange:function(e){return x(e)},components:{NoRowsOverlay:le}},p))))},exports.GrillaEtriek=Ue,exports.ImageField=function(e){var r=e.title,n=e.source,o=e.src,i=a.useRecordContext(e);return t.createElement(z,{title:r,src:o+"/"+i[n]})},exports.Layout=function(e){var r=te(e,Rt),n=o.useSelector(function(e){return"dark"===e.theme?Tt:Nt});return t.createElement(a.Layout,ee({},r,{appBar:ae,sidebar:It,menu:Ft,theme:n,notification:mt}))},exports.ListActionsEtriek=function(e){var r=e.className,n=e.exporter,o=e.filters,i=e.children,l=te(e,Pt),s=a.useListContext(e),c=s.currentSort,u=s.displayedFilters,d=s.filterValues,m=s.basePath,p=s.selectedIds,f=s.showFilter,h=s.total,g=a.useResourceContext(l),v=a.useResourceDefinition(l).hasCreate;return t.useMemo(function(){return t.createElement(a.TopToolbar,ee({className:r},a.sanitizeListRestProps(l)),o&&t.cloneElement(o,{resource:g,showFilter:f,displayedFilters:u,filterValues:d,context:"button"}),v&&t.createElement(a.CreateButton,{basePath:m}),!1!==n&&t.createElement(a.ExportButton,{disabled:0===h,resource:g,sort:c,filterValues:d}),i)},[g,u,d,p,o,h])},exports.ListCheck=function(e){var r=or(e),n=r.propsContenido,o=r.hidden,i=t.useRef(!1),l=a.useVersion(),s=n.helperText,c=te(n,ur);return t.useEffect(function(){i.current=!0},[l]),i.current?!o&&t.createElement(a.ReferenceArrayInput,c,t.createElement(a.SelectArrayInput,{helperText:s,optionText:"etiqueta",optionValue:e.source})):t.createElement(a.Labeled,{id:e.id,label:e.label,source:e.source,resource:e.resource,className:e.className,isRequired:e.isRequired,meta:e.meta,input:e.input,margin:e.margin},t.createElement(a.LinearProgress,{timeout:1}))},exports.Login=function(e){return t.createElement(Q.ThemeProvider,{theme:h.createTheme(Nt)},t.createElement(Dt,e))},exports.Menu=Ft,exports.MenuButton=function(e){var r=e.className,n=e.options,o=void 0===n?[]:n,i=e.icon,l=te(e,Ot),s=t.useState(!1),c=s[0],u=s[1],d=t.useRef(),m=t.useState(0),p=m[0],f=m[1],h=_t(e),g=a.useResourceContext(e);return t.createElement("div",ee({className:D(h.root,r)},te(l,Bt)),t.createElement(a.Button,{className:"add-filter",label:o[p].label,onClick:function(e){e.preventDefault(),u(!0),d.current=e.currentTarget}},i),t.createElement(K,{open:c,anchorEl:d.current,onClose:function(e){d.current&&d.current.contains(e.target)||u(!1)}},o.map(function(e,r){return t.createElement(G,{key:e.label,disabled:e.disabled,selected:r===p,onClick:function(t){return function(e,t){f(t),u(!1)}(0,r)&&(null==e?void 0:e.onClick(t,r))},resource:g,title:e.label},t.createElement(a.FieldTitle,{label:e.label,resource:g}))})))},exports.MultiTextField=function(e){var r=e.fields,n=e.className,a=e.record,o=te(e,Vt),i=r.separador,l=void 0===i?"":i,s=r.secundario,c=void 0===s?[]:s,u=r.hasSecundario,d=r.campos.map(function(e){return void 0!==a[e]?a[e]:e}).join(""+l);return t.createElement(g,ee({noWrap:!0,variant:"inherit",className:n},o),d,u&&t.createElement(g,{component:"span",display:"block",color:"textSecondary",variant:"caption"},c.map(function(e){return(e.etiqueta||"---")+": "+(a[e.campo]||"---")}).join(" ")))},exports.Password=function(e){var r=or(e);return!r.hidden&&t.createElement(a.PasswordInput,r.propsContenido)},exports.RadioButton=function(e){var r=or(e),n=r.propsContenido,o=r.hidden,i=t.useRef(!1),l=a.useVersion(),s=n.helperText,c=te(n,dr);return t.useEffect(function(){i.current=!0},[l]),i.current?!o&&t.createElement(a.ReferenceInput,c,t.createElement(a.RadioButtonGroupInput,{helperText:s,optionText:"etiqueta",optionValue:e.source})):t.createElement(a.Labeled,{id:e.id,label:e.label,source:e.source,resource:e.resource,className:e.className,isRequired:e.isRequired,meta:e.meta,input:e.input},t.createElement(a.LinearProgress,null))},exports.RadioButtonManual=function(e){var r=or(e);return!r.hidden&&t.createElement(a.RadioButtonGroupInput,r.propsContenido)},exports.Separador=function(e){return t.createElement(g,{variant:"h6",gutterBottom:!0},e.children)},exports.ShowEtriek=function(e){var r=te(e,At),n=a.useShowController(r),o=n.record,i=n.loading,l=Ke(e).fichaProps,s=t.useMemo(function(){return{estado:"M",initialValues:o,loading:i,fichaProps:l}},[o,i,l]);return t.createElement(Se,null,t.createElement(nt.Provider,{value:s},t.createElement(a.Show,ee({},r,n,null==l?void 0:l.panel))))},exports.SubMenu=xt,exports.TabbedFormEtriek=Qt,exports.TabbedGrillaEtriek=function(e){var r=e.filterValues,n=e.setFilters,a=e.tabs,o=a.ids,i=te(a,Je),l=e.GridComponent,s=void 0===l?Ue:l,c=te(e,Qe),u=r.id;return t.createElement(t.Fragment,null,t.createElement(T,{value:u,indicatorColor:"primary",onChange:function(e,t){n(ee({},r,{id:t}))}},o.map(function(e){return t.createElement(F,{key:e,label:e.charAt(0).toUpperCase()+e.slice(1),value:e})})),t.createElement(S,null),t.createElement(s,ee({},c,i[u])))},exports.TextArea=function(e){var r=or(e);return!r.hidden&&t.createElement(a.TextInput,ee({multiline:!0},r.propsContenido))},exports.TextBox=function(e){var r=e.tipo,n=te(e,mr),o=or(n),i=o.propsContenido,l=o.hidden,s=k.useForm(),c=a.useInput({source:e.source}),u=c.input,d=c.meta,m="F"===r||"Z"===r;t.useEffect(function(){i.value&&(s.change(e.source,i.value),e.disabled&&s.blur(e.source))}),t.useEffect(function(){m&&""!=u.value&&d.valid&&d.modified&&!d.active&&i.onBlur()},[u.value]);var p=ee({},i);return!l&&("N"===r||"D"===r?t.createElement(a.NumberInput,p):"F"===r?t.createElement($.KeyboardDateInput,p):"Z"===r?t.createElement($.KeyboardDateTimeInput,p):t.createElement(a.TextInput,"H"===r?ee({},p,{type:"time"}):p))},exports.TextField=function(e){var r=e.tipo,n=te(e,pr),o=er(n),i=o.hidden,l=ee({},o.propsContenido);return!i&&("N"===r||"D"===r?t.createElement(a.NumberField,l):"F"===r?t.createElement(a.DateField,l):"Z"===r?t.createElement(a.DateField,ee({},l,{showTime:!0})):t.createElement(a.TextField,l))},exports.choicesEstado=[{id:"1",name:"Aprobado"},{id:"2",name:"Rechazado"},{id:"3",name:"Pendiente"}],exports.dateFormat=function(e,t){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf("/")){var r=e.split("/");return new Date(parseInt(r[2],10),parseInt(r[1],10)-1,parseInt(r[0],10)).toString()}var n=/(\d{4})-(\d{2})-(\d{2})/.exec(e);if(null!==n){var a=new Date(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10));if(!isNaN(a))return a.toString()}},exports.dateFormatOptions={format:"dd/MM/yyyy"},exports.dateParser=function(e,t){if(!e)return"";var r=e.split(" "),n="";switch(r[1]){case"Jan":n="01";break;case"Feb":n="02";break;case"Mar":n="03";break;case"Apr":n="04";break;case"May":n="05";break;case"Jun":n="06";break;case"Jul":n="07";break;case"Aug":n="08";break;case"Sep":n="09";break;case"Oct":n="10";break;case"Nov":n="11";break;case"Dec":n="12"}return r[2]+"/"+n+"/"+r[3]},exports.dateTimeFormat=function(e){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf("/")){var t=e.split("/");return new Date(parseInt(t[2].substr(0,4),10),parseInt(t[1],10)-1,parseInt(t[0],10),t[2].substr(5,2),t[2].substr(8,2)).toString()}var r=/(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2})/.exec(e);if(null!==r){var n=new Date(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10),r[4],r[5]);if(!isNaN(n))return n.toString()}},exports.dateTimeParser=function(e,t){if(!e)return"";var r=e.split(" "),n="";switch(r[1]){case"Jan":n="01";break;case"Feb":n="02";break;case"Mar":n="03";break;case"Apr":n="04";break;case"May":n="05";break;case"Jun":n="06";break;case"Jul":n="07";break;case"Aug":n="08";break;case"Sep":n="09";break;case"Oct":n="10";break;case"Nov":n="11";break;case"Dec":n="12"}return r[2]+"/"+n+"/"+r[3]+" "+r[4].substr(0,5)},exports.deleteRecargarComboBox=Re,exports.descargarLink=function(e,t){var r=document.createElement("a");r.style.display="none",document.body.appendChild(r),r.setAttribute("href",e),r.setAttribute("download",t),r.click()},exports.enMessages=Zt,exports.esMessages=Kt,exports.etrFechaMayorQue=function(e){return function(t,r){var n=r[e];if(t&&n){var a=n.split("/").reverse().join("/"),o=t.split("/").reverse().join("/");if(P(a).isAfter(o))return{message:"validation.greater_or_equal",args:{menor:n}}}}},exports.etrRequerido=tt,exports.etrRequeridoNumerico=rt,exports.getFormcodFromResource=$e,exports.localeOptions=function(e){return void 0===e&&(e="es"),{locale:"en"==e?R:I}},exports.recargarComboBox=we,exports.setDisableAction=Pe,exports.setHiddenAction=Ie,exports.setRequireAction=qe,exports.themes=wt,exports.timeFormat=function(e){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf(":")){var t=e.split(":"),r=new Date;return r.setHours(t[0]),r.setMinutes(t[1]),r.toString()}var n=/(\d{2}):(\d{2})/.exec(e);if(null!==n){var a=new Date;return a.setHours(n[0]),a.setMinutes(n[1]),a.toString()}},exports.timeParser=function(e,t){return e?e.split(" ")[4].substr(0,5):""},exports.useAjax=Ne,exports.useContenidoController=or,exports.useDeleteRowEtrGrid=se,exports.useFieldController=er,exports.useGetJson=Te,exports.useInitFicha=Ke,exports.useNuevo=oe,exports.useReferenceLabel=function(e,t){var r=a.useResourceContext();return o.useSelector(function(n){var a;return(null===(a=n.admin.resources["cb_"+$e(r)+"_"+e].data[t])||void 0===a?void 0:a.etiqueta)||""})},exports.useSaveRowEtrGrid=ce,exports.useStylesContenidos=et,exports.useUtils=Ae,exports.useUtilsGrilla=_e;
1
+ function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var t=require("react"),r=e(require("@material-ui/icons/Lock")),n=e(require("@material-ui/icons/VpnLock")),a=require("react-admin"),o=require("react-redux"),i=require("prop-types"),l=e(i),c=require("@material-ui/core"),s=e(require("@material-ui/core/Dialog")),u=e(require("@material-ui/core/DialogActions")),d=e(require("@material-ui/core/DialogContent")),m=e(require("@material-ui/core/DialogContentText")),p=e(require("@material-ui/core/DialogTitle")),f=e(require("@material-ui/core/Paper")),g=require("@material-ui/core/styles"),h=e(require("@material-ui/core/Typography")),b=require("@material-ui/data-grid"),v=e(require("@material-ui/icons/Add")),E=e(require("@material-ui/icons/Cancel")),C=e(require("@material-ui/icons/Delete")),y=e(require("@material-ui/icons/Edit")),x=e(require("@material-ui/core/TableContainer")),k=require("react-final-form"),S=e(require("@material-ui/core/Divider")),T=e(require("@material-ui/core/Tab")),F=e(require("@material-ui/core/Tabs")),N=e(require("@material-ui/core/styles/makeStyles")),P=e(require("@material-ui/icons/ChevronLeft")),R=e(require("date-fns/locale/en-US")),I=e(require("date-fns/locale/es")),w=e(require("moment")),q=e(require("@material-ui/core/IconButton")),M=require("@material-ui/core/styles/colorManipulator"),D=e(require("@material-ui/core/Tooltip")),B=e(require("classnames")),L=e(require("@material-ui/core/Button")),O=e(require("@material-ui/icons/Settings")),_=e(require("@material-ui/core/Collapse")),A=e(require("@material-ui/core/List")),V=e(require("@material-ui/core/ListItemIcon")),W=e(require("@material-ui/core/MenuItem")),G=e(require("@material-ui/icons/ExpandMore")),z=e(require("@material-ui/core/Avatar")),j=e(require("@material-ui/core/Card")),H=e(require("@material-ui/core/CardActions")),U=e(require("@material-ui/core/CircularProgress")),J=e(require("@material-ui/core/TextField")),Q=require("@material-ui/styles"),Z=require("react-router-dom"),K=e(require("@material-ui/core/Menu")),Y=e(require("ra-language-english")),X=e(require("@blackbox-vision/ra-language-spanish")),$=require("react-admin-date-inputs"),ee=e(require("@material-ui/icons/RemoveCircleOutline")),te=e(require("@material-ui/icons/Check")),re=e(require("@material-ui/icons/Search")),ne=e(require("@material-ui/icons/CheckCircle")),ae=e(require("@material-ui/icons/ErrorOutline")),oe=e(require("react-draggable")),ie=require("devextreme-react");function le(){return(le=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function ce(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)t.indexOf(r=o[n])>=0||(a[r]=e[r]);return a}var se=t.forwardRef(function(e,i){var l=a.useTranslate(),c=o.useSelector(function(e){return[e.admin.resources.form_275?1:0,e.admin.resources.form_59?1:0]}),s=c[1];return[c[0]?t.createElement(a.MenuItemLink,{ref:i,key:"/form_275",to:"/form_275",primaryText:l("pos.change_pin"),leftIcon:t.createElement(r,null),onClick:e.onClick}):null,s?t.createElement(a.MenuItemLink,{ref:i,key:"/form_59",to:"/form_59",primaryText:l("pos.change_password"),leftIcon:t.createElement(n,null),onClick:e.onClick}):null]}),ue=function(e){return t.createElement(a.UserMenu,e,t.createElement(se,null))},de=function(e){return t.createElement(a.AppBar,le({},e,{elevation:1,userMenu:t.createElement(ue,null)}))},me=function(e,t){return a.useGetOne(e,"-1",t)},pe=g.makeStyles(function(e){return{root:{"& .MuiDataGrid-columnsContainer":{backgroundColor:"light"===e.palette.type?"#fafafa":"#1d1d1d"},"& .MuiDataGrid-iconSeparator":{display:"none"}},header:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.light},rootPaper:{width:"100%",height:"40vh",borderRadius:0,marginTop:e.spacing(1)},rootOverlay:{flexDirection:"column","& .ant-empty-img-1":{fill:"light"===e.palette.type?"#aeb8c2":"#262626"},"& .ant-empty-img-2":{fill:"light"===e.palette.type?"#f5f5f7":"#595959"},"& .ant-empty-img-3":{fill:"light"===e.palette.type?"#dce0e6":"#434343"},"& .ant-empty-img-4":{fill:"light"===e.palette.type?"#ffffff":"#1c1c1c"},"& .ant-empty-img-5":{fillOpacity:"light"===e.palette.type?"0.8":"0.08",fill:"light"===e.palette.type?"#f5f5f5":"#ffffff"}},label:{marginTop:e.spacing(1)},deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:c.alpha(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}},{name:"GE"}),fe=function(){var e=pe();return t.createElement(b.GridOverlay,{className:e.rootOverlay},t.createElement("svg",{width:"120",height:"100",viewBox:"0 0 184 152","aria-hidden":!0,focusable:"false"},t.createElement("g",{fill:"none",fillRule:"evenodd"},t.createElement("g",{transform:"translate(24 31.67)"},t.createElement("ellipse",{className:"ant-empty-img-5",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),t.createElement("path",{className:"ant-empty-img-1",d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z"}),t.createElement("path",{className:"ant-empty-img-2",d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z"}),t.createElement("path",{className:"ant-empty-img-3",d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z"})),t.createElement("path",{className:"ant-empty-img-3",d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z"}),t.createElement("g",{className:"ant-empty-img-4",transform:"translate(149.65 15.383)"},t.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),t.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"})))),t.createElement("div",{className:e.label},"No hay registros"))},ge=function(e,t,r){return a.useMutation({type:"deleteEtrRow",resource:e,payload:{params:t}},r)},he=function(e,t,r,n){return a.useMutation({type:e,resource:t,payload:{params:r}},n)},be=["api","basePath","classes","className","confirmTitle","confirmContent","icon","record","redirect","onSuccess","onFailure","source","camposClaveFila"],ve=["filterBy","claves","sortModel","columns","reference","allowAdd","allowRemove","etrResource","enableLoad"],Ee=g.makeStyles(function(e){return{root:{"& .MuiDataGrid-columnsContainer":{backgroundColor:"light"===e.palette.type?"#fafafa":"#1d1d1d"},"& .MuiDataGrid-iconSeparator":{display:"none"}},header:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.light},rootPaper:{width:"100%",height:"40vh",borderRadius:0,marginTop:e.spacing(1)},rootOverlay:{flexDirection:"column","& .ant-empty-img-1":{fill:"light"===e.palette.type?"#aeb8c2":"#262626"},"& .ant-empty-img-2":{fill:"light"===e.palette.type?"#f5f5f7":"#595959"},"& .ant-empty-img-3":{fill:"light"===e.palette.type?"#dce0e6":"#434343"},"& .ant-empty-img-4":{fill:"light"===e.palette.type?"#ffffff":"#1c1c1c"},"& .ant-empty-img-5":{fillOpacity:"light"===e.palette.type?"0.8":"0.08",fill:"light"===e.palette.type?"#f5f5f5":"#ffffff"}},label:{marginTop:e.spacing(1)},deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:c.alpha(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}},{name:"EtrGrid"}),Ce={marginLeft:"1.6rem",fontWeight:"bold"},ye=t.createElement(C,null),xe=function(e){var r=e.basePath,n=e.confirmTitle,o=void 0===n?"ra.message.delete_title":n,i=e.confirmContent,l=void 0===i?"ra.message.delete_content":i,c=e.icon,s=void 0===c?ye:c,u=e.record,d=e.redirect,m=void 0!==d&&d,p=e.onSuccess,f=e.onFailure,g=e.source,h=e.camposClaveFila,b=ce(e,be),v=Ee(e),E=a.useNotify(),C=a.useDeleteWithConfirmController({record:u,redirect:m,basePath:r,onSuccess:p,onFailure:f}),y=C.open,x=C.loading,k=C.handleDialogOpen,S=C.handleDialogClose,T=ge(e.resource,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);E("ra.notification.deleted","info",{smart_count:1})},onFailure:function(e){E(e.message,"warning")}})[0],F=Object.keys(u).filter(function(e){return h.split(",").includes(e)}).reduce(function(e,t){return e[t]=u[t],e},{}),N=t.useCallback(function(e){T({payload:{ge:g,clavesFila:F}})},[u]);return t.createElement(t.Fragment,null,t.createElement(a.Button,le({key:"button",onClick:k,className:v.deleteButton},b),s),t.createElement(a.Confirm,{isOpen:y,loading:x,title:o,content:l,onConfirm:N,onClose:S}))},ke=function(e){return t.createElement(s,{open:e.open,onClose:e.onClose,fullWidth:!0},t.createElement(p,null,e.labelEstado+" "+e.label),t.createElement(m,null,t.createElement(h,{component:"span",display:"block",variant:"subtitle1",style:le({},Ce)},e.msgTitle),e.msgDesc),t.createElement(a.FormWithRedirect,{resource:e.resource,save:e.save,render:e.render,initialValues:e.initialValues}))};ke.propTypes={label:i.string,onClick:i.func,icon:i.any,open:i.bool,onClose:i.func,labelEstado:i.string,msgTitle:i.any,msgDesc:i.any,resource:i.any,save:i.func,render:i.func};var Se=function(e){return t.createElement(xe,{api:!0,confirmTitle:"ra.action.delete",source:e.source,record:e.row,resource:e.resource,camposClaveFila:e.camposClaveFila})},Te=function(e){var r=e.editors,n=e.record,o=e.clavesFila,i=e.camposClaveFila,l=e.resource,c=e.label,s=e.source,m=e.etrResource,p=a.useSafeSetState(!1),f=p[0],g=p[1],h=me(m,{enabled:f}).data,b=he("createEtrRow",l,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);g(!1),x("ra.notification.created","info")},onFailure:function(e){x(e.message,"warning")}}),C=b[0],y=b[1].loading,x=a.useNotify(),k=a.useTranslate()("ra.action.create"),S=function(e){C({payload:{data:le({},e,o),ge:s,camposClaveFila:i,estado:"N"}})},T=t.useMemo(function(){return{save:S,setOnFailure:function(e){return console.log(e)}}},[S]);return t.createElement(t.Fragment,null,t.createElement(a.Button,{onClick:function(e){g(!0),e.stopPropagation()}},t.createElement(v,null)),t.createElement(a.SaveContextProvider,{value:T},t.createElement(ke,{open:f,onClose:function(e){g(!1),e.stopPropagation()},labelEstado:k,label:c,msgTitle:e.msgTitle,msgDesc:e.msgDesc,resource:l,save:S,initialValues:h,render:function(e){var o=e.handleSubmitWithRedirect,i=e.pristine,c=e.saving;return t.createElement(t.Fragment,null,t.createElement(d,null,t.Children.map(r,function(e,r){return t.cloneElement(e,{resource:l,estado:"N",initialValue:n[e.props.source],fullWidth:!0,disabled:void 0!==e.props.disabled&&e.props.disabled,InputLabelProps:{shrink:!0}})})),t.createElement(u,null,t.createElement(a.SaveButton,{handleSubmitWithRedirect:o,pristine:i,saving:c,disabled:y}),t.createElement(a.Button,{label:"ra.action.cancel",onClick:function(e){g(!1),e.stopPropagation()},disabled:y},t.createElement(E,null))))}})))},Fe=function(e){var r=e.editors,n=e.clavesFila,o=e.camposClaveFila,i=e.resource,l=e.label,c=e.source,s=e.row,m=a.useNotify(),p=a.useTranslate(),f=a.useSafeSetState(!1),g=f[0],h=f[1],b=he("updateEtrRow",i,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);h(!1),m("ra.notification.updated","info",{smart_count:1})},onFailure:function(e){m(e.message,"warning")}}),v=b[0],C=b[1].loading,x=p("ra.action.edit");return t.createElement(t.Fragment,null,t.createElement(a.Button,{onClick:function(e){h(!0),e.stopPropagation()}},t.createElement(y,null)),t.createElement(ke,{open:g,onClose:function(e){h(!1),e.stopPropagation()},labelEstado:x,label:l,msgTitle:e.msgTitle,msgDesc:e.msgDesc,resource:i,save:function(e){v({payload:{data:le({},n,e),ge:c,camposClaveFila:o,estado:"M"}})},render:function(e){var n=e.handleSubmitWithRedirect,l=e.pristine,c=e.saving;return t.createElement(t.Fragment,null,t.createElement(d,null,t.Children.map(r,function(e,r){return t.cloneElement(e,{resource:i,estado:"M",initialValue:s[e.props.source],fullWidth:!0,disabled:-1!=o.indexOf(e.props.source),InputLabelProps:{shrink:!0}})})),t.createElement(u,null,t.createElement(a.SaveButton,{handleSubmitWithRedirect:n,pristine:l,saving:c,disabled:C}),t.createElement(a.Button,{label:"ra.action.cancel",onClick:function(e){h(!1),e.stopPropagation()},disabled:C},t.createElement(E,null))))}}))},Ne=c.createTheme({},b.esES),Pe=["filterBy","sortModel","columns","reference","filter","enableLoad"],Re=c.createTheme({},b.esES),Ie=t.createContext(),we=function(e){var r=e.children,n=t.useState(!1),a=n[0],o=n[1],i=t.useMemo(function(){return{open:a,show:function(){return o(!0)},hide:function(){return o(!1)}}},[a]);return t.createElement(Ie.Provider,{value:i},r)},qe=function(){return t.useContext(Ie)},Me=function(e,t,r,n){return a.useMutation({type:"getJson",resource:e,payload:{method:t,params:r}},n)},De=function(e){var r=Me(e),n=r[0],a=r[1].loading;return[t.useCallback(function(e,t,r){return n({payload:{params:t,method:e}},{returnPromise:!0,onSuccess:r,onFailure:r})},[]),a]},Be=function(e,t,r,n){return{type:"RELOAD_CB",payload:{id:e,method:t,params:r,callback:n}}},Le=function(e,t){return{type:"RELOAD_CB_SUCCESS",payload:{id:e,callback:t}}},Oe=function(e,t){return{type:"HIDE_INPUT",payload:{id:e,hidden:t}}},_e=function(e,t){return{type:"DISABLE_INPUT",payload:{id:e,disabled:t}}},Ae=function(e,t){return{type:"REQUIRE_INPUT",payload:{id:e,required:t}}},Ve=function(){var e=o.useDispatch();return t.useCallback(function(t,r,n,a){e(Be(t,r,n,a))},[e])},We=function(){var e=o.useDispatch();return t.useCallback(function(t,r){e(Oe(t,r))},[e])},Ge=function(){var e=o.useDispatch();return t.useCallback(function(t,r){e(_e(t,r))},[e])},ze=function(){var e=o.useDispatch();return t.useCallback(function(t,r){e(Ae(t,r))},[e])},je=function(e){return{}},He=function(e){var t=a.useListContext(e),r=a.useNotify(),n=a.useRedirect(),o=a.useRefresh(),i=a.useUnselectAll(e.resource);return{ajax:De(e.resource)[0],data:t,notify:r,redirect:n,refresh:o,unselectAll:i}},Ue=function(e){var t=Ve(),r=We(),n=Ge(),o=ze(),i=qe(),l=a.useNotify(),c=a.useRedirect();return{ajax:De(e.resource)[0],notify:l,redirect:c,recargarComboBox:t,progress:i,setHidden:r,setDisable:n,setRequire:o}},Je=function(e){var t=Ve(),r=We(),n=Ge(),o=ze(),i=qe(),l=a.useNotify(),c=a.useRedirect();return{form:k.useForm(),ajax:De(e.resource)[0],notify:l,redirect:c,recargarComboBox:t,progress:i,setHidden:r,setDisable:n,setRequire:o}},Qe=["isRowEditable"],Ze=["isRowEditable","primaryText","secondaryText","desktopSize","onRenderGrilla","onLoadGrilla","hasEdit"],Ke=g.makeStyles(function(e){return{container:{maxHeight:"70vh"},rowOdd:{backgroundColor:e.palette.action.hover}}},{name:"GrillaEtriek"}),Ye=function(e,t){return void 0===t||"function"==typeof t&&t(e)},Xe=function(e){var r=e.isRowEditable,n=ce(e,Qe);return Ye(e.record,r)?t.createElement(a.EditButton,n):null},$e=function(e){!function(e){var r=e.onRenderGrilla,n=e.onLoadGrilla,o=a.useVersion(),i=He(e);t.useEffect(function(){r&&r(i)},[]),t.useEffect(function(){n&&n(i)},[o])}(e);var r=c.useMediaQuery(function(e){return e.breakpoints.down("sm")}),n=Ke(e),o=a.useResourceDefinition(e).hasEdit,i=e.isRowEditable,l=e.primaryText,s=e.secondaryText,u=e.desktopSize,d=void 0!==u&&u,m=ce(e,Ze),p=e.children,f=t.Children.count(e.children),g=l,h=s;return l||(f>=4||f>=3||f>=2?g=function(e){return e[p[0].props.source]+" - "+e[p[1].props.source]}:1==f&&(g=function(e){return e[p[0].props.source]})),s||(f>=4?h=function(e){return e[p[2].props.source]+" - "+e[p[3].props.source]}:f>=3?h=function(e){return e[p[2].props.source]}:f>=2?g=function(e){return e[p[0].props.source]+" - "+e[p[1].props.source]}:1==f&&(g=function(e){return e[p[0].props.source]})),r&&!1===d?t.createElement(a.SimpleList,{linkType:function(e){return!(!o||!Ye(e,i))&&"edit"},primaryText:g,secondaryText:h}):t.createElement(x,{className:n.container},t.createElement(a.Datagrid,le({stickyHeader:!0},m),t.Children.map(p,function(e){return e.props.hidden?null:e}),o&&t.createElement(Xe,{isRowEditable:i})))},et=["ids"],tt=["filterValues","setFilters","tabs","GridComponent"],rt=["useFormulario"],nt=function(e){var t=e.useFormulario;return{fichaProps:(void 0===t?je:t)(ce(e,rt))}},at=["basePath","className","record","hasEdit","hasShow","hasList","resource","totalPages","showFilter","setSort","setPerPage","perPage","defaultTitle","setPage","setFilters","selectedIds","onUnselectItems","onToggleItem","loaded","loading","exporter","hideFilter","hasCreate","filterValues","displayedFilters","currentSort"],ot=["children","basePath","className","data","hasShow","hasList"],it=function(e){return e.split("_")[1]},lt=N(function(e){var t;return{form:{maxHeight:"70vh",overflow:"auto"},tab:{display:"block",maxHeight:"65vh",overflow:"auto"},contenido:(t={},t[e.breakpoints.up("md")]={width:"20vw"},t)}}),ct=a.required(),st=[ct,a.minValue(1)],ut=t.createContext({}),dt=["useFormulario","enableLoad"],mt=function(e){var r=e.enableLoad,n=void 0===r||r,o=ce(e,dt),i=a.useResourceContext(e),l=me(i,{enabled:n}),c=l.data,s=l.loading,u=nt(e).fichaProps,d=t.useMemo(function(){return{estado:"N",initialValues:c,loading:s,fichaProps:u}},[c,s,u]);return t.createElement(we,null,t.createElement(ut.Provider,{value:d},t.createElement(a.Create,le({},o,null==u?void 0:u.panel))))};mt.propTypes={useFormulario:l.func};var pt=["basePath","classes","filterValues","handleSubmit","handleSubmitWithRedirect","invalid","label","pristine","resource","saving","selectedIds","submitOnEnter","redirect"],ft=["resource","record","basePath","redirect","className","icon","label"],gt=g.makeStyles(function(e){return{deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:M.alpha(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}}),ht=function(e){var r=gt(e),n=a.useTranslate(),o=e.resource,i=e.record,l=e.className,c=e.icon,s=e.label,u=void 0===s?"ra.action.delete":s,d=ce(e,ft),m=a.useDelete(o,i.id),p=m[0],f=m[1].loading;return t.createElement(D,{title:n("ra.action.delete")},t.createElement(q,le({disabled:f,onClick:p,label:u,className:B("ra-delete-button",r.deleteButton,l),key:"button"},ce(d,pt)),c))};ht.defaultProps={redirect:"list",icon:t.createElement(C,null)};var bt=["useFormulario"],vt=g.makeStyles(function(e){return{snackbarContent:{whiteSpace:"pre-wrap"}}}),Et=function(e){var r=vt(e);return t.createElement(a.Notification,le({},e,{className:r.snackbarContent}))},Ct=N(function(e){return{button:{margin:e.spacing(1)},input:{display:"none"}}}),yt=t.forwardRef(function(e,r){var n=e.isOpen,a=e.onConfirm,o=e.onClose,i=e.title,l=e.dialogText,c=e.children,f=e.hasAccept,g=void 0===f||f,h=e.hasCancel,b=void 0===h||h,v=e.loading,E=void 0!==v&&v,C=Ct(e),y=function(e){o&&o(e)};return t.createElement(s,{ref:r,open:n,fullWidth:!0,onClose:y,"aria-labelledby":"form-dialog-title"},t.createElement(p,{id:"form-dialog-title"},i),t.createElement(d,null,t.createElement(m,null,l),c),(g||b)&&t.createElement(u,null,b&&t.createElement(L,{onClick:y,variant:"contained",color:"secondary",className:C.button,disabled:E},"Cancelar"),g&&t.createElement(L,{onClick:function(e){a&&a(e)},variant:"contained",color:"primary",className:C.button,disabled:E},"Ok")))}),xt=N(function(e){return{block:{pointerEvents:"none",backgroundColor:"#ffffff",opacity:.6,position:"relative"},progress:{position:"absolute",left:"50%",top:"50%"}}}),kt=function(e){var r=xt(e),n=qe(),o=a.useResourceContext(e),i=t.useContext(ut),l=i.estado,s=i.loading,u=i.fichaProps,d=Je({resource:o});return t.useEffect(function(){u.onRenderFicha&&u.onRenderFicha(d,l)},[]),t.useEffect(function(){s||u.onLoadFicha&&u.onLoadFicha(d,l)},[s]),t.createElement(a.CardContentInner,{className:n.open?r.block:""},n.open&&t.createElement(c.CircularProgress,{className:r.progress,thickness:4,size:50}),e.children)},St=function(e){return t.createElement(kt,e)},Tt=["mutators"],Ft={setError:function(e,t){t.fields[e[0]].data=e[1]}},Nt=function(e){var r=t.useContext(ut),n=r.initialValues,o=r.fichaProps,i=o.onBeforeSubmitFicha,l=o.config,c=(l=void 0===l?{}:l).mutators,s=void 0===c?{}:c,u=ce(l,Tt),d=s===Ft?s:le({},Ft,s),m=Ue(e),p=a.useNotify(),f=t.useCallback(function(t,r,n){var a=i&&i(le({form:{values:t}},m),"N");return"string"==typeof a?void p(a,"warning"):void 0===a||a?e.save(t,r,n):void 0},[i,m]);return t.createElement(a.FormWithRedirect,le({},e,u,{save:f,mutators:d,initialValues:n,render:function(e){return t.createElement(a.SimpleFormView,le({component:St},e))}}))};Nt.propTypes=le({},a.SimpleForm.propTypes),Nt.defaultProps={margin:"normal",variant:"outlined"};var Pt=g.makeStyles(function(e){return{icon:{minWidth:e.spacing(5)},sidebarIsOpen:{paddingLeft:25,transition:"padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms"},sidebarIsClosed:{paddingLeft:0,transition:"padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms"}}}),Rt=function(e){var r=e.handleToggle,n=e.sidebarIsOpen,o=e.isOpen,i=e.name,l=e.icon,c=e.children,s=e.dense,u=a.useTranslate(),d=Pt(),m=t.createElement(W,{dense:s,button:!0,onClick:r},t.createElement(V,{className:d.icon},o?t.createElement(G,null):l),t.createElement(h,{variant:"inherit",color:"textSecondary"},u(i)));return t.createElement(t.Fragment,null,n||o?m:t.createElement(D,{title:u(i),placement:"right"},m),t.createElement(_,{in:o,timeout:"auto",unmountOnExit:!0},t.createElement(A,{dense:s,component:"div",disablePadding:!0,className:n?d.sidebarIsOpen:d.sidebarIsClosed},c),t.createElement(S,null)))},It=["items","translate"],wt={marginTop:"1.5em"},qt=function(e){var r=e.onMenuClick,n=e.dense,i=e.logout,l=a.useTranslate(),s=t.useState({mnuPrueba:!1}),u=s[0],d=s[1],m=c.useMediaQuery(function(e){return e.breakpoints.down("sm")}),p=c.useMediaQuery(function(e){return e.breakpoints.down("xs")}),f=o.useSelector(function(e){return e.admin.ui.sidebarOpen}),g=function e(r){var n=r.items,o=r.translate,i=ce(r,It),l=i.state,c=i.onMenuClick,s=i.handleToggle,u=i.dense,d=i.open;return n&&t.createElement(t.Fragment,null,n.map(function(r){var n=r.name,m=r.menu,p=r.label;return m?t.createElement(Rt,{key:n,name:p,handleToggle:function(){return s(n)},isOpen:l[n],sidebarIsOpen:d,icon:t.createElement(O,null),dense:u},e(le({items:m,translate:o},i))):t.createElement(a.MenuItemLink,{key:n,to:"/"+n,primaryText:o("resources."+n+".name",{_:p}),onClick:c,sidebarIsOpen:d,dense:u,leftIcon:t.createElement(O,null)})}))}({items:JSON.parse(localStorage.getItem("menus")),handleToggle:function(e){d(function(t){var r;return le({},t,((r={})[e]=!t[e],r))})},state:u,activeClassName:"",iconClass:"",className:"",open:f,dense:n,onMenuClick:r,translate:l});return t.createElement(a.Menu,{style:wt},t.createElement(a.DashboardMenuItem,{primaryText:l("ra.page.dashboard"),onClick:r,sidebarIsOpen:f}),g,p&&t.createElement(a.MenuItemLink,{to:"/configuration",primaryText:l("pos.configuration"),leftIcon:t.createElement(O,null),onClick:r,sidebarIsOpen:f,dense:n}),p&&i,!p&&m&&i)},Mt=le({},a.defaultTheme);Mt.palette.type="dark",Mt.overrides.RaSidebar={drawerPaper:{position:"sticky"}},Mt.overrides.RaRichTextInput={"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}};var Dt=le({},a.defaultTheme);Dt.palette.type="light",Dt.overrides.RaSidebar={drawerPaper:{position:"sticky"}},Dt.overrides.RaRichTextInput={"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}};var Bt={__proto__:null,lightTheme:Dt,darkTheme:Mt},Lt=["apiFolder"],Ot=function(e){return t.createElement(a.Sidebar,e)},_t=["className","exporter","filters","children"],At=["meta","input","render"],Vt=g.makeStyles(function(e){return{main:{display:"flex",flexDirection:"column",minHeight:"100vh",alignItems:"center",justifyContent:"flex-start",backgroundImage:function(e){return e.loginBackgroundImage},backgroundRepeat:"no-repeat",backgroundSize:"cover"},card:{minWidth:300,marginTop:"6em"},avatar:{margin:"1em",display:"flex",justifyContent:"center"},avatarIcon:{backgroundColor:e.palette.secondary.main},icon:function(t){return{position:"absolute",left:e.spacing(14-Math.ceil(t.textLength/2)-1)}},hint:{marginTop:"1em",display:"flex",justifyContent:"center",color:e.palette.grey[500]},form:{padding:"0 1em 1em 1em"},input:{marginTop:"1em"},actions:{padding:"0 1em 1em 1em"}}}),Wt=function(e){var r=e.meta,n=(r=void 0===r?{touched:!1,error:void 0}:r).touched,a=r.error,o=le({},e.input),i=ce(e,At);return t.createElement(J,le({error:!(!n||!a),helperText:n&&a},o,i,{fullWidth:!0}))},Gt=function(e){var n=e.loginBackgroundImage,o=e.nameSource,i=void 0===o?"username":o,l=e.passwordSource,c=void 0===l?"password":l,s=t.useState(!1),u=s[0],d=s[1],m=a.useTranslate(),p=m("ra.auth.sign_in"),f=Vt({loginBackgroundImage:n,textLength:p.length}),g=a.useNotify(),h=a.useLogin(),b=Z.useLocation();return t.createElement(k.Form,{onSubmit:function(e){d(!0),h(e,b.state?b.state.nextPathname:"/").catch(function(e){d(!1),g("string"==typeof e?e:void 0!==e&&e.message?e.message:"ra.auth.sign_in_error","warning")})},validate:function(e){var t={};return e[i]||(t[i]=m("ra.validation.required")),e[c]||(t[c]=m("ra.validation.required")),t},render:function(e){return t.createElement("form",{onSubmit:e.handleSubmit},t.createElement("div",{className:f.main},t.createElement(j,{className:f.card},t.createElement("div",{className:f.avatar},t.createElement(z,{className:f.avatarIcon},t.createElement(r,null))),t.createElement("div",{className:f.hint},"Inicio de Sesión"),t.createElement("div",{className:f.form},t.createElement("div",{className:f.input},t.createElement(k.Field,{autoFocus:!0,name:i,component:Wt,label:m("ra.auth.username"),disabled:u})),t.createElement("div",{className:f.input},t.createElement(k.Field,{name:c,component:Wt,label:m("ra.auth.password"),type:"password",disabled:u}))),t.createElement(H,{className:f.actions},t.createElement(L,{variant:"contained",type:"submit",color:"primary",disabled:u,fullWidth:!0},u&&t.createElement(U,{className:f.icon,size:18,thickness:2}),p))),t.createElement(a.Notification,null)))}})},zt=["displayedFilters","filterValues","showFilter"],jt=["className","options","icon"],Ht=g.makeStyles({root:{display:"inline-block"}}),Ut=["fields","className","basePath","record","textAlign","sortable"],Jt=["useFormulario"],Qt=["basePath","children","className","classes","component","form","handleSubmit","handleSubmitWithRedirect","invalid","mutationMode","pristine","record","redirect","resource","saving","submitOnEnter","syncWithLocation","tabs","toolbar","undoable","variant","margin"],Zt=["active","dirty","dirtyFields","dirtyFieldsSinceLastSubmit","dirtySinceLastSubmit","error","errors","hasSubmitErrors","hasValidationErrors","initialValues","modified","modifiedSinceLastSubmit","save","submitError","submitErrors","submitFailed","submitSucceeded","submitting","touched","valid","validating","values","visited","__versions"],Kt=["mutators"],Yt=function(e){var r=e.basePath,n=e.children,o=e.className,i=e.component,l=e.handleSubmit,s=e.handleSubmitWithRedirect,u=e.invalid,d=e.mutationMode,m=e.pristine,p=e.record,f=e.redirect,g=e.resource,h=e.saving,b=e.submitOnEnter,v=e.syncWithLocation,E=void 0===v||v,C=e.tabs,y=e.toolbar,x=e.undoable,k=e.variant,S=e.margin,T=ce(e,Qt),F=Xt(e),N=Z.useRouteMatch(),P=Z.useLocation(),R=N?N.url:P.pathname,I=t.useState(0),w=I[0],q=I[1];return t.createElement("form",le({className:B("tabbed-form",o)},$t(T)),t.cloneElement(C,{classes:F,url:R,syncWithLocation:E,onChange:function(e,t){E||q(t)},value:w},n),t.createElement(c.Divider,null),t.createElement(i,{className:F.content},t.Children.map(n,function(e,n){if(e){var o=a.getTabFullPath(e,n,R);return t.createElement(Z.Route,{exact:!0,path:a.escapePath(o)},function(a){return t.isValidElement(e)?t.cloneElement(e,{intent:"content",classes:F,resource:g,record:p,basePath:r,hidden:E?!a.match:w!==n,variant:e.props.variant||k,margin:e.props.margin||S,value:E?o:n}):null})}})),y&&t.cloneElement(y,{basePath:r,className:"toolbar",handleSubmitWithRedirect:s,handleSubmit:l,invalid:u,mutationMode:d,pristine:m,record:p,redirect:f,resource:g,saving:h,submitOnEnter:b,undoable:x}))},Xt=g.makeStyles(function(e){return{errorTabButton:{color:e.palette.error.main},content:{paddingTop:e.spacing(1),paddingLeft:e.spacing(2),paddingRight:e.spacing(2)}}},{name:"RaTabbedForm"});Yt.defaultProps={submitOnEnter:!0,tabs:t.createElement(a.TabbedFormTabs,null),toolbar:t.createElement(a.Toolbar,null),component:function(e){return t.createElement("div",{className:e.className},e.children)}};var $t=function(e){return ce(e,Zt)},er={setError:function(e,t){t.fields[e[0]].data=e[1]}},tr=function(e){var r=t.useContext(ut),n=r.initialValues,o=r.fichaProps,i=o.onBeforeSubmitFicha,l=o.config,c=(l=void 0===l?{}:l).mutators,s=void 0===c?{}:c,u=ce(l,Kt),d=s===er?s:le({},er,s),m=Ue(e),p=a.useNotify(),f=t.useCallback(function(t,r,n){var a=i&&i(le({form:{values:t}},m),"N");return"string"==typeof a?void p(a,"warning"):void 0===a||a?e.save(t,r,n):void 0},[i,m]);return t.createElement(a.FormWithRedirect,le({},e,u,{save:f,mutators:d,initialValues:n,render:function(e){return t.createElement(Yt,le({component:St},e))}}))};tr.defaultProps={margin:"normal",variant:"outlined",syncWithLocation:!1},Y.ra.page.empty="No records yet";var rr=le({},Y,{login:{id:"ID",hint:"Login",required:"Insert Username or ID",send:"Send",email:"Enter your email address",check_email:"Check your email inbox, we just send you a verification code!",must_enter_credentials:"You must first enter Username or ID",restore_password:"Restore Password",punch_in:"Punch In"},pos:{search:"Search",change_pin:"Change Pin",change_password:"Change Password",configuration:"Configuration",language:"Language",theme:{name:"Theme",light:"Light",dark:"Dark"},dashboard:{welcome:{title:"Welcome",subtitle:"Employee Management",aor_button:"Metiri WebSite"}}},validation:{greater_or_equal:"Must be greater than or equal to %{menor}"}});X.ra.notification.created="Datos guardados correctamente",X.ra.action.bulk_actions="1 seleccionado |||| %{smart_count} selecccionados",X.ra.page.dashboard="Inicio",X.ra.page.empty="Sin registros todavía",X.ra.page.invite="¿Quiere agregar uno?",X.ra.page.list="%{name}",X.ra.page.edit="Editar %{name}",X.ra.action.back="Volver";var nr=le({},X,{login:{id:"Cédula",hint:"Inicio de Sesión",required:"Ingrese Usuario o Cédula",email:"Ingrese su email aquí",send:"Enviar",check_email:"Revisa tu correo electrónico, te enviaremos un código de verificación!",must_enter_credentials:"Debe ingresar Nº de Usuario o Cédula y Contraseña primero",restore_password:"Restablecer Contraseña",punch_in:"Generar Marcas"},pos:{search:"Búsqueda",change_pin:"Cambiar Pin",change_password:"Cambiar Contraseña",configuration:"Configuración",language:"Lenguaje",theme:{name:"Tema Visual",light:"Light",dark:"Dark"},dashboard:{welcome:{title:"Bienvenid@",subtitle:"Gestión de Funcionarios",aor_button:"Sitio de Metiri"}}},validation:{greater_or_equal:"Debe ser mayor o igual a %{menor}"}}),ar=["hidden"],or=["hidden","useContenido"],ir=["hidden"],lr=function(e){var r=t.useContext(ut),n=r.estado,a=r.loading,o=r.fichaProps,i=(void 0===o?{}:o)[e.source],l=void 0===i?{}:i,c=e.hidden,s=void 0!==c&&c,u=ce(e,ar),d=l.hidden,m=l.useContenido,p=void 0===m?je:m,f=ce(l,or),g=void 0!==d?d:s,h=p(le({},u,{estado:n,hidden:g,loading:a},f)),b=h.hidden,v=ce(h,ir);if(void 0===h)throw new Error("useContenido está devolviendo undefined para el contenido "+e.source+"\n Asegúrese de incluir una instrucción return al final de la función");return{propsContenido:le({},u,f,v),hidden:void 0!==b?b:g}},cr=["onFocus","onChange","onBlur","hidden","disabled","validate"],sr=["onFocus","onBlur","onChange","hidden","disabled","useContenido","validate"],ur=["hidden","disabled","onFocus","onChnage","onBlur","validate"],dr=function(e,t,r){return"string"==typeof(null==r?void 0:r.data)?r.data:void 0},mr=function(e){var r=t.useContext(ut),n=r.estado,i=r.loading,l=r.fichaProps,c=void 0===l?{}:l,s=o.useSelector(function(t){var r=t.configInputs?t.configInputs.filter(function(t){return t.id===e.source}):[];return r[0]?r[0]:null})||{},u=s.disabled,d=s.hidden,m=!0===s.required?ct:void 0,p=c[e.source],f=void 0===p?{}:p,g=e.onFocus,h=e.onChange,b=e.onBlur,v=e.hidden,E=void 0!==v&&v,C=e.disabled,y=void 0!==C&&C,x=e.validate,k=ce(e,cr),S=a.useInput({source:e.source}).input,T=f.onFocus,F=f.onBlur,N=f.onChange,P=f.hidden,R=f.disabled,I=f.useContenido,w=void 0===I?je:I,q=f.validate,M=ce(f,sr),D=void 0!==P?P:E,B=void 0!==R?R:y,L=void 0!==T?T:g,O=void 0!==F?F:b,_=void 0!==N?N:h,A=Je(e),V=w(le({},k,{estado:n,hidden:D,loading:i,utils:A},M)),W=t.useRef(S.value);if(void 0===V)throw new Error("useContenido está devolviendo undefined para el contenido "+e.source+"\n Asegúrese de incluir una instrucción return al final de la función");var G=V.hidden,z=V.disabled,j=V.onFocus,H=V.onChnage,U=V.onBlur,J=V.validate,Q=ce(V,ur),Z=j||L,K=U||O,Y=H||_,X=le({},A,{prev:W.current}),$=Array.isArray(x)?x:[x],ee=Array.isArray(q)?q:[q],te=Array.isArray(J)?J:[J];return{propsContenido:le({onFocus:function(e){Z&&L(A,n,e),W.current=e.target.value},onBlur:function(e){return K&&K(X,n,e)},onChange:function(e){return Y&&Y(X,n,e)},helperText:!1,validate:[].concat($,ee,te,[dr,m]).filter(function(e){return void 0!==e})},k,M,Q,{disabled:void 0!==u?u:void 0!==z?z:B}),hidden:void 0!==d?d:void 0!==G?G:D}},pr=["callback"],fr=["helperText"],gr=["callback"],hr=function(e){var r=e.callback,n=ce(e,pr),o=a.useListContext(n),i=o.loading,l=o.data;return t.useEffect(function(){i||"function"==typeof r&&r(Object.values(l))},[i]),t.createElement(a.SelectInput,n)},br=["helperText"],vr=["helperText"],Er=["tipo"],Cr=function(e){return t.createElement(a.List,le({},e,{hasCreate:!1,exporter:!1,perPage:25,title:" ",bulkActionButtons:t.createElement("span",null)}),t.createElement(a.Datagrid,null,t.createElement(a.TextField,{source:"funced",sortable:!0,label:"Cédula"}),t.createElement(a.TextField,{source:"funpriape",sortable:!0,label:"Apellido"}),t.createElement(a.TextField,{source:"funprinom",sortable:!0,label:"Nombre"})))},yr={fillista:"empcod=-1"},xr=function(e){var r=t.useState(yr),n=r[0],o=r[1],i=a.useDataProvider(),l=t.useCallback(function(e){o({fillista:e.node.key})},[o]),s=t.useCallback(function(e){return i.getChildNodes("form_224",{parentId:e?e.itemData.id:""}).then(function(e){return e.data}).catch(function(){throw new Error("Data Loading Error")})},[i]);return t.createElement(c.Box,{display:"flex",flex:1,alignItems:"flex-start",height:"20em"},t.createElement(c.Box,{flexGrow:1},t.createElement(ie.TreeView,{id:"funcionarios-treeview",dataStructure:"plain",rootValue:"",onItemClick:l,createChildren:s})),t.createElement(c.Box,{flexGrow:2},t.createElement(Cr,{resource:"form_224",basePath:"/form_224",filter:n})))},kr=g.makeStyles(function(e){return{confirmPrimary:{color:e.palette.primary.main},confirmWarning:{color:e.palette.error.main,"&:hover":{backgroundColor:M.alpha(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}},iconPaddingStyle:{paddingRight:"0.5em"}}},{name:"RaConfirm"}),Sr=function(e){return t.createElement(oe,{handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]'},t.createElement(c.Paper,e))},Tr={cursor:"move"},Fr=function(e){var r,n=e.isOpen,o=e.loading,i=e.title,l=e.cancel,c=e.confirmColor,m=e.ConfirmIcon,f=e.CancelIcon,g=e.onClose,h=e.onConfirm,b=e.translateOptions,v=void 0===b?{}:b,E=kr(e),C=a.useTranslate(),y=t.useCallback(function(e,t){e.stopPropagation(),h(e,t)},[h]),x=t.useCallback(function(e){e.stopPropagation()},[]);return t.createElement(s,{open:n,onClose:g,onClick:x,fullWidth:!0,maxWidth:"lg",PaperComponent:Sr,"aria-labelledby":"draggable-dialog-title"},t.createElement(p,{style:Tr,id:"draggable-dialog-title"},C(i,le({_:i},v))),t.createElement(d,{dividers:!0},t.createElement(xr,null)),t.createElement(u,null,t.createElement(L,{disabled:o,onClick:g},t.createElement(f,{className:E.iconPaddingStyle}),C(l,{_:l})),t.createElement(L,{disabled:o,onClick:function(e){return y(e,"yes")},className:B("ra-confirm",(r={},r[E.confirmWarning]="warning"===c,r[E.confirmPrimary]="primary"===c,r)),autoFocus:!0},t.createElement(m,{className:E.iconPaddingStyle}),C("ra.action.confirm"))))};Fr.propTypes={cancel:l.string,classes:l.object,confirm:l.string,confirmColor:l.string,ConfirmIcon:l.elementType,CancelIcon:l.elementType,isOpen:l.bool,loading:l.bool,onClose:l.func.isRequired,onConfirm:l.func.isRequired,title:l.string.isRequired},Fr.defaultProps={cancel:"ra.action.cancel",classes:{},confirmColor:"primary",ConfirmIcon:ne,CancelIcon:ae,isOpen:!1};var Nr=["disabled","asistant","asistantResource","label","source"],Pr={seleccion:[],all:!0,none:!1},Rr=function(e){return!e||null!=e&&e.all?"Todos":null!=e&&e.none||0===e.seleccion.length?"Ninguno":"Selección ("+e.seleccion.length+")"},Ir=function(e){return console.log({parse:e}),e},wr=["tipo","value"],qr=g.makeStyles(function(e){return{confirmPrimary:{color:e.palette.primary.main},confirmWarning:{color:e.palette.error.main,"&:hover":{backgroundColor:M.alpha(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}},iconPaddingStyle:{paddingRight:"0.5em"}}},{name:"RaConfirm"}),Mr=function(e){return t.createElement(oe,{handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]'},t.createElement(c.Paper,e))},Dr={cursor:"move"},Br=function(e){var r,n=e.isOpen,i=e.loading,l=e.title,c=e.content,m=e.cancel,f=e.confirmColor,g=e.ConfirmIcon,h=e.CancelIcon,b=e.onClose,v=e.onConfirm,E=e.contentResource,C=e.translateOptions,y=void 0===C?{}:C,x=qr(e),k=a.useTranslate(),S=o.useSelector(function(e){return e.admin.resources[E].list.selectedIds}),T=t.useCallback(function(e,t){e.stopPropagation(),v(e,S)},[S,v]),F=t.useCallback(function(e){e.stopPropagation()},[]);return t.createElement(s,{open:n,onClose:b,onClick:F,fullWidth:!0,maxWidth:"lg",PaperComponent:Mr,"aria-labelledby":"draggable-dialog-title"},t.createElement(p,{style:Dr,id:"draggable-dialog-title"},k(l,le({_:l},y))),t.createElement(d,{dividers:!0},c),t.createElement(u,null,t.createElement(L,{disabled:i,onClick:b},t.createElement(h,{className:x.iconPaddingStyle}),k(m,{_:m})),t.createElement(L,{disabled:i,onClick:function(e){return T(e,"yes")},className:B("ra-confirm",(r={},r[x.confirmWarning]="warning"===f,r[x.confirmPrimary]="primary"===f,r)),autoFocus:!0},t.createElement(g,{className:x.iconPaddingStyle}),k("ra.action.confirm"))))};Br.propTypes={cancel:l.string,classes:l.object,confirm:l.string,confirmColor:l.string,ConfirmIcon:l.elementType,CancelIcon:l.elementType,content:l.node.isRequired,isOpen:l.bool,loading:l.bool,onClose:l.func.isRequired,onConfirm:l.func.isRequired,title:l.string.isRequired},Br.defaultProps={cancel:"ra.action.cancel",classes:{},confirmColor:"primary",ConfirmIcon:ne,CancelIcon:ae,isOpen:!1};var Lr=["disabled","asistant","asistantResource","label","source"],Or=function(){return t.createElement(t.Fragment,null)},_r={seleccion:[],all:!0,none:!1},Ar=function(e){return console.log({format:e}),!e||null!=e&&e.all?"Todos":null!=e&&e.none||0===e.seleccion.length?"Ninguno":"Selección ("+e.seleccion.length+")"},Vr=function(e){return console.log({parse:e}),e};exports.AppBar=de,exports.BooleanField=function(e){var r=lr(e),n=r.propsContenido,o=r.hidden,i=JSON.parse(JSON.stringify(e.record)),l=i[e.source];return i[e.source]=""!=l&&"0"!=l,!o&&t.createElement(a.BooleanField,le({},n,{record:i}))},exports.Camino=function(e){var r=mr(e);return!r.hidden&&t.createElement(a.FileInput,le({accept:"",maxSize:5e6},r.propsContenido),t.createElement(a.ImageField,{source:"src"}))},exports.CheckBox=function(e){var r=mr(e);return!r.hidden&&t.createElement(a.BooleanInput,r.propsContenido)},exports.ComboBox=function(e){var r,n,i=mr(e),l=i.propsContenido,c=i.hidden,s=t.useRef(!1),u=o.useDispatch(),d=a.useVersion(),m=l.helperText,p=ce(l,fr),f=o.useSelector(function(t){var r=t.reload_cb?t.reload_cb.filter(function(t){return t.id===e.source}):[];return r[0]?r[0]:null}),g=t.useRef(f),h=null===f&&g.current?g.current:f;return h&&(r=h.callback,n=ce(h,gr)),t.useEffect(function(){null!==f&&(g.current=f,u(Le(e.source)))},[JSON.stringify(f)]),t.useEffect(function(){s.current=!0},[d]),s.current?!c&&t.createElement(a.ReferenceInput,le({},p,{perPage:250,filter:n}),t.createElement(hr,{callback:r,helperText:m,optionText:"etiqueta",optionValue:e.source})):t.createElement(a.Labeled,{id:e.id,label:e.label,source:e.source,resource:e.resource,className:e.className,isRequired:e.isRequired,meta:e.meta,input:e.input,margin:e.margin},t.createElement(a.LinearProgress,{timeout:1}))},exports.ComboBoxManual=function(e){var r=mr(e);return!r.hidden&&t.createElement(a.SelectInput,r.propsContenido)},exports.CreateEtriek=mt,exports.DeleteButtonNoWarning=ht,exports.EditEtriek=function(e){var r=ce(e,bt),n=a.useEditController(r),o=n.record,i=n.loading,l=nt(e).fichaProps,c=t.useMemo(function(){return{estado:"M",initialValues:o,loading:i,fichaProps:l}},[o,i,l]);return t.createElement(we,null,t.createElement(ut.Provider,{value:c},t.createElement(a.Edit,le({},r,null==l?void 0:l.panel))))},exports.EtrGrid=function(e){var r=e.filterBy,n=void 0===r?"":r,o=e.claves,i=e.sortModel,l=e.columns,s=e.reference,u=e.allowAdd,d=void 0===u||u,m=e.allowRemove,p=void 0===m||m,g=e.etrResource,h=e.enableLoad,v=void 0===h||h,E=ce(e,ve),C=e.record,y=t.useRef(!1),x=Ee(e),k=a.useVersion(),S=t.useState(i)[1],T=i[0],F=T.field,N=T.sort;t.useEffect(function(){y.current=!0},[k]);var P=Object.keys(C).filter(function(e){return o.split(",").includes(e)}).reduce(function(e,t){return e[t]=C[t],e},{}),R={};n.split(",").forEach(function(e){e&&(R[e]=[{type:"string",comparison:"eq",value:C[e],field:e}])});var I=a.useGetList(s,{page:1,perPage:200},{field:F,order:N},R,{enabled:v&&y.current}),w=I.data,q=I.ids,M=I.loading,D=t.useMemo(function(){return q.map(function(e){return w[e]})},[q,w]),B=[d?{field:"BTN",headerName:"",sortable:!1,renderHeader:function(e){return t.createElement(Te,le({},E,{etrResource:g,camposClaveFila:o,clavesFila:P,api:e.api}))}}:{}].concat(l,[{field:" ",width:80,headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:function(e){return t.createElement(Fe,le({},E,{camposClaveFila:o,clavesFila:P,api:e.api,row:e.row}))}},p?{field:" ",headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:function(e){return t.createElement(Se,le({},E,{camposClaveFila:o,api:e.api,row:e.row}))}}:{}]),L=t.useMemo(function(){return B},[JSON.stringify(B)]);return M?t.createElement(a.Loading,null):t.createElement(f,{className:x.rootPaper},t.createElement(c.ThemeProvider,{theme:Ne},t.createElement(b.DataGrid,le({className:x.root,disableSelectionOnClick:!0,pageSize:50,hideFooter:!0,sortModel:i,rows:D,columns:L,onSortModelChange:function(e){return S(e)},components:{NoRowsOverlay:fe}},E))))},exports.EtriekNotification=Et,exports.FichaActions=function(e){var r=e.children,n=e.basePath,o=e.className,i=e.data,l=e.hasShow,c=ce(e,ot);return t.createElement(a.TopToolbar,le({className:o},ce(c,at)),r,t.createElement(a.ListButton,{label:"ra.action.back",basePath:n,icon:t.createElement(P,null)}),l&&t.createElement(a.ShowButton,{basePath:n,record:i}))},exports.FichaContext=ut,exports.FormDialog=yt,exports.FormEtriek=Nt,exports.GE=function(e){var r=e.filterBy,n=void 0===r?"":r,o=e.sortModel,i=e.columns,l=e.reference,s=e.filter,u=void 0===s?[]:s,d=e.enableLoad,m=void 0===d||d,p=ce(e,Pe),g=e.record,h=t.useRef(!1),v=pe(e),E=a.useVersion(),C=t.useState(o),y=C[0],x=C[1],k=o[0],S=k.field,T=k.sort,F=t.useMemo(function(){return[].concat(i)},[JSON.stringify(i)]);t.useEffect(function(){h.current=!0},[E]);var N=[];n.split(",").forEach(function(e){e&&N.push({type:"string",comparison:"eq",value:g[e],field:e})});var P=le({},N.concat(u)),R=a.useGetList(l,{page:1,perPage:200},{field:S,order:T},P,{enabled:m&&h.current}),I=R.data,w=R.ids,q=R.loading,M=t.useMemo(function(){return w.map(function(e){return I[e]})},[w,I]);return q?t.createElement(a.Loading,null):t.createElement(f,{className:v.rootPaper},t.createElement(c.ThemeProvider,{theme:Re},t.createElement(b.DataGrid,le({className:v.root,disableSelectionOnClick:!0,pageSize:50,hideFooter:!0,rows:M,columns:F,sortModel:y,onSortModelChange:function(e){return x(e)},components:{NoRowsOverlay:fe}},p))))},exports.GrillaEtriek=$e,exports.ImageField=function(e){var r=e.title,n=e.source,o=e.src,i=a.useRecordContext(e);return t.createElement(z,{title:r,src:o+"/"+i[n]})},exports.Layout=function(e){var r=ce(e,Lt),n=o.useSelector(function(e){return"dark"===e.theme?Mt:Dt});return t.createElement(a.Layout,le({},r,{appBar:de,sidebar:Ot,menu:qt,theme:n,notification:Et}))},exports.ListActionsEtriek=function(e){var r=e.className,n=e.exporter,o=e.filters,i=e.children,l=ce(e,_t),c=a.useListContext(e),s=c.currentSort,u=c.displayedFilters,d=c.filterValues,m=c.basePath,p=c.selectedIds,f=c.showFilter,g=c.total,h=a.useResourceContext(l),b=a.useResourceDefinition(l).hasCreate;return t.useMemo(function(){return t.createElement(a.TopToolbar,le({className:r},a.sanitizeListRestProps(l)),o&&t.cloneElement(o,{resource:h,showFilter:f,displayedFilters:u,filterValues:d,context:"button"}),b&&t.createElement(a.CreateButton,{basePath:m}),!1!==n&&t.createElement(a.ExportButton,{disabled:0===g,resource:h,sort:s,filterValues:d}),i)},[h,u,d,p,o,g])},exports.ListCheck=function(e){var r=mr(e),n=r.propsContenido,o=r.hidden,i=t.useRef(!1),l=a.useVersion(),c=n.helperText,s=ce(n,br);return t.useEffect(function(){i.current=!0},[l]),i.current?!o&&t.createElement(a.ReferenceArrayInput,s,t.createElement(a.SelectArrayInput,{helperText:c,optionText:"etiqueta",optionValue:e.source})):t.createElement(a.Labeled,{id:e.id,label:e.label,source:e.source,resource:e.resource,className:e.className,isRequired:e.isRequired,meta:e.meta,input:e.input,margin:e.margin},t.createElement(a.LinearProgress,{timeout:1}))},exports.Login=function(e){return t.createElement(Q.ThemeProvider,{theme:g.createTheme(Dt)},t.createElement(Gt,e))},exports.Menu=qt,exports.MenuButton=function(e){var r=e.className,n=e.options,o=void 0===n?[]:n,i=e.icon,l=ce(e,jt),c=t.useState(!1),s=c[0],u=c[1],d=t.useRef(),m=t.useState(0),p=m[0],f=m[1],g=Ht(e),h=a.useResourceContext(e);return t.createElement("div",le({className:B(g.root,r)},ce(l,zt)),t.createElement(a.Button,{className:"add-filter",label:o[p].label,onClick:function(e){e.preventDefault(),u(!0),d.current=e.currentTarget}},i),t.createElement(K,{open:s,anchorEl:d.current,onClose:function(e){d.current&&d.current.contains(e.target)||u(!1)}},o.map(function(e,r){return t.createElement(W,{key:e.label,disabled:e.disabled,selected:r===p,onClick:function(t){return function(e,t){f(t),u(!1)}(0,r)&&(null==e?void 0:e.onClick(t,r))},resource:h,title:e.label},t.createElement(a.FieldTitle,{label:e.label,resource:h}))})))},exports.MultiTextField=function(e){var r=e.fields,n=e.className,a=e.record,o=ce(e,Ut),i=r.separador,l=void 0===i?"":i,c=r.secundario,s=void 0===c?[]:c,u=r.hasSecundario,d=r.campos.map(function(e){return void 0!==a[e]?a[e]:e}).join(""+l);return t.createElement(h,le({noWrap:!0,variant:"inherit",className:n},o),d,u&&t.createElement(h,{component:"span",display:"block",color:"textSecondary",variant:"caption"},s.map(function(e){return(e.etiqueta||"---")+": "+(a[e.campo]||"---")}).join(" ")))},exports.Password=function(e){var r=mr(e);return!r.hidden&&t.createElement(a.PasswordInput,r.propsContenido)},exports.RadioButton=function(e){var r=mr(e),n=r.propsContenido,o=r.hidden,i=t.useRef(!1),l=a.useVersion(),c=n.helperText,s=ce(n,vr);return t.useEffect(function(){i.current=!0},[l]),i.current?!o&&t.createElement(a.ReferenceInput,s,t.createElement(a.RadioButtonGroupInput,{helperText:c,optionText:"etiqueta",optionValue:e.source})):t.createElement(a.Labeled,{id:e.id,label:e.label,source:e.source,resource:e.resource,className:e.className,isRequired:e.isRequired,meta:e.meta,input:e.input},t.createElement(a.LinearProgress,null))},exports.RadioButtonManual=function(e){var r=mr(e);return!r.hidden&&t.createElement(a.RadioButtonGroupInput,r.propsContenido)},exports.Separador=function(e){return t.createElement(h,{variant:"h6",gutterBottom:!0},e.children)},exports.ShowEtriek=function(e){var r=ce(e,Jt),n=a.useShowController(r),o=n.record,i=n.loading,l=nt(e).fichaProps,c=t.useMemo(function(){return{estado:"M",initialValues:o,loading:i,fichaProps:l}},[o,i,l]);return t.createElement(we,null,t.createElement(ut.Provider,{value:c},t.createElement(a.Show,le({},r,n,null==l?void 0:l.panel))))},exports.SubMenu=Rt,exports.TBSF=function(e){var r=e.disabled,n=e.label,i=void 0===n?"Funcionarios":n,l=e.source,c=ce(e,Nr),s=o.useSelector(function(e){return e.admin.resources.form_224.list.selectedIds}),u=t.useState(!1),d=u[0],m=u[1],p=k.useForm(),f=t.useCallback(function(){m(!1)},[m]);return t.createElement(Fragment,null,t.createElement("div",{style:{display:"flex",alignItems:"center"}},t.createElement(a.TextInput,le({initialValue:Pr},c,{source:l,label:i,disabled:!0,parse:Ir,format:Rr,helperText:!1,InputProps:{endAdornment:t.createElement(Fragment,null,t.createElement(q,{onClick:function(e){p.change(l,{seleccion:[],all:!1,none:!0})},disabled:r,"aria-label":"Ninguno",size:"small",title:"Ninguno"},t.createElement(ee,null)),t.createElement(q,{onClick:function(e){p.change(l,{seleccion:[],all:!0,none:!1})},disabled:r,"aria-label":"Todos",size:"small",title:"Todos"},t.createElement(te,null)),t.createElement(q,{onClick:function(e){return m(!0)},disabled:r,"aria-label":"Selección",size:"small",title:"Selección"},t.createElement(re,null)))}}))),t.createElement(Fr,{isOpen:d,title:"Selección de "+i,onConfirm:function(e,t){m(!1),p.change(l,{seleccion:s,all:!1,none:!1})},onClose:f}))},exports.TabbedFormEtriek=tr,exports.TabbedGrillaEtriek=function(e){var r=e.filterValues,n=e.setFilters,a=e.tabs,o=a.ids,i=ce(a,et),l=e.GridComponent,c=void 0===l?$e:l,s=ce(e,tt),u=r.id;return t.createElement(t.Fragment,null,t.createElement(F,{value:u,indicatorColor:"primary",onChange:function(e,t){n(le({},r,{id:t}))}},o.map(function(e){return t.createElement(T,{key:e,label:e.charAt(0).toUpperCase()+e.slice(1),value:e})})),t.createElement(S,null),t.createElement(c,le({},s,i[u])))},exports.TextArea=function(e){var r=mr(e);return!r.hidden&&t.createElement(a.TextInput,le({multiline:!0},r.propsContenido))},exports.TextBox=function(e){var r=e.tipo,n=ce(e,Er),o=mr(n),i=o.propsContenido,l=o.hidden,c=k.useForm(),s=a.useInput({source:e.source}),u=s.input,d=s.meta,m="F"===r||"Z"===r;t.useEffect(function(){i.value&&(c.change(e.source,i.value),e.disabled&&c.blur(e.source))}),t.useEffect(function(){m&&""!=u.value&&d.valid&&d.modified&&!d.active&&i.onBlur()},[u.value]);var p=le({},i);return!l&&("N"===r||"D"===r?t.createElement(a.NumberInput,p):"F"===r?t.createElement($.KeyboardDateInput,p):"Z"===r?t.createElement($.KeyboardDateTimeInput,p):t.createElement(a.TextInput,"H"===r?le({},p,{type:"time"}):p))},exports.TextBoxSelection=function(e){var r=e.disabled,n=e.asistant,o=e.asistantResource,i=e.label,l=e.source,c=ce(e,Lr),s=t.useState(!1),u=s[0],d=s[1],m=k.useForm(),p=t.useCallback(function(){d(!1)},[d]);return t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",alignItems:"center"}},t.createElement(a.TextInput,le({initialValue:_r},c,{source:l,label:i,disabled:!0,parse:Vr,format:Ar,helperText:!1,InputProps:{endAdornment:t.createElement(t.Fragment,null,t.createElement(q,{onClick:function(e){m.change(l,{seleccion:[],all:!1,none:!0})},disabled:r,"aria-label":"Ninguno",size:"small",title:"Ninguno"},t.createElement(ee,null)),t.createElement(q,{onClick:function(e){m.change(l,{seleccion:[],all:!0,none:!1})},disabled:r,"aria-label":"Todos",size:"small",title:"Todos"},t.createElement(te,null)),t.createElement(q,{onClick:function(e){return d(!0)},disabled:r,"aria-label":"Selección",size:"small",title:"Selección"},t.createElement(re,null)))}}))),t.createElement(Br,{isOpen:u,title:"Selección de "+i,contentResource:o,content:t.createElement(n,{bulkActionButtons:t.createElement(Or,null),hasCreate:!1,exporter:!1,resource:o,basePath:"/"+o}),onConfirm:function(e,t){d(!1),m.change(l,{seleccion:t,all:!1,none:!1})},onClose:p}))},exports.TextField=function(e){var r=e.tipo,n=ce(e,wr),o=lr(n),i=o.hidden,l=le({},o.propsContenido);return!i&&("N"===r||"D"===r?t.createElement(a.NumberField,l):"F"===r?t.createElement(a.DateField,l):"Z"===r?t.createElement(a.DateField,le({},l,{showTime:!0})):t.createElement(a.TextField,l))},exports.choicesEstado=[{id:"1",name:"Aprobado"},{id:"2",name:"Rechazado"},{id:"3",name:"Pendiente"}],exports.dateFormat=function(e,t){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf("/")){var r=e.split("/");return new Date(parseInt(r[2],10),parseInt(r[1],10)-1,parseInt(r[0],10)).toString()}var n=/(\d{4})-(\d{2})-(\d{2})/.exec(e);if(null!==n){var a=new Date(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10));if(!isNaN(a))return a.toString()}},exports.dateFormatOptions={format:"dd/MM/yyyy"},exports.dateParser=function(e,t){if(!e)return"";var r=e.split(" "),n="";switch(r[1]){case"Jan":n="01";break;case"Feb":n="02";break;case"Mar":n="03";break;case"Apr":n="04";break;case"May":n="05";break;case"Jun":n="06";break;case"Jul":n="07";break;case"Aug":n="08";break;case"Sep":n="09";break;case"Oct":n="10";break;case"Nov":n="11";break;case"Dec":n="12"}return r[2]+"/"+n+"/"+r[3]},exports.dateTimeFormat=function(e){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf("/")){var t=e.split("/");return new Date(parseInt(t[2].substr(0,4),10),parseInt(t[1],10)-1,parseInt(t[0],10),t[2].substr(5,2),t[2].substr(8,2)).toString()}var r=/(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2})/.exec(e);if(null!==r){var n=new Date(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10),r[4],r[5]);if(!isNaN(n))return n.toString()}},exports.dateTimeParser=function(e,t){if(!e)return"";var r=e.split(" "),n="";switch(r[1]){case"Jan":n="01";break;case"Feb":n="02";break;case"Mar":n="03";break;case"Apr":n="04";break;case"May":n="05";break;case"Jun":n="06";break;case"Jul":n="07";break;case"Aug":n="08";break;case"Sep":n="09";break;case"Oct":n="10";break;case"Nov":n="11";break;case"Dec":n="12"}return r[2]+"/"+n+"/"+r[3]+" "+r[4].substr(0,5)},exports.deleteRecargarComboBox=Le,exports.descargarLink=function(e,t){var r=document.createElement("a");r.style.display="none",document.body.appendChild(r),r.setAttribute("href",e),r.setAttribute("download",t),r.click()},exports.enMessages=rr,exports.esMessages=nr,exports.etrFechaMayorQue=function(e){return function(t,r){var n=r[e];if(t&&n){var a=n.split("/").reverse().join("/"),o=t.split("/").reverse().join("/");if(w(a).isAfter(o))return{message:"validation.greater_or_equal",args:{menor:n}}}}},exports.etrRequerido=ct,exports.etrRequeridoNumerico=st,exports.getFormcodFromResource=it,exports.localeOptions=function(e){return void 0===e&&(e="es"),{locale:"en"==e?R:I}},exports.recargarComboBox=Be,exports.setDisableAction=_e,exports.setHiddenAction=Oe,exports.setRequireAction=Ae,exports.themes=Bt,exports.timeFormat=function(e){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf(":")){var t=e.split(":"),r=new Date;return r.setHours(t[0]),r.setMinutes(t[1]),r.toString()}var n=/(\d{2}):(\d{2})/.exec(e);if(null!==n){var a=new Date;return a.setHours(n[0]),a.setMinutes(n[1]),a.toString()}},exports.timeParser=function(e,t){return e?e.split(" ")[4].substr(0,5):""},exports.useAjax=De,exports.useContenidoController=mr,exports.useDeleteRowEtrGrid=ge,exports.useFieldController=lr,exports.useGetJson=Me,exports.useInitFicha=nt,exports.useNuevo=me,exports.useReferenceLabel=function(e,t){var r=a.useResourceContext();return o.useSelector(function(n){var a;return(null===(a=n.admin.resources["cb_"+it(r)+"_"+e].data[t])||void 0===a?void 0:a.etiqueta)||""})},exports.useSaveRowEtrGrid=he,exports.useStylesContenidos=lt,exports.useUtils=Je,exports.useUtilsGrilla=He;
@@ -1 +1 @@
1
- import{forwardRef as e,createElement as r,useRef as n,useState as t,useEffect as a,useMemo as o,Fragment as i,Children as l,cloneElement as s,useCallback as c,createContext as u,useContext as d,isValidElement as p}from"react";import m from"@material-ui/icons/Lock";import f from"@material-ui/icons/VpnLock";import{useTranslate as v,MenuItemLink as g,AppBar as h,UserMenu as b,useGetOne as y,useMutation as C,useVersion as k,useGetList as N,Loading as S,useSafeSetState as w,useNotify as x,Button as T,SaveContextProvider as P,SaveButton as F,useDeleteWithConfirmController as I,Confirm as R,FormWithRedirect as _,useListContext as E,useRedirect as O,useRefresh as D,useUnselectAll as M,useResourceDefinition as L,SimpleList as B,Datagrid as V,EditButton as A,TopToolbar as q,ListButton as W,ShowButton as z,required as H,minValue as j,useResourceContext as G,Create as J,useDelete as U,useEditController as Z,Edit as Q,Notification as Y,CardContentInner as K,SimpleFormView as X,SimpleForm as $,Menu as ee,DashboardMenuItem as re,defaultTheme as ne,Layout as te,Sidebar as ae,sanitizeListRestProps as oe,CreateButton as ie,ExportButton as le,useLogin as se,FieldTitle as ce,useShowController as ue,Show as de,getTabFullPath as pe,escapePath as me,TabbedFormTabs as fe,Toolbar as ve,BooleanField as ge,useInput as he,FileInput as be,ImageField as ye,BooleanInput as Ce,ReferenceInput as ke,Labeled as Ne,LinearProgress as Se,SelectInput as we,useRecordContext as xe,ReferenceArrayInput as Te,SelectArrayInput as Pe,PasswordInput as Fe,RadioButtonGroupInput as Ie,TextInput as Re,NumberInput as _e,NumberField as Ee,DateField as Oe,TextField as De}from"react-admin";import{useSelector as Me,useDispatch as Le}from"react-redux";import Be,{string as Ve,func as Ae,any as qe,bool as We}from"prop-types";import{alpha as ze,createTheme as He,ThemeProvider as je,useMediaQuery as Ge,CircularProgress as Je,Divider as Ue}from"@material-ui/core";import Ze from"@material-ui/core/Dialog";import Qe from"@material-ui/core/DialogActions";import Ye from"@material-ui/core/DialogContent";import Ke from"@material-ui/core/DialogContentText";import Xe from"@material-ui/core/DialogTitle";import $e from"@material-ui/core/Paper";import{makeStyles as er,createTheme as rr}from"@material-ui/core/styles";import nr from"@material-ui/core/Typography";import{GridOverlay as tr,esES as ar,DataGrid as or}from"@material-ui/data-grid";import ir from"@material-ui/icons/Add";import lr from"@material-ui/icons/Cancel";import sr from"@material-ui/icons/Delete";import cr from"@material-ui/icons/Edit";import ur from"@material-ui/core/TableContainer";import{useForm as dr,Form as pr,Field as mr}from"react-final-form";import fr from"@material-ui/core/Divider";import vr from"@material-ui/core/Tab";import gr from"@material-ui/core/Tabs";import hr from"@material-ui/core/styles/makeStyles";import br from"@material-ui/icons/ChevronLeft";import yr from"date-fns/locale/en-US";import Cr from"date-fns/locale/es";import kr from"moment";import Nr from"@material-ui/core/IconButton";import{alpha as Sr}from"@material-ui/core/styles/colorManipulator";import wr from"@material-ui/core/Tooltip";import xr from"classnames";import Tr from"@material-ui/core/Button";import Pr from"@material-ui/icons/Settings";import Fr from"@material-ui/core/Collapse";import Ir from"@material-ui/core/List";import Rr from"@material-ui/core/ListItemIcon";import _r from"@material-ui/core/MenuItem";import Er from"@material-ui/icons/ExpandMore";import Or from"@material-ui/core/Avatar";import Dr from"@material-ui/core/Card";import Mr from"@material-ui/core/CardActions";import Lr from"@material-ui/core/CircularProgress";import Br from"@material-ui/core/TextField";import{ThemeProvider as Vr}from"@material-ui/styles";import{useLocation as Ar,useRouteMatch as qr,Route as Wr}from"react-router-dom";import zr from"@material-ui/core/Menu";import Hr from"ra-language-english";import jr from"@blackbox-vision/ra-language-spanish";import{KeyboardDateInput as Gr,KeyboardDateTimeInput as Jr}from"react-admin-date-inputs";function Ur(){return(Ur=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e}).apply(this,arguments)}function Zr(e,r){if(null==e)return{};var n,t,a={},o=Object.keys(e);for(t=0;t<o.length;t++)r.indexOf(n=o[t])>=0||(a[n]=e[n]);return a}var Qr=e(function(e,n){var t=v(),a=Me(function(e){return[e.admin.resources.form_275?1:0,e.admin.resources.form_59?1:0]}),o=a[1];return[a[0]?r(g,{ref:n,key:"/form_275",to:"/form_275",primaryText:t("pos.change_pin"),leftIcon:r(m,null),onClick:e.onClick}):null,o?r(g,{ref:n,key:"/form_59",to:"/form_59",primaryText:t("pos.change_password"),leftIcon:r(f,null),onClick:e.onClick}):null]}),Yr=function(e){return r(b,e,r(Qr,null))},Kr=function(e){return r(h,Ur({},e,{elevation:1,userMenu:r(Yr,null)}))},Xr=function(e,r){return y(e,"-1",r)},$r=er(function(e){return{root:{"& .MuiDataGrid-columnsContainer":{backgroundColor:"light"===e.palette.type?"#fafafa":"#1d1d1d"},"& .MuiDataGrid-iconSeparator":{display:"none"}},header:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.light},rootPaper:{width:"100%",height:"40vh",borderRadius:0,marginTop:e.spacing(1)},rootOverlay:{flexDirection:"column","& .ant-empty-img-1":{fill:"light"===e.palette.type?"#aeb8c2":"#262626"},"& .ant-empty-img-2":{fill:"light"===e.palette.type?"#f5f5f7":"#595959"},"& .ant-empty-img-3":{fill:"light"===e.palette.type?"#dce0e6":"#434343"},"& .ant-empty-img-4":{fill:"light"===e.palette.type?"#ffffff":"#1c1c1c"},"& .ant-empty-img-5":{fillOpacity:"light"===e.palette.type?"0.8":"0.08",fill:"light"===e.palette.type?"#f5f5f5":"#ffffff"}},label:{marginTop:e.spacing(1)},deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:ze(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}},{name:"GE"}),en=function(){var e=$r();return r(tr,{className:e.rootOverlay},r("svg",{width:"120",height:"100",viewBox:"0 0 184 152","aria-hidden":!0,focusable:"false"},r("g",{fill:"none",fillRule:"evenodd"},r("g",{transform:"translate(24 31.67)"},r("ellipse",{className:"ant-empty-img-5",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),r("path",{className:"ant-empty-img-1",d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z"}),r("path",{className:"ant-empty-img-2",d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z"}),r("path",{className:"ant-empty-img-3",d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z"})),r("path",{className:"ant-empty-img-3",d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z"}),r("g",{className:"ant-empty-img-4",transform:"translate(149.65 15.383)"},r("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),r("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"})))),r("div",{className:e.label},"No hay registros"))},rn=function(e,r,n){return C({type:"deleteEtrRow",resource:e,payload:{params:r}},n)},nn=function(e,r,n,t){return C({type:e,resource:r,payload:{params:n}},t)},tn=["api","basePath","classes","className","confirmTitle","confirmContent","icon","record","redirect","onSuccess","onFailure","source","camposClaveFila"],an=["filterBy","claves","sortModel","columns","reference","allowAdd","allowRemove","etrResource","enableLoad"],on=er(function(e){return{root:{"& .MuiDataGrid-columnsContainer":{backgroundColor:"light"===e.palette.type?"#fafafa":"#1d1d1d"},"& .MuiDataGrid-iconSeparator":{display:"none"}},header:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.light},rootPaper:{width:"100%",height:"40vh",borderRadius:0,marginTop:e.spacing(1)},rootOverlay:{flexDirection:"column","& .ant-empty-img-1":{fill:"light"===e.palette.type?"#aeb8c2":"#262626"},"& .ant-empty-img-2":{fill:"light"===e.palette.type?"#f5f5f7":"#595959"},"& .ant-empty-img-3":{fill:"light"===e.palette.type?"#dce0e6":"#434343"},"& .ant-empty-img-4":{fill:"light"===e.palette.type?"#ffffff":"#1c1c1c"},"& .ant-empty-img-5":{fillOpacity:"light"===e.palette.type?"0.8":"0.08",fill:"light"===e.palette.type?"#f5f5f5":"#ffffff"}},label:{marginTop:e.spacing(1)},deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:ze(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}},{name:"EtrGrid"}),ln={marginLeft:"1.6rem",fontWeight:"bold"},sn=r(sr,null),cn=function(e){var n=e.basePath,t=e.confirmTitle,a=void 0===t?"ra.message.delete_title":t,o=e.confirmContent,l=void 0===o?"ra.message.delete_content":o,s=e.icon,u=void 0===s?sn:s,d=e.record,p=e.redirect,m=void 0!==p&&p,f=e.onSuccess,v=e.onFailure,g=e.source,h=e.camposClaveFila,b=Zr(e,tn),y=on(e),C=x(),k=I({record:d,redirect:m,basePath:n,onSuccess:f,onFailure:v}),N=k.open,S=k.loading,w=k.handleDialogOpen,P=k.handleDialogClose,F=rn(e.resource,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);C("ra.notification.deleted","info",{smart_count:1})},onFailure:function(e){C(e.message,"warning")}})[0],_=Object.keys(d).filter(function(e){return h.split(",").includes(e)}).reduce(function(e,r){return e[r]=d[r],e},{}),E=c(function(e){F({payload:{ge:g,clavesFila:_}})},[d]);return r(i,null,r(T,Ur({key:"button",onClick:w,className:y.deleteButton},b),u),r(R,{isOpen:N,loading:S,title:a,content:l,onConfirm:E,onClose:P}))},un=function(e){return r(Ze,{open:e.open,onClose:e.onClose,fullWidth:!0},r(Xe,null,e.labelEstado+" "+e.label),r(Ke,null,r(nr,{component:"span",display:"block",variant:"subtitle1",style:Ur({},ln)},e.msgTitle),e.msgDesc),r(_,{resource:e.resource,save:e.save,render:e.render,initialValues:e.initialValues}))};un.propTypes={label:Ve,onClick:Ae,icon:qe,open:We,onClose:Ae,labelEstado:Ve,msgTitle:qe,msgDesc:qe,resource:qe,save:Ae,render:Ae};var dn=function(e){return r(cn,{api:!0,confirmTitle:"ra.action.delete",source:e.source,record:e.row,resource:e.resource,camposClaveFila:e.camposClaveFila})},pn=function(e){var n=e.editors,t=e.record,a=e.clavesFila,c=e.camposClaveFila,u=e.resource,d=e.label,p=e.source,m=e.etrResource,f=w(!1),g=f[0],h=f[1],b=Xr(m,{enabled:g}).data,y=nn("createEtrRow",u,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);h(!1),N("ra.notification.created","info")},onFailure:function(e){N(e.message,"warning")}}),C=y[0],k=y[1].loading,N=x(),S=v()("ra.action.create"),I=function(e){C({payload:{data:Ur({},e,a),ge:p,camposClaveFila:c,estado:"N"}})},R=o(function(){return{save:I,setOnFailure:function(e){return console.log(e)}}},[I]);return r(i,null,r(T,{onClick:function(e){h(!0),e.stopPropagation()}},r(ir,null)),r(P,{value:R},r(un,{open:g,onClose:function(e){h(!1),e.stopPropagation()},labelEstado:S,label:d,msgTitle:e.msgTitle,msgDesc:e.msgDesc,resource:u,save:I,initialValues:b,render:function(e){var a=e.handleSubmitWithRedirect,o=e.pristine,c=e.saving;return r(i,null,r(Ye,null,l.map(n,function(e,r){return s(e,{resource:u,estado:"N",initialValue:t[e.props.source],fullWidth:!0,disabled:void 0!==e.props.disabled&&e.props.disabled,InputLabelProps:{shrink:!0}})})),r(Qe,null,r(F,{handleSubmitWithRedirect:a,pristine:o,saving:c,disabled:k}),r(T,{label:"ra.action.cancel",onClick:function(e){h(!1),e.stopPropagation()},disabled:k},r(lr,null))))}})))},mn=function(e){var n=e.editors,t=e.clavesFila,a=e.camposClaveFila,o=e.resource,c=e.label,u=e.source,d=e.row,p=x(),m=v(),f=w(!1),g=f[0],h=f[1],b=nn("updateEtrRow",o,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);h(!1),p("ra.notification.updated","info",{smart_count:1})},onFailure:function(e){p(e.message,"warning")}}),y=b[0],C=b[1].loading,k=m("ra.action.edit");return r(i,null,r(T,{onClick:function(e){h(!0),e.stopPropagation()}},r(cr,null)),r(un,{open:g,onClose:function(e){h(!1),e.stopPropagation()},labelEstado:k,label:c,msgTitle:e.msgTitle,msgDesc:e.msgDesc,resource:o,save:function(e){y({payload:{data:Ur({},t,e),ge:u,camposClaveFila:a,estado:"M"}})},render:function(e){var t=e.handleSubmitWithRedirect,c=e.pristine,u=e.saving;return r(i,null,r(Ye,null,l.map(n,function(e,r){return s(e,{resource:o,estado:"M",initialValue:d[e.props.source],fullWidth:!0,disabled:-1!=a.indexOf(e.props.source),InputLabelProps:{shrink:!0}})})),r(Qe,null,r(F,{handleSubmitWithRedirect:t,pristine:c,saving:u,disabled:C}),r(T,{label:"ra.action.cancel",onClick:function(e){h(!1),e.stopPropagation()},disabled:C},r(lr,null))))}}))},fn=He({},ar),vn=function(e){var i=e.filterBy,l=void 0===i?"":i,s=e.claves,c=e.sortModel,u=e.columns,d=e.reference,p=e.allowAdd,m=void 0===p||p,f=e.allowRemove,v=void 0===f||f,g=e.etrResource,h=e.enableLoad,b=void 0===h||h,y=Zr(e,an),C=e.record,w=n(!1),x=on(e),T=k(),P=t(c)[1],F=c[0],I=F.field,R=F.sort;a(function(){w.current=!0},[T]);var _=Object.keys(C).filter(function(e){return s.split(",").includes(e)}).reduce(function(e,r){return e[r]=C[r],e},{}),E={};l.split(",").forEach(function(e){e&&(E[e]=[{type:"string",comparison:"eq",value:C[e],field:e}])});var O=N(d,{page:1,perPage:200},{field:I,order:R},E,{enabled:b&&w.current}),D=O.data,M=O.ids,L=O.loading,B=o(function(){return M.map(function(e){return D[e]})},[M,D]),V=[m?{field:"BTN",headerName:"",sortable:!1,renderHeader:function(e){return r(pn,Ur({},y,{etrResource:g,camposClaveFila:s,clavesFila:_,api:e.api}))}}:{}].concat(u,[{field:" ",width:80,headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:function(e){return r(mn,Ur({},y,{camposClaveFila:s,clavesFila:_,api:e.api,row:e.row}))}},v?{field:" ",headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:function(e){return r(dn,Ur({},y,{camposClaveFila:s,api:e.api,row:e.row}))}}:{}]),A=o(function(){return V},[JSON.stringify(V)]);return L?r(S,null):r($e,{className:x.rootPaper},r(je,{theme:fn},r(or,Ur({className:x.root,disableSelectionOnClick:!0,pageSize:50,hideFooter:!0,sortModel:c,rows:B,columns:A,onSortModelChange:function(e){return P(e)},components:{NoRowsOverlay:en}},y))))},gn=["filterBy","sortModel","columns","reference","filter","enableLoad"],hn=He({},ar),bn=function(e){var i=e.filterBy,l=void 0===i?"":i,s=e.sortModel,c=e.columns,u=e.reference,d=e.filter,p=void 0===d?[]:d,m=e.enableLoad,f=void 0===m||m,v=Zr(e,gn),g=e.record,h=n(!1),b=$r(e),y=k(),C=t(s),w=C[0],x=C[1],T=s[0],P=T.field,F=T.sort,I=o(function(){return[].concat(c)},[JSON.stringify(c)]);a(function(){h.current=!0},[y]);var R=[];l.split(",").forEach(function(e){e&&R.push({type:"string",comparison:"eq",value:g[e],field:e})});var _=Ur({},R.concat(p)),E=N(u,{page:1,perPage:200},{field:P,order:F},_,{enabled:f&&h.current}),O=E.data,D=E.ids,M=E.loading,L=o(function(){return D.map(function(e){return O[e]})},[D,O]);return M?r(S,null):r($e,{className:b.rootPaper},r(je,{theme:hn},r(or,Ur({className:b.root,disableSelectionOnClick:!0,pageSize:50,hideFooter:!0,rows:L,columns:I,sortModel:w,onSortModelChange:function(e){return x(e)},components:{NoRowsOverlay:en}},v))))},yn=u(),Cn=function(e){var n=e.children,a=t(!1),i=a[0],l=a[1],s=o(function(){return{open:i,show:function(){return l(!0)},hide:function(){return l(!1)}}},[i]);return r(yn.Provider,{value:s},n)},kn=function(){return d(yn)},Nn=function(e,r,n,t){return C({type:"getJson",resource:e,payload:{method:r,params:n}},t)},Sn=function(e){var r=Nn(e),n=r[0],t=r[1].loading;return[c(function(e,r,t){return n({payload:{params:r,method:e}},{returnPromise:!0,onSuccess:t,onFailure:t})},[]),t]},wn=function(e,r,n,t){return{type:"RELOAD_CB",payload:{id:e,method:r,params:n,callback:t}}},xn=function(e,r){return{type:"RELOAD_CB_SUCCESS",payload:{id:e,callback:r}}},Tn=function(e,r){return{type:"HIDE_INPUT",payload:{id:e,hidden:r}}},Pn=function(e,r){return{type:"DISABLE_INPUT",payload:{id:e,disabled:r}}},Fn=function(e,r){return{type:"REQUIRE_INPUT",payload:{id:e,required:r}}},In=function(){var e=Le();return c(function(r,n,t,a){e(wn(r,n,t,a))},[e])},Rn=function(){var e=Le();return c(function(r,n){e(Tn(r,n))},[e])},_n=function(){var e=Le();return c(function(r,n){e(Pn(r,n))},[e])},En=function(){var e=Le();return c(function(r,n){e(Fn(r,n))},[e])},On=function(e){return{}},Dn=function(e){var r=E(e),n=x(),t=O(),a=D(),o=M(e.resource);return{ajax:Sn(e.resource)[0],data:r,notify:n,redirect:t,refresh:a,unselectAll:o}},Mn=function(e){var r=In(),n=Rn(),t=_n(),a=En(),o=kn(),i=x(),l=O();return{ajax:Sn(e.resource)[0],notify:i,redirect:l,recargarComboBox:r,progress:o,setHidden:n,setDisable:t,setRequire:a}},Ln=function(e){var r=In(),n=Rn(),t=_n(),a=En(),o=kn(),i=x(),l=O();return{form:dr(),ajax:Sn(e.resource)[0],notify:i,redirect:l,recargarComboBox:r,progress:o,setHidden:n,setDisable:t,setRequire:a}},Bn=["isRowEditable"],Vn=["isRowEditable","primaryText","secondaryText","desktopSize","onRenderGrilla","onLoadGrilla","hasEdit"],An=er(function(e){return{container:{maxHeight:"70vh"},rowOdd:{backgroundColor:e.palette.action.hover}}},{name:"GrillaEtriek"}),qn=function(e,r){return void 0===r||"function"==typeof r&&r(e)},Wn=function(e){var n=e.isRowEditable,t=Zr(e,Bn);return qn(e.record,n)?r(A,t):null},zn=function(e){!function(e){var r=e.onRenderGrilla,n=e.onLoadGrilla,t=k(),o=Dn(e);a(function(){r&&r(o)},[]),a(function(){n&&n(o)},[t])}(e);var n=Ge(function(e){return e.breakpoints.down("sm")}),t=An(e),o=L(e).hasEdit,i=e.isRowEditable,s=e.primaryText,c=e.secondaryText,u=e.desktopSize,d=void 0!==u&&u,p=Zr(e,Vn),m=e.children,f=l.count(e.children),v=s,g=c;return s||(f>=4||f>=3||f>=2?v=function(e){return e[m[0].props.source]+" - "+e[m[1].props.source]}:1==f&&(v=function(e){return e[m[0].props.source]})),c||(f>=4?g=function(e){return e[m[2].props.source]+" - "+e[m[3].props.source]}:f>=3?g=function(e){return e[m[2].props.source]}:f>=2?v=function(e){return e[m[0].props.source]+" - "+e[m[1].props.source]}:1==f&&(v=function(e){return e[m[0].props.source]})),n&&!1===d?r(B,{linkType:function(e){return!(!o||!qn(e,i))&&"edit"},primaryText:v,secondaryText:g}):r(ur,{className:t.container},r(V,Ur({stickyHeader:!0},p),l.map(m,function(e){return e.props.hidden?null:e}),o&&r(Wn,{isRowEditable:i})))},Hn=["ids"],jn=["filterValues","setFilters","tabs","GridComponent"],Gn=function(e){var n=e.filterValues,t=e.setFilters,a=e.tabs,o=a.ids,l=Zr(a,Hn),s=e.GridComponent,c=void 0===s?zn:s,u=Zr(e,jn),d=n.id;return r(i,null,r(gr,{value:d,indicatorColor:"primary",onChange:function(e,r){t(Ur({},n,{id:r}))}},o.map(function(e){return r(vr,{key:e,label:e.charAt(0).toUpperCase()+e.slice(1),value:e})})),r(fr,null),r(c,Ur({},u,l[d])))},Jn=["useFormulario"],Un=function(e){var r=e.useFormulario;return{fichaProps:(void 0===r?On:r)(Zr(e,Jn))}},Zn=["basePath","className","record","hasEdit","hasShow","hasList","resource","totalPages","showFilter","setSort","setPerPage","perPage","defaultTitle","setPage","setFilters","selectedIds","onUnselectItems","onToggleItem","loaded","loading","exporter","hideFilter","hasCreate","filterValues","displayedFilters","currentSort"],Qn=["children","basePath","className","data","hasShow","hasList"],Yn=function(e){return e.split("_")[1]},Kn=hr(function(e){var r;return{form:{maxHeight:"70vh",overflow:"auto"},tab:{display:"block",maxHeight:"65vh",overflow:"auto"},contenido:(r={},r[e.breakpoints.up("md")]={width:"20vw"},r)}}),Xn=function(e,r){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf("/")){var n=e.split("/");return new Date(parseInt(n[2],10),parseInt(n[1],10)-1,parseInt(n[0],10)).toString()}var t=/(\d{4})-(\d{2})-(\d{2})/.exec(e);if(null!==t){var a=new Date(parseInt(t[1],10),parseInt(t[2],10)-1,parseInt(t[3],10));if(!isNaN(a))return a.toString()}},$n=function(e,r){if(!e)return"";var n=e.split(" "),t="";switch(n[1]){case"Jan":t="01";break;case"Feb":t="02";break;case"Mar":t="03";break;case"Apr":t="04";break;case"May":t="05";break;case"Jun":t="06";break;case"Jul":t="07";break;case"Aug":t="08";break;case"Sep":t="09";break;case"Oct":t="10";break;case"Nov":t="11";break;case"Dec":t="12"}return n[2]+"/"+t+"/"+n[3]},et=function(e){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf("/")){var r=e.split("/");return new Date(parseInt(r[2].substr(0,4),10),parseInt(r[1],10)-1,parseInt(r[0],10),r[2].substr(5,2),r[2].substr(8,2)).toString()}var n=/(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2})/.exec(e);if(null!==n){var t=new Date(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10),n[4],n[5]);if(!isNaN(t))return t.toString()}},rt=function(e,r){if(!e)return"";var n=e.split(" "),t="";switch(n[1]){case"Jan":t="01";break;case"Feb":t="02";break;case"Mar":t="03";break;case"Apr":t="04";break;case"May":t="05";break;case"Jun":t="06";break;case"Jul":t="07";break;case"Aug":t="08";break;case"Sep":t="09";break;case"Oct":t="10";break;case"Nov":t="11";break;case"Dec":t="12"}return n[2]+"/"+t+"/"+n[3]+" "+n[4].substr(0,5)},nt=function(e){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf(":")){var r=e.split(":"),n=new Date;return n.setHours(r[0]),n.setMinutes(r[1]),n.toString()}var t=/(\d{2}):(\d{2})/.exec(e);if(null!==t){var a=new Date;return a.setHours(t[0]),a.setMinutes(t[1]),a.toString()}},tt=function(e,r){return e?e.split(" ")[4].substr(0,5):""},at=function(e){return r(nr,{variant:"h6",gutterBottom:!0},e.children)},ot=function(e){var n=e.children,t=e.basePath,a=e.className,o=e.data,i=e.hasShow,l=Zr(e,Qn);return r(q,Ur({className:a},Zr(l,Zn)),n,r(W,{label:"ra.action.back",basePath:t,icon:r(br,null)}),i&&r(z,{basePath:t,record:o}))},it=H(),lt=[it,j(1)],st={format:"dd/MM/yyyy"},ct=function(e){return function(r,n){var t=n[e];if(r&&t){var a=t.split("/").reverse().join("/"),o=r.split("/").reverse().join("/");if(kr(a).isAfter(o))return{message:"validation.greater_or_equal",args:{menor:t}}}}},ut=function(e){return void 0===e&&(e="es"),{locale:"en"==e?yr:Cr}},dt=[{id:"1",name:"Aprobado"},{id:"2",name:"Rechazado"},{id:"3",name:"Pendiente"}],pt=function(e,r){var n=document.createElement("a");n.style.display="none",document.body.appendChild(n),n.setAttribute("href",e),n.setAttribute("download",r),n.click()},mt=function(e,r){var n=G();return Me(function(t){var a;return(null===(a=t.admin.resources["cb_"+Yn(n)+"_"+e].data[r])||void 0===a?void 0:a.etiqueta)||""})},ft=u({}),vt=["useFormulario","enableLoad"],gt=function(e){var n=e.enableLoad,t=void 0===n||n,a=Zr(e,vt),i=G(e),l=Xr(i,{enabled:t}),s=l.data,c=l.loading,u=Un(e).fichaProps,d=o(function(){return{estado:"N",initialValues:s,loading:c,fichaProps:u}},[s,c,u]);return r(Cn,null,r(ft.Provider,{value:d},r(J,Ur({},a,null==u?void 0:u.panel))))};gt.propTypes={useFormulario:Be.func};var ht=["basePath","classes","filterValues","handleSubmit","handleSubmitWithRedirect","invalid","label","pristine","resource","saving","selectedIds","submitOnEnter","redirect"],bt=["resource","record","basePath","redirect","className","icon","label"],yt=er(function(e){return{deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:Sr(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}}),Ct=function(e){var n=yt(e),t=v(),a=e.resource,o=e.record,i=e.className,l=e.icon,s=e.label,c=void 0===s?"ra.action.delete":s,u=Zr(e,bt),d=U(a,o.id),p=d[0],m=d[1].loading;return r(wr,{title:t("ra.action.delete")},r(Nr,Ur({disabled:m,onClick:p,label:c,className:xr("ra-delete-button",n.deleteButton,i),key:"button"},Zr(u,ht)),l))};Ct.defaultProps={redirect:"list",icon:r(sr,null)};var kt=["useFormulario"],Nt=function(e){var n=Zr(e,kt),t=Z(n),a=t.record,i=t.loading,l=Un(e).fichaProps,s=o(function(){return{estado:"M",initialValues:a,loading:i,fichaProps:l}},[a,i,l]);return r(Cn,null,r(ft.Provider,{value:s},r(Q,Ur({},n,null==l?void 0:l.panel))))},St=er(function(e){return{snackbarContent:{whiteSpace:"pre-wrap"}}}),wt=function(e){var n=St(e);return r(Y,Ur({},e,{className:n.snackbarContent}))},xt=hr(function(e){return{button:{margin:e.spacing(1)},input:{display:"none"}}}),Tt=e(function(e,n){var t=e.isOpen,a=e.onConfirm,o=e.onClose,i=e.title,l=e.dialogText,s=e.children,c=e.hasAccept,u=void 0===c||c,d=e.hasCancel,p=void 0===d||d,m=e.loading,f=void 0!==m&&m,v=xt(e),g=function(e){o&&o(e)};return r(Ze,{ref:n,open:t,fullWidth:!0,onClose:g,"aria-labelledby":"form-dialog-title"},r(Xe,{id:"form-dialog-title"},i),r(Ye,null,r(Ke,null,l),s),(u||p)&&r(Qe,null,p&&r(Tr,{onClick:g,variant:"contained",color:"secondary",className:v.button,disabled:f},"Cancelar"),u&&r(Tr,{onClick:function(e){a&&a(e)},variant:"contained",color:"primary",className:v.button,disabled:f},"Ok")))}),Pt=hr(function(e){return{block:{pointerEvents:"none",backgroundColor:"#ffffff",opacity:.6,position:"relative"},progress:{position:"absolute",left:"50%",top:"50%"}}}),Ft=function(e){var n=Pt(e),t=kn(),o=G(e),i=d(ft),l=i.estado,s=i.loading,c=i.fichaProps,u=Ln({resource:o});return a(function(){c.onRenderFicha&&c.onRenderFicha(u,l)},[]),a(function(){s||c.onLoadFicha&&c.onLoadFicha(u,l)},[s]),r(K,{className:t.open?n.block:""},t.open&&r(Je,{className:n.progress,thickness:4,size:50}),e.children)},It=function(e){return r(Ft,e)},Rt=["mutators"],_t={setError:function(e,r){r.fields[e[0]].data=e[1]}},Et=function(e){var n=d(ft),t=n.initialValues,a=n.fichaProps,o=a.onBeforeSubmitFicha,i=a.config,l=(i=void 0===i?{}:i).mutators,s=void 0===l?{}:l,u=Zr(i,Rt),p=s===_t?s:Ur({},_t,s),m=Mn(e),f=x(),v=c(function(r,n,t){var a=o&&o(Ur({form:{values:r}},m),"N");return"string"==typeof a?void f(a,"warning"):void 0===a||a?e.save(r,n,t):void 0},[o,m]);return r(_,Ur({},e,u,{save:v,mutators:p,initialValues:t,render:function(e){return r(X,Ur({component:It},e))}}))};Et.propTypes=Ur({},$.propTypes),Et.defaultProps={margin:"normal",variant:"outlined"};var Ot=er(function(e){return{icon:{minWidth:e.spacing(5)},sidebarIsOpen:{paddingLeft:25,transition:"padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms"},sidebarIsClosed:{paddingLeft:0,transition:"padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms"}}}),Dt=function(e){var n=e.handleToggle,t=e.sidebarIsOpen,a=e.isOpen,o=e.name,l=e.icon,s=e.children,c=e.dense,u=v(),d=Ot(),p=r(_r,{dense:c,button:!0,onClick:n},r(Rr,{className:d.icon},a?r(Er,null):l),r(nr,{variant:"inherit",color:"textSecondary"},u(o)));return r(i,null,t||a?p:r(wr,{title:u(o),placement:"right"},p),r(Fr,{in:a,timeout:"auto",unmountOnExit:!0},r(Ir,{dense:c,component:"div",disablePadding:!0,className:t?d.sidebarIsOpen:d.sidebarIsClosed},s),r(fr,null)))},Mt=["items","translate"],Lt={marginTop:"1.5em"},Bt=function(e){var n=e.onMenuClick,a=e.dense,o=e.logout,l=v(),s=t({mnuPrueba:!1}),c=s[0],u=s[1],d=Ge(function(e){return e.breakpoints.down("sm")}),p=Ge(function(e){return e.breakpoints.down("xs")}),m=Me(function(e){return e.admin.ui.sidebarOpen}),f=function e(n){var t=n.items,a=n.translate,o=Zr(n,Mt),l=o.state,s=o.onMenuClick,c=o.handleToggle,u=o.dense,d=o.open;return t&&r(i,null,t.map(function(n){var t=n.name,i=n.menu,p=n.label;return i?r(Dt,{key:t,name:p,handleToggle:function(){return c(t)},isOpen:l[t],sidebarIsOpen:d,icon:r(Pr,null),dense:u},e(Ur({items:i,translate:a},o))):r(g,{key:t,to:"/"+t,primaryText:a("resources."+t+".name",{_:p}),onClick:s,sidebarIsOpen:d,dense:u,leftIcon:r(Pr,null)})}))}({items:JSON.parse(localStorage.getItem("menus")),handleToggle:function(e){u(function(r){var n;return Ur({},r,((n={})[e]=!r[e],n))})},state:c,activeClassName:"",iconClass:"",className:"",open:m,dense:a,onMenuClick:n,translate:l});return r(ee,{style:Lt},r(re,{primaryText:l("ra.page.dashboard"),onClick:n,sidebarIsOpen:m}),f,p&&r(g,{to:"/configuration",primaryText:l("pos.configuration"),leftIcon:r(Pr,null),onClick:n,sidebarIsOpen:m,dense:a}),p&&o,!p&&d&&o)},Vt=Ur({},ne);Vt.palette.type="dark",Vt.overrides.RaSidebar={drawerPaper:{position:"sticky"}},Vt.overrides.RaRichTextInput={"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}};var At=Ur({},ne);At.palette.type="light",At.overrides.RaSidebar={drawerPaper:{position:"sticky"}},At.overrides.RaRichTextInput={"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}};var qt={__proto__:null,lightTheme:At,darkTheme:Vt},Wt=["apiFolder"],zt=function(e){return r(ae,e)},Ht=function(e){var n=Zr(e,Wt),t=Me(function(e){return"dark"===e.theme?Vt:At});return r(te,Ur({},n,{appBar:Kr,sidebar:zt,menu:Bt,theme:t,notification:wt}))},jt=["className","exporter","filters","children"],Gt=function(e){var n=e.className,t=e.exporter,a=e.filters,i=e.children,l=Zr(e,jt),c=E(e),u=c.currentSort,d=c.displayedFilters,p=c.filterValues,m=c.basePath,f=c.selectedIds,v=c.showFilter,g=c.total,h=G(l),b=L(l).hasCreate;return o(function(){return r(q,Ur({className:n},oe(l)),a&&s(a,{resource:h,showFilter:v,displayedFilters:d,filterValues:p,context:"button"}),b&&r(ie,{basePath:m}),!1!==t&&r(le,{disabled:0===g,resource:h,sort:u,filterValues:p}),i)},[h,d,p,f,a,g])},Jt=["meta","input","render"],Ut=er(function(e){return{main:{display:"flex",flexDirection:"column",minHeight:"100vh",alignItems:"center",justifyContent:"flex-start",backgroundImage:function(e){return e.loginBackgroundImage},backgroundRepeat:"no-repeat",backgroundSize:"cover"},card:{minWidth:300,marginTop:"6em"},avatar:{margin:"1em",display:"flex",justifyContent:"center"},avatarIcon:{backgroundColor:e.palette.secondary.main},icon:function(r){return{position:"absolute",left:e.spacing(14-Math.ceil(r.textLength/2)-1)}},hint:{marginTop:"1em",display:"flex",justifyContent:"center",color:e.palette.grey[500]},form:{padding:"0 1em 1em 1em"},input:{marginTop:"1em"},actions:{padding:"0 1em 1em 1em"}}}),Zt=function(e){var n=e.meta,t=(n=void 0===n?{touched:!1,error:void 0}:n).touched,a=n.error,o=Ur({},e.input),i=Zr(e,Jt);return r(Br,Ur({error:!(!t||!a),helperText:t&&a},o,i,{fullWidth:!0}))},Qt=function(e){var n=e.loginBackgroundImage,a=e.nameSource,o=void 0===a?"username":a,i=e.passwordSource,l=void 0===i?"password":i,s=t(!1),c=s[0],u=s[1],d=v(),p=d("ra.auth.sign_in"),f=Ut({loginBackgroundImage:n,textLength:p.length}),g=x(),h=se(),b=Ar();return r(pr,{onSubmit:function(e){u(!0),h(e,b.state?b.state.nextPathname:"/").catch(function(e){u(!1),g("string"==typeof e?e:void 0!==e&&e.message?e.message:"ra.auth.sign_in_error","warning")})},validate:function(e){var r={};return e[o]||(r[o]=d("ra.validation.required")),e[l]||(r[l]=d("ra.validation.required")),r},render:function(e){return r("form",{onSubmit:e.handleSubmit},r("div",{className:f.main},r(Dr,{className:f.card},r("div",{className:f.avatar},r(Or,{className:f.avatarIcon},r(m,null))),r("div",{className:f.hint},"Inicio de Sesión"),r("div",{className:f.form},r("div",{className:f.input},r(mr,{autoFocus:!0,name:o,component:Zt,label:d("ra.auth.username"),disabled:c})),r("div",{className:f.input},r(mr,{name:l,component:Zt,label:d("ra.auth.password"),type:"password",disabled:c}))),r(Mr,{className:f.actions},r(Tr,{variant:"contained",type:"submit",color:"primary",disabled:c,fullWidth:!0},c&&r(Lr,{className:f.icon,size:18,thickness:2}),p))),r(Y,null)))}})},Yt=function(e){return r(Vr,{theme:rr(At)},r(Qt,e))},Kt=["displayedFilters","filterValues","showFilter"],Xt=["className","options","icon"],$t=er({root:{display:"inline-block"}}),ea=function(e){var a=e.className,o=e.options,i=void 0===o?[]:o,l=e.icon,s=Zr(e,Xt),c=t(!1),u=c[0],d=c[1],p=n(),m=t(0),f=m[0],v=m[1],g=$t(e),h=G(e);return r("div",Ur({className:xr(g.root,a)},Zr(s,Kt)),r(T,{className:"add-filter",label:i[f].label,onClick:function(e){e.preventDefault(),d(!0),p.current=e.currentTarget}},l),r(zr,{open:u,anchorEl:p.current,onClose:function(e){p.current&&p.current.contains(e.target)||d(!1)}},i.map(function(e,n){return r(_r,{key:e.label,disabled:e.disabled,selected:n===f,onClick:function(r){return function(e,r){v(r),d(!1)}(0,n)&&(null==e?void 0:e.onClick(r,n))},resource:h,title:e.label},r(ce,{label:e.label,resource:h}))})))},ra=["fields","className","basePath","record","textAlign","sortable"],na=function(e){var n=e.fields,t=e.className,a=e.record,o=Zr(e,ra),i=n.separador,l=void 0===i?"":i,s=n.secundario,c=void 0===s?[]:s,u=n.hasSecundario,d=n.campos.map(function(e){return void 0!==a[e]?a[e]:e}).join(""+l);return r(nr,Ur({noWrap:!0,variant:"inherit",className:t},o),d,u&&r(nr,{component:"span",display:"block",color:"textSecondary",variant:"caption"},c.map(function(e){return(e.etiqueta||"---")+": "+(a[e.campo]||"---")}).join(" ")))},ta=["useFormulario"],aa=function(e){var n=Zr(e,ta),t=ue(n),a=t.record,i=t.loading,l=Un(e).fichaProps,s=o(function(){return{estado:"M",initialValues:a,loading:i,fichaProps:l}},[a,i,l]);return r(Cn,null,r(ft.Provider,{value:s},r(de,Ur({},n,t,null==l?void 0:l.panel))))},oa=["basePath","children","className","classes","component","form","handleSubmit","handleSubmitWithRedirect","invalid","mutationMode","pristine","record","redirect","resource","saving","submitOnEnter","syncWithLocation","tabs","toolbar","undoable","variant","margin"],ia=["active","dirty","dirtyFields","dirtyFieldsSinceLastSubmit","dirtySinceLastSubmit","error","errors","hasSubmitErrors","hasValidationErrors","initialValues","modified","modifiedSinceLastSubmit","save","submitError","submitErrors","submitFailed","submitSucceeded","submitting","touched","valid","validating","values","visited","__versions"],la=["mutators"],sa=function(e){var n=e.basePath,a=e.children,o=e.className,i=e.component,c=e.handleSubmit,u=e.handleSubmitWithRedirect,d=e.invalid,m=e.mutationMode,f=e.pristine,v=e.record,g=e.redirect,h=e.resource,b=e.saving,y=e.submitOnEnter,C=e.syncWithLocation,k=void 0===C||C,N=e.tabs,S=e.toolbar,w=e.undoable,x=e.variant,T=e.margin,P=Zr(e,oa),F=ca(e),I=qr(),R=Ar(),_=I?I.url:R.pathname,E=t(0),O=E[0],D=E[1];return r("form",Ur({className:xr("tabbed-form",o)},ua(P)),s(N,{classes:F,url:_,syncWithLocation:k,onChange:function(e,r){k||D(r)},value:O},a),r(Ue,null),r(i,{className:F.content},l.map(a,function(e,t){if(e){var a=pe(e,t,_);return r(Wr,{exact:!0,path:me(a)},function(r){return p(e)?s(e,{intent:"content",classes:F,resource:h,record:v,basePath:n,hidden:k?!r.match:O!==t,variant:e.props.variant||x,margin:e.props.margin||T,value:k?a:t}):null})}})),S&&s(S,{basePath:n,className:"toolbar",handleSubmitWithRedirect:u,handleSubmit:c,invalid:d,mutationMode:m,pristine:f,record:v,redirect:g,resource:h,saving:b,submitOnEnter:y,undoable:w}))},ca=er(function(e){return{errorTabButton:{color:e.palette.error.main},content:{paddingTop:e.spacing(1),paddingLeft:e.spacing(2),paddingRight:e.spacing(2)}}},{name:"RaTabbedForm"});sa.defaultProps={submitOnEnter:!0,tabs:r(fe,null),toolbar:r(ve,null),component:function(e){return r("div",{className:e.className},e.children)}};var ua=function(e){return Zr(e,ia)},da={setError:function(e,r){r.fields[e[0]].data=e[1]}},pa=function(e){var n=d(ft),t=n.initialValues,a=n.fichaProps,o=a.onBeforeSubmitFicha,i=a.config,l=(i=void 0===i?{}:i).mutators,s=void 0===l?{}:l,u=Zr(i,la),p=s===da?s:Ur({},da,s),m=Mn(e),f=x(),v=c(function(r,n,t){var a=o&&o(Ur({form:{values:r}},m),"N");return"string"==typeof a?void f(a,"warning"):void 0===a||a?e.save(r,n,t):void 0},[o,m]);return r(_,Ur({},e,u,{save:v,mutators:p,initialValues:t,render:function(e){return r(sa,Ur({component:It},e))}}))};pa.defaultProps={margin:"normal",variant:"outlined",syncWithLocation:!1},Hr.ra.page.empty="No records yet";var ma=Ur({},Hr,{login:{id:"ID",hint:"Login",required:"Insert Username or ID",send:"Send",email:"Enter your email address",check_email:"Check your email inbox, we just send you a verification code!",must_enter_credentials:"You must first enter Username or ID",restore_password:"Restore Password",punch_in:"Punch In"},pos:{search:"Search",change_pin:"Change Pin",change_password:"Change Password",configuration:"Configuration",language:"Language",theme:{name:"Theme",light:"Light",dark:"Dark"},dashboard:{welcome:{title:"Welcome",subtitle:"Employee Management",aor_button:"Metiri WebSite"}}},validation:{greater_or_equal:"Must be greater than or equal to %{menor}"}});jr.ra.notification.created="Datos guardados correctamente",jr.ra.action.bulk_actions="1 seleccionado |||| %{smart_count} selecccionados",jr.ra.page.dashboard="Inicio",jr.ra.page.empty="Sin registros todavía",jr.ra.page.invite="¿Quiere agregar uno?",jr.ra.page.list="%{name}",jr.ra.page.edit="Editar %{name}",jr.ra.action.back="Volver";var fa=Ur({},jr,{login:{id:"Cédula",hint:"Inicio de Sesión",required:"Ingrese Usuario o Cédula",email:"Ingrese su email aquí",send:"Enviar",check_email:"Revisa tu correo electrónico, te enviaremos un código de verificación!",must_enter_credentials:"Debe ingresar Nº de Usuario o Cédula y Contraseña primero",restore_password:"Restablecer Contraseña",punch_in:"Generar Marcas"},pos:{search:"Búsqueda",change_pin:"Cambiar Pin",change_password:"Cambiar Contraseña",configuration:"Configuración",language:"Lenguaje",theme:{name:"Tema Visual",light:"Light",dark:"Dark"},dashboard:{welcome:{title:"Bienvenid@",subtitle:"Gestión de Funcionarios",aor_button:"Sitio de Metiri"}}},validation:{greater_or_equal:"Debe ser mayor o igual a %{menor}"}}),va=["hidden"],ga=["hidden","useContenido"],ha=["hidden"],ba=function(e){var r=d(ft),n=r.estado,t=r.loading,a=r.fichaProps,o=(void 0===a?{}:a)[e.source],i=void 0===o?{}:o,l=e.hidden,s=void 0!==l&&l,c=Zr(e,va),u=i.hidden,p=i.useContenido,m=void 0===p?On:p,f=Zr(i,ga),v=void 0!==u?u:s,g=m(Ur({},c,{estado:n,hidden:v,loading:t},f)),h=g.hidden,b=Zr(g,ha);if(void 0===g)throw new Error("useContenido está devolviendo undefined para el contenido "+e.source+"\n Asegúrese de incluir una instrucción return al final de la función");return{propsContenido:Ur({},c,f,b),hidden:void 0!==h?h:v}},ya=function(e){var n=ba(e),t=n.propsContenido,a=n.hidden,o=JSON.parse(JSON.stringify(e.record)),i=o[e.source];return o[e.source]=""!=i&&"0"!=i,!a&&r(ge,Ur({},t,{record:o}))},Ca=["onFocus","onChange","onBlur","hidden","disabled","validate"],ka=["onFocus","onBlur","onChange","hidden","disabled","useContenido","validate"],Na=["hidden","disabled","onFocus","onChnage","onBlur","validate"],Sa=function(e,r,n){return"string"==typeof(null==n?void 0:n.data)?n.data:void 0},wa=function(e){var r=d(ft),t=r.estado,a=r.loading,o=r.fichaProps,i=void 0===o?{}:o,l=Me(function(r){var n=r.configInputs?r.configInputs.filter(function(r){return r.id===e.source}):[];return n[0]?n[0]:null})||{},s=l.disabled,c=l.hidden,u=!0===l.required?it:void 0,p=i[e.source],m=void 0===p?{}:p,f=e.onFocus,v=e.onChange,g=e.onBlur,h=e.hidden,b=void 0!==h&&h,y=e.disabled,C=void 0!==y&&y,k=e.validate,N=Zr(e,Ca),S=he({source:e.source}).input,w=m.onFocus,x=m.onBlur,T=m.onChange,P=m.hidden,F=m.disabled,I=m.useContenido,R=void 0===I?On:I,_=m.validate,E=Zr(m,ka),O=void 0!==P?P:b,D=void 0!==F?F:C,M=void 0!==w?w:f,L=void 0!==x?x:g,B=void 0!==T?T:v,V=Ln(e),A=R(Ur({},N,{estado:t,hidden:O,loading:a,utils:V},E)),q=n(S.value);if(void 0===A)throw new Error("useContenido está devolviendo undefined para el contenido "+e.source+"\n Asegúrese de incluir una instrucción return al final de la función");var W=A.hidden,z=A.disabled,H=A.onFocus,j=A.onChnage,G=A.onBlur,J=A.validate,U=Zr(A,Na),Z=H||M,Q=G||L,Y=j||B,K=Ur({},V,{prev:q.current}),X=Array.isArray(k)?k:[k],$=Array.isArray(_)?_:[_],ee=Array.isArray(J)?J:[J];return{propsContenido:Ur({onFocus:function(e){Z&&M(V,t,e),q.current=e.target.value},onBlur:function(e){return Q&&Q(K,t,e)},onChange:function(e){return Y&&Y(K,t,e)},helperText:!1,validate:[].concat(X,$,ee,[Sa,u]).filter(function(e){return void 0!==e})},N,E,U,{disabled:void 0!==s?s:void 0!==z?z:D}),hidden:void 0!==c?c:void 0!==W?W:O}},xa=function(e){var n=wa(e);return!n.hidden&&r(be,Ur({accept:"",maxSize:5e6},n.propsContenido),r(ye,{source:"src"}))},Ta=function(e){var n=wa(e);return!n.hidden&&r(Ce,n.propsContenido)},Pa=["callback"],Fa=["helperText"],Ia=["callback"],Ra=function(e){var n=e.callback,t=Zr(e,Pa),o=E(t),i=o.loading,l=o.data;return a(function(){i||"function"==typeof n&&n(Object.values(l))},[i]),r(we,t)},_a=function(e){var t,o,i=wa(e),l=i.propsContenido,s=i.hidden,c=n(!1),u=Le(),d=k(),p=l.helperText,m=Zr(l,Fa),f=Me(function(r){var n=r.reload_cb?r.reload_cb.filter(function(r){return r.id===e.source}):[];return n[0]?n[0]:null}),v=n(f),g=null===f&&v.current?v.current:f;return g&&(t=g.callback,o=Zr(g,Ia)),a(function(){null!==f&&(v.current=f,u(xn(e.source)))},[JSON.stringify(f)]),a(function(){c.current=!0},[d]),c.current?!s&&r(ke,Ur({},m,{perPage:250,filter:o}),r(Ra,{callback:t,helperText:p,optionText:"etiqueta",optionValue:e.source})):r(Ne,{id:e.id,label:e.label,source:e.source,resource:e.resource,className:e.className,isRequired:e.isRequired,meta:e.meta,input:e.input,margin:e.margin},r(Se,{timeout:1}))},Ea=function(e){var n=wa(e);return!n.hidden&&r(we,n.propsContenido)},Oa=function(e){var n=e.title,t=e.source,a=e.src,o=xe(e);return r(Or,{title:n,src:a+"/"+o[t]})},Da=["helperText"],Ma=function(e){var t=wa(e),o=t.propsContenido,i=t.hidden,l=n(!1),s=k(),c=o.helperText,u=Zr(o,Da);return a(function(){l.current=!0},[s]),l.current?!i&&r(Te,u,r(Pe,{helperText:c,optionText:"etiqueta",optionValue:e.source})):r(Ne,{id:e.id,label:e.label,source:e.source,resource:e.resource,className:e.className,isRequired:e.isRequired,meta:e.meta,input:e.input,margin:e.margin},r(Se,{timeout:1}))},La=function(e){var n=wa(e);return!n.hidden&&r(Fe,n.propsContenido)},Ba=["helperText"],Va=function(e){var t=wa(e),o=t.propsContenido,i=t.hidden,l=n(!1),s=k(),c=o.helperText,u=Zr(o,Ba);return a(function(){l.current=!0},[s]),l.current?!i&&r(ke,u,r(Ie,{helperText:c,optionText:"etiqueta",optionValue:e.source})):r(Ne,{id:e.id,label:e.label,source:e.source,resource:e.resource,className:e.className,isRequired:e.isRequired,meta:e.meta,input:e.input},r(Se,null))},Aa=function(e){var n=wa(e);return!n.hidden&&r(Ie,n.propsContenido)},qa=function(e){var n=wa(e);return!n.hidden&&r(Re,Ur({multiline:!0},n.propsContenido))},Wa=["tipo"],za=function(e){var n=e.tipo,t=Zr(e,Wa),o=wa(t),i=o.propsContenido,l=o.hidden,s=dr(),c=he({source:e.source}),u=c.input,d=c.meta,p="F"===n||"Z"===n;a(function(){i.value&&(s.change(e.source,i.value),e.disabled&&s.blur(e.source))}),a(function(){p&&""!=u.value&&d.valid&&d.modified&&!d.active&&i.onBlur()},[u.value]);var m=Ur({},i);return!l&&("N"===n||"D"===n?r(_e,m):"F"===n?r(Gr,m):"Z"===n?r(Jr,m):r(Re,"H"===n?Ur({},m,{type:"time"}):m))},Ha=["tipo","value"],ja=function(e){var n=e.tipo,t=Zr(e,Ha),a=ba(t),o=a.hidden,i=Ur({},a.propsContenido);return!o&&("N"===n||"D"===n?r(Ee,i):"F"===n?r(Oe,i):"Z"===n?r(Oe,Ur({},i,{showTime:!0})):r(De,i))};export{Kr as AppBar,ya as BooleanField,xa as Camino,Ta as CheckBox,_a as ComboBox,Ea as ComboBoxManual,gt as CreateEtriek,Ct as DeleteButtonNoWarning,Nt as EditEtriek,vn as EtrGrid,wt as EtriekNotification,ot as FichaActions,ft as FichaContext,Tt as FormDialog,Et as FormEtriek,bn as GE,zn as GrillaEtriek,Oa as ImageField,Ht as Layout,Gt as ListActionsEtriek,Ma as ListCheck,Yt as Login,Bt as Menu,ea as MenuButton,na as MultiTextField,La as Password,Va as RadioButton,Aa as RadioButtonManual,at as Separador,aa as ShowEtriek,Dt as SubMenu,pa as TabbedFormEtriek,Gn as TabbedGrillaEtriek,qa as TextArea,za as TextBox,ja as TextField,dt as choicesEstado,Xn as dateFormat,st as dateFormatOptions,$n as dateParser,et as dateTimeFormat,rt as dateTimeParser,xn as deleteRecargarComboBox,pt as descargarLink,ma as enMessages,fa as esMessages,ct as etrFechaMayorQue,it as etrRequerido,lt as etrRequeridoNumerico,Yn as getFormcodFromResource,ut as localeOptions,wn as recargarComboBox,Pn as setDisableAction,Tn as setHiddenAction,Fn as setRequireAction,qt as themes,nt as timeFormat,tt as timeParser,Sn as useAjax,wa as useContenidoController,rn as useDeleteRowEtrGrid,ba as useFieldController,Nn as useGetJson,Un as useInitFicha,Xr as useNuevo,mt as useReferenceLabel,nn as useSaveRowEtrGrid,Kn as useStylesContenidos,Ln as useUtils,Dn as useUtilsGrilla};
1
+ import{forwardRef as e,createElement as r,useRef as n,useState as a,useEffect as t,useMemo as o,Fragment as i,Children as l,cloneElement as s,useCallback as c,createContext as u,useContext as d,isValidElement as m}from"react";import p from"@material-ui/icons/Lock";import f from"@material-ui/icons/VpnLock";import{useTranslate as g,MenuItemLink as h,AppBar as v,UserMenu as b,useGetOne as y,useMutation as C,useVersion as k,useGetList as N,Loading as S,useSafeSetState as P,useNotify as x,Button as T,SaveContextProvider as w,SaveButton as I,useDeleteWithConfirmController as F,Confirm as R,FormWithRedirect as O,useListContext as _,useRedirect as E,useRefresh as D,useUnselectAll as M,useResourceDefinition as L,SimpleList as B,Datagrid as V,EditButton as A,TopToolbar as q,ListButton as W,ShowButton as z,required as j,minValue as H,useResourceContext as G,Create as J,useDelete as U,useEditController as Z,Edit as Q,Notification as Y,CardContentInner as K,SimpleFormView as X,SimpleForm as $,Menu as ee,DashboardMenuItem as re,defaultTheme as ne,Layout as ae,Sidebar as te,sanitizeListRestProps as oe,CreateButton as ie,ExportButton as le,useLogin as se,FieldTitle as ce,useShowController as ue,Show as de,getTabFullPath as me,escapePath as pe,TabbedFormTabs as fe,Toolbar as ge,BooleanField as he,useInput as ve,FileInput as be,ImageField as ye,BooleanInput as Ce,ReferenceInput as ke,Labeled as Ne,LinearProgress as Se,SelectInput as Pe,useRecordContext as xe,ReferenceArrayInput as Te,SelectArrayInput as we,PasswordInput as Ie,RadioButtonGroupInput as Fe,TextInput as Re,NumberInput as Oe,useDataProvider as _e,List as Ee,TextField as De,NumberField as Me,DateField as Le}from"react-admin";import{useSelector as Be,useDispatch as Ve}from"react-redux";import Ae,{string as qe,func as We,any as ze,bool as je}from"prop-types";import{alpha as He,createTheme as Ge,ThemeProvider as Je,useMediaQuery as Ue,CircularProgress as Ze,Divider as Qe,Box as Ye,Paper as Ke}from"@material-ui/core";import Xe from"@material-ui/core/Dialog";import $e from"@material-ui/core/DialogActions";import er from"@material-ui/core/DialogContent";import rr from"@material-ui/core/DialogContentText";import nr from"@material-ui/core/DialogTitle";import ar from"@material-ui/core/Paper";import{makeStyles as tr,createTheme as or}from"@material-ui/core/styles";import ir from"@material-ui/core/Typography";import{GridOverlay as lr,esES as sr,DataGrid as cr}from"@material-ui/data-grid";import ur from"@material-ui/icons/Add";import dr from"@material-ui/icons/Cancel";import mr from"@material-ui/icons/Delete";import pr from"@material-ui/icons/Edit";import fr from"@material-ui/core/TableContainer";import{useForm as gr,Form as hr,Field as vr}from"react-final-form";import br from"@material-ui/core/Divider";import yr from"@material-ui/core/Tab";import Cr from"@material-ui/core/Tabs";import kr from"@material-ui/core/styles/makeStyles";import Nr from"@material-ui/icons/ChevronLeft";import Sr from"date-fns/locale/en-US";import Pr from"date-fns/locale/es";import xr from"moment";import Tr from"@material-ui/core/IconButton";import{alpha as wr}from"@material-ui/core/styles/colorManipulator";import Ir from"@material-ui/core/Tooltip";import Fr from"classnames";import Rr from"@material-ui/core/Button";import Or from"@material-ui/icons/Settings";import _r from"@material-ui/core/Collapse";import Er from"@material-ui/core/List";import Dr from"@material-ui/core/ListItemIcon";import Mr from"@material-ui/core/MenuItem";import Lr from"@material-ui/icons/ExpandMore";import Br from"@material-ui/core/Avatar";import Vr from"@material-ui/core/Card";import Ar from"@material-ui/core/CardActions";import qr from"@material-ui/core/CircularProgress";import Wr from"@material-ui/core/TextField";import{ThemeProvider as zr}from"@material-ui/styles";import{useLocation as jr,useRouteMatch as Hr,Route as Gr}from"react-router-dom";import Jr from"@material-ui/core/Menu";import Ur from"ra-language-english";import Zr from"@blackbox-vision/ra-language-spanish";import{KeyboardDateInput as Qr,KeyboardDateTimeInput as Yr}from"react-admin-date-inputs";import Kr from"@material-ui/icons/RemoveCircleOutline";import Xr from"@material-ui/icons/Check";import $r from"@material-ui/icons/Search";import en from"@material-ui/icons/CheckCircle";import rn from"@material-ui/icons/ErrorOutline";import nn from"react-draggable";import{TreeView as an}from"devextreme-react";function tn(){return(tn=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function on(e,r){if(null==e)return{};var n,a,t={},o=Object.keys(e);for(a=0;a<o.length;a++)r.indexOf(n=o[a])>=0||(t[n]=e[n]);return t}var ln=e(function(e,n){var a=g(),t=Be(function(e){return[e.admin.resources.form_275?1:0,e.admin.resources.form_59?1:0]}),o=t[1];return[t[0]?r(h,{ref:n,key:"/form_275",to:"/form_275",primaryText:a("pos.change_pin"),leftIcon:r(p,null),onClick:e.onClick}):null,o?r(h,{ref:n,key:"/form_59",to:"/form_59",primaryText:a("pos.change_password"),leftIcon:r(f,null),onClick:e.onClick}):null]}),sn=function(e){return r(b,e,r(ln,null))},cn=function(e){return r(v,tn({},e,{elevation:1,userMenu:r(sn,null)}))},un=function(e,r){return y(e,"-1",r)},dn=tr(function(e){return{root:{"& .MuiDataGrid-columnsContainer":{backgroundColor:"light"===e.palette.type?"#fafafa":"#1d1d1d"},"& .MuiDataGrid-iconSeparator":{display:"none"}},header:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.light},rootPaper:{width:"100%",height:"40vh",borderRadius:0,marginTop:e.spacing(1)},rootOverlay:{flexDirection:"column","& .ant-empty-img-1":{fill:"light"===e.palette.type?"#aeb8c2":"#262626"},"& .ant-empty-img-2":{fill:"light"===e.palette.type?"#f5f5f7":"#595959"},"& .ant-empty-img-3":{fill:"light"===e.palette.type?"#dce0e6":"#434343"},"& .ant-empty-img-4":{fill:"light"===e.palette.type?"#ffffff":"#1c1c1c"},"& .ant-empty-img-5":{fillOpacity:"light"===e.palette.type?"0.8":"0.08",fill:"light"===e.palette.type?"#f5f5f5":"#ffffff"}},label:{marginTop:e.spacing(1)},deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:He(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}},{name:"GE"}),mn=function(){var e=dn();return r(lr,{className:e.rootOverlay},r("svg",{width:"120",height:"100",viewBox:"0 0 184 152","aria-hidden":!0,focusable:"false"},r("g",{fill:"none",fillRule:"evenodd"},r("g",{transform:"translate(24 31.67)"},r("ellipse",{className:"ant-empty-img-5",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),r("path",{className:"ant-empty-img-1",d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z"}),r("path",{className:"ant-empty-img-2",d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z"}),r("path",{className:"ant-empty-img-3",d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z"})),r("path",{className:"ant-empty-img-3",d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z"}),r("g",{className:"ant-empty-img-4",transform:"translate(149.65 15.383)"},r("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),r("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"})))),r("div",{className:e.label},"No hay registros"))},pn=function(e,r,n){return C({type:"deleteEtrRow",resource:e,payload:{params:r}},n)},fn=function(e,r,n,a){return C({type:e,resource:r,payload:{params:n}},a)},gn=["api","basePath","classes","className","confirmTitle","confirmContent","icon","record","redirect","onSuccess","onFailure","source","camposClaveFila"],hn=["filterBy","claves","sortModel","columns","reference","allowAdd","allowRemove","etrResource","enableLoad"],vn=tr(function(e){return{root:{"& .MuiDataGrid-columnsContainer":{backgroundColor:"light"===e.palette.type?"#fafafa":"#1d1d1d"},"& .MuiDataGrid-iconSeparator":{display:"none"}},header:{color:e.palette.secondary.contrastText,backgroundColor:e.palette.secondary.light},rootPaper:{width:"100%",height:"40vh",borderRadius:0,marginTop:e.spacing(1)},rootOverlay:{flexDirection:"column","& .ant-empty-img-1":{fill:"light"===e.palette.type?"#aeb8c2":"#262626"},"& .ant-empty-img-2":{fill:"light"===e.palette.type?"#f5f5f7":"#595959"},"& .ant-empty-img-3":{fill:"light"===e.palette.type?"#dce0e6":"#434343"},"& .ant-empty-img-4":{fill:"light"===e.palette.type?"#ffffff":"#1c1c1c"},"& .ant-empty-img-5":{fillOpacity:"light"===e.palette.type?"0.8":"0.08",fill:"light"===e.palette.type?"#f5f5f5":"#ffffff"}},label:{marginTop:e.spacing(1)},deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:He(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}},{name:"EtrGrid"}),bn={marginLeft:"1.6rem",fontWeight:"bold"},yn=r(mr,null),Cn=function(e){var n=e.basePath,a=e.confirmTitle,t=void 0===a?"ra.message.delete_title":a,o=e.confirmContent,l=void 0===o?"ra.message.delete_content":o,s=e.icon,u=void 0===s?yn:s,d=e.record,m=e.redirect,p=void 0!==m&&m,f=e.onSuccess,g=e.onFailure,h=e.source,v=e.camposClaveFila,b=on(e,gn),y=vn(e),C=x(),k=F({record:d,redirect:p,basePath:n,onSuccess:f,onFailure:g}),N=k.open,S=k.loading,P=k.handleDialogOpen,w=k.handleDialogClose,I=pn(e.resource,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);C("ra.notification.deleted","info",{smart_count:1})},onFailure:function(e){C(e.message,"warning")}})[0],O=Object.keys(d).filter(function(e){return v.split(",").includes(e)}).reduce(function(e,r){return e[r]=d[r],e},{}),_=c(function(e){I({payload:{ge:h,clavesFila:O}})},[d]);return r(i,null,r(T,tn({key:"button",onClick:P,className:y.deleteButton},b),u),r(R,{isOpen:N,loading:S,title:t,content:l,onConfirm:_,onClose:w}))},kn=function(e){return r(Xe,{open:e.open,onClose:e.onClose,fullWidth:!0},r(nr,null,e.labelEstado+" "+e.label),r(rr,null,r(ir,{component:"span",display:"block",variant:"subtitle1",style:tn({},bn)},e.msgTitle),e.msgDesc),r(O,{resource:e.resource,save:e.save,render:e.render,initialValues:e.initialValues}))};kn.propTypes={label:qe,onClick:We,icon:ze,open:je,onClose:We,labelEstado:qe,msgTitle:ze,msgDesc:ze,resource:ze,save:We,render:We};var Nn=function(e){return r(Cn,{api:!0,confirmTitle:"ra.action.delete",source:e.source,record:e.row,resource:e.resource,camposClaveFila:e.camposClaveFila})},Sn=function(e){var n=e.editors,a=e.record,t=e.clavesFila,c=e.camposClaveFila,u=e.resource,d=e.label,m=e.source,p=e.etrResource,f=P(!1),h=f[0],v=f[1],b=un(p,{enabled:h}).data,y=fn("createEtrRow",u,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);v(!1),N("ra.notification.created","info")},onFailure:function(e){N(e.message,"warning")}}),C=y[0],k=y[1].loading,N=x(),S=g()("ra.action.create"),F=function(e){C({payload:{data:tn({},e,t),ge:m,camposClaveFila:c,estado:"N"}})},R=o(function(){return{save:F,setOnFailure:function(e){return console.log(e)}}},[F]);return r(i,null,r(T,{onClick:function(e){v(!0),e.stopPropagation()}},r(ur,null)),r(w,{value:R},r(kn,{open:h,onClose:function(e){v(!1),e.stopPropagation()},labelEstado:S,label:d,msgTitle:e.msgTitle,msgDesc:e.msgDesc,resource:u,save:F,initialValues:b,render:function(e){var t=e.handleSubmitWithRedirect,o=e.pristine,c=e.saving;return r(i,null,r(er,null,l.map(n,function(e,r){return s(e,{resource:u,estado:"N",initialValue:a[e.props.source],fullWidth:!0,disabled:void 0!==e.props.disabled&&e.props.disabled,InputLabelProps:{shrink:!0}})})),r($e,null,r(I,{handleSubmitWithRedirect:t,pristine:o,saving:c,disabled:k}),r(T,{label:"ra.action.cancel",onClick:function(e){v(!1),e.stopPropagation()},disabled:k},r(dr,null))))}})))},Pn=function(e){var n=e.editors,a=e.clavesFila,t=e.camposClaveFila,o=e.resource,c=e.label,u=e.source,d=e.row,m=x(),p=g(),f=P(!1),h=f[0],v=f[1],b=fn("updateEtrRow",o,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);v(!1),m("ra.notification.updated","info",{smart_count:1})},onFailure:function(e){m(e.message,"warning")}}),y=b[0],C=b[1].loading,k=p("ra.action.edit");return r(i,null,r(T,{onClick:function(e){v(!0),e.stopPropagation()}},r(pr,null)),r(kn,{open:h,onClose:function(e){v(!1),e.stopPropagation()},labelEstado:k,label:c,msgTitle:e.msgTitle,msgDesc:e.msgDesc,resource:o,save:function(e){y({payload:{data:tn({},a,e),ge:u,camposClaveFila:t,estado:"M"}})},render:function(e){var a=e.handleSubmitWithRedirect,c=e.pristine,u=e.saving;return r(i,null,r(er,null,l.map(n,function(e,r){return s(e,{resource:o,estado:"M",initialValue:d[e.props.source],fullWidth:!0,disabled:-1!=t.indexOf(e.props.source),InputLabelProps:{shrink:!0}})})),r($e,null,r(I,{handleSubmitWithRedirect:a,pristine:c,saving:u,disabled:C}),r(T,{label:"ra.action.cancel",onClick:function(e){v(!1),e.stopPropagation()},disabled:C},r(dr,null))))}}))},xn=Ge({},sr),Tn=function(e){var i=e.filterBy,l=void 0===i?"":i,s=e.claves,c=e.sortModel,u=e.columns,d=e.reference,m=e.allowAdd,p=void 0===m||m,f=e.allowRemove,g=void 0===f||f,h=e.etrResource,v=e.enableLoad,b=void 0===v||v,y=on(e,hn),C=e.record,P=n(!1),x=vn(e),T=k(),w=a(c)[1],I=c[0],F=I.field,R=I.sort;t(function(){P.current=!0},[T]);var O=Object.keys(C).filter(function(e){return s.split(",").includes(e)}).reduce(function(e,r){return e[r]=C[r],e},{}),_={};l.split(",").forEach(function(e){e&&(_[e]=[{type:"string",comparison:"eq",value:C[e],field:e}])});var E=N(d,{page:1,perPage:200},{field:F,order:R},_,{enabled:b&&P.current}),D=E.data,M=E.ids,L=E.loading,B=o(function(){return M.map(function(e){return D[e]})},[M,D]),V=[p?{field:"BTN",headerName:"",sortable:!1,renderHeader:function(e){return r(Sn,tn({},y,{etrResource:h,camposClaveFila:s,clavesFila:O,api:e.api}))}}:{}].concat(u,[{field:" ",width:80,headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:function(e){return r(Pn,tn({},y,{camposClaveFila:s,clavesFila:O,api:e.api,row:e.row}))}},g?{field:" ",headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:function(e){return r(Nn,tn({},y,{camposClaveFila:s,api:e.api,row:e.row}))}}:{}]),A=o(function(){return V},[JSON.stringify(V)]);return L?r(S,null):r(ar,{className:x.rootPaper},r(Je,{theme:xn},r(cr,tn({className:x.root,disableSelectionOnClick:!0,pageSize:50,hideFooter:!0,sortModel:c,rows:B,columns:A,onSortModelChange:function(e){return w(e)},components:{NoRowsOverlay:mn}},y))))},wn=["filterBy","sortModel","columns","reference","filter","enableLoad"],In=Ge({},sr),Fn=function(e){var i=e.filterBy,l=void 0===i?"":i,s=e.sortModel,c=e.columns,u=e.reference,d=e.filter,m=void 0===d?[]:d,p=e.enableLoad,f=void 0===p||p,g=on(e,wn),h=e.record,v=n(!1),b=dn(e),y=k(),C=a(s),P=C[0],x=C[1],T=s[0],w=T.field,I=T.sort,F=o(function(){return[].concat(c)},[JSON.stringify(c)]);t(function(){v.current=!0},[y]);var R=[];l.split(",").forEach(function(e){e&&R.push({type:"string",comparison:"eq",value:h[e],field:e})});var O=tn({},R.concat(m)),_=N(u,{page:1,perPage:200},{field:w,order:I},O,{enabled:f&&v.current}),E=_.data,D=_.ids,M=_.loading,L=o(function(){return D.map(function(e){return E[e]})},[D,E]);return M?r(S,null):r(ar,{className:b.rootPaper},r(Je,{theme:In},r(cr,tn({className:b.root,disableSelectionOnClick:!0,pageSize:50,hideFooter:!0,rows:L,columns:F,sortModel:P,onSortModelChange:function(e){return x(e)},components:{NoRowsOverlay:mn}},g))))},Rn=u(),On=function(e){var n=e.children,t=a(!1),i=t[0],l=t[1],s=o(function(){return{open:i,show:function(){return l(!0)},hide:function(){return l(!1)}}},[i]);return r(Rn.Provider,{value:s},n)},_n=function(){return d(Rn)},En=function(e,r,n,a){return C({type:"getJson",resource:e,payload:{method:r,params:n}},a)},Dn=function(e){var r=En(e),n=r[0],a=r[1].loading;return[c(function(e,r,a){return n({payload:{params:r,method:e}},{returnPromise:!0,onSuccess:a,onFailure:a})},[]),a]},Mn=function(e,r,n,a){return{type:"RELOAD_CB",payload:{id:e,method:r,params:n,callback:a}}},Ln=function(e,r){return{type:"RELOAD_CB_SUCCESS",payload:{id:e,callback:r}}},Bn=function(e,r){return{type:"HIDE_INPUT",payload:{id:e,hidden:r}}},Vn=function(e,r){return{type:"DISABLE_INPUT",payload:{id:e,disabled:r}}},An=function(e,r){return{type:"REQUIRE_INPUT",payload:{id:e,required:r}}},qn=function(){var e=Ve();return c(function(r,n,a,t){e(Mn(r,n,a,t))},[e])},Wn=function(){var e=Ve();return c(function(r,n){e(Bn(r,n))},[e])},zn=function(){var e=Ve();return c(function(r,n){e(Vn(r,n))},[e])},jn=function(){var e=Ve();return c(function(r,n){e(An(r,n))},[e])},Hn=function(e){return{}},Gn=function(e){var r=_(e),n=x(),a=E(),t=D(),o=M(e.resource);return{ajax:Dn(e.resource)[0],data:r,notify:n,redirect:a,refresh:t,unselectAll:o}},Jn=function(e){var r=qn(),n=Wn(),a=zn(),t=jn(),o=_n(),i=x(),l=E();return{ajax:Dn(e.resource)[0],notify:i,redirect:l,recargarComboBox:r,progress:o,setHidden:n,setDisable:a,setRequire:t}},Un=function(e){var r=qn(),n=Wn(),a=zn(),t=jn(),o=_n(),i=x(),l=E();return{form:gr(),ajax:Dn(e.resource)[0],notify:i,redirect:l,recargarComboBox:r,progress:o,setHidden:n,setDisable:a,setRequire:t}},Zn=["isRowEditable"],Qn=["isRowEditable","primaryText","secondaryText","desktopSize","onRenderGrilla","onLoadGrilla","hasEdit"],Yn=tr(function(e){return{container:{maxHeight:"70vh"},rowOdd:{backgroundColor:e.palette.action.hover}}},{name:"GrillaEtriek"}),Kn=function(e,r){return void 0===r||"function"==typeof r&&r(e)},Xn=function(e){var n=e.isRowEditable,a=on(e,Zn);return Kn(e.record,n)?r(A,a):null},$n=function(e){!function(e){var r=e.onRenderGrilla,n=e.onLoadGrilla,a=k(),o=Gn(e);t(function(){r&&r(o)},[]),t(function(){n&&n(o)},[a])}(e);var n=Ue(function(e){return e.breakpoints.down("sm")}),a=Yn(e),o=L(e).hasEdit,i=e.isRowEditable,s=e.primaryText,c=e.secondaryText,u=e.desktopSize,d=void 0!==u&&u,m=on(e,Qn),p=e.children,f=l.count(e.children),g=s,h=c;return s||(f>=4||f>=3||f>=2?g=function(e){return e[p[0].props.source]+" - "+e[p[1].props.source]}:1==f&&(g=function(e){return e[p[0].props.source]})),c||(f>=4?h=function(e){return e[p[2].props.source]+" - "+e[p[3].props.source]}:f>=3?h=function(e){return e[p[2].props.source]}:f>=2?g=function(e){return e[p[0].props.source]+" - "+e[p[1].props.source]}:1==f&&(g=function(e){return e[p[0].props.source]})),n&&!1===d?r(B,{linkType:function(e){return!(!o||!Kn(e,i))&&"edit"},primaryText:g,secondaryText:h}):r(fr,{className:a.container},r(V,tn({stickyHeader:!0},m),l.map(p,function(e){return e.props.hidden?null:e}),o&&r(Xn,{isRowEditable:i})))},ea=["ids"],ra=["filterValues","setFilters","tabs","GridComponent"],na=function(e){var n=e.filterValues,a=e.setFilters,t=e.tabs,o=t.ids,l=on(t,ea),s=e.GridComponent,c=void 0===s?$n:s,u=on(e,ra),d=n.id;return r(i,null,r(Cr,{value:d,indicatorColor:"primary",onChange:function(e,r){a(tn({},n,{id:r}))}},o.map(function(e){return r(yr,{key:e,label:e.charAt(0).toUpperCase()+e.slice(1),value:e})})),r(br,null),r(c,tn({},u,l[d])))},aa=["useFormulario"],ta=function(e){var r=e.useFormulario;return{fichaProps:(void 0===r?Hn:r)(on(e,aa))}},oa=["basePath","className","record","hasEdit","hasShow","hasList","resource","totalPages","showFilter","setSort","setPerPage","perPage","defaultTitle","setPage","setFilters","selectedIds","onUnselectItems","onToggleItem","loaded","loading","exporter","hideFilter","hasCreate","filterValues","displayedFilters","currentSort"],ia=["children","basePath","className","data","hasShow","hasList"],la=function(e){return e.split("_")[1]},sa=kr(function(e){var r;return{form:{maxHeight:"70vh",overflow:"auto"},tab:{display:"block",maxHeight:"65vh",overflow:"auto"},contenido:(r={},r[e.breakpoints.up("md")]={width:"20vw"},r)}}),ca=function(e,r){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf("/")){var n=e.split("/");return new Date(parseInt(n[2],10),parseInt(n[1],10)-1,parseInt(n[0],10)).toString()}var a=/(\d{4})-(\d{2})-(\d{2})/.exec(e);if(null!==a){var t=new Date(parseInt(a[1],10),parseInt(a[2],10)-1,parseInt(a[3],10));if(!isNaN(t))return t.toString()}},ua=function(e,r){if(!e)return"";var n=e.split(" "),a="";switch(n[1]){case"Jan":a="01";break;case"Feb":a="02";break;case"Mar":a="03";break;case"Apr":a="04";break;case"May":a="05";break;case"Jun":a="06";break;case"Jul":a="07";break;case"Aug":a="08";break;case"Sep":a="09";break;case"Oct":a="10";break;case"Nov":a="11";break;case"Dec":a="12"}return n[2]+"/"+a+"/"+n[3]},da=function(e){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf("/")){var r=e.split("/");return new Date(parseInt(r[2].substr(0,4),10),parseInt(r[1],10)-1,parseInt(r[0],10),r[2].substr(5,2),r[2].substr(8,2)).toString()}var n=/(\d{4})-(\d{2})-(\d{2})\s(\d{2}):(\d{2})/.exec(e);if(null!==n){var a=new Date(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10),n[4],n[5]);if(!isNaN(a))return a.toString()}},ma=function(e,r){if(!e)return"";var n=e.split(" "),a="";switch(n[1]){case"Jan":a="01";break;case"Feb":a="02";break;case"Mar":a="03";break;case"Apr":a="04";break;case"May":a="05";break;case"Jun":a="06";break;case"Jul":a="07";break;case"Aug":a="08";break;case"Sep":a="09";break;case"Oct":a="10";break;case"Nov":a="11";break;case"Dec":a="12"}return n[2]+"/"+a+"/"+n[3]+" "+n[4].substr(0,5)},pa=function(e){if(!e)return"";if(e instanceof Date)return e.toString();if(-1!==e.indexOf(":")){var r=e.split(":"),n=new Date;return n.setHours(r[0]),n.setMinutes(r[1]),n.toString()}var a=/(\d{2}):(\d{2})/.exec(e);if(null!==a){var t=new Date;return t.setHours(a[0]),t.setMinutes(a[1]),t.toString()}},fa=function(e,r){return e?e.split(" ")[4].substr(0,5):""},ga=function(e){return r(ir,{variant:"h6",gutterBottom:!0},e.children)},ha=function(e){var n=e.children,a=e.basePath,t=e.className,o=e.data,i=e.hasShow,l=on(e,ia);return r(q,tn({className:t},on(l,oa)),n,r(W,{label:"ra.action.back",basePath:a,icon:r(Nr,null)}),i&&r(z,{basePath:a,record:o}))},va=j(),ba=[va,H(1)],ya={format:"dd/MM/yyyy"},Ca=function(e){return function(r,n){var a=n[e];if(r&&a){var t=a.split("/").reverse().join("/"),o=r.split("/").reverse().join("/");if(xr(t).isAfter(o))return{message:"validation.greater_or_equal",args:{menor:a}}}}},ka=function(e){return void 0===e&&(e="es"),{locale:"en"==e?Sr:Pr}},Na=[{id:"1",name:"Aprobado"},{id:"2",name:"Rechazado"},{id:"3",name:"Pendiente"}],Sa=function(e,r){var n=document.createElement("a");n.style.display="none",document.body.appendChild(n),n.setAttribute("href",e),n.setAttribute("download",r),n.click()},Pa=function(e,r){var n=G();return Be(function(a){var t;return(null===(t=a.admin.resources["cb_"+la(n)+"_"+e].data[r])||void 0===t?void 0:t.etiqueta)||""})},xa=u({}),Ta=["useFormulario","enableLoad"],wa=function(e){var n=e.enableLoad,a=void 0===n||n,t=on(e,Ta),i=G(e),l=un(i,{enabled:a}),s=l.data,c=l.loading,u=ta(e).fichaProps,d=o(function(){return{estado:"N",initialValues:s,loading:c,fichaProps:u}},[s,c,u]);return r(On,null,r(xa.Provider,{value:d},r(J,tn({},t,null==u?void 0:u.panel))))};wa.propTypes={useFormulario:Ae.func};var Ia=["basePath","classes","filterValues","handleSubmit","handleSubmitWithRedirect","invalid","label","pristine","resource","saving","selectedIds","submitOnEnter","redirect"],Fa=["resource","record","basePath","redirect","className","icon","label"],Ra=tr(function(e){return{deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:wr(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}}),Oa=function(e){var n=Ra(e),a=g(),t=e.resource,o=e.record,i=e.className,l=e.icon,s=e.label,c=void 0===s?"ra.action.delete":s,u=on(e,Fa),d=U(t,o.id),m=d[0],p=d[1].loading;return r(Ir,{title:a("ra.action.delete")},r(Tr,tn({disabled:p,onClick:m,label:c,className:Fr("ra-delete-button",n.deleteButton,i),key:"button"},on(u,Ia)),l))};Oa.defaultProps={redirect:"list",icon:r(mr,null)};var _a=["useFormulario"],Ea=function(e){var n=on(e,_a),a=Z(n),t=a.record,i=a.loading,l=ta(e).fichaProps,s=o(function(){return{estado:"M",initialValues:t,loading:i,fichaProps:l}},[t,i,l]);return r(On,null,r(xa.Provider,{value:s},r(Q,tn({},n,null==l?void 0:l.panel))))},Da=tr(function(e){return{snackbarContent:{whiteSpace:"pre-wrap"}}}),Ma=function(e){var n=Da(e);return r(Y,tn({},e,{className:n.snackbarContent}))},La=kr(function(e){return{button:{margin:e.spacing(1)},input:{display:"none"}}}),Ba=e(function(e,n){var a=e.isOpen,t=e.onConfirm,o=e.onClose,i=e.title,l=e.dialogText,s=e.children,c=e.hasAccept,u=void 0===c||c,d=e.hasCancel,m=void 0===d||d,p=e.loading,f=void 0!==p&&p,g=La(e),h=function(e){o&&o(e)};return r(Xe,{ref:n,open:a,fullWidth:!0,onClose:h,"aria-labelledby":"form-dialog-title"},r(nr,{id:"form-dialog-title"},i),r(er,null,r(rr,null,l),s),(u||m)&&r($e,null,m&&r(Rr,{onClick:h,variant:"contained",color:"secondary",className:g.button,disabled:f},"Cancelar"),u&&r(Rr,{onClick:function(e){t&&t(e)},variant:"contained",color:"primary",className:g.button,disabled:f},"Ok")))}),Va=kr(function(e){return{block:{pointerEvents:"none",backgroundColor:"#ffffff",opacity:.6,position:"relative"},progress:{position:"absolute",left:"50%",top:"50%"}}}),Aa=function(e){var n=Va(e),a=_n(),o=G(e),i=d(xa),l=i.estado,s=i.loading,c=i.fichaProps,u=Un({resource:o});return t(function(){c.onRenderFicha&&c.onRenderFicha(u,l)},[]),t(function(){s||c.onLoadFicha&&c.onLoadFicha(u,l)},[s]),r(K,{className:a.open?n.block:""},a.open&&r(Ze,{className:n.progress,thickness:4,size:50}),e.children)},qa=function(e){return r(Aa,e)},Wa=["mutators"],za={setError:function(e,r){r.fields[e[0]].data=e[1]}},ja=function(e){var n=d(xa),a=n.initialValues,t=n.fichaProps,o=t.onBeforeSubmitFicha,i=t.config,l=(i=void 0===i?{}:i).mutators,s=void 0===l?{}:l,u=on(i,Wa),m=s===za?s:tn({},za,s),p=Jn(e),f=x(),g=c(function(r,n,a){var t=o&&o(tn({form:{values:r}},p),"N");return"string"==typeof t?void f(t,"warning"):void 0===t||t?e.save(r,n,a):void 0},[o,p]);return r(O,tn({},e,u,{save:g,mutators:m,initialValues:a,render:function(e){return r(X,tn({component:qa},e))}}))};ja.propTypes=tn({},$.propTypes),ja.defaultProps={margin:"normal",variant:"outlined"};var Ha=tr(function(e){return{icon:{minWidth:e.spacing(5)},sidebarIsOpen:{paddingLeft:25,transition:"padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms"},sidebarIsClosed:{paddingLeft:0,transition:"padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms"}}}),Ga=function(e){var n=e.handleToggle,a=e.sidebarIsOpen,t=e.isOpen,o=e.name,l=e.icon,s=e.children,c=e.dense,u=g(),d=Ha(),m=r(Mr,{dense:c,button:!0,onClick:n},r(Dr,{className:d.icon},t?r(Lr,null):l),r(ir,{variant:"inherit",color:"textSecondary"},u(o)));return r(i,null,a||t?m:r(Ir,{title:u(o),placement:"right"},m),r(_r,{in:t,timeout:"auto",unmountOnExit:!0},r(Er,{dense:c,component:"div",disablePadding:!0,className:a?d.sidebarIsOpen:d.sidebarIsClosed},s),r(br,null)))},Ja=["items","translate"],Ua={marginTop:"1.5em"},Za=function(e){var n=e.onMenuClick,t=e.dense,o=e.logout,l=g(),s=a({mnuPrueba:!1}),c=s[0],u=s[1],d=Ue(function(e){return e.breakpoints.down("sm")}),m=Ue(function(e){return e.breakpoints.down("xs")}),p=Be(function(e){return e.admin.ui.sidebarOpen}),f=function e(n){var a=n.items,t=n.translate,o=on(n,Ja),l=o.state,s=o.onMenuClick,c=o.handleToggle,u=o.dense,d=o.open;return a&&r(i,null,a.map(function(n){var a=n.name,i=n.menu,m=n.label;return i?r(Ga,{key:a,name:m,handleToggle:function(){return c(a)},isOpen:l[a],sidebarIsOpen:d,icon:r(Or,null),dense:u},e(tn({items:i,translate:t},o))):r(h,{key:a,to:"/"+a,primaryText:t("resources."+a+".name",{_:m}),onClick:s,sidebarIsOpen:d,dense:u,leftIcon:r(Or,null)})}))}({items:JSON.parse(localStorage.getItem("menus")),handleToggle:function(e){u(function(r){var n;return tn({},r,((n={})[e]=!r[e],n))})},state:c,activeClassName:"",iconClass:"",className:"",open:p,dense:t,onMenuClick:n,translate:l});return r(ee,{style:Ua},r(re,{primaryText:l("ra.page.dashboard"),onClick:n,sidebarIsOpen:p}),f,m&&r(h,{to:"/configuration",primaryText:l("pos.configuration"),leftIcon:r(Or,null),onClick:n,sidebarIsOpen:p,dense:t}),m&&o,!m&&d&&o)},Qa=tn({},ne);Qa.palette.type="dark",Qa.overrides.RaSidebar={drawerPaper:{position:"sticky"}},Qa.overrides.RaRichTextInput={"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}};var Ya=tn({},ne);Ya.palette.type="light",Ya.overrides.RaSidebar={drawerPaper:{position:"sticky"}},Ya.overrides.RaRichTextInput={"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}};var Ka={__proto__:null,lightTheme:Ya,darkTheme:Qa},Xa=["apiFolder"],$a=function(e){return r(te,e)},et=function(e){var n=on(e,Xa),a=Be(function(e){return"dark"===e.theme?Qa:Ya});return r(ae,tn({},n,{appBar:cn,sidebar:$a,menu:Za,theme:a,notification:Ma}))},rt=["className","exporter","filters","children"],nt=function(e){var n=e.className,a=e.exporter,t=e.filters,i=e.children,l=on(e,rt),c=_(e),u=c.currentSort,d=c.displayedFilters,m=c.filterValues,p=c.basePath,f=c.selectedIds,g=c.showFilter,h=c.total,v=G(l),b=L(l).hasCreate;return o(function(){return r(q,tn({className:n},oe(l)),t&&s(t,{resource:v,showFilter:g,displayedFilters:d,filterValues:m,context:"button"}),b&&r(ie,{basePath:p}),!1!==a&&r(le,{disabled:0===h,resource:v,sort:u,filterValues:m}),i)},[v,d,m,f,t,h])},at=["meta","input","render"],tt=tr(function(e){return{main:{display:"flex",flexDirection:"column",minHeight:"100vh",alignItems:"center",justifyContent:"flex-start",backgroundImage:function(e){return e.loginBackgroundImage},backgroundRepeat:"no-repeat",backgroundSize:"cover"},card:{minWidth:300,marginTop:"6em"},avatar:{margin:"1em",display:"flex",justifyContent:"center"},avatarIcon:{backgroundColor:e.palette.secondary.main},icon:function(r){return{position:"absolute",left:e.spacing(14-Math.ceil(r.textLength/2)-1)}},hint:{marginTop:"1em",display:"flex",justifyContent:"center",color:e.palette.grey[500]},form:{padding:"0 1em 1em 1em"},input:{marginTop:"1em"},actions:{padding:"0 1em 1em 1em"}}}),ot=function(e){var n=e.meta,a=(n=void 0===n?{touched:!1,error:void 0}:n).touched,t=n.error,o=tn({},e.input),i=on(e,at);return r(Wr,tn({error:!(!a||!t),helperText:a&&t},o,i,{fullWidth:!0}))},it=function(e){var n=e.loginBackgroundImage,t=e.nameSource,o=void 0===t?"username":t,i=e.passwordSource,l=void 0===i?"password":i,s=a(!1),c=s[0],u=s[1],d=g(),m=d("ra.auth.sign_in"),f=tt({loginBackgroundImage:n,textLength:m.length}),h=x(),v=se(),b=jr();return r(hr,{onSubmit:function(e){u(!0),v(e,b.state?b.state.nextPathname:"/").catch(function(e){u(!1),h("string"==typeof e?e:void 0!==e&&e.message?e.message:"ra.auth.sign_in_error","warning")})},validate:function(e){var r={};return e[o]||(r[o]=d("ra.validation.required")),e[l]||(r[l]=d("ra.validation.required")),r},render:function(e){return r("form",{onSubmit:e.handleSubmit},r("div",{className:f.main},r(Vr,{className:f.card},r("div",{className:f.avatar},r(Br,{className:f.avatarIcon},r(p,null))),r("div",{className:f.hint},"Inicio de Sesión"),r("div",{className:f.form},r("div",{className:f.input},r(vr,{autoFocus:!0,name:o,component:ot,label:d("ra.auth.username"),disabled:c})),r("div",{className:f.input},r(vr,{name:l,component:ot,label:d("ra.auth.password"),type:"password",disabled:c}))),r(Ar,{className:f.actions},r(Rr,{variant:"contained",type:"submit",color:"primary",disabled:c,fullWidth:!0},c&&r(qr,{className:f.icon,size:18,thickness:2}),m))),r(Y,null)))}})},lt=function(e){return r(zr,{theme:or(Ya)},r(it,e))},st=["displayedFilters","filterValues","showFilter"],ct=["className","options","icon"],ut=tr({root:{display:"inline-block"}}),dt=function(e){var t=e.className,o=e.options,i=void 0===o?[]:o,l=e.icon,s=on(e,ct),c=a(!1),u=c[0],d=c[1],m=n(),p=a(0),f=p[0],g=p[1],h=ut(e),v=G(e);return r("div",tn({className:Fr(h.root,t)},on(s,st)),r(T,{className:"add-filter",label:i[f].label,onClick:function(e){e.preventDefault(),d(!0),m.current=e.currentTarget}},l),r(Jr,{open:u,anchorEl:m.current,onClose:function(e){m.current&&m.current.contains(e.target)||d(!1)}},i.map(function(e,n){return r(Mr,{key:e.label,disabled:e.disabled,selected:n===f,onClick:function(r){return function(e,r){g(r),d(!1)}(0,n)&&(null==e?void 0:e.onClick(r,n))},resource:v,title:e.label},r(ce,{label:e.label,resource:v}))})))},mt=["fields","className","basePath","record","textAlign","sortable"],pt=function(e){var n=e.fields,a=e.className,t=e.record,o=on(e,mt),i=n.separador,l=void 0===i?"":i,s=n.secundario,c=void 0===s?[]:s,u=n.hasSecundario,d=n.campos.map(function(e){return void 0!==t[e]?t[e]:e}).join(""+l);return r(ir,tn({noWrap:!0,variant:"inherit",className:a},o),d,u&&r(ir,{component:"span",display:"block",color:"textSecondary",variant:"caption"},c.map(function(e){return(e.etiqueta||"---")+": "+(t[e.campo]||"---")}).join(" ")))},ft=["useFormulario"],gt=function(e){var n=on(e,ft),a=ue(n),t=a.record,i=a.loading,l=ta(e).fichaProps,s=o(function(){return{estado:"M",initialValues:t,loading:i,fichaProps:l}},[t,i,l]);return r(On,null,r(xa.Provider,{value:s},r(de,tn({},n,a,null==l?void 0:l.panel))))},ht=["basePath","children","className","classes","component","form","handleSubmit","handleSubmitWithRedirect","invalid","mutationMode","pristine","record","redirect","resource","saving","submitOnEnter","syncWithLocation","tabs","toolbar","undoable","variant","margin"],vt=["active","dirty","dirtyFields","dirtyFieldsSinceLastSubmit","dirtySinceLastSubmit","error","errors","hasSubmitErrors","hasValidationErrors","initialValues","modified","modifiedSinceLastSubmit","save","submitError","submitErrors","submitFailed","submitSucceeded","submitting","touched","valid","validating","values","visited","__versions"],bt=["mutators"],yt=function(e){var n=e.basePath,t=e.children,o=e.className,i=e.component,c=e.handleSubmit,u=e.handleSubmitWithRedirect,d=e.invalid,p=e.mutationMode,f=e.pristine,g=e.record,h=e.redirect,v=e.resource,b=e.saving,y=e.submitOnEnter,C=e.syncWithLocation,k=void 0===C||C,N=e.tabs,S=e.toolbar,P=e.undoable,x=e.variant,T=e.margin,w=on(e,ht),I=Ct(e),F=Hr(),R=jr(),O=F?F.url:R.pathname,_=a(0),E=_[0],D=_[1];return r("form",tn({className:Fr("tabbed-form",o)},kt(w)),s(N,{classes:I,url:O,syncWithLocation:k,onChange:function(e,r){k||D(r)},value:E},t),r(Qe,null),r(i,{className:I.content},l.map(t,function(e,a){if(e){var t=me(e,a,O);return r(Gr,{exact:!0,path:pe(t)},function(r){return m(e)?s(e,{intent:"content",classes:I,resource:v,record:g,basePath:n,hidden:k?!r.match:E!==a,variant:e.props.variant||x,margin:e.props.margin||T,value:k?t:a}):null})}})),S&&s(S,{basePath:n,className:"toolbar",handleSubmitWithRedirect:u,handleSubmit:c,invalid:d,mutationMode:p,pristine:f,record:g,redirect:h,resource:v,saving:b,submitOnEnter:y,undoable:P}))},Ct=tr(function(e){return{errorTabButton:{color:e.palette.error.main},content:{paddingTop:e.spacing(1),paddingLeft:e.spacing(2),paddingRight:e.spacing(2)}}},{name:"RaTabbedForm"});yt.defaultProps={submitOnEnter:!0,tabs:r(fe,null),toolbar:r(ge,null),component:function(e){return r("div",{className:e.className},e.children)}};var kt=function(e){return on(e,vt)},Nt={setError:function(e,r){r.fields[e[0]].data=e[1]}},St=function(e){var n=d(xa),a=n.initialValues,t=n.fichaProps,o=t.onBeforeSubmitFicha,i=t.config,l=(i=void 0===i?{}:i).mutators,s=void 0===l?{}:l,u=on(i,bt),m=s===Nt?s:tn({},Nt,s),p=Jn(e),f=x(),g=c(function(r,n,a){var t=o&&o(tn({form:{values:r}},p),"N");return"string"==typeof t?void f(t,"warning"):void 0===t||t?e.save(r,n,a):void 0},[o,p]);return r(O,tn({},e,u,{save:g,mutators:m,initialValues:a,render:function(e){return r(yt,tn({component:qa},e))}}))};St.defaultProps={margin:"normal",variant:"outlined",syncWithLocation:!1},Ur.ra.page.empty="No records yet";var Pt=tn({},Ur,{login:{id:"ID",hint:"Login",required:"Insert Username or ID",send:"Send",email:"Enter your email address",check_email:"Check your email inbox, we just send you a verification code!",must_enter_credentials:"You must first enter Username or ID",restore_password:"Restore Password",punch_in:"Punch In"},pos:{search:"Search",change_pin:"Change Pin",change_password:"Change Password",configuration:"Configuration",language:"Language",theme:{name:"Theme",light:"Light",dark:"Dark"},dashboard:{welcome:{title:"Welcome",subtitle:"Employee Management",aor_button:"Metiri WebSite"}}},validation:{greater_or_equal:"Must be greater than or equal to %{menor}"}});Zr.ra.notification.created="Datos guardados correctamente",Zr.ra.action.bulk_actions="1 seleccionado |||| %{smart_count} selecccionados",Zr.ra.page.dashboard="Inicio",Zr.ra.page.empty="Sin registros todavía",Zr.ra.page.invite="¿Quiere agregar uno?",Zr.ra.page.list="%{name}",Zr.ra.page.edit="Editar %{name}",Zr.ra.action.back="Volver";var xt=tn({},Zr,{login:{id:"Cédula",hint:"Inicio de Sesión",required:"Ingrese Usuario o Cédula",email:"Ingrese su email aquí",send:"Enviar",check_email:"Revisa tu correo electrónico, te enviaremos un código de verificación!",must_enter_credentials:"Debe ingresar Nº de Usuario o Cédula y Contraseña primero",restore_password:"Restablecer Contraseña",punch_in:"Generar Marcas"},pos:{search:"Búsqueda",change_pin:"Cambiar Pin",change_password:"Cambiar Contraseña",configuration:"Configuración",language:"Lenguaje",theme:{name:"Tema Visual",light:"Light",dark:"Dark"},dashboard:{welcome:{title:"Bienvenid@",subtitle:"Gestión de Funcionarios",aor_button:"Sitio de Metiri"}}},validation:{greater_or_equal:"Debe ser mayor o igual a %{menor}"}}),Tt=["hidden"],wt=["hidden","useContenido"],It=["hidden"],Ft=function(e){var r=d(xa),n=r.estado,a=r.loading,t=r.fichaProps,o=(void 0===t?{}:t)[e.source],i=void 0===o?{}:o,l=e.hidden,s=void 0!==l&&l,c=on(e,Tt),u=i.hidden,m=i.useContenido,p=void 0===m?Hn:m,f=on(i,wt),g=void 0!==u?u:s,h=p(tn({},c,{estado:n,hidden:g,loading:a},f)),v=h.hidden,b=on(h,It);if(void 0===h)throw new Error("useContenido está devolviendo undefined para el contenido "+e.source+"\n Asegúrese de incluir una instrucción return al final de la función");return{propsContenido:tn({},c,f,b),hidden:void 0!==v?v:g}},Rt=function(e){var n=Ft(e),a=n.propsContenido,t=n.hidden,o=JSON.parse(JSON.stringify(e.record)),i=o[e.source];return o[e.source]=""!=i&&"0"!=i,!t&&r(he,tn({},a,{record:o}))},Ot=["onFocus","onChange","onBlur","hidden","disabled","validate"],_t=["onFocus","onBlur","onChange","hidden","disabled","useContenido","validate"],Et=["hidden","disabled","onFocus","onChnage","onBlur","validate"],Dt=function(e,r,n){return"string"==typeof(null==n?void 0:n.data)?n.data:void 0},Mt=function(e){var r=d(xa),a=r.estado,t=r.loading,o=r.fichaProps,i=void 0===o?{}:o,l=Be(function(r){var n=r.configInputs?r.configInputs.filter(function(r){return r.id===e.source}):[];return n[0]?n[0]:null})||{},s=l.disabled,c=l.hidden,u=!0===l.required?va:void 0,m=i[e.source],p=void 0===m?{}:m,f=e.onFocus,g=e.onChange,h=e.onBlur,v=e.hidden,b=void 0!==v&&v,y=e.disabled,C=void 0!==y&&y,k=e.validate,N=on(e,Ot),S=ve({source:e.source}).input,P=p.onFocus,x=p.onBlur,T=p.onChange,w=p.hidden,I=p.disabled,F=p.useContenido,R=void 0===F?Hn:F,O=p.validate,_=on(p,_t),E=void 0!==w?w:b,D=void 0!==I?I:C,M=void 0!==P?P:f,L=void 0!==x?x:h,B=void 0!==T?T:g,V=Un(e),A=R(tn({},N,{estado:a,hidden:E,loading:t,utils:V},_)),q=n(S.value);if(void 0===A)throw new Error("useContenido está devolviendo undefined para el contenido "+e.source+"\n Asegúrese de incluir una instrucción return al final de la función");var W=A.hidden,z=A.disabled,j=A.onFocus,H=A.onChnage,G=A.onBlur,J=A.validate,U=on(A,Et),Z=j||M,Q=G||L,Y=H||B,K=tn({},V,{prev:q.current}),X=Array.isArray(k)?k:[k],$=Array.isArray(O)?O:[O],ee=Array.isArray(J)?J:[J];return{propsContenido:tn({onFocus:function(e){Z&&M(V,a,e),q.current=e.target.value},onBlur:function(e){return Q&&Q(K,a,e)},onChange:function(e){return Y&&Y(K,a,e)},helperText:!1,validate:[].concat(X,$,ee,[Dt,u]).filter(function(e){return void 0!==e})},N,_,U,{disabled:void 0!==s?s:void 0!==z?z:D}),hidden:void 0!==c?c:void 0!==W?W:E}},Lt=function(e){var n=Mt(e);return!n.hidden&&r(be,tn({accept:"",maxSize:5e6},n.propsContenido),r(ye,{source:"src"}))},Bt=function(e){var n=Mt(e);return!n.hidden&&r(Ce,n.propsContenido)},Vt=["callback"],At=["helperText"],qt=["callback"],Wt=function(e){var n=e.callback,a=on(e,Vt),o=_(a),i=o.loading,l=o.data;return t(function(){i||"function"==typeof n&&n(Object.values(l))},[i]),r(Pe,a)},zt=function(e){var a,o,i=Mt(e),l=i.propsContenido,s=i.hidden,c=n(!1),u=Ve(),d=k(),m=l.helperText,p=on(l,At),f=Be(function(r){var n=r.reload_cb?r.reload_cb.filter(function(r){return r.id===e.source}):[];return n[0]?n[0]:null}),g=n(f),h=null===f&&g.current?g.current:f;return h&&(a=h.callback,o=on(h,qt)),t(function(){null!==f&&(g.current=f,u(Ln(e.source)))},[JSON.stringify(f)]),t(function(){c.current=!0},[d]),c.current?!s&&r(ke,tn({},p,{perPage:250,filter:o}),r(Wt,{callback:a,helperText:m,optionText:"etiqueta",optionValue:e.source})):r(Ne,{id:e.id,label:e.label,source:e.source,resource:e.resource,className:e.className,isRequired:e.isRequired,meta:e.meta,input:e.input,margin:e.margin},r(Se,{timeout:1}))},jt=function(e){var n=Mt(e);return!n.hidden&&r(Pe,n.propsContenido)},Ht=function(e){var n=e.title,a=e.source,t=e.src,o=xe(e);return r(Br,{title:n,src:t+"/"+o[a]})},Gt=["helperText"],Jt=function(e){var a=Mt(e),o=a.propsContenido,i=a.hidden,l=n(!1),s=k(),c=o.helperText,u=on(o,Gt);return t(function(){l.current=!0},[s]),l.current?!i&&r(Te,u,r(we,{helperText:c,optionText:"etiqueta",optionValue:e.source})):r(Ne,{id:e.id,label:e.label,source:e.source,resource:e.resource,className:e.className,isRequired:e.isRequired,meta:e.meta,input:e.input,margin:e.margin},r(Se,{timeout:1}))},Ut=function(e){var n=Mt(e);return!n.hidden&&r(Ie,n.propsContenido)},Zt=["helperText"],Qt=function(e){var a=Mt(e),o=a.propsContenido,i=a.hidden,l=n(!1),s=k(),c=o.helperText,u=on(o,Zt);return t(function(){l.current=!0},[s]),l.current?!i&&r(ke,u,r(Fe,{helperText:c,optionText:"etiqueta",optionValue:e.source})):r(Ne,{id:e.id,label:e.label,source:e.source,resource:e.resource,className:e.className,isRequired:e.isRequired,meta:e.meta,input:e.input},r(Se,null))},Yt=function(e){var n=Mt(e);return!n.hidden&&r(Fe,n.propsContenido)},Kt=function(e){var n=Mt(e);return!n.hidden&&r(Re,tn({multiline:!0},n.propsContenido))},Xt=["tipo"],$t=function(e){var n=e.tipo,a=on(e,Xt),o=Mt(a),i=o.propsContenido,l=o.hidden,s=gr(),c=ve({source:e.source}),u=c.input,d=c.meta,m="F"===n||"Z"===n;t(function(){i.value&&(s.change(e.source,i.value),e.disabled&&s.blur(e.source))}),t(function(){m&&""!=u.value&&d.valid&&d.modified&&!d.active&&i.onBlur()},[u.value]);var p=tn({},i);return!l&&("N"===n||"D"===n?r(Oe,p):"F"===n?r(Qr,p):"Z"===n?r(Yr,p):r(Re,"H"===n?tn({},p,{type:"time"}):p))},eo=function(e){return r(Ee,tn({},e,{hasCreate:!1,exporter:!1,perPage:25,title:" ",bulkActionButtons:r("span",null)}),r(V,null,r(De,{source:"funced",sortable:!0,label:"Cédula"}),r(De,{source:"funpriape",sortable:!0,label:"Apellido"}),r(De,{source:"funprinom",sortable:!0,label:"Nombre"})))},ro={fillista:"empcod=-1"},no=function(e){var n=a(ro),t=n[0],o=n[1],i=_e(),l=c(function(e){o({fillista:e.node.key})},[o]),s=c(function(e){return i.getChildNodes("form_224",{parentId:e?e.itemData.id:""}).then(function(e){return e.data}).catch(function(){throw new Error("Data Loading Error")})},[i]);return r(Ye,{display:"flex",flex:1,alignItems:"flex-start",height:"20em"},r(Ye,{flexGrow:1},r(an,{id:"funcionarios-treeview",dataStructure:"plain",rootValue:"",onItemClick:l,createChildren:s})),r(Ye,{flexGrow:2},r(eo,{resource:"form_224",basePath:"/form_224",filter:t})))},ao=tr(function(e){return{confirmPrimary:{color:e.palette.primary.main},confirmWarning:{color:e.palette.error.main,"&:hover":{backgroundColor:wr(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}},iconPaddingStyle:{paddingRight:"0.5em"}}},{name:"RaConfirm"}),to=function(e){return r(nn,{handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]'},r(Ke,e))},oo={cursor:"move"},io=function(e){var n,a=e.isOpen,t=e.loading,o=e.title,i=e.cancel,l=e.confirmColor,s=e.ConfirmIcon,u=e.CancelIcon,d=e.onClose,m=e.onConfirm,p=e.translateOptions,f=void 0===p?{}:p,h=ao(e),v=g(),b=c(function(e,r){e.stopPropagation(),m(e,r)},[m]),y=c(function(e){e.stopPropagation()},[]);return r(Xe,{open:a,onClose:d,onClick:y,fullWidth:!0,maxWidth:"lg",PaperComponent:to,"aria-labelledby":"draggable-dialog-title"},r(nr,{style:oo,id:"draggable-dialog-title"},v(o,tn({_:o},f))),r(er,{dividers:!0},r(no,null)),r($e,null,r(Rr,{disabled:t,onClick:d},r(u,{className:h.iconPaddingStyle}),v(i,{_:i})),r(Rr,{disabled:t,onClick:function(e){return b(e,"yes")},className:Fr("ra-confirm",(n={},n[h.confirmWarning]="warning"===l,n[h.confirmPrimary]="primary"===l,n)),autoFocus:!0},r(s,{className:h.iconPaddingStyle}),v("ra.action.confirm"))))};io.propTypes={cancel:Ae.string,classes:Ae.object,confirm:Ae.string,confirmColor:Ae.string,ConfirmIcon:Ae.elementType,CancelIcon:Ae.elementType,isOpen:Ae.bool,loading:Ae.bool,onClose:Ae.func.isRequired,onConfirm:Ae.func.isRequired,title:Ae.string.isRequired},io.defaultProps={cancel:"ra.action.cancel",classes:{},confirmColor:"primary",ConfirmIcon:en,CancelIcon:rn,isOpen:!1};var lo=["disabled","asistant","asistantResource","label","source"],so={seleccion:[],all:!0,none:!1},co=function(e){return!e||null!=e&&e.all?"Todos":null!=e&&e.none||0===e.seleccion.length?"Ninguno":"Selección ("+e.seleccion.length+")"},uo=function(e){return console.log({parse:e}),e},mo=function(e){var n=e.disabled,t=e.label,o=void 0===t?"Funcionarios":t,i=e.source,l=on(e,lo),s=Be(function(e){return e.admin.resources.form_224.list.selectedIds}),u=a(!1),d=u[0],m=u[1],p=gr(),f=c(function(){m(!1)},[m]);return r(Fragment,null,r("div",{style:{display:"flex",alignItems:"center"}},r(Re,tn({initialValue:so},l,{source:i,label:o,disabled:!0,parse:uo,format:co,helperText:!1,InputProps:{endAdornment:r(Fragment,null,r(Tr,{onClick:function(e){p.change(i,{seleccion:[],all:!1,none:!0})},disabled:n,"aria-label":"Ninguno",size:"small",title:"Ninguno"},r(Kr,null)),r(Tr,{onClick:function(e){p.change(i,{seleccion:[],all:!0,none:!1})},disabled:n,"aria-label":"Todos",size:"small",title:"Todos"},r(Xr,null)),r(Tr,{onClick:function(e){return m(!0)},disabled:n,"aria-label":"Selección",size:"small",title:"Selección"},r($r,null)))}}))),r(io,{isOpen:d,title:"Selección de "+o,onConfirm:function(e,r){m(!1),p.change(i,{seleccion:s,all:!1,none:!1})},onClose:f}))},po=["tipo","value"],fo=function(e){var n=e.tipo,a=on(e,po),t=Ft(a),o=t.hidden,i=tn({},t.propsContenido);return!o&&("N"===n||"D"===n?r(Me,i):"F"===n?r(Le,i):"Z"===n?r(Le,tn({},i,{showTime:!0})):r(De,i))},go=tr(function(e){return{confirmPrimary:{color:e.palette.primary.main},confirmWarning:{color:e.palette.error.main,"&:hover":{backgroundColor:wr(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}},iconPaddingStyle:{paddingRight:"0.5em"}}},{name:"RaConfirm"}),ho=function(e){return r(nn,{handle:"#draggable-dialog-title",cancel:'[class*="MuiDialogContent-root"]'},r(Ke,e))},vo={cursor:"move"},bo=function(e){var n,a=e.isOpen,t=e.loading,o=e.title,i=e.content,l=e.cancel,s=e.confirmColor,u=e.ConfirmIcon,d=e.CancelIcon,m=e.onClose,p=e.onConfirm,f=e.contentResource,h=e.translateOptions,v=void 0===h?{}:h,b=go(e),y=g(),C=Be(function(e){return e.admin.resources[f].list.selectedIds}),k=c(function(e,r){e.stopPropagation(),p(e,C)},[C,p]),N=c(function(e){e.stopPropagation()},[]);return r(Xe,{open:a,onClose:m,onClick:N,fullWidth:!0,maxWidth:"lg",PaperComponent:ho,"aria-labelledby":"draggable-dialog-title"},r(nr,{style:vo,id:"draggable-dialog-title"},y(o,tn({_:o},v))),r(er,{dividers:!0},i),r($e,null,r(Rr,{disabled:t,onClick:m},r(d,{className:b.iconPaddingStyle}),y(l,{_:l})),r(Rr,{disabled:t,onClick:function(e){return k(e,"yes")},className:Fr("ra-confirm",(n={},n[b.confirmWarning]="warning"===s,n[b.confirmPrimary]="primary"===s,n)),autoFocus:!0},r(u,{className:b.iconPaddingStyle}),y("ra.action.confirm"))))};bo.propTypes={cancel:Ae.string,classes:Ae.object,confirm:Ae.string,confirmColor:Ae.string,ConfirmIcon:Ae.elementType,CancelIcon:Ae.elementType,content:Ae.node.isRequired,isOpen:Ae.bool,loading:Ae.bool,onClose:Ae.func.isRequired,onConfirm:Ae.func.isRequired,title:Ae.string.isRequired},bo.defaultProps={cancel:"ra.action.cancel",classes:{},confirmColor:"primary",ConfirmIcon:en,CancelIcon:rn,isOpen:!1};var yo=["disabled","asistant","asistantResource","label","source"],Co=function(){return r(i,null)},ko={seleccion:[],all:!0,none:!1},No=function(e){return console.log({format:e}),!e||null!=e&&e.all?"Todos":null!=e&&e.none||0===e.seleccion.length?"Ninguno":"Selección ("+e.seleccion.length+")"},So=function(e){return console.log({parse:e}),e},Po=function(e){var n=e.disabled,t=e.asistant,o=e.asistantResource,l=e.label,s=e.source,u=on(e,yo),d=a(!1),m=d[0],p=d[1],f=gr(),g=c(function(){p(!1)},[p]);return r(i,null,r("div",{style:{display:"flex",alignItems:"center"}},r(Re,tn({initialValue:ko},u,{source:s,label:l,disabled:!0,parse:So,format:No,helperText:!1,InputProps:{endAdornment:r(i,null,r(Tr,{onClick:function(e){f.change(s,{seleccion:[],all:!1,none:!0})},disabled:n,"aria-label":"Ninguno",size:"small",title:"Ninguno"},r(Kr,null)),r(Tr,{onClick:function(e){f.change(s,{seleccion:[],all:!0,none:!1})},disabled:n,"aria-label":"Todos",size:"small",title:"Todos"},r(Xr,null)),r(Tr,{onClick:function(e){return p(!0)},disabled:n,"aria-label":"Selección",size:"small",title:"Selección"},r($r,null)))}}))),r(bo,{isOpen:m,title:"Selección de "+l,contentResource:o,content:r(t,{bulkActionButtons:r(Co,null),hasCreate:!1,exporter:!1,resource:o,basePath:"/"+o}),onConfirm:function(e,r){p(!1),f.change(s,{seleccion:r,all:!1,none:!1})},onClose:g}))};export{cn as AppBar,Rt as BooleanField,Lt as Camino,Bt as CheckBox,zt as ComboBox,jt as ComboBoxManual,wa as CreateEtriek,Oa as DeleteButtonNoWarning,Ea as EditEtriek,Tn as EtrGrid,Ma as EtriekNotification,ha as FichaActions,xa as FichaContext,Ba as FormDialog,ja as FormEtriek,Fn as GE,$n as GrillaEtriek,Ht as ImageField,et as Layout,nt as ListActionsEtriek,Jt as ListCheck,lt as Login,Za as Menu,dt as MenuButton,pt as MultiTextField,Ut as Password,Qt as RadioButton,Yt as RadioButtonManual,ga as Separador,gt as ShowEtriek,Ga as SubMenu,mo as TBSF,St as TabbedFormEtriek,na as TabbedGrillaEtriek,Kt as TextArea,$t as TextBox,Po as TextBoxSelection,fo as TextField,Na as choicesEstado,ca as dateFormat,ya as dateFormatOptions,ua as dateParser,da as dateTimeFormat,ma as dateTimeParser,Ln as deleteRecargarComboBox,Sa as descargarLink,Pt as enMessages,xt as esMessages,Ca as etrFechaMayorQue,va as etrRequerido,ba as etrRequeridoNumerico,la as getFormcodFromResource,ka as localeOptions,Mn as recargarComboBox,Vn as setDisableAction,Bn as setHiddenAction,An as setRequireAction,Ka as themes,pa as timeFormat,fa as timeParser,Dn as useAjax,Mt as useContenidoController,pn as useDeleteRowEtrGrid,Ft as useFieldController,En as useGetJson,ta as useInitFicha,un as useNuevo,Pa as useReferenceLabel,fn as useSaveRowEtrGrid,sa as useStylesContenidos,Un as useUtils,Gn as useUtilsGrilla};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biblio-react",
3
- "version": "1.6.15",
3
+ "version": "1.7.1",
4
4
  "description": "Framework de Metiri hecho en React",
5
5
  "author": "WiXSL",
6
6
  "license": "MIT",
@@ -39,6 +39,7 @@
39
39
  "@material-ui/styles": "^4.11.3",
40
40
  "classnames": "^2.3.1",
41
41
  "date-fns": "~2.16.1",
42
+ "devextreme-react": "^21.2.7",
42
43
  "history": "^4.10.1",
43
44
  "jspdf": "^2.3.1",
44
45
  "moment": "^2.29.1",