@artibet/react-mui-components 3.7.33 → 3.7.34

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.
@@ -1 +1 @@
1
- import{TextField as e,FormGroup as r,FormControlLabel as t,Switch as n,Typography as o,Stack as a,Box as i,Popover as l,Autocomplete as u,Chip as d,InputAdornment as c,IconButton as s,FormControl as f,FormLabel as v,RadioGroup as m,Radio as h,Checkbox as p}from"@mui/material";import g from"react";import{Controller as b}from"react-hook-form";import{ChromePicker as y}from"react-color";import{toDate as E}from"date-fns";import"date-fns/locale";import w from"axios";import{NumericFormat as x}from"react-number-format";import{AdapterDateFns as O}from"@mui/x-date-pickers/AdapterDateFnsV3";import{LocalizationProvider as C}from"@mui/x-date-pickers/LocalizationProvider";import{DateTimePicker as q,renderDigitalClockTimeView as S,DatePicker as T,TimePicker as L}from"@mui/x-date-pickers";import P from"date-fns/locale/el";import{Clear as k}from"@mui/icons-material";function B(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function j(e,r,t,n,o,a,i){try{var l=e[a](i),u=l.value}catch(e){return void t(e)}l.done?r(u):Promise.resolve(u).then(n,o)}function V(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var a=e.apply(r,t);function i(e){j(a,n,o,i,l,"next",e)}function l(e){j(a,n,o,i,l,"throw",e)}i(void 0)}))}}function W(e,r,t){return(r=function(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function F(){return F=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},F.apply(null,arguments)}function z(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function A(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?z(Object(t),!0).forEach((function(r){W(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):z(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function I(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==r.indexOf(n))continue;t[n]=e[n]}return t}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],-1===r.indexOf(t)&&{}.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function _(){_=function(){return r};var e,r={},t=Object.prototype,n=t.hasOwnProperty,o=Object.defineProperty||function(e,r,t){e[r]=t.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function d(e,r,t){return Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}),e[r]}try{d({},"")}catch(e){d=function(e,r,t){return e[r]=t}}function c(e,r,t,n){var a=r&&r.prototype instanceof g?r:g,i=Object.create(a.prototype),l=new k(n||[]);return o(i,"_invoke",{value:S(e,t,l)}),i}function s(e,r,t){try{return{type:"normal",arg:e.call(r,t)}}catch(e){return{type:"throw",arg:e}}}r.wrap=c;var f="suspendedStart",v="suspendedYield",m="executing",h="completed",p={};function g(){}function b(){}function y(){}var E={};d(E,i,(function(){return this}));var w=Object.getPrototypeOf,x=w&&w(w(B([])));x&&x!==t&&n.call(x,i)&&(E=x);var O=y.prototype=g.prototype=Object.create(E);function C(e){["next","throw","return"].forEach((function(r){d(e,r,(function(e){return this._invoke(r,e)}))}))}function q(e,r){function t(o,a,i,l){var u=s(e[o],e,a);if("throw"!==u.type){var d=u.arg,c=d.value;return c&&"object"==typeof c&&n.call(c,"__await")?r.resolve(c.__await).then((function(e){t("next",e,i,l)}),(function(e){t("throw",e,i,l)})):r.resolve(c).then((function(e){d.value=e,i(d)}),(function(e){return t("throw",e,i,l)}))}l(u.arg)}var a;o(this,"_invoke",{value:function(e,n){function o(){return new r((function(r,o){t(e,n,r,o)}))}return a=a?a.then(o,o):o()}})}function S(r,t,n){var o=f;return function(a,i){if(o===m)throw Error("Generator is already running");if(o===h){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var l=n.delegate;if(l){var u=T(l,n);if(u){if(u===p)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===f)throw o=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var d=s(r,t,n);if("normal"===d.type){if(o=n.done?h:v,d.arg===p)continue;return{value:d.arg,done:n.done}}"throw"===d.type&&(o=h,n.method="throw",n.arg=d.arg)}}}function T(r,t){var n=t.method,o=r.iterator[n];if(o===e)return t.delegate=null,"throw"===n&&r.iterator.return&&(t.method="return",t.arg=e,T(r,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var a=s(o,r.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,p;var i=a.arg;return i?i.done?(t[r.resultName]=i.value,t.next=r.nextLoc,"return"!==t.method&&(t.method="next",t.arg=e),t.delegate=null,p):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function L(e){var r={tryLoc:e[0]};1 in e&&(r.catchLoc=e[1]),2 in e&&(r.finallyLoc=e[2],r.afterLoc=e[3]),this.tryEntries.push(r)}function P(e){var r=e.completion||{};r.type="normal",delete r.arg,e.completion=r}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function B(r){if(r||""===r){var t=r[i];if(t)return t.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function t(){for(;++o<r.length;)if(n.call(r,o))return t.value=r[o],t.done=!1,t;return t.value=e,t.done=!0,t};return a.next=a}}throw new TypeError(typeof r+" is not iterable")}return b.prototype=y,o(O,"constructor",{value:y,configurable:!0}),o(y,"constructor",{value:b,configurable:!0}),b.displayName=d(y,u,"GeneratorFunction"),r.isGeneratorFunction=function(e){var r="function"==typeof e&&e.constructor;return!!r&&(r===b||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,d(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},r.awrap=function(e){return{__await:e}},C(q.prototype),d(q.prototype,l,(function(){return this})),r.AsyncIterator=q,r.async=function(e,t,n,o,a){void 0===a&&(a=Promise);var i=new q(c(e,t,n,o),a);return r.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},C(O),d(O,u,"Generator"),d(O,i,(function(){return this})),d(O,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var r=Object(e),t=[];for(var n in r)t.push(n);return t.reverse(),function e(){for(;t.length;){var n=t.pop();if(n in r)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=B,k.prototype={constructor:k,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!r)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var t=this;function o(n,o){return l.type="throw",l.arg=r,t.next=n,o&&(t.method="next",t.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),d=n.call(i,"finallyLoc");if(u&&d){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!d)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,r){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=r&&r<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=r,a?(this.method="next",this.next=a.finallyLoc,p):this.complete(i)},complete:function(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),p},finish:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),P(t),p}},catch:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.tryLoc===e){var n=t.completion;if("throw"===n.type){var o=n.arg;P(t)}return o}}throw Error("illegal catch attempt")},delegateYield:function(r,t,n){return this.delegate={iterator:B(r),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=e),p}},r}function N(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a,i,l=[],u=!0,d=!1;try{if(a=(t=t.call(e)).next,0===r);else for(;!(u=(n=a.call(t)).done)&&(l.push(n.value),l.length!==r);u=!0);}catch(e){d=!0,o=e}finally{try{if(!u&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(d)throw o}}return l}}(e,r)||function(e,r){if(e){if("string"==typeof e)return B(e,r);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?B(e,r):void 0}}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var K=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],D=function(r){var t=r.form,n=r.name,o=r.label,a=r.maxLength,i=void 0===a?255:a,l=r.required,u=void 0!==l&&l,d=r.disabled,c=void 0!==d&&d,s=r.autofocus,f=void 0!==s&&s,v=r.showErrors,m=void 0===v||v,h=r.readonly,p=void 0!==h&&h,y=r.readonlyBackgroundColor,E=void 0===y?"#dddddd":y,w=r.bold,x=void 0!==w&&w,O=I(r,K),C=t.control,q=t.formState.errors;return g.createElement(b,{name:n,control:C,rules:{required:u,disabled:c},render:function(r){var t,a,l=r.field,d=l.onChange,s=l.onBlur,v=l.value;return g.createElement(e,F({required:u,label:o,value:v,onChange:d,onBlur:s,error:m&&Boolean(null===(t=q[n])||void 0===t?void 0:t.message),fullWidth:!0,helperText:m&&(null===(a=q[n])||void 0===a?void 0:a.message),variant:"outlined",disabled:c,autoFocus:f,slotProps:{input:{maxLength:i,readOnly:p,sx:{fontWeight:x?"bold":"",backgroundColor:p?E:""}}}},O))}})},M=["form","name","label","required","disabled","autofocus","showErrors"],Y=function(r){var t=r.form,n=r.name,o=void 0===n?"password":n,a=r.label,i=void 0===a?"Κωδικός Πρόσβασης":a,l=r.required,u=void 0===l||l,d=r.disabled,c=void 0!==d&&d,s=r.autofocus,f=void 0!==s&&s,v=r.showErrors,m=void 0===v||v,h=I(r,M),p=t.control,y=t.formState.errors;return g.createElement(b,{name:o,control:p,rules:{required:u,disabled:c},render:function(r){var t,n,a=r.field,l=a.onChange,d=a.onBlur,s=a.value;return g.createElement(e,F({required:u,label:i,value:s,onChange:l,onBlur:d,error:m&&Boolean(null===(t=y[o])||void 0===t?void 0:t.message),fullWidth:!0,helperText:m&&(null===(n=y[o])||void 0===n?void 0:n.message),variant:"outlined",disabled:c,autoFocus:f,type:"password"},h))}})},G=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],R=function(r){var t=r.form,n=r.name,o=void 0===n?"email":n,a=r.label,i=void 0===a?"E-mail":a,l=r.maxLength,u=void 0===l?255:l,d=r.required,c=void 0===d||d,s=r.disabled,f=void 0!==s&&s,v=r.autofocus,m=void 0!==v&&v,h=r.showErrors,p=void 0===h||h,y=r.readonly,E=void 0!==y&&y,w=r.readonlyBackgroundColor,x=void 0===w?"#dddddd":w,O=r.bold,C=void 0!==O&&O,q=I(r,G),S=t.control,T=t.formState.errors;return g.createElement(b,{name:o,control:S,rules:{required:c,disabled:f},render:function(r){var t,n,a=r.field,l=a.onChange,d=a.onBlur,s=a.value;return g.createElement(e,F({required:c,label:i,value:s,onChange:l,onBlur:d,error:p&&Boolean(null===(t=T[o])||void 0===t?void 0:t.message),fullWidth:!0,helperText:p&&(null===(n=T[o])||void 0===n?void 0:n.message),variant:"outlined",disabled:f,autoFocus:m,slotProps:{input:{maxLength:u,readOnly:E,sx:{fontWeight:C?"bold":"",backgroundColor:E?x:""}}}},q))}})},H=["form","name","label","disabled"],X=function(e){var o=e.form,a=e.name,i=e.label,l=e.disabled,u=void 0!==l&&l,d=I(e,H),c=o.control;return g.createElement(b,{name:a,control:c,rules:{disabled:u},render:function(e){var l=e.field;l.onChange,l.onBlur;var u=l.value;return g.createElement(r,d,g.createElement(t,{control:g.createElement(n,{checked:Boolean(u),onChange:function(e){return o.setValue(a,e.target.checked)},inputProps:{"aria-label":i}}),label:i}))}})},U=function(e){var r=e.label,t=void 0===r?"":r,n=e.color,a=void 0===n?"white":n,i=e.backgroundColor,l=void 0===i?"#888888":i,u=e.paddingX,d=void 0===u?"10px":u,c=e.paddingY,s=void 0===c?"5px":c,f=e.borderRadius,v=void 0===f?"10px":f,m=e.fontSize,h=void 0===m?"14px":m,p=e.width,b={text:{display:"inline-block",textAlign:"center",backgroundColor:l,paddingX:d,paddingY:s,borderRadius:v,width:void 0===p?"auto":p,color:a,fontSize:h}};return g.createElement(o,{sx:b.text},t)},$=["form","name","label","selectionWidth","pickerWidth","selectionTextColor","paddingY","paddingX","required","disabled"],J=function(e){var r=e.form,t=e.name,n=void 0===t?"color":t,u=e.label,d=void 0===u?"Επιλογή Χρώματος":u,c=e.selectionWidth,s=void 0===c?70:c,f=e.pickerWidth,v=void 0===f?350:f,m=e.selectionTextColor,h=void 0===m?"white":m,p=e.paddingY,E=void 0===p?"10px":p,w=e.paddingX,x=void 0===w?"10px":w,O=e.required,C=void 0!==O&&O,q=e.disabled,S=void 0!==q&&q,T=I(e,$),L=N(g.useState(null),2),P=L[0],k=L[1],B=Boolean(P),j=B?"color-picker":void 0,V=r.control;return g.createElement(b,{name:n,control:V,rules:{disabled:S},render:function(e){var r=e.field,t=r.onChange;r.onBlur;var n=r.value;return g.createElement(a,F({gap:1},T),g.createElement(o,null,"".concat(d," ").concat(C?"*":"")),g.createElement(i,{sx:{display:"flex"}},g.createElement(i,{"aria-describedby":j,sx:{cursor:"pointer"},onClick:function(e){return k(e.currentTarget)}},g.createElement(U,{color:h,backgroundColor:n,paddingY:E,paddingX:x,width:s,label:n}))),g.createElement(l,{sx:{marginTop:"10px"},id:j,open:B,anchorEl:P,onClose:function(){return k(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"}},g.createElement(i,null,g.createElement(y,{width:v,color:n,onChange:function(e){return t(e.hex)}}))))}})},Q=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors","size","readonly","readonlyBackgroundColor","bold"],Z=function(r){var t=r.form,n=r.name,o=r.label,a=r.required,i=void 0!==a&&a,l=r.disabled,d=void 0!==l&&l,c=r.options,s=void 0===c?[]:c,f=r.valueKey,v=void 0===f?"id":f,m=r.labelKey,h=void 0===m?"label":m,p=r.maxLength,y=void 0===p?255:p,E=r.autofocus,w=void 0!==E&&E,x=r.noOptionsText,O=void 0===x?"Δεν υπάρχουν επιλογές":x,C=r.showErrors,q=void 0===C||C,S=r.size,T=void 0===S?"medium":S,L=r.readonly,P=void 0!==L&&L,k=r.readonlyBackgroundColor,B=void 0===k?"#dddddd":k,j=r.bold,V=void 0!==j&&j,W=I(r,Q),z=N(g.useState(null),2),A=z[0],_=z[1],K=t.watch(n);g.useEffect((function(){_(s.find((function(e){return e[v]===K}))||null)}),[K]);var D=t.control,M=t.formState.errors;return g.createElement(b,{name:n,control:D,rules:{required:i,disabled:d},render:function(r){var t=r.field,a=t.onChange,l=t.onBlur;return t.value,P?g.createElement(e,{size:T,label:o,fullWidth:!0,required:i,slotProps:{input:{maxLength:y,readOnly:P,sx:{fontWeight:V?"bold":"",backgroundColor:P?B:""}}},value:A?A.label:""}):g.createElement(u,{value:A,required:i,onChange:function(e,r){return a(r?r[v]:null)},options:s,isOptionEqualToValue:function(e,r){return e[v]===r[v]},noOptionsText:O,getOptionLabel:function(e){return e[h]},size:T,slotProps:{input:{maxLength:y,sx:{fontWeight:V?"bold":"",color:"red"}}},renderInput:function(r){var t,a;return g.createElement(e,F({label:o,required:i,disabled:d,autoFocus:w,size:T,error:q&&Boolean(null===(t=M[n])||void 0===t?void 0:t.message),onBlur:l,variant:"outlined",fullWidth:!0,helperText:q&&(null===(a=M[n])||void 0===a?void 0:a.message)},r,W))}})}})},ee=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors"],re=function(r){var t=r.form,n=r.name,o=r.label,a=r.required,i=void 0!==a&&a,l=r.disabled,c=void 0!==l&&l,s=r.options,f=void 0===s?[]:s,v=r.valueKey,m=void 0===v?"id":v,h=r.labelKey,p=void 0===h?"label":h,y=r.maxLength,E=void 0===y?255:y,w=r.autofocus,x=void 0!==w&&w,O=r.noOptionsText,C=void 0===O?"Δεν υπάρχουν επιλογές":O,q=r.showErrors,S=void 0===q||q,T=I(r,ee),L=N(g.useState([]),2),P=L[0],k=L[1],B=t.watch(n);g.useEffect((function(){k(f.filter((function(e){return function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";return Boolean(r.find((function(r){return r[t]===e[t]})))}(e,B)})))}),[B]);var j=t.control,V=t.formState.errors;return g.createElement(b,{name:n,control:j,rules:{required:i,disabled:c},render:function(r){var t=r.field,a=t.onChange,l=t.onBlur;return t.value,g.createElement(u,{multiple:!0,value:P,required:i,onChange:function(e,r){return a(r)},options:f,isOptionEqualToValue:function(e,r){return e[m]===r[m]},noOptionsText:C,renderTags:function(e,r){return e.map((function(e,t){return g.createElement(d,F({variant:"outlined",label:e[p],size:"small"},r({index:t})))}))},renderInput:function(r){var t,a;return g.createElement(e,F({label:o,required:i,disabled:c,autoFocus:x,inputProps:{maxLength:E},error:S&&Boolean(null===(t=V[n])||void 0===t?void 0:t.message),onBlur:l,variant:"outlined",fullWidth:!0,helperText:S&&(null===(a=V[n])||void 0===a?void 0:a.message)},r,T))}})}})},te=["form","name","label","optionsUrl","renderOption","valueKey","labelKey","minChars","required","disabled","maxLength","autofocus","loadingText","noOptionsText","placeholder","size","onChange","showErrors","readonly","readonlyBackgroundColor","bold"],ne=g.forwardRef((function(r,t){var n=r.form,o=r.name,a=r.label,i=r.optionsUrl,l=r.renderOption,d=void 0===l?null:l,c=r.valueKey,s=void 0===c?"id":c,f=r.labelKey,v=void 0===f?"label":f,m=r.minChars,h=void 0===m?2:m,p=r.required,y=void 0!==p&&p,E=r.disabled,x=void 0!==E&&E,O=r.maxLength,C=void 0===O?255:O,q=r.autofocus,S=void 0!==q&&q,T=r.loadingText,L=void 0===T?"Ανάκτηση...":T,P=r.noOptionsText,k=void 0===P?"Δεν υπάρχουν επιλογές":P,B=r.placeholder,j=void 0===B?"":B,W=r.size,z=void 0===W?"medium":W,A=r.onChange,K=void 0===A?null:A,D=r.showErrors,M=void 0===D||D,Y=r.readonly,G=void 0!==Y&&Y,R=r.readonlyBackgroundColor,H=void 0===R?"#dddddd":R,X=r.bold,U=void 0!==X&&X,$=I(r,te),J=N(g.useState(null),2),Q=J[0],Z=J[1],ee=N(g.useState([]),2),re=ee[0],ne=ee[1],oe=N(g.useState(!1),2),ae=oe[0],ie=oe[1];g.useImperativeHandle(t,(function(){return{setValue:function(e){function r(){return(r=V(_().mark((function r(){var t;return _().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return ie(!0),r.next=3,w.get("".concat(i,"?id=").concat(e));case 3:t=r.sent,ne(t.data),Z(t.data.find((function(e){return e[s]===n.getValues(o)}))||null),ie(!1);case 7:case"end":return r.stop()}}),r)})))).apply(this,arguments)}n.setValue(o,e),function(){r.apply(this,arguments)}()}}}));var le=n.control,ue=n.formState.errors;g.useEffect((function(){if(n.getValues(o)){var e=function(){var e=V(_().mark((function e(){var r;return _().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ie(!0),e.next=3,w.get("".concat(i,"?id=").concat(n.getValues(o)));case 3:r=e.sent,ne(r.data),Z(r.data.find((function(e){return e[s]===n.getValues(o)}))||null),ie(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}}),[]);var de=function(){var e=V(_().mark((function e(r,t){var n;return _().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t||ne([]),!(t.length<h)){e.next=3;break}return e.abrupt("return");case 3:return ie(!0),e.next=6,w.get("".concat(i,"?id=").concat(r||"","&token=").concat(t||""));case 6:n=e.sent,ne(n.data),ie(!1);case 9:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}(),ce=function(e,r){de(n.getValues(o),r)};return g.createElement(b,{name:o,control:le,rules:{required:y,disabled:x},render:function(r){var t,n,i,l=r.field,c=l.onChange,f=l.onBlur;return l.value,G?g.createElement(e,{size:z,label:a,fullWidth:!0,required:y,slotProps:{input:{maxLength:C,readOnly:G,sx:{fontWeight:U?"bold":"",backgroundColor:G?H:""}}},value:Q?Q.label:""}):g.createElement(u,{value:Q,options:re,onInputChange:(t=ce,n=300,function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];i&&clearTimeout(i),i=setTimeout((function(){t.apply(void 0,r)}),n)}),onChange:function(e,r){Z(r),c(r?r[s]:null),K&&K(r?r[s]:null)},isOptionEqualToValue:function(e,r){return e[s]===r[s]},getOptionLabel:function(e){return e[v]},filterOptions:function(e){return e},noOptionsText:k,loadingText:L,loading:ae,required:y,size:z,renderInput:function(r){var t,n;return g.createElement(e,F({label:a,required:y,disabled:x,autoFocus:S,placeholder:j,error:M&&Boolean(null===(t=ue[o])||void 0===t?void 0:t.message),onBlur:f,variant:"outlined",fullWidth:!0,helperText:M&&(null===(n=ue[o])||void 0===n?void 0:n.message),size:z,maxLength:C},r,$))},renderOption:function(e,r,t){return d?d(e,r,t):g.createElement("li",F({},e,{key:r[s]}),r[v])}})}})})),oe=["form","name","label","rows","required","disabled","autofocus","showErrors"],ae=function(r){var t=r.form,n=r.name,o=r.label,a=r.rows,i=void 0===a?5:a,l=r.required,u=void 0!==l&&l,d=r.disabled,c=void 0!==d&&d,s=r.autofocus,f=void 0!==s&&s,v=r.showErrors,m=void 0===v||v,h=I(r,oe),p=t.control,y=t.formState.errors;return g.createElement(b,{name:n,control:p,rules:{required:u,disabled:c},render:function(r){var t,a,l=r.field,d=l.onChange,s=l.onBlur,v=l.value;return g.createElement(e,F({required:u,label:o,value:v,multiline:!0,minRows:i,maxRows:i,onChange:d,onBlur:s,error:m&&Boolean(null===(t=y[n])||void 0===t?void 0:t.message),fullWidth:!0,helperText:m&&(null===(a=y[n])||void 0===a?void 0:a.message),variant:"outlined",disabled:c,autoFocus:f},h))}})},ie=["form","name","label","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],le=function(r){var t=r.form,n=r.name,o=r.label,a=r.required,i=void 0!==a&&a,l=r.disabled,u=void 0!==l&&l;r.autofocus;var d=r.showErrors,c=void 0===d||d,s=r.readonly,f=void 0!==s&&s,v=r.readonlyBackgroundColor,m=void 0===v?"#dddddd":v,h=r.bold,p=void 0!==h&&h,y=I(r,ie),E=t.control,w=t.formState.errors,O=function(e,r){""===e.value?t.setValue(n,null):t.setValue(n,e.floatValue)};return g.createElement(b,{name:n,control:E,rules:{required:i,disabled:u},render:function(r){var t,a,l=r.field;l.onChange,l.onBlur;var d=l.value;return g.createElement(x,F({customInput:e,variant:"outlined",label:o,required:i,disabled:u,value:d,thousandSeparator:".",decimalSeparator:",",decimalScale:2,fixedDecimalScale:!0,allowNegative:!1,onValueChange:O,error:c&&Boolean(null===(t=w[n])||void 0===t?void 0:t.message),helperText:c&&(null===(a=w[n])||void 0===a?void 0:a.message),fullWidth:!0,slotProps:{input:{readOnly:f,sx:{fontWeight:p?"bold":"",backgroundColor:f?m:""}}}},y))}})},ue=["form","name","label","required","disabled","autofocus","showErrors","ampm","singleTimeColumn","hoursStep","minutesStep","secondsStep"],de=function(e){var r=e.form,t=e.name,n=e.label,o=e.required,a=void 0!==o&&o,i=e.disabled,l=void 0!==i&&i;e.autofocus;var u=e.showErrors,d=void 0===u||u,c=e.ampm,s=void 0!==c&&c,f=e.singleTimeColumn,v=void 0===f||f,m=e.hoursStep,h=void 0===m?1:m,p=e.minutesStep,y=void 0===p?15:p,w=e.secondsStep,x=void 0===w?30:w,T=I(e,ue),L=r.control,k=r.formState.errors;return g.createElement(C,{dateAdapter:O,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"}}},g.createElement(b,{name:t,control:L,rules:{required:a,disabled:l},render:function(e){var r,o,i=e.field;return g.createElement(q,{label:n,value:i.value?E(i.value):null,format:"dd/MM/yyyy HH:mm",inputFormat:!0,views:v?["year","month","day","hours"]:["year","month","day","hours","minutes"],ampm:s,onChange:function(e){return i.onChange(e)},viewRenderers:v?{hours:S}:null,timeSteps:{hours:h,minutes:y,seconds:x},slotProps:{textField:A(A({},T),{},{required:a,error:d&&Boolean(null===(r=k[t])||void 0===r?void 0:r.message),helperText:d&&(null===(o=k[t])||void 0===o?void 0:o.message),variant:"outlined",fullWidth:!0})}})}}))},ce=["form","name","label","required","disabled","autofocus","showErrors"],se=function(e){var r=e.form,t=e.name,n=e.label,o=e.required,a=void 0!==o&&o,i=e.disabled,l=void 0!==i&&i;e.autofocus;var u=e.showErrors,d=void 0===u||u,c=I(e,ce),s=r.control,f=r.formState.errors;return g.createElement(C,{dateAdapter:O,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"}}},g.createElement(b,{name:t,control:s,rules:{required:a,disabled:l},render:function(e){var r,o,i=e.field;return g.createElement(T,{label:n,value:i.value?E(i.value):null,format:"dd/MM/yyyy",inputFormat:!0,onChange:function(e){return i.onChange(e)},slotProps:{textField:A(A({},c),{},{required:a,error:d&&Boolean(null===(r=f[t])||void 0===r?void 0:r.message),helperText:d&&(null===(o=f[t])||void 0===o?void 0:o.message),variant:"outlined",fullWidth:!0})}})}}))},fe=["form","name","label","allowNegative","required","disabled","autofocus","showErrors"],ve=function(r){var t=r.form,n=r.name,o=r.label,a=r.allowNegative,i=void 0!==a&&a,l=r.required,u=void 0!==l&&l,d=r.disabled,c=void 0!==d&&d,s=r.autofocus,f=void 0!==s&&s,v=r.showErrors,m=void 0===v||v,h=I(r,fe),p=t.control,y=t.formState.errors,E=function(e,r){""===e.value?t.setValue(n,null):t.setValue(n,e.floatValue)};return g.createElement(b,{name:n,control:p,rules:{required:u,disabled:c},render:function(r){var t,a,l=r.field;l.onChange,l.onBlur;var d=l.value;return g.createElement(x,F({customInput:e,variant:"outlined",label:o,required:u,disabled:c,value:d,thousandSeparator:!1,decimalSeparator:",",decimalScale:0,fixedDecimalScale:!0,allowNegative:i,onValueChange:E,error:m&&Boolean(null===(t=y[n])||void 0===t?void 0:t.message),helperText:m&&(null===(a=y[n])||void 0===a?void 0:a.message),fullWidth:!0,autoFocus:f},h))}})},me=["form","name","label","required","disabled","showErrors"],he=function(r){var t=r.form,n=r.name,o=r.label,a=r.required,i=void 0!==a&&a,l=r.disabled,u=void 0!==l&&l,d=r.showErrors,f=void 0===d||d,v=I(r,me),m=N(g.useState(),2),h=m[0],p=m[1],y=g.useRef(null),E=t.control,w=t.formState.errors,x=function(){y.current.value=null,y.current.click()};return g.createElement(g.Fragment,null,g.createElement(b,{name:n,control:E,rules:{required:i,disabled:u},render:function(r){var a,l,d=r.field;return d.onChange,d.onBlur,d.value,g.createElement(e,F({sx:{input:{cursor:"pointer"}},onClick:x,required:i,label:o,value:h?h.name:"",error:f&&Boolean(null===(a=w[n])||void 0===a?void 0:a.message),fullWidth:!0,helperText:f&&(null===(l=w[n])||void 0===l?void 0:l.message),variant:"outlined",disabled:u,InputProps:{endAdornment:h&&g.createElement(c,{position:"end"},g.createElement(s,{onClick:function(e){return function(e){e.stopPropagation(),p(null),t.setValue(n,null)}(e)}},g.createElement(k,null))),readOnly:!0}},v))}}),g.createElement("input",{type:"file",ref:y,style:{display:"none"},onChange:function(e){return function(e){p(e),t.setValue(n,e,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})}(e.currentTarget.files[0])}}))},pe=["form","name","label","ampm","hoursStep","minutesStep","secondsStep","singleTimeColumn","required","disabled","autofocus","showErrors"],ge=function(e){var r=e.form,t=e.name,n=e.label,o=e.ampm,a=void 0!==o&&o,i=e.hoursStep,l=void 0===i?1:i,u=e.minutesStep,d=void 0===u?15:u,c=e.secondsStep,s=void 0===c?30:c,f=e.singleTimeColumn,v=void 0===f||f,m=e.required,h=void 0!==m&&m,p=e.disabled,y=void 0!==p&&p;e.autofocus;var w=e.showErrors,x=void 0===w||w,q=I(e,pe),T=r.control,k=r.formState.errors;return g.createElement(C,{dateAdapter:O,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"}}},g.createElement(b,{name:t,control:T,rules:{required:h,disabled:y},render:function(e){var r,o,i=e.field;return g.createElement(L,{label:n,value:i.value?E(i.value):null,format:"HH:mm",inputFormat:!0,views:v?["hours"]:["hours","minutes"],ampm:a,onChange:function(e){return i.onChange(e)},viewRenderers:v?{hours:S}:null,timeSteps:{hours:l,minutes:d,seconds:s},slotProps:{textField:A(A({},q),{},{required:h,error:x&&Boolean(null===(r=k[t])||void 0===r?void 0:r.message),helperText:x&&(null===(o=k[t])||void 0===o?void 0:o.message),variant:"outlined",fullWidth:!0})}})}}))},be=["form","name","label","options","disabled","direction"],ye=function(e){var r=e.form,n=e.name,o=e.label,a=e.options,i=e.disabled,l=void 0!==i&&i,u=e.direction,d=void 0===u?"vertical":u,c=I(e,be),s=r.control;return g.createElement(b,{name:n,control:s,rules:{disabled:l},render:function(e){var i=e.field;i.onChange,i.onBlur;var l=i.value;return g.createElement(f,c,g.createElement(v,null,o),g.createElement(m,{row:"horizontal"===d,value:l,onChange:function(e){return r.setValue(n,e.target.value)}},a.map((function(e){return g.createElement(t,{key:e.id,value:e.id,control:g.createElement(h,null),label:e.label})}))))}})},Ee=["form","name","label","disabled"],we=function(e){var r=e.form,n=e.name,o=e.label,a=e.disabled,i=void 0!==a&&a,l=I(e,Ee),u=r.control;return g.createElement(b,{name:n,control:u,rules:{disabled:i},render:function(e){var a=e.field;a.onChange,a.onBlur;var u=a.value;return g.createElement(t,F({control:g.createElement(p,{checked:u,onChange:function(e){return r.setValue(n,e.target.checked)},disabled:i}),label:o},l))}})};export{ne as MyAutocompleteApiField,Z as MyAutocompleteField,re as MyAutocompleteMultiField,we as MyCheckboxField,J as MyColorPickerField,le as MyCurrencyField,se as MyDateField,de as MyDatetimeField,R as MyEmailField,ve as MyIntegerField,ae as MyNotesField,Y as MyPasswordField,ye as MyRadioField,X as MySwitchField,D as MyTextField,ge as MyTimeField,he as MyUploadField};
1
+ import{TextField as e,FormGroup as r,FormControlLabel as t,Switch as n,Typography as o,Stack as a,Box as l,Popover as i,Autocomplete as u,Chip as d,InputAdornment as c,IconButton as s,FormControl as f,FormLabel as v,RadioGroup as m,Radio as h,Checkbox as p}from"@mui/material";import g from"react";import{Controller as b}from"react-hook-form";import{ChromePicker as y}from"react-color";import{toDate as E}from"date-fns";import"date-fns/locale";import w from"axios";import{NumericFormat as x}from"react-number-format";import{AdapterDateFns as C}from"@mui/x-date-pickers/AdapterDateFnsV3";import{LocalizationProvider as O}from"@mui/x-date-pickers/LocalizationProvider";import{DateTimePicker as q,renderDigitalClockTimeView as S,DatePicker as L,TimePicker as T}from"@mui/x-date-pickers";import P from"date-fns/locale/el";import{Clear as k}from"@mui/icons-material";function B(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function j(e,r,t,n,o,a,l){try{var i=e[a](l),u=i.value}catch(e){return void t(e)}i.done?r(u):Promise.resolve(u).then(n,o)}function V(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var a=e.apply(r,t);function l(e){j(a,n,o,l,i,"next",e)}function i(e){j(a,n,o,l,i,"throw",e)}l(void 0)}))}}function W(e,r,t){return(r=function(e){var r=function(e,r){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,r);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function F(){return F=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)({}).hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},F.apply(null,arguments)}function z(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function A(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?z(Object(t),!0).forEach((function(r){W(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):z(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function I(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==r.indexOf(n))continue;t[n]=e[n]}return t}(e,r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)t=a[n],-1===r.indexOf(t)&&{}.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function _(){_=function(){return r};var e,r={},t=Object.prototype,n=t.hasOwnProperty,o=Object.defineProperty||function(e,r,t){e[r]=t.value},a="function"==typeof Symbol?Symbol:{},l=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function d(e,r,t){return Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}),e[r]}try{d({},"")}catch(e){d=function(e,r,t){return e[r]=t}}function c(e,r,t,n){var a=r&&r.prototype instanceof g?r:g,l=Object.create(a.prototype),i=new k(n||[]);return o(l,"_invoke",{value:S(e,t,i)}),l}function s(e,r,t){try{return{type:"normal",arg:e.call(r,t)}}catch(e){return{type:"throw",arg:e}}}r.wrap=c;var f="suspendedStart",v="suspendedYield",m="executing",h="completed",p={};function g(){}function b(){}function y(){}var E={};d(E,l,(function(){return this}));var w=Object.getPrototypeOf,x=w&&w(w(B([])));x&&x!==t&&n.call(x,l)&&(E=x);var C=y.prototype=g.prototype=Object.create(E);function O(e){["next","throw","return"].forEach((function(r){d(e,r,(function(e){return this._invoke(r,e)}))}))}function q(e,r){function t(o,a,l,i){var u=s(e[o],e,a);if("throw"!==u.type){var d=u.arg,c=d.value;return c&&"object"==typeof c&&n.call(c,"__await")?r.resolve(c.__await).then((function(e){t("next",e,l,i)}),(function(e){t("throw",e,l,i)})):r.resolve(c).then((function(e){d.value=e,l(d)}),(function(e){return t("throw",e,l,i)}))}i(u.arg)}var a;o(this,"_invoke",{value:function(e,n){function o(){return new r((function(r,o){t(e,n,r,o)}))}return a=a?a.then(o,o):o()}})}function S(r,t,n){var o=f;return function(a,l){if(o===m)throw Error("Generator is already running");if(o===h){if("throw"===a)throw l;return{value:e,done:!0}}for(n.method=a,n.arg=l;;){var i=n.delegate;if(i){var u=L(i,n);if(u){if(u===p)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===f)throw o=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var d=s(r,t,n);if("normal"===d.type){if(o=n.done?h:v,d.arg===p)continue;return{value:d.arg,done:n.done}}"throw"===d.type&&(o=h,n.method="throw",n.arg=d.arg)}}}function L(r,t){var n=t.method,o=r.iterator[n];if(o===e)return t.delegate=null,"throw"===n&&r.iterator.return&&(t.method="return",t.arg=e,L(r,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var a=s(o,r.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,p;var l=a.arg;return l?l.done?(t[r.resultName]=l.value,t.next=r.nextLoc,"return"!==t.method&&(t.method="next",t.arg=e),t.delegate=null,p):l:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function T(e){var r={tryLoc:e[0]};1 in e&&(r.catchLoc=e[1]),2 in e&&(r.finallyLoc=e[2],r.afterLoc=e[3]),this.tryEntries.push(r)}function P(e){var r=e.completion||{};r.type="normal",delete r.arg,e.completion=r}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function B(r){if(r||""===r){var t=r[l];if(t)return t.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,a=function t(){for(;++o<r.length;)if(n.call(r,o))return t.value=r[o],t.done=!1,t;return t.value=e,t.done=!0,t};return a.next=a}}throw new TypeError(typeof r+" is not iterable")}return b.prototype=y,o(C,"constructor",{value:y,configurable:!0}),o(y,"constructor",{value:b,configurable:!0}),b.displayName=d(y,u,"GeneratorFunction"),r.isGeneratorFunction=function(e){var r="function"==typeof e&&e.constructor;return!!r&&(r===b||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,d(e,u,"GeneratorFunction")),e.prototype=Object.create(C),e},r.awrap=function(e){return{__await:e}},O(q.prototype),d(q.prototype,i,(function(){return this})),r.AsyncIterator=q,r.async=function(e,t,n,o,a){void 0===a&&(a=Promise);var l=new q(c(e,t,n,o),a);return r.isGeneratorFunction(t)?l:l.next().then((function(e){return e.done?e.value:l.next()}))},O(C),d(C,u,"Generator"),d(C,l,(function(){return this})),d(C,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var r=Object(e),t=[];for(var n in r)t.push(n);return t.reverse(),function e(){for(;t.length;){var n=t.pop();if(n in r)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=B,k.prototype={constructor:k,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!r)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var t=this;function o(n,o){return i.type="throw",i.arg=r,t.next=n,o&&(t.method="next",t.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var l=this.tryEntries[a],i=l.completion;if("root"===l.tryLoc)return o("end");if(l.tryLoc<=this.prev){var u=n.call(l,"catchLoc"),d=n.call(l,"finallyLoc");if(u&&d){if(this.prev<l.catchLoc)return o(l.catchLoc,!0);if(this.prev<l.finallyLoc)return o(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return o(l.catchLoc,!0)}else{if(!d)throw Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return o(l.finallyLoc)}}}},abrupt:function(e,r){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=r&&r<=a.finallyLoc&&(a=null);var l=a?a.completion:{};return l.type=e,l.arg=r,a?(this.method="next",this.next=a.finallyLoc,p):this.complete(l)},complete:function(e,r){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&r&&(this.next=r),p},finish:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),P(t),p}},catch:function(e){for(var r=this.tryEntries.length-1;r>=0;--r){var t=this.tryEntries[r];if(t.tryLoc===e){var n=t.completion;if("throw"===n.type){var o=n.arg;P(t)}return o}}throw Error("illegal catch attempt")},delegateYield:function(r,t,n){return this.delegate={iterator:B(r),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=e),p}},r}function N(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,a,l,i=[],u=!0,d=!1;try{if(a=(t=t.call(e)).next,0===r);else for(;!(u=(n=a.call(t)).done)&&(i.push(n.value),i.length!==r);u=!0);}catch(e){d=!0,o=e}finally{try{if(!u&&null!=t.return&&(l=t.return(),Object(l)!==l))return}finally{if(d)throw o}}return i}}(e,r)||function(e,r){if(e){if("string"==typeof e)return B(e,r);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?B(e,r):void 0}}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var K=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],D=function(r){var t=r.form,n=r.name,o=r.label,a=r.maxLength,l=void 0===a?255:a,i=r.required,u=void 0!==i&&i,d=r.disabled,c=void 0!==d&&d,s=r.autofocus,f=void 0!==s&&s,v=r.showErrors,m=void 0===v||v,h=r.readonly,p=void 0!==h&&h,y=r.readonlyBackgroundColor,E=void 0===y?"#dddddd":y,w=r.bold,x=void 0!==w&&w,C=I(r,K),O=t.control,q=t.formState.errors;return g.createElement(b,{name:n,control:O,rules:{required:u,disabled:c},render:function(r){var t,a,i=r.field,d=i.onChange,s=i.onBlur,v=i.value;return g.createElement(e,F({required:u,label:o,value:v,onChange:d,onBlur:s,error:m&&Boolean(null===(t=q[n])||void 0===t?void 0:t.message),fullWidth:!0,helperText:m&&(null===(a=q[n])||void 0===a?void 0:a.message),variant:"outlined",disabled:c,autoFocus:f,slotProps:{input:{maxLength:l,readOnly:p,sx:{fontWeight:x?"bold":"",backgroundColor:p?E:""}}}},C))}})},M=["form","name","label","required","disabled","autofocus","showErrors"],Y=function(r){var t=r.form,n=r.name,o=void 0===n?"password":n,a=r.label,l=void 0===a?"Κωδικός Πρόσβασης":a,i=r.required,u=void 0===i||i,d=r.disabled,c=void 0!==d&&d,s=r.autofocus,f=void 0!==s&&s,v=r.showErrors,m=void 0===v||v,h=I(r,M),p=t.control,y=t.formState.errors;return g.createElement(b,{name:o,control:p,rules:{required:u,disabled:c},render:function(r){var t,n,a=r.field,i=a.onChange,d=a.onBlur,s=a.value;return g.createElement(e,F({required:u,label:l,value:s,onChange:i,onBlur:d,error:m&&Boolean(null===(t=y[o])||void 0===t?void 0:t.message),fullWidth:!0,helperText:m&&(null===(n=y[o])||void 0===n?void 0:n.message),variant:"outlined",disabled:c,autoFocus:f,type:"password"},h))}})},G=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],R=function(r){var t=r.form,n=r.name,o=void 0===n?"email":n,a=r.label,l=void 0===a?"E-mail":a,i=r.maxLength,u=void 0===i?255:i,d=r.required,c=void 0===d||d,s=r.disabled,f=void 0!==s&&s,v=r.autofocus,m=void 0!==v&&v,h=r.showErrors,p=void 0===h||h,y=r.readonly,E=void 0!==y&&y,w=r.readonlyBackgroundColor,x=void 0===w?"#dddddd":w,C=r.bold,O=void 0!==C&&C,q=I(r,G),S=t.control,L=t.formState.errors;return g.createElement(b,{name:o,control:S,rules:{required:c,disabled:f},render:function(r){var t,n,a=r.field,i=a.onChange,d=a.onBlur,s=a.value;return g.createElement(e,F({required:c,label:l,value:s,onChange:i,onBlur:d,error:p&&Boolean(null===(t=L[o])||void 0===t?void 0:t.message),fullWidth:!0,helperText:p&&(null===(n=L[o])||void 0===n?void 0:n.message),variant:"outlined",disabled:f,autoFocus:m,slotProps:{input:{maxLength:u,readOnly:E,sx:{fontWeight:O?"bold":"",backgroundColor:E?x:""}}}},q))}})},H=["form","name","label","disabled"],X=function(e){var o=e.form,a=e.name,l=e.label,i=e.disabled,u=void 0!==i&&i,d=I(e,H),c=o.control;return g.createElement(b,{name:a,control:c,rules:{disabled:u},render:function(e){var i=e.field;i.onChange,i.onBlur;var u=i.value;return g.createElement(r,d,g.createElement(t,{control:g.createElement(n,{checked:Boolean(u),onChange:function(e){return o.setValue(a,e.target.checked)},inputProps:{"aria-label":l}}),label:l}))}})},U=function(e){var r=e.label,t=void 0===r?"":r,n=e.color,a=void 0===n?"white":n,l=e.backgroundColor,i=void 0===l?"#888888":l,u=e.paddingX,d=void 0===u?"10px":u,c=e.paddingY,s=void 0===c?"5px":c,f=e.borderRadius,v=void 0===f?"10px":f,m=e.fontSize,h=void 0===m?"14px":m,p=e.width,b={text:{display:"inline-block",textAlign:"center",backgroundColor:i,paddingX:d,paddingY:s,borderRadius:v,width:void 0===p?"auto":p,color:a,fontSize:h}};return g.createElement(o,{sx:b.text},t)},$=["form","name","label","selectionWidth","pickerWidth","selectionTextColor","paddingY","paddingX","required","disabled"],J=function(e){var r=e.form,t=e.name,n=void 0===t?"color":t,u=e.label,d=void 0===u?"Επιλογή Χρώματος":u,c=e.selectionWidth,s=void 0===c?70:c,f=e.pickerWidth,v=void 0===f?350:f,m=e.selectionTextColor,h=void 0===m?"white":m,p=e.paddingY,E=void 0===p?"10px":p,w=e.paddingX,x=void 0===w?"10px":w,C=e.required,O=void 0!==C&&C,q=e.disabled,S=void 0!==q&&q,L=I(e,$),T=N(g.useState(null),2),P=T[0],k=T[1],B=Boolean(P),j=B?"color-picker":void 0,V=r.control;return g.createElement(b,{name:n,control:V,rules:{disabled:S},render:function(e){var r=e.field,t=r.onChange;r.onBlur;var n=r.value;return g.createElement(a,F({gap:1},L),g.createElement(o,null,"".concat(d," ").concat(O?"*":"")),g.createElement(l,{sx:{display:"flex"}},g.createElement(l,{"aria-describedby":j,sx:{cursor:"pointer"},onClick:function(e){return k(e.currentTarget)}},g.createElement(U,{color:h,backgroundColor:n,paddingY:E,paddingX:x,width:s,label:n}))),g.createElement(i,{sx:{marginTop:"10px"},id:j,open:B,anchorEl:P,onClose:function(){return k(null)},anchorOrigin:{vertical:"bottom",horizontal:"left"}},g.createElement(l,null,g.createElement(y,{width:v,color:n,onChange:function(e){return t(e.hex)}}))))}})},Q=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors","size","readonly","readonlyBackgroundColor","bold"],Z=function(r){var t=r.form,n=r.name,o=r.label,a=r.required,l=void 0!==a&&a,i=r.disabled,d=void 0!==i&&i,c=r.options,s=void 0===c?[]:c,f=r.valueKey,v=void 0===f?"id":f,m=r.labelKey,h=void 0===m?"label":m,p=r.maxLength,y=void 0===p?255:p,E=r.autofocus,w=void 0!==E&&E,x=r.noOptionsText,C=void 0===x?"Δεν υπάρχουν επιλογές":x,O=r.showErrors,q=void 0===O||O,S=r.size,L=void 0===S?"medium":S,T=r.readonly,P=void 0!==T&&T,k=r.readonlyBackgroundColor,B=void 0===k?"#dddddd":k,j=r.bold,V=void 0!==j&&j,W=I(r,Q),z=N(g.useState(null),2),A=z[0],_=z[1],K=t.watch(n);g.useEffect((function(){_(s.find((function(e){return e[v]===K}))||null)}),[K]);var D=t.control,M=t.formState.errors;return g.createElement(b,{name:n,control:D,rules:{required:l,disabled:d},render:function(r){var t=r.field,a=t.onChange,i=t.onBlur;return t.value,P?g.createElement(e,{size:L,label:o,fullWidth:!0,required:l,slotProps:{input:{maxLength:y,readOnly:P,sx:{fontWeight:V?"bold":"",backgroundColor:P?B:""}}},value:A?A.label:""}):g.createElement(u,{value:A,required:l,onChange:function(e,r){return a(r?r[v]:null)},options:s,isOptionEqualToValue:function(e,r){return e[v]===r[v]},noOptionsText:C,getOptionLabel:function(e){return e[h]},size:L,slotProps:{input:{maxLength:y,sx:{fontWeight:V?"bold":"",color:"red"}}},renderInput:function(r){var t,a;return g.createElement(e,F({label:o,required:l,disabled:d,autoFocus:w,size:L,error:q&&Boolean(null===(t=M[n])||void 0===t?void 0:t.message),onBlur:i,variant:"outlined",fullWidth:!0,helperText:q&&(null===(a=M[n])||void 0===a?void 0:a.message)},r,W))}})}})},ee=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors"],re=function(r){var t=r.form,n=r.name,o=r.label,a=r.required,l=void 0!==a&&a,i=r.disabled,c=void 0!==i&&i,s=r.options,f=void 0===s?[]:s,v=r.valueKey,m=void 0===v?"id":v,h=r.labelKey,p=void 0===h?"label":h,y=r.maxLength,E=void 0===y?255:y,w=r.autofocus,x=void 0!==w&&w,C=r.noOptionsText,O=void 0===C?"Δεν υπάρχουν επιλογές":C,q=r.showErrors,S=void 0===q||q,L=I(r,ee),T=N(g.useState([]),2),P=T[0],k=T[1],B=t.watch(n);g.useEffect((function(){k(f.filter((function(e){return function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";return Boolean(r.find((function(r){return r[t]===e[t]})))}(e,B)})))}),[B]);var j=t.control,V=t.formState.errors;return g.createElement(b,{name:n,control:j,rules:{required:l,disabled:c},render:function(r){var t=r.field,a=t.onChange,i=t.onBlur;return t.value,g.createElement(u,{multiple:!0,value:P,required:l,onChange:function(e,r){return a(r)},options:f,isOptionEqualToValue:function(e,r){return e[m]===r[m]},noOptionsText:O,renderTags:function(e,r){return e.map((function(e,t){return g.createElement(d,F({variant:"outlined",label:e[p],size:"small"},r({index:t})))}))},renderInput:function(r){var t,a;return g.createElement(e,F({label:o,required:l,disabled:c,autoFocus:x,inputProps:{maxLength:E},error:S&&Boolean(null===(t=V[n])||void 0===t?void 0:t.message),onBlur:i,variant:"outlined",fullWidth:!0,helperText:S&&(null===(a=V[n])||void 0===a?void 0:a.message)},r,L))}})}})},te=["form","name","label","optionsUrl","renderOption","valueKey","labelKey","minChars","required","disabled","maxLength","autofocus","loadingText","noOptionsText","placeholder","size","onChange","showErrors","readonly","readonlyBackgroundColor","bold"],ne=g.forwardRef((function(r,t){var n=r.form,o=r.name,a=r.label,l=r.optionsUrl,i=r.renderOption,d=void 0===i?null:i,c=r.valueKey,s=void 0===c?"id":c,f=r.labelKey,v=void 0===f?"label":f,m=r.minChars,h=void 0===m?2:m,p=r.required,y=void 0!==p&&p,E=r.disabled,x=void 0!==E&&E,C=r.maxLength,O=void 0===C?255:C,q=r.autofocus,S=void 0!==q&&q,L=r.loadingText,T=void 0===L?"Ανάκτηση...":L,P=r.noOptionsText,k=void 0===P?"Δεν υπάρχουν επιλογές":P,B=r.placeholder,j=void 0===B?"":B,W=r.size,z=void 0===W?"medium":W,A=r.onChange,K=void 0===A?null:A,D=r.showErrors,M=void 0===D||D,Y=r.readonly,G=void 0!==Y&&Y,R=r.readonlyBackgroundColor,H=void 0===R?"#dddddd":R,X=r.bold,U=void 0!==X&&X,$=I(r,te),J=N(g.useState(null),2),Q=J[0],Z=J[1],ee=N(g.useState([]),2),re=ee[0],ne=ee[1],oe=N(g.useState(!1),2),ae=oe[0],le=oe[1];g.useImperativeHandle(t,(function(){return{setValue:function(e){function r(){return(r=V(_().mark((function r(){var t;return _().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return le(!0),r.next=3,w.get("".concat(l,"?id=").concat(e));case 3:t=r.sent,ne(t.data),Z(t.data.find((function(e){return e[s]===n.getValues(o)}))||null),le(!1);case 7:case"end":return r.stop()}}),r)})))).apply(this,arguments)}n.setValue(o,e),function(){r.apply(this,arguments)}()}}}));var ie=n.control,ue=n.formState.errors;g.useEffect((function(){if(n.getValues(o)){var e=function(){var e=V(_().mark((function e(){var r;return _().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return le(!0),e.next=3,w.get("".concat(l,"?id=").concat(n.getValues(o)));case 3:r=e.sent,ne(r.data),Z(r.data.find((function(e){return e[s]===n.getValues(o)}))||null),le(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}}),[]);var de=function(){var e=V(_().mark((function e(r,t){var n;return _().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t||ne([]),!(t.length<h)){e.next=3;break}return e.abrupt("return");case 3:return le(!0),e.next=6,w.get("".concat(l,"?id=").concat(r||"","&token=").concat(t||""));case 6:n=e.sent,ne(n.data),le(!1);case 9:case"end":return e.stop()}}),e)})));return function(r,t){return e.apply(this,arguments)}}(),ce=function(e,r){de(n.getValues(o),r)};return g.createElement(b,{name:o,control:ie,rules:{required:y,disabled:x},render:function(r){var t,n,l,i=r.field,c=i.onChange,f=i.onBlur;return i.value,G?g.createElement(e,{size:z,label:a,fullWidth:!0,required:y,slotProps:{input:{maxLength:O,readOnly:G,sx:{fontWeight:U?"bold":"",backgroundColor:G?H:""}}},value:Q?Q.label:""}):g.createElement(u,{value:Q,options:re,onInputChange:(t=ce,n=300,function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];l&&clearTimeout(l),l=setTimeout((function(){t.apply(void 0,r)}),n)}),onChange:function(e,r){Z(r),c(r?r[s]:null),K&&K(r?r[s]:null)},isOptionEqualToValue:function(e,r){return e[s]===r[s]},getOptionLabel:function(e){return e[v]},filterOptions:function(e){return e},noOptionsText:k,loadingText:T,loading:ae,required:y,size:z,renderInput:function(r){var t,n;return g.createElement(e,F({label:a,required:y,disabled:x,autoFocus:S,placeholder:j,error:M&&Boolean(null===(t=ue[o])||void 0===t?void 0:t.message),onBlur:f,variant:"outlined",fullWidth:!0,helperText:M&&(null===(n=ue[o])||void 0===n?void 0:n.message),size:z,maxLength:O},r,$))},renderOption:function(e,r,t){return d?d(e,r,t):g.createElement("li",F({},e,{key:r[s]}),r[v])}})}})})),oe=["form","name","label","rows","required","disabled","autofocus","showErrors"],ae=function(r){var t=r.form,n=r.name,o=r.label,a=r.rows,l=void 0===a?5:a,i=r.required,u=void 0!==i&&i,d=r.disabled,c=void 0!==d&&d,s=r.autofocus,f=void 0!==s&&s,v=r.showErrors,m=void 0===v||v,h=I(r,oe),p=t.control,y=t.formState.errors;return g.createElement(b,{name:n,control:p,rules:{required:u,disabled:c},render:function(r){var t,a,i=r.field,d=i.onChange,s=i.onBlur,v=i.value;return g.createElement(e,F({required:u,label:o,value:v,multiline:!0,minRows:l,maxRows:l,onChange:d,onBlur:s,error:m&&Boolean(null===(t=y[n])||void 0===t?void 0:t.message),fullWidth:!0,helperText:m&&(null===(a=y[n])||void 0===a?void 0:a.message),variant:"outlined",disabled:c,autoFocus:f},h))}})},le=["form","name","label","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],ie=function(r){var t=r.form,n=r.name,o=r.label,a=r.required,l=void 0!==a&&a,i=r.disabled,u=void 0!==i&&i;r.autofocus;var d=r.showErrors,c=void 0===d||d,s=r.readonly,f=void 0!==s&&s,v=r.readonlyBackgroundColor,m=void 0===v?"#dddddd":v,h=r.bold,p=void 0!==h&&h,y=I(r,le),E=t.control,w=t.formState.errors,C=function(e,r){""===e.value?t.setValue(n,null):t.setValue(n,e.floatValue)};return g.createElement(b,{name:n,control:E,rules:{required:l,disabled:u},render:function(r){var t,a,i=r.field;i.onChange,i.onBlur;var d=i.value;return g.createElement(x,F({customInput:e,variant:"outlined",label:o,required:l,disabled:u,value:d,thousandSeparator:".",decimalSeparator:",",decimalScale:2,fixedDecimalScale:!0,allowNegative:!1,onValueChange:C,error:c&&Boolean(null===(t=w[n])||void 0===t?void 0:t.message),helperText:c&&(null===(a=w[n])||void 0===a?void 0:a.message),fullWidth:!0,slotProps:{input:{readOnly:f,sx:{fontWeight:p?"bold":"",backgroundColor:f?m:""}}}},y))}})},ue=["form","name","label","required","disabled","autofocus","showErrors","ampm","singleTimeColumn","hoursStep","minutesStep","secondsStep"],de=function(e){var r=e.form,t=e.name,n=e.label,o=e.required,a=void 0!==o&&o,l=e.disabled,i=void 0!==l&&l;e.autofocus;var u=e.showErrors,d=void 0===u||u,c=e.ampm,s=void 0!==c&&c,f=e.singleTimeColumn,v=void 0===f||f,m=e.hoursStep,h=void 0===m?1:m,p=e.minutesStep,y=void 0===p?15:p,w=e.secondsStep,x=void 0===w?30:w,L=I(e,ue),T=r.control,k=r.formState.errors;return g.createElement(O,{dateAdapter:C,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"},fieldClearLabel:"Καθαρισμός"}},g.createElement(b,{name:t,control:T,rules:{required:a,disabled:i},render:function(e){var r,o,l=e.field;return g.createElement(q,{label:n,value:l.value?E(l.value):null,format:"dd/MM/yyyy HH:mm",inputFormat:!0,views:v?["year","month","day","hours"]:["year","month","day","hours","minutes"],ampm:s,onChange:function(e){return l.onChange(e)},viewRenderers:v?{hours:S}:null,timeSteps:{hours:h,minutes:y,seconds:x},slotProps:{field:{clearable:!0,onClear:function(){return l.onChange(null)}},textField:A(A({},L),{},{required:a,error:d&&Boolean(null===(r=k[t])||void 0===r?void 0:r.message),helperText:d&&(null===(o=k[t])||void 0===o?void 0:o.message),variant:"outlined",fullWidth:!0})}})}}))},ce=["form","name","label","required","disabled","autofocus","showErrors"],se=function(e){var r=e.form,t=e.name,n=e.label,o=e.required,a=void 0!==o&&o,l=e.disabled,i=void 0!==l&&l;e.autofocus;var u=e.showErrors,d=void 0===u||u,c=I(e,ce),s=r.control,f=r.formState.errors;return g.createElement(O,{dateAdapter:C,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldClearLabel:"Καθαρισμός"}},g.createElement(b,{name:t,control:s,rules:{required:a,disabled:i},render:function(e){var r,o,l=e.field;return g.createElement(L,{label:n,value:l.value?E(l.value):null,format:"dd/MM/yyyy",inputFormat:!0,onChange:function(e){return l.onChange(e)},slotProps:{field:{clearable:!0,onClear:function(){return l.onChange(null)}},textField:A(A({},c),{},{required:a,error:d&&Boolean(null===(r=f[t])||void 0===r?void 0:r.message),helperText:d&&(null===(o=f[t])||void 0===o?void 0:o.message),variant:"outlined",fullWidth:!0})}})}}))},fe=["form","name","label","allowNegative","required","disabled","autofocus","showErrors"],ve=function(r){var t=r.form,n=r.name,o=r.label,a=r.allowNegative,l=void 0!==a&&a,i=r.required,u=void 0!==i&&i,d=r.disabled,c=void 0!==d&&d,s=r.autofocus,f=void 0!==s&&s,v=r.showErrors,m=void 0===v||v,h=I(r,fe),p=t.control,y=t.formState.errors,E=function(e,r){""===e.value?t.setValue(n,null):t.setValue(n,e.floatValue)};return g.createElement(b,{name:n,control:p,rules:{required:u,disabled:c},render:function(r){var t,a,i=r.field;i.onChange,i.onBlur;var d=i.value;return g.createElement(x,F({customInput:e,variant:"outlined",label:o,required:u,disabled:c,value:d,thousandSeparator:!1,decimalSeparator:",",decimalScale:0,fixedDecimalScale:!0,allowNegative:l,onValueChange:E,error:m&&Boolean(null===(t=y[n])||void 0===t?void 0:t.message),helperText:m&&(null===(a=y[n])||void 0===a?void 0:a.message),fullWidth:!0,autoFocus:f},h))}})},me=["form","name","label","required","disabled","showErrors"],he=function(r){var t=r.form,n=r.name,o=r.label,a=r.required,l=void 0!==a&&a,i=r.disabled,u=void 0!==i&&i,d=r.showErrors,f=void 0===d||d,v=I(r,me),m=N(g.useState(),2),h=m[0],p=m[1],y=g.useRef(null),E=t.control,w=t.formState.errors,x=function(){y.current.value=null,y.current.click()};return g.createElement(g.Fragment,null,g.createElement(b,{name:n,control:E,rules:{required:l,disabled:u},render:function(r){var a,i,d=r.field;return d.onChange,d.onBlur,d.value,g.createElement(e,F({sx:{input:{cursor:"pointer"}},onClick:x,required:l,label:o,value:h?h.name:"",error:f&&Boolean(null===(a=w[n])||void 0===a?void 0:a.message),fullWidth:!0,helperText:f&&(null===(i=w[n])||void 0===i?void 0:i.message),variant:"outlined",disabled:u,InputProps:{endAdornment:h&&g.createElement(c,{position:"end"},g.createElement(s,{onClick:function(e){return function(e){e.stopPropagation(),p(null),t.setValue(n,null)}(e)}},g.createElement(k,null))),readOnly:!0}},v))}}),g.createElement("input",{type:"file",ref:y,style:{display:"none"},onChange:function(e){return function(e){p(e),t.setValue(n,e,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})}(e.currentTarget.files[0])}}))},pe=["form","name","label","ampm","hoursStep","minutesStep","secondsStep","singleTimeColumn","required","disabled","autofocus","showErrors"],ge=function(e){var r=e.form,t=e.name,n=e.label,o=e.ampm,a=void 0!==o&&o,l=e.hoursStep,i=void 0===l?1:l,u=e.minutesStep,d=void 0===u?15:u,c=e.secondsStep,s=void 0===c?30:c,f=e.singleTimeColumn,v=void 0===f||f,m=e.required,h=void 0!==m&&m,p=e.disabled,y=void 0!==p&&p;e.autofocus;var w=e.showErrors,x=void 0===w||w,q=I(e,pe),L=r.control,k=r.formState.errors;return g.createElement(O,{dateAdapter:C,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"}}},g.createElement(b,{name:t,control:L,rules:{required:h,disabled:y},render:function(e){var r,o,l=e.field;return g.createElement(T,{label:n,value:l.value?E(l.value):null,format:"HH:mm",inputFormat:!0,views:v?["hours"]:["hours","minutes"],ampm:a,onChange:function(e){return l.onChange(e)},viewRenderers:v?{hours:S}:null,timeSteps:{hours:i,minutes:d,seconds:s},slotProps:{textField:A(A({},q),{},{required:h,error:x&&Boolean(null===(r=k[t])||void 0===r?void 0:r.message),helperText:x&&(null===(o=k[t])||void 0===o?void 0:o.message),variant:"outlined",fullWidth:!0})}})}}))},be=["form","name","label","options","disabled","direction"],ye=function(e){var r=e.form,n=e.name,o=e.label,a=e.options,l=e.disabled,i=void 0!==l&&l,u=e.direction,d=void 0===u?"vertical":u,c=I(e,be),s=r.control;return g.createElement(b,{name:n,control:s,rules:{disabled:i},render:function(e){var l=e.field;l.onChange,l.onBlur;var i=l.value;return g.createElement(f,c,g.createElement(v,null,o),g.createElement(m,{row:"horizontal"===d,value:i,onChange:function(e){return r.setValue(n,e.target.value)}},a.map((function(e){return g.createElement(t,{key:e.id,value:e.id,control:g.createElement(h,null),label:e.label})}))))}})},Ee=["form","name","label","disabled"],we=function(e){var r=e.form,n=e.name,o=e.label,a=e.disabled,l=void 0!==a&&a,i=I(e,Ee),u=r.control;return g.createElement(b,{name:n,control:u,rules:{disabled:l},render:function(e){var a=e.field;a.onChange,a.onBlur;var u=a.value;return g.createElement(t,F({control:g.createElement(p,{checked:u,onChange:function(e){return r.setValue(n,e.target.checked)},disabled:l}),label:o},i))}})};export{ne as MyAutocompleteApiField,Z as MyAutocompleteField,re as MyAutocompleteMultiField,we as MyCheckboxField,J as MyColorPickerField,ie as MyCurrencyField,se as MyDateField,de as MyDatetimeField,R as MyEmailField,ve as MyIntegerField,ae as MyNotesField,Y as MyPasswordField,ye as MyRadioField,X as MySwitchField,D as MyTextField,ge as MyTimeField,he as MyUploadField};
package/modals/index.js CHANGED
@@ -1 +1 @@
1
- import e from"react";import{TextField as t,Typography as r,Autocomplete as n,Chip as o,InputAdornment as i,IconButton as a,Dialog as l,Zoom as u,DialogTitle as c,Stack as d,Box as s,Divider as m,DialogContent as f,DialogActions as v,Button as p,CircularProgress as h,DialogContentText as b}from"@mui/material";import{Controller as g,useForm as E}from"react-hook-form";import{yupResolver as x}from"@hookform/resolvers/yup";import*as y from"yup";import{ChromePicker as w}from"react-color";import{toDate as C}from"date-fns";import"date-fns/locale";import S from"axios";import{NumericFormat as q}from"react-number-format";import{AdapterDateFns as W}from"@mui/x-date-pickers/AdapterDateFnsV3";import{LocalizationProvider as L}from"@mui/x-date-pickers/LocalizationProvider";import{DateTimePicker as k,renderDigitalClockTimeView as T,DatePicker as O,TimePicker as P}from"@mui/x-date-pickers";import V from"date-fns/locale/el";import{Clear as R,EditNoteRounded as j}from"@mui/icons-material";import z from"@mui/icons-material/WarningAmberRounded";import B from"@mui/icons-material/ErrorOutlineRounded";import K from"@mui/icons-material/CheckCircleOutlineRounded";function F(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function D(e,t,r,n,o,i,a){try{var l=e[i](a),u=l.value}catch(e){return void r(e)}l.done?t(u):Promise.resolve(u).then(n,o)}function I(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){D(i,n,o,a,l,"next",e)}function l(e){D(i,n,o,a,l,"throw",e)}a(void 0)}))}}function M(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function N(){return N=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},N.apply(null,arguments)}function A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A(Object(r),!0).forEach((function(t){M(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function G(){G=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",l=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function d(e,t,r,n){var i=t&&t.prototype instanceof b?t:b,a=Object.create(i.prototype),l=new O(n||[]);return o(a,"_invoke",{value:W(e,r,l)}),a}function s(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var m="suspendedStart",f="suspendedYield",v="executing",p="completed",h={};function b(){}function g(){}function E(){}var x={};c(x,a,(function(){return this}));var y=Object.getPrototypeOf,w=y&&y(y(P([])));w&&w!==r&&n.call(w,a)&&(x=w);var C=E.prototype=b.prototype=Object.create(x);function S(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function q(e,t){function r(o,i,a,l){var u=s(e[o],e,i);if("throw"!==u.type){var c=u.arg,d=c.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,l)}),(function(e){r("throw",e,a,l)})):t.resolve(d).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,l)}))}l(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function W(t,r,n){var o=m;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===p){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var l=n.delegate;if(l){var u=L(l,n);if(u){if(u===h)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var c=s(t,r,n);if("normal"===c.type){if(o=n.done?p:f,c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=p,n.method="throw",n.arg=c.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=s(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,h;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,h):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function P(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(typeof t+" is not iterable")}return g.prototype=E,o(C,"constructor",{value:E,configurable:!0}),o(E,"constructor",{value:g,configurable:!0}),g.displayName=c(E,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,c(e,u,"GeneratorFunction")),e.prototype=Object.create(C),e},t.awrap=function(e){return{__await:e}},S(q.prototype),c(q.prototype,l,(function(){return this})),t.AsyncIterator=q,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new q(d(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(C),c(C,u,"Generator"),c(C,a,(function(){return this})),c(C,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=P,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return l.type="throw",l.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],l=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:P(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),h}},t}function Y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,l=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(u=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return F(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?F(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var U=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],X=function(r){var n=r.form,o=r.name,i=r.label,a=r.maxLength,l=void 0===a?255:a,u=r.required,c=void 0!==u&&u,d=r.disabled,s=void 0!==d&&d,m=r.autofocus,f=void 0!==m&&m,v=r.showErrors,p=void 0===v||v,h=r.readonly,b=void 0!==h&&h,E=r.readonlyBackgroundColor,x=void 0===E?"#dddddd":E,y=r.bold,w=void 0!==y&&y,C=_(r,U),S=n.control,q=n.formState.errors;return e.createElement(g,{name:o,control:S,rules:{required:c,disabled:s},render:function(r){var n,a,u=r.field,d=u.onChange,m=u.onBlur,v=u.value;return e.createElement(t,N({required:c,label:i,value:v,onChange:d,onBlur:m,error:p&&Boolean(null===(n=q[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:p&&(null===(a=q[o])||void 0===a?void 0:a.message),variant:"outlined",disabled:s,autoFocus:f,slotProps:{input:{maxLength:l,readOnly:b,sx:{fontWeight:w?"bold":"",backgroundColor:b?x:""}}}},C))}})},$=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],Z=function(r){var n=r.form,o=r.name,i=void 0===o?"email":o,a=r.label,l=void 0===a?"E-mail":a,u=r.maxLength,c=void 0===u?255:u,d=r.required,s=void 0===d||d,m=r.disabled,f=void 0!==m&&m,v=r.autofocus,p=void 0!==v&&v,h=r.showErrors,b=void 0===h||h,E=r.readonly,x=void 0!==E&&E,y=r.readonlyBackgroundColor,w=void 0===y?"#dddddd":y,C=r.bold,S=void 0!==C&&C,q=_(r,$),W=n.control,L=n.formState.errors;return e.createElement(g,{name:i,control:W,rules:{required:s,disabled:f},render:function(r){var n,o,a=r.field,u=a.onChange,d=a.onBlur,m=a.value;return e.createElement(t,N({required:s,label:l,value:m,onChange:u,onBlur:d,error:b&&Boolean(null===(n=L[i])||void 0===n?void 0:n.message),fullWidth:!0,helperText:b&&(null===(o=L[i])||void 0===o?void 0:o.message),variant:"outlined",disabled:f,autoFocus:p,slotProps:{input:{maxLength:c,readOnly:x,sx:{fontWeight:S?"bold":"",backgroundColor:x?w:""}}}},q))}})},J=function(t){var n=t.label,o=void 0===n?"":n,i=t.color,a=void 0===i?"white":i,l=t.backgroundColor,u=void 0===l?"#888888":l,c=t.paddingX,d=void 0===c?"10px":c,s=t.paddingY,m=void 0===s?"5px":s,f=t.borderRadius,v=void 0===f?"10px":f,p=t.fontSize,h=void 0===p?"14px":p,b=t.width,g={text:{display:"inline-block",textAlign:"center",backgroundColor:u,paddingX:d,paddingY:m,borderRadius:v,width:void 0===b?"auto":b,color:a,fontSize:h}};return e.createElement(r,{sx:g.text},o)},Q=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors","size","readonly","readonlyBackgroundColor","bold"],ee=function(r){var o=r.form,i=r.name,a=r.label,l=r.required,u=void 0!==l&&l,c=r.disabled,d=void 0!==c&&c,s=r.options,m=void 0===s?[]:s,f=r.valueKey,v=void 0===f?"id":f,p=r.labelKey,h=void 0===p?"label":p,b=r.maxLength,E=void 0===b?255:b,x=r.autofocus,y=void 0!==x&&x,w=r.noOptionsText,C=void 0===w?"Δεν υπάρχουν επιλογές":w,S=r.showErrors,q=void 0===S||S,W=r.size,L=void 0===W?"medium":W,k=r.readonly,T=void 0!==k&&k,O=r.readonlyBackgroundColor,P=void 0===O?"#dddddd":O,V=r.bold,R=void 0!==V&&V,j=_(r,Q),z=Y(e.useState(null),2),B=z[0],K=z[1],F=o.watch(i);e.useEffect((function(){K(m.find((function(e){return e[v]===F}))||null)}),[F]);var D=o.control,I=o.formState.errors;return e.createElement(g,{name:i,control:D,rules:{required:u,disabled:d},render:function(r){var o=r.field,l=o.onChange,c=o.onBlur;return o.value,T?e.createElement(t,{size:L,label:a,fullWidth:!0,required:u,slotProps:{input:{maxLength:E,readOnly:T,sx:{fontWeight:R?"bold":"",backgroundColor:T?P:""}}},value:B?B.label:""}):e.createElement(n,{value:B,required:u,onChange:function(e,t){return l(t?t[v]:null)},options:m,isOptionEqualToValue:function(e,t){return e[v]===t[v]},noOptionsText:C,getOptionLabel:function(e){return e[h]},size:L,slotProps:{input:{maxLength:E,sx:{fontWeight:R?"bold":"",color:"red"}}},renderInput:function(r){var n,o;return e.createElement(t,N({label:a,required:u,disabled:d,autoFocus:y,size:L,error:q&&Boolean(null===(n=I[i])||void 0===n?void 0:n.message),onBlur:c,variant:"outlined",fullWidth:!0,helperText:q&&(null===(o=I[i])||void 0===o?void 0:o.message)},r,j))}})}})},te=function(e){return null==e||""===e},re=function(e){return null!=e&&""!==e},ne=function(e){return te(e)?"":new Intl.NumberFormat("el-GR",{style:"currency",currency:"EUR"}).format(e)},oe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!te(e))return new Intl.NumberFormat("el-GR",{minimumFractionDigits:t,maximumFractionDigits:t}).format(e)},ie=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors"],ae=function(r){var i=r.form,a=r.name,l=r.label,u=r.required,c=void 0!==u&&u,d=r.disabled,s=void 0!==d&&d,m=r.options,f=void 0===m?[]:m,v=r.valueKey,p=void 0===v?"id":v,h=r.labelKey,b=void 0===h?"label":h,E=r.maxLength,x=void 0===E?255:E,y=r.autofocus,w=void 0!==y&&y,C=r.noOptionsText,S=void 0===C?"Δεν υπάρχουν επιλογές":C,q=r.showErrors,W=void 0===q||q,L=_(r,ie),k=Y(e.useState([]),2),T=k[0],O=k[1],P=i.watch(a);e.useEffect((function(){O(f.filter((function(e){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";return Boolean(t.find((function(t){return t[r]===e[r]})))}(e,P)})))}),[P]);var V=i.control,R=i.formState.errors;return e.createElement(g,{name:a,control:V,rules:{required:c,disabled:s},render:function(r){var i=r.field,u=i.onChange,d=i.onBlur;return i.value,e.createElement(n,{multiple:!0,value:T,required:c,onChange:function(e,t){return u(t)},options:f,isOptionEqualToValue:function(e,t){return e[p]===t[p]},noOptionsText:S,renderTags:function(t,r){return t.map((function(t,n){return e.createElement(o,N({variant:"outlined",label:t[b],size:"small"},r({index:n})))}))},renderInput:function(r){var n,o;return e.createElement(t,N({label:l,required:c,disabled:s,autoFocus:w,inputProps:{maxLength:x},error:W&&Boolean(null===(n=R[a])||void 0===n?void 0:n.message),onBlur:d,variant:"outlined",fullWidth:!0,helperText:W&&(null===(o=R[a])||void 0===o?void 0:o.message)},r,L))}})}})},le=["form","name","label","optionsUrl","renderOption","valueKey","labelKey","minChars","required","disabled","maxLength","autofocus","loadingText","noOptionsText","placeholder","size","onChange","showErrors","readonly","readonlyBackgroundColor","bold"],ue=e.forwardRef((function(r,o){var i=r.form,a=r.name,l=r.label,u=r.optionsUrl,c=r.renderOption,d=void 0===c?null:c,s=r.valueKey,m=void 0===s?"id":s,f=r.labelKey,v=void 0===f?"label":f,p=r.minChars,h=void 0===p?2:p,b=r.required,E=void 0!==b&&b,x=r.disabled,y=void 0!==x&&x,w=r.maxLength,C=void 0===w?255:w,q=r.autofocus,W=void 0!==q&&q,L=r.loadingText,k=void 0===L?"Ανάκτηση...":L,T=r.noOptionsText,O=void 0===T?"Δεν υπάρχουν επιλογές":T,P=r.placeholder,V=void 0===P?"":P,R=r.size,j=void 0===R?"medium":R,z=r.onChange,B=void 0===z?null:z,K=r.showErrors,F=void 0===K||K,D=r.readonly,M=void 0!==D&&D,A=r.readonlyBackgroundColor,H=void 0===A?"#dddddd":A,U=r.bold,X=void 0!==U&&U,$=_(r,le),Z=Y(e.useState(null),2),J=Z[0],Q=Z[1],ee=Y(e.useState([]),2),te=ee[0],re=ee[1],ne=Y(e.useState(!1),2),oe=ne[0],ie=ne[1];e.useImperativeHandle(o,(function(){return{setValue:function(e){function t(){return(t=I(G().mark((function t(){var r;return G().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return ie(!0),t.next=3,S.get("".concat(u,"?id=").concat(e));case 3:r=t.sent,re(r.data),Q(r.data.find((function(e){return e[m]===i.getValues(a)}))||null),ie(!1);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}i.setValue(a,e),function(){t.apply(this,arguments)}()}}}));var ae=i.control,ue=i.formState.errors;e.useEffect((function(){if(i.getValues(a)){var e=function(){var e=I(G().mark((function e(){var t;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ie(!0),e.next=3,S.get("".concat(u,"?id=").concat(i.getValues(a)));case 3:t=e.sent,re(t.data),Q(t.data.find((function(e){return e[m]===i.getValues(a)}))||null),ie(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}}),[]);var ce=function(){var e=I(G().mark((function e(t,r){var n;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r||re([]),!(r.length<h)){e.next=3;break}return e.abrupt("return");case 3:return ie(!0),e.next=6,S.get("".concat(u,"?id=").concat(t||"","&token=").concat(r||""));case 6:n=e.sent,re(n.data),ie(!1);case 9:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),de=function(e,t){ce(i.getValues(a),t)};return e.createElement(g,{name:a,control:ae,rules:{required:E,disabled:y},render:function(r){var o,i,u,c=r.field,s=c.onChange,f=c.onBlur;return c.value,M?e.createElement(t,{size:j,label:l,fullWidth:!0,required:E,slotProps:{input:{maxLength:C,readOnly:M,sx:{fontWeight:X?"bold":"",backgroundColor:M?H:""}}},value:J?J.label:""}):e.createElement(n,{value:J,options:te,onInputChange:(o=de,i=300,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];u&&clearTimeout(u),u=setTimeout((function(){o.apply(void 0,t)}),i)}),onChange:function(e,t){Q(t),s(t?t[m]:null),B&&B(t?t[m]:null)},isOptionEqualToValue:function(e,t){return e[m]===t[m]},getOptionLabel:function(e){return e[v]},filterOptions:function(e){return e},noOptionsText:O,loadingText:k,loading:oe,required:E,size:j,renderInput:function(r){var n,o;return e.createElement(t,N({label:l,required:E,disabled:y,autoFocus:W,placeholder:V,error:F&&Boolean(null===(n=ue[a])||void 0===n?void 0:n.message),onBlur:f,variant:"outlined",fullWidth:!0,helperText:F&&(null===(o=ue[a])||void 0===o?void 0:o.message),size:j,maxLength:C},r,$))},renderOption:function(t,r,n){return d?d(t,r,n):e.createElement("li",N({},t,{key:r[m]}),r[v])}})}})})),ce=["form","name","label","rows","required","disabled","autofocus","showErrors"],de=function(r){var n=r.form,o=r.name,i=r.label,a=r.rows,l=void 0===a?5:a,u=r.required,c=void 0!==u&&u,d=r.disabled,s=void 0!==d&&d,m=r.autofocus,f=void 0!==m&&m,v=r.showErrors,p=void 0===v||v,h=_(r,ce),b=n.control,E=n.formState.errors;return e.createElement(g,{name:o,control:b,rules:{required:c,disabled:s},render:function(r){var n,a,u=r.field,d=u.onChange,m=u.onBlur,v=u.value;return e.createElement(t,N({required:c,label:i,value:v,multiline:!0,minRows:l,maxRows:l,onChange:d,onBlur:m,error:p&&Boolean(null===(n=E[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:p&&(null===(a=E[o])||void 0===a?void 0:a.message),variant:"outlined",disabled:s,autoFocus:f},h))}})},se=["form","name","label","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],me=function(r){var n=r.form,o=r.name,i=r.label,a=r.required,l=void 0!==a&&a,u=r.disabled,c=void 0!==u&&u;r.autofocus;var d=r.showErrors,s=void 0===d||d,m=r.readonly,f=void 0!==m&&m,v=r.readonlyBackgroundColor,p=void 0===v?"#dddddd":v,h=r.bold,b=void 0!==h&&h,E=_(r,se),x=n.control,y=n.formState.errors,w=function(e,t){""===e.value?n.setValue(o,null):n.setValue(o,e.floatValue)};return e.createElement(g,{name:o,control:x,rules:{required:l,disabled:c},render:function(r){var n,a,u=r.field;u.onChange,u.onBlur;var d=u.value;return e.createElement(q,N({customInput:t,variant:"outlined",label:i,required:l,disabled:c,value:d,thousandSeparator:".",decimalSeparator:",",decimalScale:2,fixedDecimalScale:!0,allowNegative:!1,onValueChange:w,error:s&&Boolean(null===(n=y[o])||void 0===n?void 0:n.message),helperText:s&&(null===(a=y[o])||void 0===a?void 0:a.message),fullWidth:!0,slotProps:{input:{readOnly:f,sx:{fontWeight:b?"bold":"",backgroundColor:f?p:""}}}},E))}})},fe=["form","name","label","required","disabled","autofocus","showErrors","ampm","singleTimeColumn","hoursStep","minutesStep","secondsStep"],ve=function(t){var r=t.form,n=t.name,o=t.label,i=t.required,a=void 0!==i&&i,l=t.disabled,u=void 0!==l&&l;t.autofocus;var c=t.showErrors,d=void 0===c||c,s=t.ampm,m=void 0!==s&&s,f=t.singleTimeColumn,v=void 0===f||f,p=t.hoursStep,h=void 0===p?1:p,b=t.minutesStep,E=void 0===b?15:b,x=t.secondsStep,y=void 0===x?30:x,w=_(t,fe),S=r.control,q=r.formState.errors;return e.createElement(L,{dateAdapter:W,adapterLocale:V,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"}}},e.createElement(g,{name:n,control:S,rules:{required:a,disabled:u},render:function(t){var r,i,l=t.field;return e.createElement(k,{label:o,value:l.value?C(l.value):null,format:"dd/MM/yyyy HH:mm",inputFormat:!0,views:v?["year","month","day","hours"]:["year","month","day","hours","minutes"],ampm:m,onChange:function(e){return l.onChange(e)},viewRenderers:v?{hours:T}:null,timeSteps:{hours:h,minutes:E,seconds:y},slotProps:{textField:H(H({},w),{},{required:a,error:d&&Boolean(null===(r=q[n])||void 0===r?void 0:r.message),helperText:d&&(null===(i=q[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},pe=["form","name","label","required","disabled","autofocus","showErrors"],he=function(t){var r=t.form,n=t.name,o=t.label,i=t.required,a=void 0!==i&&i,l=t.disabled,u=void 0!==l&&l;t.autofocus;var c=t.showErrors,d=void 0===c||c,s=_(t,pe),m=r.control,f=r.formState.errors;return e.createElement(L,{dateAdapter:W,adapterLocale:V,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"}}},e.createElement(g,{name:n,control:m,rules:{required:a,disabled:u},render:function(t){var r,i,l=t.field;return e.createElement(O,{label:o,value:l.value?C(l.value):null,format:"dd/MM/yyyy",inputFormat:!0,onChange:function(e){return l.onChange(e)},slotProps:{textField:H(H({},s),{},{required:a,error:d&&Boolean(null===(r=f[n])||void 0===r?void 0:r.message),helperText:d&&(null===(i=f[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},be=["form","name","label","allowNegative","required","disabled","autofocus","showErrors"],ge=function(r){var n=r.form,o=r.name,i=r.label,a=r.allowNegative,l=void 0!==a&&a,u=r.required,c=void 0!==u&&u,d=r.disabled,s=void 0!==d&&d,m=r.autofocus,f=void 0!==m&&m,v=r.showErrors,p=void 0===v||v,h=_(r,be),b=n.control,E=n.formState.errors,x=function(e,t){""===e.value?n.setValue(o,null):n.setValue(o,e.floatValue)};return e.createElement(g,{name:o,control:b,rules:{required:c,disabled:s},render:function(r){var n,a,u=r.field;u.onChange,u.onBlur;var d=u.value;return e.createElement(q,N({customInput:t,variant:"outlined",label:i,required:c,disabled:s,value:d,thousandSeparator:!1,decimalSeparator:",",decimalScale:0,fixedDecimalScale:!0,allowNegative:l,onValueChange:x,error:p&&Boolean(null===(n=E[o])||void 0===n?void 0:n.message),helperText:p&&(null===(a=E[o])||void 0===a?void 0:a.message),fullWidth:!0,autoFocus:f},h))}})},Ee=["form","name","label","required","disabled","showErrors"],xe=function(r){var n=r.form,o=r.name,l=r.label,u=r.required,c=void 0!==u&&u,d=r.disabled,s=void 0!==d&&d,m=r.showErrors,f=void 0===m||m,v=_(r,Ee),p=Y(e.useState(),2),h=p[0],b=p[1],E=e.useRef(null),x=n.control,y=n.formState.errors,w=function(){E.current.value=null,E.current.click()};return e.createElement(e.Fragment,null,e.createElement(g,{name:o,control:x,rules:{required:c,disabled:s},render:function(r){var u,d,m=r.field;return m.onChange,m.onBlur,m.value,e.createElement(t,N({sx:{input:{cursor:"pointer"}},onClick:w,required:c,label:l,value:h?h.name:"",error:f&&Boolean(null===(u=y[o])||void 0===u?void 0:u.message),fullWidth:!0,helperText:f&&(null===(d=y[o])||void 0===d?void 0:d.message),variant:"outlined",disabled:s,InputProps:{endAdornment:h&&e.createElement(i,{position:"end"},e.createElement(a,{onClick:function(e){return function(e){e.stopPropagation(),b(null),n.setValue(o,null)}(e)}},e.createElement(R,null))),readOnly:!0}},v))}}),e.createElement("input",{type:"file",ref:E,style:{display:"none"},onChange:function(e){return function(e){b(e),n.setValue(o,e,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})}(e.currentTarget.files[0])}}))},ye=["form","name","label","ampm","hoursStep","minutesStep","secondsStep","singleTimeColumn","required","disabled","autofocus","showErrors"],we=function(t){var r=t.form,n=t.name,o=t.label,i=t.ampm,a=void 0!==i&&i,l=t.hoursStep,u=void 0===l?1:l,c=t.minutesStep,d=void 0===c?15:c,s=t.secondsStep,m=void 0===s?30:s,f=t.singleTimeColumn,v=void 0===f||f,p=t.required,h=void 0!==p&&p,b=t.disabled,E=void 0!==b&&b;t.autofocus;var x=t.showErrors,y=void 0===x||x,w=_(t,ye),S=r.control,q=r.formState.errors;return e.createElement(L,{dateAdapter:W,adapterLocale:V,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"}}},e.createElement(g,{name:n,control:S,rules:{required:h,disabled:E},render:function(t){var r,i,l=t.field;return e.createElement(P,{label:o,value:l.value?C(l.value):null,format:"HH:mm",inputFormat:!0,views:v?["hours"]:["hours","minutes"],ampm:a,onChange:function(e){return l.onChange(e)},viewRenderers:v?{hours:T}:null,timeSteps:{hours:u,minutes:d,seconds:m},slotProps:{textField:H(H({},w),{},{required:h,error:y&&Boolean(null===(r=q[n])||void 0===r?void 0:r.message),helperText:y&&(null===(i=q[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},Ce=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,W=t.requiredMessage,L=void 0===W?"Υποχρεωτικό πεδίο":W,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,O=t.cancelLabel,P=void 0===O?"ΑΚΥΡΩΣΗ":O,V=t.maxLength,R=void 0===V?255:V,z=t.message,B=void 0===z?null:z,K=t.isLoading,F=void 0!==K&&K,D={text:a||""},I=y.object({text:q?y.string().max(R,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(R," χαρακτήρες")).required(L):y.string().max(R)}),M=E({defaultValues:D,resolver:x(I)});e.useEffect((function(){n&&(M.reset(D),M.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:C,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),B&&"string"==typeof B?e.createElement(r,{variant:"caption",color:"text.secondary"},B):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:M.handleSubmit((function(e){return b(e.text)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},B&&"string"!=typeof B&&e.createElement(s,{sx:{mb:2}},B),e.createElement(X,{form:M,name:"text",label:i,required:q,autofocus:!0,maxLength:R,sx:{mt:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(p,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},P),e.createElement(p,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},F?e.createElement(h,{size:20,sx:{color:"inherit"}}):T))))},Se=/^$|^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,qe=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,W=t.requiredMessage,L=void 0===W?"Υποχρεωτικό πεδίο":W,k=t.invalidMessage,T=void 0===k?"Μη έγκυρη μορφή email":k,O=t.okLabel,P=void 0===O?"ΚΑΤΑΧΩΡΗΣΗ":O,V=t.cancelLabel,R=void 0===V?"ΑΚΥΡΩΣΗ":V,z=t.maxLength,B=void 0===z?255:z,K=t.message,F=void 0===K?null:K,D=t.isLoading,I=void 0!==D&&D,M={email:a||""},N=y.object({email:q?y.string().matches(Se,T).required(L):y.string().matches(Se,T)}),A=E({defaultValues:M,resolver:x(N)});e.useEffect((function(){n&&(A.reset(M),A.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:C,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),F&&"string"==typeof F?e.createElement(r,{variant:"caption",color:"text.secondary"},F):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:A.handleSubmit((function(e){return b(e.email)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},F&&"string"!=typeof F&&e.createElement(s,{sx:{mb:2}},F),e.createElement(Z,{form:A,label:i,required:q,autofocus:!0,maxLength:B,sx:{marginTop:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(p,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},R),e.createElement(p,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},I?e.createElement(h,{size:20,sx:{color:"inherit"}}):P))))};!function(e,t){void 0===t&&(t={});var r=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".chrome-picker {\r\n -webkit-box-shadow: none !important;\r\n -moz-box-shadow: none !important;\r\n box-shadow: none !important;\r\n}");var We=function(t){var r=t.open,n=t.onSubmit,o=t.onCancel,i=t.title,a=void 0===i?"Επιλογή Χρώματος":i,u=t.color,s=void 0===u?"#000000":u,m=t.pickerWidth,h=void 0===m?350:m,b=t.selectionTextColor,g=void 0===b?"white":b,E=t.paddingY,x=void 0===E?"10px":E,y=t.paddingX,C=void 0===y?"10px":y,S=t.okLabel,q=void 0===S?"ΚΑΤΑΧΩΡΗΣΗ":S,W=t.cancelLabel,L=void 0===W?"ΑΚΥΡΩΣΗ":W;t.isLoading;var k=Y(e.useState("#000000"),2),T=k[0],O=k[1];e.useEffect((function(){r&&O(s)}),[r,s]);return e.createElement(l,{open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),form.handleSubmit(n)())}},e.createElement(c,null,a),e.createElement(f,null,e.createElement(d,{gap:2},e.createElement(J,{color:g,backgroundColor:T,paddingX:C,paddingY:x,label:T}),e.createElement(w,{width:h,color:T,onChange:function(e){return O(e.hex)}}))),e.createElement(v,null,e.createElement(p,{color:"success",onClick:function(){return n(T)}},q),e.createElement(p,{color:"error",onClick:function(){return o()}},L)))},Le=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.options,C=void 0===w?[]:w,S=t.valueKey,q=void 0===S?"id":S,W=t.labelKey,L=void 0===W?"label":W,k=t.required,T=void 0===k||k,O=t.size,P=void 0===O?"sm":O,V=t.requiredMessage,R=void 0===V?"Υποχρεωτικό πεδίο":V,z=t.okLabel,B=void 0===z?"ΚΑΤΑΧΩΡΗΣΗ":z,K=t.cancelLabel,F=void 0===K?"ΑΚΥΡΩΣΗ":K,D=t.message,I=void 0===D?null:D,M=t.isLoading,N=void 0!==M&&M,A={field:a||null},H=y.object({field:T?y.string().required(R):y.string().nullable()}),_=E({defaultValues:A,resolver:x(H)});e.useEffect((function(){n&&(_.reset(A),_.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:P,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),I&&"string"==typeof I?e.createElement(r,{variant:"caption",color:"text.secondary"},I):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:_.handleSubmit((function(e){return b(e)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},e.createElement(ee,{form:_,name:"field",label:i,options:C,valueKey:q,labelKey:L,required:T,autofocus:!0,size:"medium",sx:{marginTop:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(p,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},F),e.createElement(p,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},N?e.createElement(h,{size:20,sx:{color:"inherit"}}):B))))},ke=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=void 0===a?[]:a,g=t.onSubmit,w=t.onCancel,C=t.options,S=void 0===C?[]:C,q=t.valueKey,W=void 0===q?"id":q,L=t.labelKey,k=void 0===L?"label":L,T=t.required,O=void 0===T||T,P=t.size,V=void 0===P?"sm":P,R=t.requiredMessage,z=void 0===R?"Επιλέξτε τουλάχιστον μία τιμή":R,B=t.okLabel,K=void 0===B?"ΚΑΤΑΧΩΡΗΣΗ":B,F=t.cancelLabel,D=void 0===F?"ΑΚΥΡΩΣΗ":F,I=t.message,M=void 0===I?null:I,N=t.isLoading,A=void 0!==N&&N,H={field:b||[]},_=y.object({field:O?y.array().min(1,z):y.array()}),G=E({defaultValues:H,resolver:x(_)});e.useEffect((function(){n&&(G.reset(H),G.clearErrors())}),[n,b]);return e.createElement(l,{fullWidth:!0,maxWidth:V,open:n,onClose:function(e,t){"escapeKeyDown"===t&&w()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),M&&"string"==typeof M?e.createElement(r,{variant:"caption",color:"text.secondary"},M):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:G.handleSubmit((function(e){return g(e)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},M&&"string"!=typeof M&&e.createElement(s,{sx:{mb:2}},M),e.createElement(ae,{form:G,name:"field",label:i,options:S,valueKey:W,labelKey:k,required:O,autofocus:!0,sx:{marginTop:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(p,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),w()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},D),e.createElement(p,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},A?e.createElement(h,{size:20,sx:{color:"inherit"}}):K))))},Te=function(t){var r=t.open,n=t.title,o=t.message,i=t.onConfirm,a=t.onCancel,d=t.confirmText,m=void 0===d?"ΕΠΙΒΕΒΑΙΩΣΗ":d,g=t.cancelText,E=void 0===g?"ΑΚΥΡΩΣΗ":g,x=t.isLoading,y=void 0!==x&&x,w=t.type,C=void 0===w?"warning":w,S={warning:{color:"warning.main",icon:e.createElement(z,{sx:{fontSize:40}})},error:{color:"error.main",icon:e.createElement(B,{sx:{fontSize:40}})},success:{color:"success.main",icon:e.createElement(K,{sx:{fontSize:40}})}}[C]||{color:"primary.main",icon:null};return e.createElement(l,{open:r,onClose:function(e,t){"backdropClick"!==t&&a()},slots:{transition:u},slotProps:{backdrop:{sx:{backgroundColor:"rgba(0, 0, 0, 0.4)",backdropFilter:"blur(4px)"}},paper:{sx:{borderRadius:4,padding:1,maxWidth:400,textAlign:"center",backgroundImage:"none"}}}},e.createElement(s,{sx:{display:"flex",flexDirection:"column",alignItems:"center",mt:3}},e.createElement(s,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:70,height:70,bgcolor:"".concat(S.color,"20"),color:S.color,borderRadius:"50%",mb:2}},S.icon),e.createElement(c,{sx:{fontWeight:800,fontSize:"1.35rem",pt:0,pb:1}},n)),e.createElement(f,null,e.createElement(b,{sx:{color:"text.secondary",fontWeight:500,lineHeight:1.6}},o)),e.createElement(v,{sx:{justifyContent:"center",gap:2,px:3,pb:3,mt:1}},e.createElement(p,{fullWidth:!0,variant:"text",color:"inherit",onClick:a,sx:{borderRadius:3,fontWeight:700,color:"text.disabled"}},E),e.createElement(p,{fullWidth:!0,variant:"contained",disableElevation:!0,color:"error"===C?"error":"primary",onClick:i,sx:{borderRadius:3,fontWeight:700,py:1}},y?e.createElement(h,{size:20,sx:{color:"inherit"}}):m)))},Oe=function(t){var n=t.open,o=t.title,i=t.label,a=t.message,b=void 0===a?null:a,g=t.value,w=t.onSubmit,C=t.onCancel,S=t.size,q=void 0===S?"sm":S,W=t.rows,L=void 0===W?5:W,k=t.required,T=void 0!==k&&k,O=t.requiredMessage,P=void 0===O?"Υποχρεωτικό πεδίο":O,V=t.okLabel,R=void 0===V?"ΚΑΤΑΧΩΡΗΣΗ":V,z=t.cancelLabel,B=void 0===z?"ΑΚΥΡΩΣΗ":z,K=t.isLoading,F=void 0!==K&&K,D={notes:g||""},I=y.object({notes:T?y.string().required(P):y.string()}),M=E({defaultValues:D,resolver:x(I)});e.useEffect((function(){n&&(M.reset(D),M.clearErrors())}),[n,g]);return e.createElement(l,{fullWidth:!0,maxWidth:q,open:n,onClose:function(e,t){"escapeKeyDown"===t&&C()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),b&&"string"==typeof b?e.createElement(r,{variant:"caption",color:"text.secondary"},b):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:M.handleSubmit((function(e){return w(e.notes)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},b&&"string"!=typeof b&&e.createElement(s,{sx:{mb:2}},b),e.createElement(de,{form:M,name:"notes",label:i,required:T,rows:L,autofocus:!0,sx:{marginTop:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(p,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),C()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},B),e.createElement(p,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},F?e.createElement(h,{size:20,sx:{color:"inherit"}}):R))))},Pe=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,W=t.minValue,L=void 0===W?null:W,k=t.maxValue,T=void 0===k?null:k,O=t.requiredMessage,P=void 0===O?"Υποχρεωτικό πεδίο":O,V=t.okLabel,R=void 0===V?"ΚΑΤΑΧΩΡΗΣΗ":V,z=t.cancelLabel,B=void 0===z?"ΑΚΥΡΩΣΗ":z,K=t.message,F=void 0===K?null:K,D=t.isLoading,I=void 0!==D&&D,M={poso:re(a)?a:null},N=y.object({poso:y.number().when([],{is:function(e){return q},then:function(e){return e.required(P)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==L},then:function(e){return e.min(L,"Το ποσό πρέπει να είναι μεγαλύτερο ή ίσο από ".concat(ne(L)))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==T},then:function(e){return e.max(T,"Το ποσό πρέπει να είναι μικρότερο ή ίσο από ".concat(ne(T)))},otherwise:function(e){return e}})}),A=E({defaultValues:M,resolver:x(N)});e.useEffect((function(){n&&(A.reset(M),A.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:C,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),F&&"string"==typeof F?e.createElement(r,{variant:"caption",color:"text.secondary"},F):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:A.handleSubmit((function(e){return b(e.poso)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},e.createElement(me,{form:A,name:"poso",label:i,required:q,autofocus:!0,sx:{marginTop:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(p,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},B),e.createElement(p,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},I?e.createElement(h,{size:20,sx:{color:"inherit"}}):R))))},Ve=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,W=t.requiredMessage,L=void 0===W?"Υποχρεωτικό πεδίο":W,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,O=t.cancelLabel,P=void 0===O?"ΑΚΥΡΩΣΗ":O,V=t.message,R=void 0===V?null:V,z=t.isLoading,B=void 0!==z&&z,K={datetime:a},F=y.object({datetime:q?y.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").required(L):y.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας")}),D=E({defaultValues:K,resolver:x(F)});e.useEffect((function(){n&&(D.reset(K),D.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:C,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),R&&"string"==typeof R?e.createElement(r,{variant:"caption",color:"text.secondary"},R):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:D.handleSubmit((function(e){return b(e.datetime)})),noValidate:!0},e.createElement(f,null,R&&"string"!=typeof R&&e.createElement(s,{sx:{mb:2}},R),e.createElement(ve,{form:D,name:"datetime",label:i,required:q,autofocus:!0,sx:{marginTop:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(p,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},P),e.createElement(p,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},B?e.createElement(h,{size:20,sx:{color:"inherit"}}):T))))},Re=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,W=t.requiredMessage,L=void 0===W?"Υποχρεωτικό πεδίο":W,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,O=t.cancelLabel,P=void 0===O?"ΑΚΥΡΩΣΗ":O,V=t.message,R=void 0===V?null:V,z=t.isLoading,B=void 0!==z&&z,K={datetime:a},F=y.object({datetime:q?y.date().typeError("Μη έγκυρη μορφή ημερομηνίας").required(L):y.date().typeError("Μη έγκυρη μορφή ημερομηνίας")}),D=E({defaultValues:K,resolver:x(F)});e.useEffect((function(){n&&(D.reset(K),D.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:C,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),R&&"string"==typeof R?e.createElement(r,{variant:"caption",color:"text.secondary"},R):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:D.handleSubmit((function(e){return b(e.datetime)})),noValidate:!0},e.createElement(f,null,R&&"string"!=typeof R&&e.createElement(s,{sx:{mb:2}},R),e.createElement(he,{form:D,name:"datetime",label:i,required:q,autofocus:!0,sx:{marginTop:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(p,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},P),e.createElement(p,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},B?e.createElement(h,{size:20,sx:{color:"inherit"}}):T))))},je=[{id:!0,label:"ΝΑΙ"},{id:!1,label:"ΟΧΙ"}],ze=function(t){var n=t.open,o=t.title,i=t.label,a=t.value,u=t.onSubmit,d=t.onCancel,s=t.required,m=void 0===s||s,h=t.info,b=void 0===h?"":h,g=t.size,w=void 0===g?"sm":g,C=t.requiredMessage,S=void 0===C?"Υποχρεωτικό πεδίο":C,q=t.okLabel,W=void 0===q?"ΚΑΤΑΧΩΡΗΣΗ":q,L=t.cancelLabel,k=void 0===L?"ΑΚΥΡΩΣΗ":L,T={field:a||null},O=y.object({field:m?y.boolean().required(S):y.boolean().nullable()}),P=E({defaultValues:T,resolver:x(O)});return e.useEffect((function(){n&&(P.clearErrors(),P.setValue("field",a,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[n,a]),e.createElement(l,{fullWidth:!0,maxWidth:w,open:n,onClose:function(){}},e.createElement(c,null,o),e.createElement(f,null,b&&e.createElement(r,null,b),e.createElement(ee,{form:P,name:"field",label:i,options:je,valueKey:"id",labelKey:"label",required:m,autofocus:!0,size:"medium",sx:{marginTop:2}})),e.createElement(v,null,e.createElement(p,{color:"success",onClick:P.handleSubmit((function(e){return u(e.field)}))},W),e.createElement(p,{color:"error",onClick:function(){return d()}},k)))},Be=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,a=t.onSubmit,u=t.onCancel,d=t.allowNegative,s=void 0!==d&&d,m=t.required,h=void 0===m||m,b=t.requiredMessage,g=void 0===b?"Υποχρεωτικό πεδίο":b,w=t.size,C=void 0===w?"sm":w,S=t.minValue,q=void 0===S?null:S,W=t.maxValue,L=void 0===W?null:W,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,O=t.cancelLabel,P=void 0===O?"ΑΚΥΡΩΣΗ":O;t.isLoading;var V={num:re(i)?i:null},R=y.object({num:y.number().when([],{is:function(e){return h},then:function(e){return e.required(g)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==q},then:function(e){return e.min(q,"Η τιμή πρέπει να είναι μεγαλύτερη ή ίση από ".concat(q))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==L},then:function(e){return e.max(L,"Η τιμή πρέπει να είναι μικρότερη ή ίση από ".concat(L))},otherwise:function(e){return e}})}),j=E({defaultValues:V,resolver:x(R)});return e.useEffect((function(){r&&(j.clearErrors(),j.setValue("num",re(i)?i:null,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,i]),e.createElement(l,{fullWidth:!0,maxWidth:C,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),j.handleSubmit((function(e){return a(e.num)}))())},disableRestoreFocus:!0},e.createElement(c,null,n),e.createElement(f,null,e.createElement(ge,{form:j,name:"num",label:o,required:h,autofocus:!0,allowNegative:s,sx:{marginTop:2}})),e.createElement(v,null,e.createElement(p,{color:"success",onClick:j.handleSubmit((function(e){return a(e.num)}))},T),e.createElement(p,{color:"error",onClick:function(){return u()}},P)))},Ke=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,a=t.decimals,u=void 0===a?2:a,d=t.minValue,s=void 0===d?null:d,m=t.maxValue,h=void 0===m?null:m,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,W=t.requiredMessage,L=void 0===W?"Υποχρεωτικό πεδίο":W,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,O=t.cancelLabel,P=void 0===O?"ΑΚΥΡΩΣΗ":O;t.isLoading;var V={field:re(i)?i:null},R=y.object({field:y.number().when([],{is:function(e){return q},then:function(e){return e.required(L)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==s},then:function(e){return e.min(s,"Η τιμή πρέπει να είναι μεγαλύτερη ή ίση από ".concat(oe(s,u)))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==h},then:function(e){return e.max(h,"Η τιμή πρέπει να είναι μικρότερη ή ίση από ".concat(oe(h,u)))},otherwise:function(e){return e}})}),j=E({defaultValues:V,resolver:x(R)});return e.useEffect((function(){r&&(j.clearErrors(),j.setValue("field",re(i)?i:null,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,i]),e.createElement(l,{fullWidth:!0,maxWidth:C,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),j.handleSubmit((function(e){return b(e.field)}))())},disableRestoreFocus:!0},e.createElement(c,null,n),e.createElement(f,null,e.createElement(me,{form:j,name:"field",label:o,required:q,autofocus:!0,sx:{marginTop:2}})),e.createElement(v,null,e.createElement(p,{color:"success",onClick:j.handleSubmit((function(e){return b(e.field)}))},T),e.createElement(p,{color:"error",onClick:function(){return g()}},P)))},Fe=function(t){var r=t.open,n=t.title,o=t.message,i=t.onClose,a=t.closeText,u=void 0===a?"ΟΚ":a;return e.createElement(l,{open:r,onClose:function(){}},e.createElement(c,null,n),e.createElement(f,null,e.createElement(b,null,o)),e.createElement(v,null,e.createElement(p,{color:"primary",onClick:function(e){e.stopPropagation(),i()}},u)))},De=function(t){var r=t.open,n=t.title,o=void 0===n?"Νέο Αρχείο":n,i=t.description,a=void 0===i||i,u=t.descriptionLabel,s=void 0===u?"Περιγραφή Αρχείου":u,m=t.fileSelectLabel,h=void 0===m?"Επιλογή Αρχείου":m,b=t.maxFileName,g=void 0===b?255:b,w=t.onSubmit,C=t.onCancel;t.isLoading;var S=y.object({descr:a?y.string().required("Παρακαλώ συμπληρώστε την περιγραφή του αρχείου").max(g,"Η περιγραφή δεν πρέπει να υπερβαίνει τους ".concat(g," χαρακτήρες")):y.string(),filename:y.mixed().required("Παρακαλώ επιλέξτε ένα αρχείο")}),q=E({defaultValues:{descr:"",filename:null},resolver:x(S)});return e.useEffect((function(){r&&(q.clearErrors(),q.setValue("descr",""),q.setValue("filename",null))}),[r]),e.createElement(l,{maxWidth:"sm",fullWidth:!0,open:r,onClose:function(){}},e.createElement(c,null,o),e.createElement(f,null,e.createElement(d,{sx:{marginTop:2},gap:3},a&&e.createElement(X,{form:q,name:"descr",label:s,required:!0,autofocus:!0}),e.createElement(xe,{form:q,name:"filename",label:h,required:!0}))),e.createElement(v,null,e.createElement(p,{color:"success",onClick:q.handleSubmit(w)},"ΚΑΤΑΧΩΡΗΣΗ"),e.createElement(p,{color:"error",onClick:function(){return C()}},"ΑΚΥΡΩΣΗ")))},Ie=function(t){var n=t.open,o=t.title,i=t.label,a=t.optionsUrl,b=t.value,g=t.onSubmit,w=t.onCancel,C=t.valueKey,S=void 0===C?"id":C,q=t.labelKey,W=void 0===q?"label":q,L=t.required,k=void 0===L||L,T=t.size,O=void 0===T?"sm":T,P=t.requiredMessage,V=void 0===P?"Υποχρεωτικό πεδίο":P,R=t.minChars,z=void 0===R?1:R,B=t.okLabel,K=void 0===B?"ΚΑΤΑΧΩΡΗΣΗ":B,F=t.cancelLabel,D=void 0===F?"ΑΚΥΡΩΣΗ":F,I=t.message,M=void 0===I?null:I,N=t.isLoading,A=void 0!==N&&N,H={field:b||null},_=y.object({field:k?y.string().required(V):y.string().nullable()}),G=E({defaultValues:H,resolver:x(_)});e.useEffect((function(){n&&(G.reset(H),G.clearErrors())}),[n,b]);return e.createElement(l,{fullWidth:!0,maxWidth:O,open:n,onClose:function(e,t){"escapeKeyDown"===t&&w()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),M&&"string"==typeof M?e.createElement(r,{variant:"caption",color:"text.secondary"},M):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:G.handleSubmit((function(e){return g(e)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},M&&"string"!=typeof M&&e.createElement(s,{sx:{mb:2}},M),e.createElement(ue,{form:G,name:"field",label:i,optionsUrl:a,minChars:z,valueKey:S,labelKey:W,required:k,autofocus:!0,sx:{marginTop:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(p,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),w()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},D),e.createElement(p,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},A?e.createElement(h,{size:20,sx:{color:"inherit"}}):K))))},Me=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,a=t.onSubmit,u=t.onCancel,d=t.size,s=void 0===d?"sm":d,m=t.required,h=void 0===m||m,b=t.requiredMessage,g=void 0===b?"Υποχρεωτικό πεδίο":b,w=t.okLabel,C=void 0===w?"ΚΑΤΑΧΩΡΗΣΗ":w,S=t.cancelLabel,q=void 0===S?"ΑΚΥΡΩΣΗ":S,W={datetime:i},L=y.object({datetime:h?y.date().typeError("Μη έγκυρη μορφή ώρας").required(g):y.date().typeError("Μη έγκυρη μορφή ώρας")}),k=E({defaultValues:W,resolver:x(L)});return e.useEffect((function(){r&&(k.clearErrors(),k.setValue("datetime",i,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,i]),e.createElement(l,{fullWidth:!0,maxWidth:s,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),k.handleSubmit((function(e){return a(e.datetime)}))())},disableRestoreFocus:!0},e.createElement(c,null,n),e.createElement(f,null,e.createElement(we,{form:k,name:"datetime",label:o,required:h,autofocus:!0,sx:{marginTop:2}})),e.createElement(v,null,e.createElement(p,{color:"success",onClick:k.handleSubmit((function(e){return a(e.datetime)}))},C),e.createElement(p,{color:"error",onClick:function(){return u()}},q)))};export{Ie as AutocompleteApiModalForm,Le as AutocompleteModalForm,ke as AutocompleteMultiModalForm,Te as ConfirmationDialog,Pe as CurrencyModalForm,Re as DateModalForm,Ve as DatetimeModalForm,Ke as DecimalModalForm,qe as EmailModalForm,Be as IntegerModalForm,Fe as MessageDialog,Oe as NotesModalForm,We as PickColorModalForm,De as SelectFileModalForm,Ce as TextModalForm,Me as TimeModalForm,ze as YesNoModalForm};
1
+ import e from"react";import{TextField as t,Typography as r,Autocomplete as n,Chip as o,InputAdornment as i,IconButton as l,Dialog as a,Zoom as u,DialogTitle as c,Stack as d,Box as s,Divider as m,DialogContent as f,DialogActions as v,Button as p,CircularProgress as h,DialogContentText as b}from"@mui/material";import{Controller as g,useForm as E}from"react-hook-form";import{yupResolver as x}from"@hookform/resolvers/yup";import*as y from"yup";import{ChromePicker as w}from"react-color";import{toDate as C}from"date-fns";import"date-fns/locale";import S from"axios";import{NumericFormat as q}from"react-number-format";import{AdapterDateFns as W}from"@mui/x-date-pickers/AdapterDateFnsV3";import{LocalizationProvider as L}from"@mui/x-date-pickers/LocalizationProvider";import{DateTimePicker as k,renderDigitalClockTimeView as T,DatePicker as O,TimePicker as P}from"@mui/x-date-pickers";import V from"date-fns/locale/el";import{Clear as R,EditNoteRounded as j}from"@mui/icons-material";import z from"@mui/icons-material/WarningAmberRounded";import B from"@mui/icons-material/ErrorOutlineRounded";import K from"@mui/icons-material/CheckCircleOutlineRounded";function F(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function D(e,t,r,n,o,i,l){try{var a=e[i](l),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,o)}function I(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function l(e){D(i,n,o,l,a,"next",e)}function a(e){D(i,n,o,l,a,"throw",e)}l(void 0)}))}}function M(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function N(){return N=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},N.apply(null,arguments)}function A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A(Object(r),!0).forEach((function(t){M(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function G(){G=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},l=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function d(e,t,r,n){var i=t&&t.prototype instanceof b?t:b,l=Object.create(i.prototype),a=new O(n||[]);return o(l,"_invoke",{value:W(e,r,a)}),l}function s(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var m="suspendedStart",f="suspendedYield",v="executing",p="completed",h={};function b(){}function g(){}function E(){}var x={};c(x,l,(function(){return this}));var y=Object.getPrototypeOf,w=y&&y(y(P([])));w&&w!==r&&n.call(w,l)&&(x=w);var C=E.prototype=b.prototype=Object.create(x);function S(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function q(e,t){function r(o,i,l,a){var u=s(e[o],e,i);if("throw"!==u.type){var c=u.arg,d=c.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,l,a)}),(function(e){r("throw",e,l,a)})):t.resolve(d).then((function(e){c.value=e,l(c)}),(function(e){return r("throw",e,l,a)}))}a(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function W(t,r,n){var o=m;return function(i,l){if(o===v)throw Error("Generator is already running");if(o===p){if("throw"===i)throw l;return{value:e,done:!0}}for(n.method=i,n.arg=l;;){var a=n.delegate;if(a){var u=L(a,n);if(u){if(u===h)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var c=s(t,r,n);if("normal"===c.type){if(o=n.done?p:f,c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=p,n.method="throw",n.arg=c.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=s(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,h;var l=i.arg;return l?l.done?(r[t.resultName]=l.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,h):l:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function P(t){if(t||""===t){var r=t[l];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(typeof t+" is not iterable")}return g.prototype=E,o(C,"constructor",{value:E,configurable:!0}),o(E,"constructor",{value:g,configurable:!0}),g.displayName=c(E,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,c(e,u,"GeneratorFunction")),e.prototype=Object.create(C),e},t.awrap=function(e){return{__await:e}},S(q.prototype),c(q.prototype,a,(function(){return this})),t.AsyncIterator=q,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var l=new q(d(e,r,n,o),i);return t.isGeneratorFunction(r)?l:l.next().then((function(e){return e.done?e.value:l.next()}))},S(C),c(C,u,"Generator"),c(C,l,(function(){return this})),c(C,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=P,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return a.type="throw",a.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var l=this.tryEntries[i],a=l.completion;if("root"===l.tryLoc)return o("end");if(l.tryLoc<=this.prev){var u=n.call(l,"catchLoc"),c=n.call(l,"finallyLoc");if(u&&c){if(this.prev<l.catchLoc)return o(l.catchLoc,!0);if(this.prev<l.finallyLoc)return o(l.finallyLoc)}else if(u){if(this.prev<l.catchLoc)return o(l.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<l.finallyLoc)return o(l.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var l=i?i.completion:{};return l.type=e,l.arg=t,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(l)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:P(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),h}},t}function Y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,l,a=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(u=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(c)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return F(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?F(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var U=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],X=function(r){var n=r.form,o=r.name,i=r.label,l=r.maxLength,a=void 0===l?255:l,u=r.required,c=void 0!==u&&u,d=r.disabled,s=void 0!==d&&d,m=r.autofocus,f=void 0!==m&&m,v=r.showErrors,p=void 0===v||v,h=r.readonly,b=void 0!==h&&h,E=r.readonlyBackgroundColor,x=void 0===E?"#dddddd":E,y=r.bold,w=void 0!==y&&y,C=_(r,U),S=n.control,q=n.formState.errors;return e.createElement(g,{name:o,control:S,rules:{required:c,disabled:s},render:function(r){var n,l,u=r.field,d=u.onChange,m=u.onBlur,v=u.value;return e.createElement(t,N({required:c,label:i,value:v,onChange:d,onBlur:m,error:p&&Boolean(null===(n=q[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:p&&(null===(l=q[o])||void 0===l?void 0:l.message),variant:"outlined",disabled:s,autoFocus:f,slotProps:{input:{maxLength:a,readOnly:b,sx:{fontWeight:w?"bold":"",backgroundColor:b?x:""}}}},C))}})},$=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],Z=function(r){var n=r.form,o=r.name,i=void 0===o?"email":o,l=r.label,a=void 0===l?"E-mail":l,u=r.maxLength,c=void 0===u?255:u,d=r.required,s=void 0===d||d,m=r.disabled,f=void 0!==m&&m,v=r.autofocus,p=void 0!==v&&v,h=r.showErrors,b=void 0===h||h,E=r.readonly,x=void 0!==E&&E,y=r.readonlyBackgroundColor,w=void 0===y?"#dddddd":y,C=r.bold,S=void 0!==C&&C,q=_(r,$),W=n.control,L=n.formState.errors;return e.createElement(g,{name:i,control:W,rules:{required:s,disabled:f},render:function(r){var n,o,l=r.field,u=l.onChange,d=l.onBlur,m=l.value;return e.createElement(t,N({required:s,label:a,value:m,onChange:u,onBlur:d,error:b&&Boolean(null===(n=L[i])||void 0===n?void 0:n.message),fullWidth:!0,helperText:b&&(null===(o=L[i])||void 0===o?void 0:o.message),variant:"outlined",disabled:f,autoFocus:p,slotProps:{input:{maxLength:c,readOnly:x,sx:{fontWeight:S?"bold":"",backgroundColor:x?w:""}}}},q))}})},J=function(t){var n=t.label,o=void 0===n?"":n,i=t.color,l=void 0===i?"white":i,a=t.backgroundColor,u=void 0===a?"#888888":a,c=t.paddingX,d=void 0===c?"10px":c,s=t.paddingY,m=void 0===s?"5px":s,f=t.borderRadius,v=void 0===f?"10px":f,p=t.fontSize,h=void 0===p?"14px":p,b=t.width,g={text:{display:"inline-block",textAlign:"center",backgroundColor:u,paddingX:d,paddingY:m,borderRadius:v,width:void 0===b?"auto":b,color:l,fontSize:h}};return e.createElement(r,{sx:g.text},o)},Q=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors","size","readonly","readonlyBackgroundColor","bold"],ee=function(r){var o=r.form,i=r.name,l=r.label,a=r.required,u=void 0!==a&&a,c=r.disabled,d=void 0!==c&&c,s=r.options,m=void 0===s?[]:s,f=r.valueKey,v=void 0===f?"id":f,p=r.labelKey,h=void 0===p?"label":p,b=r.maxLength,E=void 0===b?255:b,x=r.autofocus,y=void 0!==x&&x,w=r.noOptionsText,C=void 0===w?"Δεν υπάρχουν επιλογές":w,S=r.showErrors,q=void 0===S||S,W=r.size,L=void 0===W?"medium":W,k=r.readonly,T=void 0!==k&&k,O=r.readonlyBackgroundColor,P=void 0===O?"#dddddd":O,V=r.bold,R=void 0!==V&&V,j=_(r,Q),z=Y(e.useState(null),2),B=z[0],K=z[1],F=o.watch(i);e.useEffect((function(){K(m.find((function(e){return e[v]===F}))||null)}),[F]);var D=o.control,I=o.formState.errors;return e.createElement(g,{name:i,control:D,rules:{required:u,disabled:d},render:function(r){var o=r.field,a=o.onChange,c=o.onBlur;return o.value,T?e.createElement(t,{size:L,label:l,fullWidth:!0,required:u,slotProps:{input:{maxLength:E,readOnly:T,sx:{fontWeight:R?"bold":"",backgroundColor:T?P:""}}},value:B?B.label:""}):e.createElement(n,{value:B,required:u,onChange:function(e,t){return a(t?t[v]:null)},options:m,isOptionEqualToValue:function(e,t){return e[v]===t[v]},noOptionsText:C,getOptionLabel:function(e){return e[h]},size:L,slotProps:{input:{maxLength:E,sx:{fontWeight:R?"bold":"",color:"red"}}},renderInput:function(r){var n,o;return e.createElement(t,N({label:l,required:u,disabled:d,autoFocus:y,size:L,error:q&&Boolean(null===(n=I[i])||void 0===n?void 0:n.message),onBlur:c,variant:"outlined",fullWidth:!0,helperText:q&&(null===(o=I[i])||void 0===o?void 0:o.message)},r,j))}})}})},te=function(e){return null==e||""===e},re=function(e){return null!=e&&""!==e},ne=function(e){return te(e)?"":new Intl.NumberFormat("el-GR",{style:"currency",currency:"EUR"}).format(e)},oe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!te(e))return new Intl.NumberFormat("el-GR",{minimumFractionDigits:t,maximumFractionDigits:t}).format(e)},ie=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors"],le=function(r){var i=r.form,l=r.name,a=r.label,u=r.required,c=void 0!==u&&u,d=r.disabled,s=void 0!==d&&d,m=r.options,f=void 0===m?[]:m,v=r.valueKey,p=void 0===v?"id":v,h=r.labelKey,b=void 0===h?"label":h,E=r.maxLength,x=void 0===E?255:E,y=r.autofocus,w=void 0!==y&&y,C=r.noOptionsText,S=void 0===C?"Δεν υπάρχουν επιλογές":C,q=r.showErrors,W=void 0===q||q,L=_(r,ie),k=Y(e.useState([]),2),T=k[0],O=k[1],P=i.watch(l);e.useEffect((function(){O(f.filter((function(e){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";return Boolean(t.find((function(t){return t[r]===e[r]})))}(e,P)})))}),[P]);var V=i.control,R=i.formState.errors;return e.createElement(g,{name:l,control:V,rules:{required:c,disabled:s},render:function(r){var i=r.field,u=i.onChange,d=i.onBlur;return i.value,e.createElement(n,{multiple:!0,value:T,required:c,onChange:function(e,t){return u(t)},options:f,isOptionEqualToValue:function(e,t){return e[p]===t[p]},noOptionsText:S,renderTags:function(t,r){return t.map((function(t,n){return e.createElement(o,N({variant:"outlined",label:t[b],size:"small"},r({index:n})))}))},renderInput:function(r){var n,o;return e.createElement(t,N({label:a,required:c,disabled:s,autoFocus:w,inputProps:{maxLength:x},error:W&&Boolean(null===(n=R[l])||void 0===n?void 0:n.message),onBlur:d,variant:"outlined",fullWidth:!0,helperText:W&&(null===(o=R[l])||void 0===o?void 0:o.message)},r,L))}})}})},ae=["form","name","label","optionsUrl","renderOption","valueKey","labelKey","minChars","required","disabled","maxLength","autofocus","loadingText","noOptionsText","placeholder","size","onChange","showErrors","readonly","readonlyBackgroundColor","bold"],ue=e.forwardRef((function(r,o){var i=r.form,l=r.name,a=r.label,u=r.optionsUrl,c=r.renderOption,d=void 0===c?null:c,s=r.valueKey,m=void 0===s?"id":s,f=r.labelKey,v=void 0===f?"label":f,p=r.minChars,h=void 0===p?2:p,b=r.required,E=void 0!==b&&b,x=r.disabled,y=void 0!==x&&x,w=r.maxLength,C=void 0===w?255:w,q=r.autofocus,W=void 0!==q&&q,L=r.loadingText,k=void 0===L?"Ανάκτηση...":L,T=r.noOptionsText,O=void 0===T?"Δεν υπάρχουν επιλογές":T,P=r.placeholder,V=void 0===P?"":P,R=r.size,j=void 0===R?"medium":R,z=r.onChange,B=void 0===z?null:z,K=r.showErrors,F=void 0===K||K,D=r.readonly,M=void 0!==D&&D,A=r.readonlyBackgroundColor,H=void 0===A?"#dddddd":A,U=r.bold,X=void 0!==U&&U,$=_(r,ae),Z=Y(e.useState(null),2),J=Z[0],Q=Z[1],ee=Y(e.useState([]),2),te=ee[0],re=ee[1],ne=Y(e.useState(!1),2),oe=ne[0],ie=ne[1];e.useImperativeHandle(o,(function(){return{setValue:function(e){function t(){return(t=I(G().mark((function t(){var r;return G().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return ie(!0),t.next=3,S.get("".concat(u,"?id=").concat(e));case 3:r=t.sent,re(r.data),Q(r.data.find((function(e){return e[m]===i.getValues(l)}))||null),ie(!1);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}i.setValue(l,e),function(){t.apply(this,arguments)}()}}}));var le=i.control,ue=i.formState.errors;e.useEffect((function(){if(i.getValues(l)){var e=function(){var e=I(G().mark((function e(){var t;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ie(!0),e.next=3,S.get("".concat(u,"?id=").concat(i.getValues(l)));case 3:t=e.sent,re(t.data),Q(t.data.find((function(e){return e[m]===i.getValues(l)}))||null),ie(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}}),[]);var ce=function(){var e=I(G().mark((function e(t,r){var n;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r||re([]),!(r.length<h)){e.next=3;break}return e.abrupt("return");case 3:return ie(!0),e.next=6,S.get("".concat(u,"?id=").concat(t||"","&token=").concat(r||""));case 6:n=e.sent,re(n.data),ie(!1);case 9:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),de=function(e,t){ce(i.getValues(l),t)};return e.createElement(g,{name:l,control:le,rules:{required:E,disabled:y},render:function(r){var o,i,u,c=r.field,s=c.onChange,f=c.onBlur;return c.value,M?e.createElement(t,{size:j,label:a,fullWidth:!0,required:E,slotProps:{input:{maxLength:C,readOnly:M,sx:{fontWeight:X?"bold":"",backgroundColor:M?H:""}}},value:J?J.label:""}):e.createElement(n,{value:J,options:te,onInputChange:(o=de,i=300,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];u&&clearTimeout(u),u=setTimeout((function(){o.apply(void 0,t)}),i)}),onChange:function(e,t){Q(t),s(t?t[m]:null),B&&B(t?t[m]:null)},isOptionEqualToValue:function(e,t){return e[m]===t[m]},getOptionLabel:function(e){return e[v]},filterOptions:function(e){return e},noOptionsText:O,loadingText:k,loading:oe,required:E,size:j,renderInput:function(r){var n,o;return e.createElement(t,N({label:a,required:E,disabled:y,autoFocus:W,placeholder:V,error:F&&Boolean(null===(n=ue[l])||void 0===n?void 0:n.message),onBlur:f,variant:"outlined",fullWidth:!0,helperText:F&&(null===(o=ue[l])||void 0===o?void 0:o.message),size:j,maxLength:C},r,$))},renderOption:function(t,r,n){return d?d(t,r,n):e.createElement("li",N({},t,{key:r[m]}),r[v])}})}})})),ce=["form","name","label","rows","required","disabled","autofocus","showErrors"],de=function(r){var n=r.form,o=r.name,i=r.label,l=r.rows,a=void 0===l?5:l,u=r.required,c=void 0!==u&&u,d=r.disabled,s=void 0!==d&&d,m=r.autofocus,f=void 0!==m&&m,v=r.showErrors,p=void 0===v||v,h=_(r,ce),b=n.control,E=n.formState.errors;return e.createElement(g,{name:o,control:b,rules:{required:c,disabled:s},render:function(r){var n,l,u=r.field,d=u.onChange,m=u.onBlur,v=u.value;return e.createElement(t,N({required:c,label:i,value:v,multiline:!0,minRows:a,maxRows:a,onChange:d,onBlur:m,error:p&&Boolean(null===(n=E[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:p&&(null===(l=E[o])||void 0===l?void 0:l.message),variant:"outlined",disabled:s,autoFocus:f},h))}})},se=["form","name","label","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],me=function(r){var n=r.form,o=r.name,i=r.label,l=r.required,a=void 0!==l&&l,u=r.disabled,c=void 0!==u&&u;r.autofocus;var d=r.showErrors,s=void 0===d||d,m=r.readonly,f=void 0!==m&&m,v=r.readonlyBackgroundColor,p=void 0===v?"#dddddd":v,h=r.bold,b=void 0!==h&&h,E=_(r,se),x=n.control,y=n.formState.errors,w=function(e,t){""===e.value?n.setValue(o,null):n.setValue(o,e.floatValue)};return e.createElement(g,{name:o,control:x,rules:{required:a,disabled:c},render:function(r){var n,l,u=r.field;u.onChange,u.onBlur;var d=u.value;return e.createElement(q,N({customInput:t,variant:"outlined",label:i,required:a,disabled:c,value:d,thousandSeparator:".",decimalSeparator:",",decimalScale:2,fixedDecimalScale:!0,allowNegative:!1,onValueChange:w,error:s&&Boolean(null===(n=y[o])||void 0===n?void 0:n.message),helperText:s&&(null===(l=y[o])||void 0===l?void 0:l.message),fullWidth:!0,slotProps:{input:{readOnly:f,sx:{fontWeight:b?"bold":"",backgroundColor:f?p:""}}}},E))}})},fe=["form","name","label","required","disabled","autofocus","showErrors","ampm","singleTimeColumn","hoursStep","minutesStep","secondsStep"],ve=function(t){var r=t.form,n=t.name,o=t.label,i=t.required,l=void 0!==i&&i,a=t.disabled,u=void 0!==a&&a;t.autofocus;var c=t.showErrors,d=void 0===c||c,s=t.ampm,m=void 0!==s&&s,f=t.singleTimeColumn,v=void 0===f||f,p=t.hoursStep,h=void 0===p?1:p,b=t.minutesStep,E=void 0===b?15:b,x=t.secondsStep,y=void 0===x?30:x,w=_(t,fe),S=r.control,q=r.formState.errors;return e.createElement(L,{dateAdapter:W,adapterLocale:V,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"},fieldClearLabel:"Καθαρισμός"}},e.createElement(g,{name:n,control:S,rules:{required:l,disabled:u},render:function(t){var r,i,a=t.field;return e.createElement(k,{label:o,value:a.value?C(a.value):null,format:"dd/MM/yyyy HH:mm",inputFormat:!0,views:v?["year","month","day","hours"]:["year","month","day","hours","minutes"],ampm:m,onChange:function(e){return a.onChange(e)},viewRenderers:v?{hours:T}:null,timeSteps:{hours:h,minutes:E,seconds:y},slotProps:{field:{clearable:!0,onClear:function(){return a.onChange(null)}},textField:H(H({},w),{},{required:l,error:d&&Boolean(null===(r=q[n])||void 0===r?void 0:r.message),helperText:d&&(null===(i=q[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},pe=["form","name","label","required","disabled","autofocus","showErrors"],he=function(t){var r=t.form,n=t.name,o=t.label,i=t.required,l=void 0!==i&&i,a=t.disabled,u=void 0!==a&&a;t.autofocus;var c=t.showErrors,d=void 0===c||c,s=_(t,pe),m=r.control,f=r.formState.errors;return e.createElement(L,{dateAdapter:W,adapterLocale:V,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldClearLabel:"Καθαρισμός"}},e.createElement(g,{name:n,control:m,rules:{required:l,disabled:u},render:function(t){var r,i,a=t.field;return e.createElement(O,{label:o,value:a.value?C(a.value):null,format:"dd/MM/yyyy",inputFormat:!0,onChange:function(e){return a.onChange(e)},slotProps:{field:{clearable:!0,onClear:function(){return a.onChange(null)}},textField:H(H({},s),{},{required:l,error:d&&Boolean(null===(r=f[n])||void 0===r?void 0:r.message),helperText:d&&(null===(i=f[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},be=["form","name","label","allowNegative","required","disabled","autofocus","showErrors"],ge=function(r){var n=r.form,o=r.name,i=r.label,l=r.allowNegative,a=void 0!==l&&l,u=r.required,c=void 0!==u&&u,d=r.disabled,s=void 0!==d&&d,m=r.autofocus,f=void 0!==m&&m,v=r.showErrors,p=void 0===v||v,h=_(r,be),b=n.control,E=n.formState.errors,x=function(e,t){""===e.value?n.setValue(o,null):n.setValue(o,e.floatValue)};return e.createElement(g,{name:o,control:b,rules:{required:c,disabled:s},render:function(r){var n,l,u=r.field;u.onChange,u.onBlur;var d=u.value;return e.createElement(q,N({customInput:t,variant:"outlined",label:i,required:c,disabled:s,value:d,thousandSeparator:!1,decimalSeparator:",",decimalScale:0,fixedDecimalScale:!0,allowNegative:a,onValueChange:x,error:p&&Boolean(null===(n=E[o])||void 0===n?void 0:n.message),helperText:p&&(null===(l=E[o])||void 0===l?void 0:l.message),fullWidth:!0,autoFocus:f},h))}})},Ee=["form","name","label","required","disabled","showErrors"],xe=function(r){var n=r.form,o=r.name,a=r.label,u=r.required,c=void 0!==u&&u,d=r.disabled,s=void 0!==d&&d,m=r.showErrors,f=void 0===m||m,v=_(r,Ee),p=Y(e.useState(),2),h=p[0],b=p[1],E=e.useRef(null),x=n.control,y=n.formState.errors,w=function(){E.current.value=null,E.current.click()};return e.createElement(e.Fragment,null,e.createElement(g,{name:o,control:x,rules:{required:c,disabled:s},render:function(r){var u,d,m=r.field;return m.onChange,m.onBlur,m.value,e.createElement(t,N({sx:{input:{cursor:"pointer"}},onClick:w,required:c,label:a,value:h?h.name:"",error:f&&Boolean(null===(u=y[o])||void 0===u?void 0:u.message),fullWidth:!0,helperText:f&&(null===(d=y[o])||void 0===d?void 0:d.message),variant:"outlined",disabled:s,InputProps:{endAdornment:h&&e.createElement(i,{position:"end"},e.createElement(l,{onClick:function(e){return function(e){e.stopPropagation(),b(null),n.setValue(o,null)}(e)}},e.createElement(R,null))),readOnly:!0}},v))}}),e.createElement("input",{type:"file",ref:E,style:{display:"none"},onChange:function(e){return function(e){b(e),n.setValue(o,e,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0})}(e.currentTarget.files[0])}}))},ye=["form","name","label","ampm","hoursStep","minutesStep","secondsStep","singleTimeColumn","required","disabled","autofocus","showErrors"],we=function(t){var r=t.form,n=t.name,o=t.label,i=t.ampm,l=void 0!==i&&i,a=t.hoursStep,u=void 0===a?1:a,c=t.minutesStep,d=void 0===c?15:c,s=t.secondsStep,m=void 0===s?30:s,f=t.singleTimeColumn,v=void 0===f||f,p=t.required,h=void 0!==p&&p,b=t.disabled,E=void 0!==b&&b;t.autofocus;var x=t.showErrors,y=void 0===x||x,w=_(t,ye),S=r.control,q=r.formState.errors;return e.createElement(L,{dateAdapter:W,adapterLocale:V,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"}}},e.createElement(g,{name:n,control:S,rules:{required:h,disabled:E},render:function(t){var r,i,a=t.field;return e.createElement(P,{label:o,value:a.value?C(a.value):null,format:"HH:mm",inputFormat:!0,views:v?["hours"]:["hours","minutes"],ampm:l,onChange:function(e){return a.onChange(e)},viewRenderers:v?{hours:T}:null,timeSteps:{hours:u,minutes:d,seconds:m},slotProps:{textField:H(H({},w),{},{required:h,error:y&&Boolean(null===(r=q[n])||void 0===r?void 0:r.message),helperText:y&&(null===(i=q[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},Ce=function(t){var n=t.open,o=t.title,i=t.label,l=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,W=t.requiredMessage,L=void 0===W?"Υποχρεωτικό πεδίο":W,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,O=t.cancelLabel,P=void 0===O?"ΑΚΥΡΩΣΗ":O,V=t.maxLength,R=void 0===V?255:V,z=t.message,B=void 0===z?null:z,K=t.isLoading,F=void 0!==K&&K,D={text:l||""},I=y.object({text:q?y.string().max(R,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(R," χαρακτήρες")).required(L):y.string().max(R)}),M=E({defaultValues:D,resolver:x(I)});e.useEffect((function(){n&&(M.reset(D),M.clearErrors())}),[n,l]);return e.createElement(a,{fullWidth:!0,maxWidth:C,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),B&&"string"==typeof B?e.createElement(r,{variant:"caption",color:"text.secondary"},B):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:M.handleSubmit((function(e){return b(e.text)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},B&&"string"!=typeof B&&e.createElement(s,{sx:{mb:2}},B),e.createElement(X,{form:M,name:"text",label:i,required:q,autofocus:!0,maxLength:R,sx:{mt:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(p,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},P),e.createElement(p,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},F?e.createElement(h,{size:20,sx:{color:"inherit"}}):T))))},Se=/^$|^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,qe=function(t){var n=t.open,o=t.title,i=t.label,l=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,W=t.requiredMessage,L=void 0===W?"Υποχρεωτικό πεδίο":W,k=t.invalidMessage,T=void 0===k?"Μη έγκυρη μορφή email":k,O=t.okLabel,P=void 0===O?"ΚΑΤΑΧΩΡΗΣΗ":O,V=t.cancelLabel,R=void 0===V?"ΑΚΥΡΩΣΗ":V,z=t.maxLength,B=void 0===z?255:z,K=t.message,F=void 0===K?null:K,D=t.isLoading,I=void 0!==D&&D,M={email:l||""},N=y.object({email:q?y.string().matches(Se,T).required(L):y.string().matches(Se,T)}),A=E({defaultValues:M,resolver:x(N)});e.useEffect((function(){n&&(A.reset(M),A.clearErrors())}),[n,l]);return e.createElement(a,{fullWidth:!0,maxWidth:C,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),F&&"string"==typeof F?e.createElement(r,{variant:"caption",color:"text.secondary"},F):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:A.handleSubmit((function(e){return b(e.email)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},F&&"string"!=typeof F&&e.createElement(s,{sx:{mb:2}},F),e.createElement(Z,{form:A,label:i,required:q,autofocus:!0,maxLength:B,sx:{marginTop:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(p,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},R),e.createElement(p,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},I?e.createElement(h,{size:20,sx:{color:"inherit"}}):P))))};!function(e,t){void 0===t&&(t={});var r=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".chrome-picker {\r\n -webkit-box-shadow: none !important;\r\n -moz-box-shadow: none !important;\r\n box-shadow: none !important;\r\n}");var We=function(t){var r=t.open,n=t.onSubmit,o=t.onCancel,i=t.title,l=void 0===i?"Επιλογή Χρώματος":i,u=t.color,s=void 0===u?"#000000":u,m=t.pickerWidth,h=void 0===m?350:m,b=t.selectionTextColor,g=void 0===b?"white":b,E=t.paddingY,x=void 0===E?"10px":E,y=t.paddingX,C=void 0===y?"10px":y,S=t.okLabel,q=void 0===S?"ΚΑΤΑΧΩΡΗΣΗ":S,W=t.cancelLabel,L=void 0===W?"ΑΚΥΡΩΣΗ":W;t.isLoading;var k=Y(e.useState("#000000"),2),T=k[0],O=k[1];e.useEffect((function(){r&&O(s)}),[r,s]);return e.createElement(a,{open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),form.handleSubmit(n)())}},e.createElement(c,null,l),e.createElement(f,null,e.createElement(d,{gap:2},e.createElement(J,{color:g,backgroundColor:T,paddingX:C,paddingY:x,label:T}),e.createElement(w,{width:h,color:T,onChange:function(e){return O(e.hex)}}))),e.createElement(v,null,e.createElement(p,{color:"success",onClick:function(){return n(T)}},q),e.createElement(p,{color:"error",onClick:function(){return o()}},L)))},Le=function(t){var n=t.open,o=t.title,i=t.label,l=t.value,b=t.onSubmit,g=t.onCancel,w=t.options,C=void 0===w?[]:w,S=t.valueKey,q=void 0===S?"id":S,W=t.labelKey,L=void 0===W?"label":W,k=t.required,T=void 0===k||k,O=t.size,P=void 0===O?"sm":O,V=t.requiredMessage,R=void 0===V?"Υποχρεωτικό πεδίο":V,z=t.okLabel,B=void 0===z?"ΚΑΤΑΧΩΡΗΣΗ":z,K=t.cancelLabel,F=void 0===K?"ΑΚΥΡΩΣΗ":K,D=t.message,I=void 0===D?null:D,M=t.isLoading,N=void 0!==M&&M,A={field:l||null},H=y.object({field:T?y.string().required(R):y.string().nullable()}),_=E({defaultValues:A,resolver:x(H)});e.useEffect((function(){n&&(_.reset(A),_.clearErrors())}),[n,l]);return e.createElement(a,{fullWidth:!0,maxWidth:P,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),I&&"string"==typeof I?e.createElement(r,{variant:"caption",color:"text.secondary"},I):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:_.handleSubmit((function(e){return b(e)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},e.createElement(ee,{form:_,name:"field",label:i,options:C,valueKey:q,labelKey:L,required:T,autofocus:!0,size:"medium",sx:{marginTop:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(p,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},F),e.createElement(p,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},N?e.createElement(h,{size:20,sx:{color:"inherit"}}):B))))},ke=function(t){var n=t.open,o=t.title,i=t.label,l=t.value,b=void 0===l?[]:l,g=t.onSubmit,w=t.onCancel,C=t.options,S=void 0===C?[]:C,q=t.valueKey,W=void 0===q?"id":q,L=t.labelKey,k=void 0===L?"label":L,T=t.required,O=void 0===T||T,P=t.size,V=void 0===P?"sm":P,R=t.requiredMessage,z=void 0===R?"Επιλέξτε τουλάχιστον μία τιμή":R,B=t.okLabel,K=void 0===B?"ΚΑΤΑΧΩΡΗΣΗ":B,F=t.cancelLabel,D=void 0===F?"ΑΚΥΡΩΣΗ":F,I=t.message,M=void 0===I?null:I,N=t.isLoading,A=void 0!==N&&N,H={field:b||[]},_=y.object({field:O?y.array().min(1,z):y.array()}),G=E({defaultValues:H,resolver:x(_)});e.useEffect((function(){n&&(G.reset(H),G.clearErrors())}),[n,b]);return e.createElement(a,{fullWidth:!0,maxWidth:V,open:n,onClose:function(e,t){"escapeKeyDown"===t&&w()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),M&&"string"==typeof M?e.createElement(r,{variant:"caption",color:"text.secondary"},M):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:G.handleSubmit((function(e){return g(e)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},M&&"string"!=typeof M&&e.createElement(s,{sx:{mb:2}},M),e.createElement(le,{form:G,name:"field",label:i,options:S,valueKey:W,labelKey:k,required:O,autofocus:!0,sx:{marginTop:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(p,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),w()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},D),e.createElement(p,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},A?e.createElement(h,{size:20,sx:{color:"inherit"}}):K))))},Te=function(t){var r=t.open,n=t.title,o=t.message,i=t.onConfirm,l=t.onCancel,d=t.confirmText,m=void 0===d?"ΕΠΙΒΕΒΑΙΩΣΗ":d,g=t.cancelText,E=void 0===g?"ΑΚΥΡΩΣΗ":g,x=t.isLoading,y=void 0!==x&&x,w=t.type,C=void 0===w?"warning":w,S={warning:{color:"warning.main",icon:e.createElement(z,{sx:{fontSize:40}})},error:{color:"error.main",icon:e.createElement(B,{sx:{fontSize:40}})},success:{color:"success.main",icon:e.createElement(K,{sx:{fontSize:40}})}}[C]||{color:"primary.main",icon:null};return e.createElement(a,{open:r,onClose:function(e,t){"backdropClick"!==t&&l()},slots:{transition:u},slotProps:{backdrop:{sx:{backgroundColor:"rgba(0, 0, 0, 0.4)",backdropFilter:"blur(4px)"}},paper:{sx:{borderRadius:4,padding:1,maxWidth:400,textAlign:"center",backgroundImage:"none"}}}},e.createElement(s,{sx:{display:"flex",flexDirection:"column",alignItems:"center",mt:3}},e.createElement(s,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:70,height:70,bgcolor:"".concat(S.color,"20"),color:S.color,borderRadius:"50%",mb:2}},S.icon),e.createElement(c,{sx:{fontWeight:800,fontSize:"1.35rem",pt:0,pb:1}},n)),e.createElement(f,null,e.createElement(b,{sx:{color:"text.secondary",fontWeight:500,lineHeight:1.6}},o)),e.createElement(v,{sx:{justifyContent:"center",gap:2,px:3,pb:3,mt:1}},e.createElement(p,{fullWidth:!0,variant:"text",color:"inherit",onClick:l,sx:{borderRadius:3,fontWeight:700,color:"text.disabled"}},E),e.createElement(p,{fullWidth:!0,variant:"contained",disableElevation:!0,color:"error"===C?"error":"primary",onClick:i,sx:{borderRadius:3,fontWeight:700,py:1}},y?e.createElement(h,{size:20,sx:{color:"inherit"}}):m)))},Oe=function(t){var n=t.open,o=t.title,i=t.label,l=t.message,b=void 0===l?null:l,g=t.value,w=t.onSubmit,C=t.onCancel,S=t.size,q=void 0===S?"sm":S,W=t.rows,L=void 0===W?5:W,k=t.required,T=void 0!==k&&k,O=t.requiredMessage,P=void 0===O?"Υποχρεωτικό πεδίο":O,V=t.okLabel,R=void 0===V?"ΚΑΤΑΧΩΡΗΣΗ":V,z=t.cancelLabel,B=void 0===z?"ΑΚΥΡΩΣΗ":z,K=t.isLoading,F=void 0!==K&&K,D={notes:g||""},I=y.object({notes:T?y.string().required(P):y.string()}),M=E({defaultValues:D,resolver:x(I)});e.useEffect((function(){n&&(M.reset(D),M.clearErrors())}),[n,g]);return e.createElement(a,{fullWidth:!0,maxWidth:q,open:n,onClose:function(e,t){"escapeKeyDown"===t&&C()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),b&&"string"==typeof b?e.createElement(r,{variant:"caption",color:"text.secondary"},b):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:M.handleSubmit((function(e){return w(e.notes)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},b&&"string"!=typeof b&&e.createElement(s,{sx:{mb:2}},b),e.createElement(de,{form:M,name:"notes",label:i,required:T,rows:L,autofocus:!0,sx:{marginTop:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(p,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),C()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},B),e.createElement(p,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},F?e.createElement(h,{size:20,sx:{color:"inherit"}}):R))))},Pe=function(t){var n=t.open,o=t.title,i=t.label,l=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,W=t.minValue,L=void 0===W?null:W,k=t.maxValue,T=void 0===k?null:k,O=t.requiredMessage,P=void 0===O?"Υποχρεωτικό πεδίο":O,V=t.okLabel,R=void 0===V?"ΚΑΤΑΧΩΡΗΣΗ":V,z=t.cancelLabel,B=void 0===z?"ΑΚΥΡΩΣΗ":z,K=t.message,F=void 0===K?null:K,D=t.isLoading,I=void 0!==D&&D,M={poso:re(l)?l:null},N=y.object({poso:y.number().when([],{is:function(e){return q},then:function(e){return e.required(P)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==L},then:function(e){return e.min(L,"Το ποσό πρέπει να είναι μεγαλύτερο ή ίσο από ".concat(ne(L)))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==T},then:function(e){return e.max(T,"Το ποσό πρέπει να είναι μικρότερο ή ίσο από ".concat(ne(T)))},otherwise:function(e){return e}})}),A=E({defaultValues:M,resolver:x(N)});e.useEffect((function(){n&&(A.reset(M),A.clearErrors())}),[n,l]);return e.createElement(a,{fullWidth:!0,maxWidth:C,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),F&&"string"==typeof F?e.createElement(r,{variant:"caption",color:"text.secondary"},F):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:A.handleSubmit((function(e){return b(e.poso)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},e.createElement(me,{form:A,name:"poso",label:i,required:q,autofocus:!0,sx:{marginTop:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(p,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},B),e.createElement(p,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},I?e.createElement(h,{size:20,sx:{color:"inherit"}}):R))))},Ve=function(t){var n=t.open,o=t.title,i=t.label,l=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,W=t.requiredMessage,L=void 0===W?"Υποχρεωτικό πεδίο":W,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,O=t.cancelLabel,P=void 0===O?"ΑΚΥΡΩΣΗ":O,V=t.message,R=void 0===V?null:V,z=t.isLoading,B=void 0!==z&&z,K={datetime:l},F=y.object({datetime:q?y.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").required(L):y.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").nullable()}),D=E({defaultValues:K,resolver:x(F)});e.useEffect((function(){n&&(D.reset(K),D.clearErrors())}),[n,l]);return e.createElement(a,{fullWidth:!0,maxWidth:C,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),R&&"string"==typeof R?e.createElement(r,{variant:"caption",color:"text.secondary"},R):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:D.handleSubmit((function(e){return b(e.datetime)})),noValidate:!0},e.createElement(f,null,R&&"string"!=typeof R&&e.createElement(s,{sx:{mb:2}},R),e.createElement(ve,{form:D,name:"datetime",label:i,required:q,autofocus:!0,sx:{marginTop:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(p,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},P),e.createElement(p,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},B?e.createElement(h,{size:20,sx:{color:"inherit"}}):T))))},Re=function(t){var n=t.open,o=t.title,i=t.label,l=t.value,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,W=t.requiredMessage,L=void 0===W?"Υποχρεωτικό πεδίο":W,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,O=t.cancelLabel,P=void 0===O?"ΑΚΥΡΩΣΗ":O,V=t.message,R=void 0===V?null:V,z=t.isLoading,B=void 0!==z&&z,K={datetime:l},F=y.object({datetime:q?y.date().typeError("Μη έγκυρη μορφή ημερομηνίας").required(L):y.date().typeError("Μη έγκυρη μορφή ημερομηνίας").nullable()}),D=E({defaultValues:K,resolver:x(F)});e.useEffect((function(){n&&(D.reset(K),D.clearErrors())}),[n,l]);return e.createElement(a,{fullWidth:!0,maxWidth:C,open:n,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),R&&"string"==typeof R?e.createElement(r,{variant:"caption",color:"text.secondary"},R):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:D.handleSubmit((function(e){return b(e.datetime)})),noValidate:!0},e.createElement(f,null,R&&"string"!=typeof R&&e.createElement(s,{sx:{mb:2}},R),e.createElement(he,{form:D,name:"datetime",label:i,required:q,autofocus:!0,sx:{marginTop:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(p,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},P),e.createElement(p,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},B?e.createElement(h,{size:20,sx:{color:"inherit"}}):T))))},je=[{id:!0,label:"ΝΑΙ"},{id:!1,label:"ΟΧΙ"}],ze=function(t){var n=t.open,o=t.title,i=t.label,l=t.value,u=t.onSubmit,d=t.onCancel,s=t.required,m=void 0===s||s,h=t.info,b=void 0===h?"":h,g=t.size,w=void 0===g?"sm":g,C=t.requiredMessage,S=void 0===C?"Υποχρεωτικό πεδίο":C,q=t.okLabel,W=void 0===q?"ΚΑΤΑΧΩΡΗΣΗ":q,L=t.cancelLabel,k=void 0===L?"ΑΚΥΡΩΣΗ":L,T={field:l||null},O=y.object({field:m?y.boolean().required(S):y.boolean().nullable()}),P=E({defaultValues:T,resolver:x(O)});return e.useEffect((function(){n&&(P.clearErrors(),P.setValue("field",l,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[n,l]),e.createElement(a,{fullWidth:!0,maxWidth:w,open:n,onClose:function(){}},e.createElement(c,null,o),e.createElement(f,null,b&&e.createElement(r,null,b),e.createElement(ee,{form:P,name:"field",label:i,options:je,valueKey:"id",labelKey:"label",required:m,autofocus:!0,size:"medium",sx:{marginTop:2}})),e.createElement(v,null,e.createElement(p,{color:"success",onClick:P.handleSubmit((function(e){return u(e.field)}))},W),e.createElement(p,{color:"error",onClick:function(){return d()}},k)))},Be=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,l=t.onSubmit,u=t.onCancel,d=t.allowNegative,s=void 0!==d&&d,m=t.required,h=void 0===m||m,b=t.requiredMessage,g=void 0===b?"Υποχρεωτικό πεδίο":b,w=t.size,C=void 0===w?"sm":w,S=t.minValue,q=void 0===S?null:S,W=t.maxValue,L=void 0===W?null:W,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,O=t.cancelLabel,P=void 0===O?"ΑΚΥΡΩΣΗ":O;t.isLoading;var V={num:re(i)?i:null},R=y.object({num:y.number().when([],{is:function(e){return h},then:function(e){return e.required(g)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==q},then:function(e){return e.min(q,"Η τιμή πρέπει να είναι μεγαλύτερη ή ίση από ".concat(q))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==L},then:function(e){return e.max(L,"Η τιμή πρέπει να είναι μικρότερη ή ίση από ".concat(L))},otherwise:function(e){return e}})}),j=E({defaultValues:V,resolver:x(R)});return e.useEffect((function(){r&&(j.clearErrors(),j.setValue("num",re(i)?i:null,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,i]),e.createElement(a,{fullWidth:!0,maxWidth:C,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),j.handleSubmit((function(e){return l(e.num)}))())},disableRestoreFocus:!0},e.createElement(c,null,n),e.createElement(f,null,e.createElement(ge,{form:j,name:"num",label:o,required:h,autofocus:!0,allowNegative:s,sx:{marginTop:2}})),e.createElement(v,null,e.createElement(p,{color:"success",onClick:j.handleSubmit((function(e){return l(e.num)}))},T),e.createElement(p,{color:"error",onClick:function(){return u()}},P)))},Ke=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,l=t.decimals,u=void 0===l?2:l,d=t.minValue,s=void 0===d?null:d,m=t.maxValue,h=void 0===m?null:m,b=t.onSubmit,g=t.onCancel,w=t.size,C=void 0===w?"sm":w,S=t.required,q=void 0===S||S,W=t.requiredMessage,L=void 0===W?"Υποχρεωτικό πεδίο":W,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,O=t.cancelLabel,P=void 0===O?"ΑΚΥΡΩΣΗ":O;t.isLoading;var V={field:re(i)?i:null},R=y.object({field:y.number().when([],{is:function(e){return q},then:function(e){return e.required(L)},otherwise:function(e){return e.nullable(!0)}}).when([],{is:function(e){return null!==s},then:function(e){return e.min(s,"Η τιμή πρέπει να είναι μεγαλύτερη ή ίση από ".concat(oe(s,u)))},otherwise:function(e){return e}}).when([],{is:function(e){return null!==h},then:function(e){return e.max(h,"Η τιμή πρέπει να είναι μικρότερη ή ίση από ".concat(oe(h,u)))},otherwise:function(e){return e}})}),j=E({defaultValues:V,resolver:x(R)});return e.useEffect((function(){r&&(j.clearErrors(),j.setValue("field",re(i)?i:null,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,i]),e.createElement(a,{fullWidth:!0,maxWidth:C,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),j.handleSubmit((function(e){return b(e.field)}))())},disableRestoreFocus:!0},e.createElement(c,null,n),e.createElement(f,null,e.createElement(me,{form:j,name:"field",label:o,required:q,autofocus:!0,sx:{marginTop:2}})),e.createElement(v,null,e.createElement(p,{color:"success",onClick:j.handleSubmit((function(e){return b(e.field)}))},T),e.createElement(p,{color:"error",onClick:function(){return g()}},P)))},Fe=function(t){var r=t.open,n=t.title,o=t.message,i=t.onClose,l=t.closeText,u=void 0===l?"ΟΚ":l;return e.createElement(a,{open:r,onClose:function(){}},e.createElement(c,null,n),e.createElement(f,null,e.createElement(b,null,o)),e.createElement(v,null,e.createElement(p,{color:"primary",onClick:function(e){e.stopPropagation(),i()}},u)))},De=function(t){var r=t.open,n=t.title,o=void 0===n?"Νέο Αρχείο":n,i=t.description,l=void 0===i||i,u=t.descriptionLabel,s=void 0===u?"Περιγραφή Αρχείου":u,m=t.fileSelectLabel,h=void 0===m?"Επιλογή Αρχείου":m,b=t.maxFileName,g=void 0===b?255:b,w=t.onSubmit,C=t.onCancel;t.isLoading;var S=y.object({descr:l?y.string().required("Παρακαλώ συμπληρώστε την περιγραφή του αρχείου").max(g,"Η περιγραφή δεν πρέπει να υπερβαίνει τους ".concat(g," χαρακτήρες")):y.string(),filename:y.mixed().required("Παρακαλώ επιλέξτε ένα αρχείο")}),q=E({defaultValues:{descr:"",filename:null},resolver:x(S)});return e.useEffect((function(){r&&(q.clearErrors(),q.setValue("descr",""),q.setValue("filename",null))}),[r]),e.createElement(a,{maxWidth:"sm",fullWidth:!0,open:r,onClose:function(){}},e.createElement(c,null,o),e.createElement(f,null,e.createElement(d,{sx:{marginTop:2},gap:3},l&&e.createElement(X,{form:q,name:"descr",label:s,required:!0,autofocus:!0}),e.createElement(xe,{form:q,name:"filename",label:h,required:!0}))),e.createElement(v,null,e.createElement(p,{color:"success",onClick:q.handleSubmit(w)},"ΚΑΤΑΧΩΡΗΣΗ"),e.createElement(p,{color:"error",onClick:function(){return C()}},"ΑΚΥΡΩΣΗ")))},Ie=function(t){var n=t.open,o=t.title,i=t.label,l=t.optionsUrl,b=t.value,g=t.onSubmit,w=t.onCancel,C=t.valueKey,S=void 0===C?"id":C,q=t.labelKey,W=void 0===q?"label":q,L=t.required,k=void 0===L||L,T=t.size,O=void 0===T?"sm":T,P=t.requiredMessage,V=void 0===P?"Υποχρεωτικό πεδίο":P,R=t.minChars,z=void 0===R?1:R,B=t.okLabel,K=void 0===B?"ΚΑΤΑΧΩΡΗΣΗ":B,F=t.cancelLabel,D=void 0===F?"ΑΚΥΡΩΣΗ":F,I=t.message,M=void 0===I?null:I,N=t.isLoading,A=void 0!==N&&N,H={field:b||null},_=y.object({field:k?y.string().required(V):y.string().nullable()}),G=E({defaultValues:H,resolver:x(_)});e.useEffect((function(){n&&(G.reset(H),G.clearErrors())}),[n,b]);return e.createElement(a,{fullWidth:!0,maxWidth:O,open:n,onClose:function(e,t){"escapeKeyDown"===t&&w()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(d,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(s,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),M&&"string"==typeof M?e.createElement(r,{variant:"caption",color:"text.secondary"},M):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:G.handleSubmit((function(e){return g(e)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},M&&"string"!=typeof M&&e.createElement(s,{sx:{mb:2}},M),e.createElement(ue,{form:G,name:"field",label:i,optionsUrl:l,minChars:z,valueKey:S,labelKey:W,required:k,autofocus:!0,sx:{marginTop:1}})),e.createElement(v,{sx:{p:2,px:3}},e.createElement(p,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),w()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},D),e.createElement(p,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},A?e.createElement(h,{size:20,sx:{color:"inherit"}}):K))))},Me=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,l=t.onSubmit,u=t.onCancel,d=t.size,s=void 0===d?"sm":d,m=t.required,h=void 0===m||m,b=t.requiredMessage,g=void 0===b?"Υποχρεωτικό πεδίο":b,w=t.okLabel,C=void 0===w?"ΚΑΤΑΧΩΡΗΣΗ":w,S=t.cancelLabel,q=void 0===S?"ΑΚΥΡΩΣΗ":S,W={datetime:i},L=y.object({datetime:h?y.date().typeError("Μη έγκυρη μορφή ώρας").required(g):y.date().typeError("Μη έγκυρη μορφή ώρας")}),k=E({defaultValues:W,resolver:x(L)});return e.useEffect((function(){r&&(k.clearErrors(),k.setValue("datetime",i,{shouldValidate:!1,shouldDirty:!1,shouldTouch:!1}))}),[r,i]),e.createElement(a,{fullWidth:!0,maxWidth:s,open:r,onClose:function(){},onKeyDown:function(e){"Enter"!==e.code&&"NumpadEnter"!==e.code||(e.preventDefault(),k.handleSubmit((function(e){return l(e.datetime)}))())},disableRestoreFocus:!0},e.createElement(c,null,n),e.createElement(f,null,e.createElement(we,{form:k,name:"datetime",label:o,required:h,autofocus:!0,sx:{marginTop:2}})),e.createElement(v,null,e.createElement(p,{color:"success",onClick:k.handleSubmit((function(e){return l(e.datetime)}))},C),e.createElement(p,{color:"error",onClick:function(){return u()}},q)))};export{Ie as AutocompleteApiModalForm,Le as AutocompleteModalForm,ke as AutocompleteMultiModalForm,Te as ConfirmationDialog,Pe as CurrencyModalForm,Re as DateModalForm,Ve as DatetimeModalForm,Ke as DecimalModalForm,qe as EmailModalForm,Be as IntegerModalForm,Fe as MessageDialog,Oe as NotesModalForm,We as PickColorModalForm,De as SelectFileModalForm,Ce as TextModalForm,Me as TimeModalForm,ze as YesNoModalForm};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artibet/react-mui-components",
3
- "version": "3.7.33",
3
+ "version": "3.7.34",
4
4
  "description": "Various react components build with mui library",
5
5
  "main": "./core/index.js",
6
6
  "scripts": {
@@ -1 +1 @@
1
- import e from"react";import{TextField as t,Autocomplete as r,Chip as n,Dialog as o,Zoom as i,DialogTitle as a,Stack as l,Box as s,Typography as c,Divider as d,DialogContent as u,DialogActions as m,Button as f,CircularProgress as v,DialogContentText as p,ListItem as x,Grid2 as b}from"@mui/material";import{router as g}from"@inertiajs/react";import{EditNoteRounded as h,ErrorOutline as E,Edit as y,ToggleOff as S,ToggleOn as W}from"@mui/icons-material";import{Controller as w,useForm as C}from"react-hook-form";import{yupResolver as z}from"@hookform/resolvers/yup";import*as q from"yup";import"react-color";import{format as T,parseISO as L,toDate as k}from"date-fns";import{el as R}from"date-fns/locale";import"axios";import"react-number-format";import{AdapterDateFns as O}from"@mui/x-date-pickers/AdapterDateFnsV3";import{LocalizationProvider as j}from"@mui/x-date-pickers/LocalizationProvider";import{DateTimePicker as I,renderDigitalClockTimeView as P,DatePicker as F}from"@mui/x-date-pickers";import K from"date-fns/locale/el";import B from"@mui/icons-material/WarningAmberRounded";import D from"@mui/icons-material/ErrorOutlineRounded";import M from"@mui/icons-material/CheckCircleOutlineRounded";function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function A(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function H(){return H=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},H.apply(null,arguments)}function N(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?N(Object(r),!0).forEach((function(t){A(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function $(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,l=[],s=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(s=(n=i.call(r)).done)&&(l.push(n.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return V(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?V(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Z=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],G=function(r){var n=r.form,o=r.name,i=r.label,a=r.maxLength,l=void 0===a?255:a,s=r.required,c=void 0!==s&&s,d=r.disabled,u=void 0!==d&&d,m=r.autofocus,f=void 0!==m&&m,v=r.showErrors,p=void 0===v||v,x=r.readonly,b=void 0!==x&&x,g=r.readonlyBackgroundColor,h=void 0===g?"#dddddd":g,E=r.bold,y=void 0!==E&&E,S=$(r,Z),W=n.control,C=n.formState.errors;return e.createElement(w,{name:o,control:W,rules:{required:c,disabled:u},render:function(r){var n,a,s=r.field,d=s.onChange,m=s.onBlur,v=s.value;return e.createElement(t,H({required:c,label:i,value:v,onChange:d,onBlur:m,error:p&&Boolean(null===(n=C[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:p&&(null===(a=C[o])||void 0===a?void 0:a.message),variant:"outlined",disabled:u,autoFocus:f,slotProps:{input:{maxLength:l,readOnly:b,sx:{fontWeight:y?"bold":"",backgroundColor:b?h:""}}}},S))}})},J=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],Q=function(r){var n=r.form,o=r.name,i=void 0===o?"email":o,a=r.label,l=void 0===a?"E-mail":a,s=r.maxLength,c=void 0===s?255:s,d=r.required,u=void 0===d||d,m=r.disabled,f=void 0!==m&&m,v=r.autofocus,p=void 0!==v&&v,x=r.showErrors,b=void 0===x||x,g=r.readonly,h=void 0!==g&&g,E=r.readonlyBackgroundColor,y=void 0===E?"#dddddd":E,S=r.bold,W=void 0!==S&&S,C=$(r,J),z=n.control,q=n.formState.errors;return e.createElement(w,{name:i,control:z,rules:{required:u,disabled:f},render:function(r){var n,o,a=r.field,s=a.onChange,d=a.onBlur,m=a.value;return e.createElement(t,H({required:u,label:l,value:m,onChange:s,onBlur:d,error:b&&Boolean(null===(n=q[i])||void 0===n?void 0:n.message),fullWidth:!0,helperText:b&&(null===(o=q[i])||void 0===o?void 0:o.message),variant:"outlined",disabled:f,autoFocus:p,slotProps:{input:{maxLength:c,readOnly:h,sx:{fontWeight:W?"bold":"",backgroundColor:h?y:""}}}},C))}})},X=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors","size","readonly","readonlyBackgroundColor","bold"],_=function(n){var o=n.form,i=n.name,a=n.label,l=n.required,s=void 0!==l&&l,c=n.disabled,d=void 0!==c&&c,u=n.options,m=void 0===u?[]:u,f=n.valueKey,v=void 0===f?"id":f,p=n.labelKey,x=void 0===p?"label":p,b=n.maxLength,g=void 0===b?255:b,h=n.autofocus,E=void 0!==h&&h,y=n.noOptionsText,S=void 0===y?"Δεν υπάρχουν επιλογές":y,W=n.showErrors,C=void 0===W||W,z=n.size,q=void 0===z?"medium":z,T=n.readonly,L=void 0!==T&&T,k=n.readonlyBackgroundColor,R=void 0===k?"#dddddd":k,O=n.bold,j=void 0!==O&&O,I=$(n,X),P=Y(e.useState(null),2),F=P[0],K=P[1],B=o.watch(i);e.useEffect((function(){K(m.find((function(e){return e[v]===B}))||null)}),[B]);var D=o.control,M=o.formState.errors;return e.createElement(w,{name:i,control:D,rules:{required:s,disabled:d},render:function(n){var o=n.field,l=o.onChange,c=o.onBlur;return o.value,L?e.createElement(t,{size:q,label:a,fullWidth:!0,required:s,slotProps:{input:{maxLength:g,readOnly:L,sx:{fontWeight:j?"bold":"",backgroundColor:L?R:""}}},value:F?F.label:""}):e.createElement(r,{value:F,required:s,onChange:function(e,t){return l(t?t[v]:null)},options:m,isOptionEqualToValue:function(e,t){return e[v]===t[v]},noOptionsText:S,getOptionLabel:function(e){return e[x]},size:q,slotProps:{input:{maxLength:g,sx:{fontWeight:j?"bold":"",color:"red"}}},renderInput:function(r){var n,o;return e.createElement(t,H({label:a,required:s,disabled:d,autoFocus:E,size:q,error:C&&Boolean(null===(n=M[i])||void 0===n?void 0:n.message),onBlur:c,variant:"outlined",fullWidth:!0,helperText:C&&(null===(o=M[i])||void 0===o?void 0:o.message)},r,I))}})}})},ee=function(e){return e?T(L(e,{locale:R}),"dd/MM/yyyy, HH:mm"):""},te=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors"],re=function(o){var i=o.form,a=o.name,l=o.label,s=o.required,c=void 0!==s&&s,d=o.disabled,u=void 0!==d&&d,m=o.options,f=void 0===m?[]:m,v=o.valueKey,p=void 0===v?"id":v,x=o.labelKey,b=void 0===x?"label":x,g=o.maxLength,h=void 0===g?255:g,E=o.autofocus,y=void 0!==E&&E,S=o.noOptionsText,W=void 0===S?"Δεν υπάρχουν επιλογές":S,C=o.showErrors,z=void 0===C||C,q=$(o,te),T=Y(e.useState([]),2),L=T[0],k=T[1],R=i.watch(a);e.useEffect((function(){k(f.filter((function(e){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";return Boolean(t.find((function(t){return t[r]===e[r]})))}(e,R)})))}),[R]);var O=i.control,j=i.formState.errors;return e.createElement(w,{name:a,control:O,rules:{required:c,disabled:u},render:function(o){var i=o.field,s=i.onChange,d=i.onBlur;return i.value,e.createElement(r,{multiple:!0,value:L,required:c,onChange:function(e,t){return s(t)},options:f,isOptionEqualToValue:function(e,t){return e[p]===t[p]},noOptionsText:W,renderTags:function(t,r){return t.map((function(t,o){return e.createElement(n,H({variant:"outlined",label:t[b],size:"small"},r({index:o})))}))},renderInput:function(r){var n,o;return e.createElement(t,H({label:l,required:c,disabled:u,autoFocus:y,inputProps:{maxLength:h},error:z&&Boolean(null===(n=j[a])||void 0===n?void 0:n.message),onBlur:d,variant:"outlined",fullWidth:!0,helperText:z&&(null===(o=j[a])||void 0===o?void 0:o.message)},r,q))}})}})},ne=["form","name","label","rows","required","disabled","autofocus","showErrors"],oe=function(r){var n=r.form,o=r.name,i=r.label,a=r.rows,l=void 0===a?5:a,s=r.required,c=void 0!==s&&s,d=r.disabled,u=void 0!==d&&d,m=r.autofocus,f=void 0!==m&&m,v=r.showErrors,p=void 0===v||v,x=$(r,ne),b=n.control,g=n.formState.errors;return e.createElement(w,{name:o,control:b,rules:{required:c,disabled:u},render:function(r){var n,a,s=r.field,d=s.onChange,m=s.onBlur,v=s.value;return e.createElement(t,H({required:c,label:i,value:v,multiline:!0,minRows:l,maxRows:l,onChange:d,onBlur:m,error:p&&Boolean(null===(n=g[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:p&&(null===(a=g[o])||void 0===a?void 0:a.message),variant:"outlined",disabled:u,autoFocus:f},x))}})},ie=["form","name","label","required","disabled","autofocus","showErrors","ampm","singleTimeColumn","hoursStep","minutesStep","secondsStep"],ae=function(t){var r=t.form,n=t.name,o=t.label,i=t.required,a=void 0!==i&&i,l=t.disabled,s=void 0!==l&&l;t.autofocus;var c=t.showErrors,d=void 0===c||c,u=t.ampm,m=void 0!==u&&u,f=t.singleTimeColumn,v=void 0===f||f,p=t.hoursStep,x=void 0===p?1:p,b=t.minutesStep,g=void 0===b?15:b,h=t.secondsStep,E=void 0===h?30:h,y=$(t,ie),S=r.control,W=r.formState.errors;return e.createElement(j,{dateAdapter:O,adapterLocale:K,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"}}},e.createElement(w,{name:n,control:S,rules:{required:a,disabled:s},render:function(t){var r,i,l=t.field;return e.createElement(I,{label:o,value:l.value?k(l.value):null,format:"dd/MM/yyyy HH:mm",inputFormat:!0,views:v?["year","month","day","hours"]:["year","month","day","hours","minutes"],ampm:m,onChange:function(e){return l.onChange(e)},viewRenderers:v?{hours:P}:null,timeSteps:{hours:x,minutes:g,seconds:E},slotProps:{textField:U(U({},y),{},{required:a,error:d&&Boolean(null===(r=W[n])||void 0===r?void 0:r.message),helperText:d&&(null===(i=W[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},le=["form","name","label","required","disabled","autofocus","showErrors"],se=function(t){var r=t.form,n=t.name,o=t.label,i=t.required,a=void 0!==i&&i,l=t.disabled,s=void 0!==l&&l;t.autofocus;var c=t.showErrors,d=void 0===c||c,u=$(t,le),m=r.control,f=r.formState.errors;return e.createElement(j,{dateAdapter:O,adapterLocale:K,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"}}},e.createElement(w,{name:n,control:m,rules:{required:a,disabled:s},render:function(t){var r,i,l=t.field;return e.createElement(F,{label:o,value:l.value?k(l.value):null,format:"dd/MM/yyyy",inputFormat:!0,onChange:function(e){return l.onChange(e)},slotProps:{textField:U(U({},u),{},{required:a,error:d&&Boolean(null===(r=f[n])||void 0===r?void 0:r.message),helperText:d&&(null===(i=f[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},ce=function(t){var r=t.open,n=t.title,p=t.label,x=t.value,b=t.onSubmit,g=t.onCancel,E=t.size,y=void 0===E?"sm":E,S=t.required,W=void 0===S||S,w=t.requiredMessage,T=void 0===w?"Υποχρεωτικό πεδίο":w,L=t.okLabel,k=void 0===L?"ΚΑΤΑΧΩΡΗΣΗ":L,R=t.cancelLabel,O=void 0===R?"ΑΚΥΡΩΣΗ":R,j=t.maxLength,I=void 0===j?255:j,P=t.message,F=void 0===P?null:P,K=t.isLoading,B=void 0!==K&&K,D={text:x||""},M=q.object({text:W?q.string().max(I,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(I," χαρακτήρες")).required(T):q.string().max(I)}),V=C({defaultValues:D,resolver:z(M)});e.useEffect((function(){r&&(V.reset(D),V.clearErrors())}),[r,x]);return e.createElement(o,{fullWidth:!0,maxWidth:y,open:r,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(a,{sx:{pb:1.5}},e.createElement(l,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(h,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),F&&"string"==typeof F?e.createElement(c,{variant:"caption",color:"text.secondary"},F):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:V.handleSubmit((function(e){return b(e.text)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},F&&"string"!=typeof F&&e.createElement(s,{sx:{mb:2}},F),e.createElement(G,{form:V,name:"text",label:p,required:W,autofocus:!0,maxLength:I,sx:{mt:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},O),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},B?e.createElement(v,{size:20,sx:{color:"inherit"}}):k))))},de=/^$|^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,ue=function(t){var r=t.open,n=t.title,p=t.label,x=t.value,b=t.onSubmit,g=t.onCancel,E=t.size,y=void 0===E?"sm":E,S=t.required,W=void 0===S||S,w=t.requiredMessage,T=void 0===w?"Υποχρεωτικό πεδίο":w,L=t.invalidMessage,k=void 0===L?"Μη έγκυρη μορφή email":L,R=t.okLabel,O=void 0===R?"ΚΑΤΑΧΩΡΗΣΗ":R,j=t.cancelLabel,I=void 0===j?"ΑΚΥΡΩΣΗ":j,P=t.maxLength,F=void 0===P?255:P,K=t.message,B=void 0===K?null:K,D=t.isLoading,M=void 0!==D&&D,V={email:x||""},A=q.object({email:W?q.string().matches(de,k).required(T):q.string().matches(de,k)}),H=C({defaultValues:V,resolver:z(A)});e.useEffect((function(){r&&(H.reset(V),H.clearErrors())}),[r,x]);return e.createElement(o,{fullWidth:!0,maxWidth:y,open:r,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(a,{sx:{pb:1.5}},e.createElement(l,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(h,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),B&&"string"==typeof B?e.createElement(c,{variant:"caption",color:"text.secondary"},B):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:H.handleSubmit((function(e){return b(e.email)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},B&&"string"!=typeof B&&e.createElement(s,{sx:{mb:2}},B),e.createElement(Q,{form:H,label:p,required:W,autofocus:!0,maxLength:F,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},I),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},M?e.createElement(v,{size:20,sx:{color:"inherit"}}):O))))};!function(e,t){void 0===t&&(t={});var r=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".chrome-picker {\r\n -webkit-box-shadow: none !important;\r\n -moz-box-shadow: none !important;\r\n box-shadow: none !important;\r\n}");var me=function(t){var r=t.open,n=t.title,p=t.label,x=t.value,b=t.onSubmit,g=t.onCancel,E=t.options,y=void 0===E?[]:E,S=t.valueKey,W=void 0===S?"id":S,w=t.labelKey,T=void 0===w?"label":w,L=t.required,k=void 0===L||L,R=t.size,O=void 0===R?"sm":R,j=t.requiredMessage,I=void 0===j?"Υποχρεωτικό πεδίο":j,P=t.okLabel,F=void 0===P?"ΚΑΤΑΧΩΡΗΣΗ":P,K=t.cancelLabel,B=void 0===K?"ΑΚΥΡΩΣΗ":K,D=t.message,M=void 0===D?null:D,V=t.isLoading,A=void 0!==V&&V,H={field:x||null},N=q.object({field:k?q.string().required(I):q.string().nullable()}),U=C({defaultValues:H,resolver:z(N)});e.useEffect((function(){r&&(U.reset(H),U.clearErrors())}),[r,x]);return e.createElement(o,{fullWidth:!0,maxWidth:O,open:r,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(a,{sx:{pb:1.5}},e.createElement(l,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(h,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),M&&"string"==typeof M?e.createElement(c,{variant:"caption",color:"text.secondary"},M):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:U.handleSubmit((function(e){return b(e)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},e.createElement(_,{form:U,name:"field",label:p,options:y,valueKey:W,labelKey:T,required:k,autofocus:!0,size:"medium",sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},B),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},A?e.createElement(v,{size:20,sx:{color:"inherit"}}):F))))},fe=function(t){var r=t.open,n=t.title,p=t.label,x=t.value,b=void 0===x?[]:x,g=t.onSubmit,E=t.onCancel,y=t.options,S=void 0===y?[]:y,W=t.valueKey,w=void 0===W?"id":W,T=t.labelKey,L=void 0===T?"label":T,k=t.required,R=void 0===k||k,O=t.size,j=void 0===O?"sm":O,I=t.requiredMessage,P=void 0===I?"Επιλέξτε τουλάχιστον μία τιμή":I,F=t.okLabel,K=void 0===F?"ΚΑΤΑΧΩΡΗΣΗ":F,B=t.cancelLabel,D=void 0===B?"ΑΚΥΡΩΣΗ":B,M=t.message,V=void 0===M?null:M,A=t.isLoading,H=void 0!==A&&A,N={field:b||[]},U=q.object({field:R?q.array().min(1,P):q.array()}),$=C({defaultValues:N,resolver:z(U)});e.useEffect((function(){r&&($.reset(N),$.clearErrors())}),[r,b]);return e.createElement(o,{fullWidth:!0,maxWidth:j,open:r,onClose:function(e,t){"escapeKeyDown"===t&&E()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(a,{sx:{pb:1.5}},e.createElement(l,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(h,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),V&&"string"==typeof V?e.createElement(c,{variant:"caption",color:"text.secondary"},V):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:$.handleSubmit((function(e){return g(e)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},V&&"string"!=typeof V&&e.createElement(s,{sx:{mb:2}},V),e.createElement(re,{form:$,name:"field",label:p,options:S,valueKey:w,labelKey:L,required:R,autofocus:!0,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),E()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},D),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},H?e.createElement(v,{size:20,sx:{color:"inherit"}}):K))))},ve=function(t){var r=t.open,n=t.title,l=t.message,c=t.onConfirm,d=t.onCancel,x=t.confirmText,b=void 0===x?"ΕΠΙΒΕΒΑΙΩΣΗ":x,g=t.cancelText,h=void 0===g?"ΑΚΥΡΩΣΗ":g,E=t.isLoading,y=void 0!==E&&E,S=t.type,W=void 0===S?"warning":S,w={warning:{color:"warning.main",icon:e.createElement(B,{sx:{fontSize:40}})},error:{color:"error.main",icon:e.createElement(D,{sx:{fontSize:40}})},success:{color:"success.main",icon:e.createElement(M,{sx:{fontSize:40}})}}[W]||{color:"primary.main",icon:null};return e.createElement(o,{open:r,onClose:function(e,t){"backdropClick"!==t&&d()},slots:{transition:i},slotProps:{backdrop:{sx:{backgroundColor:"rgba(0, 0, 0, 0.4)",backdropFilter:"blur(4px)"}},paper:{sx:{borderRadius:4,padding:1,maxWidth:400,textAlign:"center",backgroundImage:"none"}}}},e.createElement(s,{sx:{display:"flex",flexDirection:"column",alignItems:"center",mt:3}},e.createElement(s,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:70,height:70,bgcolor:"".concat(w.color,"20"),color:w.color,borderRadius:"50%",mb:2}},w.icon),e.createElement(a,{sx:{fontWeight:800,fontSize:"1.35rem",pt:0,pb:1}},n)),e.createElement(u,null,e.createElement(p,{sx:{color:"text.secondary",fontWeight:500,lineHeight:1.6}},l)),e.createElement(m,{sx:{justifyContent:"center",gap:2,px:3,pb:3,mt:1}},e.createElement(f,{fullWidth:!0,variant:"text",color:"inherit",onClick:d,sx:{borderRadius:3,fontWeight:700,color:"text.disabled"}},h),e.createElement(f,{fullWidth:!0,variant:"contained",disableElevation:!0,color:"error"===W?"error":"primary",onClick:c,sx:{borderRadius:3,fontWeight:700,py:1}},y?e.createElement(v,{size:20,sx:{color:"inherit"}}):b)))},pe=function(t){var r=t.open,n=t.title,p=t.label,x=t.message,b=void 0===x?null:x,g=t.value,E=t.onSubmit,y=t.onCancel,S=t.size,W=void 0===S?"sm":S,w=t.rows,T=void 0===w?5:w,L=t.required,k=void 0!==L&&L,R=t.requiredMessage,O=void 0===R?"Υποχρεωτικό πεδίο":R,j=t.okLabel,I=void 0===j?"ΚΑΤΑΧΩΡΗΣΗ":j,P=t.cancelLabel,F=void 0===P?"ΑΚΥΡΩΣΗ":P,K=t.isLoading,B=void 0!==K&&K,D={notes:g||""},M=q.object({notes:k?q.string().required(O):q.string()}),V=C({defaultValues:D,resolver:z(M)});e.useEffect((function(){r&&(V.reset(D),V.clearErrors())}),[r,g]);return e.createElement(o,{fullWidth:!0,maxWidth:W,open:r,onClose:function(e,t){"escapeKeyDown"===t&&y()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(a,{sx:{pb:1.5}},e.createElement(l,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(h,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),b&&"string"==typeof b?e.createElement(c,{variant:"caption",color:"text.secondary"},b):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:V.handleSubmit((function(e){return E(e.notes)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},b&&"string"!=typeof b&&e.createElement(s,{sx:{mb:2}},b),e.createElement(oe,{form:V,name:"notes",label:p,required:k,rows:T,autofocus:!0,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),y()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},F),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},B?e.createElement(v,{size:20,sx:{color:"inherit"}}):I))))},xe=function(t){var r=t.open,n=t.title,p=t.label,x=t.value,b=t.onSubmit,g=t.onCancel,E=t.size,y=void 0===E?"sm":E,S=t.required,W=void 0===S||S,w=t.requiredMessage,T=void 0===w?"Υποχρεωτικό πεδίο":w,L=t.okLabel,k=void 0===L?"ΚΑΤΑΧΩΡΗΣΗ":L,R=t.cancelLabel,O=void 0===R?"ΑΚΥΡΩΣΗ":R,j=t.message,I=void 0===j?null:j,P=t.isLoading,F=void 0!==P&&P,K={datetime:x},B=q.object({datetime:W?q.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").required(T):q.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας")}),D=C({defaultValues:K,resolver:z(B)});e.useEffect((function(){r&&(D.reset(K),D.clearErrors())}),[r,x]);return e.createElement(o,{fullWidth:!0,maxWidth:y,open:r,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(a,{sx:{pb:1.5}},e.createElement(l,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(h,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),I&&"string"==typeof I?e.createElement(c,{variant:"caption",color:"text.secondary"},I):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:D.handleSubmit((function(e){return b(e.datetime)})),noValidate:!0},e.createElement(u,null,I&&"string"!=typeof I&&e.createElement(s,{sx:{mb:2}},I),e.createElement(ae,{form:D,name:"datetime",label:p,required:W,autofocus:!0,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},O),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},F?e.createElement(v,{size:20,sx:{color:"inherit"}}):k))))},be=function(t){var r=t.open,n=t.title,p=t.label,x=t.value,b=t.onSubmit,g=t.onCancel,E=t.size,y=void 0===E?"sm":E,S=t.required,W=void 0===S||S,w=t.requiredMessage,T=void 0===w?"Υποχρεωτικό πεδίο":w,L=t.okLabel,k=void 0===L?"ΚΑΤΑΧΩΡΗΣΗ":L,R=t.cancelLabel,O=void 0===R?"ΑΚΥΡΩΣΗ":R,j=t.message,I=void 0===j?null:j,P=t.isLoading,F=void 0!==P&&P,K={datetime:x},B=q.object({datetime:W?q.date().typeError("Μη έγκυρη μορφή ημερομηνίας").required(T):q.date().typeError("Μη έγκυρη μορφή ημερομηνίας")}),D=C({defaultValues:K,resolver:z(B)});e.useEffect((function(){r&&(D.reset(K),D.clearErrors())}),[r,x]);return e.createElement(o,{fullWidth:!0,maxWidth:y,open:r,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(a,{sx:{pb:1.5}},e.createElement(l,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(h,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),I&&"string"==typeof I?e.createElement(c,{variant:"caption",color:"text.secondary"},I):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:D.handleSubmit((function(e){return b(e.datetime)})),noValidate:!0},e.createElement(u,null,I&&"string"!=typeof I&&e.createElement(s,{sx:{mb:2}},I),e.createElement(se,{form:D,name:"datetime",label:p,required:W,autofocus:!0,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},O),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},F?e.createElement(v,{size:20,sx:{color:"inherit"}}):k))))},ge=function(t){var r=t.label,o=t.value,i=t.render,a=void 0===i?null:i,s=t.fieldName,u=void 0===s?null:s,m=t.editable,v=void 0!==m&&m,p=t.required,h=void 0===p||p,S=t.placeholder,W=void 0===S?"":S,w=t.modalTitle,C=void 0===w?"Επεξεργασία":w,z=t.updateUrl,q=void 0===z?null:z,T=t.maxLength,L=void 0===T?255:T,k=t.message,R=void 0===k?null:k,O=t.hasDivider,j=void 0===O||O,I=Y(e.useState(!1),2),P=I[0],F=I[1],K=!o&&h,B=Y(e.useState(!1),2),D=B[0],M=B[1];return e.createElement(e.Fragment,null,e.createElement(x,{sx:{py:2.5,px:4}},e.createElement(b,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(b,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(b,{size:{xs:12,sm:6}},h&&!o?e.createElement(l,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):a||e.createElement(c,{variant:"body1",fontWeight:500},o||W)),e.createElement(b,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:K?"contained":"outlined",color:K?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),F(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),j&&e.createElement(d,{component:"li"}),e.createElement(ce,{open:P,title:C,label:r,value:o,required:h,maxLength:L,onSubmit:function(e){M(!0),g.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){M(!1),F(!1)}})},onCancel:function(){return F(!1)},message:R,isLoading:D}))},he=function(t){var r=t.label,o=t.value,i=t.render,a=void 0===i?null:i,s=t.fieldName,u=void 0===s?null:s,m=t.editable,v=void 0!==m&&m,p=t.required,h=void 0===p||p,S=t.placeholder,W=void 0===S?"":S,w=t.modalTitle,C=void 0===w?"Επεξεργασία":w,z=t.updateUrl,q=void 0===z?null:z,T=t.maxLength,L=void 0===T?255:T,k=t.message,R=void 0===k?null:k,O=t.hasDivider,j=void 0===O||O,I=Y(e.useState(!1),2),P=I[0],F=I[1],K=!o&&h,B=Y(e.useState(!1),2),D=B[0],M=B[1];return e.createElement(e.Fragment,null,e.createElement(x,{sx:{py:2.5,px:4}},e.createElement(b,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(b,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(b,{size:{xs:12,sm:6}},h&&!o?e.createElement(l,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):a||e.createElement(c,{variant:"body1",fontWeight:500},o||W)),e.createElement(b,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:K?"contained":"outlined",color:K?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),F(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),j&&e.createElement(d,{component:"li"}),e.createElement(ue,{open:P,title:C,label:r,value:o,required:h,maxLength:L,onSubmit:function(e){M(!0),g.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){M(!1),F(!1)}})},onCancel:function(){return F(!1)},message:R,isLoading:D}))},Ee=function(t){var r=t.label,o=t.value,i=t.render,a=void 0===i?null:i,s=t.fieldName,u=void 0===s?null:s,m=t.editable,v=void 0!==m&&m,p=t.required,h=void 0===p||p,S=t.placeholder,W=void 0===S?"":S,w=t.modalTitle,C=void 0===w?"Επεξεργασία":w,z=t.updateUrl,q=void 0===z?null:z,T=t.message,L=void 0===T?null:T,k=t.hasDivider,R=void 0===k||k,O=Y(e.useState(!1),2),j=O[0],I=O[1],P=!o&&h,F=Y(e.useState(!1),2),K=F[0],B=F[1];return e.createElement(e.Fragment,null,e.createElement(x,{sx:{py:2.5,px:4}},e.createElement(b,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(b,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(b,{size:{xs:12,sm:6}},h&&!o?e.createElement(l,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):a||e.createElement(c,{variant:"body1",fontWeight:500},o?ee(o):W)),e.createElement(b,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:P?"contained":"outlined",color:P?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),I(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),R&&e.createElement(d,{component:"li"}),e.createElement(xe,{open:j,title:C,label:r,value:o,required:h,onSubmit:function(e){B(!0),g.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){B(!1),I(!1)}})},onCancel:function(){return I(!1)},message:L,isLoading:K}))},ye=function(t){var r=t.label,o=t.value,i=t.render,a=void 0===i?null:i,s=t.fieldName,u=void 0===s?null:s,m=t.editable,v=void 0!==m&&m,p=t.required,h=void 0===p||p,S=t.placeholder,W=void 0===S?"":S,w=t.modalTitle,C=void 0===w?"Επεξεργασία":w,z=t.updateUrl,q=void 0===z?null:z,T=t.message,L=void 0===T?null:T,k=t.hasDivider,R=void 0===k||k,O=Y(e.useState(!1),2),j=O[0],I=O[1],P=!o&&h,F=Y(e.useState(!1),2),K=F[0],B=F[1];return e.createElement(e.Fragment,null,e.createElement(x,{sx:{py:2.5,px:4}},e.createElement(b,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(b,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(b,{size:{xs:12,sm:6}},h&&!o?e.createElement(l,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):a||e.createElement(c,{variant:"body1",fontWeight:500},o?ee(o):W)),e.createElement(b,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:P?"contained":"outlined",color:P?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),I(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),R&&e.createElement(d,{component:"li"}),e.createElement(be,{open:j,title:C,label:r,value:o,required:h,onSubmit:function(e){B(!0),g.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){B(!1),I(!1)}})},onCancel:function(){return I(!1)},message:L,isLoading:K}))},Se=function(t){var r=t.label,o=t.value,i=t.render,a=void 0===i?null:i,s=t.fieldName,u=void 0===s?null:s,m=t.editable,v=void 0!==m&&m,p=t.required,h=void 0===p||p,S=t.placeholder,W=void 0===S?"":S,w=t.modalTitle,C=void 0===w?"Επεξεργασία":w,z=t.updateUrl,q=void 0===z?null:z,T=t.rows,L=void 0===T?5:T,k=t.message,R=void 0===k?null:k,O=t.hasDivider,j=void 0===O||O,I=Y(e.useState(!1),2),P=I[0],F=I[1],K=!o&&h,B=Y(e.useState(!1),2),D=B[0],M=B[1];return e.createElement(e.Fragment,null,e.createElement(x,{sx:{py:2.5,px:4}},e.createElement(b,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(b,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(b,{size:{xs:12,sm:6}},h&&!o?e.createElement(l,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):a||e.createElement(c,{variant:"body1",fontWeight:500},o||W)),e.createElement(b,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:K?"contained":"outlined",color:K?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),F(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),j&&e.createElement(d,{component:"li"}),e.createElement(pe,{open:P,title:C,label:r,value:o,required:h,rows:L,onSubmit:function(e){M(!0),g.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){M(!1),F(!1)}})},onCancel:function(){return F(!1)},message:R,isLoading:D}))},We=function(t){var r=t.label,o=t.value,i=t.render,a=void 0===i?null:i,s=t.options,u=void 0===s?[]:s,m=t.valueKey,v=void 0===m?"id":m,p=t.labelKey,h=void 0===p?"label":p,S=t.fieldName,W=void 0===S?null:S,w=t.editable,C=void 0!==w&&w,z=t.required,q=void 0===z||z,T=t.placeholder,L=void 0===T?"":T,k=t.modalTitle,R=void 0===k?"Επεξεργασία":k,O=t.updateUrl,j=void 0===O?null:O,I=t.message,P=void 0===I?null:I,F=t.hasDivider,K=void 0===F||F,B=Y(e.useState(!1),2),D=B[0],M=B[1],V=null==o&&q,A=u.find((function(e){return e.id===o})),H=A?A.label:"",N=Y(e.useState(!1),2),U=N[0],$=N[1];return e.createElement(e.Fragment,null,e.createElement(x,{sx:{py:2.5,px:4}},e.createElement(b,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(b,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(b,{size:{xs:12,sm:6}},q&&null==o?e.createElement(l,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):a||e.createElement(c,{variant:"body1",fontWeight:500},H||L)),e.createElement(b,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},C&&e.createElement(f,{size:"small",variant:V?"contained":"outlined",color:V?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),M(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),K&&e.createElement(d,{component:"li"}),e.createElement(me,{open:D,title:R,label:r,value:o,options:u,valueKey:v,labelKey:h,required:q,onSubmit:function(e){$(!0),g.put(j,{field:W,value:e.field},{preserveScroll:!0,onFinish:function(){$(!1),M(!1)}})},onCancel:function(){return M(!1)},message:P,isLoading:U}))},we=function(t){var r=t.label,n=t.value,o=t.render,i=void 0===o?null:o,a=t.fieldName,l=void 0===a?null:a,s=t.editable,u=void 0!==s&&s,m=t.activationLabel,v=void 0===m?"Ενεργοποίηση":m,p=t.deactivationLabel,h=void 0===p?"Απενεργοποίηση":p,E=t.activationMessage,y=void 0===E?"":E,w=t.deactivationMessage,C=void 0===w?"":w,z=t.updateUrl,q=void 0===z?null:z,T=t.hasDivider,L=void 0===T||T,k=Y(e.useState(!1),2),R=k[0],O=k[1],j=Y(e.useState(!1),2),I=j[0],P=j[1];return e.createElement(e.Fragment,null,e.createElement(x,{sx:{py:2.5,px:4}},e.createElement(b,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(b,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(b,{size:{xs:12,sm:6}},i||e.createElement(c,{variant:"body1",fontWeight:500},n?1:0)),e.createElement(b,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},u&&e.createElement(f,{size:"small",variant:"outlined",color:n?"error":"success",startIcon:n?e.createElement(S,{fontSize:"small"}):e.createElement(W,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),O(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},n?h:v)))),L&&e.createElement(d,{component:"li"}),e.createElement(ve,{open:R,title:n?h:v,message:n?C:y,onConfirm:function(){P(!0),g.put(q,{field:l,value:n?0:1},{preserveScroll:!0,onFinish:function(){P(!1),O(!1)}})},onCancel:function(){return O(!1)},isLoading:I}))},Ce=function(t){var r=t.label,o=t.value,i=t.render,a=void 0===i?null:i,s=t.options,u=void 0===s?[]:s,m=t.valueKey,v=void 0===m?"id":m,p=t.labelKey,h=void 0===p?"label":p,S=t.fieldName,W=void 0===S?null:S,w=t.editable,C=void 0!==w&&w,z=t.required,q=void 0===z||z,T=t.placeholder,L=void 0===T?"":T,k=t.modalTitle,R=void 0===k?"Επεξεργασία":k,O=t.updateUrl,j=void 0===O?null:O,I=t.message,P=void 0===I?null:I,F=t.hasDivider,K=void 0===F||F,B=Y(e.useState(!1),2),D=B[0],M=B[1],V=null==o&&q,A=Y(e.useState(!1),2),H=A[0],N=A[1],U=u.filter((function(e){return o.some((function(t){return t[v]===e[v]}))})).map((function(e){return e[h]})).join(", ");return e.createElement(e.Fragment,null,e.createElement(x,{sx:{py:2.5,px:4}},e.createElement(b,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(b,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(b,{size:{xs:12,sm:6}},q&&null==o?e.createElement(l,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):a||e.createElement(c,{variant:"body1",fontWeight:500},U||L)),e.createElement(b,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},C&&e.createElement(f,{size:"small",variant:V?"contained":"outlined",color:V?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),M(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),K&&e.createElement(d,{component:"li"}),e.createElement(fe,{open:D,title:R,label:r,value:o,options:u,valueKey:v,labelKey:h,required:q,onSubmit:function(e){N(!0),g.put(j,{field:W,value:e.field.map((function(e){return e[v]}))},{preserveScroll:!0,onFinish:function(){N(!1),M(!1)}})},onCancel:function(){return M(!1)},message:P,isLoading:H}))};export{Ce as AutocompleteMultiProperty,We as AutocompleteProperty,ye as DateProperty,Ee as DateTimeProperty,he as EmailProperty,ge as StringProperty,Se as TextProperty,we as ToggleProperty};
1
+ import e from"react";import{TextField as t,Autocomplete as r,Chip as n,Dialog as o,Zoom as i,DialogTitle as l,Stack as a,Box as s,Typography as c,Divider as d,DialogContent as u,DialogActions as m,Button as f,CircularProgress as v,DialogContentText as p,ListItem as b,Grid2 as x}from"@mui/material";import{router as g}from"@inertiajs/react";import{EditNoteRounded as h,ErrorOutline as E,Edit as y,ToggleOff as S,ToggleOn as W}from"@mui/icons-material";import{Controller as w,useForm as C}from"react-hook-form";import{yupResolver as z}from"@hookform/resolvers/yup";import*as q from"yup";import"react-color";import{format as T,parseISO as L,toDate as k}from"date-fns";import{el as R}from"date-fns/locale";import"axios";import"react-number-format";import{AdapterDateFns as O}from"@mui/x-date-pickers/AdapterDateFnsV3";import{LocalizationProvider as j}from"@mui/x-date-pickers/LocalizationProvider";import{DateTimePicker as I,renderDigitalClockTimeView as P,DatePicker as F}from"@mui/x-date-pickers";import K from"date-fns/locale/el";import B from"@mui/icons-material/WarningAmberRounded";import D from"@mui/icons-material/ErrorOutlineRounded";import M from"@mui/icons-material/CheckCircleOutlineRounded";function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function A(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function H(){return H=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},H.apply(null,arguments)}function N(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?N(Object(r),!0).forEach((function(t){A(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function $(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,l,a=[],s=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t);else for(;!(s=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(c)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return V(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?V(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Z=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],G=function(r){var n=r.form,o=r.name,i=r.label,l=r.maxLength,a=void 0===l?255:l,s=r.required,c=void 0!==s&&s,d=r.disabled,u=void 0!==d&&d,m=r.autofocus,f=void 0!==m&&m,v=r.showErrors,p=void 0===v||v,b=r.readonly,x=void 0!==b&&b,g=r.readonlyBackgroundColor,h=void 0===g?"#dddddd":g,E=r.bold,y=void 0!==E&&E,S=$(r,Z),W=n.control,C=n.formState.errors;return e.createElement(w,{name:o,control:W,rules:{required:c,disabled:u},render:function(r){var n,l,s=r.field,d=s.onChange,m=s.onBlur,v=s.value;return e.createElement(t,H({required:c,label:i,value:v,onChange:d,onBlur:m,error:p&&Boolean(null===(n=C[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:p&&(null===(l=C[o])||void 0===l?void 0:l.message),variant:"outlined",disabled:u,autoFocus:f,slotProps:{input:{maxLength:a,readOnly:x,sx:{fontWeight:y?"bold":"",backgroundColor:x?h:""}}}},S))}})},J=["form","name","label","maxLength","required","disabled","autofocus","showErrors","readonly","readonlyBackgroundColor","bold"],Q=function(r){var n=r.form,o=r.name,i=void 0===o?"email":o,l=r.label,a=void 0===l?"E-mail":l,s=r.maxLength,c=void 0===s?255:s,d=r.required,u=void 0===d||d,m=r.disabled,f=void 0!==m&&m,v=r.autofocus,p=void 0!==v&&v,b=r.showErrors,x=void 0===b||b,g=r.readonly,h=void 0!==g&&g,E=r.readonlyBackgroundColor,y=void 0===E?"#dddddd":E,S=r.bold,W=void 0!==S&&S,C=$(r,J),z=n.control,q=n.formState.errors;return e.createElement(w,{name:i,control:z,rules:{required:u,disabled:f},render:function(r){var n,o,l=r.field,s=l.onChange,d=l.onBlur,m=l.value;return e.createElement(t,H({required:u,label:a,value:m,onChange:s,onBlur:d,error:x&&Boolean(null===(n=q[i])||void 0===n?void 0:n.message),fullWidth:!0,helperText:x&&(null===(o=q[i])||void 0===o?void 0:o.message),variant:"outlined",disabled:f,autoFocus:p,slotProps:{input:{maxLength:c,readOnly:h,sx:{fontWeight:W?"bold":"",backgroundColor:h?y:""}}}},C))}})},X=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors","size","readonly","readonlyBackgroundColor","bold"],_=function(n){var o=n.form,i=n.name,l=n.label,a=n.required,s=void 0!==a&&a,c=n.disabled,d=void 0!==c&&c,u=n.options,m=void 0===u?[]:u,f=n.valueKey,v=void 0===f?"id":f,p=n.labelKey,b=void 0===p?"label":p,x=n.maxLength,g=void 0===x?255:x,h=n.autofocus,E=void 0!==h&&h,y=n.noOptionsText,S=void 0===y?"Δεν υπάρχουν επιλογές":y,W=n.showErrors,C=void 0===W||W,z=n.size,q=void 0===z?"medium":z,T=n.readonly,L=void 0!==T&&T,k=n.readonlyBackgroundColor,R=void 0===k?"#dddddd":k,O=n.bold,j=void 0!==O&&O,I=$(n,X),P=Y(e.useState(null),2),F=P[0],K=P[1],B=o.watch(i);e.useEffect((function(){K(m.find((function(e){return e[v]===B}))||null)}),[B]);var D=o.control,M=o.formState.errors;return e.createElement(w,{name:i,control:D,rules:{required:s,disabled:d},render:function(n){var o=n.field,a=o.onChange,c=o.onBlur;return o.value,L?e.createElement(t,{size:q,label:l,fullWidth:!0,required:s,slotProps:{input:{maxLength:g,readOnly:L,sx:{fontWeight:j?"bold":"",backgroundColor:L?R:""}}},value:F?F.label:""}):e.createElement(r,{value:F,required:s,onChange:function(e,t){return a(t?t[v]:null)},options:m,isOptionEqualToValue:function(e,t){return e[v]===t[v]},noOptionsText:S,getOptionLabel:function(e){return e[b]},size:q,slotProps:{input:{maxLength:g,sx:{fontWeight:j?"bold":"",color:"red"}}},renderInput:function(r){var n,o;return e.createElement(t,H({label:l,required:s,disabled:d,autoFocus:E,size:q,error:C&&Boolean(null===(n=M[i])||void 0===n?void 0:n.message),onBlur:c,variant:"outlined",fullWidth:!0,helperText:C&&(null===(o=M[i])||void 0===o?void 0:o.message)},r,I))}})}})},ee=["form","name","label","required","disabled","options","valueKey","labelKey","maxLength","autofocus","noOptionsText","showErrors"],te=function(o){var i=o.form,l=o.name,a=o.label,s=o.required,c=void 0!==s&&s,d=o.disabled,u=void 0!==d&&d,m=o.options,f=void 0===m?[]:m,v=o.valueKey,p=void 0===v?"id":v,b=o.labelKey,x=void 0===b?"label":b,g=o.maxLength,h=void 0===g?255:g,E=o.autofocus,y=void 0!==E&&E,S=o.noOptionsText,W=void 0===S?"Δεν υπάρχουν επιλογές":S,C=o.showErrors,z=void 0===C||C,q=$(o,ee),T=Y(e.useState([]),2),L=T[0],k=T[1],R=i.watch(l);e.useEffect((function(){k(f.filter((function(e){return function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id";return Boolean(t.find((function(t){return t[r]===e[r]})))}(e,R)})))}),[R]);var O=i.control,j=i.formState.errors;return e.createElement(w,{name:l,control:O,rules:{required:c,disabled:u},render:function(o){var i=o.field,s=i.onChange,d=i.onBlur;return i.value,e.createElement(r,{multiple:!0,value:L,required:c,onChange:function(e,t){return s(t)},options:f,isOptionEqualToValue:function(e,t){return e[p]===t[p]},noOptionsText:W,renderTags:function(t,r){return t.map((function(t,o){return e.createElement(n,H({variant:"outlined",label:t[x],size:"small"},r({index:o})))}))},renderInput:function(r){var n,o;return e.createElement(t,H({label:a,required:c,disabled:u,autoFocus:y,inputProps:{maxLength:h},error:z&&Boolean(null===(n=j[l])||void 0===n?void 0:n.message),onBlur:d,variant:"outlined",fullWidth:!0,helperText:z&&(null===(o=j[l])||void 0===o?void 0:o.message)},r,q))}})}})},re=["form","name","label","rows","required","disabled","autofocus","showErrors"],ne=function(r){var n=r.form,o=r.name,i=r.label,l=r.rows,a=void 0===l?5:l,s=r.required,c=void 0!==s&&s,d=r.disabled,u=void 0!==d&&d,m=r.autofocus,f=void 0!==m&&m,v=r.showErrors,p=void 0===v||v,b=$(r,re),x=n.control,g=n.formState.errors;return e.createElement(w,{name:o,control:x,rules:{required:c,disabled:u},render:function(r){var n,l,s=r.field,d=s.onChange,m=s.onBlur,v=s.value;return e.createElement(t,H({required:c,label:i,value:v,multiline:!0,minRows:a,maxRows:a,onChange:d,onBlur:m,error:p&&Boolean(null===(n=g[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:p&&(null===(l=g[o])||void 0===l?void 0:l.message),variant:"outlined",disabled:u,autoFocus:f},b))}})},oe=["form","name","label","required","disabled","autofocus","showErrors","ampm","singleTimeColumn","hoursStep","minutesStep","secondsStep"],ie=function(t){var r=t.form,n=t.name,o=t.label,i=t.required,l=void 0!==i&&i,a=t.disabled,s=void 0!==a&&a;t.autofocus;var c=t.showErrors,d=void 0===c||c,u=t.ampm,m=void 0!==u&&u,f=t.singleTimeColumn,v=void 0===f||f,p=t.hoursStep,b=void 0===p?1:p,x=t.minutesStep,g=void 0===x?15:x,h=t.secondsStep,E=void 0===h?30:h,y=$(t,oe),S=r.control,W=r.formState.errors;return e.createElement(j,{dateAdapter:O,adapterLocale:K,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldHoursPlaceholder:function(e){return"ΩΩ"},fieldMinutesPlaceholder:function(e){return"ΛΛ"},fieldClearLabel:"Καθαρισμός"}},e.createElement(w,{name:n,control:S,rules:{required:l,disabled:s},render:function(t){var r,i,a=t.field;return e.createElement(I,{label:o,value:a.value?k(a.value):null,format:"dd/MM/yyyy HH:mm",inputFormat:!0,views:v?["year","month","day","hours"]:["year","month","day","hours","minutes"],ampm:m,onChange:function(e){return a.onChange(e)},viewRenderers:v?{hours:P}:null,timeSteps:{hours:b,minutes:g,seconds:E},slotProps:{field:{clearable:!0,onClear:function(){return a.onChange(null)}},textField:U(U({},y),{},{required:l,error:d&&Boolean(null===(r=W[n])||void 0===r?void 0:r.message),helperText:d&&(null===(i=W[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},le=["form","name","label","required","disabled","autofocus","showErrors"],ae=function(t){var r=t.form,n=t.name,o=t.label,i=t.required,l=void 0!==i&&i,a=t.disabled,s=void 0!==a&&a;t.autofocus;var c=t.showErrors,d=void 0===c||c,u=$(t,le),m=r.control,f=r.formState.errors;return e.createElement(j,{dateAdapter:O,adapterLocale:K,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldClearLabel:"Καθαρισμός"}},e.createElement(w,{name:n,control:m,rules:{required:l,disabled:s},render:function(t){var r,i,a=t.field;return e.createElement(F,{label:o,value:a.value?k(a.value):null,format:"dd/MM/yyyy",inputFormat:!0,onChange:function(e){return a.onChange(e)},slotProps:{field:{clearable:!0,onClear:function(){return a.onChange(null)}},textField:U(U({},u),{},{required:l,error:d&&Boolean(null===(r=f[n])||void 0===r?void 0:r.message),helperText:d&&(null===(i=f[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},se=function(t){var r=t.open,n=t.title,p=t.label,b=t.value,x=t.onSubmit,g=t.onCancel,E=t.size,y=void 0===E?"sm":E,S=t.required,W=void 0===S||S,w=t.requiredMessage,T=void 0===w?"Υποχρεωτικό πεδίο":w,L=t.okLabel,k=void 0===L?"ΚΑΤΑΧΩΡΗΣΗ":L,R=t.cancelLabel,O=void 0===R?"ΑΚΥΡΩΣΗ":R,j=t.maxLength,I=void 0===j?255:j,P=t.message,F=void 0===P?null:P,K=t.isLoading,B=void 0!==K&&K,D={text:b||""},M=q.object({text:W?q.string().max(I,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(I," χαρακτήρες")).required(T):q.string().max(I)}),V=C({defaultValues:D,resolver:z(M)});e.useEffect((function(){r&&(V.reset(D),V.clearErrors())}),[r,b]);return e.createElement(o,{fullWidth:!0,maxWidth:y,open:r,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(l,{sx:{pb:1.5}},e.createElement(a,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(h,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),F&&"string"==typeof F?e.createElement(c,{variant:"caption",color:"text.secondary"},F):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:V.handleSubmit((function(e){return x(e.text)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},F&&"string"!=typeof F&&e.createElement(s,{sx:{mb:2}},F),e.createElement(G,{form:V,name:"text",label:p,required:W,autofocus:!0,maxLength:I,sx:{mt:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},O),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},B?e.createElement(v,{size:20,sx:{color:"inherit"}}):k))))},ce=/^$|^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,de=function(t){var r=t.open,n=t.title,p=t.label,b=t.value,x=t.onSubmit,g=t.onCancel,E=t.size,y=void 0===E?"sm":E,S=t.required,W=void 0===S||S,w=t.requiredMessage,T=void 0===w?"Υποχρεωτικό πεδίο":w,L=t.invalidMessage,k=void 0===L?"Μη έγκυρη μορφή email":L,R=t.okLabel,O=void 0===R?"ΚΑΤΑΧΩΡΗΣΗ":R,j=t.cancelLabel,I=void 0===j?"ΑΚΥΡΩΣΗ":j,P=t.maxLength,F=void 0===P?255:P,K=t.message,B=void 0===K?null:K,D=t.isLoading,M=void 0!==D&&D,V={email:b||""},A=q.object({email:W?q.string().matches(ce,k).required(T):q.string().matches(ce,k)}),H=C({defaultValues:V,resolver:z(A)});e.useEffect((function(){r&&(H.reset(V),H.clearErrors())}),[r,b]);return e.createElement(o,{fullWidth:!0,maxWidth:y,open:r,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(l,{sx:{pb:1.5}},e.createElement(a,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(h,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),B&&"string"==typeof B?e.createElement(c,{variant:"caption",color:"text.secondary"},B):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:H.handleSubmit((function(e){return x(e.email)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},B&&"string"!=typeof B&&e.createElement(s,{sx:{mb:2}},B),e.createElement(Q,{form:H,label:p,required:W,autofocus:!0,maxLength:F,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},I),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},M?e.createElement(v,{size:20,sx:{color:"inherit"}}):O))))};!function(e,t){void 0===t&&(t={});var r=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".chrome-picker {\r\n -webkit-box-shadow: none !important;\r\n -moz-box-shadow: none !important;\r\n box-shadow: none !important;\r\n}");var ue=function(t){var r=t.open,n=t.title,p=t.label,b=t.value,x=t.onSubmit,g=t.onCancel,E=t.options,y=void 0===E?[]:E,S=t.valueKey,W=void 0===S?"id":S,w=t.labelKey,T=void 0===w?"label":w,L=t.required,k=void 0===L||L,R=t.size,O=void 0===R?"sm":R,j=t.requiredMessage,I=void 0===j?"Υποχρεωτικό πεδίο":j,P=t.okLabel,F=void 0===P?"ΚΑΤΑΧΩΡΗΣΗ":P,K=t.cancelLabel,B=void 0===K?"ΑΚΥΡΩΣΗ":K,D=t.message,M=void 0===D?null:D,V=t.isLoading,A=void 0!==V&&V,H={field:b||null},N=q.object({field:k?q.string().required(I):q.string().nullable()}),U=C({defaultValues:H,resolver:z(N)});e.useEffect((function(){r&&(U.reset(H),U.clearErrors())}),[r,b]);return e.createElement(o,{fullWidth:!0,maxWidth:O,open:r,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(l,{sx:{pb:1.5}},e.createElement(a,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(h,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),M&&"string"==typeof M?e.createElement(c,{variant:"caption",color:"text.secondary"},M):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:U.handleSubmit((function(e){return x(e)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},e.createElement(_,{form:U,name:"field",label:p,options:y,valueKey:W,labelKey:T,required:k,autofocus:!0,size:"medium",sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},B),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},A?e.createElement(v,{size:20,sx:{color:"inherit"}}):F))))},me=function(t){var r=t.open,n=t.title,p=t.label,b=t.value,x=void 0===b?[]:b,g=t.onSubmit,E=t.onCancel,y=t.options,S=void 0===y?[]:y,W=t.valueKey,w=void 0===W?"id":W,T=t.labelKey,L=void 0===T?"label":T,k=t.required,R=void 0===k||k,O=t.size,j=void 0===O?"sm":O,I=t.requiredMessage,P=void 0===I?"Επιλέξτε τουλάχιστον μία τιμή":I,F=t.okLabel,K=void 0===F?"ΚΑΤΑΧΩΡΗΣΗ":F,B=t.cancelLabel,D=void 0===B?"ΑΚΥΡΩΣΗ":B,M=t.message,V=void 0===M?null:M,A=t.isLoading,H=void 0!==A&&A,N={field:x||[]},U=q.object({field:R?q.array().min(1,P):q.array()}),$=C({defaultValues:N,resolver:z(U)});e.useEffect((function(){r&&($.reset(N),$.clearErrors())}),[r,x]);return e.createElement(o,{fullWidth:!0,maxWidth:j,open:r,onClose:function(e,t){"escapeKeyDown"===t&&E()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(l,{sx:{pb:1.5}},e.createElement(a,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(h,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),V&&"string"==typeof V?e.createElement(c,{variant:"caption",color:"text.secondary"},V):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:$.handleSubmit((function(e){return g(e)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},V&&"string"!=typeof V&&e.createElement(s,{sx:{mb:2}},V),e.createElement(te,{form:$,name:"field",label:p,options:S,valueKey:w,labelKey:L,required:R,autofocus:!0,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),E()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},D),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},H?e.createElement(v,{size:20,sx:{color:"inherit"}}):K))))},fe=function(t){var r=t.open,n=t.title,a=t.message,c=t.onConfirm,d=t.onCancel,b=t.confirmText,x=void 0===b?"ΕΠΙΒΕΒΑΙΩΣΗ":b,g=t.cancelText,h=void 0===g?"ΑΚΥΡΩΣΗ":g,E=t.isLoading,y=void 0!==E&&E,S=t.type,W=void 0===S?"warning":S,w={warning:{color:"warning.main",icon:e.createElement(B,{sx:{fontSize:40}})},error:{color:"error.main",icon:e.createElement(D,{sx:{fontSize:40}})},success:{color:"success.main",icon:e.createElement(M,{sx:{fontSize:40}})}}[W]||{color:"primary.main",icon:null};return e.createElement(o,{open:r,onClose:function(e,t){"backdropClick"!==t&&d()},slots:{transition:i},slotProps:{backdrop:{sx:{backgroundColor:"rgba(0, 0, 0, 0.4)",backdropFilter:"blur(4px)"}},paper:{sx:{borderRadius:4,padding:1,maxWidth:400,textAlign:"center",backgroundImage:"none"}}}},e.createElement(s,{sx:{display:"flex",flexDirection:"column",alignItems:"center",mt:3}},e.createElement(s,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:70,height:70,bgcolor:"".concat(w.color,"20"),color:w.color,borderRadius:"50%",mb:2}},w.icon),e.createElement(l,{sx:{fontWeight:800,fontSize:"1.35rem",pt:0,pb:1}},n)),e.createElement(u,null,e.createElement(p,{sx:{color:"text.secondary",fontWeight:500,lineHeight:1.6}},a)),e.createElement(m,{sx:{justifyContent:"center",gap:2,px:3,pb:3,mt:1}},e.createElement(f,{fullWidth:!0,variant:"text",color:"inherit",onClick:d,sx:{borderRadius:3,fontWeight:700,color:"text.disabled"}},h),e.createElement(f,{fullWidth:!0,variant:"contained",disableElevation:!0,color:"error"===W?"error":"primary",onClick:c,sx:{borderRadius:3,fontWeight:700,py:1}},y?e.createElement(v,{size:20,sx:{color:"inherit"}}):x)))},ve=function(t){var r=t.open,n=t.title,p=t.label,b=t.message,x=void 0===b?null:b,g=t.value,E=t.onSubmit,y=t.onCancel,S=t.size,W=void 0===S?"sm":S,w=t.rows,T=void 0===w?5:w,L=t.required,k=void 0!==L&&L,R=t.requiredMessage,O=void 0===R?"Υποχρεωτικό πεδίο":R,j=t.okLabel,I=void 0===j?"ΚΑΤΑΧΩΡΗΣΗ":j,P=t.cancelLabel,F=void 0===P?"ΑΚΥΡΩΣΗ":P,K=t.isLoading,B=void 0!==K&&K,D={notes:g||""},M=q.object({notes:k?q.string().required(O):q.string()}),V=C({defaultValues:D,resolver:z(M)});e.useEffect((function(){r&&(V.reset(D),V.clearErrors())}),[r,g]);return e.createElement(o,{fullWidth:!0,maxWidth:W,open:r,onClose:function(e,t){"escapeKeyDown"===t&&y()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(l,{sx:{pb:1.5}},e.createElement(a,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(h,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),x&&"string"==typeof x?e.createElement(c,{variant:"caption",color:"text.secondary"},x):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:V.handleSubmit((function(e){return E(e.notes)})),noValidate:!0},e.createElement(u,{sx:{mt:1}},x&&"string"!=typeof x&&e.createElement(s,{sx:{mb:2}},x),e.createElement(ne,{form:V,name:"notes",label:p,required:k,rows:T,autofocus:!0,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),y()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},F),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},B?e.createElement(v,{size:20,sx:{color:"inherit"}}):I))))},pe=function(t){var r=t.open,n=t.title,p=t.label,b=t.value,x=t.onSubmit,g=t.onCancel,E=t.size,y=void 0===E?"sm":E,S=t.required,W=void 0===S||S,w=t.requiredMessage,T=void 0===w?"Υποχρεωτικό πεδίο":w,L=t.okLabel,k=void 0===L?"ΚΑΤΑΧΩΡΗΣΗ":L,R=t.cancelLabel,O=void 0===R?"ΑΚΥΡΩΣΗ":R,j=t.message,I=void 0===j?null:j,P=t.isLoading,F=void 0!==P&&P,K={datetime:b},B=q.object({datetime:W?q.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").required(T):q.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").nullable()}),D=C({defaultValues:K,resolver:z(B)});e.useEffect((function(){r&&(D.reset(K),D.clearErrors())}),[r,b]);return e.createElement(o,{fullWidth:!0,maxWidth:y,open:r,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(l,{sx:{pb:1.5}},e.createElement(a,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(h,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),I&&"string"==typeof I?e.createElement(c,{variant:"caption",color:"text.secondary"},I):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:D.handleSubmit((function(e){return x(e.datetime)})),noValidate:!0},e.createElement(u,null,I&&"string"!=typeof I&&e.createElement(s,{sx:{mb:2}},I),e.createElement(ie,{form:D,name:"datetime",label:p,required:W,autofocus:!0,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},O),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},F?e.createElement(v,{size:20,sx:{color:"inherit"}}):k))))},be=function(t){var r=t.open,n=t.title,p=t.label,b=t.value,x=t.onSubmit,g=t.onCancel,E=t.size,y=void 0===E?"sm":E,S=t.required,W=void 0===S||S,w=t.requiredMessage,T=void 0===w?"Υποχρεωτικό πεδίο":w,L=t.okLabel,k=void 0===L?"ΚΑΤΑΧΩΡΗΣΗ":L,R=t.cancelLabel,O=void 0===R?"ΑΚΥΡΩΣΗ":R,j=t.message,I=void 0===j?null:j,P=t.isLoading,F=void 0!==P&&P,K={datetime:b},B=q.object({datetime:W?q.date().typeError("Μη έγκυρη μορφή ημερομηνίας").required(T):q.date().typeError("Μη έγκυρη μορφή ημερομηνίας").nullable()}),D=C({defaultValues:K,resolver:z(B)});e.useEffect((function(){r&&(D.reset(K),D.clearErrors())}),[r,b]);return e.createElement(o,{fullWidth:!0,maxWidth:y,open:r,onClose:function(e,t){"escapeKeyDown"===t&&g()},slots:{transition:i},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(l,{sx:{pb:1.5}},e.createElement(a,{direction:"row",spacing:2,alignItems:"center"},e.createElement(s,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(h,null)),e.createElement(s,null,e.createElement(c,{variant:"h6",fontWeight:700,lineHeight:1.2},n),I&&"string"==typeof I?e.createElement(c,{variant:"caption",color:"text.secondary"},I):null))),e.createElement(d,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:D.handleSubmit((function(e){return x(e.datetime)})),noValidate:!0},e.createElement(u,null,I&&"string"!=typeof I&&e.createElement(s,{sx:{mb:2}},I),e.createElement(ae,{form:D,name:"datetime",label:p,required:W,autofocus:!0,sx:{marginTop:1}})),e.createElement(m,{sx:{p:2,px:3}},e.createElement(f,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},O),e.createElement(f,{type:"submit",variant:"contained",color:"primary",sx:{borderRadius:2,px:4,fontWeight:700,boxShadow:"none",minWidth:150,"&:hover":{boxShadow:"0 4px 12px rgba(0,0,0,0.15)"}}},F?e.createElement(v,{size:20,sx:{color:"inherit"}}):k))))},xe=function(t){var r=t.label,o=t.value,i=t.render,l=void 0===i?null:i,s=t.fieldName,u=void 0===s?null:s,m=t.editable,v=void 0!==m&&m,p=t.required,h=void 0===p||p,S=t.placeholder,W=void 0===S?"":S,w=t.modalTitle,C=void 0===w?"Επεξεργασία":w,z=t.updateUrl,q=void 0===z?null:z,T=t.maxLength,L=void 0===T?255:T,k=t.message,R=void 0===k?null:k,O=t.hasDivider,j=void 0===O||O,I=Y(e.useState(!1),2),P=I[0],F=I[1],K=!o&&h,B=Y(e.useState(!1),2),D=B[0],M=B[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(x,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(x,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(x,{size:{xs:12,sm:6}},h&&!o?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},o||W)),e.createElement(x,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:K?"contained":"outlined",color:K?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),F(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),j&&e.createElement(d,{component:"li"}),e.createElement(se,{open:P,title:C,label:r,value:o,required:h,maxLength:L,onSubmit:function(e){M(!0),g.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){M(!1),F(!1)}})},onCancel:function(){return F(!1)},message:R,isLoading:D}))},ge=function(t){var r=t.label,o=t.value,i=t.render,l=void 0===i?null:i,s=t.fieldName,u=void 0===s?null:s,m=t.editable,v=void 0!==m&&m,p=t.required,h=void 0===p||p,S=t.placeholder,W=void 0===S?"":S,w=t.modalTitle,C=void 0===w?"Επεξεργασία":w,z=t.updateUrl,q=void 0===z?null:z,T=t.maxLength,L=void 0===T?255:T,k=t.message,R=void 0===k?null:k,O=t.hasDivider,j=void 0===O||O,I=Y(e.useState(!1),2),P=I[0],F=I[1],K=!o&&h,B=Y(e.useState(!1),2),D=B[0],M=B[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(x,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(x,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(x,{size:{xs:12,sm:6}},h&&!o?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},o||W)),e.createElement(x,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:K?"contained":"outlined",color:K?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),F(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),j&&e.createElement(d,{component:"li"}),e.createElement(de,{open:P,title:C,label:r,value:o,required:h,maxLength:L,onSubmit:function(e){M(!0),g.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){M(!1),F(!1)}})},onCancel:function(){return F(!1)},message:R,isLoading:D}))},he=function(t){var r,o=t.label,i=t.value,l=t.render,s=void 0===l?null:l,u=t.fieldName,m=void 0===u?null:u,v=t.editable,p=void 0!==v&&v,h=t.required,S=void 0===h||h,W=t.placeholder,w=void 0===W?"":W,C=t.modalTitle,z=void 0===C?"Επεξεργασία":C,q=t.updateUrl,k=void 0===q?null:q,O=t.message,j=void 0===O?null:O,I=t.hasDivider,P=void 0===I||I,F=Y(e.useState(!1),2),K=F[0],B=F[1],D=!i&&S,M=Y(e.useState(!1),2),V=M[0],A=M[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(x,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(x,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},o)),e.createElement(x,{size:{xs:12,sm:6}},S&&!i?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):s||e.createElement(c,{variant:"body1",fontWeight:500},i?(r=i)?T(L(r,{locale:R}),"dd/MM/yyyy, HH:mm"):"":w)),e.createElement(x,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},p&&e.createElement(f,{size:"small",variant:D?"contained":"outlined",color:D?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),B(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},i?"Επεξεργασία":"Συμπλήρωση")))),P&&e.createElement(d,{component:"li"}),e.createElement(pe,{open:K,title:z,label:o,value:i,required:S,onSubmit:function(e){A(!0),g.put(k,{field:m,value:e},{preserveScroll:!0,onFinish:function(){A(!1),B(!1)}})},onCancel:function(){return B(!1)},message:j,isLoading:V}))},Ee=function(t){var r=t.label,o=t.value,i=t.render,l=void 0===i?null:i,s=t.fieldName,u=void 0===s?null:s,m=t.editable,v=void 0!==m&&m,p=t.required,h=void 0===p||p,S=t.placeholder,W=void 0===S?"":S,w=t.modalTitle,C=void 0===w?"Επεξεργασία":w,z=t.updateUrl,q=void 0===z?null:z,k=t.message,O=void 0===k?null:k,j=t.hasDivider,I=void 0===j||j,P=Y(e.useState(!1),2),F=P[0],K=P[1],B=!o&&h,D=Y(e.useState(!1),2),M=D[0],V=D[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(x,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(x,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(x,{size:{xs:12,sm:6}},h&&!o?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},o?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/";return e?T(L(e,{locale:R}),"dd".concat(t,"MM").concat(t,"yyyy")):""}(o):W)),e.createElement(x,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:B?"contained":"outlined",color:B?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),K(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),I&&e.createElement(d,{component:"li"}),e.createElement(be,{open:F,title:C,label:r,value:o,required:h,onSubmit:function(e){V(!0),g.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){V(!1),K(!1)}})},onCancel:function(){return K(!1)},message:O,isLoading:M}))},ye=function(t){var r=t.label,o=t.value,i=t.render,l=void 0===i?null:i,s=t.fieldName,u=void 0===s?null:s,m=t.editable,v=void 0!==m&&m,p=t.required,h=void 0===p||p,S=t.placeholder,W=void 0===S?"":S,w=t.modalTitle,C=void 0===w?"Επεξεργασία":w,z=t.updateUrl,q=void 0===z?null:z,T=t.rows,L=void 0===T?5:T,k=t.message,R=void 0===k?null:k,O=t.hasDivider,j=void 0===O||O,I=Y(e.useState(!1),2),P=I[0],F=I[1],K=!o&&h,B=Y(e.useState(!1),2),D=B[0],M=B[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(x,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(x,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(x,{size:{xs:12,sm:6}},h&&!o?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},o||W)),e.createElement(x,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},v&&e.createElement(f,{size:"small",variant:K?"contained":"outlined",color:K?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),F(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),j&&e.createElement(d,{component:"li"}),e.createElement(ve,{open:P,title:C,label:r,value:o,required:h,rows:L,onSubmit:function(e){M(!0),g.put(q,{field:u,value:e},{preserveScroll:!0,onFinish:function(){M(!1),F(!1)}})},onCancel:function(){return F(!1)},message:R,isLoading:D}))},Se=function(t){var r=t.label,o=t.value,i=t.render,l=void 0===i?null:i,s=t.options,u=void 0===s?[]:s,m=t.valueKey,v=void 0===m?"id":m,p=t.labelKey,h=void 0===p?"label":p,S=t.fieldName,W=void 0===S?null:S,w=t.editable,C=void 0!==w&&w,z=t.required,q=void 0===z||z,T=t.placeholder,L=void 0===T?"":T,k=t.modalTitle,R=void 0===k?"Επεξεργασία":k,O=t.updateUrl,j=void 0===O?null:O,I=t.message,P=void 0===I?null:I,F=t.hasDivider,K=void 0===F||F,B=Y(e.useState(!1),2),D=B[0],M=B[1],V=null==o&&q,A=u.find((function(e){return e.id===o})),H=A?A.label:"",N=Y(e.useState(!1),2),U=N[0],$=N[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(x,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(x,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(x,{size:{xs:12,sm:6}},q&&null==o?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},H||L)),e.createElement(x,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},C&&e.createElement(f,{size:"small",variant:V?"contained":"outlined",color:V?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),M(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),K&&e.createElement(d,{component:"li"}),e.createElement(ue,{open:D,title:R,label:r,value:o,options:u,valueKey:v,labelKey:h,required:q,onSubmit:function(e){$(!0),g.put(j,{field:W,value:e.field},{preserveScroll:!0,onFinish:function(){$(!1),M(!1)}})},onCancel:function(){return M(!1)},message:P,isLoading:U}))},We=function(t){var r=t.label,n=t.value,o=t.render,i=void 0===o?null:o,l=t.fieldName,a=void 0===l?null:l,s=t.editable,u=void 0!==s&&s,m=t.activationLabel,v=void 0===m?"Ενεργοποίηση":m,p=t.deactivationLabel,h=void 0===p?"Απενεργοποίηση":p,E=t.activationMessage,y=void 0===E?"":E,w=t.deactivationMessage,C=void 0===w?"":w,z=t.updateUrl,q=void 0===z?null:z,T=t.hasDivider,L=void 0===T||T,k=Y(e.useState(!1),2),R=k[0],O=k[1],j=Y(e.useState(!1),2),I=j[0],P=j[1];return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(x,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(x,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(x,{size:{xs:12,sm:6}},i||e.createElement(c,{variant:"body1",fontWeight:500},n?1:0)),e.createElement(x,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},u&&e.createElement(f,{size:"small",variant:"outlined",color:n?"error":"success",startIcon:n?e.createElement(S,{fontSize:"small"}):e.createElement(W,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),O(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},n?h:v)))),L&&e.createElement(d,{component:"li"}),e.createElement(fe,{open:R,title:n?h:v,message:n?C:y,onConfirm:function(){P(!0),g.put(q,{field:a,value:n?0:1},{preserveScroll:!0,onFinish:function(){P(!1),O(!1)}})},onCancel:function(){return O(!1)},isLoading:I}))},we=function(t){var r=t.label,o=t.value,i=t.render,l=void 0===i?null:i,s=t.options,u=void 0===s?[]:s,m=t.valueKey,v=void 0===m?"id":m,p=t.labelKey,h=void 0===p?"label":p,S=t.fieldName,W=void 0===S?null:S,w=t.editable,C=void 0!==w&&w,z=t.required,q=void 0===z||z,T=t.placeholder,L=void 0===T?"":T,k=t.modalTitle,R=void 0===k?"Επεξεργασία":k,O=t.updateUrl,j=void 0===O?null:O,I=t.message,P=void 0===I?null:I,F=t.hasDivider,K=void 0===F||F,B=Y(e.useState(!1),2),D=B[0],M=B[1],V=null==o&&q,A=Y(e.useState(!1),2),H=A[0],N=A[1],U=u.filter((function(e){return o.some((function(t){return t[v]===e[v]}))})).map((function(e){return e[h]})).join(", ");return e.createElement(e.Fragment,null,e.createElement(b,{sx:{py:2.5,px:4}},e.createElement(x,{container:!0,spacing:2,sx:{width:"100%"},alignItems:"center"},e.createElement(x,{size:{xs:12,sm:3}},e.createElement(c,{variant:"subtitle2",color:"text.secondary",fontWeight:600},r)),e.createElement(x,{size:{xs:12,sm:6}},q&&null==o?e.createElement(a,{direction:"row",spacing:1,alignItems:"center"},e.createElement(c,{variant:"body1",color:"error.main",fontWeight:600},"Δεν έχει καταχωρηθεί"),e.createElement(n,{size:"small",color:"error",variant:"soft",label:"Απαιτείται",icon:e.createElement(E,{sx:{fontSize:"14px !important"}}),sx:{fontWeight:700,height:22}})):l||e.createElement(c,{variant:"body1",fontWeight:500},U||L)),e.createElement(x,{size:{xs:12,sm:3},sx:{display:"flex",justifyContent:"flex-end"}},C&&e.createElement(f,{size:"small",variant:V?"contained":"outlined",color:V?"error":"primary",startIcon:e.createElement(y,{fontSize:"small"}),onClick:function(e){e.currentTarget.blur(),M(!0)},sx:{borderRadius:2,textTransform:"none",fontWeight:700,minWidth:"120px"}},o?"Επεξεργασία":"Συμπλήρωση")))),K&&e.createElement(d,{component:"li"}),e.createElement(me,{open:D,title:R,label:r,value:o,options:u,valueKey:v,labelKey:h,required:q,onSubmit:function(e){N(!0),g.put(j,{field:W,value:e.field.map((function(e){return e[v]}))},{preserveScroll:!0,onFinish:function(){N(!1),M(!1)}})},onCancel:function(){return M(!1)},message:P,isLoading:H}))};export{we as AutocompleteMultiProperty,Se as AutocompleteProperty,Ee as DateProperty,he as DateTimeProperty,ge as EmailProperty,xe as StringProperty,ye as TextProperty,We as ToggleProperty};