@ehfuse/taskbox 0.5.187 → 0.5.188

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.js CHANGED
@@ -3,7 +3,7 @@
3
3
  `).replace(/<\/(p|div|li|h[1-6]|blockquote)>/gi,`
4
4
  `),t=document.createElement("div");return t.innerHTML=o,(t.textContent??"").replace(/\n{3,}/g,`
5
5
 
6
- `).trim()}function Mi({syncKey:e,value:o,onChange:t,readOnly:n=!1,minHeight:r=180,height:i=0,onChangeHeight:l}){let s=(0,kt.useRef)(null),f=(0,kt.useRef)(null),m=i>0?i:0,c=(0,kt.useRef)(m),b=(0,kt.useRef)(l);b.current=l;let p=(0,kt.useRef)(null),u=(0,kt.useRef)(Date.now()+800),[d,_]=(0,kt.useState)(!1),w=Je();(0,kt.useEffect)(()=>{if(n)return;let g=fs(o);p.current===g||p.current===o||(p.current=g,u.current=Date.now()+800,s.current?.setHtml(g))},[e,o,n]);let k=(0,kt.useRef)(-1);return(0,kt.useEffect)(()=>{if(n||w||i<=0||k.current===i||(k.current=i,Math.abs(i-c.current)<1))return;let g=f.current?.querySelector(".ehfuse-editor-container");g&&(Math.abs(g.getBoundingClientRect().height-i)<1||(g.style.height=`${i}px`,c.current=i))},[n,w,i]),(0,kt.useEffect)(()=>{if(n||w)return;let g=f.current?.querySelector(".ehfuse-editor-container");if(!g||typeof ResizeObserver>"u")return;let E,B=new ResizeObserver(P=>{let S=Math.round(P[0]?.contentRect.height??0);S<=0||(window.clearTimeout(E),E=window.setTimeout(()=>{Math.abs(S-c.current)<1||(c.current=S,b.current?.(S))},300))});return B.observe(g),()=>{window.clearTimeout(E),B.disconnect()}},[n,w]),n?(0,un.jsxs)(Gn.Box,{sx:{position:"relative",mt:1},children:[(0,un.jsx)(Gn.Box,{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:fs(o)}}),(0,un.jsx)(Gn.Tooltip,{title:"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:(0,un.jsx)(Gn.IconButton,{size:"small","aria-label":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>{navigator.clipboard.writeText(Sf(o)).then(()=>{_(!0),window.setTimeout(()=>_(!1),1500)})},sx:{position:"absolute",top:6,right:6,color:"#9a9a97"},children:d?(0,un.jsx)(yf.default,{sx:{fontSize:17,color:"#2f9e5b"}}):(0,un.jsx)(Tf.default,{sx:{fontSize:17}})})})]}):(0,un.jsx)(Gn.Box,{ref:f,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:(0,un.jsx)(Aa.EhfuseEditor,{ref:s,defaultValue:fs(o),autoHeight:w,resizable:!w,showToolbar:!w,focusBorder:!0,styles:{focusBorderColor:"var(--primary)"},toolbarOptions:Aa.minimalToolbarOptions,locale:"ko",minHeight:m||r,placeholder:"\uB0B4\uC6A9\uC744 \uC785\uB825\uD558\uC138\uC694",contentStyle:{padding:"12px"},onChange:g=>{let E=Date.now()<u.current,B=g===p.current;p.current=g,!(E||B)&&t(g)}})})}var kr=require("react"),ye=require("@mui/material"),dn=require("@dnd-kit/core"),La=require("@dnd-kit/modifiers"),Yn=require("@dnd-kit/sortable"),Ef=require("@dnd-kit/utilities"),xs=a(require("@mui/icons-material/Close"),1),Mf=a(require("@mui/icons-material/AddCircle"),1),gs=a(require("@mui/icons-material/AddTask"),1),Of=a(require("@mui/icons-material/Checklist"),1),Rf=a(require("@mui/icons-material/CheckCircle"),1),Pf=a(require("@mui/icons-material/DragIndicator"),1),zf=a(require("@mui/icons-material/Launch"),1),qf=a(require("@mui/icons-material/LinkOutlined"),1),Af=a(require("@mui/icons-material/RadioButtonUnchecked"),1);var jn=require("react"),Jo=require("@mui/material"),Cf=require("@ehfuse/mui-form-dialog"),vf=require("@ehfuse/mui-form-controls"),If=require("@ehfuse/alerts"),_f=a(require("@mui/icons-material/CheckCircle"),1),wf=a(require("@mui/icons-material/RadioButtonUnchecked"),1),Df=require("@ehfuse/overlay-scrollbar");var Eo=require("react/jsx-runtime"),Bf=[{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 Oi({open:e,task:o,tasks:t,excludeSeqs:n=[],onClose:r,onSubmit:i,hideRelationType:l=!1,title:s="\uAD00\uB828 \uC5C5\uBB34 \uC5F0\uACB0",confirmLabel:f="\uC5F0\uACB0",multiSelect:m=!1}){let c=Je(),[b,p]=(0,jn.useState)("related"),[u,d]=(0,jn.useState)(""),[_,w]=(0,jn.useState)([]);(0,jn.useEffect)(()=>{e&&(p("related"),d(""),w([]))},[e]);let k=(0,jn.useMemo)(()=>{let S=new Set([o.seq,...n]),D=u.trim().toLowerCase();return t.filter(R=>S.has(R.seq)||R.is_event||R.is_notice||R.linked_only?!1:D?R.title.toLowerCase().includes(D)||(R.ticket_no??"").toLowerCase().includes(D):!0).sort((R,A)=>!!R.completed!=!!A.completed?R.completed?1:-1:A.seq-R.seq)},[t,o.seq,n,u]),g=()=>{if(_.length===0){(0,If.ErrorAlert)("\uC5F0\uACB0\uD560 \uC5C5\uBB34\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}for(let S of _)i(S,b);r()},E=S=>{w(D=>D.includes(S)?D.filter(R=>R!==S):m?[...D,S]:[S])},B=Bf.find(S=>S.type===b)?.hint??"",P=(0,Eo.jsxs)(Jo.Box,{sx:{...c?{height:"100%",minHeight:0}:{height:560},display:"flex",flexDirection:"column",...c?{}:{border:"1px solid #cccccc",borderRadius:1},overflow:"hidden",userSelect:"none"},children:[l?null:(0,Eo.jsx)(Jo.Tabs,{value:b,onChange:(S,D)=>p(D),sx:{minHeight:38,mb:.75,flexShrink:0,"& .MuiTab-root":{minHeight:38,py:.5,fontSize:14}},children:Bf.map(S=>(0,Eo.jsx)(Jo.Tab,{value:S.type,label:S.label},S.type))}),l?null:(0,Eo.jsx)(Jo.Box,{sx:{mb:1.5,fontSize:12.5,color:"#9a9a97"},children:B}),(0,Eo.jsx)(Jo.Box,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:(0,Eo.jsx)(vf.ClearTextField,{placeholder:"\uC81C\uBAA9\xB7\uD2F0\uCF13\uBC88\uD638\uB85C \uAC80\uC0C9",value:u,onChange:S=>d(S.target.value),fullWidth:!0,autoFocus:!0,size:"small",sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),(0,Eo.jsx)(Jo.Box,{sx:{flex:1,minHeight:0},children:(0,Eo.jsx)(Df.OverlayScrollbar,{style:{height:"100%"},contentStyle:{paddingTop:0},children:(0,Eo.jsx)(Jo.Box,{sx:{display:"flex",flexDirection:"column"},children:k.length===0?(0,Eo.jsx)(Jo.Box,{sx:{py:4,textAlign:"center",fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uD560 \uC218 \uC788\uB294 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):k.map(S=>{let D=S.is_notice||S.is_event?Me(S.icon||(S.is_notice?yo:Po)):null,R=_.includes(S.seq);return(0,Eo.jsxs)(Jo.Box,{onClick:()=>E(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:R?"#e3eefb":"transparent","&:hover":{bgcolor:R?"#e3eefb":"#f7f7f5"}},children:[R?(0,Eo.jsx)(_f.default,{sx:{fontSize:20,flexShrink:0,color:"#2f6fd0"}}):(0,Eo.jsx)(wf.default,{sx:{fontSize:20,flexShrink:0,color:"#c9c8c5"}}),D?(0,Eo.jsx)(D,{sx:{fontSize:17,flexShrink:0,color:S.icon_color||"#1e3a8a"}}):null,(0,Eo.jsxs)(Jo.Box,{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]}),(0,Eo.jsx)(Jo.Box,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:(0,Eo.jsx)(Ze,{option:Ko(S)})})]},S.seq)})})})})]});return(0,Eo.jsx)(Cf.FormDialog,{open:e,onClose:r,maxWidth:"sm",fullScreen:c,mobilePresentation:c?"slide":"dialog",...c?{contentPaddingX:0,contentTopPadding:0,sectionsPaddingTop:0}:{},sx:c?{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:s,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-task-link",sections:[{id:"task-link",showTitle:!1,children:P}],scrollPastLastSection:!1,sectionContentPaddingTop:0,actions:{showCancelButton:!0,right:(0,Eo.jsx)(Jo.Button,{variant:"contained",disabled:_.length===0,onClick:g,children:f})}})}var ae=require("react/jsx-runtime");function Ph({id:e,children:o}){let{attributes:t,listeners:n,setNodeRef:r,transform:i,transition:l,isDragging:s}=(0,Yn.useSortable)({id:e});return(0,ae.jsx)(ye.Box,{ref:r,sx:{transform:Ef.CSS.Transform.toString(i),transition:l,...s?{opacity:.6,position:"relative",zIndex:1}:{}},children:o({handleProps:{...t,...n},dragging:s})})}function zh({sortable:e,sensors:o,rowIds:t,onDragEnd:n,children:r}){let i=(0,ae.jsx)(ye.Box,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:r});return e?(0,ae.jsx)(dn.DndContext,{sensors:o,collisionDetection:dn.closestCenter,modifiers:[La.restrictToVerticalAxis,La.restrictToParentElement],onDragEnd:n,children:(0,ae.jsx)(Yn.SortableContext,{items:t,strategy:Yn.verticalListSortingStrategy,children:i})}):i}function Ri({taskSeq:e,checklist:o,onAdd:t,onToggle:n,onRemove:r,onUpdate:i,onReorder:l,removeLocked:s=!1,onConvertToTask:f,onOpenLinkedTask:m,linkCandidates:c,linkBaseTask:b,onLinkExistingTask:p,resolveLinkedTask:u,myAccountSeq:d=0}){let[_,w]=(0,kr.useState)(""),[k,g]=(0,kr.useState)(!1),[E,B]=(0,kr.useState)(null),P=Je(),[S,D]=(0,kr.useState)(null),[R,A]=(0,kr.useState)(null),C=K=>{let G=K.task_seq?u?.(K.task_seq):void 0;return G?G.completed:K.checked},ie=K=>{if(!K.task_seq||d<=0)return!1;let G=u?.(K.task_seq);return G?!vl(G,d):!1},h=o.filter(C).length,[x,I]=(0,kr.useState)(!1),T=!!l&&!P&&!s,y=(0,dn.useSensors)((0,dn.useSensor)(dn.PointerSensor,{activationConstraint:{distance:5}})),M=(K,G)=>K.task_seq?`linked-${K.task_seq}`:`row-${G}`,Z=o.map(M),de=x?Z.filter((K,G)=>!C(o[G])):Z,qe=K=>{let{active:G,over:ce}=K;if(!ce||G.id===ce.id)return;let Se=Z.indexOf(String(G.id)),Oe=Z.indexOf(String(ce.id));Se<0||Oe<0||l?.(e,(0,Yn.arrayMove)(o,Se,Oe))},ge=()=>{_.trim()&&(t(e,_),w(""))};return(0,ae.jsxs)(Dt,{icon:(0,ae.jsx)(Of.default,{sx:{fontSize:19,display:"block"}}),title:(0,ae.jsxs)(ae.Fragment,{children:["\uD560\uC77C",o.length>0?(0,ae.jsxs)(ye.Box,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:[h," / ",o.length]}):null]}),titleExtra:o.length>0?(0,ae.jsxs)(ye.Box,{sx:{flex:1,minWidth:0,ml:1,display:"flex",alignItems:"center",gap:1},children:[(0,ae.jsx)(ye.Box,{sx:{flex:1,minWidth:0,height:6,borderRadius:3,bgcolor:"#ececea"},children:(0,ae.jsx)(ye.Box,{sx:{height:"100%",borderRadius:3,width:`${Math.round(h/o.length*100)}%`,bgcolor:"#2f80ed",transition:"width 0.2s"}})}),h>0?(0,ae.jsxs)(ye.Box,{component:"label",sx:{display:"inline-flex",alignItems:"center",gap:.25,flexShrink:0,cursor:"pointer",fontSize:13.5,fontWeight:400,color:"#57564f",userSelect:"none"},children:["\uC644\uB8CC \uC228\uAE40",(0,ae.jsx)(ye.Switch,{size:"small",checked:x,onChange:(K,G)=>I(G)})]}):null]}):null,children:[(0,ae.jsx)(zh,{sortable:T,sensors:y,rowIds:de,onDragEnd:qe,children:o.map((K,G)=>{let ce=K.task_seq?u?.(K.task_seq):void 0,Se=C(K);if(x&&Se)return null;let Oe=!!K.task_seq,We=ie(K),j=N=>(0,ae.jsxs)(ye.Box,{sx:{display:"flex",alignItems:"center",gap:1,px:1.25,...T?{ml:-3,pl:.5}:{},py:.5,borderRadius:1,"&:hover":{bgcolor:"#f7f7f5"},"&:hover .taskbox-checklist-remove":{opacity:1},"&:hover .taskbox-checklist-convert":{opacity:1},"&:hover .taskbox-checklist-handle":{opacity:1}},children:[N?(0,ae.jsx)(ye.Box,{className:"taskbox-checklist-handle",...N,sx:{display:"inline-flex",flexShrink:0,alignItems:"center",color:"#c9c8c5",opacity:0,transition:"opacity 0.15s",cursor:"grab","&:active":{cursor:"grabbing"},touchAction:"none",userSelect:"none"},children:(0,ae.jsx)(Pf.default,{sx:{fontSize:16}})}):null,(0,ae.jsx)(ye.Tooltip,{title:We?"\uC5F0\uACB0 \uC5C5\uBB34\uC758 \uC791\uC131\uC790\xB7\uCC45\uC784\uC790\uB9CC \uC644\uB8CC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4":"",arrow:!0,disableInteractive:!0,children:(0,ae.jsx)(ye.Box,{component:"span",onClick:We?void 0:()=>n(e,G,!Se),sx:{display:"inline-flex",flexShrink:0,cursor:We?"default":"pointer"},children:Se?(0,ae.jsx)(Rf.default,{sx:{fontSize:18,color:We?"#a9c6ec":"#2f80ed"}}):(0,ae.jsx)(Af.default,{sx:{fontSize:18,color:We?"#d6d5d1":"#9a9a97"}})})}),E?.index===G?(0,ae.jsx)(ye.Box,{component:"input",autoFocus:!0,spellCheck:!1,value:E.label,enterKeyHint:"done",onChange:le=>B({index:G,label:le.target.value}),onBlur:()=>{E.label.trim()&&E.label.trim()!==K.label&&i?.(e,G,E.label),B(null)},onKeyDown:le=>{le.key==="Enter"&&le.target.blur(),le.key==="Escape"&&B(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",p:0}}):(0,ae.jsx)(ye.Box,{component:"span",onClick:Oe?K.task_seq&&m?()=>m(K.task_seq):void 0:s||!i?void 0:P?()=>D({index:G,label:K.label}):()=>B({index:G,label:K.label}),sx:{flex:1,minWidth:0,fontSize:14.5,color:"#37352f",textDecoration:Se?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...Oe?m?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}:s||!i?{}:{cursor:"text"}},children:K.label}),Oe?(0,ae.jsxs)(ye.Box,{component:"span",onClick:K.task_seq&&m?()=>m(K.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",...m?{cursor:"pointer"}:{}},children:[(0,ae.jsx)(zf.default,{sx:{fontSize:12}}),ce?.manager_name?.trim()||"\uC5C5\uBB34"]}):null,!s&&!Oe&&f?(0,ae.jsx)(ye.Tooltip,{title:"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",arrow:!0,enterDelay:300,disableInteractive:!0,children:(0,ae.jsx)(ye.IconButton,{className:"taskbox-checklist-convert",size:"small","aria-label":"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",onClick:le=>A({anchorEl:le.currentTarget,index:G,label:K.label}),sx:{display:P?"none":"inline-flex",opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:(0,ae.jsx)(gs.default,{sx:{fontSize:16}})})}):null,s?null:(0,ae.jsx)(ye.IconButton,{className:"taskbox-checklist-remove",size:"small","aria-label":"\uD560\uC77C \uC0AD\uC81C",onClick:()=>r(e,G),sx:{display:P?"none":"inline-flex",opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:(0,ae.jsx)(xs.default,{sx:{fontSize:15}})})]});return T?(0,ae.jsx)(Ph,{id:Z[G],children:({handleProps:N})=>j(N)},Z[G]):(0,ae.jsx)(ye.Box,{children:j(null)},Z[G])})}),(0,ae.jsxs)(ye.Box,{sx:{mt:.5,ml:3.25,display:"flex",alignItems:"center",gap:.5},children:[(0,ae.jsx)(ye.Box,{component:"input",spellCheck:!1,value:_,placeholder:"+ \uD560\uC77C \uCD94\uAC00",enterKeyHint:"done",onChange:K=>w(K.target.value),onKeyDown:K=>{K.key==="Enter"&&ge()},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"}}}),c&&b&&p?(0,ae.jsx)(ye.Tooltip,{title:"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",arrow:!0,children:(0,ae.jsx)(ye.IconButton,{size:"small","aria-label":"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",onMouseDown:K=>K.preventDefault(),onClick:()=>g(!0),sx:{flexShrink:0,color:"#9a9a97"},children:(0,ae.jsx)(qf.default,{sx:{fontSize:20}})})}):null,(0,ae.jsx)(ye.IconButton,{size:"small","aria-label":"\uD560\uC77C \uCD94\uAC00",disabled:!_.trim(),onMouseDown:K=>K.preventDefault(),onClick:ge,sx:{flexShrink:0,color:_.trim()?"#2f80ed":"#c9c8c5"},children:(0,ae.jsx)(Mf.default,{sx:{fontSize:20}})})]}),c&&b&&p?(0,ae.jsx)(Oi,{open:k,task:b,tasks:c,excludeSeqs:o.map(K=>Number(K.task_seq??0)).filter(K=>K>0),hideRelationType:!0,multiSelect:!0,title:"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",confirmLabel:"\uBD99\uC774\uAE30",onClose:()=>g(!1),onSubmit:K=>{let G=c.find(ce=>ce.seq===K);p(e,K,String(G?.title??"").trim())}}):null,(0,ae.jsx)(eo,{open:!!R,anchorEl:R?.anchorEl??null,title:"\uC774 \uD560\uC77C\uC744 \uBCC4\uB3C4 \uC5C5\uBB34\uB85C \uB9CC\uB4DC\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uB9CC\uB4E4\uAE30",onCancel:()=>A(null),onConfirm:()=>{R&&f?.(e,R.index,R.label),A(null)}}),(0,ae.jsx)(ye.Dialog,{open:!!S,onClose:()=>D(null),maxWidth:"xs",fullWidth:!0,slotProps:{paper:{sx:{borderRadius:2,m:2}}},children:(0,ae.jsxs)(ye.Box,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5},children:[(0,ae.jsx)(ye.Box,{sx:{fontSize:15.5,fontWeight:600,color:"#37352f"},children:"\uD560\uC77C \uC218\uC815"}),(0,ae.jsx)(ye.TextField,{autoFocus:!0,fullWidth:!0,size:"medium",value:S?.label??"",onChange:K=>D(G=>G&&{...G,label:K.target.value}),onKeyDown:K=>{if(K.key!=="Enter")return;let G=S;G&&G.label.trim()&&i?.(e,G.index,G.label.trim()),D(null)}}),(0,ae.jsxs)(ye.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[!s&&f&&S&&!o[S.index]?.task_seq?(0,ae.jsx)(ye.IconButton,{"aria-label":"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",onClick:()=>{f(e,S.index,o[S.index]?.label??""),D(null)},sx:{color:"#57564f"},children:(0,ae.jsx)(gs.default,{sx:{fontSize:20}})}):null,!s&&S?(0,ae.jsx)(ye.IconButton,{"aria-label":"\uD560\uC77C \uC0AD\uC81C",onClick:()=>{r(e,S.index),D(null)},sx:{color:"#e5484d"},children:(0,ae.jsx)(xs.default,{sx:{fontSize:19}})}):null,(0,ae.jsx)(ye.Box,{sx:{flex:1}}),(0,ae.jsx)(ye.Button,{color:"inherit",onClick:()=>D(null),children:"\uCDE8\uC18C"}),(0,ae.jsx)(ye.Button,{variant:"contained",disabled:!S?.label.trim(),onClick:()=>{S&&S.label.trim()&&i?.(e,S.index,S.label.trim()),D(null)},children:"\uD655\uC778"})]})]})})]})}var $a=require("react"),Et=require("@mui/material"),Nf=a(require("@mui/icons-material/Close"),1),ks=a(require("@mui/icons-material/AttachFileOutlined"),1);var qh=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"]),Na=e=>{let o=e?.split(".").pop()?.toLowerCase()??"";return qh.has(o)};var Lf=require("@mui/material");var Xr=require("react/jsx-runtime");function bs(e){let o=nn(),t=o.useValue("attachmentUpload.taskSeq"),n=o.useValue("attachmentUpload.index"),r=o.useValue("attachmentUpload.total"),i=o.useValue("attachmentUpload.queue"),l=n??0;return!l||e>0&&(t??0)!==e?null:{index:l,total:r??0,queue:i??[]}}function Fa(){let o=nn().useValue("attachmentUpload.progress");return(0,Xr.jsxs)(Xr.Fragment,{children:[o??0,"%"]})}function hs(){let o=nn().useValue("attachmentUpload.progress");return(0,Xr.jsx)(Lf.LinearProgress,{variant:"determinate",value:o??0,sx:{height:4,borderRadius:2,bgcolor:"#dbe9fb",mt:.75}})}var ho=require("react/jsx-runtime");function Ha(e){return e>=1048576?`${(e/1048576).toFixed(1)}MB`:`${Math.max(1,Math.round(e/1024))}KB`}var Wa={flex:1,minWidth:0,fontSize:13.5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function Pi({taskSeq:e,attachments:o,onAdd:t,onRemove:n,removeLocked:r=!1,onPreview:i,onDownload:l}){let[s,f]=(0,$a.useState)(!1),m=(0,$a.useRef)(null),c=Je(),b=Ir(),p=vr(),u=bs(e),d=e===0,_=B=>{if(i){i(B);return}window.open(p(B.uuid??""),"_blank","noopener,noreferrer")},w=B=>{if(l){l(B);return}window.open(p(B.uuid??"",{download:!0}),"_blank","noopener,noreferrer")},k=B=>u?B+1<u.index?"done":B+1===u.index?"uploading":"waiting":"waiting",g=(B,P,S,D={})=>(0,ho.jsxs)(Et.Box,{sx:{px:1,py:.5,borderRadius:1,border:"1px solid",borderColor:D.uploading?"#d5e6fb":"#e6e6e3",bgcolor:D.uploading?"#f4f9ff":"transparent","&:hover .taskbox-file-remove":{opacity:1}},children:[(0,ho.jsxs)(Et.Box,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[(0,ho.jsx)(ks.default,{sx:{fontSize:16,color:"#9a9a97"}}),P,(0,ho.jsx)(Et.Box,{component:"span",sx:{fontSize:12,color:D.uploading?"#2f80ed":"#9a9a97",flexShrink:0},children:S}),D.removeIndex!==void 0?(0,ho.jsx)(Et.IconButton,{className:"taskbox-file-remove",size:"small","aria-label":"\uCCA8\uBD80 \uC0AD\uC81C",onClick:()=>n(e,D.removeIndex),sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:(0,ho.jsx)(Nf.default,{sx:{fontSize:15}})}):null]}),D.uploading?(0,ho.jsx)(hs,{}):null]},B),E=B=>{let P=Na(B.name);return(0,ho.jsx)(Et.Box,{component:"button",type:"button",onClick:()=>P?_(B):w(B),title:`${B.name} ${P?"\uBBF8\uB9AC\uBCF4\uAE30":"\uB2E4\uC6B4\uB85C\uB4DC"}`,sx:{...Wa,color:"#37352f",textAlign:"left",p:0,border:"none",background:"none",font:"inherit",fontSize:13.5,cursor:"pointer","&:hover":{textDecoration:"underline",color:"#2f80ed"}},children:B.name})};return(0,ho.jsxs)(Dt,{icon:(0,ho.jsx)(ks.default,{sx:{fontSize:18,display:"block"}}),title:(0,ho.jsxs)(ho.Fragment,{children:["\uD30C\uC77C ",o.length>0?o.length:""]}),children:[(0,ho.jsxs)(Et.Box,{sx:{display:"flex",flexDirection:"column",gap:.5,mt:1},children:[o.map((B,P)=>{let S=`${B.uuid||B.name}-${P}`;if(d){let D=k(P),R=D==="uploading";return g(S,(0,ho.jsx)(Et.Box,{component:"span",sx:{...Wa,color:D==="done"?"#37352f":"#9a9a97"},children:B.name}),R?(0,ho.jsx)(Fa,{}):Ha(B.size),{uploading:R,removeIndex:!r&&!u?P:void 0})}return B.uuid?g(S,E(B),Ha(B.size),{removeIndex:r?void 0:P}):g(S,(0,ho.jsx)(Et.Box,{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:{...Wa,color:"#9a9a97"},children:B.name}),Ha(B.size),{removeIndex:r?void 0:P})}),!d&&u?u.queue.slice(u.index-1).map((B,P)=>{let S=P===0;return g(`uploading-${u.index+P}-${B.name}`,(0,ho.jsx)(Et.Box,{component:"span",sx:{...Wa,color:"#9a9a97"},children:B.name}),S?(0,ho.jsx)(Fa,{}):Ha(B.size),{uploading:S})}):null]}),(0,ho.jsx)(Et.Box,{onClick:()=>m.current?.click(),onDragOver:B=>{B.preventDefault(),f(!0)},onDragLeave:()=>f(!1),onDrop:B=>{B.preventDefault(),f(!1);let P=Array.from(B.dataTransfer.files);P.length>0&&t(e,P)},sx:{mt:1,py:2.5,display:"flex",alignItems:"center",justifyContent:"center",gap:.5,border:"1.5px dashed",borderColor:s?"#2f80ed":"#cfcfcc",borderRadius:1,bgcolor:s?"#eef6ff":"transparent",color:"#787774",fontSize:13.5,cursor:"pointer",transition:"background-color 0.15s, border-color 0.15s","&:hover":{bgcolor:"#fafaf9",borderColor:"#9a9a97"}},children:c?`\uD30C\uC77C\uC744 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${b}MB)`:`\uD30C\uC77C\uC744 \uB04C\uC5B4\uB2E4 \uB193\uAC70\uB098 \uD074\uB9AD\uD574 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${b}MB)`}),(0,ho.jsx)(Et.Box,{component:"input",ref:m,type:"file",multiple:!0,onChange:B=>{let P=Array.from(B.target.files??[]);P.length>0&&t(e,P),B.target.value=""},sx:{display:"none"}})]})}var Kf=require("react"),Yt=require("@mui/material"),Uf=a(require("@mui/icons-material/Add"),1);var zi=require("react"),Qr=require("@mui/material"),Hf=require("@ehfuse/mui-form-dialog"),Wf=require("@ehfuse/mui-form-controls"),$f=require("@ehfuse/mui-color-picker"),Vf=require("@ehfuse/alerts");var pn=require("react/jsx-runtime"),Ff="#2f80ed";function Ts({open:e,onClose:o,onSubmit:t}){let[n,r]=(0,zi.useState)(""),[i,l]=(0,zi.useState)(Ff);(0,zi.useEffect)(()=>{e&&(r(""),l(Ff))},[e]);let s=()=>{let c=n.trim();if(!c){(0,Vf.ErrorAlert)("\uB77C\uBCA8 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}t(c,i),o()},f=kl(i),m=(0,pn.jsxs)(Qr.Box,{children:[(0,pn.jsxs)(Qr.Box,{sx:{display:"flex",alignItems:"center",gap:1.5,mt:.5},children:[(0,pn.jsx)(Wf.ClearTextField,{label:"\uB77C\uBCA8 \uC774\uB984",value:n,onChange:c=>r(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),s())},fullWidth:!0,autoFocus:!0}),(0,pn.jsx)($f.ColorPicker,{value:i,onChange:c=>l(c),shape:"circle",colorSize:28})]}),(0,pn.jsxs)(Qr.Box,{sx:{mt:2,display:"flex",alignItems:"center",gap:1,fontSize:13,color:"#787774"},children:["\uBBF8\uB9AC\uBCF4\uAE30",(0,pn.jsx)(Ze,{option:{key:"__preview__",name:n.trim()||"\uB77C\uBCA8",...f}})]})]});return(0,pn.jsx)(Hf.FormDialog,{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:m}],actions:{showCancelButton:!0,right:(0,pn.jsx)(Qr.Button,{variant:"contained",onClick:s,children:"\uCD94\uAC00"})}})}var Tt=require("react/jsx-runtime");function qi({anchorEl:e,selectedKeys:o,labelOptions:t,onToggle:n,onAddLabel:r,onClose:i}){let[l,s]=(0,Kf.useState)(!1),f=rn();return(0,Tt.jsxs)(Tt.Fragment,{children:[(0,Tt.jsxs)(Yt.Menu,{anchorEl:e,open:!!e,onClose:i,transitionDuration:0,...f,children:[t.map(m=>{let c=o.includes(m.key);return(0,Tt.jsxs)(Yt.MenuItem,{onClick:()=>n(m.key),sx:{fontSize:14,minWidth:170,gap:1},children:[(0,Tt.jsx)(Yt.Checkbox,{size:"small",checked:c,sx:{p:0}}),(0,Tt.jsx)(Ze,{option:m})]},m.key)}),(0,Tt.jsx)(Yt.Divider,{}),(0,Tt.jsxs)(Yt.MenuItem,{onClick:()=>s(!0),sx:{fontSize:14,color:"#787774"},children:[(0,Tt.jsx)(Yt.ListItemIcon,{children:(0,Tt.jsx)(Uf.default,{sx:{fontSize:18,color:"#787774"}})}),"\uB77C\uBCA8 \uCD94\uAC00"]})]}),(0,Tt.jsx)(Ts,{open:l,onClose:()=>s(!1),onSubmit:r})]})}function Gf(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 jf(e,o){let t=(e.target_account_seqs??[]).filter(b=>b>0);if(t.length===0)return null;let n=new Set(t),r=Gf(e,o),i=new Map;for(let b of r){let p=String(b.department??"").trim();if(!p)continue;let u=i.get(p)??[];u.push(b),i.set(p,u)}let l=[],s=new Set;for(let[b,p]of i)if(p.every(d=>n.has(Number(d.account_seq??0)))){l.push(b);for(let d of p)s.add(Number(d.account_seq??0))}let f=new Map(r.map(b=>[Number(b.account_seq??0),b.name])),m=e.target_names??[],c=[];return t.forEach((b,p)=>{s.has(b)||c.push(f.get(b)??m[p]??"\uC774\uB984\uC5C6\uC74C")}),{teamNames:l,individualNames:c}}function Ai(e,o){let t=jf(e,o);return t?[...t.teamNames,...t.individualNames].join(", "):"\uBAA8\uB4E0 \uC9C1\uC6D0"}function Ah(e,o){let t=jf(e,o);return t?{kind:"members",teamNames:t.teamNames,individualNames:t.individualNames}:{kind:"everyone"}}function ys(e,o,t){let n=(e.target_account_seqs??[]).filter(c=>c>0),r=Gf(e,o),i=n.length>0?n.length:r.length,l=e.acks??[],s=t>0&&l.some(c=>c.account_seq===t),f=t>0&&Number(e.author_account_seq??0)===t,m=n.length===0||n.includes(t);return{count:l.length,total:i,acked:s,canAck:t>0&&!f&&m&&!s&&!e.completed}}function Ss(e,o){let t=Number(o)||50,n=t*1024*1024,r=e.filter(s=>s.size>n),i=e.filter(s=>s.size<=n),l=r.length>0?`\uD30C\uC77C\uC740 1\uAC1C\uB2F9 \uCD5C\uB300 ${t}MB \uAE4C\uC9C0 \uCCA8\uBD80\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
6
+ `).trim()}function Mi({syncKey:e,value:o,onChange:t,readOnly:n=!1,minHeight:r=180,height:i=0,onChangeHeight:l}){let s=(0,kt.useRef)(null),f=(0,kt.useRef)(null),m=i>0?i:0,c=(0,kt.useRef)(m),b=(0,kt.useRef)(l);b.current=l;let p=(0,kt.useRef)(null),u=(0,kt.useRef)(Date.now()+800),[d,_]=(0,kt.useState)(!1),w=Je();(0,kt.useEffect)(()=>{if(n)return;let g=fs(o);p.current===g||p.current===o||(p.current=g,u.current=Date.now()+800,s.current?.setHtml(g))},[e,o,n]);let k=(0,kt.useRef)(-1);return(0,kt.useEffect)(()=>{if(n||w||i<=0||k.current===i||(k.current=i,Math.abs(i-c.current)<1))return;let g=f.current?.querySelector(".ehfuse-editor-container");g&&(Math.abs(g.getBoundingClientRect().height-i)<1||(g.style.height=`${i}px`,c.current=i))},[n,w,i]),(0,kt.useEffect)(()=>{if(n||w)return;let g=f.current?.querySelector(".ehfuse-editor-container");if(!g||typeof ResizeObserver>"u")return;let E,B=new ResizeObserver(P=>{let S=Math.round(P[0]?.contentRect.height??0);S<=0||(window.clearTimeout(E),E=window.setTimeout(()=>{Math.abs(S-c.current)<1||(c.current=S,b.current?.(S))},300))});return B.observe(g),()=>{window.clearTimeout(E),B.disconnect()}},[n,w]),n?(0,un.jsxs)(Gn.Box,{sx:{position:"relative",mt:1},children:[(0,un.jsx)(Gn.Box,{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:fs(o)}}),(0,un.jsx)(Gn.Tooltip,{title:"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:(0,un.jsx)(Gn.IconButton,{size:"small","aria-label":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>{navigator.clipboard.writeText(Sf(o)).then(()=>{_(!0),window.setTimeout(()=>_(!1),1500)})},sx:{position:"absolute",top:6,right:6,color:"#9a9a97"},children:d?(0,un.jsx)(yf.default,{sx:{fontSize:17,color:"#2f9e5b"}}):(0,un.jsx)(Tf.default,{sx:{fontSize:17}})})})]}):(0,un.jsx)(Gn.Box,{ref:f,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:(0,un.jsx)(Aa.EhfuseEditor,{ref:s,defaultValue:fs(o),autoHeight:w,resizable:!w,showToolbar:!w,focusBorder:!0,styles:{focusBorderColor:"var(--primary)"},toolbarOptions:Aa.minimalToolbarOptions,locale:"ko",minHeight:m||r,placeholder:"\uB0B4\uC6A9\uC744 \uC785\uB825\uD558\uC138\uC694",contentStyle:{padding:"12px"},onChange:g=>{let E=Date.now()<u.current,B=g===p.current;p.current=g,!(E||B)&&t(g)}})})}var kr=require("react"),ye=require("@mui/material"),dn=require("@dnd-kit/core"),La=require("@dnd-kit/modifiers"),Yn=require("@dnd-kit/sortable"),Ef=require("@dnd-kit/utilities"),xs=a(require("@mui/icons-material/Close"),1),Mf=a(require("@mui/icons-material/AddCircle"),1),gs=a(require("@mui/icons-material/AddTask"),1),Of=a(require("@mui/icons-material/Checklist"),1),Rf=a(require("@mui/icons-material/CheckCircle"),1),Pf=a(require("@mui/icons-material/DragIndicator"),1),zf=a(require("@mui/icons-material/Launch"),1),qf=a(require("@mui/icons-material/LinkOutlined"),1),Af=a(require("@mui/icons-material/RadioButtonUnchecked"),1);var jn=require("react"),Jo=require("@mui/material"),Cf=require("@ehfuse/mui-form-dialog"),vf=require("@ehfuse/mui-form-controls"),If=require("@ehfuse/alerts"),_f=a(require("@mui/icons-material/CheckCircle"),1),wf=a(require("@mui/icons-material/RadioButtonUnchecked"),1),Df=require("@ehfuse/overlay-scrollbar");var Eo=require("react/jsx-runtime"),Bf=[{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 Oi({open:e,task:o,tasks:t,excludeSeqs:n=[],onClose:r,onSubmit:i,hideRelationType:l=!1,title:s="\uAD00\uB828 \uC5C5\uBB34 \uC5F0\uACB0",confirmLabel:f="\uC5F0\uACB0",multiSelect:m=!1}){let c=Je(),[b,p]=(0,jn.useState)("related"),[u,d]=(0,jn.useState)(""),[_,w]=(0,jn.useState)([]);(0,jn.useEffect)(()=>{e&&(p("related"),d(""),w([]))},[e]);let k=(0,jn.useMemo)(()=>{let S=new Set([o.seq,...n]),D=u.trim().toLowerCase();return t.filter(R=>S.has(R.seq)||R.is_event||R.is_notice||R.linked_only?!1:D?R.title.toLowerCase().includes(D)||(R.ticket_no??"").toLowerCase().includes(D):!0).sort((R,A)=>!!R.completed!=!!A.completed?R.completed?1:-1:A.seq-R.seq)},[t,o.seq,n,u]),g=()=>{if(_.length===0){(0,If.ErrorAlert)("\uC5F0\uACB0\uD560 \uC5C5\uBB34\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}for(let S of _)i(S,b);r()},E=S=>{w(D=>D.includes(S)?D.filter(R=>R!==S):m?[...D,S]:[S])},B=Bf.find(S=>S.type===b)?.hint??"",P=(0,Eo.jsxs)(Jo.Box,{sx:{...c?{height:"100%",minHeight:0}:{height:560},display:"flex",flexDirection:"column",...c?{}:{border:"1px solid #cccccc",borderRadius:1},overflow:"hidden",userSelect:"none"},children:[l?null:(0,Eo.jsx)(Jo.Tabs,{value:b,onChange:(S,D)=>p(D),sx:{minHeight:38,mb:.75,flexShrink:0,"& .MuiTab-root":{minHeight:38,py:.5,fontSize:14}},children:Bf.map(S=>(0,Eo.jsx)(Jo.Tab,{value:S.type,label:S.label},S.type))}),l?null:(0,Eo.jsx)(Jo.Box,{sx:{mb:1.5,fontSize:12.5,color:"#9a9a97"},children:B}),(0,Eo.jsx)(Jo.Box,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:(0,Eo.jsx)(vf.ClearTextField,{placeholder:"\uC81C\uBAA9\xB7\uD2F0\uCF13\uBC88\uD638\uB85C \uAC80\uC0C9",value:u,onChange:S=>d(S.target.value),fullWidth:!0,autoFocus:!0,size:"small",sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),(0,Eo.jsx)(Jo.Box,{sx:{flex:1,minHeight:0},children:(0,Eo.jsx)(Df.OverlayScrollbar,{style:{height:"100%"},contentStyle:{paddingTop:0},children:(0,Eo.jsx)(Jo.Box,{sx:{display:"flex",flexDirection:"column"},children:k.length===0?(0,Eo.jsx)(Jo.Box,{sx:{py:4,textAlign:"center",fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uD560 \uC218 \uC788\uB294 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):k.map(S=>{let D=S.is_notice||S.is_event?Me(S.icon||(S.is_notice?yo:Po)):null,R=_.includes(S.seq);return(0,Eo.jsxs)(Jo.Box,{onClick:()=>E(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:R?"#e3eefb":"transparent","&:hover":{bgcolor:R?"#e3eefb":"#f7f7f5"}},children:[R?(0,Eo.jsx)(_f.default,{sx:{fontSize:20,flexShrink:0,color:"#2f6fd0"}}):(0,Eo.jsx)(wf.default,{sx:{fontSize:20,flexShrink:0,color:"#c9c8c5"}}),D?(0,Eo.jsx)(D,{sx:{fontSize:17,flexShrink:0,color:S.icon_color||"#1e3a8a"}}):null,(0,Eo.jsxs)(Jo.Box,{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]}),(0,Eo.jsx)(Jo.Box,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:(0,Eo.jsx)(Ze,{option:Ko(S)})})]},S.seq)})})})})]});return(0,Eo.jsx)(Cf.FormDialog,{open:e,onClose:r,maxWidth:"sm",fullScreen:c,mobilePresentation:c?"slide":"dialog",...c?{contentPaddingX:0,contentTopPadding:0,sectionsPaddingTop:0}:{},sx:c?{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:s,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-task-link",sections:[{id:"task-link",showTitle:!1,children:P}],scrollPastLastSection:!1,sectionContentPaddingTop:0,actions:{showCancelButton:!0,right:(0,Eo.jsx)(Jo.Button,{variant:"contained",disabled:_.length===0,onClick:g,children:f})}})}var ae=require("react/jsx-runtime");function Ph({id:e,children:o}){let{attributes:t,listeners:n,setNodeRef:r,transform:i,transition:l,isDragging:s}=(0,Yn.useSortable)({id:e});return(0,ae.jsx)(ye.Box,{ref:r,sx:{transform:Ef.CSS.Transform.toString(i),transition:l,...s?{opacity:.6,position:"relative",zIndex:1}:{}},children:o({handleProps:{...t,...n},dragging:s})})}function zh({sortable:e,sensors:o,rowIds:t,onDragEnd:n,children:r}){let i=(0,ae.jsx)(ye.Box,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:r});return e?(0,ae.jsx)(dn.DndContext,{sensors:o,collisionDetection:dn.closestCenter,modifiers:[La.restrictToVerticalAxis,La.restrictToParentElement],onDragEnd:n,children:(0,ae.jsx)(Yn.SortableContext,{items:t,strategy:Yn.verticalListSortingStrategy,children:i})}):i}function Ri({taskSeq:e,checklist:o,onAdd:t,onToggle:n,onRemove:r,onUpdate:i,onReorder:l,removeLocked:s=!1,onConvertToTask:f,onOpenLinkedTask:m,linkCandidates:c,linkBaseTask:b,onLinkExistingTask:p,resolveLinkedTask:u,myAccountSeq:d=0}){let[_,w]=(0,kr.useState)(""),[k,g]=(0,kr.useState)(!1),[E,B]=(0,kr.useState)(null),P=Je(),[S,D]=(0,kr.useState)(null),[R,A]=(0,kr.useState)(null),C=K=>{let G=K.task_seq?u?.(K.task_seq):void 0;return G?G.completed:K.checked},ie=K=>{if(!K.task_seq||d<=0)return!1;let G=u?.(K.task_seq);return G?!vl(G,d):!1},h=o.filter(C).length,[x,I]=(0,kr.useState)(!1),T=!!l&&!P&&!s,y=(0,dn.useSensors)((0,dn.useSensor)(dn.PointerSensor,{activationConstraint:{distance:5}})),M=(K,G)=>K.task_seq?`linked-${K.task_seq}`:`row-${G}`,Z=o.map(M),de=x?Z.filter((K,G)=>!C(o[G])):Z,qe=K=>{let{active:G,over:ce}=K;if(!ce||G.id===ce.id)return;let Se=Z.indexOf(String(G.id)),Oe=Z.indexOf(String(ce.id));Se<0||Oe<0||l?.(e,(0,Yn.arrayMove)(o,Se,Oe))},ge=()=>{_.trim()&&(t(e,_),w(""))};return(0,ae.jsxs)(Dt,{icon:(0,ae.jsx)(Of.default,{sx:{fontSize:19,display:"block"}}),title:(0,ae.jsxs)(ae.Fragment,{children:["\uD560\uC77C",o.length>0?(0,ae.jsxs)(ye.Box,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:[h," / ",o.length]}):null]}),titleExtra:o.length>0?(0,ae.jsxs)(ye.Box,{sx:{flex:1,minWidth:0,ml:1,display:"flex",alignItems:"center",gap:1},children:[(0,ae.jsx)(ye.Box,{sx:{flex:1,minWidth:0,height:6,borderRadius:3,bgcolor:"#ececea"},children:(0,ae.jsx)(ye.Box,{sx:{height:"100%",borderRadius:3,width:`${Math.round(h/o.length*100)}%`,bgcolor:"#2f80ed",transition:"width 0.2s"}})}),h>0?(0,ae.jsxs)(ye.Box,{component:"label",sx:{display:"inline-flex",alignItems:"center",gap:.25,flexShrink:0,cursor:"pointer",fontSize:13.5,fontWeight:400,color:"#57564f",userSelect:"none"},children:[(0,ae.jsx)(ye.Switch,{size:"small",checked:x,onChange:(K,G)=>I(G)}),"\uC644\uB8CC \uC228\uAE40"]}):null]}):null,children:[(0,ae.jsx)(zh,{sortable:T,sensors:y,rowIds:de,onDragEnd:qe,children:o.map((K,G)=>{let ce=K.task_seq?u?.(K.task_seq):void 0,Se=C(K);if(x&&Se)return null;let Oe=!!K.task_seq,We=ie(K),j=N=>(0,ae.jsxs)(ye.Box,{sx:{display:"flex",alignItems:"center",gap:1,px:1.25,...T?{ml:-3,pl:.5}:{},py:.5,borderRadius:1,"&:hover":{bgcolor:"#f7f7f5"},"&:hover .taskbox-checklist-remove":{opacity:1},"&:hover .taskbox-checklist-convert":{opacity:1},"&:hover .taskbox-checklist-handle":{opacity:1}},children:[N?(0,ae.jsx)(ye.Box,{className:"taskbox-checklist-handle",...N,sx:{display:"inline-flex",flexShrink:0,alignItems:"center",color:"#c9c8c5",opacity:0,transition:"opacity 0.15s",cursor:"grab","&:active":{cursor:"grabbing"},touchAction:"none",userSelect:"none"},children:(0,ae.jsx)(Pf.default,{sx:{fontSize:16}})}):null,(0,ae.jsx)(ye.Tooltip,{title:We?"\uC5F0\uACB0 \uC5C5\uBB34\uC758 \uC791\uC131\uC790\xB7\uCC45\uC784\uC790\uB9CC \uC644\uB8CC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4":"",arrow:!0,disableInteractive:!0,children:(0,ae.jsx)(ye.Box,{component:"span",onClick:We?void 0:()=>n(e,G,!Se),sx:{display:"inline-flex",flexShrink:0,cursor:We?"default":"pointer"},children:Se?(0,ae.jsx)(Rf.default,{sx:{fontSize:18,color:We?"#a9c6ec":"#2f80ed"}}):(0,ae.jsx)(Af.default,{sx:{fontSize:18,color:We?"#d6d5d1":"#9a9a97"}})})}),E?.index===G?(0,ae.jsx)(ye.Box,{component:"input",autoFocus:!0,spellCheck:!1,value:E.label,enterKeyHint:"done",onChange:le=>B({index:G,label:le.target.value}),onBlur:()=>{E.label.trim()&&E.label.trim()!==K.label&&i?.(e,G,E.label),B(null)},onKeyDown:le=>{le.key==="Enter"&&le.target.blur(),le.key==="Escape"&&B(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",p:0}}):(0,ae.jsx)(ye.Box,{component:"span",onClick:Oe?K.task_seq&&m?()=>m(K.task_seq):void 0:s||!i?void 0:P?()=>D({index:G,label:K.label}):()=>B({index:G,label:K.label}),sx:{flex:1,minWidth:0,fontSize:14.5,color:"#37352f",textDecoration:Se?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...Oe?m?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}:s||!i?{}:{cursor:"text"}},children:K.label}),Oe?(0,ae.jsxs)(ye.Box,{component:"span",onClick:K.task_seq&&m?()=>m(K.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",...m?{cursor:"pointer"}:{}},children:[(0,ae.jsx)(zf.default,{sx:{fontSize:12}}),ce?.manager_name?.trim()||"\uC5C5\uBB34"]}):null,!s&&!Oe&&f?(0,ae.jsx)(ye.Tooltip,{title:"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",arrow:!0,enterDelay:300,disableInteractive:!0,children:(0,ae.jsx)(ye.IconButton,{className:"taskbox-checklist-convert",size:"small","aria-label":"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",onClick:le=>A({anchorEl:le.currentTarget,index:G,label:K.label}),sx:{display:P?"none":"inline-flex",opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:(0,ae.jsx)(gs.default,{sx:{fontSize:16}})})}):null,s?null:(0,ae.jsx)(ye.IconButton,{className:"taskbox-checklist-remove",size:"small","aria-label":"\uD560\uC77C \uC0AD\uC81C",onClick:()=>r(e,G),sx:{display:P?"none":"inline-flex",opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:(0,ae.jsx)(xs.default,{sx:{fontSize:15}})})]});return T?(0,ae.jsx)(Ph,{id:Z[G],children:({handleProps:N})=>j(N)},Z[G]):(0,ae.jsx)(ye.Box,{children:j(null)},Z[G])})}),(0,ae.jsxs)(ye.Box,{sx:{mt:.5,ml:3.25,display:"flex",alignItems:"center",gap:.5},children:[(0,ae.jsx)(ye.Box,{component:"input",spellCheck:!1,value:_,placeholder:"+ \uD560\uC77C \uCD94\uAC00",enterKeyHint:"done",onChange:K=>w(K.target.value),onKeyDown:K=>{K.key==="Enter"&&ge()},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"}}}),c&&b&&p?(0,ae.jsx)(ye.Tooltip,{title:"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",arrow:!0,children:(0,ae.jsx)(ye.IconButton,{size:"small","aria-label":"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",onMouseDown:K=>K.preventDefault(),onClick:()=>g(!0),sx:{flexShrink:0,color:"#9a9a97"},children:(0,ae.jsx)(qf.default,{sx:{fontSize:20}})})}):null,(0,ae.jsx)(ye.IconButton,{size:"small","aria-label":"\uD560\uC77C \uCD94\uAC00",disabled:!_.trim(),onMouseDown:K=>K.preventDefault(),onClick:ge,sx:{flexShrink:0,color:_.trim()?"#2f80ed":"#c9c8c5"},children:(0,ae.jsx)(Mf.default,{sx:{fontSize:20}})})]}),c&&b&&p?(0,ae.jsx)(Oi,{open:k,task:b,tasks:c,excludeSeqs:o.map(K=>Number(K.task_seq??0)).filter(K=>K>0),hideRelationType:!0,multiSelect:!0,title:"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",confirmLabel:"\uBD99\uC774\uAE30",onClose:()=>g(!1),onSubmit:K=>{let G=c.find(ce=>ce.seq===K);p(e,K,String(G?.title??"").trim())}}):null,(0,ae.jsx)(eo,{open:!!R,anchorEl:R?.anchorEl??null,title:"\uC774 \uD560\uC77C\uC744 \uBCC4\uB3C4 \uC5C5\uBB34\uB85C \uB9CC\uB4DC\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uB9CC\uB4E4\uAE30",onCancel:()=>A(null),onConfirm:()=>{R&&f?.(e,R.index,R.label),A(null)}}),(0,ae.jsx)(ye.Dialog,{open:!!S,onClose:()=>D(null),maxWidth:"xs",fullWidth:!0,slotProps:{paper:{sx:{borderRadius:2,m:2}}},children:(0,ae.jsxs)(ye.Box,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5},children:[(0,ae.jsx)(ye.Box,{sx:{fontSize:15.5,fontWeight:600,color:"#37352f"},children:"\uD560\uC77C \uC218\uC815"}),(0,ae.jsx)(ye.TextField,{autoFocus:!0,fullWidth:!0,size:"medium",value:S?.label??"",onChange:K=>D(G=>G&&{...G,label:K.target.value}),onKeyDown:K=>{if(K.key!=="Enter")return;let G=S;G&&G.label.trim()&&i?.(e,G.index,G.label.trim()),D(null)}}),(0,ae.jsxs)(ye.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[!s&&f&&S&&!o[S.index]?.task_seq?(0,ae.jsx)(ye.IconButton,{"aria-label":"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",onClick:()=>{f(e,S.index,o[S.index]?.label??""),D(null)},sx:{color:"#57564f"},children:(0,ae.jsx)(gs.default,{sx:{fontSize:20}})}):null,!s&&S?(0,ae.jsx)(ye.IconButton,{"aria-label":"\uD560\uC77C \uC0AD\uC81C",onClick:()=>{r(e,S.index),D(null)},sx:{color:"#e5484d"},children:(0,ae.jsx)(xs.default,{sx:{fontSize:19}})}):null,(0,ae.jsx)(ye.Box,{sx:{flex:1}}),(0,ae.jsx)(ye.Button,{color:"inherit",onClick:()=>D(null),children:"\uCDE8\uC18C"}),(0,ae.jsx)(ye.Button,{variant:"contained",disabled:!S?.label.trim(),onClick:()=>{S&&S.label.trim()&&i?.(e,S.index,S.label.trim()),D(null)},children:"\uD655\uC778"})]})]})})]})}var $a=require("react"),Et=require("@mui/material"),Nf=a(require("@mui/icons-material/Close"),1),ks=a(require("@mui/icons-material/AttachFileOutlined"),1);var qh=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"]),Na=e=>{let o=e?.split(".").pop()?.toLowerCase()??"";return qh.has(o)};var Lf=require("@mui/material");var Xr=require("react/jsx-runtime");function bs(e){let o=nn(),t=o.useValue("attachmentUpload.taskSeq"),n=o.useValue("attachmentUpload.index"),r=o.useValue("attachmentUpload.total"),i=o.useValue("attachmentUpload.queue"),l=n??0;return!l||e>0&&(t??0)!==e?null:{index:l,total:r??0,queue:i??[]}}function Fa(){let o=nn().useValue("attachmentUpload.progress");return(0,Xr.jsxs)(Xr.Fragment,{children:[o??0,"%"]})}function hs(){let o=nn().useValue("attachmentUpload.progress");return(0,Xr.jsx)(Lf.LinearProgress,{variant:"determinate",value:o??0,sx:{height:4,borderRadius:2,bgcolor:"#dbe9fb",mt:.75}})}var ho=require("react/jsx-runtime");function Ha(e){return e>=1048576?`${(e/1048576).toFixed(1)}MB`:`${Math.max(1,Math.round(e/1024))}KB`}var Wa={flex:1,minWidth:0,fontSize:13.5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function Pi({taskSeq:e,attachments:o,onAdd:t,onRemove:n,removeLocked:r=!1,onPreview:i,onDownload:l}){let[s,f]=(0,$a.useState)(!1),m=(0,$a.useRef)(null),c=Je(),b=Ir(),p=vr(),u=bs(e),d=e===0,_=B=>{if(i){i(B);return}window.open(p(B.uuid??""),"_blank","noopener,noreferrer")},w=B=>{if(l){l(B);return}window.open(p(B.uuid??"",{download:!0}),"_blank","noopener,noreferrer")},k=B=>u?B+1<u.index?"done":B+1===u.index?"uploading":"waiting":"waiting",g=(B,P,S,D={})=>(0,ho.jsxs)(Et.Box,{sx:{px:1,py:.5,borderRadius:1,border:"1px solid",borderColor:D.uploading?"#d5e6fb":"#e6e6e3",bgcolor:D.uploading?"#f4f9ff":"transparent","&:hover .taskbox-file-remove":{opacity:1}},children:[(0,ho.jsxs)(Et.Box,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[(0,ho.jsx)(ks.default,{sx:{fontSize:16,color:"#9a9a97"}}),P,(0,ho.jsx)(Et.Box,{component:"span",sx:{fontSize:12,color:D.uploading?"#2f80ed":"#9a9a97",flexShrink:0},children:S}),D.removeIndex!==void 0?(0,ho.jsx)(Et.IconButton,{className:"taskbox-file-remove",size:"small","aria-label":"\uCCA8\uBD80 \uC0AD\uC81C",onClick:()=>n(e,D.removeIndex),sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:(0,ho.jsx)(Nf.default,{sx:{fontSize:15}})}):null]}),D.uploading?(0,ho.jsx)(hs,{}):null]},B),E=B=>{let P=Na(B.name);return(0,ho.jsx)(Et.Box,{component:"button",type:"button",onClick:()=>P?_(B):w(B),title:`${B.name} ${P?"\uBBF8\uB9AC\uBCF4\uAE30":"\uB2E4\uC6B4\uB85C\uB4DC"}`,sx:{...Wa,color:"#37352f",textAlign:"left",p:0,border:"none",background:"none",font:"inherit",fontSize:13.5,cursor:"pointer","&:hover":{textDecoration:"underline",color:"#2f80ed"}},children:B.name})};return(0,ho.jsxs)(Dt,{icon:(0,ho.jsx)(ks.default,{sx:{fontSize:18,display:"block"}}),title:(0,ho.jsxs)(ho.Fragment,{children:["\uD30C\uC77C ",o.length>0?o.length:""]}),children:[(0,ho.jsxs)(Et.Box,{sx:{display:"flex",flexDirection:"column",gap:.5,mt:1},children:[o.map((B,P)=>{let S=`${B.uuid||B.name}-${P}`;if(d){let D=k(P),R=D==="uploading";return g(S,(0,ho.jsx)(Et.Box,{component:"span",sx:{...Wa,color:D==="done"?"#37352f":"#9a9a97"},children:B.name}),R?(0,ho.jsx)(Fa,{}):Ha(B.size),{uploading:R,removeIndex:!r&&!u?P:void 0})}return B.uuid?g(S,E(B),Ha(B.size),{removeIndex:r?void 0:P}):g(S,(0,ho.jsx)(Et.Box,{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:{...Wa,color:"#9a9a97"},children:B.name}),Ha(B.size),{removeIndex:r?void 0:P})}),!d&&u?u.queue.slice(u.index-1).map((B,P)=>{let S=P===0;return g(`uploading-${u.index+P}-${B.name}`,(0,ho.jsx)(Et.Box,{component:"span",sx:{...Wa,color:"#9a9a97"},children:B.name}),S?(0,ho.jsx)(Fa,{}):Ha(B.size),{uploading:S})}):null]}),(0,ho.jsx)(Et.Box,{onClick:()=>m.current?.click(),onDragOver:B=>{B.preventDefault(),f(!0)},onDragLeave:()=>f(!1),onDrop:B=>{B.preventDefault(),f(!1);let P=Array.from(B.dataTransfer.files);P.length>0&&t(e,P)},sx:{mt:1,py:2.5,display:"flex",alignItems:"center",justifyContent:"center",gap:.5,border:"1.5px dashed",borderColor:s?"#2f80ed":"#cfcfcc",borderRadius:1,bgcolor:s?"#eef6ff":"transparent",color:"#787774",fontSize:13.5,cursor:"pointer",transition:"background-color 0.15s, border-color 0.15s","&:hover":{bgcolor:"#fafaf9",borderColor:"#9a9a97"}},children:c?`\uD30C\uC77C\uC744 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${b}MB)`:`\uD30C\uC77C\uC744 \uB04C\uC5B4\uB2E4 \uB193\uAC70\uB098 \uD074\uB9AD\uD574 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${b}MB)`}),(0,ho.jsx)(Et.Box,{component:"input",ref:m,type:"file",multiple:!0,onChange:B=>{let P=Array.from(B.target.files??[]);P.length>0&&t(e,P),B.target.value=""},sx:{display:"none"}})]})}var Kf=require("react"),Yt=require("@mui/material"),Uf=a(require("@mui/icons-material/Add"),1);var zi=require("react"),Qr=require("@mui/material"),Hf=require("@ehfuse/mui-form-dialog"),Wf=require("@ehfuse/mui-form-controls"),$f=require("@ehfuse/mui-color-picker"),Vf=require("@ehfuse/alerts");var pn=require("react/jsx-runtime"),Ff="#2f80ed";function Ts({open:e,onClose:o,onSubmit:t}){let[n,r]=(0,zi.useState)(""),[i,l]=(0,zi.useState)(Ff);(0,zi.useEffect)(()=>{e&&(r(""),l(Ff))},[e]);let s=()=>{let c=n.trim();if(!c){(0,Vf.ErrorAlert)("\uB77C\uBCA8 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}t(c,i),o()},f=kl(i),m=(0,pn.jsxs)(Qr.Box,{children:[(0,pn.jsxs)(Qr.Box,{sx:{display:"flex",alignItems:"center",gap:1.5,mt:.5},children:[(0,pn.jsx)(Wf.ClearTextField,{label:"\uB77C\uBCA8 \uC774\uB984",value:n,onChange:c=>r(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),s())},fullWidth:!0,autoFocus:!0}),(0,pn.jsx)($f.ColorPicker,{value:i,onChange:c=>l(c),shape:"circle",colorSize:28})]}),(0,pn.jsxs)(Qr.Box,{sx:{mt:2,display:"flex",alignItems:"center",gap:1,fontSize:13,color:"#787774"},children:["\uBBF8\uB9AC\uBCF4\uAE30",(0,pn.jsx)(Ze,{option:{key:"__preview__",name:n.trim()||"\uB77C\uBCA8",...f}})]})]});return(0,pn.jsx)(Hf.FormDialog,{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:m}],actions:{showCancelButton:!0,right:(0,pn.jsx)(Qr.Button,{variant:"contained",onClick:s,children:"\uCD94\uAC00"})}})}var Tt=require("react/jsx-runtime");function qi({anchorEl:e,selectedKeys:o,labelOptions:t,onToggle:n,onAddLabel:r,onClose:i}){let[l,s]=(0,Kf.useState)(!1),f=rn();return(0,Tt.jsxs)(Tt.Fragment,{children:[(0,Tt.jsxs)(Yt.Menu,{anchorEl:e,open:!!e,onClose:i,transitionDuration:0,...f,children:[t.map(m=>{let c=o.includes(m.key);return(0,Tt.jsxs)(Yt.MenuItem,{onClick:()=>n(m.key),sx:{fontSize:14,minWidth:170,gap:1},children:[(0,Tt.jsx)(Yt.Checkbox,{size:"small",checked:c,sx:{p:0}}),(0,Tt.jsx)(Ze,{option:m})]},m.key)}),(0,Tt.jsx)(Yt.Divider,{}),(0,Tt.jsxs)(Yt.MenuItem,{onClick:()=>s(!0),sx:{fontSize:14,color:"#787774"},children:[(0,Tt.jsx)(Yt.ListItemIcon,{children:(0,Tt.jsx)(Uf.default,{sx:{fontSize:18,color:"#787774"}})}),"\uB77C\uBCA8 \uCD94\uAC00"]})]}),(0,Tt.jsx)(Ts,{open:l,onClose:()=>s(!1),onSubmit:r})]})}function Gf(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 jf(e,o){let t=(e.target_account_seqs??[]).filter(b=>b>0);if(t.length===0)return null;let n=new Set(t),r=Gf(e,o),i=new Map;for(let b of r){let p=String(b.department??"").trim();if(!p)continue;let u=i.get(p)??[];u.push(b),i.set(p,u)}let l=[],s=new Set;for(let[b,p]of i)if(p.every(d=>n.has(Number(d.account_seq??0)))){l.push(b);for(let d of p)s.add(Number(d.account_seq??0))}let f=new Map(r.map(b=>[Number(b.account_seq??0),b.name])),m=e.target_names??[],c=[];return t.forEach((b,p)=>{s.has(b)||c.push(f.get(b)??m[p]??"\uC774\uB984\uC5C6\uC74C")}),{teamNames:l,individualNames:c}}function Ai(e,o){let t=jf(e,o);return t?[...t.teamNames,...t.individualNames].join(", "):"\uBAA8\uB4E0 \uC9C1\uC6D0"}function Ah(e,o){let t=jf(e,o);return t?{kind:"members",teamNames:t.teamNames,individualNames:t.individualNames}:{kind:"everyone"}}function ys(e,o,t){let n=(e.target_account_seqs??[]).filter(c=>c>0),r=Gf(e,o),i=n.length>0?n.length:r.length,l=e.acks??[],s=t>0&&l.some(c=>c.account_seq===t),f=t>0&&Number(e.author_account_seq??0)===t,m=n.length===0||n.includes(t);return{count:l.length,total:i,acked:s,canAck:t>0&&!f&&m&&!s&&!e.completed}}function Ss(e,o){let t=Number(o)||50,n=t*1024*1024,r=e.filter(s=>s.size>n),i=e.filter(s=>s.size<=n),l=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(s=>s.name).join(", ")}`:null;return{accepted:i,rejected:r,message:l}}var nx=require("@ehfuse/mui-datetime-picker"),ne=require("react/jsx-runtime"),_s="#0f9d58";function Va({form:e,statusOptions:o,customTabs:t,sprints:n=[],avatarSrcByName:r,isNotice:i=!1,hideProject:l=!1,hideBug:s=!1,leadingRow:f,hideLabel:m=!1,employees:c=[],myAccountSeq:b=0,departments:p=[],myGroupSeq:u=0,onMemberEdit:d,onAddProject:_,onAddLabelOption:w,contentSyncKey:k="create"}){let g=nn(),E=Ir(),B=e.useFormValue("manager_name"),P=e.useFormValue("receiver_names"),S=e.useFormValue("start_date"),D=!!e.useFormValue("is_event"),R=!!e.useFormValue("is_bug"),A=e.useFormValue("bug_repro")??"",C=e.useFormValue("bug_device")??"",ie=e.useFormValue("bug_where")??"",h=e.useFormValue("bug_version")??"",x=e.useFormValue("event_time")??"",I=e.useFormValue("event_place")??"",T=e.useFormValue("event_address")??"",y=e.useFormValue("due_date"),M=e.useFormValue("reminder"),Z=e.useFormValue("priority"),de=e.useFormValue("content"),ge=e.useFormValue("checklist")??[],K=e.useFormValue("tab_key"),G=e.useFormValue("sprint_seq")??0,ce=e.useFormValue("story_points")??0,Se=t.find(z=>z.key===K&&z.useSprints),Oe=Se?n.filter(z=>`custom-${z.group_seq}`===K):[],[We,j]=(0,Zr.useState)(null),N=e.useFormValue("label_keys"),[le,L]=(0,Zr.useState)(null),$=e.useFormValue("visibility")||"involved",F=Number(e.useFormValue("visibility_group_seq")??0),[X,Ie]=(0,Zr.useState)(null),Ye=e.useFormValue("repeat_rule")||"",_o=e.useFormValue("repeat_until")||"",[ko,$e]=(0,Zr.useState)(null),[wo,J]=(0,Zr.useState)(null),V=e.useFormValue("target_names"),Lo=e.useFormValue("target_account_seqs"),Pn=g.useValue("createAttachmentFiles")??[],rr=i?Ai({author_account_seq:b,target_names:V,target_account_seqs:Lo},c):"";return(0,ne.jsxs)(ne.Fragment,{children:[f,i?null:(0,ne.jsx)(lo.Box,{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"},...s?[]:[{value:"bug",label:"\uC624\uB958"}]].map(z=>{let _e=R?"bug":D?"event":"task",Ae=_e===z.value;return(0,ne.jsx)(lo.ButtonBase,{onClick:()=>{if(_e===z.value)return;e.setFormValue("is_event",z.value==="event"),e.setFormValue("is_bug",z.value==="bug"),e.setFormValue("visibility",z.value==="bug"?"all":"involved"),e.setFormValue("visibility_group_seq",0),z.value==="bug"&&(e.setFormValue("repeat_rule",""),e.setFormValue("repeat_until",""));let so=e.getFormValue("icon"),po=e.getFormValue("icon_color"),Ro=[tn,"event",_r].includes(so),ot=!po||po===_s||po===wr;Ro&&e.setFormValue("icon",z.value==="event"?"event":z.value==="bug"?_r:tn),ot&&e.setFormValue("icon_color",z.value==="event"?_s:z.value==="bug"?wr:"")},sx:{px:1.75,py:.75,borderRadius:99,fontSize:13.5,fontWeight:Ae?600:400,color:Ae?"#ffffff":"#787774",bgcolor:Ae?"#2563eb":"#f4f4f2"},children:z.label},z.label)})}),(0,ne.jsx)(lo.Divider,{sx:{borderColor:"#e6e6e3"}}),(0,ne.jsxs)(lo.Box,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:.25},children:[(0,ne.jsx)(Di,{hideProject:l,hideDueDate:!D&&!!Ye,hideReminder:!!Ye,values:{tabKey:K,managerName:B,receiverNames:P,startDate:S,dueDate:y,reminder:M,priority:Z,eventTime:x,eventPlace:I,eventAddress:T},customTabs:t,avatarSrcByName:r,notice:i,event:D,onChangeEventTime:z=>e.setFormValue("event_time",z),onChangeEventPlace:z=>e.setFormValue("event_place",z),onChangeEventAddress:z=>e.setFormValue("event_address",z),targetSummary:rr,onChangeProject:z=>e.setFormValue("tab_key",z),onAddProject:_,onChangeStartDate:z=>e.setFormValue("start_date",z),onChangeDueDate:z=>e.setFormValue("due_date",z),onChangeReminder:z=>e.setFormValue("reminder",z),onChangePriority:z=>e.setFormValue("priority",z),onMemberEdit:d,pinColumns:!0,beforeStart:(0,ne.jsxs)(ne.Fragment,{children:[!i&&!R?(0,ne.jsx)(Te,{icon:(0,ne.jsx)(Jf.default,{sx:{fontSize:17,...Ye?{color:"#2f80ed"}:{}}}),label:"\uBC18\uBCF5",onClick:z=>$e(z),sx:D?void 0:Bo(2),children:Ye?vi(Ye):(0,ne.jsx)(lo.Box,{component:"span",sx:{color:"#9a9a97"},children:"\uC5C6\uC74C"})}):null,!i&&!R&&Ye?(0,ne.jsx)(Te,{icon:(0,ne.jsx)(ex.default,{sx:{fontSize:17}}),label:"\uBC18\uBCF5 \uC885\uB8CC",onClick:z=>J(z),sx:D?void 0:Bo(2),children:_o?vt(_o):(0,ne.jsx)(lo.Box,{component:"span",sx:{color:"#9a9a97"},children:"\uC790\uB3D9"})}):null]}),trailing:(0,ne.jsxs)(ne.Fragment,{children:[i?null:(0,ne.jsx)(Te,{icon:$==="all"?(0,ne.jsx)(Cs.default,{sx:{fontSize:17,color:"#2f80ed"}}):$==="group"?(0,ne.jsx)(vs.default,{sx:{fontSize:17,color:"#d9730d"}}):(0,ne.jsx)(Bs.default,{sx:{fontSize:17}}),label:"\uACF5\uAC1C",onClick:z=>Ie(z),sx:D?void 0:Bo(1),children:$==="all"?"\uC804\uCCB4\uACF5\uAC1C":$==="group"?`\uBD80\uC11C\uACF5\uAC1C \xB7 ${p.find(z=>z.seq===F)?.name??"\uBD80\uC11C"}`:"\uBE44\uACF5\uAC1C"}),Se&&!D&&!i?(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(Te,{icon:(0,ne.jsx)(Zf.default,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:z=>j(z),sx:Bo(1),children:G>0?Oe.find(z=>z.seq===G)?.name??"\uC0AD\uC81C\uB41C \uBAA9\uD45C":(0,ne.jsx)(lo.Box,{component:"span",sx:{color:"#9a9a97"},children:"\uBBF8\uBC30\uC815"})}),(0,ne.jsx)(Te,{icon:(0,ne.jsx)(ox.default,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",sx:Bo(1),children:(0,ne.jsx)(mn,{value:ce>0?String(ce):"",placeholder:"\uBBF8\uCD94\uC815",onCommit:z=>e.setFormValue("story_points",Number(z.replace(/[^0-9.]/g,""))||0)})})]}):null,R?(0,ne.jsx)(Ei,{values:{repro:A,device:C,where:ie,version:h},onChangeRepro:z=>e.setFormValue("bug_repro",z),onChangeDevice:z=>e.setFormValue("bug_device",z),onChangeWhere:z=>e.setFormValue("bug_where",z),onChangeVersion:z=>e.setFormValue("bug_version",z)}):null]}),leading:D||m?null:(0,ne.jsx)(lo.Box,{sx:{gridColumn:"1 / -1"},children:(0,ne.jsx)(Te,{icon:(0,ne.jsx)(Qf.default,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:z=>L(z),children:(N??[]).length>0?(0,ne.jsx)(Sn,{labelKeys:N??[],labelOptions:o}):(0,ne.jsx)(lo.Box,{component:"span",sx:{color:"#9a9a97"},children:"\uBE44\uC5B4 \uC788\uC74C"})})})}),(0,ne.jsx)(lo.Divider,{sx:{my:1.5,borderColor:"#e6e6e3"}}),(0,ne.jsx)(Dt,{icon:(0,ne.jsx)(Yf.default,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",children:(0,ne.jsx)(Mi,{syncKey:k,value:de,onChange:z=>e.setFormValue("content",z)})}),D?null:(0,ne.jsx)(lo.Divider,{sx:{my:1.5,borderColor:"#e6e6e3"}}),D?null:(0,ne.jsx)(Ri,{taskSeq:0,checklist:ge,onAdd:(z,_e)=>e.setFormValue("checklist",[...ge,{label:_e,checked:!1}]),onToggle:(z,_e,Ae)=>e.setFormValue("checklist",ge.map((so,po)=>po===_e?{...so,checked:Ae}:so)),onRemove:(z,_e)=>e.setFormValue("checklist",ge.filter((Ae,so)=>so!==_e)),onUpdate:(z,_e,Ae)=>e.setFormValue("checklist",ge.map((so,po)=>po===_e?{...so,label:Ae}:so))}),(0,ne.jsx)(lo.Divider,{sx:{my:1.5,borderColor:"#e6e6e3"}}),(0,ne.jsx)(Pi,{taskSeq:0,attachments:Pn.map(z=>({name:z.name,size:z.size})),onAdd:(z,_e)=>{let Ae=Ss(_e,E);Ae.message&&(0,Is.InfoAlert)(Ae.message),Ae.accepted.length!==0&&g.setValue("createAttachmentFiles",[...g.getValue("createAttachmentFiles")??[],...Ae.accepted])},onRemove:(z,_e)=>g.setValue("createAttachmentFiles",Pn.filter((Ae,so)=>so!==_e))}),R?null:(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(lo.Divider,{sx:{my:1.5,borderColor:"#e6e6e3"}}),(0,ne.jsx)(Dt,{icon:(0,ne.jsx)(Xf.default,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:(0,ne.jsx)(tx.TextField,{form:e,name:"note",placeholder:"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",sx:{mt:1}})})]})]}),(0,ne.jsx)(lo.Menu,{transitionDuration:0,anchorEl:We,open:!!We,onClose:()=>j(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...Oe.map(z=>({seq:z.seq,label:wt(z)}))].map(z=>(0,ne.jsx)(lo.MenuItem,{onClick:()=>{e.setFormValue("sprint_seq",z.seq),j(null)},sx:{fontSize:14,minWidth:170},children:z.label},z.seq))}),(0,ne.jsx)(lo.Menu,{transitionDuration:0,anchorEl:ko,open:!!ko,onClose:()=>$e(null),children:[{value:"",label:"\uC5C6\uC74C"},...Gr].map(z=>(0,ne.jsx)(lo.MenuItem,{selected:Ye===z.value,onClick:()=>{if($e(null),z.value===""){e.setFormValue("repeat_rule",""),e.setFormValue("repeat_until","");return}let _e;if(D){if(_e=String(e.getFormValue("due_date")??"").slice(0,10),!_e){(0,Is.InfoAlert)("\uBC18\uBCF5\uD558\uB824\uBA74 \uC77C\uC815 \uB0A0\uC9DC\uB97C \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694.");return}}else{if(_e=String(e.getFormValue("start_date")??"").slice(0,10),!_e){let Ae=new Date,so=po=>String(po).padStart(2,"0");_e=`${Ae.getFullYear()}-${so(Ae.getMonth()+1)}-${so(Ae.getDate())}`}e.setFormValue("due_date",""),e.setFormValue("reminder","none")}e.setFormValue("repeat_rule",z.value),e.setFormValue("repeat_until",Ii(_e,z.value))},sx:{fontSize:14,minWidth:140},children:z.label},z.value||"none"))}),(0,ne.jsx)(nx.DatePicker,{anchorEl:wo,open:!!wo,onClose:()=>J(null),selectedDate:_o?new Date(`${_o}T00:00:00`):new Date,onDateChange:z=>{let _e=Ae=>String(Ae).padStart(2,"0");e.setFormValue("repeat_until",`${z.getFullYear()}-${_e(z.getMonth()+1)}-${_e(z.getDate())}`),J(null)}}),(0,ne.jsx)(lo.Menu,{transitionDuration:0,anchorEl:X,open:!!X,onClose:()=>Ie(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:(0,ne.jsx)(Bs.default,{sx:{fontSize:17,color:"#57564f"}}),selected:$==="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:(0,ne.jsx)(Cs.default,{sx:{fontSize:17,color:"#2f80ed"}}),selected:$==="all",onPick:()=>{e.setFormValue("visibility","all"),e.setFormValue("visibility_group_seq",0)}},...[...p].sort((z,_e)=>z.seq===u?-1:_e.seq===u?1:0).map(z=>({key:`group-${z.seq}`,label:`\uBD80\uC11C\uACF5\uAC1C \xB7 ${z.name}`,tip:`${z.name} \uC18C\uC18D \uC9C1\uC6D0\uC774 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4`,icon:(0,ne.jsx)(vs.default,{sx:{fontSize:17,color:"#d9730d"}}),selected:$==="group"&&F===z.seq,onPick:()=>{e.setFormValue("visibility","group"),e.setFormValue("visibility_group_seq",z.seq)}}))].map(z=>(0,ne.jsx)(lo.Tooltip,{title:z.tip,arrow:!0,disableInteractive:!0,placement:"right",children:(0,ne.jsxs)(lo.MenuItem,{selected:z.selected,onClick:()=>{z.onPick(),Ie(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[z.icon,z.label]})},z.key))}),(0,ne.jsx)(qi,{anchorEl:le,selectedKeys:N??[],labelOptions:o,onToggle:z=>e.setFormValue("label_keys",ci(N??[],z)),onAddLabel:(z,_e)=>w?.(z,_e),onClose:()=>L(null)})]})}var He=require("react/jsx-runtime");function Lh({open:e,onClose:o,...t}){let{form:n,presetTitle:r="",presetContent:i="",presetVisibility:l,presetVisibilityGroupSeq:s=0,presetDueDate:f="",presetTabKey:m="",presetManager:c=null,isNotice:b=!1,defaultBug:p=!1}=t,u=nn(),d=(0,Jr.useRef)(!1),[_,w]=(0,Jr.useState)(0),k=n.useFormValue("title"),g=n.useFormValue("icon"),E=n.useFormValue("icon_color"),B=!!n.useFormValue("is_event"),P=!!n.useFormValue("is_bug"),S=Je(),R=u.useValue("createSubmitting")??!1,A=b||B?Me(g||(b?yo:Po)):null,C=b?"\uACF5\uC9C0 \uB4F1\uB85D":B?"\uC77C\uC815 \uB4F1\uB85D":P?"\uC624\uB958 \uB4F1\uB85D":"\uC5C5\uBB34 \uB4F1\uB85D",ie=b?"\uACF5\uC9C0 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":B?"\uC77C\uC815 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":P?"\uC5B4\uB5A4 \uC624\uB958\uC778\uC9C0 \uD55C \uC904\uB85C \uC801\uC5B4\uC8FC\uC138\uC694":"\uC5C5\uBB34 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694";(0,Jr.useEffect)(()=>{let x=d.current;d.current=e,!(!e||x)&&(n.setFormValues({...n.getFormValues(),title:r,icon:b?yo:p?_r:tn,icon_color:b?"#e5484d":p?wr:"",manager_name:c?.name??"",manager_account_seq:c?.accountSeq??0,receiver_names:[],receiver_account_seqs:[],is_notice:b,is_event:!1,is_bug:p,visibility:l??(p?"all":"involved"),visibility_group_seq:l==="group"?s:0,bug_repro:"",bug_device:"",bug_where:"",bug_version:"",event_time:"",event_place:"",event_address:"",target_names:[],target_account_seqs:[],start_date:"",due_date:f,reminder:"none",priority:"medium",note:"",content:i,checklist:[],tab_key:m}),u.setValue("createAttachmentFiles",[]),w(I=>I+1))},[e]);let h=(0,He.jsxs)(Co.Box,{sx:{display:"flex",alignItems:"center",gap:1,px:2,pt:2,pb:1},children:[A?(0,He.jsx)(Co.Box,{sx:{display:"flex",p:0,color:E||"#1e3a8a"},children:(0,He.jsx)(A,{sx:{fontSize:20}})}):null,(0,He.jsx)(Co.Box,{component:"input",autoFocus:!0,spellCheck:!1,value:k,placeholder:ie,onChange:x=>n.setFormValue("title",x.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}}})]});return S?(0,He.jsx)(He.Fragment,{children:(0,He.jsx)(ax.FormDialog,{open:e,onClose:o,locale:"ko",fontScale:{enabled:!0,default:1.1,min:.6},title:C,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1},custom:[{icon:(0,He.jsx)(Co.Button,{variant:"contained",size:"small",disableElevation:!0,disabled:R,onClick:R?void 0:n.submit,sx:{ml:2,minWidth:0,px:1.5,py:.35,fontSize:14,fontWeight:600,bgcolor:"#2f80ed","&:hover":{bgcolor:"#2f80ed"},"&.Mui-disabled":{bgcolor:"#e6e6e3",color:"#9a9a97"}},children:"\uC800\uC7A5"}),tooltip:R?"\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:(0,He.jsx)(Co.Box,{sx:{width:"100%",minWidth:0,display:"flex",flexDirection:"column",gap:0},children:(0,He.jsx)(Va,{...t,contentSyncKey:`create-${_}`,leadingRow:h})})}]})}):(0,He.jsx)(He.Fragment,{children:(0,He.jsx)(Co.Drawer,{anchor:"right",open:e,onClose:o,sx:{zIndex:x=>x.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:(0,He.jsxs)(Co.Box,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,He.jsxs)(Co.Box,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[A?(0,He.jsx)(Co.Box,{sx:{display:"flex",px:.5,color:E||"#1e3a8a"},children:(0,He.jsx)(A,{sx:{fontSize:20}})}):null,(0,He.jsx)(Co.Box,{component:"input",autoFocus:!0,spellCheck:!1,value:k,placeholder:ie,onChange:x=>n.setFormValue("title",x.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}}}),(0,He.jsx)(Co.IconButton,{"aria-label":"\uB2EB\uAE30",onClick:o,sx:{color:"#6b7280"},children:(0,He.jsx)(rx.default,{})})]}),(0,He.jsx)(Co.Divider,{sx:{borderColor:"#e6e6e3"}}),(0,He.jsx)(Co.Box,{sx:{flex:1,minHeight:0},children:(0,He.jsx)(ix.default,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:(0,He.jsx)(Va,{...t,contentSyncKey:`create-${_}`})})}),(0,He.jsx)(Co.Divider,{sx:{borderColor:"#e6e6e3"}}),(0,He.jsxs)(Co.Box,{sx:{display:"flex",justifyContent:"flex-end",gap:1,px:2,py:1.5,flexShrink:0},children:[(0,He.jsx)(Co.Button,{onClick:o,color:"inherit",disabled:R,children:"\uCDE8\uC18C"}),(0,He.jsx)(Co.Button,{onClick:n.submit,variant:"contained",disabled:R,children:R?"\uB4F1\uB85D \uC911\u2026":"\uB4F1\uB85D"})]})]})})})}var wn=require("react"),Ht=require("@mui/material"),Zx=a(require("@mui/icons-material/ShareOutlined"),1),Jx=a(require("@mui/icons-material/HistoryOutlined"),1),eg=a(require("@ehfuse/overlay-scrollbar"),1),og=require("@ehfuse/mui-form-dialog"),$s=require("@ehfuse/alerts");var Xt=require("react"),te=require("@mui/material"),Ds=a(require("@mui/icons-material/Send"),1),sx=require("@ehfuse/mui-form-controls"),Li=a(require("@mui/icons-material/Close"),1),cx=a(require("@mui/icons-material/EditOutlined"),1),mx=a(require("@mui/icons-material/Favorite"),1),ux=a(require("@mui/icons-material/FavoriteBorderOutlined"),1),dx=a(require("@mui/icons-material/CheckCircle"),1),px=a(require("@mui/icons-material/CheckCircleOutlineOutlined"),1),Tr=a(require("@mui/icons-material/AttachFileOutlined"),1),fx=a(require("@mui/icons-material/AddCircleOutline"),1),xx=a(require("@mui/icons-material/ImageOutlined"),1);var ws=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]};var H=require("react/jsx-runtime"),Nh=5;function lx({kind:e,reactions:o,myAccountSeq:t,onToggle:n}){let r=o??[],i=t>0&&r.some(m=>m.account_seq===t),l=e==="like"?"\uC88B\uC544\uC694":"\uD655\uC778",s=r.length===0?l:(0,H.jsx)(te.Box,{sx:{whiteSpace:"pre-line",fontSize:12},children:r.map(m=>`${m.name} \xB7 ${m.time}`).join(`
8
8
  `)}),f=e==="like"?"#e5484d":"#2f80ed";return(0,H.jsx)(te.Tooltip,{title:s,arrow:!0,enterDelay:300,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:(0,H.jsxs)(te.Box,{sx:{display:"inline-flex",alignItems:"center"},children:[(0,H.jsx)(te.IconButton,{size:"small","aria-label":`\uB313\uAE00 ${l}`,onClick:n,sx:{color:i?f:"#c9c8c5",p:.5},children:e==="like"?i?(0,H.jsx)(mx.default,{sx:{fontSize:16}}):(0,H.jsx)(ux.default,{sx:{fontSize:16}}):i?(0,H.jsx)(dx.default,{sx:{fontSize:16}}):(0,H.jsx)(px.default,{sx:{fontSize:16}})}),r.length>0?(0,H.jsx)(te.Box,{component:"span",sx:{fontSize:12,color:i?f:"#9a9a97",ml:-.25},children:r.length}):null]})})}function Es({taskSeq:e,comments:o,currentUserName:t="",myAccountSeq:n=0,avatarSrcByName:r,onUpdate:i,onRemove:l,onToggleReaction:s,onPreview:f,onDownload:m}){let[c,b]=(0,Xt.useState)(null),p=(0,Xt.useRef)(null),[u,d]=(0,Xt.useState)(null),[_,w]=(0,Xt.useState)(!1),k=Math.max(0,o.length-Nh),g=k>0&&!_,E=c?Math.min(c.index,k):k,B=o.map((A,C)=>({comment:A,index:C})).slice(g?E:0),P=vr(),S=A=>{if(f){f(A);return}window.open(P(A.uuid??""),"_blank","noopener,noreferrer")},D=A=>{if(m){m(A);return}window.open(P(A.uuid??"",{download:!0}),"_blank","noopener,noreferrer")},R=mt().slots?.avatar;return(0,H.jsxs)(te.Box,{sx:{px:2,pb:2,display:"flex",flexDirection:"column",gap:.25},children:[(0,H.jsxs)(te.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,H.jsx)(Bn,{sx:{fontSize:18,display:"block",color:"#37352f"}}),(0,H.jsxs)(te.Box,{sx:{fontSize:qa,fontWeight:500,color:"#37352f"},children:["\uB313\uAE00",o.length>0?` (${o.length})`:""]}),k>0&&(!g||E>0)?(0,H.jsx)(te.Box,{role:"button",tabIndex:0,onClick:()=>w(A=>!A),onKeyDown:A=>{(A.key==="Enter"||A.key===" ")&&(A.preventDefault(),w(C=>!C))},sx:{ml:"auto",flexShrink:0,cursor:"pointer",fontSize:14.5,color:"#5b87d6","&:hover":{textDecoration:"underline"}},children:g?`\uC774\uC804 \uB313\uAE00 ${E}\uAC1C \uB354 \uBCF4\uAE30`:"\uC774\uC804 \uB313\uAE00 \uC811\uAE30"}):null]}),o.length===0?(0,H.jsx)(te.Box,{sx:{mt:1,fontSize:14.5,color:"#9a9a97"},children:"\uB4F1\uB85D\uB41C \uB313\uAE00\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,(0,H.jsx)(te.Box,{sx:{display:"flex",flexDirection:"column",gap:1,mt:1},children:B.map(({comment:A,index:C})=>{let ie=!!t&&A.author===t;return(0,H.jsxs)(te.Box,{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 h=r?.get(A.author)??"";return R?(0,H.jsx)(te.Box,{sx:{display:"inline-flex",flexShrink:0},children:(0,H.jsx)(R,{name:A.author,src:h||void 0,size:44})}):(0,H.jsx)(te.Box,{sx:{display:"inline-flex",flexShrink:0},children:(0,H.jsx)(Pt,{src:h,avatarSx:{width:44,height:44,fontSize:20,borderRadius:"50%",...pr[0]},iconFontSize:24})})})(),(0,H.jsxs)(te.Box,{sx:{flex:1,minWidth:0},children:[(0,H.jsxs)(te.Box,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0,position:"relative"},children:[(0,H.jsx)(te.Box,{component:"span",sx:{fontSize:14.5,fontWeight:700,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:A.author}),(0,H.jsx)(te.Box,{component:"span",sx:{fontSize:12.5,color:"#9a9a97",flexShrink:0,whiteSpace:"nowrap"},children:A.time}),ie?(0,H.jsx)(te.Box,{sx:{ml:"auto"}}):(0,H.jsxs)(te.Box,{sx:{display:"flex",alignItems:"center",gap:.25,ml:"auto",flexShrink:0},children:[(0,H.jsx)(lx,{kind:"like",reactions:A.likes,myAccountSeq:n,onToggle:()=>s?.(e,C,"like")}),(0,H.jsx)(lx,{kind:"ack",reactions:A.acks,myAccountSeq:n,onToggle:()=>s?.(e,C,"ack")})]}),ie?(0,H.jsxs)(te.Box,{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:[(0,H.jsx)(te.IconButton,{size:"small","aria-label":"\uB313\uAE00 \uC218\uC815",onClick:()=>b({index:C,text:A.text,attachments:[...A.attachments??[]],files:[]}),sx:{color:"#9a9a97"},children:(0,H.jsx)(cx.default,{sx:{fontSize:15}})}),(0,H.jsx)(te.IconButton,{size:"small","aria-label":"\uB313\uAE00 \uC0AD\uC81C",onClick:h=>d({anchorEl:h.currentTarget,index:C}),sx:{color:"#9a9a97"},children:(0,H.jsx)(Li.default,{sx:{fontSize:15}})})]}):null]}),c?.index===C?(0,H.jsxs)(te.Box,{sx:{mt:.5},children:[(0,H.jsx)(te.Box,{component:"textarea",autoFocus:!0,spellCheck:!1,value:c.text,onChange:h=>b({...c,text:h.target.value}),sx:{width:"100%",minHeight:56,border:"1px solid #dedddb",borderRadius:1,outline:"none",font:"inherit",fontSize:14,p:1,resize:"vertical"}}),(0,H.jsxs)(te.Box,{sx:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:.75,mt:.75},children:[c.attachments.map((h,x)=>{let I=()=>b({...c,attachments:c.attachments.filter((T,y)=>y!==x)});return Ka(h.name)&&h.uuid?(0,H.jsxs)(te.Box,{sx:{position:"relative"},children:[(0,H.jsx)(te.Box,{component:"img",src:P(h.uuid,{thumb:"md"}),alt:h.name,title:h.name,loading:"lazy",sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",display:"block"}}),(0,H.jsx)(te.IconButton,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:I,sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:(0,H.jsx)(Li.default,{sx:{fontSize:14}})})]},`kept-${h.uuid}-${x}`):(0,H.jsx)(te.Chip,{size:"small",icon:(0,H.jsx)(Tr.default,{sx:{fontSize:14}}),label:h.name,onDelete:I,sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`kept-${h.uuid??h.name}-${x}`)}),c.files.map((h,x)=>{let I=()=>b({...c,files:c.files.filter((T,y)=>y!==x)});return Ka(h.name)?(0,H.jsxs)(te.Box,{sx:{position:"relative"},children:[(0,H.jsx)(te.Box,{component:"img",src:URL.createObjectURL(h),alt:h.name,title:`${h.name} (\uC0C8 \uD30C\uC77C)`,onLoad:T=>URL.revokeObjectURL(T.target.src),sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"2px solid #2f80ed",display:"block"}}),(0,H.jsx)(te.IconButton,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:I,sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:(0,H.jsx)(Li.default,{sx:{fontSize:14}})})]},`new-${h.name}-${x}`):(0,H.jsx)(te.Chip,{size:"small",icon:(0,H.jsx)(Tr.default,{sx:{fontSize:14}}),label:`${h.name} (\uC0C8 \uD30C\uC77C)`,onDelete:I,sx:{fontSize:14,height:26,bgcolor:"#eef4ff"}},`new-${h.name}-${x}`)}),(0,H.jsx)(te.Tooltip,{title:"\uCCA8\uBD80 \uCD94\uAC00",arrow:!0,children:(0,H.jsx)(te.IconButton,{size:"small","aria-label":"\uCCA8\uBD80 \uCD94\uAC00",onClick:()=>p.current?.click(),sx:{ml:"auto",color:"#2f80ed"},children:(0,H.jsx)(fx.default,{sx:{fontSize:20}})})})]}),(0,H.jsxs)(te.Box,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:.75,mt:.5},children:[(0,H.jsx)(te.Button,{size:"small",color:"inherit",onClick:()=>b(null),children:"\uCDE8\uC18C"}),(0,H.jsx)(te.Button,{size:"small",variant:"contained",disabled:!c.text.trim()&&c.attachments.length===0&&c.files.length===0,onClick:()=>{i(e,C,c.text,{attachments:c.attachments,files:c.files}),b(null)},children:"\uC800\uC7A5"})]}),(0,H.jsx)(te.Box,{component:"input",type:"file",multiple:!0,ref:p,sx:{display:"none"},onChange:h=>{let x=Array.from(h.target.files??[]);x.length>0&&b({...c,files:[...c.files,...x].slice(0,10)}),h.target.value=""}})]}):(0,H.jsxs)(te.Box,{children:[A.text?(0,H.jsx)(te.Box,{sx:{fontSize:15,whiteSpace:"pre-wrap"},children:A.text}):null,(A.attachments??[]).length>0?(0,H.jsx)(te.Box,{sx:{display:"flex",flexWrap:"wrap",gap:.75,mt:.75},children:(A.attachments??[]).map((h,x)=>{let I=!!h.uuid;if(Ka(h.name)&&I)return(0,H.jsx)(te.Box,{component:"img",src:P(h.uuid??"",{thumb:"md"}),alt:h.name,title:`${h.name} \uD06C\uAC8C \uBCF4\uAE30`,loading:"lazy",onClick:()=>S(h),sx:{width:96,height:96,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",cursor:"pointer",bgcolor:"#f8fafc"}},`${h.name}-${x}`);let y=Na(h.name);return(0,H.jsx)(te.Chip,{size:"small",icon:(0,H.jsx)(Tr.default,{sx:{fontSize:14}}),label:`${h.name} (${ws(h.size)})`,clickable:I,onClick:I?()=>y?S(h):D(h):void 0,title:I?`${h.name} ${y?"\uBBF8\uB9AC\uBCF4\uAE30":"\uB2E4\uC6B4\uB85C\uB4DC"}`:h.name,sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`${h.name}-${x}`)})}):null]})]})]},`${A.time}-${C}`)})}),(0,H.jsx)(eo,{open:!!u,anchorEl:u?.anchorEl??null,title:"\uC774 \uB313\uAE00\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uC0AD\uC81C",onCancel:()=>d(null),onConfirm:()=>{u&&(l(e,u.index),b(null)),d(null)}})]})}function Ka(e){return/\.(png|jpe?g|gif|webp|bmp|svg|heic|heif)$/i.test(String(e??"").trim())}function Ms({onSubmit:e}){let[o,t]=(0,Xt.useState)(""),[n,r]=(0,Xt.useState)([]),[i,l]=(0,Xt.useState)(!1),s=(0,Xt.useRef)(null),f=(0,Xt.useRef)(null),m=Je(),c=u=>{let d=Array.from(u??[]);d.length!==0&&r(_=>[..._,...d].slice(0,10))},b=()=>{let u=o.trim();!u&&n.length===0||(e(u,n.length>0?n:void 0),t(""),r([]))},p=(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(te.IconButton,{size:"small","aria-label":"\uD30C\uC77C \uCCA8\uBD80",onClick:()=>s.current?.click(),sx:{color:"#9a9a97"},children:(0,H.jsx)(Tr.default,{sx:{fontSize:20}})}),(0,H.jsx)(te.IconButton,{size:"small","aria-label":"\uC774\uBBF8\uC9C0 \uCCA8\uBD80",onClick:()=>f.current?.click(),sx:{color:"#9a9a97"},children:(0,H.jsx)(xx.default,{sx:{fontSize:20}})})]});return(0,H.jsxs)(te.Box,{children:[n.length>0?(0,H.jsx)(te.Box,{sx:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:.75,px:2,pt:1},children:n.map((u,d)=>Ka(u.name)?(0,H.jsxs)(te.Box,{sx:{position:"relative"},children:[(0,H.jsx)(te.Box,{component:"img",src:URL.createObjectURL(u),alt:u.name,title:u.name,onLoad:_=>URL.revokeObjectURL(_.target.src),sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",display:"block"}}),(0,H.jsx)(te.IconButton,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:()=>r(_=>_.filter((w,k)=>k!==d)),sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:(0,H.jsx)(Li.default,{sx:{fontSize:14}})})]},`${u.name}-${d}`):(0,H.jsx)(te.Chip,{size:"small",icon:(0,H.jsx)(Tr.default,{sx:{fontSize:14}}),label:`${u.name} (${ws(u.size)})`,onDelete:()=>r(_=>_.filter((w,k)=>k!==d)),sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`${u.name}-${d}`))}):null,(0,H.jsxs)(te.Box,{sx:{position:"relative",display:"flex"},onDragOver:u=>{Array.from(u.dataTransfer?.types??[]).includes("Files")&&(u.preventDefault(),l(!0))},onDragLeave:u=>{u.currentTarget.contains(u.relatedTarget)||l(!1)},onDrop:u=>{Array.from(u.dataTransfer?.types??[]).includes("Files")&&(u.preventDefault(),l(!1),c(u.dataTransfer?.files??null))},children:[i?(0,H.jsxs)(te.Box,{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:[(0,H.jsx)(Tr.default,{sx:{fontSize:18}}),"\uC5EC\uAE30\uC5D0 \uB193\uC73C\uBA74 \uCCA8\uBD80\uB429\uB2C8\uB2E4"]}):null,(0,H.jsx)(sx.TextField,{value:o,placeholder:"\uB313\uAE00\uC744 \uC785\uB825\uD558\uC138\uC694",onChange:u=>t(u.target.value),fullWidth:!0,multiline:!0,minRows:m?1:3,maxRows:3,sx:{"& .MuiInputBase-root":{pl:2,pr:m?15:6.5,pb:m?void 0:5,borderRadius:0},"& .MuiOutlinedInput-notchedOutline":{border:"none"}}}),m?(0,H.jsxs)(te.Box,{sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",gap:.25},children:[p,(0,H.jsx)(te.IconButton,{"aria-label":"\uB313\uAE00 \uB4F1\uB85D",disabled:!o.trim()&&n.length===0,onClick:b,sx:{color:"#2563eb","&.Mui-disabled":{color:"#c9c8c5"}},children:(0,H.jsx)(Ds.default,{sx:{fontSize:22}})})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(te.Box,{sx:{position:"absolute",left:8,bottom:6,display:"flex",alignItems:"center",gap:.25},children:p}),(0,H.jsx)(te.IconButton,{"aria-label":"\uB313\uAE00 \uB4F1\uB85D",disabled:!o.trim()&&n.length===0,onClick:b,sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",color:"#2563eb","&.Mui-disabled":{color:"#c9c8c5"}},children:(0,H.jsx)(Ds.default,{sx:{fontSize:22}})})]})]}),(0,H.jsx)(te.Box,{component:"input",ref:s,type:"file",multiple:!0,onChange:u=>{c(u.target.files),u.target.value=""},sx:{display:"none"}}),(0,H.jsx)(te.Box,{component:"input",ref:f,type:"file",accept:"image/*",multiple:!0,onChange:u=>{c(u.target.files),u.target.value=""},sx:{display:"none"}})]})}var Ga=require("react"),Ho=require("@mui/material"),Bx=a(require("@mui/icons-material/Close"),1),Cx=a(require("@mui/icons-material/ArrowBack"),1),vx=a(require("@mui/icons-material/ShareOutlined"),1),Ix=a(require("@mui/icons-material/ContentCopyOutlined"),1),_x=a(require("@mui/icons-material/HistoryOutlined"),1),wx=a(require("@mui/icons-material/Print"),1);var bx=require("react"),yt=require("@mui/material"),hx=require("@ehfuse/mui-form-dialog"),kx=require("@ehfuse/overlay-scrollbar");var lt=require("react/jsx-runtime"),Fh={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 gx(e){return String(e??"").trim()||"\uC5C6\uC74C"}function Hh(e){if(e.kind!=="field")return Fh[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) "${gx(t)}" \u2192 "${gx(n)}" \uB85C \uBC14\uAFE8\uC2B5\uB2C8\uB2E4`}function Ni({open:e,taskSeq:o,items:t,loading:n,onLoad:r,onClose:i}){let l=Je();(0,bx.useEffect)(()=>{e&&o>0&&!t&&r?.(o)},[e,o,t,r]);let s=(0,lt.jsx)(yt.Box,{sx:{height:l?"100%":420,minHeight:0},children:(0,lt.jsx)(kx.OverlayScrollbar,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:(0,lt.jsxs)(yt.Box,{sx:{px:2,pt:2,display:"flex",flexDirection:"column",gap:1,"&::after":{content:'""',flexShrink:0,height:16}},children:[n&&!t?(0,lt.jsxs)(yt.Box,{sx:{display:"flex",alignItems:"center",gap:1,color:"#9a9a97",fontSize:14.5},children:[(0,lt.jsx)(yt.CircularProgress,{size:14,thickness:5,sx:{color:"#9a9a97"}}),"\uBD88\uB7EC\uC624\uB294 \uC911\u2026"]}):null,t&&t.length===0?(0,lt.jsx)(yt.Box,{sx:{fontSize:14.5,color:"#9a9a97"},children:"\uAE30\uB85D\uB41C \uD65C\uB3D9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,(t??[]).map(f=>(0,lt.jsxs)(yt.Box,{sx:{display:"flex",flexDirection:l?"column":"row",gap:l?.25:1,alignItems:l?"stretch":"baseline",minWidth:0,flexShrink:0,...l?{pb:1,borderBottom:"1px solid #ededeb","&:last-of-type":{borderBottom:"none",pb:0}}:{}},children:[(0,lt.jsx)(yt.Box,{sx:{flexShrink:0,...l?{}:{width:"10.5em"},whiteSpace:"nowrap",fontSize:13.5,color:"#9a9a97",lineHeight:1.5},children:pt(f.acted_time)}),(0,lt.jsxs)(yt.Box,{sx:{minWidth:0,fontSize:14.5,color:"#37352f",lineHeight:1.5},children:[(0,lt.jsx)(yt.Box,{component:"span",sx:{fontWeight:500},children:String(f.actor_name??"").trim()||"\uC774\uB984\uC5C6\uC74C"}),(0,lt.jsx)(yt.Box,{component:"span",sx:{ml:.5},children:Hh(f)})]})]},f.seq))]})})});return(0,lt.jsx)(hx.FormDialog,{open:e,onClose:i,maxWidth:"sm",fullScreen:l,mobilePresentation:l?"slide":"dialog",contentPaddingX:0,contentTopPadding:0,contentBottomPadding:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,sx:l?{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:s}],scrollPastLastSection:!1,actions:{showCancelButton:!1,right:(0,lt.jsx)(yt.Button,{variant:"contained",onClick:i,children:"\uB2EB\uAE30"})}})}var Ua=require("@ehfuse/alerts");var Tx=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,`