@ehfuse/taskbox 0.10.33 → 0.10.34
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 +1 -1
- package/dist/index.esm.js.map +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -7,7 +7,7 @@ import{a as va,b as op,c as Yc,d as w2,e as D2,f as R2,g as E2,h as P2}from"./ch
|
|
|
7
7
|
`).replace(/<\/(p|div|li|h[1-6]|blockquote)>/gi,`
|
|
8
8
|
`),o=document.createElement("div");return o.innerHTML=t,(o.textContent??"").replace(/\n{3,}/g,`
|
|
9
9
|
|
|
10
|
-
`).trim()}var q1={...Ug,left:(Ug.left??[]).flatMap(e=>e.includes("indent")?[["bulletList","numberList"],e]:[e])};function js({syncKey:e,value:t,onChange:o,readOnly:r=!1,viewFirst:n=!1,onTranslate:i,minHeight:a=180,editing:l,onEditingChange:s}){let{uploadContentImage:m,openExternalUrl:c}=le(),u=D=>{c?c(D):window.open(D,"_blank","noopener,noreferrer")},[f,d]=Hg(()=>!n||!bi(t).trim()),p=l!==void 0,x=p?l:f,g=xi(s);g.current=s;let w=D=>{p||d(D),g.current?.(D)};$g(()=>{n&&w(!bi(t).trim())},[e,n]);let b=xi(null),I=xi(new A1),k=xi(null),L=xi(Date.now()+800),B=Fe(),v=E1(),_=R1(v.breakpoints.down("sm")),[H,P]=Hg(!1),T=()=>{let D=bi(t);D&&navigator.clipboard.writeText(D).then(()=>{P(!0),window.setTimeout(()=>P(!1),1500)})},h=(D,S=!1)=>D instanceof Element?D.closest(S?".taskbox-content-readview a[href]":".ehfuse-editor-content a[href]"):null,y=D=>B||D.ctrlKey||D.metaKey;$g(()=>{if(r)return;let D=Uu(t);k.current===D||k.current===t||(k.current=D,L.current=Date.now()+800,b.current?.setHtml(D))},[e,t,r]);let C=Uu(t),R=xi(null),z=xi({el:null,html:""});return D1(()=>{let D=R.current;D&&(z.current.el===D&&z.current.html===C||(D.innerHTML=C,z.current={el:D,html:C}))}),r||!x?Ys(el,{sx:{position:"relative",mt:1},children:[no(el,{onClickCapture:D=>{let S=h(D.target,!0);S&&(D.preventDefault(),D.stopPropagation(),u(S.href))},ref:R,className:"taskbox-content-readview","data-drag-scroll":"off",sx:{border:"1px solid #e0e0e0",borderRadius:1,p:"12px",pr:_?"12px":"52px",pb:"28px",minHeight:a,fontSize:16,lineHeight:1.6,color:"#37352f",wordBreak:"break-word",userSelect:"text","& > p:first-of-type":{mt:0},"& > p:last-of-type":{mb:0},"& a[href]":{color:"#2563eb",textDecoration:"underline",cursor:"pointer"},"& img":{maxWidth:"100%"},"& ul, & ol":{pl:"1.5em",my:.5},"& ul":{listStyleType:"disc"},"& ol":{listStyleType:"decimal"},"& li > p":{my:0}}}),_?Ys(el,{sx:{display:"flex",gap:1,mt:1},children:[no(Hu,{variant:"outlined",color:"inherit",startIcon:no(M1,{sx:{fontSize:18}}),onClick:T,sx:{flex:1,fontSize:15,color:"#37352f",borderColor:"#d9d9d6"},children:H?"\uBCF5\uC0AC\uB428":"\uBCF5\uC0AC"}),r?null:no(Hu,{variant:"outlined",color:"inherit",startIcon:no(Wg,{sx:{fontSize:18}}),onClick:()=>w(!0),sx:{flex:1,fontSize:15,color:"#37352f",borderColor:"#d9d9d6"},children:"\uC218\uC815"}),i?no(Hu,{variant:"outlined",color:"inherit",startIcon:no(Vg,{sx:{fontSize:18}}),onClick:i,sx:{flex:1,fontSize:15,color:"#37352f",borderColor:"#d9d9d6"},children:"\uBC88\uC5ED"}):null]}):Ys(el,{sx:{position:"absolute",top:6,right:6,display:"flex",flexDirection:"column",gap:.25},children:[r?null:no(Vu,{title:"\uB0B4\uC6A9 \uC218\uC815",arrow:!0,placement:"left",children:no(Wu,{size:"small","aria-label":"\uB0B4\uC6A9 \uC218\uC815",onClick:()=>w(!0),sx:{color:"#9a9a97"},children:no(Wg,{sx:{fontSize:17}})})}),i?no(Vu,{title:"\uBC88\uC5ED",arrow:!0,placement:"left",children:no(Wu,{size:"small","aria-label":"\uBC88\uC5ED",onClick:i,sx:{color:"#9a9a97"},children:no(Vg,{sx:{fontSize:17}})})}):null]})]}):Ys(el,{onDragOver:D=>D.stopPropagation(),onDrop:D=>D.stopPropagation(),onMouseDownCapture:D=>{y(D)&&h(D.target)&&D.preventDefault()},onClickCapture:D=>{let S=y(D)?h(D.target):null;S&&(D.preventDefault(),D.stopPropagation(),u(S.href))},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"},...B?{"& .ehfuse-editor-content a[href]":{cursor:"pointer"}}:{},position:"relative"},children:[n&&!p?no(Vu,{title:"\uD3B8\uC9D1 \uB05D(\uC77D\uAE30 \uBAA8\uB4DC)",arrow:!0,children:no(Wu,{size:"small","aria-label":"\uD3B8\uC9D1 \uB05D",onMouseDown:D=>D.preventDefault(),onClick:()=>w(!1),sx:{position:"absolute",top:4,right:6,zIndex:2,color:"#2f9e5b"},children:no(P1,{sx:{fontSize:19}})})}):null,no(O1,{ref:b,defaultValue:Uu(t),autoHeight:!0,showToolbar:!B,focusBorder:!0,styles:{focusBorderColor:"var(--primary)"},toolbarOptions:q1,plugins:[I.current],locale:"ko",minHeight:a,placeholder:"\uB0B4\uC6A9\uC744 \uC785\uB825\uD558\uC138\uC694",onImageUpload:m,contentStyle:{padding:"12px"},onChange:D=>{let S=Date.now()<L.current,F=D===k.current;k.current=D,!(S||F)&&o(D)}})]})}import{Fragment as K1,jsx as vo,jsxs as Qs}from"react/jsx-runtime";function Yu(e){return String(e??"").replace(/<[^>]*>/g,"").replace(/ /g," ").trim().length>0}function Zs({content:e,templates:t,onApply:o,onSave:r,onRemove:n,readOnly:i=!1}){let[a,l]=Ku(null),[s,m]=Ku(!1),[c,u]=Ku(""),f=async p=>{l(null),!(Yu(e)&&!await $1({title:"\uC591\uC2DD \uBD88\uB7EC\uC624\uAE30",message:`\uC9C0\uAE08 \uC4F4 \uB0B4\uC6A9\uC744 "${p.name}" \uC591\uC2DD\uC73C\uB85C \uBC14\uAFC9\uB2C8\uB2E4. \uACC4\uC18D\uD560\uAE4C\uC694?`}))&&o(p.content)},d=()=>{l(null);let p=bi(e);p&&navigator.clipboard.writeText(p).then(()=>W1("\uB0B4\uC6A9\uC744 \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>H1("\uB0B4\uC6A9\uC744 \uBCF5\uC0AC\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))};return Qs(K1,{children:[vo(F1,{title:"\uB0B4\uC6A9 \uBA54\uB274",arrow:!0,disableInteractive:!0,children:vo(Gg,{size:"small","aria-label":"\uB0B4\uC6A9 \uBA54\uB274",onClick:p=>l(p.currentTarget),sx:{ml:"auto",color:"#9a9a97"},children:vo(N1,{sx:{fontSize:18}})})}),Qs(L1,{anchorEl:a,open:!!a,onClose:()=>l(null),transitionDuration:0,children:[vo(Xs,{disabled:!Yu(e),onClick:d,sx:{fontSize:14,minWidth:220},children:"\uB0B4\uC6A9 \uBCF5\uC0AC"}),i?null:vo(Kg,{sx:{my:.5}}),!i&&r?vo(Xs,{disabled:!Yu(e),onClick:()=>{l(null),u(""),m(!0)},sx:{fontSize:14,minWidth:220},children:"\uD604\uC7AC \uB0B4\uC6A9\uC744 \uC591\uC2DD\uC73C\uB85C \uC800\uC7A5"}):null,!i&&r?vo(Kg,{sx:{my:.5}}):null,i?null:t.length===0?vo(Xs,{disabled:!0,sx:{fontSize:14,minWidth:220},children:"\uC800\uC7A5\uB41C \uC591\uC2DD\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"}):t.map(p=>Qs(Xs,{onClick:()=>{f(p)},sx:{fontSize:14,minWidth:220,gap:1},children:[vo(Gu,{sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p.name}),n?vo(Gg,{size:"small","aria-label":`${p.name} \uC591\uC2DD \uC0AD\uC81C`,onClick:x=>{x.stopPropagation(),n(p.seq)},sx:{color:"#9a9a97"},children:vo(Kt,{sx:{fontSize:16}})}):null]},p.seq))]}),vo(V1,{open:s,onClose:()=>m(!1),maxWidth:"xs",title:"\uC591\uC2DD\uC73C\uB85C \uC800\uC7A5",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},tabs:{visible:!1},actions:{showCancelButton:!0,right:vo(z1,{variant:"contained",disabled:!c.trim(),onClick:()=>{r?.(c.trim(),e),m(!1)},children:"\uC800\uC7A5"})},sections:[{id:"template-name",title:"",showTitle:!1,children:Qs(Gu,{sx:{display:"flex",flexDirection:"column",gap:1},children:[vo(Gu,{sx:{fontSize:15,color:"#37352f"},children:"\uC9C0\uAE08 \uB0B4\uC6A9\uC744 \uC591\uC2DD\uC73C\uB85C \uC800\uC7A5\uD569\uB2C8\uB2E4. \uB2E4\uC74C\uBD80\uD130 \uC774 \uC774\uB984\uC73C\uB85C \uAEBC\uB0B4 \uC4F8 \uC218 \uC788\uC2B5\uB2C8\uB2E4."}),vo(U1,{size:"medium",fullWidth:!0,autoFocus:!0,placeholder:"\uC591\uC2DD \uC774\uB984 (\uC608: \uC624\uB958 \uC2E0\uACE0 \uC11C\uC2DD)",value:c,onChange:p=>u(p.target.value)})]})}]})]})}import{useState as ol}from"react";import{Box as zt,Button as Xg,Dialog as aw,IconButton as Xi,Switch as lw,TextField as sw,Tooltip as ju}from"@mui/material";import{DndContext as cw,PointerSensor as mw,closestCenter as uw,useSensor as dw,useSensors as pw}from"@dnd-kit/core";import{restrictToParentElement as fw,restrictToVerticalAxis as gw}from"@dnd-kit/modifiers";import{SortableContext as xw,arrayMove as bw,useSortable as hw,verticalListSortingStrategy as kw}from"@dnd-kit/sortable";import{CSS as Tw}from"@dnd-kit/utilities";import Qg from"@mui/icons-material/Close";import yw from"@mui/icons-material/AddCircle";import Zg from"@mui/icons-material/AddTask";import Sw from"@mui/icons-material/Checklist";import Cw from"@mui/icons-material/CheckCircle";import Bw from"@mui/icons-material/DragIndicator";import vw from"@mui/icons-material/Launch";import _w from"@mui/icons-material/LinkOutlined";import Iw from"@mui/icons-material/RadioButtonUnchecked";import{useMemo as Q1}from"react";import{Box as Nn,Button as Z1,Tab as J1,Tabs as ew}from"@mui/material";import{FormDialog as tw}from"@ehfuse/mui-form-dialog";import{ClearTextField as ow}from"@ehfuse/mui-form-controls";import nw from"@mui/icons-material/CheckCircle";import rw from"@mui/icons-material/RadioButtonUnchecked";import{OverlayScrollbar as iw}from"@ehfuse/overlay-scrollbar";import{useRef as G1}from"react";import{useGlobalForm as Y1,useModal as j1}from"@ehfuse/forma";import{ErrorAlert as X1}from"@ehfuse/alerts";var Yg={type:"related",search:"",selectedSeqs:[]};function tl(e){let t=G1(e);t.current=e;let o={link:j1({modalId:Ce("taskbox-task-link")})},r=Y1({formId:Ce("taskbox-task-link-form"),initialValues:Yg,onValidate:a=>a.selectedSeqs.length===0?(X1("\uC5F0\uACB0\uD560 \uC5C5\uBB34\uB97C \uC120\uD0DD\uD558\uC138\uC694."),!1):!0,onSubmit:a=>{for(let l of a.selectedSeqs)t.current.onSubmit(l,a.type);return o.link.close(),!0}});return{form:r,modals:o,openDialog:()=>{r.setFormValues({...Yg,selectedSeqs:[]}),o.link.open()},toggleSelected:a=>{let l=r.getFormValue("selectedSeqs")??[];if(l.includes(a)){r.setFormValue("selectedSeqs",l.filter(s=>s!==a));return}r.setFormValue("selectedSeqs",t.current.multiSelect?[...l,a]:[a])}}}import{jsx as po,jsxs as Js}from"react/jsx-runtime";var jg=[{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 ec({controller:e,task:t,tasks:o,excludeSeqs:r=[],hideRelationType:n=!1,title:i="\uAD00\uB828 \uC5C5\uBB34 \uC5F0\uACB0",confirmLabel:a="\uC5F0\uACB0"}){let l=Fe(),{form:s}=e,m=e.modals.link,c=s.useValue("type")??"related",u=String(s.useValue("search")??""),f=s.useValue("selectedSeqs")??[],d=Q1(()=>{let g=new Set([t.seq,...r]),w=u.trim().toLowerCase();return o.filter(b=>g.has(b.seq)||b.is_event||b.is_notice||b.linked_only?!1:w?b.title.toLowerCase().includes(w)||(b.ticket_no??"").toLowerCase().includes(w):!0).sort((b,I)=>!!b.completed!=!!I.completed?b.completed?1:-1:I.seq-b.seq)},[o,t.seq,r,u]),p=jg.find(g=>g.type===c)?.hint??"",x=Js(Nn,{sx:{display:"flex",flexDirection:"column",minHeight:0,height:l?"100%":"auto"},children:[n?null:po(ew,{value:c,onChange:(g,w)=>s.setFormValue("type",w),sx:{minHeight:38,flexShrink:0,borderBottom:"1px solid #ededeb","& .MuiTab-root":{minHeight:38,py:.5,fontSize:16,color:"#333333"}},children:jg.map(g=>po(J1,{value:g.type,label:g.label},g.type))}),n?null:po(Nn,{sx:{mt:1,mb:1.5,fontSize:14,flexShrink:0},children:p}),Js(Nn,{sx:{...l?{height:"100%",minHeight:0}:{height:560},display:"flex",flexDirection:"column",...l?{}:{border:"1px solid #cccccc",borderRadius:1},overflow:"hidden",userSelect:"none"},children:[po(Nn,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:po(ow,{placeholder:"\uC81C\uBAA9\xB7\uD2F0\uCF13\uBC88\uD638\uB85C \uAC80\uC0C9",name:"search",form:s,fullWidth:!0,autoFocus:!0,size:"small",sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),po(Nn,{sx:{flex:1,minHeight:0},children:po(iw,{style:{height:"100%"},contentStyle:{paddingTop:0},children:po(Nn,{sx:{display:"flex",flexDirection:"column"},children:d.length===0?po(Nn,{sx:{py:4,textAlign:"center",fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uD560 \uC218 \uC788\uB294 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):d.map(g=>{let w=g.is_notice||g.is_event?Re(g.icon||(g.is_notice?Tt:Ot)):null,b=f.includes(g.seq);return Js(Nn,{onClick:()=>e.toggleSelected(g.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:b?"#e3eefb":"transparent","&:hover":{bgcolor:b?"#e3eefb":"#f7f7f5"}},children:[b?po(nw,{sx:{fontSize:20,flexShrink:0,color:"#2f6fd0"}}):po(rw,{sx:{fontSize:20,flexShrink:0,color:"#c9c8c5"}}),w?po(w,{sx:{fontSize:17,flexShrink:0,color:g.icon_color||"#1e3a8a"}}):null,Js(Nn,{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:[g.ticket_no?`${g.ticket_no} `:"",g.title]}),po(Nn,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:po($e,{option:At(g)})})]},g.seq)})})})})]})]});return po(tw,{open:m.isOpen,onClose:m.close,maxWidth:"sm",fullScreen:l,mobilePresentation:l?"slide":"dialog",...l?{contentPaddingX:0,contentTopPadding:0,sectionsPaddingTop: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:i,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-task-link",sections:[{id:"task-link",showTitle:!1,children:x}],scrollPastLastSection:!1,sectionContentPaddingTop:0,contentTopPadding:12,actions:{showCancelButton:!0,right:po(Z1,{variant:"contained",disabled:f.length===0,onClick:()=>{s.submit()},children:a})}})}import{ConfirmActionPopper as ww}from"@ehfuse/mui-confirm-action";import{Fragment as Ew,jsx as ye,jsxs as $n}from"react/jsx-runtime";var Jg="taskbox.checklist.hideCompleted";function Dw({id:e,children:t}){let{attributes:o,listeners:r,setNodeRef:n,transform:i,transition:a,isDragging:l}=hw({id:e});return ye(zt,{ref:n,sx:{transform:Tw.Transform.toString(i),transition:a,...l?{opacity:.6,position:"relative",zIndex:1}:{}},children:t({handleProps:{...o,...r},dragging:l})})}function Rw({sortable:e,sensors:t,rowIds:o,onDragEnd:r,compact:n,children:i}){let a=ye(zt,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:n?0:3.25},children:i});return e?ye(cw,{sensors:t,collisionDetection:uw,modifiers:[gw,fw],onDragEnd:r,children:ye(xw,{items:o,strategy:kw,children:a})}):a}function tc({taskSeq:e,checklist:t,onAdd:o,onToggle:r,confirmOnToggle:n=!1,onRemove:i,onUpdate:a,onReorder:l,removeLocked:s=!1,onConvertToTask:m,onOpenLinkedTask:c,linkCandidates:u,linkBaseTask:f,onLinkExistingTask:d,resolveLinkedTask:p,myAccountSeq:x=0}){let[g,w]=ol(""),b=tl({multiSelect:!0,onSubmit:W=>{if(!d)return;let Z=u?.find(M=>M.seq===W);d(e,W,String(Z?.title??"").trim())}}),[I,k]=ol(null),L=Fe(),[B,v]=ol(null),[_,H]=ol(null),P=W=>{let Z=W.task_seq?p?.(W.task_seq):void 0;return Z?Z.completed:W.checked},T=W=>{if(!W.task_seq||x<=0)return!1;let Z=p?.(W.task_seq);return Z?!df(Z,x):!1},h=W=>!!W.task_seq&&!!p&&!p?.(W.task_seq),y=t.filter(W=>!h(W)),C=y.filter(P).length,[R,z]=ol(()=>{try{return localStorage.getItem(Jg)==="1"}catch{return!1}}),D=W=>{z(W);try{localStorage.setItem(Jg,W?"1":"0")}catch{}},S=!!l&&!L&&!s,F=pw(dw(mw,{activationConstraint:{distance:5}})),Q=(W,Z)=>W.task_seq?`linked-${W.task_seq}`:`row-${Z}`,X=t.map(Q),ae=X.filter((W,Z)=>{let M=t[Z];return h(M)?!1:!(R&&P(M))}),oe=W=>{let{active:Z,over:M}=W;if(!M||Z.id===M.id)return;let U=X.indexOf(String(Z.id)),xe=X.indexOf(String(M.id));U<0||xe<0||l?.(e,bw(t,U,xe))},Be=()=>{g.trim()&&(o(e,g),w(""))};return $n(Oo,{icon:ye(Sw,{sx:{fontSize:19,display:"block"}}),title:$n(Ew,{children:["\uD560\uC77C",t.length>0?$n(zt,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:[C," / ",t.length]}):null]}),titleExtra:y.length>0?$n(zt,{sx:{flex:1,minWidth:0,ml:1,display:"flex",alignItems:"center",gap:1},children:[ye(zt,{sx:{flex:1,minWidth:0,height:6,borderRadius:3,bgcolor:"#ececea"},children:ye(zt,{sx:{height:"100%",borderRadius:3,width:`${Math.round(C/y.length*100)}%`,bgcolor:"#2f80ed",transition:"width 0.2s"}})}),C>0?$n(zt,{component:"label",sx:{display:"inline-flex",alignItems:"center",gap:.25,flexShrink:0,cursor:"pointer",fontSize:13.5,fontWeight:400,color:"#57564f",userSelect:"none"},children:[ye(lw,{size:"small",checked:R,onChange:(W,Z)=>D(Z)}),"\uC644\uB8CC\uC228\uAE40"]}):null]}):null,children:[ye(Rw,{sortable:S,sensors:F,rowIds:ae,onDragEnd:oe,compact:L,children:t.map((W,Z)=>{let M=W.task_seq?p?.(W.task_seq):void 0,U=P(W);if(R&&U||h(W))return null;let xe=!!W.task_seq,we=T(W),Ze=ne=>$n(zt,{sx:{display:"flex",alignItems:L?"flex-start":"center",gap:1,px:1.25,...S?{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:[ne?ye(zt,{className:"taskbox-checklist-handle",...ne,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:ye(Bw,{sx:{fontSize:16}})}):null,ye(ju,{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:ye(zt,{component:"span",onClick:we?void 0:K=>n?H({anchorEl:K.currentTarget,index:Z,checked:!U}):r(e,Z,!U),sx:{display:"inline-flex",flexShrink:0,cursor:we?"default":"pointer",...L?{mt:"1px"}:{}},children:U?ye(Cw,{sx:{fontSize:18,color:we?"#a9c6ec":"#2f80ed"}}):ye(Iw,{sx:{fontSize:18,color:we?"#d6d5d1":"#9a9a97"}})})}),I?.index===Z?ye(zt,{component:"input",autoFocus:!0,spellCheck:!1,value:I.label,enterKeyHint:"done",onChange:K=>k({index:Z,label:K.target.value}),onBlur:()=>{I.label.trim()&&I.label.trim()!==W.label&&a?.(e,Z,I.label),k(null)},onKeyDown:K=>{K.key==="Enter"&&K.target.blur(),K.key==="Escape"&&k(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",p:0}}):ye(zt,{component:"span",onClick:xe?W.task_seq&&c?()=>c(W.task_seq):void 0:s||!a?void 0:L?()=>v({index:Z,label:W.label}):()=>k({index:Z,label:W.label}),sx:{flex:1,minWidth:0,fontSize:14.5,color:"#37352f",textDecoration:U?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",...L?{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:3,lineHeight:1.4,wordBreak:"break-word"}:{whiteSpace:"nowrap"},...xe?c?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}:s||!a?{}:{cursor:"text"}},children:W.label}),xe?$n(zt,{component:"span",onClick:W.task_seq&&c?()=>c(W.task_seq):void 0,sx:{display:"inline-flex",alignItems:"center",gap:.4,flexShrink:0,...L?{mt:"1px"}:{},px:.75,py:.2,borderRadius:1,fontSize:12,fontWeight:500,color:"#1d4f91",bgcolor:"#e3eefb",whiteSpace:"nowrap",...c?{cursor:"pointer"}:{}},children:[ye(vw,{sx:{fontSize:12}}),M?.manager_name?.trim()||"\uC5C5\uBB34"]}):null,!s&&!xe&&m?ye(ju,{title:"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",arrow:!0,enterDelay:300,disableInteractive:!0,children:ye(Xi,{className:"taskbox-checklist-convert",size:"small","aria-label":"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",onClick:()=>m(e,Z,W.label),sx:{display:L?"none":"inline-flex",opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:ye(Zg,{sx:{fontSize:16}})})}):null,s?null:ye(Xi,{className:"taskbox-checklist-remove",size:"small","aria-label":"\uD560\uC77C \uC0AD\uC81C",onClick:()=>i(e,Z),sx:{display:L?"none":"inline-flex",opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:ye(Qg,{sx:{fontSize:15}})})]});return S?ye(Dw,{id:X[Z],children:({handleProps:ne})=>Ze(ne)},X[Z]):ye(zt,{children:Ze(null)},X[Z])})}),$n(zt,{sx:{mt:.5,ml:L?0:3.25,display:"flex",alignItems:"center",gap:.5},children:[ye(zt,{component:"input",spellCheck:!1,value:g,placeholder:"+ \uD560\uC77C \uCD94\uAC00",enterKeyHint:"done",onChange:W=>w(W.target.value),onKeyDown:W=>{W.key==="Enter"&&Be()},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"}}}),u&&f&&d?ye(ju,{title:"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",arrow:!0,children:ye(Xi,{size:"small","aria-label":"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",onMouseDown:W=>W.preventDefault(),onClick:b.openDialog,sx:{flexShrink:0,color:"#9a9a97"},children:ye(_w,{sx:{fontSize:20}})})}):null,ye(Xi,{size:"small","aria-label":"\uD560\uC77C \uCD94\uAC00",disabled:!g.trim(),onMouseDown:W=>W.preventDefault(),onClick:Be,sx:{flexShrink:0,color:g.trim()?"#2f80ed":"#c9c8c5"},children:ye(yw,{sx:{fontSize:20}})})]}),u&&f&&d?ye(ec,{controller:b,task:f,tasks:u,excludeSeqs:t.map(W=>Number(W.task_seq??0)).filter(W=>W>0),hideRelationType:!0,title:"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",confirmLabel:"\uBD99\uC774\uAE30"}):null,ye(ww,{open:!!_,anchorEl:_?.anchorEl??null,title:_?.checked?"\uC774 \uD560\uC77C\uC744 \uC644\uB8CC \uCC98\uB9AC\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC644\uB8CC\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:_?.checked?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>H(null),onConfirm:()=>{_&&r(e,_.index,_.checked),H(null)}}),ye(aw,{open:!!B,onClose:()=>v(null),maxWidth:"xs",fullWidth:!0,slotProps:{paper:{sx:{borderRadius:2,m:2}}},children:$n(zt,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5},children:[ye(zt,{sx:{fontSize:15.5,fontWeight:600,color:"#37352f"},children:"\uD560\uC77C \uC218\uC815"}),ye(sw,{autoFocus:!0,fullWidth:!0,size:"medium",value:B?.label??"",onChange:W=>v(Z=>Z&&{...Z,label:W.target.value}),onKeyDown:W=>{if(W.key!=="Enter")return;let Z=B;Z&&Z.label.trim()&&a?.(e,Z.index,Z.label.trim()),v(null)}}),$n(zt,{sx:{display:"flex",alignItems:"center",gap:1},children:[!s&&m&&B&&!t[B.index]?.task_seq?ye(Xi,{"aria-label":"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",onClick:()=>{m(e,B.index,t[B.index]?.label??""),v(null)},sx:{color:"#57564f"},children:ye(Zg,{sx:{fontSize:20}})}):null,!s&&B?ye(Xi,{"aria-label":"\uD560\uC77C \uC0AD\uC81C",onClick:()=>{i(e,B.index),v(null)},sx:{color:"#e5484d"},children:ye(Qg,{sx:{fontSize:19}})}):null,ye(zt,{sx:{flex:1}}),ye(Xg,{color:"inherit",onClick:()=>v(null),children:"\uCDE8\uC18C"}),ye(Xg,{variant:"contained",disabled:!B?.label.trim(),onClick:()=>{B&&B.label.trim()&&a?.(e,B.index,B.label.trim()),v(null)},children:"\uD655\uC778"})]})]})})]})}import{useRef as zw,useState as Lw}from"react";import{Box as an,IconButton as Fw}from"@mui/material";import{DndContext as Nw,PointerSensor as $w,closestCenter as Hw,useSensor as Ww,useSensors as Vw}from"@dnd-kit/core";import{restrictToParentElement as Uw,restrictToVerticalAxis as Kw}from"@dnd-kit/modifiers";import{SortableContext as Gw,useSortable as Yw,verticalListSortingStrategy as jw}from"@dnd-kit/sortable";import{CSS as Xw}from"@dnd-kit/utilities";import Qw from"@mui/icons-material/DragIndicator";import Zw from"@mui/icons-material/Close";import ox from"@mui/icons-material/AttachFileOutlined";var Pw=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"]),oc=e=>{let t=e?.split(".").pop()?.toLowerCase()??"";return Pw.has(t)};import{LinearProgress as Mw}from"@mui/material";import{Fragment as Ow,jsx as qw,jsxs as Aw}from"react/jsx-runtime";function ex(e){let t=pn(),o=t.useValue("attachmentUpload.taskSeq"),r=t.useValue("attachmentUpload.index"),n=t.useValue("attachmentUpload.total"),i=t.useValue("attachmentUpload.queue"),a=r??0;return!a||e>0&&(o??0)!==e?null:{index:a,total:n??0,queue:i??[]}}function Xu(){let t=pn().useValue("attachmentUpload.progress");return Aw(Ow,{children:[t??0,"%"]})}function tx(){let t=pn().useValue("attachmentUpload.progress");return qw(Mw,{variant:"determinate",value:t??0,sx:{height:4,borderRadius:2,bgcolor:"#dbe9fb",mt:.75}})}import{Fragment as nx,jsx as Ct,jsxs as rl}from"react/jsx-runtime";function Jw({id:e,children:t}){let{attributes:o,listeners:r,setNodeRef:n,transform:i,transition:a,isDragging:l}=Yw({id:e});return Ct(an,{ref:n,sx:{transform:Xw.Transform.toString(i),transition:a,...l?{opacity:.6,position:"relative",zIndex:1}:{}},children:t({...o,...r})})}function nl(e){return e>=1048576?`${(e/1048576).toFixed(1)}MB`:`${Math.max(1,Math.round(e/1024))}KB`}var nc={flex:1,minWidth:0,fontSize:13.5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function rc({taskSeq:e,attachments:t,onAdd:o,onRemove:r,removeLocked:n=!1,onPreview:i,onDownload:a,onReorder:l}){let[s,m]=Lw(!1),c=zw(null),u=Fe(),f=wa(),d=Ia(),p=ex(e),x=e===0,g=!!l&&!x&&!u&&!n&&!p&&t.length>1,w=Vw(Ww($w,{activationConstraint:{distance:5}})),b=(P,T)=>P.uuid?`file-${P.uuid}`:`file-${T}`,I=t.map(b),k=P=>{let{active:T,over:h}=P;if(!h||T.id===h.id)return;let y=I.indexOf(String(T.id)),C=I.indexOf(String(h.id));y<0||C<0||l?.(e,y,C)},L=P=>{if(i){i(P);return}window.open(d(P.uuid??""),"_blank","noopener,noreferrer")},B=P=>{if(a){a(P);return}window.open(d(P.uuid??"",{download:!0}),"_blank","noopener,noreferrer")},v=P=>p?P+1<p.index?"done":P+1===p.index?"uploading":"waiting":"waiting",_=(P,T,h,y={})=>rl(an,{sx:{px:1,py:.5,borderRadius:1,border:"1px solid",borderColor:y.uploading?"#d5e6fb":"#e6e6e3",bgcolor:y.uploading?"#f4f9ff":"transparent","&:hover .taskbox-file-remove":{opacity:1},"&:hover .taskbox-file-handle":{opacity:1}},children:[rl(an,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[y.handleProps?Ct(an,{className:"taskbox-file-handle","aria-label":"\uC21C\uC11C \uBC14\uAFB8\uAE30",...y.handleProps,sx:{display:"inline-flex",flexShrink:0,alignItems:"center",ml:-.5,mr:-.5,color:"#c9c8c5",opacity:0,transition:"opacity 0.15s",cursor:"grab","&:active":{cursor:"grabbing"},touchAction:"none",userSelect:"none"},children:Ct(Qw,{sx:{fontSize:16}})}):null,Ct(ox,{sx:{fontSize:16,color:"#9a9a97"}}),T,Ct(an,{component:"span",sx:{fontSize:12,color:y.uploading?"#2f80ed":"#9a9a97",flexShrink:0},children:h}),y.removeIndex!==void 0?Ct(Fw,{className:"taskbox-file-remove",size:"small","aria-label":"\uCCA8\uBD80 \uC0AD\uC81C",onClick:()=>r(e,y.removeIndex),sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:Ct(Zw,{sx:{fontSize:15}})}):null]}),y.uploading?Ct(tx,{}):null]},P),H=P=>{let T=oc(P.name);return Ct(an,{component:"button",type:"button",onClick:()=>T?L(P):B(P),title:`${P.name} ${T?"\uBBF8\uB9AC\uBCF4\uAE30":"\uB2E4\uC6B4\uB85C\uB4DC"}`,sx:{...nc,color:"#37352f",textAlign:"left",p:0,border:"none",background:"none",font:"inherit",fontSize:13.5,cursor:"pointer",outline:"none","&:focus-visible":{textDecoration:"underline",color:"#2f80ed"},"&:hover":{textDecoration:"underline",color:"#2f80ed"}},children:P.name})};return rl(Oo,{icon:Ct(ox,{sx:{fontSize:18,display:"block"}}),title:rl(nx,{children:["\uD30C\uC77C ",t.length>0?t.length:""]}),children:[Ct(eD,{sortable:g,sensors:w,rowIds:I,onDragEnd:k,children:rl(an,{sx:{display:"flex",flexDirection:"column",gap:.5,mt:1},children:[t.map((P,T)=>{let h=`${P.uuid||P.name}-${T}`;if(x){let y=v(T),C=y==="uploading";return _(h,Ct(an,{component:"span",sx:{...nc,color:y==="done"?"#37352f":"#9a9a97"},children:P.name}),C?Ct(Xu,{}):nl(P.size),{uploading:C,removeIndex:!n&&!p?T:void 0})}return P.uuid?g?Ct(Jw,{id:b(P,T),children:y=>_(h,H(P),nl(P.size),{removeIndex:n?void 0:T,handleProps:y})},b(P,T)):_(h,H(P),nl(P.size),{removeIndex:n?void 0:T}):_(h,Ct(an,{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:{...nc,color:"#9a9a97"},children:P.name}),nl(P.size),{removeIndex:n?void 0:T})}),!x&&p?p.queue.slice(p.index-1).map((P,T)=>{let h=T===0;return _(`uploading-${p.index+T}-${P.name}`,Ct(an,{component:"span",sx:{...nc,color:"#9a9a97"},children:P.name}),h?Ct(Xu,{}):nl(P.size),{uploading:h})}):null]})}),Ct(an,{onClick:()=>c.current?.click(),onDragOver:P=>{P.preventDefault(),m(!0)},onDragLeave:()=>m(!1),onDrop:P=>{P.preventDefault(),m(!1);let T=Array.from(P.dataTransfer.files);T.length>0&&o(e,T)},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:u?`\uD30C\uC77C\uC744 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${f}MB)`:`\uD30C\uC77C\uC744 \uB04C\uC5B4\uB2E4 \uB193\uAC70\uB098 \uD074\uB9AD\uD574 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${f}MB)`}),Ct(an,{component:"input",ref:c,type:"file",multiple:!0,onChange:P=>{let T=Array.from(P.target.files??[]);T.length>0&&o(e,T),P.target.value=""},sx:{display:"none"}})]})}function eD({sortable:e,sensors:t,rowIds:o,onDragEnd:r,children:n}){return e?Ct(Nw,{sensors:t,collisionDetection:Hw,modifiers:[Kw,Uw],onDragEnd:r,children:Ct(Gw,{items:o,strategy:jw,children:n})}):Ct(nx,{children:n})}import{useState as lD}from"react";import{Checkbox as sD,Divider as cD,ListItemIcon as mD,Menu as uD,MenuItem as lx}from"@mui/material";import dD from"@mui/icons-material/Add";import{Box as Qu,Button as nD}from"@mui/material";import{FormDialog as rD}from"@ehfuse/mui-form-dialog";import{ClearTextField as iD}from"@ehfuse/mui-form-controls";import{ColorPicker as aD}from"@ehfuse/mui-color-picker";import{useGlobalForm as tD}from"@ehfuse/forma";import{ErrorAlert as oD}from"@ehfuse/alerts";var rx="#2f80ed";function ix({open:e,onClose:t,onSubmit:o}){let r=tD({formId:Ce("taskbox-add-label-form"),initialValues:{name:"",color:rx},onValidate:i=>String(i.name??"").trim()?!0:(oD("\uB77C\uBCA8 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694."),!1),onSubmit:i=>(o(String(i.name).trim(),i.color),n.form.close(),!0)}),n={form:eo({modalIdPrefix:"taskbox-add-label-dialog",open:e,onClose:t,onOpen:()=>r.setFormValues({name:"",color:rx})})};return{form:r,modals:n}}import{jsx as il,jsxs as Zu}from"react/jsx-runtime";function ax({open:e,onClose:t,onSubmit:o}){let{form:r,modals:n}=ix({open:e,onClose:t,onSubmit:o}),i=String(r.useFormValue("name")??""),a=String(r.useFormValue("color")??""),l=qp(a),s=Zu(Qu,{children:[Zu(Qu,{sx:{display:"flex",alignItems:"center",gap:1.5,mt:.5},children:[il(iD,{form:r,name:"name",label:"\uB77C\uBCA8 \uC774\uB984",onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),r.submit())},fullWidth:!0,autoFocus:!0}),il(aD,{value:a,onChange:m=>r.setFormValue("color",m),shape:"circle",colorSize:28})]}),Zu(Qu,{sx:{mt:2,display:"flex",alignItems:"center",gap:1,fontSize:13,color:"#787774"},children:["\uBBF8\uB9AC\uBCF4\uAE30",il($e,{option:{key:"__preview__",name:i.trim()||"\uB77C\uBCA8",...l}})]})]});return il(rD,{open:n.form.isOpen,onClose:n.form.close,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:il(nD,{variant:"contained",onClick:()=>{r.submit()},children:"\uCD94\uAC00"})}})}import{Fragment as pD,jsx as Qi,jsxs as ic}from"react/jsx-runtime";function ac({anchorEl:e,selectedKeys:t,labelOptions:o,onToggle:r,onAddLabel:n,onClose:i}){let[a,l]=lD(!1),s=Dn();return ic(pD,{children:[ic(uD,{anchorEl:e,open:!!e,onClose:i,transitionDuration:0,...s,children:[o.map(m=>{let c=t.includes(m.key);return ic(lx,{onClick:()=>r(m.key),sx:{fontSize:14,minWidth:170,gap:1},children:[Qi(sD,{size:"small",checked:c,sx:{p:0}}),Qi($e,{option:m})]},m.key)}),Qi(cD,{}),ic(lx,{onClick:()=>l(!0),sx:{fontSize:14,color:"#787774"},children:[Qi(mD,{children:Qi(dD,{sx:{fontSize:18,color:"#787774"}})}),"\uB77C\uBCA8 \uCD94\uAC00"]})]}),Qi(ax,{open:a,onClose:()=>l(!1),onSubmit:n})]})}function sx(e,t){let o=Number(e.author_account_seq??0);return t.filter(r=>{let n=Number(r.account_seq??0);return n>0&&n!==o})}function cx(e,t){let o=(e.target_account_seqs??[]).filter(u=>u>0);if(o.length===0)return null;let r=new Set(o),n=sx(e,t),i=new Map;for(let u of n){let f=String(u.department??"").trim();if(!f)continue;let d=i.get(f)??[];d.push(u),i.set(f,d)}let a=[],l=new Set;for(let[u,f]of i)if(f.every(p=>r.has(Number(p.account_seq??0)))){a.push(u);for(let p of f)l.add(Number(p.account_seq??0))}let s=new Map(n.map(u=>[Number(u.account_seq??0),u.name])),m=e.target_names??[],c=[];return o.forEach((u,f)=>{l.has(u)||c.push(s.get(u)??m[f]??"\uC774\uB984\uC5C6\uC74C")}),{teamNames:a,individualNames:c}}function lc(e,t){let o=cx(e,t);return o?[...o.teamNames,...o.individualNames].join(", "):"\uBAA8\uB4E0 \uC9C1\uC6D0"}function i8(e,t){let o=cx(e,t);return o?{kind:"members",teamNames:o.teamNames,individualNames:o.individualNames}:{kind:"everyone"}}function mx(e,t,o){let r=(e.target_account_seqs??[]).filter(d=>d>0),n=sx(e,t),i=r.length>0?r.length:n.length,a=e.acks??[],l=o>0&&a.some(d=>d.account_seq===o),s=o>0&&Number(e.author_account_seq??0)===o,m=r.length===0||r.includes(o),c=new Set(a.map(d=>d.account_seq)),f=(r.length>0?n.filter(d=>r.includes(Number(d.account_seq??0))):n).filter(d=>!c.has(Number(d.account_seq??0))).map(d=>String(d.name??"").trim()).filter(d=>d.length>0);return{count:a.length,total:i,acked:l,pendingNames:f,canAck:o>0&&!s&&m&&!l&&!e.completed}}import{DatePicker as vD}from"@ehfuse/mui-datetime-picker";import{Fragment as Ji,jsx as me,jsxs as Hn}from"react/jsx-runtime";var gx="taskbox:create-expanded";function _D(){try{return window.localStorage.getItem(gx)==="1"}catch{return!1}}function td({form:e,statusOptions:t,customTabs:o,sprints:r=[],avatarSrcByName:n,isNotice:i=!1,hideProject:a=!1,hideBug:l=!1,hideTypeToggle:s=!1,leadingRow:m,hideLabel:c=!1,simple:u=!1,hideMembers:f=!1,templateItem:d=!1,postMode:p=!1,employees:x=[],workspaceName:g="",workspaceSlot:w,myAccountSeq:b=0,departments:I=[],myGroupSeq:k=0,onMemberEdit:L,onAddProject:B,onAddLabelOption:v,contentSyncKey:_="create",contentTemplates:H,onSaveContentTemplate:P,onRemoveContentTemplate:T}){let h=pn(),y=wa(),C=e.useFormValue("manager_name"),R=e.useFormValue("receiver_names"),z=e.useFormValue("start_date"),D=!!e.useFormValue("is_event"),S=!!e.useFormValue("is_bug"),F=e.useFormValue("bug_repro")??"",Q=e.useFormValue("bug_device")??"",X=e.useFormValue("bug_where")??"",ae=e.useFormValue("bug_version")??"",oe=e.useFormValue("event_time")??"",Be=e.useFormValue("event_place")??"",W=e.useFormValue("event_address")??"",Z=e.useFormValue("due_date"),M=e.useFormValue("reminders")??[],U=e.useFormValue("priority"),xe=e.useFormValue("content"),we=e.useFormValue("note")??"",ne=e.useFormValue("checklist")??[],K=e.useFormValue("tab_key"),A=e.useFormValue("sprint_seq")??0,G=e.useFormValue("story_points")??0,re=o.find(N=>N.key===K&&N.useSprints),se=re?r.filter(N=>`custom-${N.group_seq}`===K):[],[ve,ke]=Zi(null),Je=e.useFormValue("label_keys"),[ze,De]=Zi(null),Le=e.useFormValue("visibility")||"involved",Ue=Number(e.useFormValue("visibility_group_seq")??0),[ao,jt]=Zi(null),Y=e.useFormValue("repeat_rule")||"",Se=e.useFormValue("repeat_until")||"",[Ee,Ft]=Zi(null),[Kn,lo]=Zi(null),vr=e.useFormValue("target_names"),Gn=e.useFormValue("target_account_seqs"),Nt=h.useValue("createAttachmentFiles")??[],Xo=i?lc({author_account_seq:b,target_names:vr,target_account_seqs:Gn},x):"",[ht,Yn]=Zi(_D),wt=u&&!D&&!i&&!p,it=wt&&!ht,vn=()=>{let N=!ht;Yn(N);try{window.localStorage.setItem(gx,N?"1":"0")}catch{}},$t=!p,un=f?1:2;return Hn(Ji,{children:[m,!i&&!s?Hn(dr,{sx:{display:"flex",gap:1.25,px:2,pt:1.5,pb:1.5,flexShrink:0},children:[w?me(dr,{sx:{alignSelf:"center",mr:"6px",minWidth:0,display:"flex"},children:w}):g?me(dr,{sx:{alignSelf:"center",fontSize:13.5,fontWeight:600,color:"#37352f",mr:"6px",maxWidth:160,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:g,children:g}):null,[{value:"task",label:"\uC5C5\uBB34"},{value:"event",label:"\uC77C\uC815"},...l?[]:[{value:"bug",label:"\uC624\uB958"}]].map(N=>{let j=(S?"bug":D?"event":"task")===N.value;return me(ux,{onClick:()=>bm(e,N.value),sx:{px:1.75,lineHeight:1,pt:"8px",pb:"10px",borderRadius:99,fontSize:13.5,fontWeight:j?600:400,color:j?"#ffffff":"#787774",bgcolor:j?"#2563eb":"#f4f4f2"},children:N.label},N.label)})]}):null,me(al,{sx:{borderColor:"#e6e6e3"}}),Hn(dr,{sx:{pt:1.5,pb:2,display:"flex",flexDirection:"column",gap:.25},children:[me(Ks,{hideProject:a||p||it&&!K,hideManager:f||it&&!C,hideReceivers:d||f||it&&R.length===0,hideStartDate:it||p,hideReminder:d||p||it&&M.length===0,hidePriority:p,hideDueDate:p||!D&&!!Y,values:{tabKey:K,managerName:C,receiverNames:R,startDate:z,dueDate:Z,reminders:M,priority:U,eventTime:oe,eventPlace:Be,eventAddress:W},customTabs:o,avatarSrcByName:n,notice:i,event:D,onChangeEventTime:N=>e.setFormValue("event_time",N),onChangeEventPlace:N=>e.setFormValue("event_place",N),onChangeEventAddress:N=>e.setFormValue("event_address",N),targetSummary:Xo,onChangeProject:N=>e.setFormValue("tab_key",N),onAddProject:B,onChangeStartDate:N=>e.setFormValue("start_date",N),onClearStartDate:()=>e.setFormValue("start_date",""),onChangeDueDate:N=>e.setFormValue("due_date",N),onChangeReminder:N=>e.setFormValue("reminders",N),onChangePriority:N=>e.setFormValue("priority",N),onMemberEdit:L,pinColumns:$t,beforeStart:Hn(Ji,{children:[!d&&!S&&!p&&!(it&&!Y)?me(be,{icon:me(yD,{sx:{fontSize:17,...Y?{color:"#2f80ed"}:{}}}),label:"\uBC18\uBCF5",onClick:N=>Ft(N),sx:D||!$t?void 0:dt(un),children:Y?Yl(Y):me(dr,{component:"span",sx:{color:"#9a9a97"},children:"\uC5C6\uC74C"})}):null,!d&&!S&&!p&&Y?me(be,{icon:me(SD,{sx:{fontSize:17}}),label:"\uBC18\uBCF5 \uC885\uB8CC",onClick:N=>lo(N),sx:D||!$t?void 0:dt(un),children:Se?$o(Se):me(dr,{component:"span",sx:{color:"#9a9a97"},children:"\uC790\uB3D9"})}):null]}),trailing:Hn(Ji,{children:[!i&&!f&&!(it&&Le==="involved")?me(be,{icon:Le==="all"?me(px,{sx:{fontSize:17,color:"#2f80ed"}}):Le==="group"?me(fx,{sx:{fontSize:17,color:"#d9730d"}}):me(dx,{sx:{fontSize:17}}),label:"\uACF5\uAC1C",onClick:N=>jt(N),sx:D||!$t?void 0:dt(1),children:Le==="all"?"\uC804\uCCB4\uACF5\uAC1C":Le==="group"?`\uBD80\uC11C\uACF5\uAC1C \xB7 ${I.find(N=>N.seq===Ue)?.name??"\uBD80\uC11C"}`:"\uBE44\uACF5\uAC1C"}):null,re&&!D&&!i&&!p&&!(it&&A===0&&G===0)?Hn(Ji,{children:[me(be,{icon:me(TD,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:N=>ke(N),sx:$t?dt(1):void 0,children:A>0?se.find(N=>N.seq===A)?.name??"\uC0AD\uC81C\uB41C \uBAA9\uD45C":me(dr,{component:"span",sx:{color:"#9a9a97"},children:"\uBBF8\uBC30\uC815"})}),me(be,{icon:me(CD,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",sx:$t?dt(1):void 0,children:me(mr,{value:G>0?String(G):"",placeholder:"\uBBF8\uCD94\uC815",onCommit:N=>e.setFormValue("story_points",Number(N.replace(/[^0-9.]/g,""))||0)})})]}):null,S?me(Gs,{values:{repro:F,device:Q,where:X,version:ae},onChangeRepro:N=>e.setFormValue("bug_repro",N),onChangeDevice:N=>e.setFormValue("bug_device",N),onChangeWhere:N=>e.setFormValue("bug_where",N),onChangeVersion:N=>e.setFormValue("bug_version",N)}):null]}),leading:D||c?null:me(dr,{sx:{gridColumn:"1 / -1"},children:me(be,{icon:me(kD,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:N=>De(N),children:(Je??[]).length>0?me(Rr,{labelKeys:Je??[],labelOptions:t}):me(dr,{component:"span",sx:{color:"#9a9a97"},children:"\uBE44\uC5B4 \uC788\uC74C"})})})}),wt?Hn(ux,{onClick:vn,"aria-expanded":ht,sx:{alignSelf:"flex-start",display:"flex",alignItems:"center",gap:.5,minHeight:32,mx:2,pr:1,borderRadius:1,fontSize:14,color:"#2563eb","&:hover":{bgcolor:"#f2f2f0"}},children:[ht?me(fD,{sx:{fontSize:17}}):me(gD,{sx:{fontSize:17}}),ht?"\uD56D\uBAA9 \uC811\uAE30":"\uD56D\uBAA9 \uB354 \uBCF4\uAE30"]}):null,me(al,{sx:{my:1.5,borderColor:"#e6e6e3"}}),me(Oo,{icon:me(bD,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",titleExtra:H?me(Zs,{content:xe,templates:H,onApply:N=>e.setFormValue("content",N),onSave:P,onRemove:T}):void 0,children:me(js,{syncKey:_,value:xe,onChange:N=>e.setFormValue("content",N)})}),S||p||it&&!we?null:Hn(Ji,{children:[me(al,{sx:{my:1.5,borderColor:"#e6e6e3"}}),me(Oo,{icon:me(hD,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:me(BD,{form:e,name:"note",placeholder:"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",sx:{mt:1}})})]}),D||p||it&&ne.length===0?null:me(al,{sx:{my:1.5,borderColor:"#e6e6e3"}}),D||p||it&&ne.length===0?null:me(tc,{taskSeq:0,checklist:ne,onAdd:(N,$)=>Tm(e,$),onToggle:(N,$,j)=>ym(e,$,j),onRemove:(N,$)=>Sm(e,$),onUpdate:(N,$,j)=>Cm(e,$,j)}),d?null:Hn(Ji,{children:[me(al,{sx:{my:1.5,borderColor:"#e6e6e3"}}),me(rc,{taskSeq:0,attachments:Nt.map(N=>({name:N.name,size:N.size})),onAdd:(N,$)=>Bm(h,$,y),onRemove:(N,$)=>vm(h,$)})]})]}),me(Ju,{transitionDuration:0,anchorEl:ve,open:!!ve,onClose:()=>ke(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...se.map(N=>({seq:N.seq,label:tn(N)}))].map(N=>me(ed,{onClick:()=>{e.setFormValue("sprint_seq",N.seq),ke(null)},sx:{fontSize:14,minWidth:170},children:N.label},N.seq))}),me(Ju,{transitionDuration:0,anchorEl:Ee,open:!!Ee,onClose:()=>Ft(null),children:[{value:"",label:"\uC5C6\uC74C"},...Oa].map(N=>me(ed,{selected:Y===N.value,onClick:()=>{Ft(null),hm(e,N.value)},sx:{fontSize:14,minWidth:140},children:N.label},N.value||"none"))}),me(vD,{anchorEl:Kn,open:!!Kn,onClose:()=>lo(null),selectedDate:Se?new Date(`${Se}T00:00:00`):new Date,onDateChange:N=>{km(e,N),lo(null)}}),me(Ju,{transitionDuration:0,anchorEl:ao,open:!!ao,onClose:()=>jt(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:me(dx,{sx:{fontSize:17,color:"#57564f"}}),selected:Le==="involved",onPick:()=>Aa(e,"involved")},{key:"all",label:"\uC804\uCCB4\uACF5\uAC1C",tip:"\uBAA8\uB4E0 \uC9C1\uC6D0\uC774 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4",icon:me(px,{sx:{fontSize:17,color:"#2f80ed"}}),selected:Le==="all",onPick:()=>Aa(e,"all")},...[...I].sort((N,$)=>N.seq===k?-1:$.seq===k?1:0).map(N=>({key:`group-${N.seq}`,label:`\uBD80\uC11C\uACF5\uAC1C \xB7 ${N.name}`,tip:`${N.name} \uC18C\uC18D \uC9C1\uC6D0\uC774 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4`,icon:me(fx,{sx:{fontSize:17,color:"#d9730d"}}),selected:Le==="group"&&Ue===N.seq,onPick:()=>Aa(e,"group",N.seq)}))].map(N=>me(xD,{title:N.tip,arrow:!0,disableInteractive:!0,placement:"right",children:Hn(ed,{selected:N.selected,onClick:()=>{N.onPick(),jt(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[N.icon,N.label]})},N.key))}),me(ac,{anchorEl:ze,selectedKeys:Je??[],labelOptions:t,onToggle:N=>e.setFormValue("label_keys",ns(Je??[],N)),onAddLabel:(N,$)=>v?.(N,$),onClose:()=>De(null)})]})}import{Fragment as hx,jsx as ft,jsxs as ll}from"react/jsx-runtime";var qD={gap:"0.75rem !important","& .left-actions, & .right-actions":{display:"contents"},"& .left-actions > span:empty":{display:"none"},"& .left-actions:not(:has(*:not(:empty)))":{display:"none"},"& .left-actions .MuiButton-root, & .right-actions .MuiButton-root":{flex:"1 1 0",minWidth:0,margin:"0 !important",paddingLeft:"8px !important",paddingRight:"8px !important",whiteSpace:"nowrap"},"& .right-actions .MuiButton-text":{border:"1px solid rgba(0, 0, 0, 0.23)"},"& .right-actions .MuiButton-contained":{border:"1px solid transparent"}};function kx({open:e,onClose:t,desktopPresentation:o="drawer",submitLabel:r,...n}){let{form:i,presetTitle:a="",presetContent:l="",presetVisibility:s,presetVisibilityGroupSeq:m=0,presetDueDate:c="",presetTabKey:u="",presetManager:f=null,isNotice:d=!1,defaultBug:p=!1}=n,x=pn(),g=wD(!1),[w,b]=xx(0),I=i.useFormValue("title"),k=i.useFormValue("icon"),L=i.useFormValue("icon_color"),B=!!i.useFormValue("is_event"),v=!!i.useFormValue("is_bug"),_=Fe(),P=x.useValue("createSubmitting")??!1,T=d||B?Re(k||(d?Tt:Ot)):null,h=d?"\uACF5\uC9C0 \uB4F1\uB85D":B?"\uC77C\uC815 \uB4F1\uB85D":v?"\uC624\uB958 \uB4F1\uB85D":"\uC5C5\uBB34 \uB4F1\uB85D",y=d?"\uACF5\uC9C0 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":B?"\uC77C\uC815 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":v?"\uC5B4\uB5A4 \uC624\uB958\uC778\uC9C0 \uD55C \uC904\uB85C \uC801\uC5B4\uC8FC\uC138\uC694":"\uC5C5\uBB34 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694";ID(()=>{let S=g.current;g.current=e,!(!e||S)&&(xm(i,x,{presetTitle:a,presetContent:l,presetVisibility:s,presetVisibilityGroupSeq:m,presetDueDate:c,presetTabKey:u,presetManager:f,isNotice:d,defaultBug:p}),b(F=>F+1))},[e]);let[C,R]=xx(null),z=S=>T?B?ft(PD,{title:"\uC544\uC774\uCF58 \uBCC0\uACBD",arrow:!0,enterDelay:400,disableInteractive:!0,children:ft(DD,{onClick:F=>R(F.currentTarget),sx:{display:"flex",p:.5,borderRadius:1,color:L||"#1e3a8a","&:hover":{bgcolor:"#f2f2f0"}},children:ft(T,{sx:{fontSize:20}})})}):ft(pr,{sx:[{display:"flex",color:L||"#1e3a8a"},S],children:ft(T,{sx:{fontSize:20}})}):null,D=ll(pr,{sx:{display:"flex",alignItems:"center",gap:1,px:2,pt:2,pb:1},children:[z({p:0}),ft(pr,{component:"input",autoFocus:!0,spellCheck:!1,value:I,placeholder:y,onChange:S=>i.setFormValue("title",S.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 _||o==="dialog"?ft(hx,{children:ft(AD,{open:e,onClose:t,backdropClick:!1,locale:"ko",fontScale:_?{enabled:!0,default:1.1,min:.6}:{enabled:!0},title:h,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fullScreen:_,mobilePresentation:_?"slide":"dialog",maxWidth:"md",actions:{showCancelButton:!0,right:ft(od,{variant:"contained",disableElevation:!0,disabled:P,onClick:P?void 0:i.submit,children:P?"\uC800\uC7A5 \uC911\u2026":r??"\uC800\uC7A5\uD558\uAE30"})},dialogActionSx:_?qD:void 0,tabs:{visible:!1},contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,contentBottomPadding:0,scrollPastLastSection:!1,overlayScrollbar:{enabled:!0,contentStyle:{minWidth:0}},sections:[{id:"task-create",title:"",showTitle:!1,children:ft(pr,{sx:{width:"100%",minWidth:0,display:"flex",flexDirection:"column",gap:0},children:ft(td,{...n,contentSyncKey:`create-${w}`,leadingRow:D})})}]})}):ll(hx,{children:[ft(RD,{anchor:"right",open:e,onClose:(S,F)=>{F!=="backdropClick"&&t()},"aria-label":"\uC0C8 \uC5C5\uBB34 \uB4F1\uB85D",sx:{zIndex:S=>S.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:ll(pr,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[ll(pr,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[z({px:.5}),ft(pr,{component:"input",autoFocus:!0,spellCheck:!1,value:I,placeholder:y,onChange:S=>i.setFormValue("title",S.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}}}),ft(ED,{"aria-label":"\uB2EB\uAE30",onClick:t,sx:{color:"#6b7280"},children:ft(MD,{})})]}),ft(bx,{sx:{borderColor:"#e6e6e3"}}),ft(pr,{sx:{flex:1,minHeight:0},children:ft(OD,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:ft(td,{...n,contentSyncKey:`create-${w}`})})}),ft(bx,{sx:{borderColor:"#e6e6e3"}}),ll(pr,{sx:{display:"flex",justifyContent:"flex-end",gap:.5,px:2,py:1.5,flexShrink:0},children:[ft(od,{onClick:t,color:"inherit",disabled:P,children:"\uCDE8\uC18C"}),ft(od,{onClick:i.submit,variant:"contained",disabled:P,children:P?"\uB4F1\uB85D \uC911\u2026":r??"\uB4F1\uB85D"})]})]})}),ft(Pr,{anchorEl:C,value:k,color:L,onSelect:S=>{i.setFormValue("icon",S),R(null)},onSelectColor:S=>i.setFormValue("icon_color",S),onClose:()=>R(null)})]})}import{useEffect as ab,useRef as lb,useState as sb}from"react";import{Box as hc,Button as NE,Divider as cb,Drawer as $E,IconButton as HE,ListItemIcon as yd,ListItemText as Sd,Menu as WE,MenuItem as Cd}from"@mui/material";import VE from"@mui/icons-material/MoreVert";import UE from"@mui/icons-material/DeleteOutline";import KE from"@mui/icons-material/ShareOutlined";import GE from"@mui/icons-material/HistoryOutlined";import YE from"@ehfuse/overlay-scrollbar";import{FormDialog as jE}from"@ehfuse/mui-form-dialog";import{useRef as ad,useState as hi}from"react";import{Box as he,Button as _x,Chip as mc,IconButton as Ko,Tooltip as Px}from"@mui/material";import Ix from"@mui/icons-material/Send";import{TextField as YD}from"@ehfuse/mui-form-controls";import uc from"@mui/icons-material/Close";import jD from"@mui/icons-material/EditOutlined";import wx from"@mui/icons-material/ContentCopyOutlined";import Dx from"@mui/icons-material/Check";import XD from"@mui/icons-material/Favorite";import QD from"@mui/icons-material/FavoriteBorderOutlined";import ZD from"@mui/icons-material/CheckCircle";import JD from"@mui/icons-material/CheckCircleOutlineOutlined";import ta from"@mui/icons-material/AttachFileOutlined";import eR from"@mui/icons-material/AddCircleOutline";import tR from"@mui/icons-material/ImageOutlined";var nd=e=>{if(e===0)return"0 Bytes";let t=1024,o=["Bytes","KB","MB","GB","TB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(2))+" "+o[r]};import{useCallback as sc,useEffect as zD,useMemo as LD,useRef as FD,useState as rd}from"react";import{Box as cc,Paper as ND,Popper as $D}from"@mui/material";import{jsx as ea,jsxs as WD}from"react/jsx-runtime";var Tx=8,HD=[{key:"\uC88B\uC544\uC694",label:"\uC88B\uC544\uC694",insert:"\u{1F44D}",keywords:["like","\uC5C4\uC9C0","\uAD7F"]},{key:"\uD655\uC778",label:"\uD655\uC778",insert:"\u2705",keywords:["check","\uC644\uB8CC","\uCCB4\uD06C"]},{key:"\uAC10\uC0AC",label:"\uAC10\uC0AC",insert:"\u{1F64F}",keywords:["thanks","\uACE0\uB9C8\uC6CC","\uBD80\uD0C1"]},{key:"\uCD95\uD558",label:"\uCD95\uD558",insert:"\u{1F389}",keywords:["party","\uD30C\uD2F0","\uC9DD\uC9DD"]},{key:"\uBC15\uC218",label:"\uBC15\uC218",insert:"\u{1F44F}",keywords:["clap","\uC798\uD588\uC5B4"]},{key:"\uD558\uD2B8",label:"\uD558\uD2B8",insert:"\u2764\uFE0F",keywords:["heart","\uC0AC\uB791"]},{key:"\uC6C3\uC74C",label:"\uC6C3\uC74C",insert:"\u{1F604}",keywords:["smile","\uC6C3\uAE40","\u314B\u314B"]},{key:"\uBBF8\uC18C",label:"\uBBF8\uC18C",insert:"\u{1F642}",keywords:["smile","\uC88B\uC74C"]},{key:"\uB208\uBB3C",label:"\uB208\uBB3C",insert:"\u{1F622}",keywords:["sad","\uC2AC\uD514","\u3160\u3160"]},{key:"\uB180\uB78C",label:"\uB180\uB78C",insert:"\u{1F62E}",keywords:["wow","\uD5C9"]},{key:"\uACE0\uBBFC",label:"\uACE0\uBBFC",insert:"\u{1F914}",keywords:["think","\uC0DD\uAC01","\uC74C"]},{key:"\uC624\uCF00\uC774",label:"\uC624\uCF00\uC774",insert:"\u{1F44C}",keywords:["ok","\uC54C\uACA0\uC5B4"]},{key:"\uBD88",label:"\uBD88",insert:"\u{1F525}",keywords:["fire","\uAE09\uD568","\uB300\uBC15"]},{key:"\uC544\uC774\uB514\uC5B4",label:"\uC544\uC774\uB514\uC5B4",insert:"\u{1F4A1}",keywords:["idea","\uC804\uAD6C"]},{key:"\uACBD\uACE0",label:"\uACBD\uACE0",insert:"\u26A0\uFE0F",keywords:["warning","\uC8FC\uC758"]},{key:"\uC9C8\uBB38",label:"\uC9C8\uBB38",insert:"\u2753",keywords:["question","\uBB3C\uC74C"]},{key:"\uC2DC\uACC4",label:"\uC2DC\uACC4",insert:"\u23F0",keywords:["time","\uC2DC\uAC04","\uC54C\uB78C"]},{key:"\uB2EC\uB825",label:"\uB2EC\uB825",insert:"\u{1F4C5}",keywords:["calendar","\uC77C\uC815","\uB0A0\uC9DC"]},{key:"\uBA54\uBAA8",label:"\uBA54\uBAA8",insert:"\u{1F4DD}",keywords:["note","\uAE30\uB85D"]},{key:"\uCCA8\uBD80",label:"\uCCA8\uBD80",insert:"\u{1F4CE}",keywords:["attach","\uD074\uB9BD","\uD30C\uC77C"]},{key:"\uB9C1\uD06C",label:"\uB9C1\uD06C",insert:"\u{1F517}",keywords:["link","\uC8FC\uC18C"]},{key:"\uB85C\uCF13",label:"\uB85C\uCF13",insert:"\u{1F680}",keywords:["rocket","\uCD9C\uBC1C","\uBC30\uD3EC"]},{key:"\uBCC4",label:"\uBCC4",insert:"\u2B50",keywords:["star","\uC911\uC694"]},{key:"\uC5D1\uC2A4",label:"\uC5D1\uC2A4",insert:"\u274C",keywords:["x","\uC548\uB428","\uCDE8\uC18C"]}];function yx(e,t,o){let r=e.slice(0,t),i=(o==="@"?/(^|[\s(])@([^\s@]{0,20})$/:/(^|[\s(])\/([^\s/]{0,20})$/).exec(r);return i?{start:t-i[2].length-1,query:i[2]}:null}function Sx({value:e,setValue:t,candidates:o,slashCommands:r}){let n=le(),i=o??n.mentionCandidates??[],a=r??n.slashCommands,l=a===!0?HD:Array.isArray(a)?a:[],s=FD(null),[m,c]=rd(null),[u,f]=rd(null),[d,p]=rd(0),x=i.length>0||l.length>0,g=LD(()=>{if(!u)return[];let v=u.query.toLowerCase();return u.trigger==="@"?i.filter(_=>_.name.toLowerCase().includes(v)).slice(0,Tx).map((_,H)=>({id:`p${H}-${_.name}`,text:`@${_.name} `,label:_.name,subtitle:_.subtitle,icon:ea(mo,{src:_.avatar??"",name:_.name,avatarSx:{width:24,height:24,fontSize:14},iconFontSize:16})})):l.filter(_=>[_.key,_.label,..._.keywords??[]].some(H=>H.toLowerCase().includes(v))).slice(0,Tx).map(_=>({id:`c-${_.key}`,text:_.insert,label:`/${_.label}`,icon:ea(cc,{component:"span",sx:{width:24,textAlign:"center",fontSize:18,lineHeight:1},children:_.insert})}))},[l,i,u]),w=!!(m&&u&&g.length>0),b=sc(()=>{let v=s.current;if(!x||!v)return;let _=v.selectionStart??v.value.length,H=i.length>0?yx(v.value,_,"@"):null,P=!H&&l.length>0?yx(v.value,_,"/"):null,T=H?{...H,trigger:"@"}:P?{...P,trigger:"/"}:null;f(T),p(0),c(T?v.closest(".MuiInputBase-root")??v:null)},[l.length,x,i.length]);zD(()=>{document.activeElement===s.current&&b()},[e,b]);let I=sc(v=>{let _=s.current;if(!u||!_)return;let H=_.selectionStart??e.length,P=e.slice(0,u.start)+v.text+e.slice(H);t(P),f(null),c(null);let T=u.start+v.text.length;requestAnimationFrame(()=>{_.focus(),_.setSelectionRange(T,T)})},[u,t,e]),k=sc(v=>!w||v.nativeEvent.isComposing?!1:v.key==="ArrowDown"||v.key==="ArrowUp"?(v.preventDefault(),p(_=>(_+(v.key==="ArrowDown"?1:g.length-1))%g.length),!0):v.key==="Enter"||v.key==="Tab"?(v.preventDefault(),I(g[Math.min(d,g.length-1)]),!0):v.key==="Escape"?(v.preventDefault(),v.stopPropagation(),f(null),c(null),!0):!1,[d,g,w,I]),L=sc(v=>{s.current=v},[]),B=x?ea($D,{open:w,anchorEl:m,placement:"top-start",sx:{zIndex:1500},children:ea(ND,{elevation:4,sx:{minWidth:220,maxWidth:320,py:.5,borderRadius:1.5},children:g.map((v,_)=>WD(cc,{role:"option","aria-selected":_===d,onMouseDown:H=>H.preventDefault(),onClick:()=>I(v),onMouseEnter:()=>p(_),sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:.75,cursor:"pointer",fontSize:14,bgcolor:_===d?"action.selected":"transparent"},children:[v.icon,ea(cc,{component:"span",sx:{fontWeight:500,whiteSpace:"nowrap"},children:v.label}),v.subtitle?ea(cc,{component:"span",sx:{color:"text.secondary",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:v.subtitle}):null]},v.id))})}):null;return{inputRef:L,onKeyDown:k,onSelectionChange:b,popper:B}}import{ConfirmActionPopper as oR}from"@ehfuse/mui-confirm-action";import{Box as Bx}from"@mui/material";import{Fragment as GD,jsx as id}from"react/jsx-runtime";var VD=/https?:\/\/[^\s<>"']+/g;function UD(e){let t=e,o="";for(;;){let r=t.slice(-1);if(r===")"&&(t.match(/\(/g)??[]).length<(t.match(/\)/g)??[]).length){t=t.slice(0,-1),o=r+o;continue}if(".,;:!?]}".includes(r)&&r!==""){t=t.slice(0,-1),o=r+o;continue}break}return[t,o]}var KD=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function Cx(e,t,o="m"){let r=[...new Set(t.filter(l=>l.trim().length>=2))].sort((l,s)=>s.length-l.length);if(r.length===0||!e.includes("@"))return[e];let n=new RegExp(`(^|[^A-Za-z0-9._%+-])(@(?:${r.map(KD).join("|")}))`,"g"),i=[],a=0;for(let l of e.matchAll(n)){let s=(l.index??0)+l[1].length;s>a&&i.push(e.slice(a,s)),i.push(id(Bx,{component:"span",sx:{color:"#2563eb",fontWeight:600},children:l[2]},`${o}-${s}`)),a=s+l[2].length}return a<e.length&&i.push(e.slice(a)),i}function vx({text:e}){let{openExternalUrl:t,mentionCandidates:o}=le(),r=(o??[]).map(l=>l.name),n=l=>{t?t(l):window.open(l,"_blank","noopener,noreferrer")},i=[],a=0;for(let l of e.matchAll(VD)){let s=l.index??0,[m,c]=UD(l[0]);s>a&&i.push(...Cx(e.slice(a,s),r,`m${a}`)),i.push(id(Bx,{component:"a",href:m,onClick:u=>{u.preventDefault(),u.stopPropagation(),n(m)},sx:{color:"#2563eb",textDecoration:"underline",wordBreak:"break-all",cursor:"pointer"},children:m},`${s}-${m}`)),c&&i.push(c),a=s+l[0].length}return a<e.length&&i.push(...Cx(e.slice(a),r,`m${a}`)),id(GD,{children:i})}import{Fragment as Ex,jsx as ee,jsxs as gt}from"react/jsx-runtime";var nR=5;function Rx({kind:e,reactions:t,myAccountSeq:o,onToggle:r}){let n=t??[],i=o>0&&n.some(m=>m.account_seq===o),a=e==="like"?"\uC88B\uC544\uC694":"\uD655\uC778",l=n.length===0?a:ee(he,{sx:{whiteSpace:"pre-line",fontSize:12},children:n.map(m=>`${m.name} \xB7 ${m.time}`).join(`
|
|
10
|
+
`).trim()}var q1={...Ug,left:(Ug.left??[]).flatMap(e=>e.includes("indent")?[["bulletList","numberList"],e]:[e])};function js({syncKey:e,value:t,onChange:o,readOnly:r=!1,viewFirst:n=!1,onTranslate:i,minHeight:a=180,editing:l,onEditingChange:s}){let{uploadContentImage:m,openExternalUrl:c}=le(),u=D=>{c?c(D):window.open(D,"_blank","noopener,noreferrer")},[f,d]=Hg(()=>!n||!bi(t).trim()),p=l!==void 0,x=p?l:f,g=xi(s);g.current=s;let w=D=>{p||d(D),g.current?.(D)};$g(()=>{n&&w(!bi(t).trim())},[e,n]);let b=xi(null),I=xi(new A1),k=xi(null),L=xi(Date.now()+800),B=Fe(),v=E1(),_=R1(v.breakpoints.down("sm")),[H,P]=Hg(!1),T=()=>{let D=bi(t);D&&navigator.clipboard.writeText(D).then(()=>{P(!0),window.setTimeout(()=>P(!1),1500)})},h=(D,S=!1)=>D instanceof Element?D.closest(S?".taskbox-content-readview a[href]":".ehfuse-editor-content a[href]"):null,y=D=>B||D.ctrlKey||D.metaKey;$g(()=>{if(r)return;let D=Uu(t);k.current===D||k.current===t||(k.current=D,L.current=Date.now()+800,b.current?.setHtml(D))},[e,t,r]);let C=Uu(t),R=xi(null),z=xi({el:null,html:""});return D1(()=>{let D=R.current;D&&(z.current.el===D&&z.current.html===C||(D.innerHTML=C,z.current={el:D,html:C}))}),r||!x?Ys(el,{sx:{position:"relative",mt:1},children:[no(el,{onClickCapture:D=>{let S=h(D.target,!0);S&&(D.preventDefault(),D.stopPropagation(),u(S.href))},ref:R,className:"taskbox-content-readview","data-drag-scroll":"off",sx:{border:"1px solid #e0e0e0",borderRadius:1,p:"12px",pr:_?"12px":"52px",pb:"28px",minHeight:a,fontSize:16,lineHeight:1.6,color:"#37352f",wordBreak:"break-word",userSelect:"text","& > p:first-of-type":{mt:0},"& > p:last-of-type":{mb:0},"& a[href]":{color:"#2563eb",textDecoration:"underline",cursor:"pointer"},"& img":{maxWidth:"100%"},"& ul, & ol":{pl:"1.5em",my:.5},"& ul":{listStyleType:"disc"},"& ol":{listStyleType:"decimal"},"& li > p":{my:0}}}),_?Ys(el,{sx:{display:"flex",gap:1,mt:1},children:[no(Hu,{variant:"outlined",color:"inherit",startIcon:no(M1,{sx:{fontSize:18}}),onClick:T,sx:{flex:1,fontSize:15,color:"#37352f",borderColor:"#d9d9d6"},children:H?"\uBCF5\uC0AC\uB428":"\uBCF5\uC0AC"}),r?null:no(Hu,{variant:"outlined",color:"inherit",startIcon:no(Wg,{sx:{fontSize:18}}),onClick:()=>w(!0),sx:{flex:1,fontSize:15,color:"#37352f",borderColor:"#d9d9d6"},children:"\uC218\uC815"}),i?no(Hu,{variant:"outlined",color:"inherit",startIcon:no(Vg,{sx:{fontSize:18}}),onClick:i,sx:{flex:1,fontSize:15,color:"#37352f",borderColor:"#d9d9d6"},children:"\uBC88\uC5ED"}):null]}):Ys(el,{sx:{position:"absolute",top:6,right:6,display:"flex",flexDirection:"column",gap:.25},children:[r?null:no(Vu,{title:"\uB0B4\uC6A9 \uC218\uC815",arrow:!0,placement:"left",children:no(Wu,{size:"small","aria-label":"\uB0B4\uC6A9 \uC218\uC815",onClick:()=>w(!0),sx:{color:"#9a9a97"},children:no(Wg,{sx:{fontSize:17}})})}),i?no(Vu,{title:"\uBC88\uC5ED",arrow:!0,placement:"left",children:no(Wu,{size:"small","aria-label":"\uBC88\uC5ED",onClick:i,sx:{color:"#9a9a97"},children:no(Vg,{sx:{fontSize:17}})})}):null]})]}):Ys(el,{onDragOver:D=>D.stopPropagation(),onDrop:D=>D.stopPropagation(),onMouseDownCapture:D=>{y(D)&&h(D.target)&&D.preventDefault()},onClickCapture:D=>{let S=y(D)?h(D.target):null;S&&(D.preventDefault(),D.stopPropagation(),u(S.href))},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"},...B?{"& .ehfuse-editor-content a[href]":{cursor:"pointer"}}:{},position:"relative"},children:[n&&!p?no(Vu,{title:"\uD3B8\uC9D1 \uB05D(\uC77D\uAE30 \uBAA8\uB4DC)",arrow:!0,children:no(Wu,{size:"small","aria-label":"\uD3B8\uC9D1 \uB05D",onMouseDown:D=>D.preventDefault(),onClick:()=>w(!1),sx:{position:"absolute",top:4,right:6,zIndex:2,color:"#2f9e5b"},children:no(P1,{sx:{fontSize:19}})})}):null,no(O1,{ref:b,defaultValue:Uu(t),autoHeight:!0,showToolbar:!B,focusBorder:!0,styles:{focusBorderColor:"var(--primary)"},toolbarOptions:q1,plugins:[I.current],locale:"ko",minHeight:a,placeholder:"\uB0B4\uC6A9\uC744 \uC785\uB825\uD558\uC138\uC694",onImageUpload:m,contentStyle:{padding:"12px"},onChange:D=>{let S=Date.now()<L.current,F=D===k.current;k.current=D,!(S||F)&&o(D)}})]})}import{Fragment as K1,jsx as vo,jsxs as Qs}from"react/jsx-runtime";function Yu(e){return String(e??"").replace(/<[^>]*>/g,"").replace(/ /g," ").trim().length>0}function Zs({content:e,templates:t,onApply:o,onSave:r,onRemove:n,readOnly:i=!1}){let[a,l]=Ku(null),[s,m]=Ku(!1),[c,u]=Ku(""),f=async p=>{l(null),!(Yu(e)&&!await $1({title:"\uC591\uC2DD \uBD88\uB7EC\uC624\uAE30",message:`\uC9C0\uAE08 \uC4F4 \uB0B4\uC6A9\uC744 "${p.name}" \uC591\uC2DD\uC73C\uB85C \uBC14\uAFC9\uB2C8\uB2E4. \uACC4\uC18D\uD560\uAE4C\uC694?`}))&&o(p.content)},d=()=>{l(null);let p=bi(e);p&&navigator.clipboard.writeText(p).then(()=>W1("\uB0B4\uC6A9\uC744 \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>H1("\uB0B4\uC6A9\uC744 \uBCF5\uC0AC\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."))};return Qs(K1,{children:[vo(F1,{title:"\uB0B4\uC6A9 \uBA54\uB274",arrow:!0,disableInteractive:!0,children:vo(Gg,{size:"small","aria-label":"\uB0B4\uC6A9 \uBA54\uB274",onClick:p=>l(p.currentTarget),sx:{ml:"auto",color:"#9a9a97"},children:vo(N1,{sx:{fontSize:18}})})}),Qs(L1,{anchorEl:a,open:!!a,onClose:()=>l(null),transitionDuration:0,children:[vo(Xs,{disabled:!Yu(e),onClick:d,sx:{fontSize:14,minWidth:220},children:"\uB0B4\uC6A9 \uBCF5\uC0AC"}),i?null:vo(Kg,{sx:{my:.5}}),!i&&r?vo(Xs,{disabled:!Yu(e),onClick:()=>{l(null),u(""),m(!0)},sx:{fontSize:14,minWidth:220},children:"\uD604\uC7AC \uB0B4\uC6A9\uC744 \uC591\uC2DD\uC73C\uB85C \uC800\uC7A5"}):null,!i&&r?vo(Kg,{sx:{my:.5}}):null,i?null:t.length===0?vo(Xs,{disabled:!0,sx:{fontSize:14,minWidth:220},children:"\uC800\uC7A5\uB41C \uC591\uC2DD\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"}):t.map(p=>Qs(Xs,{onClick:()=>{f(p)},sx:{fontSize:14,minWidth:220,gap:1},children:[vo(Gu,{sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p.name}),n?vo(Gg,{size:"small","aria-label":`${p.name} \uC591\uC2DD \uC0AD\uC81C`,onClick:x=>{x.stopPropagation(),n(p.seq)},sx:{color:"#9a9a97"},children:vo(Kt,{sx:{fontSize:16}})}):null]},p.seq))]}),vo(V1,{open:s,onClose:()=>m(!1),maxWidth:"xs",title:"\uC591\uC2DD\uC73C\uB85C \uC800\uC7A5",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},tabs:{visible:!1},actions:{showCancelButton:!0,right:vo(z1,{variant:"contained",disabled:!c.trim(),onClick:()=>{r?.(c.trim(),e),m(!1)},children:"\uC800\uC7A5"})},sections:[{id:"template-name",title:"",showTitle:!1,children:Qs(Gu,{sx:{display:"flex",flexDirection:"column",gap:1},children:[vo(Gu,{sx:{fontSize:15,color:"#37352f"},children:"\uC9C0\uAE08 \uB0B4\uC6A9\uC744 \uC591\uC2DD\uC73C\uB85C \uC800\uC7A5\uD569\uB2C8\uB2E4. \uB2E4\uC74C\uBD80\uD130 \uC774 \uC774\uB984\uC73C\uB85C \uAEBC\uB0B4 \uC4F8 \uC218 \uC788\uC2B5\uB2C8\uB2E4."}),vo(U1,{size:"medium",fullWidth:!0,autoFocus:!0,placeholder:"\uC591\uC2DD \uC774\uB984 (\uC608: \uC624\uB958 \uC2E0\uACE0 \uC11C\uC2DD)",value:c,onChange:p=>u(p.target.value)})]})}]})]})}import{useState as ol}from"react";import{Box as zt,Button as Xg,Dialog as aw,IconButton as Xi,Switch as lw,TextField as sw,Tooltip as ju}from"@mui/material";import{DndContext as cw,PointerSensor as mw,closestCenter as uw,useSensor as dw,useSensors as pw}from"@dnd-kit/core";import{restrictToParentElement as fw,restrictToVerticalAxis as gw}from"@dnd-kit/modifiers";import{SortableContext as xw,arrayMove as bw,useSortable as hw,verticalListSortingStrategy as kw}from"@dnd-kit/sortable";import{CSS as Tw}from"@dnd-kit/utilities";import Qg from"@mui/icons-material/Close";import yw from"@mui/icons-material/AddCircle";import Zg from"@mui/icons-material/AddTask";import Sw from"@mui/icons-material/Checklist";import Cw from"@mui/icons-material/CheckCircle";import Bw from"@mui/icons-material/DragIndicator";import vw from"@mui/icons-material/Launch";import _w from"@mui/icons-material/LinkOutlined";import Iw from"@mui/icons-material/RadioButtonUnchecked";import{useMemo as Q1}from"react";import{Box as Nn,Button as Z1,Tab as J1,Tabs as ew}from"@mui/material";import{FormDialog as tw}from"@ehfuse/mui-form-dialog";import{ClearTextField as ow}from"@ehfuse/mui-form-controls";import nw from"@mui/icons-material/CheckCircle";import rw from"@mui/icons-material/RadioButtonUnchecked";import{OverlayScrollbar as iw}from"@ehfuse/overlay-scrollbar";import{useRef as G1}from"react";import{useGlobalForm as Y1,useModal as j1}from"@ehfuse/forma";import{ErrorAlert as X1}from"@ehfuse/alerts";var Yg={type:"related",search:"",selectedSeqs:[]};function tl(e){let t=G1(e);t.current=e;let o={link:j1({modalId:Ce("taskbox-task-link")})},r=Y1({formId:Ce("taskbox-task-link-form"),initialValues:Yg,onValidate:a=>a.selectedSeqs.length===0?(X1("\uC5F0\uACB0\uD560 \uC5C5\uBB34\uB97C \uC120\uD0DD\uD558\uC138\uC694."),!1):!0,onSubmit:a=>{for(let l of a.selectedSeqs)t.current.onSubmit(l,a.type);return o.link.close(),!0}});return{form:r,modals:o,openDialog:()=>{r.setFormValues({...Yg,selectedSeqs:[]}),o.link.open()},toggleSelected:a=>{let l=r.getFormValue("selectedSeqs")??[];if(l.includes(a)){r.setFormValue("selectedSeqs",l.filter(s=>s!==a));return}r.setFormValue("selectedSeqs",t.current.multiSelect?[...l,a]:[a])}}}import{jsx as po,jsxs as Js}from"react/jsx-runtime";var jg=[{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 ec({controller:e,task:t,tasks:o,excludeSeqs:r=[],hideRelationType:n=!1,title:i="\uAD00\uB828 \uC5C5\uBB34 \uC5F0\uACB0",confirmLabel:a="\uC5F0\uACB0"}){let l=Fe(),{form:s}=e,m=e.modals.link,c=s.useValue("type")??"related",u=String(s.useValue("search")??""),f=s.useValue("selectedSeqs")??[],d=Q1(()=>{let g=new Set([t.seq,...r]),w=u.trim().toLowerCase();return o.filter(b=>g.has(b.seq)||b.is_event||b.is_notice||b.linked_only?!1:w?b.title.toLowerCase().includes(w)||(b.ticket_no??"").toLowerCase().includes(w):!0).sort((b,I)=>!!b.completed!=!!I.completed?b.completed?1:-1:I.seq-b.seq)},[o,t.seq,r,u]),p=jg.find(g=>g.type===c)?.hint??"",x=Js(Nn,{sx:{display:"flex",flexDirection:"column",minHeight:0,height:l?"100%":"auto"},children:[n?null:po(ew,{value:c,onChange:(g,w)=>s.setFormValue("type",w),sx:{minHeight:38,flexShrink:0,borderBottom:"1px solid #ededeb","& .MuiTab-root":{minHeight:38,py:.5,fontSize:16,color:"#333333"}},children:jg.map(g=>po(J1,{value:g.type,label:g.label},g.type))}),n?null:po(Nn,{sx:{mt:1,mb:1.5,fontSize:14,flexShrink:0},children:p}),Js(Nn,{sx:{...l?{height:"100%",minHeight:0}:{height:560},display:"flex",flexDirection:"column",...l?{}:{border:"1px solid #cccccc",borderRadius:1},overflow:"hidden",userSelect:"none"},children:[po(Nn,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:po(ow,{placeholder:"\uC81C\uBAA9\xB7\uD2F0\uCF13\uBC88\uD638\uB85C \uAC80\uC0C9",name:"search",form:s,fullWidth:!0,autoFocus:!0,size:"small",sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),po(Nn,{sx:{flex:1,minHeight:0},children:po(iw,{style:{height:"100%"},contentStyle:{paddingTop:0},children:po(Nn,{sx:{display:"flex",flexDirection:"column"},children:d.length===0?po(Nn,{sx:{py:4,textAlign:"center",fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uD560 \uC218 \uC788\uB294 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):d.map(g=>{let w=g.is_notice||g.is_event?Re(g.icon||(g.is_notice?Tt:Ot)):null,b=f.includes(g.seq);return Js(Nn,{onClick:()=>e.toggleSelected(g.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:b?"#e3eefb":"transparent","&:hover":{bgcolor:b?"#e3eefb":"#f7f7f5"}},children:[b?po(nw,{sx:{fontSize:20,flexShrink:0,color:"#2f6fd0"}}):po(rw,{sx:{fontSize:20,flexShrink:0,color:"#c9c8c5"}}),w?po(w,{sx:{fontSize:17,flexShrink:0,color:g.icon_color||"#1e3a8a"}}):null,Js(Nn,{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:[g.ticket_no?`${g.ticket_no} `:"",g.title]}),po(Nn,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:po($e,{option:At(g)})})]},g.seq)})})})})]})]});return po(tw,{open:m.isOpen,onClose:m.close,maxWidth:"sm",fullScreen:l,mobilePresentation:l?"slide":"dialog",...l?{contentPaddingX:0,contentTopPadding:0,sectionsPaddingTop: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:i,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-task-link",sections:[{id:"task-link",showTitle:!1,children:x}],scrollPastLastSection:!1,sectionContentPaddingTop:0,contentTopPadding:12,actions:{showCancelButton:!0,right:po(Z1,{variant:"contained",disabled:f.length===0,onClick:()=>{s.submit()},children:a})}})}import{ConfirmActionPopper as ww}from"@ehfuse/mui-confirm-action";import{Fragment as Ew,jsx as ye,jsxs as $n}from"react/jsx-runtime";var Jg="taskbox.checklist.hideCompleted";function Dw({id:e,children:t}){let{attributes:o,listeners:r,setNodeRef:n,transform:i,transition:a,isDragging:l}=hw({id:e});return ye(zt,{ref:n,sx:{transform:Tw.Transform.toString(i),transition:a,...l?{opacity:.6,position:"relative",zIndex:1}:{}},children:t({handleProps:{...o,...r},dragging:l})})}function Rw({sortable:e,sensors:t,rowIds:o,onDragEnd:r,compact:n,children:i}){let a=ye(zt,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:n?0:3.25},children:i});return e?ye(cw,{sensors:t,collisionDetection:uw,modifiers:[gw,fw],onDragEnd:r,children:ye(xw,{items:o,strategy:kw,children:a})}):a}function tc({taskSeq:e,checklist:t,onAdd:o,onToggle:r,confirmOnToggle:n=!1,onRemove:i,onUpdate:a,onReorder:l,removeLocked:s=!1,onConvertToTask:m,onOpenLinkedTask:c,linkCandidates:u,linkBaseTask:f,onLinkExistingTask:d,resolveLinkedTask:p,myAccountSeq:x=0}){let[g,w]=ol(""),b=tl({multiSelect:!0,onSubmit:W=>{if(!d)return;let Z=u?.find(M=>M.seq===W);d(e,W,String(Z?.title??"").trim())}}),[I,k]=ol(null),L=Fe(),[B,v]=ol(null),[_,H]=ol(null),P=W=>{let Z=W.task_seq?p?.(W.task_seq):void 0;return Z?Z.completed:W.checked},T=W=>{if(!W.task_seq||x<=0)return!1;let Z=p?.(W.task_seq);return Z?!df(Z,x):!1},h=W=>!!W.task_seq&&!!p&&!p?.(W.task_seq),y=t.filter(W=>!h(W)),C=y.filter(P).length,[R,z]=ol(()=>{try{return localStorage.getItem(Jg)==="1"}catch{return!1}}),D=W=>{z(W);try{localStorage.setItem(Jg,W?"1":"0")}catch{}},S=!!l&&!L&&!s,F=pw(dw(mw,{activationConstraint:{distance:5}})),Q=(W,Z)=>W.task_seq?`linked-${W.task_seq}`:`row-${Z}`,X=t.map(Q),ae=X.filter((W,Z)=>{let M=t[Z];return h(M)?!1:!(R&&P(M))}),oe=W=>{let{active:Z,over:M}=W;if(!M||Z.id===M.id)return;let U=X.indexOf(String(Z.id)),xe=X.indexOf(String(M.id));U<0||xe<0||l?.(e,bw(t,U,xe))},Be=()=>{g.trim()&&(o(e,g),w(""))};return $n(Oo,{icon:ye(Sw,{sx:{fontSize:19,display:"block"}}),title:$n(Ew,{children:["\uD560\uC77C",t.length>0?$n(zt,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:[C," / ",t.length]}):null]}),titleExtra:y.length>0?$n(zt,{sx:{flex:1,minWidth:0,ml:1,display:"flex",alignItems:"center",gap:1},children:[ye(zt,{sx:{flex:1,minWidth:0,height:6,borderRadius:3,bgcolor:"#ececea"},children:ye(zt,{sx:{height:"100%",borderRadius:3,width:`${Math.round(C/y.length*100)}%`,bgcolor:"#2f80ed",transition:"width 0.2s"}})}),C>0?$n(zt,{component:"label",sx:{display:"inline-flex",alignItems:"center",gap:.25,flexShrink:0,cursor:"pointer",fontSize:13.5,fontWeight:400,color:"#57564f",userSelect:"none"},children:[ye(lw,{size:"small",checked:R,onChange:(W,Z)=>D(Z)}),"\uC644\uB8CC\uC228\uAE40"]}):null]}):null,children:[ye(Rw,{sortable:S,sensors:F,rowIds:ae,onDragEnd:oe,compact:L,children:t.map((W,Z)=>{let M=W.task_seq?p?.(W.task_seq):void 0,U=P(W);if(R&&U||h(W))return null;let xe=!!W.task_seq,we=T(W),Ze=ne=>$n(zt,{sx:{display:"flex",alignItems:L?"flex-start":"center",gap:1,px:1.25,...S?{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:[ne?ye(zt,{className:"taskbox-checklist-handle",...ne,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:ye(Bw,{sx:{fontSize:16}})}):null,ye(ju,{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:ye(zt,{component:"span",onClick:we?void 0:K=>n?H({anchorEl:K.currentTarget,index:Z,checked:!U}):r(e,Z,!U),sx:{display:"inline-flex",flexShrink:0,cursor:we?"default":"pointer",...L?{mt:"1px"}:{}},children:U?ye(Cw,{sx:{fontSize:18,color:we?"#a9c6ec":"#2f80ed"}}):ye(Iw,{sx:{fontSize:18,color:we?"#d6d5d1":"#9a9a97"}})})}),I?.index===Z?ye(zt,{component:"input",autoFocus:!0,spellCheck:!1,value:I.label,enterKeyHint:"done",onChange:K=>k({index:Z,label:K.target.value}),onBlur:()=>{I.label.trim()&&I.label.trim()!==W.label&&a?.(e,Z,I.label),k(null)},onKeyDown:K=>{K.key==="Enter"&&K.target.blur(),K.key==="Escape"&&k(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",p:0}}):ye(zt,{component:"span",onClick:xe?W.task_seq&&c?()=>c(W.task_seq):void 0:s||!a?void 0:L?()=>v({index:Z,label:W.label}):()=>k({index:Z,label:W.label}),sx:{flex:1,minWidth:0,fontSize:14.5,color:"#37352f",textDecoration:U?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",...L?{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:3,lineHeight:1.4,wordBreak:"break-word"}:{whiteSpace:"nowrap"},...xe?c?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}:s||!a?{}:{cursor:"text"}},children:W.label}),xe?$n(zt,{component:"span",onClick:W.task_seq&&c?()=>c(W.task_seq):void 0,sx:{display:"inline-flex",alignItems:"center",gap:.4,flexShrink:0,...L?{mt:"1px"}:{},px:.75,py:.2,borderRadius:1,fontSize:12,fontWeight:500,color:"#1d4f91",bgcolor:"#e3eefb",whiteSpace:"nowrap",...c?{cursor:"pointer"}:{}},children:[ye(vw,{sx:{fontSize:12}}),M?.manager_name?.trim()||"\uC5C5\uBB34"]}):null,!s&&!xe&&m?ye(ju,{title:"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",arrow:!0,enterDelay:300,disableInteractive:!0,children:ye(Xi,{className:"taskbox-checklist-convert",size:"small","aria-label":"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",onClick:()=>m(e,Z,W.label),sx:{display:L?"none":"inline-flex",opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:ye(Zg,{sx:{fontSize:16}})})}):null,s?null:ye(Xi,{className:"taskbox-checklist-remove",size:"small","aria-label":"\uD560\uC77C \uC0AD\uC81C",onClick:()=>i(e,Z),sx:{display:L?"none":"inline-flex",opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:ye(Qg,{sx:{fontSize:15}})})]});return S?ye(Dw,{id:X[Z],children:({handleProps:ne})=>Ze(ne)},X[Z]):ye(zt,{children:Ze(null)},X[Z])})}),$n(zt,{sx:{mt:.5,ml:L?0:3.25,display:"flex",alignItems:"center",gap:.5},children:[ye(zt,{component:"input",spellCheck:!1,value:g,placeholder:"+ \uD560\uC77C \uCD94\uAC00",enterKeyHint:"done",onChange:W=>w(W.target.value),onKeyDown:W=>{W.key==="Enter"&&Be()},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"}}}),u&&f&&d?ye(ju,{title:"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",arrow:!0,children:ye(Xi,{size:"small","aria-label":"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",onMouseDown:W=>W.preventDefault(),onClick:b.openDialog,sx:{flexShrink:0,color:"#9a9a97"},children:ye(_w,{sx:{fontSize:20}})})}):null,ye(Xi,{size:"small","aria-label":"\uD560\uC77C \uCD94\uAC00",disabled:!g.trim(),onMouseDown:W=>W.preventDefault(),onClick:Be,sx:{flexShrink:0,color:g.trim()?"#2f80ed":"#c9c8c5"},children:ye(yw,{sx:{fontSize:20}})})]}),u&&f&&d?ye(ec,{controller:b,task:f,tasks:u,excludeSeqs:t.map(W=>Number(W.task_seq??0)).filter(W=>W>0),hideRelationType:!0,title:"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",confirmLabel:"\uBD99\uC774\uAE30"}):null,ye(ww,{open:!!_,anchorEl:_?.anchorEl??null,title:_?.checked?"\uC774 \uD560\uC77C\uC744 \uC644\uB8CC \uCC98\uB9AC\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC644\uB8CC\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:_?.checked?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>H(null),onConfirm:()=>{_&&r(e,_.index,_.checked),H(null)}}),ye(aw,{open:!!B,onClose:()=>v(null),maxWidth:"xs",fullWidth:!0,slotProps:{paper:{sx:{borderRadius:2,m:2}}},children:$n(zt,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5},children:[ye(zt,{sx:{fontSize:15.5,fontWeight:600,color:"#37352f"},children:"\uD560\uC77C \uC218\uC815"}),ye(sw,{autoFocus:!0,fullWidth:!0,size:"medium",value:B?.label??"",onChange:W=>v(Z=>Z&&{...Z,label:W.target.value}),onKeyDown:W=>{if(W.key!=="Enter")return;let Z=B;Z&&Z.label.trim()&&a?.(e,Z.index,Z.label.trim()),v(null)}}),$n(zt,{sx:{display:"flex",alignItems:"center",gap:1},children:[!s&&m&&B&&!t[B.index]?.task_seq?ye(Xi,{"aria-label":"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",onClick:()=>{m(e,B.index,t[B.index]?.label??""),v(null)},sx:{color:"#57564f"},children:ye(Zg,{sx:{fontSize:20}})}):null,!s&&B?ye(Xi,{"aria-label":"\uD560\uC77C \uC0AD\uC81C",onClick:()=>{i(e,B.index),v(null)},sx:{color:"#e5484d"},children:ye(Qg,{sx:{fontSize:19}})}):null,ye(zt,{sx:{flex:1}}),ye(Xg,{color:"inherit",onClick:()=>v(null),children:"\uCDE8\uC18C"}),ye(Xg,{variant:"contained",disabled:!B?.label.trim(),onClick:()=>{B&&B.label.trim()&&a?.(e,B.index,B.label.trim()),v(null)},children:"\uD655\uC778"})]})]})})]})}import{useRef as zw,useState as Lw}from"react";import{Box as an,IconButton as Fw}from"@mui/material";import{DndContext as Nw,PointerSensor as $w,closestCenter as Hw,useSensor as Ww,useSensors as Vw}from"@dnd-kit/core";import{restrictToParentElement as Uw,restrictToVerticalAxis as Kw}from"@dnd-kit/modifiers";import{SortableContext as Gw,useSortable as Yw,verticalListSortingStrategy as jw}from"@dnd-kit/sortable";import{CSS as Xw}from"@dnd-kit/utilities";import Qw from"@mui/icons-material/DragIndicator";import Zw from"@mui/icons-material/Close";import ox from"@mui/icons-material/AttachFileOutlined";var Pw=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"]),oc=e=>{let t=e?.split(".").pop()?.toLowerCase()??"";return Pw.has(t)};import{LinearProgress as Mw}from"@mui/material";import{Fragment as Ow,jsx as qw,jsxs as Aw}from"react/jsx-runtime";function ex(e){let t=pn(),o=t.useValue("attachmentUpload.taskSeq"),r=t.useValue("attachmentUpload.index"),n=t.useValue("attachmentUpload.total"),i=t.useValue("attachmentUpload.queue"),a=r??0;return!a||e>0&&(o??0)!==e?null:{index:a,total:n??0,queue:i??[]}}function Xu(){let t=pn().useValue("attachmentUpload.progress");return Aw(Ow,{children:[t??0,"%"]})}function tx(){let t=pn().useValue("attachmentUpload.progress");return qw(Mw,{variant:"determinate",value:t??0,sx:{height:4,borderRadius:2,bgcolor:"#dbe9fb",mt:.75}})}import{Fragment as nx,jsx as Ct,jsxs as rl}from"react/jsx-runtime";function Jw({id:e,children:t}){let{attributes:o,listeners:r,setNodeRef:n,transform:i,transition:a,isDragging:l}=Yw({id:e});return Ct(an,{ref:n,sx:{transform:Xw.Transform.toString(i),transition:a,...l?{opacity:.6,position:"relative",zIndex:1}:{}},children:t({...o,...r})})}function nl(e){return e>=1048576?`${(e/1048576).toFixed(1)}MB`:`${Math.max(1,Math.round(e/1024))}KB`}var nc={flex:1,minWidth:0,fontSize:13.5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function rc({taskSeq:e,attachments:t,onAdd:o,onRemove:r,removeLocked:n=!1,onPreview:i,onDownload:a,onReorder:l}){let[s,m]=Lw(!1),c=zw(null),u=Fe(),f=wa(),d=Ia(),p=ex(e),x=e===0,g=!!l&&!x&&!u&&!n&&!p&&t.length>1,w=Vw(Ww($w,{activationConstraint:{distance:5}})),b=(P,T)=>P.uuid?`file-${P.uuid}`:`file-${T}`,I=t.map(b),k=P=>{let{active:T,over:h}=P;if(!h||T.id===h.id)return;let y=I.indexOf(String(T.id)),C=I.indexOf(String(h.id));y<0||C<0||l?.(e,y,C)},L=P=>{if(i){i(P);return}window.open(d(P.uuid??""),"_blank","noopener,noreferrer")},B=P=>{if(a){a(P);return}window.open(d(P.uuid??"",{download:!0}),"_blank","noopener,noreferrer")},v=P=>p?P+1<p.index?"done":P+1===p.index?"uploading":"waiting":"waiting",_=(P,T,h,y={})=>rl(an,{sx:{px:1,py:.5,borderRadius:1,border:"1px solid",borderColor:y.uploading?"#d5e6fb":"#e6e6e3",bgcolor:y.uploading?"#f4f9ff":"transparent","&:hover .taskbox-file-remove":{opacity:1},"&:hover .taskbox-file-handle":{opacity:1}},children:[rl(an,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[y.handleProps?Ct(an,{className:"taskbox-file-handle","aria-label":"\uC21C\uC11C \uBC14\uAFB8\uAE30",...y.handleProps,sx:{display:"inline-flex",flexShrink:0,alignItems:"center",ml:-.5,mr:-.5,color:"#c9c8c5",opacity:0,transition:"opacity 0.15s",cursor:"grab","&:active":{cursor:"grabbing"},touchAction:"none",userSelect:"none"},children:Ct(Qw,{sx:{fontSize:16}})}):null,Ct(ox,{sx:{fontSize:16,color:"#9a9a97"}}),T,Ct(an,{component:"span",sx:{fontSize:12,color:y.uploading?"#2f80ed":"#9a9a97",flexShrink:0},children:h}),y.removeIndex!==void 0?Ct(Fw,{className:"taskbox-file-remove",size:"small","aria-label":"\uCCA8\uBD80 \uC0AD\uC81C",onClick:()=>r(e,y.removeIndex),sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:Ct(Zw,{sx:{fontSize:15}})}):null]}),y.uploading?Ct(tx,{}):null]},P),H=P=>{let T=oc(P.name);return Ct(an,{component:"button",type:"button",onClick:()=>T?L(P):B(P),title:`${P.name} ${T?"\uBBF8\uB9AC\uBCF4\uAE30":"\uB2E4\uC6B4\uB85C\uB4DC"}`,sx:{...nc,color:"#37352f",textAlign:"left",p:0,border:"none",background:"none",font:"inherit",fontSize:13.5,cursor:"pointer",outline:"none","&:focus-visible":{textDecoration:"underline",color:"#2f80ed"},"&:hover":{textDecoration:"underline",color:"#2f80ed"}},children:P.name})};return rl(Oo,{icon:Ct(ox,{sx:{fontSize:18,display:"block"}}),title:rl(nx,{children:["\uD30C\uC77C ",t.length>0?t.length:""]}),children:[Ct(eD,{sortable:g,sensors:w,rowIds:I,onDragEnd:k,children:rl(an,{sx:{display:"flex",flexDirection:"column",gap:.5,mt:1},children:[t.map((P,T)=>{let h=`${P.uuid||P.name}-${T}`;if(x){let y=v(T),C=y==="uploading";return _(h,Ct(an,{component:"span",sx:{...nc,color:y==="done"?"#37352f":"#9a9a97"},children:P.name}),C?Ct(Xu,{}):nl(P.size),{uploading:C,removeIndex:!n&&!p?T:void 0})}return P.uuid?g?Ct(Jw,{id:b(P,T),children:y=>_(h,H(P),nl(P.size),{removeIndex:n?void 0:T,handleProps:y})},b(P,T)):_(h,H(P),nl(P.size),{removeIndex:n?void 0:T}):_(h,Ct(an,{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:{...nc,color:"#9a9a97"},children:P.name}),nl(P.size),{removeIndex:n?void 0:T})}),!x&&p?p.queue.slice(p.index-1).map((P,T)=>{let h=T===0;return _(`uploading-${p.index+T}-${P.name}`,Ct(an,{component:"span",sx:{...nc,color:"#9a9a97"},children:P.name}),h?Ct(Xu,{}):nl(P.size),{uploading:h})}):null]})}),Ct(an,{onClick:()=>c.current?.click(),onDragOver:P=>{P.preventDefault(),m(!0)},onDragLeave:()=>m(!1),onDrop:P=>{P.preventDefault(),m(!1);let T=Array.from(P.dataTransfer.files);T.length>0&&o(e,T)},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:u?`\uD30C\uC77C\uC744 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${f}MB)`:`\uD30C\uC77C\uC744 \uB04C\uC5B4\uB2E4 \uB193\uAC70\uB098 \uD074\uB9AD\uD574 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${f}MB)`}),Ct(an,{component:"input",ref:c,type:"file",multiple:!0,onChange:P=>{let T=Array.from(P.target.files??[]);T.length>0&&o(e,T),P.target.value=""},sx:{display:"none"}})]})}function eD({sortable:e,sensors:t,rowIds:o,onDragEnd:r,children:n}){return e?Ct(Nw,{sensors:t,collisionDetection:Hw,modifiers:[Kw,Uw],onDragEnd:r,children:Ct(Gw,{items:o,strategy:jw,children:n})}):Ct(nx,{children:n})}import{useState as lD}from"react";import{Checkbox as sD,Divider as cD,ListItemIcon as mD,Menu as uD,MenuItem as lx}from"@mui/material";import dD from"@mui/icons-material/Add";import{Box as Qu,Button as nD}from"@mui/material";import{FormDialog as rD}from"@ehfuse/mui-form-dialog";import{ClearTextField as iD}from"@ehfuse/mui-form-controls";import{ColorPicker as aD}from"@ehfuse/mui-color-picker";import{useGlobalForm as tD}from"@ehfuse/forma";import{ErrorAlert as oD}from"@ehfuse/alerts";var rx="#2f80ed";function ix({open:e,onClose:t,onSubmit:o}){let r=tD({formId:Ce("taskbox-add-label-form"),initialValues:{name:"",color:rx},onValidate:i=>String(i.name??"").trim()?!0:(oD("\uB77C\uBCA8 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694."),!1),onSubmit:i=>(o(String(i.name).trim(),i.color),n.form.close(),!0)}),n={form:eo({modalIdPrefix:"taskbox-add-label-dialog",open:e,onClose:t,onOpen:()=>r.setFormValues({name:"",color:rx})})};return{form:r,modals:n}}import{jsx as il,jsxs as Zu}from"react/jsx-runtime";function ax({open:e,onClose:t,onSubmit:o}){let{form:r,modals:n}=ix({open:e,onClose:t,onSubmit:o}),i=String(r.useFormValue("name")??""),a=String(r.useFormValue("color")??""),l=qp(a),s=Zu(Qu,{children:[Zu(Qu,{sx:{display:"flex",alignItems:"center",gap:1.5,mt:.5},children:[il(iD,{form:r,name:"name",label:"\uB77C\uBCA8 \uC774\uB984",onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),r.submit())},fullWidth:!0,autoFocus:!0}),il(aD,{value:a,onChange:m=>r.setFormValue("color",m),shape:"circle",colorSize:28})]}),Zu(Qu,{sx:{mt:2,display:"flex",alignItems:"center",gap:1,fontSize:13,color:"#787774"},children:["\uBBF8\uB9AC\uBCF4\uAE30",il($e,{option:{key:"__preview__",name:i.trim()||"\uB77C\uBCA8",...l}})]})]});return il(rD,{open:n.form.isOpen,onClose:n.form.close,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:il(nD,{variant:"contained",onClick:()=>{r.submit()},children:"\uCD94\uAC00"})}})}import{Fragment as pD,jsx as Qi,jsxs as ic}from"react/jsx-runtime";function ac({anchorEl:e,selectedKeys:t,labelOptions:o,onToggle:r,onAddLabel:n,onClose:i}){let[a,l]=lD(!1),s=Dn();return ic(pD,{children:[ic(uD,{anchorEl:e,open:!!e,onClose:i,transitionDuration:0,...s,children:[o.map(m=>{let c=t.includes(m.key);return ic(lx,{onClick:()=>r(m.key),sx:{fontSize:14,minWidth:170,gap:1},children:[Qi(sD,{size:"small",checked:c,sx:{p:0}}),Qi($e,{option:m})]},m.key)}),Qi(cD,{}),ic(lx,{onClick:()=>l(!0),sx:{fontSize:14,color:"#787774"},children:[Qi(mD,{children:Qi(dD,{sx:{fontSize:18,color:"#787774"}})}),"\uB77C\uBCA8 \uCD94\uAC00"]})]}),Qi(ax,{open:a,onClose:()=>l(!1),onSubmit:n})]})}function sx(e,t){let o=Number(e.author_account_seq??0);return t.filter(r=>{let n=Number(r.account_seq??0);return n>0&&n!==o})}function cx(e,t){let o=(e.target_account_seqs??[]).filter(u=>u>0);if(o.length===0)return null;let r=new Set(o),n=sx(e,t),i=new Map;for(let u of n){let f=String(u.department??"").trim();if(!f)continue;let d=i.get(f)??[];d.push(u),i.set(f,d)}let a=[],l=new Set;for(let[u,f]of i)if(f.every(p=>r.has(Number(p.account_seq??0)))){a.push(u);for(let p of f)l.add(Number(p.account_seq??0))}let s=new Map(n.map(u=>[Number(u.account_seq??0),u.name])),m=e.target_names??[],c=[];return o.forEach((u,f)=>{l.has(u)||c.push(s.get(u)??m[f]??"\uC774\uB984\uC5C6\uC74C")}),{teamNames:a,individualNames:c}}function lc(e,t){let o=cx(e,t);return o?[...o.teamNames,...o.individualNames].join(", "):"\uBAA8\uB4E0 \uC9C1\uC6D0"}function i8(e,t){let o=cx(e,t);return o?{kind:"members",teamNames:o.teamNames,individualNames:o.individualNames}:{kind:"everyone"}}function mx(e,t,o){let r=(e.target_account_seqs??[]).filter(d=>d>0),n=sx(e,t),i=r.length>0?r.length:n.length,a=e.acks??[],l=o>0&&a.some(d=>d.account_seq===o),s=o>0&&Number(e.author_account_seq??0)===o,m=r.length===0||r.includes(o),c=new Set(a.map(d=>d.account_seq)),f=(r.length>0?n.filter(d=>r.includes(Number(d.account_seq??0))):n).filter(d=>!c.has(Number(d.account_seq??0))).map(d=>String(d.name??"").trim()).filter(d=>d.length>0);return{count:a.length,total:i,acked:l,pendingNames:f,canAck:o>0&&!s&&m&&!l&&!e.completed}}import{DatePicker as vD}from"@ehfuse/mui-datetime-picker";import{Fragment as Ji,jsx as me,jsxs as Hn}from"react/jsx-runtime";var gx="taskbox:create-expanded";function _D(){try{return window.localStorage.getItem(gx)==="1"}catch{return!1}}function td({form:e,statusOptions:t,customTabs:o,sprints:r=[],avatarSrcByName:n,isNotice:i=!1,hideProject:a=!1,hideBug:l=!1,hideTypeToggle:s=!1,leadingRow:m,hideLabel:c=!1,simple:u=!1,hideMembers:f=!1,templateItem:d=!1,postMode:p=!1,employees:x=[],workspaceName:g="",workspaceSlot:w,myAccountSeq:b=0,departments:I=[],myGroupSeq:k=0,onMemberEdit:L,onAddProject:B,onAddLabelOption:v,contentSyncKey:_="create",contentTemplates:H,onSaveContentTemplate:P,onRemoveContentTemplate:T}){let h=pn(),y=wa(),C=e.useFormValue("manager_name"),R=e.useFormValue("receiver_names"),z=e.useFormValue("start_date"),D=!!e.useFormValue("is_event"),S=!!e.useFormValue("is_bug"),F=e.useFormValue("bug_repro")??"",Q=e.useFormValue("bug_device")??"",X=e.useFormValue("bug_where")??"",ae=e.useFormValue("bug_version")??"",oe=e.useFormValue("event_time")??"",Be=e.useFormValue("event_place")??"",W=e.useFormValue("event_address")??"",Z=e.useFormValue("due_date"),M=e.useFormValue("reminders")??[],U=e.useFormValue("priority"),xe=e.useFormValue("content"),we=e.useFormValue("note")??"",ne=e.useFormValue("checklist")??[],K=e.useFormValue("tab_key"),A=e.useFormValue("sprint_seq")??0,G=e.useFormValue("story_points")??0,re=o.find(N=>N.key===K&&N.useSprints),se=re?r.filter(N=>`custom-${N.group_seq}`===K):[],[ve,ke]=Zi(null),Je=e.useFormValue("label_keys"),[ze,De]=Zi(null),Le=e.useFormValue("visibility")||"involved",Ue=Number(e.useFormValue("visibility_group_seq")??0),[ao,jt]=Zi(null),Y=e.useFormValue("repeat_rule")||"",Se=e.useFormValue("repeat_until")||"",[Ee,Ft]=Zi(null),[Kn,lo]=Zi(null),vr=e.useFormValue("target_names"),Gn=e.useFormValue("target_account_seqs"),Nt=h.useValue("createAttachmentFiles")??[],Xo=i?lc({author_account_seq:b,target_names:vr,target_account_seqs:Gn},x):"",[ht,Yn]=Zi(_D),wt=u&&!D&&!i&&!p,it=wt&&!ht,vn=()=>{let N=!ht;Yn(N);try{window.localStorage.setItem(gx,N?"1":"0")}catch{}},$t=!p,un=f?1:2;return Hn(Ji,{children:[m,!i&&!s?Hn(dr,{sx:{display:"flex",gap:1.25,px:2,pt:1.5,pb:1.5,flexShrink:0},children:[w?me(dr,{sx:{alignSelf:"center",mr:"6px",minWidth:0,display:"flex"},children:w}):g?me(dr,{sx:{alignSelf:"center",fontSize:13.5,fontWeight:600,color:"#37352f",mr:"6px",maxWidth:160,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:g,children:g}):null,[{value:"task",label:"\uC5C5\uBB34"},{value:"event",label:"\uC77C\uC815"},...l?[]:[{value:"bug",label:"\uC624\uB958"}]].map(N=>{let j=(S?"bug":D?"event":"task")===N.value;return me(ux,{onClick:()=>bm(e,N.value),sx:{px:1.75,lineHeight:1,pt:"8px",pb:"10px",borderRadius:99,fontSize:13.5,fontWeight:j?600:400,color:j?"#ffffff":"#787774",bgcolor:j?"#2563eb":"#f4f4f2"},children:N.label},N.label)})]}):null,me(al,{sx:{borderColor:"#e6e6e3"}}),Hn(dr,{sx:{pt:1.5,pb:2,display:"flex",flexDirection:"column",gap:.25},children:[me(Ks,{hideProject:a||p||it&&!K,hideManager:f||it&&!C,hideReceivers:d||f||it&&R.length===0,hideStartDate:it||p,hideReminder:d||p||it&&M.length===0,hidePriority:p,hideDueDate:p||!D&&!!Y,values:{tabKey:K,managerName:C,receiverNames:R,startDate:z,dueDate:Z,reminders:M,priority:U,eventTime:oe,eventPlace:Be,eventAddress:W},customTabs:o,avatarSrcByName:n,notice:i,event:D,onChangeEventTime:N=>e.setFormValue("event_time",N),onChangeEventPlace:N=>e.setFormValue("event_place",N),onChangeEventAddress:N=>e.setFormValue("event_address",N),targetSummary:Xo,onChangeProject:N=>e.setFormValue("tab_key",N),onAddProject:B,onChangeStartDate:N=>e.setFormValue("start_date",N),onClearStartDate:()=>e.setFormValue("start_date",""),onChangeDueDate:N=>e.setFormValue("due_date",N),onChangeReminder:N=>e.setFormValue("reminders",N),onChangePriority:N=>e.setFormValue("priority",N),onMemberEdit:L,pinColumns:$t,beforeStart:Hn(Ji,{children:[!d&&!S&&!p&&!(it&&!Y)?me(be,{icon:me(yD,{sx:{fontSize:17,...Y?{color:"#2f80ed"}:{}}}),label:"\uBC18\uBCF5",onClick:N=>Ft(N),sx:D||!$t?void 0:dt(un),children:Y?Yl(Y):me(dr,{component:"span",sx:{color:"#9a9a97"},children:"\uC5C6\uC74C"})}):null,!d&&!S&&!p&&Y?me(be,{icon:me(SD,{sx:{fontSize:17}}),label:"\uBC18\uBCF5 \uC885\uB8CC",onClick:N=>lo(N),sx:D||!$t?void 0:dt(un),children:Se?$o(Se):me(dr,{component:"span",sx:{color:"#9a9a97"},children:"\uC790\uB3D9"})}):null]}),trailing:Hn(Ji,{children:[!i&&!f&&!(it&&Le==="involved")?me(be,{icon:Le==="all"?me(px,{sx:{fontSize:17,color:"#2f80ed"}}):Le==="group"?me(fx,{sx:{fontSize:17,color:"#d9730d"}}):me(dx,{sx:{fontSize:17}}),label:"\uACF5\uAC1C",onClick:N=>jt(N),sx:D||!$t?void 0:dt(1),children:Le==="all"?"\uC804\uCCB4\uACF5\uAC1C":Le==="group"?`\uBD80\uC11C\uACF5\uAC1C \xB7 ${I.find(N=>N.seq===Ue)?.name??"\uBD80\uC11C"}`:"\uBE44\uACF5\uAC1C"}):null,re&&!D&&!i&&!p&&!(it&&A===0&&G===0)?Hn(Ji,{children:[me(be,{icon:me(TD,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:N=>ke(N),sx:$t?dt(1):void 0,children:A>0?se.find(N=>N.seq===A)?.name??"\uC0AD\uC81C\uB41C \uBAA9\uD45C":me(dr,{component:"span",sx:{color:"#9a9a97"},children:"\uBBF8\uBC30\uC815"})}),me(be,{icon:me(CD,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",sx:$t?dt(1):void 0,children:me(mr,{value:G>0?String(G):"",placeholder:"\uBBF8\uCD94\uC815",onCommit:N=>e.setFormValue("story_points",Number(N.replace(/[^0-9.]/g,""))||0)})})]}):null,S?me(Gs,{values:{repro:F,device:Q,where:X,version:ae},onChangeRepro:N=>e.setFormValue("bug_repro",N),onChangeDevice:N=>e.setFormValue("bug_device",N),onChangeWhere:N=>e.setFormValue("bug_where",N),onChangeVersion:N=>e.setFormValue("bug_version",N)}):null]}),leading:D||c?null:me(dr,{sx:{gridColumn:"1 / -1"},children:me(be,{icon:me(kD,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:N=>De(N),children:(Je??[]).length>0?me(Rr,{labelKeys:Je??[],labelOptions:t}):me(dr,{component:"span",sx:{color:"#9a9a97"},children:"\uBE44\uC5B4 \uC788\uC74C"})})})}),wt?Hn(ux,{onClick:vn,"aria-expanded":ht,sx:{alignSelf:"flex-start",display:"flex",alignItems:"center",gap:.5,minHeight:32,mx:2,pr:1,borderRadius:1,fontSize:14,color:"#2563eb","&:hover":{bgcolor:"#f2f2f0"}},children:[ht?me(fD,{sx:{fontSize:17}}):me(gD,{sx:{fontSize:17}}),ht?"\uD56D\uBAA9 \uC811\uAE30":"\uD56D\uBAA9 \uB354 \uBCF4\uAE30"]}):null,me(al,{sx:{my:1.5,borderColor:"#e6e6e3"}}),me(Oo,{icon:me(bD,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",titleExtra:H?me(Zs,{content:xe,templates:H,onApply:N=>e.setFormValue("content",N),onSave:P,onRemove:T}):void 0,children:me(js,{syncKey:_,value:xe,onChange:N=>e.setFormValue("content",N)})}),S||p||it&&!we?null:Hn(Ji,{children:[me(al,{sx:{my:1.5,borderColor:"#e6e6e3"}}),me(Oo,{icon:me(hD,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:me(BD,{form:e,name:"note",placeholder:"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",sx:{mt:1}})})]}),D||p||it&&ne.length===0?null:me(al,{sx:{my:1.5,borderColor:"#e6e6e3"}}),D||p||it&&ne.length===0?null:me(tc,{taskSeq:0,checklist:ne,onAdd:(N,$)=>Tm(e,$),onToggle:(N,$,j)=>ym(e,$,j),onRemove:(N,$)=>Sm(e,$),onUpdate:(N,$,j)=>Cm(e,$,j)}),d?null:Hn(Ji,{children:[me(al,{sx:{my:1.5,borderColor:"#e6e6e3"}}),me(rc,{taskSeq:0,attachments:Nt.map(N=>({name:N.name,size:N.size})),onAdd:(N,$)=>Bm(h,$,y),onRemove:(N,$)=>vm(h,$)})]})]}),me(Ju,{transitionDuration:0,anchorEl:ve,open:!!ve,onClose:()=>ke(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...se.map(N=>({seq:N.seq,label:tn(N)}))].map(N=>me(ed,{onClick:()=>{e.setFormValue("sprint_seq",N.seq),ke(null)},sx:{fontSize:14,minWidth:170},children:N.label},N.seq))}),me(Ju,{transitionDuration:0,anchorEl:Ee,open:!!Ee,onClose:()=>Ft(null),children:[{value:"",label:"\uC5C6\uC74C"},...Oa].map(N=>me(ed,{selected:Y===N.value,onClick:()=>{Ft(null),hm(e,N.value)},sx:{fontSize:14,minWidth:140},children:N.label},N.value||"none"))}),me(vD,{anchorEl:Kn,open:!!Kn,onClose:()=>lo(null),selectedDate:Se?new Date(`${Se}T00:00:00`):new Date,onDateChange:N=>{km(e,N),lo(null)}}),me(Ju,{transitionDuration:0,anchorEl:ao,open:!!ao,onClose:()=>jt(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:me(dx,{sx:{fontSize:17,color:"#57564f"}}),selected:Le==="involved",onPick:()=>Aa(e,"involved")},{key:"all",label:"\uC804\uCCB4\uACF5\uAC1C",tip:"\uBAA8\uB4E0 \uC9C1\uC6D0\uC774 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4",icon:me(px,{sx:{fontSize:17,color:"#2f80ed"}}),selected:Le==="all",onPick:()=>Aa(e,"all")},...[...I].sort((N,$)=>N.seq===k?-1:$.seq===k?1:0).map(N=>({key:`group-${N.seq}`,label:`\uBD80\uC11C\uACF5\uAC1C \xB7 ${N.name}`,tip:`${N.name}(\uD558\uC704 \uBD80\uC11C \uD3EC\uD568) \uC9C1\uC6D0\uC774 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4`,icon:me(fx,{sx:{fontSize:17,color:"#d9730d"}}),selected:Le==="group"&&Ue===N.seq,onPick:()=>Aa(e,"group",N.seq)}))].map(N=>me(xD,{title:N.tip,arrow:!0,disableInteractive:!0,placement:"right",children:Hn(ed,{selected:N.selected,onClick:()=>{N.onPick(),jt(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[N.icon,N.label]})},N.key))}),me(ac,{anchorEl:ze,selectedKeys:Je??[],labelOptions:t,onToggle:N=>e.setFormValue("label_keys",ns(Je??[],N)),onAddLabel:(N,$)=>v?.(N,$),onClose:()=>De(null)})]})}import{Fragment as hx,jsx as ft,jsxs as ll}from"react/jsx-runtime";var qD={gap:"0.75rem !important","& .left-actions, & .right-actions":{display:"contents"},"& .left-actions > span:empty":{display:"none"},"& .left-actions:not(:has(*:not(:empty)))":{display:"none"},"& .left-actions .MuiButton-root, & .right-actions .MuiButton-root":{flex:"1 1 0",minWidth:0,margin:"0 !important",paddingLeft:"8px !important",paddingRight:"8px !important",whiteSpace:"nowrap"},"& .right-actions .MuiButton-text":{border:"1px solid rgba(0, 0, 0, 0.23)"},"& .right-actions .MuiButton-contained":{border:"1px solid transparent"}};function kx({open:e,onClose:t,desktopPresentation:o="drawer",submitLabel:r,...n}){let{form:i,presetTitle:a="",presetContent:l="",presetVisibility:s,presetVisibilityGroupSeq:m=0,presetDueDate:c="",presetTabKey:u="",presetManager:f=null,isNotice:d=!1,defaultBug:p=!1}=n,x=pn(),g=wD(!1),[w,b]=xx(0),I=i.useFormValue("title"),k=i.useFormValue("icon"),L=i.useFormValue("icon_color"),B=!!i.useFormValue("is_event"),v=!!i.useFormValue("is_bug"),_=Fe(),P=x.useValue("createSubmitting")??!1,T=d||B?Re(k||(d?Tt:Ot)):null,h=d?"\uACF5\uC9C0 \uB4F1\uB85D":B?"\uC77C\uC815 \uB4F1\uB85D":v?"\uC624\uB958 \uB4F1\uB85D":"\uC5C5\uBB34 \uB4F1\uB85D",y=d?"\uACF5\uC9C0 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":B?"\uC77C\uC815 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":v?"\uC5B4\uB5A4 \uC624\uB958\uC778\uC9C0 \uD55C \uC904\uB85C \uC801\uC5B4\uC8FC\uC138\uC694":"\uC5C5\uBB34 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694";ID(()=>{let S=g.current;g.current=e,!(!e||S)&&(xm(i,x,{presetTitle:a,presetContent:l,presetVisibility:s,presetVisibilityGroupSeq:m,presetDueDate:c,presetTabKey:u,presetManager:f,isNotice:d,defaultBug:p}),b(F=>F+1))},[e]);let[C,R]=xx(null),z=S=>T?B?ft(PD,{title:"\uC544\uC774\uCF58 \uBCC0\uACBD",arrow:!0,enterDelay:400,disableInteractive:!0,children:ft(DD,{onClick:F=>R(F.currentTarget),sx:{display:"flex",p:.5,borderRadius:1,color:L||"#1e3a8a","&:hover":{bgcolor:"#f2f2f0"}},children:ft(T,{sx:{fontSize:20}})})}):ft(pr,{sx:[{display:"flex",color:L||"#1e3a8a"},S],children:ft(T,{sx:{fontSize:20}})}):null,D=ll(pr,{sx:{display:"flex",alignItems:"center",gap:1,px:2,pt:2,pb:1},children:[z({p:0}),ft(pr,{component:"input",autoFocus:!0,spellCheck:!1,value:I,placeholder:y,onChange:S=>i.setFormValue("title",S.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 _||o==="dialog"?ft(hx,{children:ft(AD,{open:e,onClose:t,backdropClick:!1,locale:"ko",fontScale:_?{enabled:!0,default:1.1,min:.6}:{enabled:!0},title:h,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fullScreen:_,mobilePresentation:_?"slide":"dialog",maxWidth:"md",actions:{showCancelButton:!0,right:ft(od,{variant:"contained",disableElevation:!0,disabled:P,onClick:P?void 0:i.submit,children:P?"\uC800\uC7A5 \uC911\u2026":r??"\uC800\uC7A5\uD558\uAE30"})},dialogActionSx:_?qD:void 0,tabs:{visible:!1},contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,contentBottomPadding:0,scrollPastLastSection:!1,overlayScrollbar:{enabled:!0,contentStyle:{minWidth:0}},sections:[{id:"task-create",title:"",showTitle:!1,children:ft(pr,{sx:{width:"100%",minWidth:0,display:"flex",flexDirection:"column",gap:0},children:ft(td,{...n,contentSyncKey:`create-${w}`,leadingRow:D})})}]})}):ll(hx,{children:[ft(RD,{anchor:"right",open:e,onClose:(S,F)=>{F!=="backdropClick"&&t()},"aria-label":"\uC0C8 \uC5C5\uBB34 \uB4F1\uB85D",sx:{zIndex:S=>S.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:ll(pr,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[ll(pr,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[z({px:.5}),ft(pr,{component:"input",autoFocus:!0,spellCheck:!1,value:I,placeholder:y,onChange:S=>i.setFormValue("title",S.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}}}),ft(ED,{"aria-label":"\uB2EB\uAE30",onClick:t,sx:{color:"#6b7280"},children:ft(MD,{})})]}),ft(bx,{sx:{borderColor:"#e6e6e3"}}),ft(pr,{sx:{flex:1,minHeight:0},children:ft(OD,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:ft(td,{...n,contentSyncKey:`create-${w}`})})}),ft(bx,{sx:{borderColor:"#e6e6e3"}}),ll(pr,{sx:{display:"flex",justifyContent:"flex-end",gap:.5,px:2,py:1.5,flexShrink:0},children:[ft(od,{onClick:t,color:"inherit",disabled:P,children:"\uCDE8\uC18C"}),ft(od,{onClick:i.submit,variant:"contained",disabled:P,children:P?"\uB4F1\uB85D \uC911\u2026":r??"\uB4F1\uB85D"})]})]})}),ft(Pr,{anchorEl:C,value:k,color:L,onSelect:S=>{i.setFormValue("icon",S),R(null)},onSelectColor:S=>i.setFormValue("icon_color",S),onClose:()=>R(null)})]})}import{useEffect as ab,useRef as lb,useState as sb}from"react";import{Box as hc,Button as NE,Divider as cb,Drawer as $E,IconButton as HE,ListItemIcon as yd,ListItemText as Sd,Menu as WE,MenuItem as Cd}from"@mui/material";import VE from"@mui/icons-material/MoreVert";import UE from"@mui/icons-material/DeleteOutline";import KE from"@mui/icons-material/ShareOutlined";import GE from"@mui/icons-material/HistoryOutlined";import YE from"@ehfuse/overlay-scrollbar";import{FormDialog as jE}from"@ehfuse/mui-form-dialog";import{useRef as ad,useState as hi}from"react";import{Box as he,Button as _x,Chip as mc,IconButton as Ko,Tooltip as Px}from"@mui/material";import Ix from"@mui/icons-material/Send";import{TextField as YD}from"@ehfuse/mui-form-controls";import uc from"@mui/icons-material/Close";import jD from"@mui/icons-material/EditOutlined";import wx from"@mui/icons-material/ContentCopyOutlined";import Dx from"@mui/icons-material/Check";import XD from"@mui/icons-material/Favorite";import QD from"@mui/icons-material/FavoriteBorderOutlined";import ZD from"@mui/icons-material/CheckCircle";import JD from"@mui/icons-material/CheckCircleOutlineOutlined";import ta from"@mui/icons-material/AttachFileOutlined";import eR from"@mui/icons-material/AddCircleOutline";import tR from"@mui/icons-material/ImageOutlined";var nd=e=>{if(e===0)return"0 Bytes";let t=1024,o=["Bytes","KB","MB","GB","TB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(2))+" "+o[r]};import{useCallback as sc,useEffect as zD,useMemo as LD,useRef as FD,useState as rd}from"react";import{Box as cc,Paper as ND,Popper as $D}from"@mui/material";import{jsx as ea,jsxs as WD}from"react/jsx-runtime";var Tx=8,HD=[{key:"\uC88B\uC544\uC694",label:"\uC88B\uC544\uC694",insert:"\u{1F44D}",keywords:["like","\uC5C4\uC9C0","\uAD7F"]},{key:"\uD655\uC778",label:"\uD655\uC778",insert:"\u2705",keywords:["check","\uC644\uB8CC","\uCCB4\uD06C"]},{key:"\uAC10\uC0AC",label:"\uAC10\uC0AC",insert:"\u{1F64F}",keywords:["thanks","\uACE0\uB9C8\uC6CC","\uBD80\uD0C1"]},{key:"\uCD95\uD558",label:"\uCD95\uD558",insert:"\u{1F389}",keywords:["party","\uD30C\uD2F0","\uC9DD\uC9DD"]},{key:"\uBC15\uC218",label:"\uBC15\uC218",insert:"\u{1F44F}",keywords:["clap","\uC798\uD588\uC5B4"]},{key:"\uD558\uD2B8",label:"\uD558\uD2B8",insert:"\u2764\uFE0F",keywords:["heart","\uC0AC\uB791"]},{key:"\uC6C3\uC74C",label:"\uC6C3\uC74C",insert:"\u{1F604}",keywords:["smile","\uC6C3\uAE40","\u314B\u314B"]},{key:"\uBBF8\uC18C",label:"\uBBF8\uC18C",insert:"\u{1F642}",keywords:["smile","\uC88B\uC74C"]},{key:"\uB208\uBB3C",label:"\uB208\uBB3C",insert:"\u{1F622}",keywords:["sad","\uC2AC\uD514","\u3160\u3160"]},{key:"\uB180\uB78C",label:"\uB180\uB78C",insert:"\u{1F62E}",keywords:["wow","\uD5C9"]},{key:"\uACE0\uBBFC",label:"\uACE0\uBBFC",insert:"\u{1F914}",keywords:["think","\uC0DD\uAC01","\uC74C"]},{key:"\uC624\uCF00\uC774",label:"\uC624\uCF00\uC774",insert:"\u{1F44C}",keywords:["ok","\uC54C\uACA0\uC5B4"]},{key:"\uBD88",label:"\uBD88",insert:"\u{1F525}",keywords:["fire","\uAE09\uD568","\uB300\uBC15"]},{key:"\uC544\uC774\uB514\uC5B4",label:"\uC544\uC774\uB514\uC5B4",insert:"\u{1F4A1}",keywords:["idea","\uC804\uAD6C"]},{key:"\uACBD\uACE0",label:"\uACBD\uACE0",insert:"\u26A0\uFE0F",keywords:["warning","\uC8FC\uC758"]},{key:"\uC9C8\uBB38",label:"\uC9C8\uBB38",insert:"\u2753",keywords:["question","\uBB3C\uC74C"]},{key:"\uC2DC\uACC4",label:"\uC2DC\uACC4",insert:"\u23F0",keywords:["time","\uC2DC\uAC04","\uC54C\uB78C"]},{key:"\uB2EC\uB825",label:"\uB2EC\uB825",insert:"\u{1F4C5}",keywords:["calendar","\uC77C\uC815","\uB0A0\uC9DC"]},{key:"\uBA54\uBAA8",label:"\uBA54\uBAA8",insert:"\u{1F4DD}",keywords:["note","\uAE30\uB85D"]},{key:"\uCCA8\uBD80",label:"\uCCA8\uBD80",insert:"\u{1F4CE}",keywords:["attach","\uD074\uB9BD","\uD30C\uC77C"]},{key:"\uB9C1\uD06C",label:"\uB9C1\uD06C",insert:"\u{1F517}",keywords:["link","\uC8FC\uC18C"]},{key:"\uB85C\uCF13",label:"\uB85C\uCF13",insert:"\u{1F680}",keywords:["rocket","\uCD9C\uBC1C","\uBC30\uD3EC"]},{key:"\uBCC4",label:"\uBCC4",insert:"\u2B50",keywords:["star","\uC911\uC694"]},{key:"\uC5D1\uC2A4",label:"\uC5D1\uC2A4",insert:"\u274C",keywords:["x","\uC548\uB428","\uCDE8\uC18C"]}];function yx(e,t,o){let r=e.slice(0,t),i=(o==="@"?/(^|[\s(])@([^\s@]{0,20})$/:/(^|[\s(])\/([^\s/]{0,20})$/).exec(r);return i?{start:t-i[2].length-1,query:i[2]}:null}function Sx({value:e,setValue:t,candidates:o,slashCommands:r}){let n=le(),i=o??n.mentionCandidates??[],a=r??n.slashCommands,l=a===!0?HD:Array.isArray(a)?a:[],s=FD(null),[m,c]=rd(null),[u,f]=rd(null),[d,p]=rd(0),x=i.length>0||l.length>0,g=LD(()=>{if(!u)return[];let v=u.query.toLowerCase();return u.trigger==="@"?i.filter(_=>_.name.toLowerCase().includes(v)).slice(0,Tx).map((_,H)=>({id:`p${H}-${_.name}`,text:`@${_.name} `,label:_.name,subtitle:_.subtitle,icon:ea(mo,{src:_.avatar??"",name:_.name,avatarSx:{width:24,height:24,fontSize:14},iconFontSize:16})})):l.filter(_=>[_.key,_.label,..._.keywords??[]].some(H=>H.toLowerCase().includes(v))).slice(0,Tx).map(_=>({id:`c-${_.key}`,text:_.insert,label:`/${_.label}`,icon:ea(cc,{component:"span",sx:{width:24,textAlign:"center",fontSize:18,lineHeight:1},children:_.insert})}))},[l,i,u]),w=!!(m&&u&&g.length>0),b=sc(()=>{let v=s.current;if(!x||!v)return;let _=v.selectionStart??v.value.length,H=i.length>0?yx(v.value,_,"@"):null,P=!H&&l.length>0?yx(v.value,_,"/"):null,T=H?{...H,trigger:"@"}:P?{...P,trigger:"/"}:null;f(T),p(0),c(T?v.closest(".MuiInputBase-root")??v:null)},[l.length,x,i.length]);zD(()=>{document.activeElement===s.current&&b()},[e,b]);let I=sc(v=>{let _=s.current;if(!u||!_)return;let H=_.selectionStart??e.length,P=e.slice(0,u.start)+v.text+e.slice(H);t(P),f(null),c(null);let T=u.start+v.text.length;requestAnimationFrame(()=>{_.focus(),_.setSelectionRange(T,T)})},[u,t,e]),k=sc(v=>!w||v.nativeEvent.isComposing?!1:v.key==="ArrowDown"||v.key==="ArrowUp"?(v.preventDefault(),p(_=>(_+(v.key==="ArrowDown"?1:g.length-1))%g.length),!0):v.key==="Enter"||v.key==="Tab"?(v.preventDefault(),I(g[Math.min(d,g.length-1)]),!0):v.key==="Escape"?(v.preventDefault(),v.stopPropagation(),f(null),c(null),!0):!1,[d,g,w,I]),L=sc(v=>{s.current=v},[]),B=x?ea($D,{open:w,anchorEl:m,placement:"top-start",sx:{zIndex:1500},children:ea(ND,{elevation:4,sx:{minWidth:220,maxWidth:320,py:.5,borderRadius:1.5},children:g.map((v,_)=>WD(cc,{role:"option","aria-selected":_===d,onMouseDown:H=>H.preventDefault(),onClick:()=>I(v),onMouseEnter:()=>p(_),sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:.75,cursor:"pointer",fontSize:14,bgcolor:_===d?"action.selected":"transparent"},children:[v.icon,ea(cc,{component:"span",sx:{fontWeight:500,whiteSpace:"nowrap"},children:v.label}),v.subtitle?ea(cc,{component:"span",sx:{color:"text.secondary",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:v.subtitle}):null]},v.id))})}):null;return{inputRef:L,onKeyDown:k,onSelectionChange:b,popper:B}}import{ConfirmActionPopper as oR}from"@ehfuse/mui-confirm-action";import{Box as Bx}from"@mui/material";import{Fragment as GD,jsx as id}from"react/jsx-runtime";var VD=/https?:\/\/[^\s<>"']+/g;function UD(e){let t=e,o="";for(;;){let r=t.slice(-1);if(r===")"&&(t.match(/\(/g)??[]).length<(t.match(/\)/g)??[]).length){t=t.slice(0,-1),o=r+o;continue}if(".,;:!?]}".includes(r)&&r!==""){t=t.slice(0,-1),o=r+o;continue}break}return[t,o]}var KD=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");function Cx(e,t,o="m"){let r=[...new Set(t.filter(l=>l.trim().length>=2))].sort((l,s)=>s.length-l.length);if(r.length===0||!e.includes("@"))return[e];let n=new RegExp(`(^|[^A-Za-z0-9._%+-])(@(?:${r.map(KD).join("|")}))`,"g"),i=[],a=0;for(let l of e.matchAll(n)){let s=(l.index??0)+l[1].length;s>a&&i.push(e.slice(a,s)),i.push(id(Bx,{component:"span",sx:{color:"#2563eb",fontWeight:600},children:l[2]},`${o}-${s}`)),a=s+l[2].length}return a<e.length&&i.push(e.slice(a)),i}function vx({text:e}){let{openExternalUrl:t,mentionCandidates:o}=le(),r=(o??[]).map(l=>l.name),n=l=>{t?t(l):window.open(l,"_blank","noopener,noreferrer")},i=[],a=0;for(let l of e.matchAll(VD)){let s=l.index??0,[m,c]=UD(l[0]);s>a&&i.push(...Cx(e.slice(a,s),r,`m${a}`)),i.push(id(Bx,{component:"a",href:m,onClick:u=>{u.preventDefault(),u.stopPropagation(),n(m)},sx:{color:"#2563eb",textDecoration:"underline",wordBreak:"break-all",cursor:"pointer"},children:m},`${s}-${m}`)),c&&i.push(c),a=s+l[0].length}return a<e.length&&i.push(...Cx(e.slice(a),r,`m${a}`)),id(GD,{children:i})}import{Fragment as Ex,jsx as ee,jsxs as gt}from"react/jsx-runtime";var nR=5;function Rx({kind:e,reactions:t,myAccountSeq:o,onToggle:r}){let n=t??[],i=o>0&&n.some(m=>m.account_seq===o),a=e==="like"?"\uC88B\uC544\uC694":"\uD655\uC778",l=n.length===0?a:ee(he,{sx:{whiteSpace:"pre-line",fontSize:12},children:n.map(m=>`${m.name} \xB7 ${m.time}`).join(`
|
|
11
11
|
`)}),s=e==="like"?"#e5484d":"#2f80ed";return ee(Px,{title:l,arrow:!0,enterDelay:300,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:gt(he,{sx:{display:"inline-flex",alignItems:"center"},children:[ee(Ko,{size:"small","aria-label":`\uB313\uAE00 ${a}`,onClick:r,sx:{color:i?s:"#c9c8c5",p:.5},children:e==="like"?i?ee(XD,{sx:{fontSize:16}}):ee(QD,{sx:{fontSize:16}}):i?ee(ZD,{sx:{fontSize:16}}):ee(JD,{sx:{fontSize:16}})}),n.length>0?ee(he,{component:"span",sx:{fontSize:12,color:i?s:"#9a9a97",ml:-.25},children:n.length}):null]})})}function Mx({taskSeq:e,comments:t,currentUserName:o="",myAccountSeq:r=0,avatarSrcByName:n,onUpdate:i,onRemove:a,onToggleReaction:l,onPreview:s,onDownload:m}){let[c,u]=hi(null),f=ad(null),[d,p]=hi(null),x=Fe(),[g,w]=hi(null),b=(y,C)=>{navigator.clipboard.writeText(C).then(()=>{w(y),setTimeout(()=>w(R=>R===y?null:R),1500)})},[I,k]=hi(!1),L=Math.max(0,t.length-nR),B=L>0&&!I,v=c?Math.min(c.index,L):L,_=t.map((y,C)=>({comment:y,index:C})).slice(B?v:0),H=Ia(),P=(y,C)=>{if(s){s(y,C&&C.length>1?C:void 0);return}window.open(H(y.uuid??""),"_blank","noopener,noreferrer")},T=y=>{if(m){m(y);return}window.open(H(y.uuid??"",{download:!0}),"_blank","noopener,noreferrer")},h=le().slots?.avatar;return gt(he,{className:"taskbox-comments",sx:{px:2,pb:2,display:"flex",flexDirection:"column",gap:.25},children:[gt(he,{sx:{display:"flex",alignItems:"center",gap:1},children:[ee(qr,{sx:{fontSize:18,display:"block",color:"#37352f"}}),gt(he,{sx:{fontSize:$u,fontWeight:500,color:"#37352f"},children:["\uB313\uAE00",t.length>0?` (${t.length})`:""]}),L>0&&(!B||v>0)?ee(he,{role:"button",tabIndex:0,onClick:()=>k(y=>!y),onKeyDown:y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),k(C=>!C))},sx:{ml:"auto",flexShrink:0,cursor:"pointer",fontSize:14.5,color:"#5b87d6","&:hover":{textDecoration:"underline"}},children:B?`\uC774\uC804 \uB313\uAE00 ${v}\uAC1C \uB354 \uBCF4\uAE30`:"\uC774\uC804 \uB313\uAE00 \uC811\uAE30"}):null]}),t.length===0?ee(he,{sx:{mt:1,fontSize:14.5,color:"#9a9a97"},children:"\uB4F1\uB85D\uB41C \uB313\uAE00\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,ee(he,{sx:{display:"flex",flexDirection:"column",gap:1,mt:1},children:_.map(({comment:y,index:C})=>{let R=!!o&&y.author===o,z=ee(he,{component:"span",sx:{fontSize:14.5,fontWeight:700,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:y.author}),D=y.external?ee(he,{component:"span",sx:{flexShrink:0,px:.6,fontSize:11.5,fontWeight:500,lineHeight:"18px",color:"#d9730d",bgcolor:"#fdf0e6",borderRadius:"4px",whiteSpace:"nowrap"},children:"\uAC00\uB9F9\uC810"}):null;return gt(he,{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 S=n?.get(y.author)??"";return h?ee(he,{sx:{display:"inline-flex",flexShrink:0},children:ee(h,{name:y.author,src:S||void 0,size:44})}):ee(he,{sx:{display:"inline-flex",flexShrink:0},children:ee(mo,{src:S,name:y.author,avatarSx:{width:44,height:44,fontSize:20,borderRadius:"50%",...Mr[0]},iconFontSize:24})})})(),gt(he,{sx:{flex:1,minWidth:0},children:[x?gt(he,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0},children:[z,D]}):null,gt(he,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0,position:"relative"},children:[x?null:z,x?null:D,ee(he,{component:"span",sx:{fontSize:12.5,color:"#9a9a97",flexShrink:0,whiteSpace:"nowrap"},children:y.time}),R?ee(he,{sx:{ml:"auto"}}):gt(he,{sx:{display:"flex",alignItems:"center",gap:.25,ml:"auto",flexShrink:0},children:[ee(Ko,{size:"small","aria-label":"\uB313\uAE00 \uBCF5\uC0AC",onClick:()=>b(C,y.text),sx:{color:g===C?"#2f9e5b":"#9a9a97",p:.5},children:g===C?ee(Dx,{sx:{fontSize:15}}):ee(wx,{sx:{fontSize:15}})}),ee(Rx,{kind:"like",reactions:y.likes,myAccountSeq:r,onToggle:()=>l?.(e,C,"like")}),ee(Rx,{kind:"ack",reactions:y.acks,myAccountSeq:r,onToggle:()=>l?.(e,C,"ack")})]}),R?gt(he,{className:"taskbox-comment-actions",sx:{display:"flex",alignItems:"center",gap:.25,position:"absolute",right:0,top:"50%",transform:"translateY(-50%)",pointerEvents:x?"auto":"none",backgroundColor:"#fff",opacity:x?1:0,transition:"opacity 0.15s"},children:[ee(Ko,{size:"small","aria-label":"\uB313\uAE00 \uBCF5\uC0AC",onClick:()=>b(C,y.text),sx:{color:g===C?"#2f9e5b":"#9a9a97"},children:g===C?ee(Dx,{sx:{fontSize:15}}):ee(wx,{sx:{fontSize:15}})}),ee(Ko,{size:"small","aria-label":"\uB313\uAE00 \uC218\uC815",onClick:()=>u({index:C,text:y.text,attachments:[...y.attachments??[]],files:[]}),sx:{color:"#9a9a97"},children:ee(jD,{sx:{fontSize:15}})}),ee(Ko,{size:"small","aria-label":"\uB313\uAE00 \uC0AD\uC81C",onClick:S=>p({anchorEl:S.currentTarget,index:C}),sx:{color:"#9a9a97"},children:ee(uc,{sx:{fontSize:15}})})]}):null]}),c?.index===C?gt(he,{sx:{mt:.5},children:[ee(he,{component:"textarea",autoFocus:!0,spellCheck:!1,value:c.text,onChange:S=>u({...c,text:S.target.value}),sx:{width:"100%",minHeight:56,border:"1px solid #dedddb",borderRadius:1,outline:"none",font:"inherit",fontSize:14,p:1,resize:"vertical"}}),gt(he,{sx:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:.75,mt:.75},children:[c.attachments.map((S,F)=>{let Q=()=>u({...c,attachments:c.attachments.filter((X,ae)=>ae!==F)});return sl(S.name)&&S.uuid?gt(he,{sx:{position:"relative"},children:[ee(he,{component:"img",src:H(S.uuid,{thumb:"md"}),alt:S.name,title:S.name,loading:"lazy",sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",display:"block"}}),ee(Ko,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:Q,sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:ee(uc,{sx:{fontSize:14}})})]},`kept-${S.uuid}-${F}`):ee(mc,{size:"small",icon:ee(ta,{sx:{fontSize:14}}),label:S.name,onDelete:Q,sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`kept-${S.uuid??S.name}-${F}`)}),c.files.map((S,F)=>{let Q=()=>u({...c,files:c.files.filter((X,ae)=>ae!==F)});return sl(S.name)?gt(he,{sx:{position:"relative"},children:[ee(he,{component:"img",src:URL.createObjectURL(S),alt:S.name,title:`${S.name} (\uC0C8 \uD30C\uC77C)`,onLoad:X=>URL.revokeObjectURL(X.target.src),sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"2px solid #2f80ed",display:"block"}}),ee(Ko,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:Q,sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:ee(uc,{sx:{fontSize:14}})})]},`new-${S.name}-${F}`):ee(mc,{size:"small",icon:ee(ta,{sx:{fontSize:14}}),label:`${S.name} (\uC0C8 \uD30C\uC77C)`,onDelete:Q,sx:{fontSize:14,height:26,bgcolor:"#eef4ff"}},`new-${S.name}-${F}`)}),ee(Px,{title:"\uCCA8\uBD80 \uCD94\uAC00",arrow:!0,children:ee(Ko,{size:"small","aria-label":"\uCCA8\uBD80 \uCD94\uAC00",onClick:()=>f.current?.click(),sx:{ml:"auto",color:"#2f80ed"},children:ee(eR,{sx:{fontSize:20}})})})]}),gt(he,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:.75,mt:.5},children:[ee(_x,{size:"small",color:"inherit",onClick:()=>u(null),children:"\uCDE8\uC18C"}),ee(_x,{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}),u(null)},children:"\uC800\uC7A5"})]}),ee(he,{component:"input",type:"file",multiple:!0,ref:f,sx:{display:"none"},onChange:S=>{let F=Array.from(S.target.files??[]);F.length>0&&u({...c,files:[...c.files,...F].slice(0,10)}),S.target.value=""}})]}):gt(he,{children:[y.text?ee(he,{sx:{fontSize:15,whiteSpace:"pre-wrap"},children:ee(vx,{text:y.text})}):null,(y.attachments??[]).length>0?ee(he,{sx:{display:"flex",flexWrap:"wrap",gap:.75,mt:.75},children:(y.attachments??[]).map((S,F)=>{let Q=!!S.uuid,X=sl(S.name),ae=(y.attachments??[]).filter(Be=>!!Be.uuid&&sl(Be.name));if(X&&Q)return ee(he,{component:"img",src:H(S.uuid??"",{thumb:"md"}),alt:S.name,title:`${S.name} \uD06C\uAC8C \uBCF4\uAE30`,loading:"lazy",onClick:()=>P(S,ae),sx:{width:96,height:96,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",cursor:"pointer",bgcolor:"#f8fafc"}},`${S.name}-${F}`);let oe=oc(S.name);return ee(mc,{size:"small",icon:ee(ta,{sx:{fontSize:14}}),label:`${S.name} (${nd(S.size)})`,clickable:Q,onClick:Q?()=>oe?P(S):T(S):void 0,title:Q?`${S.name} ${oe?"\uBBF8\uB9AC\uBCF4\uAE30":"\uB2E4\uC6B4\uB85C\uB4DC"}`:S.name,sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`${S.name}-${F}`)})}):null]})]})]},`${y.time}-${C}`)})}),ee(oR,{open:!!d,anchorEl:d?.anchorEl??null,title:"\uC774 \uB313\uAE00\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uC0AD\uC81C",onCancel:()=>p(null),onConfirm:()=>{d&&(a(e,d.index),u(null)),p(null)}})]})}function sl(e){return/\.(png|jpe?g|gif|webp|bmp|svg|heic|heif)$/i.test(String(e??"").trim())}function Ox({onSubmit:e,rows:t=2}){let[o,r]=hi(""),n=Sx({value:o,setValue:r}),[i,a]=hi([]),[l,s]=hi(!1),m=ad(null),c=ad(null),f=Fe()||t===1,d=g=>{let w=Array.from(g??[]);w.length!==0&&a(b=>[...b,...w].slice(0,10))},p=()=>{let g=o.trim();!g&&i.length===0||(e(g,i.length>0?i:void 0),r(""),a([]))},x=gt(Ex,{children:[ee(Ko,{size:"small","aria-label":"\uD30C\uC77C \uCCA8\uBD80",onClick:()=>m.current?.click(),sx:{color:"#9a9a97"},children:ee(ta,{sx:{fontSize:20}})}),ee(Ko,{size:"small","aria-label":"\uC774\uBBF8\uC9C0 \uCCA8\uBD80",onClick:()=>c.current?.click(),sx:{color:"#9a9a97"},children:ee(tR,{sx:{fontSize:20}})})]});return gt(he,{children:[i.length>0?ee(he,{sx:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:1.5,px:2,pt:2},children:i.map((g,w)=>sl(g.name)?gt(he,{sx:{position:"relative"},children:[ee(he,{component:"img",src:URL.createObjectURL(g),alt:g.name,title:g.name,onLoad:b=>URL.revokeObjectURL(b.target.src),sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",display:"block"}}),ee(Ko,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:()=>a(b=>b.filter((I,k)=>k!==w)),sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:ee(uc,{sx:{fontSize:14}})})]},`${g.name}-${w}`):ee(mc,{size:"small",icon:ee(ta,{sx:{fontSize:14}}),label:`${g.name} (${nd(g.size)})`,onDelete:()=>a(b=>b.filter((I,k)=>k!==w)),sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`${g.name}-${w}`))}):null,gt(he,{sx:{position:"relative",display:"flex"},onDragOver:g=>{Array.from(g.dataTransfer?.types??[]).includes("Files")&&(g.preventDefault(),s(!0))},onDragLeave:g=>{g.currentTarget.contains(g.relatedTarget)||s(!1)},onDrop:g=>{Array.from(g.dataTransfer?.types??[]).includes("Files")&&(g.preventDefault(),s(!1),d(g.dataTransfer?.files??null))},children:[l?gt(he,{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:[ee(ta,{sx:{fontSize:18}}),"\uC5EC\uAE30\uC5D0 \uB193\uC73C\uBA74 \uCCA8\uBD80\uB429\uB2C8\uB2E4"]}):null,ee(YD,{value:o,placeholder:"\uB313\uAE00\uC744 \uC785\uB825\uD558\uC138\uC694",onChange:g=>r(g.target.value),inputRef:n.inputRef,onSelect:n.onSelectionChange,onKeyDown:g=>{n.onKeyDown(g)},onPaste:g=>{Array.from(g.clipboardData?.files??[]).length!==0&&(g.preventDefault(),d(g.clipboardData.files))},fullWidth:!0,multiline:!0,minRows:f?1:t,maxRows:3,sx:{"& .MuiInputBase-root":{pl:2,pr:f?15:6.5,pb:f?void 0:5,borderRadius:0},"& .MuiOutlinedInput-notchedOutline":{border:"none"}}}),n.popper,f?gt(he,{sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",gap:.25},children:[x,ee(Ko,{"aria-label":"\uB313\uAE00 \uB4F1\uB85D",disabled:!o.trim()&&i.length===0,onClick:p,sx:{color:"#2563eb","&.Mui-disabled":{color:"#c9c8c5"}},children:ee(Ix,{sx:{fontSize:22}})})]}):gt(Ex,{children:[ee(he,{sx:{position:"absolute",left:8,bottom:6,display:"flex",alignItems:"center",gap:.25},children:x}),ee(Ko,{"aria-label":"\uB313\uAE00 \uB4F1\uB85D",disabled:!o.trim()&&i.length===0,onClick:p,sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",color:"#2563eb","&.Mui-disabled":{color:"#c9c8c5"}},children:ee(Ix,{sx:{fontSize:22}})})]})]}),ee(he,{component:"input",ref:m,type:"file",multiple:!0,onChange:g=>{d(g.target.files),g.target.value=""},sx:{display:"none"}}),ee(he,{component:"input",ref:c,type:"file",accept:"image/*",multiple:!0,onChange:g=>{d(g.target.files),g.target.value=""},sx:{display:"none"}})]})}import{useState as ml}from"react";import{Box as na,Button as gR,ButtonBase as xR,IconButton as ra,Tooltip as ia}from"@mui/material";import bR from"@mui/icons-material/Close";import hR from"@mui/icons-material/ArrowBack";import kR from"@mui/icons-material/ContentCopyOutlined";import TR from"@mui/icons-material/ShareOutlined";import yR from"@mui/icons-material/HistoryOutlined";import SR from"@mui/icons-material/Print";import{ConfirmActionPopper as CR}from"@ehfuse/mui-confirm-action";import{Box as fr,Button as aR,CircularProgress as lR}from"@mui/material";import{FormDialog as sR}from"@ehfuse/mui-form-dialog";import{OverlayScrollbar as cR}from"@ehfuse/overlay-scrollbar";import{useEffect as rR}from"react";import{useModal as iR}from"@ehfuse/forma";function cl({taskSeq:e,items:t,loading:o,onLoad:r}){let n={activity:iR({modalId:Ce("taskbox-task-activity")})},i=n.activity.isOpen;return rR(()=>{i&&e>0&&!t&&r?.(e)},[i,e,t,r]),{modals:n,items:t,loading:o,openDialog:()=>n.activity.open()}}import{jsx as gr,jsxs as dc}from"react/jsx-runtime";var mR={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",returned:"\uC644\uB8CC\uB97C \uB418\uB3CC\uB838\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 Ax(e){return String(e??"").trim()||"\uC5C6\uC74C"}function uR(e){if(e.kind!=="field")return mR[String(e.kind)]??"\uBCC0\uACBD\uD588\uC2B5\uB2C8\uB2E4";let t=String(e.field_label??e.field??"").trim()||"\uD56D\uBAA9",o=String(e.old_value??"").trim(),r=String(e.new_value??"").trim();return!o&&r?`${t}\uC744(\uB97C) "${r}"(\uC73C)\uB85C \uC785\uB825\uD588\uC2B5\uB2C8\uB2E4`:o&&!r?`${t}\uC744(\uB97C) \uBE44\uC6E0\uC2B5\uB2C8\uB2E4`:`${t}\uC744(\uB97C) "${Ax(o)}" \u2192 "${Ax(r)}" \uB85C \uBC14\uAFE8\uC2B5\uB2C8\uB2E4`}function pc({controller:e}){let t=Fe(),{items:o,loading:r}=e,n=e.modals.activity,i=gr(fr,{sx:{height:t?"100%":420,minHeight:0},children:gr(cR,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:dc(fr,{sx:{px:2,pt:2,display:"flex",flexDirection:"column",gap:1,"&::after":{content:'""',flexShrink:0,height:16}},children:[r&&!o?dc(fr,{sx:{display:"flex",alignItems:"center",gap:1,color:"#9a9a97",fontSize:14.5},children:[gr(lR,{size:14,thickness:5,sx:{color:"#9a9a97"}}),"\uBD88\uB7EC\uC624\uB294 \uC911\u2026"]}):null,o&&o.length===0?gr(fr,{sx:{fontSize:14.5,color:"#9a9a97"},children:"\uAE30\uB85D\uB41C \uD65C\uB3D9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,(o??[]).map(a=>dc(fr,{sx:{display:"flex",flexDirection:t?"column":"row",gap:t?.25:1,alignItems:t?"stretch":"baseline",minWidth:0,flexShrink:0,...t?{pb:1,borderBottom:"1px solid #ededeb","&:last-of-type":{borderBottom:"none",pb:0}}:{}},children:[gr(fr,{sx:{flexShrink:0,...t?{}:{width:"10.5em"},whiteSpace:"nowrap",fontSize:13.5,color:"#9a9a97",lineHeight:1.5},children:Ho(a.acted_time)}),dc(fr,{sx:{minWidth:0,fontSize:14.5,color:"#37352f",lineHeight:1.5},children:[gr(fr,{component:"span",sx:{fontWeight:500},children:String(a.actor_name??"").trim()||"\uC774\uB984\uC5C6\uC74C"}),gr(fr,{component:"span",sx:{ml:.5},children:uR(a)})]})]},a.seq))]})})});return gr(sR,{open:n.isOpen,onClose:n.close,maxWidth:"sm",fullScreen:t,mobilePresentation:t?"slide":"dialog",contentPaddingX:0,contentTopPadding:0,contentBottomPadding:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,sx:t?{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${o&&o.length>0?` (${o.length})`:""}`,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-task-activity",sections:[{id:"task-activity",showTitle:!1,children:i}],scrollPastLastSection:!1,actions:{showCancelButton:!1,right:gr(aR,{variant:"contained",onClick:n.close,children:"\uB2EB\uAE30"})}})}import{InfoAlert as dR,SuccessAlert as pR}from"@ehfuse/alerts";var qx=e=>e?e.replace(/<(script|style)[\s\S]*?<\/\1>/gi,"").replace(/<br\s*\/?>/gi,`
|
|
12
12
|
`).replace(/<\/(p|div|li|h[1-6]|tr)>/gi,`
|
|
13
13
|
`).replace(/<[^>]+>/g,"").replace(/ /gi," ").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&/gi,"&").replace(/\n{3,}/g,`
|