import{r as u,bs as y,bt as P,bu as B,aw as N,ax as j,j as M,bv as C,bw as O,bx as k}from"./index-DTC0Ed21.js";import{a as $,c as Y,O as G}from"./tasks-ClycqzjK.js";var K=u.useLayoutEffect,Z=function(e){var t=y.useRef(e);return K(function(){t.current=e}),t},L=function(e,t){if(typeof e=="function"){e(t);return}e.current=t},U=function(e,t){var r=y.useRef();return y.useCallback(function(i){e.current=i,r.current&&L(r.current,null),r.current=t,t&&L(t,i)},[t])},R={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},V=function(e){Object.keys(R).forEach(function(t){e.style.setProperty(t,R[t],"important")})},w=V,a=null,E=function(e,t){var r=e.scrollHeight;return t.sizingStyle.boxSizing==="border-box"?r+t.borderSize:r-t.paddingSize};function X(n,e,t,r){t===void 0&&(t=1),r===void 0&&(r=1/0),a||(a=document.createElement("textarea"),a.setAttribute("tabindex","-1"),a.setAttribute("aria-hidden","true"),w(a)),a.parentNode===null&&document.body.appendChild(a);var i=n.paddingSize,o=n.borderSize,s=n.sizingStyle,f=s.boxSizing;Object.keys(s).forEach(function(p){var v=p;a.style[v]=s[v]}),w(a),a.value=e;var d=E(a,n);a.value=e,d=E(a,n),a.value="x";var c=a.scrollHeight-i,l=c*t;f==="border-box"&&(l=l+i+o),d=Math.max(l,d);var g=c*r;return f==="border-box"&&(g=g+i+o),d=Math.min(g,d),[d,c]}var H=function(){},q=function(e,t){return e.reduce(function(r,i){return r[i]=t[i],r},{})},D=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],J=!!document.documentElement.currentStyle,Q=function(e){var t=window.getComputedStyle(e);if(t===null)return null;var r=q(D,t),i=r.boxSizing;if(i==="")return null;J&&i==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var o=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),s=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:o,borderSize:s}},ee=Q;function I(n,e,t){var r=Z(t);u.useLayoutEffect(function(){var i=function(s){return r.current(s)};if(n)return n.addEventListener(e,i),function(){return n.removeEventListener(e,i)}},[])}var te=function(e){I(window,"resize",e)},re=function(e){I(document.fonts,"loadingdone",e)},ne=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],ie=function(e,t){var r=e.cacheMeasurements,i=e.maxRows,o=e.minRows,s=e.onChange,f=s===void 0?H:s,d=e.onHeightChange,c=d===void 0?H:d,l=P(e,ne),g=l.value!==void 0,p=u.useRef(null),v=U(p,t),z=u.useRef(0),x=u.useRef(),b=function(){var h=p.current,S=r&&x.current?x.current:ee(h);if(S){x.current=S;var T=X(S,h.value||h.placeholder||"x",o,i),m=T[0],A=T[1];z.current!==m&&(z.current=m,h.style.setProperty("height",m+"px","important"),c(m,{rowHeight:A}))}},_=function(h){g||b(),f(h)};return u.useLayoutEffect(b),te(b),re(b),u.createElement("textarea",B({},l,{onChange:_,ref:v}))},ae=u.forwardRef(ie);const oe={},F=N((n,e)=>{const{autosize:t,maxRows:r,minRows:i,__staticSelector:o,resize:s,...f}=j("Textarea",oe,n),d=t&&$()!=="test",c=d?{maxRows:r,minRows:i}:{};return M.jsx(C,{component:d?ae:"textarea",ref:e,...f,__staticSelector:o||"Textarea",multiline:!0,"data-no-overflow":t&&r===void 0||void 0,__vars:{"--input-resize":s},...c})});F.classes=C.classes;F.displayName="@mantine/core/Textarea";var se=Y(function(n,e,t){O(n,t,e)});function fe({tasks:n,statuses:e}){const t=de(e),r=se(e,"Id");return n==null?void 0:n.map(i=>{var o;return{...i,Status:((o=r[i.Status])==null?void 0:o.Id)||(t==null?void 0:t.Id)||0}})}function de(n){return n.find(e=>e.Type===k.IStatusType.BeExecuted)}const le=(n,e)=>n.FromId!==e?G[n.Type]:n.Type;export{F as T,le as g,se as k,fe as p};
