@ehfuse/taskbox 0.5.291 → 0.5.292
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
|
@@ -38,7 +38,7 @@ use chrome, FireFox or Internet Explorer 11`)}var r=e("safe-buffer"),t=e("random
|
|
|
38
38
|
`).replace(/<[^>]+>/g,"").replace(/ /gi," ").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&/gi,"&").replace(/\n{3,}/g,`
|
|
39
39
|
|
|
40
40
|
`).trim():"";function K5(e){let h=[`[\uC5C5\uBB34] ${e.title}`],b=hn(e.start_date),l=hn(e.due_date);(b||l)&&h.push(`\uAE30\uAC04: ${b&&l?`${b} ~ ${l}`:b||l}`),e.manager_name&&h.push(`\uCC45\uC784\uC790: ${e.manager_name}`);let o=lr(e).name;o&&h.push(`\uC0C1\uD0DC: ${o}`);let s=_p(e.content);s&&h.push("",s);let r=String(e.note??"").trim();return r&&h.push("",`\uBE44\uACE0: ${r}`),h.join(`
|
|
41
|
-
`)}function kp(e){navigator.clipboard.writeText(e).then(()=>V5("\uC5C5\uBB34 \uB0B4\uC6A9\uC744 \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>U5("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uB0B4\uC6A9\uC744 \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD574 \uC8FC\uC138\uC694."))}function Ki(e,h){let b=K5(e);if(h&&typeof navigator.share=="function"){navigator.share({text:b}).catch(l=>{l?.name!=="AbortError"&&kp(b)});return}kp(b)}import{Fragment as t4,jsx as Bt,jsxs as Sp}from"react/jsx-runtime";function Tp({task:e,myAccountSeq:h=0,onToggleCompleted:b,onChangeTitle:l,onChangeIcon:o,onChangeIconColor:s,onClose:r,appBarMode:t=!1,activityItems:n,activityLoading:c,onLoadActivity:i,onPrint:a,onDelete:d,canDelete:f}){let u=Nt(),[g,m]=Fs(!1),[x,_]=Fs(null),[B,A]=Fs(null),[j,D]=Fs(null),[P,N]=Fs(null),q=!!e.is_notice,z=!!e.is_event,T=q?_t(e.icon||or):z?_t(e.icon||ar):null,C=q&&h>0&&(e.author_account_seq??0)===h,R=!lo(e,h),p=!!d&&(f??(h>0&&(e.author_account_seq??0)===h)),y=!z&&(q?C:(e.author_account_seq??0)===h||(e.manager_account_seq??0)===h);return Sp(t4,{children:[Sp(Gi,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[t&&r?Bt(Yi,{"aria-label":"\uB4A4\uB85C",onClick:r,sx:{color:"#37352f",ml:-1},children:Bt(X5,{})}):null,y&&!t?Bt(Xi,{title:e.completed&&e.completed_by?`${e.completed_by} \xB7 ${on(e.completed_time)} \uC644\uB8CC`:"",arrow:!0,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:Bt(Gi,{sx:{display:"flex",flexShrink:0,mr:1},children:Bt(Ln,{onClick:v=>N({anchorEl:v.currentTarget,nextCompleted:!e.completed}),children:e.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC\uD558\uAE30"})})}):null,t||!T?null:z&&!R?Bt(Xi,{title:"\uC544\uC774\uCF58 \uBCC0\uACBD",arrow:!0,enterDelay:400,disableInteractive:!0,children:Bt(G5,{onClick:v=>A(v.currentTarget),sx:{display:"flex",p:.5,borderRadius:1,color:e.icon_color||"#1e3a8a","&:hover":{bgcolor:"#f2f2f0"}},children:Bt(T,{sx:{fontSize:20}})})}):Bt(Gi,{sx:{display:"flex",px:.5,color:e.icon_color||(q?"#e5484d":"#1e3a8a")},children:Bt(T,{sx:{fontSize:20}})}),x!==null?Bt(Gi,{component:"input",autoFocus:!0,spellCheck:!1,value:x,onChange:v=>_(v.target.value),onBlur:()=>{x.trim()&&x.trim()!==e.title&&l(e.seq,x.trim()),_(null)},onKeyDown:v=>{v.key==="Enter"&&v.target.blur(),v.key==="Escape"&&_(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:18,fontWeight:500,color:"#37352f",p:0,m:0}}):t?Bt(Gi,{sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:q?"\uACF5\uC9C0":z?"\uC77C\uC815":e.is_bug?"\uC624\uB958":"\uC5C5\uBB34"}):Bt(Gi,{onClick:R?void 0:()=>_(e.title),sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:R?"default":"text",textDecoration:e.completed?"line-through":"none"},children:e.title}),i?Bt(Xi,{title:"\uD65C\uB3D9",arrow:!0,children:Bt(Yi,{"aria-label":"\uD65C\uB3D9",onClick:()=>m(!0),sx:{color:"#6b7280"},children:Bt(Q5,{sx:{fontSize:20}})})}):null,Bt(Xi,{title:u?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:Bt(Yi,{"aria-label":u?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>Ki(e,u),sx:{color:"#6b7280"},children:u?Bt(Z5,{sx:{fontSize:20}}):Bt(J5,{sx:{fontSize:20}})})}),a?Bt(Xi,{title:"\uC778\uC1C4",arrow:!0,children:Bt(Yi,{"aria-label":"\uC778\uC1C4",onClick:()=>a(e),sx:{color:"#6b7280"},children:Bt(e4,{sx:{fontSize:20}})})}):null,p?Bt(Xi,{title:"\uC0AD\uC81C",arrow:!0,children:Bt(Yi,{"aria-label":"\uC0AD\uC81C",onClick:v=>D(v.currentTarget),sx:{color:"#6b7280","&:hover":{color:"#e5484d"}},children:Bt(cr,{sx:{fontSize:20}})})}):null,r&&!t?Bt(Yi,{"aria-label":"\uB2EB\uAE30",onClick:r,sx:{color:"#6b7280"},children:Bt(Y5,{})}):null]}),Bt(At,{open:!!P,anchorEl:P?.anchorEl??null,title:P?.nextCompleted?"\uC774 \uC5C5\uBB34\uB97C \uC644\uB8CC \uCC98\uB9AC\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC644\uB8CC\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:P?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>N(null),onConfirm:()=>{P&&b(e.seq,P.nextCompleted),N(null)}}),Bt(zo,{anchorEl:B,value:e.icon??"",color:e.icon_color??"",onSelect:v=>{o(e.seq,v),A(null)},onSelectColor:s?v=>s(e.seq,v):void 0,onClose:()=>A(null)}),Bt(At,{open:!!j,anchorEl:j,title:"\uC774 \uC5C5\uBB34\uB97C \uD734\uC9C0\uD1B5\uC73C\uB85C \uBCF4\uB0B4\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uC0AD\uC81C",onCancel:()=>D(null),onConfirm:()=>{D(null),d?.(e)}}),Bt(Ml,{open:g,taskSeq:e.seq,items:n,loading:c,onLoad:i,onClose:()=>m(!1)})]})}import{useState as yn}from"react";import{Box as Zt,Button as Zi,ButtonBase as Rp,Checkbox as d4,Divider as yi,Menu as Nu,MenuItem as Lu}from"@mui/material";import f4 from"@mui/icons-material/ExpandLess";import h4 from"@mui/icons-material/ExpandMore";import p4 from"@mui/icons-material/ConfirmationNumberOutlined";import Op from"@mui/icons-material/Check";import m4 from"@mui/icons-material/DirectionsRunOutlined";import g4 from"@mui/icons-material/SpeedOutlined";import ju from"@mui/icons-material/CheckCircle";import b4 from"@mui/icons-material/CheckCircleOutlineOutlined";import zu from"@mui/icons-material/CheckCircleOutlined";import Ap from"@mui/icons-material/AccessTimeOutlined";import y4 from"@mui/icons-material/AutorenewOutlined";import x4 from"@mui/icons-material/LabelOutlined";import v4 from"@mui/icons-material/PersonOutlineOutlined";import w4 from"@mui/icons-material/SubjectOutlined";import _4 from"@mui/icons-material/StickyNote2Outlined";import k4 from"@mui/icons-material/PanToolAltOutlined";import Dp from"@mui/icons-material/LockOutlined";import Pp from"@mui/icons-material/PublicOutlined";import Np from"@mui/icons-material/Group";import S4 from"@mui/icons-material/Repeat";import T4 from"@mui/icons-material/EventOutlined";import{ConfirmDialog as Lp,InfoAlert as C4}from"@ehfuse/alerts";import{DatePicker as B4}from"@ehfuse/mui-datetime-picker";import{useState as r4}from"react";import{TextField as n4}from"@ehfuse/mui-form-controls";import{jsx as o4}from"react/jsx-runtime";function Cp({value:e,onCommit:h,onDraftChange:b,readOnly:l=!1}){let[o,s]=r4(null);return o4(n4,{value:o??e,placeholder:l?"":"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",slotProps:{input:{readOnly:l}},onChange:r=>{s(r.target.value),b?.(r.target.value)},onBlur:()=>{o!==null&&o.trim()!==e&&h(o),s(null)},onKeyDown:r=>{r.key==="Enter"&&r.target.blur(),r.key==="Escape"&&s(null)},sx:{mt:1}})}import{useMemo as Du,useState as Pu}from"react";import{Box as Or,Button as Ep,IconButton as i4}from"@mui/material";import s4 from"@mui/icons-material/AccountTreeOutlined";import a4 from"@mui/icons-material/LinkOutlined";import l4 from"@mui/icons-material/Close";import c4 from"@mui/icons-material/RedoOutlined";function bi(e){return e.relations??[]}function dz(e,h,b){return bi(e).some(l=>l.type===b&&l.task_seq===h.seq)||bi(h).some(l=>l.type===b&&l.task_seq===e.seq)}function Bp(e){return`${e.created_time??""}|${String(e.seq).padStart(12,"0")}`}function Ou(e,h){let b=new Map(h.map(u=>[u.seq,u]));b.set(e.seq,e);let l=new Map,o=(u,g)=>{l.has(u)||l.set(u,new Set),l.has(g)||l.set(g,new Set),l.get(u).add(g),l.get(g).add(u)};for(let u of b.values())for(let g of bi(u))g.type==="follow_up"&&b.has(g.task_seq)&&o(u.seq,g.task_seq);let s=new Set([e.seq]),r=[e.seq];for(;r.length>0;){let u=r.shift();for(let g of l.get(u)??[])s.has(g)||(s.add(g),r.push(g))}let t=[...s].map(u=>b.get(u)).filter(u=>!!u).sort((u,g)=>Bp(u).localeCompare(Bp(g))),n=new Set;for(let u of bi(e))u.type==="related"&&n.add(u.task_seq);for(let u of b.values())u.seq!==e.seq&&bi(u).some(g=>g.type==="related"&&g.task_seq===e.seq)&&n.add(u.seq);let c=[...n].map(u=>b.get(u)).filter(u=>u!==void 0&&u.seq!==e.seq),i=[...b.values()].filter(u=>u.seq!==e.seq&&bi(u).some(g=>g.type==="duplicate_of"&&g.task_seq===e.seq)),a=bi(e).find(u=>u.type==="duplicate_of")?.task_seq,d=a?b.get(a)??null:null,f=[...b.values()].filter(u=>u.seq!==e.seq&&(u.checklist??[]).some(g=>Number(g.task_seq??0)===e.seq));return{lineage:t,related:c,duplicates:i,duplicateOf:d,parents:f}}function Au(e,h){let b=Ou(e,h);return(b.lineage.length>=2?b.lineage.length-1:0)+b.related.length+b.duplicates.length+(b.duplicateOf?1:0)+b.parents.length}function Ip(e,h){return Au(e,h)>0}import{Fragment as u4,jsx as Wt,jsxs as Rn}from"react/jsx-runtime";function Rl({item:e,caption:h,onOpen:b,onUnlink:l}){let o=e.is_notice||e.is_event?_t(e.icon||(e.is_notice?or:ar)):null;return Rn(Or,{sx:{display:"flex",alignItems:"center",gap:.75,px:1.25,py:.5,borderRadius:1,"&:hover":{bgcolor:"#f7f7f5"},"&:hover .taskbox-relation-unlink":{opacity:1}},children:[h?Wt(Or,{component:"span",sx:{flexShrink:0,px:.6,py:.1,borderRadius:.75,fontSize:11.5,fontWeight:500,color:"#8a6d1d",bgcolor:"#faf1d7"},children:h}):null,o?Wt(o,{sx:{fontSize:16,flexShrink:0,color:e.icon_color||"#1e3a8a"}}):null,Rn(Or,{component:"span",onClick:b,sx:{flex:1,minWidth:0,fontSize:14,color:e.completed?"#9a9a97":"#37352f",textDecoration:e.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...b?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[e.ticket_no?`${e.ticket_no} `:"",e.title]}),Wt(Ot,{option:lr(e),small:!0}),l?Wt(i4,{className:"taskbox-relation-unlink",size:"small","aria-label":"\uC5F0\uACB0 \uD574\uC81C",onClick:l,sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:Wt(l4,{sx:{fontSize:15}})}):null]})}function Mp({task:e,tasks:h,readOnly:b=!1,onOpenTask:l,onLink:o,onUnlink:s,onCreateFollowUp:r}){let[t,n]=Pu(!1),[c,i]=Pu(null),[a,d]=Pu(null),f=Du(()=>Ou(e,h),[e,h]),u=f.lineage.length>=2,g=Du(()=>Au(e,h),[e,h]),m=Du(()=>{let _=new Set;for(let B of f.lineage)_.add(B.seq);for(let B of f.related)_.add(B.seq);for(let B of f.duplicates)_.add(B.seq);for(let B of f.parents)_.add(B.seq);return f.duplicateOf&&_.add(f.duplicateOf.seq),[..._]},[f]),x=(_,B,A)=>{d({anchorEl:_,targetSeq:B,type:A})};return Rn(bn,{icon:Wt(s4,{sx:{fontSize:19,display:"block"}}),title:Rn(u4,{children:["\uAD00\uB828 \uC5C5\uBB34",g>0?Wt(Or,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:g}):null]}),titleExtra:b?null:Rn(Or,{sx:{ml:"auto",display:"flex",alignItems:"center",gap:.5},children:[r?Wt(Ep,{size:"small",color:"inherit",startIcon:Wt(c4,{sx:{fontSize:16}}),onClick:_=>i(_.currentTarget),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uD6C4\uC18D \uC5C5\uBB34"}):null,o?Wt(Ep,{size:"small",color:"inherit",startIcon:Wt(a4,{sx:{fontSize:16}}),onClick:()=>n(!0),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uC5F0\uACB0"}):null]}),children:[Rn(Or,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:[u?Wt(Or,{sx:{mb:f.related.length||f.duplicates.length||f.duplicateOf?1:0},children:f.lineage.map((_,B)=>{let A=_.seq===e.seq,j=B===f.lineage.length-1;return Rn(Or,{sx:{display:"flex",gap:1},children:[Rn(Or,{sx:{display:"flex",flexDirection:"column",alignItems:"center",width:14,flexShrink:0,pt:1.1},children:[Wt(Or,{sx:{width:A?9:7,height:A?9:7,borderRadius:"50%",bgcolor:A?"#2f80ed":_.completed?"#9a9a97":"#c9c8c5",flexShrink:0}}),j?null:Wt(Or,{sx:{width:"2px",flex:1,bgcolor:"#e6e6e3"}})]}),Rn(Or,{sx:{flex:1,minWidth:0,pb:j?0:.5},children:[Rn(Or,{sx:{display:"flex",alignItems:"center",gap:.75},children:[Rn(Or,{component:"span",onClick:!A&&l?()=>l(_.seq):void 0,sx:{minWidth:0,fontSize:14,fontWeight:A?600:400,color:A?"#2f80ed":_.completed?"#9a9a97":"#37352f",textDecoration:_.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...!A&&l?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[_.ticket_no?`${_.ticket_no} `:"",_.title]}),Wt(Ot,{option:lr(_),small:!0})]}),Wt(Or,{sx:{fontSize:12,color:"#9a9a97"},children:_.completed&&_.completed_time?`${_.completed_time} \uC644\uB8CC`:_.created_time??""})]})]},_.seq)})}):null,f.parents.map(_=>Wt(Rl,{item:_,caption:"\uC0C1\uC704 \uC5C5\uBB34",onOpen:l?()=>l(_.seq):void 0},`parent-${_.seq}`)),f.duplicateOf?Wt(Rl,{item:f.duplicateOf,caption:"\uC6D0\uBCF8",onOpen:l?()=>l(f.duplicateOf.seq):void 0,onUnlink:!b&&s?_=>x(_.currentTarget,f.duplicateOf.seq,"duplicate_of"):void 0}):null,f.duplicates.map(_=>Wt(Rl,{item:_,caption:"\uC911\uBCF5",onOpen:l?()=>l(_.seq):void 0,onUnlink:!b&&s?B=>x(B.currentTarget,_.seq,"duplicate_of"):void 0},`dup-${_.seq}`)),f.related.map(_=>Wt(Rl,{item:_,onOpen:l?()=>l(_.seq):void 0,onUnlink:!b&&s?B=>x(B.currentTarget,_.seq,"related"):void 0},`rel-${_.seq}`)),g===0?Wt(Or,{sx:{px:1.25,py:.75,fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]}),o?Wt(bl,{open:t,task:e,tasks:h,excludeSeqs:m,onClose:()=>n(!1),onSubmit:(_,B)=>o(e.seq,_,B)}):null,Wt(At,{open:!!c,anchorEl:c,title:"\uC774 \uC5C5\uBB34\uC5D0\uC11C \uC774\uC5B4\uC9C0\uB294 \uD6C4\uC18D \uC5C5\uBB34\uB97C \uB9CC\uB4DC\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uB9CC\uB4E4\uAE30",onCancel:()=>i(null),onConfirm:()=>{r?.(e.seq),i(null)}}),Wt(At,{open:!!a,anchorEl:a?.anchorEl??null,title:"\uC774 \uC5C5\uBB34\uC640\uC758 \uC5F0\uACB0\uC744 \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uD574\uC81C",onCancel:()=>d(null),onConfirm:()=>{a&&s?.(e.seq,a.targetSeq,a.type),d(null)}})]})}import{Fragment as qr,jsx as we,jsxs as Ut}from"react/jsx-runtime";function Ko({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return we(Zt,{component:"span",sx:{color:"#9a9a97"},children:e})}function jp({task:e,customTabs:h,statusOptions:b,avatarSrcByName:l,onChangeStatus:o,onChangeLabels:s,onAddLabelOption:r,onChangeProject:t,onAddProject:n,onChangeDate:c,onChangeReminder:i,onMemberEdit:a,onChangePriority:d,onChangeVisibility:f,onChangeRepeat:u,departments:g=[],onChangeEventTime:m,onChangeEventPlace:x,onChangeEventAddress:_,onChangeNote:B,onChangeNoteDraft:A,onChangeContent:j,contentTemplates:D,onSaveContentTemplate:P,onRemoveContentTemplate:N,contentLoading:q=!1,onChangeContentHeight:z,onAddChecklistItem:T,onToggleChecklistItem:C,onRemoveChecklistItem:R,onUpdateChecklistItem:p,onReorderChecklist:y,onConvertChecklistToTask:v,onOpenChecklistTask:w,onLinkChecklistTask:k,resolveChecklistTask:S,relatedTasksPool:E,onOpenRelatedTask:L,onLinkRelatedTask:$,onUnlinkRelatedTask:U,onCreateFollowUpTask:O,onAddAttachments:W,onRemoveAttachment:M,onPreview:I,onDownload:F,onUpdateComment:V,onRemoveComment:Y,onToggleCommentReaction:K,currentUserName:H="",myAccountSeq:Z=0,noticeAdmin:J=!1,hideProject:G=!1,hideLabel:X=!1,showTitle:ee=!1,onChangeTitle:ne,onToggleCompleted:re,onChangeIcon:ie,onChangeIconColor:le,employees:me=[],onAckConfirm:ve,onRequestConfirm:_e,onChangeBugField:Pe,sprints:he=[],sprintProject:de=!1,hideSprint:We=!1,onChangeSprint:Ne,onChangeStoryPoints:se,onChangeResolution:Be,onClaimTask:ye,onVerifyBug:xe}){let[Ue,Te]=yn(null),[ue,Me]=yn(null),[ke,Ie]=yn(null),[lt,Le]=yn(null),[$e,Tt]=yn(!1),je={[Bn]:$e?{maxHeight:120,opacity:1,overflow:"hidden",transition:"max-height 0.25s ease, opacity 0.2s ease"}:{minHeight:0,maxHeight:0,opacity:0,overflow:"hidden",pointerEvents:"none",transition:"max-height 0.25s ease, opacity 0.2s ease"}},[Fe,xt]=yn(null),[Ze,He]=yn(null),[vt,Ye]=yn(null),[te,ce]=yn(null),[pe,Se]=yn(null),[Xe,Re]=yn(null),[De,yt]=yn(null),Ae=!!e.is_notice,Ce=!!e.is_event,et=!!e.is_bug,st=!!ye&&Ra(e,Z),ft=!!ye&&Oa(e,Z),wt=!!xe&&et&&!!e.completed&&Z>0&&(e.author_account_seq??0)===Z&&!(e.acks??[]).some(oe=>oe.account_seq===Z),pt=!lo(e,Z),Vt=!e.is_event&&(e.is_notice?Z>0&&(e.author_account_seq??0)===Z:(e.author_account_seq??0)===Z||(e.manager_account_seq??0)===Z),qt=e.is_notice||e.is_event?_t(e.icon||(e.is_notice?or:ar)):null,Pt=Ae?!Ma(e,Z):pt,Kt=st||ft?Ut(Ln,{onClick:oe=>yt(oe.currentTarget),children:[we(k4,{sx:{fontSize:16,mr:.5}}),"\uAC00\uC838\uAC00\uAE30"]}):null,Q=Ae?Tl(e,me):"",ae=Ae?op(e,me,Z):null,ge=Ae?null:Va(e,Z),be=!!(ge&&ge.total>0||Ae&&ae),Ee=!Ae,ze=Ut(qr,{children:[we(mt,{icon:we(v4,{sx:{fontSize:17}}),label:"\uC791\uC131\uC790",sx:[Gn(9),je??null,...Ce?[]:[tr(1)]],children:e.created_by?Ut(qr,{children:[we(jr,{names:[e.created_by],size:20,avatarSrcByName:l}),e.created_by]}):we(Ko,{})}),we(mt,{icon:we(Ap,{sx:{fontSize:17}}),label:"\uC791\uC131\uC77C\uC2DC",sx:[Gn(11),je??null,...Ce?[]:[tr(2)]],children:e.created_time?on(e.created_time):we(Ko,{})})]});return Ut(qr,{children:[ee?Ut(Zt,{sx:{px:2,pt:2,pb:.5,display:"flex",alignItems:"flex-start",gap:1},children:[Vt?we(d4,{checked:e.completed,icon:we(b4,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:we(ju,{sx:{fontSize:22,color:"#2f80ed"}}),onChange:(oe,it)=>{ke||Ie({anchorEl:oe.currentTarget,nextCompleted:it})},sx:{p:0,mt:.25}}):null,qt?Ce&&!pt?we(Rp,{onClick:oe=>Me(oe.currentTarget),sx:{display:"flex",p:.25,mt:.1,borderRadius:1,color:e.icon_color||"#1e3a8a","&:hover":{bgcolor:"#f2f2f0"}},children:we(qt,{sx:{fontSize:20}})}):we(Zt,{sx:{display:"flex",p:0,mt:.25,color:e.icon_color||(Ae?"#e5484d":"#1e3a8a")},children:we(qt,{sx:{fontSize:20}})}):null,we(Zt,{sx:{flex:1,minWidth:0},children:Ue!==null?we(Zt,{component:"input",autoFocus:!0,spellCheck:!1,value:Ue,onChange:oe=>Te(oe.target.value),onBlur:()=>{Ue.trim()&&Ue.trim()!==e.title&&ne(e.seq,Ue.trim()),Te(null)},onKeyDown:oe=>{oe.key==="Enter"&&oe.target.blur(),oe.key==="Escape"&&Te(null)},sx:{width:"100%",border:"none",outline:"none",font:"inherit",fontSize:19,fontWeight:600,color:"#37352f",p:0,m:0}}):we(Zt,{onClick:()=>Te(e.title),sx:{fontSize:19,fontWeight:600,color:"#37352f",lineHeight:1.35,cursor:"text",textDecoration:e.completed?"line-through":"none",userSelect:"text"},children:e.title})}),we(At,{open:!!ke,anchorEl:ke?.anchorEl??null,title:ke?.nextCompleted?"\uC774 \uC5C5\uBB34\uB97C \uC644\uB8CC \uCC98\uB9AC\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC644\uB8CC\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:ke?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>Ie(null),onConfirm:()=>{ke&&re(e.seq,ke.nextCompleted),Ie(null)}})]}):null,Ut(Zt,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:0,[Bn]:{pb:0,"& > :last-child":{mb:0}}},children:[we(dl,{hideProject:G,pinColumns:!0,projectColumn:!Ce&&!X?2:"full",values:{tabKey:e.tab_key??"",managerName:e.manager_name,receiverNames:e.receiver_names,startDate:e.start_date,dueDate:e.due_date,reminders:zn(e),priority:e.priority,eventTime:e.event_time??"",eventPlace:e.event_place??"",eventAddress:e.event_address??""},customTabs:h,avatarSrcByName:l,hideDueDate:!Ce&&!!e.repeat_rule,hideReminder:!!e.repeat_rule,notice:Ae,event:Ce,readOnly:pt,targetSummary:Q,onChangeProject:oe=>t(e.seq,oe),onAddProject:n,onChangeStartDate:oe=>c(e.seq,"start_date",oe),onChangeDueDate:oe=>c(e.seq,"due_date",oe),onChangeReminder:oe=>i(e.seq,oe),onChangePriority:oe=>d(e.seq,oe),onChangeEventTime:oe=>m?.(e.seq,oe),onChangeEventPlace:oe=>x?.(e.seq,oe),onChangeEventAddress:oe=>_?.(e.seq,oe),onMemberEdit:oe=>a(e,oe,null),narrowCollapsedSx:je,reminderLocked:e.completed,managerAction:Kt,leading:Ut(qr,{children:[wt||Kt&&(Ae||Ce)?Ut(Zt,{sx:{gridColumn:"1 / -1",display:"flex",justifyContent:"flex-start",gap:2,px:2,py:1.5},children:[Ae||Ce?Kt:null,wt?Ut(qr,{children:[we(Zi,{variant:"contained",size:"large",onClick:()=>xe?.(e.seq,!0),sx:{bgcolor:"#2f80ed"},children:"\uAC80\uC99D\uC644\uB8CC"}),we(Zi,{variant:"outlined",size:"large",color:"error",onClick:()=>xe?.(e.seq,!1),children:"\uC7AC\uC624\uD508"})]}):null]}):null,et&&e.ticket_no?we(mt,{icon:we(p4,{sx:{fontSize:17}}),label:"\uD2F0\uCF13",sx:tr(1),children:we(Zt,{component:"span",sx:{fontVariantNumeric:"tabular-nums"},children:e.ticket_no})}):null,Ce?null:we(Zt,{sx:et&&e.ticket_no||Ee||be?tr(et&&e.ticket_no?2:1):{gridColumn:"1 / -1"},children:we(mt,{icon:we(y4,{sx:{fontSize:17}}),label:"\uC0C1\uD0DC",onClick:pt||e.completed?void 0:oe=>xt(oe),children:we(Ot,{option:lr(e)})})}),Ae?null:(()=>{let oe=kn(e),it=oe==="all"?we(Pp,{sx:{fontSize:17,color:"#2f80ed"}}):oe==="group"?we(Np,{sx:{fontSize:17,color:"#d9730d"}}):we(Dp,{sx:{fontSize:17}}),Je=oe==="all"?"\uC804\uCCB4\uACF5\uAC1C":oe==="group"?`\uBD80\uC11C\uACF5\uAC1C \xB7 ${g.find(Ge=>Ge.seq===(e.visibility_group_seq??0))?.name??"\uBD80\uC11C"}`:"\uBE44\uACF5\uAC1C";return we(Zt,{sx:Ce?void 0:tr(et?1:2),children:we(mt,{icon:it,label:"\uACF5\uAC1C",onClick:pt||!f?void 0:Ge=>He(Ge),children:Je})})})(),!Ae&&!et?we(Zt,{sx:Ce?void 0:tr(1),children:we(mt,{icon:we(S4,{sx:{fontSize:17,...e.repeat_rule?{color:"#2f80ed"}:{}}}),label:"\uBC18\uBCF5",onClick:pt||!u?void 0:oe=>Ye(oe),children:e.repeat_rule?sl(e.repeat_rule):we(Ko,{label:"\uC5C6\uC74C"})})}):null,!Ae&&!et&&e.repeat_rule?we(Zt,{sx:Ce?void 0:tr(2),children:we(mt,{icon:we(T4,{sx:{fontSize:17}}),label:"\uBC18\uBCF5 \uC885\uB8CC",onClick:pt||!u?void 0:oe=>ce(oe),children:e.repeat_until?`${e.repeat_until}\uAE4C\uC9C0`:we(Ko,{})})}):null,ge&&ge.total>0?we(Zt,{sx:Ce?void 0:tr(2),children:we(mt,{icon:we(zu,{sx:{fontSize:17}}),label:"\uD655\uC778",children:ge.canConfirm?we(Zi,{size:"small",variant:"contained",onClick:()=>ve?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):Ut(Zi,{size:"small",variant:"outlined",color:"inherit",startIcon:ge.myTime?we(ju,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:oe=>Le({anchorEl:oe.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:[ge.count," / ",ge.total]})})}):null,Ae&&ae?we(Zt,{sx:tr(2),children:we(mt,{icon:we(zu,{sx:{fontSize:17}}),label:"\uD655\uC778",children:we(Zt,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,minWidth:0},children:ae.canAck?we(Zi,{size:"small",variant:"contained",onClick:()=>ve?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):we(Zi,{size:"small",variant:"outlined",color:"inherit",startIcon:ae.acked?we(ju,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:oe=>Le({anchorEl:oe.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:ae.total>0&&ae.count>=ae.total?"\uC644\uB8CC":Ut(qr,{children:[ae.count,we(Zt,{component:"span",sx:{mx:.4},children:"/"}),ae.total]})})})})}):null,de&&!We&&!Ce&&!Ae?Ut(qr,{children:[we(mt,{icon:we(m4,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:pt?void 0:oe=>Se(oe),sx:tr(1),children:(e.sprint_seq??0)>0?he.find(oe=>oe.seq===e.sprint_seq)?.name??"\uC0AD\uC81C\uB41C \uC2A4\uD504\uB9B0\uD2B8":we(Ko,{label:"\uBBF8\uBC30\uC815"})}),we(mt,{icon:we(g4,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",sx:tr(2),children:we(_o,{value:(e.story_points??0)>0?String(e.story_points):"",placeholder:"\uBBF8\uCD94\uC815",readOnly:pt,onCommit:oe=>se?.(e.seq,Number(oe.replace(/[^0-9.]/g,""))||0)})})]}):null,Ce||X?null:we(Zt,{sx:[G?{gridColumn:"1 / -1"}:tr(1),je??null],children:we(mt,{icon:we(x4,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:pt?void 0:oe=>Re(oe),children:(e.label_keys??[]).length>0?we(No,{labelKeys:e.label_keys??[],labelOptions:b}):we(Ko,{})})})]}),afterProject:Ce?null:ze,trailing:Ut(qr,{children:[et?we(fl,{values:{repro:e.bug_repro??"",device:e.bug_device??"",where:e.bug_where??"",version:e.bug_version??"",resolution:e.resolution??""},readOnly:pt,showResolution:!!e.completed,onChangeRepro:oe=>Pe?.(e.seq,"bug_repro",oe),onChangeDevice:oe=>Pe?.(e.seq,"bug_device",oe),onChangeWhere:oe=>Pe?.(e.seq,"bug_where",oe),onChangeVersion:oe=>Pe?.(e.seq,"bug_version",oe),onChangeResolution:oe=>Be?.(e.seq,oe)}):null,Ce?ze:null,e.completed?Ut(qr,{children:[we(mt,{icon:we(zu,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC790",sx:[Gn(10),je??null,...Ce?[]:[tr(1)]],children:e.completed_by?Ut(qr,{children:[we(jr,{names:[e.completed_by],size:20,avatarSrcByName:l}),e.completed_by]}):we(Ko,{})}),we(mt,{icon:we(Ap,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC77C\uC2DC",sx:[Gn(12),je??null,...Ce?[]:[tr(2)]],children:e.completed_time?on(e.completed_time):we(Ko,{})})]}):null]})}),Ut(Zt,{sx:{display:"none",[Bn]:{display:"block",mt:1.5,mb:0}},children:[we(yi,{sx:{borderColor:"#e6e6e3"}}),we(Rp,{onClick:()=>Tt(oe=>!oe),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:.5,pt:1.25,pb:1.25,fontSize:13.5,bgcolor:"#f4f4f2",color:"#37352f","&:active":{opacity:.6}},children:$e?Ut(qr,{children:["\uC811\uAE30 ",we(f4,{sx:{fontSize:18}})]}):Ut(qr,{children:["\uC815\uBCF4 \uB354\uBCF4\uAE30 ",we(h4,{sx:{fontSize:18}})]})})]}),Ut(Zt,{children:[we(yi,{sx:{my:1.5,borderColor:"#e6e6e3",[Bn]:{mt:0,mb:1.25}}}),we(bn,{icon:we(w4,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",titleExtra:D&&!pt?we(pl,{content:e.content??"",templates:D,onApply:oe=>j?.(e.seq,oe),onSave:P,onRemove:N}):void 0,children:we(Zt,{sx:{userSelect:"text"},children:q?we(Zt,{sx:{minHeight:e.content_height||180,display:"flex",alignItems:"center",justifyContent:"center"},children:we($a,{})}):we(ml,{syncKey:e.seq,value:e.content??"",height:e.content_height??0,onChangeHeight:z?oe=>z(e.seq,oe):void 0,readOnly:pt,onChange:oe=>j(e.seq,oe)})})}),e.is_bug?null:Ut(qr,{children:[we(yi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(bn,{icon:we(_4,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:we(Zt,{sx:{userSelect:"text"},children:we(Cp,{value:e.note,readOnly:Pt,onCommit:oe=>B(e.seq,oe),onDraftChange:A?oe=>A(e.seq,oe):void 0})})})]}),Ce?null:Ut(qr,{children:[we(yi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(yl,{taskSeq:e.seq,checklist:e.checklist??[],removeLocked:Pt,onAdd:T,onToggle:C,onRemove:R,onUpdate:p,onReorder:y,onConvertToTask:v,onOpenLinkedTask:w,resolveLinkedTask:S,myAccountSeq:Z,linkCandidates:E,linkBaseTask:e,onLinkExistingTask:k})]}),E&&!Ce&&!Ae&&Ip(e,E)?Ut(qr,{children:[we(yi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(Mp,{task:e,tasks:E,readOnly:pt,onOpenTask:L,onLink:$,onUnlink:U,onCreateFollowUp:O})]}):null,we(yi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(_l,{taskSeq:e.seq,attachments:e.attachments??[],removeLocked:Pt,onAdd:W,onRemove:M,onPreview:I?oe=>I({...oe,taskSeq:e.seq}):void 0,onDownload:F?oe=>F({...oe,taskSeq:e.seq}):void 0})]}),we(yi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(xp,{taskSeq:e.seq,comments:e.comments??[],currentUserName:H,myAccountSeq:Z,avatarSrcByName:l,onUpdate:V,onRemove:Y,onToggleReaction:K,onPreview:I?oe=>I({...oe,taskSeq:e.seq}):void 0,onDownload:F?oe=>F({...oe,taskSeq:e.seq}):void 0})]}),we(Ei,{anchorEl:Fe,value:e.status,options:Ae?ys:et?ni:xs,onSelect:oe=>o(e.seq,oe),onClose:()=>xt(null)}),we(Nu,{transitionDuration:0,anchorEl:vt,open:!!vt,onClose:()=>Ye(null),children:[{value:"",label:"\uC5C6\uC74C"},...Os].map(oe=>we(Lu,{selected:(e.repeat_rule??"")===oe.value,onClick:()=>{Ye(null),(async()=>{let it=e.repeat_rule??"";if(oe.value===it)return;if(oe.value===""){await Lp({title:"\uBC18\uBCF5 \uD574\uC81C",message:"\uC774\uD6C4 \uBC18\uBCF5 \uD68C\uCC28\uB97C \uBAA8\uB450 \uC0AD\uC81C\uD558\uACE0 \uBC18\uBCF5\uC744 \uD574\uC81C\uD560\uAE4C\uC694? (\uC9C0\uB09C \uD68C\uCC28\uB294 \uB0A8\uC2B5\uB2C8\uB2E4)"})&&u?.(e.seq,"","");return}let Je=String(e.due_date??"").slice(0,10);if(!Je){C4(e.is_event?"\uBC18\uBCF5\uD558\uB824\uBA74 \uC77C\uC815 \uB0A0\uC9DC\uB97C \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694.":"\uBC18\uBCF5\uD558\uB824\uBA74 \uB9C8\uAC10\uC77C\uC2DC\uB97C \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694.");return}it&&!await Lp({title:"\uBC18\uBCF5 \uBCC0\uACBD",message:"\uC774\uD6C4 \uD68C\uCC28\uB97C \uC0C8 \uADDC\uCE59\uC73C\uB85C \uB2E4\uC2DC \uC0DD\uC131\uD560\uAE4C\uC694? \uC774\uD6C4 \uD68C\uCC28\uC758 \uB313\uAE00\xB7\uCCA8\uBD80\uB294 \uC0AC\uB77C\uC9D1\uB2C8\uB2E4."})||u?.(e.seq,oe.value,al(Je,oe.value))})()},sx:{fontSize:14,minWidth:140},children:oe.label},oe.value||"none"))}),we(B4,{anchorEl:te,open:!!te,onClose:()=>ce(null),selectedDate:e.repeat_until?new Date(`${e.repeat_until}T00:00:00`):new Date,onDateChange:oe=>{ce(null);let it=rt=>String(rt).padStart(2,"0"),Je=`${oe.getFullYear()}-${it(oe.getMonth()+1)}-${it(oe.getDate())}`,Ge=e.repeat_rule??"";Ge&&u?.(e.seq,Ge,Je)}}),we(Nu,{transitionDuration:0,anchorEl:Ze,open:!!Ze,onClose:()=>He(null),children:[{key:"involved",label:"\uBE44\uACF5\uAC1C",icon:we(Dp,{sx:{fontSize:17,color:"#57564f"}}),selected:kn(e)==="involved",onPick:()=>f?.(e.seq,"involved",0)},{key:"all",label:"\uC804\uCCB4\uACF5\uAC1C",icon:we(Pp,{sx:{fontSize:17,color:"#2f80ed"}}),selected:kn(e)==="all",onPick:()=>f?.(e.seq,"all",0)},...g.map(oe=>({key:`group-${oe.seq}`,label:`\uBD80\uC11C\uACF5\uAC1C \xB7 ${oe.name}`,icon:we(Np,{sx:{fontSize:17,color:"#d9730d"}}),selected:kn(e)==="group"&&(e.visibility_group_seq??0)===oe.seq,onPick:()=>f?.(e.seq,"group",oe.seq)}))].map(oe=>Ut(Lu,{selected:oe.selected,onClick:()=>{oe.onPick(),He(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[oe.icon,oe.label,oe.selected?we(Op,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},oe.key))}),we(Nu,{transitionDuration:0,anchorEl:pe,open:!!pe,onClose:()=>Se(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...he.filter(oe=>`custom-${oe.group_seq}`===String(e.tab_key??"")).map(oe=>({seq:oe.seq,label:mn(oe)}))].map(oe=>Ut(Lu,{onClick:()=>{Ne?.(e.seq,oe.seq),Se(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[oe.label,(e.sprint_seq??0)===oe.seq?we(Op,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},oe.seq))}),we(Ua,{anchorEl:lt?.anchorEl??null,open:!!lt?.open,acks:e.acks??[],total:ae?.total??ge?.total??0,pendingNames:ae?.pendingNames??ge?.pendingNames??[],avatarSrcByName:l,onRequestConfirm:_e&&(ae?ae.count<ae.total:ge&&ge.count<ge.total)?()=>{_e(e.seq),Le(oe=>oe?{...oe,open:!1}:null)}:void 0,onClose:()=>Le(oe=>oe?{...oe,open:!1}:null)}),we(Sl,{anchorEl:Xe,selectedKeys:e.label_keys??[],labelOptions:b,onToggle:oe=>s(e.seq,Ia(e.label_keys??[],oe)),onAddLabel:r,onClose:()=>Re(null)}),we(zo,{anchorEl:ue,value:e.icon??"",color:e.icon_color??"",onSelect:oe=>{ie(e.seq,oe),Me(null)},onSelectColor:le?oe=>le(e.seq,oe):void 0,onClose:()=>Me(null)}),we(At,{open:!!De,anchorEl:De,title:st?"\uC774 \uC5C5\uBB34\uB97C \uAC00\uC838\uC640 \uCC45\uC784\uC790\uB97C \uB9E1\uC73C\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC774 \uC5C5\uBB34\uC758 \uCC45\uC784\uC790\uB97C \uB9E1\uC73C\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uAC00\uC838\uAC00\uAE30",onCancel:()=>yt(null),onConfirm:()=>{ye?.(e.seq),yt(null)}})]})}import{Fragment as D4,jsx as $r,jsxs as Wp}from"react/jsx-runtime";function KF(){let e=new Date,h=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${h(e.getMonth()+1)}-${h(e.getDate())} ${h(e.getHours())}:${h(e.getMinutes())}`}function GF({open:e,task:h,onClose:b,onAddComment:l,onSaveFields:o,presentation:s="auto",myAccountSeq:r=0,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:c,onChangeIconColor:i,activityItems:a,activityLoading:d,onLoadActivity:f,onPrint:u,onDelete:g,canDelete:m,...x}){let _=Nt(),B=Fp(null);h&&(B.current=h);let A=h??B.current,[j,D]=qp(!1),[P,N]=qp({}),q=Object.keys(P).length>0;zp(()=>{N({})},[h?.seq,e]);let z=Fp(null);if(zp(()=>{z.current?.scrollTo({top:0})},[h?.seq]),!A)return null;let T=_&&q?{...A,...P}:A,C=T.checklist??[],R=(S,E)=>{_?N(L=>({...L,...S})):E()},p=()=>{let S=P;N({});let E=A.seq,L=S.title===void 0?void 0:String(S.title).trim();if(o){let $={...S};L!==void 0&&(L?$.title=L:delete $.title),Object.keys($).length>0&&o(E,$),Hp({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"});return}L&&n(E,L),S.icon!==void 0&&c(E,String(S.icon)),S.icon_color!==void 0&&i?.(E,String(S.icon_color)),S.status!==void 0&&x.onChangeStatus(E,S.status),S.label_keys!==void 0&&x.onChangeLabels(E,S.label_keys??[]),S.tab_key!==void 0&&x.onChangeProject(E,String(S.tab_key??"")),S.start_date!==void 0&&x.onChangeDate(E,"start_date",String(S.start_date??"")),S.due_date!==void 0&&x.onChangeDate(E,"due_date",String(S.due_date??"")),S.reminders!==void 0&&x.onChangeReminder(E,S.reminders),S.priority!==void 0&&x.onChangePriority(E,S.priority),S.event_time!==void 0&&x.onChangeEventTime?.(E,String(S.event_time??"")),S.event_place!==void 0&&x.onChangeEventPlace?.(E,String(S.event_place??"")),S.event_address!==void 0&&x.onChangeEventAddress?.(E,String(S.event_address??"")),S.content!==void 0&&x.onChangeContent(E,String(S.content??"")),S.note!==void 0&&x.onChangeNote(E,String(S.note??"")),S.visibility!==void 0&&x.onChangeVisibility?.(E,S.visibility,Number(S.visibility_group_seq??0)),Hp({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"})},y={...x,onChangeStatus:(S,E)=>R({status:E},()=>x.onChangeStatus(S,E)),onChangeLabels:(S,E)=>R({label_keys:E},()=>x.onChangeLabels(S,E)),onChangeProject:(S,E)=>R({tab_key:E},()=>x.onChangeProject(S,E)),onChangeDate:(S,E,L)=>R({[E]:L},()=>x.onChangeDate(S,E,L)),onChangeReminder:(S,E)=>R({reminders:E},()=>x.onChangeReminder(S,E)),onChangePriority:(S,E)=>R({priority:E},()=>x.onChangePriority(S,E)),onChangeEventTime:(S,E)=>R({event_time:E},()=>x.onChangeEventTime?.(S,E)),onChangeEventPlace:(S,E)=>R({event_place:E},()=>x.onChangeEventPlace?.(S,E)),onChangeEventAddress:(S,E)=>R({event_address:E},()=>x.onChangeEventAddress?.(S,E)),onChangeContent:(S,E)=>R({content:E},()=>x.onChangeContent(S,E)),onChangeNote:(S,E)=>R({note:E},()=>x.onChangeNote(S,E)),onMemberEdit:(S,E)=>x.onMemberEdit(S,E,_?L=>N($=>({...$,...L})):null),onChangeNoteDraft:_?(S,E)=>R({note:E},()=>{}):void 0,onChangeVisibility:x.onChangeVisibility?(S,E,L)=>R({visibility:E,visibility_group_seq:L},()=>x.onChangeVisibility?.(S,E,L)):void 0,onAddChecklistItem:(S,E)=>R({checklist:[...C,{label:E,checked:!1}]},()=>x.onAddChecklistItem(S,E)),onToggleChecklistItem:(S,E,L)=>R({checklist:C.map(($,U)=>U===E?{...$,checked:L}:$)},()=>x.onToggleChecklistItem(S,E,L)),onRemoveChecklistItem:(S,E)=>R({checklist:C.filter((L,$)=>$!==E)},()=>x.onRemoveChecklistItem(S,E)),onUpdateChecklistItem:x.onUpdateChecklistItem?(S,E,L)=>R({checklist:C.map(($,U)=>U===E?{...$,label:L}:$)},()=>x.onUpdateChecklistItem?.(S,E,L)):void 0,onReorderChecklist:x.onReorderChecklist?(S,E)=>R({checklist:E},()=>x.onReorderChecklist?.(S,E)):void 0,onLinkChecklistTask:x.onLinkChecklistTask?(S,E,L)=>R({checklist:[...C,{label:L,checked:!1,task_seq:E}]},()=>x.onLinkChecklistTask?.(S,E,L)):void 0},v=$r(jp,{...y,task:T,myAccountSeq:r,onChangeTitle:(S,E)=>R({title:E},()=>n(S,E)),onToggleCompleted:t,onChangeIcon:(S,E)=>R({icon:E},()=>c(S,E)),onChangeIconColor:(S,E)=>R({icon_color:E},()=>i?.(S,E)),showTitle:_||s==="dialog"}),w=$r(vp,{onSubmit:(S,E)=>l(T.seq,S,E)},T.seq);return _||s==="dialog"?Wp(D4,{children:[$r(A4,{open:e,onClose:b,locale:"ko",fontScale:{enabled:!0,default:1.1,min:.6},title:T.is_notice?"\uACF5\uC9C0\uC0AC\uD56D":T.is_event?"\uC77C\uC815":T.is_bug?"\uC624\uB958":"\uC5C5\uBB34",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1},custom:[...f?[{icon:$r(R4,{sx:{color:"#6b7280"}}),tooltip:"\uD65C\uB3D9",onClick:()=>D(!0)}]:[],{icon:$r(M4,{sx:{color:"#6b7280"}}),tooltip:"\uACF5\uC720\uD558\uAE30",onClick:()=>Ki(T,!0)},..._?[{raw:!0,icon:$r(I4,{variant:"contained",size:"small",disableElevation:!0,disabled:!q,onClick:q?p:void 0,sx:{ml:1.5,height:32,minWidth:64,px:1.75,py:0,borderRadius:1,fontSize:14,fontWeight:600,bgcolor:"#2f80ed","&:hover":{bgcolor:"#2f80ed"},"&.Mui-disabled":{bgcolor:"#f2f2f0",color:"#c9c8c5"}},children:"\uC800\uC7A5\uD558\uAE30"})}]:[]]},fullScreen:_,maxWidth:_?void 0:"md",width:_?void 0:720,mobilePresentation:_?"slide":void 0,tabs:{visible:!1},contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,contentBottomPadding:0,scrollPastLastSection:!1,overlayScrollbar:{enabled:!0,contentStyle:{minWidth:0}},actions:{visible:!0,showCancelButton:!1,left:w},sx:{DialogContent:{borderBottom:"none"}},dialogActionSx:{padding:"0 !important","@media (max-width:1023.95px)":{padding:"0 !important"},borderTop:"1px solid #37352f","& .left-actions":{flex:1,width:"100%",minWidth:0,"& > *":{flex:1,minWidth:0}},"& .right-actions":{display:"none"}},sections:[{id:"task-detail",title:"",showTitle:!1,children:$r(Ol,{sx:{userSelect:"none",width:"100%",minWidth:0,display:"flex",flexDirection:"column",gap:0},children:v})}]},A.seq),$r(Ml,{open:j,taskSeq:T.seq,items:a,loading:d,onLoad:f,onClose:()=>D(!1)})]}):$r(E4,{anchor:"right",open:e,onClose:b,"aria-label":"\uC5C5\uBB34 \uC0C1\uC138",disableAutoFocus:!0,disableEnforceFocus:!0,sx:{zIndex:S=>S.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:Wp(Ol,{sx:{display:"flex",flexDirection:"column",height:"100%",userSelect:"none"},children:[$r(Tp,{task:T,myAccountSeq:r,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:c,onChangeIconColor:i,onClose:b,activityItems:a,activityLoading:d,onLoadActivity:f,onPrint:u,onDelete:g,canDelete:m}),$r($p,{sx:{borderColor:"#e6e6e3"}}),$r(Ol,{sx:{flex:1,minHeight:0},children:$r(O4,{ref:z,style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:v})}),$r($p,{sx:{borderColor:"#37352f"}}),$r(Ol,{sx:{flexShrink:0},children:w})]})})}import{useEffect as H4,useState as Bo}from"react";import{Box as Hr,Button as Hu,IconButton as Kp}from"@mui/material";import{FormDialog as Gp}from"@ehfuse/mui-form-dialog";import W4 from"@mui/icons-material/Add";import U4 from"@mui/icons-material/DirectionsRunOutlined";import V4 from"@mui/icons-material/EditOutlined";import{ErrorAlert as Yp}from"@ehfuse/alerts";import{ClearTextField as Xp,DateTextField as Zp,LabelSelect as Jp}from"@ehfuse/mui-form-controls";import{useEffect as P4,useState as Up}from"react";import{Box as Co,Button as N4,FormControlLabel as Fu,Radio as qu,RadioGroup as L4}from"@mui/material";import{FormDialog as j4}from"@ehfuse/mui-form-dialog";import{LabelSelect as z4}from"@ehfuse/mui-form-controls";import F4 from"@ehfuse/overlay-scrollbar";import{Fragment as q4,jsx as Ar,jsxs as Ji}from"react/jsx-runtime";function Vp({open:e,sprint:h,remainingTasks:b,sprints:l,onClose:o,onConfirm:s}){let r=l.filter(d=>d.seq!==h?.seq&&d.group_seq===(h?.group_seq??0)&&d.status!=="closed"),[t,n]=Up("backlog"),[c,i]=Up(0);P4(()=>{e&&(n(r.length>0?"move":"backlog"),i(r[0]?.seq??0))},[e]);let a=b.length>0;return Ar(j4,{open:e,onClose:o,maxWidth:"sm",title:"\uBAA9\uD45C \uB9C8\uAC10",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-close",tabs:{visible:!1},actions:{showCancelButton:!0,right:Ar(N4,{variant:"contained",onClick:()=>s({mode:a?t:"keep",moveToSprintSeq:t==="move"?c:0,taskSeqs:b.map(d=>d.seq)}),disabled:a&&t==="move"&&!(c>0),children:"\uB9C8\uAC10"})},sections:[{id:"sprint-close",title:"",showTitle:!1,children:Ji(Co,{sx:{display:"flex",flexDirection:"column",gap:2},children:[Ji(Co,{sx:{fontSize:18,color:"#37352f"},children:[Ar(Co,{component:"span",sx:{fontWeight:600},children:h?.name??""})," \uBAA9\uD45C\uB97C \uB9C8\uAC10\uD569\uB2C8\uB2E4."]}),a?Ji(q4,{children:[Ji(Co,{sx:{fontSize:15,color:"#6f6f6c"},children:["\uB05D\uB098\uC9C0 \uC54A\uC740 \uC5C5\uBB34\uAC00"," ",b.length,"\uAC74 \uC788\uC2B5\uB2C8\uB2E4. \uC5B4\uB5BB\uAC8C \uD560\uAE4C\uC694?"]}),Ar(Co,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:Ar(F4,{style:{maxHeight:220},thumb:{width:6},children:b.map(d=>Ji(Co,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,borderBottom:"1px solid #f2f2f0","&:last-of-type":{borderBottom:"none"}},children:[Ar(Co,{sx:{flex:1,minWidth:0,fontSize:16,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.title}),Ar(Ot,{option:lr(d)})]},d.seq))})}),Ji(L4,{value:t,onChange:(d,f)=>n(f),children:[r.length>0?Ar(Fu,{value:"move",control:Ar(qu,{size:"small"}),label:"\uB2E4\uC74C \uBAA9\uD45C\uB85C \uC774\uC6D4",sx:{"& .MuiFormControlLabel-label":{fontSize:16}}}):null,t==="move"&&r.length>0?Ar(Co,{sx:{pl:4,pb:1},children:Ar(z4,{size:"small",label:"",fullWidth:!0,value:String(c),options:r.map(d=>({value:String(d.seq),label:d.name})),onChange:d=>i(Number(d.target.value)||0)})}):null,Ar(Fu,{value:"backlog",control:Ar(qu,{size:"small"}),label:"\uBBF8\uBC30\uC815(\uBC31\uB85C\uADF8)\uC73C\uB85C \uBE7C\uAE30",sx:{"& .MuiFormControlLabel-label":{fontSize:16}}}),Ar(Fu,{value:"keep",control:Ar(qu,{size:"small"}),label:"\uC774 \uBAA9\uD45C\uC5D0 \uADF8\uB300\uB85C \uB450\uAE30",sx:{"& .MuiFormControlLabel-label":{fontSize:16}}})]})]}):Ar(Co,{sx:{fontSize:15,color:"#6f6f6c"},children:"\uB0A8\uC740 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uC774\uB300\uB85C \uB9C8\uAC10\uD558\uBA74 \uBAA9\uD45C\uAC00 \uC885\uB8CC\uB429\uB2C8\uB2E4."})]})}]})}var $u="custom-";function $4(e){return e.startsWith($u)}function sq(e){return e>0?`${$u}${e}`:""}function Go(e){if(!$4(e))return 0;let h=Number(e.slice($u.length));return Number.isInteger(h)&&h>0?h:0}import{Fragment as em,jsx as zt,jsxs as Yo}from"react/jsx-runtime";var K4=[{value:"planning",label:"\uACC4\uD68D\uC911"},{value:"active",label:"\uC9C4\uD589\uC911"},{value:"closed",label:"\uC885\uB8CC"}];function Qp(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?e.slice(5).replace("-","."):"-"}function xq({open:e,customTabs:h,sprints:b,onClose:l,onCreate:o,onUpdate:s,onChangeStatus:r,tasks:t=[],onCloseSprint:n,onRemove:c}){let i=h.filter(E=>E.useSprints&&!E.archived),[a,d]=Bo(""),[f,u]=Bo(""),[g,m]=Bo(""),[x,_]=Bo(""),[B,A]=Bo(""),[j,D]=Bo(!1),[P,N]=Bo(!1),[q,z]=Bo(null),T=q?t.filter(E=>(E.sprint_seq??0)===q.seq&&!E.completed):[],[C,R]=Bo(0);H4(()=>{e&&(d(i.length===1?i[0].key:""),u(""),m(""),_(""),A(""),R(0))},[e]);let p=()=>{u(""),m(""),_(""),A(""),R(0),N(!1)},y=E=>{R(E.seq),d(`custom-${E.group_seq}`),u(E.name),m(E.goal),_(E.start_date),A(E.end_date)},v=C>0||P,w=async()=>{let E=Go(a);if(!E){Yp("\uBAA9\uD45C\uB97C \uB9CC\uB4E4 \uD504\uB85C\uC81D\uD2B8\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}if(!f.trim()){Yp("\uBAA9\uD45C \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}D(!0);try{if(C>0){s(C,{name:f.trim(),goal:g.trim(),start_date:x,end_date:B}),p();return}await o({group_seq:E,name:f.trim(),goal:g.trim(),start_date:x,end_date:B})&&p()}finally{D(!1)}},k=new Map(h.map(E=>[Go(E.key),E.label])),S=zt(Hr,{children:i.length===0?zt(Hr,{sx:{py:2,fontSize:14,color:"#787774"},children:'\uBAA9\uD45C\uB97C \uC0AC\uC6A9\uD558\uB294 \uD504\uB85C\uC81D\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uD504\uB85C\uC81D\uD2B8 \uC218\uC815\uC5D0\uC11C "\uBAA9\uD45C(\uC2A4\uD504\uB9B0\uD2B8) \uC0AC\uC6A9"\uC744 \uBA3C\uC800 \uCF1C\uC138\uC694.'}):zt(em,{children:zt(Hr,{children:b.length===0?Yo(Hr,{sx:{py:4,display:"flex",flexDirection:"column",alignItems:"center",gap:2,color:"#9a9a97"},children:[zt(U4,{sx:{fontSize:48,color:"#d9d9d6"}}),zt(Hr,{sx:{fontSize:13.5},children:"\uB4F1\uB85D\uB41C \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."})]}):b.map(E=>Yo(Hr,{sx:{display:"flex",flexDirection:"column",gap:1,"&:not(:last-of-type)::after":{content:'""',display:"block",my:1.75,borderBottom:"1px solid #f0efed"}},children:[Yo(Hr,{sx:{minWidth:0},children:[Yo(Hr,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[zt(Hr,{component:"span",sx:{fontSize:18,fontWeight:600,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:E.name}),zt(Hr,{component:"span",sx:{flexShrink:0,px:1,py:.25,borderRadius:.75,bgcolor:"#f1f5f9",color:"#64748b",fontSize:13,fontWeight:500},children:k.get(E.group_seq)??"\uC0AD\uC81C\uB41C \uD504\uB85C\uC81D\uD2B8"}),Yo(Hr,{component:"span",sx:{flexShrink:0,fontSize:14,color:"#57564f"},children:[Qp(E.start_date)," ~"," ",Qp(E.end_date)]})]}),E.goal?zt(Hr,{sx:{mt:.5,fontSize:14,color:"#787774",lineHeight:1.5},children:E.goal}):null]}),Yo(Hr,{sx:{display:"flex",alignItems:"center",gap:.5},children:[zt(Jp,{label:"\uC0C1\uD0DC",showLabel:!1,size:"small",value:E.status,options:K4.map(L=>({value:L.value,label:L.label})),onChange:L=>{let $=String(L.target.value);if($==="closed"&&n){z(E);return}r(E.seq,$)},sx:{width:104,flexShrink:0}}),zt(Kp,{"aria-label":"\uBAA9\uD45C \uC218\uC815",onClick:()=>y(E),sx:{color:"#9a9a97","&:hover":{color:"#2563eb"}},children:zt(V4,{sx:{fontSize:18}})}),zt(Kp,{"aria-label":"\uBAA9\uD45C \uC0AD\uC81C",onClick:()=>c(E.seq),sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:zt(cr,{style:{width:16,height:16}})})]})]},E.seq))})})});return Yo(em,{children:[zt(Gp,{open:e,onClose:l,maxWidth:"sm",title:"\uBAA9\uD45C \uAD00\uB9AC",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-manage",sections:[{id:"sprint-manage",showTitle:!1,children:S}],sectionContentPaddingTop:0,actions:{showCancelButton:!0,left:i.length>0?zt(Hu,{startIcon:zt(W4,{}),onClick:()=>{p(),N(!0)},sx:{color:"#2563eb"},children:"\uC0C8 \uBAA9\uD45C"}):void 0,right:zt(Hu,{variant:"contained",onClick:l,children:"\uD655\uC778"})}}),zt(Vp,{open:q!==null,sprint:q,remainingTasks:T,sprints:b,onClose:()=>z(null),onConfirm:E=>{q&&n?.(q.seq,E),z(null)}}),zt(Gp,{open:v,onClose:()=>{N(!1),p()},maxWidth:"sm",title:C>0?"\uBAA9\uD45C \uC218\uC815":"\uC0C8 \uBAA9\uD45C",locale:"ko",backdropClick:!1,tabs:{visible:!1},titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-form",sections:[{id:"sprint-form",title:"",showTitle:!1,children:zt(Hr,{sx:{pt:1},children:Yo(Hr,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2.5,mt:1},children:[zt(Jp,{label:"\uD504\uB85C\uC81D\uD2B8",size:"medium",value:a,options:i.map(E=>({value:E.key,label:E.label})),onChange:E=>d(String(E.target.value)),disabled:C>0}),zt(Xp,{label:"\uBAA9\uD45C \uC774\uB984",size:"medium",placeholder:"\uC608: 8\uC6D4 2\uC8FC\uCC28",value:f,onChange:E=>u(E.target.value)}),zt(Zp,{size:"medium",label:"\uC2DC\uC791\uC77C",value:x,onChange:E=>_(E.target.value)}),zt(Zp,{size:"medium",label:"\uC885\uB8CC\uC77C",value:B,onChange:E=>A(E.target.value)}),zt(Xp,{label:"\uC124\uBA85",size:"medium",placeholder:"\uC120\uD0DD \uC785\uB825",value:g,onChange:E=>m(E.target.value),sx:{gridColumn:"1 / -1"}})]})})}],actions:{showCancelButton:!0,right:zt(Hu,{variant:"contained",onClick:()=>{w()},disabled:j,children:C>0?"\uC218\uC815":"\uBAA9\uD45C \uB9CC\uB4E4\uAE30"})}})]})}import{Box as Jr,Button as om,Tooltip as G4}from"@mui/material";import{FormDialog as Y4}from"@ehfuse/mui-form-dialog";import X4 from"@mui/icons-material/CalendarMonthOutlined";import Z4 from"@mui/icons-material/FileUploadOutlined";import J4 from"@mui/icons-material/FileDownloadOutlined";var Wu={google:{key:"google",name:"\uAD6C\uAE00 \uCE98\uB9B0\uB354",homeUrl:"https://calendar.google.com/calendar",defaultCalendarName:"\uAD6C\uAE00 \uCE98\uB9B0\uB354",exportSupported:!0,importSupported:!0,subscribeSteps:["\uBC84\uD2BC\uC774 \uB3D9\uC791\uD558\uC9C0 \uC54A\uC73C\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354 > \uB2E4\uB978 \uCE98\uB9B0\uB354 + > **URL\uB85C \uCD94\uAC00**\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694.","\uAD6C\uAE00\uC774 \uD53C\uB4DC\uB97C \uC8FC\uAE30\uC801\uC73C\uB85C(\uC218 \uC2DC\uAC04 \uAC04\uACA9) \uAC00\uC838\uAC00\uBBC0\uB85C \uBCC0\uACBD\uC0AC\uD56D \uBC18\uC601\uC774 \uB2A6\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4.","\uB0B4\uBCF4\uB0B4\uAE30\uB97C \uADF8\uB9CC\uD558\uB824\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0\uC11C \uCD94\uAC00\uD55C \uCE98\uB9B0\uB354\uB97C \uC0AD\uC81C\uD558\uBA74 \uB429\uB2C8\uB2E4."],importSteps:["\uAD6C\uAE00 \uCE98\uB9B0\uB354(\uC6F9) > \uC67C\uCABD \uBAA9\uB85D\uC5D0\uC11C \uAC00\uC838\uC62C \uCE98\uB9B0\uB354\uC5D0 \uB9C8\uC6B0\uC2A4\uB97C \uC62C\uB824 \u22EE > **\uC124\uC815 \uBC0F \uACF5\uC720**\uB97C \uC5FD\uB2C8\uB2E4.","**\uCE98\uB9B0\uB354 \uD1B5\uD569** \uC139\uC158\uC758 **iCal \uD615\uC2DD\uC758 \uBE44\uBC00 \uC8FC\uC18C**\uB97C \uBCF5\uC0AC\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694."],importPlaceholder:"https://calendar.google.com/calendar/ical/\u2026/basic.ics",buildSubscribeUrl:e=>`https://calendar.google.com/calendar/r?cid=${encodeURIComponent(e.replace(/^https?:\/\//,"webcal://"))}`},apple:{key:"apple",name:"\uC560\uD50C \uCE98\uB9B0\uB354",homeUrl:"https://www.icloud.com/calendar",defaultCalendarName:"\uC560\uD50C \uCE98\uB9B0\uB354",exportSupported:!0,importSupported:!0,subscribeSteps:["\uC544\uC774\uD3F0\xB7\uC544\uC774\uD328\uB4DC: **\uC124\uC815 > \uCE98\uB9B0\uB354 > \uACC4\uC815 > \uACC4\uC815 \uCD94\uAC00 > \uAE30\uD0C0 > \uAD6C\uB3C5 \uCE98\uB9B0\uB354 \uCD94\uAC00**\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694.","\uB9E5: \uCE98\uB9B0\uB354 \uC571 > **\uD30C\uC77C > \uC0C8\uB85C\uC6B4 \uCE98\uB9B0\uB354 \uAD6C\uB3C5**\uC5D0 \uBD99\uC5EC\uB123\uC2B5\uB2C8\uB2E4.","iCloud.com(\uC6F9)\uC5D0\uC11C\uB294 \uAD6C\uB3C5\uC744 \uCD94\uAC00\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 \uAE30\uAE30\uC5D0\uC11C \uCD94\uAC00\uD558\uBA74 iCloud \uB85C \uB3D9\uAE30\uD654\uB429\uB2C8\uB2E4."],importSteps:["iCloud.com > \uCE98\uB9B0\uB354\uC5D0\uC11C \uAC00\uC838\uC62C \uCE98\uB9B0\uB354 \uC606 **\uACF5\uC720 \uC544\uC774\uCF58**\uC744 \uB204\uB985\uB2C8\uB2E4.","**\uACF5\uC6A9 \uCE98\uB9B0\uB354**\uB97C \uCF1C\uACE0 \uB098\uC624\uB294 **\uB9C1\uD06C\uB97C \uBCF5\uC0AC**\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694(webcal:// \uC8FC\uC18C\uB3C4 \uADF8\uB300\uB85C \uB429\uB2C8\uB2E4)."],importPlaceholder:"webcal://p00-calendars.icloud.com/published/\u2026",importWarning:"\uC560\uD50C\uC740 **\uACF5\uC6A9 \uCE98\uB9B0\uB354**\uB85C \uBC14\uAFD4\uC57C \uC8FC\uC18C\uAC00 \uB098\uC635\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC544\uB294 \uC0AC\uB78C\uC740 \uADF8 \uCE98\uB9B0\uB354\uB97C \uBCFC \uC218 \uC788\uC73C\uB2C8, \uAC1C\uC778 \uC77C\uC815\uC774 \uB2F4\uAE34 \uCE98\uB9B0\uB354\uB294 \uACF5\uAC1C\uD558\uC9C0 \uB9C8\uC138\uC694."},naver:{key:"naver",name:"\uB124\uC774\uBC84 \uCE98\uB9B0\uB354",homeUrl:"https://calendar.naver.com",defaultCalendarName:"\uB124\uC774\uBC84 \uCE98\uB9B0\uB354",exportSupported:!0,importSupported:!0,subscribeSteps:["\uB124\uC774\uBC84 \uCE98\uB9B0\uB354 > \uC67C\uCABD **\uB0B4 \uCE98\uB9B0\uB354** \uC606 **+** > **URL\uB85C \uAD6C\uB3C5\uD558\uAE30**\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694.","\uB124\uC774\uBC84\uAC00 \uD53C\uB4DC\uB97C \uC8FC\uAE30\uC801\uC73C\uB85C \uAC00\uC838\uAC00\uBBC0\uB85C \uBCC0\uACBD\uC0AC\uD56D \uBC18\uC601\uC774 \uB2A6\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4.","\uB0B4\uBCF4\uB0B4\uAE30\uB97C \uADF8\uB9CC\uD558\uB824\uBA74 \uB124\uC774\uBC84 \uCE98\uB9B0\uB354\uC5D0\uC11C \uAD6C\uB3C5\uD55C \uCE98\uB9B0\uB354\uB97C \uC0AD\uC81C\uD558\uBA74 \uB429\uB2C8\uB2E4."],importSteps:["\uB124\uC774\uBC84 \uCE98\uB9B0\uB354 > \uC67C\uCABD **\uCE98\uB9B0\uB354 \uC124\uC815**(\uD1B1\uB2C8)\uC5D0\uC11C \uAC00\uC838\uC62C \uCE98\uB9B0\uB354\uB97C \uACE0\uB985\uB2C8\uB2E4.","**\uC678\uBD80 \uACF5\uAC1C** \uD56D\uBAA9\uC5D0\uC11C **\uCE98\uB9B0\uB354 \uACF5\uAC1C**\uB97C \uCCB4\uD06C\uD558\uBA74 \uB098\uC624\uB294 **iCal \uC8FC\uC18C**\uB97C \uBCF5\uC0AC\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694."],importPlaceholder:"https://calendar.naver.com/\u2026(iCal \uC8FC\uC18C)",importWarning:"\uB124\uC774\uBC84\uB294 **\uCE98\uB9B0\uB354\uB97C \uACF5\uAC1C**\uD574\uC57C iCal \uC8FC\uC18C\uAC00 \uB098\uC635\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC544\uB294 \uC0AC\uB78C\uC740 \uADF8 \uCE98\uB9B0\uB354\uB97C \uBCFC \uC218 \uC788\uC73C\uB2C8, \uAC1C\uC778 \uC77C\uC815\uC774 \uB2F4\uAE34 \uCE98\uB9B0\uB354\uB294 \uACF5\uAC1C\uD558\uC9C0 \uB9C8\uC138\uC694."}},tm=Object.values(Wu);function Al(e){return Wu[e??"google"]??Wu.google}import{jsx as dr,jsxs as Qi}from"react/jsx-runtime";function Eq({open:e,imports:h=[],onOpenExport:b,onOpenImport:l,onClose:o}){let s=Qi(Jr,{sx:{display:"flex",flexDirection:"column",gap:"24px"},children:[Qi(Jr,{sx:{bgcolor:"#f2f6fa",borderRadius:1,px:1.5,py:1.25,fontSize:15,lineHeight:1.8,color:"#37352f",display:"flex",flexDirection:"column",gap:.25,"& > div":{display:"flex",gap:1},"& > div::before":{content:'"\u2022"',flexShrink:0}},children:[dr(Jr,{children:Qi(Jr,{component:"span",children:[dr("b",{children:"\uB0B4\uBCF4\uB0B4\uAE30"}),"\uB294 \uB0B4 \uC5C5\uBB34\uB97C \uB2E4\uB978 \uCE98\uB9B0\uB354\uC5D0\uC11C"," ",dr("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uBCF4\uAC8C \uD569\uB2C8\uB2E4."]})}),dr(Jr,{children:Qi(Jr,{component:"span",children:[dr("b",{children:"\uAC00\uC838\uC624\uAE30"}),"\uB294 \uADF8 \uCE98\uB9B0\uB354\uC758 \uC77C\uC815\uC744 \uC5C5\uBB34\uD568 \uCE98\uB9B0\uB354\uC5D0 \uACB9\uCCD0 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4."]})}),dr(Jr,{children:dr(Jr,{component:"span",children:"\uB450 \uBC29\uD5A5 \uBAA8\uB450 \uC6D0\uBCF8\uC744 \uACE0\uCE58\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})})]}),dr(Jr,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:tm.map((r,t)=>Qi(Jr,{sx:{display:"flex",alignItems:"center",gap:2,px:2,py:1.75,borderTop:t>0?"1px solid #f2f2f0":"none"},children:[dr(X4,{sx:{fontSize:22,color:"#787774",flexShrink:0}}),Qi(Jr,{sx:{flex:1,minWidth:0},children:[dr(Jr,{sx:{fontSize:16,color:"#37352f"},children:r.name}),r.exportBlockedReason??r.importBlockedReason?dr(Jr,{sx:{fontSize:13.5,color:"#8a6d1d",mt:.25,lineHeight:1.6},children:r.exportBlockedReason??r.importBlockedReason}):null]}),dr(nm,{label:"\uB0B4\uBCF4\uB0B4\uAE30",icon:dr(Z4,{sx:{fontSize:18}}),supported:r.exportSupported,reason:r.exportBlockedReason,onClick:()=>b(r.key)}),dr(nm,{label:rm(h,r.key)>0?`\uAC00\uC838\uC624\uAE30 (${rm(h,r.key)})`:"\uAC00\uC838\uC624\uAE30",icon:dr(J4,{sx:{fontSize:18}}),supported:r.importSupported,reason:r.importBlockedReason,onClick:()=>l(r.key)})]},r.key))})]});return dr(Y4,{open:e,onClose:o,width:680,title:"\uCE98\uB9B0\uB354 \uC5F0\uB3D9",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-link",sectionContentPaddingTop:0,sections:[{id:"calendar-link",showTitle:!1,children:s}],actions:{showCancelButton:!1,right:dr(om,{variant:"contained",onClick:o,children:"\uB2EB\uAE30"})}})}function rm(e,h){return e.filter(b=>b.provider===h).length}function nm({label:e,icon:h,supported:b,reason:l,onClick:o}){let s=dr(Jr,{component:"span",sx:{flexShrink:0},children:dr(om,{size:"medium",variant:"outlined",startIcon:h,disabled:!b,onClick:o,sx:{minWidth:132,whiteSpace:"nowrap"},children:e})});return b?s:dr(G4,{title:l??"\uC774 \uC11C\uBE44\uC2A4\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",arrow:!0,children:s})}import{useState as im}from"react";import{Box as xr,Button as Vu,Divider as t6,IconButton as r6,TextField as n6}from"@mui/material";import{FormDialog as o6}from"@ehfuse/mui-form-dialog";import i6 from"@mui/icons-material/OpenInNewOutlined";import s6 from"@mui/icons-material/EventOutlined";import{ConfirmDialog as a6}from"@ehfuse/alerts";import{Fragment as Q4}from"react";import{Fragment as e6,jsx as Uu}from"react/jsx-runtime";function qs({text:e}){let h=String(e??"").split("**");return Uu(e6,{children:h.map((b,l)=>l%2===1?Uu("b",{children:b},l):Uu(Q4,{children:b},l))})}import{jsx as jt,jsxs as $s}from"react/jsx-runtime";function Wq({open:e,imports:h,provider:b,onRegister:l,onRemove:o,onClose:s}){let r=Al(b),[t,n]=im(""),[c,i]=im(!1),a=async()=>{let u=t.trim();if(u){i(!0);try{await l(u)&&n("")}finally{i(!1)}}},d=async u=>{await a6({title:"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",message:`"${u.name||r.defaultCalendarName}" \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&o(u.seq)},f=$s(xr,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[$s(xr,{sx:{color:"#37352f",lineHeight:1.7},children:[r.name,"\uC758 \uC77C\uC815\uC744 ",jt("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uC5C5\uBB34\uD568 \uCE98\uB9B0\uB354\uC5D0 \uD568\uAED8 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4.",jt("br",{}),"\uD45C\uC2DC/\uC228\uAE40\uC740 \uC5C5\uBB34\uD568 \uC6B0\uC0C1\uB2E8\uC758 ",jt("b",{children:"\uC678\uBD80 \uCE98\uB9B0\uB354 \uC77C\uC815"})," \uC2A4\uC704\uCE58\uB85C \uCF1C\uACE0 \uB055\uB2C8\uB2E4."]}),jt(xr,{sx:{fontWeight:700,color:"#37352f",mt:.5},children:"\uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354"}),h.length>0?jt(xr,{sx:{display:"flex",flexDirection:"column",border:"1px solid #e6e6e3",borderRadius:1},children:h.map((u,g)=>$s(xr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:.75,borderTop:g>0?"1px solid #efefed":"none"},children:[jt(s6,{sx:{fontSize:18,color:"#0f9d58",flexShrink:0}}),jt(xr,{component:"span",sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u.name||r.defaultCalendarName}),jt(r6,{"aria-label":"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",size:"small",onClick:()=>{d(u)},sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:jt(cr,{sx:{fontSize:18}})})]},u.seq))}):jt(xr,{sx:{color:"#9a9a97",px:.5},children:"\uC544\uC9C1 \uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}),jt(t6,{sx:{my:1,borderColor:"#e6e6e3"}}),jt(xr,{sx:{fontWeight:700,color:"#37352f"},children:"\uC0C8 \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30"}),$s(xr,{sx:{bgcolor:"#f2f6fa",borderRadius:1,px:1.5,py:1.25,mb:1,fontSize:15,lineHeight:1.8,display:"flex",flexDirection:"column",gap:.25,"& > div":{display:"flex",gap:1},"& > div::before":{content:'"\u2022"',flexShrink:0}},children:[r.importSteps.map(u=>jt(xr,{children:jt(xr,{component:"span",children:jt(qs,{text:u})})},u)),jt(xr,{children:jt(xr,{component:"span",children:"\uB4F1\uB85D\uD55C \uC8FC\uC18C\uB294 \uC11C\uBC84\uC5D0 \uC800\uC7A5\uB418\uBA70 \uB2E4\uB978 \uC9C1\uC6D0\uC5D0\uAC8C \uBCF4\uC774\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})}),jt(xr,{children:jt(xr,{component:"span",children:"\uC77C\uC815\uC740 \uC57D 10\uBD84 \uAC04\uACA9\uC73C\uB85C \uAC31\uC2E0\uB418\uACE0, \uBC18\uBCF5 \uC77C\uC815\uC740 \uC77C\uBC18\uC801\uC778 \uADDC\uCE59(\uB9E4\uC77C/\uB9E4\uC8FC/\uB9E4\uC6D4/\uB9E4\uB144)\uB9CC \uC9C0\uC6D0\uD569\uB2C8\uB2E4."})}),r.importWarning?jt(xr,{children:jt(xr,{component:"span",children:jt(qs,{text:r.importWarning})})}):null]}),$s(xr,{sx:{display:"flex",gap:2,alignItems:"center"},children:[jt(n6,{value:t,onChange:u=>n(u.target.value),fullWidth:!0,label:"iCal \uC8FC\uC18C",placeholder:r.importPlaceholder,slotProps:{input:{spellCheck:!1}}}),jt(Vu,{variant:"contained",disabled:!t.trim()||c,onClick:()=>{a()},sx:{flexShrink:0},children:c?"\uD655\uC778 \uC911\u2026":"\uB4F1\uB85D"})]})]});return jt(o6,{open:e,onClose:s,width:680,title:`${r.name} \uAC00\uC838\uC624\uAE30`,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-import",sections:[{id:"calendar-import",showTitle:!1,children:f}],actions:{showCancelButton:!1,left:jt(Vu,{variant:"outlined",startIcon:jt(i6,{sx:{fontSize:16}}),onClick:()=>window.open(r.homeUrl,"_blank"),children:r.name}),right:jt(Vu,{variant:"contained",onClick:s,children:"\uB2EB\uAE30"})}})}import{Box as xi,Button as Hs,TextField as l6}from"@mui/material";import{FormDialog as c6}from"@ehfuse/mui-form-dialog";import u6 from"@mui/icons-material/ContentCopyOutlined";import sm from"@mui/icons-material/OpenInNewOutlined";import{InfoAlert as am}from"@ehfuse/alerts";import{Fragment as f6,jsx as Tr,jsxs as vi}from"react/jsx-runtime";function d6(e){return`${window.location.origin}/api/v1/taskbox/calendar/${e}.ics`}function e$({open:e,feed:h,feedTaskCount:b,provider:l,buildFeedUrl:o,onSubscribe:s,onClose:r}){let t=Al(l),n=o??d6,c=h.subscribed?n(h.token):"",i=()=>{navigator.clipboard.writeText(c).then(()=>am("\uD53C\uB4DC \uC8FC\uC18C\uB97C \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>am("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD558\uC138\uC694."))},a=()=>{let f=t.buildSubscribeUrl?.(c);f&&window.open(f,"_blank")},d=vi(xi,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[vi(xi,{sx:{color:"#37352f",lineHeight:1.7},children:["\uB0B4\uAC00 \uAD00\uC5EC\uD55C \uC5C5\uBB34\uB97C ",Tr("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C ",t.name,"\uC5D0\uC11C \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4."]}),b===0?vi(xi,{sx:{color:"#8a6d1d",bgcolor:"#faf1d7",borderRadius:1,px:1.5,py:1.25,lineHeight:1.7},children:["\uC9C0\uAE08\uC740 \uCE98\uB9B0\uB354\uC5D0 \uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",Tr("br",{}),Tr("b",{children:"\uB9C8\uAC10\uC77C\uC2DC\uAC00 \uC788\uB294 \uB0B4 \uC5C5\uBB34 \uB610\uB294 \uBCF4\uB0B8\uC5C5\uBB34"}),"\uAC00 \uC0DD\uAE30\uBA74"," ",h.subscribed?`${t.name}\uC5D0 \uC790\uB3D9\uC73C\uB85C \uD45C\uC2DC\uB429\uB2C8\uB2E4.`:"\uC5EC\uAE30\uC11C \uAD6C\uB3C5\uC744 \uC2DC\uC791\uD558\uC138\uC694."]}):h.subscribed&&h.enabled?vi(f6,{children:[Tr(l6,{value:c,fullWidth:!0,label:"\uB0B4 \uD53C\uB4DC \uC8FC\uC18C",slotProps:{input:{readOnly:!0}}}),vi(xi,{sx:{display:"flex",gap:2},children:[Tr(Hs,{variant:"outlined",startIcon:Tr(u6,{}),onClick:i,children:"\uC8FC\uC18C \uBCF5\uC0AC"}),t.buildSubscribeUrl?vi(Hs,{variant:"contained",startIcon:Tr(sm,{}),onClick:a,children:[t.name,"\uC5D0 \uCD94\uAC00"]}):null]}),vi(xi,{sx:{bgcolor:"#f2f6fa",borderRadius:1,px:1.5,py:1.25,fontSize:15,lineHeight:1.8,display:"flex",flexDirection:"column",gap:.25,"& > div":{display:"flex",gap:1},"& > div::before":{content:'"\u2022"',flexShrink:0}},children:[t.subscribeSteps.map(f=>Tr(xi,{children:Tr("span",{children:Tr(qs,{text:f})})},f)),Tr(xi,{children:Tr("span",{children:"\uC774 \uC8FC\uC18C\uB294 \uBCF8\uC778 \uC804\uC6A9\uC785\uB2C8\uB2E4. \uACF5\uC720\uD558\uBA74 \uB0B4 \uC5C5\uBB34 \uC77C\uC815\uC774 \uB178\uCD9C\uB429\uB2C8\uB2E4."})})]})]}):Tr(Hs,{variant:"contained",onClick:s,sx:{alignSelf:"flex-start"},children:"\uAD6C\uB3C5 \uC2DC\uC791 (\uD53C\uB4DC \uBC1C\uAE09)"})]});return Tr(c6,{open:e,onClose:r,width:680,title:`${t.name}\uB85C \uB0B4\uBCF4\uB0B4\uAE30`,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-subscribe",sections:[{id:"calendar-subscribe",showTitle:!1,children:d}],actions:{showCancelButton:!1,left:Tr(Hs,{variant:"outlined",startIcon:Tr(sm,{sx:{fontSize:16}}),onClick:()=>window.open(t.homeUrl,"_blank"),children:t.name}),right:Tr(Hs,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})}})}import{useEffect as h6,useMemo as Ku,useState as Gu}from"react";import{Box as Ws,Button as p6,Typography as m6}from"@mui/material";import{FormDialog as g6}from"@ehfuse/mui-form-dialog";import{SearchTextField as b6}from"@ehfuse/mui-form-controls";import{TreeView as y6}from"@ehfuse/tree-view";import{Fragment as S6,jsx as On,jsxs as T6}from"react/jsx-runtime";function lm(e){return`${e.name}#${e.seq}`}function x6(e){return Number(e.slice(e.lastIndexOf("#")+1))||0}function v6(e){let h=[],b=l=>{for(let o of l.employees??[])h.push(o);for(let o of l.groups??[])b(o)};for(let l of e)b(l);return h}function w6(e,h){return h?[e.name,e.department,e.role_name,e.work_position].filter(Boolean).some(b=>String(b).toLowerCase().includes(h)):!0}function _6(e){let h=[[e.name,e.role_name].filter(Boolean).join(" "),e.department].filter(Boolean).join(" / ");return{id:`emp:${e.seq}`,label:lm(e),renderLabel:On(Ws,{component:"span",sx:{display:"inline-flex",alignItems:"baseline",gap:.75},children:On(Ws,{component:"span",sx:{fontWeight:400,color:"text.primary"},children:h})})}}function cm(e,h){let b=(e.groups??[]).map(o=>cm(o,h)).filter(o=>o!==null),l=(e.employees??[]).filter(o=>w6(o,h)).map(_6);return b.length===0&&l.length===0?null:{id:`group:${e.key}`,label:e.name,children:[...b,...l]}}function k6({groups:e,allEmployees:h,initialSelectedSeqs:b,multiple:l,isMobile:o,onSelectionChange:s}){let[r,t]=Gu(""),n=Ku(()=>e.map(i=>cm(i,r.trim().toLowerCase())).filter(i=>i!==null),[e,r]),c=Ku(()=>h.filter(i=>b.includes(i.seq)).map(lm),[]);return T6(S6,{children:[On(Ws,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:On(b6,{size:"small",fullWidth:!0,placeholder:"\uC774\uB984, \uBD80\uC11C \uAC80\uC0C9",onSearch:t,onClear:()=>t(""),sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),On(Ws,{sx:o?{display:"flex",flexDirection:"column"}:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:On(y6,{items:n,checkbox:!0,multiSelect:l,selectionMode:"child",showSearch:!1,defaultExpanded:!0,initialSelections:c,onChange:i=>s(i.map(x6).filter(a=>a>0)),styles:{border:"none",borderRadius:"0"}})})]})}function c$({open:e,title:h="\uC9C1\uC6D0 \uC120\uD0DD",hint:b="",groups:l,multiple:o=!1,selectedSeqs:s,confirmText:r="\uD655\uC778",onConfirm:t,onClose:n}){let c=Nt(),[i,a]=Gu([]),[d,f]=Gu(0),u=Ku(()=>v6(l),[l]),g=s??[];h6(()=>{e&&(a(g),f(x=>x+1))},[e]);let m=()=>{let x=u.filter(_=>i.includes(_.seq));t(o?x:x.slice(0,1)),n()};return On(g6,{open:e,onClose:n,title:`${h}${o&&i.length>0?` (${i.length}\uBA85)`:""}`,locale:"ko",fullScreen:c,mobilePresentation:c?"slide":"dialog",draggable:!0,width:"600px",tabs:{visible:!1},titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},scrollPastLastSection:!1,sectionContentPaddingTop:0,fontScale:{enabled:!0},fontScaleKey:"taskbox-employee-select",sections:[{id:"employee-select",title:"\uC9C1\uC6D0 \uC120\uD0DD",showTitle:!1,children:On(Ws,{sx:{...c?{}:{height:560},display:"flex",flexDirection:"column",border:"1px solid #cccccc",borderRadius:1,...c?{}:{overflow:"hidden"},userSelect:"none"},children:On(k6,{groups:l,allEmployees:u,initialSelectedSeqs:g,multiple:o,isMobile:c,onSelectionChange:a},d)})}],dialogActionSx:{"@media (max-width:1023.95px)":{gap:"0.75rem !important","& .left-actions":{flex:1,minWidth:0},"& .right-actions":{flex:1}}},actions:{visible:!0,showCancelButton:!1,left:b?On(m6,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"pre-line",lineHeight:1.35},children:b}):void 0,right:On(p6,{variant:"contained",onClick:m,children:r})}})}import{useEffect as Yk,useMemo as Wm,useState as Zs}from"react";import{Box as Mo,Button as Um}from"@mui/material";import{FormDialog as Xk}from"@ehfuse/mui-form-dialog";import{LabelSelect as od}from"@ehfuse/mui-form-controls";import Zk from"@mui/icons-material/SpeedOutlined";import{useEffect as C6,useState as B6}from"react";import{Box as Qr,Button as I6}from"@mui/material";import{FormDialog as E6}from"@ehfuse/mui-form-dialog";import{LabelSelect as M6,NumberField as um}from"@ehfuse/mui-form-controls";import R6 from"@ehfuse/overlay-scrollbar";import{jsx as Wr,jsxs as Us}from"react/jsx-runtime";var O6=[{value:"count",label:"\uBBF8\uC644\uB8CC \uAC74\uC218"},{value:"points",label:"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8"}];function dm({open:e,capacity:h,employees:b,onClose:l,onSave:o}){let[s,r]=B6(h??io);C6(()=>{e&&r(h??io)},[e,h]);let t=s.basis==="points"?"SP":"\uAC74",n=(c,i)=>{let a=Math.max(0,Math.floor(Number(i)||0));r(d=>{let f={...d.by_account};return a>0?f[c]=a:delete f[c],{...d,by_account:f}})};return Wr(E6,{open:e,onClose:l,maxWidth:"sm",title:"\uC778\uC6D0 \uC6A9\uB7C9",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-workload-capacity",tabs:{visible:!1},actions:{showCancelButton:!0,right:Wr(I6,{variant:"contained",onClick:()=>{o(s)},children:"\uC800\uC7A5"})},sectionContentPaddingTop:0,sections:[{id:"capacity",title:"",showTitle:!1,children:Us(Qr,{sx:{display:"flex",flexDirection:"column",gap:2},children:[Wr(Qr,{sx:{fontSize:15,color:"#37352f"},children:"\uD55C \uC0AC\uB78C\uC774 \uB3D9\uC2DC\uC5D0 \uC548\uC744 \uC218 \uC788\uB294 \uC591\uC744 \uC815\uD569\uB2C8\uB2E4. \uC774 \uAC12\uC744 \uB118\uAE30\uBA74 \uC6CC\uD06C\uB85C\uB4DC \uCC28\uD2B8\uC5D0\uC11C \uBD89\uAC8C \uD45C\uC2DC\uB429\uB2C8\uB2E4. 0 \uC73C\uB85C \uB450\uBA74 \uC6A9\uB7C9\uC744 \uC4F0\uC9C0 \uC54A\uACE0 \uD300 \uD3C9\uADE0\uC744 \uAE30\uC900\uC73C\uB85C \uBD05\uB2C8\uB2E4."}),Us(Qr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Wr(Qr,{sx:{width:104,flexShrink:0,fontSize:16,color:"#37352f"},children:"\uC138\uB294 \uB2E8\uC704"}),Wr(M6,{size:"medium",fullWidth:!0,label:"",value:s.basis,options:O6,onChange:c=>r(i=>({...i,basis:c.target.value}))})]}),Us(Qr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Wr(Qr,{sx:{width:104,flexShrink:0,fontSize:16,color:"#37352f"},children:"\uAE30\uBCF8 \uC6A9\uB7C9"}),Wr(um,{size:"medium",fullWidth:!0,min:0,max:999,thousandSeparator:!1,align:"right",suffix:t,value:s.default_capacity,onValueChange:c=>r(i=>({...i,default_capacity:Math.max(0,Math.floor(Number(c)||0))}))})]}),Wr(Qr,{sx:{pl:"119px",mt:-1.25,fontSize:13.5,color:"#37352f"},children:`\uC804\uC6D0 \uACF5\uD1B5 \uAE30\uC900(${t}) \xB7 0 = \uC6A9\uB7C9 \uC548 \uC500`}),Wr(Qr,{sx:{fontSize:16,fontWeight:700,color:"#37352f"},children:"\uC0AC\uB78C\uBCC4 \uC608\uC678"}),b.length===0?Wr(Qr,{sx:{fontSize:15,color:"#787774"},children:"\uC9C1\uC6D0 \uBAA9\uB85D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uAE30\uBCF8 \uC6A9\uB7C9\uB9CC \uC801\uC6A9\uB429\uB2C8\uB2E4."}):Wr(Qr,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:Wr(R6,{style:{maxHeight:260},thumb:{width:6},children:b.filter(c=>Number(c.account_seq)>0).map(c=>Us(Qr,{sx:{display:"flex",alignItems:"center",gap:1.5,px:2,py:1,borderBottom:"1px solid #f2f2f0","&:last-of-type":{borderBottom:"none"}},children:[Us(Qr,{sx:{flex:1,minWidth:0,fontSize:16,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[c.name,c.department?Wr(Qr,{component:"span",sx:{ml:1,fontSize:14,color:"#787774"},children:c.department}):null]}),Wr(Qr,{sx:{width:132,flexShrink:0},children:Wr(um,{size:"small",fullWidth:!0,min:0,max:999,thousandSeparator:!1,align:"right",suffix:t,clearWhenZero:!0,value:s.by_account[Number(c.account_seq)]??0,onValueChange:i=>n(Number(c.account_seq),String(i??""))})})]},c.account_seq))})})]})}]})}import{Box as Pl}from"@mui/material";import{Bar as N6,BarChart as L6,CartesianGrid as j6,Cell as z6,ReferenceLine as F6,ResponsiveContainer as q6,Tooltip as $6,XAxis as H6,YAxis as W6}from"recharts";import{Box as A6}from"@mui/material";import{jsx as D6}from"react/jsx-runtime";function Ur({text:e,height:h}){return D6(A6,{sx:{display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",fontSize:14.5,color:"#9a9a97",...typeof h=="number"?{height:h,minHeight:120}:{position:"absolute",inset:0,pointerEvents:"none"}},children:e})}import{createElement as P6}from"react";var Dl="#2f80ed",fm="#a9c9f5",wi="#9a9a97",Yu="#2e9e6b",Jn="#3d7eff",Xu="#c3c8ce",Vs="#f2a30f",Ks={contentStyle:{fontSize:13.5,color:"#37352f",border:"1px solid #e6e6e3",borderRadius:6},labelStyle:{fontSize:13.5,color:"#37352f",fontWeight:700},itemStyle:{fontSize:13.5}},es={...Ks,cursor:!1},ts={wrapperStyle:{fontSize:13.5,paddingTop:10},formatter:e=>P6("span",{style:{paddingRight:14,color:"#37352f"}},e)};function fr(e){return{display:"flex",flexDirection:"column",minHeight:0,position:"relative",...typeof e=="string"?{flex:1}:{}}}var Dr={flexShrink:0,mb:1.5,display:"flex",alignItems:"center",gap:2,flexWrap:"wrap"};function Qn(e){return{"& *":{outline:"none"},userSelect:"none",...typeof e=="number"?{height:e,flexShrink:0}:{flex:1,minHeight:0}}}import{jsx as An,jsxs as Gs}from"react/jsx-runtime";function U6(e,h){let b=h.filter(l=>l.sprint_seq===e.seq&&!l.archived&&l.completed);return{points:b.reduce((l,o)=>l+(o.story_points??0),0),count:b.length}}function hm({sprints:e,tasks:h,height:b=200}){let o=[...e].sort((i,a)=>`${i.start_date}|${i.seq}`.localeCompare(`${a.start_date}|${a.seq}`)).map(i=>({sprint:i,...U6(i,h)})),s=o.some(i=>i.points>0),r=s?"SP":"\uAC74",t=o.filter(i=>i.sprint.status==="closed").map(i=>s?i.points:i.count),n=t.length>0?Math.round(t.reduce((i,a)=>i+a,0)/t.length*10)/10:null,c=o.map(i=>({\uBAA9\uD45C:`${i.sprint.name}${i.sprint.status!=="closed"?" (\uC9C4\uD589\uC911)":""}`,\uC644\uB8CC:s?i.points:i.count,closed:i.sprint.status==="closed"}));return o.length===0?An(Ur,{text:"\uD45C\uC2DC\uD560 \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:b}):Gs(Pl,{sx:fr(b),children:[Gs(Pl,{sx:{flexShrink:0,mb:1,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Gs("span",{children:["\uC644\uB8CC ",s?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uBAA9\uD45C\uBCC4"]}),n!==null?Gs("span",{children:["\uD3C9\uADE0(\uC885\uB8CC \uBAA9\uD45C)"," ",An(Pl,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:n}),r]}):null]}),An(Pl,{sx:Qn(b),children:An(q6,{width:"100%",height:"100%",children:Gs(L6,{data:c,margin:{top:8,right:12,left:0,bottom:0},barCategoryGap:"28%",children:[An(j6,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),An(H6,{dataKey:"\uBAA9\uD45C",tick:{fontSize:13},tickMargin:6,interval:0}),An(W6,{tick:{fontSize:13},width:40,allowDecimals:!1}),An($6,{...es,formatter:i=>`${Number(i??0)}${r}`}),n!==null?An(F6,{y:n,stroke:wi,strokeDasharray:"6 5",label:{value:`\uD3C9\uADE0 ${n}${r}`,position:"right",fontSize:13}}):null,An(N6,{dataKey:"\uC644\uB8CC",radius:[4,4,0,0],children:c.map(i=>An(z6,{fill:i.closed?Dl:fm},i.\uBAA9\uD45C))})]})})})]})}import{useMemo as V6}from"react";import{Box as eo}from"@mui/material";import{CartesianGrid as K6,Line as pm,LineChart as G6,ResponsiveContainer as Y6,Tooltip as X6,XAxis as Z6,YAxis as J6}from"recharts";import{jsx as en,jsxs as Xo}from"react/jsx-runtime";function mm(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?new Date(`${e}T00:00:00`):null}function Q6(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function ek(e){return e.slice(5).replace("-",".")}function gm({sprint:e,tasks:h,todayStr:b,height:l=200,headerLeft:o}){let s=V6(()=>{let a=mm(e.start_date),d=mm(e.end_date);if(!a||!d||d<a||Math.round((d.getTime()-a.getTime())/864e5)+1>366)return null;let u=h.filter(P=>P.sprint_seq===e.seq&&!P.archived);if(u.length===0)return{empty:!0};let g=u.some(P=>(P.story_points??0)>0),m=P=>g?P.story_points??0:1,x=u.reduce((P,N)=>P+m(N),0),_=new Map;for(let P of u){if(!P.completed)continue;let N=(P.completed_time??"").slice(0,10),q=/^\d{4}-\d{2}-\d{2}$/.test(N)?N:e.start_date;_.set(q,(_.get(q)??0)+m(P))}let B=[];for(let P=new Date(a);P<=d;P.setDate(P.getDate()+1))B.push(Q6(P));let A=x,j=x;return{empty:!1,data:B.map((P,N)=>{let q=B.length===1?0:x*(1-N/(B.length-1));return P<=b&&(A-=_.get(P)??0,j=Math.max(0,A)),{\uB0A0\uC9DC:ek(P),\uC774\uC0C1:Math.round(q*10)/10,\uB0A8\uC740\uB7C9:P<=b?Math.max(0,A):null}}),total:x,usePoints:g,last:j}},[e,h,b]);if(!s)return Xo(eo,{sx:fr(l),children:[o?en(eo,{sx:Dr,children:o}):null,en(Ur,{text:"\uBAA9\uD45C\uC758 \uC2DC\uC791\uC77C\xB7\uC885\uB8CC\uC77C\uC774 \uC788\uC5B4\uC57C \uBC88\uB2E4\uC6B4\uC744 \uADF8\uB9B4 \uC218 \uC788\uC2B5\uB2C8\uB2E4.",height:l})]});if(s.empty)return Xo(eo,{sx:fr(l),children:[o?en(eo,{sx:Dr,children:o}):null,en(Ur,{text:"\uBC30\uC815\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})]});let{data:r,total:t,usePoints:n,last:c}=s,i=n?"SP":"\uAC74";return Xo(eo,{sx:fr(l),children:[Xo(eo,{sx:Dr,children:[o?en(eo,{sx:{flexShrink:0},children:o}):null,Xo(eo,{sx:{flex:1,minWidth:220,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Xo("span",{children:["\uB0A8\uC740 ",n?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uCD1D ",t]}),Xo("span",{children:["\uD604\uC7AC"," ",en(eo,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:c}),i," \uB0A8\uC74C"]})]})]}),en(eo,{sx:Qn(l),children:en(Y6,{width:"100%",height:"100%",children:Xo(G6,{data:r,margin:{top:8,right:12,left:0,bottom:0},children:[en(K6,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),en(Z6,{dataKey:"\uB0A0\uC9DC",tick:{fontSize:13},tickMargin:6,minTickGap:24}),en(J6,{tick:{fontSize:13},width:40,allowDecimals:!1}),en(X6,{...Ks,formatter:a=>`${Number(a??0)}${i}`}),en(pm,{type:"linear",dataKey:"\uC774\uC0C1",stroke:wi,strokeDasharray:"6 5",strokeWidth:1.5,dot:!1}),en(pm,{type:"monotone",dataKey:"\uB0A8\uC740\uB7C9",stroke:Dl,strokeWidth:2.5,dot:!1,connectNulls:!1})]})})})]})}import{useMemo as km}from"react";import{Box as to}from"@mui/material";import{Area as Qu,AreaChart as ok,CartesianGrid as ik,Legend as sk,ResponsiveContainer as ak,Tooltip as lk,XAxis as ck,YAxis as uk}from"recharts";function Io(e){let h=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${h(e.getMonth()+1)}-${h(e.getDate())}`}function Nl(e,h=new Date){let b=new Date(h);return b.setMonth(b.getMonth()-e),b}function j$(e=new Date){return{fromDate:Io(Nl(1,e)),toDate:Io(e)}}var Ju=864e5,Ys=[0,1,2,3,5,8,13,21];function xm(e){return!e.archived&&!e.linked_only&&!e.is_notice&&!e.is_event}function Zu(e){let h=String(e??"").trim(),b=/^(\d{4}-\d{2}-\d{2})(?:[ T](\d{2}:\d{2}))?/.exec(h);if(!b)return null;let l=new Date(`${b[1]}T${b[2]??"00:00"}:00`).getTime();return Number.isNaN(l)?null:l}function rs(e){let h=String(e??"").trim();return/^\d{4}-\d{2}-\d{2}/.test(h)?h.slice(0,10):""}function tk(e){let h=rs(e.created_time)||rs(e.start_date)||rs(e.completed_time);if(!h)return null;let b=rs(e.start_date),l=b&&b>h?b:h,o=e.completed?rs(e.completed_time)||h:"";return{created:h,started:l,done:o}}function vm(e,h){let b=/^\d{4}-\d{2}-\d{2}$/.test(h)?new Date(`${h}T00:00:00`):new Date,l=Math.max(2,Math.min(366,Math.round(e))),o=[];for(let s=l-1;s>=0;s-=1)o.push(Io(new Date(b.getTime()-s*Ju)));return o}function wm(e,h,b){let l=vm(h,b),o=e.filter(xm).map(tk).filter(n=>n!==null),s=l.map(n=>{let c=0,i=0,a=0;for(let d of o)d.created>n||(d.done&&d.done<=n?c+=1:d.started<=n?i+=1:a+=1);return{day:n,done:c,inProgress:i,waiting:a}}),r=s[s.length-1],t=s.reduce((n,c)=>Math.max(n,c.done+c.inProgress+c.waiting),0);return{points:s,max:t,currentWip:r?.inProgress??0,currentTotal:r?r.done+r.inProgress+r.waiting:0,currentDone:r?.done??0}}function rk(e,h){if(e.length===0)return 0;let b=Math.min(e.length-1,Math.max(0,Math.ceil(e.length*h)-1));return e[b]}function bm(e){if(e.length===0)return null;let h=[...e].sort((s,r)=>s-r),b=s=>Math.round(s*10)/10,l=Math.floor(h.length/2),o=h.length%2===1?h[l]:(h[l-1]+h[l])/2;return{count:h.length,median:b(o),average:b(h.reduce((s,r)=>s+r,0)/h.length),p85:b(rk(h,.85))}}function ym(e){for(let h=Ys.length-1;h>=0;h-=1)if(e>=Ys[h])return h;return 0}function nk(){return Ys.map((e,h)=>h===Ys.length-1?`${e}\uC77C+`:`${e}~${Ys[h+1]}\uC77C`)}function _m(e,h,b){let l=vm(h,b),o=l[0],s=l[l.length-1],r=nk(),t=r.map(()=>0),n=r.map(()=>0),c=[],i=[];for(let a of e){if(!xm(a)||!a.completed)continue;let d=rs(a.completed_time);if(!d||d<o||d>s)continue;let f=Zu(a.completed_time),u=Zu(a.created_time);if(f===null||u===null)continue;let g=Math.max(0,(f-u)/Ju);c.push(g),t[ym(g)]+=1;let m=Zu(a.start_date);if(m===null||m>f)continue;let x=Math.max(0,(f-Math.max(m,u))/Ju);i.push(x),n[ym(x)]+=1}return{labels:r,leadCounts:t,cycleCounts:n,lead:bm(c),cycle:bm(i)}}import{jsx as Vr,jsxs as Zo}from"react/jsx-runtime";function dk(e){return e.slice(5).replace("-",".")}function Sm({tasks:e,todayStr:h,days:b=30,height:l=220,headerLeft:o}){let s=km(()=>wm(e,b,h),[e,b,h]),r=km(()=>s.points.map(n=>({\uB0A0\uC9DC:dk(n.day),\uC644\uB8CC:n.done,\uC9C4\uD589:n.inProgress,\uB300\uAE30:n.waiting})),[s]),t=Zo(to,{sx:Dr,children:[o?Vr(to,{sx:{flexShrink:0},children:o}):null,Zo(to,{sx:{flex:1,minWidth:220,display:"flex",flexDirection:"column",gap:.5},children:[Zo(to,{sx:{display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Zo("span",{children:["\uCD5C\uADFC ",s.points.length,"\uC77C \u2014 \uC811\uC218 ",s.currentTotal,"\uAC74 / \uC644\uB8CC ",s.currentDone,"\uAC74"]}),Zo("span",{children:["\uC9C4\uD589 \uC911"," ",Vr(to,{component:"span",sx:{color:Jn,fontWeight:700},children:s.currentWip}),"\uAC74"]})]}),Vr(to,{sx:{fontSize:13.5,color:"#37352f"},children:"\uB760\uAC00 \uB450\uAEBC\uC6CC\uC9C0\uBA74 \uC77C\uC774 \uC313\uC774\uB294 \uC911, \uC587\uC544\uC9C0\uBA74 \uCC98\uB9AC\uB418\uB294 \uC911\uC785\uB2C8\uB2E4."})]})]});return r.length===0||s.max===0?Zo(to,{sx:fr(l),children:[o?Vr(to,{sx:Dr,children:o}):null,Vr(Ur,{text:"\uC774 \uAE30\uAC04\uC5D0 \uC811\uC218\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})]}):Zo(to,{sx:fr(l),children:[t,Vr(to,{sx:Qn(l),children:Vr(ak,{width:"100%",height:"100%",children:Zo(ok,{data:r,margin:{top:8,right:12,left:0,bottom:4},children:[Vr(ik,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),Vr(ck,{dataKey:"\uB0A0\uC9DC",tick:{fontSize:13},tickMargin:6,minTickGap:24}),Vr(uk,{tick:{fontSize:13},width:40,allowDecimals:!1}),Vr(lk,{...Ks,formatter:n=>`${Number(n??0)}\uAC74`}),Vr(sk,{...ts}),Vr(Qu,{type:"monotone",dataKey:"\uC644\uB8CC",stackId:"flow",stroke:Yu,fill:Yu,fillOpacity:.9}),Vr(Qu,{type:"monotone",dataKey:"\uC9C4\uD589",stackId:"flow",stroke:Jn,fill:Jn,fillOpacity:.85}),Vr(Qu,{type:"monotone",dataKey:"\uB300\uAE30",stackId:"flow",stroke:Xu,fill:Xu,fillOpacity:.9})]})})})]})}import{useMemo as Tm}from"react";import{Box as tn}from"@mui/material";import{Bar as Cm,BarChart as fk,CartesianGrid as hk,Legend as pk,ResponsiveContainer as mk,Tooltip as gk,XAxis as bk,YAxis as yk}from"recharts";import{jsx as vr,jsxs as xn}from"react/jsx-runtime";function Bm({label:e,color:h,summary:b}){let l=xn(tn,{sx:{display:"flex",alignItems:"center",gap:.75},children:[vr(tn,{sx:{width:10,height:10,borderRadius:.5,bgcolor:h,flexShrink:0}}),vr(tn,{component:"span",sx:{fontWeight:700,color:"#37352f"},children:e})]});return b?xn(tn,{sx:{display:"contents"},children:[l,xn("span",{children:[b.count,"\uAC74"]}),xn("span",{children:["\uC911\uC559\uAC12"," ",vr(tn,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:b.median}),"\uC77C"]}),xn("span",{children:["\uD3C9\uADE0 ",b.average,"\uC77C"]}),xn("span",{children:["85% ",b.p85,"\uC77C \uC774\uB0B4"]})]}):xn(tn,{sx:{display:"contents"},children:[l,vr(tn,{component:"span",sx:{gridColumn:"span 4",color:"#9a9a97"},children:"\uD45C\uBCF8 \uC5C6\uC74C"})]})}function Im({tasks:e,todayStr:h,days:b=30,height:l=200,headerLeft:o}){let s=Tm(()=>_m(e,b,h),[e,b,h]),r=Tm(()=>s.labels.map((t,n)=>({\uAD6C\uAC04:t,\uB9AC\uB4DC\uD0C0\uC784:s.leadCounts[n],\uC0AC\uC774\uD074\uD0C0\uC784:s.cycleCounts[n]})),[s]);return s.lead?xn(tn,{sx:fr(l),children:[xn(tn,{sx:Dr,children:[o?vr(tn,{sx:{flexShrink:0},children:o}):null,xn(tn,{sx:{flex:1,minWidth:260,display:"grid",gridTemplateColumns:"max-content max-content max-content max-content max-content",justifyContent:"start",alignItems:"center",columnGap:3,rowGap:.5,fontSize:14,color:"#000"},children:[vr(Bm,{label:"\uB9AC\uB4DC\uD0C0\uC784(\uC791\uC131\u2192\uC644\uB8CC)",color:Jn,summary:s.lead}),vr(Bm,{label:"\uC0AC\uC774\uD074\uD0C0\uC784(\uC2DC\uC791\u2192\uC644\uB8CC)",color:Vs,summary:s.cycle})]})]}),vr(tn,{sx:Qn(l),children:vr(mk,{width:"100%",height:"100%",children:xn(fk,{data:r,margin:{top:8,right:12,left:0,bottom:4},barCategoryGap:"24%",children:[vr(hk,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),vr(bk,{dataKey:"\uAD6C\uAC04",tick:{fontSize:13},tickMargin:6,interval:0}),vr(yk,{tick:{fontSize:13},width:40,allowDecimals:!1}),vr(gk,{...es,formatter:t=>`${Number(t??0)}\uAC74`}),vr(pk,{...ts}),vr(Cm,{dataKey:"\uB9AC\uB4DC\uD0C0\uC784",fill:Jn,radius:[3,3,0,0]}),vr(Cm,{dataKey:"\uC0AC\uC774\uD074\uD0C0\uC784",fill:Vs,radius:[3,3,0,0]})]})})})]}):xn(tn,{sx:fr(l),children:[o?vr(tn,{sx:Dr,children:o}):null,vr(Ur,{text:"\uC774 \uAE30\uAC04\uC5D0 \uC644\uB8CC\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})]})}import{useMemo as Om}from"react";import{Box as _i}from"@mui/material";import{Bar as td,BarChart as kk,CartesianGrid as Sk,Cell as Tk,Legend as Ck,ReferenceLine as Am,ResponsiveContainer as Bk,Tooltip as Ik,XAxis as Ek,YAxis as Mk}from"recharts";function xk(e,h){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||!/^\d{4}-\d{2}-\d{2}$/.test(h))return null;let b=new Date(`${e}T00:00:00`).getTime(),l=new Date(`${h}T00:00:00`).getTime();return Number.isNaN(b)||Number.isNaN(l)?null:Math.round((l-b)/864e5)}function vk(e,h,b){let l=String(e.due_date??"").slice(0,10),o=xk(h,l);return o===null?"later":o<0?"overdue":o<=b?"soon":"later"}function Ll(e,h){let{todayStr:b,soonDays:l=7,includeUnassigned:o=!0,limit:s,capacity:r}=h,t=r??io,n=new Map;for(let i of e){if(i.completed||i.archived||i.is_notice||i.is_event||i.linked_only)continue;let a=Number(i.manager_account_seq??0);if(!a&&!o)continue;let d=a?String(i.manager_name??"").trim()||"\uC774\uB984 \uC5C6\uC74C":"\uBBF8\uBC30\uC815",f=n.get(a)??{accountSeq:a,name:d,overdue:0,soon:0,later:0,total:0,points:0,capacity:0,load:0,ratio:0};f[vk(i,b,l)]+=1,f.total+=1,f.points+=Number(i.story_points??0)||0,n.set(a,f)}for(let i of n.values())i.capacity=wk(i.accountSeq,t),i.load=t.basis==="points"?i.points:i.total,i.ratio=i.capacity>0?i.load/i.capacity:0;let c=[...n.values()].sort((i,a)=>i.accountSeq===0!=(a.accountSeq===0)?i.accountSeq===0?1:-1:i.overdue!==a.overdue?a.overdue-i.overdue:i.total!==a.total?a.total-i.total:i.name.localeCompare(a.name));return typeof s=="number"&&s>0?c.slice(0,s):c}function jl(e,h){return e.filter(b=>b.completed||b.archived||b.is_notice||b.is_event||b.linked_only?!1:Number(b.manager_account_seq??0)===h).sort((b,l)=>{let o=String(b.due_date??"").slice(0,10),s=String(l.due_date??"").slice(0,10);return!o!=!s?o?-1:1:o!==s?o.localeCompare(s):String(b.title??"").localeCompare(String(l.title??""))})}function wk(e,h){if(!(e>0))return 0;let b=Math.max(0,Math.floor(Number(h.by_account?.[e])||0));return b>0?b:Math.max(0,Math.floor(Number(h.default_capacity)||0))}function zl(e){return e.capacity>0&&e.load>e.capacity}function Em(e,h){return h>0&&e.total>=h}function Mm(e){let h=e.filter(b=>b.accountSeq>0);return h.length===0?0:h.reduce((b,l)=>b+l.total,0)/h.length}function ed(e,h){let b=new Date(`${e}T00:00:00`);b.setDate(b.getDate()+h);let l=o=>String(o).padStart(2,"0");return`${b.getFullYear()}-${l(b.getMonth()+1)}-${l(b.getDate())}`}function _k(e){let h=new Date(`${e}T00:00:00`);if(Number.isNaN(h.getTime()))return e;let b=(h.getDay()+6)%7;return ed(e,-b)}function Rm(e,h){let{todayStr:b,includeUnassigned:l=!0,weeks:o=6,limit:s}=h,r=_k(b),t=Array.from({length:Math.max(1,o)},(f,u)=>{let g=ed(r,u*7),m=ed(g,6),[,x,_]=g.split("-");return{start:g,end:m,label:`${Number(x)}/${Number(_)}`,isCurrent:u===0}}),n=t[t.length-1].end,c=new Map;for(let f of e){if(f.completed||f.archived||f.is_notice||f.is_event||f.linked_only)continue;let u=Number(f.manager_account_seq??0);if(!u&&!l)continue;let g=u?String(f.manager_name??"").trim()||"\uC774\uB984 \uC5C6\uC74C":"\uBBF8\uBC30\uC815",m=c.get(u)??{accountSeq:u,name:g,overdue:0,byWeek:new Array(t.length).fill(0),noDue:0,total:0,beyond:0},x=String(f.due_date??"").slice(0,10);if(m.total+=1,!/^\d{4}-\d{2}-\d{2}$/.test(x))m.noDue+=1;else if(x<b)m.overdue+=1;else if(x>n)m.beyond+=1;else{let _=t.findIndex(B=>x>=B.start&&x<=B.end);_>=0?m.byWeek[_]+=1:m.beyond+=1}c.set(u,m)}let i=[...c.values()].sort((f,u)=>f.accountSeq===0!=(u.accountSeq===0)?f.accountSeq===0?1:-1:f.overdue!==u.overdue?u.overdue-f.overdue:f.total!==u.total?u.total-f.total:f.name.localeCompare(u.name)),a=typeof s=="number"&&s>0?i.slice(0,s):i,d=a.reduce((f,u)=>Math.max(f,u.overdue,u.noDue,...u.byWeek),0);return{weeks:t,rows:a,maxCell:d}}import{Fragment as Dm,jsx as wr,jsxs as Jo}from"react/jsx-runtime";var Xs="#e5484d";function Pm({tasks:e,todayStr:h,soonDays:b=7,overloadThreshold:l=0,capacity:o=io,height:s=200,headerLeft:r,selectedAccountSeq:t=0,onSelectPerson:n}){let c=Om(()=>Ll(e,{todayStr:h,soonDays:b,capacity:o}),[e,h,b,o]),i=Om(()=>Mm(c),[c]),a=l>0?l:Math.max(3,Math.ceil(i*1.5)),d=o.default_capacity>0||Object.keys(o.by_account).length>0,f=o.basis==="points"?"SP":"\uAC74",u=c.filter(g=>g.accountSeq>0&&(d?zl(g):Em(g,a))).length;return c.length===0?Jo(_i,{sx:fr(s),children:[r?wr(_i,{sx:Dr,children:r}):null,wr(Ur,{text:"\uB2F4\uB2F9\uC790\uAC00 \uC9C0\uC815\uB41C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:s})]}):Jo(_i,{sx:fr(s),children:[Jo(_i,{sx:Dr,children:[r,Jo(_i,{sx:{fontSize:13.5,color:"#37352f"},children:["1\uC778 \uD3C9\uADE0 ",wr("b",{children:i.toFixed(1)}),"\uAC74 \xB7"," ",d?Jo(Dm,{children:["\uC6A9\uB7C9 ",wr("b",{children:o.default_capacity||"\uAC1C\uC778\uBCC4"}),o.default_capacity?f:""]}):Jo(Dm,{children:["\uACFC\uBD80\uD558 \uAE30\uC900 ",wr("b",{children:a}),"\uAC74"]}),u>0?Jo(_i,{component:"span",sx:{ml:1,color:Xs,fontWeight:700},children:["\uCD08\uACFC ",u,"\uBA85"]}):null]})]}),wr(_i,{sx:Qn(s),children:wr(Bk,{width:"100%",height:"100%",children:Jo(kk,{data:c,layout:"vertical",onClick:n?g=>{let m=c.find(x=>x.name===String(g?.activeLabel??""));m&&n(m.accountSeq===t?0:m.accountSeq)}:void 0,style:n?{cursor:"pointer"}:void 0,margin:{top:4,right:16,bottom:4,left:8},barCategoryGap:c.length>8?4:10,children:[wr(Sk,{strokeDasharray:"3 3",horizontal:!1,stroke:"#eceae6"}),wr(Ek,{type:"number",allowDecimals:!1,tick:{fontSize:12}}),wr(Mk,{type:"category",dataKey:"name",width:84,tick:{fontSize:12},interval:0}),wr(Ik,{...es,formatter:(g,m)=>[`${Number(g)||0}\uAC74`,String(m)],labelFormatter:g=>{let m=c.find(x=>x.name===g);return!m||!(m.capacity>0)?String(g):`${g} \u2014 \uC6A9\uB7C9 ${m.capacity}${f} \uC911 ${m.load} (${Math.round(m.ratio*100)}%)`}}),wr(Ck,{...ts}),i>0?wr(Am,{x:i,stroke:wi,strokeDasharray:"4 4",label:{value:"\uD3C9\uADE0",position:"top",fontSize:11,fill:wi}}):null,o.default_capacity>0?wr(Am,{x:o.default_capacity,stroke:Xs,strokeDasharray:"2 3",label:{value:"\uC6A9\uB7C9",position:"top",fontSize:11,fill:Xs}}):null,wr(td,{dataKey:"overdue",name:"\uC9C0\uC5F0",stackId:"load",fill:Xs}),wr(td,{dataKey:"soon",name:`\uC784\uBC15(${b}\uC77C)`,stackId:"load",fill:Vs}),wr(td,{dataKey:"later",name:"\uC5EC\uC720",stackId:"load",fill:Jn,radius:[0,3,3,0],children:c.map(g=>wr(Tk,{fill:d&&zl(g)?Xs:Jn,fillOpacity:d&&zl(g)?.45:1,stroke:g.accountSeq===t?"#37352f":void 0,strokeWidth:g.accountSeq===t?1.5:0},g.accountSeq))})]})})})]})}import{useEffect as jk,useState as zk}from"react";import{Box as Fk,Button as qk}from"@mui/material";import{FormDialog as $k}from"@ehfuse/mui-form-dialog";import{useState as Rk}from"react";import{Box as hr,Button as Ok,Menu as Ak,MenuItem as Dk}from"@mui/material";import Pk from"@mui/icons-material/PersonOutlineOutlined";import Nk from"@ehfuse/overlay-scrollbar";import{jsx as Cr,jsxs as Eo}from"react/jsx-runtime";var Nm=56,Lm=68,jm=96;function Lk(e){let h=String(e.due_date??"").slice(0,10);return h?h.slice(5).replace("-","/"):"-"}function zm(e,h){let b=String(e.due_date??"").slice(0,10);return!!b&&b<h}function Fm({tasks:e,row:h,todayStr:b,employees:l,rows:o,height:s=200,hideSummary:r=!1,onChangeManager:t,onOpenTask:n}){let[c,i]=Rk(null),a=jl(e,h.accountSeq),d=f=>o.find(u=>u.accountSeq===f)?.total??0;return Eo(hr,{sx:{display:"flex",flexDirection:"column",minHeight:0,height:s},children:[r?null:Eo(hr,{sx:{display:"flex",alignItems:"center",gap:1,px:.5,pb:.75,fontSize:14,color:"#37352f"},children:[Cr(hr,{component:"span",sx:{fontWeight:700},children:h.name}),Eo(hr,{component:"span",children:["\uBBF8\uC644\uB8CC ",a.length,"\uAC74"]}),h.capacity>0?Eo(hr,{component:"span",sx:{color:h.load>h.capacity?"#e5484d":"#787774"},children:["\xB7 \uC6A9\uB7C9 ",h.capacity," \uC911 ",h.load]}):null]}),Eo(hr,{sx:{flex:1,minHeight:0,display:"flex",flexDirection:"column",border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:[Eo(hr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,flexShrink:0,bgcolor:"#fafaf9",borderBottom:"1px solid #e6e6e3",fontSize:13.5,fontWeight:600,color:"#37352f"},children:[Cr(hr,{sx:{width:Nm,flexShrink:0},children:"\uB9C8\uAC10"}),Cr(hr,{sx:{flex:1,minWidth:0},children:"\uC5C5\uBB34"}),Cr(hr,{sx:{width:Lm,flexShrink:0,textAlign:"center"},children:"\uC911\uC694\uB3C4"}),t?Cr(hr,{sx:{width:jm,flexShrink:0,textAlign:"center"},children:"\uCC45\uC784\uC790"}):null]}),Cr(hr,{sx:{flex:1,minHeight:0},children:Cr(Nk,{style:{height:"100%"},thumb:{width:6},children:a.length===0?Cr(hr,{sx:{p:2,fontSize:14,color:"#9a9a97"},children:"\uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):a.map(f=>Eo(hr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1.5,borderBottom:"1px solid #f2f2f0"},children:[Cr(hr,{sx:{width:Nm,flexShrink:0,fontSize:13.5,color:zm(f,b)?"#e5484d":"#787774",fontWeight:zm(f,b)?700:400},children:Lk(f)}),Cr(hr,{onClick:n?()=>n(f.seq):void 0,sx:{flex:1,minWidth:0,fontSize:14.5,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...n?{cursor:"pointer","&:hover":{textDecoration:"underline"}}:{}},children:f.title}),Cr(hr,{sx:{width:Lm,flexShrink:0,display:"flex",justifyContent:"center"},children:Cr(Lr,{priority:f.priority})}),t?Cr(hr,{sx:{width:jm,flexShrink:0,display:"flex",justifyContent:"center"},children:Cr(Ok,{size:"small",variant:"outlined",startIcon:Cr(Pk,{sx:{fontSize:17}}),onClick:u=>i({el:u.currentTarget,taskSeq:f.seq}),children:"\uC62E\uAE30\uAE30"})}):null]},f.seq))})})]}),Cr(Ak,{anchorEl:c?.el??null,open:!!c,onClose:()=>i(null),transitionDuration:0,children:l.filter(f=>Number(f.account_seq)>0&&Number(f.account_seq)!==h.accountSeq).map(f=>Eo(Dk,{onClick:()=>{c&&t&&t(c.taskSeq,Number(f.account_seq),f.name),i(null)},sx:{fontSize:14,minWidth:200},children:[Cr(hr,{sx:{flex:1},children:f.name}),Eo(hr,{component:"span",sx:{ml:2,fontSize:13,color:"#787774"},children:[d(Number(f.account_seq)),"\uAC74"]})]},f.account_seq))})]})}import{jsx as Fl}from"react/jsx-runtime";function qm({open:e,row:h,rows:b,tasks:l,todayStr:o,employees:s,onClose:r,onChangeManager:t,onOpenTask:n}){let[c,i]=zk(h);jk(()=>{h&&i(h)},[h]);let a=h??c,d=a?jl(l,a.accountSeq).length:0;return Fl($k,{open:e,onClose:r,maxWidth:"sm",title:a?`${a.name} \uC5C5\uBB34 (${d})`:"\uC5C5\uBB34",locale:"ko",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-workload-person",tabs:{visible:!1},actions:{showCancelButton:!1,right:Fl(qk,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})},sections:[{id:"person-tasks",title:"",showTitle:!1,children:Fl(Fk,{sx:{minHeight:0},children:a?Fl(Fm,{tasks:l,row:a,rows:b,todayStr:o,employees:s,height:"min(420px, 52vh)",hideSummary:!0,onChangeManager:t,onOpenTask:n}):null})}]})}import{useMemo as Hk}from"react";import{Box as ln,Tooltip as Wk}from"@mui/material";import{OverlayScrollbar as Uk}from"@ehfuse/overlay-scrollbar";import{jsx as Kr,jsxs as $l}from"react/jsx-runtime";var $m="#e5484d",Vk="#2f80ed",Kk="#9a9a97",rd=30,Gk=96,ql=56;function nd({count:e,max:h,color:b,title:l}){let o=e>0&&h>0?.18+e/h*.72:0;return Kr(Wk,{title:l,arrow:!0,disableInteractive:!0,placement:"top",children:Kr(ln,{sx:{display:"flex",alignItems:"center",justifyContent:"center",borderRight:"1px solid #ececea",borderBottom:"1px solid #ececea",bgcolor:o>0?`${b}${Math.round(o*255).toString(16).padStart(2,"0")}`:"transparent",color:o>.55?"#fff":"#37352f",fontSize:12.5,fontWeight:e>0?700:400,fontVariantNumeric:"tabular-nums"},children:e>0?e:""})})}function Hm({tasks:e,todayStr:h,weeks:b=6,height:l=200}){let o=Hk(()=>Rm(e,{todayStr:h,weeks:b}),[e,h,b]);if(o.rows.length===0)return Kr(ln,{sx:fr(l),children:Kr(Ur,{text:"\uB2F4\uB2F9\uC790\uAC00 \uC9C0\uC815\uB41C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})});let s=`${Gk}px ${ql}px repeat(${o.weeks.length}, minmax(${ql}px, 1fr)) ${ql}px ${ql}px`,r={height:rd,display:"flex",alignItems:"center",justifyContent:"center",borderRight:"1px solid #ececea",borderBottom:"1px solid #dcdad6",fontSize:12,fontWeight:700,color:"#37352f",bgcolor:"#f8f8f7",whiteSpace:"nowrap"};return Kr(ln,{sx:fr(l),children:Kr(Uk,{style:{height:"100%"},thumb:{width:8},children:$l(ln,{sx:{display:"grid",gridTemplateColumns:s,minWidth:"fit-content",height:"100%",gridTemplateRows:`${rd}px repeat(${o.rows.length}, minmax(${rd}px, 1fr))`},children:[Kr(ln,{sx:{...r,justifyContent:"flex-start",pl:1},children:"\uB2F4\uB2F9\uC790"}),Kr(ln,{sx:{...r,color:$m},children:"\uC9C0\uC5F0"}),o.weeks.map(t=>Kr(ln,{sx:{...r,...t.isCurrent?{borderBottom:"2px solid #2f80ed"}:{}},children:t.label},t.start)),Kr(ln,{sx:r,children:"\uB9C8\uAC10\uC5C6\uC74C"}),Kr(ln,{sx:r,children:"\uD569\uACC4"}),o.rows.map(t=>$l(ln,{sx:{display:"contents"},children:[Kr(ln,{sx:{display:"flex",alignItems:"center",pl:1,borderRight:"1px solid #ececea",borderBottom:"1px solid #ececea",fontSize:13,color:t.accountSeq>0?"#37352f":"#9a9a97",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.name}),Kr(nd,{count:t.overdue,max:o.maxCell,color:$m,title:`${t.name} \xB7 \uC9C0\uC5F0 ${t.overdue}\uAC74`}),t.byWeek.map((n,c)=>Kr(nd,{count:n,max:o.maxCell,color:Vk,title:`${t.name} \xB7 ${o.weeks[c].label} \uC8FC \uB9C8\uAC10 ${n}\uAC74`},o.weeks[c].start)),Kr(nd,{count:t.noDue,max:o.maxCell,color:Kk,title:`${t.name} \xB7 \uB9C8\uAC10 \uBBF8\uC815 ${t.noDue}\uAC74`}),$l(ln,{sx:{display:"flex",alignItems:"center",justifyContent:"center",borderBottom:"1px solid #ececea",fontSize:12.5,fontWeight:700,color:"#37352f",fontVariantNumeric:"tabular-nums"},children:[t.total,t.beyond>0?$l(ln,{component:"span",sx:{ml:.25,fontSize:10.5,color:"#9a9a97"},children:["(+",t.beyond,")"]}):null]})]},t.accountSeq))]})})})}import{Fragment as Vm,jsx as Jt,jsxs as Hl}from"react/jsx-runtime";var Km="min(560px, 62vh)",Jk=`calc(${Km} - 4px)`,Qk=[{value:"30",label:"\uCD5C\uADFC 30\uC77C"},{value:"60",label:"\uCD5C\uADFC 60\uC77C"},{value:"90",label:"\uCD5C\uADFC 90\uC77C"}];function rW({open:e,sprints:h,tasks:b,todayStr:l,showSprintCharts:o,capacity:s=io,capacityEmployees:r=[],onSaveCapacity:t,onChangeTaskManager:n,onOpenTask:c,initialSprintSeq:i=0,onClose:a}){let[d,f]=Zs(0),[u,g]=Zs(30);Yk(()=>{if(!e)return;let y=h.find(w=>w.status==="active")??h[0],v=h.find(w=>w.seq===i)??y;f(v?.seq??0)},[e]);let m=Wm(()=>h.find(y=>y.seq===d)??null,[h,d]),x={height:Jk,boxSizing:"border-box",px:3,py:2.5,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden"},_=Jt(od,{label:"\uBAA9\uD45C",showLabel:!1,showEmptyOption:!1,value:d?String(d):"",options:h.map(y=>({value:String(y.seq),label:mn(y)})),onChange:y=>f(Number(y.target.value)||0),sx:{width:280,flexShrink:0}}),[B,A]=Zs("distribution"),j=Jt(od,{label:"\uBCF4\uAE30",showLabel:!1,showEmptyOption:!1,value:B,options:[{value:"distribution",label:"\uC9C0\uAE08 \uBD80\uD558(\uC9C0\uC5F0\xB7\uC784\uBC15\xB7\uC5EC\uC720)"},{value:"timeline",label:"\uC8FC\uBCC4 \uB9C8\uAC10 \uBC00\uC9D1"}],onChange:y=>A(y.target.value==="timeline"?"timeline":"distribution"),sx:{width:280,flexShrink:0}}),[D,P]=Zs(!1),[N,q]=Zs(0),z=Wm(()=>Ll(b,{todayStr:l,capacity:s}),[b,l,s]),T=z.find(y=>y.accountSeq===N)??null,C=Hl(Vm,{children:[j,t?Jt(Um,{size:"small",variant:"outlined",startIcon:Jt(Zk,{sx:{fontSize:18}}),onClick:()=>P(!0),sx:{flexShrink:0},children:"\uC6A9\uB7C9"}):null]}),R=o??h.length>0,p=Jt(od,{label:"\uAE30\uAC04",showLabel:!1,showEmptyOption:!1,value:String(u),options:Qk,onChange:y=>g(Number(y.target.value)||30),sx:{width:280,flexShrink:0}});return Hl(Vm,{children:[Jt(Xk,{open:e,onClose:a,maxWidth:"md",title:"\uC5C5\uBB34 \uCC28\uD2B8",locale:"ko",contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,sectionTitleGap:0,fixedHeight:Km,contentBottomPadding:0,scrollPastLastSection:!1,tabs:{visible:!0,switchContent:!0,fullWidth:!0},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-charts",sections:[...R?[{id:"velocity",tabTitle:"\uBCA8\uB85C\uC2DC\uD2F0",showTitle:!1,children:Jt(Mo,{sx:x,children:Jt(hm,{sprints:h,tasks:b,height:"100%"})})},{id:"burndown",tabTitle:"\uBC88\uB2E4\uC6B4",showTitle:!1,children:Jt(Mo,{sx:x,children:m?Jt(gm,{sprint:m,tasks:b,todayStr:l,height:"100%",headerLeft:_}):Hl(Mo,{sx:fr("100%"),children:[Jt(Mo,{sx:Dr,children:_}),Jt(Ur,{text:"\uBC88\uB2E4\uC6B4\uC744 \uBCFC \uBAA9\uD45C\uB97C \uC120\uD0DD\uD558\uC138\uC694.",height:"100%"})]})})},{id:"cumulative-flow",tabTitle:"\uB204\uC801\uD750\uB984\uB3C4",showTitle:!1,children:Jt(Mo,{sx:x,children:Jt(Sm,{tasks:b,todayStr:l,days:u,height:"100%",headerLeft:p})})}]:[],{id:"workload",tabTitle:"\uC6CC\uD06C\uB85C\uB4DC",showTitle:!1,children:Jt(Mo,{sx:x,children:B==="timeline"?Hl(Mo,{sx:{display:"flex",flexDirection:"column",height:"100%",minHeight:0},children:[Jt(Mo,{sx:Dr,children:C}),Jt(Hm,{tasks:b,todayStr:l,height:"100%"})]}):Jt(Pm,{tasks:b,todayStr:l,height:"100%",capacity:s,headerLeft:C,selectedAccountSeq:N,onSelectPerson:n?q:void 0})})},{id:"lead-time",tabTitle:"\uB9AC\uB4DC\uD0C0\uC784",showTitle:!1,children:Jt(Mo,{sx:x,children:Jt(Im,{tasks:b,todayStr:l,days:u,height:"100%",headerLeft:p})})}],actions:{showCancelButton:!1,right:Jt(Um,{variant:"contained",onClick:a,children:"\uB2EB\uAE30"})}}),Jt(qm,{open:N>0,row:T,rows:z,tasks:b,todayStr:l,employees:r,onClose:()=>q(0),onChangeManager:n,onOpenTask:c}),t?Jt(dm,{open:D,capacity:s,employees:r,onClose:()=>P(!1),onSave:async y=>{await t(y),P(!1)}}):null]})}import{Checkbox as e8,Divider as t8,Menu as r8,MenuItem as id}from"@mui/material";import{jsx as Js,jsxs as Gm}from"react/jsx-runtime";function aW({anchorEl:e,candidates:h,selectedNames:b,avatarSrcByName:l,onToggle:o,onClear:s,onClose:r}){return Gm(r8,{anchorEl:e,open:!!e,onClose:r,transitionDuration:0,children:[h.length===0?Js(id,{disabled:!0,sx:{fontSize:14},children:"\uBAA9\uB85D\uC5D0 \uC9C0\uC815\uB41C \uC0AC\uB78C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):h.map(t=>{let n=b.includes(t.name);return Gm(id,{onClick:()=>o(t),sx:{fontSize:14,minWidth:170,gap:1},children:[Js(e8,{size:"small",checked:n,sx:{p:0}}),Js(jr,{names:[t.name],size:20,avatarSrcByName:l}),t.name]},`${t.accountSeq}-${t.name}`)}),Js(t8,{}),Js(id,{disabled:b.length===0,onClick:s,sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{useState as n8}from"react";import{ButtonBase as o8,Menu as i8,MenuItem as s8}from"@mui/material";import a8 from"@mui/icons-material/KeyboardArrowDown";import l8 from"@mui/icons-material/Check";import{Fragment as c8,jsx as sd,jsxs as ad}from"react/jsx-runtime";function mW({value:e,onChange:h,options:b}){let[l,o]=n8(null),s=b??vc,r=vc.find(t=>t.value===e)?.label??"";return ad(c8,{children:[ad(o8,{onClick:t=>o(t.currentTarget),sx:{display:"flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:1,fontSize:13.5,color:"#37352f","&:hover":{bgcolor:"#f2f2f0"}},children:[r,sd(a8,{sx:{fontSize:17,color:"#9a9a97"}})]}),sd(i8,{transitionDuration:0,anchorEl:l,open:!!l,onClose:()=>o(null),children:s.map(t=>ad(s8,{selected:t.value===e,onClick:()=>{h(t.value),o(null)},sx:{fontSize:14,minWidth:140,justifyContent:"space-between",gap:1},children:[t.label,t.value===e?sd(l8,{sx:{fontSize:16,color:"#2f80ed"}}):null]},t.value))})]})}import{Box as Wl,ButtonBase as u8}from"@mui/material";import{DateTextField as Ym}from"@ehfuse/mui-form-controls";import{jsx as Qs,jsxs as Xm}from"react/jsx-runtime";var d8=[{label:"1\uAC1C\uC6D4",months:1},{label:"3\uAC1C\uC6D4",months:3},{label:"6\uAC1C\uC6D4",months:6},{label:"1\uB144",months:12},{label:"\uC804\uCCB4",months:0}];function Zm({fromDate:e,toDate:h,onChange:b}){let l=s=>{if(s<=0){b("","");return}b(Io(Nl(s)),Io(new Date))},o=s=>s<=0?!e&&!h:!e||!h?!1:e===Io(Nl(s))&&h===Io(new Date);return Xm(Wl,{sx:{display:"flex",alignItems:"center",gap:1.5,flexWrap:"wrap"},children:[Qs(Wl,{sx:{display:"flex",alignItems:"center",gap:1.5},children:d8.map(s=>{let r=o(s.months);return Qs(u8,{onClick:()=>l(s.months),sx:{px:1.25,py:.85,borderRadius:1,fontSize:13,fontWeight:r?500:400,border:"1px solid",borderColor:r?"#2f80ed":"#dedddb",color:r?"#2f80ed":"#37352f",bgcolor:r?"#eef6ff":"transparent","&:hover":{bgcolor:r?"#eef6ff":"#f7f7f5"}},children:s.label},s.label)})}),Xm(Wl,{sx:{display:"flex",alignItems:"center",gap:.5},children:[Qs(Ym,{value:e,size:"small",placeholder:"\uC2DC\uC791\uC77C",onChange:s=>b(s.target.value,h),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}}),Qs(Wl,{component:"span",sx:{fontSize:13,color:"#9a9a97"},children:"~"}),Qs(Ym,{value:h,size:"small",placeholder:"\uC885\uB8CC\uC77C",onChange:s=>b(e,s.target.value),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}})]})]})}import{Popover as f8}from"@mui/material";import{jsx as Jm}from"react/jsx-runtime";function TW({anchorEl:e,fromDate:h,toDate:b,onChange:l,onClose:o}){return Jm(f8,{transitionDuration:0,anchorEl:e,open:!!e,onClose:o,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{p:1.5}}},children:Jm(Zm,{fromDate:h,toDate:b,onChange:l})})}import{Box as h8,ButtonBase as p8,Tab as m8,Tabs as g8}from"@mui/material";import b8 from"@mui/icons-material/Checklist";import y8 from"@mui/icons-material/Face";import x8 from"@mui/icons-material/Publish";import v8 from"@mui/icons-material/NotificationsOutlined";import w8 from"@mui/icons-material/BugReportOutlined";import _8 from"@mui/icons-material/DescriptionOutlined";import k8 from"@mui/icons-material/Inventory2Outlined";import{jsx as Dn}from"react/jsx-runtime";function Qm(e,h){return h>0?`${e} (${h})`:e}var jW=[{id:"my",label:"\uC804\uCCB4",icon:Dn(b8,{sx:{fontSize:18}})},{id:"mine",label:"\uB0B4 \uC5C5\uBB34",icon:Dn(y8,{sx:{fontSize:18}})},{id:"sent",label:"\uBCF4\uB0B8 \uC5C5\uBB34",icon:Dn(x8,{sx:{fontSize:18}})},{id:"bug",label:"\uC624\uB958",icon:Dn(w8,{sx:{fontSize:18}})},{id:"notice",label:"\uACF5\uC9C0\uC0AC\uD56D",icon:Dn(v8,{sx:{fontSize:18}})},{id:"archive",label:"\uBCF4\uAD00\uD568",icon:Dn(k8,{sx:{fontSize:18}}),hideCount:!0},{id:"report",label:"\uBCF4\uACE0\uC11C",icon:Dn(_8,{sx:{fontSize:18}}),hideCount:!0}];function S8(e){return{minHeight:46,minWidth:75,bgcolor:e.bg,color:e.color,borderRadius:"8px 8px 0 0",padding:"10px 18px",textTransform:"none",fontSize:14,fontWeight:500,border:`1px solid ${e.borderColor}`,borderBottom:"none","&:hover":{bgcolor:e.hoverBg},"&.Mui-selected":{bgcolor:e.selectedBg,color:e.selectedColor,border:`1px solid ${e.selectedBg}`,borderBottom:"none","&:hover":{bgcolor:e.selectedBg}},...e.sx}}function zW({items:e,activeTab:h,counts:b,onChange:l,compact:o=!1}){let s=ct(),r=S8(s.tabs),t=e;return o?Dn(h8,{sx:{display:"flex",flexWrap:"wrap",gap:1.25},children:t.map(n=>{let c=h===n.id;return Dn(p8,{onClick:()=>l(n.id),sx:{px:1.5,py:.75,borderRadius:1,fontSize:kr(13.5),fontWeight:500,whiteSpace:"nowrap",border:"1px solid",bgcolor:c?s.tabs.selectedBg:s.tabs.bg,color:c?s.tabs.selectedColor:s.tabs.color,borderColor:c?s.tabs.selectedBg:s.tabs.borderColor},children:Qm(n.label,n.hideCount?0:b[n.id]??0)},n.id)})}):Dn(g8,{value:h,onChange:(n,c)=>l(c),sx:{minHeight:46,"& .MuiTabs-indicator":{display:"none"},"& .MuiTabs-flexContainer":{gap:"12px",minHeight:46}},children:t.map(n=>Dn(m8,{value:n.id,label:Qm(n.label,n.hideCount?0:b[n.id]??0),icon:n.icon,iconPosition:"start",sx:r},n.id))})}import{useEffect as T8,useMemo as C8,useState as ld}from"react";import{Divider as Ul,ListItemIcon as Gr,Menu as cd,MenuItem as _r}from"@mui/material";import B8 from"@mui/icons-material/OpenInNewOutlined";import I8 from"@mui/icons-material/RestoreFromTrashOutlined";import E8 from"@mui/icons-material/Check";import M8 from"@mui/icons-material/CheckCircleOutlined";import R8 from"@mui/icons-material/RadioButtonUnchecked";import O8 from"@mui/icons-material/SendOutlined";import A8 from"@mui/icons-material/EventOutlined";import D8 from"@mui/icons-material/PersonOutlineOutlined";import P8 from"@mui/icons-material/ViewKanbanOutlined";import N8 from"@mui/icons-material/ContentCopyOutlined";import L8 from"@mui/icons-material/NextPlanOutlined";import j8 from"@mui/icons-material/ContentPasteOutlined";import z8 from"@mui/icons-material/ShareOutlined";import F8 from"@mui/icons-material/DirectionsRunOutlined";import e0 from"@mui/icons-material/ChevronRight";import q8 from"@mui/icons-material/ArchiveOutlined";import $8 from"@mui/icons-material/UnarchiveOutlined";import{ConfirmDialog as t0}from"@ehfuse/alerts";import{Fragment as r0,jsx as ut,jsxs as pr}from"react/jsx-runtime";function bU({target:e,onClose:h,customTabs:b,sprints:l=[],myAccountSeq:o=0,onOpenDetail:s,onToggleCompleted:r,onRequestConfirm:t,onChangeDueDate:n,onChangeReminder:c,onMemberEdit:i,onMoveProject:a,onDuplicate:d,onCreateFollowUp:f,onShare:u,onAssignSprint:g,onArchiveToggle:m,onDelete:x,onRestore:_,onPurge:B}){let A=Nt(),j=Nn(),[D,P]=ld(null),[N,q]=ld(null),[z,T]=ld(null);T8(()=>{e||(P(null),q(null),T(null))},[e]);let C=e?.task??null,R=!!C?.is_notice,p=!!C?.is_event,y=C?!lo(C,o):!1,v=!!C?.deleted,w=C8(()=>new Set(b.filter(L=>L.useSprints).map(L=>L.key)),[b]),k=async(L="one")=>{let $=C;if(h(),!$)return;await t0({title:"\uC5C5\uBB34 \uC0AD\uC81C",message:L==="series"?`"${$.title}" \uC758 \uC774 \uD68C\uCC28\uC640 \uC774\uD6C4 \uBC18\uBCF5 \uD68C\uCC28\uB97C \uBAA8\uB450 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`:`"${$.title}" \uC5C5\uBB34\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&x($.seq,L)},S=async()=>{let L=C;if(h(),!L)return;await t0({title:"\uC601\uAD6C \uC0AD\uC81C",message:`"${L.title}" \uC5C5\uBB34\uB97C \uC601\uAD6C\uD788 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C? \uB418\uB3CC\uB9B4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.`})&&B?.(L.seq)},E=()=>{C&&m(C.seq,!C.archived),h()};return pr(r0,{children:[pr(cd,{open:!!e,onClose:h,transitionDuration:0,anchorReference:A?"none":"anchorPosition",anchorPosition:!A&&e?{top:e.position.top,left:e.position.left}:void 0,slotProps:{paper:{sx:{minWidth:190,...A?{position:"fixed",top:"50%",left:"50%",translate:"-50% -50%",maxHeight:"70vh"}:{}}},list:A?{sx:{"& .MuiMenuItem-root":{py:1,minHeight:0}}}:void 0},children:[pr(_r,{onClick:()=>{C&&s(C),h()},sx:{fontSize:14},children:[ut(Gr,{children:ut(B8,{sx:{fontSize:19}})}),"\uC0C1\uC138 \uC5F4\uAE30"]}),v?ut(Ul,{}):null,v&&_?pr(_r,{onClick:()=>{C&&_(C.seq),h()},sx:{fontSize:14},children:[ut(Gr,{children:ut(I8,{sx:{fontSize:19}})}),"\uBCF5\uC6D0"]}):null,v&&B?pr(_r,{onClick:()=>{S()},sx:{fontSize:14,color:"#e5484d"},children:[ut(Gr,{children:ut(cr,{sx:{fontSize:19,color:"#e5484d"}})}),"\uC601\uAD6C \uC0AD\uC81C"]}):null,v?null:pr(r0,{children:[pr(_r,{disabled:R?(C?.author_account_seq??0)!==o:(C?.author_account_seq??0)!==o&&(C?.manager_account_seq??0)!==o,onClick:()=>{C&&r(C.seq,!C.completed),h()},sx:{fontSize:14},children:[ut(Gr,{children:C?.completed?ut(R8,{sx:{fontSize:19}}):ut(M8,{sx:{fontSize:19}})}),C?.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC"]}),!R&&t?pr(_r,{disabled:!(C?.manager_account_seq??0)&&(C?.receiver_account_seqs??[]).length===0,onClick:()=>{C&&t(C),h()},sx:{fontSize:14},children:[ut(Gr,{children:ut(O8,{sx:{fontSize:19}})}),"\uD655\uC778 \uC694\uCCAD"]}):null,p?null:ut(Ul,{}),p?null:pr(_r,{disabled:y,onClick:L=>{C&&P({anchorEl:L.currentTarget,task:C})},sx:{fontSize:14},children:[ut(Gr,{children:ut(A8,{sx:{fontSize:19}})}),"\uB9C8\uAC10\uC77C\uC2DC \uBCC0\uACBD"]}),!R&&!p&&i?pr(_r,{onClick:()=>{C&&i(C,"manager"),h()},sx:{fontSize:14},children:[ut(Gr,{children:ut(D8,{sx:{fontSize:19}})}),"\uCC45\uC784\uC790 \uBCC0\uACBD"]}):null,p?null:pr(_r,{disabled:y,onClick:L=>{C&&q({anchorEl:L.currentTarget,task:C})},sx:{fontSize:14},children:[ut(Gr,{children:ut(P8,{sx:{fontSize:19}})}),"\uD504\uB85C\uC81D\uD2B8 \uC774\uB3D9",ut(e0,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}),ut(Ul,{}),d?pr(_r,{disabled:y,onClick:()=>{C&&d(C.seq),h()},sx:{fontSize:14},children:[ut(Gr,{children:ut(N8,{sx:{fontSize:19}})}),"\uBCF5\uC81C"]}):null,f&&C&&!C.is_event&&!C.is_notice?pr(_r,{onClick:()=>{C&&f(C.seq),h()},sx:{fontSize:14},children:[ut(Gr,{children:ut(L8,{sx:{fontSize:19}})}),"\uD6C4\uC18D \uC5C5\uBB34 \uB9CC\uB4E4\uAE30"]}):null,pr(_r,{onClick:()=>{C&&(u?u(C):Ki(C,A)),h()},sx:{fontSize:14},children:[ut(Gr,{children:A?ut(z8,{sx:{fontSize:19}}):ut(j8,{sx:{fontSize:19}})}),A?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC"]}),C&&!C.is_notice&&!C.is_event&&w.has(String(C.tab_key??""))&&g?pr(_r,{onClick:L=>T(L.currentTarget),sx:{fontSize:14},children:[ut(Gr,{children:ut(F8,{sx:{fontSize:19}})}),"\uBAA9\uD45C\uC5D0 \uB123\uAE30",ut(e0,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}):null,pr(_r,{onClick:E,disabled:y||!C?.archived&&!(C&&Ta(C)),sx:{fontSize:14},children:[ut(Gr,{children:C?.archived?ut($8,{sx:{fontSize:19}}):ut(q8,{sx:{fontSize:19}})}),C?.archived?"\uBCF4\uAD00 \uD574\uC81C":"\uBCF4\uAD00"]}),ut(Ul,{}),pr(_r,{disabled:y,onClick:()=>{k("one")},sx:{fontSize:14,color:"#e5484d"},children:[ut(Gr,{children:ut(cr,{sx:{fontSize:19,color:"#e5484d"}})}),(C?.repeat_group_key??0)>0?"\uC0AD\uC81C (\uC774 \uD68C\uCC28\uB9CC)":"\uC0AD\uC81C"]}),(C?.repeat_group_key??0)>0?pr(_r,{disabled:y,onClick:()=>{k("series")},sx:{fontSize:14,color:"#e5484d"},children:[ut(Gr,{children:ut(cr,{sx:{fontSize:19,color:"#e5484d"}})}),"\uC0AD\uC81C (\uC774\uD6C4 \uBC18\uBCF5 \uC804\uCCB4)"]}):null]})]}),ut(pn,{anchorEl:D?.anchorEl??null,open:!!D,date:D?.task.due_date??"",reminders:zn(D?.task),hideReminder:!!D?.task.completed,centered:A,onClose:()=>{P(null),h()},onDateChange:L=>{D&&n(D.task.seq,L)},onReminderChange:L=>{D&&c?.(D.task.seq,L)}}),pr(cd,{transitionDuration:0,anchorEl:N?.anchorEl??null,open:!!N,onClose:()=>{q(null),h()},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...j,children:[ut(_r,{selected:!N?.task.tab_key,onClick:()=>{N&&a(N.task.seq,""),q(null),h()},sx:{fontSize:14,minWidth:170},children:"\uC5C6\uC74C"}),b.filter(L=>!L.archived).map(L=>ut(_r,{selected:N?.task.tab_key===L.key,onClick:()=>{N&&a(N.task.seq,L.key),q(null),h()},sx:{fontSize:14,minWidth:170},children:L.label},L.key))]}),ut(cd,{transitionDuration:0,anchorEl:z,open:!!z,onClose:()=>T(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...l.filter(L=>`custom-${L.group_seq}`===String(C?.tab_key??"")).map(L=>({seq:L.seq,label:mn(L)}))].map(L=>pr(_r,{onClick:()=>{C&&g?.(C.seq,L.seq),T(null),h()},sx:{fontSize:14,minWidth:160,gap:1},children:[L.label,(C?.sprint_seq??0)===L.seq?ut(E8,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},L.seq))})]})}import{Checkbox as H8,Divider as W8,Menu as U8,MenuItem as n0}from"@mui/material";import{jsx as Vl,jsxs as o0}from"react/jsx-runtime";function _U({anchorEl:e,labelOptions:h,selectedKeys:b,onToggle:l,onClear:o,onClose:s}){return o0(U8,{transitionDuration:0,anchorEl:e,open:!!e,onClose:s,children:[h.map(r=>{let t=b.includes(r.key);return o0(n0,{onClick:()=>l(r.key),sx:{fontSize:14,minWidth:190,gap:1},children:[Vl(H8,{size:"small",checked:t,sx:{p:0}}),Vl(Ot,{option:r})]},r.key)}),Vl(W8,{}),Vl(n0,{disabled:b.length===0,onClick:()=>{o(),s()},sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{Divider as V8,Menu as K8,MenuItem as i0}from"@mui/material";import G8 from"@mui/icons-material/Check";import Y8 from"@mui/icons-material/SettingsOutlined";import{jsx as ud,jsxs as dd}from"react/jsx-runtime";function EU(e){let{anchorEl:h,sprints:b,value:l,onSelect:o,onManage:s,onClose:r}=e;return dd(K8,{transitionDuration:0,anchorEl:h,open:!!h,onClose:r,children:[[{seq:0,label:"\uC804\uCCB4"},{seq:-1,label:"\uBBF8\uBC30\uC815 \uC5C5\uBB34"},...b.map(t=>({seq:t.seq,label:mn(t)}))].map(t=>dd(i0,{onClick:()=>{o(t.seq),r()},sx:{fontSize:14,minWidth:180,gap:1},children:[t.label,l===t.seq?ud(G8,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},t.seq)),ud(V8,{}),dd(i0,{onClick:()=>{r(),s()},sx:{fontSize:14,gap:1},children:[ud(Y8,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uAD00\uB9AC\u2026"]})]})}var X8={my:"tasks",mine:"tasks",sent:"tasks",notice:"notice",bug:"bug",archive:"archive",done:"done",report:"report"};function Z8(e){return X8[e]??"tasks"}var a0={list:"\uBAA9\uB85D",card:"\uD504\uB85C\uC81D\uD2B8",kanban:"\uC0C1\uD0DC",sprint:"\uBAA9\uD45C",calendar:"\uC8FC\uAC04",month:"\uC6D4\uAC04",agenda:"\uC544\uC820\uB2E4",timeline:"\uD0C0\uC784\uB77C\uC778"},s0=["list","calendar","month","card","kanban","sprint","timeline"],J8=["list","card"];function OU(e){let h=Z8(e);switch(h){case"notice":return{kind:h,viewOptions:[],showCreate:!0,createLabel:"\uACF5\uC9C0\uC0AC\uD56D \uB4F1\uB85D",showGroupBy:!1,showSprintFilter:!1,showDateRange:!1,showHideCompleted:!0,forceFlatList:!0,columns:{notice:!0}};case"bug":return{kind:h,viewOptions:s0,showCreate:!0,createLabel:"\uC624\uB958 \uB4F1\uB85D",showGroupBy:!0,showSprintFilter:!0,showDateRange:!1,showHideCompleted:!0,forceFlatList:!1,columns:{bug:!0}};case"archive":return{kind:h,viewOptions:J8,showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"done":return{kind:h,viewOptions:["list"],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"report":return{kind:h,viewOptions:[],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{}};default:return{kind:h,viewOptions:s0,showCreate:!0,createLabel:"\uC5C5\uBB34 \uB4F1\uB85D",showGroupBy:!0,showSprintFilter:!0,showDateRange:!1,showHideCompleted:!0,forceFlatList:!1,columns:e==="mine"?{showRequest:!1,confirmMode:"action"}:e==="sent"?{confirmMode:"time"}:{}}}}import{useMemo as Q8}from"react";import{useKeyboardState as eS}from"@ehfuse/keyboard-state";var l0=[{key:"g l",view:"list"},{key:"g b",view:"card"},{key:"g k",view:"kanban"},{key:"g s",view:"sprint"},{key:"g c",view:"calendar"},{key:"g m",view:"month"},{key:"g t",view:"timeline"}];function LU(e,h={}){let{enabled:b=!0,views:l}=h,{onCreateTask:o,onFocusSearch:s,onToggleHelp:r,onChangeView:t,onRefresh:n,onEscape:c}=e,i=l?l.join(","):"",a=Q8(()=>{let d=[];if(o&&d.push({key:"n",callback:o,options:{preventDefault:!0}}),s&&d.push({key:"/",callback:s,options:{preventDefault:!0}}),n&&d.push({key:"r",callback:n,options:{preventDefault:!0}}),r&&d.push({key:"shift+?",callback:r,options:{preventDefault:!0}}),c&&d.push({key:"escape",callback:c,options:{allowInEditable:!0}}),t)for(let f of c0(i?i.split(","):void 0))d.push({key:f.key,callback:()=>t(f.view),options:{preventDefault:!0}});return d},[o,s,r,t,n,c,i]);eS(b?a:[])}function c0(e){if(!e)return l0;let h=new Set(e);return l0.filter(b=>h.has(b.view))}function fd(e){return[{keys:"N",description:"\uC0C8 \uC5C5\uBB34 \uB4F1\uB85D"},{keys:"/",description:"\uAC80\uC0C9"},{keys:"R",description:"\uBAA9\uB85D \uC0C8\uB85C\uACE0\uCE68"},...c0(e).map(h=>({keys:h.key.split(" ").map(b=>b.toUpperCase()).join(" \u2192 "),description:`${a0[h.view]} \uBCF4\uAE30`})),{keys:"?",description:"\uB2E8\uCD95\uD0A4 \uB3C4\uC6C0\uB9D0"},{keys:"Esc",description:"\uB2EB\uAE30"}]}var jU=fd();import{Box as ea,Button as tS}from"@mui/material";import rS from"@mui/icons-material/ArrowRightAlt";import{FormDialog as nS}from"@ehfuse/mui-form-dialog";import{jsx as Qo,jsxs as u0}from"react/jsx-runtime";function oS({keys:e}){return Qo(ea,{sx:{display:"flex",alignItems:"center",gap:.5,justifyContent:"flex-end"},children:e.split(" \u2192 ").map((h,b)=>u0(ea,{sx:{display:"flex",alignItems:"center",gap:.5},children:[b>0?Qo(rS,{sx:{fontSize:18,color:"#9a9a97"}}):null,Qo(ea,{component:"span",sx:{minWidth:32,height:32,px:.75,display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:13.5,fontWeight:700,color:"#37352f",bgcolor:"#f4f4f2",border:"1px solid #e0dfdb",borderRadius:1,fontVariantNumeric:"tabular-nums"},children:h})]},`${h}-${b}`))})}function WU({open:e,onClose:h,views:b}){let l=fd(b);return Qo(nS,{open:e,onClose:h,maxWidth:"xs",title:"\uB2E8\uCD95\uD0A4",locale:"ko",titleIcons:{delete:{visible:!1}},tabs:{visible:!1},sectionContentPaddingTop:0,sections:[{id:"shortcuts",showTitle:!1,children:Qo(ea,{sx:{display:"grid",gridTemplateColumns:"auto 1fr",columnGap:2,rowGap:1.25,alignItems:"center",fontSize:14,color:"#37352f"},children:l.map(o=>u0(ea,{sx:{display:"contents"},children:[Qo(oS,{keys:o.keys}),Qo("span",{children:o.description})]},o.keys))})}],actions:{showCancelButton:!1,right:Qo(tS,{variant:"contained",onClick:h,children:"\uB2EB\uAE30"})}})}import{useEffect as d0,useRef as iS,useState as ns}from"react";import{Box as nr,Button as Pn,IconButton as hd,Menu as f0,MenuItem as h0,Switch as sS,Tooltip as p0}from"@mui/material";import{FormDialog as m0}from"@ehfuse/mui-form-dialog";import pd from"@mui/icons-material/Add";import aS from"@mui/icons-material/ArrowRightAlt";import lS from"@mui/icons-material/BoltOutlined";import cS from"@mui/icons-material/Close";import uS from"@mui/icons-material/EditOutlined";import{ErrorAlert as g0}from"@ehfuse/alerts";import{ClearTextField as ta,LabelSelect as cn}from"@ehfuse/mui-form-controls";import{Fragment as y0,jsx as Ke,jsxs as vn}from"react/jsx-runtime";var md=[{value:"created",label:"\uC5C5\uBB34 \uB4F1\uB85D \uC2DC",hint:"\uC0C8 \uC5C5\uBB34\uAC00 \uB9CC\uB4E4\uC5B4\uC9C4 \uC9C1\uD6C4 \uD55C \uBC88 \uC2E4\uD589\uD569\uB2C8\uB2E4."},{value:"status_changed",label:"\uC0C1\uD0DC \uBCC0\uACBD \uC2DC",hint:"\uC0C1\uD0DC\uAC00 \uC2E4\uC81C\uB85C \uBC14\uB010 \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4."},{value:"commented",label:"\uB313\uAE00\uC774 \uB2EC\uB838\uC744 \uB54C",hint:"\uB313\uAE00\uC774 \uC0C8\uB85C \uB2EC\uB9AC\uAC70\uB098 \uC218\uC815\uB41C \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4(\uD68C\uC2E0\uC744 \uBC1B\uC740 \uC790\uB9AC)."},{value:"manager_assigned",label:"\uCC45\uC784\uC790\uAC00 \uC9C0\uC815\uB410\uC744 \uB54C",hint:"\uCC45\uC784\uC790\uAC00 \uC0C8\uB85C \uC9C0\uC815\uB418\uAC70\uB098 \uBC14\uB010 \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4."},{value:"attachment_added",label:"\uCCA8\uBD80\uAC00 \uC62C\uB77C\uC654\uC744 \uB54C",hint:"\uC5C5\uBB34\uC5D0 \uD30C\uC77C\uC774 \uCCA8\uBD80\uB41C \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4(\uC99D\uBE59 \uC811\uC218 \uC790\uB9AC)."},{value:"field_changed",label:"\uD544\uB4DC\uAC00 \uBC14\uB00C\uC5C8\uC744 \uB54C",hint:"\uC9C0\uC815\uD55C \uD544\uB4DC\uAC00 \uC2E4\uC81C\uB85C \uBC14\uB010 \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4(\uD544\uB4DC\uB97C \uC548 \uACE0\uB974\uBA74 \uC544\uBB34 \uC218\uC815\uC5D0\uB098 \uC2E4\uD589)."},{value:"overdue",label:"\uB9C8\uAC10 \uACBD\uACFC \uC2DC",hint:"\uB9C8\uAC10\uC774 \uC9C0\uB09C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uB97C \uB9E4\uC77C \uC810\uAC80\uD574 \uC2E4\uD589\uD569\uB2C8\uB2E4."}],ra=[{value:"due_date",label:"\uB9C8\uAC10\uC77C\uC2DC"},{value:"start_date",label:"\uC2DC\uC791\uC77C\uC2DC"},{value:"priority",label:"\uC911\uC694\uB3C4"},{value:"manager_account_seq",label:"\uCC45\uC784\uC790"},{value:"receiver_account_seqs",label:"\uCC38\uC870\uC790"},{value:"label_keys",label:"\uB77C\uBCA8"},{value:"group_seq",label:"\uD504\uB85C\uC81D\uD2B8"},{value:"sprint_seq",label:"\uBAA9\uD45C"},{value:"content",label:"\uB0B4\uC6A9"},{value:"note",label:"\uBE44\uACE0"}],Yl=[{value:"high",label:"\uB192\uC74C"},{value:"medium",label:"\uC911\uAC04"},{value:"low",label:"\uB0AE\uC74C"}];function Kl(){return{name:"",trigger:"created",enabled:!0,sort_no:0,condition:{},action:{}}}function Gl(e){return nn.find(h=>h.key===e)?.name??e}function dS(e,h,b){let{condition:l,action:o}=e,s=[];if(l.group_seq){let n=h.find(c=>Go(c.key)===l.group_seq);s.push(`\uD504\uB85C\uC81D\uD2B8=${n?.label??`#${l.group_seq}`}`)}l.is_bug===!0&&s.push("\uC624\uB958\uB9CC"),l.is_event===!0&&s.push("\uC77C\uC815\uB9CC"),l.priority&&s.push(`\uC911\uC694\uB3C4=${Yl.find(n=>n.value===l.priority)?.label}`),l.label_key&&s.push(`\uB77C\uBCA8=${b.find(n=>n.key===l.label_key)?.name??l.label_key}`),l.title_contains&&s.push(`\uC81C\uBAA9\uC5D0 "${l.title_contains}" \uD3EC\uD568`),l.status&&s.push(`\uC0C1\uD0DC=${Gl(l.status)}`),l.from_status&&s.push(`${Gl(l.from_status)}\uC5D0\uC11C`),l.to_status&&s.push(`${Gl(l.to_status)}\uB85C`),l.manager_empty===!0&&s.push("\uCC45\uC784\uC790 \uC5C6\uC74C"),l.manager_empty===!1&&s.push("\uCC45\uC784\uC790 \uC788\uC74C"),l.manager_account_seq&&s.push(`\uCC45\uC784\uC790=${l.manager_name||`\uACC4\uC815 #${l.manager_account_seq}`}`),l.receiver_account_seq&&s.push(`\uCC38\uC870\uC790\uC5D0 ${l.receiver_name||`\uACC4\uC815 #${l.receiver_account_seq}`}`),l.changed_field&&s.push(`${ra.find(n=>n.value===l.changed_field)?.label??l.changed_field} \uBCC0\uACBD`),l.comment_contains&&s.push(`\uB313\uAE00\uC5D0 "${l.comment_contains}" \uD3EC\uD568`),l.comment_by_others===!0&&s.push("\uB0A8\uC774 \uC4F4 \uB313\uAE00"),typeof l.overdue_days=="number"&&s.push(`${l.overdue_days}\uC77C \uACBD\uACFC`);let r=[];o.set_status&&r.push(`\uC0C1\uD0DC=${Gl(o.set_status)}`),o.set_priority&&r.push(`\uC911\uC694\uB3C4=${Yl.find(n=>n.value===o.set_priority)?.label}`),o.assign_manager_account_seq&&r.push(`\uCC45\uC784\uC790=${o.assign_manager_name||"\uC9C0\uC815"}`),o.add_receiver_account_seq&&r.push(`\uCC38\uC870\uC790 + ${o.add_receiver_name||"\uC9C0\uC815"}`),o.add_label_key&&r.push(`\uB77C\uBCA8 + ${b.find(n=>n.key===o.add_label_key)?.name??o.add_label_key}`),o.apply_content_template_seq&&r.push(`\uBCF8\uBB38 \uC591\uC2DD=${o.apply_content_template_name||"\uC9C0\uC815"}`),o.notify_account_seq&&r.push("\uC54C\uB9BC \uBC1C\uC1A1");let t=md.find(n=>n.value===e.trigger)?.label??e.trigger;return{left:s.length>0?`${t} \xB7 ${s.join(", ")}`:t,right:r.join(", ")||"\uB3D9\uC791 \uC5C6\uC74C"}}var b0={fontSize:16,fontWeight:700,color:"#37352f"},fS={display:"flex",alignItems:"center",gap:1},hS={width:104,flexShrink:0,fontSize:16,color:"#37352f"};function sV({open:e,rules:h,customTabs:b,statusOptions:l,contentTemplates:o=[],onPickAccount:s,onClose:r,onCreate:t,onUpdate:n,onToggle:c,onRemove:i}){let[a,d]=ns(!1),[f,u]=ns(0),[g,m]=ns(Kl()),[x,_]=ns(!1),B=iS(null),[A,j]=ns(null),[D,P]=ns(null);d0(()=>{if(e)return;let H=window.setTimeout(()=>{d(!1),u(0),m(Kl())},500);return()=>window.clearTimeout(H)},[e]),d0(()=>{if(!a)return;let H=window.setTimeout(()=>B.current?.focus(),120);return()=>window.clearTimeout(H)},[a]);let N=f>0,q=g.trigger,z=()=>{d(!1),u(0),m(Kl())},T=(H,Z)=>{m(J=>{let G={...J.condition};return Z===""||Z===void 0||Z===null?delete G[H]:G[H]=Z,{...J,condition:G}})},C=(H,Z)=>{m(J=>{let G={...J.action};return Z===""||Z===void 0||Z===null?delete G[H]:G[H]=Z,{...J,action:G}})},R=H=>{m(Z=>{let J={...Z.condition};return H!=="status_changed"&&(delete J.from_status,delete J.to_status),H!=="overdue"&&delete J.overdue_days,H!=="field_changed"&&delete J.changed_field,H!=="commented"&&(delete J.comment_contains,delete J.comment_by_others),H==="field_changed"&&J.changed_field===void 0&&(J.changed_field=ra[0]?.value??""),{...Z,trigger:H,condition:J}})},p=b.filter(H=>!H.archived),y=l.map(H=>({value:H.key,label:H.name})),v=nn.map(H=>({value:H.key,label:H.name})),w=p.map(H=>({value:String(Go(H.key)),label:H.label})),{condition:k,action:S}=g,E=k.is_bug!==void 0||k.is_event!==void 0,L=[...k.group_seq===void 0&&w.length>0?[{key:"group_seq",label:"\uD504\uB85C\uC81D\uD2B8\uAC00 ~\uC778 \uACBD\uC6B0"}]:[],...E?[]:[{key:"kind",label:"\uC885\uB958\uAC00 \uC624\uB958/\uC77C\uC815\uC778 \uACBD\uC6B0"}],...k.priority===void 0?[{key:"priority",label:"\uC911\uC694\uB3C4\uAC00 ~\uC778 \uACBD\uC6B0"}]:[],...k.label_key===void 0&&y.length>0?[{key:"label_key",label:"\uB77C\uBCA8\uC774 \uBD99\uC5B4 \uC788\uB294 \uACBD\uC6B0"}]:[],...k.title_contains===void 0?[{key:"title_contains",label:"\uC81C\uBAA9\uC5D0 ~ \uB2E8\uC5B4\uAC00 \uD3EC\uD568\uB41C \uACBD\uC6B0"}]:[],...k.manager_empty===void 0?[{key:"manager_empty",label:"\uCC45\uC784\uC790\uAC00 \uC5C6\uB294/\uC788\uB294 \uACBD\uC6B0"}]:[],...s&&k.manager_account_seq===void 0?[{key:"manager_account",label:"\uCC45\uC784\uC790\uAC00 ~\uC778 \uACBD\uC6B0"}]:[],...s&&k.receiver_account_seq===void 0?[{key:"receiver_account",label:"\uCC38\uC870\uC790\uC5D0 ~\uAC00 \uD3EC\uD568\uB41C \uACBD\uC6B0"}]:[],...q==="status_changed"&&k.from_status===void 0?[{key:"from_status",label:"\uC774 \uC0C1\uD0DC\uC5D0\uC11C \uBC14\uB010 \uACBD\uC6B0"}]:[],...q==="status_changed"&&k.to_status===void 0?[{key:"to_status",label:"\uC774 \uC0C1\uD0DC\uB85C \uBC14\uB010 \uACBD\uC6B0"}]:[],...q==="field_changed"&&k.changed_field===void 0?[{key:"changed_field",label:"~ \uD544\uB4DC\uAC00 \uBCC0\uACBD\uB41C \uACBD\uC6B0"}]:[],...q==="commented"&&k.comment_contains===void 0?[{key:"comment_contains",label:"\uB313\uAE00\uC5D0 ~ \uB2E8\uC5B4\uAC00 \uD3EC\uD568\uB41C \uACBD\uC6B0"}]:[],...q==="commented"&&k.comment_by_others===void 0?[{key:"comment_by_others",label:"\uCC45\uC784\uC790\uAC00 \uC544\uB2CC \uC0AC\uB78C\uC774 \uC4F4 \uACBD\uC6B0"}]:[],...q==="overdue"&&k.overdue_days===void 0?[{key:"overdue_days",label:"\uB9C8\uAC10 \uD6C4 \uBA70\uCE60 \uC9C0\uB09C \uACBD\uC6B0"}]:[]],$=async H=>{if(!s)return;let Z=H==="manager_account"?k.manager_account_seq??0:k.receiver_account_seq??0,J=await s(Z,H==="manager_account"?"\uCC45\uC784\uC790":"\uCC38\uC870\uC790");J&&m(G=>{let X={...G.condition};return H==="manager_account"?(X.manager_account_seq=J.accountSeq,X.manager_name=J.name):(X.receiver_account_seq=J.accountSeq,X.receiver_name=J.name),{...G,condition:X}})},U=H=>{j(null),H==="group_seq"?T("group_seq",Number(w[0]?.value)||0):H==="kind"?T("is_bug",!0):H==="priority"?T("priority","high"):H==="label_key"?T("label_key",y[0]?.value??""):H==="title_contains"?m(Z=>({...Z,condition:{...Z.condition,title_contains:""}})):H==="manager_empty"?T("manager_empty",!0):H==="manager_account"||H==="receiver_account"?$(H):H==="from_status"?T("from_status",nn[0]?.key??""):H==="to_status"?T("to_status",nn[0]?.key??""):H==="changed_field"?T("changed_field",ra[0]?.value??""):H==="comment_contains"?m(Z=>({...Z,condition:{...Z.condition,comment_contains:""}})):H==="comment_by_others"?T("comment_by_others",!0):H==="overdue_days"&&T("overdue_days",1)},O=H=>{if(H==="kind"){T("is_bug",""),T("is_event","");return}if(H==="manager_account"){T("manager_account_seq",""),T("manager_name","");return}if(H==="receiver_account"){T("receiver_account_seq",""),T("receiver_name","");return}T(H==="group_seq"?"group_seq":H,"")},W=[...S.set_status===void 0?[{key:"set_status",label:"\uC0C1\uD0DC \uBC14\uAFB8\uAE30"}]:[],...S.set_priority===void 0?[{key:"set_priority",label:"\uC911\uC694\uB3C4 \uBC14\uAFB8\uAE30"}]:[],...S.add_label_key===void 0&&y.length>0?[{key:"add_label_key",label:"\uB77C\uBCA8 \uBD99\uC774\uAE30"}]:[],...s&&S.assign_manager_account_seq===void 0?[{key:"assign_manager",label:"\uCC45\uC784\uC790 \uC9C0\uC815\uD558\uAE30"}]:[],...s&&S.add_receiver_account_seq===void 0?[{key:"add_receiver",label:"\uCC38\uC870\uC790 \uCD94\uAC00\uD558\uAE30"}]:[],...o.length>0&&S.apply_content_template_seq===void 0?[{key:"apply_content_template",label:"\uBCF8\uBB38 \uC591\uC2DD \uCC44\uC6B0\uAE30"}]:[],...s&&S.notify_account_seq===void 0?[{key:"notify",label:"\uC54C\uB9BC \uBCF4\uB0B4\uAE30"}]:[]],M=async H=>{if(!s)return;let Z=H==="assign_manager"?S.assign_manager_account_seq??0:H==="add_receiver"?S.add_receiver_account_seq??0:S.notify_account_seq??0,J=await s(Z,H==="assign_manager"?"\uCC45\uC784\uC790":H==="add_receiver"?"\uCC38\uC870\uC790":"\uC54C\uB9BC \uBC1B\uC744 \uC0AC\uB78C");J&&m(G=>{let X={...G.action};return H==="assign_manager"?(X.assign_manager_account_seq=J.accountSeq,X.assign_manager_name=J.name):H==="add_receiver"?(X.add_receiver_account_seq=J.accountSeq,X.add_receiver_name=J.name):(X.notify_account_seq=J.accountSeq,X.notify_name=J.name),{...G,action:X}})},I=H=>{if(P(null),H==="set_status")C("set_status",nn[0]?.key??"");else if(H==="set_priority")C("set_priority","high");else if(H==="add_label_key")C("add_label_key",y[0]?.value??"");else if(H==="apply_content_template"){let Z=o[0];m(J=>({...J,action:{...J.action,apply_content_template_seq:Z?.seq??0,apply_content_template_name:Z?.name??""}}))}else M(H)},F=H=>{H==="assign_manager"?(C("assign_manager_account_seq",""),C("assign_manager_name","")):H==="add_receiver"?(C("add_receiver_account_seq",""),C("add_receiver_name","")):H==="apply_content_template"?(C("apply_content_template_seq",""),C("apply_content_template_name","")):H==="notify"?(C("notify_account_seq",""),C("notify_name",""),C("notify_message","")):C(H,"")},V=async()=>{if(!g.name.trim()){g0({message:"\uADDC\uCE59 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694."});return}if(Object.keys(g.action).length===0){g0({message:"\uB3D9\uC791\uC744 \uD558\uB098 \uC774\uC0C1 \uCD94\uAC00\uD558\uC138\uC694."});return}let H=N?g.sort_no:h.reduce((J,G)=>Math.max(J,G.sort_no),0)+1;_(!0);let Z=N?await n(f,{...g,sort_no:H}):await t({...g,sort_no:H});_(!1),Z&&z()},Y=(H,Z,J,G)=>vn(nr,{sx:fS,children:[Ke(nr,{sx:hS,children:H}),vn(nr,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:G?"column":"row",alignItems:G?"stretch":"center",gap:G?.5:1},children:[Z,G?Ke(nr,{sx:{fontSize:13.5,color:"#37352f"},children:G}):null]}),Ke(p0,{title:"\uC774 \uC904 \uBE7C\uAE30",arrow:!0,disableInteractive:!0,children:Ke(hd,{size:"small","aria-label":`${H} \uC904 \uBE7C\uAE30`,onClick:J,children:Ke(cS,{sx:{fontSize:16}})})})]}),K=()=>vn(nr,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[Ke(ta,{size:"medium",label:"\uADDC\uCE59 \uC774\uB984",inputRef:B,placeholder:"\uC608: \uC811\uC218 \uC624\uB958 \uC790\uB3D9 \uBC30\uC815",value:g.name,onChange:H=>m(Z=>({...Z,name:H.target.value}))}),Ke(nr,{sx:{display:"flex",alignItems:"center",gap:2,flexWrap:"wrap"},children:md.map(H=>{let Z=q===H.value;return Ke(Pn,{disableElevation:!0,variant:Z?"contained":"outlined",color:Z?"primary":"inherit",onClick:()=>R(H.value),sx:{borderRadius:99,px:1.75,...Z?{}:{color:"#57564f",borderColor:"#d9d9d6"}},children:H.label},H.value)})}),Ke(nr,{sx:{fontSize:13,color:"#787774",mt:-.5},children:md.find(H=>H.value===q)?.hint}),vn(nr,{sx:{display:"flex",alignItems:"center",gap:1,mt:.5},children:[Ke(nr,{sx:b0,children:"\uC5B4\uB5A4 \uC5C5\uBB34\uC77C \uB54C"}),L.length>0?Ke(Pn,{size:"small",startIcon:Ke(pd,{sx:{fontSize:16}}),onClick:H=>j(H.currentTarget),sx:{color:"#2563eb",minWidth:0},children:"\uC870\uAC74 \uCD94\uAC00"}):null]}),k.group_seq!==void 0?Y("\uD504\uB85C\uC81D\uD2B8",Ke(cn,{size:"medium",fullWidth:!0,label:"",value:String(k.group_seq),options:w,onChange:H=>T("group_seq",Number(H.target.value)||"")}),()=>O("group_seq")):null,E?Y("\uC885\uB958",Ke(cn,{size:"medium",fullWidth:!0,label:"",value:k.is_bug?"bug":"event",options:[{value:"bug",label:"\uC624\uB958\uB9CC"},{value:"event",label:"\uC77C\uC815\uB9CC"}],onChange:H=>{let Z=H.target.value==="bug";T("is_bug",Z?!0:""),T("is_event",Z?"":!0)}}),()=>O("kind")):null,k.priority!==void 0?Y("\uC911\uC694\uB3C4",Ke(cn,{size:"medium",fullWidth:!0,label:"",value:k.priority,options:Yl,onChange:H=>T("priority",H.target.value)}),()=>O("priority")):null,k.label_key!==void 0?Y("\uB77C\uBCA8",Ke(cn,{size:"medium",fullWidth:!0,label:"",value:k.label_key,options:y,onChange:H=>T("label_key",H.target.value)}),()=>O("label_key")):null,k.title_contains!==void 0?Y("\uC81C\uBAA9",Ke(ta,{size:"medium",fullWidth:!0,placeholder:"\uD3EC\uD568\uD560 \uB0B1\uB9D0 (\uC608: \uAE34\uAE09)",value:k.title_contains,onChange:H=>m(Z=>({...Z,condition:{...Z.condition,title_contains:H.target.value}}))}),()=>O("title_contains")):null,k.manager_empty!==void 0?Y("\uCC45\uC784\uC790",Ke(cn,{size:"medium",fullWidth:!0,label:"",value:k.manager_empty?"empty":"assigned",options:[{value:"empty",label:"\uC5C6\uC74C"},{value:"assigned",label:"\uC788\uC74C"}],onChange:H=>T("manager_empty",H.target.value==="empty")}),()=>O("manager_empty")):null,k.manager_account_seq!==void 0?Y("\uCC45\uC784\uC790",Ke(Pn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{$("manager_account")},children:k.manager_name||`\uACC4\uC815 #${k.manager_account_seq}`}),()=>O("manager_account")):null,k.receiver_account_seq!==void 0?Y("\uCC38\uC870\uC790",Ke(Pn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{$("receiver_account")},children:k.receiver_name||`\uACC4\uC815 #${k.receiver_account_seq}`}),()=>O("receiver_account")):null,k.from_status!==void 0?Y("\uC774 \uC0C1\uD0DC\uC5D0\uC11C",Ke(cn,{size:"medium",fullWidth:!0,label:"",value:k.from_status,options:v,onChange:H=>T("from_status",H.target.value)}),()=>O("from_status")):null,k.to_status!==void 0?Y("\uC774 \uC0C1\uD0DC\uB85C",Ke(cn,{size:"medium",fullWidth:!0,label:"",value:k.to_status,options:v,onChange:H=>T("to_status",H.target.value)}),()=>O("to_status")):null,k.changed_field!==void 0?Y("\uBCC0\uACBD \uD544\uB4DC",Ke(cn,{size:"medium",fullWidth:!0,label:"",value:k.changed_field,options:ra,onChange:H=>T("changed_field",H.target.value)}),()=>O("changed_field")):null,k.comment_contains!==void 0?Y("\uB313\uAE00 \uB0B1\uB9D0",Ke(ta,{size:"medium",fullWidth:!0,placeholder:"\uD3EC\uD568\uD560 \uB0B1\uB9D0 (\uC608: \uD68C\uC2E0)",value:k.comment_contains,onChange:H=>m(Z=>({...Z,condition:{...Z.condition,comment_contains:H.target.value}}))}),()=>O("comment_contains")):null,k.comment_by_others!==void 0?Y("\uB313\uAE00 \uC791\uC131\uC790",Ke(cn,{size:"medium",fullWidth:!0,label:"",value:k.comment_by_others?"others":"any",options:[{value:"others",label:"\uCC45\uC784\uC790\uAC00 \uC544\uB2CC \uC0AC\uB78C"},{value:"any",label:"\uB204\uAD6C\uB4E0"}],onChange:H=>T("comment_by_others",H.target.value==="others")}),()=>O("comment_by_others")):null,k.overdue_days!==void 0?Y("\uACBD\uACFC\uC77C",Ke(ta,{size:"medium",fullWidth:!0,type:"number",value:String(k.overdue_days),onChange:H=>T("overdue_days",Math.max(0,Number(H.target.value)||0)),helperText:"\uB9C8\uAC10 \uD6C4 \uBA70\uCE60 \uC9C0\uB0AC\uC744 \uB54C\uBD80\uD130 \uC2E4\uD589\uD560\uC9C0"}),()=>O("overdue_days")):null,Object.keys(k).length===0?Ke(nr,{sx:{fontSize:13.5,color:"#9a9a97"},children:"\uC870\uAC74\uC774 \uC5C6\uC73C\uBA74 \uBAA8\uB4E0 \uC5C5\uBB34\uC5D0 \uC2E4\uD589\uB429\uB2C8\uB2E4."}):null,vn(nr,{sx:{display:"flex",alignItems:"center",gap:1,mt:.5},children:[Ke(nr,{sx:b0,children:"\uBB34\uC5C7\uC744 \uD560\uAE4C\uC694"}),W.length>0?Ke(Pn,{size:"small",startIcon:Ke(pd,{sx:{fontSize:16}}),onClick:H=>P(H.currentTarget),sx:{color:"#2563eb",minWidth:0},children:"\uB3D9\uC791 \uCD94\uAC00"}):null]}),S.set_status!==void 0?Y("\uC0C1\uD0DC",Ke(cn,{size:"medium",fullWidth:!0,label:"",value:S.set_status,options:v,onChange:H=>C("set_status",H.target.value)}),()=>F("set_status")):null,S.set_priority!==void 0?Y("\uC911\uC694\uB3C4",Ke(cn,{size:"medium",fullWidth:!0,label:"",value:S.set_priority,options:Yl,onChange:H=>C("set_priority",H.target.value)}),()=>F("set_priority")):null,S.apply_content_template_seq!==void 0?Y("\uBCF8\uBB38 \uC591\uC2DD",Ke(cn,{size:"medium",fullWidth:!0,label:"",value:String(S.apply_content_template_seq),options:o.map(H=>({value:String(H.seq),label:H.name})),onChange:H=>{let Z=o.find(J=>String(J.seq)===String(H.target.value));m(J=>({...J,action:{...J.action,apply_content_template_seq:Z?.seq??0,apply_content_template_name:Z?.name??""}}))}}),()=>F("apply_content_template"),"\uBCF8\uBB38\uC774 \uBE44\uC5B4 \uC788\uC744 \uB54C\uB9CC \uCC44\uC6C1\uB2C8\uB2E4(\uC4F4 \uB0B4\uC6A9\uC744 \uB36E\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4)"):null,S.add_label_key!==void 0?Y("\uB77C\uBCA8",Ke(cn,{size:"medium",fullWidth:!0,label:"",value:S.add_label_key,options:y,onChange:H=>C("add_label_key",H.target.value)}),()=>F("add_label_key")):null,S.assign_manager_account_seq!==void 0?Y("\uCC45\uC784\uC790",Ke(Pn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{M("assign_manager")},children:S.assign_manager_name||`\uACC4\uC815 #${S.assign_manager_account_seq}`}),()=>F("assign_manager")):null,S.add_receiver_account_seq!==void 0?Y("\uCC38\uC870\uC790",Ke(Pn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{M("add_receiver")},children:S.add_receiver_name||`\uACC4\uC815 #${S.add_receiver_account_seq}`}),()=>F("add_receiver")):null,S.notify_account_seq!==void 0?Y("\uC54C\uB9BC",vn(y0,{children:[Ke(Pn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{M("notify")},sx:{flexShrink:0},children:S.notify_name||`\uACC4\uC815 #${S.notify_account_seq}`}),Ke(ta,{size:"medium",fullWidth:!0,placeholder:"\uC54C\uB9BC \uBB38\uAD6C(\uBE44\uC6B0\uBA74 \uAE30\uBCF8 \uBB38\uAD6C)",value:S.notify_message??"",onChange:H=>C("notify_message",H.target.value)})]}),()=>F("notify")):null,Object.keys(S).length===0?Ke(nr,{sx:{fontSize:13.5,color:"#9a9a97"},children:'"+ \uB3D9\uC791 \uCD94\uAC00" \uB85C \uD560 \uC77C\uC744 \uD558\uB098 \uC774\uC0C1 \uACE8\uB77C \uC8FC\uC138\uC694.'}):null,Ke(f0,{transitionDuration:0,anchorEl:A,open:!!A,onClose:()=>j(null),children:L.map(H=>Ke(h0,{dense:!0,onClick:()=>U(H.key),sx:{fontSize:14},children:H.label},H.key))}),Ke(f0,{transitionDuration:0,anchorEl:D,open:!!D,onClose:()=>P(null),children:W.map(H=>Ke(h0,{dense:!0,onClick:()=>I(H.key),sx:{fontSize:14},children:H.label},H.key))})]});return vn(y0,{children:[Ke(m0,{open:e,onClose:r,maxWidth:"sm",title:"\uC790\uB3D9\uD654 \uADDC\uCE59",locale:"ko",titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-rule-manage",tabs:{visible:!1},contentPaddingX:0,contentTopPadding:0,contentBottomPadding:0,sectionContentPaddingTop:0,sections:[{id:"rules",title:"",showTitle:!1,children:vn(nr,{sx:{display:"flex",flexDirection:"column",px:2.5,py:2},children:[h.length===0?vn(nr,{sx:{py:4,display:"flex",flexDirection:"column",alignItems:"center",gap:2,color:"#9a9a97"},children:[Ke(lS,{sx:{fontSize:48,color:"#d9d9d6"}}),Ke(nr,{sx:{fontSize:15},children:"\uB4F1\uB85D\uB41C \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."})]}):null,h.map(H=>vn(nr,{sx:{display:"flex",alignItems:"center",gap:2,py:1,"&:not(:last-of-type)":{borderBottom:"1px solid #ececea"},opacity:H.enabled?1:.5},children:[Ke(p0,{title:H.enabled?"\uC0AC\uC6A9 \uC911":"\uAEBC\uC9D0",arrow:!0,disableInteractive:!0,children:Ke(sS,{size:"small",inputProps:{"aria-label":`${H.name} \uADDC\uCE59 \uC0AC\uC6A9`},checked:H.enabled,onChange:(Z,J)=>c(H.seq,J)})}),vn(nr,{sx:{flex:1,minWidth:0},children:[Ke(nr,{sx:{fontSize:16,fontWeight:600,color:"#37352f"},children:H.name}),(()=>{let Z=dS(H,b,l);return vn(nr,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5,fontSize:15,color:"#6f6f6c"},children:[Ke(nr,{component:"span",children:Z.left}),Ke(aS,{sx:{fontSize:18,color:"#9a9a97",flexShrink:0}}),Ke(nr,{component:"span",children:Z.right})]})})()]}),Ke(hd,{size:"small","aria-label":`${H.name} \uADDC\uCE59 \uC218\uC815`,onClick:()=>{u(H.seq),m({name:H.name,trigger:H.trigger,enabled:H.enabled,sort_no:H.sort_no,condition:{...H.condition,...H.trigger==="field_changed"&&H.condition.changed_field===void 0?{changed_field:ra[0]?.value??""}:{}},action:{...H.action}}),d(!0)},children:Ke(uS,{sx:{fontSize:18}})}),Ke(hd,{size:"small","aria-label":`${H.name} \uADDC\uCE59 \uC0AD\uC81C`,onClick:()=>i(H.seq),children:Ke(cr,{sx:{fontSize:18}})})]},H.seq))]})}],actions:{showCancelButton:!1,left:Ke(Pn,{startIcon:Ke(pd,{}),onClick:()=>{u(0),m(Kl()),d(!0)},sx:{color:"#2563eb"},children:"\uC0C8 \uADDC\uCE59"}),right:Ke(Pn,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})}}),Ke(m0,{open:a,onClose:z,maxWidth:"sm",title:N?"\uADDC\uCE59 \uC218\uC815":"\uC0C8 \uADDC\uCE59",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-rule-form",tabs:{visible:!1},sectionContentPaddingTop:0,sections:[{id:"rule-form",title:"",showTitle:!1,children:K()}],actions:{showCancelButton:!0,right:Ke(Pn,{variant:"contained",onClick:()=>{V()},disabled:x,children:N?"\uC218\uC815":"\uADDC\uCE59 \uCD94\uAC00"})}})]})}import{useEffect as x0,useRef as gd,useState as os}from"react";import{Box as Qt,Button as is,IconButton as na,Tooltip as oa}from"@mui/material";import v0 from"@mui/icons-material/Add";import pS from"@mui/icons-material/EditOutlined";import mS from"@mui/icons-material/ContentCopyOutlined";import gS from"@mui/icons-material/DragIndicator";import bS from"@mui/icons-material/Close";import yS from"@mui/icons-material/PlaylistAddCheckOutlined";import{DndContext as xS,PointerSensor as vS,closestCenter as wS,useSensor as _S,useSensors as kS}from"@dnd-kit/core";import{restrictToParentElement as SS,restrictToVerticalAxis as TS}from"@dnd-kit/modifiers";import{SortableContext as CS,arrayMove as w0,useSortable as BS,verticalListSortingStrategy as IS}from"@dnd-kit/sortable";import{CSS as ES}from"@dnd-kit/utilities";import{FormDialog as _0}from"@ehfuse/mui-form-dialog";import{ClearTextField as bd,LabelSelect as k0,NumberField as S0}from"@ehfuse/mui-form-controls";import MS from"@ehfuse/overlay-scrollbar";import{ConfirmDialog as RS,ErrorAlert as T0}from"@ehfuse/alerts";import{Fragment as NS,jsx as ot,jsxs as wn}from"react/jsx-runtime";var OS=[{value:"high",label:"\uB192\uC74C"},{value:"medium",label:"\uC911\uAC04"},{value:"low",label:"\uB0AE\uC74C"}],C0="\uC5C5\uBB34 \uC81C\uBAA9",yd=2,Xl={flex:1,minWidth:0},B0=56,I0=20,AS=`${I0+yd*8}px`;function Zl(){return{name:"",description:"",group_seq:0,items:[]}}function DS(){return{title:"",start_offset_days:0,due_offset_days:0,priority:"medium"}}function PS({id:e,children:h}){let{attributes:b,listeners:l,setNodeRef:o,transform:s,transition:r,isDragging:t}=BS({id:e});return ot(Qt,{ref:o,sx:{transform:ES.Transform.toString(s),transition:r,...t?{opacity:.6,position:"relative",zIndex:1}:{}},children:h({handleProps:{...b,...l},dragging:t})})}function BV({open:e,templates:h,customTabs:b,onPickAccount:l,onClose:o,onCreate:s,onUpdate:r,onRemove:t,onRun:n}){let[c,i]=os(!1),[a,d]=os(0),[f,u]=os(Zl()),[g,m]=os(!1),[x,_]=os([]),B=gd(0),[A,j]=os(0),D=gd(null),P=gd(null);x0(()=>{if(e)return;let L=window.setTimeout(()=>{i(!1),d(0),u(Zl()),_([])},500);return()=>window.clearTimeout(L)},[e]);let N=()=>(B.current+=1,`template-item-${B.current}`),q=(L,$)=>{d(L),u($),_($.items.map(()=>N())),i(!0)},z=f.items.map((L,$)=>x[$]??`template-item-fallback-${$}`),T=()=>{let L=P.current?.getScrollContainer()??null;if(L){L.scrollTop=L.scrollHeight;return}let $=D.current?.querySelectorAll("*")??[];for(let U of Array.from($))if(U.scrollHeight>U.clientHeight+1){U.scrollTop=U.scrollHeight;return}},C=()=>{let L=D.current;if(!L)return null;let $=L.querySelectorAll("input[data-template-title]"),U=$.length?$:L.querySelectorAll(`input[placeholder="${C0}"]`);return U.length?U[U.length-1]:null};x0(()=>{if(A===0)return;let L=0,$=0,U=()=>{T();let W=C();W&&document.activeElement!==W&&W.focus(),L+=1,!(W&&document.activeElement===W)&&L<8&&($=window.setTimeout(U,50))},O=window.requestAnimationFrame(U);return()=>{window.cancelAnimationFrame(O),window.clearTimeout($)}},[A]);let R=b.filter(L=>!L.archived).map(L=>({value:String(Go(L.key)),label:L.label})),p=(L,$)=>{u(U=>({...U,items:U.items.map((O,W)=>W===L?{...O,...$}:O)}))},y=kS(_S(vS,{activationConstraint:{distance:5}})),v=L=>{let $=String(L.active?.id??""),U=String(L.over?.id??"");if(!$||!U||$===U)return;let O=z.indexOf($),W=z.indexOf(U);O<0||W<0||(u(M=>({...M,items:w0(M.items,O,W)})),_(M=>w0(M,O,W)))},w=async L=>{if(!l)return;let $=await l(f.items[L]?.manager_account_seq??0,"\uCC45\uC784\uC790");$&&p(L,{manager_account_seq:$.accountSeq,manager_name:$.name})},k=async()=>{let L=f.name.trim();if(!L){T0({message:"\uD15C\uD50C\uB9BF \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694."});return}let $=f.items.filter(W=>W.title.trim().length>0);if($.length===0){T0({message:"\uC5C5\uBB34 \uD56D\uBAA9\uC744 \uD55C \uC904 \uC774\uC0C1 \uB123\uC73C\uC138\uC694."});return}m(!0);let U={...f,name:L,items:$},O=a>0?await r(a,U):await s(U);m(!1),O&&(i(!1),d(0),u(Zl()))},S=ot(Qt,{children:h.length===0?wn(Qt,{sx:{py:4,display:"flex",flexDirection:"column",alignItems:"center",gap:2,color:"#9a9a97"},children:[ot(yS,{sx:{fontSize:48,color:"#d9d9d6"}}),ot(Qt,{sx:{fontSize:13.5},children:"\uB4F1\uB85D\uB41C \uD15C\uD50C\uB9BF\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."})]}):h.map(L=>wn(Qt,{sx:{display:"flex",alignItems:"center",gap:2.5,py:1.75,"&:not(:last-of-type)::after":{content:'""',display:"block",my:1.75,borderBottom:"1px solid #f0efed"}},children:[wn(Qt,{sx:{flex:1,minWidth:0},children:[ot(Qt,{sx:{fontSize:18,fontWeight:600,color:"#37352f"},children:L.name}),wn(Qt,{sx:{fontSize:14,color:"#787774",mt:.25},children:["\uC5C5\uBB34 ",L.items.length,"\uAC74",L.description?` \xB7 ${L.description}`:""]})]}),n?ot(is,{size:"medium",variant:"outlined",onClick:()=>n(L),sx:{flexShrink:0},children:"\uC2E4\uD589"}):null,ot(oa,{title:"\uC218\uC815",arrow:!0,disableInteractive:!0,children:ot(na,{size:"medium","aria-label":`${L.name} \uD15C\uD50C\uB9BF \uC218\uC815`,onClick:()=>q(L.seq,{name:L.name,description:L.description??"",group_seq:L.group_seq??0,items:L.items.map($=>({...$}))}),children:ot(pS,{sx:{fontSize:19}})})}),ot(oa,{title:"\uBCF5\uC81C",arrow:!0,disableInteractive:!0,children:ot(na,{size:"medium","aria-label":`${L.name} \uD15C\uD50C\uB9BF \uBCF5\uC81C`,onClick:()=>q(0,{name:`${L.name} \uC0AC\uBCF8`,description:L.description??"",group_seq:L.group_seq??0,items:L.items.map($=>({...$}))}),children:ot(mS,{sx:{fontSize:18}})})}),ot(oa,{title:"\uC0AD\uC81C",arrow:!0,disableInteractive:!0,children:ot(na,{size:"medium","aria-label":`${L.name} \uD15C\uD50C\uB9BF \uC0AD\uC81C`,onClick:()=>{(async()=>await RS({title:"\uD15C\uD50C\uB9BF \uC0AD\uC81C",message:`"${L.name}" \uD15C\uD50C\uB9BF\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&t(L.seq))()},children:ot(cr,{sx:{fontSize:18}})})})]},L.seq))}),E=wn(Qt,{sx:{display:"flex",flexDirection:"column",gap:3},children:[ot(bd,{size:"medium",label:"\uD15C\uD50C\uB9BF \uC774\uB984",placeholder:"\uC608: \uC2E0\uADDC \uC785\uC0AC\uC790 \uC628\uBCF4\uB529",fullWidth:!0,value:f.name,onChange:L=>u($=>({...$,name:L.target.value}))}),wn(Qt,{sx:{display:"grid",gridTemplateColumns:R.length>0?"1fr 1fr":"1fr",gap:2},children:[ot(bd,{size:"medium",label:"\uC124\uBA85",placeholder:"\uBAA9\uB85D\uC5D0\uC11C \uBB34\uC5C7\uC778\uC9C0 \uC54C\uC544\uBCFC \uD55C \uC904(\uC120\uD0DD)",fullWidth:!0,value:f.description??"",onChange:L=>u($=>({...$,description:L.target.value}))}),R.length>0?ot(k0,{size:"medium",fullWidth:!0,label:"\uB9CC\uB4E4 \uACF3(\uD504\uB85C\uC81D\uD2B8)",value:String(f.group_seq??0),options:[{value:"0",label:"\uAE30\uBCF8 \uC5C5\uBB34\uD568"},...R],onChange:L=>u($=>({...$,group_seq:Number(L.target.value)||0}))}):null]}),wn(Qt,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[ot(Qt,{sx:{fontSize:18,fontWeight:600,color:"#37352f"},children:"\uC5C5\uBB34 \uD56D\uBAA9"}),ot(Qt,{sx:{fontSize:14,color:"#37352f"},children:"\uB0A0\uC9DC\uB294 \uC2E4\uD589\uD560 \uB54C \uACE0\uB974\uB294 \uAE30\uC900\uC77C\uC5D0\uC11C \uACC4\uC0B0\uB429\uB2C8\uB2E4."})]}),f.items.length===0?ot(Qt,{sx:{fontSize:14,color:"#9a9a97",py:2},children:'\uC544\uC9C1 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. "\uD56D\uBAA9 \uCD94\uAC00" \uB85C \uC808\uCC28\uB97C \uC21C\uC11C\uB300\uB85C \uC801\uC73C\uC138\uC694.'}):ot(Qt,{ref:D,sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:ot(MS,{ref:P,style:{maxHeight:"min(560px, 52vh)"},thumb:{width:6},children:ot(xS,{sensors:y,collisionDetection:wS,modifiers:[TS,SS],onDragEnd:v,children:ot(CS,{items:z,strategy:IS,children:f.items.map((L,$)=>ot(PS,{id:z[$],children:({handleProps:U})=>wn(Qt,{sx:{borderBottom:$===f.items.length-1?"none":"1px solid #f2f2f0",px:yd,py:2,gap:2,display:"flex",flexDirection:"column"},children:[wn(Qt,{sx:{display:"flex",alignItems:"center",gap:yd},children:[ot(Qt,{...U,"aria-label":`${$+1}\uBC88 \uD56D\uBAA9 \uC21C\uC11C \uC774\uB3D9`,sx:{display:"inline-flex",alignItems:"center",flexShrink:0,color:"#c9c8c5",cursor:"grab","&:active":{cursor:"grabbing"},touchAction:"none",userSelect:"none"},children:ot(gS,{sx:{fontSize:I0}})}),ot(bd,{size:"medium",fullWidth:!0,placeholder:C0,slotProps:{htmlInput:{"data-template-title":$}},value:L.title,onChange:O=>p($,{title:O.target.value})})]}),wn(Qt,{sx:{display:"flex",alignItems:"center",gap:2,pl:AS},children:[ot(Qt,{sx:Xl,children:ot(S0,{size:"medium",fullWidth:!0,label:"\uC2DC\uC791 D+",thousandSeparator:!1,align:"right",suffix:"\uC77C",value:L.start_offset_days??null,onValueChange:O=>p($,{start_offset_days:O===null?void 0:Math.trunc(Number(O))})})}),ot(Qt,{sx:Xl,children:ot(S0,{size:"medium",fullWidth:!0,label:"\uB9C8\uAC10 D+",thousandSeparator:!1,align:"right",suffix:"\uC77C",value:L.due_offset_days??null,onValueChange:O=>p($,{due_offset_days:O===null?void 0:Math.trunc(Number(O))})})}),ot(Qt,{sx:Xl,children:ot(k0,{size:"medium",fullWidth:!0,label:"\uC911\uC694\uB3C4",value:L.priority??"medium",options:OS,onChange:O=>p($,{priority:O.target.value})})}),l?wn(Qt,{sx:{...Xl,position:"relative"},children:[ot(is,{variant:"outlined",fullWidth:!0,onClick:()=>{w($)},sx:{height:B0,display:"block",textAlign:"left",textTransform:"none",fontSize:16,fontWeight:400,lineHeight:`${B0-2}px`,py:0,px:1.75,pr:L.manager_account_seq?4.5:1.75,borderColor:"#c4c4c4",color:L.manager_name?"#37352f":"#9a9a97",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","&:hover":{borderColor:"#37352f",bgcolor:"transparent"}},children:L.manager_name||"\uCC45\uC784\uC790"}),L.manager_account_seq?ot(oa,{title:"\uCC45\uC784\uC790 \uBE44\uC6B0\uAE30",arrow:!0,disableInteractive:!0,children:ot(na,{size:"small","aria-label":`${$+1}\uBC88 \uD56D\uBAA9 \uCC45\uC784\uC790 \uBE44\uC6B0\uAE30`,onClick:O=>{O.stopPropagation(),p($,{manager_account_seq:0,manager_name:""})},sx:{position:"absolute",right:6,top:"50%",transform:"translateY(-50%)"},children:ot(bS,{sx:{fontSize:18}})})}):null]}):null,ot(oa,{title:"\uD56D\uBAA9 \uC0AD\uC81C",arrow:!0,disableInteractive:!0,children:ot(na,{size:"medium","aria-label":`${$+1}\uBC88 \uD56D\uBAA9 \uC0AD\uC81C`,onClick:()=>{u(O=>({...O,items:O.items.filter((W,M)=>M!==$)})),_(O=>O.filter((W,M)=>M!==$))},children:ot(cr,{sx:{fontSize:18}})})})]})]})},z[$]))})})})})]});return wn(NS,{children:[ot(_0,{open:e,onClose:o,maxWidth:"md",title:"\uC5C5\uBB34 \uD15C\uD50C\uB9BF",locale:"ko",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-task-template",tabs:{visible:!1},actions:{showCancelButton:!1,left:ot(is,{startIcon:ot(v0,{sx:{fontSize:18}}),onClick:()=>q(0,Zl()),children:"\uC0C8 \uD15C\uD50C\uB9BF"}),right:ot(is,{variant:"contained",onClick:o,children:"\uB2EB\uAE30"})},sectionContentPaddingTop:0,sections:[{id:"templates",title:"",showTitle:!1,children:S}]}),ot(_0,{open:c,onClose:()=>i(!1),maxWidth:"md",title:a>0?"\uD15C\uD50C\uB9BF \uC218\uC815":"\uC0C8 \uD15C\uD50C\uB9BF",locale:"ko",backdropClick:!1,fontScale:{enabled:!0},fontScaleKey:"taskbox-task-template-form",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},tabs:{visible:!1},actions:{showCancelButton:!0,left:ot(is,{startIcon:ot(v0,{sx:{fontSize:18}}),onClick:()=>{u(L=>({...L,items:[...L.items,DS()]})),_(L=>[...L,N()]),j(L=>L+1)},children:"\uD56D\uBAA9 \uCD94\uAC00"}),right:ot(is,{variant:"contained",disabled:g,onClick:()=>{k()},children:"\uC800\uC7A5"})},sectionContentPaddingTop:0,sections:[{id:"template-form",title:"",showTitle:!1,children:E}]})]})}import{useEffect as E0,useState as M0}from"react";import{Box as Pr,Button as LS}from"@mui/material";import{FormDialog as jS}from"@ehfuse/mui-form-dialog";import{DateTextField as zS}from"@ehfuse/mui-form-controls";import FS from"@ehfuse/overlay-scrollbar";import{jsx as Yr,jsxs as ia}from"react/jsx-runtime";function LV({open:e,template:h,todayStr:b,running:l=!1,onClose:o,onRun:s}){let[r,t]=M0(b),[n,c]=M0(h);E0(()=>{h&&c(h)},[h]),E0(()=>{e&&t(b)},[e]);let i=h??n,a=i?Mh(i,r):[];return Yr(jS,{open:e,onClose:o,maxWidth:"md",title:i?`${i.name} \uC2E4\uD589`:"\uD15C\uD50C\uB9BF \uC2E4\uD589",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-template-run",tabs:{visible:!1},sectionContentPaddingTop:0,actions:{showCancelButton:!0,right:Yr(LS,{variant:"contained",disabled:l||a.length===0,onClick:()=>s(a,r),children:l?"\uB9CC\uB4DC\uB294 \uC911\u2026":`\uC5C5\uBB34 ${a.length}\uAC74 \uB9CC\uB4E4\uAE30`})},sections:[{id:"template-run",title:"",showTitle:!1,children:ia(Pr,{sx:{display:"flex",flexDirection:"column",gap:2},children:[ia(Pr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Yr(Pr,{sx:{width:72,flexShrink:0,fontSize:16,color:"#37352f"},children:"\uAE30\uC900\uC77C"}),Yr(zS,{size:"medium",fullWidth:!0,value:r,onChange:d=>t(d.target.value)})]}),Yr(Pr,{sx:{fontSize:14.5,color:"#37352f"},children:"\uC544\uB798 \uC5C5\uBB34\uAC00 \uD55C\uAEBC\uBC88\uC5D0 \uB9CC\uB4E4\uC5B4\uC9D1\uB2C8\uB2E4. \uB0A0\uC9DC\uB294 \uAE30\uC900\uC77C\uC5D0\uC11C \uACC4\uC0B0\uB41C \uAC12\uC785\uB2C8\uB2E4."}),ia(Pr,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:[ia(Pr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,bgcolor:"#fafaf9",borderBottom:"1px solid #e6e6e3",fontSize:13.5,fontWeight:600,color:"#37352f"},children:[Yr(Pr,{sx:{flex:1,minWidth:0},children:"\uC5C5\uBB34"}),Yr(Pr,{sx:{width:88,flexShrink:0,textAlign:"center"},children:"\uC2DC\uC791"}),Yr(Pr,{sx:{width:88,flexShrink:0,textAlign:"center"},children:"\uB9C8\uAC10"}),Yr(Pr,{sx:{width:96,flexShrink:0,textAlign:"center"},children:"\uCC45\uC784\uC790"})]}),Yr(FS,{style:{maxHeight:520},thumb:{width:6},children:a.length===0?Yr(Pr,{sx:{p:2,fontSize:14,color:"#9a9a97"},children:"\uB9CC\uB4E4 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):a.map((d,f)=>ia(Pr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1.25,borderBottom:f===a.length-1?"none":"1px solid #f2f2f0",fontSize:16,fontWeight:500,color:"#111111"},children:[Yr(Pr,{sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.title}),Yr(Pr,{sx:{width:88,flexShrink:0,textAlign:"center",fontSize:13.5,color:d.start_date?"#37352f":"#9a9a97"},children:Bc(d.start_date)||"-"}),Yr(Pr,{sx:{width:88,flexShrink:0,textAlign:"center",fontSize:13.5,color:d.due_date?"#37352f":"#9a9a97"},children:Bc(d.due_date)||"-"}),Yr(Pr,{sx:{width:96,flexShrink:0,textAlign:"center",fontSize:13.5,color:d.manager_name?"#37352f":"#9a9a97",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.manager_name||"-"})]},f))})]})]})}]})}var qS={urgent:"\uAE34\uAE09",high:"\uB192\uC74C",normal:"\uC911\uAC04",low:"\uB0AE\uC74C"};function $S(e){return e.length===0?"":e.length<=2?e.join(", "):`${e[0]} \uC678 ${e.length-1}\uBA85`}function xd(e){let h=String(e??"").trim().slice(0,10);return/^\d{4}-\d{2}-\d{2}$/.test(h)?`${h.slice(2,4)}.${h.slice(5,7)}.${h.slice(8,10)}`:"-"}function ss(e){let h=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${h(e.getMonth()+1)}-${h(e.getDate())} ${h(e.getHours())}:${h(e.getMinutes())}`}function vd(e,h){let l=String(e.due_date??"").slice(11,16).trim()||String(e.estimated_time??"").trim(),o=xd(e.due_date),s=String(e.start_date??"").slice(11,16).trim(),r=xd(e.start_date),t=(e.receiver_names??[]).filter(Boolean).map(c=>String(c).trim()),n=(e.checklist??[]).length?`${(e.checklist??[]).filter(c=>c.checked).length}/${(e.checklist??[]).length}`:"";return{seq:Number(e.seq??0),title:String(e.title??"").trim(),statusName:lr(e).name,projectLabel:e.tab_key?h.get(String(e.tab_key))??"":"",managerName:String(e.manager_name??"").trim(),receiverNames:$S(t),receiverNamesFull:t.join(", "),startDate:r!=="-"&&s?`${r} ${s}`:r,dueDate:o!=="-"&&l?`${o} ${l}`:o,priorityName:qS[String(e.priority??"")]??"",checklist:n,note:String(e.note??"").trim(),completed:!!e.completed}}function Dt(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function HS(e,h){if(e===" ")return h*.3;let b=e.codePointAt(0)??0,l=b>=4352&&b<=4607||b>=12288&&b<=40959||b>=44032&&b<=55203||b>=63744&&b<=64255||b>=65280&&b<=65519;return h*(l?1:.55)}function Jl(e,h){let b=0;for(let l of String(e??""))b+=HS(l,h);return b}function as(e,h){let b=String(e??"").trim();if(!b)return["-"];let l=[],o="";for(let s of b){if(s===`
|
|
41
|
+
`)}function kp(e){navigator.clipboard.writeText(e).then(()=>V5("\uC5C5\uBB34 \uB0B4\uC6A9\uC744 \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>U5("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uB0B4\uC6A9\uC744 \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD574 \uC8FC\uC138\uC694."))}function Ki(e,h){let b=K5(e);if(h&&typeof navigator.share=="function"){navigator.share({text:b}).catch(l=>{l?.name!=="AbortError"&&kp(b)});return}kp(b)}import{Fragment as t4,jsx as Bt,jsxs as Sp}from"react/jsx-runtime";function Tp({task:e,myAccountSeq:h=0,onToggleCompleted:b,onChangeTitle:l,onChangeIcon:o,onChangeIconColor:s,onClose:r,appBarMode:t=!1,activityItems:n,activityLoading:c,onLoadActivity:i,onPrint:a,onDelete:d,canDelete:f}){let u=Nt(),[g,m]=Fs(!1),[x,_]=Fs(null),[B,A]=Fs(null),[j,D]=Fs(null),[P,N]=Fs(null),q=!!e.is_notice,z=!!e.is_event,T=q?_t(e.icon||or):z?_t(e.icon||ar):null,C=q&&h>0&&(e.author_account_seq??0)===h,R=!lo(e,h),p=!!d&&(f??(h>0&&(e.author_account_seq??0)===h)),y=!z&&(q?C:(e.author_account_seq??0)===h||(e.manager_account_seq??0)===h);return Sp(t4,{children:[Sp(Gi,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[t&&r?Bt(Yi,{"aria-label":"\uB4A4\uB85C",onClick:r,sx:{color:"#37352f",ml:-1},children:Bt(X5,{})}):null,y&&!t?Bt(Xi,{title:e.completed&&e.completed_by?`${e.completed_by} \xB7 ${on(e.completed_time)} \uC644\uB8CC`:"",arrow:!0,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:Bt(Gi,{sx:{display:"flex",flexShrink:0,mr:1},children:Bt(Ln,{onClick:v=>N({anchorEl:v.currentTarget,nextCompleted:!e.completed}),children:e.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC\uD558\uAE30"})})}):null,t||!T?null:z&&!R?Bt(Xi,{title:"\uC544\uC774\uCF58 \uBCC0\uACBD",arrow:!0,enterDelay:400,disableInteractive:!0,children:Bt(G5,{onClick:v=>A(v.currentTarget),sx:{display:"flex",p:.5,borderRadius:1,color:e.icon_color||"#1e3a8a","&:hover":{bgcolor:"#f2f2f0"}},children:Bt(T,{sx:{fontSize:20}})})}):Bt(Gi,{sx:{display:"flex",px:.5,color:e.icon_color||(q?"#e5484d":"#1e3a8a")},children:Bt(T,{sx:{fontSize:20}})}),x!==null?Bt(Gi,{component:"input",autoFocus:!0,spellCheck:!1,value:x,onChange:v=>_(v.target.value),onBlur:()=>{x.trim()&&x.trim()!==e.title&&l(e.seq,x.trim()),_(null)},onKeyDown:v=>{v.key==="Enter"&&v.target.blur(),v.key==="Escape"&&_(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:18,fontWeight:500,color:"#37352f",p:0,m:0}}):t?Bt(Gi,{sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:q?"\uACF5\uC9C0":z?"\uC77C\uC815":e.is_bug?"\uC624\uB958":"\uC5C5\uBB34"}):Bt(Gi,{onClick:R?void 0:()=>_(e.title),sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:R?"default":"text",textDecoration:e.completed?"line-through":"none"},children:e.title}),i?Bt(Xi,{title:"\uD65C\uB3D9",arrow:!0,children:Bt(Yi,{"aria-label":"\uD65C\uB3D9",onClick:()=>m(!0),sx:{color:"#6b7280"},children:Bt(Q5,{sx:{fontSize:20}})})}):null,Bt(Xi,{title:u?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:Bt(Yi,{"aria-label":u?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>Ki(e,u),sx:{color:"#6b7280"},children:u?Bt(Z5,{sx:{fontSize:20}}):Bt(J5,{sx:{fontSize:20}})})}),a?Bt(Xi,{title:"\uC778\uC1C4",arrow:!0,children:Bt(Yi,{"aria-label":"\uC778\uC1C4",onClick:()=>a(e),sx:{color:"#6b7280"},children:Bt(e4,{sx:{fontSize:20}})})}):null,p?Bt(Xi,{title:"\uC0AD\uC81C",arrow:!0,children:Bt(Yi,{"aria-label":"\uC0AD\uC81C",onClick:v=>D(v.currentTarget),sx:{color:"#6b7280","&:hover":{color:"#e5484d"}},children:Bt(cr,{sx:{fontSize:20}})})}):null,r&&!t?Bt(Yi,{"aria-label":"\uB2EB\uAE30",onClick:r,sx:{color:"#6b7280"},children:Bt(Y5,{})}):null]}),Bt(At,{open:!!P,anchorEl:P?.anchorEl??null,title:P?.nextCompleted?"\uC774 \uC5C5\uBB34\uB97C \uC644\uB8CC \uCC98\uB9AC\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC644\uB8CC\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:P?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>N(null),onConfirm:()=>{P&&b(e.seq,P.nextCompleted),N(null)}}),Bt(zo,{anchorEl:B,value:e.icon??"",color:e.icon_color??"",onSelect:v=>{o(e.seq,v),A(null)},onSelectColor:s?v=>s(e.seq,v):void 0,onClose:()=>A(null)}),Bt(At,{open:!!j,anchorEl:j,title:"\uC774 \uC5C5\uBB34\uB97C \uD734\uC9C0\uD1B5\uC73C\uB85C \uBCF4\uB0B4\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uC0AD\uC81C",onCancel:()=>D(null),onConfirm:()=>{D(null),d?.(e)}}),Bt(Ml,{open:g,taskSeq:e.seq,items:n,loading:c,onLoad:i,onClose:()=>m(!1)})]})}import{useState as yn}from"react";import{Box as Zt,Button as Zi,ButtonBase as Rp,Checkbox as d4,Divider as yi,Menu as Nu,MenuItem as Lu}from"@mui/material";import f4 from"@mui/icons-material/ExpandLess";import h4 from"@mui/icons-material/ExpandMore";import p4 from"@mui/icons-material/ConfirmationNumberOutlined";import Op from"@mui/icons-material/Check";import m4 from"@mui/icons-material/DirectionsRunOutlined";import g4 from"@mui/icons-material/SpeedOutlined";import ju from"@mui/icons-material/CheckCircle";import b4 from"@mui/icons-material/CheckCircleOutlineOutlined";import zu from"@mui/icons-material/CheckCircleOutlined";import Ap from"@mui/icons-material/AccessTimeOutlined";import y4 from"@mui/icons-material/AutorenewOutlined";import x4 from"@mui/icons-material/LabelOutlined";import v4 from"@mui/icons-material/PersonOutlineOutlined";import w4 from"@mui/icons-material/SubjectOutlined";import _4 from"@mui/icons-material/StickyNote2Outlined";import k4 from"@mui/icons-material/PanToolAltOutlined";import Dp from"@mui/icons-material/LockOutlined";import Pp from"@mui/icons-material/PublicOutlined";import Np from"@mui/icons-material/Group";import S4 from"@mui/icons-material/Repeat";import T4 from"@mui/icons-material/EventOutlined";import{ConfirmDialog as Lp,InfoAlert as C4}from"@ehfuse/alerts";import{DatePicker as B4}from"@ehfuse/mui-datetime-picker";import{useState as r4}from"react";import{TextField as n4}from"@ehfuse/mui-form-controls";import{jsx as o4}from"react/jsx-runtime";function Cp({value:e,onCommit:h,onDraftChange:b,readOnly:l=!1}){let[o,s]=r4(null);return o4(n4,{value:o??e,placeholder:l?"":"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",slotProps:{input:{readOnly:l}},onChange:r=>{s(r.target.value),b?.(r.target.value)},onBlur:()=>{o!==null&&o.trim()!==e&&h(o),s(null)},onKeyDown:r=>{r.key==="Enter"&&r.target.blur(),r.key==="Escape"&&s(null)},sx:{mt:1}})}import{useMemo as Du,useState as Pu}from"react";import{Box as Or,Button as Ep,IconButton as i4}from"@mui/material";import s4 from"@mui/icons-material/AccountTreeOutlined";import a4 from"@mui/icons-material/LinkOutlined";import l4 from"@mui/icons-material/Close";import c4 from"@mui/icons-material/RedoOutlined";function bi(e){return e.relations??[]}function dz(e,h,b){return bi(e).some(l=>l.type===b&&l.task_seq===h.seq)||bi(h).some(l=>l.type===b&&l.task_seq===e.seq)}function Bp(e){return`${e.created_time??""}|${String(e.seq).padStart(12,"0")}`}function Ou(e,h){let b=new Map(h.map(u=>[u.seq,u]));b.set(e.seq,e);let l=new Map,o=(u,g)=>{l.has(u)||l.set(u,new Set),l.has(g)||l.set(g,new Set),l.get(u).add(g),l.get(g).add(u)};for(let u of b.values())for(let g of bi(u))g.type==="follow_up"&&b.has(g.task_seq)&&o(u.seq,g.task_seq);let s=new Set([e.seq]),r=[e.seq];for(;r.length>0;){let u=r.shift();for(let g of l.get(u)??[])s.has(g)||(s.add(g),r.push(g))}let t=[...s].map(u=>b.get(u)).filter(u=>!!u).sort((u,g)=>Bp(u).localeCompare(Bp(g))),n=new Set;for(let u of bi(e))u.type==="related"&&n.add(u.task_seq);for(let u of b.values())u.seq!==e.seq&&bi(u).some(g=>g.type==="related"&&g.task_seq===e.seq)&&n.add(u.seq);let c=[...n].map(u=>b.get(u)).filter(u=>u!==void 0&&u.seq!==e.seq),i=[...b.values()].filter(u=>u.seq!==e.seq&&bi(u).some(g=>g.type==="duplicate_of"&&g.task_seq===e.seq)),a=bi(e).find(u=>u.type==="duplicate_of")?.task_seq,d=a?b.get(a)??null:null,f=[...b.values()].filter(u=>u.seq!==e.seq&&(u.checklist??[]).some(g=>Number(g.task_seq??0)===e.seq));return{lineage:t,related:c,duplicates:i,duplicateOf:d,parents:f}}function Au(e,h){let b=Ou(e,h);return(b.lineage.length>=2?b.lineage.length-1:0)+b.related.length+b.duplicates.length+(b.duplicateOf?1:0)+b.parents.length}function Ip(e,h){return Au(e,h)>0}import{Fragment as u4,jsx as Wt,jsxs as Rn}from"react/jsx-runtime";function Rl({item:e,caption:h,onOpen:b,onUnlink:l}){let o=e.is_notice||e.is_event?_t(e.icon||(e.is_notice?or:ar)):null;return Rn(Or,{sx:{display:"flex",alignItems:"center",gap:.75,px:1.25,py:.5,borderRadius:1,"&:hover":{bgcolor:"#f7f7f5"},"&:hover .taskbox-relation-unlink":{opacity:1}},children:[h?Wt(Or,{component:"span",sx:{flexShrink:0,px:.6,py:.1,borderRadius:.75,fontSize:11.5,fontWeight:500,color:"#8a6d1d",bgcolor:"#faf1d7"},children:h}):null,o?Wt(o,{sx:{fontSize:16,flexShrink:0,color:e.icon_color||"#1e3a8a"}}):null,Rn(Or,{component:"span",onClick:b,sx:{flex:1,minWidth:0,fontSize:14,color:e.completed?"#9a9a97":"#37352f",textDecoration:e.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...b?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[e.ticket_no?`${e.ticket_no} `:"",e.title]}),Wt(Ot,{option:lr(e),small:!0}),l?Wt(i4,{className:"taskbox-relation-unlink",size:"small","aria-label":"\uC5F0\uACB0 \uD574\uC81C",onClick:l,sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:Wt(l4,{sx:{fontSize:15}})}):null]})}function Mp({task:e,tasks:h,readOnly:b=!1,onOpenTask:l,onLink:o,onUnlink:s,onCreateFollowUp:r}){let[t,n]=Pu(!1),[c,i]=Pu(null),[a,d]=Pu(null),f=Du(()=>Ou(e,h),[e,h]),u=f.lineage.length>=2,g=Du(()=>Au(e,h),[e,h]),m=Du(()=>{let _=new Set;for(let B of f.lineage)_.add(B.seq);for(let B of f.related)_.add(B.seq);for(let B of f.duplicates)_.add(B.seq);for(let B of f.parents)_.add(B.seq);return f.duplicateOf&&_.add(f.duplicateOf.seq),[..._]},[f]),x=(_,B,A)=>{d({anchorEl:_,targetSeq:B,type:A})};return Rn(bn,{icon:Wt(s4,{sx:{fontSize:19,display:"block"}}),title:Rn(u4,{children:["\uAD00\uB828 \uC5C5\uBB34",g>0?Wt(Or,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:g}):null]}),titleExtra:b?null:Rn(Or,{sx:{ml:"auto",display:"flex",alignItems:"center",gap:.5},children:[r?Wt(Ep,{size:"small",color:"inherit",startIcon:Wt(c4,{sx:{fontSize:16}}),onClick:_=>i(_.currentTarget),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uD6C4\uC18D \uC5C5\uBB34"}):null,o?Wt(Ep,{size:"small",color:"inherit",startIcon:Wt(a4,{sx:{fontSize:16}}),onClick:()=>n(!0),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uC5F0\uACB0"}):null]}),children:[Rn(Or,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:[u?Wt(Or,{sx:{mb:f.related.length||f.duplicates.length||f.duplicateOf?1:0},children:f.lineage.map((_,B)=>{let A=_.seq===e.seq,j=B===f.lineage.length-1;return Rn(Or,{sx:{display:"flex",gap:1},children:[Rn(Or,{sx:{display:"flex",flexDirection:"column",alignItems:"center",width:14,flexShrink:0,pt:1.1},children:[Wt(Or,{sx:{width:A?9:7,height:A?9:7,borderRadius:"50%",bgcolor:A?"#2f80ed":_.completed?"#9a9a97":"#c9c8c5",flexShrink:0}}),j?null:Wt(Or,{sx:{width:"2px",flex:1,bgcolor:"#e6e6e3"}})]}),Rn(Or,{sx:{flex:1,minWidth:0,pb:j?0:.5},children:[Rn(Or,{sx:{display:"flex",alignItems:"center",gap:.75},children:[Rn(Or,{component:"span",onClick:!A&&l?()=>l(_.seq):void 0,sx:{minWidth:0,fontSize:14,fontWeight:A?600:400,color:A?"#2f80ed":_.completed?"#9a9a97":"#37352f",textDecoration:_.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...!A&&l?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[_.ticket_no?`${_.ticket_no} `:"",_.title]}),Wt(Ot,{option:lr(_),small:!0})]}),Wt(Or,{sx:{fontSize:12,color:"#9a9a97"},children:_.completed&&_.completed_time?`${_.completed_time} \uC644\uB8CC`:_.created_time??""})]})]},_.seq)})}):null,f.parents.map(_=>Wt(Rl,{item:_,caption:"\uC0C1\uC704 \uC5C5\uBB34",onOpen:l?()=>l(_.seq):void 0},`parent-${_.seq}`)),f.duplicateOf?Wt(Rl,{item:f.duplicateOf,caption:"\uC6D0\uBCF8",onOpen:l?()=>l(f.duplicateOf.seq):void 0,onUnlink:!b&&s?_=>x(_.currentTarget,f.duplicateOf.seq,"duplicate_of"):void 0}):null,f.duplicates.map(_=>Wt(Rl,{item:_,caption:"\uC911\uBCF5",onOpen:l?()=>l(_.seq):void 0,onUnlink:!b&&s?B=>x(B.currentTarget,_.seq,"duplicate_of"):void 0},`dup-${_.seq}`)),f.related.map(_=>Wt(Rl,{item:_,onOpen:l?()=>l(_.seq):void 0,onUnlink:!b&&s?B=>x(B.currentTarget,_.seq,"related"):void 0},`rel-${_.seq}`)),g===0?Wt(Or,{sx:{px:1.25,py:.75,fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]}),o?Wt(bl,{open:t,task:e,tasks:h,excludeSeqs:m,onClose:()=>n(!1),onSubmit:(_,B)=>o(e.seq,_,B)}):null,Wt(At,{open:!!c,anchorEl:c,title:"\uC774 \uC5C5\uBB34\uC5D0\uC11C \uC774\uC5B4\uC9C0\uB294 \uD6C4\uC18D \uC5C5\uBB34\uB97C \uB9CC\uB4DC\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uB9CC\uB4E4\uAE30",onCancel:()=>i(null),onConfirm:()=>{r?.(e.seq),i(null)}}),Wt(At,{open:!!a,anchorEl:a?.anchorEl??null,title:"\uC774 \uC5C5\uBB34\uC640\uC758 \uC5F0\uACB0\uC744 \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uD574\uC81C",onCancel:()=>d(null),onConfirm:()=>{a&&s?.(e.seq,a.targetSeq,a.type),d(null)}})]})}import{Fragment as qr,jsx as we,jsxs as Ut}from"react/jsx-runtime";function Ko({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return we(Zt,{component:"span",sx:{color:"#9a9a97"},children:e})}function jp({task:e,customTabs:h,statusOptions:b,avatarSrcByName:l,onChangeStatus:o,onChangeLabels:s,onAddLabelOption:r,onChangeProject:t,onAddProject:n,onChangeDate:c,onChangeReminder:i,onMemberEdit:a,onChangePriority:d,onChangeVisibility:f,onChangeRepeat:u,departments:g=[],onChangeEventTime:m,onChangeEventPlace:x,onChangeEventAddress:_,onChangeNote:B,onChangeNoteDraft:A,onChangeContent:j,contentTemplates:D,onSaveContentTemplate:P,onRemoveContentTemplate:N,contentLoading:q=!1,onChangeContentHeight:z,onAddChecklistItem:T,onToggleChecklistItem:C,onRemoveChecklistItem:R,onUpdateChecklistItem:p,onReorderChecklist:y,onConvertChecklistToTask:v,onOpenChecklistTask:w,onLinkChecklistTask:k,resolveChecklistTask:S,relatedTasksPool:E,onOpenRelatedTask:L,onLinkRelatedTask:$,onUnlinkRelatedTask:U,onCreateFollowUpTask:O,onAddAttachments:W,onRemoveAttachment:M,onPreview:I,onDownload:F,onUpdateComment:V,onRemoveComment:Y,onToggleCommentReaction:K,currentUserName:H="",myAccountSeq:Z=0,noticeAdmin:J=!1,hideProject:G=!1,hideLabel:X=!1,showTitle:ee=!1,onChangeTitle:ne,onToggleCompleted:re,onChangeIcon:ie,onChangeIconColor:le,employees:me=[],onAckConfirm:ve,onRequestConfirm:_e,onChangeBugField:Pe,sprints:he=[],sprintProject:de=!1,hideSprint:We=!1,onChangeSprint:Ne,onChangeStoryPoints:se,onChangeResolution:Be,onClaimTask:ye,onVerifyBug:xe}){let[Ue,Te]=yn(null),[ue,Me]=yn(null),[ke,Ie]=yn(null),[lt,Le]=yn(null),[$e,Tt]=yn(!1),je={[Bn]:$e?{maxHeight:120,opacity:1,overflow:"hidden",transition:"max-height 0.25s ease, opacity 0.2s ease"}:{minHeight:0,maxHeight:0,opacity:0,overflow:"hidden",pointerEvents:"none",transition:"max-height 0.25s ease, opacity 0.2s ease"}},[Fe,xt]=yn(null),[Ze,He]=yn(null),[vt,Ye]=yn(null),[te,ce]=yn(null),[pe,Se]=yn(null),[Xe,Re]=yn(null),[De,yt]=yn(null),Ae=!!e.is_notice,Ce=!!e.is_event,et=!!e.is_bug,st=!!ye&&Ra(e,Z),ft=!!ye&&Oa(e,Z),wt=!!xe&&et&&!!e.completed&&Z>0&&(e.author_account_seq??0)===Z&&!(e.acks??[]).some(oe=>oe.account_seq===Z),pt=!lo(e,Z),Vt=!e.is_event&&(e.is_notice?Z>0&&(e.author_account_seq??0)===Z:(e.author_account_seq??0)===Z||(e.manager_account_seq??0)===Z),qt=e.is_notice||e.is_event?_t(e.icon||(e.is_notice?or:ar)):null,Pt=Ae?!Ma(e,Z):pt,Kt=st||ft?Ut(Ln,{onClick:oe=>yt(oe.currentTarget),children:[we(k4,{sx:{fontSize:16,mr:.5}}),"\uAC00\uC838\uAC00\uAE30"]}):null,Q=Ae?Tl(e,me):"",ae=Ae?op(e,me,Z):null,ge=Ae?null:Va(e,Z),be=!!(ge&&ge.total>0||Ae&&ae),Ee=!Ae,ze=Ut(qr,{children:[we(mt,{icon:we(v4,{sx:{fontSize:17}}),label:"\uC791\uC131\uC790",sx:[Gn(9),je??null,...Ce?[]:[tr(1)]],children:e.created_by?Ut(qr,{children:[we(jr,{names:[e.created_by],size:20,avatarSrcByName:l}),e.created_by]}):we(Ko,{})}),we(mt,{icon:we(Ap,{sx:{fontSize:17}}),label:"\uC791\uC131\uC77C\uC2DC",sx:[Gn(11),je??null,...Ce?[]:[tr(2)]],children:e.created_time?on(e.created_time):we(Ko,{})})]});return Ut(qr,{children:[ee?Ut(Zt,{sx:{px:2,pt:2,pb:.5,display:"flex",alignItems:"flex-start",gap:1},children:[Vt?we(d4,{checked:e.completed,icon:we(b4,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:we(ju,{sx:{fontSize:22,color:"#2f80ed"}}),onChange:(oe,it)=>{ke||Ie({anchorEl:oe.currentTarget,nextCompleted:it})},sx:{p:0,mt:.25}}):null,qt?Ce&&!pt?we(Rp,{onClick:oe=>Me(oe.currentTarget),sx:{display:"flex",p:.25,mt:.1,borderRadius:1,color:e.icon_color||"#1e3a8a","&:hover":{bgcolor:"#f2f2f0"}},children:we(qt,{sx:{fontSize:20}})}):we(Zt,{sx:{display:"flex",p:0,mt:.25,color:e.icon_color||(Ae?"#e5484d":"#1e3a8a")},children:we(qt,{sx:{fontSize:20}})}):null,we(Zt,{sx:{flex:1,minWidth:0},children:Ue!==null?we(Zt,{component:"input",autoFocus:!0,spellCheck:!1,value:Ue,onChange:oe=>Te(oe.target.value),onBlur:()=>{Ue.trim()&&Ue.trim()!==e.title&&ne(e.seq,Ue.trim()),Te(null)},onKeyDown:oe=>{oe.key==="Enter"&&oe.target.blur(),oe.key==="Escape"&&Te(null)},sx:{width:"100%",border:"none",outline:"none",font:"inherit",fontSize:19,fontWeight:600,lineHeight:1.35,height:"auto",color:"#37352f",p:0,m:0}}):we(Zt,{onClick:()=>Te(e.title),sx:{fontSize:19,fontWeight:600,color:"#37352f",lineHeight:1.35,cursor:"text",textDecoration:e.completed?"line-through":"none",userSelect:"text"},children:e.title})}),we(At,{open:!!ke,anchorEl:ke?.anchorEl??null,title:ke?.nextCompleted?"\uC774 \uC5C5\uBB34\uB97C \uC644\uB8CC \uCC98\uB9AC\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC644\uB8CC\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:ke?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>Ie(null),onConfirm:()=>{ke&&re(e.seq,ke.nextCompleted),Ie(null)}})]}):null,Ut(Zt,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:0,[Bn]:{pb:0,"& > :last-child":{mb:0}}},children:[we(dl,{hideProject:G,pinColumns:!0,projectColumn:!Ce&&!X?2:"full",values:{tabKey:e.tab_key??"",managerName:e.manager_name,receiverNames:e.receiver_names,startDate:e.start_date,dueDate:e.due_date,reminders:zn(e),priority:e.priority,eventTime:e.event_time??"",eventPlace:e.event_place??"",eventAddress:e.event_address??""},customTabs:h,avatarSrcByName:l,hideDueDate:!Ce&&!!e.repeat_rule,hideReminder:!!e.repeat_rule,notice:Ae,event:Ce,readOnly:pt,targetSummary:Q,onChangeProject:oe=>t(e.seq,oe),onAddProject:n,onChangeStartDate:oe=>c(e.seq,"start_date",oe),onChangeDueDate:oe=>c(e.seq,"due_date",oe),onChangeReminder:oe=>i(e.seq,oe),onChangePriority:oe=>d(e.seq,oe),onChangeEventTime:oe=>m?.(e.seq,oe),onChangeEventPlace:oe=>x?.(e.seq,oe),onChangeEventAddress:oe=>_?.(e.seq,oe),onMemberEdit:oe=>a(e,oe,null),narrowCollapsedSx:je,reminderLocked:e.completed,managerAction:Kt,leading:Ut(qr,{children:[wt||Kt&&(Ae||Ce)?Ut(Zt,{sx:{gridColumn:"1 / -1",display:"flex",justifyContent:"flex-start",gap:2,px:2,py:1.5},children:[Ae||Ce?Kt:null,wt?Ut(qr,{children:[we(Zi,{variant:"contained",size:"large",onClick:()=>xe?.(e.seq,!0),sx:{bgcolor:"#2f80ed"},children:"\uAC80\uC99D\uC644\uB8CC"}),we(Zi,{variant:"outlined",size:"large",color:"error",onClick:()=>xe?.(e.seq,!1),children:"\uC7AC\uC624\uD508"})]}):null]}):null,et&&e.ticket_no?we(mt,{icon:we(p4,{sx:{fontSize:17}}),label:"\uD2F0\uCF13",sx:tr(1),children:we(Zt,{component:"span",sx:{fontVariantNumeric:"tabular-nums"},children:e.ticket_no})}):null,Ce?null:we(Zt,{sx:et&&e.ticket_no||Ee||be?tr(et&&e.ticket_no?2:1):{gridColumn:"1 / -1"},children:we(mt,{icon:we(y4,{sx:{fontSize:17}}),label:"\uC0C1\uD0DC",onClick:pt||e.completed?void 0:oe=>xt(oe),children:we(Ot,{option:lr(e)})})}),Ae?null:(()=>{let oe=kn(e),it=oe==="all"?we(Pp,{sx:{fontSize:17,color:"#2f80ed"}}):oe==="group"?we(Np,{sx:{fontSize:17,color:"#d9730d"}}):we(Dp,{sx:{fontSize:17}}),Je=oe==="all"?"\uC804\uCCB4\uACF5\uAC1C":oe==="group"?`\uBD80\uC11C\uACF5\uAC1C \xB7 ${g.find(Ge=>Ge.seq===(e.visibility_group_seq??0))?.name??"\uBD80\uC11C"}`:"\uBE44\uACF5\uAC1C";return we(Zt,{sx:Ce?void 0:tr(et?1:2),children:we(mt,{icon:it,label:"\uACF5\uAC1C",onClick:pt||!f?void 0:Ge=>He(Ge),children:Je})})})(),!Ae&&!et?we(Zt,{sx:Ce?void 0:tr(1),children:we(mt,{icon:we(S4,{sx:{fontSize:17,...e.repeat_rule?{color:"#2f80ed"}:{}}}),label:"\uBC18\uBCF5",onClick:pt||!u?void 0:oe=>Ye(oe),children:e.repeat_rule?sl(e.repeat_rule):we(Ko,{label:"\uC5C6\uC74C"})})}):null,!Ae&&!et&&e.repeat_rule?we(Zt,{sx:Ce?void 0:tr(2),children:we(mt,{icon:we(T4,{sx:{fontSize:17}}),label:"\uBC18\uBCF5 \uC885\uB8CC",onClick:pt||!u?void 0:oe=>ce(oe),children:e.repeat_until?`${e.repeat_until}\uAE4C\uC9C0`:we(Ko,{})})}):null,ge&&ge.total>0?we(Zt,{sx:Ce?void 0:tr(2),children:we(mt,{icon:we(zu,{sx:{fontSize:17}}),label:"\uD655\uC778",children:ge.canConfirm?we(Zi,{size:"small",variant:"contained",onClick:()=>ve?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):Ut(Zi,{size:"small",variant:"outlined",color:"inherit",startIcon:ge.myTime?we(ju,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:oe=>Le({anchorEl:oe.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:[ge.count," / ",ge.total]})})}):null,Ae&&ae?we(Zt,{sx:tr(2),children:we(mt,{icon:we(zu,{sx:{fontSize:17}}),label:"\uD655\uC778",children:we(Zt,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,minWidth:0},children:ae.canAck?we(Zi,{size:"small",variant:"contained",onClick:()=>ve?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):we(Zi,{size:"small",variant:"outlined",color:"inherit",startIcon:ae.acked?we(ju,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:oe=>Le({anchorEl:oe.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:ae.total>0&&ae.count>=ae.total?"\uC644\uB8CC":Ut(qr,{children:[ae.count,we(Zt,{component:"span",sx:{mx:.4},children:"/"}),ae.total]})})})})}):null,de&&!We&&!Ce&&!Ae?Ut(qr,{children:[we(mt,{icon:we(m4,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:pt?void 0:oe=>Se(oe),sx:tr(1),children:(e.sprint_seq??0)>0?he.find(oe=>oe.seq===e.sprint_seq)?.name??"\uC0AD\uC81C\uB41C \uC2A4\uD504\uB9B0\uD2B8":we(Ko,{label:"\uBBF8\uBC30\uC815"})}),we(mt,{icon:we(g4,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",sx:tr(2),children:we(_o,{value:(e.story_points??0)>0?String(e.story_points):"",placeholder:"\uBBF8\uCD94\uC815",readOnly:pt,onCommit:oe=>se?.(e.seq,Number(oe.replace(/[^0-9.]/g,""))||0)})})]}):null,Ce||X?null:we(Zt,{sx:[G?{gridColumn:"1 / -1"}:tr(1),je??null],children:we(mt,{icon:we(x4,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:pt?void 0:oe=>Re(oe),children:(e.label_keys??[]).length>0?we(No,{labelKeys:e.label_keys??[],labelOptions:b}):we(Ko,{})})})]}),afterProject:Ce?null:ze,trailing:Ut(qr,{children:[et?we(fl,{values:{repro:e.bug_repro??"",device:e.bug_device??"",where:e.bug_where??"",version:e.bug_version??"",resolution:e.resolution??""},readOnly:pt,showResolution:!!e.completed,onChangeRepro:oe=>Pe?.(e.seq,"bug_repro",oe),onChangeDevice:oe=>Pe?.(e.seq,"bug_device",oe),onChangeWhere:oe=>Pe?.(e.seq,"bug_where",oe),onChangeVersion:oe=>Pe?.(e.seq,"bug_version",oe),onChangeResolution:oe=>Be?.(e.seq,oe)}):null,Ce?ze:null,e.completed?Ut(qr,{children:[we(mt,{icon:we(zu,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC790",sx:[Gn(10),je??null,...Ce?[]:[tr(1)]],children:e.completed_by?Ut(qr,{children:[we(jr,{names:[e.completed_by],size:20,avatarSrcByName:l}),e.completed_by]}):we(Ko,{})}),we(mt,{icon:we(Ap,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC77C\uC2DC",sx:[Gn(12),je??null,...Ce?[]:[tr(2)]],children:e.completed_time?on(e.completed_time):we(Ko,{})})]}):null]})}),Ut(Zt,{sx:{display:"none",[Bn]:{display:"block",mt:1.5,mb:0}},children:[we(yi,{sx:{borderColor:"#e6e6e3"}}),we(Rp,{onClick:()=>Tt(oe=>!oe),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:.5,pt:1.25,pb:1.25,fontSize:13.5,bgcolor:"#f4f4f2",color:"#37352f","&:active":{opacity:.6}},children:$e?Ut(qr,{children:["\uC811\uAE30 ",we(f4,{sx:{fontSize:18}})]}):Ut(qr,{children:["\uC815\uBCF4 \uB354\uBCF4\uAE30 ",we(h4,{sx:{fontSize:18}})]})})]}),Ut(Zt,{children:[we(yi,{sx:{my:1.5,borderColor:"#e6e6e3",[Bn]:{mt:0,mb:1.25}}}),we(bn,{icon:we(w4,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",titleExtra:D&&!pt?we(pl,{content:e.content??"",templates:D,onApply:oe=>j?.(e.seq,oe),onSave:P,onRemove:N}):void 0,children:we(Zt,{sx:{userSelect:"text"},children:q?we(Zt,{sx:{minHeight:e.content_height||180,display:"flex",alignItems:"center",justifyContent:"center"},children:we($a,{})}):we(ml,{syncKey:e.seq,value:e.content??"",height:e.content_height??0,onChangeHeight:z?oe=>z(e.seq,oe):void 0,readOnly:pt,onChange:oe=>j(e.seq,oe)})})}),e.is_bug?null:Ut(qr,{children:[we(yi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(bn,{icon:we(_4,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:we(Zt,{sx:{userSelect:"text"},children:we(Cp,{value:e.note,readOnly:Pt,onCommit:oe=>B(e.seq,oe),onDraftChange:A?oe=>A(e.seq,oe):void 0})})})]}),Ce?null:Ut(qr,{children:[we(yi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(yl,{taskSeq:e.seq,checklist:e.checklist??[],removeLocked:Pt,onAdd:T,onToggle:C,onRemove:R,onUpdate:p,onReorder:y,onConvertToTask:v,onOpenLinkedTask:w,resolveLinkedTask:S,myAccountSeq:Z,linkCandidates:E,linkBaseTask:e,onLinkExistingTask:k})]}),E&&!Ce&&!Ae&&Ip(e,E)?Ut(qr,{children:[we(yi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(Mp,{task:e,tasks:E,readOnly:pt,onOpenTask:L,onLink:$,onUnlink:U,onCreateFollowUp:O})]}):null,we(yi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(_l,{taskSeq:e.seq,attachments:e.attachments??[],removeLocked:Pt,onAdd:W,onRemove:M,onPreview:I?oe=>I({...oe,taskSeq:e.seq}):void 0,onDownload:F?oe=>F({...oe,taskSeq:e.seq}):void 0})]}),we(yi,{sx:{my:1.5,borderColor:"#e6e6e3"}}),we(xp,{taskSeq:e.seq,comments:e.comments??[],currentUserName:H,myAccountSeq:Z,avatarSrcByName:l,onUpdate:V,onRemove:Y,onToggleReaction:K,onPreview:I?oe=>I({...oe,taskSeq:e.seq}):void 0,onDownload:F?oe=>F({...oe,taskSeq:e.seq}):void 0})]}),we(Ei,{anchorEl:Fe,value:e.status,options:Ae?ys:et?ni:xs,onSelect:oe=>o(e.seq,oe),onClose:()=>xt(null)}),we(Nu,{transitionDuration:0,anchorEl:vt,open:!!vt,onClose:()=>Ye(null),children:[{value:"",label:"\uC5C6\uC74C"},...Os].map(oe=>we(Lu,{selected:(e.repeat_rule??"")===oe.value,onClick:()=>{Ye(null),(async()=>{let it=e.repeat_rule??"";if(oe.value===it)return;if(oe.value===""){await Lp({title:"\uBC18\uBCF5 \uD574\uC81C",message:"\uC774\uD6C4 \uBC18\uBCF5 \uD68C\uCC28\uB97C \uBAA8\uB450 \uC0AD\uC81C\uD558\uACE0 \uBC18\uBCF5\uC744 \uD574\uC81C\uD560\uAE4C\uC694? (\uC9C0\uB09C \uD68C\uCC28\uB294 \uB0A8\uC2B5\uB2C8\uB2E4)"})&&u?.(e.seq,"","");return}let Je=String(e.due_date??"").slice(0,10);if(!Je){C4(e.is_event?"\uBC18\uBCF5\uD558\uB824\uBA74 \uC77C\uC815 \uB0A0\uC9DC\uB97C \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694.":"\uBC18\uBCF5\uD558\uB824\uBA74 \uB9C8\uAC10\uC77C\uC2DC\uB97C \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694.");return}it&&!await Lp({title:"\uBC18\uBCF5 \uBCC0\uACBD",message:"\uC774\uD6C4 \uD68C\uCC28\uB97C \uC0C8 \uADDC\uCE59\uC73C\uB85C \uB2E4\uC2DC \uC0DD\uC131\uD560\uAE4C\uC694? \uC774\uD6C4 \uD68C\uCC28\uC758 \uB313\uAE00\xB7\uCCA8\uBD80\uB294 \uC0AC\uB77C\uC9D1\uB2C8\uB2E4."})||u?.(e.seq,oe.value,al(Je,oe.value))})()},sx:{fontSize:14,minWidth:140},children:oe.label},oe.value||"none"))}),we(B4,{anchorEl:te,open:!!te,onClose:()=>ce(null),selectedDate:e.repeat_until?new Date(`${e.repeat_until}T00:00:00`):new Date,onDateChange:oe=>{ce(null);let it=rt=>String(rt).padStart(2,"0"),Je=`${oe.getFullYear()}-${it(oe.getMonth()+1)}-${it(oe.getDate())}`,Ge=e.repeat_rule??"";Ge&&u?.(e.seq,Ge,Je)}}),we(Nu,{transitionDuration:0,anchorEl:Ze,open:!!Ze,onClose:()=>He(null),children:[{key:"involved",label:"\uBE44\uACF5\uAC1C",icon:we(Dp,{sx:{fontSize:17,color:"#57564f"}}),selected:kn(e)==="involved",onPick:()=>f?.(e.seq,"involved",0)},{key:"all",label:"\uC804\uCCB4\uACF5\uAC1C",icon:we(Pp,{sx:{fontSize:17,color:"#2f80ed"}}),selected:kn(e)==="all",onPick:()=>f?.(e.seq,"all",0)},...g.map(oe=>({key:`group-${oe.seq}`,label:`\uBD80\uC11C\uACF5\uAC1C \xB7 ${oe.name}`,icon:we(Np,{sx:{fontSize:17,color:"#d9730d"}}),selected:kn(e)==="group"&&(e.visibility_group_seq??0)===oe.seq,onPick:()=>f?.(e.seq,"group",oe.seq)}))].map(oe=>Ut(Lu,{selected:oe.selected,onClick:()=>{oe.onPick(),He(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[oe.icon,oe.label,oe.selected?we(Op,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},oe.key))}),we(Nu,{transitionDuration:0,anchorEl:pe,open:!!pe,onClose:()=>Se(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...he.filter(oe=>`custom-${oe.group_seq}`===String(e.tab_key??"")).map(oe=>({seq:oe.seq,label:mn(oe)}))].map(oe=>Ut(Lu,{onClick:()=>{Ne?.(e.seq,oe.seq),Se(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[oe.label,(e.sprint_seq??0)===oe.seq?we(Op,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},oe.seq))}),we(Ua,{anchorEl:lt?.anchorEl??null,open:!!lt?.open,acks:e.acks??[],total:ae?.total??ge?.total??0,pendingNames:ae?.pendingNames??ge?.pendingNames??[],avatarSrcByName:l,onRequestConfirm:_e&&(ae?ae.count<ae.total:ge&&ge.count<ge.total)?()=>{_e(e.seq),Le(oe=>oe?{...oe,open:!1}:null)}:void 0,onClose:()=>Le(oe=>oe?{...oe,open:!1}:null)}),we(Sl,{anchorEl:Xe,selectedKeys:e.label_keys??[],labelOptions:b,onToggle:oe=>s(e.seq,Ia(e.label_keys??[],oe)),onAddLabel:r,onClose:()=>Re(null)}),we(zo,{anchorEl:ue,value:e.icon??"",color:e.icon_color??"",onSelect:oe=>{ie(e.seq,oe),Me(null)},onSelectColor:le?oe=>le(e.seq,oe):void 0,onClose:()=>Me(null)}),we(At,{open:!!De,anchorEl:De,title:st?"\uC774 \uC5C5\uBB34\uB97C \uAC00\uC838\uC640 \uCC45\uC784\uC790\uB97C \uB9E1\uC73C\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?":"\uC774 \uC5C5\uBB34\uC758 \uCC45\uC784\uC790\uB97C \uB9E1\uC73C\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uAC00\uC838\uAC00\uAE30",onCancel:()=>yt(null),onConfirm:()=>{ye?.(e.seq),yt(null)}})]})}import{Fragment as D4,jsx as $r,jsxs as Wp}from"react/jsx-runtime";function KF(){let e=new Date,h=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${h(e.getMonth()+1)}-${h(e.getDate())} ${h(e.getHours())}:${h(e.getMinutes())}`}function GF({open:e,task:h,onClose:b,onAddComment:l,onSaveFields:o,presentation:s="auto",myAccountSeq:r=0,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:c,onChangeIconColor:i,activityItems:a,activityLoading:d,onLoadActivity:f,onPrint:u,onDelete:g,canDelete:m,...x}){let _=Nt(),B=Fp(null);h&&(B.current=h);let A=h??B.current,[j,D]=qp(!1),[P,N]=qp({}),q=Object.keys(P).length>0;zp(()=>{N({})},[h?.seq,e]);let z=Fp(null);if(zp(()=>{z.current?.scrollTo({top:0})},[h?.seq]),!A)return null;let T=_&&q?{...A,...P}:A,C=T.checklist??[],R=(S,E)=>{_?N(L=>({...L,...S})):E()},p=()=>{let S=P;N({});let E=A.seq,L=S.title===void 0?void 0:String(S.title).trim();if(o){let $={...S};L!==void 0&&(L?$.title=L:delete $.title),Object.keys($).length>0&&o(E,$),Hp({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"});return}L&&n(E,L),S.icon!==void 0&&c(E,String(S.icon)),S.icon_color!==void 0&&i?.(E,String(S.icon_color)),S.status!==void 0&&x.onChangeStatus(E,S.status),S.label_keys!==void 0&&x.onChangeLabels(E,S.label_keys??[]),S.tab_key!==void 0&&x.onChangeProject(E,String(S.tab_key??"")),S.start_date!==void 0&&x.onChangeDate(E,"start_date",String(S.start_date??"")),S.due_date!==void 0&&x.onChangeDate(E,"due_date",String(S.due_date??"")),S.reminders!==void 0&&x.onChangeReminder(E,S.reminders),S.priority!==void 0&&x.onChangePriority(E,S.priority),S.event_time!==void 0&&x.onChangeEventTime?.(E,String(S.event_time??"")),S.event_place!==void 0&&x.onChangeEventPlace?.(E,String(S.event_place??"")),S.event_address!==void 0&&x.onChangeEventAddress?.(E,String(S.event_address??"")),S.content!==void 0&&x.onChangeContent(E,String(S.content??"")),S.note!==void 0&&x.onChangeNote(E,String(S.note??"")),S.visibility!==void 0&&x.onChangeVisibility?.(E,S.visibility,Number(S.visibility_group_seq??0)),Hp({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"})},y={...x,onChangeStatus:(S,E)=>R({status:E},()=>x.onChangeStatus(S,E)),onChangeLabels:(S,E)=>R({label_keys:E},()=>x.onChangeLabels(S,E)),onChangeProject:(S,E)=>R({tab_key:E},()=>x.onChangeProject(S,E)),onChangeDate:(S,E,L)=>R({[E]:L},()=>x.onChangeDate(S,E,L)),onChangeReminder:(S,E)=>R({reminders:E},()=>x.onChangeReminder(S,E)),onChangePriority:(S,E)=>R({priority:E},()=>x.onChangePriority(S,E)),onChangeEventTime:(S,E)=>R({event_time:E},()=>x.onChangeEventTime?.(S,E)),onChangeEventPlace:(S,E)=>R({event_place:E},()=>x.onChangeEventPlace?.(S,E)),onChangeEventAddress:(S,E)=>R({event_address:E},()=>x.onChangeEventAddress?.(S,E)),onChangeContent:(S,E)=>R({content:E},()=>x.onChangeContent(S,E)),onChangeNote:(S,E)=>R({note:E},()=>x.onChangeNote(S,E)),onMemberEdit:(S,E)=>x.onMemberEdit(S,E,_?L=>N($=>({...$,...L})):null),onChangeNoteDraft:_?(S,E)=>R({note:E},()=>{}):void 0,onChangeVisibility:x.onChangeVisibility?(S,E,L)=>R({visibility:E,visibility_group_seq:L},()=>x.onChangeVisibility?.(S,E,L)):void 0,onAddChecklistItem:(S,E)=>R({checklist:[...C,{label:E,checked:!1}]},()=>x.onAddChecklistItem(S,E)),onToggleChecklistItem:(S,E,L)=>R({checklist:C.map(($,U)=>U===E?{...$,checked:L}:$)},()=>x.onToggleChecklistItem(S,E,L)),onRemoveChecklistItem:(S,E)=>R({checklist:C.filter((L,$)=>$!==E)},()=>x.onRemoveChecklistItem(S,E)),onUpdateChecklistItem:x.onUpdateChecklistItem?(S,E,L)=>R({checklist:C.map(($,U)=>U===E?{...$,label:L}:$)},()=>x.onUpdateChecklistItem?.(S,E,L)):void 0,onReorderChecklist:x.onReorderChecklist?(S,E)=>R({checklist:E},()=>x.onReorderChecklist?.(S,E)):void 0,onLinkChecklistTask:x.onLinkChecklistTask?(S,E,L)=>R({checklist:[...C,{label:L,checked:!1,task_seq:E}]},()=>x.onLinkChecklistTask?.(S,E,L)):void 0},v=$r(jp,{...y,task:T,myAccountSeq:r,onChangeTitle:(S,E)=>R({title:E},()=>n(S,E)),onToggleCompleted:t,onChangeIcon:(S,E)=>R({icon:E},()=>c(S,E)),onChangeIconColor:(S,E)=>R({icon_color:E},()=>i?.(S,E)),showTitle:_||s==="dialog"}),w=$r(vp,{onSubmit:(S,E)=>l(T.seq,S,E)},T.seq);return _||s==="dialog"?Wp(D4,{children:[$r(A4,{open:e,onClose:b,locale:"ko",fontScale:{enabled:!0,default:1.1,min:.6},title:T.is_notice?"\uACF5\uC9C0\uC0AC\uD56D":T.is_event?"\uC77C\uC815":T.is_bug?"\uC624\uB958":"\uC5C5\uBB34",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1},custom:[...f?[{icon:$r(R4,{sx:{color:"#6b7280"}}),tooltip:"\uD65C\uB3D9",onClick:()=>D(!0)}]:[],{icon:$r(M4,{sx:{color:"#6b7280"}}),tooltip:"\uACF5\uC720\uD558\uAE30",onClick:()=>Ki(T,!0)},..._?[{raw:!0,icon:$r(I4,{variant:"contained",size:"small",disableElevation:!0,disabled:!q,onClick:q?p:void 0,sx:{ml:1.5,height:32,minWidth:64,px:1.75,py:0,borderRadius:1,fontSize:14,fontWeight:600,bgcolor:"#2f80ed","&:hover":{bgcolor:"#2f80ed"},"&.Mui-disabled":{bgcolor:"#f2f2f0",color:"#c9c8c5"}},children:"\uC800\uC7A5\uD558\uAE30"})}]:[]]},fullScreen:_,maxWidth:_?void 0:"md",width:_?void 0:720,mobilePresentation:_?"slide":void 0,tabs:{visible:!1},contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,contentBottomPadding:0,scrollPastLastSection:!1,overlayScrollbar:{enabled:!0,contentStyle:{minWidth:0}},actions:{visible:!0,showCancelButton:!1,left:w},sx:{DialogContent:{borderBottom:"none"}},dialogActionSx:{padding:"0 !important","@media (max-width:1023.95px)":{padding:"0 !important"},borderTop:"1px solid #37352f","& .left-actions":{flex:1,width:"100%",minWidth:0,"& > *":{flex:1,minWidth:0}},"& .right-actions":{display:"none"}},sections:[{id:"task-detail",title:"",showTitle:!1,children:$r(Ol,{sx:{userSelect:"none",width:"100%",minWidth:0,display:"flex",flexDirection:"column",gap:0},children:v})}]},A.seq),$r(Ml,{open:j,taskSeq:T.seq,items:a,loading:d,onLoad:f,onClose:()=>D(!1)})]}):$r(E4,{anchor:"right",open:e,onClose:b,"aria-label":"\uC5C5\uBB34 \uC0C1\uC138",disableAutoFocus:!0,disableEnforceFocus:!0,sx:{zIndex:S=>S.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:Wp(Ol,{sx:{display:"flex",flexDirection:"column",height:"100%",userSelect:"none"},children:[$r(Tp,{task:T,myAccountSeq:r,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:c,onChangeIconColor:i,onClose:b,activityItems:a,activityLoading:d,onLoadActivity:f,onPrint:u,onDelete:g,canDelete:m}),$r($p,{sx:{borderColor:"#e6e6e3"}}),$r(Ol,{sx:{flex:1,minHeight:0},children:$r(O4,{ref:z,style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:v})}),$r($p,{sx:{borderColor:"#37352f"}}),$r(Ol,{sx:{flexShrink:0},children:w})]})})}import{useEffect as H4,useState as Bo}from"react";import{Box as Hr,Button as Hu,IconButton as Kp}from"@mui/material";import{FormDialog as Gp}from"@ehfuse/mui-form-dialog";import W4 from"@mui/icons-material/Add";import U4 from"@mui/icons-material/DirectionsRunOutlined";import V4 from"@mui/icons-material/EditOutlined";import{ErrorAlert as Yp}from"@ehfuse/alerts";import{ClearTextField as Xp,DateTextField as Zp,LabelSelect as Jp}from"@ehfuse/mui-form-controls";import{useEffect as P4,useState as Up}from"react";import{Box as Co,Button as N4,FormControlLabel as Fu,Radio as qu,RadioGroup as L4}from"@mui/material";import{FormDialog as j4}from"@ehfuse/mui-form-dialog";import{LabelSelect as z4}from"@ehfuse/mui-form-controls";import F4 from"@ehfuse/overlay-scrollbar";import{Fragment as q4,jsx as Ar,jsxs as Ji}from"react/jsx-runtime";function Vp({open:e,sprint:h,remainingTasks:b,sprints:l,onClose:o,onConfirm:s}){let r=l.filter(d=>d.seq!==h?.seq&&d.group_seq===(h?.group_seq??0)&&d.status!=="closed"),[t,n]=Up("backlog"),[c,i]=Up(0);P4(()=>{e&&(n(r.length>0?"move":"backlog"),i(r[0]?.seq??0))},[e]);let a=b.length>0;return Ar(j4,{open:e,onClose:o,maxWidth:"sm",title:"\uBAA9\uD45C \uB9C8\uAC10",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-close",tabs:{visible:!1},actions:{showCancelButton:!0,right:Ar(N4,{variant:"contained",onClick:()=>s({mode:a?t:"keep",moveToSprintSeq:t==="move"?c:0,taskSeqs:b.map(d=>d.seq)}),disabled:a&&t==="move"&&!(c>0),children:"\uB9C8\uAC10"})},sections:[{id:"sprint-close",title:"",showTitle:!1,children:Ji(Co,{sx:{display:"flex",flexDirection:"column",gap:2},children:[Ji(Co,{sx:{fontSize:18,color:"#37352f"},children:[Ar(Co,{component:"span",sx:{fontWeight:600},children:h?.name??""})," \uBAA9\uD45C\uB97C \uB9C8\uAC10\uD569\uB2C8\uB2E4."]}),a?Ji(q4,{children:[Ji(Co,{sx:{fontSize:15,color:"#6f6f6c"},children:["\uB05D\uB098\uC9C0 \uC54A\uC740 \uC5C5\uBB34\uAC00"," ",b.length,"\uAC74 \uC788\uC2B5\uB2C8\uB2E4. \uC5B4\uB5BB\uAC8C \uD560\uAE4C\uC694?"]}),Ar(Co,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:Ar(F4,{style:{maxHeight:220},thumb:{width:6},children:b.map(d=>Ji(Co,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,borderBottom:"1px solid #f2f2f0","&:last-of-type":{borderBottom:"none"}},children:[Ar(Co,{sx:{flex:1,minWidth:0,fontSize:16,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.title}),Ar(Ot,{option:lr(d)})]},d.seq))})}),Ji(L4,{value:t,onChange:(d,f)=>n(f),children:[r.length>0?Ar(Fu,{value:"move",control:Ar(qu,{size:"small"}),label:"\uB2E4\uC74C \uBAA9\uD45C\uB85C \uC774\uC6D4",sx:{"& .MuiFormControlLabel-label":{fontSize:16}}}):null,t==="move"&&r.length>0?Ar(Co,{sx:{pl:4,pb:1},children:Ar(z4,{size:"small",label:"",fullWidth:!0,value:String(c),options:r.map(d=>({value:String(d.seq),label:d.name})),onChange:d=>i(Number(d.target.value)||0)})}):null,Ar(Fu,{value:"backlog",control:Ar(qu,{size:"small"}),label:"\uBBF8\uBC30\uC815(\uBC31\uB85C\uADF8)\uC73C\uB85C \uBE7C\uAE30",sx:{"& .MuiFormControlLabel-label":{fontSize:16}}}),Ar(Fu,{value:"keep",control:Ar(qu,{size:"small"}),label:"\uC774 \uBAA9\uD45C\uC5D0 \uADF8\uB300\uB85C \uB450\uAE30",sx:{"& .MuiFormControlLabel-label":{fontSize:16}}})]})]}):Ar(Co,{sx:{fontSize:15,color:"#6f6f6c"},children:"\uB0A8\uC740 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uC774\uB300\uB85C \uB9C8\uAC10\uD558\uBA74 \uBAA9\uD45C\uAC00 \uC885\uB8CC\uB429\uB2C8\uB2E4."})]})}]})}var $u="custom-";function $4(e){return e.startsWith($u)}function sq(e){return e>0?`${$u}${e}`:""}function Go(e){if(!$4(e))return 0;let h=Number(e.slice($u.length));return Number.isInteger(h)&&h>0?h:0}import{Fragment as em,jsx as zt,jsxs as Yo}from"react/jsx-runtime";var K4=[{value:"planning",label:"\uACC4\uD68D\uC911"},{value:"active",label:"\uC9C4\uD589\uC911"},{value:"closed",label:"\uC885\uB8CC"}];function Qp(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?e.slice(5).replace("-","."):"-"}function xq({open:e,customTabs:h,sprints:b,onClose:l,onCreate:o,onUpdate:s,onChangeStatus:r,tasks:t=[],onCloseSprint:n,onRemove:c}){let i=h.filter(E=>E.useSprints&&!E.archived),[a,d]=Bo(""),[f,u]=Bo(""),[g,m]=Bo(""),[x,_]=Bo(""),[B,A]=Bo(""),[j,D]=Bo(!1),[P,N]=Bo(!1),[q,z]=Bo(null),T=q?t.filter(E=>(E.sprint_seq??0)===q.seq&&!E.completed):[],[C,R]=Bo(0);H4(()=>{e&&(d(i.length===1?i[0].key:""),u(""),m(""),_(""),A(""),R(0))},[e]);let p=()=>{u(""),m(""),_(""),A(""),R(0),N(!1)},y=E=>{R(E.seq),d(`custom-${E.group_seq}`),u(E.name),m(E.goal),_(E.start_date),A(E.end_date)},v=C>0||P,w=async()=>{let E=Go(a);if(!E){Yp("\uBAA9\uD45C\uB97C \uB9CC\uB4E4 \uD504\uB85C\uC81D\uD2B8\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}if(!f.trim()){Yp("\uBAA9\uD45C \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}D(!0);try{if(C>0){s(C,{name:f.trim(),goal:g.trim(),start_date:x,end_date:B}),p();return}await o({group_seq:E,name:f.trim(),goal:g.trim(),start_date:x,end_date:B})&&p()}finally{D(!1)}},k=new Map(h.map(E=>[Go(E.key),E.label])),S=zt(Hr,{children:i.length===0?zt(Hr,{sx:{py:2,fontSize:14,color:"#787774"},children:'\uBAA9\uD45C\uB97C \uC0AC\uC6A9\uD558\uB294 \uD504\uB85C\uC81D\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uD504\uB85C\uC81D\uD2B8 \uC218\uC815\uC5D0\uC11C "\uBAA9\uD45C(\uC2A4\uD504\uB9B0\uD2B8) \uC0AC\uC6A9"\uC744 \uBA3C\uC800 \uCF1C\uC138\uC694.'}):zt(em,{children:zt(Hr,{children:b.length===0?Yo(Hr,{sx:{py:4,display:"flex",flexDirection:"column",alignItems:"center",gap:2,color:"#9a9a97"},children:[zt(U4,{sx:{fontSize:48,color:"#d9d9d6"}}),zt(Hr,{sx:{fontSize:13.5},children:"\uB4F1\uB85D\uB41C \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."})]}):b.map(E=>Yo(Hr,{sx:{display:"flex",flexDirection:"column",gap:1,"&:not(:last-of-type)::after":{content:'""',display:"block",my:1.75,borderBottom:"1px solid #f0efed"}},children:[Yo(Hr,{sx:{minWidth:0},children:[Yo(Hr,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[zt(Hr,{component:"span",sx:{fontSize:18,fontWeight:600,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:E.name}),zt(Hr,{component:"span",sx:{flexShrink:0,px:1,py:.25,borderRadius:.75,bgcolor:"#f1f5f9",color:"#64748b",fontSize:13,fontWeight:500},children:k.get(E.group_seq)??"\uC0AD\uC81C\uB41C \uD504\uB85C\uC81D\uD2B8"}),Yo(Hr,{component:"span",sx:{flexShrink:0,fontSize:14,color:"#57564f"},children:[Qp(E.start_date)," ~"," ",Qp(E.end_date)]})]}),E.goal?zt(Hr,{sx:{mt:.5,fontSize:14,color:"#787774",lineHeight:1.5},children:E.goal}):null]}),Yo(Hr,{sx:{display:"flex",alignItems:"center",gap:.5},children:[zt(Jp,{label:"\uC0C1\uD0DC",showLabel:!1,size:"small",value:E.status,options:K4.map(L=>({value:L.value,label:L.label})),onChange:L=>{let $=String(L.target.value);if($==="closed"&&n){z(E);return}r(E.seq,$)},sx:{width:104,flexShrink:0}}),zt(Kp,{"aria-label":"\uBAA9\uD45C \uC218\uC815",onClick:()=>y(E),sx:{color:"#9a9a97","&:hover":{color:"#2563eb"}},children:zt(V4,{sx:{fontSize:18}})}),zt(Kp,{"aria-label":"\uBAA9\uD45C \uC0AD\uC81C",onClick:()=>c(E.seq),sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:zt(cr,{style:{width:16,height:16}})})]})]},E.seq))})})});return Yo(em,{children:[zt(Gp,{open:e,onClose:l,maxWidth:"sm",title:"\uBAA9\uD45C \uAD00\uB9AC",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-manage",sections:[{id:"sprint-manage",showTitle:!1,children:S}],sectionContentPaddingTop:0,actions:{showCancelButton:!0,left:i.length>0?zt(Hu,{startIcon:zt(W4,{}),onClick:()=>{p(),N(!0)},sx:{color:"#2563eb"},children:"\uC0C8 \uBAA9\uD45C"}):void 0,right:zt(Hu,{variant:"contained",onClick:l,children:"\uD655\uC778"})}}),zt(Vp,{open:q!==null,sprint:q,remainingTasks:T,sprints:b,onClose:()=>z(null),onConfirm:E=>{q&&n?.(q.seq,E),z(null)}}),zt(Gp,{open:v,onClose:()=>{N(!1),p()},maxWidth:"sm",title:C>0?"\uBAA9\uD45C \uC218\uC815":"\uC0C8 \uBAA9\uD45C",locale:"ko",backdropClick:!1,tabs:{visible:!1},titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-form",sections:[{id:"sprint-form",title:"",showTitle:!1,children:zt(Hr,{sx:{pt:1},children:Yo(Hr,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2.5,mt:1},children:[zt(Jp,{label:"\uD504\uB85C\uC81D\uD2B8",size:"medium",value:a,options:i.map(E=>({value:E.key,label:E.label})),onChange:E=>d(String(E.target.value)),disabled:C>0}),zt(Xp,{label:"\uBAA9\uD45C \uC774\uB984",size:"medium",placeholder:"\uC608: 8\uC6D4 2\uC8FC\uCC28",value:f,onChange:E=>u(E.target.value)}),zt(Zp,{size:"medium",label:"\uC2DC\uC791\uC77C",value:x,onChange:E=>_(E.target.value)}),zt(Zp,{size:"medium",label:"\uC885\uB8CC\uC77C",value:B,onChange:E=>A(E.target.value)}),zt(Xp,{label:"\uC124\uBA85",size:"medium",placeholder:"\uC120\uD0DD \uC785\uB825",value:g,onChange:E=>m(E.target.value),sx:{gridColumn:"1 / -1"}})]})})}],actions:{showCancelButton:!0,right:zt(Hu,{variant:"contained",onClick:()=>{w()},disabled:j,children:C>0?"\uC218\uC815":"\uBAA9\uD45C \uB9CC\uB4E4\uAE30"})}})]})}import{Box as Jr,Button as om,Tooltip as G4}from"@mui/material";import{FormDialog as Y4}from"@ehfuse/mui-form-dialog";import X4 from"@mui/icons-material/CalendarMonthOutlined";import Z4 from"@mui/icons-material/FileUploadOutlined";import J4 from"@mui/icons-material/FileDownloadOutlined";var Wu={google:{key:"google",name:"\uAD6C\uAE00 \uCE98\uB9B0\uB354",homeUrl:"https://calendar.google.com/calendar",defaultCalendarName:"\uAD6C\uAE00 \uCE98\uB9B0\uB354",exportSupported:!0,importSupported:!0,subscribeSteps:["\uBC84\uD2BC\uC774 \uB3D9\uC791\uD558\uC9C0 \uC54A\uC73C\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354 > \uB2E4\uB978 \uCE98\uB9B0\uB354 + > **URL\uB85C \uCD94\uAC00**\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694.","\uAD6C\uAE00\uC774 \uD53C\uB4DC\uB97C \uC8FC\uAE30\uC801\uC73C\uB85C(\uC218 \uC2DC\uAC04 \uAC04\uACA9) \uAC00\uC838\uAC00\uBBC0\uB85C \uBCC0\uACBD\uC0AC\uD56D \uBC18\uC601\uC774 \uB2A6\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4.","\uB0B4\uBCF4\uB0B4\uAE30\uB97C \uADF8\uB9CC\uD558\uB824\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0\uC11C \uCD94\uAC00\uD55C \uCE98\uB9B0\uB354\uB97C \uC0AD\uC81C\uD558\uBA74 \uB429\uB2C8\uB2E4."],importSteps:["\uAD6C\uAE00 \uCE98\uB9B0\uB354(\uC6F9) > \uC67C\uCABD \uBAA9\uB85D\uC5D0\uC11C \uAC00\uC838\uC62C \uCE98\uB9B0\uB354\uC5D0 \uB9C8\uC6B0\uC2A4\uB97C \uC62C\uB824 \u22EE > **\uC124\uC815 \uBC0F \uACF5\uC720**\uB97C \uC5FD\uB2C8\uB2E4.","**\uCE98\uB9B0\uB354 \uD1B5\uD569** \uC139\uC158\uC758 **iCal \uD615\uC2DD\uC758 \uBE44\uBC00 \uC8FC\uC18C**\uB97C \uBCF5\uC0AC\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694."],importPlaceholder:"https://calendar.google.com/calendar/ical/\u2026/basic.ics",buildSubscribeUrl:e=>`https://calendar.google.com/calendar/r?cid=${encodeURIComponent(e.replace(/^https?:\/\//,"webcal://"))}`},apple:{key:"apple",name:"\uC560\uD50C \uCE98\uB9B0\uB354",homeUrl:"https://www.icloud.com/calendar",defaultCalendarName:"\uC560\uD50C \uCE98\uB9B0\uB354",exportSupported:!0,importSupported:!0,subscribeSteps:["\uC544\uC774\uD3F0\xB7\uC544\uC774\uD328\uB4DC: **\uC124\uC815 > \uCE98\uB9B0\uB354 > \uACC4\uC815 > \uACC4\uC815 \uCD94\uAC00 > \uAE30\uD0C0 > \uAD6C\uB3C5 \uCE98\uB9B0\uB354 \uCD94\uAC00**\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694.","\uB9E5: \uCE98\uB9B0\uB354 \uC571 > **\uD30C\uC77C > \uC0C8\uB85C\uC6B4 \uCE98\uB9B0\uB354 \uAD6C\uB3C5**\uC5D0 \uBD99\uC5EC\uB123\uC2B5\uB2C8\uB2E4.","iCloud.com(\uC6F9)\uC5D0\uC11C\uB294 \uAD6C\uB3C5\uC744 \uCD94\uAC00\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 \uAE30\uAE30\uC5D0\uC11C \uCD94\uAC00\uD558\uBA74 iCloud \uB85C \uB3D9\uAE30\uD654\uB429\uB2C8\uB2E4."],importSteps:["iCloud.com > \uCE98\uB9B0\uB354\uC5D0\uC11C \uAC00\uC838\uC62C \uCE98\uB9B0\uB354 \uC606 **\uACF5\uC720 \uC544\uC774\uCF58**\uC744 \uB204\uB985\uB2C8\uB2E4.","**\uACF5\uC6A9 \uCE98\uB9B0\uB354**\uB97C \uCF1C\uACE0 \uB098\uC624\uB294 **\uB9C1\uD06C\uB97C \uBCF5\uC0AC**\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694(webcal:// \uC8FC\uC18C\uB3C4 \uADF8\uB300\uB85C \uB429\uB2C8\uB2E4)."],importPlaceholder:"webcal://p00-calendars.icloud.com/published/\u2026",importWarning:"\uC560\uD50C\uC740 **\uACF5\uC6A9 \uCE98\uB9B0\uB354**\uB85C \uBC14\uAFD4\uC57C \uC8FC\uC18C\uAC00 \uB098\uC635\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC544\uB294 \uC0AC\uB78C\uC740 \uADF8 \uCE98\uB9B0\uB354\uB97C \uBCFC \uC218 \uC788\uC73C\uB2C8, \uAC1C\uC778 \uC77C\uC815\uC774 \uB2F4\uAE34 \uCE98\uB9B0\uB354\uB294 \uACF5\uAC1C\uD558\uC9C0 \uB9C8\uC138\uC694."},naver:{key:"naver",name:"\uB124\uC774\uBC84 \uCE98\uB9B0\uB354",homeUrl:"https://calendar.naver.com",defaultCalendarName:"\uB124\uC774\uBC84 \uCE98\uB9B0\uB354",exportSupported:!0,importSupported:!0,subscribeSteps:["\uB124\uC774\uBC84 \uCE98\uB9B0\uB354 > \uC67C\uCABD **\uB0B4 \uCE98\uB9B0\uB354** \uC606 **+** > **URL\uB85C \uAD6C\uB3C5\uD558\uAE30**\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694.","\uB124\uC774\uBC84\uAC00 \uD53C\uB4DC\uB97C \uC8FC\uAE30\uC801\uC73C\uB85C \uAC00\uC838\uAC00\uBBC0\uB85C \uBCC0\uACBD\uC0AC\uD56D \uBC18\uC601\uC774 \uB2A6\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4.","\uB0B4\uBCF4\uB0B4\uAE30\uB97C \uADF8\uB9CC\uD558\uB824\uBA74 \uB124\uC774\uBC84 \uCE98\uB9B0\uB354\uC5D0\uC11C \uAD6C\uB3C5\uD55C \uCE98\uB9B0\uB354\uB97C \uC0AD\uC81C\uD558\uBA74 \uB429\uB2C8\uB2E4."],importSteps:["\uB124\uC774\uBC84 \uCE98\uB9B0\uB354 > \uC67C\uCABD **\uCE98\uB9B0\uB354 \uC124\uC815**(\uD1B1\uB2C8)\uC5D0\uC11C \uAC00\uC838\uC62C \uCE98\uB9B0\uB354\uB97C \uACE0\uB985\uB2C8\uB2E4.","**\uC678\uBD80 \uACF5\uAC1C** \uD56D\uBAA9\uC5D0\uC11C **\uCE98\uB9B0\uB354 \uACF5\uAC1C**\uB97C \uCCB4\uD06C\uD558\uBA74 \uB098\uC624\uB294 **iCal \uC8FC\uC18C**\uB97C \uBCF5\uC0AC\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694."],importPlaceholder:"https://calendar.naver.com/\u2026(iCal \uC8FC\uC18C)",importWarning:"\uB124\uC774\uBC84\uB294 **\uCE98\uB9B0\uB354\uB97C \uACF5\uAC1C**\uD574\uC57C iCal \uC8FC\uC18C\uAC00 \uB098\uC635\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC544\uB294 \uC0AC\uB78C\uC740 \uADF8 \uCE98\uB9B0\uB354\uB97C \uBCFC \uC218 \uC788\uC73C\uB2C8, \uAC1C\uC778 \uC77C\uC815\uC774 \uB2F4\uAE34 \uCE98\uB9B0\uB354\uB294 \uACF5\uAC1C\uD558\uC9C0 \uB9C8\uC138\uC694."}},tm=Object.values(Wu);function Al(e){return Wu[e??"google"]??Wu.google}import{jsx as dr,jsxs as Qi}from"react/jsx-runtime";function Eq({open:e,imports:h=[],onOpenExport:b,onOpenImport:l,onClose:o}){let s=Qi(Jr,{sx:{display:"flex",flexDirection:"column",gap:"24px"},children:[Qi(Jr,{sx:{bgcolor:"#f2f6fa",borderRadius:1,px:1.5,py:1.25,fontSize:15,lineHeight:1.8,color:"#37352f",display:"flex",flexDirection:"column",gap:.25,"& > div":{display:"flex",gap:1},"& > div::before":{content:'"\u2022"',flexShrink:0}},children:[dr(Jr,{children:Qi(Jr,{component:"span",children:[dr("b",{children:"\uB0B4\uBCF4\uB0B4\uAE30"}),"\uB294 \uB0B4 \uC5C5\uBB34\uB97C \uB2E4\uB978 \uCE98\uB9B0\uB354\uC5D0\uC11C"," ",dr("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uBCF4\uAC8C \uD569\uB2C8\uB2E4."]})}),dr(Jr,{children:Qi(Jr,{component:"span",children:[dr("b",{children:"\uAC00\uC838\uC624\uAE30"}),"\uB294 \uADF8 \uCE98\uB9B0\uB354\uC758 \uC77C\uC815\uC744 \uC5C5\uBB34\uD568 \uCE98\uB9B0\uB354\uC5D0 \uACB9\uCCD0 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4."]})}),dr(Jr,{children:dr(Jr,{component:"span",children:"\uB450 \uBC29\uD5A5 \uBAA8\uB450 \uC6D0\uBCF8\uC744 \uACE0\uCE58\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})})]}),dr(Jr,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:tm.map((r,t)=>Qi(Jr,{sx:{display:"flex",alignItems:"center",gap:2,px:2,py:1.75,borderTop:t>0?"1px solid #f2f2f0":"none"},children:[dr(X4,{sx:{fontSize:22,color:"#787774",flexShrink:0}}),Qi(Jr,{sx:{flex:1,minWidth:0},children:[dr(Jr,{sx:{fontSize:16,color:"#37352f"},children:r.name}),r.exportBlockedReason??r.importBlockedReason?dr(Jr,{sx:{fontSize:13.5,color:"#8a6d1d",mt:.25,lineHeight:1.6},children:r.exportBlockedReason??r.importBlockedReason}):null]}),dr(nm,{label:"\uB0B4\uBCF4\uB0B4\uAE30",icon:dr(Z4,{sx:{fontSize:18}}),supported:r.exportSupported,reason:r.exportBlockedReason,onClick:()=>b(r.key)}),dr(nm,{label:rm(h,r.key)>0?`\uAC00\uC838\uC624\uAE30 (${rm(h,r.key)})`:"\uAC00\uC838\uC624\uAE30",icon:dr(J4,{sx:{fontSize:18}}),supported:r.importSupported,reason:r.importBlockedReason,onClick:()=>l(r.key)})]},r.key))})]});return dr(Y4,{open:e,onClose:o,width:680,title:"\uCE98\uB9B0\uB354 \uC5F0\uB3D9",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-link",sectionContentPaddingTop:0,sections:[{id:"calendar-link",showTitle:!1,children:s}],actions:{showCancelButton:!1,right:dr(om,{variant:"contained",onClick:o,children:"\uB2EB\uAE30"})}})}function rm(e,h){return e.filter(b=>b.provider===h).length}function nm({label:e,icon:h,supported:b,reason:l,onClick:o}){let s=dr(Jr,{component:"span",sx:{flexShrink:0},children:dr(om,{size:"medium",variant:"outlined",startIcon:h,disabled:!b,onClick:o,sx:{minWidth:132,whiteSpace:"nowrap"},children:e})});return b?s:dr(G4,{title:l??"\uC774 \uC11C\uBE44\uC2A4\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",arrow:!0,children:s})}import{useState as im}from"react";import{Box as xr,Button as Vu,Divider as t6,IconButton as r6,TextField as n6}from"@mui/material";import{FormDialog as o6}from"@ehfuse/mui-form-dialog";import i6 from"@mui/icons-material/OpenInNewOutlined";import s6 from"@mui/icons-material/EventOutlined";import{ConfirmDialog as a6}from"@ehfuse/alerts";import{Fragment as Q4}from"react";import{Fragment as e6,jsx as Uu}from"react/jsx-runtime";function qs({text:e}){let h=String(e??"").split("**");return Uu(e6,{children:h.map((b,l)=>l%2===1?Uu("b",{children:b},l):Uu(Q4,{children:b},l))})}import{jsx as jt,jsxs as $s}from"react/jsx-runtime";function Wq({open:e,imports:h,provider:b,onRegister:l,onRemove:o,onClose:s}){let r=Al(b),[t,n]=im(""),[c,i]=im(!1),a=async()=>{let u=t.trim();if(u){i(!0);try{await l(u)&&n("")}finally{i(!1)}}},d=async u=>{await a6({title:"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",message:`"${u.name||r.defaultCalendarName}" \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&o(u.seq)},f=$s(xr,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[$s(xr,{sx:{color:"#37352f",lineHeight:1.7},children:[r.name,"\uC758 \uC77C\uC815\uC744 ",jt("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uC5C5\uBB34\uD568 \uCE98\uB9B0\uB354\uC5D0 \uD568\uAED8 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4.",jt("br",{}),"\uD45C\uC2DC/\uC228\uAE40\uC740 \uC5C5\uBB34\uD568 \uC6B0\uC0C1\uB2E8\uC758 ",jt("b",{children:"\uC678\uBD80 \uCE98\uB9B0\uB354 \uC77C\uC815"})," \uC2A4\uC704\uCE58\uB85C \uCF1C\uACE0 \uB055\uB2C8\uB2E4."]}),jt(xr,{sx:{fontWeight:700,color:"#37352f",mt:.5},children:"\uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354"}),h.length>0?jt(xr,{sx:{display:"flex",flexDirection:"column",border:"1px solid #e6e6e3",borderRadius:1},children:h.map((u,g)=>$s(xr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:.75,borderTop:g>0?"1px solid #efefed":"none"},children:[jt(s6,{sx:{fontSize:18,color:"#0f9d58",flexShrink:0}}),jt(xr,{component:"span",sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:u.name||r.defaultCalendarName}),jt(r6,{"aria-label":"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",size:"small",onClick:()=>{d(u)},sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:jt(cr,{sx:{fontSize:18}})})]},u.seq))}):jt(xr,{sx:{color:"#9a9a97",px:.5},children:"\uC544\uC9C1 \uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}),jt(t6,{sx:{my:1,borderColor:"#e6e6e3"}}),jt(xr,{sx:{fontWeight:700,color:"#37352f"},children:"\uC0C8 \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30"}),$s(xr,{sx:{bgcolor:"#f2f6fa",borderRadius:1,px:1.5,py:1.25,mb:1,fontSize:15,lineHeight:1.8,display:"flex",flexDirection:"column",gap:.25,"& > div":{display:"flex",gap:1},"& > div::before":{content:'"\u2022"',flexShrink:0}},children:[r.importSteps.map(u=>jt(xr,{children:jt(xr,{component:"span",children:jt(qs,{text:u})})},u)),jt(xr,{children:jt(xr,{component:"span",children:"\uB4F1\uB85D\uD55C \uC8FC\uC18C\uB294 \uC11C\uBC84\uC5D0 \uC800\uC7A5\uB418\uBA70 \uB2E4\uB978 \uC9C1\uC6D0\uC5D0\uAC8C \uBCF4\uC774\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})}),jt(xr,{children:jt(xr,{component:"span",children:"\uC77C\uC815\uC740 \uC57D 10\uBD84 \uAC04\uACA9\uC73C\uB85C \uAC31\uC2E0\uB418\uACE0, \uBC18\uBCF5 \uC77C\uC815\uC740 \uC77C\uBC18\uC801\uC778 \uADDC\uCE59(\uB9E4\uC77C/\uB9E4\uC8FC/\uB9E4\uC6D4/\uB9E4\uB144)\uB9CC \uC9C0\uC6D0\uD569\uB2C8\uB2E4."})}),r.importWarning?jt(xr,{children:jt(xr,{component:"span",children:jt(qs,{text:r.importWarning})})}):null]}),$s(xr,{sx:{display:"flex",gap:2,alignItems:"center"},children:[jt(n6,{value:t,onChange:u=>n(u.target.value),fullWidth:!0,label:"iCal \uC8FC\uC18C",placeholder:r.importPlaceholder,slotProps:{input:{spellCheck:!1}}}),jt(Vu,{variant:"contained",disabled:!t.trim()||c,onClick:()=>{a()},sx:{flexShrink:0},children:c?"\uD655\uC778 \uC911\u2026":"\uB4F1\uB85D"})]})]});return jt(o6,{open:e,onClose:s,width:680,title:`${r.name} \uAC00\uC838\uC624\uAE30`,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-import",sections:[{id:"calendar-import",showTitle:!1,children:f}],actions:{showCancelButton:!1,left:jt(Vu,{variant:"outlined",startIcon:jt(i6,{sx:{fontSize:16}}),onClick:()=>window.open(r.homeUrl,"_blank"),children:r.name}),right:jt(Vu,{variant:"contained",onClick:s,children:"\uB2EB\uAE30"})}})}import{Box as xi,Button as Hs,TextField as l6}from"@mui/material";import{FormDialog as c6}from"@ehfuse/mui-form-dialog";import u6 from"@mui/icons-material/ContentCopyOutlined";import sm from"@mui/icons-material/OpenInNewOutlined";import{InfoAlert as am}from"@ehfuse/alerts";import{Fragment as f6,jsx as Tr,jsxs as vi}from"react/jsx-runtime";function d6(e){return`${window.location.origin}/api/v1/taskbox/calendar/${e}.ics`}function e$({open:e,feed:h,feedTaskCount:b,provider:l,buildFeedUrl:o,onSubscribe:s,onClose:r}){let t=Al(l),n=o??d6,c=h.subscribed?n(h.token):"",i=()=>{navigator.clipboard.writeText(c).then(()=>am("\uD53C\uB4DC \uC8FC\uC18C\uB97C \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>am("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD558\uC138\uC694."))},a=()=>{let f=t.buildSubscribeUrl?.(c);f&&window.open(f,"_blank")},d=vi(xi,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[vi(xi,{sx:{color:"#37352f",lineHeight:1.7},children:["\uB0B4\uAC00 \uAD00\uC5EC\uD55C \uC5C5\uBB34\uB97C ",Tr("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C ",t.name,"\uC5D0\uC11C \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4."]}),b===0?vi(xi,{sx:{color:"#8a6d1d",bgcolor:"#faf1d7",borderRadius:1,px:1.5,py:1.25,lineHeight:1.7},children:["\uC9C0\uAE08\uC740 \uCE98\uB9B0\uB354\uC5D0 \uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",Tr("br",{}),Tr("b",{children:"\uB9C8\uAC10\uC77C\uC2DC\uAC00 \uC788\uB294 \uB0B4 \uC5C5\uBB34 \uB610\uB294 \uBCF4\uB0B8\uC5C5\uBB34"}),"\uAC00 \uC0DD\uAE30\uBA74"," ",h.subscribed?`${t.name}\uC5D0 \uC790\uB3D9\uC73C\uB85C \uD45C\uC2DC\uB429\uB2C8\uB2E4.`:"\uC5EC\uAE30\uC11C \uAD6C\uB3C5\uC744 \uC2DC\uC791\uD558\uC138\uC694."]}):h.subscribed&&h.enabled?vi(f6,{children:[Tr(l6,{value:c,fullWidth:!0,label:"\uB0B4 \uD53C\uB4DC \uC8FC\uC18C",slotProps:{input:{readOnly:!0}}}),vi(xi,{sx:{display:"flex",gap:2},children:[Tr(Hs,{variant:"outlined",startIcon:Tr(u6,{}),onClick:i,children:"\uC8FC\uC18C \uBCF5\uC0AC"}),t.buildSubscribeUrl?vi(Hs,{variant:"contained",startIcon:Tr(sm,{}),onClick:a,children:[t.name,"\uC5D0 \uCD94\uAC00"]}):null]}),vi(xi,{sx:{bgcolor:"#f2f6fa",borderRadius:1,px:1.5,py:1.25,fontSize:15,lineHeight:1.8,display:"flex",flexDirection:"column",gap:.25,"& > div":{display:"flex",gap:1},"& > div::before":{content:'"\u2022"',flexShrink:0}},children:[t.subscribeSteps.map(f=>Tr(xi,{children:Tr("span",{children:Tr(qs,{text:f})})},f)),Tr(xi,{children:Tr("span",{children:"\uC774 \uC8FC\uC18C\uB294 \uBCF8\uC778 \uC804\uC6A9\uC785\uB2C8\uB2E4. \uACF5\uC720\uD558\uBA74 \uB0B4 \uC5C5\uBB34 \uC77C\uC815\uC774 \uB178\uCD9C\uB429\uB2C8\uB2E4."})})]})]}):Tr(Hs,{variant:"contained",onClick:s,sx:{alignSelf:"flex-start"},children:"\uAD6C\uB3C5 \uC2DC\uC791 (\uD53C\uB4DC \uBC1C\uAE09)"})]});return Tr(c6,{open:e,onClose:r,width:680,title:`${t.name}\uB85C \uB0B4\uBCF4\uB0B4\uAE30`,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-calendar-subscribe",sections:[{id:"calendar-subscribe",showTitle:!1,children:d}],actions:{showCancelButton:!1,left:Tr(Hs,{variant:"outlined",startIcon:Tr(sm,{sx:{fontSize:16}}),onClick:()=>window.open(t.homeUrl,"_blank"),children:t.name}),right:Tr(Hs,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})}})}import{useEffect as h6,useMemo as Ku,useState as Gu}from"react";import{Box as Ws,Button as p6,Typography as m6}from"@mui/material";import{FormDialog as g6}from"@ehfuse/mui-form-dialog";import{SearchTextField as b6}from"@ehfuse/mui-form-controls";import{TreeView as y6}from"@ehfuse/tree-view";import{Fragment as S6,jsx as On,jsxs as T6}from"react/jsx-runtime";function lm(e){return`${e.name}#${e.seq}`}function x6(e){return Number(e.slice(e.lastIndexOf("#")+1))||0}function v6(e){let h=[],b=l=>{for(let o of l.employees??[])h.push(o);for(let o of l.groups??[])b(o)};for(let l of e)b(l);return h}function w6(e,h){return h?[e.name,e.department,e.role_name,e.work_position].filter(Boolean).some(b=>String(b).toLowerCase().includes(h)):!0}function _6(e){let h=[[e.name,e.role_name].filter(Boolean).join(" "),e.department].filter(Boolean).join(" / ");return{id:`emp:${e.seq}`,label:lm(e),renderLabel:On(Ws,{component:"span",sx:{display:"inline-flex",alignItems:"baseline",gap:.75},children:On(Ws,{component:"span",sx:{fontWeight:400,color:"text.primary"},children:h})})}}function cm(e,h){let b=(e.groups??[]).map(o=>cm(o,h)).filter(o=>o!==null),l=(e.employees??[]).filter(o=>w6(o,h)).map(_6);return b.length===0&&l.length===0?null:{id:`group:${e.key}`,label:e.name,children:[...b,...l]}}function k6({groups:e,allEmployees:h,initialSelectedSeqs:b,multiple:l,isMobile:o,onSelectionChange:s}){let[r,t]=Gu(""),n=Ku(()=>e.map(i=>cm(i,r.trim().toLowerCase())).filter(i=>i!==null),[e,r]),c=Ku(()=>h.filter(i=>b.includes(i.seq)).map(lm),[]);return T6(S6,{children:[On(Ws,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:On(b6,{size:"small",fullWidth:!0,placeholder:"\uC774\uB984, \uBD80\uC11C \uAC80\uC0C9",onSearch:t,onClear:()=>t(""),sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),On(Ws,{sx:o?{display:"flex",flexDirection:"column"}:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:On(y6,{items:n,checkbox:!0,multiSelect:l,selectionMode:"child",showSearch:!1,defaultExpanded:!0,initialSelections:c,onChange:i=>s(i.map(x6).filter(a=>a>0)),styles:{border:"none",borderRadius:"0"}})})]})}function c$({open:e,title:h="\uC9C1\uC6D0 \uC120\uD0DD",hint:b="",groups:l,multiple:o=!1,selectedSeqs:s,confirmText:r="\uD655\uC778",onConfirm:t,onClose:n}){let c=Nt(),[i,a]=Gu([]),[d,f]=Gu(0),u=Ku(()=>v6(l),[l]),g=s??[];h6(()=>{e&&(a(g),f(x=>x+1))},[e]);let m=()=>{let x=u.filter(_=>i.includes(_.seq));t(o?x:x.slice(0,1)),n()};return On(g6,{open:e,onClose:n,title:`${h}${o&&i.length>0?` (${i.length}\uBA85)`:""}`,locale:"ko",fullScreen:c,mobilePresentation:c?"slide":"dialog",draggable:!0,width:"600px",tabs:{visible:!1},titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},scrollPastLastSection:!1,sectionContentPaddingTop:0,fontScale:{enabled:!0},fontScaleKey:"taskbox-employee-select",sections:[{id:"employee-select",title:"\uC9C1\uC6D0 \uC120\uD0DD",showTitle:!1,children:On(Ws,{sx:{...c?{}:{height:560},display:"flex",flexDirection:"column",border:"1px solid #cccccc",borderRadius:1,...c?{}:{overflow:"hidden"},userSelect:"none"},children:On(k6,{groups:l,allEmployees:u,initialSelectedSeqs:g,multiple:o,isMobile:c,onSelectionChange:a},d)})}],dialogActionSx:{"@media (max-width:1023.95px)":{gap:"0.75rem !important","& .left-actions":{flex:1,minWidth:0},"& .right-actions":{flex:1}}},actions:{visible:!0,showCancelButton:!1,left:b?On(m6,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"pre-line",lineHeight:1.35},children:b}):void 0,right:On(p6,{variant:"contained",onClick:m,children:r})}})}import{useEffect as Yk,useMemo as Wm,useState as Zs}from"react";import{Box as Mo,Button as Um}from"@mui/material";import{FormDialog as Xk}from"@ehfuse/mui-form-dialog";import{LabelSelect as od}from"@ehfuse/mui-form-controls";import Zk from"@mui/icons-material/SpeedOutlined";import{useEffect as C6,useState as B6}from"react";import{Box as Qr,Button as I6}from"@mui/material";import{FormDialog as E6}from"@ehfuse/mui-form-dialog";import{LabelSelect as M6,NumberField as um}from"@ehfuse/mui-form-controls";import R6 from"@ehfuse/overlay-scrollbar";import{jsx as Wr,jsxs as Us}from"react/jsx-runtime";var O6=[{value:"count",label:"\uBBF8\uC644\uB8CC \uAC74\uC218"},{value:"points",label:"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8"}];function dm({open:e,capacity:h,employees:b,onClose:l,onSave:o}){let[s,r]=B6(h??io);C6(()=>{e&&r(h??io)},[e,h]);let t=s.basis==="points"?"SP":"\uAC74",n=(c,i)=>{let a=Math.max(0,Math.floor(Number(i)||0));r(d=>{let f={...d.by_account};return a>0?f[c]=a:delete f[c],{...d,by_account:f}})};return Wr(E6,{open:e,onClose:l,maxWidth:"sm",title:"\uC778\uC6D0 \uC6A9\uB7C9",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-workload-capacity",tabs:{visible:!1},actions:{showCancelButton:!0,right:Wr(I6,{variant:"contained",onClick:()=>{o(s)},children:"\uC800\uC7A5"})},sectionContentPaddingTop:0,sections:[{id:"capacity",title:"",showTitle:!1,children:Us(Qr,{sx:{display:"flex",flexDirection:"column",gap:2},children:[Wr(Qr,{sx:{fontSize:15,color:"#37352f"},children:"\uD55C \uC0AC\uB78C\uC774 \uB3D9\uC2DC\uC5D0 \uC548\uC744 \uC218 \uC788\uB294 \uC591\uC744 \uC815\uD569\uB2C8\uB2E4. \uC774 \uAC12\uC744 \uB118\uAE30\uBA74 \uC6CC\uD06C\uB85C\uB4DC \uCC28\uD2B8\uC5D0\uC11C \uBD89\uAC8C \uD45C\uC2DC\uB429\uB2C8\uB2E4. 0 \uC73C\uB85C \uB450\uBA74 \uC6A9\uB7C9\uC744 \uC4F0\uC9C0 \uC54A\uACE0 \uD300 \uD3C9\uADE0\uC744 \uAE30\uC900\uC73C\uB85C \uBD05\uB2C8\uB2E4."}),Us(Qr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Wr(Qr,{sx:{width:104,flexShrink:0,fontSize:16,color:"#37352f"},children:"\uC138\uB294 \uB2E8\uC704"}),Wr(M6,{size:"medium",fullWidth:!0,label:"",value:s.basis,options:O6,onChange:c=>r(i=>({...i,basis:c.target.value}))})]}),Us(Qr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Wr(Qr,{sx:{width:104,flexShrink:0,fontSize:16,color:"#37352f"},children:"\uAE30\uBCF8 \uC6A9\uB7C9"}),Wr(um,{size:"medium",fullWidth:!0,min:0,max:999,thousandSeparator:!1,align:"right",suffix:t,value:s.default_capacity,onValueChange:c=>r(i=>({...i,default_capacity:Math.max(0,Math.floor(Number(c)||0))}))})]}),Wr(Qr,{sx:{pl:"119px",mt:-1.25,fontSize:13.5,color:"#37352f"},children:`\uC804\uC6D0 \uACF5\uD1B5 \uAE30\uC900(${t}) \xB7 0 = \uC6A9\uB7C9 \uC548 \uC500`}),Wr(Qr,{sx:{fontSize:16,fontWeight:700,color:"#37352f"},children:"\uC0AC\uB78C\uBCC4 \uC608\uC678"}),b.length===0?Wr(Qr,{sx:{fontSize:15,color:"#787774"},children:"\uC9C1\uC6D0 \uBAA9\uB85D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. \uAE30\uBCF8 \uC6A9\uB7C9\uB9CC \uC801\uC6A9\uB429\uB2C8\uB2E4."}):Wr(Qr,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:Wr(R6,{style:{maxHeight:260},thumb:{width:6},children:b.filter(c=>Number(c.account_seq)>0).map(c=>Us(Qr,{sx:{display:"flex",alignItems:"center",gap:1.5,px:2,py:1,borderBottom:"1px solid #f2f2f0","&:last-of-type":{borderBottom:"none"}},children:[Us(Qr,{sx:{flex:1,minWidth:0,fontSize:16,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[c.name,c.department?Wr(Qr,{component:"span",sx:{ml:1,fontSize:14,color:"#787774"},children:c.department}):null]}),Wr(Qr,{sx:{width:132,flexShrink:0},children:Wr(um,{size:"small",fullWidth:!0,min:0,max:999,thousandSeparator:!1,align:"right",suffix:t,clearWhenZero:!0,value:s.by_account[Number(c.account_seq)]??0,onValueChange:i=>n(Number(c.account_seq),String(i??""))})})]},c.account_seq))})})]})}]})}import{Box as Pl}from"@mui/material";import{Bar as N6,BarChart as L6,CartesianGrid as j6,Cell as z6,ReferenceLine as F6,ResponsiveContainer as q6,Tooltip as $6,XAxis as H6,YAxis as W6}from"recharts";import{Box as A6}from"@mui/material";import{jsx as D6}from"react/jsx-runtime";function Ur({text:e,height:h}){return D6(A6,{sx:{display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",fontSize:14.5,color:"#9a9a97",...typeof h=="number"?{height:h,minHeight:120}:{position:"absolute",inset:0,pointerEvents:"none"}},children:e})}import{createElement as P6}from"react";var Dl="#2f80ed",fm="#a9c9f5",wi="#9a9a97",Yu="#2e9e6b",Jn="#3d7eff",Xu="#c3c8ce",Vs="#f2a30f",Ks={contentStyle:{fontSize:13.5,color:"#37352f",border:"1px solid #e6e6e3",borderRadius:6},labelStyle:{fontSize:13.5,color:"#37352f",fontWeight:700},itemStyle:{fontSize:13.5}},es={...Ks,cursor:!1},ts={wrapperStyle:{fontSize:13.5,paddingTop:10},formatter:e=>P6("span",{style:{paddingRight:14,color:"#37352f"}},e)};function fr(e){return{display:"flex",flexDirection:"column",minHeight:0,position:"relative",...typeof e=="string"?{flex:1}:{}}}var Dr={flexShrink:0,mb:1.5,display:"flex",alignItems:"center",gap:2,flexWrap:"wrap"};function Qn(e){return{"& *":{outline:"none"},userSelect:"none",...typeof e=="number"?{height:e,flexShrink:0}:{flex:1,minHeight:0}}}import{jsx as An,jsxs as Gs}from"react/jsx-runtime";function U6(e,h){let b=h.filter(l=>l.sprint_seq===e.seq&&!l.archived&&l.completed);return{points:b.reduce((l,o)=>l+(o.story_points??0),0),count:b.length}}function hm({sprints:e,tasks:h,height:b=200}){let o=[...e].sort((i,a)=>`${i.start_date}|${i.seq}`.localeCompare(`${a.start_date}|${a.seq}`)).map(i=>({sprint:i,...U6(i,h)})),s=o.some(i=>i.points>0),r=s?"SP":"\uAC74",t=o.filter(i=>i.sprint.status==="closed").map(i=>s?i.points:i.count),n=t.length>0?Math.round(t.reduce((i,a)=>i+a,0)/t.length*10)/10:null,c=o.map(i=>({\uBAA9\uD45C:`${i.sprint.name}${i.sprint.status!=="closed"?" (\uC9C4\uD589\uC911)":""}`,\uC644\uB8CC:s?i.points:i.count,closed:i.sprint.status==="closed"}));return o.length===0?An(Ur,{text:"\uD45C\uC2DC\uD560 \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:b}):Gs(Pl,{sx:fr(b),children:[Gs(Pl,{sx:{flexShrink:0,mb:1,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Gs("span",{children:["\uC644\uB8CC ",s?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uBAA9\uD45C\uBCC4"]}),n!==null?Gs("span",{children:["\uD3C9\uADE0(\uC885\uB8CC \uBAA9\uD45C)"," ",An(Pl,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:n}),r]}):null]}),An(Pl,{sx:Qn(b),children:An(q6,{width:"100%",height:"100%",children:Gs(L6,{data:c,margin:{top:8,right:12,left:0,bottom:0},barCategoryGap:"28%",children:[An(j6,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),An(H6,{dataKey:"\uBAA9\uD45C",tick:{fontSize:13},tickMargin:6,interval:0}),An(W6,{tick:{fontSize:13},width:40,allowDecimals:!1}),An($6,{...es,formatter:i=>`${Number(i??0)}${r}`}),n!==null?An(F6,{y:n,stroke:wi,strokeDasharray:"6 5",label:{value:`\uD3C9\uADE0 ${n}${r}`,position:"right",fontSize:13}}):null,An(N6,{dataKey:"\uC644\uB8CC",radius:[4,4,0,0],children:c.map(i=>An(z6,{fill:i.closed?Dl:fm},i.\uBAA9\uD45C))})]})})})]})}import{useMemo as V6}from"react";import{Box as eo}from"@mui/material";import{CartesianGrid as K6,Line as pm,LineChart as G6,ResponsiveContainer as Y6,Tooltip as X6,XAxis as Z6,YAxis as J6}from"recharts";import{jsx as en,jsxs as Xo}from"react/jsx-runtime";function mm(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?new Date(`${e}T00:00:00`):null}function Q6(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function ek(e){return e.slice(5).replace("-",".")}function gm({sprint:e,tasks:h,todayStr:b,height:l=200,headerLeft:o}){let s=V6(()=>{let a=mm(e.start_date),d=mm(e.end_date);if(!a||!d||d<a||Math.round((d.getTime()-a.getTime())/864e5)+1>366)return null;let u=h.filter(P=>P.sprint_seq===e.seq&&!P.archived);if(u.length===0)return{empty:!0};let g=u.some(P=>(P.story_points??0)>0),m=P=>g?P.story_points??0:1,x=u.reduce((P,N)=>P+m(N),0),_=new Map;for(let P of u){if(!P.completed)continue;let N=(P.completed_time??"").slice(0,10),q=/^\d{4}-\d{2}-\d{2}$/.test(N)?N:e.start_date;_.set(q,(_.get(q)??0)+m(P))}let B=[];for(let P=new Date(a);P<=d;P.setDate(P.getDate()+1))B.push(Q6(P));let A=x,j=x;return{empty:!1,data:B.map((P,N)=>{let q=B.length===1?0:x*(1-N/(B.length-1));return P<=b&&(A-=_.get(P)??0,j=Math.max(0,A)),{\uB0A0\uC9DC:ek(P),\uC774\uC0C1:Math.round(q*10)/10,\uB0A8\uC740\uB7C9:P<=b?Math.max(0,A):null}}),total:x,usePoints:g,last:j}},[e,h,b]);if(!s)return Xo(eo,{sx:fr(l),children:[o?en(eo,{sx:Dr,children:o}):null,en(Ur,{text:"\uBAA9\uD45C\uC758 \uC2DC\uC791\uC77C\xB7\uC885\uB8CC\uC77C\uC774 \uC788\uC5B4\uC57C \uBC88\uB2E4\uC6B4\uC744 \uADF8\uB9B4 \uC218 \uC788\uC2B5\uB2C8\uB2E4.",height:l})]});if(s.empty)return Xo(eo,{sx:fr(l),children:[o?en(eo,{sx:Dr,children:o}):null,en(Ur,{text:"\uBC30\uC815\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})]});let{data:r,total:t,usePoints:n,last:c}=s,i=n?"SP":"\uAC74";return Xo(eo,{sx:fr(l),children:[Xo(eo,{sx:Dr,children:[o?en(eo,{sx:{flexShrink:0},children:o}):null,Xo(eo,{sx:{flex:1,minWidth:220,display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Xo("span",{children:["\uB0A8\uC740 ",n?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uCD1D ",t]}),Xo("span",{children:["\uD604\uC7AC"," ",en(eo,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:c}),i," \uB0A8\uC74C"]})]})]}),en(eo,{sx:Qn(l),children:en(Y6,{width:"100%",height:"100%",children:Xo(G6,{data:r,margin:{top:8,right:12,left:0,bottom:0},children:[en(K6,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),en(Z6,{dataKey:"\uB0A0\uC9DC",tick:{fontSize:13},tickMargin:6,minTickGap:24}),en(J6,{tick:{fontSize:13},width:40,allowDecimals:!1}),en(X6,{...Ks,formatter:a=>`${Number(a??0)}${i}`}),en(pm,{type:"linear",dataKey:"\uC774\uC0C1",stroke:wi,strokeDasharray:"6 5",strokeWidth:1.5,dot:!1}),en(pm,{type:"monotone",dataKey:"\uB0A8\uC740\uB7C9",stroke:Dl,strokeWidth:2.5,dot:!1,connectNulls:!1})]})})})]})}import{useMemo as km}from"react";import{Box as to}from"@mui/material";import{Area as Qu,AreaChart as ok,CartesianGrid as ik,Legend as sk,ResponsiveContainer as ak,Tooltip as lk,XAxis as ck,YAxis as uk}from"recharts";function Io(e){let h=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${h(e.getMonth()+1)}-${h(e.getDate())}`}function Nl(e,h=new Date){let b=new Date(h);return b.setMonth(b.getMonth()-e),b}function j$(e=new Date){return{fromDate:Io(Nl(1,e)),toDate:Io(e)}}var Ju=864e5,Ys=[0,1,2,3,5,8,13,21];function xm(e){return!e.archived&&!e.linked_only&&!e.is_notice&&!e.is_event}function Zu(e){let h=String(e??"").trim(),b=/^(\d{4}-\d{2}-\d{2})(?:[ T](\d{2}:\d{2}))?/.exec(h);if(!b)return null;let l=new Date(`${b[1]}T${b[2]??"00:00"}:00`).getTime();return Number.isNaN(l)?null:l}function rs(e){let h=String(e??"").trim();return/^\d{4}-\d{2}-\d{2}/.test(h)?h.slice(0,10):""}function tk(e){let h=rs(e.created_time)||rs(e.start_date)||rs(e.completed_time);if(!h)return null;let b=rs(e.start_date),l=b&&b>h?b:h,o=e.completed?rs(e.completed_time)||h:"";return{created:h,started:l,done:o}}function vm(e,h){let b=/^\d{4}-\d{2}-\d{2}$/.test(h)?new Date(`${h}T00:00:00`):new Date,l=Math.max(2,Math.min(366,Math.round(e))),o=[];for(let s=l-1;s>=0;s-=1)o.push(Io(new Date(b.getTime()-s*Ju)));return o}function wm(e,h,b){let l=vm(h,b),o=e.filter(xm).map(tk).filter(n=>n!==null),s=l.map(n=>{let c=0,i=0,a=0;for(let d of o)d.created>n||(d.done&&d.done<=n?c+=1:d.started<=n?i+=1:a+=1);return{day:n,done:c,inProgress:i,waiting:a}}),r=s[s.length-1],t=s.reduce((n,c)=>Math.max(n,c.done+c.inProgress+c.waiting),0);return{points:s,max:t,currentWip:r?.inProgress??0,currentTotal:r?r.done+r.inProgress+r.waiting:0,currentDone:r?.done??0}}function rk(e,h){if(e.length===0)return 0;let b=Math.min(e.length-1,Math.max(0,Math.ceil(e.length*h)-1));return e[b]}function bm(e){if(e.length===0)return null;let h=[...e].sort((s,r)=>s-r),b=s=>Math.round(s*10)/10,l=Math.floor(h.length/2),o=h.length%2===1?h[l]:(h[l-1]+h[l])/2;return{count:h.length,median:b(o),average:b(h.reduce((s,r)=>s+r,0)/h.length),p85:b(rk(h,.85))}}function ym(e){for(let h=Ys.length-1;h>=0;h-=1)if(e>=Ys[h])return h;return 0}function nk(){return Ys.map((e,h)=>h===Ys.length-1?`${e}\uC77C+`:`${e}~${Ys[h+1]}\uC77C`)}function _m(e,h,b){let l=vm(h,b),o=l[0],s=l[l.length-1],r=nk(),t=r.map(()=>0),n=r.map(()=>0),c=[],i=[];for(let a of e){if(!xm(a)||!a.completed)continue;let d=rs(a.completed_time);if(!d||d<o||d>s)continue;let f=Zu(a.completed_time),u=Zu(a.created_time);if(f===null||u===null)continue;let g=Math.max(0,(f-u)/Ju);c.push(g),t[ym(g)]+=1;let m=Zu(a.start_date);if(m===null||m>f)continue;let x=Math.max(0,(f-Math.max(m,u))/Ju);i.push(x),n[ym(x)]+=1}return{labels:r,leadCounts:t,cycleCounts:n,lead:bm(c),cycle:bm(i)}}import{jsx as Vr,jsxs as Zo}from"react/jsx-runtime";function dk(e){return e.slice(5).replace("-",".")}function Sm({tasks:e,todayStr:h,days:b=30,height:l=220,headerLeft:o}){let s=km(()=>wm(e,b,h),[e,b,h]),r=km(()=>s.points.map(n=>({\uB0A0\uC9DC:dk(n.day),\uC644\uB8CC:n.done,\uC9C4\uD589:n.inProgress,\uB300\uAE30:n.waiting})),[s]),t=Zo(to,{sx:Dr,children:[o?Vr(to,{sx:{flexShrink:0},children:o}):null,Zo(to,{sx:{flex:1,minWidth:220,display:"flex",flexDirection:"column",gap:.5},children:[Zo(to,{sx:{display:"flex",justifyContent:"space-between",flexWrap:"wrap",gap:1,fontSize:14,color:"#000"},children:[Zo("span",{children:["\uCD5C\uADFC ",s.points.length,"\uC77C \u2014 \uC811\uC218 ",s.currentTotal,"\uAC74 / \uC644\uB8CC ",s.currentDone,"\uAC74"]}),Zo("span",{children:["\uC9C4\uD589 \uC911"," ",Vr(to,{component:"span",sx:{color:Jn,fontWeight:700},children:s.currentWip}),"\uAC74"]})]}),Vr(to,{sx:{fontSize:13.5,color:"#37352f"},children:"\uB760\uAC00 \uB450\uAEBC\uC6CC\uC9C0\uBA74 \uC77C\uC774 \uC313\uC774\uB294 \uC911, \uC587\uC544\uC9C0\uBA74 \uCC98\uB9AC\uB418\uB294 \uC911\uC785\uB2C8\uB2E4."})]})]});return r.length===0||s.max===0?Zo(to,{sx:fr(l),children:[o?Vr(to,{sx:Dr,children:o}):null,Vr(Ur,{text:"\uC774 \uAE30\uAC04\uC5D0 \uC811\uC218\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})]}):Zo(to,{sx:fr(l),children:[t,Vr(to,{sx:Qn(l),children:Vr(ak,{width:"100%",height:"100%",children:Zo(ok,{data:r,margin:{top:8,right:12,left:0,bottom:4},children:[Vr(ik,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),Vr(ck,{dataKey:"\uB0A0\uC9DC",tick:{fontSize:13},tickMargin:6,minTickGap:24}),Vr(uk,{tick:{fontSize:13},width:40,allowDecimals:!1}),Vr(lk,{...Ks,formatter:n=>`${Number(n??0)}\uAC74`}),Vr(sk,{...ts}),Vr(Qu,{type:"monotone",dataKey:"\uC644\uB8CC",stackId:"flow",stroke:Yu,fill:Yu,fillOpacity:.9}),Vr(Qu,{type:"monotone",dataKey:"\uC9C4\uD589",stackId:"flow",stroke:Jn,fill:Jn,fillOpacity:.85}),Vr(Qu,{type:"monotone",dataKey:"\uB300\uAE30",stackId:"flow",stroke:Xu,fill:Xu,fillOpacity:.9})]})})})]})}import{useMemo as Tm}from"react";import{Box as tn}from"@mui/material";import{Bar as Cm,BarChart as fk,CartesianGrid as hk,Legend as pk,ResponsiveContainer as mk,Tooltip as gk,XAxis as bk,YAxis as yk}from"recharts";import{jsx as vr,jsxs as xn}from"react/jsx-runtime";function Bm({label:e,color:h,summary:b}){let l=xn(tn,{sx:{display:"flex",alignItems:"center",gap:.75},children:[vr(tn,{sx:{width:10,height:10,borderRadius:.5,bgcolor:h,flexShrink:0}}),vr(tn,{component:"span",sx:{fontWeight:700,color:"#37352f"},children:e})]});return b?xn(tn,{sx:{display:"contents"},children:[l,xn("span",{children:[b.count,"\uAC74"]}),xn("span",{children:["\uC911\uC559\uAC12"," ",vr(tn,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:b.median}),"\uC77C"]}),xn("span",{children:["\uD3C9\uADE0 ",b.average,"\uC77C"]}),xn("span",{children:["85% ",b.p85,"\uC77C \uC774\uB0B4"]})]}):xn(tn,{sx:{display:"contents"},children:[l,vr(tn,{component:"span",sx:{gridColumn:"span 4",color:"#9a9a97"},children:"\uD45C\uBCF8 \uC5C6\uC74C"})]})}function Im({tasks:e,todayStr:h,days:b=30,height:l=200,headerLeft:o}){let s=Tm(()=>_m(e,b,h),[e,b,h]),r=Tm(()=>s.labels.map((t,n)=>({\uAD6C\uAC04:t,\uB9AC\uB4DC\uD0C0\uC784:s.leadCounts[n],\uC0AC\uC774\uD074\uD0C0\uC784:s.cycleCounts[n]})),[s]);return s.lead?xn(tn,{sx:fr(l),children:[xn(tn,{sx:Dr,children:[o?vr(tn,{sx:{flexShrink:0},children:o}):null,xn(tn,{sx:{flex:1,minWidth:260,display:"grid",gridTemplateColumns:"max-content max-content max-content max-content max-content",justifyContent:"start",alignItems:"center",columnGap:3,rowGap:.5,fontSize:14,color:"#000"},children:[vr(Bm,{label:"\uB9AC\uB4DC\uD0C0\uC784(\uC791\uC131\u2192\uC644\uB8CC)",color:Jn,summary:s.lead}),vr(Bm,{label:"\uC0AC\uC774\uD074\uD0C0\uC784(\uC2DC\uC791\u2192\uC644\uB8CC)",color:Vs,summary:s.cycle})]})]}),vr(tn,{sx:Qn(l),children:vr(mk,{width:"100%",height:"100%",children:xn(fk,{data:r,margin:{top:8,right:12,left:0,bottom:4},barCategoryGap:"24%",children:[vr(hk,{strokeDasharray:"3 3",stroke:"#e6e6e3"}),vr(bk,{dataKey:"\uAD6C\uAC04",tick:{fontSize:13},tickMargin:6,interval:0}),vr(yk,{tick:{fontSize:13},width:40,allowDecimals:!1}),vr(gk,{...es,formatter:t=>`${Number(t??0)}\uAC74`}),vr(pk,{...ts}),vr(Cm,{dataKey:"\uB9AC\uB4DC\uD0C0\uC784",fill:Jn,radius:[3,3,0,0]}),vr(Cm,{dataKey:"\uC0AC\uC774\uD074\uD0C0\uC784",fill:Vs,radius:[3,3,0,0]})]})})})]}):xn(tn,{sx:fr(l),children:[o?vr(tn,{sx:Dr,children:o}):null,vr(Ur,{text:"\uC774 \uAE30\uAC04\uC5D0 \uC644\uB8CC\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})]})}import{useMemo as Om}from"react";import{Box as _i}from"@mui/material";import{Bar as td,BarChart as kk,CartesianGrid as Sk,Cell as Tk,Legend as Ck,ReferenceLine as Am,ResponsiveContainer as Bk,Tooltip as Ik,XAxis as Ek,YAxis as Mk}from"recharts";function xk(e,h){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||!/^\d{4}-\d{2}-\d{2}$/.test(h))return null;let b=new Date(`${e}T00:00:00`).getTime(),l=new Date(`${h}T00:00:00`).getTime();return Number.isNaN(b)||Number.isNaN(l)?null:Math.round((l-b)/864e5)}function vk(e,h,b){let l=String(e.due_date??"").slice(0,10),o=xk(h,l);return o===null?"later":o<0?"overdue":o<=b?"soon":"later"}function Ll(e,h){let{todayStr:b,soonDays:l=7,includeUnassigned:o=!0,limit:s,capacity:r}=h,t=r??io,n=new Map;for(let i of e){if(i.completed||i.archived||i.is_notice||i.is_event||i.linked_only)continue;let a=Number(i.manager_account_seq??0);if(!a&&!o)continue;let d=a?String(i.manager_name??"").trim()||"\uC774\uB984 \uC5C6\uC74C":"\uBBF8\uBC30\uC815",f=n.get(a)??{accountSeq:a,name:d,overdue:0,soon:0,later:0,total:0,points:0,capacity:0,load:0,ratio:0};f[vk(i,b,l)]+=1,f.total+=1,f.points+=Number(i.story_points??0)||0,n.set(a,f)}for(let i of n.values())i.capacity=wk(i.accountSeq,t),i.load=t.basis==="points"?i.points:i.total,i.ratio=i.capacity>0?i.load/i.capacity:0;let c=[...n.values()].sort((i,a)=>i.accountSeq===0!=(a.accountSeq===0)?i.accountSeq===0?1:-1:i.overdue!==a.overdue?a.overdue-i.overdue:i.total!==a.total?a.total-i.total:i.name.localeCompare(a.name));return typeof s=="number"&&s>0?c.slice(0,s):c}function jl(e,h){return e.filter(b=>b.completed||b.archived||b.is_notice||b.is_event||b.linked_only?!1:Number(b.manager_account_seq??0)===h).sort((b,l)=>{let o=String(b.due_date??"").slice(0,10),s=String(l.due_date??"").slice(0,10);return!o!=!s?o?-1:1:o!==s?o.localeCompare(s):String(b.title??"").localeCompare(String(l.title??""))})}function wk(e,h){if(!(e>0))return 0;let b=Math.max(0,Math.floor(Number(h.by_account?.[e])||0));return b>0?b:Math.max(0,Math.floor(Number(h.default_capacity)||0))}function zl(e){return e.capacity>0&&e.load>e.capacity}function Em(e,h){return h>0&&e.total>=h}function Mm(e){let h=e.filter(b=>b.accountSeq>0);return h.length===0?0:h.reduce((b,l)=>b+l.total,0)/h.length}function ed(e,h){let b=new Date(`${e}T00:00:00`);b.setDate(b.getDate()+h);let l=o=>String(o).padStart(2,"0");return`${b.getFullYear()}-${l(b.getMonth()+1)}-${l(b.getDate())}`}function _k(e){let h=new Date(`${e}T00:00:00`);if(Number.isNaN(h.getTime()))return e;let b=(h.getDay()+6)%7;return ed(e,-b)}function Rm(e,h){let{todayStr:b,includeUnassigned:l=!0,weeks:o=6,limit:s}=h,r=_k(b),t=Array.from({length:Math.max(1,o)},(f,u)=>{let g=ed(r,u*7),m=ed(g,6),[,x,_]=g.split("-");return{start:g,end:m,label:`${Number(x)}/${Number(_)}`,isCurrent:u===0}}),n=t[t.length-1].end,c=new Map;for(let f of e){if(f.completed||f.archived||f.is_notice||f.is_event||f.linked_only)continue;let u=Number(f.manager_account_seq??0);if(!u&&!l)continue;let g=u?String(f.manager_name??"").trim()||"\uC774\uB984 \uC5C6\uC74C":"\uBBF8\uBC30\uC815",m=c.get(u)??{accountSeq:u,name:g,overdue:0,byWeek:new Array(t.length).fill(0),noDue:0,total:0,beyond:0},x=String(f.due_date??"").slice(0,10);if(m.total+=1,!/^\d{4}-\d{2}-\d{2}$/.test(x))m.noDue+=1;else if(x<b)m.overdue+=1;else if(x>n)m.beyond+=1;else{let _=t.findIndex(B=>x>=B.start&&x<=B.end);_>=0?m.byWeek[_]+=1:m.beyond+=1}c.set(u,m)}let i=[...c.values()].sort((f,u)=>f.accountSeq===0!=(u.accountSeq===0)?f.accountSeq===0?1:-1:f.overdue!==u.overdue?u.overdue-f.overdue:f.total!==u.total?u.total-f.total:f.name.localeCompare(u.name)),a=typeof s=="number"&&s>0?i.slice(0,s):i,d=a.reduce((f,u)=>Math.max(f,u.overdue,u.noDue,...u.byWeek),0);return{weeks:t,rows:a,maxCell:d}}import{Fragment as Dm,jsx as wr,jsxs as Jo}from"react/jsx-runtime";var Xs="#e5484d";function Pm({tasks:e,todayStr:h,soonDays:b=7,overloadThreshold:l=0,capacity:o=io,height:s=200,headerLeft:r,selectedAccountSeq:t=0,onSelectPerson:n}){let c=Om(()=>Ll(e,{todayStr:h,soonDays:b,capacity:o}),[e,h,b,o]),i=Om(()=>Mm(c),[c]),a=l>0?l:Math.max(3,Math.ceil(i*1.5)),d=o.default_capacity>0||Object.keys(o.by_account).length>0,f=o.basis==="points"?"SP":"\uAC74",u=c.filter(g=>g.accountSeq>0&&(d?zl(g):Em(g,a))).length;return c.length===0?Jo(_i,{sx:fr(s),children:[r?wr(_i,{sx:Dr,children:r}):null,wr(Ur,{text:"\uB2F4\uB2F9\uC790\uAC00 \uC9C0\uC815\uB41C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:s})]}):Jo(_i,{sx:fr(s),children:[Jo(_i,{sx:Dr,children:[r,Jo(_i,{sx:{fontSize:13.5,color:"#37352f"},children:["1\uC778 \uD3C9\uADE0 ",wr("b",{children:i.toFixed(1)}),"\uAC74 \xB7"," ",d?Jo(Dm,{children:["\uC6A9\uB7C9 ",wr("b",{children:o.default_capacity||"\uAC1C\uC778\uBCC4"}),o.default_capacity?f:""]}):Jo(Dm,{children:["\uACFC\uBD80\uD558 \uAE30\uC900 ",wr("b",{children:a}),"\uAC74"]}),u>0?Jo(_i,{component:"span",sx:{ml:1,color:Xs,fontWeight:700},children:["\uCD08\uACFC ",u,"\uBA85"]}):null]})]}),wr(_i,{sx:Qn(s),children:wr(Bk,{width:"100%",height:"100%",children:Jo(kk,{data:c,layout:"vertical",onClick:n?g=>{let m=c.find(x=>x.name===String(g?.activeLabel??""));m&&n(m.accountSeq===t?0:m.accountSeq)}:void 0,style:n?{cursor:"pointer"}:void 0,margin:{top:4,right:16,bottom:4,left:8},barCategoryGap:c.length>8?4:10,children:[wr(Sk,{strokeDasharray:"3 3",horizontal:!1,stroke:"#eceae6"}),wr(Ek,{type:"number",allowDecimals:!1,tick:{fontSize:12}}),wr(Mk,{type:"category",dataKey:"name",width:84,tick:{fontSize:12},interval:0}),wr(Ik,{...es,formatter:(g,m)=>[`${Number(g)||0}\uAC74`,String(m)],labelFormatter:g=>{let m=c.find(x=>x.name===g);return!m||!(m.capacity>0)?String(g):`${g} \u2014 \uC6A9\uB7C9 ${m.capacity}${f} \uC911 ${m.load} (${Math.round(m.ratio*100)}%)`}}),wr(Ck,{...ts}),i>0?wr(Am,{x:i,stroke:wi,strokeDasharray:"4 4",label:{value:"\uD3C9\uADE0",position:"top",fontSize:11,fill:wi}}):null,o.default_capacity>0?wr(Am,{x:o.default_capacity,stroke:Xs,strokeDasharray:"2 3",label:{value:"\uC6A9\uB7C9",position:"top",fontSize:11,fill:Xs}}):null,wr(td,{dataKey:"overdue",name:"\uC9C0\uC5F0",stackId:"load",fill:Xs}),wr(td,{dataKey:"soon",name:`\uC784\uBC15(${b}\uC77C)`,stackId:"load",fill:Vs}),wr(td,{dataKey:"later",name:"\uC5EC\uC720",stackId:"load",fill:Jn,radius:[0,3,3,0],children:c.map(g=>wr(Tk,{fill:d&&zl(g)?Xs:Jn,fillOpacity:d&&zl(g)?.45:1,stroke:g.accountSeq===t?"#37352f":void 0,strokeWidth:g.accountSeq===t?1.5:0},g.accountSeq))})]})})})]})}import{useEffect as jk,useState as zk}from"react";import{Box as Fk,Button as qk}from"@mui/material";import{FormDialog as $k}from"@ehfuse/mui-form-dialog";import{useState as Rk}from"react";import{Box as hr,Button as Ok,Menu as Ak,MenuItem as Dk}from"@mui/material";import Pk from"@mui/icons-material/PersonOutlineOutlined";import Nk from"@ehfuse/overlay-scrollbar";import{jsx as Cr,jsxs as Eo}from"react/jsx-runtime";var Nm=56,Lm=68,jm=96;function Lk(e){let h=String(e.due_date??"").slice(0,10);return h?h.slice(5).replace("-","/"):"-"}function zm(e,h){let b=String(e.due_date??"").slice(0,10);return!!b&&b<h}function Fm({tasks:e,row:h,todayStr:b,employees:l,rows:o,height:s=200,hideSummary:r=!1,onChangeManager:t,onOpenTask:n}){let[c,i]=Rk(null),a=jl(e,h.accountSeq),d=f=>o.find(u=>u.accountSeq===f)?.total??0;return Eo(hr,{sx:{display:"flex",flexDirection:"column",minHeight:0,height:s},children:[r?null:Eo(hr,{sx:{display:"flex",alignItems:"center",gap:1,px:.5,pb:.75,fontSize:14,color:"#37352f"},children:[Cr(hr,{component:"span",sx:{fontWeight:700},children:h.name}),Eo(hr,{component:"span",children:["\uBBF8\uC644\uB8CC ",a.length,"\uAC74"]}),h.capacity>0?Eo(hr,{component:"span",sx:{color:h.load>h.capacity?"#e5484d":"#787774"},children:["\xB7 \uC6A9\uB7C9 ",h.capacity," \uC911 ",h.load]}):null]}),Eo(hr,{sx:{flex:1,minHeight:0,display:"flex",flexDirection:"column",border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:[Eo(hr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,flexShrink:0,bgcolor:"#fafaf9",borderBottom:"1px solid #e6e6e3",fontSize:13.5,fontWeight:600,color:"#37352f"},children:[Cr(hr,{sx:{width:Nm,flexShrink:0},children:"\uB9C8\uAC10"}),Cr(hr,{sx:{flex:1,minWidth:0},children:"\uC5C5\uBB34"}),Cr(hr,{sx:{width:Lm,flexShrink:0,textAlign:"center"},children:"\uC911\uC694\uB3C4"}),t?Cr(hr,{sx:{width:jm,flexShrink:0,textAlign:"center"},children:"\uCC45\uC784\uC790"}):null]}),Cr(hr,{sx:{flex:1,minHeight:0},children:Cr(Nk,{style:{height:"100%"},thumb:{width:6},children:a.length===0?Cr(hr,{sx:{p:2,fontSize:14,color:"#9a9a97"},children:"\uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):a.map(f=>Eo(hr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1.5,borderBottom:"1px solid #f2f2f0"},children:[Cr(hr,{sx:{width:Nm,flexShrink:0,fontSize:13.5,color:zm(f,b)?"#e5484d":"#787774",fontWeight:zm(f,b)?700:400},children:Lk(f)}),Cr(hr,{onClick:n?()=>n(f.seq):void 0,sx:{flex:1,minWidth:0,fontSize:14.5,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...n?{cursor:"pointer","&:hover":{textDecoration:"underline"}}:{}},children:f.title}),Cr(hr,{sx:{width:Lm,flexShrink:0,display:"flex",justifyContent:"center"},children:Cr(Lr,{priority:f.priority})}),t?Cr(hr,{sx:{width:jm,flexShrink:0,display:"flex",justifyContent:"center"},children:Cr(Ok,{size:"small",variant:"outlined",startIcon:Cr(Pk,{sx:{fontSize:17}}),onClick:u=>i({el:u.currentTarget,taskSeq:f.seq}),children:"\uC62E\uAE30\uAE30"})}):null]},f.seq))})})]}),Cr(Ak,{anchorEl:c?.el??null,open:!!c,onClose:()=>i(null),transitionDuration:0,children:l.filter(f=>Number(f.account_seq)>0&&Number(f.account_seq)!==h.accountSeq).map(f=>Eo(Dk,{onClick:()=>{c&&t&&t(c.taskSeq,Number(f.account_seq),f.name),i(null)},sx:{fontSize:14,minWidth:200},children:[Cr(hr,{sx:{flex:1},children:f.name}),Eo(hr,{component:"span",sx:{ml:2,fontSize:13,color:"#787774"},children:[d(Number(f.account_seq)),"\uAC74"]})]},f.account_seq))})]})}import{jsx as Fl}from"react/jsx-runtime";function qm({open:e,row:h,rows:b,tasks:l,todayStr:o,employees:s,onClose:r,onChangeManager:t,onOpenTask:n}){let[c,i]=zk(h);jk(()=>{h&&i(h)},[h]);let a=h??c,d=a?jl(l,a.accountSeq).length:0;return Fl($k,{open:e,onClose:r,maxWidth:"sm",title:a?`${a.name} \uC5C5\uBB34 (${d})`:"\uC5C5\uBB34",locale:"ko",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-workload-person",tabs:{visible:!1},actions:{showCancelButton:!1,right:Fl(qk,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})},sections:[{id:"person-tasks",title:"",showTitle:!1,children:Fl(Fk,{sx:{minHeight:0},children:a?Fl(Fm,{tasks:l,row:a,rows:b,todayStr:o,employees:s,height:"min(420px, 52vh)",hideSummary:!0,onChangeManager:t,onOpenTask:n}):null})}]})}import{useMemo as Hk}from"react";import{Box as ln,Tooltip as Wk}from"@mui/material";import{OverlayScrollbar as Uk}from"@ehfuse/overlay-scrollbar";import{jsx as Kr,jsxs as $l}from"react/jsx-runtime";var $m="#e5484d",Vk="#2f80ed",Kk="#9a9a97",rd=30,Gk=96,ql=56;function nd({count:e,max:h,color:b,title:l}){let o=e>0&&h>0?.18+e/h*.72:0;return Kr(Wk,{title:l,arrow:!0,disableInteractive:!0,placement:"top",children:Kr(ln,{sx:{display:"flex",alignItems:"center",justifyContent:"center",borderRight:"1px solid #ececea",borderBottom:"1px solid #ececea",bgcolor:o>0?`${b}${Math.round(o*255).toString(16).padStart(2,"0")}`:"transparent",color:o>.55?"#fff":"#37352f",fontSize:12.5,fontWeight:e>0?700:400,fontVariantNumeric:"tabular-nums"},children:e>0?e:""})})}function Hm({tasks:e,todayStr:h,weeks:b=6,height:l=200}){let o=Hk(()=>Rm(e,{todayStr:h,weeks:b}),[e,h,b]);if(o.rows.length===0)return Kr(ln,{sx:fr(l),children:Kr(Ur,{text:"\uB2F4\uB2F9\uC790\uAC00 \uC9C0\uC815\uB41C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.",height:l})});let s=`${Gk}px ${ql}px repeat(${o.weeks.length}, minmax(${ql}px, 1fr)) ${ql}px ${ql}px`,r={height:rd,display:"flex",alignItems:"center",justifyContent:"center",borderRight:"1px solid #ececea",borderBottom:"1px solid #dcdad6",fontSize:12,fontWeight:700,color:"#37352f",bgcolor:"#f8f8f7",whiteSpace:"nowrap"};return Kr(ln,{sx:fr(l),children:Kr(Uk,{style:{height:"100%"},thumb:{width:8},children:$l(ln,{sx:{display:"grid",gridTemplateColumns:s,minWidth:"fit-content",height:"100%",gridTemplateRows:`${rd}px repeat(${o.rows.length}, minmax(${rd}px, 1fr))`},children:[Kr(ln,{sx:{...r,justifyContent:"flex-start",pl:1},children:"\uB2F4\uB2F9\uC790"}),Kr(ln,{sx:{...r,color:$m},children:"\uC9C0\uC5F0"}),o.weeks.map(t=>Kr(ln,{sx:{...r,...t.isCurrent?{borderBottom:"2px solid #2f80ed"}:{}},children:t.label},t.start)),Kr(ln,{sx:r,children:"\uB9C8\uAC10\uC5C6\uC74C"}),Kr(ln,{sx:r,children:"\uD569\uACC4"}),o.rows.map(t=>$l(ln,{sx:{display:"contents"},children:[Kr(ln,{sx:{display:"flex",alignItems:"center",pl:1,borderRight:"1px solid #ececea",borderBottom:"1px solid #ececea",fontSize:13,color:t.accountSeq>0?"#37352f":"#9a9a97",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.name}),Kr(nd,{count:t.overdue,max:o.maxCell,color:$m,title:`${t.name} \xB7 \uC9C0\uC5F0 ${t.overdue}\uAC74`}),t.byWeek.map((n,c)=>Kr(nd,{count:n,max:o.maxCell,color:Vk,title:`${t.name} \xB7 ${o.weeks[c].label} \uC8FC \uB9C8\uAC10 ${n}\uAC74`},o.weeks[c].start)),Kr(nd,{count:t.noDue,max:o.maxCell,color:Kk,title:`${t.name} \xB7 \uB9C8\uAC10 \uBBF8\uC815 ${t.noDue}\uAC74`}),$l(ln,{sx:{display:"flex",alignItems:"center",justifyContent:"center",borderBottom:"1px solid #ececea",fontSize:12.5,fontWeight:700,color:"#37352f",fontVariantNumeric:"tabular-nums"},children:[t.total,t.beyond>0?$l(ln,{component:"span",sx:{ml:.25,fontSize:10.5,color:"#9a9a97"},children:["(+",t.beyond,")"]}):null]})]},t.accountSeq))]})})})}import{Fragment as Vm,jsx as Jt,jsxs as Hl}from"react/jsx-runtime";var Km="min(560px, 62vh)",Jk=`calc(${Km} - 4px)`,Qk=[{value:"30",label:"\uCD5C\uADFC 30\uC77C"},{value:"60",label:"\uCD5C\uADFC 60\uC77C"},{value:"90",label:"\uCD5C\uADFC 90\uC77C"}];function rW({open:e,sprints:h,tasks:b,todayStr:l,showSprintCharts:o,capacity:s=io,capacityEmployees:r=[],onSaveCapacity:t,onChangeTaskManager:n,onOpenTask:c,initialSprintSeq:i=0,onClose:a}){let[d,f]=Zs(0),[u,g]=Zs(30);Yk(()=>{if(!e)return;let y=h.find(w=>w.status==="active")??h[0],v=h.find(w=>w.seq===i)??y;f(v?.seq??0)},[e]);let m=Wm(()=>h.find(y=>y.seq===d)??null,[h,d]),x={height:Jk,boxSizing:"border-box",px:3,py:2.5,display:"flex",flexDirection:"column",minHeight:0,overflow:"hidden"},_=Jt(od,{label:"\uBAA9\uD45C",showLabel:!1,showEmptyOption:!1,value:d?String(d):"",options:h.map(y=>({value:String(y.seq),label:mn(y)})),onChange:y=>f(Number(y.target.value)||0),sx:{width:280,flexShrink:0}}),[B,A]=Zs("distribution"),j=Jt(od,{label:"\uBCF4\uAE30",showLabel:!1,showEmptyOption:!1,value:B,options:[{value:"distribution",label:"\uC9C0\uAE08 \uBD80\uD558(\uC9C0\uC5F0\xB7\uC784\uBC15\xB7\uC5EC\uC720)"},{value:"timeline",label:"\uC8FC\uBCC4 \uB9C8\uAC10 \uBC00\uC9D1"}],onChange:y=>A(y.target.value==="timeline"?"timeline":"distribution"),sx:{width:280,flexShrink:0}}),[D,P]=Zs(!1),[N,q]=Zs(0),z=Wm(()=>Ll(b,{todayStr:l,capacity:s}),[b,l,s]),T=z.find(y=>y.accountSeq===N)??null,C=Hl(Vm,{children:[j,t?Jt(Um,{size:"small",variant:"outlined",startIcon:Jt(Zk,{sx:{fontSize:18}}),onClick:()=>P(!0),sx:{flexShrink:0},children:"\uC6A9\uB7C9"}):null]}),R=o??h.length>0,p=Jt(od,{label:"\uAE30\uAC04",showLabel:!1,showEmptyOption:!1,value:String(u),options:Qk,onChange:y=>g(Number(y.target.value)||30),sx:{width:280,flexShrink:0}});return Hl(Vm,{children:[Jt(Xk,{open:e,onClose:a,maxWidth:"md",title:"\uC5C5\uBB34 \uCC28\uD2B8",locale:"ko",contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,sectionTitleGap:0,fixedHeight:Km,contentBottomPadding:0,scrollPastLastSection:!1,tabs:{visible:!0,switchContent:!0,fullWidth:!0},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-charts",sections:[...R?[{id:"velocity",tabTitle:"\uBCA8\uB85C\uC2DC\uD2F0",showTitle:!1,children:Jt(Mo,{sx:x,children:Jt(hm,{sprints:h,tasks:b,height:"100%"})})},{id:"burndown",tabTitle:"\uBC88\uB2E4\uC6B4",showTitle:!1,children:Jt(Mo,{sx:x,children:m?Jt(gm,{sprint:m,tasks:b,todayStr:l,height:"100%",headerLeft:_}):Hl(Mo,{sx:fr("100%"),children:[Jt(Mo,{sx:Dr,children:_}),Jt(Ur,{text:"\uBC88\uB2E4\uC6B4\uC744 \uBCFC \uBAA9\uD45C\uB97C \uC120\uD0DD\uD558\uC138\uC694.",height:"100%"})]})})},{id:"cumulative-flow",tabTitle:"\uB204\uC801\uD750\uB984\uB3C4",showTitle:!1,children:Jt(Mo,{sx:x,children:Jt(Sm,{tasks:b,todayStr:l,days:u,height:"100%",headerLeft:p})})}]:[],{id:"workload",tabTitle:"\uC6CC\uD06C\uB85C\uB4DC",showTitle:!1,children:Jt(Mo,{sx:x,children:B==="timeline"?Hl(Mo,{sx:{display:"flex",flexDirection:"column",height:"100%",minHeight:0},children:[Jt(Mo,{sx:Dr,children:C}),Jt(Hm,{tasks:b,todayStr:l,height:"100%"})]}):Jt(Pm,{tasks:b,todayStr:l,height:"100%",capacity:s,headerLeft:C,selectedAccountSeq:N,onSelectPerson:n?q:void 0})})},{id:"lead-time",tabTitle:"\uB9AC\uB4DC\uD0C0\uC784",showTitle:!1,children:Jt(Mo,{sx:x,children:Jt(Im,{tasks:b,todayStr:l,days:u,height:"100%",headerLeft:p})})}],actions:{showCancelButton:!1,right:Jt(Um,{variant:"contained",onClick:a,children:"\uB2EB\uAE30"})}}),Jt(qm,{open:N>0,row:T,rows:z,tasks:b,todayStr:l,employees:r,onClose:()=>q(0),onChangeManager:n,onOpenTask:c}),t?Jt(dm,{open:D,capacity:s,employees:r,onClose:()=>P(!1),onSave:async y=>{await t(y),P(!1)}}):null]})}import{Checkbox as e8,Divider as t8,Menu as r8,MenuItem as id}from"@mui/material";import{jsx as Js,jsxs as Gm}from"react/jsx-runtime";function aW({anchorEl:e,candidates:h,selectedNames:b,avatarSrcByName:l,onToggle:o,onClear:s,onClose:r}){return Gm(r8,{anchorEl:e,open:!!e,onClose:r,transitionDuration:0,children:[h.length===0?Js(id,{disabled:!0,sx:{fontSize:14},children:"\uBAA9\uB85D\uC5D0 \uC9C0\uC815\uB41C \uC0AC\uB78C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):h.map(t=>{let n=b.includes(t.name);return Gm(id,{onClick:()=>o(t),sx:{fontSize:14,minWidth:170,gap:1},children:[Js(e8,{size:"small",checked:n,sx:{p:0}}),Js(jr,{names:[t.name],size:20,avatarSrcByName:l}),t.name]},`${t.accountSeq}-${t.name}`)}),Js(t8,{}),Js(id,{disabled:b.length===0,onClick:s,sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{useState as n8}from"react";import{ButtonBase as o8,Menu as i8,MenuItem as s8}from"@mui/material";import a8 from"@mui/icons-material/KeyboardArrowDown";import l8 from"@mui/icons-material/Check";import{Fragment as c8,jsx as sd,jsxs as ad}from"react/jsx-runtime";function mW({value:e,onChange:h,options:b}){let[l,o]=n8(null),s=b??vc,r=vc.find(t=>t.value===e)?.label??"";return ad(c8,{children:[ad(o8,{onClick:t=>o(t.currentTarget),sx:{display:"flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:1,fontSize:13.5,color:"#37352f","&:hover":{bgcolor:"#f2f2f0"}},children:[r,sd(a8,{sx:{fontSize:17,color:"#9a9a97"}})]}),sd(i8,{transitionDuration:0,anchorEl:l,open:!!l,onClose:()=>o(null),children:s.map(t=>ad(s8,{selected:t.value===e,onClick:()=>{h(t.value),o(null)},sx:{fontSize:14,minWidth:140,justifyContent:"space-between",gap:1},children:[t.label,t.value===e?sd(l8,{sx:{fontSize:16,color:"#2f80ed"}}):null]},t.value))})]})}import{Box as Wl,ButtonBase as u8}from"@mui/material";import{DateTextField as Ym}from"@ehfuse/mui-form-controls";import{jsx as Qs,jsxs as Xm}from"react/jsx-runtime";var d8=[{label:"1\uAC1C\uC6D4",months:1},{label:"3\uAC1C\uC6D4",months:3},{label:"6\uAC1C\uC6D4",months:6},{label:"1\uB144",months:12},{label:"\uC804\uCCB4",months:0}];function Zm({fromDate:e,toDate:h,onChange:b}){let l=s=>{if(s<=0){b("","");return}b(Io(Nl(s)),Io(new Date))},o=s=>s<=0?!e&&!h:!e||!h?!1:e===Io(Nl(s))&&h===Io(new Date);return Xm(Wl,{sx:{display:"flex",alignItems:"center",gap:1.5,flexWrap:"wrap"},children:[Qs(Wl,{sx:{display:"flex",alignItems:"center",gap:1.5},children:d8.map(s=>{let r=o(s.months);return Qs(u8,{onClick:()=>l(s.months),sx:{px:1.25,py:.85,borderRadius:1,fontSize:13,fontWeight:r?500:400,border:"1px solid",borderColor:r?"#2f80ed":"#dedddb",color:r?"#2f80ed":"#37352f",bgcolor:r?"#eef6ff":"transparent","&:hover":{bgcolor:r?"#eef6ff":"#f7f7f5"}},children:s.label},s.label)})}),Xm(Wl,{sx:{display:"flex",alignItems:"center",gap:.5},children:[Qs(Ym,{value:e,size:"small",placeholder:"\uC2DC\uC791\uC77C",onChange:s=>b(s.target.value,h),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}}),Qs(Wl,{component:"span",sx:{fontSize:13,color:"#9a9a97"},children:"~"}),Qs(Ym,{value:h,size:"small",placeholder:"\uC885\uB8CC\uC77C",onChange:s=>b(e,s.target.value),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}})]})]})}import{Popover as f8}from"@mui/material";import{jsx as Jm}from"react/jsx-runtime";function TW({anchorEl:e,fromDate:h,toDate:b,onChange:l,onClose:o}){return Jm(f8,{transitionDuration:0,anchorEl:e,open:!!e,onClose:o,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{p:1.5}}},children:Jm(Zm,{fromDate:h,toDate:b,onChange:l})})}import{Box as h8,ButtonBase as p8,Tab as m8,Tabs as g8}from"@mui/material";import b8 from"@mui/icons-material/Checklist";import y8 from"@mui/icons-material/Face";import x8 from"@mui/icons-material/Publish";import v8 from"@mui/icons-material/NotificationsOutlined";import w8 from"@mui/icons-material/BugReportOutlined";import _8 from"@mui/icons-material/DescriptionOutlined";import k8 from"@mui/icons-material/Inventory2Outlined";import{jsx as Dn}from"react/jsx-runtime";function Qm(e,h){return h>0?`${e} (${h})`:e}var jW=[{id:"my",label:"\uC804\uCCB4",icon:Dn(b8,{sx:{fontSize:18}})},{id:"mine",label:"\uB0B4 \uC5C5\uBB34",icon:Dn(y8,{sx:{fontSize:18}})},{id:"sent",label:"\uBCF4\uB0B8 \uC5C5\uBB34",icon:Dn(x8,{sx:{fontSize:18}})},{id:"bug",label:"\uC624\uB958",icon:Dn(w8,{sx:{fontSize:18}})},{id:"notice",label:"\uACF5\uC9C0\uC0AC\uD56D",icon:Dn(v8,{sx:{fontSize:18}})},{id:"archive",label:"\uBCF4\uAD00\uD568",icon:Dn(k8,{sx:{fontSize:18}}),hideCount:!0},{id:"report",label:"\uBCF4\uACE0\uC11C",icon:Dn(_8,{sx:{fontSize:18}}),hideCount:!0}];function S8(e){return{minHeight:46,minWidth:75,bgcolor:e.bg,color:e.color,borderRadius:"8px 8px 0 0",padding:"10px 18px",textTransform:"none",fontSize:14,fontWeight:500,border:`1px solid ${e.borderColor}`,borderBottom:"none","&:hover":{bgcolor:e.hoverBg},"&.Mui-selected":{bgcolor:e.selectedBg,color:e.selectedColor,border:`1px solid ${e.selectedBg}`,borderBottom:"none","&:hover":{bgcolor:e.selectedBg}},...e.sx}}function zW({items:e,activeTab:h,counts:b,onChange:l,compact:o=!1}){let s=ct(),r=S8(s.tabs),t=e;return o?Dn(h8,{sx:{display:"flex",flexWrap:"wrap",gap:1.25},children:t.map(n=>{let c=h===n.id;return Dn(p8,{onClick:()=>l(n.id),sx:{px:1.5,py:.75,borderRadius:1,fontSize:kr(13.5),fontWeight:500,whiteSpace:"nowrap",border:"1px solid",bgcolor:c?s.tabs.selectedBg:s.tabs.bg,color:c?s.tabs.selectedColor:s.tabs.color,borderColor:c?s.tabs.selectedBg:s.tabs.borderColor},children:Qm(n.label,n.hideCount?0:b[n.id]??0)},n.id)})}):Dn(g8,{value:h,onChange:(n,c)=>l(c),sx:{minHeight:46,"& .MuiTabs-indicator":{display:"none"},"& .MuiTabs-flexContainer":{gap:"12px",minHeight:46}},children:t.map(n=>Dn(m8,{value:n.id,label:Qm(n.label,n.hideCount?0:b[n.id]??0),icon:n.icon,iconPosition:"start",sx:r},n.id))})}import{useEffect as T8,useMemo as C8,useState as ld}from"react";import{Divider as Ul,ListItemIcon as Gr,Menu as cd,MenuItem as _r}from"@mui/material";import B8 from"@mui/icons-material/OpenInNewOutlined";import I8 from"@mui/icons-material/RestoreFromTrashOutlined";import E8 from"@mui/icons-material/Check";import M8 from"@mui/icons-material/CheckCircleOutlined";import R8 from"@mui/icons-material/RadioButtonUnchecked";import O8 from"@mui/icons-material/SendOutlined";import A8 from"@mui/icons-material/EventOutlined";import D8 from"@mui/icons-material/PersonOutlineOutlined";import P8 from"@mui/icons-material/ViewKanbanOutlined";import N8 from"@mui/icons-material/ContentCopyOutlined";import L8 from"@mui/icons-material/NextPlanOutlined";import j8 from"@mui/icons-material/ContentPasteOutlined";import z8 from"@mui/icons-material/ShareOutlined";import F8 from"@mui/icons-material/DirectionsRunOutlined";import e0 from"@mui/icons-material/ChevronRight";import q8 from"@mui/icons-material/ArchiveOutlined";import $8 from"@mui/icons-material/UnarchiveOutlined";import{ConfirmDialog as t0}from"@ehfuse/alerts";import{Fragment as r0,jsx as ut,jsxs as pr}from"react/jsx-runtime";function bU({target:e,onClose:h,customTabs:b,sprints:l=[],myAccountSeq:o=0,onOpenDetail:s,onToggleCompleted:r,onRequestConfirm:t,onChangeDueDate:n,onChangeReminder:c,onMemberEdit:i,onMoveProject:a,onDuplicate:d,onCreateFollowUp:f,onShare:u,onAssignSprint:g,onArchiveToggle:m,onDelete:x,onRestore:_,onPurge:B}){let A=Nt(),j=Nn(),[D,P]=ld(null),[N,q]=ld(null),[z,T]=ld(null);T8(()=>{e||(P(null),q(null),T(null))},[e]);let C=e?.task??null,R=!!C?.is_notice,p=!!C?.is_event,y=C?!lo(C,o):!1,v=!!C?.deleted,w=C8(()=>new Set(b.filter(L=>L.useSprints).map(L=>L.key)),[b]),k=async(L="one")=>{let $=C;if(h(),!$)return;await t0({title:"\uC5C5\uBB34 \uC0AD\uC81C",message:L==="series"?`"${$.title}" \uC758 \uC774 \uD68C\uCC28\uC640 \uC774\uD6C4 \uBC18\uBCF5 \uD68C\uCC28\uB97C \uBAA8\uB450 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`:`"${$.title}" \uC5C5\uBB34\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&x($.seq,L)},S=async()=>{let L=C;if(h(),!L)return;await t0({title:"\uC601\uAD6C \uC0AD\uC81C",message:`"${L.title}" \uC5C5\uBB34\uB97C \uC601\uAD6C\uD788 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C? \uB418\uB3CC\uB9B4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.`})&&B?.(L.seq)},E=()=>{C&&m(C.seq,!C.archived),h()};return pr(r0,{children:[pr(cd,{open:!!e,onClose:h,transitionDuration:0,anchorReference:A?"none":"anchorPosition",anchorPosition:!A&&e?{top:e.position.top,left:e.position.left}:void 0,slotProps:{paper:{sx:{minWidth:190,...A?{position:"fixed",top:"50%",left:"50%",translate:"-50% -50%",maxHeight:"70vh"}:{}}},list:A?{sx:{"& .MuiMenuItem-root":{py:1,minHeight:0}}}:void 0},children:[pr(_r,{onClick:()=>{C&&s(C),h()},sx:{fontSize:14},children:[ut(Gr,{children:ut(B8,{sx:{fontSize:19}})}),"\uC0C1\uC138 \uC5F4\uAE30"]}),v?ut(Ul,{}):null,v&&_?pr(_r,{onClick:()=>{C&&_(C.seq),h()},sx:{fontSize:14},children:[ut(Gr,{children:ut(I8,{sx:{fontSize:19}})}),"\uBCF5\uC6D0"]}):null,v&&B?pr(_r,{onClick:()=>{S()},sx:{fontSize:14,color:"#e5484d"},children:[ut(Gr,{children:ut(cr,{sx:{fontSize:19,color:"#e5484d"}})}),"\uC601\uAD6C \uC0AD\uC81C"]}):null,v?null:pr(r0,{children:[pr(_r,{disabled:R?(C?.author_account_seq??0)!==o:(C?.author_account_seq??0)!==o&&(C?.manager_account_seq??0)!==o,onClick:()=>{C&&r(C.seq,!C.completed),h()},sx:{fontSize:14},children:[ut(Gr,{children:C?.completed?ut(R8,{sx:{fontSize:19}}):ut(M8,{sx:{fontSize:19}})}),C?.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC"]}),!R&&t?pr(_r,{disabled:!(C?.manager_account_seq??0)&&(C?.receiver_account_seqs??[]).length===0,onClick:()=>{C&&t(C),h()},sx:{fontSize:14},children:[ut(Gr,{children:ut(O8,{sx:{fontSize:19}})}),"\uD655\uC778 \uC694\uCCAD"]}):null,p?null:ut(Ul,{}),p?null:pr(_r,{disabled:y,onClick:L=>{C&&P({anchorEl:L.currentTarget,task:C})},sx:{fontSize:14},children:[ut(Gr,{children:ut(A8,{sx:{fontSize:19}})}),"\uB9C8\uAC10\uC77C\uC2DC \uBCC0\uACBD"]}),!R&&!p&&i?pr(_r,{onClick:()=>{C&&i(C,"manager"),h()},sx:{fontSize:14},children:[ut(Gr,{children:ut(D8,{sx:{fontSize:19}})}),"\uCC45\uC784\uC790 \uBCC0\uACBD"]}):null,p?null:pr(_r,{disabled:y,onClick:L=>{C&&q({anchorEl:L.currentTarget,task:C})},sx:{fontSize:14},children:[ut(Gr,{children:ut(P8,{sx:{fontSize:19}})}),"\uD504\uB85C\uC81D\uD2B8 \uC774\uB3D9",ut(e0,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}),ut(Ul,{}),d?pr(_r,{disabled:y,onClick:()=>{C&&d(C.seq),h()},sx:{fontSize:14},children:[ut(Gr,{children:ut(N8,{sx:{fontSize:19}})}),"\uBCF5\uC81C"]}):null,f&&C&&!C.is_event&&!C.is_notice?pr(_r,{onClick:()=>{C&&f(C.seq),h()},sx:{fontSize:14},children:[ut(Gr,{children:ut(L8,{sx:{fontSize:19}})}),"\uD6C4\uC18D \uC5C5\uBB34 \uB9CC\uB4E4\uAE30"]}):null,pr(_r,{onClick:()=>{C&&(u?u(C):Ki(C,A)),h()},sx:{fontSize:14},children:[ut(Gr,{children:A?ut(z8,{sx:{fontSize:19}}):ut(j8,{sx:{fontSize:19}})}),A?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC"]}),C&&!C.is_notice&&!C.is_event&&w.has(String(C.tab_key??""))&&g?pr(_r,{onClick:L=>T(L.currentTarget),sx:{fontSize:14},children:[ut(Gr,{children:ut(F8,{sx:{fontSize:19}})}),"\uBAA9\uD45C\uC5D0 \uB123\uAE30",ut(e0,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}):null,pr(_r,{onClick:E,disabled:y||!C?.archived&&!(C&&Ta(C)),sx:{fontSize:14},children:[ut(Gr,{children:C?.archived?ut($8,{sx:{fontSize:19}}):ut(q8,{sx:{fontSize:19}})}),C?.archived?"\uBCF4\uAD00 \uD574\uC81C":"\uBCF4\uAD00"]}),ut(Ul,{}),pr(_r,{disabled:y,onClick:()=>{k("one")},sx:{fontSize:14,color:"#e5484d"},children:[ut(Gr,{children:ut(cr,{sx:{fontSize:19,color:"#e5484d"}})}),(C?.repeat_group_key??0)>0?"\uC0AD\uC81C (\uC774 \uD68C\uCC28\uB9CC)":"\uC0AD\uC81C"]}),(C?.repeat_group_key??0)>0?pr(_r,{disabled:y,onClick:()=>{k("series")},sx:{fontSize:14,color:"#e5484d"},children:[ut(Gr,{children:ut(cr,{sx:{fontSize:19,color:"#e5484d"}})}),"\uC0AD\uC81C (\uC774\uD6C4 \uBC18\uBCF5 \uC804\uCCB4)"]}):null]})]}),ut(pn,{anchorEl:D?.anchorEl??null,open:!!D,date:D?.task.due_date??"",reminders:zn(D?.task),hideReminder:!!D?.task.completed,centered:A,onClose:()=>{P(null),h()},onDateChange:L=>{D&&n(D.task.seq,L)},onReminderChange:L=>{D&&c?.(D.task.seq,L)}}),pr(cd,{transitionDuration:0,anchorEl:N?.anchorEl??null,open:!!N,onClose:()=>{q(null),h()},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...j,children:[ut(_r,{selected:!N?.task.tab_key,onClick:()=>{N&&a(N.task.seq,""),q(null),h()},sx:{fontSize:14,minWidth:170},children:"\uC5C6\uC74C"}),b.filter(L=>!L.archived).map(L=>ut(_r,{selected:N?.task.tab_key===L.key,onClick:()=>{N&&a(N.task.seq,L.key),q(null),h()},sx:{fontSize:14,minWidth:170},children:L.label},L.key))]}),ut(cd,{transitionDuration:0,anchorEl:z,open:!!z,onClose:()=>T(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...l.filter(L=>`custom-${L.group_seq}`===String(C?.tab_key??"")).map(L=>({seq:L.seq,label:mn(L)}))].map(L=>pr(_r,{onClick:()=>{C&&g?.(C.seq,L.seq),T(null),h()},sx:{fontSize:14,minWidth:160,gap:1},children:[L.label,(C?.sprint_seq??0)===L.seq?ut(E8,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},L.seq))})]})}import{Checkbox as H8,Divider as W8,Menu as U8,MenuItem as n0}from"@mui/material";import{jsx as Vl,jsxs as o0}from"react/jsx-runtime";function _U({anchorEl:e,labelOptions:h,selectedKeys:b,onToggle:l,onClear:o,onClose:s}){return o0(U8,{transitionDuration:0,anchorEl:e,open:!!e,onClose:s,children:[h.map(r=>{let t=b.includes(r.key);return o0(n0,{onClick:()=>l(r.key),sx:{fontSize:14,minWidth:190,gap:1},children:[Vl(H8,{size:"small",checked:t,sx:{p:0}}),Vl(Ot,{option:r})]},r.key)}),Vl(W8,{}),Vl(n0,{disabled:b.length===0,onClick:()=>{o(),s()},sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{Divider as V8,Menu as K8,MenuItem as i0}from"@mui/material";import G8 from"@mui/icons-material/Check";import Y8 from"@mui/icons-material/SettingsOutlined";import{jsx as ud,jsxs as dd}from"react/jsx-runtime";function EU(e){let{anchorEl:h,sprints:b,value:l,onSelect:o,onManage:s,onClose:r}=e;return dd(K8,{transitionDuration:0,anchorEl:h,open:!!h,onClose:r,children:[[{seq:0,label:"\uC804\uCCB4"},{seq:-1,label:"\uBBF8\uBC30\uC815 \uC5C5\uBB34"},...b.map(t=>({seq:t.seq,label:mn(t)}))].map(t=>dd(i0,{onClick:()=>{o(t.seq),r()},sx:{fontSize:14,minWidth:180,gap:1},children:[t.label,l===t.seq?ud(G8,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},t.seq)),ud(V8,{}),dd(i0,{onClick:()=>{r(),s()},sx:{fontSize:14,gap:1},children:[ud(Y8,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uAD00\uB9AC\u2026"]})]})}var X8={my:"tasks",mine:"tasks",sent:"tasks",notice:"notice",bug:"bug",archive:"archive",done:"done",report:"report"};function Z8(e){return X8[e]??"tasks"}var a0={list:"\uBAA9\uB85D",card:"\uD504\uB85C\uC81D\uD2B8",kanban:"\uC0C1\uD0DC",sprint:"\uBAA9\uD45C",calendar:"\uC8FC\uAC04",month:"\uC6D4\uAC04",agenda:"\uC544\uC820\uB2E4",timeline:"\uD0C0\uC784\uB77C\uC778"},s0=["list","calendar","month","card","kanban","sprint","timeline"],J8=["list","card"];function OU(e){let h=Z8(e);switch(h){case"notice":return{kind:h,viewOptions:[],showCreate:!0,createLabel:"\uACF5\uC9C0\uC0AC\uD56D \uB4F1\uB85D",showGroupBy:!1,showSprintFilter:!1,showDateRange:!1,showHideCompleted:!0,forceFlatList:!0,columns:{notice:!0}};case"bug":return{kind:h,viewOptions:s0,showCreate:!0,createLabel:"\uC624\uB958 \uB4F1\uB85D",showGroupBy:!0,showSprintFilter:!0,showDateRange:!1,showHideCompleted:!0,forceFlatList:!1,columns:{bug:!0}};case"archive":return{kind:h,viewOptions:J8,showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"done":return{kind:h,viewOptions:["list"],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"report":return{kind:h,viewOptions:[],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{}};default:return{kind:h,viewOptions:s0,showCreate:!0,createLabel:"\uC5C5\uBB34 \uB4F1\uB85D",showGroupBy:!0,showSprintFilter:!0,showDateRange:!1,showHideCompleted:!0,forceFlatList:!1,columns:e==="mine"?{showRequest:!1,confirmMode:"action"}:e==="sent"?{confirmMode:"time"}:{}}}}import{useMemo as Q8}from"react";import{useKeyboardState as eS}from"@ehfuse/keyboard-state";var l0=[{key:"g l",view:"list"},{key:"g b",view:"card"},{key:"g k",view:"kanban"},{key:"g s",view:"sprint"},{key:"g c",view:"calendar"},{key:"g m",view:"month"},{key:"g t",view:"timeline"}];function LU(e,h={}){let{enabled:b=!0,views:l}=h,{onCreateTask:o,onFocusSearch:s,onToggleHelp:r,onChangeView:t,onRefresh:n,onEscape:c}=e,i=l?l.join(","):"",a=Q8(()=>{let d=[];if(o&&d.push({key:"n",callback:o,options:{preventDefault:!0}}),s&&d.push({key:"/",callback:s,options:{preventDefault:!0}}),n&&d.push({key:"r",callback:n,options:{preventDefault:!0}}),r&&d.push({key:"shift+?",callback:r,options:{preventDefault:!0}}),c&&d.push({key:"escape",callback:c,options:{allowInEditable:!0}}),t)for(let f of c0(i?i.split(","):void 0))d.push({key:f.key,callback:()=>t(f.view),options:{preventDefault:!0}});return d},[o,s,r,t,n,c,i]);eS(b?a:[])}function c0(e){if(!e)return l0;let h=new Set(e);return l0.filter(b=>h.has(b.view))}function fd(e){return[{keys:"N",description:"\uC0C8 \uC5C5\uBB34 \uB4F1\uB85D"},{keys:"/",description:"\uAC80\uC0C9"},{keys:"R",description:"\uBAA9\uB85D \uC0C8\uB85C\uACE0\uCE68"},...c0(e).map(h=>({keys:h.key.split(" ").map(b=>b.toUpperCase()).join(" \u2192 "),description:`${a0[h.view]} \uBCF4\uAE30`})),{keys:"?",description:"\uB2E8\uCD95\uD0A4 \uB3C4\uC6C0\uB9D0"},{keys:"Esc",description:"\uB2EB\uAE30"}]}var jU=fd();import{Box as ea,Button as tS}from"@mui/material";import rS from"@mui/icons-material/ArrowRightAlt";import{FormDialog as nS}from"@ehfuse/mui-form-dialog";import{jsx as Qo,jsxs as u0}from"react/jsx-runtime";function oS({keys:e}){return Qo(ea,{sx:{display:"flex",alignItems:"center",gap:.5,justifyContent:"flex-end"},children:e.split(" \u2192 ").map((h,b)=>u0(ea,{sx:{display:"flex",alignItems:"center",gap:.5},children:[b>0?Qo(rS,{sx:{fontSize:18,color:"#9a9a97"}}):null,Qo(ea,{component:"span",sx:{minWidth:32,height:32,px:.75,display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:13.5,fontWeight:700,color:"#37352f",bgcolor:"#f4f4f2",border:"1px solid #e0dfdb",borderRadius:1,fontVariantNumeric:"tabular-nums"},children:h})]},`${h}-${b}`))})}function WU({open:e,onClose:h,views:b}){let l=fd(b);return Qo(nS,{open:e,onClose:h,maxWidth:"xs",title:"\uB2E8\uCD95\uD0A4",locale:"ko",titleIcons:{delete:{visible:!1}},tabs:{visible:!1},sectionContentPaddingTop:0,sections:[{id:"shortcuts",showTitle:!1,children:Qo(ea,{sx:{display:"grid",gridTemplateColumns:"auto 1fr",columnGap:2,rowGap:1.25,alignItems:"center",fontSize:14,color:"#37352f"},children:l.map(o=>u0(ea,{sx:{display:"contents"},children:[Qo(oS,{keys:o.keys}),Qo("span",{children:o.description})]},o.keys))})}],actions:{showCancelButton:!1,right:Qo(tS,{variant:"contained",onClick:h,children:"\uB2EB\uAE30"})}})}import{useEffect as d0,useRef as iS,useState as ns}from"react";import{Box as nr,Button as Pn,IconButton as hd,Menu as f0,MenuItem as h0,Switch as sS,Tooltip as p0}from"@mui/material";import{FormDialog as m0}from"@ehfuse/mui-form-dialog";import pd from"@mui/icons-material/Add";import aS from"@mui/icons-material/ArrowRightAlt";import lS from"@mui/icons-material/BoltOutlined";import cS from"@mui/icons-material/Close";import uS from"@mui/icons-material/EditOutlined";import{ErrorAlert as g0}from"@ehfuse/alerts";import{ClearTextField as ta,LabelSelect as cn}from"@ehfuse/mui-form-controls";import{Fragment as y0,jsx as Ke,jsxs as vn}from"react/jsx-runtime";var md=[{value:"created",label:"\uC5C5\uBB34 \uB4F1\uB85D \uC2DC",hint:"\uC0C8 \uC5C5\uBB34\uAC00 \uB9CC\uB4E4\uC5B4\uC9C4 \uC9C1\uD6C4 \uD55C \uBC88 \uC2E4\uD589\uD569\uB2C8\uB2E4."},{value:"status_changed",label:"\uC0C1\uD0DC \uBCC0\uACBD \uC2DC",hint:"\uC0C1\uD0DC\uAC00 \uC2E4\uC81C\uB85C \uBC14\uB010 \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4."},{value:"commented",label:"\uB313\uAE00\uC774 \uB2EC\uB838\uC744 \uB54C",hint:"\uB313\uAE00\uC774 \uC0C8\uB85C \uB2EC\uB9AC\uAC70\uB098 \uC218\uC815\uB41C \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4(\uD68C\uC2E0\uC744 \uBC1B\uC740 \uC790\uB9AC)."},{value:"manager_assigned",label:"\uCC45\uC784\uC790\uAC00 \uC9C0\uC815\uB410\uC744 \uB54C",hint:"\uCC45\uC784\uC790\uAC00 \uC0C8\uB85C \uC9C0\uC815\uB418\uAC70\uB098 \uBC14\uB010 \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4."},{value:"attachment_added",label:"\uCCA8\uBD80\uAC00 \uC62C\uB77C\uC654\uC744 \uB54C",hint:"\uC5C5\uBB34\uC5D0 \uD30C\uC77C\uC774 \uCCA8\uBD80\uB41C \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4(\uC99D\uBE59 \uC811\uC218 \uC790\uB9AC)."},{value:"field_changed",label:"\uD544\uB4DC\uAC00 \uBC14\uB00C\uC5C8\uC744 \uB54C",hint:"\uC9C0\uC815\uD55C \uD544\uB4DC\uAC00 \uC2E4\uC81C\uB85C \uBC14\uB010 \uC9C1\uD6C4 \uC2E4\uD589\uD569\uB2C8\uB2E4(\uD544\uB4DC\uB97C \uC548 \uACE0\uB974\uBA74 \uC544\uBB34 \uC218\uC815\uC5D0\uB098 \uC2E4\uD589)."},{value:"overdue",label:"\uB9C8\uAC10 \uACBD\uACFC \uC2DC",hint:"\uB9C8\uAC10\uC774 \uC9C0\uB09C \uBBF8\uC644\uB8CC \uC5C5\uBB34\uB97C \uB9E4\uC77C \uC810\uAC80\uD574 \uC2E4\uD589\uD569\uB2C8\uB2E4."}],ra=[{value:"due_date",label:"\uB9C8\uAC10\uC77C\uC2DC"},{value:"start_date",label:"\uC2DC\uC791\uC77C\uC2DC"},{value:"priority",label:"\uC911\uC694\uB3C4"},{value:"manager_account_seq",label:"\uCC45\uC784\uC790"},{value:"receiver_account_seqs",label:"\uCC38\uC870\uC790"},{value:"label_keys",label:"\uB77C\uBCA8"},{value:"group_seq",label:"\uD504\uB85C\uC81D\uD2B8"},{value:"sprint_seq",label:"\uBAA9\uD45C"},{value:"content",label:"\uB0B4\uC6A9"},{value:"note",label:"\uBE44\uACE0"}],Yl=[{value:"high",label:"\uB192\uC74C"},{value:"medium",label:"\uC911\uAC04"},{value:"low",label:"\uB0AE\uC74C"}];function Kl(){return{name:"",trigger:"created",enabled:!0,sort_no:0,condition:{},action:{}}}function Gl(e){return nn.find(h=>h.key===e)?.name??e}function dS(e,h,b){let{condition:l,action:o}=e,s=[];if(l.group_seq){let n=h.find(c=>Go(c.key)===l.group_seq);s.push(`\uD504\uB85C\uC81D\uD2B8=${n?.label??`#${l.group_seq}`}`)}l.is_bug===!0&&s.push("\uC624\uB958\uB9CC"),l.is_event===!0&&s.push("\uC77C\uC815\uB9CC"),l.priority&&s.push(`\uC911\uC694\uB3C4=${Yl.find(n=>n.value===l.priority)?.label}`),l.label_key&&s.push(`\uB77C\uBCA8=${b.find(n=>n.key===l.label_key)?.name??l.label_key}`),l.title_contains&&s.push(`\uC81C\uBAA9\uC5D0 "${l.title_contains}" \uD3EC\uD568`),l.status&&s.push(`\uC0C1\uD0DC=${Gl(l.status)}`),l.from_status&&s.push(`${Gl(l.from_status)}\uC5D0\uC11C`),l.to_status&&s.push(`${Gl(l.to_status)}\uB85C`),l.manager_empty===!0&&s.push("\uCC45\uC784\uC790 \uC5C6\uC74C"),l.manager_empty===!1&&s.push("\uCC45\uC784\uC790 \uC788\uC74C"),l.manager_account_seq&&s.push(`\uCC45\uC784\uC790=${l.manager_name||`\uACC4\uC815 #${l.manager_account_seq}`}`),l.receiver_account_seq&&s.push(`\uCC38\uC870\uC790\uC5D0 ${l.receiver_name||`\uACC4\uC815 #${l.receiver_account_seq}`}`),l.changed_field&&s.push(`${ra.find(n=>n.value===l.changed_field)?.label??l.changed_field} \uBCC0\uACBD`),l.comment_contains&&s.push(`\uB313\uAE00\uC5D0 "${l.comment_contains}" \uD3EC\uD568`),l.comment_by_others===!0&&s.push("\uB0A8\uC774 \uC4F4 \uB313\uAE00"),typeof l.overdue_days=="number"&&s.push(`${l.overdue_days}\uC77C \uACBD\uACFC`);let r=[];o.set_status&&r.push(`\uC0C1\uD0DC=${Gl(o.set_status)}`),o.set_priority&&r.push(`\uC911\uC694\uB3C4=${Yl.find(n=>n.value===o.set_priority)?.label}`),o.assign_manager_account_seq&&r.push(`\uCC45\uC784\uC790=${o.assign_manager_name||"\uC9C0\uC815"}`),o.add_receiver_account_seq&&r.push(`\uCC38\uC870\uC790 + ${o.add_receiver_name||"\uC9C0\uC815"}`),o.add_label_key&&r.push(`\uB77C\uBCA8 + ${b.find(n=>n.key===o.add_label_key)?.name??o.add_label_key}`),o.apply_content_template_seq&&r.push(`\uBCF8\uBB38 \uC591\uC2DD=${o.apply_content_template_name||"\uC9C0\uC815"}`),o.notify_account_seq&&r.push("\uC54C\uB9BC \uBC1C\uC1A1");let t=md.find(n=>n.value===e.trigger)?.label??e.trigger;return{left:s.length>0?`${t} \xB7 ${s.join(", ")}`:t,right:r.join(", ")||"\uB3D9\uC791 \uC5C6\uC74C"}}var b0={fontSize:16,fontWeight:700,color:"#37352f"},fS={display:"flex",alignItems:"center",gap:1},hS={width:104,flexShrink:0,fontSize:16,color:"#37352f"};function sV({open:e,rules:h,customTabs:b,statusOptions:l,contentTemplates:o=[],onPickAccount:s,onClose:r,onCreate:t,onUpdate:n,onToggle:c,onRemove:i}){let[a,d]=ns(!1),[f,u]=ns(0),[g,m]=ns(Kl()),[x,_]=ns(!1),B=iS(null),[A,j]=ns(null),[D,P]=ns(null);d0(()=>{if(e)return;let H=window.setTimeout(()=>{d(!1),u(0),m(Kl())},500);return()=>window.clearTimeout(H)},[e]),d0(()=>{if(!a)return;let H=window.setTimeout(()=>B.current?.focus(),120);return()=>window.clearTimeout(H)},[a]);let N=f>0,q=g.trigger,z=()=>{d(!1),u(0),m(Kl())},T=(H,Z)=>{m(J=>{let G={...J.condition};return Z===""||Z===void 0||Z===null?delete G[H]:G[H]=Z,{...J,condition:G}})},C=(H,Z)=>{m(J=>{let G={...J.action};return Z===""||Z===void 0||Z===null?delete G[H]:G[H]=Z,{...J,action:G}})},R=H=>{m(Z=>{let J={...Z.condition};return H!=="status_changed"&&(delete J.from_status,delete J.to_status),H!=="overdue"&&delete J.overdue_days,H!=="field_changed"&&delete J.changed_field,H!=="commented"&&(delete J.comment_contains,delete J.comment_by_others),H==="field_changed"&&J.changed_field===void 0&&(J.changed_field=ra[0]?.value??""),{...Z,trigger:H,condition:J}})},p=b.filter(H=>!H.archived),y=l.map(H=>({value:H.key,label:H.name})),v=nn.map(H=>({value:H.key,label:H.name})),w=p.map(H=>({value:String(Go(H.key)),label:H.label})),{condition:k,action:S}=g,E=k.is_bug!==void 0||k.is_event!==void 0,L=[...k.group_seq===void 0&&w.length>0?[{key:"group_seq",label:"\uD504\uB85C\uC81D\uD2B8\uAC00 ~\uC778 \uACBD\uC6B0"}]:[],...E?[]:[{key:"kind",label:"\uC885\uB958\uAC00 \uC624\uB958/\uC77C\uC815\uC778 \uACBD\uC6B0"}],...k.priority===void 0?[{key:"priority",label:"\uC911\uC694\uB3C4\uAC00 ~\uC778 \uACBD\uC6B0"}]:[],...k.label_key===void 0&&y.length>0?[{key:"label_key",label:"\uB77C\uBCA8\uC774 \uBD99\uC5B4 \uC788\uB294 \uACBD\uC6B0"}]:[],...k.title_contains===void 0?[{key:"title_contains",label:"\uC81C\uBAA9\uC5D0 ~ \uB2E8\uC5B4\uAC00 \uD3EC\uD568\uB41C \uACBD\uC6B0"}]:[],...k.manager_empty===void 0?[{key:"manager_empty",label:"\uCC45\uC784\uC790\uAC00 \uC5C6\uB294/\uC788\uB294 \uACBD\uC6B0"}]:[],...s&&k.manager_account_seq===void 0?[{key:"manager_account",label:"\uCC45\uC784\uC790\uAC00 ~\uC778 \uACBD\uC6B0"}]:[],...s&&k.receiver_account_seq===void 0?[{key:"receiver_account",label:"\uCC38\uC870\uC790\uC5D0 ~\uAC00 \uD3EC\uD568\uB41C \uACBD\uC6B0"}]:[],...q==="status_changed"&&k.from_status===void 0?[{key:"from_status",label:"\uC774 \uC0C1\uD0DC\uC5D0\uC11C \uBC14\uB010 \uACBD\uC6B0"}]:[],...q==="status_changed"&&k.to_status===void 0?[{key:"to_status",label:"\uC774 \uC0C1\uD0DC\uB85C \uBC14\uB010 \uACBD\uC6B0"}]:[],...q==="field_changed"&&k.changed_field===void 0?[{key:"changed_field",label:"~ \uD544\uB4DC\uAC00 \uBCC0\uACBD\uB41C \uACBD\uC6B0"}]:[],...q==="commented"&&k.comment_contains===void 0?[{key:"comment_contains",label:"\uB313\uAE00\uC5D0 ~ \uB2E8\uC5B4\uAC00 \uD3EC\uD568\uB41C \uACBD\uC6B0"}]:[],...q==="commented"&&k.comment_by_others===void 0?[{key:"comment_by_others",label:"\uCC45\uC784\uC790\uAC00 \uC544\uB2CC \uC0AC\uB78C\uC774 \uC4F4 \uACBD\uC6B0"}]:[],...q==="overdue"&&k.overdue_days===void 0?[{key:"overdue_days",label:"\uB9C8\uAC10 \uD6C4 \uBA70\uCE60 \uC9C0\uB09C \uACBD\uC6B0"}]:[]],$=async H=>{if(!s)return;let Z=H==="manager_account"?k.manager_account_seq??0:k.receiver_account_seq??0,J=await s(Z,H==="manager_account"?"\uCC45\uC784\uC790":"\uCC38\uC870\uC790");J&&m(G=>{let X={...G.condition};return H==="manager_account"?(X.manager_account_seq=J.accountSeq,X.manager_name=J.name):(X.receiver_account_seq=J.accountSeq,X.receiver_name=J.name),{...G,condition:X}})},U=H=>{j(null),H==="group_seq"?T("group_seq",Number(w[0]?.value)||0):H==="kind"?T("is_bug",!0):H==="priority"?T("priority","high"):H==="label_key"?T("label_key",y[0]?.value??""):H==="title_contains"?m(Z=>({...Z,condition:{...Z.condition,title_contains:""}})):H==="manager_empty"?T("manager_empty",!0):H==="manager_account"||H==="receiver_account"?$(H):H==="from_status"?T("from_status",nn[0]?.key??""):H==="to_status"?T("to_status",nn[0]?.key??""):H==="changed_field"?T("changed_field",ra[0]?.value??""):H==="comment_contains"?m(Z=>({...Z,condition:{...Z.condition,comment_contains:""}})):H==="comment_by_others"?T("comment_by_others",!0):H==="overdue_days"&&T("overdue_days",1)},O=H=>{if(H==="kind"){T("is_bug",""),T("is_event","");return}if(H==="manager_account"){T("manager_account_seq",""),T("manager_name","");return}if(H==="receiver_account"){T("receiver_account_seq",""),T("receiver_name","");return}T(H==="group_seq"?"group_seq":H,"")},W=[...S.set_status===void 0?[{key:"set_status",label:"\uC0C1\uD0DC \uBC14\uAFB8\uAE30"}]:[],...S.set_priority===void 0?[{key:"set_priority",label:"\uC911\uC694\uB3C4 \uBC14\uAFB8\uAE30"}]:[],...S.add_label_key===void 0&&y.length>0?[{key:"add_label_key",label:"\uB77C\uBCA8 \uBD99\uC774\uAE30"}]:[],...s&&S.assign_manager_account_seq===void 0?[{key:"assign_manager",label:"\uCC45\uC784\uC790 \uC9C0\uC815\uD558\uAE30"}]:[],...s&&S.add_receiver_account_seq===void 0?[{key:"add_receiver",label:"\uCC38\uC870\uC790 \uCD94\uAC00\uD558\uAE30"}]:[],...o.length>0&&S.apply_content_template_seq===void 0?[{key:"apply_content_template",label:"\uBCF8\uBB38 \uC591\uC2DD \uCC44\uC6B0\uAE30"}]:[],...s&&S.notify_account_seq===void 0?[{key:"notify",label:"\uC54C\uB9BC \uBCF4\uB0B4\uAE30"}]:[]],M=async H=>{if(!s)return;let Z=H==="assign_manager"?S.assign_manager_account_seq??0:H==="add_receiver"?S.add_receiver_account_seq??0:S.notify_account_seq??0,J=await s(Z,H==="assign_manager"?"\uCC45\uC784\uC790":H==="add_receiver"?"\uCC38\uC870\uC790":"\uC54C\uB9BC \uBC1B\uC744 \uC0AC\uB78C");J&&m(G=>{let X={...G.action};return H==="assign_manager"?(X.assign_manager_account_seq=J.accountSeq,X.assign_manager_name=J.name):H==="add_receiver"?(X.add_receiver_account_seq=J.accountSeq,X.add_receiver_name=J.name):(X.notify_account_seq=J.accountSeq,X.notify_name=J.name),{...G,action:X}})},I=H=>{if(P(null),H==="set_status")C("set_status",nn[0]?.key??"");else if(H==="set_priority")C("set_priority","high");else if(H==="add_label_key")C("add_label_key",y[0]?.value??"");else if(H==="apply_content_template"){let Z=o[0];m(J=>({...J,action:{...J.action,apply_content_template_seq:Z?.seq??0,apply_content_template_name:Z?.name??""}}))}else M(H)},F=H=>{H==="assign_manager"?(C("assign_manager_account_seq",""),C("assign_manager_name","")):H==="add_receiver"?(C("add_receiver_account_seq",""),C("add_receiver_name","")):H==="apply_content_template"?(C("apply_content_template_seq",""),C("apply_content_template_name","")):H==="notify"?(C("notify_account_seq",""),C("notify_name",""),C("notify_message","")):C(H,"")},V=async()=>{if(!g.name.trim()){g0({message:"\uADDC\uCE59 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694."});return}if(Object.keys(g.action).length===0){g0({message:"\uB3D9\uC791\uC744 \uD558\uB098 \uC774\uC0C1 \uCD94\uAC00\uD558\uC138\uC694."});return}let H=N?g.sort_no:h.reduce((J,G)=>Math.max(J,G.sort_no),0)+1;_(!0);let Z=N?await n(f,{...g,sort_no:H}):await t({...g,sort_no:H});_(!1),Z&&z()},Y=(H,Z,J,G)=>vn(nr,{sx:fS,children:[Ke(nr,{sx:hS,children:H}),vn(nr,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:G?"column":"row",alignItems:G?"stretch":"center",gap:G?.5:1},children:[Z,G?Ke(nr,{sx:{fontSize:13.5,color:"#37352f"},children:G}):null]}),Ke(p0,{title:"\uC774 \uC904 \uBE7C\uAE30",arrow:!0,disableInteractive:!0,children:Ke(hd,{size:"small","aria-label":`${H} \uC904 \uBE7C\uAE30`,onClick:J,children:Ke(cS,{sx:{fontSize:16}})})})]}),K=()=>vn(nr,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[Ke(ta,{size:"medium",label:"\uADDC\uCE59 \uC774\uB984",inputRef:B,placeholder:"\uC608: \uC811\uC218 \uC624\uB958 \uC790\uB3D9 \uBC30\uC815",value:g.name,onChange:H=>m(Z=>({...Z,name:H.target.value}))}),Ke(nr,{sx:{display:"flex",alignItems:"center",gap:2,flexWrap:"wrap"},children:md.map(H=>{let Z=q===H.value;return Ke(Pn,{disableElevation:!0,variant:Z?"contained":"outlined",color:Z?"primary":"inherit",onClick:()=>R(H.value),sx:{borderRadius:99,px:1.75,...Z?{}:{color:"#57564f",borderColor:"#d9d9d6"}},children:H.label},H.value)})}),Ke(nr,{sx:{fontSize:13,color:"#787774",mt:-.5},children:md.find(H=>H.value===q)?.hint}),vn(nr,{sx:{display:"flex",alignItems:"center",gap:1,mt:.5},children:[Ke(nr,{sx:b0,children:"\uC5B4\uB5A4 \uC5C5\uBB34\uC77C \uB54C"}),L.length>0?Ke(Pn,{size:"small",startIcon:Ke(pd,{sx:{fontSize:16}}),onClick:H=>j(H.currentTarget),sx:{color:"#2563eb",minWidth:0},children:"\uC870\uAC74 \uCD94\uAC00"}):null]}),k.group_seq!==void 0?Y("\uD504\uB85C\uC81D\uD2B8",Ke(cn,{size:"medium",fullWidth:!0,label:"",value:String(k.group_seq),options:w,onChange:H=>T("group_seq",Number(H.target.value)||"")}),()=>O("group_seq")):null,E?Y("\uC885\uB958",Ke(cn,{size:"medium",fullWidth:!0,label:"",value:k.is_bug?"bug":"event",options:[{value:"bug",label:"\uC624\uB958\uB9CC"},{value:"event",label:"\uC77C\uC815\uB9CC"}],onChange:H=>{let Z=H.target.value==="bug";T("is_bug",Z?!0:""),T("is_event",Z?"":!0)}}),()=>O("kind")):null,k.priority!==void 0?Y("\uC911\uC694\uB3C4",Ke(cn,{size:"medium",fullWidth:!0,label:"",value:k.priority,options:Yl,onChange:H=>T("priority",H.target.value)}),()=>O("priority")):null,k.label_key!==void 0?Y("\uB77C\uBCA8",Ke(cn,{size:"medium",fullWidth:!0,label:"",value:k.label_key,options:y,onChange:H=>T("label_key",H.target.value)}),()=>O("label_key")):null,k.title_contains!==void 0?Y("\uC81C\uBAA9",Ke(ta,{size:"medium",fullWidth:!0,placeholder:"\uD3EC\uD568\uD560 \uB0B1\uB9D0 (\uC608: \uAE34\uAE09)",value:k.title_contains,onChange:H=>m(Z=>({...Z,condition:{...Z.condition,title_contains:H.target.value}}))}),()=>O("title_contains")):null,k.manager_empty!==void 0?Y("\uCC45\uC784\uC790",Ke(cn,{size:"medium",fullWidth:!0,label:"",value:k.manager_empty?"empty":"assigned",options:[{value:"empty",label:"\uC5C6\uC74C"},{value:"assigned",label:"\uC788\uC74C"}],onChange:H=>T("manager_empty",H.target.value==="empty")}),()=>O("manager_empty")):null,k.manager_account_seq!==void 0?Y("\uCC45\uC784\uC790",Ke(Pn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{$("manager_account")},children:k.manager_name||`\uACC4\uC815 #${k.manager_account_seq}`}),()=>O("manager_account")):null,k.receiver_account_seq!==void 0?Y("\uCC38\uC870\uC790",Ke(Pn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{$("receiver_account")},children:k.receiver_name||`\uACC4\uC815 #${k.receiver_account_seq}`}),()=>O("receiver_account")):null,k.from_status!==void 0?Y("\uC774 \uC0C1\uD0DC\uC5D0\uC11C",Ke(cn,{size:"medium",fullWidth:!0,label:"",value:k.from_status,options:v,onChange:H=>T("from_status",H.target.value)}),()=>O("from_status")):null,k.to_status!==void 0?Y("\uC774 \uC0C1\uD0DC\uB85C",Ke(cn,{size:"medium",fullWidth:!0,label:"",value:k.to_status,options:v,onChange:H=>T("to_status",H.target.value)}),()=>O("to_status")):null,k.changed_field!==void 0?Y("\uBCC0\uACBD \uD544\uB4DC",Ke(cn,{size:"medium",fullWidth:!0,label:"",value:k.changed_field,options:ra,onChange:H=>T("changed_field",H.target.value)}),()=>O("changed_field")):null,k.comment_contains!==void 0?Y("\uB313\uAE00 \uB0B1\uB9D0",Ke(ta,{size:"medium",fullWidth:!0,placeholder:"\uD3EC\uD568\uD560 \uB0B1\uB9D0 (\uC608: \uD68C\uC2E0)",value:k.comment_contains,onChange:H=>m(Z=>({...Z,condition:{...Z.condition,comment_contains:H.target.value}}))}),()=>O("comment_contains")):null,k.comment_by_others!==void 0?Y("\uB313\uAE00 \uC791\uC131\uC790",Ke(cn,{size:"medium",fullWidth:!0,label:"",value:k.comment_by_others?"others":"any",options:[{value:"others",label:"\uCC45\uC784\uC790\uAC00 \uC544\uB2CC \uC0AC\uB78C"},{value:"any",label:"\uB204\uAD6C\uB4E0"}],onChange:H=>T("comment_by_others",H.target.value==="others")}),()=>O("comment_by_others")):null,k.overdue_days!==void 0?Y("\uACBD\uACFC\uC77C",Ke(ta,{size:"medium",fullWidth:!0,type:"number",value:String(k.overdue_days),onChange:H=>T("overdue_days",Math.max(0,Number(H.target.value)||0)),helperText:"\uB9C8\uAC10 \uD6C4 \uBA70\uCE60 \uC9C0\uB0AC\uC744 \uB54C\uBD80\uD130 \uC2E4\uD589\uD560\uC9C0"}),()=>O("overdue_days")):null,Object.keys(k).length===0?Ke(nr,{sx:{fontSize:13.5,color:"#9a9a97"},children:"\uC870\uAC74\uC774 \uC5C6\uC73C\uBA74 \uBAA8\uB4E0 \uC5C5\uBB34\uC5D0 \uC2E4\uD589\uB429\uB2C8\uB2E4."}):null,vn(nr,{sx:{display:"flex",alignItems:"center",gap:1,mt:.5},children:[Ke(nr,{sx:b0,children:"\uBB34\uC5C7\uC744 \uD560\uAE4C\uC694"}),W.length>0?Ke(Pn,{size:"small",startIcon:Ke(pd,{sx:{fontSize:16}}),onClick:H=>P(H.currentTarget),sx:{color:"#2563eb",minWidth:0},children:"\uB3D9\uC791 \uCD94\uAC00"}):null]}),S.set_status!==void 0?Y("\uC0C1\uD0DC",Ke(cn,{size:"medium",fullWidth:!0,label:"",value:S.set_status,options:v,onChange:H=>C("set_status",H.target.value)}),()=>F("set_status")):null,S.set_priority!==void 0?Y("\uC911\uC694\uB3C4",Ke(cn,{size:"medium",fullWidth:!0,label:"",value:S.set_priority,options:Yl,onChange:H=>C("set_priority",H.target.value)}),()=>F("set_priority")):null,S.apply_content_template_seq!==void 0?Y("\uBCF8\uBB38 \uC591\uC2DD",Ke(cn,{size:"medium",fullWidth:!0,label:"",value:String(S.apply_content_template_seq),options:o.map(H=>({value:String(H.seq),label:H.name})),onChange:H=>{let Z=o.find(J=>String(J.seq)===String(H.target.value));m(J=>({...J,action:{...J.action,apply_content_template_seq:Z?.seq??0,apply_content_template_name:Z?.name??""}}))}}),()=>F("apply_content_template"),"\uBCF8\uBB38\uC774 \uBE44\uC5B4 \uC788\uC744 \uB54C\uB9CC \uCC44\uC6C1\uB2C8\uB2E4(\uC4F4 \uB0B4\uC6A9\uC744 \uB36E\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4)"):null,S.add_label_key!==void 0?Y("\uB77C\uBCA8",Ke(cn,{size:"medium",fullWidth:!0,label:"",value:S.add_label_key,options:y,onChange:H=>C("add_label_key",H.target.value)}),()=>F("add_label_key")):null,S.assign_manager_account_seq!==void 0?Y("\uCC45\uC784\uC790",Ke(Pn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{M("assign_manager")},children:S.assign_manager_name||`\uACC4\uC815 #${S.assign_manager_account_seq}`}),()=>F("assign_manager")):null,S.add_receiver_account_seq!==void 0?Y("\uCC38\uC870\uC790",Ke(Pn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{M("add_receiver")},children:S.add_receiver_name||`\uACC4\uC815 #${S.add_receiver_account_seq}`}),()=>F("add_receiver")):null,S.notify_account_seq!==void 0?Y("\uC54C\uB9BC",vn(y0,{children:[Ke(Pn,{size:"medium",variant:"outlined",color:"inherit",onClick:()=>{M("notify")},sx:{flexShrink:0},children:S.notify_name||`\uACC4\uC815 #${S.notify_account_seq}`}),Ke(ta,{size:"medium",fullWidth:!0,placeholder:"\uC54C\uB9BC \uBB38\uAD6C(\uBE44\uC6B0\uBA74 \uAE30\uBCF8 \uBB38\uAD6C)",value:S.notify_message??"",onChange:H=>C("notify_message",H.target.value)})]}),()=>F("notify")):null,Object.keys(S).length===0?Ke(nr,{sx:{fontSize:13.5,color:"#9a9a97"},children:'"+ \uB3D9\uC791 \uCD94\uAC00" \uB85C \uD560 \uC77C\uC744 \uD558\uB098 \uC774\uC0C1 \uACE8\uB77C \uC8FC\uC138\uC694.'}):null,Ke(f0,{transitionDuration:0,anchorEl:A,open:!!A,onClose:()=>j(null),children:L.map(H=>Ke(h0,{dense:!0,onClick:()=>U(H.key),sx:{fontSize:14},children:H.label},H.key))}),Ke(f0,{transitionDuration:0,anchorEl:D,open:!!D,onClose:()=>P(null),children:W.map(H=>Ke(h0,{dense:!0,onClick:()=>I(H.key),sx:{fontSize:14},children:H.label},H.key))})]});return vn(y0,{children:[Ke(m0,{open:e,onClose:r,maxWidth:"sm",title:"\uC790\uB3D9\uD654 \uADDC\uCE59",locale:"ko",titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-rule-manage",tabs:{visible:!1},contentPaddingX:0,contentTopPadding:0,contentBottomPadding:0,sectionContentPaddingTop:0,sections:[{id:"rules",title:"",showTitle:!1,children:vn(nr,{sx:{display:"flex",flexDirection:"column",px:2.5,py:2},children:[h.length===0?vn(nr,{sx:{py:4,display:"flex",flexDirection:"column",alignItems:"center",gap:2,color:"#9a9a97"},children:[Ke(lS,{sx:{fontSize:48,color:"#d9d9d6"}}),Ke(nr,{sx:{fontSize:15},children:"\uB4F1\uB85D\uB41C \uADDC\uCE59\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."})]}):null,h.map(H=>vn(nr,{sx:{display:"flex",alignItems:"center",gap:2,py:1,"&:not(:last-of-type)":{borderBottom:"1px solid #ececea"},opacity:H.enabled?1:.5},children:[Ke(p0,{title:H.enabled?"\uC0AC\uC6A9 \uC911":"\uAEBC\uC9D0",arrow:!0,disableInteractive:!0,children:Ke(sS,{size:"small",inputProps:{"aria-label":`${H.name} \uADDC\uCE59 \uC0AC\uC6A9`},checked:H.enabled,onChange:(Z,J)=>c(H.seq,J)})}),vn(nr,{sx:{flex:1,minWidth:0},children:[Ke(nr,{sx:{fontSize:16,fontWeight:600,color:"#37352f"},children:H.name}),(()=>{let Z=dS(H,b,l);return vn(nr,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5,fontSize:15,color:"#6f6f6c"},children:[Ke(nr,{component:"span",children:Z.left}),Ke(aS,{sx:{fontSize:18,color:"#9a9a97",flexShrink:0}}),Ke(nr,{component:"span",children:Z.right})]})})()]}),Ke(hd,{size:"small","aria-label":`${H.name} \uADDC\uCE59 \uC218\uC815`,onClick:()=>{u(H.seq),m({name:H.name,trigger:H.trigger,enabled:H.enabled,sort_no:H.sort_no,condition:{...H.condition,...H.trigger==="field_changed"&&H.condition.changed_field===void 0?{changed_field:ra[0]?.value??""}:{}},action:{...H.action}}),d(!0)},children:Ke(uS,{sx:{fontSize:18}})}),Ke(hd,{size:"small","aria-label":`${H.name} \uADDC\uCE59 \uC0AD\uC81C`,onClick:()=>i(H.seq),children:Ke(cr,{sx:{fontSize:18}})})]},H.seq))]})}],actions:{showCancelButton:!1,left:Ke(Pn,{startIcon:Ke(pd,{}),onClick:()=>{u(0),m(Kl()),d(!0)},sx:{color:"#2563eb"},children:"\uC0C8 \uADDC\uCE59"}),right:Ke(Pn,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})}}),Ke(m0,{open:a,onClose:z,maxWidth:"sm",title:N?"\uADDC\uCE59 \uC218\uC815":"\uC0C8 \uADDC\uCE59",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-rule-form",tabs:{visible:!1},sectionContentPaddingTop:0,sections:[{id:"rule-form",title:"",showTitle:!1,children:K()}],actions:{showCancelButton:!0,right:Ke(Pn,{variant:"contained",onClick:()=>{V()},disabled:x,children:N?"\uC218\uC815":"\uADDC\uCE59 \uCD94\uAC00"})}})]})}import{useEffect as x0,useRef as gd,useState as os}from"react";import{Box as Qt,Button as is,IconButton as na,Tooltip as oa}from"@mui/material";import v0 from"@mui/icons-material/Add";import pS from"@mui/icons-material/EditOutlined";import mS from"@mui/icons-material/ContentCopyOutlined";import gS from"@mui/icons-material/DragIndicator";import bS from"@mui/icons-material/Close";import yS from"@mui/icons-material/PlaylistAddCheckOutlined";import{DndContext as xS,PointerSensor as vS,closestCenter as wS,useSensor as _S,useSensors as kS}from"@dnd-kit/core";import{restrictToParentElement as SS,restrictToVerticalAxis as TS}from"@dnd-kit/modifiers";import{SortableContext as CS,arrayMove as w0,useSortable as BS,verticalListSortingStrategy as IS}from"@dnd-kit/sortable";import{CSS as ES}from"@dnd-kit/utilities";import{FormDialog as _0}from"@ehfuse/mui-form-dialog";import{ClearTextField as bd,LabelSelect as k0,NumberField as S0}from"@ehfuse/mui-form-controls";import MS from"@ehfuse/overlay-scrollbar";import{ConfirmDialog as RS,ErrorAlert as T0}from"@ehfuse/alerts";import{Fragment as NS,jsx as ot,jsxs as wn}from"react/jsx-runtime";var OS=[{value:"high",label:"\uB192\uC74C"},{value:"medium",label:"\uC911\uAC04"},{value:"low",label:"\uB0AE\uC74C"}],C0="\uC5C5\uBB34 \uC81C\uBAA9",yd=2,Xl={flex:1,minWidth:0},B0=56,I0=20,AS=`${I0+yd*8}px`;function Zl(){return{name:"",description:"",group_seq:0,items:[]}}function DS(){return{title:"",start_offset_days:0,due_offset_days:0,priority:"medium"}}function PS({id:e,children:h}){let{attributes:b,listeners:l,setNodeRef:o,transform:s,transition:r,isDragging:t}=BS({id:e});return ot(Qt,{ref:o,sx:{transform:ES.Transform.toString(s),transition:r,...t?{opacity:.6,position:"relative",zIndex:1}:{}},children:h({handleProps:{...b,...l},dragging:t})})}function BV({open:e,templates:h,customTabs:b,onPickAccount:l,onClose:o,onCreate:s,onUpdate:r,onRemove:t,onRun:n}){let[c,i]=os(!1),[a,d]=os(0),[f,u]=os(Zl()),[g,m]=os(!1),[x,_]=os([]),B=gd(0),[A,j]=os(0),D=gd(null),P=gd(null);x0(()=>{if(e)return;let L=window.setTimeout(()=>{i(!1),d(0),u(Zl()),_([])},500);return()=>window.clearTimeout(L)},[e]);let N=()=>(B.current+=1,`template-item-${B.current}`),q=(L,$)=>{d(L),u($),_($.items.map(()=>N())),i(!0)},z=f.items.map((L,$)=>x[$]??`template-item-fallback-${$}`),T=()=>{let L=P.current?.getScrollContainer()??null;if(L){L.scrollTop=L.scrollHeight;return}let $=D.current?.querySelectorAll("*")??[];for(let U of Array.from($))if(U.scrollHeight>U.clientHeight+1){U.scrollTop=U.scrollHeight;return}},C=()=>{let L=D.current;if(!L)return null;let $=L.querySelectorAll("input[data-template-title]"),U=$.length?$:L.querySelectorAll(`input[placeholder="${C0}"]`);return U.length?U[U.length-1]:null};x0(()=>{if(A===0)return;let L=0,$=0,U=()=>{T();let W=C();W&&document.activeElement!==W&&W.focus(),L+=1,!(W&&document.activeElement===W)&&L<8&&($=window.setTimeout(U,50))},O=window.requestAnimationFrame(U);return()=>{window.cancelAnimationFrame(O),window.clearTimeout($)}},[A]);let R=b.filter(L=>!L.archived).map(L=>({value:String(Go(L.key)),label:L.label})),p=(L,$)=>{u(U=>({...U,items:U.items.map((O,W)=>W===L?{...O,...$}:O)}))},y=kS(_S(vS,{activationConstraint:{distance:5}})),v=L=>{let $=String(L.active?.id??""),U=String(L.over?.id??"");if(!$||!U||$===U)return;let O=z.indexOf($),W=z.indexOf(U);O<0||W<0||(u(M=>({...M,items:w0(M.items,O,W)})),_(M=>w0(M,O,W)))},w=async L=>{if(!l)return;let $=await l(f.items[L]?.manager_account_seq??0,"\uCC45\uC784\uC790");$&&p(L,{manager_account_seq:$.accountSeq,manager_name:$.name})},k=async()=>{let L=f.name.trim();if(!L){T0({message:"\uD15C\uD50C\uB9BF \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694."});return}let $=f.items.filter(W=>W.title.trim().length>0);if($.length===0){T0({message:"\uC5C5\uBB34 \uD56D\uBAA9\uC744 \uD55C \uC904 \uC774\uC0C1 \uB123\uC73C\uC138\uC694."});return}m(!0);let U={...f,name:L,items:$},O=a>0?await r(a,U):await s(U);m(!1),O&&(i(!1),d(0),u(Zl()))},S=ot(Qt,{children:h.length===0?wn(Qt,{sx:{py:4,display:"flex",flexDirection:"column",alignItems:"center",gap:2,color:"#9a9a97"},children:[ot(yS,{sx:{fontSize:48,color:"#d9d9d6"}}),ot(Qt,{sx:{fontSize:13.5},children:"\uB4F1\uB85D\uB41C \uD15C\uD50C\uB9BF\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."})]}):h.map(L=>wn(Qt,{sx:{display:"flex",alignItems:"center",gap:2.5,py:1.75,"&:not(:last-of-type)::after":{content:'""',display:"block",my:1.75,borderBottom:"1px solid #f0efed"}},children:[wn(Qt,{sx:{flex:1,minWidth:0},children:[ot(Qt,{sx:{fontSize:18,fontWeight:600,color:"#37352f"},children:L.name}),wn(Qt,{sx:{fontSize:14,color:"#787774",mt:.25},children:["\uC5C5\uBB34 ",L.items.length,"\uAC74",L.description?` \xB7 ${L.description}`:""]})]}),n?ot(is,{size:"medium",variant:"outlined",onClick:()=>n(L),sx:{flexShrink:0},children:"\uC2E4\uD589"}):null,ot(oa,{title:"\uC218\uC815",arrow:!0,disableInteractive:!0,children:ot(na,{size:"medium","aria-label":`${L.name} \uD15C\uD50C\uB9BF \uC218\uC815`,onClick:()=>q(L.seq,{name:L.name,description:L.description??"",group_seq:L.group_seq??0,items:L.items.map($=>({...$}))}),children:ot(pS,{sx:{fontSize:19}})})}),ot(oa,{title:"\uBCF5\uC81C",arrow:!0,disableInteractive:!0,children:ot(na,{size:"medium","aria-label":`${L.name} \uD15C\uD50C\uB9BF \uBCF5\uC81C`,onClick:()=>q(0,{name:`${L.name} \uC0AC\uBCF8`,description:L.description??"",group_seq:L.group_seq??0,items:L.items.map($=>({...$}))}),children:ot(mS,{sx:{fontSize:18}})})}),ot(oa,{title:"\uC0AD\uC81C",arrow:!0,disableInteractive:!0,children:ot(na,{size:"medium","aria-label":`${L.name} \uD15C\uD50C\uB9BF \uC0AD\uC81C`,onClick:()=>{(async()=>await RS({title:"\uD15C\uD50C\uB9BF \uC0AD\uC81C",message:`"${L.name}" \uD15C\uD50C\uB9BF\uC744 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&t(L.seq))()},children:ot(cr,{sx:{fontSize:18}})})})]},L.seq))}),E=wn(Qt,{sx:{display:"flex",flexDirection:"column",gap:3},children:[ot(bd,{size:"medium",label:"\uD15C\uD50C\uB9BF \uC774\uB984",placeholder:"\uC608: \uC2E0\uADDC \uC785\uC0AC\uC790 \uC628\uBCF4\uB529",fullWidth:!0,value:f.name,onChange:L=>u($=>({...$,name:L.target.value}))}),wn(Qt,{sx:{display:"grid",gridTemplateColumns:R.length>0?"1fr 1fr":"1fr",gap:2},children:[ot(bd,{size:"medium",label:"\uC124\uBA85",placeholder:"\uBAA9\uB85D\uC5D0\uC11C \uBB34\uC5C7\uC778\uC9C0 \uC54C\uC544\uBCFC \uD55C \uC904(\uC120\uD0DD)",fullWidth:!0,value:f.description??"",onChange:L=>u($=>({...$,description:L.target.value}))}),R.length>0?ot(k0,{size:"medium",fullWidth:!0,label:"\uB9CC\uB4E4 \uACF3(\uD504\uB85C\uC81D\uD2B8)",value:String(f.group_seq??0),options:[{value:"0",label:"\uAE30\uBCF8 \uC5C5\uBB34\uD568"},...R],onChange:L=>u($=>({...$,group_seq:Number(L.target.value)||0}))}):null]}),wn(Qt,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[ot(Qt,{sx:{fontSize:18,fontWeight:600,color:"#37352f"},children:"\uC5C5\uBB34 \uD56D\uBAA9"}),ot(Qt,{sx:{fontSize:14,color:"#37352f"},children:"\uB0A0\uC9DC\uB294 \uC2E4\uD589\uD560 \uB54C \uACE0\uB974\uB294 \uAE30\uC900\uC77C\uC5D0\uC11C \uACC4\uC0B0\uB429\uB2C8\uB2E4."})]}),f.items.length===0?ot(Qt,{sx:{fontSize:14,color:"#9a9a97",py:2},children:'\uC544\uC9C1 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. "\uD56D\uBAA9 \uCD94\uAC00" \uB85C \uC808\uCC28\uB97C \uC21C\uC11C\uB300\uB85C \uC801\uC73C\uC138\uC694.'}):ot(Qt,{ref:D,sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:ot(MS,{ref:P,style:{maxHeight:"min(560px, 52vh)"},thumb:{width:6},children:ot(xS,{sensors:y,collisionDetection:wS,modifiers:[TS,SS],onDragEnd:v,children:ot(CS,{items:z,strategy:IS,children:f.items.map((L,$)=>ot(PS,{id:z[$],children:({handleProps:U})=>wn(Qt,{sx:{borderBottom:$===f.items.length-1?"none":"1px solid #f2f2f0",px:yd,py:2,gap:2,display:"flex",flexDirection:"column"},children:[wn(Qt,{sx:{display:"flex",alignItems:"center",gap:yd},children:[ot(Qt,{...U,"aria-label":`${$+1}\uBC88 \uD56D\uBAA9 \uC21C\uC11C \uC774\uB3D9`,sx:{display:"inline-flex",alignItems:"center",flexShrink:0,color:"#c9c8c5",cursor:"grab","&:active":{cursor:"grabbing"},touchAction:"none",userSelect:"none"},children:ot(gS,{sx:{fontSize:I0}})}),ot(bd,{size:"medium",fullWidth:!0,placeholder:C0,slotProps:{htmlInput:{"data-template-title":$}},value:L.title,onChange:O=>p($,{title:O.target.value})})]}),wn(Qt,{sx:{display:"flex",alignItems:"center",gap:2,pl:AS},children:[ot(Qt,{sx:Xl,children:ot(S0,{size:"medium",fullWidth:!0,label:"\uC2DC\uC791 D+",thousandSeparator:!1,align:"right",suffix:"\uC77C",value:L.start_offset_days??null,onValueChange:O=>p($,{start_offset_days:O===null?void 0:Math.trunc(Number(O))})})}),ot(Qt,{sx:Xl,children:ot(S0,{size:"medium",fullWidth:!0,label:"\uB9C8\uAC10 D+",thousandSeparator:!1,align:"right",suffix:"\uC77C",value:L.due_offset_days??null,onValueChange:O=>p($,{due_offset_days:O===null?void 0:Math.trunc(Number(O))})})}),ot(Qt,{sx:Xl,children:ot(k0,{size:"medium",fullWidth:!0,label:"\uC911\uC694\uB3C4",value:L.priority??"medium",options:OS,onChange:O=>p($,{priority:O.target.value})})}),l?wn(Qt,{sx:{...Xl,position:"relative"},children:[ot(is,{variant:"outlined",fullWidth:!0,onClick:()=>{w($)},sx:{height:B0,display:"block",textAlign:"left",textTransform:"none",fontSize:16,fontWeight:400,lineHeight:`${B0-2}px`,py:0,px:1.75,pr:L.manager_account_seq?4.5:1.75,borderColor:"#c4c4c4",color:L.manager_name?"#37352f":"#9a9a97",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","&:hover":{borderColor:"#37352f",bgcolor:"transparent"}},children:L.manager_name||"\uCC45\uC784\uC790"}),L.manager_account_seq?ot(oa,{title:"\uCC45\uC784\uC790 \uBE44\uC6B0\uAE30",arrow:!0,disableInteractive:!0,children:ot(na,{size:"small","aria-label":`${$+1}\uBC88 \uD56D\uBAA9 \uCC45\uC784\uC790 \uBE44\uC6B0\uAE30`,onClick:O=>{O.stopPropagation(),p($,{manager_account_seq:0,manager_name:""})},sx:{position:"absolute",right:6,top:"50%",transform:"translateY(-50%)"},children:ot(bS,{sx:{fontSize:18}})})}):null]}):null,ot(oa,{title:"\uD56D\uBAA9 \uC0AD\uC81C",arrow:!0,disableInteractive:!0,children:ot(na,{size:"medium","aria-label":`${$+1}\uBC88 \uD56D\uBAA9 \uC0AD\uC81C`,onClick:()=>{u(O=>({...O,items:O.items.filter((W,M)=>M!==$)})),_(O=>O.filter((W,M)=>M!==$))},children:ot(cr,{sx:{fontSize:18}})})})]})]})},z[$]))})})})})]});return wn(NS,{children:[ot(_0,{open:e,onClose:o,maxWidth:"md",title:"\uC5C5\uBB34 \uD15C\uD50C\uB9BF",locale:"ko",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-task-template",tabs:{visible:!1},actions:{showCancelButton:!1,left:ot(is,{startIcon:ot(v0,{sx:{fontSize:18}}),onClick:()=>q(0,Zl()),children:"\uC0C8 \uD15C\uD50C\uB9BF"}),right:ot(is,{variant:"contained",onClick:o,children:"\uB2EB\uAE30"})},sectionContentPaddingTop:0,sections:[{id:"templates",title:"",showTitle:!1,children:S}]}),ot(_0,{open:c,onClose:()=>i(!1),maxWidth:"md",title:a>0?"\uD15C\uD50C\uB9BF \uC218\uC815":"\uC0C8 \uD15C\uD50C\uB9BF",locale:"ko",backdropClick:!1,fontScale:{enabled:!0},fontScaleKey:"taskbox-task-template-form",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},tabs:{visible:!1},actions:{showCancelButton:!0,left:ot(is,{startIcon:ot(v0,{sx:{fontSize:18}}),onClick:()=>{u(L=>({...L,items:[...L.items,DS()]})),_(L=>[...L,N()]),j(L=>L+1)},children:"\uD56D\uBAA9 \uCD94\uAC00"}),right:ot(is,{variant:"contained",disabled:g,onClick:()=>{k()},children:"\uC800\uC7A5"})},sectionContentPaddingTop:0,sections:[{id:"template-form",title:"",showTitle:!1,children:E}]})]})}import{useEffect as E0,useState as M0}from"react";import{Box as Pr,Button as LS}from"@mui/material";import{FormDialog as jS}from"@ehfuse/mui-form-dialog";import{DateTextField as zS}from"@ehfuse/mui-form-controls";import FS from"@ehfuse/overlay-scrollbar";import{jsx as Yr,jsxs as ia}from"react/jsx-runtime";function LV({open:e,template:h,todayStr:b,running:l=!1,onClose:o,onRun:s}){let[r,t]=M0(b),[n,c]=M0(h);E0(()=>{h&&c(h)},[h]),E0(()=>{e&&t(b)},[e]);let i=h??n,a=i?Mh(i,r):[];return Yr(jS,{open:e,onClose:o,maxWidth:"md",title:i?`${i.name} \uC2E4\uD589`:"\uD15C\uD50C\uB9BF \uC2E4\uD589",locale:"ko",backdropClick:!1,titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-template-run",tabs:{visible:!1},sectionContentPaddingTop:0,actions:{showCancelButton:!0,right:Yr(LS,{variant:"contained",disabled:l||a.length===0,onClick:()=>s(a,r),children:l?"\uB9CC\uB4DC\uB294 \uC911\u2026":`\uC5C5\uBB34 ${a.length}\uAC74 \uB9CC\uB4E4\uAE30`})},sections:[{id:"template-run",title:"",showTitle:!1,children:ia(Pr,{sx:{display:"flex",flexDirection:"column",gap:2},children:[ia(Pr,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[Yr(Pr,{sx:{width:72,flexShrink:0,fontSize:16,color:"#37352f"},children:"\uAE30\uC900\uC77C"}),Yr(zS,{size:"medium",fullWidth:!0,value:r,onChange:d=>t(d.target.value)})]}),Yr(Pr,{sx:{fontSize:14.5,color:"#37352f"},children:"\uC544\uB798 \uC5C5\uBB34\uAC00 \uD55C\uAEBC\uBC88\uC5D0 \uB9CC\uB4E4\uC5B4\uC9D1\uB2C8\uB2E4. \uB0A0\uC9DC\uB294 \uAE30\uC900\uC77C\uC5D0\uC11C \uACC4\uC0B0\uB41C \uAC12\uC785\uB2C8\uB2E4."}),ia(Pr,{sx:{border:"1px solid #e6e6e3",borderRadius:1,overflow:"hidden"},children:[ia(Pr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,bgcolor:"#fafaf9",borderBottom:"1px solid #e6e6e3",fontSize:13.5,fontWeight:600,color:"#37352f"},children:[Yr(Pr,{sx:{flex:1,minWidth:0},children:"\uC5C5\uBB34"}),Yr(Pr,{sx:{width:88,flexShrink:0,textAlign:"center"},children:"\uC2DC\uC791"}),Yr(Pr,{sx:{width:88,flexShrink:0,textAlign:"center"},children:"\uB9C8\uAC10"}),Yr(Pr,{sx:{width:96,flexShrink:0,textAlign:"center"},children:"\uCC45\uC784\uC790"})]}),Yr(FS,{style:{maxHeight:520},thumb:{width:6},children:a.length===0?Yr(Pr,{sx:{p:2,fontSize:14,color:"#9a9a97"},children:"\uB9CC\uB4E4 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):a.map((d,f)=>ia(Pr,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1.25,borderBottom:f===a.length-1?"none":"1px solid #f2f2f0",fontSize:16,fontWeight:500,color:"#111111"},children:[Yr(Pr,{sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.title}),Yr(Pr,{sx:{width:88,flexShrink:0,textAlign:"center",fontSize:13.5,color:d.start_date?"#37352f":"#9a9a97"},children:Bc(d.start_date)||"-"}),Yr(Pr,{sx:{width:88,flexShrink:0,textAlign:"center",fontSize:13.5,color:d.due_date?"#37352f":"#9a9a97"},children:Bc(d.due_date)||"-"}),Yr(Pr,{sx:{width:96,flexShrink:0,textAlign:"center",fontSize:13.5,color:d.manager_name?"#37352f":"#9a9a97",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d.manager_name||"-"})]},f))})]})]})}]})}var qS={urgent:"\uAE34\uAE09",high:"\uB192\uC74C",normal:"\uC911\uAC04",low:"\uB0AE\uC74C"};function $S(e){return e.length===0?"":e.length<=2?e.join(", "):`${e[0]} \uC678 ${e.length-1}\uBA85`}function xd(e){let h=String(e??"").trim().slice(0,10);return/^\d{4}-\d{2}-\d{2}$/.test(h)?`${h.slice(2,4)}.${h.slice(5,7)}.${h.slice(8,10)}`:"-"}function ss(e){let h=b=>String(b).padStart(2,"0");return`${e.getFullYear()}-${h(e.getMonth()+1)}-${h(e.getDate())} ${h(e.getHours())}:${h(e.getMinutes())}`}function vd(e,h){let l=String(e.due_date??"").slice(11,16).trim()||String(e.estimated_time??"").trim(),o=xd(e.due_date),s=String(e.start_date??"").slice(11,16).trim(),r=xd(e.start_date),t=(e.receiver_names??[]).filter(Boolean).map(c=>String(c).trim()),n=(e.checklist??[]).length?`${(e.checklist??[]).filter(c=>c.checked).length}/${(e.checklist??[]).length}`:"";return{seq:Number(e.seq??0),title:String(e.title??"").trim(),statusName:lr(e).name,projectLabel:e.tab_key?h.get(String(e.tab_key))??"":"",managerName:String(e.manager_name??"").trim(),receiverNames:$S(t),receiverNamesFull:t.join(", "),startDate:r!=="-"&&s?`${r} ${s}`:r,dueDate:o!=="-"&&l?`${o} ${l}`:o,priorityName:qS[String(e.priority??"")]??"",checklist:n,note:String(e.note??"").trim(),completed:!!e.completed}}function Dt(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function HS(e,h){if(e===" ")return h*.3;let b=e.codePointAt(0)??0,l=b>=4352&&b<=4607||b>=12288&&b<=40959||b>=44032&&b<=55203||b>=63744&&b<=64255||b>=65280&&b<=65519;return h*(l?1:.55)}function Jl(e,h){let b=0;for(let l of String(e??""))b+=HS(l,h);return b}function as(e,h){let b=String(e??"").trim();if(!b)return["-"];let l=[],o="";for(let s of b){if(s===`
|
|
42
42
|
`){o&&l.push(o),o="";continue}let r=`${o}${s}`;if(r.length>h&&o){l.push(o),o=s;continue}o=r}return o&&l.push(o),l.length>0?l:["-"]}function ki(e,h,b){let l=String(e??"").replace(/\s+/g," ").trim();if(!l)return"";if(Jl(l,b)<=h)return l;let o=Jl("\u2026",b),s="",r=0;for(let t of l){let n=Jl(t,b);if(r+n+o>h)break;s+=t,r+=n}return`${s}\u2026`}var aa=595.28,la=841.89,ca=841.89,ua=595.28,Nr=28,_n=96,un=44,WS="'Malgun Gothic','\uB9D1\uC740 \uACE0\uB515','Apple SD Gothic Neo','Noto Sans KR',sans-serif",US="'Batang','\uBC14\uD0D5','AppleMyungjo','Noto Serif KR',serif",sa="#cbd5e1",VS=[`text { font-family: ${WS}; fill: #000000; }`,`.doc-title { font-family: ${US}; font-size: 20px; font-weight: 700; }`,".doc-sub { font-size: 10.5px; fill: #333333; }",".doc-meta { font-size: 9.5px; fill: #333333; }",".th { font-size: 9.5px; font-weight: 700; fill: #000000; }",".td { font-size: 9px; }",".td.done { fill: #555555; }",".gt { font-size: 10px; font-weight: 700; fill: #000000; }",".label { font-size: 9px; fill: #333333; }",".value { font-size: 10px; }",".section { font-size: 11.5px; font-weight: 700; fill: #000000; }",".pageno { font-size: 9px; fill: #333333; }",`.head { fill: #eef2f7; stroke: ${sa}; stroke-width: 0.5; }`,`.group { fill: #f8fafc; stroke: ${sa}; stroke-width: 0.5; }`,`.frame { fill: none; stroke: ${sa}; stroke-width: 0.5; }`,`.hline { stroke: ${sa}; stroke-width: 0.5; }`,`.vline { stroke: ${sa}; stroke-width: 0.5; }`,".bar { fill: #bfdbfe; stroke: #60a5fa; stroke-width: 0.6; }",".bar.done { fill: #e5e7eb; stroke: #cbd5e1; }",".bar.overdue { fill: #fecaca; stroke: #f87171; }"].join("");function Ro(e,h,b){let l=b-Nr;return[`<text x="${Nr}" y="46" class="doc-title">${Dt(e.documentTitle)}</text>`,`<text x="${Nr}" y="66" class="doc-sub">${Dt(e.subtitle)}</text>`,`<text x="${l}" y="42" class="doc-meta" text-anchor="end">${Dt(e.facilityName)}</text>`,`<text x="${l}" y="58" class="doc-meta" text-anchor="end">\uCD9C\uB825 ${Dt(ss(e.printedAt))}${e.printedBy?` \xB7 ${Dt(e.printedBy)}`:""}</text>`,h?`<text x="${l}" y="74" class="doc-meta" text-anchor="end">${Dt(h)}</text>`:""].join("")}function Oo(e){let{width:h,height:b,body:l,pageIndex:o,pageCount:s}=e;return[`<svg xmlns="http://www.w3.org/2000/svg" width="${h}" height="${b}" viewBox="0 0 ${h} ${b}">`,`<style>${VS}</style>`,`<rect x="0" y="0" width="${h}" height="${b}" fill="#ffffff" />`,l,`<text x="${h/2}" y="${b-22}" class="pageno" text-anchor="middle">${o+1} / ${s}</text>`,"</svg>"].join("")}var _d=ca,O0=ua,Ao=Nr,da=_d-Nr,ha=22,Si=20,Ti=22,fa=5,A0=_n,D0=un,R0=O0-46,pa=[{key:"title",label:"\uC81C\uBAA9",width:250,align:"start"},{key:"status",label:"\uC0C1\uD0DC",width:56,align:"middle"},{key:"start",label:"\uC2DC\uC791",width:86,align:"middle"},{key:"due",label:"\uB9C8\uAC10",width:86,align:"middle"},{key:"manager",label:"\uCC45\uC784\uC790",width:62,align:"middle"},{key:"receivers",label:"\uCC38\uC870\uC790",width:122,align:"start"},{key:"priority",label:"\uC911\uC694\uB3C4",width:52,align:"middle"},{key:"project",label:"\uD504\uB85C\uC81D\uD2B8",width:72,align:"middle"}],wd=pa.reduce((e,h,b)=>(e.push(b===0?Ao:e[b-1]+pa[b-1].width),e),[]);function KS(e){let h=[],b=[],l=A0+ha,o=(s,r)=>{h.push(b),b=[],l=D0+ha,s&&(b.push({kind:"group",label:s,count:r,continued:!0}),l+=Ti)};for(let s of e){s.label&&(l+Ti+Si>R0&&o("",0),b.push({kind:"group",label:s.label,count:s.rows.length,continued:!1}),l+=Ti);for(let r of s.rows)l+Si>R0&&o(s.label,s.rows.length),b.push({kind:"row",completed:r.completed,values:pa.map(t=>{switch(t.key){case"title":return r.title;case"status":return r.statusName;case"project":return r.projectLabel||"\uAE30\uBCF8";case"manager":return r.managerName||"-";case"receivers":return r.receiverNames||"-";case"start":return r.startDate;case"due":return r.dueDate;default:return r.priorityName||"-"}})}),l+=Si}return h.push(b),h.filter((s,r)=>r===0||s.length>0)}function GS(e,h){let b=[];b.push(`<rect x="${Ao}" y="${h}" width="${da-Ao}" height="${ha}" class="head" />`),pa.forEach((o,s)=>{let r=wd[s],t=o.align==="middle"?r+o.width/2:r+fa;b.push(`<text x="${t}" y="${h+ha-7}" class="th" text-anchor="${o.align}">${Dt(o.label)}</text>`)});let l=h+ha;for(let o of e){if(o.kind==="group"){b.push(`<rect x="${Ao}" y="${l}" width="${da-Ao}" height="${Ti}" class="group" />`,`<text x="${Ao+fa}" y="${l+Ti-7}" class="gt">${Dt(o.continued?`${o.label} (\uC774\uC5B4\uC11C)`:o.label)}</text>`,`<text x="${da-fa}" y="${l+Ti-7}" class="gt" text-anchor="end">${o.count}\uAC74</text>`),l+=Ti;continue}pa.forEach((s,r)=>{let t=wd[r],n=s.align==="middle"?t+s.width/2:t+fa;b.push(`<text x="${n}" y="${l+Si-6}" class="${o.completed?"td done":"td"}" text-anchor="${s.align}">${Dt(ki(o.values[r]??"",s.width-fa*2,9))}</text>`)}),b.push(`<line x1="${Ao}" y1="${l+Si}" x2="${da}" y2="${l+Si}" class="hline" />`),l+=Si}return wd.slice(1).forEach(o=>{b.push(`<line x1="${o}" y1="${h}" x2="${o}" y2="${l}" class="vline" />`)}),b.push(`<rect x="${Ao}" y="${h}" width="${da-Ao}" height="${l-h}" class="frame" />`),b.join("")}async function YS(e,h){let b=KS(h),l=h.reduce((o,s)=>o+s.rows.length,0);return b.map((o,s)=>{let r=s===0?A0:D0,t=[s===0?Ro(e,`\uC804\uCCB4 ${l}\uAC74`,_d):"",GS(o,r)].join("");return Oo({width:_d,height:O0,body:t,pageIndex:s,pageCount:b.length})})}var Sd=aa,P0=la,ro=Nr,Ql=Sd-Nr,XS=P0-46,N0=22,ZS=68,JS=(Ql-ro)/2,QS=14,kd=58;function ls(e){switch(e.kind){case"title":return 34;case"props":return Math.ceil(e.pairs.length/2)*N0+10;case"section":return 26;default:return QS}}function eT(e){let h=[{kind:"title",text:e.title,ticket:e.ticketNo}];return h.push({kind:"props",pairs:e.properties}),h.push({kind:"section",text:"\uB0B4\uC6A9"}),(e.content.trim()?e.content.split(`
|
|
43
43
|
`).flatMap(l=>l.trim()?as(l,kd):[""]):["(\uB0B4\uC6A9 \uC5C6\uC74C)"]).forEach(l=>h.push({kind:"line",text:l,muted:!e.content.trim()})),e.checklist.length>0&&(h.push({kind:"section",text:`\uD560\uC77C (${e.checklist.filter(l=>l.checked).length}/${e.checklist.length})`}),e.checklist.forEach(l=>{as(l.label,kd-3).forEach((o,s)=>h.push({kind:s===0?"check":"line",text:o,checked:l.checked}))})),e.includeComments&&e.comments.length>0&&(h.push({kind:"section",text:`\uB313\uAE00 (${e.comments.length})`}),e.comments.forEach(l=>{h.push({kind:"line",text:`${l.author} \xB7 ${l.time}`,muted:!0}),as(l.text,kd).forEach(o=>h.push({kind:"line",text:o}))})),h}function tT(e){let h=[],b=[],l=_n;for(let o of e){let s=ls(o);l+s>XS&&(h.push(b),b=[],l=un),b.push(o),l+=s}return h.push(b),h}function rT(e,h){switch(e.kind){case"title":{let b=e.ticket?`<text x="${Ql}" y="${h+16}" class="doc-meta" text-anchor="end">${Dt(e.ticket)}</text>`:"";return{markup:`<text x="${ro}" y="${h+16}" class="section" style="font-size:14px">${Dt(e.text)}</text>${b}<line x1="${ro}" y1="${h+24}" x2="${Ql}" y2="${h+24}" class="hline" />`,nextY:h+ls(e)}}case"props":{let b=[];return e.pairs.forEach((l,o)=>{let s=o%2,r=Math.floor(o/2),t=ro+s*JS,n=h+r*N0;b.push(`<text x="${t}" y="${n+14}" class="label">${Dt(l.label)}</text>`,`<text x="${t+ZS}" y="${n+14}" class="value">${Dt(as(l.value||"-",26)[0]??"-")}</text>`)}),{markup:b.join(""),nextY:h+ls(e)}}case"section":return{markup:`<text x="${ro}" y="${h+16}" class="section">${Dt(e.text)}</text><line x1="${ro}" y1="${h+21}" x2="${Ql}" y2="${h+21}" class="hline" />`,nextY:h+ls(e)};case"check":return{markup:`<text x="${ro}" y="${h+10}" class="td">${e.checked?"\u2611":"\u2610"}</text><text x="${ro+14}" y="${h+10}" class="${e.checked?"td done":"td"}">${Dt(e.text)}</text>`,nextY:h+ls(e)};default:return{markup:`<text x="${ro}" y="${h+10}" class="${e.muted?"td done":"td"}">${Dt(e.text)}</text>`,nextY:h+ls(e)}}}async function nT(e,h){let b=tT(eT(h));return b.map((l,o)=>{let s=o===0?_n:un,r=[o===0?Ro(e,"",Sd):`<text x="${ro}" y="${un-12}" class="doc-meta">${Dt(`${h.title} (\uC774\uC5B4\uC11C)`)}</text>`];for(let t of l){let n=rT(t,s);r.push(n.markup),s=n.nextY}return Oo({width:Sd,height:P0,body:r.join(""),pageIndex:o,pageCount:b.length})})}var Cd=ca,z0=ua,ec=Nr,ma=Cd-Nr,L0=z0-46,j0=210,ei=20,Td=24;function ti(e){if(!/^\d{4}-\d{2}-\d{2}$/.test(e))return null;let h=new Date(`${e}T00:00:00`);return Number.isNaN(h.getTime())?null:h}function F0(e,h){return Math.round((h.getTime()-e.getTime())/864e5)}function oT(e,h){let b=[];e.forEach(r=>{let t=ti(r.startDate),n=ti(r.dueDate);t&&b.push(t),n&&b.push(n)});let l=ti(h)??new Date;if(b.length===0)return{start:l,days:30};let o=new Date(Math.min(...b.map(r=>r.getTime()))),s=new Date(Math.max(...b.map(r=>r.getTime())));return o.setDate(o.getDate()-1),s.setDate(s.getDate()+1),{start:o,days:Math.max(7,F0(o,s)+1)}}async function iT(e,h,b){let l=oT(h,b),o=ec+j0,r=(ma-o)/l.days,t=ti(b),n=f=>o+F0(l.start,f)*r,c=Math.max(1,Math.floor((L0-_n-Td)/ei)),i=Math.max(1,Math.floor((L0-un-Td)/ei)),a=[],d=0;for(;d<h.length||a.length===0;){let f=a.length===0?c:i;if(a.push(h.slice(d,d+f)),d+=f,d>=h.length)break}return a.map((f,u)=>{let g=u===0?_n:un,m=[u===0?Ro(e,`\uC804\uCCB4 ${h.length}\uAC74`,Cd):""],x=g+Td;m.push(`<line x1="${ec}" y1="${x}" x2="${ma}" y2="${x}" class="vline" />`);for(let _=0;_<l.days;_+=1){let B=new Date(l.start);if(B.setDate(B.getDate()+_),B.getDay()!==0&&_!==0)continue;let A=o+_*r;m.push(`<line x1="${A}" y1="${x}" x2="${A}" y2="${x+f.length*ei}" class="hline" />`,`<text x="${A+2}" y="${x-6}" class="label">${B.getMonth()+1}.${B.getDate()}</text>`)}if(t&&t>=l.start){let _=n(t);_>=o&&_<=ma&&m.push(`<line x1="${_}" y1="${x}" x2="${_}" y2="${x+f.length*ei}" stroke="#f87171" stroke-width="0.8" />`)}return f.forEach((_,B)=>{let A=x+B*ei,j=ki(_.title,j0-64,9);m.push(`<text x="${ec}" y="${A+14}" class="${_.completed?"td done":"td"}">${Dt(j)}</text>`,`<text x="${o-6}" y="${A+14}" class="label" text-anchor="end">${Dt(_.managerName)}</text>`,`<line x1="${ec}" y1="${A+ei}" x2="${ma}" y2="${A+ei}" class="hline" />`);let D=ti(_.startDate)??ti(_.dueDate),P=ti(_.dueDate)??ti(_.startDate);if(!D||!P)return;let N=n(D),q=Math.max(N+r*.8,n(P)+r*.8),z=_.completed?"bar done":_.overdue?"bar overdue":"bar";m.push(`<rect x="${N}" y="${A+5}" width="${Math.max(3,Math.min(q,ma)-N)}" height="${ei-10}" rx="2" class="${z}" />`)}),Oo({width:Cd,height:z0,body:m.join(""),pageIndex:u,pageCount:a.length})})}function sT(e,h,b,l){return{title:e.title,managerName:e.managerName,startDate:String(h??"").slice(0,10),dueDate:String(b??"").slice(0,10),completed:e.completed,overdue:!e.completed&&!!b&&String(b).slice(0,10)<l}}var Bd=aa,$0=la,cs=Nr,tc=Bd-Nr,q0=$0-46,us=30,ds=18,H0=12;function aT(e){let h=[],b=[],l=_n,o=(s,r)=>{h.push(b),b=[],l=un,s&&(b.push({kind:"column",label:s,summary:r,continued:!0,gapBefore:!1}),l+=us)};for(let s of e){let r=b.length>0,t=r?H0:0;if(l+t+us+ds>q0?(o("",""),b.push({kind:"column",label:s.label,summary:s.summary,continued:!1,gapBefore:!1}),l+=us):(b.push({kind:"column",label:s.label,summary:s.summary,continued:!1,gapBefore:r}),l+=t+us),s.items.length===0){b.push({kind:"empty"}),l+=ds;continue}for(let n of s.items)l+ds>q0&&o(s.label,s.summary),b.push({kind:"item",title:n.title,meta:n.meta,completed:n.completed}),l+=ds}return h.push(b),h}async function lT(e,h,b){let l=aT(h);return l.map((o,s)=>{let r=s===0?_n:un,t=[s===0?Ro(e,b,Bd):""];for(let n of o){if(n.kind==="column"){n.gapBefore&&(r+=H0),t.push(`<rect x="${cs}" y="${r}" width="${tc-cs}" height="${us-6}" class="group" />`,`<text x="${cs+6}" y="${r+16}" class="gt">${Dt(n.continued?`${n.label} (\uC774\uC5B4\uC11C)`:n.label)}</text>`,`<text x="${tc-6}" y="${r+16}" class="label" text-anchor="end">${Dt(n.summary)}</text>`),r+=us;continue}if(n.kind==="empty"){t.push(`<text x="${cs+12}" y="${r+12}" class="td done">(\uC5C5\uBB34 \uC5C6\uC74C)</text>`),r+=ds;continue}t.push(`<text x="${cs+12}" y="${r+12}" class="${n.completed?"td done":"td"}">${Dt(ki(n.title,tc-cs-12-120,9))}</text>`,`<text x="${tc-6}" y="${r+12}" class="label" text-anchor="end">${Dt(n.meta)}</text>`),r+=ds}return Oo({width:Bd,height:$0,body:t.join(""),pageIndex:s,pageCount:l.length})})}var cT=[{header:"\uADF8\uB8F9",width:16},{header:"\uC81C\uBAA9",width:44},{header:"\uC0C1\uD0DC",width:10},{header:"\uD504\uB85C\uC81D\uD2B8",width:14},{header:"\uCC45\uC784\uC790",width:10},{header:"\uCC38\uC870\uC790",width:22},{header:"\uC2DC\uC791",width:12},{header:"\uB9C8\uAC10",width:14},{header:"\uC911\uC694\uB3C4",width:8},{header:"\uD560\uC77C",width:8},{header:"\uBE44\uACE0",width:30}],uT="FFEEF2F7",rc="FFCBD5E1";function dT(e){return e.replace(/[\\/:*?"<>|]/g,"_").trim()||"\uC5C5\uBB34\uBAA9\uB85D"}async function fT(e,h){let b=await Promise.resolve().then(()=>Q0(U0(),1)),l=new b.Workbook,o=l.addWorksheet("\uC5C5\uBB34\uBAA9\uB85D",{pageSetup:{paperSize:9,orientation:"landscape",fitToPage:!0,fitToWidth:1,fitToHeight:0}});o.columns=cT.map(i=>({header:i.header,width:i.width})),o.spliceRows(1,0,[`${e.documentTitle}`],[`${e.subtitle} \xB7 ${e.facilityName} \xB7 \uCD9C\uB825 ${ss(e.printedAt)}${e.printedBy?` \xB7 ${e.printedBy}`:""}`]),o.getRow(1).font={bold:!0,size:14},o.getRow(2).font={size:10,color:{argb:"FF6B7280"}};let s=o.getRow(3);s.font={bold:!0,size:10},s.eachCell(i=>{i.fill={type:"pattern",pattern:"solid",fgColor:{argb:uT}},i.alignment={vertical:"middle",horizontal:"center"}}),h.forEach(i=>{i.rows.forEach(a=>{let d=o.addRow([i.label,a.title,a.statusName,a.projectLabel||"\uAE30\uBCF8",a.managerName,a.receiverNamesFull,a.startDate==="-"?"":a.startDate,a.dueDate==="-"?"":a.dueDate,a.priorityName,a.checklist,a.note]);d.font={size:10,color:{argb:a.completed?"FF9CA3AF":"FF111827"}},d.alignment={vertical:"middle",wrapText:!1}})});let r=o.rowCount;for(let i=3;i<=r;i+=1)o.getRow(i).eachCell({includeEmpty:!0},a=>{a.border={top:{style:"thin",color:{argb:rc}},left:{style:"thin",color:{argb:rc}},bottom:{style:"thin",color:{argb:rc}},right:{style:"thin",color:{argb:rc}}}});o.views=[{state:"frozen",ySplit:3}];let t=await l.xlsx.writeBuffer(),n=new Blob([t],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),c=ss(e.printedAt).replace(/[: ]/g,"").slice(0,13);return{blob:n,fileName:`${dT(e.documentTitle)}_${c}.xlsx`}}function hT(e){return String(e??"").replace(/<br\s*\/?>(?=.)/gi,`
|
|
44
44
|
`).replace(/<\/(p|div|li|h[1-6])>/gi,`
|