@ehfuse/taskbox 0.5.49 → 0.5.50
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 +7 -7
- package/dist/index.esm.js.map +3 -3
- package/dist/index.js +6 -6
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var $n="waiting",Tr="replied";import{createContext as Rm,useContext as zm,useMemo as xl}from"react";import{Box as qm}from"@mui/material";var vi="--app-mobile-font-offset";function fo(e,o=0){return`calc(${e}px + max(0px, var(${vi}, 0px) - ${o}px))`}import{jsx as fl}from"react/jsx-runtime";var gl=Rm({});function Am({config:e,children:o}){let t=xl(()=>e??{},[e]),n=t.mobileFontOffsetPx;return fl(gl.Provider,{value:t,children:n===void 0?o:fl(qm,{sx:{display:"contents",[vi]:`${n}px`},children:o})})}function vo(){return zm(gl)}function Ii(){let{buildFileUrl:e}=vo();return xl(()=>e||((o,t)=>{let n=[];return t?.thumb&&n.push(`thumb=${t.thumb}`),t?.download&&n.push("download=1"),`/api/v1/files/${o}${n.length?`?${n.join("&")}`:""}`}),[e])}function Kn(){let{uploadMaxMb:e}=vo();return e??50}import{useGlobalForm as yp}from"@ehfuse/forma";import hl from"@mui/icons-material/DoNotDisturbAltOutlined";import bl from"@mui/icons-material/BookmarkBorderOutlined";import Lm from"@mui/icons-material/LabelOutlined";import Nm from"@mui/icons-material/FlagOutlined";import Fm from"@mui/icons-material/StarBorderOutlined";import Hm from"@mui/icons-material/FolderOutlined";import Wm from"@mui/icons-material/EventOutlined";import $m from"@mui/icons-material/BuildOutlined";import Km from"@mui/icons-material/LocalShippingOutlined";import Um from"@mui/icons-material/StorefrontOutlined";import Vm from"@mui/icons-material/GroupsOutlined";import Gm from"@mui/icons-material/LightbulbOutlined";import Ym from"@mui/icons-material/FavoriteBorderOutlined";import jm from"@mui/icons-material/AssignmentOutlined";import Xm from"@mui/icons-material/HomeOutlined";import Qm from"@mui/icons-material/WorkOutline";import Jm from"@mui/icons-material/SchoolOutlined";import Zm from"@mui/icons-material/LocalHospitalOutlined";import eu from"@mui/icons-material/RestaurantOutlined";import ou from"@mui/icons-material/LocalFloristOutlined";import tu from"@mui/icons-material/DirectionsCarOutlined";import nu from"@mui/icons-material/CampaignOutlined";import ru from"@mui/icons-material/SavingsOutlined";import iu from"@mui/icons-material/Inventory2Outlined";import au from"@mui/icons-material/CleaningServicesOutlined";import kl from"@mui/icons-material/HandymanOutlined";import lu from"@mui/icons-material/LocalPhoneOutlined";import su from"@mui/icons-material/EmailOutlined";import cu from"@mui/icons-material/ShoppingCartOutlined";import mu from"@mui/icons-material/BarChartOutlined";import uu from"@mui/icons-material/PrintOutlined";import du from"@mui/icons-material/SecurityOutlined";import pu from"@mui/icons-material/AlarmOutlined";import fu from"@mui/icons-material/AttachFileOutlined";import xu from"@mui/icons-material/PhotoCameraOutlined";import gu from"@mui/icons-material/ImageOutlined";import hu from"@mui/icons-material/MenuBookOutlined";import bu from"@mui/icons-material/EditOutlined";import ku from"@mui/icons-material/KeyOutlined";import Tu from"@mui/icons-material/LockOutlined";import yu from"@mui/icons-material/LockOpenOutlined";import Su from"@mui/icons-material/SettingsOutlined";import Bu from"@mui/icons-material/CloudOutlined";import Cu from"@mui/icons-material/WifiOutlined";import vu from"@mui/icons-material/ComputerOutlined";import Iu from"@mui/icons-material/SmartphoneOutlined";import _u from"@mui/icons-material/TvOutlined";import wu from"@mui/icons-material/AccessTimeOutlined";import Du from"@mui/icons-material/TimerOutlined";import Mu from"@mui/icons-material/MapOutlined";import Ou from"@mui/icons-material/PlaceOutlined";import Eu from"@mui/icons-material/NavigationOutlined";import Pu from"@mui/icons-material/FlightOutlined";import Ru from"@mui/icons-material/TrainOutlined";import zu from"@mui/icons-material/DirectionsBusOutlined";import qu from"@mui/icons-material/DirectionsBikeOutlined";import Au from"@mui/icons-material/DirectionsWalkOutlined";import Lu from"@mui/icons-material/DirectionsRunOutlined";import Nu from"@mui/icons-material/FitnessCenterOutlined";import Fu from"@mui/icons-material/SportsSoccerOutlined";import Hu from"@mui/icons-material/EmojiEventsOutlined";import Wu from"@mui/icons-material/CardGiftcardOutlined";import $u from"@mui/icons-material/CakeOutlined";import Tl from"@mui/icons-material/CoffeeOutlined";import Ku from"@mui/icons-material/LocalPizzaOutlined";import Uu from"@mui/icons-material/ShoppingBagOutlined";import yl from"@mui/icons-material/CreditCardOutlined";import Vu from"@mui/icons-material/AccountBalanceOutlined";import Gu from"@mui/icons-material/AccountBalanceWalletOutlined";import Yu from"@mui/icons-material/AttachMoneyOutlined";import ju from"@mui/icons-material/ReceiptLongOutlined";import Xu from"@mui/icons-material/CalculateOutlined";import Qu from"@mui/icons-material/TrendingUpOutlined";import Ju from"@mui/icons-material/ListAltOutlined";import Zu from"@mui/icons-material/TaskAltOutlined";import ed from"@mui/icons-material/DoneAllOutlined";import od from"@mui/icons-material/WarningAmberOutlined";import td from"@mui/icons-material/InfoOutlined";import nd from"@mui/icons-material/HelpOutlined";import rd from"@mui/icons-material/SupportAgentOutlined";import id from"@mui/icons-material/PersonOutlined";import ad from"@mui/icons-material/PersonAddOutlined";import ld from"@mui/icons-material/BadgeOutlined";import sd from"@mui/icons-material/WbSunnyOutlined";import cd from"@mui/icons-material/DarkModeOutlined";import md from"@mui/icons-material/LocalFireDepartmentOutlined";import ud from"@mui/icons-material/WaterDropOutlined";import dd from"@mui/icons-material/BoltOutlined";import pd from"@mui/icons-material/AutorenewOutlined";import fd from"@mui/icons-material/ScienceOutlined";import xd from"@mui/icons-material/MedicalServicesOutlined";import gd from"@mui/icons-material/NotificationsOutlined";import hd from"@mui/icons-material/SendOutlined";import bd from"@mui/icons-material/LinkOutlined";import kd from"@mui/icons-material/PublicOutlined";import Sl from"@mui/icons-material/ApartmentOutlined";import Td from"@mui/icons-material/PlumbingOutlined";import yd from"@mui/icons-material/ElectricalServicesOutlined";import Sd from"@mui/icons-material/ChatOutlined";import Bd from"@mui/icons-material/DescriptionOutlined";import Cd from"@mui/icons-material/FactCheckOutlined";import vd from"@mui/icons-material/RocketLaunchOutlined";import Id from"@mui/icons-material/PaletteOutlined";import _d from"@mui/icons-material/MusicNoteOutlined";import wd from"@mui/icons-material/VideocamOutlined";import Dd from"@mui/icons-material/ThumbUpOutlined";import Md from"@mui/icons-material/PushPinOutlined";import Od from"@mui/icons-material/SearchOutlined";import Ed from"@mui/icons-material/VisibilityOutlined";import Pd from"@mui/icons-material/VerifiedOutlined";import Rd from"@mui/icons-material/TrackChangesOutlined";import zd from"@mui/icons-material/ExtensionOutlined";import qd from"@mui/icons-material/CodeOutlined";import Ad from"@mui/icons-material/BugReportOutlined";import Ld from"@mui/icons-material/SmartToyOutlined";import Nd from"@mui/icons-material/StorageOutlined";import Fd from"@mui/icons-material/QrCode2Outlined";import Hd from"@mui/icons-material/FileDownloadOutlined";import Wd from"@mui/icons-material/FileUploadOutlined";import $d from"@mui/icons-material/MicOutlined";import Kd from"@mui/icons-material/HeadphonesOutlined";import Ud from"@mui/icons-material/MovieOutlined";import Vd from"@mui/icons-material/SportsEsportsOutlined";import Gd from"@mui/icons-material/BrushOutlined";import Yd from"@mui/icons-material/ArchitectureOutlined";import jd from"@mui/icons-material/EngineeringOutlined";import Xd from"@mui/icons-material/FactoryOutlined";import Qd from"@mui/icons-material/AgricultureOutlined";import Jd from"@mui/icons-material/DirectionsBoatOutlined";import Zd from"@mui/icons-material/TwoWheelerOutlined";import ep from"@mui/icons-material/HandshakeOutlined";import op from"@mui/icons-material/GavelOutlined";import tp from"@mui/icons-material/BalanceOutlined";import np from"@mui/icons-material/TranslateOutlined";import rp from"@mui/icons-material/PsychologyOutlined";import ip from"@mui/icons-material/PetsOutlined";import ap from"@mui/icons-material/CelebrationOutlined";import lp from"@mui/icons-material/BeachAccessOutlined";import sp from"@mui/icons-material/AcUnitOutlined";import cp from"@mui/icons-material/ForestOutlined";import mp from"@mui/icons-material/LandscapeOutlined";import up from"@mui/icons-material/HotelOutlined";import dp from"@mui/icons-material/LocalLaundryServiceOutlined";import pp from"@mui/icons-material/ChairOutlined";import fp from"@mui/icons-material/LocalBarOutlined";import xp from"@mui/icons-material/LunchDiningOutlined";import gp from"@mui/icons-material/IcecreamOutlined";import hp from"@mui/icons-material/WorkspacePremiumOutlined";import bp from"@mui/icons-material/DiamondOutlined";import kp from"@mui/icons-material/VaccinesOutlined";var _i="bookmark",Me="label",xo="notifications",Un="warning",Vn="#e53e3e",Bl="none",wi=[{key:Bl,Icon:hl},{key:"label",Icon:Lm},{key:"bookmark",Icon:bl},{key:"flag",Icon:Nm},{key:"star",Icon:Fm},{key:"folder",Icon:Hm},{key:"event",Icon:Wm},{key:"build",Icon:$m},{key:"shipping",Icon:Km},{key:"store",Icon:Um},{key:"groups",Icon:Vm},{key:"idea",Icon:Gm},{key:"heart",Icon:Ym},{key:"assignment",Icon:jm},{key:"home",Icon:Xm},{key:"work",Icon:Qm},{key:"school",Icon:Jm},{key:"hospital",Icon:Zm},{key:"restaurant",Icon:eu},{key:"flower",Icon:ou},{key:"car",Icon:tu},{key:"campaign",Icon:nu},{key:"savings",Icon:ru},{key:"inventory",Icon:iu},{key:"cleaning",Icon:au},{key:"handyman",Icon:kl},{key:"phone",Icon:lu},{key:"email",Icon:su},{key:"cart",Icon:cu},{key:"chart",Icon:mu},{key:"print",Icon:uu},{key:"security",Icon:du},{key:"alarm",Icon:pu},{key:"attach",Icon:fu},{key:"camera",Icon:xu},{key:"image",Icon:gu},{key:"book",Icon:hu},{key:"edit",Icon:bu},{key:"key",Icon:ku},{key:"lock",Icon:Tu},{key:"unlock",Icon:yu},{key:"settings",Icon:Su},{key:"cloud",Icon:Bu},{key:"wifi",Icon:Cu},{key:"computer",Icon:vu},{key:"smartphone",Icon:Iu},{key:"tv",Icon:_u},{key:"clock",Icon:wu},{key:"timer",Icon:Du},{key:"map",Icon:Mu},{key:"place",Icon:Ou},{key:"navigation",Icon:Eu},{key:"flight",Icon:Pu},{key:"train",Icon:Ru},{key:"bus",Icon:zu},{key:"bike",Icon:qu},{key:"walk",Icon:Au},{key:"run",Icon:Lu},{key:"fitness",Icon:Nu},{key:"soccer",Icon:Fu},{key:"trophy",Icon:Hu},{key:"gift",Icon:Wu},{key:"cake",Icon:$u},{key:"coffee",Icon:Tl},{key:"pizza",Icon:Ku},{key:"bag",Icon:Uu},{key:"card",Icon:yl},{key:"bank",Icon:Vu},{key:"wallet",Icon:Gu},{key:"money",Icon:Yu},{key:"receipt",Icon:ju},{key:"calculate",Icon:Xu},{key:"trending",Icon:Qu},{key:"listalt",Icon:Ju},{key:"task",Icon:Zu},{key:"doneall",Icon:ed},{key:"warning",Icon:od},{key:"info",Icon:td},{key:"help",Icon:nd},{key:"support",Icon:rd},{key:"person",Icon:id},{key:"personadd",Icon:ad},{key:"badge",Icon:ld},{key:"sun",Icon:sd},{key:"moon",Icon:cd},{key:"fire",Icon:md},{key:"water",Icon:ud},{key:"bolt",Icon:dd},{key:"renew",Icon:pd},{key:"science",Icon:fd},{key:"medical",Icon:xd},{key:"notifications",Icon:gd},{key:"send",Icon:hd},{key:"link",Icon:bd},{key:"public",Icon:kd},{key:"apartment",Icon:Sl},{key:"plumbing",Icon:Td},{key:"electrical",Icon:yd},{key:"chat",Icon:Sd},{key:"description",Icon:Bd},{key:"factcheck",Icon:Cd},{key:"rocket",Icon:vd},{key:"palette",Icon:Id},{key:"music",Icon:_d},{key:"video",Icon:wd},{key:"thumbup",Icon:Dd},{key:"pin",Icon:Md},{key:"search",Icon:Od},{key:"eye",Icon:Ed},{key:"verified",Icon:Pd},{key:"target",Icon:Rd},{key:"extension",Icon:zd},{key:"code",Icon:qd},{key:"bug",Icon:Ad},{key:"robot",Icon:Ld},{key:"storage",Icon:Nd},{key:"qrcode",Icon:Fd},{key:"download",Icon:Hd},{key:"upload",Icon:Wd},{key:"mic",Icon:$d},{key:"headphones",Icon:Kd},{key:"movie",Icon:Ud},{key:"game",Icon:Vd},{key:"brush",Icon:Gd},{key:"architecture",Icon:Yd},{key:"engineering",Icon:jd},{key:"factory",Icon:Xd},{key:"agriculture",Icon:Qd},{key:"boat",Icon:Jd},{key:"motorcycle",Icon:Zd},{key:"handshake",Icon:ep},{key:"gavel",Icon:op},{key:"balance",Icon:tp},{key:"translate",Icon:np},{key:"psychology",Icon:rp},{key:"pets",Icon:ip},{key:"celebration",Icon:ap},{key:"beach",Icon:lp},{key:"snow",Icon:sp},{key:"forest",Icon:cp},{key:"mountain",Icon:mp},{key:"hotel",Icon:up},{key:"laundry",Icon:dp},{key:"chair",Icon:pp},{key:"bar",Icon:fp},{key:"burger",Icon:xp},{key:"icecream",Icon:gp},{key:"medal",Icon:hp},{key:"diamond",Icon:bp},{key:"vaccine",Icon:kp}],Tp={cafe:Tl,payment:yl,business:Sl,construction:kl};function Fe(e){return e===Bl?null:wi.find(o=>o.key===e)?.Icon??Tp[String(e??"")]??bl}function kn(e){return Fe(e)??hl}var Di={title:"",icon:Me,icon_color:"",manager_name:"",manager_account_seq:0,receiver_names:[],receiver_account_seqs:[],is_notice:!1,is_event:!1,is_bug:!1,is_open:!1,bug_repro:"",bug_device:"",bug_where:"",bug_version:"",sprint_seq:0,story_points:0,event_time:"",event_place:"",event_address:"",target_names:[],target_account_seqs:[],start_date:"",due_date:"",reminder:"none",priority:"medium",label_keys:[],note:"",content:"",checklist:[],tab_key:""},Mi={createAttachmentFiles:[],createSubmitting:!1,attachmentUpload:null};function Sp(e){let{formId:o="taskbox-create-form",initialValues:t,onValidate:n,onSubmit:r}=e;return yp({formId:o,initialValues:{...Di,...t},onValidate:n,onSubmit:r})}import{useGlobalFormaState as Bp}from"@ehfuse/forma";var Cl="taskbox-ui-state";function st(){return Bp({stateId:Cl,initialValues:Mi})}import{useMemo as Cp}from"react";import{useTheme as vp}from"@mui/material";function Yt(e,o){let t=Math.max(0,Math.min(1,o));if(t<=0)return"transparent";let n=e.trim().replace("#",""),r=n.length===3?n.split("").map(d=>d+d).join(""):n;if(!/^[0-9a-fA-F]{6}$/.test(r))return e;let i=Number.parseInt(r.slice(0,2),16),a=Number.parseInt(r.slice(2,4),16),s=Number.parseInt(r.slice(4,6),16);return`rgba(${i}, ${a}, ${s}, ${t})`}function vl(e,o){let t=Math.max(0,Math.min(1,o)),n=e.trim().replace("#",""),r=n.length===3?n.split("").map(l=>l+l).join(""):n;if(!/^[0-9a-fA-F]{6}$/.test(r))return e;let i=l=>Math.round(l+(255-l)*t),a=i(Number.parseInt(r.slice(0,2),16)),s=i(Number.parseInt(r.slice(2,4),16)),d=i(Number.parseInt(r.slice(4,6),16));return`#${[a,s,d].map(l=>l.toString(16).padStart(2,"0")).join("")}`}function Oi(e,o,t){return t==="dark"?{accent:e,accentContrast:o,accentSoft:"#1d2b45",accentOnSurface:"#b3d1ff",danger:"#f87171",dangerSoft:"#3a1f22",success:"#4ade80",warning:"#fbbf24",textStrong:"#ffffff",textPrimary:"#e2e8f0",textSecondary:"#a3adbb",textMuted:"#77808d",textInverse:"#0f1216",surface:"#161a1f",surfaceSubtle:"#1e232a",surfaceHover:"#272d36",border:"#2c333c",borderStrong:"#3b434e"}:{accent:e,accentContrast:o,accentSoft:"#eef4ff",accentOnSurface:e,danger:"#e5484d",dangerSoft:"#fdebec",success:"#16a34a",warning:"#e8a33d",textStrong:"#000000",textPrimary:"#37352f",textSecondary:"#787774",textMuted:"#9a9a97",textInverse:"#ffffff",surface:"#ffffff",surfaceSubtle:"#fafaf9",surfaceHover:"#f4f4f2",border:"#e6e6e3",borderStrong:"#dedddb"}}function Ip(e,o){let t=o==="dark";return{bg:t?vl(e.accent,.45):e.accent,color:t?e.textInverse:e.accentContrast,border:"none",fontSize:11.5,fontWeight:600,minWidth:20,width:34,borderRadius:999,paddingX:.6,paddingY:.4}}function Il(e,o){return{...e,...o??{}}}function yr(e,o="light"){let t=o==="dark",n=Ip(e,o),r=e.accentOnSurface;return{mode:o,colors:e,table:{bg:e.surface,borderColor:e.borderStrong,headerBg:e.surface,headerColor:e.textSecondary,headerActiveColor:e.textStrong,headerFilteredColor:r,headerFontSize:13,rowBg:e.surface,rowColor:e.textPrimary,rowSubColor:e.textSecondary,rowTitleColor:e.textStrong,rowTitleFontWeight:o==="dark"?400:500,rowHoverBg:e.surfaceHover,rowBorderColor:e.border,cellHoverBg:e.surfaceHover,emptyColor:e.textMuted,groupHeader:{bg:e.surfaceSubtle,hoverBg:e.surfaceHover,borderColor:e.border,labelColor:o==="dark"?e.textStrong:e.textPrimary,labelFontSize:15.5,labelFontWeight:o==="dark"?400:700,minHeight:48,badge:{...n,borderRadius:4,width:34}}},board:{columnBg:e.surfaceSubtle,columnHeaderColor:e.textPrimary,columnHeaderFontSize:13.5,badge:{...n,borderRadius:4,width:34}},summary:{gaugeTrackColor:o==="dark"?e.borderStrong:"#ececea",gaugeBarColor:r,gaugeCompleteColor:e.success,gaugeHeight:6,numberColor:r,overdueColor:e.danger,textColor:e.textStrong},actionButton:{bg:"#2f80ed",color:"#ffffff",hoverBg:"#2470dd",bgImage:"linear-gradient(180deg, #5ba1f5 0%, #2f80ed 100%)",hoverBgImage:"linear-gradient(180deg, #4d95ee 0%, #2470dd 100%)"},tabs:{bg:o==="dark"?e.surfaceSubtle:e.surface,color:o==="dark"?e.textSecondary:e.textStrong,hoverBg:e.surfaceHover,borderColor:o==="dark"?e.border:e.borderStrong,selectedBg:o==="dark"?e.surfaceHover:e.textStrong,selectedColor:o==="dark"?e.textStrong:e.surface},calendar:{bg:e.surface,borderColor:t?"#3a434f":e.border,headerBg:e.surfaceSubtle,headerColor:e.textSecondary,cellBg:t?"#1a1e24":e.surface,dateBandBg:e.surface,otherMonthBg:t?"#1a1e24":e.surface,todayBg:e.accentSoft,hoverBg:e.surfaceHover,dateColor:e.textPrimary,holidayColor:e.danger},card:{bg:t?"#232a33":e.surface,borderColor:t?"#333c47":e.border,hoverBg:t?"#2b3441":e.surfaceHover,titleColor:e.textPrimary,subColor:e.textSecondary},timeline:{bg:e.surface,gridColor:e.border,headerBg:e.surfaceSubtle,headerColor:e.textSecondary,todayLineColor:e.accentOnSurface,barColor:e.accentOnSurface,overdueBarColor:e.danger},avatar:{ringColor:o==="dark"?e.textStrong:e.accent,separatorColor:e.surface},chip:{borderRadius:.75,fontSize:13,fontWeight:500,plainColor:o==="dark"?e.textSecondary:"#57564f",plainDotColor:e.textMuted,darkBgAlpha:.15,darkTextSource:"dot"}}}function Ei(e,o){if(!o)return e;let t=o.mode??e.mode,r={...t===e.mode?e.colors:Oi(e.colors.accent,e.colors.accentContrast,t),...o.colors??{}},i=yr(r,t),{groupHeader:a,...s}=o.table??{},{badge:d,...l}=o.board??{},{badge:u,...p}=a??{};return{mode:t,colors:r,table:{...i.table,...s,groupHeader:{...i.table.groupHeader,...p,badge:Il(i.table.groupHeader.badge,u)}},board:{...i.board,...l,badge:Il(i.board.badge,d)},summary:{...i.summary,...o.summary??{}},chip:{...i.chip,...o.chip??{}},actionButton:{...i.actionButton,...o.actionButton??{}},tabs:{...i.tabs,...o.tabs??{}},avatar:{...i.avatar,...o.avatar??{}},calendar:{...i.calendar,...o.calendar??{}},card:{...i.card,...o.card??{}},timeline:{...i.timeline,...o.timeline??{}}}}function _p(e={}){let{mode:o="light",accent:t="#2563eb",accentContrast:n="#ffffff",input:r}=e;return Ei(yr(Oi(t,n,o),o),r)}function ne(){let e=vp(),{theme:o}=vo(),t=e.palette.primary.main,n=e.palette.primary.contrastText,r=e.palette.mode==="dark"?"dark":"light";return Cp(()=>Ei(yr(Oi(t,n,r),r),o),[t,n,r,o])}import{useCallback as dt,useEffect as es,useMemo as Zt,useRef as tx,useState as pt}from"react";import{Box as No,Divider as nx,IconButton as rx,ListItemIcon as ix,Menu as os,MenuItem as Lr}from"@mui/material";import ts from"@mui/icons-material/Add";import ax from"@mui/icons-material/ArrowUpward";import lx from"@mui/icons-material/ArrowDownward";import sx from"@mui/icons-material/KeyboardArrowDown";import cx from"@mui/icons-material/KeyboardArrowRight";import ra from"@mui/icons-material/Check";import mx from"@mui/icons-material/FilterList";import ux from"@mui/icons-material/InboxOutlined";import{Virtuoso as ns}from"react-virtuoso";import dx from"@ehfuse/overlay-scrollbar";import{DatePicker as px}from"@ehfuse/mui-datetime-picker";function wp(e){let o=String(e??"").trim().replace("T"," "),t=o.match(/^(\d{4})-(\d{2})-(\d{2})(?:[ ](\d{2}):(\d{2})(?::(\d{2}))?)?/);return t?new Date(Number(t[1]),Number(t[2])-1,Number(t[3]),Number(t[4]??0),Number(t[5]??0),Number(t[6]??0)):new Date(o)}function qe(e,o="YYYY-MM-DD"){let t=typeof e=="string"?wp(e):e;if(!e||e===""||isNaN(t.getTime()))return"";let n=t.getFullYear(),r=(t.getMonth()+1).toString().padStart(2,"0"),i=t.getDate().toString().padStart(2,"0"),a=n.toString().slice(-2);switch(o){case"YYYY-MM-DD":return`${n}-${r}-${i}`;case"YY.MM.DD":return`${a}.${r}.${i}`;case"MM/DD/YYYY":return`${r}/${i}/${n}`;case"DD.MM.YYYY":return`${i}.${r}.${n}`;case"YYYYMMDD":return`${n}${r}${i}`;default:return o.replace(/YYYY/g,n.toString()).replace(/YY/g,a).replace(/MM/g,r).replace(/DD/g,i)}}function _l(){return qe(new Date)}import{Box as wl}from"@mui/material";import{jsx as Mp,jsxs as Op}from"react/jsx-runtime";var Dp={high:{label:"\uB192\uC74C",dot:"#e5484d",bgcolor:"#fdebec",color:"#c4554d"},medium:{label:"\uC911\uAC04",dot:"#2f80ed",bgcolor:"#e3eefb",color:"#1d4f91"},low:{label:"\uB0AE\uC74C",dot:"#9a9a97",bgcolor:"#efefed",color:"#57564f"}};function Lo({priority:e,small:o=!1,plain:t=!1}){let n=Dp[e],r=ne(),i=r.mode==="dark",a=t||e==="low";return Op(wl,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:o?.5:.75,px:a?0:o?.9:1.25,py:a?0:o?.25:.5,borderRadius:.75,fontSize:o?11.5:13,fontWeight:500,bgcolor:a?"transparent":i?Yt(n.dot,r.chip.darkBgAlpha):n.bgcolor,color:a?i?r.chip.plainColor:n.color:i?r.chip.darkTextSource==="fg"?n.color:n.dot:n.color,whiteSpace:"nowrap"},children:[Mp(wl,{component:"span",sx:{width:o?6:8,height:o?6:8,borderRadius:"50%",bgcolor:n.dot}}),n.label]})}import{Menu as qp,MenuItem as Ap}from"@mui/material";import Lp from"@mui/icons-material/Check";function Qo(){return{}}var Pi=[{key:"always",name:"\uD56D\uC0C1"},{key:"often",name:"\uC790\uC8FC"},{key:"sometimes",name:"\uAC00\uB054"},{key:"once",name:"1\uD68C"},{key:"unable",name:"\uC7AC\uD604\uBD88\uAC00"}],Ri=[{key:"desktop",name:"\uB370\uC2A4\uD06C\uD1B1"},{key:"tablet",name:"\uD0DC\uBE14\uB9BF"},{key:"mobile",name:"\uD734\uB300\uD3F0"}],zi=[{key:"fixed",name:"\uC218\uC815\uC644\uB8CC"},{key:"duplicate",name:"\uC911\uBCF5"},{key:"cannot_reproduce",name:"\uC7AC\uD604\uBD88\uAC00"},{key:"by_design",name:"\uC0AC\uC591\uB300\uB85C"},{key:"wont_fix",name:"\uC548 \uACE0\uCE68"}];function Dl(e){return Pi.find(o=>o.key===e)?.name??""}function Ml(e){return Ri.find(o=>o.key===e)?.name??""}function Sr(e){return zi.find(o=>o.key===e)?.name??""}function qi(e,o=new Date){if(!e.is_event)return!1;let t=String(e.due_date??"").trim().slice(0,10);if(!/^\d{4}-\d{2}-\d{2}$/.test(t))return!1;let n=String(e.event_time??"").trim();if(/^\d{2}:\d{2}$/.test(n)){let i=new Date(`${t}T${n}:00`);return!Number.isNaN(i.getTime())&&i.getTime()<=o.getTime()}let r=new Date(`${t}T00:00:00`);return Number.isNaN(r.getTime())?!1:(r.setDate(r.getDate()+1),r.getTime()<=o.getTime())}function Br(e,o=new Date){return e.is_event?qi(e,o):!!e.completed}var jt=[{key:"not_started",name:"\uC2DC\uC791\uC804",bg:"#efefed",fg:"#57564f",dot:"#9a9a97"},{key:"in_progress",name:"\uC9C4\uD589\uC911",bg:"#dcf2e3",fg:"#1f6b3a",dot:"#2f9e5b"},{key:"hold",name:"\uBCF4\uB958",bg:"#fbeee0",fg:"#8a5a2b",dot:"#d9730d"},{key:$n,name:"\uD655\uC778\uC911",bg:"#faf1d7",fg:"#8a6d1d",dot:"#e8a33d"},{key:Tr,name:"\uD655\uC778\uC644\uB8CC",bg:"#e3eefb",fg:"#1d4f91",dot:"#2f80ed"}],Yn=jt.filter(e=>e.key!==$n&&e.key!==Tr);function Cr(e){return jt.find(o=>o.key===e)??jt[0]}var Ai={key:"completed",name:"\uC644\uB8CC",bg:"#e3eefb",fg:"#1d4f91",dot:"#2f80ed"};function go(e){if(e.is_notice)return Ol(e.status);if(e.is_bug&&e.completed){let o=Sr(e.resolution)||"\uC644\uB8CC";return{...Ai,name:o}}return e.completed?Ai:e.is_bug?Pp(e.status):Cr(e.status)}var Ep={key:"event_ended",name:"\uC885\uB8CC",bg:"#efefed",fg:"#57564f",dot:"#9a9a97"};function jn(e){return qi(e)?Ep:null}var Gn=[{key:"notice_scheduled",name:"\uAC8C\uC2DC\uC608\uC815",bg:"#faf1d7",fg:"#8a6d1d",dot:"#e8a33d"},{key:"notice_active",name:"\uAC8C\uC2DC\uC911",bg:"#dcf2e3",fg:"#1f6b3a",dot:"#2f9e5b"},{key:"notice_closed",name:"\uC885\uB8CC",bg:"#efefed",fg:"#57564f",dot:"#9a9a97"}];function Ol(e){return Gn.find(o=>o.key===e)??Gn[1]}var Li="__closed__",Xt=[{key:"bug_received",name:"\uC811\uC218",bg:"#fdeaea",fg:"#9b2c2c",dot:"#e53e3e"},{key:"bug_confirmed",name:"\uD655\uC778\uC911",bg:"#faf1d7",fg:"#8a6d1d",dot:"#e8a33d"},{key:"bug_in_progress",name:"\uC9C4\uD589\uC911",bg:"#dcf2e3",fg:"#1f6b3a",dot:"#2f9e5b"},{key:"bug_hold",name:"\uBCF4\uB958",bg:"#efefed",fg:"#57564f",dot:"#9a9a97"}],mv=[...Xt.filter(e=>e.key!=="bug_hold"),{key:Li,name:"\uC644\uB8CC",bg:"#e3eefb",fg:"#1d4f91",dot:"#2f80ed"},...Xt.filter(e=>e.key==="bug_hold")];function Pp(e){return Xt.find(o=>o.key===e)??Xt[0]}function El(e){return e.is_notice?Gn:e.is_bug?Xt:Yn}function Ni(e){return e.status===$n}var Rp={in_progress:0,[$n]:1,not_started:2,hold:3,[Tr]:4};function uv(e){return e.completed?9:Rp[String(e.status??"")]??2}function Tn(e,o){let t=new Map(o.map(r=>[r.key,r])),n=(e.label_keys??[]).map(r=>t.get(r)).filter(r=>!!r);if(e.is_event){let r=jn({is_event:!0,due_date:String(e.due_date??""),event_time:e.event_time});return r?[r,...n]:n}return e.is_notice?String(e.status??"")==="notice_active"?n:[Ol(e.status),...n]:e.is_bug?[go({...e,is_notice:!1}),...n]:e.completed?[Ai,...n]:[Cr(e.status),...n]}function Pl(e){return{bg:`${e}1f`,fg:e,dot:e}}function vr(e,o){return e.includes(o)?e.filter(t=>t!==o):[...e,o]}import{Box as Ir}from"@mui/material";import{jsx as Xn,jsxs as zp}from"react/jsx-runtime";function Ee({option:e,small:o=!1}){let t=ne(),n=t.mode==="dark",r=e.key==="not_started";return zp(Ir,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:o?.5:.75,px:r?0:o?.9:1.25,py:r?0:o?.25:.5,borderRadius:1.25,fontSize:o?11.5:13,fontWeight:500,bgcolor:r?"transparent":n?Yt(e.dot,t.chip.darkBgAlpha):e.bg,color:r?n?t.chip.plainColor:e.fg:n?t.chip.darkTextSource==="fg"?e.fg:e.dot:e.fg,whiteSpace:"nowrap"},children:[Xn(Ir,{component:"span",sx:{width:o?6:8,height:o?6:8,borderRadius:"50%",bgcolor:e.dot,flexShrink:0}}),e.name]})}function hv({task:e,statusOptions:o,small:t=!1}){let n=Tn(e,o);return n.length===0?null:Xn(Ir,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5},children:n.map(r=>Xn(Ee,{option:r,small:t},r.key))})}function Ot({labelKeys:e,labelOptions:o}){let t=new Map(o.map(r=>[r.key,r])),n=e.map(r=>t.get(r)).filter(r=>!!r);return n.length===0?null:Xn(Ir,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5},children:n.map(r=>Xn(Ee,{option:r,small:!0},r.key))})}import{jsx as Fi,jsxs as Np}from"react/jsx-runtime";function _r({anchorEl:e,value:o,options:t=jt,onSelect:n,onClose:r}){let i=Qo();return Fi(qp,{anchorEl:e,open:!!e,onClose:r,transitionDuration:0,...i,children:t.map(a=>Np(Ap,{onClick:()=>{n(a.key),r()},sx:{fontSize:14,minWidth:150,gap:1},children:[Fi(Ee,{option:a}),o===a.key?Fi(Lp,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},a.key))})}function wr(e,o){if(o<=0)return!1;if(e.is_notice){if((e.author_account_seq??0)===o)return!0;let t=(e.target_account_seqs??[]).filter(n=>n>0);return t.length===0||t.includes(o)}return Hi(e)?!0:(e.author_account_seq??0)===o||(e.manager_account_seq??0)===o||(e.receiver_account_seqs??[]).includes(o)}function Hi(e){return e.is_notice||!e.is_open||e.completed||e.archived?!1:(e.manager_account_seq??0)===0}function Dr(e,o){return o<=0?!1:Hi(e)}function Mr(e,o){return o<=0||e.is_notice||e.is_event||e.completed||e.archived||(e.manager_account_seq??0)>0||Hi(e)?!1:(e.receiver_account_seqs??[]).includes(o)||(e.author_account_seq??0)===o}function Rl(e){return!!e.is_bug&&(e.manager_account_seq??0)===0&&e.status==="bug_received"}function ct(e,o){return o<=0?!1:e.is_notice?(e.author_account_seq??0)===o:(e.author_account_seq??0)===o||(e.manager_account_seq??0)===o||(e.receiver_account_seqs??[]).includes(o)}var _v=[119,121,141,143];var Wi=[{value:"due",label:"\uADF8\uB8F9 : \uB9C8\uAC10\uAE30\uD55C"},{value:"status",label:"\uADF8\uB8F9 : \uC0C1\uD0DC"},{value:"manager",label:"\uADF8\uB8F9 : \uCC45\uC784\uC790"},{value:"tab",label:"\uADF8\uB8F9 : \uD504\uB85C\uC81D\uD2B8"},{value:"none",label:"\uADF8\uB8F9 \uC5C6\uC74C"}];function Fp(e){let o=new Date(`${e}T00:00:00`);return o.setDate(o.getDate()+(6-o.getDay())),qe(o)}var Hp=[{key:"overdue",label:"\uC9C0\uB0A8"},{key:"today",label:"\uC624\uB298"},{key:"this_week",label:"\uC774\uBC88 \uC8FC"},{key:"later",label:"\uC774\uD6C4"},{key:"no_due",label:"\uB9C8\uAC10 \uC5C6\uC74C"}];function Wp(e,o,t){let n=e.due_date.slice(0,10);return n?n<o?"overdue":n===o?"today":n<=t?"this_week":"later":"no_due"}function $i(e,o,t,n=[],r=[],i="",a){let s=e.filter(m=>m.is_notice);if(s.length>0){let m=$i(e.filter(c=>!c.is_notice),o,t,n,r,i,a);return[{key:"__notice__",label:"\uACF5\uC9C0\uC0AC\uD56D",tasks:s},...m]}let d=new Map,l=(m,c)=>{let T=d.get(m);T?T.push(c):d.set(m,[c])},u;if(o==="due"){let m=Fp(t);for(let c of e)l(Wp(c,t,m),c);u=Hp}else if(o==="status"){for(let m of e)l(Cr(m.status).key,m);u=jt.map(m=>({key:m.key,label:m.name}))}else if(o==="tab"){for(let m of e)l(m.tab_key?.trim()||"__none__",m);u=[...n.filter(m=>!m.archived).map(m=>({key:m.key,label:m.label})),{key:"__none__",label:"\uAE30\uBCF8 \uC5C5\uBB34\uD568"},...n.filter(m=>m.archived).map(m=>({key:m.key,label:`${m.label} (\uBCF4\uAD00\uB428)`}))]}else if(a?.enabled){let m=Number(a.myAccountSeq??0),c=i.trim();for(let T of e){if(!(Number(T.manager_account_seq??0)>0||String(T.manager_name??"").trim()!=="")){l("__none__",T);continue}let f=m>0&&Number(T.manager_account_seq??0)===m||!!c&&String(T.manager_name??"").trim()===c;l(f?"__manager__":"__reference__",T)}u=[{key:"__manager__",label:"\uCC45\uC784\uC790"},{key:"__none__",label:"\uCC45\uC784\uC790 \uBBF8\uBC30\uC815"},{key:"__reference__",label:"\uCC38\uC870\uC790"}]}else{for(let f of e)l(String(f.manager_name??"").trim()||"__none__",f);let m=i.trim(),c=[...d.keys()].filter(f=>f!=="__none__").sort((f,g)=>{if(m){if(f===m)return-1;if(g===m)return 1}return f.localeCompare(g)}),T=!!m&&c.includes(m),B=c.filter(f=>f!==m);u=[...T?[{key:m,label:"\uB0B4 \uC5C5\uBB34"}]:[],{key:"__none__",label:"\uCC45\uC784\uC790 \uBBF8\uBC30\uC815"},...B.map(f=>({key:f,label:f}))]}let p=[];for(let m of u){let c=d.get(m.key);!c||c.length===0||p.push({key:m.key,label:m.label,tasks:c})}return p}import $p from"@mui/icons-material/NotesOutlined";import Kp from"@mui/icons-material/AutorenewOutlined";import Up from"@mui/icons-material/CalendarTodayOutlined";import Vp from"@mui/icons-material/EventOutlined";import Gp from"@mui/icons-material/PersonOutlineOutlined";import ql from"@mui/icons-material/PeopleAltOutlined";import Vi from"@mui/icons-material/CheckCircleOutlineOutlined";import Yp from"@mui/icons-material/FlagOutlined";import jp from"@mui/icons-material/AccessTimeOutlined";import Xp from"@mui/icons-material/StickyNote2Outlined";import Qp from"@mui/icons-material/ViewKanbanOutlined";import Jp from"@mui/icons-material/ConfirmationNumberOutlined";import{jsx as co}from"react/jsx-runtime";var Zp={role_mark:"11px",completed:"44px",ticket_no:"100px",title:"minmax(220px, 1.8fr)",status:"110px",start_date:"110px",due_date:"120px",manager_name:"110px",receiver_names:"170px",targets:"170px",priority:"84px",ack:"104px",confirm:"100px",project:"150px",request:"100px",completed_time:"150px",note:"minmax(200px, 1.2fr)"};function Or(e){return Gi(e).map(o=>Zp[o.id]).join(" ")}var ef={id:"completed_time",label:"\uC644\uB8CC\uC77C\uC2DC",icon:co(jp,{sx:{fontSize:15}}),align:"center",sortable:!0},of={id:"ticket_no",label:"\uD2F0\uCF13",icon:co(Jp,{sx:{fontSize:15}}),align:"center"},tf={id:"project",label:"\uD504\uB85C\uC81D\uD2B8",icon:co(Qp,{sx:{fontSize:15}}),projectFilter:!0},nf={id:"targets",label:"\uB300\uC0C1\uC790",icon:co(ql,{sx:{fontSize:15}})},zl={id:"priority",label:"\uC911\uC694\uB3C4",icon:co(Yp,{sx:{fontSize:15}}),align:"center",priorityFilter:!0},rf={id:"ack",label:"\uD655\uC778",icon:co(Vi,{sx:{fontSize:15}}),align:"center",ackFilter:!0},af={id:"confirm",label:"\uD655\uC778",icon:co(Vi,{sx:{fontSize:15}}),align:"center",ackFilter:!0};function Ki(e){let o=e.findIndex(n=>n.id==="receiver_names"||n.id==="targets"),t=o>=0?o+1:e.findIndex(n=>n.id==="note");return t<0?[...e,zl]:[...e.slice(0,t),zl,...e.slice(t)]}function Gi(e){let{showProject:o=!1,showManager:t=!0,showActions:n=!0,showRequest:r=!0,notice:i=!1,bug:a=!1,confirmMode:s="none"}=e??{},d=p=>{if(!a)return p;let m=p.filter(B=>B.id!=="note"),c=m.findIndex(B=>B.id==="completed"),T=c>=0?c+1:0;return[...m.slice(0,T),of,...m.slice(T)]};if(i)return d(Ki(Ui.filter(p=>!["manager_name","receiver_names","request"].includes(p.id)).flatMap(p=>p.id==="due_date"?[p,nf]:p.id==="note"?[rf,p]:[p])));let l=t?Ui:Ui.filter(p=>p.id!=="manager_name");if(n)r||(l=l.filter(p=>p.id!=="request"));else{l=l.filter(m=>m.id!=="request");let p=l.findIndex(m=>m.id==="note");l=[...l.slice(0,p),ef,...l.slice(p)]}if(s==="action"){let p=l.findIndex(m=>m.id==="note");l=[...l.slice(0,p),af,...l.slice(p)]}if(!o)return d(Ki(l));let u=l.findIndex(p=>p.id==="receiver_names");return d(Ki([...l.slice(0,u+1),tf,...l.slice(u+1)]))}var Ui=[{id:"role_mark",label:"",icon:null},{id:"completed",label:"\uC644\uB8CC",icon:null,align:"center"},{id:"title",label:"\uC81C\uBAA9",icon:co($p,{sx:{fontSize:15}}),sortable:!0},{id:"status",label:"\uC0C1\uD0DC",icon:co(Kp,{sx:{fontSize:15}}),align:"center",statusFilter:!0},{id:"start_date",label:"\uC2DC\uC791\uC77C\uC790",icon:co(Up,{sx:{fontSize:15}}),align:"center",sortable:!0},{id:"due_date",label:"\uB9C8\uAC10\uAE30\uD55C",icon:co(Vp,{sx:{fontSize:15}}),align:"center",sortable:!0},{id:"manager_name",label:"\uCC45\uC784\uC790",icon:co(Gp,{sx:{fontSize:15}}),memberFilter:"manager"},{id:"receiver_names",label:"\uCC38\uC870\uC790",icon:co(ql,{sx:{fontSize:15}}),memberFilter:"receivers"},{id:"request",label:"\uD655\uC778",icon:co(Vi,{sx:{fontSize:15}}),align:"center",ackFilter:!0},{id:"note",label:"\uBE44\uACE0",icon:co(Xp,{sx:{fontSize:15}})}];import{Button as Al,ClickAwayListener as cf,Dialog as mf,Paper as uf,Popper as df,Typography as pf,Box as ff}from"@mui/material";import{useMediaQuery as lf,useTheme as sf}from"@mui/material";function Re(){let{isMobile:e}=vo(),o=sf(),t=lf(o.breakpoints.up("lg"));return e!==void 0?e:!t}import{Fragment as gf,jsx as Et,jsxs as Ll}from"react/jsx-runtime";function xf({title:e,content:o,confirmText:t,cancelText:n,titleFontSize:r,actionFontSize:i,actionMinHeight:a,onCancel:s,onConfirm:d}){return Ll(gf,{children:[Et(pf,{component:"div",sx:{fontSize:r,fontWeight:700,color:"#0f172a",lineHeight:1.4},children:e}),o,Ll(ff,{sx:{display:"flex",gap:2,justifyContent:"flex-end"},children:[Et(Al,{size:"medium",variant:"outlined",color:"inherit",onClick:s,fullWidth:!0,sx:{fontSize:i,minHeight:a,fontWeight:700},children:n}),Et(Al,{size:"medium",variant:"contained",color:"primary",onClick:d,fullWidth:!0,sx:{fontSize:i,minHeight:a,fontWeight:700},children:t})]})]})}function Ge({open:e,anchorEl:o,title:t="\uD655\uC778\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",content:n,confirmText:r="\uD655\uC778",cancelText:i="\uCDE8\uC18C",placement:a="top",minWidth:s=160,minHeight:d,titleFontSize:l=17,actionFontSize:u=16,actionMinHeight:p=44,zIndex:m=1300,onCancel:c,onConfirm:T}){let B=Re(),f=Et(xf,{title:t,content:n,confirmText:r,cancelText:i,titleFontSize:l,actionFontSize:u,actionMinHeight:p,onCancel:c,onConfirm:T});return B?Et(mf,{open:e,onClose:c,sx:{zIndex:m},slotProps:{paper:{sx:{p:3,display:"flex",flexDirection:"column",gap:3,minWidth:260}}},children:f}):Et(df,{open:e,anchorEl:o,placement:a,sx:{zIndex:m},children:Et(cf,{onClickAway:c,children:Et(uf,{elevation:4,sx:{p:3,display:"flex",flexDirection:"column",gap:3,minWidth:s,minHeight:d,justifyContent:d?"space-between":"flex-start"},onClick:g=>g.stopPropagation(),onMouseDown:g=>g.stopPropagation(),children:f})})})}import{useEffect as wf,useRef as Df,useState as Vl}from"react";import{Box as ke,Button as Mf,Checkbox as Of,Tooltip as Xi}from"@mui/material";import Ef from"@mui/icons-material/AlarmOutlined";import Pf from"@mui/icons-material/CheckCircle";import Rf from"@mui/icons-material/CheckCircleOutlineOutlined";import{useEffect as hf,useState as Nl}from"react";import{Avatar as Fl}from"@mui/material";import bf from"@mui/icons-material/PersonOutlineOutlined";import{jsx as ji}from"react/jsx-runtime";var Yi=new Set,Hl=e=>e.startsWith("data:")||e.startsWith("blob:");function Jo({src:e,avatarSx:o,iconFontSize:t=40}){let[n,r]=Nl(()=>e?Hl(e)||Yi.has(e):!1),[i,a]=Nl(!1),s={position:"relative",overflow:"hidden",borderRadius:"15px"},d=o?[s,...Array.isArray(o)?o:[o]]:s;return hf(()=>{a(!1),r(e?Hl(e)||Yi.has(e):!1)},[e]),!e||i?ji(Fl,{sx:d,children:ji(bf,{sx:{fontSize:t}})}):ji(Fl,{src:e,imgProps:{onLoad:()=>{Yi.add(e),r(!0)},onError:()=>a(!0),style:n?void 0:{opacity:0}},sx:d})}var kf=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Er=(e,o)=>{if(!o||!o.trim())return[{text:e,highlight:!1}];try{let t=kf(o.trim()),n=new RegExp(`(${t})`,"gi");return e.split(n).map(i=>i.toLowerCase()===o.trim().toLowerCase()?{text:i,highlight:!0}:{text:i,highlight:!1}).filter(i=>i.text)}catch{return[{text:e,highlight:!1}]}};var Tf=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"];function Zo(e){let o=String(e??"").trim().slice(0,10);if(!/^\d{4}-\d{2}-\d{2}$/.test(o))return"";let t=new Date(`${o}T00:00:00`);return Number.isNaN(t.getTime())?"":`${o.slice(2).replaceAll("-",".")} (${Tf[t.getDay()]})`}function mt(e){let o=String(e??"").trim(),[t,n=""]=o.split(" "),r=Zo(t);return r?n?`${r} ${n.slice(0,5)}`:r:""}import{Box as Wl,Tooltip as yf}from"@mui/material";import{jsx as Pr}from"react/jsx-runtime";var yn=[{bgcolor:"#dbe7ff",color:"#24408e"},{bgcolor:"#ffe4d6",color:"#8a4b21"},{bgcolor:"#dcf2e3",color:"#1f6b3a"},{bgcolor:"#f3e3f7",color:"#6d2f80"},{bgcolor:"#fdf0cf",color:"#8a6d1d"},{bgcolor:"#e0f0f6",color:"#1d5f78"},{bgcolor:"#efe6dc",color:"#6b4a2b"}];function ho({names:e,size:o=22,ringFirst:t=!1,avatarSrcByName:n}){let r=ne();return Pr(Wl,{sx:{display:"flex",alignItems:"center"},children:e.map((i,a)=>{let s=t&&a===0;return Pr(yf,{title:s?`\uCC45\uC784\uC790 \xB7 ${i}`:i,arrow:!0,children:Pr(Wl,{sx:{ml:a===0?0:"-7px",zIndex:a,borderRadius:"50%",border:`2px solid ${s?r.avatar.ringColor:r.avatar.separatorColor}`,display:"inline-flex",...r.avatar.sx},children:Pr(Jo,{src:n?.get(i)??"",avatarSx:{width:o,height:o,fontSize:Math.round(o/2),borderRadius:"50%",...yn[a%yn.length]},iconFontSize:Math.round(o*.6)})})},`${i}-${a}`)})})}import{Box as $l,Button as Ul}from"@mui/material";import Sf from"@mui/icons-material/CheckCircle";import{Fragment as vf,jsx as Qn,jsxs as Kl}from"react/jsx-runtime";function Bf(e){let o=e.mode==="dark";return{minWidth:0,width:"100%",px:1,py:.25,fontSize:13,color:e.table.rowColor,borderColor:e.colors.borderStrong,background:o?e.colors.surfaceHover:"linear-gradient(180deg, #ffffff 0%, #f6f7f9 100%)",whiteSpace:"nowrap","&:hover":{background:o?e.colors.surfaceSubtle:"linear-gradient(180deg, #fcfcfd 0%, #f0f2f4 100%)",borderColor:e.colors.borderStrong}}}function Cf(e){return{minWidth:0,px:1.25,py:.25,fontSize:13,whiteSpace:"nowrap",color:e.actionButton.color,backgroundColor:e.actionButton.bg,backgroundImage:e.actionButton.bgImage,boxShadow:"none","&:hover":{backgroundColor:e.actionButton.hoverBg,backgroundImage:e.actionButton.hoverBgImage,boxShadow:"none"},...e.actionButton.sx}}function Sn({onClick:e,children:o,fullWidth:t=!1,sx:n}){let r=ne();return Qn(Ul,{size:"small",variant:"contained",color:"inherit",fullWidth:t,sx:[Cf(r),...Array.isArray(n)?n:n?[n]:[]],onClick:i=>{i.stopPropagation(),e(i)},children:o})}function Bn({canConfirm:e,count:o,total:t,myConfirmed:n=!1,onConfirm:r,onShowList:i}){let a=ne(),s=Bf(a);return e?Qn(Sn,{onClick:()=>r(),children:"\uD655\uC778"}):Kl(Ul,{size:"small",variant:"outlined",color:"inherit",sx:s,onClick:d=>{d.stopPropagation(),i(d.currentTarget)},children:[n?Qn(Sf,{sx:{fontSize:16,color:"#2f80ed",flexShrink:0}}):null,Qn($l,{component:"span",sx:{flex:1,textAlign:"center",minWidth:0},children:t>0&&o>=t?"\uC644\uB8CC":Kl(vf,{children:[o,Qn($l,{component:"span",sx:{mx:.15},children:"/"}),t]})})]})}import{SvgIcon as If}from"@mui/material";import{jsx as Rr,jsxs as _f}from"react/jsx-runtime";function Cn({sx:e,...o}){return _f(If,{viewBox:"0 0 48 48",...o,sx:{fill:"none",...e},children:[Rr("path",{d:"M24,6C13.23,6,4.5,12.93,4.5,21.46c0,5.39,3.5,10.13,8.79,12.89l-1.76,7.06a.46.46,0,0,0,.68.51L21,36.7a24,24,0,0,0,3,.2c10.77,0,19.5-6.91,19.5-15.44S34.77,6,24,6Z",fill:"none",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Rr("circle",{cx:"23.91",cy:"21.46",r:"2.71",fill:"currentColor",stroke:"none"}),Rr("circle",{cx:"33.65",cy:"21.46",r:"2.71",fill:"currentColor",stroke:"none"}),Rr("circle",{cx:"14.18",cy:"21.46",r:"2.71",fill:"currentColor",stroke:"none"})]})}import{Fragment as Ji,jsx as V,jsxs as vn}from"react/jsx-runtime";function Gl(e){let o=String(e??"").trim();return o?o.slice(2,10).replaceAll("-","."):"-"}function Qi(e,o){let t=String(e??"").trim()||"-";return Er(t,o).map((n,r)=>V("span",{className:n.highlight?"font-semibold text-blue-600":void 0,children:n.text},`${n.text}-${r}`))}function zr({names:e,searchText:o,avatarSrcByName:t,emphasize:n=!1}){let r=e.filter(i=>i.trim());if(r.length===0)return null;if(r.length===1){let i=r[0]??"";return vn(Ji,{children:[V(Jo,{src:t?.get(i)??"",avatarSx:{width:24,height:24,borderRadius:"50%",...yn[0]},iconFontSize:15}),V(ke,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...n?{fontWeight:500,color:"#2f80ed"}:{}},children:Qi(i,o)})]})}return V(ho,{names:r,size:22,avatarSrcByName:t})}function Yl({display:e,summary:o,searchText:t,avatarSrcByName:n}){if(!e||e.kind==="everyone")return V(ke,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o||"\uBAA8\uB4E0 \uC9C1\uC6D0"});let{teamNames:r,individualNames:i}=e;if(r.length===0)return V(zr,{names:i,searchText:t,avatarSrcByName:n});let a=[...r,...i],s=a.join(", ");return a.length>2?V(Xi,{title:s,arrow:!0,children:V(ke,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:`${a[0]}, ${a[1]} \uC678 ${a.length-2}\uBA85`})}):V(Xi,{title:s,arrow:!0,children:vn(ke,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0},children:[V(ke,{component:"span",sx:{flexShrink:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.join(", ")+(i.length>0?",":"")}),i.length>0?V(zr,{names:i,searchText:t,avatarSrcByName:n}):null]})})}function jl({task:e,statusOptions:o,avatarSrcByName:t,searchText:n,myAccountSeq:r=0,todayStr:i,showProject:a=!1,showManager:s=!0,showActions:d=!0,showRequest:l=!0,confirmMode:u="none",bugMode:p=!1,confirmInfo:m,onConfirmTask:c,projectLabel:T="",projectIcon:B="",onProjectClick:f,onRequestToggleCompleted:g,onDateClick:k,onChangeNote:w,onMemberClick:b,onClaimClick:S,onVolunteerClick:h,onStatusClick:x,onOpenDetail:I,onTaskContextMenu:W,hideBottomBorder:D=!1,completeLocked:J=!1,unread:C=!1,notice:y=!1,noticeReadOnly:L=!1,noteLocked:$=!1,targetSummary:Q="",targetDisplay:R,onArchiveTask:ie,ackInfo:re,onAckConfirm:Ce,onAckListClick:xe,onPriorityClick:Ne}){let[oe,le]=Vl(!1),[ge,q]=Vl(""),K=Df(null);wf(()=>{if(!oe)return;let A=U=>{let Ue=K.current;Ue&&(U.target instanceof Node&&Ue.contains(U.target)||Ue.blur())};return document.addEventListener("mousedown",A,!0),document.addEventListener("touchstart",A,!0),()=>{document.removeEventListener("mousedown",A,!0),document.removeEventListener("touchstart",A,!0)}},[oe]);let Y=[e.manager_account_seq??0,...e.receiver_account_seqs??[]].some(A=>A>0&&A!==(e.author_account_seq??0)),E=L,H=r>0&&!e.is_notice&&!e.is_event&&(e.manager_account_seq??0)===r,_=E||!!e.is_notice,N=ne(),ce=!!S&&Dr(e,r),M=!!h&&Mr(e,r),ae=_&&!Rl(e),me=e.is_notice?V(Bn,{canConfirm:!!re?.canAck,count:re?.count??0,total:re?.total??0,myConfirmed:!!re?.acked,onConfirm:()=>Ce?.(e),onShowList:A=>xe?.(e,A)}):null,Oe=!e.is_notice&&!!e.due_date&&e.due_date.slice(0,10)<=i?"#e5484d":"#2f80ed";return vn(ke,{onContextMenu:A=>W(e,A),sx:{display:"grid",gridTemplateColumns:Or({showProject:a,showManager:s,showActions:d,showRequest:l,notice:y,confirmMode:u,bug:p}),minHeight:48,fontSize:15,bgcolor:N.table.rowBg,color:N.table.rowColor,borderBottom:D?"none":`1px solid ${N.table.rowBorderColor}`,"&:hover":{bgcolor:N.table.rowHoverBg},"& > .cell":{px:1,minWidth:0,display:"flex",alignItems:"center",borderRight:`1px solid ${N.table.rowBorderColor}`},"& > .cell:first-of-type":{px:0,borderRight:"none"},"& > .cell:nth-of-type(2)":{pl:1.5,pr:2},"& > .cell:last-child":{borderRight:"none",pr:2}},children:[V(ke,{className:"cell",children:H?V(ke,{sx:{width:3,alignSelf:"stretch",my:.5,ml:.5,bgcolor:"#2f80ed",borderRadius:1.5}}):null}),V(ke,{className:"cell",sx:{justifyContent:"center"},children:!E&&!J?V(Xi,{title:e.completed&&e.completed_by?`${e.completed_by} \xB7 ${mt(e.completed_time)} \uC644\uB8CC`:e.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC",arrow:!0,enterDelay:300,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:V(Of,{checked:e.completed,icon:V(Rf,{sx:{fontSize:20,color:"#9a9a97",opacity:.45}}),checkedIcon:V(Pf,{sx:{fontSize:20,color:"#2f80ed"}}),onClick:A=>A.stopPropagation(),onChange:(A,U)=>g({anchorEl:A.currentTarget,task:e,nextCompleted:U}),sx:{p:.5}})}):null}),p?V(ke,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums",color:"#37352f"},children:e.ticket_no||"-"}):null,vn(ke,{className:"cell",onClick:()=>I(e),sx:{gap:1,cursor:"pointer","&:hover":{bgcolor:N.table.cellHoverBg}},children:[(()=>{let A=Fe(e.icon||(e.is_notice?xo:Me));if(!A)return null;let U=e.icon_color||(e.is_notice?"#e5484d":"#1e3a8a");return V(A,{sx:{fontSize:18,flexShrink:0,color:U}})})(),V(ke,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:e.completed?400:N.table.rowTitleFontWeight,color:e.completed?N.colors.textMuted:N.table.rowTitleColor,textDecoration:e.completed?"line-through":"none"},children:Qi(e.title,n)}),(e.comment_count??e.comments?.length??0)>0?V(Cn,{sx:{fontSize:16,flexShrink:0,color:"#9a9a97"}}):null,V(ke,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:V(Ot,{labelKeys:e.label_keys??[],labelOptions:o})}),C?V(ke,{component:"span",sx:{flexShrink:0,px:.55,fontSize:10.5,fontWeight:700,lineHeight:1.6,color:"#fff",bgcolor:"#e5484d",borderRadius:"4px"},children:"N"}):null,Br(e)&&!e.archived&&!E&&ie?V(Mf,{size:"small",variant:"outlined",color:"inherit",sx:{ml:"auto",flexShrink:0,minWidth:0,px:1.25,py:.25,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},onClick:A=>{A.stopPropagation(),ie(e)},children:"\uBCF4\uAD00"}):null]}),(()=>{let A=E||!!e.is_event||!!e.completed;return V(ke,{className:"cell",onClick:A?void 0:U=>x(e,U.currentTarget),sx:{py:.5,justifyContent:"center",...A?{}:{cursor:"pointer","&:hover":{bgcolor:N.table.cellHoverBg}}},children:e.is_event?(()=>{let U=jn(e);return U?V(Ee,{option:U}):null})():V(Ee,{option:go(e)})})})(),V(ke,{className:"cell",onClick:E?void 0:A=>k(e,"start_date",A.currentTarget),sx:{justifyContent:"center",whiteSpace:"nowrap",...E?{}:{cursor:"pointer","&:hover":{bgcolor:N.table.cellHoverBg}}},children:Gl(e.start_date)}),V(ke,{className:"cell",onClick:E?void 0:A=>k(e,"due_date",A.currentTarget),sx:{justifyContent:"center",gap:.5,color:Oe,fontWeight:500,whiteSpace:"nowrap",...E?{}:{cursor:"pointer","&:hover":{bgcolor:N.table.cellHoverBg}}},children:e.due_date?vn(Ji,{children:[Gl(e.due_date),V(Ef,{sx:{fontSize:15}})]}):null}),y?V(ke,{className:"cell",onClick:E?void 0:()=>b(e,"targets"),sx:{gap:.75,...E?{}:{cursor:"pointer","&:hover":{bgcolor:N.table.cellHoverBg}}},children:V(Yl,{display:R,summary:Q,searchText:n,avatarSrcByName:t})}):null,!y&&e.is_notice?V(ke,{className:"cell",onClick:E?void 0:()=>b(e,"targets"),sx:{gridColumn:s?"span 2":"auto",gap:.75,...E?{}:{cursor:"pointer","&:hover":{bgcolor:N.table.cellHoverBg}}},children:V(Yl,{display:R,summary:Q,searchText:n,avatarSrcByName:t})}):null,!y&&!e.is_notice&&!e.is_event&&s?V(ke,{className:"cell",onClick:ae?void 0:()=>b(e,"manager"),sx:{gap:.75,...ce||M?{justifyContent:"center"}:{},...ae?{}:{cursor:"pointer","&:hover":{bgcolor:N.table.cellHoverBg}}},children:ce?V(Sn,{onClick:A=>S?.(e,A.currentTarget),children:"\uAC00\uC838\uAC00\uAE30"}):M?V(Sn,{onClick:A=>h?.(e,A.currentTarget),children:"\uAC00\uC838\uAC00\uAE30"}):V(zr,{names:e.manager_name?[e.manager_name]:[],searchText:n,avatarSrcByName:t,emphasize:H})}):null,!y&&!e.is_notice?V(ke,{className:"cell",onClick:_?void 0:()=>b(e,"receivers"),sx:{gridColumn:e.is_event&&s?"span 2":"auto",gap:.75,..._?{}:{cursor:"pointer","&:hover":{bgcolor:N.table.cellHoverBg}}},children:V(zr,{names:e.receiver_names,searchText:n,avatarSrcByName:t})}):null,V(ke,{className:"cell",onClick:E?void 0:A=>Ne?.(e,A.currentTarget),sx:{py:.5,justifyContent:"center",...E?{}:{cursor:"pointer","&:hover":{bgcolor:N.table.cellHoverBg}}},children:V(Lo,{priority:e.priority,plain:!0})}),a?V(ke,{className:"cell",onClick:E?void 0:A=>f?.(e,A.currentTarget),sx:{gap:.5,justifyContent:"flex-start",...E?{}:{cursor:"pointer","&:hover":{bgcolor:N.table.cellHoverBg}}},children:T?vn(Ji,{children:[(()=>{let A=Fe(B);return A?V(A,{sx:{fontSize:15,flexShrink:0,color:"#1e3a8a"}}):null})(),V(ke,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:T})]}):null}):null,y?V(ke,{className:"cell",sx:{justifyContent:"center"},children:me}):null,!y&&d&&l?V(ke,{className:"cell",sx:{justifyContent:"center"},children:e.is_notice?me:Y?V(Bn,{canConfirm:!!m?.canConfirm,count:m?.count??0,total:m?.total??0,myConfirmed:!!m?.myTime,onConfirm:()=>c?.(e),onShowList:A=>xe?.(e,A)}):null}):null,!y&&u==="action"?V(ke,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",color:N.table.rowSubColor},children:e.is_notice?me:m&&m.total>0?V(Bn,{canConfirm:!!m.canConfirm,count:m.count,total:m.total,myConfirmed:!!m.myTime,onConfirm:()=>c?.(e),onShowList:A=>xe?.(e,A)}):"-"}):null,!y&&!d?V(ke,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",color:N.table.rowSubColor},children:e.completed_time||"-"}):null,p?null:V(ke,{className:"cell",onClick:()=>{!$&&!oe&&(q(e.note),le(!0))},sx:{color:"#6f6f6c",cursor:$?"default":"text"},children:oe?V(ke,{component:"input",ref:K,autoFocus:!0,spellCheck:!1,value:ge,onChange:A=>q(A.target.value),onBlur:()=>{le(!1),ge.trim()!==e.note&&w(e.seq,ge)},onKeyDown:A=>{A.key==="Enter"&&A.target.blur(),A.key==="Escape"&&(q(e.note),le(!1))},sx:{flex:1,minWidth:0,width:"100%",border:"none",outline:"none",bgcolor:"transparent",font:"inherit",lineHeight:"inherit",letterSpacing:"inherit",color:N.table.rowTitleColor,caretColor:N.table.rowTitleColor,p:0,m:0}}):V(ke,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.note?Qi(e.note,n):""})})]})}import{useState as zf}from"react";import{Box as Jn,Button as Xl,ButtonBase as qf,Dialog as Af,Divider as Ql,Menu as Lf,MenuItem as Nf,Popover as Ff}from"@mui/material";import Hf from"@mui/icons-material/ChevronRight";import Wf from"@mui/icons-material/Check";import $f from"@mui/icons-material/NotificationsActiveOutlined";import{SimpleCalendar as Kf}from"@ehfuse/mui-datetime-picker";import{Fragment as Gf,jsx as Do,jsxs as Qt}from"react/jsx-runtime";var Uf=[{value:"min30_before",label:"30\uBD84 \uC804"},{value:"hour1_before",label:"1\uC2DC\uAC04 \uC804"},{value:"hour2_before",label:"2\uC2DC\uAC04 \uC804"}],Jl=[{value:"day_before",label:"1\uC77C \uC804"},{value:"two_days_before",label:"2\uC77C \uC804"},{value:"three_days_before",label:"3\uC77C \uC804"},{value:"week_before",label:"1\uC8FC\uC77C \uC804"}],Zl=[{value:"none",label:"\uC5C6\uC74C"},...Uf,...Jl];function Zi(e){return e?Zl:[{value:"none",label:"\uC5C6\uC74C"},...Jl]}function ea(e){return e==="same_day"?"\uB2F9\uC77C":Zl.find(o=>o.value===e)?.label??"\uC5C6\uC74C"}function Vf(e){let o=e?new Date(`${e}T00:00:00`):new Date;return Number.isNaN(o.getTime())?new Date:o}function Pt({anchorEl:e,open:o,date:t,reminder:n,hideReminder:r=!1,centered:i=!1,onClose:a,onDateChange:s,onReminderChange:d}){let[l,u]=zf(null),p=Qo(),m=Qt(Jn,{sx:{width:300,maxWidth:"100%"},children:[Do(Jn,{sx:{height:320},children:Do(Kf,{selectedDate:Vf(t),onSelect:c=>{s(qe(c)),a()},onClose:a,showFooter:!1,autoApply:!0})}),r?null:Qt(Gf,{children:[Do(Ql,{sx:{borderColor:"#e6e6e3"}}),Qt(qf,{onClick:c=>u(c.currentTarget),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1.25,fontSize:14,"&:hover":{bgcolor:"#f8f8f7"}},children:[Qt(Jn,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75,color:"#37352f"},children:[Do($f,{sx:{fontSize:17,color:"#9a9a97"}}),"\uB9AC\uB9C8\uC778\uB354"]}),Qt(Jn,{component:"span",sx:{display:"inline-flex",alignItems:"center",color:"#37352f"},children:[ea(n),Do(Hf,{sx:{fontSize:18,ml:.25,color:"#9a9a97"}})]})]}),Do(Lf,{transitionDuration:0,anchorEl:l,open:!!l,onClose:()=>u(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...p,children:Zi(!1).map(c=>Qt(Nf,{selected:c.value===n,onClick:()=>{d(c.value),u(null)},sx:{fontSize:14,minWidth:120,justifyContent:"space-between",gap:1},children:[c.label,c.value===n?Do(Wf,{sx:{fontSize:16,color:"#2f80ed"}}):null]},c.value))})]}),Do(Ql,{sx:{borderColor:"#e6e6e3"}}),Qt(Jn,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:1,py:.5},children:[Do(Xl,{size:"small",onClick:()=>{s(qe(new Date)),a()},sx:{minWidth:0,px:1.25,fontSize:13.5,color:"#2563eb"},children:"\uC624\uB298"}),Do(Xl,{size:"small",onClick:a,sx:{minWidth:0,px:1.25,fontSize:13.5,color:"#2563eb"},children:"\uB2EB\uAE30"})]})]});return i?Do(Af,{open:o,onClose:a,slotProps:{paper:{sx:{borderRadius:3,width:300,maxWidth:"calc(100vw - 48px)",overflow:"hidden"}}},children:m}):Do(Ff,{transitionDuration:0,open:o,anchorEl:e,onClose:a,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{borderRadius:2,boxShadow:"0 8px 24px rgba(0,0,0,0.14)"}}},children:m})}import{useEffect as Xf,useState as ta}from"react";import{Box as Jt,Button as Qf,Switch as Jf}from"@mui/material";import{FormDialog as Zf}from"@ehfuse/mui-form-dialog";import{ClearTextField as ex}from"@ehfuse/mui-form-controls";import{ErrorAlert as ox}from"@ehfuse/alerts";import{Box as Yf,ButtonBase as jf}from"@mui/material";import{jsx as oa}from"react/jsx-runtime";function qr({value:e,onChange:o}){return oa(Yf,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(40px, 1fr))",gap:1},children:wi.map(({key:t,Icon:n})=>{let r=t===e;return oa(jf,{onClick:()=>o(t),sx:{display:"flex",alignItems:"center",justifyContent:"center",height:40,minWidth:40,borderRadius:1,border:r?"2px solid #2563eb":"1px solid #dedddb",bgcolor:r?"#eef4ff":"#fff",color:r?"#1e3a8a":"#787774","&:hover":{bgcolor:r?"#eef4ff":"#f4f4f2"}},children:oa(n,{sx:{fontSize:20}})},t)})})}import{jsx as ut,jsxs as na}from"react/jsx-runtime";function Ar({open:e,title:o="\uC0C8 \uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00",initialLabel:t="",initialIcon:n=_i,confirmText:r="\uCD94\uAC00",initialUseSprints:i=!1,onClose:a,onSubmit:s}){let[d,l]=ta(""),[u,p]=ta(_i),[m,c]=ta(!1);Xf(()=>{e&&(l(t),p(n),c(i))},[e]);let T=()=>{let f=d.trim();if(!f){ox("\uD504\uB85C\uC81D\uD2B8 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}s(f,u,m),a()};return ut(Zf,{open:e,onClose:a,maxWidth:"xs",title:o,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-add-tab",sections:[{id:"add-tab",showTitle:!1,children:na(Jt,{children:[ut(ex,{label:"\uD504\uB85C\uC81D\uD2B8 \uC774\uB984",value:d,onChange:f=>l(f.target.value),onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),T())},fullWidth:!0,autoFocus:!0,sx:{mt:.5}}),ut(Jt,{sx:{mt:2,fontSize:13,color:"#787774"},children:"\uC544\uC774\uCF58"}),ut(Jt,{sx:{mt:1,maxHeight:264,overflowY:"auto",pr:.5},children:ut(qr,{value:u,onChange:p})}),na(Jt,{sx:{mt:2,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[na(Jt,{children:[ut(Jt,{sx:{fontSize:14,color:"#37352f"},children:"\uBAA9\uD45C(\uC2A4\uD504\uB9B0\uD2B8) \uC0AC\uC6A9"}),ut(Jt,{sx:{fontSize:12.5,color:"#9a9a97"},children:"\uBAA9\uD45C \uBC30\uC815\uC73C\uB85C \uBC18\uBCF5 \uC8FC\uAE30\uB97C \uAD00\uB9AC\uD569\uB2C8\uB2E4(\uAC1C\uBC1C\uD300\uC6A9)"})]}),ut(Jf,{checked:m,onChange:(f,g)=>c(g)})]})]})}],actions:{showCancelButton:!0,right:ut(Qf,{variant:"contained",onClick:T,children:r})}})}import{jsx as pe,jsxs as et}from"react/jsx-runtime";function fx(e){let o=e?new Date(`${e}T00:00:00`):new Date;return Number.isNaN(o.getTime())?new Date:o}function rs({tasks:e,statusOptions:o,avatarSrcByName:t,searchText:n,todayStr:r,sortBy:i,sortDirection:a,onSort:s,onRequestReply:d,onToggleCompleted:l,onChangeTaskDate:u,onChangeTaskReminder:p,groupBy:m,collapsedGroupKeys:c,customTabs:T,onToggleGroup:B,hideCompleted:f=!1,onAddInGroup:g,canAddInGroup:k,renderGroupSummary:w,renderGroupTitleSummary:b,onChangeTaskProject:S,onAddProject:h,onChangeNote:x,onMemberClick:I,onClaimTask:W,onChangeTaskStatus:D,onOpenDetail:J,onTaskContextMenu:C,onMemberFilterClick:y,activeMemberFilters:L=[],onStatusFilterClick:$,statusFilterActive:Q=!1,onAckFilterClick:R,ackFilterActive:ie=!1,onProjectFilterClick:re,projectFilterActive:Ce=!1,onPriorityFilterClick:xe,priorityFilterActive:Ne=!1,columns:oe,getConfirmInfo:le,onConfirmTask:ge,myAccountSeq:q=0,currentUserName:K="",groupManagerByMyRole:Y=!1,allowManagerVolunteer:E=!0,noticeAdmin:H=!1,getTargetSummary:_,getTargetDisplay:N,onArchiveTask:ce,isTaskUnread:M,getAckInfo:ae,onAckConfirm:me,onAckListClick:he,onChangeTaskPriority:Oe,onEndReached:A}){let U=ne(),Ue=Zt(()=>({showManager:!0,showActions:!0,showRequest:!0,...oe}),[oe]),no=Ue.showManager??!0,Yo=Ue.showActions??!0,wt=Ue.showRequest??!0,Kt=Ue.confirmMode??"none",at=Ue.notice??!1,qo=Ue.bug??!1,Dt=m!=="none",Ut=Zt(()=>Dt?$i(e,m,r,T,o,K,{enabled:Y,myAccountSeq:q}):[],[Dt,e,m,r,T,o,K,Y,q]),Ao=Zt(()=>f?Ut.map(v=>({section:v,visibleTasks:v.tasks.filter(ee=>!ee.completed)})).filter(v=>v.visibleTasks.length>0):Ut.map(v=>({section:v,visibleTasks:v.tasks})),[Ut,f]),Mt=Zt(()=>f?e.filter(v=>!v.completed):e,[e,f]),Vt=Zt(()=>new Set(c),[c]),Bo=Ue.showProject??(!at&&m!=="tab"),Gt=Zt(()=>Gi({...Ue,showProject:Bo}),[Ue,Bo]),De=Or({...Ue,showProject:Bo}),O=Zt(()=>{let v=new Map;for(let ee of T)v.set(ee.key,{label:ee.archived?`${ee.label} (\uBCF4\uAD00\uB428)`:ee.label,icon:ee.icon});return v},[T]),F=tx(null),[j,Z]=pt(null),be=e.length>0;es(()=>{if(!be){Z(null);return}let v=window.requestAnimationFrame(()=>{Z(F.current?.getScrollContainer()??null)});return()=>window.cancelAnimationFrame(v)},[be]);let[_e,eo]=pt(!1);es(()=>{if(!j)return;let v=()=>eo(j.scrollHeight>j.clientHeight);v();let ee=new ResizeObserver(v);return ee.observe(j),j.firstElementChild&&ee.observe(j.firstElementChild),()=>ee.disconnect()},[j]);let[ue,Ve]=pt(null),[Se,Qe]=pt(null),[jo,_o]=pt(null),[oo,Xo]=pt(null),[Co,P]=pt(!1),[Fn,sl]=pt(null),Hn=Fn?e.find(v=>v.seq===Fn.taskSeq)??null:null,[hr,Ci]=pt(null),br=hr?e.find(v=>v.seq===hr.taskSeq)??null:null,cl=dt((v,ee)=>{Ci({anchorEl:ee,taskSeq:v.seq})},[]),ml=dt((v,ee)=>{sl({anchorEl:ee,taskSeq:v.seq})},[]),Dm=dt((v,ee)=>{if(!ee)return;s(v,i===v&&a==="asc"?"desc":"asc")},[s,i,a]),ul=dt((v,ee,ve)=>{Ve({anchorEl:ve,taskSeq:v.seq,field:ee,date:v[ee],reminder:v.reminder,completed:v.completed})},[]),dl=dt((v,ee)=>{Xo({anchorEl:ee,task:v})},[]),Mm=dt(v=>{ue&&(u(ue.taskSeq,ue.field,qe(v)),Ve(null))},[ue,u]),Om=dt(v=>{ue&&(u(ue.taskSeq,ue.field,v),Ve(ee=>ee&&{...ee,date:v}))},[ue,u]),Em=dt(v=>{ue&&(p(ue.taskSeq,v),Ve(ee=>ee&&{...ee,reminder:v}))},[ue,p]),pl=dt((v,ee=!1)=>pe(jl,{hideBottomBorder:ee,task:v,statusOptions:o,avatarSrcByName:t,searchText:n,myAccountSeq:q,todayStr:r,showProject:Bo,showManager:no,showActions:Yo,showRequest:wt,confirmMode:Kt,confirmInfo:v.is_notice?void 0:le?.(v),onConfirmTask:ge,projectLabel:O.get(v.tab_key??"")?.label??"",projectIcon:O.get(v.tab_key??"")?.icon??"",onProjectClick:dl,onRequestReply:d,onRequestToggleCompleted:Qe,onDateClick:ul,onChangeNote:x,onMemberClick:I,onClaimClick:W?(ve,wo)=>_o({anchorEl:wo,taskSeq:ve.seq,title:ve.title,kind:"claim"}):void 0,onVolunteerClick:E?(ve,wo)=>_o({anchorEl:wo,taskSeq:ve.seq,title:ve.title,kind:"volunteer"}):void 0,onStatusClick:ml,onOpenDetail:J,onTaskContextMenu:C,notice:at,bugMode:qo,noticeReadOnly:!ct(v,q),noteLocked:v.is_notice?!wr(v,q):!ct(v,q),completeLocked:v.is_event?!0:v.is_notice?(v.author_account_seq??0)!==q:(v.author_account_seq??0)!==q&&(v.manager_account_seq??0)!==q,targetSummary:v.is_notice?_?.(v):void 0,targetDisplay:v.is_notice?N?.(v):void 0,onArchiveTask:ce,unread:M?.(v)??!1,ackInfo:v.is_notice?ae?.(v):void 0,onAckConfirm:me,onAckListClick:he,onPriorityClick:cl},v.seq),[n,o,t,r,Bo,no,Yo,wt,Kt,le,ge,at,qo,q,H,_,N,ce,M,ae,me,he,cl,O,dl,d,ul,x,I,W,ml,J,C]);return et(No,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${U.table.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden",bgcolor:U.table.bg,color:U.table.rowColor,...U.table.sx},children:[pe(No,{sx:{display:"grid",gridTemplateColumns:De,borderBottom:`1px solid ${U.table.borderColor}`,flexShrink:0,bgcolor:U.table.headerBg,"& > *":{borderRight:`1px solid ${U.table.rowBorderColor}`},"& > *:first-of-type":{px:0,borderRight:"none"},"& > *:nth-of-type(2)":{pl:1.5,pr:2},"& > *:last-child":{borderRight:"none",pr:2},...U.table.headerSx},children:Gt.map(v=>{let ee=i===v.id,ve=!!v.memberFilter,wo=ve&&L.includes(v.memberFilter),Wn=ve||!!v.statusFilter||!!v.ackFilter||!!v.projectFilter||!!v.priorityFilter,kr=wo||!!v.statusFilter&&Q||!!v.ackFilter&&ie||!!v.projectFilter&&Ce||!!v.priorityFilter&&Ne;return et(No,{onClick:lt=>{v.memberFilter?y(v.memberFilter,lt.currentTarget):v.statusFilter?$(lt.currentTarget):v.ackFilter?R?.(lt.currentTarget):v.projectFilter?re?.(lt.currentTarget):v.priorityFilter?xe?.(lt.currentTarget):Dm(v.id,v.sortable)},sx:{display:"flex",alignItems:"center",justifyContent:v.align==="center"?"center":"flex-start",gap:.5,px:1,py:1,minWidth:0,fontSize:U.table.headerFontSize,color:v.sortable||Wn?U.table.headerActiveColor:U.table.headerColor,whiteSpace:"nowrap",cursor:v.sortable||Wn?"pointer":"default",userSelect:"none",...ee?{color:U.table.headerFilteredColor}:{},...kr?{color:U.table.headerFilteredColor,fontWeight:600}:{}},children:[v.icon,v.label,kr?pe(mx,{sx:{fontSize:14}}):null,ee?a==="asc"?pe(ax,{sx:{fontSize:13}}):pe(lx,{sx:{fontSize:13}}):null]},v.id)})}),Mt.length===0?pe(No,{sx:{py:8,textAlign:"center",color:U.table.emptyColor,fontSize:14},children:qo?"\uB4F1\uB85D\uB41C \uC624\uB958\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.":at?"\uB4F1\uB85D\uB41C \uACF5\uC9C0\uC0AC\uD56D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.":"\uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):pe(No,{sx:{flex:1,minHeight:0},children:pe(dx,{ref:F,style:{height:"100%"},thumb:{width:8},children:j?Dt?pe(ns,{customScrollParent:j,data:Ao,computeItemKey:(v,ee)=>ee.section.key,itemContent:(v,ee)=>{let{section:ve,visibleTasks:wo}=ee,Wn=Vt.has(ve.key),kr=v===Ao.length-1;return et(No,{children:[et(No,{onClick:()=>B(ve.key),sx:{display:"flex",alignItems:"center",gap:.5,px:1.5,minHeight:U.table.groupHeader.minHeight,bgcolor:U.table.groupHeader.bg,borderBottom:`1px solid ${U.table.groupHeader.borderColor}`,cursor:"pointer",userSelect:"none","&:hover":{bgcolor:U.table.groupHeader.hoverBg},...U.table.groupHeader.sx},children:[Wn?pe(cx,{sx:{fontSize:20,color:U.colors.textMuted}}):pe(sx,{sx:{fontSize:20,color:U.colors.textMuted}}),pe(No,{component:"span",sx:{fontSize:U.table.groupHeader.labelFontSize,fontWeight:U.table.groupHeader.labelFontWeight,color:U.table.groupHeader.labelColor},children:ve.label}),b?pe(No,{sx:{flexShrink:0,display:"flex",alignItems:"center",ml:.5},children:b(ve.key,ve.tasks)}):null,g&&(!k||k(ve.key))?pe(rx,{size:"small","aria-label":"\uC774 \uADF8\uB8F9\uC5D0 \uC5C5\uBB34 \uB4F1\uB85D",onClick:lt=>{lt.stopPropagation(),g(ve.key,ve.tasks)},sx:{flexShrink:0,ml:.75,p:.25,color:U.colors.textSecondary,"&:hover":{bgcolor:U.colors.surfaceHover,color:U.colors.accentOnSurface}},children:pe(ts,{sx:{fontSize:21}})}):null,et(No,{sx:{ml:"auto",minWidth:0,display:"flex",alignItems:"center",gap:1,pr:.5},children:[w?w(ve.key,ve.tasks):null,pe(No,{component:"span",sx:{flexShrink:0,width:U.table.groupHeader.badge.width,py:U.table.groupHeader.badge.paddingY,borderRadius:`${U.table.groupHeader.badge.borderRadius}px`,bgcolor:U.table.groupHeader.badge.bg,border:U.table.groupHeader.badge.border,color:U.table.groupHeader.badge.color,fontSize:U.table.groupHeader.badge.fontSize,fontWeight:U.table.groupHeader.badge.fontWeight,lineHeight:1.6,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:wo.length})]})]}),Wn?null:wo.map((lt,Pm)=>pl(lt,kr&&Pm===wo.length-1&&_e))]})}}):pe(ns,{customScrollParent:j,data:Mt,computeItemKey:(v,ee)=>ee.seq,endReached:A,itemContent:(v,ee)=>pl(ee,v===Mt.length-1&&_e)}):null})}),pe(_r,{anchorEl:Fn?.anchorEl??null,value:Hn?.status??"",options:Hn?El(Hn):Yn,onSelect:v=>{Hn&&D(Hn.seq,v)},onClose:()=>sl(null)}),pe(os,{transitionDuration:0,anchorEl:hr?.anchorEl??null,open:!!hr,onClose:()=>Ci(null),children:["high","medium","low"].map(v=>et(Lr,{selected:br?.priority===v,onClick:()=>{br&&Oe?.(br.seq,v),Ci(null)},sx:{fontSize:14,minWidth:130,gap:1},children:[pe(Lo,{priority:v,small:!0}),br?.priority===v?pe(ra,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},v))}),et(os,{anchorEl:oo?.anchorEl??null,open:!!oo,onClose:()=>Xo(null),transitionDuration:0,children:[et(Lr,{selected:!oo?.task.tab_key,onClick:()=>{oo&&S(oo.task.seq,""),Xo(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[pe(ux,{sx:{fontSize:17,color:"#9a9a97"}}),"\uC5C6\uC74C",oo?.task.tab_key?null:pe(ra,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}})]}),T.filter(v=>!v.archived).map(v=>{let ee=Fe(v.icon),ve=oo?.task.tab_key===v.key;return et(Lr,{selected:ve,onClick:()=>{oo&&S(oo.task.seq,v.key),Xo(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[ee?pe(ee,{sx:{fontSize:17,color:"#1e3a8a"}}):null,v.label,ve?pe(ra,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},v.key)}),h?[pe(nx,{},"add-project-divider"),et(Lr,{onClick:()=>P(!0),sx:{fontSize:14,color:"#787774"},children:[pe(ix,{children:pe(ts,{sx:{fontSize:18,color:"#787774"}})}),"\uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00"]},"add-project")]:null]}),h?pe(Ar,{open:Co,onClose:()=>P(!1),onSubmit:(v,ee)=>{let ve=oo?.task.seq??0;(async()=>{let wo=await h(v,ee);wo&&ve&&S(ve,wo)})(),Xo(null)}}):null,pe(px,{anchorEl:ue?.anchorEl??null,open:!!ue&&ue?.field==="start_date",onClose:()=>Ve(null),selectedDate:fx(ue?.date??""),onDateChange:Mm}),pe(Pt,{anchorEl:ue?.anchorEl??null,open:!!ue&&ue?.field==="due_date",date:ue?.date??"",reminder:ue?.reminder??"none",hideReminder:!!ue?.completed,onClose:()=>Ve(null),onDateChange:Om,onReminderChange:Em}),pe(Ge,{open:!!jo,anchorEl:jo?.anchorEl??null,title:jo?.kind==="claim"?"\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:()=>_o(null),onConfirm:()=>{jo&&W?.(jo.taskSeq),_o(null)}}),pe(Ge,{open:!!Se,anchorEl:Se?.anchorEl??null,title:Se?.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:Se?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>Qe(null),onConfirm:()=>{Se&&l(Se.task,Se.nextCompleted),Qe(null)}})]})}import{useCallback as ot,useMemo as xt,useRef as Rx,useState as gt}from"react";import{Box as Ie,ButtonBase as ks,Divider as cs,IconButton as ms,Menu as us,MenuItem as zt}from"@mui/material";import sa from"@mui/icons-material/Add";import ds from"@mui/icons-material/MoreVert";import ps from"@mui/icons-material/EditOutlined";import fs from"@mui/icons-material/ArchiveOutlined";import xs from"@mui/icons-material/UnarchiveOutlined";import zx from"@mui/icons-material/NotificationsOutlined";import qx from"@mui/icons-material/PeopleAltOutlined";import{SvgIcon as xx}from"@mui/material";import{jsx as is}from"react/jsx-runtime";function ft({sx:e,...o}){return is(xx,{viewBox:"0 0 24 24",...o,sx:{fill:"none",...e},children:is("path",{d:"M4 6H20M16 6L15.7294 5.18807C15.4671 4.40125 15.3359 4.00784 15.0927 3.71698C14.8779 3.46013 14.6021 3.26132 14.2905 3.13878C13.9376 3 13.523 3 12.6936 3H11.3064C10.477 3 10.0624 3 9.70951 3.13878C9.39792 3.26132 9.12208 3.46013 8.90729 3.71698C8.66405 4.00784 8.53292 4.40125 8.27064 5.18807L8 6M18 6V16.2C18 17.8802 18 18.7202 17.673 19.362C17.3854 19.9265 16.9265 20.3854 16.362 20.673C15.7202 21 14.8802 21 13.2 21H10.8C9.11984 21 8.27976 21 7.63803 20.673C7.07354 20.3854 6.6146 19.9265 6.32698 19.362C6 18.7202 6 17.8802 6 16.2V6M14 10V17M10 10V17",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}import{DndContext as Ax,DragOverlay as Lx,PointerSensor as Nx,pointerWithin as Fx,rectIntersection as Hx,useDroppable as Wx,useSensor as $x,useSensors as Kx}from"@dnd-kit/core";import{SortableContext as Ts,arrayMove as gs,horizontalListSortingStrategy as Ux,useSortable as Vx,verticalListSortingStrategy as Gx}from"@dnd-kit/sortable";import{CSS as Yx}from"@dnd-kit/utilities";import ca from"@ehfuse/overlay-scrollbar";import{useState as Tx}from"react";import{Box as Rt,ButtonBase as yx,Checkbox as Sx,Tooltip as Bx}from"@mui/material";import Cx from"@mui/icons-material/AlarmOutlined";import vx from"@mui/icons-material/TimerOutlined";import{Box as en,Button as gx,Popover as hx}from"@mui/material";import bx from"@mui/icons-material/CheckCircle";import{jsx as on,jsxs as Nr}from"react/jsx-runtime";function Fr({anchorEl:e,open:o,acks:t,total:n,avatarSrcByName:r,onRequestConfirm:i,onClose:a}){let s=Re();return on(hx,{open:o&&(s||!!e),anchorEl:e,onClose:a,transitionDuration:0,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...s?{anchorReference:"none",slotProps:{paper:{sx:{position:"fixed",top:"50%",left:"50%",translate:"-50% -50%",maxWidth:"calc(100vw - 48px)",maxHeight:"70vh",borderRadius:3}}}}:{},children:Nr(en,{sx:{minWidth:240,maxWidth:320,py:1},children:[Nr(en,{sx:{px:2,pb:.75,fontSize:fo(13.5),fontWeight:600,color:"#37352f",borderBottom:"1px solid #efefed"},children:["\uD655\uC778 ",t.length,"/",n]}),t.length===0?on(en,{sx:{px:2,py:1.5,fontSize:fo(13.5),color:"#9a9a97"},children:"\uC544\uC9C1 \uD655\uC778\uD55C \uC0AC\uB78C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):t.map(d=>Nr(en,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:.75,minWidth:0},children:[on(ho,{names:[d.name],size:22,avatarSrcByName:r}),on(en,{component:"span",sx:{fontSize:fo(14),color:"#37352f",whiteSpace:"nowrap"},children:d.name}),on(en,{component:"span",sx:{ml:"auto",fontSize:fo(12.5),color:"#9a9a97",whiteSpace:"nowrap"},children:mt(d.time)}),on(bx,{sx:{fontSize:16,color:"#2f80ed",flexShrink:0}})]},d.account_seq)),i?on(en,{sx:{borderTop:"1px solid #efefed",px:1.5,pt:1,pb:.25},children:Nr(gx,{size:"small",fullWidth:!0,variant:"outlined",onClick:()=>{i(),a()},sx:{fontSize:fo(13)},children:["\uD655\uC778 \uC694\uCCAD (",n-t.length,"\uBA85 \uBBF8\uD655\uC778)"]})}):null]})})}function kx(e){let o=Number(e.author_account_seq??0);return[...new Set([Number(e.manager_account_seq??0),...e.receiver_account_seqs??[]].filter(t=>t>0&&t!==o))]}function as(e,o){let t=kx(e),n=e.acks??[],r=o>0?n.find(i=>i.account_seq===o):void 0;return{myTime:r?.time??"",canConfirm:o>0&&t.includes(o)&&!r,count:n.filter(i=>t.includes(i.account_seq)).length,total:t.length}}function j1(e){let o=String(e??"").trim();return o?o.slice(5,16).replaceAll("-","."):""}import{Fragment as wx,jsx as bo,jsxs as tn}from"react/jsx-runtime";function Hr(e){return{border:`1px solid ${e.borderColor}`,borderRadius:1,p:1,bgcolor:e.bg,display:"flex",flexDirection:"column",gap:.75,boxShadow:"0 1px 2px rgba(0,0,0,0.04)",...e.sx}}function Ix(e){let o=e.trim();return o?o.slice(2,10).replaceAll("-","."):"-"}function _x(){let e=new Date,o=String(e.getMonth()+1).padStart(2,"0"),t=String(e.getDate()).padStart(2,"0");return`${e.getFullYear()}-${o}-${t}`}function Zn({task:e,statusOptions:o,showDueDate:t=!1,onRequestArchiveToggle:n,onRequestReply:r,onDueDateClick:i,titleFontSize:a=13}){let s=ne(),l=!!e.due_date&&e.due_date.slice(0,10)<=_x()?s.colors.danger:s.colors.accentOnSurface,u=as(e,0),[p,m]=Tx(null),c=Tn(e,o),T=new Set(e.label_keys??[]),B=c.filter(g=>!T.has(g.key)),f=c.filter(g=>T.has(g.key));return tn(wx,{children:[tn(Rt,{sx:{display:"flex",alignItems:"center",gap:.5},children:[bo(Sx,{size:"small",checked:e.completed,onPointerDown:g=>g.stopPropagation(),onClick:g=>g.stopPropagation(),onChange:(g,k)=>n?.({anchorEl:g.currentTarget,taskSeq:e.seq,nextCompleted:k}),sx:{p:0}}),bo(Bx,{title:e.title,arrow:!0,enterDelay:300,children:tn(Rt,{sx:{flex:1,minWidth:0,pr:3.5,fontSize:a,fontWeight:s.mode==="dark"||e.completed?400:500,color:s.mode==="dark"?s.colors.textStrong:s.colors.textPrimary,lineHeight:1.35,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textDecoration:e.completed?"line-through":"none"},children:[e.is_event&&e.event_time?`${e.event_time} `:"",e.title]})}),(e.comment_count??e.comments?.length??0)>0?bo(Cn,{sx:{fontSize:15,flexShrink:0,color:s.colors.textMuted}}):null]}),e.is_bug&&e.ticket_no?bo(Rt,{sx:{pl:3,mt:-.5,fontSize:12.5,color:s.colors.textSecondary,fontWeight:500,fontVariantNumeric:"tabular-nums"},children:e.ticket_no}):null,tn(Rt,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:.5},children:[tn(Rt,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5,minWidth:0},children:[B.map(g=>bo(Ee,{option:g,small:!0},g.key)),bo(Lo,{priority:e.priority,small:!0}),f.map(g=>bo(Ee,{option:g,small:!0},g.key))]}),t&&String(e.due_date??"").trim()?tn(yx,{disabled:!i,onPointerDown:g=>g.stopPropagation(),onClick:g=>{g.stopPropagation(),i?.(e,g.currentTarget)},sx:{display:"inline-flex",alignItems:"center",gap:.25,px:.5,py:.1,borderRadius:.75,fontSize:13,fontWeight:500,color:l,whiteSpace:"nowrap","&:hover":i?{bgcolor:s.colors.border}:void 0},children:[Ix(e.due_date),bo(Cx,{sx:{fontSize:15}})]}):null]}),t&&e.estimated_time?tn(Rt,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.25,mt:-.5,fontSize:12,color:s.colors.textSecondary},children:[bo(vx,{sx:{fontSize:14}}),e.estimated_time]}):null,bo(ho,{names:[...e.manager_name?[e.manager_name]:[],...e.receiver_names],size:20,ringFirst:!!e.manager_name}),u.total>0?bo(Rt,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.5},children:bo(Rt,{sx:{flexShrink:0,width:64},onPointerDown:g=>g.stopPropagation(),onClick:g=>g.stopPropagation(),children:bo(Bn,{canConfirm:!1,count:u.count,total:u.total,onConfirm:()=>{},onShowList:g=>m(g)})})}):null,bo(Fr,{anchorEl:p,open:!!p,acks:e.acks??[],total:u.total,onRequestConfirm:r&&u.count<u.total?()=>{r(e),m(null)}:void 0,onClose:()=>m(null)})]})}import{Box as Dx}from"@mui/material";import{useSortable as Mx}from"@dnd-kit/sortable";import{CSS as Ox}from"@dnd-kit/utilities";import{jsx as ls}from"react/jsx-runtime";function Ex(e){return{px:1.25,py:1,display:"flex",flexDirection:"column",gap:.75,borderBottom:`1px solid ${e.borderColor}`,bgcolor:e.bg}}function ss({task:e,statusOptions:o,variant:t="card",showDueDate:n=!1,onRequestArchiveToggle:r,onRequestReply:i,onDueDateClick:a,onCardClick:s,onCardContextMenu:d,titleFontSize:l}){let u=ne(),{attributes:p,listeners:m,setNodeRef:c,transform:T,transition:B,isDragging:f}=Mx({id:String(e.seq)}),g=t==="list";return ls(Dx,{ref:c,...p,...m,onClick:s?()=>s(e):void 0,onContextMenu:d?k=>d(e,k):void 0,sx:{...g?Ex(u.card):Hr(u.card),opacity:f?.35:e.completed?.55:1,transform:Ox.Translate.toString(T),transition:B,position:"relative",cursor:"default",touchAction:"none","&:hover":g?{bgcolor:u.card.hoverBg}:{boxShadow:"0 3px 8px rgba(0,0,0,0.1)"}},children:ls(Zn,{task:e,statusOptions:o,showDueDate:n,onRequestArchiveToggle:r,onRequestReply:i,onDueDateClick:a,titleFontSize:l})})}function Px(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?e.slice(5).replace("-","."):""}function Mo(e){if(e.status==="closed")return`${e.name} (\uC885\uB8CC)`;let o=Px(e.end_date);return o?`${e.name} (~${o})`:e.name}import{jsx as X,jsxs as ze}from"react/jsx-runtime";var hs=2,Wr="group-",Oo="colmove-",ia="__default__",aa=Li,la="__other__",$r="sprint-",bs=`${$r}0`,jx={planning:"#9a9a97",active:"#2f80ed",closed:"#9a9a97"};function ys(e){return{flexShrink:0,width:e.width,py:e.paddingY,borderRadius:`${e.borderRadius}px`,bgcolor:e.bg,border:e.border,color:e.color,fontSize:e.fontSize,fontWeight:e.fontWeight,lineHeight:1.6,textAlign:"center",fontVariantNumeric:"tabular-nums",...e.sx}}function Xx({column:e,tasks:o,statusOptions:t,onRequestArchiveToggle:n,onRequestReply:r,onDueDateClick:i,onAddTask:a,canAdd:s,onOpenMenu:d,onCardClick:l,onCardContextMenu:u,grow:p,summary:m,onOpenSprintMenu:c}){let T=ne(),{setNodeRef:B,isOver:f}=Wx({id:`${Wr}${e.key}`}),{attributes:g,listeners:k,setNodeRef:w,transform:b,transition:S,isDragging:h}=Vx({id:`${Oo}${e.key}`,disabled:e.isDefault||e.isArchived||!!e.locked});return ze(Ie,{ref:x=>{B(x),w(x)},sx:{flex:p?"1 0 270px":"0 0 270px",minWidth:270,contain:"inline-size",minHeight:0,maxHeight:"100%",display:"flex",flexDirection:"column",borderRadius:1.5,boxShadow:x=>x.shadows[1],bgcolor:f?T.colors.accentSoft:T.board.columnBg,transition:"background-color 0.15s",overflow:"hidden",transform:Yx.Translate.toString(b),...S?{transition:`${S}, background-color 0.15s`}:{},opacity:h?.6:1},children:[ze(Ie,{...g,...k,sx:{display:"flex",alignItems:"center",gap:.75,pl:1.25,pr:.5,py:1.1,borderBottom:`1px solid ${T.card.borderColor}`,flexShrink:0,touchAction:"none",cursor:e.isDefault||e.isArchived||e.locked?"default":"grab",opacity:e.isArchived?.65:1},children:[e.dot?X(Ie,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:e.dot,flexShrink:0}}):e.isDefault?null:(()=>{let x=Fe(e.icon);return x?X(x,{sx:{fontSize:17,color:"#1e3a8a"}}):null})(),X(Ie,{component:"span",sx:{fontSize:T.board.columnHeaderFontSize,fontWeight:700,color:T.board.columnHeaderColor,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.label}),X(Ie,{component:"span",sx:{...ys(T.board.badge),ml:"auto"},children:o.length}),e.sprint&&c?X(ms,{size:"small","aria-label":"\uBAA9\uD45C \uBA54\uB274",onPointerDown:x=>x.stopPropagation(),onClick:x=>c(x.currentTarget,e.sprint),sx:{color:"#9a9a97"},children:X(ds,{sx:{fontSize:18}})}):e.locked?null:X(ms,{size:"small","aria-label":"\uD504\uB85C\uC81D\uD2B8 \uBA54\uB274",onPointerDown:x=>x.stopPropagation(),onClick:x=>d({anchorEl:x.currentTarget,column:e}),sx:{color:"#9a9a97"},children:X(ds,{sx:{fontSize:18}})})]}),m?X(Ie,{sx:{px:1.25,py:1.25,borderBottom:`1px solid ${T.card.borderColor}`,flexShrink:0},children:m}):null,X(Ie,{sx:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column"},children:X(ca,{style:{height:"auto",flex:"1 1 auto",minHeight:0},contentStyle:{minWidth:0},thumb:{width:6},children:ze(Ie,{sx:{display:"flex",flexDirection:"column",flexGrow:1},children:[X(Ts,{items:o.map(x=>String(x.seq)),strategy:Gx,children:o.map(x=>X(ss,{task:x,statusOptions:t,variant:"list",showDueDate:!0,titleFontSize:15,onRequestArchiveToggle:n,onRequestReply:r,onDueDateClick:i,onCardClick:l,onCardContextMenu:u},x.seq))}),o.length===0&&!s?X(Ie,{sx:{py:3,textAlign:"center",fontSize:13,color:"#9a9a97"},children:"\uCE74\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,o.length===0&&s?X(Ie,{sx:{flexGrow:1,minHeight:56,display:"flex",flexDirection:"column","&:hover .taskbox-board-add":{opacity:1,pointerEvents:"auto"}},children:ze(ks,{className:"taskbox-board-add",onClick:()=>a(e.isDefault?"":e.key),sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,px:1.25,py:1.75,borderBottom:`1px dashed ${T.card.borderColor}`,bgcolor:T.card.bg,color:T.colors.accentOnSurface,fontSize:13,fontWeight:500,opacity:0,pointerEvents:"none",transition:"opacity 0.15s","&:hover":{bgcolor:T.card.hoverBg}},children:[X(sa,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})}):null]})})})]})}function ma({tasks:e,statusOptions:o,customTabs:t,mode:n="active",onToggleCompleted:r,onRequestReply:i,onChangeDueDate:a,onChangeReminder:s,onMoveTask:d,columnAxis:l="project",statusColumns:u=[],onMoveTaskStatus:p,sprintColumns:m=[],onMoveTaskSprint:c,onAddGroup:T,onAddTask:B,canAdd:f=!0,onRequestRename:g,onArchiveProject:k,onDeleteProject:w,onReorderProjects:b,onOpenDetail:S,onTaskContextMenu:h,hideCompleted:x=!1,renderColumnSummary:I,onEditSprint:W,onChangeSprintStatus:D,onRemoveSprint:J}){let C=ne(),[y,L]=gt(null),[$,Q]=gt(null),[R,ie]=gt(null),[re,Ce]=gt(null),[xe,Ne]=gt(null),[oe,le]=gt(null),[ge,q]=gt(null),[K,Y]=gt(null),[E,H]=gt(null),_=Rx(!1),N=xt(()=>new Map(e.map(O=>[O.seq,O])),[e]),ce=xt(()=>{let O=e.filter(F=>F.is_notice);return O.sort((F,j)=>F.completed!==j.completed?F.completed?1:-1:j.seq-F.seq),O},[e]),M=xt(()=>t.filter(O=>!O.archived),[t]),ae=xt(()=>t.filter(O=>O.archived),[t]),me=O=>({key:O.key,label:O.label,icon:O.icon,isDefault:!1,isArchived:O.archived}),he=xt(()=>new Set(u.map(O=>O.key)),[u]),Oe=xt(()=>new Set(m.map(O=>O.seq)),[m]),A=xt(()=>{if(l==="sprint")return[{key:bs,label:"\uBBF8\uBC30\uC815",icon:"",isDefault:!0,isArchived:!1,dot:"#c9c8c5",locked:!0},...m.map(O=>({key:`${$r}${O.seq}`,label:Mo(O),icon:"",isDefault:!1,isArchived:!1,dot:jx[O.status],locked:!0,sprint:O}))];if(l==="status"){let O=u.map(F=>({key:F.key,label:F.name,icon:"",isDefault:!1,isArchived:!1,dot:F.dot,locked:!0}));return O.some(F=>F.key===aa)?O:[...O,{key:aa,label:"\uC644\uB8CC",icon:"",isDefault:!1,isArchived:!1,dot:"#2f80ed",locked:!0}]}return n==="archived"?ae.map(me):[{key:ia,label:"\uAE30\uBCF8 \uC5C5\uBB34\uD568",icon:"",isDefault:!0,isArchived:!1},...M.map(me)]},[l,u,m,n,M,ae]),U=Kx($x(Nx,{activationConstraint:{distance:5}})),Ue=ot(O=>{let F=String(O.active.id).startsWith(Oo),j=Fx(O),Z=j.length>0?j:Hx(O);if(F)return Z.filter(eo=>String(eo.id).startsWith(Oo));let be=Z.filter(eo=>!String(eo.id).startsWith(Oo)),_e=be.filter(eo=>!String(eo.id).startsWith(Wr));return _e.length>0?_e:be},[]),no=xt(()=>{let O=new Map;for(let F of e){if(F.is_notice)continue;let j;if(l==="sprint"){let be=F.sprint_seq??0;j=Oe.has(be)?`${$r}${be}`:bs}else j=l==="status"?F.completed?aa:he.has(String(F.status??""))?String(F.status??""):la:F.tab_key?.trim()||ia;let Z=O.get(j);Z?Z.push(F):O.set(j,[F])}for(let F of O.values())F.sort((j,Z)=>{if(j.completed!==Z.completed)return j.completed?1:-1;let be=(j.group_sort_no??0)>0,_e=(Z.group_sort_no??0)>0;return be&&_e?(j.group_sort_no??0)-(Z.group_sort_no??0):be!==_e?be?-1:1:j.due_date!==Z.due_date?j.due_date<Z.due_date?-1:1:j.seq-Z.seq});return O},[e,l,he,Oe]),Yo=xt(()=>l!=="status"||(no.get(la)??[]).length===0?A:[...A,{key:la,label:"\uAE30\uD0C0",icon:"",isDefault:!1,isArchived:!1,dot:"#c9c8c5",locked:!0}],[l,A,no]),wt=ot(O=>ge?(ge.get(O)??[]).map(F=>N.get(F)).filter(F=>!!F):no.get(O)??[],[ge,N,no]),Kt=ot(O=>{let F=wt(O);return x?F.filter(j=>!j.completed):F},[wt,x]),at=ot(O=>{let F=String(O.active.id);if(F.startsWith(Oo)){H(F.slice(Oo.length));return}Y(Number(F)),q(new Map(A.map(j=>[j.key,(no.get(j.key)??[]).map(Z=>Z.seq)])))},[A,no]),qo=ot((O,F)=>{if(O.startsWith(Wr))return{key:O.slice(Wr.length),overSeq:null};let j=Number(O);for(let[Z,be]of F)if(be.includes(j))return{key:Z,overSeq:j};return null},[]),Dt=ot(O=>{let{active:F,over:j}=O;!j||String(F.id).startsWith(Oo)||q(Z=>{if(!Z)return Z;let be=Number(F.id),_e=qo(String(j.id),Z);if(!_e)return Z;let eo=[...Z.entries()].find(([,Qe])=>Qe.includes(be))?.[0];if(!eo||eo===_e.key)return Z;let ue=new Map(Z);ue.set(eo,(ue.get(eo)??[]).filter(Qe=>Qe!==be));let Ve=[...ue.get(_e.key)??[]],Se=Ve.length;if(_e.overSeq!==null){let Qe=Ve.indexOf(_e.overSeq);Qe!==-1&&(Se=Qe)}return Ve.splice(Se,0,be),ue.set(_e.key,Ve),ue})},[qo]),Ut=ot(O=>{let F=String(O.active.id);if(F.startsWith(Oo)){H(null);let Se=String(O.over?.id??"");if(!Se.startsWith(Oo))return;let Qe=F.slice(Oo.length),jo=Se.slice(Oo.length);if(Qe===jo)return;let _o=t.map(Co=>Co.key),oo=_o.indexOf(Qe),Xo=_o.indexOf(jo);if(oo===-1||Xo===-1)return;b(gs(_o,oo,Xo));return}let j=ge;if(q(null),Y(null),_.current=!0,!j||!O.over)return;let Z=Number(F),be=[...j.entries()].find(([,Se])=>Se.includes(Z));if(!be)return;let[_e,eo]=be,ue=[...eo],Ve=qo(String(O.over.id),j);if(Ve&&Ve.key===_e&&Ve.overSeq!==null&&Ve.overSeq!==Z){let Se=ue.indexOf(Z),Qe=ue.indexOf(Ve.overSeq);Se!==-1&&Qe!==-1&&(ue=gs(ue,Se,Qe))}if(l==="status"){p?.(Z,_e);return}if(l==="sprint"){c?.(Z,Number(_e.slice($r.length))||0);return}d(Z,_e===ia?"":_e,ue)},[t,ge,qo,d,b,l,p,c]),Ao=ot(()=>{q(null),Y(null),H(null),_.current=!0},[]),Mt=ot(O=>{if(_.current){_.current=!1;return}S(O)},[S]),Vt=K!==null?N.get(K)??null:null,Bo=E!==null?A.find(O=>O.key===E)??null:null,Gt=ot((O,F)=>{le({anchorEl:F,taskSeq:O.seq,date:O.due_date,reminder:O.reminder})},[]),De=$?.column??null;return ze(Ie,{sx:{flex:1,minHeight:0,height:"100%",display:"flex",flexDirection:"column",border:`1px solid ${C.card.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden",p:hs,bgcolor:C.colors.surfaceSubtle},children:[ze(Ax,{sensors:U,collisionDetection:Ue,onDragStart:at,onDragOver:Dt,onDragEnd:Ut,onDragCancel:Ao,children:[X(Ie,{sx:{flex:1,minHeight:0,minWidth:0,contain:"inline-size"},children:n==="archived"&&A.length===0?X(Ie,{sx:{py:8,textAlign:"center",color:"#9a9a97",fontSize:14},children:"\uBCF4\uAD00\uB41C \uD504\uB85C\uC81D\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):X(ca,{style:{height:"100%"},contentStyle:{width:"max-content",minWidth:"100%",height:"100%"},thumb:{width:8},showHorizontalScrollbar:!0,children:ze(Ie,{sx:{display:"flex",alignItems:"flex-start",gap:hs,height:"100%",minWidth:"min-content",pb:.5},children:[n==="active"&&ce.length>0?ze(Ie,{sx:{flex:l!=="project"?"1 0 270px":"0 0 270px",minWidth:270,contain:"inline-size",minHeight:0,maxHeight:"100%",display:"flex",flexDirection:"column",borderRadius:1.5,boxShadow:O=>O.shadows[1],bgcolor:C.card.bg,overflow:"hidden"},children:[ze(Ie,{sx:{display:"flex",alignItems:"center",gap:.75,pl:1.25,pr:.5,py:1.1,borderBottom:`1px solid ${C.card.borderColor}`,flexShrink:0,minHeight:48},children:[X(zx,{sx:{fontSize:17,color:"#e8763a"}}),X(Ie,{component:"span",sx:{fontSize:14.5,fontWeight:700,color:C.board.columnHeaderColor},children:"\uACF5\uC9C0\uC0AC\uD56D"}),ze(Ie,{component:"span",sx:{fontSize:13,color:"#9a9a97",flexShrink:0},children:["(",ce.length,")"]})]}),X(Ie,{sx:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column"},children:X(ca,{style:{height:"auto",flex:"1 1 auto",minHeight:0},contentStyle:{minWidth:0},thumb:{width:6},children:X(Ie,{sx:{display:"flex",flexDirection:"column"},children:ce.map(O=>ze(Ie,{onClick:()=>Mt(O),onContextMenu:F=>h(O,F),sx:{px:1.25,py:1,display:"flex",flexDirection:"column",gap:.75,borderBottom:`1px solid ${C.card.borderColor}`,bgcolor:C.card.bg,cursor:"pointer","&:hover":{bgcolor:C.card.hoverBg}},children:[X(Zn,{task:O,statusOptions:o,showDueDate:!0,titleFontSize:15,onRequestArchiveToggle:L}),(()=>{let F=(O.target_names??[]).filter(Z=>Z.trim());if(F.length===0)return null;let j=F.length>2?`${F[0]}, ${F[1]} \uC678 ${F.length-2}`:F.join(", ");return ze(Ie,{sx:{display:"flex",alignItems:"center",gap:.5,fontSize:12.5,color:"#787774",overflow:"hidden",whiteSpace:"nowrap"},children:[X(qx,{sx:{fontSize:14,flexShrink:0}}),X(Ie,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis"},children:j})]})})()]},O.seq))})})})]}):null,X(Ts,{items:M.map(O=>`${Oo}${O.key}`),strategy:Ux,children:Yo.map(O=>X(Xx,{column:O,tasks:Kt(O.key),summary:I?.(O.key,wt(O.key)),onOpenSprintMenu:W||D||J?(F,j)=>ie({anchorEl:F,sprint:j}):void 0,statusOptions:o,onRequestArchiveToggle:L,onRequestReply:i,onDueDateClick:Gt,onAddTask:B,canAdd:f&&l==="project",onOpenMenu:Q,onCardClick:Mt,onCardContextMenu:h,grow:l!=="project"},O.key))}),n==="active"&&l==="project"?ze(ks,{onClick:T,sx:{flex:"0 0 270px",minWidth:270,display:"flex",alignItems:"center",justifyContent:"center",gap:.5,py:2,border:"1.5px dashed #cfcfcc",borderRadius:1.5,color:"#787774",fontSize:14,"&:hover":{bgcolor:"#eef2f6",borderColor:"#9a9a97"}},children:[X(sa,{sx:{fontSize:18}}),"\uC0C8 \uD504\uB85C\uC81D\uD2B8"]}):null,n==="active"&&Yo.length===0&&ce.length===0?X(Ie,{sx:{flex:1,minWidth:240,display:"flex",alignItems:"center",justifyContent:"center",color:"#9a9a97",fontSize:14,py:6},children:l==="project"?"\uD504\uB85C\uC81D\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uC0C8 \uD504\uB85C\uC81D\uD2B8\uB97C \uCD94\uAC00\uD574 \uC5C5\uBB34\uB97C \uC815\uB9AC\uD558\uC138\uC694.":"\uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]})})}),X(Lx,{children:Vt?X(Ie,{sx:{...Hr,width:250,boxShadow:"0 8px 20px rgba(0,0,0,0.18)",cursor:"grabbing"},children:X(Zn,{task:Vt,statusOptions:o,showDueDate:!0,titleFontSize:15})}):Bo?ze(Ie,{sx:{display:"flex",alignItems:"center",gap:.75,width:270,px:1.25,py:1,bgcolor:C.card.bg,border:`1px solid ${C.card.borderColor}`,borderRadius:1.5,boxShadow:"0 8px 20px rgba(0,0,0,0.18)",opacity:.9,cursor:"grabbing"},children:[(()=>{let O=Fe(Bo.icon);return O?X(O,{sx:{fontSize:17,color:"#1e3a8a"}}):null})(),X(Ie,{component:"span",sx:{fontSize:13.5,fontWeight:700,color:C.board.columnHeaderColor},children:Bo.label}),X(Ie,{component:"span",sx:ys(C.board.badge),children:(no.get(Bo.key)??[]).length})]}):null})]}),ze(us,{transitionDuration:0,anchorEl:$?.anchorEl??null,open:!!$,onClose:()=>Q(null),children:[De&&!De.isArchived&&f?ze(zt,{onClick:()=>{De&&B(De.isDefault?"":De.key),Q(null)},sx:{fontSize:14,gap:1},children:[X(sa,{sx:{fontSize:18,color:"#787774"}}),"\uC0C8 \uC5C5\uBB34 \uB4F1\uB85D"]}):null,De&&!De.isDefault&&!De.isArchived?ze(zt,{onClick:()=>{g(De.key,De.label,De.icon),Q(null)},sx:{fontSize:14,gap:1},children:[X(ps,{sx:{fontSize:18,color:"#787774"}}),"\uC218\uC815"]}):null,De&&!De.isDefault&&!De.isArchived?ze(zt,{onClick:()=>{k(De.key,!0),Q(null)},sx:{fontSize:14,gap:1},children:[X(fs,{sx:{fontSize:18,color:"#787774"}}),"\uBCF4\uAD00"]}):null,De&&De.isArchived?ze(zt,{onClick:()=>{k(De.key,!1),Q(null)},sx:{fontSize:14,gap:1},children:[X(xs,{sx:{fontSize:18,color:"#787774"}}),"\uBCF5\uC6D0"]}):null,De&&!De.isDefault?X(cs,{}):null,De&&!De.isDefault?ze(zt,{onClick:()=>{$&&Ne($),Q(null)},sx:{fontSize:14,gap:1,color:"#e5484d"},children:[X(ft,{sx:{fontSize:18}}),"\uC0AD\uC81C"]}):null]}),ze(us,{transitionDuration:0,anchorEl:R?.anchorEl??null,open:!!R,onClose:()=>ie(null),children:[W?ze(zt,{onClick:()=>{R&&W(R.sprint.seq),ie(null)},sx:{fontSize:14,gap:1},children:[X(ps,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uC218\uC815"]}):null,D?ze(zt,{onClick:()=>{R&&D(R.sprint.seq,R.sprint.status==="closed"?"active":"closed"),ie(null)},sx:{fontSize:14,gap:1},children:[R?.sprint.status==="closed"?X(xs,{sx:{fontSize:18,color:"#787774"}}):X(fs,{sx:{fontSize:18,color:"#787774"}}),R?.sprint.status==="closed"?"\uB2E4\uC2DC \uC2DC\uC791":"\uBAA9\uD45C \uC885\uB8CC"]}):null,J?X(cs,{}):null,J?ze(zt,{onClick:()=>{R&&Ce(R),ie(null)},sx:{fontSize:14,gap:1,color:"#e5484d"},children:[X(ft,{sx:{fontSize:18}}),"\uBAA9\uD45C \uC0AD\uC81C"]}):null]}),X(Ge,{open:!!re,anchorEl:re?.anchorEl??null,title:`"${re?.sprint.name??""}" \uBAA9\uD45C\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`,confirmText:"\uC0AD\uC81C",onCancel:()=>Ce(null),onConfirm:()=>{re&&J?.(re.sprint.seq),Ce(null)}}),X(Pt,{anchorEl:oe?.anchorEl??null,open:!!oe,date:oe?.date??"",reminder:oe?.reminder??"none",onClose:()=>le(null),onDateChange:O=>{oe&&(a(oe.taskSeq,O),le(F=>F&&{...F,date:O}))},onReminderChange:O=>{oe&&(s(oe.taskSeq,O),le(F=>F&&{...F,reminder:O}))}}),X(Ge,{open:!!xe,anchorEl:xe?.anchorEl??null,title:`"${xe?.column.label??""}" \uD504\uB85C\uC81D\uD2B8\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?
|
|
2
|
-
\uC18C\uC18D \uC5C5\uBB34\uB294 \uAE30\uBCF8 \uC5C5\uBB34\uD568\uC73C\uB85C \uC774\uB3D9\uD569\uB2C8\uB2E4.`,confirmText:"\uC0AD\uC81C",onCancel:()=>Ne(null),onConfirm:()=>{xe&&w(xe.column.key),Ne(null)}}),X(Ge,{open:!!y,anchorEl:y?.anchorEl??null,title:y?.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:y?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>L(null),onConfirm:()=>{y&&r(y.taskSeq,y.nextCompleted),L(null)}})]})}import{useCallback as ht,useMemo as er,useRef as ng,useState as or}from"react";import{Box as Ye,Button as rg,ButtonBase as Cs,IconButton as Bs}from"@mui/material";import ig from"@mui/icons-material/Add";import ag from"@mui/icons-material/ChevronLeft";import lg from"@mui/icons-material/ChevronRight";import sg from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as cg}from"@ehfuse/mui-datetime-picker";import{DndContext as mg,DragOverlay as ug,PointerSensor as dg,pointerWithin as pg,rectIntersection as fg,useDroppable as xg,useSensor as gg,useSensors as hg}from"@dnd-kit/core";import{SortableContext as bg,arrayMove as kg,useSortable as Tg,verticalListSortingStrategy as yg}from"@dnd-kit/sortable";import{CSS as Sg}from"@dnd-kit/utilities";import Bg from"@ehfuse/overlay-scrollbar";import{useEffect as Qx,useState as Jx}from"react";function qt(e){let{loadHolidays:o}=vo(),[t,n]=Jx(()=>new Map),r=e.join(",");return Qx(()=>{if(!o||!r){n(new Map);return}let i=!1;return o(r.split(",").map(Number)).then(a=>{if(i)return;let s=new Map;for(let d of a)s.has(d.date)||s.set(d.date,d.name);n(s)}).catch(()=>{}),()=>{i=!0}},[o,r]),t}function Zx(e){let[o,t,n]=e.split("-").map(Number),r=new Date(Date.UTC(o,t-1,n+1)),i=a=>String(a).padStart(2,"0");return`${r.getUTCFullYear()}-${i(r.getUTCMonth()+1)}-${i(r.getUTCDate())}`}function In(e){let o=new Map;for(let t of e){let n=t.start_date;for(let r=0;r<62&&n<=t.end_date;r+=1){let i=o.get(n);i?i.push(t):o.set(n,[t]),n=Zx(n)}}for(let t of o.values())t.sort((n,r)=>(n.time||"99:99").localeCompare(r.time||"99:99")||n.title.localeCompare(r.title));return o}import{Box as ua,Tooltip as eg}from"@mui/material";import{jsx as da,jsxs as og}from"react/jsx-runtime";function _n({event:e,small:o=!1}){let t=e.time?`${e.time} ${e.title}`:e.title,n=e.calendar?`\uAD6C\uAE00 \xB7 ${e.calendar}`:"\uAD6C\uAE00 \uCE98\uB9B0\uB354",r=i=>{i.stopPropagation();let[a,s,d]=e.start_date.split("-").map(Number);window.open(`https://calendar.google.com/calendar/r/day/${a}/${s}/${d}`,"_blank")};return da(eg,{title:`(${n}) ${t}`,arrow:!0,enterDelay:300,children:og(ua,{onClick:r,onPointerDown:i=>i.stopPropagation(),sx:{display:"flex",alignItems:"center",gap:.5,px:1,py:o?.6:.8,borderRadius:.75,bgcolor:"#f1f1ef",color:"#37352f",fontSize:15,fontWeight:500,overflow:"hidden",whiteSpace:"nowrap",flexShrink:0,minWidth:0,maxWidth:"100%",cursor:"pointer","&:hover":{bgcolor:"#ececea"}},children:[da(ua,{component:"span",sx:{width:6,height:6,borderRadius:"50%",bgcolor:"#0f9d58",flexShrink:0}}),da(ua,{component:"span",sx:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:t})]})})}import{Box as Kr,Checkbox as tg}from"@mui/material";import{jsx as wn,jsxs as Ss}from"react/jsx-runtime";var pa={high:"#e5484d",medium:"#2f80ed",low:"#d9a514"},fa=15;function At({task:e,statusOptions:o,onOpenDetail:t,onContextMenu:n,isPreview:r=!1,isDragging:i=!1,isMine:a=!1,avatarSrcByName:s,showManagerAvatar:d=!1,onOpenMembers:l,setNodeRef:u,dragProps:p,trailing:m,showCheckbox:c=!1,onRequestToggleCompleted:T}){let B=ne(),f=B.mode==="dark",[g]=Tn(e,o),k=String(e.manager_name??"").trim(),w=Fe(e.icon||(e.is_notice?xo:Me)),b=!e.is_event&&!e.due_date.slice(0,10),S=!e.completed&&!e.is_event&&!!e.due_date&&e.due_date.slice(0,10)<_l(),h=d&&!a&&!!k;return Ss(Kr,{ref:u,...p??{},onClick:x=>{x.stopPropagation(),t(e)},onContextMenu:n?x=>n(e,x):void 0,sx:{display:"flex",alignItems:"center",gap:.5,py:.6,px:1,flexShrink:0,borderRadius:.75,minWidth:0,maxWidth:"100%",bgcolor:g?f?Yt(g.dot,B.chip.darkBgAlpha):g.bg:f?B.card.bg:B.colors.surfaceHover,color:g?f?B.chip.darkTextSource==="fg"?g.fg:g.dot:g.fg:B.colors.textPrimary,fontSize:fa,fontWeight:f||e.completed?400:500,textDecoration:e.completed?"line-through":"none",opacity:r?.5:i?.35:e.completed?.6:1,border:r?`1px dashed ${B.colors.accent}`:"1px solid transparent",pointerEvents:r?"none":"auto",cursor:"pointer",touchAction:p?"none":"auto",overflow:"hidden","&:hover":{filter:"brightness(0.96)"},...S?{borderLeft:`3px solid ${B.colors.danger}`,pl:.75}:a?{borderLeft:`3px solid ${B.colors.accentOnSurface}`,pl:.75}:b?{borderLeft:`3px solid ${Yt(B.colors.textMuted,.4)}`,pl:.75}:{}},children:[wn(Kr,{component:"span",sx:{width:6,height:6,borderRadius:"50%",flexShrink:0,bgcolor:pa[e.priority]??B.colors.accentOnSurface}}),c&&T?wn(tg,{size:"small",checked:e.completed,onPointerDown:x=>x.stopPropagation(),onClick:x=>x.stopPropagation(),onChange:(x,I)=>T({anchorEl:x.currentTarget,taskSeq:e.seq,nextCompleted:I}),sx:{p:0,flexShrink:0}}):null,w?wn(w,{sx:{fontSize:15,flexShrink:0,opacity:.75}}):null,Ss(Kr,{component:"span",sx:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:f?B.colors.textStrong:B.colors.textPrimary},children:[e.is_event&&e.event_time?`${e.event_time} `:"",e.title]}),(e.comment_count??e.comments?.length??0)>0?wn(Cn,{sx:{fontSize:15,flexShrink:0,color:B.colors.textMuted}}):null,m??null,!m&&h?wn(Kr,{component:"span",onClick:l?x=>{x.stopPropagation(),l(e)}:void 0,sx:{display:"inline-flex",flexShrink:0,ml:"auto",pl:.5},children:wn(Jo,{src:s?.get(k)??"",avatarSx:{width:22,height:22,fontSize:11},iconFontSize:14})}):null]})}import{jsx as ye,jsxs as bt}from"react/jsx-runtime";var vs=36,Cg=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"],Ur="day-";function xa(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(o.getDate()-o.getDay()),o}function ga(e,o){let t=new Date(e);return t.setDate(t.getDate()+o),t}function vg(e){let o=e[0],t=e[e.length-1];return o.getMonth()===t.getMonth()?`${o.getFullYear()}\uB144 ${o.getMonth()+1}\uC6D4`:o.getFullYear()===t.getFullYear()?`${o.getFullYear()}\uB144 ${o.getMonth()+1}\uC6D4 - ${t.getMonth()+1}\uC6D4`:`${o.getFullYear()}\uB144 ${o.getMonth()+1}\uC6D4 - ${t.getFullYear()}\uB144 ${t.getMonth()+1}\uC6D4`}function Ig(e){return e.getDate()===1?`${e.getMonth()+1}\uC6D4 1\uC77C`:String(e.getDate())}function _g({task:e,statusOptions:o,isMine:t,avatarSrcByName:n,onCardClick:r,onCardContextMenu:i,onRequestArchiveToggle:a}){let{attributes:s,listeners:d,setNodeRef:l,transform:u,transition:p,isDragging:m}=Tg({id:String(e.seq)});return ye(At,{task:e,statusOptions:o,isMine:t,avatarSrcByName:n,showManagerAvatar:!0,onOpenDetail:c=>r?.(c),onContextMenu:i,showCheckbox:!0,onRequestToggleCompleted:a,isDragging:m,setNodeRef:l,dragProps:{...s,...d,style:{transform:Sg.Translate.toString(u),transition:p}}})}function wg({dayKey:e,isToday:o,dayLabel:t,holidayName:n,tasks:r,googleEvents:i,statusOptions:a,onRequestArchiveToggle:s,onRequestReply:d,onAddSchedule:l,canAdd:u,onCardClick:p,onCardContextMenu:m,summary:c,myAccountSeq:T,avatarSrcByName:B}){let f=ne(),{setNodeRef:g}=xg({id:`${Ur}${e}`});return bt(Ye,{ref:g,sx:{minWidth:0,minHeight:0,height:"100%",display:"flex",flexDirection:"column",bgcolor:o?f.calendar.todayBg:f.calendar.cellBg},children:[bt(Ye,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:.5,px:1,height:vs,bgcolor:o?f.calendar.todayBg:f.calendar.dateBandBg,borderBottom:`1px solid ${f.calendar.borderColor}`,flexShrink:0},children:[n?ye(Ye,{component:"span",sx:{mr:"auto",fontSize:11.5,fontWeight:600,color:f.colors.danger,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n}):null,o?ye(Ye,{component:"span",sx:{mr:.75,px:.6,py:.1,borderRadius:.5,fontSize:11,fontWeight:600,bgcolor:f.colors.danger,color:f.calendar.cellBg,lineHeight:1.6},children:"\uC624\uB298"}):null,ye(Ye,{component:"span",sx:{fontSize:13.5,fontWeight:o?700:400,color:n?f.colors.danger:f.mode==="dark"?f.colors.textStrong:f.colors.textPrimary,flexShrink:0},children:t})]}),c?ye(Ye,{sx:{px:1,py:1,borderBottom:`1px solid ${f.calendar.borderColor}`,flexShrink:0},children:c}):null,ye(Ye,{sx:{flex:1,minHeight:0,bgcolor:o?f.calendar.todayBg:f.colors.surfaceSubtle},children:ye(Bg,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:bt(Ye,{sx:{display:"flex",flexDirection:"column",flexGrow:1},children:[i.length>0?ye(Ye,{sx:{display:"flex",flexDirection:"column",gap:.5,px:1,pt:.75,pb:.25},children:i.map(k=>ye(_n,{event:k},k.uid))}):null,ye(bg,{items:r.map(k=>String(k.seq)),strategy:yg,children:ye(Ye,{sx:{display:"flex",flexDirection:"column",gap:.5,px:1,pt:.75},children:r.map(k=>ye(_g,{task:k,statusOptions:a,isMine:T>0&&Number(k.manager_account_seq??0)===T,avatarSrcByName:B,onCardClick:p,onCardContextMenu:m,onRequestArchiveToggle:s},k.seq))})}),ye(Ye,{sx:{flexGrow:1,minHeight:56,display:"flex",flexDirection:"column",pb:1,...u?{"&:hover .taskbox-add-schedule":{opacity:1,pointerEvents:"auto"}}:{}},children:bt(Cs,{className:"taskbox-add-schedule",onClick:()=>l(e),sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,px:1.25,py:1.75,borderBottom:`1px dashed ${f.calendar.borderColor}`,bgcolor:f.calendar.cellBg,color:f.colors.accentOnSurface,fontSize:13,fontWeight:500,opacity:0,pointerEvents:"none",transition:"opacity 0.15s","&:hover":{bgcolor:f.calendar.hoverBg}},children:[ye(ig,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})})]})})})]})}function Is({tasks:e,googleEvents:o=[],statusOptions:t,fallbackToStartDate:n=!1,myAccountSeq:r=0,avatarSrcByName:i,todayStr:a,onToggleCompleted:s,onMoveTask:d,onRequestReply:l,onAddSchedule:u,canAdd:p=!0,onOpenDetail:m,onTaskContextMenu:c,hideCompleted:T=!1,renderColumnSummary:B}){let f=ne(),[g,k]=or(()=>xa(new Date)),[w,b]=or(null),[S,h]=or(null),[x,I]=or(null),[W,D]=or(null),J=ng(!1),C=er(()=>Array.from({length:7},(E,H)=>ga(g,H)),[g]),y=er(()=>new Map(e.map(E=>[E.seq,E])),[e]),L=er(()=>[...new Set(C.map(E=>E.getFullYear()))],[C]),$=qt(L),Q=hg(gg(dg,{activationConstraint:{distance:5}})),R=ht(E=>{let H=pg(E),_=H.length>0?H:fg(E),N=_.filter(ce=>!String(ce.id).startsWith(Ur));return N.length>0?N:_},[]),ie=er(()=>In(o),[o]),re=er(()=>{let E=new Map;for(let H of e){let _=H.due_date.slice(0,10)||(n?H.start_date.slice(0,10):"");if(!_)continue;let N=E.get(_);N?N.push(H):E.set(_,[H])}for(let H of E.values())H.sort((_,N)=>{let ce=_.sort_no>0,M=N.sort_no>0;if(ce&&M)return _.sort_no-N.sort_no;if(ce!==M)return ce?-1:1;if(_.completed!==N.completed)return _.completed?1:-1;let ae=Ni(_),me=Ni(N);return ae!==me?ae?-1:1:_.seq-N.seq});return E},[e,n]),Ce=ht(E=>x?(x.get(E)??[]).map(H=>y.get(H)).filter(H=>!!H):re.get(E)??[],[x,y,re]),xe=ht(E=>{let H=Ce(E);return T?H.filter(_=>!_.completed):H},[Ce,T]),Ne=ht(E=>{D(Number(E.active.id)),I(new Map(C.map(H=>{let _=qe(H);return[_,(re.get(_)??[]).map(N=>N.seq)]})))},[C,re]),oe=ht((E,H)=>{if(E.startsWith(Ur))return{day:E.slice(Ur.length),overSeq:null};let _=Number(E);for(let[N,ce]of H)if(ce.includes(_))return{day:N,overSeq:_};return null},[]),le=ht(E=>{let{active:H,over:_}=E;_&&I(N=>{if(!N)return N;let ce=Number(H.id),M=oe(String(_.id),N);if(!M)return N;let ae=[...N.entries()].find(([,A])=>A.includes(ce))?.[0];if(!ae||ae===M.day)return N;let me=new Map(N);me.set(ae,(me.get(ae)??[]).filter(A=>A!==ce));let he=[...me.get(M.day)??[]],Oe=he.length;if(M.overSeq!==null){let A=he.indexOf(M.overSeq);A!==-1&&(Oe=A)}return he.splice(Oe,0,ce),me.set(M.day,he),me})},[oe]),ge=ht(E=>{let{active:H,over:_}=E,N=x;if(I(null),D(null),J.current=!0,!N||!_)return;let ce=Number(H.id),M=[...N.entries()].find(([,A])=>A.includes(ce));if(!M)return;let[ae,me]=M,he=[...me],Oe=oe(String(_.id),N);if(Oe&&Oe.day===ae&&Oe.overSeq!==null&&Oe.overSeq!==ce){let A=he.indexOf(ce),U=he.indexOf(Oe.overSeq);A!==-1&&U!==-1&&(he=kg(he,A,U))}d(ce,ae,he)},[x,d,oe]),q=ht(()=>{I(null),D(null),J.current=!0},[]),K=ht(E=>{if(J.current){J.current=!1;return}m(E)},[m]),Y=W!==null?y.get(W)??null:null;return bt(Ye,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${f.calendar.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden"},children:[bt(Ye,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,bgcolor:f.calendar.bg,borderBottom:`1px solid ${f.calendar.borderColor}`,flexShrink:0},children:[bt(Ye,{sx:{display:"flex",alignItems:"center",gap:.25},children:[ye(Bs,{size:"small","aria-label":"\uC774\uC804 \uC8FC",onClick:()=>k(ga(g,-7)),children:ye(ag,{sx:{fontSize:20,color:f.colors.textSecondary}})}),ye(rg,{size:"small",color:"inherit",onClick:()=>k(xa(new Date)),sx:{minWidth:0,px:1,mx:1,fontSize:13,fontWeight:f.mode==="dark"?400:500,color:f.mode==="dark"?f.colors.textStrong:f.colors.textPrimary},children:"\uC624\uB298"}),ye(Bs,{size:"small","aria-label":"\uB2E4\uC74C \uC8FC",onClick:()=>k(ga(g,7)),children:ye(lg,{sx:{fontSize:20,color:f.colors.textSecondary}})})]}),bt(Cs,{onClick:E=>h(E.currentTarget),sx:{display:"inline-flex",alignItems:"center",gap:.25,px:.75,py:.25,borderRadius:1,fontSize:15,fontWeight:f.mode==="dark"?400:700,color:f.mode==="dark"?f.colors.textStrong:f.colors.textPrimary,"&:hover":{bgcolor:f.colors.surfaceHover}},children:[vg(C),ye(sg,{sx:{fontSize:18,color:f.colors.textMuted}})]})]}),ye(Ye,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",bgcolor:f.calendar.headerBg,borderBottom:`1px solid ${f.calendar.borderColor}`,flexShrink:0,"& > *":{borderRight:`1px solid ${f.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:C.map(E=>{let H=E.getDay(),_=$.has(qe(E));return ye(Ye,{sx:{height:vs,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12.5,color:H===0||_?f.colors.danger:H===6?f.colors.accentOnSurface:f.colors.textSecondary},children:Cg[H]},qe(E))})}),ye(Ye,{sx:{flex:1,minHeight:0},children:bt(mg,{sensors:Q,collisionDetection:R,onDragStart:Ne,onDragOver:le,onDragEnd:ge,onDragCancel:q,children:[ye(Ye,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",height:"100%",minHeight:0,"& > *":{borderRight:`1px solid ${f.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:C.map(E=>{let H=qe(E);return ye(wg,{dayKey:H,isToday:H===a,dayLabel:Ig(E),holidayName:$.get(H)??"",summary:B?.(H,Ce(H)),tasks:xe(H),googleEvents:ie.get(H)??[],statusOptions:t,onRequestArchiveToggle:b,onRequestReply:l,onAddSchedule:u,canAdd:p,onCardClick:K,onCardContextMenu:c,myAccountSeq:r,avatarSrcByName:i},H)})}),ye(ug,{children:Y?ye(Ye,{sx:{boxShadow:"0 8px 20px rgba(0,0,0,0.18)",borderRadius:.75,cursor:"grabbing"},children:ye(At,{task:Y,statusOptions:t,onOpenDetail:()=>{},isMine:r>0&&Number(Y.manager_account_seq??0)===r})}):null})]})}),ye(cg,{anchorEl:S,open:!!S,onClose:()=>h(null),selectedDate:g,onDateChange:E=>{k(xa(E)),h(null)}}),ye(Ge,{open:!!w,anchorEl:w?.anchorEl??null,title:w?.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:w?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>b(null),onConfirm:()=>{w&&s(w.taskSeq,w.nextCompleted),b(null)}})]})}import{useCallback as tr,useMemo as nn,useState as nr}from"react";import{Box as mo,Button as Dg,ButtonBase as Ds,IconButton as _s,Tooltip as Mg}from"@mui/material";import Og from"@mui/icons-material/Add";import Eg from"@mui/icons-material/ChevronLeft";import Pg from"@mui/icons-material/ChevronRight";import Rg from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as zg}from"@ehfuse/mui-datetime-picker";import{DndContext as qg,DragOverlay as Ag,PointerSensor as Lg,pointerWithin as Ng,rectIntersection as Fg,useDraggable as Hg,useDroppable as Ms,useSensor as Wg,useSensors as $g}from"@dnd-kit/core";import Kg from"@ehfuse/overlay-scrollbar";import{jsx as Pe,jsxs as kt}from"react/jsx-runtime";var Ug=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"],Vr="mday-",Gr="mchip-",Os=36;function Vg(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(o.getDate()-o.getDay()),o}function Yr(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(1),o}function Gg(e,o){let t=new Date(e);return t.setDate(t.getDate()+o),t}function ws(e,o){let t=Yr(e);return t.setMonth(t.getMonth()+o),t}function Yg({task:e,statusOptions:o,isPreview:t=!1,isMine:n=!1,avatarSrcByName:r,onOpenDetail:i,onContextMenu:a,onRequestToggleCompleted:s}){let{attributes:d,listeners:l,setNodeRef:u,isDragging:p}=Hg({id:String(e.seq),disabled:t}),{setNodeRef:m}=Ms({id:`${Gr}${e.seq}`,disabled:t});return Pe(Mg,{title:e.title,arrow:!0,enterDelay:400,children:Pe(At,{task:e,statusOptions:o,onOpenDetail:i,onContextMenu:a,showCheckbox:!!s,onRequestToggleCompleted:s,isPreview:t,isDragging:p,isMine:n,avatarSrcByName:r,showManagerAvatar:!0,setNodeRef:c=>{u(c),m(c)},dragProps:{...d,...l}})})}function jg({dayKey:e,dayNumber:o,isToday:t,isOtherMonth:n,weekday:r,holidayName:i,tasks:a,googleEvents:s,statusOptions:d,previewSeq:l,myAccountSeq:u,avatarSrcByName:p,onRequestToggleCompleted:m,onOpenDetail:c,onTaskContextMenu:T,onAddSchedule:B,canAdd:f}){let g=ne(),k=g.mode==="dark",{setNodeRef:w,isOver:b}=Ms({id:`${Vr}${e}`}),S=a,h=!!i||r===0;return kt(mo,{ref:w,sx:{minWidth:0,minHeight:0,display:"flex",flexDirection:"column",gap:.5,p:.5,bgcolor:b?g.colors.accentSoft:t?g.calendar.todayBg:n?g.calendar.otherMonthBg:g.calendar.cellBg,transition:"background-color 0.15s",overflow:"hidden",...f?{"&:hover .taskbox-month-add":{opacity:1,pointerEvents:"auto"}}:{}},children:[kt(mo,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.5,height:Os,flexShrink:0,mx:-.5,mt:-.5,px:1,bgcolor:t?g.calendar.todayBg:g.calendar.dateBandBg,borderBottom:`1px solid ${g.calendar.borderColor}`},children:[i?Pe(mo,{component:"span",sx:{mr:.25,minWidth:0,fontSize:11,fontWeight:600,color:g.colors.danger,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i}):null,t?Pe(mo,{component:"span",sx:{px:.5,borderRadius:.5,fontSize:10.5,fontWeight:600,bgcolor:g.colors.danger,color:g.calendar.cellBg,lineHeight:1.6},children:"\uC624\uB298"}):null,Pe(mo,{component:"span",sx:{fontSize:13.5,fontWeight:t?700:400,color:n?g.colors.textMuted:h?g.colors.danger:r===6?g.colors.accentOnSurface:k?g.colors.textStrong:g.colors.textPrimary,flexShrink:0},children:o})]}),s.map(x=>Pe(_n,{event:x,small:!0},x.uid)),S.map(x=>Pe(Yg,{task:x,statusOptions:d,isPreview:x.seq===l,isMine:u>0&&Number(x.manager_account_seq??0)===u,avatarSrcByName:p,onRequestToggleCompleted:m,onOpenDetail:c,onContextMenu:T},x.seq)),Pe(mo,{sx:{flexGrow:1,minHeight:0,display:"flex",alignItems:"flex-start"},children:kt(Ds,{className:"taskbox-month-add",onClick:()=>B(e),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,px:1.25,py:.75,borderBottom:`1px dashed ${g.calendar.borderColor}`,bgcolor:g.calendar.cellBg,color:g.colors.accentOnSurface,fontSize:13,fontWeight:500,opacity:0,pointerEvents:"none",transition:"opacity 0.15s","&:hover":{bgcolor:g.calendar.hoverBg}},children:[Pe(Og,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})})]})}function Es({tasks:e,googleEvents:o=[],statusOptions:t,fallbackToStartDate:n=!1,myAccountSeq:r=0,avatarSrcByName:i,onToggleCompleted:a,todayStr:s,onMoveTask:d,onAddSchedule:l,canAdd:u=!0,onOpenDetail:p,onTaskContextMenu:m}){let c=ne(),T=c.mode==="dark",[B,f]=nr(()=>Yr(new Date)),[g,k]=nr(null),[w,b]=nr(null),[S,h]=nr(null),[x,I]=nr(null),W=nn(()=>{let q=Vg(B);return Array.from({length:42},(K,Y)=>Gg(q,Y))},[B]),D=nn(()=>new Map(e.map(q=>[q.seq,q])),[e]),J=nn(()=>In(o),[o]),C=nn(()=>[...new Set(W.map(q=>q.getFullYear()))],[W]),y=qt(C),L=nn(()=>{let q=new Map;for(let K of e){let Y=K.due_date.slice(0,10)||(n?K.start_date.slice(0,10):"");if(!Y)continue;let E=q.get(Y);E?E.push(K):q.set(Y,[K])}for(let K of q.values())K.sort((Y,E)=>{let H=Y.sort_no>0,_=E.sort_no>0;return H&&_?Y.sort_no-E.sort_no:H!==_?H?-1:1:Y.completed!==E.completed?Y.completed?1:-1:Y.seq-E.seq});return q},[e,n]),$=$g(Wg(Lg,{activationConstraint:{distance:5}})),Q=tr(q=>{let K=Ng(q),Y=K.length>0?K:Fg(q),E=Y.filter(H=>String(H.id).startsWith(Gr));return E.length>0?E:Y.filter(H=>String(H.id).startsWith(Vr))},[]),R=tr(q=>{h(Number(q.active.id))},[]),ie=tr(q=>{I(q.over?String(q.over.id):null)},[]),re=nn(()=>{let q=new Map;for(let[K,Y]of L)for(let E of Y)q.set(E.seq,K);return q},[L]),Ce=S!==null?D.get(S)?.due_date.slice(0,10)??"":"",xe=nn(()=>{if(S===null||!x)return null;if(x.startsWith(Gr)){let q=Number(x.slice(Gr.length)),K=re.get(q);if(!K)return null;let Y=(L.get(K)??[]).filter(H=>H.seq!==S),E=Y.findIndex(H=>H.seq===q);return{day:K,index:E===-1?Y.length:E}}if(x.startsWith(Vr)){let q=x.slice(Vr.length),K=(L.get(q)??[]).filter(Y=>Y.seq!==S);return{day:q,index:K.length}}return null},[S,re,x,L]),Ne=tr(q=>{let K=L.get(q)??[];if(S===null||!xe)return K;let Y=D.get(S);if(!Y)return K;let E=K.filter(H=>H.seq!==S);return q===xe.day?[...E.slice(0,xe.index),Y,...E.slice(xe.index)]:q===Ce?E:K},[S,Ce,xe,D,L]),oe=tr(q=>{let K=S,Y=xe;if(h(null),I(null),K===null||!Y)return;let E=(L.get(Y.day)??[]).filter(_=>_.seq!==K),H=[...E.slice(0,Y.index).map(_=>_.seq),K,...E.slice(Y.index).map(_=>_.seq)];d(K,Y.day,H)},[S,xe,d,L]),le=S!==null?D.get(S)??null:null,ge=`${B.getFullYear()}\uB144 ${B.getMonth()+1}\uC6D4`;return kt(mo,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${c.calendar.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden"},children:[kt(mo,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,bgcolor:c.calendar.bg,borderBottom:`1px solid ${c.calendar.borderColor}`,flexShrink:0},children:[kt(mo,{sx:{display:"flex",alignItems:"center",gap:.25},children:[Pe(_s,{size:"small","aria-label":"\uC774\uC804 \uB2EC",onClick:()=>f(ws(B,-1)),children:Pe(Eg,{sx:{fontSize:20,color:c.colors.textSecondary}})}),Pe(Dg,{size:"small",color:"inherit",onClick:()=>f(Yr(new Date)),sx:{minWidth:0,px:1,mx:1,fontSize:13,fontWeight:c.mode==="dark"?400:500,color:c.mode==="dark"?c.colors.textStrong:c.colors.textPrimary},children:"\uC624\uB298"}),Pe(_s,{size:"small","aria-label":"\uB2E4\uC74C \uB2EC",onClick:()=>f(ws(B,1)),children:Pe(Pg,{sx:{fontSize:20,color:c.colors.textSecondary}})})]}),kt(Ds,{onClick:q=>k(q.currentTarget),sx:{display:"inline-flex",alignItems:"center",gap:.25,ml:{xs:"auto",lg:0},px:.75,py:.25,borderRadius:1,fontSize:15,fontWeight:c.mode==="dark"?400:700,color:c.mode==="dark"?c.colors.textStrong:c.colors.textPrimary,"&:hover":{bgcolor:c.colors.surfaceHover}},children:[ge,Pe(Rg,{sx:{fontSize:18,color:c.colors.textMuted}})]})]}),Pe(mo,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",bgcolor:c.calendar.headerBg,borderBottom:`1px solid ${c.calendar.borderColor}`,flexShrink:0,"& > *":{borderRight:`1px solid ${c.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:Ug.map((q,K)=>Pe(mo,{sx:{height:Os,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12.5,color:K===0?c.colors.danger:K===6?c.colors.accentOnSurface:c.colors.textSecondary},children:q},q))}),Pe(mo,{sx:{flex:1,minHeight:0},children:kt(qg,{sensors:$,collisionDetection:Q,onDragStart:R,onDragOver:ie,onDragEnd:oe,onDragCancel:()=>{h(null),I(null)},children:[Pe(Kg,{style:{height:"100%"},thumb:{width:8},children:Pe(mo,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",gridTemplateRows:"repeat(6, minmax(112px, auto))",minHeight:"100%",flexShrink:0,"& > *":{borderRight:`1px solid ${c.calendar.borderColor}`,borderBottom:`1px solid ${c.calendar.borderColor}`},"& > *:nth-of-type(7n)":{borderRight:"none"},"& > *:nth-last-of-type(-n+7)":{borderBottom:"none"}},children:W.map(q=>{let K=qe(q);return Pe(jg,{dayKey:K,dayNumber:q.getDate(),isToday:K===s,isOtherMonth:q.getMonth()!==B.getMonth(),weekday:q.getDay(),holidayName:y.get(K)??"",tasks:Ne(K),googleEvents:J.get(K)??[],statusOptions:t,previewSeq:xe?.day===K?S:null,myAccountSeq:r,avatarSrcByName:i,onRequestToggleCompleted:a?b:void 0,onOpenDetail:p,onTaskContextMenu:m,onAddSchedule:l,canAdd:u},K)})})}),Pe(Ag,{children:le?kt(mo,{sx:{display:"flex",alignItems:"center",gap:.5,py:.6,px:.75,borderRadius:.75,bgcolor:c.calendar.cellBg,border:`1px solid ${c.calendar.borderColor}`,boxShadow:"0 6px 16px rgba(0,0,0,0.18)",fontSize:fa,fontWeight:500,color:c.colors.textPrimary,cursor:"grabbing",whiteSpace:"nowrap"},children:[Pe(mo,{component:"span",sx:{width:6,height:6,borderRadius:"50%",bgcolor:pa[le.priority]}}),le.title]}):null})]})}),Pe(Ge,{open:!!w,anchorEl:w?.anchorEl??null,title:w?.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:w?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>b(null),onConfirm:()=>{w&&a?.(w.taskSeq,w.nextCompleted),b(null)}}),Pe(zg,{anchorEl:g,open:!!g,onClose:()=>k(null),selectedDate:B,onDateChange:q=>{f(Yr(q)),k(null)}})]})}import{useEffect as Jg,useMemo as rr,useRef as Zg,useState as ba}from"react";import{Box as Io,Button as eh,IconButton as Rs}from"@mui/material";import oh from"@mui/icons-material/ChevronLeft";import th from"@mui/icons-material/ChevronRight";import nh from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as rh}from"@ehfuse/mui-datetime-picker";import{Box as Tt,Button as Xg,Dialog as Qg}from"@mui/material";import{jsx as yt,jsxs as ha}from"react/jsx-runtime";function Ps({task:e,avatarSrcByName:o,onClose:t}){let n=ne(),r=e?[{label:"\uCC45\uC784\uC790",names:[String(e.manager_name??"").trim()]},{label:"\uCC38\uC870\uC790",names:e.receiver_names??[]},{label:"\uC791\uC131\uC790",names:[String(e.created_by??"").trim()]}]:[];return yt(Qg,{open:!!e,onClose:t,maxWidth:"xs",fullWidth:!0,slotProps:{paper:{sx:{borderRadius:2,m:2}}},children:e?ha(Tt,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5,bgcolor:n.colors.surface},children:[yt(Tt,{sx:{fontSize:15.5,fontWeight:600,color:n.colors.textStrong,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title}),r.map(i=>{let a=i.names.filter(s=>!!s);return ha(Tt,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[yt(Tt,{sx:{width:56,flexShrink:0,fontSize:13.5,color:n.colors.textSecondary,pt:.5},children:i.label}),yt(Tt,{sx:{display:"flex",flexWrap:"wrap",gap:1,minWidth:0},children:a.length===0?yt(Tt,{sx:{fontSize:14,color:n.colors.textMuted,pt:.5},children:"\uBE44\uC5B4 \uC788\uC74C"}):a.map(s=>ha(Tt,{sx:{display:"flex",alignItems:"center",gap:.75},children:[yt(Jo,{src:o?.get(s)??"",avatarSx:{width:26,height:26,fontSize:12},iconFontSize:16}),yt(Tt,{sx:{fontSize:14.5,color:n.colors.textPrimary},children:s})]},`${i.label}-${s}`))})]},i.label)}),yt(Tt,{sx:{display:"flex",justifyContent:"flex-end",pt:.5},children:yt(Xg,{size:"small",color:"inherit",onClick:t,children:"\uB2EB\uAE30"})})]}):null})}import{jsx as ro,jsxs as St}from"react/jsx-runtime";var ih=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"];function ka(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(1),o}function zs(e){let o=t=>String(t).padStart(2,"0");return`${e.getFullYear()}-${o(e.getMonth()+1)}-${o(e.getDate())}`}function qs({tasks:e,googleEvents:o=[],statusOptions:t,todayStr:n,onOpenDetail:r,onAddSchedule:i,myAccountSeq:a=0,avatarSrcByName:s,fallbackToStartDate:d=!1}){let l=ne(),[u,p]=ba(()=>ka(new Date)),[m,c]=ba(!1),T=rr(()=>{let I=new Date(u.getFullYear(),u.getMonth()+1,0).getDate();return Array.from({length:I},(W,D)=>{let J=new Date(u.getFullYear(),u.getMonth(),D+1);return{ymd:zs(J),dayNumber:D+1,weekday:J.getDay()}})},[u]),B=rr(()=>{let I=new Map;for(let W of e){let D=W.due_date.slice(0,10)||(d?W.start_date.slice(0,10):"");if(!D)continue;let J=I.get(D);J?J.push(W):I.set(D,[W])}for(let W of I.values())W.sort((D,J)=>D.completed!==J.completed?D.completed?1:-1:D.seq-J.seq);return I},[e,d]),f=rr(()=>d?e.filter(I=>!I.due_date.slice(0,10)&&!I.start_date.slice(0,10)).sort((I,W)=>I.completed!==W.completed?I.completed?1:-1:I.seq-W.seq):[],[e,d]),[g,k]=ba(null),w=rr(()=>In(o),[o]),b=rr(()=>[u.getFullYear()],[u]),S=qt(b),h=Zg(null),x=n.slice(0,7)===zs(u).slice(0,7);return Jg(()=>{if(!x)return;let I=C=>{let y=C?.parentElement??null;for(;y;){let L=window.getComputedStyle(y);if(/(auto|scroll)/.test(L.overflowY)&&y.scrollHeight>y.clientHeight)return y;y=y.parentElement}return null},W=()=>{let C=h.current,y=I(C);if(!y||!C)return;let L=C.getBoundingClientRect().top-y.getBoundingClientRect().top+y.scrollTop;y.scrollTop=Math.max(0,L-y.clientHeight/2+C.clientHeight/2)},D=setTimeout(W,100),J=setTimeout(W,400);return()=>{clearTimeout(D),clearTimeout(J)}},[x,u]),St(Io,{sx:{minWidth:0,maxWidth:"100%",overflow:"hidden",bgcolor:l.colors.surface},children:[St(Io,{sx:{display:"flex",alignItems:"center",gap:.5,px:1.5,py:1,flexShrink:0},children:[ro(Rs,{size:"small","aria-label":"\uC774\uC804 \uB2EC",onClick:()=>p(I=>new Date(I.getFullYear(),I.getMonth()-1,1)),children:ro(oh,{sx:{fontSize:20,color:l.colors.textSecondary}})}),ro(eh,{size:"small",color:"inherit",onClick:()=>p(ka(new Date)),sx:{minWidth:0,px:1,fontSize:13.5,color:l.mode==="dark"?l.colors.textStrong:l.colors.textPrimary},children:"\uC624\uB298"}),ro(Rs,{size:"small","aria-label":"\uB2E4\uC74C \uB2EC",onClick:()=>p(I=>new Date(I.getFullYear(),I.getMonth()+1,1)),children:ro(th,{sx:{fontSize:20,color:l.colors.textSecondary}})}),St(Io,{onClick:()=>c(!0),sx:{ml:"auto",pr:.5,display:"flex",alignItems:"center",gap:.25,fontSize:16.5,fontWeight:l.mode==="dark"?400:700,color:l.mode==="dark"?l.colors.textStrong:l.colors.textPrimary,cursor:"pointer"},children:[u.getFullYear(),"\uB144 ",u.getMonth()+1,"\uC6D4",ro(nh,{sx:{fontSize:20,color:l.colors.textMuted}})]})]}),St(Io,{sx:{minWidth:0,overflowX:"hidden",borderTop:`1px solid ${l.calendar.borderColor}`},children:[f.length>0?St(Io,{sx:{display:"flex",alignItems:"center",gap:1,px:1,py:.75,minWidth:0,maxWidth:"100%",flexShrink:0,borderBottom:`1px solid ${l.calendar.borderColor}`},children:[St(Io,{sx:{width:52,flexShrink:0,fontSize:12.5,lineHeight:1.3,color:l.colors.textSecondary,textAlign:"center"},children:["\uB0A0\uC9DC",ro("br",{}),"\uC5C6\uC74C"]}),ro(Io,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:.5},children:f.map(I=>ro(At,{task:I,statusOptions:t,onOpenDetail:r,isMine:a>0&&Number(I.manager_account_seq??0)===a,avatarSrcByName:s,showManagerAvatar:!0,onOpenMembers:k},I.seq))})]}):null,T.map(({ymd:I,dayNumber:W,weekday:D})=>{let J=S.get(I)??"",C=I===n,y=!!J||D===0,L=B.get(I)??[],$=w.get(I)??[],Q=L.length>0||$.length>0;return St(Io,{ref:C?h:void 0,onClick:i?()=>i(I):void 0,sx:{display:"flex",alignItems:"center",gap:1,px:1,minWidth:0,maxWidth:"100%",py:Q?.75:.5,minHeight:44,flexShrink:0,borderBottom:`1px solid ${l.calendar.borderColor}`,...i?{cursor:"pointer"}:{}},children:[ro(Io,{sx:{width:52,flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",gap:.25},children:St(Io,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:.25,"@media (min-width:600px)":{flexDirection:"row",gap:.75}},children:[ro(Io,{component:"span",sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:28,height:28,borderRadius:"50%",fontSize:17,fontWeight:C?700:500,color:C?l.colors.surface:y?l.colors.danger:D===6?l.colors.accentOnSurface:l.colors.textPrimary,bgcolor:C?l.colors.accentOnSurface:"transparent"},children:W}),ro(Io,{component:"span",sx:{fontSize:13,color:y?l.colors.danger:D===6?l.colors.accentOnSurface:l.colors.textSecondary},children:ih[D]})]})}),St(Io,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:.5},children:[$.map(R=>ro(_n,{event:R},R.uid)),L.map(R=>ro(At,{task:R,statusOptions:t,onOpenDetail:r,isMine:a>0&&Number(R.manager_account_seq??0)===a,avatarSrcByName:s,showManagerAvatar:!0,onOpenMembers:k},R.seq))]})]},I)})]}),ro(Ps,{task:g,avatarSrcByName:s,onClose:()=>k(null)}),ro(rh,{open:m,centered:!0,monthOnly:!0,onClose:()=>c(!1),selectedDate:u,onDateChange:I=>{p(ka(I)),c(!1)}})]})}import{useCallback as As,useEffect as Ls,useMemo as Ta,useRef as Xr,useState as Qr}from"react";import{Box as He,Tooltip as Hs}from"@mui/material";import ah from"@ehfuse/overlay-scrollbar";import lh from"@mui/icons-material/CheckCircle";import sh from"@mui/icons-material/RadioButtonUnchecked";import{DndContext as ch,PointerSensor as mh,closestCenter as uh,useSensor as dh,useSensors as ph}from"@dnd-kit/core";import{SortableContext as fh,arrayMove as xh,useSortable as gh,verticalListSortingStrategy as hh}from"@dnd-kit/sortable";import bh from"@mui/icons-material/DragIndicator";import{jsx as Ae,jsxs as Lt}from"react/jsx-runtime";var ya=36,kh=48,Ns=40,Th=24,yh=4,Sh=14,Fs=36,Bh=12.5,Dn=220,Ch={high:{bg:"#f6c6c9",border:"#e5484d"},medium:{bg:"#c5d8f6",border:"#2f80ed"},low:{bg:"#f3e3b6",border:"#d9a514"}};function rn(e){let o=String(e??"").trim();if(!o)return null;let t=new Date(`${o}T00:00:00`);return Number.isNaN(t.getTime())?null:t}function jr(e,o){let t=new Date(e);return t.setDate(t.getDate()+o),t}function Sa(e,o){return Math.round((o.getTime()-e.getTime())/864e5)}function vh({task:e,dragHandle:o,onPointerDown:t,onClick:n}){let r=ne(),i=Xr(null),[a,s]=Qr("");return Ae(Hs,{title:a,arrow:!0,enterDelay:300,children:Lt(He,{onPointerDown:t,onClick:d=>n(e,d),onMouseEnter:()=>{let d=i.current;s(d&&d.scrollWidth>d.clientWidth?e.title:"")},sx:{width:Dn,flexShrink:0,position:"sticky",left:0,zIndex:2,bgcolor:r.timeline.bg,borderRight:`1px solid ${r.timeline.gridColor}`,display:"flex",alignItems:"center",gap:.5,pl:.5,pr:1.5,fontSize:15,fontWeight:r.mode==="dark"||e.completed?400:500,color:e.completed?r.colors.textMuted:r.mode==="dark"?r.colors.textStrong:r.colors.textPrimary,overflow:"hidden",whiteSpace:"nowrap",cursor:"pointer",textDecoration:e.completed?"line-through":"none","&:hover":{bgcolor:r.colors.surfaceHover}},children:[o,Ae(He,{ref:i,component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title})]})})}function Ih({id:e,showIndicator:o,children:t}){let n=ne(),{attributes:r,listeners:i,setNodeRef:a}=gh({id:e});return Lt(He,{ref:a,sx:{position:"relative"},children:[o?Ae(He,{sx:{position:"absolute",top:-1,left:0,right:0,height:2,bgcolor:n.colors.accentOnSurface,zIndex:5}}):null,t({...r,...i})]})}function Ws({tasks:e,todayStr:o,onOpenDetail:t,onToggleChecklist:n,onReorderTasks:r,onTaskContextMenu:i}){let a=ne(),s=Ta(()=>[...e].sort((y,L)=>{let $=(y.timeline_sort_no??0)>0,Q=(L.timeline_sort_no??0)>0;if($&&Q)return(y.timeline_sort_no??0)-(L.timeline_sort_no??0);if($!==Q)return $?-1:1;let R=y.due_date||y.start_date,ie=L.due_date||L.start_date;return R!==ie?R<ie?-1:1:y.seq-L.seq}),[e]),[d,l]=Qr(null),[u,p]=Qr(null),m=ph(dh(mh,{activationConstraint:{distance:4}})),c=As(y=>{l(y.over?Number(y.over.id):null)},[]),T=As(y=>{l(null),p(null);let{active:L,over:$}=y;if(!$||L.id===$.id)return;let Q=s.map(re=>re.seq),R=Q.indexOf(Number(L.id)),ie=Q.indexOf(Number($.id));R===-1||ie===-1||r(xh(Q,R,ie))},[s,r]),B=Ta(()=>{let y=rn(o)??new Date,L=y,$=jr(y,21);for(let ie of s){let re=rn(ie.start_date)??rn(ie.due_date),Ce=rn(ie.due_date)??re;re&&re<L&&(L=re),Ce&&Ce>$&&($=Ce)}let Q=jr(L,-3),R=Sa(Q,jr($,3))+1;return Array.from({length:R},(ie,re)=>jr(Q,re))},[s,o]),f=B[0],g=B.findIndex(y=>qe(y)===o),{dayWidths:k,dayOffsets:w,gridWidth:b}=Ta(()=>{let y=B.map((Q,R)=>Q.getDate()===1||R===0?kh:ya),L=[],$=0;for(let Q of y)L.push($),$+=Q;return{dayWidths:y,dayOffsets:L,gridWidth:$}},[B]),S=Dn+b,h=Xr(null),x=y=>{h.current={x:y.clientX,y:y.clientY}},I=(y,L)=>{let $=h.current;h.current=null,!($&&(Math.abs(L.clientX-$.x)>5||Math.abs(L.clientY-$.y)>5))&&t(y)},W=Xr(null),[D,J]=Qr(!1);Ls(()=>{let y=W.current?.getScrollContainer();if(!y)return;let L=()=>J(y.scrollHeight>y.clientHeight);L();let $=new ResizeObserver(L);return $.observe(y),()=>$.disconnect()},[s.length]);let C=Xr(!1);return Ls(()=>{if(s.length===0||C.current)return;C.current=!0;let y=window.requestAnimationFrame(()=>{let L=W.current?.getScrollContainer();!L||g<0||(L.scrollLeft=Math.max(0,w[g]-ya*3))});return()=>window.cancelAnimationFrame(y)},[s.length]),Ae(He,{sx:{flex:1,minHeight:0,minWidth:0,maxWidth:"100%",display:"flex",flexDirection:"column",border:`1px solid ${a.timeline.gridColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden",bgcolor:a.timeline.headerBg},children:Ae(He,{sx:{flex:1,minHeight:0,minWidth:0,contain:"inline-size"},children:Ae(ah,{ref:W,style:{height:"100%"},contentStyle:{width:"max-content",minWidth:"100%"},thumb:{width:8},showHorizontalScrollbar:!0,dragScroll:{excludeClasses:["taskbox-timeline-handle"]},children:Lt(He,{sx:{width:S,position:"relative",bgcolor:a.timeline.bg},children:[Lt(He,{sx:{display:"flex",position:"sticky",top:0,zIndex:3,bgcolor:a.timeline.headerBg,borderBottom:`1px solid ${a.timeline.gridColor}`},children:[Ae(He,{sx:{width:Dn,height:Fs,flexShrink:0,position:"sticky",left:0,zIndex:4,bgcolor:a.timeline.headerBg,borderRight:`1px solid ${a.timeline.gridColor}`,display:"flex",alignItems:"center",px:1.5,fontSize:13,color:a.colors.textSecondary},children:"\uC81C\uBAA9"}),B.map((y,L)=>{let $=y.getDay(),Q=L===g,R=y.getDate()===1||L===0;return Ae(He,{sx:{width:k[L],height:Fs,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",fontSize:Bh,fontWeight:Q&&a.mode!=="dark"?700:400,color:Q?a.timeline.bg:$===0?a.colors.danger:$===6?a.colors.accentOnSurface:a.colors.textSecondary,bgcolor:Q?a.colors.danger:"transparent",borderRight:`1px solid ${a.timeline.gridColor}`,whiteSpace:"nowrap"},children:R?`${y.getMonth()+1}/${y.getDate()}`:y.getDate()},qe(y))})]}),Ae(ch,{sensors:m,collisionDetection:uh,onDragStart:y=>p(Number(y.active.id)),onDragOver:c,onDragEnd:T,onDragCancel:()=>{l(null),p(null)},children:Ae(fh,{items:s.map(y=>String(y.seq)),strategy:hh,children:Lt(He,{sx:{position:"relative"},children:[B.map((y,L)=>{let $=y.getDay(),Q=L===g;return!Q&&$!==0&&$!==6?null:Ae(He,{sx:{position:"absolute",top:0,bottom:0,left:Dn+w[L],width:k[L],bgcolor:Q?"rgba(229,72,77,0.07)":a.colors.surfaceSubtle,zIndex:0}},`stripe-${qe(y)}`)}),s.map((y,L)=>{let $=rn(y.start_date)??rn(y.due_date),Q=rn(y.due_date)??$,R=$?Math.min(B.length-1,Math.max(0,Sa(f,$))):0,ie=Q?Math.min(B.length-1,Math.max(R,Sa(f,Q))):R,re=Ch[y.priority],Ce=Dn+w[R]+2,xe=w[ie]+k[ie]-w[R]-4,Ne=y.checklist??[];return Ae(Ih,{id:String(y.seq),showIndicator:d===y.seq&&u!==y.seq,children:oe=>Lt(He,{sx:{borderBottom:L===s.length-1&&D?"none":`1px solid ${a.timeline.gridColor}`,position:"relative",zIndex:1,opacity:u===y.seq?.45:1},children:[Lt(He,{onContextMenu:le=>i(y,le),sx:{display:"flex",height:Ns,position:"relative","&:hover":{bgcolor:"rgba(47,128,237,0.04)"}},children:[Ae(vh,{task:y,dragHandle:Ae(He,{component:"span",className:"taskbox-timeline-handle",...oe,onClick:le=>le.stopPropagation(),sx:{display:"inline-flex",alignItems:"center",flexShrink:0,color:a.colors.accentOnSurface,cursor:"grab",touchAction:"none","&:hover":{color:a.colors.accentOnSurface}},children:(()=>{let le=Fe(y.icon||Me)??bh;return Ae(le,{sx:{fontSize:17}})})()}),onPointerDown:x,onClick:I}),Ae(Hs,{title:`${y.title} (${y.start_date||"?"} ~ ${y.due_date||"?"})`,arrow:!0,enterDelay:300,children:Ae(He,{onPointerDown:x,onClick:le=>I(y,le),sx:{position:"absolute",top:(Ns-20)/2,left:Ce,width:Math.max(ya-4,xe),height:20,borderRadius:1,bgcolor:re.bg,border:`1px solid ${re.border}`,opacity:y.completed?.45:1,cursor:"pointer","&:hover":{filter:"brightness(0.95)"}}})})]}),Ne.map((le,ge)=>Ae(He,{sx:{display:"flex",height:Th,position:"relative",mt:ge===0?`${yh}px`:0,mb:ge===Ne.length-1?`${Sh}px`:0},children:Ae(He,{sx:{width:Dn,flexShrink:0,position:"sticky",left:0,zIndex:2,bgcolor:a.timeline.bg,borderRight:`1px solid ${a.timeline.gridColor}`,display:"flex",alignItems:"center",pl:4.25,pr:1.5,fontSize:13,color:le.checked?a.colors.textMuted:a.colors.textPrimary},children:Lt(He,{onClick:()=>n(y.seq,ge,!le.checked),sx:{display:"inline-flex",alignItems:"center",gap:.75,minWidth:0,cursor:"pointer"},children:[le.checked?Ae(lh,{sx:{fontSize:17,color:a.colors.accentOnSurface,flexShrink:0}}):Ae(sh,{sx:{fontSize:17,color:a.colors.textMuted,flexShrink:0}}),Ae(He,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textDecoration:le.checked?"line-through":"none"},children:le.label})]})})},`${y.seq}-check-${ge}`))]})},y.seq)}),s.length===0?Ae(He,{sx:{py:8,textAlign:"center",color:a.colors.textMuted,fontSize:14},children:"\uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]})})})]})})})})}import{jsx as an}from"react/jsx-runtime";function MD(e){switch(e.view){case"card":case"kanban":{let{view:o,...t}=e;return an(ma,{...t,columnAxis:o==="kanban"?"status":"project"})}case"sprint":{let{view:o,...t}=e;return an(ma,{...t,columnAxis:"sprint"})}case"calendar":{let{view:o,...t}=e;return an(Is,{...t})}case"month":{let{view:o,...t}=e;return an(Es,{...t})}case"agenda":{let{view:o,...t}=e;return an(qs,{...t})}case"timeline":{let{view:o,...t}=e;return an(Ws,{...t})}default:{let{view:o,...t}=e;return an(rs,{...t})}}}var OD=["list","card","kanban","calendar","month","timeline"];import{Box as ko}from"@mui/material";function _h(e){let o=String(e??"").trim();if(!o)return 0;let t=0,n=!1;for(let r of o.matchAll(/(\d+(?:\.\d+)?)\s*(h|시간|m|분|d|일)/gi)){let i=parseFloat(r[1]),a=r[2].toLowerCase();n=!0,a==="m"||a==="\uBD84"?t+=i/60:a==="d"||a==="\uC77C"?t+=i*8:t+=i}if(!n){let r=parseFloat(o);Number.isFinite(r)&&(t+=r)}return t}function $s(e){let o=Math.round(e*10)/10;return`${o%1===0?o.toFixed(0):o.toFixed(1)}\uC2DC\uAC04`}function Ks(e,o,t){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||!/^\d{4}-\d{2}-\d{2}$/.test(o))return 0;let n=new Date(`${e}T00:00:00`),r=new Date(`${o}T00:00:00`);if(r<n||r.getTime()-n.getTime()>3660*864e5)return 0;let i=0;for(let a=new Date(n);a<=r;a.setDate(a.getDate()+1)){let s=a.getDay();if(s===0||s===6)continue;let d=`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}-${String(a.getDate()).padStart(2,"0")}`;t.has(d)||(i+=1)}return i}function Us(e){return e.reduce((o,t)=>t.completed?o:o+_h(t.estimated_time),0)}import{Fragment as wh,jsx as Nt,jsxs as Fo}from"react/jsx-runtime";function Vs(e,o){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||!/^\d{4}-\d{2}-\d{2}$/.test(o))return null;let t=new Date(`${e}T00:00:00`),n=new Date(`${o}T00:00:00`);return Math.round((t.getTime()-n.getTime())/864e5)}function Gs({tasks:e,todayStr:o,showProgress:t=!0,dday:n=null,workdaysLeft:r=null,showPoints:i=!0,showHours:a=!0,showOverdue:s=!0,showInfo:d=!0,inline:l=!1}){let u=ne(),p=e.filter(I=>!I.archived),m=p.filter(I=>I.completed).length,c=p.length>0?Math.round(m/p.length*100):0,T=p.filter(I=>!I.completed&&!I.is_event&&!!I.due_date&&I.due_date.slice(0,10)<o).length,B=p.reduce((I,W)=>W.completed?I:I+(W.story_points??0),0),f=Us(p),g=t?Nt(ko,{sx:{flex:l?"0 0 110px":"1 1 auto",minWidth:0,height:u.summary.gaugeHeight,borderRadius:3,bgcolor:u.summary.gaugeTrackColor},children:Nt(ko,{sx:{height:"100%",borderRadius:3,width:`${c}%`,bgcolor:c>=100?u.summary.gaugeCompleteColor:u.summary.gaugeBarColor,transition:"width 0.2s"}})}):null,k=t?Fo(ko,{component:"span",sx:{flexShrink:0,fontSize:l?14:13,color:u.summary.textColor},children:[c,"%"]}):null,w={color:u.summary.numberColor,fontWeight:700,fontSize:l?15:14},b=p.length-m,S=Fo(wh,{children:[l?null:Fo("span",{children:["\uB0A8\uC740 ",Nt(ko,{component:"span",sx:w,children:b}),"\uAC74"]}),s&&T>0?Fo(ko,{component:"span",sx:{color:u.summary.overdueColor,fontWeight:600},children:["\uC9C0\uC5F0"," ",Nt(ko,{component:"span",sx:{fontWeight:700,fontSize:l?15:14},children:T}),"\uAC74"]}):null,i&&B>0?Fo("span",{children:[Nt(ko,{component:"span",sx:w,children:B}),"SP"]}):null,a&&f>0?Fo("span",{children:["\uC57D ",Nt(ko,{component:"span",sx:w,children:$s(f).replace("\uC2DC\uAC04","")}),"\uC2DC\uAC04"]}):null]}),h=typeof r=="number"&&Number.isFinite(r)?Fo("span",{children:["\uADFC\uBB34\uC77C ",Nt(ko,{component:"span",sx:w,children:r}),"\uC77C"]}):null,x=typeof n=="number"&&Number.isFinite(n)?Nt(ko,{component:"span",sx:{ml:l?0:"auto",flexShrink:0,px:.6,py:.1,borderRadius:.5,fontSize:12,fontWeight:600,bgcolor:u.summary.overdueColor,color:u.colors.textInverse,lineHeight:1.6},children:n===0?"D-day":n>0?`D-${n}`:`D+${-n}`}):null;return l?Fo(ko,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0,fontSize:14.5,color:u.summary.textColor,whiteSpace:"nowrap",...u.summary.sx},children:[d?S:null,d?h:null,d?x:null,g,k]}):Fo(ko,{sx:{display:"flex",flexDirection:"column",gap:.5},children:[t?Fo(ko,{sx:{display:"flex",alignItems:"center",gap:1},children:[g,k]}):null,Fo(ko,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,fontSize:13.5,color:u.summary.textColor},children:[S,h,x]})]})}import{useMemo as Dh}from"react";import{jsx as Mh}from"react/jsx-runtime";function KD({sprint:e,tasks:o,todayStr:t,...n}){let r=e.status==="closed"?null:Vs(e.end_date,t),i=r!==null&&r>=0,a=Dh(()=>{if(!i)return[];let l=Number(t.slice(0,4)),u=Number(e.end_date.slice(0,4))||l,p=[];for(let m=l;m<=Math.max(l,u);m+=1)p.push(m);return p},[i,t,e.end_date]),s=qt(a),d=i?Ks(t,e.end_date,new Set(s.keys())):null;return Mh(Gs,{tasks:o,todayStr:t,dday:r,workdaysLeft:d,...n})}import{useEffect as Fh,useRef as Hh,useState as Wh}from"react";import{Box as Ca}from"@mui/material";import{Children as Oh}from"react";import{Box as Ba,CircularProgress as Eh}from"@mui/material";import{jsx as Jr}from"react/jsx-runtime";var Ys={xs:2,md:3};function js(){return Jr(Ba,{sx:{position:"fixed",top:"calc(50% + 30px)",left:"50%",transform:"translate(-50%, -50%)",zIndex:1},children:Jr(Eh,{size:44,thickness:4,sx:{color:"#94a3b8"}})})}function Xs({children:e}){return Jr(Ba,{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:Ys,pb:Ys},children:Oh.map(e,o=>o==null||o===!1?null:Jr(Ba,{sx:{bgcolor:"background.paper",borderRadius:"12px",boxShadow:"0 1px 3px rgba(15,23,42,0.08)",minWidth:0},children:o}))})}import{Box as Ct,Button as qh,Checkbox as Ah,Typography as Ft}from"@mui/material";import Js from"@mui/icons-material/CheckCircle";import Lh from"@mui/icons-material/CheckCircleOutlineOutlined";import{Fragment as zh,jsx as Qs}from"react/jsx-runtime";var Ph="taskbox-search-highlight";function Rh(e,o){let t=o?.keyPrefix??"hl";return e.map((n,r)=>Qs("span",{className:n.highlight?o?.highlightClassName??Ph:o?.className,style:n.highlight?{fontWeight:700,color:"#2563eb"}:void 0,children:n.text},`${t}-${n.text}-${r}`))}function Zr({text:e,keyword:o,fallback:t="-",className:n,highlightClassName:r,keyPrefix:i}){let a=String(e??"").trim()||t,s=Er(a,o);return Qs(zh,{children:Rh(s,{className:n,highlightClassName:r,keyPrefix:i})})}import{jsx as fe,jsxs as Mn}from"react/jsx-runtime";var Nh={flexShrink:0,minWidth:64,textAlign:"center",px:.75,py:.35,borderRadius:.75,bgcolor:"#f1f5f9",color:"#64748b",fontSize:fo(12.5),fontWeight:500,lineHeight:1.4},Bt={fontSize:fo(14.5),color:"#374151",minWidth:0,lineHeight:1.45};function tt({label:e,children:o}){return Mn(Ct,{sx:{display:"flex",alignItems:"flex-start",gap:1,minWidth:0},children:[fe(Ct,{sx:Nh,children:e}),fe(Ct,{sx:{...Bt,flex:1,pt:.2},children:o})]})}function Zs({task:e,statusOptions:o,projectLabel:t,searchText:n,todayStr:r,onRequestToggleCompleted:i,onOpenDetail:a,onTaskContextMenu:s,targetSummary:d="",ackInfo:l,completeLocked:u=!1,unread:p=!1,noticeReadOnly:m=!1,onAckConfirm:c,onAckListClick:T,myManaged:B=!1}){let f=e.is_event?jn(e):go(e),g=Zo(e.start_date),k=Zo(e.due_date),w=!e.is_notice&&!e.completed&&!!e.due_date&&e.due_date<r,b=(e.receiver_names??[]).filter(Boolean);return Mn(Ct,{role:"button",tabIndex:0,onClick:()=>a(e),onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),a(e))},onContextMenu:S=>s(e,S),sx:{display:"flex",flexDirection:"column",gap:.75,minWidth:0,p:1.25,cursor:"pointer",position:"relative"},children:[B?fe(Ct,{sx:{position:"absolute",left:3,top:5,bottom:5,width:3,borderRadius:"999px",bgcolor:"#2f80ed"}}):null,Mn(Ct,{sx:{display:"flex",alignItems:"flex-start",gap:.75,minWidth:0,mb:1},children:[!m&&!u?fe(Ah,{checked:e.completed,icon:fe(Lh,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:fe(Js,{sx:{fontSize:22,color:"#2f80ed"}}),onClick:S=>S.stopPropagation(),onChange:(S,h)=>i({anchorEl:S.currentTarget,taskSeq:e.seq,nextCompleted:h}),sx:{p:0,mt:.1,flexShrink:0}}):null,(()=>{let S=Fe(e.icon||(e.is_notice?xo:Me));if(!S)return null;let h=e.icon_color||(e.is_notice?"#e5484d":"#1e3a8a");return fe(S,{sx:{fontSize:19,flexShrink:0,mt:"1px",color:h}})})(),fe(Ft,{sx:{fontSize:fo(16),fontWeight:600,lineHeight:1.35,minWidth:0,flex:1,color:e.completed?"#9a9a97":"#111827",textDecoration:e.completed?"line-through":"none"},children:fe(Zr,{text:e.title,keyword:n})}),p?fe(Ct,{component:"span",sx:{flexShrink:0,px:.55,fontSize:fo(10.5),fontWeight:700,lineHeight:1.6,color:"#fff",bgcolor:"#e5484d",borderRadius:"4px"},children:"N"}):null]}),Mn(Ct,{sx:{display:"flex",flexDirection:"column",gap:.6,minWidth:0},children:[fe(tt,{label:f?"\uC0C1\uD0DC":"\uC911\uC694\uB3C4",children:Mn(Ct,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5},children:[f?fe(Ee,{option:f,small:!0}):null,fe(Lo,{priority:e.priority,small:!0})]})}),(e.label_keys??[]).length>0?fe(tt,{label:"\uB77C\uBCA8",children:fe(Ot,{labelKeys:e.label_keys,labelOptions:o})}):null,t?fe(tt,{label:"\uD504\uB85C\uC81D\uD2B8",children:fe(Ft,{sx:Bt,children:t})}):null,g?fe(tt,{label:"\uC2DC\uC791",children:fe(Ft,{sx:Bt,children:g})}):null,k?fe(tt,{label:"\uB9C8\uAC10",children:Mn(Ft,{sx:{...Bt,color:w?"#e5484d":Bt.color,fontWeight:w?600:400},children:[k,w?" \xB7 \uC9C0\uC5F0":""]})}):null,e.is_notice?fe(tt,{label:"\uB300\uC0C1\uC790",children:fe(Ft,{sx:Bt,children:d||"\uBAA8\uB4E0 \uC9C1\uC6D0"})}):null,e.is_notice&&l?fe(tt,{label:"\uD655\uC778",children:fe(qh,{size:"small",variant:l.canAck?"contained":"outlined",color:"inherit",startIcon:l.acked?fe(Js,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:S=>{S.stopPropagation(),l.canAck?c?.(e):T?.(e,S.currentTarget)},sx:{py:0,px:1.25,minWidth:0,fontSize:fo(13),...l.canAck?{color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}}:{bgcolor:"#fff",borderColor:"#d5d8dc"}},children:l.canAck?"\uD655\uC778":`${l.count}/${l.total}`})}):null,!e.is_notice&&e.manager_name?fe(tt,{label:"\uCC45\uC784\uC790",children:fe(Ft,{sx:Bt,children:fe(Zr,{text:e.manager_name,keyword:n})})}):null,!e.is_notice&&b.length>0?fe(tt,{label:"\uCC38\uC870\uC790",children:fe(Ft,{sx:Bt,children:b.join(", ")})}):null,e.note?fe(tt,{label:"\uBE44\uACE0",children:fe(Ft,{sx:Bt,children:fe(Zr,{text:e.note,keyword:n})})}):null]})]})}import{jsx as On,jsxs as $h}from"react/jsx-runtime";function hM({tasks:e,statusOptions:o,customTabs:t,loading:n,searchText:r,todayStr:i,onToggleCompleted:a,onOpenDetail:s,onTaskContextMenu:d,getTargetSummary:l,getAckInfo:u,getNoticeReadOnly:p,isTaskUnread:m,getCompleteLocked:c,onAckConfirm:T,onAckListClick:B,onEndReached:f,myAccountSeq:g=0}){let k=new Map(t.map(h=>[h.key,h.label])),[w,b]=Wh(null),S=Hh(null);return Fh(()=>{let h=S.current;if(!f||!h)return;let x=new IntersectionObserver(I=>{I[0]?.isIntersecting&&f()});return x.observe(h),()=>x.disconnect()},[f,e.length]),e.length===0?n?On(js,{}):On(Ca,{sx:{py:6,textAlign:"center",color:"#94a3b8",fontSize:"0.9rem"},children:"\uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):$h(Ca,{sx:{minWidth:0},children:[On(Xs,{children:e.map(h=>On(Zs,{myManaged:g>0&&!h.is_notice&&!h.is_event&&(h.manager_account_seq??0)===g,task:h,statusOptions:o,projectLabel:h.tab_key?k.get(h.tab_key)??"":"",searchText:r,todayStr:i,onRequestToggleCompleted:b,onOpenDetail:s,onTaskContextMenu:d,targetSummary:h.is_notice?l?.(h):void 0,ackInfo:h.is_notice?u?.(h):void 0,noticeReadOnly:h.is_notice?p?.(h):!1,unread:m?.(h)??!1,completeLocked:c?.(h)??!1,onAckConfirm:T,onAckListClick:B},h.seq))}),f?On(Ca,{ref:S,sx:{height:"1px"}}):null,On(Ge,{open:!!w,anchorEl:w?.anchorEl??null,title:w?.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:w?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>b(null),onConfirm:()=>{w&&a(w.taskSeq,w.nextCompleted),b(null)}})]})}import{useEffect as Rk,useRef as zk,useState as Mc}from"react";import{Box as ur,Button as Oc,Divider as qk,Drawer as Ak,IconButton as La,Tooltip as Lk}from"@mui/material";import Nk from"@mui/icons-material/Close";import Fk from"@mui/icons-material/ArrowBack";import Hk from"@ehfuse/overlay-scrollbar";import{Box as va,ButtonBase as Kh,Divider as Uh,Popover as Vh}from"@mui/material";import Gh from"@mui/icons-material/Check";import Yh from"@ehfuse/overlay-scrollbar";import{jsx as ln,jsxs as oc}from"react/jsx-runtime";var ec=["#1e3a8a","#2f80ed","#06b6d4","#0fa3a3","#2f9e5b","#84cc16","#e8a33d","#d9730d","#e5484d","#e255a1","#a355c0","#8a5a2b","#57564f","#111827"];function En({anchorEl:e,value:o,color:t="",onSelect:n,onSelectColor:r,onClose:i}){return ln(Vh,{transitionDuration:0,open:!!e,anchorEl:e,onClose:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},marginThreshold:16,slotProps:{paper:{sx:{mt:1,maxHeight:"calc(100dvh - 96px)"}}},children:oc(va,{sx:{width:"min(492px, calc(100vw - 32px))"},children:[ln(Yh,{style:{maxHeight:"min(432px, calc(100dvh - 240px))"},contentStyle:{minWidth:0,padding:10},thumb:{width:6},children:ln(qr,{value:o||Me,onChange:a=>{n(a),i()}})}),r?oc(va,{sx:{px:1.25,pb:1.25},children:[ln(Uh,{sx:{mb:1,borderColor:"#efefed"}}),ln(va,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:ec.map(a=>{let s=(t||ec[0])===a;return ln(Kh,{"aria-label":`\uC544\uC774\uCF58 \uC0C9 ${a}`,onClick:()=>r(a),sx:{width:26,height:26,borderRadius:"50%",bgcolor:a,display:"flex",alignItems:"center",justifyContent:"center"},children:s?ln(Gh,{sx:{fontSize:15,color:"#ffffff"}}):null},a)})})]}):null]})})}import{useState as _c}from"react";import{Box as sr,ButtonBase as Ck,Divider as cr,Menu as vk,MenuItem as Ik}from"@mui/material";import _k from"@mui/icons-material/SubjectOutlined";import wk from"@mui/icons-material/StickyNote2Outlined";import Dk from"@mui/icons-material/LabelOutlined";import Mk from"@mui/icons-material/DirectionsRunOutlined";import Ok from"@mui/icons-material/SpeedOutlined";import{TextField as Ek}from"@ehfuse/mui-form-controls";import{InfoAlert as Pk}from"@ehfuse/alerts";import{useState as Ht}from"react";import{Box as mc,Divider as pb,ListItemIcon as fb,Menu as wa,MenuItem as ir}from"@mui/material";import xb from"@mui/icons-material/Add";import oi from"@mui/icons-material/Check";import gb from"@mui/icons-material/ViewKanbanOutlined";import hb from"@mui/icons-material/CalendarTodayOutlined";import bb from"@mui/icons-material/EventOutlined";import kb from"@mui/icons-material/PersonOutlineOutlined";import ac from"@mui/icons-material/PeopleAltOutlined";import Tb from"@mui/icons-material/FlagOutlined";import lc from"@mui/icons-material/TimerOutlined";import yb from"@mui/icons-material/NotificationsNoneOutlined";import Sb from"@mui/icons-material/InboxOutlined";import Bb from"@mui/icons-material/PlaceOutlined";import Cb from"@mui/icons-material/MapOutlined";import{DatePicker as vb,TimePicker as sc}from"@ehfuse/mui-datetime-picker";var Ho="@media (max-width: 719.95px)";function uo(e){return{[Ho]:{order:e}}}import{useEffect as jh,useState as Xh}from"react";import{Box as Qh}from"@mui/material";import{jsx as Jh}from"react/jsx-runtime";function vt({value:e,placeholder:o,readOnly:t,onCommit:n}){let r=ne(),[i,a]=Xh(e);return jh(()=>a(e),[e]),Jh(Qh,{component:"input",spellCheck:!1,value:i,readOnly:t,placeholder:o,onChange:s=>a(s.target.value),onBlur:()=>{i.trim()!==e&&n(i.trim())},onKeyDown:s=>{s.key==="Enter"&&s.target.blur()},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:r.colors.textPrimary,caretColor:r.colors.textPrimary,bgcolor:"transparent",p:0,"&::placeholder":{color:"#9a9a97"}}})}import{Box as Ia}from"@mui/material";import{jsx as Zh,jsxs as tc}from"react/jsx-runtime";function de({icon:e,label:o,onClick:t,sx:n,children:r}){return tc(Ia,{sx:[{display:"flex",alignItems:"center",minHeight:26,[Ho]:{minHeight:25}},...Array.isArray(n)?n:[n]],children:[tc(Ia,{sx:{display:"flex",alignItems:"center",gap:1,width:104,flexShrink:0,fontSize:13.5,color:"#787774"},children:[e,o]}),Zh(Ia,{onClick:t?i=>t(i.currentTarget):void 0,sx:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:.5,px:1,py:.25,borderRadius:1,fontSize:14,cursor:t?"pointer":"default","&:hover":t?{bgcolor:"#f2f2f0"}:void 0,[Ho]:{py:.25}},children:r})]})}import{Suspense as eb,lazy as ob,useEffect as tb,useState as nc}from"react";import{Box as _a,Dialog as nb,DialogContent as rb,DialogTitle as ib,IconButton as rc,Tooltip as ab}from"@mui/material";import lb from"@mui/icons-material/Close";import sb from"@mui/icons-material/Search";import{Fragment as db,jsx as Wo,jsxs as ei}from"react/jsx-runtime";function cb(e){return Wo(_a,{sx:{p:3,fontSize:14,color:"#9a9a97"},children:"\uC8FC\uC18C \uAC80\uC0C9 \uBAA8\uB4C8(react-daum-postcode)\uC744 \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC9C1\uC811 \uC785\uB825\uD574 \uC8FC\uC138\uC694."})}var mb=ob(()=>import("react-daum-postcode").then(e=>({default:e.default})).catch(()=>({default:cb})));function ub(e){if(e.addressType!=="R")return e.address;let o="";return e.bname!==""&&/[동|로|가]$/g.test(e.bname)&&(o+=e.bname),e.buildingName!==""&&e.apartment==="Y"&&(o+=o!==""?`, ${e.buildingName}`:e.buildingName),o!==""?`${e.address} (${o})`:e.address}function ic({value:e,placeholder:o="\uC8FC\uC18C \uC785\uB825",readOnly:t,onCommit:n}){let[r,i]=nc(e),[a,s]=nc(!1),d=vo().slots?.addressSearch;tb(()=>i(e),[e]);let l=p=>{i(p),s(!1),p!==e&&n(p)};return ei(db,{children:[ei(_a,{sx:{display:"flex",alignItems:"center",gap:.5,flex:1,minWidth:0},children:[Wo(_a,{component:"input",spellCheck:!1,value:r,readOnly:t,placeholder:o,onChange:p=>i(p.target.value),onBlur:()=>{a||r.trim()!==e&&n(r.trim())},onKeyDown:p=>{p.key==="Enter"&&(p.preventDefault(),!t&&s(!0))},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",p:0,"&::placeholder":{color:"#9a9a97"}}}),t?null:Wo(ab,{title:"\uC8FC\uC18C \uAC80\uC0C9",arrow:!0,children:Wo(rc,{tabIndex:-1,size:"small","aria-label":"\uC8FC\uC18C \uAC80\uC0C9",onClick:()=>s(!0),sx:{color:"#9a9a97",p:.25,flexShrink:0},children:Wo(sb,{sx:{fontSize:17}})})})]}),d?Wo(d,{open:a,onComplete:l,onClose:()=>s(!1)}):ei(nb,{open:a,onClose:()=>s(!1),maxWidth:"sm",fullWidth:!0,slotProps:{paper:{sx:{height:550}}},children:[ei(ib,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",pr:2},children:["\uC8FC\uC18C \uAC80\uC0C9",Wo(rc,{onClick:()=>s(!1),size:"small",children:Wo(lb,{})})]}),Wo(rb,{style:{padding:0},dividers:!0,children:a?Wo(eb,{fallback:null,children:Wo(mb,{onComplete:p=>{l(ub(p))},onClose:()=>s(!1),defaultQuery:r,style:{width:"100%",height:"100%"}})}):null})]})]})}import{Fragment as ti,jsx as G,jsxs as $o}from"react/jsx-runtime";function Ib(e){let o=e?new Date(`${e}T00:00:00`):new Date;return Number.isNaN(o.getTime())?new Date:o}function cc(e){let[o="00",t="00"]=String(e??"").split(":");return{hour:/^\d{2}$/.test(o)?o:"00",minute:/^\d{2}$/.test(t)?t:"00"}}function sn({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return G(mc,{component:"span",sx:{color:"#9a9a97"},children:e})}function ni({values:e,customTabs:o,avatarSrcByName:t,showEstimatedTime:n=!1,managerLocked:r=!1,notice:i=!1,event:a=!1,readOnly:s=!1,targetSummary:d="",narrowCollapsedSx:l,reminderLocked:u=!1,managerAction:p,hideProject:m=!1,leading:c,trailing:T,onChangeProject:B,onChangeStartDate:f,onChangeDueDate:g,onChangeReminder:k,onChangePriority:w,onChangeEstimatedTime:b,onChangeEventTime:S,onChangeEventPlace:h,onChangeEventAddress:x,onMemberEdit:I,onAddProject:W}){let[D,J]=Ht(null),[C,y]=Ht(!1),[L,$]=Ht(null),[Q,R]=Ht(null),[ie,re]=Ht(null),[Ce,xe]=Ht(null),[Ne,oe]=Ht(null),[le,ge]=Ht(null),q=Re(),K=Qo(),Y=_=>[uo(_),...l?Array.isArray(l)?l:[l]:[]],E=o.find(_=>_.key===e.tabKey),H=o.filter(_=>!_.archived);return $o(ti,{children:[$o(mc,{sx:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",columnGap:3,rowGap:.25,px:2,[Ho]:{gridTemplateColumns:"minmax(0, 1fr)"}},children:[c,m?null:G(de,{icon:G(gb,{sx:{fontSize:17}}),label:"\uD504\uB85C\uC81D\uD2B8",onClick:s?void 0:_=>J(_),sx:Y(1),children:E?(()=>{let _=Fe(E.icon);return $o(ti,{children:[_?G(_,{sx:{fontSize:16,color:"#1e3a8a"}}):null,E.label]})})():"\uAE30\uBCF8"}),i?G(de,{icon:G(ac,{sx:{fontSize:17}}),label:"\uB300\uC0C1\uC790",onClick:s?void 0:()=>I("targets"),sx:uo(7),children:d||"\uBAA8\uB4E0 \uC9C1\uC6D0"}):null,!i&&!a?G(de,{icon:G(kb,{sx:{fontSize:17}}),label:"\uCC45\uC784\uC790",onClick:r||s||!e.managerName&&p?void 0:()=>I("manager"),sx:uo(7),children:e.managerName?$o(ti,{children:[G(ho,{names:[e.managerName],size:20,avatarSrcByName:t}),e.managerName]}):p??G(sn,{})}):null,a?null:G(de,{icon:G(hb,{sx:{fontSize:17}}),label:"\uC2DC\uC791\uC77C\uC790",onClick:s?void 0:_=>re(_),sx:uo(2),children:e.startDate?Zo(e.startDate):G(sn,{})}),i?null:G(de,{icon:G(ac,{sx:{fontSize:17}}),label:a?"\uCC38\uC11D\uC790":"\uCC38\uC870\uC790",onClick:s?void 0:()=>I("receivers"),sx:uo(a?7:8),children:e.receiverNames.length>0?$o(ti,{children:[G(ho,{names:e.receiverNames,size:20,avatarSrcByName:t}),e.receiverNames.length===1?e.receiverNames[0]:null]}):G(sn,{})}),G(de,{icon:G(bb,{sx:{fontSize:17}}),label:a?"\uB0A0\uC9DC":"\uB9C8\uAC10\uAE30\uD55C",onClick:s?void 0:_=>xe(_),sx:uo(3),children:e.dueDate?Zo(e.dueDate):G(sn,{})}),a?G(de,{icon:G(lc,{sx:{fontSize:17}}),label:"\uC2DC\uAC01",onClick:s?void 0:_=>ge(_),sx:uo(4),children:e.eventTime?e.eventTime:G(sn,{label:"\uC885\uC77C"})}):null,a?G(de,{icon:G(Bb,{sx:{fontSize:17}}),label:"\uC7A5\uC18C",sx:uo(5),children:G(vt,{value:e.eventPlace??"",placeholder:"\uC7A5\uC18C \uC785\uB825",readOnly:s,onCommit:_=>h?.(_)})}):null,n?G(de,{icon:G(lc,{sx:{fontSize:17}}),label:"\uC608\uC0C1\uC2DC\uAC04",onClick:s?void 0:_=>oe(_),sx:Y(4),children:e.estimatedTime?e.estimatedTime:G(sn,{})}):null,G(de,{icon:G(yb,{sx:{fontSize:17}}),label:"\uB9AC\uB9C8\uC778\uB354",onClick:s||u?void 0:_=>R(_),sx:Y(a?8:5),children:e.reminder==="none"?G(sn,{label:"\uC5C6\uC74C"}):ea(e.reminder)}),a?G(de,{icon:G(Cb,{sx:{fontSize:17}}),label:"\uC8FC\uC18C",sx:[{gridColumn:"1 / -1"},uo(6)],children:G(ic,{value:e.eventAddress??"",placeholder:"\uC8FC\uC18C \uC785\uB825",readOnly:s,onCommit:_=>x?.(_)})}):null,a?null:G(de,{icon:G(Tb,{sx:{fontSize:17}}),label:"\uC911\uC694\uB3C4",onClick:s?void 0:_=>$(_),sx:Y(6),children:G(Lo,{priority:e.priority,small:!0})}),T]}),$o(wa,{transitionDuration:0,anchorEl:D,open:!!D,onClose:()=>J(null),...K,children:[$o(ir,{selected:!e.tabKey,onClick:()=>{B(""),J(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[G(Sb,{sx:{fontSize:17,color:"#9a9a97"}}),"\uC5C6\uC74C",e.tabKey?null:G(oi,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}})]}),H.map(_=>{let N=Fe(_.icon),ce=e.tabKey===_.key;return $o(ir,{selected:ce,onClick:()=>{B(_.key),J(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[N?G(N,{sx:{fontSize:17,color:"#1e3a8a"}}):null,_.label,ce?G(oi,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},_.key)}),W?[G(pb,{},"add-project-divider"),$o(ir,{onClick:()=>y(!0),sx:{fontSize:14,color:"#787774"},children:[G(fb,{children:G(xb,{sx:{fontSize:18,color:"#787774"}})}),"\uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00"]},"add-project")]:null]}),W?G(Ar,{open:C,onClose:()=>y(!1),onSubmit:(_,N,ce)=>{(async()=>{let M=await W(_,N,ce);M&&B(M)})(),J(null)}}):null,G(wa,{transitionDuration:0,anchorEl:L,open:!!L,onClose:()=>$(null),...K,children:["high","medium","low"].map(_=>$o(ir,{selected:e.priority===_,onClick:()=>{w(_),$(null)},sx:{fontSize:14,minWidth:130,gap:1},children:[G(Lo,{priority:_,small:!0}),e.priority===_?G(oi,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},_))}),G(wa,{transitionDuration:0,anchorEl:Q,open:!!Q,onClose:()=>R(null),...K,children:Zi(a&&!!e.eventTime).map(_=>$o(ir,{selected:e.reminder===_.value,onClick:()=>{k(_.value),R(null)},sx:{fontSize:14,minWidth:150,gap:1},children:[_.label,e.reminder===_.value?G(oi,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},_.value))}),n?G(sc,{anchorEl:Ne,open:!!Ne,onClose:()=>oe(null),value:cc(e.estimatedTime),format:"HH:mm",minuteStep:5,autoApply:!0,centered:q,locale:"ko",onChange:(_,N)=>{b?.(`${_}:${N}`),oe(null)}}):null,a?G(sc,{anchorEl:le,open:!!le,onClose:()=>ge(null),value:cc(e.eventTime),format:"HH:mm",minuteStep:10,autoApply:!0,centered:q,locale:"ko",onChange:(_,N)=>{S?.(`${_}:${N}`),ge(null)}}):null,G(vb,{anchorEl:ie,open:!!ie,onClose:()=>re(null),selectedDate:Ib(e.startDate),centered:q,onDateChange:_=>{f(qe(_)),re(null)}}),G(Pt,{anchorEl:Ce,open:!!Ce,date:e.dueDate,reminder:e.reminder,hideReminder:u,centered:q,onClose:()=>xe(null),onDateChange:g,onReminderChange:k})]})}import{useState as _b}from"react";import{Box as wb,Menu as Db,MenuItem as Mb}from"@mui/material";import Ob from"@mui/icons-material/RepeatOutlined";import Eb from"@mui/icons-material/DevicesOutlined";import Pb from"@mui/icons-material/ScreenSearchDesktopOutlined";import Rb from"@mui/icons-material/SellOutlined";import zb from"@mui/icons-material/TaskAltOutlined";import{Fragment as uc,jsx as Je,jsxs as dc}from"react/jsx-runtime";function Da({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return Je(wb,{component:"span",sx:{color:"#9a9a97"},children:e})}function ri({values:e,readOnly:o=!1,showResolution:t=!1,onChangeRepro:n,onChangeDevice:r,onChangeWhere:i,onChangeVersion:a,onChangeResolution:s}){let[d,l]=_b(null),u=d?.field==="repro"?Pi:d?.field==="device"?Ri:zi,p=m=>{d?.field==="repro"?n(m):d?.field==="device"?r(m):d?.field==="resolution"&&s?.(m),l(null)};return dc(uc,{children:[dc(uc,{children:[Je(de,{icon:Je(Ob,{sx:{fontSize:17}}),label:"\uC7AC\uD604\uBE48\uB3C4",onClick:o?void 0:m=>l({field:"repro",el:m}),children:Dl(e.repro)||Je(Da,{label:"\uC120\uD0DD"})}),Je(de,{icon:Je(Eb,{sx:{fontSize:17}}),label:"\uB514\uBC14\uC774\uC2A4",onClick:o?void 0:m=>l({field:"device",el:m}),children:Ml(e.device)||Je(Da,{label:"\uC120\uD0DD"})}),Je(de,{icon:Je(Pb,{sx:{fontSize:17}}),label:"\uBC1C\uC0DD\uD654\uBA74",children:Je(vt,{value:e.where,placeholder:"\uC608: POS > \uC8FC\uBB38\uD604\uD669",readOnly:o,onCommit:i})}),Je(de,{icon:Je(Rb,{sx:{fontSize:17}}),label:"\uBC1C\uC0DD\uBC84\uC804",children:Je(vt,{value:e.version,placeholder:"\uC608: 2026-08-06 \uBC30\uD3EC",readOnly:o,onCommit:a})}),t?Je(de,{icon:Je(zb,{sx:{fontSize:17}}),label:"\uC885\uB8CC\uC0AC\uC720",onClick:o?void 0:m=>l({field:"resolution",el:m}),children:Sr(e.resolution)||Je(Da,{label:"\uC120\uD0DD"})}):null]}),Je(Db,{open:!!d,anchorEl:d?.el??null,onClose:()=>l(null),transitionDuration:0,children:u.map(m=>Je(Mb,{onClick:()=>p(m.key),sx:{fontSize:14},children:m.name},m.key))})]})}import{Box as pc}from"@mui/material";import{jsxs as fc}from"react/jsx-runtime";function Eo({icon:e,title:o,titleExtra:t,children:n}){return fc(pc,{sx:{px:2,display:"flex",flexDirection:"column",gap:.25},children:[fc(pc,{sx:{display:"flex",alignItems:"center",gap:1,fontSize:14.5,fontWeight:500,color:"#37352f"},children:[e,o,t]}),n]})}import{useEffect as qb,useRef as Ma,useState as Ab}from"react";import{Box as Oa,IconButton as Lb,Tooltip as Nb}from"@mui/material";import Fb from"@mui/icons-material/ContentCopyOutlined";import Hb from"@mui/icons-material/Check";import{EhfuseEditor as Wb,minimalToolbarOptions as $b}from"@ehfuse/editor";import{jsx as cn,jsxs as Ub}from"react/jsx-runtime";function Ea(e){let o=e.trim();return o?o.startsWith("<")?e:`<p>${o}</p>`:"<p></p>"}function Kb(e){let o=e.replace(/<br\s*\/?>/gi,`
|
|
1
|
+
var $n="waiting",Tr="replied";import{createContext as zm,useContext as qm,useMemo as xl}from"react";import{Box as Am}from"@mui/material";var Ii="--app-mobile-font-offset";function fo(e,o=0){return`calc(${e}px + max(0px, var(${Ii}, 0px) - ${o}px))`}import{jsx as fl}from"react/jsx-runtime";var gl=zm({});function Lm({config:e,children:o}){let t=xl(()=>e??{},[e]),n=t.mobileFontOffsetPx;return fl(gl.Provider,{value:t,children:n===void 0?o:fl(Am,{sx:{display:"contents",[Ii]:`${n}px`},children:o})})}function Io(){return qm(gl)}function _i(){let{buildFileUrl:e}=Io();return xl(()=>e||((o,t)=>{let n=[];return t?.thumb&&n.push(`thumb=${t.thumb}`),t?.download&&n.push("download=1"),`/api/v1/files/${o}${n.length?`?${n.join("&")}`:""}`}),[e])}function Kn(){let{uploadMaxMb:e}=Io();return e??50}import{useGlobalForm as Sp}from"@ehfuse/forma";import hl from"@mui/icons-material/DoNotDisturbAltOutlined";import bl from"@mui/icons-material/BookmarkBorderOutlined";import Nm from"@mui/icons-material/LabelOutlined";import Fm from"@mui/icons-material/FlagOutlined";import Hm from"@mui/icons-material/StarBorderOutlined";import Wm from"@mui/icons-material/FolderOutlined";import $m from"@mui/icons-material/EventOutlined";import Km from"@mui/icons-material/BuildOutlined";import Um from"@mui/icons-material/LocalShippingOutlined";import Vm from"@mui/icons-material/StorefrontOutlined";import Gm from"@mui/icons-material/GroupsOutlined";import Ym from"@mui/icons-material/LightbulbOutlined";import jm from"@mui/icons-material/FavoriteBorderOutlined";import Xm from"@mui/icons-material/AssignmentOutlined";import Qm from"@mui/icons-material/HomeOutlined";import Jm from"@mui/icons-material/WorkOutline";import Zm from"@mui/icons-material/SchoolOutlined";import eu from"@mui/icons-material/LocalHospitalOutlined";import ou from"@mui/icons-material/RestaurantOutlined";import tu from"@mui/icons-material/LocalFloristOutlined";import nu from"@mui/icons-material/DirectionsCarOutlined";import ru from"@mui/icons-material/CampaignOutlined";import iu from"@mui/icons-material/SavingsOutlined";import au from"@mui/icons-material/Inventory2Outlined";import lu from"@mui/icons-material/CleaningServicesOutlined";import kl from"@mui/icons-material/HandymanOutlined";import su from"@mui/icons-material/LocalPhoneOutlined";import cu from"@mui/icons-material/EmailOutlined";import mu from"@mui/icons-material/ShoppingCartOutlined";import uu from"@mui/icons-material/BarChartOutlined";import du from"@mui/icons-material/PrintOutlined";import pu from"@mui/icons-material/SecurityOutlined";import fu from"@mui/icons-material/AlarmOutlined";import xu from"@mui/icons-material/AttachFileOutlined";import gu from"@mui/icons-material/PhotoCameraOutlined";import hu from"@mui/icons-material/ImageOutlined";import bu from"@mui/icons-material/MenuBookOutlined";import ku from"@mui/icons-material/EditOutlined";import Tu from"@mui/icons-material/KeyOutlined";import yu from"@mui/icons-material/LockOutlined";import Su from"@mui/icons-material/LockOpenOutlined";import Bu from"@mui/icons-material/SettingsOutlined";import Cu from"@mui/icons-material/CloudOutlined";import vu from"@mui/icons-material/WifiOutlined";import Iu from"@mui/icons-material/ComputerOutlined";import _u from"@mui/icons-material/SmartphoneOutlined";import Du from"@mui/icons-material/TvOutlined";import wu from"@mui/icons-material/AccessTimeOutlined";import Mu from"@mui/icons-material/TimerOutlined";import Ou from"@mui/icons-material/MapOutlined";import Eu from"@mui/icons-material/PlaceOutlined";import Pu from"@mui/icons-material/NavigationOutlined";import Ru from"@mui/icons-material/FlightOutlined";import zu from"@mui/icons-material/TrainOutlined";import qu from"@mui/icons-material/DirectionsBusOutlined";import Au from"@mui/icons-material/DirectionsBikeOutlined";import Lu from"@mui/icons-material/DirectionsWalkOutlined";import Nu from"@mui/icons-material/DirectionsRunOutlined";import Fu from"@mui/icons-material/FitnessCenterOutlined";import Hu from"@mui/icons-material/SportsSoccerOutlined";import Wu from"@mui/icons-material/EmojiEventsOutlined";import $u from"@mui/icons-material/CardGiftcardOutlined";import Ku from"@mui/icons-material/CakeOutlined";import Tl from"@mui/icons-material/CoffeeOutlined";import Uu from"@mui/icons-material/LocalPizzaOutlined";import Vu from"@mui/icons-material/ShoppingBagOutlined";import yl from"@mui/icons-material/CreditCardOutlined";import Gu from"@mui/icons-material/AccountBalanceOutlined";import Yu from"@mui/icons-material/AccountBalanceWalletOutlined";import ju from"@mui/icons-material/AttachMoneyOutlined";import Xu from"@mui/icons-material/ReceiptLongOutlined";import Qu from"@mui/icons-material/CalculateOutlined";import Ju from"@mui/icons-material/TrendingUpOutlined";import Zu from"@mui/icons-material/ListAltOutlined";import ed from"@mui/icons-material/TaskAltOutlined";import od from"@mui/icons-material/DoneAllOutlined";import td from"@mui/icons-material/WarningAmberOutlined";import nd from"@mui/icons-material/InfoOutlined";import rd from"@mui/icons-material/HelpOutlined";import id from"@mui/icons-material/SupportAgentOutlined";import ad from"@mui/icons-material/PersonOutlined";import ld from"@mui/icons-material/PersonAddOutlined";import sd from"@mui/icons-material/BadgeOutlined";import cd from"@mui/icons-material/WbSunnyOutlined";import md from"@mui/icons-material/DarkModeOutlined";import ud from"@mui/icons-material/LocalFireDepartmentOutlined";import dd from"@mui/icons-material/WaterDropOutlined";import pd from"@mui/icons-material/BoltOutlined";import fd from"@mui/icons-material/AutorenewOutlined";import xd from"@mui/icons-material/ScienceOutlined";import gd from"@mui/icons-material/MedicalServicesOutlined";import hd from"@mui/icons-material/NotificationsOutlined";import bd from"@mui/icons-material/SendOutlined";import kd from"@mui/icons-material/LinkOutlined";import Td from"@mui/icons-material/PublicOutlined";import Sl from"@mui/icons-material/ApartmentOutlined";import yd from"@mui/icons-material/PlumbingOutlined";import Sd from"@mui/icons-material/ElectricalServicesOutlined";import Bd from"@mui/icons-material/ChatOutlined";import Cd from"@mui/icons-material/DescriptionOutlined";import vd from"@mui/icons-material/FactCheckOutlined";import Id from"@mui/icons-material/RocketLaunchOutlined";import _d from"@mui/icons-material/PaletteOutlined";import Dd from"@mui/icons-material/MusicNoteOutlined";import wd from"@mui/icons-material/VideocamOutlined";import Md from"@mui/icons-material/ThumbUpOutlined";import Od from"@mui/icons-material/PushPinOutlined";import Ed from"@mui/icons-material/SearchOutlined";import Pd from"@mui/icons-material/VisibilityOutlined";import Rd from"@mui/icons-material/VerifiedOutlined";import zd from"@mui/icons-material/TrackChangesOutlined";import qd from"@mui/icons-material/ExtensionOutlined";import Ad from"@mui/icons-material/CodeOutlined";import Ld from"@mui/icons-material/BugReportOutlined";import Nd from"@mui/icons-material/SmartToyOutlined";import Fd from"@mui/icons-material/StorageOutlined";import Hd from"@mui/icons-material/QrCode2Outlined";import Wd from"@mui/icons-material/FileDownloadOutlined";import $d from"@mui/icons-material/FileUploadOutlined";import Kd from"@mui/icons-material/MicOutlined";import Ud from"@mui/icons-material/HeadphonesOutlined";import Vd from"@mui/icons-material/MovieOutlined";import Gd from"@mui/icons-material/SportsEsportsOutlined";import Yd from"@mui/icons-material/BrushOutlined";import jd from"@mui/icons-material/ArchitectureOutlined";import Xd from"@mui/icons-material/EngineeringOutlined";import Qd from"@mui/icons-material/FactoryOutlined";import Jd from"@mui/icons-material/AgricultureOutlined";import Zd from"@mui/icons-material/DirectionsBoatOutlined";import ep from"@mui/icons-material/TwoWheelerOutlined";import op from"@mui/icons-material/HandshakeOutlined";import tp from"@mui/icons-material/GavelOutlined";import np from"@mui/icons-material/BalanceOutlined";import rp from"@mui/icons-material/TranslateOutlined";import ip from"@mui/icons-material/PsychologyOutlined";import ap from"@mui/icons-material/PetsOutlined";import lp from"@mui/icons-material/CelebrationOutlined";import sp from"@mui/icons-material/BeachAccessOutlined";import cp from"@mui/icons-material/AcUnitOutlined";import mp from"@mui/icons-material/ForestOutlined";import up from"@mui/icons-material/LandscapeOutlined";import dp from"@mui/icons-material/HotelOutlined";import pp from"@mui/icons-material/LocalLaundryServiceOutlined";import fp from"@mui/icons-material/ChairOutlined";import xp from"@mui/icons-material/LocalBarOutlined";import gp from"@mui/icons-material/LunchDiningOutlined";import hp from"@mui/icons-material/IcecreamOutlined";import bp from"@mui/icons-material/WorkspacePremiumOutlined";import kp from"@mui/icons-material/DiamondOutlined";import Tp from"@mui/icons-material/VaccinesOutlined";var Di="bookmark",Me="label",xo="notifications",Un="warning",Vn="#e53e3e",Bl="none",wi=[{key:Bl,Icon:hl},{key:"label",Icon:Nm},{key:"bookmark",Icon:bl},{key:"flag",Icon:Fm},{key:"star",Icon:Hm},{key:"folder",Icon:Wm},{key:"event",Icon:$m},{key:"build",Icon:Km},{key:"shipping",Icon:Um},{key:"store",Icon:Vm},{key:"groups",Icon:Gm},{key:"idea",Icon:Ym},{key:"heart",Icon:jm},{key:"assignment",Icon:Xm},{key:"home",Icon:Qm},{key:"work",Icon:Jm},{key:"school",Icon:Zm},{key:"hospital",Icon:eu},{key:"restaurant",Icon:ou},{key:"flower",Icon:tu},{key:"car",Icon:nu},{key:"campaign",Icon:ru},{key:"savings",Icon:iu},{key:"inventory",Icon:au},{key:"cleaning",Icon:lu},{key:"handyman",Icon:kl},{key:"phone",Icon:su},{key:"email",Icon:cu},{key:"cart",Icon:mu},{key:"chart",Icon:uu},{key:"print",Icon:du},{key:"security",Icon:pu},{key:"alarm",Icon:fu},{key:"attach",Icon:xu},{key:"camera",Icon:gu},{key:"image",Icon:hu},{key:"book",Icon:bu},{key:"edit",Icon:ku},{key:"key",Icon:Tu},{key:"lock",Icon:yu},{key:"unlock",Icon:Su},{key:"settings",Icon:Bu},{key:"cloud",Icon:Cu},{key:"wifi",Icon:vu},{key:"computer",Icon:Iu},{key:"smartphone",Icon:_u},{key:"tv",Icon:Du},{key:"clock",Icon:wu},{key:"timer",Icon:Mu},{key:"map",Icon:Ou},{key:"place",Icon:Eu},{key:"navigation",Icon:Pu},{key:"flight",Icon:Ru},{key:"train",Icon:zu},{key:"bus",Icon:qu},{key:"bike",Icon:Au},{key:"walk",Icon:Lu},{key:"run",Icon:Nu},{key:"fitness",Icon:Fu},{key:"soccer",Icon:Hu},{key:"trophy",Icon:Wu},{key:"gift",Icon:$u},{key:"cake",Icon:Ku},{key:"coffee",Icon:Tl},{key:"pizza",Icon:Uu},{key:"bag",Icon:Vu},{key:"card",Icon:yl},{key:"bank",Icon:Gu},{key:"wallet",Icon:Yu},{key:"money",Icon:ju},{key:"receipt",Icon:Xu},{key:"calculate",Icon:Qu},{key:"trending",Icon:Ju},{key:"listalt",Icon:Zu},{key:"task",Icon:ed},{key:"doneall",Icon:od},{key:"warning",Icon:td},{key:"info",Icon:nd},{key:"help",Icon:rd},{key:"support",Icon:id},{key:"person",Icon:ad},{key:"personadd",Icon:ld},{key:"badge",Icon:sd},{key:"sun",Icon:cd},{key:"moon",Icon:md},{key:"fire",Icon:ud},{key:"water",Icon:dd},{key:"bolt",Icon:pd},{key:"renew",Icon:fd},{key:"science",Icon:xd},{key:"medical",Icon:gd},{key:"notifications",Icon:hd},{key:"send",Icon:bd},{key:"link",Icon:kd},{key:"public",Icon:Td},{key:"apartment",Icon:Sl},{key:"plumbing",Icon:yd},{key:"electrical",Icon:Sd},{key:"chat",Icon:Bd},{key:"description",Icon:Cd},{key:"factcheck",Icon:vd},{key:"rocket",Icon:Id},{key:"palette",Icon:_d},{key:"music",Icon:Dd},{key:"video",Icon:wd},{key:"thumbup",Icon:Md},{key:"pin",Icon:Od},{key:"search",Icon:Ed},{key:"eye",Icon:Pd},{key:"verified",Icon:Rd},{key:"target",Icon:zd},{key:"extension",Icon:qd},{key:"code",Icon:Ad},{key:"bug",Icon:Ld},{key:"robot",Icon:Nd},{key:"storage",Icon:Fd},{key:"qrcode",Icon:Hd},{key:"download",Icon:Wd},{key:"upload",Icon:$d},{key:"mic",Icon:Kd},{key:"headphones",Icon:Ud},{key:"movie",Icon:Vd},{key:"game",Icon:Gd},{key:"brush",Icon:Yd},{key:"architecture",Icon:jd},{key:"engineering",Icon:Xd},{key:"factory",Icon:Qd},{key:"agriculture",Icon:Jd},{key:"boat",Icon:Zd},{key:"motorcycle",Icon:ep},{key:"handshake",Icon:op},{key:"gavel",Icon:tp},{key:"balance",Icon:np},{key:"translate",Icon:rp},{key:"psychology",Icon:ip},{key:"pets",Icon:ap},{key:"celebration",Icon:lp},{key:"beach",Icon:sp},{key:"snow",Icon:cp},{key:"forest",Icon:mp},{key:"mountain",Icon:up},{key:"hotel",Icon:dp},{key:"laundry",Icon:pp},{key:"chair",Icon:fp},{key:"bar",Icon:xp},{key:"burger",Icon:gp},{key:"icecream",Icon:hp},{key:"medal",Icon:bp},{key:"diamond",Icon:kp},{key:"vaccine",Icon:Tp}],yp={cafe:Tl,payment:yl,business:Sl,construction:kl};function He(e){return e===Bl?null:wi.find(o=>o.key===e)?.Icon??yp[String(e??"")]??bl}function Tn(e){return He(e)??hl}var Mi={title:"",icon:Me,icon_color:"",manager_name:"",manager_account_seq:0,receiver_names:[],receiver_account_seqs:[],is_notice:!1,is_event:!1,is_bug:!1,is_open:!1,bug_repro:"",bug_device:"",bug_where:"",bug_version:"",sprint_seq:0,story_points:0,event_time:"",event_place:"",event_address:"",target_names:[],target_account_seqs:[],start_date:"",due_date:"",reminder:"none",priority:"medium",label_keys:[],note:"",content:"",checklist:[],tab_key:""},Oi={createAttachmentFiles:[],createSubmitting:!1,attachmentUpload:null};function Bp(e){let{formId:o="taskbox-create-form",initialValues:t,onValidate:n,onSubmit:r}=e;return Sp({formId:o,initialValues:{...Mi,...t},onValidate:n,onSubmit:r})}import{useGlobalFormaState as Cp}from"@ehfuse/forma";var Cl="taskbox-ui-state";function st(){return Cp({stateId:Cl,initialValues:Oi})}import{useMemo as vp}from"react";import{useTheme as Ip}from"@mui/material";function jt(e,o){let t=Math.max(0,Math.min(1,o));if(t<=0)return"transparent";let n=e.trim().replace("#",""),r=n.length===3?n.split("").map(d=>d+d).join(""):n;if(!/^[0-9a-fA-F]{6}$/.test(r))return e;let i=Number.parseInt(r.slice(0,2),16),a=Number.parseInt(r.slice(2,4),16),s=Number.parseInt(r.slice(4,6),16);return`rgba(${i}, ${a}, ${s}, ${t})`}function vl(e,o){let t=Math.max(0,Math.min(1,o)),n=e.trim().replace("#",""),r=n.length===3?n.split("").map(l=>l+l).join(""):n;if(!/^[0-9a-fA-F]{6}$/.test(r))return e;let i=l=>Math.round(l+(255-l)*t),a=i(Number.parseInt(r.slice(0,2),16)),s=i(Number.parseInt(r.slice(2,4),16)),d=i(Number.parseInt(r.slice(4,6),16));return`#${[a,s,d].map(l=>l.toString(16).padStart(2,"0")).join("")}`}function Ei(e,o,t){return t==="dark"?{accent:e,accentContrast:o,accentSoft:"#1d2b45",accentOnSurface:"#b3d1ff",danger:"#f87171",dangerSoft:"#3a1f22",success:"#4ade80",warning:"#fbbf24",textStrong:"#ffffff",textPrimary:"#e2e8f0",textSecondary:"#a3adbb",textMuted:"#77808d",textInverse:"#0f1216",surface:"#161a1f",surfaceSubtle:"#1e232a",surfaceHover:"#272d36",border:"#2c333c",borderStrong:"#3b434e"}:{accent:e,accentContrast:o,accentSoft:"#eef4ff",accentOnSurface:e,danger:"#e5484d",dangerSoft:"#fdebec",success:"#16a34a",warning:"#e8a33d",textStrong:"#000000",textPrimary:"#37352f",textSecondary:"#787774",textMuted:"#9a9a97",textInverse:"#ffffff",surface:"#ffffff",surfaceSubtle:"#fafaf9",surfaceHover:"#f4f4f2",border:"#e6e6e3",borderStrong:"#dedddb"}}function _p(e,o){let t=o==="dark";return{bg:t?vl(e.accent,.45):e.accent,color:t?e.textInverse:e.accentContrast,border:"none",fontSize:11.5,fontWeight:600,minWidth:20,width:34,borderRadius:999,paddingX:.6,paddingY:.4}}function Il(e,o){return{...e,...o??{}}}function yr(e,o="light"){let t=o==="dark",n=_p(e,o),r=e.accentOnSurface;return{mode:o,colors:e,table:{bg:e.surface,borderColor:e.borderStrong,headerBg:e.surface,headerColor:e.textSecondary,headerActiveColor:e.textStrong,headerFilteredColor:r,headerFontSize:13,rowBg:e.surface,rowColor:e.textPrimary,rowSubColor:e.textSecondary,rowTitleColor:e.textStrong,rowTitleFontWeight:o==="dark"?400:500,rowHoverBg:e.surfaceHover,rowBorderColor:e.border,cellHoverBg:e.surfaceHover,emptyColor:e.textMuted,groupHeader:{bg:e.surfaceSubtle,hoverBg:e.surfaceHover,borderColor:e.border,labelColor:o==="dark"?e.textStrong:e.textPrimary,labelFontSize:15.5,labelFontWeight:o==="dark"?400:700,minHeight:48,badge:{...n,borderRadius:4,width:34}}},board:{columnBg:e.surfaceSubtle,columnHeaderColor:e.textPrimary,columnHeaderFontSize:13.5,badge:{...n,borderRadius:4,width:34}},summary:{gaugeTrackColor:o==="dark"?e.borderStrong:"#ececea",gaugeBarColor:r,gaugeCompleteColor:e.success,gaugeHeight:6,numberColor:r,overdueColor:e.danger,textColor:e.textStrong},actionButton:{bg:"#2f80ed",color:"#ffffff",hoverBg:"#2470dd",bgImage:"linear-gradient(180deg, #5ba1f5 0%, #2f80ed 100%)",hoverBgImage:"linear-gradient(180deg, #4d95ee 0%, #2470dd 100%)"},tabs:{bg:o==="dark"?e.surfaceSubtle:e.surface,color:o==="dark"?e.textSecondary:e.textStrong,hoverBg:e.surfaceHover,borderColor:o==="dark"?e.border:e.borderStrong,selectedBg:o==="dark"?e.surfaceHover:e.textStrong,selectedColor:o==="dark"?e.textStrong:e.surface},calendar:{bg:e.surface,borderColor:t?"#3a434f":e.border,headerBg:e.surfaceSubtle,headerColor:e.textSecondary,cellBg:t?"#1a1e24":e.surface,dateBandBg:e.surface,otherMonthBg:t?"#1a1e24":e.surface,todayBg:e.accentSoft,hoverBg:e.surfaceHover,dateColor:e.textPrimary,holidayColor:e.danger},card:{bg:t?"#232a33":e.surface,borderColor:t?"#333c47":e.border,hoverBg:t?"#2b3441":e.surfaceHover,titleColor:e.textPrimary,subColor:e.textSecondary},timeline:{bg:e.surface,gridColor:e.border,headerBg:e.surfaceSubtle,headerColor:e.textSecondary,todayLineColor:e.accentOnSurface,barColor:e.accentOnSurface,overdueBarColor:e.danger},avatar:{ringColor:o==="dark"?e.textStrong:e.accent,separatorColor:e.surface},chip:{borderRadius:.75,fontSize:13,fontWeight:500,plainColor:o==="dark"?e.textSecondary:"#57564f",plainDotColor:e.textMuted,darkBgAlpha:.15,darkTextSource:"dot"}}}function Pi(e,o){if(!o)return e;let t=o.mode??e.mode,r={...t===e.mode?e.colors:Ei(e.colors.accent,e.colors.accentContrast,t),...o.colors??{}},i=yr(r,t),{groupHeader:a,...s}=o.table??{},{badge:d,...l}=o.board??{},{badge:u,...p}=a??{};return{mode:t,colors:r,table:{...i.table,...s,groupHeader:{...i.table.groupHeader,...p,badge:Il(i.table.groupHeader.badge,u)}},board:{...i.board,...l,badge:Il(i.board.badge,d)},summary:{...i.summary,...o.summary??{}},chip:{...i.chip,...o.chip??{}},actionButton:{...i.actionButton,...o.actionButton??{}},tabs:{...i.tabs,...o.tabs??{}},avatar:{...i.avatar,...o.avatar??{}},calendar:{...i.calendar,...o.calendar??{}},card:{...i.card,...o.card??{}},timeline:{...i.timeline,...o.timeline??{}}}}function Dp(e={}){let{mode:o="light",accent:t="#2563eb",accentContrast:n="#ffffff",input:r}=e;return Pi(yr(Ei(t,n,o),o),r)}function ne(){let e=Ip(),{theme:o}=Io(),t=e.palette.primary.main,n=e.palette.primary.contrastText,r=e.palette.mode==="dark"?"dark":"light";return vp(()=>Pi(yr(Ei(t,n,r),r),o),[t,n,r,o])}import{useCallback as dt,useEffect as es,useMemo as en,useRef as nx,useState as pt}from"react";import{Box as Fo,Divider as rx,IconButton as ix,ListItemIcon as ax,Menu as os,MenuItem as Lr}from"@mui/material";import ts from"@mui/icons-material/Add";import lx from"@mui/icons-material/ArrowUpward";import sx from"@mui/icons-material/ArrowDownward";import cx from"@mui/icons-material/KeyboardArrowDown";import mx from"@mui/icons-material/KeyboardArrowRight";import ia from"@mui/icons-material/Check";import ux from"@mui/icons-material/FilterList";import dx from"@mui/icons-material/InboxOutlined";import{Virtuoso as ns}from"react-virtuoso";import px from"@ehfuse/overlay-scrollbar";import{DatePicker as fx}from"@ehfuse/mui-datetime-picker";function wp(e){let o=String(e??"").trim().replace("T"," "),t=o.match(/^(\d{4})-(\d{2})-(\d{2})(?:[ ](\d{2}):(\d{2})(?::(\d{2}))?)?/);return t?new Date(Number(t[1]),Number(t[2])-1,Number(t[3]),Number(t[4]??0),Number(t[5]??0),Number(t[6]??0)):new Date(o)}function Ae(e,o="YYYY-MM-DD"){let t=typeof e=="string"?wp(e):e;if(!e||e===""||isNaN(t.getTime()))return"";let n=t.getFullYear(),r=(t.getMonth()+1).toString().padStart(2,"0"),i=t.getDate().toString().padStart(2,"0"),a=n.toString().slice(-2);switch(o){case"YYYY-MM-DD":return`${n}-${r}-${i}`;case"YY.MM.DD":return`${a}.${r}.${i}`;case"MM/DD/YYYY":return`${r}/${i}/${n}`;case"DD.MM.YYYY":return`${i}.${r}.${n}`;case"YYYYMMDD":return`${n}${r}${i}`;default:return o.replace(/YYYY/g,n.toString()).replace(/YY/g,a).replace(/MM/g,r).replace(/DD/g,i)}}function _l(){return Ae(new Date)}import{Box as Dl}from"@mui/material";import{jsx as Op,jsxs as Ep}from"react/jsx-runtime";var Mp={high:{label:"\uB192\uC74C",dot:"#e5484d",bgcolor:"#fdebec",color:"#c4554d"},medium:{label:"\uC911\uAC04",dot:"#2f80ed",bgcolor:"#e3eefb",color:"#1d4f91"},low:{label:"\uB0AE\uC74C",dot:"#9a9a97",bgcolor:"#efefed",color:"#57564f"}};function No({priority:e,small:o=!1,plain:t=!1}){let n=Mp[e],r=ne(),i=r.mode==="dark",a=t||e==="low";return Ep(Dl,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:o?.5:.75,px:a?0:o?.9:1.25,py:a?0:o?.25:.5,borderRadius:.75,fontSize:o?11.5:13,fontWeight:500,bgcolor:a?"transparent":i?jt(n.dot,r.chip.darkBgAlpha):n.bgcolor,color:a?i?r.chip.plainColor:n.color:i?r.chip.darkTextSource==="fg"?n.color:n.dot:n.color,whiteSpace:"nowrap"},children:[Op(Dl,{component:"span",sx:{width:o?6:8,height:o?6:8,borderRadius:"50%",bgcolor:n.dot}}),n.label]})}import{Menu as Ap,MenuItem as Lp}from"@mui/material";import Np from"@mui/icons-material/Check";function Qo(){return{}}var Ri=[{key:"always",name:"\uD56D\uC0C1"},{key:"often",name:"\uC790\uC8FC"},{key:"sometimes",name:"\uAC00\uB054"},{key:"once",name:"1\uD68C"},{key:"unable",name:"\uC7AC\uD604\uBD88\uAC00"}],zi=[{key:"desktop",name:"\uB370\uC2A4\uD06C\uD1B1"},{key:"tablet",name:"\uD0DC\uBE14\uB9BF"},{key:"mobile",name:"\uD734\uB300\uD3F0"}],qi=[{key:"fixed",name:"\uC218\uC815\uC644\uB8CC"},{key:"duplicate",name:"\uC911\uBCF5"},{key:"cannot_reproduce",name:"\uC7AC\uD604\uBD88\uAC00"},{key:"by_design",name:"\uC0AC\uC591\uB300\uB85C"},{key:"wont_fix",name:"\uC548 \uACE0\uCE68"}];function wl(e){return Ri.find(o=>o.key===e)?.name??""}function Ml(e){return zi.find(o=>o.key===e)?.name??""}function Sr(e){return qi.find(o=>o.key===e)?.name??""}function Ai(e,o=new Date){if(!e.is_event)return!1;let t=String(e.due_date??"").trim().slice(0,10);if(!/^\d{4}-\d{2}-\d{2}$/.test(t))return!1;let n=String(e.event_time??"").trim();if(/^\d{2}:\d{2}$/.test(n)){let i=new Date(`${t}T${n}:00`);return!Number.isNaN(i.getTime())&&i.getTime()<=o.getTime()}let r=new Date(`${t}T00:00:00`);return Number.isNaN(r.getTime())?!1:(r.setDate(r.getDate()+1),r.getTime()<=o.getTime())}function Br(e,o=new Date){return e.is_event?Ai(e,o):!!e.completed}var Xt=[{key:"not_started",name:"\uC2DC\uC791\uC804",bg:"#efefed",fg:"#57564f",dot:"#9a9a97"},{key:"in_progress",name:"\uC9C4\uD589\uC911",bg:"#dcf2e3",fg:"#1f6b3a",dot:"#2f9e5b"},{key:"hold",name:"\uBCF4\uB958",bg:"#fbeee0",fg:"#8a5a2b",dot:"#d9730d"},{key:$n,name:"\uD655\uC778\uC911",bg:"#faf1d7",fg:"#8a6d1d",dot:"#e8a33d"},{key:Tr,name:"\uD655\uC778\uC644\uB8CC",bg:"#e3eefb",fg:"#1d4f91",dot:"#2f80ed"}],Yn=Xt.filter(e=>e.key!==$n&&e.key!==Tr);function Cr(e){return Xt.find(o=>o.key===e)??Xt[0]}var Li={key:"completed",name:"\uC644\uB8CC",bg:"#e3eefb",fg:"#1d4f91",dot:"#2f80ed"};function go(e){if(e.is_notice)return Ol(e.status);if(e.is_bug&&e.completed){let o=Sr(e.resolution)||"\uC644\uB8CC";return{...Li,name:o}}return e.completed?Li:e.is_bug?Rp(e.status):Cr(e.status)}var Pp={key:"event_ended",name:"\uC885\uB8CC",bg:"#efefed",fg:"#57564f",dot:"#9a9a97"};function jn(e){return Ai(e)?Pp:null}var Gn=[{key:"notice_scheduled",name:"\uAC8C\uC2DC\uC608\uC815",bg:"#faf1d7",fg:"#8a6d1d",dot:"#e8a33d"},{key:"notice_active",name:"\uAC8C\uC2DC\uC911",bg:"#dcf2e3",fg:"#1f6b3a",dot:"#2f9e5b"},{key:"notice_closed",name:"\uC885\uB8CC",bg:"#efefed",fg:"#57564f",dot:"#9a9a97"}];function Ol(e){return Gn.find(o=>o.key===e)??Gn[1]}var Ni="__closed__",Qt=[{key:"bug_received",name:"\uC811\uC218",bg:"#fdeaea",fg:"#9b2c2c",dot:"#e53e3e"},{key:"bug_confirmed",name:"\uD655\uC778\uC911",bg:"#faf1d7",fg:"#8a6d1d",dot:"#e8a33d"},{key:"bug_in_progress",name:"\uC9C4\uD589\uC911",bg:"#dcf2e3",fg:"#1f6b3a",dot:"#2f9e5b"},{key:"bug_hold",name:"\uBCF4\uB958",bg:"#efefed",fg:"#57564f",dot:"#9a9a97"}],pv=[...Qt.filter(e=>e.key!=="bug_hold"),{key:Ni,name:"\uC644\uB8CC",bg:"#e3eefb",fg:"#1d4f91",dot:"#2f80ed"},...Qt.filter(e=>e.key==="bug_hold")];function Rp(e){return Qt.find(o=>o.key===e)??Qt[0]}function El(e){return e.is_notice?Gn:e.is_bug?Qt:Yn}function Fi(e){return e.status===$n}var zp={in_progress:0,[$n]:1,not_started:2,hold:3,[Tr]:4};function fv(e){return e.completed?9:zp[String(e.status??"")]??2}function yn(e,o){let t=new Map(o.map(r=>[r.key,r])),n=(e.label_keys??[]).map(r=>t.get(r)).filter(r=>!!r);if(e.is_event){let r=jn({is_event:!0,due_date:String(e.due_date??""),event_time:e.event_time});return r?[r,...n]:n}return e.is_notice?String(e.status??"")==="notice_active"?n:[Ol(e.status),...n]:e.is_bug?[go({...e,is_notice:!1}),...n]:e.completed?[Li,...n]:[Cr(e.status),...n]}function Pl(e){return{bg:`${e}1f`,fg:e,dot:e}}function vr(e,o){return e.includes(o)?e.filter(t=>t!==o):[...e,o]}import{Box as Ir}from"@mui/material";import{jsx as Xn,jsxs as qp}from"react/jsx-runtime";function Ee({option:e,small:o=!1}){let t=ne(),n=t.mode==="dark",r=e.key==="not_started";return qp(Ir,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:o?.5:.75,px:r?0:o?.9:1.25,py:r?0:o?.25:.5,borderRadius:1.25,fontSize:o?11.5:13,fontWeight:500,bgcolor:r?"transparent":n?jt(e.dot,t.chip.darkBgAlpha):e.bg,color:r?n?t.chip.plainColor:e.fg:n?t.chip.darkTextSource==="fg"?e.fg:e.dot:e.fg,whiteSpace:"nowrap"},children:[Xn(Ir,{component:"span",sx:{width:o?6:8,height:o?6:8,borderRadius:"50%",bgcolor:e.dot,flexShrink:0}}),e.name]})}function Tv({task:e,statusOptions:o,small:t=!1}){let n=yn(e,o);return n.length===0?null:Xn(Ir,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5},children:n.map(r=>Xn(Ee,{option:r,small:t},r.key))})}function Ot({labelKeys:e,labelOptions:o}){let t=new Map(o.map(r=>[r.key,r])),n=e.map(r=>t.get(r)).filter(r=>!!r);return n.length===0?null:Xn(Ir,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5},children:n.map(r=>Xn(Ee,{option:r,small:!0},r.key))})}import{jsx as Hi,jsxs as Fp}from"react/jsx-runtime";function _r({anchorEl:e,value:o,options:t=Xt,onSelect:n,onClose:r}){let i=Qo();return Hi(Ap,{anchorEl:e,open:!!e,onClose:r,transitionDuration:0,...i,children:t.map(a=>Fp(Lp,{onClick:()=>{n(a.key),r()},sx:{fontSize:14,minWidth:150,gap:1},children:[Hi(Ee,{option:a}),o===a.key?Hi(Np,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},a.key))})}function Dr(e,o){if(o<=0)return!1;if(e.is_notice){if((e.author_account_seq??0)===o)return!0;let t=(e.target_account_seqs??[]).filter(n=>n>0);return t.length===0||t.includes(o)}return Wi(e)?!0:(e.author_account_seq??0)===o||(e.manager_account_seq??0)===o||(e.receiver_account_seqs??[]).includes(o)}function Wi(e){return e.is_notice||!e.is_open||e.completed||e.archived?!1:(e.manager_account_seq??0)===0}function wr(e,o){return o<=0?!1:Wi(e)}function Mr(e,o){return o<=0||e.is_notice||e.is_event||e.completed||e.archived||(e.manager_account_seq??0)>0||Wi(e)?!1:(e.receiver_account_seqs??[]).includes(o)||(e.author_account_seq??0)===o}function Rl(e){return!!e.is_bug&&(e.manager_account_seq??0)===0&&e.status==="bug_received"}function ct(e,o){return o<=0?!1:e.is_notice?(e.author_account_seq??0)===o:(e.author_account_seq??0)===o||(e.manager_account_seq??0)===o||(e.receiver_account_seqs??[]).includes(o)}var Mv=[119,121,141,143];var $i=[{value:"due",label:"\uADF8\uB8F9 : \uB9C8\uAC10\uAE30\uD55C"},{value:"status",label:"\uADF8\uB8F9 : \uC0C1\uD0DC"},{value:"manager",label:"\uADF8\uB8F9 : \uCC45\uC784\uC790"},{value:"tab",label:"\uADF8\uB8F9 : \uD504\uB85C\uC81D\uD2B8"},{value:"none",label:"\uADF8\uB8F9 \uC5C6\uC74C"}];function Hp(e){let o=new Date(`${e}T00:00:00`);return o.setDate(o.getDate()+(6-o.getDay())),Ae(o)}var Wp=[{key:"overdue",label:"\uC9C0\uB0A8"},{key:"today",label:"\uC624\uB298"},{key:"this_week",label:"\uC774\uBC88 \uC8FC"},{key:"later",label:"\uC774\uD6C4"},{key:"no_due",label:"\uB9C8\uAC10 \uC5C6\uC74C"}];function $p(e,o,t){let n=e.due_date.slice(0,10);return n?n<o?"overdue":n===o?"today":n<=t?"this_week":"later":"no_due"}function Ki(e,o,t,n=[],r=[],i="",a){let s=e.filter(m=>m.is_notice);if(s.length>0){let m=Ki(e.filter(c=>!c.is_notice),o,t,n,r,i,a);return[{key:"__notice__",label:"\uACF5\uC9C0\uC0AC\uD56D",tasks:s},...m]}let d=new Map,l=(m,c)=>{let k=d.get(m);k?k.push(c):d.set(m,[c])},u;if(o==="due"){let m=Hp(t);for(let c of e)l($p(c,t,m),c);u=Wp}else if(o==="status"){for(let m of e)l(Cr(m.status).key,m);u=Xt.map(m=>({key:m.key,label:m.name}))}else if(o==="tab"){for(let m of e)l(m.tab_key?.trim()||"__none__",m);u=[...n.filter(m=>!m.archived).map(m=>({key:m.key,label:m.label})),{key:"__none__",label:"\uAE30\uBCF8 \uC5C5\uBB34\uD568"},...n.filter(m=>m.archived).map(m=>({key:m.key,label:`${m.label} (\uBCF4\uAD00\uB428)`}))]}else if(a?.enabled){let m=Number(a.myAccountSeq??0),c=i.trim();for(let k of e){if(!(Number(k.manager_account_seq??0)>0||String(k.manager_name??"").trim()!=="")){l("__none__",k);continue}let g=m>0&&Number(k.manager_account_seq??0)===m||!!c&&String(k.manager_name??"").trim()===c;l(g?"__manager__":"__reference__",k)}u=[{key:"__manager__",label:"\uCC45\uC784\uC790"},{key:"__none__",label:"\uCC45\uC784\uC790 \uBBF8\uBC30\uC815"},{key:"__reference__",label:"\uCC38\uC870\uC790"}]}else{for(let g of e)l(String(g.manager_name??"").trim()||"__none__",g);let m=i.trim(),c=[...d.keys()].filter(g=>g!=="__none__").sort((g,h)=>{if(m){if(g===m)return-1;if(h===m)return 1}return g.localeCompare(h)}),k=!!m&&c.includes(m),S=c.filter(g=>g!==m);u=[...k?[{key:m,label:"\uB0B4 \uC5C5\uBB34"}]:[],{key:"__none__",label:"\uCC45\uC784\uC790 \uBBF8\uBC30\uC815"},...S.map(g=>({key:g,label:g}))]}let p=[];for(let m of u){let c=d.get(m.key);!c||c.length===0||p.push({key:m.key,label:m.label,tasks:c})}return p}import Kp from"@mui/icons-material/NotesOutlined";import Up from"@mui/icons-material/AutorenewOutlined";import Vp from"@mui/icons-material/CalendarTodayOutlined";import Gp from"@mui/icons-material/EventOutlined";import Yp from"@mui/icons-material/PersonOutlineOutlined";import ql from"@mui/icons-material/PeopleAltOutlined";import Gi from"@mui/icons-material/CheckCircleOutlineOutlined";import jp from"@mui/icons-material/FlagOutlined";import Xp from"@mui/icons-material/AccessTimeOutlined";import Qp from"@mui/icons-material/StickyNote2Outlined";import Jp from"@mui/icons-material/ViewKanbanOutlined";import Zp from"@mui/icons-material/ConfirmationNumberOutlined";import{jsx as co}from"react/jsx-runtime";var ef={role_mark:"11px",completed:"44px",ticket_no:"100px",title:"minmax(220px, 1.8fr)",status:"110px",start_date:"110px",due_date:"120px",manager_name:"110px",receiver_names:"170px",targets:"170px",priority:"84px",ack:"104px",confirm:"100px",project:"150px",request:"100px",completed_time:"150px",note:"minmax(200px, 1.2fr)"};function Or(e){return Yi(e).map(o=>ef[o.id]).join(" ")}var of={id:"completed_time",label:"\uC644\uB8CC\uC77C\uC2DC",icon:co(Xp,{sx:{fontSize:15}}),align:"center",sortable:!0},tf={id:"ticket_no",label:"\uD2F0\uCF13",icon:co(Zp,{sx:{fontSize:15}}),align:"center"},nf={id:"project",label:"\uD504\uB85C\uC81D\uD2B8",icon:co(Jp,{sx:{fontSize:15}}),projectFilter:!0},rf={id:"targets",label:"\uB300\uC0C1\uC790",icon:co(ql,{sx:{fontSize:15}})},zl={id:"priority",label:"\uC911\uC694\uB3C4",icon:co(jp,{sx:{fontSize:15}}),align:"center",priorityFilter:!0},af={id:"ack",label:"\uD655\uC778",icon:co(Gi,{sx:{fontSize:15}}),align:"center",ackFilter:!0},lf={id:"confirm",label:"\uD655\uC778",icon:co(Gi,{sx:{fontSize:15}}),align:"center",ackFilter:!0};function Ui(e){let o=e.findIndex(n=>n.id==="receiver_names"||n.id==="targets"),t=o>=0?o+1:e.findIndex(n=>n.id==="note");return t<0?[...e,zl]:[...e.slice(0,t),zl,...e.slice(t)]}function Yi(e){let{showProject:o=!1,showManager:t=!0,showActions:n=!0,showRequest:r=!0,notice:i=!1,bug:a=!1,confirmMode:s="none"}=e??{},d=p=>{if(!a)return p;let m=p.filter(S=>S.id!=="note"),c=m.findIndex(S=>S.id==="completed"),k=c>=0?c+1:0;return[...m.slice(0,k),tf,...m.slice(k)]};if(i)return d(Ui(Vi.filter(p=>!["manager_name","receiver_names","request"].includes(p.id)).flatMap(p=>p.id==="due_date"?[p,rf]:p.id==="note"?[af,p]:[p])));let l=t?Vi:Vi.filter(p=>p.id!=="manager_name");if(n)r||(l=l.filter(p=>p.id!=="request"));else{l=l.filter(m=>m.id!=="request");let p=l.findIndex(m=>m.id==="note");l=[...l.slice(0,p),of,...l.slice(p)]}if(s==="action"){let p=l.findIndex(m=>m.id==="note");l=[...l.slice(0,p),lf,...l.slice(p)]}if(!o)return d(Ui(l));let u=l.findIndex(p=>p.id==="receiver_names");return d(Ui([...l.slice(0,u+1),nf,...l.slice(u+1)]))}var Vi=[{id:"role_mark",label:"",icon:null},{id:"completed",label:"\uC644\uB8CC",icon:null,align:"center"},{id:"title",label:"\uC81C\uBAA9",icon:co(Kp,{sx:{fontSize:15}}),sortable:!0},{id:"status",label:"\uC0C1\uD0DC",icon:co(Up,{sx:{fontSize:15}}),align:"center",statusFilter:!0},{id:"start_date",label:"\uC2DC\uC791\uC77C\uC790",icon:co(Vp,{sx:{fontSize:15}}),align:"center",sortable:!0},{id:"due_date",label:"\uB9C8\uAC10\uAE30\uD55C",icon:co(Gp,{sx:{fontSize:15}}),align:"center",sortable:!0},{id:"manager_name",label:"\uCC45\uC784\uC790",icon:co(Yp,{sx:{fontSize:15}}),memberFilter:"manager"},{id:"receiver_names",label:"\uCC38\uC870\uC790",icon:co(ql,{sx:{fontSize:15}}),memberFilter:"receivers"},{id:"request",label:"\uD655\uC778",icon:co(Gi,{sx:{fontSize:15}}),align:"center",ackFilter:!0},{id:"note",label:"\uBE44\uACE0",icon:co(Qp,{sx:{fontSize:15}})}];import{Button as Al,ClickAwayListener as mf,Dialog as uf,Paper as df,Popper as pf,Typography as ff,Box as xf}from"@mui/material";import{useMediaQuery as sf,useTheme as cf}from"@mui/material";function Re(){let{isMobile:e}=Io(),o=cf(),t=sf(o.breakpoints.up("lg"));return e!==void 0?e:!t}import{Fragment as hf,jsx as Et,jsxs as Ll}from"react/jsx-runtime";function gf({title:e,content:o,confirmText:t,cancelText:n,titleFontSize:r,actionFontSize:i,actionMinHeight:a,onCancel:s,onConfirm:d}){return Ll(hf,{children:[Et(ff,{component:"div",sx:{fontSize:r,fontWeight:700,color:"#0f172a",lineHeight:1.4},children:e}),o,Ll(xf,{sx:{display:"flex",gap:2,justifyContent:"flex-end"},children:[Et(Al,{size:"medium",variant:"outlined",color:"inherit",onClick:s,fullWidth:!0,sx:{fontSize:i,minHeight:a,fontWeight:700},children:n}),Et(Al,{size:"medium",variant:"contained",color:"primary",onClick:d,fullWidth:!0,sx:{fontSize:i,minHeight:a,fontWeight:700},children:t})]})]})}function Ye({open:e,anchorEl:o,title:t="\uD655\uC778\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",content:n,confirmText:r="\uD655\uC778",cancelText:i="\uCDE8\uC18C",placement:a="top",minWidth:s=160,minHeight:d,titleFontSize:l=17,actionFontSize:u=16,actionMinHeight:p=44,zIndex:m=1300,onCancel:c,onConfirm:k}){let S=Re(),g=Et(gf,{title:t,content:n,confirmText:r,cancelText:i,titleFontSize:l,actionFontSize:u,actionMinHeight:p,onCancel:c,onConfirm:k});return S?Et(uf,{open:e,onClose:c,sx:{zIndex:m},slotProps:{paper:{sx:{p:3,display:"flex",flexDirection:"column",gap:3,minWidth:260}}},children:g}):Et(pf,{open:e,anchorEl:o,placement:a,sx:{zIndex:m},children:Et(mf,{onClickAway:c,children:Et(df,{elevation:4,sx:{p:3,display:"flex",flexDirection:"column",gap:3,minWidth:s,minHeight:d,justifyContent:d?"space-between":"flex-start"},onClick:h=>h.stopPropagation(),onMouseDown:h=>h.stopPropagation(),children:g})})})}import{useEffect as wf,useRef as Mf,useState as Vl}from"react";import{Box as ke,Button as Of,Checkbox as Ef,Tooltip as Qi}from"@mui/material";import Pf from"@mui/icons-material/AlarmOutlined";import Rf from"@mui/icons-material/CheckCircle";import zf from"@mui/icons-material/CheckCircleOutlineOutlined";import{useEffect as bf,useState as Nl}from"react";import{Avatar as Fl}from"@mui/material";import kf from"@mui/icons-material/PersonOutlineOutlined";import{jsx as Xi}from"react/jsx-runtime";var ji=new Set,Hl=e=>e.startsWith("data:")||e.startsWith("blob:");function Jo({src:e,avatarSx:o,iconFontSize:t=40}){let[n,r]=Nl(()=>e?Hl(e)||ji.has(e):!1),[i,a]=Nl(!1),s={position:"relative",overflow:"hidden",borderRadius:"15px"},d=o?[s,...Array.isArray(o)?o:[o]]:s;return bf(()=>{a(!1),r(e?Hl(e)||ji.has(e):!1)},[e]),!e||i?Xi(Fl,{sx:d,children:Xi(kf,{sx:{fontSize:t}})}):Xi(Fl,{src:e,imgProps:{onLoad:()=>{ji.add(e),r(!0)},onError:()=>a(!0),style:n?void 0:{opacity:0}},sx:d})}var Tf=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Er=(e,o)=>{if(!o||!o.trim())return[{text:e,highlight:!1}];try{let t=Tf(o.trim()),n=new RegExp(`(${t})`,"gi");return e.split(n).map(i=>i.toLowerCase()===o.trim().toLowerCase()?{text:i,highlight:!0}:{text:i,highlight:!1}).filter(i=>i.text)}catch{return[{text:e,highlight:!1}]}};var yf=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"];function Zo(e){let o=String(e??"").trim().slice(0,10);if(!/^\d{4}-\d{2}-\d{2}$/.test(o))return"";let t=new Date(`${o}T00:00:00`);return Number.isNaN(t.getTime())?"":`${o.slice(2).replaceAll("-",".")} (${yf[t.getDay()]})`}function mt(e){let o=String(e??"").trim(),[t,n=""]=o.split(" "),r=Zo(t);return r?n?`${r} ${n.slice(0,5)}`:r:""}import{Box as Wl,Tooltip as Sf}from"@mui/material";import{jsx as Pr}from"react/jsx-runtime";var Sn=[{bgcolor:"#dbe7ff",color:"#24408e"},{bgcolor:"#ffe4d6",color:"#8a4b21"},{bgcolor:"#dcf2e3",color:"#1f6b3a"},{bgcolor:"#f3e3f7",color:"#6d2f80"},{bgcolor:"#fdf0cf",color:"#8a6d1d"},{bgcolor:"#e0f0f6",color:"#1d5f78"},{bgcolor:"#efe6dc",color:"#6b4a2b"}];function ho({names:e,size:o=22,ringFirst:t=!1,avatarSrcByName:n}){let r=ne();return Pr(Wl,{sx:{display:"flex",alignItems:"center"},children:e.map((i,a)=>{let s=t&&a===0;return Pr(Sf,{title:s?`\uCC45\uC784\uC790 \xB7 ${i}`:i,arrow:!0,children:Pr(Wl,{sx:{ml:a===0?0:"-7px",zIndex:a,borderRadius:"50%",border:`2px solid ${s?r.avatar.ringColor:r.avatar.separatorColor}`,display:"inline-flex",...r.avatar.sx},children:Pr(Jo,{src:n?.get(i)??"",avatarSx:{width:o,height:o,fontSize:Math.round(o/2),borderRadius:"50%",...Sn[a%Sn.length]},iconFontSize:Math.round(o*.6)})})},`${i}-${a}`)})})}import{Box as $l,Button as Ul}from"@mui/material";import Bf from"@mui/icons-material/CheckCircle";import{Fragment as If,jsx as Qn,jsxs as Kl}from"react/jsx-runtime";function Cf(e){let o=e.mode==="dark";return{minWidth:0,width:"100%",px:1,py:.25,fontSize:13,color:e.table.rowColor,borderColor:e.colors.borderStrong,background:o?e.colors.surfaceHover:"linear-gradient(180deg, #ffffff 0%, #f6f7f9 100%)",whiteSpace:"nowrap","&:hover":{background:o?e.colors.surfaceSubtle:"linear-gradient(180deg, #fcfcfd 0%, #f0f2f4 100%)",borderColor:e.colors.borderStrong}}}function vf(e){return{minWidth:0,px:1.25,py:.25,fontSize:13,whiteSpace:"nowrap",color:e.actionButton.color,backgroundColor:e.actionButton.bg,backgroundImage:e.actionButton.bgImage,boxShadow:"none","&:hover":{backgroundColor:e.actionButton.hoverBg,backgroundImage:e.actionButton.hoverBgImage,boxShadow:"none"},...e.actionButton.sx}}function Bn({onClick:e,children:o,fullWidth:t=!1,sx:n}){let r=ne();return Qn(Ul,{size:"small",variant:"contained",color:"inherit",fullWidth:t,sx:[vf(r),...Array.isArray(n)?n:n?[n]:[]],onClick:i=>{i.stopPropagation(),e(i)},children:o})}function Cn({canConfirm:e,count:o,total:t,myConfirmed:n=!1,onConfirm:r,onShowList:i}){let a=ne(),s=Cf(a);return e?Qn(Bn,{onClick:()=>r(),children:"\uD655\uC778"}):Kl(Ul,{size:"small",variant:"outlined",color:"inherit",sx:s,onClick:d=>{d.stopPropagation(),i(d.currentTarget)},children:[n?Qn(Bf,{sx:{fontSize:16,color:"#2f80ed",flexShrink:0}}):null,Qn($l,{component:"span",sx:{flex:1,textAlign:"center",minWidth:0},children:t>0&&o>=t?"\uC644\uB8CC":Kl(If,{children:[o,Qn($l,{component:"span",sx:{mx:.15},children:"/"}),t]})})]})}import{SvgIcon as _f}from"@mui/material";import{jsx as Rr,jsxs as Df}from"react/jsx-runtime";function vn({sx:e,...o}){return Df(_f,{viewBox:"0 0 48 48",...o,sx:{fill:"none",...e},children:[Rr("path",{d:"M24,6C13.23,6,4.5,12.93,4.5,21.46c0,5.39,3.5,10.13,8.79,12.89l-1.76,7.06a.46.46,0,0,0,.68.51L21,36.7a24,24,0,0,0,3,.2c10.77,0,19.5-6.91,19.5-15.44S34.77,6,24,6Z",fill:"none",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}),Rr("circle",{cx:"23.91",cy:"21.46",r:"2.71",fill:"currentColor",stroke:"none"}),Rr("circle",{cx:"33.65",cy:"21.46",r:"2.71",fill:"currentColor",stroke:"none"}),Rr("circle",{cx:"14.18",cy:"21.46",r:"2.71",fill:"currentColor",stroke:"none"})]})}import{Fragment as Zi,jsx as G,jsxs as In}from"react/jsx-runtime";function Gl(e){let o=String(e??"").trim();return o?o.slice(2,10).replaceAll("-","."):"-"}function Ji(e,o){let t=String(e??"").trim()||"-";return Er(t,o).map((n,r)=>G("span",{className:n.highlight?"font-semibold text-blue-600":void 0,children:n.text},`${n.text}-${r}`))}function zr({names:e,searchText:o,avatarSrcByName:t,emphasize:n=!1}){let r=e.filter(i=>i.trim());if(r.length===0)return null;if(r.length===1){let i=r[0]??"";return In(Zi,{children:[G(Jo,{src:t?.get(i)??"",avatarSx:{width:24,height:24,borderRadius:"50%",...Sn[0]},iconFontSize:15}),G(ke,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...n?{fontWeight:500,color:"#2f80ed"}:{}},children:Ji(i,o)})]})}return G(ho,{names:r,size:22,avatarSrcByName:t})}function Yl({display:e,summary:o,searchText:t,avatarSrcByName:n}){if(!e||e.kind==="everyone")return G(ke,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o||"\uBAA8\uB4E0 \uC9C1\uC6D0"});let{teamNames:r,individualNames:i}=e;if(r.length===0)return G(zr,{names:i,searchText:t,avatarSrcByName:n});let a=[...r,...i],s=a.join(", ");return a.length>2?G(Qi,{title:s,arrow:!0,children:G(ke,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:`${a[0]}, ${a[1]} \uC678 ${a.length-2}\uBA85`})}):G(Qi,{title:s,arrow:!0,children:In(ke,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0},children:[G(ke,{component:"span",sx:{flexShrink:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:r.join(", ")+(i.length>0?",":"")}),i.length>0?G(zr,{names:i,searchText:t,avatarSrcByName:n}):null]})})}function jl({task:e,statusOptions:o,avatarSrcByName:t,searchText:n,myAccountSeq:r=0,todayStr:i,showProject:a=!1,showManager:s=!0,showActions:d=!0,showRequest:l=!0,confirmMode:u="none",bugMode:p=!1,confirmInfo:m,onConfirmTask:c,projectLabel:k="",projectIcon:S="",onProjectClick:g,onRequestToggleCompleted:h,onDateClick:b,onChangeNote:w,onMemberClick:y,onClaimClick:v,onVolunteerClick:f,onStatusClick:x,onOpenDetail:I,onTaskContextMenu:W,hideBottomBorder:_=!1,completeLocked:K=!1,unread:B=!1,notice:T=!1,noticeReadOnly:L=!1,noteLocked:$=!1,targetSummary:J="",targetDisplay:R,onArchiveTask:ie,ackInfo:re,onAckConfirm:Ce,onAckListClick:xe,onPriorityClick:Fe}){let[oe,le]=Vl(!1),[ge,q]=Vl(""),U=Mf(null);wf(()=>{if(!oe)return;let A=V=>{let Ve=U.current;Ve&&(V.target instanceof Node&&Ve.contains(V.target)||Ve.blur())};return document.addEventListener("mousedown",A,!0),document.addEventListener("touchstart",A,!0),()=>{document.removeEventListener("mousedown",A,!0),document.removeEventListener("touchstart",A,!0)}},[oe]);let j=[e.manager_account_seq??0,...e.receiver_account_seqs??[]].some(A=>A>0&&A!==(e.author_account_seq??0)),E=L,H=r>0&&!e.is_notice&&!e.is_event&&(e.manager_account_seq??0)===r,D=E||!!e.is_notice,N=ne(),ce=!!v&&wr(e,r),M=!!f&&Mr(e,r),ae=D&&!Rl(e),me=e.is_notice?G(Cn,{canConfirm:!!re?.canAck,count:re?.count??0,total:re?.total??0,myConfirmed:!!re?.acked,onConfirm:()=>Ce?.(e),onShowList:A=>xe?.(e,A)}):null,Oe=!e.is_notice&&!!e.due_date&&e.due_date.slice(0,10)<=i?"#e5484d":"#2f80ed";return In(ke,{onContextMenu:A=>W(e,A),sx:{display:"grid",gridTemplateColumns:Or({showProject:a,showManager:s,showActions:d,showRequest:l,notice:T,confirmMode:u,bug:p}),minHeight:48,fontSize:15,bgcolor:N.table.rowBg,color:N.table.rowColor,borderBottom:_?"none":`1px solid ${N.table.rowBorderColor}`,"&:hover":{bgcolor:N.table.rowHoverBg},"& > .cell":{px:1,minWidth:0,display:"flex",alignItems:"center",borderRight:`1px solid ${N.table.rowBorderColor}`},"& > .cell:first-of-type":{px:0,borderRight:"none"},"& > .cell:nth-of-type(2)":{pl:1.5,pr:2},"& > .cell:last-child":{borderRight:"none",pr:2}},children:[G(ke,{className:"cell",children:H?G(ke,{sx:{width:3,alignSelf:"stretch",my:.5,ml:.5,bgcolor:"#2f80ed",borderRadius:1.5}}):null}),G(ke,{className:"cell",sx:{justifyContent:"center"},children:!E&&!K?G(Qi,{title:e.completed&&e.completed_by?`${e.completed_by} \xB7 ${mt(e.completed_time)} \uC644\uB8CC`:e.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC",arrow:!0,enterDelay:300,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:G(Ef,{checked:e.completed,icon:G(zf,{sx:{fontSize:20,color:"#9a9a97",opacity:.45}}),checkedIcon:G(Rf,{sx:{fontSize:20,color:"#2f80ed"}}),onClick:A=>A.stopPropagation(),onChange:(A,V)=>h({anchorEl:A.currentTarget,task:e,nextCompleted:V}),sx:{p:.5}})}):null}),p?G(ke,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",fontVariantNumeric:"tabular-nums",color:"#37352f"},children:e.ticket_no||"-"}):null,In(ke,{className:"cell",onClick:()=>I(e),sx:{gap:1,cursor:"pointer","&:hover":{bgcolor:N.table.cellHoverBg}},children:[(()=>{let A=He(e.icon||(e.is_notice?xo:Me));if(!A)return null;let V=e.icon_color||(e.is_notice?"#e5484d":"#1e3a8a");return G(A,{sx:{fontSize:18,flexShrink:0,color:V}})})(),G(ke,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:e.completed?400:N.table.rowTitleFontWeight,color:e.completed?N.colors.textMuted:N.table.rowTitleColor,textDecoration:e.completed?"line-through":"none"},children:Ji(e.title,n)}),(e.comment_count??e.comments?.length??0)>0?G(vn,{sx:{fontSize:16,flexShrink:0,color:"#9a9a97"}}):null,G(ke,{sx:{flexShrink:0,display:"flex",alignItems:"center"},children:G(Ot,{labelKeys:e.label_keys??[],labelOptions:o})}),B?G(ke,{component:"span",sx:{flexShrink:0,px:.55,fontSize:10.5,fontWeight:700,lineHeight:1.6,color:"#fff",bgcolor:"#e5484d",borderRadius:"4px"},children:"N"}):null,Br(e)&&!e.archived&&!E&&ie?G(Of,{size:"small",variant:"outlined",color:"inherit",sx:{ml:"auto",flexShrink:0,minWidth:0,px:1.25,py:.25,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},onClick:A=>{A.stopPropagation(),ie(e)},children:"\uBCF4\uAD00"}):null]}),(()=>{let A=E||!!e.is_event||!!e.completed;return G(ke,{className:"cell",onClick:A?void 0:V=>x(e,V.currentTarget),sx:{py:.5,justifyContent:"center",...A?{}:{cursor:"pointer","&:hover":{bgcolor:N.table.cellHoverBg}}},children:e.is_event?(()=>{let V=jn(e);return V?G(Ee,{option:V}):null})():G(Ee,{option:go(e)})})})(),G(ke,{className:"cell",onClick:E?void 0:A=>b(e,"start_date",A.currentTarget),sx:{justifyContent:"center",whiteSpace:"nowrap",...E?{}:{cursor:"pointer","&:hover":{bgcolor:N.table.cellHoverBg}}},children:Gl(e.start_date)}),G(ke,{className:"cell",onClick:E?void 0:A=>b(e,"due_date",A.currentTarget),sx:{justifyContent:"center",gap:.5,color:Oe,fontWeight:500,whiteSpace:"nowrap",...E?{}:{cursor:"pointer","&:hover":{bgcolor:N.table.cellHoverBg}}},children:e.due_date?In(Zi,{children:[Gl(e.due_date),G(Pf,{sx:{fontSize:15}})]}):null}),T?G(ke,{className:"cell",onClick:E?void 0:()=>y(e,"targets"),sx:{gap:.75,...E?{}:{cursor:"pointer","&:hover":{bgcolor:N.table.cellHoverBg}}},children:G(Yl,{display:R,summary:J,searchText:n,avatarSrcByName:t})}):null,!T&&e.is_notice?G(ke,{className:"cell",onClick:E?void 0:()=>y(e,"targets"),sx:{gridColumn:s?"span 2":"auto",gap:.75,...E?{}:{cursor:"pointer","&:hover":{bgcolor:N.table.cellHoverBg}}},children:G(Yl,{display:R,summary:J,searchText:n,avatarSrcByName:t})}):null,!T&&!e.is_notice&&!e.is_event&&s?G(ke,{className:"cell",onClick:ae?void 0:()=>y(e,"manager"),sx:{gap:.75,...ce||M?{justifyContent:"center"}:{},...ae?{}:{cursor:"pointer","&:hover":{bgcolor:N.table.cellHoverBg}}},children:ce?G(Bn,{onClick:A=>v?.(e,A.currentTarget),children:"\uAC00\uC838\uAC00\uAE30"}):M?G(Bn,{onClick:A=>f?.(e,A.currentTarget),children:"\uAC00\uC838\uAC00\uAE30"}):G(zr,{names:e.manager_name?[e.manager_name]:[],searchText:n,avatarSrcByName:t,emphasize:H})}):null,!T&&!e.is_notice?G(ke,{className:"cell",onClick:D?void 0:()=>y(e,"receivers"),sx:{gridColumn:e.is_event&&s?"span 2":"auto",gap:.75,...D?{}:{cursor:"pointer","&:hover":{bgcolor:N.table.cellHoverBg}}},children:G(zr,{names:e.receiver_names,searchText:n,avatarSrcByName:t})}):null,G(ke,{className:"cell",onClick:E?void 0:A=>Fe?.(e,A.currentTarget),sx:{py:.5,justifyContent:"center",...E?{}:{cursor:"pointer","&:hover":{bgcolor:N.table.cellHoverBg}}},children:G(No,{priority:e.priority,plain:!0})}),a?G(ke,{className:"cell",onClick:E?void 0:A=>g?.(e,A.currentTarget),sx:{gap:.5,justifyContent:"flex-start",...E?{}:{cursor:"pointer","&:hover":{bgcolor:N.table.cellHoverBg}}},children:k?In(Zi,{children:[(()=>{let A=He(S);return A?G(A,{sx:{fontSize:15,flexShrink:0,color:"#1e3a8a"}}):null})(),G(ke,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:k})]}):null}):null,T?G(ke,{className:"cell",sx:{justifyContent:"center"},children:me}):null,!T&&d&&l?G(ke,{className:"cell",sx:{justifyContent:"center"},children:e.is_notice?me:j?G(Cn,{canConfirm:!!m?.canConfirm,count:m?.count??0,total:m?.total??0,myConfirmed:!!m?.myTime,onConfirm:()=>c?.(e),onShowList:A=>xe?.(e,A)}):null}):null,!T&&u==="action"?G(ke,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",color:N.table.rowSubColor},children:e.is_notice?me:m&&m.total>0?G(Cn,{canConfirm:!!m.canConfirm,count:m.count,total:m.total,myConfirmed:!!m.myTime,onConfirm:()=>c?.(e),onShowList:A=>xe?.(e,A)}):"-"}):null,!T&&!d?G(ke,{className:"cell",sx:{justifyContent:"center",whiteSpace:"nowrap",color:N.table.rowSubColor},children:e.completed_time||"-"}):null,p?null:G(ke,{className:"cell",onClick:()=>{!$&&!oe&&(q(e.note),le(!0))},sx:{color:"#6f6f6c",cursor:$?"default":"text"},children:oe?G(ke,{component:"input",ref:U,autoFocus:!0,spellCheck:!1,value:ge,onChange:A=>q(A.target.value),onBlur:()=>{le(!1),ge.trim()!==e.note&&w(e.seq,ge)},onKeyDown:A=>{A.key==="Enter"&&A.target.blur(),A.key==="Escape"&&(q(e.note),le(!1))},sx:{flex:1,minWidth:0,width:"100%",border:"none",outline:"none",bgcolor:"transparent",font:"inherit",lineHeight:"inherit",letterSpacing:"inherit",color:N.table.rowTitleColor,caretColor:N.table.rowTitleColor,p:0,m:0}}):G(ke,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.note?Ji(e.note,n):""})})]})}import{useState as qf}from"react";import{Box as Jn,Button as Xl,ButtonBase as Af,Dialog as Lf,Divider as Ql,Menu as Nf,MenuItem as Ff,Popover as Hf}from"@mui/material";import Wf from"@mui/icons-material/ChevronRight";import $f from"@mui/icons-material/Check";import Kf from"@mui/icons-material/NotificationsActiveOutlined";import{SimpleCalendar as Uf}from"@ehfuse/mui-datetime-picker";import{Fragment as Yf,jsx as Mo,jsxs as Jt}from"react/jsx-runtime";var Vf=[{value:"min30_before",label:"30\uBD84 \uC804"},{value:"hour1_before",label:"1\uC2DC\uAC04 \uC804"},{value:"hour2_before",label:"2\uC2DC\uAC04 \uC804"}],Jl=[{value:"day_before",label:"1\uC77C \uC804"},{value:"two_days_before",label:"2\uC77C \uC804"},{value:"three_days_before",label:"3\uC77C \uC804"},{value:"week_before",label:"1\uC8FC\uC77C \uC804"}],Zl=[{value:"none",label:"\uC5C6\uC74C"},...Vf,...Jl];function ea(e){return e?Zl:[{value:"none",label:"\uC5C6\uC74C"},...Jl]}function oa(e){return e==="same_day"?"\uB2F9\uC77C":Zl.find(o=>o.value===e)?.label??"\uC5C6\uC74C"}function Gf(e){let o=e?new Date(`${e}T00:00:00`):new Date;return Number.isNaN(o.getTime())?new Date:o}function Pt({anchorEl:e,open:o,date:t,reminder:n,hideReminder:r=!1,centered:i=!1,onClose:a,onDateChange:s,onReminderChange:d}){let[l,u]=qf(null),p=Qo(),m=Jt(Jn,{sx:{width:300,maxWidth:"100%"},children:[Mo(Jn,{sx:{height:320},children:Mo(Uf,{selectedDate:Gf(t),onSelect:c=>{s(Ae(c)),a()},onClose:a,showFooter:!1,autoApply:!0})}),r?null:Jt(Yf,{children:[Mo(Ql,{sx:{borderColor:"#e6e6e3"}}),Jt(Af,{onClick:c=>u(c.currentTarget),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",px:2,py:1.25,fontSize:14,"&:hover":{bgcolor:"#f8f8f7"}},children:[Jt(Jn,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75,color:"#37352f"},children:[Mo(Kf,{sx:{fontSize:17,color:"#9a9a97"}}),"\uB9AC\uB9C8\uC778\uB354"]}),Jt(Jn,{component:"span",sx:{display:"inline-flex",alignItems:"center",color:"#37352f"},children:[oa(n),Mo(Wf,{sx:{fontSize:18,ml:.25,color:"#9a9a97"}})]})]}),Mo(Nf,{transitionDuration:0,anchorEl:l,open:!!l,onClose:()=>u(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...p,children:ea(!1).map(c=>Jt(Ff,{selected:c.value===n,onClick:()=>{d(c.value),u(null)},sx:{fontSize:14,minWidth:120,justifyContent:"space-between",gap:1},children:[c.label,c.value===n?Mo($f,{sx:{fontSize:16,color:"#2f80ed"}}):null]},c.value))})]}),Mo(Ql,{sx:{borderColor:"#e6e6e3"}}),Jt(Jn,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:1,py:.5},children:[Mo(Xl,{size:"small",onClick:()=>{s(Ae(new Date)),a()},sx:{minWidth:0,px:1.25,fontSize:13.5,color:"#2563eb"},children:"\uC624\uB298"}),Mo(Xl,{size:"small",onClick:a,sx:{minWidth:0,px:1.25,fontSize:13.5,color:"#2563eb"},children:"\uB2EB\uAE30"})]})]});return i?Mo(Lf,{open:o,onClose:a,slotProps:{paper:{sx:{borderRadius:3,width:300,maxWidth:"calc(100vw - 48px)",overflow:"hidden"}}},children:m}):Mo(Hf,{transitionDuration:0,open:o,anchorEl:e,onClose:a,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{borderRadius:2,boxShadow:"0 8px 24px rgba(0,0,0,0.14)"}}},children:m})}import{useEffect as Qf,useState as na}from"react";import{Box as Zt,Button as Jf,Switch as Zf}from"@mui/material";import{FormDialog as ex}from"@ehfuse/mui-form-dialog";import{ClearTextField as ox}from"@ehfuse/mui-form-controls";import{ErrorAlert as tx}from"@ehfuse/alerts";import{Box as jf,ButtonBase as Xf}from"@mui/material";import{jsx as ta}from"react/jsx-runtime";function qr({value:e,onChange:o}){return ta(jf,{sx:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(40px, 1fr))",gap:1},children:wi.map(({key:t,Icon:n})=>{let r=t===e;return ta(Xf,{onClick:()=>o(t),sx:{display:"flex",alignItems:"center",justifyContent:"center",height:40,minWidth:40,borderRadius:1,border:r?"2px solid #2563eb":"1px solid #dedddb",bgcolor:r?"#eef4ff":"#fff",color:r?"#1e3a8a":"#787774","&:hover":{bgcolor:r?"#eef4ff":"#f4f4f2"}},children:ta(n,{sx:{fontSize:20}})},t)})})}import{jsx as ut,jsxs as ra}from"react/jsx-runtime";function Ar({open:e,title:o="\uC0C8 \uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00",initialLabel:t="",initialIcon:n=Di,confirmText:r="\uCD94\uAC00",initialUseSprints:i=!1,onClose:a,onSubmit:s}){let[d,l]=na(""),[u,p]=na(Di),[m,c]=na(!1);Qf(()=>{e&&(l(t),p(n),c(i))},[e]);let k=()=>{let g=d.trim();if(!g){tx("\uD504\uB85C\uC81D\uD2B8 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}s(g,u,m),a()};return ut(ex,{open:e,onClose:a,maxWidth:"xs",title:o,locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-add-tab",sections:[{id:"add-tab",showTitle:!1,children:ra(Zt,{children:[ut(ox,{label:"\uD504\uB85C\uC81D\uD2B8 \uC774\uB984",value:d,onChange:g=>l(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),k())},fullWidth:!0,autoFocus:!0,sx:{mt:.5}}),ut(Zt,{sx:{mt:2,fontSize:13,color:"#787774"},children:"\uC544\uC774\uCF58"}),ut(Zt,{sx:{mt:1,maxHeight:264,overflowY:"auto",pr:.5},children:ut(qr,{value:u,onChange:p})}),ra(Zt,{sx:{mt:2,display:"flex",alignItems:"center",justifyContent:"space-between",gap:1},children:[ra(Zt,{children:[ut(Zt,{sx:{fontSize:14,color:"#37352f"},children:"\uBAA9\uD45C(\uC2A4\uD504\uB9B0\uD2B8) \uC0AC\uC6A9"}),ut(Zt,{sx:{fontSize:12.5,color:"#9a9a97"},children:"\uBAA9\uD45C \uBC30\uC815\uC73C\uB85C \uBC18\uBCF5 \uC8FC\uAE30\uB97C \uAD00\uB9AC\uD569\uB2C8\uB2E4(\uAC1C\uBC1C\uD300\uC6A9)"})]}),ut(Zf,{checked:m,onChange:(g,h)=>c(h)})]})]})}],actions:{showCancelButton:!0,right:ut(Jf,{variant:"contained",onClick:k,children:r})}})}import{jsx as pe,jsxs as et}from"react/jsx-runtime";function xx(e){let o=e?new Date(`${e}T00:00:00`):new Date;return Number.isNaN(o.getTime())?new Date:o}function rs({tasks:e,statusOptions:o,avatarSrcByName:t,searchText:n,todayStr:r,sortBy:i,sortDirection:a,onSort:s,onRequestReply:d,onToggleCompleted:l,onChangeTaskDate:u,onChangeTaskReminder:p,groupBy:m,collapsedGroupKeys:c,customTabs:k,onToggleGroup:S,hideCompleted:g=!1,onAddInGroup:h,canAddInGroup:b,renderGroupSummary:w,renderGroupTitleSummary:y,onChangeTaskProject:v,onAddProject:f,onChangeNote:x,onMemberClick:I,onClaimTask:W,onChangeTaskStatus:_,onOpenDetail:K,onTaskContextMenu:B,onMemberFilterClick:T,activeMemberFilters:L=[],onStatusFilterClick:$,statusFilterActive:J=!1,onAckFilterClick:R,ackFilterActive:ie=!1,onProjectFilterClick:re,projectFilterActive:Ce=!1,onPriorityFilterClick:xe,priorityFilterActive:Fe=!1,columns:oe,getConfirmInfo:le,onConfirmTask:ge,myAccountSeq:q=0,currentUserName:U="",groupManagerByMyRole:j=!1,allowManagerVolunteer:E=!0,noticeAdmin:H=!1,getTargetSummary:D,getTargetDisplay:N,onArchiveTask:ce,isTaskUnread:M,getAckInfo:ae,onAckConfirm:me,onAckListClick:he,onChangeTaskPriority:Oe,onEndReached:A}){let V=ne(),Ve=en(()=>({showManager:!0,showActions:!0,showRequest:!0,...oe}),[oe]),no=Ve.showManager??!0,Yo=Ve.showActions??!0,Dt=Ve.showRequest??!0,Ut=Ve.confirmMode??"none",at=Ve.notice??!1,Ao=Ve.bug??!1,wt=m!=="none",Vt=en(()=>wt?Ki(e,m,r,k,o,U,{enabled:j,myAccountSeq:q}):[],[wt,e,m,r,k,o,U,j,q]),Lo=en(()=>g?Vt.map(C=>({section:C,visibleTasks:C.tasks.filter(ee=>!ee.completed)})).filter(C=>C.visibleTasks.length>0):Vt.map(C=>({section:C,visibleTasks:C.tasks})),[Vt,g]),Mt=en(()=>g?e.filter(C=>!C.completed):e,[e,g]),Gt=en(()=>new Set(c),[c]),Co=Ve.showProject??(!at&&m!=="tab"),Yt=en(()=>Yi({...Ve,showProject:Co}),[Ve,Co]),we=Or({...Ve,showProject:Co}),O=en(()=>{let C=new Map;for(let ee of k)C.set(ee.key,{label:ee.archived?`${ee.label} (\uBCF4\uAD00\uB428)`:ee.label,icon:ee.icon});return C},[k]),F=nx(null),[X,Z]=pt(null),be=e.length>0;es(()=>{if(!be){Z(null);return}let C=window.requestAnimationFrame(()=>{Z(F.current?.getScrollContainer()??null)});return()=>window.cancelAnimationFrame(C)},[be]);let[_e,eo]=pt(!1);es(()=>{if(!X)return;let C=()=>eo(X.scrollHeight>X.clientHeight);C();let ee=new ResizeObserver(C);return ee.observe(X),X.firstElementChild&&ee.observe(X.firstElementChild),()=>ee.disconnect()},[X]);let[ue,Ge]=pt(null),[Se,Qe]=pt(null),[jo,Do]=pt(null),[oo,Xo]=pt(null),[vo,P]=pt(!1),[Fn,sl]=pt(null),Hn=Fn?e.find(C=>C.seq===Fn.taskSeq)??null:null,[hr,vi]=pt(null),br=hr?e.find(C=>C.seq===hr.taskSeq)??null:null,cl=dt((C,ee)=>{vi({anchorEl:ee,taskSeq:C.seq})},[]),ml=dt((C,ee)=>{sl({anchorEl:ee,taskSeq:C.seq})},[]),Mm=dt((C,ee)=>{if(!ee)return;s(C,i===C&&a==="asc"?"desc":"asc")},[s,i,a]),ul=dt((C,ee,ve)=>{Ge({anchorEl:ve,taskSeq:C.seq,field:ee,date:C[ee],reminder:C.reminder,completed:C.completed})},[]),dl=dt((C,ee)=>{Xo({anchorEl:ee,task:C})},[]),Om=dt(C=>{ue&&(u(ue.taskSeq,ue.field,Ae(C)),Ge(null))},[ue,u]),Em=dt(C=>{ue&&(u(ue.taskSeq,ue.field,C),Ge(ee=>ee&&{...ee,date:C}))},[ue,u]),Pm=dt(C=>{ue&&(p(ue.taskSeq,C),Ge(ee=>ee&&{...ee,reminder:C}))},[ue,p]),pl=dt((C,ee=!1)=>pe(jl,{hideBottomBorder:ee,task:C,statusOptions:o,avatarSrcByName:t,searchText:n,myAccountSeq:q,todayStr:r,showProject:Co,showManager:no,showActions:Yo,showRequest:Dt,confirmMode:Ut,confirmInfo:C.is_notice?void 0:le?.(C),onConfirmTask:ge,projectLabel:O.get(C.tab_key??"")?.label??"",projectIcon:O.get(C.tab_key??"")?.icon??"",onProjectClick:dl,onRequestReply:d,onRequestToggleCompleted:Qe,onDateClick:ul,onChangeNote:x,onMemberClick:I,onClaimClick:W?(ve,wo)=>Do({anchorEl:wo,taskSeq:ve.seq,title:ve.title,kind:"claim"}):void 0,onVolunteerClick:E?(ve,wo)=>Do({anchorEl:wo,taskSeq:ve.seq,title:ve.title,kind:"volunteer"}):void 0,onStatusClick:ml,onOpenDetail:K,onTaskContextMenu:B,notice:at,bugMode:Ao,noticeReadOnly:!ct(C,q),noteLocked:C.is_notice?!Dr(C,q):!ct(C,q),completeLocked:C.is_event?!0:C.is_notice?(C.author_account_seq??0)!==q:(C.author_account_seq??0)!==q&&(C.manager_account_seq??0)!==q,targetSummary:C.is_notice?D?.(C):void 0,targetDisplay:C.is_notice?N?.(C):void 0,onArchiveTask:ce,unread:M?.(C)??!1,ackInfo:C.is_notice?ae?.(C):void 0,onAckConfirm:me,onAckListClick:he,onPriorityClick:cl},C.seq),[n,o,t,r,Co,no,Yo,Dt,Ut,le,ge,at,Ao,q,H,D,N,ce,M,ae,me,he,cl,O,dl,d,ul,x,I,W,ml,K,B]);return et(Fo,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${V.table.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden",bgcolor:V.table.bg,color:V.table.rowColor,...V.table.sx},children:[pe(Fo,{sx:{display:"grid",gridTemplateColumns:we,borderBottom:`1px solid ${V.table.borderColor}`,flexShrink:0,bgcolor:V.table.headerBg,"& > *":{borderRight:`1px solid ${V.table.rowBorderColor}`},"& > *:first-of-type":{px:0,borderRight:"none"},"& > *:nth-of-type(2)":{pl:1.5,pr:2},"& > *:last-child":{borderRight:"none",pr:2},...V.table.headerSx},children:Yt.map(C=>{let ee=i===C.id,ve=!!C.memberFilter,wo=ve&&L.includes(C.memberFilter),Wn=ve||!!C.statusFilter||!!C.ackFilter||!!C.projectFilter||!!C.priorityFilter,kr=wo||!!C.statusFilter&&J||!!C.ackFilter&&ie||!!C.projectFilter&&Ce||!!C.priorityFilter&&Fe;return et(Fo,{onClick:lt=>{C.memberFilter?T(C.memberFilter,lt.currentTarget):C.statusFilter?$(lt.currentTarget):C.ackFilter?R?.(lt.currentTarget):C.projectFilter?re?.(lt.currentTarget):C.priorityFilter?xe?.(lt.currentTarget):Mm(C.id,C.sortable)},sx:{display:"flex",alignItems:"center",justifyContent:C.align==="center"?"center":"flex-start",gap:.5,px:1,py:1,minWidth:0,fontSize:V.table.headerFontSize,color:C.sortable||Wn?V.table.headerActiveColor:V.table.headerColor,whiteSpace:"nowrap",cursor:C.sortable||Wn?"pointer":"default",userSelect:"none",...ee?{color:V.table.headerFilteredColor}:{},...kr?{color:V.table.headerFilteredColor,fontWeight:600}:{}},children:[C.icon,C.label,kr?pe(ux,{sx:{fontSize:14}}):null,ee?a==="asc"?pe(lx,{sx:{fontSize:13}}):pe(sx,{sx:{fontSize:13}}):null]},C.id)})}),Mt.length===0?pe(Fo,{sx:{py:8,textAlign:"center",color:V.table.emptyColor,fontSize:14},children:Ao?"\uB4F1\uB85D\uB41C \uC624\uB958\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.":at?"\uB4F1\uB85D\uB41C \uACF5\uC9C0\uC0AC\uD56D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.":"\uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):pe(Fo,{sx:{flex:1,minHeight:0},children:pe(px,{ref:F,style:{height:"100%"},thumb:{width:8},children:X?wt?pe(ns,{customScrollParent:X,data:Lo,computeItemKey:(C,ee)=>ee.section.key,itemContent:(C,ee)=>{let{section:ve,visibleTasks:wo}=ee,Wn=Gt.has(ve.key),kr=C===Lo.length-1;return et(Fo,{children:[et(Fo,{onClick:()=>S(ve.key),sx:{display:"flex",alignItems:"center",gap:.5,px:1.5,minHeight:V.table.groupHeader.minHeight,bgcolor:V.table.groupHeader.bg,borderBottom:`1px solid ${V.table.groupHeader.borderColor}`,cursor:"pointer",userSelect:"none","&:hover":{bgcolor:V.table.groupHeader.hoverBg},...V.table.groupHeader.sx},children:[Wn?pe(mx,{sx:{fontSize:20,color:V.colors.textMuted}}):pe(cx,{sx:{fontSize:20,color:V.colors.textMuted}}),pe(Fo,{component:"span",sx:{fontSize:V.table.groupHeader.labelFontSize,fontWeight:V.table.groupHeader.labelFontWeight,color:V.table.groupHeader.labelColor},children:ve.label}),y?pe(Fo,{sx:{flexShrink:0,display:"flex",alignItems:"center",ml:.5},children:y(ve.key,ve.tasks)}):null,h&&(!b||b(ve.key))?pe(ix,{size:"small","aria-label":"\uC774 \uADF8\uB8F9\uC5D0 \uC5C5\uBB34 \uB4F1\uB85D",onClick:lt=>{lt.stopPropagation(),h(ve.key,ve.tasks)},sx:{flexShrink:0,ml:.75,p:.25,color:V.colors.textSecondary,"&:hover":{bgcolor:V.colors.surfaceHover,color:V.colors.accentOnSurface}},children:pe(ts,{sx:{fontSize:21}})}):null,et(Fo,{sx:{ml:"auto",minWidth:0,display:"flex",alignItems:"center",gap:1,pr:.5},children:[w?w(ve.key,ve.tasks):null,pe(Fo,{component:"span",sx:{flexShrink:0,width:V.table.groupHeader.badge.width,py:V.table.groupHeader.badge.paddingY,borderRadius:`${V.table.groupHeader.badge.borderRadius}px`,bgcolor:V.table.groupHeader.badge.bg,border:V.table.groupHeader.badge.border,color:V.table.groupHeader.badge.color,fontSize:V.table.groupHeader.badge.fontSize,fontWeight:V.table.groupHeader.badge.fontWeight,lineHeight:1.6,textAlign:"center",fontVariantNumeric:"tabular-nums"},children:wo.length})]})]}),Wn?null:wo.map((lt,Rm)=>pl(lt,kr&&Rm===wo.length-1&&_e))]})}}):pe(ns,{customScrollParent:X,data:Mt,computeItemKey:(C,ee)=>ee.seq,endReached:A,itemContent:(C,ee)=>pl(ee,C===Mt.length-1&&_e)}):null})}),pe(_r,{anchorEl:Fn?.anchorEl??null,value:Hn?.status??"",options:Hn?El(Hn):Yn,onSelect:C=>{Hn&&_(Hn.seq,C)},onClose:()=>sl(null)}),pe(os,{transitionDuration:0,anchorEl:hr?.anchorEl??null,open:!!hr,onClose:()=>vi(null),children:["high","medium","low"].map(C=>et(Lr,{selected:br?.priority===C,onClick:()=>{br&&Oe?.(br.seq,C),vi(null)},sx:{fontSize:14,minWidth:130,gap:1},children:[pe(No,{priority:C,small:!0}),br?.priority===C?pe(ia,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},C))}),et(os,{anchorEl:oo?.anchorEl??null,open:!!oo,onClose:()=>Xo(null),transitionDuration:0,children:[et(Lr,{selected:!oo?.task.tab_key,onClick:()=>{oo&&v(oo.task.seq,""),Xo(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[pe(dx,{sx:{fontSize:17,color:"#9a9a97"}}),"\uC5C6\uC74C",oo?.task.tab_key?null:pe(ia,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}})]}),k.filter(C=>!C.archived).map(C=>{let ee=He(C.icon),ve=oo?.task.tab_key===C.key;return et(Lr,{selected:ve,onClick:()=>{oo&&v(oo.task.seq,C.key),Xo(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[ee?pe(ee,{sx:{fontSize:17,color:"#1e3a8a"}}):null,C.label,ve?pe(ia,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},C.key)}),f?[pe(rx,{},"add-project-divider"),et(Lr,{onClick:()=>P(!0),sx:{fontSize:14,color:"#787774"},children:[pe(ax,{children:pe(ts,{sx:{fontSize:18,color:"#787774"}})}),"\uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00"]},"add-project")]:null]}),f?pe(Ar,{open:vo,onClose:()=>P(!1),onSubmit:(C,ee)=>{let ve=oo?.task.seq??0;(async()=>{let wo=await f(C,ee);wo&&ve&&v(ve,wo)})(),Xo(null)}}):null,pe(fx,{anchorEl:ue?.anchorEl??null,open:!!ue&&ue?.field==="start_date",onClose:()=>Ge(null),selectedDate:xx(ue?.date??""),onDateChange:Om}),pe(Pt,{anchorEl:ue?.anchorEl??null,open:!!ue&&ue?.field==="due_date",date:ue?.date??"",reminder:ue?.reminder??"none",hideReminder:!!ue?.completed,onClose:()=>Ge(null),onDateChange:Em,onReminderChange:Pm}),pe(Ye,{open:!!jo,anchorEl:jo?.anchorEl??null,title:jo?.kind==="claim"?"\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:()=>Do(null),onConfirm:()=>{jo&&W?.(jo.taskSeq),Do(null)}}),pe(Ye,{open:!!Se,anchorEl:Se?.anchorEl??null,title:Se?.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:Se?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>Qe(null),onConfirm:()=>{Se&&l(Se.task,Se.nextCompleted),Qe(null)}})]})}import{useCallback as ot,useMemo as xt,useRef as zx,useState as gt}from"react";import{Box as Ie,ButtonBase as ks,Divider as cs,IconButton as ms,Menu as us,MenuItem as zt}from"@mui/material";import ca from"@mui/icons-material/Add";import ds from"@mui/icons-material/MoreVert";import ps from"@mui/icons-material/EditOutlined";import fs from"@mui/icons-material/ArchiveOutlined";import xs from"@mui/icons-material/UnarchiveOutlined";import qx from"@mui/icons-material/NotificationsOutlined";import Ax from"@mui/icons-material/PeopleAltOutlined";import{SvgIcon as gx}from"@mui/material";import{jsx as is}from"react/jsx-runtime";function ft({sx:e,...o}){return is(gx,{viewBox:"0 0 24 24",...o,sx:{fill:"none",...e},children:is("path",{d:"M4 6H20M16 6L15.7294 5.18807C15.4671 4.40125 15.3359 4.00784 15.0927 3.71698C14.8779 3.46013 14.6021 3.26132 14.2905 3.13878C13.9376 3 13.523 3 12.6936 3H11.3064C10.477 3 10.0624 3 9.70951 3.13878C9.39792 3.26132 9.12208 3.46013 8.90729 3.71698C8.66405 4.00784 8.53292 4.40125 8.27064 5.18807L8 6M18 6V16.2C18 17.8802 18 18.7202 17.673 19.362C17.3854 19.9265 16.9265 20.3854 16.362 20.673C15.7202 21 14.8802 21 13.2 21H10.8C9.11984 21 8.27976 21 7.63803 20.673C7.07354 20.3854 6.6146 19.9265 6.32698 19.362C6 18.7202 6 17.8802 6 16.2V6M14 10V17M10 10V17",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}import{DndContext as Lx,DragOverlay as Nx,PointerSensor as Fx,pointerWithin as Hx,rectIntersection as Wx,useDroppable as $x,useSensor as Kx,useSensors as Ux}from"@dnd-kit/core";import{SortableContext as Ts,arrayMove as gs,horizontalListSortingStrategy as Vx,useSortable as Gx,verticalListSortingStrategy as Yx}from"@dnd-kit/sortable";import{CSS as jx}from"@dnd-kit/utilities";import ma from"@ehfuse/overlay-scrollbar";import{useState as yx}from"react";import{Box as Rt,ButtonBase as Sx,Checkbox as Bx,Tooltip as Cx}from"@mui/material";import vx from"@mui/icons-material/AlarmOutlined";import Ix from"@mui/icons-material/TimerOutlined";import{Box as on,Button as hx,Popover as bx}from"@mui/material";import kx from"@mui/icons-material/CheckCircle";import{jsx as tn,jsxs as Nr}from"react/jsx-runtime";function Fr({anchorEl:e,open:o,acks:t,total:n,avatarSrcByName:r,onRequestConfirm:i,onClose:a}){let s=Re();return tn(bx,{open:o&&(s||!!e),anchorEl:e,onClose:a,transitionDuration:0,anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...s?{anchorReference:"none",slotProps:{paper:{sx:{position:"fixed",top:"50%",left:"50%",translate:"-50% -50%",maxWidth:"calc(100vw - 48px)",maxHeight:"70vh",borderRadius:3}}}}:{},children:Nr(on,{sx:{minWidth:240,maxWidth:320,py:1},children:[Nr(on,{sx:{px:2,pb:.75,fontSize:fo(13.5),fontWeight:600,color:"#37352f",borderBottom:"1px solid #efefed"},children:["\uD655\uC778 ",t.length,"/",n]}),t.length===0?tn(on,{sx:{px:2,py:1.5,fontSize:fo(13.5),color:"#9a9a97"},children:"\uC544\uC9C1 \uD655\uC778\uD55C \uC0AC\uB78C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):t.map(d=>Nr(on,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:.75,minWidth:0},children:[tn(ho,{names:[d.name],size:22,avatarSrcByName:r}),tn(on,{component:"span",sx:{fontSize:fo(14),color:"#37352f",whiteSpace:"nowrap"},children:d.name}),tn(on,{component:"span",sx:{ml:"auto",fontSize:fo(12.5),color:"#9a9a97",whiteSpace:"nowrap"},children:mt(d.time)}),tn(kx,{sx:{fontSize:16,color:"#2f80ed",flexShrink:0}})]},d.account_seq)),i?tn(on,{sx:{borderTop:"1px solid #efefed",px:1.5,pt:1,pb:.25},children:Nr(hx,{size:"small",fullWidth:!0,variant:"outlined",onClick:()=>{i(),a()},sx:{fontSize:fo(13)},children:["\uD655\uC778 \uC694\uCCAD (",n-t.length,"\uBA85 \uBBF8\uD655\uC778)"]})}):null]})})}function Tx(e){let o=Number(e.author_account_seq??0);return[...new Set([Number(e.manager_account_seq??0),...e.receiver_account_seqs??[]].filter(t=>t>0&&t!==o))]}function as(e,o){let t=Tx(e),n=e.acks??[],r=o>0?n.find(i=>i.account_seq===o):void 0;return{myTime:r?.time??"",canConfirm:o>0&&t.includes(o)&&!r,count:n.filter(i=>t.includes(i.account_seq)).length,total:t.length}}function J1(e){let o=String(e??"").trim();return o?o.slice(5,16).replaceAll("-","."):""}import{Fragment as wx,jsx as bo,jsxs as nn}from"react/jsx-runtime";function Hr(e){return{border:`1px solid ${e.borderColor}`,borderRadius:1,p:1,bgcolor:e.bg,display:"flex",flexDirection:"column",gap:.75,boxShadow:"0 1px 2px rgba(0,0,0,0.04)",...e.sx}}function _x(e){let o=e.trim();return o?o.slice(2,10).replaceAll("-","."):"-"}function Dx(){let e=new Date,o=String(e.getMonth()+1).padStart(2,"0"),t=String(e.getDate()).padStart(2,"0");return`${e.getFullYear()}-${o}-${t}`}function Zn({task:e,statusOptions:o,showDueDate:t=!1,onRequestArchiveToggle:n,onRequestReply:r,onDueDateClick:i,titleFontSize:a=13}){let s=ne(),l=!!e.due_date&&e.due_date.slice(0,10)<=Dx()?s.colors.danger:s.colors.accentOnSurface,u=as(e,0),[p,m]=yx(null),c=yn(e,o),k=new Set(e.label_keys??[]),S=c.filter(h=>!k.has(h.key)),g=c.filter(h=>k.has(h.key));return nn(wx,{children:[nn(Rt,{sx:{display:"flex",alignItems:"center",gap:.5},children:[bo(Bx,{size:"small",checked:e.completed,onPointerDown:h=>h.stopPropagation(),onClick:h=>h.stopPropagation(),onChange:(h,b)=>n?.({anchorEl:h.currentTarget,taskSeq:e.seq,nextCompleted:b}),sx:{p:0}}),bo(Cx,{title:e.title,arrow:!0,enterDelay:300,children:nn(Rt,{sx:{flex:1,minWidth:0,pr:3.5,fontSize:a,fontWeight:s.mode==="dark"||e.completed?400:500,color:s.mode==="dark"?s.colors.textStrong:s.colors.textPrimary,lineHeight:1.35,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textDecoration:e.completed?"line-through":"none"},children:[e.is_event&&e.event_time?`${e.event_time} `:"",e.title]})}),(e.comment_count??e.comments?.length??0)>0?bo(vn,{sx:{fontSize:15,flexShrink:0,color:s.colors.textMuted}}):null]}),e.is_bug&&e.ticket_no?bo(Rt,{sx:{pl:3,mt:-.5,fontSize:12.5,color:s.colors.textSecondary,fontWeight:500,fontVariantNumeric:"tabular-nums"},children:e.ticket_no}):null,nn(Rt,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:.5},children:[nn(Rt,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5,minWidth:0},children:[S.map(h=>bo(Ee,{option:h,small:!0},h.key)),bo(No,{priority:e.priority,small:!0}),g.map(h=>bo(Ee,{option:h,small:!0},h.key))]}),t&&String(e.due_date??"").trim()?nn(Sx,{disabled:!i,onPointerDown:h=>h.stopPropagation(),onClick:h=>{h.stopPropagation(),i?.(e,h.currentTarget)},sx:{display:"inline-flex",alignItems:"center",gap:.25,px:.5,py:.1,borderRadius:.75,fontSize:13,fontWeight:500,color:l,whiteSpace:"nowrap","&:hover":i?{bgcolor:s.colors.border}:void 0},children:[_x(e.due_date),bo(vx,{sx:{fontSize:15}})]}):null]}),t&&e.estimated_time?nn(Rt,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.25,mt:-.5,fontSize:12,color:s.colors.textSecondary},children:[bo(Ix,{sx:{fontSize:14}}),e.estimated_time]}):null,bo(ho,{names:[...e.manager_name?[e.manager_name]:[],...e.receiver_names],size:20,ringFirst:!!e.manager_name}),u.total>0?bo(Rt,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.5},children:bo(Rt,{sx:{flexShrink:0,width:64},onPointerDown:h=>h.stopPropagation(),onClick:h=>h.stopPropagation(),children:bo(Cn,{canConfirm:!1,count:u.count,total:u.total,onConfirm:()=>{},onShowList:h=>m(h)})})}):null,bo(Fr,{anchorEl:p,open:!!p,acks:e.acks??[],total:u.total,onRequestConfirm:r&&u.count<u.total?()=>{r(e),m(null)}:void 0,onClose:()=>m(null)})]})}import{Box as Mx}from"@mui/material";import{useSortable as Ox}from"@dnd-kit/sortable";import{CSS as Ex}from"@dnd-kit/utilities";import{jsx as ls}from"react/jsx-runtime";function Px(e){return{px:1.25,py:1,display:"flex",flexDirection:"column",gap:.75,borderBottom:`1px solid ${e.borderColor}`,bgcolor:e.bg}}function ss({task:e,statusOptions:o,variant:t="card",showDueDate:n=!1,onRequestArchiveToggle:r,onRequestReply:i,onDueDateClick:a,onCardClick:s,onCardContextMenu:d,titleFontSize:l}){let u=ne(),{attributes:p,listeners:m,setNodeRef:c,transform:k,transition:S,isDragging:g}=Ox({id:String(e.seq)}),h=t==="list";return ls(Mx,{ref:c,...p,...m,onClick:s?()=>s(e):void 0,onContextMenu:d?b=>d(e,b):void 0,sx:{...h?Px(u.card):Hr(u.card),opacity:g?.35:e.completed?.55:1,transform:Ex.Translate.toString(k),transition:S,position:"relative",cursor:"default",touchAction:"none","&:hover":h?{bgcolor:u.card.hoverBg}:{boxShadow:"0 3px 8px rgba(0,0,0,0.1)"}},children:ls(Zn,{task:e,statusOptions:o,showDueDate:n,onRequestArchiveToggle:r,onRequestReply:i,onDueDateClick:a,titleFontSize:l})})}function Rx(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?e.slice(5).replace("-","."):""}function Oo(e){if(e.status==="closed")return`${e.name} (\uC885\uB8CC)`;let o=Rx(e.end_date);return o?`${e.name} (~${o})`:e.name}import{jsx as Q,jsxs as ze}from"react/jsx-runtime";var hs=2,Wr="group-",Eo="colmove-",aa="__default__",la=Ni,sa="__other__",$r="sprint-",bs=`${$r}0`,Xx={planning:"#9a9a97",active:"#2f80ed",closed:"#9a9a97"};function ys(e){return{flexShrink:0,width:e.width,py:e.paddingY,borderRadius:`${e.borderRadius}px`,bgcolor:e.bg,border:e.border,color:e.color,fontSize:e.fontSize,fontWeight:e.fontWeight,lineHeight:1.6,textAlign:"center",fontVariantNumeric:"tabular-nums",...e.sx}}function Qx({column:e,tasks:o,statusOptions:t,onRequestArchiveToggle:n,onRequestReply:r,onDueDateClick:i,onAddTask:a,canAdd:s,onOpenMenu:d,onCardClick:l,onCardContextMenu:u,grow:p,summary:m,onOpenSprintMenu:c}){let k=ne(),{setNodeRef:S,isOver:g}=$x({id:`${Wr}${e.key}`}),{attributes:h,listeners:b,setNodeRef:w,transform:y,transition:v,isDragging:f}=Gx({id:`${Eo}${e.key}`,disabled:e.isDefault||e.isArchived||!!e.locked});return ze(Ie,{ref:x=>{S(x),w(x)},sx:{flex:p?"1 0 270px":"0 0 270px",minWidth:270,contain:"inline-size",minHeight:0,maxHeight:"100%",display:"flex",flexDirection:"column",borderRadius:1.5,boxShadow:x=>x.shadows[1],bgcolor:g?k.colors.accentSoft:k.board.columnBg,transition:"background-color 0.15s",overflow:"hidden",transform:jx.Translate.toString(y),...v?{transition:`${v}, background-color 0.15s`}:{},opacity:f?.6:1},children:[ze(Ie,{...h,...b,sx:{display:"flex",alignItems:"center",gap:.75,pl:1.25,pr:.5,py:1.1,borderBottom:`1px solid ${k.card.borderColor}`,flexShrink:0,touchAction:"none",cursor:e.isDefault||e.isArchived||e.locked?"default":"grab",opacity:e.isArchived?.65:1},children:[e.dot?Q(Ie,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:e.dot,flexShrink:0}}):e.isDefault?null:(()=>{let x=He(e.icon);return x?Q(x,{sx:{fontSize:17,color:"#1e3a8a"}}):null})(),Q(Ie,{component:"span",sx:{fontSize:k.board.columnHeaderFontSize,fontWeight:700,color:k.board.columnHeaderColor,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.label}),Q(Ie,{component:"span",sx:{...ys(k.board.badge),ml:"auto"},children:o.length}),e.sprint&&c?Q(ms,{size:"small","aria-label":"\uBAA9\uD45C \uBA54\uB274",onPointerDown:x=>x.stopPropagation(),onClick:x=>c(x.currentTarget,e.sprint),sx:{color:"#9a9a97"},children:Q(ds,{sx:{fontSize:18}})}):e.locked?null:Q(ms,{size:"small","aria-label":"\uD504\uB85C\uC81D\uD2B8 \uBA54\uB274",onPointerDown:x=>x.stopPropagation(),onClick:x=>d({anchorEl:x.currentTarget,column:e}),sx:{color:"#9a9a97"},children:Q(ds,{sx:{fontSize:18}})})]}),m?Q(Ie,{sx:{px:1.25,py:1.25,borderBottom:`1px solid ${k.card.borderColor}`,flexShrink:0},children:m}):null,Q(Ie,{sx:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column"},children:Q(ma,{style:{height:"auto",flex:"1 1 auto",minHeight:0},contentStyle:{minWidth:0},thumb:{width:6},children:ze(Ie,{sx:{display:"flex",flexDirection:"column",flexGrow:1},children:[Q(Ts,{items:o.map(x=>String(x.seq)),strategy:Yx,children:o.map(x=>Q(ss,{task:x,statusOptions:t,variant:"list",showDueDate:!0,titleFontSize:15,onRequestArchiveToggle:n,onRequestReply:r,onDueDateClick:i,onCardClick:l,onCardContextMenu:u},x.seq))}),o.length===0&&!s?Q(Ie,{sx:{py:3,textAlign:"center",fontSize:13,color:"#9a9a97"},children:"\uCE74\uB4DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,o.length===0&&s?Q(Ie,{sx:{flexGrow:1,minHeight:56,display:"flex",flexDirection:"column","&:hover .taskbox-board-add":{opacity:1,pointerEvents:"auto"}},children:ze(ks,{className:"taskbox-board-add",onClick:()=>a(e.isDefault?"":e.key),sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,px:1.25,py:1.75,borderBottom:`1px dashed ${k.card.borderColor}`,bgcolor:k.card.bg,color:k.colors.accentOnSurface,fontSize:13,fontWeight:500,opacity:0,pointerEvents:"none",transition:"opacity 0.15s","&:hover":{bgcolor:k.card.hoverBg}},children:[Q(ca,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})}):null]})})})]})}function ua({tasks:e,statusOptions:o,customTabs:t,mode:n="active",onToggleCompleted:r,onRequestReply:i,onChangeDueDate:a,onChangeReminder:s,onMoveTask:d,columnAxis:l="project",statusColumns:u=[],onMoveTaskStatus:p,sprintColumns:m=[],onMoveTaskSprint:c,onAddGroup:k,onAddTask:S,canAdd:g=!0,onRequestRename:h,onArchiveProject:b,onDeleteProject:w,onReorderProjects:y,onOpenDetail:v,onTaskContextMenu:f,hideCompleted:x=!1,renderColumnSummary:I,onEditSprint:W,onChangeSprintStatus:_,onRemoveSprint:K}){let B=ne(),[T,L]=gt(null),[$,J]=gt(null),[R,ie]=gt(null),[re,Ce]=gt(null),[xe,Fe]=gt(null),[oe,le]=gt(null),[ge,q]=gt(null),[U,j]=gt(null),[E,H]=gt(null),D=zx(!1),N=xt(()=>new Map(e.map(O=>[O.seq,O])),[e]),ce=xt(()=>{let O=e.filter(F=>F.is_notice);return O.sort((F,X)=>F.completed!==X.completed?F.completed?1:-1:X.seq-F.seq),O},[e]),M=xt(()=>t.filter(O=>!O.archived),[t]),ae=xt(()=>t.filter(O=>O.archived),[t]),me=O=>({key:O.key,label:O.label,icon:O.icon,isDefault:!1,isArchived:O.archived}),he=xt(()=>new Set(u.map(O=>O.key)),[u]),Oe=xt(()=>new Set(m.map(O=>O.seq)),[m]),A=xt(()=>{if(l==="sprint")return[{key:bs,label:"\uBBF8\uBC30\uC815",icon:"",isDefault:!0,isArchived:!1,dot:"#c9c8c5",locked:!0},...m.map(O=>({key:`${$r}${O.seq}`,label:Oo(O),icon:"",isDefault:!1,isArchived:!1,dot:Xx[O.status],locked:!0,sprint:O}))];if(l==="status"){let O=u.map(F=>({key:F.key,label:F.name,icon:"",isDefault:!1,isArchived:!1,dot:F.dot,locked:!0}));return O.some(F=>F.key===la)?O:[...O,{key:la,label:"\uC644\uB8CC",icon:"",isDefault:!1,isArchived:!1,dot:"#2f80ed",locked:!0}]}return n==="archived"?ae.map(me):[{key:aa,label:"\uAE30\uBCF8 \uC5C5\uBB34\uD568",icon:"",isDefault:!0,isArchived:!1},...M.map(me)]},[l,u,m,n,M,ae]),V=Ux(Kx(Fx,{activationConstraint:{distance:5}})),Ve=ot(O=>{let F=String(O.active.id).startsWith(Eo),X=Hx(O),Z=X.length>0?X:Wx(O);if(F)return Z.filter(eo=>String(eo.id).startsWith(Eo));let be=Z.filter(eo=>!String(eo.id).startsWith(Eo)),_e=be.filter(eo=>!String(eo.id).startsWith(Wr));return _e.length>0?_e:be},[]),no=xt(()=>{let O=new Map;for(let F of e){if(F.is_notice)continue;let X;if(l==="sprint"){let be=F.sprint_seq??0;X=Oe.has(be)?`${$r}${be}`:bs}else X=l==="status"?F.completed?la:he.has(String(F.status??""))?String(F.status??""):sa:F.tab_key?.trim()||aa;let Z=O.get(X);Z?Z.push(F):O.set(X,[F])}for(let F of O.values())F.sort((X,Z)=>{if(X.completed!==Z.completed)return X.completed?1:-1;let be=(X.group_sort_no??0)>0,_e=(Z.group_sort_no??0)>0;return be&&_e?(X.group_sort_no??0)-(Z.group_sort_no??0):be!==_e?be?-1:1:X.due_date!==Z.due_date?X.due_date<Z.due_date?-1:1:X.seq-Z.seq});return O},[e,l,he,Oe]),Yo=xt(()=>l!=="status"||(no.get(sa)??[]).length===0?A:[...A,{key:sa,label:"\uAE30\uD0C0",icon:"",isDefault:!1,isArchived:!1,dot:"#c9c8c5",locked:!0}],[l,A,no]),Dt=ot(O=>ge?(ge.get(O)??[]).map(F=>N.get(F)).filter(F=>!!F):no.get(O)??[],[ge,N,no]),Ut=ot(O=>{let F=Dt(O);return x?F.filter(X=>!X.completed):F},[Dt,x]),at=ot(O=>{let F=String(O.active.id);if(F.startsWith(Eo)){H(F.slice(Eo.length));return}j(Number(F)),q(new Map(A.map(X=>[X.key,(no.get(X.key)??[]).map(Z=>Z.seq)])))},[A,no]),Ao=ot((O,F)=>{if(O.startsWith(Wr))return{key:O.slice(Wr.length),overSeq:null};let X=Number(O);for(let[Z,be]of F)if(be.includes(X))return{key:Z,overSeq:X};return null},[]),wt=ot(O=>{let{active:F,over:X}=O;!X||String(F.id).startsWith(Eo)||q(Z=>{if(!Z)return Z;let be=Number(F.id),_e=Ao(String(X.id),Z);if(!_e)return Z;let eo=[...Z.entries()].find(([,Qe])=>Qe.includes(be))?.[0];if(!eo||eo===_e.key)return Z;let ue=new Map(Z);ue.set(eo,(ue.get(eo)??[]).filter(Qe=>Qe!==be));let Ge=[...ue.get(_e.key)??[]],Se=Ge.length;if(_e.overSeq!==null){let Qe=Ge.indexOf(_e.overSeq);Qe!==-1&&(Se=Qe)}return Ge.splice(Se,0,be),ue.set(_e.key,Ge),ue})},[Ao]),Vt=ot(O=>{let F=String(O.active.id);if(F.startsWith(Eo)){H(null);let Se=String(O.over?.id??"");if(!Se.startsWith(Eo))return;let Qe=F.slice(Eo.length),jo=Se.slice(Eo.length);if(Qe===jo)return;let Do=t.map(vo=>vo.key),oo=Do.indexOf(Qe),Xo=Do.indexOf(jo);if(oo===-1||Xo===-1)return;y(gs(Do,oo,Xo));return}let X=ge;if(q(null),j(null),D.current=!0,!X||!O.over)return;let Z=Number(F),be=[...X.entries()].find(([,Se])=>Se.includes(Z));if(!be)return;let[_e,eo]=be,ue=[...eo],Ge=Ao(String(O.over.id),X);if(Ge&&Ge.key===_e&&Ge.overSeq!==null&&Ge.overSeq!==Z){let Se=ue.indexOf(Z),Qe=ue.indexOf(Ge.overSeq);Se!==-1&&Qe!==-1&&(ue=gs(ue,Se,Qe))}if(l==="status"){p?.(Z,_e);return}if(l==="sprint"){c?.(Z,Number(_e.slice($r.length))||0);return}d(Z,_e===aa?"":_e,ue)},[t,ge,Ao,d,y,l,p,c]),Lo=ot(()=>{q(null),j(null),H(null),D.current=!0},[]),Mt=ot(O=>{if(D.current){D.current=!1;return}v(O)},[v]),Gt=U!==null?N.get(U)??null:null,Co=E!==null?A.find(O=>O.key===E)??null:null,Yt=ot((O,F)=>{le({anchorEl:F,taskSeq:O.seq,date:O.due_date,reminder:O.reminder})},[]),we=$?.column??null;return ze(Ie,{sx:{flex:1,minHeight:0,height:"100%",display:"flex",flexDirection:"column",border:`1px solid ${B.card.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden",p:hs,bgcolor:B.colors.surfaceSubtle},children:[ze(Lx,{sensors:V,collisionDetection:Ve,onDragStart:at,onDragOver:wt,onDragEnd:Vt,onDragCancel:Lo,children:[Q(Ie,{sx:{flex:1,minHeight:0,minWidth:0,contain:"inline-size"},children:n==="archived"&&A.length===0?Q(Ie,{sx:{py:8,textAlign:"center",color:"#9a9a97",fontSize:14},children:"\uBCF4\uAD00\uB41C \uD504\uB85C\uC81D\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):Q(ma,{style:{height:"100%"},contentStyle:{width:"max-content",minWidth:"100%",height:"100%"},thumb:{width:8},showHorizontalScrollbar:!0,children:ze(Ie,{sx:{display:"flex",alignItems:"flex-start",gap:hs,height:"100%",minWidth:"min-content",pb:.5},children:[n==="active"&&ce.length>0?ze(Ie,{sx:{flex:l!=="project"?"1 0 270px":"0 0 270px",minWidth:270,contain:"inline-size",minHeight:0,maxHeight:"100%",display:"flex",flexDirection:"column",borderRadius:1.5,boxShadow:O=>O.shadows[1],bgcolor:B.card.bg,overflow:"hidden"},children:[ze(Ie,{sx:{display:"flex",alignItems:"center",gap:.75,pl:1.25,pr:.5,py:1.1,borderBottom:`1px solid ${B.card.borderColor}`,flexShrink:0,minHeight:48},children:[Q(qx,{sx:{fontSize:17,color:"#e8763a"}}),Q(Ie,{component:"span",sx:{fontSize:14.5,fontWeight:700,color:B.board.columnHeaderColor},children:"\uACF5\uC9C0\uC0AC\uD56D"}),ze(Ie,{component:"span",sx:{fontSize:13,color:"#9a9a97",flexShrink:0},children:["(",ce.length,")"]})]}),Q(Ie,{sx:{flex:"1 1 auto",minHeight:0,display:"flex",flexDirection:"column"},children:Q(ma,{style:{height:"auto",flex:"1 1 auto",minHeight:0},contentStyle:{minWidth:0},thumb:{width:6},children:Q(Ie,{sx:{display:"flex",flexDirection:"column"},children:ce.map(O=>ze(Ie,{onClick:()=>Mt(O),onContextMenu:F=>f(O,F),sx:{px:1.25,py:1,display:"flex",flexDirection:"column",gap:.75,borderBottom:`1px solid ${B.card.borderColor}`,bgcolor:B.card.bg,cursor:"pointer","&:hover":{bgcolor:B.card.hoverBg}},children:[Q(Zn,{task:O,statusOptions:o,showDueDate:!0,titleFontSize:15,onRequestArchiveToggle:L}),(()=>{let F=(O.target_names??[]).filter(Z=>Z.trim());if(F.length===0)return null;let X=F.length>2?`${F[0]}, ${F[1]} \uC678 ${F.length-2}`:F.join(", ");return ze(Ie,{sx:{display:"flex",alignItems:"center",gap:.5,fontSize:12.5,color:"#787774",overflow:"hidden",whiteSpace:"nowrap"},children:[Q(Ax,{sx:{fontSize:14,flexShrink:0}}),Q(Ie,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis"},children:X})]})})()]},O.seq))})})})]}):null,Q(Ts,{items:M.map(O=>`${Eo}${O.key}`),strategy:Vx,children:Yo.map(O=>Q(Qx,{column:O,tasks:Ut(O.key),summary:I?.(O.key,Dt(O.key)),onOpenSprintMenu:W||_||K?(F,X)=>ie({anchorEl:F,sprint:X}):void 0,statusOptions:o,onRequestArchiveToggle:L,onRequestReply:i,onDueDateClick:Yt,onAddTask:S,canAdd:g&&l==="project",onOpenMenu:J,onCardClick:Mt,onCardContextMenu:f,grow:l!=="project"},O.key))}),n==="active"&&l==="project"?ze(ks,{onClick:k,sx:{flex:"0 0 270px",minWidth:270,display:"flex",alignItems:"center",justifyContent:"center",gap:.5,py:2,border:"1.5px dashed #cfcfcc",borderRadius:1.5,color:"#787774",fontSize:14,"&:hover":{bgcolor:"#eef2f6",borderColor:"#9a9a97"}},children:[Q(ca,{sx:{fontSize:18}}),"\uC0C8 \uD504\uB85C\uC81D\uD2B8"]}):null,n==="active"&&Yo.length===0&&ce.length===0?Q(Ie,{sx:{flex:1,minWidth:240,display:"flex",alignItems:"center",justifyContent:"center",color:"#9a9a97",fontSize:14,py:6},children:l==="project"?"\uD504\uB85C\uC81D\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uC0C8 \uD504\uB85C\uC81D\uD2B8\uB97C \uCD94\uAC00\uD574 \uC5C5\uBB34\uB97C \uC815\uB9AC\uD558\uC138\uC694.":"\uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]})})}),Q(Nx,{children:Gt?Q(Ie,{sx:{...Hr,width:250,boxShadow:"0 8px 20px rgba(0,0,0,0.18)",cursor:"grabbing"},children:Q(Zn,{task:Gt,statusOptions:o,showDueDate:!0,titleFontSize:15})}):Co?ze(Ie,{sx:{display:"flex",alignItems:"center",gap:.75,width:270,px:1.25,py:1,bgcolor:B.card.bg,border:`1px solid ${B.card.borderColor}`,borderRadius:1.5,boxShadow:"0 8px 20px rgba(0,0,0,0.18)",opacity:.9,cursor:"grabbing"},children:[(()=>{let O=He(Co.icon);return O?Q(O,{sx:{fontSize:17,color:"#1e3a8a"}}):null})(),Q(Ie,{component:"span",sx:{fontSize:13.5,fontWeight:700,color:B.board.columnHeaderColor},children:Co.label}),Q(Ie,{component:"span",sx:ys(B.board.badge),children:(no.get(Co.key)??[]).length})]}):null})]}),ze(us,{transitionDuration:0,anchorEl:$?.anchorEl??null,open:!!$,onClose:()=>J(null),children:[we&&!we.isArchived&&g?ze(zt,{onClick:()=>{we&&S(we.isDefault?"":we.key),J(null)},sx:{fontSize:14,gap:1},children:[Q(ca,{sx:{fontSize:18,color:"#787774"}}),"\uC0C8 \uC5C5\uBB34 \uB4F1\uB85D"]}):null,we&&!we.isDefault&&!we.isArchived?ze(zt,{onClick:()=>{h(we.key,we.label,we.icon),J(null)},sx:{fontSize:14,gap:1},children:[Q(ps,{sx:{fontSize:18,color:"#787774"}}),"\uC218\uC815"]}):null,we&&!we.isDefault&&!we.isArchived?ze(zt,{onClick:()=>{b(we.key,!0),J(null)},sx:{fontSize:14,gap:1},children:[Q(fs,{sx:{fontSize:18,color:"#787774"}}),"\uBCF4\uAD00"]}):null,we&&we.isArchived?ze(zt,{onClick:()=>{b(we.key,!1),J(null)},sx:{fontSize:14,gap:1},children:[Q(xs,{sx:{fontSize:18,color:"#787774"}}),"\uBCF5\uC6D0"]}):null,we&&!we.isDefault?Q(cs,{}):null,we&&!we.isDefault?ze(zt,{onClick:()=>{$&&Fe($),J(null)},sx:{fontSize:14,gap:1,color:"#e5484d"},children:[Q(ft,{sx:{fontSize:18}}),"\uC0AD\uC81C"]}):null]}),ze(us,{transitionDuration:0,anchorEl:R?.anchorEl??null,open:!!R,onClose:()=>ie(null),children:[W?ze(zt,{onClick:()=>{R&&W(R.sprint.seq),ie(null)},sx:{fontSize:14,gap:1},children:[Q(ps,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uC218\uC815"]}):null,_?ze(zt,{onClick:()=>{R&&_(R.sprint.seq,R.sprint.status==="closed"?"active":"closed"),ie(null)},sx:{fontSize:14,gap:1},children:[R?.sprint.status==="closed"?Q(xs,{sx:{fontSize:18,color:"#787774"}}):Q(fs,{sx:{fontSize:18,color:"#787774"}}),R?.sprint.status==="closed"?"\uB2E4\uC2DC \uC2DC\uC791":"\uBAA9\uD45C \uC885\uB8CC"]}):null,K?Q(cs,{}):null,K?ze(zt,{onClick:()=>{R&&Ce(R),ie(null)},sx:{fontSize:14,gap:1,color:"#e5484d"},children:[Q(ft,{sx:{fontSize:18}}),"\uBAA9\uD45C \uC0AD\uC81C"]}):null]}),Q(Ye,{open:!!re,anchorEl:re?.anchorEl??null,title:`"${re?.sprint.name??""}" \uBAA9\uD45C\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`,confirmText:"\uC0AD\uC81C",onCancel:()=>Ce(null),onConfirm:()=>{re&&K?.(re.sprint.seq),Ce(null)}}),Q(Pt,{anchorEl:oe?.anchorEl??null,open:!!oe,date:oe?.date??"",reminder:oe?.reminder??"none",onClose:()=>le(null),onDateChange:O=>{oe&&(a(oe.taskSeq,O),le(F=>F&&{...F,date:O}))},onReminderChange:O=>{oe&&(s(oe.taskSeq,O),le(F=>F&&{...F,reminder:O}))}}),Q(Ye,{open:!!xe,anchorEl:xe?.anchorEl??null,title:`"${xe?.column.label??""}" \uD504\uB85C\uC81D\uD2B8\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?
|
|
2
|
+
\uC18C\uC18D \uC5C5\uBB34\uB294 \uAE30\uBCF8 \uC5C5\uBB34\uD568\uC73C\uB85C \uC774\uB3D9\uD569\uB2C8\uB2E4.`,confirmText:"\uC0AD\uC81C",onCancel:()=>Fe(null),onConfirm:()=>{xe&&w(xe.column.key),Fe(null)}}),Q(Ye,{open:!!T,anchorEl:T?.anchorEl??null,title:T?.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:T?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>L(null),onConfirm:()=>{T&&r(T.taskSeq,T.nextCompleted),L(null)}})]})}import{useCallback as ht,useMemo as er,useRef as rg,useState as or}from"react";import{Box as je,Button as ig,ButtonBase as Cs,IconButton as Bs}from"@mui/material";import ag from"@mui/icons-material/Add";import lg from"@mui/icons-material/ChevronLeft";import sg from"@mui/icons-material/ChevronRight";import cg from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as mg}from"@ehfuse/mui-datetime-picker";import{DndContext as ug,DragOverlay as dg,PointerSensor as pg,pointerWithin as fg,rectIntersection as xg,useDroppable as gg,useSensor as hg,useSensors as bg}from"@dnd-kit/core";import{SortableContext as kg,arrayMove as Tg,useSortable as yg,verticalListSortingStrategy as Sg}from"@dnd-kit/sortable";import{CSS as Bg}from"@dnd-kit/utilities";import Cg from"@ehfuse/overlay-scrollbar";import{useEffect as Jx,useState as Zx}from"react";function qt(e){let{loadHolidays:o}=Io(),[t,n]=Zx(()=>new Map),r=e.join(",");return Jx(()=>{if(!o||!r){n(new Map);return}let i=!1;return o(r.split(",").map(Number)).then(a=>{if(i)return;let s=new Map;for(let d of a)s.has(d.date)||s.set(d.date,d.name);n(s)}).catch(()=>{}),()=>{i=!0}},[o,r]),t}function eg(e){let[o,t,n]=e.split("-").map(Number),r=new Date(Date.UTC(o,t-1,n+1)),i=a=>String(a).padStart(2,"0");return`${r.getUTCFullYear()}-${i(r.getUTCMonth()+1)}-${i(r.getUTCDate())}`}function _n(e){let o=new Map;for(let t of e){let n=t.start_date;for(let r=0;r<62&&n<=t.end_date;r+=1){let i=o.get(n);i?i.push(t):o.set(n,[t]),n=eg(n)}}for(let t of o.values())t.sort((n,r)=>(n.time||"99:99").localeCompare(r.time||"99:99")||n.title.localeCompare(r.title));return o}import{Box as da,Tooltip as og}from"@mui/material";import{jsx as pa,jsxs as tg}from"react/jsx-runtime";function Dn({event:e,small:o=!1}){let t=e.time?`${e.time} ${e.title}`:e.title,n=e.calendar?`\uAD6C\uAE00 \xB7 ${e.calendar}`:"\uAD6C\uAE00 \uCE98\uB9B0\uB354",r=i=>{i.stopPropagation();let[a,s,d]=e.start_date.split("-").map(Number);window.open(`https://calendar.google.com/calendar/r/day/${a}/${s}/${d}`,"_blank")};return pa(og,{title:`(${n}) ${t}`,arrow:!0,enterDelay:300,children:tg(da,{onClick:r,onPointerDown:i=>i.stopPropagation(),sx:{display:"flex",alignItems:"center",gap:.5,px:1,py:o?.6:.8,borderRadius:.75,bgcolor:"#f1f1ef",color:"#37352f",fontSize:15,fontWeight:500,overflow:"hidden",whiteSpace:"nowrap",flexShrink:0,minWidth:0,maxWidth:"100%",cursor:"pointer","&:hover":{bgcolor:"#ececea"}},children:[pa(da,{component:"span",sx:{width:6,height:6,borderRadius:"50%",bgcolor:"#0f9d58",flexShrink:0}}),pa(da,{component:"span",sx:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:t})]})})}import{Box as Kr,Checkbox as ng}from"@mui/material";import{jsx as wn,jsxs as Ss}from"react/jsx-runtime";var fa={high:"#e5484d",medium:"#2f80ed",low:"#d9a514"},xa=15;function At({task:e,statusOptions:o,onOpenDetail:t,onContextMenu:n,isPreview:r=!1,isDragging:i=!1,isMine:a=!1,avatarSrcByName:s,showManagerAvatar:d=!1,onOpenMembers:l,setNodeRef:u,dragProps:p,trailing:m,showCheckbox:c=!1,onRequestToggleCompleted:k}){let S=ne(),g=S.mode==="dark",[h]=yn(e,o),b=String(e.manager_name??"").trim(),w=He(e.icon||(e.is_notice?xo:Me)),y=!e.is_event&&!e.due_date.slice(0,10),v=!e.completed&&!e.is_event&&!!e.due_date&&e.due_date.slice(0,10)<_l(),f=d&&!a&&!!b;return Ss(Kr,{ref:u,...p??{},onClick:x=>{x.stopPropagation(),t(e)},onContextMenu:n?x=>n(e,x):void 0,sx:{display:"flex",alignItems:"center",gap:.5,py:.6,px:1,flexShrink:0,borderRadius:.75,minWidth:0,maxWidth:"100%",bgcolor:h?g?jt(h.dot,S.chip.darkBgAlpha):h.bg:g?S.card.bg:S.colors.surfaceHover,color:h?g?S.chip.darkTextSource==="fg"?h.fg:h.dot:h.fg:S.colors.textPrimary,fontSize:xa,fontWeight:g||e.completed?400:500,textDecoration:e.completed?"line-through":"none",opacity:r?.5:i?.35:e.completed?.6:1,border:r?`1px dashed ${S.colors.accent}`:"1px solid transparent",pointerEvents:r?"none":"auto",cursor:"pointer",touchAction:p?"none":"auto",overflow:"hidden","&:hover":{filter:"brightness(0.96)"},...v?{borderLeft:`3px solid ${S.colors.danger}`,pl:.75}:a?{borderLeft:`3px solid ${S.colors.accentOnSurface}`,pl:.75}:y?{borderLeft:`3px solid ${jt(S.colors.textMuted,.4)}`,pl:.75}:{}},children:[wn(Kr,{component:"span",sx:{width:6,height:6,borderRadius:"50%",flexShrink:0,bgcolor:fa[e.priority]??S.colors.accentOnSurface}}),c&&k?wn(ng,{size:"small",checked:e.completed,onPointerDown:x=>x.stopPropagation(),onClick:x=>x.stopPropagation(),onChange:(x,I)=>k({anchorEl:x.currentTarget,taskSeq:e.seq,nextCompleted:I}),sx:{p:0,flexShrink:0}}):null,w?wn(w,{sx:{fontSize:15,flexShrink:0,opacity:.75}}):null,Ss(Kr,{component:"span",sx:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:g?S.colors.textStrong:S.colors.textPrimary},children:[e.is_event&&e.event_time?`${e.event_time} `:"",e.title]}),(e.comment_count??e.comments?.length??0)>0?wn(vn,{sx:{fontSize:15,flexShrink:0,color:S.colors.textMuted}}):null,m??null,!m&&f?wn(Kr,{component:"span",onClick:l?x=>{x.stopPropagation(),l(e)}:void 0,sx:{display:"inline-flex",flexShrink:0,ml:"auto",pl:.5},children:wn(Jo,{src:s?.get(b)??"",avatarSx:{width:22,height:22,fontSize:11},iconFontSize:14})}):null]})}import{jsx as ye,jsxs as bt}from"react/jsx-runtime";var vs=36,vg=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"],Ur="day-";function ga(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(o.getDate()-o.getDay()),o}function ha(e,o){let t=new Date(e);return t.setDate(t.getDate()+o),t}function Ig(e){let o=e[0],t=e[e.length-1];return o.getMonth()===t.getMonth()?`${o.getFullYear()}\uB144 ${o.getMonth()+1}\uC6D4`:o.getFullYear()===t.getFullYear()?`${o.getFullYear()}\uB144 ${o.getMonth()+1}\uC6D4 - ${t.getMonth()+1}\uC6D4`:`${o.getFullYear()}\uB144 ${o.getMonth()+1}\uC6D4 - ${t.getFullYear()}\uB144 ${t.getMonth()+1}\uC6D4`}function _g(e){return e.getDate()===1?`${e.getMonth()+1}\uC6D4 1\uC77C`:String(e.getDate())}function Dg({task:e,statusOptions:o,isMine:t,avatarSrcByName:n,onCardClick:r,onCardContextMenu:i,onRequestArchiveToggle:a}){let{attributes:s,listeners:d,setNodeRef:l,transform:u,transition:p,isDragging:m}=yg({id:String(e.seq)});return ye(At,{task:e,statusOptions:o,isMine:t,avatarSrcByName:n,showManagerAvatar:!0,onOpenDetail:c=>r?.(c),onContextMenu:i,showCheckbox:!0,onRequestToggleCompleted:a,isDragging:m,setNodeRef:l,dragProps:{...s,...d,style:{transform:Bg.Translate.toString(u),transition:p}}})}function wg({dayKey:e,isToday:o,dayLabel:t,holidayName:n,tasks:r,googleEvents:i,statusOptions:a,onRequestArchiveToggle:s,onRequestReply:d,onAddSchedule:l,canAdd:u,onCardClick:p,onCardContextMenu:m,summary:c,myAccountSeq:k,avatarSrcByName:S}){let g=ne(),{setNodeRef:h}=gg({id:`${Ur}${e}`});return bt(je,{ref:h,sx:{minWidth:0,minHeight:0,height:"100%",display:"flex",flexDirection:"column",bgcolor:o?g.calendar.todayBg:g.calendar.cellBg},children:[bt(je,{sx:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:.5,px:1,height:vs,bgcolor:o?g.calendar.todayBg:g.calendar.dateBandBg,borderBottom:`1px solid ${g.calendar.borderColor}`,flexShrink:0},children:[n?ye(je,{component:"span",sx:{mr:"auto",fontSize:11.5,fontWeight:600,color:g.colors.danger,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n}):null,o?ye(je,{component:"span",sx:{mr:.75,px:.6,py:.1,borderRadius:.5,fontSize:11,fontWeight:600,bgcolor:g.colors.danger,color:g.calendar.cellBg,lineHeight:1.6},children:"\uC624\uB298"}):null,ye(je,{component:"span",sx:{fontSize:13.5,fontWeight:o?700:400,color:n?g.colors.danger:g.mode==="dark"?g.colors.textStrong:g.colors.textPrimary,flexShrink:0},children:t})]}),c?ye(je,{sx:{px:1,py:1,borderBottom:`1px solid ${g.calendar.borderColor}`,flexShrink:0},children:c}):null,ye(je,{sx:{flex:1,minHeight:0,bgcolor:o?g.calendar.todayBg:g.colors.surfaceSubtle},children:ye(Cg,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:bt(je,{sx:{display:"flex",flexDirection:"column",flexGrow:1},children:[i.length>0?ye(je,{sx:{display:"flex",flexDirection:"column",gap:.5,px:1,pt:.75,pb:.25},children:i.map(b=>ye(Dn,{event:b},b.uid))}):null,ye(kg,{items:r.map(b=>String(b.seq)),strategy:Sg,children:ye(je,{sx:{display:"flex",flexDirection:"column",gap:.5,px:1,pt:.75},children:r.map(b=>ye(Dg,{task:b,statusOptions:a,isMine:k>0&&Number(b.manager_account_seq??0)===k,avatarSrcByName:S,onCardClick:p,onCardContextMenu:m,onRequestArchiveToggle:s},b.seq))})}),ye(je,{sx:{flexGrow:1,minHeight:56,display:"flex",flexDirection:"column",pb:1,...u?{"&:hover .taskbox-add-schedule":{opacity:1,pointerEvents:"auto"}}:{}},children:bt(Cs,{className:"taskbox-add-schedule",onClick:()=>l(e),sx:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,px:1.25,py:1.75,borderBottom:`1px dashed ${g.calendar.borderColor}`,bgcolor:g.calendar.cellBg,color:g.colors.accentOnSurface,fontSize:13,fontWeight:500,opacity:0,pointerEvents:"none",transition:"opacity 0.15s","&:hover":{bgcolor:g.calendar.hoverBg}},children:[ye(ag,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})})]})})})]})}function Is({tasks:e,googleEvents:o=[],statusOptions:t,fallbackToStartDate:n=!1,myAccountSeq:r=0,avatarSrcByName:i,todayStr:a,onToggleCompleted:s,onMoveTask:d,onRequestReply:l,onAddSchedule:u,canAdd:p=!0,onOpenDetail:m,onTaskContextMenu:c,hideCompleted:k=!1,renderColumnSummary:S}){let g=ne(),[h,b]=or(()=>ga(new Date)),[w,y]=or(null),[v,f]=or(null),[x,I]=or(null),[W,_]=or(null),K=rg(!1),B=er(()=>Array.from({length:7},(E,H)=>ha(h,H)),[h]),T=er(()=>new Map(e.map(E=>[E.seq,E])),[e]),L=er(()=>[...new Set(B.map(E=>E.getFullYear()))],[B]),$=qt(L),J=bg(hg(pg,{activationConstraint:{distance:5}})),R=ht(E=>{let H=fg(E),D=H.length>0?H:xg(E),N=D.filter(ce=>!String(ce.id).startsWith(Ur));return N.length>0?N:D},[]),ie=er(()=>_n(o),[o]),re=er(()=>{let E=new Map;for(let H of e){let D=H.due_date.slice(0,10)||(n?H.start_date.slice(0,10):"");if(!D)continue;let N=E.get(D);N?N.push(H):E.set(D,[H])}for(let H of E.values())H.sort((D,N)=>{let ce=D.sort_no>0,M=N.sort_no>0;if(ce&&M)return D.sort_no-N.sort_no;if(ce!==M)return ce?-1:1;if(D.completed!==N.completed)return D.completed?1:-1;let ae=Fi(D),me=Fi(N);return ae!==me?ae?-1:1:D.seq-N.seq});return E},[e,n]),Ce=ht(E=>x?(x.get(E)??[]).map(H=>T.get(H)).filter(H=>!!H):re.get(E)??[],[x,T,re]),xe=ht(E=>{let H=Ce(E);return k?H.filter(D=>!D.completed):H},[Ce,k]),Fe=ht(E=>{_(Number(E.active.id)),I(new Map(B.map(H=>{let D=Ae(H);return[D,(re.get(D)??[]).map(N=>N.seq)]})))},[B,re]),oe=ht((E,H)=>{if(E.startsWith(Ur))return{day:E.slice(Ur.length),overSeq:null};let D=Number(E);for(let[N,ce]of H)if(ce.includes(D))return{day:N,overSeq:D};return null},[]),le=ht(E=>{let{active:H,over:D}=E;D&&I(N=>{if(!N)return N;let ce=Number(H.id),M=oe(String(D.id),N);if(!M)return N;let ae=[...N.entries()].find(([,A])=>A.includes(ce))?.[0];if(!ae||ae===M.day)return N;let me=new Map(N);me.set(ae,(me.get(ae)??[]).filter(A=>A!==ce));let he=[...me.get(M.day)??[]],Oe=he.length;if(M.overSeq!==null){let A=he.indexOf(M.overSeq);A!==-1&&(Oe=A)}return he.splice(Oe,0,ce),me.set(M.day,he),me})},[oe]),ge=ht(E=>{let{active:H,over:D}=E,N=x;if(I(null),_(null),K.current=!0,!N||!D)return;let ce=Number(H.id),M=[...N.entries()].find(([,A])=>A.includes(ce));if(!M)return;let[ae,me]=M,he=[...me],Oe=oe(String(D.id),N);if(Oe&&Oe.day===ae&&Oe.overSeq!==null&&Oe.overSeq!==ce){let A=he.indexOf(ce),V=he.indexOf(Oe.overSeq);A!==-1&&V!==-1&&(he=Tg(he,A,V))}d(ce,ae,he)},[x,d,oe]),q=ht(()=>{I(null),_(null),K.current=!0},[]),U=ht(E=>{if(K.current){K.current=!1;return}m(E)},[m]),j=W!==null?T.get(W)??null:null;return bt(je,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${g.calendar.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden"},children:[bt(je,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,bgcolor:g.calendar.bg,borderBottom:`1px solid ${g.calendar.borderColor}`,flexShrink:0},children:[bt(je,{sx:{display:"flex",alignItems:"center",gap:.25},children:[ye(Bs,{size:"small","aria-label":"\uC774\uC804 \uC8FC",onClick:()=>b(ha(h,-7)),children:ye(lg,{sx:{fontSize:20,color:g.colors.textSecondary}})}),ye(ig,{size:"small",color:"inherit",onClick:()=>b(ga(new Date)),sx:{minWidth:0,px:1,mx:1,fontSize:13,fontWeight:g.mode==="dark"?400:500,color:g.mode==="dark"?g.colors.textStrong:g.colors.textPrimary},children:"\uC624\uB298"}),ye(Bs,{size:"small","aria-label":"\uB2E4\uC74C \uC8FC",onClick:()=>b(ha(h,7)),children:ye(sg,{sx:{fontSize:20,color:g.colors.textSecondary}})})]}),bt(Cs,{onClick:E=>f(E.currentTarget),sx:{display:"inline-flex",alignItems:"center",gap:.25,px:.75,py:.25,borderRadius:1,fontSize:15,fontWeight:g.mode==="dark"?400:700,color:g.mode==="dark"?g.colors.textStrong:g.colors.textPrimary,"&:hover":{bgcolor:g.colors.surfaceHover}},children:[Ig(B),ye(cg,{sx:{fontSize:18,color:g.colors.textMuted}})]})]}),ye(je,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",bgcolor:g.calendar.headerBg,borderBottom:`1px solid ${g.calendar.borderColor}`,flexShrink:0,"& > *":{borderRight:`1px solid ${g.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:B.map(E=>{let H=E.getDay(),D=$.has(Ae(E));return ye(je,{sx:{height:vs,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12.5,color:H===0||D?g.colors.danger:H===6?g.colors.accentOnSurface:g.colors.textSecondary},children:vg[H]},Ae(E))})}),ye(je,{sx:{flex:1,minHeight:0},children:bt(ug,{sensors:J,collisionDetection:R,onDragStart:Fe,onDragOver:le,onDragEnd:ge,onDragCancel:q,children:[ye(je,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",height:"100%",minHeight:0,"& > *":{borderRight:`1px solid ${g.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:B.map(E=>{let H=Ae(E);return ye(wg,{dayKey:H,isToday:H===a,dayLabel:_g(E),holidayName:$.get(H)??"",summary:S?.(H,Ce(H)),tasks:xe(H),googleEvents:ie.get(H)??[],statusOptions:t,onRequestArchiveToggle:y,onRequestReply:l,onAddSchedule:u,canAdd:p,onCardClick:U,onCardContextMenu:c,myAccountSeq:r,avatarSrcByName:i},H)})}),ye(dg,{children:j?ye(je,{sx:{boxShadow:"0 8px 20px rgba(0,0,0,0.18)",borderRadius:.75,cursor:"grabbing"},children:ye(At,{task:j,statusOptions:t,onOpenDetail:()=>{},isMine:r>0&&Number(j.manager_account_seq??0)===r})}):null})]})}),ye(mg,{anchorEl:v,open:!!v,onClose:()=>f(null),selectedDate:h,onDateChange:E=>{b(ga(E)),f(null)}}),ye(Ye,{open:!!w,anchorEl:w?.anchorEl??null,title:w?.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:w?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>y(null),onConfirm:()=>{w&&s(w.taskSeq,w.nextCompleted),y(null)}})]})}import{useCallback as tr,useMemo as rn,useState as nr}from"react";import{Box as mo,Button as Mg,ButtonBase as ws,IconButton as _s,Tooltip as Og}from"@mui/material";import Eg from"@mui/icons-material/Add";import Pg from"@mui/icons-material/ChevronLeft";import Rg from"@mui/icons-material/ChevronRight";import zg from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as qg}from"@ehfuse/mui-datetime-picker";import{DndContext as Ag,DragOverlay as Lg,PointerSensor as Ng,pointerWithin as Fg,rectIntersection as Hg,useDraggable as Wg,useDroppable as Ms,useSensor as $g,useSensors as Kg}from"@dnd-kit/core";import Ug from"@ehfuse/overlay-scrollbar";import{jsx as Pe,jsxs as kt}from"react/jsx-runtime";var Vg=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"],Vr="mday-",Gr="mchip-",Os=36;function Gg(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(o.getDate()-o.getDay()),o}function Yr(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(1),o}function Yg(e,o){let t=new Date(e);return t.setDate(t.getDate()+o),t}function Ds(e,o){let t=Yr(e);return t.setMonth(t.getMonth()+o),t}function jg({task:e,statusOptions:o,isPreview:t=!1,isMine:n=!1,avatarSrcByName:r,onOpenDetail:i,onContextMenu:a,onRequestToggleCompleted:s}){let{attributes:d,listeners:l,setNodeRef:u,isDragging:p}=Wg({id:String(e.seq),disabled:t}),{setNodeRef:m}=Ms({id:`${Gr}${e.seq}`,disabled:t});return Pe(Og,{title:e.title,arrow:!0,enterDelay:400,children:Pe(At,{task:e,statusOptions:o,onOpenDetail:i,onContextMenu:a,showCheckbox:!!s,onRequestToggleCompleted:s,isPreview:t,isDragging:p,isMine:n,avatarSrcByName:r,showManagerAvatar:!0,setNodeRef:c=>{u(c),m(c)},dragProps:{...d,...l}})})}function Xg({dayKey:e,dayNumber:o,isToday:t,isOtherMonth:n,weekday:r,holidayName:i,tasks:a,googleEvents:s,statusOptions:d,previewSeq:l,myAccountSeq:u,avatarSrcByName:p,onRequestToggleCompleted:m,onOpenDetail:c,onTaskContextMenu:k,onAddSchedule:S,canAdd:g}){let h=ne(),b=h.mode==="dark",{setNodeRef:w,isOver:y}=Ms({id:`${Vr}${e}`}),v=a,f=!!i||r===0;return kt(mo,{ref:w,sx:{minWidth:0,minHeight:0,display:"flex",flexDirection:"column",gap:.5,p:.5,bgcolor:y?h.colors.accentSoft:t?h.calendar.todayBg:n?h.calendar.otherMonthBg:h.calendar.cellBg,transition:"background-color 0.15s",overflow:"hidden",...g?{"&:hover .taskbox-month-add":{opacity:1,pointerEvents:"auto"}}:{}},children:[kt(mo,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:.5,height:Os,flexShrink:0,mx:-.5,mt:-.5,px:1,bgcolor:t?h.calendar.todayBg:h.calendar.dateBandBg,borderBottom:`1px solid ${h.calendar.borderColor}`},children:[i?Pe(mo,{component:"span",sx:{mr:.25,minWidth:0,fontSize:11,fontWeight:600,color:h.colors.danger,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:i}):null,t?Pe(mo,{component:"span",sx:{px:.5,borderRadius:.5,fontSize:10.5,fontWeight:600,bgcolor:h.colors.danger,color:h.calendar.cellBg,lineHeight:1.6},children:"\uC624\uB298"}):null,Pe(mo,{component:"span",sx:{fontSize:13.5,fontWeight:t?700:400,color:n?h.colors.textMuted:f?h.colors.danger:r===6?h.colors.accentOnSurface:b?h.colors.textStrong:h.colors.textPrimary,flexShrink:0},children:o})]}),s.map(x=>Pe(Dn,{event:x,small:!0},x.uid)),v.map(x=>Pe(jg,{task:x,statusOptions:d,isPreview:x.seq===l,isMine:u>0&&Number(x.manager_account_seq??0)===u,avatarSrcByName:p,onRequestToggleCompleted:m,onOpenDetail:c,onContextMenu:k},x.seq)),Pe(mo,{sx:{flexGrow:1,minHeight:0,display:"flex",alignItems:"flex-start"},children:kt(ws,{className:"taskbox-month-add",onClick:()=>S(e),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"flex-start",gap:.5,px:1.25,py:.75,borderBottom:`1px dashed ${h.calendar.borderColor}`,bgcolor:h.calendar.cellBg,color:h.colors.accentOnSurface,fontSize:13,fontWeight:500,opacity:0,pointerEvents:"none",transition:"opacity 0.15s","&:hover":{bgcolor:h.calendar.hoverBg}},children:[Pe(Eg,{sx:{fontSize:16}}),"\uC5C5\uBB34 \uB4F1\uB85D"]})})]})}function Es({tasks:e,googleEvents:o=[],statusOptions:t,fallbackToStartDate:n=!1,myAccountSeq:r=0,avatarSrcByName:i,onToggleCompleted:a,todayStr:s,onMoveTask:d,onAddSchedule:l,canAdd:u=!0,onOpenDetail:p,onTaskContextMenu:m}){let c=ne(),k=c.mode==="dark",[S,g]=nr(()=>Yr(new Date)),[h,b]=nr(null),[w,y]=nr(null),[v,f]=nr(null),[x,I]=nr(null),W=rn(()=>{let q=Gg(S);return Array.from({length:42},(U,j)=>Yg(q,j))},[S]),_=rn(()=>new Map(e.map(q=>[q.seq,q])),[e]),K=rn(()=>_n(o),[o]),B=rn(()=>[...new Set(W.map(q=>q.getFullYear()))],[W]),T=qt(B),L=rn(()=>{let q=new Map;for(let U of e){let j=U.due_date.slice(0,10)||(n?U.start_date.slice(0,10):"");if(!j)continue;let E=q.get(j);E?E.push(U):q.set(j,[U])}for(let U of q.values())U.sort((j,E)=>{let H=j.sort_no>0,D=E.sort_no>0;return H&&D?j.sort_no-E.sort_no:H!==D?H?-1:1:j.completed!==E.completed?j.completed?1:-1:j.seq-E.seq});return q},[e,n]),$=Kg($g(Ng,{activationConstraint:{distance:5}})),J=tr(q=>{let U=Fg(q),j=U.length>0?U:Hg(q),E=j.filter(H=>String(H.id).startsWith(Gr));return E.length>0?E:j.filter(H=>String(H.id).startsWith(Vr))},[]),R=tr(q=>{f(Number(q.active.id))},[]),ie=tr(q=>{I(q.over?String(q.over.id):null)},[]),re=rn(()=>{let q=new Map;for(let[U,j]of L)for(let E of j)q.set(E.seq,U);return q},[L]),Ce=v!==null?_.get(v)?.due_date.slice(0,10)??"":"",xe=rn(()=>{if(v===null||!x)return null;if(x.startsWith(Gr)){let q=Number(x.slice(Gr.length)),U=re.get(q);if(!U)return null;let j=(L.get(U)??[]).filter(H=>H.seq!==v),E=j.findIndex(H=>H.seq===q);return{day:U,index:E===-1?j.length:E}}if(x.startsWith(Vr)){let q=x.slice(Vr.length),U=(L.get(q)??[]).filter(j=>j.seq!==v);return{day:q,index:U.length}}return null},[v,re,x,L]),Fe=tr(q=>{let U=L.get(q)??[];if(v===null||!xe)return U;let j=_.get(v);if(!j)return U;let E=U.filter(H=>H.seq!==v);return q===xe.day?[...E.slice(0,xe.index),j,...E.slice(xe.index)]:q===Ce?E:U},[v,Ce,xe,_,L]),oe=tr(q=>{let U=v,j=xe;if(f(null),I(null),U===null||!j)return;let E=(L.get(j.day)??[]).filter(D=>D.seq!==U),H=[...E.slice(0,j.index).map(D=>D.seq),U,...E.slice(j.index).map(D=>D.seq)];d(U,j.day,H)},[v,xe,d,L]),le=v!==null?_.get(v)??null:null,ge=`${S.getFullYear()}\uB144 ${S.getMonth()+1}\uC6D4`;return kt(mo,{sx:{display:"flex",flexDirection:"column",flex:1,minHeight:0,border:`1px solid ${c.calendar.borderColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden"},children:[kt(mo,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:1,bgcolor:c.calendar.bg,borderBottom:`1px solid ${c.calendar.borderColor}`,flexShrink:0},children:[kt(mo,{sx:{display:"flex",alignItems:"center",gap:.25},children:[Pe(_s,{size:"small","aria-label":"\uC774\uC804 \uB2EC",onClick:()=>g(Ds(S,-1)),children:Pe(Pg,{sx:{fontSize:20,color:c.colors.textSecondary}})}),Pe(Mg,{size:"small",color:"inherit",onClick:()=>g(Yr(new Date)),sx:{minWidth:0,px:1,mx:1,fontSize:13,fontWeight:c.mode==="dark"?400:500,color:c.mode==="dark"?c.colors.textStrong:c.colors.textPrimary},children:"\uC624\uB298"}),Pe(_s,{size:"small","aria-label":"\uB2E4\uC74C \uB2EC",onClick:()=>g(Ds(S,1)),children:Pe(Rg,{sx:{fontSize:20,color:c.colors.textSecondary}})})]}),kt(ws,{onClick:q=>b(q.currentTarget),sx:{display:"inline-flex",alignItems:"center",gap:.25,ml:{xs:"auto",lg:0},px:.75,py:.25,borderRadius:1,fontSize:15,fontWeight:c.mode==="dark"?400:700,color:c.mode==="dark"?c.colors.textStrong:c.colors.textPrimary,"&:hover":{bgcolor:c.colors.surfaceHover}},children:[ge,Pe(zg,{sx:{fontSize:18,color:c.colors.textMuted}})]})]}),Pe(mo,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",bgcolor:c.calendar.headerBg,borderBottom:`1px solid ${c.calendar.borderColor}`,flexShrink:0,"& > *":{borderRight:`1px solid ${c.calendar.borderColor}`},"& > *:last-child":{borderRight:"none"}},children:Vg.map((q,U)=>Pe(mo,{sx:{height:Os,display:"flex",alignItems:"center",justifyContent:"center",fontSize:12.5,color:U===0?c.colors.danger:U===6?c.colors.accentOnSurface:c.colors.textSecondary},children:q},q))}),Pe(mo,{sx:{flex:1,minHeight:0},children:kt(Ag,{sensors:$,collisionDetection:J,onDragStart:R,onDragOver:ie,onDragEnd:oe,onDragCancel:()=>{f(null),I(null)},children:[Pe(Ug,{style:{height:"100%"},thumb:{width:8},children:Pe(mo,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",gridTemplateRows:"repeat(6, minmax(112px, auto))",minHeight:"100%",flexShrink:0,"& > *":{borderRight:`1px solid ${c.calendar.borderColor}`,borderBottom:`1px solid ${c.calendar.borderColor}`},"& > *:nth-of-type(7n)":{borderRight:"none"},"& > *:nth-last-of-type(-n+7)":{borderBottom:"none"}},children:W.map(q=>{let U=Ae(q);return Pe(Xg,{dayKey:U,dayNumber:q.getDate(),isToday:U===s,isOtherMonth:q.getMonth()!==S.getMonth(),weekday:q.getDay(),holidayName:T.get(U)??"",tasks:Fe(U),googleEvents:K.get(U)??[],statusOptions:t,previewSeq:xe?.day===U?v:null,myAccountSeq:r,avatarSrcByName:i,onRequestToggleCompleted:a?y:void 0,onOpenDetail:p,onTaskContextMenu:m,onAddSchedule:l,canAdd:u},U)})})}),Pe(Lg,{children:le?kt(mo,{sx:{display:"flex",alignItems:"center",gap:.5,py:.6,px:.75,borderRadius:.75,bgcolor:c.calendar.cellBg,border:`1px solid ${c.calendar.borderColor}`,boxShadow:"0 6px 16px rgba(0,0,0,0.18)",fontSize:xa,fontWeight:500,color:c.colors.textPrimary,cursor:"grabbing",whiteSpace:"nowrap"},children:[Pe(mo,{component:"span",sx:{width:6,height:6,borderRadius:"50%",bgcolor:fa[le.priority]}}),le.title]}):null})]})}),Pe(Ye,{open:!!w,anchorEl:w?.anchorEl??null,title:w?.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:w?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>y(null),onConfirm:()=>{w&&a?.(w.taskSeq,w.nextCompleted),y(null)}}),Pe(qg,{anchorEl:h,open:!!h,onClose:()=>b(null),selectedDate:S,onDateChange:q=>{g(Yr(q)),b(null)}})]})}import{useEffect as Zg,useMemo as rr,useRef as eh,useState as ka}from"react";import{Box as _o,Button as oh,IconButton as Rs}from"@mui/material";import th from"@mui/icons-material/ChevronLeft";import nh from"@mui/icons-material/ChevronRight";import rh from"@mui/icons-material/KeyboardArrowDown";import{DatePicker as ih}from"@ehfuse/mui-datetime-picker";import{Box as Tt,Button as Qg,Dialog as Jg}from"@mui/material";import{jsx as yt,jsxs as ba}from"react/jsx-runtime";function Ps({task:e,avatarSrcByName:o,onClose:t}){let n=ne(),r=e?[{label:"\uCC45\uC784\uC790",names:[String(e.manager_name??"").trim()]},{label:"\uCC38\uC870\uC790",names:e.receiver_names??[]},{label:"\uC791\uC131\uC790",names:[String(e.created_by??"").trim()]}]:[];return yt(Jg,{open:!!e,onClose:t,maxWidth:"xs",fullWidth:!0,slotProps:{paper:{sx:{borderRadius:2,m:2}}},children:e?ba(Tt,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5,bgcolor:n.colors.surface},children:[yt(Tt,{sx:{fontSize:15.5,fontWeight:600,color:n.colors.textStrong,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title}),r.map(i=>{let a=i.names.filter(s=>!!s);return ba(Tt,{sx:{display:"flex",alignItems:"flex-start",gap:1.5},children:[yt(Tt,{sx:{width:56,flexShrink:0,fontSize:13.5,color:n.colors.textSecondary,pt:.5},children:i.label}),yt(Tt,{sx:{display:"flex",flexWrap:"wrap",gap:1,minWidth:0},children:a.length===0?yt(Tt,{sx:{fontSize:14,color:n.colors.textMuted,pt:.5},children:"\uBE44\uC5B4 \uC788\uC74C"}):a.map(s=>ba(Tt,{sx:{display:"flex",alignItems:"center",gap:.75},children:[yt(Jo,{src:o?.get(s)??"",avatarSx:{width:26,height:26,fontSize:12},iconFontSize:16}),yt(Tt,{sx:{fontSize:14.5,color:n.colors.textPrimary},children:s})]},`${i.label}-${s}`))})]},i.label)}),yt(Tt,{sx:{display:"flex",justifyContent:"flex-end",pt:.5},children:yt(Qg,{size:"small",color:"inherit",onClick:t,children:"\uB2EB\uAE30"})})]}):null})}import{jsx as ro,jsxs as St}from"react/jsx-runtime";var ah=["\uC77C","\uC6D4","\uD654","\uC218","\uBAA9","\uAE08","\uD1A0"];function Ta(e){let o=new Date(e);return o.setHours(0,0,0,0),o.setDate(1),o}function zs(e){let o=t=>String(t).padStart(2,"0");return`${e.getFullYear()}-${o(e.getMonth()+1)}-${o(e.getDate())}`}function qs({tasks:e,googleEvents:o=[],statusOptions:t,todayStr:n,onOpenDetail:r,onAddSchedule:i,myAccountSeq:a=0,avatarSrcByName:s,fallbackToStartDate:d=!1}){let l=ne(),[u,p]=ka(()=>Ta(new Date)),[m,c]=ka(!1),k=rr(()=>{let I=new Date(u.getFullYear(),u.getMonth()+1,0).getDate();return Array.from({length:I},(W,_)=>{let K=new Date(u.getFullYear(),u.getMonth(),_+1);return{ymd:zs(K),dayNumber:_+1,weekday:K.getDay()}})},[u]),S=rr(()=>{let I=new Map;for(let W of e){let _=W.due_date.slice(0,10)||(d?W.start_date.slice(0,10):"");if(!_)continue;let K=I.get(_);K?K.push(W):I.set(_,[W])}for(let W of I.values())W.sort((_,K)=>_.completed!==K.completed?_.completed?1:-1:_.seq-K.seq);return I},[e,d]),g=rr(()=>d?e.filter(I=>!I.due_date.slice(0,10)&&!I.start_date.slice(0,10)).sort((I,W)=>I.completed!==W.completed?I.completed?1:-1:I.seq-W.seq):[],[e,d]),[h,b]=ka(null),w=rr(()=>_n(o),[o]),y=rr(()=>[u.getFullYear()],[u]),v=qt(y),f=eh(null),x=n.slice(0,7)===zs(u).slice(0,7);return Zg(()=>{if(!x)return;let I=B=>{let T=B?.parentElement??null;for(;T;){let L=window.getComputedStyle(T);if(/(auto|scroll)/.test(L.overflowY)&&T.scrollHeight>T.clientHeight)return T;T=T.parentElement}return null},W=()=>{let B=f.current,T=I(B);if(!T||!B)return;let L=B.getBoundingClientRect().top-T.getBoundingClientRect().top+T.scrollTop;T.scrollTop=Math.max(0,L-T.clientHeight/2+B.clientHeight/2)},_=setTimeout(W,100),K=setTimeout(W,400);return()=>{clearTimeout(_),clearTimeout(K)}},[x,u]),St(_o,{sx:{minWidth:0,maxWidth:"100%",overflow:"hidden",bgcolor:l.colors.surface},children:[St(_o,{sx:{display:"flex",alignItems:"center",gap:.5,px:1.5,py:1,flexShrink:0},children:[ro(Rs,{size:"small","aria-label":"\uC774\uC804 \uB2EC",onClick:()=>p(I=>new Date(I.getFullYear(),I.getMonth()-1,1)),children:ro(th,{sx:{fontSize:20,color:l.colors.textSecondary}})}),ro(oh,{size:"small",color:"inherit",onClick:()=>p(Ta(new Date)),sx:{minWidth:0,px:1,fontSize:13.5,color:l.mode==="dark"?l.colors.textStrong:l.colors.textPrimary},children:"\uC624\uB298"}),ro(Rs,{size:"small","aria-label":"\uB2E4\uC74C \uB2EC",onClick:()=>p(I=>new Date(I.getFullYear(),I.getMonth()+1,1)),children:ro(nh,{sx:{fontSize:20,color:l.colors.textSecondary}})}),St(_o,{onClick:()=>c(!0),sx:{ml:"auto",pr:.5,display:"flex",alignItems:"center",gap:.25,fontSize:16.5,fontWeight:l.mode==="dark"?400:700,color:l.mode==="dark"?l.colors.textStrong:l.colors.textPrimary,cursor:"pointer"},children:[u.getFullYear(),"\uB144 ",u.getMonth()+1,"\uC6D4",ro(rh,{sx:{fontSize:20,color:l.colors.textMuted}})]})]}),St(_o,{sx:{minWidth:0,overflowX:"hidden",borderTop:`1px solid ${l.calendar.borderColor}`},children:[g.length>0?St(_o,{sx:{display:"flex",alignItems:"center",gap:1,px:1,py:.75,minWidth:0,maxWidth:"100%",flexShrink:0,borderBottom:`1px solid ${l.calendar.borderColor}`},children:[St(_o,{sx:{width:52,flexShrink:0,fontSize:12.5,lineHeight:1.3,color:l.colors.textSecondary,textAlign:"center"},children:["\uB0A0\uC9DC",ro("br",{}),"\uC5C6\uC74C"]}),ro(_o,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:.5},children:g.map(I=>ro(At,{task:I,statusOptions:t,onOpenDetail:r,isMine:a>0&&Number(I.manager_account_seq??0)===a,avatarSrcByName:s,showManagerAvatar:!0,onOpenMembers:b},I.seq))})]}):null,k.map(({ymd:I,dayNumber:W,weekday:_})=>{let K=v.get(I)??"",B=I===n,T=!!K||_===0,L=S.get(I)??[],$=w.get(I)??[],J=L.length>0||$.length>0;return St(_o,{ref:B?f:void 0,onClick:i?()=>i(I):void 0,sx:{display:"flex",alignItems:"center",gap:1,px:1,minWidth:0,maxWidth:"100%",py:J?.75:.5,minHeight:44,flexShrink:0,borderBottom:`1px solid ${l.calendar.borderColor}`,...i?{cursor:"pointer"}:{}},children:[ro(_o,{sx:{width:52,flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",gap:.25},children:St(_o,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:.25,"@media (min-width:600px)":{flexDirection:"row",gap:.75}},children:[ro(_o,{component:"span",sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:30,height:30,borderRadius:"50%",fontSize:19,fontWeight:B?700:500,color:B?l.colors.surface:T?l.colors.danger:_===6?l.colors.accentOnSurface:l.colors.textPrimary,bgcolor:B?l.colors.accentOnSurface:"transparent"},children:W}),ro(_o,{component:"span",sx:{fontSize:13,color:T?l.colors.danger:_===6?l.colors.accentOnSurface:l.colors.textSecondary},children:ah[_]})]})}),St(_o,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:.5},children:[$.map(R=>ro(Dn,{event:R},R.uid)),L.map(R=>ro(At,{task:R,statusOptions:t,onOpenDetail:r,isMine:a>0&&Number(R.manager_account_seq??0)===a,avatarSrcByName:s,showManagerAvatar:!0,onOpenMembers:b},R.seq))]})]},I)})]}),ro(Ps,{task:h,avatarSrcByName:s,onClose:()=>b(null)}),ro(ih,{open:m,centered:!0,monthOnly:!0,onClose:()=>c(!1),selectedDate:u,onDateChange:I=>{p(Ta(I)),c(!1)}})]})}import{useCallback as As,useEffect as Ls,useMemo as ya,useRef as Xr,useState as Qr}from"react";import{Box as We,Tooltip as Hs}from"@mui/material";import lh from"@ehfuse/overlay-scrollbar";import sh from"@mui/icons-material/CheckCircle";import ch from"@mui/icons-material/RadioButtonUnchecked";import{DndContext as mh,PointerSensor as uh,closestCenter as dh,useSensor as ph,useSensors as fh}from"@dnd-kit/core";import{SortableContext as xh,arrayMove as gh,useSortable as hh,verticalListSortingStrategy as bh}from"@dnd-kit/sortable";import kh from"@mui/icons-material/DragIndicator";import{jsx as Le,jsxs as Lt}from"react/jsx-runtime";var Sa=36,Th=48,Ns=40,yh=24,Sh=4,Bh=14,Fs=36,Ch=12.5,Mn=220,vh={high:{bg:"#f6c6c9",border:"#e5484d"},medium:{bg:"#c5d8f6",border:"#2f80ed"},low:{bg:"#f3e3b6",border:"#d9a514"}};function an(e){let o=String(e??"").trim();if(!o)return null;let t=new Date(`${o}T00:00:00`);return Number.isNaN(t.getTime())?null:t}function jr(e,o){let t=new Date(e);return t.setDate(t.getDate()+o),t}function Ba(e,o){return Math.round((o.getTime()-e.getTime())/864e5)}function Ih({task:e,dragHandle:o,onPointerDown:t,onClick:n}){let r=ne(),i=Xr(null),[a,s]=Qr("");return Le(Hs,{title:a,arrow:!0,enterDelay:300,children:Lt(We,{onPointerDown:t,onClick:d=>n(e,d),onMouseEnter:()=>{let d=i.current;s(d&&d.scrollWidth>d.clientWidth?e.title:"")},sx:{width:Mn,flexShrink:0,position:"sticky",left:0,zIndex:2,bgcolor:r.timeline.bg,borderRight:`1px solid ${r.timeline.gridColor}`,display:"flex",alignItems:"center",gap:.5,pl:.5,pr:1.5,fontSize:15,fontWeight:r.mode==="dark"||e.completed?400:500,color:e.completed?r.colors.textMuted:r.mode==="dark"?r.colors.textStrong:r.colors.textPrimary,overflow:"hidden",whiteSpace:"nowrap",cursor:"pointer",textDecoration:e.completed?"line-through":"none","&:hover":{bgcolor:r.colors.surfaceHover}},children:[o,Le(We,{ref:i,component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title})]})})}function _h({id:e,showIndicator:o,children:t}){let n=ne(),{attributes:r,listeners:i,setNodeRef:a}=hh({id:e});return Lt(We,{ref:a,sx:{position:"relative"},children:[o?Le(We,{sx:{position:"absolute",top:-1,left:0,right:0,height:2,bgcolor:n.colors.accentOnSurface,zIndex:5}}):null,t({...r,...i})]})}function Ws({tasks:e,todayStr:o,onOpenDetail:t,onToggleChecklist:n,onReorderTasks:r,onTaskContextMenu:i}){let a=ne(),s=ya(()=>[...e].sort((T,L)=>{let $=(T.timeline_sort_no??0)>0,J=(L.timeline_sort_no??0)>0;if($&&J)return(T.timeline_sort_no??0)-(L.timeline_sort_no??0);if($!==J)return $?-1:1;let R=T.due_date||T.start_date,ie=L.due_date||L.start_date;return R!==ie?R<ie?-1:1:T.seq-L.seq}),[e]),[d,l]=Qr(null),[u,p]=Qr(null),m=fh(ph(uh,{activationConstraint:{distance:4}})),c=As(T=>{l(T.over?Number(T.over.id):null)},[]),k=As(T=>{l(null),p(null);let{active:L,over:$}=T;if(!$||L.id===$.id)return;let J=s.map(re=>re.seq),R=J.indexOf(Number(L.id)),ie=J.indexOf(Number($.id));R===-1||ie===-1||r(gh(J,R,ie))},[s,r]),S=ya(()=>{let T=an(o)??new Date,L=T,$=jr(T,21);for(let ie of s){let re=an(ie.start_date)??an(ie.due_date),Ce=an(ie.due_date)??re;re&&re<L&&(L=re),Ce&&Ce>$&&($=Ce)}let J=jr(L,-3),R=Ba(J,jr($,3))+1;return Array.from({length:R},(ie,re)=>jr(J,re))},[s,o]),g=S[0],h=S.findIndex(T=>Ae(T)===o),{dayWidths:b,dayOffsets:w,gridWidth:y}=ya(()=>{let T=S.map((J,R)=>J.getDate()===1||R===0?Th:Sa),L=[],$=0;for(let J of T)L.push($),$+=J;return{dayWidths:T,dayOffsets:L,gridWidth:$}},[S]),v=Mn+y,f=Xr(null),x=T=>{f.current={x:T.clientX,y:T.clientY}},I=(T,L)=>{let $=f.current;f.current=null,!($&&(Math.abs(L.clientX-$.x)>5||Math.abs(L.clientY-$.y)>5))&&t(T)},W=Xr(null),[_,K]=Qr(!1);Ls(()=>{let T=W.current?.getScrollContainer();if(!T)return;let L=()=>K(T.scrollHeight>T.clientHeight);L();let $=new ResizeObserver(L);return $.observe(T),()=>$.disconnect()},[s.length]);let B=Xr(!1);return Ls(()=>{if(s.length===0||B.current)return;B.current=!0;let T=window.requestAnimationFrame(()=>{let L=W.current?.getScrollContainer();!L||h<0||(L.scrollLeft=Math.max(0,w[h]-Sa*3))});return()=>window.cancelAnimationFrame(T)},[s.length]),Le(We,{sx:{flex:1,minHeight:0,minWidth:0,maxWidth:"100%",display:"flex",flexDirection:"column",border:`1px solid ${a.timeline.gridColor}`,borderRadius:"0 0 4px 4px",overflow:"hidden",bgcolor:a.timeline.headerBg},children:Le(We,{sx:{flex:1,minHeight:0,minWidth:0,contain:"inline-size"},children:Le(lh,{ref:W,style:{height:"100%"},contentStyle:{width:"max-content",minWidth:"100%"},thumb:{width:8},showHorizontalScrollbar:!0,dragScroll:{excludeClasses:["taskbox-timeline-handle"]},children:Lt(We,{sx:{width:v,position:"relative",bgcolor:a.timeline.bg},children:[Lt(We,{sx:{display:"flex",position:"sticky",top:0,zIndex:3,bgcolor:a.timeline.headerBg,borderBottom:`1px solid ${a.timeline.gridColor}`},children:[Le(We,{sx:{width:Mn,height:Fs,flexShrink:0,position:"sticky",left:0,zIndex:4,bgcolor:a.timeline.headerBg,borderRight:`1px solid ${a.timeline.gridColor}`,display:"flex",alignItems:"center",px:1.5,fontSize:13,color:a.colors.textSecondary},children:"\uC81C\uBAA9"}),S.map((T,L)=>{let $=T.getDay(),J=L===h,R=T.getDate()===1||L===0;return Le(We,{sx:{width:b[L],height:Fs,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",fontSize:Ch,fontWeight:J&&a.mode!=="dark"?700:400,color:J?a.timeline.bg:$===0?a.colors.danger:$===6?a.colors.accentOnSurface:a.colors.textSecondary,bgcolor:J?a.colors.danger:"transparent",borderRight:`1px solid ${a.timeline.gridColor}`,whiteSpace:"nowrap"},children:R?`${T.getMonth()+1}/${T.getDate()}`:T.getDate()},Ae(T))})]}),Le(mh,{sensors:m,collisionDetection:dh,onDragStart:T=>p(Number(T.active.id)),onDragOver:c,onDragEnd:k,onDragCancel:()=>{l(null),p(null)},children:Le(xh,{items:s.map(T=>String(T.seq)),strategy:bh,children:Lt(We,{sx:{position:"relative"},children:[S.map((T,L)=>{let $=T.getDay(),J=L===h;return!J&&$!==0&&$!==6?null:Le(We,{sx:{position:"absolute",top:0,bottom:0,left:Mn+w[L],width:b[L],bgcolor:J?"rgba(229,72,77,0.07)":a.colors.surfaceSubtle,zIndex:0}},`stripe-${Ae(T)}`)}),s.map((T,L)=>{let $=an(T.start_date)??an(T.due_date),J=an(T.due_date)??$,R=$?Math.min(S.length-1,Math.max(0,Ba(g,$))):0,ie=J?Math.min(S.length-1,Math.max(R,Ba(g,J))):R,re=vh[T.priority],Ce=Mn+w[R]+2,xe=w[ie]+b[ie]-w[R]-4,Fe=T.checklist??[];return Le(_h,{id:String(T.seq),showIndicator:d===T.seq&&u!==T.seq,children:oe=>Lt(We,{sx:{borderBottom:L===s.length-1&&_?"none":`1px solid ${a.timeline.gridColor}`,position:"relative",zIndex:1,opacity:u===T.seq?.45:1},children:[Lt(We,{onContextMenu:le=>i(T,le),sx:{display:"flex",height:Ns,position:"relative","&:hover":{bgcolor:"rgba(47,128,237,0.04)"}},children:[Le(Ih,{task:T,dragHandle:Le(We,{component:"span",className:"taskbox-timeline-handle",...oe,onClick:le=>le.stopPropagation(),sx:{display:"inline-flex",alignItems:"center",flexShrink:0,color:a.colors.accentOnSurface,cursor:"grab",touchAction:"none","&:hover":{color:a.colors.accentOnSurface}},children:(()=>{let le=He(T.icon||Me)??kh;return Le(le,{sx:{fontSize:17}})})()}),onPointerDown:x,onClick:I}),Le(Hs,{title:`${T.title} (${T.start_date||"?"} ~ ${T.due_date||"?"})`,arrow:!0,enterDelay:300,children:Le(We,{onPointerDown:x,onClick:le=>I(T,le),sx:{position:"absolute",top:(Ns-20)/2,left:Ce,width:Math.max(Sa-4,xe),height:20,borderRadius:1,bgcolor:re.bg,border:`1px solid ${re.border}`,opacity:T.completed?.45:1,cursor:"pointer","&:hover":{filter:"brightness(0.95)"}}})})]}),Fe.map((le,ge)=>Le(We,{sx:{display:"flex",height:yh,position:"relative",mt:ge===0?`${Sh}px`:0,mb:ge===Fe.length-1?`${Bh}px`:0},children:Le(We,{sx:{width:Mn,flexShrink:0,position:"sticky",left:0,zIndex:2,bgcolor:a.timeline.bg,borderRight:`1px solid ${a.timeline.gridColor}`,display:"flex",alignItems:"center",pl:4.25,pr:1.5,fontSize:13,color:le.checked?a.colors.textMuted:a.colors.textPrimary},children:Lt(We,{onClick:()=>n(T.seq,ge,!le.checked),sx:{display:"inline-flex",alignItems:"center",gap:.75,minWidth:0,cursor:"pointer"},children:[le.checked?Le(sh,{sx:{fontSize:17,color:a.colors.accentOnSurface,flexShrink:0}}):Le(ch,{sx:{fontSize:17,color:a.colors.textMuted,flexShrink:0}}),Le(We,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textDecoration:le.checked?"line-through":"none"},children:le.label})]})})},`${T.seq}-check-${ge}`))]})},T.seq)}),s.length===0?Le(We,{sx:{py:8,textAlign:"center",color:a.colors.textMuted,fontSize:14},children:"\uD45C\uC2DC\uD560 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]})})})]})})})})}import{jsx as ln}from"react/jsx-runtime";function Pw(e){switch(e.view){case"card":case"kanban":{let{view:o,...t}=e;return ln(ua,{...t,columnAxis:o==="kanban"?"status":"project"})}case"sprint":{let{view:o,...t}=e;return ln(ua,{...t,columnAxis:"sprint"})}case"calendar":{let{view:o,...t}=e;return ln(Is,{...t})}case"month":{let{view:o,...t}=e;return ln(Es,{...t})}case"agenda":{let{view:o,...t}=e;return ln(qs,{...t})}case"timeline":{let{view:o,...t}=e;return ln(Ws,{...t})}default:{let{view:o,...t}=e;return ln(rs,{...t})}}}var Rw=["list","card","kanban","calendar","month","timeline"];import{Box as ko}from"@mui/material";function Dh(e){let o=String(e??"").trim();if(!o)return 0;let t=0,n=!1;for(let r of o.matchAll(/(\d+(?:\.\d+)?)\s*(h|시간|m|분|d|일)/gi)){let i=parseFloat(r[1]),a=r[2].toLowerCase();n=!0,a==="m"||a==="\uBD84"?t+=i/60:a==="d"||a==="\uC77C"?t+=i*8:t+=i}if(!n){let r=parseFloat(o);Number.isFinite(r)&&(t+=r)}return t}function $s(e){let o=Math.round(e*10)/10;return`${o%1===0?o.toFixed(0):o.toFixed(1)}\uC2DC\uAC04`}function Ks(e,o,t){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||!/^\d{4}-\d{2}-\d{2}$/.test(o))return 0;let n=new Date(`${e}T00:00:00`),r=new Date(`${o}T00:00:00`);if(r<n||r.getTime()-n.getTime()>3660*864e5)return 0;let i=0;for(let a=new Date(n);a<=r;a.setDate(a.getDate()+1)){let s=a.getDay();if(s===0||s===6)continue;let d=`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}-${String(a.getDate()).padStart(2,"0")}`;t.has(d)||(i+=1)}return i}function Us(e){return e.reduce((o,t)=>t.completed?o:o+Dh(t.estimated_time),0)}import{Fragment as wh,jsx as Nt,jsxs as Ho}from"react/jsx-runtime";function Vs(e,o){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||!/^\d{4}-\d{2}-\d{2}$/.test(o))return null;let t=new Date(`${e}T00:00:00`),n=new Date(`${o}T00:00:00`);return Math.round((t.getTime()-n.getTime())/864e5)}function Gs({tasks:e,todayStr:o,showProgress:t=!0,dday:n=null,workdaysLeft:r=null,showPoints:i=!0,showHours:a=!0,showOverdue:s=!0,showInfo:d=!0,inline:l=!1}){let u=ne(),p=e.filter(I=>!I.archived),m=p.filter(I=>I.completed).length,c=p.length>0?Math.round(m/p.length*100):0,k=p.filter(I=>!I.completed&&!I.is_event&&!!I.due_date&&I.due_date.slice(0,10)<o).length,S=p.reduce((I,W)=>W.completed?I:I+(W.story_points??0),0),g=Us(p),h=t?Nt(ko,{sx:{flex:l?"0 0 110px":"1 1 auto",minWidth:0,height:u.summary.gaugeHeight,borderRadius:3,bgcolor:u.summary.gaugeTrackColor},children:Nt(ko,{sx:{height:"100%",borderRadius:3,width:`${c}%`,bgcolor:c>=100?u.summary.gaugeCompleteColor:u.summary.gaugeBarColor,transition:"width 0.2s"}})}):null,b=t?Ho(ko,{component:"span",sx:{flexShrink:0,fontSize:l?14:13,color:u.summary.textColor},children:[c,"%"]}):null,w={color:u.summary.numberColor,fontWeight:700,fontSize:l?15:14},y=p.length-m,v=Ho(wh,{children:[l?null:Ho("span",{children:["\uB0A8\uC740 ",Nt(ko,{component:"span",sx:w,children:y}),"\uAC74"]}),s&&k>0?Ho(ko,{component:"span",sx:{color:u.summary.overdueColor,fontWeight:600},children:["\uC9C0\uC5F0"," ",Nt(ko,{component:"span",sx:{fontWeight:700,fontSize:l?15:14},children:k}),"\uAC74"]}):null,i&&S>0?Ho("span",{children:[Nt(ko,{component:"span",sx:w,children:S}),"SP"]}):null,a&&g>0?Ho("span",{children:["\uC57D ",Nt(ko,{component:"span",sx:w,children:$s(g).replace("\uC2DC\uAC04","")}),"\uC2DC\uAC04"]}):null]}),f=typeof r=="number"&&Number.isFinite(r)?Ho("span",{children:["\uADFC\uBB34\uC77C ",Nt(ko,{component:"span",sx:w,children:r}),"\uC77C"]}):null,x=typeof n=="number"&&Number.isFinite(n)?Nt(ko,{component:"span",sx:{ml:l?0:"auto",flexShrink:0,px:.6,py:.1,borderRadius:.5,fontSize:12,fontWeight:600,bgcolor:u.summary.overdueColor,color:u.colors.textInverse,lineHeight:1.6},children:n===0?"D-day":n>0?`D-${n}`:`D+${-n}`}):null;return l?Ho(ko,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0,fontSize:14.5,color:u.summary.textColor,whiteSpace:"nowrap",...u.summary.sx},children:[d?v:null,d?f:null,d?x:null,h,b]}):Ho(ko,{sx:{display:"flex",flexDirection:"column",gap:.5},children:[t?Ho(ko,{sx:{display:"flex",alignItems:"center",gap:1},children:[h,b]}):null,Ho(ko,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,fontSize:13.5,color:u.summary.textColor},children:[v,f,x]})]})}import{useMemo as Mh}from"react";import{jsx as Oh}from"react/jsx-runtime";function Gw({sprint:e,tasks:o,todayStr:t,...n}){let r=e.status==="closed"?null:Vs(e.end_date,t),i=r!==null&&r>=0,a=Mh(()=>{if(!i)return[];let l=Number(t.slice(0,4)),u=Number(e.end_date.slice(0,4))||l,p=[];for(let m=l;m<=Math.max(l,u);m+=1)p.push(m);return p},[i,t,e.end_date]),s=qt(a),d=i?Ks(t,e.end_date,new Set(s.keys())):null;return Oh(Gs,{tasks:o,todayStr:t,dday:r,workdaysLeft:d,...n})}import{useEffect as Hh,useRef as Wh,useState as $h}from"react";import{Box as va}from"@mui/material";import{Children as Eh}from"react";import{Box as Ca,CircularProgress as Ph}from"@mui/material";import{jsx as Jr}from"react/jsx-runtime";var Ys={xs:2,md:3};function js(){return Jr(Ca,{sx:{position:"fixed",top:"calc(50% + 30px)",left:"50%",transform:"translate(-50%, -50%)",zIndex:1},children:Jr(Ph,{size:44,thickness:4,sx:{color:"#94a3b8"}})})}function Xs({children:e}){return Jr(Ca,{sx:{minWidth:0,display:"flex",flexDirection:"column",gap:Ys,pb:Ys},children:Eh.map(e,o=>o==null||o===!1?null:Jr(Ca,{sx:{bgcolor:"background.paper",borderRadius:"12px",boxShadow:"0 1px 3px rgba(15,23,42,0.08)",minWidth:0},children:o}))})}import{Box as Ct,Button as Ah,Checkbox as Lh,Typography as Ft}from"@mui/material";import Js from"@mui/icons-material/CheckCircle";import Nh from"@mui/icons-material/CheckCircleOutlineOutlined";import{Fragment as qh,jsx as Qs}from"react/jsx-runtime";var Rh="taskbox-search-highlight";function zh(e,o){let t=o?.keyPrefix??"hl";return e.map((n,r)=>Qs("span",{className:n.highlight?o?.highlightClassName??Rh:o?.className,style:n.highlight?{fontWeight:700,color:"#2563eb"}:void 0,children:n.text},`${t}-${n.text}-${r}`))}function Zr({text:e,keyword:o,fallback:t="-",className:n,highlightClassName:r,keyPrefix:i}){let a=String(e??"").trim()||t,s=Er(a,o);return Qs(qh,{children:zh(s,{className:n,highlightClassName:r,keyPrefix:i})})}import{jsx as fe,jsxs as On}from"react/jsx-runtime";var Fh={flexShrink:0,minWidth:64,textAlign:"center",px:.75,py:.35,borderRadius:.75,bgcolor:"#f1f5f9",color:"#64748b",fontSize:fo(12.5),fontWeight:500,lineHeight:1.4},Bt={fontSize:fo(14.5),color:"#374151",minWidth:0,lineHeight:1.45};function tt({label:e,children:o}){return On(Ct,{sx:{display:"flex",alignItems:"flex-start",gap:1,minWidth:0},children:[fe(Ct,{sx:Fh,children:e}),fe(Ct,{sx:{...Bt,flex:1,pt:.2},children:o})]})}function Zs({task:e,statusOptions:o,projectLabel:t,searchText:n,todayStr:r,onRequestToggleCompleted:i,onOpenDetail:a,onTaskContextMenu:s,targetSummary:d="",ackInfo:l,completeLocked:u=!1,unread:p=!1,noticeReadOnly:m=!1,onAckConfirm:c,onAckListClick:k,myManaged:S=!1}){let g=e.is_event?jn(e):go(e),h=Zo(e.start_date),b=Zo(e.due_date),w=!e.is_notice&&!e.completed&&!!e.due_date&&e.due_date<r,y=(e.receiver_names??[]).filter(Boolean);return On(Ct,{role:"button",tabIndex:0,onClick:()=>a(e),onKeyDown:v=>{(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),a(e))},onContextMenu:v=>s(e,v),sx:{display:"flex",flexDirection:"column",gap:.75,minWidth:0,p:1.25,cursor:"pointer",position:"relative"},children:[S?fe(Ct,{sx:{position:"absolute",left:3,top:5,bottom:5,width:3,borderRadius:"999px",bgcolor:"#2f80ed"}}):null,On(Ct,{sx:{display:"flex",alignItems:"flex-start",gap:.75,minWidth:0,mb:1},children:[!m&&!u?fe(Lh,{checked:e.completed,icon:fe(Nh,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:fe(Js,{sx:{fontSize:22,color:"#2f80ed"}}),onClick:v=>v.stopPropagation(),onChange:(v,f)=>i({anchorEl:v.currentTarget,taskSeq:e.seq,nextCompleted:f}),sx:{p:0,mt:.1,flexShrink:0}}):null,(()=>{let v=He(e.icon||(e.is_notice?xo:Me));if(!v)return null;let f=e.icon_color||(e.is_notice?"#e5484d":"#1e3a8a");return fe(v,{sx:{fontSize:19,flexShrink:0,mt:"1px",color:f}})})(),fe(Ft,{sx:{fontSize:fo(16),fontWeight:600,lineHeight:1.35,minWidth:0,flex:1,color:e.completed?"#9a9a97":"#111827",textDecoration:e.completed?"line-through":"none"},children:fe(Zr,{text:e.title,keyword:n})}),p?fe(Ct,{component:"span",sx:{flexShrink:0,px:.55,fontSize:fo(10.5),fontWeight:700,lineHeight:1.6,color:"#fff",bgcolor:"#e5484d",borderRadius:"4px"},children:"N"}):null]}),On(Ct,{sx:{display:"flex",flexDirection:"column",gap:.6,minWidth:0},children:[fe(tt,{label:g?"\uC0C1\uD0DC":"\uC911\uC694\uB3C4",children:On(Ct,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:.5},children:[g?fe(Ee,{option:g,small:!0}):null,fe(No,{priority:e.priority,small:!0})]})}),(e.label_keys??[]).length>0?fe(tt,{label:"\uB77C\uBCA8",children:fe(Ot,{labelKeys:e.label_keys,labelOptions:o})}):null,t?fe(tt,{label:"\uD504\uB85C\uC81D\uD2B8",children:fe(Ft,{sx:Bt,children:t})}):null,h?fe(tt,{label:"\uC2DC\uC791",children:fe(Ft,{sx:Bt,children:h})}):null,b?fe(tt,{label:"\uB9C8\uAC10",children:On(Ft,{sx:{...Bt,color:w?"#e5484d":Bt.color,fontWeight:w?600:400},children:[b,w?" \xB7 \uC9C0\uC5F0":""]})}):null,e.is_notice?fe(tt,{label:"\uB300\uC0C1\uC790",children:fe(Ft,{sx:Bt,children:d||"\uBAA8\uB4E0 \uC9C1\uC6D0"})}):null,e.is_notice&&l?fe(tt,{label:"\uD655\uC778",children:fe(Ah,{size:"small",variant:l.canAck?"contained":"outlined",color:"inherit",startIcon:l.acked?fe(Js,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:v=>{v.stopPropagation(),l.canAck?c?.(e):k?.(e,v.currentTarget)},sx:{py:0,px:1.25,minWidth:0,fontSize:fo(13),...l.canAck?{color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}}:{bgcolor:"#fff",borderColor:"#d5d8dc"}},children:l.canAck?"\uD655\uC778":`${l.count}/${l.total}`})}):null,!e.is_notice&&e.manager_name?fe(tt,{label:"\uCC45\uC784\uC790",children:fe(Ft,{sx:Bt,children:fe(Zr,{text:e.manager_name,keyword:n})})}):null,!e.is_notice&&y.length>0?fe(tt,{label:"\uCC38\uC870\uC790",children:fe(Ft,{sx:Bt,children:y.join(", ")})}):null,e.note?fe(tt,{label:"\uBE44\uACE0",children:fe(Ft,{sx:Bt,children:fe(Zr,{text:e.note,keyword:n})})}):null]})]})}import{jsx as En,jsxs as Kh}from"react/jsx-runtime";function TM({tasks:e,statusOptions:o,customTabs:t,loading:n,searchText:r,todayStr:i,onToggleCompleted:a,onOpenDetail:s,onTaskContextMenu:d,getTargetSummary:l,getAckInfo:u,getNoticeReadOnly:p,isTaskUnread:m,getCompleteLocked:c,onAckConfirm:k,onAckListClick:S,onEndReached:g,myAccountSeq:h=0}){let b=new Map(t.map(f=>[f.key,f.label])),[w,y]=$h(null),v=Wh(null);return Hh(()=>{let f=v.current;if(!g||!f)return;let x=new IntersectionObserver(I=>{I[0]?.isIntersecting&&g()});return x.observe(f),()=>x.disconnect()},[g,e.length]),e.length===0?n?En(js,{}):En(va,{sx:{py:6,textAlign:"center",color:"#94a3b8",fontSize:"0.9rem"},children:"\uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):Kh(va,{sx:{minWidth:0},children:[En(Xs,{children:e.map(f=>En(Zs,{myManaged:h>0&&!f.is_notice&&!f.is_event&&(f.manager_account_seq??0)===h,task:f,statusOptions:o,projectLabel:f.tab_key?b.get(f.tab_key)??"":"",searchText:r,todayStr:i,onRequestToggleCompleted:y,onOpenDetail:s,onTaskContextMenu:d,targetSummary:f.is_notice?l?.(f):void 0,ackInfo:f.is_notice?u?.(f):void 0,noticeReadOnly:f.is_notice?p?.(f):!1,unread:m?.(f)??!1,completeLocked:c?.(f)??!1,onAckConfirm:k,onAckListClick:S},f.seq))}),g?En(va,{ref:v,sx:{height:"1px"}}):null,En(Ye,{open:!!w,anchorEl:w?.anchorEl??null,title:w?.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:w?.nextCompleted?"\uC644\uB8CC":"\uD574\uC81C",onCancel:()=>y(null),onConfirm:()=>{w&&a(w.taskSeq,w.nextCompleted),y(null)}})]})}import{useEffect as Ak,useRef as Lk,useState as Oc}from"react";import{Box as ur,Button as Ec,Divider as Nk,Drawer as Fk,IconButton as La,Tooltip as Hk}from"@mui/material";import Wk from"@mui/icons-material/Close";import $k from"@mui/icons-material/ArrowBack";import Kk from"@ehfuse/overlay-scrollbar";import{Box as Ia,ButtonBase as Uh,Divider as Vh,Popover as Gh}from"@mui/material";import Yh from"@mui/icons-material/Check";import jh from"@ehfuse/overlay-scrollbar";import{jsx as sn,jsxs as oc}from"react/jsx-runtime";var ec=["#1e3a8a","#2f80ed","#06b6d4","#0fa3a3","#2f9e5b","#84cc16","#e8a33d","#d9730d","#e5484d","#e255a1","#a355c0","#8a5a2b","#57564f","#111827"];function Pn({anchorEl:e,value:o,color:t="",onSelect:n,onSelectColor:r,onClose:i}){return sn(Gh,{transitionDuration:0,open:!!e,anchorEl:e,onClose:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},marginThreshold:16,slotProps:{paper:{sx:{mt:1,maxHeight:"calc(100dvh - 96px)"}}},children:oc(Ia,{sx:{width:"min(492px, calc(100vw - 32px))"},children:[sn(jh,{style:{maxHeight:"min(432px, calc(100dvh - 240px))"},contentStyle:{minWidth:0,padding:10},thumb:{width:6},children:sn(qr,{value:o||Me,onChange:a=>{n(a),i()}})}),r?oc(Ia,{sx:{px:1.25,pb:1.25},children:[sn(Vh,{sx:{mb:1,borderColor:"#efefed"}}),sn(Ia,{sx:{display:"flex",flexWrap:"wrap",gap:.75},children:ec.map(a=>{let s=(t||ec[0])===a;return sn(Uh,{"aria-label":`\uC544\uC774\uCF58 \uC0C9 ${a}`,onClick:()=>r(a),sx:{width:26,height:26,borderRadius:"50%",bgcolor:a,display:"flex",alignItems:"center",justifyContent:"center"},children:s?sn(Yh,{sx:{fontSize:15,color:"#ffffff"}}):null},a)})})]}):null]})})}import{useState as Dc}from"react";import{Box as sr,ButtonBase as _k,Divider as cr,Menu as Dk,MenuItem as wk}from"@mui/material";import Mk from"@mui/icons-material/SubjectOutlined";import Ok from"@mui/icons-material/StickyNote2Outlined";import Ek from"@mui/icons-material/LabelOutlined";import Pk from"@mui/icons-material/DirectionsRunOutlined";import Rk from"@mui/icons-material/SpeedOutlined";import{TextField as zk}from"@ehfuse/mui-form-controls";import{InfoAlert as qk}from"@ehfuse/alerts";import{useState as Ht}from"react";import{Box as mc,Divider as fb,ListItemIcon as xb,Menu as wa,MenuItem as ir}from"@mui/material";import gb from"@mui/icons-material/Add";import oi from"@mui/icons-material/Check";import hb from"@mui/icons-material/ViewKanbanOutlined";import bb from"@mui/icons-material/CalendarTodayOutlined";import kb from"@mui/icons-material/EventOutlined";import Tb from"@mui/icons-material/PersonOutlineOutlined";import ac from"@mui/icons-material/PeopleAltOutlined";import yb from"@mui/icons-material/FlagOutlined";import lc from"@mui/icons-material/TimerOutlined";import Sb from"@mui/icons-material/NotificationsNoneOutlined";import Bb from"@mui/icons-material/InboxOutlined";import Cb from"@mui/icons-material/PlaceOutlined";import vb from"@mui/icons-material/MapOutlined";import{DatePicker as Ib,TimePicker as sc}from"@ehfuse/mui-datetime-picker";var Wo="@media (max-width: 719.95px)";function uo(e){return{[Wo]:{order:e}}}import{useEffect as Xh,useState as Qh}from"react";import{Box as Jh}from"@mui/material";import{jsx as Zh}from"react/jsx-runtime";function vt({value:e,placeholder:o,readOnly:t,onCommit:n}){let r=ne(),[i,a]=Qh(e);return Xh(()=>a(e),[e]),Zh(Jh,{component:"input",spellCheck:!1,value:i,readOnly:t,placeholder:o,onChange:s=>a(s.target.value),onBlur:()=>{i.trim()!==e&&n(i.trim())},onKeyDown:s=>{s.key==="Enter"&&s.target.blur()},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:r.colors.textPrimary,caretColor:r.colors.textPrimary,bgcolor:"transparent",p:0,"&::placeholder":{color:"#9a9a97"}}})}import{Box as _a}from"@mui/material";import{jsx as eb,jsxs as tc}from"react/jsx-runtime";function de({icon:e,label:o,onClick:t,sx:n,children:r}){return tc(_a,{sx:[{display:"flex",alignItems:"center",minHeight:26,[Wo]:{minHeight:25}},...Array.isArray(n)?n:[n]],children:[tc(_a,{sx:{display:"flex",alignItems:"center",gap:1,width:104,flexShrink:0,fontSize:13.5,color:"#787774"},children:[e,o]}),eb(_a,{onClick:t?i=>t(i.currentTarget):void 0,sx:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:.5,px:1,py:.25,borderRadius:1,fontSize:14,cursor:t?"pointer":"default","&:hover":t?{bgcolor:"#f2f2f0"}:void 0,[Wo]:{py:.25}},children:r})]})}import{Suspense as ob,lazy as tb,useEffect as nb,useState as nc}from"react";import{Box as Da,Dialog as rb,DialogContent as ib,DialogTitle as ab,IconButton as rc,Tooltip as lb}from"@mui/material";import sb from"@mui/icons-material/Close";import cb from"@mui/icons-material/Search";import{Fragment as pb,jsx as $o,jsxs as ei}from"react/jsx-runtime";function mb(e){return $o(Da,{sx:{p:3,fontSize:14,color:"#9a9a97"},children:"\uC8FC\uC18C \uAC80\uC0C9 \uBAA8\uB4C8(react-daum-postcode)\uC744 \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC9C1\uC811 \uC785\uB825\uD574 \uC8FC\uC138\uC694."})}var ub=tb(()=>import("react-daum-postcode").then(e=>({default:e.default})).catch(()=>({default:mb})));function db(e){if(e.addressType!=="R")return e.address;let o="";return e.bname!==""&&/[동|로|가]$/g.test(e.bname)&&(o+=e.bname),e.buildingName!==""&&e.apartment==="Y"&&(o+=o!==""?`, ${e.buildingName}`:e.buildingName),o!==""?`${e.address} (${o})`:e.address}function ic({value:e,placeholder:o="\uC8FC\uC18C \uC785\uB825",readOnly:t,onCommit:n}){let[r,i]=nc(e),[a,s]=nc(!1),d=Io().slots?.addressSearch;nb(()=>i(e),[e]);let l=p=>{i(p),s(!1),p!==e&&n(p)};return ei(pb,{children:[ei(Da,{sx:{display:"flex",alignItems:"center",gap:.5,flex:1,minWidth:0},children:[$o(Da,{component:"input",spellCheck:!1,value:r,readOnly:t,placeholder:o,onChange:p=>i(p.target.value),onBlur:()=>{a||r.trim()!==e&&n(r.trim())},onKeyDown:p=>{p.key==="Enter"&&(p.preventDefault(),!t&&s(!0))},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",p:0,"&::placeholder":{color:"#9a9a97"}}}),t?null:$o(lb,{title:"\uC8FC\uC18C \uAC80\uC0C9",arrow:!0,children:$o(rc,{tabIndex:-1,size:"small","aria-label":"\uC8FC\uC18C \uAC80\uC0C9",onClick:()=>s(!0),sx:{color:"#9a9a97",p:.25,flexShrink:0},children:$o(cb,{sx:{fontSize:17}})})})]}),d?$o(d,{open:a,onComplete:l,onClose:()=>s(!1)}):ei(rb,{open:a,onClose:()=>s(!1),maxWidth:"sm",fullWidth:!0,slotProps:{paper:{sx:{height:550}}},children:[ei(ab,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",pr:2},children:["\uC8FC\uC18C \uAC80\uC0C9",$o(rc,{onClick:()=>s(!1),size:"small",children:$o(sb,{})})]}),$o(ib,{style:{padding:0},dividers:!0,children:a?$o(ob,{fallback:null,children:$o(ub,{onComplete:p=>{l(db(p))},onClose:()=>s(!1),defaultQuery:r,style:{width:"100%",height:"100%"}})}):null})]})]})}import{Fragment as ti,jsx as Y,jsxs as Ko}from"react/jsx-runtime";function _b(e){let o=e?new Date(`${e}T00:00:00`):new Date;return Number.isNaN(o.getTime())?new Date:o}function cc(e){let[o="00",t="00"]=String(e??"").split(":");return{hour:/^\d{2}$/.test(o)?o:"00",minute:/^\d{2}$/.test(t)?t:"00"}}function cn({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return Y(mc,{component:"span",sx:{color:"#9a9a97"},children:e})}function ni({values:e,customTabs:o,avatarSrcByName:t,showEstimatedTime:n=!1,managerLocked:r=!1,notice:i=!1,event:a=!1,readOnly:s=!1,targetSummary:d="",narrowCollapsedSx:l,reminderLocked:u=!1,managerAction:p,hideProject:m=!1,leading:c,trailing:k,onChangeProject:S,onChangeStartDate:g,onChangeDueDate:h,onChangeReminder:b,onChangePriority:w,onChangeEstimatedTime:y,onChangeEventTime:v,onChangeEventPlace:f,onChangeEventAddress:x,onMemberEdit:I,onAddProject:W}){let[_,K]=Ht(null),[B,T]=Ht(!1),[L,$]=Ht(null),[J,R]=Ht(null),[ie,re]=Ht(null),[Ce,xe]=Ht(null),[Fe,oe]=Ht(null),[le,ge]=Ht(null),q=Re(),U=Qo(),j=D=>[uo(D),...l?Array.isArray(l)?l:[l]:[]],E=o.find(D=>D.key===e.tabKey),H=o.filter(D=>!D.archived);return Ko(ti,{children:[Ko(mc,{sx:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",columnGap:3,rowGap:.25,px:2,[Wo]:{gridTemplateColumns:"minmax(0, 1fr)"}},children:[c,m?null:Y(de,{icon:Y(hb,{sx:{fontSize:17}}),label:"\uD504\uB85C\uC81D\uD2B8",onClick:s?void 0:D=>K(D),sx:j(1),children:E?(()=>{let D=He(E.icon);return Ko(ti,{children:[D?Y(D,{sx:{fontSize:16,color:"#1e3a8a"}}):null,E.label]})})():"\uAE30\uBCF8"}),i?Y(de,{icon:Y(ac,{sx:{fontSize:17}}),label:"\uB300\uC0C1\uC790",onClick:s?void 0:()=>I("targets"),sx:uo(7),children:d||"\uBAA8\uB4E0 \uC9C1\uC6D0"}):null,!i&&!a?Y(de,{icon:Y(Tb,{sx:{fontSize:17}}),label:"\uCC45\uC784\uC790",onClick:r||s||!e.managerName&&p?void 0:()=>I("manager"),sx:uo(7),children:e.managerName?Ko(ti,{children:[Y(ho,{names:[e.managerName],size:20,avatarSrcByName:t}),e.managerName]}):p??Y(cn,{})}):null,a?null:Y(de,{icon:Y(bb,{sx:{fontSize:17}}),label:"\uC2DC\uC791\uC77C\uC790",onClick:s?void 0:D=>re(D),sx:uo(2),children:e.startDate?Zo(e.startDate):Y(cn,{})}),i?null:Y(de,{icon:Y(ac,{sx:{fontSize:17}}),label:a?"\uCC38\uC11D\uC790":"\uCC38\uC870\uC790",onClick:s?void 0:()=>I("receivers"),sx:uo(a?7:8),children:e.receiverNames.length>0?Ko(ti,{children:[Y(ho,{names:e.receiverNames,size:20,avatarSrcByName:t}),e.receiverNames.length===1?e.receiverNames[0]:null]}):Y(cn,{})}),Y(de,{icon:Y(kb,{sx:{fontSize:17}}),label:a?"\uB0A0\uC9DC":"\uB9C8\uAC10\uAE30\uD55C",onClick:s?void 0:D=>xe(D),sx:uo(3),children:e.dueDate?Zo(e.dueDate):Y(cn,{})}),a?Y(de,{icon:Y(lc,{sx:{fontSize:17}}),label:"\uC2DC\uAC01",onClick:s?void 0:D=>ge(D),sx:uo(4),children:e.eventTime?e.eventTime:Y(cn,{label:"\uC885\uC77C"})}):null,a?Y(de,{icon:Y(Cb,{sx:{fontSize:17}}),label:"\uC7A5\uC18C",sx:uo(5),children:Y(vt,{value:e.eventPlace??"",placeholder:"\uC7A5\uC18C \uC785\uB825",readOnly:s,onCommit:D=>f?.(D)})}):null,n?Y(de,{icon:Y(lc,{sx:{fontSize:17}}),label:"\uC608\uC0C1\uC2DC\uAC04",onClick:s?void 0:D=>oe(D),sx:j(4),children:e.estimatedTime?e.estimatedTime:Y(cn,{})}):null,Y(de,{icon:Y(Sb,{sx:{fontSize:17}}),label:"\uB9AC\uB9C8\uC778\uB354",onClick:s||u?void 0:D=>R(D),sx:j(a?8:5),children:e.reminder==="none"?Y(cn,{label:"\uC5C6\uC74C"}):oa(e.reminder)}),a?Y(de,{icon:Y(vb,{sx:{fontSize:17}}),label:"\uC8FC\uC18C",sx:[{gridColumn:"1 / -1"},uo(6)],children:Y(ic,{value:e.eventAddress??"",placeholder:"\uC8FC\uC18C \uC785\uB825",readOnly:s,onCommit:D=>x?.(D)})}):null,a?null:Y(de,{icon:Y(yb,{sx:{fontSize:17}}),label:"\uC911\uC694\uB3C4",onClick:s?void 0:D=>$(D),sx:j(6),children:Y(No,{priority:e.priority,small:!0})}),k]}),Ko(wa,{transitionDuration:0,anchorEl:_,open:!!_,onClose:()=>K(null),...U,children:[Ko(ir,{selected:!e.tabKey,onClick:()=>{S(""),K(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[Y(Bb,{sx:{fontSize:17,color:"#9a9a97"}}),"\uC5C6\uC74C",e.tabKey?null:Y(oi,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}})]}),H.map(D=>{let N=He(D.icon),ce=e.tabKey===D.key;return Ko(ir,{selected:ce,onClick:()=>{S(D.key),K(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[N?Y(N,{sx:{fontSize:17,color:"#1e3a8a"}}):null,D.label,ce?Y(oi,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},D.key)}),W?[Y(fb,{},"add-project-divider"),Ko(ir,{onClick:()=>T(!0),sx:{fontSize:14,color:"#787774"},children:[Y(xb,{children:Y(gb,{sx:{fontSize:18,color:"#787774"}})}),"\uD504\uB85C\uC81D\uD2B8 \uCD94\uAC00"]},"add-project")]:null]}),W?Y(Ar,{open:B,onClose:()=>T(!1),onSubmit:(D,N,ce)=>{(async()=>{let M=await W(D,N,ce);M&&S(M)})(),K(null)}}):null,Y(wa,{transitionDuration:0,anchorEl:L,open:!!L,onClose:()=>$(null),...U,children:["high","medium","low"].map(D=>Ko(ir,{selected:e.priority===D,onClick:()=>{w(D),$(null)},sx:{fontSize:14,minWidth:130,gap:1},children:[Y(No,{priority:D,small:!0}),e.priority===D?Y(oi,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},D))}),Y(wa,{transitionDuration:0,anchorEl:J,open:!!J,onClose:()=>R(null),...U,children:ea(a&&!!e.eventTime).map(D=>Ko(ir,{selected:e.reminder===D.value,onClick:()=>{b(D.value),R(null)},sx:{fontSize:14,minWidth:150,gap:1},children:[D.label,e.reminder===D.value?Y(oi,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},D.value))}),n?Y(sc,{anchorEl:Fe,open:!!Fe,onClose:()=>oe(null),value:cc(e.estimatedTime),format:"HH:mm",minuteStep:5,autoApply:!0,centered:q,locale:"ko",onChange:(D,N)=>{y?.(`${D}:${N}`),oe(null)}}):null,a?Y(sc,{anchorEl:le,open:!!le,onClose:()=>ge(null),value:cc(e.eventTime),format:"HH:mm",minuteStep:10,autoApply:!0,centered:q,locale:"ko",onChange:(D,N)=>{v?.(`${D}:${N}`),ge(null)}}):null,Y(Ib,{anchorEl:ie,open:!!ie,onClose:()=>re(null),selectedDate:_b(e.startDate),centered:q,onDateChange:D=>{g(Ae(D)),re(null)}}),Y(Pt,{anchorEl:Ce,open:!!Ce,date:e.dueDate,reminder:e.reminder,hideReminder:u,centered:q,onClose:()=>xe(null),onDateChange:h,onReminderChange:b})]})}import{useState as Db}from"react";import{Box as wb,Menu as Mb,MenuItem as Ob}from"@mui/material";import Eb from"@mui/icons-material/RepeatOutlined";import Pb from"@mui/icons-material/DevicesOutlined";import Rb from"@mui/icons-material/ScreenSearchDesktopOutlined";import zb from"@mui/icons-material/SellOutlined";import qb from"@mui/icons-material/TaskAltOutlined";import{Fragment as uc,jsx as Je,jsxs as dc}from"react/jsx-runtime";function Ma({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return Je(wb,{component:"span",sx:{color:"#9a9a97"},children:e})}function ri({values:e,readOnly:o=!1,showResolution:t=!1,onChangeRepro:n,onChangeDevice:r,onChangeWhere:i,onChangeVersion:a,onChangeResolution:s}){let[d,l]=Db(null),u=d?.field==="repro"?Ri:d?.field==="device"?zi:qi,p=m=>{d?.field==="repro"?n(m):d?.field==="device"?r(m):d?.field==="resolution"&&s?.(m),l(null)};return dc(uc,{children:[dc(uc,{children:[Je(de,{icon:Je(Eb,{sx:{fontSize:17}}),label:"\uC7AC\uD604\uBE48\uB3C4",onClick:o?void 0:m=>l({field:"repro",el:m}),children:wl(e.repro)||Je(Ma,{label:"\uC120\uD0DD"})}),Je(de,{icon:Je(Pb,{sx:{fontSize:17}}),label:"\uB514\uBC14\uC774\uC2A4",onClick:o?void 0:m=>l({field:"device",el:m}),children:Ml(e.device)||Je(Ma,{label:"\uC120\uD0DD"})}),Je(de,{icon:Je(Rb,{sx:{fontSize:17}}),label:"\uBC1C\uC0DD\uD654\uBA74",children:Je(vt,{value:e.where,placeholder:"\uC608: POS > \uC8FC\uBB38\uD604\uD669",readOnly:o,onCommit:i})}),Je(de,{icon:Je(zb,{sx:{fontSize:17}}),label:"\uBC1C\uC0DD\uBC84\uC804",children:Je(vt,{value:e.version,placeholder:"\uC608: 2026-08-06 \uBC30\uD3EC",readOnly:o,onCommit:a})}),t?Je(de,{icon:Je(qb,{sx:{fontSize:17}}),label:"\uC885\uB8CC\uC0AC\uC720",onClick:o?void 0:m=>l({field:"resolution",el:m}),children:Sr(e.resolution)||Je(Ma,{label:"\uC120\uD0DD"})}):null]}),Je(Mb,{open:!!d,anchorEl:d?.el??null,onClose:()=>l(null),transitionDuration:0,children:u.map(m=>Je(Ob,{onClick:()=>p(m.key),sx:{fontSize:14},children:m.name},m.key))})]})}import{Box as pc}from"@mui/material";import{jsxs as fc}from"react/jsx-runtime";function Po({icon:e,title:o,titleExtra:t,children:n}){return fc(pc,{sx:{px:2,display:"flex",flexDirection:"column",gap:.25},children:[fc(pc,{sx:{display:"flex",alignItems:"center",gap:1,fontSize:14.5,fontWeight:500,color:"#37352f"},children:[e,o,t]}),n]})}import{useEffect as Ab,useRef as Oa,useState as Lb}from"react";import{Box as Ea,IconButton as Nb,Tooltip as Fb}from"@mui/material";import Hb from"@mui/icons-material/ContentCopyOutlined";import Wb from"@mui/icons-material/Check";import{EhfuseEditor as $b,minimalToolbarOptions as Kb}from"@ehfuse/editor";import{jsx as mn,jsxs as Vb}from"react/jsx-runtime";function Pa(e){let o=e.trim();return o?o.startsWith("<")?e:`<p>${o}</p>`:"<p></p>"}function Ub(e){let o=e.replace(/<br\s*\/?>/gi,`
|
|
3
3
|
`).replace(/<\/(p|div|li|h[1-6]|blockquote)>/gi,`
|
|
4
4
|
`),t=document.createElement("div");return t.innerHTML=o,(t.textContent??"").replace(/\n{3,}/g,`
|
|
5
5
|
|
|
6
|
-
`).trim()}function ii({syncKey:e,value:o,onChange:t,readOnly:n=!1,minHeight:r=180}){let i=Ma(null),a=Ma(null),s=Ma(Date.now()+800),[d,l]=Ab(!1),u=Re();return qb(()=>{if(n)return;let p=Ea(o);a.current===p||a.current===o||(a.current=p,s.current=Date.now()+800,i.current?.setHtml(p))},[e,o,n]),n?Ub(Oa,{sx:{position:"relative",mt:1},children:[cn(Oa,{sx:{border:"1px solid #e0e0e0",borderRadius:1,p:"12px",pr:"40px",minHeight:r,fontSize:16,lineHeight:1.6,color:"#37352f",wordBreak:"break-word",userSelect:"none","& > p:first-of-type":{mt:0},"& > p:last-of-type":{mb:0}},dangerouslySetInnerHTML:{__html:Ea(o)}}),cn(Nb,{title:"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:cn(Lb,{size:"small","aria-label":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>{navigator.clipboard.writeText(Kb(o)).then(()=>{l(!0),window.setTimeout(()=>l(!1),1500)})},sx:{position:"absolute",top:6,right:6,color:"#9a9a97"},children:d?cn(Hb,{sx:{fontSize:17,color:"#2f9e5b"}}):cn(Fb,{sx:{fontSize:17}})})})]}):cn(Oa,{sx:{mt:1,"& .ehfuse-editor-content > p:first-of-type":{mt:0},"& .ehfuse-editor-content > p:last-of-type":{mb:0},"& .ehfuse-editor-content.ehfuse-editor-empty::before":{top:"12px",left:"12px"}},children:cn(Wb,{ref:i,defaultValue:Ea(o),showToolbar:!u,focusBorder:!0,styles:{focusBorderColor:"var(--primary)"},toolbarOptions:$b,locale:"ko",minHeight:r,placeholder:"\uB0B4\uC6A9\uC744 \uC785\uB825\uD558\uC138\uC694",contentStyle:{padding:"12px"},onChange:p=>{let m=Date.now()<s.current,c=p===a.current;a.current=p,!(m||c)&&t(p)}})})}import{useState as Pa}from"react";import{Box as Ko,IconButton as Ra,Tooltip as Vb}from"@mui/material";import Gb from"@mui/icons-material/Close";import Yb from"@mui/icons-material/AddCircle";import jb from"@mui/icons-material/AddTask";import Xb from"@mui/icons-material/Checklist";import Qb from"@mui/icons-material/CheckCircle";import Jb from"@mui/icons-material/Launch";import Zb from"@mui/icons-material/RadioButtonUnchecked";import{Fragment as ek,jsx as je,jsxs as Pn}from"react/jsx-runtime";function ai({taskSeq:e,checklist:o,onAdd:t,onToggle:n,onRemove:r,onUpdate:i,removeLocked:a=!1,onConvertToTask:s,onOpenLinkedTask:d,resolveLinkedTask:l}){let[u,p]=Pa(""),[m,c]=Pa(null),T=Re(),[B,f]=Pa(null),g=b=>{let S=b.task_seq?l?.(b.task_seq):void 0;return S?S.completed:b.checked},k=o.filter(g).length,w=()=>{u.trim()&&(t(e,u),p(""))};return Pn(Eo,{icon:je(Xb,{sx:{fontSize:19,display:"block"}}),title:Pn(ek,{children:["\uD560\uC77C",o.length>0?Pn(Ko,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:[k," / ",o.length]}):null]}),titleExtra:o.length>0?je(Ko,{sx:{flex:1,minWidth:0,ml:1,height:6,borderRadius:3,bgcolor:"#ececea"},children:je(Ko,{sx:{height:"100%",borderRadius:3,width:`${Math.round(k/o.length*100)}%`,bgcolor:"#2f80ed",transition:"width 0.2s"}})}):null,children:[je(Ko,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:o.map((b,S)=>{let h=b.task_seq?l?.(b.task_seq):void 0,x=g(b),I=!!b.task_seq;return Pn(Ko,{sx:{display:"flex",alignItems:"center",gap:1,px:1.25,py:.5,borderRadius:1,"&:hover":{bgcolor:"#f7f7f5"},"&:hover .taskbox-checklist-remove":{opacity:1},"&:hover .taskbox-checklist-convert":{opacity:1}},children:[je(Ko,{component:"span",onClick:()=>n(e,S,!x),sx:{display:"inline-flex",flexShrink:0,cursor:"pointer"},children:x?je(Qb,{sx:{fontSize:18,color:"#2f80ed"}}):je(Zb,{sx:{fontSize:18,color:"#9a9a97"}})}),m?.index===S?je(Ko,{component:"input",autoFocus:!0,spellCheck:!1,value:m.label,enterKeyHint:"done",onChange:W=>c({index:S,label:W.target.value}),onBlur:()=>{m.label.trim()&&m.label.trim()!==b.label&&i?.(e,S,m.label),c(null)},onKeyDown:W=>{W.key==="Enter"&&W.target.blur(),W.key==="Escape"&&c(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",p:0}}):je(Ko,{component:"span",onClick:I?b.task_seq&&d?()=>d(b.task_seq):void 0:a||!i||T?void 0:()=>c({index:S,label:b.label}),sx:{flex:1,minWidth:0,fontSize:14,color:x?"#9a9a97":"#37352f",textDecoration:x?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...I?d?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}:a||!i||T?{}:{cursor:"text"}},children:b.label}),I?Pn(Ko,{component:"span",onClick:b.task_seq&&d?()=>d(b.task_seq):void 0,sx:{display:"inline-flex",alignItems:"center",gap:.4,flexShrink:0,px:.75,py:.2,borderRadius:1,fontSize:12,fontWeight:500,color:"#1d4f91",bgcolor:"#e3eefb",whiteSpace:"nowrap",...d?{cursor:"pointer"}:{}},children:[je(Jb,{sx:{fontSize:12}}),h?.manager_name?.trim()||"\uC5C5\uBB34"]}):null,!a&&!I&&s?je(Vb,{title:"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",arrow:!0,enterDelay:300,disableInteractive:!0,children:je(Ra,{className:"taskbox-checklist-convert",size:"small","aria-label":"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",onClick:W=>f({anchorEl:W.currentTarget,index:S,label:b.label}),sx:{opacity:T?1:0,transition:"opacity 0.15s",color:"#9a9a97"},children:je(jb,{sx:{fontSize:16}})})}):null,a?null:je(Ra,{className:"taskbox-checklist-remove",size:"small","aria-label":"\uD560\uC77C \uC0AD\uC81C",onClick:()=>r(e,S),sx:{opacity:T?1:0,transition:"opacity 0.15s",color:"#9a9a97"},children:je(Gb,{sx:{fontSize:15}})})]},`${b.label}-${S}`)})}),Pn(Ko,{sx:{mt:.5,ml:3.25,display:"flex",alignItems:"center",gap:.5},children:[je(Ko,{component:"input",spellCheck:!1,value:u,placeholder:"+ \uD560\uC77C \uCD94\uAC00",enterKeyHint:"done",onChange:b=>p(b.target.value),onKeyDown:b=>{b.key==="Enter"&&w()},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",px:1.25,py:.75,"&::placeholder":{color:"#9a9a97"}}}),je(Ra,{size:"small","aria-label":"\uD560\uC77C \uCD94\uAC00",disabled:!u.trim(),onMouseDown:b=>b.preventDefault(),onClick:w,sx:{flexShrink:0,color:u.trim()?"#2f80ed":"#c9c8c5"},children:je(Yb,{sx:{fontSize:20}})})]}),je(Ge,{open:!!B,anchorEl:B?.anchorEl??null,title:"\uC774 \uD560\uC77C\uC744 \uBCC4\uB3C4 \uC5C5\uBB34\uB85C \uB9CC\uB4DC\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uB9CC\uB4E4\uAE30",onCancel:()=>f(null),onConfirm:()=>{B&&s?.(e,B.index,B.label),f(null)}})]})}import{useRef as ak,useState as lk}from"react";import{Box as nt,IconButton as sk}from"@mui/material";import ck from"@mui/icons-material/Close";import bc from"@mui/icons-material/AttachFileOutlined";var ok=new Set(["jpg","jpeg","png","gif","bmp","webp","svg","pdf","txt","json","xml","log","md","markdown","csv","xls","xlsx","html","htm","js","jsx","ts","tsx","css","scss","sass","less","php","py","java","c","cpp","h","hpp","cs","go","rs","rb","swift","kt","scala","sql","sh","bash","bat","ps1","yml","yaml","toml","ini","conf","mp4","avi","mov","wmv","flv","webm","mp3","wav","ogg","m4a","aac"]),xc=e=>{let o=e?.split(".").pop()?.toLowerCase()??"";return ok.has(o)};import{LinearProgress as tk}from"@mui/material";import{Fragment as nk,jsx as ik,jsxs as rk}from"react/jsx-runtime";function gc(e){let o=st(),t=o.useValue("attachmentUpload.taskSeq"),n=o.useValue("attachmentUpload.index"),r=o.useValue("attachmentUpload.total"),i=o.useValue("attachmentUpload.queue"),a=n??0;return!a||e>0&&(t??0)!==e?null:{index:a,total:r??0,queue:i??[]}}function za(){let o=st().useValue("attachmentUpload.progress");return rk(nk,{children:[o??0,"%"]})}function hc(){let o=st().useValue("attachmentUpload.progress");return ik(tk,{variant:"determinate",value:o??0,sx:{height:4,borderRadius:2,bgcolor:"#dbe9fb",mt:.75}})}import{Fragment as mk,jsx as To,jsxs as ar}from"react/jsx-runtime";function li(e){return e>=1048576?`${(e/1048576).toFixed(1)}MB`:`${Math.max(1,Math.round(e/1024))}KB`}var si={flex:1,minWidth:0,fontSize:13.5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function ci({taskSeq:e,attachments:o,onAdd:t,onRemove:n,removeLocked:r=!1,onPreview:i,onDownload:a}){let[s,d]=lk(!1),l=ak(null),u=Re(),p=Kn(),m=Ii(),c=gc(e),T=e===0,B=b=>{if(i){i(b);return}window.open(m(b.uuid??""),"_blank","noopener,noreferrer")},f=b=>{if(a){a(b);return}window.open(m(b.uuid??"",{download:!0}),"_blank","noopener,noreferrer")},g=b=>c?b+1<c.index?"done":b+1===c.index?"uploading":"waiting":"waiting",k=(b,S,h,x={})=>ar(nt,{sx:{px:1,py:.5,borderRadius:1,border:"1px solid",borderColor:x.uploading?"#d5e6fb":"#e6e6e3",bgcolor:x.uploading?"#f4f9ff":"transparent","&:hover .taskbox-file-remove":{opacity:1}},children:[ar(nt,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[To(bc,{sx:{fontSize:16,color:"#9a9a97"}}),S,To(nt,{component:"span",sx:{fontSize:12,color:x.uploading?"#2f80ed":"#9a9a97",flexShrink:0},children:h}),x.removeIndex!==void 0?To(sk,{className:"taskbox-file-remove",size:"small","aria-label":"\uCCA8\uBD80 \uC0AD\uC81C",onClick:()=>n(e,x.removeIndex),sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:To(ck,{sx:{fontSize:15}})}):null]}),x.uploading?To(hc,{}):null]},b),w=b=>{let S=xc(b.name);return To(nt,{component:"button",type:"button",onClick:()=>S?B(b):f(b),title:`${b.name} ${S?"\uBBF8\uB9AC\uBCF4\uAE30":"\uB2E4\uC6B4\uB85C\uB4DC"}`,sx:{...si,color:"#37352f",textAlign:"left",p:0,border:"none",background:"none",font:"inherit",fontSize:13.5,cursor:"pointer","&:hover":{textDecoration:"underline",color:"#2f80ed"}},children:b.name})};return ar(Eo,{icon:To(bc,{sx:{fontSize:18,display:"block"}}),title:ar(mk,{children:["\uD30C\uC77C ",o.length>0?o.length:""]}),children:[ar(nt,{sx:{display:"flex",flexDirection:"column",gap:.5,mt:1},children:[o.map((b,S)=>{let h=`${b.uuid||b.name}-${S}`;if(T){let x=g(S),I=x==="uploading";return k(h,To(nt,{component:"span",sx:{...si,color:x==="done"?"#37352f":"#9a9a97"},children:b.name}),I?To(za,{}):li(b.size),{uploading:I,removeIndex:!r&&!c?S:void 0})}return b.uuid?k(h,w(b),li(b.size),{removeIndex:r?void 0:S}):k(h,To(nt,{component:"span",title:"\uC2E4\uD30C\uC77C\uC774 \uC5C6\uB294 \uC774\uC804 \uBC29\uC2DD \uCCA8\uBD80\uC785\uB2C8\uB2E4(\uB2E4\uC6B4\uB85C\uB4DC \uBD88\uAC00) \u2014 \uB2E4\uC2DC \uCCA8\uBD80\uD574 \uC8FC\uC138\uC694.",sx:{...si,color:"#9a9a97"},children:b.name}),li(b.size),{removeIndex:r?void 0:S})}),!T&&c?c.queue.slice(c.index-1).map((b,S)=>{let h=S===0;return k(`uploading-${c.index+S}-${b.name}`,To(nt,{component:"span",sx:{...si,color:"#9a9a97"},children:b.name}),h?To(za,{}):li(b.size),{uploading:h})}):null]}),To(nt,{onClick:()=>l.current?.click(),onDragOver:b=>{b.preventDefault(),d(!0)},onDragLeave:()=>d(!1),onDrop:b=>{b.preventDefault(),d(!1);let S=Array.from(b.dataTransfer.files);S.length>0&&t(e,S)},sx:{mt:1,py:2.5,display:"flex",alignItems:"center",justifyContent:"center",gap:.5,border:"1.5px dashed",borderColor:s?"#2f80ed":"#cfcfcc",borderRadius:1,bgcolor:s?"#eef6ff":"transparent",color:"#787774",fontSize:13.5,cursor:"pointer",transition:"background-color 0.15s, border-color 0.15s","&:hover":{bgcolor:"#fafaf9",borderColor:"#9a9a97"}},children:u?`\uD30C\uC77C\uC744 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${p}MB)`:`\uD30C\uC77C\uC744 \uB04C\uC5B4\uB2E4 \uB193\uAC70\uB098 \uD074\uB9AD\uD574 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${p}MB)`}),To(nt,{component:"input",ref:l,type:"file",multiple:!0,onChange:b=>{let S=Array.from(b.target.files??[]);S.length>0&&t(e,S),b.target.value=""},sx:{display:"none"}})]})}import{useState as hk}from"react";import{Checkbox as bk,Divider as kk,ListItemIcon as Tk,Menu as yk,MenuItem as Sc}from"@mui/material";import Sk from"@mui/icons-material/Add";import{useEffect as uk,useState as kc}from"react";import{Box as qa,Button as dk}from"@mui/material";import{FormDialog as pk}from"@ehfuse/mui-form-dialog";import{ClearTextField as fk}from"@ehfuse/mui-form-controls";import{ColorPicker as xk}from"@ehfuse/mui-color-picker";import{ErrorAlert as gk}from"@ehfuse/alerts";import{jsx as lr,jsxs as Aa}from"react/jsx-runtime";var Tc="#2f80ed";function yc({open:e,onClose:o,onSubmit:t}){let[n,r]=kc(""),[i,a]=kc(Tc);uk(()=>{e&&(r(""),a(Tc))},[e]);let s=()=>{let u=n.trim();if(!u){gk("\uB77C\uBCA8 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}t(u,i),o()},d=Pl(i),l=Aa(qa,{children:[Aa(qa,{sx:{display:"flex",alignItems:"center",gap:1.5,mt:.5},children:[lr(fk,{label:"\uB77C\uBCA8 \uC774\uB984",value:n,onChange:u=>r(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),s())},fullWidth:!0,autoFocus:!0}),lr(xk,{value:i,onChange:u=>a(u),shape:"circle",colorSize:28})]}),Aa(qa,{sx:{mt:2,display:"flex",alignItems:"center",gap:1,fontSize:13,color:"#787774"},children:["\uBBF8\uB9AC\uBCF4\uAE30",lr(Ee,{option:{key:"__preview__",name:n.trim()||"\uB77C\uBCA8",...d}})]})]});return lr(pk,{open:e,onClose:o,maxWidth:"xs",title:"\uC0C8 \uB77C\uBCA8 \uCD94\uAC00",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-add-label",sections:[{id:"add-label",showTitle:!1,children:l}],actions:{showCancelButton:!0,right:lr(dk,{variant:"contained",onClick:s,children:"\uCD94\uAC00"})}})}import{Fragment as Bk,jsx as Rn,jsxs as mi}from"react/jsx-runtime";function ui({anchorEl:e,selectedKeys:o,labelOptions:t,onToggle:n,onAddLabel:r,onClose:i}){let[a,s]=hk(!1),d=Qo();return mi(Bk,{children:[mi(yk,{anchorEl:e,open:!!e,onClose:i,transitionDuration:0,...d,children:[t.map(l=>{let u=o.includes(l.key);return mi(Sc,{onClick:()=>n(l.key),sx:{fontSize:14,minWidth:170,gap:1},children:[Rn(bk,{size:"small",checked:u,sx:{p:0}}),Rn(Ee,{option:l})]},l.key)}),Rn(kk,{}),mi(Sc,{onClick:()=>s(!0),sx:{fontSize:14,color:"#787774"},children:[Rn(Tk,{children:Rn(Sk,{sx:{fontSize:18,color:"#787774"}})}),"\uB77C\uBCA8 \uCD94\uAC00"]})]}),Rn(yc,{open:a,onClose:()=>s(!1),onSubmit:r})]})}function Bc(e,o){let t=Number(e.author_account_seq??0);return o.filter(n=>{let r=Number(n.account_seq??0);return r>0&&r!==t})}function Cc(e,o){let t=(e.target_account_seqs??[]).filter(p=>p>0);if(t.length===0)return null;let n=new Set(t),r=Bc(e,o),i=new Map;for(let p of r){let m=String(p.department??"").trim();if(!m)continue;let c=i.get(m)??[];c.push(p),i.set(m,c)}let a=[],s=new Set;for(let[p,m]of i)if(m.every(T=>n.has(Number(T.account_seq??0)))){a.push(p);for(let T of m)s.add(Number(T.account_seq??0))}let d=new Map(r.map(p=>[Number(p.account_seq??0),p.name])),l=e.target_names??[],u=[];return t.forEach((p,m)=>{s.has(p)||u.push(d.get(p)??l[m]??"\uC774\uB984\uC5C6\uC74C")}),{teamNames:a,individualNames:u}}function di(e,o){let t=Cc(e,o);return t?[...t.teamNames,...t.individualNames].join(", "):"\uBAA8\uB4E0 \uC9C1\uC6D0"}function LE(e,o){let t=Cc(e,o);return t?{kind:"members",teamNames:t.teamNames,individualNames:t.individualNames}:{kind:"everyone"}}function vc(e,o,t){let n=(e.target_account_seqs??[]).filter(u=>u>0),r=Bc(e,o),i=n.length>0?n.length:r.length,a=e.acks??[],s=t>0&&a.some(u=>u.account_seq===t),d=t>0&&Number(e.author_account_seq??0)===t,l=n.length===0||n.includes(t);return{count:a.length,total:i,acked:s,canAck:t>0&&!d&&l&&!s&&!e.completed}}function Ic(e,o){let t=Number(o)||50,n=t*1024*1024,r=e.filter(s=>s.size>n),i=e.filter(s=>s.size<=n),a=r.length>0?`\uD30C\uC77C\uC740 1\uAC1C\uB2F9 \uCD5C\uB300 ${t}MB \uAE4C\uC9C0 \uCCA8\uBD80\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
|
|
7
|
-
\uC81C\uC678\uB41C \uD30C\uC77C: ${r.map(s=>s.name).join(", ")}`:null;return{accepted:i,rejected:r,message:a}}import{Fragment as pi,jsx as Te,jsxs as mr}from"react/jsx-runtime";var wc="#0f9d58";function Dc({form:e,statusOptions:o,customTabs:t,sprints:n=[],avatarSrcByName:r,isNotice:i=!1,hideProject:a=!1,hideBug:s=!1,hideLabel:d=!1,employees:l=[],myAccountSeq:u=0,onMemberEdit:p,onAddProject:m,onAddLabelOption:c,contentSyncKey:T="create"}){let B=st(),f=Kn(),g=e.useFormValue("manager_name"),k=e.useFormValue("receiver_names"),w=e.useFormValue("start_date"),b=!!e.useFormValue("is_event"),S=!!e.useFormValue("is_bug"),h=e.useFormValue("bug_repro")??"",x=e.useFormValue("bug_device")??"",I=e.useFormValue("bug_where")??"",W=e.useFormValue("bug_version")??"",D=e.useFormValue("event_time")??"",J=e.useFormValue("event_place")??"",C=e.useFormValue("event_address")??"",y=e.useFormValue("due_date"),L=e.useFormValue("reminder"),$=e.useFormValue("priority"),Q=e.useFormValue("content"),ie=e.useFormValue("checklist")??[],re=e.useFormValue("tab_key"),Ce=e.useFormValue("sprint_seq")??0,xe=e.useFormValue("story_points")??0,Ne=t.find(M=>M.key===re&&M.useSprints),oe=Ne?n.filter(M=>`custom-${M.group_seq}`===re):[],[le,ge]=_c(null),q=e.useFormValue("label_keys"),[K,Y]=_c(null),E=e.useFormValue("target_names"),H=e.useFormValue("target_account_seqs"),N=B.useValue("createAttachmentFiles")??[],ce=i?di({author_account_seq:u,target_names:E,target_account_seqs:H},l):"";return mr(pi,{children:[i?null:Te(sr,{sx:{display:"flex",gap:1.25,px:2,pb:1.5,flexShrink:0},children:[{value:"task",label:"\uC5C5\uBB34"},{value:"event",label:"\uC77C\uC815"},...s?[]:[{value:"bug",label:"\uC624\uB958"}]].map(M=>{let ae=S?"bug":b?"event":"task",me=ae===M.value;return Te(Ck,{onClick:()=>{if(ae===M.value)return;e.setFormValue("is_event",M.value==="event"),e.setFormValue("is_bug",M.value==="bug"),e.setFormValue("is_open",M.value==="bug");let he=e.getFormValue("icon"),Oe=e.getFormValue("icon_color"),A=[Me,"event",Un].includes(he),U=!Oe||Oe===wc||Oe===Vn;A&&e.setFormValue("icon",M.value==="event"?"event":M.value==="bug"?Un:Me),U&&e.setFormValue("icon_color",M.value==="event"?wc:M.value==="bug"?Vn:"")},sx:{px:1.75,py:.75,borderRadius:99,fontSize:13.5,fontWeight:me?600:400,color:me?"#ffffff":"#787774",bgcolor:me?"#2563eb":"#f4f4f2"},children:M.label},M.label)})}),Te(cr,{sx:{borderColor:"#e6e6e3"}}),mr(sr,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:.25},children:[Te(ni,{hideProject:a,values:{tabKey:re,managerName:g,receiverNames:k,startDate:w,dueDate:y,reminder:L,priority:$,eventTime:D,eventPlace:J,eventAddress:C},customTabs:t,avatarSrcByName:r,notice:i,event:b,onChangeEventTime:M=>e.setFormValue("event_time",M),onChangeEventPlace:M=>e.setFormValue("event_place",M),onChangeEventAddress:M=>e.setFormValue("event_address",M),targetSummary:ce,onChangeProject:M=>e.setFormValue("tab_key",M),onAddProject:m,onChangeStartDate:M=>e.setFormValue("start_date",M),onChangeDueDate:M=>e.setFormValue("due_date",M),onChangeReminder:M=>e.setFormValue("reminder",M),onChangePriority:M=>e.setFormValue("priority",M),onMemberEdit:p,trailing:mr(pi,{children:[Ne&&!b&&!i?mr(pi,{children:[Te(de,{icon:Te(Mk,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:M=>ge(M),children:Ce>0?oe.find(M=>M.seq===Ce)?.name??"\uC0AD\uC81C\uB41C \uBAA9\uD45C":Te(sr,{component:"span",sx:{color:"#9a9a97"},children:"\uBBF8\uBC30\uC815"})}),Te(de,{icon:Te(Ok,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",children:Te(vt,{value:xe>0?String(xe):"",placeholder:"\uBBF8\uCD94\uC815",onCommit:M=>e.setFormValue("story_points",Number(M.replace(/[^0-9.]/g,""))||0)})})]}):null,S?Te(ri,{values:{repro:h,device:x,where:I,version:W},onChangeRepro:M=>e.setFormValue("bug_repro",M),onChangeDevice:M=>e.setFormValue("bug_device",M),onChangeWhere:M=>e.setFormValue("bug_where",M),onChangeVersion:M=>e.setFormValue("bug_version",M)}):null]}),leading:b||d?null:Te(sr,{sx:{gridColumn:"1 / -1"},children:Te(de,{icon:Te(Dk,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:M=>Y(M),children:(q??[]).length>0?Te(Ot,{labelKeys:q??[],labelOptions:o}):Te(sr,{component:"span",sx:{color:"#9a9a97"},children:"\uBE44\uC5B4 \uC788\uC74C"})})})}),Te(cr,{sx:{my:1.5,borderColor:"#e6e6e3"}}),Te(Eo,{icon:Te(_k,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",children:Te(ii,{syncKey:T,value:Q,onChange:M=>e.setFormValue("content",M)})}),b?null:Te(cr,{sx:{my:1.5,borderColor:"#e6e6e3"}}),b?null:Te(ai,{taskSeq:0,checklist:ie,onAdd:(M,ae)=>e.setFormValue("checklist",[...ie,{label:ae,checked:!1}]),onToggle:(M,ae,me)=>e.setFormValue("checklist",ie.map((he,Oe)=>Oe===ae?{...he,checked:me}:he)),onRemove:(M,ae)=>e.setFormValue("checklist",ie.filter((me,he)=>he!==ae)),onUpdate:(M,ae,me)=>e.setFormValue("checklist",ie.map((he,Oe)=>Oe===ae?{...he,label:me}:he))}),Te(cr,{sx:{my:1.5,borderColor:"#e6e6e3"}}),Te(ci,{taskSeq:0,attachments:N.map(M=>({name:M.name,size:M.size})),onAdd:(M,ae)=>{let me=Ic(ae,f);me.message&&Pk(me.message),me.accepted.length!==0&&B.setValue("createAttachmentFiles",[...B.getValue("createAttachmentFiles")??[],...me.accepted])},onRemove:(M,ae)=>B.setValue("createAttachmentFiles",N.filter((me,he)=>he!==ae))}),S?null:mr(pi,{children:[Te(cr,{sx:{my:1.5,borderColor:"#e6e6e3"}}),Te(Eo,{icon:Te(wk,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:Te(Ek,{form:e,name:"note",placeholder:"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",sx:{mt:1}})})]})]}),Te(vk,{transitionDuration:0,anchorEl:le,open:!!le,onClose:()=>ge(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...oe.map(M=>({seq:M.seq,label:Mo(M)}))].map(M=>Te(Ik,{onClick:()=>{e.setFormValue("sprint_seq",M.seq),ge(null)},sx:{fontSize:14,minWidth:170},children:M.label},M.seq))}),Te(ui,{anchorEl:K,selectedKeys:q??[],labelOptions:o,onToggle:M=>e.setFormValue("label_keys",vr(q??[],M)),onAddLabel:(M,ae)=>c?.(M,ae),onClose:()=>Y(null)})]})}import{Fragment as Wk,jsx as io,jsxs as fi}from"react/jsx-runtime";function I5({open:e,onClose:o,...t}){let{form:n,presetDueDate:r="",presetTabKey:i="",presetManager:a=null,isNotice:s=!1,defaultBug:d=!1}=t,l=st(),u=zk(!1),[p,m]=Mc(0),[c,T]=Mc(null),B=n.useFormValue("title"),f=n.useFormValue("icon"),g=n.useFormValue("icon_color"),k=!!n.useFormValue("is_event"),w=!!n.useFormValue("is_bug"),b=Re(),h=l.useValue("createSubmitting")??!1,x=kn(f||Me);return Rk(()=>{let I=u.current;u.current=e,!(!e||I)&&(n.setFormValues({...n.getFormValues(),title:"",icon:s?xo:d?Un:Me,icon_color:s?"#e5484d":d?Vn:"",manager_name:a?.name??"",manager_account_seq:a?.accountSeq??0,receiver_names:[],receiver_account_seqs:[],is_notice:s,is_event:!1,is_bug:d,is_open:d,bug_repro:"",bug_device:"",bug_where:"",bug_version:"",event_time:"",event_place:"",event_address:"",target_names:[],target_account_seqs:[],start_date:qe(new Date),due_date:r,reminder:"none",priority:"medium",note:"",content:"",checklist:[],tab_key:i}),l.setValue("createAttachmentFiles",[]),m(W=>W+1))},[e]),fi(Wk,{children:[io(Ak,{anchor:"right",open:e,onClose:o,sx:{zIndex:I=>I.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:fi(ur,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[fi(ur,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[b?io(La,{"aria-label":"\uB2EB\uAE30",onClick:o,sx:{color:"#6b7280"},children:io(Fk,{})}):null,io(Lk,{title:"\uC544\uC774\uCF58 \uBCC0\uACBD",arrow:!0,children:io(La,{size:"small",onClick:I=>T(I.currentTarget),sx:{color:g||"#1e3a8a"},children:io(x,{sx:{fontSize:20}})})}),io(ur,{component:"input",autoFocus:!0,spellCheck:!1,value:B,placeholder:s?"\uACF5\uC9C0 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":k?"\uC77C\uC815 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":w?"\uC5B4\uB5A4 \uC624\uB958\uC778\uC9C0 \uD55C \uC904\uB85C \uC801\uC5B4\uC8FC\uC138\uC694":"\uC5C5\uBB34 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694",onChange:I=>n.setFormValue("title",I.target.value),sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:18,fontWeight:500,color:"#37352f",p:0,m:0,"&::placeholder":{color:"#c9c8c5",fontWeight:400}}}),b?null:io(La,{"aria-label":"\uB2EB\uAE30",onClick:o,sx:{color:"#6b7280"},children:io(Nk,{})})]}),io(ur,{sx:{flex:1,minHeight:0},children:io(Hk,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:io(Dc,{...t,contentSyncKey:`create-${p}`})})}),io(qk,{sx:{borderColor:"#e6e6e3"}}),fi(ur,{sx:{display:"flex",justifyContent:"flex-end",gap:1,px:2,py:1.5,flexShrink:0},children:[io(Oc,{onClick:o,color:"inherit",disabled:h,children:"\uCDE8\uC18C"}),io(Oc,{onClick:n.submit,variant:"contained",disabled:h,children:h?"\uB4F1\uB85D \uC911\u2026":"\uB4F1\uB85D"})]})]})}),io(En,{anchorEl:c,value:f,color:g||"#1e3a8a",onSelect:I=>n.setFormValue("icon",I),onSelectColor:I=>n.setFormValue("icon_color",I),onClose:()=>T(null)})]})}import{useEffect as VT,useRef as GT,useState as YT}from"react";import{Box as ki,Divider as nm,Drawer as jT}from"@mui/material";import XT from"@mui/icons-material/CheckCircle";import QT from"@ehfuse/overlay-scrollbar";import{FormDialog as JT}from"@ehfuse/mui-form-dialog";import{SuccessAlert as ZT}from"@ehfuse/alerts";import{useRef as Ec,useState as Fa}from"react";import{Box as Be,Button as Pc,Chip as Ac,IconButton as mn,Tooltip as $k}from"@mui/material";import Rc from"@mui/icons-material/Send";import{TextField as Kk}from"@ehfuse/mui-form-controls";import Uk from"@mui/icons-material/Close";import Vk from"@mui/icons-material/EditOutlined";import Gk from"@mui/icons-material/Favorite";import Yk from"@mui/icons-material/FavoriteBorderOutlined";import jk from"@mui/icons-material/CheckCircle";import Xk from"@mui/icons-material/CheckCircleOutlineOutlined";import Ha from"@mui/icons-material/AttachFileOutlined";import Qk from"@mui/icons-material/ImageOutlined";var Na=e=>{if(e===0)return"0 Bytes";let o=1024,t=["Bytes","KB","MB","GB","TB"],n=Math.floor(Math.log(e)/Math.log(o));return parseFloat((e/Math.pow(o,n)).toFixed(2))+" "+t[n]};import{Fragment as qc,jsx as te,jsxs as ao}from"react/jsx-runtime";function zc({kind:e,reactions:o,myAccountSeq:t,onToggle:n}){let r=o??[],i=t>0&&r.some(l=>l.account_seq===t),a=e==="like"?"\uC88B\uC544\uC694":"\uD655\uC778",s=r.length===0?a:te(Be,{sx:{whiteSpace:"pre-line",fontSize:12},children:r.map(l=>`${l.name} \xB7 ${l.time}`).join(`
|
|
8
|
-
`)}),d=e==="like"?"#e5484d":"#2f80ed";return te(
|
|
6
|
+
`).trim()}function ii({syncKey:e,value:o,onChange:t,readOnly:n=!1,minHeight:r=180}){let i=Oa(null),a=Oa(null),s=Oa(Date.now()+800),[d,l]=Lb(!1),u=Re();return Ab(()=>{if(n)return;let p=Pa(o);a.current===p||a.current===o||(a.current=p,s.current=Date.now()+800,i.current?.setHtml(p))},[e,o,n]),n?Vb(Ea,{sx:{position:"relative",mt:1},children:[mn(Ea,{sx:{border:"1px solid #e0e0e0",borderRadius:1,p:"12px",pr:"40px",minHeight:r,fontSize:16,lineHeight:1.6,color:"#37352f",wordBreak:"break-word",userSelect:"none","& > p:first-of-type":{mt:0},"& > p:last-of-type":{mb:0}},dangerouslySetInnerHTML:{__html:Pa(o)}}),mn(Fb,{title:"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:mn(Nb,{size:"small","aria-label":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>{navigator.clipboard.writeText(Ub(o)).then(()=>{l(!0),window.setTimeout(()=>l(!1),1500)})},sx:{position:"absolute",top:6,right:6,color:"#9a9a97"},children:d?mn(Wb,{sx:{fontSize:17,color:"#2f9e5b"}}):mn(Hb,{sx:{fontSize:17}})})})]}):mn(Ea,{sx:{mt:1,"& .ehfuse-editor-content > p:first-of-type":{mt:0},"& .ehfuse-editor-content > p:last-of-type":{mb:0},"& .ehfuse-editor-content.ehfuse-editor-empty::before":{top:"12px",left:"12px"}},children:mn($b,{ref:i,defaultValue:Pa(o),showToolbar:!u,focusBorder:!0,styles:{focusBorderColor:"var(--primary)"},toolbarOptions:Kb,locale:"ko",minHeight:r,placeholder:"\uB0B4\uC6A9\uC744 \uC785\uB825\uD558\uC138\uC694",contentStyle:{padding:"12px"},onChange:p=>{let m=Date.now()<s.current,c=p===a.current;a.current=p,!(m||c)&&t(p)}})})}import{useState as ai}from"react";import{Box as To,Button as xc,Dialog as Gb,IconButton as Ra,TextField as Yb,Tooltip as jb}from"@mui/material";import Xb from"@mui/icons-material/Close";import Qb from"@mui/icons-material/AddCircle";import Jb from"@mui/icons-material/AddTask";import Zb from"@mui/icons-material/Checklist";import ek from"@mui/icons-material/CheckCircle";import ok from"@mui/icons-material/Launch";import tk from"@mui/icons-material/RadioButtonUnchecked";import{Fragment as nk,jsx as qe,jsxs as Wt}from"react/jsx-runtime";function li({taskSeq:e,checklist:o,onAdd:t,onToggle:n,onRemove:r,onUpdate:i,removeLocked:a=!1,onConvertToTask:s,onOpenLinkedTask:d,resolveLinkedTask:l}){let[u,p]=ai(""),[m,c]=ai(null),k=Re(),[S,g]=ai(null),[h,b]=ai(null),w=f=>{let x=f.task_seq?l?.(f.task_seq):void 0;return x?x.completed:f.checked},y=o.filter(w).length,v=()=>{u.trim()&&(t(e,u),p(""))};return Wt(Po,{icon:qe(Zb,{sx:{fontSize:19,display:"block"}}),title:Wt(nk,{children:["\uD560\uC77C",o.length>0?Wt(To,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:[y," / ",o.length]}):null]}),titleExtra:o.length>0?qe(To,{sx:{flex:1,minWidth:0,ml:1,height:6,borderRadius:3,bgcolor:"#ececea"},children:qe(To,{sx:{height:"100%",borderRadius:3,width:`${Math.round(y/o.length*100)}%`,bgcolor:"#2f80ed",transition:"width 0.2s"}})}):null,children:[qe(To,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:o.map((f,x)=>{let I=f.task_seq?l?.(f.task_seq):void 0,W=w(f),_=!!f.task_seq;return Wt(To,{sx:{display:"flex",alignItems:"center",gap:1,px:1.25,py:.5,borderRadius:1,"&:hover":{bgcolor:"#f7f7f5"},"&:hover .taskbox-checklist-remove":{opacity:1},"&:hover .taskbox-checklist-convert":{opacity:1}},children:[qe(To,{component:"span",onClick:()=>n(e,x,!W),sx:{display:"inline-flex",flexShrink:0,cursor:"pointer"},children:W?qe(ek,{sx:{fontSize:18,color:"#2f80ed"}}):qe(tk,{sx:{fontSize:18,color:"#9a9a97"}})}),m?.index===x?qe(To,{component:"input",autoFocus:!0,spellCheck:!1,value:m.label,enterKeyHint:"done",onChange:K=>c({index:x,label:K.target.value}),onBlur:()=>{m.label.trim()&&m.label.trim()!==f.label&&i?.(e,x,m.label),c(null)},onKeyDown:K=>{K.key==="Enter"&&K.target.blur(),K.key==="Escape"&&c(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",p:0}}):qe(To,{component:"span",onClick:_?f.task_seq&&d?()=>d(f.task_seq):void 0:a||!i?void 0:k?()=>g({index:x,label:f.label}):()=>c({index:x,label:f.label}),sx:{flex:1,minWidth:0,fontSize:14,color:W?"#9a9a97":"#37352f",textDecoration:W?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",..._?d?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}:a||!i?{}:{cursor:"text"}},children:f.label}),_?Wt(To,{component:"span",onClick:f.task_seq&&d?()=>d(f.task_seq):void 0,sx:{display:"inline-flex",alignItems:"center",gap:.4,flexShrink:0,px:.75,py:.2,borderRadius:1,fontSize:12,fontWeight:500,color:"#1d4f91",bgcolor:"#e3eefb",whiteSpace:"nowrap",...d?{cursor:"pointer"}:{}},children:[qe(ok,{sx:{fontSize:12}}),I?.manager_name?.trim()||"\uC5C5\uBB34"]}):null,!a&&!_&&s?qe(jb,{title:"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",arrow:!0,enterDelay:300,disableInteractive:!0,children:qe(Ra,{className:"taskbox-checklist-convert",size:"small","aria-label":"\uC5C5\uBB34\uB85C \uB9CC\uB4E4\uAE30",onClick:K=>b({anchorEl:K.currentTarget,index:x,label:f.label}),sx:{opacity:k?1:0,transition:"opacity 0.15s",color:"#9a9a97"},children:qe(Jb,{sx:{fontSize:16}})})}):null,a?null:qe(Ra,{className:"taskbox-checklist-remove",size:"small","aria-label":"\uD560\uC77C \uC0AD\uC81C",onClick:()=>r(e,x),sx:{opacity:k?1:0,transition:"opacity 0.15s",color:"#9a9a97"},children:qe(Xb,{sx:{fontSize:15}})})]},`${f.label}-${x}`)})}),Wt(To,{sx:{mt:.5,ml:3.25,display:"flex",alignItems:"center",gap:.5},children:[qe(To,{component:"input",spellCheck:!1,value:u,placeholder:"+ \uD560\uC77C \uCD94\uAC00",enterKeyHint:"done",onChange:f=>p(f.target.value),onKeyDown:f=>{f.key==="Enter"&&v()},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:14,color:"#37352f",bgcolor:"transparent",px:1.25,py:.75,"&::placeholder":{color:"#9a9a97"}}}),qe(Ra,{size:"small","aria-label":"\uD560\uC77C \uCD94\uAC00",disabled:!u.trim(),onMouseDown:f=>f.preventDefault(),onClick:v,sx:{flexShrink:0,color:u.trim()?"#2f80ed":"#c9c8c5"},children:qe(Qb,{sx:{fontSize:20}})})]}),qe(Ye,{open:!!h,anchorEl:h?.anchorEl??null,title:"\uC774 \uD560\uC77C\uC744 \uBCC4\uB3C4 \uC5C5\uBB34\uB85C \uB9CC\uB4DC\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uB9CC\uB4E4\uAE30",onCancel:()=>b(null),onConfirm:()=>{h&&s?.(e,h.index,h.label),b(null)}}),qe(Gb,{open:!!S,onClose:()=>g(null),maxWidth:"xs",fullWidth:!0,slotProps:{paper:{sx:{borderRadius:2,m:2}}},children:Wt(To,{sx:{p:2,display:"flex",flexDirection:"column",gap:1.5},children:[qe(To,{sx:{fontSize:15.5,fontWeight:600,color:"#37352f"},children:"\uD560\uC77C \uC218\uC815"}),qe(Yb,{autoFocus:!0,fullWidth:!0,size:"small",value:S?.label??"",onChange:f=>g(x=>x&&{...x,label:f.target.value}),onKeyDown:f=>{if(f.key!=="Enter")return;let x=S;x&&x.label.trim()&&i?.(e,x.index,x.label.trim()),g(null)}}),Wt(To,{sx:{display:"flex",justifyContent:"flex-end",gap:1},children:[qe(xc,{color:"inherit",onClick:()=>g(null),children:"\uCDE8\uC18C"}),qe(xc,{variant:"contained",disabled:!S?.label.trim(),onClick:()=>{S&&S.label.trim()&&i?.(e,S.index,S.label.trim()),g(null)},children:"\uD655\uC778"})]})]})})]})}import{useRef as ck,useState as mk}from"react";import{Box as nt,IconButton as uk}from"@mui/material";import dk from"@mui/icons-material/Close";import kc from"@mui/icons-material/AttachFileOutlined";var rk=new Set(["jpg","jpeg","png","gif","bmp","webp","svg","pdf","txt","json","xml","log","md","markdown","csv","xls","xlsx","html","htm","js","jsx","ts","tsx","css","scss","sass","less","php","py","java","c","cpp","h","hpp","cs","go","rs","rb","swift","kt","scala","sql","sh","bash","bat","ps1","yml","yaml","toml","ini","conf","mp4","avi","mov","wmv","flv","webm","mp3","wav","ogg","m4a","aac"]),gc=e=>{let o=e?.split(".").pop()?.toLowerCase()??"";return rk.has(o)};import{LinearProgress as ik}from"@mui/material";import{Fragment as ak,jsx as sk,jsxs as lk}from"react/jsx-runtime";function hc(e){let o=st(),t=o.useValue("attachmentUpload.taskSeq"),n=o.useValue("attachmentUpload.index"),r=o.useValue("attachmentUpload.total"),i=o.useValue("attachmentUpload.queue"),a=n??0;return!a||e>0&&(t??0)!==e?null:{index:a,total:r??0,queue:i??[]}}function za(){let o=st().useValue("attachmentUpload.progress");return lk(ak,{children:[o??0,"%"]})}function bc(){let o=st().useValue("attachmentUpload.progress");return sk(ik,{variant:"determinate",value:o??0,sx:{height:4,borderRadius:2,bgcolor:"#dbe9fb",mt:.75}})}import{Fragment as pk,jsx as yo,jsxs as ar}from"react/jsx-runtime";function si(e){return e>=1048576?`${(e/1048576).toFixed(1)}MB`:`${Math.max(1,Math.round(e/1024))}KB`}var ci={flex:1,minWidth:0,fontSize:13.5,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function mi({taskSeq:e,attachments:o,onAdd:t,onRemove:n,removeLocked:r=!1,onPreview:i,onDownload:a}){let[s,d]=mk(!1),l=ck(null),u=Re(),p=Kn(),m=_i(),c=hc(e),k=e===0,S=y=>{if(i){i(y);return}window.open(m(y.uuid??""),"_blank","noopener,noreferrer")},g=y=>{if(a){a(y);return}window.open(m(y.uuid??"",{download:!0}),"_blank","noopener,noreferrer")},h=y=>c?y+1<c.index?"done":y+1===c.index?"uploading":"waiting":"waiting",b=(y,v,f,x={})=>ar(nt,{sx:{px:1,py:.5,borderRadius:1,border:"1px solid",borderColor:x.uploading?"#d5e6fb":"#e6e6e3",bgcolor:x.uploading?"#f4f9ff":"transparent","&:hover .taskbox-file-remove":{opacity:1}},children:[ar(nt,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[yo(kc,{sx:{fontSize:16,color:"#9a9a97"}}),v,yo(nt,{component:"span",sx:{fontSize:12,color:x.uploading?"#2f80ed":"#9a9a97",flexShrink:0},children:f}),x.removeIndex!==void 0?yo(uk,{className:"taskbox-file-remove",size:"small","aria-label":"\uCCA8\uBD80 \uC0AD\uC81C",onClick:()=>n(e,x.removeIndex),sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:yo(dk,{sx:{fontSize:15}})}):null]}),x.uploading?yo(bc,{}):null]},y),w=y=>{let v=gc(y.name);return yo(nt,{component:"button",type:"button",onClick:()=>v?S(y):g(y),title:`${y.name} ${v?"\uBBF8\uB9AC\uBCF4\uAE30":"\uB2E4\uC6B4\uB85C\uB4DC"}`,sx:{...ci,color:"#37352f",textAlign:"left",p:0,border:"none",background:"none",font:"inherit",fontSize:13.5,cursor:"pointer","&:hover":{textDecoration:"underline",color:"#2f80ed"}},children:y.name})};return ar(Po,{icon:yo(kc,{sx:{fontSize:18,display:"block"}}),title:ar(pk,{children:["\uD30C\uC77C ",o.length>0?o.length:""]}),children:[ar(nt,{sx:{display:"flex",flexDirection:"column",gap:.5,mt:1},children:[o.map((y,v)=>{let f=`${y.uuid||y.name}-${v}`;if(k){let x=h(v),I=x==="uploading";return b(f,yo(nt,{component:"span",sx:{...ci,color:x==="done"?"#37352f":"#9a9a97"},children:y.name}),I?yo(za,{}):si(y.size),{uploading:I,removeIndex:!r&&!c?v:void 0})}return y.uuid?b(f,w(y),si(y.size),{removeIndex:r?void 0:v}):b(f,yo(nt,{component:"span",title:"\uC2E4\uD30C\uC77C\uC774 \uC5C6\uB294 \uC774\uC804 \uBC29\uC2DD \uCCA8\uBD80\uC785\uB2C8\uB2E4(\uB2E4\uC6B4\uB85C\uB4DC \uBD88\uAC00) \u2014 \uB2E4\uC2DC \uCCA8\uBD80\uD574 \uC8FC\uC138\uC694.",sx:{...ci,color:"#9a9a97"},children:y.name}),si(y.size),{removeIndex:r?void 0:v})}),!k&&c?c.queue.slice(c.index-1).map((y,v)=>{let f=v===0;return b(`uploading-${c.index+v}-${y.name}`,yo(nt,{component:"span",sx:{...ci,color:"#9a9a97"},children:y.name}),f?yo(za,{}):si(y.size),{uploading:f})}):null]}),yo(nt,{onClick:()=>l.current?.click(),onDragOver:y=>{y.preventDefault(),d(!0)},onDragLeave:()=>d(!1),onDrop:y=>{y.preventDefault(),d(!1);let v=Array.from(y.dataTransfer.files);v.length>0&&t(e,v)},sx:{mt:1,py:2.5,display:"flex",alignItems:"center",justifyContent:"center",gap:.5,border:"1.5px dashed",borderColor:s?"#2f80ed":"#cfcfcc",borderRadius:1,bgcolor:s?"#eef6ff":"transparent",color:"#787774",fontSize:13.5,cursor:"pointer",transition:"background-color 0.15s, border-color 0.15s","&:hover":{bgcolor:"#fafaf9",borderColor:"#9a9a97"}},children:u?`\uD30C\uC77C\uC744 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${p}MB)`:`\uD30C\uC77C\uC744 \uB04C\uC5B4\uB2E4 \uB193\uAC70\uB098 \uD074\uB9AD\uD574 \uCCA8\uBD80\uD558\uC138\uC694 (\uCD5C\uB300 ${p}MB)`}),yo(nt,{component:"input",ref:l,type:"file",multiple:!0,onChange:y=>{let v=Array.from(y.target.files??[]);v.length>0&&t(e,v),y.target.value=""},sx:{display:"none"}})]})}import{useState as Tk}from"react";import{Checkbox as yk,Divider as Sk,ListItemIcon as Bk,Menu as Ck,MenuItem as Bc}from"@mui/material";import vk from"@mui/icons-material/Add";import{useEffect as fk,useState as Tc}from"react";import{Box as qa,Button as xk}from"@mui/material";import{FormDialog as gk}from"@ehfuse/mui-form-dialog";import{ClearTextField as hk}from"@ehfuse/mui-form-controls";import{ColorPicker as bk}from"@ehfuse/mui-color-picker";import{ErrorAlert as kk}from"@ehfuse/alerts";import{jsx as lr,jsxs as Aa}from"react/jsx-runtime";var yc="#2f80ed";function Sc({open:e,onClose:o,onSubmit:t}){let[n,r]=Tc(""),[i,a]=Tc(yc);fk(()=>{e&&(r(""),a(yc))},[e]);let s=()=>{let u=n.trim();if(!u){kk("\uB77C\uBCA8 \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}t(u,i),o()},d=Pl(i),l=Aa(qa,{children:[Aa(qa,{sx:{display:"flex",alignItems:"center",gap:1.5,mt:.5},children:[lr(hk,{label:"\uB77C\uBCA8 \uC774\uB984",value:n,onChange:u=>r(u.target.value),onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),s())},fullWidth:!0,autoFocus:!0}),lr(bk,{value:i,onChange:u=>a(u),shape:"circle",colorSize:28})]}),Aa(qa,{sx:{mt:2,display:"flex",alignItems:"center",gap:1,fontSize:13,color:"#787774"},children:["\uBBF8\uB9AC\uBCF4\uAE30",lr(Ee,{option:{key:"__preview__",name:n.trim()||"\uB77C\uBCA8",...d}})]})]});return lr(gk,{open:e,onClose:o,maxWidth:"xs",title:"\uC0C8 \uB77C\uBCA8 \uCD94\uAC00",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-add-label",sections:[{id:"add-label",showTitle:!1,children:l}],actions:{showCancelButton:!0,right:lr(xk,{variant:"contained",onClick:s,children:"\uCD94\uAC00"})}})}import{Fragment as Ik,jsx as Rn,jsxs as ui}from"react/jsx-runtime";function di({anchorEl:e,selectedKeys:o,labelOptions:t,onToggle:n,onAddLabel:r,onClose:i}){let[a,s]=Tk(!1),d=Qo();return ui(Ik,{children:[ui(Ck,{anchorEl:e,open:!!e,onClose:i,transitionDuration:0,...d,children:[t.map(l=>{let u=o.includes(l.key);return ui(Bc,{onClick:()=>n(l.key),sx:{fontSize:14,minWidth:170,gap:1},children:[Rn(yk,{size:"small",checked:u,sx:{p:0}}),Rn(Ee,{option:l})]},l.key)}),Rn(Sk,{}),ui(Bc,{onClick:()=>s(!0),sx:{fontSize:14,color:"#787774"},children:[Rn(Bk,{children:Rn(vk,{sx:{fontSize:18,color:"#787774"}})}),"\uB77C\uBCA8 \uCD94\uAC00"]})]}),Rn(Sc,{open:a,onClose:()=>s(!1),onSubmit:r})]})}function Cc(e,o){let t=Number(e.author_account_seq??0);return o.filter(n=>{let r=Number(n.account_seq??0);return r>0&&r!==t})}function vc(e,o){let t=(e.target_account_seqs??[]).filter(p=>p>0);if(t.length===0)return null;let n=new Set(t),r=Cc(e,o),i=new Map;for(let p of r){let m=String(p.department??"").trim();if(!m)continue;let c=i.get(m)??[];c.push(p),i.set(m,c)}let a=[],s=new Set;for(let[p,m]of i)if(m.every(k=>n.has(Number(k.account_seq??0)))){a.push(p);for(let k of m)s.add(Number(k.account_seq??0))}let d=new Map(r.map(p=>[Number(p.account_seq??0),p.name])),l=e.target_names??[],u=[];return t.forEach((p,m)=>{s.has(p)||u.push(d.get(p)??l[m]??"\uC774\uB984\uC5C6\uC74C")}),{teamNames:a,individualNames:u}}function pi(e,o){let t=vc(e,o);return t?[...t.teamNames,...t.individualNames].join(", "):"\uBAA8\uB4E0 \uC9C1\uC6D0"}function HE(e,o){let t=vc(e,o);return t?{kind:"members",teamNames:t.teamNames,individualNames:t.individualNames}:{kind:"everyone"}}function Ic(e,o,t){let n=(e.target_account_seqs??[]).filter(u=>u>0),r=Cc(e,o),i=n.length>0?n.length:r.length,a=e.acks??[],s=t>0&&a.some(u=>u.account_seq===t),d=t>0&&Number(e.author_account_seq??0)===t,l=n.length===0||n.includes(t);return{count:a.length,total:i,acked:s,canAck:t>0&&!d&&l&&!s&&!e.completed}}function _c(e,o){let t=Number(o)||50,n=t*1024*1024,r=e.filter(s=>s.size>n),i=e.filter(s=>s.size<=n),a=r.length>0?`\uD30C\uC77C\uC740 1\uAC1C\uB2F9 \uCD5C\uB300 ${t}MB \uAE4C\uC9C0 \uCCA8\uBD80\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
|
|
7
|
+
\uC81C\uC678\uB41C \uD30C\uC77C: ${r.map(s=>s.name).join(", ")}`:null;return{accepted:i,rejected:r,message:a}}import{Fragment as fi,jsx as Te,jsxs as mr}from"react/jsx-runtime";var wc="#0f9d58";function Mc({form:e,statusOptions:o,customTabs:t,sprints:n=[],avatarSrcByName:r,isNotice:i=!1,hideProject:a=!1,hideBug:s=!1,hideLabel:d=!1,employees:l=[],myAccountSeq:u=0,onMemberEdit:p,onAddProject:m,onAddLabelOption:c,contentSyncKey:k="create"}){let S=st(),g=Kn(),h=e.useFormValue("manager_name"),b=e.useFormValue("receiver_names"),w=e.useFormValue("start_date"),y=!!e.useFormValue("is_event"),v=!!e.useFormValue("is_bug"),f=e.useFormValue("bug_repro")??"",x=e.useFormValue("bug_device")??"",I=e.useFormValue("bug_where")??"",W=e.useFormValue("bug_version")??"",_=e.useFormValue("event_time")??"",K=e.useFormValue("event_place")??"",B=e.useFormValue("event_address")??"",T=e.useFormValue("due_date"),L=e.useFormValue("reminder"),$=e.useFormValue("priority"),J=e.useFormValue("content"),ie=e.useFormValue("checklist")??[],re=e.useFormValue("tab_key"),Ce=e.useFormValue("sprint_seq")??0,xe=e.useFormValue("story_points")??0,Fe=t.find(M=>M.key===re&&M.useSprints),oe=Fe?n.filter(M=>`custom-${M.group_seq}`===re):[],[le,ge]=Dc(null),q=e.useFormValue("label_keys"),[U,j]=Dc(null),E=e.useFormValue("target_names"),H=e.useFormValue("target_account_seqs"),N=S.useValue("createAttachmentFiles")??[],ce=i?pi({author_account_seq:u,target_names:E,target_account_seqs:H},l):"";return mr(fi,{children:[i?null:Te(sr,{sx:{display:"flex",gap:1.25,px:2,pb:1.5,flexShrink:0},children:[{value:"task",label:"\uC5C5\uBB34"},{value:"event",label:"\uC77C\uC815"},...s?[]:[{value:"bug",label:"\uC624\uB958"}]].map(M=>{let ae=v?"bug":y?"event":"task",me=ae===M.value;return Te(_k,{onClick:()=>{if(ae===M.value)return;e.setFormValue("is_event",M.value==="event"),e.setFormValue("is_bug",M.value==="bug"),e.setFormValue("is_open",M.value==="bug");let he=e.getFormValue("icon"),Oe=e.getFormValue("icon_color"),A=[Me,"event",Un].includes(he),V=!Oe||Oe===wc||Oe===Vn;A&&e.setFormValue("icon",M.value==="event"?"event":M.value==="bug"?Un:Me),V&&e.setFormValue("icon_color",M.value==="event"?wc:M.value==="bug"?Vn:"")},sx:{px:1.75,py:.75,borderRadius:99,fontSize:13.5,fontWeight:me?600:400,color:me?"#ffffff":"#787774",bgcolor:me?"#2563eb":"#f4f4f2"},children:M.label},M.label)})}),Te(cr,{sx:{borderColor:"#e6e6e3"}}),mr(sr,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:.25},children:[Te(ni,{hideProject:a,values:{tabKey:re,managerName:h,receiverNames:b,startDate:w,dueDate:T,reminder:L,priority:$,eventTime:_,eventPlace:K,eventAddress:B},customTabs:t,avatarSrcByName:r,notice:i,event:y,onChangeEventTime:M=>e.setFormValue("event_time",M),onChangeEventPlace:M=>e.setFormValue("event_place",M),onChangeEventAddress:M=>e.setFormValue("event_address",M),targetSummary:ce,onChangeProject:M=>e.setFormValue("tab_key",M),onAddProject:m,onChangeStartDate:M=>e.setFormValue("start_date",M),onChangeDueDate:M=>e.setFormValue("due_date",M),onChangeReminder:M=>e.setFormValue("reminder",M),onChangePriority:M=>e.setFormValue("priority",M),onMemberEdit:p,trailing:mr(fi,{children:[Fe&&!y&&!i?mr(fi,{children:[Te(de,{icon:Te(Pk,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:M=>ge(M),children:Ce>0?oe.find(M=>M.seq===Ce)?.name??"\uC0AD\uC81C\uB41C \uBAA9\uD45C":Te(sr,{component:"span",sx:{color:"#9a9a97"},children:"\uBBF8\uBC30\uC815"})}),Te(de,{icon:Te(Rk,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",children:Te(vt,{value:xe>0?String(xe):"",placeholder:"\uBBF8\uCD94\uC815",onCommit:M=>e.setFormValue("story_points",Number(M.replace(/[^0-9.]/g,""))||0)})})]}):null,v?Te(ri,{values:{repro:f,device:x,where:I,version:W},onChangeRepro:M=>e.setFormValue("bug_repro",M),onChangeDevice:M=>e.setFormValue("bug_device",M),onChangeWhere:M=>e.setFormValue("bug_where",M),onChangeVersion:M=>e.setFormValue("bug_version",M)}):null]}),leading:y||d?null:Te(sr,{sx:{gridColumn:"1 / -1"},children:Te(de,{icon:Te(Ek,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:M=>j(M),children:(q??[]).length>0?Te(Ot,{labelKeys:q??[],labelOptions:o}):Te(sr,{component:"span",sx:{color:"#9a9a97"},children:"\uBE44\uC5B4 \uC788\uC74C"})})})}),Te(cr,{sx:{my:1.5,borderColor:"#e6e6e3"}}),Te(Po,{icon:Te(Mk,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",children:Te(ii,{syncKey:k,value:J,onChange:M=>e.setFormValue("content",M)})}),y?null:Te(cr,{sx:{my:1.5,borderColor:"#e6e6e3"}}),y?null:Te(li,{taskSeq:0,checklist:ie,onAdd:(M,ae)=>e.setFormValue("checklist",[...ie,{label:ae,checked:!1}]),onToggle:(M,ae,me)=>e.setFormValue("checklist",ie.map((he,Oe)=>Oe===ae?{...he,checked:me}:he)),onRemove:(M,ae)=>e.setFormValue("checklist",ie.filter((me,he)=>he!==ae)),onUpdate:(M,ae,me)=>e.setFormValue("checklist",ie.map((he,Oe)=>Oe===ae?{...he,label:me}:he))}),Te(cr,{sx:{my:1.5,borderColor:"#e6e6e3"}}),Te(mi,{taskSeq:0,attachments:N.map(M=>({name:M.name,size:M.size})),onAdd:(M,ae)=>{let me=_c(ae,g);me.message&&qk(me.message),me.accepted.length!==0&&S.setValue("createAttachmentFiles",[...S.getValue("createAttachmentFiles")??[],...me.accepted])},onRemove:(M,ae)=>S.setValue("createAttachmentFiles",N.filter((me,he)=>he!==ae))}),v?null:mr(fi,{children:[Te(cr,{sx:{my:1.5,borderColor:"#e6e6e3"}}),Te(Po,{icon:Te(Ok,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:Te(zk,{form:e,name:"note",placeholder:"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",sx:{mt:1}})})]})]}),Te(Dk,{transitionDuration:0,anchorEl:le,open:!!le,onClose:()=>ge(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...oe.map(M=>({seq:M.seq,label:Oo(M)}))].map(M=>Te(wk,{onClick:()=>{e.setFormValue("sprint_seq",M.seq),ge(null)},sx:{fontSize:14,minWidth:170},children:M.label},M.seq))}),Te(di,{anchorEl:U,selectedKeys:q??[],labelOptions:o,onToggle:M=>e.setFormValue("label_keys",vr(q??[],M)),onAddLabel:(M,ae)=>c?.(M,ae),onClose:()=>j(null)})]})}import{Fragment as Uk,jsx as io,jsxs as xi}from"react/jsx-runtime";function w5({open:e,onClose:o,...t}){let{form:n,presetDueDate:r="",presetTabKey:i="",presetManager:a=null,isNotice:s=!1,defaultBug:d=!1}=t,l=st(),u=Lk(!1),[p,m]=Oc(0),[c,k]=Oc(null),S=n.useFormValue("title"),g=n.useFormValue("icon"),h=n.useFormValue("icon_color"),b=!!n.useFormValue("is_event"),w=!!n.useFormValue("is_bug"),y=Re(),f=l.useValue("createSubmitting")??!1,x=Tn(g||Me);return Ak(()=>{let I=u.current;u.current=e,!(!e||I)&&(n.setFormValues({...n.getFormValues(),title:"",icon:s?xo:d?Un:Me,icon_color:s?"#e5484d":d?Vn:"",manager_name:a?.name??"",manager_account_seq:a?.accountSeq??0,receiver_names:[],receiver_account_seqs:[],is_notice:s,is_event:!1,is_bug:d,is_open:d,bug_repro:"",bug_device:"",bug_where:"",bug_version:"",event_time:"",event_place:"",event_address:"",target_names:[],target_account_seqs:[],start_date:Ae(new Date),due_date:r,reminder:"none",priority:"medium",note:"",content:"",checklist:[],tab_key:i}),l.setValue("createAttachmentFiles",[]),m(W=>W+1))},[e]),xi(Uk,{children:[io(Fk,{anchor:"right",open:e,onClose:o,sx:{zIndex:I=>I.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:xi(ur,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[xi(ur,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[y?io(La,{"aria-label":"\uB2EB\uAE30",onClick:o,sx:{color:"#6b7280"},children:io($k,{})}):null,io(Hk,{title:"\uC544\uC774\uCF58 \uBCC0\uACBD",arrow:!0,children:io(La,{size:"small",onClick:I=>k(I.currentTarget),sx:{color:h||"#1e3a8a"},children:io(x,{sx:{fontSize:20}})})}),io(ur,{component:"input",autoFocus:!0,spellCheck:!1,value:S,placeholder:s?"\uACF5\uC9C0 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":b?"\uC77C\uC815 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694":w?"\uC5B4\uB5A4 \uC624\uB958\uC778\uC9C0 \uD55C \uC904\uB85C \uC801\uC5B4\uC8FC\uC138\uC694":"\uC5C5\uBB34 \uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694",onChange:I=>n.setFormValue("title",I.target.value),sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:18,fontWeight:500,color:"#37352f",p:0,m:0,"&::placeholder":{color:"#c9c8c5",fontWeight:400}}}),y?null:io(La,{"aria-label":"\uB2EB\uAE30",onClick:o,sx:{color:"#6b7280"},children:io(Wk,{})})]}),io(ur,{sx:{flex:1,minHeight:0},children:io(Kk,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:io(Mc,{...t,contentSyncKey:`create-${p}`})})}),io(Nk,{sx:{borderColor:"#e6e6e3"}}),xi(ur,{sx:{display:"flex",justifyContent:"flex-end",gap:1,px:2,py:1.5,flexShrink:0},children:[io(Ec,{onClick:o,color:"inherit",disabled:f,children:"\uCDE8\uC18C"}),io(Ec,{onClick:n.submit,variant:"contained",disabled:f,children:f?"\uB4F1\uB85D \uC911\u2026":"\uB4F1\uB85D"})]})]})}),io(Pn,{anchorEl:c,value:g,color:h||"#1e3a8a",onSelect:I=>n.setFormValue("icon",I),onSelectColor:I=>n.setFormValue("icon_color",I),onClose:()=>k(null)})]})}import{useEffect as jT,useRef as XT,useState as QT}from"react";import{Box as Ti,Divider as rm,Drawer as JT}from"@mui/material";import ZT from"@mui/icons-material/CheckCircle";import ey from"@ehfuse/overlay-scrollbar";import{FormDialog as oy}from"@ehfuse/mui-form-dialog";import{SuccessAlert as ty}from"@ehfuse/alerts";import{useRef as Pc,useState as Fa}from"react";import{Box as Be,Button as Rc,Chip as Lc,IconButton as un,Tooltip as Vk}from"@mui/material";import zc from"@mui/icons-material/Send";import{TextField as Gk}from"@ehfuse/mui-form-controls";import Yk from"@mui/icons-material/Close";import jk from"@mui/icons-material/EditOutlined";import Xk from"@mui/icons-material/Favorite";import Qk from"@mui/icons-material/FavoriteBorderOutlined";import Jk from"@mui/icons-material/CheckCircle";import Zk from"@mui/icons-material/CheckCircleOutlineOutlined";import Ha from"@mui/icons-material/AttachFileOutlined";import eT from"@mui/icons-material/ImageOutlined";var Na=e=>{if(e===0)return"0 Bytes";let o=1024,t=["Bytes","KB","MB","GB","TB"],n=Math.floor(Math.log(e)/Math.log(o));return parseFloat((e/Math.pow(o,n)).toFixed(2))+" "+t[n]};import{Fragment as Ac,jsx as te,jsxs as ao}from"react/jsx-runtime";function qc({kind:e,reactions:o,myAccountSeq:t,onToggle:n}){let r=o??[],i=t>0&&r.some(l=>l.account_seq===t),a=e==="like"?"\uC88B\uC544\uC694":"\uD655\uC778",s=r.length===0?a:te(Be,{sx:{whiteSpace:"pre-line",fontSize:12},children:r.map(l=>`${l.name} \xB7 ${l.time}`).join(`
|
|
8
|
+
`)}),d=e==="like"?"#e5484d":"#2f80ed";return te(Vk,{title:s,arrow:!0,enterDelay:300,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:ao(Be,{sx:{display:"inline-flex",alignItems:"center"},children:[te(un,{size:"small","aria-label":`\uB313\uAE00 ${a}`,onClick:n,sx:{color:i?d:"#c9c8c5",p:.5},children:e==="like"?i?te(Xk,{sx:{fontSize:16}}):te(Qk,{sx:{fontSize:16}}):i?te(Jk,{sx:{fontSize:16}}):te(Zk,{sx:{fontSize:16}})}),r.length>0?te(Be,{component:"span",sx:{fontSize:12,color:i?d:"#9a9a97",ml:-.25},children:r.length}):null]})})}function Nc({taskSeq:e,comments:o,currentUserName:t="",myAccountSeq:n=0,avatarSrcByName:r,onUpdate:i,onRemove:a,onToggleReaction:s}){let[d,l]=Fa(null),u=Io().slots?.avatar;return ao(Be,{sx:{px:2,pb:2,display:"flex",flexDirection:"column",gap:.25},children:[ao(Be,{sx:{fontSize:14.5,fontWeight:500,color:"#37352f"},children:["\uB313\uAE00",o.length>0?` (${o.length})`:""]}),o.length===0?te(Be,{sx:{mt:1,fontSize:13.5,color:"#9a9a97"},children:"\uB4F1\uB85D\uB41C \uB313\uAE00\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):null,te(Be,{sx:{display:"flex",flexDirection:"column",gap:1,mt:1},children:o.map((p,m)=>ao(Be,{sx:{display:"flex",gap:1.5,alignItems:"flex-start","&:hover .taskbox-comment-actions":{opacity:1,pointerEvents:"auto"},"&:not(:last-child)":{borderBottom:"1px dashed #e0dfdc",pb:1}},children:[(()=>{let c=r?.get(p.author)??"";return u?te(Be,{sx:{display:"inline-flex",flexShrink:0},children:te(u,{name:p.author,src:c||void 0,size:44})}):te(Be,{sx:{display:"inline-flex",flexShrink:0},children:te(Jo,{src:c,avatarSx:{width:44,height:44,fontSize:20,borderRadius:"50%",...Sn[0]},iconFontSize:24})})})(),ao(Be,{sx:{flex:1,minWidth:0},children:[ao(Be,{sx:{display:"flex",alignItems:"center",gap:.75,minWidth:0,position:"relative"},children:[te(Be,{component:"span",sx:{fontSize:14.5,fontWeight:700,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p.author}),te(Be,{component:"span",sx:{fontSize:12.5,color:"#9a9a97",flexShrink:0,whiteSpace:"nowrap"},children:p.time}),ao(Be,{sx:{display:"flex",alignItems:"center",gap:.25,ml:"auto",flexShrink:0},children:[te(qc,{kind:"like",reactions:p.likes,myAccountSeq:n,onToggle:()=>s?.(e,m,"like")}),te(qc,{kind:"ack",reactions:p.acks,myAccountSeq:n,onToggle:()=>s?.(e,m,"ack")})]}),t&&p.author===t?ao(Be,{className:"taskbox-comment-actions",sx:{display:"flex",alignItems:"center",gap:.25,position:"absolute",right:0,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",backgroundColor:"#fff",opacity:0,transition:"opacity 0.15s"},children:[te(un,{size:"small","aria-label":"\uB313\uAE00 \uC218\uC815",onClick:()=>l({index:m,text:p.text}),sx:{color:"#9a9a97"},children:te(jk,{sx:{fontSize:15}})}),te(un,{size:"small","aria-label":"\uB313\uAE00 \uC0AD\uC81C",onClick:()=>{a(e,m),l(null)},sx:{color:"#9a9a97"},children:te(Yk,{sx:{fontSize:15}})})]}):null]}),d?.index===m?ao(Be,{sx:{mt:.5},children:[te(Be,{component:"textarea",autoFocus:!0,spellCheck:!1,value:d.text,onChange:c=>l({index:m,text:c.target.value}),sx:{width:"100%",minHeight:56,border:"1px solid #dedddb",borderRadius:1,outline:"none",font:"inherit",fontSize:14,p:1,resize:"vertical"}}),ao(Be,{sx:{display:"flex",justifyContent:"flex-end",gap:.75,mt:.5},children:[te(Rc,{size:"small",color:"inherit",onClick:()=>l(null),children:"\uCDE8\uC18C"}),te(Rc,{size:"small",variant:"contained",disabled:!d.text.trim(),onClick:()=>{i(e,m,d.text),l(null)},children:"\uC800\uC7A5"})]})]}):ao(Be,{children:[p.text?te(Be,{sx:{fontSize:15,whiteSpace:"pre-wrap"},children:p.text}):null,(p.attachments??[]).length>0?te(Be,{sx:{display:"flex",flexWrap:"wrap",gap:.5,mt:.5},children:(p.attachments??[]).map((c,k)=>te(Lc,{size:"small",icon:te(Ha,{sx:{fontSize:14}}),label:`${c.name} (${Na(c.size)})`,sx:{fontSize:12,bgcolor:"#f1f5f9"}},`${c.name}-${k}`))}):null]})]})]},`${p.time}-${m}`))})]})}function Fc({onSubmit:e}){let[o,t]=Fa(""),[n,r]=Fa([]),i=Pc(null),a=Pc(null),s=Re(),d=p=>{let m=Array.from(p??[]).map(c=>({name:c.name,size:c.size}));m.length!==0&&r(c=>[...c,...m].slice(0,10))},l=()=>{let p=o.trim();!p&&n.length===0||(e(p,n.length>0?n:void 0),t(""),r([]))},u=ao(Ac,{children:[te(un,{size:"small","aria-label":"\uD30C\uC77C \uCCA8\uBD80",onClick:()=>i.current?.click(),sx:{color:"#9a9a97"},children:te(Ha,{sx:{fontSize:20}})}),te(un,{size:"small","aria-label":"\uC774\uBBF8\uC9C0 \uCCA8\uBD80",onClick:()=>a.current?.click(),sx:{color:"#9a9a97"},children:te(eT,{sx:{fontSize:20}})})]});return ao(Be,{children:[n.length>0?te(Be,{sx:{display:"flex",flexWrap:"wrap",gap:.5,px:2,pt:1},children:n.map((p,m)=>te(Lc,{size:"small",icon:te(Ha,{sx:{fontSize:14}}),label:`${p.name} (${Na(p.size)})`,onDelete:()=>r(c=>c.filter((k,S)=>S!==m)),sx:{fontSize:12,bgcolor:"#f1f5f9"}},`${p.name}-${m}`))}):null,ao(Be,{sx:{position:"relative",display:"flex"},children:[te(Gk,{value:o,placeholder:"\uB313\uAE00\uC744 \uC785\uB825\uD558\uC138\uC694",onChange:p=>t(p.target.value),fullWidth:!0,multiline:!0,minRows:s?1:3,maxRows:3,sx:{"& .MuiInputBase-root":{pl:2,pr:s?15:6.5,pb:s?void 0:5,borderRadius:0},"& .MuiOutlinedInput-notchedOutline":{border:"none"}}}),s?ao(Be,{sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",gap:.25},children:[u,te(un,{"aria-label":"\uB313\uAE00 \uB4F1\uB85D",disabled:!o.trim()&&n.length===0,onClick:l,sx:{color:"#2563eb","&.Mui-disabled":{color:"#c9c8c5"}},children:te(zc,{sx:{fontSize:22}})})]}):ao(Ac,{children:[te(Be,{sx:{position:"absolute",left:8,bottom:6,display:"flex",alignItems:"center",gap:.25},children:u}),te(un,{"aria-label":"\uB313\uAE00 \uB4F1\uB85D",disabled:!o.trim()&&n.length===0,onClick:l,sx:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",color:"#2563eb","&.Mui-disabled":{color:"#c9c8c5"}},children:te(zc,{sx:{fontSize:22}})})]})]}),te(Be,{component:"input",ref:i,type:"file",multiple:!0,onChange:p=>{d(p.target.files),p.target.value=""},sx:{display:"none"}}),te(Be,{component:"input",ref:a,type:"file",accept:"image/*",multiple:!0,onChange:p=>{d(p.target.files),p.target.value=""},sx:{display:"none"}})]})}import{useState as $c}from"react";import{Box as hi,Checkbox as rT,IconButton as bi,Tooltip as Wa}from"@mui/material";import iT from"@mui/icons-material/Close";import aT from"@mui/icons-material/ArrowBack";import lT from"@mui/icons-material/ShareOutlined";import sT from"@mui/icons-material/ContentPasteOutlined";import cT from"@mui/icons-material/CheckCircle";import mT from"@mui/icons-material/CheckCircleOutlineOutlined";import{InfoAlert as oT,SuccessAlert as tT}from"@ehfuse/alerts";var Hc=e=>e?e.replace(/<(script|style)[\s\S]*?<\/\1>/gi,"").replace(/<br\s*\/?>/gi,`
|
|
9
9
|
`).replace(/<\/(p|div|li|h[1-6]|tr)>/gi,`
|
|
10
10
|
`).replace(/<[^>]+>/g,"").replace(/ /gi," ").replace(/</gi,"<").replace(/>/gi,">").replace(/"/gi,'"').replace(/'/gi,"'").replace(/&/gi,"&").replace(/\n{3,}/g,`
|
|
11
11
|
|
|
12
|
-
`).trim():"";function
|
|
13
|
-
`)}function Hc(e){navigator.clipboard.writeText(e).then(()=>Zk("\uC5C5\uBB34 \uB0B4\uC6A9\uC744 \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>Jk("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uB0B4\uC6A9\uC744 \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD574 \uC8FC\uC138\uC694."))}function xi(e,o){let t=eT(e);if(o&&typeof navigator.share=="function"){navigator.share({text:t}).catch(n=>{n?.name!=="AbortError"&&Hc(t)});return}Hc(t)}import{Fragment as sT,jsx as Xe,jsxs as $c}from"react/jsx-runtime";function Kc({task:e,myAccountSeq:o=0,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:r,onChangeIconColor:i,onClose:a,appBarMode:s=!1}){let d=Re(),[l,u]=Wc(null),[p,m]=Wc(null),c=kn(e.icon||(e.is_notice?xo:e.is_event?"event":Me)),T=!!e.is_notice,B=!!e.is_event,f=T&&o>0&&(e.author_account_seq??0)===o,g=!ct(e,o),k=!B&&(T?f:(e.author_account_seq??0)===o||(e.manager_account_seq??0)===o);return $c(sT,{children:[$c(gi,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[s&&a?Xe(hi,{"aria-label":"\uB4A4\uB85C",onClick:a,sx:{color:"#37352f",ml:-1},children:Xe(nT,{})}):null,k&&!s?Xe(Wa,{title:e.completed&&e.completed_by?`${e.completed_by} \xB7 ${mt(e.completed_time)} \uC644\uB8CC`:e.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC",arrow:!0,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:Xe(oT,{checked:e.completed,icon:Xe(lT,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:Xe(aT,{sx:{fontSize:22,color:"#2f80ed"}}),onChange:(w,b)=>t(e.seq,b),sx:{p:0}})}):null,s?null:Xe(Wa,{title:g?"":"\uC544\uC774\uCF58 \uBCC0\uACBD",arrow:!0,children:Xe(hi,{size:"small",onClick:g?void 0:w=>m(w.currentTarget),sx:{color:e.icon_color||(T?"#e5484d":"#1e3a8a")},children:Xe(c,{sx:{fontSize:20}})})}),l!==null?Xe(gi,{component:"input",autoFocus:!0,spellCheck:!1,value:l,onChange:w=>u(w.target.value),onBlur:()=>{l.trim()&&l.trim()!==e.title&&n(e.seq,l.trim()),u(null)},onKeyDown:w=>{w.key==="Enter"&&w.target.blur(),w.key==="Escape"&&u(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:18,fontWeight:500,color:"#37352f",p:0,m:0}}):s?Xe(gi,{sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:T?"\uACF5\uC9C0":B?"\uC77C\uC815":e.is_bug?"\uC624\uB958":"\uC5C5\uBB34"}):Xe(gi,{onClick:g?void 0:()=>u(e.title),sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:g?"default":"text",textDecoration:e.completed?"line-through":"none"},children:e.title}),Xe(Wa,{title:d?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:Xe(hi,{"aria-label":d?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>xi(e,d),sx:{color:"#6b7280"},children:d?Xe(rT,{sx:{fontSize:20}}):Xe(iT,{sx:{fontSize:20}})})}),a&&!s?Xe(hi,{"aria-label":"\uB2EB\uAE30",onClick:a,sx:{color:"#6b7280"},children:Xe(tT,{})}):null]}),Xe(En,{anchorEl:p,value:e.icon||(T?xo:""),color:e.icon_color||(T?"#e5484d":"#1e3a8a"),onSelect:w=>r(e.seq,w),onSelectColor:w=>i?.(e.seq,w),onClose:()=>m(null)})]})}import{useState as Wt}from"react";import{Box as to,Button as bi,ButtonBase as wT,Checkbox as DT,Divider as dn,IconButton as MT,Menu as OT,MenuItem as ET}from"@mui/material";import PT from"@mui/icons-material/ExpandLess";import RT from"@mui/icons-material/ExpandMore";import zT from"@mui/icons-material/ConfirmationNumberOutlined";import qT from"@mui/icons-material/Check";import AT from"@mui/icons-material/DirectionsRunOutlined";import LT from"@mui/icons-material/SpeedOutlined";import Zc from"@mui/icons-material/CheckCircle";import NT from"@mui/icons-material/CheckCircleOutlineOutlined";import em from"@mui/icons-material/CheckCircleOutlined";import om from"@mui/icons-material/AccessTimeOutlined";import FT from"@mui/icons-material/AutorenewOutlined";import HT from"@mui/icons-material/LabelOutlined";import WT from"@mui/icons-material/PersonOutlineOutlined";import $T from"@mui/icons-material/SubjectOutlined";import KT from"@mui/icons-material/StickyNote2Outlined";import UT from"@mui/icons-material/PanToolAltOutlined";import{useState as cT}from"react";import{TextField as mT}from"@ehfuse/mui-form-controls";import{jsx as uT}from"react/jsx-runtime";function Uc({value:e,onCommit:o,onDraftChange:t,readOnly:n=!1}){let[r,i]=cT(null);return uT(mT,{value:r??e,placeholder:n?"":"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",slotProps:{input:{readOnly:n}},onChange:a=>{i(a.target.value),t?.(a.target.value)},onBlur:()=>{r!==null&&r.trim()!==e&&o(r),i(null)},onKeyDown:a=>{a.key==="Enter"&&a.target.blur(),a.key==="Escape"&&i(null)},sx:{mt:1}})}import{useMemo as Xc,useState as Ua}from"react";import{Box as lo,Button as Qc,IconButton as ST}from"@mui/material";import BT from"@mui/icons-material/AccountTreeOutlined";import CT from"@mui/icons-material/Add";import vT from"@mui/icons-material/Close";import IT from"@mui/icons-material/NextPlanOutlined";function un(e){return e.relations??[]}function yP(e,o,t){return un(e).some(n=>n.type===t&&n.task_seq===o.seq)||un(o).some(n=>n.type===t&&n.task_seq===e.seq)}function Vc(e){return`${e.created_time??""}|${String(e.seq).padStart(12,"0")}`}function Gc(e,o){let t=new Map(o.map(c=>[c.seq,c]));t.set(e.seq,e);let n=new Map,r=(c,T)=>{n.has(c)||n.set(c,new Set),n.has(T)||n.set(T,new Set),n.get(c).add(T),n.get(T).add(c)};for(let c of t.values())for(let T of un(c))T.type==="follow_up"&&t.has(T.task_seq)&&r(c.seq,T.task_seq);let i=new Set([e.seq]),a=[e.seq];for(;a.length>0;){let c=a.shift();for(let T of n.get(c)??[])i.has(T)||(i.add(T),a.push(T))}let s=[...i].map(c=>t.get(c)).filter(c=>!!c).sort((c,T)=>Vc(c).localeCompare(Vc(T))),d=new Set;for(let c of un(e))c.type==="related"&&d.add(c.task_seq);for(let c of t.values())c.seq!==e.seq&&un(c).some(T=>T.type==="related"&&T.task_seq===e.seq)&&d.add(c.seq);let l=[...d].map(c=>t.get(c)).filter(c=>c!==void 0&&c.seq!==e.seq),u=[...t.values()].filter(c=>c.seq!==e.seq&&un(c).some(T=>T.type==="duplicate_of"&&T.task_seq===e.seq)),p=un(e).find(c=>c.type==="duplicate_of")?.task_seq,m=p?t.get(p)??null:null;return{lineage:s,related:l,duplicates:u,duplicateOf:m}}import{useEffect as dT,useMemo as pT,useState as $a}from"react";import{Box as zn,Button as fT,Tab as xT,Tabs as gT}from"@mui/material";import hT from"@mui/icons-material/Check";import{FormDialog as bT}from"@ehfuse/mui-form-dialog";import{ClearTextField as kT}from"@ehfuse/mui-form-controls";import{ErrorAlert as TT}from"@ehfuse/alerts";import{OverlayScrollbar as yT}from"@ehfuse/overlay-scrollbar";import{jsx as Po,jsxs as Ka}from"react/jsx-runtime";var Yc=[{type:"related",label:"\uAD00\uB828",hint:"\uB2E8\uC21C\uD788 \uAD00\uB828 \uC788\uB294 \uC5C5\uBB34\uB85C \uC5F0\uACB0\uD569\uB2C8\uB2E4"},{type:"follow_up",label:"\uC774\uC804 \uC5C5\uBB34",hint:"\uC774 \uC5C5\uBB34\uAC00 \uC120\uD0DD\uD55C \uC5C5\uBB34\uC5D0\uC11C \uC774\uC5B4\uC9C4 \uD6C4\uC18D\uC784\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4(\uC774\uB825 \uD0C0\uC784\uB77C\uC778)"},{type:"duplicate_of",label:"\uC911\uBCF5(\uC6D0\uBCF8)",hint:"\uC774 \uC5C5\uBB34\uAC00 \uC120\uD0DD\uD55C \uC6D0\uBCF8 \uC5C5\uBB34\uC758 \uC911\uBCF5\uC784\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4"}];function jc({open:e,task:o,tasks:t,excludeSeqs:n=[],onClose:r,onSubmit:i}){let[a,s]=$a("related"),[d,l]=$a(""),[u,p]=$a(0);dT(()=>{e&&(s("related"),l(""),p(0))},[e]);let m=pT(()=>{let f=new Set([o.seq,...n]),g=d.trim().toLowerCase();return t.filter(k=>f.has(k.seq)||k.is_event||k.is_notice?!1:g?k.title.toLowerCase().includes(g)||(k.ticket_no??"").toLowerCase().includes(g):!0)},[t,o.seq,n,d]),c=()=>{if(!u){TT("\uC5F0\uACB0\uD560 \uC5C5\uBB34\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}i(u,a),r()},T=Yc.find(f=>f.type===a)?.hint??"",B=Ka(zn,{children:[Po(gT,{value:a,onChange:(f,g)=>s(g),sx:{minHeight:38,mb:.75,"& .MuiTab-root":{minHeight:38,py:.5,fontSize:14}},children:Yc.map(f=>Po(xT,{value:f.type,label:f.label},f.type))}),Po(zn,{sx:{mb:1.5,fontSize:12.5,color:"#9a9a97"},children:T}),Po(kT,{label:"\uC5C5\uBB34 \uAC80\uC0C9",placeholder:"\uC81C\uBAA9\xB7\uD2F0\uCF13\uBC88\uD638\uB85C \uAC80\uC0C9",value:d,onChange:f=>l(f.target.value),fullWidth:!0,autoFocus:!0}),Po(zn,{sx:{mt:1.5,height:300,border:"1px solid #e6e6e3",borderRadius:1},children:Po(yT,{style:{height:"100%"},children:m.length===0?Po(zn,{sx:{py:4,textAlign:"center",fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uD560 \uC218 \uC788\uB294 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):m.map(f=>{let g=Fe(f.icon||Me),k=f.seq===u;return Ka(zn,{onClick:()=>p(k?0:f.seq),sx:{display:"flex",alignItems:"center",gap:.75,px:1.25,py:.75,cursor:"pointer",bgcolor:k?"#e3eefb":"transparent","&:hover":{bgcolor:k?"#e3eefb":"#f7f7f5"}},children:[g?Po(g,{sx:{fontSize:17,flexShrink:0,color:f.icon_color||"#1e3a8a"}}):null,Ka(zn,{component:"span",sx:{flex:1,minWidth:0,fontSize:14,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[f.ticket_no?`${f.ticket_no} `:"",f.title]}),Po(Ee,{option:go(f),small:!0}),k?Po(hT,{sx:{fontSize:17,flexShrink:0,color:"#2f80ed"}}):null]},f.seq)})})})]});return Po(bT,{open:e,onClose:r,maxWidth:"sm",title:"\uAD00\uB828 \uC5C5\uBB34 \uC5F0\uACB0",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-task-link",sections:[{id:"task-link",showTitle:!1,children:B}],actions:{showCancelButton:!0,right:Po(fT,{variant:"contained",disabled:!u,onClick:c,children:"\uC5F0\uACB0"})}})}import{Fragment as _T,jsx as Le,jsxs as Uo}from"react/jsx-runtime";function Va({item:e,caption:o,onOpen:t,onUnlink:n}){let r=Fe(e.icon||Me);return Uo(lo,{sx:{display:"flex",alignItems:"center",gap:.75,px:1.25,py:.5,borderRadius:1,"&:hover":{bgcolor:"#f7f7f5"},"&:hover .taskbox-relation-unlink":{opacity:1}},children:[o?Le(lo,{component:"span",sx:{flexShrink:0,px:.6,py:.1,borderRadius:.75,fontSize:11.5,fontWeight:500,color:"#8a6d1d",bgcolor:"#faf1d7"},children:o}):null,r?Le(r,{sx:{fontSize:16,flexShrink:0,color:e.icon_color||"#1e3a8a"}}):null,Uo(lo,{component:"span",onClick:t,sx:{flex:1,minWidth:0,fontSize:14,color:e.completed?"#9a9a97":"#37352f",textDecoration:e.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...t?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[e.ticket_no?`${e.ticket_no} `:"",e.title]}),Le(Ee,{option:go(e),small:!0}),n?Le(ST,{className:"taskbox-relation-unlink",size:"small","aria-label":"\uC5F0\uACB0 \uD574\uC81C",onClick:n,sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:Le(vT,{sx:{fontSize:15}})}):null]})}function Jc({task:e,tasks:o,readOnly:t=!1,onOpenTask:n,onLink:r,onUnlink:i,onCreateFollowUp:a}){let[s,d]=Ua(!1),[l,u]=Ua(null),[p,m]=Ua(null),c=Xc(()=>Gc(e,o),[e,o]),T=c.lineage.length>=2,B=(T?c.lineage.length-1:0)+c.related.length+c.duplicates.length+(c.duplicateOf?1:0),f=Xc(()=>{let k=new Set;for(let w of c.lineage)k.add(w.seq);for(let w of c.related)k.add(w.seq);for(let w of c.duplicates)k.add(w.seq);return c.duplicateOf&&k.add(c.duplicateOf.seq),[...k]},[c]),g=(k,w,b)=>{m({anchorEl:k,targetSeq:w,type:b})};return Uo(Eo,{icon:Le(BT,{sx:{fontSize:19,display:"block"}}),title:Uo(_T,{children:["\uAD00\uB828 \uC5C5\uBB34",B>0?Le(lo,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:B}):null]}),titleExtra:t?null:Uo(lo,{sx:{ml:"auto",display:"flex",alignItems:"center",gap:.5},children:[a?Le(Qc,{size:"small",color:"inherit",startIcon:Le(IT,{sx:{fontSize:16}}),onClick:k=>u(k.currentTarget),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uD6C4\uC18D \uC5C5\uBB34"}):null,r?Le(Qc,{size:"small",color:"inherit",startIcon:Le(CT,{sx:{fontSize:16}}),onClick:()=>d(!0),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uC5F0\uACB0"}):null]}),children:[Uo(lo,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:[T?Le(lo,{sx:{mb:c.related.length||c.duplicates.length||c.duplicateOf?1:0},children:c.lineage.map((k,w)=>{let b=k.seq===e.seq,S=w===c.lineage.length-1;return Uo(lo,{sx:{display:"flex",gap:1},children:[Uo(lo,{sx:{display:"flex",flexDirection:"column",alignItems:"center",width:14,flexShrink:0,pt:1.1},children:[Le(lo,{sx:{width:b?9:7,height:b?9:7,borderRadius:"50%",bgcolor:b?"#2f80ed":k.completed?"#9a9a97":"#c9c8c5",flexShrink:0}}),S?null:Le(lo,{sx:{width:"2px",flex:1,bgcolor:"#e6e6e3"}})]}),Uo(lo,{sx:{flex:1,minWidth:0,pb:S?0:.5},children:[Uo(lo,{sx:{display:"flex",alignItems:"center",gap:.75},children:[Uo(lo,{component:"span",onClick:!b&&n?()=>n(k.seq):void 0,sx:{minWidth:0,fontSize:14,fontWeight:b?600:400,color:b?"#2f80ed":k.completed?"#9a9a97":"#37352f",textDecoration:k.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...!b&&n?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[k.ticket_no?`${k.ticket_no} `:"",k.title]}),Le(Ee,{option:go(k),small:!0})]}),Le(lo,{sx:{fontSize:12,color:"#9a9a97"},children:k.completed&&k.completed_time?`${k.completed_time} \uC644\uB8CC`:k.created_time??""})]})]},k.seq)})}):null,c.duplicateOf?Le(Va,{item:c.duplicateOf,caption:"\uC6D0\uBCF8",onOpen:n?()=>n(c.duplicateOf.seq):void 0,onUnlink:!t&&i?k=>g(k.currentTarget,c.duplicateOf.seq,"duplicate_of"):void 0}):null,c.duplicates.map(k=>Le(Va,{item:k,caption:"\uC911\uBCF5",onOpen:n?()=>n(k.seq):void 0,onUnlink:!t&&i?w=>g(w.currentTarget,k.seq,"duplicate_of"):void 0},`dup-${k.seq}`)),c.related.map(k=>Le(Va,{item:k,onOpen:n?()=>n(k.seq):void 0,onUnlink:!t&&i?w=>g(w.currentTarget,k.seq,"related"):void 0},`rel-${k.seq}`)),B===0?Le(lo,{sx:{px:1.25,py:.75,fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]}),r?Le(jc,{open:s,task:e,tasks:o,excludeSeqs:f,onClose:()=>d(!1),onSubmit:(k,w)=>r(e.seq,k,w)}):null,Le(Ge,{open:!!l,anchorEl:l,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:()=>u(null),onConfirm:()=>{a?.(e.seq),u(null)}}),Le(Ge,{open:!!p,anchorEl:p?.anchorEl??null,title:"\uC774 \uC5C5\uBB34\uC640\uC758 \uC5F0\uACB0\uC744 \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uD574\uC81C",onCancel:()=>m(null),onConfirm:()=>{p&&i?.(e.seq,p.targetSeq,p.type),m(null)}})]})}import{Fragment as yo,jsx as z,jsxs as We}from"react/jsx-runtime";function qn({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return z(to,{component:"span",sx:{color:"#9a9a97"},children:e})}function tm({task:e,customTabs:o,statusOptions:t,avatarSrcByName:n,onChangeStatus:r,onChangeLabels:i,onAddLabelOption:a,onChangeProject:s,onAddProject:d,onChangeDate:l,onChangeReminder:u,onMemberEdit:p,onChangePriority:m,onChangeEstimatedTime:c,onChangeEventTime:T,onChangeEventPlace:B,onChangeEventAddress:f,onChangeNote:g,onChangeContent:k,onAddChecklistItem:w,onToggleChecklistItem:b,onRemoveChecklistItem:S,onUpdateChecklistItem:h,onConvertChecklistToTask:x,onOpenChecklistTask:I,resolveChecklistTask:W,relatedTasksPool:D,onOpenRelatedTask:J,onLinkRelatedTask:C,onUnlinkRelatedTask:y,onCreateFollowUpTask:L,onAddAttachments:$,onRemoveAttachment:Q,onPreview:R,onDownload:ie,onUpdateComment:re,onRemoveComment:Ce,onToggleCommentReaction:xe,currentUserName:Ne="",myAccountSeq:oe=0,noticeAdmin:le=!1,hideProject:ge=!1,hideLabel:q=!1,showTitle:K=!1,onChangeTitle:Y,onToggleCompleted:E,onChangeIcon:H,onChangeIconColor:_,employees:N=[],onAckConfirm:ce,onChangeBugField:M,sprints:ae=[],sprintProject:me=!1,onChangeSprint:he,onChangeStoryPoints:Oe,onChangeResolution:A,onClaimTask:U,onVerifyBug:Ue}){let[no,Yo]=Wt(null),[wt,Kt]=Wt(null),[at,qo]=Wt(null),[Dt,Ut]=Wt(!1),Ao={[Ho]:Dt?{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"}},[Mt,Vt]=Wt(null),[Bo,Gt]=Wt(null),[De,O]=Wt(null),[F,j]=Wt(null),Z=!!e.is_notice,be=!!e.is_event,_e=!!e.is_bug,eo=!!U&&Dr(e,oe),ue=!!U&&Mr(e,oe),Ve=!!Ue&&_e&&!!e.completed&&oe>0&&(e.author_account_seq??0)===oe&&!(e.acks??[]).some(P=>P.account_seq===oe),Se=!ct(e,oe),Qe=!e.is_event&&(e.is_notice?oe>0&&(e.author_account_seq??0)===oe:(e.author_account_seq??0)===oe||(e.manager_account_seq??0)===oe),jo=kn(e.icon||(e.is_notice?xo:e.is_event?"event":Me)),_o=Z?!wr(e,oe):Se,oo=eo||ue?We(Sn,{onClick:P=>j(P.currentTarget),children:[z(UT,{sx:{fontSize:16,mr:.5}}),"\uAC00\uC838\uAC00\uAE30"]}):null,Xo=Z?di(e,N):"",Co=Z?vc(e,N,oe):null;return We(yo,{children:[K?We(to,{sx:{px:2,pt:2,pb:.5,display:"flex",alignItems:"flex-start",gap:1},children:[Qe?z(DT,{checked:e.completed,icon:z(NT,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:z(Zc,{sx:{fontSize:22,color:"#2f80ed"}}),onChange:(P,Fn)=>E(e.seq,Fn),sx:{p:0,mt:.25}}):null,z(MT,{size:"small","aria-label":"\uC544\uC774\uCF58 \uBCC0\uACBD",onClick:Se?void 0:P=>Kt(P.currentTarget),sx:{p:0,mt:.25,color:e.icon_color||(Z?"#e5484d":"#1e3a8a")},children:z(jo,{sx:{fontSize:20}})}),z(to,{sx:{flex:1,minWidth:0},children:no!==null?z(to,{component:"input",autoFocus:!0,spellCheck:!1,value:no,onChange:P=>Yo(P.target.value),onBlur:()=>{no.trim()&&no.trim()!==e.title&&Y(e.seq,no.trim()),Yo(null)},onKeyDown:P=>{P.key==="Enter"&&P.target.blur(),P.key==="Escape"&&Yo(null)},sx:{width:"100%",border:"none",outline:"none",font:"inherit",fontSize:19,fontWeight:600,color:"#37352f",p:0,m:0}}):z(to,{onClick:()=>Yo(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})}),z(En,{anchorEl:wt,value:e.icon||(Z?xo:""),color:e.icon_color||(Z?"#e5484d":"#1e3a8a"),onSelect:P=>H(e.seq,P),onSelectColor:P=>_?.(e.seq,P),onClose:()=>Kt(null)})]}):null,We(to,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:.25,[Ho]:{pb:0}},children:[z(ni,{hideProject:ge,values:{tabKey:e.tab_key??"",managerName:e.manager_name,receiverNames:e.receiver_names,startDate:e.start_date,dueDate:e.due_date,reminder:e.reminder,priority:e.priority,estimatedTime:e.estimated_time,eventTime:e.event_time??"",eventPlace:e.event_place??"",eventAddress:e.event_address??""},customTabs:o,avatarSrcByName:n,showEstimatedTime:!be,notice:Z,event:be,readOnly:Se,targetSummary:Xo,onChangeProject:P=>s(e.seq,P),onAddProject:d,onChangeStartDate:P=>l(e.seq,"start_date",P),onChangeDueDate:P=>l(e.seq,"due_date",P),onChangeReminder:P=>u(e.seq,P),onChangePriority:P=>m(e.seq,P),onChangeEstimatedTime:P=>c(e.seq,P),onChangeEventTime:P=>T?.(e.seq,P),onChangeEventPlace:P=>B?.(e.seq,P),onChangeEventAddress:P=>f?.(e.seq,P),onMemberEdit:P=>p(e,P),narrowCollapsedSx:Ao,reminderLocked:e.completed,managerAction:oo,leading:We(yo,{children:[Ve||oo&&(Z||be)?We(to,{sx:{gridColumn:"1 / -1",display:"flex",justifyContent:"center",gap:1,px:2,py:.75},children:[Z||be?oo:null,Ve?We(yo,{children:[z(bi,{variant:"contained",size:"small",onClick:()=>Ue?.(e.seq,!0),sx:{bgcolor:"#2f80ed"},children:"\uC218\uC815 \uD655\uC778(\uAC80\uC99D \uC644\uB8CC)"}),z(bi,{variant:"outlined",size:"small",color:"error",onClick:()=>Ue?.(e.seq,!1),children:"\uC544\uC9C1 \uC7AC\uD604\uB428(\uC7AC\uC624\uD508)"})]}):null]}):null,_e&&e.ticket_no?z(de,{icon:z(zT,{sx:{fontSize:17}}),label:"\uD2F0\uCF13",children:z(to,{component:"span",sx:{fontVariantNumeric:"tabular-nums"},children:e.ticket_no})}):null,be?null:z(to,{sx:_e&&e.ticket_no?void 0:{gridColumn:"1 / -1"},children:z(de,{icon:z(FT,{sx:{fontSize:17}}),label:"\uC0C1\uD0DC",onClick:Se||e.completed?void 0:P=>Vt(P),children:z(Ee,{option:go(e)})})}),me&&!be&&!Z?We(yo,{children:[z(de,{icon:z(AT,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:Se?void 0:P=>Gt(P),children:(e.sprint_seq??0)>0?ae.find(P=>P.seq===e.sprint_seq)?.name??"\uC0AD\uC81C\uB41C \uC2A4\uD504\uB9B0\uD2B8":z(qn,{label:"\uBBF8\uBC30\uC815"})}),z(de,{icon:z(LT,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",children:z(vt,{value:(e.story_points??0)>0?String(e.story_points):"",placeholder:"\uBBF8\uCD94\uC815",readOnly:Se,onCommit:P=>Oe?.(e.seq,Number(P.replace(/[^0-9.]/g,""))||0)})})]}):null,be||q?null:z(to,{sx:[{gridColumn:"1 / -1"},Ao??null],children:z(de,{icon:z(HT,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:Se?void 0:P=>O(P),children:(e.label_keys??[]).length>0?z(Ot,{labelKeys:e.label_keys??[],labelOptions:t}):z(qn,{})})}),Z&&Co?z(to,{sx:{gridColumn:"1 / -1"},children:z(de,{icon:z(em,{sx:{fontSize:17}}),label:"\uD655\uC778",children:z(to,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,minWidth:0},children:Co.canAck?z(bi,{size:"small",variant:"contained",onClick:()=>ce?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):z(bi,{size:"small",variant:"outlined",color:"inherit",startIcon:Co.acked?z(Zc,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:P=>qo({anchorEl:P.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:Co.total>0&&Co.count>=Co.total?"\uC644\uB8CC":We(yo,{children:[Co.count,z(to,{component:"span",sx:{mx:.4},children:"/"}),Co.total]})})})})}):null]}),trailing:We(yo,{children:[_e?z(ri,{values:{repro:e.bug_repro??"",device:e.bug_device??"",where:e.bug_where??"",version:e.bug_version??"",resolution:e.resolution??""},readOnly:Se,showResolution:!!e.completed,onChangeRepro:P=>M?.(e.seq,"bug_repro",P),onChangeDevice:P=>M?.(e.seq,"bug_device",P),onChangeWhere:P=>M?.(e.seq,"bug_where",P),onChangeVersion:P=>M?.(e.seq,"bug_version",P),onChangeResolution:P=>A?.(e.seq,P)}):null,z(de,{icon:z(WT,{sx:{fontSize:17}}),label:"\uC791\uC131\uC790",sx:[uo(9),Ao??null],children:e.created_by?We(yo,{children:[z(ho,{names:[e.created_by],size:20,avatarSrcByName:n}),e.created_by]}):z(qn,{})}),z(de,{icon:z(om,{sx:{fontSize:17}}),label:"\uC791\uC131\uC2DC\uAC04",sx:[uo(11),Ao??null],children:e.created_time?mt(e.created_time):z(qn,{})}),e.completed?We(yo,{children:[z(de,{icon:z(em,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC790",sx:[uo(10),Ao??null],children:e.completed_by?We(yo,{children:[z(ho,{names:[e.completed_by],size:20,avatarSrcByName:n}),e.completed_by]}):z(qn,{})}),z(de,{icon:z(om,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC2DC\uAC04",sx:[uo(12),Ao??null],children:e.completed_time?mt(e.completed_time):z(qn,{})})]}):null]})}),We(to,{sx:{display:"none",[Ho]:{display:"block",mt:1.5}},children:[z(dn,{sx:{borderColor:"#e6e6e3"}}),z(wT,{onClick:()=>Ut(P=>!P),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:.5,pt:1.5,pb:1.25,fontSize:13.5,bgcolor:"#f4f4f2",color:"#37352f","&:active":{opacity:.6}},children:Dt?We(yo,{children:["\uC811\uAE30 ",z(PT,{sx:{fontSize:18}})]}):We(yo,{children:["\uC815\uBCF4 \uB354\uBCF4\uAE30 ",z(RT,{sx:{fontSize:18}})]})})]}),We(to,{children:[z(dn,{sx:{my:1.5,borderColor:"#e6e6e3",[Ho]:{mt:0}}}),z(Eo,{icon:z($T,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",children:z(to,{sx:{userSelect:"text"},children:z(ii,{syncKey:e.seq,value:e.content??"",readOnly:Se,onChange:P=>k(e.seq,P)})})}),e.is_bug?null:We(yo,{children:[z(dn,{sx:{my:1.5,borderColor:"#e6e6e3"}}),z(Eo,{icon:z(KT,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:z(to,{sx:{userSelect:"text"},children:z(Uc,{value:e.note,readOnly:_o,onCommit:P=>g(e.seq,P)})})})]}),be?null:We(yo,{children:[z(dn,{sx:{my:1.5,borderColor:"#e6e6e3"}}),z(ai,{taskSeq:e.seq,checklist:e.checklist??[],removeLocked:_o,onAdd:w,onToggle:b,onRemove:S,onUpdate:h,onConvertToTask:x,onOpenLinkedTask:I,resolveLinkedTask:W})]}),D&&!be&&!Z?We(yo,{children:[z(dn,{sx:{my:1.5,borderColor:"#e6e6e3"}}),z(Jc,{task:e,tasks:D,readOnly:Se,onOpenTask:J,onLink:C,onUnlink:y,onCreateFollowUp:L})]}):null,z(dn,{sx:{my:1.5,borderColor:"#e6e6e3"}}),z(ci,{taskSeq:e.seq,attachments:e.attachments??[],removeLocked:_o,onAdd:$,onRemove:Q,onPreview:R?P=>R({...P,taskSeq:e.seq}):void 0,onDownload:ie?P=>ie({...P,taskSeq:e.seq}):void 0})]}),z(dn,{sx:{my:1.5,borderColor:"#e6e6e3"}}),z(Lc,{taskSeq:e.seq,comments:e.comments??[],currentUserName:Ne,myAccountSeq:oe,avatarSrcByName:n,onUpdate:re,onRemove:Ce,onToggleReaction:xe})]}),z(_r,{anchorEl:Mt,value:e.status,options:Z?Gn:_e?Xt:Yn,onSelect:P=>r(e.seq,P),onClose:()=>Vt(null)}),z(OT,{transitionDuration:0,anchorEl:Bo,open:!!Bo,onClose:()=>Gt(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...ae.filter(P=>`custom-${P.group_seq}`===String(e.tab_key??"")).map(P=>({seq:P.seq,label:Mo(P)}))].map(P=>We(ET,{onClick:()=>{he?.(e.seq,P.seq),Gt(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[P.label,(e.sprint_seq??0)===P.seq?z(qT,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},P.seq))}),z(Fr,{anchorEl:at?.anchorEl??null,open:!!at?.open,acks:e.acks??[],total:Co?.total??0,avatarSrcByName:n,onClose:()=>qo(P=>P?{...P,open:!1}:null)}),z(ui,{anchorEl:De,selectedKeys:e.label_keys??[],labelOptions:t,onToggle:P=>i(e.seq,vr(e.label_keys??[],P)),onAddLabel:a,onClose:()=>O(null)}),z(Ge,{open:!!F,anchorEl:F,title:eo?"\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:()=>j(null),onConfirm:()=>{U?.(e.seq),j(null)}})]})}import{jsx as Ro,jsxs as ey}from"react/jsx-runtime";function JR(){let e=new Date,o=t=>String(t).padStart(2,"0");return`${e.getFullYear()}-${o(e.getMonth()+1)}-${o(e.getDate())} ${o(e.getHours())}:${o(e.getMinutes())}`}function ZR({open:e,task:o,onClose:t,onAddComment:n,myAccountSeq:r=0,onToggleCompleted:i,onChangeTitle:a,onChangeIcon:s,onChangeIconColor:d,...l}){let u=Re(),p=GT(null);o&&(p.current=o);let m=o??p.current,[c,T]=YT({}),B=Object.keys(c).length>0;if(VT(()=>{T({})},[o?.seq,e]),!m)return null;let f=u&&B?{...m,...c}:m,g=(h,x)=>{u?T(I=>({...I,...h})):x()},k=()=>{let h=c;T({});let x=m.seq;h.title!==void 0&&String(h.title).trim()&&a(x,String(h.title).trim()),h.icon!==void 0&&s(x,String(h.icon)),h.icon_color!==void 0&&d?.(x,String(h.icon_color)),h.status!==void 0&&l.onChangeStatus(x,h.status),h.label_keys!==void 0&&l.onChangeLabels(x,h.label_keys??[]),h.tab_key!==void 0&&l.onChangeProject(x,String(h.tab_key??"")),h.start_date!==void 0&&l.onChangeDate(x,"start_date",String(h.start_date??"")),h.due_date!==void 0&&l.onChangeDate(x,"due_date",String(h.due_date??"")),h.reminder!==void 0&&l.onChangeReminder(x,h.reminder),h.priority!==void 0&&l.onChangePriority(x,h.priority),h.estimated_time!==void 0&&l.onChangeEstimatedTime(x,String(h.estimated_time??"")),h.event_time!==void 0&&l.onChangeEventTime?.(x,String(h.event_time??"")),h.event_place!==void 0&&l.onChangeEventPlace?.(x,String(h.event_place??"")),h.event_address!==void 0&&l.onChangeEventAddress?.(x,String(h.event_address??"")),h.content!==void 0&&l.onChangeContent(x,String(h.content??"")),h.note!==void 0&&l.onChangeNote(x,String(h.note??"")),ZT({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"})},w={...l,onChangeStatus:(h,x)=>g({status:x},()=>l.onChangeStatus(h,x)),onChangeLabels:(h,x)=>g({label_keys:x},()=>l.onChangeLabels(h,x)),onChangeProject:(h,x)=>g({tab_key:x},()=>l.onChangeProject(h,x)),onChangeDate:(h,x,I)=>g({[x]:I},()=>l.onChangeDate(h,x,I)),onChangeReminder:(h,x)=>g({reminder:x},()=>l.onChangeReminder(h,x)),onChangePriority:(h,x)=>g({priority:x},()=>l.onChangePriority(h,x)),onChangeEstimatedTime:(h,x)=>g({estimated_time:x},()=>l.onChangeEstimatedTime(h,x)),onChangeEventTime:(h,x)=>g({event_time:x},()=>l.onChangeEventTime?.(h,x)),onChangeEventPlace:(h,x)=>g({event_place:x},()=>l.onChangeEventPlace?.(h,x)),onChangeEventAddress:(h,x)=>g({event_address:x},()=>l.onChangeEventAddress?.(h,x)),onChangeContent:(h,x)=>g({content:x},()=>l.onChangeContent(h,x)),onChangeNote:(h,x)=>g({note:x},()=>l.onChangeNote(h,x))},b=Ro(tm,{...w,task:f,myAccountSeq:r,onChangeTitle:(h,x)=>g({title:x},()=>a(h,x)),onToggleCompleted:i,onChangeIcon:(h,x)=>g({icon:x},()=>s(h,x)),onChangeIconColor:(h,x)=>g({icon_color:x},()=>d?.(h,x)),showTitle:u}),S=Ro(Nc,{onSubmit:(h,x)=>n(f.seq,h,x)},f.seq);return u?Ro(JT,{open:e,onClose:t,locale:"ko",fontScale:{default:1.1,min:.6},title:f.is_notice?"\uACF5\uC9C0\uC0AC\uD56D":f.is_event?"\uC77C\uC815":f.is_bug?"\uC624\uB958":"\uC5C5\uBB34",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1},custom:[{icon:Ro(XT,{sx:{ml:2,color:B?"#2f9e5b":"#c9c8c5"}}),tooltip:B?"\uC800\uC7A5":"",onClick:B?k:void 0}]},fullScreen:!0,mobilePresentation:"slide",tabs:{visible:!1},contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,contentBottomPadding:0,scrollPastLastSection:!1,overlayScrollbar:{enabled:!0,contentStyle:{minWidth:0}},actions:{visible:!0,showCancelButton:!1,left:S},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:Ro(ki,{sx:{userSelect:"none",width:"100%",minWidth:0},children:b})}]}):Ro(jT,{anchor:"right",open:e,onClose:t,sx:{zIndex:h=>h.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:ey(ki,{sx:{display:"flex",flexDirection:"column",height:"100%",userSelect:"none"},children:[Ro(Kc,{task:f,myAccountSeq:r,onToggleCompleted:i,onChangeTitle:a,onChangeIcon:s,onChangeIconColor:d,onClose:t}),Ro(nm,{sx:{borderColor:"#e6e6e3"}}),Ro(ki,{sx:{flex:1,minHeight:0},children:Ro(QT,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:b})}),Ro(nm,{sx:{borderColor:"#37352f"}}),Ro(ki,{sx:{flexShrink:0},children:S})]})})}import{useEffect as ty,useState as pn}from"react";import{Box as So,Button as ja,IconButton as rm}from"@mui/material";import{FormDialog as ny}from"@ehfuse/mui-form-dialog";import ry from"@mui/icons-material/EditOutlined";import{ErrorAlert as im}from"@ehfuse/alerts";import{ClearTextField as am,DateTextField as lm,LabelSelect as sm}from"@ehfuse/mui-form-controls";var Ga="custom-";function oy(e){return e.startsWith(Ga)}function t2(e){return e>0?`${Ga}${e}`:""}function Ya(e){if(!oy(e))return 0;let o=Number(e.slice(Ga.length));return Number.isInteger(o)&&o>0?o:0}import{Fragment as ay,jsx as $e,jsxs as $t}from"react/jsx-runtime";var iy=[{value:"planning",label:"\uACC4\uD68D\uC911"},{value:"active",label:"\uC9C4\uD589\uC911"},{value:"closed",label:"\uC885\uB8CC"}];function cm(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?e.slice(5).replace("-","."):"-"}function d2({open:e,customTabs:o,sprints:t,onClose:n,onCreate:r,onUpdate:i,onChangeStatus:a,onRemove:s}){let d=o.filter(C=>C.useSprints&&!C.archived),[l,u]=pn(""),[p,m]=pn(""),[c,T]=pn(""),[B,f]=pn(""),[g,k]=pn(""),[w,b]=pn(!1),[S,h]=pn(0);ty(()=>{e&&(u(d.length===1?d[0].key:""),m(""),T(""),f(""),k(""),h(0))},[e]);let x=()=>{m(""),T(""),f(""),k(""),h(0)},I=C=>{h(C.seq),u(`custom-${C.group_seq}`),m(C.name),T(C.goal),f(C.start_date),k(C.end_date)},W=async()=>{let C=Ya(l);if(!C){im("\uBAA9\uD45C\uB97C \uB9CC\uB4E4 \uD504\uB85C\uC81D\uD2B8\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}if(!p.trim()){im("\uBAA9\uD45C \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}b(!0);try{if(S>0){i(S,{name:p.trim(),goal:c.trim(),start_date:B,end_date:g}),x();return}await r({group_seq:C,name:p.trim(),goal:c.trim(),start_date:B,end_date:g})&&x()}finally{b(!1)}},D=new Map(o.map(C=>[Ya(C.key),C.label])),J=$e(So,{children:d.length===0?$e(So,{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.'}):$t(ay,{children:[$t(So,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2.5,mt:1},children:[$e(sm,{label:"\uD504\uB85C\uC81D\uD2B8",size:"medium",value:l,options:d.map(C=>({value:C.key,label:C.label})),onChange:C=>u(String(C.target.value)),disabled:S>0}),$e(am,{label:"\uBAA9\uD45C \uC774\uB984",size:"medium",placeholder:"\uC608: 8\uC6D4 2\uC8FC\uCC28",value:p,onChange:C=>m(C.target.value)}),$e(lm,{size:"medium",label:"\uC2DC\uC791\uC77C",value:B,onChange:C=>f(C.target.value)}),$e(lm,{size:"medium",label:"\uC885\uB8CC\uC77C",value:g,onChange:C=>k(C.target.value)}),$e(am,{label:"\uC124\uBA85",size:"medium",placeholder:"\uC120\uD0DD \uC785\uB825",value:c,onChange:C=>T(C.target.value),sx:{gridColumn:"1 / -1"}})]}),$t(So,{sx:{mt:1.5,display:"flex",justifyContent:"flex-end",gap:1},children:[S>0?$e(ja,{color:"inherit",onClick:x,disabled:w,children:"\uCDE8\uC18C"}):null,$e(ja,{variant:"contained",onClick:()=>{W()},disabled:w,children:S>0?"\uBAA9\uD45C \uC800\uC7A5":"\uBAA9\uD45C \uB9CC\uB4E4\uAE30"})]}),$e(So,{sx:{mt:2,borderTop:"1px solid #e6e6e3"},children:t.length===0?$e(So,{sx:{py:3,textAlign:"center",fontSize:14,color:"#9a9a97"},children:"\uB4F1\uB85D\uB41C \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):t.map(C=>$t(So,{sx:{display:"flex",flexDirection:"column",gap:1,py:1.75,borderBottom:"1px solid #f0efed"},children:[$t(So,{sx:{minWidth:0},children:[$t(So,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[$e(So,{component:"span",sx:{fontSize:16,fontWeight:600,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:C.name}),$e(So,{component:"span",sx:{flexShrink:0,px:1,py:.25,borderRadius:.75,bgcolor:"#f1f5f9",color:"#64748b",fontSize:13,fontWeight:500},children:D.get(C.group_seq)??"\uC0AD\uC81C\uB41C \uD504\uB85C\uC81D\uD2B8"}),$t(So,{component:"span",sx:{flexShrink:0,fontSize:14,color:"#57564f"},children:[cm(C.start_date)," ~ ",cm(C.end_date)]})]}),C.goal?$e(So,{sx:{mt:.5,fontSize:14,color:"#787774",lineHeight:1.5},children:C.goal}):null]}),$t(So,{sx:{display:"flex",alignItems:"center",gap:.5},children:[$e(sm,{label:"\uC0C1\uD0DC",showLabel:!1,size:"small",value:C.status,options:iy.map(y=>({value:y.value,label:y.label})),onChange:y=>a(C.seq,String(y.target.value)),sx:{width:104,flexShrink:0}}),$e(rm,{"aria-label":"\uBAA9\uD45C \uC218\uC815",onClick:()=>I(C),sx:{color:"#9a9a97","&:hover":{color:"#2563eb"}},children:$e(ry,{sx:{fontSize:18}})}),$e(rm,{"aria-label":"\uBAA9\uD45C \uC0AD\uC81C",onClick:()=>s(C.seq),sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:$e(ft,{style:{width:16,height:16}})})]})]},C.seq))})]})});return $e(ny,{open:e,onClose:n,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:J}],actions:{showCancelButton:!1,right:$e(ja,{variant:"contained",onClick:n,children:"\uB2EB\uAE30"})}})}import{useState as mm}from"react";import{Box as Ze,Button as Xa,Divider as ly,IconButton as sy,TextField as cy}from"@mui/material";import{FormDialog as my}from"@ehfuse/mui-form-dialog";import uy from"@mui/icons-material/OpenInNewOutlined";import dy from"@mui/icons-material/EventOutlined";import{ConfirmDialog as py}from"@ehfuse/alerts";import{jsx as we,jsxs as fn}from"react/jsx-runtime";function S2({open:e,imports:o,onRegister:t,onRemove:n,onClose:r}){let[i,a]=mm(""),[s,d]=mm(!1),l=async()=>{let m=i.trim();if(m){d(!0);try{await t(m)&&a("")}finally{d(!1)}}},u=async m=>{await py({title:"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",message:`"${m.name||"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}" \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&n(m.seq)},p=fn(Ze,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[fn(Ze,{sx:{color:"#37352f",lineHeight:1.7},children:["\uAD6C\uAE00 \uCE98\uB9B0\uB354\uC758 \uC77C\uC815\uC744 ",we("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uC5C5\uBB34\uD568 \uCE98\uB9B0\uB354\uC5D0 \uD568\uAED8 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4.",we("br",{}),"\uD45C\uC2DC/\uC228\uAE40\uC740 \uC5C5\uBB34\uD568 \uC6B0\uC0C1\uB2E8\uC758 ",we("b",{children:"\uAD6C\uAE00 \uC77C\uC815"})," \uC2A4\uC704\uCE58\uB85C \uCF1C\uACE0 \uB055\uB2C8\uB2E4."]}),we(Ze,{sx:{fontWeight:700,color:"#37352f",mt:.5},children:"\uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354"}),o.length>0?we(Ze,{sx:{display:"flex",flexDirection:"column",border:"1px solid #e6e6e3",borderRadius:1},children:o.map((m,c)=>fn(Ze,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:.75,borderTop:c>0?"1px solid #efefed":"none"},children:[we(dy,{sx:{fontSize:18,color:"#0f9d58",flexShrink:0}}),we(Ze,{component:"span",sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:m.name||"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),we(sy,{"aria-label":"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",size:"small",onClick:()=>{u(m)},sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:we(ft,{sx:{fontSize:18}})})]},m.seq))}):we(Ze,{sx:{color:"#9a9a97",px:.5},children:"\uC544\uC9C1 \uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}),we(ly,{sx:{my:1,borderColor:"#e6e6e3"}}),we(Ze,{sx:{fontWeight:700,color:"#37352f"},children:"\uC0C8 \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30"}),fn(Ze,{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:[we(Ze,{children:fn(Ze,{component:"span",children:["\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 > ",we("b",{children:"\uC124\uC815 \uBC0F \uACF5\uC720"}),"\uB97C \uC5FD\uB2C8\uB2E4."]})}),we(Ze,{children:fn(Ze,{component:"span",children:[we("b",{children:"\uCE98\uB9B0\uB354 \uD1B5\uD569"})," \uC139\uC158\uC758 ",we("b",{children:'"iCal \uD615\uC2DD\uC758 \uBE44\uBC00 \uC8FC\uC18C"'})," \uB97C \uBCF5\uC0AC\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694."]})}),we(Ze,{children:we(Ze,{component:"span",children:"\uBE44\uBC00 \uC8FC\uC18C\uB294 \uBCF8\uC778 \uC804\uC6A9\uC785\uB2C8\uB2E4. \uC11C\uBC84\uC5D0 \uC800\uC7A5\uB418\uBA70 \uB2E4\uB978 \uC9C1\uC6D0\uC5D0\uAC8C \uBCF4\uC774\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})}),we(Ze,{children:we(Ze,{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."})})]}),fn(Ze,{sx:{display:"flex",gap:2,alignItems:"center"},children:[we(cy,{value:i,onChange:m=>a(m.target.value),fullWidth:!0,label:"\uBE44\uBC00 iCal \uC8FC\uC18C",placeholder:"https://calendar.google.com/calendar/ical/\u2026/basic.ics",slotProps:{input:{spellCheck:!1}}}),we(Xa,{variant:"contained",disabled:!i.trim()||s,onClick:()=>{l()},sx:{flexShrink:0},children:s?"\uD655\uC778 \uC911\u2026":"\uB4F1\uB85D"})]})]});return we(my,{open:e,onClose:r,width:680,title:"\uAD6C\uAE00 \uCE98\uB9B0\uB354 \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:p}],actions:{showCancelButton:!1,left:we(Xa,{variant:"outlined",startIcon:we(uy,{sx:{fontSize:16}}),onClick:()=>window.open("https://calendar.google.com/calendar","_blank"),children:"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),right:we(Xa,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})}})}import{Box as It,Button as dr,TextField as fy}from"@mui/material";import{FormDialog as xy}from"@ehfuse/mui-form-dialog";import gy from"@mui/icons-material/ContentCopyOutlined";import um from"@mui/icons-material/OpenInNewOutlined";import{InfoAlert as dm}from"@ehfuse/alerts";import{Fragment as by,jsx as Ke,jsxs as xn}from"react/jsx-runtime";function hy(e){return`${window.location.origin}/api/v1/taskbox/calendar/${e}.ics`}function M2({open:e,feed:o,feedTaskCount:t,buildFeedUrl:n,onSubscribe:r,onClose:i}){let a=n??hy,s=o.subscribed?a(o.token):"",d=()=>{navigator.clipboard.writeText(s).then(()=>dm("\uD53C\uB4DC \uC8FC\uC18C\uB97C \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>dm("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD558\uC138\uC694."))},l=()=>{let p=s.replace(/^https?:\/\//,"webcal://");window.open(`https://calendar.google.com/calendar/r?cid=${encodeURIComponent(p)}`,"_blank")},u=xn(It,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[xn(It,{sx:{color:"#37352f",lineHeight:1.7},children:["\uB0B4\uAC00 \uAD00\uC5EC\uD55C \uC5C5\uBB34\uB97C ",Ke("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0\uC11C \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4."]}),t===0?xn(It,{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.",Ke("br",{}),Ke("b",{children:"\uB9C8\uAC10\uAE30\uD55C\uC774 \uC788\uB294 \uB0B4 \uC5C5\uBB34 \uB610\uB294 \uBCF4\uB0B8\uC5C5\uBB34"}),"\uAC00 \uC0DD\uAE30\uBA74"," ",o.subscribed?"\uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0 \uC790\uB3D9\uC73C\uB85C \uD45C\uC2DC\uB429\uB2C8\uB2E4.":"\uC5EC\uAE30\uC11C \uAD6C\uB3C5\uC744 \uC2DC\uC791\uD558\uC138\uC694."]}):o.subscribed&&o.enabled?xn(by,{children:[Ke(fy,{value:s,fullWidth:!0,label:"\uB0B4 \uD53C\uB4DC \uC8FC\uC18C",slotProps:{input:{readOnly:!0}}}),xn(It,{sx:{display:"flex",gap:2},children:[Ke(dr,{variant:"outlined",startIcon:Ke(gy,{}),onClick:d,children:"\uC8FC\uC18C \uBCF5\uC0AC"}),Ke(dr,{variant:"contained",startIcon:Ke(um,{}),onClick:l,children:"Google \uCE98\uB9B0\uB354\uC5D0 \uCD94\uAC00"})]}),xn(It,{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:[Ke(It,{children:xn("span",{children:["\uBC84\uD2BC\uC774 \uB3D9\uC791\uD558\uC9C0 \uC54A\uC73C\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354 > \uB2E4\uB978 \uCE98\uB9B0\uB354 + > ",Ke("b",{children:"URL\uB85C \uCD94\uAC00"}),"\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694."]})}),Ke(It,{children:Ke("span",{children:"\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."})}),Ke(It,{children:Ke("span",{children:"\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."})}),Ke(It,{children:Ke("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."})})]})]}):Ke(dr,{variant:"contained",onClick:r,sx:{alignSelf:"flex-start"},children:"\uAD6C\uB3C5 \uC2DC\uC791 (\uD53C\uB4DC \uBC1C\uAE09)"})]});return Ke(xy,{open:e,onClose:i,width:680,title:"\uAD6C\uAE00 \uCE98\uB9B0\uB354\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:u}],actions:{showCancelButton:!1,left:Ke(dr,{variant:"outlined",startIcon:Ke(um,{sx:{fontSize:16}}),onClick:()=>window.open("https://calendar.google.com/calendar","_blank"),children:"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),right:Ke(dr,{variant:"contained",onClick:i,children:"\uB2EB\uAE30"})}})}import{useEffect as ky,useMemo as Qa,useState as Ja}from"react";import{Box as pr,Button as Ty,Typography as yy}from"@mui/material";import{FormDialog as Sy}from"@ehfuse/mui-form-dialog";import{SearchTextField as By}from"@ehfuse/mui-form-controls";import{TreeView as Cy}from"@ehfuse/tree-view";import{Fragment as My,jsx as Vo,jsxs as Oy}from"react/jsx-runtime";function pm(e){return`${e.name}#${e.seq}`}function vy(e){return Number(e.slice(e.lastIndexOf("#")+1))||0}function Iy(e){let o=[],t=n=>{for(let r of n.employees??[])o.push(r);for(let r of n.groups??[])t(r)};for(let n of e)t(n);return o}function _y(e,o){return o?[e.name,e.department,e.role_name,e.work_position].filter(Boolean).some(t=>String(t).toLowerCase().includes(o)):!0}function wy(e){let o=[[e.name,e.role_name].filter(Boolean).join(" "),e.department].filter(Boolean).join(" / ");return{id:`emp:${e.seq}`,label:pm(e),renderLabel:Vo(pr,{component:"span",sx:{display:"inline-flex",alignItems:"baseline",gap:.75},children:Vo(pr,{component:"span",sx:{fontWeight:400,color:"text.primary"},children:o})})}}function fm(e,o){let t=(e.groups??[]).map(r=>fm(r,o)).filter(r=>r!==null),n=(e.employees??[]).filter(r=>_y(r,o)).map(wy);return t.length===0&&n.length===0?null:{id:`group:${e.key}`,label:e.name,children:[...t,...n]}}function Dy({groups:e,allEmployees:o,initialSelectedSeqs:t,multiple:n,isMobile:r,onSelectionChange:i}){let[a,s]=Ja(""),d=Qa(()=>e.map(u=>fm(u,a.trim().toLowerCase())).filter(u=>u!==null),[e,a]),l=Qa(()=>o.filter(u=>t.includes(u.seq)).map(pm),[]);return Oy(My,{children:[Vo(pr,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:Vo(By,{size:"small",fullWidth:!0,placeholder:"\uC774\uB984, \uBD80\uC11C \uAC80\uC0C9",onSearch:s,onClear:()=>s(""),sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),Vo(pr,{sx:r?{display:"flex",flexDirection:"column"}:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:Vo(Cy,{items:d,checkbox:!0,multiSelect:n,selectionMode:"child",showSearch:!1,defaultExpanded:!0,initialSelections:l,onChange:u=>i(u.map(vy).filter(p=>p>0)),styles:{border:"none",borderRadius:"0"}})})]})}function N2({open:e,title:o="\uC9C1\uC6D0 \uC120\uD0DD",hint:t="",groups:n,multiple:r=!1,selectedSeqs:i,confirmText:a="\uD655\uC778",onConfirm:s,onClose:d}){let l=Re(),[u,p]=Ja([]),[m,c]=Ja(0),T=Qa(()=>Iy(n),[n]),B=i??[];ky(()=>{e&&(p(B),c(g=>g+1))},[e]);let f=()=>{let g=T.filter(k=>u.includes(k.seq));s(r?g:g.slice(0,1)),d()};return Vo(Sy,{open:e,onClose:d,title:`${o}${r&&u.length>0?` (${u.length}\uBA85)`:""}`,locale:"ko",fullScreen:l,mobilePresentation:l?"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:Vo(pr,{sx:{...l?{}:{height:560},display:"flex",flexDirection:"column",border:"1px solid #cccccc",borderRadius:1,...l?{}:{overflow:"hidden"},userSelect:"none"},children:Vo(Dy,{groups:n,allEmployees:T,initialSelectedSeqs:B,multiple:r,isMobile:l,onSelectionChange:p},m)})}],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:t?Vo(yy,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"pre-line",lineHeight:1.35},children:t}):void 0,right:Vo(Ty,{variant:"contained",onClick:f,children:a})}})}import{useEffect as zy,useMemo as qy,useState as Ay}from"react";import{Box as Nn,Button as Ly,Divider as Ny}from"@mui/material";import{FormDialog as Fy}from"@ehfuse/mui-form-dialog";import{LabelSelect as Hy}from"@ehfuse/mui-form-controls";import{Box as rt}from"@mui/material";import{jsx as An,jsxs as Ln}from"react/jsx-runtime";function Ey(e,o){let t=o.filter(n=>n.sprint_seq===e.seq&&!n.archived&&n.completed);return{points:t.reduce((n,r)=>n+(r.story_points??0),0),count:t.length}}function xm({sprints:e,tasks:o,height:t=160}){let r=[...e].sort((u,p)=>`${u.start_date}|${u.seq}`.localeCompare(`${p.start_date}|${p.seq}`)).map(u=>({sprint:u,...Ey(u,o)})),i=r.some(u=>u.points>0),a=r.map(u=>i?u.points:u.count),s=Math.max(1,...a),d=r.filter(u=>u.sprint.status==="closed").map(u=>i?u.points:u.count),l=d.length>0?Math.round(d.reduce((u,p)=>u+p,0)/d.length*10)/10:null;return r.length===0?An(rt,{sx:{py:4,textAlign:"center",fontSize:14.5,color:"#9a9a97"},children:"\uD45C\uC2DC\uD560 \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):Ln(rt,{children:[Ln(rt,{sx:{mb:1,display:"flex",justifyContent:"space-between",fontSize:14,color:"#000"},children:[Ln("span",{children:["\uC644\uB8CC ",i?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uBAA9\uD45C\uBCC4"]}),l!==null?Ln("span",{children:["\uD3C9\uADE0(\uC885\uB8CC \uBAA9\uD45C)"," ",An(rt,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:l}),i?"SP":"\uAC74"]}):null]}),An(rt,{sx:{display:"flex",alignItems:"flex-end",gap:2,height:t,px:.5},children:r.map(u=>{let p=i?u.points:u.count,m=Math.round((t-24)*p/s),c=u.sprint.status==="closed";return Ln(rt,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-end",height:"100%"},children:[An(rt,{sx:{fontSize:14,fontWeight:700,color:"#37352f",lineHeight:1.5},children:p}),An(rt,{sx:{width:"60%",maxWidth:56,height:Math.max(2,m),borderRadius:"4px 4px 0 0",bgcolor:c?"#2f80ed":"#a9c9f5"}})]},u.sprint.seq)})}),An(rt,{sx:{display:"flex",gap:2,px:.5,mt:.5},children:r.map(u=>Ln(rt,{sx:{flex:1,minWidth:0,textAlign:"center",fontSize:13.5,color:"#000",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[u.sprint.name,u.sprint.status!=="closed"?" (\uC9C4\uD589\uC911)":""]},u.sprint.seq))})]})}import{useMemo as Py}from"react";import{Box as gn}from"@mui/material";import{jsx as it,jsxs as hn}from"react/jsx-runtime";function gm(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?new Date(`${e}T00:00:00`):null}function Ry(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function Za(e){return e.slice(5).replace("-",".")}function hm({sprint:e,tasks:o,todayStr:t,height:n=200}){let r=Py(()=>{let g=gm(e.start_date),k=gm(e.end_date);if(!g||!k||k<g||Math.round((k.getTime()-g.getTime())/864e5)+1>366)return null;let b=o.filter(C=>C.sprint_seq===e.seq&&!C.archived);if(b.length===0)return{empty:!0};let S=b.some(C=>(C.story_points??0)>0),h=C=>S?C.story_points??0:1,x=b.reduce((C,y)=>C+h(y),0),I=new Map;for(let C of b){if(!C.completed)continue;let y=(C.completed_time??"").slice(0,10),L=/^\d{4}-\d{2}-\d{2}$/.test(y)?y:e.start_date;I.set(L,(I.get(L)??0)+h(C))}let W=[];for(let C=new Date(g);C<=k;C.setDate(C.getDate()+1))W.push(Ry(C));let D=x,J=[];for(let C of W){if(C>t)break;D-=I.get(C)??0,J.push({day:C,value:Math.max(0,D)})}return{empty:!1,days:W,total:x,usePoints:S,actual:J}},[e,o,t]);if(!r)return it(gn,{sx:{py:4,textAlign:"center",fontSize:14.5,color:"#9a9a97"},children:"\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."});if(r.empty)return it(gn,{sx:{py:4,textAlign:"center",fontSize:14.5,color:"#9a9a97"},children:"\uBC30\uC815\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."});let{days:i,total:a,usePoints:s,actual:d}=r,l=600,u=200,p=8,m=g=>i.length===1?0:g/(i.length-1)*l,c=g=>p+(u-p*2)*(1-g/Math.max(1,a)),T=`${m(0)},${c(a)} ${m(i.length-1)},${c(0)}`,B=d.map(g=>`${m(i.indexOf(g.day))},${c(g.value)}`).join(" "),f=d[d.length-1];return hn(gn,{children:[hn(gn,{sx:{mb:1,display:"flex",justifyContent:"space-between",fontSize:14,color:"#000"},children:[hn("span",{children:["\uB0A8\uC740 ",s?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uCD1D ",a]}),f?hn("span",{children:["\uD604\uC7AC"," ",it(gn,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:f.value}),s?"SP":"\uAC74"," \uB0A8\uC74C"]}):null]}),it(gn,{sx:{border:"1px solid #e6e6e3",borderRadius:1,bgcolor:"#fafaf9",px:1,py:.5},children:hn("svg",{viewBox:`0 0 ${l} ${u}`,preserveAspectRatio:"none",style:{display:"block",width:"100%",height:n},children:[it("line",{x1:0,y1:c(0),x2:l,y2:c(0),stroke:"#e6e6e3",strokeWidth:1}),it("polyline",{points:T,fill:"none",stroke:"#9a9a97",strokeWidth:1.5,strokeDasharray:"6 5",vectorEffect:"non-scaling-stroke"}),d.length>1?it("polyline",{points:B,fill:"none",stroke:"#2f80ed",strokeWidth:2.5,vectorEffect:"non-scaling-stroke"}):null,f?it("circle",{cx:m(i.indexOf(f.day)),cy:c(f.value),r:4,fill:"#2f80ed",vectorEffect:"non-scaling-stroke"}):null]})}),hn(gn,{sx:{mt:.5,display:"flex",justifyContent:"space-between",fontSize:13.5,color:"#000"},children:[it("span",{children:Za(e.start_date)}),t>e.start_date&&t<e.end_date?hn("span",{children:["\uC624\uB298 ",Za(t)]}):null,it("span",{children:Za(e.end_date)})]})]})}import{jsx as _t,jsxs as el}from"react/jsx-runtime";function tz({open:e,sprints:o,tasks:t,todayStr:n,initialSprintSeq:r=0,onClose:i}){let[a,s]=Ay(0);zy(()=>{if(!e)return;let u=o.find(m=>m.status==="active")??o[0],p=o.find(m=>m.seq===r)??u;s(p?.seq??0)},[e]);let d=qy(()=>o.find(u=>u.seq===a)??null,[o,a]),l=el(Nn,{sx:{display:"flex",flexDirection:"column"},children:[el(Nn,{sx:{px:3,py:2.5},children:[_t(Nn,{sx:{mb:1.5,fontSize:17,fontWeight:700,color:"#37352f"},children:"\uBCA8\uB85C\uC2DC\uD2F0"}),_t(xm,{sprints:o,tasks:t})]}),_t(Ny,{sx:{borderColor:"#e6e6e3"}}),el(Nn,{sx:{px:3,py:2.5},children:[_t(Nn,{sx:{mb:1.5,fontSize:17,fontWeight:700,color:"#37352f"},children:"\uBC88\uB2E4\uC6B4"}),_t(Hy,{label:"\uBAA9\uD45C",showLabel:!1,value:a?String(a):"",options:o.map(u=>({value:String(u.seq),label:Mo(u)})),onChange:u=>s(Number(u.target.value)||0),sx:{width:280,mb:2}}),d?_t(hm,{sprint:d,tasks:t,todayStr:n}):_t(Nn,{sx:{py:4,textAlign:"center",fontSize:13.5,color:"#9a9a97"},children:"\uBC88\uB2E4\uC6B4\uC744 \uBCFC \uBAA9\uD45C\uB97C \uC120\uD0DD\uD558\uC138\uC694."})]})]});return _t(Fy,{open:e,onClose:i,width:680,title:"\uBAA9\uD45C \uCC28\uD2B8",locale:"ko",contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-charts",sections:[{id:"sprint-charts",showTitle:!1,children:l}],actions:{showCancelButton:!1,right:_t(Ly,{variant:"contained",onClick:i,children:"\uB2EB\uAE30"})}})}import{Checkbox as Wy,Divider as $y,Menu as Ky,MenuItem as ol}from"@mui/material";import{jsx as fr,jsxs as bm}from"react/jsx-runtime";function lz({anchorEl:e,candidates:o,selectedNames:t,avatarSrcByName:n,onToggle:r,onClear:i,onClose:a}){return bm(Ky,{anchorEl:e,open:!!e,onClose:a,transitionDuration:0,children:[o.length===0?fr(ol,{disabled:!0,sx:{fontSize:14},children:"\uBAA9\uB85D\uC5D0 \uC9C0\uC815\uB41C \uC0AC\uB78C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):o.map(s=>{let d=t.includes(s.name);return bm(ol,{onClick:()=>r(s),sx:{fontSize:14,minWidth:170,gap:1},children:[fr(Wy,{size:"small",checked:d,sx:{p:0}}),fr(ho,{names:[s.name],size:20,avatarSrcByName:n}),s.name]},`${s.accountSeq}-${s.name}`)}),fr($y,{}),fr(ol,{disabled:t.length===0,onClick:i,sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{useState as Uy}from"react";import{ButtonBase as Vy,Menu as Gy,MenuItem as Yy}from"@mui/material";import jy from"@mui/icons-material/KeyboardArrowDown";import Xy from"@mui/icons-material/Check";import{Fragment as Qy,jsx as tl,jsxs as nl}from"react/jsx-runtime";function xz({value:e,onChange:o,options:t}){let[n,r]=Uy(null),i=t??Wi,a=Wi.find(s=>s.value===e)?.label??"";return nl(Qy,{children:[nl(Vy,{onClick:s=>r(s.currentTarget),sx:{display:"flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:1,fontSize:13.5,color:"#37352f","&:hover":{bgcolor:"#f2f2f0"}},children:[a,tl(jy,{sx:{fontSize:17,color:"#9a9a97"}})]}),tl(Gy,{transitionDuration:0,anchorEl:n,open:!!n,onClose:()=>r(null),children:i.map(s=>nl(Yy,{selected:s.value===e,onClick:()=>{o(s.value),r(null)},sx:{fontSize:14,minWidth:140,justifyContent:"space-between",gap:1},children:[s.label,s.value===e?tl(Xy,{sx:{fontSize:16,color:"#2f80ed"}}):null]},s.value))})]})}import{Box as yi,ButtonBase as Jy}from"@mui/material";import{DateTextField as km}from"@ehfuse/mui-form-controls";function bn(e){let o=t=>String(t).padStart(2,"0");return`${e.getFullYear()}-${o(e.getMonth()+1)}-${o(e.getDate())}`}function Ti(e,o=new Date){let t=new Date(o);return t.setMonth(t.getMonth()-e),t}function bz(e=new Date){return{fromDate:bn(Ti(1,e)),toDate:bn(e)}}import{jsx as xr,jsxs as Tm}from"react/jsx-runtime";var Zy=[{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 ym({fromDate:e,toDate:o,onChange:t}){let n=i=>{if(i<=0){t("","");return}t(bn(Ti(i)),bn(new Date))},r=i=>i<=0?!e&&!o:!e||!o?!1:e===bn(Ti(i))&&o===bn(new Date);return Tm(yi,{sx:{display:"flex",alignItems:"center",gap:1.5,flexWrap:"wrap"},children:[xr(yi,{sx:{display:"flex",alignItems:"center",gap:1.5},children:Zy.map(i=>{let a=r(i.months);return xr(Jy,{onClick:()=>n(i.months),sx:{px:1.25,py:.85,borderRadius:1,fontSize:13,fontWeight:a?500:400,border:"1px solid",borderColor:a?"#2f80ed":"#dedddb",color:a?"#2f80ed":"#37352f",bgcolor:a?"#eef6ff":"transparent","&:hover":{bgcolor:a?"#eef6ff":"#f7f7f5"}},children:i.label},i.label)})}),Tm(yi,{sx:{display:"flex",alignItems:"center",gap:.5},children:[xr(km,{value:e,size:"small",placeholder:"\uC2DC\uC791\uC77C",onChange:i=>t(i.target.value,o),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}}),xr(yi,{component:"span",sx:{fontSize:13,color:"#9a9a97"},children:"~"}),xr(km,{value:o,size:"small",placeholder:"\uC885\uB8CC\uC77C",onChange:i=>t(e,i.target.value),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}})]})]})}import{Popover as eS}from"@mui/material";import{jsx as Sm}from"react/jsx-runtime";function _z({anchorEl:e,fromDate:o,toDate:t,onChange:n,onClose:r}){return Sm(eS,{transitionDuration:0,anchorEl:e,open:!!e,onClose:r,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{p:1.5}}},children:Sm(ym,{fromDate:o,toDate:t,onChange:n})})}import{Box as oS,ButtonBase as tS,Tab as nS,Tabs as rS}from"@mui/material";import iS from"@mui/icons-material/Checklist";import aS from"@mui/icons-material/Face";import lS from"@mui/icons-material/Publish";import sS from"@mui/icons-material/NotificationsOutlined";import cS from"@mui/icons-material/BugReportOutlined";import mS from"@mui/icons-material/DescriptionOutlined";import uS from"@mui/icons-material/Inventory2Outlined";import{jsx as Go}from"react/jsx-runtime";function Bm(e,o){return o>0?`${e} (${o})`:e}var Fz=[{id:"my",label:"\uC804\uCCB4",icon:Go(iS,{sx:{fontSize:18}})},{id:"notice",label:"\uACF5\uC9C0\uC0AC\uD56D",icon:Go(sS,{sx:{fontSize:18}})},{id:"mine",label:"\uB0B4 \uC5C5\uBB34",icon:Go(aS,{sx:{fontSize:18}})},{id:"sent",label:"\uBCF4\uB0B8 \uC5C5\uBB34",icon:Go(lS,{sx:{fontSize:18}})},{id:"bug",label:"\uC624\uB958",icon:Go(cS,{sx:{fontSize:18}})},{id:"archive",label:"\uBCF4\uAD00\uD568",icon:Go(uS,{sx:{fontSize:18}}),hideCount:!0},{id:"report",label:"\uBCF4\uACE0\uC11C",icon:Go(mS,{sx:{fontSize:18}}),hideCount:!0}];function dS(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 Hz({items:e,activeTab:o,counts:t,onChange:n,compact:r=!1}){let i=ne(),a=dS(i.tabs),s=e;return r?Go(oS,{sx:{display:"flex",flexWrap:"wrap",gap:1.25},children:s.map(d=>{let l=o===d.id;return Go(tS,{onClick:()=>n(d.id),sx:{px:1.5,py:.75,borderRadius:1,fontSize:fo(13.5),fontWeight:500,whiteSpace:"nowrap",border:"1px solid",bgcolor:l?i.tabs.selectedBg:i.tabs.bg,color:l?i.tabs.selectedColor:i.tabs.color,borderColor:l?i.tabs.selectedBg:i.tabs.borderColor},children:Bm(d.label,d.hideCount?0:t[d.id]??0)},d.id)})}):Go(rS,{value:o,onChange:(d,l)=>n(l),sx:{minHeight:46,"& .MuiTabs-indicator":{display:"none"},"& .MuiTabs-flexContainer":{gap:"12px",minHeight:46}},children:s.map(d=>Go(nS,{value:d.id,label:Bm(d.label,d.hideCount?0:t[d.id]??0),icon:d.icon,iconPosition:"start",sx:a},d.id))})}import{useEffect as pS,useMemo as fS,useState as rl}from"react";import{Divider as il,ListItemIcon as zo,Menu as al,MenuItem as po}from"@mui/material";import xS from"@mui/icons-material/OpenInNewOutlined";import gS from"@mui/icons-material/Check";import hS from"@mui/icons-material/CheckCircleOutlined";import bS from"@mui/icons-material/RadioButtonUnchecked";import kS from"@mui/icons-material/SendOutlined";import TS from"@mui/icons-material/EventOutlined";import yS from"@mui/icons-material/PersonOutlineOutlined";import SS from"@mui/icons-material/ViewKanbanOutlined";import BS from"@mui/icons-material/ContentCopyOutlined";import CS from"@mui/icons-material/NextPlanOutlined";import vS from"@mui/icons-material/ContentPasteOutlined";import IS from"@mui/icons-material/ShareOutlined";import _S from"@mui/icons-material/DirectionsRunOutlined";import Cm from"@mui/icons-material/ChevronRight";import wS from"@mui/icons-material/ArchiveOutlined";import DS from"@mui/icons-material/UnarchiveOutlined";import{ConfirmDialog as MS}from"@ehfuse/alerts";import{Fragment as OS,jsx as se,jsxs as so}from"react/jsx-runtime";function hq({target:e,onClose:o,customTabs:t,sprints:n=[],myAccountSeq:r=0,onOpenDetail:i,onToggleCompleted:a,onRequestConfirm:s,onChangeDueDate:d,onChangeReminder:l,onMemberEdit:u,onMoveProject:p,onDuplicate:m,onCreateFollowUp:c,onShare:T,onAssignSprint:B,onArchiveToggle:f,onDelete:g}){let k=Re(),w=Qo(),[b,S]=rl(null),[h,x]=rl(null),[I,W]=rl(null);pS(()=>{e||(S(null),x(null),W(null))},[e]);let D=e?.task??null,J=!!D?.is_notice,C=!!D?.is_event,y=D?!ct(D,r):!1,L=fS(()=>new Set(t.filter(R=>R.useSprints).map(R=>R.key)),[t]),$=async()=>{let R=D;if(o(),!R)return;await MS({title:"\uC5C5\uBB34 \uC0AD\uC81C",message:`"${R.title}" \uC5C5\uBB34\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&g(R.seq)},Q=()=>{D&&f(D.seq,!D.archived),o()};return so(OS,{children:[so(al,{open:!!e,onClose:o,transitionDuration:0,anchorReference:k?"none":"anchorPosition",anchorPosition:!k&&e?{top:e.position.top,left:e.position.left}:void 0,slotProps:{paper:{sx:{minWidth:190,...k?{position:"fixed",top:"50%",left:"50%",translate:"-50% -50%",maxHeight:"70vh"}:{}}},list:k?{sx:{"& .MuiMenuItem-root":{py:1,minHeight:0}}}:void 0},children:[so(po,{onClick:()=>{D&&i(D),o()},sx:{fontSize:14},children:[se(zo,{children:se(xS,{sx:{fontSize:19}})}),"\uC0C1\uC138 \uC5F4\uAE30"]}),so(po,{disabled:J?(D?.author_account_seq??0)!==r:(D?.author_account_seq??0)!==r&&(D?.manager_account_seq??0)!==r,onClick:()=>{D&&a(D.seq,!D.completed),o()},sx:{fontSize:14},children:[se(zo,{children:D?.completed?se(bS,{sx:{fontSize:19}}):se(hS,{sx:{fontSize:19}})}),D?.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC"]}),!J&&s?so(po,{disabled:!(D?.manager_account_seq??0)&&(D?.receiver_account_seqs??[]).length===0,onClick:()=>{D&&s(D),o()},sx:{fontSize:14},children:[se(zo,{children:se(kS,{sx:{fontSize:19}})}),"\uD655\uC778 \uC694\uCCAD"]}):null,C?null:se(il,{}),C?null:so(po,{disabled:y,onClick:R=>{D&&S({anchorEl:R.currentTarget,task:D})},sx:{fontSize:14},children:[se(zo,{children:se(TS,{sx:{fontSize:19}})}),"\uB9C8\uAC10\uAE30\uD55C \uBCC0\uACBD"]}),!J&&!C&&u?so(po,{onClick:()=>{D&&u(D,"manager"),o()},sx:{fontSize:14},children:[se(zo,{children:se(yS,{sx:{fontSize:19}})}),"\uCC45\uC784\uC790 \uBCC0\uACBD"]}):null,C?null:so(po,{disabled:y,onClick:R=>{D&&x({anchorEl:R.currentTarget,task:D})},sx:{fontSize:14},children:[se(zo,{children:se(SS,{sx:{fontSize:19}})}),"\uD504\uB85C\uC81D\uD2B8 \uC774\uB3D9",se(Cm,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}),se(il,{}),m?so(po,{disabled:y,onClick:()=>{D&&m(D.seq),o()},sx:{fontSize:14},children:[se(zo,{children:se(BS,{sx:{fontSize:19}})}),"\uBCF5\uC81C"]}):null,c&&D&&!D.is_event&&!D.is_notice?so(po,{onClick:()=>{D&&c(D.seq),o()},sx:{fontSize:14},children:[se(zo,{children:se(CS,{sx:{fontSize:19}})}),"\uD6C4\uC18D \uC5C5\uBB34 \uB9CC\uB4E4\uAE30"]}):null,so(po,{onClick:()=>{D&&(T?T(D):xi(D,k)),o()},sx:{fontSize:14},children:[se(zo,{children:k?se(IS,{sx:{fontSize:19}}):se(vS,{sx:{fontSize:19}})}),k?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC"]}),D&&!D.is_notice&&!D.is_event&&L.has(String(D.tab_key??""))&&B?so(po,{onClick:R=>W(R.currentTarget),sx:{fontSize:14},children:[se(zo,{children:se(_S,{sx:{fontSize:19}})}),"\uBAA9\uD45C\uC5D0 \uB123\uAE30",se(Cm,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}):null,so(po,{onClick:Q,disabled:y||!D?.archived&&!(D&&Br(D)),sx:{fontSize:14},children:[se(zo,{children:D?.archived?se(DS,{sx:{fontSize:19}}):se(wS,{sx:{fontSize:19}})}),D?.archived?"\uBCF4\uAD00 \uD574\uC81C":"\uBCF4\uAD00"]}),se(il,{}),so(po,{disabled:y,onClick:$,sx:{fontSize:14,color:"#e5484d"},children:[se(zo,{children:se(ft,{sx:{fontSize:19,color:"#e5484d"}})}),"\uC0AD\uC81C"]})]}),se(Pt,{anchorEl:b?.anchorEl??null,open:!!b,date:b?.task.due_date??"",reminder:b?.task.reminder??"none",hideReminder:!!b?.task.completed,centered:k,onClose:()=>{S(null),o()},onDateChange:R=>{b&&d(b.task.seq,R)},onReminderChange:R=>{b&&l?.(b.task.seq,R)}}),so(al,{transitionDuration:0,anchorEl:h?.anchorEl??null,open:!!h,onClose:()=>{x(null),o()},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...w,children:[se(po,{selected:!h?.task.tab_key,onClick:()=>{h&&p(h.task.seq,""),x(null),o()},sx:{fontSize:14,minWidth:170},children:"\uC5C6\uC74C"}),t.filter(R=>!R.archived).map(R=>se(po,{selected:h?.task.tab_key===R.key,onClick:()=>{h&&p(h.task.seq,R.key),x(null),o()},sx:{fontSize:14,minWidth:170},children:R.label},R.key))]}),se(al,{transitionDuration:0,anchorEl:I,open:!!I,onClose:()=>W(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...n.filter(R=>`custom-${R.group_seq}`===String(D?.tab_key??"")).map(R=>({seq:R.seq,label:Mo(R)}))].map(R=>so(po,{onClick:()=>{D&&B?.(D.seq,R.seq),W(null),o()},sx:{fontSize:14,minWidth:160,gap:1},children:[R.label,(D?.sprint_seq??0)===R.seq?se(gS,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},R.seq))})]})}import{Checkbox as ES,Divider as PS,Menu as RS,MenuItem as vm}from"@mui/material";import{jsx as Si,jsxs as Im}from"react/jsx-runtime";function Sq({anchorEl:e,labelOptions:o,selectedKeys:t,onToggle:n,onClear:r,onClose:i}){return Im(RS,{transitionDuration:0,anchorEl:e,open:!!e,onClose:i,children:[o.map(a=>{let s=t.includes(a.key);return Im(vm,{onClick:()=>n(a.key),sx:{fontSize:14,minWidth:190,gap:1},children:[Si(ES,{size:"small",checked:s,sx:{p:0}}),Si(Ee,{option:a})]},a.key)}),Si(PS,{}),Si(vm,{disabled:t.length===0,onClick:()=>{r(),i()},sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{Divider as _m,Menu as zS,MenuItem as ll}from"@mui/material";import qS from"@mui/icons-material/Check";import AS from"@mui/icons-material/BarChartOutlined";import LS from"@mui/icons-material/SettingsOutlined";import{jsx as gr,jsxs as Bi}from"react/jsx-runtime";function Mq(e){let{anchorEl:o,sprints:t,value:n,onSelect:r,onManage:i,onCharts:a,onClose:s}=e;return Bi(zS,{transitionDuration:0,anchorEl:o,open:!!o,onClose:s,children:[[{seq:0,label:"\uC804\uCCB4"},{seq:-1,label:"\uBBF8\uBC30\uC815 \uC5C5\uBB34"},...t.map(d=>({seq:d.seq,label:Mo(d)}))].map(d=>Bi(ll,{onClick:()=>{r(d.seq),s()},sx:{fontSize:14,minWidth:180,gap:1},children:[d.label,n===d.seq?gr(qS,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},d.seq)),gr(_m,{}),a?Bi(ll,{onClick:()=>{s(),a()},sx:{fontSize:14,gap:1},children:[gr(AS,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uCC28\uD2B8"]}):null,a?gr(_m,{}):null,Bi(ll,{onClick:()=>{s(),i()},sx:{fontSize:14,gap:1},children:[gr(LS,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uAD00\uB9AC\u2026"]})]})}var NS={my:"tasks",mine:"tasks",sent:"tasks",notice:"notice",bug:"bug",archive:"archive",done:"done",report:"report"};function FS(e){return NS[e]??"tasks"}var Pq={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"},wm=["list","calendar","month","card","kanban","sprint","timeline"],HS=["list","card"];function Rq(e){let o=FS(e);switch(o){case"notice":return{kind:o,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:o,viewOptions:wm,showCreate:!0,createLabel:"\uC624\uB958 \uB4F1\uB85D",showGroupBy:!0,showSprintFilter:!0,showDateRange:!1,showHideCompleted:!0,forceFlatList:!1,columns:{bug:!0}};case"archive":return{kind:o,viewOptions:HS,showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"done":return{kind:o,viewOptions:["list"],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"report":return{kind:o,viewOptions:[],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{}};default:return{kind:o,viewOptions:wm,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"}:{}}}}export{_v as ALL_TASK_VIEWER_ACCOUNT_SEQS,yc as AddLabelDialog,Ar as AddTabDialog,hc as AttachmentUploadGauge,za as AttachmentUploadPercent,Ri as BUG_DEVICE_OPTIONS,Vn as BUG_ICON_COLOR,mv as BUG_KANBAN_COLUMNS,Pi as BUG_REPRO_OPTIONS,zi as BUG_RESOLUTION_OPTIONS,Xt as BUG_STATUS_OPTIONS,Un as BUG_TASK_ICON,ri as BugPropertiesGrid,Zp as COLUMN_WIDTHS,Ai as COMPLETED_STATUS_OPTION,Ga as CUSTOM_TAB_KEY_PREFIX,S2 as CalendarImportDialog,M2 as CalendarSubscribeDialog,Cn as CommentBubbleIcon,Bn as ConfirmCountButton,Jl as DATE_REMINDER_OPTIONS,_i as DEFAULT_PROJECT_ICON,Fz as DEFAULT_TASKBOX_TAB_ITEMS,Me as DEFAULT_TASK_ICON,_z as DateRangeFilterPopover,Eo as DrawerSection,Pt as DueDatePickerPopover,Ep as ENDED_EVENT_STATUS_OPTION,wc as EVENT_ICON_COLOR,N2 as EmployeeSelectDialog,Wi as GROUP_BY_OPTIONS,_n as GoogleEventChip,xz as GroupByMenuButton,qr as IconPickerGrid,ic as InlineAddressInput,vt as InlineTextValue,Li as KANBAN_CLOSED_COLUMN_KEY,Sq as LabelFilterMenu,ui as LabelSelectMenu,Yn as MANUAL_TASK_STATUS_OPTIONS,lz as MemberFilterMenu,Gn as NOTICE_STATUS_OPTIONS,xo as NOTICE_TASK_ICON,Bl as NO_TASK_ICON,wi as PROJECT_ICON_OPTIONS,de as PropertyRow,yn as RECEIVER_AVATAR_COLORS,Zl as REMINDER_OPTIONS,ho as ReceiverAvatarStack,Jc as RelatedTasksSection,Tr as STATUS_KEY_REPLIED,$n as STATUS_KEY_WAITING,ss as SortableTaskCard,hm as SprintBurndownChart,tz as SprintChartsDialog,Mq as SprintFilterMenu,d2 as SprintManageDialog,xm as SprintVelocityChart,_r as StatusSelectMenu,Ui as TASKBOX_COLUMNS,Ho as TASKBOX_DRAWER_NARROW_MQ,Cl as TASKBOX_UI_STATE_ID,Pq as TASKBOX_VIEW_LABELS,OD as TASKBOX_VIEW_MODES,jt as TASK_STATUS_OPTIONS,Uf as TIME_REMINDER_OPTIONS,Fr as TaskAckListPopover,Sn as TaskActionButton,ci as TaskAttachmentsSection,Gs as TaskBoxColumnSummary,ma as TaskBoxGroupBoard,hM as TaskBoxMobileList,qs as TaskBoxMonthAgenda,Es as TaskBoxMonthCalendar,KD as TaskBoxSprintColumnSummary,rs as TaskBoxTable,Hz as TaskBoxTabs,Ws as TaskBoxTimeline,MD as TaskBoxView,Is as TaskBoxWeekCalendar,Zn as TaskCardContent,ai as TaskChecklistSection,Nc as TaskCommentInput,Lc as TaskCommentsSection,ii as TaskContentEditor,hq as TaskContextMenu,ni as TaskCorePropertiesGrid,Dc as TaskCreateBody,I5 as TaskCreateDrawer,ym as TaskDateRangeFilter,tm as TaskDetailBody,ZR as TaskDetailDrawer,Kc as TaskDetailHeader,En as TaskIconPickerPopover,Ot as TaskLabelChips,jc as TaskLinkDialog,Uc as TaskNoteField,Lo as TaskPriorityChip,Ee as TaskStatusChip,hv as TaskStatusChips,Am as TaskboxProvider,hy as buildCalendarFeedUrl,Hr as buildCardBaseSx,Pl as buildStatusOptionColors,$i as buildTaskGroupSections,Gc as buildTaskRelationsModel,eT as buildTaskShareText,yr as buildTaskboxTheme,Rl as canAssignBugManager,Dr as canClaimTaskItem,ct as canEditTaskItem,wr as canViewTaskItem,Mr as canVolunteerTaskItem,Ks as countWorkdays,_p as createTaskboxTheme,Vs as daysLeftUntil,Di as defaultTaskBoxFormValues,Mi as defaultTaskboxUiStateValues,Ic as filterFilesWithinLimit,j1 as formatConfirmTime,$s as formatHours,Zo as formatKoreanDate,mt as formatKoreanDateTime,Mo as formatSprintOptionLabel,Ml as getBugDeviceName,Dl as getBugReproName,Sr as getBugResolutionName,Pp as getBugStatusOption,bz as getDefaultDateRange,jn as getEventDisplayStatusOption,uv as getNoDueStatusRank,vc as getNoticeAckInfo,Ol as getNoticeStatusOption,LE as getNoticeTargetDisplay,kn as getProjectIconAnchorComponent,Fe as getProjectIconComponent,ea as getReminderLabel,Zi as getReminderOptions,El as getStatusOptionsForTask,Rq as getTabHeaderConfig,Gi as getTaskBoxColumnDefs,Or as getTaskBoxGridTemplate,FS as getTaskBoxTabKind,as as getTaskConfirmInfo,go as getTaskDisplayStatusOption,Cr as getTaskStatusOption,In as groupGoogleEventsByDate,Ya as groupSeqFromTabKey,yP as hasRelation,Kb as htmlToPlainText,oy as isCustomTabKey,Hi as isOpenPoolTaskItem,qi as isPastEvent,Br as isTaskDone,Ni as isWaitingTask,Ti as monthsAgoDate,uo as narrowOrderSx,JR as nowDateTimeString,_h as parseEstimatedHours,un as relationsOf,Tn as resolveTaskStatusOptions,Ei as resolveTaskboxTheme,xi as shareTaskText,Us as sumRemainingHours,di as summarizeNoticeTargets,t2 as tabKeyFromGroupSeq,bn as toYmd,vr as toggleLabelKey,Ii as useBuildFileUrl,gc as useTaskAttachmentUploadMeta,vo as useTaskboxConfig,Sp as useTaskboxForm,ne as useTaskboxTheme,st as useTaskboxUiState,Kn as useUploadMaxMb};
|
|
12
|
+
`).trim():"";function nT(e){let o=[`[\uC5C5\uBB34] ${e.title}`],t=Zo(e.start_date),n=Zo(e.due_date);(t||n)&&o.push(`\uAE30\uAC04: ${t&&n?`${t} ~ ${n}`:t||n}`),e.manager_name&&o.push(`\uCC45\uC784\uC790: ${e.manager_name}`);let r=go(e).name;r&&o.push(`\uC0C1\uD0DC: ${r}`);let i=Hc(e.content);i&&o.push("",i);let a=String(e.note??"").trim();return a&&o.push("",`\uBE44\uACE0: ${a}`),o.join(`
|
|
13
|
+
`)}function Wc(e){navigator.clipboard.writeText(e).then(()=>tT("\uC5C5\uBB34 \uB0B4\uC6A9\uC744 \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>oT("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uB0B4\uC6A9\uC744 \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD574 \uC8FC\uC138\uC694."))}function gi(e,o){let t=nT(e);if(o&&typeof navigator.share=="function"){navigator.share({text:t}).catch(n=>{n?.name!=="AbortError"&&Wc(t)});return}Wc(t)}import{Fragment as uT,jsx as Xe,jsxs as Kc}from"react/jsx-runtime";function Uc({task:e,myAccountSeq:o=0,onToggleCompleted:t,onChangeTitle:n,onChangeIcon:r,onChangeIconColor:i,onClose:a,appBarMode:s=!1}){let d=Re(),[l,u]=$c(null),[p,m]=$c(null),c=Tn(e.icon||(e.is_notice?xo:e.is_event?"event":Me)),k=!!e.is_notice,S=!!e.is_event,g=k&&o>0&&(e.author_account_seq??0)===o,h=!ct(e,o),b=!S&&(k?g:(e.author_account_seq??0)===o||(e.manager_account_seq??0)===o);return Kc(uT,{children:[Kc(hi,{sx:{display:"flex",alignItems:"center",gap:1,px:2,py:1.5,flexShrink:0},children:[s&&a?Xe(bi,{"aria-label":"\uB4A4\uB85C",onClick:a,sx:{color:"#37352f",ml:-1},children:Xe(aT,{})}):null,b&&!s?Xe(Wa,{title:e.completed&&e.completed_by?`${e.completed_by} \xB7 ${mt(e.completed_time)} \uC644\uB8CC`:e.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC",arrow:!0,disableInteractive:!0,slotProps:{transition:{timeout:0}},children:Xe(rT,{checked:e.completed,icon:Xe(mT,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:Xe(cT,{sx:{fontSize:22,color:"#2f80ed"}}),onChange:(w,y)=>t(e.seq,y),sx:{p:0}})}):null,s?null:Xe(Wa,{title:h?"":"\uC544\uC774\uCF58 \uBCC0\uACBD",arrow:!0,children:Xe(bi,{size:"small",onClick:h?void 0:w=>m(w.currentTarget),sx:{color:e.icon_color||(k?"#e5484d":"#1e3a8a")},children:Xe(c,{sx:{fontSize:20}})})}),l!==null?Xe(hi,{component:"input",autoFocus:!0,spellCheck:!1,value:l,onChange:w=>u(w.target.value),onBlur:()=>{l.trim()&&l.trim()!==e.title&&n(e.seq,l.trim()),u(null)},onKeyDown:w=>{w.key==="Enter"&&w.target.blur(),w.key==="Escape"&&u(null)},sx:{flex:1,minWidth:0,border:"none",outline:"none",font:"inherit",fontSize:18,fontWeight:500,color:"#37352f",p:0,m:0}}):s?Xe(hi,{sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:k?"\uACF5\uC9C0":S?"\uC77C\uC815":e.is_bug?"\uC624\uB958":"\uC5C5\uBB34"}):Xe(hi,{onClick:h?void 0:()=>u(e.title),sx:{flex:1,minWidth:0,fontSize:18,fontWeight:500,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:h?"default":"text",textDecoration:e.completed?"line-through":"none"},children:e.title}),Xe(Wa,{title:d?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",arrow:!0,children:Xe(bi,{"aria-label":d?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC",onClick:()=>gi(e,d),sx:{color:"#6b7280"},children:d?Xe(lT,{sx:{fontSize:20}}):Xe(sT,{sx:{fontSize:20}})})}),a&&!s?Xe(bi,{"aria-label":"\uB2EB\uAE30",onClick:a,sx:{color:"#6b7280"},children:Xe(iT,{})}):null]}),Xe(Pn,{anchorEl:p,value:e.icon||(k?xo:""),color:e.icon_color||(k?"#e5484d":"#1e3a8a"),onSelect:w=>r(e.seq,w),onSelectColor:w=>i?.(e.seq,w),onClose:()=>m(null)})]})}import{useState as $t}from"react";import{Box as to,Button as ki,ButtonBase as OT,Checkbox as ET,Divider as pn,IconButton as PT,Menu as RT,MenuItem as zT}from"@mui/material";import qT from"@mui/icons-material/ExpandLess";import AT from"@mui/icons-material/ExpandMore";import LT from"@mui/icons-material/ConfirmationNumberOutlined";import NT from"@mui/icons-material/Check";import FT from"@mui/icons-material/DirectionsRunOutlined";import HT from"@mui/icons-material/SpeedOutlined";import em from"@mui/icons-material/CheckCircle";import WT from"@mui/icons-material/CheckCircleOutlineOutlined";import om from"@mui/icons-material/CheckCircleOutlined";import tm from"@mui/icons-material/AccessTimeOutlined";import $T from"@mui/icons-material/AutorenewOutlined";import KT from"@mui/icons-material/LabelOutlined";import UT from"@mui/icons-material/PersonOutlineOutlined";import VT from"@mui/icons-material/SubjectOutlined";import GT from"@mui/icons-material/StickyNote2Outlined";import YT from"@mui/icons-material/PanToolAltOutlined";import{useState as dT}from"react";import{TextField as pT}from"@ehfuse/mui-form-controls";import{jsx as fT}from"react/jsx-runtime";function Vc({value:e,onCommit:o,onDraftChange:t,readOnly:n=!1}){let[r,i]=dT(null);return fT(pT,{value:r??e,placeholder:n?"":"\uBE44\uACE0 \uC785\uB825",fullWidth:!0,size:"medium",slotProps:{input:{readOnly:n}},onChange:a=>{i(a.target.value),t?.(a.target.value)},onBlur:()=>{r!==null&&r.trim()!==e&&o(r),i(null)},onKeyDown:a=>{a.key==="Enter"&&a.target.blur(),a.key==="Escape"&&i(null)},sx:{mt:1}})}import{useMemo as Qc,useState as Ua}from"react";import{Box as lo,Button as Jc,IconButton as vT}from"@mui/material";import IT from"@mui/icons-material/AccountTreeOutlined";import _T from"@mui/icons-material/Add";import DT from"@mui/icons-material/Close";import wT from"@mui/icons-material/NextPlanOutlined";function dn(e){return e.relations??[]}function CP(e,o,t){return dn(e).some(n=>n.type===t&&n.task_seq===o.seq)||dn(o).some(n=>n.type===t&&n.task_seq===e.seq)}function Gc(e){return`${e.created_time??""}|${String(e.seq).padStart(12,"0")}`}function Yc(e,o){let t=new Map(o.map(c=>[c.seq,c]));t.set(e.seq,e);let n=new Map,r=(c,k)=>{n.has(c)||n.set(c,new Set),n.has(k)||n.set(k,new Set),n.get(c).add(k),n.get(k).add(c)};for(let c of t.values())for(let k of dn(c))k.type==="follow_up"&&t.has(k.task_seq)&&r(c.seq,k.task_seq);let i=new Set([e.seq]),a=[e.seq];for(;a.length>0;){let c=a.shift();for(let k of n.get(c)??[])i.has(k)||(i.add(k),a.push(k))}let s=[...i].map(c=>t.get(c)).filter(c=>!!c).sort((c,k)=>Gc(c).localeCompare(Gc(k))),d=new Set;for(let c of dn(e))c.type==="related"&&d.add(c.task_seq);for(let c of t.values())c.seq!==e.seq&&dn(c).some(k=>k.type==="related"&&k.task_seq===e.seq)&&d.add(c.seq);let l=[...d].map(c=>t.get(c)).filter(c=>c!==void 0&&c.seq!==e.seq),u=[...t.values()].filter(c=>c.seq!==e.seq&&dn(c).some(k=>k.type==="duplicate_of"&&k.task_seq===e.seq)),p=dn(e).find(c=>c.type==="duplicate_of")?.task_seq,m=p?t.get(p)??null:null;return{lineage:s,related:l,duplicates:u,duplicateOf:m}}import{useEffect as xT,useMemo as gT,useState as $a}from"react";import{Box as zn,Button as hT,Tab as bT,Tabs as kT}from"@mui/material";import TT from"@mui/icons-material/Check";import{FormDialog as yT}from"@ehfuse/mui-form-dialog";import{ClearTextField as ST}from"@ehfuse/mui-form-controls";import{ErrorAlert as BT}from"@ehfuse/alerts";import{OverlayScrollbar as CT}from"@ehfuse/overlay-scrollbar";import{jsx as Ro,jsxs as Ka}from"react/jsx-runtime";var jc=[{type:"related",label:"\uAD00\uB828",hint:"\uB2E8\uC21C\uD788 \uAD00\uB828 \uC788\uB294 \uC5C5\uBB34\uB85C \uC5F0\uACB0\uD569\uB2C8\uB2E4"},{type:"follow_up",label:"\uC774\uC804 \uC5C5\uBB34",hint:"\uC774 \uC5C5\uBB34\uAC00 \uC120\uD0DD\uD55C \uC5C5\uBB34\uC5D0\uC11C \uC774\uC5B4\uC9C4 \uD6C4\uC18D\uC784\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4(\uC774\uB825 \uD0C0\uC784\uB77C\uC778)"},{type:"duplicate_of",label:"\uC911\uBCF5(\uC6D0\uBCF8)",hint:"\uC774 \uC5C5\uBB34\uAC00 \uC120\uD0DD\uD55C \uC6D0\uBCF8 \uC5C5\uBB34\uC758 \uC911\uBCF5\uC784\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4"}];function Xc({open:e,task:o,tasks:t,excludeSeqs:n=[],onClose:r,onSubmit:i}){let[a,s]=$a("related"),[d,l]=$a(""),[u,p]=$a(0);xT(()=>{e&&(s("related"),l(""),p(0))},[e]);let m=gT(()=>{let g=new Set([o.seq,...n]),h=d.trim().toLowerCase();return t.filter(b=>g.has(b.seq)||b.is_event||b.is_notice?!1:h?b.title.toLowerCase().includes(h)||(b.ticket_no??"").toLowerCase().includes(h):!0)},[t,o.seq,n,d]),c=()=>{if(!u){BT("\uC5F0\uACB0\uD560 \uC5C5\uBB34\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}i(u,a),r()},k=jc.find(g=>g.type===a)?.hint??"",S=Ka(zn,{children:[Ro(kT,{value:a,onChange:(g,h)=>s(h),sx:{minHeight:38,mb:.75,"& .MuiTab-root":{minHeight:38,py:.5,fontSize:14}},children:jc.map(g=>Ro(bT,{value:g.type,label:g.label},g.type))}),Ro(zn,{sx:{mb:1.5,fontSize:12.5,color:"#9a9a97"},children:k}),Ro(ST,{label:"\uC5C5\uBB34 \uAC80\uC0C9",placeholder:"\uC81C\uBAA9\xB7\uD2F0\uCF13\uBC88\uD638\uB85C \uAC80\uC0C9",value:d,onChange:g=>l(g.target.value),fullWidth:!0,autoFocus:!0}),Ro(zn,{sx:{mt:1.5,height:300,border:"1px solid #e6e6e3",borderRadius:1},children:Ro(CT,{style:{height:"100%"},children:m.length===0?Ro(zn,{sx:{py:4,textAlign:"center",fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uD560 \uC218 \uC788\uB294 \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):m.map(g=>{let h=He(g.icon||Me),b=g.seq===u;return Ka(zn,{onClick:()=>p(b?0:g.seq),sx:{display:"flex",alignItems:"center",gap:.75,px:1.25,py:.75,cursor:"pointer",bgcolor:b?"#e3eefb":"transparent","&:hover":{bgcolor:b?"#e3eefb":"#f7f7f5"}},children:[h?Ro(h,{sx:{fontSize:17,flexShrink:0,color:g.icon_color||"#1e3a8a"}}):null,Ka(zn,{component:"span",sx:{flex:1,minWidth:0,fontSize:14,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[g.ticket_no?`${g.ticket_no} `:"",g.title]}),Ro(Ee,{option:go(g),small:!0}),b?Ro(TT,{sx:{fontSize:17,flexShrink:0,color:"#2f80ed"}}):null]},g.seq)})})})]});return Ro(yT,{open:e,onClose:r,maxWidth:"sm",title:"\uAD00\uB828 \uC5C5\uBB34 \uC5F0\uACB0",locale:"ko",tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-task-link",sections:[{id:"task-link",showTitle:!1,children:S}],actions:{showCancelButton:!0,right:Ro(hT,{variant:"contained",disabled:!u,onClick:c,children:"\uC5F0\uACB0"})}})}import{Fragment as MT,jsx as Ne,jsxs as Uo}from"react/jsx-runtime";function Va({item:e,caption:o,onOpen:t,onUnlink:n}){let r=He(e.icon||Me);return Uo(lo,{sx:{display:"flex",alignItems:"center",gap:.75,px:1.25,py:.5,borderRadius:1,"&:hover":{bgcolor:"#f7f7f5"},"&:hover .taskbox-relation-unlink":{opacity:1}},children:[o?Ne(lo,{component:"span",sx:{flexShrink:0,px:.6,py:.1,borderRadius:.75,fontSize:11.5,fontWeight:500,color:"#8a6d1d",bgcolor:"#faf1d7"},children:o}):null,r?Ne(r,{sx:{fontSize:16,flexShrink:0,color:e.icon_color||"#1e3a8a"}}):null,Uo(lo,{component:"span",onClick:t,sx:{flex:1,minWidth:0,fontSize:14,color:e.completed?"#9a9a97":"#37352f",textDecoration:e.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...t?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[e.ticket_no?`${e.ticket_no} `:"",e.title]}),Ne(Ee,{option:go(e),small:!0}),n?Ne(vT,{className:"taskbox-relation-unlink",size:"small","aria-label":"\uC5F0\uACB0 \uD574\uC81C",onClick:n,sx:{opacity:0,transition:"opacity 0.15s",color:"#9a9a97"},children:Ne(DT,{sx:{fontSize:15}})}):null]})}function Zc({task:e,tasks:o,readOnly:t=!1,onOpenTask:n,onLink:r,onUnlink:i,onCreateFollowUp:a}){let[s,d]=Ua(!1),[l,u]=Ua(null),[p,m]=Ua(null),c=Qc(()=>Yc(e,o),[e,o]),k=c.lineage.length>=2,S=(k?c.lineage.length-1:0)+c.related.length+c.duplicates.length+(c.duplicateOf?1:0),g=Qc(()=>{let b=new Set;for(let w of c.lineage)b.add(w.seq);for(let w of c.related)b.add(w.seq);for(let w of c.duplicates)b.add(w.seq);return c.duplicateOf&&b.add(c.duplicateOf.seq),[...b]},[c]),h=(b,w,y)=>{m({anchorEl:b,targetSeq:w,type:y})};return Uo(Po,{icon:Ne(IT,{sx:{fontSize:19,display:"block"}}),title:Uo(MT,{children:["\uAD00\uB828 \uC5C5\uBB34",S>0?Ne(lo,{component:"span",sx:{fontSize:12.5,color:"#9a9a97"},children:S}):null]}),titleExtra:t?null:Uo(lo,{sx:{ml:"auto",display:"flex",alignItems:"center",gap:.5},children:[a?Ne(Jc,{size:"small",color:"inherit",startIcon:Ne(wT,{sx:{fontSize:16}}),onClick:b=>u(b.currentTarget),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uD6C4\uC18D \uC5C5\uBB34"}):null,r?Ne(Jc,{size:"small",color:"inherit",startIcon:Ne(_T,{sx:{fontSize:16}}),onClick:()=>d(!0),sx:{minWidth:0,px:1,fontSize:12.5,color:"#787774"},children:"\uC5F0\uACB0"}):null]}),children:[Uo(lo,{sx:{display:"flex",flexDirection:"column",mt:.5,pl:3.25},children:[k?Ne(lo,{sx:{mb:c.related.length||c.duplicates.length||c.duplicateOf?1:0},children:c.lineage.map((b,w)=>{let y=b.seq===e.seq,v=w===c.lineage.length-1;return Uo(lo,{sx:{display:"flex",gap:1},children:[Uo(lo,{sx:{display:"flex",flexDirection:"column",alignItems:"center",width:14,flexShrink:0,pt:1.1},children:[Ne(lo,{sx:{width:y?9:7,height:y?9:7,borderRadius:"50%",bgcolor:y?"#2f80ed":b.completed?"#9a9a97":"#c9c8c5",flexShrink:0}}),v?null:Ne(lo,{sx:{width:"2px",flex:1,bgcolor:"#e6e6e3"}})]}),Uo(lo,{sx:{flex:1,minWidth:0,pb:v?0:.5},children:[Uo(lo,{sx:{display:"flex",alignItems:"center",gap:.75},children:[Uo(lo,{component:"span",onClick:!y&&n?()=>n(b.seq):void 0,sx:{minWidth:0,fontSize:14,fontWeight:y?600:400,color:y?"#2f80ed":b.completed?"#9a9a97":"#37352f",textDecoration:b.completed?"line-through":"none",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",...!y&&n?{cursor:"pointer","&:hover":{color:"#2f80ed"}}:{}},children:[b.ticket_no?`${b.ticket_no} `:"",b.title]}),Ne(Ee,{option:go(b),small:!0})]}),Ne(lo,{sx:{fontSize:12,color:"#9a9a97"},children:b.completed&&b.completed_time?`${b.completed_time} \uC644\uB8CC`:b.created_time??""})]})]},b.seq)})}):null,c.duplicateOf?Ne(Va,{item:c.duplicateOf,caption:"\uC6D0\uBCF8",onOpen:n?()=>n(c.duplicateOf.seq):void 0,onUnlink:!t&&i?b=>h(b.currentTarget,c.duplicateOf.seq,"duplicate_of"):void 0}):null,c.duplicates.map(b=>Ne(Va,{item:b,caption:"\uC911\uBCF5",onOpen:n?()=>n(b.seq):void 0,onUnlink:!t&&i?w=>h(w.currentTarget,b.seq,"duplicate_of"):void 0},`dup-${b.seq}`)),c.related.map(b=>Ne(Va,{item:b,onOpen:n?()=>n(b.seq):void 0,onUnlink:!t&&i?w=>h(w.currentTarget,b.seq,"related"):void 0},`rel-${b.seq}`)),S===0?Ne(lo,{sx:{px:1.25,py:.75,fontSize:13.5,color:"#9a9a97"},children:"\uC5F0\uACB0\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):null]}),r?Ne(Xc,{open:s,task:e,tasks:o,excludeSeqs:g,onClose:()=>d(!1),onSubmit:(b,w)=>r(e.seq,b,w)}):null,Ne(Ye,{open:!!l,anchorEl:l,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:()=>u(null),onConfirm:()=>{a?.(e.seq),u(null)}}),Ne(Ye,{open:!!p,anchorEl:p?.anchorEl??null,title:"\uC774 \uC5C5\uBB34\uC640\uC758 \uC5F0\uACB0\uC744 \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",confirmText:"\uD574\uC81C",onCancel:()=>m(null),onConfirm:()=>{p&&i?.(e.seq,p.targetSeq,p.type),m(null)}})]})}import{Fragment as So,jsx as z,jsxs as $e}from"react/jsx-runtime";function qn({label:e="\uBE44\uC5B4 \uC788\uC74C"}){return z(to,{component:"span",sx:{color:"#9a9a97"},children:e})}function nm({task:e,customTabs:o,statusOptions:t,avatarSrcByName:n,onChangeStatus:r,onChangeLabels:i,onAddLabelOption:a,onChangeProject:s,onAddProject:d,onChangeDate:l,onChangeReminder:u,onMemberEdit:p,onChangePriority:m,onChangeEstimatedTime:c,onChangeEventTime:k,onChangeEventPlace:S,onChangeEventAddress:g,onChangeNote:h,onChangeContent:b,onAddChecklistItem:w,onToggleChecklistItem:y,onRemoveChecklistItem:v,onUpdateChecklistItem:f,onConvertChecklistToTask:x,onOpenChecklistTask:I,resolveChecklistTask:W,relatedTasksPool:_,onOpenRelatedTask:K,onLinkRelatedTask:B,onUnlinkRelatedTask:T,onCreateFollowUpTask:L,onAddAttachments:$,onRemoveAttachment:J,onPreview:R,onDownload:ie,onUpdateComment:re,onRemoveComment:Ce,onToggleCommentReaction:xe,currentUserName:Fe="",myAccountSeq:oe=0,noticeAdmin:le=!1,hideProject:ge=!1,hideLabel:q=!1,showTitle:U=!1,onChangeTitle:j,onToggleCompleted:E,onChangeIcon:H,onChangeIconColor:D,employees:N=[],onAckConfirm:ce,onChangeBugField:M,sprints:ae=[],sprintProject:me=!1,onChangeSprint:he,onChangeStoryPoints:Oe,onChangeResolution:A,onClaimTask:V,onVerifyBug:Ve}){let[no,Yo]=$t(null),[Dt,Ut]=$t(null),[at,Ao]=$t(null),[wt,Vt]=$t(!1),Lo={[Wo]:wt?{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"}},[Mt,Gt]=$t(null),[Co,Yt]=$t(null),[we,O]=$t(null),[F,X]=$t(null),Z=!!e.is_notice,be=!!e.is_event,_e=!!e.is_bug,eo=!!V&&wr(e,oe),ue=!!V&&Mr(e,oe),Ge=!!Ve&&_e&&!!e.completed&&oe>0&&(e.author_account_seq??0)===oe&&!(e.acks??[]).some(P=>P.account_seq===oe),Se=!ct(e,oe),Qe=!e.is_event&&(e.is_notice?oe>0&&(e.author_account_seq??0)===oe:(e.author_account_seq??0)===oe||(e.manager_account_seq??0)===oe),jo=Tn(e.icon||(e.is_notice?xo:e.is_event?"event":Me)),Do=Z?!Dr(e,oe):Se,oo=eo||ue?$e(Bn,{onClick:P=>X(P.currentTarget),children:[z(YT,{sx:{fontSize:16,mr:.5}}),"\uAC00\uC838\uAC00\uAE30"]}):null,Xo=Z?pi(e,N):"",vo=Z?Ic(e,N,oe):null;return $e(So,{children:[U?$e(to,{sx:{px:2,pt:2,pb:.5,display:"flex",alignItems:"flex-start",gap:1},children:[Qe?z(ET,{checked:e.completed,icon:z(WT,{sx:{fontSize:22,color:"#9a9a97",opacity:.45}}),checkedIcon:z(em,{sx:{fontSize:22,color:"#2f80ed"}}),onChange:(P,Fn)=>E(e.seq,Fn),sx:{p:0,mt:.25}}):null,z(PT,{size:"small","aria-label":"\uC544\uC774\uCF58 \uBCC0\uACBD",onClick:Se?void 0:P=>Ut(P.currentTarget),sx:{p:0,mt:.25,color:e.icon_color||(Z?"#e5484d":"#1e3a8a")},children:z(jo,{sx:{fontSize:20}})}),z(to,{sx:{flex:1,minWidth:0},children:no!==null?z(to,{component:"input",autoFocus:!0,spellCheck:!1,value:no,onChange:P=>Yo(P.target.value),onBlur:()=>{no.trim()&&no.trim()!==e.title&&j(e.seq,no.trim()),Yo(null)},onKeyDown:P=>{P.key==="Enter"&&P.target.blur(),P.key==="Escape"&&Yo(null)},sx:{width:"100%",border:"none",outline:"none",font:"inherit",fontSize:19,fontWeight:600,color:"#37352f",p:0,m:0}}):z(to,{onClick:()=>Yo(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})}),z(Pn,{anchorEl:Dt,value:e.icon||(Z?xo:""),color:e.icon_color||(Z?"#e5484d":"#1e3a8a"),onSelect:P=>H(e.seq,P),onSelectColor:P=>D?.(e.seq,P),onClose:()=>Ut(null)})]}):null,$e(to,{sx:{py:1.5,display:"flex",flexDirection:"column",gap:.25,[Wo]:{pb:0}},children:[z(ni,{hideProject:ge,values:{tabKey:e.tab_key??"",managerName:e.manager_name,receiverNames:e.receiver_names,startDate:e.start_date,dueDate:e.due_date,reminder:e.reminder,priority:e.priority,estimatedTime:e.estimated_time,eventTime:e.event_time??"",eventPlace:e.event_place??"",eventAddress:e.event_address??""},customTabs:o,avatarSrcByName:n,showEstimatedTime:!be,notice:Z,event:be,readOnly:Se,targetSummary:Xo,onChangeProject:P=>s(e.seq,P),onAddProject:d,onChangeStartDate:P=>l(e.seq,"start_date",P),onChangeDueDate:P=>l(e.seq,"due_date",P),onChangeReminder:P=>u(e.seq,P),onChangePriority:P=>m(e.seq,P),onChangeEstimatedTime:P=>c(e.seq,P),onChangeEventTime:P=>k?.(e.seq,P),onChangeEventPlace:P=>S?.(e.seq,P),onChangeEventAddress:P=>g?.(e.seq,P),onMemberEdit:P=>p(e,P),narrowCollapsedSx:Lo,reminderLocked:e.completed,managerAction:oo,leading:$e(So,{children:[Ge||oo&&(Z||be)?$e(to,{sx:{gridColumn:"1 / -1",display:"flex",justifyContent:"center",gap:1,px:2,py:.75},children:[Z||be?oo:null,Ge?$e(So,{children:[z(ki,{variant:"contained",size:"small",onClick:()=>Ve?.(e.seq,!0),sx:{bgcolor:"#2f80ed"},children:"\uC218\uC815 \uD655\uC778(\uAC80\uC99D \uC644\uB8CC)"}),z(ki,{variant:"outlined",size:"small",color:"error",onClick:()=>Ve?.(e.seq,!1),children:"\uC544\uC9C1 \uC7AC\uD604\uB428(\uC7AC\uC624\uD508)"})]}):null]}):null,_e&&e.ticket_no?z(de,{icon:z(LT,{sx:{fontSize:17}}),label:"\uD2F0\uCF13",children:z(to,{component:"span",sx:{fontVariantNumeric:"tabular-nums"},children:e.ticket_no})}):null,be?null:z(to,{sx:_e&&e.ticket_no?void 0:{gridColumn:"1 / -1"},children:z(de,{icon:z($T,{sx:{fontSize:17}}),label:"\uC0C1\uD0DC",onClick:Se||e.completed?void 0:P=>Gt(P),children:z(Ee,{option:go(e)})})}),me&&!be&&!Z?$e(So,{children:[z(de,{icon:z(FT,{sx:{fontSize:17}}),label:"\uBAA9\uD45C",onClick:Se?void 0:P=>Yt(P),children:(e.sprint_seq??0)>0?ae.find(P=>P.seq===e.sprint_seq)?.name??"\uC0AD\uC81C\uB41C \uC2A4\uD504\uB9B0\uD2B8":z(qn,{label:"\uBBF8\uBC30\uC815"})}),z(de,{icon:z(HT,{sx:{fontSize:17}}),label:"\uD3EC\uC778\uD2B8",children:z(vt,{value:(e.story_points??0)>0?String(e.story_points):"",placeholder:"\uBBF8\uCD94\uC815",readOnly:Se,onCommit:P=>Oe?.(e.seq,Number(P.replace(/[^0-9.]/g,""))||0)})})]}):null,be||q?null:z(to,{sx:[{gridColumn:"1 / -1"},Lo??null],children:z(de,{icon:z(KT,{sx:{fontSize:17}}),label:"\uB77C\uBCA8",onClick:Se?void 0:P=>O(P),children:(e.label_keys??[]).length>0?z(Ot,{labelKeys:e.label_keys??[],labelOptions:t}):z(qn,{})})}),Z&&vo?z(to,{sx:{gridColumn:"1 / -1"},children:z(de,{icon:z(om,{sx:{fontSize:17}}),label:"\uD655\uC778",children:z(to,{sx:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:1,minWidth:0},children:vo.canAck?z(ki,{size:"small",variant:"contained",onClick:()=>ce?.(e.seq),sx:{py:.1,px:1.25,minWidth:0,color:"#fff",bgcolor:"#2f80ed",boxShadow:"none","&:hover":{bgcolor:"#1e6fd9",boxShadow:"none"}},children:"\uD655\uC778"}):z(ki,{size:"small",variant:"outlined",color:"inherit",startIcon:vo.acked?z(em,{sx:{fontSize:"16px !important",color:"#2f80ed"}}):null,onClick:P=>Ao({anchorEl:P.currentTarget,open:!0}),sx:{py:.1,px:1.25,minWidth:0,fontSize:13,color:"text.primary",borderColor:"#d5d8dc",bgcolor:"#fff",whiteSpace:"nowrap"},children:vo.total>0&&vo.count>=vo.total?"\uC644\uB8CC":$e(So,{children:[vo.count,z(to,{component:"span",sx:{mx:.4},children:"/"}),vo.total]})})})})}):null]}),trailing:$e(So,{children:[_e?z(ri,{values:{repro:e.bug_repro??"",device:e.bug_device??"",where:e.bug_where??"",version:e.bug_version??"",resolution:e.resolution??""},readOnly:Se,showResolution:!!e.completed,onChangeRepro:P=>M?.(e.seq,"bug_repro",P),onChangeDevice:P=>M?.(e.seq,"bug_device",P),onChangeWhere:P=>M?.(e.seq,"bug_where",P),onChangeVersion:P=>M?.(e.seq,"bug_version",P),onChangeResolution:P=>A?.(e.seq,P)}):null,z(de,{icon:z(UT,{sx:{fontSize:17}}),label:"\uC791\uC131\uC790",sx:[uo(9),Lo??null],children:e.created_by?$e(So,{children:[z(ho,{names:[e.created_by],size:20,avatarSrcByName:n}),e.created_by]}):z(qn,{})}),z(de,{icon:z(tm,{sx:{fontSize:17}}),label:"\uC791\uC131\uC2DC\uAC04",sx:[uo(11),Lo??null],children:e.created_time?mt(e.created_time):z(qn,{})}),e.completed?$e(So,{children:[z(de,{icon:z(om,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC790",sx:[uo(10),Lo??null],children:e.completed_by?$e(So,{children:[z(ho,{names:[e.completed_by],size:20,avatarSrcByName:n}),e.completed_by]}):z(qn,{})}),z(de,{icon:z(tm,{sx:{fontSize:17}}),label:"\uC644\uB8CC\uC2DC\uAC04",sx:[uo(12),Lo??null],children:e.completed_time?mt(e.completed_time):z(qn,{})})]}):null]})}),$e(to,{sx:{display:"none",[Wo]:{display:"block",mt:1.5}},children:[z(pn,{sx:{borderColor:"#e6e6e3"}}),z(OT,{onClick:()=>Vt(P=>!P),sx:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:.5,pt:1.5,pb:1.25,fontSize:13.5,bgcolor:"#f4f4f2",color:"#37352f","&:active":{opacity:.6}},children:wt?$e(So,{children:["\uC811\uAE30 ",z(qT,{sx:{fontSize:18}})]}):$e(So,{children:["\uC815\uBCF4 \uB354\uBCF4\uAE30 ",z(AT,{sx:{fontSize:18}})]})})]}),$e(to,{children:[z(pn,{sx:{my:1.5,borderColor:"#e6e6e3",[Wo]:{mt:0}}}),z(Po,{icon:z(VT,{sx:{fontSize:18,display:"block"}}),title:"\uB0B4\uC6A9",children:z(to,{sx:{userSelect:"text"},children:z(ii,{syncKey:e.seq,value:e.content??"",readOnly:Se,onChange:P=>b(e.seq,P)})})}),e.is_bug?null:$e(So,{children:[z(pn,{sx:{my:1.5,borderColor:"#e6e6e3"}}),z(Po,{icon:z(GT,{sx:{fontSize:18,display:"block"}}),title:"\uBE44\uACE0",children:z(to,{sx:{userSelect:"text"},children:z(Vc,{value:e.note,readOnly:Do,onCommit:P=>h(e.seq,P)})})})]}),be?null:$e(So,{children:[z(pn,{sx:{my:1.5,borderColor:"#e6e6e3"}}),z(li,{taskSeq:e.seq,checklist:e.checklist??[],removeLocked:Do,onAdd:w,onToggle:y,onRemove:v,onUpdate:f,onConvertToTask:x,onOpenLinkedTask:I,resolveLinkedTask:W})]}),_&&!be&&!Z?$e(So,{children:[z(pn,{sx:{my:1.5,borderColor:"#e6e6e3"}}),z(Zc,{task:e,tasks:_,readOnly:Se,onOpenTask:K,onLink:B,onUnlink:T,onCreateFollowUp:L})]}):null,z(pn,{sx:{my:1.5,borderColor:"#e6e6e3"}}),z(mi,{taskSeq:e.seq,attachments:e.attachments??[],removeLocked:Do,onAdd:$,onRemove:J,onPreview:R?P=>R({...P,taskSeq:e.seq}):void 0,onDownload:ie?P=>ie({...P,taskSeq:e.seq}):void 0})]}),z(pn,{sx:{my:1.5,borderColor:"#e6e6e3"}}),z(Nc,{taskSeq:e.seq,comments:e.comments??[],currentUserName:Fe,myAccountSeq:oe,avatarSrcByName:n,onUpdate:re,onRemove:Ce,onToggleReaction:xe})]}),z(_r,{anchorEl:Mt,value:e.status,options:Z?Gn:_e?Qt:Yn,onSelect:P=>r(e.seq,P),onClose:()=>Gt(null)}),z(RT,{transitionDuration:0,anchorEl:Co,open:!!Co,onClose:()=>Yt(null),children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...ae.filter(P=>`custom-${P.group_seq}`===String(e.tab_key??"")).map(P=>({seq:P.seq,label:Oo(P)}))].map(P=>$e(zT,{onClick:()=>{he?.(e.seq,P.seq),Yt(null)},sx:{fontSize:14,minWidth:170,gap:1},children:[P.label,(e.sprint_seq??0)===P.seq?z(NT,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},P.seq))}),z(Fr,{anchorEl:at?.anchorEl??null,open:!!at?.open,acks:e.acks??[],total:vo?.total??0,avatarSrcByName:n,onClose:()=>Ao(P=>P?{...P,open:!1}:null)}),z(di,{anchorEl:we,selectedKeys:e.label_keys??[],labelOptions:t,onToggle:P=>i(e.seq,vr(e.label_keys??[],P)),onAddLabel:a,onClose:()=>O(null)}),z(Ye,{open:!!F,anchorEl:F,title:eo?"\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:()=>X(null),onConfirm:()=>{V?.(e.seq),X(null)}})]})}import{jsx as zo,jsxs as ny}from"react/jsx-runtime";function o2(){let e=new Date,o=t=>String(t).padStart(2,"0");return`${e.getFullYear()}-${o(e.getMonth()+1)}-${o(e.getDate())} ${o(e.getHours())}:${o(e.getMinutes())}`}function t2({open:e,task:o,onClose:t,onAddComment:n,myAccountSeq:r=0,onToggleCompleted:i,onChangeTitle:a,onChangeIcon:s,onChangeIconColor:d,...l}){let u=Re(),p=XT(null);o&&(p.current=o);let m=o??p.current,[c,k]=QT({}),S=Object.keys(c).length>0;if(jT(()=>{k({})},[o?.seq,e]),!m)return null;let g=u&&S?{...m,...c}:m,h=(f,x)=>{u?k(I=>({...I,...f})):x()},b=()=>{let f=c;k({});let x=m.seq;f.title!==void 0&&String(f.title).trim()&&a(x,String(f.title).trim()),f.icon!==void 0&&s(x,String(f.icon)),f.icon_color!==void 0&&d?.(x,String(f.icon_color)),f.status!==void 0&&l.onChangeStatus(x,f.status),f.label_keys!==void 0&&l.onChangeLabels(x,f.label_keys??[]),f.tab_key!==void 0&&l.onChangeProject(x,String(f.tab_key??"")),f.start_date!==void 0&&l.onChangeDate(x,"start_date",String(f.start_date??"")),f.due_date!==void 0&&l.onChangeDate(x,"due_date",String(f.due_date??"")),f.reminder!==void 0&&l.onChangeReminder(x,f.reminder),f.priority!==void 0&&l.onChangePriority(x,f.priority),f.estimated_time!==void 0&&l.onChangeEstimatedTime(x,String(f.estimated_time??"")),f.event_time!==void 0&&l.onChangeEventTime?.(x,String(f.event_time??"")),f.event_place!==void 0&&l.onChangeEventPlace?.(x,String(f.event_place??"")),f.event_address!==void 0&&l.onChangeEventAddress?.(x,String(f.event_address??"")),f.content!==void 0&&l.onChangeContent(x,String(f.content??"")),f.note!==void 0&&l.onChangeNote(x,String(f.note??"")),ty({message:"\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.",position:"center"})},w={...l,onChangeStatus:(f,x)=>h({status:x},()=>l.onChangeStatus(f,x)),onChangeLabels:(f,x)=>h({label_keys:x},()=>l.onChangeLabels(f,x)),onChangeProject:(f,x)=>h({tab_key:x},()=>l.onChangeProject(f,x)),onChangeDate:(f,x,I)=>h({[x]:I},()=>l.onChangeDate(f,x,I)),onChangeReminder:(f,x)=>h({reminder:x},()=>l.onChangeReminder(f,x)),onChangePriority:(f,x)=>h({priority:x},()=>l.onChangePriority(f,x)),onChangeEstimatedTime:(f,x)=>h({estimated_time:x},()=>l.onChangeEstimatedTime(f,x)),onChangeEventTime:(f,x)=>h({event_time:x},()=>l.onChangeEventTime?.(f,x)),onChangeEventPlace:(f,x)=>h({event_place:x},()=>l.onChangeEventPlace?.(f,x)),onChangeEventAddress:(f,x)=>h({event_address:x},()=>l.onChangeEventAddress?.(f,x)),onChangeContent:(f,x)=>h({content:x},()=>l.onChangeContent(f,x)),onChangeNote:(f,x)=>h({note:x},()=>l.onChangeNote(f,x))},y=zo(nm,{...w,task:g,myAccountSeq:r,onChangeTitle:(f,x)=>h({title:x},()=>a(f,x)),onToggleCompleted:i,onChangeIcon:(f,x)=>h({icon:x},()=>s(f,x)),onChangeIconColor:(f,x)=>h({icon_color:x},()=>d?.(f,x)),showTitle:u}),v=zo(Fc,{onSubmit:(f,x)=>n(g.seq,f,x)},g.seq);return u?zo(oy,{open:e,onClose:t,locale:"ko",fontScale:{default:1.1,min:.6},title:g.is_notice?"\uACF5\uC9C0\uC0AC\uD56D":g.is_event?"\uC77C\uC815":g.is_bug?"\uC624\uB958":"\uC5C5\uBB34",titleIcons:{delete:{visible:!1},print:{visible:!1},share:{visible:!1},custom:[{icon:zo(ZT,{sx:{ml:2,color:S?"#2f9e5b":"#c9c8c5"}}),tooltip:S?"\uC800\uC7A5":"",onClick:S?b:void 0}]},fullScreen:!0,mobilePresentation:"slide",tabs:{visible:!1},contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,sectionContentPaddingTop:0,contentBottomPadding:0,scrollPastLastSection:!1,overlayScrollbar:{enabled:!0,contentStyle:{minWidth:0}},actions:{visible:!0,showCancelButton:!1,left:v},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:zo(Ti,{sx:{userSelect:"none",width:"100%",minWidth:0},children:y})}]}):zo(JT,{anchor:"right",open:e,onClose:t,sx:{zIndex:f=>f.zIndex.modal},slotProps:{paper:{sx:{width:720,maxWidth:"100vw"}}},children:ny(Ti,{sx:{display:"flex",flexDirection:"column",height:"100%",userSelect:"none"},children:[zo(Uc,{task:g,myAccountSeq:r,onToggleCompleted:i,onChangeTitle:a,onChangeIcon:s,onChangeIconColor:d,onClose:t}),zo(rm,{sx:{borderColor:"#e6e6e3"}}),zo(Ti,{sx:{flex:1,minHeight:0},children:zo(ey,{style:{height:"100%"},contentStyle:{minWidth:0},thumb:{width:6},children:y})}),zo(rm,{sx:{borderColor:"#37352f"}}),zo(Ti,{sx:{flexShrink:0},children:v})]})})}import{useEffect as iy,useState as fn}from"react";import{Box as Bo,Button as ja,IconButton as im}from"@mui/material";import{FormDialog as ay}from"@ehfuse/mui-form-dialog";import ly from"@mui/icons-material/EditOutlined";import{ErrorAlert as am}from"@ehfuse/alerts";import{ClearTextField as lm,DateTextField as sm,LabelSelect as cm}from"@ehfuse/mui-form-controls";var Ga="custom-";function ry(e){return e.startsWith(Ga)}function i2(e){return e>0?`${Ga}${e}`:""}function Ya(e){if(!ry(e))return 0;let o=Number(e.slice(Ga.length));return Number.isInteger(o)&&o>0?o:0}import{Fragment as cy,jsx as Ke,jsxs as Kt}from"react/jsx-runtime";var sy=[{value:"planning",label:"\uACC4\uD68D\uC911"},{value:"active",label:"\uC9C4\uD589\uC911"},{value:"closed",label:"\uC885\uB8CC"}];function mm(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?e.slice(5).replace("-","."):"-"}function x2({open:e,customTabs:o,sprints:t,onClose:n,onCreate:r,onUpdate:i,onChangeStatus:a,onRemove:s}){let d=o.filter(B=>B.useSprints&&!B.archived),[l,u]=fn(""),[p,m]=fn(""),[c,k]=fn(""),[S,g]=fn(""),[h,b]=fn(""),[w,y]=fn(!1),[v,f]=fn(0);iy(()=>{e&&(u(d.length===1?d[0].key:""),m(""),k(""),g(""),b(""),f(0))},[e]);let x=()=>{m(""),k(""),g(""),b(""),f(0)},I=B=>{f(B.seq),u(`custom-${B.group_seq}`),m(B.name),k(B.goal),g(B.start_date),b(B.end_date)},W=async()=>{let B=Ya(l);if(!B){am("\uBAA9\uD45C\uB97C \uB9CC\uB4E4 \uD504\uB85C\uC81D\uD2B8\uB97C \uC120\uD0DD\uD558\uC138\uC694.");return}if(!p.trim()){am("\uBAA9\uD45C \uC774\uB984\uC744 \uC785\uB825\uD558\uC138\uC694.");return}y(!0);try{if(v>0){i(v,{name:p.trim(),goal:c.trim(),start_date:S,end_date:h}),x();return}await r({group_seq:B,name:p.trim(),goal:c.trim(),start_date:S,end_date:h})&&x()}finally{y(!1)}},_=new Map(o.map(B=>[Ya(B.key),B.label])),K=Ke(Bo,{children:d.length===0?Ke(Bo,{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.'}):Kt(cy,{children:[Kt(Bo,{sx:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:2.5,mt:1},children:[Ke(cm,{label:"\uD504\uB85C\uC81D\uD2B8",size:"medium",value:l,options:d.map(B=>({value:B.key,label:B.label})),onChange:B=>u(String(B.target.value)),disabled:v>0}),Ke(lm,{label:"\uBAA9\uD45C \uC774\uB984",size:"medium",placeholder:"\uC608: 8\uC6D4 2\uC8FC\uCC28",value:p,onChange:B=>m(B.target.value)}),Ke(sm,{size:"medium",label:"\uC2DC\uC791\uC77C",value:S,onChange:B=>g(B.target.value)}),Ke(sm,{size:"medium",label:"\uC885\uB8CC\uC77C",value:h,onChange:B=>b(B.target.value)}),Ke(lm,{label:"\uC124\uBA85",size:"medium",placeholder:"\uC120\uD0DD \uC785\uB825",value:c,onChange:B=>k(B.target.value),sx:{gridColumn:"1 / -1"}})]}),Kt(Bo,{sx:{mt:1.5,display:"flex",justifyContent:"flex-end",gap:1},children:[v>0?Ke(ja,{color:"inherit",onClick:x,disabled:w,children:"\uCDE8\uC18C"}):null,Ke(ja,{variant:"contained",onClick:()=>{W()},disabled:w,children:v>0?"\uBAA9\uD45C \uC800\uC7A5":"\uBAA9\uD45C \uB9CC\uB4E4\uAE30"})]}),Ke(Bo,{sx:{mt:2,borderTop:"1px solid #e6e6e3"},children:t.length===0?Ke(Bo,{sx:{py:3,textAlign:"center",fontSize:14,color:"#9a9a97"},children:"\uB4F1\uB85D\uB41C \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):t.map(B=>Kt(Bo,{sx:{display:"flex",flexDirection:"column",gap:1,py:1.75,borderBottom:"1px solid #f0efed"},children:[Kt(Bo,{sx:{minWidth:0},children:[Kt(Bo,{sx:{display:"flex",alignItems:"center",gap:1,minWidth:0},children:[Ke(Bo,{component:"span",sx:{fontSize:16,fontWeight:600,color:"#37352f",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},children:B.name}),Ke(Bo,{component:"span",sx:{flexShrink:0,px:1,py:.25,borderRadius:.75,bgcolor:"#f1f5f9",color:"#64748b",fontSize:13,fontWeight:500},children:_.get(B.group_seq)??"\uC0AD\uC81C\uB41C \uD504\uB85C\uC81D\uD2B8"}),Kt(Bo,{component:"span",sx:{flexShrink:0,fontSize:14,color:"#57564f"},children:[mm(B.start_date)," ~ ",mm(B.end_date)]})]}),B.goal?Ke(Bo,{sx:{mt:.5,fontSize:14,color:"#787774",lineHeight:1.5},children:B.goal}):null]}),Kt(Bo,{sx:{display:"flex",alignItems:"center",gap:.5},children:[Ke(cm,{label:"\uC0C1\uD0DC",showLabel:!1,size:"small",value:B.status,options:sy.map(T=>({value:T.value,label:T.label})),onChange:T=>a(B.seq,String(T.target.value)),sx:{width:104,flexShrink:0}}),Ke(im,{"aria-label":"\uBAA9\uD45C \uC218\uC815",onClick:()=>I(B),sx:{color:"#9a9a97","&:hover":{color:"#2563eb"}},children:Ke(ly,{sx:{fontSize:18}})}),Ke(im,{"aria-label":"\uBAA9\uD45C \uC0AD\uC81C",onClick:()=>s(B.seq),sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:Ke(ft,{style:{width:16,height:16}})})]})]},B.seq))})]})});return Ke(ay,{open:e,onClose:n,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:K}],actions:{showCancelButton:!1,right:Ke(ja,{variant:"contained",onClick:n,children:"\uB2EB\uAE30"})}})}import{useState as um}from"react";import{Box as Ze,Button as Xa,Divider as my,IconButton as uy,TextField as dy}from"@mui/material";import{FormDialog as py}from"@ehfuse/mui-form-dialog";import fy from"@mui/icons-material/OpenInNewOutlined";import xy from"@mui/icons-material/EventOutlined";import{ConfirmDialog as gy}from"@ehfuse/alerts";import{jsx as De,jsxs as xn}from"react/jsx-runtime";function v2({open:e,imports:o,onRegister:t,onRemove:n,onClose:r}){let[i,a]=um(""),[s,d]=um(!1),l=async()=>{let m=i.trim();if(m){d(!0);try{await t(m)&&a("")}finally{d(!1)}}},u=async m=>{await gy({title:"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",message:`"${m.name||"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}" \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30\uB97C \uD574\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&n(m.seq)},p=xn(Ze,{sx:{display:"flex",flexDirection:"column",gap:1.5},children:[xn(Ze,{sx:{color:"#37352f",lineHeight:1.7},children:["\uAD6C\uAE00 \uCE98\uB9B0\uB354\uC758 \uC77C\uC815\uC744 ",De("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uC5C5\uBB34\uD568 \uCE98\uB9B0\uB354\uC5D0 \uD568\uAED8 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4.",De("br",{}),"\uD45C\uC2DC/\uC228\uAE40\uC740 \uC5C5\uBB34\uD568 \uC6B0\uC0C1\uB2E8\uC758 ",De("b",{children:"\uAD6C\uAE00 \uC77C\uC815"})," \uC2A4\uC704\uCE58\uB85C \uCF1C\uACE0 \uB055\uB2C8\uB2E4."]}),De(Ze,{sx:{fontWeight:700,color:"#37352f",mt:.5},children:"\uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354"}),o.length>0?De(Ze,{sx:{display:"flex",flexDirection:"column",border:"1px solid #e6e6e3",borderRadius:1},children:o.map((m,c)=>xn(Ze,{sx:{display:"flex",alignItems:"center",gap:1,px:1.5,py:.75,borderTop:c>0?"1px solid #efefed":"none"},children:[De(xy,{sx:{fontSize:18,color:"#0f9d58",flexShrink:0}}),De(Ze,{component:"span",sx:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:m.name||"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),De(uy,{"aria-label":"\uAC00\uC838\uC624\uAE30 \uD574\uC81C",size:"small",onClick:()=>{u(m)},sx:{color:"#9a9a97","&:hover":{color:"#e5484d"}},children:De(ft,{sx:{fontSize:18}})})]},m.seq))}):De(Ze,{sx:{color:"#9a9a97",px:.5},children:"\uC544\uC9C1 \uB4F1\uB85D\uB41C \uCE98\uB9B0\uB354\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}),De(my,{sx:{my:1,borderColor:"#e6e6e3"}}),De(Ze,{sx:{fontWeight:700,color:"#37352f"},children:"\uC0C8 \uCE98\uB9B0\uB354 \uAC00\uC838\uC624\uAE30"}),xn(Ze,{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:[De(Ze,{children:xn(Ze,{component:"span",children:["\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 > ",De("b",{children:"\uC124\uC815 \uBC0F \uACF5\uC720"}),"\uB97C \uC5FD\uB2C8\uB2E4."]})}),De(Ze,{children:xn(Ze,{component:"span",children:[De("b",{children:"\uCE98\uB9B0\uB354 \uD1B5\uD569"})," \uC139\uC158\uC758 ",De("b",{children:'"iCal \uD615\uC2DD\uC758 \uBE44\uBC00 \uC8FC\uC18C"'})," \uB97C \uBCF5\uC0AC\uD574 \uC544\uB798\uC5D0 \uBD99\uC5EC\uB123\uC73C\uC138\uC694."]})}),De(Ze,{children:De(Ze,{component:"span",children:"\uBE44\uBC00 \uC8FC\uC18C\uB294 \uBCF8\uC778 \uC804\uC6A9\uC785\uB2C8\uB2E4. \uC11C\uBC84\uC5D0 \uC800\uC7A5\uB418\uBA70 \uB2E4\uB978 \uC9C1\uC6D0\uC5D0\uAC8C \uBCF4\uC774\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})}),De(Ze,{children:De(Ze,{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."})})]}),xn(Ze,{sx:{display:"flex",gap:2,alignItems:"center"},children:[De(dy,{value:i,onChange:m=>a(m.target.value),fullWidth:!0,label:"\uBE44\uBC00 iCal \uC8FC\uC18C",placeholder:"https://calendar.google.com/calendar/ical/\u2026/basic.ics",slotProps:{input:{spellCheck:!1}}}),De(Xa,{variant:"contained",disabled:!i.trim()||s,onClick:()=>{l()},sx:{flexShrink:0},children:s?"\uD655\uC778 \uC911\u2026":"\uB4F1\uB85D"})]})]});return De(py,{open:e,onClose:r,width:680,title:"\uAD6C\uAE00 \uCE98\uB9B0\uB354 \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:p}],actions:{showCancelButton:!1,left:De(Xa,{variant:"outlined",startIcon:De(fy,{sx:{fontSize:16}}),onClick:()=>window.open("https://calendar.google.com/calendar","_blank"),children:"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),right:De(Xa,{variant:"contained",onClick:r,children:"\uB2EB\uAE30"})}})}import{Box as It,Button as dr,TextField as hy}from"@mui/material";import{FormDialog as by}from"@ehfuse/mui-form-dialog";import ky from"@mui/icons-material/ContentCopyOutlined";import dm from"@mui/icons-material/OpenInNewOutlined";import{InfoAlert as pm}from"@ehfuse/alerts";import{Fragment as yy,jsx as Ue,jsxs as gn}from"react/jsx-runtime";function Ty(e){return`${window.location.origin}/api/v1/taskbox/calendar/${e}.ics`}function P2({open:e,feed:o,feedTaskCount:t,buildFeedUrl:n,onSubscribe:r,onClose:i}){let a=n??Ty,s=o.subscribed?a(o.token):"",d=()=>{navigator.clipboard.writeText(s).then(()=>pm("\uD53C\uB4DC \uC8FC\uC18C\uB97C \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")).catch(()=>pm("\uBCF5\uC0AC\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uC8FC\uC18C\uB97C \uC9C1\uC811 \uC120\uD0DD\uD574 \uBCF5\uC0AC\uD558\uC138\uC694."))},l=()=>{let p=s.replace(/^https?:\/\//,"webcal://");window.open(`https://calendar.google.com/calendar/r?cid=${encodeURIComponent(p)}`,"_blank")},u=gn(It,{sx:{display:"flex",flexDirection:"column",gap:2.5},children:[gn(It,{sx:{color:"#37352f",lineHeight:1.7},children:["\uB0B4\uAC00 \uAD00\uC5EC\uD55C \uC5C5\uBB34\uB97C ",Ue("b",{children:"\uC77D\uAE30\uC804\uC6A9"}),"\uC73C\uB85C \uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0\uC11C \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4."]}),t===0?gn(It,{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.",Ue("br",{}),Ue("b",{children:"\uB9C8\uAC10\uAE30\uD55C\uC774 \uC788\uB294 \uB0B4 \uC5C5\uBB34 \uB610\uB294 \uBCF4\uB0B8\uC5C5\uBB34"}),"\uAC00 \uC0DD\uAE30\uBA74"," ",o.subscribed?"\uAD6C\uAE00 \uCE98\uB9B0\uB354\uC5D0 \uC790\uB3D9\uC73C\uB85C \uD45C\uC2DC\uB429\uB2C8\uB2E4.":"\uC5EC\uAE30\uC11C \uAD6C\uB3C5\uC744 \uC2DC\uC791\uD558\uC138\uC694."]}):o.subscribed&&o.enabled?gn(yy,{children:[Ue(hy,{value:s,fullWidth:!0,label:"\uB0B4 \uD53C\uB4DC \uC8FC\uC18C",slotProps:{input:{readOnly:!0}}}),gn(It,{sx:{display:"flex",gap:2},children:[Ue(dr,{variant:"outlined",startIcon:Ue(ky,{}),onClick:d,children:"\uC8FC\uC18C \uBCF5\uC0AC"}),Ue(dr,{variant:"contained",startIcon:Ue(dm,{}),onClick:l,children:"Google \uCE98\uB9B0\uB354\uC5D0 \uCD94\uAC00"})]}),gn(It,{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:[Ue(It,{children:gn("span",{children:["\uBC84\uD2BC\uC774 \uB3D9\uC791\uD558\uC9C0 \uC54A\uC73C\uBA74 \uAD6C\uAE00 \uCE98\uB9B0\uB354 > \uB2E4\uB978 \uCE98\uB9B0\uB354 + > ",Ue("b",{children:"URL\uB85C \uCD94\uAC00"}),"\uC5D0 \uC704 \uC8FC\uC18C\uB97C \uBD99\uC5EC\uB123\uC73C\uC138\uC694."]})}),Ue(It,{children:Ue("span",{children:"\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."})}),Ue(It,{children:Ue("span",{children:"\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."})}),Ue(It,{children:Ue("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."})})]})]}):Ue(dr,{variant:"contained",onClick:r,sx:{alignSelf:"flex-start"},children:"\uAD6C\uB3C5 \uC2DC\uC791 (\uD53C\uB4DC \uBC1C\uAE09)"})]});return Ue(by,{open:e,onClose:i,width:680,title:"\uAD6C\uAE00 \uCE98\uB9B0\uB354\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:u}],actions:{showCancelButton:!1,left:Ue(dr,{variant:"outlined",startIcon:Ue(dm,{sx:{fontSize:16}}),onClick:()=>window.open("https://calendar.google.com/calendar","_blank"),children:"\uAD6C\uAE00 \uCE98\uB9B0\uB354"}),right:Ue(dr,{variant:"contained",onClick:i,children:"\uB2EB\uAE30"})}})}import{useEffect as Sy,useMemo as Qa,useState as Ja}from"react";import{Box as pr,Button as By,Typography as Cy}from"@mui/material";import{FormDialog as vy}from"@ehfuse/mui-form-dialog";import{SearchTextField as Iy}from"@ehfuse/mui-form-controls";import{TreeView as _y}from"@ehfuse/tree-view";import{Fragment as Py,jsx as Vo,jsxs as Ry}from"react/jsx-runtime";function fm(e){return`${e.name}#${e.seq}`}function Dy(e){return Number(e.slice(e.lastIndexOf("#")+1))||0}function wy(e){let o=[],t=n=>{for(let r of n.employees??[])o.push(r);for(let r of n.groups??[])t(r)};for(let n of e)t(n);return o}function My(e,o){return o?[e.name,e.department,e.role_name,e.work_position].filter(Boolean).some(t=>String(t).toLowerCase().includes(o)):!0}function Oy(e){let o=[[e.name,e.role_name].filter(Boolean).join(" "),e.department].filter(Boolean).join(" / ");return{id:`emp:${e.seq}`,label:fm(e),renderLabel:Vo(pr,{component:"span",sx:{display:"inline-flex",alignItems:"baseline",gap:.75},children:Vo(pr,{component:"span",sx:{fontWeight:400,color:"text.primary"},children:o})})}}function xm(e,o){let t=(e.groups??[]).map(r=>xm(r,o)).filter(r=>r!==null),n=(e.employees??[]).filter(r=>My(r,o)).map(Oy);return t.length===0&&n.length===0?null:{id:`group:${e.key}`,label:e.name,children:[...t,...n]}}function Ey({groups:e,allEmployees:o,initialSelectedSeqs:t,multiple:n,isMobile:r,onSelectionChange:i}){let[a,s]=Ja(""),d=Qa(()=>e.map(u=>xm(u,a.trim().toLowerCase())).filter(u=>u!==null),[e,a]),l=Qa(()=>o.filter(u=>t.includes(u.seq)).map(fm),[]);return Ry(Py,{children:[Vo(pr,{sx:{px:1.5,py:1,borderBottom:"1px solid #cccccc",flexShrink:0},children:Vo(Iy,{size:"small",fullWidth:!0,placeholder:"\uC774\uB984, \uBD80\uC11C \uAC80\uC0C9",onSearch:s,onClear:()=>s(""),sx:{"& .MuiOutlinedInput-notchedOutline":{border:"none"},"& .MuiInputBase-root":{px:0}}})}),Vo(pr,{sx:r?{display:"flex",flexDirection:"column"}:{flex:1,minHeight:0,overflow:"hidden",display:"flex",flexDirection:"column"},children:Vo(_y,{items:d,checkbox:!0,multiSelect:n,selectionMode:"child",showSearch:!1,defaultExpanded:!0,initialSelections:l,onChange:u=>i(u.map(Dy).filter(p=>p>0)),styles:{border:"none",borderRadius:"0"}})})]})}function W2({open:e,title:o="\uC9C1\uC6D0 \uC120\uD0DD",hint:t="",groups:n,multiple:r=!1,selectedSeqs:i,confirmText:a="\uD655\uC778",onConfirm:s,onClose:d}){let l=Re(),[u,p]=Ja([]),[m,c]=Ja(0),k=Qa(()=>wy(n),[n]),S=i??[];Sy(()=>{e&&(p(S),c(h=>h+1))},[e]);let g=()=>{let h=k.filter(b=>u.includes(b.seq));s(r?h:h.slice(0,1)),d()};return Vo(vy,{open:e,onClose:d,title:`${o}${r&&u.length>0?` (${u.length}\uBA85)`:""}`,locale:"ko",fullScreen:l,mobilePresentation:l?"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:Vo(pr,{sx:{...l?{}:{height:560},display:"flex",flexDirection:"column",border:"1px solid #cccccc",borderRadius:1,...l?{}:{overflow:"hidden"},userSelect:"none"},children:Vo(Ey,{groups:n,allEmployees:k,initialSelectedSeqs:S,multiple:r,isMobile:l,onSelectionChange:p},m)})}],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:t?Vo(Cy,{variant:"body2",color:"text.secondary",sx:{whiteSpace:"pre-line",lineHeight:1.35},children:t}):void 0,right:Vo(By,{variant:"contained",onClick:g,children:a})}})}import{useEffect as Ly,useMemo as Ny,useState as Fy}from"react";import{Box as Nn,Button as Hy,Divider as Wy}from"@mui/material";import{FormDialog as $y}from"@ehfuse/mui-form-dialog";import{LabelSelect as Ky}from"@ehfuse/mui-form-controls";import{Box as rt}from"@mui/material";import{jsx as An,jsxs as Ln}from"react/jsx-runtime";function zy(e,o){let t=o.filter(n=>n.sprint_seq===e.seq&&!n.archived&&n.completed);return{points:t.reduce((n,r)=>n+(r.story_points??0),0),count:t.length}}function gm({sprints:e,tasks:o,height:t=160}){let r=[...e].sort((u,p)=>`${u.start_date}|${u.seq}`.localeCompare(`${p.start_date}|${p.seq}`)).map(u=>({sprint:u,...zy(u,o)})),i=r.some(u=>u.points>0),a=r.map(u=>i?u.points:u.count),s=Math.max(1,...a),d=r.filter(u=>u.sprint.status==="closed").map(u=>i?u.points:u.count),l=d.length>0?Math.round(d.reduce((u,p)=>u+p,0)/d.length*10)/10:null;return r.length===0?An(rt,{sx:{py:4,textAlign:"center",fontSize:14.5,color:"#9a9a97"},children:"\uD45C\uC2DC\uD560 \uBAA9\uD45C\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."}):Ln(rt,{children:[Ln(rt,{sx:{mb:1,display:"flex",justifyContent:"space-between",fontSize:14,color:"#000"},children:[Ln("span",{children:["\uC644\uB8CC ",i?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uBAA9\uD45C\uBCC4"]}),l!==null?Ln("span",{children:["\uD3C9\uADE0(\uC885\uB8CC \uBAA9\uD45C)"," ",An(rt,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:l}),i?"SP":"\uAC74"]}):null]}),An(rt,{sx:{display:"flex",alignItems:"flex-end",gap:2,height:t,px:.5},children:r.map(u=>{let p=i?u.points:u.count,m=Math.round((t-24)*p/s),c=u.sprint.status==="closed";return Ln(rt,{sx:{flex:1,minWidth:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-end",height:"100%"},children:[An(rt,{sx:{fontSize:14,fontWeight:700,color:"#37352f",lineHeight:1.5},children:p}),An(rt,{sx:{width:"60%",maxWidth:56,height:Math.max(2,m),borderRadius:"4px 4px 0 0",bgcolor:c?"#2f80ed":"#a9c9f5"}})]},u.sprint.seq)})}),An(rt,{sx:{display:"flex",gap:2,px:.5,mt:.5},children:r.map(u=>Ln(rt,{sx:{flex:1,minWidth:0,textAlign:"center",fontSize:13.5,color:"#000",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[u.sprint.name,u.sprint.status!=="closed"?" (\uC9C4\uD589\uC911)":""]},u.sprint.seq))})]})}import{useMemo as qy}from"react";import{Box as hn}from"@mui/material";import{jsx as it,jsxs as bn}from"react/jsx-runtime";function hm(e){return/^\d{4}-\d{2}-\d{2}$/.test(e)?new Date(`${e}T00:00:00`):null}function Ay(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function Za(e){return e.slice(5).replace("-",".")}function bm({sprint:e,tasks:o,todayStr:t,height:n=200}){let r=qy(()=>{let h=hm(e.start_date),b=hm(e.end_date);if(!h||!b||b<h||Math.round((b.getTime()-h.getTime())/864e5)+1>366)return null;let y=o.filter(B=>B.sprint_seq===e.seq&&!B.archived);if(y.length===0)return{empty:!0};let v=y.some(B=>(B.story_points??0)>0),f=B=>v?B.story_points??0:1,x=y.reduce((B,T)=>B+f(T),0),I=new Map;for(let B of y){if(!B.completed)continue;let T=(B.completed_time??"").slice(0,10),L=/^\d{4}-\d{2}-\d{2}$/.test(T)?T:e.start_date;I.set(L,(I.get(L)??0)+f(B))}let W=[];for(let B=new Date(h);B<=b;B.setDate(B.getDate()+1))W.push(Ay(B));let _=x,K=[];for(let B of W){if(B>t)break;_-=I.get(B)??0,K.push({day:B,value:Math.max(0,_)})}return{empty:!1,days:W,total:x,usePoints:v,actual:K}},[e,o,t]);if(!r)return it(hn,{sx:{py:4,textAlign:"center",fontSize:14.5,color:"#9a9a97"},children:"\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."});if(r.empty)return it(hn,{sx:{py:4,textAlign:"center",fontSize:14.5,color:"#9a9a97"},children:"\uBC30\uC815\uB41C \uC5C5\uBB34\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."});let{days:i,total:a,usePoints:s,actual:d}=r,l=600,u=200,p=8,m=h=>i.length===1?0:h/(i.length-1)*l,c=h=>p+(u-p*2)*(1-h/Math.max(1,a)),k=`${m(0)},${c(a)} ${m(i.length-1)},${c(0)}`,S=d.map(h=>`${m(i.indexOf(h.day))},${c(h.value)}`).join(" "),g=d[d.length-1];return bn(hn,{children:[bn(hn,{sx:{mb:1,display:"flex",justifyContent:"space-between",fontSize:14,color:"#000"},children:[bn("span",{children:["\uB0A8\uC740 ",s?"\uC2A4\uD1A0\uB9AC \uD3EC\uC778\uD2B8(SP)":"\uC5C5\uBB34 \uC218(\uAC74)"," \u2014 \uCD1D ",a]}),g?bn("span",{children:["\uD604\uC7AC"," ",it(hn,{component:"span",sx:{color:"#2f80ed",fontWeight:700},children:g.value}),s?"SP":"\uAC74"," \uB0A8\uC74C"]}):null]}),it(hn,{sx:{border:"1px solid #e6e6e3",borderRadius:1,bgcolor:"#fafaf9",px:1,py:.5},children:bn("svg",{viewBox:`0 0 ${l} ${u}`,preserveAspectRatio:"none",style:{display:"block",width:"100%",height:n},children:[it("line",{x1:0,y1:c(0),x2:l,y2:c(0),stroke:"#e6e6e3",strokeWidth:1}),it("polyline",{points:k,fill:"none",stroke:"#9a9a97",strokeWidth:1.5,strokeDasharray:"6 5",vectorEffect:"non-scaling-stroke"}),d.length>1?it("polyline",{points:S,fill:"none",stroke:"#2f80ed",strokeWidth:2.5,vectorEffect:"non-scaling-stroke"}):null,g?it("circle",{cx:m(i.indexOf(g.day)),cy:c(g.value),r:4,fill:"#2f80ed",vectorEffect:"non-scaling-stroke"}):null]})}),bn(hn,{sx:{mt:.5,display:"flex",justifyContent:"space-between",fontSize:13.5,color:"#000"},children:[it("span",{children:Za(e.start_date)}),t>e.start_date&&t<e.end_date?bn("span",{children:["\uC624\uB298 ",Za(t)]}):null,it("span",{children:Za(e.end_date)})]})]})}import{jsx as _t,jsxs as el}from"react/jsx-runtime";function iz({open:e,sprints:o,tasks:t,todayStr:n,initialSprintSeq:r=0,onClose:i}){let[a,s]=Fy(0);Ly(()=>{if(!e)return;let u=o.find(m=>m.status==="active")??o[0],p=o.find(m=>m.seq===r)??u;s(p?.seq??0)},[e]);let d=Ny(()=>o.find(u=>u.seq===a)??null,[o,a]),l=el(Nn,{sx:{display:"flex",flexDirection:"column"},children:[el(Nn,{sx:{px:3,py:2.5},children:[_t(Nn,{sx:{mb:1.5,fontSize:17,fontWeight:700,color:"#37352f"},children:"\uBCA8\uB85C\uC2DC\uD2F0"}),_t(gm,{sprints:o,tasks:t})]}),_t(Wy,{sx:{borderColor:"#e6e6e3"}}),el(Nn,{sx:{px:3,py:2.5},children:[_t(Nn,{sx:{mb:1.5,fontSize:17,fontWeight:700,color:"#37352f"},children:"\uBC88\uB2E4\uC6B4"}),_t(Ky,{label:"\uBAA9\uD45C",showLabel:!1,value:a?String(a):"",options:o.map(u=>({value:String(u.seq),label:Oo(u)})),onChange:u=>s(Number(u.target.value)||0),sx:{width:280,mb:2}}),d?_t(bm,{sprint:d,tasks:t,todayStr:n}):_t(Nn,{sx:{py:4,textAlign:"center",fontSize:13.5,color:"#9a9a97"},children:"\uBC88\uB2E4\uC6B4\uC744 \uBCFC \uBAA9\uD45C\uB97C \uC120\uD0DD\uD558\uC138\uC694."})]})]});return _t($y,{open:e,onClose:i,width:680,title:"\uBAA9\uD45C \uCC28\uD2B8",locale:"ko",contentTopPadding:0,contentPaddingX:0,sectionsPaddingTop:0,tabs:{visible:!1},titleIcons:{delete:{visible:!1}},fontScale:{enabled:!0},fontScaleKey:"taskbox-sprint-charts",sections:[{id:"sprint-charts",showTitle:!1,children:l}],actions:{showCancelButton:!1,right:_t(Hy,{variant:"contained",onClick:i,children:"\uB2EB\uAE30"})}})}import{Checkbox as Uy,Divider as Vy,Menu as Gy,MenuItem as ol}from"@mui/material";import{jsx as fr,jsxs as km}from"react/jsx-runtime";function mz({anchorEl:e,candidates:o,selectedNames:t,avatarSrcByName:n,onToggle:r,onClear:i,onClose:a}){return km(Gy,{anchorEl:e,open:!!e,onClose:a,transitionDuration:0,children:[o.length===0?fr(ol,{disabled:!0,sx:{fontSize:14},children:"\uBAA9\uB85D\uC5D0 \uC9C0\uC815\uB41C \uC0AC\uB78C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."}):o.map(s=>{let d=t.includes(s.name);return km(ol,{onClick:()=>r(s),sx:{fontSize:14,minWidth:170,gap:1},children:[fr(Uy,{size:"small",checked:d,sx:{p:0}}),fr(ho,{names:[s.name],size:20,avatarSrcByName:n}),s.name]},`${s.accountSeq}-${s.name}`)}),fr(Vy,{}),fr(ol,{disabled:t.length===0,onClick:i,sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{useState as Yy}from"react";import{ButtonBase as jy,Menu as Xy,MenuItem as Qy}from"@mui/material";import Jy from"@mui/icons-material/KeyboardArrowDown";import Zy from"@mui/icons-material/Check";import{Fragment as e0,jsx as tl,jsxs as nl}from"react/jsx-runtime";function bz({value:e,onChange:o,options:t}){let[n,r]=Yy(null),i=t??$i,a=$i.find(s=>s.value===e)?.label??"";return nl(e0,{children:[nl(jy,{onClick:s=>r(s.currentTarget),sx:{display:"flex",alignItems:"center",gap:.5,px:1,py:.5,borderRadius:1,fontSize:13.5,color:"#37352f","&:hover":{bgcolor:"#f2f2f0"}},children:[a,tl(Jy,{sx:{fontSize:17,color:"#9a9a97"}})]}),tl(Xy,{transitionDuration:0,anchorEl:n,open:!!n,onClose:()=>r(null),children:i.map(s=>nl(Qy,{selected:s.value===e,onClick:()=>{o(s.value),r(null)},sx:{fontSize:14,minWidth:140,justifyContent:"space-between",gap:1},children:[s.label,s.value===e?tl(Zy,{sx:{fontSize:16,color:"#2f80ed"}}):null]},s.value))})]})}import{Box as Si,ButtonBase as o0}from"@mui/material";import{DateTextField as Tm}from"@ehfuse/mui-form-controls";function kn(e){let o=t=>String(t).padStart(2,"0");return`${e.getFullYear()}-${o(e.getMonth()+1)}-${o(e.getDate())}`}function yi(e,o=new Date){let t=new Date(o);return t.setMonth(t.getMonth()-e),t}function yz(e=new Date){return{fromDate:kn(yi(1,e)),toDate:kn(e)}}import{jsx as xr,jsxs as ym}from"react/jsx-runtime";var t0=[{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 Sm({fromDate:e,toDate:o,onChange:t}){let n=i=>{if(i<=0){t("","");return}t(kn(yi(i)),kn(new Date))},r=i=>i<=0?!e&&!o:!e||!o?!1:e===kn(yi(i))&&o===kn(new Date);return ym(Si,{sx:{display:"flex",alignItems:"center",gap:1.5,flexWrap:"wrap"},children:[xr(Si,{sx:{display:"flex",alignItems:"center",gap:1.5},children:t0.map(i=>{let a=r(i.months);return xr(o0,{onClick:()=>n(i.months),sx:{px:1.25,py:.85,borderRadius:1,fontSize:13,fontWeight:a?500:400,border:"1px solid",borderColor:a?"#2f80ed":"#dedddb",color:a?"#2f80ed":"#37352f",bgcolor:a?"#eef6ff":"transparent","&:hover":{bgcolor:a?"#eef6ff":"#f7f7f5"}},children:i.label},i.label)})}),ym(Si,{sx:{display:"flex",alignItems:"center",gap:.5},children:[xr(Tm,{value:e,size:"small",placeholder:"\uC2DC\uC791\uC77C",onChange:i=>t(i.target.value,o),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}}),xr(Si,{component:"span",sx:{fontSize:13,color:"#9a9a97"},children:"~"}),xr(Tm,{value:o,size:"small",placeholder:"\uC885\uB8CC\uC77C",onChange:i=>t(e,i.target.value),sx:{width:140,"& .MuiInputBase-input":{fontSize:13}}})]})]})}import{Popover as n0}from"@mui/material";import{jsx as Bm}from"react/jsx-runtime";function Mz({anchorEl:e,fromDate:o,toDate:t,onChange:n,onClose:r}){return Bm(n0,{transitionDuration:0,anchorEl:e,open:!!e,onClose:r,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},slotProps:{paper:{sx:{p:1.5}}},children:Bm(Sm,{fromDate:o,toDate:t,onChange:n})})}import{Box as r0,ButtonBase as i0,Tab as a0,Tabs as l0}from"@mui/material";import s0 from"@mui/icons-material/Checklist";import c0 from"@mui/icons-material/Face";import m0 from"@mui/icons-material/Publish";import u0 from"@mui/icons-material/NotificationsOutlined";import d0 from"@mui/icons-material/BugReportOutlined";import p0 from"@mui/icons-material/DescriptionOutlined";import f0 from"@mui/icons-material/Inventory2Outlined";import{jsx as Go}from"react/jsx-runtime";function Cm(e,o){return o>0?`${e} (${o})`:e}var $z=[{id:"my",label:"\uC804\uCCB4",icon:Go(s0,{sx:{fontSize:18}})},{id:"notice",label:"\uACF5\uC9C0\uC0AC\uD56D",icon:Go(u0,{sx:{fontSize:18}})},{id:"mine",label:"\uB0B4 \uC5C5\uBB34",icon:Go(c0,{sx:{fontSize:18}})},{id:"sent",label:"\uBCF4\uB0B8 \uC5C5\uBB34",icon:Go(m0,{sx:{fontSize:18}})},{id:"bug",label:"\uC624\uB958",icon:Go(d0,{sx:{fontSize:18}})},{id:"archive",label:"\uBCF4\uAD00\uD568",icon:Go(f0,{sx:{fontSize:18}}),hideCount:!0},{id:"report",label:"\uBCF4\uACE0\uC11C",icon:Go(p0,{sx:{fontSize:18}}),hideCount:!0}];function x0(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 Kz({items:e,activeTab:o,counts:t,onChange:n,compact:r=!1}){let i=ne(),a=x0(i.tabs),s=e;return r?Go(r0,{sx:{display:"flex",flexWrap:"wrap",gap:1.25},children:s.map(d=>{let l=o===d.id;return Go(i0,{onClick:()=>n(d.id),sx:{px:1.5,py:.75,borderRadius:1,fontSize:fo(13.5),fontWeight:500,whiteSpace:"nowrap",border:"1px solid",bgcolor:l?i.tabs.selectedBg:i.tabs.bg,color:l?i.tabs.selectedColor:i.tabs.color,borderColor:l?i.tabs.selectedBg:i.tabs.borderColor},children:Cm(d.label,d.hideCount?0:t[d.id]??0)},d.id)})}):Go(l0,{value:o,onChange:(d,l)=>n(l),sx:{minHeight:46,"& .MuiTabs-indicator":{display:"none"},"& .MuiTabs-flexContainer":{gap:"12px",minHeight:46}},children:s.map(d=>Go(a0,{value:d.id,label:Cm(d.label,d.hideCount?0:t[d.id]??0),icon:d.icon,iconPosition:"start",sx:a},d.id))})}import{useEffect as g0,useMemo as h0,useState as rl}from"react";import{Divider as il,ListItemIcon as qo,Menu as al,MenuItem as po}from"@mui/material";import b0 from"@mui/icons-material/OpenInNewOutlined";import k0 from"@mui/icons-material/Check";import T0 from"@mui/icons-material/CheckCircleOutlined";import y0 from"@mui/icons-material/RadioButtonUnchecked";import S0 from"@mui/icons-material/SendOutlined";import B0 from"@mui/icons-material/EventOutlined";import C0 from"@mui/icons-material/PersonOutlineOutlined";import v0 from"@mui/icons-material/ViewKanbanOutlined";import I0 from"@mui/icons-material/ContentCopyOutlined";import _0 from"@mui/icons-material/NextPlanOutlined";import D0 from"@mui/icons-material/ContentPasteOutlined";import w0 from"@mui/icons-material/ShareOutlined";import M0 from"@mui/icons-material/DirectionsRunOutlined";import vm from"@mui/icons-material/ChevronRight";import O0 from"@mui/icons-material/ArchiveOutlined";import E0 from"@mui/icons-material/UnarchiveOutlined";import{ConfirmDialog as P0}from"@ehfuse/alerts";import{Fragment as R0,jsx as se,jsxs as so}from"react/jsx-runtime";function Tq({target:e,onClose:o,customTabs:t,sprints:n=[],myAccountSeq:r=0,onOpenDetail:i,onToggleCompleted:a,onRequestConfirm:s,onChangeDueDate:d,onChangeReminder:l,onMemberEdit:u,onMoveProject:p,onDuplicate:m,onCreateFollowUp:c,onShare:k,onAssignSprint:S,onArchiveToggle:g,onDelete:h}){let b=Re(),w=Qo(),[y,v]=rl(null),[f,x]=rl(null),[I,W]=rl(null);g0(()=>{e||(v(null),x(null),W(null))},[e]);let _=e?.task??null,K=!!_?.is_notice,B=!!_?.is_event,T=_?!ct(_,r):!1,L=h0(()=>new Set(t.filter(R=>R.useSprints).map(R=>R.key)),[t]),$=async()=>{let R=_;if(o(),!R)return;await P0({title:"\uC5C5\uBB34 \uC0AD\uC81C",message:`"${R.title}" \uC5C5\uBB34\uB97C \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?`})&&h(R.seq)},J=()=>{_&&g(_.seq,!_.archived),o()};return so(R0,{children:[so(al,{open:!!e,onClose:o,transitionDuration:0,anchorReference:b?"none":"anchorPosition",anchorPosition:!b&&e?{top:e.position.top,left:e.position.left}:void 0,slotProps:{paper:{sx:{minWidth:190,...b?{position:"fixed",top:"50%",left:"50%",translate:"-50% -50%",maxHeight:"70vh"}:{}}},list:b?{sx:{"& .MuiMenuItem-root":{py:1,minHeight:0}}}:void 0},children:[so(po,{onClick:()=>{_&&i(_),o()},sx:{fontSize:14},children:[se(qo,{children:se(b0,{sx:{fontSize:19}})}),"\uC0C1\uC138 \uC5F4\uAE30"]}),so(po,{disabled:K?(_?.author_account_seq??0)!==r:(_?.author_account_seq??0)!==r&&(_?.manager_account_seq??0)!==r,onClick:()=>{_&&a(_.seq,!_.completed),o()},sx:{fontSize:14},children:[se(qo,{children:_?.completed?se(y0,{sx:{fontSize:19}}):se(T0,{sx:{fontSize:19}})}),_?.completed?"\uC644\uB8CC \uD574\uC81C":"\uC644\uB8CC \uCC98\uB9AC"]}),!K&&s?so(po,{disabled:!(_?.manager_account_seq??0)&&(_?.receiver_account_seqs??[]).length===0,onClick:()=>{_&&s(_),o()},sx:{fontSize:14},children:[se(qo,{children:se(S0,{sx:{fontSize:19}})}),"\uD655\uC778 \uC694\uCCAD"]}):null,B?null:se(il,{}),B?null:so(po,{disabled:T,onClick:R=>{_&&v({anchorEl:R.currentTarget,task:_})},sx:{fontSize:14},children:[se(qo,{children:se(B0,{sx:{fontSize:19}})}),"\uB9C8\uAC10\uAE30\uD55C \uBCC0\uACBD"]}),!K&&!B&&u?so(po,{onClick:()=>{_&&u(_,"manager"),o()},sx:{fontSize:14},children:[se(qo,{children:se(C0,{sx:{fontSize:19}})}),"\uCC45\uC784\uC790 \uBCC0\uACBD"]}):null,B?null:so(po,{disabled:T,onClick:R=>{_&&x({anchorEl:R.currentTarget,task:_})},sx:{fontSize:14},children:[se(qo,{children:se(v0,{sx:{fontSize:19}})}),"\uD504\uB85C\uC81D\uD2B8 \uC774\uB3D9",se(vm,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}),se(il,{}),m?so(po,{disabled:T,onClick:()=>{_&&m(_.seq),o()},sx:{fontSize:14},children:[se(qo,{children:se(I0,{sx:{fontSize:19}})}),"\uBCF5\uC81C"]}):null,c&&_&&!_.is_event&&!_.is_notice?so(po,{onClick:()=>{_&&c(_.seq),o()},sx:{fontSize:14},children:[se(qo,{children:se(_0,{sx:{fontSize:19}})}),"\uD6C4\uC18D \uC5C5\uBB34 \uB9CC\uB4E4\uAE30"]}):null,so(po,{onClick:()=>{_&&(k?k(_):gi(_,b)),o()},sx:{fontSize:14},children:[se(qo,{children:b?se(w0,{sx:{fontSize:19}}):se(D0,{sx:{fontSize:19}})}),b?"\uACF5\uC720\uD558\uAE30":"\uB0B4\uC6A9 \uBCF5\uC0AC"]}),_&&!_.is_notice&&!_.is_event&&L.has(String(_.tab_key??""))&&S?so(po,{onClick:R=>W(R.currentTarget),sx:{fontSize:14},children:[se(qo,{children:se(M0,{sx:{fontSize:19}})}),"\uBAA9\uD45C\uC5D0 \uB123\uAE30",se(vm,{sx:{fontSize:18,ml:"auto",color:"#9a9a97"}})]}):null,so(po,{onClick:J,disabled:T||!_?.archived&&!(_&&Br(_)),sx:{fontSize:14},children:[se(qo,{children:_?.archived?se(E0,{sx:{fontSize:19}}):se(O0,{sx:{fontSize:19}})}),_?.archived?"\uBCF4\uAD00 \uD574\uC81C":"\uBCF4\uAD00"]}),se(il,{}),so(po,{disabled:T,onClick:$,sx:{fontSize:14,color:"#e5484d"},children:[se(qo,{children:se(ft,{sx:{fontSize:19,color:"#e5484d"}})}),"\uC0AD\uC81C"]})]}),se(Pt,{anchorEl:y?.anchorEl??null,open:!!y,date:y?.task.due_date??"",reminder:y?.task.reminder??"none",hideReminder:!!y?.task.completed,centered:b,onClose:()=>{v(null),o()},onDateChange:R=>{y&&d(y.task.seq,R)},onReminderChange:R=>{y&&l?.(y.task.seq,R)}}),so(al,{transitionDuration:0,anchorEl:f?.anchorEl??null,open:!!f,onClose:()=>{x(null),o()},anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},...w,children:[se(po,{selected:!f?.task.tab_key,onClick:()=>{f&&p(f.task.seq,""),x(null),o()},sx:{fontSize:14,minWidth:170},children:"\uC5C6\uC74C"}),t.filter(R=>!R.archived).map(R=>se(po,{selected:f?.task.tab_key===R.key,onClick:()=>{f&&p(f.task.seq,R.key),x(null),o()},sx:{fontSize:14,minWidth:170},children:R.label},R.key))]}),se(al,{transitionDuration:0,anchorEl:I,open:!!I,onClose:()=>W(null),anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},children:[{seq:0,label:"\uBBF8\uBC30\uC815"},...n.filter(R=>`custom-${R.group_seq}`===String(_?.tab_key??"")).map(R=>({seq:R.seq,label:Oo(R)}))].map(R=>so(po,{onClick:()=>{_&&S?.(_.seq,R.seq),W(null),o()},sx:{fontSize:14,minWidth:160,gap:1},children:[R.label,(_?.sprint_seq??0)===R.seq?se(k0,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},R.seq))})]})}import{Checkbox as z0,Divider as q0,Menu as A0,MenuItem as Im}from"@mui/material";import{jsx as Bi,jsxs as _m}from"react/jsx-runtime";function vq({anchorEl:e,labelOptions:o,selectedKeys:t,onToggle:n,onClear:r,onClose:i}){return _m(A0,{transitionDuration:0,anchorEl:e,open:!!e,onClose:i,children:[o.map(a=>{let s=t.includes(a.key);return _m(Im,{onClick:()=>n(a.key),sx:{fontSize:14,minWidth:190,gap:1},children:[Bi(z0,{size:"small",checked:s,sx:{p:0}}),Bi(Ee,{option:a})]},a.key)}),Bi(q0,{}),Bi(Im,{disabled:t.length===0,onClick:()=>{r(),i()},sx:{fontSize:14,color:"#787774"},children:"\uD544\uD130 \uD574\uC81C"})]})}import{Divider as Dm,Menu as L0,MenuItem as ll}from"@mui/material";import N0 from"@mui/icons-material/Check";import F0 from"@mui/icons-material/BarChartOutlined";import H0 from"@mui/icons-material/SettingsOutlined";import{jsx as gr,jsxs as Ci}from"react/jsx-runtime";function Pq(e){let{anchorEl:o,sprints:t,value:n,onSelect:r,onManage:i,onCharts:a,onClose:s}=e;return Ci(L0,{transitionDuration:0,anchorEl:o,open:!!o,onClose:s,children:[[{seq:0,label:"\uC804\uCCB4"},{seq:-1,label:"\uBBF8\uBC30\uC815 \uC5C5\uBB34"},...t.map(d=>({seq:d.seq,label:Oo(d)}))].map(d=>Ci(ll,{onClick:()=>{r(d.seq),s()},sx:{fontSize:14,minWidth:180,gap:1},children:[d.label,n===d.seq?gr(N0,{sx:{fontSize:16,color:"#2f80ed",ml:"auto"}}):null]},d.seq)),gr(Dm,{}),a?Ci(ll,{onClick:()=>{s(),a()},sx:{fontSize:14,gap:1},children:[gr(F0,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uCC28\uD2B8"]}):null,a?gr(Dm,{}):null,Ci(ll,{onClick:()=>{s(),i()},sx:{fontSize:14,gap:1},children:[gr(H0,{sx:{fontSize:18,color:"#787774"}}),"\uBAA9\uD45C \uAD00\uB9AC\u2026"]})]})}var W0={my:"tasks",mine:"tasks",sent:"tasks",notice:"notice",bug:"bug",archive:"archive",done:"done",report:"report"};function $0(e){return W0[e]??"tasks"}var qq={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"},wm=["list","calendar","month","card","kanban","sprint","timeline"],K0=["list","card"];function Aq(e){let o=$0(e);switch(o){case"notice":return{kind:o,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:o,viewOptions:wm,showCreate:!0,createLabel:"\uC624\uB958 \uB4F1\uB85D",showGroupBy:!0,showSprintFilter:!0,showDateRange:!1,showHideCompleted:!0,forceFlatList:!1,columns:{bug:!0}};case"archive":return{kind:o,viewOptions:K0,showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"done":return{kind:o,viewOptions:["list"],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{showActions:!1}};case"report":return{kind:o,viewOptions:[],showCreate:!1,createLabel:"",showGroupBy:!1,showSprintFilter:!1,showDateRange:!0,showHideCompleted:!1,forceFlatList:!0,columns:{}};default:return{kind:o,viewOptions:wm,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"}:{}}}}export{Mv as ALL_TASK_VIEWER_ACCOUNT_SEQS,Sc as AddLabelDialog,Ar as AddTabDialog,bc as AttachmentUploadGauge,za as AttachmentUploadPercent,zi as BUG_DEVICE_OPTIONS,Vn as BUG_ICON_COLOR,pv as BUG_KANBAN_COLUMNS,Ri as BUG_REPRO_OPTIONS,qi as BUG_RESOLUTION_OPTIONS,Qt as BUG_STATUS_OPTIONS,Un as BUG_TASK_ICON,ri as BugPropertiesGrid,ef as COLUMN_WIDTHS,Li as COMPLETED_STATUS_OPTION,Ga as CUSTOM_TAB_KEY_PREFIX,v2 as CalendarImportDialog,P2 as CalendarSubscribeDialog,vn as CommentBubbleIcon,Cn as ConfirmCountButton,Jl as DATE_REMINDER_OPTIONS,Di as DEFAULT_PROJECT_ICON,$z as DEFAULT_TASKBOX_TAB_ITEMS,Me as DEFAULT_TASK_ICON,Mz as DateRangeFilterPopover,Po as DrawerSection,Pt as DueDatePickerPopover,Pp as ENDED_EVENT_STATUS_OPTION,wc as EVENT_ICON_COLOR,W2 as EmployeeSelectDialog,$i as GROUP_BY_OPTIONS,Dn as GoogleEventChip,bz as GroupByMenuButton,qr as IconPickerGrid,ic as InlineAddressInput,vt as InlineTextValue,Ni as KANBAN_CLOSED_COLUMN_KEY,vq as LabelFilterMenu,di as LabelSelectMenu,Yn as MANUAL_TASK_STATUS_OPTIONS,mz as MemberFilterMenu,Gn as NOTICE_STATUS_OPTIONS,xo as NOTICE_TASK_ICON,Bl as NO_TASK_ICON,wi as PROJECT_ICON_OPTIONS,de as PropertyRow,Sn as RECEIVER_AVATAR_COLORS,Zl as REMINDER_OPTIONS,ho as ReceiverAvatarStack,Zc as RelatedTasksSection,Tr as STATUS_KEY_REPLIED,$n as STATUS_KEY_WAITING,ss as SortableTaskCard,bm as SprintBurndownChart,iz as SprintChartsDialog,Pq as SprintFilterMenu,x2 as SprintManageDialog,gm as SprintVelocityChart,_r as StatusSelectMenu,Vi as TASKBOX_COLUMNS,Wo as TASKBOX_DRAWER_NARROW_MQ,Cl as TASKBOX_UI_STATE_ID,qq as TASKBOX_VIEW_LABELS,Rw as TASKBOX_VIEW_MODES,Xt as TASK_STATUS_OPTIONS,Vf as TIME_REMINDER_OPTIONS,Fr as TaskAckListPopover,Bn as TaskActionButton,mi as TaskAttachmentsSection,Gs as TaskBoxColumnSummary,ua as TaskBoxGroupBoard,TM as TaskBoxMobileList,qs as TaskBoxMonthAgenda,Es as TaskBoxMonthCalendar,Gw as TaskBoxSprintColumnSummary,rs as TaskBoxTable,Kz as TaskBoxTabs,Ws as TaskBoxTimeline,Pw as TaskBoxView,Is as TaskBoxWeekCalendar,Zn as TaskCardContent,li as TaskChecklistSection,Fc as TaskCommentInput,Nc as TaskCommentsSection,ii as TaskContentEditor,Tq as TaskContextMenu,ni as TaskCorePropertiesGrid,Mc as TaskCreateBody,w5 as TaskCreateDrawer,Sm as TaskDateRangeFilter,nm as TaskDetailBody,t2 as TaskDetailDrawer,Uc as TaskDetailHeader,Pn as TaskIconPickerPopover,Ot as TaskLabelChips,Xc as TaskLinkDialog,Vc as TaskNoteField,No as TaskPriorityChip,Ee as TaskStatusChip,Tv as TaskStatusChips,Lm as TaskboxProvider,Ty as buildCalendarFeedUrl,Hr as buildCardBaseSx,Pl as buildStatusOptionColors,Ki as buildTaskGroupSections,Yc as buildTaskRelationsModel,nT as buildTaskShareText,yr as buildTaskboxTheme,Rl as canAssignBugManager,wr as canClaimTaskItem,ct as canEditTaskItem,Dr as canViewTaskItem,Mr as canVolunteerTaskItem,Ks as countWorkdays,Dp as createTaskboxTheme,Vs as daysLeftUntil,Mi as defaultTaskBoxFormValues,Oi as defaultTaskboxUiStateValues,_c as filterFilesWithinLimit,J1 as formatConfirmTime,$s as formatHours,Zo as formatKoreanDate,mt as formatKoreanDateTime,Oo as formatSprintOptionLabel,Ml as getBugDeviceName,wl as getBugReproName,Sr as getBugResolutionName,Rp as getBugStatusOption,yz as getDefaultDateRange,jn as getEventDisplayStatusOption,fv as getNoDueStatusRank,Ic as getNoticeAckInfo,Ol as getNoticeStatusOption,HE as getNoticeTargetDisplay,Tn as getProjectIconAnchorComponent,He as getProjectIconComponent,oa as getReminderLabel,ea as getReminderOptions,El as getStatusOptionsForTask,Aq as getTabHeaderConfig,Yi as getTaskBoxColumnDefs,Or as getTaskBoxGridTemplate,$0 as getTaskBoxTabKind,as as getTaskConfirmInfo,go as getTaskDisplayStatusOption,Cr as getTaskStatusOption,_n as groupGoogleEventsByDate,Ya as groupSeqFromTabKey,CP as hasRelation,Ub as htmlToPlainText,ry as isCustomTabKey,Wi as isOpenPoolTaskItem,Ai as isPastEvent,Br as isTaskDone,Fi as isWaitingTask,yi as monthsAgoDate,uo as narrowOrderSx,o2 as nowDateTimeString,Dh as parseEstimatedHours,dn as relationsOf,yn as resolveTaskStatusOptions,Pi as resolveTaskboxTheme,gi as shareTaskText,Us as sumRemainingHours,pi as summarizeNoticeTargets,i2 as tabKeyFromGroupSeq,kn as toYmd,vr as toggleLabelKey,_i as useBuildFileUrl,hc as useTaskAttachmentUploadMeta,Io as useTaskboxConfig,Bp as useTaskboxForm,ne as useTaskboxTheme,st as useTaskboxUiState,Kn as useUploadMaxMb};
|
|
14
14
|
//# sourceMappingURL=index.esm.js.map
|