@dartech/arsenal-ui 1.4.86 → 1.4.87
Sign up to get free protection for your applications and to get access to all the features.
- package/index.cjs.js +1 -0
- package/index.esm.js +1 -1
- package/package.json +4 -4
- /package/{index.esm.d.ts → index.cjs.d.ts} +0 -0
package/index.cjs.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@mui/material/styles"),r=require("react/jsx-runtime"),t=require("tslib"),l=require("@mui/material/TextField"),a=require("@mui/material/MenuItem"),n=require("react"),o=require("react-hook-form"),i=require("@mui/material/SvgIcon"),s=require("@mui/material/IconButton"),d=require("@mui/material/InputAdornment"),u=require("@mui/material/Button"),c=require("@mui/material/Dialog"),p=require("@mui/material/DialogActions"),m=require("@mui/material/DialogContent"),f=require("@mui/material/DialogContentText"),x=require("@mui/material/DialogTitle"),h=require("@mui/material/Box"),y=require("@mui/material/Typography"),g=require("@mui/material/CircularProgress"),b=require("@mui/material/FormControl"),C=require("@mui/material/FormControlLabel"),v=require("@mui/material/FormHelperText"),j=require("@mui/material/Checkbox"),T=require("@mui/material/Radio"),E=require("@mui/material/RadioGroup"),P=require("@mui/material/FormLabel"),S=require("@mui/material/Autocomplete"),O=require("lodash/get"),k=require("@tanstack/react-query"),w=require("qs"),M=require("@mui/material/Tooltip"),V=require("react-router-dom"),R=require("@uiw/react-codemirror"),F=require("@uiw/codemirror-extensions-langs"),L=require("@uiw/codemirror-theme-abcdef"),N=require("@mui/material/Switch"),D=require("@mui/x-date-pickers/DatePicker"),I=require("date-fns"),q=require("@mui/x-date-pickers/DateTimePicker"),A=require("@mui/x-date-pickers/TimePicker"),_=require("@mui/material/Chip"),$=require("@mui/material/Unstable_Grid2"),z=require("duration-fns"),B=require("react-input-mask"),H=require("@mui/material/Pagination"),W=require("@mui/material/TablePagination"),J=require("@mui/x-data-grid"),G=require("@mui/material/Table"),Y=require("@mui/material/TableBody"),Z=require("@mui/material/TableCell"),U=require("@mui/material/TableContainer"),K=require("@mui/material/TableHead"),X=require("@mui/material/TableRow"),Q=require("@mui/material/TableFooter"),ee=require("@mui/material/Backdrop"),re=require("@mui/material/TableSortLabel"),te=require("@mui/material/Menu"),le=require("@mui/icons-material/MoreHoriz"),ae=require("@mui/material/Paper"),ne=require("@mui/material/Tab"),oe=require("@mui/material/Tabs"),ie=require("@mui/material/Accordion"),se=require("@mui/material/AccordionSummary"),de=require("@mui/material/AccordionDetails"),ue=require("@mui/material/AccordionActions"),ce=require("@mui/icons-material"),pe=require("@mui/icons-material/Delete"),me=require("@mui/material/Stepper"),fe=require("@mui/material/Step"),xe=require("@mui/material/StepLabel"),he=require("@mui/material/StepContent"),ye=require("@mui/material/StepConnector"),ge=require("@mui/x-date-pickers/AdapterDateFns"),be=require("@mui/x-date-pickers/LocalizationProvider"),Ce=require("@mui/material/Select"),ve=require("@mui/material/InputLabel"),je=require("classnames"),Te=require("react-toastify"),Ee=require("@mui/material/CssBaseline"),Pe=require("@mui/material/Drawer"),Se=require("@mui/material/List"),Oe=require("@mui/material/ListItem"),ke=require("@mui/material/ListItemIcon"),we=require("@mui/material/ListItemButton"),Me=require("@mui/material/ListSubheader"),Ve=require("@mui/material/ListItemText"),Re=require("@mui/material/Toolbar"),Fe=require("@mui/material/ButtonBase"),Le=require("@mui/material/Collapse"),Ne=require("@mui/material/Breadcrumbs"),De=require("@mui/icons-material/NavigateNext");function Ie(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var qe,Ae=Ie(l),_e=Ie(a),$e=Ie(n),ze=Ie(i),Be=Ie(s),He=Ie(d),We=Ie(u),Je=Ie(c),Ge=Ie(p),Ye=Ie(m),Ze=Ie(f),Ue=Ie(x),Ke=Ie(h),Xe=Ie(y),Qe=Ie(g),er=Ie(b),rr=Ie(C),tr=Ie(v),lr=Ie(j),ar=Ie(T),nr=Ie(E),or=Ie(P),ir=Ie(S),sr=Ie(O),dr=Ie(w),ur=Ie(M),cr=Ie(R),pr=Ie(N),mr=Ie(_),fr=Ie($),xr=Ie(B),hr=Ie(H),yr=Ie(W),gr=Ie(G),br=Ie(Y),Cr=Ie(Z),vr=Ie(U),jr=Ie(K),Tr=Ie(X),Er=Ie(Q),Pr=Ie(ee),Sr=Ie(re),Or=Ie(te),kr=Ie(le),wr=Ie(ae),Mr=Ie(ne),Vr=Ie(oe),Rr=Ie(ie),Fr=Ie(se),Lr=Ie(de),Nr=Ie(ue),Dr=Ie(pe),Ir=Ie(me),qr=Ie(fe),Ar=Ie(xe),_r=Ie(he),$r=Ie(ye),zr=Ie(Ce),Br=Ie(ve),Hr=Ie(je),Wr=Ie(Ee),Jr=Ie(Pe),Gr=Ie(Se),Yr=Ie(Oe),Zr=Ie(ke),Ur=Ie(we),Kr=Ie(Me),Xr=Ie(Ve),Qr=Ie(Re),et=Ie(Fe),rt=Ie(Le),tt=Ie(Ne),lt=Ie(De);exports.PropertyType=void 0,(qe=exports.PropertyType||(exports.PropertyType={})).STRING="STRING",qe.INTEGER="INTEGER",qe.BIG_INTEGER="BIG_INTEGER",qe.BIG_DECIMAL="BIG_DECIMAL",qe.FLOAT="FLOAT",qe.LONG="LONG",qe.DOUBLE="DOUBLE",qe.BOOLEAN="BOOLEAN",qe.ENTITY_REFERENCE="ENTITY_REFERENCE",qe.ENTITY="ENTITY",qe.FILE="FILE",qe.FILE_REFERENCE="FILE_REFERENCE",qe.JSON="JSON",qe.DATE="DATE",qe.TIME="TIME",qe.DATE_TIME="DATE_TIME",qe.ANY="ANY";const at="yyyy-MM-dd",nt="HH:mm:ss",ot="yyyy-MM-dd'T'HH:mm:ss.SSSZ";var it;exports.RoundingMode=void 0,(it=exports.RoundingMode||(exports.RoundingMode={})).UP="UP",it.DOWN="DOWN",it.CEILING="CEILING",it.FLOOR="FLOOR",it.HALF_UP="HALF_UP",it.HALF_DOWN="HALF_DOWN",it.HALF_EVEN="HALF_EVEN",it.UNNECESSARY="UNNECESSARY";const st=({transparent:e,position:t,bgcolor:l})=>r.jsx(Ke.default,{position:null!=t?t:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:l||(e?"none":"rgba(255, 255, 255, .3)"),zIndex:10,children:r.jsx(Qe.default,{})}),dt="Please, fill this field",ut="Incorrect date format",ct=e=>{var l,{control:a,validate:n,name:i="",label:s="",required:d=!1,defaultValue:u="",disabled:c=!1,textarea:p=!1,hideErrorMessage:m=!1,onChange:f,requiredErrorText:x=""}=e,h=t.__rest(e,["control","validate","name","label","required","defaultValue","disabled","textarea","hideErrorMessage","onChange","requiredErrorText"]);const y=o.useController({name:i,control:a,defaultValue:u,rules:{required:!!d&&(x||dt),validate:n}}),g=y.field,{ref:b,onChange:C,value:v}=g,j=t.__rest(g,["ref","onChange","value"]),{fieldState:{error:T}}=y;return r.jsx(Ae.default,Object.assign({},j,{fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:b,name:i,label:d?r.jsxs(r.Fragment,{children:[s," ",r.jsx("span",{children:"*"})]}):s,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!T,helperText:!m&&(null==T?void 0:T.message),FormHelperTextProps:{variant:"standard"},disabled:c,multiline:p,minRows:p?3:1,value:null!=v?v:"",onChange:f||C,InputLabelProps:{shrink:!!h.placeholder},inputProps:Object.assign(Object.assign({},null!==(l=null==h?void 0:h.inputProps)&&void 0!==l?l:{}),{value:null!=v?v:""})},h))};function pt(e,r){const t=n.useRef();n.useEffect((()=>()=>{t.current&&clearTimeout(t.current)}),[]);return(...l)=>{clearTimeout(t.current),t.current=setTimeout((()=>{e(...l)}),r)}}const mt=()=>{const[e,r]=n.useState(!1);return{open:e,toggle:()=>{r((e=>!e))},onClose:()=>{r(!1)},onOpen:()=>{r(!0)}}},ft=()=>r.jsx(ze.default,{children:r.jsx("path",{d:"M4.22032 8.46991C4.36094 8.32946 4.55157 8.25057 4.75032 8.25057C4.94907 8.25057 5.13969 8.32946 5.28032 8.46991L12.0003 15.1899L18.7203 8.46991C18.789 8.39622 18.8718 8.33712 18.9638 8.29613C19.0558 8.25514 19.1551 8.23309 19.2558 8.23132C19.3565 8.22954 19.4565 8.24807 19.5499 8.28579C19.6433 8.32351 19.7281 8.37965 19.7994 8.45087C19.8706 8.52209 19.9267 8.60692 19.9644 8.70031C20.0022 8.7937 20.0207 8.89373 20.0189 8.99443C20.0171 9.09513 19.9951 9.19445 19.9541 9.28645C19.9131 9.37845 19.854 9.46125 19.7803 9.52991L12.5303 16.7799C12.3897 16.9204 12.1991 16.9992 12.0003 16.9992C11.8016 16.9992 11.6109 16.9204 11.4703 16.7799L4.22032 9.52991C4.07987 9.38928 4.00098 9.19866 4.00098 8.99991C4.00098 8.80116 4.07987 8.61054 4.22032 8.46991Z",fill:"#8B8C9E"})}),xt=e=>{var l,{control:a,validate:i,name:s="",label:d="",required:u=!1,defaultValue:c="",disabled:p=!1,hideErrorMessage:m=!1,onChange:f,labelKey:x,valueKey:h,options:y=[],requiredErrorText:g=""}=e,b=t.__rest(e,["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange","labelKey","valueKey","options","requiredErrorText"]);const C=o.useController({name:s,control:a,defaultValue:c,rules:{required:!!u&&(g||dt),validate:i}}),v=C.field,{ref:j,onChange:T,value:E}=v,P=t.__rest(v,["ref","onChange","value"]),{fieldState:{error:S}}=C,O=n.useCallback((e=>"string"==typeof e?e:h?e[h]:e.value),[h]),k=n.useCallback((e=>"string"==typeof e?e:x?e[x]:e.label),[x]),w=n.useCallback((()=>{f?f(null):T(null)}),[T,f]);return r.jsx(Ae.default,Object.assign({},P,{select:!0,fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:j,name:s,label:u?r.jsxs(r.Fragment,{children:[d," ",r.jsx("span",{children:"*"})]}):d,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!S,helperText:!m&&(null==S?void 0:S.message),FormHelperTextProps:{variant:"standard"},disabled:p,value:null!=E?E:"",onChange:f||T},b,{inputProps:Object.assign(Object.assign({},null!==(l=null==b?void 0:b.inputProps)&&void 0!==l?l:{}),{value:null!=E?E:""}),InputProps:Object.assign({endAdornment:!u&&E?r.jsx(He.default,{position:"end",sx:{mr:0},children:r.jsx(Be.default,{onClick:w,size:"small",children:r.jsx(ze.default,{fontSize:"small",children:r.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})})})}):null},null==b?void 0:b.InputProps),SelectProps:{sx:{"& .MuiSelect-select .notranslate::after":b.placeholder?{content:`"${b.placeholder}"`,opacity:.42}:{}}},children:y.map(((e,t)=>r.jsx(_e.default,{value:O(e),children:k(e)},t)))}))},ht=e=>{var{control:l,validate:a,name:i="",label:s="",required:d=!1,defaultValue:u,disabled:c=!1,hideErrorMessage:p=!1,onChange:m}=e,f=t.__rest(e,["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange"]);const x=o.useController({name:i,control:l,defaultValue:null!=u&&u}),h=x.field,{ref:y,onChange:g,value:b}=h,C=t.__rest(h,["ref","onChange","value"]),{fieldState:{error:v}}=x,j=n.useMemo((()=>{if("boolean"==typeof b)return b;if("string"==typeof b){if("false"===b)return g(!1),!1;if("true"===b)return g(!0),!0}return!1}),[b,g]);return r.jsxs(er.default,{error:!!v,component:"fieldset",variant:"standard",disabled:c,children:[r.jsx(rr.default,{control:r.jsx(lr.default,Object.assign({},C,{checked:j,onChange:m||g,name:i,inputRef:y,disabled:c},f)),label:s}),!p&&(null==v?void 0:v.message)&&r.jsx(tr.default,{variant:"standard",children:v.message})]})};var yt=({valueKey:e,labelKey:r})=>{const t=n.useCallback(((r,t)=>{if(r&&t){if("string"==typeof r)return r===t;if(e)return sr.default(r,e)===sr.default(t,e)||sr.default(r,e)===t;if(r.value)return r.value===t.value||r.value===t}return!1}),[e]),l=n.useCallback((e=>e?"string"==typeof e?e:r&&sr.default(e,r,"")?sr.default(e,r,"")+"":e.label+""||e.name+""||e.value+""||e.code+""||"--no label--":""),[r]),a=n.useCallback(((e,r)=>n.createElement(Ke.default,Object.assign({},e,{component:"li",key:e.id}),l(r))),[l]);return{isOptionEqualToValue:t,getOptionLabel:l,renderOption:a}};const gt=e=>{var{control:l,validate:a,name:i="",label:s="",required:d=!1,defaultValue:u="",disabled:c=!1,hideErrorMessage:p=!1,onChange:m,labelKey:f,valueKey:x,options:h=[],multiple:y,textFieldProps:g={},disableCloseOnSelect:b,useStringValue:C,requiredErrorText:v="",startAdornment:j,endAdornment:T}=e,E=t.__rest(e,["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange","labelKey","valueKey","options","multiple","textFieldProps","disableCloseOnSelect","useStringValue","requiredErrorText","startAdornment","endAdornment"]);const P=o.useController({name:i,control:l,defaultValue:u||(y?[]:null),rules:{required:!!d&&(v||dt),validate:a}}),S=P.field,{ref:O,onChange:k,value:w}=S,M=t.__rest(S,["ref","onChange","value"]),{fieldState:{error:V}}=P,[R,F]=n.useState(),{getOptionLabel:L,isOptionEqualToValue:N,renderOption:D}=yt({valueKey:x,labelKey:f});return n.useEffect((()=>{"string"==typeof w&&x&&C&&void 0===R&&h.length&&h[0]&&"object"==typeof h[0]&&F(h.find((e=>sr.default(e,x)===w)))}),[R,h,C,w,x]),r.jsx(ir.default,Object.assign({},M,{value:C?null!=R?R:null:w,fullWidth:!0,disablePortal:!0,size:"small",readOnly:c,options:h,multiple:y,getOptionLabel:L,isOptionEqualToValue:N,disableCloseOnSelect:b||y,filterSelectedOptions:y,onChange:m||((e,r)=>{k(C&&x?sr.default(r,x):r),F(r)}),renderOption:D,renderInput:e=>r.jsx(Ae.default,Object.assign({},e,{variant:"outlined",name:i,label:d?r.jsxs(r.Fragment,{children:[s," ",r.jsx("span",{children:"*"})]}):s,InputLabelProps:{shrink:!!(null==E?void 0:E.placeholder)},sx:{".MuiInputLabel-root span":{color:"#D6331F"}},placeholder:null==E?void 0:E.placeholder,error:!!V,inputRef:O,helperText:!p&&(null==V?void 0:V.message),FormHelperTextProps:{variant:"standard"},InputProps:Object.assign(Object.assign({},e.InputProps),{startAdornment:j||e.InputProps.startAdornment,endAdornment:T||e.InputProps.endAdornment})},g))},E))};const bt=()=>r.jsx("img",{src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M4.22032 8.46991C4.36094 8.32946 4.55157 8.25057 4.75032 8.25057C4.94907 8.25057 5.13969 8.32946 5.28032 8.46991L12.0003 15.1899L18.7203 8.46991C18.789 8.39622 18.8718 8.33712 18.9638 8.29613C19.0558 8.25514 19.1551 8.23309 19.2558 8.23132C19.3565 8.22954 19.4565 8.24807 19.5499 8.28579C19.6433 8.32351 19.7281 8.37965 19.7994 8.45087C19.8706 8.52209 19.9267 8.60692 19.9644 8.70031C20.0022 8.7937 20.0207 8.89373 20.0189 8.99443C20.0171 9.09513 19.9951 9.19445 19.9541 9.28645C19.9131 9.37845 19.854 9.46125 19.7803 9.52991L12.5303 16.7799C12.3897 16.9204 12.1991 16.9992 12.0003 16.9992C11.8016 16.9992 11.6109 16.9204 11.4703 16.7799L4.22032 9.52991C4.07987 9.38928 4.00098 9.19866 4.00098 8.99991C4.00098 8.80116 4.07987 8.61054 4.22032 8.46991Z' fill='%238B8C9E'/%3e%3c/svg%3e",alt:""});const Ct=({copyText:e,helpText:t="Copy"})=>{const[l,a]=n.useState(t);return l?r.jsx(ur.default,{title:l,placement:"top",children:r.jsx(Be.default,{onClick:()=>{navigator.clipboard.writeText(e),a("Copied!"),setTimeout((()=>{a(t)}),1e3)},children:r.jsx(ze.default,{fontSize:"small",children:r.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4 6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z"})})})}):null},vt=n.forwardRef(((e,l)=>{var{control:a,name:i,mode:s="json",label:d,width:u="100%",height:c="200px",readOnly:p,required:m=!1,validateJson:f=!1,hideErrorMessage:x=!1,fontSize:h=16,validate:y=!0,parseValue:g,requiredErrorText:b="",useCleanValue:C}=e,v=t.__rest(e,["control","name","mode","label","width","height","readOnly","required","validateJson","hideErrorMessage","fontSize","validate","parseValue","requiredErrorText","useCleanValue"]);const j=o.useController({control:a,name:i,rules:{required:!!m&&(b||dt),validate:e=>{if(e&&f&&"string"==typeof e)try{return JSON.parse(e),!0}catch(e){return console.error(e),"Invalid JSON"}return!0}}}),T=j.field,{onChange:E,value:P,ref:S}=T,O=t.__rest(T,["onChange","value","ref"]),{fieldState:{error:k}}=j,w=n.useMemo((()=>({json:[F.langs.json()],javascript:[F.langs.javascript()],python:[F.langs.python()]})),[]),M=n.useMemo((()=>"text"===s&&"string"!=typeof P?JSON.stringify(P,null,2):"json"===s&&"string"!=typeof P?null===P?"":C?JSON.stringify(P,null,2).replace(/\\"/g,""):JSON.stringify(P,null,2):"string"==typeof P&&"text"!==s&&C?P.replace(/\\"/g,""):P),[P,C,s]),V=n.useCallback((e=>{if(g)try{const r=JSON.parse(e);E(r)}catch(r){E(e)}else E(e)}),[E,g]);return r.jsxs(Ke.default,{display:"flex",flexDirection:"column",width:"100%",children:[r.jsx(Ke.default,{children:d&&r.jsx(Xe.default,{variant:"subtitle1",display:"inline",style:{marginRight:10},children:m?r.jsxs(r.Fragment,{children:[d," ",r.jsx(Ke.default,{component:"span",color:"#D6331F",children:"*"})]}):d})}),r.jsxs(r.Fragment,{children:[r.jsx(cr.default,Object.assign({},O,{ref:l||S,basicSetup:{autocompletion:!0,history:!0},theme:L.abcdef,width:u,height:c,style:{fontSize:h,lineHeight:1.4,zIndex:0,isolation:"isolate"},readOnly:p,value:M,onChange:V,extensions:"text"===s?[]:w[s]},v)),k&&!x&&r.jsx(tr.default,{variant:"standard",error:!0,children:k.message})]})]})})),jt=(e,r)=>{const t=[...e];return t.splice(r,1),t};const Tt=(e,r,t,l="asc")=>{const a=e[t],n=r[t];return a<n?"asc"===l?-1:1:a>n?"asc"===l?1:-1:0},Et=e=>{if(!e)return"";if("string"==typeof e)try{return JSON.stringify(JSON.parse(e),null,2)}catch(r){return e}else try{return JSON.stringify(e,null,2)}catch(e){return"Failed to stringify JSON"}},Pt=e=>{try{const r=JSON.parse(e);return Object.keys(r).forEach((e=>{r[e]=Pt(r[e])})),r}catch(r){return e}},St=n.forwardRef((({value:e,height:t=200,fontSize:l=16},a)=>{const[o,i]=n.useState(!0),s=n.useCallback((e=>{const r=t=>{e.scrollDOM.scrollHeight-e.scrollDOM.offsetHeight-t.target.scrollTop<10&&setTimeout((()=>e.scrollDOM.scrollTo(0,0)),200),0===t.target.scrollTop&&(i(!1),e.scrollDOM.removeEventListener("scroll",r))};e.scrollDOM.scrollHeight>3e4?(i(!0),e.scrollDOM.addEventListener("scroll",r),e.scrollDOM.scrollTo(0,e.scrollDOM.scrollHeight-1e3),setTimeout((()=>{e.scrollDOM.scrollTo({top:e.scrollDOM.scrollHeight,behavior:"smooth"})}),300)):i(!1)}),[]);return r.jsxs(Ke.default,{position:"relative",children:[o&&r.jsx(st,{bgcolor:"#fff"}),r.jsx(cr.default,{ref:a,readOnly:!0,width:"100%",value:"string"==typeof e?e:JSON.stringify(e,null,2),height:`${t}px`,basicSetup:{autocompletion:!0,history:!0,foldGutter:!0},onCreateEditor:s,extensions:[F.langs.json()],style:{fontSize:l,width:"100%"}})]})})),Ot=({open:e,onClose:t,value:l,jsonViewProps:a})=>{const o=n.useRef();return r.jsxs(Je.default,{disableEscapeKeyDown:!0,open:e,onClose:t,fullWidth:!0,maxWidth:"md",style:{width:800,left:"30%"},children:[r.jsx(Ye.default,{children:r.jsx(St,Object.assign({value:l},a,{ref:o}))}),r.jsxs(Ge.default,{children:[r.jsx(Ct,{copyText:l}),r.jsx(We.default,{onClick:t,variant:"contained",color:"secondary",children:"Close"})]})]})};var kt=({value:e,copyButton:t=!1,textField:l=!1})=>{const{open:a,onOpen:o,onClose:i}=mt(),s=n.useCallback((e=>{e.stopPropagation(),o()}),[o]);return r.jsxs(Ke.default,{width:"100%",children:[r.jsxs(Ke.default,{display:"flex",alignItems:"center",justifyContent:"flex-end",pt:1,mb:2,children:[t&&r.jsx(Ct,{copyText:Et(e)}),r.jsx(ur.default,{title:"Open",placement:"top",children:r.jsx(Be.default,{size:"small",onClick:s,children:r.jsx(ze.default,{children:r.jsx("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})})})})]}),l?r.jsx(Ke.default,{overflow:"hidden",whiteSpace:"nowrap",children:"object"==typeof e?JSON.stringify(e):e}):r.jsx(St,{value:e}),r.jsx(Ot,{open:a,value:Et(e),onClose:i,jsonViewProps:{height:450}})]})};const wt={spacing:4,palette:{primary:{main:"#E0613A",dark:"#d9512e",light:"#E0613A"},secondary:{main:"#007994",dark:"#262842",light:"#cbe8ee"},text:{disabled:"#A9A9B8"},success:{main:"#2DB77B",light:"#DBFCEE"},grey:{100:"#F7F8FC",700:"#101F2B"}},typography:{fontSize:14,allVariants:{fontFamily:["Euclid","-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto",'"Helvetica Neue"',"Arial","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"'].join(",")},h1:{fontWeight:400},h3:{fontWeight:500},h4:{fontWeight:500}}};var Mt=e.createTheme(wt);var Vt={components:{MuiButtonBase:{defaultProps:{disableElevation:!0},styleOverrides:{root:{"&.MuiButton-root":{boxShadow:"none"},"&.MuiButton-root:hover":{boxShadow:"none"},"&.MuiButton-containedPrimary:hover":{backgroundColor:"#D15C3B"},"&.MuiButton-outlinedPrimary:hover":{backgroundColor:"#F6F6F7",borderColor:"#DDDDE1"},"&.MuiButton-textPrimary":{color:Mt.palette.secondary.dark,"&:hover":{backgroundColor:"#F6F6F7"},"&:active":{backgroundColor:"#EEEEF0"}},"&.MuiButton-textSecondary":{color:Mt.palette.secondary.main,"&:hover":{backgroundColor:"#DEF7FC"},"&:active":{backgroundColor:"#CFE6ED"}}}}},MuiInputBase:{styleOverrides:{root:{color:"#262842",borderRadius:Mt.spacing(3),minWidth:Mt.spacing(25),background:Mt.palette.background.default,paddingRight:Mt.spacing(3)},input:{minWidth:Mt.spacing(25)}}},MuiSelect:{defaultProps:{IconComponent:ft},styleOverrides:{nativeInput:{padding:0,height:"32px"}}},MuiTextField:{styleOverrides:{root:{minWidth:Mt.spacing(25)}}},MuiInputLabel:{styleOverrides:{root:{color:"#6D6E85",position:"relative",overflow:"initial",transform:"none",marginBottom:Mt.spacing(1),fontWeight:500,fontSize:"14px",lineHeight:"20px",pointerEvents:"auto","&.Mui-focused":{color:"#6D6E85"}}}},MuiOutlinedInput:{styleOverrides:{root:{borderRadius:Mt.spacing(3),minWidth:Mt.spacing(25),"&:hover":{".MuiOutlinedInput-notchedOutline":{borderColor:"#8B8C9E"}},"&.Mui-focused":{".MuiOutlinedInput-notchedOutline":{borderColor:Mt.palette.secondary.main}}},notchedOutline:{top:0,"& legend":{display:"none",transition:"none"}}}},MuiAutocomplete:{defaultProps:{popupIcon:r.jsx(ft,{})},styleOverrides:{root:{"& .MuiOutlinedInput-root .MuiAutocomplete-endAdornment":{right:12}},paper:{marginTop:8,borderRadius:12,boxShadow:"0px 8px 16px rgba(0, 0, 0, 0.04)"},listbox:{"::-webkit-scrollbar":{width:"6px",backgroundColor:"white"},"::-webkit-scrollbar-thumb":{borderRadius:"10px",backgroundColor:"rgba(38, 40, 66, 0.24)"}}}},MuiMenu:{styleOverrides:{list:{paddingTop:0,paddingBottom:0,background:"white","& li.Mui-selected":{background:"rgba(38, 40, 66, 0.08) !important"}}}},MuiPopover:{styleOverrides:{paper:{marginTop:8,borderRadius:12,boxShadow:"0px 8px 16px rgba(0, 0, 0, 0.04)"}}},MuiFormLabel:{styleOverrides:{root:{color:"#6D6E85",fontSize:14,fontWeight:500,"&.Mui-focused":{color:"#6D6E85"},"& span":{color:"#D6331F"}},asterisk:{color:"#D6331F","&$error":{color:"#D6331F"}}}},MuiTooltip:{styleOverrides:{tooltip:{fontSize:14},backgroundColor:Mt.palette.secondary.dark,padding:Mt.spacing(2,3),borderRadius:8,textAlign:"center"}}}};var Rt={components:{MuiTableContainer:{styleOverrides:{root:{borderRadius:Mt.spacing(3),border:"1px solid rgba(38, 40, 66, 0.08)",overflow:"hidden"}}},MuiTableHead:{styleOverrides:{root:{backgroundColor:"#F7F8FC"}}},MuiTableRow:{styleOverrides:{root:{"&.MuiTableRow-hover":{"&:hover":{backgroundColor:"#F6F6F7"},"&:active, &:focus":{backgroundColor:"#EEEEF0"}},"&:active, &:focus":{backgroundColor:"#EEEEF0"}}}},MuiTableCell:{styleOverrides:{root:{padding:Mt.spacing(1,2),borderColor:"#26284214","&:first-of-type":{paddingLeft:Mt.spacing(4)}},head:{padding:Mt.spacing(2,2),color:"#6D6E85"},body:{wordBreak:"break-all"}}},MuiTableSortLabel:{styleOverrides:{root:{maxHeight:"24px",lineHeight:1}}},MuiTablePagination:{styleOverrides:{root:{"& .MuiInputBase-root":{border:"1px solid #2628421F",borderRadius:4,minWidth:58,height:32,paddingRight:Mt.spacing(2),"& .MuiSelect-select":{paddingRight:"4px !important",color:Mt.palette.secondary.dark,"&:focus":{backgroundColor:"transparent"}}}}}},MuiPaginationItem:{styleOverrides:{root:{height:32,minWidth:32,borderRadius:4,border:"1px solid transparent",margin:"0, 2px","&.Mui-selected":{borderColor:"#2628421F",backgroundColor:"#F7F8FC"}}}},MuiDataGrid:{defaultProps:{headerHeight:40,getRowHeight:()=>"auto"},styleOverrides:{root:{borderRadius:Mt.spacing(3),width:"100%",color:Mt.palette.secondary.dark,border:"1px solid #26284214","& .MuiDataGrid-actionsCell":{flexWrap:"wrap",width:"100%",'& > button[aria-label="more"]':{marginLeft:"auto"}}},columnHeaders:{backgroundColor:Mt.palette.grey[100],borderTopLeftRadius:Mt.spacing(3),borderTopRightRadius:Mt.spacing(3)},columnHeader:{"&:focus":{outline:"none"}},columnHeaderTitle:{color:"#6D6E85",fontWeight:500},row:{"&:hover":{backgroundColor:"#F6F6F7"},"&:active, &:focus":{backgroundColor:"#EEEEF0"}},columnSeparator:{display:"none"},withBorder:{borderColor:"#E0E3EA"},cell:{minHeight:"48px !important",textOverflow:"ellipsis",wordBreak:"break-all",lineHeight:"unset",padding:Mt.spacing(1.25,3),borderColor:"#E0E3EA","&:focus":{outline:"none"}}}}}};var Ft={components:{MuiStepIcon:{styleOverrides:{root:{fontSize:"20px",color:Mt.palette.text.disabled,"&.Mui-active, &.Mui-completed":{color:Mt.palette.secondary.main}}}}}};var Lt={components:{MuiTypography:{styleOverrides:{h1:{[Mt.breakpoints.up("lg")]:{fontSize:"1.5rem"}},h3:{fontSize:"1.25rem",[Mt.breakpoints.up("lg")]:{fontSize:"1.125rem"}},h4:{fontSize:"1rem",[Mt.breakpoints.up("lg")]:{fontSize:"1rem"}},subtitle2:{color:"#6D6E85"}}}}};const Nt=(()=>{if(document){const e="https://dev-qa-arsenal-frontend-fonts-bucket.s3.eu-north-1.amazonaws.com/fonts.css";if(!document.querySelectorAll(`link[href="${e}"]`).length){const r=document.createElement("link");r.href=e,r.rel="stylesheet",document.head.appendChild(r)}}return e.responsiveFontSizes(e.createTheme(Mt,{components:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Vt.components),Rt.components),Ft.components),Lt.components),{MuiToolbar:{styleOverrides:{root:{[Mt.breakpoints.up("sm")]:{minHeight:"56px"}}}},MuiAppBar:{styleOverrides:{root:{boxShadow:"none",backgroundColor:"#007F9B"}}},MuiButton:{styleOverrides:{root:{borderRadius:Mt.spacing(2.5),padding:Mt.spacing(2.5,4),lineHeight:"20px",fontSize:"1rem",textTransform:"none"},outlined:{color:"#262842",backgroundColor:"#FFFFFF !important",border:"1px solid rgba(38, 40, 66, 0.12)"},text:{color:Mt.palette.secondary.dark}}},MuiDialog:{styleOverrides:{root:{"& .MuiModal-backdrop":{background:"rgba(28, 55, 77, 0.5)",backdropFilter:"blur(2px)"}},paper:{borderRadius:Mt.spacing(3)},paperWidthXs:{maxWidth:500}}},MuiDialogContent:{styleOverrides:{root:{color:"#6D6E85"}}},MuiDialogActions:{styleOverrides:{root:{background:"#F7F8FC",borderTop:"1px solid rgba(38, 40, 66, 0.08)",padding:Mt.spacing(3,6)}}},MuiTabs:{styleOverrides:{root:{minHeight:"38px"},indicator:{backgroundColor:Mt.palette.secondary.main}}},MuiTab:{styleOverrides:{root:{fontSize:14,fontWeight:500,textTransform:"none",padding:"10px 12px",lineHeight:"1.125rem",minHeight:"38px",color:"#8B8C9E","&.Mui-selected":{color:Mt.palette.secondary.main}}}}})}))})(),Dt=new RegExp("^[-+]?[0-9]+$"),It=new RegExp(/^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/),qt=(e,r)=>{if("string"==typeof e)return/[$%#{<]{1}(?:S?JS)?(?:[{(%#>]|\()/g.test(e);if(r){if(Array.isArray(e))for(const t of e)if(qt(t,r))return!0;if("object"==typeof e)for(const t in e)if(qt(e[t],r))return!0}return!1},At=new Intl.NumberFormat("ru-RU",{style:"decimal"}),_t=e=>!e&&0!==e&&!1!==e,$t=(e,r,t)=>{if(null==r)return null;if(qt(r))return r;let l=r;switch(e){case exports.PropertyType.BOOLEAN:l=!!r||!(!r&&null!==r)&&null;break;case exports.PropertyType.INTEGER:case exports.PropertyType.BIG_INTEGER:case exports.PropertyType.BIG_DECIMAL:case exports.PropertyType.FLOAT:case exports.PropertyType.LONG:case exports.PropertyType.DOUBLE:l=Number(r);break;case exports.PropertyType.DATE:case exports.PropertyType.DATE_TIME:case exports.PropertyType.TIME:if(r)try{const e=t.formatText.replace(/[Z,z,x]+/g,"XX");l=I.format(I.parse(r,e,new Date),e)}catch(e){console.error(e)}break;case exports.PropertyType.JSON:try{"string"!=typeof r&&(l=JSON.stringify(r)),l=JSON.parse(l)}catch(e){console.log(e),l=null}break;case exports.PropertyType.ANY:try{l="string"==typeof r?JSON.parse(l):r}catch(e){l=r}break;case exports.PropertyType.ENTITY:l=zt(t.properties,r)}return l},zt=(e,r)=>{if(r){const t={};return e.forEach((e=>{const{key:l,propertyType:a}=e,n=r[l];Array.isArray(n)?t[l]=n.map((r=>$t(a,r,{formatText:e.format,properties:e.properties}))):t[l]=$t(a,n,{formatText:e.format,properties:e.properties})})),t}return null},Bt=(e,r)=>{const t={};return e.forEach((e=>{const{key:l,name:a,isRequired:n,isMultiple:o,sortOrder:i,isEnabled:s,uiSettings:d,validationNode:u}=e,c=e.propertyType?"string"==typeof e.propertyType?e.propertyType:e.propertyType.value:null,p=Object.assign({name:a,propertyType:c,isRequired:n,isMultiple:o,sortOrder:i,isEnabled:s,validationNode:u,uiSettings:d},((e,r)=>{const t={};let l,a="";return r?e.isMultiple?(a="values",l=e.value):(a="value",l=e.value):e.isMultiple?(a="defaultValues",l=e.defaultValue):(a="defaultValue",l=e.defaultValue),Array.isArray(l)?t[a]=l.map((r=>$t(e.propertyType,r,{formatText:e.format,properties:e.properties}))):t[a]=$t(e.propertyType,l,{formatText:e.format,properties:e.properties}),t})(Object.assign(Object.assign({},e),{propertyType:c}),r));if("isViewableInList"in e&&(p.isViewableInList=e.isViewableInList),d)if("string"==typeof d)try{p.uiSettings=JSON.parse(d)}catch(e){console.log(e),p.uiSettings=d}else p.uiSettings=d;else p.uiSettings=null;c===exports.PropertyType.BIG_DECIMAL&&(p.precisionScale=e.precisionScale,p.roundingMode=e.roundingMode),c!==exports.PropertyType.DATE&&c!==exports.PropertyType.TIME&&c!==exports.PropertyType.DATE_TIME||(p.format=e.format),c===exports.PropertyType.STRING&&(p.restrictedValues=e.restrictedValues),c===exports.PropertyType.ENTITY_REFERENCE&&(p.source=e.source,p.definitionCode=e.definitionCode,p.definitionVersion=e.definitionVersion,p.labelPropertyCode=e.labelPropertyCode,p.valuePropertyCode=e.valuePropertyCode),c===exports.PropertyType.ENTITY&&(p.properties=Bt(e.properties,r)),t[l]=p})),t};function Ht(e,r){return Object.keys(e).map((t=>{const l=Object.assign(Object.assign({key:t},e[t]),r||{});if(l.propertyType===exports.PropertyType.ENTITY&&(l.properties=Ht(l.properties,r)),l.propertyType===exports.PropertyType.JSON)try{null==l.defaultValue?l.defaultValue="":l.defaultValue=JSON.stringify(l.defaultValue,null,2)}catch(e){l.defaultValue=""}return l.isMultiple&&("defaultValues"in l&&(l.defaultValue=l.defaultValues),"values"in l&&(l.value=l.values)),l})).sort(((e,r)=>Tt(e,r,"sortOrder")))}const Wt=e=>{let r=[];return r=Array.isArray(e.properties)?e.properties:Ht(e.properties),r.reduce(((e,r)=>{const t=JSON.parse(JSON.stringify(e));return r.propertyType===exports.PropertyType.ENTITY?t[r.key]=Wt(r):t[r.key]=r.propertyType,t}),{})},Jt=({propertyType:e,useExpression:r,required:t})=>{let l=[{value:"widget",label:"Fill array (widget)",sortOrder:1}];return t||l.push({value:"null",label:"NULL",sortOrder:0}),r&&(e===exports.PropertyType.JSON||e===exports.PropertyType.ENTITY||e===exports.PropertyType.ANY?l.push({value:"expression",label:"Expression (JSON editor)",sortOrder:3}):l.push({value:"expression",label:"Expression",sortOrder:3})),e!==exports.PropertyType.JSON&&e!==exports.PropertyType.ANY&&e!==exports.PropertyType.ENTITY||l.push({value:"json_valid",label:"JSON editor",sortOrder:2}),l=l.sort(((e,r)=>Tt(e,r,"sortOrder"))),l},Gt=({propertyType:e,useExpression:r,required:t})=>{let l=[{value:"widget",label:"Widget",sortOrder:1}];switch(t||l.push({value:"null",label:"NULL",sortOrder:0}),r&&(e===exports.PropertyType.JSON||e===exports.PropertyType.ENTITY||e===exports.PropertyType.ANY?l.push({value:"expression",label:"Expression (JSON editor)",sortOrder:3}):l.push({value:"expression",label:"Expression",sortOrder:3})),e===exports.PropertyType.JSON&&l.push({value:"dem_builder",label:"DEM Builder",sortOrder:2}),e){case exports.PropertyType.STRING:l[0].label="Text input";break;case exports.PropertyType.INTEGER:case exports.PropertyType.BIG_INTEGER:case exports.PropertyType.BIG_DECIMAL:case exports.PropertyType.FLOAT:case exports.PropertyType.LONG:case exports.PropertyType.DOUBLE:l[0].label="Number input";break;case exports.PropertyType.BOOLEAN:l[0].label="Switch";break;case exports.PropertyType.ENTITY_REFERENCE:l[0].label="Entity reference field";break;case exports.PropertyType.JSON:l[0].label="JSON editor";break;case exports.PropertyType.DATE:l[0].label="Date picker",l.push({value:"string",label:"Text input",sortOrder:2});break;case exports.PropertyType.DATE_TIME:l[0].label="Date & Time picker",l.push({value:"string",label:"Text input",sortOrder:2});break;case exports.PropertyType.TIME:l[0].label="Time picker",l.push({value:"string",label:"Text input",sortOrder:2});break;case exports.PropertyType.ANY:l[0].label="Textarea"}return l=l.sort(((e,r)=>Tt(e,r,"sortOrder"))),l},Yt={required:dt,notValidNumber:"Not valid number",notValidInteger:"Not valid integer"},Zt=e=>{var l,a,{control:i,validate:s,name:d="",label:u="",required:c=!1,defaultValue:p=null,disabled:m=!1,hideErrorMessage:f=!1,onChange:x,decimal:h=!1,valueAsNumber:y=!0,useFormattedInputValue:g=!1,errorText:b}=e,C=t.__rest(e,["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange","decimal","valueAsNumber","useFormattedInputValue","errorText"]);const v=n.useMemo((()=>b||Yt),[b]),j=o.useController({name:d,control:i,defaultValue:p,rules:{required:!!c&&v.required,validate:e=>0==+e||(null===e?!c||v.required:h&&!It.test(e)||/^-*0+$/.test(e)?v.notValidNumber:h||Dt.test(e)?!s||("function"!=typeof s||s(e)):v.notValidInteger)}}),T=j.field,{ref:E,onChange:P,value:S}=T,O=t.__rest(T,["ref","onChange","value"]),{fieldState:{error:k}}=j;return r.jsx(Ae.default,Object.assign({},O,{fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:E,name:d,label:c?r.jsxs(r.Fragment,{children:[u," ",r.jsx("span",{children:"*"})]}):u,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!k,helperText:!f&&(null==k?void 0:k.message),disabled:m,value:g?null!==(l=null==S?void 0:S.toLocaleString("ru-Ru",{maximumFractionDigits:10}).replace(",","."))&&void 0!==l?l:"":null!=S?S:"",onChange:e=>{var r;const t=e.target.value.replace(/\s/g,""),l=e.nativeEvent.data;if(!isNaN(l)||h&&"."===l||"-"===l||"+"===l||t){if(x)x(e);else if(y)if(e.target.value)if("0"===e.target.value)P(0);else if(h){const l=e.target.value.split(".")[1];P(!It.test(t)||/^0+$/.test(l)||/^-*0+$/.test(t)?e.target.value:+parseFloat(t).toFixed(null!==(r=null==l?void 0:l.length)&&void 0!==r?r:0))}else P(Number.isNaN(+t)?e.target.value:+t);else P(null)}else P(e.target.value)},FormHelperTextProps:{variant:"standard"},inputProps:Object.assign({},null!==(a=null==C?void 0:C.inputProps)&&void 0!==a?a:{})},C))},Ut=e=>{var{control:l,name:a,label:i}=e,s=t.__rest(e,["control","name","label"]);const d=o.useController({control:l,name:a}).field,{ref:u,onChange:c,value:p}=d,m=t.__rest(d,["ref","onChange","value"]),f=n.useMemo((()=>{if("boolean"==typeof p)return p;if("string"==typeof p){if("false"===p)return c(!1),!1;if("true"===p)return c(!0),!0}return!1}),[p,c]);n.useEffect((()=>{null===p&&c(!1)}),[p,c]);return r.jsx(rr.default,{label:i,name:a,control:r.jsx(pr.default,Object.assign({},m,{color:"primary",size:"small",inputRef:u,onChange:e=>{const{checked:r}=e.target;c(r)},checked:f},s))})};var Kt="data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M17.75 3C18.612 3 19.4386 3.34241 20.0481 3.9519C20.6576 4.5614 21 5.38805 21 6.25V17.75C21 18.612 20.6576 19.4386 20.0481 20.0481C19.4386 20.6576 18.612 21 17.75 21H6.25C5.38805 21 4.5614 20.6576 3.9519 20.0481C3.34241 19.4386 3 18.612 3 17.75V6.25C3 5.38805 3.34241 4.5614 3.9519 3.9519C4.5614 3.34241 5.38805 3 6.25 3H17.75ZM19.5 8.5H4.5V17.75C4.5 18.716 5.284 19.5 6.25 19.5H17.75C18.2141 19.5 18.6592 19.3156 18.9874 18.9874C19.3156 18.6592 19.5 18.2141 19.5 17.75V8.5ZM7.75 14.5C8.08152 14.5 8.39946 14.6317 8.63388 14.8661C8.8683 15.1005 9 15.4185 9 15.75C9 16.0815 8.8683 16.3995 8.63388 16.6339C8.39946 16.8683 8.08152 17 7.75 17C7.41848 17 7.10054 16.8683 6.86612 16.6339C6.6317 16.3995 6.5 16.0815 6.5 15.75C6.5 15.4185 6.6317 15.1005 6.86612 14.8661C7.10054 14.6317 7.41848 14.5 7.75 14.5ZM12 14.5C12.3315 14.5 12.6495 14.6317 12.8839 14.8661C13.1183 15.1005 13.25 15.4185 13.25 15.75C13.25 16.0815 13.1183 16.3995 12.8839 16.6339C12.6495 16.8683 12.3315 17 12 17C11.6685 17 11.3505 16.8683 11.1161 16.6339C10.8817 16.3995 10.75 16.0815 10.75 15.75C10.75 15.4185 10.8817 15.1005 11.1161 14.8661C11.3505 14.6317 11.6685 14.5 12 14.5ZM7.75 10.5C8.08152 10.5 8.39946 10.6317 8.63388 10.8661C8.8683 11.1005 9 11.4185 9 11.75C9 12.0815 8.8683 12.3995 8.63388 12.6339C8.39946 12.8683 8.08152 13 7.75 13C7.41848 13 7.10054 12.8683 6.86612 12.6339C6.6317 12.3995 6.5 12.0815 6.5 11.75C6.5 11.4185 6.6317 11.1005 6.86612 10.8661C7.10054 10.6317 7.41848 10.5 7.75 10.5ZM12 10.5C12.3315 10.5 12.6495 10.6317 12.8839 10.8661C13.1183 11.1005 13.25 11.4185 13.25 11.75C13.25 12.0815 13.1183 12.3995 12.8839 12.6339C12.6495 12.8683 12.3315 13 12 13C11.6685 13 11.3505 12.8683 11.1161 12.6339C10.8817 12.3995 10.75 12.0815 10.75 11.75C10.75 11.4185 10.8817 11.1005 11.1161 10.8661C11.3505 10.6317 11.6685 10.5 12 10.5ZM16.25 10.5C16.5815 10.5 16.8995 10.6317 17.1339 10.8661C17.3683 11.1005 17.5 11.4185 17.5 11.75C17.5 12.0815 17.3683 12.3995 17.1339 12.6339C16.8995 12.8683 16.5815 13 16.25 13C15.9185 13 15.6005 12.8683 15.3661 12.6339C15.1317 12.3995 15 12.0815 15 11.75C15 11.4185 15.1317 11.1005 15.3661 10.8661C15.6005 10.6317 15.9185 10.5 16.25 10.5ZM17.75 4.5H6.25C5.78587 4.5 5.34075 4.68437 5.01256 5.01256C4.68437 5.34075 4.5 5.78587 4.5 6.25V7H19.5V6.25C19.5 5.78587 19.3156 5.34075 18.9874 5.01256C18.6592 4.68437 18.2141 4.5 17.75 4.5Z' fill='%238B8C9E'/%3e%3c/svg%3e";const Xt=()=>r.jsx("img",{src:Kt,alt:""}),Qt=e=>{var{control:l,name:a,required:i,label:s,placeholder:d,defaultValue:u,format:c=at,hideErrorMessage:p=!1,textFieldProps:m={},requiredErrorText:f="",validate:x,validateErrorText:h}=e,y=t.__rest(e,["control","name","required","label","placeholder","defaultValue","format","hideErrorMessage","textFieldProps","requiredErrorText","validate","validateErrorText"]);const[g,b]=n.useState(at),{field:C,fieldState:{error:v}}=o.useController({control:l,name:a,defaultValue:u,rules:{required:!!i&&(f||dt),validate:x||(e=>!(""!==e&&!I.isMatch(e,g))||(h||ut))}}),j=n.useCallback((e=>{C.onChange(I.isValid(e)?I.format(e,g):e)}),[C,g]);return n.useEffect((()=>{const e=c.replace(/[Z,z,x]+/g,"XX");try{I.isMatch(I.format(new Date,e),e),b(e)}catch(e){console.error(e)}}),[c]),r.jsxs(r.Fragment,{children:[r.jsx(or.default,{required:i,children:s}),r.jsx(D.DatePicker,Object.assign({},C,g?{inputFormat:g}:{},{value:g?I.parse(C.value,g,new Date):C.value,onChange:j,components:{OpenPickerIcon:Xt}},y,{renderInput:e=>r.jsx(Ae.default,Object.assign({},e,{fullWidth:!0,size:"small",variant:"outlined",name:a,error:!!v,helperText:!p&&(null==v?void 0:v.message),FormHelperTextProps:{variant:"standard"},inputProps:Object.assign(Object.assign({},e.inputProps),{placeholder:d})},m))}))]})},el=()=>r.jsx("img",{src:Kt,alt:""}),rl=e=>{var{control:l,name:a,required:i,label:s,placeholder:d,defaultValue:u,format:c=ot,hideErrorMessage:p=!1,textFieldProps:m,requiredErrorText:f="",validate:x,validateErrorText:h}=e,y=t.__rest(e,["control","name","required","label","placeholder","defaultValue","format","hideErrorMessage","textFieldProps","requiredErrorText","validate","validateErrorText"]);const[g,b]=n.useState(),{field:C,fieldState:{error:v}}=o.useController({control:l,name:a,defaultValue:u,rules:{required:!!i&&(f||dt),validate:x||(e=>!(""!==e&&!I.isMatch(e,g))||(h||ut))}}),j=n.useCallback((e=>{C.onChange(I.isValid(e)?I.format(e,g):e)}),[C,g]);return n.useEffect((()=>{const e=c.replace(/[Z,z,x]+/g,"XX");try{I.isMatch(I.format(new Date,e),e),b(e)}catch(e){console.error(e)}}),[c]),r.jsx(q.DateTimePicker,Object.assign({},C,{ampm:!1,label:i?r.jsxs(r.Fragment,{children:[s," ",r.jsx("span",{children:"*"})]}):s,value:g?I.parse(C.value,g,new Date):C.value},g?{inputFormat:g}:{},{onChange:j,components:{OpenPickerIcon:el}},y,{renderInput:e=>r.jsx(Ae.default,Object.assign({},e,{fullWidth:!0,size:"small",sx:{".MuiInputLabel-root span":{color:"#D6331F"}},inputProps:Object.assign(Object.assign({},e.inputProps),{placeholder:d}),variant:"outlined",name:a,error:!!v,helperText:!p&&(null==v?void 0:v.message),FormHelperTextProps:{variant:"standard"}},m))}))},tl=e=>{var{control:l,name:a,required:i,label:s,textFieldProps:d={},format:u=nt,hideErrorMessage:c=!1,requiredErrorText:p="",placeholder:m,defaultValue:f}=e,x=t.__rest(e,["control","name","required","label","textFieldProps","format","hideErrorMessage","requiredErrorText","placeholder","defaultValue"]);const h=o.useController({control:l,name:a,defaultValue:f,rules:{required:!!i&&(p||dt),validate:e=>!!I.isMatch(e,u)||"Incorrect date format"}}),y=h.field,{onChange:g,ref:b,value:C}=y,v=t.__rest(y,["onChange","ref","value"]),{fieldState:{error:j}}=h,[T,E]=n.useState(null);return n.useEffect((()=>{if(C&&u){let e=I.parse(C,u,new Date);I.isValid(e)||(e=I.parse(C,"HH:mm:ss.SSS",new Date)),E(e)}}),[C,u]),r.jsx(A.TimePicker,Object.assign({},v,{mask:"",inputRef:b,label:i?r.jsxs(r.Fragment,{children:[s," ",r.jsx("span",{children:"*"})]}):s,ampm:!1,value:T,inputFormat:u,onChange:e=>{E(e),g(I.isValid(e)?I.format(e,u):e)}},x,{renderInput:e=>r.jsx(Ae.default,Object.assign({},e,{fullWidth:!0,size:"small",sx:{".MuiInputLabel-root span":{color:"#D6331F"}},inputProps:Object.assign(Object.assign({},e.inputProps),{placeholder:m}),variant:"outlined",name:a,error:!!j,helperText:!c&&(null==j?void 0:j.message),FormHelperTextProps:{variant:"standard"}}))}))},ll=e=>{var l,a,i,{name:s,control:d,label:u,required:c,defaultValue:p=null,onChange:m,textFieldLabel:f}=e,x=t.__rest(e,["name","control","label","required","defaultValue","onChange","textFieldLabel"]);const[h,y]=n.useState(""),[g,b]=n.useState(null),C=o.useController({control:d,name:s,defaultValue:p,rules:{required:c&&dt}}),v=C.field,{onChange:j,value:T}=v,E=t.__rest(v,["onChange","value"]),{formState:{errors:P}}=C,S=n.useMemo((()=>m||j),[m,j]),O=n.useCallback((e=>{const{value:r}=e.target;y(r)}),[]),k=n.useCallback((()=>{b(null),!h||Array.isArray(T)&&T.includes(h)?Array.isArray(T)&&T.includes(h)&&b("This value already exists"):(S([...null!=T?T:[],h]),y(""))}),[h,S,T]),w=n.useCallback((e=>{S(T.filter((r=>r!==e)))}),[T,S]),M=n.useCallback((e=>{"Enter"!==e.key&&13!==e.keyCode||(e.stopPropagation(),e.preventDefault(),k())}),[k]);return r.jsxs(r.Fragment,{children:[r.jsx(or.default,{required:c,children:u}),r.jsx(Ke.default,{display:"flex",flexWrap:"wrap",children:null==T?void 0:T.map(((e,t)=>r.jsx(mr.default,{sx:{mr:1,mb:1},variant:"outlined",label:e,onDelete:()=>w(e)},t)))}),r.jsx("input",Object.assign({type:"hidden"},d.register(s),{onChange:S,value:T},E)),r.jsx(Ae.default,Object.assign({fullWidth:!0,variant:"outlined",size:"small",label:f||""===f?f:`Add ${u}`,value:h,onChange:O,error:!!(null===(l=P[s])||void 0===l?void 0:l.message),helperText:null===(a=P[s])||void 0===a?void 0:a.message,FormHelperTextProps:{variant:"standard"},name:s,onKeyDown:M,InputProps:{endAdornment:r.jsx(Be.default,{size:"small",onClick:k,children:r.jsx(ze.default,{children:r.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})})},inputProps:Object.assign({},null!==(i=null==x?void 0:x.inputProps)&&void 0!==i?i:{})},x)),g&&r.jsx(tr.default,{error:!0,children:g})]})};var al="data:image/svg+xml,%3csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M5.99995 8L9.99995 12L14 8H5.99995Z' fill='%236D7C8B'/%3e%3c/svg%3e";const nl=()=>r.jsx("img",{src:al,alt:""});var ol=()=>{const e=J.useGridApiContext(),t=J.useGridSelector(e,J.gridPageSelector),l=J.useGridSelector(e,J.gridPageCountSelector),a=J.useGridSelector(e,J.gridRowCountSelector),n=J.useGridSelector(e,J.gridPageSizeSelector),o=r=>e.current.setPage(r);return r.jsxs(Ke.default,{px:2,display:"flex",alignItems:"center",children:[r.jsx(yr.default,{component:"div",page:t,count:a,rowsPerPage:n,rowsPerPageOptions:[10,20,50,100],onPageChange:(e,r)=>o(r),onRowsPerPageChange:r=>e.current.setPageSize(parseInt(r.target.value,10)),labelRowsPerPage:"Строк на странице",labelDisplayedRows:({from:e,to:r,count:t})=>`${e}–${r} из ${-1!==t?t:`более ${r}`}`,ActionsComponent:void 0,SelectProps:{IconComponent:nl}}),r.jsx(hr.default,{count:l,page:t+1,onChange:(e,r)=>o(r-1)})]})};var il=e=>{var{hideMenu:l,currentColumn:a,onUnsort:n}=e,o=t.__rest(e,["hideMenu","currentColumn","onUnsort"]);return r.jsx(J.GridColumnMenuContainer,Object.assign({hideMenu:l,currentColumn:a},o,{children:r.jsx(J.GridFilterMenuItem,{onClick:l,column:a})}))};var sl=({mode:e})=>{const[r,t]=V.useSearchParams(),l=+r.get("page")||0,a=+r.get("size")||10;return n.useEffect((()=>{"server"===e&&(r.has("page")||r.set("page","0"),r.has("size")||r.set("size","10"),t(r,{replace:!0}))}),[e,r,t]),{page:l,size:a,onPageChange:e=>{r.set("page",`${e}`),t(r,{replace:!0})},onSizeChange:e=>{r.set("size",`${e}`),t(r,{replace:!0})}}};var dl=()=>{const[e,r]=V.useSearchParams(),t=e.getAll("sort").map((e=>e.split(",")));return{onColumnHeaderClick:({field:t,colDef:l})=>{if(l.sortable){let l=!1;const a=e.getAll("sort");e.delete("sort"),a.forEach((r=>{const[a,n]=r.split(",");a===t?(l=!0,"asc"===n&&e.append("sort",`${a},desc`)):e.append("sort",`${a},${n}`)})),l||e.append("sort",`${t},asc`),r(e,{replace:!0})}},getSortedColumns:e=>e.map((e=>{const r=t.find((r=>r[0]===e.field));return e.headerClassName=r?`Sorted --${r[1]} `:"",e}))}};var ul=e=>{const[r,t]=n.useState(10);n.useEffect((()=>{t(e)}),[e]);return{pageSize:r,handlePageSizeChange:e=>t(e)}},cl="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M3.47341 10.4087C3.3698 10.2747 3.32108 10.1063 3.33715 9.9377C3.35321 9.76909 3.43285 9.61291 3.55989 9.50088C3.68693 9.38886 3.85185 9.3294 4.02115 9.33457C4.19045 9.33974 4.35144 9.40915 4.47141 9.52872L8.00008 13.0574L11.5287 9.52872L11.5914 9.47338C11.7254 9.36978 11.8938 9.32106 12.0624 9.33712C12.231 9.35318 12.3872 9.43282 12.4992 9.55987C12.6113 9.68691 12.6707 9.85183 12.6656 10.0211C12.6604 10.1904 12.591 10.3514 12.4714 10.4714L8.47141 14.4714L8.40874 14.5267C8.28047 14.6262 8.12031 14.6755 7.95829 14.6653C7.79627 14.6551 7.64354 14.5862 7.52874 14.4714L3.52874 10.4714L3.47341 10.4087ZM12.5267 5.59138C12.6304 5.72538 12.6791 5.89379 12.663 6.0624C12.6469 6.23102 12.5673 6.3872 12.4403 6.49922C12.3132 6.61124 12.1483 6.67071 11.979 6.66554C11.8097 6.66037 11.6487 6.59095 11.5287 6.47138L8.00008 2.94272L4.47141 6.47138L4.40874 6.52672C4.27475 6.63032 4.10634 6.67905 3.93773 6.66298C3.76911 6.64692 3.61293 6.56728 3.50091 6.44024C3.38889 6.31319 3.32942 6.14827 3.33459 5.97897C3.33976 5.80967 3.40918 5.64869 3.52874 5.52872L7.52874 1.52872L7.59141 1.47338C7.71968 1.37388 7.87985 1.3246 8.04187 1.33479C8.20388 1.34498 8.35662 1.41393 8.47141 1.52872L12.4714 5.52872L12.5267 5.59138Z' fill='%23262842'/%3e%3c/svg%3e",pl="data:image/svg+xml,%3c%3fxml version='1.0' encoding='utf-8'%3f%3e%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cg transform='matrix(1%2c 0%2c 0%2c 1%2c 0.05728%2c 0.935561)'%3e %3cpath d='M 3.473 9.409 C 3.37 9.275 3.321 9.106 3.337 8.938 C 3.353 8.769 3.433 8.613 3.56 8.501 C 3.687 8.389 3.852 8.329 4.021 8.335 C 4.19 8.34 4.351 8.409 4.471 8.529 L 8 12.057 L 11.529 8.529 L 11.591 8.473 C 11.725 8.37 11.894 8.321 12.062 8.337 C 12.231 8.353 12.387 8.433 12.499 8.56 C 12.611 8.687 12.671 8.852 12.666 9.021 C 12.66 9.19 12.591 9.351 12.471 9.471 L 8.471 13.471 L 8.409 13.527 C 8.28 13.626 8.12 13.676 7.958 13.665 C 7.796 13.655 7.644 13.586 7.529 13.471 L 3.529 9.471 L 3.473 9.409 Z' fill='%23262842' style='fill-opacity: 0.6%3b'/%3e %3cpath d='M 12.472 4.636 C 12.575 4.77 12.624 4.939 12.608 5.107 C 12.592 5.276 12.512 5.432 12.385 5.544 C 12.258 5.656 12.093 5.716 11.924 5.71 C 11.755 5.705 11.594 5.636 11.474 5.516 L 7.945 1.988 L 4.416 5.516 L 4.354 5.572 C 4.22 5.675 4.051 5.724 3.883 5.708 C 3.714 5.692 3.558 5.612 3.446 5.485 C 3.334 5.358 3.274 5.193 3.28 5.024 C 3.285 4.855 3.354 4.694 3.474 4.574 L 7.474 0.574 L 7.536 0.518 C 7.665 0.419 7.825 0.37 7.987 0.38 C 8.149 0.39 8.302 0.459 8.416 0.574 L 12.416 4.574 L 12.472 4.636 Z' fill='%23262842' style='fill-opacity: 1%3b'/%3e %3c/g%3e%3c/svg%3e",ml="data:image/svg+xml,%3c%3fxml version='1.0' encoding='utf-8'%3f%3e%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cg transform='matrix(1%2c 0%2c 0%2c 1%2c 0.05728%2c 0.935561)'%3e %3cpath d='M 3.473 9.409 C 3.37 9.275 3.321 9.106 3.337 8.938 C 3.353 8.769 3.433 8.613 3.56 8.501 C 3.687 8.389 3.852 8.329 4.021 8.335 C 4.19 8.34 4.351 8.409 4.471 8.529 L 8 12.057 L 11.529 8.529 L 11.591 8.473 C 11.725 8.37 11.894 8.321 12.062 8.337 C 12.231 8.353 12.387 8.433 12.499 8.56 C 12.611 8.687 12.671 8.852 12.666 9.021 C 12.66 9.19 12.591 9.351 12.471 9.471 L 8.471 13.471 L 8.409 13.527 C 8.28 13.626 8.12 13.676 7.958 13.665 C 7.796 13.655 7.644 13.586 7.529 13.471 L 3.529 9.471 L 3.473 9.409 Z' fill='%23262842' style='fill-opacity: 1%3b'/%3e %3cpath d='M 12.472 4.636 C 12.575 4.77 12.624 4.939 12.608 5.107 C 12.592 5.276 12.512 5.432 12.385 5.544 C 12.258 5.656 12.093 5.716 11.924 5.71 C 11.755 5.705 11.594 5.636 11.474 5.516 L 7.945 1.988 L 4.416 5.516 L 4.354 5.572 C 4.22 5.675 4.051 5.724 3.883 5.708 C 3.714 5.692 3.558 5.612 3.446 5.485 C 3.334 5.358 3.274 5.193 3.28 5.024 C 3.285 4.855 3.354 4.694 3.474 4.574 L 7.474 0.574 L 7.536 0.518 C 7.665 0.419 7.825 0.37 7.987 0.38 C 8.149 0.39 8.302 0.459 8.416 0.574 L 12.416 4.574 L 12.472 4.636 Z' fill='%23262842' style='fill-opacity: 0.6%3b'/%3e %3c/g%3e%3c/svg%3e";const fl=()=>r.jsx("img",{src:cl,alt:""}),xl=()=>r.jsx("img",{src:pl,alt:""}),hl=()=>r.jsx("img",{src:ml,alt:""});var yl=()=>{const[e,r]=V.useSearchParams(),t=n.useMemo((()=>{var r;return null!==(r=e.get("page"))&&void 0!==r?r:0}),[e]),l=n.useMemo((()=>{var r;return null!==(r=e.get("size"))&&void 0!==r?r:10}),[e]),a=n.useCallback((e=>{r((r=>(r.set("page",`${e}`),r)))}),[r]),o=n.useCallback((e=>{r((r=>(r.set("size",`${e}`),r)))}),[r]);return n.useEffect((()=>{e.has("page")||r((e=>(e.set("page","0"),e))),e.has("size")||r((e=>(e.set("size","10"),e)))}),[e,r]),{page:t,size:l,onPageChange:a,onSizeChange:o}};var gl=()=>{const[e,r]=V.useSearchParams(),t=n.useMemo((()=>e.getAll("sort").map((e=>e.split(",")))),[e]),l=n.useCallback((e=>{r((r=>{r.delete("sort");let l=!1;return t.forEach((([t,a])=>{t===e?(l=!0,"asc"===a&&r.append("sort",`${t},desc`)):r.append("sort",`${t},${a}`)})),l||r.append("sort",`${e},asc`),r}))}),[t,r]),a=n.useCallback((e=>{const r=t.find((([r,t])=>r===e));return!!r&&r[1]}),[t]);return{sortParams:t,onSortChanged:l,getColumnSorting:a}};const bl=e.styled(Sr.default)((({active:e})=>({".MuiSvgIcon-root":{opacity:e?1:.5,marginTop:"4%"}}))),Cl=()=>r.jsx("img",{src:al,alt:""}),vl=()=>r.jsx("img",{src:cl,alt:""}),jl=()=>r.jsx("img",{src:pl,alt:""}),Tl=()=>r.jsx("img",{src:ml,alt:""});function El({columns:e=[],rows:t=[],totalCount:l,children:a,pagination:n=!0,loading:o=!1,onRowClick:i,emptyDataText:s,verticalAlign:d="middle",labelRowsPerPage:u},c){const{page:p,size:m,onPageChange:f,onSizeChange:x}=yl(),{onSortChanged:h,getColumnSorting:y}=gl();return r.jsx(Ke.default,{sx:{overflow:"auto"},children:r.jsxs(vr.default,{sx:{width:"100%",display:"table",tableLayout:"fixed"},children:[r.jsx(Pr.default,{open:o,sx:{position:"absolute",top:0,left:0},children:r.jsx(st,{})}),r.jsxs(gr.default,{ref:c,children:[r.jsx(jr.default,{children:r.jsx(Tr.default,{children:e.map(((e,t)=>{const l=!!e.sortKey&&y(e.sortKey);return r.jsx(Cr.default,{align:e.align?e.align:"left",sortDirection:l,sx:{width:e.width?`${e.width}%`:"unset"},children:r.jsx(bl,{active:!!l,hideSortIcon:!e.sortKey,direction:l||"asc",IconComponent:"asc"===l?jl:"desc"===l?Tl:vl,onClick:()=>e.sortKey?h(e.sortKey):{},children:e.label})},t)}))})}),r.jsx(br.default,{children:t.length?t.map(((t,l)=>r.jsx(Tr.default,{hover:!0,onClick:i?()=>i(t):t.onClick,sx:{verticalAlign:d},children:e.map(((e,a)=>r.jsx(Cr.default,{align:e.align?e.align:"left",sx:{maxWidth:e.width?`${e.width}%`:"unset"},children:r.jsx(Ke.default,{sx:{maxWidth:"90%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",padding:({spacing:e})=>e(2.4,0)},children:r.jsx(Ke.default,{children:e.renderCell?e.renderCell(t,l):t[e.id]})})},a)))},l))):r.jsx(Tr.default,{sx:{verticalAlign:d},children:r.jsx(Cr.default,{align:"center",colSpan:e.length,children:null!=s?s:"Нет данных"})})}),n||a?r.jsx(Er.default,{children:r.jsxs(Tr.default,{children:[a&&r.jsx(Cr.default,{colSpan:e.length,sx:{background:"#F0F0F7",px:4,py:3},children:a}),n&&t.length?r.jsx(yr.default,{rowsPerPageOptions:[5,10,25],count:l,rowsPerPage:+m,page:+p,sx:{borderBottom:"none"},labelRowsPerPage:u,labelDisplayedRows:u?({from:e,to:r,count:t})=>`${e}–${r} из ${-1!==t?t:`более ${r}`}`:void 0,SelectProps:{IconComponent:Cl},onPageChange:(e,r)=>f(r),onRowsPerPageChange:e=>x(+e.target.value)}):null]})}):null]})]})})}const Pl=n.forwardRef(El),Sl=e=>{const{children:l,value:a,index:n}=e,o=t.__rest(e,["children","value","index"]);return r.jsx("div",Object.assign({role:"tabpanel",hidden:a!==n,id:`simple-tabpanel-${n}`,"aria-labelledby":`simple-tab-${n}`},o,{children:a===n?l:null}))},Ol=Object.values(exports.RoundingMode).sort(((e,r)=>e.localeCompare(r)));var kl=({propertyFieldName:e,control:t})=>r.jsxs(r.Fragment,{children:[r.jsx(fr.default,{children:r.jsx(Zt,{required:!0,control:t,defaultValue:2,name:`${e}.precisionScale`,label:"Precision Scale"})}),r.jsx(fr.default,{children:r.jsx(xt,{required:!0,control:t,name:`${e}.roundingMode`,label:"Rounding Mode",defaultValue:exports.RoundingMode.HALF_UP,options:Ol})})]});var wl=({propertyFieldName:e,control:t,defaultValue:l=""})=>r.jsx(fr.default,{children:r.jsx(ct,{required:!0,control:t,defaultValue:l,name:`${e}.format`,label:"Format"})});const Ml=()=>r.jsx("div",{style:{display:"inline-block",width:"10px",height:"10px",borderRadius:"50%",backgroundColor:"#536DFE",marginTop:"5px"}}),Vl=({data:e})=>r.jsxs(Ir.default,{nonLinear:!0,orientation:"vertical",connector:r.jsx($r.default,{sx:{marginLeft:4}}),sx:{width:"100%"},children:[e.filter(Boolean).map(((e,t)=>r.jsxs(qr.default,{expanded:!0,children:[r.jsx(Ar.default,{sx:{display:"flex",alignItems:"flex-start"},StepIconComponent:Ml,StepIconProps:{icon:"",completed:!1,active:!0},children:e.label}),r.jsx(_r.default,{sx:{marginLeft:4},children:e.content})]},t))),r.jsx(qr.default,{})]}),Rl=({properties:e=[]})=>{const t=n.useMemo((()=>e?e.map((e=>{const t="string"==typeof e.propertyType?e.propertyType:e.propertyType?e.propertyType.value:"";return{label:r.jsxs(Ke.default,{display:"flex",flexDirection:"column",children:[r.jsxs("b",{children:[e.name,e.isRequired?"*":""]}),r.jsxs("span",{children:[e.key," | ",e.isMultiple?"multiple":"single"," |"," ",t]})]}),content:"ENTITY"===e.propertyType&&r.jsx(Rl,{properties:e.properties})}})):[]),[e]);return r.jsx(Vl,{data:t})};var Fl=Rl;const Ll={key:"",propertyType:null,name:"",defaultValue:"",value:"",defaultValues:[],isRequired:!0,isMultiple:!1,sortOrder:0,isEnabled:!0,executeValue:"",uiSettings:""};var Nl=({control:e,parentPropertyFieldName:l,entityDefinition:a=!1,globalParameter:i=!1,entityReferenceDefinitionSources:s,entityReferenceValueComponent:d,fileReferenceValueComponent:u})=>{const c=n.useRef(null),{field:{onChange:p}}=o.useController({control:e,name:`${l}.properties`}),m=o.useWatch({control:e,name:`${l}.properties`,defaultValue:[]}),f=o.useWatch({control:e,name:`${l}.name`}),{append:x,remove:h}=o.useFieldArray({control:e,name:`${l}.properties`}),y=mt(),[g,b]=n.useState(0),C=n.useCallback((()=>{if((null==m?void 0:m.length)>0){x(Ll);const e=m.length;b(e)}else x(Ll);c.current.addProperty()}),[m,x]),v=()=>t.__awaiter(void 0,void 0,void 0,(function*(){p(c.current.getProperties()),y.onClose()}));return r.jsxs(r.Fragment,{children:[r.jsx(fr.default,{children:r.jsx(Xe.default,{variant:"h6",children:"Properties"})}),r.jsx(fr.default,{children:r.jsx(Fl,{properties:m})}),r.jsx(fr.default,{children:r.jsx(We.default,{variant:"contained",color:"primary",onClick:y.onOpen,children:"Edit properties"})}),r.jsxs(Je.default,{disableEscapeKeyDown:!0,open:y.open,onClose:v,fullWidth:!0,maxWidth:"md",children:[r.jsxs(Ue.default,{children:[f||"Entity"," Properties"]}),r.jsx(Ye.default,{style:{height:"500px",overflow:"hidden"},children:r.jsxs(fr.default,{container:!0,direction:"row",spacing:2,style:{height:"100%"},children:[r.jsxs(fr.default,{xs:3,style:{backgroundColor:"#f9f9f9",height:"100%",overflowY:"auto"},children:[r.jsx(Ir.default,{nonLinear:!0,activeStep:g,orientation:"vertical",style:{paddingLeft:"4px"},children:m.map(((e,t)=>r.jsxs(qr.default,{onClick:()=>(e=>b(e))(t),style:{cursor:"pointer"},children:[r.jsx(Ar.default,{StepIconProps:{icon:""},style:{wordBreak:"break-word"},children:e.name||"(no name)"}),r.jsx(_r.default,{})]},t)))}),r.jsx(We.default,{variant:"contained",size:"small",color:"primary",onClick:C,children:"Add property"})]}),r.jsx(fr.default,{container:!0,wrap:"nowrap",direction:"column",spacing:2,style:{height:"100%",overflowY:"auto",width:"75%"},children:r.jsx(ua,{ref:c,properties:m,hideAddButton:!0,parentRemove:h,focusOnIndex:g,entityDefinition:a,globalParameter:i,entityReferenceDefinitionSources:s,entityReferenceValueComponent:d,fileReferenceValueComponent:u})})]})}),r.jsx(Ge.default,{children:r.jsx(We.default,{variant:"contained",color:"primary",onClick:v,children:"Ok"})})]})]})};var Dl=({propertyFieldName:e,control:t,sources:l=[{label:"Arsenal Entities",value:"ARSENAL_ENTITIES"}]})=>r.jsxs(r.Fragment,{children:[r.jsx(fr.default,{children:r.jsx(xt,{required:!0,control:t,name:`${e}.source`,label:"Source",options:l})}),r.jsx(fr.default,{children:r.jsx(ct,{required:!0,control:t,name:`${e}.definitionCode`,label:"Definition Code"})}),r.jsx(fr.default,{children:r.jsx(ct,{required:!0,control:t,name:`${e}.definitionVersion`,label:"Definition Version",defaultValue:1})}),r.jsx(fr.default,{children:r.jsx(ct,{required:!0,control:t,name:`${e}.labelPropertyCode`,label:"Label Property Code"})}),r.jsx(fr.default,{children:r.jsx(ct,{required:!0,control:t,name:`${e}.valuePropertyCode`,label:"Value Property Code"})})]});const Il=({control:e,propertyType:t,propertyFieldName:l,entityDefinition:a=!1,globalParameter:n=!1,entityReferenceDefinitionSources:o,entityReferenceValueComponent:i,fileReferenceValueComponent:s})=>{switch(t){case exports.PropertyType.STRING:return r.jsx(ll,{name:`${l}.restrictedValues`,control:e,label:"Restricted Values"});case exports.PropertyType.BIG_DECIMAL:return r.jsx(kl,{propertyFieldName:l,control:e});case exports.PropertyType.DATE:return r.jsx(wl,{control:e,propertyFieldName:l,defaultValue:at});case exports.PropertyType.TIME:return r.jsx(wl,{control:e,propertyFieldName:l,defaultValue:nt});case exports.PropertyType.DATE_TIME:return r.jsx(wl,{control:e,propertyFieldName:l,defaultValue:ot});case exports.PropertyType.ENTITY_REFERENCE:return r.jsx(Dl,{control:e,propertyFieldName:l,sources:o});case exports.PropertyType.ENTITY:return r.jsx(Nl,{control:e,parentPropertyFieldName:l,globalParameter:n,entityDefinition:a,entityReferenceDefinitionSources:o,entityReferenceValueComponent:i,fileReferenceValueComponent:s});default:return null}};var ql=({control:e,name:t,label:l,required:a,restrictedValues:n,requiredErrorText:i="",requiredSelectErrorText:s=""})=>{const{field:{onChange:d,ref:u},fieldState:{error:c}}=o.useController({control:e,name:t,rules:{required:!!a&&(Array.isArray(n)&&n.length?s||"Please, select a value":i||dt)}}),p=o.useWatch({control:e,name:t});return Array.isArray(n)&&n.length?r.jsxs(er.default,{fullWidth:!0,size:"small",variant:"outlined",error:!!c,children:[r.jsx(Br.default,{htmlFor:"type-select",children:l}),r.jsx(zr.default,{labelId:"type-select",label:l,value:p||"",onChange:d,ref:u,children:n.map((e=>r.jsx(_e.default,{value:e,children:e},e)))})]}):r.jsx(ct,{hideErrorMessage:!0,required:a,control:e,name:t,label:l})};var Al=({name:e})=>{const{control:l,setValue:a,register:i}=o.useFormContext(),s=o.useWatch({control:l,name:e}),d=n.useCallback((r=>t.__awaiter(void 0,void 0,void 0,(function*(){const t=r.target.files[0];(new FileReader).readAsDataURL(t);const l=yield(e=>new Promise(((r,t)=>{const l=new FileReader;l.readAsDataURL(e),l.onload=()=>{r(l.result)},l.onerror=e=>{t(e)}})))(t);a(e,l)}))),[e,a]);return r.jsxs(r.Fragment,{children:[r.jsxs(Ke.default,{mb:2,display:"flex",flex:"row",children:[r.jsx(Xe.default,{children:"Does file uploaded:"}),s?r.jsx(ze.default,{sx:{paddingLeft:2},children:r.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}):r.jsx(ze.default,{sx:{paddingLeft:2},children:r.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z"})})]}),r.jsxs(We.default,{component:"label",variant:"contained",size:"large",color:"primary",sx:{marginTop:4},children:[s?"Change file":"Upload file",r.jsx("input",Object.assign({type:"hidden"},i(`${e}`,{required:!0}))),r.jsx("input",{type:"file",hidden:!0,onChange:d})]})]})};const _l=({property:e,name:t,label:l,useExpression:a,control:n,entityReferenceDefinitionSources:o,entityReferenceValueComponent:i,fileReferenceValueComponent:s})=>{var d;switch("string"==typeof e.propertyType?e.propertyType:null===(d=e.propertyType)||void 0===d?void 0:d.value){case exports.PropertyType.BIG_DECIMAL:case exports.PropertyType.FLOAT:case exports.PropertyType.DOUBLE:return r.jsx(Zt,{required:!0,decimal:!0,hideErrorMessage:!0,control:n,name:t,label:l,valueAsNumber:!0});case exports.PropertyType.INTEGER:case exports.PropertyType.BIG_INTEGER:case exports.PropertyType.LONG:return r.jsx(Zt,{required:!0,hideErrorMessage:!0,control:n,name:t,label:l,valueAsNumber:!0});case exports.PropertyType.BOOLEAN:return r.jsx(Ut,{control:n,name:t});case exports.PropertyType.DATE:return r.jsx(Qt,{hideErrorMessage:!0,control:n,name:t,label:l,format:e.format});case exports.PropertyType.TIME:return r.jsx(tl,{hideErrorMessage:!0,control:n,name:t,label:l,format:e.format});case exports.PropertyType.DATE_TIME:return r.jsx(rl,{hideErrorMessage:!0,control:n,name:t,label:l,format:e.format});case exports.PropertyType.JSON:return r.jsx(vt,{control:n,name:t,label:l,parseValue:!0,hideErrorMessage:!0,validateJson:!0});case exports.PropertyType.STRING:return r.jsx(ql,{control:n,name:t,label:l,restrictedValues:e.restrictedValues});case exports.PropertyType.ENTITY_REFERENCE:return i?r.jsx(i,{name:t,property:e}):r.jsx(ql,{name:t,label:l,control:n});case exports.PropertyType.FILE:return r.jsx(Al,{name:t});case exports.PropertyType.FILE_REFERENCE:return s?r.jsx(s,{name:t}):r.jsx(ql,{name:t,label:l,control:n});case exports.PropertyType.ANY:return r.jsx(vt,{control:n,name:t,hideErrorMessage:!0,label:l});case exports.PropertyType.ENTITY:return r.jsx(Ea,{properties:e.properties,dataFieldName:t,useExpression:a,entityReferenceDefinitionSources:o,entityReferenceValueComponent:i,fileReferenceValueComponent:s});default:return r.jsx("div",{children:"No widget"})}};var $l=({value:e,property:r,label:t,isDirty:l,required:a=!1,useExpression:o=!1,multipleOptions:i=!1})=>{const s=n.useMemo((()=>t?`${t} (value)`:`${r.name} (value)`),[t,r]),d=n.useMemo((()=>t?`${t} (widget)`:`${r.name} (widget)`),[t,r]),u=n.useMemo((()=>{var e;return"string"==typeof r.propertyType?r.propertyType:null===(e=r.propertyType)||void 0===e?void 0:e.value}),[r]),[c,p]=n.useState(null),m=n.useMemo((()=>i?Jt({propertyType:u,required:a,useExpression:o}):Gt({propertyType:u,required:a,useExpression:o})),[o,a,u,i]),f=n.useMemo((()=>{switch(u){case exports.PropertyType.STRING:case exports.PropertyType.DATE:case exports.PropertyType.TIME:case exports.PropertyType.DATE_TIME:case exports.PropertyType.ENTITY_REFERENCE:case exports.PropertyType.ANY:case exports.PropertyType.FILE:case exports.PropertyType.FILE_REFERENCE:return"";case exports.PropertyType.JSON:return{};case exports.PropertyType.BOOLEAN:return!1;case exports.PropertyType.INTEGER:case exports.PropertyType.BIG_DECIMAL:case exports.PropertyType.BIG_INTEGER:case exports.PropertyType.DOUBLE:case exports.PropertyType.LONG:case exports.PropertyType.FLOAT:return 0;default:return null}}),[u]),x=n.useMemo((()=>u===exports.PropertyType.JSON||u===exports.PropertyType.ANY),[u]),h=n.useCallback((()=>{qt(e,x)?p("expression"):null==e||qt(e,x)||"widget"===c||"string"===c||p("widget")}),[e,c,x]);return n.useEffect((()=>{c?l||h():!_t(e)||r.isRequired||null!==r.defaultValue&&null!==r.value?o&&qt(e,x)?p("expression"):p("widget"):p("null")}),[e,c,m,o,l,h,x,a,r]),{propertyType:u,valueLabel:s,fillOptionLabel:d,fillOption:c,fillOptions:m,setFillOption:p,defaultProperyValue:f,checkFillOption:h}};const zl=e.styled(Br.default)((()=>({inputLabel:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",width:"100%"}}))),Bl=({control:e,property:t,name:l,useExpression:a,label:i,required:s,title:d,entityReferenceDefinitionSources:u,entityReferenceValueComponent:c,fileReferenceValueComponent:p,requiredErrorText:m=""})=>{const{field:{value:f,onChange:x},fieldState:{error:h,isDirty:y}}=o.useController({name:l,control:e,defaultValue:t.defaultValue,rules:{validate:e=>!s||null!==e||(m||dt)}}),g=n.useRef({}),{propertyType:b,valueLabel:C,fillOptionLabel:v,fillOption:j,fillOptions:T,setFillOption:E,defaultProperyValue:P}=$l({value:f,property:t,isDirty:y,label:i,required:s,useExpression:a}),S=n.useCallback((e=>{const r=e.target.value;g.current=Object.assign(Object.assign({},g.current),{[j]:f}),E(r);const l=g.current[r];if("null"===r)x(null,{shouldDirty:!0});else if("widget"===r)if(b===exports.PropertyType.JSON&&f&&"string"!=typeof f&&"dem_builder"===j&&"properties"in f){const e=Object.assign(Object.assign({},f),{properties:Bt(f.property||[])});try{x(null!=l?l:JSON.stringify(e,null,"\t"))}catch(e){console.log("Stringify failed",e)}}else x(null!=l?l:t.defaultValue||P);else if("expression"===r||"string"===r)x(null!=l?l:"",{shouldDirty:!0});else if("dem_builder"===r){const e={code:"",name:"",version:0,properties:[]};if(f)try{const e=JSON.parse(f);e.properties=Ht(e.properties||{}),x(null!=l?l:e,{shouldDirty:!0})}catch(r){x(null!=l?l:e,{shouldDirty:!0})}else x(null!=l?l:e,{shouldDirty:!0})}}),[P,f,E,j,b,x,t]);return n.useEffect((()=>{y||!t.defaultValue&&!t.value||f||x(t.defaultValue||t.value)}),[y,t,x,f]),n.useEffect((()=>{var e;(void 0===f||t.isRequired&&null===f&&!t.defaultValue&&!t.value)&&x(null!==(e=g.current[j])&&void 0!==e?e:P)}),[f,x,P,t,j]),r.jsxs(fr.default,{xs:12,children:[d&&r.jsx(Ke.default,{mb:2,children:r.jsx(Xe.default,{variant:"h6",children:d})}),T?r.jsx(Ke.default,{mb:2,children:r.jsxs(er.default,{fullWidth:!0,size:"small",variant:"outlined",children:[r.jsx(zl,{htmlFor:"type-select",children:v}),r.jsx(zr.default,{labelId:"type-select",label:v,value:j||"",onChange:S,children:T.map((e=>r.jsx(_e.default,{value:e.value,children:e.label},e.value)))})]})}):null,"expression"===j&&(b===exports.PropertyType.JSON||b===exports.PropertyType.ENTITY||b===exports.PropertyType.ANY?r.jsx(vt,{name:l,control:e,label:C,parseValue:!0,validateJson:!0,hideErrorMessage:!0}):r.jsx(ct,{control:e,name:l,label:C,hideErrorMessage:!0})),"string"===j&&r.jsx(ct,{control:e,name:l,label:C,hideErrorMessage:!0}),"json_notvalid"===j&&r.jsx(vt,{name:l,control:e,label:C,hideErrorMessage:!0}),"widget"===j&&r.jsx(_l,{control:e,property:t,name:l,useExpression:a,label:C,entityReferenceDefinitionSources:u,entityReferenceValueComponent:c,fileReferenceValueComponent:p}),"dem_builder"===j&&r.jsx(ma,{control:e,title:"JSON",definitionFieldName:l,entityReferenceDefinitionSources:u,entityReferenceValueComponent:c,fileReferenceValueComponent:p}),h&&r.jsx(tr.default,{error:!0,children:h.message})]})};var Hl=({control:e,name:t,property:l,useExpression:a,required:n,label:i,entityReferenceDefinitionSources:s,entityReferenceValueComponent:d,fileReferenceValueComponent:u})=>{const{fields:c,append:p,remove:m}=o.useFieldArray({control:e,name:t});return r.jsxs(fr.default,{container:!0,spacing:2,direction:"column",xs:12,children:[Array.isArray(c)&&c.length?c.map(((o,c)=>r.jsx(fr.default,{xs:12,children:r.jsxs(Ke.default,{display:"flex",alignItems:"flex-start",width:"100%",p:2,style:{backgroundColor:"#f1f1f1"},children:[r.jsx(Bl,{control:e,required:n,property:l,useExpression:a,name:`${t}.${c}`,label:`${i||l.name} (${c+1})`,entityReferenceDefinitionSources:s,entityReferenceValueComponent:d,fileReferenceValueComponent:u}),r.jsx(Ke.default,{mt:"8px",ml:"4px",children:r.jsx(Be.default,{id:"close-button",size:"small",onClick:()=>m(c),children:r.jsx(ze.default,{fontSize:"small",children:r.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})})})})]})},o.id))):null,r.jsx(fr.default,{children:r.jsx(We.default,{variant:"contained",size:"small",color:"primary",onClick:()=>p(null),children:"Add value"})})]})};const Wl=({control:e,property:t,name:l,useExpression:a,required:i,label:s,title:d,entityReferenceDefinitionSources:u,entityReferenceValueComponent:c,fileReferenceValueComponent:p,requiredErrorText:m=""})=>{var f;const[x,h]=n.useState(!1),{field:{value:y,onChange:g},fieldState:{error:b,isDirty:C}}=o.useController({control:e,name:l,defaultValue:null!==(f=t.defaultValue)&&void 0!==f?f:[],rules:{validate:e=>!(i&&!e)||(m||dt)}}),v=n.useRef({}),{propertyType:j,valueLabel:T,fillOptionLabel:E,fillOption:P,fillOptions:S,setFillOption:O,checkFillOption:k}=$l({property:t,value:y,isDirty:C,label:s,required:i,useExpression:a,multipleOptions:!0});return n.useEffect((()=>{y||g(t.isRequired&&t.isMultiple?[]:null)}),[y,t,g]),n.useEffect((()=>{y&&!x&&(h(!0),k())}),[k,x,y]),r.jsxs(fr.default,{children:[d&&r.jsx(Ke.default,{mb:2,children:r.jsx(Xe.default,{variant:"h6",children:d})}),S?r.jsx(Ke.default,{mb:2,children:r.jsxs(er.default,{fullWidth:!0,size:"small",variant:"outlined",children:[r.jsx(zl,{htmlFor:"type-select",children:E}),r.jsx(zr.default,{labelId:"type-select",label:E,value:P||"",onChange:e=>{h(!0),v.current=Object.assign(Object.assign({},v.current),{[P]:y});const r=e.target.value,t=v.current[r];"null"===r?g(null):"expression"===r||"json_valid"===r||"json_notvalid"===r?g(null!=t?t:"",{shouldDirty:!0}):"widget"===r&&g(null!=t?t:[],{shouldDirty:!0}),O(r)},children:S.map((e=>r.jsx(_e.default,{value:e.value,children:e.label},e.value)))})]})}):null,"expression"===P&&(j===exports.PropertyType.JSON||j===exports.PropertyType.ENTITY||j===exports.PropertyType.ANY?r.jsx(vt,{name:l,control:e,label:T,parseValue:!0,validateJson:!0,hideErrorMessage:!0}):r.jsx(ct,{required:!0,hideErrorMessage:!0,control:e,name:l,label:T})),"json_valid"===P&&r.jsx(vt,{name:l,control:e,label:T,parseValue:!0,validateJson:!0,hideErrorMessage:!0}),"widget"===P&&r.jsx(Hl,{control:e,property:t,name:l,useExpression:a,required:i,label:s,entityReferenceDefinitionSources:u,entityReferenceValueComponent:c,fileReferenceValueComponent:p}),b&&r.jsx(tr.default,{error:!0,children:b.message})]})},Jl=({control:e,propertyFieldName:t,name:l,label:a="",required:i,entityReferenceDefinitionSources:s,entityReferenceValueComponent:d,fileReferenceValueComponent:u})=>{const c=o.useWatch({control:e,name:`${t}.propertyType`}),p=o.useWatch({control:e,name:`${t}.isMultiple`}),m=o.useWatch({control:e,name:`${t}.format`}),f=o.useWatch({control:e,name:`${t}.restrictedValues`}),x=o.useWatch({control:e,name:`${t}.properties`}),h=o.useWatch({control:e,name:`${t}.isRequired`}),y=n.useMemo((()=>Object.assign(Object.assign(Object.assign(Object.assign({name:a,isRequired:null!=i?i:h,isMultiple:p},!!m&&{format:m}),{restrictedValues:f}),!!x&&{properties:x}),{propertyType:"string"==typeof c?c:c.value,defaultValue:null,defaultValues:[],sortOrder:0,isEnabled:!0,uiSettings:null,validationNode:null})),[c,m,f,p,a,h,x,i]);return r.jsx(be.LocalizationProvider,{dateAdapter:ge.AdapterDateFns,children:p?r.jsx(Wl,{control:e,name:l,property:y,title:a,required:i,entityReferenceDefinitionSources:s,entityReferenceValueComponent:d,fileReferenceValueComponent:u}):r.jsx(Bl,{control:e,name:l,property:y,title:a,required:i,entityReferenceDefinitionSources:s,entityReferenceValueComponent:d,fileReferenceValueComponent:u})})};var Gl=({name:e})=>{const t=n.useMemo((()=>({type:""})),[]),{control:l}=o.useFormContext(),{fields:a,append:i,remove:s}=o.useFieldArray({control:l,name:e});return r.jsxs(Ke.default,{mt:2,children:[r.jsx(We.default,{variant:"outlined",size:"small",onClick:()=>i(t),children:"Add node"}),a.map((({id:t},l)=>r.jsx(ta,{removeHandle:()=>s(l),name:`${e}.${l}`},t)))]})};const Yl=n.createContext(""),Zl=({name:e,control:t})=>r.jsxs(r.Fragment,{children:[r.jsx(Xe.default,{variant:"body2",gutterBottom:!0,children:"Node"}),r.jsx(Ke.default,{children:r.jsx(ct,{control:t,name:`${e}.minimumLength`,label:"Minimum Length",type:"number"})}),r.jsx(Ke.default,{mt:2,children:r.jsx(ct,{control:t,name:`${e}.maximumLength`,label:"Maximum Length",type:"number"})})]}),Ul=({name:e,control:t})=>r.jsxs(r.Fragment,{children:[r.jsx(Xe.default,{variant:"body2",gutterBottom:!0,children:"Node"}),r.jsx(Ke.default,{children:r.jsx(ct,{control:t,name:`${e}.multipleOf`,label:"Multiple Of",type:"number"})}),r.jsx(Ke.default,{mt:2,children:r.jsx(ct,{control:t,name:`${e}.minimum`,label:"Minimum",type:"number"})}),r.jsx(Ke.default,{mt:2,children:r.jsx(ct,{control:t,name:`${e}.maximum`,label:"Maximum",type:"number"})}),r.jsxs(Ke.default,{mt:2,children:[r.jsx(ht,{control:t,name:`${e}.exclusiveMinimum`,label:"Exclusive Minimum"}),r.jsx(ht,{control:t,name:`${e}.exclusiveMaximum`,label:"Exclusive Maximum"})]})]}),Kl=["STRING_REGEX","JSON_SCHEMA"],Xl=new Set([exports.PropertyType.INTEGER,exports.PropertyType.FLOAT,exports.PropertyType.DOUBLE,exports.PropertyType.BIG_DECIMAL,exports.PropertyType.BIG_INTEGER,exports.PropertyType.LONG]);var Ql=({name:e})=>{const{control:t,setValue:l}=o.useFormContext(),a=n.useContext(Yl),i=o.useWatch({control:t,name:`${e}.type`}),s=n.useMemo((()=>{if("STRING_REGEX"===i)return r.jsx(ct,{control:t,name:`${e}.pattern`,label:"Pattern"});if("JSON_SCHEMA"===i)switch(!0){case a===exports.PropertyType.STRING:return r.jsx(Zl,{name:`${e}.node`,control:t});case Xl.has(a):return r.jsx(Ul,{name:`${e}.node`,control:t});case a===exports.PropertyType.JSON:return r.jsx(vt,{label:"Properties",control:t,name:`${e}.properties`,validateJson:!0,parseValue:!0});default:return"Not available for type "+a}return null}),[a,i,t,e]);return n.useEffect((()=>{Xl.has(a)&&"JSON_SCHEMA"===i&&(l(`${e}.node.exclusiveMinimum`,!1),l(`${e}.node.exclusiveMaximum`,!1))}),[a,i,l,e]),r.jsx(Vl,{data:[{label:"Validator",content:r.jsxs(r.Fragment,{children:[r.jsx(Ke.default,{children:r.jsx(xt,{control:t,name:`${e}.type`,label:"Type",options:Kl,onChange:r=>{l(e,{}),l(`${e}.type`,r.target.value)}})}),r.jsx(Ke.default,{mt:2,children:s})]})}]})};const ea=["AND","OR","NOT","NODE"],ra=({name:e,removeHandle:t})=>{const{control:l}=o.useFormContext(),a=o.useWatch({control:l,name:`${e}.type`}),i=n.useMemo((()=>({AND:r.jsx(Gl,{name:`${e}.nodes`}),OR:r.jsx(Gl,{name:`${e}.nodes`}),NODE:r.jsx(Ql,{name:`${e}.validator`}),NOT:r.jsx(ra,{name:`${e}.node`})})),[e]);return r.jsx(Vl,{data:[{label:"Node Type",content:r.jsxs(r.Fragment,{children:[r.jsxs(Ke.default,{display:"flex",alignItems:"flex-end",children:[r.jsx(xt,{required:!0,control:l,name:`${e}.type`,label:"Type",options:ea}),t&&r.jsx(Ke.default,{ml:2,children:r.jsx(Be.default,{onClick:t,color:"primary",children:r.jsx(Dr.default,{})})})]}),r.jsx(Ke.default,{children:i[a]})]})}]})};var ta=ra;const la=({name:e})=>{const[t,l]=n.useState(!1),{setValue:a,getValues:i}=o.useFormContext(),s=n.useCallback((r=>{l(r.target.checked),r.target.checked||a(e,null)}),[a,e]);return n.useEffect((()=>{i(e)&&l(!0)}),[e,i]),r.jsxs(r.Fragment,{children:[r.jsxs(Ke.default,{display:"flex",justifyContent:"space-between",children:[r.jsx(Xe.default,{variant:"h6",children:"Validator"}),r.jsx(rr.default,{label:"Enable",control:r.jsx(lr.default,{color:"primary",checked:t,onChange:s})})]}),t&&r.jsx(ta,{name:e})]})};var aa=({name:e,label:t="",propertyFieldName:l,type:a,decimal:i=!1,options:s=[],required:d=!1})=>{const{control:u}=o.useFormContext(),c=n.useMemo((()=>`${l}.${e}`),[e,l]);switch(a){case"text":return r.jsx(ct,{control:u,name:c,label:t,required:d});case"number":return r.jsx(Zt,{control:u,name:c,label:t,decimal:i,required:d});case"select":return r.jsx(xt,{control:u,name:c,label:t,options:s,required:d});case"autocomplete":return r.jsx(gt,{control:u,name:c,label:t,options:s,required:d});case"json":return r.jsx(vt,{control:u,name:c,label:t,mode:"json",required:d});default:return null}};var na=e=>({customCheckboxes:n.useMemo((()=>e.length?e.filter((e=>"checkbox"===e.type)):[]),[e]),customFields:n.useMemo((()=>e.length?e.filter((e=>"checkbox"!==e.type)):[]),[e])});const oa=Object.values(exports.PropertyType).sort(((e,r)=>e.localeCompare(r))).map((e=>({value:e,label:e.replace("_"," ").toLowerCase().replace(/(^\w)|([-\s]\w)/g,(e=>e.toUpperCase()))}))),ia=n.memo((({setValue:e,control:t,propertyFieldName:l,entityDefinition:a=!1,globalParameter:i=!1,customPropertyFields:s=[],entityReferenceDefinitionSources:d,entityReferenceValueComponent:u,fileReferenceValueComponent:c})=>{var p;const m=o.useWatch({control:t,name:`${l}.propertyType`}),f=o.useWatch({control:t,name:`${l}.isMultiple`}),x=o.useWatch({control:t,name:`${l}.isRequired`}),{customCheckboxes:h,customFields:y}=na(s),g=n.useMemo((()=>{let e=i?"Value":"Default Value";return f&&(e+="s"),e}),[i,f]);return n.useEffect((()=>{m&&"string"==typeof m&&e(`${l}.propertyType`,oa.find((e=>e.value===m)))}),[m,e,l]),r.jsxs(fr.default,{container:!0,direction:"column",spacing:2,children:[r.jsx(fr.default,{children:r.jsx(ct,{required:!0,control:t,name:`${l}.key`,label:"Key"})}),r.jsx(fr.default,{children:r.jsx(ct,{required:!0,control:t,name:`${l}.name`,label:"Name"})}),r.jsx(fr.default,{children:r.jsx(gt,{required:!0,control:t,name:`${l}.propertyType`,label:"Type",options:oa,onChange:(r,t)=>{const a=`${l}.propertyType`,n=`${l}.${i?"value":"defaultValue"}`;e(n,f?[]:null),e(a,t)}})}),r.jsx(fr.default,{children:r.jsx(Zt,{required:!0,control:t,name:`${l}.sortOrder`,label:"Sort Order"})}),r.jsx(fr.default,{children:r.jsx(vt,{control:t,name:`${l}.uiSettings`,label:"UI Settings",validateJson:!0,parseValue:!0})}),r.jsxs(fr.default,{children:[r.jsx(ht,{control:t,name:`${l}.isMultiple`,label:"Multiple"}),r.jsx(ht,{control:t,name:`${l}.isEnabled`,label:"Enabled"}),r.jsx(ht,{control:t,name:`${l}.isRequired`,label:"Required"}),a&&r.jsx(ht,{control:t,name:`${l}.isViewableInList`,label:"Is viewable in list"}),h.length?r.jsx(r.Fragment,{children:h.map(((e,a)=>r.jsx(ht,{control:t,name:`${l}.${e.name}`,label:e.label,checked:e.checked,defaultValue:e.defaultValue},a)))}):null]}),m&&r.jsxs(r.Fragment,{children:[r.jsx(fr.default,{children:r.jsx(Yl.Provider,{value:null!==(p=m.value)&&void 0!==p?p:m,children:r.jsx(la,{name:`${l}.validationNode`})})}),r.jsx(Il,{control:t,propertyType:"string"==typeof m?m:m.value,propertyFieldName:l,globalParameter:i,entityDefinition:a,entityReferenceDefinitionSources:d,entityReferenceValueComponent:u,fileReferenceValueComponent:c}),r.jsx(Jl,{control:t,propertyFieldName:l,name:`${l}.${i?"value":"defaultValue"}`,label:g,required:!!i&&x,entityReferenceDefinitionSources:d,entityReferenceValueComponent:u,fileReferenceValueComponent:c})]}),y.length?r.jsx(r.Fragment,{children:y.map(((e,t)=>r.jsx(fr.default,{children:r.jsx(aa,Object.assign({},e,{propertyFieldName:l}))},t)))}):null]})}));var sa=({entityDefinition:e,globalParameter:t,customPropertyFields:l,index:a,arrLength:o,entityReferenceDefinitionSources:i,entityReferenceValueComponent:s,control:d,setValue:u,fileReferenceValueComponent:c,handleRemoveParameter:p,error:m,item:f,extRefs:x})=>{const[h,y]=n.useState(a===o&&!f.key);return r.jsx(fr.default,{sm:12,ref:e=>x.current[a]=e,children:r.jsxs(Rr.default,{expanded:h,onChange:()=>y(!h),elevation:3,children:[r.jsx(Fr.default,{expandIcon:r.jsx(ce.ExpandMore,{}),children:r.jsx(Xe.default,{color:m&&m[a]?"secondary":"initial",style:{wordBreak:"break-word"},children:f.name||`Property ${a+1}`})}),r.jsx(Lr.default,{children:h&&r.jsx(ia,{control:d,setValue:u,propertyFieldName:`properties.${a}`,entityDefinition:e,globalParameter:t,customPropertyFields:l,entityReferenceDefinitionSources:i,entityReferenceValueComponent:s,fileReferenceValueComponent:c})}),r.jsx(Nr.default,{children:r.jsx(We.default,{variant:"contained",size:"small",color:"secondary",onClick:()=>p(a),children:"Remove"})})]})})};const da={key:"",propertyType:null,name:"",defaultValue:"",defaultValues:[],isRequired:!0,isMultiple:!1,sortOrder:0,isEnabled:!0,executeValue:"",uiSettings:""},ua=n.forwardRef((({properties:e,parentFieldName:t,hideAddButton:l,focusOnIndex:a,required:i,entityDefinition:s=!1,globalParameter:d=!1,customPropertyFields:u=[],parentRemove:c,entityReferenceDefinitionSources:p,entityReferenceValueComponent:m,fileReferenceValueComponent:f},x)=>{var h;const{clearErrors:y,control:g,setValue:b,getValues:C,reset:v,trigger:j,watch:T}=o.useForm({mode:"all",defaultValues:{properties:e}}),{fields:E,append:P,remove:S}=o.useFieldArray({control:g,name:"properties"}),{fieldState:{error:O}}=o.useController({control:g,name:"properties",rules:{validate:e=>!i||!Array.isArray(e)||0!==e.length||"Please, fill the properties"}}),k=n.useRef([]),w=n.useCallback((()=>{P(da),y("properties")}),[P,y]),M=n.useCallback((e=>{c&&c(e),S(e)}),[c,S]);return n.useEffect((()=>{"number"==typeof a&&k.current[a]&&k.current[a].scrollIntoView({behavior:"smooth",block:"start"})}),[a,k]),n.useEffect((()=>{var r;e.length&&!(null===(r=C("properties"))||void 0===r?void 0:r.length)&&v({properties:e})}),[e,C,v]),n.useImperativeHandle(x,(()=>({getProperties:()=>C("properties"),addProperty:w,removeProperty:M,trigger:j})),[C,w,M,j]),r.jsxs(r.Fragment,{children:[O&&O.message&&r.jsx(fr.default,{sm:12,children:r.jsx(Xe.default,{color:"secondary",children:O.message})}),Array.isArray(E)&&E.map(((e,t,l)=>r.jsx(sa,{item:e,index:t,arrLength:l.length-1,control:g,setValue:b,customPropertyFields:u,entityDefinition:s,globalParameter:d,error:O,handleRemoveParameter:M,fileReferenceValueComponent:f,entityReferenceValueComponent:m,entityReferenceDefinitionSources:p,extRefs:k},e.id))),!l&&r.jsxs(fr.default,{xs:12,children:[r.jsx(We.default,{variant:"contained",size:"small",color:"primary",onClick:w,children:"Add property"}),O&&r.jsx(tr.default,{error:!0,children:null===(h=O.root)||void 0===h?void 0:h.message})]})]})})),ca={key:"",propertyType:null,name:"",defaultValue:"",defaultValues:[],isRequired:!0,isMultiple:!1,sortOrder:0,isEnabled:!0,executeValue:"",uiSettings:""},pa=({control:e,parentFieldName:t,hideAddButton:l,focusOnIndex:a,required:i,entityDefinition:s=!1,globalParameter:d=!1,customPropertyFields:u=[],parentRemove:c,entityReferenceDefinitionSources:p,entityReferenceValueComponent:m,fileReferenceValueComponent:f})=>{var x;const h=n.useMemo((()=>t?`${t}.properties`:"properties"),[t]),{clearErrors:y,setValue:g}=o.useFormContext(),{fields:b,append:C,remove:v}=o.useFieldArray({control:e,name:h}),{fieldState:{error:j}}=o.useController({control:e,name:h,rules:{validate:e=>!i||!Array.isArray(e)||0!==e.length||"Please, fill the properties"}}),T=n.useRef([]),E=n.useCallback((()=>{C(ca),y("properties")}),[C,y]),P=n.useCallback((e=>{c&&c(e),v(e)}),[c,v]);return n.useEffect((()=>{"number"==typeof a&&T.current[a]&&T.current[a].scrollIntoView({behavior:"smooth",block:"start"})}),[a,T]),r.jsxs(r.Fragment,{children:[j&&j.message&&r.jsx(fr.default,{sm:12,children:r.jsx(Xe.default,{color:"secondary",children:j.message})}),Array.isArray(b)&&b.map(((t,l,a)=>r.jsx(fr.default,{sm:12,ref:e=>T.current[l]=e,children:r.jsxs(Rr.default,{defaultExpanded:l===a.length-1&&!t.key,elevation:3,children:[r.jsx(Fr.default,{expandIcon:r.jsx(ce.ExpandMore,{}),children:r.jsx(Xe.default,{color:j&&j[l]?"secondary":"initial",style:{wordBreak:"break-word"},children:t.name||`Property ${l+1}`})}),r.jsx(Lr.default,{children:r.jsx(ia,{control:e,setValue:g,propertyFieldName:`${h}.${l}`,entityDefinition:s,globalParameter:d,customPropertyFields:u,entityReferenceDefinitionSources:p,entityReferenceValueComponent:m,fileReferenceValueComponent:f})}),r.jsx(Nr.default,{children:r.jsx(We.default,{variant:"contained",size:"small",color:"secondary",onClick:()=>P(l),children:"Remove"})})]})},t.id))),!l&&r.jsxs(fr.default,{xs:12,children:[r.jsx(We.default,{variant:"contained",size:"small",color:"primary",onClick:E,children:"Add property"}),j&&r.jsx(tr.default,{error:!0,children:null===(x=j.root)||void 0===x?void 0:x.message})]})]})},ma=n.forwardRef((({control:e,definitionFieldName:t,title:l,hideCodeField:a,hideVersionField:n,hideNameField:i,required:s=!1,entityReferenceDefinitionSources:d,entityReferenceValueComponent:u,fileReferenceValueComponent:c},p)=>{const{control:m,getValues:f}=o.useFormContext(),x=f(`${t}.properties`);return r.jsxs(fr.default,{container:!0,direction:"column",spacing:2,children:[l&&r.jsx(fr.default,{sm:12,children:r.jsx(Ke.default,{my:2,children:r.jsx(Xe.default,{variant:"h6",children:l})})}),!i&&r.jsx(fr.default,{sm:12,children:r.jsx(ct,{required:!0,control:null!=e?e:m,name:t?`${t}.name`:"name",label:"Name"})}),!a&&r.jsx(fr.default,{sm:12,children:r.jsx(ct,{required:!0,control:null!=e?e:m,name:t?`${t}.code`:"code",label:"Code"})}),!n&&r.jsx(fr.default,{sm:12,children:r.jsx(Zt,{required:!0,control:null!=e?e:m,name:t?`${t}.version`:"version",label:"Version"})}),p?r.jsx(ua,{ref:p,properties:x,required:s,parentFieldName:t,entityReferenceDefinitionSources:d,entityReferenceValueComponent:u,fileReferenceValueComponent:c}):r.jsx(pa,{control:e,required:s,parentFieldName:t,entityReferenceDefinitionSources:d,entityReferenceValueComponent:u,fileReferenceValueComponent:c})]})})),fa={name:"Name",key:"Key",propertyType:"Property Type",defaultValue:"Default Value",defaultValues:"Default Values",sortOrder:"Sort Order",isRequired:"Required",isMultiple:"Multiple",isEnabled:"Enabled",isViewableInList:"Is Viewable In List",precisionScale:"Precision Scale",roundingMode:"Rounding Mode",format:"Format",definitionCode:"Definition Code",definitionVersion:"Definition Version",labelPropertyCode:"Label Property Code",valuePropertyCode:"Value Property Code",restrictedValues:"Restricted Values",value:"Value",values:"Values",uiSettings:"UI Settings",validationNode:"Validation Node"},xa=({value:e,type:t})=>t!==exports.PropertyType.JSON&&t!==exports.PropertyType.ENTITY&&t!==exports.PropertyType.ANY||!e?r.jsx(Xe.default,{variant:"subtitle1",display:"inline",style:{wordBreak:"break-word"},children:null===e?"null":e.toString()}):r.jsx(St,{value:e}),ha=(e,t,l)=>{switch(t){case"isRequired":case"isMultiple":case"isEnabled":case"isViewableInList":return e?r.jsx(ze.default,{color:"primary",fontSize:"small",children:r.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}):null;case"restrictedValues":return e?r.jsx(Ke.default,{display:"flex",flexWrap:"wrap",children:e.map((e=>r.jsx(mr.default,{label:e,style:{wordBreak:"break-word",maxWidth:"500px"}},e)))}):null;case"defaultValue":case"value":return r.jsx(xa,{value:e,type:l});case"values":case"defaultValues":return Array.isArray(e)&&l!==exports.PropertyType.ENTITY&&l!==exports.PropertyType.JSON&&l!==exports.PropertyType.ANY?r.jsxs("div",{children:["[",null==e?void 0:e.map(((e,t)=>r.jsx("div",{children:r.jsx(xa,{value:e,type:l})},t))),"]"]}):r.jsx(St,{value:e});case"uiSettings":case"validationNode":return e?r.jsx(St,{value:e}):null;default:return r.jsx(Xe.default,{variant:"subtitle1",display:"inline",style:{wordBreak:"break-word"},children:e})}};var ya=({property:e})=>{const t=n.useMemo((()=>(e&&(e.isMultiple?(delete e.defaultValue,delete e.value):(delete e.defaultValues,delete e.values)),e)),[e]);return r.jsx(gr.default,{size:"small",children:r.jsx(br.default,{children:Object.keys(fa).map((e=>e in t?r.jsxs(Tr.default,{children:[r.jsx(Cr.default,{width:"30%",children:r.jsx(Xe.default,{children:fa[e]})}),r.jsx(Cr.default,{children:ha(t[e],e,t.propertyType)})]},e):null))})})};const ga=({properties:e,parentNames:t=[]})=>{const l=n.useMemo((()=>{let r=!1;return e.every((e=>e.propertyType!==exports.PropertyType.ENTITY||(r=!0,!1))),r}),[e]);return r.jsxs(Ke.default,{mt:4,children:[r.jsx(Xe.default,{variant:"h6",children:"Properties"}),r.jsxs(Ir.default,{orientation:"vertical",style:{paddingLeft:"4px"},children:[e.map((e=>r.jsxs(qr.default,{expanded:!0,children:[r.jsx(Ar.default,{StepIconProps:{icon:"",completed:!1,active:!0}}),r.jsx(_r.default,{children:r.jsx(Ca,{property:e,parentNames:[...t],defaultExpanded:!1})})]},e.key))),l&&r.jsx(qr.default,{})]})]})};var ba=n.memo(ga);const Ca=({property:e,parentNames:t=[],defaultExpanded:l=!0})=>{const[a,o]=n.useState(!0);return n.useEffect((()=>{o(l)}),[l]),r.jsxs(Rr.default,{elevation:3,style:{backgroundColor:t.length%2==1?"#f1f1f1":"#fff"},expanded:a,onChange:()=>o((e=>!e)),children:[r.jsx(Fr.default,{expandIcon:r.jsx(ze.default,{children:r.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),children:r.jsx(Xe.default,{style:{wordBreak:"break-word",fontWeight:"600"},children:e.name})}),r.jsx(Lr.default,{children:r.jsxs(Ke.default,{width:"100%",children:[r.jsx(ya,{property:e}),e.propertyType===exports.PropertyType.ENTITY&&r.jsx(ba,{properties:Ht(e.properties),parentNames:[...t,e.name]})]})})]})},va=({property:e,name:t,useExpression:l,label:a,required:i,title:s,entityReferenceDefinitionSources:d,entityReferenceValueComponent:u,fileReferenceValueComponent:c,requiredErrorText:p=""})=>{const{control:m,clearErrors:f,setValue:x}=o.useFormContext(),{field:{value:h},fieldState:{error:y,isDirty:g}}=o.useController({name:t,control:m,rules:{validate:e=>!i||null!==e||(p||dt)}}),b=n.useRef({}),{propertyType:C,valueLabel:v,fillOptionLabel:j,fillOption:T,fillOptions:E,setFillOption:P,defaultProperyValue:S}=$l({value:h,property:e,isDirty:g,label:a,required:i,useExpression:l}),O=n.useCallback((r=>{const l=r.target.value;b.current=Object.assign(Object.assign({},b.current),{[T]:h}),P(l);const a=b.current[l];if("null"===l)x(t,null,{shouldDirty:!0});else if("widget"===l)if(C===exports.PropertyType.JSON&&h&&"string"!=typeof h&&"dem_builder"===T&&"properties"in h){const e=Object.assign(Object.assign({},h),{properties:Bt(h.property||[])});try{x(t,null!=a?a:JSON.stringify(e,null,"\t"))}catch(e){console.log("Stringify failed",e)}}else x(t,null!=a?a:e.defaultValue||S);else if("expression"===l||"string"===l)x(t,null!=a?a:"",{shouldDirty:!0});else if("dem_builder"===l){const e={code:"",name:"",version:0,properties:[]};if(h)try{const e=JSON.parse(h);e.properties=Ht(e.properties||{}),x(t,null!=a?a:e,{shouldDirty:!0})}catch(r){x(t,null!=a?a:e,{shouldDirty:!0})}else x(t,null!=a?a:e,{shouldDirty:!0})}f()}),[t,f,h,P,T,C,e,x,S]);return n.useEffect((()=>{var r;!g&&_t(h)&&(!e.isRequired||null!==e.defaultValue&&null!==e.value?e.isRequired||null!==e.defaultValue&&null!==e.value?_t(e.defaultValue)&&_t(e.value)||x(t,e.defaultValue||e.value):x(t,null):x(t,null!==(r=b.current[T])&&void 0!==r?r:S,{shouldDirty:!0}))}),[h,e,t,T,g,x,S]),r.jsxs(fr.default,{xs:12,children:[s&&r.jsx(Ke.default,{mb:2,children:r.jsx(Xe.default,{variant:"h6",children:s})}),E?r.jsx(Ke.default,{mb:2,children:r.jsxs(er.default,{fullWidth:!0,size:"small",variant:"outlined",children:[r.jsx(zl,{htmlFor:"type-select",children:j}),r.jsx(zr.default,{labelId:"type-select",label:j,value:T||"",onChange:O,children:E.map((e=>r.jsx(_e.default,{value:e.value,children:e.label},e.value)))})]})}):null,"expression"===T&&(C===exports.PropertyType.JSON||C===exports.PropertyType.ENTITY||C===exports.PropertyType.ANY?r.jsx(vt,{name:t,control:m,label:v,parseValue:!0,hideErrorMessage:!0,useCleanValue:!0,mode:C===exports.PropertyType.ANY?"text":"json"}):r.jsx(ct,{control:m,name:t,label:v,hideErrorMessage:!0})),"string"===T&&r.jsx(ct,{control:m,name:t,label:v,hideErrorMessage:!0}),"json_notvalid"===T&&r.jsx(vt,{name:t,control:m,label:v,hideErrorMessage:!0}),"widget"===T&&r.jsx(_l,{control:m,property:e,name:t,useExpression:l,label:v,entityReferenceDefinitionSources:d,entityReferenceValueComponent:u,fileReferenceValueComponent:c}),"dem_builder"===T&&r.jsx(ma,{title:"JSON",definitionFieldName:t,entityReferenceDefinitionSources:d,entityReferenceValueComponent:u,fileReferenceValueComponent:c}),y&&r.jsx(tr.default,{error:!0,children:y.message})]})};var ja=({name:e,property:t,useExpression:l,required:a,label:i,entityReferenceDefinitionSources:s,entityReferenceValueComponent:d,fileReferenceValueComponent:u})=>{const{control:c,setValue:p,clearErrors:m}=o.useFormContext(),f=o.useWatch({control:c,name:e}),x=n.useCallback((()=>{f&&Array.isArray(f)?p(`${e}.${f.length}`,null):p(e,[]),m(e)}),[e,f,p,m]),h=n.useCallback((r=>{p(e,jt(f,r))}),[e,f,p]);return r.jsxs(fr.default,{container:!0,spacing:2,direction:"column",xs:12,children:[Array.isArray(f)&&f.length?f.map(((n,o)=>r.jsx(fr.default,{xs:12,children:r.jsxs(Ke.default,{display:"flex",alignItems:"flex-start",width:"100%",p:2,style:{backgroundColor:"#f1f1f1"},children:[r.jsx(va,{required:a,property:t,useExpression:l,name:`${e}.${o}`,label:`${i||t.name} (${o+1})`,entityReferenceDefinitionSources:s,entityReferenceValueComponent:d,fileReferenceValueComponent:u}),r.jsx(Ke.default,{mt:"8px",ml:"4px",children:r.jsx(Be.default,{id:"close-button",size:"small",onClick:()=>h(o),children:r.jsx(ze.default,{fontSize:"small",children:r.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})})})})]})},o))):null,r.jsx(fr.default,{children:r.jsx(We.default,{variant:"contained",size:"small",color:"primary",onClick:x,children:"Add value"})})]})};const Ta=({property:e,name:t,useExpression:l,required:a,label:i,title:s,entityReferenceDefinitionSources:d,entityReferenceValueComponent:u,fileReferenceValueComponent:c,requiredErrorText:p=""})=>{var m;const[f,x]=n.useState(!1),{control:h,clearErrors:y,setValue:g,watch:b}=o.useFormContext(),{field:{ref:C,onChange:v},fieldState:{error:j,isDirty:T}}=o.useController({control:h,name:t,defaultValue:null!==(m=e.defaultValue)&&void 0!==m?m:[],rules:{validate:e=>!(a&&!e)||(p||dt)}}),E=b(t),P=n.useRef({}),{propertyType:S,valueLabel:O,fillOptionLabel:k,fillOption:w,fillOptions:M,setFillOption:V,checkFillOption:R}=$l({property:e,value:E,isDirty:T,label:i,required:a,useExpression:l,multipleOptions:!0});return n.useEffect((()=>{E||v(e.isRequired&&e.isMultiple?[]:null)}),[E,e,v]),n.useEffect((()=>{E&&!f&&(x(!0),R())}),[R,f,E]),r.jsxs(fr.default,{children:[s&&r.jsx(Ke.default,{mb:2,children:r.jsx(Xe.default,{variant:"h6",children:s})}),M?r.jsx(Ke.default,{mb:2,children:r.jsxs(er.default,{fullWidth:!0,size:"small",variant:"outlined",children:[r.jsx(zl,{htmlFor:"type-select",children:k}),r.jsx(zr.default,{labelId:"type-select",label:k,value:w||"",onChange:e=>{x(!0),P.current=Object.assign(Object.assign({},P.current),{[w]:E});const r=e.target.value,l=P.current[r];"null"===r?g(t,null):"expression"===r||"json_valid"===r||"json_notvalid"===r?g(t,null!=l?l:"",{shouldDirty:!0}):"widget"===r&&g(t,null!=l?l:[],{shouldDirty:!0}),V(r),y(t)},children:M.map((e=>r.jsx(_e.default,{value:e.value,children:e.label},e.value)))})]})}):null,"expression"===w&&(S===exports.PropertyType.JSON||S===exports.PropertyType.ENTITY||S===exports.PropertyType.ANY?r.jsx(vt,{name:t,control:h,label:O,parseValue:!0,hideErrorMessage:!0,useCleanValue:!0,mode:S===exports.PropertyType.ANY?"text":"json"}):r.jsx(ct,{required:!0,hideErrorMessage:!0,control:h,name:t,label:O})),"json_valid"===w&&r.jsx(vt,{name:t,control:h,label:O,parseValue:!0,validateJson:!0,hideErrorMessage:!0}),"widget"===w&&r.jsx(ja,{property:e,name:t,useExpression:l,required:a,label:i,entityReferenceDefinitionSources:d,entityReferenceValueComponent:u,fileReferenceValueComponent:c}),j&&r.jsx(tr.default,{error:!0,children:j.message})]})},Ea=({properties:e,dataFieldName:t,useExpression:l=!1,title:a,entityReferenceDefinitionSources:o,entityReferenceValueComponent:i,fileReferenceValueComponent:s})=>{const d=n.useMemo((()=>e?e.map((e=>{var a;const n="string"==typeof e.propertyType?e.propertyType:null===(a=e.propertyType)||void 0===a?void 0:a.value;return{label:r.jsxs(Ke.default,{display:"flex",flexDirection:"column",children:[r.jsxs("b",{children:[e.name,e.isRequired?"*":""]}),r.jsxs("span",{children:[e.key," | ",e.isMultiple?"multiple":"single"," |"," ",n]})]}),content:e.isMultiple?r.jsx(Ta,{property:e,name:`${t}.${e.key}`,useExpression:l,label:e.name,required:e.isRequired,entityReferenceValueComponent:i,fileReferenceValueComponent:s,entityReferenceDefinitionSources:o}):r.jsx(va,{property:e,name:`${t}.${e.key}`,useExpression:l,label:e.name,required:e.isRequired,entityReferenceDefinitionSources:o,entityReferenceValueComponent:i,fileReferenceValueComponent:s})}})):[]),[e,t,l,i,o,s]);return r.jsx(be.LocalizationProvider,{dateAdapter:ge.AdapterDateFns,children:r.jsxs(fr.default,{container:!0,direction:"column",spacing:2,children:[a&&r.jsx(fr.default,{xs:12,children:r.jsx("div",{style:{fontWeight:"600"},children:a})}),r.jsx(Vl,{data:d})]})})};var Pa=({property:e,data:t})=>{const{name:l}=e,a=n.useCallback(((e,r)=>{const t=e,l=document.createElement("a");document.body.appendChild(l),l.href=t,l.target="_self",l.download=r,l.click()}),[]);return r.jsx(We.default,{component:"label",variant:"contained",size:"large",color:"primary",onClick:()=>a(t,l),children:"Download File"})};const Sa=({property:e,data:t,properties:l})=>{const a=e=>r.jsx(Ke.default,{style:{backgroundColor:"#fff",border:"1px solid #ccc",borderRadius:"4px",padding:"4px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:null===e?"null":e.toString()});switch(e.propertyType){case exports.PropertyType.JSON:return r.jsx(St,{value:t});case exports.PropertyType.ENTITY:return r.jsx(ka,{properties:l,data:t});case exports.PropertyType.ANY:return"object"==typeof t?r.jsx(St,{value:t}):a(t);case exports.PropertyType.FILE_REFERENCE:return null===t?a(t):r.jsx(We.default,{component:V.Link,color:"primary",variant:"contained",target:"_blank",to:t,sx:{marginTop:4},children:"Download via link"});case exports.PropertyType.FILE:return null===t?a(t):r.jsx(Pa,{data:t,property:e});default:return a(t)}};var Oa=({property:e,data:t,hasBackground:l=!1})=>{const a=n.useMemo((()=>e.propertyType===exports.PropertyType.ENTITY?Array.isArray(e.properties)?e.properties:Ht(e.properties):[]),[e]);return r.jsx(Ke.default,{style:{backgroundColor:l?"#f1f1f1":"none"},children:r.jsx(Sa,{property:e,data:t,properties:a})})};const ka=({properties:e,data:t})=>{const l=n.useMemo((()=>e&&t?e.map((e=>{const{key:l,name:a,isMultiple:n,propertyType:o}=e,i=t[e.key]?t[e.key]:null;return{label:r.jsxs(Ke.default,{display:"flex",flexDirection:"column",children:[r.jsx("b",{children:a}),r.jsxs("span",{children:[l," | ",n?"multiple":"single"," | ",o]})]}),content:n&&Array.isArray(i)&&e.propertyType!==exports.PropertyType.ANY?r.jsx(r.Fragment,{children:i.map(((t,l)=>r.jsx(Ke.default,{mb:2,children:r.jsx(Oa,{property:e,data:t,hasBackground:!0})},l)))}):r.jsx(Oa,{property:e,data:i})}})):[]),[e,t]);return r.jsx(fr.default,{container:!0,direction:"column",spacing:2,children:r.jsx(Vl,{data:l})})},wa=e.styled(Ke.default)((({theme:e})=>({backgroundColor:"#eee",fontSize:"14px",padding:"0 8px",borderRadius:"10px",width:"fit-content","&.success":{backgroundColor:"#a9dfa9"},"&.error":{backgroundColor:"#ff7e7e"},"&.warning":{backgroundColor:e.palette.warning.main}}))),Ma=({text:e,status:t="default"})=>r.jsx(wa,{className:Hr.default("root",{[t]:!0}),children:e}),Va=({properties:e,parentKey:t="",activePath:l="",prefix:a="",onClick:n})=>r.jsx(Ir.default,{orientation:"vertical",onClick:e=>e.stopPropagation(),children:e&&e.map((e=>{var o;const i=t?`${t}.${e.key}`:e.key,s=null!==(o=e.propertyType.value)&&void 0!==o?o:e.propertyType;return r.jsxs(qr.default,{expanded:!0,onClick:()=>{return e=i,void n(a?`${a}.${e}`:e);var e},children:[r.jsx(Ar.default,{StepIconProps:{icon:"",completed:!1,active:l===i},children:r.jsxs(Ke.default,{sx:{propertyStepLabel:{"&:hover":{fontWeight:"600",cursor:"pointer"}}},children:[e.name," - ",e.key," - ",s]})}),r.jsx(_r.default,{children:r.jsx("div",{children:s===exports.PropertyType.ENTITY&&r.jsx(Va,{onClick:n,activePath:l,properties:e.properties,parentKey:i},e.key)})})]},e.key)}))});var Ra=Va;const Fa=n.createContext({collapsed:!1,toggleCollapse:()=>{console.log("collapse toggle")}}),La=()=>n.useContext(Fa),Na=({children:e})=>{const[t,l]=n.useState("true"===localStorage.getItem("sidebar_collapsed")),a=n.useCallback((()=>{l(!t),localStorage.setItem("sidebar_collapsed",`${!t}`),window.dispatchEvent(new CustomEvent("sidebar_collapsed",{detail:{collapsed:!t}}))}),[t]),o=n.useCallback(((e,r)=>{localStorage.setItem(`${e.toLowerCase()}_collapsed`,`${!r}`)}),[]);return r.jsx(Fa.Provider,{value:{collapsed:t,toggleCollapse:a,toggleRootElementLink:o},children:e})},Da=e.styled("div")({position:"relative","&:hover":{".button-collapse":{opacity:1}}}),Ia=e.styled(Jr.default)((e=>({width:248,flexShrink:0,position:"relative",transition:"all 0.3s ease-in-out","& .MuiDrawer-paper":{backgroundColor:e.theme.palette.secondary.main,width:248,boxSizing:"border-box",borderRight:"none",borderRadius:0,transition:"all 0.3s ease-in-out",overflow:"hidden"},"&.collapsed":{width:70,"& .MuiDrawer-paper":{width:70}}}))),qa=e.styled(Qr.default)((({theme:e})=>({backgroundColor:"#fff",borderRight:"1px solid rgba(38, 40, 66, 0.08)",position:"relative","& span":{paddingLeft:10,paddingTop:5,fontSize:24,fontWeight:600,transition:".3s ease .1s",whiteSpace:"nowrap"},"&:after":{transition:"opacity .3s",content:"attr(data-title)",fontSize:30,position:"absolute",left:"50%",transform:"translate3d(-50%, 0, 0)",opacity:0,visibility:"hidden"},"&.collapsed":{justifyContent:"center","& img":{width:40},"& span":{opacity:0,visibility:"hidden",transitionDelay:"0s"},"&:after":{opacity:1,visibility:"visible",transitionDelay:".1s"}}}))),Aa=e.styled(Gr.default)((e=>({padding:e.theme.spacing(3),margin:0}))),_a=e.styled(Yr.default)((e=>({color:"#fff",height:e.theme.spacing(11),overflow:"hidden"}))),$a=e.styled(Ur.default)((({theme:e})=>({borderRadius:e.spacing(2.5),padding:e.spacing(2),height:e.spacing(11),alignItems:"center","&.active":{backgroundColor:"rgba(38, 40, 66, 0.12)","&.main":{backgroundColor:"rgba(255, 255, 255, 0.12)",borderLeft:"4px solid #E0613A"}},"&:hover":{backgroundColor:"rgba(255, 255, 255, 0.08)"},"&.collapsed":{width:e.spacing(11.5),"&.active":{"&.main":{border:"none",backgroundColor:"#E0613A"}}}}))),za=e.styled(Zr.default)((({theme:e})=>({color:"#fff",minWidth:20,marginRight:e.spacing(2),"& svg":{marginLeft:2,fill:"#fff",color:"#fff"}}))),Ba=e.styled(Kr.default)((({theme:e})=>({textTransform:"uppercase",borderRadius:e.spacing(2.5),backgroundColor:e.palette.secondary.main,color:"#fff",paddingLeft:0,paddingRight:0,position:"relative","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.08)"},"&.collapsed":{fontSize:24,textAlign:"center",fontWeight:"bold",paddingRight:0}}))),Ha=e.styled(Xr.default)((({theme:e})=>({width:"100%",marginLeft:e.spacing(2),alignItems:"center","& > *":{overflow:"hidden",textOverflow:"ellipsis",wordBreak:"break-all",whiteSpace:"nowrap"}}))),Wa=e.styled(Gr.default)((e=>({margin:0,padding:0,"& .MuiListItemText-root:not(.main)":{paddingLeft:e.theme.spacing(8.5)}}))),Ja=e.styled(et.default)((e=>({position:"absolute",top:e.theme.spacing(10),left:"calc(100% - 16px)",width:e.theme.spacing(8),height:e.theme.spacing(8),border:"1px solid #E0E3EA",borderRadius:"50%",boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.12)",backgroundColor:"#fff",zIndex:8e3,opacity:0,transition:"all 0.3s ease-in-out","&.collapsed":{img:{transition:"all 0.3s ease-in-out",transform:"rotate(180deg)"}}})));var Ga=({route:e,isActive:t,isSubmenu:l})=>{const{collapsed:a}=La(),[o,i]=$e.default.useState(null),s=Boolean(o),d=e=>{i(e.currentTarget)},u=()=>{i(null)},c=n.useCallback((({children:t})=>a&&!l?r.jsx(ur.default,{title:e.name,placement:"right",children:t}):t),[a,e,l]);return e.link?r.jsx(_a,{disablePadding:!0,component:V.Link,replace:!0,to:{pathname:e.link,search:e.query},children:r.jsx(c,{children:r.jsxs($a,{className:Hr.default({active:t,main:e.main,collapsed:a}),children:[e.icon&&r.jsx(za,{className:Hr.default({collapsed:a}),children:e.icon}),r.jsx(Ha,{primary:e.name,primaryTypographyProps:{variant:"body2"},className:Hr.default({collapsed:a,main:e.main}),sx:a&&!l?{display:"none"}:{}})]})})}):e.children&&a?r.jsxs(r.Fragment,{children:[r.jsx(Ba,{className:"collapsed",children:r.jsx(ur.default,{title:e.name,placement:"right",children:r.jsx($a,{className:Hr.default({active:t,main:e.main,collapsed:a}),sx:{justifyContent:"center"},onClick:d,children:e.name.substring(0,1)})})}),r.jsx(Or.default,{open:s,anchorEl:o,onClose:u,PaperProps:{sx:{width:300,maxHeight:440}},MenuListProps:{sx:{bgcolor:"secondary.main"}},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:e.children.map(((e,t)=>r.jsx(Xa,{route:e,isSubmenu:!0},t)))})]}):r.jsx(Ba,{children:e.name})},Ya="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg opacity='0.6'%3e%3cpath d='M10.3533 2.81334C10.447 2.90709 10.4996 3.03417 10.4996 3.16667C10.4996 3.29917 10.447 3.42626 10.3533 3.52001L5.87334 8.00001L10.3533 12.48C10.4025 12.5258 10.4419 12.581 10.4692 12.6423C10.4965 12.7036 10.5112 12.7699 10.5124 12.837C10.5136 12.9041 10.5012 12.9708 10.4761 13.0331C10.4509 13.0953 10.4135 13.1519 10.366 13.1994C10.3186 13.2468 10.262 13.2843 10.1997 13.3094C10.1375 13.3346 10.0708 13.3469 10.0037 13.3457C9.93652 13.3446 9.87032 13.3299 9.80898 13.3025C9.74765 13.2752 9.69245 13.2358 9.64667 13.1867L4.81334 8.35334C4.71971 8.25959 4.66711 8.13251 4.66711 8.00001C4.66711 7.86751 4.71971 7.74042 4.81334 7.64667L9.64667 2.81334C9.74042 2.71971 9.86751 2.66711 10 2.66711C10.1325 2.66711 10.2596 2.71971 10.3533 2.81334Z' fill='white'/%3e%3c/g%3e%3c/svg%3e";var Za=({route:e,isActive:t,isListOpen:l,handleClick:a,isSubmenu:n})=>r.jsx(Ba,{children:r.jsx(Aa,{sx:{padding:0,margin:0},children:r.jsx(_a,{disablePadding:!0,onClick:a,children:r.jsxs($a,{className:Hr.default({active:t,main:e.main}),sx:{justifyContent:"space-between"},children:[r.jsx(Ha,{primary:e.name,className:Hr.default({main:e.main}),sx:n?{}:{display:"none"}}),e.name,r.jsx(Ke.default,{component:"img",src:Ya,mr:3,sx:{transition:"transform .3s",transform:`rotate(${l?0:"-90deg"})`}})]})})})});function Ua({route:e,isActive:t,isListOpen:l,handleClick:a,isSubmenu:n}){const{collapsed:o}=La();return(null==e?void 0:e.link)?r.jsx(_a,{disablePadding:!0,onClick:a,children:r.jsxs($a,{className:Hr.default({active:t,main:e.main,collapsed:o}),children:[e.icon&&r.jsx(za,{children:e.icon}),r.jsx(Ha,{primary:e.name,primaryTypographyProps:{variant:"body2"},className:Hr.default({collapsed:o,main:e.main}),sx:o&&!n?{display:"none"}:{}}),r.jsx(Ke.default,{component:"img",src:Ya,mr:3,sx:{transition:"transform .3s",transform:`rotate(${l?"-90deg":0})`}})]})}):(null==e?void 0:e.rootLink)?r.jsx(Za,{route:e,handleClick:a,isListOpen:l}):r.jsx(Ba,{children:e.name})}const Ka=({route:e,isSubmenu:t})=>{var l,a,o;const i=V.useLocation(),{collapsed:s,toggleRootElementLink:d}=La(),[u,c]=n.useState(!1),[p,m]=n.useState("true"===localStorage.getItem(`${e.name.toLowerCase()}_collapsed`)),f=n.useMemo((()=>!(!e.link&&!e.rootLink)&&i.pathname.startsWith(e.link||e.rootLink)),[i.pathname,e]),x=n.useCallback((()=>{e&&e.rootLink&&(d(e.name,p),m(!p))}),[p,e,d]);return n.useEffect((()=>{c(f)}),[f]),(null==e?void 0:e.rootLink)&&(null===(l=e.children)||void 0===l?void 0:l.length)&&(!s||s&&t)?r.jsxs(r.Fragment,{children:[r.jsx(Ua,{route:e,isActive:f,handleClick:x,isListOpen:p,isSubmenu:t}),r.jsx(rt.default,{in:!p,timeout:"auto",children:r.jsx(Wa,{children:e.children.map((e=>r.jsx(Ka,{route:e,isSubmenu:t},e.name)))})})]}):(null===(a=e.children)||void 0===a?void 0:a.length)&&(!s||s&&t)?r.jsxs(r.Fragment,{children:[r.jsx(Ua,{route:e,isActive:f,handleClick:()=>{c(!u)},isListOpen:u||!e.link,isSubmenu:t}),r.jsx(rt.default,{in:u||!e.link,timeout:"auto",children:r.jsx(Wa,{children:null===(o=e.children)||void 0===o?void 0:o.map(((e,l)=>r.jsx(Ka,{route:e,isSubmenu:t},e.name)))})})]}):r.jsx(Ga,{route:e,isActive:f,isSubmenu:t})};var Xa=Ka;var Qa=({title:e,routes:t,id:l,logo:a,collapsedLogo:n,footer:o,collapsedFooter:i})=>{const{collapsed:s,toggleCollapse:d}=La();return r.jsxs(Da,{children:[r.jsx(Ja,{className:Hr.default("button-collapse",{collapsed:s}),onClick:d,children:r.jsx("img",{src:"data:image/svg+xml,%3csvg width='7' height='12' viewBox='0 0 7 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6.47054 0.861939C6.59552 0.986958 6.66573 1.1565 6.66573 1.33327C6.66573 1.51005 6.59552 1.67959 6.47054 1.80461L2.27521 5.99994L6.47054 10.1953C6.59198 10.321 6.65917 10.4894 6.65766 10.6642C6.65614 10.839 6.58602 11.0062 6.46242 11.1298C6.33881 11.2534 6.1716 11.3235 5.99681 11.3251C5.82201 11.3266 5.65361 11.2594 5.52787 11.1379L0.861207 6.47127C0.736226 6.34625 0.666016 6.17672 0.666016 5.99994C0.666016 5.82316 0.736226 5.65362 0.861207 5.52861L5.52787 0.861939C5.65289 0.736958 5.82243 0.666748 5.99921 0.666748C6.17598 0.666748 6.34552 0.736958 6.47054 0.861939V0.861939Z' fill='%238B8C9E'/%3e%3c/svg%3e",alt:"collapse"})}),r.jsxs(Ia,{variant:"permanent",anchor:"left",className:Hr.default({collapsed:s}),id:l,children:[(!!e||!!a)&&r.jsx(qa,{className:Hr.default({collapsed:s}),"data-title":e.substring(0,1),children:r.jsxs(Ke.default,{display:"flex",flexDirection:"column",children:[!!e&&r.jsx(Ke.default,{component:"span",children:e}),!!a&&r.jsx(Ke.default,{component:"img",src:s?n:a,alt:"Lending Hub KZ"})]})}),r.jsxs(Ke.default,{height:""+(a||e?"calc(100vh - 56px)":"auto"),display:"flex",flexDirection:"column",justifyContent:"space-between",children:[r.jsx(Aa,{sx:{overflowY:"auto","&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-thumb":{background:"rgba(196, 196, 196, 0.8)",borderRadius:"16px",backgroundClip:"padding-box",border:"2px solid rgba(0, 0, 0, 0)"}},children:t.map((e=>r.jsx(Xa,{route:e},e.name)))}),o&&r.jsx(Ke.default,{borderTop:"1px solid #FFFFFF1F",children:s?i:o})]})]})]})};const en=e.styled(V.Link)((()=>({textDecoration:"none",color:"inherit"}))),rn=({children:e})=>{const[t,l]=n.useState(!1),a=n.useCallback((e=>{l((null==e?void 0:e.scrollWidth)>(null==e?void 0:e.clientWidth));window.addEventListener("resize",(()=>{l((null==e?void 0:e.scrollWidth)>(null==e?void 0:e.clientWidth))}))}),[]);return r.jsx(ur.default,{title:e,arrow:!0,disableHoverListener:!t,children:r.jsx("div",{ref:a,style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e})})};exports.AlertDialog=({open:e,title:t,description:l,closeButtonTitle:a="Close",onClose:n,confirmButtonTitle:o="Confirm",confirmButtonDisabled:i=!1,disableBackdropClick:s=!1,onConfirm:d,children:u,dialogProps:c,loading:p,maxWidth:m="xs",hideCloseButton:f=!1})=>r.jsx("div",{children:r.jsxs(Je.default,Object.assign({open:e,onClose:s?(e,r)=>{if("backdropClick"===r)return null;n()}:n,disableEscapeKeyDown:s,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",fullWidth:!0,maxWidth:m},c,{children:[p&&r.jsx(st,{}),r.jsxs(Ue.default,{id:"alert-dialog-title",sx:{display:"flex",justifyContent:"space-between"},children:[r.jsx(Xe.default,{variant:"inherit",children:t}),!f&&r.jsx(Be.default,{sx:{padding:0},onClick:n,children:r.jsx(ze.default,{children:r.jsx("g",{opacity:"0.6",children:r.jsx("path",{d:"M4.39704 4.554L4.47004 4.47C4.59702 4.34299 4.76538 4.26576 4.94449 4.25236C5.1236 4.23897 5.30157 4.29029 5.44604 4.397L5.53004 4.47L12 10.939L18.47 4.469C18.5393 4.3974 18.622 4.34031 18.7136 4.30104C18.8051 4.26178 18.9035 4.24114 19.0031 4.24032C19.1027 4.2395 19.2014 4.25853 19.2936 4.29628C19.3857 4.33403 19.4694 4.38976 19.5398 4.46022C19.6102 4.53067 19.6659 4.61443 19.7035 4.70662C19.7412 4.79881 19.7601 4.89758 19.7592 4.99716C19.7583 5.09675 19.7376 5.19515 19.6982 5.28664C19.6589 5.37812 19.6017 5.46085 19.53 5.53L13.061 12L19.531 18.47C19.6579 18.5971 19.7349 18.7655 19.7482 18.9446C19.7614 19.1237 19.7099 19.3016 19.603 19.446L19.53 19.53C19.403 19.657 19.2347 19.7343 19.0556 19.7476C18.8765 19.761 18.6985 19.7097 18.554 19.603L18.47 19.53L12 13.061L5.53004 19.531C5.38852 19.6676 5.19903 19.7431 5.00238 19.7413C4.80574 19.7395 4.61766 19.6605 4.47867 19.5214C4.33968 19.3823 4.26089 19.1941 4.25928 18.9975C4.25766 18.8008 4.33335 18.6114 4.47004 18.47L10.939 12L4.46904 5.53C4.34217 5.40289 4.26512 5.23447 4.25191 5.05537C4.2387 4.87626 4.29019 4.69836 4.39704 4.554L4.47004 4.47L4.39704 4.554Z",fill:"black"})})})})]}),r.jsxs(Ye.default,{children:[l&&r.jsx(Ze.default,{id:"alert-dialog-description",children:l}),r.jsx(Ke.default,{maxWidth:"100%",overflow:"hidden",children:u})]}),r.jsxs(Ge.default,{children:[!f&&r.jsx(We.default,{onClick:n,variant:"outlined",children:a}),o&&d?r.jsx(We.default,{onClick:d,color:"primary",variant:"contained",autoFocus:!0,disabled:i,disableElevation:!0,children:o}):null]})]}))}),exports.BackButton=({text:e,buttonProps:t={}})=>{const l=V.useNavigate(),{state:a}=V.useLocation(),o=n.useMemo((()=>null==a?void 0:a.from),[a]),i=n.useCallback((()=>{l(o||-1)}),[l,o]);return r.jsx(Ke.default,{mr:2,children:e?r.jsx(We.default,Object.assign({color:"inherit",onClick:o?null:i,component:V.Link,to:null!=o?o:""},t,{children:e})):r.jsx(Be.default,{onClick:i,children:r.jsx(ze.default,{children:r.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"})})})})},exports.Breadcrumbs=({crumbs:e})=>r.jsx(tt.default,{separator:r.jsx(lt.default,{fontSize:"small"}),"aria-label":"breadcrumb",sx:{"& li":{color:"#6D6E85","&:last-child":{color:"#262842"}}},children:e.map(((e,t)=>e.link?r.jsx(en,{to:e.link,className:"breadcrumb",children:e.title},t):r.jsx(Xe.default,{className:"breadcrumb",children:e.title},t)))}),exports.ContentLayout=({children:e,toolbar:t,contentSx:l,sx:a})=>r.jsxs(Ke.default,{component:"section",sx:Object.assign({flexGrow:1,bgcolor:"background.default"},a),children:[r.jsx(Qr.default,{sx:{borderBottom:"1px solid rgba(38, 40, 66, 0.08)"},children:t}),r.jsx(Ke.default,{sx:Object.assign(Object.assign({},l),{height:"calc(100vh - 56px)",overflow:"scroll"}),children:r.jsx(n.Suspense,{fallback:r.jsx(st,{}),children:null!=e?e:r.jsx(V.Outlet,{})})})]}),exports.ControlAceEditor=vt,exports.ControlArrayInput=ll,exports.ControlAutocomplete=gt,exports.ControlCheckbox=ht,exports.ControlDate=Qt,exports.ControlDateTime=rl,exports.ControlDebouncedInput=e=>{var l,{control:a,validate:i,name:s="",label:d="",required:u=!1,defaultValue:c="",disabled:p=!1,textarea:m=!1,hideErrorMessage:f=!1,onChange:x,requiredErrorText:h=""}=e,y=t.__rest(e,["control","validate","name","label","required","defaultValue","disabled","textarea","hideErrorMessage","onChange","requiredErrorText"]);const{field:{ref:g,onChange:b},fieldState:{error:C}}=o.useController({name:s,control:a,defaultValue:c,rules:{required:!!u&&(h||dt),validate:i}}),v=o.useWatch({control:a,name:s}),[j,T]=n.useState("");n.useEffect((()=>{!j&&v&&T(v)}),[j,v]);const E=pt((e=>{b(e)}),200),P=n.useCallback((e=>{T(e.target.value),E(e.target.value)}),[E]);return r.jsx(Ae.default,Object.assign({fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:g,name:s,label:u?r.jsxs(r.Fragment,{children:[d," ",r.jsx("span",{children:"*"})]}):d,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!C,helperText:!f&&(null==C?void 0:C.message),FormHelperTextProps:{variant:"standard"},disabled:p,multiline:m,minRows:m?3:1,value:null!=j?j:"",onChange:P},y,{inputProps:Object.assign(Object.assign({},null!==(l=null==y?void 0:y.inputProps)&&void 0!==l?l:{}),{value:null!=j?j:""})}))},exports.ControlInput=ct,exports.ControlNumberInput=Zt,exports.ControlPeriodInput=({name:e="period",control:t,label:l="Period",required:a,isSecondsVisible:i=!1})=>{var s;const[d,u]=n.useState(),{setValue:c,register:p,formState:{errors:m}}=o.useFormContext(),f=o.useWatch({control:t,name:e}),x=n.useCallback((r=>{const{name:t,value:l}=r.target,a=Object.assign({},null!=d?d:{});l?(a[t]=+l,c(e,z.toString(a),{shouldValidate:!0})):(delete a[t],c(e,"",{shouldValidate:!0})),u(a)}),[c,e,d]),h=null===(s=m[e])||void 0===s?void 0:s.message;return n.useEffect((()=>{f&&!d&&u(z.parse(f))}),[d,f]),r.jsxs(r.Fragment,{children:[r.jsx("input",Object.assign({type:"hidden"},p(e,{required:a&&"Please, fill one of the fields"}))),r.jsx(Xe.default,{variant:"subtitle1",children:a?r.jsxs(r.Fragment,{children:[l," ",r.jsx(Ke.default,{component:"span",color:"#D6331F",children:"*"})]}):l}),h&&r.jsx(tr.default,{error:!0,children:h}),r.jsxs(fr.default,{container:!0,columns:2,spacing:2,flexWrap:"wrap",children:[r.jsx(fr.default,{sm:1,children:r.jsx(Ae.default,{variant:"outlined",size:"small",value:(null==d?void 0:d.years)||"",error:!!h,name:"years",label:"Years",type:"number",onChange:x,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})}),r.jsx(fr.default,{sm:1,children:r.jsx(Ae.default,{variant:"outlined",size:"small",error:!!h,value:(null==d?void 0:d.months)||"",name:"months",label:"Months",type:"number",onChange:x,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})}),r.jsx(fr.default,{sm:1,children:r.jsx(Ae.default,{variant:"outlined",size:"small",error:!!h,value:(null==d?void 0:d.weeks)||"",name:"weeks",label:"Weeks",type:"number",onChange:x,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})}),r.jsx(fr.default,{sm:1,children:r.jsx(Ae.default,{variant:"outlined",size:"small",error:!!h,value:(null==d?void 0:d.days)||"",name:"days",label:"Days",type:"number",onChange:x,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})}),r.jsx(fr.default,{sm:1,children:r.jsx(Ae.default,{variant:"outlined",size:"small",error:!!h,value:(null==d?void 0:d.hours)||"",name:"hours",label:"Hours",type:"number",onChange:x,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})}),r.jsx(fr.default,{sm:1,children:r.jsx(Ae.default,{variant:"outlined",size:"small",error:!!h,value:(null==d?void 0:d.minutes)||"",name:"minutes",label:"Minutes",type:"number",onChange:x,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})}),i&&r.jsx(fr.default,{sm:1,children:r.jsx(Ae.default,{variant:"outlined",size:"small",error:!!h,value:(null==d?void 0:d.seconds)||"",name:"seconds",label:"Seconds",type:"number",onChange:x,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})})]})]})},exports.ControlPhoneInput=e=>{var{control:l,name:a,label:n,required:i,mask:s="+7 (799) 999 99 99",requiredErrorText:d="",inputMaskProps:u,disabled:c,invalidErrorText:p}=e,m=t.__rest(e,["control","name","label","required","mask","requiredErrorText","inputMaskProps","disabled","invalidErrorText"]);return r.jsx(o.Controller,{control:l,name:a,rules:{required:!!i&&(d||dt),validate:e=>!i&&!e||(!!/(\+7\s\(\d{3}\)\s)(\d{3}\s\d{2})(\s\d{2})/.test(e)||(p||"Incorrect phone number format"))},render:({field:e,fieldState:{error:t}})=>r.jsx(xr.default,Object.assign({disabled:c,mask:s,value:e.value,onChange:e.onChange,onBlur:e.onBlur},u,{children:r.jsx(Ae.default,Object.assign({fullWidth:!0,size:"small",label:i&&n?r.jsxs(r.Fragment,{children:[n," ",r.jsx("span",{children:"*"})]}):n,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},inputMode:"numeric",InputProps:{startAdornment:r.jsx(He.default,{position:"start",children:r.jsx("img",{src:"data:image/svg+xml,%3csvg width='32' height='24' viewBox='0 0 32 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg clip-path='url(%23clip0_6762_5474)'%3e%3crect width='32' height='24' rx='2' fill='white'/%3e%3cmask id='mask0_6762_5474' style='mask-type:luminance' maskUnits='userSpaceOnUse' x='0' y='0' width='32' height='24'%3e%3crect width='32' height='24' rx='2' fill='white'/%3e%3c/mask%3e%3cg mask='url(%23mask0_6762_5474)'%3e%3crect width='32' height='24' fill='%2330C6E0'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M16.0001 16.8002C18.5249 16.8002 20.5716 14.6512 20.5716 12.0002C20.5716 9.34923 18.5249 7.2002 16.0001 7.2002C13.4754 7.2002 11.4287 9.34923 11.4287 12.0002C11.4287 14.6512 13.4754 16.8002 16.0001 16.8002Z' fill='%23FFCD4B'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M14.1352 20.5791L16.0001 17.6561L17.865 20.5791L18.3374 17.096L21.2255 18.8799L20.2118 15.5264L23.5511 15.818L21.252 13.2584L24.381 11.9998L21.252 10.7411L23.5511 8.1816L20.2118 8.47311L21.2255 5.11966L18.3374 6.90359L17.865 3.42041L16.0001 6.34344L14.1352 3.42041L13.6628 6.90359L10.7747 5.11966L11.7884 8.47311L8.44912 8.1816L10.7482 10.7411L7.61914 11.9998L10.7482 13.2584L8.44912 15.818L11.7884 15.5264L10.7747 18.8799L13.6628 17.096L14.1352 20.5791ZM21.3334 11.9998C21.3334 15.0926 18.9456 17.5998 16.0001 17.5998C13.0546 17.5998 10.6668 15.0926 10.6668 11.9998C10.6668 8.90698 13.0546 6.39978 16.0001 6.39978C18.9456 6.39978 21.3334 8.90698 21.3334 11.9998Z' fill='%23FFCD4B'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M1.52393 1.93343C1.52393 1.74934 1.67316 1.6001 1.85726 1.6001H2.7144C2.8985 1.6001 3.04774 1.74934 3.04774 1.93343V2.86676C3.04774 3.05086 2.8985 3.2001 2.7144 3.2001H1.85726C1.67316 3.2001 1.52393 3.05086 1.52393 2.86676V1.93343ZM1.52393 5.13343C1.52393 4.94934 1.67316 4.8001 1.85726 4.8001H2.7144C2.8985 4.8001 3.04774 4.94934 3.04774 5.13343V6.06676C3.04774 6.25086 2.8985 6.4001 2.7144 6.4001H1.85726C1.67316 6.4001 1.52393 6.25086 1.52393 6.06676V5.13343ZM1.85726 8.0001C1.67316 8.0001 1.52393 8.14934 1.52393 8.33343V9.26676C1.52393 9.45086 1.67316 9.6001 1.85726 9.6001H2.7144C2.8985 9.6001 3.04774 9.45086 3.04774 9.26676V8.33343C3.04774 8.14934 2.8985 8.0001 2.7144 8.0001H1.85726ZM1.52393 11.5334C1.52393 11.3493 1.67316 11.2001 1.85726 11.2001H2.7144C2.8985 11.2001 3.04774 11.3493 3.04774 11.5334V12.4668C3.04774 12.6509 2.8985 12.8001 2.7144 12.8001H1.85726C1.67316 12.8001 1.52393 12.6509 1.52393 12.4668V11.5334ZM1.85726 14.4001C1.67316 14.4001 1.52393 14.5493 1.52393 14.7334V15.6668C1.52393 15.8509 1.67316 16.0001 1.85726 16.0001H2.7144C2.8985 16.0001 3.04774 15.8509 3.04774 15.6668V14.7334C3.04774 14.5493 2.8985 14.4001 2.7144 14.4001H1.85726ZM1.52393 17.9334C1.52393 17.7493 1.67316 17.6001 1.85726 17.6001H2.7144C2.8985 17.6001 3.04774 17.7493 3.04774 17.9334V18.8668C3.04774 19.0509 2.8985 19.2001 2.7144 19.2001H1.85726C1.67316 19.2001 1.52393 19.0509 1.52393 18.8668V17.9334ZM1.85726 20.8001C1.67316 20.8001 1.52393 20.9493 1.52393 21.1334V22.0668C1.52393 22.2509 1.67316 22.4001 1.85726 22.4001H2.7144C2.8985 22.4001 3.04774 22.2509 3.04774 22.0668V21.1334C3.04774 20.9493 2.8985 20.8001 2.7144 20.8001H1.85726ZM3.04774 19.5334C3.04774 19.3493 3.19697 19.2001 3.38107 19.2001H4.23821C4.42231 19.2001 4.57154 19.3493 4.57154 19.5334V20.4668C4.57154 20.6509 4.42231 20.8001 4.23821 20.8001H3.38107C3.19697 20.8001 3.04774 20.6509 3.04774 20.4668V19.5334ZM3.38107 16.0001C3.19697 16.0001 3.04774 16.1493 3.04774 16.3334V17.2668C3.04774 17.4509 3.19697 17.6001 3.38107 17.6001H4.23821C4.42231 17.6001 4.57154 17.4509 4.57154 17.2668V16.3334C4.57154 16.1493 4.42231 16.0001 4.23821 16.0001H3.38107ZM3.04774 13.1334C3.04774 12.9493 3.19697 12.8001 3.38107 12.8001H4.23821C4.42231 12.8001 4.57154 12.9493 4.57154 13.1334V14.0668C4.57154 14.2509 4.42231 14.4001 4.23821 14.4001H3.38107C3.19697 14.4001 3.04774 14.2509 3.04774 14.0668V13.1334ZM3.38107 9.6001C3.19697 9.6001 3.04774 9.74934 3.04774 9.93343V10.8668C3.04774 11.0509 3.19697 11.2001 3.38107 11.2001H4.23821C4.42231 11.2001 4.57154 11.0509 4.57154 10.8668V9.93343C4.57154 9.74934 4.42231 9.6001 4.23821 9.6001H3.38107ZM3.04774 6.73343C3.04774 6.54934 3.19697 6.4001 3.38107 6.4001H4.23821C4.42231 6.4001 4.57154 6.54934 4.57154 6.73343V7.66676C4.57154 7.85086 4.42231 8.0001 4.23821 8.0001H3.38107C3.19697 8.0001 3.04774 7.85086 3.04774 7.66676V6.73343ZM3.38107 3.2001C3.19697 3.2001 3.04774 3.34934 3.04774 3.53343V4.46676C3.04774 4.65086 3.19697 4.8001 3.38107 4.8001H4.23821C4.42231 4.8001 4.57154 4.65086 4.57154 4.46676V3.53343C4.57154 3.34934 4.42231 3.2001 4.23821 3.2001H3.38107Z' fill='%23FFCD4B'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath id='clip0_6762_5474'%3e%3crect width='32' height='24' rx='4' fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",alt:""})})}},m,{error:!!t,FormHelperTextProps:{variant:"standard"},helperText:null==t?void 0:t.message}))}))})},exports.ControlQueryAutocomplete=function(e){var{name:l,label:a,control:i,required:s=!1,searchBy:d,labelKey:u,multiple:c=!1,mongoQueryJson:p,disabled:m,valueKey:f,sortBy:x="",hideErrorMessage:h,disableCloseOnSelect:y,textFieldProps:g,onChange:b,queryFunction:C,validate:v,itemQueryFunction:j,requiredErrorText:T="",startAdornment:E,endAdornment:P}=e,S=t.__rest(e,["name","label","control","required","searchBy","labelKey","multiple","mongoQueryJson","disabled","valueKey","sortBy","hideErrorMessage","disableCloseOnSelect","textFieldProps","onChange","queryFunction","validate","itemQueryFunction","requiredErrorText","startAdornment","endAdornment"]);const O=o.useController({control:i,name:l,defaultValue:c?[]:null,rules:{required:!!s&&(T||dt),validate:v}}),w=O.field,{ref:M,onChange:V,value:R}=w,F=t.__rest(w,["ref","onChange","value"]),{fieldState:{error:L,isDirty:N}}=O,{getOptionLabel:D,isOptionEqualToValue:I,renderOption:q}=yt({valueKey:f,labelKey:u}),[A,_]=n.useState([]),[$,z]=n.useState(!1),[B,H]=n.useState(""),[W,J]=n.useState(""),[G,Y]=n.useState(0),Z=n.useMemo((()=>!!A.length&&$),[$,A]),{data:U,isFetching:K}=k.useQuery(["options",G,W],(()=>{const e=dr.default.parse(Object.assign({page:`${G}`,size:"20",sort:x},W?{[d]:W}:{}),{ignoreQueryPrefix:!0});return C(e)}),{onSuccess(e){_(W?e.collection:r=>1===r.length?e.collection:[...r,...e.collection])}}),X=(e,r)=>{if("object"==typeof e){if(Array.isArray(e))return e.map((e=>X(e,r)));{const t={};for(const l in e)t[l]=X(e[l],r);return t}}return"string"==typeof e&&e.includes("${variable}")?e.replace("${variable}",r):e},Q=pt((e=>{if(Y(0),p){const r=X(p,e);J(JSON.stringify(r))}else J(e)}),500),ee=n.useCallback(((e,r)=>{_([]),H(r),Q(r)}),[Q]),re=n.useCallback(((e,r)=>{V(r),b&&b(e,r)}),[V,b]);n.useEffect((()=>{if(!N&&R&&j){let e=R;"object"==typeof R&&f in R&&(e=sr.default(R,f)),j(e).then((e=>{V(e),H(sr.default(e,u))})).catch(console.error)}}),[R,N,f,u,j,V]);const te=n.useCallback((e=>{const r=e.currentTarget;r.scrollHeight-r.scrollTop-r.clientHeight<=1&&A.length<(null==U?void 0:U.totalItems)&&Y((e=>e+1))}),[U,A]);return r.jsx(ir.default,Object.assign({},F,{fullWidth:!0,disablePortal:!0,size:"small",readOnly:m,options:A,multiple:c,getOptionLabel:D,isOptionEqualToValue:I,disableCloseOnSelect:y||c,filterSelectedOptions:c,inputValue:B,value:R,onChange:re,loading:K,clearOnBlur:!1,open:Z,filterOptions:e=>e,onOpen:()=>{z(!0)},onClose:()=>{z(!1),J("")},onInputChange:ee,ListboxProps:{onScroll:te},renderOption:q,popupIcon:r.jsx(bt,{}),renderInput:e=>r.jsx(Ae.default,Object.assign({},e,{label:s?r.jsxs(r.Fragment,{children:[a," ",r.jsx("span",{children:"*"})]}):a,InputLabelProps:{shrink:!!(null==S?void 0:S.placeholder)},placeholder:null==S?void 0:S.placeholder,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},variant:"outlined",error:!!L,inputRef:M,helperText:!h&&(null==L?void 0:L.message),FormHelperTextProps:{variant:"standard"},InputProps:Object.assign(Object.assign({},e.InputProps),{endAdornment:P||r.jsxs($e.default.Fragment,{children:[K?r.jsx(He.default,{position:"end",children:r.jsx(Qe.default,{color:"inherit",size:20})}):null,e.InputProps.endAdornment]}),startAdornment:E||e.InputProps.startAdornment})},g))},S))},exports.ControlRadio=({name:e,label:l,values:a=[],control:i,required:s,defaultValue:d,disabled:u,hideErrorMessage:c,labelKey:p,valueKey:m,validate:f,onChange:x,row:h,radioProps:y,requiredErrorText:g=""})=>{const b=o.useController({name:e,control:i,defaultValue:d,rules:{required:!!s&&(g||dt),validate:f}}),C=b.field,{onChange:v}=C,j=t.__rest(C,["onChange"]),{fieldState:{error:T}}=b,E=n.useCallback((e=>"string"==typeof e?e:m?e[m]:e.value),[m]),P=n.useCallback((e=>"string"==typeof e?e:p?e[p]:e.label),[p]),S=n.useCallback((e=>"string"==typeof e?e===j.value:e===("string"==typeof j.value?"true"===j.value:j.value)),[j.value]),O=n.useCallback((e=>{"true"===e.target.value||"false"===e.target.value?v("true"===e.target.value):v(e)}),[v]);return r.jsxs(er.default,{disabled:u,error:!!T,children:[r.jsx(or.default,{id:"radio-buttons-group",children:l}),r.jsx(nr.default,Object.assign({},j,{row:h,"aria-labelledby":"radio-buttons-group",onChange:x||O,children:a.map(((e,t)=>r.jsx(rr.default,{value:E(e),control:r.jsx(ar.default,Object.assign({},y,{checked:S(E(e))})),label:P(e)},t)))})),!c&&(null==T?void 0:T.message)&&r.jsx(tr.default,{variant:"standard",children:T.message})]})},exports.ControlSelect=xt,exports.ControlSwitch=Ut,exports.ControlTime=tl,exports.CopyButton=Ct,exports.CreateDefinition=ma,exports.CreatePropertiesList=ua,exports.CreatePropertiesListContext=pa,exports.CreatePropertyFormFields=ia,exports.DATE_DEFAULT_FORMAT=at,exports.DATE_TIME_DEFAULT_FORMAT=ot,exports.DEFAULT_DATE_VALIDATION_ERROR_TEXT=ut,exports.DEFAULT_ERROR_TEXT=Yt,exports.DEFAULT_REQUIRED_ERROR_TEXT=dt,exports.DefinitionFiller=Ea,exports.DefinitionValueView=ka,exports.InfoItem=({title:e,text:t,json:l})=>r.jsxs(Ke.default,{sx:{paddingBottom:8},children:[r.jsx(Ke.default,{sx:{fontSize:"14px",fontWeight:600,color:"#536DFE"},children:e}),t&&r.jsx(Ke.default,{sx:{fontSize:"18px",wordWrap:"break-word"},children:t}),l&&r.jsx(St,{value:l,height:300})]}),exports.JsonModalView=Ot,exports.JsonPathPicker=({open:e=!1,onClose:t,onPaste:l,properties:a})=>{const[o,i]=n.useState("");return r.jsxs(Je.default,{open:e,onClose:t,fullWidth:!0,maxWidth:"md",children:[r.jsx(Ue.default,{children:"JSON path picker"}),r.jsxs(Ye.default,{children:[(null==a?void 0:a.length)?a.map(((e,t)=>r.jsxs("div",{children:[r.jsx(Xe.default,{variant:"h6",children:e.title}),r.jsx(Ra,{properties:e.properties,prefix:e.pathPrefix,onClick:i,activePath:o})]},t))):r.jsx(Xe.default,{children:"Please, add properties"}),o&&r.jsxs(Xe.default,{variant:"h6",gutterBottom:!0,children:["Selected path : $(",o,")"]})]}),r.jsxs(Ge.default,{children:[r.jsx(We.default,{variant:"contained",color:"primary",onClick:()=>{navigator.clipboard.writeText(`$(${o})`),Te.toast.success("Copied!")},children:"Copy"}),r.jsx(We.default,{variant:"contained",color:"primary",onClick:()=>{l(`$(${o})`),Te.toast.success("Pasted!")},children:"Paste"}),r.jsx(We.default,{variant:"contained",color:"secondary",onClick:t,children:"Close"})]})]})},exports.JsonView=St,exports.Loader=st,exports.MenuIcon=({src:e,alt:t})=>r.jsx(Ke.default,{sx:{width:20,height:20,display:"flex",justifyContent:"center",alignItems:"center"},children:r.jsx("img",{src:e,alt:t})}),exports.MultiplePropertyFiller=Ta,exports.OverflowTip=rn,exports.PopupIconComponent=ft,exports.PropertyFiller=va,exports.PropertyValueField=Jl,exports.RouteTabs=e=>{var t;const{tabs:l}=e,a=V.useNavigate(),o=V.useLocation(),i=n.useMemo((()=>new URLSearchParams(o.search)),[o.search]),s=i.get("tab");return r.jsxs(Ke.default,{children:[r.jsx(wr.default,{children:r.jsx(Vr.default,{value:s||(null===(t=l[0])||void 0===t?void 0:t.name),indicatorColor:"primary",textColor:"primary",onChange:(e,r)=>{i.set("tab",r),a({pathname:o.pathname,search:i.toString()},{replace:!0})},children:l.map((e=>r.jsx(Mr.default,{value:e.name,label:e.label},e.name)))})}),r.jsx(Ke.default,{mt:2,children:l.map((e=>{var t;return r.jsx(Sl,{value:s||(null===(t=l[0])||void 0===t?void 0:t.name),index:e.name,children:e.component},e.name)}))})]})},exports.Sidebar=({routes:t,theme:l=Nt,title:a="",id:n,logo:o,collapsedLogo:i,footer:s,collapsedFooter:d})=>r.jsxs(e.ThemeProvider,{theme:l,children:[r.jsx(Wr.default,{}),r.jsx(Na,{children:r.jsx(Qa,{title:a,routes:t,id:n,logo:o,collapsedLogo:i,footer:s,collapsedFooter:d})})]}),exports.SimpleTable=Pl,exports.Status=Ma,exports.StepperView=Vl,exports.TIME_DEFAULT_FORMAT=nt,exports.TabPanel=Sl,exports.Table=e=>{var{columns:l,rows:a,rowCount:n,loading:o,disableMargin:i,mode:s="server",initialPageSize:d=10,pagination:u=!0,onCellClick:c}=e,p=t.__rest(e,["columns","rows","rowCount","loading","disableMargin","mode","initialPageSize","pagination","onCellClick"]);const{page:m,size:f,onPageChange:x,onSizeChange:h}=sl({mode:s}),{onColumnHeaderClick:y,getSortedColumns:g}=dl(),{pageSize:b,handlePageSizeChange:C}=ul(d),v={sortingMode:s,paginationMode:s,pageSize:"server"===s?f:u?b:n,onPageSizeChange:"server"===s?h:C,components:{BaseTooltip:ur.default,Pagination:ol,ColumnUnsortedIcon:e=>(t.__rest(e,["sortingOrder"]),r.jsx(fl,{})),ColumnSortedDescendingIcon:e=>(t.__rest(e,["sortingOrder"]),r.jsx(hl,{})),ColumnSortedAscendingIcon:e=>(t.__rest(e,["sortingOrder"]),r.jsx(xl,{}))}};return"server"===s&&(v.onColumnHeaderClick=y,v.page=m,v.onPageChange=x,v.components.ColumnMenu=il),r.jsx(Ke.default,{mt:i?0:2,children:r.jsx(J.DataGrid,Object.assign({autoHeight:!0,hideFooterPagination:!u,hideFooter:!u,disableSelectionOnClick:!0,loading:o,rows:a,disableColumnMenu:!0,columns:g(l),rowCount:n,rowsPerPageOptions:[10,20,50,100],onCellClick:c},v,p))})},exports.TableAction=({icon:e,label:t,showInMenu:l,onClick:a,location:n})=>{var o;return n?r.jsx(Be.default,{component:V.Link,to:n.pathname,state:null!==(o=n.state)&&void 0!==o?o:null,size:"small",children:r.jsx(ur.default,{title:t,arrow:!0,children:$e.default.cloneElement(e,{fontSize:"small"})})}):r.jsx(J.GridActionsCellItem,{nonce:"",onResize:void 0,onResizeCapture:void 0,icon:r.jsx(ur.default,{title:t,arrow:!0,children:e}),onClick:a,label:t,showInMenu:l})},exports.TableActionCell=({actionsList:e})=>{const[t,l]=n.useState(null),a=Boolean(t),o=()=>{l(null)};return r.jsxs("div",{children:[r.jsx(Be.default,{"aria-label":"more",id:"more-button","aria-controls":a?"more-menu":void 0,"aria-expanded":a?"true":void 0,"aria-haspopup":"true",onClick:e=>{e.stopPropagation(),l(e.currentTarget)},children:r.jsx(kr.default,{})}),r.jsx(Or.default,{id:"more-menu",MenuListProps:{"aria-labelledby":"more-button"},anchorEl:t,open:a,onClose:e=>{e.stopPropagation(),o()},PaperProps:{style:{minWidth:"127px"}},children:e.map((e=>r.jsx(_e.default,{onClick:r=>{r.stopPropagation(),e.onClick&&e.onClick(),o()},children:e.title},e.title)))})]})},exports.ViewPropertiesList=({properties:e,expandAll:t=!0})=>{const l=n.useMemo((()=>Array.isArray(e)?e:e?Ht(e):[]),[e]);return r.jsx(Ke.default,{display:"flex",flexDirection:"column",children:l.length?l.map((e=>r.jsx(Ca,{property:e,defaultExpanded:t},e.key))):r.jsx(Xe.default,{children:"No properties"})})},exports.ViewProperty=Ca,exports.capitalize=function(e){return e.replace(/(^\w)|([-\s]\w)/g,(e=>e.toUpperCase()))},exports.deepParseJson=Pt,exports.defaultDefinitionArrayValue={code:"",name:"",version:0,properties:[]},exports.defaultDefinitionObjectValue={code:"",name:"",version:0,properties:{}},exports.digitsOnly=Dt,exports.floatsOnly=It,exports.formatDefinitionData=zt,exports.formatTableRowValue=({value:e,canCopy:t,copyValue:l,shortId:a,fullText:n=!1,textParams:o})=>{const{displayAs:i="text",tooltipLinkComponent:s=null,dateFormat:d=null,statusVariant:u=null}=o||{};switch(i){case"boolean":return e?r.jsx(ze.default,{color:"primary",fontSize:"small",children:r.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}):r.jsx(ze.default,{fontSize:"small",children:r.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z"})});case"date":return e?d?r.jsx(rn,{children:d.map(((t,l)=>r.jsx(Ke.default,{children:I.format(new Date(e),t)},l)))}):r.jsxs(rn,{children:[r.jsx(Ke.default,{children:I.format(new Date(e),"dd.MM.yyyy")}),r.jsx(Ke.default,{children:I.format(new Date(e),"HH:mm:ss")})]}):"";case"status":return r.jsx(rn,{children:r.jsx(Ma,{text:e,status:u||"default"})});case"json_text":return r.jsx(kt,{value:e,textField:!0});case"json_code":return r.jsx(kt,{value:e,copyButton:!0});case"array":return r.jsx(Ke.default,{children:null==e?void 0:e.map(((e,t)=>r.jsx(Ke.default,{children:e},t)))});case"collapsed_array":return e&&r.jsx(Ke.default,{children:r.jsx(ur.default,{arrow:!0,title:s||e.map(((e,t)=>r.jsx(Ke.default,{fontSize:14,style:{paddingTop:Nt.spacing(1)},children:e},t))),children:r.jsx(Ke.default,{children:e.length>1?`${e[0]} (+${e.length-1})`:e[0]})})});case"number":return r.jsx(Ke.default,{display:"flex",justifyContent:"flex-end",children:r.jsx(rn,{children:e.toLocaleString("ru-Ru",{minimumFractionDigits:2})})});default:return e?r.jsxs(Ke.default,{display:"flex",alignItems:"center",width:"100%",children:[a?r.jsx(rn,{children:e?`${e.slice(0,6)}...${e.slice(-6)}`:"..."}):n?r.jsx(Ke.default,{sx:{whiteSpace:"normal"},children:"string"==typeof e?e:JSON.stringify(e)}):r.jsx(rn,{children:"string"==typeof e?e:JSON.stringify(e)}),t&&r.jsx(Ct,{copyText:l?"string"==typeof l?l:JSON.stringify(l):e})]}):""}},exports.getDemPropertyDateFormat=(e,r)=>{if(r)try{const e=r.replace(/Z/g,"XXX");return I.format(new Date,e),e}catch(r){return console.error("Incorrect format",r),e}return e},exports.getEntityStarterValue=Wt,exports.getJsonStringValue=Et,exports.getMultiplePropertyFillOptions=Jt,exports.getSinglePropertyFillOptions=Gt,exports.isDateType=e=>e===exports.PropertyType.DATE||e===exports.PropertyType.DATE_TIME||e===exports.PropertyType.TIME,exports.isExpression=qt,exports.isPropertyValueEmpty=_t,exports.numberFormat=At,exports.propertiesArrayToObject=Bt,exports.propertiesObjectToArray=Ht,exports.removeArrayItem=jt,exports.safeParseJson=e=>{try{return JSON.parse(e)}catch(e){return null}},exports.sortArrayOfObjects=Tt,exports.theme=Nt,exports.useDebounce=pt,exports.useToggle=mt,exports.validateJson=e=>{try{JSON.parse(e)}catch(e){return!1}return!0};
|
package/index.esm.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import{createTheme as e,responsiveFontSizes as r,styled as t,ThemeProvider as n}from"@mui/material/styles";import{jsx as l,jsxs as i,Fragment as o}from"react/jsx-runtime";import{__rest as a,__awaiter as s}from"tslib";import d from"@mui/material/TextField";import c from"@mui/material/MenuItem";import u,{useRef as p,useEffect as m,useState as h,useCallback as f,useMemo as g,createElement as v,forwardRef as y,createContext as b,useContext as C,memo as x,useImperativeHandle as E,Suspense as O}from"react";import{useController as T,useWatch as S,useFormContext as w,Controller as V,useFieldArray as L,useForm as k}from"react-hook-form";import R from"@mui/material/SvgIcon";import M from"@mui/material/IconButton";import N from"@mui/material/InputAdornment";import I from"@mui/material/Button";import F from"@mui/material/Dialog";import D from"@mui/material/DialogActions";import P from"@mui/material/DialogContent";import A from"@mui/material/DialogContentText";import q from"@mui/material/DialogTitle";import $ from"@mui/material/Box";import z from"@mui/material/Typography";import j from"@mui/material/CircularProgress";import B from"@mui/material/FormControl";import H from"@mui/material/FormControlLabel";import _ from"@mui/material/FormHelperText";import W from"@mui/material/Checkbox";import J from"@mui/material/Radio";import G from"@mui/material/RadioGroup";import Y from"@mui/material/FormLabel";import Z from"@mui/material/Autocomplete";import K from"lodash/get";import{useQuery as U}from"@tanstack/react-query";import X from"qs";import Q from"@mui/material/Tooltip";import{useNavigate as ee,useLocation as re,Link as te,useSearchParams as ne,Outlet as le}from"react-router-dom";import ie from"@uiw/react-codemirror";import{langs as oe}from"@uiw/codemirror-extensions-langs";import{abcdef as ae}from"@uiw/codemirror-theme-abcdef";import se from"@mui/material/Switch";import{DatePicker as de}from"@mui/x-date-pickers/DatePicker";import{format as ce,parse as ue,isValid as pe,isMatch as me}from"date-fns";import{DateTimePicker as he}from"@mui/x-date-pickers/DateTimePicker";import{TimePicker as fe}from"@mui/x-date-pickers/TimePicker";import ge from"@mui/material/Chip";import ve from"@mui/material/Unstable_Grid2";import{toString as ye,parse as be}from"duration-fns";import Ce from"react-input-mask";import xe from"@mui/material/Pagination";import Ee from"@mui/material/TablePagination";import{useGridApiContext as Oe,useGridSelector as Te,gridPageSelector as Se,gridPageCountSelector as we,gridRowCountSelector as Ve,gridPageSizeSelector as Le,GridColumnMenuContainer as ke,GridFilterMenuItem as Re,DataGrid as Me,GridActionsCellItem as Ne}from"@mui/x-data-grid";import Ie from"@mui/material/Table";import Fe from"@mui/material/TableBody";import De from"@mui/material/TableCell";import Pe from"@mui/material/TableContainer";import Ae from"@mui/material/TableHead";import qe from"@mui/material/TableRow";import $e from"@mui/material/TableFooter";import ze from"@mui/material/Backdrop";import je from"@mui/material/TableSortLabel";import Be from"@mui/material/Menu";import He from"@mui/icons-material/MoreHoriz";import _e from"@mui/material/Paper";import We from"@mui/material/Tab";import Je from"@mui/material/Tabs";import Ge from"@mui/material/Accordion";import Ye from"@mui/material/AccordionSummary";import Ze from"@mui/material/AccordionDetails";import Ke from"@mui/material/AccordionActions";import{ExpandMore as Ue}from"@mui/icons-material";import Xe from"@mui/icons-material/Delete";import Qe from"@mui/material/Stepper";import er from"@mui/material/Step";import rr from"@mui/material/StepLabel";import tr from"@mui/material/StepContent";import nr from"@mui/material/StepConnector";import{AdapterDateFns as lr}from"@mui/x-date-pickers/AdapterDateFns";import{LocalizationProvider as ir}from"@mui/x-date-pickers/LocalizationProvider";import or from"@mui/material/Select";import ar from"@mui/material/InputLabel";import sr from"classnames";import{toast as dr}from"react-toastify";import cr from"@mui/material/CssBaseline";import ur from"@mui/material/Drawer";import pr from"@mui/material/List";import mr from"@mui/material/ListItem";import hr from"@mui/material/ListItemIcon";import fr from"@mui/material/ListItemButton";import gr from"@mui/material/ListSubheader";import vr from"@mui/material/ListItemText";import yr from"@mui/material/Toolbar";import br from"@mui/material/ButtonBase";import Cr from"@mui/material/Collapse";import xr from"@mui/material/Breadcrumbs";import Er from"@mui/icons-material/NavigateNext";var Or;!function(e){e.STRING="STRING",e.INTEGER="INTEGER",e.BIG_INTEGER="BIG_INTEGER",e.BIG_DECIMAL="BIG_DECIMAL",e.FLOAT="FLOAT",e.LONG="LONG",e.DOUBLE="DOUBLE",e.BOOLEAN="BOOLEAN",e.ENTITY_REFERENCE="ENTITY_REFERENCE",e.ENTITY="ENTITY",e.FILE="FILE",e.FILE_REFERENCE="FILE_REFERENCE",e.JSON="JSON",e.DATE="DATE",e.TIME="TIME",e.DATE_TIME="DATE_TIME",e.ANY="ANY"}(Or||(Or={}));const Tr="yyyy-MM-dd",Sr="HH:mm:ss",wr="yyyy-MM-dd'T'HH:mm:ss.SSSZ";var Vr;!function(e){e.UP="UP",e.DOWN="DOWN",e.CEILING="CEILING",e.FLOOR="FLOOR",e.HALF_UP="HALF_UP",e.HALF_DOWN="HALF_DOWN",e.HALF_EVEN="HALF_EVEN",e.UNNECESSARY="UNNECESSARY"}(Vr||(Vr={}));const Lr=({transparent:e,position:r,bgcolor:t})=>l($,{position:null!=r?r:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:t||(e?"none":"rgba(255, 255, 255, .3)"),zIndex:10,children:l(j,{})}),kr=({open:e,title:r,description:t,closeButtonTitle:n="Close",onClose:o,confirmButtonTitle:a="Confirm",confirmButtonDisabled:s=!1,disableBackdropClick:d=!1,onConfirm:c,children:u,dialogProps:p,loading:m,maxWidth:h="xs",hideCloseButton:f=!1})=>l("div",{children:i(F,Object.assign({open:e,onClose:d?(e,r)=>{if("backdropClick"===r)return null;o()}:o,disableEscapeKeyDown:d,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",fullWidth:!0,maxWidth:h},p,{children:[m&&l(Lr,{}),i(q,{id:"alert-dialog-title",sx:{display:"flex",justifyContent:"space-between"},children:[l(z,{variant:"inherit",children:r}),!f&&l(M,{sx:{padding:0},onClick:o,children:l(R,{children:l("g",{opacity:"0.6",children:l("path",{d:"M4.39704 4.554L4.47004 4.47C4.59702 4.34299 4.76538 4.26576 4.94449 4.25236C5.1236 4.23897 5.30157 4.29029 5.44604 4.397L5.53004 4.47L12 10.939L18.47 4.469C18.5393 4.3974 18.622 4.34031 18.7136 4.30104C18.8051 4.26178 18.9035 4.24114 19.0031 4.24032C19.1027 4.2395 19.2014 4.25853 19.2936 4.29628C19.3857 4.33403 19.4694 4.38976 19.5398 4.46022C19.6102 4.53067 19.6659 4.61443 19.7035 4.70662C19.7412 4.79881 19.7601 4.89758 19.7592 4.99716C19.7583 5.09675 19.7376 5.19515 19.6982 5.28664C19.6589 5.37812 19.6017 5.46085 19.53 5.53L13.061 12L19.531 18.47C19.6579 18.5971 19.7349 18.7655 19.7482 18.9446C19.7614 19.1237 19.7099 19.3016 19.603 19.446L19.53 19.53C19.403 19.657 19.2347 19.7343 19.0556 19.7476C18.8765 19.761 18.6985 19.7097 18.554 19.603L18.47 19.53L12 13.061L5.53004 19.531C5.38852 19.6676 5.19903 19.7431 5.00238 19.7413C4.80574 19.7395 4.61766 19.6605 4.47867 19.5214C4.33968 19.3823 4.26089 19.1941 4.25928 18.9975C4.25766 18.8008 4.33335 18.6114 4.47004 18.47L10.939 12L4.46904 5.53C4.34217 5.40289 4.26512 5.23447 4.25191 5.05537C4.2387 4.87626 4.29019 4.69836 4.39704 4.554L4.47004 4.47L4.39704 4.554Z",fill:"black"})})})})]}),i(P,{children:[t&&l(A,{id:"alert-dialog-description",children:t}),l($,{maxWidth:"100%",overflow:"hidden",children:u})]}),i(D,{children:[!f&&l(I,{onClick:o,variant:"outlined",children:n}),a&&c?l(I,{onClick:c,color:"primary",variant:"contained",autoFocus:!0,disabled:s,disableElevation:!0,children:a}):null]})]}))}),Rr={code:"",name:"",version:0,properties:[]},Mr={code:"",name:"",version:0,properties:{}},Nr="Please, fill this field",Ir="Incorrect date format",Fr=e=>{var r,{control:t,validate:n,name:s="",label:c="",required:u=!1,defaultValue:p="",disabled:m=!1,textarea:h=!1,hideErrorMessage:f=!1,onChange:g,requiredErrorText:v=""}=e,y=a(e,["control","validate","name","label","required","defaultValue","disabled","textarea","hideErrorMessage","onChange","requiredErrorText"]);const b=T({name:s,control:t,defaultValue:p,rules:{required:!!u&&(v||Nr),validate:n}}),C=b.field,{ref:x,onChange:E,value:O}=C,S=a(C,["ref","onChange","value"]),{fieldState:{error:w}}=b;return l(d,Object.assign({},S,{fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:x,name:s,label:u?i(o,{children:[c," ",l("span",{children:"*"})]}):c,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!w,helperText:!f&&(null==w?void 0:w.message),FormHelperTextProps:{variant:"standard"},disabled:m,multiline:h,minRows:h?3:1,value:null!=O?O:"",onChange:g||E,InputLabelProps:{shrink:!!y.placeholder},inputProps:Object.assign(Object.assign({},null!==(r=null==y?void 0:y.inputProps)&&void 0!==r?r:{}),{value:null!=O?O:""})},y))};function Dr(e,r){const t=p();m((()=>()=>{t.current&&clearTimeout(t.current)}),[]);return(...n)=>{clearTimeout(t.current),t.current=setTimeout((()=>{e(...n)}),r)}}const Pr=()=>{const[e,r]=h(!1);return{open:e,toggle:()=>{r((e=>!e))},onClose:()=>{r(!1)},onOpen:()=>{r(!0)}}},Ar=e=>{var r,{control:t,validate:n,name:s="",label:c="",required:u=!1,defaultValue:p="",disabled:g=!1,textarea:v=!1,hideErrorMessage:y=!1,onChange:b,requiredErrorText:C=""}=e,x=a(e,["control","validate","name","label","required","defaultValue","disabled","textarea","hideErrorMessage","onChange","requiredErrorText"]);const{field:{ref:E,onChange:O},fieldState:{error:w}}=T({name:s,control:t,defaultValue:p,rules:{required:!!u&&(C||Nr),validate:n}}),V=S({control:t,name:s}),[L,k]=h("");m((()=>{!L&&V&&k(V)}),[L,V]);const R=Dr((e=>{O(e)}),200),M=f((e=>{k(e.target.value),R(e.target.value)}),[R]);return l(d,Object.assign({fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:E,name:s,label:u?i(o,{children:[c," ",l("span",{children:"*"})]}):c,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!w,helperText:!y&&(null==w?void 0:w.message),FormHelperTextProps:{variant:"standard"},disabled:g,multiline:v,minRows:v?3:1,value:null!=L?L:"",onChange:M},x,{inputProps:Object.assign(Object.assign({},null!==(r=null==x?void 0:x.inputProps)&&void 0!==r?r:{}),{value:null!=L?L:""})}))},qr=()=>l(R,{children:l("path",{d:"M4.22032 8.46991C4.36094 8.32946 4.55157 8.25057 4.75032 8.25057C4.94907 8.25057 5.13969 8.32946 5.28032 8.46991L12.0003 15.1899L18.7203 8.46991C18.789 8.39622 18.8718 8.33712 18.9638 8.29613C19.0558 8.25514 19.1551 8.23309 19.2558 8.23132C19.3565 8.22954 19.4565 8.24807 19.5499 8.28579C19.6433 8.32351 19.7281 8.37965 19.7994 8.45087C19.8706 8.52209 19.9267 8.60692 19.9644 8.70031C20.0022 8.7937 20.0207 8.89373 20.0189 8.99443C20.0171 9.09513 19.9951 9.19445 19.9541 9.28645C19.9131 9.37845 19.854 9.46125 19.7803 9.52991L12.5303 16.7799C12.3897 16.9204 12.1991 16.9992 12.0003 16.9992C11.8016 16.9992 11.6109 16.9204 11.4703 16.7799L4.22032 9.52991C4.07987 9.38928 4.00098 9.19866 4.00098 8.99991C4.00098 8.80116 4.07987 8.61054 4.22032 8.46991Z",fill:"#8B8C9E"})}),$r=e=>{var r,{control:t,validate:n,name:s="",label:u="",required:p=!1,defaultValue:m="",disabled:h=!1,hideErrorMessage:g=!1,onChange:v,labelKey:y,valueKey:b,options:C=[],requiredErrorText:x=""}=e,E=a(e,["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange","labelKey","valueKey","options","requiredErrorText"]);const O=T({name:s,control:t,defaultValue:m,rules:{required:!!p&&(x||Nr),validate:n}}),S=O.field,{ref:w,onChange:V,value:L}=S,k=a(S,["ref","onChange","value"]),{fieldState:{error:I}}=O,F=f((e=>"string"==typeof e?e:b?e[b]:e.value),[b]),D=f((e=>"string"==typeof e?e:y?e[y]:e.label),[y]),P=f((()=>{v?v(null):V(null)}),[V,v]);return l(d,Object.assign({},k,{select:!0,fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:w,name:s,label:p?i(o,{children:[u," ",l("span",{children:"*"})]}):u,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!I,helperText:!g&&(null==I?void 0:I.message),FormHelperTextProps:{variant:"standard"},disabled:h,value:null!=L?L:"",onChange:v||V},E,{inputProps:Object.assign(Object.assign({},null!==(r=null==E?void 0:E.inputProps)&&void 0!==r?r:{}),{value:null!=L?L:""}),InputProps:Object.assign({endAdornment:!p&&L?l(N,{position:"end",sx:{mr:0},children:l(M,{onClick:P,size:"small",children:l(R,{fontSize:"small",children:l("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})})})}):null},null==E?void 0:E.InputProps),SelectProps:{sx:{"& .MuiSelect-select .notranslate::after":E.placeholder?{content:`"${E.placeholder}"`,opacity:.42}:{}}},children:C.map(((e,r)=>l(c,{value:F(e),children:D(e)},r)))}))},zr=e=>{var{control:r,validate:t,name:n="",label:o="",required:s=!1,defaultValue:d,disabled:c=!1,hideErrorMessage:u=!1,onChange:p}=e,m=a(e,["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange"]);const h=T({name:n,control:r,defaultValue:null!=d&&d}),f=h.field,{ref:v,onChange:y,value:b}=f,C=a(f,["ref","onChange","value"]),{fieldState:{error:x}}=h,E=g((()=>{if("boolean"==typeof b)return b;if("string"==typeof b){if("false"===b)return y(!1),!1;if("true"===b)return y(!0),!0}return!1}),[b,y]);return i(B,{error:!!x,component:"fieldset",variant:"standard",disabled:c,children:[l(H,{control:l(W,Object.assign({},C,{checked:E,onChange:p||y,name:n,inputRef:v,disabled:c},m)),label:o}),!u&&(null==x?void 0:x.message)&&l(_,{variant:"standard",children:x.message})]})},jr=({name:e,label:r,values:t=[],control:n,required:o,defaultValue:s,disabled:d,hideErrorMessage:c,labelKey:u,valueKey:p,validate:m,onChange:h,row:g,radioProps:v,requiredErrorText:y=""})=>{const b=T({name:e,control:n,defaultValue:s,rules:{required:!!o&&(y||Nr),validate:m}}),C=b.field,{onChange:x}=C,E=a(C,["onChange"]),{fieldState:{error:O}}=b,S=f((e=>"string"==typeof e?e:p?e[p]:e.value),[p]),w=f((e=>"string"==typeof e?e:u?e[u]:e.label),[u]),V=f((e=>"string"==typeof e?e===E.value:e===("string"==typeof E.value?"true"===E.value:E.value)),[E.value]),L=f((e=>{"true"===e.target.value||"false"===e.target.value?x("true"===e.target.value):x(e)}),[x]);return i(B,{disabled:d,error:!!O,children:[l(Y,{id:"radio-buttons-group",children:r}),l(G,Object.assign({},E,{row:g,"aria-labelledby":"radio-buttons-group",onChange:h||L,children:t.map(((e,r)=>l(H,{value:S(e),control:l(J,Object.assign({},v,{checked:V(S(e))})),label:w(e)},r)))})),!c&&(null==O?void 0:O.message)&&l(_,{variant:"standard",children:O.message})]})};var Br=({valueKey:e,labelKey:r})=>{const t=f(((r,t)=>{if(r&&t){if("string"==typeof r)return r===t;if(e)return K(r,e)===K(t,e)||K(r,e)===t;if(r.value)return r.value===t.value||r.value===t}return!1}),[e]),n=f((e=>e?"string"==typeof e?e:r&&K(e,r,"")?K(e,r,"")+"":e.label+""||e.name+""||e.value+""||e.code+""||"--no label--":""),[r]),l=f(((e,r)=>v($,Object.assign({},e,{component:"li",key:e.id}),n(r))),[n]);return{isOptionEqualToValue:t,getOptionLabel:n,renderOption:l}};const Hr=e=>{var{control:r,validate:t,name:n="",label:s="",required:c=!1,defaultValue:u="",disabled:p=!1,hideErrorMessage:f=!1,onChange:g,labelKey:v,valueKey:y,options:b=[],multiple:C,textFieldProps:x={},disableCloseOnSelect:E,useStringValue:O,requiredErrorText:S="",startAdornment:w,endAdornment:V}=e,L=a(e,["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange","labelKey","valueKey","options","multiple","textFieldProps","disableCloseOnSelect","useStringValue","requiredErrorText","startAdornment","endAdornment"]);const k=T({name:n,control:r,defaultValue:u||(C?[]:null),rules:{required:!!c&&(S||Nr),validate:t}}),R=k.field,{ref:M,onChange:N,value:I}=R,F=a(R,["ref","onChange","value"]),{fieldState:{error:D}}=k,[P,A]=h(),{getOptionLabel:q,isOptionEqualToValue:$,renderOption:z}=Br({valueKey:y,labelKey:v});return m((()=>{"string"==typeof I&&y&&O&&void 0===P&&b.length&&b[0]&&"object"==typeof b[0]&&A(b.find((e=>K(e,y)===I)))}),[P,b,O,I,y]),l(Z,Object.assign({},F,{value:O?null!=P?P:null:I,fullWidth:!0,disablePortal:!0,size:"small",readOnly:p,options:b,multiple:C,getOptionLabel:q,isOptionEqualToValue:$,disableCloseOnSelect:E||C,filterSelectedOptions:C,onChange:g||((e,r)=>{N(O&&y?K(r,y):r),A(r)}),renderOption:z,renderInput:e=>l(d,Object.assign({},e,{variant:"outlined",name:n,label:c?i(o,{children:[s," ",l("span",{children:"*"})]}):s,InputLabelProps:{shrink:!!(null==L?void 0:L.placeholder)},sx:{".MuiInputLabel-root span":{color:"#D6331F"}},placeholder:null==L?void 0:L.placeholder,error:!!D,inputRef:M,helperText:!f&&(null==D?void 0:D.message),FormHelperTextProps:{variant:"standard"},InputProps:Object.assign(Object.assign({},e.InputProps),{startAdornment:w||e.InputProps.startAdornment,endAdornment:V||e.InputProps.endAdornment})},x))},L))};const _r=()=>l("img",{src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M4.22032 8.46991C4.36094 8.32946 4.55157 8.25057 4.75032 8.25057C4.94907 8.25057 5.13969 8.32946 5.28032 8.46991L12.0003 15.1899L18.7203 8.46991C18.789 8.39622 18.8718 8.33712 18.9638 8.29613C19.0558 8.25514 19.1551 8.23309 19.2558 8.23132C19.3565 8.22954 19.4565 8.24807 19.5499 8.28579C19.6433 8.32351 19.7281 8.37965 19.7994 8.45087C19.8706 8.52209 19.9267 8.60692 19.9644 8.70031C20.0022 8.7937 20.0207 8.89373 20.0189 8.99443C20.0171 9.09513 19.9951 9.19445 19.9541 9.28645C19.9131 9.37845 19.854 9.46125 19.7803 9.52991L12.5303 16.7799C12.3897 16.9204 12.1991 16.9992 12.0003 16.9992C11.8016 16.9992 11.6109 16.9204 11.4703 16.7799L4.22032 9.52991C4.07987 9.38928 4.00098 9.19866 4.00098 8.99991C4.00098 8.80116 4.07987 8.61054 4.22032 8.46991Z' fill='%238B8C9E'/%3e%3c/svg%3e",alt:""});function Wr(e){var{name:r,label:t,control:n,required:s=!1,searchBy:c,labelKey:p,multiple:v=!1,mongoQueryJson:y,disabled:b,valueKey:C,sortBy:x="",hideErrorMessage:E,disableCloseOnSelect:O,textFieldProps:S,onChange:w,queryFunction:V,validate:L,itemQueryFunction:k,requiredErrorText:R="",startAdornment:M,endAdornment:I}=e,F=a(e,["name","label","control","required","searchBy","labelKey","multiple","mongoQueryJson","disabled","valueKey","sortBy","hideErrorMessage","disableCloseOnSelect","textFieldProps","onChange","queryFunction","validate","itemQueryFunction","requiredErrorText","startAdornment","endAdornment"]);const D=T({control:n,name:r,defaultValue:v?[]:null,rules:{required:!!s&&(R||Nr),validate:L}}),P=D.field,{ref:A,onChange:q,value:$}=P,z=a(P,["ref","onChange","value"]),{fieldState:{error:B,isDirty:H}}=D,{getOptionLabel:_,isOptionEqualToValue:W,renderOption:J}=Br({valueKey:C,labelKey:p}),[G,Y]=h([]),[Q,ee]=h(!1),[re,te]=h(""),[ne,le]=h(""),[ie,oe]=h(0),ae=g((()=>!!G.length&&Q),[Q,G]),{data:se,isFetching:de}=U(["options",ie,ne],(()=>{const e=X.parse(Object.assign({page:`${ie}`,size:"20",sort:x},ne?{[c]:ne}:{}),{ignoreQueryPrefix:!0});return V(e)}),{onSuccess(e){Y(ne?e.collection:r=>1===r.length?e.collection:[...r,...e.collection])}}),ce=(e,r)=>{if("object"==typeof e){if(Array.isArray(e))return e.map((e=>ce(e,r)));{const t={};for(const n in e)t[n]=ce(e[n],r);return t}}return"string"==typeof e&&e.includes("${variable}")?e.replace("${variable}",r):e},ue=Dr((e=>{if(oe(0),y){const r=ce(y,e);le(JSON.stringify(r))}else le(e)}),500),pe=f(((e,r)=>{Y([]),te(r),ue(r)}),[ue]),me=f(((e,r)=>{q(r),w&&w(e,r)}),[q,w]);m((()=>{if(!H&&$&&k){let e=$;"object"==typeof $&&C in $&&(e=K($,C)),k(e).then((e=>{q(e),te(K(e,p))})).catch(console.error)}}),[$,H,C,p,k,q]);const he=f((e=>{const r=e.currentTarget;r.scrollHeight-r.scrollTop-r.clientHeight<=1&&G.length<(null==se?void 0:se.totalItems)&&oe((e=>e+1))}),[se,G]);return l(Z,Object.assign({},z,{fullWidth:!0,disablePortal:!0,size:"small",readOnly:b,options:G,multiple:v,getOptionLabel:_,isOptionEqualToValue:W,disableCloseOnSelect:O||v,filterSelectedOptions:v,inputValue:re,value:$,onChange:me,loading:de,clearOnBlur:!1,open:ae,filterOptions:e=>e,onOpen:()=>{ee(!0)},onClose:()=>{ee(!1),le("")},onInputChange:pe,ListboxProps:{onScroll:he},renderOption:J,popupIcon:l(_r,{}),renderInput:e=>l(d,Object.assign({},e,{label:s?i(o,{children:[t," ",l("span",{children:"*"})]}):t,InputLabelProps:{shrink:!!(null==F?void 0:F.placeholder)},placeholder:null==F?void 0:F.placeholder,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},variant:"outlined",error:!!B,inputRef:A,helperText:!E&&(null==B?void 0:B.message),FormHelperTextProps:{variant:"standard"},InputProps:Object.assign(Object.assign({},e.InputProps),{endAdornment:I||i(u.Fragment,{children:[de?l(N,{position:"end",children:l(j,{color:"inherit",size:20})}):null,e.InputProps.endAdornment]}),startAdornment:M||e.InputProps.startAdornment})},S))},F))}const Jr=({copyText:e,helpText:r="Copy"})=>{const[t,n]=h(r);return t?l(Q,{title:t,placement:"top",children:l(M,{onClick:()=>{navigator.clipboard.writeText(e),n("Copied!"),setTimeout((()=>{n(r)}),1e3)},children:l(R,{fontSize:"small",children:l("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4 6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z"})})})}):null},Gr=({text:e,buttonProps:r={}})=>{const t=ee(),{state:n}=re(),i=g((()=>null==n?void 0:n.from),[n]),o=f((()=>{t(i||-1)}),[t,i]);return l($,{mr:2,children:e?l(I,Object.assign({color:"inherit",onClick:i?null:o,component:te,to:null!=i?i:""},r,{children:e})):l(M,{onClick:o,children:l(R,{children:l("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"})})})})},Yr=y(((e,r)=>{var{control:t,name:n,mode:s="json",label:d,width:c="100%",height:u="200px",readOnly:p,required:m=!1,validateJson:h=!1,hideErrorMessage:v=!1,fontSize:y=16,validate:b=!0,parseValue:C,requiredErrorText:x="",useCleanValue:E}=e,O=a(e,["control","name","mode","label","width","height","readOnly","required","validateJson","hideErrorMessage","fontSize","validate","parseValue","requiredErrorText","useCleanValue"]);const S=T({control:t,name:n,rules:{required:!!m&&(x||Nr),validate:e=>{if(e&&h&&"string"==typeof e)try{return JSON.parse(e),!0}catch(e){return console.error(e),"Invalid JSON"}return!0}}}),w=S.field,{onChange:V,value:L,ref:k}=w,R=a(w,["onChange","value","ref"]),{fieldState:{error:M}}=S,N=g((()=>({json:[oe.json()],javascript:[oe.javascript()],python:[oe.python()]})),[]),I=g((()=>"text"===s&&"string"!=typeof L?JSON.stringify(L,null,2):"json"===s&&"string"!=typeof L?null===L?"":E?JSON.stringify(L,null,2).replace(/\\"/g,""):JSON.stringify(L,null,2):"string"==typeof L&&"text"!==s&&E?L.replace(/\\"/g,""):L),[L,E,s]),F=f((e=>{if(C)try{const r=JSON.parse(e);V(r)}catch(r){V(e)}else V(e)}),[V,C]);return i($,{display:"flex",flexDirection:"column",width:"100%",children:[l($,{children:d&&l(z,{variant:"subtitle1",display:"inline",style:{marginRight:10},children:m?i(o,{children:[d," ",l($,{component:"span",color:"#D6331F",children:"*"})]}):d})}),i(o,{children:[l(ie,Object.assign({},R,{ref:r||k,basicSetup:{autocompletion:!0,history:!0},theme:ae,width:c,height:u,style:{fontSize:y,lineHeight:1.4,zIndex:0,isolation:"isolate"},readOnly:p,value:I,onChange:F,extensions:"text"===s?[]:N[s]},O)),M&&!v&&l(_,{variant:"standard",error:!0,children:M.message})]})]})})),Zr=(e,r)=>{const t=[...e];return t.splice(r,1),t},Kr=e=>{try{JSON.parse(e)}catch(e){return!1}return!0};function Ur(e){return e.replace(/(^\w)|([-\s]\w)/g,(e=>e.toUpperCase()))}const Xr=(e,r,t,n="asc")=>{const l=e[t],i=r[t];return l<i?"asc"===n?-1:1:l>i?"asc"===n?1:-1:0},Qr=e=>{if(!e)return"";if("string"==typeof e)try{return JSON.stringify(JSON.parse(e),null,2)}catch(r){return e}else try{return JSON.stringify(e,null,2)}catch(e){return"Failed to stringify JSON"}},et=e=>{try{return JSON.parse(e)}catch(e){return null}},rt=e=>{try{const r=JSON.parse(e);return Object.keys(r).forEach((e=>{r[e]=rt(r[e])})),r}catch(r){return e}},tt=y((({value:e,height:r=200,fontSize:t=16},n)=>{const[o,a]=h(!0),s=f((e=>{const r=t=>{e.scrollDOM.scrollHeight-e.scrollDOM.offsetHeight-t.target.scrollTop<10&&setTimeout((()=>e.scrollDOM.scrollTo(0,0)),200),0===t.target.scrollTop&&(a(!1),e.scrollDOM.removeEventListener("scroll",r))};e.scrollDOM.scrollHeight>3e4?(a(!0),e.scrollDOM.addEventListener("scroll",r),e.scrollDOM.scrollTo(0,e.scrollDOM.scrollHeight-1e3),setTimeout((()=>{e.scrollDOM.scrollTo({top:e.scrollDOM.scrollHeight,behavior:"smooth"})}),300)):a(!1)}),[]);return i($,{position:"relative",children:[o&&l(Lr,{bgcolor:"#fff"}),l(ie,{ref:n,readOnly:!0,width:"100%",value:"string"==typeof e?e:JSON.stringify(e,null,2),height:`${r}px`,basicSetup:{autocompletion:!0,history:!0,foldGutter:!0},onCreateEditor:s,extensions:[oe.json()],style:{fontSize:t,width:"100%"}})]})})),nt=({open:e,onClose:r,value:t,jsonViewProps:n})=>{const o=p();return i(F,{disableEscapeKeyDown:!0,open:e,onClose:r,fullWidth:!0,maxWidth:"md",style:{width:800,left:"30%"},children:[l(P,{children:l(tt,Object.assign({value:t},n,{ref:o}))}),i(D,{children:[l(Jr,{copyText:t}),l(I,{onClick:r,variant:"contained",color:"secondary",children:"Close"})]})]})};var lt=({value:e,copyButton:r=!1,textField:t=!1})=>{const{open:n,onOpen:o,onClose:a}=Pr(),s=f((e=>{e.stopPropagation(),o()}),[o]);return i($,{width:"100%",children:[i($,{display:"flex",alignItems:"center",justifyContent:"flex-end",pt:1,mb:2,children:[r&&l(Jr,{copyText:Qr(e)}),l(Q,{title:"Open",placement:"top",children:l(M,{size:"small",onClick:s,children:l(R,{children:l("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})})})})]}),t?l($,{overflow:"hidden",whiteSpace:"nowrap",children:"object"==typeof e?JSON.stringify(e):e}):l(tt,{value:e}),l(nt,{open:n,value:Qr(e),onClose:a,jsonViewProps:{height:450}})]})};const it={spacing:4,palette:{primary:{main:"#E0613A",dark:"#d9512e",light:"#E0613A"},secondary:{main:"#007994",dark:"#262842",light:"#cbe8ee"},text:{disabled:"#A9A9B8"},success:{main:"#2DB77B",light:"#DBFCEE"},grey:{100:"#F7F8FC",700:"#101F2B"}},typography:{fontSize:14,allVariants:{fontFamily:["Euclid","-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto",'"Helvetica Neue"',"Arial","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"'].join(",")},h1:{fontWeight:400},h3:{fontWeight:500},h4:{fontWeight:500}}};var ot=e(it);var at={components:{MuiButtonBase:{defaultProps:{disableElevation:!0},styleOverrides:{root:{"&.MuiButton-root":{boxShadow:"none"},"&.MuiButton-root:hover":{boxShadow:"none"},"&.MuiButton-containedPrimary:hover":{backgroundColor:"#D15C3B"},"&.MuiButton-outlinedPrimary:hover":{backgroundColor:"#F6F6F7",borderColor:"#DDDDE1"},"&.MuiButton-textPrimary":{color:ot.palette.secondary.dark,"&:hover":{backgroundColor:"#F6F6F7"},"&:active":{backgroundColor:"#EEEEF0"}},"&.MuiButton-textSecondary":{color:ot.palette.secondary.main,"&:hover":{backgroundColor:"#DEF7FC"},"&:active":{backgroundColor:"#CFE6ED"}}}}},MuiInputBase:{styleOverrides:{root:{color:"#262842",borderRadius:ot.spacing(3),minWidth:ot.spacing(25),background:ot.palette.background.default,paddingRight:ot.spacing(3)},input:{minWidth:ot.spacing(25)}}},MuiSelect:{defaultProps:{IconComponent:qr},styleOverrides:{nativeInput:{padding:0,height:"32px"}}},MuiTextField:{styleOverrides:{root:{minWidth:ot.spacing(25)}}},MuiInputLabel:{styleOverrides:{root:{color:"#6D6E85",position:"relative",overflow:"initial",transform:"none",marginBottom:ot.spacing(1),fontWeight:500,fontSize:"14px",lineHeight:"20px",pointerEvents:"auto","&.Mui-focused":{color:"#6D6E85"}}}},MuiOutlinedInput:{styleOverrides:{root:{borderRadius:ot.spacing(3),minWidth:ot.spacing(25),"&:hover":{".MuiOutlinedInput-notchedOutline":{borderColor:"#8B8C9E"}},"&.Mui-focused":{".MuiOutlinedInput-notchedOutline":{borderColor:ot.palette.secondary.main}}},notchedOutline:{top:0,"& legend":{display:"none",transition:"none"}}}},MuiAutocomplete:{defaultProps:{popupIcon:l(qr,{})},styleOverrides:{root:{"& .MuiOutlinedInput-root .MuiAutocomplete-endAdornment":{right:12}},paper:{marginTop:8,borderRadius:12,boxShadow:"0px 8px 16px rgba(0, 0, 0, 0.04)"},listbox:{"::-webkit-scrollbar":{width:"6px",backgroundColor:"white"},"::-webkit-scrollbar-thumb":{borderRadius:"10px",backgroundColor:"rgba(38, 40, 66, 0.24)"}}}},MuiMenu:{styleOverrides:{list:{paddingTop:0,paddingBottom:0,background:"white","& li.Mui-selected":{background:"rgba(38, 40, 66, 0.08) !important"}}}},MuiPopover:{styleOverrides:{paper:{marginTop:8,borderRadius:12,boxShadow:"0px 8px 16px rgba(0, 0, 0, 0.04)"}}},MuiFormLabel:{styleOverrides:{root:{color:"#6D6E85",fontSize:14,fontWeight:500,"&.Mui-focused":{color:"#6D6E85"},"& span":{color:"#D6331F"}},asterisk:{color:"#D6331F","&$error":{color:"#D6331F"}}}},MuiTooltip:{styleOverrides:{tooltip:{fontSize:14},backgroundColor:ot.palette.secondary.dark,padding:ot.spacing(2,3),borderRadius:8,textAlign:"center"}}}};var st={components:{MuiTableContainer:{styleOverrides:{root:{borderRadius:ot.spacing(3),border:"1px solid rgba(38, 40, 66, 0.08)",overflow:"hidden"}}},MuiTableHead:{styleOverrides:{root:{backgroundColor:"#F7F8FC"}}},MuiTableRow:{styleOverrides:{root:{"&.MuiTableRow-hover":{"&:hover":{backgroundColor:"#F6F6F7"},"&:active, &:focus":{backgroundColor:"#EEEEF0"}},"&:active, &:focus":{backgroundColor:"#EEEEF0"}}}},MuiTableCell:{styleOverrides:{root:{padding:ot.spacing(1,2),borderColor:"#26284214","&:first-of-type":{paddingLeft:ot.spacing(4)}},head:{padding:ot.spacing(2,2),color:"#6D6E85"},body:{wordBreak:"break-all"}}},MuiTableSortLabel:{styleOverrides:{root:{maxHeight:"24px",lineHeight:1}}},MuiTablePagination:{styleOverrides:{root:{"& .MuiInputBase-root":{border:"1px solid #2628421F",borderRadius:4,minWidth:58,height:32,paddingRight:ot.spacing(2),"& .MuiSelect-select":{paddingRight:"4px !important",color:ot.palette.secondary.dark,"&:focus":{backgroundColor:"transparent"}}}}}},MuiPaginationItem:{styleOverrides:{root:{height:32,minWidth:32,borderRadius:4,border:"1px solid transparent",margin:"0, 2px","&.Mui-selected":{borderColor:"#2628421F",backgroundColor:"#F7F8FC"}}}},MuiDataGrid:{defaultProps:{headerHeight:40,getRowHeight:()=>"auto"},styleOverrides:{root:{borderRadius:ot.spacing(3),width:"100%",color:ot.palette.secondary.dark,border:"1px solid #26284214","& .MuiDataGrid-actionsCell":{flexWrap:"wrap",width:"100%",'& > button[aria-label="more"]':{marginLeft:"auto"}}},columnHeaders:{backgroundColor:ot.palette.grey[100],borderTopLeftRadius:ot.spacing(3),borderTopRightRadius:ot.spacing(3)},columnHeader:{"&:focus":{outline:"none"}},columnHeaderTitle:{color:"#6D6E85",fontWeight:500},row:{"&:hover":{backgroundColor:"#F6F6F7"},"&:active, &:focus":{backgroundColor:"#EEEEF0"}},columnSeparator:{display:"none"},withBorder:{borderColor:"#E0E3EA"},cell:{minHeight:"48px !important",textOverflow:"ellipsis",wordBreak:"break-all",lineHeight:"unset",padding:ot.spacing(1.25,3),borderColor:"#E0E3EA","&:focus":{outline:"none"}}}}}};var dt={components:{MuiStepIcon:{styleOverrides:{root:{fontSize:"20px",color:ot.palette.text.disabled,"&.Mui-active, &.Mui-completed":{color:ot.palette.secondary.main}}}}}};var ct={components:{MuiTypography:{styleOverrides:{h1:{[ot.breakpoints.up("lg")]:{fontSize:"1.5rem"}},h3:{fontSize:"1.25rem",[ot.breakpoints.up("lg")]:{fontSize:"1.125rem"}},h4:{fontSize:"1rem",[ot.breakpoints.up("lg")]:{fontSize:"1rem"}},subtitle2:{color:"#6D6E85"}}}}};const ut=(()=>{if(document){const e="https://dev-qa-arsenal-frontend-fonts-bucket.s3.eu-north-1.amazonaws.com/fonts.css";if(!document.querySelectorAll(`link[href="${e}"]`).length){const r=document.createElement("link");r.href=e,r.rel="stylesheet",document.head.appendChild(r)}}return r(e(ot,{components:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},at.components),st.components),dt.components),ct.components),{MuiToolbar:{styleOverrides:{root:{[ot.breakpoints.up("sm")]:{minHeight:"56px"}}}},MuiAppBar:{styleOverrides:{root:{boxShadow:"none",backgroundColor:"#007F9B"}}},MuiButton:{styleOverrides:{root:{borderRadius:ot.spacing(2.5),padding:ot.spacing(2.5,4),lineHeight:"20px",fontSize:"1rem",textTransform:"none"},outlined:{color:"#262842",backgroundColor:"#FFFFFF !important",border:"1px solid rgba(38, 40, 66, 0.12)"},text:{color:ot.palette.secondary.dark}}},MuiDialog:{styleOverrides:{root:{"& .MuiModal-backdrop":{background:"rgba(28, 55, 77, 0.5)",backdropFilter:"blur(2px)"}},paper:{borderRadius:ot.spacing(3)},paperWidthXs:{maxWidth:500}}},MuiDialogContent:{styleOverrides:{root:{color:"#6D6E85"}}},MuiDialogActions:{styleOverrides:{root:{background:"#F7F8FC",borderTop:"1px solid rgba(38, 40, 66, 0.08)",padding:ot.spacing(3,6)}}},MuiTabs:{styleOverrides:{root:{minHeight:"38px"},indicator:{backgroundColor:ot.palette.secondary.main}}},MuiTab:{styleOverrides:{root:{fontSize:14,fontWeight:500,textTransform:"none",padding:"10px 12px",lineHeight:"1.125rem",minHeight:"38px",color:"#8B8C9E","&.Mui-selected":{color:ot.palette.secondary.main}}}}})}))})(),pt=({value:e,canCopy:r,copyValue:t,shortId:n,fullText:o=!1,textParams:a})=>{const{displayAs:s="text",tooltipLinkComponent:d=null,dateFormat:c=null,statusVariant:u=null}=a||{};switch(s){case"boolean":return l(R,e?{color:"primary",fontSize:"small",children:l("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}:{fontSize:"small",children:l("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z"})});case"date":return e?c?l(Gl,{children:c.map(((r,t)=>l($,{children:ce(new Date(e),r)},t)))}):i(Gl,{children:[l($,{children:ce(new Date(e),"dd.MM.yyyy")}),l($,{children:ce(new Date(e),"HH:mm:ss")})]}):"";case"status":return l(Gl,{children:l(vl,{text:e,status:u||"default"})});case"json_text":return l(lt,{value:e,textField:!0});case"json_code":return l(lt,{value:e,copyButton:!0});case"array":return l($,{children:null==e?void 0:e.map(((e,r)=>l($,{children:e},r)))});case"collapsed_array":return e&&l($,{children:l(Q,{arrow:!0,title:d||e.map(((e,r)=>l($,{fontSize:14,style:{paddingTop:ut.spacing(1)},children:e},r))),children:l($,{children:e.length>1?`${e[0]} (+${e.length-1})`:e[0]})})});case"number":return l($,{display:"flex",justifyContent:"flex-end",children:l(Gl,{children:e.toLocaleString("ru-Ru",{minimumFractionDigits:2})})});default:return e?i($,{display:"flex",alignItems:"center",width:"100%",children:[n?l(Gl,{children:e?`${e.slice(0,6)}...${e.slice(-6)}`:"..."}):o?l($,{sx:{whiteSpace:"normal"},children:"string"==typeof e?e:JSON.stringify(e)}):l(Gl,{children:"string"==typeof e?e:JSON.stringify(e)}),r&&l(Jr,{copyText:t?"string"==typeof t?t:JSON.stringify(t):e})]}):""}},mt=new RegExp("^[-+]?[0-9]+$"),ht=new RegExp(/^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/),ft=(e,r)=>{if("string"==typeof e)return/[$%#{<]{1}(?:S?JS)?(?:[{(%#>]|\()/g.test(e);if(r){if(Array.isArray(e))for(const t of e)if(ft(t,r))return!0;if("object"==typeof e)for(const t in e)if(ft(e[t],r))return!0}return!1},gt=e=>e===Or.DATE||e===Or.DATE_TIME||e===Or.TIME,vt=new Intl.NumberFormat("ru-RU",{style:"decimal"}),yt=e=>!e&&0!==e&&!1!==e,bt=(e,r,t)=>{if(null==r)return null;if(ft(r))return r;let n=r;switch(e){case Or.BOOLEAN:n=!!r||!(!r&&null!==r)&&null;break;case Or.INTEGER:case Or.BIG_INTEGER:case Or.BIG_DECIMAL:case Or.FLOAT:case Or.LONG:case Or.DOUBLE:n=Number(r);break;case Or.DATE:case Or.DATE_TIME:case Or.TIME:if(r)try{const e=t.formatText.replace(/[Z,z,x]+/g,"XX");n=ce(ue(r,e,new Date),e)}catch(e){console.error(e)}break;case Or.JSON:try{"string"!=typeof r&&(n=JSON.stringify(r)),n=JSON.parse(n)}catch(e){console.log(e),n=null}break;case Or.ANY:try{n="string"==typeof r?JSON.parse(n):r}catch(e){n=r}break;case Or.ENTITY:n=Ct(t.properties,r)}return n},Ct=(e,r)=>{if(r){const t={};return e.forEach((e=>{const{key:n,propertyType:l}=e,i=r[n];Array.isArray(i)?t[n]=i.map((r=>bt(l,r,{formatText:e.format,properties:e.properties}))):t[n]=bt(l,i,{formatText:e.format,properties:e.properties})})),t}return null},xt=(e,r)=>{const t={};return e.forEach((e=>{const{key:n,name:l,isRequired:i,isMultiple:o,sortOrder:a,isEnabled:s,uiSettings:d,validationNode:c}=e,u=e.propertyType?"string"==typeof e.propertyType?e.propertyType:e.propertyType.value:null,p=Object.assign({name:l,propertyType:u,isRequired:i,isMultiple:o,sortOrder:a,isEnabled:s,validationNode:c,uiSettings:d},((e,r)=>{const t={};let n,l="";return r?e.isMultiple?(l="values",n=e.value):(l="value",n=e.value):e.isMultiple?(l="defaultValues",n=e.defaultValue):(l="defaultValue",n=e.defaultValue),Array.isArray(n)?t[l]=n.map((r=>bt(e.propertyType,r,{formatText:e.format,properties:e.properties}))):t[l]=bt(e.propertyType,n,{formatText:e.format,properties:e.properties}),t})(Object.assign(Object.assign({},e),{propertyType:u}),r));if("isViewableInList"in e&&(p.isViewableInList=e.isViewableInList),d)if("string"==typeof d)try{p.uiSettings=JSON.parse(d)}catch(e){console.log(e),p.uiSettings=d}else p.uiSettings=d;else p.uiSettings=null;u===Or.BIG_DECIMAL&&(p.precisionScale=e.precisionScale,p.roundingMode=e.roundingMode),u!==Or.DATE&&u!==Or.TIME&&u!==Or.DATE_TIME||(p.format=e.format),u===Or.STRING&&(p.restrictedValues=e.restrictedValues),u===Or.ENTITY_REFERENCE&&(p.source=e.source,p.definitionCode=e.definitionCode,p.definitionVersion=e.definitionVersion,p.labelPropertyCode=e.labelPropertyCode,p.valuePropertyCode=e.valuePropertyCode),u===Or.ENTITY&&(p.properties=xt(e.properties,r)),t[n]=p})),t};function Et(e,r){return Object.keys(e).map((t=>{const n=Object.assign(Object.assign({key:t},e[t]),r||{});if(n.propertyType===Or.ENTITY&&(n.properties=Et(n.properties,r)),n.propertyType===Or.JSON)try{null==n.defaultValue?n.defaultValue="":n.defaultValue=JSON.stringify(n.defaultValue,null,2)}catch(e){n.defaultValue=""}return n.isMultiple&&("defaultValues"in n&&(n.defaultValue=n.defaultValues),"values"in n&&(n.value=n.values)),n})).sort(((e,r)=>Xr(e,r,"sortOrder")))}const Ot=(e,r)=>{if(r)try{const e=r.replace(/Z/g,"XXX");return ce(new Date,e),e}catch(r){return console.error("Incorrect format",r),e}return e},Tt=e=>{let r=[];return r=Array.isArray(e.properties)?e.properties:Et(e.properties),r.reduce(((e,r)=>{const t=JSON.parse(JSON.stringify(e));return r.propertyType===Or.ENTITY?t[r.key]=Tt(r):t[r.key]=r.propertyType,t}),{})},St=({propertyType:e,useExpression:r,required:t})=>{let n=[{value:"widget",label:"Fill array (widget)",sortOrder:1}];return t||n.push({value:"null",label:"NULL",sortOrder:0}),r&&(e===Or.JSON||e===Or.ENTITY||e===Or.ANY?n.push({value:"expression",label:"Expression (JSON editor)",sortOrder:3}):n.push({value:"expression",label:"Expression",sortOrder:3})),e!==Or.JSON&&e!==Or.ANY&&e!==Or.ENTITY||n.push({value:"json_valid",label:"JSON editor",sortOrder:2}),n=n.sort(((e,r)=>Xr(e,r,"sortOrder"))),n},wt=({propertyType:e,useExpression:r,required:t})=>{let n=[{value:"widget",label:"Widget",sortOrder:1}];switch(t||n.push({value:"null",label:"NULL",sortOrder:0}),r&&(e===Or.JSON||e===Or.ENTITY||e===Or.ANY?n.push({value:"expression",label:"Expression (JSON editor)",sortOrder:3}):n.push({value:"expression",label:"Expression",sortOrder:3})),e===Or.JSON&&n.push({value:"dem_builder",label:"DEM Builder",sortOrder:2}),e){case Or.STRING:n[0].label="Text input";break;case Or.INTEGER:case Or.BIG_INTEGER:case Or.BIG_DECIMAL:case Or.FLOAT:case Or.LONG:case Or.DOUBLE:n[0].label="Number input";break;case Or.BOOLEAN:n[0].label="Switch";break;case Or.ENTITY_REFERENCE:n[0].label="Entity reference field";break;case Or.JSON:n[0].label="JSON editor";break;case Or.DATE:n[0].label="Date picker",n.push({value:"string",label:"Text input",sortOrder:2});break;case Or.DATE_TIME:n[0].label="Date & Time picker",n.push({value:"string",label:"Text input",sortOrder:2});break;case Or.TIME:n[0].label="Time picker",n.push({value:"string",label:"Text input",sortOrder:2});break;case Or.ANY:n[0].label="Textarea"}return n=n.sort(((e,r)=>Xr(e,r,"sortOrder"))),n},Vt={required:Nr,notValidNumber:"Not valid number",notValidInteger:"Not valid integer"},Lt=e=>{var r,t,{control:n,validate:s,name:c="",label:u="",required:p=!1,defaultValue:m=null,disabled:h=!1,hideErrorMessage:f=!1,onChange:v,decimal:y=!1,valueAsNumber:b=!0,useFormattedInputValue:C=!1,errorText:x}=e,E=a(e,["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange","decimal","valueAsNumber","useFormattedInputValue","errorText"]);const O=g((()=>x||Vt),[x]),S=T({name:c,control:n,defaultValue:m,rules:{required:!!p&&O.required,validate:e=>0==+e||(null===e?!p||O.required:y&&!ht.test(e)||/^-*0+$/.test(e)?O.notValidNumber:y||mt.test(e)?!s||("function"!=typeof s||s(e)):O.notValidInteger)}}),w=S.field,{ref:V,onChange:L,value:k}=w,R=a(w,["ref","onChange","value"]),{fieldState:{error:M}}=S;return l(d,Object.assign({},R,{fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:V,name:c,label:p?i(o,{children:[u," ",l("span",{children:"*"})]}):u,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!M,helperText:!f&&(null==M?void 0:M.message),disabled:h,value:C?null!==(r=null==k?void 0:k.toLocaleString("ru-Ru",{maximumFractionDigits:10}).replace(",","."))&&void 0!==r?r:"":null!=k?k:"",onChange:e=>{var r;const t=e.target.value.replace(/\s/g,""),n=e.nativeEvent.data;if(!isNaN(n)||y&&"."===n||"-"===n||"+"===n||t){if(v)v(e);else if(b)if(e.target.value)if("0"===e.target.value)L(0);else if(y){const n=e.target.value.split(".")[1];L(!ht.test(t)||/^0+$/.test(n)||/^-*0+$/.test(t)?e.target.value:+parseFloat(t).toFixed(null!==(r=null==n?void 0:n.length)&&void 0!==r?r:0))}else L(Number.isNaN(+t)?e.target.value:+t);else L(null)}else L(e.target.value)},FormHelperTextProps:{variant:"standard"},inputProps:Object.assign({},null!==(t=null==E?void 0:E.inputProps)&&void 0!==t?t:{})},E))},kt=e=>{var{control:r,name:t,label:n}=e,i=a(e,["control","name","label"]);const o=T({control:r,name:t}).field,{ref:s,onChange:d,value:c}=o,u=a(o,["ref","onChange","value"]),p=g((()=>{if("boolean"==typeof c)return c;if("string"==typeof c){if("false"===c)return d(!1),!1;if("true"===c)return d(!0),!0}return!1}),[c,d]);m((()=>{null===c&&d(!1)}),[c,d]);return l(H,{label:n,name:t,control:l(se,Object.assign({},u,{color:"primary",size:"small",inputRef:s,onChange:e=>{const{checked:r}=e.target;d(r)},checked:p},i))})};var Rt="data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M17.75 3C18.612 3 19.4386 3.34241 20.0481 3.9519C20.6576 4.5614 21 5.38805 21 6.25V17.75C21 18.612 20.6576 19.4386 20.0481 20.0481C19.4386 20.6576 18.612 21 17.75 21H6.25C5.38805 21 4.5614 20.6576 3.9519 20.0481C3.34241 19.4386 3 18.612 3 17.75V6.25C3 5.38805 3.34241 4.5614 3.9519 3.9519C4.5614 3.34241 5.38805 3 6.25 3H17.75ZM19.5 8.5H4.5V17.75C4.5 18.716 5.284 19.5 6.25 19.5H17.75C18.2141 19.5 18.6592 19.3156 18.9874 18.9874C19.3156 18.6592 19.5 18.2141 19.5 17.75V8.5ZM7.75 14.5C8.08152 14.5 8.39946 14.6317 8.63388 14.8661C8.8683 15.1005 9 15.4185 9 15.75C9 16.0815 8.8683 16.3995 8.63388 16.6339C8.39946 16.8683 8.08152 17 7.75 17C7.41848 17 7.10054 16.8683 6.86612 16.6339C6.6317 16.3995 6.5 16.0815 6.5 15.75C6.5 15.4185 6.6317 15.1005 6.86612 14.8661C7.10054 14.6317 7.41848 14.5 7.75 14.5ZM12 14.5C12.3315 14.5 12.6495 14.6317 12.8839 14.8661C13.1183 15.1005 13.25 15.4185 13.25 15.75C13.25 16.0815 13.1183 16.3995 12.8839 16.6339C12.6495 16.8683 12.3315 17 12 17C11.6685 17 11.3505 16.8683 11.1161 16.6339C10.8817 16.3995 10.75 16.0815 10.75 15.75C10.75 15.4185 10.8817 15.1005 11.1161 14.8661C11.3505 14.6317 11.6685 14.5 12 14.5ZM7.75 10.5C8.08152 10.5 8.39946 10.6317 8.63388 10.8661C8.8683 11.1005 9 11.4185 9 11.75C9 12.0815 8.8683 12.3995 8.63388 12.6339C8.39946 12.8683 8.08152 13 7.75 13C7.41848 13 7.10054 12.8683 6.86612 12.6339C6.6317 12.3995 6.5 12.0815 6.5 11.75C6.5 11.4185 6.6317 11.1005 6.86612 10.8661C7.10054 10.6317 7.41848 10.5 7.75 10.5ZM12 10.5C12.3315 10.5 12.6495 10.6317 12.8839 10.8661C13.1183 11.1005 13.25 11.4185 13.25 11.75C13.25 12.0815 13.1183 12.3995 12.8839 12.6339C12.6495 12.8683 12.3315 13 12 13C11.6685 13 11.3505 12.8683 11.1161 12.6339C10.8817 12.3995 10.75 12.0815 10.75 11.75C10.75 11.4185 10.8817 11.1005 11.1161 10.8661C11.3505 10.6317 11.6685 10.5 12 10.5ZM16.25 10.5C16.5815 10.5 16.8995 10.6317 17.1339 10.8661C17.3683 11.1005 17.5 11.4185 17.5 11.75C17.5 12.0815 17.3683 12.3995 17.1339 12.6339C16.8995 12.8683 16.5815 13 16.25 13C15.9185 13 15.6005 12.8683 15.3661 12.6339C15.1317 12.3995 15 12.0815 15 11.75C15 11.4185 15.1317 11.1005 15.3661 10.8661C15.6005 10.6317 15.9185 10.5 16.25 10.5ZM17.75 4.5H6.25C5.78587 4.5 5.34075 4.68437 5.01256 5.01256C4.68437 5.34075 4.5 5.78587 4.5 6.25V7H19.5V6.25C19.5 5.78587 19.3156 5.34075 18.9874 5.01256C18.6592 4.68437 18.2141 4.5 17.75 4.5Z' fill='%238B8C9E'/%3e%3c/svg%3e";const Mt=()=>l("img",{src:Rt,alt:""}),Nt=e=>{var{control:r,name:t,required:n,label:s,placeholder:c,defaultValue:u,format:p=Tr,hideErrorMessage:g=!1,textFieldProps:v={},requiredErrorText:y="",validate:b,validateErrorText:C}=e,x=a(e,["control","name","required","label","placeholder","defaultValue","format","hideErrorMessage","textFieldProps","requiredErrorText","validate","validateErrorText"]);const[E,O]=h(Tr),{field:S,fieldState:{error:w}}=T({control:r,name:t,defaultValue:u,rules:{required:!!n&&(y||Nr),validate:b||(e=>!(""!==e&&!me(e,E))||(C||Ir))}}),V=f((e=>{S.onChange(pe(e)?ce(e,E):e)}),[S,E]);return m((()=>{const e=p.replace(/[Z,z,x]+/g,"XX");try{me(ce(new Date,e),e),O(e)}catch(e){console.error(e)}}),[p]),i(o,{children:[l(Y,{required:n,children:s}),l(de,Object.assign({},S,E?{inputFormat:E}:{},{value:E?ue(S.value,E,new Date):S.value,onChange:V,components:{OpenPickerIcon:Mt}},x,{renderInput:e=>l(d,Object.assign({},e,{fullWidth:!0,size:"small",variant:"outlined",name:t,error:!!w,helperText:!g&&(null==w?void 0:w.message),FormHelperTextProps:{variant:"standard"},inputProps:Object.assign(Object.assign({},e.inputProps),{placeholder:c})},v))}))]})},It=()=>l("img",{src:Rt,alt:""}),Ft=e=>{var{control:r,name:t,required:n,label:s,placeholder:c,defaultValue:u,format:p=wr,hideErrorMessage:g=!1,textFieldProps:v,requiredErrorText:y="",validate:b,validateErrorText:C}=e,x=a(e,["control","name","required","label","placeholder","defaultValue","format","hideErrorMessage","textFieldProps","requiredErrorText","validate","validateErrorText"]);const[E,O]=h(),{field:S,fieldState:{error:w}}=T({control:r,name:t,defaultValue:u,rules:{required:!!n&&(y||Nr),validate:b||(e=>!(""!==e&&!me(e,E))||(C||Ir))}}),V=f((e=>{S.onChange(pe(e)?ce(e,E):e)}),[S,E]);return m((()=>{const e=p.replace(/[Z,z,x]+/g,"XX");try{me(ce(new Date,e),e),O(e)}catch(e){console.error(e)}}),[p]),l(he,Object.assign({},S,{ampm:!1,label:n?i(o,{children:[s," ",l("span",{children:"*"})]}):s,value:E?ue(S.value,E,new Date):S.value},E?{inputFormat:E}:{},{onChange:V,components:{OpenPickerIcon:It}},x,{renderInput:e=>l(d,Object.assign({},e,{fullWidth:!0,size:"small",sx:{".MuiInputLabel-root span":{color:"#D6331F"}},inputProps:Object.assign(Object.assign({},e.inputProps),{placeholder:c}),variant:"outlined",name:t,error:!!w,helperText:!g&&(null==w?void 0:w.message),FormHelperTextProps:{variant:"standard"}},v))}))},Dt=e=>{var{control:r,name:t,required:n,label:s,textFieldProps:c={},format:u=Sr,hideErrorMessage:p=!1,requiredErrorText:f="",placeholder:g,defaultValue:v}=e,y=a(e,["control","name","required","label","textFieldProps","format","hideErrorMessage","requiredErrorText","placeholder","defaultValue"]);const b=T({control:r,name:t,defaultValue:v,rules:{required:!!n&&(f||Nr),validate:e=>!!me(e,u)||"Incorrect date format"}}),C=b.field,{onChange:x,ref:E,value:O}=C,S=a(C,["onChange","ref","value"]),{fieldState:{error:w}}=b,[V,L]=h(null);return m((()=>{if(O&&u){let e=ue(O,u,new Date);pe(e)||(e=ue(O,"HH:mm:ss.SSS",new Date)),L(e)}}),[O,u]),l(fe,Object.assign({},S,{mask:"",inputRef:E,label:n?i(o,{children:[s," ",l("span",{children:"*"})]}):s,ampm:!1,value:V,inputFormat:u,onChange:e=>{L(e),x(pe(e)?ce(e,u):e)}},y,{renderInput:e=>l(d,Object.assign({},e,{fullWidth:!0,size:"small",sx:{".MuiInputLabel-root span":{color:"#D6331F"}},inputProps:Object.assign(Object.assign({},e.inputProps),{placeholder:g}),variant:"outlined",name:t,error:!!w,helperText:!p&&(null==w?void 0:w.message),FormHelperTextProps:{variant:"standard"}}))}))},Pt=e=>{var r,t,n,{name:s,control:c,label:u,required:p,defaultValue:m=null,onChange:v,textFieldLabel:y}=e,b=a(e,["name","control","label","required","defaultValue","onChange","textFieldLabel"]);const[C,x]=h(""),[E,O]=h(null),S=T({control:c,name:s,defaultValue:m,rules:{required:p&&Nr}}),w=S.field,{onChange:V,value:L}=w,k=a(w,["onChange","value"]),{formState:{errors:N}}=S,I=g((()=>v||V),[v,V]),F=f((e=>{const{value:r}=e.target;x(r)}),[]),D=f((()=>{O(null),!C||Array.isArray(L)&&L.includes(C)?Array.isArray(L)&&L.includes(C)&&O("This value already exists"):(I([...null!=L?L:[],C]),x(""))}),[C,I,L]),P=f((e=>{I(L.filter((r=>r!==e)))}),[L,I]),A=f((e=>{"Enter"!==e.key&&13!==e.keyCode||(e.stopPropagation(),e.preventDefault(),D())}),[D]);return i(o,{children:[l(Y,{required:p,children:u}),l($,{display:"flex",flexWrap:"wrap",children:null==L?void 0:L.map(((e,r)=>l(ge,{sx:{mr:1,mb:1},variant:"outlined",label:e,onDelete:()=>P(e)},r)))}),l("input",Object.assign({type:"hidden"},c.register(s),{onChange:I,value:L},k)),l(d,Object.assign({fullWidth:!0,variant:"outlined",size:"small",label:y||""===y?y:`Add ${u}`,value:C,onChange:F,error:!!(null===(r=N[s])||void 0===r?void 0:r.message),helperText:null===(t=N[s])||void 0===t?void 0:t.message,FormHelperTextProps:{variant:"standard"},name:s,onKeyDown:A,InputProps:{endAdornment:l(M,{size:"small",onClick:D,children:l(R,{children:l("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})})},inputProps:Object.assign({},null!==(n=null==b?void 0:b.inputProps)&&void 0!==n?n:{})},b)),E&&l(_,{error:!0,children:E})]})},At=({name:e="period",control:r,label:t="Period",required:n,isSecondsVisible:a=!1})=>{var s;const[c,u]=h(),{setValue:p,register:g,formState:{errors:v}}=w(),y=S({control:r,name:e}),b=f((r=>{const{name:t,value:n}=r.target,l=Object.assign({},null!=c?c:{});n?(l[t]=+n,p(e,ye(l),{shouldValidate:!0})):(delete l[t],p(e,"",{shouldValidate:!0})),u(l)}),[p,e,c]),C=null===(s=v[e])||void 0===s?void 0:s.message;return m((()=>{y&&!c&&u(be(y))}),[c,y]),i(o,{children:[l("input",Object.assign({type:"hidden"},g(e,{required:n&&"Please, fill one of the fields"}))),l(z,{variant:"subtitle1",children:n?i(o,{children:[t," ",l($,{component:"span",color:"#D6331F",children:"*"})]}):t}),C&&l(_,{error:!0,children:C}),i(ve,{container:!0,columns:2,spacing:2,flexWrap:"wrap",children:[l(ve,{sm:1,children:l(d,{variant:"outlined",size:"small",value:(null==c?void 0:c.years)||"",error:!!C,name:"years",label:"Years",type:"number",onChange:b,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})}),l(ve,{sm:1,children:l(d,{variant:"outlined",size:"small",error:!!C,value:(null==c?void 0:c.months)||"",name:"months",label:"Months",type:"number",onChange:b,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})}),l(ve,{sm:1,children:l(d,{variant:"outlined",size:"small",error:!!C,value:(null==c?void 0:c.weeks)||"",name:"weeks",label:"Weeks",type:"number",onChange:b,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})}),l(ve,{sm:1,children:l(d,{variant:"outlined",size:"small",error:!!C,value:(null==c?void 0:c.days)||"",name:"days",label:"Days",type:"number",onChange:b,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})}),l(ve,{sm:1,children:l(d,{variant:"outlined",size:"small",error:!!C,value:(null==c?void 0:c.hours)||"",name:"hours",label:"Hours",type:"number",onChange:b,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})}),l(ve,{sm:1,children:l(d,{variant:"outlined",size:"small",error:!!C,value:(null==c?void 0:c.minutes)||"",name:"minutes",label:"Minutes",type:"number",onChange:b,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})}),a&&l(ve,{sm:1,children:l(d,{variant:"outlined",size:"small",error:!!C,value:(null==c?void 0:c.seconds)||"",name:"seconds",label:"Seconds",type:"number",onChange:b,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})})]})]})};const qt=e=>{var{control:r,name:t,label:n,required:s,mask:c="+7 (799) 999 99 99",requiredErrorText:u="",inputMaskProps:p,disabled:m,invalidErrorText:h}=e,f=a(e,["control","name","label","required","mask","requiredErrorText","inputMaskProps","disabled","invalidErrorText"]);return l(V,{control:r,name:t,rules:{required:!!s&&(u||Nr),validate:e=>!s&&!e||(!!/(\+7\s\(\d{3}\)\s)(\d{3}\s\d{2})(\s\d{2})/.test(e)||(h||"Incorrect phone number format"))},render:({field:e,fieldState:{error:r}})=>l(Ce,Object.assign({disabled:m,mask:c,value:e.value,onChange:e.onChange,onBlur:e.onBlur},p,{children:l(d,Object.assign({fullWidth:!0,size:"small",label:s&&n?i(o,{children:[n," ",l("span",{children:"*"})]}):n,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},inputMode:"numeric",InputProps:{startAdornment:l(N,{position:"start",children:l("img",{src:"data:image/svg+xml,%3csvg width='32' height='24' viewBox='0 0 32 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg clip-path='url(%23clip0_6762_5474)'%3e%3crect width='32' height='24' rx='2' fill='white'/%3e%3cmask id='mask0_6762_5474' style='mask-type:luminance' maskUnits='userSpaceOnUse' x='0' y='0' width='32' height='24'%3e%3crect width='32' height='24' rx='2' fill='white'/%3e%3c/mask%3e%3cg mask='url(%23mask0_6762_5474)'%3e%3crect width='32' height='24' fill='%2330C6E0'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M16.0001 16.8002C18.5249 16.8002 20.5716 14.6512 20.5716 12.0002C20.5716 9.34923 18.5249 7.2002 16.0001 7.2002C13.4754 7.2002 11.4287 9.34923 11.4287 12.0002C11.4287 14.6512 13.4754 16.8002 16.0001 16.8002Z' fill='%23FFCD4B'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M14.1352 20.5791L16.0001 17.6561L17.865 20.5791L18.3374 17.096L21.2255 18.8799L20.2118 15.5264L23.5511 15.818L21.252 13.2584L24.381 11.9998L21.252 10.7411L23.5511 8.1816L20.2118 8.47311L21.2255 5.11966L18.3374 6.90359L17.865 3.42041L16.0001 6.34344L14.1352 3.42041L13.6628 6.90359L10.7747 5.11966L11.7884 8.47311L8.44912 8.1816L10.7482 10.7411L7.61914 11.9998L10.7482 13.2584L8.44912 15.818L11.7884 15.5264L10.7747 18.8799L13.6628 17.096L14.1352 20.5791ZM21.3334 11.9998C21.3334 15.0926 18.9456 17.5998 16.0001 17.5998C13.0546 17.5998 10.6668 15.0926 10.6668 11.9998C10.6668 8.90698 13.0546 6.39978 16.0001 6.39978C18.9456 6.39978 21.3334 8.90698 21.3334 11.9998Z' fill='%23FFCD4B'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M1.52393 1.93343C1.52393 1.74934 1.67316 1.6001 1.85726 1.6001H2.7144C2.8985 1.6001 3.04774 1.74934 3.04774 1.93343V2.86676C3.04774 3.05086 2.8985 3.2001 2.7144 3.2001H1.85726C1.67316 3.2001 1.52393 3.05086 1.52393 2.86676V1.93343ZM1.52393 5.13343C1.52393 4.94934 1.67316 4.8001 1.85726 4.8001H2.7144C2.8985 4.8001 3.04774 4.94934 3.04774 5.13343V6.06676C3.04774 6.25086 2.8985 6.4001 2.7144 6.4001H1.85726C1.67316 6.4001 1.52393 6.25086 1.52393 6.06676V5.13343ZM1.85726 8.0001C1.67316 8.0001 1.52393 8.14934 1.52393 8.33343V9.26676C1.52393 9.45086 1.67316 9.6001 1.85726 9.6001H2.7144C2.8985 9.6001 3.04774 9.45086 3.04774 9.26676V8.33343C3.04774 8.14934 2.8985 8.0001 2.7144 8.0001H1.85726ZM1.52393 11.5334C1.52393 11.3493 1.67316 11.2001 1.85726 11.2001H2.7144C2.8985 11.2001 3.04774 11.3493 3.04774 11.5334V12.4668C3.04774 12.6509 2.8985 12.8001 2.7144 12.8001H1.85726C1.67316 12.8001 1.52393 12.6509 1.52393 12.4668V11.5334ZM1.85726 14.4001C1.67316 14.4001 1.52393 14.5493 1.52393 14.7334V15.6668C1.52393 15.8509 1.67316 16.0001 1.85726 16.0001H2.7144C2.8985 16.0001 3.04774 15.8509 3.04774 15.6668V14.7334C3.04774 14.5493 2.8985 14.4001 2.7144 14.4001H1.85726ZM1.52393 17.9334C1.52393 17.7493 1.67316 17.6001 1.85726 17.6001H2.7144C2.8985 17.6001 3.04774 17.7493 3.04774 17.9334V18.8668C3.04774 19.0509 2.8985 19.2001 2.7144 19.2001H1.85726C1.67316 19.2001 1.52393 19.0509 1.52393 18.8668V17.9334ZM1.85726 20.8001C1.67316 20.8001 1.52393 20.9493 1.52393 21.1334V22.0668C1.52393 22.2509 1.67316 22.4001 1.85726 22.4001H2.7144C2.8985 22.4001 3.04774 22.2509 3.04774 22.0668V21.1334C3.04774 20.9493 2.8985 20.8001 2.7144 20.8001H1.85726ZM3.04774 19.5334C3.04774 19.3493 3.19697 19.2001 3.38107 19.2001H4.23821C4.42231 19.2001 4.57154 19.3493 4.57154 19.5334V20.4668C4.57154 20.6509 4.42231 20.8001 4.23821 20.8001H3.38107C3.19697 20.8001 3.04774 20.6509 3.04774 20.4668V19.5334ZM3.38107 16.0001C3.19697 16.0001 3.04774 16.1493 3.04774 16.3334V17.2668C3.04774 17.4509 3.19697 17.6001 3.38107 17.6001H4.23821C4.42231 17.6001 4.57154 17.4509 4.57154 17.2668V16.3334C4.57154 16.1493 4.42231 16.0001 4.23821 16.0001H3.38107ZM3.04774 13.1334C3.04774 12.9493 3.19697 12.8001 3.38107 12.8001H4.23821C4.42231 12.8001 4.57154 12.9493 4.57154 13.1334V14.0668C4.57154 14.2509 4.42231 14.4001 4.23821 14.4001H3.38107C3.19697 14.4001 3.04774 14.2509 3.04774 14.0668V13.1334ZM3.38107 9.6001C3.19697 9.6001 3.04774 9.74934 3.04774 9.93343V10.8668C3.04774 11.0509 3.19697 11.2001 3.38107 11.2001H4.23821C4.42231 11.2001 4.57154 11.0509 4.57154 10.8668V9.93343C4.57154 9.74934 4.42231 9.6001 4.23821 9.6001H3.38107ZM3.04774 6.73343C3.04774 6.54934 3.19697 6.4001 3.38107 6.4001H4.23821C4.42231 6.4001 4.57154 6.54934 4.57154 6.73343V7.66676C4.57154 7.85086 4.42231 8.0001 4.23821 8.0001H3.38107C3.19697 8.0001 3.04774 7.85086 3.04774 7.66676V6.73343ZM3.38107 3.2001C3.19697 3.2001 3.04774 3.34934 3.04774 3.53343V4.46676C3.04774 4.65086 3.19697 4.8001 3.38107 4.8001H4.23821C4.42231 4.8001 4.57154 4.65086 4.57154 4.46676V3.53343C4.57154 3.34934 4.42231 3.2001 4.23821 3.2001H3.38107Z' fill='%23FFCD4B'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath id='clip0_6762_5474'%3e%3crect width='32' height='24' rx='4' fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",alt:""})})}},f,{error:!!r,FormHelperTextProps:{variant:"standard"},helperText:null==r?void 0:r.message}))}))})};var $t="data:image/svg+xml,%3csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M5.99995 8L9.99995 12L14 8H5.99995Z' fill='%236D7C8B'/%3e%3c/svg%3e";const zt=()=>l("img",{src:$t,alt:""});var jt=()=>{const e=Oe(),r=Te(e,Se),t=Te(e,we),n=Te(e,Ve),o=Te(e,Le),a=r=>e.current.setPage(r);return i($,{px:2,display:"flex",alignItems:"center",children:[l(Ee,{component:"div",page:r,count:n,rowsPerPage:o,rowsPerPageOptions:[10,20,50,100],onPageChange:(e,r)=>a(r),onRowsPerPageChange:r=>e.current.setPageSize(parseInt(r.target.value,10)),labelRowsPerPage:"Строк на странице",labelDisplayedRows:({from:e,to:r,count:t})=>`${e}–${r} из ${-1!==t?t:`более ${r}`}`,ActionsComponent:void 0,SelectProps:{IconComponent:zt}}),l(xe,{count:t,page:r+1,onChange:(e,r)=>a(r-1)})]})};var Bt=e=>{var{hideMenu:r,currentColumn:t,onUnsort:n}=e,i=a(e,["hideMenu","currentColumn","onUnsort"]);return l(ke,Object.assign({hideMenu:r,currentColumn:t},i,{children:l(Re,{onClick:r,column:t})}))};var Ht=({mode:e})=>{const[r,t]=ne(),n=+r.get("page")||0,l=+r.get("size")||10;return m((()=>{"server"===e&&(r.has("page")||r.set("page","0"),r.has("size")||r.set("size","10"),t(r,{replace:!0}))}),[e,r,t]),{page:n,size:l,onPageChange:e=>{r.set("page",`${e}`),t(r,{replace:!0})},onSizeChange:e=>{r.set("size",`${e}`),t(r,{replace:!0})}}};var _t=()=>{const[e,r]=ne(),t=e.getAll("sort").map((e=>e.split(",")));return{onColumnHeaderClick:({field:t,colDef:n})=>{if(n.sortable){let n=!1;const l=e.getAll("sort");e.delete("sort"),l.forEach((r=>{const[l,i]=r.split(",");l===t?(n=!0,"asc"===i&&e.append("sort",`${l},desc`)):e.append("sort",`${l},${i}`)})),n||e.append("sort",`${t},asc`),r(e,{replace:!0})}},getSortedColumns:e=>e.map((e=>{const r=t.find((r=>r[0]===e.field));return e.headerClassName=r?`Sorted --${r[1]} `:"",e}))}};var Wt=e=>{const[r,t]=h(10);m((()=>{t(e)}),[e]);return{pageSize:r,handlePageSizeChange:e=>t(e)}},Jt="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M3.47341 10.4087C3.3698 10.2747 3.32108 10.1063 3.33715 9.9377C3.35321 9.76909 3.43285 9.61291 3.55989 9.50088C3.68693 9.38886 3.85185 9.3294 4.02115 9.33457C4.19045 9.33974 4.35144 9.40915 4.47141 9.52872L8.00008 13.0574L11.5287 9.52872L11.5914 9.47338C11.7254 9.36978 11.8938 9.32106 12.0624 9.33712C12.231 9.35318 12.3872 9.43282 12.4992 9.55987C12.6113 9.68691 12.6707 9.85183 12.6656 10.0211C12.6604 10.1904 12.591 10.3514 12.4714 10.4714L8.47141 14.4714L8.40874 14.5267C8.28047 14.6262 8.12031 14.6755 7.95829 14.6653C7.79627 14.6551 7.64354 14.5862 7.52874 14.4714L3.52874 10.4714L3.47341 10.4087ZM12.5267 5.59138C12.6304 5.72538 12.6791 5.89379 12.663 6.0624C12.6469 6.23102 12.5673 6.3872 12.4403 6.49922C12.3132 6.61124 12.1483 6.67071 11.979 6.66554C11.8097 6.66037 11.6487 6.59095 11.5287 6.47138L8.00008 2.94272L4.47141 6.47138L4.40874 6.52672C4.27475 6.63032 4.10634 6.67905 3.93773 6.66298C3.76911 6.64692 3.61293 6.56728 3.50091 6.44024C3.38889 6.31319 3.32942 6.14827 3.33459 5.97897C3.33976 5.80967 3.40918 5.64869 3.52874 5.52872L7.52874 1.52872L7.59141 1.47338C7.71968 1.37388 7.87985 1.3246 8.04187 1.33479C8.20388 1.34498 8.35662 1.41393 8.47141 1.52872L12.4714 5.52872L12.5267 5.59138Z' fill='%23262842'/%3e%3c/svg%3e",Gt="data:image/svg+xml,%3c%3fxml version='1.0' encoding='utf-8'%3f%3e%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cg transform='matrix(1%2c 0%2c 0%2c 1%2c 0.05728%2c 0.935561)'%3e %3cpath d='M 3.473 9.409 C 3.37 9.275 3.321 9.106 3.337 8.938 C 3.353 8.769 3.433 8.613 3.56 8.501 C 3.687 8.389 3.852 8.329 4.021 8.335 C 4.19 8.34 4.351 8.409 4.471 8.529 L 8 12.057 L 11.529 8.529 L 11.591 8.473 C 11.725 8.37 11.894 8.321 12.062 8.337 C 12.231 8.353 12.387 8.433 12.499 8.56 C 12.611 8.687 12.671 8.852 12.666 9.021 C 12.66 9.19 12.591 9.351 12.471 9.471 L 8.471 13.471 L 8.409 13.527 C 8.28 13.626 8.12 13.676 7.958 13.665 C 7.796 13.655 7.644 13.586 7.529 13.471 L 3.529 9.471 L 3.473 9.409 Z' fill='%23262842' style='fill-opacity: 0.6%3b'/%3e %3cpath d='M 12.472 4.636 C 12.575 4.77 12.624 4.939 12.608 5.107 C 12.592 5.276 12.512 5.432 12.385 5.544 C 12.258 5.656 12.093 5.716 11.924 5.71 C 11.755 5.705 11.594 5.636 11.474 5.516 L 7.945 1.988 L 4.416 5.516 L 4.354 5.572 C 4.22 5.675 4.051 5.724 3.883 5.708 C 3.714 5.692 3.558 5.612 3.446 5.485 C 3.334 5.358 3.274 5.193 3.28 5.024 C 3.285 4.855 3.354 4.694 3.474 4.574 L 7.474 0.574 L 7.536 0.518 C 7.665 0.419 7.825 0.37 7.987 0.38 C 8.149 0.39 8.302 0.459 8.416 0.574 L 12.416 4.574 L 12.472 4.636 Z' fill='%23262842' style='fill-opacity: 1%3b'/%3e %3c/g%3e%3c/svg%3e",Yt="data:image/svg+xml,%3c%3fxml version='1.0' encoding='utf-8'%3f%3e%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cg transform='matrix(1%2c 0%2c 0%2c 1%2c 0.05728%2c 0.935561)'%3e %3cpath d='M 3.473 9.409 C 3.37 9.275 3.321 9.106 3.337 8.938 C 3.353 8.769 3.433 8.613 3.56 8.501 C 3.687 8.389 3.852 8.329 4.021 8.335 C 4.19 8.34 4.351 8.409 4.471 8.529 L 8 12.057 L 11.529 8.529 L 11.591 8.473 C 11.725 8.37 11.894 8.321 12.062 8.337 C 12.231 8.353 12.387 8.433 12.499 8.56 C 12.611 8.687 12.671 8.852 12.666 9.021 C 12.66 9.19 12.591 9.351 12.471 9.471 L 8.471 13.471 L 8.409 13.527 C 8.28 13.626 8.12 13.676 7.958 13.665 C 7.796 13.655 7.644 13.586 7.529 13.471 L 3.529 9.471 L 3.473 9.409 Z' fill='%23262842' style='fill-opacity: 1%3b'/%3e %3cpath d='M 12.472 4.636 C 12.575 4.77 12.624 4.939 12.608 5.107 C 12.592 5.276 12.512 5.432 12.385 5.544 C 12.258 5.656 12.093 5.716 11.924 5.71 C 11.755 5.705 11.594 5.636 11.474 5.516 L 7.945 1.988 L 4.416 5.516 L 4.354 5.572 C 4.22 5.675 4.051 5.724 3.883 5.708 C 3.714 5.692 3.558 5.612 3.446 5.485 C 3.334 5.358 3.274 5.193 3.28 5.024 C 3.285 4.855 3.354 4.694 3.474 4.574 L 7.474 0.574 L 7.536 0.518 C 7.665 0.419 7.825 0.37 7.987 0.38 C 8.149 0.39 8.302 0.459 8.416 0.574 L 12.416 4.574 L 12.472 4.636 Z' fill='%23262842' style='fill-opacity: 0.6%3b'/%3e %3c/g%3e%3c/svg%3e";const Zt=()=>l("img",{src:Jt,alt:""}),Kt=()=>l("img",{src:Gt,alt:""}),Ut=()=>l("img",{src:Yt,alt:""}),Xt=e=>{var{columns:r,rows:t,rowCount:n,loading:i,disableMargin:o,mode:s="server",initialPageSize:d=10,pagination:c=!0,onCellClick:u}=e,p=a(e,["columns","rows","rowCount","loading","disableMargin","mode","initialPageSize","pagination","onCellClick"]);const{page:m,size:h,onPageChange:f,onSizeChange:g}=Ht({mode:s}),{onColumnHeaderClick:v,getSortedColumns:y}=_t(),{pageSize:b,handlePageSizeChange:C}=Wt(d),x={sortingMode:s,paginationMode:s,pageSize:"server"===s?h:c?b:n,onPageSizeChange:"server"===s?g:C,components:{BaseTooltip:Q,Pagination:jt,ColumnUnsortedIcon:e=>(a(e,["sortingOrder"]),l(Zt,{})),ColumnSortedDescendingIcon:e=>(a(e,["sortingOrder"]),l(Ut,{})),ColumnSortedAscendingIcon:e=>(a(e,["sortingOrder"]),l(Kt,{}))}};return"server"===s&&(x.onColumnHeaderClick=v,x.page=m,x.onPageChange=f,x.components.ColumnMenu=Bt),l($,{mt:o?0:2,children:l(Me,Object.assign({autoHeight:!0,hideFooterPagination:!c,hideFooter:!c,disableSelectionOnClick:!0,loading:i,rows:t,disableColumnMenu:!0,columns:y(r),rowCount:n,rowsPerPageOptions:[10,20,50,100],onCellClick:u},x,p))})},Qt=({icon:e,label:r,showInMenu:t,onClick:n,location:i})=>{var o;return i?l(M,{component:te,to:i.pathname,state:null!==(o=i.state)&&void 0!==o?o:null,size:"small",children:l(Q,{title:r,arrow:!0,children:u.cloneElement(e,{fontSize:"small"})})}):l(Ne,{nonce:"",onResize:void 0,onResizeCapture:void 0,icon:l(Q,{title:r,arrow:!0,children:e}),onClick:n,label:r,showInMenu:t})};var en=()=>{const[e,r]=ne(),t=g((()=>{var r;return null!==(r=e.get("page"))&&void 0!==r?r:0}),[e]),n=g((()=>{var r;return null!==(r=e.get("size"))&&void 0!==r?r:10}),[e]),l=f((e=>{r((r=>(r.set("page",`${e}`),r)))}),[r]),i=f((e=>{r((r=>(r.set("size",`${e}`),r)))}),[r]);return m((()=>{e.has("page")||r((e=>(e.set("page","0"),e))),e.has("size")||r((e=>(e.set("size","10"),e)))}),[e,r]),{page:t,size:n,onPageChange:l,onSizeChange:i}};var rn=()=>{const[e,r]=ne(),t=g((()=>e.getAll("sort").map((e=>e.split(",")))),[e]),n=f((e=>{r((r=>{r.delete("sort");let n=!1;return t.forEach((([t,l])=>{t===e?(n=!0,"asc"===l&&r.append("sort",`${t},desc`)):r.append("sort",`${t},${l}`)})),n||r.append("sort",`${e},asc`),r}))}),[t,r]),l=f((e=>{const r=t.find((([r,t])=>r===e));return!!r&&r[1]}),[t]);return{sortParams:t,onSortChanged:n,getColumnSorting:l}};const tn=t(je)((({active:e})=>({".MuiSvgIcon-root":{opacity:e?1:.5,marginTop:"4%"}}))),nn=()=>l("img",{src:$t,alt:""}),ln=()=>l("img",{src:Jt,alt:""}),on=()=>l("img",{src:Gt,alt:""}),an=()=>l("img",{src:Yt,alt:""});function sn({columns:e=[],rows:r=[],totalCount:t,children:n,pagination:o=!0,loading:a=!1,onRowClick:s,emptyDataText:d,verticalAlign:c="middle",labelRowsPerPage:u},p){const{page:m,size:h,onPageChange:f,onSizeChange:g}=en(),{onSortChanged:v,getColumnSorting:y}=rn();return l($,{sx:{overflow:"auto"},children:i(Pe,{sx:{width:"100%",display:"table",tableLayout:"fixed"},children:[l(ze,{open:a,sx:{position:"absolute",top:0,left:0},children:l(Lr,{})}),i(Ie,{ref:p,children:[l(Ae,{children:l(qe,{children:e.map(((e,r)=>{const t=!!e.sortKey&&y(e.sortKey);return l(De,{align:e.align?e.align:"left",sortDirection:t,sx:{width:e.width?`${e.width}%`:"unset"},children:l(tn,{active:!!t,hideSortIcon:!e.sortKey,direction:t||"asc",IconComponent:"asc"===t?on:"desc"===t?an:ln,onClick:()=>e.sortKey?v(e.sortKey):{},children:e.label})},r)}))})}),l(Fe,{children:r.length?r.map(((r,t)=>l(qe,{hover:!0,onClick:s?()=>s(r):r.onClick,sx:{verticalAlign:c},children:e.map(((e,n)=>l(De,{align:e.align?e.align:"left",sx:{maxWidth:e.width?`${e.width}%`:"unset"},children:l($,{sx:{maxWidth:"90%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",padding:({spacing:e})=>e(2.4,0)},children:l($,{children:e.renderCell?e.renderCell(r,t):r[e.id]})})},n)))},t))):l(qe,{sx:{verticalAlign:c},children:l(De,{align:"center",colSpan:e.length,children:null!=d?d:"Нет данных"})})}),o||n?l($e,{children:i(qe,{children:[n&&l(De,{colSpan:e.length,sx:{background:"#F0F0F7",px:4,py:3},children:n}),o&&r.length?l(Ee,{rowsPerPageOptions:[5,10,25],count:t,rowsPerPage:+h,page:+m,sx:{borderBottom:"none"},labelRowsPerPage:u,labelDisplayedRows:u?({from:e,to:r,count:t})=>`${e}–${r} из ${-1!==t?t:`более ${r}`}`:void 0,SelectProps:{IconComponent:nn},onPageChange:(e,r)=>f(r),onRowsPerPageChange:e=>g(+e.target.value)}):null]})}):null]})]})})}const dn=y(sn),cn=({actionsList:e})=>{const[r,t]=h(null),n=Boolean(r),o=()=>{t(null)};return i("div",{children:[l(M,{"aria-label":"more",id:"more-button","aria-controls":n?"more-menu":void 0,"aria-expanded":n?"true":void 0,"aria-haspopup":"true",onClick:e=>{e.stopPropagation(),t(e.currentTarget)},children:l(He,{})}),l(Be,{id:"more-menu",MenuListProps:{"aria-labelledby":"more-button"},anchorEl:r,open:n,onClose:e=>{e.stopPropagation(),o()},PaperProps:{style:{minWidth:"127px"}},children:e.map((e=>l(c,{onClick:r=>{r.stopPropagation(),e.onClick&&e.onClick(),o()},children:e.title},e.title)))})]})},un=e=>{const{children:r,value:t,index:n}=e,i=a(e,["children","value","index"]);return l("div",Object.assign({role:"tabpanel",hidden:t!==n,id:`simple-tabpanel-${n}`,"aria-labelledby":`simple-tab-${n}`},i,{children:t===n?r:null}))},pn=e=>{var r;const{tabs:t}=e,n=ee(),o=re(),a=g((()=>new URLSearchParams(o.search)),[o.search]),s=a.get("tab");return i($,{children:[l(_e,{children:l(Je,{value:s||(null===(r=t[0])||void 0===r?void 0:r.name),indicatorColor:"primary",textColor:"primary",onChange:(e,r)=>{a.set("tab",r),n({pathname:o.pathname,search:a.toString()},{replace:!0})},children:t.map((e=>l(We,{value:e.name,label:e.label},e.name)))})}),l($,{mt:2,children:t.map((e=>{var r;return l(un,{value:s||(null===(r=t[0])||void 0===r?void 0:r.name),index:e.name,children:e.component},e.name)}))})]})},mn=({title:e,text:r,json:t})=>i($,{sx:{paddingBottom:8},children:[l($,{sx:{fontSize:"14px",fontWeight:600,color:"#536DFE"},children:e}),r&&l($,{sx:{fontSize:"18px",wordWrap:"break-word"},children:r}),t&&l(tt,{value:t,height:300})]}),hn=Object.values(Vr).sort(((e,r)=>e.localeCompare(r)));var fn=({propertyFieldName:e,control:r})=>i(o,{children:[l(ve,{children:l(Lt,{required:!0,control:r,defaultValue:2,name:`${e}.precisionScale`,label:"Precision Scale"})}),l(ve,{children:l($r,{required:!0,control:r,name:`${e}.roundingMode`,label:"Rounding Mode",defaultValue:Vr.HALF_UP,options:hn})})]});var gn=({propertyFieldName:e,control:r,defaultValue:t=""})=>l(ve,{children:l(Fr,{required:!0,control:r,defaultValue:t,name:`${e}.format`,label:"Format"})});const vn=()=>l("div",{style:{display:"inline-block",width:"10px",height:"10px",borderRadius:"50%",backgroundColor:"#536DFE",marginTop:"5px"}}),yn=({data:e})=>i(Qe,{nonLinear:!0,orientation:"vertical",connector:l(nr,{sx:{marginLeft:4}}),sx:{width:"100%"},children:[e.filter(Boolean).map(((e,r)=>i(er,{expanded:!0,children:[l(rr,{sx:{display:"flex",alignItems:"flex-start"},StepIconComponent:vn,StepIconProps:{icon:"",completed:!1,active:!0},children:e.label}),l(tr,{sx:{marginLeft:4},children:e.content})]},r))),l(er,{})]}),bn=({properties:e=[]})=>{const r=g((()=>e?e.map((e=>{const r="string"==typeof e.propertyType?e.propertyType:e.propertyType?e.propertyType.value:"";return{label:i($,{display:"flex",flexDirection:"column",children:[i("b",{children:[e.name,e.isRequired?"*":""]}),i("span",{children:[e.key," | ",e.isMultiple?"multiple":"single"," |"," ",r]})]}),content:"ENTITY"===e.propertyType&&l(bn,{properties:e.properties})}})):[]),[e]);return l(yn,{data:r})};var Cn=bn;const xn={key:"",propertyType:null,name:"",defaultValue:"",value:"",defaultValues:[],isRequired:!0,isMultiple:!1,sortOrder:0,isEnabled:!0,executeValue:"",uiSettings:""};var En=({control:e,parentPropertyFieldName:r,entityDefinition:t=!1,globalParameter:n=!1,entityReferenceDefinitionSources:a,entityReferenceValueComponent:d,fileReferenceValueComponent:c})=>{const u=p(null),{field:{onChange:m}}=T({control:e,name:`${r}.properties`}),g=S({control:e,name:`${r}.properties`,defaultValue:[]}),v=S({control:e,name:`${r}.name`}),{append:y,remove:b}=L({control:e,name:`${r}.properties`}),C=Pr(),[x,E]=h(0),O=f((()=>{if((null==g?void 0:g.length)>0){y(xn);const e=g.length;E(e)}else y(xn);u.current.addProperty()}),[g,y]),w=()=>s(void 0,void 0,void 0,(function*(){m(u.current.getProperties()),C.onClose()}));return i(o,{children:[l(ve,{children:l(z,{variant:"h6",children:"Properties"})}),l(ve,{children:l(Cn,{properties:g})}),l(ve,{children:l(I,{variant:"contained",color:"primary",onClick:C.onOpen,children:"Edit properties"})}),i(F,{disableEscapeKeyDown:!0,open:C.open,onClose:w,fullWidth:!0,maxWidth:"md",children:[i(q,{children:[v||"Entity"," Properties"]}),l(P,{style:{height:"500px",overflow:"hidden"},children:i(ve,{container:!0,direction:"row",spacing:2,style:{height:"100%"},children:[i(ve,{xs:3,style:{backgroundColor:"#f9f9f9",height:"100%",overflowY:"auto"},children:[l(Qe,{nonLinear:!0,activeStep:x,orientation:"vertical",style:{paddingLeft:"4px"},children:g.map(((e,r)=>i(er,{onClick:()=>(e=>E(e))(r),style:{cursor:"pointer"},children:[l(rr,{StepIconProps:{icon:""},style:{wordBreak:"break-word"},children:e.name||"(no name)"}),l(tr,{})]},r)))}),l(I,{variant:"contained",size:"small",color:"primary",onClick:O,children:"Add property"})]}),l(ve,{container:!0,wrap:"nowrap",direction:"column",spacing:2,style:{height:"100%",overflowY:"auto",width:"75%"},children:l(Un,{ref:u,properties:g,hideAddButton:!0,parentRemove:b,focusOnIndex:x,entityDefinition:t,globalParameter:n,entityReferenceDefinitionSources:a,entityReferenceValueComponent:d,fileReferenceValueComponent:c})})]})}),l(D,{children:l(I,{variant:"contained",color:"primary",onClick:w,children:"Ok"})})]})]})};var On=({propertyFieldName:e,control:r,sources:t=[{label:"Arsenal Entities",value:"ARSENAL_ENTITIES"}]})=>i(o,{children:[l(ve,{children:l($r,{required:!0,control:r,name:`${e}.source`,label:"Source",options:t})}),l(ve,{children:l(Fr,{required:!0,control:r,name:`${e}.definitionCode`,label:"Definition Code"})}),l(ve,{children:l(Fr,{required:!0,control:r,name:`${e}.definitionVersion`,label:"Definition Version",defaultValue:1})}),l(ve,{children:l(Fr,{required:!0,control:r,name:`${e}.labelPropertyCode`,label:"Label Property Code"})}),l(ve,{children:l(Fr,{required:!0,control:r,name:`${e}.valuePropertyCode`,label:"Value Property Code"})})]});const Tn=({control:e,propertyType:r,propertyFieldName:t,entityDefinition:n=!1,globalParameter:i=!1,entityReferenceDefinitionSources:o,entityReferenceValueComponent:a,fileReferenceValueComponent:s})=>{switch(r){case Or.STRING:return l(Pt,{name:`${t}.restrictedValues`,control:e,label:"Restricted Values"});case Or.BIG_DECIMAL:return l(fn,{propertyFieldName:t,control:e});case Or.DATE:return l(gn,{control:e,propertyFieldName:t,defaultValue:Tr});case Or.TIME:return l(gn,{control:e,propertyFieldName:t,defaultValue:Sr});case Or.DATE_TIME:return l(gn,{control:e,propertyFieldName:t,defaultValue:wr});case Or.ENTITY_REFERENCE:return l(On,{control:e,propertyFieldName:t,sources:o});case Or.ENTITY:return l(En,{control:e,parentPropertyFieldName:t,globalParameter:i,entityDefinition:n,entityReferenceDefinitionSources:o,entityReferenceValueComponent:a,fileReferenceValueComponent:s});default:return null}};var Sn=({control:e,name:r,label:t,required:n,restrictedValues:o,requiredErrorText:a="",requiredSelectErrorText:s=""})=>{const{field:{onChange:d,ref:u},fieldState:{error:p}}=T({control:e,name:r,rules:{required:!!n&&(Array.isArray(o)&&o.length?s||"Please, select a value":a||Nr)}}),m=S({control:e,name:r});return Array.isArray(o)&&o.length?i(B,{fullWidth:!0,size:"small",variant:"outlined",error:!!p,children:[l(ar,{htmlFor:"type-select",children:t}),l(or,{labelId:"type-select",label:t,value:m||"",onChange:d,ref:u,children:o.map((e=>l(c,{value:e,children:e},e)))})]}):l(Fr,{hideErrorMessage:!0,required:n,control:e,name:r,label:t})};var wn=({name:e})=>{const{control:r,setValue:t,register:n}=w(),a=S({control:r,name:e}),d=f((r=>s(void 0,void 0,void 0,(function*(){const n=r.target.files[0];(new FileReader).readAsDataURL(n);const l=yield(e=>new Promise(((r,t)=>{const n=new FileReader;n.readAsDataURL(e),n.onload=()=>{r(n.result)},n.onerror=e=>{t(e)}})))(n);t(e,l)}))),[e,t]);return i(o,{children:[i($,{mb:2,display:"flex",flex:"row",children:[l(z,{children:"Does file uploaded:"}),l(R,a?{sx:{paddingLeft:2},children:l("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}:{sx:{paddingLeft:2},children:l("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z"})})]}),i(I,{component:"label",variant:"contained",size:"large",color:"primary",sx:{marginTop:4},children:[a?"Change file":"Upload file",l("input",Object.assign({type:"hidden"},n(`${e}`,{required:!0}))),l("input",{type:"file",hidden:!0,onChange:d})]})]})};const Vn=({property:e,name:r,label:t,useExpression:n,control:i,entityReferenceDefinitionSources:o,entityReferenceValueComponent:a,fileReferenceValueComponent:s})=>{var d;switch("string"==typeof e.propertyType?e.propertyType:null===(d=e.propertyType)||void 0===d?void 0:d.value){case Or.BIG_DECIMAL:case Or.FLOAT:case Or.DOUBLE:return l(Lt,{required:!0,decimal:!0,hideErrorMessage:!0,control:i,name:r,label:t,valueAsNumber:!0});case Or.INTEGER:case Or.BIG_INTEGER:case Or.LONG:return l(Lt,{required:!0,hideErrorMessage:!0,control:i,name:r,label:t,valueAsNumber:!0});case Or.BOOLEAN:return l(kt,{control:i,name:r});case Or.DATE:return l(Nt,{hideErrorMessage:!0,control:i,name:r,label:t,format:e.format});case Or.TIME:return l(Dt,{hideErrorMessage:!0,control:i,name:r,label:t,format:e.format});case Or.DATE_TIME:return l(Ft,{hideErrorMessage:!0,control:i,name:r,label:t,format:e.format});case Or.JSON:return l(Yr,{control:i,name:r,label:t,parseValue:!0,hideErrorMessage:!0,validateJson:!0});case Or.STRING:return l(Sn,{control:i,name:r,label:t,restrictedValues:e.restrictedValues});case Or.ENTITY_REFERENCE:return a?l(a,{name:r,property:e}):l(Sn,{name:r,label:t,control:i});case Or.FILE:return l(wn,{name:r});case Or.FILE_REFERENCE:return s?l(s,{name:r}):l(Sn,{name:r,label:t,control:i});case Or.ANY:return l(Yr,{control:i,name:r,hideErrorMessage:!0,label:t});case Or.ENTITY:return l(ul,{properties:e.properties,dataFieldName:r,useExpression:n,entityReferenceDefinitionSources:o,entityReferenceValueComponent:a,fileReferenceValueComponent:s});default:return l("div",{children:"No widget"})}};var Ln=({value:e,property:r,label:t,isDirty:n,required:l=!1,useExpression:i=!1,multipleOptions:o=!1})=>{const a=g((()=>t?`${t} (value)`:`${r.name} (value)`),[t,r]),s=g((()=>t?`${t} (widget)`:`${r.name} (widget)`),[t,r]),d=g((()=>{var e;return"string"==typeof r.propertyType?r.propertyType:null===(e=r.propertyType)||void 0===e?void 0:e.value}),[r]),[c,u]=h(null),p=g((()=>o?St({propertyType:d,required:l,useExpression:i}):wt({propertyType:d,required:l,useExpression:i})),[i,l,d,o]),v=g((()=>{switch(d){case Or.STRING:case Or.DATE:case Or.TIME:case Or.DATE_TIME:case Or.ENTITY_REFERENCE:case Or.ANY:case Or.FILE:case Or.FILE_REFERENCE:return"";case Or.JSON:return{};case Or.BOOLEAN:return!1;case Or.INTEGER:case Or.BIG_DECIMAL:case Or.BIG_INTEGER:case Or.DOUBLE:case Or.LONG:case Or.FLOAT:return 0;default:return null}}),[d]),y=g((()=>d===Or.JSON||d===Or.ANY),[d]),b=f((()=>{ft(e,y)?u("expression"):null==e||ft(e,y)||"widget"===c||"string"===c||u("widget")}),[e,c,y]);return m((()=>{c?n||b():!yt(e)||r.isRequired||null!==r.defaultValue&&null!==r.value?i&&ft(e,y)?u("expression"):u("widget"):u("null")}),[e,c,p,i,n,b,y,l,r]),{propertyType:d,valueLabel:a,fillOptionLabel:s,fillOption:c,fillOptions:p,setFillOption:u,defaultProperyValue:v,checkFillOption:b}};const kn=t(ar)((()=>({inputLabel:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",width:"100%"}}))),Rn=({control:e,property:r,name:t,useExpression:n,label:o,required:a,title:s,entityReferenceDefinitionSources:d,entityReferenceValueComponent:u,fileReferenceValueComponent:h,requiredErrorText:g=""})=>{const{field:{value:v,onChange:y},fieldState:{error:b,isDirty:C}}=T({name:t,control:e,defaultValue:r.defaultValue,rules:{validate:e=>!a||null!==e||(g||Nr)}}),x=p({}),{propertyType:E,valueLabel:O,fillOptionLabel:S,fillOption:w,fillOptions:V,setFillOption:L,defaultProperyValue:k}=Ln({value:v,property:r,isDirty:C,label:o,required:a,useExpression:n}),R=f((e=>{const t=e.target.value;x.current=Object.assign(Object.assign({},x.current),{[w]:v}),L(t);const n=x.current[t];if("null"===t)y(null,{shouldDirty:!0});else if("widget"===t)if(E===Or.JSON&&v&&"string"!=typeof v&&"dem_builder"===w&&"properties"in v){const e=Object.assign(Object.assign({},v),{properties:xt(v.property||[])});try{y(null!=n?n:JSON.stringify(e,null,"\t"))}catch(e){console.log("Stringify failed",e)}}else y(null!=n?n:r.defaultValue||k);else if("expression"===t||"string"===t)y(null!=n?n:"",{shouldDirty:!0});else if("dem_builder"===t){const e={code:"",name:"",version:0,properties:[]};if(v)try{const e=JSON.parse(v);e.properties=Et(e.properties||{}),y(null!=n?n:e,{shouldDirty:!0})}catch(r){y(null!=n?n:e,{shouldDirty:!0})}else y(null!=n?n:e,{shouldDirty:!0})}}),[k,v,L,w,E,y,r]);return m((()=>{C||!r.defaultValue&&!r.value||v||y(r.defaultValue||r.value)}),[C,r,y,v]),m((()=>{var e;(void 0===v||r.isRequired&&null===v&&!r.defaultValue&&!r.value)&&y(null!==(e=x.current[w])&&void 0!==e?e:k)}),[v,y,k,r,w]),i(ve,{xs:12,children:[s&&l($,{mb:2,children:l(z,{variant:"h6",children:s})}),V?l($,{mb:2,children:i(B,{fullWidth:!0,size:"small",variant:"outlined",children:[l(kn,{htmlFor:"type-select",children:S}),l(or,{labelId:"type-select",label:S,value:w||"",onChange:R,children:V.map((e=>l(c,{value:e.value,children:e.label},e.value)))})]})}):null,"expression"===w&&(E===Or.JSON||E===Or.ENTITY||E===Or.ANY?l(Yr,{name:t,control:e,label:O,parseValue:!0,validateJson:!0,hideErrorMessage:!0}):l(Fr,{control:e,name:t,label:O,hideErrorMessage:!0})),"string"===w&&l(Fr,{control:e,name:t,label:O,hideErrorMessage:!0}),"json_notvalid"===w&&l(Yr,{name:t,control:e,label:O,hideErrorMessage:!0}),"widget"===w&&l(Vn,{control:e,property:r,name:t,useExpression:n,label:O,entityReferenceDefinitionSources:d,entityReferenceValueComponent:u,fileReferenceValueComponent:h}),"dem_builder"===w&&l(el,{control:e,title:"JSON",definitionFieldName:t,entityReferenceDefinitionSources:d,entityReferenceValueComponent:u,fileReferenceValueComponent:h}),b&&l(_,{error:!0,children:b.message})]})};var Mn=({control:e,name:r,property:t,useExpression:n,required:o,label:a,entityReferenceDefinitionSources:s,entityReferenceValueComponent:d,fileReferenceValueComponent:c})=>{const{fields:u,append:p,remove:m}=L({control:e,name:r});return i(ve,{container:!0,spacing:2,direction:"column",xs:12,children:[Array.isArray(u)&&u.length?u.map(((u,p)=>l(ve,{xs:12,children:i($,{display:"flex",alignItems:"flex-start",width:"100%",p:2,style:{backgroundColor:"#f1f1f1"},children:[l(Rn,{control:e,required:o,property:t,useExpression:n,name:`${r}.${p}`,label:`${a||t.name} (${p+1})`,entityReferenceDefinitionSources:s,entityReferenceValueComponent:d,fileReferenceValueComponent:c}),l($,{mt:"8px",ml:"4px",children:l(M,{id:"close-button",size:"small",onClick:()=>m(p),children:l(R,{fontSize:"small",children:l("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})})})})]})},u.id))):null,l(ve,{children:l(I,{variant:"contained",size:"small",color:"primary",onClick:()=>p(null),children:"Add value"})})]})};const Nn=({control:e,property:r,name:t,useExpression:n,required:o,label:a,title:s,entityReferenceDefinitionSources:d,entityReferenceValueComponent:u,fileReferenceValueComponent:f,requiredErrorText:g=""})=>{var v;const[y,b]=h(!1),{field:{value:C,onChange:x},fieldState:{error:E,isDirty:O}}=T({control:e,name:t,defaultValue:null!==(v=r.defaultValue)&&void 0!==v?v:[],rules:{validate:e=>!(o&&!e)||(g||Nr)}}),S=p({}),{propertyType:w,valueLabel:V,fillOptionLabel:L,fillOption:k,fillOptions:R,setFillOption:M,checkFillOption:N}=Ln({property:r,value:C,isDirty:O,label:a,required:o,useExpression:n,multipleOptions:!0});return m((()=>{C||x(r.isRequired&&r.isMultiple?[]:null)}),[C,r,x]),m((()=>{C&&!y&&(b(!0),N())}),[N,y,C]),i(ve,{children:[s&&l($,{mb:2,children:l(z,{variant:"h6",children:s})}),R?l($,{mb:2,children:i(B,{fullWidth:!0,size:"small",variant:"outlined",children:[l(kn,{htmlFor:"type-select",children:L}),l(or,{labelId:"type-select",label:L,value:k||"",onChange:e=>{b(!0),S.current=Object.assign(Object.assign({},S.current),{[k]:C});const r=e.target.value,t=S.current[r];"null"===r?x(null):"expression"===r||"json_valid"===r||"json_notvalid"===r?x(null!=t?t:"",{shouldDirty:!0}):"widget"===r&&x(null!=t?t:[],{shouldDirty:!0}),M(r)},children:R.map((e=>l(c,{value:e.value,children:e.label},e.value)))})]})}):null,"expression"===k&&(w===Or.JSON||w===Or.ENTITY||w===Or.ANY?l(Yr,{name:t,control:e,label:V,parseValue:!0,validateJson:!0,hideErrorMessage:!0}):l(Fr,{required:!0,hideErrorMessage:!0,control:e,name:t,label:V})),"json_valid"===k&&l(Yr,{name:t,control:e,label:V,parseValue:!0,validateJson:!0,hideErrorMessage:!0}),"widget"===k&&l(Mn,{control:e,property:r,name:t,useExpression:n,required:o,label:a,entityReferenceDefinitionSources:d,entityReferenceValueComponent:u,fileReferenceValueComponent:f}),E&&l(_,{error:!0,children:E.message})]})},In=({control:e,propertyFieldName:r,name:t,label:n="",required:i,entityReferenceDefinitionSources:o,entityReferenceValueComponent:a,fileReferenceValueComponent:s})=>{const d=S({control:e,name:`${r}.propertyType`}),c=S({control:e,name:`${r}.isMultiple`}),u=S({control:e,name:`${r}.format`}),p=S({control:e,name:`${r}.restrictedValues`}),m=S({control:e,name:`${r}.properties`}),h=S({control:e,name:`${r}.isRequired`}),f=g((()=>Object.assign(Object.assign(Object.assign(Object.assign({name:n,isRequired:null!=i?i:h,isMultiple:c},!!u&&{format:u}),{restrictedValues:p}),!!m&&{properties:m}),{propertyType:"string"==typeof d?d:d.value,defaultValue:null,defaultValues:[],sortOrder:0,isEnabled:!0,uiSettings:null,validationNode:null})),[d,u,p,c,n,h,m,i]);return l(ir,{dateAdapter:lr,children:l(c?Nn:Rn,{control:e,name:t,property:f,title:n,required:i,entityReferenceDefinitionSources:o,entityReferenceValueComponent:a,fileReferenceValueComponent:s})})};var Fn=({name:e})=>{const r=g((()=>({type:""})),[]),{control:t}=w(),{fields:n,append:o,remove:a}=L({control:t,name:e});return i($,{mt:2,children:[l(I,{variant:"outlined",size:"small",onClick:()=>o(r),children:"Add node"}),n.map((({id:r},t)=>l(Hn,{removeHandle:()=>a(t),name:`${e}.${t}`},r)))]})};const Dn=b(""),Pn=({name:e,control:r})=>i(o,{children:[l(z,{variant:"body2",gutterBottom:!0,children:"Node"}),l($,{children:l(Fr,{control:r,name:`${e}.minimumLength`,label:"Minimum Length",type:"number"})}),l($,{mt:2,children:l(Fr,{control:r,name:`${e}.maximumLength`,label:"Maximum Length",type:"number"})})]}),An=({name:e,control:r})=>i(o,{children:[l(z,{variant:"body2",gutterBottom:!0,children:"Node"}),l($,{children:l(Fr,{control:r,name:`${e}.multipleOf`,label:"Multiple Of",type:"number"})}),l($,{mt:2,children:l(Fr,{control:r,name:`${e}.minimum`,label:"Minimum",type:"number"})}),l($,{mt:2,children:l(Fr,{control:r,name:`${e}.maximum`,label:"Maximum",type:"number"})}),i($,{mt:2,children:[l(zr,{control:r,name:`${e}.exclusiveMinimum`,label:"Exclusive Minimum"}),l(zr,{control:r,name:`${e}.exclusiveMaximum`,label:"Exclusive Maximum"})]})]}),qn=["STRING_REGEX","JSON_SCHEMA"],$n=new Set([Or.INTEGER,Or.FLOAT,Or.DOUBLE,Or.BIG_DECIMAL,Or.BIG_INTEGER,Or.LONG]);var zn=({name:e})=>{const{control:r,setValue:t}=w(),n=C(Dn),a=S({control:r,name:`${e}.type`}),s=g((()=>{if("STRING_REGEX"===a)return l(Fr,{control:r,name:`${e}.pattern`,label:"Pattern"});if("JSON_SCHEMA"===a)switch(!0){case n===Or.STRING:return l(Pn,{name:`${e}.node`,control:r});case $n.has(n):return l(An,{name:`${e}.node`,control:r});case n===Or.JSON:return l(Yr,{label:"Properties",control:r,name:`${e}.properties`,validateJson:!0,parseValue:!0});default:return"Not available for type "+n}return null}),[n,a,r,e]);return m((()=>{$n.has(n)&&"JSON_SCHEMA"===a&&(t(`${e}.node.exclusiveMinimum`,!1),t(`${e}.node.exclusiveMaximum`,!1))}),[n,a,t,e]),l(yn,{data:[{label:"Validator",content:i(o,{children:[l($,{children:l($r,{control:r,name:`${e}.type`,label:"Type",options:qn,onChange:r=>{t(e,{}),t(`${e}.type`,r.target.value)}})}),l($,{mt:2,children:s})]})}]})};const jn=["AND","OR","NOT","NODE"],Bn=({name:e,removeHandle:r})=>{const{control:t}=w(),n=S({control:t,name:`${e}.type`}),a=g((()=>({AND:l(Fn,{name:`${e}.nodes`}),OR:l(Fn,{name:`${e}.nodes`}),NODE:l(zn,{name:`${e}.validator`}),NOT:l(Bn,{name:`${e}.node`})})),[e]);return l(yn,{data:[{label:"Node Type",content:i(o,{children:[i($,{display:"flex",alignItems:"flex-end",children:[l($r,{required:!0,control:t,name:`${e}.type`,label:"Type",options:jn}),r&&l($,{ml:2,children:l(M,{onClick:r,color:"primary",children:l(Xe,{})})})]}),l($,{children:a[n]})]})}]})};var Hn=Bn;const _n=({name:e})=>{const[r,t]=h(!1),{setValue:n,getValues:a}=w(),s=f((r=>{t(r.target.checked),r.target.checked||n(e,null)}),[n,e]);return m((()=>{a(e)&&t(!0)}),[e,a]),i(o,{children:[i($,{display:"flex",justifyContent:"space-between",children:[l(z,{variant:"h6",children:"Validator"}),l(H,{label:"Enable",control:l(W,{color:"primary",checked:r,onChange:s})})]}),r&&l(Hn,{name:e})]})};var Wn=({name:e,label:r="",propertyFieldName:t,type:n,decimal:i=!1,options:o=[],required:a=!1})=>{const{control:s}=w(),d=g((()=>`${t}.${e}`),[e,t]);switch(n){case"text":return l(Fr,{control:s,name:d,label:r,required:a});case"number":return l(Lt,{control:s,name:d,label:r,decimal:i,required:a});case"select":return l($r,{control:s,name:d,label:r,options:o,required:a});case"autocomplete":return l(Hr,{control:s,name:d,label:r,options:o,required:a});case"json":return l(Yr,{control:s,name:d,label:r,mode:"json",required:a});default:return null}};var Jn=e=>({customCheckboxes:g((()=>e.length?e.filter((e=>"checkbox"===e.type)):[]),[e]),customFields:g((()=>e.length?e.filter((e=>"checkbox"!==e.type)):[]),[e])});const Gn=Object.values(Or).sort(((e,r)=>e.localeCompare(r))).map((e=>({value:e,label:e.replace("_"," ").toLowerCase().replace(/(^\w)|([-\s]\w)/g,(e=>e.toUpperCase()))}))),Yn=x((({setValue:e,control:r,propertyFieldName:t,entityDefinition:n=!1,globalParameter:a=!1,customPropertyFields:s=[],entityReferenceDefinitionSources:d,entityReferenceValueComponent:c,fileReferenceValueComponent:u})=>{var p;const h=S({control:r,name:`${t}.propertyType`}),f=S({control:r,name:`${t}.isMultiple`}),v=S({control:r,name:`${t}.isRequired`}),{customCheckboxes:y,customFields:b}=Jn(s),C=g((()=>{let e=a?"Value":"Default Value";return f&&(e+="s"),e}),[a,f]);return m((()=>{h&&"string"==typeof h&&e(`${t}.propertyType`,Gn.find((e=>e.value===h)))}),[h,e,t]),i(ve,{container:!0,direction:"column",spacing:2,children:[l(ve,{children:l(Fr,{required:!0,control:r,name:`${t}.key`,label:"Key"})}),l(ve,{children:l(Fr,{required:!0,control:r,name:`${t}.name`,label:"Name"})}),l(ve,{children:l(Hr,{required:!0,control:r,name:`${t}.propertyType`,label:"Type",options:Gn,onChange:(r,n)=>{const l=`${t}.propertyType`,i=`${t}.${a?"value":"defaultValue"}`;e(i,f?[]:null),e(l,n)}})}),l(ve,{children:l(Lt,{required:!0,control:r,name:`${t}.sortOrder`,label:"Sort Order"})}),l(ve,{children:l(Yr,{control:r,name:`${t}.uiSettings`,label:"UI Settings",validateJson:!0,parseValue:!0})}),i(ve,{children:[l(zr,{control:r,name:`${t}.isMultiple`,label:"Multiple"}),l(zr,{control:r,name:`${t}.isEnabled`,label:"Enabled"}),l(zr,{control:r,name:`${t}.isRequired`,label:"Required"}),n&&l(zr,{control:r,name:`${t}.isViewableInList`,label:"Is viewable in list"}),y.length?l(o,{children:y.map(((e,n)=>l(zr,{control:r,name:`${t}.${e.name}`,label:e.label,checked:e.checked,defaultValue:e.defaultValue},n)))}):null]}),h&&i(o,{children:[l(ve,{children:l(Dn.Provider,{value:null!==(p=h.value)&&void 0!==p?p:h,children:l(_n,{name:`${t}.validationNode`})})}),l(Tn,{control:r,propertyType:"string"==typeof h?h:h.value,propertyFieldName:t,globalParameter:a,entityDefinition:n,entityReferenceDefinitionSources:d,entityReferenceValueComponent:c,fileReferenceValueComponent:u}),l(In,{control:r,propertyFieldName:t,name:`${t}.${a?"value":"defaultValue"}`,label:C,required:!!a&&v,entityReferenceDefinitionSources:d,entityReferenceValueComponent:c,fileReferenceValueComponent:u})]}),b.length?l(o,{children:b.map(((e,r)=>l(ve,{children:l(Wn,Object.assign({},e,{propertyFieldName:t}))},r)))}):null]})}));var Zn=({entityDefinition:e,globalParameter:r,customPropertyFields:t,index:n,arrLength:o,entityReferenceDefinitionSources:a,entityReferenceValueComponent:s,control:d,setValue:c,fileReferenceValueComponent:u,handleRemoveParameter:p,error:m,item:f,extRefs:g})=>{const[v,y]=h(n===o&&!f.key);return l(ve,{sm:12,ref:e=>g.current[n]=e,children:i(Ge,{expanded:v,onChange:()=>y(!v),elevation:3,children:[l(Ye,{expandIcon:l(Ue,{}),children:l(z,{color:m&&m[n]?"secondary":"initial",style:{wordBreak:"break-word"},children:f.name||`Property ${n+1}`})}),l(Ze,{children:v&&l(Yn,{control:d,setValue:c,propertyFieldName:`properties.${n}`,entityDefinition:e,globalParameter:r,customPropertyFields:t,entityReferenceDefinitionSources:a,entityReferenceValueComponent:s,fileReferenceValueComponent:u})}),l(Ke,{children:l(I,{variant:"contained",size:"small",color:"secondary",onClick:()=>p(n),children:"Remove"})})]})})};const Kn={key:"",propertyType:null,name:"",defaultValue:"",defaultValues:[],isRequired:!0,isMultiple:!1,sortOrder:0,isEnabled:!0,executeValue:"",uiSettings:""},Un=y((({properties:e,parentFieldName:r,hideAddButton:t,focusOnIndex:n,required:a,entityDefinition:s=!1,globalParameter:d=!1,customPropertyFields:c=[],parentRemove:u,entityReferenceDefinitionSources:h,entityReferenceValueComponent:g,fileReferenceValueComponent:v},y)=>{var b;const{clearErrors:C,control:x,setValue:O,getValues:S,reset:w,trigger:V,watch:R}=k({mode:"all",defaultValues:{properties:e}}),{fields:M,append:N,remove:F}=L({control:x,name:"properties"}),{fieldState:{error:D}}=T({control:x,name:"properties",rules:{validate:e=>!a||!Array.isArray(e)||0!==e.length||"Please, fill the properties"}}),P=p([]),A=f((()=>{N(Kn),C("properties")}),[N,C]),q=f((e=>{u&&u(e),F(e)}),[u,F]);return m((()=>{"number"==typeof n&&P.current[n]&&P.current[n].scrollIntoView({behavior:"smooth",block:"start"})}),[n,P]),m((()=>{var r;e.length&&!(null===(r=S("properties"))||void 0===r?void 0:r.length)&&w({properties:e})}),[e,S,w]),E(y,(()=>({getProperties:()=>S("properties"),addProperty:A,removeProperty:q,trigger:V})),[S,A,q,V]),i(o,{children:[D&&D.message&&l(ve,{sm:12,children:l(z,{color:"secondary",children:D.message})}),Array.isArray(M)&&M.map(((e,r,t)=>l(Zn,{item:e,index:r,arrLength:t.length-1,control:x,setValue:O,customPropertyFields:c,entityDefinition:s,globalParameter:d,error:D,handleRemoveParameter:q,fileReferenceValueComponent:v,entityReferenceValueComponent:g,entityReferenceDefinitionSources:h,extRefs:P},e.id))),!t&&i(ve,{xs:12,children:[l(I,{variant:"contained",size:"small",color:"primary",onClick:A,children:"Add property"}),D&&l(_,{error:!0,children:null===(b=D.root)||void 0===b?void 0:b.message})]})]})})),Xn={key:"",propertyType:null,name:"",defaultValue:"",defaultValues:[],isRequired:!0,isMultiple:!1,sortOrder:0,isEnabled:!0,executeValue:"",uiSettings:""},Qn=({control:e,parentFieldName:r,hideAddButton:t,focusOnIndex:n,required:a,entityDefinition:s=!1,globalParameter:d=!1,customPropertyFields:c=[],parentRemove:u,entityReferenceDefinitionSources:h,entityReferenceValueComponent:v,fileReferenceValueComponent:y})=>{var b;const C=g((()=>r?`${r}.properties`:"properties"),[r]),{clearErrors:x,setValue:E}=w(),{fields:O,append:S,remove:V}=L({control:e,name:C}),{fieldState:{error:k}}=T({control:e,name:C,rules:{validate:e=>!a||!Array.isArray(e)||0!==e.length||"Please, fill the properties"}}),R=p([]),M=f((()=>{S(Xn),x("properties")}),[S,x]),N=f((e=>{u&&u(e),V(e)}),[u,V]);return m((()=>{"number"==typeof n&&R.current[n]&&R.current[n].scrollIntoView({behavior:"smooth",block:"start"})}),[n,R]),i(o,{children:[k&&k.message&&l(ve,{sm:12,children:l(z,{color:"secondary",children:k.message})}),Array.isArray(O)&&O.map(((r,t,n)=>l(ve,{sm:12,ref:e=>R.current[t]=e,children:i(Ge,{defaultExpanded:t===n.length-1&&!r.key,elevation:3,children:[l(Ye,{expandIcon:l(Ue,{}),children:l(z,{color:k&&k[t]?"secondary":"initial",style:{wordBreak:"break-word"},children:r.name||`Property ${t+1}`})}),l(Ze,{children:l(Yn,{control:e,setValue:E,propertyFieldName:`${C}.${t}`,entityDefinition:s,globalParameter:d,customPropertyFields:c,entityReferenceDefinitionSources:h,entityReferenceValueComponent:v,fileReferenceValueComponent:y})}),l(Ke,{children:l(I,{variant:"contained",size:"small",color:"secondary",onClick:()=>N(t),children:"Remove"})})]})},r.id))),!t&&i(ve,{xs:12,children:[l(I,{variant:"contained",size:"small",color:"primary",onClick:M,children:"Add property"}),k&&l(_,{error:!0,children:null===(b=k.root)||void 0===b?void 0:b.message})]})]})},el=y((({control:e,definitionFieldName:r,title:t,hideCodeField:n,hideVersionField:o,hideNameField:a,required:s=!1,entityReferenceDefinitionSources:d,entityReferenceValueComponent:c,fileReferenceValueComponent:u},p)=>{const{control:m,getValues:h}=w(),f=h(`${r}.properties`);return i(ve,{container:!0,direction:"column",spacing:2,children:[t&&l(ve,{sm:12,children:l($,{my:2,children:l(z,{variant:"h6",children:t})})}),!a&&l(ve,{sm:12,children:l(Fr,{required:!0,control:null!=e?e:m,name:r?`${r}.name`:"name",label:"Name"})}),!n&&l(ve,{sm:12,children:l(Fr,{required:!0,control:null!=e?e:m,name:r?`${r}.code`:"code",label:"Code"})}),!o&&l(ve,{sm:12,children:l(Lt,{required:!0,control:null!=e?e:m,name:r?`${r}.version`:"version",label:"Version"})}),p?l(Un,{ref:p,properties:f,required:s,parentFieldName:r,entityReferenceDefinitionSources:d,entityReferenceValueComponent:c,fileReferenceValueComponent:u}):l(Qn,{control:e,required:s,parentFieldName:r,entityReferenceDefinitionSources:d,entityReferenceValueComponent:c,fileReferenceValueComponent:u})]})})),rl={name:"Name",key:"Key",propertyType:"Property Type",defaultValue:"Default Value",defaultValues:"Default Values",sortOrder:"Sort Order",isRequired:"Required",isMultiple:"Multiple",isEnabled:"Enabled",isViewableInList:"Is Viewable In List",precisionScale:"Precision Scale",roundingMode:"Rounding Mode",format:"Format",definitionCode:"Definition Code",definitionVersion:"Definition Version",labelPropertyCode:"Label Property Code",valuePropertyCode:"Value Property Code",restrictedValues:"Restricted Values",value:"Value",values:"Values",uiSettings:"UI Settings",validationNode:"Validation Node"},tl=({value:e,type:r})=>r!==Or.JSON&&r!==Or.ENTITY&&r!==Or.ANY||!e?l(z,{variant:"subtitle1",display:"inline",style:{wordBreak:"break-word"},children:null===e?"null":e.toString()}):l(tt,{value:e}),nl=(e,r,t)=>{switch(r){case"isRequired":case"isMultiple":case"isEnabled":case"isViewableInList":return e?l(R,{color:"primary",fontSize:"small",children:l("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}):null;case"restrictedValues":return e?l($,{display:"flex",flexWrap:"wrap",children:e.map((e=>l(ge,{label:e,style:{wordBreak:"break-word",maxWidth:"500px"}},e)))}):null;case"defaultValue":case"value":return l(tl,{value:e,type:t});case"values":case"defaultValues":return Array.isArray(e)&&t!==Or.ENTITY&&t!==Or.JSON&&t!==Or.ANY?i("div",{children:["[",null==e?void 0:e.map(((e,r)=>l("div",{children:l(tl,{value:e,type:t})},r))),"]"]}):l(tt,{value:e});case"uiSettings":case"validationNode":return e?l(tt,{value:e}):null;default:return l(z,{variant:"subtitle1",display:"inline",style:{wordBreak:"break-word"},children:e})}};var ll=({property:e})=>{const r=g((()=>(e&&(e.isMultiple?(delete e.defaultValue,delete e.value):(delete e.defaultValues,delete e.values)),e)),[e]);return l(Ie,{size:"small",children:l(Fe,{children:Object.keys(rl).map((e=>e in r?i(qe,{children:[l(De,{width:"30%",children:l(z,{children:rl[e]})}),l(De,{children:nl(r[e],e,r.propertyType)})]},e):null))})})};var il=x((({properties:e,parentNames:r=[]})=>{const t=g((()=>{let r=!1;return e.every((e=>e.propertyType!==Or.ENTITY||(r=!0,!1))),r}),[e]);return i($,{mt:4,children:[l(z,{variant:"h6",children:"Properties"}),i(Qe,{orientation:"vertical",style:{paddingLeft:"4px"},children:[e.map((e=>i(er,{expanded:!0,children:[l(rr,{StepIconProps:{icon:"",completed:!1,active:!0}}),l(tr,{children:l(ol,{property:e,parentNames:[...r],defaultExpanded:!1})})]},e.key))),t&&l(er,{})]})]})}));const ol=({property:e,parentNames:r=[],defaultExpanded:t=!0})=>{const[n,o]=h(!0);return m((()=>{o(t)}),[t]),i(Ge,{elevation:3,style:{backgroundColor:r.length%2==1?"#f1f1f1":"#fff"},expanded:n,onChange:()=>o((e=>!e)),children:[l(Ye,{expandIcon:l(R,{children:l("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),children:l(z,{style:{wordBreak:"break-word",fontWeight:"600"},children:e.name})}),l(Ze,{children:i($,{width:"100%",children:[l(ll,{property:e}),e.propertyType===Or.ENTITY&&l(il,{properties:Et(e.properties),parentNames:[...r,e.name]})]})})]})},al=({properties:e,expandAll:r=!0})=>{const t=g((()=>Array.isArray(e)?e:e?Et(e):[]),[e]);return l($,{display:"flex",flexDirection:"column",children:t.length?t.map((e=>l(ol,{property:e,defaultExpanded:r},e.key))):l(z,{children:"No properties"})})},sl=({property:e,name:r,useExpression:t,label:n,required:o,title:a,entityReferenceDefinitionSources:s,entityReferenceValueComponent:d,fileReferenceValueComponent:u,requiredErrorText:h=""})=>{const{control:g,clearErrors:v,setValue:y}=w(),{field:{value:b},fieldState:{error:C,isDirty:x}}=T({name:r,control:g,rules:{validate:e=>!o||null!==e||(h||Nr)}}),E=p({}),{propertyType:O,valueLabel:S,fillOptionLabel:V,fillOption:L,fillOptions:k,setFillOption:R,defaultProperyValue:M}=Ln({value:b,property:e,isDirty:x,label:n,required:o,useExpression:t}),N=f((t=>{const n=t.target.value;E.current=Object.assign(Object.assign({},E.current),{[L]:b}),R(n);const l=E.current[n];if("null"===n)y(r,null,{shouldDirty:!0});else if("widget"===n)if(O===Or.JSON&&b&&"string"!=typeof b&&"dem_builder"===L&&"properties"in b){const e=Object.assign(Object.assign({},b),{properties:xt(b.property||[])});try{y(r,null!=l?l:JSON.stringify(e,null,"\t"))}catch(e){console.log("Stringify failed",e)}}else y(r,null!=l?l:e.defaultValue||M);else if("expression"===n||"string"===n)y(r,null!=l?l:"",{shouldDirty:!0});else if("dem_builder"===n){const e={code:"",name:"",version:0,properties:[]};if(b)try{const e=JSON.parse(b);e.properties=Et(e.properties||{}),y(r,null!=l?l:e,{shouldDirty:!0})}catch(t){y(r,null!=l?l:e,{shouldDirty:!0})}else y(r,null!=l?l:e,{shouldDirty:!0})}v()}),[r,v,b,R,L,O,e,y,M]);return m((()=>{var t;!x&&yt(b)&&(!e.isRequired||null!==e.defaultValue&&null!==e.value?e.isRequired||null!==e.defaultValue&&null!==e.value?yt(e.defaultValue)&&yt(e.value)||y(r,e.defaultValue||e.value):y(r,null):y(r,null!==(t=E.current[L])&&void 0!==t?t:M,{shouldDirty:!0}))}),[b,e,r,L,x,y,M]),i(ve,{xs:12,children:[a&&l($,{mb:2,children:l(z,{variant:"h6",children:a})}),k?l($,{mb:2,children:i(B,{fullWidth:!0,size:"small",variant:"outlined",children:[l(kn,{htmlFor:"type-select",children:V}),l(or,{labelId:"type-select",label:V,value:L||"",onChange:N,children:k.map((e=>l(c,{value:e.value,children:e.label},e.value)))})]})}):null,"expression"===L&&(O===Or.JSON||O===Or.ENTITY||O===Or.ANY?l(Yr,{name:r,control:g,label:S,parseValue:!0,hideErrorMessage:!0,useCleanValue:!0,mode:O===Or.ANY?"text":"json"}):l(Fr,{control:g,name:r,label:S,hideErrorMessage:!0})),"string"===L&&l(Fr,{control:g,name:r,label:S,hideErrorMessage:!0}),"json_notvalid"===L&&l(Yr,{name:r,control:g,label:S,hideErrorMessage:!0}),"widget"===L&&l(Vn,{control:g,property:e,name:r,useExpression:t,label:S,entityReferenceDefinitionSources:s,entityReferenceValueComponent:d,fileReferenceValueComponent:u}),"dem_builder"===L&&l(el,{title:"JSON",definitionFieldName:r,entityReferenceDefinitionSources:s,entityReferenceValueComponent:d,fileReferenceValueComponent:u}),C&&l(_,{error:!0,children:C.message})]})};var dl=({name:e,property:r,useExpression:t,required:n,label:o,entityReferenceDefinitionSources:a,entityReferenceValueComponent:s,fileReferenceValueComponent:d})=>{const{control:c,setValue:u,clearErrors:p}=w(),m=S({control:c,name:e}),h=f((()=>{m&&Array.isArray(m)?u(`${e}.${m.length}`,null):u(e,[]),p(e)}),[e,m,u,p]),g=f((r=>{u(e,Zr(m,r))}),[e,m,u]);return i(ve,{container:!0,spacing:2,direction:"column",xs:12,children:[Array.isArray(m)&&m.length?m.map(((c,u)=>l(ve,{xs:12,children:i($,{display:"flex",alignItems:"flex-start",width:"100%",p:2,style:{backgroundColor:"#f1f1f1"},children:[l(sl,{required:n,property:r,useExpression:t,name:`${e}.${u}`,label:`${o||r.name} (${u+1})`,entityReferenceDefinitionSources:a,entityReferenceValueComponent:s,fileReferenceValueComponent:d}),l($,{mt:"8px",ml:"4px",children:l(M,{id:"close-button",size:"small",onClick:()=>g(u),children:l(R,{fontSize:"small",children:l("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})})})})]})},u))):null,l(ve,{children:l(I,{variant:"contained",size:"small",color:"primary",onClick:h,children:"Add value"})})]})};const cl=({property:e,name:r,useExpression:t,required:n,label:o,title:a,entityReferenceDefinitionSources:s,entityReferenceValueComponent:d,fileReferenceValueComponent:u,requiredErrorText:f=""})=>{var g;const[v,y]=h(!1),{control:b,clearErrors:C,setValue:x,watch:E}=w(),{field:{ref:O,onChange:S},fieldState:{error:V,isDirty:L}}=T({control:b,name:r,defaultValue:null!==(g=e.defaultValue)&&void 0!==g?g:[],rules:{validate:e=>!(n&&!e)||(f||Nr)}}),k=E(r),R=p({}),{propertyType:M,valueLabel:N,fillOptionLabel:I,fillOption:F,fillOptions:D,setFillOption:P,checkFillOption:A}=Ln({property:e,value:k,isDirty:L,label:o,required:n,useExpression:t,multipleOptions:!0});return m((()=>{k||S(e.isRequired&&e.isMultiple?[]:null)}),[k,e,S]),m((()=>{k&&!v&&(y(!0),A())}),[A,v,k]),i(ve,{children:[a&&l($,{mb:2,children:l(z,{variant:"h6",children:a})}),D?l($,{mb:2,children:i(B,{fullWidth:!0,size:"small",variant:"outlined",children:[l(kn,{htmlFor:"type-select",children:I}),l(or,{labelId:"type-select",label:I,value:F||"",onChange:e=>{y(!0),R.current=Object.assign(Object.assign({},R.current),{[F]:k});const t=e.target.value,n=R.current[t];"null"===t?x(r,null):"expression"===t||"json_valid"===t||"json_notvalid"===t?x(r,null!=n?n:"",{shouldDirty:!0}):"widget"===t&&x(r,null!=n?n:[],{shouldDirty:!0}),P(t),C(r)},children:D.map((e=>l(c,{value:e.value,children:e.label},e.value)))})]})}):null,"expression"===F&&(M===Or.JSON||M===Or.ENTITY||M===Or.ANY?l(Yr,{name:r,control:b,label:N,parseValue:!0,hideErrorMessage:!0,useCleanValue:!0,mode:M===Or.ANY?"text":"json"}):l(Fr,{required:!0,hideErrorMessage:!0,control:b,name:r,label:N})),"json_valid"===F&&l(Yr,{name:r,control:b,label:N,parseValue:!0,validateJson:!0,hideErrorMessage:!0}),"widget"===F&&l(dl,{property:e,name:r,useExpression:t,required:n,label:o,entityReferenceDefinitionSources:s,entityReferenceValueComponent:d,fileReferenceValueComponent:u}),V&&l(_,{error:!0,children:V.message})]})},ul=({properties:e,dataFieldName:r,useExpression:t=!1,title:n,entityReferenceDefinitionSources:o,entityReferenceValueComponent:a,fileReferenceValueComponent:s})=>{const d=g((()=>e?e.map((e=>{var n;const d="string"==typeof e.propertyType?e.propertyType:null===(n=e.propertyType)||void 0===n?void 0:n.value;return{label:i($,{display:"flex",flexDirection:"column",children:[i("b",{children:[e.name,e.isRequired?"*":""]}),i("span",{children:[e.key," | ",e.isMultiple?"multiple":"single"," |"," ",d]})]}),content:e.isMultiple?l(cl,{property:e,name:`${r}.${e.key}`,useExpression:t,label:e.name,required:e.isRequired,entityReferenceValueComponent:a,fileReferenceValueComponent:s,entityReferenceDefinitionSources:o}):l(sl,{property:e,name:`${r}.${e.key}`,useExpression:t,label:e.name,required:e.isRequired,entityReferenceDefinitionSources:o,entityReferenceValueComponent:a,fileReferenceValueComponent:s})}})):[]),[e,r,t,a,o,s]);return l(ir,{dateAdapter:lr,children:i(ve,{container:!0,direction:"column",spacing:2,children:[n&&l(ve,{xs:12,children:l("div",{style:{fontWeight:"600"},children:n})}),l(yn,{data:d})]})})};var pl=({property:e,data:r})=>{const{name:t}=e,n=f(((e,r)=>{const t=e,n=document.createElement("a");document.body.appendChild(n),n.href=t,n.target="_self",n.download=r,n.click()}),[]);return l(I,{component:"label",variant:"contained",size:"large",color:"primary",onClick:()=>n(r,t),children:"Download File"})};const ml=({property:e,data:r,properties:t})=>{const n=e=>l($,{style:{backgroundColor:"#fff",border:"1px solid #ccc",borderRadius:"4px",padding:"4px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:null===e?"null":e.toString()});switch(e.propertyType){case Or.JSON:return l(tt,{value:r});case Or.ENTITY:return l(fl,{properties:t,data:r});case Or.ANY:return"object"==typeof r?l(tt,{value:r}):n(r);case Or.FILE_REFERENCE:return null===r?n(r):l(I,{component:te,color:"primary",variant:"contained",target:"_blank",to:r,sx:{marginTop:4},children:"Download via link"});case Or.FILE:return null===r?n(r):l(pl,{data:r,property:e});default:return n(r)}};var hl=({property:e,data:r,hasBackground:t=!1})=>{const n=g((()=>e.propertyType===Or.ENTITY?Array.isArray(e.properties)?e.properties:Et(e.properties):[]),[e]);return l($,{style:{backgroundColor:t?"#f1f1f1":"none"},children:l(ml,{property:e,data:r,properties:n})})};const fl=({properties:e,data:r})=>{const t=g((()=>e&&r?e.map((e=>{const{key:t,name:n,isMultiple:a,propertyType:s}=e,d=r[e.key]?r[e.key]:null;return{label:i($,{display:"flex",flexDirection:"column",children:[l("b",{children:n}),i("span",{children:[t," | ",a?"multiple":"single"," | ",s]})]}),content:a&&Array.isArray(d)&&e.propertyType!==Or.ANY?l(o,{children:d.map(((r,t)=>l($,{mb:2,children:l(hl,{property:e,data:r,hasBackground:!0})},t)))}):l(hl,{property:e,data:d})}})):[]),[e,r]);return l(ve,{container:!0,direction:"column",spacing:2,children:l(yn,{data:t})})},gl=t($)((({theme:e})=>({backgroundColor:"#eee",fontSize:"14px",padding:"0 8px",borderRadius:"10px",width:"fit-content","&.success":{backgroundColor:"#a9dfa9"},"&.error":{backgroundColor:"#ff7e7e"},"&.warning":{backgroundColor:e.palette.warning.main}}))),vl=({text:e,status:r="default"})=>l(gl,{className:sr("root",{[r]:!0}),children:e}),yl=({properties:e,parentKey:r="",activePath:t="",prefix:n="",onClick:o})=>l(Qe,{orientation:"vertical",onClick:e=>e.stopPropagation(),children:e&&e.map((e=>{var a;const s=r?`${r}.${e.key}`:e.key,d=null!==(a=e.propertyType.value)&&void 0!==a?a:e.propertyType;return i(er,{expanded:!0,onClick:()=>{return e=s,void o(n?`${n}.${e}`:e);var e},children:[l(rr,{StepIconProps:{icon:"",completed:!1,active:t===s},children:i($,{sx:{propertyStepLabel:{"&:hover":{fontWeight:"600",cursor:"pointer"}}},children:[e.name," - ",e.key," - ",d]})}),l(tr,{children:l("div",{children:d===Or.ENTITY&&l(yl,{onClick:o,activePath:t,properties:e.properties,parentKey:s},e.key)})})]},e.key)}))});var bl=yl;const Cl=({open:e=!1,onClose:r,onPaste:t,properties:n})=>{const[o,a]=h("");return i(F,{open:e,onClose:r,fullWidth:!0,maxWidth:"md",children:[l(q,{children:"JSON path picker"}),i(P,{children:[(null==n?void 0:n.length)?n.map(((e,r)=>i("div",{children:[l(z,{variant:"h6",children:e.title}),l(bl,{properties:e.properties,prefix:e.pathPrefix,onClick:a,activePath:o})]},r))):l(z,{children:"Please, add properties"}),o&&i(z,{variant:"h6",gutterBottom:!0,children:["Selected path : $(",o,")"]})]}),i(D,{children:[l(I,{variant:"contained",color:"primary",onClick:()=>{navigator.clipboard.writeText(`$(${o})`),dr.success("Copied!")},children:"Copy"}),l(I,{variant:"contained",color:"primary",onClick:()=>{t(`$(${o})`),dr.success("Pasted!")},children:"Paste"}),l(I,{variant:"contained",color:"secondary",onClick:r,children:"Close"})]})]})},xl=b({collapsed:!1,toggleCollapse:()=>{console.log("collapse toggle")}}),El=()=>C(xl),Ol=({children:e})=>{const[r,t]=h("true"===localStorage.getItem("sidebar_collapsed")),n=f((()=>{t(!r),localStorage.setItem("sidebar_collapsed",`${!r}`),window.dispatchEvent(new CustomEvent("sidebar_collapsed",{detail:{collapsed:!r}}))}),[r]),i=f(((e,r)=>{localStorage.setItem(`${e.toLowerCase()}_collapsed`,`${!r}`)}),[]);return l(xl.Provider,{value:{collapsed:r,toggleCollapse:n,toggleRootElementLink:i},children:e})},Tl=t("div")({position:"relative","&:hover":{".button-collapse":{opacity:1}}}),Sl=t(ur)((e=>({width:248,flexShrink:0,position:"relative",transition:"all 0.3s ease-in-out","& .MuiDrawer-paper":{backgroundColor:e.theme.palette.secondary.main,width:248,boxSizing:"border-box",borderRight:"none",borderRadius:0,transition:"all 0.3s ease-in-out",overflow:"hidden"},"&.collapsed":{width:70,"& .MuiDrawer-paper":{width:70}}}))),wl=t(yr)((({theme:e})=>({backgroundColor:"#fff",borderRight:"1px solid rgba(38, 40, 66, 0.08)",position:"relative","& span":{paddingLeft:10,paddingTop:5,fontSize:24,fontWeight:600,transition:".3s ease .1s",whiteSpace:"nowrap"},"&:after":{transition:"opacity .3s",content:"attr(data-title)",fontSize:30,position:"absolute",left:"50%",transform:"translate3d(-50%, 0, 0)",opacity:0,visibility:"hidden"},"&.collapsed":{justifyContent:"center","& img":{width:40},"& span":{opacity:0,visibility:"hidden",transitionDelay:"0s"},"&:after":{opacity:1,visibility:"visible",transitionDelay:".1s"}}}))),Vl=t(pr)((e=>({padding:e.theme.spacing(3),margin:0}))),Ll=t(mr)((e=>({color:"#fff",height:e.theme.spacing(11),overflow:"hidden"}))),kl=t(fr)((({theme:e})=>({borderRadius:e.spacing(2.5),padding:e.spacing(2),height:e.spacing(11),alignItems:"center","&.active":{backgroundColor:"rgba(38, 40, 66, 0.12)","&.main":{backgroundColor:"rgba(255, 255, 255, 0.12)",borderLeft:"4px solid #E0613A"}},"&:hover":{backgroundColor:"rgba(255, 255, 255, 0.08)"},"&.collapsed":{width:e.spacing(11.5),"&.active":{"&.main":{border:"none",backgroundColor:"#E0613A"}}}}))),Rl=t(hr)((({theme:e})=>({color:"#fff",minWidth:20,marginRight:e.spacing(2),"& svg":{marginLeft:2,fill:"#fff",color:"#fff"}}))),Ml=t(gr)((({theme:e})=>({textTransform:"uppercase",borderRadius:e.spacing(2.5),backgroundColor:e.palette.secondary.main,color:"#fff",paddingLeft:0,paddingRight:0,position:"relative","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.08)"},"&.collapsed":{fontSize:24,textAlign:"center",fontWeight:"bold",paddingRight:0}}))),Nl=t(vr)((({theme:e})=>({width:"100%",marginLeft:e.spacing(2),alignItems:"center","& > *":{overflow:"hidden",textOverflow:"ellipsis",wordBreak:"break-all",whiteSpace:"nowrap"}}))),Il=t(pr)((e=>({margin:0,padding:0,"& .MuiListItemText-root:not(.main)":{paddingLeft:e.theme.spacing(8.5)}}))),Fl=t(br)((e=>({position:"absolute",top:e.theme.spacing(10),left:"calc(100% - 16px)",width:e.theme.spacing(8),height:e.theme.spacing(8),border:"1px solid #E0E3EA",borderRadius:"50%",boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.12)",backgroundColor:"#fff",zIndex:8e3,opacity:0,transition:"all 0.3s ease-in-out","&.collapsed":{img:{transition:"all 0.3s ease-in-out",transform:"rotate(180deg)"}}})));var Dl=({route:e,isActive:r,isSubmenu:t})=>{const{collapsed:n}=El(),[a,s]=u.useState(null),d=Boolean(a),c=e=>{s(e.currentTarget)},p=()=>{s(null)},m=f((({children:r})=>n&&!t?l(Q,{title:e.name,placement:"right",children:r}):r),[n,e,t]);return e.link?l(Ll,{disablePadding:!0,component:te,replace:!0,to:{pathname:e.link,search:e.query},children:l(m,{children:i(kl,{className:sr({active:r,main:e.main,collapsed:n}),children:[e.icon&&l(Rl,{className:sr({collapsed:n}),children:e.icon}),l(Nl,{primary:e.name,primaryTypographyProps:{variant:"body2"},className:sr({collapsed:n,main:e.main}),sx:n&&!t?{display:"none"}:{}})]})})}):e.children&&n?i(o,{children:[l(Ml,{className:"collapsed",children:l(Q,{title:e.name,placement:"right",children:l(kl,{className:sr({active:r,main:e.main,collapsed:n}),sx:{justifyContent:"center"},onClick:c,children:e.name.substring(0,1)})})}),l(Be,{open:d,anchorEl:a,onClose:p,PaperProps:{sx:{width:300,maxHeight:440}},MenuListProps:{sx:{bgcolor:"secondary.main"}},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:e.children.map(((e,r)=>l(zl,{route:e,isSubmenu:!0},r)))})]}):l(Ml,{children:e.name})},Pl="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg opacity='0.6'%3e%3cpath d='M10.3533 2.81334C10.447 2.90709 10.4996 3.03417 10.4996 3.16667C10.4996 3.29917 10.447 3.42626 10.3533 3.52001L5.87334 8.00001L10.3533 12.48C10.4025 12.5258 10.4419 12.581 10.4692 12.6423C10.4965 12.7036 10.5112 12.7699 10.5124 12.837C10.5136 12.9041 10.5012 12.9708 10.4761 13.0331C10.4509 13.0953 10.4135 13.1519 10.366 13.1994C10.3186 13.2468 10.262 13.2843 10.1997 13.3094C10.1375 13.3346 10.0708 13.3469 10.0037 13.3457C9.93652 13.3446 9.87032 13.3299 9.80898 13.3025C9.74765 13.2752 9.69245 13.2358 9.64667 13.1867L4.81334 8.35334C4.71971 8.25959 4.66711 8.13251 4.66711 8.00001C4.66711 7.86751 4.71971 7.74042 4.81334 7.64667L9.64667 2.81334C9.74042 2.71971 9.86751 2.66711 10 2.66711C10.1325 2.66711 10.2596 2.71971 10.3533 2.81334Z' fill='white'/%3e%3c/g%3e%3c/svg%3e";var Al=({route:e,isActive:r,isListOpen:t,handleClick:n,isSubmenu:o})=>l(Ml,{children:l(Vl,{sx:{padding:0,margin:0},children:l(Ll,{disablePadding:!0,onClick:n,children:i(kl,{className:sr({active:r,main:e.main}),sx:{justifyContent:"space-between"},children:[l(Nl,{primary:e.name,className:sr({main:e.main}),sx:o?{}:{display:"none"}}),e.name,l($,{component:"img",src:Pl,mr:3,sx:{transition:"transform .3s",transform:`rotate(${t?0:"-90deg"})`}})]})})})});function ql({route:e,isActive:r,isListOpen:t,handleClick:n,isSubmenu:o}){const{collapsed:a}=El();return(null==e?void 0:e.link)?l(Ll,{disablePadding:!0,onClick:n,children:i(kl,{className:sr({active:r,main:e.main,collapsed:a}),children:[e.icon&&l(Rl,{children:e.icon}),l(Nl,{primary:e.name,primaryTypographyProps:{variant:"body2"},className:sr({collapsed:a,main:e.main}),sx:a&&!o?{display:"none"}:{}}),l($,{component:"img",src:Pl,mr:3,sx:{transition:"transform .3s",transform:`rotate(${t?"-90deg":0})`}})]})}):(null==e?void 0:e.rootLink)?l(Al,{route:e,handleClick:n,isListOpen:t}):l(Ml,{children:e.name})}const $l=({route:e,isSubmenu:r})=>{var t,n,a;const s=re(),{collapsed:d,toggleRootElementLink:c}=El(),[u,p]=h(!1),[v,y]=h("true"===localStorage.getItem(`${e.name.toLowerCase()}_collapsed`)),b=g((()=>!(!e.link&&!e.rootLink)&&s.pathname.startsWith(e.link||e.rootLink)),[s.pathname,e]),C=f((()=>{e&&e.rootLink&&(c(e.name,v),y(!v))}),[v,e,c]);return m((()=>{p(b)}),[b]),(null==e?void 0:e.rootLink)&&(null===(t=e.children)||void 0===t?void 0:t.length)&&(!d||d&&r)?i(o,{children:[l(ql,{route:e,isActive:b,handleClick:C,isListOpen:v,isSubmenu:r}),l(Cr,{in:!v,timeout:"auto",children:l(Il,{children:e.children.map((e=>l($l,{route:e,isSubmenu:r},e.name)))})})]}):(null===(n=e.children)||void 0===n?void 0:n.length)&&(!d||d&&r)?i(o,{children:[l(ql,{route:e,isActive:b,handleClick:()=>{p(!u)},isListOpen:u||!e.link,isSubmenu:r}),l(Cr,{in:u||!e.link,timeout:"auto",children:l(Il,{children:null===(a=e.children)||void 0===a?void 0:a.map(((e,t)=>l($l,{route:e,isSubmenu:r},e.name)))})})]}):l(Dl,{route:e,isActive:b,isSubmenu:r})};var zl=$l;const jl=({src:e,alt:r})=>l($,{sx:{width:20,height:20,display:"flex",justifyContent:"center",alignItems:"center"},children:l("img",{src:e,alt:r})});var Bl=({title:e,routes:r,id:t,logo:n,collapsedLogo:o,footer:a,collapsedFooter:s})=>{const{collapsed:d,toggleCollapse:c}=El();return i(Tl,{children:[l(Fl,{className:sr("button-collapse",{collapsed:d}),onClick:c,children:l("img",{src:"data:image/svg+xml,%3csvg width='7' height='12' viewBox='0 0 7 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6.47054 0.861939C6.59552 0.986958 6.66573 1.1565 6.66573 1.33327C6.66573 1.51005 6.59552 1.67959 6.47054 1.80461L2.27521 5.99994L6.47054 10.1953C6.59198 10.321 6.65917 10.4894 6.65766 10.6642C6.65614 10.839 6.58602 11.0062 6.46242 11.1298C6.33881 11.2534 6.1716 11.3235 5.99681 11.3251C5.82201 11.3266 5.65361 11.2594 5.52787 11.1379L0.861207 6.47127C0.736226 6.34625 0.666016 6.17672 0.666016 5.99994C0.666016 5.82316 0.736226 5.65362 0.861207 5.52861L5.52787 0.861939C5.65289 0.736958 5.82243 0.666748 5.99921 0.666748C6.17598 0.666748 6.34552 0.736958 6.47054 0.861939V0.861939Z' fill='%238B8C9E'/%3e%3c/svg%3e",alt:"collapse"})}),i(Sl,{variant:"permanent",anchor:"left",className:sr({collapsed:d}),id:t,children:[(!!e||!!n)&&l(wl,{className:sr({collapsed:d}),"data-title":e.substring(0,1),children:i($,{display:"flex",flexDirection:"column",children:[!!e&&l($,{component:"span",children:e}),!!n&&l($,{component:"img",src:d?o:n,alt:"Lending Hub KZ"})]})}),i($,{height:""+(n||e?"calc(100vh - 56px)":"auto"),display:"flex",flexDirection:"column",justifyContent:"space-between",children:[l(Vl,{sx:{overflowY:"auto","&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-thumb":{background:"rgba(196, 196, 196, 0.8)",borderRadius:"16px",backgroundClip:"padding-box",border:"2px solid rgba(0, 0, 0, 0)"}},children:r.map((e=>l(zl,{route:e},e.name)))}),a&&l($,{borderTop:"1px solid #FFFFFF1F",children:d?s:a})]})]})]})};const Hl=({routes:e,theme:r=ut,title:t="",id:o,logo:a,collapsedLogo:s,footer:d,collapsedFooter:c})=>i(n,{theme:r,children:[l(cr,{}),l(Ol,{children:l(Bl,{title:t,routes:e,id:o,logo:a,collapsedLogo:s,footer:d,collapsedFooter:c})})]}),_l=({children:e,toolbar:r,contentSx:t,sx:n})=>i($,{component:"section",sx:Object.assign({flexGrow:1,bgcolor:"background.default"},n),children:[l(yr,{sx:{borderBottom:"1px solid rgba(38, 40, 66, 0.08)"},children:r}),l($,{sx:Object.assign(Object.assign({},t),{height:"calc(100vh - 56px)",overflow:"scroll"}),children:l(O,{fallback:l(Lr,{}),children:null!=e?e:l(le,{})})})]}),Wl=t(te)((()=>({textDecoration:"none",color:"inherit"}))),Jl=({crumbs:e})=>l(xr,{separator:l(Er,{fontSize:"small"}),"aria-label":"breadcrumb",sx:{"& li":{color:"#6D6E85","&:last-child":{color:"#262842"}}},children:e.map(((e,r)=>e.link?l(Wl,{to:e.link,className:"breadcrumb",children:e.title},r):l(z,{className:"breadcrumb",children:e.title},r)))}),Gl=({children:e})=>{const[r,t]=h(!1),n=f((e=>{t((null==e?void 0:e.scrollWidth)>(null==e?void 0:e.clientWidth));window.addEventListener("resize",(()=>{t((null==e?void 0:e.scrollWidth)>(null==e?void 0:e.clientWidth))}))}),[]);return l(Q,{title:e,arrow:!0,disableHoverListener:!r,children:l("div",{ref:n,style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e})})};export{kr as AlertDialog,Gr as BackButton,Jl as Breadcrumbs,_l as ContentLayout,Yr as ControlAceEditor,Pt as ControlArrayInput,Hr as ControlAutocomplete,zr as ControlCheckbox,Nt as ControlDate,Ft as ControlDateTime,Ar as ControlDebouncedInput,Fr as ControlInput,Lt as ControlNumberInput,At as ControlPeriodInput,qt as ControlPhoneInput,Wr as ControlQueryAutocomplete,jr as ControlRadio,$r as ControlSelect,kt as ControlSwitch,Dt as ControlTime,Jr as CopyButton,el as CreateDefinition,Un as CreatePropertiesList,Qn as CreatePropertiesListContext,Yn as CreatePropertyFormFields,Tr as DATE_DEFAULT_FORMAT,wr as DATE_TIME_DEFAULT_FORMAT,Ir as DEFAULT_DATE_VALIDATION_ERROR_TEXT,Vt as DEFAULT_ERROR_TEXT,Nr as DEFAULT_REQUIRED_ERROR_TEXT,ul as DefinitionFiller,fl as DefinitionValueView,mn as InfoItem,nt as JsonModalView,Cl as JsonPathPicker,tt as JsonView,Lr as Loader,jl as MenuIcon,cl as MultiplePropertyFiller,Gl as OverflowTip,qr as PopupIconComponent,sl as PropertyFiller,Or as PropertyType,In as PropertyValueField,Vr as RoundingMode,pn as RouteTabs,Hl as Sidebar,dn as SimpleTable,vl as Status,yn as StepperView,Sr as TIME_DEFAULT_FORMAT,un as TabPanel,Xt as Table,Qt as TableAction,cn as TableActionCell,al as ViewPropertiesList,ol as ViewProperty,Ur as capitalize,rt as deepParseJson,Rr as defaultDefinitionArrayValue,Mr as defaultDefinitionObjectValue,mt as digitsOnly,ht as floatsOnly,Ct as formatDefinitionData,pt as formatTableRowValue,Ot as getDemPropertyDateFormat,Tt as getEntityStarterValue,Qr as getJsonStringValue,St as getMultiplePropertyFillOptions,wt as getSinglePropertyFillOptions,gt as isDateType,ft as isExpression,yt as isPropertyValueEmpty,vt as numberFormat,xt as propertiesArrayToObject,Et as propertiesObjectToArray,Zr as removeArrayItem,et as safeParseJson,Xr as sortArrayOfObjects,ut as theme,Dr as useDebounce,Pr as useToggle,Kr as validateJson};
|
1
|
+
import{createTheme as e,responsiveFontSizes as r,styled as t,ThemeProvider as n}from"@mui/material/styles";import{jsx as l,jsxs as o,Fragment as i}from"@emotion/react/jsx-runtime";import a from"@mui/material/TextField";import s from"@mui/material/MenuItem";import d,{useRef as c,useEffect as u,useState as p,useCallback as m,useMemo as h,forwardRef as f,createContext as g,useContext as y,memo as b,useImperativeHandle as v,Suspense as C}from"react";import{useController as x,useWatch as E,useFormContext as T,Controller as O,useFieldArray as S,useForm as w}from"react-hook-form";import V from"@mui/material/SvgIcon";import L from"@mui/material/IconButton";import k from"@mui/material/InputAdornment";import R from"@mui/material/Button";import M from"@mui/material/Dialog";import N from"@mui/material/DialogActions";import I from"@mui/material/DialogContent";import F from"@mui/material/DialogContentText";import D from"@mui/material/DialogTitle";import P from"@mui/material/Box";import A from"@mui/material/Typography";import q from"@mui/material/CircularProgress";import $ from"@mui/material/FormControl";import z from"@mui/material/FormControlLabel";import B from"@mui/material/FormHelperText";import H from"@mui/material/Checkbox";import j from"@mui/material/Radio";import _ from"@mui/material/RadioGroup";import W from"@mui/material/FormLabel";import J from"@mui/material/Autocomplete";import G from"lodash/get";import{createElement as Y}from"@emotion/react";import{useQuery as Z}from"@tanstack/react-query";import K from"qs";import U from"@mui/material/Tooltip";import{useNavigate as X,useLocation as Q,Link as ee,useSearchParams as re,Outlet as te}from"react-router-dom";import ne from"@uiw/react-codemirror";import{langs as le}from"@uiw/codemirror-extensions-langs";import{abcdef as oe}from"@uiw/codemirror-theme-abcdef";import ie from"@mui/material/Switch";import{DatePicker as ae}from"@mui/x-date-pickers/DatePicker";import{format as se,parse as de,isValid as ce,isMatch as ue}from"date-fns";import{DateTimePicker as pe}from"@mui/x-date-pickers/DateTimePicker";import{TimePicker as me}from"@mui/x-date-pickers/TimePicker";import he from"@mui/material/Chip";import fe from"@mui/material/Unstable_Grid2";import{toString as ge,parse as ye}from"duration-fns";import be from"react-input-mask";import ve from"@mui/material/Pagination";import Ce from"@mui/material/TablePagination";import{useGridApiContext as xe,useGridSelector as Ee,gridPageSelector as Te,gridPageCountSelector as Oe,gridRowCountSelector as Se,gridPageSizeSelector as we,GridColumnMenuContainer as Ve,GridFilterMenuItem as Le,DataGrid as ke,GridActionsCellItem as Re}from"@mui/x-data-grid";import Me from"@mui/material/Table";import Ne from"@mui/material/TableBody";import Ie from"@mui/material/TableCell";import Fe from"@mui/material/TableContainer";import De from"@mui/material/TableHead";import Pe from"@mui/material/TableRow";import Ae from"@mui/material/TableFooter";import qe from"@mui/material/Backdrop";import $e from"@mui/material/TableSortLabel";import ze from"@mui/material/Menu";import Be from"@mui/icons-material/MoreHoriz";import He from"@mui/material/Paper";import je from"@mui/material/Tab";import _e from"@mui/material/Tabs";import We from"@mui/material/Accordion";import Je from"@mui/material/AccordionSummary";import Ge from"@mui/material/AccordionDetails";import Ye from"@mui/material/AccordionActions";import{ExpandMore as Ze}from"@mui/icons-material";import Ke from"@mui/icons-material/Delete";import Ue from"@mui/material/Stepper";import Xe from"@mui/material/Step";import Qe from"@mui/material/StepLabel";import er from"@mui/material/StepContent";import rr from"@mui/material/StepConnector";import{AdapterDateFns as tr}from"@mui/x-date-pickers/AdapterDateFns";import{LocalizationProvider as nr}from"@mui/x-date-pickers/LocalizationProvider";import lr from"@mui/material/Select";import or from"@mui/material/InputLabel";import ir from"classnames";import{toast as ar}from"react-toastify";import sr from"@mui/material/CssBaseline";import dr from"@mui/material/Drawer";import cr from"@mui/material/List";import ur from"@mui/material/ListItem";import pr from"@mui/material/ListItemIcon";import mr from"@mui/material/ListItemButton";import hr from"@mui/material/ListSubheader";import fr from"@mui/material/ListItemText";import gr from"@mui/material/Toolbar";import yr from"@mui/material/ButtonBase";import br from"@mui/material/Collapse";import vr from"@mui/material/Breadcrumbs";import Cr from"@mui/icons-material/NavigateNext";let xr=function(e){return e.STRING="STRING",e.INTEGER="INTEGER",e.BIG_INTEGER="BIG_INTEGER",e.BIG_DECIMAL="BIG_DECIMAL",e.FLOAT="FLOAT",e.LONG="LONG",e.DOUBLE="DOUBLE",e.BOOLEAN="BOOLEAN",e.ENTITY_REFERENCE="ENTITY_REFERENCE",e.ENTITY="ENTITY",e.FILE="FILE",e.FILE_REFERENCE="FILE_REFERENCE",e.JSON="JSON",e.DATE="DATE",e.TIME="TIME",e.DATE_TIME="DATE_TIME",e.ANY="ANY",e}({});const Er="yyyy-MM-dd",Tr="HH:mm:ss",Or="yyyy-MM-dd'T'HH:mm:ss.SSSZ";let Sr=function(e){return e.UP="UP",e.DOWN="DOWN",e.CEILING="CEILING",e.FLOOR="FLOOR",e.HALF_UP="HALF_UP",e.HALF_DOWN="HALF_DOWN",e.HALF_EVEN="HALF_EVEN",e.UNNECESSARY="UNNECESSARY",e}({});const wr=({transparent:e,position:r,bgcolor:t})=>l(P,{position:null!=r?r:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:t||(e?"none":"rgba(255, 255, 255, .3)"),zIndex:10,children:l(q,{})}),Vr=({open:e,title:r,description:t,closeButtonTitle:n="Close",onClose:i,confirmButtonTitle:a="Confirm",confirmButtonDisabled:s=!1,disableBackdropClick:d=!1,onConfirm:c,children:u,dialogProps:p,loading:m,maxWidth:h="xs",hideCloseButton:f=!1})=>l("div",{children:o(M,Object.assign({open:e,onClose:d?(e,r)=>{if("backdropClick"===r)return null;i()}:i,disableEscapeKeyDown:d,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",fullWidth:!0,maxWidth:h},p,{children:[m&&l(wr,{}),o(D,{id:"alert-dialog-title",sx:{display:"flex",justifyContent:"space-between"},children:[l(A,{variant:"inherit",children:r}),!f&&l(L,{sx:{padding:0},onClick:i,children:l(V,{children:l("g",{opacity:"0.6",children:l("path",{d:"M4.39704 4.554L4.47004 4.47C4.59702 4.34299 4.76538 4.26576 4.94449 4.25236C5.1236 4.23897 5.30157 4.29029 5.44604 4.397L5.53004 4.47L12 10.939L18.47 4.469C18.5393 4.3974 18.622 4.34031 18.7136 4.30104C18.8051 4.26178 18.9035 4.24114 19.0031 4.24032C19.1027 4.2395 19.2014 4.25853 19.2936 4.29628C19.3857 4.33403 19.4694 4.38976 19.5398 4.46022C19.6102 4.53067 19.6659 4.61443 19.7035 4.70662C19.7412 4.79881 19.7601 4.89758 19.7592 4.99716C19.7583 5.09675 19.7376 5.19515 19.6982 5.28664C19.6589 5.37812 19.6017 5.46085 19.53 5.53L13.061 12L19.531 18.47C19.6579 18.5971 19.7349 18.7655 19.7482 18.9446C19.7614 19.1237 19.7099 19.3016 19.603 19.446L19.53 19.53C19.403 19.657 19.2347 19.7343 19.0556 19.7476C18.8765 19.761 18.6985 19.7097 18.554 19.603L18.47 19.53L12 13.061L5.53004 19.531C5.38852 19.6676 5.19903 19.7431 5.00238 19.7413C4.80574 19.7395 4.61766 19.6605 4.47867 19.5214C4.33968 19.3823 4.26089 19.1941 4.25928 18.9975C4.25766 18.8008 4.33335 18.6114 4.47004 18.47L10.939 12L4.46904 5.53C4.34217 5.40289 4.26512 5.23447 4.25191 5.05537C4.2387 4.87626 4.29019 4.69836 4.39704 4.554L4.47004 4.47L4.39704 4.554Z",fill:"black"})})})})]}),o(I,{children:[t&&l(F,{id:"alert-dialog-description",children:t}),l(P,{maxWidth:"100%",overflow:"hidden",children:u})]}),o(N,{children:[!f&&l(R,{onClick:i,variant:"outlined",children:n}),a&&c?l(R,{onClick:c,color:"primary",variant:"contained",autoFocus:!0,disabled:s,disableElevation:!0,children:a}):null]})]}))});function Lr(e,r){if(null==e)return{};var t,n,l={},o=Object.keys(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||(l[t]=e[t]);return l}const kr={code:"",name:"",version:0,properties:[]},Rr={code:"",name:"",version:0,properties:{}},Mr="Please, fill this field",Nr="Incorrect date format",Ir=["control","validate","name","label","required","defaultValue","disabled","textarea","hideErrorMessage","onChange","requiredErrorText"],Fr=["ref","onChange","value"],Dr=e=>{var r;let{control:t,validate:n,name:s="",label:d="",required:c=!1,defaultValue:u="",disabled:p=!1,textarea:m=!1,hideErrorMessage:h=!1,onChange:f,requiredErrorText:g=""}=e,y=Lr(e,Ir);const b=x({name:s,control:t,defaultValue:u,rules:{required:!!c&&(g||Mr),validate:n}}),{field:{ref:v,onChange:C,value:E},fieldState:{error:T}}=b,O=Lr(b.field,Fr);return l(a,Object.assign({},O,{fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:v,name:s,label:c?o(i,{children:[d," ",l("span",{children:"*"})]}):d,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!T,helperText:!h&&(null==T?void 0:T.message),FormHelperTextProps:{variant:"standard"},disabled:p,multiline:m,minRows:m?3:1,value:null!=E?E:"",onChange:f||C,InputLabelProps:{shrink:!!y.placeholder},inputProps:Object.assign({},null!=(r=null==y?void 0:y.inputProps)?r:{},{value:null!=E?E:""})},y))};function Pr(e,r){const t=c();u((()=>()=>{t.current&&clearTimeout(t.current)}),[]);return(...n)=>{clearTimeout(t.current),t.current=setTimeout((()=>{e(...n)}),r)}}const Ar=()=>{const[e,r]=p(!1);return{open:e,toggle:()=>{r((e=>!e))},onClose:()=>{r(!1)},onOpen:()=>{r(!0)}}},qr=["control","validate","name","label","required","defaultValue","disabled","textarea","hideErrorMessage","onChange","requiredErrorText"],$r=e=>{var r;let{control:t,validate:n,name:s="",label:d="",required:c=!1,defaultValue:h="",disabled:f=!1,textarea:g=!1,hideErrorMessage:y=!1,requiredErrorText:b=""}=e,v=Lr(e,qr);const{field:{ref:C,onChange:T},fieldState:{error:O}}=x({name:s,control:t,defaultValue:h,rules:{required:!!c&&(b||Mr),validate:n}}),S=E({control:t,name:s}),[w,V]=p("");u((()=>{!w&&S&&V(S)}),[w,S]);const L=Pr((e=>{T(e)}),200),k=m((e=>{V(e.target.value),L(e.target.value)}),[L]);return l(a,Object.assign({fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:C,name:s,label:c?o(i,{children:[d," ",l("span",{children:"*"})]}):d,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!O,helperText:!y&&(null==O?void 0:O.message),FormHelperTextProps:{variant:"standard"},disabled:f,multiline:g,minRows:g?3:1,value:null!=w?w:"",onChange:k},v,{inputProps:Object.assign({},null!=(r=null==v?void 0:v.inputProps)?r:{},{value:null!=w?w:""})}))},zr=["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange","labelKey","valueKey","options","requiredErrorText"],Br=["ref","onChange","value"],Hr=()=>l(V,{children:l("path",{d:"M4.22032 8.46991C4.36094 8.32946 4.55157 8.25057 4.75032 8.25057C4.94907 8.25057 5.13969 8.32946 5.28032 8.46991L12.0003 15.1899L18.7203 8.46991C18.789 8.39622 18.8718 8.33712 18.9638 8.29613C19.0558 8.25514 19.1551 8.23309 19.2558 8.23132C19.3565 8.22954 19.4565 8.24807 19.5499 8.28579C19.6433 8.32351 19.7281 8.37965 19.7994 8.45087C19.8706 8.52209 19.9267 8.60692 19.9644 8.70031C20.0022 8.7937 20.0207 8.89373 20.0189 8.99443C20.0171 9.09513 19.9951 9.19445 19.9541 9.28645C19.9131 9.37845 19.854 9.46125 19.7803 9.52991L12.5303 16.7799C12.3897 16.9204 12.1991 16.9992 12.0003 16.9992C11.8016 16.9992 11.6109 16.9204 11.4703 16.7799L4.22032 9.52991C4.07987 9.38928 4.00098 9.19866 4.00098 8.99991C4.00098 8.80116 4.07987 8.61054 4.22032 8.46991Z",fill:"#8B8C9E"})}),jr=e=>{var r;let{control:t,validate:n,name:d="",label:c="",required:u=!1,defaultValue:p="",disabled:h=!1,hideErrorMessage:f=!1,onChange:g,labelKey:y,valueKey:b,options:v=[],requiredErrorText:C=""}=e,E=Lr(e,zr);const T=x({name:d,control:t,defaultValue:p,rules:{required:!!u&&(C||Mr),validate:n}}),{field:{ref:O,onChange:S,value:w},fieldState:{error:R}}=T,M=Lr(T.field,Br),N=m((e=>"string"==typeof e?e:b?e[b]:e.value),[b]),I=m((e=>"string"==typeof e?e:y?e[y]:e.label),[y]),F=m((()=>{g?g(null):S(null)}),[S,g]);return l(a,Object.assign({},M,{select:!0,fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:O,name:d,label:u?o(i,{children:[c," ",l("span",{children:"*"})]}):c,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!R,helperText:!f&&(null==R?void 0:R.message),FormHelperTextProps:{variant:"standard"},disabled:h,value:null!=w?w:"",onChange:g||S},E,{inputProps:Object.assign({},null!=(r=null==E?void 0:E.inputProps)?r:{},{value:null!=w?w:""}),InputProps:Object.assign({endAdornment:!u&&w?l(k,{position:"end",sx:{mr:0},children:l(L,{onClick:F,size:"small",children:l(V,{fontSize:"small",children:l("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})})})}):null},null==E?void 0:E.InputProps),SelectProps:{sx:{"& .MuiSelect-select .notranslate::after":E.placeholder?{content:`"${E.placeholder}"`,opacity:.42}:{}}},children:v.map(((e,r)=>l(s,{value:N(e),children:I(e)},r)))}))},_r=["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange"],Wr=["ref","onChange","value"],Jr=e=>{let{control:r,name:t="",label:n="",required:i=!1,defaultValue:a,disabled:s=!1,hideErrorMessage:d=!1,onChange:c}=e,u=Lr(e,_r);const p=x({name:t,control:r,defaultValue:null!=a&&a}),{field:{ref:m,onChange:f,value:g},fieldState:{error:y}}=p,b=Lr(p.field,Wr),v=h((()=>{if("boolean"==typeof g)return g;if("string"==typeof g){if("false"===g)return f(!1),!1;if("true"===g)return f(!0),!0}return!1}),[g,f]);return o($,{error:!!y,component:"fieldset",variant:"standard",disabled:s,children:[l(z,{control:l(H,Object.assign({},b,{checked:v,onChange:c||f,name:t,inputRef:m,disabled:s},u)),label:n}),!d&&(null==y?void 0:y.message)&&l(B,{variant:"standard",children:y.message})]})},Gr=["onChange"],Yr=({name:e,label:r,values:t=[],control:n,required:i,defaultValue:a,disabled:s,hideErrorMessage:d,labelKey:c,valueKey:u,validate:p,onChange:h,row:f,radioProps:g,requiredErrorText:y=""})=>{const b=x({name:e,control:n,defaultValue:a,rules:{required:!!i&&(y||Mr),validate:p}}),{field:{onChange:v},fieldState:{error:C}}=b,E=Lr(b.field,Gr),T=m((e=>"string"==typeof e?e:u?e[u]:e.value),[u]),O=m((e=>"string"==typeof e?e:c?e[c]:e.label),[c]),S=m((e=>"string"==typeof e?e===E.value:e===("string"==typeof E.value?"true"===E.value:E.value)),[E.value]),w=m((e=>{"true"===e.target.value||"false"===e.target.value?v("true"===e.target.value):v(e)}),[v]);return o($,{disabled:s,error:!!C,children:[l(W,{id:"radio-buttons-group",children:r}),l(_,Object.assign({},E,{row:f,"aria-labelledby":"radio-buttons-group",onChange:h||w,children:t.map(((e,r)=>l(z,{value:T(e),control:l(j,Object.assign({},g,{checked:S(T(e))})),label:O(e)},r)))})),!d&&(null==C?void 0:C.message)&&l(B,{variant:"standard",children:C.message})]})};var Zr=({valueKey:e,labelKey:r})=>{const t=m(((r,t)=>{if(r&&t){if("string"==typeof r)return r===t;if(e)return G(r,e)===G(t,e)||G(r,e)===t;if(r.value)return r.value===t.value||r.value===t}return!1}),[e]),n=m((e=>e?"string"==typeof e?e:r&&G(e,r,"")?G(e,r,"")+"":e.label+""||e.name+""||e.value+""||e.code+""||"--no label--":""),[r]),l=m(((e,r)=>Y(P,Object.assign({},e,{component:"li",key:e.id}),n(r))),[n]);return{isOptionEqualToValue:t,getOptionLabel:n,renderOption:l}};const Kr=["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange","labelKey","valueKey","options","multiple","textFieldProps","disableCloseOnSelect","useStringValue","requiredErrorText","startAdornment","endAdornment"],Ur=["ref","onChange","value"],Xr=e=>{let{control:r,validate:t,name:n="",label:s="",required:d=!1,defaultValue:c="",disabled:m=!1,hideErrorMessage:h=!1,onChange:f,labelKey:g,valueKey:y,options:b=[],multiple:v,textFieldProps:C={},disableCloseOnSelect:E,useStringValue:T,requiredErrorText:O="",startAdornment:S,endAdornment:w}=e,V=Lr(e,Kr);const L=x({name:n,control:r,defaultValue:c||(v?[]:null),rules:{required:!!d&&(O||Mr),validate:t}}),{field:{ref:k,onChange:R,value:M},fieldState:{error:N}}=L,I=Lr(L.field,Ur),[F,D]=p(),{getOptionLabel:P,isOptionEqualToValue:A,renderOption:q}=Zr({valueKey:y,labelKey:g});return u((()=>{"string"==typeof M&&y&&T&&void 0===F&&b.length&&b[0]&&"object"==typeof b[0]&&D(b.find((e=>G(e,y)===M)))}),[F,b,T,M,y]),l(J,Object.assign({},I,{value:T?null!=F?F:null:M,fullWidth:!0,disablePortal:!0,size:"small",readOnly:m,options:b,multiple:v,getOptionLabel:P,isOptionEqualToValue:A,disableCloseOnSelect:E||v,filterSelectedOptions:v,onChange:f||((e,r)=>{R(T&&y?G(r,y):r),D(r)}),renderOption:q,renderInput:e=>l(a,Object.assign({},e,{variant:"outlined",name:n,label:d?o(i,{children:[s," ",l("span",{children:"*"})]}):s,InputLabelProps:{shrink:!(null==V||!V.placeholder)},sx:{".MuiInputLabel-root span":{color:"#D6331F"}},placeholder:null==V?void 0:V.placeholder,error:!!N,inputRef:k,helperText:!h&&(null==N?void 0:N.message),FormHelperTextProps:{variant:"standard"},InputProps:Object.assign({},e.InputProps,{startAdornment:S||e.InputProps.startAdornment,endAdornment:w||e.InputProps.endAdornment})},C))},V))};const Qr=["name","label","control","required","searchBy","labelKey","multiple","mongoQueryJson","disabled","valueKey","sortBy","hideErrorMessage","disableCloseOnSelect","textFieldProps","onChange","queryFunction","validate","itemQueryFunction","requiredErrorText","startAdornment","endAdornment"],et=["ref","onChange","value"],rt=()=>l("img",{src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M4.22032 8.46991C4.36094 8.32946 4.55157 8.25057 4.75032 8.25057C4.94907 8.25057 5.13969 8.32946 5.28032 8.46991L12.0003 15.1899L18.7203 8.46991C18.789 8.39622 18.8718 8.33712 18.9638 8.29613C19.0558 8.25514 19.1551 8.23309 19.2558 8.23132C19.3565 8.22954 19.4565 8.24807 19.5499 8.28579C19.6433 8.32351 19.7281 8.37965 19.7994 8.45087C19.8706 8.52209 19.9267 8.60692 19.9644 8.70031C20.0022 8.7937 20.0207 8.89373 20.0189 8.99443C20.0171 9.09513 19.9951 9.19445 19.9541 9.28645C19.9131 9.37845 19.854 9.46125 19.7803 9.52991L12.5303 16.7799C12.3897 16.9204 12.1991 16.9992 12.0003 16.9992C11.8016 16.9992 11.6109 16.9204 11.4703 16.7799L4.22032 9.52991C4.07987 9.38928 4.00098 9.19866 4.00098 8.99991C4.00098 8.80116 4.07987 8.61054 4.22032 8.46991Z' fill='%238B8C9E'/%3e%3c/svg%3e",alt:""});function tt(e){let{name:r,label:t,control:n,required:s=!1,searchBy:c,labelKey:f,multiple:g=!1,mongoQueryJson:y,disabled:b,valueKey:v,sortBy:C="",hideErrorMessage:E,disableCloseOnSelect:T,textFieldProps:O,onChange:S,queryFunction:w,validate:V,itemQueryFunction:L,requiredErrorText:R="",startAdornment:M,endAdornment:N}=e,I=Lr(e,Qr);const F=x({control:n,name:r,defaultValue:g?[]:null,rules:{required:!!s&&(R||Mr),validate:V}}),{field:{ref:D,onChange:P,value:A},fieldState:{error:$,isDirty:z}}=F,B=Lr(F.field,et),{getOptionLabel:H,isOptionEqualToValue:j,renderOption:_}=Zr({valueKey:v,labelKey:f}),[W,Y]=p([]),[U,X]=p(!1),[Q,ee]=p(""),[re,te]=p(""),[ne,le]=p(0),oe=h((()=>!!W.length&&U),[U,W]),{data:ie,isFetching:ae}=Z(["options",ne,re],(()=>{const e=K.parse(Object.assign({page:`${ne}`,size:"20",sort:C},re?{[c]:re}:{}),{ignoreQueryPrefix:!0});return w(e)}),{onSuccess(e){Y(re?e.collection:r=>1===r.length?e.collection:[...r,...e.collection])}}),se=(e,r)=>{if("object"==typeof e){if(Array.isArray(e))return e.map((e=>se(e,r)));{const t={};for(const n in e)t[n]=se(e[n],r);return t}}return"string"==typeof e&&e.includes("${variable}")?e.replace("${variable}",r):e},de=Pr((e=>{if(le(0),y){const r=se(y,e);te(JSON.stringify(r))}else te(e)}),500),ce=m(((e,r)=>{Y([]),ee(r),de(r)}),[de]),ue=m(((e,r)=>{P(r),S&&S(e,r)}),[P,S]);u((()=>{if(!z&&A&&L){let e=A;"object"==typeof A&&v in A&&(e=G(A,v)),L(e).then((e=>{P(e),ee(G(e,f))})).catch(console.error)}}),[A,z,v,f,L,P]);const pe=m((e=>{const r=e.currentTarget;r.scrollHeight-r.scrollTop-r.clientHeight<=1&&W.length<(null==ie?void 0:ie.totalItems)&&le((e=>e+1))}),[ie,W]);return l(J,Object.assign({},B,{fullWidth:!0,disablePortal:!0,size:"small",readOnly:b,options:W,multiple:g,getOptionLabel:H,isOptionEqualToValue:j,disableCloseOnSelect:T||g,filterSelectedOptions:g,inputValue:Q,value:A,onChange:ue,loading:ae,clearOnBlur:!1,open:oe,filterOptions:e=>e,onOpen:()=>{X(!0)},onClose:()=>{X(!1),te("")},onInputChange:ce,ListboxProps:{onScroll:pe},renderOption:_,popupIcon:l(rt,{}),renderInput:e=>l(a,Object.assign({},e,{label:s?o(i,{children:[t," ",l("span",{children:"*"})]}):t,InputLabelProps:{shrink:!(null==I||!I.placeholder)},placeholder:null==I?void 0:I.placeholder,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},variant:"outlined",error:!!$,inputRef:D,helperText:!E&&(null==$?void 0:$.message),FormHelperTextProps:{variant:"standard"},InputProps:Object.assign({},e.InputProps,{endAdornment:N||o(d.Fragment,{children:[ae?l(k,{position:"end",children:l(q,{color:"inherit",size:20})}):null,e.InputProps.endAdornment]}),startAdornment:M||e.InputProps.startAdornment})},O))},I))}const nt=({copyText:e,helpText:r="Copy"})=>{const[t,n]=p(r);return t?l(U,{title:t,placement:"top",children:l(L,{onClick:()=>{navigator.clipboard.writeText(e),n("Copied!"),setTimeout((()=>{n(r)}),1e3)},children:l(V,{fontSize:"small",children:l("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4 6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z"})})})}):null},lt=({text:e,buttonProps:r={}})=>{const t=X(),{state:n}=Q(),o=h((()=>null==n?void 0:n.from),[n]),i=m((()=>{t(o||-1)}),[t,o]);return l(P,{mr:2,children:e?l(R,Object.assign({color:"inherit",onClick:o?null:i,component:ee,to:null!=o?o:""},r,{children:e})):l(L,{onClick:i,children:l(V,{children:l("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"})})})})},ot=["control","name","mode","label","width","height","readOnly","required","validateJson","hideErrorMessage","fontSize","validate","parseValue","requiredErrorText","useCleanValue"],it=["onChange","value","ref"],at=f(((e,r)=>{let{control:t,name:n,mode:a="json",label:s,width:d="100%",height:c="200px",readOnly:u,required:p=!1,validateJson:f=!1,hideErrorMessage:g=!1,fontSize:y=16,validate:b=!0,parseValue:v,requiredErrorText:C="",useCleanValue:E}=e,T=Lr(e,ot);const O=x({control:t,name:n,rules:{required:!!p&&(C||Mr),validate:e=>{if(e&&f&&"string"==typeof e)try{return JSON.parse(e),!0}catch(e){return console.error(e),"Invalid JSON"}return!0}}}),{field:{onChange:S,value:w,ref:V},fieldState:{error:L}}=O,k=Lr(O.field,it),R=h((()=>({json:[le.json()],javascript:[le.javascript()],python:[le.python()]})),[]),M=h((()=>"text"===a&&"string"!=typeof w?JSON.stringify(w,null,2):"json"===a&&"string"!=typeof w?null===w?"":E?JSON.stringify(w,null,2).replace(/\\"/g,""):JSON.stringify(w,null,2):"string"==typeof w&&"text"!==a&&E?w.replace(/\\"/g,""):w),[w,E,a]),N=m((e=>{if(v)try{const r=JSON.parse(e);S(r)}catch(r){S(e)}else S(e)}),[S,v]);return o(P,{display:"flex",flexDirection:"column",width:"100%",children:[l(P,{children:s&&l(A,{variant:"subtitle1",display:"inline",style:{marginRight:10},children:p?o(i,{children:[s," ",l(P,{component:"span",color:"#D6331F",children:"*"})]}):s})}),o(i,{children:[l(ne,Object.assign({},k,{ref:r||V,basicSetup:{autocompletion:!0,history:!0},theme:oe,width:d,height:c,style:{fontSize:y,lineHeight:1.4,zIndex:0,isolation:"isolate"},readOnly:u,value:M,onChange:N,extensions:"text"===a?[]:R[a]},T)),L&&!g&&l(B,{variant:"standard",error:!0,children:L.message})]})]})})),st=(e,r)=>{const t=[...e];return t.splice(r,1),t},dt=e=>{try{JSON.parse(e)}catch(e){return!1}return!0};function ct(e){return e.replace(/(^\w)|([-\s]\w)/g,(e=>e.toUpperCase()))}const ut=(e,r,t,n="asc")=>{const l=e[t],o=r[t];return l<o?"asc"===n?-1:1:l>o?"asc"===n?1:-1:0},pt=e=>{if(!e)return"";if("string"==typeof e)try{return JSON.stringify(JSON.parse(e),null,2)}catch(r){return e}else try{return JSON.stringify(e,null,2)}catch(e){return"Failed to stringify JSON"}},mt=e=>{try{return JSON.parse(e)}catch(e){return null}},ht=e=>{try{const r=JSON.parse(e);return Object.keys(r).forEach((e=>{r[e]=ht(r[e])})),r}catch(r){return e}},ft=f((({value:e,height:r=200,fontSize:t=16},n)=>{const[i,a]=p(!0),s=m((e=>{const r=t=>{e.scrollDOM.scrollHeight-e.scrollDOM.offsetHeight-t.target.scrollTop<10&&setTimeout((()=>e.scrollDOM.scrollTo(0,0)),200),0===t.target.scrollTop&&(a(!1),e.scrollDOM.removeEventListener("scroll",r))};e.scrollDOM.scrollHeight>3e4?(a(!0),e.scrollDOM.addEventListener("scroll",r),e.scrollDOM.scrollTo(0,e.scrollDOM.scrollHeight-1e3),setTimeout((()=>{e.scrollDOM.scrollTo({top:e.scrollDOM.scrollHeight,behavior:"smooth"})}),300)):a(!1)}),[]);return o(P,{position:"relative",children:[i&&l(wr,{bgcolor:"#fff"}),l(ne,{ref:n,readOnly:!0,width:"100%",value:"string"==typeof e?e:JSON.stringify(e,null,2),height:`${r}px`,basicSetup:{autocompletion:!0,history:!0,foldGutter:!0},onCreateEditor:s,extensions:[le.json()],style:{fontSize:t,width:"100%"}})]})})),gt=({open:e,onClose:r,value:t,jsonViewProps:n})=>{const i=c();return o(M,{disableEscapeKeyDown:!0,open:e,onClose:r,fullWidth:!0,maxWidth:"md",style:{width:800,left:"30%"},children:[l(I,{children:l(ft,Object.assign({value:t},n,{ref:i}))}),o(N,{children:[l(nt,{copyText:t}),l(R,{onClick:r,variant:"contained",color:"secondary",children:"Close"})]})]})};var yt=({value:e,copyButton:r=!1,textField:t=!1})=>{const{open:n,onOpen:i,onClose:a}=Ar(),s=m((e=>{e.stopPropagation(),i()}),[i]);return o(P,{width:"100%",children:[o(P,{display:"flex",alignItems:"center",justifyContent:"flex-end",pt:1,mb:2,children:[r&&l(nt,{copyText:pt(e)}),l(U,{title:"Open",placement:"top",children:l(L,{size:"small",onClick:s,children:l(V,{children:l("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})})})})]}),t?l(P,{overflow:"hidden",whiteSpace:"nowrap",children:"object"==typeof e?JSON.stringify(e):e}):l(ft,{value:e}),l(gt,{open:n,value:pt(e),onClose:a,jsonViewProps:{height:450}})]})};const bt={spacing:4,palette:{primary:{main:"#E0613A",dark:"#d9512e",light:"#E0613A"},secondary:{main:"#007994",dark:"#262842",light:"#cbe8ee"},text:{disabled:"#A9A9B8"},success:{main:"#2DB77B",light:"#DBFCEE"},grey:{100:"#F7F8FC",700:"#101F2B"}},typography:{fontSize:14,allVariants:{fontFamily:["Euclid","-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto",'"Helvetica Neue"',"Arial","sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"'].join(",")},h1:{fontWeight:400},h3:{fontWeight:500},h4:{fontWeight:500}}};var vt=e(bt);var Ct={components:{MuiButtonBase:{defaultProps:{disableElevation:!0},styleOverrides:{root:{"&.MuiButton-root":{boxShadow:"none"},"&.MuiButton-root:hover":{boxShadow:"none"},"&.MuiButton-containedPrimary:hover":{backgroundColor:"#D15C3B"},"&.MuiButton-outlinedPrimary:hover":{backgroundColor:"#F6F6F7",borderColor:"#DDDDE1"},"&.MuiButton-textPrimary":{color:vt.palette.secondary.dark,"&:hover":{backgroundColor:"#F6F6F7"},"&:active":{backgroundColor:"#EEEEF0"}},"&.MuiButton-textSecondary":{color:vt.palette.secondary.main,"&:hover":{backgroundColor:"#DEF7FC"},"&:active":{backgroundColor:"#CFE6ED"}}}}},MuiInputBase:{styleOverrides:{root:{color:"#262842",borderRadius:vt.spacing(3),minWidth:vt.spacing(25),background:vt.palette.background.default,paddingRight:vt.spacing(3)},input:{minWidth:vt.spacing(25)}}},MuiSelect:{defaultProps:{IconComponent:Hr},styleOverrides:{nativeInput:{padding:0,height:"32px"}}},MuiTextField:{styleOverrides:{root:{minWidth:vt.spacing(25)}}},MuiInputLabel:{styleOverrides:{root:{color:"#6D6E85",position:"relative",overflow:"initial",transform:"none",marginBottom:vt.spacing(1),fontWeight:500,fontSize:"14px",lineHeight:"20px",pointerEvents:"auto","&.Mui-focused":{color:"#6D6E85"}}}},MuiOutlinedInput:{styleOverrides:{root:{borderRadius:vt.spacing(3),minWidth:vt.spacing(25),"&:hover":{".MuiOutlinedInput-notchedOutline":{borderColor:"#8B8C9E"}},"&.Mui-focused":{".MuiOutlinedInput-notchedOutline":{borderColor:vt.palette.secondary.main}}},notchedOutline:{top:0,"& legend":{display:"none",transition:"none"}}}},MuiAutocomplete:{defaultProps:{popupIcon:l(Hr,{})},styleOverrides:{root:{"& .MuiOutlinedInput-root .MuiAutocomplete-endAdornment":{right:12}},paper:{marginTop:8,borderRadius:12,boxShadow:"0px 8px 16px rgba(0, 0, 0, 0.04)"},listbox:{"::-webkit-scrollbar":{width:"6px",backgroundColor:"white"},"::-webkit-scrollbar-thumb":{borderRadius:"10px",backgroundColor:"rgba(38, 40, 66, 0.24)"}}}},MuiMenu:{styleOverrides:{list:{paddingTop:0,paddingBottom:0,background:"white","& li.Mui-selected":{background:"rgba(38, 40, 66, 0.08) !important"}}}},MuiPopover:{styleOverrides:{paper:{marginTop:8,borderRadius:12,boxShadow:"0px 8px 16px rgba(0, 0, 0, 0.04)"}}},MuiFormLabel:{styleOverrides:{root:{color:"#6D6E85",fontSize:14,fontWeight:500,"&.Mui-focused":{color:"#6D6E85"},"& span":{color:"#D6331F"}},asterisk:{color:"#D6331F","&$error":{color:"#D6331F"}}}},MuiTooltip:{styleOverrides:{tooltip:{fontSize:14},backgroundColor:vt.palette.secondary.dark,padding:vt.spacing(2,3),borderRadius:8,textAlign:"center"}}}};var xt={components:{MuiTableContainer:{styleOverrides:{root:{borderRadius:vt.spacing(3),border:"1px solid rgba(38, 40, 66, 0.08)",overflow:"hidden"}}},MuiTableHead:{styleOverrides:{root:{backgroundColor:"#F7F8FC"}}},MuiTableRow:{styleOverrides:{root:{"&.MuiTableRow-hover":{"&:hover":{backgroundColor:"#F6F6F7"},"&:active, &:focus":{backgroundColor:"#EEEEF0"}},"&:active, &:focus":{backgroundColor:"#EEEEF0"}}}},MuiTableCell:{styleOverrides:{root:{padding:vt.spacing(1,2),borderColor:"#26284214","&:first-of-type":{paddingLeft:vt.spacing(4)}},head:{padding:vt.spacing(2,2),color:"#6D6E85"},body:{wordBreak:"break-all"}}},MuiTableSortLabel:{styleOverrides:{root:{maxHeight:"24px",lineHeight:1}}},MuiTablePagination:{styleOverrides:{root:{"& .MuiInputBase-root":{border:"1px solid #2628421F",borderRadius:4,minWidth:58,height:32,paddingRight:vt.spacing(2),"& .MuiSelect-select":{paddingRight:"4px !important",color:vt.palette.secondary.dark,"&:focus":{backgroundColor:"transparent"}}}}}},MuiPaginationItem:{styleOverrides:{root:{height:32,minWidth:32,borderRadius:4,border:"1px solid transparent",margin:"0, 2px","&.Mui-selected":{borderColor:"#2628421F",backgroundColor:"#F7F8FC"}}}},MuiDataGrid:{defaultProps:{headerHeight:40,getRowHeight:()=>"auto"},styleOverrides:{root:{borderRadius:vt.spacing(3),width:"100%",color:vt.palette.secondary.dark,border:"1px solid #26284214","& .MuiDataGrid-actionsCell":{flexWrap:"wrap",width:"100%",'& > button[aria-label="more"]':{marginLeft:"auto"}}},columnHeaders:{backgroundColor:vt.palette.grey[100],borderTopLeftRadius:vt.spacing(3),borderTopRightRadius:vt.spacing(3)},columnHeader:{"&:focus":{outline:"none"}},columnHeaderTitle:{color:"#6D6E85",fontWeight:500},row:{"&:hover":{backgroundColor:"#F6F6F7"},"&:active, &:focus":{backgroundColor:"#EEEEF0"}},columnSeparator:{display:"none"},withBorder:{borderColor:"#E0E3EA"},cell:{minHeight:"48px !important",textOverflow:"ellipsis",wordBreak:"break-all",lineHeight:"unset",padding:vt.spacing(1.25,3),borderColor:"#E0E3EA","&:focus":{outline:"none"}}}}}};var Et={components:{MuiStepIcon:{styleOverrides:{root:{fontSize:"20px",color:vt.palette.text.disabled,"&.Mui-active, &.Mui-completed":{color:vt.palette.secondary.main}}}}}};var Tt={components:{MuiTypography:{styleOverrides:{h1:{[vt.breakpoints.up("lg")]:{fontSize:"1.5rem"}},h3:{fontSize:"1.25rem",[vt.breakpoints.up("lg")]:{fontSize:"1.125rem"}},h4:{fontSize:"1rem",[vt.breakpoints.up("lg")]:{fontSize:"1rem"}},subtitle2:{color:"#6D6E85"}}}}};const Ot=(()=>{if(document){const e="https://dev-qa-arsenal-frontend-fonts-bucket.s3.eu-north-1.amazonaws.com/fonts.css";if(!document.querySelectorAll(`link[href="${e}"]`).length){const r=document.createElement("link");r.href=e,r.rel="stylesheet",document.head.appendChild(r)}}return r(e(vt,{components:Object.assign({},Ct.components,xt.components,Et.components,Tt.components,{MuiToolbar:{styleOverrides:{root:{[vt.breakpoints.up("sm")]:{minHeight:"56px"}}}},MuiAppBar:{styleOverrides:{root:{boxShadow:"none",backgroundColor:"#007F9B"}}},MuiButton:{styleOverrides:{root:{borderRadius:vt.spacing(2.5),padding:vt.spacing(2.5,4),lineHeight:"20px",fontSize:"1rem",textTransform:"none"},outlined:{color:"#262842",backgroundColor:"#FFFFFF !important",border:"1px solid rgba(38, 40, 66, 0.12)"},text:{color:vt.palette.secondary.dark}}},MuiDialog:{styleOverrides:{root:{"& .MuiModal-backdrop":{background:"rgba(28, 55, 77, 0.5)",backdropFilter:"blur(2px)"}},paper:{borderRadius:vt.spacing(3)},paperWidthXs:{maxWidth:500}}},MuiDialogContent:{styleOverrides:{root:{color:"#6D6E85"}}},MuiDialogActions:{styleOverrides:{root:{background:"#F7F8FC",borderTop:"1px solid rgba(38, 40, 66, 0.08)",padding:vt.spacing(3,6)}}},MuiTabs:{styleOverrides:{root:{minHeight:"38px"},indicator:{backgroundColor:vt.palette.secondary.main}}},MuiTab:{styleOverrides:{root:{fontSize:14,fontWeight:500,textTransform:"none",padding:"10px 12px",lineHeight:"1.125rem",minHeight:"38px",color:"#8B8C9E","&.Mui-selected":{color:vt.palette.secondary.main}}}}})}))})(),St=({value:e,canCopy:r,copyValue:t,shortId:n,fullText:i=!1,textParams:a})=>{const{displayAs:s="text",tooltipLinkComponent:d=null,dateFormat:c=null,statusVariant:u=null}=a||{};switch(s){case"boolean":return l(V,e?{color:"primary",fontSize:"small",children:l("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}:{fontSize:"small",children:l("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z"})});case"date":return e?c?l(Oo,{children:c.map(((r,t)=>l(P,{children:se(new Date(e),r)},t)))}):o(Oo,{children:[l(P,{children:se(new Date(e),"dd.MM.yyyy")}),l(P,{children:se(new Date(e),"HH:mm:ss")})]}):"";case"status":return l(Oo,{children:l(Gl,{text:e,status:u||"default"})});case"json_text":return l(yt,{value:e,textField:!0});case"json_code":return l(yt,{value:e,copyButton:!0});case"array":return l(P,{children:null==e?void 0:e.map(((e,r)=>l(P,{children:e},r)))});case"collapsed_array":return e&&l(P,{children:l(U,{arrow:!0,title:d||e.map(((e,r)=>l(P,{fontSize:14,style:{paddingTop:Ot.spacing(1)},children:e},r))),children:l(P,{children:e.length>1?`${e[0]} (+${e.length-1})`:e[0]})})});case"number":return l(P,{display:"flex",justifyContent:"flex-end",children:l(Oo,{children:e.toLocaleString("ru-Ru",{minimumFractionDigits:2})})});default:return e?o(P,{display:"flex",alignItems:"center",width:"100%",children:[n?l(Oo,{children:e?`${e.slice(0,6)}...${e.slice(-6)}`:"..."}):i?l(P,{sx:{whiteSpace:"normal"},children:"string"==typeof e?e:JSON.stringify(e)}):l(Oo,{children:"string"==typeof e?e:JSON.stringify(e)}),r&&l(nt,{copyText:t?"string"==typeof t?t:JSON.stringify(t):e})]}):""}},wt=new RegExp("^[-+]?[0-9]+$"),Vt=new RegExp(/^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/),Lt=(e,r)=>{if("string"==typeof e)return/[$%#{<]{1}(?:S?JS)?(?:[{(%#>]|\()/g.test(e);if(r){if(Array.isArray(e))for(const t of e)if(Lt(t,r))return!0;if("object"==typeof e)for(const t in e)if(Lt(e[t],r))return!0}return!1},kt=e=>e===xr.DATE||e===xr.DATE_TIME||e===xr.TIME,Rt=new Intl.NumberFormat("ru-RU",{style:"decimal"}),Mt=e=>!e&&0!==e&&!1!==e,Nt=(e,r,t)=>{if(null==r)return null;if(Lt(r))return r;let n=r;switch(e){case xr.BOOLEAN:n=!!r||!(!r&&null!==r)&&null;break;case xr.INTEGER:case xr.BIG_INTEGER:case xr.BIG_DECIMAL:case xr.FLOAT:case xr.LONG:case xr.DOUBLE:n=Number(r);break;case xr.DATE:case xr.DATE_TIME:case xr.TIME:if(r)try{const e=t.formatText.replace(/[Z,z,x]+/g,"XX");n=se(de(r,e,new Date),e)}catch(e){console.error(e)}break;case xr.JSON:try{"string"!=typeof r&&(n=JSON.stringify(r)),n=JSON.parse(n)}catch(e){console.log(e),n=null}break;case xr.ANY:try{n="string"==typeof r?JSON.parse(n):r}catch(e){n=r}break;case xr.ENTITY:n=It(t.properties,r)}return n},It=(e,r)=>{if(r){const t={};return e.forEach((e=>{const{key:n,propertyType:l}=e,o=r[n];Array.isArray(o)?t[n]=o.map((r=>Nt(l,r,{formatText:e.format,properties:e.properties}))):t[n]=Nt(l,o,{formatText:e.format,properties:e.properties})})),t}return null},Ft=(e,r)=>{const t={};return e.forEach((e=>{const{key:n,name:l,isRequired:o,isMultiple:i,sortOrder:a,isEnabled:s,uiSettings:d,validationNode:c}=e,u=e.propertyType?"string"==typeof e.propertyType?e.propertyType:e.propertyType.value:null,p=Object.assign({name:l,propertyType:u,isRequired:o,isMultiple:i,sortOrder:a,isEnabled:s,validationNode:c,uiSettings:d},((e,r)=>{const t={};let n,l="";return r?e.isMultiple?(l="values",n=e.value):(l="value",n=e.value):e.isMultiple?(l="defaultValues",n=e.defaultValue):(l="defaultValue",n=e.defaultValue),Array.isArray(n)?t[l]=n.map((r=>Nt(e.propertyType,r,{formatText:e.format,properties:e.properties}))):t[l]=Nt(e.propertyType,n,{formatText:e.format,properties:e.properties}),t})(Object.assign({},e,{propertyType:u}),r));if("isViewableInList"in e&&(p.isViewableInList=e.isViewableInList),d)if("string"==typeof d)try{p.uiSettings=JSON.parse(d)}catch(e){console.log(e),p.uiSettings=d}else p.uiSettings=d;else p.uiSettings=null;u===xr.BIG_DECIMAL&&(p.precisionScale=e.precisionScale,p.roundingMode=e.roundingMode),u!==xr.DATE&&u!==xr.TIME&&u!==xr.DATE_TIME||(p.format=e.format),u===xr.STRING&&(p.restrictedValues=e.restrictedValues),u===xr.ENTITY_REFERENCE&&(p.source=e.source,p.definitionCode=e.definitionCode,p.definitionVersion=e.definitionVersion,p.labelPropertyCode=e.labelPropertyCode,p.valuePropertyCode=e.valuePropertyCode),u===xr.ENTITY&&(p.properties=Ft(e.properties,r)),t[n]=p})),t};function Dt(e,r){return Object.keys(e).map((t=>{const n=Object.assign({key:t},e[t],r||{});if(n.propertyType===xr.ENTITY&&(n.properties=Dt(n.properties,r)),n.propertyType===xr.JSON)try{null==n.defaultValue?n.defaultValue="":n.defaultValue=JSON.stringify(n.defaultValue,null,2)}catch(e){n.defaultValue=""}return n.isMultiple&&("defaultValues"in n&&(n.defaultValue=n.defaultValues),"values"in n&&(n.value=n.values)),n})).sort(((e,r)=>ut(e,r,"sortOrder")))}const Pt=(e,r)=>{if(r)try{const e=r.replace(/Z/g,"XXX");return se(new Date,e),e}catch(r){return console.error("Incorrect format",r),e}return e},At=e=>{let r=[];return r=Array.isArray(e.properties)?e.properties:Dt(e.properties),r.reduce(((e,r)=>{const t=JSON.parse(JSON.stringify(e));return r.propertyType===xr.ENTITY?t[r.key]=At(r):t[r.key]=r.propertyType,t}),{})},qt=({propertyType:e,useExpression:r,required:t})=>{let n=[{value:"widget",label:"Fill array (widget)",sortOrder:1}];return t||n.push({value:"null",label:"NULL",sortOrder:0}),r&&(e===xr.JSON||e===xr.ENTITY||e===xr.ANY?n.push({value:"expression",label:"Expression (JSON editor)",sortOrder:3}):n.push({value:"expression",label:"Expression",sortOrder:3})),e!==xr.JSON&&e!==xr.ANY&&e!==xr.ENTITY||n.push({value:"json_valid",label:"JSON editor",sortOrder:2}),n=n.sort(((e,r)=>ut(e,r,"sortOrder"))),n},$t=({propertyType:e,useExpression:r,required:t})=>{let n=[{value:"widget",label:"Widget",sortOrder:1}];switch(t||n.push({value:"null",label:"NULL",sortOrder:0}),r&&(e===xr.JSON||e===xr.ENTITY||e===xr.ANY?n.push({value:"expression",label:"Expression (JSON editor)",sortOrder:3}):n.push({value:"expression",label:"Expression",sortOrder:3})),e===xr.JSON&&n.push({value:"dem_builder",label:"DEM Builder",sortOrder:2}),e){case xr.STRING:n[0].label="Text input";break;case xr.INTEGER:case xr.BIG_INTEGER:case xr.BIG_DECIMAL:case xr.FLOAT:case xr.LONG:case xr.DOUBLE:n[0].label="Number input";break;case xr.BOOLEAN:n[0].label="Switch";break;case xr.ENTITY_REFERENCE:n[0].label="Entity reference field";break;case xr.JSON:n[0].label="JSON editor";break;case xr.DATE:n[0].label="Date picker",n.push({value:"string",label:"Text input",sortOrder:2});break;case xr.DATE_TIME:n[0].label="Date & Time picker",n.push({value:"string",label:"Text input",sortOrder:2});break;case xr.TIME:n[0].label="Time picker",n.push({value:"string",label:"Text input",sortOrder:2});break;case xr.ANY:n[0].label="Textarea"}return n=n.sort(((e,r)=>ut(e,r,"sortOrder"))),n},zt=["control","validate","name","label","required","defaultValue","disabled","hideErrorMessage","onChange","decimal","valueAsNumber","useFormattedInputValue","errorText"],Bt=["ref","onChange","value"],Ht={required:Mr,notValidNumber:"Not valid number",notValidInteger:"Not valid integer"},jt=e=>{var r,t;let{control:n,validate:s,name:d="",label:c="",required:u=!1,defaultValue:p=null,disabled:m=!1,hideErrorMessage:f=!1,onChange:g,decimal:y=!1,valueAsNumber:b=!0,useFormattedInputValue:v=!1,errorText:C}=e,E=Lr(e,zt);const T=h((()=>C||Ht),[C]),O=x({name:d,control:n,defaultValue:p,rules:{required:!!u&&T.required,validate:e=>0==+e||(null===e?!u||T.required:y&&!Vt.test(e)||/^-*0+$/.test(e)?T.notValidNumber:y||wt.test(e)?!s||("function"!=typeof s||s(e)):T.notValidInteger)}}),{field:{ref:S,onChange:w,value:V},fieldState:{error:L}}=O,k=Lr(O.field,Bt);return l(a,Object.assign({},k,{fullWidth:!0,size:"small",variant:"outlined",type:"text",inputRef:S,name:d,label:u?o(i,{children:[c," ",l("span",{children:"*"})]}):c,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},error:!!L,helperText:!f&&(null==L?void 0:L.message),disabled:m,value:v?null!=(r=null==V?void 0:V.toLocaleString("ru-Ru",{maximumFractionDigits:10}).replace(",","."))?r:"":null!=V?V:"",onChange:e=>{const r=e.target.value.replace(/\s/g,""),t=e.nativeEvent.data;if(!isNaN(t)||y&&"."===t||"-"===t||"+"===t||r){if(g)g(e);else if(b)if(e.target.value)if("0"===e.target.value)w(0);else if(y){var n;const t=e.target.value.split(".")[1];w(!Vt.test(r)||/^0+$/.test(t)||/^-*0+$/.test(r)?e.target.value:+parseFloat(r).toFixed(null!=(n=null==t?void 0:t.length)?n:0))}else w(Number.isNaN(+r)?e.target.value:+r);else w(null)}else w(e.target.value)},FormHelperTextProps:{variant:"standard"},inputProps:Object.assign({},null!=(t=null==E?void 0:E.inputProps)?t:{})},E))},_t=["control","name","label"],Wt=["ref","onChange","value"],Jt=e=>{let{control:r,name:t,label:n}=e,o=Lr(e,_t);const i=x({control:r,name:t}),{field:{ref:a,onChange:s,value:d}}=i,c=Lr(i.field,Wt),p=h((()=>{if("boolean"==typeof d)return d;if("string"==typeof d){if("false"===d)return s(!1),!1;if("true"===d)return s(!0),!0}return!1}),[d,s]);u((()=>{null===d&&s(!1)}),[d,s]);return l(z,{label:n,name:t,control:l(ie,Object.assign({},c,{color:"primary",size:"small",inputRef:a,onChange:e=>{const{checked:r}=e.target;s(r)},checked:p},o))})};var Gt="data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M17.75 3C18.612 3 19.4386 3.34241 20.0481 3.9519C20.6576 4.5614 21 5.38805 21 6.25V17.75C21 18.612 20.6576 19.4386 20.0481 20.0481C19.4386 20.6576 18.612 21 17.75 21H6.25C5.38805 21 4.5614 20.6576 3.9519 20.0481C3.34241 19.4386 3 18.612 3 17.75V6.25C3 5.38805 3.34241 4.5614 3.9519 3.9519C4.5614 3.34241 5.38805 3 6.25 3H17.75ZM19.5 8.5H4.5V17.75C4.5 18.716 5.284 19.5 6.25 19.5H17.75C18.2141 19.5 18.6592 19.3156 18.9874 18.9874C19.3156 18.6592 19.5 18.2141 19.5 17.75V8.5ZM7.75 14.5C8.08152 14.5 8.39946 14.6317 8.63388 14.8661C8.8683 15.1005 9 15.4185 9 15.75C9 16.0815 8.8683 16.3995 8.63388 16.6339C8.39946 16.8683 8.08152 17 7.75 17C7.41848 17 7.10054 16.8683 6.86612 16.6339C6.6317 16.3995 6.5 16.0815 6.5 15.75C6.5 15.4185 6.6317 15.1005 6.86612 14.8661C7.10054 14.6317 7.41848 14.5 7.75 14.5ZM12 14.5C12.3315 14.5 12.6495 14.6317 12.8839 14.8661C13.1183 15.1005 13.25 15.4185 13.25 15.75C13.25 16.0815 13.1183 16.3995 12.8839 16.6339C12.6495 16.8683 12.3315 17 12 17C11.6685 17 11.3505 16.8683 11.1161 16.6339C10.8817 16.3995 10.75 16.0815 10.75 15.75C10.75 15.4185 10.8817 15.1005 11.1161 14.8661C11.3505 14.6317 11.6685 14.5 12 14.5ZM7.75 10.5C8.08152 10.5 8.39946 10.6317 8.63388 10.8661C8.8683 11.1005 9 11.4185 9 11.75C9 12.0815 8.8683 12.3995 8.63388 12.6339C8.39946 12.8683 8.08152 13 7.75 13C7.41848 13 7.10054 12.8683 6.86612 12.6339C6.6317 12.3995 6.5 12.0815 6.5 11.75C6.5 11.4185 6.6317 11.1005 6.86612 10.8661C7.10054 10.6317 7.41848 10.5 7.75 10.5ZM12 10.5C12.3315 10.5 12.6495 10.6317 12.8839 10.8661C13.1183 11.1005 13.25 11.4185 13.25 11.75C13.25 12.0815 13.1183 12.3995 12.8839 12.6339C12.6495 12.8683 12.3315 13 12 13C11.6685 13 11.3505 12.8683 11.1161 12.6339C10.8817 12.3995 10.75 12.0815 10.75 11.75C10.75 11.4185 10.8817 11.1005 11.1161 10.8661C11.3505 10.6317 11.6685 10.5 12 10.5ZM16.25 10.5C16.5815 10.5 16.8995 10.6317 17.1339 10.8661C17.3683 11.1005 17.5 11.4185 17.5 11.75C17.5 12.0815 17.3683 12.3995 17.1339 12.6339C16.8995 12.8683 16.5815 13 16.25 13C15.9185 13 15.6005 12.8683 15.3661 12.6339C15.1317 12.3995 15 12.0815 15 11.75C15 11.4185 15.1317 11.1005 15.3661 10.8661C15.6005 10.6317 15.9185 10.5 16.25 10.5ZM17.75 4.5H6.25C5.78587 4.5 5.34075 4.68437 5.01256 5.01256C4.68437 5.34075 4.5 5.78587 4.5 6.25V7H19.5V6.25C19.5 5.78587 19.3156 5.34075 18.9874 5.01256C18.6592 4.68437 18.2141 4.5 17.75 4.5Z' fill='%238B8C9E'/%3e%3c/svg%3e";const Yt=["control","name","required","label","placeholder","defaultValue","format","hideErrorMessage","textFieldProps","requiredErrorText","validate","validateErrorText"],Zt=()=>l("img",{src:Gt,alt:""}),Kt=e=>{let{control:r,name:t,required:n,label:s,placeholder:d,defaultValue:c,format:h=Er,hideErrorMessage:f=!1,textFieldProps:g={},requiredErrorText:y="",validate:b,validateErrorText:v}=e,C=Lr(e,Yt);const[E,T]=p(Er),{field:O,fieldState:{error:S}}=x({control:r,name:t,defaultValue:c,rules:{required:!!n&&(y||Mr),validate:b||(e=>!(""!==e&&!ue(e,E))||(v||Nr))}}),w=m((e=>{O.onChange(ce(e)?se(e,E):e)}),[O,E]);return u((()=>{const e=h.replace(/[Z,z,x]+/g,"XX");try{ue(se(new Date,e),e),T(e)}catch(e){console.error(e)}}),[h]),o(i,{children:[l(W,{required:n,children:s}),l(ae,Object.assign({},O,E?{inputFormat:E}:{},{value:E?de(O.value,E,new Date):O.value,onChange:w,components:{OpenPickerIcon:Zt}},C,{renderInput:e=>l(a,Object.assign({},e,{fullWidth:!0,size:"small",variant:"outlined",name:t,error:!!S,helperText:!f&&(null==S?void 0:S.message),FormHelperTextProps:{variant:"standard"},inputProps:Object.assign({},e.inputProps,{placeholder:d})},g))}))]})},Ut=["control","name","required","label","placeholder","defaultValue","format","hideErrorMessage","textFieldProps","requiredErrorText","validate","validateErrorText"],Xt=()=>l("img",{src:Gt,alt:""}),Qt=e=>{let{control:r,name:t,required:n,label:s,placeholder:d,defaultValue:c,format:h=Or,hideErrorMessage:f=!1,textFieldProps:g,requiredErrorText:y="",validate:b,validateErrorText:v}=e,C=Lr(e,Ut);const[E,T]=p(),{field:O,fieldState:{error:S}}=x({control:r,name:t,defaultValue:c,rules:{required:!!n&&(y||Mr),validate:b||(e=>!(""!==e&&!ue(e,E))||(v||Nr))}}),w=m((e=>{O.onChange(ce(e)?se(e,E):e)}),[O,E]);return u((()=>{const e=h.replace(/[Z,z,x]+/g,"XX");try{ue(se(new Date,e),e),T(e)}catch(e){console.error(e)}}),[h]),l(pe,Object.assign({},O,{ampm:!1,label:n?o(i,{children:[s," ",l("span",{children:"*"})]}):s,value:E?de(O.value,E,new Date):O.value},E?{inputFormat:E}:{},{onChange:w,components:{OpenPickerIcon:Xt}},C,{renderInput:e=>l(a,Object.assign({},e,{fullWidth:!0,size:"small",sx:{".MuiInputLabel-root span":{color:"#D6331F"}},inputProps:Object.assign({},e.inputProps,{placeholder:d}),variant:"outlined",name:t,error:!!S,helperText:!f&&(null==S?void 0:S.message),FormHelperTextProps:{variant:"standard"}},g))}))},en=["control","name","required","label","textFieldProps","format","hideErrorMessage","requiredErrorText","placeholder","defaultValue"],rn=["onChange","ref","value"],tn=e=>{let{control:r,name:t,required:n,label:s,textFieldProps:d={},format:c=Tr,hideErrorMessage:m=!1,requiredErrorText:h="",placeholder:f,defaultValue:g}=e,y=Lr(e,en);const b=x({control:r,name:t,defaultValue:g,rules:{required:!!n&&(h||Mr),validate:e=>!!ue(e,c)||"Incorrect date format"}}),{field:{onChange:v,ref:C,value:E},fieldState:{error:T}}=b,O=Lr(b.field,rn),[S,w]=p(null);return u((()=>{if(E&&c){let e=de(E,c,new Date);ce(e)||(e=de(E,"HH:mm:ss.SSS",new Date)),w(e)}}),[E,c]),l(me,Object.assign({},O,{mask:"",inputRef:C,label:n?o(i,{children:[s," ",l("span",{children:"*"})]}):s,ampm:!1,value:S,inputFormat:c,onChange:e=>{w(e),v(ce(e)?se(e,c):e)}},y,{renderInput:e=>l(a,Object.assign({},e,{fullWidth:!0,size:"small",sx:{".MuiInputLabel-root span":{color:"#D6331F"}},inputProps:Object.assign({},e.inputProps,{placeholder:f}),variant:"outlined",name:t,error:!!T,helperText:!m&&(null==T?void 0:T.message),FormHelperTextProps:{variant:"standard"}}))}))},nn=["name","control","label","required","defaultValue","onChange","textFieldLabel"],ln=["onChange","value"],on=e=>{var r,t,n;let{name:s,control:d,label:c,required:u,defaultValue:f=null,onChange:g,textFieldLabel:y}=e,b=Lr(e,nn);const[v,C]=p(""),[E,T]=p(null),O=x({control:d,name:s,defaultValue:f,rules:{required:u&&Mr}}),{field:{onChange:S,value:w},formState:{errors:k}}=O,R=Lr(O.field,ln),M=h((()=>g||S),[g,S]),N=m((e=>{const{value:r}=e.target;C(r)}),[]),I=m((()=>{T(null),!v||Array.isArray(w)&&w.includes(v)?Array.isArray(w)&&w.includes(v)&&T("This value already exists"):(M([...null!=w?w:[],v]),C(""))}),[v,M,w]),F=m((e=>{M(w.filter((r=>r!==e)))}),[w,M]),D=m((e=>{"Enter"!==e.key&&13!==e.keyCode||(e.stopPropagation(),e.preventDefault(),I())}),[I]);return o(i,{children:[l(W,{required:u,children:c}),l(P,{display:"flex",flexWrap:"wrap",children:null==w?void 0:w.map(((e,r)=>l(he,{sx:{mr:1,mb:1},variant:"outlined",label:e,onDelete:()=>F(e)},r)))}),l("input",Object.assign({type:"hidden"},d.register(s),{onChange:M,value:w},R)),l(a,Object.assign({fullWidth:!0,variant:"outlined",size:"small",label:y||""===y?y:`Add ${c}`,value:v,onChange:N,error:!(null==(r=k[s])||!r.message),helperText:null==(t=k[s])?void 0:t.message,FormHelperTextProps:{variant:"standard"},name:s,onKeyDown:D,InputProps:{endAdornment:l(L,{size:"small",onClick:I,children:l(V,{children:l("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})})},inputProps:Object.assign({},null!=(n=null==b?void 0:b.inputProps)?n:{})},b)),E&&l(B,{error:!0,children:E})]})},an=({name:e="period",control:r,label:t="Period",required:n,isSecondsVisible:s=!1})=>{var d;const[c,h]=p(),{setValue:f,register:g,formState:{errors:y}}=T(),b=E({control:r,name:e}),v=m((r=>{const{name:t,value:n}=r.target,l=Object.assign({},null!=c?c:{});n?(l[t]=+n,f(e,ge(l),{shouldValidate:!0})):(delete l[t],f(e,"",{shouldValidate:!0})),h(l)}),[f,e,c]),C=null==(d=y[e])?void 0:d.message;return u((()=>{b&&!c&&h(ye(b))}),[c,b]),o(i,{children:[l("input",Object.assign({type:"hidden"},g(e,{required:n&&"Please, fill one of the fields"}))),l(A,{variant:"subtitle1",children:n?o(i,{children:[t," ",l(P,{component:"span",color:"#D6331F",children:"*"})]}):t}),C&&l(B,{error:!0,children:C}),o(fe,{container:!0,columns:2,spacing:2,flexWrap:"wrap",children:[l(fe,{sm:1,children:l(a,{variant:"outlined",size:"small",value:(null==c?void 0:c.years)||"",error:!!C,name:"years",label:"Years",type:"number",onChange:v,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})}),l(fe,{sm:1,children:l(a,{variant:"outlined",size:"small",error:!!C,value:(null==c?void 0:c.months)||"",name:"months",label:"Months",type:"number",onChange:v,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})}),l(fe,{sm:1,children:l(a,{variant:"outlined",size:"small",error:!!C,value:(null==c?void 0:c.weeks)||"",name:"weeks",label:"Weeks",type:"number",onChange:v,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})}),l(fe,{sm:1,children:l(a,{variant:"outlined",size:"small",error:!!C,value:(null==c?void 0:c.days)||"",name:"days",label:"Days",type:"number",onChange:v,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})}),l(fe,{sm:1,children:l(a,{variant:"outlined",size:"small",error:!!C,value:(null==c?void 0:c.hours)||"",name:"hours",label:"Hours",type:"number",onChange:v,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})}),l(fe,{sm:1,children:l(a,{variant:"outlined",size:"small",error:!!C,value:(null==c?void 0:c.minutes)||"",name:"minutes",label:"Minutes",type:"number",onChange:v,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})}),s&&l(fe,{sm:1,children:l(a,{variant:"outlined",size:"small",error:!!C,value:(null==c?void 0:c.seconds)||"",name:"seconds",label:"Seconds",type:"number",onChange:v,fullWidth:!0,FormHelperTextProps:{variant:"standard"}})})]})]})};const sn=["control","name","label","required","mask","requiredErrorText","inputMaskProps","disabled","invalidErrorText"],dn=e=>{let{control:r,name:t,label:n,required:s,mask:d="+7 (799) 999 99 99",requiredErrorText:c="",inputMaskProps:u,disabled:p,invalidErrorText:m}=e,h=Lr(e,sn);return l(O,{control:r,name:t,rules:{required:!!s&&(c||Mr),validate:e=>!s&&!e||(!!/(\+7\s\(\d{3}\)\s)(\d{3}\s\d{2})(\s\d{2})/.test(e)||(m||"Incorrect phone number format"))},render:({field:e,fieldState:{error:r}})=>l(be,Object.assign({disabled:p,mask:d,value:e.value,onChange:e.onChange,onBlur:e.onBlur},u,{children:l(a,Object.assign({fullWidth:!0,size:"small",label:s&&n?o(i,{children:[n," ",l("span",{children:"*"})]}):n,sx:{".MuiInputLabel-root span":{color:"#D6331F"}},inputMode:"numeric",InputProps:{startAdornment:l(k,{position:"start",children:l("img",{src:"data:image/svg+xml,%3csvg width='32' height='24' viewBox='0 0 32 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg clip-path='url(%23clip0_6762_5474)'%3e%3crect width='32' height='24' rx='2' fill='white'/%3e%3cmask id='mask0_6762_5474' style='mask-type:luminance' maskUnits='userSpaceOnUse' x='0' y='0' width='32' height='24'%3e%3crect width='32' height='24' rx='2' fill='white'/%3e%3c/mask%3e%3cg mask='url(%23mask0_6762_5474)'%3e%3crect width='32' height='24' fill='%2330C6E0'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M16.0001 16.8002C18.5249 16.8002 20.5716 14.6512 20.5716 12.0002C20.5716 9.34923 18.5249 7.2002 16.0001 7.2002C13.4754 7.2002 11.4287 9.34923 11.4287 12.0002C11.4287 14.6512 13.4754 16.8002 16.0001 16.8002Z' fill='%23FFCD4B'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M14.1352 20.5791L16.0001 17.6561L17.865 20.5791L18.3374 17.096L21.2255 18.8799L20.2118 15.5264L23.5511 15.818L21.252 13.2584L24.381 11.9998L21.252 10.7411L23.5511 8.1816L20.2118 8.47311L21.2255 5.11966L18.3374 6.90359L17.865 3.42041L16.0001 6.34344L14.1352 3.42041L13.6628 6.90359L10.7747 5.11966L11.7884 8.47311L8.44912 8.1816L10.7482 10.7411L7.61914 11.9998L10.7482 13.2584L8.44912 15.818L11.7884 15.5264L10.7747 18.8799L13.6628 17.096L14.1352 20.5791ZM21.3334 11.9998C21.3334 15.0926 18.9456 17.5998 16.0001 17.5998C13.0546 17.5998 10.6668 15.0926 10.6668 11.9998C10.6668 8.90698 13.0546 6.39978 16.0001 6.39978C18.9456 6.39978 21.3334 8.90698 21.3334 11.9998Z' fill='%23FFCD4B'/%3e%3cpath fill-rule='evenodd' clip-rule='evenodd' d='M1.52393 1.93343C1.52393 1.74934 1.67316 1.6001 1.85726 1.6001H2.7144C2.8985 1.6001 3.04774 1.74934 3.04774 1.93343V2.86676C3.04774 3.05086 2.8985 3.2001 2.7144 3.2001H1.85726C1.67316 3.2001 1.52393 3.05086 1.52393 2.86676V1.93343ZM1.52393 5.13343C1.52393 4.94934 1.67316 4.8001 1.85726 4.8001H2.7144C2.8985 4.8001 3.04774 4.94934 3.04774 5.13343V6.06676C3.04774 6.25086 2.8985 6.4001 2.7144 6.4001H1.85726C1.67316 6.4001 1.52393 6.25086 1.52393 6.06676V5.13343ZM1.85726 8.0001C1.67316 8.0001 1.52393 8.14934 1.52393 8.33343V9.26676C1.52393 9.45086 1.67316 9.6001 1.85726 9.6001H2.7144C2.8985 9.6001 3.04774 9.45086 3.04774 9.26676V8.33343C3.04774 8.14934 2.8985 8.0001 2.7144 8.0001H1.85726ZM1.52393 11.5334C1.52393 11.3493 1.67316 11.2001 1.85726 11.2001H2.7144C2.8985 11.2001 3.04774 11.3493 3.04774 11.5334V12.4668C3.04774 12.6509 2.8985 12.8001 2.7144 12.8001H1.85726C1.67316 12.8001 1.52393 12.6509 1.52393 12.4668V11.5334ZM1.85726 14.4001C1.67316 14.4001 1.52393 14.5493 1.52393 14.7334V15.6668C1.52393 15.8509 1.67316 16.0001 1.85726 16.0001H2.7144C2.8985 16.0001 3.04774 15.8509 3.04774 15.6668V14.7334C3.04774 14.5493 2.8985 14.4001 2.7144 14.4001H1.85726ZM1.52393 17.9334C1.52393 17.7493 1.67316 17.6001 1.85726 17.6001H2.7144C2.8985 17.6001 3.04774 17.7493 3.04774 17.9334V18.8668C3.04774 19.0509 2.8985 19.2001 2.7144 19.2001H1.85726C1.67316 19.2001 1.52393 19.0509 1.52393 18.8668V17.9334ZM1.85726 20.8001C1.67316 20.8001 1.52393 20.9493 1.52393 21.1334V22.0668C1.52393 22.2509 1.67316 22.4001 1.85726 22.4001H2.7144C2.8985 22.4001 3.04774 22.2509 3.04774 22.0668V21.1334C3.04774 20.9493 2.8985 20.8001 2.7144 20.8001H1.85726ZM3.04774 19.5334C3.04774 19.3493 3.19697 19.2001 3.38107 19.2001H4.23821C4.42231 19.2001 4.57154 19.3493 4.57154 19.5334V20.4668C4.57154 20.6509 4.42231 20.8001 4.23821 20.8001H3.38107C3.19697 20.8001 3.04774 20.6509 3.04774 20.4668V19.5334ZM3.38107 16.0001C3.19697 16.0001 3.04774 16.1493 3.04774 16.3334V17.2668C3.04774 17.4509 3.19697 17.6001 3.38107 17.6001H4.23821C4.42231 17.6001 4.57154 17.4509 4.57154 17.2668V16.3334C4.57154 16.1493 4.42231 16.0001 4.23821 16.0001H3.38107ZM3.04774 13.1334C3.04774 12.9493 3.19697 12.8001 3.38107 12.8001H4.23821C4.42231 12.8001 4.57154 12.9493 4.57154 13.1334V14.0668C4.57154 14.2509 4.42231 14.4001 4.23821 14.4001H3.38107C3.19697 14.4001 3.04774 14.2509 3.04774 14.0668V13.1334ZM3.38107 9.6001C3.19697 9.6001 3.04774 9.74934 3.04774 9.93343V10.8668C3.04774 11.0509 3.19697 11.2001 3.38107 11.2001H4.23821C4.42231 11.2001 4.57154 11.0509 4.57154 10.8668V9.93343C4.57154 9.74934 4.42231 9.6001 4.23821 9.6001H3.38107ZM3.04774 6.73343C3.04774 6.54934 3.19697 6.4001 3.38107 6.4001H4.23821C4.42231 6.4001 4.57154 6.54934 4.57154 6.73343V7.66676C4.57154 7.85086 4.42231 8.0001 4.23821 8.0001H3.38107C3.19697 8.0001 3.04774 7.85086 3.04774 7.66676V6.73343ZM3.38107 3.2001C3.19697 3.2001 3.04774 3.34934 3.04774 3.53343V4.46676C3.04774 4.65086 3.19697 4.8001 3.38107 4.8001H4.23821C4.42231 4.8001 4.57154 4.65086 4.57154 4.46676V3.53343C4.57154 3.34934 4.42231 3.2001 4.23821 3.2001H3.38107Z' fill='%23FFCD4B'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cclipPath id='clip0_6762_5474'%3e%3crect width='32' height='24' rx='4' fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",alt:""})})}},h,{error:!!r,FormHelperTextProps:{variant:"standard"},helperText:null==r?void 0:r.message}))}))})};var cn="data:image/svg+xml,%3csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M5.99995 8L9.99995 12L14 8H5.99995Z' fill='%236D7C8B'/%3e%3c/svg%3e";const un=()=>l("img",{src:cn,alt:""});var pn=()=>{const e=xe(),r=Ee(e,Te),t=Ee(e,Oe),n=Ee(e,Se),i=Ee(e,we),a=r=>e.current.setPage(r);return o(P,{px:2,display:"flex",alignItems:"center",children:[l(Ce,{component:"div",page:r,count:n,rowsPerPage:i,rowsPerPageOptions:[10,20,50,100],onPageChange:(e,r)=>a(r),onRowsPerPageChange:r=>e.current.setPageSize(parseInt(r.target.value,10)),labelRowsPerPage:"Строк на странице",labelDisplayedRows:({from:e,to:r,count:t})=>`${e}–${r} из ${-1!==t?t:`более ${r}`}`,ActionsComponent:void 0,SelectProps:{IconComponent:un}}),l(ve,{count:t,page:r+1,onChange:(e,r)=>a(r-1)})]})};const mn=["hideMenu","currentColumn","onUnsort"];var hn=e=>{let{hideMenu:r,currentColumn:t}=e,n=Lr(e,mn);return l(Ve,Object.assign({hideMenu:r,currentColumn:t},n,{children:l(Le,{onClick:r,column:t})}))};var fn=({mode:e})=>{const[r,t]=re(),n=+r.get("page")||0,l=+r.get("size")||10;return u((()=>{"server"===e&&(r.has("page")||r.set("page","0"),r.has("size")||r.set("size","10"),t(r,{replace:!0}))}),[e,r,t]),{page:n,size:l,onPageChange:e=>{r.set("page",`${e}`),t(r,{replace:!0})},onSizeChange:e=>{r.set("size",`${e}`),t(r,{replace:!0})}}};var gn=()=>{const[e,r]=re(),t=e.getAll("sort").map((e=>e.split(",")));return{onColumnHeaderClick:({field:t,colDef:n})=>{if(n.sortable){let n=!1;const l=e.getAll("sort");e.delete("sort"),l.forEach((r=>{const[l,o]=r.split(",");l===t?(n=!0,"asc"===o&&e.append("sort",`${l},desc`)):e.append("sort",`${l},${o}`)})),n||e.append("sort",`${t},asc`),r(e,{replace:!0})}},getSortedColumns:e=>e.map((e=>{const r=t.find((r=>r[0]===e.field));return e.headerClassName=r?`Sorted --${r[1]} `:"",e}))}};var yn=e=>{const[r,t]=p(10);u((()=>{t(e)}),[e]);return{pageSize:r,handlePageSizeChange:e=>t(e)}},bn="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M3.47341 10.4087C3.3698 10.2747 3.32108 10.1063 3.33715 9.9377C3.35321 9.76909 3.43285 9.61291 3.55989 9.50088C3.68693 9.38886 3.85185 9.3294 4.02115 9.33457C4.19045 9.33974 4.35144 9.40915 4.47141 9.52872L8.00008 13.0574L11.5287 9.52872L11.5914 9.47338C11.7254 9.36978 11.8938 9.32106 12.0624 9.33712C12.231 9.35318 12.3872 9.43282 12.4992 9.55987C12.6113 9.68691 12.6707 9.85183 12.6656 10.0211C12.6604 10.1904 12.591 10.3514 12.4714 10.4714L8.47141 14.4714L8.40874 14.5267C8.28047 14.6262 8.12031 14.6755 7.95829 14.6653C7.79627 14.6551 7.64354 14.5862 7.52874 14.4714L3.52874 10.4714L3.47341 10.4087ZM12.5267 5.59138C12.6304 5.72538 12.6791 5.89379 12.663 6.0624C12.6469 6.23102 12.5673 6.3872 12.4403 6.49922C12.3132 6.61124 12.1483 6.67071 11.979 6.66554C11.8097 6.66037 11.6487 6.59095 11.5287 6.47138L8.00008 2.94272L4.47141 6.47138L4.40874 6.52672C4.27475 6.63032 4.10634 6.67905 3.93773 6.66298C3.76911 6.64692 3.61293 6.56728 3.50091 6.44024C3.38889 6.31319 3.32942 6.14827 3.33459 5.97897C3.33976 5.80967 3.40918 5.64869 3.52874 5.52872L7.52874 1.52872L7.59141 1.47338C7.71968 1.37388 7.87985 1.3246 8.04187 1.33479C8.20388 1.34498 8.35662 1.41393 8.47141 1.52872L12.4714 5.52872L12.5267 5.59138Z' fill='%23262842'/%3e%3c/svg%3e",vn="data:image/svg+xml,%3c%3fxml version='1.0' encoding='utf-8'%3f%3e%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cg transform='matrix(1%2c 0%2c 0%2c 1%2c 0.05728%2c 0.935561)'%3e %3cpath d='M 3.473 9.409 C 3.37 9.275 3.321 9.106 3.337 8.938 C 3.353 8.769 3.433 8.613 3.56 8.501 C 3.687 8.389 3.852 8.329 4.021 8.335 C 4.19 8.34 4.351 8.409 4.471 8.529 L 8 12.057 L 11.529 8.529 L 11.591 8.473 C 11.725 8.37 11.894 8.321 12.062 8.337 C 12.231 8.353 12.387 8.433 12.499 8.56 C 12.611 8.687 12.671 8.852 12.666 9.021 C 12.66 9.19 12.591 9.351 12.471 9.471 L 8.471 13.471 L 8.409 13.527 C 8.28 13.626 8.12 13.676 7.958 13.665 C 7.796 13.655 7.644 13.586 7.529 13.471 L 3.529 9.471 L 3.473 9.409 Z' fill='%23262842' style='fill-opacity: 0.6%3b'/%3e %3cpath d='M 12.472 4.636 C 12.575 4.77 12.624 4.939 12.608 5.107 C 12.592 5.276 12.512 5.432 12.385 5.544 C 12.258 5.656 12.093 5.716 11.924 5.71 C 11.755 5.705 11.594 5.636 11.474 5.516 L 7.945 1.988 L 4.416 5.516 L 4.354 5.572 C 4.22 5.675 4.051 5.724 3.883 5.708 C 3.714 5.692 3.558 5.612 3.446 5.485 C 3.334 5.358 3.274 5.193 3.28 5.024 C 3.285 4.855 3.354 4.694 3.474 4.574 L 7.474 0.574 L 7.536 0.518 C 7.665 0.419 7.825 0.37 7.987 0.38 C 8.149 0.39 8.302 0.459 8.416 0.574 L 12.416 4.574 L 12.472 4.636 Z' fill='%23262842' style='fill-opacity: 1%3b'/%3e %3c/g%3e%3c/svg%3e",Cn="data:image/svg+xml,%3c%3fxml version='1.0' encoding='utf-8'%3f%3e%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cg transform='matrix(1%2c 0%2c 0%2c 1%2c 0.05728%2c 0.935561)'%3e %3cpath d='M 3.473 9.409 C 3.37 9.275 3.321 9.106 3.337 8.938 C 3.353 8.769 3.433 8.613 3.56 8.501 C 3.687 8.389 3.852 8.329 4.021 8.335 C 4.19 8.34 4.351 8.409 4.471 8.529 L 8 12.057 L 11.529 8.529 L 11.591 8.473 C 11.725 8.37 11.894 8.321 12.062 8.337 C 12.231 8.353 12.387 8.433 12.499 8.56 C 12.611 8.687 12.671 8.852 12.666 9.021 C 12.66 9.19 12.591 9.351 12.471 9.471 L 8.471 13.471 L 8.409 13.527 C 8.28 13.626 8.12 13.676 7.958 13.665 C 7.796 13.655 7.644 13.586 7.529 13.471 L 3.529 9.471 L 3.473 9.409 Z' fill='%23262842' style='fill-opacity: 1%3b'/%3e %3cpath d='M 12.472 4.636 C 12.575 4.77 12.624 4.939 12.608 5.107 C 12.592 5.276 12.512 5.432 12.385 5.544 C 12.258 5.656 12.093 5.716 11.924 5.71 C 11.755 5.705 11.594 5.636 11.474 5.516 L 7.945 1.988 L 4.416 5.516 L 4.354 5.572 C 4.22 5.675 4.051 5.724 3.883 5.708 C 3.714 5.692 3.558 5.612 3.446 5.485 C 3.334 5.358 3.274 5.193 3.28 5.024 C 3.285 4.855 3.354 4.694 3.474 4.574 L 7.474 0.574 L 7.536 0.518 C 7.665 0.419 7.825 0.37 7.987 0.38 C 8.149 0.39 8.302 0.459 8.416 0.574 L 12.416 4.574 L 12.472 4.636 Z' fill='%23262842' style='fill-opacity: 0.6%3b'/%3e %3c/g%3e%3c/svg%3e";const xn=["columns","rows","rowCount","loading","disableMargin","mode","initialPageSize","pagination","onCellClick"],En=["sortingOrder"],Tn=["sortingOrder"],On=["sortingOrder"],Sn=()=>l("img",{src:bn,alt:""}),wn=()=>l("img",{src:vn,alt:""}),Vn=()=>l("img",{src:Cn,alt:""}),Ln=e=>{let{columns:r,rows:t,rowCount:n,loading:o,disableMargin:i,mode:a="server",initialPageSize:s=10,pagination:d=!0,onCellClick:c}=e,u=Lr(e,xn);const{page:p,size:m,onPageChange:h,onSizeChange:f}=fn({mode:a}),{onColumnHeaderClick:g,getSortedColumns:y}=gn(),{pageSize:b,handlePageSizeChange:v}=yn(s),C={sortingMode:a,paginationMode:a,pageSize:"server"===a?m:d?b:n,onPageSizeChange:"server"===a?f:v,components:{BaseTooltip:U,Pagination:pn,ColumnUnsortedIcon:e=>(Lr(e,En),l(Sn,{})),ColumnSortedDescendingIcon:e=>(Lr(e,Tn),l(Vn,{})),ColumnSortedAscendingIcon:e=>(Lr(e,On),l(wn,{}))}};return"server"===a&&(C.onColumnHeaderClick=g,C.page=p,C.onPageChange=h,C.components.ColumnMenu=hn),l(P,{mt:i?0:2,children:l(ke,Object.assign({autoHeight:!0,hideFooterPagination:!d,hideFooter:!d,disableSelectionOnClick:!0,loading:o,rows:t,disableColumnMenu:!0,columns:y(r),rowCount:n,rowsPerPageOptions:[10,20,50,100],onCellClick:c},C,u))})},kn=({icon:e,label:r,showInMenu:t,onClick:n,location:o})=>{var i;return o?l(L,{component:ee,to:o.pathname,state:null!=(i=o.state)?i:null,size:"small",children:l(U,{title:r,arrow:!0,children:d.cloneElement(e,{fontSize:"small"})})}):l(Re,{nonce:"",onResize:void 0,onResizeCapture:void 0,icon:l(U,{title:r,arrow:!0,children:e}),onClick:n,label:r,showInMenu:t})};var Rn=()=>{const[e,r]=re(),t=h((()=>{var r;return null!=(r=e.get("page"))?r:0}),[e]),n=h((()=>{var r;return null!=(r=e.get("size"))?r:10}),[e]),l=m((e=>{r((r=>(r.set("page",`${e}`),r)))}),[r]),o=m((e=>{r((r=>(r.set("size",`${e}`),r)))}),[r]);return u((()=>{e.has("page")||r((e=>(e.set("page","0"),e))),e.has("size")||r((e=>(e.set("size","10"),e)))}),[e,r]),{page:t,size:n,onPageChange:l,onSizeChange:o}};var Mn=()=>{const[e,r]=re(),t=h((()=>e.getAll("sort").map((e=>e.split(",")))),[e]),n=m((e=>{r((r=>{r.delete("sort");let n=!1;return t.forEach((([t,l])=>{t===e?(n=!0,"asc"===l&&r.append("sort",`${t},desc`)):r.append("sort",`${t},${l}`)})),n||r.append("sort",`${e},asc`),r}))}),[t,r]),l=m((e=>{const r=t.find((([r,t])=>r===e));return!!r&&r[1]}),[t]);return{sortParams:t,onSortChanged:n,getColumnSorting:l}};const Nn=t($e)((({active:e})=>({".MuiSvgIcon-root":{opacity:e?1:.5,marginTop:"4%"}}))),In=()=>l("img",{src:cn,alt:""}),Fn=()=>l("img",{src:bn,alt:""}),Dn=()=>l("img",{src:vn,alt:""}),Pn=()=>l("img",{src:Cn,alt:""});function An({columns:e=[],rows:r=[],totalCount:t,children:n,pagination:i=!0,loading:a=!1,onRowClick:s,emptyDataText:d,verticalAlign:c="middle",labelRowsPerPage:u},p){const{page:m,size:h,onPageChange:f,onSizeChange:g}=Rn(),{onSortChanged:y,getColumnSorting:b}=Mn();return l(P,{sx:{overflow:"auto"},children:o(Fe,{sx:{width:"100%",display:"table",tableLayout:"fixed"},children:[l(qe,{open:a,sx:{position:"absolute",top:0,left:0},children:l(wr,{})}),o(Me,{ref:p,children:[l(De,{children:l(Pe,{children:e.map(((e,r)=>{const t=!!e.sortKey&&b(e.sortKey);return l(Ie,{align:e.align?e.align:"left",sortDirection:t,sx:{width:e.width?`${e.width}%`:"unset"},children:l(Nn,{active:!!t,hideSortIcon:!e.sortKey,direction:t||"asc",IconComponent:"asc"===t?Dn:"desc"===t?Pn:Fn,onClick:()=>e.sortKey?y(e.sortKey):{},children:e.label})},r)}))})}),l(Ne,{children:r.length?r.map(((r,t)=>l(Pe,{hover:!0,onClick:s?()=>s(r):r.onClick,sx:{verticalAlign:c},children:e.map(((e,n)=>l(Ie,{align:e.align?e.align:"left",sx:{maxWidth:e.width?`${e.width}%`:"unset"},children:l(P,{sx:{maxWidth:"90%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",padding:({spacing:e})=>e(2.4,0)},children:l(P,{children:e.renderCell?e.renderCell(r,t):r[e.id]})})},n)))},t))):l(Pe,{sx:{verticalAlign:c},children:l(Ie,{align:"center",colSpan:e.length,children:null!=d?d:"Нет данных"})})}),i||n?l(Ae,{children:o(Pe,{children:[n&&l(Ie,{colSpan:e.length,sx:{background:"#F0F0F7",px:4,py:3},children:n}),i&&r.length?l(Ce,{rowsPerPageOptions:[5,10,25],count:t,rowsPerPage:+h,page:+m,sx:{borderBottom:"none"},labelRowsPerPage:u,labelDisplayedRows:u?({from:e,to:r,count:t})=>`${e}–${r} из ${-1!==t?t:`более ${r}`}`:void 0,SelectProps:{IconComponent:In},onPageChange:(e,r)=>f(r),onRowsPerPageChange:e=>g(+e.target.value)}):null]})}):null]})]})})}const qn=f(An),$n=({actionsList:e})=>{const[r,t]=p(null),n=Boolean(r),i=()=>{t(null)};return o("div",{children:[l(L,{"aria-label":"more",id:"more-button","aria-controls":n?"more-menu":void 0,"aria-expanded":n?"true":void 0,"aria-haspopup":"true",onClick:e=>{e.stopPropagation(),t(e.currentTarget)},children:l(Be,{})}),l(ze,{id:"more-menu",MenuListProps:{"aria-labelledby":"more-button"},anchorEl:r,open:n,onClose:e=>{e.stopPropagation(),i()},PaperProps:{style:{minWidth:"127px"}},children:e.map((e=>l(s,{onClick:r=>{r.stopPropagation(),e.onClick&&e.onClick(),i()},children:e.title},e.title)))})]})},zn=["children","value","index"],Bn=e=>{const{children:r,value:t,index:n}=e,o=Lr(e,zn);return l("div",Object.assign({role:"tabpanel",hidden:t!==n,id:`simple-tabpanel-${n}`,"aria-labelledby":`simple-tab-${n}`},o,{children:t===n?r:null}))},Hn=e=>{var r;const{tabs:t}=e,n=X(),i=Q(),a=h((()=>new URLSearchParams(i.search)),[i.search]),s=a.get("tab");return o(P,{children:[l(He,{children:l(_e,{value:s||(null==(r=t[0])?void 0:r.name),indicatorColor:"primary",textColor:"primary",onChange:(e,r)=>{a.set("tab",r),n({pathname:i.pathname,search:a.toString()},{replace:!0})},children:t.map((e=>l(je,{value:e.name,label:e.label},e.name)))})}),l(P,{mt:2,children:t.map((e=>{var r;return l(Bn,{value:s||(null==(r=t[0])?void 0:r.name),index:e.name,children:e.component},e.name)}))})]})},jn=({title:e,text:r,json:t})=>o(P,{sx:{paddingBottom:8},children:[l(P,{sx:{fontSize:"14px",fontWeight:600,color:"#536DFE"},children:e}),r&&l(P,{sx:{fontSize:"18px",wordWrap:"break-word"},children:r}),t&&l(ft,{value:t,height:300})]}),_n=Object.values(Sr).sort(((e,r)=>e.localeCompare(r)));var Wn=({propertyFieldName:e,control:r})=>o(i,{children:[l(fe,{children:l(jt,{required:!0,control:r,defaultValue:2,name:`${e}.precisionScale`,label:"Precision Scale"})}),l(fe,{children:l(jr,{required:!0,control:r,name:`${e}.roundingMode`,label:"Rounding Mode",defaultValue:Sr.HALF_UP,options:_n})})]});var Jn=({propertyFieldName:e,control:r,defaultValue:t=""})=>l(fe,{children:l(Dr,{required:!0,control:r,defaultValue:t,name:`${e}.format`,label:"Format"})});const Gn=()=>l("div",{style:{display:"inline-block",width:"10px",height:"10px",borderRadius:"50%",backgroundColor:"#536DFE",marginTop:"5px"}}),Yn=({data:e})=>o(Ue,{nonLinear:!0,orientation:"vertical",connector:l(rr,{sx:{marginLeft:4}}),sx:{width:"100%"},children:[e.filter(Boolean).map(((e,r)=>o(Xe,{expanded:!0,children:[l(Qe,{sx:{display:"flex",alignItems:"flex-start"},StepIconComponent:Gn,StepIconProps:{icon:"",completed:!1,active:!0},children:e.label}),l(er,{sx:{marginLeft:4},children:e.content})]},r))),l(Xe,{})]}),Zn=({properties:e=[]})=>{const r=h((()=>e?e.map((e=>{const r="string"==typeof e.propertyType?e.propertyType:e.propertyType?e.propertyType.value:"";return{label:o(P,{display:"flex",flexDirection:"column",children:[o("b",{children:[e.name,e.isRequired?"*":""]}),o("span",{children:[e.key," | ",e.isMultiple?"multiple":"single"," |"," ",r]})]}),content:"ENTITY"===e.propertyType&&l(Zn,{properties:e.properties})}})):[]),[e]);return l(Yn,{data:r})};var Kn=Zn;const Un={key:"",propertyType:null,name:"",defaultValue:"",value:"",defaultValues:[],isRequired:!0,isMultiple:!1,sortOrder:0,isEnabled:!0,executeValue:"",uiSettings:""};var Xn=({control:e,parentPropertyFieldName:r,entityDefinition:t=!1,globalParameter:n=!1,entityReferenceDefinitionSources:a,entityReferenceValueComponent:s,fileReferenceValueComponent:d})=>{const u=c(null),{field:{onChange:h}}=x({control:e,name:`${r}.properties`}),f=E({control:e,name:`${r}.properties`,defaultValue:[]}),g=E({control:e,name:`${r}.name`}),{append:y,remove:b}=S({control:e,name:`${r}.properties`}),v=Ar(),[C,T]=p(0),O=m((()=>{if((null==f?void 0:f.length)>0){y(Un);const e=f.length;T(e)}else y(Un);u.current.addProperty()}),[f,y]),w=async()=>{h(u.current.getProperties()),v.onClose()};return o(i,{children:[l(fe,{children:l(A,{variant:"h6",children:"Properties"})}),l(fe,{children:l(Kn,{properties:f})}),l(fe,{children:l(R,{variant:"contained",color:"primary",onClick:v.onOpen,children:"Edit properties"})}),o(M,{disableEscapeKeyDown:!0,open:v.open,onClose:w,fullWidth:!0,maxWidth:"md",children:[o(D,{children:[g||"Entity"," Properties"]}),l(I,{style:{height:"500px",overflow:"hidden"},children:o(fe,{container:!0,direction:"row",spacing:2,style:{height:"100%"},children:[o(fe,{xs:3,style:{backgroundColor:"#f9f9f9",height:"100%",overflowY:"auto"},children:[l(Ue,{nonLinear:!0,activeStep:C,orientation:"vertical",style:{paddingLeft:"4px"},children:f.map(((e,r)=>o(Xe,{onClick:()=>(e=>T(e))(r),style:{cursor:"pointer"},children:[l(Qe,{StepIconProps:{icon:""},style:{wordBreak:"break-word"},children:e.name||"(no name)"}),l(er,{})]},r)))}),l(R,{variant:"contained",size:"small",color:"primary",onClick:O,children:"Add property"})]}),l(fe,{container:!0,wrap:"nowrap",direction:"column",spacing:2,style:{height:"100%",overflowY:"auto",width:"75%"},children:l(Vl,{ref:u,properties:f,hideAddButton:!0,parentRemove:b,focusOnIndex:C,entityDefinition:t,globalParameter:n,entityReferenceDefinitionSources:a,entityReferenceValueComponent:s,fileReferenceValueComponent:d})})]})}),l(N,{children:l(R,{variant:"contained",color:"primary",onClick:w,children:"Ok"})})]})]})};var Qn=({propertyFieldName:e,control:r,sources:t=[{label:"Arsenal Entities",value:"ARSENAL_ENTITIES"}]})=>o(i,{children:[l(fe,{children:l(jr,{required:!0,control:r,name:`${e}.source`,label:"Source",options:t})}),l(fe,{children:l(Dr,{required:!0,control:r,name:`${e}.definitionCode`,label:"Definition Code"})}),l(fe,{children:l(Dr,{required:!0,control:r,name:`${e}.definitionVersion`,label:"Definition Version",defaultValue:1})}),l(fe,{children:l(Dr,{required:!0,control:r,name:`${e}.labelPropertyCode`,label:"Label Property Code"})}),l(fe,{children:l(Dr,{required:!0,control:r,name:`${e}.valuePropertyCode`,label:"Value Property Code"})})]});const el=({control:e,propertyType:r,propertyFieldName:t,entityDefinition:n=!1,globalParameter:o=!1,entityReferenceDefinitionSources:i,entityReferenceValueComponent:a,fileReferenceValueComponent:s})=>{switch(r){case xr.STRING:return l(on,{name:`${t}.restrictedValues`,control:e,label:"Restricted Values"});case xr.BIG_DECIMAL:return l(Wn,{propertyFieldName:t,control:e});case xr.DATE:return l(Jn,{control:e,propertyFieldName:t,defaultValue:Er});case xr.TIME:return l(Jn,{control:e,propertyFieldName:t,defaultValue:Tr});case xr.DATE_TIME:return l(Jn,{control:e,propertyFieldName:t,defaultValue:Or});case xr.ENTITY_REFERENCE:return l(Qn,{control:e,propertyFieldName:t,sources:i});case xr.ENTITY:return l(Xn,{control:e,parentPropertyFieldName:t,globalParameter:o,entityDefinition:n,entityReferenceDefinitionSources:i,entityReferenceValueComponent:a,fileReferenceValueComponent:s});default:return null}};var rl=({control:e,name:r,label:t,required:n,restrictedValues:i,requiredErrorText:a="",requiredSelectErrorText:d=""})=>{const{field:{onChange:c,ref:u},fieldState:{error:p}}=x({control:e,name:r,rules:{required:!!n&&(Array.isArray(i)&&i.length?d||"Please, select a value":a||Mr)}}),m=E({control:e,name:r});return Array.isArray(i)&&i.length?o($,{fullWidth:!0,size:"small",variant:"outlined",error:!!p,children:[l(or,{htmlFor:"type-select",children:t}),l(lr,{labelId:"type-select",label:t,value:m||"",onChange:c,ref:u,children:i.map((e=>l(s,{value:e,children:e},e)))})]}):l(Dr,{hideErrorMessage:!0,required:n,control:e,name:r,label:t})};var tl=({name:e})=>{const{control:r,setValue:t,register:n}=T(),a=E({control:r,name:e}),s=m((async r=>{const n=r.target.files[0];(new FileReader).readAsDataURL(n);const l=await(e=>new Promise(((r,t)=>{const n=new FileReader;n.readAsDataURL(e),n.onload=()=>{r(n.result)},n.onerror=e=>{t(e)}})))(n);t(e,l)}),[e,t]);return o(i,{children:[o(P,{mb:2,display:"flex",flex:"row",children:[l(A,{children:"Does file uploaded:"}),l(V,a?{sx:{paddingLeft:2},children:l("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}:{sx:{paddingLeft:2},children:l("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8 0-1.85.63-3.55 1.69-4.9L16.9 18.31C15.55 19.37 13.85 20 12 20zm6.31-3.1L7.1 5.69C8.45 4.63 10.15 4 12 4c4.42 0 8 3.58 8 8 0 1.85-.63 3.55-1.69 4.9z"})})]}),o(R,{component:"label",variant:"contained",size:"large",color:"primary",sx:{marginTop:4},children:[a?"Change file":"Upload file",l("input",Object.assign({type:"hidden"},n(`${e}`,{required:!0}))),l("input",{type:"file",hidden:!0,onChange:s})]})]})};const nl=({property:e,name:r,label:t,useExpression:n,control:o,entityReferenceDefinitionSources:i,entityReferenceValueComponent:a,fileReferenceValueComponent:s})=>{var d;switch("string"==typeof e.propertyType?e.propertyType:null==(d=e.propertyType)?void 0:d.value){case xr.BIG_DECIMAL:case xr.FLOAT:case xr.DOUBLE:return l(jt,{required:!0,decimal:!0,hideErrorMessage:!0,control:o,name:r,label:t,valueAsNumber:!0});case xr.INTEGER:case xr.BIG_INTEGER:case xr.LONG:return l(jt,{required:!0,hideErrorMessage:!0,control:o,name:r,label:t,valueAsNumber:!0});case xr.BOOLEAN:return l(Jt,{control:o,name:r});case xr.DATE:return l(Kt,{hideErrorMessage:!0,control:o,name:r,label:t,format:e.format});case xr.TIME:return l(tn,{hideErrorMessage:!0,control:o,name:r,label:t,format:e.format});case xr.DATE_TIME:return l(Qt,{hideErrorMessage:!0,control:o,name:r,label:t,format:e.format});case xr.JSON:return l(at,{control:o,name:r,label:t,parseValue:!0,hideErrorMessage:!0,validateJson:!0});case xr.STRING:return l(rl,{control:o,name:r,label:t,restrictedValues:e.restrictedValues});case xr.ENTITY_REFERENCE:return a?l(a,{name:r,property:e}):l(rl,{name:r,label:t,control:o});case xr.FILE:return l(tl,{name:r});case xr.FILE_REFERENCE:return s?l(s,{name:r}):l(rl,{name:r,label:t,control:o});case xr.ANY:return l(at,{control:o,name:r,hideErrorMessage:!0,label:t});case xr.ENTITY:return l(Bl,{properties:e.properties,dataFieldName:r,useExpression:n,entityReferenceDefinitionSources:i,entityReferenceValueComponent:a,fileReferenceValueComponent:s});default:return l("div",{children:"No widget"})}};var ll=({value:e,property:r,label:t,isDirty:n,required:l=!1,useExpression:o=!1,multipleOptions:i=!1})=>{const a=h((()=>t?`${t} (value)`:`${r.name} (value)`),[t,r]),s=h((()=>t?`${t} (widget)`:`${r.name} (widget)`),[t,r]),d=h((()=>{var e;return"string"==typeof r.propertyType?r.propertyType:null==(e=r.propertyType)?void 0:e.value}),[r]),[c,f]=p(null),g=h((()=>i?qt({propertyType:d,required:l,useExpression:o}):$t({propertyType:d,required:l,useExpression:o})),[o,l,d,i]),y=h((()=>{switch(d){case xr.STRING:case xr.DATE:case xr.TIME:case xr.DATE_TIME:case xr.ENTITY_REFERENCE:case xr.ANY:case xr.FILE:case xr.FILE_REFERENCE:return"";case xr.JSON:return{};case xr.BOOLEAN:return!1;case xr.INTEGER:case xr.BIG_DECIMAL:case xr.BIG_INTEGER:case xr.DOUBLE:case xr.LONG:case xr.FLOAT:return 0;default:return null}}),[d]),b=h((()=>d===xr.JSON||d===xr.ANY),[d]),v=m((()=>{Lt(e,b)?f("expression"):null==e||Lt(e,b)||"widget"===c||"string"===c||f("widget")}),[e,c,b]);return u((()=>{c?n||v():!Mt(e)||r.isRequired||null!==r.defaultValue&&null!==r.value?o&&Lt(e,b)?f("expression"):f("widget"):f("null")}),[e,c,g,o,n,v,b,l,r]),{propertyType:d,valueLabel:a,fillOptionLabel:s,fillOption:c,fillOptions:g,setFillOption:f,defaultProperyValue:y,checkFillOption:v}};const ol=t(or)((()=>({inputLabel:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",width:"100%"}}))),il=({control:e,property:r,name:t,useExpression:n,label:i,required:a,title:d,entityReferenceDefinitionSources:p,entityReferenceValueComponent:h,fileReferenceValueComponent:f,requiredErrorText:g=""})=>{const{field:{value:y,onChange:b},fieldState:{error:v,isDirty:C}}=x({name:t,control:e,defaultValue:r.defaultValue,rules:{validate:e=>!a||null!==e||(g||Mr)}}),E=c({}),{propertyType:T,valueLabel:O,fillOptionLabel:S,fillOption:w,fillOptions:V,setFillOption:L,defaultProperyValue:k}=ll({value:y,property:r,isDirty:C,label:i,required:a,useExpression:n}),R=m((e=>{const t=e.target.value;E.current=Object.assign({},E.current,{[w]:y}),L(t);const n=E.current[t];if("null"===t)b(null,{shouldDirty:!0});else if("widget"===t)if(T===xr.JSON&&y&&"string"!=typeof y&&"dem_builder"===w&&"properties"in y){const e=Object.assign({},y,{properties:Ft(y.property||[])});try{b(null!=n?n:JSON.stringify(e,null,"\t"))}catch(e){console.log("Stringify failed",e)}}else b(null!=n?n:r.defaultValue||k);else if("expression"===t||"string"===t)b(null!=n?n:"",{shouldDirty:!0});else if("dem_builder"===t){const e={code:"",name:"",version:0,properties:[]};if(y)try{const e=JSON.parse(y);e.properties=Dt(e.properties||{}),b(null!=n?n:e,{shouldDirty:!0})}catch(r){b(null!=n?n:e,{shouldDirty:!0})}else b(null!=n?n:e,{shouldDirty:!0})}}),[k,y,L,w,T,b,r]);return u((()=>{C||!r.defaultValue&&!r.value||y||b(r.defaultValue||r.value)}),[C,r,b,y]),u((()=>{var e;(void 0===y||r.isRequired&&null===y&&!r.defaultValue&&!r.value)&&b(null!=(e=E.current[w])?e:k)}),[y,b,k,r,w]),o(fe,{xs:12,children:[d&&l(P,{mb:2,children:l(A,{variant:"h6",children:d})}),V?l(P,{mb:2,children:o($,{fullWidth:!0,size:"small",variant:"outlined",children:[l(ol,{htmlFor:"type-select",children:S}),l(lr,{labelId:"type-select",label:S,value:w||"",onChange:R,children:V.map((e=>l(s,{value:e.value,children:e.label},e.value)))})]})}):null,"expression"===w&&(T===xr.JSON||T===xr.ENTITY||T===xr.ANY?l(at,{name:t,control:e,label:O,parseValue:!0,validateJson:!0,hideErrorMessage:!0}):l(Dr,{control:e,name:t,label:O,hideErrorMessage:!0})),"string"===w&&l(Dr,{control:e,name:t,label:O,hideErrorMessage:!0}),"json_notvalid"===w&&l(at,{name:t,control:e,label:O,hideErrorMessage:!0}),"widget"===w&&l(nl,{control:e,property:r,name:t,useExpression:n,label:O,entityReferenceDefinitionSources:p,entityReferenceValueComponent:h,fileReferenceValueComponent:f}),"dem_builder"===w&&l(Rl,{control:e,title:"JSON",definitionFieldName:t,entityReferenceDefinitionSources:p,entityReferenceValueComponent:h,fileReferenceValueComponent:f}),v&&l(B,{error:!0,children:v.message})]})};var al=({control:e,name:r,property:t,useExpression:n,required:i,label:a,entityReferenceDefinitionSources:s,entityReferenceValueComponent:d,fileReferenceValueComponent:c})=>{const{fields:u,append:p,remove:m}=S({control:e,name:r});return o(fe,{container:!0,spacing:2,direction:"column",xs:12,children:[Array.isArray(u)&&u.length?u.map(((u,p)=>l(fe,{xs:12,children:o(P,{display:"flex",alignItems:"flex-start",width:"100%",p:2,style:{backgroundColor:"#f1f1f1"},children:[l(il,{control:e,required:i,property:t,useExpression:n,name:`${r}.${p}`,label:`${a||t.name} (${p+1})`,entityReferenceDefinitionSources:s,entityReferenceValueComponent:d,fileReferenceValueComponent:c}),l(P,{mt:"8px",ml:"4px",children:l(L,{id:"close-button",size:"small",onClick:()=>m(p),children:l(V,{fontSize:"small",children:l("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})})})})]})},u.id))):null,l(fe,{children:l(R,{variant:"contained",size:"small",color:"primary",onClick:()=>p(null),children:"Add value"})})]})};const sl=({control:e,property:r,name:t,useExpression:n,required:i,label:a,title:d,entityReferenceDefinitionSources:m,entityReferenceValueComponent:h,fileReferenceValueComponent:f,requiredErrorText:g=""})=>{var y;const[b,v]=p(!1),{field:{value:C,onChange:E},fieldState:{error:T,isDirty:O}}=x({control:e,name:t,defaultValue:null!=(y=r.defaultValue)?y:[],rules:{validate:e=>!(i&&!e)||(g||Mr)}}),S=c({}),{propertyType:w,valueLabel:V,fillOptionLabel:L,fillOption:k,fillOptions:R,setFillOption:M,checkFillOption:N}=ll({property:r,value:C,isDirty:O,label:a,required:i,useExpression:n,multipleOptions:!0});return u((()=>{C||E(r.isRequired&&r.isMultiple?[]:null)}),[C,r,E]),u((()=>{C&&!b&&(v(!0),N())}),[N,b,C]),o(fe,{children:[d&&l(P,{mb:2,children:l(A,{variant:"h6",children:d})}),R?l(P,{mb:2,children:o($,{fullWidth:!0,size:"small",variant:"outlined",children:[l(ol,{htmlFor:"type-select",children:L}),l(lr,{labelId:"type-select",label:L,value:k||"",onChange:e=>{v(!0),S.current=Object.assign({},S.current,{[k]:C});const r=e.target.value,t=S.current[r];"null"===r?E(null):"expression"===r||"json_valid"===r||"json_notvalid"===r?E(null!=t?t:"",{shouldDirty:!0}):"widget"===r&&E(null!=t?t:[],{shouldDirty:!0}),M(r)},children:R.map((e=>l(s,{value:e.value,children:e.label},e.value)))})]})}):null,"expression"===k&&(w===xr.JSON||w===xr.ENTITY||w===xr.ANY?l(at,{name:t,control:e,label:V,parseValue:!0,validateJson:!0,hideErrorMessage:!0}):l(Dr,{required:!0,hideErrorMessage:!0,control:e,name:t,label:V})),"json_valid"===k&&l(at,{name:t,control:e,label:V,parseValue:!0,validateJson:!0,hideErrorMessage:!0}),"widget"===k&&l(al,{control:e,property:r,name:t,useExpression:n,required:i,label:a,entityReferenceDefinitionSources:m,entityReferenceValueComponent:h,fileReferenceValueComponent:f}),T&&l(B,{error:!0,children:T.message})]})},dl=({control:e,propertyFieldName:r,name:t,label:n="",required:o,entityReferenceDefinitionSources:i,entityReferenceValueComponent:a,fileReferenceValueComponent:s})=>{const d=E({control:e,name:`${r}.propertyType`}),c=E({control:e,name:`${r}.isMultiple`}),u=E({control:e,name:`${r}.format`}),p=E({control:e,name:`${r}.restrictedValues`}),m=E({control:e,name:`${r}.properties`}),f=E({control:e,name:`${r}.isRequired`}),g=h((()=>Object.assign({name:n,isRequired:null!=o?o:f,isMultiple:c},!!u&&{format:u},{restrictedValues:p},!!m&&{properties:m},{propertyType:"string"==typeof d?d:d.value,defaultValue:null,defaultValues:[],sortOrder:0,isEnabled:!0,uiSettings:null,validationNode:null})),[d,u,p,c,n,f,m,o]);return l(nr,{dateAdapter:tr,children:l(c?sl:il,{control:e,name:t,property:g,title:n,required:o,entityReferenceDefinitionSources:i,entityReferenceValueComponent:a,fileReferenceValueComponent:s})})};var cl=({name:e})=>{const r=h((()=>({type:""})),[]),{control:t}=T(),{fields:n,append:i,remove:a}=S({control:t,name:e});return o(P,{mt:2,children:[l(R,{variant:"outlined",size:"small",onClick:()=>i(r),children:"Add node"}),n.map((({id:r},t)=>l(vl,{removeHandle:()=>a(t),name:`${e}.${t}`},r)))]})};const ul=g(""),pl=({name:e,control:r})=>o(i,{children:[l(A,{variant:"body2",gutterBottom:!0,children:"Node"}),l(P,{children:l(Dr,{control:r,name:`${e}.minimumLength`,label:"Minimum Length",type:"number"})}),l(P,{mt:2,children:l(Dr,{control:r,name:`${e}.maximumLength`,label:"Maximum Length",type:"number"})})]}),ml=({name:e,control:r})=>o(i,{children:[l(A,{variant:"body2",gutterBottom:!0,children:"Node"}),l(P,{children:l(Dr,{control:r,name:`${e}.multipleOf`,label:"Multiple Of",type:"number"})}),l(P,{mt:2,children:l(Dr,{control:r,name:`${e}.minimum`,label:"Minimum",type:"number"})}),l(P,{mt:2,children:l(Dr,{control:r,name:`${e}.maximum`,label:"Maximum",type:"number"})}),o(P,{mt:2,children:[l(Jr,{control:r,name:`${e}.exclusiveMinimum`,label:"Exclusive Minimum"}),l(Jr,{control:r,name:`${e}.exclusiveMaximum`,label:"Exclusive Maximum"})]})]}),hl=["STRING_REGEX","JSON_SCHEMA"],fl=new Set([xr.INTEGER,xr.FLOAT,xr.DOUBLE,xr.BIG_DECIMAL,xr.BIG_INTEGER,xr.LONG]);var gl=({name:e})=>{const{control:r,setValue:t}=T(),n=y(ul),a=E({control:r,name:`${e}.type`}),s=h((()=>{if("STRING_REGEX"===a)return l(Dr,{control:r,name:`${e}.pattern`,label:"Pattern"});if("JSON_SCHEMA"===a)switch(!0){case n===xr.STRING:return l(pl,{name:`${e}.node`,control:r});case fl.has(n):return l(ml,{name:`${e}.node`,control:r});case n===xr.JSON:return l(at,{label:"Properties",control:r,name:`${e}.properties`,validateJson:!0,parseValue:!0});default:return"Not available for type "+n}return null}),[n,a,r,e]);return u((()=>{fl.has(n)&&"JSON_SCHEMA"===a&&(t(`${e}.node.exclusiveMinimum`,!1),t(`${e}.node.exclusiveMaximum`,!1))}),[n,a,t,e]),l(Yn,{data:[{label:"Validator",content:o(i,{children:[l(P,{children:l(jr,{control:r,name:`${e}.type`,label:"Type",options:hl,onChange:r=>{t(e,{}),t(`${e}.type`,r.target.value)}})}),l(P,{mt:2,children:s})]})}]})};const yl=["AND","OR","NOT","NODE"],bl=({name:e,removeHandle:r})=>{const{control:t}=T(),n=E({control:t,name:`${e}.type`}),a=h((()=>({AND:l(cl,{name:`${e}.nodes`}),OR:l(cl,{name:`${e}.nodes`}),NODE:l(gl,{name:`${e}.validator`}),NOT:l(bl,{name:`${e}.node`})})),[e]);return l(Yn,{data:[{label:"Node Type",content:o(i,{children:[o(P,{display:"flex",alignItems:"flex-end",children:[l(jr,{required:!0,control:t,name:`${e}.type`,label:"Type",options:yl}),r&&l(P,{ml:2,children:l(L,{onClick:r,color:"primary",children:l(Ke,{})})})]}),l(P,{children:a[n]})]})}]})};var vl=bl;const Cl=({name:e})=>{const[r,t]=p(!1),{setValue:n,getValues:a}=T(),s=m((r=>{t(r.target.checked),r.target.checked||n(e,null)}),[n,e]);return u((()=>{a(e)&&t(!0)}),[e,a]),o(i,{children:[o(P,{display:"flex",justifyContent:"space-between",children:[l(A,{variant:"h6",children:"Validator"}),l(z,{label:"Enable",control:l(H,{color:"primary",checked:r,onChange:s})})]}),r&&l(vl,{name:e})]})};var xl=({name:e,label:r="",propertyFieldName:t,type:n,decimal:o=!1,options:i=[],required:a=!1})=>{const{control:s}=T(),d=h((()=>`${t}.${e}`),[e,t]);switch(n){case"text":return l(Dr,{control:s,name:d,label:r,required:a});case"number":return l(jt,{control:s,name:d,label:r,decimal:o,required:a});case"select":return l(jr,{control:s,name:d,label:r,options:i,required:a});case"autocomplete":return l(Xr,{control:s,name:d,label:r,options:i,required:a});case"json":return l(at,{control:s,name:d,label:r,mode:"json",required:a});default:return null}};var El=e=>({customCheckboxes:h((()=>e.length?e.filter((e=>"checkbox"===e.type)):[]),[e]),customFields:h((()=>e.length?e.filter((e=>"checkbox"!==e.type)):[]),[e])});const Tl=Object.values(xr).sort(((e,r)=>e.localeCompare(r))).map((e=>({value:e,label:e.replace("_"," ").toLowerCase().replace(/(^\w)|([-\s]\w)/g,(e=>e.toUpperCase()))}))),Ol=b((({setValue:e,control:r,propertyFieldName:t,entityDefinition:n=!1,globalParameter:a=!1,customPropertyFields:s=[],entityReferenceDefinitionSources:d,entityReferenceValueComponent:c,fileReferenceValueComponent:p})=>{var m;const f=E({control:r,name:`${t}.propertyType`}),g=E({control:r,name:`${t}.isMultiple`}),y=E({control:r,name:`${t}.isRequired`}),{customCheckboxes:b,customFields:v}=El(s),C=h((()=>{let e=a?"Value":"Default Value";return g&&(e+="s"),e}),[a,g]);return u((()=>{f&&"string"==typeof f&&e(`${t}.propertyType`,Tl.find((e=>e.value===f)))}),[f,e,t]),o(fe,{container:!0,direction:"column",spacing:2,children:[l(fe,{children:l(Dr,{required:!0,control:r,name:`${t}.key`,label:"Key"})}),l(fe,{children:l(Dr,{required:!0,control:r,name:`${t}.name`,label:"Name"})}),l(fe,{children:l(Xr,{required:!0,control:r,name:`${t}.propertyType`,label:"Type",options:Tl,onChange:(r,n)=>{const l=`${t}.propertyType`,o=`${t}.${a?"value":"defaultValue"}`;e(o,g?[]:null),e(l,n)}})}),l(fe,{children:l(jt,{required:!0,control:r,name:`${t}.sortOrder`,label:"Sort Order"})}),l(fe,{children:l(at,{control:r,name:`${t}.uiSettings`,label:"UI Settings",validateJson:!0,parseValue:!0})}),o(fe,{children:[l(Jr,{control:r,name:`${t}.isMultiple`,label:"Multiple"}),l(Jr,{control:r,name:`${t}.isEnabled`,label:"Enabled"}),l(Jr,{control:r,name:`${t}.isRequired`,label:"Required"}),n&&l(Jr,{control:r,name:`${t}.isViewableInList`,label:"Is viewable in list"}),b.length?l(i,{children:b.map(((e,n)=>l(Jr,{control:r,name:`${t}.${e.name}`,label:e.label,checked:e.checked,defaultValue:e.defaultValue},n)))}):null]}),f&&o(i,{children:[l(fe,{children:l(ul.Provider,{value:null!=(m=f.value)?m:f,children:l(Cl,{name:`${t}.validationNode`})})}),l(el,{control:r,propertyType:"string"==typeof f?f:f.value,propertyFieldName:t,globalParameter:a,entityDefinition:n,entityReferenceDefinitionSources:d,entityReferenceValueComponent:c,fileReferenceValueComponent:p}),l(dl,{control:r,propertyFieldName:t,name:`${t}.${a?"value":"defaultValue"}`,label:C,required:!!a&&y,entityReferenceDefinitionSources:d,entityReferenceValueComponent:c,fileReferenceValueComponent:p})]}),v.length?l(i,{children:v.map(((e,r)=>l(fe,{children:l(xl,Object.assign({},e,{propertyFieldName:t}))},r)))}):null]})}));var Sl=({entityDefinition:e,globalParameter:r,customPropertyFields:t,index:n,arrLength:i,entityReferenceDefinitionSources:a,entityReferenceValueComponent:s,control:d,setValue:c,fileReferenceValueComponent:u,handleRemoveParameter:m,error:h,item:f,extRefs:g})=>{const[y,b]=p(n===i&&!f.key);return l(fe,{sm:12,ref:e=>g.current[n]=e,children:o(We,{expanded:y,onChange:()=>b(!y),elevation:3,children:[l(Je,{expandIcon:l(Ze,{}),children:l(A,{color:h&&h[n]?"secondary":"initial",style:{wordBreak:"break-word"},children:f.name||`Property ${n+1}`})}),l(Ge,{children:y&&l(Ol,{control:d,setValue:c,propertyFieldName:`properties.${n}`,entityDefinition:e,globalParameter:r,customPropertyFields:t,entityReferenceDefinitionSources:a,entityReferenceValueComponent:s,fileReferenceValueComponent:u})}),l(Ye,{children:l(R,{variant:"contained",size:"small",color:"secondary",onClick:()=>m(n),children:"Remove"})})]})})};const wl={key:"",propertyType:null,name:"",defaultValue:"",defaultValues:[],isRequired:!0,isMultiple:!1,sortOrder:0,isEnabled:!0,executeValue:"",uiSettings:""},Vl=f((({properties:e,parentFieldName:r,hideAddButton:t,focusOnIndex:n,required:a,entityDefinition:s=!1,globalParameter:d=!1,customPropertyFields:p=[],parentRemove:h,entityReferenceDefinitionSources:f,entityReferenceValueComponent:g,fileReferenceValueComponent:y},b)=>{var C;const{clearErrors:E,control:T,setValue:O,getValues:V,reset:L,trigger:k,watch:M}=w({mode:"all",defaultValues:{properties:e}}),{fields:N,append:I,remove:F}=S({control:T,name:"properties"}),{fieldState:{error:D}}=x({control:T,name:"properties",rules:{validate:e=>!a||!Array.isArray(e)||0!==e.length||"Please, fill the properties"}}),P=c([]),q=m((()=>{I(wl),E("properties")}),[I,E]),$=m((e=>{h&&h(e),F(e)}),[h,F]);return u((()=>{"number"==typeof n&&P.current[n]&&P.current[n].scrollIntoView({behavior:"smooth",block:"start"})}),[n,P]),u((()=>{var r;!e.length||null!=(r=V("properties"))&&r.length||L({properties:e})}),[e,V,L]),v(b,(()=>({getProperties:()=>V("properties"),addProperty:q,removeProperty:$,trigger:k})),[V,q,$,k]),o(i,{children:[D&&D.message&&l(fe,{sm:12,children:l(A,{color:"secondary",children:D.message})}),Array.isArray(N)&&N.map(((e,r,t)=>l(Sl,{item:e,index:r,arrLength:t.length-1,control:T,setValue:O,customPropertyFields:p,entityDefinition:s,globalParameter:d,error:D,handleRemoveParameter:$,fileReferenceValueComponent:y,entityReferenceValueComponent:g,entityReferenceDefinitionSources:f,extRefs:P},e.id))),!t&&o(fe,{xs:12,children:[l(R,{variant:"contained",size:"small",color:"primary",onClick:q,children:"Add property"}),D&&l(B,{error:!0,children:null==(C=D.root)?void 0:C.message})]})]})})),Ll={key:"",propertyType:null,name:"",defaultValue:"",defaultValues:[],isRequired:!0,isMultiple:!1,sortOrder:0,isEnabled:!0,executeValue:"",uiSettings:""},kl=({control:e,parentFieldName:r,hideAddButton:t,focusOnIndex:n,required:a,entityDefinition:s=!1,globalParameter:d=!1,customPropertyFields:p=[],parentRemove:f,entityReferenceDefinitionSources:g,entityReferenceValueComponent:y,fileReferenceValueComponent:b})=>{var v;const C=h((()=>r?`${r}.properties`:"properties"),[r]),{clearErrors:E,setValue:O}=T(),{fields:w,append:V,remove:L}=S({control:e,name:C}),{fieldState:{error:k}}=x({control:e,name:C,rules:{validate:e=>!a||!Array.isArray(e)||0!==e.length||"Please, fill the properties"}}),M=c([]),N=m((()=>{V(Ll),E("properties")}),[V,E]),I=m((e=>{f&&f(e),L(e)}),[f,L]);return u((()=>{"number"==typeof n&&M.current[n]&&M.current[n].scrollIntoView({behavior:"smooth",block:"start"})}),[n,M]),o(i,{children:[k&&k.message&&l(fe,{sm:12,children:l(A,{color:"secondary",children:k.message})}),Array.isArray(w)&&w.map(((r,t,n)=>l(fe,{sm:12,ref:e=>M.current[t]=e,children:o(We,{defaultExpanded:t===n.length-1&&!r.key,elevation:3,children:[l(Je,{expandIcon:l(Ze,{}),children:l(A,{color:k&&k[t]?"secondary":"initial",style:{wordBreak:"break-word"},children:r.name||`Property ${t+1}`})}),l(Ge,{children:l(Ol,{control:e,setValue:O,propertyFieldName:`${C}.${t}`,entityDefinition:s,globalParameter:d,customPropertyFields:p,entityReferenceDefinitionSources:g,entityReferenceValueComponent:y,fileReferenceValueComponent:b})}),l(Ye,{children:l(R,{variant:"contained",size:"small",color:"secondary",onClick:()=>I(t),children:"Remove"})})]})},r.id))),!t&&o(fe,{xs:12,children:[l(R,{variant:"contained",size:"small",color:"primary",onClick:N,children:"Add property"}),k&&l(B,{error:!0,children:null==(v=k.root)?void 0:v.message})]})]})},Rl=f((({control:e,definitionFieldName:r,title:t,hideCodeField:n,hideVersionField:i,hideNameField:a,required:s=!1,entityReferenceDefinitionSources:d,entityReferenceValueComponent:c,fileReferenceValueComponent:u},p)=>{const{control:m,getValues:h}=T(),f=h(`${r}.properties`);return o(fe,{container:!0,direction:"column",spacing:2,children:[t&&l(fe,{sm:12,children:l(P,{my:2,children:l(A,{variant:"h6",children:t})})}),!a&&l(fe,{sm:12,children:l(Dr,{required:!0,control:null!=e?e:m,name:r?`${r}.name`:"name",label:"Name"})}),!n&&l(fe,{sm:12,children:l(Dr,{required:!0,control:null!=e?e:m,name:r?`${r}.code`:"code",label:"Code"})}),!i&&l(fe,{sm:12,children:l(jt,{required:!0,control:null!=e?e:m,name:r?`${r}.version`:"version",label:"Version"})}),p?l(Vl,{ref:p,properties:f,required:s,parentFieldName:r,entityReferenceDefinitionSources:d,entityReferenceValueComponent:c,fileReferenceValueComponent:u}):l(kl,{control:e,required:s,parentFieldName:r,entityReferenceDefinitionSources:d,entityReferenceValueComponent:c,fileReferenceValueComponent:u})]})})),Ml={name:"Name",key:"Key",propertyType:"Property Type",defaultValue:"Default Value",defaultValues:"Default Values",sortOrder:"Sort Order",isRequired:"Required",isMultiple:"Multiple",isEnabled:"Enabled",isViewableInList:"Is Viewable In List",precisionScale:"Precision Scale",roundingMode:"Rounding Mode",format:"Format",definitionCode:"Definition Code",definitionVersion:"Definition Version",labelPropertyCode:"Label Property Code",valuePropertyCode:"Value Property Code",restrictedValues:"Restricted Values",value:"Value",values:"Values",uiSettings:"UI Settings",validationNode:"Validation Node"},Nl=({value:e,type:r})=>r!==xr.JSON&&r!==xr.ENTITY&&r!==xr.ANY||!e?l(A,{variant:"subtitle1",display:"inline",style:{wordBreak:"break-word"},children:null===e?"null":e.toString()}):l(ft,{value:e}),Il=(e,r,t)=>{switch(r){case"isRequired":case"isMultiple":case"isEnabled":case"isViewableInList":return e?l(V,{color:"primary",fontSize:"small",children:l("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})}):null;case"restrictedValues":return e?l(P,{display:"flex",flexWrap:"wrap",children:e.map((e=>l(he,{label:e,style:{wordBreak:"break-word",maxWidth:"500px"}},e)))}):null;case"defaultValue":case"value":return l(Nl,{value:e,type:t});case"values":case"defaultValues":return Array.isArray(e)&&t!==xr.ENTITY&&t!==xr.JSON&&t!==xr.ANY?o("div",{children:["[",null==e?void 0:e.map(((e,r)=>l("div",{children:l(Nl,{value:e,type:t})},r))),"]"]}):l(ft,{value:e});case"uiSettings":case"validationNode":return e?l(ft,{value:e}):null;default:return l(A,{variant:"subtitle1",display:"inline",style:{wordBreak:"break-word"},children:e})}};var Fl=({property:e})=>{const r=h((()=>(e&&(e.isMultiple?(delete e.defaultValue,delete e.value):(delete e.defaultValues,delete e.values)),e)),[e]);return l(Me,{size:"small",children:l(Ne,{children:Object.keys(Ml).map((e=>e in r?o(Pe,{children:[l(Ie,{width:"30%",children:l(A,{children:Ml[e]})}),l(Ie,{children:Il(r[e],e,r.propertyType)})]},e):null))})})};var Dl=b((({properties:e,parentNames:r=[]})=>{const t=h((()=>{let r=!1;return e.every((e=>e.propertyType!==xr.ENTITY||(r=!0,!1))),r}),[e]);return o(P,{mt:4,children:[l(A,{variant:"h6",children:"Properties"}),o(Ue,{orientation:"vertical",style:{paddingLeft:"4px"},children:[e.map((e=>o(Xe,{expanded:!0,children:[l(Qe,{StepIconProps:{icon:"",completed:!1,active:!0}}),l(er,{children:l(Pl,{property:e,parentNames:[...r],defaultExpanded:!1})})]},e.key))),t&&l(Xe,{})]})]})}));const Pl=({property:e,parentNames:r=[],defaultExpanded:t=!0})=>{const[n,i]=p(!0);return u((()=>{i(t)}),[t]),o(We,{elevation:3,style:{backgroundColor:r.length%2==1?"#f1f1f1":"#fff"},expanded:n,onChange:()=>i((e=>!e)),children:[l(Je,{expandIcon:l(V,{children:l("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),children:l(A,{style:{wordBreak:"break-word",fontWeight:"600"},children:e.name})}),l(Ge,{children:o(P,{width:"100%",children:[l(Fl,{property:e}),e.propertyType===xr.ENTITY&&l(Dl,{properties:Dt(e.properties),parentNames:[...r,e.name]})]})})]})},Al=({properties:e,expandAll:r=!0})=>{const t=h((()=>Array.isArray(e)?e:e?Dt(e):[]),[e]);return l(P,{display:"flex",flexDirection:"column",children:t.length?t.map((e=>l(Pl,{property:e,defaultExpanded:r},e.key))):l(A,{children:"No properties"})})},ql=({property:e,name:r,useExpression:t,label:n,required:i,title:a,entityReferenceDefinitionSources:d,entityReferenceValueComponent:p,fileReferenceValueComponent:h,requiredErrorText:f=""})=>{const{control:g,clearErrors:y,setValue:b}=T(),{field:{value:v},fieldState:{error:C,isDirty:E}}=x({name:r,control:g,rules:{validate:e=>!i||null!==e||(f||Mr)}}),O=c({}),{propertyType:S,valueLabel:w,fillOptionLabel:V,fillOption:L,fillOptions:k,setFillOption:R,defaultProperyValue:M}=ll({value:v,property:e,isDirty:E,label:n,required:i,useExpression:t}),N=m((t=>{const n=t.target.value;O.current=Object.assign({},O.current,{[L]:v}),R(n);const l=O.current[n];if("null"===n)b(r,null,{shouldDirty:!0});else if("widget"===n)if(S===xr.JSON&&v&&"string"!=typeof v&&"dem_builder"===L&&"properties"in v){const e=Object.assign({},v,{properties:Ft(v.property||[])});try{b(r,null!=l?l:JSON.stringify(e,null,"\t"))}catch(e){console.log("Stringify failed",e)}}else b(r,null!=l?l:e.defaultValue||M);else if("expression"===n||"string"===n)b(r,null!=l?l:"",{shouldDirty:!0});else if("dem_builder"===n){const e={code:"",name:"",version:0,properties:[]};if(v)try{const e=JSON.parse(v);e.properties=Dt(e.properties||{}),b(r,null!=l?l:e,{shouldDirty:!0})}catch(t){b(r,null!=l?l:e,{shouldDirty:!0})}else b(r,null!=l?l:e,{shouldDirty:!0})}y()}),[r,y,v,R,L,S,e,b,M]);return u((()=>{var t;!E&&Mt(v)&&(!e.isRequired||null!==e.defaultValue&&null!==e.value?e.isRequired||null!==e.defaultValue&&null!==e.value?Mt(e.defaultValue)&&Mt(e.value)||b(r,e.defaultValue||e.value):b(r,null):b(r,null!=(t=O.current[L])?t:M,{shouldDirty:!0}))}),[v,e,r,L,E,b,M]),o(fe,{xs:12,children:[a&&l(P,{mb:2,children:l(A,{variant:"h6",children:a})}),k?l(P,{mb:2,children:o($,{fullWidth:!0,size:"small",variant:"outlined",children:[l(ol,{htmlFor:"type-select",children:V}),l(lr,{labelId:"type-select",label:V,value:L||"",onChange:N,children:k.map((e=>l(s,{value:e.value,children:e.label},e.value)))})]})}):null,"expression"===L&&(S===xr.JSON||S===xr.ENTITY||S===xr.ANY?l(at,{name:r,control:g,label:w,parseValue:!0,hideErrorMessage:!0,useCleanValue:!0,mode:S===xr.ANY?"text":"json"}):l(Dr,{control:g,name:r,label:w,hideErrorMessage:!0})),"string"===L&&l(Dr,{control:g,name:r,label:w,hideErrorMessage:!0}),"json_notvalid"===L&&l(at,{name:r,control:g,label:w,hideErrorMessage:!0}),"widget"===L&&l(nl,{control:g,property:e,name:r,useExpression:t,label:w,entityReferenceDefinitionSources:d,entityReferenceValueComponent:p,fileReferenceValueComponent:h}),"dem_builder"===L&&l(Rl,{title:"JSON",definitionFieldName:r,entityReferenceDefinitionSources:d,entityReferenceValueComponent:p,fileReferenceValueComponent:h}),C&&l(B,{error:!0,children:C.message})]})};var $l=({name:e,property:r,useExpression:t,required:n,label:i,entityReferenceDefinitionSources:a,entityReferenceValueComponent:s,fileReferenceValueComponent:d})=>{const{control:c,setValue:u,clearErrors:p}=T(),h=E({control:c,name:e}),f=m((()=>{h&&Array.isArray(h)?u(`${e}.${h.length}`,null):u(e,[]),p(e)}),[e,h,u,p]),g=m((r=>{u(e,st(h,r))}),[e,h,u]);return o(fe,{container:!0,spacing:2,direction:"column",xs:12,children:[Array.isArray(h)&&h.length?h.map(((c,u)=>l(fe,{xs:12,children:o(P,{display:"flex",alignItems:"flex-start",width:"100%",p:2,style:{backgroundColor:"#f1f1f1"},children:[l(ql,{required:n,property:r,useExpression:t,name:`${e}.${u}`,label:`${i||r.name} (${u+1})`,entityReferenceDefinitionSources:a,entityReferenceValueComponent:s,fileReferenceValueComponent:d}),l(P,{mt:"8px",ml:"4px",children:l(L,{id:"close-button",size:"small",onClick:()=>g(u),children:l(V,{fontSize:"small",children:l("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})})})})]})},u))):null,l(fe,{children:l(R,{variant:"contained",size:"small",color:"primary",onClick:f,children:"Add value"})})]})};const zl=({property:e,name:r,useExpression:t,required:n,label:i,title:a,entityReferenceDefinitionSources:d,entityReferenceValueComponent:m,fileReferenceValueComponent:h,requiredErrorText:f=""})=>{var g;const[y,b]=p(!1),{control:v,clearErrors:C,setValue:E,watch:O}=T(),{field:{ref:S,onChange:w},fieldState:{error:V,isDirty:L}}=x({control:v,name:r,defaultValue:null!=(g=e.defaultValue)?g:[],rules:{validate:e=>!(n&&!e)||(f||Mr)}}),k=O(r),R=c({}),{propertyType:M,valueLabel:N,fillOptionLabel:I,fillOption:F,fillOptions:D,setFillOption:q,checkFillOption:z}=ll({property:e,value:k,isDirty:L,label:i,required:n,useExpression:t,multipleOptions:!0});return u((()=>{k||w(e.isRequired&&e.isMultiple?[]:null)}),[k,e,w]),u((()=>{k&&!y&&(b(!0),z())}),[z,y,k]),o(fe,{children:[a&&l(P,{mb:2,children:l(A,{variant:"h6",children:a})}),D?l(P,{mb:2,children:o($,{fullWidth:!0,size:"small",variant:"outlined",children:[l(ol,{htmlFor:"type-select",children:I}),l(lr,{labelId:"type-select",label:I,value:F||"",onChange:e=>{b(!0),R.current=Object.assign({},R.current,{[F]:k});const t=e.target.value,n=R.current[t];"null"===t?E(r,null):"expression"===t||"json_valid"===t||"json_notvalid"===t?E(r,null!=n?n:"",{shouldDirty:!0}):"widget"===t&&E(r,null!=n?n:[],{shouldDirty:!0}),q(t),C(r)},children:D.map((e=>l(s,{value:e.value,children:e.label},e.value)))})]})}):null,"expression"===F&&(M===xr.JSON||M===xr.ENTITY||M===xr.ANY?l(at,{name:r,control:v,label:N,parseValue:!0,hideErrorMessage:!0,useCleanValue:!0,mode:M===xr.ANY?"text":"json"}):l(Dr,{required:!0,hideErrorMessage:!0,control:v,name:r,label:N})),"json_valid"===F&&l(at,{name:r,control:v,label:N,parseValue:!0,validateJson:!0,hideErrorMessage:!0}),"widget"===F&&l($l,{property:e,name:r,useExpression:t,required:n,label:i,entityReferenceDefinitionSources:d,entityReferenceValueComponent:m,fileReferenceValueComponent:h}),V&&l(B,{error:!0,children:V.message})]})},Bl=({properties:e,dataFieldName:r,useExpression:t=!1,title:n,entityReferenceDefinitionSources:i,entityReferenceValueComponent:a,fileReferenceValueComponent:s})=>{const d=h((()=>e?e.map((e=>{var n;const d="string"==typeof e.propertyType?e.propertyType:null==(n=e.propertyType)?void 0:n.value;return{label:o(P,{display:"flex",flexDirection:"column",children:[o("b",{children:[e.name,e.isRequired?"*":""]}),o("span",{children:[e.key," | ",e.isMultiple?"multiple":"single"," |"," ",d]})]}),content:e.isMultiple?l(zl,{property:e,name:`${r}.${e.key}`,useExpression:t,label:e.name,required:e.isRequired,entityReferenceValueComponent:a,fileReferenceValueComponent:s,entityReferenceDefinitionSources:i}):l(ql,{property:e,name:`${r}.${e.key}`,useExpression:t,label:e.name,required:e.isRequired,entityReferenceDefinitionSources:i,entityReferenceValueComponent:a,fileReferenceValueComponent:s})}})):[]),[e,r,t,a,i,s]);return l(nr,{dateAdapter:tr,children:o(fe,{container:!0,direction:"column",spacing:2,children:[n&&l(fe,{xs:12,children:l("div",{style:{fontWeight:"600"},children:n})}),l(Yn,{data:d})]})})};var Hl=({property:e,data:r})=>{const{name:t}=e,n=m(((e,r)=>{const t=e,n=document.createElement("a");document.body.appendChild(n),n.href=t,n.target="_self",n.download=r,n.click()}),[]);return l(R,{component:"label",variant:"contained",size:"large",color:"primary",onClick:()=>n(r,t),children:"Download File"})};const jl=({property:e,data:r,properties:t})=>{const n=e=>l(P,{style:{backgroundColor:"#fff",border:"1px solid #ccc",borderRadius:"4px",padding:"4px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:null===e?"null":e.toString()});switch(e.propertyType){case xr.JSON:return l(ft,{value:r});case xr.ENTITY:return l(Wl,{properties:t,data:r});case xr.ANY:return"object"==typeof r?l(ft,{value:r}):n(r);case xr.FILE_REFERENCE:return null===r?n(r):l(R,{component:ee,color:"primary",variant:"contained",target:"_blank",to:r,sx:{marginTop:4},children:"Download via link"});case xr.FILE:return null===r?n(r):l(Hl,{data:r,property:e});default:return n(r)}};var _l=({property:e,data:r,hasBackground:t=!1})=>{const n=h((()=>e.propertyType===xr.ENTITY?Array.isArray(e.properties)?e.properties:Dt(e.properties):[]),[e]);return l(P,{style:{backgroundColor:t?"#f1f1f1":"none"},children:l(jl,{property:e,data:r,properties:n})})};const Wl=({properties:e,data:r})=>{const t=h((()=>e&&r?e.map((e=>{const{key:t,name:n,isMultiple:a,propertyType:s}=e,d=r[e.key]?r[e.key]:null;return{label:o(P,{display:"flex",flexDirection:"column",children:[l("b",{children:n}),o("span",{children:[t," | ",a?"multiple":"single"," | ",s]})]}),content:a&&Array.isArray(d)&&e.propertyType!==xr.ANY?l(i,{children:d.map(((r,t)=>l(P,{mb:2,children:l(_l,{property:e,data:r,hasBackground:!0})},t)))}):l(_l,{property:e,data:d})}})):[]),[e,r]);return l(fe,{container:!0,direction:"column",spacing:2,children:l(Yn,{data:t})})},Jl=t(P)((({theme:e})=>({backgroundColor:"#eee",fontSize:"14px",padding:"0 8px",borderRadius:"10px",width:"fit-content","&.success":{backgroundColor:"#a9dfa9"},"&.error":{backgroundColor:"#ff7e7e"},"&.warning":{backgroundColor:e.palette.warning.main}}))),Gl=({text:e,status:r="default"})=>l(Jl,{className:ir("root",{[r]:!0}),children:e}),Yl=({properties:e,parentKey:r="",activePath:t="",prefix:n="",onClick:i})=>l(Ue,{orientation:"vertical",onClick:e=>e.stopPropagation(),children:e&&e.map((e=>{var a;const s=r?`${r}.${e.key}`:e.key,d=null!=(a=e.propertyType.value)?a:e.propertyType;return o(Xe,{expanded:!0,onClick:()=>{return e=s,void i(n?`${n}.${e}`:e);var e},children:[l(Qe,{StepIconProps:{icon:"",completed:!1,active:t===s},children:o(P,{sx:{propertyStepLabel:{"&:hover":{fontWeight:"600",cursor:"pointer"}}},children:[e.name," - ",e.key," - ",d]})}),l(er,{children:l("div",{children:d===xr.ENTITY&&l(Yl,{onClick:i,activePath:t,properties:e.properties,parentKey:s},e.key)})})]},e.key)}))});var Zl=Yl;const Kl=({open:e=!1,onClose:r,onPaste:t,properties:n})=>{const[i,a]=p("");return o(M,{open:e,onClose:r,fullWidth:!0,maxWidth:"md",children:[l(D,{children:"JSON path picker"}),o(I,{children:[null!=n&&n.length?n.map(((e,r)=>o("div",{children:[l(A,{variant:"h6",children:e.title}),l(Zl,{properties:e.properties,prefix:e.pathPrefix,onClick:a,activePath:i})]},r))):l(A,{children:"Please, add properties"}),i&&o(A,{variant:"h6",gutterBottom:!0,children:["Selected path : $(",i,")"]})]}),o(N,{children:[l(R,{variant:"contained",color:"primary",onClick:()=>{navigator.clipboard.writeText(`$(${i})`),ar.success("Copied!")},children:"Copy"}),l(R,{variant:"contained",color:"primary",onClick:()=>{t(`$(${i})`),ar.success("Pasted!")},children:"Paste"}),l(R,{variant:"contained",color:"secondary",onClick:r,children:"Close"})]})]})},Ul=g({collapsed:!1,toggleCollapse:()=>{console.log("collapse toggle")}}),Xl=()=>y(Ul),Ql=({children:e})=>{const[r,t]=p("true"===localStorage.getItem("sidebar_collapsed")),n=m((()=>{t(!r),localStorage.setItem("sidebar_collapsed",`${!r}`),window.dispatchEvent(new CustomEvent("sidebar_collapsed",{detail:{collapsed:!r}}))}),[r]),o=m(((e,r)=>{localStorage.setItem(`${e.toLowerCase()}_collapsed`,`${!r}`)}),[]);return l(Ul.Provider,{value:{collapsed:r,toggleCollapse:n,toggleRootElementLink:o},children:e})},eo=t("div")({position:"relative","&:hover":{".button-collapse":{opacity:1}}}),ro=t(dr)((e=>({width:248,flexShrink:0,position:"relative",transition:"all 0.3s ease-in-out","& .MuiDrawer-paper":{backgroundColor:e.theme.palette.secondary.main,width:248,boxSizing:"border-box",borderRight:"none",borderRadius:0,transition:"all 0.3s ease-in-out",overflow:"hidden"},"&.collapsed":{width:70,"& .MuiDrawer-paper":{width:70}}}))),to=t(gr)((({theme:e})=>({backgroundColor:"#fff",borderRight:"1px solid rgba(38, 40, 66, 0.08)",position:"relative","& span":{paddingLeft:10,paddingTop:5,fontSize:24,fontWeight:600,transition:".3s ease .1s",whiteSpace:"nowrap"},"&:after":{transition:"opacity .3s",content:"attr(data-title)",fontSize:30,position:"absolute",left:"50%",transform:"translate3d(-50%, 0, 0)",opacity:0,visibility:"hidden"},"&.collapsed":{justifyContent:"center","& img":{width:40},"& span":{opacity:0,visibility:"hidden",transitionDelay:"0s"},"&:after":{opacity:1,visibility:"visible",transitionDelay:".1s"}}}))),no=t(cr)((e=>({padding:e.theme.spacing(3),margin:0}))),lo=t(ur)((e=>({color:"#fff",height:e.theme.spacing(11),overflow:"hidden"}))),oo=t(mr)((({theme:e})=>({borderRadius:e.spacing(2.5),padding:e.spacing(2),height:e.spacing(11),alignItems:"center","&.active":{backgroundColor:"rgba(38, 40, 66, 0.12)","&.main":{backgroundColor:"rgba(255, 255, 255, 0.12)",borderLeft:"4px solid #E0613A"}},"&:hover":{backgroundColor:"rgba(255, 255, 255, 0.08)"},"&.collapsed":{width:e.spacing(11.5),"&.active":{"&.main":{border:"none",backgroundColor:"#E0613A"}}}}))),io=t(pr)((({theme:e})=>({color:"#fff",minWidth:20,marginRight:e.spacing(2),"& svg":{marginLeft:2,fill:"#fff",color:"#fff"}}))),ao=t(hr)((({theme:e})=>({textTransform:"uppercase",borderRadius:e.spacing(2.5),backgroundColor:e.palette.secondary.main,color:"#fff",paddingLeft:0,paddingRight:0,position:"relative","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.08)"},"&.collapsed":{fontSize:24,textAlign:"center",fontWeight:"bold",paddingRight:0}}))),so=t(fr)((({theme:e})=>({width:"100%",marginLeft:e.spacing(2),alignItems:"center","& > *":{overflow:"hidden",textOverflow:"ellipsis",wordBreak:"break-all",whiteSpace:"nowrap"}}))),co=t(cr)((e=>({margin:0,padding:0,"& .MuiListItemText-root:not(.main)":{paddingLeft:e.theme.spacing(8.5)}}))),uo=t(yr)((e=>({position:"absolute",top:e.theme.spacing(10),left:"calc(100% - 16px)",width:e.theme.spacing(8),height:e.theme.spacing(8),border:"1px solid #E0E3EA",borderRadius:"50%",boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.12)",backgroundColor:"#fff",zIndex:8e3,opacity:0,transition:"all 0.3s ease-in-out","&.collapsed":{img:{transition:"all 0.3s ease-in-out",transform:"rotate(180deg)"}}})));var po=({route:e,isActive:r,isSubmenu:t})=>{const{collapsed:n}=Xl(),[a,s]=d.useState(null),c=Boolean(a),u=e=>{s(e.currentTarget)},p=()=>{s(null)},h=m((({children:r})=>n&&!t?l(U,{title:e.name,placement:"right",children:r}):r),[n,e,t]);return e.link?l(lo,{disablePadding:!0,component:ee,replace:!0,to:{pathname:e.link,search:e.query},children:l(h,{children:o(oo,{className:ir({active:r,main:e.main,collapsed:n}),children:[e.icon&&l(io,{className:ir({collapsed:n}),children:e.icon}),l(so,{primary:e.name,primaryTypographyProps:{variant:"body2"},className:ir({collapsed:n,main:e.main}),sx:n&&!t?{display:"none"}:{}})]})})}):e.children&&n?o(i,{children:[l(ao,{className:"collapsed",children:l(U,{title:e.name,placement:"right",children:l(oo,{className:ir({active:r,main:e.main,collapsed:n}),sx:{justifyContent:"center"},onClick:u,children:e.name.substring(0,1)})})}),l(ze,{open:c,anchorEl:a,onClose:p,PaperProps:{sx:{width:300,maxHeight:440}},MenuListProps:{sx:{bgcolor:"secondary.main"}},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:e.children.map(((e,r)=>l(yo,{route:e,isSubmenu:!0},r)))})]}):l(ao,{children:e.name})},mo="data:image/svg+xml,%3csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg opacity='0.6'%3e%3cpath d='M10.3533 2.81334C10.447 2.90709 10.4996 3.03417 10.4996 3.16667C10.4996 3.29917 10.447 3.42626 10.3533 3.52001L5.87334 8.00001L10.3533 12.48C10.4025 12.5258 10.4419 12.581 10.4692 12.6423C10.4965 12.7036 10.5112 12.7699 10.5124 12.837C10.5136 12.9041 10.5012 12.9708 10.4761 13.0331C10.4509 13.0953 10.4135 13.1519 10.366 13.1994C10.3186 13.2468 10.262 13.2843 10.1997 13.3094C10.1375 13.3346 10.0708 13.3469 10.0037 13.3457C9.93652 13.3446 9.87032 13.3299 9.80898 13.3025C9.74765 13.2752 9.69245 13.2358 9.64667 13.1867L4.81334 8.35334C4.71971 8.25959 4.66711 8.13251 4.66711 8.00001C4.66711 7.86751 4.71971 7.74042 4.81334 7.64667L9.64667 2.81334C9.74042 2.71971 9.86751 2.66711 10 2.66711C10.1325 2.66711 10.2596 2.71971 10.3533 2.81334Z' fill='white'/%3e%3c/g%3e%3c/svg%3e";var ho=({route:e,isActive:r,isListOpen:t,handleClick:n,isSubmenu:i})=>l(ao,{children:l(no,{sx:{padding:0,margin:0},children:l(lo,{disablePadding:!0,onClick:n,children:o(oo,{className:ir({active:r,main:e.main}),sx:{justifyContent:"space-between"},children:[l(so,{primary:e.name,className:ir({main:e.main}),sx:i?{}:{display:"none"}}),e.name,l(P,{component:"img",src:mo,mr:3,sx:{transition:"transform .3s",transform:`rotate(${t?0:"-90deg"})`}})]})})})});function fo({route:e,isActive:r,isListOpen:t,handleClick:n,isSubmenu:i}){const{collapsed:a}=Xl();return null!=e&&e.link?l(lo,{disablePadding:!0,onClick:n,children:o(oo,{className:ir({active:r,main:e.main,collapsed:a}),children:[e.icon&&l(io,{children:e.icon}),l(so,{primary:e.name,primaryTypographyProps:{variant:"body2"},className:ir({collapsed:a,main:e.main}),sx:a&&!i?{display:"none"}:{}}),l(P,{component:"img",src:mo,mr:3,sx:{transition:"transform .3s",transform:`rotate(${t?"-90deg":0})`}})]})}):null!=e&&e.rootLink?l(ho,{route:e,handleClick:n,isListOpen:t}):l(ao,{children:e.name})}const go=({route:e,isSubmenu:r})=>{var t,n,a;const s=Q(),{collapsed:d,toggleRootElementLink:c}=Xl(),[f,g]=p(!1),[y,b]=p("true"===localStorage.getItem(`${e.name.toLowerCase()}_collapsed`)),v=h((()=>!(!e.link&&!e.rootLink)&&s.pathname.startsWith(e.link||e.rootLink)),[s.pathname,e]),C=m((()=>{e&&e.rootLink&&(c(e.name,y),b(!y))}),[y,e,c]);return u((()=>{g(v)}),[v]),null!=e&&e.rootLink&&null!=(t=e.children)&&t.length&&(!d||d&&r)?o(i,{children:[l(fo,{route:e,isActive:v,handleClick:C,isListOpen:y,isSubmenu:r}),l(br,{in:!y,timeout:"auto",children:l(co,{children:e.children.map((e=>l(go,{route:e,isSubmenu:r},e.name)))})})]}):null!=(n=e.children)&&n.length&&(!d||d&&r)?o(i,{children:[l(fo,{route:e,isActive:v,handleClick:()=>{g(!f)},isListOpen:f||!e.link,isSubmenu:r}),l(br,{in:f||!e.link,timeout:"auto",children:l(co,{children:null==(a=e.children)?void 0:a.map(((e,t)=>l(go,{route:e,isSubmenu:r},e.name)))})})]}):l(po,{route:e,isActive:v,isSubmenu:r})};var yo=go;const bo=({src:e,alt:r})=>l(P,{sx:{width:20,height:20,display:"flex",justifyContent:"center",alignItems:"center"},children:l("img",{src:e,alt:r})});var vo=({title:e,routes:r,id:t,logo:n,collapsedLogo:i,footer:a,collapsedFooter:s})=>{const{collapsed:d,toggleCollapse:c}=Xl();return o(eo,{children:[l(uo,{className:ir("button-collapse",{collapsed:d}),onClick:c,children:l("img",{src:"data:image/svg+xml,%3csvg width='7' height='12' viewBox='0 0 7 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M6.47054 0.861939C6.59552 0.986958 6.66573 1.1565 6.66573 1.33327C6.66573 1.51005 6.59552 1.67959 6.47054 1.80461L2.27521 5.99994L6.47054 10.1953C6.59198 10.321 6.65917 10.4894 6.65766 10.6642C6.65614 10.839 6.58602 11.0062 6.46242 11.1298C6.33881 11.2534 6.1716 11.3235 5.99681 11.3251C5.82201 11.3266 5.65361 11.2594 5.52787 11.1379L0.861207 6.47127C0.736226 6.34625 0.666016 6.17672 0.666016 5.99994C0.666016 5.82316 0.736226 5.65362 0.861207 5.52861L5.52787 0.861939C5.65289 0.736958 5.82243 0.666748 5.99921 0.666748C6.17598 0.666748 6.34552 0.736958 6.47054 0.861939V0.861939Z' fill='%238B8C9E'/%3e%3c/svg%3e",alt:"collapse"})}),o(ro,{variant:"permanent",anchor:"left",className:ir({collapsed:d}),id:t,children:[(!!e||!!n)&&l(to,{className:ir({collapsed:d}),"data-title":e.substring(0,1),children:o(P,{display:"flex",flexDirection:"column",children:[!!e&&l(P,{component:"span",children:e}),!!n&&l(P,{component:"img",src:d?i:n,alt:"Lending Hub KZ"})]})}),o(P,{height:""+(n||e?"calc(100vh - 56px)":"auto"),display:"flex",flexDirection:"column",justifyContent:"space-between",children:[l(no,{sx:{overflowY:"auto","&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-thumb":{background:"rgba(196, 196, 196, 0.8)",borderRadius:"16px",backgroundClip:"padding-box",border:"2px solid rgba(0, 0, 0, 0)"}},children:r.map((e=>l(yo,{route:e},e.name)))}),a&&l(P,{borderTop:"1px solid #FFFFFF1F",children:d?s:a})]})]})]})};const Co=({routes:e,theme:r=Ot,title:t="",id:i,logo:a,collapsedLogo:s,footer:d,collapsedFooter:c})=>o(n,{theme:r,children:[l(sr,{}),l(Ql,{children:l(vo,{title:t,routes:e,id:i,logo:a,collapsedLogo:s,footer:d,collapsedFooter:c})})]}),xo=({children:e,toolbar:r,contentSx:t,sx:n})=>o(P,{component:"section",sx:Object.assign({flexGrow:1,bgcolor:"background.default"},n),children:[l(gr,{sx:{borderBottom:"1px solid rgba(38, 40, 66, 0.08)"},children:r}),l(P,{sx:Object.assign({},t,{height:"calc(100vh - 56px)",overflow:"scroll"}),children:l(C,{fallback:l(wr,{}),children:null!=e?e:l(te,{})})})]}),Eo=t(ee)((()=>({textDecoration:"none",color:"inherit"}))),To=({crumbs:e})=>l(vr,{separator:l(Cr,{fontSize:"small"}),"aria-label":"breadcrumb",sx:{"& li":{color:"#6D6E85","&:last-child":{color:"#262842"}}},children:e.map(((e,r)=>e.link?l(Eo,{to:e.link,className:"breadcrumb",children:e.title},r):l(A,{className:"breadcrumb",children:e.title},r)))}),Oo=({children:e})=>{const[r,t]=p(!1),n=m((e=>{t((null==e?void 0:e.scrollWidth)>(null==e?void 0:e.clientWidth));window.addEventListener("resize",(()=>{t((null==e?void 0:e.scrollWidth)>(null==e?void 0:e.clientWidth))}))}),[]);return l(U,{title:e,arrow:!0,disableHoverListener:!r,children:l("div",{ref:n,style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e})})};export{Vr as AlertDialog,lt as BackButton,To as Breadcrumbs,xo as ContentLayout,at as ControlAceEditor,on as ControlArrayInput,Xr as ControlAutocomplete,Jr as ControlCheckbox,Kt as ControlDate,Qt as ControlDateTime,$r as ControlDebouncedInput,Dr as ControlInput,jt as ControlNumberInput,an as ControlPeriodInput,dn as ControlPhoneInput,tt as ControlQueryAutocomplete,Yr as ControlRadio,jr as ControlSelect,Jt as ControlSwitch,tn as ControlTime,nt as CopyButton,Rl as CreateDefinition,Vl as CreatePropertiesList,kl as CreatePropertiesListContext,Ol as CreatePropertyFormFields,Er as DATE_DEFAULT_FORMAT,Or as DATE_TIME_DEFAULT_FORMAT,Nr as DEFAULT_DATE_VALIDATION_ERROR_TEXT,Ht as DEFAULT_ERROR_TEXT,Mr as DEFAULT_REQUIRED_ERROR_TEXT,Bl as DefinitionFiller,Wl as DefinitionValueView,jn as InfoItem,gt as JsonModalView,Kl as JsonPathPicker,ft as JsonView,wr as Loader,bo as MenuIcon,zl as MultiplePropertyFiller,Oo as OverflowTip,Hr as PopupIconComponent,ql as PropertyFiller,xr as PropertyType,dl as PropertyValueField,Sr as RoundingMode,Hn as RouteTabs,Co as Sidebar,qn as SimpleTable,Gl as Status,Yn as StepperView,Tr as TIME_DEFAULT_FORMAT,Bn as TabPanel,Ln as Table,kn as TableAction,$n as TableActionCell,Al as ViewPropertiesList,Pl as ViewProperty,ct as capitalize,ht as deepParseJson,kr as defaultDefinitionArrayValue,Rr as defaultDefinitionObjectValue,wt as digitsOnly,Vt as floatsOnly,It as formatDefinitionData,St as formatTableRowValue,Pt as getDemPropertyDateFormat,At as getEntityStarterValue,pt as getJsonStringValue,qt as getMultiplePropertyFillOptions,$t as getSinglePropertyFillOptions,kt as isDateType,Lt as isExpression,Mt as isPropertyValueEmpty,Rt as numberFormat,Ft as propertiesArrayToObject,Dt as propertiesObjectToArray,st as removeArrayItem,mt as safeParseJson,ut as sortArrayOfObjects,Ot as theme,Pr as useDebounce,Ar as useToggle,dt as validateJson};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@dartech/arsenal-ui",
|
3
|
-
"version": "1.4.
|
3
|
+
"version": "1.4.87",
|
4
4
|
"author": "DAR",
|
5
5
|
"publishConfig": {
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
@@ -25,9 +25,9 @@
|
|
25
25
|
"react-router-dom": "6.8.0",
|
26
26
|
"react-toastify": "^9.1.1",
|
27
27
|
"classnames": "^2.3.1",
|
28
|
-
"@tanstack/react-query": "^4.24.10"
|
28
|
+
"@tanstack/react-query": "^4.24.10",
|
29
|
+
"react-input-mask": "^3.0.0-alpha.2"
|
29
30
|
},
|
30
31
|
"module": "./index.esm.js",
|
31
|
-
"
|
32
|
-
"main": "./index.esm.js"
|
32
|
+
"main": "./index.cjs.js"
|
33
33
|
}
|
File without changes
|