@paperclipai/ui 2026.1012.0 → 2026.1012.1-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/dist/assets/AgentAvatar-B-1xry2J.js +1 -0
  2. package/dist/assets/Agents.production-pyhOBV2x.js +2 -0
  3. package/dist/assets/BreadcrumbContext-BqrxjvgW.js +15 -0
  4. package/dist/assets/CompanyActivity.production-HWlY6969.js +1 -0
  5. package/dist/assets/{CompanyExport-ByT0n9X1.js → CompanyExport-WskzQtT_.js} +3 -3
  6. package/dist/assets/{CompanySkills.production-BR8Dmnfm.js → CompanySkills.production-D61y2stR.js} +2 -2
  7. package/dist/assets/EmptyState-BTZhuDsf.js +1 -0
  8. package/dist/assets/MarkdownBody-cZQWay7b.js +16 -0
  9. package/dist/assets/MarkdownEditor-DAPNmxy1.js +85 -0
  10. package/dist/assets/OrgChart.production-9-_IJFEl.js +1 -0
  11. package/dist/assets/{PageSkeleton-BPIWjCC1.js → PageSkeleton-CxgVifID.js} +1 -1
  12. package/dist/assets/RoutineDetail.production-DBvVMjsd.js +1 -0
  13. package/dist/assets/RoutineRunVariablesDialog-DZOo1veJ.js +5 -0
  14. package/dist/assets/Routines.production-DE1oZ_mY.js +1 -0
  15. package/dist/assets/StatusIcon-BXQHVKUH.js +1 -0
  16. package/dist/assets/ToastContext-T9Pp8-AG.js +1 -0
  17. package/dist/assets/agent-avatar-url-DQnt6boq.js +134 -0
  18. package/dist/assets/alert-dialog-DMuNPqKM.js +1 -0
  19. package/dist/assets/arrow-right-B0x0jRuv.js +1 -0
  20. package/dist/assets/badge-CZnzMLuG.js +1 -0
  21. package/dist/assets/bot-CEdLboxo.js +1 -0
  22. package/dist/assets/card-s-lN8fb-.js +1 -0
  23. package/dist/assets/{check-Bja65weE.js → check-BIqJVMcw.js} +1 -1
  24. package/dist/assets/checkbox-Br1J3cXc.js +1 -0
  25. package/dist/assets/clipboard-D40Q5q6s.js +1 -0
  26. package/dist/assets/{company-members-Bdiin8XX.js → company-members-Gm1tBjqe.js} +1 -1
  27. package/dist/assets/{definition-DVfwNc9t.js → definition-k8fwqa3H.js} +1 -1
  28. package/dist/assets/dist-BGju9tdR.js +1 -0
  29. package/dist/assets/dist-D1LcUizL.js +1 -0
  30. package/dist/assets/dist-DwveVgxz.js +1 -0
  31. package/dist/assets/environments-hvvTB-X_.js +1 -0
  32. package/dist/assets/external-link-CRPTOPQP.js +1 -0
  33. package/dist/assets/{file-text-CrnCCdyx.js → file-text-7IiZXGg8.js} +1 -1
  34. package/dist/assets/{health-DmpWWrJd.js → health-DEc4HToe.js} +1 -1
  35. package/dist/assets/{heartbeats-ZGlmMClz.js → heartbeats-BLf3lyvz.js} +1 -1
  36. package/dist/assets/index-CUVXSWy6.css +1 -0
  37. package/dist/assets/{index-xCoSuYwt.js → index-YJY9oyby.js} +198 -306
  38. package/dist/assets/{input-C_bMo76m.js → input-QhvcBvZC.js} +1 -1
  39. package/dist/assets/label-D1BwZwuY.js +5 -0
  40. package/dist/assets/{mention-chips-DFkItOAK.js → mention-chips-BccP-YPW.js} +1 -1
  41. package/dist/assets/{rotate-ccw-CkPm2XIi.js → rotate-ccw-DWQojh1C.js} +1 -1
  42. package/dist/assets/select-Dx8riB8Y.js +1 -0
  43. package/dist/assets/sheet-B29m3gPT.js +1 -0
  44. package/dist/assets/skeleton-D7QvWIPX.js +1 -0
  45. package/dist/assets/tabs-AE3sXkCp.js +1 -0
  46. package/dist/assets/use-adapter-capabilities-Dkd784iv.js +1 -0
  47. package/dist/assets/use-copy-action-B9lu9oLC.js +1 -0
  48. package/dist/assets/useHiddenSettings-DQ4f3mug.js +1 -0
  49. package/dist/brands/adapters/openai-dot.README.md +7 -0
  50. package/dist/brands/adapters/openai-dot.svg +3 -0
  51. package/dist/brands/apps/bedrock.svg +1 -0
  52. package/dist/brands/apps/calendly.png +0 -0
  53. package/dist/brands/apps/clickup.png +0 -0
  54. package/dist/brands/apps/enterpret.png +0 -0
  55. package/dist/brands/apps/exa.svg +5 -0
  56. package/dist/brands/apps/firecrawl.svg +12 -0
  57. package/dist/brands/apps/gauge.png +0 -0
  58. package/dist/brands/apps/google.svg +1 -0
  59. package/dist/brands/apps/gsc-wizard.png +0 -0
  60. package/dist/brands/apps/klaviyo.png +0 -0
  61. package/dist/brands/apps/manifest.json +126 -3
  62. package/dist/brands/apps/monday-dark.png +0 -0
  63. package/dist/brands/apps/monday.png +0 -0
  64. package/dist/brands/apps/parallel-dark.svg +11 -0
  65. package/dist/brands/apps/parallel.svg +11 -0
  66. package/dist/brands/apps/superagent.png +0 -0
  67. package/dist/brands/apps/tavily.png +0 -0
  68. package/dist/brands/apps/telem-dark.svg +9 -0
  69. package/dist/brands/apps/telem.svg +9 -0
  70. package/dist/brands/apps/windsor-ai.png +0 -0
  71. package/dist/index.html +40 -46
  72. package/dist/sw.js +1 -1
  73. package/package.json +1 -1
  74. package/dist/assets/AgentAvatar-hwMRqcrH.js +0 -1
  75. package/dist/assets/AgentIdentity-C4wUhahM.js +0 -1
  76. package/dist/assets/Agents.production-5YBiRaLw.js +0 -2
  77. package/dist/assets/CompanyActivity.production-CuShP4nI.js +0 -1
  78. package/dist/assets/Costs.production-DcRg1pIV.js +0 -1
  79. package/dist/assets/EmptyState-srXBUYpN.js +0 -1
  80. package/dist/assets/MarkdownBody-QDzWplOg.js +0 -16
  81. package/dist/assets/MarkdownEditor-DTPZs6ab.js +0 -85
  82. package/dist/assets/OrgChart.production-DRD-hUVm.js +0 -1
  83. package/dist/assets/RoutineDetail.production-qqXdkaGx.js +0 -1
  84. package/dist/assets/RoutineRunVariablesDialog-Dv-XXlk2.js +0 -5
  85. package/dist/assets/Routines.production-Bl_boMxt.js +0 -1
  86. package/dist/assets/SidebarContext-DikNZ_v1.js +0 -1
  87. package/dist/assets/StatusIcon-CMrWodIU.js +0 -1
  88. package/dist/assets/agent-avatar-url-fEmcDqiX.js +0 -92
  89. package/dist/assets/agents-Cf2S6arr.js +0 -1
  90. package/dist/assets/badge-KD51rk5h.js +0 -1
  91. package/dist/assets/bot-4cughMcT.js +0 -1
  92. package/dist/assets/boxes-C6nHxz-A.js +0 -41
  93. package/dist/assets/button-DTubwuQ6.js +0 -1
  94. package/dist/assets/card-C9ZmzVw0.js +0 -1
  95. package/dist/assets/checkbox-CleHvCEY.js +0 -1
  96. package/dist/assets/chevron-down-D8JRibLV.js +0 -1
  97. package/dist/assets/chevron-right-CgzCCOfh.js +0 -1
  98. package/dist/assets/clipboard-DnJ1cPLx.js +0 -1
  99. package/dist/assets/dist-C3Lo2hgr.js +0 -1
  100. package/dist/assets/dist-CAuAyrrq.js +0 -1
  101. package/dist/assets/environments-CZ7tS33r.js +0 -1
  102. package/dist/assets/external-link-CKTTLhdy.js +0 -1
  103. package/dist/assets/index-u6D-k1be.css +0 -1
  104. package/dist/assets/label-8eVLsMYR.js +0 -5
  105. package/dist/assets/loader-circle-CJnkZ24k.js +0 -1
  106. package/dist/assets/octagon-alert-YXWOcSEA.js +0 -1
  107. package/dist/assets/router-ByYbJGEF.js +0 -15
  108. package/dist/assets/save-CSreF0sI.js +0 -1
  109. package/dist/assets/select-8C2_Exjs.js +0 -1
  110. package/dist/assets/sheet-Cd5zfgfU.js +0 -1
  111. package/dist/assets/skeleton-OzUJKgp9.js +0 -1
  112. package/dist/assets/tabs-WNMY3tGd.js +0 -1
  113. package/dist/assets/triangle-alert-Bcme6xBa.js +0 -1
  114. package/dist/assets/use-adapter-capabilities-zw4p_nGL.js +0 -1
  115. package/dist/assets/useHiddenSettings-MsH9KG62.js +0 -1
@@ -0,0 +1 @@
1
+ var E=Object.defineProperty;var o=(a,e)=>E(a,"name",{value:e,configurable:!0});import{i as C}from"./rolldown-runtime-ZpX3ckPj.js";import{G as v,M as A,T as L,aa as w,an as h,j as k,k as I,ln as N,sa as R}from"./agent-avatar-url-DQnt6boq.js";var m=C(R(),1),i=C(w(),1),y=Object.defineProperty,g=o((a,e)=>y(a,"name",{value:e,configurable:!0}),"__name"),z="Avatar",[T,X]=k(z),M=[0,()=>{}],[P,_]=T(z),F=m.forwardRef(g(o(function(e,t){const{__scopeAvatar:s,...n}=e,[r,l]=m.useState("idle"),[d,u]=S();return(0,i.jsx)(P,{scope:s,imageLoadingStatus:r,setImageLoadingStatus:l,imageCount:d,setImageCount:u,children:(0,i.jsx)(A.span,{...n,ref:t})})},"Avatar2"),"Avatar")),U="AvatarImage",q=m.forwardRef(g(o(function(e,t){const{__scopeAvatar:s,src:n,onLoadingStatusChange:r,...l}=e,d=_(U,s);d.setImageCount;const u=j(n,{referrerPolicy:l.referrerPolicy,crossOrigin:l.crossOrigin,loadingStatus:d.imageLoadingStatus,setLoadingStatus:d.setImageLoadingStatus}),c=L(f=>{r?.(f)}),p=m.useRef(u);return I(()=>{const f=p.current;p.current=u,u!==f&&c(u)},[u,c]),u==="loaded"?(0,i.jsx)(A.img,{...l,ref:t,src:n}):null},"AvatarImage2"),"AvatarImage")),G="AvatarFallback",O=m.forwardRef(g(o(function(e,t){const{__scopeAvatar:s,delayMs:n,...r}=e,l=_(G,s),[d,u]=m.useState(n===void 0);return m.useEffect(()=>{if(n!==void 0){const c=window.setTimeout(()=>u(!0),n);return()=>window.clearTimeout(c)}},[n]),d&&l.imageLoadingStatus!=="loaded"?(0,i.jsx)(A.span,{...r,ref:t}):null},"AvatarFallback2"),"AvatarFallback"));function j(a,{loadingStatus:e,setLoadingStatus:t,referrerPolicy:s,crossOrigin:n}){return I(()=>{if(!a){t("error");return}const r=new window.Image,l=g(u=>{const c=u.currentTarget;t(x(c))},"handleLoad"),d=g(()=>t("error"),"handleError");return r.addEventListener("load",l),r.addEventListener("error",d),s&&(r.referrerPolicy=s),r.crossOrigin=n??null,r.src=a,t(x(r)),()=>{r.removeEventListener("load",l),r.removeEventListener("error",d),t("idle")}},[a,n,s,t]),e}o(j,"useImageLoadingStatus");g(j,"useImageLoadingStatus");function x(a){return a.complete?a.naturalWidth>0?"loaded":"error":"loading"}o(x,"getImageLoadingStatus");g(x,"getImageLoadingStatus");function S(){return M}o(S,"useImageCount");g(S,"useImageCount");function W(a){}o(W,"useUpdateImageCount");g(W,"useUpdateImageCount");function $({className:a,size:e="default",shape:t="circle",...s}){return(0,i.jsx)(F,{"data-slot":"avatar","data-size":e,"data-shape":t,className:v("group/avatar relative flex size-8 shrink-0 overflow-hidden select-none data-[size=lg]:size-10 data-[size=sm]:size-6 data-[size=xs]:size-5",t==="square"?"rounded-md":"rounded-full",a),...s})}o($,"Avatar");function B({className:a,...e}){return(0,i.jsx)(q,{"data-slot":"avatar-image",className:v("aspect-square size-full object-cover",a),...e})}o(B,"AvatarImage");function K({className:a,...e}){return(0,i.jsx)(O,{"data-slot":"avatar-fallback",className:v("bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[shape=square]/avatar:rounded-md group-data-[size=sm]/avatar:text-xs group-data-[size=xs]/avatar:text-(length:--text-nano)",a),...e})}o(K,"AvatarFallback");function Y({className:a,...e}){return(0,i.jsx)("div",{"data-slot":"avatar-group",className:v("*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2",a),...e})}o(Y,"AvatarGroup");function Z({className:a,...e}){return(0,i.jsx)("div",{"data-slot":"avatar-group-count",className:v("bg-muted text-muted-foreground ring-background relative flex size-8 shrink-0 items-center justify-center rounded-full text-sm ring-2 group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3",a),...e})}o(Z,"AvatarGroupCount");function b(a){const e=a.trim().split(/\s+/);return e.length>=2?(e[0][0]+e[e.length-1][0]).toUpperCase():a.slice(0,2).toUpperCase()}o(b,"deriveInitials");var V={xs:"text-sm",sm:"text-xs",default:"text-sm",lg:"text-sm"};function aa({name:a,avatarUrl:e,initials:t,size:s="default",shape:n="circle",className:r}){const l=t??b(a);return(0,i.jsxs)("span",{className:v("inline-flex min-w-0 gap-1.5 items-center",s==="xs"&&"gap-1",s==="lg"&&"gap-2",r),title:a,children:[(0,i.jsxs)($,{size:s,shape:n,"aria-hidden":"true",children:[e&&(0,i.jsx)(B,{src:e,alt:""}),(0,i.jsx)(K,{children:l})]}),(0,i.jsx)("span",{className:v("truncate",V[s]),children:a})]})}o(aa,"Identity");var D={16:"size-4",20:"size-5",24:"size-6",32:"size-8",40:"size-10",48:"size-12",64:"size-16",96:"size-24",128:"size-32",256:"size-64",512:"size-128"};function ea({agent:a,appearance:e,size:t=24,name:s,label:n,pose:r="rest",muted:l=!1,className:d}){const u=N(e??a?.appearance,a?.id),c=h(u,t,1,r,l),[p,f]=(0,m.useState)(null);return(0,i.jsx)("span",{"data-slot":"agent-avatar",className:v("relative inline-flex shrink-0 items-center justify-center align-middle",D[t],d),role:n?"img":void 0,"aria-label":n,"aria-hidden":n?void 0:!0,children:p===c?(0,i.jsx)("span",{className:"text-xs text-muted-foreground",children:b(s??a?.name??"Agent")}):(0,i.jsx)("img",{src:c,srcSet:u.customAvatarAssetId?void 0:`${h(u,t,2,r,l)} 2x`,alt:"",width:t,height:t,decoding:"async",loading:"lazy",className:"size-full object-contain",onError:o(()=>f(c),"onError")})})}o(ea,"AgentAvatar");export{$ as a,Z as c,b as i,B as l,D as n,K as o,aa as r,Y as s,ea as t};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-YJY9oyby.js","assets/rolldown-runtime-ZpX3ckPj.js","assets/agent-avatar-url-DQnt6boq.js","assets/preload-helper-CceJXRIF.js","assets/BreadcrumbContext-BqrxjvgW.js","assets/label-D1BwZwuY.js","assets/mention-chips-BccP-YPW.js","assets/dist-D1LcUizL.js","assets/dist-BGju9tdR.js","assets/checkbox-Br1J3cXc.js","assets/check-BIqJVMcw.js","assets/clipboard-D40Q5q6s.js","assets/RoutineRunVariablesDialog-DZOo1veJ.js","assets/alert-dialog-DMuNPqKM.js","assets/AgentAvatar-B-1xry2J.js","assets/MarkdownEditor-DAPNmxy1.js","assets/dist-DwveVgxz.js","assets/dist-BhxPxuMy.js","assets/StatusIcon-BXQHVKUH.js","assets/badge-CZnzMLuG.js","assets/bot-CEdLboxo.js","assets/select-Dx8riB8Y.js","assets/ToastContext-T9Pp8-AG.js","assets/sheet-B29m3gPT.js","assets/heartbeats-BLf3lyvz.js","assets/useHiddenSettings-DQ4f3mug.js","assets/health-DEc4HToe.js","assets/rotate-ccw-DWQojh1C.js","assets/environments-hvvTB-X_.js","assets/input-QhvcBvZC.js","assets/company-members-Gm1tBjqe.js","assets/card-s-lN8fb-.js","assets/EmptyState-BTZhuDsf.js","assets/PageSkeleton-CxgVifID.js","assets/skeleton-D7QvWIPX.js","assets/tabs-AE3sXkCp.js","assets/use-adapter-capabilities-Dkd784iv.js","assets/use-copy-action-B9lu9oLC.js","assets/arrow-right-B0x0jRuv.js","assets/external-link-CRPTOPQP.js","assets/MarkdownBody-cZQWay7b.js","assets/file-text-7IiZXGg8.js","assets/index-CUVXSWy6.css"])))=>i.map(i=>d[i]);
2
+ var Ie=Object.defineProperty;var a=(e,n)=>Ie(e,"name",{value:n,configurable:!0});import{i as ae}from"./rolldown-runtime-ZpX3ckPj.js";import{B as re,Ei as b,G as T,Hr as Ae,aa as Ce,lt as Ee,mt as Se,sa as _e,xt as j,z as $}from"./agent-avatar-url-DQnt6boq.js";import{t as Le}from"./preload-helper-CceJXRIF.js";import{Ln as Me,ct as Te,f as ke,i as K,n as qe,r as ee,s as ie,yt as Pe}from"./BreadcrumbContext-BqrxjvgW.js";import{m as le}from"./alert-dialog-DMuNPqKM.js";import{t as oe}from"./AgentAvatar-B-1xry2J.js";import{t as Be}from"./tabs-AE3sXkCp.js";import{t as te}from"./bot-CEdLboxo.js";import{i as Fe,o as Re,t as $e}from"./heartbeats-BLf3lyvz.js";import{i as Ke,n as Oe,t as se}from"./environments-hvvTB-X_.js";import{t as ne}from"./EmptyState-BTZhuDsf.js";import{t as De}from"./PageSkeleton-CxgVifID.js";import{Ft as O,Gt as ze,Kt as ce,Lt as Ve,Ot as Ge,Rt as He,Vt as Ue,Wt as Qe,Xt as We,Yt as ue,Zt as Xe,qt as Ye}from"./index-YJY9oyby.js";var d=ae(_e(),1),t=ae(Ce(),1),de=Ae,Ze=(0,d.lazy)(()=>Le(()=>import("./index-YJY9oyby.js").then(e=>e.gt).then(e=>({default:e.ConfigureBuiltInAgentModal})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42]))),Je=["all","active","paused","error","builtin"],et=[{value:"all",label:"All"},{value:"active",label:"Active"},{value:"paused",label:"Paused"},{value:"error",label:"Error"},{value:"builtin",label:"Built-in"}];function tt(e){return Je.includes(e)}a(tt,"isFilterTab");var z={label:"Local",detail:"Paperclip host",title:"Local - Paperclip host"},me={label:"—",detail:"Loading environment",title:"Loading environment"},pe=new Set(["terminated","pending_approval"]);function xe(e,n){return n==="all"?!0:n==="active"?e==="active"||e==="running"||e==="idle":n==="paused"?e==="paused":n==="error"?e==="error":!0}a(xe,"matchesFilter");function st(e,n,i){return e.filter(r=>pe.has(r.status)?!1:n==="builtin"?i.has(r.id):xe(r.status,n)).sort((r,o)=>r.name.localeCompare(o.name))}a(st,"filterAgents");function nt(e){const n=e.adapterConfig?.model;if(typeof n!="string")return null;const i=n.trim();return i.length>0?i:null}a(nt,"getConfiguredModel");function at(e){return e==="ssh"?"SSH":e.charAt(0).toUpperCase()+e.slice(1)}a(at,"formatEnvironmentDriver");function rt(e,n){const i=typeof e.config.provider=="string"?e.config.provider.trim():"";return i?n?.sandboxProviders?.[i]?.displayName??i:"Sandbox"}a(rt,"getSandboxProviderLabel");function it(e,n){const i=Ve(e)?"Managed by Paperclip":e.driver==="sandbox"?`${rt(e,n)} sandbox provider`:e.driver==="local"?"Paperclip host":at(e.driver);return{label:e.name,detail:i,title:`${e.name} - ${i}`}}a(it,"describeEnvironment");function lt(e){return{label:"Unknown environment",detail:e.slice(0,8),title:`Unknown environment - ${e}`}}a(lt,"describeMissingEnvironment");function ot(e,n,i,r){const o=e.defaultEnvironmentId??i;if(!o)return z;const m=n.get(o);return m?it(m,r):lt(o)}a(ot,"resolveAgentEnvironment");function ge(e,n,i){return e.reduce((r,o)=>{const m=ge(o.reports,n,i);return pe.has(o.status)?(r.push(...m),r):(((n==="builtin"?i.has(o.id):xe(o.status,n))||m.length>0)&&r.push({...o,reports:m}),r)},[]).sort((r,o)=>r.name.localeCompare(o.name))}a(ge,"filterOrgTree");function wt(){const{selectedCompanyId:e}=Se(),{openNewAgent:n}=Fe(),{setBreadcrumbs:i}=qe(),r=ke(),o=Me(),{isMobile:m}=Ke(),N=o.pathname.split("/").pop()??"all",v=tt(N)?N:"all",[E,w]=(0,d.useState)("org"),I=m,l=I?"list":E,{data:u}=b({queryKey:j.instance.settings,queryFn:a(()=>Oe.get(),"queryFn"),enabled:!!e}),p=u?.experimental.enableBuiltInAgents===!0,f=v==="builtin"&&!p?"all":v,k=(0,d.useMemo)(()=>et.filter(s=>s.value!=="builtin"||p),[p]),{data:h}=b({queryKey:j.builtInAgents.list(e),queryFn:a(()=>We.list(e),"queryFn"),enabled:!!e&&p}),S=(0,d.useMemo)(()=>{const s=new Map;if(!p)return s;for(const c of h??[])c.agentId&&s.set(c.agentId,c);return s},[h,p]),V=(0,d.useMemo)(()=>new Set(S.keys()),[S]),[q,P]=(0,d.useState)(null),{data:x,isLoading:ve,error:G}=b({queryKey:j.agents.list(e),queryFn:a(()=>ee.list(e),"queryFn"),enabled:!!e}),{data:A}=b({queryKey:j.org(e),queryFn:a(()=>ee.org(e),"queryFn"),enabled:!!e&&l==="org"}),_=u?.experimental.enableEnvironments===!0,{data:C}=b({queryKey:j.environments.list(e),queryFn:a(()=>se.list(e),"queryFn"),enabled:!!e&&_}),{data:H}=b({queryKey:j.environments.capabilities(e),queryFn:a(()=>se.capabilities(e),"queryFn"),enabled:!!e&&_}),U=[...j.liveRuns(e),"agents-page"],B=ze({companyId:e,resourceKey:"live-runs:agents-page",queryKey:U,enabled:!!e,refetchInterval:15e3,leaderOnly:!0}),{data:F,dataUpdatedAt:be}=b({queryKey:U,queryFn:a(()=>$e.liveRunsForCompany(e),"queryFn"),enabled:B.enabled,refetchInterval:B.refetchInterval});Qe(B,F,be);const Q=Ye(e),L=(0,d.useMemo)(()=>{const s=new Map;for(const c of F??[]){if(c.status!=="running"&&c.status!=="queued")continue;const g=s.get(c.agentId);if(g){g.liveCount+=1;continue}s.set(c.agentId,{runId:c.id,liveCount:1})}return s},[F]),je=(0,d.useMemo)(()=>{const s=new Map;for(const c of x??[])s.set(c.id,c);return s},[x]),W=(0,d.useMemo)(()=>{const s=new Map;for(const c of C??[])s.set(c.id,c);return s},[C]),X=(0,d.useMemo)(()=>{const s=new Map;for(const c of x??[])s.set(c.id,ot(c,W,u?.defaultEnvironmentId??null,H));return s},[x,W,H,u?.defaultEnvironmentId]);if((0,d.useEffect)(()=>{i([{label:"Agents"}])},[i]),(0,d.useEffect)(()=>{e&&v==="builtin"&&u&&!p&&r("/agents/all",{replace:!0})},[p,u,r,v,e]),!e)return(0,t.jsx)(ne,{icon:te,message:"Select a company to view agents."});if(ve)return(0,t.jsx)(De,{variant:"list"});const y=st(x??[],f,V),R=ge(A??[],f,V),Y=_&&C===void 0,Z=_&&(C===void 0||C.length>1),ye=a(s=>Y?me:X.get(s)??z,"resolveRenderedEnvironment"),Ne=a(s=>{const c=s.orgChainHealth?.status==="invalid_org_chain",g=S.get(s.id),we=g?.status==="needs_setup"||g?.status==="pending_approval",M=g&&we?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ue,{status:g.status}),g.status==="needs_setup"&&(0,t.jsx)("span",{onClick:a(J=>{J.preventDefault(),J.stopPropagation()},"onClick"),children:(0,t.jsx)(K,{size:"xs",variant:"outline",onClick:a(()=>P(g),"onClick"),children:"Set up"})})]}):null;return(0,t.jsx)(Ge,{title:s.name,titleAccessory:(0,t.jsx)(Xe,{agentId:s.id,companyId:s.companyId}),titleClassName:"flex-1 xl:flex-none xl:w-56",titleTextClassName:"whitespace-normal break-words xl:truncate xl:whitespace-nowrap",subtitleClassName:"whitespace-normal break-words xl:truncate xl:whitespace-nowrap",subtitle:`${de[s.role]??s.role}${s.title?` - ${s.title}`:""}`,to:re(s),className:T("group",s.pausedAt&&f!=="paused"?"opacity-50":"",ce(Q.data,"agent",s.id)==="left"?"sm:text-foreground/55":""),leading:c?(0,t.jsx)(le,{className:"h-3.5 w-3.5 text-amber-500","aria-label":"Invalid reporting chain"}):(0,t.jsx)(oe,{agent:s,size:32}),secondaryRow:M?(0,t.jsx)("div",{className:"xl:hidden flex flex-wrap items-center gap-1.5",children:M}):void 0,meta:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[M&&(0,t.jsx)("div",{className:"hidden xl:flex items-center gap-1.5",children:M}),(0,t.jsx)("div",{className:"hidden xl:flex items-center gap-3",children:(0,t.jsx)(he,{agent:s,environment:ye(s.id),showEnvironment:Z})})]}),metaSpacerClassName:"hidden xl:block",trailing:(0,t.jsx)("div",{className:"flex items-center gap-3",children:(0,t.jsxs)("div",{className:"hidden sm:flex items-center gap-3",children:[L.has(s.id)&&(0,t.jsx)(D,{agentRef:$(s),runId:L.get(s.id).runId,liveCount:L.get(s.id).liveCount}),(0,t.jsx)("span",{className:"w-20 flex justify-end",children:(0,t.jsx)(O,{status:s.status})})]})})},s.id)},"renderAgentRow");return(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,t.jsx)(Be,{value:f,onValueChange:a(s=>r(`/agents/${s}`),"onValueChange"),children:(0,t.jsx)(Ue,{items:k,value:f,onValueChange:a(s=>r(`/agents/${s}`),"onValueChange")})}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[!I&&(0,t.jsxs)("div",{className:"flex items-center border border-border",role:"group","aria-label":"View mode",children:[(0,t.jsx)("button",{className:T("p-1.5 transition-colors",l==="list"?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50"),onClick:a(()=>w("list"),"onClick"),title:"List view","aria-label":"List view","aria-pressed":l==="list",children:(0,t.jsx)(Re,{className:"h-3.5 w-3.5"})}),(0,t.jsx)("button",{className:T("p-1.5 transition-colors",l==="org"?"bg-accent text-foreground":"text-muted-foreground hover:bg-accent/50"),onClick:a(()=>w("org"),"onClick"),title:"Org chart view","aria-label":"Org chart view","aria-pressed":l==="org",children:(0,t.jsx)(Pe,{className:"h-3.5 w-3.5"})})]}),(0,t.jsxs)(K,{size:"sm",variant:"outline",onClick:n,children:[(0,t.jsx)(Te,{className:"h-3.5 w-3.5 mr-1.5"}),"New Agent"]})]})]}),y.length>0&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[y.length," agent",y.length!==1?"s":""]}),G&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:G.message}),x&&x.length===0&&(0,t.jsx)(ne,{icon:te,message:"Create your first agent to get started.",action:"New Agent",onAction:n}),l==="list"&&y.length>0&&(0,t.jsx)("div",{children:y.map(Ne)}),l==="list"&&x&&x.length>0&&y.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No agents match the selected status."}),l==="org"&&R.length>0&&(0,t.jsx)("div",{className:"py-1",children:R.map(s=>(0,t.jsx)(fe,{node:s,depth:0,agentMap:je,liveRunByAgent:L,environmentByAgentId:X,environmentDataLoading:Y,showEnvironment:Z,tab:f,memberships:Q.data,builtInByAgentId:S,onConfigureBuiltIn:P},s.id))}),l==="org"&&A&&A.length>0&&R.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No agents match the selected status."}),l==="org"&&A&&A.length===0&&(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-8",children:"No organizational hierarchy defined."}),q&&e&&(0,t.jsx)(d.Suspense,{fallback:null,children:(0,t.jsx)(Ze,{companyId:e,state:q,open:q!==null,onOpenChange:a(s=>{s||P(null)},"onOpenChange")})})]})}a(wt,"Agents");function fe({node:e,depth:n,agentMap:i,liveRunByAgent:r,environmentByAgentId:o,environmentDataLoading:m,showEnvironment:N,tab:v,memberships:E,builtInByAgentId:w,onConfigureBuiltIn:I}){const l=i.get(e.id),u=w.get(e.id),p=u?.status==="needs_setup"||u?.status==="pending_approval",f=!!(l&&l.orgChainHealth?.status==="invalid_org_chain"),k=ce(E,"agent",e.id);return(0,t.jsxs)("div",{style:{paddingLeft:n*24},children:[(0,t.jsxs)(ie,{to:l?re(l):`/agents/${e.id}`,className:T("group flex items-center gap-3 rounded-lg px-3 py-2 hover:bg-accent/50 transition-colors w-full text-left no-underline text-inherit",l?.pausedAt&&v!=="paused"&&"opacity-50",k==="left"&&"sm:text-foreground/55"),children:[f?(0,t.jsx)(le,{className:"h-3.5 w-3.5 shrink-0 text-amber-500","aria-label":"Invalid reporting chain"}):(0,t.jsx)(oe,{agent:l??e,size:24}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 flex flex-wrap items-center gap-2",children:[(0,t.jsxs)("div",{className:"min-w-(--sz-7rem) truncate",children:[(0,t.jsx)("span",{className:"text-sm font-medium",children:e.name}),(0,t.jsxs)("span",{className:"text-xs text-muted-foreground ml-2",children:[de[e.role]??e.role,l?.title?` - ${l.title}`:""]})]}),u&&p&&(0,t.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[(0,t.jsx)(ue,{status:u.status}),u.status==="needs_setup"&&(0,t.jsx)("span",{onClick:a(h=>{h.preventDefault(),h.stopPropagation()},"onClick"),children:(0,t.jsx)(K,{size:"xs",variant:"outline",onClick:a(()=>I(u),"onClick"),children:"Set up"})})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[(0,t.jsx)("span",{className:"sm:hidden",children:r.has(e.id)?(0,t.jsx)(D,{agentRef:l?$(l):e.id,runId:r.get(e.id).runId,liveCount:r.get(e.id).liveCount}):(0,t.jsx)(O,{status:e.status})}),(0,t.jsxs)("div",{className:"hidden sm:flex items-center gap-3",children:[r.has(e.id)&&(0,t.jsx)(D,{agentRef:l?$(l):e.id,runId:r.get(e.id).runId,liveCount:r.get(e.id).liveCount}),l&&(0,t.jsx)("div",{className:"hidden xl:flex items-center gap-3",children:(0,t.jsx)(he,{agent:l,environment:m?me:o.get(l.id)??z,showEnvironment:N})}),(0,t.jsx)("span",{className:"w-20 flex justify-end",children:(0,t.jsx)(O,{status:e.status})})]})]})]}),e.reports&&e.reports.length>0&&(0,t.jsx)("div",{className:"border-l border-border ml-4",children:e.reports.map(h=>(0,t.jsx)(fe,{node:h,depth:n+1,agentMap:i,liveRunByAgent:r,environmentByAgentId:o,environmentDataLoading:m,showEnvironment:N,tab:v,memberships:E,builtInByAgentId:w,onConfigureBuiltIn:I},h.id))})]})}a(fe,"OrgTreeNode");function he({agent:e,environment:n,showEnvironment:i}){const r=nt(e),o=He(e.adapterType);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"w-44 min-w-0 leading-tight",children:[(0,t.jsx)("div",{className:"truncate font-mono text-xs text-muted-foreground",title:r??void 0,children:r??"—"}),(0,t.jsx)("div",{className:"truncate font-mono text-(length:--text-micro) text-muted-foreground/70",title:o,children:o})]}),i&&(0,t.jsxs)("div",{className:"w-44 min-w-0 leading-tight",children:[(0,t.jsx)("div",{className:"truncate text-xs text-muted-foreground",title:n.title,children:n.label}),(0,t.jsx)("div",{className:"truncate text-(length:--text-micro) text-muted-foreground/70",children:n.detail})]}),(0,t.jsx)("span",{className:"w-24 whitespace-nowrap text-right text-xs text-muted-foreground",children:e.lastHeartbeatAt?Ee(e.lastHeartbeatAt):"—"})]})}a(he,"AgentMetaColumns");function D({agentRef:e,runId:n,liveCount:i}){return(0,t.jsxs)(ie,{to:`/agents/${e}/runs/${n}`,className:"flex items-center gap-1.5 px-2 py-0.5 rounded-full bg-blue-500/10 hover:bg-blue-500/20 transition-colors no-underline",onClick:a(r=>r.stopPropagation(),"onClick"),children:[(0,t.jsxs)("span",{className:"relative flex h-2 w-2",children:[(0,t.jsx)("span",{className:"animate-pulse absolute inline-flex h-full w-full rounded-full bg-blue-400 opacity-75"}),(0,t.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-blue-500"})]}),(0,t.jsxs)("span",{className:"text-(length:--text-micro) font-medium text-blue-600 dark:text-blue-400",children:["Live",i>1?` (${i})`:""]})]})}a(D,"LiveRunIndicator");export{wt as Agents};
@@ -0,0 +1,15 @@
1
+ var On=Object.defineProperty;var a=(e,t)=>On(e,"name",{value:t,configurable:!0});import{i as jt}from"./rolldown-runtime-ZpX3ckPj.js";import{$n as jn,Ei as Nn,G as K,P as Bn,a as zn,aa as Fn,c as qn,er as st,ft as Hn,gi as Wn,hi as d,ia as Vn,ii as Kn,l as Qn,mi as Nt,mt as Jn,n as k,r as Gn,sa as Yn,t as Zn,u as Xn,xt as de}from"./agent-avatar-url-DQnt6boq.js";import{t as ea}from"./preload-helper-CceJXRIF.js";var l=jt(Yn(),1),We=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Bt=/^[\\/]{2}/;function ta(e,t){return t+e.replace(/\\/g,"/")}a(ta,"normalizeProtocolRelativeUrl");var it="popstate";function lt(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}a(lt,"isLocation");function ra(e={}){function t(n,o){let s=o.state?.masked,{pathname:i,search:u,hash:c}=s||n.location;return Oe("",{pathname:i,search:u,hash:c},o.state&&o.state.usr||null,o.state&&o.state.key||"default",s?{pathname:n.location.pathname,search:n.location.search,hash:n.location.hash}:void 0)}a(t,"createBrowserLocation");function r(n,o){return typeof o=="string"?o:Q(o)}return a(r,"createBrowserHref"),aa(t,r,null,e)}a(ra,"createBrowserHistory");function $(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}a($,"invariant");function M(e,t){if(!e)try{throw new Error(t)}catch{}}a(M,"warning");function na(){return Math.random().toString(36).substring(2,10)}a(na,"createKey");function ut(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}a(ut,"getHistoryState");function Oe(e,t,r=null,n,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?te(t):t,state:r,key:t&&t.key||n||na(),mask:o}}a(Oe,"createLocation");function Q({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}a(Q,"createPath");function te(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}a(te,"parsePath");function aa(e,t,r,n={}){let{window:o=document.defaultView,v5Compat:s=!1}=n,i=o.history,u="POP",c=null,m=p();m==null&&(m=0,i.replaceState({...i.state,idx:m},""));function p(){return(i.state||{idx:null}).idx}a(p,"getIndex");function f(){u="POP";let h=p(),x=h==null?null:h-m;m=h,c&&c({action:u,location:y.location,delta:x})}a(f,"handlePop");function g(h,x){u="PUSH";let w=lt(h)?h:Oe(y.location,h,x);r&&r(w,h),m=p()+1;let I=ut(w,m),_=y.createHref(w.mask||w);try{i.pushState(I,"",_)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(_)}s&&c&&c({action:u,location:y.location,delta:1})}a(g,"push");function b(h,x){u="REPLACE";let w=lt(h)?h:Oe(y.location,h,x);r&&r(w,h),m=p();let I=ut(w,m),_=y.createHref(w.mask||w);i.replaceState(I,"",_),s&&c&&c({action:u,location:y.location,delta:0})}a(b,"replace2");function v(h){return oa(o,h)}a(v,"createURL");let y={get action(){return u},get location(){return e(o,i)},listen(h){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(it,f),c=h,()=>{o.removeEventListener(it,f),c=null}},createHref(h){return t(o,h)},createURL:v,encodeLocation(h){let x=v(h);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:g,replace:b,go(h){return i.go(h)}};return y}a(aa,"getUrlBasedHistory");function oa(e,t,r=!1){let n="http://localhost";e&&(n=e.location.origin!=="null"?e.location.origin:e.location.href),$(n,"No window.location.(origin|href) available to create URL");let o=typeof t=="string"?t:Q(t);return o=o.replace(/ $/,"%20"),!r&&Bt.test(o)&&(o=n+o),new URL(o,n)}a(oa,"createBrowserURLImpl");var sa;sa=new WeakMap;function zt(e,t,r="/"){return Ft(e,t,r,!1)}a(zt,"matchRoutes");function Ft(e,t,r,n,o){let s=q((typeof t=="string"?te(t):t).pathname||"/",r);if(s==null)return null;let i=o??la(e),u=null,c=ba(s);for(let m=0;u==null&&m<i.length;++m)u=va(i[m],c,n);return u}a(Ft,"matchRoutesImpl");function ia(e,t){let{route:r,pathname:n,params:o}=e;return{id:r.id,pathname:n,params:o,data:t[r.id],loaderData:t[r.id],handle:r.handle}}a(ia,"convertRouteMatchToUiMatch");function la(e){let t=qt(e);return ua(t),t}a(la,"flattenAndRankRoutes");function qt(e,t=[],r=[],n="",o=!1){let s=a((i,u,c=o,m)=>{let p={relativePath:m===void 0?i.path||"":m,caseSensitive:i.caseSensitive===!0,childrenIndex:u,route:i};if(p.relativePath.startsWith("/")){if(!p.relativePath.startsWith(n)&&c)return;$(p.relativePath.startsWith(n),`Absolute route path "${p.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),p.relativePath=p.relativePath.slice(n.length)}let f=N([n,p.relativePath]),g=r.concat(p);i.children&&i.children.length>0&&($(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),qt(i.children,t,g,f,c)),!(i.path==null&&!i.index)&&t.push({path:f,score:ga(f,i.index),routesMeta:g.map((b,v)=>{let[y,h]=Vt(b.relativePath,b.caseSensitive,v===g.length-1);return{...b,matcher:y,compiledParams:h}})})},"flattenRoute");return e.forEach((i,u)=>{if(i.path===""||!i.path?.includes("?"))s(i,u);else for(let c of Ht(i.path))s(i,u,!0,c)}),t}a(qt,"flattenRoutes");function Ht(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,o=r.endsWith("?"),s=r.replace(/\?$/,"");if(n.length===0)return o?[s,""]:[s];let i=Ht(n.join("/")),u=[];return u.push(...i.map(c=>c===""?s:[s,c].join("/"))),o&&u.push(...i),u.map(c=>e.startsWith("/")&&c===""?"/":c)}a(Ht,"explodeOptionalSegments");function ua(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:ya(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}a(ua,"rankRouteBranches");var ca=/^:[\w-]+$/,da=3,ma=2,fa=1,pa=10,ha=-2,ct=a(e=>e==="*","isSplat");function ga(e,t){let r=e.split("/"),n=r.length;return r.some(ct)&&(n+=ha),t&&(n+=ma),r.filter(o=>!ct(o)).reduce((o,s)=>o+(ca.test(s)?da:s===""?fa:pa),n)}a(ga,"computeScore");function ya(e,t){return e.length===t.length&&e.slice(0,-1).every((r,n)=>r===t[n])?e[e.length-1]-t[t.length-1]:0}a(ya,"compareIndexes");function va(e,t,r=!1){let{routesMeta:n}=e,o={},s="/",i=[];for(let u=0;u<n.length;++u){let c=n[u],m=u===n.length-1,p=s==="/"?t:t.slice(s.length)||"/",f={path:c.relativePath,caseSensitive:c.caseSensitive,end:m},g=c.matcher&&c.compiledParams?Wt(f,p,c.matcher,c.compiledParams):xe(f,p),b=c.route;if(!g&&m&&r&&!n[n.length-1].route.index&&(g=xe({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},p)),!g)return null;Object.assign(o,g.params),i.push({params:o,pathname:N([s,g.pathname]),pathnameBase:wa(N([s,g.pathnameBase])),route:b}),g.pathnameBase!=="/"&&(s=N([s,g.pathnameBase]))}return i}a(va,"matchRouteBranch");function xe(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Vt(e.path,e.caseSensitive,e.end);return Wt(e,t,r,n)}a(xe,"matchPath");function Wt(e,t,r,n){let o=t.match(r);if(!o)return null;let s=o[0],i=X(s,1),u=o.slice(1);return{params:n.reduce((c,{paramName:m,isOptional:p},f)=>{if(m==="*"){let b=u[f]||"";i=X(s.slice(0,s.length-b.length),1)}const g=u[f];return p&&!g?c[m]=void 0:c[m]=(g||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:i,pattern:e}}a(Wt,"matchPathImpl");function Vt(e,t=!1,r=!0){M(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,i,u,c,m)=>{if(n.push({paramName:i,isOptional:u!=null}),u){let p=m.charAt(c+s.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),n]}a(Vt,"compilePath");function ba(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return M(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}a(ba,"decodePath");function q(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}a(q,"stripBasename");function ka(e,t="/"){let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?te(e):e,s;return r?(r=Kt(r),r.startsWith("/")||r.startsWith("\\")?s=dt(r.substring(1),"/"):s=dt(r,t)):s=t,{pathname:s,search:Ia(n),hash:Sa(o)}}a(ka,"resolvePath");function dt(e,t){let r=X(t).split("/");return e.split("/").forEach(n=>{n===".."?r.length>1&&r.pop():n!=="."&&r.push(n)}),r.length>1?r.join("/"):"/"}a(dt,"resolvePathname");function Le(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}a(Le,"getInvalidPathError");function xa(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}a(xa,"getPathContributingMatches");function Ve(e){let t=xa(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}a(Ve,"getResolveToMatches");function Re(e,t,r,n=!1){let o;typeof e=="string"?o=te(e):(o={...e},$(!o.pathname||!o.pathname.includes("?"),Le("?","pathname","search",o)),$(!o.pathname||!o.pathname.includes("#"),Le("#","pathname","hash",o)),$(!o.search||!o.search.includes("#"),Le("#","search","hash",o)));let s=e===""||o.pathname==="",i=s?"/":o.pathname,u;if(i==null)u=r;else{let f=t.length-1;if(!n&&i.startsWith("..")){let g=i.split("/");for(;g[0]==="..";)g.shift(),f-=1;o.pathname=g.join("/")}u=f>=0?t[f]:"/"}let c=ka(o,u),m=i&&i!=="/"&&i.endsWith("/"),p=(s||i===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(m||p)&&(c.pathname+="/"),c}a(Re,"resolveTo$1");var Kt=a(e=>e.replace(/[\\/]{2,}/g,"/"),"removeDoubleSlashes"),N=a(e=>Kt(e.join("/")),"joinPaths");function X(e,t=0){let r=e.length;for(;r>t&&e.charCodeAt(r-1)===47;)r--;return r===e.length?e:e.slice(0,r)}a(X,"removeTrailingSlash");var wa=a(e=>X(e).replace(/^\/*/,"/"),"normalizePathname"),Ia=a(e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,"normalizeSearch"),Sa=a(e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,"normalizeHash"),Ra=class{static{a(this,"ErrorResponseImpl")}constructor(e,t,r,n=!1){this.status=e,this.statusText=t||"",this.internal=n,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Qt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}a(Qt,"isRouteErrorResponse");function Ca(e){return N(e.map(t=>t.route.path).filter(Boolean))||"/"}a(Ca,"getRoutePattern");var Jt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Gt(e,t){let r=e;if(typeof r!="string"||!We.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let n=r,o=!1;if(Jt)try{let s=new URL(window.location.href),i=Bt.test(r)?new URL(ta(r,s.protocol)):new URL(r),u=q(i.pathname,t);i.origin===s.origin&&u!=null?r=u+i.search+i.hash:o=!0}catch{M(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:n,isExternal:o,to:r}}a(Gt,"parseToInfo");var Qi=Object.getOwnPropertyNames(Object.prototype).sort().join("\0"),mt=new URL("http://localhost");function Ke(e){if(e.createURL)return e.createURL("/");try{return new URL(e.createHref("/"),mt)}catch{return mt}}a(Ke,"getNavigatorCurrentUrl");function Me(e,t){return e.origin===t.origin&&(e.origin!=="null"||e.protocol===t.protocol&&e.host===t.host)}a(Me,"isSameOrigin");function Ea(e,t){if(e.startsWith("//"))return!0;let r=t.protocol.toLowerCase();return e.toLowerCase().startsWith(r)?t.host===""||e.slice(r.length).startsWith("//"):!1}a(Ea,"isExplicitUrl");function Qe(e,t,r,n){let o=null;try{o=e==null?null:new URL(e,r)}catch{}let s=new URL(t,r),i=o!=null&&!Me(o,r),u=!Me(s,r);if(n==="reject"){if(i||u)throw new Error("External navigation is not allowed")}else if(u&&(o==null||!Ea(e,o)||!Me(o,s)))throw new Error("External navigation is not allowed")}a(Qe,"validateNavigationTarget");var Yt=["POST","PUT","PATCH","DELETE"],Ji=new Set(Yt),$a=["GET",...Yt],Gi=new Set($a),_a,Aa,Da,Pa;_a=new WeakMap;Aa=new WeakMap;Da=new WeakMap;Pa=new WeakMap;var La=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Ma(e){try{return La.includes(new URL(e).protocol)}catch{return!1}}a(Ma,"hasInvalidProtocol");var re=l.createContext(null);re.displayName="DataRouter";var me=l.createContext(null);me.displayName="DataRouterState";var Zt=l.createContext(!1);function Xt(){return l.useContext(Zt)}a(Xt,"useIsRSCRouterContext");var er=l.createContext({isTransitioning:!1});er.displayName="ViewTransition";var Ta=l.createContext(new Map);Ta.displayName="Fetchers";var je=l.createContext(null);je.displayName="Await";var P=l.createContext(null);P.displayName="Navigation";var ne=l.createContext(null);ne.displayName="Location";var O=l.createContext({outlet:null,matches:[],isDataRoute:!1});O.displayName="Route";var Je=l.createContext(null);Je.displayName="RouteError";var tr="REACT_ROUTER_ERROR",Ua="REDIRECT",Oa="ROUTE_ERROR_RESPONSE";function ja(e){if(e.startsWith(`${tr}:${Ua}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}a(ja,"decodeRedirectErrorDigest");function Na(e){if(e.startsWith(`${tr}:${Oa}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Ra(t.status,t.statusText,t.data)}catch{}}a(Na,"decodeRouteErrorResponseDigest");function Ba(e,{relative:t}={}){$(ae(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:n}=l.useContext(P),{hash:o,pathname:s,search:i}=fe(e,{relative:t}),u=s;return r!=="/"&&(u=s==="/"?r:N([r,s])),n.createHref({pathname:u,search:i,hash:o})}a(Ba,"useHref");function ae(){return l.useContext(ne)!=null}a(ae,"useInRouterContext");function T(){return $(ae(),"useLocation() may be used only in the context of a <Router> component."),l.useContext(ne).location}a(T,"useLocation");function Yi(){return l.useContext(ne).navigationType}a(Yi,"useNavigationType");var rr="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function nr(e){l.useContext(P).static||l.useLayoutEffect(e)}a(nr,"useIsomorphicLayoutEffect");function Ce(){let{isDataRoute:e}=l.useContext(O);return e?ro():za()}a(Ce,"useNavigate$1");function za(){$(ae(),"useNavigate() may be used only in the context of a <Router> component.");let e=l.useContext(re),{basename:t,navigator:r}=l.useContext(P),{matches:n}=l.useContext(O),{pathname:o}=T(),s=JSON.stringify(Ve(n)),i=l.useRef(!1);return nr(()=>{i.current=!0}),l.useCallback((u,c={})=>{if(M(i.current,rr),!i.current)return;if(typeof u=="number"){r.go(u);return}let m=Re(u,JSON.parse(s),o,c.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:N([t,m.pathname])),Qe(typeof u=="string"?u:Q(u),r.createHref(m),Ke(r),"reject"),(c.replace?r.replace:r.push)(m,c.state,c)},[t,r,s,o,e])}a(za,"useNavigateUnstable");var Fa=l.createContext(null);function qa(e){let t=l.useContext(O).outlet;return l.useMemo(()=>t&&l.createElement(Fa.Provider,{value:e},t),[t,e])}a(qa,"useOutlet");function Ha(){let{matches:e}=l.useContext(O);return e[e.length-1]?.params??{}}a(Ha,"useParams");function fe(e,{relative:t}={}){let{matches:r}=l.useContext(O),{pathname:n}=T(),o=JSON.stringify(Ve(r));return l.useMemo(()=>Re(e,JSON.parse(o),n,t==="path"),[e,o,n,t])}a(fe,"useResolvedPath");function Wa(e,t){return ar(e,t)}a(Wa,"useRoutes");function ar(e,t,r){$(ae(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:n}=l.useContext(P),{matches:o}=l.useContext(O),s=o[o.length-1],i=s?s.params:{},u=s?s.pathname:"/",c=s?s.pathnameBase:"/",m=s&&s.route;{let h=m&&m.path||"";ir(u,!m||h.endsWith("*")||h.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${h}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
2
+
3
+ Please change the parent <Route path="${h}"> to <Route path="${h==="/"?"*":`${h}/*`}">.`)}let p=T(),f;if(t){let h=typeof t=="string"?te(t):t;$(c==="/"||h.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${h.pathname}" was given in the \`location\` prop.`),f=h}else f=p;let g=f.pathname||"/",b=g;if(c!=="/"){let h=c.replace(/^\//,"").split("/");b="/"+g.replace(/^\//,"").split("/").slice(h.length).join("/")}let v=r&&r.state.matches.length?r.state.matches.map(h=>Object.assign(h,{route:r.manifest[h.route.id]||h.route})):zt(e,{pathname:b});M(m||v!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),M(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let y=Ga(v&&v.map(h=>Object.assign({},h,{params:Object.assign({},i,h.params),pathname:N([c,n.encodeLocation?n.encodeLocation(h.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:h.pathname]),pathnameBase:h.pathnameBase==="/"?c:N([c,n.encodeLocation?n.encodeLocation(h.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:h.pathnameBase])})),o,r);return t&&y?l.createElement(ne.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...f},navigationType:"POP"}},y):y}a(ar,"useRoutesImpl");function Va(){let e=to(),t=Qt(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:n},s={padding:"2px 4px",backgroundColor:n},i=null;return i=l.createElement(l.Fragment,null,l.createElement("p",null,"💿 Hey developer 👋"),l.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",l.createElement("code",{style:s},"ErrorBoundary")," or"," ",l.createElement("code",{style:s},"errorElement")," prop on your route.")),l.createElement(l.Fragment,null,l.createElement("h2",null,"Unexpected Application Error!"),l.createElement("h3",{style:{fontStyle:"italic"}},t),r?l.createElement("pre",{style:o},r):null,i)}a(Va,"DefaultErrorComponent");var Ka=l.createElement(Va,null),or=class extends l.Component{static{a(this,"RenderErrorBoundary")}constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError&&this.props.onError(e,t)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=Na(e.digest);r&&(e=r)}let t=e!==void 0?l.createElement(O.Provider,{value:this.props.routeContext},l.createElement(Je.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?l.createElement(Qa,{error:e},t):t}};or.contextType=Zt;var Te=new WeakMap;function Qa({children:e,error:t}){let{basename:r,navigator:n}=l.useContext(P);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let o=ja(t.digest);if(o){let s=Te.get(t);if(s)throw s;let i=Gt(o.location,r),u=i.absoluteURL||i.to;if(Qe(o.location,u,Ke(n),"allow-explicit"),Ma(u))throw new Error("Invalid redirect location");if(Jt&&!Te.get(t))if(i.isExternal||o.reloadDocument)window.location.href=u;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:o.replace}));throw Te.set(t,c),c}return l.createElement("meta",{httpEquiv:"refresh",content:`0;url=${u}`})}}return e}a(Qa,"RSCErrorHandler");function Ja({routeContext:e,match:t,children:r}){let n=l.useContext(re);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),l.createElement(O.Provider,{value:e},r)}a(Ja,"RenderedRoute");function Ga(e,t=[],r){let n=r?.state;if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,s=n?.errors;if(s!=null){let p=o.findIndex(f=>f.route.id&&s?.[f.route.id]!==void 0);$(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),o=o.slice(0,Math.min(o.length,p+1))}let i=!1,u=-1;if(r&&n){i=n.renderFallback;for(let p=0;p<o.length;p++){let f=o[p];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=p),f.route.id){let{loaderData:g,errors:b}=n,v=f.route.loader&&!g.hasOwnProperty(f.route.id)&&(!b||b[f.route.id]===void 0);if(f.route.lazy||v){r.isStatic&&(i=!0),u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}}let c=r?.onError,m=n&&c?(p,f)=>{c(p,{location:n.location,params:n.matches?.[0]?.params??{},pattern:Ca(n.matches),errorInfo:f})}:void 0;return o.reduceRight((p,f,g)=>{let b,v=!1,y=null,h=null;n&&(b=s&&f.route.id?s[f.route.id]:void 0,y=f.route.errorElement||Ka,i&&(u<0&&g===0?(ir("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,h=null):u===g&&(v=!0,h=f.route.hydrateFallbackElement||null)));let x=t.concat(o.slice(0,g+1)),w=a(()=>{let I;return b?I=y:v?I=h:f.route.Component?I=l.createElement(f.route.Component,null):f.route.element?I=f.route.element:I=p,l.createElement(Ja,{match:f,routeContext:{outlet:p,matches:x,isDataRoute:n!=null},children:I})},"getChildren");return n&&(f.route.ErrorBoundary||f.route.errorElement||g===0)?l.createElement(or,{location:n.location,revalidation:n.revalidation,component:y,error:b,children:w(),routeContext:{outlet:null,matches:x,isDataRoute:!0},onError:m}):w()},null)}a(Ga,"_renderMatches");function Ge(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}a(Ge,"getDataRouterConsoleError");function Ya(e){let t=l.useContext(re);return $(t,Ge(e)),t}a(Ya,"useDataRouterContext");function Ye(e){let t=l.useContext(me);return $(t,Ge(e)),t}a(Ye,"useDataRouterState");function Za(e){let t=l.useContext(O);return $(t,Ge(e)),t}a(Za,"useRouteContext");function Ze(e){let t=Za(e),r=t.matches[t.matches.length-1];return $(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}a(Ze,"useCurrentRouteId");function Xa(){return Ze("useRouteId")}a(Xa,"useRouteId");function eo(){let e=Ye("useNavigation");return l.useMemo(()=>{let{matches:t,historyAction:r,...n}=e.navigation;return n},[e.navigation])}a(eo,"useNavigation");function sr(){let{matches:e,loaderData:t}=Ye("useMatches");return l.useMemo(()=>e.map(r=>ia(r,t)),[e,t])}a(sr,"useMatches");function to(){let e=l.useContext(Je),t=Ye("useRouteError"),r=Ze("useRouteError");return e!==void 0?e:t.errors?.[r]}a(to,"useRouteError");function ro(){let{router:e}=Ya("useNavigate"),t=Ze("useNavigate"),r=l.useRef(!1);return nr(()=>{r.current=!0}),l.useCallback(async(n,o={})=>{M(r.current,rr),r.current&&(typeof n=="number"?await e.navigate(n):await e.navigate(n,{fromRouteId:t,...o}))},[e,t])}a(ro,"useNavigateStable");var ft={};function ir(e,t,r){!t&&!ft[e]&&(ft[e]=!0,M(!1,r))}a(ir,"warningOnce");var pt={};function no(e,t){!e&&!pt[t]&&(pt[t]=!0)}a(no,"warnOnce");var Zi=l.memo(ao);function ao({routes:e,manifest:t,future:r,state:n,isStatic:o,onError:s}){return ar(e,void 0,{manifest:t,state:n,isStatic:o,onError:s,future:r})}a(ao,"DataRoutes2");function oo({to:e,replace:t,state:r,relative:n}){$(ae(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o,navigator:s}=l.useContext(P);M(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=l.useContext(O),{pathname:u}=T(),c=Ce(),m=Re(e,Ve(i),u,n==="path");Qe(typeof e=="string"?e:Q(e),s.createHref(m),Ke(s),"reject");let p=JSON.stringify(m);return l.useEffect(()=>{c(JSON.parse(p),{replace:t,state:r,relative:n})},[c,p,n,t,r]),null}a(oo,"Navigate$1");function Xi(e){return qa(e.context)}a(Xi,"Outlet");function so(e){$(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}a(so,"Route");function lr({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:o,static:s=!1,useTransitions:i}){$(!ae(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=e.replace(/^\/*/,"/"),c=l.useMemo(()=>({basename:u,navigator:o,static:s,useTransitions:i,future:{}}),[u,o,s,i]);typeof r=="string"&&(r=te(r));let{pathname:m="/",search:p="",hash:f="",state:g=null,key:b="default",mask:v}=r,y=l.useMemo(()=>{let h=q(m,u);return h==null?null:{location:{pathname:h,search:p,hash:f,state:g,key:b,mask:v},navigationType:n}},[u,m,p,f,g,b,n,v]);return M(y!=null,`<Router basename="${u}"> is not able to match the URL "${m}${p}${f}" because it does not start with the basename, so the <Router> won't render anything.`),y==null?null:l.createElement(P.Provider,{value:c},l.createElement(ne.Provider,{children:t,value:y}))}a(lr,"Router");function el({children:e,location:t}){return Wa(Ne(e),t)}a(el,"Routes");var tl=class extends l.Component{static{a(this,"AwaitErrorBoundary")}constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onError&&this.props.onError(e,t)}render(){let{children:e,errorElement:t,resolve:r}=this.props,n=null,o=0;if(!(r instanceof Promise))o=1,n=Promise.resolve(),Object.defineProperty(n,"_tracked",{get:a(()=>!0,"get")}),Object.defineProperty(n,"_data",{get:a(()=>r,"get")});else if(this.state.error){o=2;let s=this.state.error;n=Promise.reject().catch(()=>{}),Object.defineProperty(n,"_tracked",{get:a(()=>!0,"get")}),Object.defineProperty(n,"_error",{get:a(()=>s,"get")})}else r._tracked?(n=r,o="_error"in n?2:"_data"in n?1:0):(o=0,Object.defineProperty(r,"_tracked",{get:a(()=>!0,"get")}),n=r.then(s=>Object.defineProperty(r,"_data",{get:a(()=>s,"get")}),s=>{this.props.onError?.(s),Object.defineProperty(r,"_error",{get:a(()=>s,"get")})}));if(o===2&&!t)throw n._error;if(o===2)return l.createElement(je.Provider,{value:n,children:t});if(o===1)return l.createElement(je.Provider,{value:n,children:e});throw n}};function Ne(e,t=[]){let r=[];return l.Children.forEach(e,(n,o)=>{if(!l.isValidElement(n))return;let s=[...t,o];if(n.type===l.Fragment){r.push.apply(r,Ne(n.props.children,s));return}$(n.type===so,`[${typeof n.type=="string"?n.type:n.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),$(!n.props.index||!n.props.children,"An index route cannot have child routes.");let i={id:n.props.id||s.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,middleware:n.props.middleware,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(i.children=Ne(n.props.children,s)),r.push(i)}),r}a(Ne,"createRoutesFromChildren");var be="get",ke="application/x-www-form-urlencoded";function Ee(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}a(Ee,"isHtmlElement");function io(e){return Ee(e)&&e.tagName.toLowerCase()==="button"}a(io,"isButtonElement");function lo(e){return Ee(e)&&e.tagName.toLowerCase()==="form"}a(lo,"isFormElement");function uo(e){return Ee(e)&&e.tagName.toLowerCase()==="input"}a(uo,"isInputElement");function co(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}a(co,"isModifiedEvent");function mo(e,t){return e.button===0&&(!t||t==="_self")&&!co(e)}a(mo,"shouldProcessLinkClick");function Be(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(o=>[r,o]):[[r,n]])},[]))}a(Be,"createSearchParams");function fo(e,t){let r=Be(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(s=>{r.append(o,s)})}),r}a(fo,"getSearchParamsForLocation");var ge=null;function po(){if(ge===null)try{new FormData(document.createElement("form"),0),ge=!1}catch{ge=!0}return ge}a(po,"isFormDataSubmitterSupported");var ho=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ue(e){return e!=null&&!ho.has(e)?(M(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ke}"`),null):e}a(Ue,"getFormEncType");function go(e,t){let r,n,o,s,i;if(lo(e)){let u=e.getAttribute("action");n=u?q(u,t):null,r=e.getAttribute("method")||be,o=Ue(e.getAttribute("enctype"))||ke,s=new FormData(e)}else if(io(e)||uo(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||u.getAttribute("action");if(n=c?q(c,t):null,r=e.getAttribute("formmethod")||u.getAttribute("method")||be,o=Ue(e.getAttribute("formenctype"))||Ue(u.getAttribute("enctype"))||ke,s=new FormData(u,e),!po()){let{name:m,type:p,value:f}=e;if(p==="image"){let g=m?`${m}.`:"";s.append(`${g}x`,"0"),s.append(`${g}y`,"0")}else m&&s.append(m,f)}}else{if(Ee(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=be,n=null,o=ke,i=e}return s&&o==="text/plain"&&(i=s,s=void 0),{action:n,method:r.toLowerCase(),encType:o,formData:s,body:i}}a(go,"getFormSubmissionInfo");var rl=Object.getOwnPropertyNames(Object.prototype).sort().join("\0"),yo={"&":"\\u0026",">":"\\u003e","<":"\\u003c","\u2028":"\\u2028","\u2029":"\\u2029"},vo=/[&><\u2028\u2029]/g;function ht(e){return e.replace(vo,t=>yo[t])}a(ht,"escapeHtml");function $e(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}a($e,"invariant2");function ur(e,t,r,n){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${n}`:o.pathname=`${o.pathname}.${n}`:o.pathname==="/"?o.pathname=`_root.${n}`:t&&q(o.pathname,t)==="/"?o.pathname=`${X(t)}/_root.${n}`:o.pathname=`${X(o.pathname)}.${n}`,o}a(ur,"singleFetchUrl");async function bo(e,t){if(e.id in t)return t[e.id];try{let r=await ea(()=>import(e.module),[]);return t[e.id]=r,r}catch{return window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}a(bo,"loadRouteModule");function ko(e){return e!=null&&typeof e.page=="string"}a(ko,"isPageLinkDescriptor");function xo(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}a(xo,"isHtmlLinkDescriptor");async function wo(e,t,r){return Ro((await Promise.all(e.map(async n=>{let o=t.routes[n.route.id];if(o){let s=await bo(o,r);return s.links?s.links():[]}return[]}))).flat(1).filter(xo).filter(n=>n.rel==="stylesheet"||n.rel==="preload").map(n=>n.rel==="stylesheet"?{...n,rel:"prefetch",as:"style"}:{...n,rel:"prefetch"}))}a(wo,"getKeyedPrefetchLinks");function gt(e,t,r,n,o,s){let i=a((c,m)=>r[m]?c.route.id!==r[m].route.id:!0,"isNew"),u=a((c,m)=>r[m].pathname!==c.pathname||r[m].route.path?.endsWith("*")&&r[m].params["*"]!==c.params["*"],"matchPathChanged");return s==="assets"?t.filter((c,m)=>i(c,m)||u(c,m)):s==="data"?t.filter((c,m)=>{let p=n.routes[c.route.id];if(!p||!p.hasLoader)return!1;if(i(c,m)||u(c,m))return!0;if(c.route.shouldRevalidate){let f=c.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof f=="boolean")return f}return!0}):[]}a(gt,"getNewMatchesForLinks");function cr(e,t,{includeHydrateFallback:r}={}){return Io(e.map(n=>{let o=t.routes[n.route.id];if(!o)return[];let s=[o.module];return o.clientActionModule&&(s=s.concat(o.clientActionModule)),o.clientLoaderModule&&(s=s.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(s=s.concat(o.hydrateFallbackModule)),o.imports&&(s=s.concat(o.imports)),s}).flat(1))}a(cr,"getModuleLinkHrefs");function Io(e){return[...new Set(e)]}a(Io,"dedupeHrefs");function So(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}a(So,"sortKeys");function Ro(e,t){let r=new Set,n=new Set(t);return e.reduce((o,s)=>{if(t&&!ko(s)&&s.as==="script"&&s.href&&n.has(s.href))return o;let i=JSON.stringify(So(s));return r.has(i)||(r.add(i),o.push({key:i,link:s})),o},[])}a(Ro,"dedupeLinkDescriptors");function Co(e,t){return e.mode==="lazy"&&t===!0}a(Co,"isFogOfWarEnabled");function Eo({sri:e,...t},r){let n=new Set(r.state.matches.map(u=>u.route.id)),o=r.state.location.pathname.split("/").filter(Boolean),s=["/"];for(o.pop();o.length>0;)s.push(`/${o.join("/")}`),o.pop();s.forEach(u=>{let c=Ft(r.routes,u,r.basename||"/",!1,r.branches);c&&c.forEach(m=>n.add(m.route.id))});let i=[...n].reduce((u,c)=>Object.assign(u,{[c]:t.routes[c]}),{});return{...t,routes:i,sri:e?!0:void 0}}a(Eo,"getPartialManifest");function _e(){let e=l.useContext(re);return $e(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}a(_e,"useDataRouterContext2");function dr(){let e=l.useContext(me);return $e(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}a(dr,"useDataRouterStateContext");var Ae=l.createContext(void 0);Ae.displayName="FrameworkContext";function J(){let e=l.useContext(Ae);return $e(e,"You must render this element inside a <HydratedRouter> element"),e}a(J,"useFrameworkContext");function $o(e,t){let r=l.useContext(Ae),[n,o]=l.useState(!1),[s,i]=l.useState(!1),{onFocus:u,onBlur:c,onMouseEnter:m,onMouseLeave:p,onTouchStart:f}=t,g=l.useRef(null);l.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let y=a(x=>{x.forEach(w=>{i(w.isIntersecting)})},"callback"),h=new IntersectionObserver(y,{threshold:.5});return g.current&&h.observe(g.current),()=>{h.disconnect()}}},[e]),l.useEffect(()=>{if(n){let y=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(y)}}},[n]);let b=a(()=>{o(!0)},"setIntent"),v=a(()=>{o(!1),i(!1)},"cancelIntent");return r?e!=="intent"?[s,g,{}]:[s,g,{onFocus:ie(u,b),onBlur:ie(c,v),onMouseEnter:ie(m,b),onMouseLeave:ie(p,v),onTouchStart:ie(f,b)}]:[!1,g,{}]}a($o,"usePrefetchBehavior");function ie(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}a(ie,"composeEventHandlers");function _o(e,t,r){if(r&&!we)return[e[0]];if(t){let n=e.findIndex(o=>t[o.route.id]!==void 0);return e.slice(0,n+1)}return e}a(_o,"getActiveMatches");function Ao({page:e,...t}){let r=Xt(),{nonce:n}=J(),{router:o}=_e(),s=l.useMemo(()=>zt(o.routes,e,o.basename),[o.routes,e,o.basename]);return s?(t.nonce==null&&n&&(t={...t,nonce:n}),r?l.createElement(Po,{page:e,matches:s,...t}):l.createElement(Lo,{page:e,matches:s,...t})):null}a(Ao,"PrefetchPageLinks");function Do(e){let{manifest:t,routeModules:r}=J(),[n,o]=l.useState([]);return l.useEffect(()=>{let s=!1;return wo(e,t,r).then(i=>{s||o(i)}),()=>{s=!0}},[e,t,r]),n}a(Do,"useKeyedPrefetchLinks");function Po({page:e,matches:t,...r}){let n=T(),{future:o}=J(),{basename:s}=_e(),i=l.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let u=ur(e,s,o.v8_trailingSlashAwareDataRequests,"rsc"),c=!1,m=[];for(let p of t)typeof p.route.shouldRevalidate=="function"?c=!0:m.push(p.route.id);return c&&m.length>0&&u.searchParams.set("_routes",m.join(",")),[u.pathname+u.search]},[s,o.v8_trailingSlashAwareDataRequests,e,n,t]);return l.createElement(l.Fragment,null,i.map(u=>l.createElement("link",{key:u,rel:"prefetch",as:"fetch",href:u,...r})))}a(Po,"RSCPrefetchPageLinksImpl");function Lo({page:e,matches:t,...r}){let n=T(),{future:o,manifest:s,routeModules:i}=J(),{basename:u}=_e(),{loaderData:c,matches:m}=dr(),p=l.useMemo(()=>gt(e,t,m,s,n,"data"),[e,t,m,s,n]),f=l.useMemo(()=>gt(e,t,m,s,n,"assets"),[e,t,m,s,n]),g=l.useMemo(()=>{if(e===n.pathname+n.search+n.hash)return[];let y=new Set,h=!1;if(t.forEach(w=>{let I=s.routes[w.route.id];!I||!I.hasLoader||(!p.some(_=>_.route.id===w.route.id)&&w.route.id in c&&i[w.route.id]?.shouldRevalidate||I.hasClientLoader?h=!0:y.add(w.route.id))}),y.size===0)return[];let x=ur(e,u,o.v8_trailingSlashAwareDataRequests,"data");return h&&y.size>0&&x.searchParams.set("_routes",t.filter(w=>y.has(w.route.id)).map(w=>w.route.id).join(",")),[x.pathname+x.search]},[u,o.v8_trailingSlashAwareDataRequests,c,n,s,p,t,e,i]),b=l.useMemo(()=>cr(f,s),[f,s]),v=Do(f);return l.createElement(l.Fragment,null,g.map(y=>l.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...r})),b.map(y=>l.createElement("link",{key:y,rel:"modulepreload",href:y,...r})),v.map(({key:y,link:h})=>l.createElement("link",{key:y,nonce:r.nonce,...h,crossOrigin:h.crossOrigin??r.crossOrigin})))}a(Lo,"PrefetchPageLinksImpl");var we=!1;function Mo(){we=!0}a(Mo,"setIsHydrated");function To(e){let{manifest:t,serverHandoffString:r,isSpaMode:n,renderMeta:o,routeDiscovery:s,ssr:i,nonce:u}=J(),{router:c,static:m,staticContext:p}=_e(),{matches:f}=dr(),g=Xt(),b=Co(s,i);e.nonce==null&&u&&(e={...e,nonce:u}),o&&(o.didRenderScripts=!0);let v=_o(f,null,n);l.useEffect(()=>{Mo()},[]);let y=l.useMemo(()=>{if(g)return null;let w=p?`window.__reactRouterContext = ${r};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());`:" ",I=m?`${t.hmr?.runtime?`import ${JSON.stringify(t.hmr.runtime)};`:""}${b?"":`import ${JSON.stringify(t.url)}`};
4
+ ${v.map((_,C)=>{let A=`route${C}`,L=t.routes[_.route.id];$e(L,`Route ${_.route.id} not found in manifest`);let{clientActionModule:j,clientLoaderModule:D,clientMiddlewareModule:B,hydrateFallbackModule:G,module:U}=L,H=[...j?[{module:j,varName:`${A}_clientAction`}]:[],...D?[{module:D,varName:`${A}_clientLoader`}]:[],...B?[{module:B,varName:`${A}_clientMiddleware`}]:[],...G?[{module:G,varName:`${A}_HydrateFallback`}]:[],{module:U,varName:`${A}_main`}];return H.length===1?`import * as ${A} from ${JSON.stringify(U)};`:[H.map(z=>`import * as ${z.varName} from "${z.module}";`).join(`
5
+ `),`const ${A} = {${H.map(z=>`...${z.varName}`).join(",")}};`].join(`
6
+ `)}).join(`
7
+ `)}
8
+ ${b?`window.__reactRouterManifest = ${JSON.stringify(Eo(t,c),null,2)};`:""}
9
+ window.__reactRouterRouteModules = {${v.map((_,C)=>`${JSON.stringify(_.route.id)}:route${C}`).join(",")}};
10
+
11
+ import(${JSON.stringify(t.entry.module)});`:" ";return l.createElement(l.Fragment,null,l.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:w},type:void 0}),l.createElement("script",{...e,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:I},type:"module",async:!0}))},[]),h=we||g?[]:[...new Set(t.entry.imports.concat(cr(v,t,{includeHydrateFallback:!0})))],x=typeof t.sri=="object"?t.sri:{};return no(!g,"The <Scripts /> element is a no-op when using RSC and can be safely removed."),we||g?null:l.createElement(l.Fragment,null,typeof t.sri=="object"?l.createElement("script",{...e,"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:x})}}):null,b?null:l.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:x[t.url],nonce:e.nonce,suppressHydrationWarning:!0}),l.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:x[t.entry.module],nonce:e.nonce,suppressHydrationWarning:!0}),h.map(w=>l.createElement("link",{key:w,rel:"modulepreload",href:w,crossOrigin:e.crossOrigin,integrity:x[w],nonce:e.nonce,suppressHydrationWarning:!0})),y)}a(To,"Scripts");function Uo(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}a(Uo,"mergeRefs");var nl=class extends l.Component{static{a(this,"RemixErrorBoundary")}constructor(e){super(e),this.state={error:e.error||null,location:e.location}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error||null,location:e.location}:{error:e.error||t.error,location:t.location}}render(){return this.state.error?l.createElement(Oo,{error:this.state.error,isOutsideRemixApp:!0}):this.props.children}};function Oo({error:e,isOutsideRemixApp:t}){let{nonce:r}=J(),n=l.createElement("script",{nonce:r,dangerouslySetInnerHTML:{__html:`
12
+ console.log(
13
+ "💿 Hey developer 👋. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."
14
+ );
15
+ `}});if(Qt(e))return l.createElement(yt,{title:"Unhandled Thrown Response!"},l.createElement("h1",{style:{fontSize:"24px"}},e.status," ",e.statusText),n);let o;if(e instanceof Error)o=e;else{let s=e==null?"Unknown Error":typeof e=="object"&&"toString"in e?e.toString():JSON.stringify(e);o=new Error(s)}return l.createElement(yt,{title:"Application Error!",isOutsideRemixApp:t},l.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),l.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},o.stack),n)}a(Oo,"RemixRootDefaultErrorBoundary");function yt({title:e,renderScripts:t,isOutsideRemixApp:r,children:n}){let{routeModules:o}=J();return o.root?.Layout&&!r?n:l.createElement("html",{lang:"en"},l.createElement("head",null,l.createElement("meta",{charSet:"utf-8"}),l.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),l.createElement("title",null,e)),l.createElement("body",null,l.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},n,t?l.createElement(To,null):null)))}a(yt,"BoundaryShell");var jo=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{jo&&(window.__reactRouterVersion="7.18.4")}catch{}function al({basename:e,children:t,useTransitions:r,window:n}){let o=l.useRef();o.current==null&&(o.current=ra({window:n,v5Compat:!0}));let s=o.current,[i,u]=l.useState({action:s.action,location:s.location}),c=l.useCallback(m=>{r===!1?u(m):l.startTransition(()=>u(m))},[r]);return l.useLayoutEffect(()=>s.listen(c),[s,c]),l.createElement(lr,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:s,useTransitions:r})}a(al,"BrowserRouter");function No({basename:e,children:t,history:r,useTransitions:n}){let[o,s]=l.useState({action:r.action,location:r.location}),i=l.useCallback(u=>{n===!1?s(u):l.startTransition(()=>s(u))},[n]);return l.useLayoutEffect(()=>r.listen(i),[r,i]),l.createElement(lr,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:r,useTransitions:n})}a(No,"HistoryRouter");No.displayName="unstable_HistoryRouter";var pe=l.forwardRef(a(function({onClick:t,discover:r="render",prefetch:n="none",relative:o,reloadDocument:s,replace:i,mask:u,state:c,target:m,to:p,preventScrollReset:f,viewTransition:g,defaultShouldRevalidate:b,...v},y){let{basename:h,navigator:x,useTransitions:w}=l.useContext(P),I=typeof p=="string"&&We.test(p),_=Gt(p,h);p=_.to;let C=Ba(p,{relative:o}),A=T(),L=null;if(u){let F=Re(u,[],A.mask?A.mask.pathname:"/",!0);h!=="/"&&(F.pathname=F.pathname==="/"?h:N([h,F.pathname])),L=x.createHref(F)}let[j,D,B]=$o(n,v),G=qo(p,{replace:i,mask:u,state:c,target:m,preventScrollReset:f,relative:o,viewTransition:g,defaultShouldRevalidate:b,useTransitions:w});function U(F){t&&t(F),F.defaultPrevented||G(F)}a(U,"handleClick");let H=!(_.isExternal||s),z=l.createElement("a",{...v,...B,href:(H?L:void 0)||_.absoluteURL||C,onClick:H?U:t,ref:Uo(y,D),target:m,"data-discover":!I&&r==="render"?"true":void 0});return j&&!I?l.createElement(l.Fragment,null,z,l.createElement(Ao,{page:C})):z},"LinkWithRef"));pe.displayName="Link";var mr=l.forwardRef(a(function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:o=!1,style:s,to:i,viewTransition:u,children:c,...m},p){let f=fe(i,{relative:m.relative}),g=T(),b=l.useContext(me),{navigator:v,basename:y}=l.useContext(P),h=b!=null&&Go(f)&&u===!0,x=v.encodeLocation?v.encodeLocation(f).pathname:f.pathname,w=g.pathname,I=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;r||(w=w.toLowerCase(),I=I?I.toLowerCase():null,x=x.toLowerCase()),I&&y&&(I=q(I,y)||I);const _=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let C=w===x||!o&&w.startsWith(x)&&w.charAt(_)==="/",A=I!=null&&(I===x||!o&&I.startsWith(x)&&I.charAt(x.length)==="/"),L={isActive:C,isPending:A,isTransitioning:h},j=C?t:void 0,D;typeof n=="function"?D=n(L):D=[n,C?"active":null,A?"pending":null,h?"transitioning":null].filter(Boolean).join(" ");let B=typeof s=="function"?s(L):s;return l.createElement(pe,{...m,"aria-current":j,className:D,ref:p,style:B,to:i,viewTransition:u},typeof c=="function"?c(L):c)},"NavLinkWithRef"));mr.displayName="NavLink";var Bo=l.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:n,replace:o,state:s,method:i=be,action:u,onSubmit:c,relative:m,preventScrollReset:p,viewTransition:f,defaultShouldRevalidate:g,...b},v)=>{let{useTransitions:y}=l.useContext(P),h=Vo(),x=Ko(u,{relative:m}),w=i.toLowerCase()==="get"?"get":"post",I=typeof u=="string"&&We.test(u),_=a(C=>{if(c&&c(C),C.defaultPrevented)return;C.preventDefault();let A=C.nativeEvent.submitter,L=A?.getAttribute("formmethod")||i,j=a(()=>h(A||C.currentTarget,{fetcherKey:t,method:L,navigate:r,replace:o,state:s,relative:m,preventScrollReset:p,viewTransition:f,defaultShouldRevalidate:g}),"doSubmit");y&&r!==!1?l.startTransition(()=>j()):j()},"submitHandler");return l.createElement("form",{ref:v,method:w,action:x,onSubmit:n?c:_,...b,"data-discover":!I&&e==="render"?"true":void 0})});Bo.displayName="Form";function zo({getKey:e,storageKey:t,...r}){let n=l.useContext(Ae),{basename:o}=l.useContext(P),s=T(),i=sr();Qo({getKey:e,storageKey:t});let u=l.useMemo(()=>{if(!n||!e)return null;let m=Fe(s,i,o,e);return m!==s.key?m:null},[]);if(!n||n.isSpaMode)return null;let c=((m,p)=>{if(!window.history.state||!window.history.state.key){let f=Math.random().toString(32).slice(2);window.history.replaceState({key:f},"")}try{let f=JSON.parse(sessionStorage.getItem(m)||"{}")[p||window.history.state.key];typeof f=="number"&&window.scrollTo(0,f)}catch{sessionStorage.removeItem(m)}}).toString();return r.nonce==null&&n?.nonce&&(r.nonce=n.nonce),l.createElement("script",{...r,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${ht(JSON.stringify(t||ze))}, ${ht(JSON.stringify(u))})`}})}a(zo,"ScrollRestoration");zo.displayName="ScrollRestoration";function fr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}a(fr,"getDataRouterConsoleError2");function Xe(e){let t=l.useContext(re);return $(t,fr(e)),t}a(Xe,"useDataRouterContext3");function Fo(e){let t=l.useContext(me);return $(t,fr(e)),t}a(Fo,"useDataRouterState2");function qo(e,{target:t,replace:r,mask:n,state:o,preventScrollReset:s,relative:i,viewTransition:u,defaultShouldRevalidate:c,useTransitions:m}={}){let p=Ce(),f=T(),g=fe(e,{relative:i});return l.useCallback(b=>{if(mo(b,t)){b.preventDefault();let v=r!==void 0?r:Q(f)===Q(g),y=a(()=>p(e,{replace:v,mask:n,state:o,preventScrollReset:s,relative:i,viewTransition:u,defaultShouldRevalidate:c}),"doNavigate");m?l.startTransition(()=>y()):y()}},[f,p,g,r,n,o,t,e,s,i,u,c,m])}a(qo,"useLinkClickHandler");function ol(e){M(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=l.useRef(Be(e)),r=l.useRef(!1),n=T(),o=l.useMemo(()=>fo(n.search,r.current?null:t.current),[n.search]),s=Ce();return[o,l.useCallback((i,u)=>{const c=Be(typeof i=="function"?i(new URLSearchParams(o)):i);r.current=!0,s("?"+c,u)},[s,o])]}a(ol,"useSearchParams");var Ho=0,Wo=a(()=>`__${String(++Ho)}__`,"getUniqueFetcherId");function Vo(){let{router:e}=Xe("useSubmit"),{basename:t}=l.useContext(P),r=Xa(),n=e.fetch,o=e.navigate;return l.useCallback(async(s,i={})=>{let{action:u,method:c,encType:m,formData:p,body:f}=go(s,t);if(i.navigate===!1){let g=i.fetcherKey||Wo();await n(g,r,i.action||u,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:p,body:f,formMethod:i.method||c,formEncType:i.encType||m,flushSync:i.flushSync})}else await o(i.action||u,{defaultShouldRevalidate:i.defaultShouldRevalidate,preventScrollReset:i.preventScrollReset,formData:p,body:f,formMethod:i.method||c,formEncType:i.encType||m,replace:i.replace,state:i.state,fromRouteId:r,flushSync:i.flushSync,viewTransition:i.viewTransition})},[n,o,t,r])}a(Vo,"useSubmit");function Ko(e,{relative:t}={}){let{basename:r}=l.useContext(P),n=l.useContext(O);$(n,"useFormAction must be used inside a RouteContext");let[o]=n.matches.slice(-1),s={...fe(e||".",{relative:t})},i=T();if(e==null){s.search=i.search;let u=new URLSearchParams(s.search),c=u.getAll("index");if(c.some(m=>m==="")){u.delete("index"),c.filter(p=>p).forEach(p=>u.append("index",p));let m=u.toString();s.search=m?`?${m}`:""}}return(!e||e===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(s.pathname=s.pathname==="/"?r:N([r,s.pathname])),Q(s)}a(Ko,"useFormAction");var ze="react-router-scroll-positions",ye={};function Fe(e,t,r,n){let o=null;return n&&(r!=="/"?o=n({...e,pathname:q(e.pathname,r)||e.pathname},t):o=n(e,t)),o==null&&(o=e.key),o}a(Fe,"getScrollRestorationKey");function Qo({getKey:e,storageKey:t}={}){let{router:r}=Xe("useScrollRestoration"),{restoreScrollPosition:n,preventScrollReset:o}=Fo("useScrollRestoration"),{basename:s}=l.useContext(P),i=T(),u=sr(),c=eo();l.useEffect(()=>(window.history.scrollRestoration="manual",()=>{window.history.scrollRestoration="auto"}),[]),Jo(l.useCallback(()=>{if(c.state==="idle"){let m=Fe(i,u,s,e);ye[m]=window.scrollY}try{sessionStorage.setItem(t||ze,JSON.stringify(ye))}catch(m){M(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${m}).`)}window.history.scrollRestoration="auto"},[c.state,e,s,i,u,t])),typeof document<"u"&&(l.useLayoutEffect(()=>{try{let m=sessionStorage.getItem(t||ze);m&&(ye=JSON.parse(m))}catch{}},[t]),l.useLayoutEffect(()=>{let m=r?.enableScrollRestoration(ye,()=>window.scrollY,e?(p,f)=>Fe(p,f,s,e):void 0);return()=>m&&m()},[r,s,e]),l.useLayoutEffect(()=>{if(n!==!1){if(typeof n=="number"){window.scrollTo(0,n);return}try{if(i.hash){let m=document.getElementById(decodeURIComponent(i.hash.slice(1)));if(m){m.scrollIntoView();return}}}catch{M(!1,`"${i.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}o!==!0&&window.scrollTo(0,0)}},[i,n,o]))}a(Qo,"useScrollRestoration");function sl(e,t){let{capture:r}=t||{};l.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("beforeunload",e,n),()=>{window.removeEventListener("beforeunload",e,n)}},[e,r])}a(sl,"useBeforeUnload");function Jo(e,t){let{capture:r}=t||{};l.useEffect(()=>{let n=r!=null?{capture:r}:void 0;return window.addEventListener("pagehide",e,n),()=>{window.removeEventListener("pagehide",e,n)}},[e,r])}a(Jo,"usePageHide");function Go(e,{relative:t}={}){let r=l.useContext(er);$(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:n}=Xe("useViewTransitionState"),o=fe(e,{relative:t});if(!r.isTransitioning)return!1;let s=q(r.currentLocation.pathname,n)||r.currentLocation.pathname,i=q(r.nextLocation.pathname,n)||r.nextLocation.pathname;return xe(o.pathname,i)!=null||xe(o.pathname,s)!=null}a(Go,"useViewTransitionState");var vt=60,qe=3600,Ie=24*qe,bt=7*Ie,kt=30*Ie;function Yo(e){const t=Date.now(),r=new Date(e).getTime(),n=Math.round((t-r)/1e3);return n<vt?"just now":n<qe?`${Math.floor(n/vt)}m ago`:n<Ie?`${Math.floor(n/qe)}h ago`:n<bt?`${Math.floor(n/Ie)}d ago`:n<kt?`${Math.floor(n/bt)}w ago`:`${Math.floor(n/kt)}mo ago`}a(Yo,"timeAgo");var Zo=[{label:"My work",views:[{key:"mine",label:"Mine",surface:"inbox",inboxTab:"mine",hint:"Assigned to you or waiting on you"},{key:"unread",label:"Unread",surface:"inbox",inboxTab:"unread",hint:"Tasks you touched with new activity"},{key:"blocked",label:"Blocked",surface:"inbox",inboxTab:"blocked",hint:"Blocked tasks, grouped by blocker"},{key:"recent",label:"Recent",surface:"inbox",inboxTab:"recent",hint:"Everything you touched lately"},{key:"everything",label:"Everything",surface:"inbox",inboxTab:"all",hint:"Tasks, approvals, failed runs and join requests"}]},{label:"Organization",views:[{key:"all",label:"All tasks",surface:"issues",statuses:[],hint:"Every task in the organization"},{key:"active",label:"Active",surface:"issues",statuses:["todo","in_progress","in_review","blocked"],hint:"Open tasks, running or not"},{key:"backlog",label:"Backlog",surface:"issues",statuses:["backlog"],hint:"Not started yet"},{key:"done",label:"Done",surface:"issues",statuses:["done","cancelled"],hint:"Completed and cancelled"}]}],pr=new Map(Zo.flatMap(e=>e.views.map(t=>[t.key,t]))),hr="mine",Xo="view",es="paperclip:tasks:last-view";function ts(e){return typeof e=="string"&&pr.has(e)}a(ts,"isTaskViewKey");function gr(e){return pr.get(e)}a(gr,"taskView");function et(e){return ts(e)?e:null}a(et,"normalizeTaskViewKey");var xt={mine:"mine",unread:"unread",blocked:"blocked",recent:"recent",all:"everything"};function il(e){return e&&e in xt?xt[e]:hr}a(il,"taskViewForInboxTab");function ll(){try{return et(window.localStorage.getItem("paperclip:tasks:last-view"))??"mine"}catch{return hr}}a(ll,"loadLastTaskView");function ul(e){try{window.localStorage.setItem(es,e)}catch{}}a(ul,"saveLastTaskView");var cl=["assignee","workspace","participantAgentId","q"];function dl(e,t,r){const n=et(e);return t&&(!n||gr(n).surface==="inbox")?"all":n??r}a(dl,"resolveInitialTaskView");var yr="from",vr="fromHref",br="paperclip:issue-detail-breadcrumb:";function kr(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.label=="string"&&typeof t.href=="string"}a(kr,"isIssueDetailBreadcrumb");function xr(e){return e==="issues"||e==="inbox"}a(xr,"isIssueDetailSource");function wr(e){if(typeof e!="object"||e===null)return!1;const t=e,r=t.originKind===void 0||typeof t.originKind=="string",n=t.originId===void 0||t.originId===null||typeof t.originId=="string",o=t.blockerAttention===void 0||typeof t.blockerAttention=="object"&&t.blockerAttention!==null;return typeof t.id=="string"&&(t.identifier===null||typeof t.identifier=="string")&&typeof t.title=="string"&&typeof t.status=="string"&&o&&typeof t.priority=="string"&&(t.projectId===null||typeof t.projectId=="string")&&(t.projectName===null||typeof t.projectName=="string")&&r&&n}a(wr,"isIssueDetailHeaderSeed");function rs(e){return{id:e.id,identifier:e.identifier??null,title:e.title,status:e.status,blockerAttention:e.blockerAttention,priority:e.priority,projectId:e.projectId??null,projectName:e.project?.name??null,originKind:e.originKind,originId:e.originId??null}}a(rs,"createIssueDetailHeaderSeed");function Ir(e,t){const r=rs(t);return typeof e!="object"||e===null?{issueDetailHeaderSeed:r}:{...e,issueDetailHeaderSeed:r}}a(Ir,"withIssueDetailHeaderSeed");function ns(e){if(typeof e!="object"||e===null)return null;const t=e.issueDetailHeaderSeed;return wr(t)?t:null}a(ns,"readIssueDetailHeaderSeed");function as(e){if(!e)return null;const t=new URLSearchParams(e).get(yr);return xr(t)?t:null}a(as,"readIssueDetailSourceFromSearch");function os(e){if(!e)return null;const t=new URLSearchParams(e).get(vr);return t&&t.startsWith("/")?t:null}a(os,"readIssueDetailBreadcrumbHrefFromSearch");function ss(e){const t=e.slice(e.indexOf("?")+1);if(!e.includes("?"))return!1;const r=new URLSearchParams(t).get(Xo),n=et(r);return n!==null&&gr(n).surface==="inbox"}a(ss,"isInboxBackedTaskViewHref");function Sr(e,t){return xr(e?.issueDetailSource)?e.issueDetailSource:t?t.href.includes("/inbox")||ss(t.href)||t.label==="Inbox"?"inbox":t.label==="Tasks"||t.href.includes("/issues")?"issues":null:null}a(Sr,"inferIssueDetailSource");function wt(e){return e==="inbox"?{label:"Inbox",href:"/inbox"}:{label:"Tasks",href:"/issues"}}a(wt,"breadcrumbForSource");function ml(e,t,r){return{issueDetailBreadcrumb:{label:e,href:t},issueDetailSource:r}}a(ml,"createIssueDetailLocationState");function fl(e){return typeof e!="object"||e===null?{issueDetailInboxQuickArchiveArmed:!0}:{...e,issueDetailInboxQuickArchiveArmed:!0}}a(fl,"armIssueDetailInboxQuickArchive");function is(e){if(typeof window>"u"||!window.sessionStorage)return null;const t=window.sessionStorage.getItem(`${br}${e}`);if(!t)return null;try{const r=JSON.parse(t),n=kr(r.issueDetailBreadcrumb)?r.issueDetailBreadcrumb:null,o=Sr(r,n);if(!n||!o)return null;const s=wr(r.issueDetailHeaderSeed)?r.issueDetailHeaderSeed:void 0;return{issueDetailBreadcrumb:n,issueDetailSource:o,issueDetailInboxQuickArchiveArmed:r.issueDetailInboxQuickArchiveArmed===!0,issueDetailHeaderSeed:s}}catch{return null}}a(is,"readStoredIssueDetailLocationState");function Rr(e,t){if(typeof e=="object"&&e!==null){const o=e.issueDetailBreadcrumb;if(kr(o)){const s=Sr(e,o);if(!s)return null;const i=ns(e)??void 0;return{issueDetailBreadcrumb:o,issueDetailSource:s,issueDetailInboxQuickArchiveArmed:e.issueDetailInboxQuickArchiveArmed===!0,issueDetailHeaderSeed:i}}}const r=as(t),n=os(t);return r?{issueDetailBreadcrumb:n?{...wt(r),href:n}:wt(r),issueDetailSource:r,issueDetailInboxQuickArchiveArmed:!1}:null}a(Rr,"normalizeIssueDetailLocationState");function pl(e,t,r){if(typeof window>"u"||!window.sessionStorage)return;const n=Rr(t,r);n&&window.sessionStorage.setItem(`${br}${e}`,JSON.stringify(n))}a(pl,"rememberIssueDetailLocationState");function ls(e){return`/issues/${e}`}a(ls,"createIssueDetailPath");function hl(e){if(!e)return!1;const t=new URLSearchParams(e);return t.has(yr)||t.has(vr)}a(hl,"hasLegacyIssueDetailQuery");function us(e,t,r){const n=Rr(t,r);return n||(e?is(e):null)}a(us,"readIssueDetailLocationState");function gl(e,t,r){return us(e,t,r)?.issueDetailBreadcrumb??null}a(gl,"readIssueDetailBreadcrumb");var It=class extends Error{static{a(this,"CommentSubmissionUnknownError")}constructor(){super("We couldn’t confirm whether this comment was saved. Review the conversation before starting another draft."),this.name="CommentSubmissionUnknownError"}};function St(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e,r=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;return typeof t.id=="string"&&r.test(t.id)&&typeof t.issueId=="string"&&r.test(t.issueId)&&typeof t.body=="string"}a(St,"hasCommentReceipt");async function Rt(e,t){try{const r=await e;if(!t(r))throw new It;return r}catch(r){throw r instanceof Nt&&r.status<500?r:new It}}a(Rt,"confirmedCommentResponse");function Ct(e){const t=new URLSearchParams;return e?.attention&&t.set("attention",e.attention),e?.status&&t.set("status",e.status),e?.projectId&&t.set("projectId",e.projectId),e?.parentId&&t.set("parentId",e.parentId),e?.assigneeAgentId&&t.set("assigneeAgentId",e.assigneeAgentId),e?.participantAgentId&&t.set("participantAgentId",e.participantAgentId),e?.assigneeUserId&&t.set("assigneeUserId",e.assigneeUserId),e?.touchedByUserId&&t.set("touchedByUserId",e.touchedByUserId),e?.inboxArchivedByUserId&&t.set("inboxArchivedByUserId",e.inboxArchivedByUserId),e?.unreadForUserId&&t.set("unreadForUserId",e.unreadForUserId),e?.labelId&&t.set("labelId",e.labelId),e?.workspaceId&&t.set("workspaceId",e.workspaceId),e?.executionWorkspaceId&&t.set("executionWorkspaceId",e.executionWorkspaceId),e?.originKind&&t.set("originKind",e.originKind),e?.originKindPrefix&&t.set("originKindPrefix",e.originKindPrefix),e?.originId&&t.set("originId",e.originId),e?.descendantOf&&t.set("descendantOf",e.descendantOf),e?.createdFromIssueId&&t.set("createdFromIssueId",e.createdFromIssueId),e?.includeRoutineExecutions&&t.set("includeRoutineExecutions","true"),e?.includeBlockedBy&&t.set("includeBlockedBy","true"),e?.includeBlockedInboxAttention&&t.set("includeBlockedInboxAttention","true"),e?.includeLiveDescendantSummary&&t.set("includeLiveDescendantSummary","true"),e?.hasPlanDocument!==void 0&&t.set("hasPlanDocument",e.hasPlanDocument?"true":"false"),e?.q&&t.set("q",e.q),e?.limit&&t.set("limit",String(e.limit)),e?.offset!==void 0&&t.set("offset",String(e.offset)),e?.sortField&&t.set("sortField",e.sortField),e?.sortDir&&t.set("sortDir",e.sortDir),e?.afterId&&t.set("afterId",e.afterId),t}a(Ct,"issueListSearchParams");var Z={listAll:a(async(e,t,r)=>{const o=new Map;let s;for(;;){const i=await Z.list(e,{...t,limit:500,sortField:"id",sortDir:"asc",afterId:s},r);for(const u of i)o.set(u.id,u);if(i.length<500)return[...o.values()];s=i[i.length-1].id}},"listAll"),list:a((e,t,r)=>{const n=Ct(t).toString(),o=`/companies/${e}/issues${n?`?${n}`:""}`;return r?d.get(o,r):d.get(o)},"list"),listCompact:a((e,t,r)=>{const n=Ct(t);n.set("view","compact");const o=`/companies/${e}/issues?${n.toString()}`;return r?d.get(o,r):d.get(o)},"listCompact"),count:a((e,t)=>{const r=new URLSearchParams;return r.set("attention",t.attention),t.status&&r.set("status",t.status),t.assigneeAgentId&&r.set("assigneeAgentId",t.assigneeAgentId),t.assigneeUserId&&r.set("assigneeUserId",t.assigneeUserId),t.projectId&&r.set("projectId",t.projectId),t.labelId&&r.set("labelId",t.labelId),t.q&&r.set("q",t.q),d.get(`/companies/${e}/issues/count?${r.toString()}`)},"count"),listLabels:a(e=>d.get(`/companies/${e}/labels`),"listLabels"),createLabel:a((e,t)=>d.post(`/companies/${e}/labels`,t),"createLabel"),deleteLabel:a(e=>d.delete(`/labels/${e}`),"deleteLabel"),get:a((e,t)=>t?d.get(`/issues/${e}`,t):d.get(`/issues/${e}`),"get"),getRunnerGoal:a((e,t)=>{const r=t?`?agentId=${encodeURIComponent(t)}`:"";return d.get(`/issues/${e}/runner-goal${r}`)},"getRunnerGoal"),actOnRunnerGoal:a((e,t)=>d.post(`/issues/${e}/runner-goal/actions`,t),"actOnRunnerGoal"),getWatchdog:a(e=>d.get(`/issues/${e}/watchdog`),"getWatchdog"),upsertWatchdog:a((e,t)=>d.put(`/issues/${e}/watchdog`,t),"upsertWatchdog"),deleteWatchdog:a(e=>d.delete(`/issues/${e}/watchdog`),"deleteWatchdog"),markRead:a(e=>d.post(`/issues/${e}/read`,{}),"markRead"),markUnread:a(e=>d.delete(`/issues/${e}/read`),"markUnread"),archiveFromInbox:a(e=>d.post(`/issues/${e}/inbox-archive`,{}),"archiveFromInbox"),unarchiveFromInbox:a(e=>d.delete(`/issues/${e}/inbox-archive`),"unarchiveFromInbox"),setTitle:a((e,t)=>d.put(`/issues/${e}/title`,t),"setTitle"),create:a((e,t)=>d.post(`/companies/${e}/issues`,t),"create"),update:a((e,t)=>{const r=d.patch(`/issues/${e}`,t);return typeof t.comment=="string"?Rt(r,n=>St(n?.comment)):r},"update"),decideStalledReview:a((e,t)=>d.post(`/issues/${e}/stalled-review-decision`,t),"decideStalledReview"),retryWorkspaceExport:a((e,t)=>d.post(`/issues/${e}/recovery-actions/retry-workspace-export`,t),"retryWorkspaceExport"),resolveRecoveryAction:a((e,t)=>d.post(`/issues/${e}/recovery-actions/resolve`,t),"resolveRecoveryAction"),previewTreeControl:a((e,t)=>d.post(`/issues/${e}/tree-control/preview`,t),"previewTreeControl"),createTreeHold:a((e,t)=>d.post(`/issues/${e}/tree-holds`,t),"createTreeHold"),getTreeHold:a((e,t)=>d.get(`/issues/${e}/tree-holds/${t}`),"getTreeHold"),listTreeHolds:a((e,t)=>{const r=new URLSearchParams;t?.status&&r.set("status",t.status),t?.mode&&r.set("mode",t.mode),t?.includeMembers&&r.set("includeMembers","true");const n=r.toString();return d.get(`/issues/${e}/tree-holds${n?`?${n}`:""}`)},"listTreeHolds"),getTreeControlState:a(e=>d.get(`/issues/${e}/tree-control/state`),"getTreeControlState"),releaseTreeHold:a((e,t,r)=>d.post(`/issues/${e}/tree-holds/${t}/release`,r),"releaseTreeHold"),checkMonitorNow:a(e=>d.post(`/issues/${e}/monitor/check-now`,{}),"checkMonitorNow"),retryScheduledRetryNow:a(e=>d.post(`/issues/${e}/scheduled-retry/retry-now`,{}),"retryScheduledRetryNow"),remove:a(e=>d.delete(`/issues/${e}`),"remove"),checkout:a((e,t)=>d.post(`/issues/${e}/checkout`,{agentId:t,expectedStatuses:["todo","backlog","blocked","in_review"]}),"checkout"),release:a(e=>d.post(`/issues/${e}/release`,{}),"release"),listComments:a((e,t)=>{const r=new URLSearchParams;t?.after&&r.set("after",t.after),t?.order&&r.set("order",t.order),t?.limit&&r.set("limit",String(t.limit));const n=r.toString();return d.get(`/issues/${e}/comments${n?`?${n}`:""}`)},"listComments"),getQueuedComments:a(e=>d.get(`/issues/${e}/queued-comments`),"getQueuedComments"),editQueuedComment:a((e,t,r)=>d.patch(`/issues/${e}/queued-comments/${t}`,r),"editQueuedComment"),reorderQueuedComments:a((e,t)=>d.put(`/issues/${e}/queued-comments/order`,t),"reorderQueuedComments"),interruptQueuedComments:a((e,t)=>d.post(`/issues/${e}/queued-comments/interrupt`,t),"interruptQueuedComments"),interruptLatestQueuedComments:a(async(e,t)=>{const r=await Z.getQueuedComments(e);if(!r.queueId||r.targetRunId&&r.targetRunId!==t)throw new Error("The queued messages changed. Refresh and try again.");return Z.interruptQueuedComments(e,{queueId:r.queueId,revision:r.revision,targetRunId:r.targetRunId})},"interruptLatestQueuedComments"),steerQueuedComment:a((e,t,r)=>d.post(`/issues/${e}/queued-comments/${t}/steer`,r),"steerQueuedComment"),discardQueuedComment:a((e,t,r)=>d.delete(`/issues/${e}/queued-comments/${t}`,r),"discardQueuedComment"),listInteractions:a(e=>d.get(`/issues/${e}/interactions`),"listInteractions"),listAcceptedPlanDecompositions:a(e=>d.get(`/issues/${e}/accepted-plan-decompositions`),"listAcceptedPlanDecompositions"),createInteraction:a((e,t)=>d.post(`/issues/${e}/interactions`,t),"createInteraction"),acceptInteraction:a((e,t,r)=>d.post(`/issues/${e}/interactions/${t}/accept`,r??{}),"acceptInteraction"),rejectInteraction:a((e,t,r)=>d.post(`/issues/${e}/interactions/${t}/reject`,r?{reason:r}:{}),"rejectInteraction"),cancelInteraction:a((e,t,r)=>d.post(`/issues/${e}/interactions/${t}/cancel`,r?{reason:r}:{}),"cancelInteraction"),skipInteraction:a((e,t,r)=>d.post(`/issues/${e}/interactions/${t}/skip`,r?{reason:r}:{}),"skipInteraction"),respondToInteraction:a((e,t,r)=>d.post(`/issues/${e}/interactions/${t}/respond`,r),"respondToInteraction"),submitInteractionVerdicts:a((e,t,r)=>d.post(`/issues/${e}/interactions/${t}/verdicts`,{verdicts:r}),"submitInteractionVerdicts"),getComment:a((e,t)=>d.get(`/issues/${e}/comments/${t}`),"getComment"),listFeedbackVotes:a(e=>d.get(`/issues/${e}/feedback-votes`),"listFeedbackVotes"),getCostSummary:a((e,t={})=>{const r=t.excludeRoot?"?excludeRoot=true":"";return d.get(`/issues/${e}/cost-summary${r}`)},"getCostSummary"),listFeedbackTraces:a((e,t)=>{const r=new URLSearchParams;for(const[o,s]of Object.entries(t??{}))s!==void 0&&r.set(o,String(s));const n=r.toString();return d.get(`/issues/${e}/feedback-traces${n?`?${n}`:""}`)},"listFeedbackTraces"),upsertFeedbackVote:a((e,t)=>d.post(`/issues/${e}/feedback-votes`,t),"upsertFeedbackVote"),addComment:a((e,t,r,n,o,s)=>Rt(d.post(`/issues/${e}/comments`,{body:t,...s?{clientRequestId:s}:{},...r===void 0?{}:{reopen:r},...n===void 0?{}:{interrupt:n},...o?.length?{attachmentIds:o}:{}}),St),"addComment"),cancelComment:a((e,t)=>d.delete(`/issues/${e}/comments/${t}?mode=cancel`),"cancelComment"),deleteComment:a((e,t)=>d.delete(`/issues/${e}/comments/${t}`),"deleteComment"),listDocuments:a((e,t)=>d.get(`/issues/${e}/documents${t?.includeSystem?"?includeSystem=true":""}`),"listDocuments"),getDocument:a((e,t)=>d.get(`/issues/${e}/documents/${encodeURIComponent(t)}`),"getDocument"),upsertDocument:a((e,t,r)=>d.put(`/issues/${e}/documents/${encodeURIComponent(t)}`,r),"upsertDocument"),lockDocument:a((e,t)=>d.post(`/issues/${e}/documents/${encodeURIComponent(t)}/lock`,{}),"lockDocument"),unlockDocument:a((e,t)=>d.post(`/issues/${e}/documents/${encodeURIComponent(t)}/unlock`,{}),"unlockDocument"),listDocumentRevisions:a((e,t)=>d.get(`/issues/${e}/documents/${encodeURIComponent(t)}/revisions`),"listDocumentRevisions"),restoreDocumentRevision:a((e,t,r)=>d.post(`/issues/${e}/documents/${encodeURIComponent(t)}/revisions/${r}/restore`,{}),"restoreDocumentRevision"),deleteDocument:a((e,t)=>d.delete(`/issues/${e}/documents/${encodeURIComponent(t)}`),"deleteDocument"),listAttachments:a(e=>d.get(`/issues/${e}/attachments`),"listAttachments"),uploadAttachment:a((e,t,r,n)=>{const o=new FormData;return o.append("file",r),n&&o.append("issueCommentId",n),d.postForm(`/companies/${e}/issues/${t}/attachments`,o)},"uploadAttachment"),deleteAttachment:a(e=>d.delete(`/attachments/${e}`),"deleteAttachment"),privacyConstraints:a(e=>d.get(`/issues/${e}/privacy-constraints`),"privacyConstraints"),listAccessGrants:a((e,t)=>t?d.get(`/issues/${e}/access-grants`,t):d.get(`/issues/${e}/access-grants`),"listAccessGrants"),createAccessGrant:a((e,t)=>d.post(`/issues/${e}/access-grants`,t),"createAccessGrant"),revokeAccessGrant:a((e,t)=>d.post(`/issues/${e}/access-grants/${t}/revoke`,{}),"revokeAccessGrant"),setVisibility:a((e,t)=>d.patch(`/issues/${e}`,{visibility:t}),"setVisibility"),listApprovals:a(e=>d.get(`/issues/${e}/approvals`),"listApprovals"),linkApproval:a((e,t)=>d.post(`/issues/${e}/approvals`,{approvalId:t}),"linkApproval"),unlinkApproval:a((e,t)=>d.delete(`/issues/${e}/approvals/${t}`),"unlinkApproval"),listWorkProducts:a((e,t)=>{const r=`/issues/${e}/work-products${t?.refreshPullRequests?"?refreshPullRequests=true":""}`;return t?.fresh&&Wn(r),d.get(r,{signal:t?.signal})},"listWorkProducts"),ensureWorkProductReviewDocument:a((e,t)=>d.post(`/issues/${e}/work-products/${t}/review-document`,{}),"ensureWorkProductReviewDocument"),createWorkProduct:a((e,t)=>d.post(`/issues/${e}/work-products`,t),"createWorkProduct"),updateWorkProduct:a((e,t)=>d.patch(`/work-products/${e}`,t),"updateWorkProduct"),deleteWorkProduct:a(e=>d.delete(`/work-products/${e}`),"deleteWorkProduct")};function ee(e){return new Date(e).getTime()}a(ee,"toTimestamp");function cs(){const e=globalThis.crypto?.randomUUID?.();return e?`optimistic-${e}`:`optimistic-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}a(cs,"createOptimisticCommentId");function tt(e){return[...e].sort((t,r)=>{const n=ee(t.createdAt)-ee(r.createdAt);return n!==0?n:t.id.localeCompare(r.id)})}a(tt,"sortIssueComments");function Et(e){return tt(e).reverse()}a(Et,"sortIssueCommentsDesc");function yl(e){const t=new Date,r=cs();return{id:r,clientId:r,companyId:e.companyId,issueId:e.issueId,authorType:"user",authorAgentId:null,authorUserId:e.authorUserId,body:e.body,presentation:null,metadata:null,clientStatus:e.clientStatus??"pending",queueTargetRunId:e.queueTargetRunId??null,createdAt:t,updatedAt:t}}a(yl,"createOptimisticIssueComment");function vl(e){return e.runId||e.interruptedRunId||e.comment.id&&(e.comment.id===e.activeRunWakeCommentId||e.comment.id===e.activeRunCommentId)||e.comment.authorAgentId&&e.activeRunAgentId&&e.comment.authorAgentId===e.activeRunAgentId?!1:e.comment.clientStatus==="queued"?!0:e.activeRunStartedAt?ee(e.comment.createdAt)>=ee(e.activeRunStartedAt):!1}a(vl,"isQueuedIssueComment");function bl(e,t){const r=t.queuedTargetRunId??null;return!r||!t.targetRunIsLive||t.runningRunId&&t.runningRunId!==r?e:{...e,clientStatus:"queued",queueState:"queued",queueTargetRunId:r}}a(bl,"applyLocalQueuedIssueCommentState");function kl(e,t){const r=e??[],n=[...r],o=new Set(n.map(i=>i.id)),s=new Set;for(const i of t){if(o.has(i.id))continue;const u=r.find(c=>!s.has(c.id)&&c.issueId===i.issueId&&c.authorType===i.authorType&&c.authorUserId===i.authorUserId&&c.body===i.body&&Math.abs(ee(c.createdAt)-ee(i.createdAt))<=6e4);if(u){s.add(u.id);const c={...u,clientId:i.clientId};n[n.findIndex(m=>m.id===u.id)]=c;continue}n.push(i)}return tt(n)}a(kl,"mergeIssueComments");function xl(e,t){const r=e.findIndex(n=>n.clientId===t);return r===-1?{comments:e,comment:null}:{comments:e.filter(n=>n.clientId!==t),comment:e[r]??null}}a(xl,"takeOptimisticIssueComment");function wl(e){return tt((e??[]).flatMap(t=>t))}a(wl,"flattenIssueCommentPages");function ds(e,t){if(!(!e||e.length<t))return e[e.length-1]?.id}a(ds,"getNextIssueCommentPageParam");function $t(e,t){if(!(!e||e.length<t))return e[e.length-1]?.id}a($t,"getNextPageCursor");async function Il(e){const t=(e.pages??[]).map(i=>[...i]),r=e.pageParams?[...e.pageParams].slice(0,t.length):t.map(()=>null);for(;r.length<t.length;)r.push(null);if(e.pageSize<=0)return{pages:t,pageParams:r};let n=$t(t[t.length-1],e.pageSize);const o=Math.max(0,e.maxPages??Number.POSITIVE_INFINITY),s=new Set;for(;n&&!s.has(n)&&s.size<o;){s.add(n);const i=[...await e.fetchPage(n)];t.push(i),r.push(n),n=$t(i,e.pageSize)}return{pages:t,pageParams:r}}a(Il,"loadRemainingIssueCommentPages");function Sl(e){return e.activeDetailTab!=="chat"||!e.hasOlderComments||e.initialPageLoading||e.olderPageLoading||e.loadedCommentCount===0?!1:e.loadedCommentCount<e.autoLoadLimit}a(Sl,"shouldAutoloadOlderIssueComments");function Rl(e,t){if(!e)return e;const r={...e};return t.reopen===!0&&(e.status==="done"||e.status==="cancelled"||e.status==="blocked")&&(r.status="todo"),t.reassignment&&(r.assigneeAgentId=t.reassignment.assigneeAgentId,r.assigneeUserId=t.reassignment.assigneeUserId),r}a(Rl,"applyOptimisticIssueCommentUpdate");function ms(e,t){if(!e)return e;const r={...e,updatedAt:new Date},n=a(s=>Object.prototype.hasOwnProperty.call(t,s),"hasOwn"),o=a(s=>{n(s)&&(r[s]=t[s])},"assign");if(o("status"),o("priority"),o("assigneeAgentId"),o("assigneeUserId"),o("projectId"),o("parentId"),o("projectWorkspaceId"),o("executionWorkspaceId"),o("executionWorkspacePreference"),o("executionWorkspaceSettings"),o("hiddenAt"),n("labelIds")&&Array.isArray(t.labelIds)){const s=t.labelIds.filter(i=>typeof i=="string");r.labelIds=s,e.labels&&(r.labels=e.labels.filter(i=>s.includes(i.id)))}if(n("blockedByIssueIds")&&Array.isArray(t.blockedByIssueIds)&&e.blockedBy){const s=new Set(t.blockedByIssueIds.filter(i=>typeof i=="string"));r.blockedBy=e.blockedBy.filter(i=>s.has(i.id))}return n("projectId")&&(r.project=e.project?.id===r.projectId?e.project:null),n("parentId")&&(r.ancestors=void 0),n("executionWorkspaceId")&&(r.currentExecutionWorkspace=e.currentExecutionWorkspace?.id===r.executionWorkspaceId?e.currentExecutionWorkspace:null),r}a(ms,"applyOptimisticIssueFieldUpdate");function fs(e,t){const r=t instanceof Set?t:new Set(t);return r.has(e.id)||!!e.identifier&&r.has(e.identifier)}a(fs,"matchesIssueRef$1");function Cl(e,t,r){if(!e)return e;let n=!1;const o=e.map(s=>fs(s,t)?(n=!0,ms(s,r)??s):s);return n?o:e}a(Cl,"applyOptimisticIssueFieldUpdateToCollection");function El(e,t){if(!e||e.length===0)return[[t]];const r=e.map(n=>[...n]);for(let n=0;n<r.length;n+=1){const o=r[n].findIndex(s=>s.id===t.id);if(o!==-1)return r[n][o]=t,r[n]=Et(r[n]),r}return r[0]=Et([...r[0],t]),r}a(El,"upsertIssueCommentInPages");function $l(e,t){return!e||e.length===0?[]:e.map(r=>r.filter(n=>n.id!==t)).filter(r=>r.length>0)}a($l,"removeIssueCommentFromPages");var ps=["issues","detail"],Cr=6e4,hs=3e4;function le(e){return typeof e=="string"&&e.length>0}a(le,"isNonEmptyString");function Er(e,t){const r=new Set;return le(e)&&r.add(e),le(t?.id)&&r.add(t.id),le(t?.identifier)&&r.add(t.identifier),Array.from(r)}a(Er,"collectIssueRefs");function gs(e,t){const r=t instanceof Set?t:new Set(t);return r.has(e.id)||!!e.identifier&&r.has(e.identifier)}a(gs,"matchesIssueRef");function Se(e){if(typeof e!="object"||e===null)return!1;const t=e;return le(t.id)&&le(t.companyId)&&typeof t.title=="string"&&typeof t.status=="string"&&typeof t.workMode=="string"&&typeof t.priority=="string"&&(t.projectId===null||typeof t.projectId=="string")&&(t.parentId===null||typeof t.parentId=="string")&&(t.identifier===null||typeof t.identifier=="string")&&(t.description===null||typeof t.description=="string")&&(t.assigneeAgentId===null||typeof t.assigneeAgentId=="string")&&(t.assigneeUserId===null||typeof t.assigneeUserId=="string")&&(t.executionRunId===null||typeof t.executionRunId=="string")&&(t.issueNumber===null||typeof t.issueNumber=="number")&&typeof t.requestDepth=="number"&&t.createdAt!=null&&t.updatedAt!=null}a(Se,"isCompleteIssueSnapshot");function _t(e,t){return e?{...e,...t}:t}a(_t,"mergeIssueSnapshots");function $r(e,t,r){const n=Er(t,r);for(const o of n){const s=e.getQueryData(de.issues.detail(o));if(Se(s))return s}return e.getQueriesData({queryKey:ps}).map(([,o])=>o).find(o=>Se(o)&&gs(o,n))}a($r,"getCachedIssueDetail");function _r(e,t,r){if(!Se(t))return t;const n=Er(r?.issueRef,t),o=_t($r(e,r?.issueRef,t),t);for(const s of n)e.setQueryData(de.issues.detail(s),i=>_t(i,o));return o}a(_r,"seedIssueDetailCache");async function Ar(e,t,r){return _r(e,r?await Z.get(t,r):await Z.get(t),{issueRef:t})}a(Ar,"fetchIssueDetail");function ys(e,t,r){return{queryKey:de.issues.detail(t),queryFn:a(({signal:n})=>Ar(e,t,{signal:n}),"queryFn"),placeholderData:$r(e,t,r?.placeholderIssue??void 0)}}a(ys,"getIssueDetailQueryOptions");function vs(e,t,r){return Se(r?.issue)&&_r(e,r.issue,{issueRef:t}),e.prefetchQuery({queryKey:de.issues.detail(t),queryFn:a(()=>Ar(e,t),"queryFn"),staleTime:Cr})}a(vs,"prefetchIssueDetail");function bs(e,t){return e.prefetchInfiniteQuery({queryKey:de.issues.comments(t),queryFn:a(({pageParam:r})=>Z.listComments(t,{order:"desc",limit:50,...r?{after:r}:{}}),"queryFn"),initialPageParam:null,getNextPageParam:a(r=>ds(r,50),"getNextPageParam"),staleTime:hs,pages:1})}a(bs,"prefetchIssueComments");function ks(e,t,r){return Promise.all([vs(e,t,r),bs(e,t)])}a(ks,"prefetchIssueDetailForNavigation");var S=jt(Fn(),1);function xs({...e}){return(0,S.jsx)(Qn,{"data-slot":"popover",...e})}a(xs,"Popover");function ws({...e}){return(0,S.jsx)(Xn,{"data-slot":"popover-trigger",...e})}a(ws,"PopoverTrigger");function Is({className:e,align:t="center",sideOffset:r=4,disablePortal:n=!1,...o}){const s=(0,S.jsx)(zn,{"data-slot":"popover-content",align:t,sideOffset:r,className:K("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...o});return n?s:(0,S.jsx)(qn,{children:s})}a(Is,"PopoverContent");function _l({...e}){return(0,S.jsx)(Gn,{"data-slot":"popover-anchor",...e})}a(_l,"PopoverAnchor");function Al({className:e,...t}){return(0,S.jsx)("div",{"data-slot":"popover-title",className:K("font-medium",e),...t})}a(Al,"PopoverTitle");function Dl({className:e,...t}){return(0,S.jsx)("p",{"data-slot":"popover-description",className:K("text-muted-foreground",e),...t})}a(Dl,"PopoverDescription");var Dr={name:"atom",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M20.2 20.2c2.04-2.03.02-7.36-4.5-11.9-4.54-4.52-9.87-6.54-11.9-4.5-2.04 2.03-.02 7.36 4.5 11.9 4.54 4.52 9.87 6.54 11.9 4.5Z",key:"1l2ple"}],["path",{d:"M15.7 15.7c4.52-4.54 6.54-9.87 4.5-11.9-2.03-2.04-7.36-.02-11.9 4.5-4.52 4.54-6.54 9.87-4.5 11.9 2.03 2.04 7.36.02 11.9-4.5Z",key:"1wam0m"}]]};Dr.node;var Ss=k(Dr),Pr={name:"ban",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]]};Pr.node;var Rs=k(Pr),Lr={name:"box",size:24,node:[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]};Lr.node;var Cs=k(Lr),Mr={name:"brain",size:24,node:[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]};Mr.node;var Es=k(Mr),Tr={name:"briefcase",size:24,node:[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]};Tr.node;var $s=k(Tr),Ur={name:"bug",size:24,node:[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]]};Ur.node;var _s=k(Ur),Or={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};Or.node;var As=k(Or),jr={name:"circle-dashed",size:24,node:[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]};jr.node;var Nr=k(jr),Br={name:"circle-dot",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};Br.node;var Ds=k(Br),zr={name:"circle-minus",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]],aliases:["minus-circle"]};zr.node;var At=k(zr),Fr={name:"circle",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]};Fr.node;var Dt=k(Fr),qr={name:"code",size:24,node:[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]};qr.node;var Ps=k(qr),Hr={name:"cog",size:24,node:[["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["circle",{cx:"12",cy:"12",r:"8",key:"46899m"}]]};Hr.node;var Ls=k(Hr),Wr={name:"compass",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]]};Wr.node;var Ms=k(Wr),Vr={name:"cpu",size:24,node:[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]};Vr.node;var Ts=k(Vr),Kr={name:"crown",size:24,node:[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]};Kr.node;var Us=k(Kr),Qr={name:"database",size:24,node:[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]};Qr.node;var Os=k(Qr),Jr={name:"file-code",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]};Jr.node;var js=k(Jr),Gr={name:"flame",size:24,node:[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]]};Gr.node;var Ns=k(Gr),Yr={name:"folder",size:24,node:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]};Yr.node;var Bs=k(Yr),Zr={name:"gem",size:24,node:[["path",{d:"M10.5 3 8 9l4 13 4-13-2.5-6",key:"b3dvk1"}],["path",{d:"M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z",key:"7w4byz"}],["path",{d:"M2 9h20",key:"16fsjt"}]]};Zr.node;var zs=k(Zr),Xr={name:"git-branch",size:24,node:[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]};Xr.node;var Fs=k(Xr),en={name:"globe",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]};en.node;var qs=k(en),tn={name:"hammer",size:24,node:[["path",{d:"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9",key:"1hayfq"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"15ts47"}]]};tn.node;var Hs=k(tn),rn={name:"heart",size:24,node:[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]};rn.node;var Ws=k(rn),nn={name:"hexagon",size:24,node:[["path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",key:"yt0hxn"}]]};nn.node;var Vs=k(nn),an={name:"layers",size:24,node:[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],aliases:["layers-3"]};an.node;var Ks=k(an),on={name:"lightbulb",size:24,node:[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]};on.node;var Qs=k(on),sn={name:"lock",size:24,node:[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]};sn.node;var Js=k(sn),ln={name:"mail",size:24,node:[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]};ln.node;var Gs=k(ln),un={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};un.node;var Ys=k(un),cn={name:"package",size:24,node:[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]};cn.node;var Zs=k(cn),dn={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};dn.node;var Pl=k(dn),mn={name:"puzzle",size:24,node:[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]};mn.node;var Xs=k(mn),fn={name:"radar",size:24,node:[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]]};fn.node;var ei=k(fn),pn={name:"rocket",size:24,node:[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]};pn.node;var ti=k(pn),hn={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};hn.node;var ri=k(hn),gn={name:"shield",size:24,node:[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]};gn.node;var ni=k(gn),yn={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};yn.node;var ai=k(yn),vn={name:"star",size:24,node:[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]};vn.node;var oi=k(vn),bn={name:"target",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]};bn.node;var si=k(bn),kn={name:"telescope",size:24,node:[["path",{d:"m10.065 12.493-6.18 1.318a.934.934 0 0 1-1.108-.702l-.537-2.15a1.07 1.07 0 0 1 .691-1.265l13.504-4.44",key:"k4qptu"}],["path",{d:"m13.56 11.747 4.332-.924",key:"19l80z"}],["path",{d:"m16 21-3.105-6.21",key:"7oh9d"}],["path",{d:"M16.485 5.94a2 2 0 0 1 1.455-2.425l1.09-.272a1 1 0 0 1 1.212.727l1.515 6.06a1 1 0 0 1-.727 1.213l-1.09.272a2 2 0 0 1-2.425-1.455z",key:"m7xp4m"}],["path",{d:"m6.158 8.633 1.114 4.456",key:"74o979"}],["path",{d:"m8 21 3.105-6.21",key:"1fvxut"}],["circle",{cx:"12",cy:"13",r:"2",key:"1c1ljs"}]]};kn.node;var ii=k(kn),xn={name:"terminal",size:24,node:[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]};xn.node;var li=k(xn),wn={name:"wrench",size:24,node:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]};wn.node;var ui=k(wn),In={name:"zap",size:24,node:[["path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z",key:"1v7up4"}]]};In.node;var ci=k(In),Ll={backlog:"text-muted-foreground border-muted-foreground",todo:"text-amber-600 border-amber-600 dark:text-amber-400 dark:border-amber-400",in_progress:"text-blue-600 border-blue-600 dark:text-blue-400 dark:border-blue-400",in_review:"text-violet-600 border-violet-600 dark:text-violet-400 dark:border-violet-400",done:"text-green-600 border-green-600 dark:text-green-400 dark:border-green-400",cancelled:"text-neutral-500 border-neutral-500",blocked:"text-red-600 border-red-600 dark:text-red-400 dark:border-red-400"},Ml="text-muted-foreground border-muted-foreground",Tl={backlog:"text-muted-foreground",todo:"text-amber-600 dark:text-amber-400",in_progress:"text-blue-600 dark:text-blue-400",in_review:"text-violet-600 dark:text-violet-400",done:"text-green-600 dark:text-green-400",cancelled:"text-neutral-500",blocked:"text-red-600 dark:text-red-400"},Ul="text-muted-foreground",ve={gray:"bg-[#F5F3F0] text-[#52585D] border-[#A8AEB2] dark:bg-[#6e696024] dark:text-[#9A958A] dark:border-[#9e958a73]",blue:"bg-[#DBEAFE] text-[#1D4ED8] border-[#2563EB] dark:bg-[#2563eb2e] dark:text-[#2563EB] dark:border-[#2563eb73]",amber:"bg-[#FEF3C7] text-[#B45309] border-[#F59E0B] dark:bg-[#f59e0b24] dark:text-[#F59E0B] dark:border-[#f59e0b73]",green:"bg-[#DCFCE7] text-[#188A3C] border-[#22C55E] dark:bg-[#22c55e1f] dark:text-[#22C55E] dark:border-[#22c55e73]",violet:"bg-[#EDE9FE] text-[#5B21B6] border-[#7C3AED] dark:bg-[#7c3aed2e] dark:text-[#7C3AED] dark:border-[#7c3aed73]",red:"bg-[#FEE2E2] text-[#991B1B] border-[#DC2626] dark:bg-[#dc26262e] dark:text-[#DC2626] dark:border-[#dc262673]"},Ol={active:`border ${ve.green}`,running:`border ${ve.blue}`,scheduled_retry:"bg-sky-100 text-sky-700 dark:bg-sky-900/50 dark:text-sky-300",paused:`border ${ve.amber}`,idle:`border ${ve.gray}`,archived:"bg-muted text-muted-foreground",planned:"bg-muted text-muted-foreground",achieved:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",completed:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",failed:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",timed_out:"bg-orange-100 text-orange-700 dark:bg-orange-900/50 dark:text-orange-300",succeeded:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",ok:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",warning:"bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",error:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",info:"bg-sky-100 text-sky-700 dark:bg-sky-900/50 dark:text-sky-300",terminated:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",pending:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-300",queued:"bg-yellow-100 text-yellow-700 dark:bg-yellow-900/50 dark:text-yellow-300",pending_approval:"bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",revision_requested:"bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",approved:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",rejected:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",draft:"bg-muted text-muted-foreground",backlog:"bg-muted text-muted-foreground",todo:"bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",in_progress:"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",in_review:"bg-violet-100 text-violet-700 dark:bg-violet-900/50 dark:text-violet-300",blocked:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",done:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",cancelled:"bg-muted text-muted-foreground",allowed:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",denied:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",block:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300","require-approval":"bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",redacted:"bg-violet-100 text-violet-700 dark:bg-violet-900/50 dark:text-violet-300","rate-limit":"bg-orange-100 text-orange-700 dark:bg-orange-900/50 dark:text-orange-300",deferred:"bg-sky-100 text-sky-700 dark:bg-sky-900/50 dark:text-sky-300",hidden:"bg-muted text-muted-foreground",quarantined:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300","runtime-error":"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",healthy:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",degraded:"bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",unchecked:"bg-muted text-muted-foreground"},jl="bg-muted text-muted-foreground",Nl="text-[#1D4ED8] dark:text-[#2563EB]",Bl="bg-blue-500/10 border-blue-500/30 text-blue-600 dark:text-blue-400",zl={info:"border-[#2563EB]/40 bg-[#DBEAFE]/50 text-[#1D4ED8] dark:border-[#2563eb59] dark:bg-[#2563eb14] dark:text-[#93C5FD]",warning:"border-[#F59E0B]/50 bg-[#FEF3C7]/60 text-[#B45309] dark:border-[#f59e0b59] dark:bg-[#f59e0b12] dark:text-[#F59E0B]",danger:"border-destructive/40 bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300"},Fl={idle:"--status-agent-idle",active:"--status-agent-idle",running:"--status-agent-running",paused:"--status-agent-paused",error:"--status-agent-error"},ql="--status-agent-idle",Hl={idle:"--status-task-backlog",backlog:"--status-task-backlog",todo:"--status-task-todo",in_progress:"--status-task-in_progress",in_review:"--status-task-in_review",done:"--status-task-done",blocked:"--status-task-blocked",cancelled:"--status-task-cancelled"},Wl="--status-task-backlog",di={idle:"--status-task-icon-backlog",backlog:"--status-task-icon-backlog",todo:"--status-task-icon-todo",in_progress:"--status-task-icon-in_progress",in_review:"--status-task-icon-in_review",done:"--status-task-icon-done",blocked:"--status-task-icon-blocked",cancelled:"--status-task-icon-cancelled",in_queue:"--status-task-icon-in_queue"};var Vl={running:"bg-blue-400 animate-pulse",active:"bg-green-400",paused:"bg-yellow-400",idle:"bg-yellow-400",pending_approval:"bg-amber-400",error:"bg-red-400",archived:"bg-neutral-400"},Kl="bg-neutral-400",Ql={critical:"text-red-600 dark:text-red-400",high:"text-orange-600 dark:text-orange-400",medium:"text-yellow-600 dark:text-yellow-400",low:"text-blue-600 dark:text-blue-400"},Jl="text-yellow-600 dark:text-yellow-400",Gl={unknown:"text-muted-foreground border-muted-foreground",open:"text-blue-600 border-blue-600 dark:text-blue-400 dark:border-blue-400",waiting:"text-amber-600 border-amber-600 dark:text-amber-400 dark:border-amber-400",running:"text-blue-600 border-blue-600 dark:text-blue-400 dark:border-blue-400",succeeded:"text-green-600 border-green-600 dark:text-green-400 dark:border-green-400",merged:"text-violet-600 border-violet-600 dark:text-violet-400 dark:border-violet-400",failed:"text-red-600 border-red-600 dark:text-red-400 dark:border-red-400",blocked:"text-red-600 border-red-600 dark:text-red-400 dark:border-red-400",closed:"text-neutral-500 border-neutral-500",archived:"text-neutral-500 border-neutral-500",auth_required:"text-amber-600 border-amber-600 dark:text-amber-400 dark:border-amber-400",unreachable:"text-red-600 border-red-600 dark:text-red-400 dark:border-red-400"},Yl="text-muted-foreground border-muted-foreground",Zl={unknown:"bg-muted text-muted-foreground",open:"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",waiting:"bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",running:"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",succeeded:"bg-green-100 text-green-700 dark:bg-green-900/50 dark:text-green-300",failed:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",blocked:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300",closed:"bg-muted text-muted-foreground",archived:"bg-muted text-muted-foreground",auth_required:"bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300",unreachable:"bg-red-100 text-red-700 dark:bg-red-900/50 dark:text-red-300"},Xl="bg-muted text-muted-foreground",eu={unknown:"",fresh:"",stale:"opacity-70 [border-style:dashed]",auth_required:"[border-style:dashed]",unreachable:"[border-style:dashed]"},mi={sm:14,md:16,lg:20},fi=k("TaskProgressSpinner",[["circle",{cx:"12",cy:"12",r:"10",pathLength:"100",strokeDasharray:"80 20",key:"progress"}]]),pi={idle:Dt,backlog:Nr,todo:Dt,in_progress:fi,in_review:Ds,done:As,blocked:At,cancelled:Rs,in_queue:At},hi=Nr;function gi({status:e,size:t="md",className:r,title:n}){const o=mi[t],s=pi[e]??hi,i=di[e]??"--status-task-icon-backlog",u=n?{role:"img","aria-label":n}:{"aria-hidden":!0};return(0,S.jsx)(s,{size:o,className:K("inline-block shrink-0 align-middle",e==="in_progress"&&"motion-safe:animate-spin",r),style:{color:`var(${i})`},...u,children:n?(0,S.jsx)("title",{children:n}):null})}a(gi,"StatusGlyph");var Pt={folder:Bs,rocket:ti,code:Ps,terminal:li,database:Os,globe:qs,package:Zs,boxes:Zn,box:Cs,layers:Ks,briefcase:$s,compass:Ms,target:si,flame:Ns,zap:ci,star:oi,bug:_s,wrench:ui,hammer:Hs,lightbulb:Qs,sparkles:ai,shield:ni,lock:Js,search:ri,cog:Ls,brain:Es,cpu:Ts,"git-branch":Fs,"file-code":js,puzzle:Xs,gem:zs,atom:Ss,heart:Ws,mail:Gs,"message-square":Ys,crown:Us,radar:ei,telescope:ii,hexagon:Vs},yi="folder";function vi(e){return e&&Kn.includes(e)?Pt[e]:Pt[yi]}a(vi,"getProjectIcon");var bi={xs:{box:"h-4 w-4 rounded-sm",icon:"h-2.5 w-2.5"},sm:{box:"h-6 w-6 rounded-md",icon:"h-3.5 w-3.5"},md:{box:"h-7 w-7 rounded-lg",icon:"h-4 w-4"},lg:{box:"h-9 w-9 rounded-lg",icon:"h-5 w-5"}};function ki({color:e,icon:t,size:r="md",className:n}){const o=bi[r],s=!!e,i=vi(t);return(0,S.jsx)("span",{"aria-hidden":!0,className:K("inline-flex shrink-0 items-center justify-center",o.box,s?"text-white":"bg-muted text-muted-foreground",n),style:s?{backgroundColor:e??void 0}:void 0,children:(0,S.jsx)(i,{className:o.icon})})}a(ki,"ProjectTile");var ue=null,He=new Set;function Sn(){for(const e of He)e()}a(Sn,"emitQuicklookChange");function Lt(e){ue!==e&&(ue=e,Sn())}a(Lt,"openQuicklookId");function Mt(e){ue===e&&(ue=null,Sn())}a(Mt,"closeQuicklookId");function xi(e){return He.add(e),()=>{He.delete(e)}}a(xi,"subscribeQuicklook");function wi(e){return l.useSyncExternalStore(xi,()=>ue===e,()=>!1)}a(wi,"useIsQuicklookOpen");var Ii=120,Si=13,Ri="w-72 p-3";function Ci(e="start"){return e==="start"?-13:e==="end"?Si:0}a(Ci,"quicklookAlignOffset");function Ei(e){if(!e)return null;const t=e.replace(/!\[[^\]]*]\([^)]+\)/g," ").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/[#>*_`~-]+/g," ").replace(/\s+/g," ").trim();return t?t.length>180?`${t.slice(0,177).trimEnd()}...`:t:null}a(Ei,"summarizeIssueDescription");function $i({className:e}){return(0,S.jsx)("span",{className:K("text-xs",e),"aria-hidden":!0,children:"·"})}a($i,"QuicklookSeparator");function _i(e){const t=e.replace(/_/g," ");return t.charAt(0).toUpperCase()+t.slice(1)}a(_i,"statusLabel");function Ai({issue:e,linkTo:t,linkState:r,compact:n=!1}){const o=(0,l.useMemo)(()=>Ei(e.description),[e.description]),s=e.project?.name;return(0,S.jsxs)("div",{className:K("space-y-2",n&&"space-y-1.5"),children:[(0,S.jsxs)("div",{className:"flex items-center gap-1",children:[(0,S.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-1",children:[(0,S.jsx)(gi,{status:e.status,size:"md",title:_i(e.status)}),(0,S.jsx)("span",{className:"shrink-0 font-mono text-(length:--text-micro) text-muted-foreground",children:e.identifier??e.id.slice(0,8)}),s?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)($i,{className:"shrink-0 text-muted-foreground"}),(0,S.jsxs)("span",{className:"flex min-w-0 max-w-(--sz-12rem) flex-1 items-center gap-1 text-(length:--text-micro) text-muted-foreground",title:s,"data-testid":"quicklook-project",children:[(0,S.jsx)(ki,{size:"xs"}),(0,S.jsx)("span",{className:"truncate",children:s})]})]}):null]}),(0,S.jsx)("span",{className:"shrink-0 text-(length:--text-micro) text-muted-foreground",children:Yo(new Date(e.updatedAt))})]}),(0,S.jsx)(pe,{to:t,state:r??Ir(null,e),className:"block text-sm font-medium leading-snug hover:underline line-clamp-2",children:e.title}),o?(0,S.jsx)("p",{className:"text-xs leading-5 text-muted-foreground [display:-webkit-box] [-webkit-box-orient:vertical] [-webkit-line-clamp:4] overflow-hidden",children:o}):null]})}a(Ai,"IssueQuicklookCard");var Di=l.forwardRef(a(function({issuePathId:t,to:r,children:n,className:o,state:s,disableIssueQuicklook:i=!1,issuePrefetch:u=null,issueQuicklookSide:c="top",issueQuicklookAlign:m="start",onClick:p,onClickCapture:f,onMouseEnter:g,onFocus:b,onBlur:v,onTouchStart:y,...h},x){const w=Vn(),I=l.useMemo(()=>Symbol("issue-quicklook"),[]),_=wi(I),C=l.useRef(null),A=l.useRef(null),L=l.useRef(null),j=l.useCallback(E=>{A.current=E,typeof x=="function"?x(E):x&&(x.current=E)},[x]),D=l.useCallback(()=>{C.current&&(clearTimeout(C.current),C.current=null)},[]),B=l.useCallback(()=>{D(),Lt(I)},[D,I]),G=l.useCallback(()=>{D(),C.current=setTimeout(()=>{C.current=null,Lt(I)},Ii)},[D,I]),U=l.useCallback(()=>{D(),Mt(I)},[D,I]);l.useEffect(()=>()=>{D(),Mt(I)},[D,I]),l.useEffect(()=>{if(!_)return;const E=12,at=a((V,se,Y)=>{if(!V)return!1;const W=V.getBoundingClientRect();return se>=W.left-E&&se<=W.right+E&&Y>=W.top-E&&Y<=W.bottom+E},"nearBox"),Un=a((V,se)=>{const Y=A.current,W=L.current;if(Y?.matches(":hover")||W?.matches(":hover")||at(Y,V,se)||at(W,V,se))return!0;const Pe=document.activeElement;return Y===Pe||!!W&&!!Pe&&W.contains(Pe)},"stillEngaged"),ot=a(V=>{Un(V.clientX,V.clientY)||U()},"onPointerMove");return document.addEventListener("pointermove",ot,{passive:!0}),()=>document.removeEventListener("pointermove",ot)},[_,U]);const H=u?Ir(s,u):s,{data:z,isLoading:F}=Nn({...ys(w,t,{placeholderIssue:u??void 0}),enabled:_,staleTime:Cr}),Tn=ls(t),oe=l.useCallback(()=>{ks(w,t,{issue:u})},[t,u,w]),nt=(0,S.jsx)(pe,{ref:j,to:r,state:H,className:o,onMouseEnter:a(E=>{oe(),g?.(E)},"onMouseEnter"),onFocus:a(E=>{oe(),B(),b?.(E)},"onFocus"),onBlur:a(E=>{setTimeout(()=>U(),0),v?.(E)},"onBlur"),onTouchStart:a(E=>{oe(),y?.(E)},"onTouchStart"),onClickCapture:a(E=>{oe(),f?.(E)},"onClickCapture"),onClick:a(E=>{U(),p?.(E)},"onClick"),...h,children:n});return i?nt:(0,S.jsxs)(xs,{open:_,onOpenChange:a(E=>E?B():U(),"onOpenChange"),children:[(0,S.jsx)(ws,{asChild:!0,onMouseEnter:a(()=>{oe(),G()},"onMouseEnter"),onMouseLeave:U,children:nt}),(0,S.jsx)(Is,{ref:L,"data-quicklook":!0,className:Ri,side:c,align:m,alignOffset:Ci(m),onMouseEnter:B,onMouseLeave:U,onOpenAutoFocus:a(E=>E.preventDefault(),"onOpenAutoFocus"),onCloseAutoFocus:a(E=>E.preventDefault(),"onCloseAutoFocus"),children:z?(0,S.jsx)(Ai,{issue:z,linkTo:Tn,linkState:H,compact:!0}):(0,S.jsxs)("div",{className:"space-y-2",children:[(0,S.jsx)("div",{className:"h-4 w-24 rounded bg-accent/50"}),(0,S.jsx)("div",{className:"h-4 w-full rounded bg-accent/40"}),(0,S.jsx)("div",{className:"h-4 w-3/4 rounded bg-accent/30"}),F?null:(0,S.jsx)("p",{className:"text-xs text-muted-foreground",children:"Unable to load task preview."})]})})]})},"IssueLinkQuicklookImpl")),Rn=new Set(["dashboard","companies","company","skills","teams-catalog","org","agents","chats","apps","projects","workspaces","execution-workspaces","issues","tasks","routines","goals","artifacts","tools","approvals","costs","usage","activity","audit","decisions","inbox","board-chat","artifacts","u","design-guide","search","settings","timeline"]),rt=new Set(["auth","invite","board-claim","cli-auth","mcp-connect","dot-connect","assistant-connections","docs","instance"]);function ce(e){return e.trim().toUpperCase()}a(ce,"normalizeCompanyPrefix");function Cn(e){const t=e.match(/^([^?#]*)(\?[^#]*)?(#.*)?$/);return{pathname:t?.[1]??e,search:t?.[2]??"",hash:t?.[3]??""}}a(Cn,"splitPath");function Pi(e){return e.split("/").filter(Boolean)[0]??null}a(Pi,"getRootSegment");function Li(e){if(e==="/")return!0;const t=Pi(e);return t?rt.has(t.toLowerCase()):!0}a(Li,"isGlobalPath");function En(e){const t=e.split("/").filter(Boolean);if(t.length===0)return null;const r=t[0].toLowerCase();return rt.has(r)||Rn.has(r)?null:ce(t[0])}a(En,"extractCompanyPrefixFromPath");function Tt(e,t){const{pathname:r,search:n,hash:o}=Cn(e);if(!r.startsWith("/")||Li(r)||!t)return e;const s=ce(t);return En(r)?e:`/${s}${r}${n}${o}`}a(Tt,"applyCompanyPrefix");function Mi(e,...t){const r=["cases",...t].filter(Boolean).join("/");return e?`/${ce(e)}/${r}`:`/${r}`}a(Mi,"caseHref");function tu(e){const{pathname:t,search:r,hash:n}=Cn(e),o=t.split("/").filter(Boolean);if(o.length>=2){const s=o[1].toLowerCase();if(!rt.has(o[0].toLowerCase())&&Rn.has(s))return`/${o.slice(1).join("/")}${r}${n}`}return`${t}${r}${n}`}a(tu,"toCompanyRelativePath");var $n=/^[A-Z][A-Z0-9]*-\d+$/i,Ti=/^issue:\/\/:?([^?#\s]+)([?#].*)?$/i,Ui=/issue:\/\/:?[^\s<>()]+|https?:\/\/[^\s<>()]+|\/(?:[^\s<>()/]+\/)*issues\/[A-Z][A-Z0-9]*-\d+(?=$|[\s<>)\],.;!?:])|\b[A-Z][A-Z0-9]*-\d+\b/gi;function _n(e){if(!e)return null;const t=e.trim();if(!t||/^https?:\/\//i.test(t))return null;const r=t.split(/[?#]/,1)[0].split("/").filter(Boolean),n=r.findIndex(s=>s==="issues");if(n===-1||n===r.length-1)return null;const o=decodeURIComponent(r[n+1]??"");return!o||o.startsWith(":")?null:$n.test(o)?o.toUpperCase():o}a(_n,"parseIssuePathIdFromPath");function An(e,t){if(!e)return null;const r=e.trim(),n=r.match(Ti);if(n?.[1]){const i=decodeURIComponent(n[1]);return{issuePathId:i,href:`/issues/${encodeURIComponent(i)}${n[2]??""}`}}const o=_n(e);if(o)return{issuePathId:o,href:`/issues/${encodeURIComponent(o)}${r.match(/[?#].*$/)?.[0]??""}`};if(!$n.test(r))return null;const s=r.toUpperCase();if(t&&t.size>0){const i=s.split("-")[0];if(!i||!t.has(i))return null}return{issuePathId:s,href:`/issues/${encodeURIComponent(s)}`}}a(An,"parseIssueReferenceFromHref");function Oi(e){let t=e,r="";for(;t.length>0;){const n=t.at(-1);if(!n||!/[),.;!?:\]]/.test(n))break;if(n===")"){const o=(t.match(/\(/g)??[]).length;if((t.match(/\)/g)??[]).length<=o)break}if(n==="]"){const o=(t.match(/\[/g)??[]).length;if((t.match(/\]/g)??[]).length<=o)break}r=`${n}${r}`,t=t.slice(0,-1)}return{core:t,trailing:r}}a(Oi,"splitTrailingPunctuation");function Dn(e,t,r="text"){return{type:"link",url:t,children:[{type:r,value:e}]}}a(Dn,"createIssueLinkNode");function ji(e,t){const r=[];let n=0,o=!1;for(const s of e.matchAll(Ui)){const i=s[0];if(!i)continue;const u=s.index??0,c=u+i.length,{core:m,trailing:p}=Oi(i),f=An(m,t);f&&(o=!0,u>n&&r.push({type:"text",value:e.slice(n,u)}),r.push(Dn(m,f.href)),p&&r.push({type:"text",value:p}),n=c)}return o?(n<e.length&&r.push({type:"text",value:e.slice(n)}),r):null}a(ji,"linkifyIssueReferencesInText");function Pn(e,t){if(!Array.isArray(e.children)||e.children.length===0||e.type==="link"||e.type==="linkReference"||e.type==="code"||e.type==="definition"||e.type==="html")return;const r=[];for(const n of e.children){if(n.type==="inlineCode"&&typeof n.value=="string"){const o=An(n.value,t);if(o){r.push(Dn(n.value,o.href,"inlineCode"));continue}}if(n.type==="text"&&typeof n.value=="string"){const o=ji(n.value,t);if(o){r.push(...o);continue}}Pn(n,t),r.push(n)}e.children=r}a(Pn,"rewriteMarkdownTree");function ru(e){const t=e?.knownPrefixes&&e.knownPrefixes.length>0?new Set(e.knownPrefixes.map(r=>r.toUpperCase())):void 0;return r=>{Pn(r,t)}}a(ru,"remarkLinkIssueReferences");function De(e,t){if(typeof e=="string")return Tt(e,t);if(e.pathname&&e.pathname.startsWith("/")){const r=Tt(e.pathname,t);if(r!==e.pathname)return{...e,pathname:r}}return e}a(De,"resolveTo");function he(){const{selectedCompany:e}=Jn(),t=Ha(),r=T();if(t.companyPrefix)return ce(t.companyPrefix);const n=En(r.pathname);return n||(e?ce(e.issuePrefix):null)}a(he,"useActiveCompanyPrefix");function nu(){const e=he();return l.useCallback((...t)=>Mi(e,...t),[e])}a(nu,"useCaseHref");var au=l.forwardRef(a(function({to:t,disableIssueQuicklook:r=!1,issuePrefetch:n=null,issueQuicklookSide:o,issueQuicklookAlign:s,...i},u){const c=De(t,he()),m=_n(typeof c=="string"?c:c.pathname);return m?(0,S.jsx)(Di,{ref:u,to:c,issuePathId:m,disableIssueQuicklook:r,issuePrefetch:n,issueQuicklookSide:o,issueQuicklookAlign:s,...i}):(0,S.jsx)(pe,{ref:u,to:c,...i})},"CompanyLink")),ou=l.forwardRef(a(function({to:t,...r},n){const o=he();return(0,S.jsx)(mr,{ref:n,to:De(t,o),...r})},"CompanyNavLink"));function su({to:e,...t}){const r=he();return(0,S.jsx)(oo,{to:De(e,r),...t})}a(su,"Navigate");function iu(){const e=Ce(),t=he();return l.useCallback(((r,n)=>{if(typeof r=="number"){e(r);return}e(De(r,t),n)}),[e,t])}a(iu,"useNavigate");var Ut=a(e=>typeof e=="boolean"?`${e}`:e===0?"0":e,"falsyToString"),Ot=Hn,Ni=a((e,t)=>r=>{var n;if(t?.variants==null)return Ot(e,r?.class,r?.className);const{variants:o,defaultVariants:s}=t,i=Object.keys(o).map(m=>{const p=r?.[m],f=s?.[m];if(p===null)return null;const g=Ut(p)||Ut(f);return o[m][g]}),u=r&&Object.entries(r).reduce((m,p)=>{let[f,g]=p;return g===void 0||(m[f]=g),m},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((m,p)=>{let{class:f,className:g,...b}=p;return Object.entries(b).every(v=>{let[y,h]=v;return Array.isArray(h)?h.includes({...s,...u}[y]):{...s,...u}[y]===h})?[...m,f,g]:m},[]);return Ot(e,i,c,r?.class,r?.className)},"cva"),Bi=Ni("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-(--tp-color-background-color-border-color-box-shadow-opacity) disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-(length:--rad-3) aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",cta:"bg-foreground text-background hover:bg-foreground/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-9 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-10","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-9","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}}),zi=l.forwardRef(a(function({className:t,variant:r="default",size:n="default",asChild:o=!1,...s},i){const u=o?Bn:"button";return(0,S.jsx)(u,{ref:i,"data-slot":"button","data-variant":r,"data-size":n,className:K(Bi({variant:r,size:n,className:t})),...s})},"Button"));zi.displayName="Button";function Ln(e,t){return t?`${e}${e.includes("?")?"&":"?"}companyId=${encodeURIComponent(t)}`:e}a(Ln,"withCompanyScope");function R(e,t,r=""){return Ln(`/agents/${encodeURIComponent(e)}${r}`,t)}a(R,"agentPath");var lu={setAvatar:a((e,t,r)=>d.put(`/companies/${e}/agents/${t}/avatar`,{imageBase64:r}),"setAvatar"),getIdentity:a((e,t)=>d.get(R(e,t,"/identity")),"getIdentity"),adoptAiConnection:a((e,t,r,n)=>d.post(Ln(`/agents/${e}/connection-intents/${t}/adopt`,n),{connectionId:r}),"adoptAiConnection"),list:a(e=>d.get(`/companies/${e}/agents`),"list"),org:a(e=>d.get(`/companies/${e}/org`),"org"),listConfigurations:a(e=>d.get(`/companies/${e}/agent-configurations`),"listConfigurations"),get:a(async(e,t)=>{try{return await d.get(R(e,t))}catch(r){if(!(r instanceof Nt)||r.status!==409||!t||jn(e))throw r;const n=st(e);if(!n)throw r;const o=(await d.get(`/companies/${t}/agents`)).filter(s=>s.status!=="terminated"&&st(s.urlKey)===n);if(o.length!==1)throw r;return d.get(R(o[0].id,t))}},"get"),getConfiguration:a((e,t)=>d.get(R(e,t,"/configuration")),"getConfiguration"),listConfigRevisions:a((e,t)=>d.get(R(e,t,"/config-revisions")),"listConfigRevisions"),getConfigRevision:a((e,t,r)=>d.get(R(e,r,`/config-revisions/${t}`)),"getConfigRevision"),rollbackConfigRevision:a((e,t,r)=>d.post(R(e,r,`/config-revisions/${t}/rollback`),{}),"rollbackConfigRevision"),create:a((e,t)=>d.post(`/companies/${e}/agents`,t),"create"),hire:a((e,t)=>d.post(`/companies/${e}/agent-hires`,t),"hire"),update:a((e,t,r)=>d.patch(R(e,r),t),"update"),updatePermissions:a((e,t,r)=>d.patch(R(e,r,"/permissions"),t),"updatePermissions"),instructionsBundle:a((e,t)=>d.get(R(e,t,"/instructions-bundle")),"instructionsBundle"),updateInstructionsBundle:a((e,t,r)=>d.patch(R(e,r,"/instructions-bundle"),t),"updateInstructionsBundle"),instructionsFile:a((e,t,r)=>d.get(R(e,r,`/instructions-bundle/file?path=${encodeURIComponent(t)}`)),"instructionsFile"),saveInstructionsFile:a((e,t,r)=>d.put(R(e,r,"/instructions-bundle/file"),t),"saveInstructionsFile"),instructionCandidates:a((e,t)=>d.get(R(e,t,"/instructions-bundle/candidates")),"instructionCandidates"),resolveInstructionCandidate:a((e,t,r,n)=>d.post(R(e,n,`/instructions-bundle/candidates/${t}/resolve`),r),"resolveInstructionCandidate"),instructionHistory:a((e,t,r,n)=>d.get(R(e,r,`/instructions-bundle/history?path=${encodeURIComponent(t)}${n?`&cursor=${encodeURIComponent(n)}`:""}`)),"instructionHistory"),instructionRevision:a((e,t,r,n)=>d.get(R(e,n,`/instructions-bundle/revision/${r}?path=${encodeURIComponent(t)}`)),"instructionRevision"),instructionDiff:a((e,t,r,n,o)=>d.get(R(e,o,`/instructions-bundle/diff?path=${encodeURIComponent(t)}&from=${encodeURIComponent(r)}&to=${encodeURIComponent(n)}`)),"instructionDiff"),restoreInstructions:a((e,t,r)=>d.post(R(e,r,"/instructions-bundle/restore"),t),"restoreInstructions"),downloadInstructionsFile:a((e,t,r)=>`/api${R(e,r,`/instructions-bundle/file?path=${encodeURIComponent(t)}&download=true`)}`,"downloadInstructionsFile"),deleteInstructionsFile:a((e,t,r,n)=>d.delete(R(e,r,`/instructions-bundle/file?path=${encodeURIComponent(t)}${n?`&baseHash=${n}`:""}`)),"deleteInstructionsFile"),retryLifecycle:a((e,t)=>d.post(R(e,t,"/lifecycle/retry"),{}),"retryLifecycle"),pause:a((e,t)=>d.post(R(e,t,"/pause"),{}),"pause"),resume:a((e,t)=>d.post(R(e,t,"/resume"),{}),"resume"),clearError:a((e,t)=>d.post(R(e,t,"/clear-error"),{}),"clearError"),approve:a((e,t)=>d.post(R(e,t,"/approve"),{}),"approve"),terminate:a((e,t)=>d.post(R(e,t,"/terminate"),{}),"terminate"),remove:a((e,t)=>d.delete(R(e,t)),"remove"),listKeys:a((e,t)=>d.get(R(e,t,"/keys")),"listKeys"),skills:a((e,t)=>d.get(R(e,t,"/skills")),"skills"),syncSkills:a((e,t,r,n)=>d.post(R(e,n,"/skills/sync"),{desiredSkills:t,mode:r}),"syncSkills"),createKey:a((e,t,r,n)=>d.post(R(e,r,"/keys"),{name:t,...n?{scope:n}:{}}),"createKey"),revokeKey:a((e,t,r)=>d.delete(R(e,r,`/keys/${encodeURIComponent(t)}`)),"revokeKey"),runtimeState:a((e,t)=>d.get(R(e,t,"/runtime-state")),"runtimeState"),taskSessions:a((e,t)=>d.get(R(e,t,"/task-sessions")),"taskSessions"),resetSession:a((e,t,r)=>d.post(R(e,r,"/runtime-state/reset-session"),{taskKey:t??null}),"resetSession"),adapterModels:a((e,t,r)=>{const n=new URLSearchParams;r?.refresh&&n.set("refresh","1"),r?.provider&&n.set("provider",r.provider),r?.poolId&&n.set("poolId",r.poolId),r?.environmentId&&n.set("environmentId",r.environmentId);const o=n.size>0?`?${n.toString()}`:"";return d.get(`/companies/${encodeURIComponent(e)}/adapters/${encodeURIComponent(t)}/models${o}`)},"adapterModels"),detectModel:a((e,t)=>d.get(`/companies/${encodeURIComponent(e)}/adapters/${encodeURIComponent(t)}/detect-model`),"detectModel"),testEnvironment:a((e,t,r)=>d.post(`/companies/${e}/adapters/${t}/test-environment`,r),"testEnvironment"),getAdapterAuthSignal:a((e,t,r)=>{const n=r?`?environmentId=${encodeURIComponent(r)}`:"";return d.get(`/companies/${encodeURIComponent(e)}/adapters/${encodeURIComponent(t)}/auth-signal${n}`)},"getAdapterAuthSignal"),invoke:a((e,t,r={})=>d.post(R(e,t,"/heartbeat/invoke"),r),"invoke"),wakeup:a((e,t,r)=>d.post(R(e,r,"/wakeup"),t),"wakeup"),retryFailedRun:a(async(e,t,r)=>{const n=await d.post(R(e,r,"/wakeup"),{source:"on_demand",triggerDetail:"manual",reason:"retry_failed_run",failedRunId:t});if("id"in n){if(["failed","timed_out","cancelled","interrupted"].includes(n.status))throw new Error("The previous retry has already stopped. Refresh the task and retry its latest failed run.");return{runId:n.id,issueId:null}}if("actionId"in n){if(n.status==="failed"||n.status==="cancelled")throw new Error("This retry could not start. Open the task to review its current access and recovery state.");return{runId:n.runId,issueId:n.issueId}}throw new Error(n.message??"Retry was skipped.")},"retryFailedRun"),loginWithClaude:a((e,t)=>d.post(R(e,t,"/claude-login"),{}),"loginWithClaude"),startAdapterAuthLogin:a((e,t,r)=>d.post(`/companies/${encodeURIComponent(e)}/adapters/${encodeURIComponent(t)}/login-sessions`,r),"startAdapterAuthLogin"),getAdapterAuthLoginStatus:a((e,t,r)=>d.get(`/companies/${encodeURIComponent(e)}/adapters/${encodeURIComponent(t)}/login-sessions/${encodeURIComponent(r)}`,{cache:"no-store"}),"getAdapterAuthLoginStatus"),getActiveAdapterAuthLoginSession:a((e,t)=>d.get(`/companies/${encodeURIComponent(e)}/adapters/${encodeURIComponent(t)}/login-sessions/active`,{cache:"no-store"}),"getActiveAdapterAuthLoginSession"),cancelAdapterAuthLogin:a((e,t,r)=>d.post(`/companies/${encodeURIComponent(e)}/adapters/${encodeURIComponent(t)}/login-sessions/${encodeURIComponent(r)}/cancel`,{}),"cancelAdapterAuthLogin"),getClaudeOAuthTokenStatus:a(e=>d.get(`/companies/${encodeURIComponent(e)}/claude-oauth-token-status`),"getClaudeOAuthTokenStatus"),startClaudeSetupTokenLogin:a((e,t)=>d.post(`/companies/${encodeURIComponent(e)}/setup-token-login-sessions`,{adapterType:"claude_local",...t}),"startClaudeSetupTokenLogin"),getClaudeSetupTokenLoginStatus:a((e,t)=>d.get(`/companies/${encodeURIComponent(e)}/setup-token-login-sessions/${encodeURIComponent(t)}`),"getClaudeSetupTokenLoginStatus"),getActiveClaudeSetupTokenLoginSession:a(e=>d.get(`/companies/${encodeURIComponent(e)}/setup-token-login-sessions/active`,{cache:"no-store"}),"getActiveClaudeSetupTokenLoginSession"),getClaudeSetupTokenLoginPrompt:a((e,t)=>d.get(`/companies/${encodeURIComponent(e)}/setup-token-login-sessions/${encodeURIComponent(t)}/prompt`),"getClaudeSetupTokenLoginPrompt"),submitClaudeSetupTokenBrowserCode:a((e,t,r)=>d.post(`/companies/${encodeURIComponent(e)}/setup-token-login-sessions/${encodeURIComponent(t)}/code`,{browserCode:r}),"submitClaudeSetupTokenBrowserCode"),completeClaudeSetupTokenLogin:a((e,t)=>d.post(`/companies/${encodeURIComponent(e)}/setup-token-login-sessions/${encodeURIComponent(t)}/completion`,{}),"completeClaudeSetupTokenLogin"),cancelClaudeSetupTokenLogin:a((e,t)=>d.post(`/companies/${encodeURIComponent(e)}/setup-token-login-sessions/${encodeURIComponent(t)}/cancel`,{}),"cancelClaudeSetupTokenLogin"),availableSkills:a(()=>d.get("/skills/available"),"availableSkills")},Mn=(0,l.createContext)(null);function Fi(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1)if(e[r]?.label!==t[r]?.label||e[r]?.onClick!==t[r]?.onClick||e[r]?.href!==t[r]?.href||e[r]?.identifier!==t[r]?.identifier||e[r]?.leadingKey!==t[r]?.leadingKey||e[r]?.trailingKey!==t[r]?.trailingKey)return!1;return!0}a(Fi,"breadcrumbsEqual");function qi(e,t){const r=e.length===0?[]:[...e].reverse().map(o=>o.label),n=t?.trim()?[t.trim()]:[];return[...r,...n,"Paperclip"].join(" • ")}a(qi,"buildDocumentTitle");function uu({children:e,companyName:t}){const[r,n]=(0,l.useState)([]),[o,s]=(0,l.useState)(null),[i,u]=(0,l.useState)(null),[c,m]=(0,l.useState)(null),p=(0,l.useCallback)(v=>{n(y=>Fi(y,v)?y:v)},[]),f=(0,l.useCallback)(v=>{m(v)},[]),g=(0,l.useCallback)(v=>{s(v)},[]),b=(0,l.useCallback)(v=>{u(v)},[]);return(0,l.useEffect)(()=>{document.title=qi(r,t)},[r,t]),(0,S.jsx)(Mn.Provider,{value:{breadcrumbs:r,setBreadcrumbs:p,breadcrumbToolbar:o,setBreadcrumbToolbar:g,breadcrumbPanelControl:i,setBreadcrumbPanelControl:b,mobileToolbar:c,setMobileToolbar:f},children:e})}a(uu,"BreadcrumbProvider");function cu(){const e=(0,l.useContext)(Mn);if(!e)throw new Error("useBreadcrumbs must be used within BreadcrumbProvider");return e}a(cu,"useBreadcrumbs");export{ii as $,yl as $t,ql as A,Yo as An,Dt as At,Tl as B,Ha as Bn,xs as Bt,Ci as C,Xo as Cn,js as Ct,Vl as D,ul as Dn,Ms as Dt,gi as E,dl as En,Ts as Et,Xl as F,el as Fn,_s as Ft,Nl as G,ws as Gt,Bl as H,Is as Ht,Gl as I,sl as In,Es as It,Hl as J,ks as Jt,Ol as K,$r as Kt,Yl as L,T as Ln,Cs as Lt,ve as M,pe as Mn,Ds as Mt,eu as N,Xi as Nn,Nr as Nt,Kl as O,gr as On,Ls as Ot,Zl as P,so as Pn,As as Pt,li as Q,Cl as Qt,Ll as R,Ce as Rn,Rs as Rt,Ri as S,Zo as Sn,Ns as St,Pt as T,et as Tn,Us as Tt,Ql as U,Dl as Ut,Ul as V,ol as Vn,_l as Vt,Jl as W,Al as Wt,ci as X,Rl as Xt,Wl as Y,bl as Yt,ui as Z,ms as Zt,Li as _,ns as _n,Hs as _t,Bi as a,kl as an,ti as at,Di as b,Ir as bn,zs as bt,ou as c,xl as cn,Pl as ct,nu as d,It as dn,Gs as dt,wl as en,si as et,iu as f,fl as fn,Js as ft,En as g,gl as gn,Ws as gt,Tt as h,hl as hn,Vs as ht,zi as i,fs as in,ri as it,zl as j,al as jn,At as jt,Fl as k,il as kn,Ps as kt,su as l,El as ln,Zs as lt,ru as m,ls as mn,Ks as mt,cu as n,vl as nn,ai as nt,Ni as o,$l as on,ei as ot,An as p,ml as pn,Qs as pt,jl as q,ys as qt,lu as r,Il as rn,ni as rt,au as s,Sl as sn,Xs as st,uu as t,ds as tn,oi as tt,he as u,Z as un,Ys as ut,ce as v,us as vn,qs as vt,ki as w,ll as wn,Os as wt,Ai as x,cl as xn,Bs as xt,tu as y,pl as yn,Fs as yt,Ml as z,Yi as zn,Ss as zt};
@@ -0,0 +1 @@
1
+ var xe=Object.defineProperty;var r=(t,a)=>xe(t,"name",{value:a,configurable:!0});import{i as ne}from"./rolldown-runtime-ZpX3ckPj.js";import{Ei as W,G as pe,aa as he,lt as ge,mi as X,mt as fe,sa as ye,xt as Y}from"./agent-avatar-url-DQnt6boq.js";import{Vn as ve,i as T,n as je,r as be,s as re}from"./BreadcrumbContext-BqrxjvgW.js";import{r as ee,t as Ne}from"./AgentAvatar-B-1xry2J.js";import{i as te,r as we,t as Ae}from"./tabs-AE3sXkCp.js";import{a as Te}from"./ToastContext-T9Pp8-AG.js";import{a as y,c as R,l as _,n as F,r as k}from"./select-Dx8riB8Y.js";import{t as se}from"./input-QhvcBvZC.js";import{o as Se,r as Ce}from"./company-members-Gm1tBjqe.js";import{r as v,t as j}from"./card-s-lN8fb-.js";import{t as Ee}from"./EmptyState-BTZhuDsf.js";import{b as ae,hn as Ie,in as Ue,kt as Pe,rn as De,tn as Le,xn as Re}from"./index-YJY9oyby.js";var l=ne(ye(),1),e=ne(he(),1),_e=50,n="__all",Fe=[{value:n,label:"All actions"},{value:"issue.",label:"Tasks"},{value:"agent.",label:"Agents"},{value:"heartbeat.",label:"Runs"},{value:"approval.",label:"Approvals"},{value:"project.",label:"Projects"},{value:"goal.",label:"Goals"},{value:"tool_gateway.",label:"Tools"},{value:"cost.",label:"Costs"},{value:"company.",label:"Company"}],ke=[{value:n,label:"All entities"},{value:"issue",label:"Task"},{value:"agent",label:"Agent"},{value:"project",label:"Project"},{value:"goal",label:"Goal"},{value:"company",label:"Company"}];function Be(t){if(!t)return;const a=new Date(`${t}T00:00:00.000Z`);return Number.isNaN(a.getTime())?void 0:a.toISOString()}r(Be,"toStartIso");function Ve(t){if(!t)return;const a=new Date(`${t}T23:59:59.999Z`);return Number.isNaN(a.getTime())?void 0:a.toISOString()}r(Ve,"toEndIso");function $e({record:t,agentMap:a,userProfileMap:d}){const u=t.agentId??(t.actorType==="agent"?t.actorId:null),c=u?a.get(u):null;if(c)return(0,e.jsxs)("span",{className:"inline-flex min-w-0 items-center gap-1.5",title:c.name,children:[(0,e.jsx)("span",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:(0,e.jsx)(Ne,{agent:c,size:16,className:"h-3 w-3"})}),(0,e.jsx)("span",{className:"truncate font-medium text-foreground",children:c.name})]});if(t.actorType==="user"&&t.actorId){const m=d.get(t.actorId);return(0,e.jsx)(ee,{name:m?.label??"User",avatarUrl:m?.image??null,size:"sm",className:"font-medium text-foreground"})}const h=t.actorType==="plugin"?"Plugin":t.actorType==="agent"?"Agent":t.actorType==="user"?"User":"System";return(0,e.jsx)(ee,{name:h,size:"sm",className:"font-medium text-foreground"})}r($e,"AuditActor");function qe({record:t}){const{issue:a,document:d}=t.entity,u=a?.identifier??a?.id??null;return u?(0,e.jsx)(re,{to:`/issues/${u}`,className:"font-medium text-primary hover:underline",children:a?.identifier?`${a.identifier}${a.title?` · ${a.title}`:""}`:"the task"}):d?(0,e.jsx)("span",{className:"font-medium text-foreground",children:d.key}):(0,e.jsx)("span",{className:"text-muted-foreground",children:t.entityType})}r(qe,"AuditEntityNode");function ze({record:t,agentMap:a,userProfileMap:d}){const u=Pe(t.action,t.details,{agentMap:a,userProfileMap:d}),c=t.responsibleUserId?d.get(t.responsibleUserId):null,h=!!(t.responsibleUserId&&!(t.actorType==="user"&&t.actorId===t.responsibleUserId)),m=c?.label??(t.responsibleUserId?"a user":null),g=t.entity.comment?.excerpt?.trim(),x=t.entity.issue&&t.entity.document?t.entity.document.key:null;return(0,e.jsx)("li",{className:"px-4 py-3 text-sm",children:(0,e.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,e.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-1 text-foreground",children:[(0,e.jsx)($e,{record:t,agentMap:a,userProfileMap:d}),(0,e.jsx)("span",{className:"text-muted-foreground",children:u}),(0,e.jsx)(qe,{record:t})]}),g?(0,e.jsxs)("p",{className:"line-clamp-2 border-l-2 border-border pl-2 text-muted-foreground",children:["“",g,"”"]}):null,x?(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Document ",(0,e.jsx)("span",{className:"font-mono text-(length:--text-micro)",children:x})]}):null,(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[h&&m?(0,e.jsxs)("span",{className:"inline-flex items-center rounded-full bg-muted px-2 py-0.5",children:["on behalf of ",m]}):null,t.runId&&t.agentId?(0,e.jsx)(re,{to:`/agents/${t.agentId}/runs/${t.runId}`,className:"text-primary hover:underline",children:"View run"}):null,(0,e.jsx)("span",{className:"font-mono text-(length:--text-micro) opacity-70",children:t.action})]})]}),(0,e.jsx)("time",{className:"shrink-0 whitespace-nowrap text-xs text-muted-foreground",dateTime:t.createdAt,title:new Date(t.createdAt).toLocaleString(),children:ge(t.createdAt)})]})})}r(ze,"AuditRow");function Me(){return(0,e.jsx)(j,{children:(0,e.jsxs)(v,{className:"flex flex-col items-center gap-3 py-14 text-center",children:[(0,e.jsx)(Le,{className:"h-10 w-10 text-muted-foreground/50"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm font-medium text-foreground",children:"Agent audit is a Paperclip Enterprise view"}),(0,e.jsxs)("p",{className:"mx-auto mt-1 max-w-md text-sm text-muted-foreground",children:["The agent audit log gives you a searchable, exportable record of everything your agents did — every comment, task change, approval, and run — with the responsible person for each action. Ask an administrator to grant you the"," ",(0,e.jsx)("span",{className:"font-mono text-(length:--text-micro)",children:"audit:view_agent_actions"})," ","permission to view it."]})]})]})})}r(Me,"AuditUpsell");function Oe({companyId:t,lockedAgentId:a,hideHeader:d,mode:u,onModeChange:c}){const{pushToast:h}=Te(),[m,g]=(0,l.useState)(n),[x,B]=(0,l.useState)(n),[S,V]=(0,l.useState)(n),[C,$]=(0,l.useState)(n),[E,q]=(0,l.useState)(""),[I,z]=(0,l.useState)(""),[Z,Q]=(0,l.useState)(!1),[U,H]=(0,l.useState)(!1),M=W({queryKey:Y.agents.list(t),queryFn:r(()=>be.list(t),"queryFn")}),O=W({queryKey:Y.access.companyUserDirectory(t),queryFn:r(()=>Se.listUserDirectory(t),"queryFn"),retry:!1}),ie=(0,l.useMemo)(()=>new Map((M.data??[]).map(s=>[s.id,s])),[M.data]),le=(0,l.useMemo)(()=>Ce(O.data?.users),[O.data]),f=a?"agents":u??"all",o={actorScope:f,agentId:a??(m===n?void 0:m),responsibleUserId:x===n?void 0:x,action:S===n?void 0:S,entityType:C===n?void 0:C,from:Be(E),to:Ve(I)},b=!!(!a&&m!==n||x!==n||S!==n||C!==n||E||I),i=Re({queryKey:Y.audit.agentActions(t,{actorScope:o.actorScope,agentId:o.agentId,responsibleUserId:o.responsibleUserId,action:o.action,entityType:o.entityType,from:o.from,to:o.to}),queryFn:r(({pageParam:s})=>ae.listAgentActions(t,{...o,limit:_e,cursor:s??void 0}),"queryFn"),initialPageParam:null,getNextPageParam:r(s=>s.nextCursor??void 0,"getNextPageParam"),retry:r((s,p)=>!(p instanceof X&&p.status===403)&&s<2,"retry")}),K=i.error instanceof X&&i.error.status===403,P=i.data?.pages.some(s=>s.accessTier==="basic")??!1,oe=i.data?.pages.some(s=>s.accessTier==="full")??!1,G=(0,l.useMemo)(()=>{const s=i.data?.pages??[];return(P?s.filter(p=>p.accessTier!=="full"):s).flatMap(p=>p.items)},[i.data,P]),D=P?"basic":i.data?.pages[0]?.accessTier,N=P&&oe,ce=a?!0:D==="full",de=!!(N&&U&&!i.isFetching),L=!!(!a&&!de&&(K&&b||N)),w=!!(K&&!a&&f==="agents"&&c),ue=!!(!a&&c&&!w&&(f==="agents"||D==="full"));(0,l.useEffect)(()=>{w&&c?.("all")},[w,c]),(0,l.useEffect)(()=>{!a&&(D==="basic"||L)&&(g(n),B(n),V(n),$(n),q(""),z(""))},[D,N,a,L]),(0,l.useEffect)(()=>{if(!N){U&&H(!1);return}U||(H(!0),i.refetch())},[U,i,N]);const J=r(()=>{g(n),B(n),V(n),$(n),q(""),z("")},"clearFilters"),me=r(async()=>{Q(!0);try{const s=await ae.exportAgentActionsCsv(t,{actorScope:o.actorScope,agentId:o.agentId,responsibleUserId:o.responsibleUserId,action:o.action,entityType:o.entityType,from:o.from,to:o.to}),p=URL.createObjectURL(s),A=document.createElement("a");A.href=p,A.download=`${f==="agents"?"agent-audit":"activity"}-${t}.csv`,document.body.appendChild(A),A.click(),A.remove(),window.setTimeout(()=>URL.revokeObjectURL(p),5e3),h({title:"Audit exported",body:"Your CSV download has started.",tone:"success"})}catch(s){h({title:"Export failed",body:s instanceof Error?s.message:"Could not export the audit log.",tone:"error"})}finally{Q(!1)}},"handleExport");return K&&!L&&!w?(0,e.jsx)(Me,{}):(0,e.jsxs)("div",{className:"space-y-4",children:[d?null:(0,e.jsx)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:(0,e.jsxs)("div",{children:[(0,e.jsx)("h1",{className:"text-lg font-semibold text-foreground",children:"Activity"}),(0,e.jsx)("p",{className:"mt-1 max-w-2xl text-sm text-muted-foreground",children:f==="agents"?"Every recorded agent action, newest first — with the responsible person and run behind each one.":"Everything happening in your company, newest first — people, agents, and the system. Each line is one recorded action."})]})}),ue?(0,e.jsx)(Ae,{value:f,onValueChange:r(s=>c?.(s),"onValueChange"),children:(0,e.jsxs)(we,{"aria-label":"Activity scope",children:[(0,e.jsx)(te,{value:"all",children:"All activity"}),(0,e.jsx)(te,{value:"agents",children:"Agent actions"})]})}):null,ce?(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[a?null:(0,e.jsxs)(F,{value:m,onValueChange:g,children:[(0,e.jsx)(R,{className:"w-40",children:(0,e.jsx)(_,{placeholder:"Agent"})}),(0,e.jsxs)(k,{children:[(0,e.jsx)(y,{value:n,children:"All agents"}),(M.data??[]).map(s=>(0,e.jsx)(y,{value:s.id,children:s.name},s.id))]})]}),(0,e.jsxs)(F,{value:x,onValueChange:B,children:[(0,e.jsx)(R,{className:"w-52",children:(0,e.jsx)(_,{placeholder:"Responsible user"})}),(0,e.jsxs)(k,{children:[(0,e.jsx)(y,{value:n,children:"All responsible users"}),(O.data?.users??[]).map(s=>(0,e.jsx)(y,{value:s.principalId,children:s.user?.name??s.user?.email??s.principalId.slice(0,8)},s.principalId))]})]}),(0,e.jsxs)(F,{value:S,onValueChange:V,children:[(0,e.jsx)(R,{className:"w-36",children:(0,e.jsx)(_,{placeholder:"Action"})}),(0,e.jsx)(k,{children:Fe.map(s=>(0,e.jsx)(y,{value:s.value,children:s.label},s.value))})]}),(0,e.jsxs)(F,{value:C,onValueChange:$,children:[(0,e.jsx)(R,{className:"w-36",children:(0,e.jsx)(_,{placeholder:"Entity"})}),(0,e.jsx)(k,{children:ke.map(s=>(0,e.jsx)(y,{value:s.value,children:s.label},s.value))})]}),(0,e.jsx)(se,{type:"date","aria-label":"From date",value:E,max:I||void 0,onChange:r(s=>q(s.target.value),"onChange"),className:"w-36"}),(0,e.jsx)(se,{type:"date","aria-label":"To date",value:I,min:E||void 0,onChange:r(s=>z(s.target.value),"onChange"),className:"w-36"}),b?(0,e.jsx)(T,{variant:"ghost",size:"sm",onClick:J,children:"Clear filters"}):null,(0,e.jsxs)(T,{variant:"outline",size:"sm",className:"ml-auto",onClick:me,disabled:Z||i.isLoading||G.length===0,children:[(0,e.jsx)(Ie,{className:"mr-1.5 h-4 w-4"}),Z?"Exporting…":"Export CSV"]})]}):null,L||w?(0,e.jsx)(j,{children:(0,e.jsx)(v,{className:"py-14 text-center text-sm text-muted-foreground",children:"Refreshing audit access…"})}):i.isLoading?(0,e.jsx)(j,{children:(0,e.jsx)(v,{className:"py-14 text-center text-sm text-muted-foreground",children:"Loading…"})}):i.error?(0,e.jsx)(j,{children:(0,e.jsxs)(v,{className:"flex flex-col items-center gap-3 py-14 text-center",children:[(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:i.error instanceof Error?i.error.message:"Failed to load the audit log."}),(0,e.jsx)(T,{variant:"outline",size:"sm",onClick:r(()=>i.refetch(),"onClick"),children:"Try again"})]})}):G.length===0?(0,e.jsx)(j,{children:(0,e.jsxs)(v,{className:"flex flex-col items-center gap-3 py-14 text-center",children:[(0,e.jsx)(De,{className:"h-10 w-10 text-muted-foreground/40"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm font-medium text-foreground",children:b?"No actions match these filters":"Nothing here yet"}),(0,e.jsx)("p",{className:"mt-1 max-w-md text-sm text-muted-foreground",children:b?"Try a wider date range or different filters.":f==="agents"?"As soon as your agents start doing things, their actions show up here.":"As soon as anyone in your company does something, it shows up here."})]}),b?(0,e.jsx)(T,{variant:"outline",size:"sm",onClick:J,children:"Clear filters"}):null]})}):(0,e.jsx)(j,{children:(0,e.jsx)(v,{className:"px-0 py-0",children:(0,e.jsx)("ul",{className:pe("divide-y divide-border"),children:G.map(s=>(0,e.jsx)(ze,{record:s,agentMap:ie,userProfileMap:le},s.id))})})}),i.hasNextPage?(0,e.jsx)("div",{className:"flex justify-center",children:(0,e.jsx)(T,{variant:"outline",size:"sm",onClick:r(()=>i.fetchNextPage(),"onClick"),disabled:i.isFetchingNextPage,children:i.isFetchingNextPage?"Loading…":"Load more"})}):null,(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Recorded by Paperclip — entries can't be edited. Sensitive values are never stored."})]})}r(Oe,"AuditFeed");function nt(){const{selectedCompanyId:t}=fe(),{setBreadcrumbs:a}=je(),[d,u]=ve(),c=d.get("mode")==="agents"?"agents":"all";(0,l.useEffect)(()=>{a([{label:"Activity"}])},[a]);const h=(0,l.useCallback)(m=>{u(g=>{const x=new URLSearchParams(g);return m==="agents"?x.set("mode","agents"):x.delete("mode"),x},{replace:!0})},[u]);return t?(0,e.jsx)(Oe,{companyId:t,mode:c,onModeChange:h}):(0,e.jsx)(Ee,{icon:Ue,message:"Select a company to view activity."})}r(nt,"CompanyActivity");export{nt as CompanyActivity};