@ehfuse/taskbox 0.5.150 → 0.5.151

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/index.esm.js CHANGED
@@ -5,7 +5,7 @@ var Kl="waiting",YS="replied";import{createContext as wu,useContext as Du,useMem
5
5
 
6
6
  `).trim()}function Oi({syncKey:e,value:o,onChange:t,readOnly:n=!1,minHeight:r=180,height:i=0,onChangeHeight:a}){let l=Bn(null),u=Bn(null),s=i>0?i:0,m=Bn(s),x=Bn(a);x.current=a;let p=Bn(null),c=Bn(Date.now()+800),[f,E]=Wk(!1),v=Ie();sl(()=>{if(n)return;let g=ml(o);p.current===g||p.current===o||(p.current=g,c.current=Date.now()+800,l.current?.setHtml(g))},[e,o,n]);let h=Bn(-1);return sl(()=>{if(n||v||i<=0||h.current===i||(h.current=i,Math.abs(i-m.current)<1))return;let g=u.current?.querySelector(".ehfuse-editor-container");g&&(Math.abs(g.getBoundingClientRect().height-i)<1||(g.style.height=`${i}px`,m.current=i))},[n,v,i]),sl(()=>{if(n||v)return;let g=u.current?.querySelector(".ehfuse-editor-container");if(!g||typeof ResizeObserver>"u")return;let I,y=new ResizeObserver(O=>{let S=Math.round(O[0]?.contentRect.height??0);S<=0||(window.clearTimeout(I),I=window.setTimeout(()=>{Math.abs(S-m.current)<1||(m.current=S,x.current?.(S))},300))});return y.observe(g),()=>{window.clearTimeout(I),y.disconnect()}},[n,v]),n?Xk(cl,{sx:{position:"relative",mt:1},children:[Cn(cl,{sx:{border:"1px solid #e0e0e0",borderRadius:1,p:"12px",pr:"40px",minHeight:r,fontSize:16,lineHeight:1.6,color:"#37352f",wordBreak:"break-word",userSelect:"none","& > p:first-of-type":{mt:0},"& > p:last-of-type":{mb:0}},dangerouslySetInnerHTML:{__html:ml(o)}}),Cn(Vk,{title:"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:Cn($k,{size:"small","aria-label":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>{navigator.clipboard.writeText(Yk(o)).then(()=>{E(!0),window.setTimeout(()=>E(!1),1500)})},sx:{position:"absolute",top:6,right:6,color:"#9a9a97"},children:f?Cn(Uk,{sx:{fontSize:17,color:"#2f9e5b"}}):Cn(Kk,{sx:{fontSize:17}})})})]}):Cn(cl,{ref:u,onDragOver:g=>g.stopPropagation(),onDrop:g=>g.stopPropagation(),sx:{mt:1,"& .ehfuse-editor-content > p:first-of-type":{mt:0},"& .ehfuse-editor-content > p:last-of-type":{mb:0},"& .ehfuse-editor-content.ehfuse-editor-empty::before":{top:"12px",left:"12px"}},children:Cn(Gk,{ref:l,defaultValue:ml(o),autoHeight:v,resizable:!v,showToolbar:!v,focusBorder:!0,styles:{focusBorderColor:"var(--primary)"},toolbarOptions:jk,locale:"ko",minHeight:s||r,placeholder:"\uB0B4\uC6A9\uC744 \uC785\uB825\uD558\uC138\uC694",contentStyle:{padding:"12px"},onChange:g=>{let I=Date.now()<c.current,y=g===p.current;p.current=g,!(I||y)&&t(g)}})})}import{useState as Pr}from"react";import{Box as Bo,Button as Qc,Dialog as sT,IconButton as Zn,TextField as cT,Tooltip as Zc}from"@mui/material";import Jc from"@mui/icons-material/Close";import mT from"@mui/icons-material/AddCircle";import em from"@mui/icons-material/AddTask";import uT from"@mui/icons-material/Checklist";import dT from"@mui/icons-material/CheckCircle";import pT from"@mui/icons-material/Launch";import fT from"@mui/icons-material/LinkOutlined";import xT from"@mui/icons-material/RadioButtonUnchecked";import{useEffect as Qk,useMemo as Zk,useState as ul}from"react";import{Box as Nt,Button as Jk,Tab as eT,Tabs as oT}from"@mui/material";import{FormDialog as tT}from"@ehfuse/mui-form-dialog";import{ClearTextField as nT}from"@ehfuse/mui-form-controls";import{ErrorAlert as rT}from"@ehfuse/alerts";import iT from"@mui/icons-material/CheckCircle";import aT from"@mui/icons-material/RadioButtonUnchecked";import{OverlayScrollbar as lT}from"@ehfuse/overlay-scrollbar";import{jsx as fo,jsxs as dl}from"react/jsx-runtime";var Xc=[{type:"related",label:"\uAD00\uB828",hint:"\uB2E8\uC21C\uD788 \uAD00\uB828 \uC788\uB294 \uC5C5\uBB34\uB85C \uC5F0\uACB0\uD569\uB2C8\uB2E4"},{type:"follow_up",label:"\uC774\uC804 \uC5C5\uBB34",hint:"\uC774 \uC5C5\uBB34\uAC00 \uC120\uD0DD\uD55C \uC5C5\uBB34\uC5D0\uC11C \uC774\uC5B4\uC9C4 \uD6C4\uC18D\uC784\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4(\uC774\uB825 \uD0C0\uC784\uB77C\uC778)"},{type:"duplicate_of",label:"\uC911\uBCF5(\uC6D0\uBCF8)",hint:"\uC774 \uC5C5\uBB34\uAC00 \uC120\uD0DD\uD55C \uC6D0\uBCF8 \uC5C5\uBB34\uC758 \uC911\uBCF5\uC784\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4"}];function Pi({open:e,task:o,tasks:t,excludeSeqs:n=[],onClose:r,onSubmit:i,hideRelationType:a=!1,title:l="\uAD00\uB828 \uC5C5\uBB34 \uC5F0\uACB0",confirmLabel:u="\uC5F0\uACB0",multiSelect:s=!1}){let m=Ie(),[x,p]=ul("related"),[c,f]=ul(""),[E,v]=ul([]);Qk(()=>{e&&(p("related"),f(""),v([]))},[e]);let h=Zk(()=>{let S=new Set([o.seq,...n]),_=c.trim().toLowerCase();return t.filter(P=>S.has(P.seq)||P.is_event||P.is_notice?!1:_?P.title.toLowerCase().includes(_)||(P.ticket_no??"").toLowerCase().includes(_):!0).sort((P,C)=>!!P.completed!=!!C.completed?P.completed?1:-1:C.seq-P.seq)},[t,o.seq,n,c]),g=()=>{if(E.length===0){rT("\uC5F0\uACB0\uD560 \uC5C5\uBB34\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}for(let S of E)i(S,x);r()},I=S=>{v(_=>_.includes(S)?_.filter(P=>P!==S):s?[..._,S]:[S])},y=Xc.find(S=>S.type===x)?.hint??"",O=dl(Nt,{sx:{...m?{height:"100%",minHeight:0}:{height:560},display:"flex",flexDirection:"column",...m?{}:{border:"1px solid #cccccc",borderRadius:1},overflow:"hidden",userSelect:"none"},children:[a?null:fo(oT,{value:x,onChange:(S,_)=>p(_),sx:{minHeight:38,mb:.75,flexShrink:0,"& .MuiTab-root":{minHeight:38,py:.5,fontSize:14}},children:Xc.map(S=>fo(eT,{value:S.type,label:S.label},S.type))}),a?null:fo(Nt,{sx:{mb:1.5,fontSize:12.5,color:"#9a9a97"},children:y}),fo(Nt,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:fo(nT,{placeholder:"\uC81C\uBAA9\xB7\uD2F0\uCF13\uBC88\uD638\uB85C \uAC80\uC0C9",value:c,onChange:S=>f(S.target.value),fullWidth:!0,autoFocus:!0,size:"small",sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),fo(Nt,{sx:{flex:1,minHeight:0},children:fo(lT,{style:{height:"100%"},contentStyle:{paddingTop:0},children:fo(Nt,{sx:{display:"flex",flexDirection:"column"},children:h.length===0?fo(Nt,{sx:{py:4,textAlign:"center",fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uD560 \uC218 \uC788\uB294 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):h.map(S=>{let _=Ue(S.icon||Pe),P=E.includes(S.seq);return dl(Nt,{onClick:()=>I(S.seq),sx:{display:"flex",alignItems:"center",gap:.75,px:1.5,py:1.25,flexShrink:0,cursor:"pointer",borderBottom:"1px solid #ededeb","&:last-of-type":{borderBottom:"none"},bgcolor:P?"#e3eefb":"transparent","&:hover":{bgcolor:P?"#e3eefb":"#f7f7f5"}},children:[P?fo(iT,{sx:{fontSize:20,flexShrink:0,color:"#2f6fd0"}}):fo(aT,{sx:{fontSize:20,flexShrink:0,color:"#c9c8c5"}}),_?fo(_,{sx:{fontSize:17,flexShrink:0,color:S.icon_color||"#1e3a8a"}}):null,dl(Nt,{component:"span",sx:{flex:1,minWidth:0,fontSize:15,color:"#37352f",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:3,overflow:"hidden",lineHeight:1.5,wordBreak:"break-word"},children:[S.ticket_no?`${S.ticket_no} `:"",S.title]}),fo(Nt,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:fo(ze,{option:Oo(S)})})]},S.seq)})})})})]});return fo(tT,{open:e,onClose:r,maxWidth:"sm",fullScreen:m,mobilePresentation:m?"slide":"dialog",...m?{contentPaddingX:0,contentTopPadding:0,sectionsPaddingTop:0}:{},sx:m?{DialogContent:{pb:0,"& .os-content > div":{height:"100%",boxSizing:"border-box",paddingBottom:0,marginBottom:0},"& .FormSection-content, & .section-content":{height:"100%",paddingBottom:0,marginBottom:0}}}:void 0,title:l,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-task-link",sections:[{id:"task-link",showTitle:!1,children:O}],scrollPastLastSection:!1,sectionContentPaddingTop:0,actions:{showCancelButton:!0,right:fo(Jk,{variant:"contained",disabled:E.length===0,onClick:g,children:u})}})}import{Fragment as gT,jsx as he,jsxs as an}from"react/jsx-runtime";function Ri({taskSeq:e,checklist:o,onAdd:t,onToggle:n,onRemove:r,onUpdate:i,removeLocked:a=!1,onConvertToTask:l,onOpenLinkedTask:u,linkCandidates:s,linkBaseTask:m,onLinkExistingTask:x,resolveLinkedTask:p}){let[c,f]=Pr(""),[E,v]=Pr(!1),[h,g]=Pr(null),I=Ie(),[y,O]=Pr(null),[S,_]=Pr(null),P=N=>{let d=N.task_seq?p?.(N.task_seq):void 0;return d?d.completed:N.checked},C=o.filter(P).length,M=()=>{c.trim()&&(t(e,c),f(""))};return an(Go,{icon:he(uT,{sx:{fontSize:19,display:"block"}}),title:an(gT,{children:["\uD560\uC77C",o.length>0?an(Bo,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:[C," / ",o.length]}):null]}),titleExtra:o.length>0?he(Bo,{sx:{flex:1,minWidth:0,ml:1,height:6,borderRadius:3,bgcolor:"#ececea"},children:he(Bo,{sx:{height:"100%",borderRadius:3,width:`${Math.round(C/o.length*100)}%`,bgcolor:"#2f80ed",transition:"width 0.2s"}})}):null,children:[he(Bo,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:o.map((N,d)=>{let T=N.task_seq?p?.(N.task_seq):void 0,k=P(N),b=!!N.task_seq;return an(Bo,{sx:{display:"flex",alignItems:"center",gap:1,px:1.25,py:.5,borderRadius:1,"&:hover":{bgcolor:"#f7f7f5"},"&:hover .taskbox-checklist-remove":{opacity:1},"&:hover .taskbox-checklist-convert":{opacity:1}},children:[he(Bo,{component:"span",onClick:()=>n(e,d,!k),sx:{display:"inline-flex",flexShrink:0,cursor:"pointer"},children:k?he(dT,{sx:{fontSize:18,color:"#2f80ed"}}):he(xT,{sx:{fontSize:18,color:"#9a9a97"}})}),h?.index===d?he(Bo,{component:"input",autoFocus:!0,spellCheck:!1,value:h.label,enterKeyHint:"done",onChange:z=>g({index:d,label:z.target.value}),onBlur:()=>{h.label.trim()&&h.label.trim()!==N.label&&i?.(e,d,h.label),g(null)},onKeyDown:z=>{z.key==="Enter"&&z.target.blur(),z.key==="Escape"&&g(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",p:0}}):he(Bo,{component:"span",onClick:b?N.task_seq&&u?()=>u(N.task_seq):void 0:a||!i?void 0:I?()=>O({index:d,label:N.label}):()=>g({index:d,label:N.label}),sx:{flex:1,minWidth:0,fontSize:14.5,color:"#37352f",textDecoration:k?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...b?u?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}:a||!i?{}:{cursor:"text"}},children:N.label}),b?an(Bo,{component:"span",onClick:N.task_seq&&u?()=>u(N.task_seq):void 0,sx:{display:"inline-flex",alignItems:"center",gap:.4,flexShrink:0,px:.75,py:.2,borderRadius:1,fontSize:12,fontWeight:500,color:"#1d4f91",bgcolor:"#e3eefb",whiteSpace:"nowrap",...u?{cursor:"pointer"}:{}},children:[he(pT,{sx:{fontSize:12}}),T?.manager_name?.trim()||"\uC5C5\uBB34"]}):null,!a&&!b&&l?he(Zc,{title:"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",arrow:!0,enterDelay:300,disableInteractive:!0,children:he(Zn,{className:"taskbox-checklist-convert",size:"small","aria-label":"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",onClick:z=>_({anchorEl:z.currentTarget,index:d,label:N.label}),sx:{display:I?"none":"inline-flex",opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:he(em,{sx:{fontSize:16}})})}):null,a?null:he(Zn,{className:"taskbox-checklist-remove",size:"small","aria-label":"\uD560\uC77C \uC0AD\uC81C",onClick:()=>r(e,d),sx:{display:I?"none":"inline-flex",opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:he(Jc,{sx:{fontSize:15}})})]},`${N.label}-${d}`)})}),an(Bo,{sx:{mt:.5,ml:3.25,display:"flex",alignItems:"center",gap:.5},children:[he(Bo,{component:"input",spellCheck:!1,value:c,placeholder:"+ \uD560\uC77C \uCD94\uAC00",enterKeyHint:"done",onChange:N=>f(N.target.value),onKeyDown:N=>{N.key==="Enter"&&M()},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",px:1.25,py:.75,"&::placeholder":{color:"#9a9a97"}}}),s&&m&&x?he(Zc,{title:"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",arrow:!0,children:he(Zn,{size:"small","aria-label":"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",onMouseDown:N=>N.preventDefault(),onClick:()=>v(!0),sx:{flexShrink:0,color:"#9a9a97"},children:he(fT,{sx:{fontSize:20}})})}):null,he(Zn,{size:"small","aria-label":"\uD560\uC77C \uCD94\uAC00",disabled:!c.trim(),onMouseDown:N=>N.preventDefault(),onClick:M,sx:{flexShrink:0,color:c.trim()?"#2f80ed":"#c9c8c5"},children:he(mT,{sx:{fontSize:20}})})]}),s&&m&&x?he(Pi,{open:E,task:m,tasks:s,excludeSeqs:o.map(N=>Number(N.task_seq??0)).filter(N=>N>0),hideRelationType:!0,multiSelect:!0,title:"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",confirmLabel:"\uBD99\uC774\uAE30",onClose:()=>v(!1),onSubmit:N=>{let d=s.find(T=>T.seq===N);x(e,N,String(d?.title??"").trim())}}):null,he(We,{open:!!S,anchorEl:S?.anchorEl??null,title:"\uC774 \uD560\uC77C\uC744 \uBCC4\uB3C4 \uC5C5\uBB34\uB85C \uB9CC\uB4DC\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uB9CC\uB4E4\uAE30",onCancel:()=>_(null),onConfirm:()=>{S&&l?.(e,S.index,S.label),_(null)}}),he(sT,{open:!!y,onClose:()=>O(null),maxWidth:"xs",fullWidth:!0,slotProps:{paper:{sx:{borderRadius:2,m:2}}},children:an(Bo,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5},children:[he(Bo,{sx:{fontSize:15.5,fontWeight:600,color:"#37352f"},children:"\uD560\uC77C \uC218\uC815"}),he(cT,{autoFocus:!0,fullWidth:!0,size:"medium",value:y?.label??"",onChange:N=>O(d=>d&&{...d,label:N.target.value}),onKeyDown:N=>{if(N.key!=="Enter")return;let d=y;d&&d.label.trim()&&i?.(e,d.index,d.label.trim()),O(null)}}),an(Bo,{sx:{display:"flex",alignItems:"center",gap:1},children:[!a&&l&&y&&!o[y.index]?.task_seq?he(Zn,{"aria-label":"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",onClick:()=>{l(e,y.index,o[y.index]?.label??""),O(null)},sx:{color:"#57564f"},children:he(em,{sx:{fontSize:20}})}):null,!a&&y?he(Zn,{"aria-label":"\uD560\uC77C \uC0AD\uC81C",onClick:()=>{r(e,y.index),O(null)},sx:{color:"#e5484d"},children:he(Jc,{sx:{fontSize:19}})}):null,he(Bo,{sx:{flex:1}}),he(Qc,{color:"inherit",onClick:()=>O(null),children:"\uCDE8\uC18C"}),he(Qc,{variant:"contained",disabled:!y?.label.trim(),onClick:()=>{y&&y.label.trim()&&i?.(e,y.index,y.label.trim()),O(null)},children:"\uD655\uC778"})]})]})})]})}import{useRef as ST,useState as BT}from"react";import{Box as ft,IconButton as CT}from"@mui/material";import vT from"@mui/icons-material/Close";import nm from"@mui/icons-material/AttachFileOutlined";var bT=new Set(["jpg","jpeg","png","gif","bmp","webp","svg","pdf","txt","json","xml","log","md","markdown","csv","xls","xlsx","html","htm","js","jsx","ts","tsx","css","scss","sass","less","php","py","java","c","cpp","h","hpp","cs","go","rs","rb","swift","kt","scala","sql","sh","bash","bat","ps1","yml","yaml","toml","ini","conf","mp4","avi","mov","wmv","flv","webm","mp3","wav","ogg","m4a","aac"]),zi=e=>{let o=e?.split(".").pop()?.toLowerCase()??"";return bT.has(o)};import{LinearProgress as hT}from"@mui/material";import{Fragment as kT,jsx as yT,jsxs as TT}from"react/jsx-runtime";function om(e){let o=Tt(),t=o.useValue("attachmentUpload.taskSeq"),n=o.useValue("attachmentUpload.index"),r=o.useValue("attachmentUpload.total"),i=o.useValue("attachmentUpload.queue"),a=n??0;return!a||e>0&&(t??0)!==e?null:{index:a,total:r??0,queue:i??[]}}function pl(){let o=Tt().useValue("attachmentUpload.progress");return TT(kT,{children:[o??0,"%"]})}function tm(){let o=Tt().useValue("attachmentUpload.progress");return yT(hT,{variant:"determinate",value:o??0,sx:{height:4,borderRadius:2,bgcolor:"#dbe9fb",mt:.75}})}import{Fragment as IT,jsx as zo,jsxs as Rr}from"react/jsx-runtime";function qi(e){return e>=1048576?`${(e/1048576).toFixed(1)}MB`:`${Math.max(1,Math.round(e/1024))}KB`}var Ai={flex:1,minWidth:0,fontSize:13.5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function Li({taskSeq:e,attachments:o,onAdd:t,onRemove:n,removeLocked:r=!1,onPreview:i,onDownload:a}){let[l,u]=BT(!1),s=ST(null),m=Ie(),x=br(),p=gr(),c=om(e),f=e===0,E=y=>{if(i){i(y);return}window.open(p(y.uuid??""),"_blank","noopener,noreferrer")},v=y=>{if(a){a(y);return}window.open(p(y.uuid??"",{download:!0}),"_blank","noopener,noreferrer")},h=y=>c?y+1<c.index?"done":y+1===c.index?"uploading":"waiting":"waiting",g=(y,O,S,_={})=>Rr(ft,{sx:{px:1,py:.5,borderRadius:1,border:"1px solid",borderColor:_.uploading?"#d5e6fb":"#e6e6e3",bgcolor:_.uploading?"#f4f9ff":"transparent","&:hover .taskbox-file-remove":{opacity:1}},children:[Rr(ft,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[zo(nm,{sx:{fontSize:16,color:"#9a9a97"}}),O,zo(ft,{component:"span",sx:{fontSize:12,color:_.uploading?"#2f80ed":"#9a9a97",flexShrink:0},children:S}),_.removeIndex!==void 0?zo(CT,{className:"taskbox-file-remove",size:"small","aria-label":"\uCCA8\uBD80 \uC0AD\uC81C",onClick:()=>n(e,_.removeIndex),sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:zo(vT,{sx:{fontSize:15}})}):null]}),_.uploading?zo(tm,{}):null]},y),I=y=>{let O=zi(y.name);return zo(ft,{component:"button",type:"button",onClick:()=>O?E(y):v(y),title:`${y.name} ${O?"\uBBF8\uB9AC\uBCF4\uAE30":"\uB2E4\uC6B4\uB85C\uB4DC"}`,sx:{...Ai,color:"#37352f",textAlign:"left",p:0,border:"none",background:"none",font:"inherit",fontSize:13.5,cursor:"pointer","&:hover":{textDecoration:"underline",color:"#2f80ed"}},children:y.name})};return Rr(Go,{icon:zo(nm,{sx:{fontSize:18,display:"block"}}),title:Rr(IT,{children:["\uD30C\uC77C ",o.length>0?o.length:""]}),children:[Rr(ft,{sx:{display:"flex",flexDirection:"column",gap:.5,mt:1},children:[o.map((y,O)=>{let S=`${y.uuid||y.name}-${O}`;if(f){let _=h(O),P=_==="uploading";return g(S,zo(ft,{component:"span",sx:{...Ai,color:_==="done"?"#37352f":"#9a9a97"},children:y.name}),P?zo(pl,{}):qi(y.size),{uploading:P,removeIndex:!r&&!c?O:void 0})}return y.uuid?g(S,I(y),qi(y.size),{removeIndex:r?void 0:O}):g(S,zo(ft,{component:"span",title:"\uC2E4\uD30C\uC77C\uC774 \uC5C6\uB294 \uC774\uC804 \uBC29\uC2DD \uCCA8\uBD80\uC785\uB2C8\uB2E4(\uB2E4\uC6B4\uB85C\uB4DC \uBD88\uAC00) \u2014 \uB2E4\uC2DC \uCCA8\uBD80\uD574 \uC8FC\uC138\uC694.",sx:{...Ai,color:"#9a9a97"},children:y.name}),qi(y.size),{removeIndex:r?void 0:O})}),!f&&c?c.queue.slice(c.index-1).map((y,O)=>{let S=O===0;return g(`uploading-${c.index+O}-${y.name}`,zo(ft,{component:"span",sx:{...Ai,color:"#9a9a97"},children:y.name}),S?zo(pl,{}):qi(y.size),{uploading:S})}):null]}),zo(ft,{onClick:()=>s.current?.click(),onDragOver:y=>{y.preventDefault(),u(!0)},onDragLeave:()=>u(!1),onDrop:y=>{y.preventDefault(),u(!1);let O=Array.from(y.dataTransfer.files);O.length>0&&t(e,O)},sx:{mt:1,py:2.5,display:"flex",alignItems:"center",justifyContent:"center",gap:.5,border:"1.5px dashed",borderColor:l?"#2f80ed":"#cfcfcc",borderRadius:1,bgcolor:l?"#eef6ff":"transparent",color:"#787774",fontSize:13.5,cursor:"pointer",transition:"background-color 0.15s, border-color 0.15s","&:hover":{bgcolor:"#fafaf9",borderColor:"#9a9a97"}},children:m?`\uD30C\uC77C\uC744 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${x}MB)`:`\uD30C\uC77C\uC744 \uB04C\uC5B4\uB2E4 \uB193\uAC70\uB098 \uD074\uB9AD\uD574 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${x}MB)`}),zo(ft,{component:"input",ref:s,type:"file",multiple:!0,onChange:y=>{let O=Array.from(y.target.files??[]);O.length>0&&t(e,O),y.target.value=""},sx:{display:"none"}})]})}import{useState as PT}from"react";import{Checkbox as RT,Divider as zT,ListItemIcon as qT,Menu as AT,MenuItem as lm}from"@mui/material";import LT from"@mui/icons-material/Add";import{useEffect as _T,useState as rm}from"react";import{Box as fl,Button as wT}from"@mui/material";import{FormDialog as DT}from"@ehfuse/mui-form-dialog";import{ClearTextField as MT}from"@ehfuse/mui-form-controls";import{ColorPicker as ET}from"@ehfuse/mui-color-picker";import{ErrorAlert as OT}from"@ehfuse/alerts";import{jsx as zr,jsxs as xl}from"react/jsx-runtime";var im="#2f80ed";function am({open:e,onClose:o,onSubmit:t}){let[n,r]=rm(""),[i,a]=rm(im);_T(()=>{e&&(r(""),a(im))},[e]);let l=()=>{let m=n.trim();if(!m){OT("\uB77C\uBCA8 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}t(m,i),o()},u=us(i),s=xl(fl,{children:[xl(fl,{sx:{display:"flex",alignItems:"center",gap:1.5,mt:.5},children:[zr(MT,{label:"\uB77C\uBCA8 \uC774\uB984",value:n,onChange:m=>r(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),l())},fullWidth:!0,autoFocus:!0}),zr(ET,{value:i,onChange:m=>a(m),shape:"circle",colorSize:28})]}),xl(fl,{sx:{mt:2,display:"flex",alignItems:"center",gap:1,fontSize:13,color:"#787774"},children:["\uBBF8\uB9AC\uBCF4\uAE30",zr(ze,{option:{key:"__preview__",name:n.trim()||"\uB77C\uBCA8",...u}})]})]});return zr(DT,{open:e,onClose:o,maxWidth:"xs",title:"\uC0C8 \uB77C\uBCA8 \uCD94\uAC00",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-add-label",sections:[{id:"add-label",showTitle:!1,children:s}],actions:{showCancelButton:!0,right:zr(wT,{variant:"contained",onClick:l,children:"\uCD94\uAC00"})}})}import{Fragment as NT,jsx as Jn,jsxs as Ni}from"react/jsx-runtime";function Fi({anchorEl:e,selectedKeys:o,labelOptions:t,onToggle:n,onAddLabel:r,onClose:i}){let[a,l]=PT(!1),u=at();return Ni(NT,{children:[Ni(AT,{anchorEl:e,open:!!e,onClose:i,transitionDuration:0,...u,children:[t.map(s=>{let m=o.includes(s.key);return Ni(lm,{onClick:()=>n(s.key),sx:{fontSize:14,minWidth:170,gap:1},children:[Jn(RT,{size:"small",checked:m,sx:{p:0}}),Jn(ze,{option:s})]},s.key)}),Jn(zT,{}),Ni(lm,{onClick:()=>l(!0),sx:{fontSize:14,color:"#787774"},children:[Jn(qT,{children:Jn(LT,{sx:{fontSize:18,color:"#787774"}})}),"\uB77C\uBCA8 \uCD94\uAC00"]})]}),Jn(am,{open:a,onClose:()=>l(!1),onSubmit:r})]})}function sm(e,o){let t=Number(e.author_account_seq??0);return o.filter(n=>{let r=Number(n.account_seq??0);return r>0&&r!==t})}function cm(e,o){let t=(e.target_account_seqs??[]).filter(x=>x>0);if(t.length===0)return null;let n=new Set(t),r=sm(e,o),i=new Map;for(let x of r){let p=String(x.department??"").trim();if(!p)continue;let c=i.get(p)??[];c.push(x),i.set(p,c)}let a=[],l=new Set;for(let[x,p]of i)if(p.every(f=>n.has(Number(f.account_seq??0)))){a.push(x);for(let f of p)l.add(Number(f.account_seq??0))}let u=new Map(r.map(x=>[Number(x.account_seq??0),x.name])),s=e.target_names??[],m=[];return t.forEach((x,p)=>{l.has(x)||m.push(u.get(x)??s[p]??"\uC774\uB984\uC5C6\uC74C")}),{teamNames:a,individualNames:m}}function Hi(e,o){let t=cm(e,o);return t?[...t.teamNames,...t.individualNames].join(", "):"\uBAA8\uB4E0 \uC9C1\uC6D0"}function DP(e,o){let t=cm(e,o);return t?{kind:"members",teamNames:t.teamNames,individualNames:t.individualNames}:{kind:"everyone"}}function mm(e,o,t){let n=(e.target_account_seqs??[]).filter(m=>m>0),r=sm(e,o),i=n.length>0?n.length:r.length,a=e.acks??[],l=t>0&&a.some(m=>m.account_seq===t),u=t>0&&Number(e.author_account_seq??0)===t,s=n.length===0||n.includes(t);return{count:a.length,total:i,acked:l,canAck:t>0&&!u&&s&&!l&&!e.completed}}function um(e,o){let t=Number(o)||50,n=t*1024*1024,r=e.filter(l=>l.size>n),i=e.filter(l=>l.size<=n),a=r.length>0?`\uD30C\uC77C\uC740 1\uAC1C\uB2F9 \uCD5C\uB300 ${t}MB \uAE4C\uC9C0 \uCCA8\uBD80\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
7
7
  \uC81C\uC678\uB41C \uD30C\uC77C: ${r.map(l=>l.name).join(", ")}`:null;return{accepted:i,rejected:r,message:a}}import{Fragment as Wi,jsx as re,jsxs as er}from"react/jsx-runtime";var bm="#0f9d58";function bl({form:e,statusOptions:o,customTabs:t,sprints:n=[],avatarSrcByName:r,isNotice:i=!1,hideProject:a=!1,hideBug:l=!1,leadingRow:u,hideLabel:s=!1,employees:m=[],myAccountSeq:x=0,departments:p=[],myGroupSeq:c=0,onMemberEdit:f,onAddProject:E,onAddLabelOption:v,contentSyncKey:h="create"}){let g=Tt(),I=br(),y=e.useFormValue("manager_name"),O=e.useFormValue("receiver_names"),S=e.useFormValue("start_date"),_=!!e.useFormValue("is_event"),P=!!e.useFormValue("is_bug"),C=e.useFormValue("bug_repro")??"",M=e.useFormValue("bug_device")??"",N=e.useFormValue("bug_where")??"",d=e.useFormValue("bug_version")??"",T=e.useFormValue("event_time")??"",k=e.useFormValue("event_place")??"",b=e.useFormValue("event_address")??"",z=e.useFormValue("due_date"),L=e.useFormValue("estimated_time")??"",ie=e.useFormValue("reminder"),se=e.useFormValue("priority"),Se=e.useFormValue("content"),ae=e.useFormValue("checklist")??[],fe=e.useFormValue("tab_key"),ce=e.useFormValue("sprint_seq")??0,ke=e.useFormValue("story_points")??0,Oe=t.find(w=>w.key===fe&&w.useSprints),me=Oe?n.filter(w=>`custom-${w.group_seq}`===fe):[],[W,V]=gl(null),J=e.useFormValue("label_keys"),[B,F]=gl(null),Y=e.useFormValue("visibility")||"involved",K=Number(e.useFormValue("visibility_group_seq")??0),[we,Ae]=gl(null),eo=e.useFormValue("target_names"),Ye=e.useFormValue("target_account_seqs"),Xe=g.useValue("createAttachmentFiles")??[],X=i?Hi({author_account_seq:x,target_names:eo,target_account_seqs:Ye},m):"";return er(Wi,{children:[u,i?null:re(qr,{sx:{display:"flex",gap:1.25,px:2,pt:1.5,pb:1.5,flexShrink:0},children:[{value:"task",label:"\uC5C5\uBB34"},{value:"event",label:"\uC77C\uC815"},...l?[]:[{value:"bug",label:"\uC624\uB958"}]].map(w=>{let De=P?"bug":_?"event":"task",H=De===w.value;return re(FT,{onClick:()=>{if(De===w.value)return;e.setFormValue("is_event",w.value==="event"),e.setFormValue("is_bug",w.value==="bug"),e.setFormValue("visibility",w.value==="bug"?"all":"involved"),e.setFormValue("visibility_group_seq",0);let ve=e.getFormValue("icon"),oo=e.getFormValue("icon_color"),Io=[Pe,"event",hr].includes(ve),Fo=!oo||oo===bm||oo===kr;Io&&e.setFormValue("icon",w.value==="event"?"event":w.value==="bug"?hr:Pe),Fo&&e.setFormValue("icon_color",w.value==="event"?bm:w.value==="bug"?kr:"")},sx:{px:1.75,py:.75,borderRadius:99,fontSize:13.5,fontWeight:H?600:400,color:H?"#ffffff":"#787774",bgcolor:H?"#2563eb":"#f4f4f2"},children:w.label},w.label)})}),re(Ar,{sx:{borderColor:"#e6e6e3"}}),er(qr,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:.25},children:[re(Mi,{hideProject:a,showEstimatedTime:!_,values:{tabKey:fe,managerName:y,receiverNames:O,startDate:S,dueDate:z,reminder:ie,priority:se,estimatedTime:L,eventTime:T,eventPlace:k,eventAddress:b},onChangeEstimatedTime:w=>e.setFormValue("estimated_time",w),customTabs:t,avatarSrcByName:r,notice:i,event:_,onChangeEventTime:w=>e.setFormValue("event_time",w),onChangeEventPlace:w=>e.setFormValue("event_place",w),onChangeEventAddress:w=>e.setFormValue("event_address",w),targetSummary:X,onChangeProject:w=>e.setFormValue("tab_key",w),onAddProject:E,onChangeStartDate:w=>e.setFormValue("start_date",w),onChangeDueDate:w=>e.setFormValue("due_date",w),onChangeReminder:w=>e.setFormValue("reminder",w),onChangePriority:w=>e.setFormValue("priority",w),onMemberEdit:f,trailing:er(Wi,{children:[i?null:re(de,{icon:Y==="all"?re(xm,{sx:{fontSize:17,color:"#2f80ed"}}):Y==="group"?re(gm,{sx:{fontSize:17,color:"#d9730d"}}):re(fm,{sx:{fontSize:17}}),label:"\uACF5\uAC1C",onClick:w=>Ae(w),children:Y==="all"?"\uC804\uCCB4\uACF5\uAC1C":Y==="group"?`\uBD80\uC11C\uACF5\uAC1C \xB7 ${p.find(w=>w.seq===K)?.name??"\uBD80\uC11C"}`:"\uBE44\uACF5\uAC1C"}),Oe&&!_&&!i?er(Wi,{children:[re(de,{icon:re(KT,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:w=>V(w),children:ce>0?me.find(w=>w.seq===ce)?.name??"\uC0AD\uC81C\uB41C \uBAA9\uD45C":re(qr,{component:"span",sx:{color:"#9a9a97"},children:"\uBBF8\uBC30\uC815"})}),re(de,{icon:re(UT,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",children:re(Lt,{value:ke>0?String(ke):"",placeholder:"\uBBF8\uCD94\uC815",onCommit:w=>e.setFormValue("story_points",Number(w.replace(/[^0-9.]/g,""))||0)})})]}):null,P?re(Ei,{values:{repro:C,device:M,where:N,version:d},onChangeRepro:w=>e.setFormValue("bug_repro",w),onChangeDevice:w=>e.setFormValue("bug_device",w),onChangeWhere:w=>e.setFormValue("bug_where",w),onChangeVersion:w=>e.setFormValue("bug_version",w)}):null]}),leading:_||s?null:re(qr,{sx:{gridColumn:"1 / -1"},children:re(de,{icon:re(VT,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:w=>F(w),children:(J??[]).length>0?re(Ut,{labelKeys:J??[],labelOptions:o}):re(qr,{component:"span",sx:{color:"#9a9a97"},children:"\uBE44\uC5B4 \uC788\uC74C"})})})}),re(Ar,{sx:{my:1.5,borderColor:"#e6e6e3"}}),re(Go,{icon:re(WT,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",children:re(Oi,{syncKey:h,value:Se,onChange:w=>e.setFormValue("content",w)})}),_?null:re(Ar,{sx:{my:1.5,borderColor:"#e6e6e3"}}),_?null:re(Ri,{taskSeq:0,checklist:ae,onAdd:(w,De)=>e.setFormValue("checklist",[...ae,{label:De,checked:!1}]),onToggle:(w,De,H)=>e.setFormValue("checklist",ae.map((ve,oo)=>oo===De?{...ve,checked:H}:ve)),onRemove:(w,De)=>e.setFormValue("checklist",ae.filter((H,ve)=>ve!==De)),onUpdate:(w,De,H)=>e.setFormValue("checklist",ae.map((ve,oo)=>oo===De?{...ve,label:H}:ve))}),re(Ar,{sx:{my:1.5,borderColor:"#e6e6e3"}}),re(Li,{taskSeq:0,attachments:Xe.map(w=>({name:w.name,size:w.size})),onAdd:(w,De)=>{let H=um(De,I);H.message&&jT(H.message),H.accepted.length!==0&&g.setValue("createAttachmentFiles",[...g.getValue("createAttachmentFiles")??[],...H.accepted])},onRemove:(w,De)=>g.setValue("createAttachmentFiles",Xe.filter((H,ve)=>ve!==De))}),P?null:er(Wi,{children:[re(Ar,{sx:{my:1.5,borderColor:"#e6e6e3"}}),re(Go,{icon:re($T,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:re(GT,{form:e,name:"note",placeholder:"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",sx:{mt:1}})})]})]}),re(dm,{transitionDuration:0,anchorEl:W,open:!!W,onClose:()=>V(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...me.map(w=>({seq:w.seq,label:Ko(w)}))].map(w=>re(pm,{onClick:()=>{e.setFormValue("sprint_seq",w.seq),V(null)},sx:{fontSize:14,minWidth:170},children:w.label},w.seq))}),re(dm,{transitionDuration:0,anchorEl:we,open:!!we,onClose:()=>Ae(null),children:[{key:"involved",label:"\uBE44\uACF5\uAC1C",tip:"\uC791\uC131\uC790\xB7\uCC45\uC784\uC790\xB7\uCC38\uC870\uC790\uB9CC \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4",icon:re(fm,{sx:{fontSize:17,color:"#57564f"}}),selected:Y==="involved",onPick:()=>{e.setFormValue("visibility","involved"),e.setFormValue("visibility_group_seq",0)}},{key:"all",label:"\uC804\uCCB4\uACF5\uAC1C",tip:"\uBAA8\uB4E0 \uC9C1\uC6D0\uC774 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4",icon:re(xm,{sx:{fontSize:17,color:"#2f80ed"}}),selected:Y==="all",onPick:()=>{e.setFormValue("visibility","all"),e.setFormValue("visibility_group_seq",0)}},...[...p].sort((w,De)=>w.seq===c?-1:De.seq===c?1:0).map(w=>({key:`group-${w.seq}`,label:`\uBD80\uC11C\uACF5\uAC1C \xB7 ${w.name}`,tip:`${w.name} \uC18C\uC18D \uC9C1\uC6D0\uC774 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4`,icon:re(gm,{sx:{fontSize:17,color:"#d9730d"}}),selected:Y==="group"&&K===w.seq,onPick:()=>{e.setFormValue("visibility","group"),e.setFormValue("visibility_group_seq",w.seq)}}))].map(w=>re(HT,{title:w.tip,arrow:!0,disableInteractive:!0,placement:"right",children:er(pm,{selected:w.selected,onClick:()=>{w.onPick(),Ae(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[w.icon,w.label]})},w.key))}),re(Fi,{anchorEl:B,selectedKeys:J??[],labelOptions:o,onToggle:w=>e.setFormValue("label_keys",Qr(J??[],w)),onAddLabel:(w,De)=>v?.(w,De),onClose:()=>F(null)})]})}import{Fragment as Tm,jsx as Ge,jsxs as or}from"react/jsx-runtime";function TR({open:e,onClose:o,...t}){let{form:n,presetTitle:r="",presetContent:i="",presetVisibility:a,presetDueDate:l="",presetTabKey:u="",presetManager:s=null,isNotice:m=!1,defaultBug:x=!1}=t,p=Tt(),c=XT(!1),[f,E]=hm(0),[v,h]=hm(null),g=n.useFormValue("title"),I=n.useFormValue("icon"),y=n.useFormValue("icon_color"),O=!!n.useFormValue("is_event"),S=!!n.useFormValue("is_bug"),_=Ie(),C=p.useValue("createSubmitting")??!1,M=zn(I||Pe),N=m?"\uACF5\uC9C0 \uB4F1\uB85D":O?"\uC77C\uC815 \uB4F1\uB85D":S?"\uC624\uB958 \uB4F1\uB85D":"\uC5C5\uBB34 \uB4F1\uB85D",d=m?"\uACF5\uC9C0 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":O?"\uC77C\uC815 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":S?"\uC5B4\uB5A4 \uC624\uB958\uC778\uC9C0 \uD55C \uC904\uB85C \uC801\uC5B4\uC8FC\uC138\uC694":"\uC5C5\uBB34 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694";YT(()=>{let b=c.current;c.current=e,!(!e||b)&&(n.setFormValues({...n.getFormValues(),title:r,icon:m?Eo:x?hr:Pe,icon_color:m?"#e5484d":x?kr:"",manager_name:s?.name??"",manager_account_seq:s?.accountSeq??0,receiver_names:[],receiver_account_seqs:[],is_notice:m,is_event:!1,is_bug:x,visibility:a??(x?"all":"involved"),visibility_group_seq:0,bug_repro:"",bug_device:"",bug_where:"",bug_version:"",event_time:"",event_place:"",event_address:"",target_names:[],target_account_seqs:[],start_date:He(new Date),due_date:l,reminder:"none",priority:"medium",note:"",content:i,checklist:[],tab_key:u}),p.setValue("createAttachmentFiles",[]),E(z=>z+1))},[e]);let T=or(ln,{sx:{display:"flex",alignItems:"center",gap:1,px:2,pt:2,pb:1},children:[Ge(kl,{size:"small","aria-label":"\uC544\uC774\uCF58 \uBCC0\uACBD",onClick:b=>h(b.currentTarget),sx:{p:0,color:y||"#1e3a8a"},children:Ge(M,{sx:{fontSize:20}})}),Ge(ln,{component:"input",autoFocus:!0,spellCheck:!1,value:g,placeholder:d,onChange:b=>n.setFormValue("title",b.target.value),sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:19,fontWeight:600,color:"#37352f",p:0,m:0,"&::placeholder":{color:"#c9c8c5",fontWeight:400}}})]}),k=Ge(Qn,{anchorEl:v,value:I,color:y||"#1e3a8a",onSelect:b=>n.setFormValue("icon",b),onSelectColor:b=>n.setFormValue("icon_color",b),onClose:()=>h(null)});return _?or(Tm,{children:[Ge(oy,{open:e,onClose:o,locale:"ko",fontScale:{enabled:!0,default:1.1,min:.6},title:N,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1},custom:[{icon:Ge(hl,{variant:"contained",size:"small",disableElevation:!0,disabled:C,onClick:C?void 0:n.submit,sx:{ml:2,minWidth:0,px:1.5,py:.35,fontSize:14,fontWeight:600,bgcolor:"#2f80ed","&:hover":{bgcolor:"#2f80ed"}},children:"\uC800\uC7A5"}),tooltip:C?"\uC800\uC7A5 \uC911\u2026":""}]},fullScreen:!0,mobilePresentation:"slide",tabs:{visible:!1},contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,contentBottomPadding:0,scrollPastLastSection:!1,overlayScrollbar:{enabled:!0,contentStyle:{minWidth:0}},actions:{visible:!1},sections:[{id:"task-create",title:"",showTitle:!1,children:Ge(ln,{sx:{width:"100%",minWidth:0,display:"flex",flexDirection:"column",gap:0},children:Ge(bl,{...t,contentSyncKey:`create-${f}`,leadingRow:T})})}]}),k]}):or(Tm,{children:[Ge(QT,{anchor:"right",open:e,onClose:o,sx:{zIndex:b=>b.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:or(ln,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[or(ln,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[Ge(ZT,{title:"\uC544\uC774\uCF58 \uBCC0\uACBD",arrow:!0,children:Ge(kl,{size:"small",onClick:b=>h(b.currentTarget),sx:{color:y||"#1e3a8a"},children:Ge(M,{sx:{fontSize:20}})})}),Ge(ln,{component:"input",autoFocus:!0,spellCheck:!1,value:g,placeholder:d,onChange:b=>n.setFormValue("title",b.target.value),sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:18,fontWeight:500,color:"#37352f",p:0,m:0,"&::placeholder":{color:"#c9c8c5",fontWeight:400}}}),Ge(kl,{"aria-label":"\uB2EB\uAE30",onClick:o,sx:{color:"#6b7280"},children:Ge(JT,{})})]}),Ge(km,{sx:{borderColor:"#e6e6e3"}}),Ge(ln,{sx:{flex:1,minHeight:0},children:Ge(ey,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:Ge(bl,{...t,contentSyncKey:`create-${f}`})})}),Ge(km,{sx:{borderColor:"#e6e6e3"}}),or(ln,{sx:{display:"flex",justifyContent:"flex-end",gap:1,px:2,py:1.5,flexShrink:0},children:[Ge(hl,{onClick:o,color:"inherit",disabled:C,children:"\uCDE8\uC18C"}),Ge(hl,{onClick:n.submit,variant:"contained",disabled:C,children:C?"\uB4F1\uB85D \uC911\u2026":"\uB4F1\uB85D"})]})]})}),k]})}import{useEffect as Um,useRef as Gm,useState as jm}from"react";import{Box as Yi,Button as o0,Divider as Ym,Drawer as t0}from"@mui/material";import n0 from"@mui/icons-material/ShareOutlined";import r0 from"@mui/icons-material/HistoryOutlined";import i0 from"@ehfuse/overlay-scrollbar";import{FormDialog as a0}from"@ehfuse/mui-form-dialog";import{SuccessAlert as Xm}from"@ehfuse/alerts";import{useRef as yl,useState as tr}from"react";import{Box as te,Button as ym,Chip as $i,IconButton as tt,Tooltip as vm}from"@mui/material";import Sm from"@mui/icons-material/Send";import{TextField as ty}from"@ehfuse/mui-form-controls";import Vi from"@mui/icons-material/Close";import ny from"@mui/icons-material/EditOutlined";import ry from"@mui/icons-material/Favorite";import iy from"@mui/icons-material/FavoriteBorderOutlined";import ay from"@mui/icons-material/CheckCircle";import ly from"@mui/icons-material/CheckCircleOutlineOutlined";import nr from"@mui/icons-material/AttachFileOutlined";import sy from"@mui/icons-material/AddCircleOutline";import cy from"@mui/icons-material/ImageOutlined";var Tl=e=>{if(e===0)return"0 Bytes";let o=1024,t=["Bytes","KB","MB","GB","TB"],n=Math.floor(Math.log(e)/Math.log(o));return parseFloat((e/Math.pow(o,n)).toFixed(2))+" "+t[n]};import{Fragment as Cm,jsx as U,jsxs as je}from"react/jsx-runtime";var my=5;function Bm({kind:e,reactions:o,myAccountSeq:t,onToggle:n}){let r=o??[],i=t>0&&r.some(s=>s.account_seq===t),a=e==="like"?"\uC88B\uC544\uC694":"\uD655\uC778",l=r.length===0?a:U(te,{sx:{whiteSpace:"pre-line",fontSize:12},children:r.map(s=>`${s.name} \xB7 ${s.time}`).join(`
8
- `)}),u=e==="like"?"#e5484d":"#2f80ed";return U(vm,{title:l,arrow:!0,enterDelay:300,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:je(te,{sx:{display:"inline-flex",alignItems:"center"},children:[U(tt,{size:"small","aria-label":`\uB313\uAE00 ${a}`,onClick:n,sx:{color:i?u:"#c9c8c5",p:.5},children:e==="like"?i?U(ry,{sx:{fontSize:16}}):U(iy,{sx:{fontSize:16}}):i?U(ay,{sx:{fontSize:16}}):U(ly,{sx:{fontSize:16}})}),r.length>0?U(te,{component:"span",sx:{fontSize:12,color:i?u:"#9a9a97",ml:-.25},children:r.length}):null]})})}function Im({taskSeq:e,comments:o,currentUserName:t="",myAccountSeq:n=0,avatarSrcByName:r,onUpdate:i,onRemove:a,onToggleReaction:l,onPreview:u,onDownload:s}){let[m,x]=tr(null),p=yl(null),[c,f]=tr(null),[E,v]=tr(!1),h=Math.max(0,o.length-my),g=h>0&&!E,I=m?Math.min(m.index,h):h,y=o.map((C,M)=>({comment:C,index:M})).slice(g?I:0),O=gr(),S=C=>{if(u){u(C);return}window.open(O(C.uuid??""),"_blank","noopener,noreferrer")},_=C=>{if(s){s(C);return}window.open(O(C.uuid??"",{download:!0}),"_blank","noopener,noreferrer")},P=No().slots?.avatar;return je(te,{sx:{px:2,pb:2,display:"flex",flexDirection:"column",gap:.25},children:[je(te,{sx:{display:"flex",alignItems:"center",gap:1},children:[U(jt,{sx:{fontSize:18,display:"block",color:"#37352f"}}),je(te,{sx:{fontSize:ll,fontWeight:500,color:"#37352f"},children:["\uB313\uAE00",o.length>0?` (${o.length})`:""]}),h>0&&(!g||I>0)?U(te,{role:"button",tabIndex:0,onClick:()=>v(C=>!C),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),v(M=>!M))},sx:{ml:"auto",flexShrink:0,cursor:"pointer",fontSize:14.5,color:"#5b87d6","&:hover":{textDecoration:"underline"}},children:g?`\uC774\uC804 \uB313\uAE00 ${I}\uAC1C \uB354 \uBCF4\uAE30`:"\uC774\uC804 \uB313\uAE00 \uC811\uAE30"}):null]}),o.length===0?U(te,{sx:{mt:1,fontSize:14.5,color:"#9a9a97"},children:"\uB4F1\uB85D\uB41C \uB313\uAE00\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,U(te,{sx:{display:"flex",flexDirection:"column",gap:1,mt:1},children:y.map(({comment:C,index:M})=>{let N=!!t&&C.author===t;return je(te,{sx:{display:"flex",gap:1.5,alignItems:"flex-start","&:hover .taskbox-comment-actions":{opacity:1,pointerEvents:"auto"},"&:not(:last-child)":{borderBottom:"1px dashed #e0dfdc",pb:1}},children:[(()=>{let d=r?.get(C.author)??"";return P?U(te,{sx:{display:"inline-flex",flexShrink:0},children:U(P,{name:C.author,src:d||void 0,size:44})}):U(te,{sx:{display:"inline-flex",flexShrink:0},children:U(lt,{src:d,avatarSx:{width:44,height:44,fontSize:20,borderRadius:"50%",...Nn[0]},iconFontSize:24})})})(),je(te,{sx:{flex:1,minWidth:0},children:[je(te,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0,position:"relative"},children:[U(te,{component:"span",sx:{fontSize:14.5,fontWeight:700,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:C.author}),U(te,{component:"span",sx:{fontSize:12.5,color:"#9a9a97",flexShrink:0,whiteSpace:"nowrap"},children:C.time}),N?U(te,{sx:{ml:"auto"}}):je(te,{sx:{display:"flex",alignItems:"center",gap:.25,ml:"auto",flexShrink:0},children:[U(Bm,{kind:"like",reactions:C.likes,myAccountSeq:n,onToggle:()=>l?.(e,M,"like")}),U(Bm,{kind:"ack",reactions:C.acks,myAccountSeq:n,onToggle:()=>l?.(e,M,"ack")})]}),N?je(te,{className:"taskbox-comment-actions",sx:{display:"flex",alignItems:"center",gap:.25,position:"absolute",right:0,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",backgroundColor:"#fff",opacity:0,transition:"opacity 0.15s"},children:[U(tt,{size:"small","aria-label":"\uB313\uAE00 \uC218\uC815",onClick:()=>x({index:M,text:C.text,attachments:[...C.attachments??[]],files:[]}),sx:{color:"#9a9a97"},children:U(ny,{sx:{fontSize:15}})}),U(tt,{size:"small","aria-label":"\uB313\uAE00 \uC0AD\uC81C",onClick:d=>f({anchorEl:d.currentTarget,index:M}),sx:{color:"#9a9a97"},children:U(Vi,{sx:{fontSize:15}})})]}):null]}),m?.index===M?je(te,{sx:{mt:.5},children:[U(te,{component:"textarea",autoFocus:!0,spellCheck:!1,value:m.text,onChange:d=>x({...m,text:d.target.value}),sx:{width:"100%",minHeight:56,border:"1px solid #dedddb",borderRadius:1,outline:"none",font:"inherit",fontSize:14,p:1,resize:"vertical"}}),je(te,{sx:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:.75,mt:.75},children:[m.attachments.map((d,T)=>{let k=()=>x({...m,attachments:m.attachments.filter((b,z)=>z!==T)});return Ki(d.name)&&d.uuid?je(te,{sx:{position:"relative"},children:[U(te,{component:"img",src:O(d.uuid,{thumb:"md"}),alt:d.name,title:d.name,loading:"lazy",sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",display:"block"}}),U(tt,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:k,sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:U(Vi,{sx:{fontSize:14}})})]},`kept-${d.uuid}-${T}`):U($i,{size:"small",icon:U(nr,{sx:{fontSize:14}}),label:d.name,onDelete:k,sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`kept-${d.uuid??d.name}-${T}`)}),m.files.map((d,T)=>{let k=()=>x({...m,files:m.files.filter((b,z)=>z!==T)});return Ki(d.name)?je(te,{sx:{position:"relative"},children:[U(te,{component:"img",src:URL.createObjectURL(d),alt:d.name,title:`${d.name} (\uC0C8 \uD30C\uC77C)`,onLoad:b=>URL.revokeObjectURL(b.target.src),sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"2px solid #2f80ed",display:"block"}}),U(tt,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:k,sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:U(Vi,{sx:{fontSize:14}})})]},`new-${d.name}-${T}`):U($i,{size:"small",icon:U(nr,{sx:{fontSize:14}}),label:`${d.name} (\uC0C8 \uD30C\uC77C)`,onDelete:k,sx:{fontSize:14,height:26,bgcolor:"#eef4ff"}},`new-${d.name}-${T}`)}),U(vm,{title:"\uCCA8\uBD80 \uCD94\uAC00",arrow:!0,children:U(tt,{size:"small","aria-label":"\uCCA8\uBD80 \uCD94\uAC00",onClick:()=>p.current?.click(),sx:{ml:"auto",color:"#2f80ed"},children:U(sy,{sx:{fontSize:20}})})})]}),je(te,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:.75,mt:.5},children:[U(ym,{size:"small",color:"inherit",onClick:()=>x(null),children:"\uCDE8\uC18C"}),U(ym,{size:"small",variant:"contained",disabled:!m.text.trim()&&m.attachments.length===0&&m.files.length===0,onClick:()=>{i(e,M,m.text,{attachments:m.attachments,files:m.files}),x(null)},children:"\uC800\uC7A5"})]}),U(te,{component:"input",type:"file",multiple:!0,ref:p,sx:{display:"none"},onChange:d=>{let T=Array.from(d.target.files??[]);T.length>0&&x({...m,files:[...m.files,...T].slice(0,10)}),d.target.value=""}})]}):je(te,{children:[C.text?U(te,{sx:{fontSize:15,whiteSpace:"pre-wrap"},children:C.text}):null,(C.attachments??[]).length>0?U(te,{sx:{display:"flex",flexWrap:"wrap",gap:.75,mt:.75},children:(C.attachments??[]).map((d,T)=>{let k=!!d.uuid;if(Ki(d.name)&&k)return U(te,{component:"img",src:O(d.uuid??"",{thumb:"md"}),alt:d.name,title:`${d.name} \uD06C\uAC8C \uBCF4\uAE30`,loading:"lazy",onClick:()=>S(d),sx:{width:96,height:96,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",cursor:"pointer",bgcolor:"#f8fafc"}},`${d.name}-${T}`);let z=zi(d.name);return U($i,{size:"small",icon:U(nr,{sx:{fontSize:14}}),label:`${d.name} (${Tl(d.size)})`,clickable:k,onClick:k?()=>z?S(d):_(d):void 0,title:k?`${d.name} ${z?"\uBBF8\uB9AC\uBCF4\uAE30":"\uB2E4\uC6B4\uB85C\uB4DC"}`:d.name,sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`${d.name}-${T}`)})}):null]})]})]},`${C.time}-${M}`)})}),U(We,{open:!!c,anchorEl:c?.anchorEl??null,title:"\uC774 \uB313\uAE00\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uC0AD\uC81C",onCancel:()=>f(null),onConfirm:()=>{c&&(a(e,c.index),x(null)),f(null)}})]})}function Ki(e){return/\.(png|jpe?g|gif|webp|bmp|svg|heic|heif)$/i.test(String(e??"").trim())}function _m({onSubmit:e}){let[o,t]=tr(""),[n,r]=tr([]),[i,a]=tr(!1),l=yl(null),u=yl(null),s=Ie(),m=c=>{let f=Array.from(c??[]);f.length!==0&&r(E=>[...E,...f].slice(0,10))},x=()=>{let c=o.trim();!c&&n.length===0||(e(c,n.length>0?n:void 0),t(""),r([]))},p=je(Cm,{children:[U(tt,{size:"small","aria-label":"\uD30C\uC77C \uCCA8\uBD80",onClick:()=>l.current?.click(),sx:{color:"#9a9a97"},children:U(nr,{sx:{fontSize:20}})}),U(tt,{size:"small","aria-label":"\uC774\uBBF8\uC9C0 \uCCA8\uBD80",onClick:()=>u.current?.click(),sx:{color:"#9a9a97"},children:U(cy,{sx:{fontSize:20}})})]});return je(te,{children:[n.length>0?U(te,{sx:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:.75,px:2,pt:1},children:n.map((c,f)=>Ki(c.name)?je(te,{sx:{position:"relative"},children:[U(te,{component:"img",src:URL.createObjectURL(c),alt:c.name,title:c.name,onLoad:E=>URL.revokeObjectURL(E.target.src),sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",display:"block"}}),U(tt,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:()=>r(E=>E.filter((v,h)=>h!==f)),sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:U(Vi,{sx:{fontSize:14}})})]},`${c.name}-${f}`):U($i,{size:"small",icon:U(nr,{sx:{fontSize:14}}),label:`${c.name} (${Tl(c.size)})`,onDelete:()=>r(E=>E.filter((v,h)=>h!==f)),sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`${c.name}-${f}`))}):null,je(te,{sx:{position:"relative",display:"flex"},onDragOver:c=>{Array.from(c.dataTransfer?.types??[]).includes("Files")&&(c.preventDefault(),a(!0))},onDragLeave:c=>{c.currentTarget.contains(c.relatedTarget)||a(!1)},onDrop:c=>{Array.from(c.dataTransfer?.types??[]).includes("Files")&&(c.preventDefault(),a(!1),m(c.dataTransfer?.files??null))},children:[i?je(te,{sx:{position:"absolute",inset:0,zIndex:2,display:"flex",alignItems:"center",justifyContent:"center",gap:.75,borderRadius:1,border:"2px dashed #2f80ed",bgcolor:"rgba(47,128,237,0.08)",color:"#2f80ed",fontSize:14,fontWeight:600,pointerEvents:"none"},children:[U(nr,{sx:{fontSize:18}}),"\uC5EC\uAE30\uC5D0 \uB193\uC73C\uBA74 \uCCA8\uBD80\uB429\uB2C8\uB2E4"]}):null,U(ty,{value:o,placeholder:"\uB313\uAE00\uC744 \uC785\uB825\uD558\uC138\uC694",onChange:c=>t(c.target.value),fullWidth:!0,multiline:!0,minRows:s?1:3,maxRows:3,sx:{"& .MuiInputBase-root":{pl:2,pr:s?15:6.5,pb:s?void 0:5,borderRadius:0},"& .MuiOutlinedInput-notchedOutline":{border:"none"}}}),s?je(te,{sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",gap:.25},children:[p,U(tt,{"aria-label":"\uB313\uAE00 \uB4F1\uB85D",disabled:!o.trim()&&n.length===0,onClick:x,sx:{color:"#2563eb","&.Mui-disabled":{color:"#c9c8c5"}},children:U(Sm,{sx:{fontSize:22}})})]}):je(Cm,{children:[U(te,{sx:{position:"absolute",left:8,bottom:6,display:"flex",alignItems:"center",gap:.25},children:p}),U(tt,{"aria-label":"\uB313\uAE00 \uB4F1\uB85D",disabled:!o.trim()&&n.length===0,onClick:x,sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",color:"#2563eb","&.Mui-disabled":{color:"#c9c8c5"}},children:U(Sm,{sx:{fontSize:22}})})]})]}),U(te,{component:"input",ref:l,type:"file",multiple:!0,onChange:c=>{m(c.target.files),c.target.value=""},sx:{display:"none"}}),U(te,{component:"input",ref:u,type:"file",accept:"image/*",multiple:!0,onChange:c=>{m(c.target.files),c.target.value=""},sx:{display:"none"}})]})}import{useState as Sl}from"react";import{Box as ji,Checkbox as yy,IconButton as ir,Tooltip as Lr}from"@mui/material";import Sy from"@mui/icons-material/Close";import By from"@mui/icons-material/ArrowBack";import Cy from"@mui/icons-material/ShareOutlined";import vy from"@mui/icons-material/ContentCopyOutlined";import Iy from"@mui/icons-material/CheckCircle";import _y from"@mui/icons-material/CheckCircleOutlineOutlined";import wy from"@mui/icons-material/HistoryOutlined";import Dy from"@mui/icons-material/Print";import{useEffect as uy}from"react";import{Box as Ft,Button as dy,CircularProgress as py}from"@mui/material";import{FormDialog as fy}from"@ehfuse/mui-form-dialog";import{OverlayScrollbar as xy}from"@ehfuse/overlay-scrollbar";import{jsx as Ht,jsxs as Ui}from"react/jsx-runtime";var gy={created:"\uC5C5\uBB34\uB97C \uB4F1\uB85D\uD588\uC2B5\uB2C8\uB2E4",completed:"\uC644\uB8CC \uCC98\uB9AC\uD588\uC2B5\uB2C8\uB2E4",uncompleted:"\uC644\uB8CC\uB97C \uD574\uC81C\uD588\uC2B5\uB2C8\uB2E4",confirm_requested:"\uD655\uC778\uC744 \uC694\uCCAD\uD588\uC2B5\uB2C8\uB2E4",acked:"\uD655\uC778\uD588\uC2B5\uB2C8\uB2E4",claimed:"\uC5C5\uBB34\uB97C \uAC00\uC838\uAC14\uC2B5\uB2C8\uB2E4",bug_verified:"\uC218\uC815\uC744 \uD655\uC778\uD588\uC2B5\uB2C8\uB2E4(\uC885\uB8CC)",bug_reopened:"\uC7AC\uC624\uD508\uD588\uC2B5\uB2C8\uB2E4"};function wm(e){return String(e??"").trim()||"\uC5C6\uC74C"}function by(e){if(e.kind!=="field")return gy[String(e.kind)]??"\uBCC0\uACBD\uD588\uC2B5\uB2C8\uB2E4";let o=String(e.field_label??e.field??"").trim()||"\uD56D\uBAA9",t=String(e.old_value??"").trim(),n=String(e.new_value??"").trim();return!t&&n?`${o}\uC744(\uB97C) "${n}"(\uC73C)\uB85C \uC785\uB825\uD588\uC2B5\uB2C8\uB2E4`:t&&!n?`${o}\uC744(\uB97C) \uBE44\uC6E0\uC2B5\uB2C8\uB2E4`:`${o}\uC744(\uB97C) "${wm(t)}" \u2192 "${wm(n)}" \uB85C \uBC14\uAFE8\uC2B5\uB2C8\uB2E4`}function Gi({open:e,taskSeq:o,items:t,loading:n,onLoad:r,onClose:i}){let a=Ie();uy(()=>{e&&o>0&&!t&&r?.(o)},[e,o,t,r]);let l=Ht(Ft,{sx:{height:a?"100%":420,minHeight:0},children:Ht(xy,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:Ui(Ft,{sx:{px:2,pt:2,display:"flex",flexDirection:"column",gap:1,"&::after":{content:'""',flexShrink:0,height:16}},children:[n&&!t?Ui(Ft,{sx:{display:"flex",alignItems:"center",gap:1,color:"#9a9a97",fontSize:14.5},children:[Ht(py,{size:14,thickness:5,sx:{color:"#9a9a97"}}),"\uBD88\uB7EC\uC624\uB294 \uC911\u2026"]}):null,t&&t.length===0?Ht(Ft,{sx:{fontSize:14.5,color:"#9a9a97"},children:"\uAE30\uB85D\uB41C \uD65C\uB3D9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,(t??[]).map(u=>Ui(Ft,{sx:{display:"flex",gap:1,alignItems:"baseline",minWidth:0,flexShrink:0},children:[Ht(Ft,{sx:{flexShrink:0,width:"10.5em",whiteSpace:"nowrap",fontSize:13.5,color:"#9a9a97",lineHeight:1.5},children:Qo(u.acted_time)}),Ui(Ft,{sx:{minWidth:0,fontSize:14.5,color:"#37352f",lineHeight:1.5},children:[Ht(Ft,{component:"span",sx:{fontWeight:500},children:String(u.actor_name??"").trim()||"\uC774\uB984\uC5C6\uC74C"}),Ht(Ft,{component:"span",sx:{ml:.5},children:by(u)})]})]},u.seq))]})})});return Ht(fy,{open:e,onClose:i,maxWidth:"sm",fullScreen:a,mobilePresentation:a?"slide":"dialog",contentPaddingX:0,contentTopPadding:0,contentBottomPadding:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,sx:a?{DialogContent:{pb:0,"& .os-content > div":{height:"100%",boxSizing:"border-box",paddingBottom:0,marginBottom:0},"& .FormSection-content, & .section-content":{height:"100%",paddingBottom:0,marginBottom:0}}}:void 0,title:`\uD65C\uB3D9${t&&t.length>0?` (${t.length})`:""}`,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-task-activity",sections:[{id:"task-activity",showTitle:!1,children:l}],scrollPastLastSection:!1,actions:{showCancelButton:!1,right:Ht(dy,{variant:"contained",onClick:i,children:"\uB2EB\uAE30"})}})}import{InfoAlert as hy,SuccessAlert as ky}from"@ehfuse/alerts";var Dm=e=>e?e.replace(/<(script|style)[\s\S]*?<\/\1>/gi,"").replace(/<br\s*\/?>/gi,`
8
+ `)}),u=e==="like"?"#e5484d":"#2f80ed";return U(vm,{title:l,arrow:!0,enterDelay:300,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:je(te,{sx:{display:"inline-flex",alignItems:"center"},children:[U(tt,{size:"small","aria-label":`\uB313\uAE00 ${a}`,onClick:n,sx:{color:i?u:"#c9c8c5",p:.5},children:e==="like"?i?U(ry,{sx:{fontSize:16}}):U(iy,{sx:{fontSize:16}}):i?U(ay,{sx:{fontSize:16}}):U(ly,{sx:{fontSize:16}})}),r.length>0?U(te,{component:"span",sx:{fontSize:12,color:i?u:"#9a9a97",ml:-.25},children:r.length}):null]})})}function Im({taskSeq:e,comments:o,currentUserName:t="",myAccountSeq:n=0,avatarSrcByName:r,onUpdate:i,onRemove:a,onToggleReaction:l,onPreview:u,onDownload:s}){let[m,x]=tr(null),p=yl(null),[c,f]=tr(null),[E,v]=tr(!1),h=Math.max(0,o.length-my),g=h>0&&!E,I=m?Math.min(m.index,h):h,y=o.map((C,M)=>({comment:C,index:M})).slice(g?I:0),O=gr(),S=C=>{if(u){u(C);return}window.open(O(C.uuid??""),"_blank","noopener,noreferrer")},_=C=>{if(s){s(C);return}window.open(O(C.uuid??"",{download:!0}),"_blank","noopener,noreferrer")},P=No().slots?.avatar;return je(te,{sx:{px:2,pb:2,display:"flex",flexDirection:"column",gap:.25},children:[je(te,{sx:{display:"flex",alignItems:"center",gap:1},children:[U(jt,{sx:{fontSize:18,display:"block",color:"#37352f"}}),je(te,{sx:{fontSize:ll,fontWeight:500,color:"#37352f"},children:["\uB313\uAE00",o.length>0?` (${o.length})`:""]}),h>0&&(!g||I>0)?U(te,{role:"button",tabIndex:0,onClick:()=>v(C=>!C),onKeyDown:C=>{(C.key==="Enter"||C.key===" ")&&(C.preventDefault(),v(M=>!M))},sx:{ml:"auto",flexShrink:0,cursor:"pointer",fontSize:14.5,color:"#5b87d6","&:hover":{textDecoration:"underline"}},children:g?`\uC774\uC804 \uB313\uAE00 ${I}\uAC1C \uB354 \uBCF4\uAE30`:"\uC774\uC804 \uB313\uAE00 \uC811\uAE30"}):null]}),o.length===0?U(te,{sx:{mt:1,fontSize:14.5,color:"#9a9a97"},children:"\uB4F1\uB85D\uB41C \uB313\uAE00\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,U(te,{sx:{display:"flex",flexDirection:"column",gap:1,mt:1},children:y.map(({comment:C,index:M})=>{let N=!!t&&C.author===t;return je(te,{sx:{display:"flex",gap:1.5,alignItems:"flex-start","&:hover .taskbox-comment-actions":{opacity:1,pointerEvents:"auto"},"&:not(:last-child)":{borderBottom:"1px dashed #e0dfdc",pb:1}},children:[(()=>{let d=r?.get(C.author)??"";return P?U(te,{sx:{display:"inline-flex",flexShrink:0},children:U(P,{name:C.author,src:d||void 0,size:44})}):U(te,{sx:{display:"inline-flex",flexShrink:0},children:U(lt,{src:d,avatarSx:{width:44,height:44,fontSize:20,borderRadius:"50%",...Nn[0]},iconFontSize:24})})})(),je(te,{sx:{flex:1,minWidth:0},children:[je(te,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0,position:"relative"},children:[U(te,{component:"span",sx:{fontSize:14.5,fontWeight:700,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:C.author}),U(te,{component:"span",sx:{fontSize:12.5,color:"#9a9a97",flexShrink:0,whiteSpace:"nowrap"},children:C.time}),N?U(te,{sx:{ml:"auto"}}):je(te,{sx:{display:"flex",alignItems:"center",gap:.25,ml:"auto",flexShrink:0},children:[U(Bm,{kind:"like",reactions:C.likes,myAccountSeq:n,onToggle:()=>l?.(e,M,"like")}),U(Bm,{kind:"ack",reactions:C.acks,myAccountSeq:n,onToggle:()=>l?.(e,M,"ack")})]}),N?je(te,{className:"taskbox-comment-actions",sx:{display:"flex",alignItems:"center",gap:.25,position:"absolute",right:0,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",backgroundColor:"#fff",opacity:0,transition:"opacity 0.15s"},children:[U(tt,{size:"small","aria-label":"\uB313\uAE00 \uC218\uC815",onClick:()=>x({index:M,text:C.text,attachments:[...C.attachments??[]],files:[]}),sx:{color:"#9a9a97"},children:U(ny,{sx:{fontSize:15}})}),U(tt,{size:"small","aria-label":"\uB313\uAE00 \uC0AD\uC81C",onClick:d=>f({anchorEl:d.currentTarget,index:M}),sx:{color:"#9a9a97"},children:U(Vi,{sx:{fontSize:15}})})]}):null]}),m?.index===M?je(te,{sx:{mt:.5},children:[U(te,{component:"textarea",autoFocus:!0,spellCheck:!1,value:m.text,onChange:d=>x({...m,text:d.target.value}),sx:{width:"100%",minHeight:56,border:"1px solid #dedddb",borderRadius:1,outline:"none",font:"inherit",fontSize:14,p:1,resize:"vertical"}}),je(te,{sx:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:.75,mt:.75},children:[m.attachments.map((d,T)=>{let k=()=>x({...m,attachments:m.attachments.filter((b,z)=>z!==T)});return Ki(d.name)&&d.uuid?je(te,{sx:{position:"relative"},children:[U(te,{component:"img",src:O(d.uuid,{thumb:"md"}),alt:d.name,title:d.name,loading:"lazy",sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",display:"block"}}),U(tt,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:k,sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:U(Vi,{sx:{fontSize:14}})})]},`kept-${d.uuid}-${T}`):U($i,{size:"small",icon:U(nr,{sx:{fontSize:14}}),label:d.name,onDelete:k,sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`kept-${d.uuid??d.name}-${T}`)}),m.files.map((d,T)=>{let k=()=>x({...m,files:m.files.filter((b,z)=>z!==T)});return Ki(d.name)?je(te,{sx:{position:"relative"},children:[U(te,{component:"img",src:URL.createObjectURL(d),alt:d.name,title:`${d.name} (\uC0C8 \uD30C\uC77C)`,onLoad:b=>URL.revokeObjectURL(b.target.src),sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"2px solid #2f80ed",display:"block"}}),U(tt,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:k,sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:U(Vi,{sx:{fontSize:14}})})]},`new-${d.name}-${T}`):U($i,{size:"small",icon:U(nr,{sx:{fontSize:14}}),label:`${d.name} (\uC0C8 \uD30C\uC77C)`,onDelete:k,sx:{fontSize:14,height:26,bgcolor:"#eef4ff"}},`new-${d.name}-${T}`)}),U(vm,{title:"\uCCA8\uBD80 \uCD94\uAC00",arrow:!0,children:U(tt,{size:"small","aria-label":"\uCCA8\uBD80 \uCD94\uAC00",onClick:()=>p.current?.click(),sx:{ml:"auto",color:"#2f80ed"},children:U(sy,{sx:{fontSize:20}})})})]}),je(te,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:.75,mt:.5},children:[U(ym,{size:"small",color:"inherit",onClick:()=>x(null),children:"\uCDE8\uC18C"}),U(ym,{size:"small",variant:"contained",disabled:!m.text.trim()&&m.attachments.length===0&&m.files.length===0,onClick:()=>{i(e,M,m.text,{attachments:m.attachments,files:m.files}),x(null)},children:"\uC800\uC7A5"})]}),U(te,{component:"input",type:"file",multiple:!0,ref:p,sx:{display:"none"},onChange:d=>{let T=Array.from(d.target.files??[]);T.length>0&&x({...m,files:[...m.files,...T].slice(0,10)}),d.target.value=""}})]}):je(te,{children:[C.text?U(te,{sx:{fontSize:15,whiteSpace:"pre-wrap"},children:C.text}):null,(C.attachments??[]).length>0?U(te,{sx:{display:"flex",flexWrap:"wrap",gap:.75,mt:.75},children:(C.attachments??[]).map((d,T)=>{let k=!!d.uuid;if(Ki(d.name)&&k)return U(te,{component:"img",src:O(d.uuid??"",{thumb:"md"}),alt:d.name,title:`${d.name} \uD06C\uAC8C \uBCF4\uAE30`,loading:"lazy",onClick:()=>S(d),sx:{width:96,height:96,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",cursor:"pointer",bgcolor:"#f8fafc"}},`${d.name}-${T}`);let z=zi(d.name);return U($i,{size:"small",icon:U(nr,{sx:{fontSize:14}}),label:`${d.name} (${Tl(d.size)})`,clickable:k,onClick:k?()=>z?S(d):_(d):void 0,title:k?`${d.name} ${z?"\uBBF8\uB9AC\uBCF4\uAE30":"\uB2E4\uC6B4\uB85C\uB4DC"}`:d.name,sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`${d.name}-${T}`)})}):null]})]})]},`${C.time}-${M}`)})}),U(We,{open:!!c,anchorEl:c?.anchorEl??null,title:"\uC774 \uB313\uAE00\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uC0AD\uC81C",onCancel:()=>f(null),onConfirm:()=>{c&&(a(e,c.index),x(null)),f(null)}})]})}function Ki(e){return/\.(png|jpe?g|gif|webp|bmp|svg|heic|heif)$/i.test(String(e??"").trim())}function _m({onSubmit:e}){let[o,t]=tr(""),[n,r]=tr([]),[i,a]=tr(!1),l=yl(null),u=yl(null),s=Ie(),m=c=>{let f=Array.from(c??[]);f.length!==0&&r(E=>[...E,...f].slice(0,10))},x=()=>{let c=o.trim();!c&&n.length===0||(e(c,n.length>0?n:void 0),t(""),r([]))},p=je(Cm,{children:[U(tt,{size:"small","aria-label":"\uD30C\uC77C \uCCA8\uBD80",onClick:()=>l.current?.click(),sx:{color:"#9a9a97"},children:U(nr,{sx:{fontSize:20}})}),U(tt,{size:"small","aria-label":"\uC774\uBBF8\uC9C0 \uCCA8\uBD80",onClick:()=>u.current?.click(),sx:{color:"#9a9a97"},children:U(cy,{sx:{fontSize:20}})})]});return je(te,{children:[n.length>0?U(te,{sx:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:.75,px:2,pt:1},children:n.map((c,f)=>Ki(c.name)?je(te,{sx:{position:"relative"},children:[U(te,{component:"img",src:URL.createObjectURL(c),alt:c.name,title:c.name,onLoad:E=>URL.revokeObjectURL(E.target.src),sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",display:"block"}}),U(tt,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:()=>r(E=>E.filter((v,h)=>h!==f)),sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:U(Vi,{sx:{fontSize:14}})})]},`${c.name}-${f}`):U($i,{size:"small",icon:U(nr,{sx:{fontSize:14}}),label:`${c.name} (${Tl(c.size)})`,onDelete:()=>r(E=>E.filter((v,h)=>h!==f)),sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`${c.name}-${f}`))}):null,je(te,{sx:{position:"relative",display:"flex"},onDragOver:c=>{Array.from(c.dataTransfer?.types??[]).includes("Files")&&(c.preventDefault(),a(!0))},onDragLeave:c=>{c.currentTarget.contains(c.relatedTarget)||a(!1)},onDrop:c=>{Array.from(c.dataTransfer?.types??[]).includes("Files")&&(c.preventDefault(),a(!1),m(c.dataTransfer?.files??null))},children:[i?je(te,{sx:{position:"absolute",inset:0,zIndex:2,display:"flex",alignItems:"center",justifyContent:"center",gap:.75,borderRadius:1,border:"2px dashed #2f80ed",bgcolor:"rgba(47,128,237,0.08)",color:"#2f80ed",fontSize:14,fontWeight:600,pointerEvents:"none"},children:[U(nr,{sx:{fontSize:18}}),"\uC5EC\uAE30\uC5D0 \uB193\uC73C\uBA74 \uCCA8\uBD80\uB429\uB2C8\uB2E4"]}):null,U(ty,{value:o,placeholder:"\uB313\uAE00\uC744 \uC785\uB825\uD558\uC138\uC694",onChange:c=>t(c.target.value),fullWidth:!0,multiline:!0,minRows:s?1:3,maxRows:3,sx:{"& .MuiInputBase-root":{pl:2,pr:s?15:6.5,pb:s?void 0:5,borderRadius:0},"& .MuiOutlinedInput-notchedOutline":{border:"none"}}}),s?je(te,{sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",gap:.25},children:[p,U(tt,{"aria-label":"\uB313\uAE00 \uB4F1\uB85D",disabled:!o.trim()&&n.length===0,onClick:x,sx:{color:"#2563eb","&.Mui-disabled":{color:"#c9c8c5"}},children:U(Sm,{sx:{fontSize:22}})})]}):je(Cm,{children:[U(te,{sx:{position:"absolute",left:8,bottom:6,display:"flex",alignItems:"center",gap:.25},children:p}),U(tt,{"aria-label":"\uB313\uAE00 \uB4F1\uB85D",disabled:!o.trim()&&n.length===0,onClick:x,sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",color:"#2563eb","&.Mui-disabled":{color:"#c9c8c5"}},children:U(Sm,{sx:{fontSize:22}})})]})]}),U(te,{component:"input",ref:l,type:"file",multiple:!0,onChange:c=>{m(c.target.files),c.target.value=""},sx:{display:"none"}}),U(te,{component:"input",ref:u,type:"file",accept:"image/*",multiple:!0,onChange:c=>{m(c.target.files),c.target.value=""},sx:{display:"none"}})]})}import{useState as Sl}from"react";import{Box as ji,Checkbox as yy,IconButton as ir,Tooltip as Lr}from"@mui/material";import Sy from"@mui/icons-material/Close";import By from"@mui/icons-material/ArrowBack";import Cy from"@mui/icons-material/ShareOutlined";import vy from"@mui/icons-material/ContentCopyOutlined";import Iy from"@mui/icons-material/CheckCircle";import _y from"@mui/icons-material/CheckCircleOutlineOutlined";import wy from"@mui/icons-material/HistoryOutlined";import Dy from"@mui/icons-material/Print";import{useEffect as uy}from"react";import{Box as Ft,Button as dy,CircularProgress as py}from"@mui/material";import{FormDialog as fy}from"@ehfuse/mui-form-dialog";import{OverlayScrollbar as xy}from"@ehfuse/overlay-scrollbar";import{jsx as Ht,jsxs as Ui}from"react/jsx-runtime";var gy={created:"\uC5C5\uBB34\uB97C \uB4F1\uB85D\uD588\uC2B5\uB2C8\uB2E4",completed:"\uC644\uB8CC \uCC98\uB9AC\uD588\uC2B5\uB2C8\uB2E4",uncompleted:"\uC644\uB8CC\uB97C \uD574\uC81C\uD588\uC2B5\uB2C8\uB2E4",confirm_requested:"\uD655\uC778\uC744 \uC694\uCCAD\uD588\uC2B5\uB2C8\uB2E4",acked:"\uD655\uC778\uD588\uC2B5\uB2C8\uB2E4",claimed:"\uC5C5\uBB34\uB97C \uAC00\uC838\uAC14\uC2B5\uB2C8\uB2E4",bug_verified:"\uC218\uC815\uC744 \uD655\uC778\uD588\uC2B5\uB2C8\uB2E4(\uC885\uB8CC)",bug_reopened:"\uC7AC\uC624\uD508\uD588\uC2B5\uB2C8\uB2E4"};function wm(e){return String(e??"").trim()||"\uC5C6\uC74C"}function by(e){if(e.kind!=="field")return gy[String(e.kind)]??"\uBCC0\uACBD\uD588\uC2B5\uB2C8\uB2E4";let o=String(e.field_label??e.field??"").trim()||"\uD56D\uBAA9",t=String(e.old_value??"").trim(),n=String(e.new_value??"").trim();return!t&&n?`${o}\uC744(\uB97C) "${n}"(\uC73C)\uB85C \uC785\uB825\uD588\uC2B5\uB2C8\uB2E4`:t&&!n?`${o}\uC744(\uB97C) \uBE44\uC6E0\uC2B5\uB2C8\uB2E4`:`${o}\uC744(\uB97C) "${wm(t)}" \u2192 "${wm(n)}" \uB85C \uBC14\uAFE8\uC2B5\uB2C8\uB2E4`}function Gi({open:e,taskSeq:o,items:t,loading:n,onLoad:r,onClose:i}){let a=Ie();uy(()=>{e&&o>0&&!t&&r?.(o)},[e,o,t,r]);let l=Ht(Ft,{sx:{height:a?"100%":420,minHeight:0},children:Ht(xy,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:Ui(Ft,{sx:{px:2,pt:2,display:"flex",flexDirection:"column",gap:1,"&::after":{content:'""',flexShrink:0,height:16}},children:[n&&!t?Ui(Ft,{sx:{display:"flex",alignItems:"center",gap:1,color:"#9a9a97",fontSize:14.5},children:[Ht(py,{size:14,thickness:5,sx:{color:"#9a9a97"}}),"\uBD88\uB7EC\uC624\uB294 \uC911\u2026"]}):null,t&&t.length===0?Ht(Ft,{sx:{fontSize:14.5,color:"#9a9a97"},children:"\uAE30\uB85D\uB41C \uD65C\uB3D9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,(t??[]).map(u=>Ui(Ft,{sx:{display:"flex",flexDirection:a?"column":"row",gap:a?.25:1,alignItems:a?"stretch":"baseline",minWidth:0,flexShrink:0,...a?{pb:1,borderBottom:"1px solid #ededeb","&:last-of-type":{borderBottom:"none",pb:0}}:{}},children:[Ht(Ft,{sx:{flexShrink:0,...a?{}:{width:"10.5em"},whiteSpace:"nowrap",fontSize:13.5,color:"#9a9a97",lineHeight:1.5},children:Qo(u.acted_time)}),Ui(Ft,{sx:{minWidth:0,fontSize:14.5,color:"#37352f",lineHeight:1.5},children:[Ht(Ft,{component:"span",sx:{fontWeight:500},children:String(u.actor_name??"").trim()||"\uC774\uB984\uC5C6\uC74C"}),Ht(Ft,{component:"span",sx:{ml:.5},children:by(u)})]})]},u.seq))]})})});return Ht(fy,{open:e,onClose:i,maxWidth:"sm",fullScreen:a,mobilePresentation:a?"slide":"dialog",contentPaddingX:0,contentTopPadding:0,contentBottomPadding:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,sx:a?{DialogContent:{pb:0,"& .os-content > div":{height:"100%",boxSizing:"border-box",paddingBottom:0,marginBottom:0},"& .FormSection-content, & .section-content":{height:"100%",paddingBottom:0,marginBottom:0}}}:void 0,title:`\uD65C\uB3D9${t&&t.length>0?` (${t.length})`:""}`,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-task-activity",sections:[{id:"task-activity",showTitle:!1,children:l}],scrollPastLastSection:!1,actions:{showCancelButton:!1,right:Ht(dy,{variant:"contained",onClick:i,children:"\uB2EB\uAE30"})}})}import{InfoAlert as hy,SuccessAlert as ky}from"@ehfuse/alerts";var Dm=e=>e?e.replace(/<(script|style)[\s\S]*?<\/\1>/gi,"").replace(/<br\s*\/?>/gi,`
9
9
  `).replace(/<\/(p|div|li|h[1-6]|tr)>/gi,`
10
10
  `).replace(/<[^>]+>/g,"").replace(/&nbsp;/gi," ").replace(/&lt;/gi,"<").replace(/&gt;/gi,">").replace(/&quot;/gi,'"').replace(/&#39;/gi,"'").replace(/&amp;/gi,"&").replace(/\n{3,}/g,`
11
11