biblio-react 1.6.4 → 1.6.8
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 +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1 -1
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -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 m}from"react";import p 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 w,Loading as N,useSafeSetState as S,useNotify as T,Button as x,SaveContextProvider as P,SaveButton as F,useDeleteWithConfirmController as I,Confirm as _,FormWithRedirect as R,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 U,useDelete as J,useEditController as Z,Edit as Q,Notification as Y,CardContentInner as $,SimpleFormView as K,SimpleForm as X,Menu as ee,DashboardMenuItem as re,Layout as ne,Sidebar as te,sanitizeListRestProps as ae,CreateButton as oe,ExportButton as ie,useLogin as le,FieldTitle as se,useShowController as ce,Show as ue,getTabFullPath as de,escapePath as me,TabbedFormTabs as pe,Toolbar as fe,BooleanField as ve,useInput as ge,FileInput as he,ImageField as be,BooleanInput as ye,ReferenceInput as Ce,Labeled as ke,LinearProgress as we,SelectInput as Ne,useRecordContext as Se,ReferenceArrayInput as Te,SelectArrayInput as xe,PasswordInput as Pe,RadioButtonGroupInput as Fe,TextInput as Ie,NumberInput as _e,NumberField as Re,DateField as Ee,TextField as Oe}from"react-admin";import{useSelector as De,useDispatch as Me}from"react-redux";import Le,{string as Be,func as Ve,any as Ae,bool as qe}from"prop-types";import{alpha as We,createTheme as ze,ThemeProvider as He,useMediaQuery as je,CircularProgress as Ge,Divider as Ue}from"@material-ui/core";import Je from"@material-ui/core/Dialog";import Ze from"@material-ui/core/DialogActions";import Qe from"@material-ui/core/DialogContent";import Ye from"@material-ui/core/DialogContentText";import $e from"@material-ui/core/DialogTitle";import Ke from"@material-ui/core/Paper";import{makeStyles as Xe,createTheme as er}from"@material-ui/core/styles";import rr from"@material-ui/core/Typography";import{GridOverlay as nr,esES as tr,DataGrid as ar}from"@material-ui/data-grid";import or from"@material-ui/icons/Add";import ir from"@material-ui/icons/Cancel";import lr from"@material-ui/icons/Delete";import sr from"@material-ui/icons/Edit";import cr from"@material-ui/core/TableContainer";import{useForm as ur,Form as dr,Field as mr}from"react-final-form";import pr from"@material-ui/core/Divider";import fr from"@material-ui/core/Tab";import vr from"@material-ui/core/Tabs";import gr from"@material-ui/core/styles/makeStyles";import hr from"@material-ui/icons/ChevronLeft";import br from"date-fns/locale/en-US";import yr from"date-fns/locale/es";import Cr from"moment";import kr from"@material-ui/core/IconButton";import{alpha as wr}from"@material-ui/core/styles/colorManipulator";import Nr from"@material-ui/core/Tooltip";import Sr from"classnames";import Tr from"@material-ui/core/Button";import xr from"@material-ui/icons/Settings";import Pr from"@material-ui/core/Collapse";import Fr from"@material-ui/core/List";import Ir from"@material-ui/core/ListItemIcon";import _r from"@material-ui/core/MenuItem";import Rr from"@material-ui/icons/ExpandMore";import Er from"@material-ui/core/Avatar";import Or from"@material-ui/core/Card";import Dr from"@material-ui/core/CardActions";import Mr from"@material-ui/core/CircularProgress";import Lr from"@material-ui/core/TextField";import{ThemeProvider as Br}from"@material-ui/styles";import{useLocation as Vr,useRouteMatch as Ar,Route as qr}from"react-router-dom";import Wr from"@material-ui/core/Menu";import zr from"ra-language-english";import Hr from"@blackbox-vision/ra-language-spanish";import{KeyboardDateInput as jr,KeyboardDateTimeInput as Gr}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 Jr(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 Zr=e(function(e,n){var t=v(),a=De(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(p,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]}),Qr=function(e){return r(b,e,r(Zr,null))},Yr=function(e){return r(h,Ur({},e,{elevation:1,userMenu:r(Qr,null)}))},$r=function(e,r){return y(e,"-1",r)},Kr=Xe(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:We(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}},{name:"GE"}),Xr=function(){var e=Kr();return r(nr,{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"))},en=function(e,r,n){return C({type:"deleteEtrRow",resource:e,payload:{params:r}},n)},rn=function(e,r,n,t){return C({type:e,resource:r,payload:{params:n}},t)},nn=["api","basePath","classes","className","confirmTitle","confirmContent","icon","record","redirect","onSuccess","onFailure","source","camposClaveFila"],tn=["filterBy","claves","sortModel","columns","reference","allowAdd","allowRemove","etrResource","enableLoad"],an=Xe(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:We(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}},{name:"EtrGrid"}),on={marginLeft:"1.6rem",fontWeight:"bold"},ln=r(lr,null),sn=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?ln:s,d=e.record,m=e.redirect,p=void 0!==m&&m,f=e.onSuccess,v=e.onFailure,g=e.source,h=e.camposClaveFila,b=Jr(e,nn),y=an(e),C=T(),k=I({record:d,redirect:p,basePath:n,onSuccess:f,onFailure:v}),w=k.open,N=k.loading,S=k.handleDialogOpen,P=k.handleDialogClose,F=en(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],R=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:R}})},[d]);return r(i,null,r(x,Ur({key:"button",onClick:S,className:y.deleteButton},b),u),r(_,{isOpen:w,loading:N,title:a,content:l,onConfirm:E,onClose:P}))},cn=function(e){return r(Je,{open:e.open,onClose:e.onClose,fullWidth:!0},r($e,null,e.labelEstado+" "+e.label),r(Ye,null,r(rr,{component:"span",display:"block",variant:"subtitle1",style:Ur({},on)},e.msgTitle),e.msgDesc),r(R,{resource:e.resource,save:e.save,render:e.render,initialValues:e.initialValues}))};cn.propTypes={label:Be,onClick:Ve,icon:Ae,open:qe,onClose:Ve,labelEstado:Be,msgTitle:Ae,msgDesc:Ae,resource:Ae,save:Ve,render:Ve};var un=function(e){return r(sn,{api:!0,confirmTitle:"ra.action.delete",source:e.source,record:e.row,resource:e.resource,camposClaveFila:e.camposClaveFila})},dn=function(e){var n=e.editors,t=e.record,a=e.clavesFila,c=e.camposClaveFila,u=e.resource,d=e.label,m=e.source,p=e.etrResource,f=S(!1),g=f[0],h=f[1],b=$r(p,{enabled:g}).data,y=rn("createEtrRow",u,{},{refresh:!0,onSuccess:function(e){if(e.error)throw new Error(e.error);h(!1),w("ra.notification.created","info")},onFailure:function(e){w(e.message,"warning")}}),C=y[0],k=y[1].loading,w=T(),N=v()("ra.action.create"),I=function(e){C({payload:{data:Ur({},e,a),ge:m,camposClaveFila:c,estado:"N"}})},_=o(function(){return{save:I,setOnFailure:function(e){return console.log(e)}}},[I]);return r(i,null,r(x,{onClick:function(e){h(!0),e.stopPropagation()}},r(or,null)),r(P,{value:_},r(cn,{open:g,onClose:function(e){h(!1),e.stopPropagation()},labelEstado:N,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(Qe,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(Ze,null,r(F,{handleSubmitWithRedirect:a,pristine:o,saving:c,disabled:k}),r(x,{label:"ra.action.cancel",onClick:function(e){h(!1),e.stopPropagation()},disabled:k},r(ir,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,m=T(),p=v(),f=S(!1),g=f[0],h=f[1],b=rn("updateEtrRow",o,{},{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")}}),y=b[0],C=b[1].loading,k=p("ra.action.edit");return r(i,null,r(x,{onClick:function(e){h(!0),e.stopPropagation()}},r(sr,null)),r(cn,{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(Qe,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(Ze,null,r(F,{handleSubmitWithRedirect:t,pristine:c,saving:u,disabled:C}),r(x,{label:"ra.action.cancel",onClick:function(e){h(!1),e.stopPropagation()},disabled:C},r(ir,null))))}}))},pn=ze({},tr),fn=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,v=void 0===f||f,g=e.etrResource,h=e.enableLoad,b=void 0===h||h,y=Jr(e,tn),C=e.record,S=n(!1),T=an(e),x=k(),P=t(c)[1],F=c[0],I=F.field,_=F.sort;a(function(){S.current=!0},[x]);var R=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=w(d,{page:1,perPage:200},{field:I,order:_},E,{enabled:b&&S.current}),D=O.data,M=O.ids,L=O.loading,B=o(function(){return M.map(function(e){return D[e]})},[M,D]);if(L)return r(N,null);var V=[p?{field:"BTN",headerName:"",sortable:!1,renderHeader:function(e){return r(dn,Ur({},y,{etrResource:g,camposClaveFila:s,clavesFila:R,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:R,api:e.api,row:e.row}))}},v?{field:" ",headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:function(e){return r(un,Ur({},y,{camposClaveFila:s,api:e.api,row:e.row}))}}:{}]),A=o(function(){return V},[JSON.stringify(V)]);return r(Ke,{className:T.rootPaper},r(He,{theme:pn},r(ar,Ur({className:T.root,disableSelectionOnClick:!0,pageSize:50,hideFooter:!0,sortModel:c,rows:B,columns:A,onSortModelChange:function(e){return P(e)},components:{NoRowsOverlay:Xr}},y))))},vn=["filterBy","sortModel","columns","reference","enableLoad"],gn=ze({},tr),hn=function(e){var i=e.filterBy,l=void 0===i?"":i,s=e.sortModel,c=e.columns,u=e.reference,d=e.enableLoad,m=void 0===d||d,p=Jr(e,vn),f=e.record,v=n(!1),g=Kr(e),h=k(),b=t(s),y=b[0],C=b[1],S=s[0],T=S.field,x=S.sort,P=o(function(){return[].concat(c)},[JSON.stringify(c)]);a(function(){v.current=!0},[h]);var F={};l.split(",").forEach(function(e){e&&(F[e]=[{type:"string",comparison:"eq",value:f[e],field:e}])});var I=w(u,{page:1,perPage:200},{field:T,order:x},F,{enabled:m&&v.current}),_=I.data,R=I.ids,E=I.loading,O=o(function(){return R.map(function(e){return _[e]})},[R,_]);return E?r(N,null):r(Ke,{className:g.rootPaper},r(He,{theme:gn},r(ar,Ur({className:g.root,disableSelectionOnClick:!0,pageSize:50,hideFooter:!0,rows:O,columns:P,sortModel:y,onSortModelChange:function(e){return C(e)},components:{NoRowsOverlay:Xr}},p))))},bn=u(),yn=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(bn.Provider,{value:s},n)},Cn=function(){return d(bn)},kn=function(e,r,n,t){return C({type:"getJson",resource:e,payload:{method:r,params:n}},t)},wn=function(e){var r=kn(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]},Nn=function(e,r,n,t){return{type:"RELOAD_CB",payload:{id:e,method:r,params:n,callback:t}}},Sn=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}}},xn=function(e,r){return{type:"DISABLE_INPUT",payload:{id:e,disabled:r}}},Pn=function(e,r){return{type:"REQUIRE_INPUT",payload:{id:e,required:r}}},Fn=function(){var e=Me();return c(function(r,n,t,a){e(Nn(r,n,t,a))},[e])},In=function(){var e=Me();return c(function(r,n){e(Tn(r,n))},[e])},_n=function(){var e=Me();return c(function(r,n){e(xn(r,n))},[e])},Rn=function(){var e=Me();return c(function(r,n){e(Pn(r,n))},[e])},En=function(e){return{}},On=function(e){var r=E(e),n=T(),t=O(),a=D(),o=M(e.resource);return{ajax:wn(e.resource)[0],data:r,notify:n,redirect:t,refresh:a,unselectAll:o}},Dn=function(e){var r=Fn(),n=In(),t=_n(),a=Rn(),o=Cn(),i=T(),l=O();return{ajax:wn(e.resource)[0],notify:i,redirect:l,recargarComboBox:r,progress:o,setHidden:n,setDisable:t,setRequire:a}},Mn=function(e){var r=Fn(),n=In(),t=_n(),a=Rn(),o=Cn(),i=T(),l=O();return{form:ur(),ajax:wn(e.resource)[0],notify:i,redirect:l,recargarComboBox:r,progress:o,setHidden:n,setDisable:t,setRequire:a}},Ln=["isRowEditable"],Bn=["isRowEditable","primaryText","secondaryText","desktopSize","onRenderGrilla","onLoadGrilla"],Vn=Xe(function(e){return{container:{maxHeight:"70vh"},rowOdd:{backgroundColor:e.palette.action.hover}}},{name:"GrillaEtriek"}),An=function(e,r){return void 0===r||"function"==typeof r&&r(e)},qn=function(e){var n=e.isRowEditable,t=Jr(e,Ln);return An(e.record,n)?r(A,t):null},Wn=function(e){!function(e){var r=e.onRenderGrilla,n=e.onLoadGrilla,t=k(),o=On(e);a(function(){r&&r(o)},[]),a(function(){n&&n(o)},[t])}(e);var n=je(function(e){return e.breakpoints.down("sm")}),t=Vn(e),o=L(e).hasEdit,i=e.isRowEditable,s=e.primaryText,c=e.secondaryText,u=e.desktopSize,d=void 0!==u&&u,m=Jr(e,Bn),p=e.children,f=l.count(e.children),v=s,g=c;return s||(f>=4||f>=3||f>=2?v=function(e){return e[p[0].props.source]+" - "+e[p[1].props.source]}:1==f&&(v=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?v=function(e){return e[p[0].props.source]+" - "+e[p[1].props.source]}:1==f&&(v=function(e){return e[p[0].props.source]})),n&&!1===d?r(B,{linkType:function(e){return o&&An(e,i)?"edit":""},primaryText:v,secondaryText:g}):r(cr,{className:t.container},r(V,Ur({stickyHeader:!0},m),l.map(p,function(e){return e.props.hidden?null:e}),o&&r(qn,{isRowEditable:i})))},zn=["ids"],Hn=["filterValues","setFilters","tabs","GridComponent"],jn=function(e){var n=e.filterValues,t=e.setFilters,a=e.tabs,o=a.ids,l=Jr(a,zn),s=e.GridComponent,c=void 0===s?Wn:s,u=Jr(e,Hn),d=n.id;return r(i,null,r(vr,{value:d,indicatorColor:"primary",onChange:function(e,r){t(Ur({},n,{id:r}))}},o.map(function(e){return r(fr,{key:e,label:e.charAt(0).toUpperCase()+e.slice(1),value:e})})),r(pr,null),r(c,Ur({},u,l[d])))},Gn=["useFormulario"],Un=function(e){var r=e.useFormulario;return{fichaProps:(void 0===r?En:r)(Jr(e,Gn))}},Jn=["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"],Zn=["children","basePath","className","data","hasShow","hasList"],Qn=function(e){return e.split("_")[1]},Yn=gr(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)}}),$n=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()}},Kn=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]},Xn=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()}},et=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)},rt=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()}},nt=function(e,r){return e?e.split(" ")[4].substr(0,5):""},tt=function(e){return r(rr,{variant:"h6",gutterBottom:!0},e.children)},at=function(e){var n=e.children,t=e.basePath,a=e.className,o=e.data,i=e.hasShow,l=Jr(e,Zn);return r(q,Ur({className:a},Jr(l,Jn)),n,r(W,{label:"ra.action.back",basePath:t,icon:r(hr,null)}),i&&r(z,{basePath:t,record:o}))},ot=H(),it=[ot,j(1)],lt={format:"dd/MM/yyyy"},st=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(Cr(a).isAfter(o))return{message:"validation.greater_or_equal",args:{menor:t}}}}},ct=function(e){return void 0===e&&(e="es"),{locale:"en"==e?br:yr}},ut=[{id:"1",name:"Aprobado"},{id:"2",name:"Rechazado"},{id:"3",name:"Pendiente"}],dt=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 De(function(t){var a;return(null===(a=t.admin.resources["cb_"+Qn(n)+"_"+e].data[r])||void 0===a?void 0:a.etiqueta)||""})},pt=u({}),ft=["useFormulario","enableLoad"],vt=function(e){var n=e.enableLoad,t=void 0===n||n,a=Jr(e,ft),i=G(e),l=$r(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(yn,null,r(pt.Provider,{value:d},r(U,Ur({},a,null==u?void 0:u.panel))))};vt.propTypes={useFormulario:Le.func};var gt=["basePath","classes","filterValues","handleSubmit","handleSubmitWithRedirect","invalid","label","pristine","resource","saving","selectedIds","submitOnEnter","redirect"],ht=["resource","record","basePath","redirect","className","icon","label"],bt=Xe(function(e){return{deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:wr(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}}),yt=function(e){var n=bt(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=Jr(e,ht),d=J(a,o.id),m=d[0],p=d[1].loading;return r(Nr,{title:t("ra.action.delete")},r(kr,Ur({disabled:p,onClick:m,label:c,className:Sr("ra-delete-button",n.deleteButton,i),key:"button"},Jr(u,gt)),l))};yt.defaultProps={redirect:"list",icon:r(lr,null)};var Ct=["useFormulario"],kt=function(e){var n=Jr(e,Ct),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(yn,null,r(pt.Provider,{value:s},r(Q,Ur({},n,null==l?void 0:l.panel))))},wt=Xe(function(e){return{snackbarContent:{whiteSpace:"pre-wrap"}}}),Nt=function(e){var n=wt(e);return r(Y,Ur({},e,{className:n.snackbarContent}))},St=gr(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,m=void 0===d||d,p=e.loading,f=void 0!==p&&p,v=St(e),g=function(e){o&&o(e)};return r(Je,{ref:n,open:t,fullWidth:!0,onClose:g,"aria-labelledby":"form-dialog-title"},r($e,{id:"form-dialog-title"},i),r(Qe,null,r(Ye,null,l),s),(u||m)&&r(Ze,null,m&&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")))}),xt=gr(function(e){return{block:{pointerEvents:"none",backgroundColor:"#ffffff",opacity:.6,position:"relative"},progress:{position:"absolute",left:"50%",top:"50%"}}}),Pt=function(e){var n=xt(e),t=Cn(),o=G(e),i=d(pt),l=i.estado,s=i.loading,c=i.fichaProps,u=Mn({resource:o});return a(function(){c.onRenderFicha&&c.onRenderFicha(u,l)},[]),a(function(){s||c.onLoadFicha&&c.onLoadFicha(u,l)},[s]),r($,{className:t.open?n.block:""},t.open&&r(Ge,{className:n.progress,thickness:4,size:50}),e.children)},Ft=function(e){return r(Pt,e)},It=["mutators"],_t={setError:function(e,r){r.fields[e[0]].data=e[1]}},Rt=function(e){var n=d(pt),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=Jr(i,It),m=s===_t?s:Ur({},_t,s),p=Dn(e),f=T(),v=c(function(r,n,t){var a=o&&o(Ur({form:{values:r}},p),"N");return"string"==typeof a?void f(a,"warning"):void 0===a||a?e.save(r,n,t):void 0},[o,p]);return r(R,Ur({},e,u,{save:v,mutators:m,initialValues:t,render:function(e){return r(K,Ur({component:Ft},e))}}))};Rt.propTypes=Ur({},X.propTypes),Rt.defaultProps={margin:"normal",variant:"outlined"};var Et=Xe(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"}}}),Ot=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=Et(),m=r(_r,{dense:c,button:!0,onClick:n},r(Ir,{className:d.icon},a?r(Rr,null):l),r(rr,{variant:"inherit",color:"textSecondary"},u(o)));return r(i,null,t||a?m:r(Nr,{title:u(o),placement:"right"},m),r(Pr,{in:a,timeout:"auto",unmountOnExit:!0},r(Fr,{dense:c,component:"div",disablePadding:!0,className:t?d.sidebarIsOpen:d.sidebarIsClosed},s),r(pr,null)))},Dt=["items","translate"],Mt={marginTop:"1.5em"},Lt=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=je(function(e){return e.breakpoints.down("sm")}),m=je(function(e){return e.breakpoints.down("xs")}),p=De(function(e){return e.admin.ui.sidebarOpen}),f=function e(n){var t=n.items,a=n.translate,o=Jr(n,Dt),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,m=n.label;return i?r(Ot,{key:t,name:m,handleToggle:function(){return c(t)},isOpen:l[t],sidebarIsOpen:d,icon:r(xr,null),dense:u},e(Ur({items:i,translate:a},o))):r(g,{key:t,to:"/"+t,primaryText:a("resources."+t+".name",{_:m}),onClick:s,sidebarIsOpen:d,dense:u,leftIcon:r(xr,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:p,dense:a,onMenuClick:n,translate:l});return r(ee,{style:Mt},r(re,{primaryText:l("ra.page.dashboard"),onClick:n,sidebarIsOpen:p}),f,m&&r(g,{to:"/configuration",primaryText:l("pos.configuration"),leftIcon:r(xr,null),onClick:n,sidebarIsOpen:p,dense:a}),m&&o,!m&&d&&o)},Bt={palette:{type:"dark",primary:{main:"#90caf9"}},overrides:{RaSidebar:{drawerPaper:{position:"sticky"}},RaRichTextInput:{"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}}}},Vt={palette:{secondary:{light:"#5f5fc4",main:"#2196f3",dark:"#001064",contrastText:"#fff"}},overrides:{RaSidebar:{drawerPaper:{position:"sticky"}},RaRichTextInput:{"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}},MuiFilledInput:{root:{backgroundColor:"rgba(0, 0, 0, 0.04)","&$disabled":{backgroundColor:"rgba(0, 0, 0, 0.04)"}}}}},At={__proto__:null,darkTheme:Bt,lightTheme:Vt},qt=["apiFolder"],Wt=function(e,r,n){var t="";if(n){var a=new Date;a.setTime(a.getTime()+24*n*60*60*1e3),t=";expires="+a.toUTCString()}document.cookie=e+"="+r+t+";path=/"},zt=function(e){Wt(e,"",-1)},Ht=function(e){return r(te,e)},jt=function(e){var n=e.apiFolder,t=Jr(e,qt),o=De(function(e){return"dark"===e.theme?Bt:Vt});return a(function(){return Wt("sistema_activo",n),window&&(window.onunload=window.onbeforeunload=function(){zt("sistema_activo")}),function(){zt("sistema_activo")}},[]),r(ne,Ur({},t,{appBar:Yr,sidebar:Ht,menu:Lt,theme:o,notification:Nt}))},Gt=["className","exporter","filters","children"],Ut=function(e){var n=e.className,t=e.exporter,a=e.filters,i=e.children,l=Jr(e,Gt),c=E(e),u=c.currentSort,d=c.displayedFilters,m=c.filterValues,p=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},ae(l)),a&&s(a,{resource:h,showFilter:v,displayedFilters:d,filterValues:m,context:"button"}),b&&r(oe,{basePath:p}),!1!==t&&r(ie,{disabled:0===g,resource:h,sort:u,filterValues:m}),i)},[h,d,m,f,a,g])},Jt=["meta","input","render"],Zt=Xe(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"}}}),Qt=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=Jr(e,Jt);return r(Lr,Ur({error:!(!t||!a),helperText:t&&a},o,i,{fullWidth:!0}))},Yt=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(),m=d("ra.auth.sign_in"),f=Zt({loginBackgroundImage:n,textLength:m.length}),g=T(),h=le(),b=Vr();return r(dr,{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(Or,{className:f.card},r("div",{className:f.avatar},r(Er,{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(mr,{autoFocus:!0,name:o,component:Qt,label:d("ra.auth.username"),disabled:c})),r("div",{className:f.input},r(mr,{name:l,component:Qt,label:d("ra.auth.password"),type:"password",disabled:c}))),r(Dr,{className:f.actions},r(Tr,{variant:"contained",type:"submit",color:"primary",disabled:c,fullWidth:!0},c&&r(Mr,{className:f.icon,size:18,thickness:2}),m))),r(Y,null)))}})},$t=function(e){return r(Br,{theme:er(Vt)},r(Yt,e))},Kt=["displayedFilters","filterValues","showFilter"],Xt=["className","options","icon"],ea=Xe({root:{display:"inline-block"}}),ra=function(e){var a=e.className,o=e.options,i=void 0===o?[]:o,l=e.icon,s=Jr(e,Xt),c=t(!1),u=c[0],d=c[1],m=n(),p=t(0),f=p[0],v=p[1],g=ea(e),h=G(e);return r("div",Ur({className:Sr(g.root,a)},Jr(s,Kt)),r(x,{className:"add-filter",label:i[f].label,onClick:function(e){e.preventDefault(),d(!0),m.current=e.currentTarget}},l),r(Wr,{open:u,anchorEl:m.current,onClose:function(e){m.current&&m.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(se,{label:e.label,resource:h}))})))},na=["fields","className","basePath","record","textAlign","sortable"],ta=function(e){var n=e.fields,t=e.className,a=e.record,o=Jr(e,na),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(rr,Ur({noWrap:!0,variant:"inherit",className:t},o),d,u&&r(rr,{component:"span",display:"block",color:"textSecondary",variant:"caption"},c.map(function(e){return(e.etiqueta||"---")+": "+(a[e.campo]||"---")}).join(" ")))},aa=["useFormulario"],oa=function(e){var n=Jr(e,aa),t=ce(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(yn,null,r(pt.Provider,{value:s},r(ue,Ur({},n,t,null==l?void 0:l.panel))))},ia=["basePath","children","className","classes","component","form","handleSubmit","handleSubmitWithRedirect","invalid","mutationMode","pristine","record","redirect","resource","saving","submitOnEnter","syncWithLocation","tabs","toolbar","undoable","variant","margin"],la=["active","dirty","dirtyFields","dirtyFieldsSinceLastSubmit","dirtySinceLastSubmit","error","errors","hasSubmitErrors","hasValidationErrors","initialValues","modified","modifiedSinceLastSubmit","save","submitError","submitErrors","submitFailed","submitSucceeded","submitting","touched","valid","validating","values","visited","__versions"],sa=["mutators"],ca=function(e){var n=e.basePath,a=e.children,o=e.className,i=e.component,c=e.handleSubmit,u=e.handleSubmitWithRedirect,d=e.invalid,p=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,w=e.tabs,N=e.toolbar,S=e.undoable,T=e.variant,x=e.margin,P=Jr(e,ia),F=ua(e),I=Ar(),_=Vr(),R=I?I.url:_.pathname,E=t(0),O=E[0],D=E[1];return r("form",Ur({className:Sr("tabbed-form",o)},da(P)),s(w,{classes:F,url:R,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=de(e,t,R);return r(qr,{exact:!0,path:me(a)},function(r){return m(e)?s(e,{intent:"content",classes:F,resource:h,record:v,basePath:n,hidden:k?!r.match:O!==t,variant:e.props.variant||T,margin:e.props.margin||x,value:k?a:t}):null})}})),N&&s(N,{basePath:n,className:"toolbar",handleSubmitWithRedirect:u,handleSubmit:c,invalid:d,mutationMode:p,pristine:f,record:v,redirect:g,resource:h,saving:b,submitOnEnter:y,undoable:S}))},ua=Xe(function(e){return{errorTabButton:{color:e.palette.error.main},content:{paddingTop:e.spacing(1),paddingLeft:e.spacing(2),paddingRight:e.spacing(2)}}},{name:"RaTabbedForm"});ca.defaultProps={submitOnEnter:!0,tabs:r(pe,null),toolbar:r(fe,null),component:function(e){return r("div",{className:e.className},e.children)}};var da=function(e){return Jr(e,la)},ma={setError:function(e,r){r.fields[e[0]].data=e[1]}},pa=function(e){var n=d(pt),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=Jr(i,sa),m=s===ma?s:Ur({},ma,s),p=Dn(e),f=T(),v=c(function(r,n,t){var a=o&&o(Ur({form:{values:r}},p),"N");return"string"==typeof a?void f(a,"warning"):void 0===a||a?e.save(r,n,t):void 0},[o,p]);return r(R,Ur({},e,u,{save:v,mutators:m,initialValues:t,render:function(e){return r(ca,Ur({component:Ft},e))}}))};pa.defaultProps={margin:"normal",variant:"outlined",syncWithLocation:!1},zr.ra.page.empty="No records yet";var fa=Ur({},zr,{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:"Etriek WebSite"}}},validation:{greater_or_equal:"Must be greater than or equal to %{menor}"}});Hr.ra.notification.created="Datos guardados correctamente",Hr.ra.action.bulk_actions="1 seleccionado |||| %{smart_count} selecccionados",Hr.ra.page.dashboard="Inicio",Hr.ra.page.empty="Sin registros todavía",Hr.ra.page.invite="¿Quiere agregar uno?",Hr.ra.page.list="%{name}",Hr.ra.page.edit="Editar %{name}",Hr.ra.action.back="Volver";var va=Ur({},Hr,{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 Etriek"}}},validation:{greater_or_equal:"Debe ser mayor o igual a %{menor}"}}),ga=["hidden"],ha=["hidden","useContenido"],ba=["hidden"],ya=function(e){var r=d(pt),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=Jr(e,ga),u=i.hidden,m=i.useContenido,p=void 0===m?En:m,f=Jr(i,ha),v=void 0!==u?u:s,g=p(Ur({},c,{estado:n,hidden:v,loading:t},f)),h=g.hidden,b=Jr(g,ba);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}},Ca=function(e){var n=ya(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(ve,Ur({},t,{record:o}))},ka=["onFocus","onChange","onBlur","hidden","disabled","validate"],wa=["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},Ta=function(e){var r=d(pt),t=r.estado,a=r.loading,o=r.fichaProps,i=void 0===o?{}:o,l=De(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?ot:void 0,m=i[e.source],p=void 0===m?{}:m,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,w=Jr(e,ka),N=ge({source:e.source}).input,S=p.onFocus,T=p.onBlur,x=p.onChange,P=p.hidden,F=p.disabled,I=p.useContenido,_=void 0===I?En:I,R=p.validate,E=Jr(p,wa),O=void 0!==P?P:b,D=void 0!==F?F:C,M=void 0!==S?S:f,L=void 0!==T?T:g,B=void 0!==x?x:v,V=Mn(e),A=_(Ur({},w,{estado:t,hidden:O,loading:a,utils:V},E)),q=n(N.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,U=A.validate,J=Jr(A,Na),Z=H||M,Q=G||L,Y=j||B,$=Ur({},V,{prev:q.current}),K=Array.isArray(k)?k:[k],X=Array.isArray(R)?R:[R],ee=Array.isArray(U)?U:[U];return{propsContenido:Ur({onFocus:function(e){Z&&M(V,t,e),q.current=e.target.value},onBlur:function(e){return Q&&Q($,t,e)},onChange:function(e){return Y&&Y($,t,e)},helperText:!1,validate:[].concat(K,X,ee,[Sa,u]).filter(function(e){return void 0!==e})},w,E,J,{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=Ta(e);return!n.hidden&&r(he,Ur({accept:"",maxSize:5e6},n.propsContenido),r(be,{source:"src"}))},Pa=function(e){var n=Ta(e);return!n.hidden&&r(ye,n.propsContenido)},Fa=["callback"],Ia=["helperText"],_a=["callback"],Ra=function(e){var n=e.callback,t=Jr(e,Fa),o=E(t),i=o.loading,l=o.data;return a(function(){i||"function"==typeof n&&n(Object.values(l))},[i]),r(Ne,t)},Ea=function(e){var t,o,i=Ta(e),l=i.propsContenido,s=i.hidden,c=n(!1),u=Me(),d=k(),m=l.helperText,p=Jr(l,Ia),f=De(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=Jr(g,_a)),a(function(){null!==f&&(v.current=f,u(Sn(e.source)))},[JSON.stringify(f)]),a(function(){c.current=!0},[d]),c.current?!s&&r(Ce,Ur({},p,{perPage:250,filter:o}),r(Ra,{callback:t,helperText:m,optionText:"etiqueta",optionValue:e.source})):r(ke,{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(we,{timeout:1}))},Oa=function(e){var n=Ta(e);return!n.hidden&&r(Ne,n.propsContenido)},Da=function(e){var n=e.title,t=e.source,a=e.src,o=Se(e);return r(Er,{title:n,src:a+"/"+o[t]})},Ma=["helperText"],La=function(e){var t=Ta(e),o=t.propsContenido,i=t.hidden,l=n(!1),s=k(),c=o.helperText,u=Jr(o,Ma);return a(function(){l.current=!0},[s]),l.current?!i&&r(Te,u,r(xe,{helperText:c,optionText:"etiqueta",optionValue:e.source})):r(ke,{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(we,{timeout:1}))},Ba=function(e){var n=Ta(e);return!n.hidden&&r(Pe,n.propsContenido)},Va=["helperText"],Aa=function(e){var t=Ta(e),o=t.propsContenido,i=t.hidden,l=n(!1),s=k(),c=o.helperText,u=Jr(o,Va);return a(function(){l.current=!0},[s]),l.current?!i&&r(Ce,u,r(Fe,{helperText:c,optionText:"etiqueta",optionValue:e.source})):r(ke,{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(we,null))},qa=function(e){var n=Ta(e);return!n.hidden&&r(Fe,n.propsContenido)},Wa=function(e){var n=Ta(e);return!n.hidden&&r(Ie,Ur({multiline:!0},n.propsContenido))},za=["tipo"],Ha=function(e){var n=e.tipo,t=Jr(e,za),o=Ta(t),i=o.propsContenido,l=o.hidden,s=ur(),c=ge({source:e.source}),u=c.input,d=c.meta,m="F"===n||"Z"===n;a(function(){i.value&&(s.change(e.source,i.value),e.disabled&&s.blur(e.source))}),a(function(){m&&""!=u.value&&d.valid&&d.modified&&!d.active&&i.onBlur()},[u.value]);var p=Ur({},i);return!l&&("N"===n||"D"===n?r(_e,p):"F"===n?r(jr,p):"Z"===n?r(Gr,p):r(Ie,"H"===n?Ur({},p,{type:"time"}):p))},ja=["tipo","value"],Ga=function(e){var n=e.tipo,t=Jr(e,ja),a=ya(t),o=a.hidden,i=Ur({},a.propsContenido);return!o&&("N"===n||"D"===n?r(Re,i):"F"===n?r(Ee,i):"Z"===n?r(Ee,Ur({},i,{showTime:!0})):r(Oe,i))};export{Yr as AppBar,Ca as BooleanField,xa as Camino,Pa as CheckBox,Ea as ComboBox,Oa as ComboBoxManual,vt as CreateEtriek,yt as DeleteButtonNoWarning,kt as EditEtriek,fn as EtrGrid,Nt as EtriekNotification,at as FichaActions,pt as FichaContext,Tt as FormDialog,Rt as FormEtriek,hn as GE,Wn as GrillaEtriek,Da as ImageField,jt as Layout,Ut as ListActionsEtriek,La as ListCheck,$t as Login,Lt as Menu,ra as MenuButton,ta as MultiTextField,Ba as Password,Aa as RadioButton,qa as RadioButtonManual,tt as Separador,oa as ShowEtriek,Ot as SubMenu,pa as TabbedFormEtriek,jn as TabbedGrillaEtriek,Wa as TextArea,Ha as TextBox,Ga as TextField,ut as choicesEstado,$n as dateFormat,lt as dateFormatOptions,Kn as dateParser,Xn as dateTimeFormat,et as dateTimeParser,Sn as deleteRecargarComboBox,dt as descargarLink,fa as enMessages,va as esMessages,st as etrFechaMayorQue,ot as etrRequerido,it as etrRequeridoNumerico,Qn as getFormcodFromResource,ct as localeOptions,Nn as recargarComboBox,xn as setDisableAction,Tn as setHiddenAction,Pn as setRequireAction,At as themes,rt as timeFormat,nt as timeParser,wn as useAjax,Ta as useContenidoController,en as useDeleteRowEtrGrid,ya as useFieldController,kn as useGetJson,Un as useInitFicha,$r as useNuevo,mt as useReferenceLabel,rn as useSaveRowEtrGrid,Yn as useStylesContenidos,Mn as useUtils,On as useUtilsGrilla};
|
|
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 E,FormWithRedirect as R,useListContext as _,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 $,SimpleFormView as K,SimpleForm as X,Menu as ee,DashboardMenuItem as re,Layout as ne,Sidebar as te,sanitizeListRestProps as ae,CreateButton as oe,ExportButton as ie,useLogin as le,FieldTitle as se,useShowController as ce,Show as ue,getTabFullPath as de,escapePath as pe,TabbedFormTabs as me,Toolbar as fe,BooleanField as ve,useInput as ge,FileInput as he,ImageField as be,BooleanInput as ye,ReferenceInput as Ce,Labeled as ke,LinearProgress as Ne,SelectInput as Se,useRecordContext as we,ReferenceArrayInput as xe,SelectArrayInput as Te,PasswordInput as Pe,RadioButtonGroupInput as Fe,TextInput as Ie,NumberInput as Ee,NumberField as Re,DateField as _e,TextField as Oe}from"react-admin";import{useSelector as De,useDispatch as Me}from"react-redux";import Le,{string as Be,func as Ve,any as Ae,bool as qe}from"prop-types";import{alpha as We,createTheme as ze,ThemeProvider as He,useMediaQuery as je,CircularProgress as Ge,Divider as Je}from"@material-ui/core";import Ue from"@material-ui/core/Dialog";import Ze from"@material-ui/core/DialogActions";import Qe from"@material-ui/core/DialogContent";import Ye from"@material-ui/core/DialogContentText";import $e from"@material-ui/core/DialogTitle";import Ke from"@material-ui/core/Paper";import{makeStyles as Xe,createTheme as er}from"@material-ui/core/styles";import rr from"@material-ui/core/Typography";import{GridOverlay as nr,esES as tr,DataGrid as ar}from"@material-ui/data-grid";import or from"@material-ui/icons/Add";import ir from"@material-ui/icons/Cancel";import lr from"@material-ui/icons/Delete";import sr from"@material-ui/icons/Edit";import cr from"@material-ui/core/TableContainer";import{useForm as ur,Form as dr,Field as pr}from"react-final-form";import mr from"@material-ui/core/Divider";import fr from"@material-ui/core/Tab";import vr from"@material-ui/core/Tabs";import gr from"@material-ui/core/styles/makeStyles";import hr from"@material-ui/icons/ChevronLeft";import br from"date-fns/locale/en-US";import yr from"date-fns/locale/es";import Cr from"moment";import kr from"@material-ui/core/IconButton";import{alpha as Nr}from"@material-ui/core/styles/colorManipulator";import Sr from"@material-ui/core/Tooltip";import wr from"classnames";import xr from"@material-ui/core/Button";import Tr from"@material-ui/icons/Settings";import Pr from"@material-ui/core/Collapse";import Fr from"@material-ui/core/List";import Ir from"@material-ui/core/ListItemIcon";import Er from"@material-ui/core/MenuItem";import Rr from"@material-ui/icons/ExpandMore";import _r from"@material-ui/core/Avatar";import Or from"@material-ui/core/Card";import Dr from"@material-ui/core/CardActions";import Mr from"@material-ui/core/CircularProgress";import Lr from"@material-ui/core/TextField";import{ThemeProvider as Br}from"@material-ui/styles";import{useLocation as Vr,useRouteMatch as Ar,Route as qr}from"react-router-dom";import Wr from"@material-ui/core/Menu";import zr from"ra-language-english";import Hr from"@blackbox-vision/ra-language-spanish";import{KeyboardDateInput as jr,KeyboardDateTimeInput as Gr}from"react-admin-date-inputs";function Jr(){return(Jr=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 Ur(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 Zr=e(function(e,n){var t=v(),a=De(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]}),Qr=function(e){return r(b,e,r(Zr,null))},Yr=function(e){return r(h,Jr({},e,{elevation:1,userMenu:r(Qr,null)}))},$r=function(e,r){return y(e,"-1",r)},Kr=Xe(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:We(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}},{name:"GE"}),Xr=function(){var e=Kr();return r(nr,{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"))},en=function(e,r,n){return C({type:"deleteEtrRow",resource:e,payload:{params:r}},n)},rn=function(e,r,n,t){return C({type:e,resource:r,payload:{params:n}},t)},nn=["api","basePath","classes","className","confirmTitle","confirmContent","icon","record","redirect","onSuccess","onFailure","source","camposClaveFila"],tn=["filterBy","claves","sortModel","columns","reference","allowAdd","allowRemove","etrResource","enableLoad"],an=Xe(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:We(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}},{name:"EtrGrid"}),on={marginLeft:"1.6rem",fontWeight:"bold"},ln=r(lr,null),sn=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?ln: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=Ur(e,nn),y=an(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=en(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],R=Object.keys(d).filter(function(e){return h.split(",").includes(e)}).reduce(function(e,r){return e[r]=d[r],e},{}),_=c(function(e){F({payload:{ge:g,clavesFila:R}})},[d]);return r(i,null,r(T,Jr({key:"button",onClick:w,className:y.deleteButton},b),u),r(E,{isOpen:N,loading:S,title:a,content:l,onConfirm:_,onClose:P}))},cn=function(e){return r(Ue,{open:e.open,onClose:e.onClose,fullWidth:!0},r($e,null,e.labelEstado+" "+e.label),r(Ye,null,r(rr,{component:"span",display:"block",variant:"subtitle1",style:Jr({},on)},e.msgTitle),e.msgDesc),r(R,{resource:e.resource,save:e.save,render:e.render,initialValues:e.initialValues}))};cn.propTypes={label:Be,onClick:Ve,icon:Ae,open:qe,onClose:Ve,labelEstado:Be,msgTitle:Ae,msgDesc:Ae,resource:Ae,save:Ve,render:Ve};var un=function(e){return r(sn,{api:!0,confirmTitle:"ra.action.delete",source:e.source,record:e.row,resource:e.resource,camposClaveFila:e.camposClaveFila})},dn=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=$r(m,{enabled:g}).data,y=rn("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:Jr({},e,a),ge:p,camposClaveFila:c,estado:"N"}})},E=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(or,null)),r(P,{value:E},r(cn,{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(Qe,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(Ze,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(ir,null))))}})))},pn=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=rn("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(sr,null)),r(cn,{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:Jr({},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(Qe,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(Ze,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(ir,null))))}}))},mn=ze({},tr),fn=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=Ur(e,tn),C=e.record,w=n(!1),x=an(e),T=k(),P=t(c)[1],F=c[0],I=F.field,E=F.sort;a(function(){w.current=!0},[T]);var R=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 O=N(d,{page:1,perPage:200},{field:I,order: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(dn,Jr({},y,{etrResource:g,camposClaveFila:s,clavesFila:R,api:e.api}))}}:{}].concat(u,[{field:" ",width:80,headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:function(e){return r(pn,Jr({},y,{camposClaveFila:s,clavesFila:R,api:e.api,row:e.row}))}},v?{field:" ",headerName:"",headerAlign:"center",sortable:!1,disableClickEventBubbling:!0,renderCell:function(e){return r(un,Jr({},y,{camposClaveFila:s,api:e.api,row:e.row}))}}:{}]),A=o(function(){return V},[JSON.stringify(V)]);return L?r(S,null):r(Ke,{className:x.rootPaper},r(He,{theme:mn},r(ar,Jr({className:x.root,disableSelectionOnClick:!0,pageSize:50,hideFooter:!0,sortModel:c,rows:B,columns:A,onSortModelChange:function(e){return P(e)},components:{NoRowsOverlay:Xr}},y))))},vn=["filterBy","sortModel","columns","reference","filter","enableLoad"],gn=ze({},tr),hn=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=Ur(e,vn),g=e.record,h=n(!1),b=Kr(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 E=[];l.split(",").forEach(function(e){e&&E.push({type:"string",comparison:"eq",value:g[e],field:e})});var R=Jr({},E.concat(p)),_=N(u,{page:1,perPage:200},{field:P,order:F},R,{enabled:f&&h.current}),O=_.data,D=_.ids,M=_.loading,L=o(function(){return D.map(function(e){return O[e]})},[D,O]);return M?r(S,null):r(Ke,{className:b.rootPaper},r(He,{theme:gn},r(ar,Jr({className:b.root,disableSelectionOnClick:!0,pageSize:50,hideFooter:!0,rows:L,columns:I,sortModel:w,onSortModelChange:function(e){return x(e)},components:{NoRowsOverlay:Xr}},v))))},bn=u(),yn=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(bn.Provider,{value:s},n)},Cn=function(){return d(bn)},kn=function(e,r,n,t){return C({type:"getJson",resource:e,payload:{method:r,params:n}},t)},Nn=function(e){var r=kn(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]},Sn=function(e,r,n,t){return{type:"RELOAD_CB",payload:{id:e,method:r,params:n,callback:t}}},wn=function(e,r){return{type:"RELOAD_CB_SUCCESS",payload:{id:e,callback:r}}},xn=function(e,r){return{type:"HIDE_INPUT",payload:{id:e,hidden:r}}},Tn=function(e,r){return{type:"DISABLE_INPUT",payload:{id:e,disabled:r}}},Pn=function(e,r){return{type:"REQUIRE_INPUT",payload:{id:e,required:r}}},Fn=function(){var e=Me();return c(function(r,n,t,a){e(Sn(r,n,t,a))},[e])},In=function(){var e=Me();return c(function(r,n){e(xn(r,n))},[e])},En=function(){var e=Me();return c(function(r,n){e(Tn(r,n))},[e])},Rn=function(){var e=Me();return c(function(r,n){e(Pn(r,n))},[e])},_n=function(e){return{}},On=function(e){var r=_(e),n=x(),t=O(),a=D(),o=M(e.resource);return{ajax:Nn(e.resource)[0],data:r,notify:n,redirect:t,refresh:a,unselectAll:o}},Dn=function(e){var r=Fn(),n=In(),t=En(),a=Rn(),o=Cn(),i=x(),l=O();return{ajax:Nn(e.resource)[0],notify:i,redirect:l,recargarComboBox:r,progress:o,setHidden:n,setDisable:t,setRequire:a}},Mn=function(e){var r=Fn(),n=In(),t=En(),a=Rn(),o=Cn(),i=x(),l=O();return{form:ur(),ajax:Nn(e.resource)[0],notify:i,redirect:l,recargarComboBox:r,progress:o,setHidden:n,setDisable:t,setRequire:a}},Ln=["isRowEditable"],Bn=["isRowEditable","primaryText","secondaryText","desktopSize","onRenderGrilla","onLoadGrilla","hasEdit"],Vn=Xe(function(e){return{container:{maxHeight:"70vh"},rowOdd:{backgroundColor:e.palette.action.hover}}},{name:"GrillaEtriek"}),An=function(e,r){return void 0===r||"function"==typeof r&&r(e)},qn=function(e){var n=e.isRowEditable,t=Ur(e,Ln);return An(e.record,n)?r(A,t):null},Wn=function(e){!function(e){var r=e.onRenderGrilla,n=e.onLoadGrilla,t=k(),o=On(e);a(function(){r&&r(o)},[]),a(function(){n&&n(o)},[t])}(e);var n=je(function(e){return e.breakpoints.down("sm")}),t=Vn(e),o=L(e).hasEdit,i=e.isRowEditable,s=e.primaryText,c=e.secondaryText,u=e.desktopSize,d=void 0!==u&&u,p=Ur(e,Bn),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&&An(e,i)?"edit":""},primaryText:v,secondaryText:g}):r(cr,{className:t.container},r(V,Jr({stickyHeader:!0},p),l.map(m,function(e){return e.props.hidden?null:e}),o&&r(qn,{isRowEditable:i})))},zn=["ids"],Hn=["filterValues","setFilters","tabs","GridComponent"],jn=function(e){var n=e.filterValues,t=e.setFilters,a=e.tabs,o=a.ids,l=Ur(a,zn),s=e.GridComponent,c=void 0===s?Wn:s,u=Ur(e,Hn),d=n.id;return r(i,null,r(vr,{value:d,indicatorColor:"primary",onChange:function(e,r){t(Jr({},n,{id:r}))}},o.map(function(e){return r(fr,{key:e,label:e.charAt(0).toUpperCase()+e.slice(1),value:e})})),r(mr,null),r(c,Jr({},u,l[d])))},Gn=["useFormulario"],Jn=function(e){var r=e.useFormulario;return{fichaProps:(void 0===r?_n:r)(Ur(e,Gn))}},Un=["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"],Zn=["children","basePath","className","data","hasShow","hasList"],Qn=function(e){return e.split("_")[1]},Yn=gr(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)}}),$n=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()}},Kn=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]},Xn=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()}},et=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)},rt=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()}},nt=function(e,r){return e?e.split(" ")[4].substr(0,5):""},tt=function(e){return r(rr,{variant:"h6",gutterBottom:!0},e.children)},at=function(e){var n=e.children,t=e.basePath,a=e.className,o=e.data,i=e.hasShow,l=Ur(e,Zn);return r(q,Jr({className:a},Ur(l,Un)),n,r(W,{label:"ra.action.back",basePath:t,icon:r(hr,null)}),i&&r(z,{basePath:t,record:o}))},ot=H(),it=[ot,j(1)],lt={format:"dd/MM/yyyy"},st=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(Cr(a).isAfter(o))return{message:"validation.greater_or_equal",args:{menor:t}}}}},ct=function(e){return void 0===e&&(e="es"),{locale:"en"==e?br:yr}},ut=[{id:"1",name:"Aprobado"},{id:"2",name:"Rechazado"},{id:"3",name:"Pendiente"}],dt=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()},pt=function(e,r){var n=G();return De(function(t){var a;return(null===(a=t.admin.resources["cb_"+Qn(n)+"_"+e].data[r])||void 0===a?void 0:a.etiqueta)||""})},mt=u({}),ft=["useFormulario","enableLoad"],vt=function(e){var n=e.enableLoad,t=void 0===n||n,a=Ur(e,ft),i=G(e),l=$r(i,{enabled:t}),s=l.data,c=l.loading,u=Jn(e).fichaProps,d=o(function(){return{estado:"N",initialValues:s,loading:c,fichaProps:u}},[s,c,u]);return r(yn,null,r(mt.Provider,{value:d},r(J,Jr({},a,null==u?void 0:u.panel))))};vt.propTypes={useFormulario:Le.func};var gt=["basePath","classes","filterValues","handleSubmit","handleSubmitWithRedirect","invalid","label","pristine","resource","saving","selectedIds","submitOnEnter","redirect"],ht=["resource","record","basePath","redirect","className","icon","label"],bt=Xe(function(e){return{deleteButton:{color:e.palette.error.main,"&:hover":{backgroundColor:Nr(e.palette.error.main,.12),"@media (hover: none)":{backgroundColor:"transparent"}}}}}),yt=function(e){var n=bt(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=Ur(e,ht),d=U(a,o.id),p=d[0],m=d[1].loading;return r(Sr,{title:t("ra.action.delete")},r(kr,Jr({disabled:m,onClick:p,label:c,className:wr("ra-delete-button",n.deleteButton,i),key:"button"},Ur(u,gt)),l))};yt.defaultProps={redirect:"list",icon:r(lr,null)};var Ct=["useFormulario"],kt=function(e){var n=Ur(e,Ct),t=Z(n),a=t.record,i=t.loading,l=Jn(e).fichaProps,s=o(function(){return{estado:"M",initialValues:a,loading:i,fichaProps:l}},[a,i,l]);return r(yn,null,r(mt.Provider,{value:s},r(Q,Jr({},n,null==l?void 0:l.panel))))},Nt=Xe(function(e){return{snackbarContent:{whiteSpace:"pre-wrap"}}}),St=function(e){var n=Nt(e);return r(Y,Jr({},e,{className:n.snackbarContent}))},wt=gr(function(e){return{button:{margin:e.spacing(1)},input:{display:"none"}}}),xt=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=wt(e),g=function(e){o&&o(e)};return r(Ue,{ref:n,open:t,fullWidth:!0,onClose:g,"aria-labelledby":"form-dialog-title"},r($e,{id:"form-dialog-title"},i),r(Qe,null,r(Ye,null,l),s),(u||p)&&r(Ze,null,p&&r(xr,{onClick:g,variant:"contained",color:"secondary",className:v.button,disabled:f},"Cancelar"),u&&r(xr,{onClick:function(e){a&&a(e)},variant:"contained",color:"primary",className:v.button,disabled:f},"Ok")))}),Tt=gr(function(e){return{block:{pointerEvents:"none",backgroundColor:"#ffffff",opacity:.6,position:"relative"},progress:{position:"absolute",left:"50%",top:"50%"}}}),Pt=function(e){var n=Tt(e),t=Cn(),o=G(e),i=d(mt),l=i.estado,s=i.loading,c=i.fichaProps,u=Mn({resource:o});return a(function(){c.onRenderFicha&&c.onRenderFicha(u,l)},[]),a(function(){s||c.onLoadFicha&&c.onLoadFicha(u,l)},[s]),r($,{className:t.open?n.block:""},t.open&&r(Ge,{className:n.progress,thickness:4,size:50}),e.children)},Ft=function(e){return r(Pt,e)},It=["mutators"],Et={setError:function(e,r){r.fields[e[0]].data=e[1]}},Rt=function(e){var n=d(mt),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=Ur(i,It),p=s===Et?s:Jr({},Et,s),m=Dn(e),f=x(),v=c(function(r,n,t){var a=o&&o(Jr({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(R,Jr({},e,u,{save:v,mutators:p,initialValues:t,render:function(e){return r(K,Jr({component:Ft},e))}}))};Rt.propTypes=Jr({},X.propTypes),Rt.defaultProps={margin:"normal",variant:"outlined"};var _t=Xe(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"}}}),Ot=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=_t(),p=r(Er,{dense:c,button:!0,onClick:n},r(Ir,{className:d.icon},a?r(Rr,null):l),r(rr,{variant:"inherit",color:"textSecondary"},u(o)));return r(i,null,t||a?p:r(Sr,{title:u(o),placement:"right"},p),r(Pr,{in:a,timeout:"auto",unmountOnExit:!0},r(Fr,{dense:c,component:"div",disablePadding:!0,className:t?d.sidebarIsOpen:d.sidebarIsClosed},s),r(mr,null)))},Dt=["items","translate"],Mt={marginTop:"1.5em"},Lt=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=je(function(e){return e.breakpoints.down("sm")}),p=je(function(e){return e.breakpoints.down("xs")}),m=De(function(e){return e.admin.ui.sidebarOpen}),f=function e(n){var t=n.items,a=n.translate,o=Ur(n,Dt),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(Ot,{key:t,name:p,handleToggle:function(){return c(t)},isOpen:l[t],sidebarIsOpen:d,icon:r(Tr,null),dense:u},e(Jr({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(Tr,null)})}))}({items:JSON.parse(localStorage.getItem("menus")),handleToggle:function(e){u(function(r){var n;return Jr({},r,((n={})[e]=!r[e],n))})},state:c,activeClassName:"",iconClass:"",className:"",open:m,dense:a,onMenuClick:n,translate:l});return r(ee,{style:Mt},r(re,{primaryText:l("ra.page.dashboard"),onClick:n,sidebarIsOpen:m}),f,p&&r(g,{to:"/configuration",primaryText:l("pos.configuration"),leftIcon:r(Tr,null),onClick:n,sidebarIsOpen:m,dense:a}),p&&o,!p&&d&&o)},Bt={palette:{type:"dark",primary:{main:"#90caf9"}},overrides:{RaSidebar:{drawerPaper:{position:"sticky"}},RaRichTextInput:{"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}}}},Vt={palette:{secondary:{light:"#5f5fc4",main:"#2196f3",dark:"#001064",contrastText:"#fff"}},overrides:{RaSidebar:{drawerPaper:{position:"sticky"}},RaRichTextInput:{"@global":{".ra-rich-text-input":{"& .ql-editor":{"& p:not(:last-child)":{marginBottom:"0"}}}}},MuiFilledInput:{root:{backgroundColor:"rgba(0, 0, 0, 0.04)","&$disabled":{backgroundColor:"rgba(0, 0, 0, 0.04)"}}}}},At={__proto__:null,darkTheme:Bt,lightTheme:Vt},qt=["apiFolder"],Wt=function(e){return r(te,e)},zt=function(e){var n=Ur(e,qt),t=De(function(e){return"dark"===e.theme?Bt:Vt});return r(ne,Jr({},n,{appBar:Yr,sidebar:Wt,menu:Lt,theme:t,notification:St}))},Ht=["className","exporter","filters","children"],jt=function(e){var n=e.className,t=e.exporter,a=e.filters,i=e.children,l=Ur(e,Ht),c=_(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,Jr({className:n},ae(l)),a&&s(a,{resource:h,showFilter:v,displayedFilters:d,filterValues:p,context:"button"}),b&&r(oe,{basePath:m}),!1!==t&&r(ie,{disabled:0===g,resource:h,sort:u,filterValues:p}),i)},[h,d,p,f,a,g])},Gt=["meta","input","render"],Jt=Xe(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"}}}),Ut=function(e){var n=e.meta,t=(n=void 0===n?{touched:!1,error:void 0}:n).touched,a=n.error,o=Jr({},e.input),i=Ur(e,Gt);return r(Lr,Jr({error:!(!t||!a),helperText:t&&a},o,i,{fullWidth:!0}))},Zt=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=Jt({loginBackgroundImage:n,textLength:p.length}),g=x(),h=le(),b=Vr();return r(dr,{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(Or,{className:f.card},r("div",{className:f.avatar},r(_r,{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(pr,{autoFocus:!0,name:o,component:Ut,label:d("ra.auth.username"),disabled:c})),r("div",{className:f.input},r(pr,{name:l,component:Ut,label:d("ra.auth.password"),type:"password",disabled:c}))),r(Dr,{className:f.actions},r(xr,{variant:"contained",type:"submit",color:"primary",disabled:c,fullWidth:!0},c&&r(Mr,{className:f.icon,size:18,thickness:2}),p))),r(Y,null)))}})},Qt=function(e){return r(Br,{theme:er(Vt)},r(Zt,e))},Yt=["displayedFilters","filterValues","showFilter"],$t=["className","options","icon"],Kt=Xe({root:{display:"inline-block"}}),Xt=function(e){var a=e.className,o=e.options,i=void 0===o?[]:o,l=e.icon,s=Ur(e,$t),c=t(!1),u=c[0],d=c[1],p=n(),m=t(0),f=m[0],v=m[1],g=Kt(e),h=G(e);return r("div",Jr({className:wr(g.root,a)},Ur(s,Yt)),r(T,{className:"add-filter",label:i[f].label,onClick:function(e){e.preventDefault(),d(!0),p.current=e.currentTarget}},l),r(Wr,{open:u,anchorEl:p.current,onClose:function(e){p.current&&p.current.contains(e.target)||d(!1)}},i.map(function(e,n){return r(Er,{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(se,{label:e.label,resource:h}))})))},ea=["fields","className","basePath","record","textAlign","sortable"],ra=function(e){var n=e.fields,t=e.className,a=e.record,o=Ur(e,ea),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(rr,Jr({noWrap:!0,variant:"inherit",className:t},o),d,u&&r(rr,{component:"span",display:"block",color:"textSecondary",variant:"caption"},c.map(function(e){return(e.etiqueta||"---")+": "+(a[e.campo]||"---")}).join(" ")))},na=["useFormulario"],ta=function(e){var n=Ur(e,na),t=ce(n),a=t.record,i=t.loading,l=Jn(e).fichaProps,s=o(function(){return{estado:"M",initialValues:a,loading:i,fichaProps:l}},[a,i,l]);return r(yn,null,r(mt.Provider,{value:s},r(ue,Jr({},n,t,null==l?void 0:l.panel))))},aa=["basePath","children","className","classes","component","form","handleSubmit","handleSubmitWithRedirect","invalid","mutationMode","pristine","record","redirect","resource","saving","submitOnEnter","syncWithLocation","tabs","toolbar","undoable","variant","margin"],oa=["active","dirty","dirtyFields","dirtyFieldsSinceLastSubmit","dirtySinceLastSubmit","error","errors","hasSubmitErrors","hasValidationErrors","initialValues","modified","modifiedSinceLastSubmit","save","submitError","submitErrors","submitFailed","submitSucceeded","submitting","touched","valid","validating","values","visited","__versions"],ia=["mutators"],la=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=Ur(e,aa),F=sa(e),I=Ar(),E=Vr(),R=I?I.url:E.pathname,_=t(0),O=_[0],D=_[1];return r("form",Jr({className:wr("tabbed-form",o)},ca(P)),s(N,{classes:F,url:R,syncWithLocation:k,onChange:function(e,r){k||D(r)},value:O},a),r(Je,null),r(i,{className:F.content},l.map(a,function(e,t){if(e){var a=de(e,t,R);return r(qr,{exact:!0,path:pe(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}))},sa=Xe(function(e){return{errorTabButton:{color:e.palette.error.main},content:{paddingTop:e.spacing(1),paddingLeft:e.spacing(2),paddingRight:e.spacing(2)}}},{name:"RaTabbedForm"});la.defaultProps={submitOnEnter:!0,tabs:r(me,null),toolbar:r(fe,null),component:function(e){return r("div",{className:e.className},e.children)}};var ca=function(e){return Ur(e,oa)},ua={setError:function(e,r){r.fields[e[0]].data=e[1]}},da=function(e){var n=d(mt),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=Ur(i,ia),p=s===ua?s:Jr({},ua,s),m=Dn(e),f=x(),v=c(function(r,n,t){var a=o&&o(Jr({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(R,Jr({},e,u,{save:v,mutators:p,initialValues:t,render:function(e){return r(la,Jr({component:Ft},e))}}))};da.defaultProps={margin:"normal",variant:"outlined",syncWithLocation:!1},zr.ra.page.empty="No records yet";var pa=Jr({},zr,{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:"Etriek WebSite"}}},validation:{greater_or_equal:"Must be greater than or equal to %{menor}"}});Hr.ra.notification.created="Datos guardados correctamente",Hr.ra.action.bulk_actions="1 seleccionado |||| %{smart_count} selecccionados",Hr.ra.page.dashboard="Inicio",Hr.ra.page.empty="Sin registros todavía",Hr.ra.page.invite="¿Quiere agregar uno?",Hr.ra.page.list="%{name}",Hr.ra.page.edit="Editar %{name}",Hr.ra.action.back="Volver";var ma=Jr({},Hr,{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 Etriek"}}},validation:{greater_or_equal:"Debe ser mayor o igual a %{menor}"}}),fa=["hidden"],va=["hidden","useContenido"],ga=["hidden"],ha=function(e){var r=d(mt),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=Ur(e,fa),u=i.hidden,p=i.useContenido,m=void 0===p?_n:p,f=Ur(i,va),v=void 0!==u?u:s,g=m(Jr({},c,{estado:n,hidden:v,loading:t},f)),h=g.hidden,b=Ur(g,ga);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:Jr({},c,f,b),hidden:void 0!==h?h:v}},ba=function(e){var n=ha(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(ve,Jr({},t,{record:o}))},ya=["onFocus","onChange","onBlur","hidden","disabled","validate"],Ca=["onFocus","onBlur","onChange","hidden","disabled","useContenido","validate"],ka=["hidden","disabled","onFocus","onChnage","onBlur","validate"],Na=function(e,r,n){return"string"==typeof(null==n?void 0:n.data)?n.data:void 0},Sa=function(e){var r=d(mt),t=r.estado,a=r.loading,o=r.fichaProps,i=void 0===o?{}:o,l=De(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?ot: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=Ur(e,ya),S=ge({source:e.source}).input,w=m.onFocus,x=m.onBlur,T=m.onChange,P=m.hidden,F=m.disabled,I=m.useContenido,E=void 0===I?_n:I,R=m.validate,_=Ur(m,Ca),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=Mn(e),A=E(Jr({},N,{estado:t,hidden:O,loading:a,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,H=A.onFocus,j=A.onChnage,G=A.onBlur,J=A.validate,U=Ur(A,ka),Z=H||M,Q=G||L,Y=j||B,$=Jr({},V,{prev:q.current}),K=Array.isArray(k)?k:[k],X=Array.isArray(R)?R:[R],ee=Array.isArray(J)?J:[J];return{propsContenido:Jr({onFocus:function(e){Z&&M(V,t,e),q.current=e.target.value},onBlur:function(e){return Q&&Q($,t,e)},onChange:function(e){return Y&&Y($,t,e)},helperText:!1,validate:[].concat(K,X,ee,[Na,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:O}},wa=function(e){var n=Sa(e);return!n.hidden&&r(he,Jr({accept:"",maxSize:5e6},n.propsContenido),r(be,{source:"src"}))},xa=function(e){var n=Sa(e);return!n.hidden&&r(ye,n.propsContenido)},Ta=["callback"],Pa=["helperText"],Fa=["callback"],Ia=function(e){var n=e.callback,t=Ur(e,Ta),o=_(t),i=o.loading,l=o.data;return a(function(){i||"function"==typeof n&&n(Object.values(l))},[i]),r(Se,t)},Ea=function(e){var t,o,i=Sa(e),l=i.propsContenido,s=i.hidden,c=n(!1),u=Me(),d=k(),p=l.helperText,m=Ur(l,Pa),f=De(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=Ur(g,Fa)),a(function(){null!==f&&(v.current=f,u(wn(e.source)))},[JSON.stringify(f)]),a(function(){c.current=!0},[d]),c.current?!s&&r(Ce,Jr({},m,{perPage:250,filter:o}),r(Ia,{callback:t,helperText:p,optionText:"etiqueta",optionValue:e.source})):r(ke,{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(Ne,{timeout:1}))},Ra=function(e){var n=Sa(e);return!n.hidden&&r(Se,n.propsContenido)},_a=function(e){var n=e.title,t=e.source,a=e.src,o=we(e);return r(_r,{title:n,src:a+"/"+o[t]})},Oa=["helperText"],Da=function(e){var t=Sa(e),o=t.propsContenido,i=t.hidden,l=n(!1),s=k(),c=o.helperText,u=Ur(o,Oa);return a(function(){l.current=!0},[s]),l.current?!i&&r(xe,u,r(Te,{helperText:c,optionText:"etiqueta",optionValue:e.source})):r(ke,{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(Ne,{timeout:1}))},Ma=function(e){var n=Sa(e);return!n.hidden&&r(Pe,n.propsContenido)},La=["helperText"],Ba=function(e){var t=Sa(e),o=t.propsContenido,i=t.hidden,l=n(!1),s=k(),c=o.helperText,u=Ur(o,La);return a(function(){l.current=!0},[s]),l.current?!i&&r(Ce,u,r(Fe,{helperText:c,optionText:"etiqueta",optionValue:e.source})):r(ke,{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(Ne,null))},Va=function(e){var n=Sa(e);return!n.hidden&&r(Fe,n.propsContenido)},Aa=function(e){var n=Sa(e);return!n.hidden&&r(Ie,Jr({multiline:!0},n.propsContenido))},qa=["tipo"],Wa=function(e){var n=e.tipo,t=Ur(e,qa),o=Sa(t),i=o.propsContenido,l=o.hidden,s=ur(),c=ge({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=Jr({},i);return!l&&("N"===n||"D"===n?r(Ee,m):"F"===n?r(jr,m):"Z"===n?r(Gr,m):r(Ie,"H"===n?Jr({},m,{type:"time"}):m))},za=["tipo","value"],Ha=function(e){var n=e.tipo,t=Ur(e,za),a=ha(t),o=a.hidden,i=Jr({},a.propsContenido);return!o&&("N"===n||"D"===n?r(Re,i):"F"===n?r(_e,i):"Z"===n?r(_e,Jr({},i,{showTime:!0})):r(Oe,i))};export{Yr as AppBar,ba as BooleanField,wa as Camino,xa as CheckBox,Ea as ComboBox,Ra as ComboBoxManual,vt as CreateEtriek,yt as DeleteButtonNoWarning,kt as EditEtriek,fn as EtrGrid,St as EtriekNotification,at as FichaActions,mt as FichaContext,xt as FormDialog,Rt as FormEtriek,hn as GE,Wn as GrillaEtriek,_a as ImageField,zt as Layout,jt as ListActionsEtriek,Da as ListCheck,Qt as Login,Lt as Menu,Xt as MenuButton,ra as MultiTextField,Ma as Password,Ba as RadioButton,Va as RadioButtonManual,tt as Separador,ta as ShowEtriek,Ot as SubMenu,da as TabbedFormEtriek,jn as TabbedGrillaEtriek,Aa as TextArea,Wa as TextBox,Ha as TextField,ut as choicesEstado,$n as dateFormat,lt as dateFormatOptions,Kn as dateParser,Xn as dateTimeFormat,et as dateTimeParser,wn as deleteRecargarComboBox,dt as descargarLink,pa as enMessages,ma as esMessages,st as etrFechaMayorQue,ot as etrRequerido,it as etrRequeridoNumerico,Qn as getFormcodFromResource,ct as localeOptions,Sn as recargarComboBox,Tn as setDisableAction,xn as setHiddenAction,Pn as setRequireAction,At as themes,rt as timeFormat,nt as timeParser,Nn as useAjax,Sa as useContenidoController,en as useDeleteRowEtrGrid,ha as useFieldController,kn as useGetJson,Jn as useInitFicha,$r as useNuevo,pt as useReferenceLabel,rn as useSaveRowEtrGrid,Yn as useStylesContenidos,Mn as useUtils,On as useUtilsGrilla};
|