@artibet/react-mui-components 3.8.8 → 3.8.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/modals/index.js +1 -1
- package/package.json +1 -1
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 s,Box as d,Divider as m,DialogContent as f,DialogActions as p,Button as v,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 R}from"@mui/x-date-pickers";import V from"date-fns/locale/el";import{Clear as P,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 D(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 F(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){F(i,n,o,a,l,"next",e)}function l(e){F(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 _(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 A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){M(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function H(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 s(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 d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var m="suspendedStart",f="suspendedYield",p="executing",v="completed",h={};function b(){}function g(){}function E(){}var x={};c(x,a,(function(){return this}));var y=Object.getPrototypeOf,w=y&&y(y(R([])));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=d(e[o],e,i);if("throw"!==u.type){var c=u.arg,s=c.value;return s&&"object"==typeof s&&n.call(s,"__await")?t.resolve(s.__await).then((function(e){r("next",e,a,l)}),(function(e){r("throw",e,a,l)})):t.resolve(s).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===p)throw Error("Generator is already running");if(o===v){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=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=d(t,r,n);if("normal"===c.type){if(o=n.done?v:f,c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=v,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=d(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 R(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(s(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=R,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:R(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 D(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)?D(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,s=r.disabled,d=void 0!==s&&s,m=r.autofocus,f=void 0!==m&&m,p=r.showErrors,v=void 0===p||p,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=H(r,U),S=n.control,q=n.formState.errors;return e.createElement(g,{name:o,control:S,rules:{required:c,disabled:d},render:function(r){var n,a,u=r.field,s=u.onChange,m=u.onBlur,p=u.value;return e.createElement(t,N({required:c,label:i,value:p,onChange:s,onBlur:m,error:v&&Boolean(null===(n=q[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:v&&(null===(a=q[o])||void 0===a?void 0:a.message),variant:"outlined",disabled:d,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,s=r.required,d=void 0===s||s,m=r.disabled,f=void 0!==m&&m,p=r.autofocus,v=void 0!==p&&p,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=H(r,$),W=n.control,L=n.formState.errors;return e.createElement(g,{name:i,control:W,rules:{required:d,disabled:f},render:function(r){var n,o,a=r.field,u=a.onChange,s=a.onBlur,m=a.value;return e.createElement(t,N({required:d,label:l,value:m,onChange:u,onBlur:s,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:v,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,s=void 0===c?"10px":c,d=t.paddingY,m=void 0===d?"5px":d,f=t.borderRadius,p=void 0===f?"10px":f,v=t.fontSize,h=void 0===v?"14px":v,b=t.width,g={text:{display:"inline-block",textAlign:"center",backgroundColor:u,paddingX:s,paddingY:m,borderRadius:p,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,s=void 0!==c&&c,d=r.options,m=void 0===d?[]:d,f=r.valueKey,p=void 0===f?"id":f,v=r.labelKey,h=void 0===v?"label":v,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,R=void 0===O?"#dddddd":O,V=r.bold,P=void 0!==V&&V,j=H(r,Q),z=Y(e.useState(null),2),B=z[0],K=z[1],D=o.watch(i);e.useEffect((function(){K(m.find((function(e){return e[p]===D}))||null)}),[D]);var F=o.control,I=o.formState.errors;return e.createElement(g,{name:i,control:F,rules:{required:u,disabled:s},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:P?"bold":"",backgroundColor:T?R:""}}},value:B?B.label:""}):e.createElement(n,{value:B,required:u,onChange:function(e,t){return l(t?t[p]:null)},options:m,isOptionEqualToValue:function(e,t){return e[p]===t[p]},noOptionsText:C,getOptionLabel:function(e){return e[h]},size:L,slotProps:{input:{maxLength:E,sx:{fontWeight:P?"bold":"",color:"red"}}},renderInput:function(r){var n,o;return e.createElement(t,N({label:a,required:u,disabled:s,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,s=r.disabled,d=void 0!==s&&s,m=r.options,f=void 0===m?[]:m,p=r.valueKey,v=void 0===p?"id":p,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=H(r,ie),k=Y(e.useState([]),2),T=k[0],O=k[1],R=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,R)})))}),[R]);var V=i.control,P=i.formState.errors;return e.createElement(g,{name:a,control:V,rules:{required:c,disabled:d},render:function(r){var i=r.field,u=i.onChange,s=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[v]===t[v]},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:d,autoFocus:w,inputProps:{maxLength:x},error:W&&Boolean(null===(n=P[a])||void 0===n?void 0:n.message),onBlur:s,variant:"outlined",fullWidth:!0,helperText:W&&(null===(o=P[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,s=void 0===c?null:c,d=r.valueKey,m=void 0===d?"id":d,f=r.labelKey,p=void 0===f?"label":f,v=r.minChars,h=void 0===v?2:v,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,R=r.placeholder,V=void 0===R?"":R,P=r.size,j=void 0===P?"medium":P,z=r.onChange,B=void 0===z?null:z,K=r.showErrors,D=void 0===K||K,F=r.readonly,M=void 0!==F&&F,_=r.readonlyBackgroundColor,A=void 0===_?"#dddddd":_,U=r.bold,X=void 0!==U&&U,$=H(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)}}(),se=e.useMemo((function(){return e=function(e,t,r){var n;"input"===r&&(n=t,ce(i.getValues(a),n))},t=300,function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];r&&clearTimeout(r),r=setTimeout((function(){e.apply(void 0,o)}),t)};var e,t,r}),[]);return e.createElement(g,{name:a,control:ae,rules:{required:E,disabled:y},render:function(r){var o=r.field,i=o.onChange,u=o.onBlur;return o.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?A:""}}},value:J?J.label:""}):e.createElement(n,{value:J,options:te,onInputChange:se,onChange:function(e,t){Q(t),i(t?t[m]:null),B&&B(t?t[m]:null)},isOptionEqualToValue:function(e,t){return e[m]===t[m]},getOptionLabel:function(e){return e[p]},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:D&&Boolean(null===(n=ue[a])||void 0===n?void 0:n.message),onBlur:u,variant:"outlined",fullWidth:!0,helperText:D&&(null===(o=ue[a])||void 0===o?void 0:o.message),size:j,maxLength:C},r,$))},renderOption:function(t,r,n){return s?s(t,r,n):e.createElement("li",N({},t,{key:r[m]}),r[p])}})}})})),ce=["form","name","label","rows","required","disabled","autofocus","showErrors"],se=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,s=r.disabled,d=void 0!==s&&s,m=r.autofocus,f=void 0!==m&&m,p=r.showErrors,v=void 0===p||p,h=H(r,ce),b=n.control,E=n.formState.errors;return e.createElement(g,{name:o,control:b,rules:{required:c,disabled:d},render:function(r){var n,a,u=r.field,s=u.onChange,m=u.onBlur,p=u.value;return e.createElement(t,N({required:c,label:i,value:p,multiline:!0,minRows:l,maxRows:l,onChange:s,onBlur:m,error:v&&Boolean(null===(n=E[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:v&&(null===(a=E[o])||void 0===a?void 0:a.message),variant:"outlined",disabled:d,autoFocus:f},h))}})},de=["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 s=r.showErrors,d=void 0===s||s,m=r.readonly,f=void 0!==m&&m,p=r.readonlyBackgroundColor,v=void 0===p?"#dddddd":p,h=r.bold,b=void 0!==h&&h,E=H(r,de),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 s=u.value;return e.createElement(q,N({customInput:t,variant:"outlined",label:i,required:l,disabled:c,value:s,thousandSeparator:".",decimalSeparator:",",decimalScale:2,fixedDecimalScale:!0,allowNegative:!1,onValueChange:w,error:d&&Boolean(null===(n=y[o])||void 0===n?void 0:n.message),helperText:d&&(null===(a=y[o])||void 0===a?void 0:a.message),fullWidth:!0,slotProps:{input:{readOnly:f,sx:{fontWeight:b?"bold":"",backgroundColor:f?v:""}}}},E))}})},fe=["form","name","label","required","disabled","autofocus","showErrors","ampm","singleTimeColumn","hoursStep","minutesStep","secondsStep"],pe=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,s=void 0===c||c,d=t.ampm,m=void 0!==d&&d,f=t.singleTimeColumn,p=void 0===f||f,v=t.hoursStep,h=void 0===v?1:v,b=t.minutesStep,E=void 0===b?15:b,x=t.secondsStep,y=void 0===x?30:x,w=H(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: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:p?["year","month","day","hours"]:["year","month","day","hours","minutes"],ampm:m,onChange:function(e){return l.onChange(e)},viewRenderers:p?{hours:T}:null,timeSteps:{hours:h,minutes:E,seconds:y},slotProps:{field:{clearable:!0,onClear:function(){return l.onChange(null)}},textField:A(A({},w),{},{required:a,error:s&&Boolean(null===(r=q[n])||void 0===r?void 0:r.message),helperText:s&&(null===(i=q[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},ve=["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,s=void 0===c||c,d=H(t,ve),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: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:{field:{clearable:!0,onClear:function(){return l.onChange(null)}},textField:A(A({},d),{},{required:a,error:s&&Boolean(null===(r=f[n])||void 0===r?void 0:r.message),helperText:s&&(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,s=r.disabled,d=void 0!==s&&s,m=r.autofocus,f=void 0!==m&&m,p=r.showErrors,v=void 0===p||p,h=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:d},render:function(r){var n,a,u=r.field;u.onChange,u.onBlur;var s=u.value;return e.createElement(q,N({customInput:t,variant:"outlined",label:i,required:c,disabled:d,value:s,thousandSeparator:!1,decimalSeparator:",",decimalScale:0,fixedDecimalScale:!0,allowNegative:l,onValueChange:x,error:v&&Boolean(null===(n=E[o])||void 0===n?void 0:n.message),helperText:v&&(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,s=r.disabled,d=void 0!==s&&s,m=r.showErrors,f=void 0===m||m,p=H(r,Ee),v=Y(e.useState(),2),h=v[0],b=v[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:d},render:function(r){var u,s,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===(s=y[o])||void 0===s?void 0:s.message),variant:"outlined",disabled:d,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(P,null))),readOnly:!0}},p))}}),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,s=void 0===c?15:c,d=t.secondsStep,m=void 0===d?30:d,f=t.singleTimeColumn,p=void 0===f||f,v=t.required,h=void 0!==v&&v,b=t.disabled,E=void 0!==b&&b;t.autofocus;var x=t.showErrors,y=void 0===x||x,w=H(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(R,{label:o,value:l.value?C(l.value):null,format:"HH:mm",inputFormat:!0,views:p?["hours"]:["hours","minutes"],ampm:a,onChange:function(e){return l.onChange(e)},viewRenderers:p?{hours:T}:null,timeSteps:{hours:u,minutes:s,seconds:m},slotProps:{textField:A(A({},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,R=void 0===O?"ΑΚΥΡΩΣΗ":O,V=t.maxLength,P=void 0===V?255:V,z=t.message,B=void 0===z?null:z,K=t.isLoading,D=void 0!==K&&K,F={text:a||""},I=y.object({text:q?y.string().max(P,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(P," χαρακτήρες")).required(L):y.string().max(P)}),M=E({defaultValues:F,resolver:x(I)});e.useEffect((function(){n&&(M.reset(F),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(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,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(d,{sx:{mb:2}},B),e.createElement(X,{form:M,name:"text",label:i,required:q,autofocus:!0,maxLength:P,sx:{mt:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},R),e.createElement(v,{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)"}}},D?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,R=void 0===O?"ΚΑΤΑΧΩΡΗΣΗ":O,V=t.cancelLabel,P=void 0===V?"ΑΚΥΡΩΣΗ":V,z=t.maxLength,B=void 0===z?255:z,K=t.message,D=void 0===K?null:K,F=t.isLoading,I=void 0!==F&&F,M={email:a||""},N=y.object({email:q?y.string().matches(Se,T).required(L):y.string().matches(Se,T)}),_=E({defaultValues:M,resolver:x(N)});e.useEffect((function(){n&&(_.reset(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(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),D&&"string"==typeof D?e.createElement(r,{variant:"caption",color:"text.secondary"},D):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:_.handleSubmit((function(e){return b(e.email)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},D&&"string"!=typeof D&&e.createElement(d,{sx:{mb:2}},D),e.createElement(Z,{form:_,label:i,required:q,autofocus:!0,maxLength:B,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},P),e.createElement(v,{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))))};!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,d=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(d)}),[r,d]);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(s,{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(p,null,e.createElement(v,{color:"success",onClick:function(){return n(T)}},q),e.createElement(v,{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,R=void 0===O?"sm":O,V=t.requiredMessage,P=void 0===V?"Υποχρεωτικό πεδίο":V,z=t.okLabel,B=void 0===z?"ΚΑΤΑΧΩΡΗΣΗ":z,K=t.cancelLabel,D=void 0===K?"ΑΚΥΡΩΣΗ":K,F=t.message,I=void 0===F?null:F,M=t.isLoading,N=void 0!==M&&M,_={field:a||null},A=y.object({field:T?y.string().required(P):y.string().nullable()}),H=E({defaultValues:_,resolver:x(A)});e.useEffect((function(){n&&(H.reset(_),H.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:R,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(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,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:H.handleSubmit((function(e){return b(e)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},e.createElement(ee,{form:H,name:"field",label:i,options:C,valueKey:q,labelKey:L,required:T,autofocus:!0,size:"medium",sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},D),e.createElement(v,{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,R=t.size,V=void 0===R?"sm":R,P=t.requiredMessage,z=void 0===P?"Επιλέξτε τουλάχιστον μία τιμή":P,B=t.okLabel,K=void 0===B?"ΚΑΤΑΧΩΡΗΣΗ":B,D=t.cancelLabel,F=void 0===D?"ΑΚΥΡΩΣΗ":D,I=t.message,M=void 0===I?null:I,N=t.isLoading,_=void 0!==N&&N,A={field:b||[]},H=y.object({field:O?y.array().min(1,z):y.array()}),G=E({defaultValues:A,resolver:x(H)});e.useEffect((function(){n&&(G.reset(A),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(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,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(d,{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(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),w()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},F),e.createElement(v,{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)"}}},_?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,s=t.confirmText,m=void 0===s?"ΕΠΙΒΕΒΑΙΩΣΗ":s,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(d,{sx:{display:"flex",flexDirection:"column",alignItems:"center",mt:3}},e.createElement(d,{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(p,{sx:{justifyContent:"center",gap:2,px:3,pb:3,mt:1}},e.createElement(v,{fullWidth:!0,variant:"text",color:"inherit",onClick:a,sx:{borderRadius:3,fontWeight:700,color:"text.disabled"}},E),e.createElement(v,{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,R=void 0===O?"Υποχρεωτικό πεδίο":O,V=t.okLabel,P=void 0===V?"ΚΑΤΑΧΩΡΗΣΗ":V,z=t.cancelLabel,B=void 0===z?"ΑΚΥΡΩΣΗ":z,K=t.isLoading,D=void 0!==K&&K,F={notes:g||""},I=y.object({notes:T?y.string().required(R):y.string()}),M=E({defaultValues:F,resolver:x(I)});e.useEffect((function(){n&&(M.reset(F),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(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,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(d,{sx:{mb:2}},b),e.createElement(se,{form:M,name:"notes",label:i,required:T,rows:L,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),C()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},B),e.createElement(v,{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)"}}},D?e.createElement(h,{size:20,sx:{color:"inherit"}}):P))))},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.minValue,L=void 0===W?null:W,k=t.maxValue,T=void 0===k?null:k,O=t.requiredMessage,R=void 0===O?"Υποχρεωτικό πεδίο":O,V=t.okLabel,P=void 0===V?"ΚΑΤΑΧΩΡΗΣΗ":V,z=t.cancelLabel,B=void 0===z?"ΑΚΥΡΩΣΗ":z,K=t.message,D=void 0===K?null:K,F=t.isLoading,I=void 0!==F&&F,M={poso:re(a)?a:null},N=y.object({poso:y.number().when([],{is:function(e){return q},then:function(e){return e.required(R)},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}})}),_=E({defaultValues:M,resolver:x(N)});e.useEffect((function(){n&&(_.reset(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(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),D&&"string"==typeof D?e.createElement(r,{variant:"caption",color:"text.secondary"},D):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:_.handleSubmit((function(e){return b(e.poso)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},e.createElement(me,{form:_,name:"poso",label:i,required:q,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},B),e.createElement(v,{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))))},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,R=void 0===O?"ΑΚΥΡΩΣΗ":O,V=t.message,P=void 0===V?null:V,z=t.isLoading,B=void 0!==z&&z,K={datetime:a},D=y.object({datetime:q?y.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").required(L):y.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").nullable()}),F=E({defaultValues:K,resolver:x(D)});e.useEffect((function(){n&&(F.reset(K),F.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(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),P&&"string"==typeof P?e.createElement(r,{variant:"caption",color:"text.secondary"},P):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:F.handleSubmit((function(e){return b(e.datetime)})),noValidate:!0},e.createElement(f,null,P&&"string"!=typeof P&&e.createElement(d,{sx:{mb:2}},P),e.createElement(pe,{form:F,name:"datetime",label:i,required:q,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},R),e.createElement(v,{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))))},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.requiredMessage,L=void 0===W?"Υποχρεωτικό πεδίο":W,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,O=t.cancelLabel,R=void 0===O?"ΑΚΥΡΩΣΗ":O,V=t.message,P=void 0===V?null:V,z=t.isLoading,B=void 0!==z&&z,K={datetime:a},D=y.object({datetime:q?y.date().typeError("Μη έγκυρη μορφή ημερομηνίας").required(L):y.date().typeError("Μη έγκυρη μορφή ημερομηνίας").nullable()}),F=E({defaultValues:K,resolver:x(D)});e.useEffect((function(){n&&(F.reset(K),F.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(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),P&&"string"==typeof P?e.createElement(r,{variant:"caption",color:"text.secondary"},P):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:F.handleSubmit((function(e){return b(e.datetime)})),noValidate:!0},e.createElement(f,null,P&&"string"!=typeof P&&e.createElement(d,{sx:{mb:2}},P),e.createElement(he,{form:F,name:"datetime",label:i,required:q,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},R),e.createElement(v,{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,s=t.onCancel,d=t.required,m=void 0===d||d,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()}),R=E({defaultValues:T,resolver:x(O)});return e.useEffect((function(){n&&(R.clearErrors(),R.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:R,name:"field",label:i,options:je,valueKey:"id",labelKey:"label",required:m,autofocus:!0,size:"medium",sx:{marginTop:2}})),e.createElement(p,null,e.createElement(v,{color:"success",onClick:R.handleSubmit((function(e){return u(e.field)}))},W),e.createElement(v,{color:"error",onClick:function(){return s()}},k)))},Be=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,a=t.onSubmit,u=t.onCancel,s=t.allowNegative,d=void 0!==s&&s,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,R=void 0===O?"ΑΚΥΡΩΣΗ":O;t.isLoading;var V={num:re(i)?i:null},P=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(P)});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:d,sx:{marginTop:2}})),e.createElement(p,null,e.createElement(v,{color:"success",onClick:j.handleSubmit((function(e){return a(e.num)}))},T),e.createElement(v,{color:"error",onClick:function(){return u()}},R)))},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,s=t.minValue,d=void 0===s?null:s,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,R=void 0===O?"ΑΚΥΡΩΣΗ":O;t.isLoading;var V={field:re(i)?i:null},P=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!==d},then:function(e){return e.min(d,"Η τιμή πρέπει να είναι μεγαλύτερη ή ίση από ".concat(oe(d,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(P)});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(p,null,e.createElement(v,{color:"success",onClick:j.handleSubmit((function(e){return b(e.field)}))},T),e.createElement(v,{color:"error",onClick:function(){return g()}},R)))},De=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(p,null,e.createElement(v,{color:"primary",onClick:function(e){e.stopPropagation(),i()}},u)))},Fe=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,d=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(s,{sx:{marginTop:2},gap:3},a&&e.createElement(X,{form:q,name:"descr",label:d,required:!0,autofocus:!0}),e.createElement(xe,{form:q,name:"filename",label:h,required:!0}))),e.createElement(p,null,e.createElement(v,{color:"success",onClick:q.handleSubmit(w)},"ΚΑΤΑΧΩΡΗΣΗ"),e.createElement(v,{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,R=t.requiredMessage,V=void 0===R?"Υποχρεωτικό πεδίο":R,P=t.minChars,z=void 0===P?1:P,B=t.okLabel,K=void 0===B?"ΚΑΤΑΧΩΡΗΣΗ":B,D=t.cancelLabel,F=void 0===D?"ΑΚΥΡΩΣΗ":D,I=t.message,M=void 0===I?null:I,N=t.isLoading,_=void 0!==N&&N,A={field:b||null},H=y.object({field:k?y.string().required(V):y.string().nullable()}),G=E({defaultValues:A,resolver:x(H)});e.useEffect((function(){n&&(G.reset(A),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(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,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(d,{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(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),w()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},F),e.createElement(v,{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)"}}},_?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,s=t.size,d=void 0===s?"sm":s,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:d,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(p,null,e.createElement(v,{color:"success",onClick:k.handleSubmit((function(e){return a(e.datetime)}))},C),e.createElement(v,{color:"error",onClick:function(){return u()}},q)))},Ne=function(t){var n=t.open,o=t.title,i=t.registrationNumber,a=t.registrationDate,b=t.registrationNumberLabel,g=void 0===b?"Αριθμός Πρωτοκόλλου":b,w=t.registrationDateLabel,C=void 0===w?"Ημερομηνία Πρωτοκόλλου":w,S=t.onSubmit,q=t.onCancel,W=t.size,L=void 0===W?"sm":W,k=t.required,T=void 0!==k&&k,O=t.registrationNumberRequiredMessage,R=void 0===O?"Συμπληρώστε τον αριθμό πρωτοκόλλου":O,V=t.registrationDateRequiredMessage,P=void 0===V?"Συμπληρώστε ή επιλέξτε την ημερομηνία πρωτοκόλλου":V,z=t.okLabel,B=void 0===z?"ΚΑΤΑΧΩΡΗΣΗ":z,K=t.cancelLabel,D=void 0===K?"ΑΚΥΡΩΣΗ":K,F=t.registrationNumberMaxLength,I=void 0===F?255:F,M=t.message,N=void 0===M?null:M,_=t.isLoading,A=void 0!==_&&_,H=e.useMemo((function(){return{registration_number:i||"",registration_date:a||null}}),[i,a]),G=y.object({registration_number:T?y.string().max(I,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(I," χαρακτήρες")).required(R):y.string().max(I,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(I," χαρακτήρες")),registration_date:T?y.date().typeError("Μη έγκυρη μορφή ημερομηνίας").required(P):y.date().typeError("Μη έγκυρη μορφή ημερομηνίας").nullable()}),Y=E({defaultValues:H,resolver:x(G)});e.useEffect((function(){n&&(Y.reset(H),Y.clearErrors())}),[n,H]);return e.createElement(l,{fullWidth:!0,maxWidth:L,open:n,onClose:function(e,t){"escapeKeyDown"===t&&q()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),N&&"string"==typeof N?e.createElement(r,{variant:"caption",color:"text.secondary"},N):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:Y.handleSubmit((function(e){return S(e)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},N&&"string"!=typeof N&&e.createElement(d,{sx:{mb:2}},N),e.createElement(s,{direction:"column",spacing:2.5},e.createElement(X,{form:Y,name:"registration_number",label:g,required:T,autofocus:!0,maxLength:I,sx:{mt:1}}),e.createElement(he,{form:Y,name:"registration_date",label:C,required:T,sx:{mt:1}}))),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),q()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},D),e.createElement(v,{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"}}):B))))};export{Ie as AutocompleteApiModalForm,Le as AutocompleteModalForm,ke as AutocompleteMultiModalForm,Te as ConfirmationDialog,Re as CurrencyModalForm,Pe as DateModalForm,Ve as DatetimeModalForm,Ke as DecimalModalForm,qe as EmailModalForm,Be as IntegerModalForm,De as MessageDialog,Oe as NotesModalForm,We as PickColorModalForm,Ne as RegistrationModalForm,Fe 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 a,Dialog as l,Zoom as u,DialogTitle as c,Stack as s,Box as d,Divider as m,DialogContent as f,DialogActions as p,Button as v,CircularProgress as h,DialogContentText as b}from"@mui/material";import{Controller as g,useForm as x}from"react-hook-form";import{yupResolver as E}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 R}from"@mui/x-date-pickers";import P from"date-fns/locale/el";import{Clear as V,EditNoteRounded as j}from"@mui/icons-material";import z from"@mui/icons-material/WarningAmberRounded";import K from"@mui/icons-material/ErrorOutlineRounded";import B from"@mui/icons-material/CheckCircleOutlineRounded";function D(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 F(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){F(i,n,o,a,l,"next",e)}function l(e){F(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 _(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 A(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_(Object(r),!0).forEach((function(t){M(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function H(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 s(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 d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var m="suspendedStart",f="suspendedYield",p="executing",v="completed",h={};function b(){}function g(){}function x(){}var E={};c(E,a,(function(){return this}));var y=Object.getPrototypeOf,w=y&&y(y(R([])));w&&w!==r&&n.call(w,a)&&(E=w);var C=x.prototype=b.prototype=Object.create(E);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=d(e[o],e,i);if("throw"!==u.type){var c=u.arg,s=c.value;return s&&"object"==typeof s&&n.call(s,"__await")?t.resolve(s.__await).then((function(e){r("next",e,a,l)}),(function(e){r("throw",e,a,l)})):t.resolve(s).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===p)throw Error("Generator is already running");if(o===v){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=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=p;var c=d(t,r,n);if("normal"===c.type){if(o=n.done?v:f,c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=v,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=d(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 R(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=x,o(C,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:g,configurable:!0}),g.displayName=c(x,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,x):(e.__proto__=x,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(s(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=R,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:R(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 D(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)?D(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,s=r.disabled,d=void 0!==s&&s,m=r.autofocus,f=void 0!==m&&m,p=r.showErrors,v=void 0===p||p,h=r.readonly,b=void 0!==h&&h,x=r.readonlyBackgroundColor,E=void 0===x?"#dddddd":x,y=r.bold,w=void 0!==y&&y,C=H(r,U),S=n.control,q=n.formState.errors;return e.createElement(g,{name:o,control:S,rules:{required:c,disabled:d},render:function(r){var n,a,u=r.field,s=u.onChange,m=u.onBlur,p=u.value;return e.createElement(t,N({required:c,label:i,value:p,onChange:s,onBlur:m,error:v&&Boolean(null===(n=q[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:v&&(null===(a=q[o])||void 0===a?void 0:a.message),variant:"outlined",disabled:d,autoFocus:f,slotProps:{input:{maxLength:l,readOnly:b,sx:{fontWeight:w?"bold":"",backgroundColor:b?E:""}}}},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,s=r.required,d=void 0===s||s,m=r.disabled,f=void 0!==m&&m,p=r.autofocus,v=void 0!==p&&p,h=r.showErrors,b=void 0===h||h,x=r.readonly,E=void 0!==x&&x,y=r.readonlyBackgroundColor,w=void 0===y?"#dddddd":y,C=r.bold,S=void 0!==C&&C,q=H(r,$),W=n.control,L=n.formState.errors;return e.createElement(g,{name:i,control:W,rules:{required:d,disabled:f},render:function(r){var n,o,a=r.field,u=a.onChange,s=a.onBlur,m=a.value;return e.createElement(t,N({required:d,label:l,value:m,onChange:u,onBlur:s,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:v,slotProps:{input:{maxLength:c,readOnly:E,sx:{fontWeight:S?"bold":"",backgroundColor:E?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,s=void 0===c?"10px":c,d=t.paddingY,m=void 0===d?"5px":d,f=t.borderRadius,p=void 0===f?"10px":f,v=t.fontSize,h=void 0===v?"14px":v,b=t.width,g={text:{display:"inline-block",textAlign:"center",backgroundColor:u,paddingX:s,paddingY:m,borderRadius:p,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,s=void 0!==c&&c,d=r.options,m=void 0===d?[]:d,f=r.valueKey,p=void 0===f?"id":f,v=r.labelKey,h=void 0===v?"label":v,b=r.maxLength,x=void 0===b?255:b,E=r.autofocus,y=void 0!==E&&E,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,R=void 0===O?"#dddddd":O,P=r.bold,V=void 0!==P&&P,j=H(r,Q),z=Y(e.useState(null),2),K=z[0],B=z[1],D=o.watch(i);e.useEffect((function(){B(m.find((function(e){return e[p]===D}))||null)}),[D]);var F=o.control,I=o.formState.errors;return e.createElement(g,{name:i,control:F,rules:{required:u,disabled:s},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:x,readOnly:T,sx:{fontWeight:V?"bold":"",backgroundColor:T?R:""}}},value:K?K.label:""}):e.createElement(n,{value:K,required:u,onChange:function(e,t){return l(t?t[p]:null)},options:m,isOptionEqualToValue:function(e,t){return e[p]===t[p]},noOptionsText:C,getOptionLabel:function(e){return e[h]},size:L,slotProps:{input:{maxLength:x,sx:{fontWeight:V?"bold":"",color:"red"}}},renderInput:function(r){var n,o;return e.createElement(t,N({label:a,required:u,disabled:s,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,s=r.disabled,d=void 0!==s&&s,m=r.options,f=void 0===m?[]:m,p=r.valueKey,v=void 0===p?"id":p,h=r.labelKey,b=void 0===h?"label":h,x=r.maxLength,E=void 0===x?255:x,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=H(r,ie),k=Y(e.useState([]),2),T=k[0],O=k[1],R=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,R)})))}),[R]);var P=i.control,V=i.formState.errors;return e.createElement(g,{name:a,control:P,rules:{required:c,disabled:d},render:function(r){var i=r.field,u=i.onChange,s=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[v]===t[v]},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:d,autoFocus:w,inputProps:{maxLength:E},error:W&&Boolean(null===(n=V[a])||void 0===n?void 0:n.message),onBlur:s,variant:"outlined",fullWidth:!0,helperText:W&&(null===(o=V[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,s=void 0===c?null:c,d=r.valueKey,m=void 0===d?"id":d,f=r.labelKey,p=void 0===f?"label":f,v=r.minChars,h=void 0===v?2:v,b=r.required,x=void 0!==b&&b,E=r.disabled,y=void 0!==E&&E,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,R=r.placeholder,P=void 0===R?"":R,V=r.size,j=void 0===V?"medium":V,z=r.onChange,K=void 0===z?null:z,B=r.showErrors,D=void 0===B||B,F=r.readonly,M=void 0!==F&&F,_=r.readonlyBackgroundColor,A=void 0===_?"#dddddd":_,U=r.bold,X=void 0!==U&&U,$=H(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)}}(),se=e.useMemo((function(){return e=function(e,t,r){var n;"input"===r&&(n=t,ce(i.getValues(a),n))},t=300,function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];r&&clearTimeout(r),r=setTimeout((function(){e.apply(void 0,o)}),t)};var e,t,r}),[]);return e.createElement(g,{name:a,control:ae,rules:{required:x,disabled:y},render:function(r){var o=r.field,i=o.onChange,u=o.onBlur;return o.value,M?e.createElement(t,{size:j,label:l,fullWidth:!0,required:x,slotProps:{input:{maxLength:C,readOnly:M,sx:{fontWeight:X?"bold":"",backgroundColor:M?A:""}}},value:J?J.label:""}):e.createElement(n,{value:J,options:te,onInputChange:se,onChange:function(e,t){Q(t),i(t?t[m]:null),K&&K(t?t[m]:null)},isOptionEqualToValue:function(e,t){return e[m]===t[m]},getOptionLabel:function(e){return e[p]},filterOptions:function(e){return e},noOptionsText:O,loadingText:k,loading:oe,required:x,size:j,renderInput:function(r){var n,o;return e.createElement(t,N({label:l,required:x,disabled:y,autoFocus:W,placeholder:P,error:D&&Boolean(null===(n=ue[a])||void 0===n?void 0:n.message),onBlur:u,variant:"outlined",fullWidth:!0,helperText:D&&(null===(o=ue[a])||void 0===o?void 0:o.message),size:j,maxLength:C},r,$))},renderOption:function(t,r,n){return s?s(t,r,n):e.createElement("li",N({},t,{key:r[m]}),r[p])}})}})})),ce=["form","name","label","rows","required","disabled","autofocus","showErrors"],se=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,s=r.disabled,d=void 0!==s&&s,m=r.autofocus,f=void 0!==m&&m,p=r.showErrors,v=void 0===p||p,h=H(r,ce),b=n.control,x=n.formState.errors;return e.createElement(g,{name:o,control:b,rules:{required:c,disabled:d},render:function(r){var n,a,u=r.field,s=u.onChange,m=u.onBlur,p=u.value;return e.createElement(t,N({required:c,label:i,value:p,multiline:!0,minRows:l,maxRows:l,onChange:s,onBlur:m,error:v&&Boolean(null===(n=x[o])||void 0===n?void 0:n.message),fullWidth:!0,helperText:v&&(null===(a=x[o])||void 0===a?void 0:a.message),variant:"outlined",disabled:d,autoFocus:f},h))}})},de=["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 s=r.showErrors,d=void 0===s||s,m=r.readonly,f=void 0!==m&&m,p=r.readonlyBackgroundColor,v=void 0===p?"#dddddd":p,h=r.bold,b=void 0!==h&&h,x=H(r,de),E=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:E,rules:{required:l,disabled:c},render:function(r){var n,a,u=r.field;u.onChange,u.onBlur;var s=u.value;return e.createElement(q,N({customInput:t,variant:"outlined",label:i,required:l,disabled:c,value:s,thousandSeparator:".",decimalSeparator:",",decimalScale:2,fixedDecimalScale:!0,allowNegative:!1,onValueChange:w,error:d&&Boolean(null===(n=y[o])||void 0===n?void 0:n.message),helperText:d&&(null===(a=y[o])||void 0===a?void 0:a.message),fullWidth:!0,slotProps:{input:{readOnly:f,sx:{fontWeight:b?"bold":"",backgroundColor:f?v:""}}}},x))}})},fe=["form","name","label","required","disabled","autofocus","showErrors","ampm","singleTimeColumn","hoursStep","minutesStep","secondsStep"],pe=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,s=void 0===c||c,d=t.ampm,m=void 0!==d&&d,f=t.singleTimeColumn,p=void 0===f||f,v=t.hoursStep,h=void 0===v?1:v,b=t.minutesStep,x=void 0===b?15:b,E=t.secondsStep,y=void 0===E?30:E,w=H(t,fe),S=r.control,q=r.formState.errors;return e.createElement(L,{dateAdapter:W,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:"Καθαρισμός"}},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:p?["year","month","day","hours"]:["year","month","day","hours","minutes"],ampm:m,onChange:function(e){return l.onChange(e)},viewRenderers:p?{hours:T}:null,timeSteps:{hours:h,minutes:x,seconds:y},slotProps:{field:{clearable:!0,onClear:function(){return l.onChange(null)}},textField:A(A({},w),{},{required:a,error:s&&Boolean(null===(r=q[n])||void 0===r?void 0:r.message),helperText:s&&(null===(i=q[n])||void 0===i?void 0:i.message),variant:"outlined",fullWidth:!0})}})}}))},ve=["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,s=void 0===c||c,d=H(t,ve),m=r.control,f=r.formState.errors;return e.createElement(L,{dateAdapter:W,adapterLocale:P,localeText:{fieldDayPlaceholder:function(e){return"ΗΗ"},fieldMonthPlaceholder:function(e){return"ΜΜ"},fieldYearPlaceholder:function(e){return"EEEE"},fieldClearLabel:"Καθαρισμός"}},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:{field:{clearable:!0,onClear:function(){return l.onChange(null)}},textField:A(A({},d),{},{required:a,error:s&&Boolean(null===(r=f[n])||void 0===r?void 0:r.message),helperText:s&&(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,s=r.disabled,d=void 0!==s&&s,m=r.autofocus,f=void 0!==m&&m,p=r.showErrors,v=void 0===p||p,h=H(r,be),b=n.control,x=n.formState.errors,E=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:d},render:function(r){var n,a,u=r.field;u.onChange,u.onBlur;var s=u.value;return e.createElement(q,N({customInput:t,variant:"outlined",label:i,required:c,disabled:d,value:s,thousandSeparator:!1,decimalSeparator:",",decimalScale:0,fixedDecimalScale:!0,allowNegative:l,onValueChange:E,error:v&&Boolean(null===(n=x[o])||void 0===n?void 0:n.message),helperText:v&&(null===(a=x[o])||void 0===a?void 0:a.message),fullWidth:!0,autoFocus:f},h))}})},xe=["form","name","label","required","disabled","showErrors"],Ee=function(r){var n=r.form,o=r.name,l=r.label,u=r.required,c=void 0!==u&&u,s=r.disabled,d=void 0!==s&&s,m=r.showErrors,f=void 0===m||m,p=H(r,xe),v=Y(e.useState(),2),h=v[0],b=v[1],x=e.useRef(null),E=n.control,y=n.formState.errors,w=function(){x.current.value=null,x.current.click()};return e.createElement(e.Fragment,null,e.createElement(g,{name:o,control:E,rules:{required:c,disabled:d},render:function(r){var u,s,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===(s=y[o])||void 0===s?void 0:s.message),variant:"outlined",disabled:d,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(V,null))),readOnly:!0}},p))}}),e.createElement("input",{type:"file",ref:x,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,s=void 0===c?15:c,d=t.secondsStep,m=void 0===d?30:d,f=t.singleTimeColumn,p=void 0===f||f,v=t.required,h=void 0!==v&&v,b=t.disabled,x=void 0!==b&&b;t.autofocus;var E=t.showErrors,y=void 0===E||E,w=H(t,ye),S=r.control,q=r.formState.errors;return e.createElement(L,{dateAdapter:W,adapterLocale:P,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:x},render:function(t){var r,i,l=t.field;return e.createElement(R,{label:o,value:l.value?C(l.value):null,format:"HH:mm",inputFormat:!0,views:p?["hours"]:["hours","minutes"],ampm:a,onChange:function(e){return l.onChange(e)},viewRenderers:p?{hours:T}:null,timeSteps:{hours:u,minutes:s,seconds:m},slotProps:{textField:A(A({},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,R=void 0===O?"ΑΚΥΡΩΣΗ":O,P=t.maxLength,V=void 0===P?255:P,z=t.message,K=void 0===z?null:z,B=t.isLoading,D=void 0!==B&&B,F={text:a||""},I=y.object({text:q?y.string().max(V,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(V," χαρακτήρες")).required(L):y.string().max(V)}),M=x({defaultValues:F,resolver:E(I)});e.useEffect((function(){n&&(M.reset(F),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(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),K&&"string"==typeof K?e.createElement(r,{variant:"caption",color:"text.secondary"},K):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}},K&&"string"!=typeof K&&e.createElement(d,{sx:{mb:2}},K),e.createElement(X,{form:M,name:"text",label:i,required:q,autofocus:!0,maxLength:V,sx:{mt:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},R),e.createElement(v,{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)"}}},D?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,R=void 0===O?"ΚΑΤΑΧΩΡΗΣΗ":O,P=t.cancelLabel,V=void 0===P?"ΑΚΥΡΩΣΗ":P,z=t.maxLength,K=void 0===z?255:z,B=t.message,D=void 0===B?null:B,F=t.isLoading,I=void 0!==F&&F,M={email:a||""},N=y.object({email:q?y.string().matches(Se,T).required(L):y.string().matches(Se,T)}),_=x({defaultValues:M,resolver:E(N)});e.useEffect((function(){n&&(_.reset(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(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),D&&"string"==typeof D?e.createElement(r,{variant:"caption",color:"text.secondary"},D):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:_.handleSubmit((function(e){return b(e.email)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},D&&"string"!=typeof D&&e.createElement(d,{sx:{mb:2}},D),e.createElement(Z,{form:_,label:i,required:q,autofocus:!0,maxLength:K,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},V),e.createElement(v,{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))))};!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,d=void 0===u?"#000000":u,m=t.pickerWidth,h=void 0===m?350:m,b=t.selectionTextColor,g=void 0===b?"white":b,x=t.paddingY,E=void 0===x?"10px":x,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(d)}),[r,d]);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(s,{gap:2},e.createElement(J,{color:g,backgroundColor:T,paddingX:C,paddingY:E,label:T}),e.createElement(w,{width:h,color:T,onChange:function(e){return O(e.hex)}}))),e.createElement(p,null,e.createElement(v,{color:"success",onClick:function(){return n(T)}},q),e.createElement(v,{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,R=void 0===O?"sm":O,P=t.requiredMessage,V=void 0===P?"Υποχρεωτικό πεδίο":P,z=t.okLabel,K=void 0===z?"ΚΑΤΑΧΩΡΗΣΗ":z,B=t.cancelLabel,D=void 0===B?"ΑΚΥΡΩΣΗ":B,F=t.message,I=void 0===F?null:F,M=t.isLoading,N=void 0!==M&&M,_={field:a||null},A=y.object({field:T?y.string().required(V):y.string().nullable()}),H=x({defaultValues:_,resolver:E(A)});e.useEffect((function(){n&&(H.reset(_),H.clearErrors())}),[n,a]);return e.createElement(l,{fullWidth:!0,maxWidth:R,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(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,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:H.handleSubmit((function(e){return b(e)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},e.createElement(ee,{form:H,name:"field",label:i,options:C,valueKey:q,labelKey:L,required:T,autofocus:!0,size:"medium",sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},D),e.createElement(v,{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"}}):K))))},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,R=t.size,P=void 0===R?"sm":R,V=t.requiredMessage,z=void 0===V?"Επιλέξτε τουλάχιστον μία τιμή":V,K=t.okLabel,B=void 0===K?"ΚΑΤΑΧΩΡΗΣΗ":K,D=t.cancelLabel,F=void 0===D?"ΑΚΥΡΩΣΗ":D,I=t.message,M=void 0===I?null:I,N=t.isLoading,_=void 0!==N&&N,A={field:b||[]},H=y.object({field:O?y.array().min(1,z):y.array()}),G=x({defaultValues:A,resolver:E(H)});e.useEffect((function(){n&&(G.reset(A),G.clearErrors())}),[n,b]);return e.createElement(l,{fullWidth:!0,maxWidth:P,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(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,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(d,{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(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),w()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},F),e.createElement(v,{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)"}}},_?e.createElement(h,{size:20,sx:{color:"inherit"}}):B))))},Te=function(t){var r=t.open,n=t.title,o=t.message,i=t.onConfirm,a=t.onCancel,s=t.confirmText,m=void 0===s?"ΕΠΙΒΕΒΑΙΩΣΗ":s,g=t.cancelText,x=void 0===g?"ΑΚΥΡΩΣΗ":g,E=t.isLoading,y=void 0!==E&&E,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(K,{sx:{fontSize:40}})},success:{color:"success.main",icon:e.createElement(B,{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(d,{sx:{display:"flex",flexDirection:"column",alignItems:"center",mt:3}},e.createElement(d,{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(p,{sx:{justifyContent:"center",gap:2,px:3,pb:3,mt:1}},e.createElement(v,{fullWidth:!0,variant:"text",color:"inherit",onClick:a,sx:{borderRadius:3,fontWeight:700,color:"text.disabled"}},x),e.createElement(v,{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,R=void 0===O?"Υποχρεωτικό πεδίο":O,P=t.okLabel,V=void 0===P?"ΚΑΤΑΧΩΡΗΣΗ":P,z=t.cancelLabel,K=void 0===z?"ΑΚΥΡΩΣΗ":z,B=t.isLoading,D=void 0!==B&&B,F={notes:g||""},I=y.object({notes:T?y.string().required(R):y.string()}),M=x({defaultValues:F,resolver:E(I)});e.useEffect((function(){n&&(M.reset(F),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(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,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(d,{sx:{mb:2}},b),e.createElement(se,{form:M,name:"notes",label:i,required:T,rows:L,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),C()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},K),e.createElement(v,{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)"}}},D?e.createElement(h,{size:20,sx:{color:"inherit"}}):V))))},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.minValue,L=void 0===W?null:W,k=t.maxValue,T=void 0===k?null:k,O=t.requiredMessage,R=void 0===O?"Υποχρεωτικό πεδίο":O,P=t.okLabel,V=void 0===P?"ΚΑΤΑΧΩΡΗΣΗ":P,z=t.cancelLabel,K=void 0===z?"ΑΚΥΡΩΣΗ":z,B=t.message,D=void 0===B?null:B,F=t.isLoading,I=void 0!==F&&F,M={poso:re(a)?a:null},N=y.object({poso:y.number().when([],{is:function(e){return q},then:function(e){return e.required(R)},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}})}),_=x({defaultValues:M,resolver:E(N)});e.useEffect((function(){n&&(_.reset(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(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),D&&"string"==typeof D?e.createElement(r,{variant:"caption",color:"text.secondary"},D):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:_.handleSubmit((function(e){return b(e.poso)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},e.createElement(me,{form:_,name:"poso",label:i,required:q,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},K),e.createElement(v,{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"}}):V))))},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.requiredMessage,L=void 0===W?"Υποχρεωτικό πεδίο":W,k=t.okLabel,T=void 0===k?"ΚΑΤΑΧΩΡΗΣΗ":k,O=t.cancelLabel,R=void 0===O?"ΑΚΥΡΩΣΗ":O,P=t.message,V=void 0===P?null:P,z=t.isLoading,K=void 0!==z&&z,B={datetime:a},D=y.object({datetime:q?y.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").required(L):y.date().typeError("Μη έγκυρη μορφή ημερομηνίας/ώρας").nullable()}),F=x({defaultValues:B,resolver:E(D)});e.useEffect((function(){n&&(F.reset(B),F.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(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),V&&"string"==typeof V?e.createElement(r,{variant:"caption",color:"text.secondary"},V):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:F.handleSubmit((function(e){return b(e.datetime)})),noValidate:!0},e.createElement(f,null,V&&"string"!=typeof V&&e.createElement(d,{sx:{mb:2}},V),e.createElement(pe,{form:F,name:"datetime",label:i,required:q,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},R),e.createElement(v,{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)"}}},K?e.createElement(h,{size:20,sx:{color:"inherit"}}):T))))},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,R=void 0===O?"ΑΚΥΡΩΣΗ":O,P=t.message,V=void 0===P?null:P,z=t.isLoading,K=void 0!==z&&z,B={datetime:a},D=y.object({datetime:q?y.date().typeError("Μη έγκυρη μορφή ημερομηνίας").required(L):y.date().typeError("Μη έγκυρη μορφή ημερομηνίας").nullable()}),F=x({defaultValues:B,resolver:E(D)});e.useEffect((function(){n&&(F.reset(B),F.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(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),V&&"string"==typeof V?e.createElement(r,{variant:"caption",color:"text.secondary"},V):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:F.handleSubmit((function(e){return b(e.datetime)})),noValidate:!0},e.createElement(f,null,V&&"string"!=typeof V&&e.createElement(d,{sx:{mb:2}},V),e.createElement(he,{form:F,name:"datetime",label:i,required:q,autofocus:!0,sx:{marginTop:1}})),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),g()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},R),e.createElement(v,{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)"}}},K?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,s=t.onCancel,d=t.required,m=void 0===d||d,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()}),R=x({defaultValues:T,resolver:E(O)});return e.useEffect((function(){n&&(R.clearErrors(),R.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:R,name:"field",label:i,options:je,valueKey:"id",labelKey:"label",required:m,autofocus:!0,size:"medium",sx:{marginTop:2}})),e.createElement(p,null,e.createElement(v,{color:"success",onClick:R.handleSubmit((function(e){return u(e.field)}))},W),e.createElement(v,{color:"error",onClick:function(){return s()}},k)))},Ke=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,a=t.onSubmit,u=t.onCancel,s=t.allowNegative,d=void 0!==s&&s,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,R=void 0===O?"ΑΚΥΡΩΣΗ":O;t.isLoading;var P={num:re(i)?i:null},V=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=x({defaultValues:P,resolver:E(V)});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:d,sx:{marginTop:2}})),e.createElement(p,null,e.createElement(v,{color:"success",onClick:j.handleSubmit((function(e){return a(e.num)}))},T),e.createElement(v,{color:"error",onClick:function(){return u()}},R)))},Be=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,a=t.decimals,u=void 0===a?2:a,s=t.minValue,d=void 0===s?null:s,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,R=void 0===O?"ΑΚΥΡΩΣΗ":O;t.isLoading;var P={field:re(i)?i:null},V=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!==d},then:function(e){return e.min(d,"Η τιμή πρέπει να είναι μεγαλύτερη ή ίση από ".concat(oe(d,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=x({defaultValues:P,resolver:E(V)});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(p,null,e.createElement(v,{color:"success",onClick:j.handleSubmit((function(e){return b(e.field)}))},T),e.createElement(v,{color:"error",onClick:function(){return g()}},R)))},De=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(p,null,e.createElement(v,{color:"primary",onClick:function(e){e.stopPropagation(),i()}},u)))},Fe=function(t){var n=t.open,o=t.title,i=void 0===o?"Νέο Αρχείο":o,a=t.description,u=void 0===a||a,b=t.descriptionLabel,g=void 0===b?"Περιγραφή Αρχείου":b,w=t.descriptionRequiredMessage,C=void 0===w?"Παρακαλώ συμπληρώστε την περιγραφή του αρχείου":w,S=t.fileSelectLabel,q=void 0===S?"Επιλογή Αρχείου":S,W=t.maxFileName,L=void 0===W?255:W,k=t.onSubmit,T=t.onCancel,O=t.okLabel,R=void 0===O?"ΚΑΤΑΧΩΡΗΣΗ":O,P=t.cancelLabel,V=void 0===P?"ΑΚΥΡΩΣΗ":P,z=t.message,K=void 0===z?null:z,B=t.isLoading,D=void 0!==B&&B,F={descr:"",filename:null},I=y.object({descr:u?y.string().required(C).max(L,"Το πεδίο δεν πρέπει να υπερβαίνει τους ".concat(L," χαρακτήρες")):y.string(),filename:y.mixed().required("Παρακαλώ επιλέξτε ένα αρχείο")}),M=x({defaultValues:F,resolver:E(I)});e.useEffect((function(){n&&(M.reset(F),M.clearErrors())}),[n]);return e.createElement(l,{maxWidth:"sm",fullWidth:!0,open:n,onClose:function(e,t){"escapeKeyDown"===t&&T()},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},i),K&&"string"==typeof K?e.createElement(r,{variant:"caption",color:"text.secondary"},K):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:M.handleSubmit(k),noValidate:!0},e.createElement(f,{sx:{mt:1}},K&&"string"!=typeof K&&e.createElement(d,{sx:{mb:2}},K),e.createElement(s,{sx:{marginTop:2},gap:3},u&&e.createElement(X,{form:M,name:"descr",label:g,required:!0,autofocus:!0}),e.createElement(Ee,{form:M,name:"filename",label:q,required:!0}))),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),T()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},V),e.createElement(v,{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)"}}},D?e.createElement(h,{size:20,sx:{color:"inherit"}}):R))))},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,R=t.requiredMessage,P=void 0===R?"Υποχρεωτικό πεδίο":R,V=t.minChars,z=void 0===V?1:V,K=t.okLabel,B=void 0===K?"ΚΑΤΑΧΩΡΗΣΗ":K,D=t.cancelLabel,F=void 0===D?"ΑΚΥΡΩΣΗ":D,I=t.message,M=void 0===I?null:I,N=t.isLoading,_=void 0!==N&&N,A={field:b||null},H=y.object({field:k?y.string().required(P):y.string().nullable()}),G=x({defaultValues:A,resolver:E(H)});e.useEffect((function(){n&&(G.reset(A),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(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,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(d,{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(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),w()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},F),e.createElement(v,{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)"}}},_?e.createElement(h,{size:20,sx:{color:"inherit"}}):B))))},Me=function(t){var r=t.open,n=t.title,o=t.label,i=t.value,a=t.onSubmit,u=t.onCancel,s=t.size,d=void 0===s?"sm":s,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=x({defaultValues:W,resolver:E(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:d,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(p,null,e.createElement(v,{color:"success",onClick:k.handleSubmit((function(e){return a(e.datetime)}))},C),e.createElement(v,{color:"error",onClick:function(){return u()}},q)))},Ne=function(t){var n=t.open,o=t.title,i=t.registrationNumber,a=t.registrationDate,b=t.registrationNumberLabel,g=void 0===b?"Αριθμός Πρωτοκόλλου":b,w=t.registrationDateLabel,C=void 0===w?"Ημερομηνία Πρωτοκόλλου":w,S=t.onSubmit,q=t.onCancel,W=t.size,L=void 0===W?"sm":W,k=t.required,T=void 0!==k&&k,O=t.registrationNumberRequiredMessage,R=void 0===O?"Συμπληρώστε τον αριθμό πρωτοκόλλου":O,P=t.registrationDateRequiredMessage,V=void 0===P?"Συμπληρώστε ή επιλέξτε την ημερομηνία πρωτοκόλλου":P,z=t.okLabel,K=void 0===z?"ΚΑΤΑΧΩΡΗΣΗ":z,B=t.cancelLabel,D=void 0===B?"ΑΚΥΡΩΣΗ":B,F=t.registrationNumberMaxLength,I=void 0===F?255:F,M=t.message,N=void 0===M?null:M,_=t.isLoading,A=void 0!==_&&_,H=e.useMemo((function(){return{registration_number:i||"",registration_date:a||null}}),[i,a]),G=y.object({registration_number:T?y.string().max(I,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(I," χαρακτήρες")).required(R):y.string().max(I,"Παρακαλώ πληκτρολογείστε μέχρι ".concat(I," χαρακτήρες")),registration_date:T?y.date().typeError("Μη έγκυρη μορφή ημερομηνίας").required(V):y.date().typeError("Μη έγκυρη μορφή ημερομηνίας").nullable()}),Y=x({defaultValues:H,resolver:E(G)});e.useEffect((function(){n&&(Y.reset(H),Y.clearErrors())}),[n,H]);return e.createElement(l,{fullWidth:!0,maxWidth:L,open:n,onClose:function(e,t){"escapeKeyDown"===t&&q()},slots:{transition:u},disableRestoreFocus:!1,slotProps:{paper:{sx:{borderRadius:3,p:.5}}}},e.createElement(c,{sx:{pb:1.5}},e.createElement(s,{direction:"row",spacing:2,alignItems:"center"},e.createElement(d,{sx:{bgcolor:"primary.light",color:"primary.main",p:1,borderRadius:2,display:"flex"}},e.createElement(j,null)),e.createElement(d,null,e.createElement(r,{variant:"h6",fontWeight:700,lineHeight:1.2},o),N&&"string"==typeof N?e.createElement(r,{variant:"caption",color:"text.secondary"},N):null))),e.createElement(m,{sx:{mx:3,opacity:.5}}),e.createElement("form",{onSubmit:Y.handleSubmit((function(e){return S(e)})),noValidate:!0},e.createElement(f,{sx:{mt:1}},N&&"string"!=typeof N&&e.createElement(d,{sx:{mb:2}},N),e.createElement(s,{direction:"column",spacing:2.5},e.createElement(X,{form:Y,name:"registration_number",label:g,required:T,autofocus:!0,maxLength:I,sx:{mt:1}}),e.createElement(he,{form:Y,name:"registration_date",label:C,required:T,sx:{mt:1}}))),e.createElement(p,{sx:{p:2,px:3}},e.createElement(v,{color:"inherit",onClick:function(e){e&&e.currentTarget.blur(),q()},sx:{fontWeight:700,color:"text.secondary",minWidth:150}},D),e.createElement(v,{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))))};export{Ie as AutocompleteApiModalForm,Le as AutocompleteModalForm,ke as AutocompleteMultiModalForm,Te as ConfirmationDialog,Re as CurrencyModalForm,Ve as DateModalForm,Pe as DatetimeModalForm,Be as DecimalModalForm,qe as EmailModalForm,Ke as IntegerModalForm,De as MessageDialog,Oe as NotesModalForm,We as PickColorModalForm,Ne as RegistrationModalForm,Fe as SelectFileModalForm,Ce as TextModalForm,Me as TimeModalForm,ze as YesNoModalForm};
|