react-luminus-components 1.3.202 → 1.3.203
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.cjs.js +1 -1
- package/dist/main.es.js +3 -3
- package/package.json +1 -1
package/dist/main.cjs.js
CHANGED
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
Prefix can't start with '-' when allowNegative is true.
|
|
7
7
|
prefix: `+o+`
|
|
8
8
|
allowNegative: `+a+`
|
|
9
|
-
`),a=!1),Object.assign(Object.assign({},t),{allowNegative:a})}function ei(t){t=Ja(t),t.decimalSeparator,t.allowedDecimalSeparators,t.thousandsGroupStyle;var s=t.suffix,n=t.allowNegative,r=t.allowLeadingZeros,o=t.onKeyDown;o===void 0&&(o=Te);var a=t.onBlur;a===void 0&&(a=Te);var l=t.thousandSeparator,c=t.decimalScale,u=t.fixedDecimalScale,d=t.prefix;d===void 0&&(d="");var x=t.defaultValue,p=t.value,E=t.valueIsNumericString,m=t.onValueChange,h=bn(t,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),g=jt(t),j=g.decimalSeparator,f=g.allowedDecimalSeparators,b=function(w){return hs(w,t)},y=function(w,N){return Za(w,N,t)},v=ze(p)?x:p,R=E??Qa(v,d,s);ze(p)?ze(x)||(R=R||typeof x=="number"):R=R||typeof p=="number";var _=function(w){return wn(w)?w:(typeof w=="number"&&(w=_n(w)),R&&typeof c=="number"?fs(w,c,!!u):w)},D=Sn(_(p),_(x),!!R,b,y,m),S=D[0],I=S.numAsString,F=S.formattedValue,L=D[1],A=function(w){var N=w.target,M=w.key,V=N.selectionStart,K=N.selectionEnd,P=N.value;if(P===void 0&&(P=""),(M==="Backspace"||M==="Delete")&&K<d.length){w.preventDefault();return}if(V!==K){o(w);return}M==="Backspace"&&P[0]==="-"&&V===d.length+1&&n&&Oe(N,1),c&&u&&(M==="Backspace"&&P[V-1]===j?(Oe(N,V-1),w.preventDefault()):M==="Delete"&&P[V]===j&&w.preventDefault()),f!=null&&f.includes(M)&&P[V]===j&&Oe(N,V+1);var W=l===!0?",":l;M==="Backspace"&&P[V-1]===W&&Oe(N,V-1),M==="Delete"&&P[V]===W&&Oe(N,V+1),o(w)},C=function(w){var N=I;if(N.match(/\d/g)||(N=""),r||(N=Ba(N)),u&&c&&(N=fs(N,c,u)),N!==I){var M=hs(N,t);L({formattedValue:M,value:N,floatValue:parseFloat(N)},{event:w,source:st.event})}a(w)},U=function(w){return w===j?!0:nt(w)},G=function(w){var N=w.currentValue,M=w.lastValue,V=w.formattedValue,K=w.currentValueIndex,P=w.formattedValueIndex,W=N[K],Z=V[P],q=kn(M,N),$=q.to,Y=function(B){return y(B).indexOf(".")+d.length};return p===0&&u&&c&&N[$.start]===j&&Y(N)<K&&Y(V)>P?!1:K>=$.start&&K<$.end&&f&&f.includes(W)&&Z===j?!0:W===Z};return Object.assign(Object.assign({},h),{value:F,valueIsNumericString:!1,isValidInputCharacter:U,isCharacterSame:G,onValueChange:L,format:b,removeFormatting:y,getCaretBoundary:function(w){return Xa(w,t)},onKeyDown:A,onBlur:C})}function Gt(t){var s=ei(t);return i.createElement(Ka,Object.assign({},s))}const ti=({InputContainer:t=e.FloatingLabelInput,value:s,onChange:n,debounceMs:r,label:o,withoutLabel:a,placeholder:l,size:c,hidden:u,disabled:d,showClearIcon:x,clearValue:p,className:E,step:m,noSelectOnFocus:h,decimalScale:g,fixedDecimalScale:j=!1,numberPrefix:f,numberSuffix:b,min:y,max:v,hint:R})=>{const _=i.useCallback(()=>{if(!n)return;const A=p??null;n(A?Number(A):null)},[p,n]),D=i.useRef(null),[S,I]=i.useState((s==null?void 0:s.toString())??""),F=i.useCallback(A=>{const C=A;n&&n(C==null||C===""?null:Number(C))},[n]),L=i.useCallback(A=>{var U,G;let C=parseFloat(((G=(U=A.target)==null?void 0:U.value)==null?void 0:G.replaceAll(" ","").replaceAll(",","."))??0);if(Number.isNaN(C)&&(C=0),!r){F(C.toString());return}I(C.toString()),D.current!==null&&window.clearTimeout(D.current),D.current=window.setTimeout(()=>{F(C.toString())},r)},[r,F]);return i.useEffect(()=>{I(s===null?"":s.toString())},[v,y,s]),i.useEffect(()=>{v!==void 0&&Number(S)>v&&I(v.toString()),y!==void 0&&Number(S)<y&&I(y.toString())},[S,v,y,I]),i.useEffect(()=>{!n||s===null||(v!==void 0&&s>v&&n(v),y!==void 0&&s<y&&n(y))},[s,v,y,n]),e.jsxRuntimeExports.jsxs(t,{withoutLabel:a,label:o??"",hidden:u,className:E,hint:R,children:[e.jsxRuntimeExports.jsx(Gt,{displayType:"input",thousandSeparator:" ",decimalSeparator:",",decimalScale:g,fixedDecimalScale:j,prefix:f,suffix:b,defaultValue:"",value:r?S:(s==null?void 0:s.toString())??"",placeholder:l??o,onFocus:A=>{!h&&A.target.select()},onChange:L,hidden:u,disabled:d,className:e.classNames("form-control text-end w-100",{[`form-control-${c}`]:c}),step:m,min:y,max:v}),x&&s!==null&&n&&!d&&e.jsxRuntimeExports.jsx("div",{className:"luminus-input-remove-icon inset",children:e.jsxRuntimeExports.jsx(e.IconButton,{color:"secondary",size:"sm",onClick:_,children:e.jsxRuntimeExports.jsx(e.MdClear,{})})})]})},si=({InputContainer:t=e.RowLabelInput,label:s,options:n,disabled:r,hidden:o,className:a,value:l,onChange:c})=>{const u=i.useCallback(d=>{c&&c(d.target.value)},[c]);return e.jsxRuntimeExports.jsx(t,{isForRadioInput:!0,hidden:o,withoutLabel:!s,label:`${s}`,className:a,children:n.map(d=>e.jsxRuntimeExports.jsx(e.Form.Check,{id:`radio-${d.id}`,label:d.name,type:"radio",value:d.id??"",checked:l===d.id,onChange:u,hidden:o,disabled:r,className:"w-100"},d.id))})},gs=[["D","day"],["M","month"],["Y","year"],["C","custom"]],ni="_wrapper_qfqux_1",ri="_lg_qfqux_7",oi="_sm_qfqux_11",ai="_md_qfqux_14",Es={wrapper:ni,lg:ri,sm:oi,md:ai},dt=t=>{const s=new Date(t),n=e.trimIsoDate(s.toISOString());s.setMonth(s.getMonth()+1),s.setDate(s.getDate()-1);const r=e.trimIsoDate(s.toISOString());return{from:n,to:r}},Xe=t=>{const s=new Date(t),n=e.trimIsoDate(s.toISOString());s.setFullYear(s.getFullYear()+1),s.setDate(s.getDate()-1);const r=e.trimIsoDate(s.toISOString());return{from:n,to:r}},ii=(t,s)=>{if(t===null||s===null)return"C";if(t===s)return"D";const n=new Date(t);return dt(n).to===s?"M":Xe(n).to===s?"Y":(console.log(Xe(n),s),"C")},li=(t,s,n)=>{const r=i.useCallback((l,c)=>{if(t==="C"){n(u=>({...u,[l]:c}));return}switch(l){case"from":n(u=>{if(c===null)return u;const d=new Date(c);if(t==="D"){const x=e.trimIsoDate(d.toISOString());return{from:x,to:x}}return t==="M"?dt(d):t==="Y"?Xe(d):u});break;case"to":s("C"),n(u=>({...u,[l]:c}));break}},[t,n,s]),o=i.useCallback(l=>{n(c=>{if(c.from===null||c.to===null)return c;const u=new Date(c.from);u.setHours(u.getHours()-u.getTimezoneOffset()/60);const d=new Date(c.to);if(t==="D"){u.setDate(u.getDate()+l);const x=e.trimIsoDate(u.toISOString());return{from:x,to:x}}return t==="M"?(u.setMonth(u.getMonth()+l),dt(u)):t==="Y"?(u.setFullYear(u.getFullYear()+l),Xe(u)):{from:e.trimIsoDate(u.toISOString()),to:e.trimIsoDate(d.toISOString())}})},[t,n]),a=i.useCallback(l=>{l==="D"?n(c=>({from:c.from,to:c.from})):l==="M"?n(c=>{if(c.from===null)return c;const u=e.getFirstDayOfMonth(c.from);return dt(u)}):l==="Y"&&n(c=>{if(c.from===null)return c;const u=e.getFirstDayOfYear(new Date(c.from).getFullYear());return Xe(u)}),s(l)},[n,s]);return{setFromToProp:r,handleArrowClick:o,handleRangeChange:a}},ci=({fromtoState:[t,s],className:n,size:r})=>{const{texts:{date:o},ProjectIconComponent:a}=i.useContext(e.LuminusComponentsContext),[l,c]=i.useState("C"),{handleArrowClick:u,handleRangeChange:d,setFromToProp:x}=li(l,c,s),p=i.useMemo(()=>l==="C",[l]),E=i.useRef(!0);return i.useEffect(()=>{if(E.current){const m=ii(t.from,t.to);c(m),E.current=!1}},[t.from,t.to]),e.jsxRuntimeExports.jsxs("div",{className:e.classNames("d-inline-flex align-items-center gap-1",Es.wrapper,Es[r??"md"],n),children:[e.jsxRuntimeExports.jsx(e.IconButton,{disabled:p,onClick:()=>{u(-1)},children:e.jsxRuntimeExports.jsx(a,{icon:"chevron-left"})}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center gap-1",children:[e.jsxRuntimeExports.jsx(Se,{type:"date",value:t.from,onChange:m=>x("from",m===null?null:m.toString()),InputContainer:e.NoInputContainer,size:r}),e.jsxRuntimeExports.jsx(e.Dropdown,{toggle:e.jsxRuntimeExports.jsx(e.DropdownToggle,{text:o[gs.find(m=>m[0]===l)[1]].substring(0,1),as:e.FromToDatePickerDropdownToggle}),children:gs.map(m=>e.jsxRuntimeExports.jsx(e.DropdownItem,{disabled:m[0]===l,className:e.classNames(m[0]===l?"text-black-50":""),onClick:()=>d(m[0]),role:"button",children:o[m[1]]},m[0]))}),e.jsxRuntimeExports.jsx(Se,{type:"date",value:t.to,onChange:m=>x("to",m===null?null:m.toString()),InputContainer:e.NoInputContainer,size:r})]})}),e.jsxRuntimeExports.jsx(e.IconButton,{disabled:p,onClick:()=>{u(1)},children:e.jsxRuntimeExports.jsx(a,{icon:"chevron-right"})})]})},ui=({defaultMonth:t,searchKey:s="monthFrom",yearMin:n,yearMax:r})=>{const{localizationContext:o}=i.useContext(e.LuminusComponentsContext),{dateFnsLocale:a}=i.useContext(o),{searchParams:l,setSearch:c}=Ae.useSearchQuery(),u=l.get(s),d=u?e.parseISO(u):t,x=i.useCallback(p=>{c(s,St(p,{representation:"date"}))},[s,c]);return e.jsxRuntimeExports.jsx(xn,{month:d,onChangeMonth:x,locale:a,yearMin:n,yearMax:r})},di=({defaultYear:t,searchKey:s="yearFrom",...n})=>{const[r,o]=Ae.useSearchQueryState(s,St(t,{representation:"date"})),a=r?e.parseISO(r):t,l=i.useCallback(c=>{o(St(c,{representation:"date"}))},[o]);return e.jsxRuntimeExports.jsx(mn,{year:a,onChangeYear:l,...n})},xi=({data:t,showLegend:s=!1,legendPosition:n="left",onClick:r})=>{const{chartColorPalette:o}=i.useContext(e.LuminusComponentsContext);return e.jsxRuntimeExports.jsx(e._,{data:t,margin:{top:50,right:s&&n==="right"?200:100,bottom:50,left:s&&n==="left"?200:100},innerRadius:.4,padAngle:4,cornerRadius:2,activeOuterRadiusOffset:10,borderWidth:2,borderColor:{from:"color",modifiers:[["darker",.5]]},colors:o,arcLinkLabelsSkipAngle:10,arcLinkLabelsTextColor:{from:"color",modifiers:[["darker",.5]]},arcLinkLabelsThickness:2,arcLinkLabelsColor:{from:"color"},enableArcLabels:!1,legends:s?[{anchor:n,direction:n==="left"||n==="right"?"column":"row",justify:!1,translateX:n==="left"?-200:n==="right"?200:0,translateY:n==="top"?-50:n==="bottom"?50:0,itemsSpacing:4,itemWidth:120,itemHeight:18,itemTextColor:"#1e2832",itemDirection:"left-to-right",itemOpacity:1,symbolSize:18,symbolShape:"circle",padding:10}]:[],onClick:a=>r&&r(a.data)})},mi=({errors:t,schema:s})=>{const n=r=>{var o,a;return r.toLowerCase()==="others"?"Obecné":((a=(o=s.columns)==null?void 0:o.find(l=>l.field===r))==null?void 0:a.caption)??r};return e.jsxRuntimeExports.jsx("div",{className:"alert alert-danger w-100 m-0 p-2",children:e.jsxRuntimeExports.jsx("table",{children:e.jsxRuntimeExports.jsx("tbody",{children:t.map(r=>e.jsxRuntimeExports.jsxs("tr",{children:[e.jsxRuntimeExports.jsx("td",{className:"fw-bold pe-2",children:e.jsxRuntimeExports.jsxs(e.Typography,{variant:"body",children:[n(r.name),":"]})}),e.jsxRuntimeExports.jsx("td",{className:"",children:e.jsxRuntimeExports.jsx(e.Typography,{variant:"body",children:r.errors})})]},r.name))})})})},In=t=>{const s={};return Object.keys(t).forEach(n=>{if(t[n].value===!0){s[n]=1;return}if(t[n].value===!1){s[n]=0;return}s[n]=t[n].value}),s},Rs=(t,s)=>{const n={};return Object.keys(t).forEach(r=>{var l;const o=t[r],a=(l=s.columns)==null?void 0:l.find(c=>c.field===r);if((a==null?void 0:a.type)==="BIT"&&(o===1||o===0)){n[r]={value:o===1,defaultValue:o===1};return}n[r]={value:o,defaultValue:o}}),n},pi="_table_1klfy_1",fi="_table-header_1klfy_10",ji="_table-row_1klfy_10",hi="_table-head_1klfy_10",gi="_filters-row_1klfy_19",Ei="_table-body_1klfy_30",Ri="_table-cell_1klfy_30",vi="_action-column_1klfy_43",yi="_sticky-top_1klfy_47",bi="_sticky-first_1klfy_54",wi="_sticky-last_1klfy_61",Ci="_sticky-bottom_1klfy_68",re={table:pi,"table-header":"_table-header_1klfy_10",tableHeader:fi,"table-row":"_table-row_1klfy_10",tableRow:ji,"table-head":"_table-head_1klfy_10",tableHead:hi,"filters-row":"_filters-row_1klfy_19",filtersRow:gi,"table-body":"_table-body_1klfy_30",tableBody:Ei,"table-cell":"_table-cell_1klfy_30",tableCell:Ri,"action-column":"_action-column_1klfy_43",actionColumn:vi,"sticky-top":"_sticky-top_1klfy_47",stickyTop:yi,"sticky-first":"_sticky-first_1klfy_54",stickyFirst:bi,"sticky-last":"_sticky-last_1klfy_61",stickyLast:wi,"sticky-bottom":"_sticky-bottom_1klfy_68",stickyBottom:Ci},Ni="_input_pxkkh_1",ke={input:Ni},Dn=({type:t,value:s,field:n,isPrimary:r,isReadonly:o,primaryEditable:a=!1,valuesForSelect:l,addValueToValuesForSelect:c,onChangeHandler:u,hideClearIcon:d,clearValue:x,customPickers:p})=>{var E;switch(t){case"NUM":return l&&l.length>0?e.jsxRuntimeExports.jsx(tt,{withoutLabel:!0,InputContainer:e.NoInputContainer,className:ke.input,size:"sm",value:(s==null?void 0:s.toString())??"",onChange:m=>u(n,m===null?null:Number(m)),options:l,disabled:o?!0:r?!a:!1,showClearIcon:!d,clearValue:x,dropdownWidth:200}):e.jsxRuntimeExports.jsx(Se,{withoutLabel:!0,InputContainer:e.NoInputContainer,className:ke.input,size:"sm",type:"number",value:s===null?null:Number(s),onChange:m=>u(n,m===null?null:Number(m)),disabled:o?!0:r?!a:!1,showClearIcon:!d,clearValue:x});case"STR":return l&&l.length>0?e.jsxRuntimeExports.jsx(tt,{withoutLabel:!0,InputContainer:e.NoInputContainer,className:ke.input,size:"sm",value:(s==null?void 0:s.toString())??"",onChange:m=>u(n,(m==null?void 0:m.toString())??null),options:l,disabled:o?!0:r?!a:!1,showClearIcon:!d,clearValue:x,dropdownWidth:200}):e.jsxRuntimeExports.jsx(Se,{withoutLabel:!0,InputContainer:e.NoInputContainer,className:e.classNames(ke.input,ke.longer),size:"sm",type:"text",value:(s==null?void 0:s.toString())??"",onChange:m=>u(n,(m==null?void 0:m.toString())??null),disabled:o?!0:r?!a:!1,showClearIcon:!d,clearValue:x});case"BIT":return e.jsxRuntimeExports.jsx(yn,{InputContainer:e.NoInputContainer,className:ke.input,value:s===!0,onChange:m=>u(n,m),disabled:o?!0:r?!a:!1});case"DT":return e.jsxRuntimeExports.jsx(Se,{withoutLabel:!0,InputContainer:e.NoInputContainer,className:ke.input,size:"sm",type:"date",value:s?s.toString().split("T")[0]??"":"",onChange:m=>u(n,(m==null?void 0:m.toString())??null),disabled:o?!0:r?!a:!1,showClearIcon:!d,clearValue:x});default:{const m=p==null?void 0:p.find(h=>h.type===t);return m?e.jsxRuntimeExports.jsx(m.picker,{className:e.classNames(ke.input,ke.longer),value:s?{id:(s==null?void 0:s.toString())??null,name:((E=l==null?void 0:l.find(h=>{var g;return((g=h.id)==null?void 0:g.toString())===(s==null?void 0:s.toString())}))==null?void 0:E.name)??""}:null,onChange:h=>{var g;u(n,(h==null?void 0:h.id)??null),console.log(h,l==null?void 0:l.some(j=>{var f,b;return((f=j.id)==null?void 0:f.toString())===((b=h==null?void 0:h.id)==null?void 0:b.toString())}),c),h&&!(l!=null&&l.some(j=>{var f,b;return((f=j.id)==null?void 0:f.toString())===((b=h==null?void 0:h.id)==null?void 0:b.toString())}))&&c&&(console.log("adding to values for select"),c({id:((g=h.id)==null?void 0:g.toString())??"",name:h.name}))},disabled:o?!0:r?!a:!1}):e.jsxRuntimeExports.jsx("div",{className:"alert alert-warning p-1 m-0",children:e.jsxRuntimeExports.jsxs(e.Typography,{variant:"body",children:["Neznámý typ ",t]})})}}},_i=({schema:t,columns:s,setColumns:n,initialItem:r,onEdit:o,onDelete:a,customPickers:l})=>{const{ProjectIconComponent:c}=i.useContext(e.LuminusComponentsContext),[u,d]=i.useState(r),x=i.useCallback((m,h)=>{console.log("changeValue",m,h),d(g=>({...g,[m]:{...g[m],value:h}}))},[]),p=m=>(m==null?void 0:m.value)!==(m==null?void 0:m.defaultValue),E=i.useCallback(()=>Object.keys(u).some(m=>p(u[m])),[u]);return i.useEffect(()=>{d(r)},[r]),e.jsxRuntimeExports.jsxs("tr",{className:e.classNames("table-row",re.tableRow),children:[e.jsxRuntimeExports.jsx("td",{className:e.classNames("table-cell",re.tableCell,re.stickyFirst),children:E()&&e.jsxRuntimeExports.jsx(e.IconButton,{color:"success",onClick:()=>o(In(u)),children:e.jsxRuntimeExports.jsx(c,{icon:"check"})})}),s.map(m=>{var h,g;return e.jsxRuntimeExports.jsx("td",{className:e.classNames("table-cell",re.tableCell),children:e.jsxRuntimeExports.jsx(Dn,{type:m.type,value:(h=u[m.field??""])==null?void 0:h.value,field:m.field,isReadonly:m.readOnly,isPrimary:t.primaryKey===m.field,valuesForSelect:m.valuesForSelect,addValueToValuesForSelect:j=>{n(s.map(f=>f.field===m.field?{...f,valuesForSelect:[...f.valuesForSelect??[],j]}:f))},onChangeHandler:x,hideClearIcon:!p(u[m.field??""]),clearValue:(g=u[m.field??""].defaultValue)==null?void 0:g.toString(),customPickers:l})},`${t.id}-${m.field}`)}),e.jsxRuntimeExports.jsx("td",{className:e.classNames("table-cell",re.tableCell,re.stickyLast),children:e.jsxRuntimeExports.jsx(e.IconButton,{color:"danger",onClick:()=>a(u[t.primaryKey??""].value),children:e.jsxRuntimeExports.jsx(c,{icon:"delete"})})})]})},ki=({schema:t,columns:s,setColumns:n,onCreate:r,customPickers:o})=>{const{ProjectIconComponent:a}=i.useContext(e.LuminusComponentsContext),[l,c]=i.useState(null),u=i.useCallback(()=>{var p;const x={};(p=t.columns)==null||p.forEach(E=>{const m=E.type==="BIT"?!1:E.type==="NUM"?0:E.type==="STR"?"":null;x[E.field??""]={value:m,defaultValue:m}}),c(x)},[t]),d=i.useCallback((x,p)=>{c(E=>E&&{...E,[x]:{...E[x],value:p}})},[]);return l?e.jsxRuntimeExports.jsxs("tr",{className:"sticky-bottom shadow",children:[e.jsxRuntimeExports.jsx("td",{className:"sticky-first",children:e.jsxRuntimeExports.jsx(e.IconButton,{color:"success",onClick:async()=>{const x=In(l);x&&await r(x)&&c(null)},children:e.jsxRuntimeExports.jsx(a,{icon:"check"})})}),s.map(x=>e.jsxRuntimeExports.jsx("td",{children:e.jsxRuntimeExports.jsx(Dn,{type:x.type,value:l[x.field??""].value,field:x.field,isReadonly:x.readOnly,isPrimary:t.primaryKey===x.field,valuesForSelect:x.valuesForSelect,addValueToValuesForSelect:p=>{n(s.map(E=>E.field===x.field?{...E,valuesForSelect:[...E.valuesForSelect??[],p]}:E))},onChangeHandler:d,primaryEditable:!0,customPickers:o})},`${t.id}-${x.field}`)),e.jsxRuntimeExports.jsx("td",{className:"sticky-last",children:e.jsxRuntimeExports.jsx(e.IconButton,{color:"danger",onClick:()=>c(null),children:e.jsxRuntimeExports.jsx(a,{icon:"cancel"})})})]}):e.jsxRuntimeExports.jsxs("tr",{className:"sticky-bottom shadow",children:[e.jsxRuntimeExports.jsx("td",{className:"sticky-first",children:e.jsxRuntimeExports.jsx(e.IconButton,{onClick:u,children:e.jsxRuntimeExports.jsx(a,{icon:"add"})})}),e.jsxRuntimeExports.jsx("td",{colSpan:s.length+1})]})},Si="_resizer_ref0b_1",Ii="_content_ref0b_11",Di="_dragging_ref0b_16",lt={resizer:Si,content:Ii,dragging:Di},Tn=({cellRef:t,defaultWidth:s})=>{const[n,r]=i.useState(s),[,o]=i.useState(null);return i.useEffect(()=>{r(s)},[s]),i.useEffect(()=>{t.current&&(t.current.style.minWidth=`${n}px`)},[n,t]),e.jsxRuntimeExports.jsx("div",{className:e.classNames("luminus-column-resizer",lt.resizer),draggable:!0,onDragStart:a=>{o(a.currentTarget.getBoundingClientRect().x),a.currentTarget.classList.add(lt.dragging)},onDrag:a=>{o(l=>(t.current&&r(c=>c+a.clientX-(l??0)),a.clientX))},onDragEnd:a=>{o(null),a.currentTarget.classList.remove(lt.dragging)},children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("content",lt.content)})})},Ti=({column:t,children:s})=>t.description?e.jsxRuntimeExports.jsx(e.SimpleTooltip,{placement:"bottom",text:t.description??"",children:e.jsxRuntimeExports.jsx("div",{children:s})}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:s}),Li=({column:t,sortByField:s,sortByType:n,setSortBy:r})=>{const{ProjectIconComponent:o}=i.useContext(e.LuminusComponentsContext),a=i.useRef(null),l=i.useMemo(()=>{if(t.valuesForSelect&&t.valuesForSelect.length>0)return 200;switch(t.type){case"NUM":return 80;case"STR":return 200;case"BIT":return 50;case"DT":return 100;default:return 100}},[t.type,t.valuesForSelect]);return e.jsxRuntimeExports.jsxs("th",{ref:a,className:e.classNames("table-head",re.tableHead),onClick:()=>{const c=s===t.field?n:null;if(c==="asc"){r(t.field,"desc");return}if(c==="desc"){r(t.field,null);return}r(t.field,"asc")},children:[e.jsxRuntimeExports.jsx(Ti,{column:t,children:e.jsxRuntimeExports.jsxs("div",{className:"d-flex justify-content-between align-items-center",children:[t.label,s===t.field&&e.jsxRuntimeExports.jsx(o,{icon:n==="asc"?"chevron-up":"chevron-down"})]})}),e.jsxRuntimeExports.jsx(Tn,{cellRef:a,defaultWidth:l})]})},Fi=({schema:t,items:s,onEditItem:n,onDeleteItem:r,onCreateItem:o,filters:a,setFilter:l,sortByField:c,sortByType:u,setSortBy:d,selectedMaster:x,customPickers:p})=>{const{texts:{dynamicForms:E}}=i.useContext(e.LuminusComponentsContext),[m,h]=i.useState([]);return i.useEffect(()=>{var g,j,f;h([...((f=(j=(g=t.columns)==null?void 0:g.filter(b=>!b.hidden))==null?void 0:j.filter(b=>t.masterReference?b.field!==t.masterReferenceColumn:!0))==null?void 0:f.map(b=>{var y;return{label:b.caption??"",width:100,description:b.description??null,field:b.field??"",type:b.type,readOnly:b.readOnly,valuesForSelect:((y=b.values)==null?void 0:y.filter(v=>b.valuesFilteredByMaster?v.masterValue===x:!0).map(v=>({id:v.id??"",name:v.name})))??void 0}}))??[]])},[t,x]),e.jsxRuntimeExports.jsxs("table",{id:`dynamic-table-${t.id}`,className:e.classNames("table table-borderless luminus-df-table",re.table),children:[e.jsxRuntimeExports.jsxs("thead",{className:e.classNames("text-nowrap table-header",re.stickyTop,re.tableHeader),children:[e.jsxRuntimeExports.jsxs("tr",{className:e.classNames("table-row",re.tableRow),children:[e.jsxRuntimeExports.jsx("th",{className:e.classNames("table-head",re.tableHead,re.actionColumn,re.stickyFirst)}),m.map(g=>e.jsxRuntimeExports.jsx(Li,{column:g,sortByField:c,sortByType:u,setSortBy:d},`${t.id}-${g.field}`)),e.jsxRuntimeExports.jsx("th",{className:e.classNames("table-head",re.tableHead,re.actionColumn,re.stickyLast)})]}),e.jsxRuntimeExports.jsxs("tr",{className:e.classNames("table-row filters-row",re.tableRow,re.filtersRow),children:[e.jsxRuntimeExports.jsx("th",{className:e.classNames("table-head",re.tableHead,re.actionColumn,re.stickyFirst)}),m.map(g=>e.jsxRuntimeExports.jsx("th",{className:e.classNames("table-head",re.tableHead),children:g.valuesForSelect&&g.valuesForSelect.length>0||g.type==="BIT"?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(tt,{InputContainer:e.NoInputContainer,withoutLabel:!0,size:"sm",value:a[g.field]??"",onChange:j=>l(g.field,(j==null?void 0:j.toString())??null),options:g.type==="BIT"?[{id:1,name:E.yes},{id:0,name:E.no}]:g.valuesForSelect??[],isNumber:g.type==="BIT",showClearIcon:!0,dropdownWidth:200})}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(Se,{InputContainer:e.NoInputContainer,withoutLabel:!0,size:"sm",type:g.type==="NUM"?"number":g.type==="DT"?"date":"text",value:a[g.field]??"",onChange:j=>l(g.field,(j==null?void 0:j.toString())??null)})})},`${t.id}-${g.field}`)),e.jsxRuntimeExports.jsx("th",{className:e.classNames("table-head",re.tableHead,re.actionColumn,re.stickyLast)})]})]}),e.jsxRuntimeExports.jsxs("tbody",{className:e.classNames("table-body",re.tableBody),children:[s.filter(g=>g[t.primaryKey??""]).map(g=>e.jsxRuntimeExports.jsx(_i,{schema:t,columns:m,setColumns:h,initialItem:g,onEdit:n,onDelete:r,customPickers:p},`${t.id}-${g[t.primaryKey??""].value}`)),e.jsxRuntimeExports.jsx(ki,{schema:t,columns:m,setColumns:h,onCreate:o,customPickers:p})]})]})},$i=({master:t,onChange:s,options:n,label:r})=>e.jsxRuntimeExports.jsx("div",{style:{minWidth:"200px"},children:e.jsxRuntimeExports.jsx(tt,{label:r,value:t,onChange:o=>s(o?o.toString():null),options:n,size:"sm"})}),Mi="_pagination_gujwe_1",vs={pagination:Mi},ys={appDetail:"/settings/:id"},Be={apiSchemaGet:"/dynamicForms/schema",apiDataGet:"/dynamicForms/data",apiItemPost:"/dynamicForms/update",apiItemDelete:"/dynamicForms/delete",apiItemCreate:"/dynamicForms/insert",apiExportGet:"/dynamicForms/export"},Bi=({id:t,page:s,setPage:n,filters:r,setFilter:o,sortByField:a,sortByType:l,setSortBy:c,appUrls:{appDetail:u=ys.appDetail}=ys,apiUrls:{apiSchemaGet:d=Be.apiSchemaGet,apiDataGet:x=Be.apiDataGet,apiItemPost:p=Be.apiItemPost,apiItemDelete:E=Be.apiItemDelete,apiItemCreate:m=Be.apiItemCreate,apiExportGet:h=Be.apiExportGet}=Be,customPickers:g})=>{var ee,te,fe,Re,ve,Pe;const{texts:{dynamicForms:j},ProjectIconComponent:f}=i.useContext(e.LuminusComponentsContext),b=e.useAxios(),{startLoading:y,stopLoading:v}=i.useContext(e.LoadingContext),[R,_]=i.useState(null),[D,S]=i.useState(null),[I,F]=i.useState(null),[L,A]=i.useState(null),[C,U]=i.useState(!1),{addNotification:G}=e.useNotifications(),[w,N]=i.useState([]),{confirm:M}=e.useConfirm(),V=20,K=V+1,P=L?Math.ceil(L.length/V):1,W=s?s>1:!1,Z=s?s<P:!1,q=s?(s-1)*V:0,$=s?s*V:V,Y=i.useMemo(()=>L?L.length>K:!1,[L,K]),B=i.useMemo(()=>Y?(L==null?void 0:L.slice(q,$))??null:L??null,[Y,L,q,$]),[z,ae]=i.useState(null);i.useEffect(()=>{_(null),S(null),U(!1),N([]),ae(null)},[t]);const Ne=i.useCallback(async()=>{y("dynamicFormSchema"),await b.get(`${d}?id=${t}`).then(({data:H})=>{_(H),v("dynamicFormSchema")}).catch(()=>v("dynamicFormSchema"))},[b,t,y,v,d]),Ee=i.useCallback(async()=>{var H;if(!(R===null||((H=R.id)==null?void 0:H.toString())!==t)){if(R.masterReference&&!z){S([]);return}y("dynamicFormData"),await b.get(`${x}?id=${t}&showArchive=${C}${R.masterReference?`&master=${z}`:""}`).then(({data:se})=>{const ie=se.map(ne=>{var le;return Object.fromEntries(((le=R.columns)==null?void 0:le.filter(ue=>ue.field).map(ue=>[ue.field,{value:ne[ue.field??""],defaultValue:ne[ue.field??""]}]))??[])});S(ie),v("dynamicFormData")}).catch(()=>v("dynamicFormData"))}},[b,t,R,y,v,C,z,x]),_e=i.useCallback(async()=>{var H;R===null||((H=R.id)==null?void 0:H.toString())!==t||R.masterReference&&!z||(y("dynamicFormExport"),await b.get(`${h}?id=${t}&showArchive=${C}${R.masterReference?`&master=${z}`:""}`,{responseType:"blob"}).then(se=>e.saveFileFromResponse(se,{fallbackName:`export-${t}`})).finally(()=>v("dynamicFormExport")))},[b,t,R,y,v,C,z,h]),me=i.useCallback(async H=>(y("dynamicFormEdit"),b.post(`${p}?id=${t}`,H).then(()=>(v("dynamicFormEdit"),N([]),!0)).catch(se=>(v("dynamicFormEdit"),N(e.extractErrorsFromResponse(se)),!1))),[b,t,y,v,p]),Q=i.useCallback(async H=>(y("dynamicFormDelete"),b.delete(`${E}?id=${t}&pk=${H}`).then(()=>(v("dynamicFormDelete"),N([]),!0)).catch(se=>(v("dynamicFormDelete"),N(e.extractErrorsFromResponse(se)),!1))),[b,t,y,v,E]),xe=i.useCallback(async H=>(y("dynamicFormCreate"),b.post(`${m}?id=${t}`,H).then(({data:se})=>(v("dynamicFormCreate"),N([]),se)).catch(se=>(v("dynamicFormCreate"),N(e.extractErrorsFromResponse(se)),null))),[b,t,y,v,m]),be=i.useCallback(async H=>{R&&await me(R.masterReference?{...H,[R.masterReferenceColumn??""]:z}:H)&&(G(j.editSuccess,"success"),S(se=>se&&se.map(ie=>{var ne;return((ne=ie[(R==null?void 0:R.primaryKey)??""])==null?void 0:ne.value)===H[(R==null?void 0:R.primaryKey)??""]?Rs(H,R):ie})))},[G,me,R,z,j]),k=i.useCallback(async H=>{await M(j.deleteConfirm)&&await Q(H)&&(G(j.deleteSuccess,"success"),S(se=>se&&se.filter(ie=>{var ne;return((ne=ie[(R==null?void 0:R.primaryKey)??""])==null?void 0:ne.value)!==H})))},[G,Q,j,M,R]),T=i.useCallback(async H=>{if(!R)return!1;const se=await xe(R.masterReference?{...H,[R.masterReferenceColumn??""]:z}:H);if(se!==null){G(j.createSuccess,"success");const ie=Rs(H,R);return ie[(R==null?void 0:R.primaryKey)??""]={value:se,defaultValue:se},S(ne=>[...ne??[],ie]),!0}return!1},[G,xe,j,R,z]),O=H=>{H>P?n(P):H<1&&n(1),n(H)},J=i.useCallback(()=>{if(!D||!R){F(null);return}const H=D.filter(se=>Object.entries(r).every(([ie,ne])=>{var Ke,Ye,qe;if(ne===null)return!0;const le=(Ke=se[ie])==null?void 0:Ke.value;if(le==null)return!1;const ue=(Ye=R.columns)==null?void 0:Ye.find(it=>it.field===ie),Ue=ue==null?void 0:ue.type,Ge=(ue==null?void 0:ue.values)&&((qe=ue==null?void 0:ue.values)==null?void 0:qe.length)>0;if(!Ue)return!1;switch(Ue){case"STR":return Ge?le===ne:le.toString().toLowerCase().includes(ne.toLowerCase());case"NUM":return Ge?Number(le)===Number(ne):le.toString().toLowerCase().includes(ne.toLowerCase());case"DT":return le.toString().toLowerCase().includes(ne.toLowerCase());case"BIT":return Number(le)===Number(ne);default:return le.toString().toLowerCase().includes(ne.toLowerCase())}}));F(H)},[D,r,R]),ce=i.useCallback(()=>{if(!I||!R){A([]);return}if(!a){A(I);return}A([...I].sort((H,se)=>{var Ue,Ge,Ke,Ye,qe,it;const ie=((Ge=(Ue=H[a])==null?void 0:Ue.value)==null?void 0:Ge.toString())??"",ne=((Ye=(Ke=se[a])==null?void 0:Ke.value)==null?void 0:Ye.toString())??"",le=R.columns.find(we=>we.field===a),ue=le==null?void 0:le.type;if(!le||!ue||!ie&&!ne)return 0;if(!ie)return 1;if(!ne)return-1;if(le.values&&le.values.length>0){const we=((qe=le.values.find(ht=>{var Qe;return((Qe=ht.id)==null?void 0:Qe.toString())===ie}))==null?void 0:qe.name)??"",Ie=((it=le.values.find(ht=>{var Qe;return((Qe=ht.id)==null?void 0:Qe.toString())===ne}))==null?void 0:it.name)??"";return l==="asc"?we.localeCompare(Ie):Ie.localeCompare(we)}if(ue==="NUM"){const we=Number(ie),Ie=Number(ne);return l==="asc"?we-Ie:Ie-we}if(ue==="DT"){const we=e.parseISO(ie==null?void 0:ie.toString()).getTime(),Ie=e.parseISO(ne==null?void 0:ne.toString()).getTime();return l==="asc"?we-Ie:Ie-we}return l==="asc"?ie.toString().localeCompare(ne.toString()):ne.toString().localeCompare(ie.toString())}))},[I,R,a,l]);return i.useEffect(()=>{Ne()},[Ne]),i.useEffect(()=>{Ee()},[Ee]),i.useEffect(()=>{J()},[J]),i.useEffect(()=>{ce()},[ce]),i.useEffect(()=>{Y?s||n(1):L&&n(null)},[L,Y,s,n]),i.useEffect(()=>{!Y||!s||(s>P&&n(P),s<1&&n(1))},[s,Y,P,n]),e.jsxRuntimeExports.jsxs("div",{className:"h-100 w-100 d-flex flex-column",children:[e.jsxRuntimeExports.jsxs("div",{className:"mb-3 d-flex justify-content-between align-items-center",children:[e.jsxRuntimeExports.jsx(e.Typography,{variant:"h3",children:(R==null?void 0:R.name)??""}),e.jsxRuntimeExports.jsxs(e.Dropdown,{toggle:e.jsxRuntimeExports.jsx(e.DropdownToggle,{as:e.SimpleDropdownToggle}),children:[e.jsxRuntimeExports.jsx(e.DropdownItem,{onClick:()=>U(!C),children:C?j.hideArchived:j.showArchived}),e.jsxRuntimeExports.jsx(Vt,{}),e.jsxRuntimeExports.jsx(e.DropdownItem,{onClick:_e,icon:e.jsxRuntimeExports.jsx(f,{icon:"file-download"}),children:j.downloadExport})]})]}),(R==null?void 0:R.description)&&e.jsxRuntimeExports.jsx(e.Typography,{variant:"body2",className:"mb-3",children:R==null?void 0:R.description}),(R==null?void 0:R.masterReference)&&e.jsxRuntimeExports.jsx("div",{className:"mb-3 d-flex",children:e.jsxRuntimeExports.jsx($i,{label:((te=(ee=R.columns)==null?void 0:ee.find(H=>H.field===R.masterReferenceColumn))==null?void 0:te.caption)??"",options:((Re=(fe=R.columns)==null?void 0:fe.find(H=>H.field===R.masterReferenceColumn))==null?void 0:Re.values)??[],master:z,onChange:H=>ae(H)})}),(R==null?void 0:R.slaves)&&R.slaves.length>0&&e.jsxRuntimeExports.jsx("div",{className:"mb-3 d-flex align-items-center flex-start gap-1",children:R.slaves.map(H=>{var se;return e.jsxRuntimeExports.jsx(e.ContextButton,{as:"link",href:`${oe.generatePath(u,{id:(se=H.id)==null?void 0:se.toString()})}?type=dynamic-form`,children:H.name},H.id)})}),R!=null&&R.masterReference&&!z?e.jsxRuntimeExports.jsx(at,{variant:"warning",children:j.selectMaster(((Pe=(ve=R.columns)==null?void 0:ve.find(H=>H.field===R.masterReferenceColumn))==null?void 0:Pe.caption)??"").toLowerCase()}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[R&&w.length>0&&e.jsxRuntimeExports.jsx("div",{className:"mb-2",children:e.jsxRuntimeExports.jsx(mi,{errors:w,schema:R})}),R&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("rounded border overflow-auto",vs.tableContainer),children:e.jsxRuntimeExports.jsx(Fi,{schema:R,items:!Y&&L&&(L==null?void 0:L.length)>K?[]:(Y?B:L)??[],onEditItem:be,onDeleteItem:k,onCreateItem:T,filters:r,setFilter:o,sortByField:a,sortByType:l,setSortBy:c,selectedMaster:(z==null?void 0:z.toString())??null,customPickers:g})}),Y&&s&&e.jsxRuntimeExports.jsxs("div",{className:e.classNames(vs.pagination,"d-flex align-items-center gap-3 p-1 border-bottom border-start border-end rounded"),children:[e.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center gap-1",children:[e.jsxRuntimeExports.jsx(e.IconButton,{color:"primary",onClick:()=>O(1),disabled:!W,children:e.jsxRuntimeExports.jsx(f,{icon:"chevron-double-left"})}),e.jsxRuntimeExports.jsx(e.IconButton,{color:"primary",onClick:()=>O(s-1),disabled:!W,children:e.jsxRuntimeExports.jsx(f,{icon:"chevron-left"})}),e.jsxRuntimeExports.jsx(e.IconButton,{color:"primary",onClick:()=>O(s+1),disabled:!Z,children:e.jsxRuntimeExports.jsx(f,{icon:"chevron-right"})}),e.jsxRuntimeExports.jsx(e.IconButton,{color:"primary",onClick:()=>O(P),disabled:!Z,children:e.jsxRuntimeExports.jsx(f,{icon:"chevron-double-right"})})]}),e.jsxRuntimeExports.jsxs(e.Typography,{variant:"body",children:[j.tablePage," ",s," ",j.tablePageFrom," ",P]})]})]})]})]})},bs={appDetail:"/settings/:id"},ws={apiDynamicFormsGet:"/dynamicForms"},Oi=({item:t,children:s})=>t.description?e.jsxRuntimeExports.jsx(e.SimpleTooltip,{placement:"left",text:t.description??"",children:e.jsxRuntimeExports.jsx("div",{children:s})}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:s}),Ai=({activeId:t,otherForms:s=[],groupsDefs:n=[],searchQuery:r,fullSize:o,appUrls:{appDetail:a=bs.appDetail}=bs,apiUrls:{apiDynamicFormsGet:l=ws.apiDynamicFormsGet}=ws})=>{const c=e.useAxios(),{startLoading:u,stopLoading:d}=i.useContext(e.LoadingContext),[x,p]=i.useState(null),[E]=Ae.useSearchQueryState("search",""),m=i.useMemo(()=>[...(x==null?void 0:x.map(j=>({...j,type:"dynamic-form"})))??[],...s].filter(j=>pe.stringSearchWithin(j.name,r)||pe.stringSearchWithin(j.description,r)).sort((j,f)=>(j.name??"").localeCompare(f.name??""))??[],[x,s,r]),h=i.useMemo(()=>n.map(j=>({id:j.id,name:j.name??"",items:m.filter(f=>f.group===j.id)})).filter(j=>j.items.length>0),[n,m]),g=i.useCallback(async()=>{u("dynamicForms"),await c.get(l).then(({data:j})=>{p(j),d("dynamicForms")}).catch(()=>d("dynamicForms"))},[c,u,d,l]);return i.useEffect(()=>{!x&&g()},[g,x]),m.length>0?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx("div",{className:"w-auto list-group forms-items overflow-x-hidden",children:h.map(j=>e.jsxRuntimeExports.jsx(et,{title:j.name,defaultOpen:!0,children:j.items.map(f=>{var b,y,v,R;return o?e.jsxRuntimeExports.jsxs(oe.Link,{to:`${oe.generatePath(a,{id:(b=f.id)==null?void 0:b.toString()})}?type=${f.type}&search=${E??""}`,className:`text-nowrap list-group-item list-group-item-action ${(t==null?void 0:t.toString())===((y=f.id)==null?void 0:y.toString())?"active":""}`,children:[e.jsxRuntimeExports.jsx(e.Typography,{variant:"body",children:f.name}),f.description&&e.jsxRuntimeExports.jsx(e.Typography,{variant:"body2",className:"text-muted mt-2",children:f.description})]},f.id):e.jsxRuntimeExports.jsx(Oi,{item:f,children:e.jsxRuntimeExports.jsx(oe.Link,{to:`${oe.generatePath(a,{id:(v=f.id)==null?void 0:v.toString()})}?type=${f.type}&search=${E??""}`,className:`text-nowrap list-group-item list-group-item-action ${(t==null?void 0:t.toString())===((R=f.id)==null?void 0:R.toString())?"active":""}`,children:e.jsxRuntimeExports.jsx(e.Typography,{variant:"body2",children:f.name})})},f.id)})},j.id))})}):null},Pi=({label:t,to:s,value:n})=>e.jsxRuntimeExports.jsxs(e.RowLabelInput,{label:t,children:[e.jsxRuntimeExports.jsx("input",{disabled:!0,className:"form-control d-none"}),s?e.jsxRuntimeExports.jsx(oe.Link,{to:s,className:"border-bottom luminus-dropdown-picker-link form-control d-flex justify-content-end align-items-center",children:n}):e.jsxRuntimeExports.jsx("div",{className:"luminus-dropdown-picker-link form-control d-flex justify-content-end align-items-center",children:n})]}),Vi=()=>{const{localizationContext:t}=i.useContext(e.LuminusComponentsContext),{language:s,setLanguage:n}=i.useContext(t),r=o=>{n(o)};return e.jsxRuntimeExports.jsx(e.DropdownItem,{onClick:o=>{r(s==="cz"?"en":s==="en"?"de":"cz"),o.stopPropagation()},children:s==="cz"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("strong",{children:"CZ"}),e.jsxRuntimeExports.jsx(e.MdArrowRight,{}),e.jsxRuntimeExports.jsx("span",{children:"EN"}),e.jsxRuntimeExports.jsx(e.MdArrowRight,{}),e.jsxRuntimeExports.jsx("span",{children:"DE"})]}):s==="en"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("strong",{children:"EN"}),e.jsxRuntimeExports.jsx(e.MdArrowRight,{}),e.jsxRuntimeExports.jsx("span",{children:"DE"}),e.jsxRuntimeExports.jsx(e.MdArrowRight,{}),e.jsxRuntimeExports.jsx("span",{children:"CZ"})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("strong",{children:"DE"}),e.jsxRuntimeExports.jsx(e.MdArrowRight,{}),e.jsxRuntimeExports.jsx("span",{children:"CZ"}),e.jsxRuntimeExports.jsx(e.MdArrowRight,{}),e.jsxRuntimeExports.jsx("span",{children:"EN"})]})})},zi=({controlId:t,...s})=>e.jsxRuntimeExports.jsx(e.Form.Group,{controlId:t,...s}),Wi=({employeeId:t,alt:s,noPhotoImage:n,cafmApiUrl:r,showLargeInLightBox:o=!1})=>{const{user:a}=i.useContext(e.UserContext),{photoPath:l,photoPathSm:c}=Ae.useEmployeePhotoPath(t);return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:t&&e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:o?e.jsxRuntimeExports.jsx(gn,{baseUrl:r,customToken:a.cafmToken??void 0,photos:[{id:t.toString(),alt:s??"",isDefault:!0,smSrc:c,lgSrc:l}],placeholder:n,ImgComponent:Ft}):e.jsxRuntimeExports.jsx(Ft,{baseUrl:r,customToken:a.cafmToken??void 0,src:c,alt:s,placeholder:n,className:"rounded w-100"})})})},Hi=({text:t,setText:s,onSearchButtonClick:n,className:r})=>{const o=a=>{s(a)};return e.jsxRuntimeExports.jsxs(ut,{className:`${r}`,children:[e.jsxRuntimeExports.jsx(e.Form.Control,{value:t,onChange:a=>s(a.target.value)}),t&&e.jsxRuntimeExports.jsx(e.Button$1,{onClick:()=>o(""),variant:"link",className:"border text-muted",children:e.jsxRuntimeExports.jsx(e.MdClear,{})}),e.jsxRuntimeExports.jsx(e.Button$1,{onClick:()=>n&&n(t),variant:"link",className:"border",children:e.jsxRuntimeExports.jsx(e.MdSearch,{})})]})},Ui=({value:t,numberPrefix:s,numberSuffix:n,decimalScale:r=2,fixedDecimalScale:o=!1,className:a})=>e.jsxRuntimeExports.jsx(Gt,{value:t,displayType:"text",thousandSeparator:" ",decimalScale:r,fixedDecimalScale:o,defaultValue:"",prefix:s,suffix:n,className:a,decimalSeparator:","}),Gi=({data:t,keys:s,colors:n,tooltipLabel:r})=>e.jsxRuntimeExports.jsx(e.Re,{data:t.map(o=>({name:o.name,...o.values})),indexBy:"name",keys:s,margin:{top:20,right:50,bottom:30,left:150},layout:"horizontal",colors:n,padding:.2,borderRadius:2,borderWidth:2,borderColor:{from:"color",modifiers:[["darker",.5]]},axisTop:null,axisRight:null,axisBottom:{tickSize:5,tickPadding:5,tickRotation:0},axisLeft:{tickSize:5,tickPadding:5,tickRotation:0},labelSkipWidth:12,labelSkipHeight:12,labelTextColor:{from:"color",modifiers:[["darker",1.6]]},tooltipLabel:r}),Ki="_hrText_xxish_1",Yi={hrText:Ki},Ln=({text:t})=>e.jsxRuntimeExports.jsx("hr",{className:e.classNames(Yi.hrText),"data-content":t}),qi="_cards-group_1gvpy_1",Qi="_group-title_1gvpy_1",Zi="_group-content_1gvpy_8",Xi="_report-card_1gvpy_12",Ji="_card-title-link_1gvpy_22",Ve={"cards-group":"_cards-group_1gvpy_1",cardsGroup:qi,"group-title":"_group-title_1gvpy_1",groupTitle:Qi,"group-content":"_group-content_1gvpy_8",groupContent:Zi,"report-card":"_report-card_1gvpy_12",reportCard:Xi,"card-title-link":"_card-title-link_1gvpy_22",cardTitleLink:Ji},el=({reportsLastUsedGet:t,getReportRoute:s,getReportName:n})=>{const{texts:{reports:r}}=i.useContext(e.LuminusComponentsContext),{data:o}=Je.useGetApiData(t);return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(et,{defaultOpen:!0,title:r.index.lastUsedReports,children:e.jsxRuntimeExports.jsx(tn,{children:o&&o.map(a=>a.versions.map(l=>e.jsxRuntimeExports.jsxs(rt,{as:oe.Link,to:s(a,l.id),className:"p-1 px-2",action:!0,children:[e.jsxRuntimeExports.jsx(e.Typography,{variant:"body2",className:"text-uppercase",children:n(a)}),e.jsxRuntimeExports.jsxs(e.Typography,{variant:"caption",className:"d-flex justify-content-between align-items-center gap-3 text-dark",children:[l.name,e.jsxRuntimeExports.jsx(e.Typography,{variant:"caption",className:"text-end opacity-50",children:e.formatDate(l.lastUsedDate)})]})]})))})})})},Ct={reportsGet:"/reports",reportsLastUsedGet:"/reports/last-used"},tl=({groups:t,apiUrls:{reportsGet:s=Ct.reportsGet,reportsLastUsedGet:n=Ct.reportsLastUsedGet}=Ct,getReportName:r,getReportDescription:o,getGroupTitle:a,getReportRoute:l})=>{const{texts:{reports:c}}=i.useContext(e.LuminusComponentsContext),[u,d]=i.useState(""),[x]=pt(u,500),p=i.useCallback(j=>j.map(f=>({...f,groupId:!f.groupId||f.groupId===0||!t.some(b=>b===f.groupId)?999:f.groupId})),[t]),{data:E}=Je.useGetApiData(s,{dataTransformer:p}),m=i.useMemo(()=>{if(E===null)return{};const j={};return t.forEach(f=>{j[f]=E.filter(b=>b.groupId===f&&(pe.stringSearchWithin(r(b),x)||pe.stringSearchWithin(o(b),x)||b.versions.some(y=>pe.stringSearchWithin(y.name,x))))}),j},[x,t,E,o,r]),h=i.useMemo(()=>t.filter(j=>{var f;return((f=m[j])==null?void 0:f.length)>0}),[m,t]),{isMobile:g}=He.useWindowSize();return e.jsxRuntimeExports.jsxs(e.PageContainer,{variant:"fullScreen",sideContent:e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(el,{reportsLastUsedGet:n,getReportName:r,getReportRoute:l})}),children:[e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(e.Form.Control,{className:"mb-3",type:"search",value:u,onChange:j=>{var f;return d(((f=j.target)==null?void 0:f.value)??"")},placeholder:c.index.search})}),e.jsxRuntimeExports.jsx("div",{className:"overflow-x-hidden luminus-thin-scrollbar luminus-reports-index",children:h.map(j=>e.jsxRuntimeExports.jsxs("div",{className:e.classNames(Ve.cardsGroup,{[Ve.mobile]:g}),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("group-title",Ve.groupTitle),children:e.jsxRuntimeExports.jsx(Ln,{text:a(j)})}),e.jsxRuntimeExports.jsx("div",{className:e.classNames(Ve.groupContent),children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("row gx-3 gy-3"),children:m[j].map(f=>e.jsxRuntimeExports.jsx("div",{className:"col-12 col-lg-4",children:e.jsxRuntimeExports.jsxs(zt,{title:e.jsxRuntimeExports.jsx(oe.Link,{to:l(f),className:e.classNames(Ve.cardTitleLink,"w-100 text-uppercase fw-normal"),children:r(f)}),headerClassName:"bg-darker",className:e.classNames(Ve.reportCard,"shadow h-100 d-flex flex-column"),contentClassName:"d-flex flex-column gap-2 h-100",children:[e.jsxRuntimeExports.jsx(e.Typography,{variant:"body2",className:"px-2",children:o(f)}),e.jsxRuntimeExports.jsx("div",{className:"h-100 d-flex flex-column justify-content-center",children:f.versions&&f.versions.length>0?e.jsxRuntimeExports.jsx("div",{className:"list-group",children:f.versions.map(b=>e.jsxRuntimeExports.jsx(rt,{as:oe.Link,to:l(f,b.id),className:"p-1 px-2",action:!0,children:e.jsxRuntimeExports.jsxs(e.Typography,{variant:"body2",className:"d-flex justify-content-between align-items-center gap-3",children:[e.jsxRuntimeExports.jsx("div",{className:"link",children:b.name}),e.jsxRuntimeExports.jsx(e.Typography,{variant:"caption",className:"text-end opacity-50",children:e.formatDate(b.lastUsedDate)})]})}))}):null})]})},f.id))})})]},j))})]})},sl="_mini-detail-popover_obryf_1",nl="_sm_obryf_5",rl="_lg_obryf_9",Cs={"mini-detail-popover":"_mini-detail-popover_obryf_1",miniDetailPopover:sl,sm:nl,lg:rl},ol=({children:t,useMiniDetail:s,miniDetailProps:n,placement:r="bottom",trigger:o=["hover"],delayMs:a=500})=>{const[l,c]=i.useState(!1),{isLoading:u,detail:d,heading:x,tooltipWidth:p}=s({...n,enabled:l}),E=i.useRef(null);return e.jsxRuntimeExports.jsx("div",{onMouseEnter:()=>{E.current=window.setTimeout(()=>c(!0),a)},onMouseLeave:()=>{E.current&&clearTimeout(E.current),c(!1)},children:l?e.jsxRuntimeExports.jsx(e.HtmlTooltip,{heading:u?e.jsxRuntimeExports.jsx(e.Typography,{variant:"body2",className:"placeholder-glow",children:e.jsxRuntimeExports.jsx("span",{className:"placeholder bg-primary col-6"})}):x,content:e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:u?e.jsxRuntimeExports.jsxs(e.Typography,{variant:"body2",className:"placeholder-glow",children:[e.jsxRuntimeExports.jsxs("div",{className:"d-flex justify-content-between py-1",children:[e.jsxRuntimeExports.jsx("span",{className:"placeholder col-5"}),e.jsxRuntimeExports.jsx("span",{className:"placeholder col-4"})]}),e.jsxRuntimeExports.jsxs("div",{className:"d-flex justify-content-between py-1",children:[e.jsxRuntimeExports.jsx("span",{className:"placeholder col-3"}),e.jsxRuntimeExports.jsx("span",{className:"placeholder col-2"})]}),e.jsxRuntimeExports.jsxs("div",{className:"d-flex justify-content-between py-1",children:[e.jsxRuntimeExports.jsx("span",{className:"placeholder col-4"}),e.jsxRuntimeExports.jsx("span",{className:"placeholder col-6"})]}),e.jsxRuntimeExports.jsxs("div",{className:"d-flex justify-content-between py-1",children:[e.jsxRuntimeExports.jsx("span",{className:"placeholder col-4"}),e.jsxRuntimeExports.jsx("span",{className:"placeholder col-3"})]}),e.jsxRuntimeExports.jsxs("div",{className:"d-flex justify-content-between py-1",children:[e.jsxRuntimeExports.jsx("span",{className:"placeholder col-5"}),e.jsxRuntimeExports.jsx("span",{className:"placeholder col-4"})]})]}):d}),placement:r,trigger:o,popoverClassName:e.classNames(Cs.miniDetailPopover,Cs[p]),children:e.jsxRuntimeExports.jsx("div",{children:t})}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:t})})},al=({label:t,value:s})=>e.jsxRuntimeExports.jsxs("div",{className:"py-1 border-bottom d-flex gap-3 align-items-center justify-content-between",children:[e.jsxRuntimeExports.jsx(e.Typography,{variant:"caption",children:t}),e.jsxRuntimeExports.jsx(e.Typography,{variant:"body2",className:"text-end",children:s??"-"})]}),il=({InputContainer:t=e.RowLabelInput,formField:s,label:n,resetsFields:r,type:o,required:a,hidden:l,disabled:c,withoutLabel:u,hint:d,onChange:x,className:p})=>{const{register:E,formState:m,setValue:h}=ye.useFormContext(),[g,j]=i.useState(void 0),[f,b]=i.useState(!1);i.useEffect(()=>{const v=s.split(".");let R=m.errors;v.forEach(_=>{R!==void 0&&(R=R[_])}),j(R)},[m,s]),i.useEffect(()=>{m.isSubmitted&&b(!0)},[m]);const y=g!==void 0;return e.jsxRuntimeExports.jsxs(t,{isForCheckInput:!0,hidden:l,label:`${n}${a?" *":""}`,isInvalid:y,withoutLabel:u,hint:d,className:p,children:[e.jsxRuntimeExports.jsx(e.Form.Check,{id:`check-${s}`,type:o??"checkbox",label:`${n}${a?" *":""}`,...E(s,{onChange:v=>{r&&r.forEach(R=>h(R,null,{shouldDirty:!0,shouldValidate:f})),x&&x(v.target.value??null)}}),isInvalid:y,hidden:l,disabled:c||m.disabled,className:"w-100"}),g&&e.jsxRuntimeExports.jsx(e.InvalidFeedback,{message:g.message})]})},ll=({InputContainer:t=e.RowLabelInput,label:s,formField:n,options:r,resetsFields:o,required:a,disabled:l,hidden:c,onChange:u,className:d})=>{const{register:x,formState:p,setValue:E,watch:m}=ye.useFormContext(),[h,g]=i.useState(void 0),[j,f]=i.useState(!1),b=i.useMemo(()=>r,[r]);i.useEffect(()=>{const v=n.split(".");let R=p.errors;v.forEach(_=>{R!==void 0&&(R=R[_])}),g(R)},[p,n]),i.useEffect(()=>{p.isSubmitted&&f(!0)},[p]);const y=h!==void 0;return e.jsxRuntimeExports.jsxs(t,{isForRadioInput:!0,hidden:c,withoutLabel:!s,label:`${s}${a?" *":""}`,isInvalid:y,className:d,children:[b.map(v=>e.jsxRuntimeExports.jsx(e.Form.Check,{id:`radio-${v.id}`,label:v.name,type:"radio",value:v.id??"",checked:m(n)===v.id,...x(n,{onChange:R=>{var _;o&&o.forEach(D=>E(D,null,{shouldDirty:!0,shouldValidate:j})),u&&u((_=R.target)!=null&&_.value?R.target.value.toString():null)}}),isInvalid:y,hidden:c,disabled:l||p.disabled,className:"w-100"},v.id)),h&&e.jsxRuntimeExports.jsx(e.InvalidFeedback,{message:h.message})]})},cl=({InputContainer:t=e.RowLabelInput,formField:s,label:n,size:r,defaultSelection:o,resetsFields:a,isNumber:l,required:c,hidden:u,disabled:d,items:x,onSearchQueryChange:p,selectedItemNavigateTo:E,texts:m,dropdownItemsNameWidth:h,isLoading:g,withoutLabel:j,additionalColumns:f,CustomOnChangeComponent:b,icon:y,displayIdAsName:v,onSelect:R,className:_,archiveColumn:D,hint:S,addNewOptionPath:I,refreshOptions:F,MiniDetailComponent:L})=>{const{formState:A,setValue:C,watch:U,control:G}=ye.useFormContext(),[w,N]=i.useState(void 0),[M,V]=i.useState(!1),[K,P]=i.useState(!1),W=U(s)??null,Z=W===(o==null?void 0:o.id)?o==null?void 0:o.name:U(`${s}-DropdownName`),q=i.useMemo(()=>W==null?null:{id:W??null,name:Z??""},[W,Z]),$=i.useCallback(()=>{const Q=s.split(".");let xe=A.errors;Q.forEach(be=>{xe!==void 0&&(xe=xe[be])}),N(xe)},[A,s]),Y=i.useCallback(Q=>{if((Q==null?void 0:Q.id)===W)return;if(R&&R(Q),a&&a.forEach(be=>C(be,null,{shouldDirty:!0,shouldValidate:K})),Q===null){C(s,null,{shouldDirty:!0,shouldValidate:K}),C(`${s}-DropdownName`,null);return}let xe=null;l?xe=(Q==null?void 0:Q.id)!==null&&(Q==null?void 0:Q.id)!==""?parseInt(Q.id.toString(),10):null:xe=Q.id===null||Q.id===void 0||Q.id===""?null:Q.id,C(s,xe,{shouldDirty:!0,shouldValidate:K}),C(`${s}-DropdownName`,Q.name??"")},[C,s,K,l,a,W,R]),B=i.useCallback(Q=>{V(!1),Y(Q)},[Y]),z=i.useCallback(()=>{V(!1)},[]);i.useEffect(()=>{$()},[$]),i.useEffect(()=>{A.isSubmitted&&P(!0)},[A]);const ae=i.useRef(null),Ne=w!==void 0,Ee=E!==void 0,_e=Ee&&q!==null,me=d||A.disabled;return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(t,{label:`${n}${c?" *":""}`,hidden:u,withoutLabel:j,isInvalid:Ne,inputContainerClassName:e.classNames({"luminus-dropdown-select-open":M}),hint:S,className:_,children:[e.jsxRuntimeExports.jsxs(vn,{currentSelection:q,selectedItemNavigateTo:E,children:[v&&(q==null?void 0:q.name)&&e.jsxRuntimeExports.jsx(e.Typography,{variant:"caption",className:"d-flex justify-content-end mt-2 luminus-dropdown-selection-name",children:q.name}),e.jsxRuntimeExports.jsx(ye.Controller,{control:G,name:s,render:()=>e.jsxRuntimeExports.jsx(ft,{value:W,MiniDetailComponent:L,children:e.jsxRuntimeExports.jsx(e.Form.Select,{size:r,onMouseDown:Q=>{Q.currentTarget.focus(),Q.preventDefault()},onClick:()=>{!Ee&&!me&&V(!0)},ref:ae,value:W??"",onChange:()=>{},isInvalid:Ne,hidden:u,className:e.classNames("w-100",{"luminus-dropdown-picker-disabled":me,"luminus-dropdown-picker-link":_e}),children:e.jsxRuntimeExports.jsx("option",{value:W,children:v?W:(Z==null?void 0:Z.length)>0?Z:W})})})}),b||!me&&Ee?e.jsxRuntimeExports.jsxs("div",{className:"custom-picker-button",children:[!b&&!me&&Ee&&e.jsxRuntimeExports.jsx(e.IconButton,{size:"sm",color:"secondary",onClick:Q=>{Q.preventDefault(),Q.stopPropagation(),V(!0)},children:y??e.jsxRuntimeExports.jsx(e.MdOutlineEdit,{})}),b??null]}):null]}),w&&e.jsxRuntimeExports.jsx(e.InvalidFeedback,{message:w.message}),ae.current&&e.jsxRuntimeExports.jsx(ot,{show:M,onCancel:z,items:x,currentSelection:q,onSelectionChange:B,onSearchQueryChange:p,texts:m,itemsNameWidth:h,additionalColumns:f,displayIdAsName:v,isLoading:g,disabled:me,inputRef:ae,archiveColumn:D,addNewOptionPath:I,refreshOptions:F})]})})},ul=({InputContainer:t=e.RowLabelInput,label:s,formField:n,hidden:r,required:o,placeholder:a,disabled:l,showClearIcon:c,resetsFields:u,multiple:d,accept:x,withoutLabel:p,hint:E,className:m})=>{const{watch:h,setValue:g,register:j,formState:f}=ye.useFormContext(),[b,y]=i.useState(!1),[v,R]=i.useState(void 0),_=i.useCallback(()=>{g(n,"")},[g,n]),D=i.useCallback(()=>{const I=n.split(".");let F=f.errors;I.forEach(L=>{F!==void 0&&(F=F[L])}),R(F)},[f,n]);i.useEffect(D,[D]),i.useEffect(()=>{f.isSubmitted&&y(!0)},[f]);const S=v!==void 0;return e.jsxRuntimeExports.jsxs(t,{label:`${s}${o?"*":""}`,hidden:r,withoutLabel:p,isInvalid:S,hint:E,className:m,children:[e.jsxRuntimeExports.jsx(e.FormControl,{type:"file",multiple:d,accept:x.join(", "),placeholder:a??s,isInvalid:S,hidden:r,disabled:l||f.disabled,className:"w-100",...j(n,{onChange:()=>{u&&u.forEach(I=>g(I,null,{shouldDirty:!0,shouldValidate:b}))}})}),c&&h(n)&&e.jsxRuntimeExports.jsx("div",{className:"luminus-input-remove-icon",children:e.jsxRuntimeExports.jsx(e.IconButton,{color:"secondary",size:"sm",onClick:_,children:e.jsxRuntimeExports.jsx(e.MdClear,{})})}),v&&e.jsxRuntimeExports.jsx(e.InvalidFeedback,{message:v.message})]})},dl=({children:t,onStorno:s,noSpacer:n})=>{const{formState:r}=ye.useFormContext(),[o,a]=i.useState(!1);return i.useEffect(()=>{a(Object.keys(r.dirtyFields).length>0)},[r]),o?e.jsxRuntimeExports.jsx(dn,{onStorno:s,noSpacer:n,disabled:r.disabled,children:t}):null},xl=({InputContainer:t=e.RowLabelInput,options:s,formField:n,label:r,size:o,resetsFields:a,isNumber:l,required:c,hidden:u,disabled:d,withoutLabel:x,noSortOptions:p,suffixIdToName:E,onSelect:m,className:h,appendCurrentSelectionWithName:g,hint:j,addNewOptionPath:f,refreshOptions:b,MiniDetailComponent:y})=>{const{texts:{customSelect:v}}=i.useContext(e.LuminusComponentsContext),{formState:R,setValue:_,watch:D,control:S}=ye.useFormContext(),[I,F]=i.useState(void 0),[L,A]=i.useState(!1),[C,U]=i.useState(!1),[G,w]=i.useState(""),N=D(n),M=i.useMemo(()=>s.find(B=>B.id===N)??null,[s,N]),V=i.useCallback(()=>{const B=n.split(".");let z=R.errors;B.forEach(ae=>{z!==void 0&&(z=z[ae])}),F(z)},[R,n]),K=i.useCallback(B=>{if((B==null?void 0:B.id)===N)return;if(m&&m(B),a&&a.forEach(ae=>_(ae,null,{shouldDirty:!0,shouldValidate:C})),B===null){_(n,null,{shouldDirty:!0,shouldValidate:C});return}let z=null;l?z=(B==null?void 0:B.id)!==null&&(B==null?void 0:B.id)!==""?parseInt(B.id.toString(),10):null:z=B.id===null||B.id===void 0||B.id===""?null:B.id,_(n,z,{shouldDirty:!0,shouldValidate:C})},[_,n,l,a,N,C,m]),P=i.useCallback(B=>{A(!1),K(B)},[K]),W=i.useCallback(B=>{w(B)},[]);i.useEffect(()=>{V()},[V]),i.useEffect(()=>{R.isSubmitted&&U(!0)},[R]);const Z=i.useCallback(B=>{var z;return B===null?"":!B.name||B.name.length===0?((z=B.id)==null?void 0:z.toString())??"":E?`${B.name} (${B.id})`:B.name},[E]),q=i.useMemo(()=>{const B=s??[];return g!==void 0&&N&&(B.some(z=>z.id===N)||B.push({id:N,name:g})),B.map(z=>({id:z.id,name:Z(z)})).filter(z=>pe.stringSearchWithin(z.name,G)).sort((z,ae)=>p?0:(z.name??"").localeCompare(ae.name??""))},[s,p,G,Z,g,N]),$=i.useRef(null),Y=I!==void 0;return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(t,{label:`${r}${c?" *":""}`,hidden:u,withoutLabel:x,isInvalid:Y,inputContainerClassName:e.classNames({"luminus-dropdown-select-open":L}),hint:j,className:h,children:[e.jsxRuntimeExports.jsx(ye.Controller,{control:S,name:n,render:()=>e.jsxRuntimeExports.jsx(ft,{value:N,MiniDetailComponent:y,children:e.jsxRuntimeExports.jsx(e.Form.Select,{size:o,onMouseDown:B=>{B.currentTarget.focus(),B.preventDefault()},onClick:()=>{A(!0)},ref:$,value:N??"",onChange:()=>{},isInvalid:Y,hidden:u,disabled:d,className:"w-100",children:e.jsxRuntimeExports.jsx("option",{value:(M==null?void 0:M.id)??"",children:Z(M)})})})}),I&&e.jsxRuntimeExports.jsx(e.InvalidFeedback,{message:I.message}),$.current&&e.jsxRuntimeExports.jsx(ot,{show:L,onCancel:()=>A(!1),items:q,currentSelection:M??null,onSelectionChange:P,onSearchQueryChange:W,texts:v,disabled:d,inputRef:$,autoHideSearch:!0,allItemsLength:s.length,addNewOptionPath:f,refreshOptions:b})]})})},ml=({InputContainer:t=e.RowLabelInput,formField:s,label:n,placeholder:r,size:o,resetsFields:a,showClearIcon:l,clearValue:c,required:u,hidden:d,disabled:x,withoutLabel:p,step:E,stepperStep:m=1,className:h,min:g,max:j,onChange:f,hint:b})=>{const{register:y,formState:v,setValue:R,watch:_}=ye.useFormContext(),[D,S]=i.useState(void 0),[I,F]=i.useState(!1),L=i.useCallback((w,N,M)=>{R(w,pe.limitNumber(N,g,j),M)},[j,g,R]),A=i.useCallback(()=>{const w=c??null;L(s,w!==null?Number(w):null,{shouldDirty:!0,shouldValidate:I})},[c,L,s,I]),C=i.useCallback(()=>{const w=s.split(".");let N=v.errors;w.forEach(M=>{N!==void 0&&(N=N[M])}),S(N)},[v,s]);i.useEffect(()=>{C()},[C]),i.useEffect(()=>{v.isSubmitted&&F(!0)},[v]);const U=D!==void 0,G=_(s);return e.jsxRuntimeExports.jsxs(t,{label:`${n}${u?" *":""}`,hidden:d,withoutLabel:p,isInvalid:U,hint:b,className:h,children:[e.jsxRuntimeExports.jsxs("div",{className:"luminus-input-container position-relative w-100",children:[e.jsxRuntimeExports.jsx(e.Form.Control,{type:"number",placeholder:r??n,size:o,...y(s,{setValueAs:w=>w==null||w===""?null:pe.limitNumber(Number(w),g,j),min:g,max:j,onChange:w=>{var N;a&&a.forEach(M=>R(M,null,{shouldDirty:!0,shouldValidate:I})),f&&f((N=w.target)!=null&&N.value?Number(w.target.value)??null:null)}}),isInvalid:U,hidden:d,disabled:x||v.disabled,className:"w-100 luminus-numeric-stepper",step:E,min:g,max:j}),e.jsxRuntimeExports.jsx("div",{className:"stepper-icon left",children:!x&&e.jsxRuntimeExports.jsx(e.IconButton,{size:"sm",onClick:w=>{w.preventDefault(),w.stopPropagation(),L(s,((G?Number(G):0)-m).toString(),{shouldDirty:!0,shouldValidate:I})},children:e.jsxRuntimeExports.jsx(e.FaMinus,{})})}),e.jsxRuntimeExports.jsx("div",{className:"stepper-icon right",children:!x&&e.jsxRuntimeExports.jsx(e.IconButton,{size:"sm",onClick:w=>{w.preventDefault(),w.stopPropagation(),L(s,((G?Number(G):0)+m).toString(),{shouldDirty:!0,shouldValidate:I})},children:e.jsxRuntimeExports.jsx(e.FaPlus,{})})})]}),l&&_(s)&&e.jsxRuntimeExports.jsx("div",{className:"luminus-input-remove-icon",children:e.jsxRuntimeExports.jsx(e.IconButton,{color:"secondary",size:"sm",onClick:A,children:e.jsxRuntimeExports.jsx(e.MdClear,{})})}),D&&e.jsxRuntimeExports.jsx(e.InvalidFeedback,{message:D.message})]})},pl=({InputContainer:t=e.RowLabelInput,formField:s,label:n,placeholder:r,resetsFields:o,showClearIcon:a,clearValue:l,required:c,hidden:u,disabled:d,withoutLabel:x,step:p,size:E,CustomOnChangeComponent:m,noSelectOnFocus:h,className:g,decimalScale:j=2,fixedDecimalScale:f=!1,numberPrefix:b,numberSuffix:y,min:v,max:R,onChange:_,hint:D})=>{const{formState:S,setValue:I,watch:F,control:L}=ye.useFormContext(),[A,C]=i.useState(void 0),[U,G]=i.useState(!1),w=i.useCallback(()=>{const K=l??null;I(s,K!==null?Number(K):null,{shouldDirty:!0,shouldValidate:U})},[l,I,s,U]),N=i.useCallback(()=>{const K=s.split(".");let P=S.errors;K.forEach(W=>{P!==void 0&&(P=P[W])}),C(P)},[S,s]);i.useEffect(()=>{N()},[N]),i.useEffect(()=>{S.isSubmitted&&G(!0)},[S]);const M=F(s);i.useEffect(()=>{R!==void 0&&M>R&&I(s,R),v!==void 0&&M<v&&I(s,v)},[s,M,R,v,I]);const V=A!==void 0;return e.jsxRuntimeExports.jsxs(t,{label:`${n}${c?" *":""}`,hidden:u,withoutLabel:x,isInvalid:V,hint:D,className:g,children:[e.jsxRuntimeExports.jsxs("div",{className:"luminus-input-container position-relative w-100",children:[e.jsxRuntimeExports.jsx(ye.Controller,{control:L,name:s,render:({field:{ref:K,onChange:P,name:W,value:Z}})=>e.jsxRuntimeExports.jsx(Gt,{displayType:"input",thousandSeparator:" ",decimalSeparator:",",decimalScale:j,fixedDecimalScale:f,prefix:b,suffix:y,defaultValue:"",name:W,value:Z??"",placeholder:r??n,onFocus:q=>{!h&&q.target.select()},onChange:q=>{var B,z;const $=parseFloat(((z=(B=q.target)==null?void 0:B.value)==null?void 0:z.replaceAll(" ","").replaceAll(",","."))??0);o&&o.forEach(ae=>I(ae,null,{shouldDirty:!0,shouldValidate:U}));const Y=$==null||Number.isNaN($)?null:Number($);P(Y),_&&_(Y)},hidden:u,disabled:d||S.disabled,className:e.classNames("form-control text-end w-100",{"is-invalid":V},{[`form-control-${E}`]:E}),step:p,getInputRef:K,min:v,max:R})}),m&&e.jsxRuntimeExports.jsx("div",{className:"custom-picker-button",children:m})]}),a&&F(s)&&e.jsxRuntimeExports.jsx("div",{className:"luminus-input-remove-icon inset",children:e.jsxRuntimeExports.jsx(e.IconButton,{color:"secondary",size:"sm",onClick:w,children:e.jsxRuntimeExports.jsx(e.MdClear,{})})}),A&&e.jsxRuntimeExports.jsx(e.InvalidFeedback,{message:A.message})]})},Kt=["slice","options","formats","conditions"],Ns=t=>{const s=t.current.flexmonster.getReport({withDefaults:!0});if(typeof s=="string")throw alert("report is string"),new Error("report is string");const n={};return Kt.forEach(r=>{n[r]=s[r]}),JSON.stringify(n)},fl=t=>{if(t.settings){const s=JSON.parse(t.settings);return Kt.forEach(n=>{s[n]===void 0&&(s[n]=null)}),s}return{}},jl=t=>{const s={};return Kt.forEach(n=>{s[n]=(t==null?void 0:t[n])??void 0}),s},_s=(t,s)=>t.hierarchy&&t.hierarchy.uniqueName===s,ks=t=>!t.member&&!t.isDrillThrough,Ss=(t,s)=>typeof t=="function"?t(s):t.replace(":id",s),Fn=({dataSource:t,settings:s,pivotRef:n,localization:r,licenseKey:o,hyperlinkColumn:a,enabled:l=!0})=>{const{texts:{reports:c}}=i.useContext(e.LuminusComponentsContext),[u,d]=i.useState(!1),x=i.useRef(null),p=n??x,E=i.useMemo(()=>({localization:r}),[r]),m=i.useCallback(f=>{delete f[0],delete f[1],delete f[2];const b=[{id:"fm-tab-expand",title:c.expandAll,handler:p.current.flexmonster.expandAllData,icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"/><path fill="none" d="M0 0h24v24H0V0z"/></svg>'},{id:"fm-tab-collapse",title:c.collapseAll,handler:p.current.flexmonster.collapseAllData,icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"/><path d="M0 0h24v24H0z" fill="none"/></svg>'}];return f.unshift({id:"fm-tab-expand",title:c.expand,icon:'<svg height="42" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d=" M16 4 L28 4 L28 16 L24 12 L20 16 L16 12 L20 8z M4 16 L8 20 L12 16 L16 20 L12 24 L16 28 L4 28z "/></svg>',menu:b,rightGroup:!0}),f},[p,c.collapseAll,c.expand,c.expandAll]),h=f=>{const b=f.getTabs();f.getTabs=()=>m(b)};i.useEffect(()=>{var f;u&&l&&((f=p.current)==null||f.flexmonster.updateData(t),console.log("Updating flexmonster dataSource to: ",t))},[t,l,u,p]),i.useEffect(()=>{var f,b,y;if(u&&l){const{options:v,conditions:R,formats:_,slice:D,...S}=(f=p.current)==null?void 0:f.flexmonster.getReport();if(S===void 0||typeof S=="string")return;const I=jl(s);I.options={...s==null?void 0:s.options,grid:{...(b=s==null?void 0:s.options)==null?void 0:b.grid,autoSwitchToCompact:!1},showFieldListSearch:!0};const F={...S,...I};(y=p.current)==null||y.flexmonster.setReport(F),console.log("Refreshing flexmonster settings. New report: ",F)}},[l,u,p,s]);const g=i.useCallback((f,b)=>{var I;if(!a||!_s(b,a.idColumn)||ks(b))return;const y=(I=b.escapedLabel)==null?void 0:I.toString();if(y===void 0)return;const v=Ss(a.url,y),R="style='color: #00a45a; text-decoration: underline; cursor: pointer;'",_=b.type==="header"?"onclick='event.stopImmediatePropagation()'":"",D=b.isDrillThrough||b.type==="header"?`href='${v}' target='_blank'`:"";f.style&&(f.style["z-index"]=1);const S=`<a ${D} ${R} ${_}>${b.escapedLabel}</a>`;f.text=S},[a]),j=i.useCallback(f=>{if(!a||!_s(f,a.idColumn)||ks(f))return;const b=Ss(a.url,f.escapedLabel??"");window.open(b??"","_blank","noreferrer")},[a]);return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(An.Pivot,{ref:p,global:E,licenseKey:o,toolbar:!0,height:"100%",beforetoolbarcreated:h,ready:()=>{d(!0)},width:"100%",customizeCell:g,cellclick:j})})},hl=(t,s,n,r)=>{const{texts:{reports:o}}=i.useContext(e.LuminusComponentsContext),{prompt:a}=e.usePrompt(),{confirm:l}=e.useConfirm(),c=e.useAxios(),{user:u}=i.useContext(e.UserContext),{startLoading:d,stopLoading:x}=i.useContext(e.LoadingContext),{addNotification:p}=e.useNotifications(),E=i.useCallback(async f=>{d("report-versionSavingAs");try{const b=await c.post("/reports/version",f);p(o.saveSuccessful,"success"),await r(b.data)}finally{x("report-versionSavingAs")}},[p,r,c,o.saveSuccessful,d,x]),m=i.useCallback(async()=>{if(n===null){p("none open","warning");return}if(!await l(o.confirmOverwriteSave))return;const b=Ns(s);E({reportSourceName:t,reportVersionId:n,settings:b})},[p,l,s,t,o.confirmOverwriteSave,E,n]),h=i.useCallback(async()=>{const f=await a(o.enterName,{input:"input",required:!0});if(f===null)return;const b=Ns(s);E({reportSourceName:t,name:f,settings:b})},[s,a,t,o.enterName,E]),g=i.useCallback(async()=>{d("report-versionSavingAs");try{await c.post("/reports/version",{reportVersionId:n??void 0,reportSourceName:t,isArchived:!0}),p(o.deleteSuccessful,"success")}finally{x("report-versionSavingAs")}},[p,c,t,o.deleteSuccessful,n,d,x]),j=i.useCallback(async()=>{d("report-versionSavingAs");try{await c.post("/reports/version-restrictions",{reportVersionId:n??void 0,userRestricts:[{employeeId:u.personalNumber,addRights:!1}]}),p(o.detachSuccessful,"success")}finally{x("report-versionSavingAs")}},[p,c,o.detachSuccessful,n,d,x,u.personalNumber]);return{saveAs:h,save:m,archive:g,detach:j}},gl=t=>{const s=e.useAxios(),{startLoading:n,stopLoading:r}=i.useContext(e.LoadingContext);return{changeEmployeeRights:i.useCallback(async(a,l)=>{let c=null;n("reportSharing-addPerson");try{c=(await s.post("/reports/version-restrictions",{reportVersionId:t,userRestricts:[{employeeId:a,addRights:l}]})).data}finally{r("reportSharing-addPerson")}return c},[s,t,n,r])}},El=({isOpen:t,onHide:s,usersData:n,reportVersionId:r,EmployeePicker:o,setReportVersion:a})=>{const{ProjectIconComponent:l,texts:{reports:c}}=i.useContext(e.LuminusComponentsContext),{confirm:u}=e.useConfirm(),[d,x]=i.useState(null),{changeEmployeeRights:p}=gl(r),E=i.useCallback(g=>{a(j=>j===null?null:{...j,users:g.filter(f=>f.isReportOwner===!1)})},[a]),m=i.useCallback(async()=>{if(d===null)return;const g=await p(d.id,!0);E(g),x(null)},[d,p,E]),h=i.useCallback(async g=>{if(!await u(c.removeSharingWith(g)))return;const f=await p(g,!1);E(f)},[p,u,c,E]);return e.jsxRuntimeExports.jsxs(e.Modal,{show:t,onHide:s,children:[e.jsxRuntimeExports.jsx(e.Modal.Header,{closeButton:!0,children:e.jsxRuntimeExports.jsx(e.Modal.Title,{children:c.reportSharing})}),e.jsxRuntimeExports.jsxs(e.Modal.Body,{children:[e.jsxRuntimeExports.jsx(e.Typography,{variant:"h6",children:c.sharedWith}),e.jsxRuntimeExports.jsxs(tn,{variant:"flush",children:[n&&n.length===0?e.jsxRuntimeExports.jsx("div",{className:"px-2 text-muted",children:c.noone.toLowerCase()}):null,n==null?void 0:n.map(g=>e.jsxRuntimeExports.jsxs(rt,{className:"d-flex justify-content-between align-items-center gap-3 border-bottom px-2 py-1",children:[g.lastName," ",g.firstName," [",g.id,"]",e.jsxRuntimeExports.jsx(e.IconButton,{color:"danger",onClick:()=>h(g.id),children:e.jsxRuntimeExports.jsx(l,{icon:"delete"})})]},g.id))]}),e.jsxRuntimeExports.jsx(e.Typography,{variant:"h6",className:"mt-2 mb-2",children:c.addSharing}),e.jsxRuntimeExports.jsxs("div",{className:"d-flex gap-2 align-items-center",children:[e.jsxRuntimeExports.jsx("div",{className:"flex-grow-1",children:e.jsxRuntimeExports.jsx(o,{label:c.shareWith,onSelect:g=>{if(g===null||typeof g.id!="number"){x(null);return}x(g)},value:d})}),e.jsxRuntimeExports.jsx(e.PrimaryButton,{onClick:m,disabled:d===null,children:c.add})]})]})]})},Rl=(t,s)=>{const[n,r]=i.useState(null);return i.useEffect(()=>{t.then(({default:o})=>{const a=s!==void 0?s(o):o;r(a)})},[s,t]),{mappings:n}},vl=({reportType:t,title:s,data:n,filterElements:r,getReportRoute:o,localization:a,licenseKey:l,EmployeePicker:c,localizationJsonFile:u,localizationTransformer:d,hyperlinkColumn:x})=>{const{texts:{reports:p}}=i.useContext(e.LuminusComponentsContext),{confirm:E}=e.useConfirm(),m=oe.useNavigate(),[h]=oe.useSearchParams(),{id:g}=oe.useParams(),j=i.useMemo(()=>g===void 0?null:Number(g),[g]),f=i.useCallback($=>{const Y=$===null?"":$.toString();m(oe.generatePath(o(t),{id:Y})+"?"+h.toString(),{replace:!0,flushSync:!0})},[o,m,t,h]),[b,y]=i.useState(!1),v=i.useRef(null),{user:R}=i.useContext(e.UserContext),{data:_,reloadData:D}=Je.useGetApiData(`/reports/${t}`),{mappings:S}=Rl(u,d),[I,F]=i.useState({}),L=i.useCallback($=>{const Y=$.target.value,B=Y===""?null:Number(Y);f(B)},[f]),A=i.useCallback(async $=>{await D(),f($)},[D,f]),{data:C,setData:U}=Je.useGetApiData(`/reports/version/${j}`,{enabled:j!==null,nullStateBeforeLoad:!1,nullStateOnFail:!0});i.useEffect(()=>{var Y;if(C===null){F({});return}const $=fl(C)??{};F($),(Y=v.current)==null||Y.flexmonster.refresh()},[C]);const{save:G,saveAs:w,archive:N,detach:M}=hl(t,v,j,A),V=i.useMemo(()=>({data:n??[],mapping:S??void 0}),[n,S]),K=i.useCallback(async()=>{var Y;await E(p.confirmRevertChanges)&&((Y=v.current)==null||Y.flexmonster.setReport({dataSource:V,...I}))},[E,V,p.confirmRevertChanges,I]),P=i.useMemo(()=>(C==null?void 0:C.ownerId)===R.personalNumber,[C==null?void 0:C.ownerId,R.personalNumber]),W=i.useMemo(()=>{var $;return($=C==null?void 0:C.users)==null?void 0:$.some(Y=>Y.id===R.personalNumber&&!Y.isReportOwner)},[C==null?void 0:C.users,R.personalNumber]),Z=i.useCallback(async()=>{await E(p.confirmDelete(C==null?void 0:C.name))&&(await N(),f(null),await D())},[N,E,D,C==null?void 0:C.name,p,f]),q=i.useCallback(async()=>{await E(p.confirmDetach(C==null?void 0:C.name))&&(await M(),f(null),await D())},[E,M,D,C==null?void 0:C.name,p,f]);return i.useEffect(()=>{var $,Y;j===null&&f((($=_==null?void 0:_.reportVersions.find(B=>B.isSystem===!0))==null?void 0:$.reportVersionId)??((Y=_==null?void 0:_.reportVersions[0])==null?void 0:Y.reportVersionId)??null)},[_==null?void 0:_.reportVersions,j,f]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.PageContainer,{variant:"fullScreen",title:e.jsxRuntimeExports.jsxs("div",{className:"d-flex justify-content-start gap-3",children:[e.jsxRuntimeExports.jsx(e.Typography,{variant:"h3",children:s}),r,e.jsxRuntimeExports.jsxs("div",{className:"d-flex gap-1 align-items-center",children:[e.jsxRuntimeExports.jsxs(e.FormSelect,{size:"sm",value:j??void 0,onChange:L,children:[e.jsxRuntimeExports.jsx("optgroup",{label:p.versionSelectSystem,children:_==null?void 0:_.reportVersions.filter($=>$.isSystem===!0).map($=>e.jsxRuntimeExports.jsx("option",{value:$.reportVersionId,children:$.name},$.reportVersionId))}),e.jsxRuntimeExports.jsx("optgroup",{label:p.versionSelectYour,children:_==null?void 0:_.reportVersions.filter($=>$.ownerId===R.personalNumber).map($=>e.jsxRuntimeExports.jsx("option",{value:$.reportVersionId,children:$.name},$.reportVersionId))}),e.jsxRuntimeExports.jsx("optgroup",{label:p.versionSelectSharedWithYou,children:_==null?void 0:_.reportVersions.filter($=>$.isSystem===!1&&$.ownerId!==R.personalNumber).map($=>e.jsxRuntimeExports.jsx("option",{value:$.reportVersionId,children:`${$.name} [${$.ownerId}]`},$.reportVersionId))})]}),e.jsxRuntimeExports.jsx(e.ContextButton,{icon:e.jsxRuntimeExports.jsx(e.MdSave,{}),onClick:G,disabled:j===null||(C==null?void 0:C.isSystem)||!P,children:p.save}),e.jsxRuntimeExports.jsx(e.ContextButton,{icon:e.jsxRuntimeExports.jsx(e.MdSaveAs,{}),onClick:w,className:"flex-shrink-0",children:p.saveAs}),e.jsxRuntimeExports.jsxs(e.Dropdown,{toggle:e.jsxRuntimeExports.jsx(e.DropdownToggle,{as:e.SimpleDropdownToggle}),children:[e.jsxRuntimeExports.jsx(e.DropdownItem,{onClick:K,children:p.revertChanges}),e.jsxRuntimeExports.jsx(e.DropdownItem,{onClick:()=>y(!0),disabled:!P||(C==null?void 0:C.isSystem),children:p.share}),P&&!(C!=null&&C.isSystem)?e.jsxRuntimeExports.jsx(e.DropdownItem,{color:"danger",onClick:Z,children:p.delete}):null,W&&!(C!=null&&C.isSystem)?e.jsxRuntimeExports.jsx(e.DropdownItem,{color:"danger",onClick:q,children:p.detach}):null]})]})]}),children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("h-100 w-100",V.data&&V.data.length>0?"":"d-none"),children:e.jsxRuntimeExports.jsx(Fn,{dataSource:V,settings:I,pivotRef:v,enabled:V.data&&V.data.length>0,localization:a,licenseKey:l,hyperlinkColumn:x})})}),C!==null?e.jsxRuntimeExports.jsx(El,{isOpen:b,onHide:()=>y(!1),usersData:C.users??null,setReportVersion:U,reportVersionId:C==null?void 0:C.reportVersionId,EmployeePicker:c}):null]})},yl=({cell:{value:t}})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:t?e.jsxRuntimeExports.jsx(e.AvatarIcon,{name:t,size:21,fontSize:12}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{})}),bl=({knownTypes:t,typeFilters:s,onChangeTypeFilters:n})=>e.jsxRuntimeExports.jsx("div",{className:"mb-1 d-flex justify-content-center gap-2",children:t.map(r=>e.jsxRuntimeExports.jsx("div",{role:"button",style:{height:"14px",width:"14px",borderRadius:"50%",border:"2px solid transparent",backgroundColor:"transparent"},className:e.classNames(`border-${r}`,s.includes(r)&&`bg-${r}`),onClick:()=>{s.includes(r)?n(s.filter(o=>o!==r)):n([...s,r])}},r))}),wl=({linksTo:t,onClick:s,children:n})=>t?e.jsxRuntimeExports.jsx(oe.Link,{to:t,className:"text-decoration-none",onClick:s,children:n}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:n}),Cl=({message:t,onDeleteMessage:s,onClickMessage:n,getIcon:r,getLinksTo:o})=>{const{ProjectIconComponent:a,localizationContext:l}=i.useContext(e.LuminusComponentsContext),{dateFnsLocale:c}=i.useContext(l),u=t.dateTime?e.parseISO(t.dateTime):null,d=u?Wn(new Date(Date.now()),u):0;return e.jsxRuntimeExports.jsxs("div",{children:[u&&e.jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-end",children:e.jsxRuntimeExports.jsx(e.SimpleTooltip,{text:e.format(u,"dd.MM.yyyy HH:mm"),placement:"left",children:e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(e.Typography,{variant:"caption",children:d>2?e.format(u,"dd.MM.yyyy"):Un(u,new Date(Date.now()),{locale:c.code})})})})}),e.jsxRuntimeExports.jsx(wl,{linksTo:o(t)??void 0,onClick:n,children:e.jsxRuntimeExports.jsx(En,{level:t.type,noIcon:!0,children:e.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-start gap-2",children:[r(t),e.jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column gap-1 w-100",children:[e.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-start justify-content-between gap-3",children:[e.jsxRuntimeExports.jsx(e.Typography,{variant:"body2",className:"fw-bold",children:t.subject}),e.jsxRuntimeExports.jsx(e.IconButton,{size:"sm",onClick:x=>{x.preventDefault(),x.stopPropagation(),s(t.id)},children:e.jsxRuntimeExports.jsx(a,{icon:"delete"})})]}),e.jsxRuntimeExports.jsx(e.Typography,{variant:"body2",children:t.text})]})]})})})]})},Is=["info","warning","danger"],Ds=({messages:t,isLoading:s,onDeleteMessage:n,onClickMessage:r,getIcon:o,getLinksTo:a})=>{const{texts:{messageBoard:l}}=i.useContext(e.LuminusComponentsContext),[c,u]=i.useState(Is),d=i.useMemo(()=>t.filter(x=>c.includes(x.type??"")),[c,t]);return e.jsxRuntimeExports.jsxs("div",{className:"h-100 d-flex flex-column overflow-hidden",children:[e.jsxRuntimeExports.jsx(bl,{knownTypes:Is,typeFilters:c,onChangeTypeFilters:x=>u(x)}),s&&e.jsxRuntimeExports.jsxs("div",{className:"p-3 w-100",children:[e.jsxRuntimeExports.jsx(De,{as:ss.Title,animation:"glow",children:e.jsxRuntimeExports.jsx(De,{xs:6})}),e.jsxRuntimeExports.jsxs(De,{as:ss.Text,animation:"glow",children:[e.jsxRuntimeExports.jsx(De,{xs:7})," ",e.jsxRuntimeExports.jsx(De,{xs:4})," ",e.jsxRuntimeExports.jsx(De,{xs:4})," ",e.jsxRuntimeExports.jsx(De,{xs:6})," ",e.jsxRuntimeExports.jsx(De,{xs:8})]})]}),!s&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[t.length===0&&e.jsxRuntimeExports.jsx(at,{variant:"info",size:"sm",className:"mt-2",children:l.noMessages}),e.jsxRuntimeExports.jsx("div",{className:"h-100 overflow-y-auto d-flex flex-column gap-2 luminus-thin-scrollbar",children:d.map(x=>e.jsxRuntimeExports.jsx(Cl,{message:x,onDeleteMessage:n,onClickMessage:r,getIcon:o,getLinksTo:a},x.id))})]})]})},Nt={apiGet:"/messageBoard",apiDelete:"/messageBoard/"},Nl=({renderAsNotifPanel:t,notifIcon:s,apiUrls:{apiGet:n=Nt.apiGet,apiDelete:r=Nt.apiDelete}=Nt,getIcon:o,getLinksTo:a})=>{const c=e.useAxios(),[u,d]=i.useState([]),[x,p]=i.useState(!1),[E,m]=i.useState(!1),[h,g]=i.useState(!1),j=i.useCallback(async()=>{m(!0),await c.get(n).then(({data:R})=>{d(R),p(!0),m(!1)}).catch(()=>{d([]),m(!1)})},[n,c]),f=i.useCallback(async R=>c.delete(`${r}${R}`).then(()=>!0).catch(()=>!1),[r,c]),b=i.useCallback(R=>{f(R).then(_=>{_&&d(u.filter(D=>D.id!==R))})},[f,u]);i.useEffect(()=>{j();const R=setInterval(()=>j(),60*1e3);return()=>{clearInterval(R)}},[j]);const y=u.filter(R=>R.type==="danger").length,v=x?!1:E;return t?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"position-relative",children:[e.jsxRuntimeExports.jsx(e.IconButton,{size:"md",onClick:()=>g(!h),children:s}),y>0&&e.jsxRuntimeExports.jsx("div",{className:"badge rounded-pill bg-danger p-1 px-2 text-white",style:{position:"absolute",top:"-6px",right:"-10px",fontSize:"10px"},children:y})]}),e.jsxRuntimeExports.jsx(as,{show:h,onHide:()=>g(!1),placement:"end",children:e.jsxRuntimeExports.jsx(as.Body,{children:e.jsxRuntimeExports.jsx(Ds,{messages:u,isLoading:v,onDeleteMessage:b,onClickMessage:()=>g(!1),getIcon:o,getLinksTo:a})})})]}):e.jsxRuntimeExports.jsx(Ds,{messages:u,isLoading:v,onDeleteMessage:b,getIcon:o,getLinksTo:a})},_l="_tab-panel_d8l8q_1",kl="_full-height-no-overflow_d8l8q_5",Sl="_disabled_d8l8q_12",_t={"tab-panel":"_tab-panel_d8l8q_1",tabPanel:_l,"full-height-no-overflow":"_full-height-no-overflow_d8l8q_5",fullHeightNoOverflow:kl,disabled:Sl},Il=({eventKey:t,activeTab:s,fullHeightNoOverflow:n,disabled:r,className:o,children:a})=>t!==s?null:e.jsxRuntimeExports.jsx("div",{className:e.classNames("luminus-tab-panel",_t.tabPanel,{[_t.fullHeightNoOverflow]:n},{disabled:r},{[_t.disabled]:r},o),children:a}),Dl="_join-line_1q9e8_1",Tl={"join-line":"_join-line_1q9e8_1",joinLine:Dl},$n=({activeTab:t,onSelect:s,children:n,vertical:r,verticalStepper:o})=>e.jsxRuntimeExports.jsx("div",{className:e.classNames("luminus-tabs d-flex mb-2",{"gap-1":!o},{"gap-0":o},{"flex-column":r||o}),children:n.map((a,l)=>{const c=a.type,u=a.props;if(!u)return null;const d=u.eventKey,x=u.children,p=u.className,E=u.onClick;return e.jsxRuntimeExports.jsxs(i.Fragment,{children:[e.jsxRuntimeExports.jsx(c,{...u,className:e.classNames({active:t===d},p),onClick:()=>{s(d),E&&E(d)},vertical:r||o,children:x}),o&&l<n.length-1&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("join-line",Tl.joinLine)})]},u.eventKey)})}),Ll="_tab_1tbi7_1",Fl="_disabled_1tbi7_7",$l="_vertical_1tbi7_13",kt={tab:Ll,disabled:Fl,vertical:$l},Mn=({eventKey:t,className:s,onClick:n,disabled:r,vertical:o,children:a})=>e.jsxRuntimeExports.jsx("div",{role:"button",className:e.classNames("luminus-tab text-primary rounded",kt.tab,s,{disabled:r},{[kt.disabled]:r},{vertical:o},{[kt.vertical]:o}),onClick:()=>n&&!r&&n(t),children:typeof a=="string"?e.jsxRuntimeExports.jsx(e.Typography,{variant:o?"body":"h6",className:o?"":"text-primary",children:a}):a}),Ml=({tabs:t,activeTab:s,onSelect:n,...r})=>{var l;const{ProjectIconComponent:o}=i.useContext(e.LuminusComponentsContext),{isMobile:a}=He.useWindowSize();return a?e.jsxRuntimeExports.jsx(e.Dropdown,{toggle:e.jsxRuntimeExports.jsx(e.DropdownToggle,{as:e.SimpleDropdownToggle,text:((l=t.find(c=>c.id===s))==null?void 0:l.name)??"",icon:e.jsxRuntimeExports.jsx(o,{icon:"chevron-down"})}),...r,children:t.map(c=>e.jsxRuntimeExports.jsx(e.DropdownItem,{onClick:()=>n(c.id),children:c.name},c.id))}):e.jsxRuntimeExports.jsx($n,{activeTab:s,onSelect:c=>n(c),...r,children:t.map(c=>e.jsxRuntimeExports.jsx(Mn,{eventKey:c.id,children:c.name},c.id))})},Bl="_selection_1dtmm_1",Ol="_selectionBg_1dtmm_10",Al="_selectionItemsContainer_1dtmm_18",Pl="_selectionItems_1dtmm_18",ct={selection:Bl,selectionBg:Ol,selectionItemsContainer:Al,selectionItems:Pl},Yt=({icon:t,setIcon:s,IconComponent:n,IconTypeArray:r})=>{const[o,a]=i.useState(!1),l=c=>{s(c),a(!1)};return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.IconButton,{className:"rounded m-1",onClick:()=>a(!0),children:e.jsxRuntimeExports.jsx(n,{icon:t})}),o&&e.jsxRuntimeExports.jsxs("div",{className:ct.selection,children:[e.jsxRuntimeExports.jsx("div",{className:ct.selectionBg,onClick:()=>a(!1)}),e.jsxRuntimeExports.jsx("div",{className:ct.selectionItemsContainer,children:e.jsxRuntimeExports.jsx("div",{className:ct.selectionItems,children:r.filter((c,u,d)=>d.indexOf(c)===u).map(c=>e.jsxRuntimeExports.jsx(e.IconButton,{className:"rounded",onClick:()=>l(c),children:e.jsxRuntimeExports.jsx(n,{icon:c})},c))})})]})]})},qt=()=>{const t=i.useContext(e.ShortcutLinksContext);if(t===void 0)throw new Error("ShortcutLinksProvider not initilized. Probably tried to use useShortcutLinks outside ShortcutLinksProvider.");return t},Vl=({shortcutLink:t,IconComponent:s,IconTypeArray:n,editShortcutLink:r})=>{const{ProjectIconComponent:o}=i.useContext(e.LuminusComponentsContext),[a,l]=i.useState(t.icon),[c,u]=i.useState(t.name);console.log(a,typeof a);const d=i.useMemo(()=>!(a===t.icon&&c===t.name),[a,c,t.icon,t.name]),x=i.useCallback(()=>{l(t.icon),u(t.name)},[t]),p=i.useCallback(()=>{r({...t,icon:a,name:c})},[r,a,c,t]);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("td",{className:"align-middle",children:e.jsxRuntimeExports.jsx(Se,{type:"text",maxLength:20,value:c,onChange:u,className:"d-flex-grow-1",InputContainer:e.NoInputContainer})}),e.jsxRuntimeExports.jsx("td",{className:"align-middle text-center",children:e.jsxRuntimeExports.jsx(Yt,{icon:a,setIcon:l,IconComponent:s,IconTypeArray:n})}),e.jsxRuntimeExports.jsx("td",{className:"align-middle",style:{width:"7em"},children:d&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.IconButton,{onClick:x,color:"danger",className:"d-inline mx-2",children:e.jsxRuntimeExports.jsx(o,{icon:"cancel"})}),e.jsxRuntimeExports.jsx(e.IconButton,{onClick:p,color:"success",className:"d-inline mx-2",children:e.jsxRuntimeExports.jsx(o,{icon:"check"})})]})})]})},zl=({shortcutLink:t,IconComponent:s,IconTypeArray:n,editShortcutLink:r,deleteShortcutLink:o})=>{const{ProjectIconComponent:a}=i.useContext(e.LuminusComponentsContext),l=i.useCallback(()=>{o(t.id)},[o,t.id]);return e.jsxRuntimeExports.jsx("tr",{className:"mb-3",children:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("td",{className:"align-middle",children:e.jsxRuntimeExports.jsx(e.IconButton,{onClick:l,color:"danger",children:e.jsxRuntimeExports.jsx(a,{icon:"delete"})})}),e.jsxRuntimeExports.jsx("td",{className:"align-middle",children:t.url.length<=23?t.url:e.jsxRuntimeExports.jsx(e.SimpleTooltip,{placement:"bottom",text:t.url,children:e.jsxRuntimeExports.jsxs("span",{children:[t.url.slice(0,21),"..."]})})}),e.jsxRuntimeExports.jsx(Vl,{shortcutLink:t,IconComponent:s,IconTypeArray:n,editShortcutLink:r})]})})},Wl=({IconComponent:t,IconTypeArray:s})=>{const{texts:n}=i.useContext(e.LuminusComponentsContext),{shortcutLinks:r,editShortcutLink:o,deleteShortcutLink:a}=qt();return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:r!==null&&r.length>0?e.jsxRuntimeExports.jsxs(mr,{title:n.shortcutLinks.shortcutLinksSetting,children:[e.jsxRuntimeExports.jsx("thead",{className:"fw-bold",children:e.jsxRuntimeExports.jsxs("tr",{children:[e.jsxRuntimeExports.jsx("th",{}),e.jsxRuntimeExports.jsx("th",{children:n.shortcutLinks.target}),e.jsxRuntimeExports.jsx("th",{children:n.shortcutLinks.name}),e.jsxRuntimeExports.jsx("th",{children:n.shortcutLinks.icon}),e.jsxRuntimeExports.jsx("th",{})]})}),e.jsxRuntimeExports.jsx("tbody",{children:r==null?void 0:r.map(l=>e.jsxRuntimeExports.jsx(zl,{shortcutLink:l,IconComponent:t,IconTypeArray:s,editShortcutLink:o,deleteShortcutLink:a},l.id))})]}):e.jsxRuntimeExports.jsx(at,{variant:"info",children:n.shortcutLinks.addLinksToEditThemHereInfo})})},$t=5,Hl="_linkButton_pnlvi_1",Ul="_linkAddButton_pnlvi_31",Gl="_createLinkRow_pnlvi_39",We={linkButton:Hl,linkAddButton:Ul,createLinkRow:Gl},Kl=({shortcutLink:t,IconComponent:s})=>e.jsxRuntimeExports.jsx(e.SimpleTooltip,{text:t.name,placement:"bottom",children:e.jsxRuntimeExports.jsx(oe.Link,{to:t.url,className:We.linkButton,children:e.jsxRuntimeExports.jsx(s,{icon:t.icon})})}),Yl=({closeModal:t,isOpen:s,createLink:n,pageTitlePrefix:r,IconComponent:o,IconTypeArray:a})=>{const l=oe.useLocation(),{texts:c}=i.useContext(e.LuminusComponentsContext),[u,d]=i.useState("star-outline"),[x,p]=i.useState(r?document.title.replace(r,""):document.title),E=i.useCallback(async()=>{await n({icon:u,name:x,url:l.pathname+l.search}),t()},[t,n,u,l.pathname,l.search,x]),m=i.useMemo(()=>l.pathname+l.search,[l.pathname,l.search]);return e.jsxRuntimeExports.jsxs(e.Modal,{show:s,onHide:t,size:"sm",children:[e.jsxRuntimeExports.jsx(e.Modal.Header,{closeButton:!0,children:e.jsxRuntimeExports.jsx(e.Modal.Title,{children:c.shortcutLinks.newShortcut})}),e.jsxRuntimeExports.jsxs(e.Modal.Body,{children:[e.jsxRuntimeExports.jsxs("div",{className:We.createLinkRow,children:[e.jsxRuntimeExports.jsx(e.Typography,{variant:"form-label",className:"pe-3 text-end",children:c.shortcutLinks.target}),e.jsxRuntimeExports.jsx("div",{className:"d-flex align-items-middle fw-bold text-muted",children:m.length<=23?m:e.jsxRuntimeExports.jsx(e.SimpleTooltip,{placement:"bottom",text:m,children:e.jsxRuntimeExports.jsxs("span",{children:[m.slice(0,21),"..."]})})})]}),e.jsxRuntimeExports.jsxs("div",{className:We.createLinkRow,children:[e.jsxRuntimeExports.jsx(e.Typography,{variant:"form-label",className:"pe-3 text-end",children:c.shortcutLinks.name}),e.jsxRuntimeExports.jsx("div",{className:"d-flex align-items-middle fw-bold",children:e.jsxRuntimeExports.jsx(Se,{type:"text",maxLength:25,value:x,onChange:p,className:"w-100",InputContainer:e.RowLabelInput,withoutLabel:!0})})]}),e.jsxRuntimeExports.jsxs("div",{className:We.createLinkRow,children:[e.jsxRuntimeExports.jsx(e.Typography,{variant:"form-label",className:"pe-3 text-end",children:c.shortcutLinks.icon}),e.jsxRuntimeExports.jsx("div",{className:"d-flex align-items-middle fw-bold",children:e.jsxRuntimeExports.jsx(Yt,{icon:u,setIcon:d,IconComponent:o,IconTypeArray:a})})]})]}),e.jsxRuntimeExports.jsx(e.Modal.Footer,{className:"d-flex justify-content-end",children:e.jsxRuntimeExports.jsx(e.PrimaryButton,{onClick:E,children:c.shortcutLinks.addShortcut})})]})},ql=({IconComponent:t,IconTypeArray:s,pageTitlePrefix:n,createLink:r})=>{const{ProjectIconComponent:o,texts:a}=i.useContext(e.LuminusComponentsContext),[l,c]=i.useState(!1),[u]=pt(l,100);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.SimpleTooltip,{text:a.shortcutLinks.addShortcut,placement:"bottom",children:e.jsxRuntimeExports.jsx("button",{type:"button",className:e.classNames(We.linkButton,We.linkAddButton),onClick:()=>c(!0),children:e.jsxRuntimeExports.jsx(o,{icon:"add"})})}),(l||u)&&e.jsxRuntimeExports.jsx(Yl,{IconComponent:t,IconTypeArray:s,closeModal:()=>c(!1),createLink:r,isOpen:l,pageTitlePrefix:n})]})},Ql=({IconComponent:t,IconTypeArray:s,pageTitlePrefix:n})=>{const{shortcutLinks:r,createShortcutLink:o}=qt(),a=i.useMemo(()=>r!==null&&r.length<$t,[r]);return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("div",{className:"d-flex gap-2",children:[r==null?void 0:r.slice(0,$t).map((l,c)=>l!==null?e.jsxRuntimeExports.jsx(Kl,{shortcutLink:l,IconComponent:t},c):null),a&&e.jsxRuntimeExports.jsx(ql,{IconComponent:t,IconTypeArray:s,pageTitlePrefix:n,createLink:o})]})})},Zl=t=>{const s=e.useAxios(),{startLoading:n,stopLoading:r}=i.useContext(e.LoadingContext),o=i.useCallback(async c=>{n("submit-createShortcutLink");try{await s.post(`/dynamicForms/insert?referenceId=${t}`,c)}finally{r("submit-createShortcutLink")}},[s,t,n,r]),a=i.useCallback(async c=>{n("submit-updateShortcutLink");try{await s.post(`/dynamicForms/update?referenceId=${t}`,c)}finally{r("submit-updateShortcutLink")}},[s,t,n,r]),l=i.useCallback(async c=>{n("delete-deleteShortcutLink");try{await s.delete(`/dynamicForms/delete?referenceId=${t}&pk=${c.toString()}`)}finally{r("delete-deleteShortcutLink")}},[s,t,n,r]);return{create:o,update:a,remove:l}},Xl=t=>{if(t==null)throw new Error("Tried to make operation on null shortcutLinks.");return t},Ts=t=>{if(t==null)throw new Error("Tried to make operation on null shortcutLinks.");return t},Jl=({children:t,referenceId:s})=>{const{user:n}=i.useContext(e.UserContext),r=i.useCallback(m=>m.map(h=>({id:h.id,icon:h.icon,name:h.name,url:h.url})),[]),{data:o,reloadData:a}=Je.useGetApiData(`/dynamicForms/lookup-data-all?referenceId=${s}&employee=${n==null?void 0:n.personalNumber}`,{silent:!0,dataTransformer:r,enabled:n!==null}),{create:l,update:c,remove:u}=Zl(s),d=i.useCallback(async m=>{const h=Ts(n);if(Xl(o).length>=$t)throw new Error("Cannot add more shortcut links.");await l({...m,employee:h.personalNumber}),await a()},[l,a,o,n]),x=i.useCallback(async m=>{const h=Ts(n);await c({...m,employee:h.personalNumber}),await a()},[a,c,n]),p=i.useCallback(async m=>{await u(m),await a()},[a,u]),E=i.useMemo(()=>({shortcutLinks:o,createShortcutLink:d,editShortcutLink:x,deleteShortcutLink:p}),[d,p,x,o]);return e.jsxRuntimeExports.jsx(e.ShortcutLinksContext.Provider,{value:E,children:t})};exports.AvatarIcon=e.AvatarIcon;exports.ContextButton=e.ContextButton;exports.Documents=e.Documents;exports.Dropdown=e.Dropdown;exports.DropdownItem=e.DropdownItem;exports.DropdownToggle=e.DropdownToggle;exports.FileExtensionIcon=e.FileExtensionIcon;exports.FloatingLabelInput=e.FloatingLabelInput;exports.HookFormTextAreaInput=e.HookFormTextAreaInput;exports.HookFormTextInput=e.HookFormTextInput;exports.HtmlTooltip=e.HtmlTooltip;exports.IconButton=e.IconButton;exports.InvalidFeedback=e.InvalidFeedback;exports.NoInputContainer=e.NoInputContainer;exports.PrimaryButton=e.PrimaryButton;exports.ResponsiveContextDropdown=e.ResponsiveContextDropdown;exports.ResponsiveContextDropdownItem=e.ResponsiveContextDropdownItem;exports.RowLabelInput=e.RowLabelInput;exports.SimpleToggle=e.SimpleDropdownToggle;exports.SimpleTooltip=e.SimpleTooltip;exports.Typography=e.Typography;exports.UserAvatarToggle=e.UserAvatarToggle;exports.Loading=ge.Loading;exports.Alert=at;exports.AlertItem=En;exports.ApiFileDownloadButton=Vn;exports.AppSearch=$o;exports.AuthTemplate=ua;exports.Backdrop=Wt;exports.Badge=Yr;exports.BarChart=Gi;exports.Card=zt;exports.CheckInput=yn;exports.Collapse=et;exports.ColumnResizer=Tn;exports.DisabledRowLabelLink=Pi;exports.DropdownDivider=Vt;exports.DropdownPicker=Sa;exports.DynamicForm=Bi;exports.EmployeeSmallPhoto=Wi;exports.ErrorBoundary=pn;exports.FileUploadButton=pr;exports.FileUploadContextButton=Pt;exports.FileUploadDropdownItem=Zr;exports.Flexmonster=Fn;exports.FloatingActionContainer=Rn;exports.FloatingFormSubmit=dn;exports.FromToDatePicker=ci;exports.HomeDashboard=zr;exports.HookFormCheckInput=il;exports.HookFormDropdownPicker=cl;exports.HookFormFileInput=ul;exports.HookFormFloatingSubmit=dl;exports.HookFormNumericStepperInput=ml;exports.HookFormNumericTextInput=pl;exports.HookFormRadioInput=ll;exports.HookFormSelectInput=xl;exports.HrWithText=Ln;exports.IconPicker=Yt;exports.ImgApi=Ft;exports.ImgDirect=Ht;exports.LanguageSwitch=Vi;exports.LoadingBlock=Ls;exports.MessageBoard=Nl;exports.MiniDetailTooltip=ol;exports.MiniDetailValueItem=al;exports.MonthPicker=xn;exports.MonthPickerSearchParams=ui;exports.NumericFormat=Ui;exports.NumericStepperInput=Da;exports.NumericTextInput=ti;exports.PhotoLibrary=gn;exports.PhotoLightbox=hn;exports.PieChart=xi;exports.RadioInput=si;exports.ReportPage=vl;exports.ReportsIndexPage=tl;exports.ResponsiveTabs=Ml;exports.SearchBox=Hi;exports.SelectInput=tt;exports.SettingsFormPicker=Ai;exports.ShortcutLinks=Ql;exports.ShortcutLinksProvider=Jl;exports.ShortcutLinksSetup=Wl;exports.SimplePicker=ot;exports.Tab=Mn;exports.TabPanel=Il;exports.Tabs=$n;exports.TextAreaInput=Ia;exports.TextInput=Se;exports.Timeline=_a;exports.TypedFormGroup=zi;exports.UserAvatarValueFormat=yl;exports.VersionInfo=ha;exports.WidgetCard=Tt;exports.YearPicker=mn;exports.YearPickerSearchParams=di;exports.useShortcutLinksContext=qt;
|
|
9
|
+
`),a=!1),Object.assign(Object.assign({},t),{allowNegative:a})}function ei(t){t=Ja(t),t.decimalSeparator,t.allowedDecimalSeparators,t.thousandsGroupStyle;var s=t.suffix,n=t.allowNegative,r=t.allowLeadingZeros,o=t.onKeyDown;o===void 0&&(o=Te);var a=t.onBlur;a===void 0&&(a=Te);var l=t.thousandSeparator,c=t.decimalScale,u=t.fixedDecimalScale,d=t.prefix;d===void 0&&(d="");var x=t.defaultValue,p=t.value,E=t.valueIsNumericString,m=t.onValueChange,h=bn(t,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),g=jt(t),j=g.decimalSeparator,f=g.allowedDecimalSeparators,b=function(w){return hs(w,t)},y=function(w,N){return Za(w,N,t)},v=ze(p)?x:p,R=E??Qa(v,d,s);ze(p)?ze(x)||(R=R||typeof x=="number"):R=R||typeof p=="number";var _=function(w){return wn(w)?w:(typeof w=="number"&&(w=_n(w)),R&&typeof c=="number"?fs(w,c,!!u):w)},D=Sn(_(p),_(x),!!R,b,y,m),S=D[0],I=S.numAsString,F=S.formattedValue,L=D[1],A=function(w){var N=w.target,M=w.key,V=N.selectionStart,K=N.selectionEnd,P=N.value;if(P===void 0&&(P=""),(M==="Backspace"||M==="Delete")&&K<d.length){w.preventDefault();return}if(V!==K){o(w);return}M==="Backspace"&&P[0]==="-"&&V===d.length+1&&n&&Oe(N,1),c&&u&&(M==="Backspace"&&P[V-1]===j?(Oe(N,V-1),w.preventDefault()):M==="Delete"&&P[V]===j&&w.preventDefault()),f!=null&&f.includes(M)&&P[V]===j&&Oe(N,V+1);var W=l===!0?",":l;M==="Backspace"&&P[V-1]===W&&Oe(N,V-1),M==="Delete"&&P[V]===W&&Oe(N,V+1),o(w)},C=function(w){var N=I;if(N.match(/\d/g)||(N=""),r||(N=Ba(N)),u&&c&&(N=fs(N,c,u)),N!==I){var M=hs(N,t);L({formattedValue:M,value:N,floatValue:parseFloat(N)},{event:w,source:st.event})}a(w)},U=function(w){return w===j?!0:nt(w)},G=function(w){var N=w.currentValue,M=w.lastValue,V=w.formattedValue,K=w.currentValueIndex,P=w.formattedValueIndex,W=N[K],Z=V[P],q=kn(M,N),$=q.to,Y=function(B){return y(B).indexOf(".")+d.length};return p===0&&u&&c&&N[$.start]===j&&Y(N)<K&&Y(V)>P?!1:K>=$.start&&K<$.end&&f&&f.includes(W)&&Z===j?!0:W===Z};return Object.assign(Object.assign({},h),{value:F,valueIsNumericString:!1,isValidInputCharacter:U,isCharacterSame:G,onValueChange:L,format:b,removeFormatting:y,getCaretBoundary:function(w){return Xa(w,t)},onKeyDown:A,onBlur:C})}function Gt(t){var s=ei(t);return i.createElement(Ka,Object.assign({},s))}const ti=({InputContainer:t=e.FloatingLabelInput,value:s,onChange:n,debounceMs:r,label:o,withoutLabel:a,placeholder:l,size:c,hidden:u,disabled:d,showClearIcon:x,clearValue:p,className:E,step:m,noSelectOnFocus:h,decimalScale:g,fixedDecimalScale:j=!1,numberPrefix:f,numberSuffix:b,min:y,max:v,hint:R})=>{const _=i.useCallback(()=>{if(!n)return;const A=p??null;n(A?Number(A):null)},[p,n]),D=i.useRef(null),[S,I]=i.useState((s==null?void 0:s.toString())??""),F=i.useCallback(A=>{const C=A;n&&n(C==null||C===""?null:Number(C))},[n]),L=i.useCallback(A=>{var U,G;let C=parseFloat(((G=(U=A.target)==null?void 0:U.value)==null?void 0:G.replaceAll(" ","").replaceAll(",","."))??0);if(Number.isNaN(C)&&(C=0),!r){F(C.toString());return}I(C.toString()),D.current!==null&&window.clearTimeout(D.current),D.current=window.setTimeout(()=>{F(C.toString())},r)},[r,F]);return i.useEffect(()=>{I(s===null?"":s.toString())},[v,y,s]),i.useEffect(()=>{v!==void 0&&Number(S)>v&&I(v.toString()),y!==void 0&&Number(S)<y&&I(y.toString())},[S,v,y,I]),i.useEffect(()=>{!n||s===null||(v!==void 0&&s>v&&n(v),y!==void 0&&s<y&&n(y))},[s,v,y,n]),e.jsxRuntimeExports.jsxs(t,{withoutLabel:a,label:o??"",hidden:u,className:E,hint:R,children:[e.jsxRuntimeExports.jsx(Gt,{displayType:"input",thousandSeparator:" ",decimalSeparator:",",decimalScale:g,fixedDecimalScale:j,prefix:f,suffix:b,defaultValue:"",value:r?S:(s==null?void 0:s.toString())??"",placeholder:l??o,onFocus:A=>{!h&&A.target.select()},onChange:L,hidden:u,disabled:d,className:e.classNames("form-control text-end w-100",{[`form-control-${c}`]:c}),step:m,min:y,max:v}),x&&s!==null&&n&&!d&&e.jsxRuntimeExports.jsx("div",{className:"luminus-input-remove-icon inset",children:e.jsxRuntimeExports.jsx(e.IconButton,{color:"secondary",size:"sm",onClick:_,children:e.jsxRuntimeExports.jsx(e.MdClear,{})})})]})},si=({InputContainer:t=e.RowLabelInput,label:s,options:n,disabled:r,hidden:o,className:a,value:l,onChange:c})=>{const u=i.useCallback(d=>{c&&c(d.target.value)},[c]);return e.jsxRuntimeExports.jsx(t,{isForRadioInput:!0,hidden:o,withoutLabel:!s,label:`${s}`,className:a,children:n.map(d=>e.jsxRuntimeExports.jsx(e.Form.Check,{id:`radio-${d.id}`,label:d.name,type:"radio",value:d.id??"",checked:l===d.id,onChange:u,hidden:o,disabled:r,className:"w-100"},d.id))})},gs=[["D","day"],["M","month"],["Y","year"],["C","custom"]],ni="_wrapper_qfqux_1",ri="_lg_qfqux_7",oi="_sm_qfqux_11",ai="_md_qfqux_14",Es={wrapper:ni,lg:ri,sm:oi,md:ai},dt=t=>{const s=new Date(t),n=e.trimIsoDate(s.toISOString());s.setMonth(s.getMonth()+1),s.setDate(s.getDate()-1);const r=e.trimIsoDate(s.toISOString());return{from:n,to:r}},Xe=t=>{const s=new Date(t),n=e.trimIsoDate(s.toISOString());s.setFullYear(s.getFullYear()+1),s.setDate(s.getDate()-1);const r=e.trimIsoDate(s.toISOString());return{from:n,to:r}},ii=(t,s)=>{if(t===null||s===null)return"C";if(t===s)return"D";const n=new Date(t);return dt(n).to===s?"M":Xe(n).to===s?"Y":(console.log(Xe(n),s),"C")},li=(t,s,n)=>{const r=i.useCallback((l,c)=>{if(t==="C"){n(u=>({...u,[l]:c}));return}switch(l){case"from":n(u=>{if(c===null)return u;const d=new Date(c);if(t==="D"){const x=e.trimIsoDate(d.toISOString());return{from:x,to:x}}return t==="M"?dt(d):t==="Y"?Xe(d):u});break;case"to":s("C"),n(u=>({...u,[l]:c}));break}},[t,n,s]),o=i.useCallback(l=>{n(c=>{if(c.from===null||c.to===null)return c;const u=new Date(c.from);u.setHours(u.getHours()-u.getTimezoneOffset()/60);const d=new Date(c.to);if(t==="D"){u.setDate(u.getDate()+l);const x=e.trimIsoDate(u.toISOString());return{from:x,to:x}}return t==="M"?(u.setMonth(u.getMonth()+l),dt(u)):t==="Y"?(u.setFullYear(u.getFullYear()+l),Xe(u)):{from:e.trimIsoDate(u.toISOString()),to:e.trimIsoDate(d.toISOString())}})},[t,n]),a=i.useCallback(l=>{l==="D"?n(c=>({from:c.from,to:c.from})):l==="M"?n(c=>{if(c.from===null)return c;const u=e.getFirstDayOfMonth(c.from);return dt(u)}):l==="Y"&&n(c=>{if(c.from===null)return c;const u=e.getFirstDayOfYear(new Date(c.from).getFullYear());return Xe(u)}),s(l)},[n,s]);return{setFromToProp:r,handleArrowClick:o,handleRangeChange:a}},ci=({fromtoState:[t,s],className:n,size:r})=>{const{texts:{date:o},ProjectIconComponent:a}=i.useContext(e.LuminusComponentsContext),[l,c]=i.useState("C"),{handleArrowClick:u,handleRangeChange:d,setFromToProp:x}=li(l,c,s),p=i.useMemo(()=>l==="C",[l]),E=i.useRef(!0);return i.useEffect(()=>{if(E.current){const m=ii(t.from,t.to);c(m),E.current=!1}},[t.from,t.to]),e.jsxRuntimeExports.jsxs("div",{className:e.classNames("d-inline-flex align-items-center gap-1",Es.wrapper,Es[r??"md"],n),children:[e.jsxRuntimeExports.jsx(e.IconButton,{disabled:p,onClick:()=>{u(-1)},children:e.jsxRuntimeExports.jsx(a,{icon:"chevron-left"})}),e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center gap-1",children:[e.jsxRuntimeExports.jsx(Se,{type:"date",value:t.from,onChange:m=>x("from",m===null?null:m.toString()),InputContainer:e.NoInputContainer,size:r}),e.jsxRuntimeExports.jsx(e.Dropdown,{toggle:e.jsxRuntimeExports.jsx(e.DropdownToggle,{text:o[gs.find(m=>m[0]===l)[1]].substring(0,1),as:e.FromToDatePickerDropdownToggle}),children:gs.map(m=>e.jsxRuntimeExports.jsx(e.DropdownItem,{disabled:m[0]===l,className:e.classNames(m[0]===l?"text-black-50":""),onClick:()=>d(m[0]),role:"button",children:o[m[1]]},m[0]))}),e.jsxRuntimeExports.jsx(Se,{type:"date",value:t.to,onChange:m=>x("to",m===null?null:m.toString()),InputContainer:e.NoInputContainer,size:r})]})}),e.jsxRuntimeExports.jsx(e.IconButton,{disabled:p,onClick:()=>{u(1)},children:e.jsxRuntimeExports.jsx(a,{icon:"chevron-right"})})]})},ui=({defaultMonth:t,searchKey:s="monthFrom",yearMin:n,yearMax:r})=>{const{localizationContext:o}=i.useContext(e.LuminusComponentsContext),{dateFnsLocale:a}=i.useContext(o),{searchParams:l,setSearch:c}=Ae.useSearchQuery(),u=l.get(s),d=u?e.parseISO(u):t,x=i.useCallback(p=>{c(s,St(p,{representation:"date"}))},[s,c]);return e.jsxRuntimeExports.jsx(xn,{month:d,onChangeMonth:x,locale:a,yearMin:n,yearMax:r})},di=({defaultYear:t,searchKey:s="yearFrom",...n})=>{const[r,o]=Ae.useSearchQueryState(s,St(t,{representation:"date"})),a=r?e.parseISO(r):t,l=i.useCallback(c=>{o(St(c,{representation:"date"}))},[o]);return e.jsxRuntimeExports.jsx(mn,{year:a,onChangeYear:l,...n})},xi=({data:t,showLegend:s=!1,legendPosition:n="left",onClick:r})=>{const{chartColorPalette:o}=i.useContext(e.LuminusComponentsContext);return e.jsxRuntimeExports.jsx(e._,{data:t,margin:{top:50,right:s&&n==="right"?200:100,bottom:50,left:s&&n==="left"?200:100},innerRadius:.4,padAngle:4,cornerRadius:2,activeOuterRadiusOffset:10,borderWidth:2,borderColor:{from:"color",modifiers:[["darker",.5]]},colors:o,arcLinkLabelsSkipAngle:10,arcLinkLabelsTextColor:{from:"color",modifiers:[["darker",.5]]},arcLinkLabelsThickness:2,arcLinkLabelsColor:{from:"color"},enableArcLabels:!1,legends:s?[{anchor:n,direction:n==="left"||n==="right"?"column":"row",justify:!1,translateX:n==="left"?-200:n==="right"?200:0,translateY:n==="top"?-50:n==="bottom"?50:0,itemsSpacing:4,itemWidth:120,itemHeight:18,itemTextColor:"#1e2832",itemDirection:"left-to-right",itemOpacity:1,symbolSize:18,symbolShape:"circle",padding:10}]:[],onClick:a=>r&&r(a.data)})},mi=({errors:t,schema:s})=>{const n=r=>{var o,a;return r.toLowerCase()==="others"?"Obecné":((a=(o=s.columns)==null?void 0:o.find(l=>l.field===r))==null?void 0:a.caption)??r};return e.jsxRuntimeExports.jsx("div",{className:"alert alert-danger w-100 m-0 p-2",children:e.jsxRuntimeExports.jsx("table",{children:e.jsxRuntimeExports.jsx("tbody",{children:t.map(r=>e.jsxRuntimeExports.jsxs("tr",{children:[e.jsxRuntimeExports.jsx("td",{className:"fw-bold pe-2",children:e.jsxRuntimeExports.jsxs(e.Typography,{variant:"body",children:[n(r.name),":"]})}),e.jsxRuntimeExports.jsx("td",{className:"",children:e.jsxRuntimeExports.jsx(e.Typography,{variant:"body",children:r.errors})})]},r.name))})})})},In=t=>{const s={};return Object.keys(t).forEach(n=>{if(t[n].value===!0){s[n]=1;return}if(t[n].value===!1){s[n]=0;return}s[n]=t[n].value}),s},Rs=(t,s)=>{const n={};return Object.keys(t).forEach(r=>{var l;const o=t[r],a=(l=s.columns)==null?void 0:l.find(c=>c.field===r);if((a==null?void 0:a.type)==="BIT"&&(o===1||o===0)){n[r]={value:o===1,defaultValue:o===1};return}n[r]={value:o,defaultValue:o}}),n},pi="_table_1klfy_1",fi="_table-header_1klfy_10",ji="_table-row_1klfy_10",hi="_table-head_1klfy_10",gi="_filters-row_1klfy_19",Ei="_table-body_1klfy_30",Ri="_table-cell_1klfy_30",vi="_action-column_1klfy_43",yi="_sticky-top_1klfy_47",bi="_sticky-first_1klfy_54",wi="_sticky-last_1klfy_61",Ci="_sticky-bottom_1klfy_68",re={table:pi,"table-header":"_table-header_1klfy_10",tableHeader:fi,"table-row":"_table-row_1klfy_10",tableRow:ji,"table-head":"_table-head_1klfy_10",tableHead:hi,"filters-row":"_filters-row_1klfy_19",filtersRow:gi,"table-body":"_table-body_1klfy_30",tableBody:Ei,"table-cell":"_table-cell_1klfy_30",tableCell:Ri,"action-column":"_action-column_1klfy_43",actionColumn:vi,"sticky-top":"_sticky-top_1klfy_47",stickyTop:yi,"sticky-first":"_sticky-first_1klfy_54",stickyFirst:bi,"sticky-last":"_sticky-last_1klfy_61",stickyLast:wi,"sticky-bottom":"_sticky-bottom_1klfy_68",stickyBottom:Ci},Ni="_input_pxkkh_1",ke={input:Ni},Dn=({type:t,value:s,field:n,isPrimary:r,isReadonly:o,primaryEditable:a=!1,valuesForSelect:l,addValueToValuesForSelect:c,onChangeHandler:u,hideClearIcon:d,clearValue:x,customPickers:p})=>{var E;switch(t){case"NUM":return l&&l.length>0?e.jsxRuntimeExports.jsx(tt,{withoutLabel:!0,InputContainer:e.NoInputContainer,className:ke.input,size:"sm",value:(s==null?void 0:s.toString())??"",onChange:m=>u(n,m===null?null:Number(m)),options:l,disabled:o?!0:r?!a:!1,showClearIcon:!d,clearValue:x,dropdownWidth:200}):e.jsxRuntimeExports.jsx(Se,{withoutLabel:!0,InputContainer:e.NoInputContainer,className:ke.input,size:"sm",type:"number",value:s===null?null:Number(s),onChange:m=>u(n,m===null?null:Number(m)),disabled:o?!0:r?!a:!1,showClearIcon:!d,clearValue:x});case"STR":return l&&l.length>0?e.jsxRuntimeExports.jsx(tt,{withoutLabel:!0,InputContainer:e.NoInputContainer,className:ke.input,size:"sm",value:(s==null?void 0:s.toString())??"",onChange:m=>u(n,(m==null?void 0:m.toString())??null),options:l,disabled:o?!0:r?!a:!1,showClearIcon:!d,clearValue:x,dropdownWidth:200}):e.jsxRuntimeExports.jsx(Se,{withoutLabel:!0,InputContainer:e.NoInputContainer,className:e.classNames(ke.input,ke.longer),size:"sm",type:"text",value:(s==null?void 0:s.toString())??"",onChange:m=>u(n,(m==null?void 0:m.toString())??null),disabled:o?!0:r?!a:!1,showClearIcon:!d,clearValue:x});case"BIT":return e.jsxRuntimeExports.jsx(yn,{InputContainer:e.NoInputContainer,className:ke.input,value:s===!0,onChange:m=>u(n,m),disabled:o?!0:r?!a:!1});case"DT":return e.jsxRuntimeExports.jsx(Se,{withoutLabel:!0,InputContainer:e.NoInputContainer,className:ke.input,size:"sm",type:"date",value:s?s.toString().split("T")[0]??"":"",onChange:m=>u(n,(m==null?void 0:m.toString())??null),disabled:o?!0:r?!a:!1,showClearIcon:!d,clearValue:x});default:{const m=p==null?void 0:p.find(h=>h.type===t);return m?e.jsxRuntimeExports.jsx(m.picker,{className:e.classNames(ke.input,ke.longer),value:s?{id:(s==null?void 0:s.toString())??null,name:((E=l==null?void 0:l.find(h=>{var g;return((g=h.id)==null?void 0:g.toString())===(s==null?void 0:s.toString())}))==null?void 0:E.name)??""}:null,onChange:h=>{var g;u(n,(h==null?void 0:h.id)??null),console.log(h,l==null?void 0:l.some(j=>{var f,b;return((f=j.id)==null?void 0:f.toString())===((b=h==null?void 0:h.id)==null?void 0:b.toString())}),c),h&&!(l!=null&&l.some(j=>{var f,b;return((f=j.id)==null?void 0:f.toString())===((b=h==null?void 0:h.id)==null?void 0:b.toString())}))&&c&&(console.log("adding to values for select"),c({id:((g=h.id)==null?void 0:g.toString())??"",name:h.name}))},disabled:o?!0:r?!a:!1}):e.jsxRuntimeExports.jsx("div",{className:"alert alert-warning p-1 m-0",children:e.jsxRuntimeExports.jsxs(e.Typography,{variant:"body",children:["Neznámý typ ",t]})})}}},_i=({schema:t,columns:s,setColumns:n,initialItem:r,onEdit:o,onDelete:a,customPickers:l})=>{const{ProjectIconComponent:c}=i.useContext(e.LuminusComponentsContext),[u,d]=i.useState(r),x=i.useCallback((m,h)=>{console.log("changeValue",m,h),d(g=>({...g,[m]:{...g[m],value:h}}))},[]),p=m=>(m==null?void 0:m.value)!==(m==null?void 0:m.defaultValue),E=i.useCallback(()=>Object.keys(u).some(m=>p(u[m])),[u]);return i.useEffect(()=>{d(r)},[r]),e.jsxRuntimeExports.jsxs("tr",{className:e.classNames("table-row",re.tableRow),children:[e.jsxRuntimeExports.jsx("td",{className:e.classNames("table-cell",re.tableCell,re.stickyFirst),children:E()&&e.jsxRuntimeExports.jsx(e.IconButton,{color:"success",onClick:()=>o(In(u)),children:e.jsxRuntimeExports.jsx(c,{icon:"check"})})}),s.map(m=>{var h,g;return e.jsxRuntimeExports.jsx("td",{className:e.classNames("table-cell",re.tableCell),children:e.jsxRuntimeExports.jsx(Dn,{type:m.type,value:(h=u[m.field??""])==null?void 0:h.value,field:m.field,isReadonly:m.readOnly,isPrimary:t.primaryKey===m.field,valuesForSelect:m.valuesForSelect,addValueToValuesForSelect:j=>{n(s.map(f=>f.field===m.field?{...f,valuesForSelect:[...f.valuesForSelect??[],j]}:f))},onChangeHandler:x,hideClearIcon:!p(u[m.field??""]),clearValue:(g=u[m.field??""].defaultValue)==null?void 0:g.toString(),customPickers:l})},`${t.id}-${m.field}`)}),e.jsxRuntimeExports.jsx("td",{className:e.classNames("table-cell",re.tableCell,re.stickyLast),children:e.jsxRuntimeExports.jsx(e.IconButton,{color:"danger",onClick:()=>a(u[t.primaryKey??""].value),children:e.jsxRuntimeExports.jsx(c,{icon:"delete"})})})]})},ki=({schema:t,columns:s,setColumns:n,onCreate:r,customPickers:o})=>{const{ProjectIconComponent:a}=i.useContext(e.LuminusComponentsContext),[l,c]=i.useState(null),u=i.useCallback(()=>{var p;const x={};(p=t.columns)==null||p.forEach(E=>{const m=E.type==="BIT"?!1:E.type==="NUM"?0:E.type==="STR"?"":null;x[E.field??""]={value:m,defaultValue:m}}),c(x)},[t]),d=i.useCallback((x,p)=>{c(E=>E&&{...E,[x]:{...E[x],value:p}})},[]);return l?e.jsxRuntimeExports.jsxs("tr",{className:"sticky-bottom shadow",children:[e.jsxRuntimeExports.jsx("td",{className:"sticky-first",children:e.jsxRuntimeExports.jsx(e.IconButton,{color:"success",onClick:async()=>{const x=In(l);x&&await r(x)&&c(null)},children:e.jsxRuntimeExports.jsx(a,{icon:"check"})})}),s.map(x=>e.jsxRuntimeExports.jsx("td",{children:e.jsxRuntimeExports.jsx(Dn,{type:x.type,value:l[x.field??""].value,field:x.field,isReadonly:x.readOnly,isPrimary:t.primaryKey===x.field,valuesForSelect:x.valuesForSelect,addValueToValuesForSelect:p=>{n(s.map(E=>E.field===x.field?{...E,valuesForSelect:[...E.valuesForSelect??[],p]}:E))},onChangeHandler:d,primaryEditable:!0,customPickers:o})},`${t.id}-${x.field}`)),e.jsxRuntimeExports.jsx("td",{className:"sticky-last",children:e.jsxRuntimeExports.jsx(e.IconButton,{color:"danger",onClick:()=>c(null),children:e.jsxRuntimeExports.jsx(a,{icon:"cancel"})})})]}):e.jsxRuntimeExports.jsxs("tr",{className:"sticky-bottom shadow",children:[e.jsxRuntimeExports.jsx("td",{className:"sticky-first",children:e.jsxRuntimeExports.jsx(e.IconButton,{onClick:u,children:e.jsxRuntimeExports.jsx(a,{icon:"add"})})}),e.jsxRuntimeExports.jsx("td",{colSpan:s.length+1})]})},Si="_resizer_ref0b_1",Ii="_content_ref0b_11",Di="_dragging_ref0b_16",lt={resizer:Si,content:Ii,dragging:Di},Tn=({cellRef:t,defaultWidth:s})=>{const[n,r]=i.useState(s),[,o]=i.useState(null);return i.useEffect(()=>{r(s)},[s]),i.useEffect(()=>{t.current&&(t.current.style.minWidth=`${n}px`)},[n,t]),e.jsxRuntimeExports.jsx("div",{className:e.classNames("luminus-column-resizer",lt.resizer),draggable:!0,onDragStart:a=>{o(a.currentTarget.getBoundingClientRect().x),a.currentTarget.classList.add(lt.dragging)},onDrag:a=>{o(l=>(t.current&&r(c=>c+a.clientX-(l??0)),a.clientX))},onDragEnd:a=>{o(null),a.currentTarget.classList.remove(lt.dragging)},children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("content",lt.content)})})},Ti=({column:t,children:s})=>t.description?e.jsxRuntimeExports.jsx(e.SimpleTooltip,{placement:"bottom",text:t.description??"",children:e.jsxRuntimeExports.jsx("div",{children:s})}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:s}),Li=({column:t,sortByField:s,sortByType:n,setSortBy:r})=>{const{ProjectIconComponent:o}=i.useContext(e.LuminusComponentsContext),a=i.useRef(null),l=i.useMemo(()=>{if(t.valuesForSelect&&t.valuesForSelect.length>0)return 200;switch(t.type){case"NUM":return 80;case"STR":return 200;case"BIT":return 50;case"DT":return 100;default:return 100}},[t.type,t.valuesForSelect]);return e.jsxRuntimeExports.jsxs("th",{ref:a,className:e.classNames("table-head",re.tableHead),onClick:()=>{const c=s===t.field?n:null;if(c==="asc"){r(t.field,"desc");return}if(c==="desc"){r(t.field,null);return}r(t.field,"asc")},children:[e.jsxRuntimeExports.jsx(Ti,{column:t,children:e.jsxRuntimeExports.jsxs("div",{className:"d-flex justify-content-between align-items-center",children:[t.label,s===t.field&&e.jsxRuntimeExports.jsx(o,{icon:n==="asc"?"chevron-up":"chevron-down"})]})}),e.jsxRuntimeExports.jsx(Tn,{cellRef:a,defaultWidth:l})]})},Fi=({schema:t,items:s,onEditItem:n,onDeleteItem:r,onCreateItem:o,filters:a,setFilter:l,sortByField:c,sortByType:u,setSortBy:d,selectedMaster:x,customPickers:p})=>{const{texts:{dynamicForms:E}}=i.useContext(e.LuminusComponentsContext),[m,h]=i.useState([]);return i.useEffect(()=>{var g,j,f;h([...((f=(j=(g=t.columns)==null?void 0:g.filter(b=>!b.hidden))==null?void 0:j.filter(b=>t.masterReference?b.field!==t.masterReferenceColumn:!0))==null?void 0:f.map(b=>{var y;return{label:b.caption??"",width:100,description:b.description??null,field:b.field??"",type:b.type,readOnly:b.readOnly,valuesForSelect:((y=b.values)==null?void 0:y.filter(v=>b.valuesFilteredByMaster?v.masterValue===x:!0).map(v=>({id:v.id??"",name:v.name})))??void 0}}))??[]])},[t,x]),e.jsxRuntimeExports.jsxs("table",{id:`dynamic-table-${t.id}`,className:e.classNames("table table-borderless luminus-df-table",re.table),children:[e.jsxRuntimeExports.jsxs("thead",{className:e.classNames("text-nowrap table-header",re.stickyTop,re.tableHeader),children:[e.jsxRuntimeExports.jsxs("tr",{className:e.classNames("table-row",re.tableRow),children:[e.jsxRuntimeExports.jsx("th",{className:e.classNames("table-head",re.tableHead,re.actionColumn,re.stickyFirst)}),m.map(g=>e.jsxRuntimeExports.jsx(Li,{column:g,sortByField:c,sortByType:u,setSortBy:d},`${t.id}-${g.field}`)),e.jsxRuntimeExports.jsx("th",{className:e.classNames("table-head",re.tableHead,re.actionColumn,re.stickyLast)})]}),e.jsxRuntimeExports.jsxs("tr",{className:e.classNames("table-row filters-row",re.tableRow,re.filtersRow),children:[e.jsxRuntimeExports.jsx("th",{className:e.classNames("table-head",re.tableHead,re.actionColumn,re.stickyFirst)}),m.map(g=>e.jsxRuntimeExports.jsx("th",{className:e.classNames("table-head",re.tableHead),children:g.valuesForSelect&&g.valuesForSelect.length>0||g.type==="BIT"?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(tt,{InputContainer:e.NoInputContainer,withoutLabel:!0,size:"sm",value:a[g.field]??"",onChange:j=>l(g.field,(j==null?void 0:j.toString())??null),options:g.type==="BIT"?[{id:1,name:E.yes},{id:0,name:E.no}]:g.valuesForSelect??[],isNumber:g.type==="BIT",showClearIcon:!0,dropdownWidth:200})}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(Se,{InputContainer:e.NoInputContainer,withoutLabel:!0,size:"sm",type:g.type==="NUM"?"number":g.type==="DT"?"date":"text",value:a[g.field]??"",onChange:j=>l(g.field,(j==null?void 0:j.toString())??null)})})},`${t.id}-${g.field}`)),e.jsxRuntimeExports.jsx("th",{className:e.classNames("table-head",re.tableHead,re.actionColumn,re.stickyLast)})]})]}),e.jsxRuntimeExports.jsxs("tbody",{className:e.classNames("table-body",re.tableBody),children:[s.filter(g=>g[t.primaryKey??""]).map(g=>e.jsxRuntimeExports.jsx(_i,{schema:t,columns:m,setColumns:h,initialItem:g,onEdit:n,onDelete:r,customPickers:p},`${t.id}-${g[t.primaryKey??""].value}`)),e.jsxRuntimeExports.jsx(ki,{schema:t,columns:m,setColumns:h,onCreate:o,customPickers:p})]})]})},$i=({master:t,onChange:s,options:n,label:r})=>e.jsxRuntimeExports.jsx("div",{style:{minWidth:"200px"},children:e.jsxRuntimeExports.jsx(tt,{label:r,value:t,onChange:o=>s(o?o.toString():null),options:n,size:"sm"})}),Mi="_pagination_gujwe_1",vs={pagination:Mi},ys={appDetail:"/settings/:id"},Be={apiSchemaGet:"/dynamicForms/schema",apiDataGet:"/dynamicForms/data",apiItemPost:"/dynamicForms/update",apiItemDelete:"/dynamicForms/delete",apiItemCreate:"/dynamicForms/insert",apiExportGet:"/dynamicForms/export"},Bi=({id:t,page:s,setPage:n,filters:r,setFilter:o,sortByField:a,sortByType:l,setSortBy:c,appUrls:{appDetail:u=ys.appDetail}=ys,apiUrls:{apiSchemaGet:d=Be.apiSchemaGet,apiDataGet:x=Be.apiDataGet,apiItemPost:p=Be.apiItemPost,apiItemDelete:E=Be.apiItemDelete,apiItemCreate:m=Be.apiItemCreate,apiExportGet:h=Be.apiExportGet}=Be,customPickers:g})=>{var ee,te,fe,Re,ve,Pe;const{texts:{dynamicForms:j},ProjectIconComponent:f}=i.useContext(e.LuminusComponentsContext),b=e.useAxios(),{startLoading:y,stopLoading:v}=i.useContext(e.LoadingContext),[R,_]=i.useState(null),[D,S]=i.useState(null),[I,F]=i.useState(null),[L,A]=i.useState(null),[C,U]=i.useState(!1),{addNotification:G}=e.useNotifications(),[w,N]=i.useState([]),{confirm:M}=e.useConfirm(),V=20,K=V+1,P=L?Math.ceil(L.length/V):1,W=s?s>1:!1,Z=s?s<P:!1,q=s?(s-1)*V:0,$=s?s*V:V,Y=i.useMemo(()=>L?L.length>K:!1,[L,K]),B=i.useMemo(()=>Y?(L==null?void 0:L.slice(q,$))??null:L??null,[Y,L,q,$]),[z,ae]=i.useState(null);i.useEffect(()=>{_(null),S(null),U(!1),N([]),ae(null)},[t]);const Ne=i.useCallback(async()=>{y("dynamicFormSchema"),await b.get(`${d}?id=${t}`).then(({data:H})=>{_(H),v("dynamicFormSchema")}).catch(()=>v("dynamicFormSchema"))},[b,t,y,v,d]),Ee=i.useCallback(async()=>{var H;if(!(R===null||((H=R.id)==null?void 0:H.toString())!==t)){if(R.masterReference&&!z){S([]);return}y("dynamicFormData"),await b.get(`${x}?id=${t}&showArchive=${C}${R.masterReference?`&master=${z}`:""}`).then(({data:se})=>{const ie=se.map(ne=>{var le;return Object.fromEntries(((le=R.columns)==null?void 0:le.filter(ue=>ue.field).map(ue=>[ue.field,{value:ne[ue.field??""],defaultValue:ne[ue.field??""]}]))??[])});S(ie),v("dynamicFormData")}).catch(()=>v("dynamicFormData"))}},[b,t,R,y,v,C,z,x]),_e=i.useCallback(async()=>{var H;R===null||((H=R.id)==null?void 0:H.toString())!==t||R.masterReference&&!z||(y("dynamicFormExport"),await b.get(`${h}?id=${t}&showArchive=${C}${R.masterReference?`&master=${z}`:""}`,{responseType:"blob"}).then(se=>e.saveFileFromResponse(se,{fallbackName:`export-${t}`})).finally(()=>v("dynamicFormExport")))},[b,t,R,y,v,C,z,h]),me=i.useCallback(async H=>(y("dynamicFormEdit"),b.post(`${p}?id=${t}`,H).then(()=>(v("dynamicFormEdit"),N([]),!0)).catch(se=>(v("dynamicFormEdit"),N(e.extractErrorsFromResponse(se)),!1))),[b,t,y,v,p]),Q=i.useCallback(async H=>(y("dynamicFormDelete"),b.delete(`${E}?id=${t}&pk=${H}`).then(()=>(v("dynamicFormDelete"),N([]),!0)).catch(se=>(v("dynamicFormDelete"),N(e.extractErrorsFromResponse(se)),!1))),[b,t,y,v,E]),xe=i.useCallback(async H=>(y("dynamicFormCreate"),b.post(`${m}?id=${t}`,H).then(({data:se})=>(v("dynamicFormCreate"),N([]),se)).catch(se=>(v("dynamicFormCreate"),N(e.extractErrorsFromResponse(se)),null))),[b,t,y,v,m]),be=i.useCallback(async H=>{R&&await me(R.masterReference?{...H,[R.masterReferenceColumn??""]:z}:H)&&(G(j.editSuccess,"success"),S(se=>se&&se.map(ie=>{var ne;return((ne=ie[(R==null?void 0:R.primaryKey)??""])==null?void 0:ne.value)===H[(R==null?void 0:R.primaryKey)??""]?Rs(H,R):ie})))},[G,me,R,z,j]),k=i.useCallback(async H=>{await M(j.deleteConfirm)&&await Q(H)&&(G(j.deleteSuccess,"success"),S(se=>se&&se.filter(ie=>{var ne;return((ne=ie[(R==null?void 0:R.primaryKey)??""])==null?void 0:ne.value)!==H})))},[G,Q,j,M,R]),T=i.useCallback(async H=>{if(!R)return!1;const se=await xe(R.masterReference?{...H,[R.masterReferenceColumn??""]:z}:H);if(se!==null){G(j.createSuccess,"success");const ie=Rs(H,R);return ie[(R==null?void 0:R.primaryKey)??""]={value:se,defaultValue:se},S(ne=>[...ne??[],ie]),!0}return!1},[G,xe,j,R,z]),O=H=>{H>P?n(P):H<1&&n(1),n(H)},J=i.useCallback(()=>{if(!D||!R){F(null);return}const H=D.filter(se=>Object.entries(r).every(([ie,ne])=>{var Ke,Ye,qe;if(ne===null)return!0;const le=(Ke=se[ie])==null?void 0:Ke.value;if(le==null)return!1;const ue=(Ye=R.columns)==null?void 0:Ye.find(it=>it.field===ie),Ue=ue==null?void 0:ue.type,Ge=(ue==null?void 0:ue.values)&&((qe=ue==null?void 0:ue.values)==null?void 0:qe.length)>0;if(!Ue)return!1;switch(Ue){case"STR":return Ge?le===ne:le.toString().toLowerCase().includes(ne.toLowerCase());case"NUM":return Ge?Number(le)===Number(ne):le.toString().toLowerCase().includes(ne.toLowerCase());case"DT":return le.toString().toLowerCase().includes(ne.toLowerCase());case"BIT":return Number(le)===Number(ne);default:return le.toString().toLowerCase().includes(ne.toLowerCase())}}));F(H)},[D,r,R]),ce=i.useCallback(()=>{if(!I||!R){A([]);return}if(!a){A(I);return}A([...I].sort((H,se)=>{var Ue,Ge,Ke,Ye,qe,it;const ie=((Ge=(Ue=H[a])==null?void 0:Ue.value)==null?void 0:Ge.toString())??"",ne=((Ye=(Ke=se[a])==null?void 0:Ke.value)==null?void 0:Ye.toString())??"",le=R.columns.find(we=>we.field===a),ue=le==null?void 0:le.type;if(!le||!ue||!ie&&!ne)return 0;if(!ie)return 1;if(!ne)return-1;if(le.values&&le.values.length>0){const we=((qe=le.values.find(ht=>{var Qe;return((Qe=ht.id)==null?void 0:Qe.toString())===ie}))==null?void 0:qe.name)??"",Ie=((it=le.values.find(ht=>{var Qe;return((Qe=ht.id)==null?void 0:Qe.toString())===ne}))==null?void 0:it.name)??"";return l==="asc"?we.localeCompare(Ie):Ie.localeCompare(we)}if(ue==="NUM"){const we=Number(ie),Ie=Number(ne);return l==="asc"?we-Ie:Ie-we}if(ue==="DT"){const we=e.parseISO(ie==null?void 0:ie.toString()).getTime(),Ie=e.parseISO(ne==null?void 0:ne.toString()).getTime();return l==="asc"?we-Ie:Ie-we}return l==="asc"?ie.toString().localeCompare(ne.toString()):ne.toString().localeCompare(ie.toString())}))},[I,R,a,l]);return i.useEffect(()=>{Ne()},[Ne]),i.useEffect(()=>{Ee()},[Ee]),i.useEffect(()=>{J()},[J]),i.useEffect(()=>{ce()},[ce]),i.useEffect(()=>{Y?s||n(1):L&&n(null)},[L,Y,s,n]),i.useEffect(()=>{!Y||!s||(s>P&&n(P),s<1&&n(1))},[s,Y,P,n]),e.jsxRuntimeExports.jsxs("div",{className:"h-100 w-100 d-flex flex-column",children:[e.jsxRuntimeExports.jsxs("div",{className:"mb-3 d-flex justify-content-between align-items-center",children:[e.jsxRuntimeExports.jsx(e.Typography,{variant:"h3",children:(R==null?void 0:R.name)??""}),e.jsxRuntimeExports.jsxs(e.Dropdown,{toggle:e.jsxRuntimeExports.jsx(e.DropdownToggle,{as:e.SimpleDropdownToggle}),children:[e.jsxRuntimeExports.jsx(e.DropdownItem,{onClick:()=>U(!C),children:C?j.hideArchived:j.showArchived}),e.jsxRuntimeExports.jsx(Vt,{}),e.jsxRuntimeExports.jsx(e.DropdownItem,{onClick:_e,icon:e.jsxRuntimeExports.jsx(f,{icon:"file-download"}),children:j.downloadExport})]})]}),(R==null?void 0:R.description)&&e.jsxRuntimeExports.jsx(e.Typography,{variant:"body2",className:"mb-3",children:R==null?void 0:R.description}),(R==null?void 0:R.masterReference)&&e.jsxRuntimeExports.jsx("div",{className:"mb-3 d-flex",children:e.jsxRuntimeExports.jsx($i,{label:((te=(ee=R.columns)==null?void 0:ee.find(H=>H.field===R.masterReferenceColumn))==null?void 0:te.caption)??"",options:((Re=(fe=R.columns)==null?void 0:fe.find(H=>H.field===R.masterReferenceColumn))==null?void 0:Re.values)??[],master:z,onChange:H=>ae(H)})}),(R==null?void 0:R.slaves)&&R.slaves.length>0&&e.jsxRuntimeExports.jsx("div",{className:"mb-3 d-flex align-items-center flex-start gap-1",children:R.slaves.map(H=>{var se;return e.jsxRuntimeExports.jsx(e.ContextButton,{as:"link",href:`${oe.generatePath(u,{id:(se=H.id)==null?void 0:se.toString()})}?type=dynamic-form`,children:H.name},H.id)})}),R!=null&&R.masterReference&&!z?e.jsxRuntimeExports.jsx(at,{variant:"warning",children:j.selectMaster(((Pe=(ve=R.columns)==null?void 0:ve.find(H=>H.field===R.masterReferenceColumn))==null?void 0:Pe.caption)??"").toLowerCase()}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[R&&w.length>0&&e.jsxRuntimeExports.jsx("div",{className:"mb-2",children:e.jsxRuntimeExports.jsx(mi,{errors:w,schema:R})}),R&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("rounded border overflow-auto",vs.tableContainer),children:e.jsxRuntimeExports.jsx(Fi,{schema:R,items:!Y&&L&&(L==null?void 0:L.length)>K?[]:(Y?B:L)??[],onEditItem:be,onDeleteItem:k,onCreateItem:T,filters:r,setFilter:o,sortByField:a,sortByType:l,setSortBy:c,selectedMaster:(z==null?void 0:z.toString())??null,customPickers:g})}),Y&&s&&e.jsxRuntimeExports.jsxs("div",{className:e.classNames(vs.pagination,"d-flex align-items-center gap-3 p-1 border-bottom border-start border-end rounded"),children:[e.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center gap-1",children:[e.jsxRuntimeExports.jsx(e.IconButton,{color:"primary",onClick:()=>O(1),disabled:!W,children:e.jsxRuntimeExports.jsx(f,{icon:"chevron-double-left"})}),e.jsxRuntimeExports.jsx(e.IconButton,{color:"primary",onClick:()=>O(s-1),disabled:!W,children:e.jsxRuntimeExports.jsx(f,{icon:"chevron-left"})}),e.jsxRuntimeExports.jsx(e.IconButton,{color:"primary",onClick:()=>O(s+1),disabled:!Z,children:e.jsxRuntimeExports.jsx(f,{icon:"chevron-right"})}),e.jsxRuntimeExports.jsx(e.IconButton,{color:"primary",onClick:()=>O(P),disabled:!Z,children:e.jsxRuntimeExports.jsx(f,{icon:"chevron-double-right"})})]}),e.jsxRuntimeExports.jsxs(e.Typography,{variant:"body",children:[j.tablePage," ",s," ",j.tablePageFrom," ",P]})]})]})]})]})},bs={appDetail:"/settings/:id"},ws={apiDynamicFormsGet:"/dynamicForms"},Oi=({item:t,children:s})=>t.description?e.jsxRuntimeExports.jsx(e.SimpleTooltip,{placement:"left",text:t.description??"",children:e.jsxRuntimeExports.jsx("div",{children:s})}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:s}),Ai=({activeId:t,otherForms:s=[],groupsDefs:n=[],searchQuery:r,fullSize:o,appUrls:{appDetail:a=bs.appDetail}=bs,apiUrls:{apiDynamicFormsGet:l=ws.apiDynamicFormsGet}=ws})=>{const c=e.useAxios(),{startLoading:u,stopLoading:d}=i.useContext(e.LoadingContext),[x,p]=i.useState(null),[E]=Ae.useSearchQueryState("search",""),m=i.useMemo(()=>[...(x==null?void 0:x.map(j=>({...j,type:"dynamic-form"})))??[],...s].filter(j=>pe.stringSearchWithin(j.name,r)||pe.stringSearchWithin(j.description,r)).sort((j,f)=>(j.name??"").localeCompare(f.name??""))??[],[x,s,r]),h=i.useMemo(()=>n.map(j=>({id:j.id,name:j.name??"",items:m.filter(f=>f.group===j.id)})).filter(j=>j.items.length>0),[n,m]),g=i.useCallback(async()=>{u("dynamicForms"),await c.get(l).then(({data:j})=>{p(j),d("dynamicForms")}).catch(()=>d("dynamicForms"))},[c,u,d,l]);return i.useEffect(()=>{!x&&g()},[g,x]),m.length>0?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx("div",{className:"w-auto list-group forms-items overflow-x-hidden",children:h.map(j=>e.jsxRuntimeExports.jsx(et,{title:j.name,defaultOpen:!0,children:j.items.map(f=>{var b,y,v,R;return o?e.jsxRuntimeExports.jsxs(oe.Link,{to:`${oe.generatePath(a,{id:(b=f.id)==null?void 0:b.toString()})}?type=${f.type}&search=${E??""}`,className:`text-nowrap list-group-item list-group-item-action ${(t==null?void 0:t.toString())===((y=f.id)==null?void 0:y.toString())?"active":""}`,children:[e.jsxRuntimeExports.jsx(e.Typography,{variant:"body",children:f.name}),f.description&&e.jsxRuntimeExports.jsx(e.Typography,{variant:"body2",className:"text-muted mt-2",children:f.description})]},f.id):e.jsxRuntimeExports.jsx(Oi,{item:f,children:e.jsxRuntimeExports.jsx(oe.Link,{to:`${oe.generatePath(a,{id:(v=f.id)==null?void 0:v.toString()})}?type=${f.type}&search=${E??""}`,className:`text-nowrap list-group-item list-group-item-action ${(t==null?void 0:t.toString())===((R=f.id)==null?void 0:R.toString())?"active":""}`,children:e.jsxRuntimeExports.jsx(e.Typography,{variant:"body2",children:f.name})})},f.id)})},j.id))})}):null},Pi=({label:t,to:s,value:n})=>e.jsxRuntimeExports.jsxs(e.RowLabelInput,{label:t,children:[e.jsxRuntimeExports.jsx("input",{disabled:!0,className:"form-control d-none"}),s?e.jsxRuntimeExports.jsx(oe.Link,{to:s,className:"border-bottom luminus-dropdown-picker-link form-control d-flex justify-content-end align-items-center",children:n}):e.jsxRuntimeExports.jsx("div",{className:"luminus-dropdown-picker-link form-control d-flex justify-content-end align-items-center",children:n})]}),Vi=()=>{const{localizationContext:t}=i.useContext(e.LuminusComponentsContext),{language:s,setLanguage:n}=i.useContext(t),r=o=>{n(o)};return e.jsxRuntimeExports.jsx(e.DropdownItem,{onClick:o=>{r(s==="cz"?"en":s==="en"?"de":"cz"),o.stopPropagation()},children:s==="cz"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("strong",{className:"fw-bold",children:"CZ"}),e.jsxRuntimeExports.jsx(e.MdArrowRight,{}),e.jsxRuntimeExports.jsx("span",{children:"EN"}),e.jsxRuntimeExports.jsx(e.MdArrowRight,{}),e.jsxRuntimeExports.jsx("span",{children:"DE"})]}):s==="en"?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("strong",{className:"fw-bold",children:"EN"}),e.jsxRuntimeExports.jsx(e.MdArrowRight,{}),e.jsxRuntimeExports.jsx("span",{children:"DE"}),e.jsxRuntimeExports.jsx(e.MdArrowRight,{}),e.jsxRuntimeExports.jsx("span",{children:"CZ"})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("strong",{className:"fw-bold",children:"DE"}),e.jsxRuntimeExports.jsx(e.MdArrowRight,{}),e.jsxRuntimeExports.jsx("span",{children:"CZ"}),e.jsxRuntimeExports.jsx(e.MdArrowRight,{}),e.jsxRuntimeExports.jsx("span",{children:"EN"})]})})},zi=({controlId:t,...s})=>e.jsxRuntimeExports.jsx(e.Form.Group,{controlId:t,...s}),Wi=({employeeId:t,alt:s,noPhotoImage:n,cafmApiUrl:r,showLargeInLightBox:o=!1})=>{const{user:a}=i.useContext(e.UserContext),{photoPath:l,photoPathSm:c}=Ae.useEmployeePhotoPath(t);return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:t&&e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:o?e.jsxRuntimeExports.jsx(gn,{baseUrl:r,customToken:a.cafmToken??void 0,photos:[{id:t.toString(),alt:s??"",isDefault:!0,smSrc:c,lgSrc:l}],placeholder:n,ImgComponent:Ft}):e.jsxRuntimeExports.jsx(Ft,{baseUrl:r,customToken:a.cafmToken??void 0,src:c,alt:s,placeholder:n,className:"rounded w-100"})})})},Hi=({text:t,setText:s,onSearchButtonClick:n,className:r})=>{const o=a=>{s(a)};return e.jsxRuntimeExports.jsxs(ut,{className:`${r}`,children:[e.jsxRuntimeExports.jsx(e.Form.Control,{value:t,onChange:a=>s(a.target.value)}),t&&e.jsxRuntimeExports.jsx(e.Button$1,{onClick:()=>o(""),variant:"link",className:"border text-muted",children:e.jsxRuntimeExports.jsx(e.MdClear,{})}),e.jsxRuntimeExports.jsx(e.Button$1,{onClick:()=>n&&n(t),variant:"link",className:"border",children:e.jsxRuntimeExports.jsx(e.MdSearch,{})})]})},Ui=({value:t,numberPrefix:s,numberSuffix:n,decimalScale:r=2,fixedDecimalScale:o=!1,className:a})=>e.jsxRuntimeExports.jsx(Gt,{value:t,displayType:"text",thousandSeparator:" ",decimalScale:r,fixedDecimalScale:o,defaultValue:"",prefix:s,suffix:n,className:a,decimalSeparator:","}),Gi=({data:t,keys:s,colors:n,tooltipLabel:r})=>e.jsxRuntimeExports.jsx(e.Re,{data:t.map(o=>({name:o.name,...o.values})),indexBy:"name",keys:s,margin:{top:20,right:50,bottom:30,left:150},layout:"horizontal",colors:n,padding:.2,borderRadius:2,borderWidth:2,borderColor:{from:"color",modifiers:[["darker",.5]]},axisTop:null,axisRight:null,axisBottom:{tickSize:5,tickPadding:5,tickRotation:0},axisLeft:{tickSize:5,tickPadding:5,tickRotation:0},labelSkipWidth:12,labelSkipHeight:12,labelTextColor:{from:"color",modifiers:[["darker",1.6]]},tooltipLabel:r}),Ki="_hrText_xxish_1",Yi={hrText:Ki},Ln=({text:t})=>e.jsxRuntimeExports.jsx("hr",{className:e.classNames(Yi.hrText),"data-content":t}),qi="_cards-group_1gvpy_1",Qi="_group-title_1gvpy_1",Zi="_group-content_1gvpy_8",Xi="_report-card_1gvpy_12",Ji="_card-title-link_1gvpy_22",Ve={"cards-group":"_cards-group_1gvpy_1",cardsGroup:qi,"group-title":"_group-title_1gvpy_1",groupTitle:Qi,"group-content":"_group-content_1gvpy_8",groupContent:Zi,"report-card":"_report-card_1gvpy_12",reportCard:Xi,"card-title-link":"_card-title-link_1gvpy_22",cardTitleLink:Ji},el=({reportsLastUsedGet:t,getReportRoute:s,getReportName:n})=>{const{texts:{reports:r}}=i.useContext(e.LuminusComponentsContext),{data:o}=Je.useGetApiData(t);return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(et,{defaultOpen:!0,title:r.index.lastUsedReports,children:e.jsxRuntimeExports.jsx(tn,{children:o&&o.map(a=>a.versions.map(l=>e.jsxRuntimeExports.jsxs(rt,{as:oe.Link,to:s(a,l.id),className:"p-1 px-2",action:!0,children:[e.jsxRuntimeExports.jsx(e.Typography,{variant:"body2",className:"text-uppercase",children:n(a)}),e.jsxRuntimeExports.jsxs(e.Typography,{variant:"caption",className:"d-flex justify-content-between align-items-center gap-3 text-dark",children:[l.name,e.jsxRuntimeExports.jsx(e.Typography,{variant:"caption",className:"text-end opacity-50",children:e.formatDate(l.lastUsedDate)})]})]})))})})})},Ct={reportsGet:"/reports",reportsLastUsedGet:"/reports/last-used"},tl=({groups:t,apiUrls:{reportsGet:s=Ct.reportsGet,reportsLastUsedGet:n=Ct.reportsLastUsedGet}=Ct,getReportName:r,getReportDescription:o,getGroupTitle:a,getReportRoute:l})=>{const{texts:{reports:c}}=i.useContext(e.LuminusComponentsContext),[u,d]=i.useState(""),[x]=pt(u,500),p=i.useCallback(j=>j.map(f=>({...f,groupId:!f.groupId||f.groupId===0||!t.some(b=>b===f.groupId)?999:f.groupId})),[t]),{data:E}=Je.useGetApiData(s,{dataTransformer:p}),m=i.useMemo(()=>{if(E===null)return{};const j={};return t.forEach(f=>{j[f]=E.filter(b=>b.groupId===f&&(pe.stringSearchWithin(r(b),x)||pe.stringSearchWithin(o(b),x)||b.versions.some(y=>pe.stringSearchWithin(y.name,x))))}),j},[x,t,E,o,r]),h=i.useMemo(()=>t.filter(j=>{var f;return((f=m[j])==null?void 0:f.length)>0}),[m,t]),{isMobile:g}=He.useWindowSize();return e.jsxRuntimeExports.jsxs(e.PageContainer,{variant:"fullScreen",sideContent:e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(el,{reportsLastUsedGet:n,getReportName:r,getReportRoute:l})}),children:[e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(e.Form.Control,{className:"mb-3",type:"search",value:u,onChange:j=>{var f;return d(((f=j.target)==null?void 0:f.value)??"")},placeholder:c.index.search})}),e.jsxRuntimeExports.jsx("div",{className:"overflow-x-hidden luminus-thin-scrollbar luminus-reports-index",children:h.map(j=>e.jsxRuntimeExports.jsxs("div",{className:e.classNames(Ve.cardsGroup,{[Ve.mobile]:g}),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("group-title",Ve.groupTitle),children:e.jsxRuntimeExports.jsx(Ln,{text:a(j)})}),e.jsxRuntimeExports.jsx("div",{className:e.classNames(Ve.groupContent),children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("row gx-3 gy-3"),children:m[j].map(f=>e.jsxRuntimeExports.jsx("div",{className:"col-12 col-lg-4",children:e.jsxRuntimeExports.jsxs(zt,{title:e.jsxRuntimeExports.jsx(oe.Link,{to:l(f),className:e.classNames(Ve.cardTitleLink,"w-100 text-uppercase fw-normal"),children:r(f)}),headerClassName:"bg-darker",className:e.classNames(Ve.reportCard,"shadow h-100 d-flex flex-column"),contentClassName:"d-flex flex-column gap-2 h-100",children:[e.jsxRuntimeExports.jsx(e.Typography,{variant:"body2",className:"px-2",children:o(f)}),e.jsxRuntimeExports.jsx("div",{className:"h-100 d-flex flex-column justify-content-center",children:f.versions&&f.versions.length>0?e.jsxRuntimeExports.jsx("div",{className:"list-group",children:f.versions.map(b=>e.jsxRuntimeExports.jsx(rt,{as:oe.Link,to:l(f,b.id),className:"p-1 px-2",action:!0,children:e.jsxRuntimeExports.jsxs(e.Typography,{variant:"body2",className:"d-flex justify-content-between align-items-center gap-3",children:[e.jsxRuntimeExports.jsx("div",{className:"link",children:b.name}),e.jsxRuntimeExports.jsx(e.Typography,{variant:"caption",className:"text-end opacity-50",children:e.formatDate(b.lastUsedDate)})]})}))}):null})]})},f.id))})})]},j))})]})},sl="_mini-detail-popover_obryf_1",nl="_sm_obryf_5",rl="_lg_obryf_9",Cs={"mini-detail-popover":"_mini-detail-popover_obryf_1",miniDetailPopover:sl,sm:nl,lg:rl},ol=({children:t,useMiniDetail:s,miniDetailProps:n,placement:r="bottom",trigger:o=["hover"],delayMs:a=500})=>{const[l,c]=i.useState(!1),{isLoading:u,detail:d,heading:x,tooltipWidth:p}=s({...n,enabled:l}),E=i.useRef(null);return e.jsxRuntimeExports.jsx("div",{onMouseEnter:()=>{E.current=window.setTimeout(()=>c(!0),a)},onMouseLeave:()=>{E.current&&clearTimeout(E.current),c(!1)},children:l?e.jsxRuntimeExports.jsx(e.HtmlTooltip,{heading:u?e.jsxRuntimeExports.jsx(e.Typography,{variant:"body2",className:"placeholder-glow",children:e.jsxRuntimeExports.jsx("span",{className:"placeholder bg-primary col-6"})}):x,content:e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:u?e.jsxRuntimeExports.jsxs(e.Typography,{variant:"body2",className:"placeholder-glow",children:[e.jsxRuntimeExports.jsxs("div",{className:"d-flex justify-content-between py-1",children:[e.jsxRuntimeExports.jsx("span",{className:"placeholder col-5"}),e.jsxRuntimeExports.jsx("span",{className:"placeholder col-4"})]}),e.jsxRuntimeExports.jsxs("div",{className:"d-flex justify-content-between py-1",children:[e.jsxRuntimeExports.jsx("span",{className:"placeholder col-3"}),e.jsxRuntimeExports.jsx("span",{className:"placeholder col-2"})]}),e.jsxRuntimeExports.jsxs("div",{className:"d-flex justify-content-between py-1",children:[e.jsxRuntimeExports.jsx("span",{className:"placeholder col-4"}),e.jsxRuntimeExports.jsx("span",{className:"placeholder col-6"})]}),e.jsxRuntimeExports.jsxs("div",{className:"d-flex justify-content-between py-1",children:[e.jsxRuntimeExports.jsx("span",{className:"placeholder col-4"}),e.jsxRuntimeExports.jsx("span",{className:"placeholder col-3"})]}),e.jsxRuntimeExports.jsxs("div",{className:"d-flex justify-content-between py-1",children:[e.jsxRuntimeExports.jsx("span",{className:"placeholder col-5"}),e.jsxRuntimeExports.jsx("span",{className:"placeholder col-4"})]})]}):d}),placement:r,trigger:o,popoverClassName:e.classNames(Cs.miniDetailPopover,Cs[p]),children:e.jsxRuntimeExports.jsx("div",{children:t})}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:t})})},al=({label:t,value:s})=>e.jsxRuntimeExports.jsxs("div",{className:"py-1 border-bottom d-flex gap-3 align-items-center justify-content-between",children:[e.jsxRuntimeExports.jsx(e.Typography,{variant:"caption",children:t}),e.jsxRuntimeExports.jsx(e.Typography,{variant:"body2",className:"text-end",children:s??"-"})]}),il=({InputContainer:t=e.RowLabelInput,formField:s,label:n,resetsFields:r,type:o,required:a,hidden:l,disabled:c,withoutLabel:u,hint:d,onChange:x,className:p})=>{const{register:E,formState:m,setValue:h}=ye.useFormContext(),[g,j]=i.useState(void 0),[f,b]=i.useState(!1);i.useEffect(()=>{const v=s.split(".");let R=m.errors;v.forEach(_=>{R!==void 0&&(R=R[_])}),j(R)},[m,s]),i.useEffect(()=>{m.isSubmitted&&b(!0)},[m]);const y=g!==void 0;return e.jsxRuntimeExports.jsxs(t,{isForCheckInput:!0,hidden:l,label:`${n}${a?" *":""}`,isInvalid:y,withoutLabel:u,hint:d,className:p,children:[e.jsxRuntimeExports.jsx(e.Form.Check,{id:`check-${s}`,type:o??"checkbox",label:`${n}${a?" *":""}`,...E(s,{onChange:v=>{r&&r.forEach(R=>h(R,null,{shouldDirty:!0,shouldValidate:f})),x&&x(v.target.value??null)}}),isInvalid:y,hidden:l,disabled:c||m.disabled,className:"w-100"}),g&&e.jsxRuntimeExports.jsx(e.InvalidFeedback,{message:g.message})]})},ll=({InputContainer:t=e.RowLabelInput,label:s,formField:n,options:r,resetsFields:o,required:a,disabled:l,hidden:c,onChange:u,className:d})=>{const{register:x,formState:p,setValue:E,watch:m}=ye.useFormContext(),[h,g]=i.useState(void 0),[j,f]=i.useState(!1),b=i.useMemo(()=>r,[r]);i.useEffect(()=>{const v=n.split(".");let R=p.errors;v.forEach(_=>{R!==void 0&&(R=R[_])}),g(R)},[p,n]),i.useEffect(()=>{p.isSubmitted&&f(!0)},[p]);const y=h!==void 0;return e.jsxRuntimeExports.jsxs(t,{isForRadioInput:!0,hidden:c,withoutLabel:!s,label:`${s}${a?" *":""}`,isInvalid:y,className:d,children:[b.map(v=>e.jsxRuntimeExports.jsx(e.Form.Check,{id:`radio-${v.id}`,label:v.name,type:"radio",value:v.id??"",checked:m(n)===v.id,...x(n,{onChange:R=>{var _;o&&o.forEach(D=>E(D,null,{shouldDirty:!0,shouldValidate:j})),u&&u((_=R.target)!=null&&_.value?R.target.value.toString():null)}}),isInvalid:y,hidden:c,disabled:l||p.disabled,className:"w-100"},v.id)),h&&e.jsxRuntimeExports.jsx(e.InvalidFeedback,{message:h.message})]})},cl=({InputContainer:t=e.RowLabelInput,formField:s,label:n,size:r,defaultSelection:o,resetsFields:a,isNumber:l,required:c,hidden:u,disabled:d,items:x,onSearchQueryChange:p,selectedItemNavigateTo:E,texts:m,dropdownItemsNameWidth:h,isLoading:g,withoutLabel:j,additionalColumns:f,CustomOnChangeComponent:b,icon:y,displayIdAsName:v,onSelect:R,className:_,archiveColumn:D,hint:S,addNewOptionPath:I,refreshOptions:F,MiniDetailComponent:L})=>{const{formState:A,setValue:C,watch:U,control:G}=ye.useFormContext(),[w,N]=i.useState(void 0),[M,V]=i.useState(!1),[K,P]=i.useState(!1),W=U(s)??null,Z=W===(o==null?void 0:o.id)?o==null?void 0:o.name:U(`${s}-DropdownName`),q=i.useMemo(()=>W==null?null:{id:W??null,name:Z??""},[W,Z]),$=i.useCallback(()=>{const Q=s.split(".");let xe=A.errors;Q.forEach(be=>{xe!==void 0&&(xe=xe[be])}),N(xe)},[A,s]),Y=i.useCallback(Q=>{if((Q==null?void 0:Q.id)===W)return;if(R&&R(Q),a&&a.forEach(be=>C(be,null,{shouldDirty:!0,shouldValidate:K})),Q===null){C(s,null,{shouldDirty:!0,shouldValidate:K}),C(`${s}-DropdownName`,null);return}let xe=null;l?xe=(Q==null?void 0:Q.id)!==null&&(Q==null?void 0:Q.id)!==""?parseInt(Q.id.toString(),10):null:xe=Q.id===null||Q.id===void 0||Q.id===""?null:Q.id,C(s,xe,{shouldDirty:!0,shouldValidate:K}),C(`${s}-DropdownName`,Q.name??"")},[C,s,K,l,a,W,R]),B=i.useCallback(Q=>{V(!1),Y(Q)},[Y]),z=i.useCallback(()=>{V(!1)},[]);i.useEffect(()=>{$()},[$]),i.useEffect(()=>{A.isSubmitted&&P(!0)},[A]);const ae=i.useRef(null),Ne=w!==void 0,Ee=E!==void 0,_e=Ee&&q!==null,me=d||A.disabled;return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(t,{label:`${n}${c?" *":""}`,hidden:u,withoutLabel:j,isInvalid:Ne,inputContainerClassName:e.classNames({"luminus-dropdown-select-open":M}),hint:S,className:_,children:[e.jsxRuntimeExports.jsxs(vn,{currentSelection:q,selectedItemNavigateTo:E,children:[v&&(q==null?void 0:q.name)&&e.jsxRuntimeExports.jsx(e.Typography,{variant:"caption",className:"d-flex justify-content-end mt-2 luminus-dropdown-selection-name",children:q.name}),e.jsxRuntimeExports.jsx(ye.Controller,{control:G,name:s,render:()=>e.jsxRuntimeExports.jsx(ft,{value:W,MiniDetailComponent:L,children:e.jsxRuntimeExports.jsx(e.Form.Select,{size:r,onMouseDown:Q=>{Q.currentTarget.focus(),Q.preventDefault()},onClick:()=>{!Ee&&!me&&V(!0)},ref:ae,value:W??"",onChange:()=>{},isInvalid:Ne,hidden:u,className:e.classNames("w-100",{"luminus-dropdown-picker-disabled":me,"luminus-dropdown-picker-link":_e}),children:e.jsxRuntimeExports.jsx("option",{value:W,children:v?W:(Z==null?void 0:Z.length)>0?Z:W})})})}),b||!me&&Ee?e.jsxRuntimeExports.jsxs("div",{className:"custom-picker-button",children:[!b&&!me&&Ee&&e.jsxRuntimeExports.jsx(e.IconButton,{size:"sm",color:"secondary",onClick:Q=>{Q.preventDefault(),Q.stopPropagation(),V(!0)},children:y??e.jsxRuntimeExports.jsx(e.MdOutlineEdit,{})}),b??null]}):null]}),w&&e.jsxRuntimeExports.jsx(e.InvalidFeedback,{message:w.message}),ae.current&&e.jsxRuntimeExports.jsx(ot,{show:M,onCancel:z,items:x,currentSelection:q,onSelectionChange:B,onSearchQueryChange:p,texts:m,itemsNameWidth:h,additionalColumns:f,displayIdAsName:v,isLoading:g,disabled:me,inputRef:ae,archiveColumn:D,addNewOptionPath:I,refreshOptions:F})]})})},ul=({InputContainer:t=e.RowLabelInput,label:s,formField:n,hidden:r,required:o,placeholder:a,disabled:l,showClearIcon:c,resetsFields:u,multiple:d,accept:x,withoutLabel:p,hint:E,className:m})=>{const{watch:h,setValue:g,register:j,formState:f}=ye.useFormContext(),[b,y]=i.useState(!1),[v,R]=i.useState(void 0),_=i.useCallback(()=>{g(n,"")},[g,n]),D=i.useCallback(()=>{const I=n.split(".");let F=f.errors;I.forEach(L=>{F!==void 0&&(F=F[L])}),R(F)},[f,n]);i.useEffect(D,[D]),i.useEffect(()=>{f.isSubmitted&&y(!0)},[f]);const S=v!==void 0;return e.jsxRuntimeExports.jsxs(t,{label:`${s}${o?"*":""}`,hidden:r,withoutLabel:p,isInvalid:S,hint:E,className:m,children:[e.jsxRuntimeExports.jsx(e.FormControl,{type:"file",multiple:d,accept:x.join(", "),placeholder:a??s,isInvalid:S,hidden:r,disabled:l||f.disabled,className:"w-100",...j(n,{onChange:()=>{u&&u.forEach(I=>g(I,null,{shouldDirty:!0,shouldValidate:b}))}})}),c&&h(n)&&e.jsxRuntimeExports.jsx("div",{className:"luminus-input-remove-icon",children:e.jsxRuntimeExports.jsx(e.IconButton,{color:"secondary",size:"sm",onClick:_,children:e.jsxRuntimeExports.jsx(e.MdClear,{})})}),v&&e.jsxRuntimeExports.jsx(e.InvalidFeedback,{message:v.message})]})},dl=({children:t,onStorno:s,noSpacer:n})=>{const{formState:r}=ye.useFormContext(),[o,a]=i.useState(!1);return i.useEffect(()=>{a(Object.keys(r.dirtyFields).length>0)},[r]),o?e.jsxRuntimeExports.jsx(dn,{onStorno:s,noSpacer:n,disabled:r.disabled,children:t}):null},xl=({InputContainer:t=e.RowLabelInput,options:s,formField:n,label:r,size:o,resetsFields:a,isNumber:l,required:c,hidden:u,disabled:d,withoutLabel:x,noSortOptions:p,suffixIdToName:E,onSelect:m,className:h,appendCurrentSelectionWithName:g,hint:j,addNewOptionPath:f,refreshOptions:b,MiniDetailComponent:y})=>{const{texts:{customSelect:v}}=i.useContext(e.LuminusComponentsContext),{formState:R,setValue:_,watch:D,control:S}=ye.useFormContext(),[I,F]=i.useState(void 0),[L,A]=i.useState(!1),[C,U]=i.useState(!1),[G,w]=i.useState(""),N=D(n),M=i.useMemo(()=>s.find(B=>B.id===N)??null,[s,N]),V=i.useCallback(()=>{const B=n.split(".");let z=R.errors;B.forEach(ae=>{z!==void 0&&(z=z[ae])}),F(z)},[R,n]),K=i.useCallback(B=>{if((B==null?void 0:B.id)===N)return;if(m&&m(B),a&&a.forEach(ae=>_(ae,null,{shouldDirty:!0,shouldValidate:C})),B===null){_(n,null,{shouldDirty:!0,shouldValidate:C});return}let z=null;l?z=(B==null?void 0:B.id)!==null&&(B==null?void 0:B.id)!==""?parseInt(B.id.toString(),10):null:z=B.id===null||B.id===void 0||B.id===""?null:B.id,_(n,z,{shouldDirty:!0,shouldValidate:C})},[_,n,l,a,N,C,m]),P=i.useCallback(B=>{A(!1),K(B)},[K]),W=i.useCallback(B=>{w(B)},[]);i.useEffect(()=>{V()},[V]),i.useEffect(()=>{R.isSubmitted&&U(!0)},[R]);const Z=i.useCallback(B=>{var z;return B===null?"":!B.name||B.name.length===0?((z=B.id)==null?void 0:z.toString())??"":E?`${B.name} (${B.id})`:B.name},[E]),q=i.useMemo(()=>{const B=s??[];return g!==void 0&&N&&(B.some(z=>z.id===N)||B.push({id:N,name:g})),B.map(z=>({id:z.id,name:Z(z)})).filter(z=>pe.stringSearchWithin(z.name,G)).sort((z,ae)=>p?0:(z.name??"").localeCompare(ae.name??""))},[s,p,G,Z,g,N]),$=i.useRef(null),Y=I!==void 0;return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs(t,{label:`${r}${c?" *":""}`,hidden:u,withoutLabel:x,isInvalid:Y,inputContainerClassName:e.classNames({"luminus-dropdown-select-open":L}),hint:j,className:h,children:[e.jsxRuntimeExports.jsx(ye.Controller,{control:S,name:n,render:()=>e.jsxRuntimeExports.jsx(ft,{value:N,MiniDetailComponent:y,children:e.jsxRuntimeExports.jsx(e.Form.Select,{size:o,onMouseDown:B=>{B.currentTarget.focus(),B.preventDefault()},onClick:()=>{A(!0)},ref:$,value:N??"",onChange:()=>{},isInvalid:Y,hidden:u,disabled:d,className:"w-100",children:e.jsxRuntimeExports.jsx("option",{value:(M==null?void 0:M.id)??"",children:Z(M)})})})}),I&&e.jsxRuntimeExports.jsx(e.InvalidFeedback,{message:I.message}),$.current&&e.jsxRuntimeExports.jsx(ot,{show:L,onCancel:()=>A(!1),items:q,currentSelection:M??null,onSelectionChange:P,onSearchQueryChange:W,texts:v,disabled:d,inputRef:$,autoHideSearch:!0,allItemsLength:s.length,addNewOptionPath:f,refreshOptions:b})]})})},ml=({InputContainer:t=e.RowLabelInput,formField:s,label:n,placeholder:r,size:o,resetsFields:a,showClearIcon:l,clearValue:c,required:u,hidden:d,disabled:x,withoutLabel:p,step:E,stepperStep:m=1,className:h,min:g,max:j,onChange:f,hint:b})=>{const{register:y,formState:v,setValue:R,watch:_}=ye.useFormContext(),[D,S]=i.useState(void 0),[I,F]=i.useState(!1),L=i.useCallback((w,N,M)=>{R(w,pe.limitNumber(N,g,j),M)},[j,g,R]),A=i.useCallback(()=>{const w=c??null;L(s,w!==null?Number(w):null,{shouldDirty:!0,shouldValidate:I})},[c,L,s,I]),C=i.useCallback(()=>{const w=s.split(".");let N=v.errors;w.forEach(M=>{N!==void 0&&(N=N[M])}),S(N)},[v,s]);i.useEffect(()=>{C()},[C]),i.useEffect(()=>{v.isSubmitted&&F(!0)},[v]);const U=D!==void 0,G=_(s);return e.jsxRuntimeExports.jsxs(t,{label:`${n}${u?" *":""}`,hidden:d,withoutLabel:p,isInvalid:U,hint:b,className:h,children:[e.jsxRuntimeExports.jsxs("div",{className:"luminus-input-container position-relative w-100",children:[e.jsxRuntimeExports.jsx(e.Form.Control,{type:"number",placeholder:r??n,size:o,...y(s,{setValueAs:w=>w==null||w===""?null:pe.limitNumber(Number(w),g,j),min:g,max:j,onChange:w=>{var N;a&&a.forEach(M=>R(M,null,{shouldDirty:!0,shouldValidate:I})),f&&f((N=w.target)!=null&&N.value?Number(w.target.value)??null:null)}}),isInvalid:U,hidden:d,disabled:x||v.disabled,className:"w-100 luminus-numeric-stepper",step:E,min:g,max:j}),e.jsxRuntimeExports.jsx("div",{className:"stepper-icon left",children:!x&&e.jsxRuntimeExports.jsx(e.IconButton,{size:"sm",onClick:w=>{w.preventDefault(),w.stopPropagation(),L(s,((G?Number(G):0)-m).toString(),{shouldDirty:!0,shouldValidate:I})},children:e.jsxRuntimeExports.jsx(e.FaMinus,{})})}),e.jsxRuntimeExports.jsx("div",{className:"stepper-icon right",children:!x&&e.jsxRuntimeExports.jsx(e.IconButton,{size:"sm",onClick:w=>{w.preventDefault(),w.stopPropagation(),L(s,((G?Number(G):0)+m).toString(),{shouldDirty:!0,shouldValidate:I})},children:e.jsxRuntimeExports.jsx(e.FaPlus,{})})})]}),l&&_(s)&&e.jsxRuntimeExports.jsx("div",{className:"luminus-input-remove-icon",children:e.jsxRuntimeExports.jsx(e.IconButton,{color:"secondary",size:"sm",onClick:A,children:e.jsxRuntimeExports.jsx(e.MdClear,{})})}),D&&e.jsxRuntimeExports.jsx(e.InvalidFeedback,{message:D.message})]})},pl=({InputContainer:t=e.RowLabelInput,formField:s,label:n,placeholder:r,resetsFields:o,showClearIcon:a,clearValue:l,required:c,hidden:u,disabled:d,withoutLabel:x,step:p,size:E,CustomOnChangeComponent:m,noSelectOnFocus:h,className:g,decimalScale:j=2,fixedDecimalScale:f=!1,numberPrefix:b,numberSuffix:y,min:v,max:R,onChange:_,hint:D})=>{const{formState:S,setValue:I,watch:F,control:L}=ye.useFormContext(),[A,C]=i.useState(void 0),[U,G]=i.useState(!1),w=i.useCallback(()=>{const K=l??null;I(s,K!==null?Number(K):null,{shouldDirty:!0,shouldValidate:U})},[l,I,s,U]),N=i.useCallback(()=>{const K=s.split(".");let P=S.errors;K.forEach(W=>{P!==void 0&&(P=P[W])}),C(P)},[S,s]);i.useEffect(()=>{N()},[N]),i.useEffect(()=>{S.isSubmitted&&G(!0)},[S]);const M=F(s);i.useEffect(()=>{R!==void 0&&M>R&&I(s,R),v!==void 0&&M<v&&I(s,v)},[s,M,R,v,I]);const V=A!==void 0;return e.jsxRuntimeExports.jsxs(t,{label:`${n}${c?" *":""}`,hidden:u,withoutLabel:x,isInvalid:V,hint:D,className:g,children:[e.jsxRuntimeExports.jsxs("div",{className:"luminus-input-container position-relative w-100",children:[e.jsxRuntimeExports.jsx(ye.Controller,{control:L,name:s,render:({field:{ref:K,onChange:P,name:W,value:Z}})=>e.jsxRuntimeExports.jsx(Gt,{displayType:"input",thousandSeparator:" ",decimalSeparator:",",decimalScale:j,fixedDecimalScale:f,prefix:b,suffix:y,defaultValue:"",name:W,value:Z??"",placeholder:r??n,onFocus:q=>{!h&&q.target.select()},onChange:q=>{var B,z;const $=parseFloat(((z=(B=q.target)==null?void 0:B.value)==null?void 0:z.replaceAll(" ","").replaceAll(",","."))??0);o&&o.forEach(ae=>I(ae,null,{shouldDirty:!0,shouldValidate:U}));const Y=$==null||Number.isNaN($)?null:Number($);P(Y),_&&_(Y)},hidden:u,disabled:d||S.disabled,className:e.classNames("form-control text-end w-100",{"is-invalid":V},{[`form-control-${E}`]:E}),step:p,getInputRef:K,min:v,max:R})}),m&&e.jsxRuntimeExports.jsx("div",{className:"custom-picker-button",children:m})]}),a&&F(s)&&e.jsxRuntimeExports.jsx("div",{className:"luminus-input-remove-icon inset",children:e.jsxRuntimeExports.jsx(e.IconButton,{color:"secondary",size:"sm",onClick:w,children:e.jsxRuntimeExports.jsx(e.MdClear,{})})}),A&&e.jsxRuntimeExports.jsx(e.InvalidFeedback,{message:A.message})]})},Kt=["slice","options","formats","conditions"],Ns=t=>{const s=t.current.flexmonster.getReport({withDefaults:!0});if(typeof s=="string")throw alert("report is string"),new Error("report is string");const n={};return Kt.forEach(r=>{n[r]=s[r]}),JSON.stringify(n)},fl=t=>{if(t.settings){const s=JSON.parse(t.settings);return Kt.forEach(n=>{s[n]===void 0&&(s[n]=null)}),s}return{}},jl=t=>{const s={};return Kt.forEach(n=>{s[n]=(t==null?void 0:t[n])??void 0}),s},_s=(t,s)=>t.hierarchy&&t.hierarchy.uniqueName===s,ks=t=>!t.member&&!t.isDrillThrough,Ss=(t,s)=>typeof t=="function"?t(s):t.replace(":id",s),Fn=({dataSource:t,settings:s,pivotRef:n,localization:r,licenseKey:o,hyperlinkColumn:a,enabled:l=!0})=>{const{texts:{reports:c}}=i.useContext(e.LuminusComponentsContext),[u,d]=i.useState(!1),x=i.useRef(null),p=n??x,E=i.useMemo(()=>({localization:r}),[r]),m=i.useCallback(f=>{delete f[0],delete f[1],delete f[2];const b=[{id:"fm-tab-expand",title:c.expandAll,handler:p.current.flexmonster.expandAllData,icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"/><path fill="none" d="M0 0h24v24H0V0z"/></svg>'},{id:"fm-tab-collapse",title:c.collapseAll,handler:p.current.flexmonster.collapseAllData,icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z"/><path d="M0 0h24v24H0z" fill="none"/></svg>'}];return f.unshift({id:"fm-tab-expand",title:c.expand,icon:'<svg height="42" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d=" M16 4 L28 4 L28 16 L24 12 L20 16 L16 12 L20 8z M4 16 L8 20 L12 16 L16 20 L12 24 L16 28 L4 28z "/></svg>',menu:b,rightGroup:!0}),f},[p,c.collapseAll,c.expand,c.expandAll]),h=f=>{const b=f.getTabs();f.getTabs=()=>m(b)};i.useEffect(()=>{var f;u&&l&&((f=p.current)==null||f.flexmonster.updateData(t),console.log("Updating flexmonster dataSource to: ",t))},[t,l,u,p]),i.useEffect(()=>{var f,b,y;if(u&&l){const{options:v,conditions:R,formats:_,slice:D,...S}=(f=p.current)==null?void 0:f.flexmonster.getReport();if(S===void 0||typeof S=="string")return;const I=jl(s);I.options={...s==null?void 0:s.options,grid:{...(b=s==null?void 0:s.options)==null?void 0:b.grid,autoSwitchToCompact:!1},showFieldListSearch:!0};const F={...S,...I};(y=p.current)==null||y.flexmonster.setReport(F),console.log("Refreshing flexmonster settings. New report: ",F)}},[l,u,p,s]);const g=i.useCallback((f,b)=>{var I;if(!a||!_s(b,a.idColumn)||ks(b))return;const y=(I=b.escapedLabel)==null?void 0:I.toString();if(y===void 0)return;const v=Ss(a.url,y),R="style='color: #00a45a; text-decoration: underline; cursor: pointer;'",_=b.type==="header"?"onclick='event.stopImmediatePropagation()'":"",D=b.isDrillThrough||b.type==="header"?`href='${v}' target='_blank'`:"";f.style&&(f.style["z-index"]=1);const S=`<a ${D} ${R} ${_}>${b.escapedLabel}</a>`;f.text=S},[a]),j=i.useCallback(f=>{if(!a||!_s(f,a.idColumn)||ks(f))return;const b=Ss(a.url,f.escapedLabel??"");window.open(b??"","_blank","noreferrer")},[a]);return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsx(An.Pivot,{ref:p,global:E,licenseKey:o,toolbar:!0,height:"100%",beforetoolbarcreated:h,ready:()=>{d(!0)},width:"100%",customizeCell:g,cellclick:j})})},hl=(t,s,n,r)=>{const{texts:{reports:o}}=i.useContext(e.LuminusComponentsContext),{prompt:a}=e.usePrompt(),{confirm:l}=e.useConfirm(),c=e.useAxios(),{user:u}=i.useContext(e.UserContext),{startLoading:d,stopLoading:x}=i.useContext(e.LoadingContext),{addNotification:p}=e.useNotifications(),E=i.useCallback(async f=>{d("report-versionSavingAs");try{const b=await c.post("/reports/version",f);p(o.saveSuccessful,"success"),await r(b.data)}finally{x("report-versionSavingAs")}},[p,r,c,o.saveSuccessful,d,x]),m=i.useCallback(async()=>{if(n===null){p("none open","warning");return}if(!await l(o.confirmOverwriteSave))return;const b=Ns(s);E({reportSourceName:t,reportVersionId:n,settings:b})},[p,l,s,t,o.confirmOverwriteSave,E,n]),h=i.useCallback(async()=>{const f=await a(o.enterName,{input:"input",required:!0});if(f===null)return;const b=Ns(s);E({reportSourceName:t,name:f,settings:b})},[s,a,t,o.enterName,E]),g=i.useCallback(async()=>{d("report-versionSavingAs");try{await c.post("/reports/version",{reportVersionId:n??void 0,reportSourceName:t,isArchived:!0}),p(o.deleteSuccessful,"success")}finally{x("report-versionSavingAs")}},[p,c,t,o.deleteSuccessful,n,d,x]),j=i.useCallback(async()=>{d("report-versionSavingAs");try{await c.post("/reports/version-restrictions",{reportVersionId:n??void 0,userRestricts:[{employeeId:u.personalNumber,addRights:!1}]}),p(o.detachSuccessful,"success")}finally{x("report-versionSavingAs")}},[p,c,o.detachSuccessful,n,d,x,u.personalNumber]);return{saveAs:h,save:m,archive:g,detach:j}},gl=t=>{const s=e.useAxios(),{startLoading:n,stopLoading:r}=i.useContext(e.LoadingContext);return{changeEmployeeRights:i.useCallback(async(a,l)=>{let c=null;n("reportSharing-addPerson");try{c=(await s.post("/reports/version-restrictions",{reportVersionId:t,userRestricts:[{employeeId:a,addRights:l}]})).data}finally{r("reportSharing-addPerson")}return c},[s,t,n,r])}},El=({isOpen:t,onHide:s,usersData:n,reportVersionId:r,EmployeePicker:o,setReportVersion:a})=>{const{ProjectIconComponent:l,texts:{reports:c}}=i.useContext(e.LuminusComponentsContext),{confirm:u}=e.useConfirm(),[d,x]=i.useState(null),{changeEmployeeRights:p}=gl(r),E=i.useCallback(g=>{a(j=>j===null?null:{...j,users:g.filter(f=>f.isReportOwner===!1)})},[a]),m=i.useCallback(async()=>{if(d===null)return;const g=await p(d.id,!0);E(g),x(null)},[d,p,E]),h=i.useCallback(async g=>{if(!await u(c.removeSharingWith(g)))return;const f=await p(g,!1);E(f)},[p,u,c,E]);return e.jsxRuntimeExports.jsxs(e.Modal,{show:t,onHide:s,children:[e.jsxRuntimeExports.jsx(e.Modal.Header,{closeButton:!0,children:e.jsxRuntimeExports.jsx(e.Modal.Title,{children:c.reportSharing})}),e.jsxRuntimeExports.jsxs(e.Modal.Body,{children:[e.jsxRuntimeExports.jsx(e.Typography,{variant:"h6",children:c.sharedWith}),e.jsxRuntimeExports.jsxs(tn,{variant:"flush",children:[n&&n.length===0?e.jsxRuntimeExports.jsx("div",{className:"px-2 text-muted",children:c.noone.toLowerCase()}):null,n==null?void 0:n.map(g=>e.jsxRuntimeExports.jsxs(rt,{className:"d-flex justify-content-between align-items-center gap-3 border-bottom px-2 py-1",children:[g.lastName," ",g.firstName," [",g.id,"]",e.jsxRuntimeExports.jsx(e.IconButton,{color:"danger",onClick:()=>h(g.id),children:e.jsxRuntimeExports.jsx(l,{icon:"delete"})})]},g.id))]}),e.jsxRuntimeExports.jsx(e.Typography,{variant:"h6",className:"mt-2 mb-2",children:c.addSharing}),e.jsxRuntimeExports.jsxs("div",{className:"d-flex gap-2 align-items-center",children:[e.jsxRuntimeExports.jsx("div",{className:"flex-grow-1",children:e.jsxRuntimeExports.jsx(o,{label:c.shareWith,onSelect:g=>{if(g===null||typeof g.id!="number"){x(null);return}x(g)},value:d})}),e.jsxRuntimeExports.jsx(e.PrimaryButton,{onClick:m,disabled:d===null,children:c.add})]})]})]})},Rl=(t,s)=>{const[n,r]=i.useState(null);return i.useEffect(()=>{t.then(({default:o})=>{const a=s!==void 0?s(o):o;r(a)})},[s,t]),{mappings:n}},vl=({reportType:t,title:s,data:n,filterElements:r,getReportRoute:o,localization:a,licenseKey:l,EmployeePicker:c,localizationJsonFile:u,localizationTransformer:d,hyperlinkColumn:x})=>{const{texts:{reports:p}}=i.useContext(e.LuminusComponentsContext),{confirm:E}=e.useConfirm(),m=oe.useNavigate(),[h]=oe.useSearchParams(),{id:g}=oe.useParams(),j=i.useMemo(()=>g===void 0?null:Number(g),[g]),f=i.useCallback($=>{const Y=$===null?"":$.toString();m(oe.generatePath(o(t),{id:Y})+"?"+h.toString(),{replace:!0,flushSync:!0})},[o,m,t,h]),[b,y]=i.useState(!1),v=i.useRef(null),{user:R}=i.useContext(e.UserContext),{data:_,reloadData:D}=Je.useGetApiData(`/reports/${t}`),{mappings:S}=Rl(u,d),[I,F]=i.useState({}),L=i.useCallback($=>{const Y=$.target.value,B=Y===""?null:Number(Y);f(B)},[f]),A=i.useCallback(async $=>{await D(),f($)},[D,f]),{data:C,setData:U}=Je.useGetApiData(`/reports/version/${j}`,{enabled:j!==null,nullStateBeforeLoad:!1,nullStateOnFail:!0});i.useEffect(()=>{var Y;if(C===null){F({});return}const $=fl(C)??{};F($),(Y=v.current)==null||Y.flexmonster.refresh()},[C]);const{save:G,saveAs:w,archive:N,detach:M}=hl(t,v,j,A),V=i.useMemo(()=>({data:n??[],mapping:S??void 0}),[n,S]),K=i.useCallback(async()=>{var Y;await E(p.confirmRevertChanges)&&((Y=v.current)==null||Y.flexmonster.setReport({dataSource:V,...I}))},[E,V,p.confirmRevertChanges,I]),P=i.useMemo(()=>(C==null?void 0:C.ownerId)===R.personalNumber,[C==null?void 0:C.ownerId,R.personalNumber]),W=i.useMemo(()=>{var $;return($=C==null?void 0:C.users)==null?void 0:$.some(Y=>Y.id===R.personalNumber&&!Y.isReportOwner)},[C==null?void 0:C.users,R.personalNumber]),Z=i.useCallback(async()=>{await E(p.confirmDelete(C==null?void 0:C.name))&&(await N(),f(null),await D())},[N,E,D,C==null?void 0:C.name,p,f]),q=i.useCallback(async()=>{await E(p.confirmDetach(C==null?void 0:C.name))&&(await M(),f(null),await D())},[E,M,D,C==null?void 0:C.name,p,f]);return i.useEffect(()=>{var $,Y;j===null&&f((($=_==null?void 0:_.reportVersions.find(B=>B.isSystem===!0))==null?void 0:$.reportVersionId)??((Y=_==null?void 0:_.reportVersions[0])==null?void 0:Y.reportVersionId)??null)},[_==null?void 0:_.reportVersions,j,f]),e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.PageContainer,{variant:"fullScreen",title:e.jsxRuntimeExports.jsxs("div",{className:"d-flex justify-content-start gap-3",children:[e.jsxRuntimeExports.jsx(e.Typography,{variant:"h3",children:s}),r,e.jsxRuntimeExports.jsxs("div",{className:"d-flex gap-1 align-items-center",children:[e.jsxRuntimeExports.jsxs(e.FormSelect,{size:"sm",value:j??void 0,onChange:L,children:[e.jsxRuntimeExports.jsx("optgroup",{label:p.versionSelectSystem,children:_==null?void 0:_.reportVersions.filter($=>$.isSystem===!0).map($=>e.jsxRuntimeExports.jsx("option",{value:$.reportVersionId,children:$.name},$.reportVersionId))}),e.jsxRuntimeExports.jsx("optgroup",{label:p.versionSelectYour,children:_==null?void 0:_.reportVersions.filter($=>$.ownerId===R.personalNumber).map($=>e.jsxRuntimeExports.jsx("option",{value:$.reportVersionId,children:$.name},$.reportVersionId))}),e.jsxRuntimeExports.jsx("optgroup",{label:p.versionSelectSharedWithYou,children:_==null?void 0:_.reportVersions.filter($=>$.isSystem===!1&&$.ownerId!==R.personalNumber).map($=>e.jsxRuntimeExports.jsx("option",{value:$.reportVersionId,children:`${$.name} [${$.ownerId}]`},$.reportVersionId))})]}),e.jsxRuntimeExports.jsx(e.ContextButton,{icon:e.jsxRuntimeExports.jsx(e.MdSave,{}),onClick:G,disabled:j===null||(C==null?void 0:C.isSystem)||!P,children:p.save}),e.jsxRuntimeExports.jsx(e.ContextButton,{icon:e.jsxRuntimeExports.jsx(e.MdSaveAs,{}),onClick:w,className:"flex-shrink-0",children:p.saveAs}),e.jsxRuntimeExports.jsxs(e.Dropdown,{toggle:e.jsxRuntimeExports.jsx(e.DropdownToggle,{as:e.SimpleDropdownToggle}),children:[e.jsxRuntimeExports.jsx(e.DropdownItem,{onClick:K,children:p.revertChanges}),e.jsxRuntimeExports.jsx(e.DropdownItem,{onClick:()=>y(!0),disabled:!P||(C==null?void 0:C.isSystem),children:p.share}),P&&!(C!=null&&C.isSystem)?e.jsxRuntimeExports.jsx(e.DropdownItem,{color:"danger",onClick:Z,children:p.delete}):null,W&&!(C!=null&&C.isSystem)?e.jsxRuntimeExports.jsx(e.DropdownItem,{color:"danger",onClick:q,children:p.detach}):null]})]})]}),children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("h-100 w-100",V.data&&V.data.length>0?"":"d-none"),children:e.jsxRuntimeExports.jsx(Fn,{dataSource:V,settings:I,pivotRef:v,enabled:V.data&&V.data.length>0,localization:a,licenseKey:l,hyperlinkColumn:x})})}),C!==null?e.jsxRuntimeExports.jsx(El,{isOpen:b,onHide:()=>y(!1),usersData:C.users??null,setReportVersion:U,reportVersionId:C==null?void 0:C.reportVersionId,EmployeePicker:c}):null]})},yl=({cell:{value:t}})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:t?e.jsxRuntimeExports.jsx(e.AvatarIcon,{name:t,size:21,fontSize:12}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{})}),bl=({knownTypes:t,typeFilters:s,onChangeTypeFilters:n})=>e.jsxRuntimeExports.jsx("div",{className:"mb-1 d-flex justify-content-center gap-2",children:t.map(r=>e.jsxRuntimeExports.jsx("div",{role:"button",style:{height:"14px",width:"14px",borderRadius:"50%",border:"2px solid transparent",backgroundColor:"transparent"},className:e.classNames(`border-${r}`,s.includes(r)&&`bg-${r}`),onClick:()=>{s.includes(r)?n(s.filter(o=>o!==r)):n([...s,r])}},r))}),wl=({linksTo:t,onClick:s,children:n})=>t?e.jsxRuntimeExports.jsx(oe.Link,{to:t,className:"text-decoration-none",onClick:s,children:n}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:n}),Cl=({message:t,onDeleteMessage:s,onClickMessage:n,getIcon:r,getLinksTo:o})=>{const{ProjectIconComponent:a,localizationContext:l}=i.useContext(e.LuminusComponentsContext),{dateFnsLocale:c}=i.useContext(l),u=t.dateTime?e.parseISO(t.dateTime):null,d=u?Wn(new Date(Date.now()),u):0;return e.jsxRuntimeExports.jsxs("div",{children:[u&&e.jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-end",children:e.jsxRuntimeExports.jsx(e.SimpleTooltip,{text:e.format(u,"dd.MM.yyyy HH:mm"),placement:"left",children:e.jsxRuntimeExports.jsx("div",{children:e.jsxRuntimeExports.jsx(e.Typography,{variant:"caption",children:d>2?e.format(u,"dd.MM.yyyy"):Un(u,new Date(Date.now()),{locale:c.code})})})})}),e.jsxRuntimeExports.jsx(wl,{linksTo:o(t)??void 0,onClick:n,children:e.jsxRuntimeExports.jsx(En,{level:t.type,noIcon:!0,children:e.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-start gap-2",children:[r(t),e.jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column gap-1 w-100",children:[e.jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-start justify-content-between gap-3",children:[e.jsxRuntimeExports.jsx(e.Typography,{variant:"body2",className:"fw-bold",children:t.subject}),e.jsxRuntimeExports.jsx(e.IconButton,{size:"sm",onClick:x=>{x.preventDefault(),x.stopPropagation(),s(t.id)},children:e.jsxRuntimeExports.jsx(a,{icon:"delete"})})]}),e.jsxRuntimeExports.jsx(e.Typography,{variant:"body2",children:t.text})]})]})})})]})},Is=["info","warning","danger"],Ds=({messages:t,isLoading:s,onDeleteMessage:n,onClickMessage:r,getIcon:o,getLinksTo:a})=>{const{texts:{messageBoard:l}}=i.useContext(e.LuminusComponentsContext),[c,u]=i.useState(Is),d=i.useMemo(()=>t.filter(x=>c.includes(x.type??"")),[c,t]);return e.jsxRuntimeExports.jsxs("div",{className:"h-100 d-flex flex-column overflow-hidden",children:[e.jsxRuntimeExports.jsx(bl,{knownTypes:Is,typeFilters:c,onChangeTypeFilters:x=>u(x)}),s&&e.jsxRuntimeExports.jsxs("div",{className:"p-3 w-100",children:[e.jsxRuntimeExports.jsx(De,{as:ss.Title,animation:"glow",children:e.jsxRuntimeExports.jsx(De,{xs:6})}),e.jsxRuntimeExports.jsxs(De,{as:ss.Text,animation:"glow",children:[e.jsxRuntimeExports.jsx(De,{xs:7})," ",e.jsxRuntimeExports.jsx(De,{xs:4})," ",e.jsxRuntimeExports.jsx(De,{xs:4})," ",e.jsxRuntimeExports.jsx(De,{xs:6})," ",e.jsxRuntimeExports.jsx(De,{xs:8})]})]}),!s&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[t.length===0&&e.jsxRuntimeExports.jsx(at,{variant:"info",size:"sm",className:"mt-2",children:l.noMessages}),e.jsxRuntimeExports.jsx("div",{className:"h-100 overflow-y-auto d-flex flex-column gap-2 luminus-thin-scrollbar",children:d.map(x=>e.jsxRuntimeExports.jsx(Cl,{message:x,onDeleteMessage:n,onClickMessage:r,getIcon:o,getLinksTo:a},x.id))})]})]})},Nt={apiGet:"/messageBoard",apiDelete:"/messageBoard/"},Nl=({renderAsNotifPanel:t,notifIcon:s,apiUrls:{apiGet:n=Nt.apiGet,apiDelete:r=Nt.apiDelete}=Nt,getIcon:o,getLinksTo:a})=>{const c=e.useAxios(),[u,d]=i.useState([]),[x,p]=i.useState(!1),[E,m]=i.useState(!1),[h,g]=i.useState(!1),j=i.useCallback(async()=>{m(!0),await c.get(n).then(({data:R})=>{d(R),p(!0),m(!1)}).catch(()=>{d([]),m(!1)})},[n,c]),f=i.useCallback(async R=>c.delete(`${r}${R}`).then(()=>!0).catch(()=>!1),[r,c]),b=i.useCallback(R=>{f(R).then(_=>{_&&d(u.filter(D=>D.id!==R))})},[f,u]);i.useEffect(()=>{j();const R=setInterval(()=>j(),60*1e3);return()=>{clearInterval(R)}},[j]);const y=u.filter(R=>R.type==="danger").length,v=x?!1:E;return t?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:"position-relative",children:[e.jsxRuntimeExports.jsx(e.IconButton,{size:"md",onClick:()=>g(!h),children:s}),y>0&&e.jsxRuntimeExports.jsx("div",{className:"badge rounded-pill bg-danger p-1 px-2 text-white",style:{position:"absolute",top:"-6px",right:"-10px",fontSize:"10px"},children:y})]}),e.jsxRuntimeExports.jsx(as,{show:h,onHide:()=>g(!1),placement:"end",children:e.jsxRuntimeExports.jsx(as.Body,{children:e.jsxRuntimeExports.jsx(Ds,{messages:u,isLoading:v,onDeleteMessage:b,onClickMessage:()=>g(!1),getIcon:o,getLinksTo:a})})})]}):e.jsxRuntimeExports.jsx(Ds,{messages:u,isLoading:v,onDeleteMessage:b,getIcon:o,getLinksTo:a})},_l="_tab-panel_d8l8q_1",kl="_full-height-no-overflow_d8l8q_5",Sl="_disabled_d8l8q_12",_t={"tab-panel":"_tab-panel_d8l8q_1",tabPanel:_l,"full-height-no-overflow":"_full-height-no-overflow_d8l8q_5",fullHeightNoOverflow:kl,disabled:Sl},Il=({eventKey:t,activeTab:s,fullHeightNoOverflow:n,disabled:r,className:o,children:a})=>t!==s?null:e.jsxRuntimeExports.jsx("div",{className:e.classNames("luminus-tab-panel",_t.tabPanel,{[_t.fullHeightNoOverflow]:n},{disabled:r},{[_t.disabled]:r},o),children:a}),Dl="_join-line_1q9e8_1",Tl={"join-line":"_join-line_1q9e8_1",joinLine:Dl},$n=({activeTab:t,onSelect:s,children:n,vertical:r,verticalStepper:o})=>e.jsxRuntimeExports.jsx("div",{className:e.classNames("luminus-tabs d-flex mb-2",{"gap-1":!o},{"gap-0":o},{"flex-column":r||o}),children:n.map((a,l)=>{const c=a.type,u=a.props;if(!u)return null;const d=u.eventKey,x=u.children,p=u.className,E=u.onClick;return e.jsxRuntimeExports.jsxs(i.Fragment,{children:[e.jsxRuntimeExports.jsx(c,{...u,className:e.classNames({active:t===d},p),onClick:()=>{s(d),E&&E(d)},vertical:r||o,children:x}),o&&l<n.length-1&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("join-line",Tl.joinLine)})]},u.eventKey)})}),Ll="_tab_1tbi7_1",Fl="_disabled_1tbi7_7",$l="_vertical_1tbi7_13",kt={tab:Ll,disabled:Fl,vertical:$l},Mn=({eventKey:t,className:s,onClick:n,disabled:r,vertical:o,children:a})=>e.jsxRuntimeExports.jsx("div",{role:"button",className:e.classNames("luminus-tab text-primary rounded",kt.tab,s,{disabled:r},{[kt.disabled]:r},{vertical:o},{[kt.vertical]:o}),onClick:()=>n&&!r&&n(t),children:typeof a=="string"?e.jsxRuntimeExports.jsx(e.Typography,{variant:o?"body":"h6",className:o?"":"text-primary",children:a}):a}),Ml=({tabs:t,activeTab:s,onSelect:n,...r})=>{var l;const{ProjectIconComponent:o}=i.useContext(e.LuminusComponentsContext),{isMobile:a}=He.useWindowSize();return a?e.jsxRuntimeExports.jsx(e.Dropdown,{toggle:e.jsxRuntimeExports.jsx(e.DropdownToggle,{as:e.SimpleDropdownToggle,text:((l=t.find(c=>c.id===s))==null?void 0:l.name)??"",icon:e.jsxRuntimeExports.jsx(o,{icon:"chevron-down"})}),...r,children:t.map(c=>e.jsxRuntimeExports.jsx(e.DropdownItem,{onClick:()=>n(c.id),children:c.name},c.id))}):e.jsxRuntimeExports.jsx($n,{activeTab:s,onSelect:c=>n(c),...r,children:t.map(c=>e.jsxRuntimeExports.jsx(Mn,{eventKey:c.id,children:c.name},c.id))})},Bl="_selection_1dtmm_1",Ol="_selectionBg_1dtmm_10",Al="_selectionItemsContainer_1dtmm_18",Pl="_selectionItems_1dtmm_18",ct={selection:Bl,selectionBg:Ol,selectionItemsContainer:Al,selectionItems:Pl},Yt=({icon:t,setIcon:s,IconComponent:n,IconTypeArray:r})=>{const[o,a]=i.useState(!1),l=c=>{s(c),a(!1)};return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.IconButton,{className:"rounded m-1",onClick:()=>a(!0),children:e.jsxRuntimeExports.jsx(n,{icon:t})}),o&&e.jsxRuntimeExports.jsxs("div",{className:ct.selection,children:[e.jsxRuntimeExports.jsx("div",{className:ct.selectionBg,onClick:()=>a(!1)}),e.jsxRuntimeExports.jsx("div",{className:ct.selectionItemsContainer,children:e.jsxRuntimeExports.jsx("div",{className:ct.selectionItems,children:r.filter((c,u,d)=>d.indexOf(c)===u).map(c=>e.jsxRuntimeExports.jsx(e.IconButton,{className:"rounded",onClick:()=>l(c),children:e.jsxRuntimeExports.jsx(n,{icon:c})},c))})})]})]})},qt=()=>{const t=i.useContext(e.ShortcutLinksContext);if(t===void 0)throw new Error("ShortcutLinksProvider not initilized. Probably tried to use useShortcutLinks outside ShortcutLinksProvider.");return t},Vl=({shortcutLink:t,IconComponent:s,IconTypeArray:n,editShortcutLink:r})=>{const{ProjectIconComponent:o}=i.useContext(e.LuminusComponentsContext),[a,l]=i.useState(t.icon),[c,u]=i.useState(t.name);console.log(a,typeof a);const d=i.useMemo(()=>!(a===t.icon&&c===t.name),[a,c,t.icon,t.name]),x=i.useCallback(()=>{l(t.icon),u(t.name)},[t]),p=i.useCallback(()=>{r({...t,icon:a,name:c})},[r,a,c,t]);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("td",{className:"align-middle",children:e.jsxRuntimeExports.jsx(Se,{type:"text",maxLength:20,value:c,onChange:u,className:"d-flex-grow-1",InputContainer:e.NoInputContainer})}),e.jsxRuntimeExports.jsx("td",{className:"align-middle text-center",children:e.jsxRuntimeExports.jsx(Yt,{icon:a,setIcon:l,IconComponent:s,IconTypeArray:n})}),e.jsxRuntimeExports.jsx("td",{className:"align-middle",style:{width:"7em"},children:d&&e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.IconButton,{onClick:x,color:"danger",className:"d-inline mx-2",children:e.jsxRuntimeExports.jsx(o,{icon:"cancel"})}),e.jsxRuntimeExports.jsx(e.IconButton,{onClick:p,color:"success",className:"d-inline mx-2",children:e.jsxRuntimeExports.jsx(o,{icon:"check"})})]})})]})},zl=({shortcutLink:t,IconComponent:s,IconTypeArray:n,editShortcutLink:r,deleteShortcutLink:o})=>{const{ProjectIconComponent:a}=i.useContext(e.LuminusComponentsContext),l=i.useCallback(()=>{o(t.id)},[o,t.id]);return e.jsxRuntimeExports.jsx("tr",{className:"mb-3",children:e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx("td",{className:"align-middle",children:e.jsxRuntimeExports.jsx(e.IconButton,{onClick:l,color:"danger",children:e.jsxRuntimeExports.jsx(a,{icon:"delete"})})}),e.jsxRuntimeExports.jsx("td",{className:"align-middle",children:t.url.length<=23?t.url:e.jsxRuntimeExports.jsx(e.SimpleTooltip,{placement:"bottom",text:t.url,children:e.jsxRuntimeExports.jsxs("span",{children:[t.url.slice(0,21),"..."]})})}),e.jsxRuntimeExports.jsx(Vl,{shortcutLink:t,IconComponent:s,IconTypeArray:n,editShortcutLink:r})]})})},Wl=({IconComponent:t,IconTypeArray:s})=>{const{texts:n}=i.useContext(e.LuminusComponentsContext),{shortcutLinks:r,editShortcutLink:o,deleteShortcutLink:a}=qt();return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:r!==null&&r.length>0?e.jsxRuntimeExports.jsxs(mr,{title:n.shortcutLinks.shortcutLinksSetting,children:[e.jsxRuntimeExports.jsx("thead",{className:"fw-bold",children:e.jsxRuntimeExports.jsxs("tr",{children:[e.jsxRuntimeExports.jsx("th",{}),e.jsxRuntimeExports.jsx("th",{children:n.shortcutLinks.target}),e.jsxRuntimeExports.jsx("th",{children:n.shortcutLinks.name}),e.jsxRuntimeExports.jsx("th",{children:n.shortcutLinks.icon}),e.jsxRuntimeExports.jsx("th",{})]})}),e.jsxRuntimeExports.jsx("tbody",{children:r==null?void 0:r.map(l=>e.jsxRuntimeExports.jsx(zl,{shortcutLink:l,IconComponent:t,IconTypeArray:s,editShortcutLink:o,deleteShortcutLink:a},l.id))})]}):e.jsxRuntimeExports.jsx(at,{variant:"info",children:n.shortcutLinks.addLinksToEditThemHereInfo})})},$t=5,Hl="_linkButton_pnlvi_1",Ul="_linkAddButton_pnlvi_31",Gl="_createLinkRow_pnlvi_39",We={linkButton:Hl,linkAddButton:Ul,createLinkRow:Gl},Kl=({shortcutLink:t,IconComponent:s})=>e.jsxRuntimeExports.jsx(e.SimpleTooltip,{text:t.name,placement:"bottom",children:e.jsxRuntimeExports.jsx(oe.Link,{to:t.url,className:We.linkButton,children:e.jsxRuntimeExports.jsx(s,{icon:t.icon})})}),Yl=({closeModal:t,isOpen:s,createLink:n,pageTitlePrefix:r,IconComponent:o,IconTypeArray:a})=>{const l=oe.useLocation(),{texts:c}=i.useContext(e.LuminusComponentsContext),[u,d]=i.useState("star-outline"),[x,p]=i.useState(r?document.title.replace(r,""):document.title),E=i.useCallback(async()=>{await n({icon:u,name:x,url:l.pathname+l.search}),t()},[t,n,u,l.pathname,l.search,x]),m=i.useMemo(()=>l.pathname+l.search,[l.pathname,l.search]);return e.jsxRuntimeExports.jsxs(e.Modal,{show:s,onHide:t,size:"sm",children:[e.jsxRuntimeExports.jsx(e.Modal.Header,{closeButton:!0,children:e.jsxRuntimeExports.jsx(e.Modal.Title,{children:c.shortcutLinks.newShortcut})}),e.jsxRuntimeExports.jsxs(e.Modal.Body,{children:[e.jsxRuntimeExports.jsxs("div",{className:We.createLinkRow,children:[e.jsxRuntimeExports.jsx(e.Typography,{variant:"form-label",className:"pe-3 text-end",children:c.shortcutLinks.target}),e.jsxRuntimeExports.jsx("div",{className:"d-flex align-items-middle fw-bold text-muted",children:m.length<=23?m:e.jsxRuntimeExports.jsx(e.SimpleTooltip,{placement:"bottom",text:m,children:e.jsxRuntimeExports.jsxs("span",{children:[m.slice(0,21),"..."]})})})]}),e.jsxRuntimeExports.jsxs("div",{className:We.createLinkRow,children:[e.jsxRuntimeExports.jsx(e.Typography,{variant:"form-label",className:"pe-3 text-end",children:c.shortcutLinks.name}),e.jsxRuntimeExports.jsx("div",{className:"d-flex align-items-middle fw-bold",children:e.jsxRuntimeExports.jsx(Se,{type:"text",maxLength:25,value:x,onChange:p,className:"w-100",InputContainer:e.RowLabelInput,withoutLabel:!0})})]}),e.jsxRuntimeExports.jsxs("div",{className:We.createLinkRow,children:[e.jsxRuntimeExports.jsx(e.Typography,{variant:"form-label",className:"pe-3 text-end",children:c.shortcutLinks.icon}),e.jsxRuntimeExports.jsx("div",{className:"d-flex align-items-middle fw-bold",children:e.jsxRuntimeExports.jsx(Yt,{icon:u,setIcon:d,IconComponent:o,IconTypeArray:a})})]})]}),e.jsxRuntimeExports.jsx(e.Modal.Footer,{className:"d-flex justify-content-end",children:e.jsxRuntimeExports.jsx(e.PrimaryButton,{onClick:E,children:c.shortcutLinks.addShortcut})})]})},ql=({IconComponent:t,IconTypeArray:s,pageTitlePrefix:n,createLink:r})=>{const{ProjectIconComponent:o,texts:a}=i.useContext(e.LuminusComponentsContext),[l,c]=i.useState(!1),[u]=pt(l,100);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.SimpleTooltip,{text:a.shortcutLinks.addShortcut,placement:"bottom",children:e.jsxRuntimeExports.jsx("button",{type:"button",className:e.classNames(We.linkButton,We.linkAddButton),onClick:()=>c(!0),children:e.jsxRuntimeExports.jsx(o,{icon:"add"})})}),(l||u)&&e.jsxRuntimeExports.jsx(Yl,{IconComponent:t,IconTypeArray:s,closeModal:()=>c(!1),createLink:r,isOpen:l,pageTitlePrefix:n})]})},Ql=({IconComponent:t,IconTypeArray:s,pageTitlePrefix:n})=>{const{shortcutLinks:r,createShortcutLink:o}=qt(),a=i.useMemo(()=>r!==null&&r.length<$t,[r]);return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("div",{className:"d-flex gap-2",children:[r==null?void 0:r.slice(0,$t).map((l,c)=>l!==null?e.jsxRuntimeExports.jsx(Kl,{shortcutLink:l,IconComponent:t},c):null),a&&e.jsxRuntimeExports.jsx(ql,{IconComponent:t,IconTypeArray:s,pageTitlePrefix:n,createLink:o})]})})},Zl=t=>{const s=e.useAxios(),{startLoading:n,stopLoading:r}=i.useContext(e.LoadingContext),o=i.useCallback(async c=>{n("submit-createShortcutLink");try{await s.post(`/dynamicForms/insert?referenceId=${t}`,c)}finally{r("submit-createShortcutLink")}},[s,t,n,r]),a=i.useCallback(async c=>{n("submit-updateShortcutLink");try{await s.post(`/dynamicForms/update?referenceId=${t}`,c)}finally{r("submit-updateShortcutLink")}},[s,t,n,r]),l=i.useCallback(async c=>{n("delete-deleteShortcutLink");try{await s.delete(`/dynamicForms/delete?referenceId=${t}&pk=${c.toString()}`)}finally{r("delete-deleteShortcutLink")}},[s,t,n,r]);return{create:o,update:a,remove:l}},Xl=t=>{if(t==null)throw new Error("Tried to make operation on null shortcutLinks.");return t},Ts=t=>{if(t==null)throw new Error("Tried to make operation on null shortcutLinks.");return t},Jl=({children:t,referenceId:s})=>{const{user:n}=i.useContext(e.UserContext),r=i.useCallback(m=>m.map(h=>({id:h.id,icon:h.icon,name:h.name,url:h.url})),[]),{data:o,reloadData:a}=Je.useGetApiData(`/dynamicForms/lookup-data-all?referenceId=${s}&employee=${n==null?void 0:n.personalNumber}`,{silent:!0,dataTransformer:r,enabled:n!==null}),{create:l,update:c,remove:u}=Zl(s),d=i.useCallback(async m=>{const h=Ts(n);if(Xl(o).length>=$t)throw new Error("Cannot add more shortcut links.");await l({...m,employee:h.personalNumber}),await a()},[l,a,o,n]),x=i.useCallback(async m=>{const h=Ts(n);await c({...m,employee:h.personalNumber}),await a()},[a,c,n]),p=i.useCallback(async m=>{await u(m),await a()},[a,u]),E=i.useMemo(()=>({shortcutLinks:o,createShortcutLink:d,editShortcutLink:x,deleteShortcutLink:p}),[d,p,x,o]);return e.jsxRuntimeExports.jsx(e.ShortcutLinksContext.Provider,{value:E,children:t})};exports.AvatarIcon=e.AvatarIcon;exports.ContextButton=e.ContextButton;exports.Documents=e.Documents;exports.Dropdown=e.Dropdown;exports.DropdownItem=e.DropdownItem;exports.DropdownToggle=e.DropdownToggle;exports.FileExtensionIcon=e.FileExtensionIcon;exports.FloatingLabelInput=e.FloatingLabelInput;exports.HookFormTextAreaInput=e.HookFormTextAreaInput;exports.HookFormTextInput=e.HookFormTextInput;exports.HtmlTooltip=e.HtmlTooltip;exports.IconButton=e.IconButton;exports.InvalidFeedback=e.InvalidFeedback;exports.NoInputContainer=e.NoInputContainer;exports.PrimaryButton=e.PrimaryButton;exports.ResponsiveContextDropdown=e.ResponsiveContextDropdown;exports.ResponsiveContextDropdownItem=e.ResponsiveContextDropdownItem;exports.RowLabelInput=e.RowLabelInput;exports.SimpleToggle=e.SimpleDropdownToggle;exports.SimpleTooltip=e.SimpleTooltip;exports.Typography=e.Typography;exports.UserAvatarToggle=e.UserAvatarToggle;exports.Loading=ge.Loading;exports.Alert=at;exports.AlertItem=En;exports.ApiFileDownloadButton=Vn;exports.AppSearch=$o;exports.AuthTemplate=ua;exports.Backdrop=Wt;exports.Badge=Yr;exports.BarChart=Gi;exports.Card=zt;exports.CheckInput=yn;exports.Collapse=et;exports.ColumnResizer=Tn;exports.DisabledRowLabelLink=Pi;exports.DropdownDivider=Vt;exports.DropdownPicker=Sa;exports.DynamicForm=Bi;exports.EmployeeSmallPhoto=Wi;exports.ErrorBoundary=pn;exports.FileUploadButton=pr;exports.FileUploadContextButton=Pt;exports.FileUploadDropdownItem=Zr;exports.Flexmonster=Fn;exports.FloatingActionContainer=Rn;exports.FloatingFormSubmit=dn;exports.FromToDatePicker=ci;exports.HomeDashboard=zr;exports.HookFormCheckInput=il;exports.HookFormDropdownPicker=cl;exports.HookFormFileInput=ul;exports.HookFormFloatingSubmit=dl;exports.HookFormNumericStepperInput=ml;exports.HookFormNumericTextInput=pl;exports.HookFormRadioInput=ll;exports.HookFormSelectInput=xl;exports.HrWithText=Ln;exports.IconPicker=Yt;exports.ImgApi=Ft;exports.ImgDirect=Ht;exports.LanguageSwitch=Vi;exports.LoadingBlock=Ls;exports.MessageBoard=Nl;exports.MiniDetailTooltip=ol;exports.MiniDetailValueItem=al;exports.MonthPicker=xn;exports.MonthPickerSearchParams=ui;exports.NumericFormat=Ui;exports.NumericStepperInput=Da;exports.NumericTextInput=ti;exports.PhotoLibrary=gn;exports.PhotoLightbox=hn;exports.PieChart=xi;exports.RadioInput=si;exports.ReportPage=vl;exports.ReportsIndexPage=tl;exports.ResponsiveTabs=Ml;exports.SearchBox=Hi;exports.SelectInput=tt;exports.SettingsFormPicker=Ai;exports.ShortcutLinks=Ql;exports.ShortcutLinksProvider=Jl;exports.ShortcutLinksSetup=Wl;exports.SimplePicker=ot;exports.Tab=Mn;exports.TabPanel=Il;exports.Tabs=$n;exports.TextAreaInput=Ia;exports.TextInput=Se;exports.Timeline=_a;exports.TypedFormGroup=zi;exports.UserAvatarValueFormat=yl;exports.VersionInfo=ha;exports.WidgetCard=Tt;exports.YearPicker=mn;exports.YearPickerSearchParams=di;exports.useShortcutLinksContext=qt;
|
package/dist/main.es.js
CHANGED
|
@@ -3354,19 +3354,19 @@ const _u = ({ InputContainer: e = lt, value: n, onChange: r, debounceMs: s, labe
|
|
|
3354
3354
|
return /* @__PURE__ */ t.jsx(Ce, { onClick: (a) => {
|
|
3355
3355
|
s(n === "cz" ? "en" : n === "en" ? "de" : "cz"), a.stopPropagation();
|
|
3356
3356
|
}, children: n === "cz" ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
3357
|
-
/* @__PURE__ */ t.jsx("strong", { children: "CZ" }),
|
|
3357
|
+
/* @__PURE__ */ t.jsx("strong", { className: "fw-bold", children: "CZ" }),
|
|
3358
3358
|
/* @__PURE__ */ t.jsx(ut, {}),
|
|
3359
3359
|
/* @__PURE__ */ t.jsx("span", { children: "EN" }),
|
|
3360
3360
|
/* @__PURE__ */ t.jsx(ut, {}),
|
|
3361
3361
|
/* @__PURE__ */ t.jsx("span", { children: "DE" })
|
|
3362
3362
|
] }) : n === "en" ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
3363
|
-
/* @__PURE__ */ t.jsx("strong", { children: "EN" }),
|
|
3363
|
+
/* @__PURE__ */ t.jsx("strong", { className: "fw-bold", children: "EN" }),
|
|
3364
3364
|
/* @__PURE__ */ t.jsx(ut, {}),
|
|
3365
3365
|
/* @__PURE__ */ t.jsx("span", { children: "DE" }),
|
|
3366
3366
|
/* @__PURE__ */ t.jsx(ut, {}),
|
|
3367
3367
|
/* @__PURE__ */ t.jsx("span", { children: "CZ" })
|
|
3368
3368
|
] }) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
3369
|
-
/* @__PURE__ */ t.jsx("strong", { children: "DE" }),
|
|
3369
|
+
/* @__PURE__ */ t.jsx("strong", { className: "fw-bold", children: "DE" }),
|
|
3370
3370
|
/* @__PURE__ */ t.jsx(ut, {}),
|
|
3371
3371
|
/* @__PURE__ */ t.jsx("span", { children: "CZ" }),
|
|
3372
3372
|
/* @__PURE__ */ t.jsx(ut, {}),
|