@ehfuse/taskbox 0.5.131 → 0.5.133
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 +2 -2
- 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.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
`).replace(/<\/(p|div|li|h[1-6]|blockquote)>/gi,`
|
|
4
4
|
`),t=document.createElement("div");return t.innerHTML=o,(t.textContent??"").replace(/\n{3,}/g,`
|
|
5
5
|
|
|
6
|
-
`).trim()}function xi({syncKey:e,value:o,onChange:t,readOnly:n=!1,minHeight:r=180,height:i=0,onChangeHeight:l}){let s=(0,lt.useRef)(null),p=(0,lt.useRef)(null),m=i>0?i:0,c=(0,lt.useRef)(m),x=(0,lt.useRef)(l);x.current=l;let f=(0,lt.useRef)(null),u=(0,lt.useRef)(Date.now()+800),[h,R]=(0,lt.useState)(!1),I=Ye();(0,lt.useEffect)(()=>{if(n)return;let g=Kl(o);f.current===g||f.current===o||(f.current=g,u.current=Date.now()+800,s.current?.setHtml(g))},[e,o,n]);let b=(0,lt.useRef)(-1);return(0,lt.useEffect)(()=>{if(n||I||i<=0||b.current===i||(b.current=i,Math.abs(i-c.current)<1))return;let g=p.current?.querySelector(".ehfuse-editor-container");g&&(Math.abs(g.getBoundingClientRect().height-i)<1||(g.style.height=`${i}px`,c.current=i))},[n,I,i]),(0,lt.useEffect)(()=>{if(n||I)return;let g=p.current?.querySelector(".ehfuse-editor-container");if(!g||typeof ResizeObserver>"u")return;let C,B=new ResizeObserver(M=>{let S=Math.round(M[0]?.contentRect.height??0);S<=0||(window.clearTimeout(C),C=window.setTimeout(()=>{Math.abs(S-c.current)<1||(c.current=S,x.current?.(S))},300))});return B.observe(g),()=>{window.clearTimeout(C),B.disconnect()}},[n,I]),n?(0,jt.jsxs)(Mn.Box,{sx:{position:"relative",mt:1},children:[(0,jt.jsx)(Mn.Box,{sx:{border:"1px solid #e0e0e0",borderRadius:1,p:"12px",pr:"40px",minHeight:r,fontSize:16,lineHeight:1.6,color:"#37352f",wordBreak:"break-word",userSelect:"none","& > p:first-of-type":{mt:0},"& > p:last-of-type":{mb:0}},dangerouslySetInnerHTML:{__html:Kl(o)}}),(0,jt.jsx)(Mn.Tooltip,{title:"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:(0,jt.jsx)(Mn.IconButton,{size:"small","aria-label":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>{navigator.clipboard.writeText(qp(o)).then(()=>{R(!0),window.setTimeout(()=>R(!1),1500)})},sx:{position:"absolute",top:6,right:6,color:"#9a9a97"},children:h?(0,jt.jsx)(zp.default,{sx:{fontSize:17,color:"#2f9e5b"}}):(0,jt.jsx)(Pp.default,{sx:{fontSize:17}})})})]}):(0,jt.jsx)(Mn.Box,{ref:p,onDragOver:g=>g.stopPropagation(),onDrop:g=>g.stopPropagation(),sx:{mt:1,"& .ehfuse-editor-content > p:first-of-type":{mt:0},"& .ehfuse-editor-content > p:last-of-type":{mb:0},"& .ehfuse-editor-content.ehfuse-editor-empty::before":{top:"12px",left:"12px"}},children:(0,jt.jsx)(ka.EhfuseEditor,{ref:s,defaultValue:Kl(o),autoHeight:I,resizable:!I,showToolbar:!I,focusBorder:!0,styles:{focusBorderColor:"var(--primary)"},toolbarOptions:ka.minimalToolbarOptions,locale:"ko",minHeight:m||r,placeholder:"\uB0B4\uC6A9\uC744 \uC785\uB825\uD558\uC138\uC694",contentStyle:{padding:"12px"},onChange:g=>{let C=Date.now()<u.current,B=g===f.current;f.current=g,!(C||B)&&t(g)}})})}var zr=require("react"),Oe=require("@mui/material"),Ul=a(require("@mui/icons-material/Close"),1),Kp=a(require("@mui/icons-material/AddCircle"),1),Vl=a(require("@mui/icons-material/AddTask"),1),Up=a(require("@mui/icons-material/Checklist"),1),Vp=a(require("@mui/icons-material/CheckCircle"),1),Gp=a(require("@mui/icons-material/Launch"),1),Yp=a(require("@mui/icons-material/LinkOutlined"),1),jp=a(require("@mui/icons-material/RadioButtonUnchecked"),1);var On=require("react"),Ho=require("@mui/material"),Lp=require("@ehfuse/mui-form-dialog"),Np=require("@ehfuse/mui-form-controls"),Fp=require("@ehfuse/alerts"),Hp=a(require("@mui/icons-material/CheckCircle"),1),Wp=a(require("@mui/icons-material/RadioButtonUnchecked"),1),$p=require("@ehfuse/overlay-scrollbar");var So=require("react/jsx-runtime"),Ap=[{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 gi({open:e,task:o,tasks:t,excludeSeqs:n=[],onClose:r,onSubmit:i,hideRelationType:l=!1,title:s="\uAD00\uB828 \uC5C5\uBB34 \uC5F0\uACB0",confirmLabel:p="\uC5F0\uACB0",multiSelect:m=!1}){let c=Ye(),[x,f]=(0,On.useState)("related"),[u,h]=(0,On.useState)(""),[R,I]=(0,On.useState)([]);(0,On.useEffect)(()=>{e&&(f("related"),h(""),I([]))},[e]);let b=(0,On.useMemo)(()=>{let S=new Set([o.seq,...n]),E=u.trim().toLowerCase();return t.filter(y=>S.has(y.seq)||y.is_event||y.is_notice?!1:E?y.title.toLowerCase().includes(E)||(y.ticket_no??"").toLowerCase().includes(E):!0).sort((y,k)=>!!y.completed!=!!k.completed?y.completed?1:-1:k.seq-y.seq)},[t,o.seq,n,u]),g=()=>{if(R.length===0){(0,Fp.ErrorAlert)("\uC5F0\uACB0\uD560 \uC5C5\uBB34\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}for(let S of R)i(S,x);r()},C=S=>{I(E=>E.includes(S)?E.filter(y=>y!==S):m?[...E,S]:[S])},B=Ap.find(S=>S.type===x)?.hint??"",M=(0,So.jsxs)(Ho.Box,{sx:{...c?{height:"100%",minHeight:0}:{height:560},display:"flex",flexDirection:"column",...c?{}:{border:"1px solid #cccccc",borderRadius:1},overflow:"hidden",userSelect:"none"},children:[l?null:(0,So.jsx)(Ho.Tabs,{value:x,onChange:(S,E)=>f(E),sx:{minHeight:38,mb:.75,flexShrink:0,"& .MuiTab-root":{minHeight:38,py:.5,fontSize:14}},children:Ap.map(S=>(0,So.jsx)(Ho.Tab,{value:S.type,label:S.label},S.type))}),l?null:(0,So.jsx)(Ho.Box,{sx:{mb:1.5,fontSize:12.5,color:"#9a9a97"},children:B}),(0,So.jsx)(Ho.Box,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:(0,So.jsx)(Np.ClearTextField,{placeholder:"\uC81C\uBAA9\xB7\uD2F0\uCF13\uBC88\uD638\uB85C \uAC80\uC0C9",value:u,onChange:S=>h(S.target.value),fullWidth:!0,autoFocus:!0,size:"small",sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),(0,So.jsx)(Ho.Box,{sx:{flex:1,minHeight:0},children:(0,So.jsx)($p.OverlayScrollbar,{style:{height:"100%"},contentStyle:{paddingLeft:8,paddingRight:8,paddingTop:8},children:(0,So.jsx)(Ho.Box,{sx:{display:"flex",flexDirection:"column","&::after":{content:'""',flexShrink:0,height:"8px"}},children:b.length===0?(0,So.jsx)(Ho.Box,{sx:{py:4,textAlign:"center",fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uD560 \uC218 \uC788\uB294 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):b.map(S=>{let E=co(S.icon||Ve),y=R.includes(S.seq);return(0,So.jsxs)(Ho.Box,{onClick:()=>C(S.seq),sx:{display:"flex",alignItems:"flex-start",gap:.75,px:1.25,py:1,mb:1,flexShrink:0,cursor:"pointer",border:"1px solid",borderColor:y?"#9dc0ee":"#e6e6e3",borderRadius:1.5,bgcolor:y?"#e3eefb":"#fff","&:hover":{bgcolor:y?"#e3eefb":"#f7f7f5"}},children:[y?(0,So.jsx)(Hp.default,{sx:{fontSize:20,flexShrink:0,mt:"1px",color:"#2f6fd0"}}):(0,So.jsx)(Wp.default,{sx:{fontSize:20,flexShrink:0,mt:"1px",color:"#c9c8c5"}}),E?(0,So.jsx)(E,{sx:{fontSize:17,flexShrink:0,mt:"3px",color:S.icon_color||"#1e3a8a"}}):null,(0,So.jsxs)(Ho.Box,{component:"span",sx:{flex:1,minWidth:0,fontSize:15,color:"#37352f",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:3,overflow:"hidden",lineHeight:1.5,wordBreak:"break-word"},children:[S.ticket_no?`${S.ticket_no} `:"",S.title]}),(0,So.jsx)(Ho.Box,{sx:{flexShrink:0,mt:"1px"},children:(0,So.jsx)(Ge,{option:Go(S)})})]},S.seq)})})})})]});return(0,So.jsx)(Lp.FormDialog,{open:e,onClose:r,maxWidth:"sm",fullScreen:c,mobilePresentation:c?"slide":"dialog",...c?{contentPaddingX:0,contentTopPadding:0,sectionsPaddingTop:0}:{},sx:c?{DialogContent:{"& .os-content > div":{height:"100%",boxSizing:"border-box"},"& .FormSection-content, & .section-content":{height:"100%"}}}:void 0,title:s,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-task-link",sections:[{id:"task-link",showTitle:!1,children:M}],scrollPastLastSection:!1,sectionContentPaddingTop:0,actions:{showCancelButton:!0,right:(0,So.jsx)(Ho.Button,{variant:"contained",disabled:R.length===0,onClick:g,children:p})}})}var ae=require("react/jsx-runtime");function hi({taskSeq:e,checklist:o,onAdd:t,onToggle:n,onRemove:r,onUpdate:i,removeLocked:l=!1,onConvertToTask:s,onOpenLinkedTask:p,linkCandidates:m,linkBaseTask:c,onLinkExistingTask:x,resolveLinkedTask:f}){let[u,h]=(0,zr.useState)(""),[R,I]=(0,zr.useState)(!1),[b,g]=(0,zr.useState)(null),C=Ye(),[B,M]=(0,zr.useState)(null),[S,E]=(0,zr.useState)(null),y=A=>{let d=A.task_seq?f?.(A.task_seq):void 0;return d?d.completed:A.checked},k=o.filter(y).length,w=()=>{u.trim()&&(t(e,u),h(""))};return(0,ae.jsxs)(gt,{icon:(0,ae.jsx)(Up.default,{sx:{fontSize:19,display:"block"}}),title:(0,ae.jsxs)(ae.Fragment,{children:["\uD560\uC77C",o.length>0?(0,ae.jsxs)(Oe.Box,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:[k," / ",o.length]}):null]}),titleExtra:o.length>0?(0,ae.jsx)(Oe.Box,{sx:{flex:1,minWidth:0,ml:1,height:6,borderRadius:3,bgcolor:"#ececea"},children:(0,ae.jsx)(Oe.Box,{sx:{height:"100%",borderRadius:3,width:`${Math.round(k/o.length*100)}%`,bgcolor:"#2f80ed",transition:"width 0.2s"}})}):null,children:[(0,ae.jsx)(Oe.Box,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:o.map((A,d)=>{let T=A.task_seq?f?.(A.task_seq):void 0,z=y(A),N=!!A.task_seq;return(0,ae.jsxs)(Oe.Box,{sx:{display:"flex",alignItems:"center",gap:1,px:1.25,py:.5,borderRadius:1,"&:hover":{bgcolor:"#f7f7f5"},"&:hover .taskbox-checklist-remove":{opacity:1},"&:hover .taskbox-checklist-convert":{opacity:1}},children:[(0,ae.jsx)(Oe.Box,{component:"span",onClick:()=>n(e,d,!z),sx:{display:"inline-flex",flexShrink:0,cursor:"pointer"},children:z?(0,ae.jsx)(Vp.default,{sx:{fontSize:18,color:"#2f80ed"}}):(0,ae.jsx)(jp.default,{sx:{fontSize:18,color:"#9a9a97"}})}),b?.index===d?(0,ae.jsx)(Oe.Box,{component:"input",autoFocus:!0,spellCheck:!1,value:b.label,enterKeyHint:"done",onChange:H=>g({index:d,label:H.target.value}),onBlur:()=>{b.label.trim()&&b.label.trim()!==A.label&&i?.(e,d,b.label),g(null)},onKeyDown:H=>{H.key==="Enter"&&H.target.blur(),H.key==="Escape"&&g(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",p:0}}):(0,ae.jsx)(Oe.Box,{component:"span",onClick:N?A.task_seq&&p?()=>p(A.task_seq):void 0:l||!i?void 0:C?()=>M({index:d,label:A.label}):()=>g({index:d,label:A.label}),sx:{flex:1,minWidth:0,fontSize:14.5,color:"#37352f",textDecoration:z?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...N?p?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}:l||!i?{}:{cursor:"text"}},children:A.label}),N?(0,ae.jsxs)(Oe.Box,{component:"span",onClick:A.task_seq&&p?()=>p(A.task_seq):void 0,sx:{display:"inline-flex",alignItems:"center",gap:.4,flexShrink:0,px:.75,py:.2,borderRadius:1,fontSize:12,fontWeight:500,color:"#1d4f91",bgcolor:"#e3eefb",whiteSpace:"nowrap",...p?{cursor:"pointer"}:{}},children:[(0,ae.jsx)(Gp.default,{sx:{fontSize:12}}),T?.manager_name?.trim()||"\uC5C5\uBB34"]}):null,!l&&!N&&s?(0,ae.jsx)(Oe.Tooltip,{title:"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",arrow:!0,enterDelay:300,disableInteractive:!0,children:(0,ae.jsx)(Oe.IconButton,{className:"taskbox-checklist-convert",size:"small","aria-label":"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",onClick:H=>E({anchorEl:H.currentTarget,index:d,label:A.label}),sx:{display:C?"none":"inline-flex",opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:(0,ae.jsx)(Vl.default,{sx:{fontSize:16}})})}):null,l?null:(0,ae.jsx)(Oe.IconButton,{className:"taskbox-checklist-remove",size:"small","aria-label":"\uD560\uC77C \uC0AD\uC81C",onClick:()=>r(e,d),sx:{display:C?"none":"inline-flex",opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:(0,ae.jsx)(Ul.default,{sx:{fontSize:15}})})]},`${A.label}-${d}`)})}),(0,ae.jsxs)(Oe.Box,{sx:{mt:.5,ml:3.25,display:"flex",alignItems:"center",gap:.5},children:[(0,ae.jsx)(Oe.Box,{component:"input",spellCheck:!1,value:u,placeholder:"+ \uD560\uC77C \uCD94\uAC00",enterKeyHint:"done",onChange:A=>h(A.target.value),onKeyDown:A=>{A.key==="Enter"&&w()},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"}}}),m&&c&&x?(0,ae.jsx)(Oe.Tooltip,{title:"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",arrow:!0,children:(0,ae.jsx)(Oe.IconButton,{size:"small","aria-label":"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",onMouseDown:A=>A.preventDefault(),onClick:()=>I(!0),sx:{flexShrink:0,color:"#9a9a97"},children:(0,ae.jsx)(Yp.default,{sx:{fontSize:20}})})}):null,(0,ae.jsx)(Oe.IconButton,{size:"small","aria-label":"\uD560\uC77C \uCD94\uAC00",disabled:!u.trim(),onMouseDown:A=>A.preventDefault(),onClick:w,sx:{flexShrink:0,color:u.trim()?"#2f80ed":"#c9c8c5"},children:(0,ae.jsx)(Kp.default,{sx:{fontSize:20}})})]}),m&&c&&x?(0,ae.jsx)(gi,{open:R,task:c,tasks:m,excludeSeqs:o.map(A=>Number(A.task_seq??0)).filter(A=>A>0),hideRelationType:!0,multiSelect:!0,title:"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",confirmLabel:"\uBD99\uC774\uAE30",onClose:()=>I(!1),onSubmit:A=>{let d=m.find(T=>T.seq===A);x(e,A,String(d?.title??"").trim())}}):null,(0,ae.jsx)(uo,{open:!!S,anchorEl:S?.anchorEl??null,title:"\uC774 \uD560\uC77C\uC744 \uBCC4\uB3C4 \uC5C5\uBB34\uB85C \uB9CC\uB4DC\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uB9CC\uB4E4\uAE30",onCancel:()=>E(null),onConfirm:()=>{S&&s?.(e,S.index,S.label),E(null)}}),(0,ae.jsx)(Oe.Dialog,{open:!!B,onClose:()=>M(null),maxWidth:"xs",fullWidth:!0,slotProps:{paper:{sx:{borderRadius:2,m:2}}},children:(0,ae.jsxs)(Oe.Box,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5},children:[(0,ae.jsx)(Oe.Box,{sx:{fontSize:15.5,fontWeight:600,color:"#37352f"},children:"\uD560\uC77C \uC218\uC815"}),(0,ae.jsx)(Oe.TextField,{autoFocus:!0,fullWidth:!0,size:"medium",value:B?.label??"",onChange:A=>M(d=>d&&{...d,label:A.target.value}),onKeyDown:A=>{if(A.key!=="Enter")return;let d=B;d&&d.label.trim()&&i?.(e,d.index,d.label.trim()),M(null)}}),(0,ae.jsxs)(Oe.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[!l&&s&&B&&!o[B.index]?.task_seq?(0,ae.jsx)(Oe.IconButton,{"aria-label":"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",onClick:()=>{s(e,B.index,o[B.index]?.label??""),M(null)},sx:{color:"#57564f"},children:(0,ae.jsx)(Vl.default,{sx:{fontSize:20}})}):null,!l&&B?(0,ae.jsx)(Oe.IconButton,{"aria-label":"\uD560\uC77C \uC0AD\uC81C",onClick:()=>{r(e,B.index),M(null)},sx:{color:"#e5484d"},children:(0,ae.jsx)(Ul.default,{sx:{fontSize:19}})}):null,(0,ae.jsx)(Oe.Box,{sx:{flex:1}}),(0,ae.jsx)(Oe.Button,{color:"inherit",onClick:()=>M(null),children:"\uCDE8\uC18C"}),(0,ae.jsx)(Oe.Button,{variant:"contained",disabled:!B?.label.trim(),onClick:()=>{B&&B.label.trim()&&i?.(e,B.index,B.label.trim()),M(null)},children:"\uD655\uC778"})]})]})})]})}var Ca=require("react"),ht=require("@mui/material"),Qp=a(require("@mui/icons-material/Close"),1),jl=a(require("@mui/icons-material/AttachFileOutlined"),1);var zh=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"]),Ta=e=>{let o=e?.split(".").pop()?.toLowerCase()??"";return zh.has(o)};var Xp=require("@mui/material");var qr=require("react/jsx-runtime");function Gl(e){let o=Ht(),t=o.useValue("attachmentUpload.taskSeq"),n=o.useValue("attachmentUpload.index"),r=o.useValue("attachmentUpload.total"),i=o.useValue("attachmentUpload.queue"),l=n??0;return!l||e>0&&(t??0)!==e?null:{index:l,total:r??0,queue:i??[]}}function ya(){let o=Ht().useValue("attachmentUpload.progress");return(0,qr.jsxs)(qr.Fragment,{children:[o??0,"%"]})}function Yl(){let o=Ht().useValue("attachmentUpload.progress");return(0,qr.jsx)(Xp.LinearProgress,{variant:"determinate",value:o??0,sx:{height:4,borderRadius:2,bgcolor:"#dbe9fb",mt:.75}})}var go=require("react/jsx-runtime");function Sa(e){return e>=1048576?`${(e/1048576).toFixed(1)}MB`:`${Math.max(1,Math.round(e/1024))}KB`}var Ba={flex:1,minWidth:0,fontSize:13.5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function bi({taskSeq:e,attachments:o,onAdd:t,onRemove:n,removeLocked:r=!1,onPreview:i,onDownload:l}){let[s,p]=(0,Ca.useState)(!1),m=(0,Ca.useRef)(null),c=Ye(),x=pr(),f=dr(),u=Gl(e),h=e===0,R=B=>{if(i){i(B);return}window.open(f(B.uuid??""),"_blank","noopener,noreferrer")},I=B=>{if(l){l(B);return}window.open(f(B.uuid??"",{download:!0}),"_blank","noopener,noreferrer")},b=B=>u?B+1<u.index?"done":B+1===u.index?"uploading":"waiting":"waiting",g=(B,M,S,E={})=>(0,go.jsxs)(ht.Box,{sx:{px:1,py:.5,borderRadius:1,border:"1px solid",borderColor:E.uploading?"#d5e6fb":"#e6e6e3",bgcolor:E.uploading?"#f4f9ff":"transparent","&:hover .taskbox-file-remove":{opacity:1}},children:[(0,go.jsxs)(ht.Box,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[(0,go.jsx)(jl.default,{sx:{fontSize:16,color:"#9a9a97"}}),M,(0,go.jsx)(ht.Box,{component:"span",sx:{fontSize:12,color:E.uploading?"#2f80ed":"#9a9a97",flexShrink:0},children:S}),E.removeIndex!==void 0?(0,go.jsx)(ht.IconButton,{className:"taskbox-file-remove",size:"small","aria-label":"\uCCA8\uBD80 \uC0AD\uC81C",onClick:()=>n(e,E.removeIndex),sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:(0,go.jsx)(Qp.default,{sx:{fontSize:15}})}):null]}),E.uploading?(0,go.jsx)(Yl,{}):null]},B),C=B=>{let M=Ta(B.name);return(0,go.jsx)(ht.Box,{component:"button",type:"button",onClick:()=>M?R(B):I(B),title:`${B.name} ${M?"\uBBF8\uB9AC\uBCF4\uAE30":"\uB2E4\uC6B4\uB85C\uB4DC"}`,sx:{...Ba,color:"#37352f",textAlign:"left",p:0,border:"none",background:"none",font:"inherit",fontSize:13.5,cursor:"pointer","&:hover":{textDecoration:"underline",color:"#2f80ed"}},children:B.name})};return(0,go.jsxs)(gt,{icon:(0,go.jsx)(jl.default,{sx:{fontSize:18,display:"block"}}),title:(0,go.jsxs)(go.Fragment,{children:["\uD30C\uC77C ",o.length>0?o.length:""]}),children:[(0,go.jsxs)(ht.Box,{sx:{display:"flex",flexDirection:"column",gap:.5,mt:1},children:[o.map((B,M)=>{let S=`${B.uuid||B.name}-${M}`;if(h){let E=b(M),y=E==="uploading";return g(S,(0,go.jsx)(ht.Box,{component:"span",sx:{...Ba,color:E==="done"?"#37352f":"#9a9a97"},children:B.name}),y?(0,go.jsx)(ya,{}):Sa(B.size),{uploading:y,removeIndex:!r&&!u?M:void 0})}return B.uuid?g(S,C(B),Sa(B.size),{removeIndex:r?void 0:M}):g(S,(0,go.jsx)(ht.Box,{component:"span",title:"\uC2E4\uD30C\uC77C\uC774 \uC5C6\uB294 \uC774\uC804 \uBC29\uC2DD \uCCA8\uBD80\uC785\uB2C8\uB2E4(\uB2E4\uC6B4\uB85C\uB4DC \uBD88\uAC00) \u2014 \uB2E4\uC2DC \uCCA8\uBD80\uD574 \uC8FC\uC138\uC694.",sx:{...Ba,color:"#9a9a97"},children:B.name}),Sa(B.size),{removeIndex:r?void 0:M})}),!h&&u?u.queue.slice(u.index-1).map((B,M)=>{let S=M===0;return g(`uploading-${u.index+M}-${B.name}`,(0,go.jsx)(ht.Box,{component:"span",sx:{...Ba,color:"#9a9a97"},children:B.name}),S?(0,go.jsx)(ya,{}):Sa(B.size),{uploading:S})}):null]}),(0,go.jsx)(ht.Box,{onClick:()=>m.current?.click(),onDragOver:B=>{B.preventDefault(),p(!0)},onDragLeave:()=>p(!1),onDrop:B=>{B.preventDefault(),p(!1);let M=Array.from(B.dataTransfer.files);M.length>0&&t(e,M)},sx:{mt:1,py:2.5,display:"flex",alignItems:"center",justifyContent:"center",gap:.5,border:"1.5px dashed",borderColor:s?"#2f80ed":"#cfcfcc",borderRadius:1,bgcolor:s?"#eef6ff":"transparent",color:"#787774",fontSize:13.5,cursor:"pointer",transition:"background-color 0.15s, border-color 0.15s","&:hover":{bgcolor:"#fafaf9",borderColor:"#9a9a97"}},children:c?`\uD30C\uC77C\uC744 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${x}MB)`:`\uD30C\uC77C\uC744 \uB04C\uC5B4\uB2E4 \uB193\uAC70\uB098 \uD074\uB9AD\uD574 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${x}MB)`}),(0,go.jsx)(ht.Box,{component:"input",ref:m,type:"file",multiple:!0,onChange:B=>{let M=Array.from(B.target.files??[]);M.length>0&&t(e,M),B.target.value=""},sx:{display:"none"}})]})}var nf=require("react"),qt=require("@mui/material"),rf=a(require("@mui/icons-material/Add"),1);var ki=require("react"),Ar=require("@mui/material"),Jp=require("@ehfuse/mui-form-dialog"),ef=require("@ehfuse/mui-form-controls"),of=require("@ehfuse/mui-color-picker"),tf=require("@ehfuse/alerts");var Xt=require("react/jsx-runtime"),Zp="#2f80ed";function Xl({open:e,onClose:o,onSubmit:t}){let[n,r]=(0,ki.useState)(""),[i,l]=(0,ki.useState)(Zp);(0,ki.useEffect)(()=>{e&&(r(""),l(Zp))},[e]);let s=()=>{let c=n.trim();if(!c){(0,tf.ErrorAlert)("\uB77C\uBCA8 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}t(c,i),o()},p=Za(i),m=(0,Xt.jsxs)(Ar.Box,{children:[(0,Xt.jsxs)(Ar.Box,{sx:{display:"flex",alignItems:"center",gap:1.5,mt:.5},children:[(0,Xt.jsx)(ef.ClearTextField,{label:"\uB77C\uBCA8 \uC774\uB984",value:n,onChange:c=>r(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),s())},fullWidth:!0,autoFocus:!0}),(0,Xt.jsx)(of.ColorPicker,{value:i,onChange:c=>l(c),shape:"circle",colorSize:28})]}),(0,Xt.jsxs)(Ar.Box,{sx:{mt:2,display:"flex",alignItems:"center",gap:1,fontSize:13,color:"#787774"},children:["\uBBF8\uB9AC\uBCF4\uAE30",(0,Xt.jsx)(Ge,{option:{key:"__preview__",name:n.trim()||"\uB77C\uBCA8",...p}})]})]});return(0,Xt.jsx)(Jp.FormDialog,{open:e,onClose:o,maxWidth:"xs",title:"\uC0C8 \uB77C\uBCA8 \uCD94\uAC00",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-add-label",sections:[{id:"add-label",showTitle:!1,children:m}],actions:{showCancelButton:!0,right:(0,Xt.jsx)(Ar.Button,{variant:"contained",onClick:s,children:"\uCD94\uAC00"})}})}var st=require("react/jsx-runtime");function Ti({anchorEl:e,selectedKeys:o,labelOptions:t,onToggle:n,onAddLabel:r,onClose:i}){let[l,s]=(0,nf.useState)(!1),p=Wt();return(0,st.jsxs)(st.Fragment,{children:[(0,st.jsxs)(qt.Menu,{anchorEl:e,open:!!e,onClose:i,transitionDuration:0,...p,children:[t.map(m=>{let c=o.includes(m.key);return(0,st.jsxs)(qt.MenuItem,{onClick:()=>n(m.key),sx:{fontSize:14,minWidth:170,gap:1},children:[(0,st.jsx)(qt.Checkbox,{size:"small",checked:c,sx:{p:0}}),(0,st.jsx)(Ge,{option:m})]},m.key)}),(0,st.jsx)(qt.Divider,{}),(0,st.jsxs)(qt.MenuItem,{onClick:()=>s(!0),sx:{fontSize:14,color:"#787774"},children:[(0,st.jsx)(qt.ListItemIcon,{children:(0,st.jsx)(rf.default,{sx:{fontSize:18,color:"#787774"}})}),"\uB77C\uBCA8 \uCD94\uAC00"]})]}),(0,st.jsx)(Xl,{open:l,onClose:()=>s(!1),onSubmit:r})]})}function af(e,o){let t=Number(e.author_account_seq??0);return o.filter(n=>{let r=Number(n.account_seq??0);return r>0&&r!==t})}function lf(e,o){let t=(e.target_account_seqs??[]).filter(x=>x>0);if(t.length===0)return null;let n=new Set(t),r=af(e,o),i=new Map;for(let x of r){let f=String(x.department??"").trim();if(!f)continue;let u=i.get(f)??[];u.push(x),i.set(f,u)}let l=[],s=new Set;for(let[x,f]of i)if(f.every(h=>n.has(Number(h.account_seq??0)))){l.push(x);for(let h of f)s.add(Number(h.account_seq??0))}let p=new Map(r.map(x=>[Number(x.account_seq??0),x.name])),m=e.target_names??[],c=[];return t.forEach((x,f)=>{s.has(x)||c.push(p.get(x)??m[f]??"\uC774\uB984\uC5C6\uC74C")}),{teamNames:l,individualNames:c}}function yi(e,o){let t=lf(e,o);return t?[...t.teamNames,...t.individualNames].join(", "):"\uBAA8\uB4E0 \uC9C1\uC6D0"}function qh(e,o){let t=lf(e,o);return t?{kind:"members",teamNames:t.teamNames,individualNames:t.individualNames}:{kind:"everyone"}}function Ql(e,o,t){let n=(e.target_account_seqs??[]).filter(c=>c>0),r=af(e,o),i=n.length>0?n.length:r.length,l=e.acks??[],s=t>0&&l.some(c=>c.account_seq===t),p=t>0&&Number(e.author_account_seq??0)===t,m=n.length===0||n.includes(t);return{count:l.length,total:i,acked:s,canAck:t>0&&!p&&m&&!s&&!e.completed}}function Zl(e,o){let t=Number(o)||50,n=t*1024*1024,r=e.filter(s=>s.size>n),i=e.filter(s=>s.size<=n),l=r.length>0?`\uD30C\uC77C\uC740 1\uAC1C\uB2F9 \uCD5C\uB300 ${t}MB \uAE4C\uC9C0 \uCCA8\uBD80\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
|
|
6
|
+
`).trim()}function xi({syncKey:e,value:o,onChange:t,readOnly:n=!1,minHeight:r=180,height:i=0,onChangeHeight:l}){let s=(0,lt.useRef)(null),p=(0,lt.useRef)(null),m=i>0?i:0,c=(0,lt.useRef)(m),x=(0,lt.useRef)(l);x.current=l;let f=(0,lt.useRef)(null),u=(0,lt.useRef)(Date.now()+800),[h,R]=(0,lt.useState)(!1),I=Ye();(0,lt.useEffect)(()=>{if(n)return;let g=Kl(o);f.current===g||f.current===o||(f.current=g,u.current=Date.now()+800,s.current?.setHtml(g))},[e,o,n]);let b=(0,lt.useRef)(-1);return(0,lt.useEffect)(()=>{if(n||I||i<=0||b.current===i||(b.current=i,Math.abs(i-c.current)<1))return;let g=p.current?.querySelector(".ehfuse-editor-container");g&&(Math.abs(g.getBoundingClientRect().height-i)<1||(g.style.height=`${i}px`,c.current=i))},[n,I,i]),(0,lt.useEffect)(()=>{if(n||I)return;let g=p.current?.querySelector(".ehfuse-editor-container");if(!g||typeof ResizeObserver>"u")return;let C,B=new ResizeObserver(M=>{let S=Math.round(M[0]?.contentRect.height??0);S<=0||(window.clearTimeout(C),C=window.setTimeout(()=>{Math.abs(S-c.current)<1||(c.current=S,x.current?.(S))},300))});return B.observe(g),()=>{window.clearTimeout(C),B.disconnect()}},[n,I]),n?(0,jt.jsxs)(Mn.Box,{sx:{position:"relative",mt:1},children:[(0,jt.jsx)(Mn.Box,{sx:{border:"1px solid #e0e0e0",borderRadius:1,p:"12px",pr:"40px",minHeight:r,fontSize:16,lineHeight:1.6,color:"#37352f",wordBreak:"break-word",userSelect:"none","& > p:first-of-type":{mt:0},"& > p:last-of-type":{mb:0}},dangerouslySetInnerHTML:{__html:Kl(o)}}),(0,jt.jsx)(Mn.Tooltip,{title:"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:(0,jt.jsx)(Mn.IconButton,{size:"small","aria-label":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>{navigator.clipboard.writeText(qp(o)).then(()=>{R(!0),window.setTimeout(()=>R(!1),1500)})},sx:{position:"absolute",top:6,right:6,color:"#9a9a97"},children:h?(0,jt.jsx)(zp.default,{sx:{fontSize:17,color:"#2f9e5b"}}):(0,jt.jsx)(Pp.default,{sx:{fontSize:17}})})})]}):(0,jt.jsx)(Mn.Box,{ref:p,onDragOver:g=>g.stopPropagation(),onDrop:g=>g.stopPropagation(),sx:{mt:1,"& .ehfuse-editor-content > p:first-of-type":{mt:0},"& .ehfuse-editor-content > p:last-of-type":{mb:0},"& .ehfuse-editor-content.ehfuse-editor-empty::before":{top:"12px",left:"12px"}},children:(0,jt.jsx)(ka.EhfuseEditor,{ref:s,defaultValue:Kl(o),autoHeight:I,resizable:!I,showToolbar:!I,focusBorder:!0,styles:{focusBorderColor:"var(--primary)"},toolbarOptions:ka.minimalToolbarOptions,locale:"ko",minHeight:m||r,placeholder:"\uB0B4\uC6A9\uC744 \uC785\uB825\uD558\uC138\uC694",contentStyle:{padding:"12px"},onChange:g=>{let C=Date.now()<u.current,B=g===f.current;f.current=g,!(C||B)&&t(g)}})})}var zr=require("react"),Oe=require("@mui/material"),Ul=a(require("@mui/icons-material/Close"),1),Kp=a(require("@mui/icons-material/AddCircle"),1),Vl=a(require("@mui/icons-material/AddTask"),1),Up=a(require("@mui/icons-material/Checklist"),1),Vp=a(require("@mui/icons-material/CheckCircle"),1),Gp=a(require("@mui/icons-material/Launch"),1),Yp=a(require("@mui/icons-material/LinkOutlined"),1),jp=a(require("@mui/icons-material/RadioButtonUnchecked"),1);var On=require("react"),Ho=require("@mui/material"),Lp=require("@ehfuse/mui-form-dialog"),Np=require("@ehfuse/mui-form-controls"),Fp=require("@ehfuse/alerts"),Hp=a(require("@mui/icons-material/CheckCircle"),1),Wp=a(require("@mui/icons-material/RadioButtonUnchecked"),1),$p=require("@ehfuse/overlay-scrollbar");var So=require("react/jsx-runtime"),Ap=[{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 gi({open:e,task:o,tasks:t,excludeSeqs:n=[],onClose:r,onSubmit:i,hideRelationType:l=!1,title:s="\uAD00\uB828 \uC5C5\uBB34 \uC5F0\uACB0",confirmLabel:p="\uC5F0\uACB0",multiSelect:m=!1}){let c=Ye(),[x,f]=(0,On.useState)("related"),[u,h]=(0,On.useState)(""),[R,I]=(0,On.useState)([]);(0,On.useEffect)(()=>{e&&(f("related"),h(""),I([]))},[e]);let b=(0,On.useMemo)(()=>{let S=new Set([o.seq,...n]),E=u.trim().toLowerCase();return t.filter(y=>S.has(y.seq)||y.is_event||y.is_notice?!1:E?y.title.toLowerCase().includes(E)||(y.ticket_no??"").toLowerCase().includes(E):!0).sort((y,k)=>!!y.completed!=!!k.completed?y.completed?1:-1:k.seq-y.seq)},[t,o.seq,n,u]),g=()=>{if(R.length===0){(0,Fp.ErrorAlert)("\uC5F0\uACB0\uD560 \uC5C5\uBB34\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}for(let S of R)i(S,x);r()},C=S=>{I(E=>E.includes(S)?E.filter(y=>y!==S):m?[...E,S]:[S])},B=Ap.find(S=>S.type===x)?.hint??"",M=(0,So.jsxs)(Ho.Box,{sx:{...c?{height:"100%",minHeight:0}:{height:560},display:"flex",flexDirection:"column",...c?{}:{border:"1px solid #cccccc",borderRadius:1},overflow:"hidden",userSelect:"none"},children:[l?null:(0,So.jsx)(Ho.Tabs,{value:x,onChange:(S,E)=>f(E),sx:{minHeight:38,mb:.75,flexShrink:0,"& .MuiTab-root":{minHeight:38,py:.5,fontSize:14}},children:Ap.map(S=>(0,So.jsx)(Ho.Tab,{value:S.type,label:S.label},S.type))}),l?null:(0,So.jsx)(Ho.Box,{sx:{mb:1.5,fontSize:12.5,color:"#9a9a97"},children:B}),(0,So.jsx)(Ho.Box,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:(0,So.jsx)(Np.ClearTextField,{placeholder:"\uC81C\uBAA9\xB7\uD2F0\uCF13\uBC88\uD638\uB85C \uAC80\uC0C9",value:u,onChange:S=>h(S.target.value),fullWidth:!0,autoFocus:!0,size:"small",sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),(0,So.jsx)(Ho.Box,{sx:{flex:1,minHeight:0},children:(0,So.jsx)($p.OverlayScrollbar,{style:{height:"100%"},contentStyle:{paddingTop:0},children:(0,So.jsx)(Ho.Box,{sx:{display:"flex",flexDirection:"column","&::after":{content:'""',flexShrink:0,height:"8px"}},children:b.length===0?(0,So.jsx)(Ho.Box,{sx:{py:4,textAlign:"center",fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uD560 \uC218 \uC788\uB294 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):b.map(S=>{let E=co(S.icon||Ve),y=R.includes(S.seq);return(0,So.jsxs)(Ho.Box,{onClick:()=>C(S.seq),sx:{display:"flex",alignItems:"center",gap:.75,px:1.5,py:1.25,flexShrink:0,cursor:"pointer",borderBottom:"1px solid #ededeb","&:last-of-type":{borderBottom:"none"},bgcolor:y?"#e3eefb":"transparent","&:hover":{bgcolor:y?"#e3eefb":"#f7f7f5"}},children:[y?(0,So.jsx)(Hp.default,{sx:{fontSize:20,flexShrink:0,color:"#2f6fd0"}}):(0,So.jsx)(Wp.default,{sx:{fontSize:20,flexShrink:0,color:"#c9c8c5"}}),E?(0,So.jsx)(E,{sx:{fontSize:17,flexShrink:0,color:S.icon_color||"#1e3a8a"}}):null,(0,So.jsxs)(Ho.Box,{component:"span",sx:{flex:1,minWidth:0,fontSize:15,color:"#37352f",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:3,overflow:"hidden",lineHeight:1.5,wordBreak:"break-word"},children:[S.ticket_no?`${S.ticket_no} `:"",S.title]}),(0,So.jsx)(Ho.Box,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:(0,So.jsx)(Ge,{option:Go(S)})})]},S.seq)})})})})]});return(0,So.jsx)(Lp.FormDialog,{open:e,onClose:r,maxWidth:"sm",fullScreen:c,mobilePresentation:c?"slide":"dialog",...c?{contentPaddingX:0,contentTopPadding:0,sectionsPaddingTop:0}:{},sx:c?{DialogContent:{"& .os-content > div":{height:"100%",boxSizing:"border-box"},"& .FormSection-content, & .section-content":{height:"100%"}}}:void 0,title:s,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-task-link",sections:[{id:"task-link",showTitle:!1,children:M}],scrollPastLastSection:!1,sectionContentPaddingTop:0,actions:{showCancelButton:!0,right:(0,So.jsx)(Ho.Button,{variant:"contained",disabled:R.length===0,onClick:g,children:p})}})}var ae=require("react/jsx-runtime");function hi({taskSeq:e,checklist:o,onAdd:t,onToggle:n,onRemove:r,onUpdate:i,removeLocked:l=!1,onConvertToTask:s,onOpenLinkedTask:p,linkCandidates:m,linkBaseTask:c,onLinkExistingTask:x,resolveLinkedTask:f}){let[u,h]=(0,zr.useState)(""),[R,I]=(0,zr.useState)(!1),[b,g]=(0,zr.useState)(null),C=Ye(),[B,M]=(0,zr.useState)(null),[S,E]=(0,zr.useState)(null),y=A=>{let d=A.task_seq?f?.(A.task_seq):void 0;return d?d.completed:A.checked},k=o.filter(y).length,w=()=>{u.trim()&&(t(e,u),h(""))};return(0,ae.jsxs)(gt,{icon:(0,ae.jsx)(Up.default,{sx:{fontSize:19,display:"block"}}),title:(0,ae.jsxs)(ae.Fragment,{children:["\uD560\uC77C",o.length>0?(0,ae.jsxs)(Oe.Box,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:[k," / ",o.length]}):null]}),titleExtra:o.length>0?(0,ae.jsx)(Oe.Box,{sx:{flex:1,minWidth:0,ml:1,height:6,borderRadius:3,bgcolor:"#ececea"},children:(0,ae.jsx)(Oe.Box,{sx:{height:"100%",borderRadius:3,width:`${Math.round(k/o.length*100)}%`,bgcolor:"#2f80ed",transition:"width 0.2s"}})}):null,children:[(0,ae.jsx)(Oe.Box,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:o.map((A,d)=>{let T=A.task_seq?f?.(A.task_seq):void 0,z=y(A),N=!!A.task_seq;return(0,ae.jsxs)(Oe.Box,{sx:{display:"flex",alignItems:"center",gap:1,px:1.25,py:.5,borderRadius:1,"&:hover":{bgcolor:"#f7f7f5"},"&:hover .taskbox-checklist-remove":{opacity:1},"&:hover .taskbox-checklist-convert":{opacity:1}},children:[(0,ae.jsx)(Oe.Box,{component:"span",onClick:()=>n(e,d,!z),sx:{display:"inline-flex",flexShrink:0,cursor:"pointer"},children:z?(0,ae.jsx)(Vp.default,{sx:{fontSize:18,color:"#2f80ed"}}):(0,ae.jsx)(jp.default,{sx:{fontSize:18,color:"#9a9a97"}})}),b?.index===d?(0,ae.jsx)(Oe.Box,{component:"input",autoFocus:!0,spellCheck:!1,value:b.label,enterKeyHint:"done",onChange:H=>g({index:d,label:H.target.value}),onBlur:()=>{b.label.trim()&&b.label.trim()!==A.label&&i?.(e,d,b.label),g(null)},onKeyDown:H=>{H.key==="Enter"&&H.target.blur(),H.key==="Escape"&&g(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",p:0}}):(0,ae.jsx)(Oe.Box,{component:"span",onClick:N?A.task_seq&&p?()=>p(A.task_seq):void 0:l||!i?void 0:C?()=>M({index:d,label:A.label}):()=>g({index:d,label:A.label}),sx:{flex:1,minWidth:0,fontSize:14.5,color:"#37352f",textDecoration:z?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...N?p?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}:l||!i?{}:{cursor:"text"}},children:A.label}),N?(0,ae.jsxs)(Oe.Box,{component:"span",onClick:A.task_seq&&p?()=>p(A.task_seq):void 0,sx:{display:"inline-flex",alignItems:"center",gap:.4,flexShrink:0,px:.75,py:.2,borderRadius:1,fontSize:12,fontWeight:500,color:"#1d4f91",bgcolor:"#e3eefb",whiteSpace:"nowrap",...p?{cursor:"pointer"}:{}},children:[(0,ae.jsx)(Gp.default,{sx:{fontSize:12}}),T?.manager_name?.trim()||"\uC5C5\uBB34"]}):null,!l&&!N&&s?(0,ae.jsx)(Oe.Tooltip,{title:"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",arrow:!0,enterDelay:300,disableInteractive:!0,children:(0,ae.jsx)(Oe.IconButton,{className:"taskbox-checklist-convert",size:"small","aria-label":"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",onClick:H=>E({anchorEl:H.currentTarget,index:d,label:A.label}),sx:{display:C?"none":"inline-flex",opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:(0,ae.jsx)(Vl.default,{sx:{fontSize:16}})})}):null,l?null:(0,ae.jsx)(Oe.IconButton,{className:"taskbox-checklist-remove",size:"small","aria-label":"\uD560\uC77C \uC0AD\uC81C",onClick:()=>r(e,d),sx:{display:C?"none":"inline-flex",opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:(0,ae.jsx)(Ul.default,{sx:{fontSize:15}})})]},`${A.label}-${d}`)})}),(0,ae.jsxs)(Oe.Box,{sx:{mt:.5,ml:3.25,display:"flex",alignItems:"center",gap:.5},children:[(0,ae.jsx)(Oe.Box,{component:"input",spellCheck:!1,value:u,placeholder:"+ \uD560\uC77C \uCD94\uAC00",enterKeyHint:"done",onChange:A=>h(A.target.value),onKeyDown:A=>{A.key==="Enter"&&w()},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"}}}),m&&c&&x?(0,ae.jsx)(Oe.Tooltip,{title:"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",arrow:!0,children:(0,ae.jsx)(Oe.IconButton,{size:"small","aria-label":"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",onMouseDown:A=>A.preventDefault(),onClick:()=>I(!0),sx:{flexShrink:0,color:"#9a9a97"},children:(0,ae.jsx)(Yp.default,{sx:{fontSize:20}})})}):null,(0,ae.jsx)(Oe.IconButton,{size:"small","aria-label":"\uD560\uC77C \uCD94\uAC00",disabled:!u.trim(),onMouseDown:A=>A.preventDefault(),onClick:w,sx:{flexShrink:0,color:u.trim()?"#2f80ed":"#c9c8c5"},children:(0,ae.jsx)(Kp.default,{sx:{fontSize:20}})})]}),m&&c&&x?(0,ae.jsx)(gi,{open:R,task:c,tasks:m,excludeSeqs:o.map(A=>Number(A.task_seq??0)).filter(A=>A>0),hideRelationType:!0,multiSelect:!0,title:"\uAE30\uC874 \uC5C5\uBB34 \uBD99\uC774\uAE30",confirmLabel:"\uBD99\uC774\uAE30",onClose:()=>I(!1),onSubmit:A=>{let d=m.find(T=>T.seq===A);x(e,A,String(d?.title??"").trim())}}):null,(0,ae.jsx)(uo,{open:!!S,anchorEl:S?.anchorEl??null,title:"\uC774 \uD560\uC77C\uC744 \uBCC4\uB3C4 \uC5C5\uBB34\uB85C \uB9CC\uB4DC\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uB9CC\uB4E4\uAE30",onCancel:()=>E(null),onConfirm:()=>{S&&s?.(e,S.index,S.label),E(null)}}),(0,ae.jsx)(Oe.Dialog,{open:!!B,onClose:()=>M(null),maxWidth:"xs",fullWidth:!0,slotProps:{paper:{sx:{borderRadius:2,m:2}}},children:(0,ae.jsxs)(Oe.Box,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5},children:[(0,ae.jsx)(Oe.Box,{sx:{fontSize:15.5,fontWeight:600,color:"#37352f"},children:"\uD560\uC77C \uC218\uC815"}),(0,ae.jsx)(Oe.TextField,{autoFocus:!0,fullWidth:!0,size:"medium",value:B?.label??"",onChange:A=>M(d=>d&&{...d,label:A.target.value}),onKeyDown:A=>{if(A.key!=="Enter")return;let d=B;d&&d.label.trim()&&i?.(e,d.index,d.label.trim()),M(null)}}),(0,ae.jsxs)(Oe.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[!l&&s&&B&&!o[B.index]?.task_seq?(0,ae.jsx)(Oe.IconButton,{"aria-label":"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",onClick:()=>{s(e,B.index,o[B.index]?.label??""),M(null)},sx:{color:"#57564f"},children:(0,ae.jsx)(Vl.default,{sx:{fontSize:20}})}):null,!l&&B?(0,ae.jsx)(Oe.IconButton,{"aria-label":"\uD560\uC77C \uC0AD\uC81C",onClick:()=>{r(e,B.index),M(null)},sx:{color:"#e5484d"},children:(0,ae.jsx)(Ul.default,{sx:{fontSize:19}})}):null,(0,ae.jsx)(Oe.Box,{sx:{flex:1}}),(0,ae.jsx)(Oe.Button,{color:"inherit",onClick:()=>M(null),children:"\uCDE8\uC18C"}),(0,ae.jsx)(Oe.Button,{variant:"contained",disabled:!B?.label.trim(),onClick:()=>{B&&B.label.trim()&&i?.(e,B.index,B.label.trim()),M(null)},children:"\uD655\uC778"})]})]})})]})}var Ca=require("react"),ht=require("@mui/material"),Qp=a(require("@mui/icons-material/Close"),1),jl=a(require("@mui/icons-material/AttachFileOutlined"),1);var zh=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"]),Ta=e=>{let o=e?.split(".").pop()?.toLowerCase()??"";return zh.has(o)};var Xp=require("@mui/material");var qr=require("react/jsx-runtime");function Gl(e){let o=Ht(),t=o.useValue("attachmentUpload.taskSeq"),n=o.useValue("attachmentUpload.index"),r=o.useValue("attachmentUpload.total"),i=o.useValue("attachmentUpload.queue"),l=n??0;return!l||e>0&&(t??0)!==e?null:{index:l,total:r??0,queue:i??[]}}function ya(){let o=Ht().useValue("attachmentUpload.progress");return(0,qr.jsxs)(qr.Fragment,{children:[o??0,"%"]})}function Yl(){let o=Ht().useValue("attachmentUpload.progress");return(0,qr.jsx)(Xp.LinearProgress,{variant:"determinate",value:o??0,sx:{height:4,borderRadius:2,bgcolor:"#dbe9fb",mt:.75}})}var go=require("react/jsx-runtime");function Sa(e){return e>=1048576?`${(e/1048576).toFixed(1)}MB`:`${Math.max(1,Math.round(e/1024))}KB`}var Ba={flex:1,minWidth:0,fontSize:13.5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function bi({taskSeq:e,attachments:o,onAdd:t,onRemove:n,removeLocked:r=!1,onPreview:i,onDownload:l}){let[s,p]=(0,Ca.useState)(!1),m=(0,Ca.useRef)(null),c=Ye(),x=pr(),f=dr(),u=Gl(e),h=e===0,R=B=>{if(i){i(B);return}window.open(f(B.uuid??""),"_blank","noopener,noreferrer")},I=B=>{if(l){l(B);return}window.open(f(B.uuid??"",{download:!0}),"_blank","noopener,noreferrer")},b=B=>u?B+1<u.index?"done":B+1===u.index?"uploading":"waiting":"waiting",g=(B,M,S,E={})=>(0,go.jsxs)(ht.Box,{sx:{px:1,py:.5,borderRadius:1,border:"1px solid",borderColor:E.uploading?"#d5e6fb":"#e6e6e3",bgcolor:E.uploading?"#f4f9ff":"transparent","&:hover .taskbox-file-remove":{opacity:1}},children:[(0,go.jsxs)(ht.Box,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[(0,go.jsx)(jl.default,{sx:{fontSize:16,color:"#9a9a97"}}),M,(0,go.jsx)(ht.Box,{component:"span",sx:{fontSize:12,color:E.uploading?"#2f80ed":"#9a9a97",flexShrink:0},children:S}),E.removeIndex!==void 0?(0,go.jsx)(ht.IconButton,{className:"taskbox-file-remove",size:"small","aria-label":"\uCCA8\uBD80 \uC0AD\uC81C",onClick:()=>n(e,E.removeIndex),sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:(0,go.jsx)(Qp.default,{sx:{fontSize:15}})}):null]}),E.uploading?(0,go.jsx)(Yl,{}):null]},B),C=B=>{let M=Ta(B.name);return(0,go.jsx)(ht.Box,{component:"button",type:"button",onClick:()=>M?R(B):I(B),title:`${B.name} ${M?"\uBBF8\uB9AC\uBCF4\uAE30":"\uB2E4\uC6B4\uB85C\uB4DC"}`,sx:{...Ba,color:"#37352f",textAlign:"left",p:0,border:"none",background:"none",font:"inherit",fontSize:13.5,cursor:"pointer","&:hover":{textDecoration:"underline",color:"#2f80ed"}},children:B.name})};return(0,go.jsxs)(gt,{icon:(0,go.jsx)(jl.default,{sx:{fontSize:18,display:"block"}}),title:(0,go.jsxs)(go.Fragment,{children:["\uD30C\uC77C ",o.length>0?o.length:""]}),children:[(0,go.jsxs)(ht.Box,{sx:{display:"flex",flexDirection:"column",gap:.5,mt:1},children:[o.map((B,M)=>{let S=`${B.uuid||B.name}-${M}`;if(h){let E=b(M),y=E==="uploading";return g(S,(0,go.jsx)(ht.Box,{component:"span",sx:{...Ba,color:E==="done"?"#37352f":"#9a9a97"},children:B.name}),y?(0,go.jsx)(ya,{}):Sa(B.size),{uploading:y,removeIndex:!r&&!u?M:void 0})}return B.uuid?g(S,C(B),Sa(B.size),{removeIndex:r?void 0:M}):g(S,(0,go.jsx)(ht.Box,{component:"span",title:"\uC2E4\uD30C\uC77C\uC774 \uC5C6\uB294 \uC774\uC804 \uBC29\uC2DD \uCCA8\uBD80\uC785\uB2C8\uB2E4(\uB2E4\uC6B4\uB85C\uB4DC \uBD88\uAC00) \u2014 \uB2E4\uC2DC \uCCA8\uBD80\uD574 \uC8FC\uC138\uC694.",sx:{...Ba,color:"#9a9a97"},children:B.name}),Sa(B.size),{removeIndex:r?void 0:M})}),!h&&u?u.queue.slice(u.index-1).map((B,M)=>{let S=M===0;return g(`uploading-${u.index+M}-${B.name}`,(0,go.jsx)(ht.Box,{component:"span",sx:{...Ba,color:"#9a9a97"},children:B.name}),S?(0,go.jsx)(ya,{}):Sa(B.size),{uploading:S})}):null]}),(0,go.jsx)(ht.Box,{onClick:()=>m.current?.click(),onDragOver:B=>{B.preventDefault(),p(!0)},onDragLeave:()=>p(!1),onDrop:B=>{B.preventDefault(),p(!1);let M=Array.from(B.dataTransfer.files);M.length>0&&t(e,M)},sx:{mt:1,py:2.5,display:"flex",alignItems:"center",justifyContent:"center",gap:.5,border:"1.5px dashed",borderColor:s?"#2f80ed":"#cfcfcc",borderRadius:1,bgcolor:s?"#eef6ff":"transparent",color:"#787774",fontSize:13.5,cursor:"pointer",transition:"background-color 0.15s, border-color 0.15s","&:hover":{bgcolor:"#fafaf9",borderColor:"#9a9a97"}},children:c?`\uD30C\uC77C\uC744 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${x}MB)`:`\uD30C\uC77C\uC744 \uB04C\uC5B4\uB2E4 \uB193\uAC70\uB098 \uD074\uB9AD\uD574 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${x}MB)`}),(0,go.jsx)(ht.Box,{component:"input",ref:m,type:"file",multiple:!0,onChange:B=>{let M=Array.from(B.target.files??[]);M.length>0&&t(e,M),B.target.value=""},sx:{display:"none"}})]})}var nf=require("react"),qt=require("@mui/material"),rf=a(require("@mui/icons-material/Add"),1);var ki=require("react"),Ar=require("@mui/material"),Jp=require("@ehfuse/mui-form-dialog"),ef=require("@ehfuse/mui-form-controls"),of=require("@ehfuse/mui-color-picker"),tf=require("@ehfuse/alerts");var Xt=require("react/jsx-runtime"),Zp="#2f80ed";function Xl({open:e,onClose:o,onSubmit:t}){let[n,r]=(0,ki.useState)(""),[i,l]=(0,ki.useState)(Zp);(0,ki.useEffect)(()=>{e&&(r(""),l(Zp))},[e]);let s=()=>{let c=n.trim();if(!c){(0,tf.ErrorAlert)("\uB77C\uBCA8 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}t(c,i),o()},p=Za(i),m=(0,Xt.jsxs)(Ar.Box,{children:[(0,Xt.jsxs)(Ar.Box,{sx:{display:"flex",alignItems:"center",gap:1.5,mt:.5},children:[(0,Xt.jsx)(ef.ClearTextField,{label:"\uB77C\uBCA8 \uC774\uB984",value:n,onChange:c=>r(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),s())},fullWidth:!0,autoFocus:!0}),(0,Xt.jsx)(of.ColorPicker,{value:i,onChange:c=>l(c),shape:"circle",colorSize:28})]}),(0,Xt.jsxs)(Ar.Box,{sx:{mt:2,display:"flex",alignItems:"center",gap:1,fontSize:13,color:"#787774"},children:["\uBBF8\uB9AC\uBCF4\uAE30",(0,Xt.jsx)(Ge,{option:{key:"__preview__",name:n.trim()||"\uB77C\uBCA8",...p}})]})]});return(0,Xt.jsx)(Jp.FormDialog,{open:e,onClose:o,maxWidth:"xs",title:"\uC0C8 \uB77C\uBCA8 \uCD94\uAC00",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-add-label",sections:[{id:"add-label",showTitle:!1,children:m}],actions:{showCancelButton:!0,right:(0,Xt.jsx)(Ar.Button,{variant:"contained",onClick:s,children:"\uCD94\uAC00"})}})}var st=require("react/jsx-runtime");function Ti({anchorEl:e,selectedKeys:o,labelOptions:t,onToggle:n,onAddLabel:r,onClose:i}){let[l,s]=(0,nf.useState)(!1),p=Wt();return(0,st.jsxs)(st.Fragment,{children:[(0,st.jsxs)(qt.Menu,{anchorEl:e,open:!!e,onClose:i,transitionDuration:0,...p,children:[t.map(m=>{let c=o.includes(m.key);return(0,st.jsxs)(qt.MenuItem,{onClick:()=>n(m.key),sx:{fontSize:14,minWidth:170,gap:1},children:[(0,st.jsx)(qt.Checkbox,{size:"small",checked:c,sx:{p:0}}),(0,st.jsx)(Ge,{option:m})]},m.key)}),(0,st.jsx)(qt.Divider,{}),(0,st.jsxs)(qt.MenuItem,{onClick:()=>s(!0),sx:{fontSize:14,color:"#787774"},children:[(0,st.jsx)(qt.ListItemIcon,{children:(0,st.jsx)(rf.default,{sx:{fontSize:18,color:"#787774"}})}),"\uB77C\uBCA8 \uCD94\uAC00"]})]}),(0,st.jsx)(Xl,{open:l,onClose:()=>s(!1),onSubmit:r})]})}function af(e,o){let t=Number(e.author_account_seq??0);return o.filter(n=>{let r=Number(n.account_seq??0);return r>0&&r!==t})}function lf(e,o){let t=(e.target_account_seqs??[]).filter(x=>x>0);if(t.length===0)return null;let n=new Set(t),r=af(e,o),i=new Map;for(let x of r){let f=String(x.department??"").trim();if(!f)continue;let u=i.get(f)??[];u.push(x),i.set(f,u)}let l=[],s=new Set;for(let[x,f]of i)if(f.every(h=>n.has(Number(h.account_seq??0)))){l.push(x);for(let h of f)s.add(Number(h.account_seq??0))}let p=new Map(r.map(x=>[Number(x.account_seq??0),x.name])),m=e.target_names??[],c=[];return t.forEach((x,f)=>{s.has(x)||c.push(p.get(x)??m[f]??"\uC774\uB984\uC5C6\uC74C")}),{teamNames:l,individualNames:c}}function yi(e,o){let t=lf(e,o);return t?[...t.teamNames,...t.individualNames].join(", "):"\uBAA8\uB4E0 \uC9C1\uC6D0"}function qh(e,o){let t=lf(e,o);return t?{kind:"members",teamNames:t.teamNames,individualNames:t.individualNames}:{kind:"everyone"}}function Ql(e,o,t){let n=(e.target_account_seqs??[]).filter(c=>c>0),r=af(e,o),i=n.length>0?n.length:r.length,l=e.acks??[],s=t>0&&l.some(c=>c.account_seq===t),p=t>0&&Number(e.author_account_seq??0)===t,m=n.length===0||n.includes(t);return{count:l.length,total:i,acked:s,canAck:t>0&&!p&&m&&!s&&!e.completed}}function Zl(e,o){let t=Number(o)||50,n=t*1024*1024,r=e.filter(s=>s.size>n),i=e.filter(s=>s.size<=n),l=r.length>0?`\uD30C\uC77C\uC740 1\uAC1C\uB2F9 \uCD5C\uB300 ${t}MB \uAE4C\uC9C0 \uCCA8\uBD80\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
|
|
7
7
|
\uC81C\uC678\uB41C \uD30C\uC77C: ${r.map(s=>s.name).join(", ")}`:null;return{accepted:i,rejected:r,message:l}}var ue=require("react/jsx-runtime"),es="#0f9d58";function va({form:e,statusOptions:o,customTabs:t,sprints:n=[],avatarSrcByName:r,isNotice:i=!1,hideProject:l=!1,hideBug:s=!1,leadingRow:p,hideLabel:m=!1,employees:c=[],myAccountSeq:x=0,onMemberEdit:f,onAddProject:u,onAddLabelOption:h,contentSyncKey:R="create"}){let I=Ht(),b=pr(),g=e.useFormValue("manager_name"),C=e.useFormValue("receiver_names"),B=e.useFormValue("start_date"),M=!!e.useFormValue("is_event"),S=!!e.useFormValue("is_bug"),E=e.useFormValue("bug_repro")??"",y=e.useFormValue("bug_device")??"",k=e.useFormValue("bug_where")??"",w=e.useFormValue("bug_version")??"",A=e.useFormValue("event_time")??"",d=e.useFormValue("event_place")??"",T=e.useFormValue("event_address")??"",z=e.useFormValue("due_date"),N=e.useFormValue("estimated_time")??"",H=e.useFormValue("reminder"),W=e.useFormValue("priority"),he=e.useFormValue("content"),ye=e.useFormValue("checklist")??[],be=e.useFormValue("tab_key"),ze=e.useFormValue("sprint_seq")??0,_e=e.useFormValue("story_points")??0,ge=t.find(L=>L.key===be&&L.useSprints),re=ge?n.filter(L=>`custom-${L.group_seq}`===be):[],[qe,to]=(0,Jl.useState)(null),V=e.useFormValue("label_keys"),[$,te]=(0,Jl.useState)(null),v=e.useFormValue("target_names"),O=e.useFormValue("target_account_seqs"),se=I.useValue("createAttachmentFiles")??[],We=i?yi({author_account_seq:x,target_names:v,target_account_seqs:O},c):"";return(0,ue.jsxs)(ue.Fragment,{children:[p,i?null:(0,ue.jsx)(Mo.Box,{sx:{display:"flex",gap:1.25,px:2,pt:1.5,pb:1.5,flexShrink:0},children:[{value:"task",label:"\uC5C5\uBB34"},{value:"event",label:"\uC77C\uC815"},...s?[]:[{value:"bug",label:"\uC624\uB958"}]].map(L=>{let we=S?"bug":M?"event":"task",Ae=we===L.value;return(0,ue.jsx)(Mo.ButtonBase,{onClick:()=>{if(we===L.value)return;e.setFormValue("is_event",L.value==="event"),e.setFormValue("is_bug",L.value==="bug"),e.setFormValue("is_open",L.value==="bug");let ke=e.getFormValue("icon"),Q=e.getFormValue("icon_color"),Ne=[Ve,"event",fr].includes(ke),j=!Q||Q===es||Q===xr;Ne&&e.setFormValue("icon",L.value==="event"?"event":L.value==="bug"?fr:Ve),j&&e.setFormValue("icon_color",L.value==="event"?es:L.value==="bug"?xr:"")},sx:{px:1.75,py:.75,borderRadius:99,fontSize:13.5,fontWeight:Ae?600:400,color:Ae?"#ffffff":"#787774",bgcolor:Ae?"#2563eb":"#f4f4f2"},children:L.label},L.label)})}),(0,ue.jsx)(Mo.Divider,{sx:{borderColor:"#e6e6e3"}}),(0,ue.jsxs)(Mo.Box,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:.25},children:[(0,ue.jsx)(pi,{hideProject:l,showEstimatedTime:!M,values:{tabKey:be,managerName:g,receiverNames:C,startDate:B,dueDate:z,reminder:H,priority:W,estimatedTime:N,eventTime:A,eventPlace:d,eventAddress:T},onChangeEstimatedTime:L=>e.setFormValue("estimated_time",L),customTabs:t,avatarSrcByName:r,notice:i,event:M,onChangeEventTime:L=>e.setFormValue("event_time",L),onChangeEventPlace:L=>e.setFormValue("event_place",L),onChangeEventAddress:L=>e.setFormValue("event_address",L),targetSummary:We,onChangeProject:L=>e.setFormValue("tab_key",L),onAddProject:u,onChangeStartDate:L=>e.setFormValue("start_date",L),onChangeDueDate:L=>e.setFormValue("due_date",L),onChangeReminder:L=>e.setFormValue("reminder",L),onChangePriority:L=>e.setFormValue("priority",L),onMemberEdit:f,trailing:(0,ue.jsxs)(ue.Fragment,{children:[ge&&!M&&!i?(0,ue.jsxs)(ue.Fragment,{children:[(0,ue.jsx)(ve,{icon:(0,ue.jsx)(uf.default,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:L=>to(L),children:ze>0?re.find(L=>L.seq===ze)?.name??"\uC0AD\uC81C\uB41C \uBAA9\uD45C":(0,ue.jsx)(Mo.Box,{component:"span",sx:{color:"#9a9a97"},children:"\uBBF8\uBC30\uC815"})}),(0,ue.jsx)(ve,{icon:(0,ue.jsx)(df.default,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",children:(0,ue.jsx)(Yt,{value:_e>0?String(_e):"",placeholder:"\uBBF8\uCD94\uC815",onCommit:L=>e.setFormValue("story_points",Number(L.replace(/[^0-9.]/g,""))||0)})})]}):null,S?(0,ue.jsx)(fi,{values:{repro:E,device:y,where:k,version:w},onChangeRepro:L=>e.setFormValue("bug_repro",L),onChangeDevice:L=>e.setFormValue("bug_device",L),onChangeWhere:L=>e.setFormValue("bug_where",L),onChangeVersion:L=>e.setFormValue("bug_version",L)}):null]}),leading:M||m?null:(0,ue.jsx)(Mo.Box,{sx:{gridColumn:"1 / -1"},children:(0,ue.jsx)(ve,{icon:(0,ue.jsx)(mf.default,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:L=>te(L),children:(V??[]).length>0?(0,ue.jsx)(ln,{labelKeys:V??[],labelOptions:o}):(0,ue.jsx)(Mo.Box,{component:"span",sx:{color:"#9a9a97"},children:"\uBE44\uC5B4 \uC788\uC74C"})})})}),(0,ue.jsx)(Mo.Divider,{sx:{my:1.5,borderColor:"#e6e6e3"}}),(0,ue.jsx)(gt,{icon:(0,ue.jsx)(sf.default,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",children:(0,ue.jsx)(xi,{syncKey:R,value:he,onChange:L=>e.setFormValue("content",L)})}),M?null:(0,ue.jsx)(Mo.Divider,{sx:{my:1.5,borderColor:"#e6e6e3"}}),M?null:(0,ue.jsx)(hi,{taskSeq:0,checklist:ye,onAdd:(L,we)=>e.setFormValue("checklist",[...ye,{label:we,checked:!1}]),onToggle:(L,we,Ae)=>e.setFormValue("checklist",ye.map((ke,Q)=>Q===we?{...ke,checked:Ae}:ke)),onRemove:(L,we)=>e.setFormValue("checklist",ye.filter((Ae,ke)=>ke!==we)),onUpdate:(L,we,Ae)=>e.setFormValue("checklist",ye.map((ke,Q)=>Q===we?{...ke,label:Ae}:ke))}),(0,ue.jsx)(Mo.Divider,{sx:{my:1.5,borderColor:"#e6e6e3"}}),(0,ue.jsx)(bi,{taskSeq:0,attachments:se.map(L=>({name:L.name,size:L.size})),onAdd:(L,we)=>{let Ae=Zl(we,b);Ae.message&&(0,ff.InfoAlert)(Ae.message),Ae.accepted.length!==0&&I.setValue("createAttachmentFiles",[...I.getValue("createAttachmentFiles")??[],...Ae.accepted])},onRemove:(L,we)=>I.setValue("createAttachmentFiles",se.filter((Ae,ke)=>ke!==we))}),S?null:(0,ue.jsxs)(ue.Fragment,{children:[(0,ue.jsx)(Mo.Divider,{sx:{my:1.5,borderColor:"#e6e6e3"}}),(0,ue.jsx)(gt,{icon:(0,ue.jsx)(cf.default,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:(0,ue.jsx)(pf.TextField,{form:e,name:"note",placeholder:"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",sx:{mt:1}})})]})]}),(0,ue.jsx)(Mo.Menu,{transitionDuration:0,anchorEl:qe,open:!!qe,onClose:()=>to(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...re.map(L=>({seq:L.seq,label:xt(L)}))].map(L=>(0,ue.jsx)(Mo.MenuItem,{onClick:()=>{e.setFormValue("sprint_seq",L.seq),to(null)},sx:{fontSize:14,minWidth:170},children:L.label},L.seq))}),(0,ue.jsx)(Ti,{anchorEl:$,selectedKeys:V??[],labelOptions:o,onToggle:L=>e.setFormValue("label_keys",Vr(V??[],L)),onAddLabel:(L,we)=>h?.(L,we),onClose:()=>te(null)})]})}var Re=require("react/jsx-runtime");function Ah({open:e,onClose:o,...t}){let{form:n,presetDueDate:r="",presetTabKey:i="",presetManager:l=null,isNotice:s=!1,defaultBug:p=!1}=t,m=Ht(),c=(0,rr.useRef)(!1),[x,f]=(0,rr.useState)(0),[u,h]=(0,rr.useState)(null),R=n.useFormValue("title"),I=n.useFormValue("icon"),b=n.useFormValue("icon_color"),g=!!n.useFormValue("is_event"),C=!!n.useFormValue("is_bug"),B=Ye(),S=m.useValue("createSubmitting")??!1,E=Vn(I||Ve),y=s?"\uACF5\uC9C0 \uB4F1\uB85D":g?"\uC77C\uC815 \uB4F1\uB85D":C?"\uC624\uB958 \uB4F1\uB85D":"\uC5C5\uBB34 \uB4F1\uB85D",k=s?"\uACF5\uC9C0 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":g?"\uC77C\uC815 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":C?"\uC5B4\uB5A4 \uC624\uB958\uC778\uC9C0 \uD55C \uC904\uB85C \uC801\uC5B4\uC8FC\uC138\uC694":"\uC5C5\uBB34 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694";(0,rr.useEffect)(()=>{let d=c.current;c.current=e,!(!e||d)&&(n.setFormValues({...n.getFormValues(),title:"",icon:s?Vo:p?fr:Ve,icon_color:s?"#e5484d":p?xr:"",manager_name:l?.name??"",manager_account_seq:l?.accountSeq??0,receiver_names:[],receiver_account_seqs:[],is_notice:s,is_event:!1,is_bug:p,is_open:p,bug_repro:"",bug_device:"",bug_where:"",bug_version:"",event_time:"",event_place:"",event_address:"",target_names:[],target_account_seqs:[],start_date:mo(new Date),due_date:r,reminder:"none",priority:"medium",note:"",content:"",checklist:[],tab_key:i}),m.setValue("createAttachmentFiles",[]),f(T=>T+1))},[e]);let w=(0,Re.jsxs)(lo.Box,{sx:{display:"flex",alignItems:"center",gap:1,px:2,pt:2,pb:1},children:[(0,Re.jsx)(lo.IconButton,{size:"small","aria-label":"\uC544\uC774\uCF58 \uBCC0\uACBD",onClick:d=>h(d.currentTarget),sx:{p:0,color:b||"#1e3a8a"},children:(0,Re.jsx)(E,{sx:{fontSize:20}})}),(0,Re.jsx)(lo.Box,{component:"input",autoFocus:!0,spellCheck:!1,value:R,placeholder:k,onChange:d=>n.setFormValue("title",d.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}}})]}),A=(0,Re.jsx)(tr,{anchorEl:u,value:I,color:b||"#1e3a8a",onSelect:d=>n.setFormValue("icon",d),onSelectColor:d=>n.setFormValue("icon_color",d),onClose:()=>h(null)});return B?(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsx)(hf.FormDialog,{open:e,onClose:o,locale:"ko",fontScale:{enabled:!0,default:1.1,min:.6},title:y,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1},custom:[{icon:(0,Re.jsx)(lo.Button,{variant:"contained",size:"small",disableElevation:!0,disabled:S,onClick:S?void 0:n.submit,sx:{ml:2,minWidth:0,px:1.5,py:.35,fontSize:14,fontWeight:600,bgcolor:"#2f80ed","&:hover":{bgcolor:"#2f80ed"}},children:"\uC800\uC7A5"}),tooltip:S?"\uC800\uC7A5 \uC911\u2026":""}]},fullScreen:!0,mobilePresentation:"slide",tabs:{visible:!1},contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,contentBottomPadding:0,scrollPastLastSection:!1,overlayScrollbar:{enabled:!0,contentStyle:{minWidth:0}},actions:{visible:!1},sections:[{id:"task-create",title:"",showTitle:!1,children:(0,Re.jsx)(lo.Box,{sx:{width:"100%",minWidth:0,display:"flex",flexDirection:"column",gap:0},children:(0,Re.jsx)(va,{...t,contentSyncKey:`create-${x}`,leadingRow:w})})}]}),A]}):(0,Re.jsxs)(Re.Fragment,{children:[(0,Re.jsx)(lo.Drawer,{anchor:"right",open:e,onClose:o,sx:{zIndex:d=>d.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:(0,Re.jsxs)(lo.Box,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[(0,Re.jsxs)(lo.Box,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[(0,Re.jsx)(lo.Tooltip,{title:"\uC544\uC774\uCF58 \uBCC0\uACBD",arrow:!0,children:(0,Re.jsx)(lo.IconButton,{size:"small",onClick:d=>h(d.currentTarget),sx:{color:b||"#1e3a8a"},children:(0,Re.jsx)(E,{sx:{fontSize:20}})})}),(0,Re.jsx)(lo.Box,{component:"input",autoFocus:!0,spellCheck:!1,value:R,placeholder:k,onChange:d=>n.setFormValue("title",d.target.value),sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:18,fontWeight:500,color:"#37352f",p:0,m:0,"&::placeholder":{color:"#c9c8c5",fontWeight:400}}}),(0,Re.jsx)(lo.IconButton,{"aria-label":"\uB2EB\uAE30",onClick:o,sx:{color:"#6b7280"},children:(0,Re.jsx)(xf.default,{})})]}),(0,Re.jsx)(lo.Divider,{sx:{borderColor:"#e6e6e3"}}),(0,Re.jsx)(lo.Box,{sx:{flex:1,minHeight:0},children:(0,Re.jsx)(gf.default,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:(0,Re.jsx)(va,{...t,contentSyncKey:`create-${x}`})})}),(0,Re.jsx)(lo.Divider,{sx:{borderColor:"#e6e6e3"}}),(0,Re.jsxs)(lo.Box,{sx:{display:"flex",justifyContent:"flex-end",gap:1,px:2,py:1.5,flexShrink:0},children:[(0,Re.jsx)(lo.Button,{onClick:o,color:"inherit",disabled:S,children:"\uCDE8\uC18C"}),(0,Re.jsx)(lo.Button,{onClick:n.submit,variant:"contained",disabled:S,children:S?"\uB4F1\uB85D \uC911\u2026":"\uB4F1\uB85D"})]})]})}),A]})}var zn=require("react"),Dt=require("@mui/material"),lx=a(require("@mui/icons-material/ShareOutlined"),1),sx=a(require("@ehfuse/overlay-scrollbar"),1),cx=require("@ehfuse/mui-form-dialog"),fs=require("@ehfuse/alerts");var At=require("react"),X=require("@mui/material"),ts=a(require("@mui/icons-material/Send"),1),kf=require("@ehfuse/mui-form-controls"),Si=a(require("@mui/icons-material/Close"),1),Tf=a(require("@mui/icons-material/EditOutlined"),1),yf=a(require("@mui/icons-material/Favorite"),1),Sf=a(require("@mui/icons-material/FavoriteBorderOutlined"),1),Bf=a(require("@mui/icons-material/CheckCircle"),1),Cf=a(require("@mui/icons-material/CheckCircleOutlineOutlined"),1),ir=a(require("@mui/icons-material/AttachFileOutlined"),1),vf=a(require("@mui/icons-material/AddCircleOutline"),1),If=a(require("@mui/icons-material/ImageOutlined"),1);var os=e=>{if(e===0)return"0 Bytes";let o=1024,t=["Bytes","KB","MB","GB","TB"],n=Math.floor(Math.log(e)/Math.log(o));return parseFloat((e/Math.pow(o,n)).toFixed(2))+" "+t[n]};var F=require("react/jsx-runtime"),Lh=5;function bf({kind:e,reactions:o,myAccountSeq:t,onToggle:n}){let r=o??[],i=t>0&&r.some(m=>m.account_seq===t),l=e==="like"?"\uC88B\uC544\uC694":"\uD655\uC778",s=r.length===0?l:(0,F.jsx)(X.Box,{sx:{whiteSpace:"pre-line",fontSize:12},children:r.map(m=>`${m.name} \xB7 ${m.time}`).join(`
|
|
8
8
|
`)}),p=e==="like"?"#e5484d":"#2f80ed";return(0,F.jsx)(X.Tooltip,{title:s,arrow:!0,enterDelay:300,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:(0,F.jsxs)(X.Box,{sx:{display:"inline-flex",alignItems:"center"},children:[(0,F.jsx)(X.IconButton,{size:"small","aria-label":`\uB313\uAE00 ${l}`,onClick:n,sx:{color:i?p:"#c9c8c5",p:.5},children:e==="like"?i?(0,F.jsx)(yf.default,{sx:{fontSize:16}}):(0,F.jsx)(Sf.default,{sx:{fontSize:16}}):i?(0,F.jsx)(Bf.default,{sx:{fontSize:16}}):(0,F.jsx)(Cf.default,{sx:{fontSize:16}})}),r.length>0?(0,F.jsx)(X.Box,{component:"span",sx:{fontSize:12,color:i?p:"#9a9a97",ml:-.25},children:r.length}):null]})})}function ns({taskSeq:e,comments:o,currentUserName:t="",myAccountSeq:n=0,avatarSrcByName:r,onUpdate:i,onRemove:l,onToggleReaction:s,onPreview:p,onDownload:m}){let[c,x]=(0,At.useState)(null),f=(0,At.useRef)(null),[u,h]=(0,At.useState)(null),[R,I]=(0,At.useState)(!1),b=Math.max(0,o.length-Lh),g=b>0&&!R,C=c?Math.min(c.index,b):b,B=o.map((k,w)=>({comment:k,index:w})).slice(g?C:0),M=dr(),S=k=>{if(p){p(k);return}window.open(M(k.uuid??""),"_blank","noopener,noreferrer")},E=k=>{if(m){m(k);return}window.open(M(k.uuid??"",{download:!0}),"_blank","noopener,noreferrer")},y=ot().slots?.avatar;return(0,F.jsxs)(X.Box,{sx:{px:2,pb:2,display:"flex",flexDirection:"column",gap:.25},children:[(0,F.jsxs)(X.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,F.jsx)(sn,{sx:{fontSize:18,display:"block",color:"#37352f"}}),(0,F.jsxs)(X.Box,{sx:{fontSize:Pr,fontWeight:500,color:"#37352f"},children:["\uB313\uAE00",o.length>0?` (${o.length})`:""]}),b>0&&(!g||C>0)?(0,F.jsx)(X.Box,{role:"button",tabIndex:0,onClick:()=>I(k=>!k),onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),I(w=>!w))},sx:{ml:"auto",flexShrink:0,cursor:"pointer",fontSize:14.5,color:"#5b87d6","&:hover":{textDecoration:"underline"}},children:g?`\uC774\uC804 \uB313\uAE00 ${C}\uAC1C \uB354 \uBCF4\uAE30`:"\uC774\uC804 \uB313\uAE00 \uC811\uAE30"}):null]}),o.length===0?(0,F.jsx)(X.Box,{sx:{mt:1,fontSize:14.5,color:"#9a9a97"},children:"\uB4F1\uB85D\uB41C \uB313\uAE00\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,(0,F.jsx)(X.Box,{sx:{display:"flex",flexDirection:"column",gap:1,mt:1},children:B.map(({comment:k,index:w})=>{let A=!!t&&k.author===t;return(0,F.jsxs)(X.Box,{sx:{display:"flex",gap:1.5,alignItems:"flex-start","&:hover .taskbox-comment-actions":{opacity:1,pointerEvents:"auto"},"&:not(:last-child)":{borderBottom:"1px dashed #e0dfdc",pb:1}},children:[(()=>{let d=r?.get(k.author)??"";return y?(0,F.jsx)(X.Box,{sx:{display:"inline-flex",flexShrink:0},children:(0,F.jsx)(y,{name:k.author,src:d||void 0,size:44})}):(0,F.jsx)(X.Box,{sx:{display:"inline-flex",flexShrink:0},children:(0,F.jsx)(Kt,{src:d,avatarSx:{width:44,height:44,fontSize:20,borderRadius:"50%",...Yn[0]},iconFontSize:24})})})(),(0,F.jsxs)(X.Box,{sx:{flex:1,minWidth:0},children:[(0,F.jsxs)(X.Box,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0,position:"relative"},children:[(0,F.jsx)(X.Box,{component:"span",sx:{fontSize:14.5,fontWeight:700,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:k.author}),(0,F.jsx)(X.Box,{component:"span",sx:{fontSize:12.5,color:"#9a9a97",flexShrink:0,whiteSpace:"nowrap"},children:k.time}),A?(0,F.jsx)(X.Box,{sx:{ml:"auto"}}):(0,F.jsxs)(X.Box,{sx:{display:"flex",alignItems:"center",gap:.25,ml:"auto",flexShrink:0},children:[(0,F.jsx)(bf,{kind:"like",reactions:k.likes,myAccountSeq:n,onToggle:()=>s?.(e,w,"like")}),(0,F.jsx)(bf,{kind:"ack",reactions:k.acks,myAccountSeq:n,onToggle:()=>s?.(e,w,"ack")})]}),A?(0,F.jsxs)(X.Box,{className:"taskbox-comment-actions",sx:{display:"flex",alignItems:"center",gap:.25,position:"absolute",right:0,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",backgroundColor:"#fff",opacity:0,transition:"opacity 0.15s"},children:[(0,F.jsx)(X.IconButton,{size:"small","aria-label":"\uB313\uAE00 \uC218\uC815",onClick:()=>x({index:w,text:k.text,attachments:[...k.attachments??[]],files:[]}),sx:{color:"#9a9a97"},children:(0,F.jsx)(Tf.default,{sx:{fontSize:15}})}),(0,F.jsx)(X.IconButton,{size:"small","aria-label":"\uB313\uAE00 \uC0AD\uC81C",onClick:d=>h({anchorEl:d.currentTarget,index:w}),sx:{color:"#9a9a97"},children:(0,F.jsx)(Si.default,{sx:{fontSize:15}})})]}):null]}),c?.index===w?(0,F.jsxs)(X.Box,{sx:{mt:.5},children:[(0,F.jsx)(X.Box,{component:"textarea",autoFocus:!0,spellCheck:!1,value:c.text,onChange:d=>x({...c,text:d.target.value}),sx:{width:"100%",minHeight:56,border:"1px solid #dedddb",borderRadius:1,outline:"none",font:"inherit",fontSize:14,p:1,resize:"vertical"}}),(0,F.jsxs)(X.Box,{sx:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:.75,mt:.75},children:[c.attachments.map((d,T)=>{let z=()=>x({...c,attachments:c.attachments.filter((N,H)=>H!==T)});return Ia(d.name)&&d.uuid?(0,F.jsxs)(X.Box,{sx:{position:"relative"},children:[(0,F.jsx)(X.Box,{component:"img",src:M(d.uuid,{thumb:"md"}),alt:d.name,title:d.name,loading:"lazy",sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",display:"block"}}),(0,F.jsx)(X.IconButton,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:z,sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:(0,F.jsx)(Si.default,{sx:{fontSize:14}})})]},`kept-${d.uuid}-${T}`):(0,F.jsx)(X.Chip,{size:"small",icon:(0,F.jsx)(ir.default,{sx:{fontSize:14}}),label:d.name,onDelete:z,sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`kept-${d.uuid??d.name}-${T}`)}),c.files.map((d,T)=>{let z=()=>x({...c,files:c.files.filter((N,H)=>H!==T)});return Ia(d.name)?(0,F.jsxs)(X.Box,{sx:{position:"relative"},children:[(0,F.jsx)(X.Box,{component:"img",src:URL.createObjectURL(d),alt:d.name,title:`${d.name} (\uC0C8 \uD30C\uC77C)`,onLoad:N=>URL.revokeObjectURL(N.target.src),sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"2px solid #2f80ed",display:"block"}}),(0,F.jsx)(X.IconButton,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:z,sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:(0,F.jsx)(Si.default,{sx:{fontSize:14}})})]},`new-${d.name}-${T}`):(0,F.jsx)(X.Chip,{size:"small",icon:(0,F.jsx)(ir.default,{sx:{fontSize:14}}),label:`${d.name} (\uC0C8 \uD30C\uC77C)`,onDelete:z,sx:{fontSize:14,height:26,bgcolor:"#eef4ff"}},`new-${d.name}-${T}`)}),(0,F.jsx)(X.Tooltip,{title:"\uCCA8\uBD80 \uCD94\uAC00",arrow:!0,children:(0,F.jsx)(X.IconButton,{size:"small","aria-label":"\uCCA8\uBD80 \uCD94\uAC00",onClick:()=>f.current?.click(),sx:{ml:"auto",color:"#2f80ed"},children:(0,F.jsx)(vf.default,{sx:{fontSize:20}})})})]}),(0,F.jsxs)(X.Box,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:.75,mt:.5},children:[(0,F.jsx)(X.Button,{size:"small",color:"inherit",onClick:()=>x(null),children:"\uCDE8\uC18C"}),(0,F.jsx)(X.Button,{size:"small",variant:"contained",disabled:!c.text.trim()&&c.attachments.length===0&&c.files.length===0,onClick:()=>{i(e,w,c.text,{attachments:c.attachments,files:c.files}),x(null)},children:"\uC800\uC7A5"})]}),(0,F.jsx)(X.Box,{component:"input",type:"file",multiple:!0,ref:f,sx:{display:"none"},onChange:d=>{let T=Array.from(d.target.files??[]);T.length>0&&x({...c,files:[...c.files,...T].slice(0,10)}),d.target.value=""}})]}):(0,F.jsxs)(X.Box,{children:[k.text?(0,F.jsx)(X.Box,{sx:{fontSize:15,whiteSpace:"pre-wrap"},children:k.text}):null,(k.attachments??[]).length>0?(0,F.jsx)(X.Box,{sx:{display:"flex",flexWrap:"wrap",gap:.75,mt:.75},children:(k.attachments??[]).map((d,T)=>{let z=!!d.uuid;if(Ia(d.name)&&z)return(0,F.jsx)(X.Box,{component:"img",src:M(d.uuid??"",{thumb:"md"}),alt:d.name,title:`${d.name} \uD06C\uAC8C \uBCF4\uAE30`,loading:"lazy",onClick:()=>S(d),sx:{width:96,height:96,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",cursor:"pointer",bgcolor:"#f8fafc"}},`${d.name}-${T}`);let H=Ta(d.name);return(0,F.jsx)(X.Chip,{size:"small",icon:(0,F.jsx)(ir.default,{sx:{fontSize:14}}),label:`${d.name} (${os(d.size)})`,clickable:z,onClick:z?()=>H?S(d):E(d):void 0,title:z?`${d.name} ${H?"\uBBF8\uB9AC\uBCF4\uAE30":"\uB2E4\uC6B4\uB85C\uB4DC"}`:d.name,sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`${d.name}-${T}`)})}):null]})]})]},`${k.time}-${w}`)})}),(0,F.jsx)(uo,{open:!!u,anchorEl:u?.anchorEl??null,title:"\uC774 \uB313\uAE00\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uC0AD\uC81C",onCancel:()=>h(null),onConfirm:()=>{u&&(l(e,u.index),x(null)),h(null)}})]})}function Ia(e){return/\.(png|jpe?g|gif|webp|bmp|svg|heic|heif)$/i.test(String(e??"").trim())}function rs({onSubmit:e}){let[o,t]=(0,At.useState)(""),[n,r]=(0,At.useState)([]),[i,l]=(0,At.useState)(!1),s=(0,At.useRef)(null),p=(0,At.useRef)(null),m=Ye(),c=u=>{let h=Array.from(u??[]);h.length!==0&&r(R=>[...R,...h].slice(0,10))},x=()=>{let u=o.trim();!u&&n.length===0||(e(u,n.length>0?n:void 0),t(""),r([]))},f=(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(X.IconButton,{size:"small","aria-label":"\uD30C\uC77C \uCCA8\uBD80",onClick:()=>s.current?.click(),sx:{color:"#9a9a97"},children:(0,F.jsx)(ir.default,{sx:{fontSize:20}})}),(0,F.jsx)(X.IconButton,{size:"small","aria-label":"\uC774\uBBF8\uC9C0 \uCCA8\uBD80",onClick:()=>p.current?.click(),sx:{color:"#9a9a97"},children:(0,F.jsx)(If.default,{sx:{fontSize:20}})})]});return(0,F.jsxs)(X.Box,{children:[n.length>0?(0,F.jsx)(X.Box,{sx:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:.75,px:2,pt:1},children:n.map((u,h)=>Ia(u.name)?(0,F.jsxs)(X.Box,{sx:{position:"relative"},children:[(0,F.jsx)(X.Box,{component:"img",src:URL.createObjectURL(u),alt:u.name,title:u.name,onLoad:R=>URL.revokeObjectURL(R.target.src),sx:{width:72,height:72,objectFit:"cover",borderRadius:1,border:"1px solid #e6e6e3",display:"block"}}),(0,F.jsx)(X.IconButton,{size:"small","aria-label":"\uCCA8\uBD80 \uC81C\uAC70",onClick:()=>r(R=>R.filter((I,b)=>b!==h)),sx:{position:"absolute",top:-6,right:-6,p:.25,bgcolor:"#ffffff",border:"1px solid #e6e6e3","&:hover":{bgcolor:"#f1f5f9"}},children:(0,F.jsx)(Si.default,{sx:{fontSize:14}})})]},`${u.name}-${h}`):(0,F.jsx)(X.Chip,{size:"small",icon:(0,F.jsx)(ir.default,{sx:{fontSize:14}}),label:`${u.name} (${os(u.size)})`,onDelete:()=>r(R=>R.filter((I,b)=>b!==h)),sx:{fontSize:14,height:26,bgcolor:"#f1f5f9"}},`${u.name}-${h}`))}):null,(0,F.jsxs)(X.Box,{sx:{position:"relative",display:"flex"},onDragOver:u=>{Array.from(u.dataTransfer?.types??[]).includes("Files")&&(u.preventDefault(),l(!0))},onDragLeave:u=>{u.currentTarget.contains(u.relatedTarget)||l(!1)},onDrop:u=>{Array.from(u.dataTransfer?.types??[]).includes("Files")&&(u.preventDefault(),l(!1),c(u.dataTransfer?.files??null))},children:[i?(0,F.jsxs)(X.Box,{sx:{position:"absolute",inset:0,zIndex:2,display:"flex",alignItems:"center",justifyContent:"center",gap:.75,borderRadius:1,border:"2px dashed #2f80ed",bgcolor:"rgba(47,128,237,0.08)",color:"#2f80ed",fontSize:14,fontWeight:600,pointerEvents:"none"},children:[(0,F.jsx)(ir.default,{sx:{fontSize:18}}),"\uC5EC\uAE30\uC5D0 \uB193\uC73C\uBA74 \uCCA8\uBD80\uB429\uB2C8\uB2E4"]}):null,(0,F.jsx)(kf.TextField,{value:o,placeholder:"\uB313\uAE00\uC744 \uC785\uB825\uD558\uC138\uC694",onChange:u=>t(u.target.value),fullWidth:!0,multiline:!0,minRows:m?1:3,maxRows:3,sx:{"& .MuiInputBase-root":{pl:2,pr:m?15:6.5,pb:m?void 0:5,borderRadius:0},"& .MuiOutlinedInput-notchedOutline":{border:"none"}}}),m?(0,F.jsxs)(X.Box,{sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",gap:.25},children:[f,(0,F.jsx)(X.IconButton,{"aria-label":"\uB313\uAE00 \uB4F1\uB85D",disabled:!o.trim()&&n.length===0,onClick:x,sx:{color:"#2563eb","&.Mui-disabled":{color:"#c9c8c5"}},children:(0,F.jsx)(ts.default,{sx:{fontSize:22}})})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(X.Box,{sx:{position:"absolute",left:8,bottom:6,display:"flex",alignItems:"center",gap:.25},children:f}),(0,F.jsx)(X.IconButton,{"aria-label":"\uB313\uAE00 \uB4F1\uB85D",disabled:!o.trim()&&n.length===0,onClick:x,sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",color:"#2563eb","&.Mui-disabled":{color:"#c9c8c5"}},children:(0,F.jsx)(ts.default,{sx:{fontSize:22}})})]})]}),(0,F.jsx)(X.Box,{component:"input",ref:s,type:"file",multiple:!0,onChange:u=>{c(u.target.files),u.target.value=""},sx:{display:"none"}}),(0,F.jsx)(X.Box,{component:"input",ref:p,type:"file",accept:"image/*",multiple:!0,onChange:u=>{c(u.target.files),u.target.value=""},sx:{display:"none"}})]})}var is=require("react"),Wo=require("@mui/material"),Ef=a(require("@mui/icons-material/Close"),1),Mf=a(require("@mui/icons-material/ArrowBack"),1),Of=a(require("@mui/icons-material/ShareOutlined"),1),Rf=a(require("@mui/icons-material/ContentCopyOutlined"),1),Pf=a(require("@mui/icons-material/CheckCircle"),1),zf=a(require("@mui/icons-material/CheckCircleOutlineOutlined"),1);var _a=require("@ehfuse/alerts");var _f=e=>e?e.replace(/<(script|style)[\s\S]*?<\/\1>/gi,"").replace(/<br\s*\/?>/gi,`
|
|
9
9
|
`).replace(/<\/(p|div|li|h[1-6]|tr)>/gi,`
|