1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[74778],{317:(e,t,n)=>{n.d(t,{H:()=>g});var r=n(32957),a=n(97849),l=n(70307),i=n(62592),s=n(3625),o=n(75438),d=n(51897),c=n(30515),u=n(65644),p=n(74261);function g(e){var t,n;let{projectId:g,heading:x}=e,h=(0,c.t)(),v=(0,i.S)(),y=(0,l.c)("common"),b=(0,l.c)("boardConnections"),m=function(){let e=(0,l.c)("boardConnections");return(0,s.useCallback)(t=>e.has("status.".concat(t))?e("status.".concat(t)):t,[e])}(),f=(0,d.Us)(),j=void 0===x?b("heading"):x,[k,S]=(0,s.useState)([]),[w,C]=(0,s.useState)([]),[z,I]=(0,s.useState)(!0),[T,R]=(0,s.useState)(null),[W,D]=(0,s.useState)(!1),[A,P]=(0,s.useState)(!1),[M,H]=(0,s.useState)(null),[B,E]=(0,s.useState)({}),[L,K]=(0,s.useState)(""),[F,N]=(0,s.useState)(""),[_,O]=(0,s.useState)(""),[q,U]=(0,s.useState)(300),V=L||(f.some(e=>"jira"===e.id)?"jira":null!=(n=null==(t=f[0])?void 0:t.id)?n:""),G=f.find(e=>e.id===V),X=e=>{var t,n;return null!=(n=null==(t=f.find(t=>t.id===e))?void 0:t.label)?n:e},Q=e=>e?b.has("externalBoardIdHint.".concat(e.id))?b("externalBoardIdHint.".concat(e.id)):e.externalBoardIdHint:b("externalBoardIdPlaceholder"),J=(0,s.useCallback)(()=>{I(!0),Promise.all([o.ox.list(g),Promise.all([o.UQ.list({projectId:g}),o.UQ.list({scope:"global"})]).then(e=>{let[t,n]=e;return[...t,...n]})]).then(e=>{let[t,n]=e;S(t),C(n)}).catch(e=>R((0,u.yR)(e,b("loadError")))).finally(()=>I(!1))},[g,b]);(0,s.useEffect)(()=>{J()},[J]);let Y=()=>{K(""),N(""),O(""),U(300)},$=async()=>{if(R(null),(null==G?void 0:G.externalBoardId)==="required"&&!_.trim())return void R(b("externalIdRequired",{provider:G.label,hint:Q(G)}));P(!0);try{let e=await o.ox.create({projectId:g,provider:V,credentialId:F||null,externalBoardId:_.trim()||null,pollIntervalSec:q});o.ox.sync(e.id).then(()=>E(t=>({...t,[e.id]:{text:b("initialSyncStarted"),error:!1}}))).catch(t=>E(n=>({...n,[e.id]:{text:t instanceof Error?t.message:b("initialSyncFailed"),error:!0}}))).finally(J),Y(),D(!1),J()}catch(e){R((0,u.yR)(e,b("createError")))}finally{P(!1)}},Z=async e=>{H(e),E(t=>{let{[e]:n,...r}=t;return r});try{await o.ox.sync(e),E(t=>({...t,[e]:{text:b("synced"),error:!1}}))}catch(t){E(n=>({...n,[e]:{text:t instanceof Error?t.message:b("syncFailed"),error:!0}}))}finally{H(null),J()}},ee=async e=>{await v(y("deleteBoardConnectionConfirm"))&&(await o.ox.remove(e),J())},et=w.filter(e=>e.provider===V);return(0,r.jsxs)("div",{style:p.BZ,children:[j&&(0,r.jsx)("div",{style:{fontWeight:600,marginBottom:6,fontSize:14},children:j}),(0,r.jsx)("div",{style:{fontSize:12,color:"var(--text-muted)"},children:b("description")}),z?(0,r.jsx)("div",{style:{fontSize:13,color:"var(--text-muted)",marginTop:12},children:y("loading")}):(0,r.jsxs)("div",{style:{marginTop:12},children:[0===k.length&&(0,r.jsx)("div",{style:{fontSize:13,color:"var(--text-muted)"},children:b("empty")}),k.map(e=>{var t,n,a,l;return(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4,padding:"10px 0",borderTop:"1px solid var(--border-subtle)"},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[(0,r.jsx)("span",{style:{fontSize:11,fontWeight:700,textTransform:"uppercase",color:"var(--coral-bright)",minWidth:56},children:X(e.provider)}),(0,r.jsxs)("span",{style:{fontSize:13,color:"var(--text-primary)",flex:1,minWidth:140},children:[e.externalBoardId||b("boardFallback")," \xb7 ",null!==(a=e.credentialId,n=null==(l=w.find(e=>e.id===a))?void 0:l.name)&&void 0!==n?n:b("noKey"),(0,r.jsxs)("span",{style:{marginLeft:6,fontSize:11,color:"var(--text-muted)"},children:[m(e.status),e.lastPolledAt?" \xb7 ".concat(b("lastPolled",{time:h.dateTime(e.lastPolledAt)})):""]}),B[e.id]&&!B[e.id].error&&(0,r.jsxs)("span",{style:{marginLeft:6,fontSize:11,color:"var(--text-muted)"},children:["\xb7 ",B[e.id].text]})]}),(0,r.jsx)("button",{type:"button",style:p.QQ,disabled:M===e.id,onClick:()=>Z(e.id),children:M===e.id?b("syncing"):b("syncNow")}),(0,r.jsx)("button",{type:"button",style:{...p.QQ,color:"var(--danger)"},onClick:()=>ee(e.id),children:y("delete")})]}),(null==(t=B[e.id])?void 0:t.error)&&(0,r.jsx)("div",{role:"alert",style:{fontSize:12,color:"var(--error-text)",background:"var(--error-bg, rgba(220,38,38,0.08))",border:"1px solid var(--error-border, rgba(220,38,38,0.3))",borderRadius:"var(--radius-sm)",padding:"6px 10px"},children:b("syncFailedPrefix",{message:B[e.id].text})})]},e.id)})]}),T&&(0,r.jsx)("div",{role:"alert",style:{fontSize:12,color:"var(--danger)",marginTop:10},children:T}),W?(0,r.jsxs)("div",{style:p.XI,children:[(0,r.jsx)(a.l,{"aria-label":b("providerSelect"),value:V,onChange:e=>{K(e.target.value),N("")},style:p.C8,children:f.map(e=>(0,r.jsx)("option",{value:e.id,children:e.label},e.id))}),(0,r.jsxs)(a.l,{"aria-label":b("selectAccessKey"),value:F,onChange:e=>N(e.target.value),style:p.C8,children:[(0,r.jsx)("option",{value:"",children:b("selectAccessKey")}),et.map(e=>(0,r.jsxs)("option",{value:e.id,children:[e.name," (",X(e.provider),null==e.projectId?b("workspaceSuffix"):"",")"]},e.id))]}),(0,r.jsx)("input",{style:p.C8,"aria-label":b("externalBoardIdPlaceholder"),placeholder:Q(G),value:_,onCh
1ange:e=>O(e.target.value)}),(0,r.jsxs)("label",{style:{fontSize:12,color:"var(--text-secondary)"},children:[b("pollIntervalLabel"),(0,r.jsx)("input",{style:{...p.C8,marginTop:4},type:"number",min:60,value:q,onChange:e=>U(Number(e.target.value))})]}),(0,r.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[(0,r.jsx)("button",{type:"button",style:p.tB,disabled:A||!V,onClick:$,children:A?b("connecting"):b("connectAndSync")}),(0,r.jsx)("button",{type:"button",style:p.QQ,onClick:()=>{D(!1),Y(),R(null)},children:y("cancel")})]})]}):(0,r.jsx)("button",{type:"button",style:{...p.tB,marginTop:14},onClick:()=>D(!0),children:b("connectExternalBoard")})]})}},8132:(e,t,n)=>{n.d(t,{ChunkErrorBoundary:()=>d});var r=n(32957),a=n(5337),l=n(3625),i=n(70307),s=n(55602),o=n(33772);class d extends l.Component{static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){(0,s.oz)(e)&&((0,o.ed)(e,{boundary:"ChunkErrorBoundary",componentStack:t.componentStack}),(0,s.Gf)())}render(){let{error:e}=this.state;if(!e)return this.props.children;if(!(0,s.oz)(e))throw e;return(0,r.jsx)(c,{recovering:!(0,s.zn)(),compact:this.props.compact})}constructor(...e){super(...e),this.state={error:null}}}function c(e){let{recovering:t,compact:n}=e,l=(0,i.c)("chunkError");return n?(0,r.jsx)("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-muted)",fontSize:"var(--font-size-small)",padding:16,textAlign:"center"},children:t?(0,r.jsx)("span",{children:l("recovering")}):(0,r.jsx)("button",{type:"button",onClick:()=>void(0,s.Gf)(!0),style:{padding:"6px 12px",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-subtle)",background:"var(--bg-base)",color:"var(--text-secondary)",cursor:"pointer"},children:l("reload")})}):(0,r.jsxs)("div",{style:{minHeight:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:14,padding:32,textAlign:"center",background:"var(--bg-deep)",color:"var(--text-primary)",fontFamily:"var(--font-display, system-ui, sans-serif)"},children:[(0,r.jsx)("div",{style:{fontSize:"var(--font-size-page-title)",animation:t?"pulse 1.5s ease-in-out infinite":void 0},children:t?(0,r.jsx)(a.I,{source:"â¡",size:"1em"}):(0,r.jsx)(a.I,{source:"â ï¸",size:"1em"})}),t?(0,r.jsx)("p",{style:{color:"var(--text-secondary)",margin:0},children:l("recovering")}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h2",{style:{fontSize:"var(--font-size-section)",fontWeight:700,margin:0},children:l("title")}),(0,r.jsx)("p",{style:{color:"var(--text-secondary)",margin:0,maxWidth:420},children:l("body")}),(0,r.jsx)("button",{type:"button",onClick:()=>void(0,s.Gf)(!0),style:{marginTop:8,background:"linear-gradient(135deg, var(--coral-bright), var(--coral-dark))",color:"var(--text-on-accent)",border:"none",padding:"10px 24px",borderRadius:"var(--radius-lg)",fontFamily:"var(--font-display, system-ui, sans-serif)",fontWeight:600,cursor:"pointer",fontSize:"var(--font-size-body)"},children:l("reload")})]})]})}},11002:(e,t,n)=>{n.d(t,{F:()=>i,eu:()=>s});var r=n(32957),a=n(3625),l=n(11813);function i(e){let{name:t,imageUrl:n,count:i,active:s=!1,size:o=36,color:d}=e,c=(0,a.useMemo)(()=>null!=d?d:function(e){let t=["var(--red-bright)","var(--orange-bright)","var(--amber-bright)","var(--yellow-bright)","var(--emerald-bright)","var(--teal-bright)","var(--cyan-bright)","var(--indigo-bright)","var(--violet-bright)","var(--pink-bright)"],n=0;for(let t=0;t<e.length;t++)n=e.charCodeAt(t)+((n<<5)-n);return t[Math.abs(n)%t.length]}(t),[t,d]),u=(0,a.useMemo)(()=>(0,l.b)(t),[t]),[p,g]=(0,a.useState)(null),x=n&&n!==p?n:null;return(0,r.jsxs)("span",{style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:o,height:o,borderRadius:"50%",background:s?c:"var(--bg-elevated)",color:s?"var(--text-on-accent)":"var(--text-secondary)",border:"2px solid ".concat(s?c:"var(--border-subtle)"),fontWeight:600,fontSize:Math.max(9,Math.round(.36*o)),lineHeight:1,flexShrink:0,transition:"background 0.15s, color 0.15s, border-color 0.15s",overflow:null!=i?"visible":"hidden"},"aria-hidden":"true",children:[x?(0,r.jsx)("img",{src:x,alt:"",width:o,height:o,referrerPolicy:"no-referrer",onError:()=>g(x),style:{width:"100%",height:"100%",borderRadius:"50%",objectFit:"cover"}}):u,null!=i&&(0,r.jsx)("span",{style:{position:"absolute",top:-4,right:-4,background:"var(--coral-bright)",color:"var(--text-on-accent)",fontSize:9,fontWeight:700,minWidth:16,height:16,borderRadius:"var(--radius-md)",display:"flex",alignItems:"center",justifyContent:"center",padding:"0 4px",lineHeight:1,boxShadow:"0 1px 3px rgba(0,0,0,0.25)",pointerEvents:"none"},children:i>99?"99+":i})]})}function s(e){let{onClick:t,title:n,...a}=e,{name:l,count:s}=a;return(0,r.jsx)("button",{type:"button",onClick:t,title:null!=n?n:"".concat(l).concat(null!=s?" (".concat(s," task").concat(1!==s?"
1s":"",")"):""),"aria-label":null!=n?n:"".concat(l).concat(null!=s?", ".concat(s," tasks"):""),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",background:"none",border:"none",padding:0,cursor:t?"pointer":"default",outline:"none",fontFamily:"inherit",lineHeight:1},children:(0,r.jsx)(i,{...a})})}},11365:(e,t,n)=>{n.d(t,{Rd:()=>s,_8:()=>l,oV:()=>i});var r=n(65644),a=n(85352);let l=["blocked_dependency","awaiting_review","scope_change","unclear_requirements","external","capacity","other"],i={crossTeam:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:30,t=arguments.length>1?arguments[1]:void 0;return(0,r.AT)("/api/insights/benchmarking/cross-team?days=".concat(e).concat(null!=t?"&projectId=".concat(t):""))},delayTaxonomy:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:90,t=arguments.length>1?arguments[1]:void 0;return(0,r.AT)("/api/insights/delay-taxonomy?days=".concat(e).concat(null!=t?"&projectId=".concat(t):""))},tagDelay:(e,t,n)=>(0,r.AT)("/api/insights/delay-taxonomy",{method:"POST",body:JSON.stringify({taskId:e,reasonCode:t,notes:n})}),clearDelay:e=>(0,r.AT)("/api/insights/delay-taxonomy/".concat(e),{method:"DELETE"}),exportDataset:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:30,a=arguments.length>3?arguments[3]:void 0;return(0,r.Ti)("/api/insights/export?dataset=".concat(e,"&format=").concat(t,"&days=").concat(n).concat(null!=a?"&projectId=".concat(a):""))}};function s(e,t,n){(0,a.mR)(e,"".concat(t,"-").concat(new Date().toISOString().slice(0,10),".").concat(n),"html"===n?"text/html":"text/csv")}},11813:(e,t,n)=>{n.d(t,{b:()=>r});function r(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"?",n=(null!=e?e:"").trim().split(/\s+/).filter(Boolean);return 0===n.length?t:1===n.length?n[0].slice(0,2).toUpperCase():(n[0][0]+n[n.length-1][0]).toUpperCase()}},14021:(e,t,n)=>{n.d(t,{H6:()=>s,Sm:()=>i,WP:()=>l,Z0:()=>a});let r={ts:"typescript",tsx:"typescriptreact",js:"javascript",jsx:"javascriptreact",css:"css",scss:"scss",html:"html",json:"json",md:"markdown",py:"python",rs:"rust",go:"go",java:"java",sh:"shell",yaml:"yaml",yml:"yaml",toml:"toml",sql:"sql"};function a(e){var t,n,a;return e&&null!=(a=r[null!=(n=null==(t=e.split(".").pop())?void 0:t.toLowerCase())?n:""])?a:"plaintext"}function l(e){return e.split("/").pop()||e}function i(e){let t,n=/```[ \t]*([^\n`]*)\r?\n([\s\S]*?)\r?\n?```/g;for(;null!==(t=n.exec(e));){let e=t[1].trim().toLowerCase();if("md"===e||"markdown"===e||e.endsWith(".md"))return t[2].trim()}return e}function s(e){let t=[],n={};for(let r of e){let e=r.path.split("/").filter(Boolean);if(0===e.length)continue;let a=t,l="";for(let t=0;t<e.length;t++){let i=e[t];l=l?"".concat(l,"/").concat(i):i;let s=t===e.length-1;if(!n[l]){let e={name:i,path:l,type:s?r.type:"directory",children:s&&"file"===r.type?void 0:[]};n[l]=e,a.push(e)}s||(a=n[l].children)}}return t}},22494:(e,t,n)=>{n.d(t,{y:()=>d});var r=n(32957),a=n(5337),l=n(31917),i=n.n(l),s=n(70307),o=n(76464);function d(e){var t;let{error:n,fallback:l=null}=e,d=(0,s.c)("insights");return(0,o.VW)(n)?(0,r.jsxs)("div",{role:"region","aria-label":d("upgrade.title"),style:{display:"flex",flexDirection:"column",gap:10,alignItems:"flex-start",padding:"20px 22px",borderRadius:"var(--radius-lg)",border:"1px solid var(--border-subtle)",background:"var(--surface-sunken, rgba(37,99,235,0.06))"},children:[(0,r.jsx)("span",{style:{fontSize:"1.4rem"},"aria-hidden":!0,children:(0,r.jsx)(a.I,{source:"\uD83D\uDD12",size:"1em"})}),(0,r.jsx)("div",{style:{fontWeight:700,fontSize:"0.98rem",color:"var(--text-primary)"},children:d("upgrade.title")}),(0,r.jsx)("p",{style:{margin:0,fontSize:"0.86rem",color:"var(--text-secondary)",maxWidth:460},children:d("upgrade.body",{plan:n.currentPlan})}),(0,r.jsx)(i(),{href:"/pricing?upgrade=".concat(null!=(t=n.requiredPlan)?t:"pro"),style:{marginTop:4,padding:"8px 16px",borderRadius:"var(--radius-md)",textDecoration:"none",background:"var(--accent)",color:"var(--text-on-accent)",fontWeight:600,fontSize:"0.84rem"},children:d("upgrade.cta")})]}):(0,r.jsx)(r.Fragment,{children:l})}},33351:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(32957),a=n(9629);function l(e){let{size:t=20,className:n}=e;return(0,r.jsx)(a.default,{src:"/agentHost.png",alt:"",width:t,height:t,className:n,style:{objectFit:"contain",display:"inline-block",verticalAlign:"middle"}})}},50796:(e,t,n)=>{n.d(t,{u:()=>c});var r=n(32957),a=n(3625),l=n(70307),i=n(92826),s=n(51277),o=n(14745),d=n(40505);function c(e){let{items:t,getLabel:n,onSelect:c,getAccentColor:u,onReschedule:p}=e,g=(0,l.c)("schedule"),x=(0,a.useMemo)(()=>(0,s.ol)(new Date),[]),h=(0,a.useMemo)(()=>new Map(t.map(e=>[String(e.id),e])),[t]),v=(0,a.useMemo)(()=>t.flatMap(e=>{let t=(0,s.A0)(e,x);if(!t.start||!t.end)return[];let r=null==u?void 0:u(e);return[{id:String(e.id),ref:String(e.id),subject:n(e),startISO:t.start.toISOString().slice(0,10),endISO:t.end.toISOString().slice(0,10),allDay:!0,color:(0,i.ST)(s.ef,t.status,"solid"),...r?{accent:r}:{}}]}),[t,x,n,u]),y=(0,a.useMemo)(()=>t.filter(e=>!(0,s._U)(e.dueDate)&&!(0,s._U)(e.startDate)).map(e=>{let t=null==u?void 0:u(e);return{id:String(e.id),subject:n(e),...t?{accent:t}:{}}}),[t,n,u]),b=(0,a.useCallback)(e=>{let t=h.get(e);t&&c(t)},[h,c]),m=(0,a.useCallback)((e,t)=>{var n;let r=h.get(e.id);if(!r||!p)return;let a=(0,s.A0)(r,x),l=null!=(n=a.start)?n:a.end;if(!l)return;let i=(0,s.YM)((0,s.ol)(l),(0,s.ol)(new Date("".concat(t.startISO.slice(0,10),"T00:00")))),o=(0,s._f)(r,"move",i);o&&p(r,o)},[h,p,x]);return(0,r.jsx)(o.Vv,{events:v,variant:"full",undated:y,onSelectUndated:b,onSelectEvent:e=>b(e.id),toolbar:(0,r.jsx)(d.X,{}),...p?{onUpdate:m}:{},label:g("calendarLabel")})}},51897:(e,t,n)=>{n.d(t,{Us:()=>u,h5:()=>d,rD:()=>c});var r=n(3625),a=n(65644),l=n(75438),i=n(41602);let s={fetch:()=>(0,a.AT)("/api/integrations/connectable").then(e=>{var t,n;return{providers:null!=(t=e.providers)?t:[],categories:null!=(n=e.categories)?n:[]}})},o="integrations:";function d(){return(0,i.z)("".concat(o,"board-providers"),()=>l.ox.providers())}function c(){let[e,t]=(0,r.useState)({catalog:null,loading:!0,failed:!1});(0,r.useEffect)(()=>{let e=!0;return(0,i.z)("".concat(o,"connectable"),()=>s.fetch()).then(n=>{e&&t({catalog:n,loading:!1,failed:!1})}).catch(()=>{e&&t({catalog:null,loading:!1,failed:!0})}),()=>{e=!1}},[]);let n=(0,r.useMemo)(()=>{var t,n;return new Map((null!=(n=null==(t=e.catalog)?void 0:t.providers)?n:[]).map(e=>[e.id,e]))},[e.catalog]);return{...e,byId:n}}function u(){let[e,t]=(0,r.useState)([]);return(0,r.useEffect)(()=>{let e=!0;return d().then(n=>{e&&t(n)}).catch(()=>void 0),()=>{e=!1}},[]),e}},55330:(e,t,n)=>{n.d(t,{v:()=>Y});var r=n(32957),a=n(3625),l=n(77144),i=n(70307),s=n(97849),o=n(54633),d=n(56229),c=n(44891),u=n(90405),p=n(75438),g=n(34806),x=n(73185),h=n(47014),v=n(62753),y=n(67674),b=n(66774),m=n(64480),f=n(33351);let j="text/plain";function k(e){return"".concat(e.kind,":").concat(e.ref)}var S=n(56985);let w=(0,a.createContext)(null);function C(e){let{children:t}=e,[n,l]=(0,a.useState)(null),i=(0,a.useCallback)((e,t)=>{l(n=>(null==n?void 0:n.id)===e?null:{id:e,title:t})},[]),s=(0,a.useCallback)(()=>l(null),[]),o=(0,a.useMemo)(()=>{var e,t;return{pickedTaskId:null!=(e=null==n?void 0:n.id)?e:null,pickedTitle:null!=(t=null==n?void 0:n.title)?t:null,pick:i,clear:s}},[n,i,s]);return(0,r.jsx)(w.Provider,{value:o,children:t})}function z(){return(0,a.useContext)(w)}function I(e,t,n){if(!(null==e?void 0:e.pickedTaskId))return{};let r=e.pickedTaskId,a=()=>{n(r),e.clear()};return{role:"button",tabIndex:0,"aria-label":t,onClick:a,onKeyDown:e=>
1{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),a())},style:{outline:"2px dashed var(--coral-bright)",outlineOffset:2,cursor:"pointer"}}}function T(e){let{task:t,onOpen:n,compact:a=!1}=e,l=(0,i.c)("ceremony"),s=z(),o=(null==s?void 0:s.pickedTaskId)===t.id;return(0,r.jsxs)("div",{draggable:!0,onDragStart:e=>{e.dataTransfer.setData(j,String(t.id)),e.dataTransfer.effectAllowed="move",function(e,t){try{var n;if("undefined"==typeof document||!(null==(n=e.dataTransfer)?void 0:n.setDragImage))return;let r=document.createElement("div");r.textContent=t,Object.assign(r.style,{position:"fixed",top:"".concat(-1e4,"px"),left:"".concat(-1e4,"px"),maxWidth:"260px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"6px 10px",borderRadius:"var(--radius-md)",border:"1px solid var(--coral-bright)",background:"var(--bg-elevated)",color:"var(--text-primary)",font:"600 12px/1.3 var(--font-sans, system-ui)",boxShadow:"0 6px 20px rgba(0,0,0,0.25)",pointerEvents:"none"}),document.body.appendChild(r),e.dataTransfer.setDragImage(r,12,12),requestAnimationFrame(()=>r.remove())}catch(e){}}(e,t.key?"".concat(t.key," \xb7 ").concat(t.title):t.title)},onClick:()=>null==n?void 0:n(t),style:{background:"var(--bg-base)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:a?"6px 8px":10,cursor:"grab",display:"flex",flexDirection:"column",gap:4,outline:o?"2px solid var(--coral-bright)":void 0,outlineOffset:o?1:void 0},title:t.title,children:[(0,r.jsx)("div",{style:{fontSize:a?12:13,fontWeight:500,color:"var(--text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.title}),(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:10,color:"var(--text-muted)"},children:[(0,r.jsx)("span",{style:{fontFamily:"var(--font-mono)"},children:t.key}),(0,r.jsx)("span",{className:(0,S.Xl)(t.priority),style:{fontSize:9,padding:"1px 6px",borderRadius:"var(--radius-sm)",textTransform:"capitalize"},children:t.priority}),s&&(0,r.jsx)("button",{type:"button","aria-pressed":o,"aria-label":l(o?"putDown":"pickUp",{title:t.title}),onClick:e=>{e.stopPropagation(),s.pick(t.id,t.title)},style:{marginLeft:"auto",padding:"2px 8px",fontSize:10,fontWeight:600,borderRadius:"var(--radius-sm)",border:"1px solid ".concat(o?"var(--coral-bright)":"var(--border-subtle)"),background:o?"var(--surface-coral-soft)":"var(--bg-elevated)",color:o?"var(--coral-bright)":"var(--text-secondary)",cursor:"pointer"},children:l(o?"placeHint":"move")})]})]})}function R(e){let{load:t,cap:n,onClick:a}=e,l=n>0?t/n:1.5*(t>0),i=Math.min(100,Math.round(100*l));return(0,r.jsxs)("button",{type:"button",onClick:a,title:"Load ".concat(t,"/").concat(n," â open scorecard"),style:{width:64,padding:0,border:"none",background:"transparent",cursor:"pointer",display:"flex",flexDirection:"column",alignItems:"center",gap:2},children:[(0,r.jsx)("div",{style:{width:"100%",height:6,borderRadius:"var(--radius-sm)",background:"var(--bg-deep)",border:"1px solid var(--border-subtle)",overflow:"hidden"},children:(0,r.jsx)("div",{style:{width:"".concat(i,"%"),height:"100%",background:l<=.6?"var(--success)":l<=1?"var(--yellow-bright)":"var(--error)",transition:"width 0.2s, background 0.2s"}})}),(0,r.jsxs)("span",{style:{fontSize:9,color:"var(--text-muted)",lineHeight:1},children:[t,"/",n]})]})}var W=n(89031),D=n(61359);function A(e){let{tasks:t,onClick:n}=e,a=(0,i.c)("ceremony.briefcase"),l=(0,D.d)();if(0===t.length)return null;let s=Array.from(new Set(t.map(e=>e.status))).slice(0,5);return(0,r.jsxs)("button",{type:"button",onClick:n,title:a("open",{count:t.length}),style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:"var(--radius-full)",border:"1px solid var(--border-subtle)",background:"var(--bg-elevated)",color:"var(--text-secondary)",cursor:"pointer",fontSize:11,fontWeight:600},children:[(0,r.jsxs)("svg",{viewBox:"0 0 24 24",style:{width:13,height:13,stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"aria-hidden":"true",children:[(0,r.jsx)("rect",{x:"2",y:"7",width:"20",height:"14",rx:"2"}),(0,r.jsx)("path",{d:"M16 7V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v2"})]}),(0,r.jsx)("span",{children:t.length}),(0,r.jsx)("span",{style:{display:"inline-flex",gap:2,marginLeft:2},children:s.map(e=>(0,r.jsx)("span",{className:(0,W.l$)(e),title:l(e),style:{width:6,height:6,borderRadius:"50%",padding:0,display:"inline-block"}},e))})]})}let P={human:"kindHuman",cloud_agent:"kindAgent",host_agent:"kindRemote"};function M(e){let{member:t,stackTasks:n,assignedTasks:l,activeLoad:s,cap:o,present:d,isCurrentTurn:c,showStack:u,onDropTask:p,onOpen:g,onOpenScorec
1ard:x,onOpenAssigned:h}=e,[v,y]=(0,a.useState)(!1),b=(0,i.c)("ceremony"),k=z(),S="human"===t.kind;return(0,r.jsxs)("div",{onDragOver:e=>{e.preventDefault(),y(!0)},onDragLeave:()=>y(!1),onDrop:e=>{e.preventDefault(),y(!1);let t=Number(e.dataTransfer.getData(j));t&&p(t)},...I(k,b("assignTo",{name:t.name}),p),style:{display:"flex",flexDirection:"column",alignItems:"center",gap:4,width:140,padding:8,borderRadius:"var(--radius-lg)",background:v?"var(--surface-coral-soft)":"transparent",border:v?"1px dashed var(--coral-bright)":"1px solid transparent",transition:"background 0.12s, border-color 0.12s"},children:[(0,r.jsx)(R,{load:s,cap:o,onClick:x}),(0,r.jsx)("div",{style:{position:"relative",width:56,height:56,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--bg-elevated)",border:"2px solid ".concat(c?"var(--coral-bright)":d?"var(--cyan-bright)":"var(--border-subtle)"),boxShadow:c?"0 0 16px var(--shadow-coral-mid)":d?"0 0 12px var(--cyan-glow)":"none",...c?{animation:"agentPulse 1.4s ease-in-out infinite"}:{}},title:c?"".concat(t.name," â speaking"):d?"".concat(t.name," â live"):t.name,children:S?(0,r.jsx)(m.s,{label:t.name}):(0,r.jsx)(f.A,{size:28})}),(0,r.jsxs)("div",{style:{textAlign:"center"},children:[(0,r.jsx)("div",{style:{fontSize:12,fontWeight:600,color:"var(--text-primary)",maxWidth:130,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.name}),(0,r.jsx)("div",{style:{fontSize:10,color:"var(--text-muted)"},children:b(P[t.kind])})]}),(0,r.jsx)(A,{tasks:l,onClick:h}),u&&n.length>0&&(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4,width:"100%"},children:[n.slice(0,4).map(e=>(0,r.jsx)(T,{task:e,onOpen:g,compact:!0},e.id)),n.length>4&&(0,r.jsxs)("div",{style:{fontSize:10,color:"var(--text-muted)",textAlign:"center"},children:["+",n.length-4," more"]})]})]})}function H(e){let{tasks:t,title:n,onOpen:l,onReturn:s}=e,[d,c]=(0,a.useState)(!1),u=(0,o.a)(),p=(0,i.c)("ceremony"),g=z();return(0,r.jsxs)("div",{onDragOver:s?e=>{e.preventDefault(),c(!0)}:void 0,onDragLeave:s?()=>c(!1):void 0,onDrop:s?e=>{e.preventDefault(),c(!1);let t=Number(e.dataTransfer.getData(j));t&&s(t)}:void 0,...s?I(g,p("returnToBacklog"),s):{},style:{width:u?"100%":240,flexShrink:0,display:"flex",flexDirection:"column",gap:8,padding:12,borderRadius:"var(--radius-lg)",background:d?"var(--surface-coral-soft)":"var(--bg-deep)",border:"1px ".concat(d?"dashed var(--coral-bright)":"solid var(--border-subtle)"),maxHeight:u?260:"100%",overflowY:"auto"},children:[(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,r.jsx)("span",{style:{fontSize:12,fontWeight:700,color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:.4},children:n}),(0,r.jsx)("span",{style:{fontSize:12,color:"var(--text-muted)"},children:t.length})]}),0===t.length?(0,r.jsx)("div",{style:{fontSize:12,color:"var(--text-muted)",padding:"12px 0",textAlign:"center"},children:p("nothingHere")}):t.map(e=>(0,r.jsx)(T,{task:e,onOpen:l},e.id))]})}var B=n(5337),E=n(84026);function L(e){let{epic:t,childCount:n,onDropTask:l,onOpen:s}=e,[o,d]=(0,a.useState)(!1),c=(0,i.c)("ceremony"),u=z();return(0,r.jsxs)("div",{onDragOver:e=>{e.preventDefault(),d(!0)},onDragLeave:()=>d(!1),onDrop:e=>{e.preventDefault(),d(!1);let n=Number(e.dataTransfer.getData(j));n&&n!==t.id&&l(n)},onClick:()=>s(t),...I(u,c("groupIntoEpic",{title:t.title}),e=>{e!==t.id&&l(e)}),style:{padding:10,borderRadius:"var(--radius-lg)",cursor:"pointer",background:o?"var(--surface-coral-soft)":"var(--bg-base)",border:"1px ".concat(o?"dashed var(--coral-bright)":"solid var(--border-subtle)"),display:"flex",flexDirection:"column",gap:4},title:t.title,children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,r.jsx)("span",{"aria-hidden":!0,children:(0,r.jsx)(B.I,{source:"\uD83D\uDDC2ï¸",size:"1em"})}),(0,r.jsx)("span",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.title})]}),(0,r.jsx)("div",{style:{fontSize:11,color:"var(--text-muted)"},children:c("taskCount",{count:n})})]})}function K(e){let{epics:t,childCountByEpic:n,onDropToEpic:l,onCreateEpic:s,onOpen:d}=e,c=(0,o.a)(),u=(0,i.c)("ceremony"),[p,g]=(0,a.useState)(!1);return(0,r.jsxs)("div",{style:{width:c?"100%":240,flexShrink:0,display:"flex",flexDirection:"column",gap:8,padding:12,borderRadius:"var(--radius-lg)",background:"var(--bg-deep)",border:"1px solid var(--border-subtle)",maxHeight:c?260:"100%",overflowY:"auto"},children:[(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,r.jsx)("span",{style:{fontSize:12,fontWeight:700,color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:.4},children:u("epics")}),(0,r.jsx)("button",{type:"button",onClick:()=>g(!0),style:{fontSize:12,fontWeight:600,color:"var(--coral-bright)",background:"none",border:"none",cursor:"pointer"},children:u("newShort")})]}),p&&(0,r.jsx)(E.InlineNameForm,{placeholder:u("newEpicPrompt"),submitLabel:u("createEpic"),onSubmit:async e=>{await s(e),g(!1)},onCancel:()=>g(!1)}),0===t.length?(0,r.jsx)("div",{style:{fontSize:12,color:"var(--text-muted)",padding:"12px 0",textAlign:"center"},children:u("noEpics")}):t.map(e=>{var t;return(0,r.jsx)(L,{epic:e,childCount:null!=(t=n.get(e.id))?t:0,onDropTask:t=>l(t,e.id),onOpen:d},e.id)})]})}var F=n(96056);let N=e=>({padding:"6px 12px",fontSize:13,fontWeight:600,borderRadius:"var(--radius-md)",cursor:"pointer",border:"primary"===e?"none":"1px solid var(--border-subtle)",background:"primary"===e?"linear-gradient(135deg, var(--coral-bright), var(--coral-dark))":"var(--bg-deep)",color:"primary"===e?"var(--text-on-accent)":"var(--text-secondary)"});function _(e){var t,n;let{session:l,participants:s,isFacilitator:o,busy:d,onStart:c,onNext:u,onComplete:p,onPauseTurn:g,onResumeTur
1n:x}=e,h=(0,i.c)("ceremony"),[,v]=(0,a.useState)(0),y=(0,a.useRef)(""),b=(null==l?void 0:l.status)==="active";if((0,a.useEffect)(()=>{if(!b)return;let e=setInterval(()=>v(e=>e+1),1e3);return()=>clearInterval(e)},[b]),!l||"active"!==l.status)return(0,r.jsx)("button",{type:"button",style:N("primary"),disabled:d||!o,onClick:c,title:h(o?"startSessionHint":"startSessionFacilitatorOnly"),children:h("startSession")});let m=Date.now(),f=m-new Date(l.startedAt).getTime(),j=null!=(t=l.currentTurn)?t:0,k=null!=(n=s.find(e=>e.turnOrder===j))?n:s[j],S=null!=l.currentTurn&&!l.turnStartedAt,w=l.turnStartedAt?m-new Date(l.turnStartedAt).getTime():0,C=j>=s.length-1,z="timeboxed"!==l.turnMode||S?null:1e3*l.turnSeconds-w;if(o&&!d&&!S&&null!=z&&z<=0){let e="".concat(l.id,":").concat(j);y.current!==e&&(y.current=e,C?p():u(j+1))}return(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,flexWrap:"wrap"},children:[(0,r.jsx)("span",{style:{fontSize:13,fontWeight:700,color:"var(--text-primary)",fontFamily:"var(--font-mono)"},children:(0,F.a3)(f)}),k&&(0,r.jsxs)("span",{style:{fontSize:13,color:"var(--text-secondary)"},children:[(0,r.jsx)(B.I,{source:"\uD83C\uDFA4",size:"1em"})," ",(0,r.jsx)("strong",{style:{color:"var(--text-primary)"},children:k.memberName}),(0,r.jsx)("span",{style:{marginLeft:6,fontFamily:"var(--font-mono)",color:null!=z&&z<=1e4?"var(--error)":"var(--text-muted)"},children:null!=z?(0,F.a3)(Math.max(0,z)):(0,F.a3)(w)}),S&&(0,r.jsx)("span",{style:{marginLeft:6,fontSize:11,fontWeight:700,color:"var(--warning-text)"},children:h("turnPaused")})]}),o&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",style:N("tertiary"),disabled:d,onClick:S?x:g,title:h(S?"resumeTurnHint":"pauseTurnHint"),children:h(S?"resumeTurn":"pauseTurn")}),!C&&(0,r.jsxs)("button",{type:"button",style:N("tertiary"),disabled:d,onClick:()=>u(j+1),children:[h("nextSpeaker")," â"]}),(0,r.jsx)("button",{type:"button",style:N("primary"),disabled:d,onClick:p,children:h("completeSession")})]})]})}var O=n(38613);function q(e){let{label:t,value:n,hint:a}=e,l=null==n||""===n;return(0,r.jsxs)("div",{style:{background:"var(--bg-deep)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-lg)",padding:12},children:[(0,r.jsx)("div",{style:{fontSize:11,color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:.4},children:t}),(0,r.jsx)("div",{style:{fontSize:18,fontWeight:700,color:l?"var(--text-muted)":"var(--text-primary)",marginTop:2},children:l?"No data yet":n}),a&&(0,r.jsx)("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:2},children:a})]})}function U(e){var t,n,l,i,s;let{member:o}=e,d=(0,O.b)(),[c,u]=(0,a.useState)(null),[g,x]=(0,a.useState)(null),[h,v]=(0,a.useState)(!0),[y,b]=(0,a.useState)(null);if((0,a.useEffect)(()=>{let e=!0;return v(!0),b(null),Promise.all([p.eI.metrics(7).then(e=>e.members).catch(()=>[]),p.eI.profiles().then(e=>e.profiles).catch(()=>[])]).then(t=>{var n,r;let[a,l]=t;e&&(u(null!=(n=a.find(e=>e.memberKind===o.kind&&e.memberRef===o.ref))?n:null),x(null!=(r=l.find(e=>e.memberKind===o.kind&&e.memberRef===o.ref))?r:null))}).catch(t=>{e&&b(d(t))}).finally(()=>{e&&v(!1)}),()=>{e=!1}},[o.kind,o.ref,d]),h)return(0,r.jsx)("div",{style:{padding:16,color:"var(--text-muted)",fontSize:13},children:"Loading scorecardâ¦"});if(y)return(0,r.jsx)("div",{style:{padding:16,color:"var(--error-text)",fontSize:13},children:y});let m=e=>Array.isArray(e)?e.filter(e=>"string"==typeof e):[],f=m(null==g?void 0:g.skills),j=m(null==g?void 0:g.focusAreas);return(0,r.jsxs)("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:14},children:[(0,r.jsxs)("div",{style:{fontSize:12,color:"var(--text-muted)"},children:["Last 7 days \xb7 ",o.name]}),(0,r.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},children:[(0,r.jsx)(q,{label:"Capacity (WIP)",value:null!=(t=null==g?void 0:g.maxConcurrentWip)?t:null,hint:(null==g?void 0:g.dailyCapacityPoints)!=null?"".concat(g.dailyCapacityPoints," pts/day"):void 0}),(0,r.jsx)(q,{label:"Assigned",value:null!=(n=null==c?void 0:c.assignedCount)?n:null}),(0,r.jsx)(q,{label:"Completed",value:null!=(l=null==c?void 0:c.completedCount)?l:null}),(0,r.jsx)(q,{label:"Cycle time",value:c?(0,F.BG)(c.avgCycleTimeHours):null,hint:"first in-progress â done"}),(0,r.jsx)(q,{label:"Redo",value:null!=(i=null==c?void 0:c.redoCount)?i:null,hint:"backward lane moves"}),(0,r.jsx)(q,{label:"Reopen",value:null!=(s=null==c?void 0:c.reopenCount)?s:null,hint:"bounced out of done"}
1),(0,r.jsx)(q,{label:"Pickup latency",value:c?(0,F.BG)(c.avgPickupLatencyHours):null,hint:"assigned â started (human)"}),(0,r.jsx)(q,{label:"Board hygiene",value:(null==c?void 0:c.boardHygieneScore)!=null?Math.round(c.boardHygieneScore):null,hint:"0â100 (human)"}),(0,r.jsx)(q,{label:"Effectiveness",value:(null==c?void 0:c.effectivenessScore)!=null?Math.round(c.effectivenessScore):null}),(0,r.jsx)(q,{label:"Engagement",value:(null==c?void 0:c.engagementScore)!=null?Math.round(c.engagementScore):null,hint:"human board behaviour"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{style:{fontSize:11,color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:.4,marginBottom:6},children:"Specialization"}),f.length+j.length>0?(0,r.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:[...f,...j].map((e,t)=>(0,r.jsx)("span",{className:"badge-blue",style:{fontSize:11},children:e},"".concat(e,"-").concat(t)))}):(0,r.jsx)("div",{style:{fontSize:13,color:"var(--text-muted)"},children:"No data yet"})]})]})}function V(e){let{member:t,tasks:n,onOpenTask:l}=e,s=(0,i.c)("ceremony.assignedWork"),o=(0,D.d)(),d=(0,a.useMemo)(()=>{let e=new Map;for(let r of n){var t;let n=null!=(t=e.get(r.status))?t:[];n.push(r),e.set(r.status,n)}return[...e.entries()].sort((e,t)=>{let n=W.Hi.indexOf(e[0]),r=W.Hi.indexOf(t[0]);return n!==r?(n<0?Number.MAX_SAFE_INTEGER:n)-(r<0?Number.MAX_SAFE_INTEGER:r):e[0].localeCompare(t[0])})},[n]);return(0,r.jsxs)("div",{style:{padding:16,display:"flex",flexDirection:"column",gap:14},children:[(0,r.jsx)("div",{style:{fontSize:12,color:"var(--text-muted)"},children:s("assignedTo",{count:n.length,name:t.name})}),0===n.length?(0,r.jsx)("div",{style:{fontSize:13,color:"var(--text-muted)"},children:s("empty")}):d.map(e=>{let[t,n]=e;return(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[(0,r.jsxs)("div",{style:{fontSize:11,fontWeight:700,color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:.4},children:[o(t)," \xb7 ",n.length]}),n.map(e=>(0,r.jsx)(T,{task:e,onOpen:l},e.id))]},t)})]})}var G=n(65644);let X=new Set(["in_progress","in_review","ready"]);async function Q(e){try{let t=await (0,g.Jw)(e);if(t.length>0){let e=await Promise.all(t.map(e=>(0,g.Uo)(e.id))),n=new Map;for(let t of e)for(let e of t.members)n.set("".concat(e.memberKind,":").concat(e.memberRef),{kind:e.memberKind,ref:e.memberRef,name:e.memberName});if(n.size>0)return[...n.values()]}}catch(e){}return(await (0,g.WB)().catch(()=>[])).map(e=>({kind:e.kind,ref:e.ref,name:e.name}))}let J=new Set(["in_progress","in_review"]);function Y(e){return(0,r.jsx)(C,{children:(0,r.jsx)($,{...e})})}function $(e){var t,n,g,m,f;let{projectId:S,mode:w,onModeChange:C,onClose:T}=e,{user:R,tenant:W}=(0,x.A)(),D=(0,i.c)("meetings"),A=(0,i.c)("ceremony"),P=z(),B=(0,o.a)(),[L,F]=(0,a.useState)(!1),[N,O]=(0,a.useState)([]),[q,Y]=(0,a.useState)([]),[$,Z]=(0,a.useState)([]),[ee,et]=(0,a.useState)(""),[en,er]=(0,a.useState)(!0),[ea,el]=(0,a.useState)(null),[ei,es]=(0,a.useState)(null),[eo,ed]=(0,a.useState)({}),[ec,eu]=(0,a.useState)(null),[ep,eg]=(0,a.useState)([]),[ex,eh]=(0,a.useState)(!1),[ev,ey]=(0,a.useState)([]),[eb,em]=(0,a.useState)(null),[ef,ej]=(0,a.useState)(null),ek=(0,a.useCallback)(async()=>{er(!0);try{var e,t;let[n,r,a,l,i]=await Promise.all([p.bI.list(S),p.cO.list(S).catch(()=>[]),Q(S),p._c.active(S,w).catch(()=>({session:null})),p.eI.profiles().then(e=>e.profiles).catch(()=>[])]);O(n),Z(r),Y(a),eu(null!=(e=l.session)?e:null),eg(null!=(t=l.participants)?t:[]),ey(i),et(e=>{var t,n;return e||(null==(t=r.find(e=>"active"===e.status))?void 0:t.id)||(null==(n=r[0])?void 0:n.id)||""})}catch(e){el((0,G.yR)(e,A("errorLoad")))}finally{er(!1)}},[S,w,A]);(0,a.useEffect)(()=>{ek()},[ek]);let eS=(0,a.useMemo)(()=>{var e,t,n;return{kind:"human",ref:null!=(e=null==R?void 0:R.id)?e:"",name:null!=(n=null!=(t=null==R?void 0:R.name)?t:null==R?void 0:R.email)?n:"You"}},[null==R?void 0:R.id,null==R?void 0:R.name,null==R?void 0:R.email]),{peers:ew,connected:eC,send:ez}=function(e,t,n){let{onChange:r,onFrame:l}=n,[i,s]=(0,a.useState)([]),[o,d]=(0,a.useState)(null),[c,u]=(0,a.useState)(!1),p=(0,a.useRef)(null),g=(0,a.useRef)(t);(0,a.useEffect)(()=>{g.current=t},[t]);let x=(0,a.useCallback)(e=>{s(t=>{let n=t.filter(t=>t.id!==e.id);return n.push(e),n})},[]);return(0,a.useEffect)(()=>
1{if(null==e)return;let t=(0,h.pI)();if(!t)return;let n=(0,v.j)("/api/agile/ceremonies/rooms/".concat(e,"/ws"),{token:t}),a=!1,i=null,o=null,c=()=>{if(!a){try{i=new WebSocket(n)}catch(e){o=setTimeout(c,2e3);return}p.current=i,i.onopen=()=>{u(!0);try{null==i||i.send(JSON.stringify({type:"join",...g.current}))}catch(e){}},i.onmessage=e=>{let t;try{t=JSON.parse("string"==typeof e.data?e.data:"")}catch(e){return}if(t&&"string"==typeof t.type)switch(t.type){case"hello":var n;d(String(null!=(n=t.id)?n:""));break;case"roster":s(Array.isArray(t.peers)?t.peers:[]);break;case"presence":if("join"===t.action&&t.peer)x(t.peer);else if("leave"===t.action&&t.peer){let e=t.peer.id;s(t=>t.filter(t=>t.id!==e))}break;case"changed":r();break;default:null==l||l(t)}},i.onclose=()=>{u(!1),a||(o=setTimeout(c,2e3))},i.onerror=()=>{try{null==i||i.close()}catch(e){}}}};return c(),()=>{a=!0,o&&clearTimeout(o),u(!1),s([]),d(null);try{null==i||i.close()}catch(e){}p.current=null}},[e,r,l,x]),{peers:i,myId:o,connected:c,send:(0,a.useCallback)(e=>{let t=p.current;if(t&&t.readyState===WebSocket.OPEN)try{t.send(JSON.stringify(e))}catch(e){}},[])}}(S,eS,{onChange:ek,onFrame:(0,a.useCallback)(e=>{"cursor"===e.type&&e.from&&ed(t=>{var n;return{...t,[e.from]:{x:Number(e.x),y:Number(e.y),name:String(null!=(n=e.name)?n:""),at:Date.now()}}})},[])}),eI=null!=(t=null==ec?void 0:ec.meetingRoomKey)?t:"ceremony-".concat(S),eT=(0,d.yT)(),eR=(0,a.useCallback)(()=>F(!1),[]);(0,a.useEffect)(()=>{var e;L&&eT.start({roomKey:eI,label:A("standup"===w?"standup":"planning"),tenantId:null!=(e=null==W?void 0:W.id)?e:null,href:"/projects?tab=ceremonies",participant:{name:eS.name,ref:eS.ref},privacyMode:"direct-only",onLeave:eR})},[L,eS.name,eS.ref,eT.start,eI,w,eR,A,null==W?void 0:W.id]);let eW=(0,a.useCallback)(()=>{var e;(null==(e=eT.room)?void 0:e.roomKey)===eI&&eT.leave(),F(!1)},[eT,eI]),eD=(0,a.useMemo)(()=>{let e=new Set(ew.map(e=>k(e)));return eC&&eS.ref&&e.add(k(eS)),e},[ew,eC,eS]),eA=(null==ec?void 0:ec.status)==="active"?ec.id:null;(0,l.c)(()=>eA?p._c.heartbeat(eA):void 0,{intervalMs:6e4,enabled:!!eA&&eC,pauseWhenHidden:!1,restartKey:eA}),(0,a.useEffect)(()=>{let e=setInterval(()=>{ed(e=>{let t=Date.now(),n={};for(let[r,a]of Object.entries(e))t-a.at<4e3&&(n[r]=a);return n})},2e3);return()=>clearInterval(e)},[]);let eP=(0,a.useMemo)(()=>N.filter(e=>"epic"===e.taskType),[N]),eM=(0,a.useMemo)(()=>{var e;let t=new Map;for(let n of N)null!=n.parentTaskId&&t.set(n.parentTaskId,(null!=(e=t.get(n.parentTaskId))?e:0)+1);return t},[N]),eH=(0,a.useMemo)(()=>N.filter(e=>"epic"!==e.taskType&&null==e.assignedUserId&&null==e.assignedAgentRef&&null==e.assignedAgentHostId),[N]),eB=(0,a.useCallback)(e=>N.filter(t=>"human"===e.kind?t.assignedUserId===e.ref:"cloud_agent"===e.kind?t.assignedAgentRef===e.ref:t.assignedAgentHostId===Number(e.ref)),[N]),eE=(0,a.useCallback)(e=>{let t=eB(e);return"standup"===w?t.filter(e=>J.has(e.status)):t},[eB,w]),eL=null!=(n=null==ec?void 0:ec.defaultMemberWipCap)?n:8,eK=(0,a.useMemo)(()=>{var e;let t=new Map;for(let n of ev)t.set(k({kind:n.memberKind,ref:n.memberRef}),null!=(e=n.maxConcurrentWip)?e:eL);return t},[ev,eL]),eF=(0,a.useMemo)(()=>{if((null==ec?void 0:ec.currentTurn)==null)return null;let e=ep.find(e=>e.turnOrder===ec.currentTurn);return e?k({kind:e.memberKind,ref:e.memberRef}):null},[null==ec?void 0:ec.currentTurn,ep]),eN=!ec||ec.facilitatorId===(null!=(g=null==R?void 0:R.id)?g:""),e_=(0,a.useCallback)(async(e,t)=>{try{let n=await p.bI.update(e,t);O(t=>t.map(t=>t.id===e?n:t)),es(t=>(null==t?void 0:t.id)===e?n:t)}catch(e){el((0,G.yR)(e,A("errorUpdate")))}},[A]),eO=(0,a.useCallback)((e,t)=>e_(e,"human"===t.kind?{assignedUserId:t.ref,assignedAgentRef:null,assignedAgentHostId:null}:"cloud_agent"===t.kind?{assignedAgentRef:t.ref,assignedUserId:null,assignedAgentHostId:null}:{assignedAgentHostId:Number(t.ref),assignedUserId:null,assignedAgentRef:null}),[e_]),eq=(0,a.useCallback)((e,t)=>e_(e,{parentTaskId:t}),[e_]),eU=(0,a.useCallback)((e,t)=>e_(e,{sprintId:t}),[e_]),eV=(0,a.useCallback)(e=>e_(e,{assignedUserId:null,assignedAgentRef:null,assignedAgentHostId:null}),[e_]),eG=(0,a.useCallback)((e,t)=>e_(e,{status:t}),[e_]),eX=(0,a.useCallback)(async e=>{try{let t=await p.bI.create({projectId:S,title:e,taskType:"epic"});O(e=>[t,...e])}catch(e){el((0,G.yR)(e,A("errorCreateEpic")))}},[S,A]),[eQ,eJ]=(0,a.useState)(!1),eY=(0,a.useCallback)(async e=>{try{let t=await p.cO.create({name:e,status:"active",projectId:S});Z(e=>[t,...e]),et(t.id),eJ(!1)}catch(e){el((0,G.yR)(e,A("errorCreateSprint")))}},[S,A]),e$=(0,a.useCallback)(e=>{var t,n;eu(null!=(t=e.session)?t:null),eg(null!=(n=e.participants)?n:[])},[]),eZ=(0,a.useCallback)(async()=>{eh(!0);try{let e=q.map(e=>({kind:e.kind,ref:e.ref,name:e.name}));e$(await p._c.start(S,w,e))}catch(e){el((0,G.yR)(e,A("errorStart")))}finally{eh(!1)}},[q,S,w,e$,A]),e0=(0,a.useCallback)(async e=>{if(ec){eh(!0);try{e$(await p._c.advanceTurn(ec.id,e))}catch(e){el((0,G.yR)(e,A("errorAdvance")))}finally{eh(!1)}}},[ec,e$,A]),e1=(0,a.useCallback)(async e=>{if(ec){eh(!0);try{e$(e?await p._c.pauseTurn(ec.id):await p._c.resumeTurn(ec.id))}catch(e){el((0,G.yR)(e,A("errorAdvance")))}finally{eh(!1)}}},[ec,e$,A]),e2=(0,a.useCallback)(async()=>
1{if(ec){eh(!0);try{e$(await p._c.complete(ec.id)),ek()}catch(e){el((0,G.yR)(e,A("errorComplete")))}finally{eh(!1)}}},[ec,e$,ek,A]),e6=(0,a.useRef)(0),e3=(0,a.useCallback)(e=>{let t=Date.now();if(t-e6.current<60)return;e6.current=t;let n=e.currentTarget.getBoundingClientRect();ez({type:"cursor",x:(e.clientX-n.left)/n.width*100,y:(e.clientY-n.top)/n.height*100,name:eS.name})},[ez,eS.name]),e8=null!=(m=$.find(e=>e.id===ee))?m:null,e4=ee?N.filter(e=>e.sprintId===ee).length:0;return(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:12,height:"100%",minHeight:0},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:12},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12},children:[(0,r.jsx)(y.a,{value:w,onChange:e=>C(e),options:[{value:"standup",label:A("standup")},{value:"planning",label:A("planning")}]}),(0,r.jsxs)("span",{style:{fontSize:12,color:"var(--text-muted)"},children:[A("atTable",{count:q.length}),eC&&(0,r.jsxs)("span",{style:{marginLeft:8,color:"var(--cyan-bright)"},children:["â ",A("live",{count:ew.length+1})]})]})]}),(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,flexWrap:"wrap"},children:[(0,r.jsxs)("button",{type:"button",onClick:()=>{L?eW():F(!0)},"aria-pressed":L,style:{display:"inline-flex",alignItems:"center",gap:6,padding:"6px 12px",fontSize:13,fontWeight:600,borderRadius:"var(--radius-md)",cursor:"pointer",background:L?"var(--coral-bright)":"var(--bg-deep)",color:L?"var(--bg-deep)":"var(--text-secondary)",border:"1px solid ".concat(L?"var(--coral-bright)":"var(--border-subtle)")},children:[(0,r.jsxs)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("path",{d:"M23 7l-7 5 7 5V7z"}),(0,r.jsx)("rect",{x:"1",y:"5",width:"15",height:"14",rx:"2",ry:"2"})]}),D(L?"cameraOn":"joinWithCamera")]}),q.length>0&&(0,r.jsx)(_,{session:ec,participants:ep,isFacilitator:eN,busy:ex,onStart:eZ,onNext:e0,onComplete:e2,onPauseTurn:()=>e1(!0),onResumeTurn:()=>e1(!1)}),T&&(0,r.jsx)("button",{type:"button",onClick:T,style:{padding:"6px 12px",fontSize:13,fontWeight:600,background:"var(--bg-deep)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",cursor:"pointer"},children:A("close")})]})]}),ea&&(0,r.jsx)("div",{style:{padding:"8px 12px",borderRadius:"var(--radius-md)",background:"var(--error-bg)",border:"1px solid var(--error-border)",color:"var(--error-text)",fontSize:13},children:ea}),L&&(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8,padding:10,borderRadius:"var(--radius-lg)",background:"var(--bg-deep)",border:"1px solid var(--border-subtle)"},children:[eT.mediaError?(0,r.jsx)("div",{style:{fontSize:12,color:"var(--error-text)"},children:D("cameraError",{error:eT.mediaError})}):(0,r.jsx)(c.Y,{self:{name:eS.name,stream:eT.localStream,camOn:eT.camOn,micOn:eT.micOn},tiles:eT.tiles,compact:!0}),(0,r.jsx)("div",{style:{display:"flex",justifyContent:"center"},children:(0,r.jsx)(u.t,{camOn:eT.camOn,micOn:eT.micOn,onToggleCam:eT.toggleCam,onToggleMic:eT.toggleMic,onLeave:eW})}),(0,r.jsx)("div",{title:eT.mediaPaths.map(e=>"".concat(e.localCandidateType," â ").concat(e.remoteCandidateType)).join("\n"),style:{textAlign:"center",fontSize:11,color:"var(--text-muted)"},children:eT.mediaPaths.length?"Direct ICE path verified \xb7 ".concat(eT.mediaPaths.length):"Direct-only media \xb7 TURN disabled"})]}),en?(0,r.jsx)("div",{style:{color:"var(--text-muted)",fontSize:13},children:A("loading")}):(0,r.jsxs)("div",{style:{display:"flex",flexDirection:B?"column":"row",gap:12,flex:1,minHeight:0},children:[(0,r.jsx)(H,{tasks:eH,title:"standup"===w?A("toDiscuss"):A("backlog"),onOpen:es,onReturn:eV}),(0,r.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:8,minWidth:0},children:["planning"===w&&(0,r.jsxs)("div",{onDragOver:ee?e=>e.preventDefault():void 0,onDrop:ee?e=>{e.preventDefault();let t=Number(e.dataTransfer.getData(j));t&&eU(t,ee)}
1:void 0,...ee?I(P,A("scheduleIntoSprint"),e=>eU(e,ee)):{},style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",borderRadius:"var(--radius-lg)",background:"var(--bg-deep)",border:"1px dashed var(--border-subtle)"},children:[(0,r.jsx)("span",{style:{fontSize:12,fontWeight:700,color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:.4},children:A("sprint")}),$.length>0?(0,r.jsx)(s.l,{value:ee,onChange:e=>et(e.target.value),style:{fontSize:13,padding:"4px 8px",borderRadius:"var(--radius-sm)",background:"var(--bg-base)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)"},children:$.map(e=>(0,r.jsxs)("option",{value:e.id,children:[e.name," (",e.status,")"]},e.id))}):(0,r.jsx)("span",{style:{fontSize:12,color:"var(--text-muted)"},children:A("noSprint")}),e8&&(0,r.jsx)("span",{style:{fontSize:12,color:"var(--text-muted)"},children:A("sprintScheduled",{count:e4})}),eQ?(0,r.jsx)("div",{style:{marginLeft:"auto",minWidth:0},children:(0,r.jsx)(E.InlineNameForm,{placeholder:A("newSprintPrompt"),submitLabel:A("createSprint"),onSubmit:eY,onCancel:()=>eJ(!1)})}):(0,r.jsx)("button",{type:"button",onClick:()=>eJ(!0),style:{marginLeft:"auto",fontSize:12,fontWeight:600,color:"var(--coral-bright)",background:"none",border:"none",cursor:"pointer"},children:A("newSprint")})]}),(0,r.jsxs)("div",{onMouseMove:B?void 0:e3,style:{position:"relative",flex:1,minHeight:B?"auto":360,borderRadius:"var(--radius-xl)",background:"radial-gradient(circle at 50% 50%, var(--surface-card), var(--bg-deep))",border:"1px solid var(--border-subtle)",overflow:"hidden",...B?{display:"flex",flexWrap:"wrap",gap:8,justifyContent:"center",alignContent:"flex-start",padding:12}:{}},children:[(0,r.jsxs)("div",{onDragOver:"standup"===w?e=>e.preventDefault():void 0,onDrop:"standup"===w?e=>{e.preventDefault();let t=Number(e.dataTransfer.getData(j));t&&eG(t,"done")}:void 0,..."standup"===w?I(P,A("markDone"),e=>eG(e,"done")):{},style:B?{flexBasis:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:8,padding:"8px 12px",borderRadius:"var(--radius-lg)",background:"var(--bg-elevated)",border:"1px solid var(--border-subtle)",textAlign:"center"}:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:160,height:160,borderRadius:"50%",background:"var(--bg-elevated)",border:"1px solid var(--border-subtle)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:4,textAlign:"center",padding:12},children:[(0,r.jsx)("span",{style:{fontSize:13,fontWeight:700,color:"var(--text-primary)"},children:A(w)}),"standup"===w?B?null:(0,r.jsx)("span",{style:{fontSize:11,color:"var(--text-muted)"},children:A("dropToDone")}):(0,r.jsx)("span",{style:{fontSize:11,color:"var(--text-muted)"},children:A("inBacklog",{count:eH.length})})]}),q.map((e,t)=>{var n;let a=k(e),l=eB(e),i=(0,r.jsx)(M,{member:e,stackTasks:eE(e),assignedTasks:l,activeLoad:l.filter(e=>X.has(e.status)).length,cap:null!=(n=eK.get(a))?n:eL,present:eD.has(a),isCurrentTurn:eF===a,showStack:"standup"===w,onDropTask:t=>eO(t,e),onOpen:es,onOpenScorecard:()=>em(e),onOpenAssigned:()=>ej(e)});if(B)return(0,r.jsx)("div",{children:i},a);let s=2*Math.PI*t/Math.max(q.length,1)-Math.PI/2,o=50+42*Math.cos(s),d=50+40*Math.sin(s);return(0,r.jsx)("div",{style:{position:"absolute",left:"".concat(o,"%"),top:"".concat(d,"%"),transform:"translate(-50%, -50%)"},children:i},a)}),0===q.length&&(0,r.jsx)("div",{style:B?{flexBasis:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-muted)",fontSize:13,padding:"24px 0",textAlign:"center"}:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-muted)",fontSize:13},children:A("noMembers")}),Object.entries(eo).map(e=>{let[t,n]=e;return(0,r.jsxs)("div",{style:{position:"absolute",left:"".concat(n.x,"%"),top:"".concat(n.y,"%"),transform:"translate(-2px, -2px)",pointerEvents:"none",zIndex:5},children:[(0,r.jsx)("div",{style:{width:8,height:8,borderRadius:"50%",background:"var(--cyan-bright)",boxShadow:"0 0 8px var(--cyan-glow)"}}
1),(0,r.jsx)("span",{style:{fontSize:10,color:"var(--cyan-bright)",background:"var(--bg-deep)",padding:"1px 4px",borderRadius:"var(--radius-sm)",whiteSpace:"nowrap"},children:n.name})]},t)})]})]}),"planning"===w&&(0,r.jsx)(K,{epics:eP,childCountByEpic:eM,onDropToEpic:eq,onCreateEpic:eX,onOpen:es})]}),(0,r.jsx)(b.M,{open:!!ei,onClose:()=>es(null),title:null!=(f=null==ei?void 0:ei.title)?f:"",widthStorageKey:"ceremony-task-detail",children:ei&&(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:10,padding:16,fontSize:13,color:"var(--text-secondary)"},children:[(0,r.jsx)("div",{style:{fontFamily:"var(--font-mono)",color:"var(--text-muted)"},children:ei.key}),(0,r.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,r.jsx)("span",{style:{textTransform:"capitalize"},children:A("priority",{priority:ei.priority})}),(0,r.jsxs)("span",{style:{textTransform:"capitalize"},children:["\xb7 ",A("status",{status:ei.status})]})]}),ei.description&&(0,r.jsx)("p",{style:{color:"var(--text-primary)",whiteSpace:"pre-wrap"},children:ei.description}),(0,r.jsx)("a",{href:"/projects?tab=tasks&project=".concat(ei.projectId),style:{color:"var(--coral-bright)",fontWeight:600,textDecoration:"none"},children:A("openOnBoard")})]})}),(0,r.jsx)(b.M,{open:!!eb,onClose:()=>em(null),title:eb?A("scorecardTitle",{name:eb.name}):"",widthStorageKey:"ceremony-scorecard",children:eb&&(0,r.jsx)(U,{member:eb})}),(0,r.jsx)(b.M,{open:!!ef,onClose:()=>ej(null),title:ef?A("assignedTitle",{name:ef.name}):"",widthStorageKey:"ceremony-assigned-work",children:ef&&(0,r.jsx)(V,{member:ef,tasks:eB(ef),onOpenTask:e=>{ej(null),es(e)}})})]})}},55602:(e,t,n)=>{n.d(t,{Gf:()=>s,aL:()=>o,oz:()=>a,zn:()=>l});let r="bf-chunk-reload-at";function a(e){var t;if(!e)return!1;if("ChunkLoadError"===e.name)return!0;let n=String(null!=(t=e.message)?t:e);return/Loading chunk [\w-]+ failed/i.test(n)||/Failed to load chunk\b/i.test(n)||/Loading CSS chunk/i.test(n)||/ChunkLoadError/i.test(n)||/\.undefined\.js/i.test(n)||/importScripts|Failed to fetch dynamically imported module/i.test(n)||/module factory is not available/i.test(n)||/deleted in an HMR update/i.test(n)}function l(){try{let e=Number(sessionStorage.getItem(r)||"0");return e>0&&Date.now()-e<3e4}catch(e){return!1}}async function i(){try{if("undefined"!=typeof caches){let e=await caches.keys();await Promise.all(e.map(e=>caches.delete(e)))}}catch(e){}try{if("undefined"!=typeof navigator&&"serviceWorker"in navigator){let e=await navigator.serviceWorker.getRegistrations();await Promise.all(e.map(e=>e.unregister()))}}catch(e){}}async function s(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!(!e&&l())){try{sessionStorage.setItem(r,String(Date.now()))}catch(e){}await i(),window.location.reload()}}function o(){let e=e=>{a(e.reason)&&s()},t=e=>{var t;a(null!=(t=e.error)?t:e.message)&&s()};return window.addEventListener("unhandledrejection",e),window.addEventListener("error",t),()=>{window.removeEventListener("unhandledrejection",e),window.removeEventListener("error",t)}}},56985:(e,t,n)=>{n.d(t,{HO:()=>a,PN:()=>r,Xl:()=>i});let r=["low","medium","high","urgent"],a=["urgent","high","medium","low"],l={low:"badge-gray",medium:"badge-blue",high:"badge-yellow",urgent:"badge-red"};function i(e){var t;return null!=(t=l[e])?t:"badge-gray"}},66350:(e,t,n)=>{n.r(t),n.d(t,{TaskMgmtContent:()=>te});var r=n(32957),a=n(5337),l=n(24627),i=n(97849),s=n(3625),o=n(31917),d=n.n(o),c=n(29102),u=n(70307),p=n(62592),g=n(2272),x=n(75438),h=n(6808),v=n(79432),y=n(34806),b=n(34863),m=n(330),f=n(66774),j=n(317),k=n(38613);function S(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=(0,k.b)(),[r,a]=(0,s.use
1State)(null),[l,i]=(0,s.useState)([]),[o,d]=(0,s.useState)({}),[c,u]=(0,s.useState)(null),[p,g]=(0,s.useState)(!1),[h,v]=(0,s.useState)(null),y=(0,s.useCallback)(async()=>{if(null==e){a(null),i([]),d({});return}g(!0),v(null);try{var t;let{boards:n,cloudRunAllowance:r}=await x.G0.listWithAllowance();u(r);let l=null!=(t=n.find(t=>t.projectId===e))?t:null;if(a(l),l){let e=(await x.G0.swimlanes.list(l.id)).sort((e,t)=>e.position-t.position);i(e);let t=await Promise.all(e.map(async e=>[e.id,await x.G0.agents.list(l.id,e.id)]));d(Object.fromEntries(t))}else i([]),d({})}catch(e){v(n(e))}finally{g(!1)}},[e,n]);return(0,s.useEffect)(()=>{t&&y()},[t,y]),{board:r,lanes:l,agentsByLane:o,cloudRunAllowance:c,loading:p,error:h,reload:y}}let w={padding:"7px 10px",fontSize:"var(--font-size-small)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",background:"var(--bg-deep)",color:"var(--text-primary)",boxSizing:"border-box"},C={padding:"7px 12px",fontSize:"var(--font-size-small)",fontWeight:600,background:"var(--coral-bright)",color:"var(--text-on-accent)",border:"none",borderRadius:"var(--radius-md)",cursor:"pointer"},z={padding:"5px 9px",fontSize:"var(--font-size-small)",fontWeight:600,background:"var(--bg-elevated)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",cursor:"pointer"},I={padding:20};function T(e){var t,n,a;let{board:l,lanes:o,reload:d}
1=e,c=(0,u.c)("boardConfig"),[p,h]=(0,s.useState)(0),[v,y]=(0,s.useState)(""),[b,m]=(0,s.useState)(!1),f=(0,s.useCallback)(async()=>{try{h(await x.G0.orphanedTasks.count(l.id))}catch(e){h(0)}},[l.id]);(0,s.useEffect)(()=>{f()},[f,o]);let j=null!=(a=null==(t=null!=(n=o.find(e=>!e.isTerminal&&!e.isParking))?n:o[0])?void 0:t.key)?a:"",k=v||j,S=async()=>{if(k){m(!0);try{await x.G0.orphanedTasks.adopt(l.id,k),await f(),d()}finally{m(!1)}}};return 0===p||0===o.length?null:(0,r.jsxs)("div",{role:"status",style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap",marginBottom:12,padding:"10px 12px",borderRadius:"var(--radius-md)",border:"1px solid var(--warning-border)",background:"var(--warning-bg)",color:"var(--warning-text)",fontSize:12},children:[(0,r.jsx)("span",{style:{flex:1,minWidth:200},children:c("orphanedTickets",{count:p})}),(0,r.jsxs)(g.RoleGate,{capability:"board.manageLanes",children:[(0,r.jsx)(i.l,{value:k,onChange:e=>y(e.target.value),style:{...w,minWidth:130},"aria-label":c("orphanedAdoptInto"),title:c("orphanedAdoptIntoTitle"),children:o.map(e=>(0,r.jsx)("option",{value:e.key,children:e.name},e.id))}),(0,r.jsx)("button",{type:"button",style:C,disabled:b||!k,onClick:S,children:c("orphanedAdopt")})]})]})}function R(e){var t,n,a,l,s;let{lane:o,lanes:d,workflows:c,patchLane:p}=e,g=(0,u.c)("boardConfig"),x=null!=(t=o.actionType)?t:"advance",h={fontSize:11,fontWeight:700,textTransform:"uppercase",color:"var(--text-muted)"};return(0,r.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap",marginTop:10},children:[(0,r.jsx)("span",{style:h,children:g("whenDone")}),(0,r.jsxs)(i.l,{value:x,onChange:e=>p(o.id,{actionType:e.target.value,actionTarget:""}),style:w,title:g("whenDoneTitle"),children:[(0,r.jsx)("option",{value:"advance",children:g("actionAdvance")}),(0,r.jsx)("option",{value:"move_ticket",children:g("actionMoveTicket")}),(0,r.jsx)("option",{value:"run_workflow",children:g("actionRunWorkflow")}),(0,r.jsx)("option",{value:"do_nothing",children:g("actionDoNothing")})]}),"move_ticket"===x&&(0,r.jsxs)(i.l,{value:null!=(n=o.actionTarget)?n:"",onChange:e=>p(o.id,{actionTarget:e.target.value}),style:w,title:g("destinationLane"),children:[(0,r.jsx)("option",{value:"",children:g("selectLane")}),d.filter(e=>e.id!==o.id).map(e=>(0,r.jsx)("option",{value:e.key,children:e.name},e.id))]}),"run_workflow"===x&&(0,r.jsxs)(i.l,{value:null!=(a=o.actionTarget)?a:"",onChange:e=>p(o.id,{actionTarget:e.target.value}),style:w,title:g("workflowToRun"),children:[(0,r.jsx)("option",{value:"",children:g("selectWorkflow")}),c.map(e=>(0,r.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,r.jsx)("span",{style:{width:1,height:18,background:"var(--border-subtle)"}}),(0,r.jsx)("span",{style:h,children:g("succeedsWhen")}),(0,r.jsxs)(i.l,{value:null!=(l=o.successPolicy)?l:"all",onChange:e=>p(o.id,{successPolicy:e.target.value,..."n_of_m"===e.target.value?{}:{successThreshold:null}}),style:w,title:g("succeedsWhenTitle"),children:[(0,r.jsx)("option",{value:"all",children:g("successAll")}),(0,r.jsx)("option",{value:"any",children:g("successAny")}),(0,r.jsx)("option",{value:"n_of_m",children:g("successNofM")})]}),"n_of_m"===o.successPolicy&&(0,r.jsx)("input",{type:"number",min:1,style:{...w,width:64},defaultValue:null!=(s=o.successThreshold)?s:1,onBlur:e=>p(o.id,{successThreshold:Math.max(1,Number(e.target.value)||1)}),title:g("nLabel")})]})}function W(e){var t;let{board:n,lane:a,patchLane:l}=e,o=(0,u.c)("boardConfig"),[d,c]=(0,s.useState)(!1),[p,g]=(0,s.useState)(null),[h,v]=(0,s.useState)("role"),[y,b]=(0,s.useState)(""),[m,f]=(0,s.useState)("reviewer"),j=(0,s.useCallback)(()=>{x.G0.requirements.list(n.id,a.id).then(g).catch(()=>g([]))},[n.id,a.id]);(0,s.useEffect)(()=>{d&&null===p&&j()},[d,p,j]);let k=async()=>{var e;let t=y.trim();t&&(await x.G0.requirements.create(n.id,a.id,{kind:h,ref:t,responsibility:"diagnostic"===h?null:m,isRequired:!0,position:null!=(e=null==p?void 0:p.length)?e:0}),b(""),j())},S=async e=>{await x.G0.requirements.remove(n.id,a.id,e),j()},I=async e=>{await x.G0.requirements.patch(n.id,a.id,e.id,{isRequired:!e.isRequired}),j()};return(0,r.jsxs)("div",{style:{marginTop:10,borderTop:"1px dashed var(--border-subtle)",paddingTop:10},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[(0,r.jsxs)("button",{type:"button",style:{...z},onClick:()=>c(e=>!e),"aria-expanded":d,children:[d?"â¾":"â¸"," ",o("requirements")]}),(0,r.jsxs)("label",{style:{fontSize:12,color:"var(--text-secondary)",display:"flex",gap:6,alignItems:"center"}
1,children:[o("requirementGate"),(0,r.jsxs)(i.l,{value:null!=(t=a.requirementGate)?t:"soft",onChange:e=>l(a.id,{requirementGate:e.target.value}),style:w,title:o("requirementGateTitle"),children:[(0,r.jsx)("option",{value:"off",children:o("gateOff")}),(0,r.jsx)("option",{value:"soft",children:o("gateSoft")}),(0,r.jsx)("option",{value:"hard",children:o("gateHard")})]})]})]}),d&&(0,r.jsxs)("div",{style:{marginTop:10},children:[(0,r.jsx)("div",{style:{fontSize:12,color:"var(--text-muted)",marginBottom:8},children:o("requirementsIntro")}),null===p?(0,r.jsx)("div",{style:{fontSize:12,color:"var(--text-muted)"},children:o("loading")}):0===p.length?(0,r.jsx)("div",{style:{fontSize:12,color:"var(--text-muted)"},children:o("noRequirements")}):(0,r.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:6,marginBottom:10},children:p.map(e=>{let t;return(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",fontSize:12,background:"var(--bg-deep)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"6px 10px"},children:[(0,r.jsx)("span",{style:{fontWeight:600,color:"var(--text-secondary)"},children:o("role"===(t=e.kind)?"reqKindRole":"diagnostic"===t?"reqKindDiagnostic":"reqKindReview")}),(0,r.jsx)("span",{style:{color:"var(--text-primary)"},children:e.ref}),e.responsibility&&(0,r.jsxs)("span",{style:{color:"var(--text-muted)"},children:["\xb7 ",o("owner"===e.responsibility?"respOwner":"reviewer"===e.responsibility?"respReviewer":"respContributor")]}),(0,r.jsxs)("label",{style:{marginLeft:"auto",display:"flex",gap:4,alignItems:"center",color:"var(--text-secondary)"},children:[(0,r.jsx)("input",{type:"checkbox",checked:e.isRequired,onChange:()=>I(e)})," ",o("required")]}),(0,r.jsx)("button",{type:"button",style:{...z,color:"var(--danger)",padding:"2px 8px"},onClick:()=>S(e.id),children:o("delete")})]},e.id)})}),(0,r.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[(0,r.jsxs)(i.l,{value:h,onChange:e=>v(e.target.value),style:w,title:o("reqKind"),children:[(0,r.jsx)("option",{value:"role",children:o("reqKindRole")}),(0,r.jsx)("option",{value:"review",children:o("reqKindReview")}),(0,r.jsx)("option",{value:"diagnostic",children:o("reqKindDiagnostic")})]}),(0,r.jsx)("input",{style:{...w,flex:1,minWidth:120},placeholder:o("reqRefPlaceholder"),value:y,onChange:e=>b(e.target.value),onKeyDown:e=>{"Enter"===e.key&&k()}}),"diagnostic"!==h&&(0,r.jsxs)(i.l,{value:m,onChange:e=>f(e.target.value),style:w,title:o("responsibility"),children:[(0,r.jsx)("option",{value:"reviewer",children:o("respReviewer")}),(0,r.jsx)("option",{value:"owner",children:o("respOwner")}),(0,r.jsx)("option",{value:"contributor",children:o("respContributor")})]}),(0,r.jsx)("button",{type:"button",style:C,onClick:k,children:o("addRequirement")})]})]})]})}function D(e){let{boardId:t,laneId:n,style:a}=e,l=(0,u.c)("boardConfig"),[i,o]=(0,s.useState)(!1),[d,c]=(0,s.useState)(null),[p,g]=(0,s.useState)(null),h=async()=>{o(!0),g(null),c(null);try{c(await x.G0.runLane(t,n))}catch(e){g(e.message||l("runLaneError"))}finally{o(!1)}};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",style:a,onClick:h,disabled:i,title:l("runLaneTitle"),children:i?l("runLaneRunning"):l("runLane")}),d&&(0,r.jsx)("span",{style:{fontSize:"var(--font-size-eyebrow)",color:"var(--text-muted)"},children:0===d.considered?l("runLaneEmpty"):l("runLaneResult",{started:d.started,skipped:d.skipped})}),p&&(0,r.jsx)("span",{style:{fontSize:"var(--font-size-eyebrow)",color:"var(--danger)"},children:p})]})}var A=n(92671);function P(e){let{board:t,lane:n,agents:a,reload:l}=e,o=(0,u.c)("boardConfig"),[d,c]=(0,s.useState)(""),[p,g]=(0,s.useState)(""),[h,v]=(0,s.useState)(""),[y,b]=(0,s.useState)(""),[m,f]=(0,s.useState)([]),[j,k]=(0,s.useState)(!1);(0,s.useEffect)(()=>{if(!j)return;let e=!0;return(0,A.hy)(t.projectId).then(t=>{e&&f(t)}).catch(()=>{}),()=>{e=!1}},[j,t.projectId]);let S=async()=>{if(!d)return;let[e,r]=d.split(":");await x.G0.agents.create(t.id,n.id,{agentKind:e,agentRef:r,name:p.trim()||null,role:h.trim()||null,model:y.trim()||null,position:a.length}),c(""),g(""),v(""),b(""),k(!1),l()},I=async e=>
1{await x.G0.agents.remove(t.id,n.id,e),l()};return(0,r.jsxs)("div",{style:{marginTop:10,paddingTop:10,borderTop:"1px dashed var(--border-subtle)"},children:[(0,r.jsx)("div",{style:{fontSize:11,fontWeight:700,textTransform:"uppercase",color:"var(--text-muted)",marginBottom:6},children:o("autonomousAgents")}),0===a.length&&(0,r.jsx)("div",{style:{fontSize:12,color:"var(--text-muted)"},children:o("noAgentsInLane")}),a.map(e=>{var t;return(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:13,padding:"4px 0"},children:[(0,r.jsx)("span",{style:{fontWeight:600},children:null!=(t=e.name)?t:e.role}),(0,r.jsx)("span",{className:"badge-blue",style:{fontSize:10,padding:"1px 7px",borderRadius:"var(--radius-sm)",textTransform:"capitalize"},title:o("roleTitle"),children:e.role}),(0,r.jsxs)("span",{style:{fontSize:11,color:"var(--text-muted)"},children:[e.runtime,e.model?" \xb7 ".concat(e.model):" \xb7 ".concat(o("defaultLlm"))]}),(0,r.jsx)("span",{style:{flex:1}}),(0,r.jsx)("button",{type:"button",style:{...z,color:"var(--danger)"},onClick:()=>I(e.id),children:o("remove")})]},e.id)}),j?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{style:{display:"flex",gap:6,marginTop:8,flexWrap:"wrap"},children:[(0,r.jsxs)(i.l,{value:d,onChange:e=>c(e.target.value),style:{...w,flex:1,minWidth:180},"aria-label":o("selectAgent"),children:[(0,r.jsx)("option",{value:"",children:o("selectAgent")}),m.map(e=>(0,r.jsx)("option",{value:"".concat(e.kind,":").concat(e.ref),children:e.name},"".concat(e.kind,":").concat(e.ref)))]}),(0,r.jsx)("input",{style:{...w,width:140},placeholder:o("namePlaceholder"),value:p,onChange:e=>g(e.target.value),title:o("nameTitle")}),(0,r.jsx)("input",{style:{...w,width:120},placeholder:o("rolePlaceholder"),value:h,onChange:e=>v(e.target.value),title:o("roleTitle")}),(0,r.jsx)("input",{style:{...w,width:160},placeholder:o("modelPlaceholder"),value:y,onChange:e=>b(e.target.value)}),(0,r.jsx)("button",{type:"button",style:C,onClick:S,disabled:!d,children:o("add")}),(0,r.jsx)("button",{type:"button",style:z,onClick:()=>{k(!1),c(""),g(""),v(""),b("")},children:o("cancel")})]}),0===m.length&&(0,r.jsx)("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:6},children:o("noAgentsRegistered")})]}):(0,r.jsxs)("div",{style:{display:"flex",gap:6,marginTop:8,flexWrap:"wrap",alignItems:"center"},children:[(0,r.jsx)("button",{type:"button",style:z,onClick:()=>k(!0),children:o("assignAgent")}),a.length>0&&(0,r.jsx)(D,{boardId:t.id,laneId:n.id,style:z})]})]})}function M(e){let{board:t,lanes:n,agentsByLane:a,reload:l}
1=e,o=(0,u.c)("boardConfig"),d=(0,p.S)(),[c,h]=(0,s.useState)(""),[v,y]=(0,s.useState)(!1),[b,m]=(0,s.useState)({}),[f,j]=(0,s.useState)({}),[k,S]=(0,s.useState)({}),[D,A]=(0,s.useState)([]);(0,s.useEffect)(()=>{let e=!0;return x.Aq.list().then(t=>{e&&A(t)}).catch(()=>{}),()=>{e=!1}},[]);let M=async()=>{let e=c.trim();e&&(await x.G0.swimlanes.create(t.id,{name:e,position:n.length}),h(""),y(!1),l())},H=async e=>{var r,a,i;let s=n.filter(t=>t.id!==e);await d(o("confirmDeleteLane"))&&(await x.G0.swimlanes.remove(t.id,e,null!=(i=null!=(a=b[e])?a:null==(r=s[0])?void 0:r.key)?i:null),m(t=>{let n={...t};return delete n[e],n}),l())},B=async(e,n)=>{await x.G0.swimlanes.patch(t.id,e,n),l()},E=async(e,n)=>{S(t=>{let n={...t};return delete n[e.id],n});try{let r=await x.G0.swimlanes.patch(t.id,e.id,{key:n});r.renamed&&j(t=>({...t,[e.id]:r.renamed})),l()}catch(t){S(n=>({...n,[e.id]:t instanceof Error?t.message:o("errRenameKey")}))}},L=async(e,r)=>{let a=n[e+r],i=n[e];a&&i&&(await x.G0.swimlanes.patch(t.id,i.id,{position:a.position}),await x.G0.swimlanes.patch(t.id,a.id,{position:i.position}),l())};return(0,r.jsxs)(g.RoleGate,{capability:"board.manageLanes",variant:"block",style:I,children:[(0,r.jsx)("div",{style:{fontSize:12,color:"var(--text-muted)",marginBottom:12},children:o("lanesIntro")}),(0,r.jsx)(T,{board:t,lanes:n,reload:l}),0===n.length&&(0,r.jsx)("div",{style:{fontSize:13,color:"var(--text-muted)"},children:o("noLanes")}),n.map((e,s)=>{var d,c,u,p;return(0,r.jsxs)("div",{style:{border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-lg)",padding:14,marginBottom:12},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[(0,r.jsx)("button",{type:"button",style:{...z,padding:"0 6px",lineHeight:1.2},disabled:0===s,title:o("moveLeft"),onClick:()=>L(s,-1),children:"â²"}),(0,r.jsx)("button",{type:"button",style:{...z,padding:"0 6px",lineHeight:1.2},disabled:s===n.length-1,title:o("moveRight"),onClick:()=>L(s,1),children:"â¼"})]}),(0,r.jsx)("input",{style:{...w,fontWeight:600,fontSize:14,flex:1,minWidth:140},defaultValue:e.name,title:o("laneNameTitle"),onBlur:t=>{let n=t.target.value.trim();n&&n!==e.name&&B(e.id,{name:n})}}),(0,r.jsx)("input",{style:{...w,fontFamily:"var(--font-mono, monospace)",width:150,minWidth:110},defaultValue:e.key,title:o("laneKeyTitle"),"aria-label":o("laneKey"),onBlur:t=>{let n=t.target.value.trim();
1n&&n!==e.key&&E(e,n)}}),(0,r.jsxs)(i.l,{value:e.gate,onChange:t=>B(e.id,{gate:t.target.value}),style:w,title:o("gate"),children:[(0,r.jsx)("option",{value:"auto",children:o("gateAuto")}),(0,r.jsx)("option",{value:"human",children:o("gateHuman")})]}),(0,r.jsxs)(i.l,{value:e.executionMode,onChange:t=>B(e.id,{executionMode:t.target.value}),style:w,title:o("execution"),children:[(0,r.jsx)("option",{value:"sequential",children:o("execSequential")}),(0,r.jsx)("option",{value:"parallel",children:o("execParallel")})]}),(0,r.jsxs)(i.l,{value:e.failurePolicy,onChange:t=>B(e.id,{failurePolicy:t.target.value}),style:w,title:o("onFailure"),children:[(0,r.jsx)("option",{value:"needs_attention",children:o("failNeedsAttention")}),(0,r.jsx)("option",{value:"retry",children:o("failRetry")}),(0,r.jsx)("option",{value:"skip",children:o("failSkip")})]}),(0,r.jsxs)("label",{style:{fontSize:12,color:"var(--text-secondary)",display:"flex",gap:4,alignItems:"center"},children:[(0,r.jsx)("input",{type:"checkbox",checked:e.isTerminal,onChange:t=>B(e.id,{isTerminal:t.target.checked})})," ",o("terminal")]}),(0,r.jsxs)("label",{style:{fontSize:12,color:"var(--text-secondary)",display:"flex",gap:4,alignItems:"center"},title:o("parkingTitle"),children:[(0,r.jsx)("input",{type:"checkbox",checked:null!=(d=e.isParking)&&d,onChange:t=>B(e.id,{isParking:t.target.checked})})," ",o("parking")]}),n.length>1&&(0,r.jsxs)(i.l,{value:null!=(c=b[e.id])?c:"",onChange:t=>m(n=>({...n,[e.id]:t.target.value})),style:{...w,minWidth:130},title:o("mergeIntoTitle"),"aria-label":o("mergeInto"),children:[(0,r.jsx)("option",{value:"",children:o("mergeIntoAuto")}),n.filter(t=>t.id!==e.id).map(e=>(0,r.jsx)("option",{value:e.key,children:e.name},e.id))]}),(0,r.jsx)("button",{type:"button",style:{...z,color:"var(--danger)"},onClick:()=>H(e.id),children:o("delete")})]}),k[e.id]&&(0,r.jsx)("div",{role:"alert",style:{marginTop:8,fontSize:12,color:"var(--danger)"},children:k[e.id]}),f[e.id]&&!k[e.id]&&(0,r.jsx)("div",{role:"status",style:{marginTop:8,fontSize:12,color:"var(--text-muted)"},children:o("laneKeyRenamed",{count:f[e.id].movedTasks,key:f[e.id].key})}),!e.isTerminal&&!e.isParking&&"auto"===e.gate&&0===(null!=(u=a[e.id])?u:[]).length&&(0,r.jsx)("div",{role:"status",style:{marginTop:10,padding:"8px 10px",borderRadius:"var(--radius-md)",border:"1px solid var(--warning-border)",background:"var(--warning-bg)",color:"var(--warning-text)",fontSize:12},children:o("laneUnstaffed")}),(0,r.jsx)(R,{lane:e,lanes:n,workflows:D,patchLane:B}),(0,r.jsx)(P,{board:t,lane:e,agents:null!=(p=a[e.id])?p:[],reload:l}),(0,r.jsx)(W,{board:t,lane:e,patchLane:B})]},e.id)}),v?(0,r.jsxs)("div",{style:{display:"flex",gap:8,marginTop:10,flexWrap:"wrap"},children:[(0,r.jsx)("input",{style:{...w,flex:1,minWidth:140},placeholder:o("columnNamePlaceholder"),value:c,onChange:e=>h(e.target.value),onKeyDown:e=>{"Enter"===e.key&&M()}}),(0,r.jsx)("button",{type:"button",style:C,onClick:M,children:o("add")}),(0,r.jsx)("button",{type:"button",style:z,onClick:()=>{y(!1),h("")},children:o("cancel")})]}):(0,r.jsx)("button",{type:"button",style:C,onClick:()=>y(!0),children:o("addSwimlane")})]})}var H=n(65644);function B(e){let{projectId:t}=e,n=(0,u.c)("boardConfig"),[a,l]=(0,s.useState)([]),[o,c]=(0,s.useState)([]),[p,g]=(0,s.useState)(!0),[x,h]=(0,s.use
1State)(null),[v,b]=(0,s.useState)(""),[m,f]=(0,s.useState)(!1),j=(0,s.useCallback)(async()=>{g(!0),h(null);try{let[e,n]=await Promise.all([(0,y.du)(),(0,y.Jw)(t)]);l(e),c(n)}catch(e){h((0,H.yR)(e,n("errLoadTeams")))}finally{g(!1)}},[t,n]);(0,s.useEffect)(()=>{j()},[j]);let k=new Set(o.map(e=>e.id)),S=a.filter(e=>!k.has(e.id)),T=async e=>{f(!0),h(null);try{await e(),await j()}catch(e){h((0,H.yR)(e,n("errUpdate")))}finally{f(!1)}},R=e=>(0,r.jsx)(d(),{href:"/workforce?tab=teams",style:{color:"var(--coral-bright)",fontWeight:600},children:e});return(0,r.jsxs)("div",{style:I,children:[(0,r.jsx)("div",{style:{fontSize:12,color:"var(--text-muted)",marginBottom:12},children:n.rich("teamsIntro",{link:R})}),x&&(0,r.jsx)("div",{style:{fontSize:13,color:"var(--danger)",marginBottom:10},children:x}),p?(0,r.jsx)("div",{style:{fontSize:13,color:"var(--text-muted)"},children:n("loadingTeams")}):(0,r.jsxs)(r.Fragment,{children:[0===o.length?(0,r.jsx)("div",{style:{fontSize:13,color:"var(--text-muted)",marginBottom:12},children:n("noTeamsAssigned")}):(0,r.jsx)("div",{style:{marginBottom:12},children:o.map(e=>(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"8px 0",borderBottom:"1px solid var(--border-subtle)"},children:[(0,r.jsxs)("div",{style:{minWidth:0},children:[(0,r.jsx)("div",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)"},children:e.name}),e.description&&(0,r.jsx)("div",{style:{fontSize:12,color:"var(--text-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.description})]}),(0,r.jsx)("span",{style:{flex:1}}),(0,r.jsx)("button",{type:"button",style:{...z,color:"var(--danger)"},disabled:m,onClick:()=>void T(()=>(0,y.zl)(e.id,t)),children:n("remove")})]},e.id))}),0===a.length?(0,r.jsx)("div",{style:{fontSize:12,color:"var(--text-muted)"},children:n.rich("noTeamsExist",{link:R})}):(0,r.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[(0,r.jsxs)(i.l,{value:v,onChange:e=>b(e.target.value),style:{...w,flex:1,minWidth:200},"aria-label":n("selectTeamToAssign"),disabled:m||0===S.length,children:[(0,r.jsx)("option",{value:"",children:0===S.length?n("allTeamsAssigned"):n("assignTeam")}),S.map(e=>(0,r.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,r.jsx)("button",{type:"button",style:{...C,opacity:!v||m?.6:1},disabled:!v||m,onClick:()=>{let e=Number(v);e&&T(async()=>{await (0,y.Sf)(e,t),b("")})},children:n("assign")})]})]})]})}function E(e){var t,n,a,l,o;let{board:d,projectId:c,onSaved:h}=e,v=(0,u.c)("boardConfig"),y=(0,p.S)(),[b,m]=(0,s.useState)(d.maxConcurrentTickets),[f,j]=(0,s.useState)(d.name),[k,S]=(0,s.useState)(null!=(t=d.standupTurnMode)?t:"facilitator"),[z,T]=(0,s.useState)(null!=(n=d.standupTurnSeconds)?n:90),[R,W]=(0,s.useState)(null!=(a=d.defaultMemberWipCap)?a:8),[D,A]=(0,s.useState)(null!=(l=d.hideDoneItems)&&l),[P,M]=(0,s.use
1State)(null==(o=d.requireExecutionApproval)||o),[B,E]=(0,s.useState)(!1),[L,K]=(0,s.useState)([]),[F,N]=(0,s.useState)(""),[_,O]=(0,s.useState)(""),[q,U]=(0,s.useState)(!1),[V,G]=(0,s.useState)(null);(0,s.useEffect)(()=>{let e=!0;return Promise.all([x.up.listTemplates(),x.up.roster(c)]).then(t=>{let[n,r]=t;e&&(K(n),N(r.templateId),O(r.templateId))}).catch(t=>{e&&G((0,H.yR)(t,v("templateLoadError")))}),()=>{e=!1}},[c,v]);let X=async()=>{var e;if(!_||_===F)return;let t=L.find(e=>e.id===_);if(await y({title:v("templateConfirmTitle"),message:v("templateConfirmMessage",{name:null!=(e=null==t?void 0:t.name)?e:_}),confirmLabel:v("templateApply"),destructive:!0})){U(!0),G(null);try{await x.up.applyTemplate(c,_),N(_),h()}catch(e){G((0,H.yR)(e,v("templateApplyError")))}finally{U(!1)}}},Q=async()=>{E(!0);try{await x.G0.update(d.id,{name:f.trim()||d.name,maxConcurrentTickets:b,standupTurnMode:k,standupTurnSeconds:z,defaultMemberWipCap:R,hideDoneItems:D,requireExecutionApproval:P}),h()}finally{E(!1)}};return(0,r.jsxs)("div",{style:{...I,display:"flex",flexDirection:"column",gap:14,maxWidth:420},children:[(0,r.jsxs)("div",{style:{paddingBottom:14,borderBottom:"1px solid var(--border-subtle)"},children:[(0,r.jsx)("div",{style:{fontSize:"var(--font-size-small)",fontWeight:600,color:"var(--text-primary)"},children:v("templateHeading")}),(0,r.jsx)("div",{style:{fontSize:"var(--font-size-eyebrow)",color:"var(--text-muted)",marginTop:3},children:v("templateHint")}),(0,r.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center",marginTop:8,flexWrap:"wrap"},children:[(0,r.jsx)(i.l,{value:_,onChange:e=>O(e.target.value),disabled:q||0===L.length,"aria-label":v("templateLabel"),style:{...w,flex:1,minWidth:220},children:L.map(e=>(0,r.jsx)("option",{value:e.id,children:e.name},e.id))}),(0,r.jsx)(g.RoleGate,{capability:"manager.manage",variant:"block",children:(0,r.jsx)("button",{type:"button",style:{...C,opacity:!_||_===F||q?.6:1},disabled:!_||_===F||q,onClick:()=>void X(),children:q?v("templateApplying"):v("templateApply")})})]}),V&&(0,r.jsx)("div",{style:{marginTop:6,fontSize:"var(--font-size-eyebrow)",color:"var(--danger)"},children:V})]}),(0,r.jsxs)("label",{style:{fontSize:"var(--font-size-small)",color:"var(--text-secondary)"},children:[v("boardNameLabel"),(0,r.jsx)("input",{style:{...w,width:"100%",marginTop:4},value:f,onChange:e=>j(e.target.value)})]}),(0,r.jsxs)("label",{style:{fontSize:"var(--font-size-small)",color:"var(--text-secondary)"},children:[v("maxConcurrent"),(0,r.jsx)("input",{type:"number",min:1,style:{...w,width:120,marginTop:4},value:b,onChange:e=>m(Number(e.target.value))})]}),(0,r.jsxs)("label",{style:{fontSize:"var(--font-size-small)",color:"var(--text-secondary)",display:"flex",gap:8,alignItems:"center"},children:[(0,r.jsx)("input",{type:"checkbox",checked:D,onChange:e=>A(e.target.checked)}),v("hideDoneItems")]}),(0,r.jsxs)("div",{style:{borderTop:"1px solid var(--border-subtle)",paddingTop:14},children:[(0,r.jsx)("div",{style:{fontSize:"var(--font-size-small)",fontWeight:600,color:"var(--text-primary)",marginBottom:6},children:v("approvalHeading")}),(0,r.jsx)(g.RoleGate,{capability:"board.manageApproval",variant:"block",children:(0,r.jsxs)("label",{style:{fontSize:"var(--font-size-small)",color:"var(--text-secondary)",display:"flex",gap:8,alignItems:"flex-start"},children:[(0,r.jsx)("input",{type:"checkbox",checked:P,onChange:e=>M(e.target.checked),style:{marginTop:3}}),(0,r.jsxs)("span",{children:[v("approvalToggle"),(0,r.jsx)("span",{style:{display:"block",fontSize:"var(--font-size-eyebrow)",color:"var(--text-muted)",marginTop:2},children:P?v("approvalOnHint"):v("approvalOffHint")})]})]})})]}),(0,r.jsxs)("div",{style:{borderTop:"1px solid var(--border-subtle)",paddingTop:14},children:[(0,r.jsx)("div",{style:{fontSize:"var(--font-size-small)",fontWeight:600,color:"var(--text-primary)",marginBottom:8},children:v("standupTimer")}),(0,r.jsxs)("label",{style:{fontSize:"var(--font-size-small)",color:"var(--text-secondary)",display:"block"},children:[v("mode"),(0,r.jsxs)(i.l,{style:{...w,width:"100%",marginTop:4},value:k,onChange:e=>S(e.target.value),children:[(0,r.jsx)("option",{value:"facilitator",children:v("modeFacilitator")}),(0,r.jsx)("option",{value:"timeboxed",children:v("modeTimeboxed")})]})]}),"timeboxed"===k&&(0,r.jsxs)("label",{style:{fontSize:"var(--font-size-small)",color:"var(--text-secondary)",display:"block",marginTop:10},children:[v("secondsPerPerson"),(0,r.jsx)("input",{type:"number",min:10,step:5,style:{...w,width:120,marginTop:4},value:z,onChange:e=>T(Number(e.target.value))})]}),(0,r.jsxs)("label",{style:{fontSize:"var(--font-size-small)",color:"var(--text-secondary)",display:"block",marginTop:10},children:[v("wipCapLabel"),(0,r.jsx)("div",{style:{fontSize:"var(--font-size-eyebrow)",color:"var(--text-muted)",marginTop:2},children:v("wipCapHint")}),(0,r.jsx)("input",{type:"number",min:1,max:100,step:1,style:{...w,width:120,marginTop:4},value:R,onChange:e=>W(Number(e.target.value))})]})]}),(0,r.jsx)("div",{children:(0,r.jsx)("button",{type:"button",style:C,disabled:B,onClick:Q,children:B?v("saving"):v("saveSettings")})})]})}var L=n(38172);let K=["lanes","teams","settings","external"];function F(e){let{open:t,onClose:n,projectId:a,projectName:l,initialTab:i="lanes"}
1=e,o=(0,u.c)("boardConfig"),[d,c]=(0,s.useState)(i);(0,s.useEffect)(()=>{t&&c(i)},[t,i]);let{board:p,lanes:g,agentsByLane:h,loading:v,error:y,reload:b}=S(a,t),{provisioning:m,provisionError:k}=function(e){let{open:t,board:n,laneCount:r,loading:a,error:l,projectId:i,projectName:o,reload:d}=e,c=(0,u.c)("boardConfig"),{allowed:p}=(0,L.JT)("board.manageLanes"),[g,h]=(0,s.useState)(!1),[v,y]=(0,s.useState)(null),b=(0,s.useRef)(null);return(0,s.useEffect)(()=>{if(!t){y(null),b.current=null;return}if(!a&&!l&&!g&&!v&&p){if(!n){h(!0),x.G0.create({projectId:i,name:c("boardNameDefault",{name:null!=o?o:c("projectFallback")})}).then(()=>d()).catch(e=>y((0,H.yR)(e,c("errCreateBoard")))).finally(()=>h(!1));return}0===r&&b.current!==n.id&&(b.current=n.id,h(!0),x.G0.swimlanes.ensureDefaults(n.id).then(()=>d()).catch(e=>y((0,H.yR)(e,c("errSetupLanes")))).finally(()=>h(!1)))}},[t,a,l,n,r,g,v,i,o,d,c,p]),{provisioning:g,provisionError:v}}({open:t,board:p,laneCount:g.length,loading:v,error:y,projectId:a,projectName:l,reload:b}),w=null!=y?y:k,C=v||m||!p;return(0,r.jsx)(f.M,{open:t,onClose:n,title:o("title"),width:"wide",widthStorageKey:"board-config",tabs:K.map(e=>({id:e,label:o("tab.".concat(e))})),activeTabId:d,onTabChange:e=>c(e),children:C||w?(0,r.jsx)("div",{style:I,children:(0,r.jsx)("span",{style:{fontSize:"var(--font-size-small)",color:w?"var(--danger)":"var(--text-muted)"},children:null!=w?w:m||!p?o("settingUp"):o("loading")})}):"lanes"===d?(0,r.jsx)(M,{board:p,lanes:g,agentsByLane:h,reload:b}):"teams"===d?(0,r.jsx)(B,{projectId:a}):"settings"===d?(0,r.jsx)(E,{board:p,projectId:a,onSaved:b}):(0,r.jsx)("div",{style:I,children:(0,r.jsx)(j.H,{projectId:a,heading:o("externalHeading")})})})}var N=n(13630),_=n(23149),O=n(38171),q=n(37167),U=n(92826);let V={will_run:"success",already_running:"accent",same_lane_reentry:"accent",human_gate:"warning",capability_mismatch:"warning",run_cap_exhausted:"warning",cloud_run_limit:"warning",tenant_token_limit:"warning",cooldown_active:"accent",no_agent:"neutral",managed_no_role:"warning",lane_unconfigured:"warning",no_board:"neutral",no_lane:"neutral",terminal_lane:"neutral",not_executable:"neutral",pending_approval:"warning",execution_disabled:"warning",lane_requirement_gate:"warning"};function G(e){let{tasks:t,isActive:n,onDispatched:l}=e,i=(0,u.c)("board.triage"),[o,d]=(0,s.useState)(!1),[c,p]=(0,s.use
1State)(!1),[h,v]=(0,s.useState)(null),[y,b]=(0,s.useState)(new Map),[m,f]=(0,s.useState)(new Set),j=t.filter(e=>(e.assignedAgentRef||null!=e.assignedAgentHostId)&&!n(e.id)),k=(0,s.useCallback)(async()=>{p(!0),v(null);try{let e=await Promise.all(j.map(async e=>{try{return[e.id,await x.bI.autorunDiagnostics(e.id)]}catch(t){return[e.id,null]}}));b(new Map(e.filter(e=>null!==e[1])))}catch(e){v(i("error"))}finally{p(!1)}},[j,i]),S=(0,s.useCallback)(()=>{let e=!o;d(e),e&&k()},[o,k]),w=(0,s.useCallback)(async e=>{f(t=>new Set(t).add(e));try{await x.bI.runNow(e),l();try{let t=await x.bI.autorunDiagnostics(e);b(n=>new Map(n).set(e,t))}catch(e){}}catch(e){}finally{f(t=>{let n=new Set(t);return n.delete(e),n})}},[l]),C=(0,s.useCallback)(async()=>{for(let e of j.filter(e=>{let t=y.get(e.id);return(null==t?void 0:t.candidate)&&!t.liveExecution}))await w(e.id)},[j,y,w]);if(0===j.length)return null;let z=j.filter(e=>{let t=y.get(e.id);return(null==t?void 0:t.candidate)&&!t.liveExecution}).length;return(0,r.jsxs)("div",{style:{position:"relative"},children:[(0,r.jsxs)("button",{type:"button",style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:"var(--radius-full)",fontSize:10,fontWeight:600,border:"1px solid ".concat(o?"var(--coral-bright)":"var(--border-subtle)"),background:"var(--bg-elevated)",color:"var(--text-secondary)",cursor:"pointer",whiteSpace:"nowrap"},onClick:S,"aria-expanded":o,title:i("title"),children:[(0,r.jsx)(a.I,{source:"â",size:"1em"})," ",i("button")," ",j.length]}),o&&(0,r.jsxs)("div",{role:"dialog","aria-label":i("title"),style:{position:"absolute",top:"calc(100% + 6px)",right:0,zIndex:30,width:"min(320px, 80vw)",maxHeight:360,overflowY:"auto",background:"var(--surface)",border:"1px solid var(--border)",borderRadius:"var(--radius-lg)",boxShadow:"0 8px 24px rgba(0,0,0,0.28)",padding:10},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,marginBottom:8},children:[(0,r.jsx)("span",{style:{fontSize:12,fontWeight:700,color:"var(--text-primary)"},children:i("title")}),(0,r.jsx)(g.RoleGate,{capability:"runtime.execute",style:{flexShrink:0},children:(0,r.jsx)("button",{type:"button",disabled:0===z||m.size>0,onClick:()=>void C(),style:{fontSize:10,fontWeight:600,padding:"3px 8px",borderRadius:"var(--radius-sm)",border:"1px solid var(--border)",background:z>0?"var(--coral-bright)":"var(--bg-elevated)",color:z>0?"var(--text-on-accent)":"var(--text-muted)",cursor:z>0?"pointer":"not-allowed",whiteSpace:"nowrap"},children:i("runAll",{count:z})})})]}),c&&(0,r.jsx)("div",{style:{fontSize:11,color:"var(--text-muted)",padding:"6px 2px"},children:i("loading")}),h&&(0,r.jsx)("div",{style:{fontSize:11,color:"var(--danger)",padding:"6px 2px"},children:h}),!c&&!h&&j.map(e=>{let t=y.get(e.id),n=null==t?void 0:t.reason,a=m.has(e.id),l=!!(null==t?void 0:t.candidate)&&!t.liveExecution;return(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 4px",borderTop:"1px solid var(--border-subtle)"},children:[(0,r.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,r.jsxs)("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[e.key?"".concat(e.key," \xb7 "):"",e.title]}),(0,r.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:5,marginTop:3},children:[(0,r.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:(0,U.ST)(V,n,"solid"),flexShrink:0}}),(0,r.jsx)("span",{style:{fontSize:10,color:"var(--text-muted)"},children:n?i("reason.".concat(n)):"â"})]})]}),(0,r.jsx)(g.RoleGate,{capability:"runtime.execute",style:{flexShrink:0},children:(0,r.jsx)("button",{type:"button",disabled:!l||a,onClick:()=>void w(e.id),style:{fontSize:10,fontWeight:600,padding:"3px 8px",borderRadius:"var(--radius-sm)",border:"1px solid var(--border)",background:l&&!a?"var(--coral-bright)":"var(--bg-elevated)",color:l&&!a?"var(--text-on-accent)":"var(--text-muted)",cursor:l&&!a?"pointer":"not-allowed",whiteSpace:"nowrap",flexShrink:0},children:a?i("running"):i("run")})})]},e.id)})]})]})}var X=n(8318),Q=n(11002);function J(e){let{tasks:t,members:n,agentHosts:l,cloudAgents:i,selectedAssignees:o,onSelectAssignees:d,allLabel:c="All",disableAll:u=!1}=e,p=(0,s.useMemo)(()=>{var e,r,a,s,o;let d=new Map;for(let n of t){let t=null!=(o=n).assignedAgentHostId?"h:".concat(o.assignedAgentHostId):o.assignedAgentRef?"c:".concat(o.assignedAgentRef):o.assignedUserId?"u:".concat(o.assignedUserId):null;t&&d.set(t,(null!=(e=d.get(t))?e:0)+1)}let c=[];for(let e of n){let t="u:".concat(e.id),n=null!=(r=d.get(t))?r:0;n>0&&c.push({key:t,name:e.name,count:n,isHuman:!0})}for(let e of l){let t="h:".concat(e.id),n=null!=(a=d.get(t))?a:0;n>0&&c.push({key:t,name:e.name,count:n,isHuman:!1})}for(let e of i){let t="c:".concat(e.ref),n=null!=(s=d.get(t))?s:0;n>0&&c.push({key:t,name:e.name,count:n,isHuman:!1})}return c.sort((e,t)=>
1e.count!==t.count?t.count-e.count:e.name.localeCompare(t.name)),c},[t,n,l,i]),g=null!=o?o:[],x=(0,s.useMemo)(()=>(function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8;if(n<=0)return[];let r=new Set(t);return[...e.filter(e=>r.has(e.key)),...e.filter(e=>!r.has(e.key))].slice(0,n)})(p,g),[p,g]),h=0===g.length;return 0===p.length?null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),d([])},disabled:u,"aria-label":"Show all tasks",title:"Show all tasks (clear assignee filter)",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,padding:"0 10px",borderRadius:"var(--radius-xl)",fontSize:12,fontWeight:600,border:"1px solid ".concat(h?"var(--coral-bright)":"var(--border-subtle)"),background:h?"var(--coral-bright)":"var(--bg-deep)",color:h?"var(--text-on-accent)":"var(--text-muted)",cursor:u?"not-allowed":"pointer",flexShrink:0,opacity:u?.5:1,transition:"background 0.15s, color 0.15s, border-color 0.15s",fontFamily:"inherit",outline:"none",whiteSpace:"nowrap",gap:4},children:c}),g.length>0&&p.length>0&&(0,r.jsx)("button",{type:"button",onClick:()=>{d([])},"aria-label":"Clear selected assignees",title:"Clear selected assignees",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",height:28,width:28,borderRadius:"50%",border:"1px solid var(--border-subtle)",background:"var(--bg-elevated)",color:"var(--text-muted)",cursor:"pointer",flexShrink:0,fontSize:14,lineHeight:1,fontFamily:"inherit",outline:"none",paddingLeft:0,paddingRight:0},children:(0,r.jsx)(a.I,{name:"close",size:14})}),(0,r.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:4,overflow:"hidden",WebkitOverflowScrolling:"touch",flex:1,minWidth:0},children:[x.map(e=>{let t=g.includes(e.key);return(0,r.jsx)(Q.eu,{name:e.name,count:e.count,active:t,onClick:t=>{var n;return n=e.key,void(t.stopPropagation(),d(g.includes(n)?g.filter(e=>e!==n):[...g,n]))},title:"".concat(e.name," â ").concat(e.count," task").concat(1!==e.count?"s":"").concat(t?" (filtering)":" â click to filter"),size:28},e.key)}),p.length>8&&(0,r.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",height:28,padding:"0 8px",fontSize:11,color:"var(--text-muted)",background:"var(--bg-deep)",borderRadius:"var(--radius-lg)",flexShrink:0},children:["+",p.length-8," more"]})]})]})}let Y=new Set(["pending","submitted","running","claimed"]);var $=n(51451),Z=n(73310);let ee={list:e=>(0,H.AT)("/api/releases".concat(null!=e?"?projectId=".concat(e):""))};var et=n(57300);function en(e){var t;let{value:n,projectId:a,onChange:l,disabled:s,autoFocus:o,onBlur:d,style:c}=e,p=(0,u.c)("insights.emp"),{data:g}=(0,et.P)(()=>ee.list(a),[a]),x=null!=(t=null==g?void 0:g.releases)?t:[];return(0,r.jsxs)(i.l,{autoFocus:o,disabled:s,onBlur:d,value:null!=n?n:"",onChange:e=>l(e.target.value||null),"aria-label":p("release.label"),style:c,children:[(0,r.jsx)("option",{value:"",children:p("release.none")}),x.map(e=>(0,r.jsxs)("option",{value:e.id,children:[e.name,e.version?" (".concat(e.version,")"):""]},e.id))]})}var er=n(11365);function ea(e){let{taskId:t,value:n,onChange:a,disabled:l,style:o}
1=e,d=(0,u.c)("insights.emp"),[c,p]=(0,s.useState)(!1),g=async e=>{p(!0);try{e?(await er.oV.tagDelay(t,e),null==a||a(e)):(await er.oV.clearDelay(t),null==a||a(null))}finally{p(!1)}};return(0,r.jsxs)(i.l,{disabled:l||c,value:null!=n?n:"",onChange:e=>g(e.target.value),"aria-label":d("delay.tagLabel"),style:o,children:[(0,r.jsx)("option",{value:"",children:d("delay.untagged")}),er._8.map(e=>(0,r.jsx)("option",{value:e,children:d("delay.reason.".concat(e))},e))]})}function el(e){let{projects:t,currentProjectId:n,onMove:a,disabled:l=!1,label:s="Move to boardâ¦",style:o}=e,d=t.filter(e=>e.id!==n);return 0===d.length?null:(0,r.jsxs)(i.l,{value:"",disabled:l,"aria-label":s,onClick:e=>e.stopPropagation(),onChange:e=>{let t=e.target.value;t&&a(Number(t)),e.target.value=""},style:{padding:"4px 8px",fontSize:13,border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",background:"var(--bg-deep)",color:"var(--text-primary)",cursor:l?"not-allowed":"pointer",opacity:l?.6:1,...o},children:[(0,r.jsx)("option",{value:"",children:s}),d.map(e=>(0,r.jsx)("option",{value:e.id,children:e.name},e.id))]})}var ei=n(97860),es=n(55372),eo=n(83996),ed=n(63059),ec=n(67674),eu=n(14021),ep=n(13625),eg=n(31987);let ex={padding:"7px 10px",fontSize:13,border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",background:"var(--bg-deep)",color:"var(--text-primary)",cursor:"pointer"},eh={width:32,height:32,display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",background:"var(--bg-base)",color:"var(--text-secondary)",cursor:"pointer"},ev={padding:"6px 12px",fontSize:12,border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",background:"var(--bg-base)",color:"var(--text-secondary)",cursor:"pointer"};function ey(e){var t,n;let{taskId:l,projectId:o}=e,d=(0,u.c)("taskPrd"),c=(0,u.c)("common"),[p,g]=(0,s.useState)([]),[h,v]=(0,s.useState)([]),[y,b]=(0,s.useState)(""),[m,f]=(0,s.useState)(!0),[j,k]=(0,s.useState)(!1),[S,w]=(0,s.useState)(!1),[C,z]=(0,s.useState)(!1),[I,T]=(0,s.useState)("preview"),R=(0,s.useCallback)(async()=>{f(!0);try{if(null!=l){let[e,t]=await Promise.all([x.KG.list(l),x.$l.list(o)]);g(e),v(t),b(t=>{var n,r;return e.some(e=>e.id===t)?t:null!=(r=null==(n=e[0])?void 0:n.id)?r:""})}else{let e=(await x.$l.list(o)).filter(e=>e.prd);g(e),b(t=>{var n,r;return e.some(e=>e.id===t)?t:null!=(r=null==(n=e[0])?void 0:n.id)?r:""})}}catch(e){g([])}finally{f(!1)}},[l,o]);(0,s.useEffect)(()=>{R()},[R]);let W=null!=(t=p.find(e=>e.id===y))?t:null,D=h.filter(e=>!p.some(t=>t.id===e.id)),A=async e=>{k(!0);try{await e(),await R()}finally{k(!1)}},P=C&&null!=l?(0,r.jsx)(ep.O,{projectId:o,onClose:()=>z(!1),onCreated:async e=>{z(!1),await A(()=>x.KG.attach(l,e.id,!0))}}):null;if(m)return(0,r.jsx)("div",{style:{padding:20,fontSize:13,color:"var(--text-muted)"},children:c("loading")});if(0===p.length)return(0,r.jsxs)("div",{style:{padding:20,fontSize:13,color:"var(--text-muted)"},children:[null!=l?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{style:{marginTop:0},children:d("emptyTask")}),(0,r.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[(0,r.jsx)("button",{type:"button",style:{...ev,opacity:j?.6:1},disabled:j,onClick:()=>A(()=>x.KG.generate(l)),children:j?d("generating"):d("generateWithAi")}),(0,r.jsx)("button",{type:"button",style:{...ev,opacity:j?.6:1},disabled:j,onClick:()=>z(!0),children:d("createPrd")}),D.length>0&&(0,r.jsxs)(i.l,{style:ex,defaultValue:"",disabled:j,onChange:e=>e.target.value&&A(()=>x.KG.attach(l,e.target.value,!0)),children:[(0,r.jsx)("option",{value:"",children:d("attachExisting")}),D.map(e=>(0,r.jsx)("option",{value:e.id,children:e.goal||d("prdFallback",{id:e.id.slice(0,8)})},e.id))]})]})]}):(0,r.jsx)(r.Fragment,{children:d("emptyProject")}),P]});let M=null!=(n=null==W?void 0:W.prd)?n:"",H=(0,r.jsx)("div",{style:{fontSize:13,lineHeight:1.6,color:"var(--text-primary)"},children:"raw"===I?(0,r.jsx)("pre",{style:{margin:0,padding:"12px 14px",borderRadius:"var(--radius-md)",border:"1px solid var(--border-subtle)",background:"var(--bg-elevated)",color:"var(--text-primary)",overflowX:"auto",fontFamily:"'JetBrains Mono', 'Fira Code', monospace",fontSize:"0.78rem",lineHeight:1.6,whiteSpace:"pre-wrap"},children:M}):(0,r.jsx)(ed.v,{content:(0,eu.Sm)(M)})}
1),B=(0,r.jsx)(ec.a,{value:I,onChange:T,options:[{value:"preview",label:d("viewPreview")},{value:"raw",label:d("viewRaw")}]});return(0,r.jsxs)("div",{style:{padding:20},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12},children:[p.length>1?(0,r.jsx)(i.l,{value:y,onChange:e=>b(e.target.value),style:{...ex,flex:1},children:p.map(e=>(0,r.jsxs)("option",{value:e.id,children:[e.isPrimary?(0,r.jsx)(a.I,{source:"â
",size:"1em"}):"",e.goal||d("prdFallback",{id:e.id.slice(0,8)})," (",e.status,")"]},e.id))}):(0,r.jsxs)("div",{style:{flex:1,fontWeight:600,fontSize:14},children:[(null==W?void 0:W.isPrimary)?(0,r.jsx)(a.I,{source:"â
",size:"1em"}):"",(null==W?void 0:W.goal)||d("prdLabel"),(0,r.jsxs)("span",{style:{fontSize:12,color:"var(--text-muted)",fontWeight:400},children:[" \xb7 ",null==W?void 0:W.status]})]}),B,(0,r.jsx)("button",{type:"button",style:eh,title:d("expandFullScreen"),"aria-label":d("expandFullScreen"),onClick:()=>w(!0),children:(0,r.jsx)(a.I,{name:"maximize",size:16})})]}),null!=l&&W&&(0,r.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginBottom:12},children:[!W.isPrimary&&(0,r.jsx)("button",{type:"button",style:{...ev,opacity:j?.6:1},disabled:j,onClick:()=>A(()=>x.KG.setPrimary(l,W.id)),children:d("setPrimary")}),(0,r.jsx)("button",{type:"button",style:{...ev,opacity:j?.6:1},disabled:j,onClick:()=>A(()=>x.KG.detach(l,W.id)),children:d("detach")}),(0,r.jsx)("button",{type:"button",style:{...ev,opacity:j?.6:1},disabled:j,onClick:()=>z(!0),children:d("createPrd")}),D.length>0&&(0,r.jsxs)(i.l,{style:ex,value:"",disabled:j,onChange:e=>e.target.value&&A(()=>x.KG.attach(l,e.target.value)),children:[(0,r.jsx)("option",{value:"",children:d("attachExisting")}),D.map(e=>(0,r.jsx)("option",{value:e.id,children:e.goal||d("prdFallback",{id:e.id.slice(0,8)})},e.id))]})]}),P,H,S&&(0,eo.createPortal)((0,r.jsxs)("div",{role:"dialog","aria-modal":"true",style:{position:"fixed",inset:0,zIndex:10010,background:"var(--bg-base)",display:"flex",flexDirection:"column"},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 24px",borderBottom:"1px solid var(--border-subtle)"},children:[(0,r.jsx)("div",{style:{fontWeight:700,fontSize:16},children:(null==W?void 0:W.goal)||d("prdLabel")}),(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[B,(0,r.jsx)(eg.p,{onClose:()=>w(!1),label:d("exitFullScreen")})]})]}),(0,r.jsx)("div",{style:{flex:1,overflow:"auto",padding:"24px 32px",maxWidth:900,margin:"0 auto",width:"100%",boxSizing:"border-box"},children:H})]}),document.body)]})}let eb=(e,t)=>"".concat(null!=e?e:"",":").concat(t);var em=n(61359),ef=n(42325),ej=n(30515);let ek={completed:"success",waived:"warning",in_progress:"info",assigned:"neutral",changes_requested:"danger",unstaffed:"danger",pending:"neutral",skipped:"neutral"};function eS(e){let{state:t,label:n}=e;return(0,r.jsx)("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"var(--radius-full)",fontSize:11,fontWeight:600,...(0,U.Zm)(ek,t),whiteSpace:"nowrap"},children:n})}let ew={blocking:"danger",advisory:"warning"};function eC(e){let{gaps:t,tone:n,title:a}=e,l=(0,u.c)("accountability"),i=(0,em.d)();if(0===t.length)return null;let s=(0,U.Zm)(ew,n),o=(e,t)=>l.has(e)?l(e,t):e;return(0,r.jsxs)("div",{style:{border:"1px solid ".concat(s.borderColor),background:s.background,borderRadius:"var(--radius-lg)",padding:"10px 12px"},children:[(0,r.jsx)("div",{style:{fontSize:12,fontWeight:700,color:s.color,marginBottom:6},children:a}),(0,r.jsx)("ul",{style:{margin:0,paddingLeft:18,display:"flex",flexDirection:"column",gap:3},children:t.map((e,t)=>{var n;return(0,r.jsxs)("li",{style:{fontSize:12,color:s.color},children:[(0,r.jsx)("strong",{children:e.roleName}),e.responsibility?" \xb7 ".concat(o("responsibility.".concat(e.responsibility))):"",e.stageKey?" \xb7 ".concat(i(e.stageKey)):""," â ",o("unsigned"===e.kind&&e.state?"state.".concat(e.state):"gaps.kind.".concat(e.kind)),": ",o("waived"===e.kind?e.reason?"gaps.detail.waived":"gaps.detail.waived_no_reason":"unsigned"!==e.kind?"gaps.detail.".concat(e.kind):"pending"===e.state||"assigned"===e.state||"in_progress"===e.state?"gaps.detail.".concat(e.state):"gaps.detail.unsigned",e.reason?{reason:e.reason}:void 0)]},"".concat(null!=(n=e.stageKey)?n:"",":").concat(e.roleKey,":").concat(e.kind,":").concat(t))})})]})}function ez(e){var t,n;let{p:a,contribution:l}=e,i=(0,u.c)("accountability"),s=null!=l?l:a.evidence,o=[];return null!=a.childTaskId&&o.push("#".concat(a.childTaskId)),(null==s?void 0:s.executionId)!=null&&o.push(i("contribution.run",{id:s.executionId})),(null==s?void 0:s.prdRevision)!=null&&o.push(i("contribution.prd",{revision:s.prdRevision})),(null==s?void 0:s.toolRunId)&&o.push(i("contribution.test",{id:s.toolRunId})),(null==s||null==(t=s.diffFiles)?void 0:t.length)&&o.push(i("contribution.files",{count:s.diffFiles.length})),(0,r.jsxs)("span",{style:{color:"var(--text-secondary)"},children:[(null==s?void 0:s.prUrl)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("a",{href:s.prUrl,target:"_blank",rel:"noreferrer",children:i("contribution.pr")}),o.length?" \xb7 ":""]}),o.length?o.join(" \xb7 "):null!=(n=null==s?void 0:s.reviewThreadRef)?n:(null==s?void 0:s.prUrl)?"":"â"]})}let eI=["approved","changes_requested","waived"],eT=new Set(["waived"]);function eR(e){let{taskId:t}=e,n=(0,k.b)(),a=(0,ej.t)(),l=(0,u.c)("accountability"),o=(0,L.JT)("manager.manage").allowed,[d,c]=(0,s.use
1State)(null),[p,g]=(0,s.useState)([]),[h,v]=(0,s.useState)(!0),[y,b]=(0,s.useState)(null),[m,f]=(0,s.useState)(!1),[j,S]=(0,s.useState)(""),[w,C]=(0,s.useState)(""),[z,I]=(0,s.useState)(null),[T,R]=(0,s.useState)("approved"),[W,D]=(0,s.useState)(""),A=(0,s.useCallback)(()=>{v(!0),x.up.accountability(t).then(e=>{c(e),b(null)}).catch(e=>b(n(e))).finally(()=>v(!1))},[t,n]);(0,s.useEffect)(()=>{A()},[A]),(0,s.useEffect)(()=>{x.up.listRoles().then(g).catch(()=>g([]))},[]);let P=(0,s.useMemo)(()=>{var e;let t=new Map;for(let n of null!=(e=null==d?void 0:d.signoffs)?e:[])t.set(eb(n.laneKey,n.roleKey),n);return t},[d]),M=(0,s.useCallback)(async()=>{if(j){f(!0);try{await x.up.assessResource(t,{roleKey:j,note:w||void 0}),S(""),C(""),A()}catch(e){b(n(e))}finally{f(!1)}}},[t,j,w,A,n]),H=(0,s.useCallback)(async()=>{f(!0);try{await x.up.materializeParticipants(t),A()}catch(e){b(n(e))}finally{f(!1)}},[t,A,n]),B=(0,s.useCallback)(async()=>{if(z){f(!0);try{var e;await x.up.signoff(t,{roleKey:z.roleKey,laneKey:null!=(e=z.laneKey)?e:void 0,verdict:T,summary:W.trim()||void 0,waiveReason:"waived"===T?W.trim():void 0}),I(null),D(""),R("approved"),b(null),A()}catch(e){b(n(e))}finally{f(!1)}}},[t,z,T,W,A,n]),E=e=>l.has("verdict.".concat(e))?l("verdict.".concat(e)):e;if(h)return(0,r.jsx)("div",{style:{padding:16,color:"var(--text-muted)"},children:l("loading")});if(y)return(0,r.jsx)("div",{style:{padding:16,color:"var(--danger-text)"},children:y});if(!d)return null;let K=d.participants.filter(e=>e.required),F=d.gaps.filter(e=>"blocking"===e.severity),N=d.gaps.filter(e=>"blocking"!==e.severity);return(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:16,padding:4},children:[(0,r.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:12},children:[(0,r.jsx)("div",{style:{fontSize:15,fontWeight:700,color:"var(--text-primary)"},children:l("signedHeader",{done:d.completedCount,total:d.requiredCount})}),(0,r.jsx)("div",{style:{flex:1,minWidth:120,height:8,borderRadius:"var(--radius-full)",background:"var(--bg-deep)",overflow:"hidden"},children:(0,r.jsx)("div",{style:{width:"".concat(d.percentComplete,"%"),height:"100%",background:d.percentComplete>=100?"var(--success)":"var(--coral-bright)"}})}),(0,r.jsxs)("div",{style:{fontSize:13,fontWeight:600,color:"var(--text-secondary)"},children:[d.percentComplete,"%"]})]}),(0,r.jsx)(eC,{gaps:F,tone:"blocking",title:l("gaps.title",{count:F.length})}),(0,r.jsx)(eC,{gaps:N,tone:"advisory",title:l("gaps.outstandingTitle",{count:N.length})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{style:{fontSize:13,fontWeight:700,color:"var(--text-primary)",marginBottom:6},children:l("table.title")}),(0,r.jsx)("div",{style:ef.eo,children:(0,r.jsxs)("table",{style:ef.c1,children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{style:ef.ew,children:[(0,r.jsx)("th",{style:ef.qb,children:l("table.role")}),(0,r.jsx)("th",{style:ef.qb,children:l("table.who")}),(0,r.jsx)("th",{style:ef.qb,children:l("table.state")}),(0,r.jsx)("th",{style:ef.qb,children:l("table.verdict")}),(0,r.jsx)("th",{style:ef.qb,children:l("table.when")}),(0,r.jsx)("th",{style:ef.qb,children:l("table.comments")}),(0,r.jsx)("th",{style:ef.qb,children:l("table.contribution")}),(0,r.jsx)("th",{style:ef.qb,children:l("table.action")})]})}),(0,r.jsxs)("tbody",{children:[0===K.length&&(0,r.jsx)("tr",{style:ef.wX,children:(0,r.jsx)("td",{style:ef.dQ,colSpan:8,children:l("table.empty")})}),K.map(e=>{var t,n,o,d,c;let u,p=P.get(eb(e.stageKey,e.roleKey)),g=(null==z?void 0:z.roleKey)===e.roleKey&&z.laneKey===(null!=(t=e.stageKey)?t:null),x="completed"!==e.state&&"waived"!==e.state&&"skipped"!==e.state;return(0,r.jsxs)(s.Fragment,{children:[(0,r.jsxs)("tr",{style:ef.wX,children:[(0,r.jsxs)("td",{style:ef.Qm,children:[(0,r.jsx)("div",{style:{fontWeight:600,color:"var(--text-primary)"},children:e.roleName}),(0,r.jsxs)("div",{style:{fontSize:11,color:"var(--text-muted)"},children:[l.has("responsibility.".concat(e.responsibility))?l("responsibility.".concat(e.responsibility)):e.responsibility,"template"!==e.source?" \xb7 ".concat(l("addedBadge")):""]})]}),(0,r.jsx)("td",{style:ef.Qm,children:null!=(o=null!=(n=null==p?void 0:p.memberName)?n:e.assigneeName)?o:(0,r.jsx)("span",{style:{color:"var(--text-muted)"},children:l("unassigned")})}),(0,r.jsx)("td",{style:ef.Qm,children:(0,r.jsx)(eS,{state:e.state,label:(u=e.state,l.has("state.".concat(u))?l("state.".concat(u)):u)})}),(0,r.jsx)("td",{style:ef.Qm,children:p?(0,r.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[E(p.verdict),p.autoAttested&&(0,r.jsx)("span",{title:l("autoAttested.help"),style:{padding:"1px 6px",borderRadius:"var(--radius-full)",fontSize:10,fontWeight:700,background:"var(--warning-bg)",color:"var(--warning-text)",whiteSpace:"nowrap"},children:l("autoAttested.badge")})]}):(0,r.jsx)("span",{style:{color:"var(--text-muted)"},children:"â"})}),(0,r.jsx)("td",{style:ef.dQ,children:p?a.dateTime(p.createdAt):"â"}),(0,r.jsx)("td",{style:ef.dQ,children:null!=(c=null!=(d=null==p?void 0:p.summary)?d:null==p?void 0:p.waiveReason)?c:"â"}),(0,r.jsx)("td",{style:ef.Qm,children:(0,r.jsx)(ez,{p:e,contribution:null==p?void 0:p.contribution})}),(0,r.jsx)("td",{style:ef.Qm,children:x&&(0,r.jsx)("button",{type:"button",onClick:()=>{var t;I(g?null:{roleKey:e.roleKey,laneKey:null!=(t=e.stageKey)?t:null}),D(""),R("approved")},style:{padding:"4px 10px",fontSize:12,fontWeight:600,borderRadius:"var(--radius-md)",whiteSpace:"nowrap",border:"1px solid var(--border-subtle)",background:"var(--bg-base)",color:"var(--text-secondary)",cursor:"pointer"},children:g?l("signoff.cancel"):l("signoff.action")})})]}),g&&(0,r.jsx)("tr",{style:ef.wX,children:(0,r.jsxs)("td",{style:{...ef.Qm,background:"var(--bg-deep)"},colSpan:8,children:[(0,r.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[(0,r.jsx)(i.l,{value:T,onChange:e=>R(e.target.value),"aria-label":l("table.verdict"),style:{padding:"7px 10px",fontSize:13,borderRadius:"var(--radius-md)",border:"1px solid var(--border-subtle)",background:"var(--bg-base)",color:"var(--text-primary)"},children:eI.map(e=>(0,r.jsx)("option",{value:e,style:{background:"var(--bg-base)",color:"var(--text-primary)"},children:E(e)},e))}),(0,r.jsx)("input",{value:W,onChange:e=>D(e.target.value),placeholder:eT.has(T)?l("signoff.reasonRequired"):l("signoff.summaryPlaceholder"),style:{flex:"1 1 200px",minWidth:0,padding:"7px 10px",fontSize:13,borderRadius:"var(--radius-md)",border:"1px solid var(--border-subtle)",background:"var(--bg-base)",color:"var(--text-primary)"}}),(0,r.jsx)("button",{type:"button",onClick:B,disabled:m||eT.has(T)&&!W.trim(),style:{padding:"7px 14px",fontSize:13,fontWeight:700,borderRadius:"var(--radius-md)",border:"none",background:"var(--coral-bright)",color:"var(--text-on-accent)",cursor:m?"not-allowed":"pointer",opacity:m||eT.has(T)&&!W.trim()?.6:1},children:m?l("signoff.recording"):l("signoff.confirm",{role:e.roleName})})]}),(0,r.jsx)("div",{style:{fontSize:11,color:"var(--text-muted)",marginTop:6},children:l("signoff.help")})]})})]},e.id)})]})]})})]}),o&&(0,r.jsxs)("div",{style:{border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-lg)",padding:"12px",display:"flex",flexDirection:"column",gap:8},children:[(0,r.jsx)("div",{style:{fontSize:13,fontWeight:700,color:"var(--text-primary)"},children:l("assess.title")}),(0,r.jsx)("div",{style:{fontSize:12,color:"var(--text-muted)"},children:l("assess.help")}),(0,r.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center"},children:[(0,r.jsxs)(i.l,{value:j,onChange:e=>S(e.target.value),"aria-label":l("assess.rolePlaceholder"),style:{padding:"7px 10px",fontSize:13,borderRadius:"var(--radius-md)",border:"1px solid var(--border-subtle)",background:"var(--bg-deep)",color:"var(--text-primary)"},children:[(0,r.jsx)("option",{value:"",style:{background:"var(--bg-deep)",color:"var(--text-primary)"},children:l("assess.rolePlaceholder")}),p.map(e=>(0,r.jsx)("option",{value:e.key,style:{background:"var(--bg-deep)",color:"var(--text-primary)"},children:e.name},e.key))]}),(0,r.jsx)("input",{value:w,onChange:e=>C(e.target.value),placeholder:l("assess.notePlaceholder"),style:{flex:1,minWidth:160,padding:"7px 10px",fontSize:13,borderRadius:"var(--radius-md)",border:"1px solid var(--border-subtle)",background:"var(--bg-deep)",color:"var(--text-primary)"}}),(0,r.jsx)("button",{onClick:M,disabled:!j||m,style:{padding:"7px 14px",fontSize:13,fontWeight:600,borderRadius:"var(--radius-md)",border:"none",cursor:j&&!m?"pointer":"not-allowed",background:"var(--coral-bright)",color:"var(--text-on-accent)",opacity:j&&!m?1:.6},children:l("assess.add")})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("button",{onClick:H,disabled:m,style:{padding:"7px 14px",fontSize:12,fontWeight:600,borderRadius:"var(--radius-md)",border:"1px solid var(--border-subtle)",background:"var(--bg-base)",color:"var(--text-secondary)",cursor:m?"not-allowed":"pointer"},children:l("assess.materialize")}),(0,r.jsx)("span",{style:{marginLeft:8,fontSize:11,color:"var(--text-muted)"},children:l("assess.materializeHelp")})]})]})]})}var eW=n(12397),eD=n(56985),eA=n(49049),eP=n(42449);let eM={fontSize:10,padding:"2px 6px",borderRadius:"var(--radius-sm)"};function eH(e){var t,n,l,i,s;let{task:o,flagged:d=!1,participants:c=null,showPriority:p=!0,showKey:g=!1}=e,x=(0,u.c)("board"),h=(0,u.c)("common"),v=(0,u.c)("planning"),y="epic"===o.taskType?(0,eP.Az)(o.decompositionSource):null,b="epic"===o.taskType?(0,eP.pH)(o.planVerdict):[],m=(0,eW.B)(o.taskType),f="complete"===(s=o.lastReviewVerdict)?{color:"var(--success-text, var(--success))",glyph:"â"}:"gaps"===s?{color:"var(--warning-text, var(--warning))",glyph:"â "}:{color:"var(--text-secondary)",glyph:"â»"};return(0,r.jsxs)(r.Fragment,{children:[g&&(0,r.jsx)("span",{style:{fontFamily:"var(--font-mono)"},children:o.key}),p&&(0,r.jsx)("span",{className:(0,eD.Xl)(o.priority),style:{...eM,textTransform:"capitalize"},children:o.priority}),m&&(0,r.jsx)("span",{className:m,style:eM,children:h((0,eW.d)(o.taskType))}),o.reviewCount?(0,r.jsxs)("span",{title:"complete"===o.lastReviewVerdict?h("reviewComplete"):"gaps"===o.lastReviewVerdict?h("reviewGaps"):void 0,style:{...eM,display:"inline-flex",alignItems:"center",gap:3,background:"var(--bg-elevated)",color:f.color,fontWeight:600},children:[(0,r.jsx)(a.I,{source:f.glyph,size:13})," ",h("reviewedTimes",{count:o.reviewCount})]}):null,d&&(0,r.jsxs)("span",{title:x("audit.flaggedTitle"),style:{...eM,display:"inline-flex",alignItems:"center",gap:3,background:"var(--danger-bg)",color:"var(--danger-text)",fontWeight:700},children:[(0,r.jsx)(a.I,{source:"â",size:"1em"})," ",x("audit.flagged")]}),c&&c.required>0&&(0,r.jsxs)("span",{title:x("audit.participantsTitle"),style:{...eM,display:"inline-flex",alignItems:"center",gap:3,fontWeight:700,background:c.percent>=100?"var(--success-bg)":"var(--bg-deep)",color:c.percent>=100?"var(--success-text)":"var(--text-secondary)"},children:[(0,r.jsx)(a.I,{source:"â
",size:"1em"})," ",c.completed,"/",c.required]}),c&&(null!=(t=c.unstaffed)?t:0)>0&&(0,r.jsxs)("span",{title:x("audit.unstaffedTitle",{count:null!=(n=c.unstaffed)?n:0}),style:{...eM,display:"inline-flex",alignItems:"center",gap:3,fontWeight:700,background:"var(--danger-bg)",color:"var(--danger-text)"},children:[(0,r.jsx)(a.I,{source:"\uD83D\uDC64",size:"1em"})," ",x("audit.unstaffed",{count:null!=(l=c.unstaffed)?l:0})]}),null!=o.businessValue&&(0,r.jsx)("span",{title:null!=(i=o.businessValueRationale)?i:x("businessValue.badgeTitle"),style:{...eM,background:"var(--surface-interactive, var(--bg-elevated))",color:"var(--text-secondary)",fontWeight:700},children:x("businessValue.badge",{value:o.businessValue})}),(0,r.jsx)(eA.c,{status:o.buildStatus}),y&&(0,r.jsxs)("span",{title:v(y.titleKey),style:{...eM,display:"inline-flex",alignItems:"center",gap:3,fontWeight:700,background:"warn"===y.tone?"var(--warning-bg, var(--bg-elevated))":"var(--bg-elevated)",color:"warn"===y.tone?"var(--warning-text, var(--warning))":"accent"===y.tone?"var(--accent)":"var(--text-secondary)"},children:[(0,r.jsx)(a.I,{source:"warn"===y.tone?"â ":"â¨",size:"1em"})," ",v(y.labelKey)]}),b.map(e=>(0,r.jsxs)("span",{title:v(e.titleKey,{count:e.count}),style:{...eM,display:"inline-flex",alignItems:"center",gap:3,fontWeight:700,background:"danger"===e.tone?"var(--danger-bg)":"var(--warning-bg, var(--bg-elevated))",color:"danger"===e.tone?"var(--danger-text)":"var(--warning-text, var(--warning))"},children:[(0,r.jsx)(a.I,{source:"cyclic"===e.kind?"\uD83D\uDD01":"â±",size:"1em"})," ",v(e.labelKey,{count:e.count})]},e.kind)),o.specCount?(0,r.jsxs)("span",{title:x("prdBadgeTitle",{count:o.specCount}),style:{...eM,background:"var(--bg-elevated)",color:"var(--text-secondary)"},children:[(0,r.jsx)(a.I,{source:"\uD83D\uDCC4",size:"1em"})," PRD",o.specCount>1?" \xd7".concat(o.specCount):""]}):null]})}let eB={border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-lg)",padding:12,background:"var(--bg-elevated)",display:"flex",flexDirection:"column",gap:8,minWidth:0},eE={fontSize:"var(--font-size-field-label)",fontWeight:700,letterSpacing:.6,textTransform:"uppercase",color:"var(--text-muted)"},eL={border:"none",background:"none",padding:0,font:"inherit",color:"var(--coral-bright)",fontWeight:600,cursor:"pointer",textAlign:"left"},eK="pmo.objectives.link";function eF(e){var t;let{taskId:n,projectId:a,onLinked:l}=e,o=(0,k.b)(),d=(0,u.c)("ticketContext"),{allowed:c}
1=(0,L.JT)(eK),[p,h]=(0,s.useState)({status:"loading"}),[v,y]=(0,s.useState)(0),[b,m]=(0,s.useState)(""),[f,j]=(0,s.useState)(!1),[S,w]=(0,s.useState)(null);(0,s.useEffect)(()=>{let e=!0;return x.Zu.objectives.list().then(t=>{e&&h({status:"ready",rows:t})}).catch(t=>{e&&h({status:"failed",detail:o(t)})}),()=>{e=!1}},[v,o]);let C=(0,s.useCallback)(()=>{h({status:"loading"}),y(e=>e+1)},[]),z=(0,s.useMemo)(()=>(function(e,t){let n=(e,t)=>e.title.localeCompare(t.title),r=e=>null!=t&&e.projectId===t;return{project:e.filter(r).sort(n),other:e.filter(e=>!r(e)).sort(n)}})("ready"===p.status?p.rows:[],a),[p,a]),I=(0,s.useCallback)(()=>{b&&c&&(j(!0),w(null),x.Zu.objectives.addLink(b,{linkKind:"task",taskId:n}).then(()=>{m(""),l()}).catch(e=>w(o(e))).finally(()=>j(!1)))},[b,c,n,l,o]),T="ready"===p.status&&0===p.rows.length,R=!c||f||"ready"!==p.status||T,W=!c||f||!b,D=e=>(0,r.jsx)("option",{value:e.id,children:e.period?"".concat(e.title," \xb7 ").concat(e.period):e.title},e.id),A=z.project.length>0&&z.other.length>0?[(0,r.jsx)("optgroup",{label:d("projectObjectives"),children:z.project.map(D)},"project"),(0,r.jsx)("optgroup",{label:d("otherObjectives"),children:z.other.map(D)},"other")]:[...z.project,...z.other].map(D);return(0,r.jsxs)("div",{style:{...eB,gap:8},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,r.jsx)("span",{style:eE,children:d("objective")}),(0,r.jsx)("span",{style:{fontSize:"var(--font-size-small)",color:"var(--text-muted)",flex:"1 1 200px",minWidth:0},children:d("noObjective")})]}),(0,r.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[(0,r.jsxs)(i.l,{value:b,onChange:e=>m(e.target.value),disabled:R,"aria-label":d("linkObjectiveLabel"),style:{flex:"1 1 200px",minWidth:0,fontSize:"var(--font-size-small)"},children:[(0,r.jsx)("option",{value:"",children:d("loading"===p.status?"loadingObjectives":"chooseObjective")}),A]}),(0,r.jsx)(g.RoleGate,{capability:eK,children:(0,r.jsx)("button",{type:"button",onClick:I,disabled:W,style:{padding:"6px 12px",borderRadius:"var(--radius-md)",border:"none",fontSize:"var(--font-size-small)",fontWeight:700,background:"var(--coral-bright)",color:"var(--text-on-accent)",cursor:W?"default":"pointer",opacity:W?.6:1},children:d(f?"linking":"linkObjective")})})]}),T&&(0,r.jsx)("span",{style:{fontSize:"var(--font-size-eyebrow)",color:"var(--text-muted)"},children:d("noObjectivesYet")}),"failed"===p.status&&(0,r.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[(0,r.jsx)("span",{role:"alert",title:null!=(t=p.detail)?t:void 0,style:{fontSize:"var(--font-size-eyebrow)",color:"var(--danger-text)"},children:d("loadObjectivesFailed")}),(0,r.jsx)("button",{type:"button",onClick:C,style:{...eL,fontSize:"var(--font-size-eyebrow)"},children:d("retryLoadObjectives")})]}),S&&(0,r.jsx)("span",{role:"alert",style:{fontSize:"var(--font-size-eyebrow)",color:"var(--danger-text)"},children:S})]})}function eN(e){let{percent:t,height:n=8}=e;return(0,r.jsx)("div",{role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":100,style:{height:n,borderRadius:"var(--radius-full)",background:"var(--bg-deep)",overflow:"hidden",width:"100%"},children:(0,r.jsx)("div",{style:{width:"".concat(Math.min(100,Math.max(0,t)),"%"),height:"100%",background:t>=100?"var(--success)":t>=50?"var(--coral-bright)":"var(--warning-text)",transition:"width .3s ease"}})})}function e_(e){let{children:t,value:n,percent:a}=e;return(0,r.jsxs)("div",{style:eB,children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:8},children:[(0,r.jsx)("span",{style:eE,children:t}),(0,r.jsx)("span",{style:{fontSize:18,fontWeight:800,color:"var(--text-primary)",lineHeight:1},children:n})]}),null!=a&&(0,r.jsx)(eN,{percent:a})]})}function eO(e){let{objective:t,onOpen:n}=e,a=(0,u.c)("ticketContext"),l=t.keyResults;return(0,r.jsxs)("div",{style:{...eB,gap:10},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:10,flexWrap:"wrap"},children:[(0,r.jsxs)("div",{style:{minWidth:0,flex:"1 1 200px"},children:[(0,r.jsxs)("div",{style:eE,children:[a("via.".concat(t.via)),t.viaLabel?" \xb7 ".concat(t.viaLabel):"",t.period?" \xb7 ".concat(t.period):""]}),(0,r.jsx)("button",{type:"button",onClick:n,style:{...eL,fontSize:14,marginTop:2},children:t.title})]}),(0,r.jsxs)("div",{style:{textAlign:"right",flexShrink:0},children:[(0,r.jsxs)("div",{style:{fontSize:18,fontWeight:800,color:"var(--text-primary)",lineHeight:1},children:[t.percent,"%"]}
1),(0,r.jsx)("div",{style:{fontSize:10,color:"var(--text-muted)"},children:a("objectiveAttained")})]})]}),(0,r.jsx)(eN,{percent:t.percent,height:6}),(0,r.jsx)("div",{style:{fontSize:12,color:"var(--text-secondary)",lineHeight:1.5},children:t.sharePercent>0?a.rich("objectiveShare",{share:t.sharePercent,done:t.linkedTaskDone,total:t.linkedTaskCount,b:e=>(0,r.jsx)("strong",{style:{color:"var(--text-primary)"},children:e})}):a("objectiveInherited")}),l.length>0&&(0,r.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:l.map(e=>(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:12,flexWrap:"wrap"},children:[(0,r.jsx)("span",{style:{flex:"1 1 140px",minWidth:0,color:"var(--text-secondary)"},children:e.title}),(0,r.jsx)("span",{style:{flex:"0 0 70px",maxWidth:70},children:(0,r.jsx)(eN,{percent:e.percent,height:5})}),(0,r.jsxs)("span",{style:{fontSize:11,fontWeight:700,color:"var(--text-muted)",minWidth:34,textAlign:"right"},children:[e.percent,"%"]})]},e.id))})]})}function eq(e){var t;let{taskId:n,onOpenEpic:a,onOpenTab:l,onChanged:i}
1=e,o=(0,k.b)(),d=(0,u.c)("ticketContext"),[c,p]=(0,s.useState)(null),[g,h]=(0,s.useState)(null),[v,y]=(0,s.useState)(!1),b=(0,s.useCallback)(()=>{let e=!0;return x.bI.context(n).then(t=>{e&&(p(t),h(null))}).catch(t=>{e&&h(o(t))}),()=>{e=!1}},[n,o]);(0,s.useEffect)(()=>b(),[b]);let m=(0,s.useCallback)(()=>{y(!0),x.up.coordinate(n).then(()=>{b(),null==i||i()}).catch(e=>h(o(e))).finally(()=>y(!1))},[n,b,i,o]);if(g)return(0,r.jsx)("div",{style:{fontSize:12,color:"var(--danger-text)",marginBottom:12},children:g});if(!c)return null;let{completion:f,signoff:j,epic:S,children:w,objectives:C}=c,z=null!=w?w:S;return(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:10,marginBottom:18},children:[(0,r.jsxs)("div",{style:{display:"grid",gap:10,gridTemplateColumns:"repeat(auto-fit, minmax(180px, 1fr))"},children:[(0,r.jsx)(e_,{value:f.isParked?d("parked"):"".concat(null!=(t=f.percent)?t:0,"%"),percent:f.isParked?null:f.percent,children:d("thisTicket")}),z&&(0,r.jsx)(e_,{value:"".concat(z.percent,"%"),percent:z.percent,children:w?d("thisEpic"):d("parentEpic")}),j.required>0&&(0,r.jsx)(e_,{value:"".concat(j.completed,"/").concat(j.required),percent:j.percent,children:d("signoffs")})]}),f.basis.length>0&&(0,r.jsx)("div",{style:{display:"flex",gap:10,flexWrap:"wrap",fontSize:11,color:"var(--text-muted)"},children:f.basis.map(e=>(0,r.jsxs)("span",{children:["lane"===e.kind?d("basisLane",{index:e.done,total:e.total}):"signoff"===e.kind?d("basisSignoff",{done:e.done,total:e.total}):d("basisChildren",{done:e.done,total:e.total}),e.weight<1?" \xb7 ".concat(d("basisWeight",{weight:Math.round(100*e.weight)})):""]},e.kind))}),S&&(0,r.jsxs)("div",{style:{...eB,flexDirection:"row",alignItems:"center",gap:10,flexWrap:"wrap"},children:[(0,r.jsx)("span",{style:eE,children:d("partOfEpic")}),(0,r.jsx)("button",{type:"button",onClick:()=>null==a?void 0:a(S.id),style:{...eL,fontSize:13,flex:"1 1 180px",minWidth:0},children:S.title}),(0,r.jsx)("span",{style:{fontSize:12,color:"var(--text-secondary)",whiteSpace:"nowrap"},children:d("epicChildren",{done:S.done,total:S.total})})]}),(j.outstandingRoles.length>0||j.gaps>0)&&(0,r.jsxs)("div",{style:{...eB,border:"1px solid var(--warning-border)",background:"var(--warning-bg)"},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,r.jsx)("span",{style:{...eE,color:"var(--warning-text)"},children:d("waitingOn")}),(0,r.jsx)("span",{style:{fontSize:13,color:"var(--warning-text)",flex:"1 1 180px",minWidth:0},children:j.outstandingRoles.length>0?j.outstandingRoles.join(" \xb7 "):d("gapsOnly",{count:j.gaps})})]}),(0,r.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[(0,r.jsx)("button",{type:"button",onClick:m,disabled:v,style:{padding:"6px 12px",borderRadius:"var(--radius-md)",border:"none",fontSize:12,fontWeight:700,background:"var(--coral-bright)",color:"var(--text-on-accent)",cursor:v?"default":"pointer",opacity:v?.65:1},children:v?d("dispatching"):d("dispatchReviewers")}),(0,r.jsx)("button",{type:"button",onClick:()=>null==l?void 0:l("accountability"),style:{padding:"6px 12px",borderRadius:"var(--radius-md)",border:"1px solid var(--border-subtle)",background:"var(--bg-base)",color:"var(--text-secondary)",fontSize:12,fontWeight:600,cursor:"pointer"},children:d("reviewSignoffs")})]})]}),C.length>0?C.map(e=>(0,r.jsx)(eO,{objective:e,onOpen:()=>{window.location.href="/pmo?objective=".concat(e.id)}},e.id)):(0,r.jsx)(eF,{taskId:n,projectId:c.projectId,onLinked:()=>{b(),null==i||i()}})]})}var eU=n(3948),eV=n(30886);function eG(e){let{task:t,label:n="Run",onRan:a,onAwaitingApproval:l,style:i}=e,{run:s,running:o,error:d}=(0,eV.J)({task:t,onRan:a,onAwaitingApproval:l});return(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-end",gap:6},children:[(0,r.jsx)(g.RoleGate,{capability:"runtime.execute",children:(0,r.jsxs)("button",{type:"button",onClick:()=>s(),disabled:o,style:{padding:"8px 16px",fontSize:13,fontWeight:600,border:"none",borderRadius:"var(--radius-md)",background:"linear-gradient(135deg, var(--coral-bright), var(--coral-dark))",color:"var(--text-on-accent)",cursor:o?"default":"pointer",opacity:o?.7:1,whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:6,...i}
1,children:[o?"Runningâ¦":n,!o&&(0,r.jsx)("svg",{viewBox:"0 0 24 24",style:{width:14,height:14,fill:"currentColor"},children:(0,r.jsx)("path",{d:"M8 5v14l11-7z"})})]})}),d&&(0,r.jsx)("div",{style:{fontSize:12,color:"var(--danger)"},children:d})]})}var eX=n(68263),eQ=n(69285);let eJ={background:"var(--bg-elevated)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"8px 12px",fontSize:13,outline:"none",width:"100%",boxSizing:"border-box"},eY={fontSize:12,fontWeight:600,color:"var(--text-secondary)",marginBottom:4,display:"block"},e$=e=>({padding:"8px 16px",borderRadius:"var(--radius-md)",fontSize:13,fontWeight:600,cursor:"pointer",border:e?"none":"1px solid var(--border-subtle)",background:e?"linear-gradient(135deg, var(--coral-bright), var(--coral-dark))":"var(--bg-elevated)",color:e?"var(--text-on-accent)":"var(--text-primary)"}),eZ=["project_bid","design","fte"],e0=["fixed_bid","hourly","fte"];function e1(e){let{ticketId:t,defaultRequirements:n,onClose:a,onPublished:l}=e,o=(0,u.c)("gigs"),[d,c]=(0,s.useState)("project_bid"),[p,g]=(0,s.useState)("fixed_bid"),[x,h]=(0,s.use
1State)(null!=n?n:""),[v,y]=(0,s.useState)(""),[b,m]=(0,s.useState)(""),[j,k]=(0,s.useState)("public"),[S,w]=(0,s.useState)(!1),[C,z]=(0,s.useState)(null),I=async()=>{w(!0),z(null);try{let{posting:e}=await (0,eQ.A$)({ticketId:t,postingType:d,engagementType:p,requirements:x.trim()||void 0,rateMinCents:v?Math.round(100*parseFloat(v)):void 0,rateMaxCents:b?Math.round(100*parseFloat(b)):void 0,visibility:j});l(e)}catch(e){z((0,H.yR)(e,o("publish.publishError")))}finally{w(!1)}};return(0,r.jsx)(f.M,{open:!0,onClose:a,title:o("publish.modalTitle"),width:"sheet",widthStorageKey:"marketplace-publish",children:(0,r.jsxs)("div",{style:{padding:20,display:"flex",flexDirection:"column",gap:12},children:[(0,r.jsx)("p",{style:{fontSize:12,color:"var(--text-muted)",margin:0},children:o("publish.modalSubtitle")}),(0,r.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(180px, 1fr))",gap:10},children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{style:eY,htmlFor:"mkt-posting",children:o("publish.postingType")}),(0,r.jsx)(i.l,{id:"mkt-posting",style:eJ,value:d,onChange:e=>{var t;c(t=e.target.value),"fte"===t?g("fte"):"fte"===p&&g("fixed_bid")},children:eZ.map(e=>(0,r.jsx)("option",{value:e,children:o("postingType.".concat(e))},e))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{style:eY,htmlFor:"mkt-engagement",children:o("publish.engagementType")}),(0,r.jsx)(i.l,{id:"mkt-engagement",style:eJ,value:p,onChange:e=>g(e.target.value),disabled:"fte"===d,children:e0.map(e=>(0,r.jsx)("option",{value:e,children:o("engagementType.".concat(e))},e))})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{style:eY,htmlFor:"mkt-req",children:o("publish.requirements")}),(0,r.jsx)("textarea",{id:"mkt-req",style:{...eJ,minHeight:90,resize:"vertical",fontFamily:"inherit"},placeholder:o("publish.requirementsPlaceholder"),value:x,onChange:e=>h(e.target.value)})]}),(0,r.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(140px, 1fr))",gap:10},children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{style:eY,htmlFor:"mkt-min",children:o("publish.rateMin")}),(0,r.jsx)("input",{id:"mkt-min",style:eJ,type:"number",min:0,value:v,onChange:e=>y(e.target.value)})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{style:eY,htmlFor:"mkt-max",children:o("publish.rateMax")}),(0,r.jsx)("input",{id:"mkt-max",style:eJ,type:"number",min:0,value:b,onChange:e=>m(e.target.value)})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{style:eY,htmlFor:"mkt-vis",children:o("publish.visibility")}),(0,r.jsxs)(i.l,{id:"mkt-vis",style:eJ,value:j,onChange:e=>k(e.target.value),children:[(0,r.jsx)("option",{value:"public",children:o("visibility.public")}),(0,r.jsx)("option",{value:"private",children:o("visibility.private")})]})]})]}),(0,r.jsx)("p",{style:{fontSize:11,color:"var(--text-muted)",margin:0},children:o("publish.rateHint")}),C&&(0,r.jsx)("div",{style:{fontSize:12,color:"var(--error-text)"},children:C}),(0,r.jsxs)("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:4},children:[(0,r.jsx)("button",{type:"button",style:e$(!1),onClick:a,children:o("publish.cancel")}),(0,r.jsx)("button",{type:"button",style:{...e$(!0),opacity:S?.7:1},disabled:S,onClick:I,children:S?o("publish.publishing"):o("publish.publishBtn")})]})]})})}var e2=n(55330),e6=n(50796),e3=n(37011),e8=n(89031);function e4(e){let{allowance:t}=e,n=(0,u.c)("board");return(null==t?void 0:t.overAllowance)?(0,r.jsxs)("div",{role:"status",style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:8,padding:"10px 12px",borderRadius:"var(--radius-md)",border:"1px solid var(--warning-border, var(--border-subtle))",background:"var(--warning-bg, var(--bg-elevated))",color:"var(--text-primary)",fontSize:"var(--font-size-small)",lineHeight:1.5},children:[(0,r.jsx)("strong",{children:n("allowance.title")}),(0,r.jsx)("span",{style:{color:"var(--text-secondary)"},children:n("allowance.detail",{used:t.used,limit:t.limit,plan:t.plan})}),(0,r.jsx)("span",{style:{color:"var(--text-muted)"},children:n("allowance.onPremNote")}),(0,r.jsx)(d(),{href:"/pricing",style:{marginLeft:"auto",color:"var(--link, var(--text-primary))",fontWeight:600,whiteSpace:"nowrap"},children:n("allowance.upgrade")})]}):null}let e5=eD.PN;function e7(e,t){return t?e.dateWith(t,{month:"short",day:"numeric"}):""}function e9(e){let{hosts:t,cloudAgents:n,members:a,hostId:l,agentRef:s,userId:o,onChange:d,autoFocus:c,disabled:p,onBlur:g,style:x}=e,h=(0,u.c)("taskMgmt");return(0,r.jsxs)(i.l,{autoFocus:c,disabled:p,onBlur:g,value:(0,m.tD)(l,s,o),onChange:e=>d((0,m.kx)(e.target.value)),style:x,children:[(0,r.jsx)("option",{value:"",children:h("unassigned")}),a.length>0&&(0,r.jsx)("optgroup",{label:h("teamMembers"),children:a.map(e=>(0,r.jsx)("option",{value:"u:".concat(e.id),children:e.name},"u:".concat(e.id)))}),t.length>0&&(0,r.jsx)("optgroup",{label:h("agentHosts"),children:t.map(e=>(0,r.jsx)("option",{value:"h:".concat(e.id),children:e.name},"h:".concat(e.id)))}),n.length>0&&(0,r.jsx)("optgroup",{label:h("cloudAgents"),children:n.map(e=>(0,r.jsx)("option",{value:"c:".concat(e.ref),children:e.name},"c:".concat(e.ref)))})]})}function te(e){var t,n,o,j,k,w,C,z,I,T,R,W,D,A,P;let{projectId:M,projectName:B,projects:E,compact:L=!1}=e,K=(0,ej.t)(),U=(0,u.c)("boardConfig"),V=(0,em.d)(),Q=(0,p.S)(),ee=(0,u.c)("board"),et=(0,u.c)("common"),er=(0,u.c)("taskMgmt"),eo=(0,u.c)("gigs"),eu=(0,u.c)("schedule"),ep=(0,v.H8)(),[ex,eh]=(0,s.use
1State)([]),[ev,eb]=(0,s.useState)(new Set),[ef,ek]=(0,s.useState)(new Map),[eS,ew]=(0,s.useState)(null!=(o=null!=E?E:null==ep?void 0:ep.projects)?o:[]),[eC,ez]=(0,s.useState)([]),[eI,eT]=(0,s.useState)([]),[eW,eA]=(0,s.useState)([]),[eP,eM]=(0,s.useState)(new Map),[eB,eE]=(0,s.useState)(!0),[eL,eK]=(0,s.useState)(null),[eF,eN]=(0,s.useState)(null),[e_,eO]=(0,s.useState)(null),[eV,eJ]=(0,s.useState)("board"),[eY,e$]=(0,s.useState)(!1),[eZ,e0]=(0,s.useState)(new Set),[te,tt]=(0,s.useState)(null),[tn,tr]=(0,s.useState)(""),[ta,tl]=(0,s.useState)(null!=M?String(M):""),[ti,ts]=(0,s.useState)(""),[to,td]=(0,s.useState)(""),[tc,tu]=(0,s.useState)([]),[tp,tg]=(0,s.useState)(!1),[tx,th]=(0,s.useState)(null),[tv,ty]=(0,s.useState)({status:"todo",priority:"medium"}),[tb,tm]=(0,s.useState)(!1),[tf,tj]=(0,s.useState)(null),{effectiveWidth:tk,showControl:tS,chooseWidth:tw}=(0,Z.A4)("task-detail","wide"),[tC,tz]=(0,s.useState)(""),[tI,tT]=(0,s.useState)([]),[tR,tW]=(0,s.useState)(""),[tD,tA]=(0,s.useState)(null),[tP,tM]=(0,s.useState)(!1),[tH,tB]=(0,s.use
1State)("lanes"),[tE,tL]=(0,s.useState)(null),[tK,tF]=(0,s.useState)(!1),[tN,t_]=(0,s.useState)("details"),[tO,tq]=(0,s.useState)(null),[tU,tV]=(0,s.useState)(null),[tG,tX]=(0,s.useState)(""),[tQ,tJ]=(0,s.useState)(!1),[tY,t$]=(0,s.useState)(void 0),[tZ,t0]=(0,s.useState)(!1),[t1,t2]=(0,s.useState)(!1),t6=(0,s.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"details";t_(t),tj(e)},[]),t3=(0,s.useCallback)(e=>{let t=ex.find(t=>t.id===e);if(t)return void t6(t);x.bI.get(e).then(t6).catch(()=>{})},[ex,t6]),t8=(0,c.useRouter)(),t4=(0,c.useSearchParams)(),t5=(0,s.useRef)(null),t7=(0,s.useCallback)(()=>{if(tj(null),tq(null),null==t4?void 0:t4.get("task")){let e=new URLSearchParams(Array.from(t4.entries()));e.delete("task");let t=e.toString();t8.replace(t?"?".concat(t):"?",{scroll:!1})}},[t4,t8]);(0,s.useEffect)(()=>{let e=null==t4?void 0:t4.get("task");if(!e)return;let t=Number(e);if(!Number.isInteger(t)||t<=0||(null==tf?void 0:tf.id)===t||t5.current===e)return;let n=ex.find(e=>e.id===t);if(n){t5.current=e,t6(n);return}let r=!0;return x.bI.get(t).then(t=>{r&&t&&t5.current!==e&&(t5.current=e,t6(t))}).catch(()=>{}),()=>{r=!1}},[t4,ex,t6,null==tf?void 0:tf.id]),(0,s.useEffect)(()=>{let e=null==tf?void 0:tf.id;if(null==e||(null==tf?void 0:tf.restricted))return void t$(void 0);let t=!0;return t$(void 0),(0,eQ.rw)(e).then(e=>{t&&t$(e)}).catch(()=>{t&&t$(null)}),()=>{t=!1}},[null==tf?void 0:tf.id,null==tf?void 0:tf.restricted]);let t9=async()=>{if(tf){t2(!0);try{await (0,eQ.tu)(tf.id),t$(null)}catch(e){}finally{t2(!1)}}},ne=(0,s.useCallback)(e=>e.restricted?et("clearanceNeeded"):e.title,[et]);(0,s.useEffect)(()=>{let e=null==eF?void 0:eF.approvalId;if(!e)return void eO(null);let t=!0;return x.p.get(e).then(e=>{t&&eO(e)}).catch(()=>{t&&eO(null)}),()=>{t=!1}},[null==eF?void 0:eF.approvalId]);let nt=(0,s.useCallback)(async e=>{(null==e?void 0:e.background)||eE(!0),eK(null);try{let[e,t,n,r,a,l]=await Promise.all([x.bI.list(M),x.pA.list().catch(()=>[]),x.Aq.runTargets().catch(()=>({hosts:[],cloudAgents:[]})),x.bI.assignees().catch(()=>[]),null!=M?(0,y.us)(M).catch(()=>null):Promise.resolve(null),x.up.assignable().catch(()=>({agents:[],humans:[],hires:[]}))]);eh(e);let i=(null==a?void 0:a.scopedToTeams)?new Set(a.workforce.map(e=>"".concat(e.kind,":").concat(e.ref))):null;ez(i?t.filter(e=>i.has("host_agent:".concat(e.id))):t),eT(i?n.cloudAgents.filter(e=>i.has("cloud_agent:".concat(e.ref))):n.cloudAgents);let s=i?r.filter(e=>i.has("human:".concat(e.id))):r,o=l.hires.map(e=>({id:e.ref,name:e.name}));if(eA([...s,...o.filter(e=>!s.some(t=>t.id===e.id))]),E)ew(E);else if(!ep){let e=await (0,h.vj)().catch(()=>[]);ew(e)}}catch(e){eK((0,H.yR)(e,er("errLoad")))}finally{(null==e?void 0:e.background)||eE(!1)}},[M,E,ep]);(0,s.useEffect)(()=>{!E&&ep&&ew(ep.projects)},[E,ep]),(0,s.useEffect)(()=>{nt()},[nt]),(0,b.B)(["tasks","executions","projects","boards"],()=>{nt({background:!0})}),(0,s.useEffect)(()=>{"board"===eV&&(tT([]),tW(""))},[eV]),(0,s.useEffect)(()=>{tV(null)},[null==tf?void 0:tf.id,tN]),(0,s.useEffect)(()=>{if(!tf||tU)return;let e=ex.find(e=>e.id===tf.id);e&&e!==tf&&tj(e)},[ex,tf,tU]);let nn=e=>{var t,n;return e?null!=(n=null==(t=eS.find(t=>t.id===e))?void 0:t.name)?n:String(e):"â"},nr=e=>(0,m.z3)(e.assignedAgentHostId,e.assignedAgentRef,e.assignedUserId,eC,eI,eW),na=(0,s.useCallback)(e=>{let t=null==e?void 0:eP.get(e);return null==M&&t?{hosts:eC.filter(e=>t.has("host_agent:".concat(e.id))),cloudAgents:eI.filter(e=>t.has("cloud_agent:".concat(e.ref))),members:eW.filter(e=>t.has("human:".concat(e.id)))}:{hosts:eC,cloudAgents:eI,members:eW}},[M,eP,eC,eI,eW]);(0,s.useEffect)(()=>{if(null!=M)return;let e=[...new Set(ex.map(e=>e.projectId).filter(e=>null!=e))].filter(e=>!eP.has(e));if(0===e.length)return;let t=!0;return Promise.all(e.map(async e=>{let t=await (0,y.us)(e).catch(()=>null);return[e,(null==t?void 0:t.scopedToTeams)?new Set(t.workforce.map(e=>"".concat(e.kind,":").concat(e.ref))):null]})).then(e=>{t&&eM(t=>{let n=new Map(t);for(let[t,r]of e)n.set(t,r);return n})}),()=>{t=!1}},[M,ex,eP]);let nl=e=>(0,m.tD)(e.assignedAgentHostId,e.assignedAgentRef,e.assignedUserId),ni=null!=M?M:ta?Number(ta):void 0,ns=null!=M?B:nn(ni);(0,s.useEffect)(()=>
1{if(null==ni)return void eb(new Set);let e=!0;return x.up.flaggedForProject(ni).then(t=>{e&&eb(new Set(t.map(e=>e.taskId)))}).catch(()=>{e&&eb(new Set)}),x.up.participantsSummary(ni).then(t=>{e&&ek(new Map(t.map(e=>[e.taskId,{completed:e.completed,required:e.required,percent:e.percent}])))}).catch(()=>{e&&ek(new Map)}),()=>{e=!1}},[ni,ex]);let{board:no,lanes:nd,agentsByLane:nc,cloudRunAllowance:nu,reload:np}=S(ni,null!=ni&&"board"===eV&&!L),ng=(0,s.useMemo)(()=>{let e=nd.filter(e=>e.isTerminal).map(e=>e.key);return new Set(e.length>0?e:["done"])},[nd]),nx=ex.filter(e=>{if(tn&&e.status!==tn||ta&&String(e.projectId)!==ta||ti&&e.priority!==ti||to&&!e.title.toLowerCase().includes(to.toLowerCase())||(null==no?void 0:no.hideDoneItems)&&"board"===eV&&ng.has(e.status))return!1;if(tc.length>0){let t=(0,m.tD)(e.assignedAgentHostId,e.assignedAgentRef,e.assignedUserId);if(!tc.includes(t))return!1}return!0}),{executions:nh,dispatches:nv,refresh:ny}=function(e,t){let[n,r]=(0,s.useState)([]),[a,l]=(0,s.useState)([]),i=(0,s.useRef)(e);i.current=e;let o=(0,s.useCallback)(async()=>
1{let e=i.current,[t,n]=await Promise.all([x.bp.listRecent().catch(()=>null),e?x.G0.dispatches(e).catch(()=>null):Promise.resolve(null)]),a=!1;return t&&(r(t),a=a||t.some(e=>Y.has(e.status))),n&&(l(n),a=a||n.some(e=>Y.has(e.status))),a},[]),d=(0,s.useCallback)(()=>{o()},[o]);return(0,s.useEffect)(()=>{if(!t){r([]),l([]);return}let e=!1,n=null,a=async()=>{if(e)return;let t=await o();e||(n=setTimeout(a,t?8e3:3e4))};return a(),()=>{e=!0,n&&clearTimeout(n)}},[t,e,o]),{executions:n,dispatches:a,refresh:d}}("board"!==eV||L||null==no?void 0:no.id,"board"===eV||"table"===eV),nb=(0,s.useCallback)(()=>{nt({background:!0}),ny(),np()},[nt,ny,np]);(0,$.K)(null!=ni?"/api/projects/".concat(ni,"/stream"):null,nb);let nm=(0,s.useMemo)(()=>{let e=new Map;for(let t of nv){if(!t.assignmentId)continue;let n=e.get(t.assignmentId),r=t.updatedAt?new Date(t.updatedAt).getTime():0,a=(null==n?void 0:n.updatedAt)?new Date(n.updatedAt).getTime():-1;(!n||r>=a)&&e.set(t.assignmentId,t)}return e},[nv]),nf=(0,s.useMemo)(()=>{let e=()=>e8.Hi.map(e=>({id:e,status:e,label:V(e),agents:[]}));if(0===nd.length)return e();let t=[],n=new Set;for(let e of nd){var r;n.has(e.key)||(t.push({id:e.id,status:e.key,label:e.name,agents:null!=(r=nc[e.id])?r:[]}),n.add(e.key))}for(let e of ex)n.has(e.status)||(t.push({id:"orphan:".concat(e.status),status:e.status,label:V(e.status),agents:[]}),n.add(e.status));return t.length>0?t:e()},[nd,nc,ex,V]),nj=e=>e.map((e,t)=>({t:e,i:t})).sort((e,t)=>{var n,r;let a=null!=(n=e.t.managerRank)?n:1/0,l=null!=(r=t.t.managerRank)?r:1/0;return a!==l?a-l:e.i-t.i}).map(e=>e.t),nk=nf.map(e=>({value:e.status,label:e.label})),nS=e=>{var t,n;return null!=(n=null==(t=nf.find(t=>t.status===e))?void 0:t.label)?n:V(e)},nw=(0,s.useMemo)(()=>{let e=new Map;for(let t of nx){let n=(0,m.tD)(t.assignedAgentHostId,t.assignedAgentRef,t.assignedUserId),r=e.get(n);r?r.tasks.push(t):e.set(n,{key:n,name:nr(t),tasks:[t]})}return Array.from(e.values()).sort((e,t)=>""===e.key!=(""===t.key)?""===e.key?1:-1:e.name.localeCompare(t.name))},[nx,nr]),nC=(0,s.useCallback)((e,t)=>{if(!e)return;let n=e.slice(0,2),r=e.slice(2),a="u:"===n?"human":"c:"===n?"cloud_agent":"h:"===n?"host_agent":null;a&&r&&tt({kind:a,refId:r,name:t,tasks:ex.filter(t=>(0,m.tD)(t.assignedAgentHostId,t.assignedAgentRef,t.assignedUserId)===e)})},[ex]),nz=(0,s.useCallback)(e=>{e0(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),nI=(0,s.useMemo)(()=>{let e=new Map;for(let t of nh){let n=e.get(t.taskId),r=t.createdAt?new Date(t.createdAt).getTime():0,a=(null==n?void 0:n.createdAt)?new Date(n.createdAt).getTime():-1;(!n||r>=a)&&e.set(t.taskId,t)}return e},[nh]),nT=e=>e.cloudAgentRef?"c:".concat(e.cloudAgentRef):null!=e.agentHostId?"h:".concat(e.agentHostId):null!=e.agentId?"a:".concat(e.agentId):"agent",nR=e=>{var t,n,r,a,l,i;return null!=(i=null!=(l=e.cloudAgentRef?null!=(r=null==(t=eI.find(t=>t.ref===e.cloudAgentRef))?void 0:t.name)?r:"Agent ".concat(String(e.cloudAgentRef).slice(0,6)):null)?l:null!=e.agentHostId?null!=(a=null==(n=eC.find(t=>t.id===e.agentHostId))?void 0:n.name)?a:"AgentHost ".concat(e.agentHostId):null)?i:null!=e.agentId?"Agent ".concat(e.agentId):"Agent"},nW=(0,s.useMemo)(()=>{let e=new Map;for(let n of nh){var t;let r=null!=(t=e.get(n.taskId))?t:[],a=nT(n),l=n.createdAt?new Date(n.createdAt).getTime():0,i=r.find(e=>e.key===a);i?l>=i.ts&&(i.status=n.status,i.execId=n.id,i.ts=l):r.push({key:a,label:nR(n),status:n.status,execId:n.id,ts:l}),e.set(n.taskId,r)}for(let t of e.values())t.sort((e,t)=>t.ts-e.ts);return e},[nh,eI,eC]),nD=async e=>{var t,n,r,a,l,i,s,o,d,c,u,p,g;if(e.preventDefault(),null==(t=tv.title)?void 0:t.trim()){tm(!0);try{if(tx){let e=await x.bI.update(tx.id,{title:tv.title,description:null!=(n=tv.description)?n:null,
1status:null!=(r=tv.status)?r:tx.status,priority:null!=(a=tv.priority)?a:tx.priority,assignedAgentHostId:null!=(l=tv.assignedAgentHostId)?l:null,assignedAgentRef:null!=(i=tv.assignedAgentRef)?i:null,assignedUserId:null!=(s=tv.assignedUserId)?s:null,dueDate:null!=(o=tv.dueDate)?o:null});eh(t=>t.map(t=>t.id===e.id?e:t)),(null==tf?void 0:tf.id)===e.id&&tj(e)}else{let e=null!=M?M:tv.projectId;if(null==e)return void eK(er("errSelectProject"));let t=await x.bI.create({projectId:e,title:tv.title.trim(),description:tv.description||void 0,priority:null!=(d=tv.priority)?d:"medium",assignedAgentHostId:null!=(c=tv.assignedAgentHostId)?c:void 0,assignedAgentRef:null!=(u=tv.assignedAgentRef)?u:void 0,assignedUserId:null!=(p=tv.assignedUserId)?p:void 0,dueDate:tv.dueDate||void 0}),n=null!=(g=tv.status)?g:"todo",r="backlog"!==n?await x.bI.update(t.id,{status:n}):t;eh(e=>[r,...e])}tg(!1)}catch(e){eK((0,H.yR)(e,er("errSave")))}finally{tm(!1)}}},nA=async(e,t)=>{if((null==t||t.stopPropagation(),null==e?void 0:e.id)&&await Q(et("deleteNamedConfirm",{name:e.title})))try{await x.bI.delete(e.id),eh(t=>t.filter(t=>t.id!==e.id)),(null==tf?void 0:tf.id)===e.id&&tj(null)}catch(e){eK((0,H.yR)(e,er("errDelete")))}},nP=(0,s.useCallback)(async(e,t)=>{try{let n=await x.bI.update(e.id,t);eh(e=>e.map(e=>e.id===n.id?n:e)),tj(e=>e&&e.id===n.id?n:e)}catch(e){eK((0,H.yR)(e,eu("rescheduleFailed")))}},[eu]),nM=async e=>{if(tf){tJ(!0);try{let t=await x.bI.update(tf.id,e);eh(e=>e.map(e=>e.id===t.id?t:e)),tj(t),tV(null)}catch(e){eK((0,H.yR)(e,er("errSave")))}finally{tJ(!1)}}},nH=()=>{let e=tG.trim();if(""===e)return void nM({businessValue:null});let t=Number(e);if(Number.isNaN(t))return void tV(null);nM({businessValue:Math.max(0,Math.min(100,Math.round(t)))})},nB=async(e,t)=>{try{let n=await x.bI.update(e,{status:t});eh(e=>e.map(e=>e.id===n.id?n:e)),(null==tf?void 0:tf.id)===e&&tj(n),(0,X.r)("ticket_move",{ref:"task:".concat(e),metadata:{status:t}}),ny()}catch(e){eK((0,H.yR)(e,er("errUpdate")))}},nE=e=>e.preventDefault(),nL=async e=>{let t=tI.slice();for(let n of(tT([]),tW(""),t))await nB(n,e)},nK=async(e,t)=>{try{let n=await x.bI.move(e,t);eh(e=>e.map(e=>e.id===n.id?n:e)),(null==tf?void 0:tf.id)===e&&tj(null)}catch(e){eK((0,H.yR)(e,er("errMove")))}},nF=async e=>{let t=tI.slice();for(let n of(tT([]),t))await nK(n,e)},nN=(e,t)=>{e.preventDefault(),tC&&(nB(Number(tC),t),tz(""))},n_={background:"var(--bg-base)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-lg)",padding:16},nO={padding:"6px 12px",fontSize:13,fontWeight:600,background:"var(--bg-deep)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",cursor:"pointer"},nq={...nO,background:"linear-gradient(135deg, var(--coral-bright), var(--coral-dark))",color:"var(--text-on-accent)",border:"none"},nU=e=>{var t,n,l;let s=null!=(t=nW.get(e.id))?t:[];return(0,r.jsxs)("div",{draggable:!0,onDragStart:()=>tz(String(e.id)),onClick:()=>t6(e),style:{...n_,padding:12,cursor:"grab",position:"relative"},children:[(0,r.jsx)("div",{style:{position:"absolute",top:8,right:8},children:tD===e.id?(0,r.jsx)(i.l,{value:e.status,onChange:t=>{t.stopPropagation(),nB(e.id,t.target.value),tA(null)},onClick:e=>e.stopPropagation(),children:nk.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))}):(0,r.jsx)("span",{className:(0,e8.l$)(e.status),style:{fontSize:10,padding:"2px 8px",borderRadius:"var(--radius-sm)",textTransform:"capitalize",cursor:"pointer"},onClick:t=>{t.stopPropagation(),tA(e.id)},children:nS(e.status)})}),(0,r.jsxs)("div",{style:{fontWeight:500,fontSize:13,color:e.restricted?"var(--text-muted)":"var(--text-primary)",display:"flex",alignItems:"center",gap:6},children:[e.restricted&&(0,r.jsx)("span",{"aria-hidden":!0,style:{flexShrink:0},children:(0,r.jsx)(a.I,{source:"\uD83D\uDD12",size:"1em"})}),(0,r.jsx)("span",{style:e.restricted?{fontStyle:"italic"}:void 0,children:ne(e)})]}),(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,marginTop:6,fontSize:11,color:"var(--text-muted)",flexWrap:"wrap"},children:[(0,r.jsx)(eH,{task:e,showKey:!0,flagged:ev.has(e.id),participants:null!=(n=ef.get(e.id))?n:null}),s.length>0?s.map(t=>(0,r.jsx)(q.sJ,{label:t.label,status:t.status,meta:"completed"!==t.status?t.status:void 0,title:"".concat(t.label," â execution #").concat(t.execId," \xb7 ").concat(t.status,". Click to open the Agent tab."),onClick:t=>{t.stopPropagation(),t6(e,"agent")}},t.key)):e.assignedAgentHostId||e.assignedAgentRef||e.assignedUserId?e.assignedAgentHostId||e.assignedAgentRef?(0,r.jsx)(_.A,{selectValue:nl(e),children:(0,r.jsx)(q.sJ,{label:nr(e),status:"pending",meta:"pending",title:"".concat(nr(e)," â queued")})}):(0,r.jsx)(_.A,{selectValue:nl(e),children:(0,r.jsx)("span",{children:nr(e)})}):null,e.githubPrUrl&&(0,r.jsxs)("a",{href:e.githubPrUrl,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),style:{color:"var(--text-muted)",textDecoration:"none",fontWeight:600},children:["PR#",null!=(l=e.githubPrNumber)?l:"â"]}),e.dueDate&&(0,r.jsx)("span",{style:{marginLeft:"auto"},children:e7(K,e.dueDate)})]})]},e.id)};return(0,r.jsx)(N.H,{children:(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[eL&&(0,r.jsx)("div",{style:{padding:"10px 14px",borderRadius:"var(--radius-md)",background:"var(--error-bg)",border:"1px solid var(--error-border)",color:"var(--error-text)",fontSize:13},children:eL}),eF&&(0,r.jsxs)("div",{style:{padding:"10px 14px",borderRadius:"var(--radius-md)",background:"var(--warning-bg)",border:"1px solid var(--warning-border)",color:"var(--warning-text)",fontSize:13,display:"flex",justifyContent:"space-between",alignItems:"center",gap:12,flexWrap:"wrap"},children:[(0,r.jsxs)("span",{children:[eF.reason," ","(Task #",eF.taskId,", approval ",eF.approvalId.slice(0,8),"...)"]}),(0,r.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:12,flexWrap:"wrap"},children:[e_&&(0,r.jsx)(eX.l,{approval:e_,compact:!0,onResolved:e=>{eN(null),eO(null),"approved"===e.status&&nt({background:!0})}}),null!=ni&&(0,r.jsx)(g.RoleGate,{capability:"board.manageApproval",children:(0,r.jsx)("button",{type:"button",onClick:()=>{tB("settings"),tM(!0)},style:{fontWeight:700,color:"var(--coral-bright)",textDecoration:"none",background:"none",border:"none",cursor:"pointer",padding:0,font:"inherit"},children:U("bannerManage")})}),(0,r.jsx)(d(),{href:"/workforce?tab=approvals",style:{fontWeight:700,color:"var(--coral-bright)",textDecoration:"none"},children:er("openApprovals")})]})]}),!L&&(0,r.jsx)(e4,{allowance:nu}),!L&&(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:12},children:[(0,r.jsx)("div",{children:(0,r.jsxs)("span",{style:{fontSize:13,color:"var(--text-muted)"},children:[er("taskCount",{count:nx.length}),B?" \xb7 ".concat(B):""]})}),(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,r.jsx)(ec.a,{value:eV,onChange:eJ,board:!0,table:!0,calendar:!0,gantt:!0}
1),"board"===eV&&(0,r.jsx)(ec.a,{value:eY?"people":"stage",onChange:e=>e$("people"===e),options:[{value:"stage",label:er("byStage")},{value:"people",label:er("byAssignee")}]}),(0,r.jsx)("button",{type:"button",onClick:()=>{var e,t;th(null),ty({status:null!=(t=null==(e=nf[0])?void 0:e.status)?t:"todo",priority:"medium",...null!=M?{projectId:M}:{}}),tg(!0)},style:nq,children:er("newTask")}),null!=ni&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",onClick:()=>tL("standup"),style:nO,children:er("startStandup")}),(0,r.jsx)("button",{type:"button",onClick:()=>tL("planning"),style:nO,children:er("startPlanning")})]}),(()=>{let e=null!=ni,t={...nO,width:36,padding:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:e?1:.4,cursor:e?"pointer":"not-allowed"};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",onClick:()=>e&&tF(!0),disabled:!e,style:t,"aria-label":er("viewPrdAria"),title:e?er("viewPrdTitle"):er("viewPrdDisabledTitle"),children:(0,r.jsxs)("svg",{viewBox:"0 0 24 24",style:{width:18,height:18,stroke:"currentColor",fill:"none",strokeWidth:2},children:[(0,r.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,r.jsx)("path",{d:"M14 2v6h6"}),(0,r.jsx)("line",{x1:"8",y1:"13",x2:"16",y2:"13"}),(0,r.jsx)("line",{x1:"8",y1:"17",x2:"16",y2:"17"})]})}),(0,r.jsx)("button",{type:"button",onClick:()=>{e&&(tB("lanes"),tM(!0))},disabled:!e,style:t,"aria-label":er("configureBoardAria"),title:e?er("configureBoardTitle"):er("configureBoardDisabledTitle"),children:(0,r.jsxs)("svg",{viewBox:"0 0 24 24",style:{width:18,height:18,stroke:"currentColor",fill:"none",strokeWidth:2},children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,r.jsx)("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]})})]})})()]})]}),!L&&(0,r.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[(0,r.jsx)("input",{type:"text",placeholder:er("searchPlaceholder"),value:to,onChange:e=>td(e.target.value),style:{maxWidth:200,height:32,padding:"4px 10px",fontSize:13,border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",background:"var(--bg-deep)",color:"var(--text-primary)"}}),(0,r.jsxs)(i.l,{value:tn,onChange:e=>tr(e.target.value),style:{maxWidth:160,height:32,padding:"4px 10px",fontSize:13,border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",background:"var(--bg-deep)",color:"var(--text-primary)"},children:[(0,r.jsx)("option",{value:"",children:er("allStatuses")}),nk.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))]}),!M&&!ep&&(0,r.jsxs)(i.l,{value:ta,onChange:e=>tl(e.target.value),style:{maxWidth:180,height:32,padding:"4px 10px",fontSize:13,border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",background:"var(--bg-deep)",color:"var(--text-primary)"},children:[(0,r.jsx)("option",{value:"",children:er("allProjects")}),eS.map(e=>(0,r.jsx)("option",{value:String(e.id),children:e.name},e.id))]}),(0,r.jsxs)(i.l,{value:ti,onChange:e=>ts(e.target.value),style:{maxWidth:140,height:32,padding:"4px 10px",fontSize:13,border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",background:"var(--bg-deep)",color:"var(--text-primary)"},children:[(0,r.jsx)("option",{value:"",children:er("allPriorities")}),e5.map(e=>(0,r.jsx)("option",{value:e,children:e},e))]}),(0,r.jsx)(J,{tasks:ex,agentHosts:eC,cloudAgents:eI,members:eW,selectedAssignees:tc,onSelectAssignees:tu})]}),eB?(0,r.jsx)("div",{style:{color:"var(--text-muted)",fontSize:13},children:et("loading")}):"board"===eV&&eY?(0,r.jsx)("div",{style:{overflowX:"auto",WebkitOverflowScrolling:"touch",paddingBottom:4},children:0===nw.length?(0,r.jsx)("div",{style:{color:"var(--text-muted)",fontSize:13},children:er("noTasks")}):(0,r.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"minmax(140px, 200px) repeat(".concat(nf.length,", minmax(180px, 1fr))"),gap:8,minWidth:"min-content"},children:[(0,r.jsx)("div",{}),nf.map(e=>(0,r.jsx)("div",{style:{fontSize:12,fontWeight:600,color:"var(--text-muted)",padding:"0 4px 4px"},children:e.label},e.id)),nw.map(e=>{let t=e.key||"unassigned",n=eZ.has(t);return(0,r.jsxs)(s.Fragment,{children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:13,fontWeight:600,color:"var(--text-primary)",padding:"8px 4px",borderTop:"1px solid var(--border-subtle)",gridColumn:n?void 0:"1 / -1",position:n?"sticky":void 0,top:n?0:void 0,alignSelf:n?"start":void 0,zIndex:n?2:void 0,background:n?"var(--bg-surface)":void 0},children:[(0,r.jsx)("button",{type:"button",onClick:()=>nz(t),"aria-expanded":n,"aria-label":er(n?"collapseAssigneeRow":"expandAssigneeRow",{name:e.name}),style:{border:0,padding:2,background:"transparent",color:"var(--text-muted)",cursor:"pointer",lineHeight:1}
1,children:(0,r.jsx)("span",{"aria-hidden":!0,children:n?"â¾":"â¸"})}),e.key?(0,r.jsx)(_.A,{selectValue:e.key,children:(0,r.jsx)("a",{href:"#assignee-".concat(encodeURIComponent(e.key)),onClick:t=>{t.preventDefault(),nC(e.key,e.name)},style:{color:"var(--accent)",textDecoration:"underline",textUnderlineOffset:2},children:e.name})}):e.name,(0,r.jsx)("span",{style:{fontSize:11,fontWeight:500,color:"var(--text-muted)"},children:e.tasks.length})]}),n&&nf.map(t=>{let n=nj(e.tasks.filter(e=>e.status===t.status));return(0,r.jsx)("div",{onDragOver:nE,onDrop:e=>nN(e,t.status),style:{background:"var(--bg-deep)",border:"1px dashed var(--border-subtle)",borderRadius:"var(--radius-lg)",padding:8,display:"flex",flexDirection:"column",gap:8,minHeight:56,borderTop:"1px solid var(--border-subtle)"},children:n.map(e=>nU(e))},t.id)})]},t)})]})}):"board"===eV?(0,r.jsx)("div",{className:"task-kanban",style:{display:"grid",gridTemplateColumns:"repeat(".concat(nf.length,", minmax(200px, 1fr))"),gap:12,minHeight:200,overflowX:"auto",WebkitOverflowScrolling:"touch",scrollSnapType:"x proximity",paddingBottom:4},children:nf.map(e=>{let t=e.status,n=nj(nx.filter(e=>e.status===t));return(0,r.jsxs)("div",{onDragOver:nE,onDrop:e=>nN(e,t),style:{background:"var(--bg-deep)",border:"1px dashed var(--border-subtle)",borderRadius:"var(--radius-lg)",padding:12,display:"flex",flexDirection:"column",minHeight:120,scrollSnapAlign:"start"},children:[(0,r.jsxs)("div",{style:{marginBottom:8},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:12,fontWeight:600,color:"var(--text-muted)"},children:[(0,r.jsx)("span",{children:e.label}),(0,r.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[(0,r.jsx)(G,{tasks:n,isActive:e=>{var t;return(null!=(t=nW.get(e))?t:[]).some(e=>q.PF.has(e.status))},onDispatched:ny}),(0,r.jsx)("span",{children:n.length})]})]}),e.agents.length>0&&(0,r.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginTop:6},title:er("swimlaneAgentsTitle"),children:e.agents.map(e=>{var t,n;let a=nm.get(e.id),l=null!=(t=e.name)?t:e.role;return(0,r.jsx)(q.sJ,{label:l,status:null==a?void 0:a.status,meta:null!=(n=e.model)?n:e.runtime,title:"".concat(l," \xb7 ").concat(e.runtime).concat(e.model?" \xb7 ".concat(e.model):"").concat(a?" â ".concat(a.status):"")},e.id)})})]}),(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8,flex:1},children:[n.map(e=>nU(e)),!L&&(0,r.jsx)("button",{type:"button",onClick:()=>{ty({status:t,priority:"medium",...null!=M?{projectId:M}:{}}),th(null),tg(!0)},style:{...nO,borderStyle:"dashed",width:"100%",marginTop:4},children:"+ Add task"})]})]},e.id)})}):"calendar"===eV?(0,r.jsx)(e6.u,{items:nx,getLabel:ne,onSelect:e=>t6(e),onReschedule:nP}):"gantt"===eV?(0,r.jsx)(e3.I,{items:nx,getLabel:ne,onSelect:e=>t6(e),columnLabel:eu("columnTask"),emptyMessage:eu("emptyTasks"),onReschedule:nP}):(0,r.jsx)("div",{style:n_,children:0===nx.length?(0,r.jsx)("div",{style:{textAlign:"center",padding:24,color:"var(--text-muted)",fontSize:13},children:er("noTasks")}):(0,r.jsxs)(r.Fragment,{children:[tI.length>0&&(0,r.jsxs)("div",{style:{marginBottom:8,display:"flex",alignItems:"center",gap:12},children:[(0,r.jsxs)("span",{style:{fontSize:13,color:"var(--text-muted)"},children:[tI.length," selected"]}),(0,r.jsxs)(i.l,{value:tR,onChange:e=>{let t=e.target.value;t&&nL(t)},style:{padding:"4px 8px",fontSize:13},children:[(0,r.jsx)("option",{value:"",children:er("bulkChangeStatus")}),nk.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))]}),(0,r.jsx)(el,{projects:eS,currentProjectId:ni,onMove:nF})]}),(0,r.jsx)("div",{style:{overflowX:"auto"},children:(0,r.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[(0,r.jsx)("th",{style:{padding:"8px 12px"},children:(0,r.jsx)("input",{type:"checkbox",checked:nx.length>0&&tI.length===nx.length,onChange:()=>{tI.length===nx.length?tT([]):tT(nx.map(e=>e.id))}})}),(0,r.jsx)("th",{style:{textAlign:"left",padding:"8px 12px",color:"var(--text-muted)",fontWeight:600},children:er("colTask")}),(0,r.jsx)("th",{style:{textAlign:"left",padding:"8px 12px",color:"var(--text-muted)",fontWeight:600},children:er("status")}),(0,r.jsx)("th",{style:{textAlign:"left",padding:"8px 12px",color:"var(--text-muted)",fontWeight:600},children:er("priority")}),!M&&(0,r.jsx)("th",{style:{textAlign:"left",padding:"8px 12px",color:"var(--text-muted)",fontWeight:600},children:er("project")}),(0,r.jsx)("th",{style:{textAlign:"left",padding:"8px 12px",color:"var(--text-muted)",fontWeight:600},children:er("colAssignee")}),(0,r.jsx)("th",{style:{textAlign:"left",padding:"8px 12px",color:"var(--text-muted)",fontWeight:600},children:er("colDue")}),(0,r.jsx)("th",{style:{width:1}})]})}),(0,r.jsx)("tbody",{children:nx.map(e=>{var t;let n=nI.get(e.id);return(0,r.jsxs)("tr",{onClick:()=>t6(e),style:{borderBottom:"1px solid var(--border-subtle)",cursor:"pointer"},children:[(0,r.jsx)("td",{style:{padding:"10px 12px"},children:(0,r.jsx)("input",{type:"checkbox",checked:tI.includes(e.id),onClick:e=>e.stopPropagation(),onChange:t=>{var n;t.stopPropagation(),n=e.id,tT(e=>e.includes(n)?e.filter(e=>e!==n):[...e,n])}})}),(0,r.jsxs)("td",{style:{padding:"10px 12px"},children:[(0,r.jsxs)("div",{style:{fontWeight:500,color:e.restricted?"var(--text-muted)":"var(--text-primary)",fontStyle:e.restricted?"italic":void 0},children:[e.restricted&&(0,r.jsx)("span",{"aria-hidden":!0,style:{marginRight:6},children:(0,r.jsx)(a.I,{source:"\uD83D\uDD12",size:"1em"})}),ne(e)]}),(0,r.jsx)("div",{style:{fontSize:11,fontFamily:"var(--font-mono)",color:"var(--text-muted)"},children:e.key})]}),(0,r.jsx)("td",{style:{padding:"10px 12px"},onClick:e=>e.stopPropagation(),children:tD===e.id?(0,r.jsx)(i.l,{value:e.status,onChange:t=>{nB(e.id,t.target.value),tA(null)},onClick:e=>e.stopPropagation(),children:nk.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))}):(0,r.jsx)("span",{className:(0,e8.l$)(e.status),style:{fontSize:10,padding:"2px 8px",borderRadius:"var(--radius-sm)",textTransform:"capitalize",cursor:"pointer"},onClick:()=>tA(e.id),children:nS(e.status)})}),(0,r.jsx)("td",{style:{padding:"10px 12px"},children:(0,r.jsx)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:(0,r.jsx)(eH,{task:e,flagged:ev.has(e.id),participants:null!=(t=ef.get(e.id))?t:null})})}),!M&&(0,r.jsx)("td",{style:{padding:"10px 12px",fontSize:12,color:"var(--text-muted)"},children:nn(e.projectId)}),(0,r.jsx)("td",{style:{padding:"10px 12px",fontSize:12,color:"var(--text-muted)"},onClick:e=>e.stopPropagation(),children:n?(0,r.jsx)(q.sJ,{label:nR(n),status:n.status,meta:"completed"!==n.status?n.status:void 0,title:"".concat(nR(n)," â execution #").concat(n.id," \xb7 ").concat(n.status,". Click to open the Agent tab."),onClick:()=>t6(e,"agent")}):(0,r.jsx)(_.A,{selectValue:nl(e),children:nr(e)})}),(0,r.jsx)("td",{style:{padding:"10px 12px",fontSize:12,color:"var(--text-muted)"},children:e7(K,e.dueDate)}),(0,r.jsx)("td",{style:{padding:"10px 12px"},onClick:e=>e.stopPropagation(),children:(0,r.jsxs)("div",{style:{display:"flex",gap:4,alignItems:"center"},children:[(0,r.jsx)("button",{type:"button",style:{...nO,padding:"4px 8px",fontSize:12},onClick:()=>t6(e),children:et("view")}),(0,r.jsx)("button",{type:"button",style:{...nO,padding:"4px 8px",fontSize:12},onClick:t=>{null==t||t.stopPropagation(),th(e),ty({...e}),tg(!0)},children:et("edit")}),(0,r.jsx)(el,{projects:eS,currentProjectId:e.projectId,onMove:t=>nK(e.id,t),label:er("move"),style:{padding:"4px 6px",fontSize:12}}),(0,r.jsx)("button",{type:"button",style:{...nO,padding:"4px 8px",fontSize:12,color:"var(--error-text)",borderColor:"var(--error-border)"},onClick:t=>nA(e,t),children:et("delete")})]})})]},e.id)})})]})})]})}),(0,r.jsx)(f.M,{open:tp,onClose:()=>tg(!1),title:tx?er("editTask"):er("newTask"),width:"wide",widthStorageKey:"task-form",children:(0,r.jsx)("div",{style:{padding:20},children:(0,r.jsxs)("form",{onSubmit:nD,style:{display:"grid",gap:14},children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{style:{display:"block",fontSize:12,color:"var(--text-muted)",marginBottom:4},children:er("title")}),(0,r.jsx)("input",{required:!0,placeholder:er("titlePlaceholder"),value:null!=(j=tv.title)?j:"",onCh
1ange:e=>ty(t=>({...t,title:e.target.value})),style:{width:"100%",padding:"8px 10px",fontSize:13,border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",background:"var(--bg-deep)",color:"var(--text-primary)"}})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{style:{display:"block",fontSize:12,color:"var(--text-muted)",marginBottom:4},children:er("descriptionOptional")}),(0,r.jsx)("textarea",{placeholder:er("descriptionPlaceholder"),value:null!=(k=tv.description)?k:"",onChange:e=>ty(t=>({...t,description:e.target.value})),rows:3,style:{width:"100%",padding:"8px 10px",fontSize:13,border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",background:"var(--bg-deep)",color:"var(--text-primary)",resize:"vertical"}})]}),(0,r.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{style:{display:"block",fontSize:12,color:"var(--text-muted)",marginBottom:4},children:er("status")}),(0,r.jsx)(i.l,{value:null!=(w=tv.status)?w:"todo",onChange:e=>ty(t=>({...t,status:e.target.value})),style:{width:"100%",padding:"8px 10px",fontSize:13,border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",background:"var(--bg-deep)",color:"var(--text-primary)"},children:nk.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{style:{display:"block",fontSize:12,color:"var(--text-muted)",marginBottom:4},children:er("priority")}),(0,r.jsx)(i.l,{value:null!=(C=tv.priority)?C:"medium",onChange:e=>ty(t=>({...t,priority:e.target.value})),style:{width:"100%",padding:"8px 10px",fontSize:13,border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",background:"var(--bg-deep)",color:"var(--text-primary)"},children:e5.map(e=>(0,r.jsx)("option",{value:e,children:e},e))})]})]}),!M&&(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{style:{display:"block",fontSize:12,color:"var(--text-muted)",marginBottom:4},children:er("project")}),(0,r.jsxs)(i.l,{value:null!=(z=tv.projectId)?z:"",onChange:e=>ty(t=>({...t,projectId:e.target.value?Number(e.target.value):void 0})),style:{width:"100%",padding:"8px 10px",fontSize:13,border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",background:"var(--bg-deep)",color:"var(--text-primary)"},children:[(0,r.jsx)("option",{value:"",children:er("selectProject")}),eS.map(e=>(0,r.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,r.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:12},children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{style:{display:"block",fontSize:12,color:"var(--text-muted)",marginBottom:4},children:er("assignToMember")}),(0,r.jsx)(e9,{hosts:eC,cloudAgents:eI,members:eW,hostId:tv.assignedAgentHostId,agentRef:tv.assignedAgentRef,userId:tv.assignedUserId,onChange:e=>ty(t=>({...t,...e})),style:{width:"100%",padding:"8px 10px",fontSize:13,border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",background:"var(--bg-deep)",color:"var(--text-primary)"}})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{style:{display:"block",fontSize:12,color:"var(--text-muted)",marginBottom:4},children:er("dueDateOptional")}),(0,r.jsx)("input",{type:"date",value:null!=(I=null==(t=tv.dueDate)?void 0:t.split("T")[0])?I:"",onChange:e=>ty(t=>({...t,dueDate:e.target.value||void 0})),style:{width:"100%",padding:"8px 10px",fontSize:13,border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",background:"var(--bg-deep)",color:"var(--text-primary)"}})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{style:{display:"block",fontSize:12,color:"var(--text-muted)",marginBottom:4},children:er("githubPrUrl")}),(0,r.jsx)("input",{type:"url",placeholder:"https://github.com/org/repo/pull/123",value:null!=(T=tv.githubPrUrl)?T:"",onChange:e=>ty(t=>({...t,githubPrUrl:e.target.value||null})),style:{width:"100%",padding:"8px 10px",fontSize:13,border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",background:"var(--bg-deep)",color:"var(--text-primary)",boxSizing:"border-box"}})]}),(0,r.jsxs)("div",{style:{display:"flex",gap:8,justifyContent:"flex-end",marginTop:8},children:[(0,r.jsx)("button",{type:"button",style:nO,onClick:()=>tg(!1),children:et("cancel")}),(0,r.jsx)("button",{type:"submit",disabled:tb,style:{...nq,opacity:tb?.7:1},children:tb?et("saving"):tx?er("saveChanges"):er("createTask")})]})]})})}),tf&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"slide-panel-overlay",role:"presentation",style:{position:"fixed",inset:0,zIndex:10002},onClick:t7}),(0,r.jsxs)("div",{className:"slide-panel-drawer",style:{position:"fixed",top:0,right:0,bottom:0,width:(0,Z.XH)(tk),maxWidth:"100%",borderLeft:"1px solid var(--border-subtle)",boxShadow:"-8px 0 24px rgba(0,0,0,0.2)",zIndex:10003,dis
1play:"flex",flexDirection:"column",overflow:"hidden"},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:16,borderBottom:"1px solid var(--border-subtle)"},children:[(0,r.jsxs)("div",{style:{flex:1,minWidth:0,marginRight:12},children:["title"===tU?(0,r.jsx)("input",{autoFocus:!0,value:tG,onChange:e=>tX(e.target.value),onBlur:()=>{let e=tG.trim();e&&e!==tf.title?nM({title:e}):tV(null)},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),e.target.blur()),"Escape"===e.key&&tV(null)},style:{width:"100%",fontWeight:700,fontSize:16,padding:"4px 8px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",background:"var(--bg-deep)",color:"var(--text-primary)"}}):tf.restricted?(0,r.jsxs)("div",{style:{fontWeight:700,fontSize:16,color:"var(--text-muted)",fontStyle:"italic",display:"flex",alignItems:"center",gap:6,padding:"4px 6px",margin:"-4px -6px"},children:[(0,r.jsx)("span",{"aria-hidden":!0,children:(0,r.jsx)(a.I,{source:"\uD83D\uDD12",size:"1em"})}),et("clearanceNeeded")]}):(0,r.jsx)("div",{role:"button",tabIndex:0,onClick:()=>{tX(tf.title),tV("title")},onKeyDown:e=>{"Enter"===e.key&&(tX(tf.title),tV("title"))},title:er("editTitleTitle"),style:{fontWeight:700,fontSize:16,cursor:"text",borderRadius:"var(--radius-sm)",padding:"4px 6px",margin:"-4px -6px"},children:tf.title}),(0,r.jsx)("div",{style:{fontSize:11,fontFamily:"var(--font-mono)",color:"var(--text-muted)",marginTop:2,paddingLeft:6},children:tf.key})]}),(0,r.jsxs)("div",{style:{display:"flex",gap:8,flexShrink:0,flexWrap:"wrap",justifyContent:"flex-end"},children:[!tf.restricted&&(0,r.jsxs)("button",{type:"button",className:"drawer-action",onClick:()=>tq(tf.id),"aria-label":er("lifecycleAction"),title:er("lifecycleActionTitle"),children:[(0,r.jsxs)("svg",{viewBox:"0 0 24 24","aria-hidden":!0,style:{width:17,height:17,stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,r.jsx)("polyline",{points:"12 7 12 12 16 14"})]}),(0,r.jsx)("span",{className:"drawer-action-label",children:er("lifecycleAction")})]}),tS&&(0,r.jsx)(Z.iu,{value:tk,onChange:tw}),!tf.restricted&&(0,r.jsx)("button",{type:"button",onClick:e=>nA(tf,e),style:{width:36,height:36,display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid var(--error-border)",borderRadius:"var(--radius-md)",background:"var(--bg-base)",color:"var(--error-text)",cursor:"pointer"},"aria-label":er("deleteTask"),title:er("deleteTask"),children:(0,r.jsxs)("svg",{viewBox:"0 0 24 24",style:{width:18,height:18,stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},children:[(0,r.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,r.jsx)("path",{d:"M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),(0,r.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,r.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})}),(0,r.jsx)(eg.p,{onClose:t7})]})]}),!tf.restricted&&(0,r.jsx)("div",{style:{display:"flex",borderBottom:"1px solid var(--border-subtle)",flexShrink:0,overflowX:"auto"},children:[["details",er("details")],["agent",er("tabAgent")],["changes",er("tabChanges")],["prd",er("tabPrd")],["accountability",er("tabAccountability")]].map(e=>{let[t,n]=e;return(0,r.jsx)("button",{type:"button",onClick:()=>t_(t),style:{padding:"10px 16px",fontSize:13,border:"none",background:"none",cursor:"pointer",whiteSpace:"nowrap",borderBottom:"2px solid ".concat(tN===t?"var(--coral-bright)":"transparent"),color:tN===t?"var(--coral-bright)":"var(--text-muted)",fontWeight:tN===t?600:400},children:n},t)})}),tf.restricted?(0,r.jsxs)("div",{style:{flex:1,overflow:"auto",padding:32,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center",gap:12},children:[(0,r.jsx)("div",{"aria-hidden":!0,style:{fontSize:40},children:(0,r.jsx)(a.I,{source:"\uD83D\uDD12",size:"1em"})}),(0,r.jsx)("div",{style:{fontSize:16,fontWeight:700,color:"var(--text-primary)"},children:et("clearanceNeeded")}),(0,r.jsx)("p",{style:{fontSize:13,color:"var(--text-muted)",maxWidth:360,margin:0},children:et("clearanceNeededBody")})]}):"agent"===tN?(0,r.jsx)("div",{style:{flex:1,overflow:"auto"},children:(0,r.jsx)(ei.$,{task:tf,projectId:tf.projectId,agentHosts:eC,onTaskChanged:()=>nt({background:!0})})}):"changes"===tN?(0,r.jsx)("div",{style:{flex:1,overflow:"auto",padding:16},children:(0,r.jsx)(es.Nq,{taskId:tf.id,maxHeight:9999})}):"prd"===tN?(0,r.jsx)("div",{style:{flex:1,overflow:"auto"},children:(0,r.jsx)(ey,{taskId:tf.id,projectId:tf.projectId})}):"accountability"===tN?(0,r.jsx)("div",{style:{flex:1,overflow:"auto",padding:16},children:(0,r.jsx)(eR,{taskId:tf.id})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{style:{flex:1,overflow:"auto",padding:20},children:[(0,r.jsxs)("div",{style:{display:"flex",gap:8,flexWrap:"wrap",marginBottom:16,alignItems:"center"},children:["status"===tU?(0,r.jsx)(i.l,{autoFocus:!0,value:tf.status,onChange:e=>{nB(tf.id,e.target.value),tV(null)},onBlur:()=>tV(null),style:{fontSize:12,padding:"3px 6px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",background:"var(--bg-deep)",color:"var(--text-primary)"},children:nk.map(e=>(0,r.jsx)("option",{value:e.value,children:e.label},e.value))}):(0,r.jsx)("span",{role:"button",tabIndex:0,onClick:()=>tV("status"),onKeyDown:e=>{"Enter"===e.key&&tV("status")},title:er("changeStatusTitle"),className:(0,e8.l$)(tf.status),style:{fontSize:11,padding:"4px 8px",borderRadius:"var(--radius-sm)",cursor:"pointer"},children:nS(tf.status)}),"priority"===tU?(0,r.jsx)(i.l,{autoFocus:!0,value:tf.priority,disabled:tQ,onChange:e=>nM({priority:e.target.value}),onBlur:()=>tV(null),style:{fontSize:12,padding:"3px 6px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",background:"var(--bg-deep)",color:"var(--text-primary)"},children:e5.map(e=>(0,r.jsx)("option",{value:e,children:e},e))}):(0,r.jsx)("span",{role:"button",tabIndex:0,onClick:()=>tV("priority"),onKeyDown:e=>{"Enter"===e.key&&tV("priority")},title:er("changePriorityTitle"),className:(0,eD.Xl)(tf.priority),style:{fontSize:11,padding:"4px 8px",borderRadius:"var(--radius-sm)",cursor:"pointer"},children:tf.priority}),(0,r.jsx)(eH,{task:tf,showPriority:!1,flagged:ev.has(tf.id),participants:null!=(R=ef.get(tf.id))?R:null})]}),(0,r.jsx)(eq,{taskId:tf.id,onOpenEpic:t3,onOpenTab:t_,onChanged:()=>nt({background:!0})}),(tf.gitBranch||tf.githubPrUrl)&&(0,r.jsxs)("div",{style:{marginBottom:16},children:[(0,r.jsx)("div",{style:{fontWeight:600,marginBottom:6,fontSize:14},children:er("branchAndPr")}),(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[tf.gitBranch&&(0,r.jsx)("span",{style:{fontSize:13,fontFamily:"var(--font-mono)",color:"var(--text-secondary)",wordBreak:"break-all"},children:tf.gitBranch}),tf.githubPrUrl&&(0,r.jsxs)("a",{href:tf.githubPrUrl,target:"_blank",rel:"noopener noreferrer",title:er("viewCodeChangesTitle"),style:{fontSize:12,fontWeight:600,fontFamily:"var(--font-mono)",color:"var(--coral-bright)",textDecoration:"none",padding:"2px 8px",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-subtle)",background:"var(--bg-deep)",whiteSpace:"nowrap"},children:["PR",tf.githubPrNumber?" #".concat(tf.githubPrNumber):""," â"]})]})]}),(0,r.jsxs)("div",{style:{marginBottom:16},children:[(0,r.jsx)("div",{style:{fontWeight:600,marginBottom:8,fontSize:14},children:er("description")}),"description"===tU?(0,r.jsxs)("div",{style:{display:"grid",gap:8}
1,children:[(0,r.jsx)("textarea",{autoFocus:!0,value:tG,onChange:e=>tX(e.target.value),onKeyDown:e=>{"Escape"===e.key&&tV(null)},rows:6,placeholder:er("markdownPlaceholder"),style:{width:"100%",padding:"8px 10px",fontSize:13,fontFamily:"var(--font-mono)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",background:"var(--bg-deep)",color:"var(--text-primary)",resize:"vertical",boxSizing:"border-box"}}),(0,r.jsxs)("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[(0,r.jsx)("button",{type:"button",style:nO,onClick:()=>tV(null),children:et("cancel")}),(0,r.jsx)("button",{type:"button",disabled:tQ,style:{...nq,opacity:tQ?.7:1},onClick:()=>nM({description:tG.trim()||null}),children:tQ?et("saving"):et("save")})]})]}):(0,r.jsx)("div",{role:"button",tabIndex:0,onClick:()=>{var e;tX(null!=(e=tf.description)?e:""),tV("description")},onKeyDown:e=>{if("Enter"===e.key){var t;tX(null!=(t=tf.description)?t:""),tV("description")}},title:er("editDescriptionTitle"),style:{fontSize:13,color:tf.description?"var(--text-secondary)":"var(--text-muted)",lineHeight:1.6,cursor:"text",borderRadius:"var(--radius-md)",padding:8,margin:-8,minHeight:24},children:tf.description?(0,r.jsx)(ed.v,{content:tf.description}):er("addDescription")})]}),void 0!==tY&&(0,r.jsxs)("div",{style:{marginBottom:16},children:[(0,r.jsx)("div",{style:{fontWeight:600,marginBottom:8,fontSize:14},children:eo("publish.section")}),tY?(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[(0,r.jsx)("span",{className:"badge-green",children:eo("publish.published")}),(0,r.jsx)("span",{style:{fontSize:12,color:"var(--text-muted)"},children:eo("publish.publishedHint")}),(0,r.jsx)("button",{type:"button",disabled:t1,onClick:t9,style:{marginLeft:"auto",padding:"6px 12px",borderRadius:"var(--radius-md)",border:"1px solid var(--border-subtle)",background:"var(--bg-elevated)",color:"var(--text-muted)",fontSize:12,fontWeight:600,cursor:"pointer"},children:eo(t1?"publish.unpublishing":"publish.unpublish")})]}):(0,r.jsx)("button",{type:"button",onClick:()=>t0(!0),style:{padding:"7px 16px",borderRadius:"var(--radius-md)",border:"1px solid var(--coral-bright)",background:"var(--surface-coral-soft)",color:"var(--coral-bright)",fontSize:13,fontWeight:700,cursor:"pointer"},children:eo("publish.action")})]}),tZ&&(0,r.jsx)(e1,{ticketId:tf.id,defaultRequirements:null!=(W=tf.description)?W:"",onClose:()=>t0(!1),onPublished:e=>{t$(e),t0(!1)}}),(0,r.jsxs)("div",{style:{marginBottom:16},children:[(0,r.jsx)("div",{style:{fontWeight:600,marginBottom:10,fontSize:14},children:er("details")}),(0,r.jsxs)("div",{style:{display:"grid",gap:8},children:[(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:13,minHeight:28},children:[(0,r.jsx)("span",{style:{color:"var(--text-muted)"},children:er("project")}),"project"===tU?(0,r.jsx)(el,{projects:eS,currentProjectId:tf.projectId,onMove:e=>{nK(tf.id,e),tV(null)},label:"".concat(nn(tf.projectId)," â"),style:{fontSize:13,padding:"3px 6px"}}):(0,r.jsx)("span",{role:"button",tabIndex:0,onClick:()=>tV("project"),onKeyDown:e=>{"Enter"===e.key&&tV("project")},title:er("moveBoardTitle"),style:{color:"var(--text-primary)",cursor:"pointer",borderBottom:"1px dashed var(--border-subtle)"},children:nn(tf.projectId)})]}),(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:13,minHeight:28},children:[(0,r.jsx)("span",{style:{color:"var(--text-muted)"},children:er("assigneeOwner")}),"assignee"===tU?(0,r.jsx)(e9,{autoFocus:!0,...na(tf.projectId),hostId:tf.assignedAgentHostId,agentRef:tf.assignedAgentRef,userId:tf.assignedUserId,disabled:tQ,onChange:e=>nM(e),onBlur:()=>tV(null),style:{fontSize:13,padding:"3px 6px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",background:"var(--bg-deep)",color:"var(--text-primary)"}}):(0,r.jsx)("span",{role:"button",tabIndex:0,onClick:()=>tV("assignee"),onKeyDown:e=>{"Enter"===e.key&&tV("assignee")},title:er("changeAssigneeTitle"),style:{color:"var(--text-primary)",cursor:"pointer",borderBottom:"1px dashed var(--border-subtle)"},children:nr(tf)})]}),(0,r.jsx)(_.x,{selectValue:nl(tf)}),(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:13,minHeight:28},children:[(0,r.jsx)("span",{style:{color:"var(--text-muted)"},children:er("dueDate")}),"dueDate"===tU?(0,r.jsx)("input",{type:"date",autoFocus:!0,value:null!=(D=null==(n=tf.dueDate)?void 0:n.split("T")[0])?D:"",disabled:tQ,onChange:e=>nM({dueDate:e.target.value||null}),onBlur:()=>tV(null),onKeyDown:e=>{"Escape"===e.key&&tV(null)},style:{fontSize:13,padding:"3px 6px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",background:"var(--bg-deep)",color:"var(--text-primary)"}}):(0,r.jsx)("span",{role:"button",tabIndex:0,onClick:()=>tV("dueDate"),onKeyDown:e=>{"Enter"===e.key&&tV("dueDate")},title:er("setDueDateTitle"),style:{color:tf.dueDate?"var(--text-primary)":"var(--text-muted)",cursor:"pointer",borderBottom:"1px dashed var(--border-subtle)"},children:e7(K,tf.dueDate)||er("none")})]}),(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:13,minHeight:28,gap:12},children:[(0,r.jsx)("span",{style:{color:"var(--text-muted)"},children:er("release")}),(0,r.jsx)(en,{value:null!=(A=tf.releaseId)?A:null,projectId:tf.projectId,onChange:e=>void nM({releaseId:e})})]}),(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:13,minHeight:28,gap:12},children:[(0,r.jsx)("span",{style:{color:"var(--text-muted)"},children:er("delayReason")}),(0,r.jsx)(ea,{taskId:tf.id,value:null})]}),(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",fontSize:13,minHeight:28,gap:12},children:[(0,r.jsxs)("span",{style:{color:"var(--text-muted)",paddingTop:4},children:[ee("businessValue.label"),null!=tf.managerRank&&(0,r.jsxs)("span",{title:ee("businessValue.rankTitle"),style:{marginLeft:6,fontSize:10,padding:"1px 5px",borderRadius:"var(--radius-sm)",background:"var(--surface-interactive, var(--bg-elevated))",color:"var(--text-secondary)",fontWeight:700},children:["#",tf.managerRank]})]}),"businessValue"===tU?(0,r.jsx)("input",{type:"number",min:0,max:100,autoFocus:!0,value:tG,disabled:tQ,onChange:e=>tX(e.target.value),onBlur:nH,onKeyDown:e=>{"Enter"===e.key&&nH(),"Escape"===e.key&&tV(null)},placeholder:"0â100",style:{width:90,fontSize:13,padding:"3px 6px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",background:"var(--bg-deep)",color:"var(--text-primary)"}}):(0,r.jsx)("span",{role:"button",tabIndex:0,onClick:()=>{tX(null!=tf.businessValue?String(tf.businessValue):""),tV("businessValue")},onKeyDown:e=>{"Enter"===e.key&&(tX(null!=tf.businessValue?String(tf.businessValue):""),tV("businessValue"))},title:null!=(P=tf.businessValueRationale)?P:ee("businessValue.editTitle"),style:{color:null!=tf.businessValue?"var(--text-primary)":"var(--text-muted)",cursor:"pointer",borderBottom:"1px dashed var(--border-subtle)",textAlign:"right",maxWidth:220},children:null!=tf.businessValue?ee("businessValue.badge",{value:tf.businessValue}):ee("businessValue.unset")})]}),null!=tf.businessValue&&tf.businessValueRationale&&"businessValue"!==tU&&(0,r.jsx)("div",{style:{fontSize:12,color:"var(--text-muted)",marginTop:-2,lineHeight:1.5},children:tf.businessValueRationale}),(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:13,minHeight:28},children:[(0,r.jsx)("span",{style:{color:"var(--text-muted)"},children:er("created")}),(0,r.jsx)("span",{style:{color:"var(--text-primary)"},children:e7(K,tf.createdAt)})]})]})]})]}),(0,r.jsxs)("div",{style:{flexShrink:0,borderTop:"1px solid var(--border-subtle)",padding:"12px 20px",background:"var(--bg-base)",display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[(0,r.jsx)("span",{style:{fontSize:12,color:"var(--text-muted)"}
1,children:er.rich("runsAs",{name:nr(tf),b:e=>(0,r.jsx)("strong",{style:{color:"var(--text-secondary)"},children:e})})}),(0,r.jsx)(eG,{task:tf,label:er("runThisTask"),onRan:()=>{t_("agent"),ny()},onAwaitingApproval:e=>eN({approvalId:e.approvalId,taskId:e.taskId,reason:e.reason})})]})]})]})]}),(0,r.jsx)(eU.j,{taskId:tO,onClose:()=>tq(null)}),null!=ni&&(0,r.jsx)(F,{open:tP,onClose:()=>tM(!1),projectId:ni,projectName:ns,initialTab:tH}),te&&(0,r.jsx)(O.X,{kind:te.kind,refId:te.refId,name:te.name,tasks:te.tasks,onClose:()=>tt(null)}),null!=ni&&(0,r.jsx)(f.M,{open:tK,onClose:()=>tF(!1),title:"PRD".concat(ns?" \xb7 ".concat(ns):""),width:"wide",widthStorageKey:"task-prd",children:(0,r.jsx)(ey,{projectId:ni})}),null!=ni&&tE&&(0,r.jsx)(l.m,{label:ns||"Ceremony",style:{zIndex:1e4},children:(0,r.jsx)("div",{style:{width:"100%",height:"100%",maxWidth:1400,margin:"0 auto",background:"var(--bg-surface)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xl)",padding:16,display:"flex",flexDirection:"column",minHeight:0},children:(0,r.jsx)(e2.v,{projectId:ni,mode:tE,onModeChange:tL,onClose:()=>{tL(null),nt({background:!0})}})})})]})})}},74261:(e,t,n)=>{n.d(t,{BZ:()=>r,C8:()=>l,QQ:()=>s,XI:()=>a,tB:()=>i});let r={background:"var(--bg-base)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-lg)",padding:20},a={marginTop:14,display:"flex",flexDirection:"column",gap:10,padding:14,background:"var(--bg-deep)",borderRadius:"var(--radius-lg)"},l={padding:"8px 12px",fontSize:"var(--font-size-small)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",background:"var(--bg-deep)",color:"var(--text-primary)",width:"100%",boxSizing:"border-box"},i={padding:"8px 14px",fontSize:"var(--font-size-small)",fontWeight:600,background:"var(--coral-bright)",color:"var(--text-on-accent)",border:"none",borderRadius:"var(--radius-md)",cursor:"pointer"},s={padding:"6px 10px",fontSize:"var(--font-size-small)",fontWeight:600,background:"var(--bg-elevated)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",cursor:"pointer"}},87405:(e,t,n)=>{n.d(t,{l:()=>x});var r=n(32957),a=n(5337),l=n(3625),i=n(70307),s=n(75438),o=n(6808),d=n(38172),c=n(33961),u=n(97849),p=n(38613);let g=(e,t)=>({display:"inline-flex",alignItems:"center",gap:4,padding:"1px 8px",borderRadius:"var(--radius-full)",fontSize:11,fontWeight:600,background:e,color:t});function x(e){var t;let{projectId:n}=e,x=(0,p.b)(),h=(0,i.c)("kanban"),v=(0,d.JT)("agents.create").allowed,[y,b]=(0,l.useState)([]),[m,f]=(0,l.useState)(null),[j,k]=(0,l.useState)([]),[S,w]=(0,l.useState)(!1),[C,z]=(0,l.useState)(null),[I,T]=(0,l.useState)(null),[R,W]=(0,l.useState)(!1),[D,A]=(0,l.useState)(null),P=(0,c.X)(null!=I),M=(0,l.useCallback)(async()=>{try{let[e,t,r]=await Promise.all([s.up.listTemplates().catch(()=>[]),s.up.roster(n),s.up.flaggedForProject(n).catch(()=>[])]);b(e),f(t),k(r)}catch(e){A(x(e))}},[n,x]);(0,l.useEffect)(()=>{M()},[M]);let H=async e=>{if(e&&e!==(null==m?void 0:m.templateId)){w(!0),A(null);try{await s.up.applyTemplate(n,e),await M()}catch(e){A(x(e))}finally{w(!1)}}},B=async e=>{z(e.roleKey),A(null);try{let t=await (0,o.ZP)({name:"".concat(e.name," Agent"),title:e.name,skills:[e.roleKey],published:!1});await s.up.assignRole({roleKey:e.roleKey,assigneeKind:"agent",assigneeRef:t.id,assigneeName:t.name,projectId:n}),P.reload(),await M()}catch(e){A(x(e))}finally{z(null)}},E=async(e,t)=>{W(!0),A(null);try{await s.up.assignRole({roleKey:e,...t,projectId:n}),T(null),await M()}catch(e){A(x(e))}finally{W(!1)}},L=async e=>{A(null);try{await s.up.unassignRole(e),await M()}catch(e){A(x(e))}};return(0,r.jsxs)("div",{style:{background:"var(--surface)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-lg)",padding:16},id:"kanban-roster",children:[(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:8},children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{style:{fontWeight:600,fontSize:14},children:h("rosterTitle")}),(0,r.jsx)("div",{style:{fontSize:12,color:"var(--text-muted)"},children:h("rosterSubtitle")})]}),m&&(0,r.jsx)("span",{style:g("var(--surface-2)","var(--text-secondary)"),children:h("coverageSummary",{filled:m.filledCount,total:m.roles.length})})]}),(0,r.jsxs)("div",{style:{marginTop:12,display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,r.jsx)("label",{htmlFor:"kanban-template",style:{fontSize:12,color:"var(--text-muted)"},children:h("templateLabel")}),(0,r.jsx)(u.l,{id:"kanban-template",disabled:!v||S,value:null!=(t=null==m?void 0:m.templateId)?t:"",onChange:e=>H(e.target.value),style:{flex:"1 1 200px",minWidth:180,fontSize:13},children:y.map(e=>(0,r.jsxs)("option",{value:e.id,children:[e.name,e.builtin?" \xb7 ".concat(h("builtin")):""]},e.id))}),S&&(0,r.jsx)("span",{style:{fontSize:12,color:"var(--text-muted)"},children:h("applying")})]}),D&&(0,r.jsx)("div",{style:{marginTop:8,fontSize:12,color:"var(--danger-text)"},children:D}),(0,r.jsxs)("div",{style:{marginTop:12,display:"flex",flexDirection:"column",gap:6},children:[null==m?void 0:m.roles.map(e=>{var t;let n=e.filledBy.filter(e=>"assignment"===e.via&&e.assignmentId);return(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8,padding:"8px 10px",borderRadius:"var(--radius-md)",background:"var(--surface-2)"},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"}
1,children:[(0,r.jsx)("span",{"aria-hidden":!0,children:(0,r.jsx)(a.I,{source:null!=(t=e.icon)?t:"person",size:16})}),(0,r.jsx)("span",{style:{fontWeight:600,fontSize:13},children:e.name}),e.required?(0,r.jsx)("span",{style:g("var(--warning-bg)","var(--warning-text)"),children:h("required")}):(0,r.jsx)("span",{style:g("var(--surface)","var(--text-muted)"),children:h("optional")}),(0,r.jsx)("span",{style:{flex:1}}),"filled"===e.status?(0,r.jsxs)("span",{style:g("var(--success-bg)","var(--success-text)"),title:e.filledBy.map(e=>e.name).join(", "),children:["â ",h("filled")]}):(0,r.jsx)("span",{style:g("var(--danger-bg)","var(--danger-text)"),children:h("gap")}),v&&(0,r.jsxs)("span",{style:{display:"inline-flex",gap:6,alignItems:"center"},children:[(0,r.jsx)("button",{type:"button",onClick:()=>T(I===e.roleKey?null:e.roleKey),style:{fontSize:12,padding:"4px 10px",borderRadius:"var(--radius-sm)",cursor:"pointer",background:"transparent",color:"var(--accent)",border:"1px solid var(--accent)"},children:h("assign")}),"gap"===e.status&&(0,r.jsx)("button",{type:"button",onClick:()=>B(e),disabled:C===e.roleKey,style:{fontSize:12,padding:"4px 10px",borderRadius:"var(--radius-sm)",cursor:"pointer",background:"var(--accent)",color:"var(--text-on-accent)",border:"none"},children:C===e.roleKey?h("creating"):h("createAgent")})]})]}),n.length>0&&(0,r.jsx)("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:n.map(e=>{let t;return(0,r.jsxs)("span",{style:{...g("var(--surface)","var(--text-secondary)"),border:"1px solid var(--border-subtle)"},children:[(0,r.jsx)("span",{"aria-hidden":!0,children:"agent"===e.kind?(0,r.jsx)(a.I,{source:"\uD83E\uDD16",size:"1em"}):"hire"===e.kind?(0,r.jsx)(a.I,{source:"\uD83E\uDD1D",size:"1em"}):(0,r.jsx)(a.I,{source:"\uD83E\uDDD1",size:"1em"})}),e.name,(0,r.jsxs)("span",{style:{color:"var(--text-muted)",fontSize:10},children:["\xb7 ",h("agent"===(t=e.kind)?"assigneeAgent":"hire"===t?"assigneeHire":"assigneeHuman")]}),v&&(0,r.jsx)("button",{type:"button","aria-label":h("unassign"),onClick:()=>L(e.assignmentId),style:{marginLeft:2,background:"none",border:"none",cursor:"pointer",color:"var(--text-muted)",fontSize:13,lineHeight:1,padding:0},children:"\xd7"})]},e.assignmentId)})}),v&&I===e.roleKey&&(0,r.jsx)(c.I,{workforce:P,busy:R,onAssign:t=>E(e.roleKey,t),onCancel:()=>T(null)})]},e.roleKey)}),m&&0===m.roles.length&&(0,r.jsx)("div",{style:{fontSize:12,color:"var(--text-muted)"},children:h("noRoles")})]}),(0,r.jsxs)("div",{style:{marginTop:16,paddingTop:12,borderTop:"1px solid var(--border-subtle)"},children:[(0,r.jsxs)("div",{style:{fontWeight:600,fontSize:13,marginBottom:6},children:[h("auditTitle")," ",j.length>0&&(0,r.jsx)("span",{style:g("var(--danger-bg)","var(--danger-text)"),children:j.length})]}),0===j.length?(0,r.jsx)("div",{style:{fontSize:12,color:"var(--text-muted)"},children:h("noFlagged")}):(0,r.jsx)("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:6},children:j.slice(0,8).map(e=>(0,r.jsxs)("li",{style:{fontSize:12},children:[(0,r.jsxs)("span",{style:{fontWeight:600},children:["#",e.taskId," ",e.title]}),(0,r.jsxs)("span",{style:{color:"var(--text-muted)"},children:[" â ",h("coverage",{pct:e.coverage})]}),(0,r.jsx)("div",{style:{color:"var(--text-muted)",marginTop:2},children:e.missing.slice(0,4).map((e,t)=>(0,r.jsxs)("span",{style:{marginRight:8},children:["changes_requested"===e.reason?"âº":"â¢"," ",e.laneName,": ",e.ref]},t))})]},e.taskId))})]})]})}},97860:(e,t,n)=>{n.d(t,{$:()=>m});var r=n(32957),a=n(5337),l=n(3625),i=n(75438),s=n(92671),o=n(76859),d=n(29072),c=n(34642),u=n(70307),p=n(62592),g=n(65644);function x(e){var t;let{projectId:n,tenantId:a,agentHostId:x,className:y,style:b}=e,m=(0,p.S)(),f=(0,u.c)("common"),j=(0,u.c)("agentCapabilities"),[k,S]=(0,l.useState)([]),[w,C]=(0,l.useState)([]),[z,I]=(0,l.useState)(!0),[T,R]=(0,l.useState)(null),[W,D]=(0,l.useState)(!1),[A,P]=(0,l.useState)(!1),[M,H]=(0,l.useState)(null),B=(0,l.useCallback)(async()=>{I(!0),R(null);try{let[e,t]=await Promise.all([i.Af.list(n),(0,s.iK)()]);S(e),C(t)}catch(e){R((0,g.yR)(e,j("failedLoadAgents")))}finally{I(!1)}},[n]);(0,l.useEffect)(()=>{B()},[B]);let E=(0,l.useMemo)(()=>new Set(k.map(e=>"".concat(e.agentKind,":").concat(e.agentRef))),[k]),L=(0,l.useMemo)(()=>w.filter(e=>!E.has("".concat(e.kind,":").concat(e.ref))),[w,E]),K=async e=>{P(!0),R(null);try{await i.Af.add({projectId:n,agentKind:e.kind,agentRef:e.ref,name:e.name}),await B()}catch(e){R((0,g.yR)(e,j("failedAddAgent")))}finally{P(!1)}},F=async e=>{if(await m(f("removeAgentFromProjectConfirm",{name:e.name}))){P(!0),R(null);try{await i.Af.remove(e.id),M===e.id&&H(null),S(t=>t.filter(t=>t.id!==e.id))}catch(e){R((0,g.yR)(e,j("failedRemoveAgent")))}finally{P(!1)}}},N=null!=M&&null!=(t=k.find(e=>e.id===M))?t:null;return(0,r.jsxs)("div",{className:y,style:{display:"flex",flexDirection:"column",gap:16,...b},children:[(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:8},children:[(0,r.jsx)("div",{style:{fontSize:14,fontWeight:700,color:"var(--text-primary)"},children:j("agentsCount",{count:k.length})}),(0,r.jsx)("button",{type:"button",onClick:()=>D(e=>!e),style:{padding:"5px 12px",fontSize:12,fontWeight:600,background:"var(--coral-bright)",color:"var(--text-on-accent)",border:"none",borderRadius:"var(--radius-md)",cursor:"pointer"},children:W?j("done"):j("addAgent")})]}),T&&(0,r.jsx)("div",{style:{padding:"8px 12px",fontSize:12,background:"rgba(239,68,68,0.15)",color:"var(--error-text)",borderRadius:"var(--radius-md)"},children:T}),z?(0,r.jsx)("div",{style:{color:"var(--text-muted)",fontSize:13},children:f("loading")}):W?(0,r.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:0===L.length?(0,r.jsx)("div",{style:{fontSize:12,color:"var(--text-muted)",padding:12},children:j("noMoreAgents")}):L.map(e=>(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",background:"var(--bg-base)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)"},children:[(0,r.jsx)(h,{kind:e.kind}),(0,r.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,r.jsx)("div",{style:{fontWeight:600,fontSize:13,color:"var(--text-primary)"},children:e.name}),(0,r.jsx)("div",{style:{fontSize:11,color:"var(--text-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.meta})]}),(0,r.jsx)("button",{type:"button",onClick:()=>K(e),disabled:A,style:{padding:"4px 10px",fontSize:11,fontWeight:600,background:"var(--coral-bright)",color:"var(--text-on-accent)",border:"none",borderRadius:"var(--radius-sm)",cursor:A?"wait":"pointer",flexShrink:0},children:j("add")})]},"".concat(e.kind,":").concat(e.ref)))}):0===k.length?(0,r.jsx)("div",{style:{fontSize:13,color:"var(--text-muted)",padding:16,textAlign:"center"},children:j("noAgentsYet")}):(0,r.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:k.map(e=>(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"8px 12px",background:"var(--bg-base)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)"},children:[(0,r.jsx)(h,{kind:e.agentKind}),(0,r.jsx)("div",{style:{flex:1,minWidth:0},children:(0,r.jsx)("div",{style:{fontWeight:600,fontSize:13,color:"var(--text-primary)"},children:e.name})}),(0,r.jsx)("button",{type:"button",onClick:()=>F(e),disabled:A,style:{padding:"4px 10px",fontSize:11,fontWeight:600,background:"rgba(239,68,68,0.1)",color:"var(--error-text)",border:"1px solid rgba(239,68,68,0.3)",borderRadius:"var(--radius-sm)",cursor:A?"wait":"pointer",flexShrink:0},children:j("remove")})]},e.id))})]}),(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap",borderTop:"1px solid var(--border-subtle)",paddingTop:14},children:[(0,r.jsx)("span",{style:{fontSize:12,fontWeight:600,color:"var(--text-muted)"},children:j("capabilitiesFor")}),(0,r.jsx)("button",{type:"button",onClick:()=>H(null),style:v(null===M),children:j("projectWide")}),k.map(e=>(0,r.jsx)("button",{type:"button",onClick:()=>H(e.id),style:v(M===e.id),children:e.name},e.id))]}),N?(0,r.jsx)(o.W,{scope:"agent",scopeId:N.id,projectId:n,agentAssignment:N,tenantId:a}):(0,r.jsx)(o.W,{scope:"project",scopeId:n,projectId:n,tenantId:a}),k.length>0&&(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:10,borderTop:"1px solid var(--border-subtle)",paddingTop:14},children:[(0,r.jsxs)("div",{style:{fontSize:14,fontWeight:700,color:"var(--text-primary)"},children:[j("scheduledRunsCron"),N&&(0,r.jsxs)("span",{style:{fontSize:12,fontWeight:500,color:"var(--text-muted)"},children:[" \xb7 ",N.name]})]}),x?(0,r.jsx)(d.i,{agentHostId:x,projectId:n,projectAgentId:N?N.id:"none",hideProjectColumn:!0}):(0,r.jsx)("div",{style:{fontSize:13,color:"var(--text-muted)",padding:16,textAlign:"center",background:"var(--bg-base)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)"},children:j("assignHostHint")})]}),(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:10,borderTop:"1px solid var(--border-subtle)",paddingTop:14},children:[(0,r.jsx)("div",{style:{fontSize:14,fontWeight:700,color:"var(--text-primary)"},children:j("observability")}),(0,r.jsx)(c.ObservabilityContent,{})]})]})}function h(e){let{kind:t}=e;return(0,r.jsx)("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",padding:"2px 6px",borderRadius:"var(--radius-sm)",flexShrink:0,background:"workforce"===t?"var(--surface-coral-soft)":"var(--bg-elevated)",color:"workforce"===t?"var(--coral-bright)":"var(--text-muted)"},children:s.gh[t]})}function v(e){return{padding:"5px 12px",fontSize:12,fontWeight:e?700:500,color:e?"var(--coral-bright)":"var(--text-muted)",background:e?"rgba(255,107,53,0.08)":"transparent",border:"1px solid ".concat(e?"var(--border-accent, var(--coral-bright))":"var(--border-subtle)"),borderRadius:"var(--radius-md)",cursor:"pointer"}}var y=n(87405),b=n(95528);function m(e){let{projectId:t,agentHostId:n,tenantId:i,task:s,agentHosts:o,onTaskChanged:d}=e,[c,u]=(0,l.useState)(!s);return(0,r.jsxs)("div",{children:[s&&(0,r.jsx)(b.C,{task:s,agentHosts:null!=o?o:[],onTaskChanged:d}),s?(0,r.jsxs)("div",{style:{padding:"0 20px 20px"},children:[(0,r.jsxs)("button",{type:"button",onClick:()=>u(e=>!e),style:{width:"100%",textAlign:"left",padding:"10px 0",fontSize:14,fontWeight:600,color:"var(--text-primary)",background:"none",border:"none",borderTop:"1px solid var(--border-subtle)",cursor:"pointer",display:"flex",alignItems:"center",gap:8},children:[(0,r.jsx)("span",{style:{transform:c?"rotate(90deg)":"none",transition:"transform 0.15s",color:"var(--text-muted)"},children:(0,r.jsx)(a.I,{source:"â¶",size:"1em"})}),"Agents & capabilities"]}),c&&(0,r.jsx)(x,{projectId:t,agentHostId:n,tenantId:i,style:{marginTop:12}})]}):(0,r.jsxs)("div",{style:{padding:20,display:"flex",flexDirection:"column",gap:16},children:[(0,r.jsx)(y.l,{projectId:t}),(0,r.jsx)(x,{projectId:t,agentHostId:n,tenantId:i})]})]})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.