@tickernelz/paperclip-pro-server 2026.926.0 → 2026.926.2

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 (95) hide show
  1. package/dist/build-info.json +1 -1
  2. package/dist/routes/agents.d.ts.map +1 -1
  3. package/dist/routes/agents.js +116 -1
  4. package/dist/routes/agents.js.map +1 -1
  5. package/dist/routes/issues.d.ts.map +1 -1
  6. package/dist/routes/issues.js +79 -6
  7. package/dist/routes/issues.js.map +1 -1
  8. package/dist/routes/openapi.d.ts.map +1 -1
  9. package/dist/routes/openapi.js +30 -1
  10. package/dist/routes/openapi.js.map +1 -1
  11. package/dist/services/adapter-config-field-value.d.ts +12 -0
  12. package/dist/services/adapter-config-field-value.d.ts.map +1 -0
  13. package/dist/services/adapter-config-field-value.js +31 -0
  14. package/dist/services/adapter-config-field-value.js.map +1 -0
  15. package/dist/services/agent-adapter-config-batch.d.ts +26 -0
  16. package/dist/services/agent-adapter-config-batch.d.ts.map +1 -0
  17. package/dist/services/agent-adapter-config-batch.js +174 -0
  18. package/dist/services/agent-adapter-config-batch.js.map +1 -0
  19. package/dist/services/heartbeat.d.ts +4 -4
  20. package/dist/services/issue-model-override-inheritance.d.ts +13 -0
  21. package/dist/services/issue-model-override-inheritance.d.ts.map +1 -0
  22. package/dist/services/issue-model-override-inheritance.js +68 -0
  23. package/dist/services/issue-model-override-inheritance.js.map +1 -0
  24. package/dist/services/issue-run-model-override.d.ts +19 -4
  25. package/dist/services/issue-run-model-override.d.ts.map +1 -1
  26. package/dist/services/issue-run-model-override.js +71 -22
  27. package/dist/services/issue-run-model-override.js.map +1 -1
  28. package/dist/services/issues.d.ts.map +1 -1
  29. package/dist/services/issues.js +21 -0
  30. package/dist/services/issues.js.map +1 -1
  31. package/dist/services/native-runtime/native-session-executor.d.ts +1 -1
  32. package/dist/services/native-runtime/native-session-executor.d.ts.map +1 -1
  33. package/package.json +20 -20
  34. package/ui-dist/assets/{AgentAvatar-CWNp7Eqe.js → AgentAvatar-CnpBTXF0.js} +1 -1
  35. package/ui-dist/assets/{AgentIdentity-Bqzrcghn.js → AgentIdentity-CV55DQtR.js} +1 -1
  36. package/ui-dist/assets/{Agents.production-Cs7mMvAL.js → Agents.production-5Tba_pW_.js} +2 -2
  37. package/ui-dist/assets/{CompanyActivity.production-4bljbHSU.js → CompanyActivity.production-CONFWTe1.js} +1 -1
  38. package/ui-dist/assets/{CompanyExport-CBh7R3lQ.js → CompanyExport-CiOVCS4y.js} +1 -1
  39. package/ui-dist/assets/{CompanySkills.production-DEleeGzs.js → CompanySkills.production-gv4ej6PI.js} +1 -1
  40. package/ui-dist/assets/{Costs.production-Dm5j2nxX.js → Costs.production-C6rOIGNV.js} +1 -1
  41. package/ui-dist/assets/{EmptyState-D62UDLDa.js → EmptyState-DeVTy8IU.js} +1 -1
  42. package/ui-dist/assets/{MarkdownBody-DfGkmx3G.js → MarkdownBody-Da7yUIDf.js} +1 -1
  43. package/ui-dist/assets/{MarkdownEditor-ZwstkvWb.js → MarkdownEditor-7JCtdEaZ.js} +1 -1
  44. package/ui-dist/assets/{OrgChart.production-BWKofGdO.js → OrgChart.production-DYeuFtY_.js} +1 -1
  45. package/ui-dist/assets/{PageSkeleton-C0pPO_Gb.js → PageSkeleton-DRRnaWWU.js} +1 -1
  46. package/ui-dist/assets/{RoutineDetail.production-_auZa0K9.js → RoutineDetail.production-Bt4IHfSD.js} +1 -1
  47. package/ui-dist/assets/RoutineRunVariablesDialog-Bj-Q_Ua3.js +5 -0
  48. package/ui-dist/assets/{Routines.production-D8R6Ujt6.js → Routines.production-BBxSwg2A.js} +1 -1
  49. package/ui-dist/assets/{SidebarContext-B3vvFvTk.js → SidebarContext-CxjppFTY.js} +1 -1
  50. package/ui-dist/assets/{StatusIcon-BYqGFWup.js → StatusIcon-j05cEqDO.js} +1 -1
  51. package/ui-dist/assets/agents-ZcIBncVi.js +1 -0
  52. package/ui-dist/assets/{badge-CW7lQ_Zd.js → badge-B4sBXDQo.js} +1 -1
  53. package/ui-dist/assets/{bot-DIsSOxfs.js → bot-CcFVz40n.js} +1 -1
  54. package/ui-dist/assets/{button-BYQHEF4e.js → button-LkWt40cm.js} +1 -1
  55. package/ui-dist/assets/{card-CFXZOYds.js → card-DbvoJZ3K.js} +1 -1
  56. package/ui-dist/assets/{check-Cniv3It0.js → check-CgfxcCMv.js} +1 -1
  57. package/ui-dist/assets/{checkbox-MLVUJCCS.js → checkbox-CLAkJpms.js} +1 -1
  58. package/ui-dist/assets/{chevron-down-Dq0fsCvv.js → chevron-down-CpKmud_n.js} +1 -1
  59. package/ui-dist/assets/{chevron-right-C4o2Lqna.js → chevron-right-IZydUoW5.js} +1 -1
  60. package/ui-dist/assets/{clipboard-CfEDu5my.js → clipboard-CjMs5cp9.js} +1 -1
  61. package/ui-dist/assets/{company-members-tdITTHFY.js → company-members-Dyq_pnza.js} +1 -1
  62. package/ui-dist/assets/createLucideIcon-CZEG6UJ7.js +92 -0
  63. package/ui-dist/assets/{definition-B5Yyiufk.js → definition-B49KTmLW.js} +1 -1
  64. package/ui-dist/assets/{dist-DCpDFPbp.js → dist-Cqh7BG-j.js} +1 -1
  65. package/ui-dist/assets/{dist-bQQ2HFhw.js → dist-pDmgIRxg.js} +1 -1
  66. package/ui-dist/assets/{environments-awDXeIDD.js → environments-xbdxVBLT.js} +1 -1
  67. package/ui-dist/assets/{external-link-3uv6Ak2X.js → external-link-BbeUY6zf.js} +1 -1
  68. package/ui-dist/assets/{file-text-DWMD8a2i.js → file-text-BMJQ4LZs.js} +1 -1
  69. package/ui-dist/assets/{health-DY_y3c9e.js → health-Bj6kLXe5.js} +1 -1
  70. package/ui-dist/assets/{heartbeats-BQipXQOf.js → heartbeats-DFiFf4Zf.js} +1 -1
  71. package/ui-dist/assets/{index-N4w1Oco1.js → index-BRCs87uX.js} +162 -162
  72. package/ui-dist/assets/index-GCNIGBzC.css +1 -0
  73. package/ui-dist/assets/{input-B7ODc-rR.js → input-a7SggR2b.js} +1 -1
  74. package/ui-dist/assets/label-Dnc69R1W.js +5 -0
  75. package/ui-dist/assets/{loader-circle-DA6xS_rG.js → loader-circle-Cu72DKdC.js} +1 -1
  76. package/ui-dist/assets/{mention-chips-r4UB4Eiw.js → mention-chips-BEaOTvHT.js} +1 -1
  77. package/ui-dist/assets/{octagon-alert-DsI0y-RL.js → octagon-alert-DfqJ6RjK.js} +1 -1
  78. package/ui-dist/assets/{rotate-ccw-D6pz3VoJ.js → rotate-ccw-DiFaj3XM.js} +1 -1
  79. package/ui-dist/assets/{router-DcMYq5w_.js → router-G1KztA90.js} +1 -1
  80. package/ui-dist/assets/{save-CvrYa2yq.js → save-D9PtvKKu.js} +1 -1
  81. package/ui-dist/assets/{select-CV7s_3g2.js → select-DSr2hsz2.js} +1 -1
  82. package/ui-dist/assets/{sheet-CrBXG9pk.js → sheet-H27vJn3G.js} +1 -1
  83. package/ui-dist/assets/{skeleton-efW_R0t3.js → skeleton-CPVPMT4g.js} +1 -1
  84. package/ui-dist/assets/{tabs-4RdauNv3.js → tabs-D8G3-AL7.js} +1 -1
  85. package/ui-dist/assets/{triangle-alert-DQUol3t5.js → triangle-alert-DiD4Atur.js} +1 -1
  86. package/ui-dist/assets/{use-adapter-capabilities-pFfW1mOk.js → use-adapter-capabilities-D_QCYxa2.js} +1 -1
  87. package/ui-dist/assets/{useHiddenSettings-b1eurTXV.js → useHiddenSettings-vbDpbX0U.js} +1 -1
  88. package/ui-dist/assets/{zap-CKzX0hdL.js → zap-CCqZhqc3.js} +1 -1
  89. package/ui-dist/index.html +46 -46
  90. package/ui-dist/sw.js +1 -1
  91. package/ui-dist/assets/RoutineRunVariablesDialog-CUcwhS7L.js +0 -5
  92. package/ui-dist/assets/agents-CNina7HI.js +0 -1
  93. package/ui-dist/assets/createLucideIcon-CINAT48M.js +0 -92
  94. package/ui-dist/assets/index-BAoNTaz4.css +0 -1
  95. package/ui-dist/assets/label-BnqmTeef.js +0 -5
@@ -1 +1 @@
1
- var ot=Object.defineProperty;var o=(i,h)=>ot(i,"name",{value:h,configurable:!0});import{i as Re}from"./rolldown-runtime-ZpX3ckPj.js";import{Fr as dt,L as J,Lr as lt,M,Pr as ct,S as Ie,T as m,U as ut,Y as v,nr as S,tr as qe,x as mt}from"./createLucideIcon-CINAT48M.js";import{i as O,n as B,r as pt,t as te}from"./tabs-4RdauNv3.js";import{r as gt,t as xt}from"./EmptyState-D62UDLDa.js";import{t as ht}from"./chevron-down-Dq0fsCvv.js";import{t as bt}from"./chevron-right-C4o2Lqna.js";import{t as vt}from"./button-BYQHEF4e.js";import{t as yt}from"./AgentIdentity-Bqzrcghn.js";import{i as R,o as $,r as F,s as L,t as q}from"./card-CFXZOYds.js";import{t as se}from"./PageSkeleton-C0pPO_Gb.js";import{$t as De,C as jt,D as N,E as Ae,Fn as ne,Gt as ft,Hn as re,In as ie,S as Fe,T as Ee,Wn as Nt,_t as ae,b as Ct,gt as wt,v as Tt,w as kt,x as Ke,xn as oe,y as St}from"./index-N4w1Oco1.js";var l=Re(lt(),1),e=Re(dt(),1),Bt="__none__";function Mt(){const i=new Date,h=i.getDay(),y=h===0?-6:1-h,u=new Date(i.getFullYear(),i.getMonth(),i.getDate()+y,0,0,0,0),j=new Date(u.getFullYear(),u.getMonth(),u.getDate()+6,23,59,59,999);return{from:u.toISOString(),to:j.toISOString()}}o(Mt,"currentWeekRange");function Pt({provider:i,rows:h}){const y=h.reduce((j,b)=>j+b.inputTokens+b.cachedInputTokens+b.outputTokens,0),u=h.reduce((j,b)=>j+b.costCents,0);return(0,e.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,e.jsx)("span",{children:J(i)}),(0,e.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:M(y)}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:m(u)})]})}o(Pt,"ProviderTabLabel");function It({biller:i,rows:h}){const y=h.reduce((j,b)=>j+b.inputTokens+b.cachedInputTokens+b.outputTokens,0),u=h.reduce((j,b)=>j+b.costCents,0);return(0,e.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,e.jsx)("span",{children:J(i)}),(0,e.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:M(y)}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:m(u)})]})}o(It,"BillerTabLabel");function C({label:i,value:h,subtitle:y,icon:u}){return(0,e.jsx)(q,{className:"block p-4",children:(0,e.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"text-(length:--text-micro) uppercase tracking-(--tracking-eyebrow) text-muted-foreground",children:i}),(0,e.jsx)("div",{className:"mt-2 text-2xl font-semibold tabular-nums",children:h}),(0,e.jsx)("div",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:y})]}),(0,e.jsx)("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-md border border-border",children:(0,e.jsx)(u,{className:"h-4 w-4 text-muted-foreground"})})]})})}o(C,"MetricTile");function _e({debitCents:i,creditCents:h,netCents:y,estimatedDebitCents:u,eventCount:j}){return(0,e.jsxs)(q,{children:[(0,e.jsxs)($,{className:"px-5 pt-5 pb-2",children:[(0,e.jsx)(L,{className:"text-base",children:"Finance ledger"}),(0,e.jsx)(R,{children:"Account-level charges that do not map to a single inference request."})]}),(0,e.jsxs)(F,{className:"grid gap-3 px-5 pb-5 pt-2 sm:grid-cols-2 xl:grid-cols-4",children:[(0,e.jsx)(C,{label:"Debits",value:m(i),subtitle:`${j} total event${j===1?"":"s"} in range`,icon:re}),(0,e.jsx)(C,{label:"Credits",value:m(h),subtitle:"Refunds, offsets, and credit returns",icon:Nt}),(0,e.jsx)(C,{label:"Net",value:m(y),subtitle:"Debit minus credit for the selected period",icon:oe}),(0,e.jsx)(C,{label:"Estimated",value:m(u),subtitle:"Estimated debits that are not yet invoice-authoritative",icon:ie})]})]})}o(_e,"FinanceSummaryCard");function Ot(){const{selectedCompanyId:i}=ut(),{setBreadcrumbs:h}=gt(),y=ct(),[u,j]=(0,l.useState)("overview"),[b,de]=(0,l.useState)("all"),[W,le]=(0,l.useState)("all"),{preset:E,setPreset:$e,customFrom:Le,setCustomFrom:We,customTo:ze,setCustomTo:Oe,from:g,to:x,customReady:D}=Ct();(0,l.useEffect)(()=>{h([{label:"Costs"}])},[h]);const[Qe,Ye]=(0,l.useState)(()=>new Date().toDateString()),X=(0,l.useRef)(null);(0,l.useEffect)(()=>{const t=o(()=>{const s=new Date,n=new Date(s.getFullYear(),s.getMonth(),s.getDate()+1).getTime()-s.getTime();X.current=setTimeout(()=>{Ye(new Date().toDateString()),t()},n)},"schedule");return t(),()=>{X.current!=null&&clearTimeout(X.current)}},[]);const P=(0,l.useMemo)(()=>Mt(),[Qe]),d=i??Bt,{data:A,isLoading:Ue,error:ce}=S({queryKey:v.budgets.overview(d),queryFn:o(()=>ae.overview(d),"queryFn"),enabled:!!i&&D,refetchInterval:3e4,staleTime:5e3}),ue=o(()=>{i&&(y.invalidateQueries({queryKey:v.budgets.overview(i)}),y.invalidateQueries({queryKey:v.dashboard(i)}),y.invalidateQueries({queryKey:v.agents.list(i)}),y.invalidateQueries({queryKey:v.projects.all(i)}))},"invalidateBudgetViews"),me=qe({mutationFn:o(t=>ae.upsertPolicy(d,{scopeType:t.scopeType,scopeId:t.scopeId,amount:t.amount,windowKind:t.windowKind}),"mutationFn"),onSuccess:ue}),K=qe({mutationFn:o(t=>ae.resolveIncident(d,t.incidentId,t),"mutationFn"),onSuccess:ue}),{data:a,isLoading:Ve,error:He}=S({queryKey:v.costs(d,g||void 0,x||void 0),queryFn:o(async()=>{const[t,s,n,r]=await Promise.all([N.summary(d,g||void 0,x||void 0),N.byAgent(d,g||void 0,x||void 0),N.byProject(d,g||void 0,x||void 0),N.byAgentModel(d,g||void 0,x||void 0)]);return{summary:t,byAgent:s,byProject:n,byAgentModel:r}},"queryFn"),enabled:!!i&&D}),{data:p,isLoading:pe,error:Z}=S({queryKey:[v.financeSummary(d,g||void 0,x||void 0),v.financeByBiller(d,g||void 0,x||void 0),v.financeByKind(d,g||void 0,x||void 0),v.financeEvents(d,g||void 0,x||void 0,18)],queryFn:o(async()=>{const[t,s,n,r]=await Promise.all([N.financeSummary(d,g||void 0,x||void 0),N.financeByBiller(d,g||void 0,x||void 0),N.financeByKind(d,g||void 0,x||void 0),N.financeEvents(d,g||void 0,x||void 0,18)]);return{summary:t,byBiller:s,byKind:n,events:r}},"queryFn"),enabled:!!i&&D}),[Ge,ge]=(0,l.useState)(new Set);(0,l.useEffect)(()=>{ge(new Set)},[d,g,x]);function Je(t){ge(s=>{const n=new Set(s);return n.has(t)?n.delete(t):n.add(t),n})}o(Je,"toggleAgent");const Xe=(0,l.useMemo)(()=>{const t=new Map;for(const s of a?.byAgentModel??[]){const n=t.get(s.agentId)??[];n.push(s),t.set(s.agentId,n)}for(const[s,n]of t)t.set(s,n.slice().sort((r,c)=>c.costCents-r.costCents));return t},[a?.byAgentModel]),{data:Q}=S({queryKey:v.usageByProvider(d,g||void 0,x||void 0),queryFn:o(()=>N.byProvider(d,g||void 0,x||void 0),"queryFn"),enabled:!!i&&D&&(u==="providers"||u==="billers"),refetchInterval:3e4,staleTime:1e4}),{data:xe}=S({queryKey:v.usageByBiller(d,g||void 0,x||void 0),queryFn:o(()=>N.byBiller(d,g||void 0,x||void 0),"queryFn"),enabled:!!i&&D&&u==="billers",refetchInterval:3e4,staleTime:1e4}),{data:he}=S({queryKey:v.usageByProvider(d,P.from,P.to),queryFn:o(()=>N.byProvider(d,P.from,P.to),"queryFn"),enabled:!!i&&(u==="providers"||u==="billers"),refetchInterval:3e4,staleTime:1e4}),{data:be}=S({queryKey:v.usageByBiller(d,P.from,P.to),queryFn:o(()=>N.byBiller(d,P.from,P.to),"queryFn"),enabled:!!i&&u==="billers",refetchInterval:3e4,staleTime:1e4}),{data:ve}=S({queryKey:v.usageWindowSpend(d),queryFn:o(()=>N.windowSpend(d),"queryFn"),enabled:!!i&&u==="providers",refetchInterval:3e4,staleTime:1e4}),{data:_,isLoading:ye}=S({queryKey:v.usageQuotaWindows(d),queryFn:o(()=>N.quotaWindows(d),"queryFn"),enabled:!!i&&u==="providers",refetchInterval:3e5,staleTime:6e4}),w=(0,l.useMemo)(()=>{const t=new Map;for(const s of Q??[]){const n=t.get(s.provider)??[];n.push(s),t.set(s.provider,n)}return t},[Q]),k=(0,l.useMemo)(()=>{const t=new Map;for(const s of xe??[]){const n=t.get(s.biller)??[];n.push(s),t.set(s.biller,n)}return t},[xe]),je=(0,l.useMemo)(()=>{const t=new Map;for(const s of he??[])t.set(s.provider,(t.get(s.provider)??0)+s.costCents);return t},[he]),fe=(0,l.useMemo)(()=>{const t=new Map;for(const s of be??[])t.set(s.biller,(t.get(s.biller)??0)+s.costCents);return t},[be]),Ne=(0,l.useMemo)(()=>{const t=new Map;for(const s of ve??[]){const n=t.get(s.provider)??[];n.push(s),t.set(s.provider,n)}return t},[ve]),Ce=(0,l.useMemo)(()=>{const t=new Map;for(const s of _??[])s.ok&&s.windows.length>0&&t.set(s.provider,s.windows);return t},[_]),we=(0,l.useMemo)(()=>{const t=new Map;for(const s of _??[])!s.ok&&s.error&&t.set(s.provider,s.error);return t},[_]),Te=(0,l.useMemo)(()=>{const t=new Map;for(const s of _??[])typeof s.source=="string"&&s.source.length>0&&t.set(s.provider,s.source);return t},[_]),ke=(0,l.useMemo)(()=>{const t=new Map;if(E!=="mtd")return t;const s=a?.summary.budgetCents??0;if(s<=0)return t;const n=a?.summary.spendCents??0,r=new Date,c=r.getDate(),T=new Date(r.getFullYear(),r.getMonth()+1,0).getDate();for(const[f,nt]of w){const ee=nt.reduce((rt,it)=>rt+it.costCents,0),Pe=s*(n>0?ee/n:0);if(Pe<=0){t.set(f,!1);continue}const at=ee/Math.max(c,1);t.set(f,ee+at*(T-c)>Pe)}return t},[E,a,w]),Y=(0,l.useMemo)(()=>Array.from(w.keys()),[w]),U=(0,l.useMemo)(()=>Array.from(k.keys()),[k]),V=b==="all"||Y.includes(b)?b:"all";(0,l.useEffect)(()=>{V!==b&&de("all")},[V,b]);const H=W==="all"||U.includes(W)?W:"all";(0,l.useEffect)(()=>{H!==W&&le("all")},[H,W]);const Ze=(0,l.useMemo)(()=>{const t=Array.from(w.keys()),s=t.reduce((r,c)=>r+(w.get(c)?.reduce((T,f)=>T+f.inputTokens+f.cachedInputTokens+f.outputTokens,0)??0),0),n=t.reduce((r,c)=>r+(w.get(c)?.reduce((T,f)=>T+f.costCents,0)??0),0);return[{value:"all",label:(0,e.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,e.jsx)("span",{children:"All providers"}),t.length>0?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:M(s)}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:m(n)})]}):null]})},...t.map(r=>({value:r,label:(0,e.jsx)(Pt,{provider:r,rows:w.get(r)??[]})}))]},[w]),et=(0,l.useMemo)(()=>{const t=Array.from(k.keys()),s=t.reduce((r,c)=>r+(k.get(c)?.reduce((T,f)=>T+f.inputTokens+f.cachedInputTokens+f.outputTokens,0)??0),0),n=t.reduce((r,c)=>r+(k.get(c)?.reduce((T,f)=>T+f.costCents,0)??0),0);return[{value:"all",label:(0,e.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,e.jsx)("span",{children:"All billers"}),t.length>0?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:M(s)}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:m(n)})]}):null]})},...t.map(r=>({value:r,label:(0,e.jsx)(It,{biller:r,rows:k.get(r)??[]})}))]},[k]),Se=(a?.byAgent??[]).reduce((t,s)=>t+s.inputTokens+s.cachedInputTokens+s.outputTokens,0),Be=p?.events??[],z=A?.policies??[],I=A?.activeIncidents??[],tt=(0,l.useMemo)(()=>({company:z.filter(t=>t.scopeType==="company"),agent:z.filter(t=>t.scopeType==="agent"),project:z.filter(t=>t.scopeType==="project")}),[z]);if(!i)return(0,e.jsx)(xt,{icon:ne,message:"Select a company to view costs."});const G=E==="custom"&&!D,st=(Ve||pe)&&D,Me=He??Z;return(0,e.jsxs)("div",{className:"space-y-6",children:[(0,e.jsxs)("div",{className:"space-y-5",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("h1",{className:"text-3xl font-semibold tracking-tight",children:"Costs"}),(0,e.jsx)("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-muted-foreground",children:"Inference spend, platform fees, credits, and live quota windows."})]}),(0,e.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:Tt.map(t=>(0,e.jsx)(vt,{variant:E===t?"secondary":"ghost",size:"sm",onClick:o(()=>$e(t),"onClick"),"aria-pressed":E===t,children:St[t]},t))})]}),E==="custom"?(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border border-border p-3",children:[(0,e.jsx)("input",{type:"date",value:Le,onChange:o(t=>We(t.target.value),"onChange"),className:"h-9 rounded-md border border-input bg-background px-3 text-sm text-foreground"}),(0,e.jsx)("span",{className:"text-sm text-muted-foreground",children:"to"}),(0,e.jsx)("input",{type:"date",value:ze,onChange:o(t=>Oe(t.target.value),"onChange"),className:"h-9 rounded-md border border-input bg-background px-3 text-sm text-foreground"})]}):null,(0,e.jsxs)("div",{className:"grid gap-3 lg:grid-cols-4",children:[(0,e.jsx)(C,{label:"Inference spend",value:m(a?.summary.spendCents??0),subtitle:`${M(Se)} tokens across request-scoped events`,icon:ne}),(0,e.jsx)(C,{label:"Budget",value:I.length>0?String(I.length):a?.summary.budgetCents&&a.summary.budgetCents>0?`${a.summary.utilizationPercent}%`:"Open",subtitle:I.length>0?`${A?.pausedAgentCount??0} agents paused · ${A?.pausedProjectCount??0} projects paused`:a?.summary.budgetCents&&a.summary.budgetCents>0?`${m(a.summary.spendCents)} of ${m(a.summary.budgetCents)}`:"No monthly cap configured",icon:ie}),(0,e.jsx)(C,{label:"Finance net",value:m(p?.summary.netCents??0),subtitle:`${m(p?.summary.debitCents??0)} debits · ${m(p?.summary.creditCents??0)} credits`,icon:oe}),(0,e.jsx)(C,{label:"Finance events",value:String(p?.summary.eventCount??0),subtitle:`${m(p?.summary.estimatedDebitCents??0)} estimated in range`,icon:re})]})]}),(0,e.jsxs)(te,{value:u,onValueChange:o(t=>j(t),"onValueChange"),children:[(0,e.jsxs)(pt,{variant:"line",className:"justify-start",children:[(0,e.jsx)(O,{value:"overview",children:"Overview"}),(0,e.jsx)(O,{value:"budgets",children:"Budgets"}),(0,e.jsx)(O,{value:"providers",children:"Providers"}),(0,e.jsx)(O,{value:"billers",children:"Billers"}),(0,e.jsx)(O,{value:"finance",children:"Finance"})]}),(0,e.jsx)(B,{value:"overview",className:"mt-4 space-y-4",children:G?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Select a start and end date to load data."}):st?(0,e.jsx)(se,{variant:"costs"}):Me?(0,e.jsx)("p",{className:"text-sm text-destructive",children:Me.message}):(0,e.jsxs)(e.Fragment,{children:[I.length>0?(0,e.jsx)("div",{className:"grid gap-4 xl:grid-cols-2",children:I.slice(0,2).map(t=>(0,e.jsx)(Ee,{incident:t,isMutating:K.isPending,onKeepPaused:o(()=>K.mutate({incidentId:t.id,action:"keep_paused"}),"onKeepPaused"),onRaiseAndResume:o(s=>K.mutate({incidentId:t.id,action:"raise_budget_and_resume",amount:s}),"onRaiseAndResume")},t.id))}):null,(0,e.jsxs)("div",{className:"grid gap-4 xl:grid-cols-(--gtc-31)",children:[(0,e.jsxs)(q,{children:[(0,e.jsxs)($,{className:"px-5 pt-5 pb-2",children:[(0,e.jsx)(L,{className:"text-base",children:"Inference ledger"}),(0,e.jsx)(R,{children:"Request-scoped inference spend for the selected period."})]}),(0,e.jsxs)(F,{className:"space-y-4 px-5 pb-5 pt-2",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-3xl font-semibold tabular-nums",children:m(a?.summary.spendCents??0)}),(0,e.jsx)("div",{className:"mt-1 text-sm text-muted-foreground",children:a?.summary.budgetCents&&a.summary.budgetCents>0?`Budget ${m(a.summary.budgetCents)}`:"Unlimited budget"})]}),(0,e.jsxs)("div",{className:"border border-border px-4 py-3 text-right",children:[(0,e.jsx)("div",{className:"text-(length:--text-micro) uppercase tracking-(--tracking-eyebrow) text-muted-foreground",children:"usage"}),(0,e.jsx)("div",{className:"mt-1 text-lg font-medium tabular-nums",children:M(Se)})]})]}),a?.summary.budgetCents&&a.summary.budgetCents>0?(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("div",{className:"h-2 overflow-hidden bg-muted",children:(0,e.jsx)("div",{className:Ie("h-full transition-(--tp-width-background-color) duration-150",a.summary.utilizationPercent>90?"bg-(--status-task-blocked)":a.summary.utilizationPercent>70?"bg-(--status-task-todo)":"bg-(--status-task-done)"),style:{width:`${Math.min(100,a.summary.utilizationPercent)}%`}})}),(0,e.jsxs)("div",{className:"text-xs text-muted-foreground",children:[a.summary.utilizationPercent,"% of monthly budget consumed in this range."]})]}):null]})]}),(0,e.jsx)(_e,{debitCents:p?.summary.debitCents??0,creditCents:p?.summary.creditCents??0,netCents:p?.summary.netCents??0,estimatedDebitCents:p?.summary.estimatedDebitCents??0,eventCount:p?.summary.eventCount??0})]}),(0,e.jsxs)("div",{className:"grid gap-4 xl:grid-cols-(--gtc-32)",children:[(0,e.jsxs)(q,{children:[(0,e.jsxs)($,{className:"px-5 pt-5 pb-2",children:[(0,e.jsx)(L,{className:"text-base",children:"By agent"}),(0,e.jsx)(R,{children:"What each agent consumed in the selected period."})]}),(0,e.jsx)(F,{className:"space-y-2 px-5 pb-5 pt-2",children:(a?.byAgent.length??0)===0?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No cost events yet."}):a?.byAgent.map(t=>{const s=Xe.get(t.agentId)??[],n=Ge.has(t.agentId),r=s.length>0;return(0,e.jsxs)("div",{className:"border border-border px-4 py-3",children:[(0,e.jsxs)("div",{className:Ie("flex items-start justify-between gap-3",r?"cursor-pointer select-none":""),onClick:o(()=>r&&Je(t.agentId),"onClick"),children:[(0,e.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[r?n?(0,e.jsx)(ht,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,e.jsx)(bt,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,e.jsx)("span",{className:"h-3 w-3 shrink-0"}),(0,e.jsx)(yt,{agent:{id:t.agentId,name:t.agentName??t.agentId,appearance:t.agentAppearance},size:"sm"}),t.agentStatus==="terminated"?(0,e.jsx)(ft,{status:"terminated"}):null]}),(0,e.jsxs)("div",{className:"text-right text-sm tabular-nums",children:[(0,e.jsx)("div",{className:"font-medium",children:m(t.costCents)}),(0,e.jsxs)("div",{className:"text-xs text-muted-foreground",children:["in ",M(t.inputTokens+t.cachedInputTokens)," · out ",M(t.outputTokens)]}),t.apiRunCount>0||t.subscriptionRunCount>0?(0,e.jsxs)("div",{className:"text-xs text-muted-foreground",children:[t.apiRunCount>0?`${t.apiRunCount} api`:"0 api"," · ",t.subscriptionRunCount>0?`${t.subscriptionRunCount} subscription`:"0 subscription"]}):null]})]}),n&&s.length>0?(0,e.jsx)("div",{className:"mt-3 space-y-2 border-l border-border pl-4",children:s.map(c=>{const T=t.costCents>0?Math.round(c.costCents/t.costCents*100):0;return(0,e.jsxs)("div",{className:"flex items-start justify-between gap-3 text-xs",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsxs)("div",{className:"truncate font-medium text-foreground",children:[J(c.provider),(0,e.jsx)("span",{className:"mx-1 text-border",children:"/"}),(0,e.jsx)("span",{className:"font-mono",children:c.model})]}),(0,e.jsxs)("div",{className:"truncate text-muted-foreground",children:[J(c.biller)," · ",mt(c.billingType)]})]}),(0,e.jsxs)("div",{className:"text-right tabular-nums",children:[(0,e.jsxs)("div",{className:"font-medium",children:[m(c.costCents),(0,e.jsxs)("span",{className:"ml-1 font-normal text-muted-foreground",children:["(",T,"%)"]})]}),(0,e.jsxs)("div",{className:"text-muted-foreground",children:[M(c.inputTokens+c.cachedInputTokens+c.outputTokens)," tok"]})]})]},`${c.provider}:${c.model}:${c.billingType}`)})}):null]},t.agentId)})})]}),(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)(q,{children:[(0,e.jsxs)($,{className:"px-5 pt-5 pb-2",children:[(0,e.jsx)(L,{className:"text-base",children:"By project"}),(0,e.jsx)(R,{children:"Run costs attributed through project-linked tasks."})]}),(0,e.jsx)(F,{className:"space-y-2 px-5 pb-5 pt-2",children:(a?.byProject.length??0)===0?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No project-attributed run costs yet."}):a?.byProject.map((t,s)=>(0,e.jsxs)("div",{className:"flex items-center justify-between gap-3 border border-border px-3 py-2 text-sm",children:[(0,e.jsx)("span",{className:"truncate",children:t.projectName??t.projectId??"Unattributed"}),(0,e.jsx)("span",{className:"font-medium tabular-nums",children:m(t.costCents)})]},t.projectId??`unattributed-${s}`))})]}),(0,e.jsx)(Fe,{rows:Be.slice(0,6),emptyMessage:"No finance events yet. Add account-level charges once biller invoices or credits land."})]})]})]})}),(0,e.jsx)(B,{value:"budgets",className:"mt-4 space-y-4",children:Ue?(0,e.jsx)(se,{variant:"costs"}):ce?(0,e.jsx)("p",{className:"text-sm text-destructive",children:ce.message}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(q,{className:"border-border/70 bg-(image:--gradient-extract-2)",children:[(0,e.jsxs)($,{className:"px-5 pt-5 pb-3",children:[(0,e.jsx)(L,{className:"text-base",children:"Budget control plane"}),(0,e.jsx)(R,{children:"Hard-stop spend limits for agents and projects. Provider subscription quota stays separate and appears under Providers."})]}),(0,e.jsxs)(F,{className:"grid gap-3 px-5 pb-5 pt-0 md:grid-cols-4",children:[(0,e.jsx)(C,{label:"Active incidents",value:String(I.length),subtitle:"Open soft or hard threshold crossings",icon:oe}),(0,e.jsx)(C,{label:"Pending approvals",value:String(A?.pendingApprovalCount??0),subtitle:"Budget override approvals awaiting board action",icon:re}),(0,e.jsx)(C,{label:"Paused agents",value:String(A?.pausedAgentCount??0),subtitle:"Agent heartbeats blocked by budget",icon:ie}),(0,e.jsx)(C,{label:"Paused projects",value:String(A?.pausedProjectCount??0),subtitle:"Project execution blocked by budget",icon:ne})]})]}),I.length>0?(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("h2",{className:"text-lg font-semibold",children:"Active incidents"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Resolve hard stops here by raising the budget or explicitly keeping the scope paused."})]}),(0,e.jsx)("div",{className:"grid gap-4 xl:grid-cols-2",children:I.map(t=>(0,e.jsx)(Ee,{incident:t,isMutating:K.isPending,onKeepPaused:o(()=>K.mutate({incidentId:t.id,action:"keep_paused"}),"onKeepPaused"),onRaiseAndResume:o(s=>K.mutate({incidentId:t.id,action:"raise_budget_and_resume",amount:s}),"onRaiseAndResume")},t.id))})]}):null,(0,e.jsxs)("div",{className:"space-y-5",children:[["company","agent","project"].map(t=>{const s=tt[t];return s.length===0?null:(0,e.jsxs)("section",{className:"space-y-3",children:[(0,e.jsxs)("div",{children:[(0,e.jsxs)("h2",{className:"text-lg font-semibold capitalize",children:[t," budgets"]}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:t==="company"?"Company-wide monthly policy.":t==="agent"?"Recurring monthly spend policies for individual agents.":"Lifetime spend policies for execution-bound projects."})]}),(0,e.jsx)("div",{className:"grid gap-4 xl:grid-cols-2",children:s.map(n=>(0,e.jsx)(wt,{summary:n,isSaving:me.isPending,onSave:o(r=>me.mutate({scopeType:n.scopeType,scopeId:n.scopeId,amount:r,windowKind:n.windowKind}),"onSave")},n.policyId))})]},t)}),z.length===0?(0,e.jsx)(q,{children:(0,e.jsx)(F,{className:"px-5 py-8 text-sm text-muted-foreground",children:"No budget policies yet. Set agent and project budgets from their detail pages, or use the existing company monthly budget control."})}):null]})]})}),(0,e.jsx)(B,{value:"providers",className:"mt-4 space-y-4",children:G?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Select a start and end date to load data."}):(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)(te,{value:V,onValueChange:de,children:[(0,e.jsx)(De,{items:Ze,value:V}),(0,e.jsx)(B,{value:"all",className:"mt-4",children:Y.length===0?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No cost events in this period."}):(0,e.jsx)("div",{className:"grid gap-4 md:grid-cols-2",children:Y.map(t=>(0,e.jsx)(Ke,{provider:t,rows:w.get(t)??[],budgetMonthlyCents:a?.summary.budgetCents??0,totalCompanySpendCents:a?.summary.spendCents??0,weekSpendCents:je.get(t)??0,windowRows:Ne.get(t)??[],showDeficitNotch:ke.get(t)??!1,quotaWindows:Ce.get(t)??[],quotaError:we.get(t)??null,quotaSource:Te.get(t)??null,quotaLoading:ye},t))})}),Y.map(t=>(0,e.jsx)(B,{value:t,className:"mt-4",children:(0,e.jsx)(Ke,{provider:t,rows:w.get(t)??[],budgetMonthlyCents:a?.summary.budgetCents??0,totalCompanySpendCents:a?.summary.spendCents??0,weekSpendCents:je.get(t)??0,windowRows:Ne.get(t)??[],showDeficitNotch:ke.get(t)??!1,quotaWindows:Ce.get(t)??[],quotaError:we.get(t)??null,quotaSource:Te.get(t)??null,quotaLoading:ye})},t))]})})}),(0,e.jsx)(B,{value:"billers",className:"mt-4 space-y-4",children:G?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Select a start and end date to load data."}):(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)(te,{value:H,onValueChange:le,children:[(0,e.jsx)(De,{items:et,value:H}),(0,e.jsx)(B,{value:"all",className:"mt-4",children:U.length===0?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No billable events in this period."}):(0,e.jsx)("div",{className:"grid gap-4 md:grid-cols-2",children:U.map(t=>{const s=(k.get(t)??[])[0];if(!s)return null;const n=(Q??[]).filter(r=>r.biller===t);return(0,e.jsx)(Ae,{row:s,weekSpendCents:fe.get(t)??0,budgetMonthlyCents:a?.summary.budgetCents??0,totalCompanySpendCents:a?.summary.spendCents??0,providerRows:n},t)})})}),U.map(t=>{const s=(k.get(t)??[])[0];if(!s)return null;const n=(Q??[]).filter(r=>r.biller===t);return(0,e.jsx)(B,{value:t,className:"mt-4",children:(0,e.jsx)(Ae,{row:s,weekSpendCents:fe.get(t)??0,budgetMonthlyCents:a?.summary.budgetCents??0,totalCompanySpendCents:a?.summary.spendCents??0,providerRows:n})},t)})]})})}),(0,e.jsx)(B,{value:"finance",className:"mt-4 space-y-4",children:G?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Select a start and end date to load data."}):pe?(0,e.jsx)(se,{variant:"costs"}):Z?(0,e.jsx)("p",{className:"text-sm text-destructive",children:Z.message}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(_e,{debitCents:p?.summary.debitCents??0,creditCents:p?.summary.creditCents??0,netCents:p?.summary.netCents??0,estimatedDebitCents:p?.summary.estimatedDebitCents??0,eventCount:p?.summary.eventCount??0}),(0,e.jsxs)("div",{className:"grid gap-4 xl:grid-cols-(--gtc-33)",children:[(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)(q,{children:[(0,e.jsxs)($,{className:"px-5 pt-5 pb-2",children:[(0,e.jsx)(L,{className:"text-base",children:"By biller"}),(0,e.jsx)(R,{children:"Account-level financial events grouped by who charged or credited them."})]}),(0,e.jsx)(F,{className:"grid gap-4 px-5 pb-5 pt-2 md:grid-cols-2",children:(p?.byBiller.length??0)===0?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No finance events yet."}):p?.byBiller.map(t=>(0,e.jsx)(kt,{row:t},t.biller))})]}),(0,e.jsx)(Fe,{rows:Be})]}),(0,e.jsx)(jt,{rows:p?.byKind??[]})]})]})})]})]})}o(Ot,"Costs");export{Ot as Costs};
1
+ var ot=Object.defineProperty;var o=(i,h)=>ot(i,"name",{value:h,configurable:!0});import{i as Re}from"./rolldown-runtime-ZpX3ckPj.js";import{Fr as dt,L as J,Lr as lt,M,Pr as ct,S as Ie,T as m,U as ut,Y as v,nr as S,tr as qe,x as mt}from"./createLucideIcon-CZEG6UJ7.js";import{i as O,n as B,r as pt,t as te}from"./tabs-D8G3-AL7.js";import{r as gt,t as xt}from"./EmptyState-DeVTy8IU.js";import{t as ht}from"./chevron-down-CpKmud_n.js";import{t as bt}from"./chevron-right-IZydUoW5.js";import{t as vt}from"./button-LkWt40cm.js";import{t as yt}from"./AgentIdentity-CV55DQtR.js";import{i as R,o as $,r as F,s as L,t as q}from"./card-DbvoJZ3K.js";import{t as se}from"./PageSkeleton-DRRnaWWU.js";import{$t as De,C as jt,D as N,E as Ae,Fn as ne,Gt as ft,Hn as re,In as ie,S as Fe,T as Ee,Wn as Nt,_t as ae,b as Ct,gt as wt,v as Tt,w as kt,x as Ke,xn as oe,y as St}from"./index-BRCs87uX.js";var l=Re(lt(),1),e=Re(dt(),1),Bt="__none__";function Mt(){const i=new Date,h=i.getDay(),y=h===0?-6:1-h,u=new Date(i.getFullYear(),i.getMonth(),i.getDate()+y,0,0,0,0),j=new Date(u.getFullYear(),u.getMonth(),u.getDate()+6,23,59,59,999);return{from:u.toISOString(),to:j.toISOString()}}o(Mt,"currentWeekRange");function Pt({provider:i,rows:h}){const y=h.reduce((j,b)=>j+b.inputTokens+b.cachedInputTokens+b.outputTokens,0),u=h.reduce((j,b)=>j+b.costCents,0);return(0,e.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,e.jsx)("span",{children:J(i)}),(0,e.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:M(y)}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:m(u)})]})}o(Pt,"ProviderTabLabel");function It({biller:i,rows:h}){const y=h.reduce((j,b)=>j+b.inputTokens+b.cachedInputTokens+b.outputTokens,0),u=h.reduce((j,b)=>j+b.costCents,0);return(0,e.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,e.jsx)("span",{children:J(i)}),(0,e.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:M(y)}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:m(u)})]})}o(It,"BillerTabLabel");function C({label:i,value:h,subtitle:y,icon:u}){return(0,e.jsx)(q,{className:"block p-4",children:(0,e.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"text-(length:--text-micro) uppercase tracking-(--tracking-eyebrow) text-muted-foreground",children:i}),(0,e.jsx)("div",{className:"mt-2 text-2xl font-semibold tabular-nums",children:h}),(0,e.jsx)("div",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:y})]}),(0,e.jsx)("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-md border border-border",children:(0,e.jsx)(u,{className:"h-4 w-4 text-muted-foreground"})})]})})}o(C,"MetricTile");function _e({debitCents:i,creditCents:h,netCents:y,estimatedDebitCents:u,eventCount:j}){return(0,e.jsxs)(q,{children:[(0,e.jsxs)($,{className:"px-5 pt-5 pb-2",children:[(0,e.jsx)(L,{className:"text-base",children:"Finance ledger"}),(0,e.jsx)(R,{children:"Account-level charges that do not map to a single inference request."})]}),(0,e.jsxs)(F,{className:"grid gap-3 px-5 pb-5 pt-2 sm:grid-cols-2 xl:grid-cols-4",children:[(0,e.jsx)(C,{label:"Debits",value:m(i),subtitle:`${j} total event${j===1?"":"s"} in range`,icon:re}),(0,e.jsx)(C,{label:"Credits",value:m(h),subtitle:"Refunds, offsets, and credit returns",icon:Nt}),(0,e.jsx)(C,{label:"Net",value:m(y),subtitle:"Debit minus credit for the selected period",icon:oe}),(0,e.jsx)(C,{label:"Estimated",value:m(u),subtitle:"Estimated debits that are not yet invoice-authoritative",icon:ie})]})]})}o(_e,"FinanceSummaryCard");function Ot(){const{selectedCompanyId:i}=ut(),{setBreadcrumbs:h}=gt(),y=ct(),[u,j]=(0,l.useState)("overview"),[b,de]=(0,l.useState)("all"),[W,le]=(0,l.useState)("all"),{preset:E,setPreset:$e,customFrom:Le,setCustomFrom:We,customTo:ze,setCustomTo:Oe,from:g,to:x,customReady:D}=Ct();(0,l.useEffect)(()=>{h([{label:"Costs"}])},[h]);const[Qe,Ye]=(0,l.useState)(()=>new Date().toDateString()),X=(0,l.useRef)(null);(0,l.useEffect)(()=>{const t=o(()=>{const s=new Date,n=new Date(s.getFullYear(),s.getMonth(),s.getDate()+1).getTime()-s.getTime();X.current=setTimeout(()=>{Ye(new Date().toDateString()),t()},n)},"schedule");return t(),()=>{X.current!=null&&clearTimeout(X.current)}},[]);const P=(0,l.useMemo)(()=>Mt(),[Qe]),d=i??Bt,{data:A,isLoading:Ue,error:ce}=S({queryKey:v.budgets.overview(d),queryFn:o(()=>ae.overview(d),"queryFn"),enabled:!!i&&D,refetchInterval:3e4,staleTime:5e3}),ue=o(()=>{i&&(y.invalidateQueries({queryKey:v.budgets.overview(i)}),y.invalidateQueries({queryKey:v.dashboard(i)}),y.invalidateQueries({queryKey:v.agents.list(i)}),y.invalidateQueries({queryKey:v.projects.all(i)}))},"invalidateBudgetViews"),me=qe({mutationFn:o(t=>ae.upsertPolicy(d,{scopeType:t.scopeType,scopeId:t.scopeId,amount:t.amount,windowKind:t.windowKind}),"mutationFn"),onSuccess:ue}),K=qe({mutationFn:o(t=>ae.resolveIncident(d,t.incidentId,t),"mutationFn"),onSuccess:ue}),{data:a,isLoading:Ve,error:He}=S({queryKey:v.costs(d,g||void 0,x||void 0),queryFn:o(async()=>{const[t,s,n,r]=await Promise.all([N.summary(d,g||void 0,x||void 0),N.byAgent(d,g||void 0,x||void 0),N.byProject(d,g||void 0,x||void 0),N.byAgentModel(d,g||void 0,x||void 0)]);return{summary:t,byAgent:s,byProject:n,byAgentModel:r}},"queryFn"),enabled:!!i&&D}),{data:p,isLoading:pe,error:Z}=S({queryKey:[v.financeSummary(d,g||void 0,x||void 0),v.financeByBiller(d,g||void 0,x||void 0),v.financeByKind(d,g||void 0,x||void 0),v.financeEvents(d,g||void 0,x||void 0,18)],queryFn:o(async()=>{const[t,s,n,r]=await Promise.all([N.financeSummary(d,g||void 0,x||void 0),N.financeByBiller(d,g||void 0,x||void 0),N.financeByKind(d,g||void 0,x||void 0),N.financeEvents(d,g||void 0,x||void 0,18)]);return{summary:t,byBiller:s,byKind:n,events:r}},"queryFn"),enabled:!!i&&D}),[Ge,ge]=(0,l.useState)(new Set);(0,l.useEffect)(()=>{ge(new Set)},[d,g,x]);function Je(t){ge(s=>{const n=new Set(s);return n.has(t)?n.delete(t):n.add(t),n})}o(Je,"toggleAgent");const Xe=(0,l.useMemo)(()=>{const t=new Map;for(const s of a?.byAgentModel??[]){const n=t.get(s.agentId)??[];n.push(s),t.set(s.agentId,n)}for(const[s,n]of t)t.set(s,n.slice().sort((r,c)=>c.costCents-r.costCents));return t},[a?.byAgentModel]),{data:Q}=S({queryKey:v.usageByProvider(d,g||void 0,x||void 0),queryFn:o(()=>N.byProvider(d,g||void 0,x||void 0),"queryFn"),enabled:!!i&&D&&(u==="providers"||u==="billers"),refetchInterval:3e4,staleTime:1e4}),{data:xe}=S({queryKey:v.usageByBiller(d,g||void 0,x||void 0),queryFn:o(()=>N.byBiller(d,g||void 0,x||void 0),"queryFn"),enabled:!!i&&D&&u==="billers",refetchInterval:3e4,staleTime:1e4}),{data:he}=S({queryKey:v.usageByProvider(d,P.from,P.to),queryFn:o(()=>N.byProvider(d,P.from,P.to),"queryFn"),enabled:!!i&&(u==="providers"||u==="billers"),refetchInterval:3e4,staleTime:1e4}),{data:be}=S({queryKey:v.usageByBiller(d,P.from,P.to),queryFn:o(()=>N.byBiller(d,P.from,P.to),"queryFn"),enabled:!!i&&u==="billers",refetchInterval:3e4,staleTime:1e4}),{data:ve}=S({queryKey:v.usageWindowSpend(d),queryFn:o(()=>N.windowSpend(d),"queryFn"),enabled:!!i&&u==="providers",refetchInterval:3e4,staleTime:1e4}),{data:_,isLoading:ye}=S({queryKey:v.usageQuotaWindows(d),queryFn:o(()=>N.quotaWindows(d),"queryFn"),enabled:!!i&&u==="providers",refetchInterval:3e5,staleTime:6e4}),w=(0,l.useMemo)(()=>{const t=new Map;for(const s of Q??[]){const n=t.get(s.provider)??[];n.push(s),t.set(s.provider,n)}return t},[Q]),k=(0,l.useMemo)(()=>{const t=new Map;for(const s of xe??[]){const n=t.get(s.biller)??[];n.push(s),t.set(s.biller,n)}return t},[xe]),je=(0,l.useMemo)(()=>{const t=new Map;for(const s of he??[])t.set(s.provider,(t.get(s.provider)??0)+s.costCents);return t},[he]),fe=(0,l.useMemo)(()=>{const t=new Map;for(const s of be??[])t.set(s.biller,(t.get(s.biller)??0)+s.costCents);return t},[be]),Ne=(0,l.useMemo)(()=>{const t=new Map;for(const s of ve??[]){const n=t.get(s.provider)??[];n.push(s),t.set(s.provider,n)}return t},[ve]),Ce=(0,l.useMemo)(()=>{const t=new Map;for(const s of _??[])s.ok&&s.windows.length>0&&t.set(s.provider,s.windows);return t},[_]),we=(0,l.useMemo)(()=>{const t=new Map;for(const s of _??[])!s.ok&&s.error&&t.set(s.provider,s.error);return t},[_]),Te=(0,l.useMemo)(()=>{const t=new Map;for(const s of _??[])typeof s.source=="string"&&s.source.length>0&&t.set(s.provider,s.source);return t},[_]),ke=(0,l.useMemo)(()=>{const t=new Map;if(E!=="mtd")return t;const s=a?.summary.budgetCents??0;if(s<=0)return t;const n=a?.summary.spendCents??0,r=new Date,c=r.getDate(),T=new Date(r.getFullYear(),r.getMonth()+1,0).getDate();for(const[f,nt]of w){const ee=nt.reduce((rt,it)=>rt+it.costCents,0),Pe=s*(n>0?ee/n:0);if(Pe<=0){t.set(f,!1);continue}const at=ee/Math.max(c,1);t.set(f,ee+at*(T-c)>Pe)}return t},[E,a,w]),Y=(0,l.useMemo)(()=>Array.from(w.keys()),[w]),U=(0,l.useMemo)(()=>Array.from(k.keys()),[k]),V=b==="all"||Y.includes(b)?b:"all";(0,l.useEffect)(()=>{V!==b&&de("all")},[V,b]);const H=W==="all"||U.includes(W)?W:"all";(0,l.useEffect)(()=>{H!==W&&le("all")},[H,W]);const Ze=(0,l.useMemo)(()=>{const t=Array.from(w.keys()),s=t.reduce((r,c)=>r+(w.get(c)?.reduce((T,f)=>T+f.inputTokens+f.cachedInputTokens+f.outputTokens,0)??0),0),n=t.reduce((r,c)=>r+(w.get(c)?.reduce((T,f)=>T+f.costCents,0)??0),0);return[{value:"all",label:(0,e.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,e.jsx)("span",{children:"All providers"}),t.length>0?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:M(s)}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:m(n)})]}):null]})},...t.map(r=>({value:r,label:(0,e.jsx)(Pt,{provider:r,rows:w.get(r)??[]})}))]},[w]),et=(0,l.useMemo)(()=>{const t=Array.from(k.keys()),s=t.reduce((r,c)=>r+(k.get(c)?.reduce((T,f)=>T+f.inputTokens+f.cachedInputTokens+f.outputTokens,0)??0),0),n=t.reduce((r,c)=>r+(k.get(c)?.reduce((T,f)=>T+f.costCents,0)??0),0);return[{value:"all",label:(0,e.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,e.jsx)("span",{children:"All billers"}),t.length>0?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:M(s)}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:m(n)})]}):null]})},...t.map(r=>({value:r,label:(0,e.jsx)(It,{biller:r,rows:k.get(r)??[]})}))]},[k]),Se=(a?.byAgent??[]).reduce((t,s)=>t+s.inputTokens+s.cachedInputTokens+s.outputTokens,0),Be=p?.events??[],z=A?.policies??[],I=A?.activeIncidents??[],tt=(0,l.useMemo)(()=>({company:z.filter(t=>t.scopeType==="company"),agent:z.filter(t=>t.scopeType==="agent"),project:z.filter(t=>t.scopeType==="project")}),[z]);if(!i)return(0,e.jsx)(xt,{icon:ne,message:"Select a company to view costs."});const G=E==="custom"&&!D,st=(Ve||pe)&&D,Me=He??Z;return(0,e.jsxs)("div",{className:"space-y-6",children:[(0,e.jsxs)("div",{className:"space-y-5",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("h1",{className:"text-3xl font-semibold tracking-tight",children:"Costs"}),(0,e.jsx)("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-muted-foreground",children:"Inference spend, platform fees, credits, and live quota windows."})]}),(0,e.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:Tt.map(t=>(0,e.jsx)(vt,{variant:E===t?"secondary":"ghost",size:"sm",onClick:o(()=>$e(t),"onClick"),"aria-pressed":E===t,children:St[t]},t))})]}),E==="custom"?(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border border-border p-3",children:[(0,e.jsx)("input",{type:"date",value:Le,onChange:o(t=>We(t.target.value),"onChange"),className:"h-9 rounded-md border border-input bg-background px-3 text-sm text-foreground"}),(0,e.jsx)("span",{className:"text-sm text-muted-foreground",children:"to"}),(0,e.jsx)("input",{type:"date",value:ze,onChange:o(t=>Oe(t.target.value),"onChange"),className:"h-9 rounded-md border border-input bg-background px-3 text-sm text-foreground"})]}):null,(0,e.jsxs)("div",{className:"grid gap-3 lg:grid-cols-4",children:[(0,e.jsx)(C,{label:"Inference spend",value:m(a?.summary.spendCents??0),subtitle:`${M(Se)} tokens across request-scoped events`,icon:ne}),(0,e.jsx)(C,{label:"Budget",value:I.length>0?String(I.length):a?.summary.budgetCents&&a.summary.budgetCents>0?`${a.summary.utilizationPercent}%`:"Open",subtitle:I.length>0?`${A?.pausedAgentCount??0} agents paused · ${A?.pausedProjectCount??0} projects paused`:a?.summary.budgetCents&&a.summary.budgetCents>0?`${m(a.summary.spendCents)} of ${m(a.summary.budgetCents)}`:"No monthly cap configured",icon:ie}),(0,e.jsx)(C,{label:"Finance net",value:m(p?.summary.netCents??0),subtitle:`${m(p?.summary.debitCents??0)} debits · ${m(p?.summary.creditCents??0)} credits`,icon:oe}),(0,e.jsx)(C,{label:"Finance events",value:String(p?.summary.eventCount??0),subtitle:`${m(p?.summary.estimatedDebitCents??0)} estimated in range`,icon:re})]})]}),(0,e.jsxs)(te,{value:u,onValueChange:o(t=>j(t),"onValueChange"),children:[(0,e.jsxs)(pt,{variant:"line",className:"justify-start",children:[(0,e.jsx)(O,{value:"overview",children:"Overview"}),(0,e.jsx)(O,{value:"budgets",children:"Budgets"}),(0,e.jsx)(O,{value:"providers",children:"Providers"}),(0,e.jsx)(O,{value:"billers",children:"Billers"}),(0,e.jsx)(O,{value:"finance",children:"Finance"})]}),(0,e.jsx)(B,{value:"overview",className:"mt-4 space-y-4",children:G?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Select a start and end date to load data."}):st?(0,e.jsx)(se,{variant:"costs"}):Me?(0,e.jsx)("p",{className:"text-sm text-destructive",children:Me.message}):(0,e.jsxs)(e.Fragment,{children:[I.length>0?(0,e.jsx)("div",{className:"grid gap-4 xl:grid-cols-2",children:I.slice(0,2).map(t=>(0,e.jsx)(Ee,{incident:t,isMutating:K.isPending,onKeepPaused:o(()=>K.mutate({incidentId:t.id,action:"keep_paused"}),"onKeepPaused"),onRaiseAndResume:o(s=>K.mutate({incidentId:t.id,action:"raise_budget_and_resume",amount:s}),"onRaiseAndResume")},t.id))}):null,(0,e.jsxs)("div",{className:"grid gap-4 xl:grid-cols-(--gtc-31)",children:[(0,e.jsxs)(q,{children:[(0,e.jsxs)($,{className:"px-5 pt-5 pb-2",children:[(0,e.jsx)(L,{className:"text-base",children:"Inference ledger"}),(0,e.jsx)(R,{children:"Request-scoped inference spend for the selected period."})]}),(0,e.jsxs)(F,{className:"space-y-4 px-5 pb-5 pt-2",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-3xl font-semibold tabular-nums",children:m(a?.summary.spendCents??0)}),(0,e.jsx)("div",{className:"mt-1 text-sm text-muted-foreground",children:a?.summary.budgetCents&&a.summary.budgetCents>0?`Budget ${m(a.summary.budgetCents)}`:"Unlimited budget"})]}),(0,e.jsxs)("div",{className:"border border-border px-4 py-3 text-right",children:[(0,e.jsx)("div",{className:"text-(length:--text-micro) uppercase tracking-(--tracking-eyebrow) text-muted-foreground",children:"usage"}),(0,e.jsx)("div",{className:"mt-1 text-lg font-medium tabular-nums",children:M(Se)})]})]}),a?.summary.budgetCents&&a.summary.budgetCents>0?(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("div",{className:"h-2 overflow-hidden bg-muted",children:(0,e.jsx)("div",{className:Ie("h-full transition-(--tp-width-background-color) duration-150",a.summary.utilizationPercent>90?"bg-(--status-task-blocked)":a.summary.utilizationPercent>70?"bg-(--status-task-todo)":"bg-(--status-task-done)"),style:{width:`${Math.min(100,a.summary.utilizationPercent)}%`}})}),(0,e.jsxs)("div",{className:"text-xs text-muted-foreground",children:[a.summary.utilizationPercent,"% of monthly budget consumed in this range."]})]}):null]})]}),(0,e.jsx)(_e,{debitCents:p?.summary.debitCents??0,creditCents:p?.summary.creditCents??0,netCents:p?.summary.netCents??0,estimatedDebitCents:p?.summary.estimatedDebitCents??0,eventCount:p?.summary.eventCount??0})]}),(0,e.jsxs)("div",{className:"grid gap-4 xl:grid-cols-(--gtc-32)",children:[(0,e.jsxs)(q,{children:[(0,e.jsxs)($,{className:"px-5 pt-5 pb-2",children:[(0,e.jsx)(L,{className:"text-base",children:"By agent"}),(0,e.jsx)(R,{children:"What each agent consumed in the selected period."})]}),(0,e.jsx)(F,{className:"space-y-2 px-5 pb-5 pt-2",children:(a?.byAgent.length??0)===0?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No cost events yet."}):a?.byAgent.map(t=>{const s=Xe.get(t.agentId)??[],n=Ge.has(t.agentId),r=s.length>0;return(0,e.jsxs)("div",{className:"border border-border px-4 py-3",children:[(0,e.jsxs)("div",{className:Ie("flex items-start justify-between gap-3",r?"cursor-pointer select-none":""),onClick:o(()=>r&&Je(t.agentId),"onClick"),children:[(0,e.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[r?n?(0,e.jsx)(ht,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,e.jsx)(bt,{className:"h-3 w-3 shrink-0 text-muted-foreground"}):(0,e.jsx)("span",{className:"h-3 w-3 shrink-0"}),(0,e.jsx)(yt,{agent:{id:t.agentId,name:t.agentName??t.agentId,appearance:t.agentAppearance},size:"sm"}),t.agentStatus==="terminated"?(0,e.jsx)(ft,{status:"terminated"}):null]}),(0,e.jsxs)("div",{className:"text-right text-sm tabular-nums",children:[(0,e.jsx)("div",{className:"font-medium",children:m(t.costCents)}),(0,e.jsxs)("div",{className:"text-xs text-muted-foreground",children:["in ",M(t.inputTokens+t.cachedInputTokens)," · out ",M(t.outputTokens)]}),t.apiRunCount>0||t.subscriptionRunCount>0?(0,e.jsxs)("div",{className:"text-xs text-muted-foreground",children:[t.apiRunCount>0?`${t.apiRunCount} api`:"0 api"," · ",t.subscriptionRunCount>0?`${t.subscriptionRunCount} subscription`:"0 subscription"]}):null]})]}),n&&s.length>0?(0,e.jsx)("div",{className:"mt-3 space-y-2 border-l border-border pl-4",children:s.map(c=>{const T=t.costCents>0?Math.round(c.costCents/t.costCents*100):0;return(0,e.jsxs)("div",{className:"flex items-start justify-between gap-3 text-xs",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsxs)("div",{className:"truncate font-medium text-foreground",children:[J(c.provider),(0,e.jsx)("span",{className:"mx-1 text-border",children:"/"}),(0,e.jsx)("span",{className:"font-mono",children:c.model})]}),(0,e.jsxs)("div",{className:"truncate text-muted-foreground",children:[J(c.biller)," · ",mt(c.billingType)]})]}),(0,e.jsxs)("div",{className:"text-right tabular-nums",children:[(0,e.jsxs)("div",{className:"font-medium",children:[m(c.costCents),(0,e.jsxs)("span",{className:"ml-1 font-normal text-muted-foreground",children:["(",T,"%)"]})]}),(0,e.jsxs)("div",{className:"text-muted-foreground",children:[M(c.inputTokens+c.cachedInputTokens+c.outputTokens)," tok"]})]})]},`${c.provider}:${c.model}:${c.billingType}`)})}):null]},t.agentId)})})]}),(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)(q,{children:[(0,e.jsxs)($,{className:"px-5 pt-5 pb-2",children:[(0,e.jsx)(L,{className:"text-base",children:"By project"}),(0,e.jsx)(R,{children:"Run costs attributed through project-linked tasks."})]}),(0,e.jsx)(F,{className:"space-y-2 px-5 pb-5 pt-2",children:(a?.byProject.length??0)===0?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No project-attributed run costs yet."}):a?.byProject.map((t,s)=>(0,e.jsxs)("div",{className:"flex items-center justify-between gap-3 border border-border px-3 py-2 text-sm",children:[(0,e.jsx)("span",{className:"truncate",children:t.projectName??t.projectId??"Unattributed"}),(0,e.jsx)("span",{className:"font-medium tabular-nums",children:m(t.costCents)})]},t.projectId??`unattributed-${s}`))})]}),(0,e.jsx)(Fe,{rows:Be.slice(0,6),emptyMessage:"No finance events yet. Add account-level charges once biller invoices or credits land."})]})]})]})}),(0,e.jsx)(B,{value:"budgets",className:"mt-4 space-y-4",children:Ue?(0,e.jsx)(se,{variant:"costs"}):ce?(0,e.jsx)("p",{className:"text-sm text-destructive",children:ce.message}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(q,{className:"border-border/70 bg-(image:--gradient-extract-2)",children:[(0,e.jsxs)($,{className:"px-5 pt-5 pb-3",children:[(0,e.jsx)(L,{className:"text-base",children:"Budget control plane"}),(0,e.jsx)(R,{children:"Hard-stop spend limits for agents and projects. Provider subscription quota stays separate and appears under Providers."})]}),(0,e.jsxs)(F,{className:"grid gap-3 px-5 pb-5 pt-0 md:grid-cols-4",children:[(0,e.jsx)(C,{label:"Active incidents",value:String(I.length),subtitle:"Open soft or hard threshold crossings",icon:oe}),(0,e.jsx)(C,{label:"Pending approvals",value:String(A?.pendingApprovalCount??0),subtitle:"Budget override approvals awaiting board action",icon:re}),(0,e.jsx)(C,{label:"Paused agents",value:String(A?.pausedAgentCount??0),subtitle:"Agent heartbeats blocked by budget",icon:ie}),(0,e.jsx)(C,{label:"Paused projects",value:String(A?.pausedProjectCount??0),subtitle:"Project execution blocked by budget",icon:ne})]})]}),I.length>0?(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("h2",{className:"text-lg font-semibold",children:"Active incidents"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Resolve hard stops here by raising the budget or explicitly keeping the scope paused."})]}),(0,e.jsx)("div",{className:"grid gap-4 xl:grid-cols-2",children:I.map(t=>(0,e.jsx)(Ee,{incident:t,isMutating:K.isPending,onKeepPaused:o(()=>K.mutate({incidentId:t.id,action:"keep_paused"}),"onKeepPaused"),onRaiseAndResume:o(s=>K.mutate({incidentId:t.id,action:"raise_budget_and_resume",amount:s}),"onRaiseAndResume")},t.id))})]}):null,(0,e.jsxs)("div",{className:"space-y-5",children:[["company","agent","project"].map(t=>{const s=tt[t];return s.length===0?null:(0,e.jsxs)("section",{className:"space-y-3",children:[(0,e.jsxs)("div",{children:[(0,e.jsxs)("h2",{className:"text-lg font-semibold capitalize",children:[t," budgets"]}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:t==="company"?"Company-wide monthly policy.":t==="agent"?"Recurring monthly spend policies for individual agents.":"Lifetime spend policies for execution-bound projects."})]}),(0,e.jsx)("div",{className:"grid gap-4 xl:grid-cols-2",children:s.map(n=>(0,e.jsx)(wt,{summary:n,isSaving:me.isPending,onSave:o(r=>me.mutate({scopeType:n.scopeType,scopeId:n.scopeId,amount:r,windowKind:n.windowKind}),"onSave")},n.policyId))})]},t)}),z.length===0?(0,e.jsx)(q,{children:(0,e.jsx)(F,{className:"px-5 py-8 text-sm text-muted-foreground",children:"No budget policies yet. Set agent and project budgets from their detail pages, or use the existing company monthly budget control."})}):null]})]})}),(0,e.jsx)(B,{value:"providers",className:"mt-4 space-y-4",children:G?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Select a start and end date to load data."}):(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)(te,{value:V,onValueChange:de,children:[(0,e.jsx)(De,{items:Ze,value:V}),(0,e.jsx)(B,{value:"all",className:"mt-4",children:Y.length===0?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No cost events in this period."}):(0,e.jsx)("div",{className:"grid gap-4 md:grid-cols-2",children:Y.map(t=>(0,e.jsx)(Ke,{provider:t,rows:w.get(t)??[],budgetMonthlyCents:a?.summary.budgetCents??0,totalCompanySpendCents:a?.summary.spendCents??0,weekSpendCents:je.get(t)??0,windowRows:Ne.get(t)??[],showDeficitNotch:ke.get(t)??!1,quotaWindows:Ce.get(t)??[],quotaError:we.get(t)??null,quotaSource:Te.get(t)??null,quotaLoading:ye},t))})}),Y.map(t=>(0,e.jsx)(B,{value:t,className:"mt-4",children:(0,e.jsx)(Ke,{provider:t,rows:w.get(t)??[],budgetMonthlyCents:a?.summary.budgetCents??0,totalCompanySpendCents:a?.summary.spendCents??0,weekSpendCents:je.get(t)??0,windowRows:Ne.get(t)??[],showDeficitNotch:ke.get(t)??!1,quotaWindows:Ce.get(t)??[],quotaError:we.get(t)??null,quotaSource:Te.get(t)??null,quotaLoading:ye})},t))]})})}),(0,e.jsx)(B,{value:"billers",className:"mt-4 space-y-4",children:G?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Select a start and end date to load data."}):(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)(te,{value:H,onValueChange:le,children:[(0,e.jsx)(De,{items:et,value:H}),(0,e.jsx)(B,{value:"all",className:"mt-4",children:U.length===0?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No billable events in this period."}):(0,e.jsx)("div",{className:"grid gap-4 md:grid-cols-2",children:U.map(t=>{const s=(k.get(t)??[])[0];if(!s)return null;const n=(Q??[]).filter(r=>r.biller===t);return(0,e.jsx)(Ae,{row:s,weekSpendCents:fe.get(t)??0,budgetMonthlyCents:a?.summary.budgetCents??0,totalCompanySpendCents:a?.summary.spendCents??0,providerRows:n},t)})})}),U.map(t=>{const s=(k.get(t)??[])[0];if(!s)return null;const n=(Q??[]).filter(r=>r.biller===t);return(0,e.jsx)(B,{value:t,className:"mt-4",children:(0,e.jsx)(Ae,{row:s,weekSpendCents:fe.get(t)??0,budgetMonthlyCents:a?.summary.budgetCents??0,totalCompanySpendCents:a?.summary.spendCents??0,providerRows:n})},t)})]})})}),(0,e.jsx)(B,{value:"finance",className:"mt-4 space-y-4",children:G?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Select a start and end date to load data."}):pe?(0,e.jsx)(se,{variant:"costs"}):Z?(0,e.jsx)("p",{className:"text-sm text-destructive",children:Z.message}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(_e,{debitCents:p?.summary.debitCents??0,creditCents:p?.summary.creditCents??0,netCents:p?.summary.netCents??0,estimatedDebitCents:p?.summary.estimatedDebitCents??0,eventCount:p?.summary.eventCount??0}),(0,e.jsxs)("div",{className:"grid gap-4 xl:grid-cols-(--gtc-33)",children:[(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)(q,{children:[(0,e.jsxs)($,{className:"px-5 pt-5 pb-2",children:[(0,e.jsx)(L,{className:"text-base",children:"By biller"}),(0,e.jsx)(R,{children:"Account-level financial events grouped by who charged or credited them."})]}),(0,e.jsx)(F,{className:"grid gap-4 px-5 pb-5 pt-2 md:grid-cols-2",children:(p?.byBiller.length??0)===0?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No finance events yet."}):p?.byBiller.map(t=>(0,e.jsx)(kt,{row:t},t.biller))})]}),(0,e.jsx)(Fe,{rows:Be})]}),(0,e.jsx)(jt,{rows:p?.byKind??[]})]})]})})]})]})}o(Ot,"Costs");export{Ot as Costs};
@@ -1 +1 @@
1
- var j=Object.defineProperty;var l=(e,a)=>j(e,"name",{value:a,configurable:!0});import{i as k}from"./rolldown-runtime-ZpX3ckPj.js";import{Fr as T,Lr as M,S as B,t as u}from"./createLucideIcon-CINAT48M.js";import{A as x,T as N,j as P,k as w,t as E}from"./button-BYQHEF4e.js";var I=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],q=u("ban",I),D=[["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"}]],p=u("circle-dashed",D),F=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],K=u("circle-dot",F),L=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]],h=u("circle-minus",L),t=k(T(),1),$={sm:14,md:16,lg:20},z=u("TaskProgressSpinner",[["circle",{cx:"12",cy:"12",r:"10",pathLength:"100",strokeDasharray:"80 20",key:"progress"}]]),A={idle:x,backlog:p,todo:x,in_progress:z,in_review:K,done:P,blocked:h,cancelled:q,in_queue:h},U=p;function Q({status:e,size:a="md",className:r,title:s}){const n=$[a],i=A[e]??U,d=N[e]??"--status-task-icon-backlog",m=s?{role:"img","aria-label":s}:{"aria-hidden":!0};return(0,t.jsx)(i,{size:n,className:B("inline-block shrink-0 align-middle",e==="in_progress"&&"motion-safe:animate-spin",r),style:{color:`var(${d})`},...m,children:s?(0,t.jsx)("title",{children:s}):null})}l(Q,"StatusGlyph");var c=k(M(),1),y=(0,c.createContext)(null);function V(e,a){if(e===a)return!0;if(e.length!==a.length)return!1;for(let r=0;r<e.length;r+=1)if(e[r]?.label!==a[r]?.label||e[r]?.onClick!==a[r]?.onClick||e[r]?.href!==a[r]?.href||e[r]?.identifier!==a[r]?.identifier||e[r]?.leadingKey!==a[r]?.leadingKey||e[r]?.trailingKey!==a[r]?.trailingKey)return!1;return!0}l(V,"breadcrumbsEqual");function O(e,a){const r=e.length===0?[]:[...e].reverse().map(n=>n.label),s=a?.trim()?[a.trim()]:[];return[...r,...s,"Paperclip"].join(" • ")}l(O,"buildDocumentTitle");function R({children:e,companyName:a}){const[r,s]=(0,c.useState)([]),[n,i]=(0,c.useState)(null),[d,m]=(0,c.useState)(null),[f,v]=(0,c.useState)(null),g=(0,c.useCallback)(o=>{s(b=>V(b,o)?b:o)},[]),_=(0,c.useCallback)(o=>{v(o)},[]),C=(0,c.useCallback)(o=>{i(o)},[]),S=(0,c.useCallback)(o=>{m(o)},[]);return(0,c.useEffect)(()=>{document.title=O(r,a)},[r,a]),(0,t.jsx)(y.Provider,{value:{breadcrumbs:r,setBreadcrumbs:g,breadcrumbToolbar:n,setBreadcrumbToolbar:C,breadcrumbPanelControl:d,setBreadcrumbPanelControl:S,mobileToolbar:f,setMobileToolbar:_},children:e})}l(R,"BreadcrumbProvider");function W(){const e=(0,c.useContext)(y);if(!e)throw new Error("useBreadcrumbs must be used within BreadcrumbProvider");return e}l(W,"useBreadcrumbs");function Y({icon:e,title:a,message:r,description:s,action:n,onAction:i,hideActionIcon:d=!1}){return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[(0,t.jsx)("div",{className:"bg-muted/50 p-4 mb-4",children:(0,t.jsx)(e,{className:"h-10 w-10 text-muted-foreground/50"})}),a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-base font-semibold text-foreground mb-1.5",children:a}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-4 max-w-md",children:r})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:r}),s&&(0,t.jsx)("p",{className:"max-w-md text-sm text-muted-foreground mb-4",children:s})]}),n&&i&&(0,t.jsxs)(E,{onClick:i,children:[!d&&(0,t.jsx)(w,{className:"h-4 w-4 mr-1.5"}),n]})]})}l(Y,"EmptyState");export{h as a,q as c,Q as i,R as n,K as o,W as r,p as s,Y as t};
1
+ var j=Object.defineProperty;var l=(e,a)=>j(e,"name",{value:a,configurable:!0});import{i as k}from"./rolldown-runtime-ZpX3ckPj.js";import{Fr as T,Lr as M,S as B,t as u}from"./createLucideIcon-CZEG6UJ7.js";import{A as x,T as N,j as P,k as w,t as E}from"./button-LkWt40cm.js";var I=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],q=u("ban",I),D=[["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"}]],p=u("circle-dashed",D),F=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],K=u("circle-dot",F),L=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]],h=u("circle-minus",L),t=k(T(),1),$={sm:14,md:16,lg:20},z=u("TaskProgressSpinner",[["circle",{cx:"12",cy:"12",r:"10",pathLength:"100",strokeDasharray:"80 20",key:"progress"}]]),A={idle:x,backlog:p,todo:x,in_progress:z,in_review:K,done:P,blocked:h,cancelled:q,in_queue:h},U=p;function Q({status:e,size:a="md",className:r,title:s}){const n=$[a],i=A[e]??U,d=N[e]??"--status-task-icon-backlog",m=s?{role:"img","aria-label":s}:{"aria-hidden":!0};return(0,t.jsx)(i,{size:n,className:B("inline-block shrink-0 align-middle",e==="in_progress"&&"motion-safe:animate-spin",r),style:{color:`var(${d})`},...m,children:s?(0,t.jsx)("title",{children:s}):null})}l(Q,"StatusGlyph");var c=k(M(),1),y=(0,c.createContext)(null);function V(e,a){if(e===a)return!0;if(e.length!==a.length)return!1;for(let r=0;r<e.length;r+=1)if(e[r]?.label!==a[r]?.label||e[r]?.onClick!==a[r]?.onClick||e[r]?.href!==a[r]?.href||e[r]?.identifier!==a[r]?.identifier||e[r]?.leadingKey!==a[r]?.leadingKey||e[r]?.trailingKey!==a[r]?.trailingKey)return!1;return!0}l(V,"breadcrumbsEqual");function O(e,a){const r=e.length===0?[]:[...e].reverse().map(n=>n.label),s=a?.trim()?[a.trim()]:[];return[...r,...s,"Paperclip"].join(" • ")}l(O,"buildDocumentTitle");function R({children:e,companyName:a}){const[r,s]=(0,c.useState)([]),[n,i]=(0,c.useState)(null),[d,m]=(0,c.useState)(null),[f,v]=(0,c.useState)(null),g=(0,c.useCallback)(o=>{s(b=>V(b,o)?b:o)},[]),_=(0,c.useCallback)(o=>{v(o)},[]),C=(0,c.useCallback)(o=>{i(o)},[]),S=(0,c.useCallback)(o=>{m(o)},[]);return(0,c.useEffect)(()=>{document.title=O(r,a)},[r,a]),(0,t.jsx)(y.Provider,{value:{breadcrumbs:r,setBreadcrumbs:g,breadcrumbToolbar:n,setBreadcrumbToolbar:C,breadcrumbPanelControl:d,setBreadcrumbPanelControl:S,mobileToolbar:f,setMobileToolbar:_},children:e})}l(R,"BreadcrumbProvider");function W(){const e=(0,c.useContext)(y);if(!e)throw new Error("useBreadcrumbs must be used within BreadcrumbProvider");return e}l(W,"useBreadcrumbs");function Y({icon:e,title:a,message:r,description:s,action:n,onAction:i,hideActionIcon:d=!1}){return(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[(0,t.jsx)("div",{className:"bg-muted/50 p-4 mb-4",children:(0,t.jsx)(e,{className:"h-10 w-10 text-muted-foreground/50"})}),a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-base font-semibold text-foreground mb-1.5",children:a}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-4 max-w-md",children:r})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"text-sm font-medium text-foreground mb-1",children:r}),s&&(0,t.jsx)("p",{className:"max-w-md text-sm text-muted-foreground mb-4",children:s})]}),n&&i&&(0,t.jsxs)(E,{onClick:i,children:[!d&&(0,t.jsx)(w,{className:"h-4 w-4 mr-1.5"}),n]})]})}l(Y,"EmptyState");export{h as a,q as c,Q as i,R as n,K as o,W as r,p as s,Y as t};
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-G_BSi0G0.js","assets/preload-helper-CceJXRIF.js","assets/chunk-Y2CYZVJY-OvsAdhaO.js","assets/src-Bssc388C.js","assets/rolldown-runtime-ZpX3ckPj.js","assets/chunk-DU6HZSFF-2P5iNHqg.js","assets/chunk-75Z2AOVW-BaPl5WA6.js","assets/dist-Cj4C2HPs.js","assets/chunk-PWAF6VOD-CR3rNBNB.js","assets/chunk-GMAD6QVW-BfvaaEBW.js","assets/chunk-P2QGCYS3-CjqEi3mx.js","assets/chunk-4HAMMTFA-CGGd_Pxz.js","assets/rough.esm-DnC5Tr1g.js","assets/chunk-GVQU2GXP-Cwp_Wpj2.js","assets/chunk-OSK3NFVY-DlrxddG-.js","assets/line-CJEZO7lL.js","assets/path-D6mommQw.js","assets/array-CL5Tisss.js","assets/graphlib-DHhK3saS.js","assets/chunk-L3NEJ4N5-JUd1UqX1.js"])))=>i.map(i=>d[i]);
2
- var xn=Object.defineProperty;var o=(e,t)=>xn(e,"name",{value:t,configurable:!0});import{i as ye,n as Sn,t as ie}from"./rolldown-runtime-ZpX3ckPj.js";import{Fr as Bn,Lr as In,Pr as Pn,S as H,W as Ln,Xn as fe,Y as St,nr as Rn,t as Bt}from"./createLucideIcon-CINAT48M.js";import{t as jn}from"./preload-helper-CceJXRIF.js";import{B as Tn,a as Nn,c as _n,it as It,o as On,s as Mn,t as Ue}from"./router-DcMYq5w_.js";import{C as zn,D as Pt,F as Re,H as re,I as tt,J as He,K as $,L as $n,P as T,R as Un,S as Hn,U as le,W as Wn,Y as Z,_ as Vn,c as Kn,d as qn,f as Xn,g as ue,h as Yn,i as Lt,j as We,k as nt,l as Gn,m as Zn,p as Jn,r as Qn,u as er,x as Ve,z as tr}from"./mention-chips-r4UB4Eiw.js";import{c as nr,d as rr,h as rt,i as Rt,l as lr,m as or,n as ir,t as ur,u as jt,y as ar}from"./StatusIcon-BYqGFWup.js";import{t as sr}from"./check-Cniv3It0.js";import{p as cr}from"./button-BYQHEF4e.js";import{i as pr,r as fr,t as hr}from"./clipboard-CfEDu5my.js";import{t as dr}from"./external-link-3uv6Ak2X.js";var mr=[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],Dr=Bt("file-code-corner",mr),gr=[["path",{d:"m16 16-3 3 3 3",key:"117b85"}],["path",{d:"M3 12h14.5a1 1 0 0 1 0 7H13",key:"18xa6z"}],["path",{d:"M3 19h6",key:"1ygdsz"}],["path",{d:"M3 5h18",key:"1u36vt"}]],Fr=Bt("text-wrap",gr);function J(e){const t=[];let n=-1,r=0,l=0;for(;++n<e.length;){const u=e.charCodeAt(n);let i="";if(u===37&&le(e.charCodeAt(n+1))&&le(e.charCodeAt(n+2)))l=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(i=String.fromCharCode(u));else if(u>55295&&u<57344){const a=e.charCodeAt(n+1);u<56320&&a>56319&&a<57344?(i=String.fromCharCode(u,a),l=1):i="�"}else i=String.fromCharCode(u);i&&(t.push(e.slice(r,n),encodeURIComponent(i)),r=n+l+1,i=""),l&&(n+=l,l=0)}return t.join("")+e.slice(r)}o(J,"normalizeUri");var w=ye(In(),1),g=ye(Bn(),1);function yr(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}o(yr,"escapeStringRegexp");var Tt="paperclip.theme",wr="#18181b",Cr="#ffffff",Nt=(0,w.createContext)(void 0);function kr(){return typeof document>"u"||document.documentElement.classList.contains("dark")?"dark":"light"}o(kr,"resolveThemeFromDocument");function Er(){if(typeof window>"u")return!1;try{const e=window.localStorage.getItem(Tt);return e==="light"||e==="dark"}catch{return!1}}o(Er,"hasStoredTheme");function Ar(e){if(typeof document>"u")return;const t=e==="dark",n=document.documentElement;n.classList.toggle("dark",t),n.style.colorScheme=t?"dark":"light";const r=document.querySelector('meta[name="theme-color"]');r instanceof HTMLMetaElement&&r.setAttribute("content",t?wr:Cr)}o(Ar,"applyTheme");function oa({children:e}){const[t,n]=(0,w.useState)(()=>kr()),[r,l]=(0,w.useState)(()=>Er()),u=(0,w.useCallback)(c=>{l(!0),n(c)},[]),i=(0,w.useCallback)(()=>{l(!0),n(c=>c==="dark"?"light":"dark")},[]);(0,w.useEffect)(()=>{if(Ar(t),!!r)try{localStorage.setItem(Tt,t)}catch{}},[t,r]),(0,w.useEffect)(()=>{if(r||typeof window>"u"||typeof window.matchMedia!="function")return;const c=window.matchMedia("(prefers-color-scheme: dark)"),p=o(f=>{n(f.matches?"dark":"light")},"handleChange");return c.addEventListener("change",p),()=>c.removeEventListener("change",p)},[r]);const a=(0,w.useMemo)(()=>({theme:t,setTheme:u,toggleTheme:i}),[t,u,i]);return(0,g.jsx)(Nt.Provider,{value:a,children:e})}o(oa,"ThemeProvider");function vr(){const e=(0,w.useContext)(Nt);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}o(vr,"useTheme");function br(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}o(br,"stringify$1");var xr=/[ \t\n\f\r]/g;function Sr(e){return typeof e=="object"?e.type==="text"?lt(e.value):!1:lt(e)}o(Sr,"whitespace");function lt(e){return e.replace(xr,"")===""}o(lt,"empty");var ae=class{static{o(this,"Schema")}constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};ae.prototype.normal={};ae.prototype.property={};ae.prototype.space=void 0;function _t(e,t){const n={},r={};for(const l of e)Object.assign(n,l.property),Object.assign(r,l.normal);return new ae(n,r,t)}o(_t,"merge");function je(e){return e.toLowerCase()}o(je,"normalize$1");var N=class{static{o(this,"Info")}constructor(e,t){this.attribute=t,this.property=e}};N.prototype.attribute="";N.prototype.booleanish=!1;N.prototype.boolean=!1;N.prototype.commaOrSpaceSeparated=!1;N.prototype.commaSeparated=!1;N.prototype.defined=!1;N.prototype.mustUseProperty=!1;N.prototype.number=!1;N.prototype.overloadedBoolean=!1;N.prototype.property="";N.prototype.spaceSeparated=!1;N.prototype.space=void 0;var Te=Sn({boolean:o(()=>v,"boolean"),booleanish:o(()=>L,"booleanish"),commaOrSpaceSeparated:o(()=>M,"commaOrSpaceSeparated"),commaSeparated:o(()=>X,"commaSeparated"),number:o(()=>m,"number"),overloadedBoolean:o(()=>Ne,"overloadedBoolean"),spaceSeparated:o(()=>P,"spaceSeparated")}),Br=0,v=Y(),L=Y(),Ne=Y(),m=Y(),P=Y(),X=Y(),M=Y();function Y(){return 2**++Br}o(Y,"increment");var we=Object.keys(Te),Ke=class extends N{static{o(this,"DefinedInfo")}constructor(e,t,n,r){let l=-1;if(super(e,t),ot(this,"space",r),typeof n=="number")for(;++l<we.length;){const u=we[l];ot(this,we[l],(n&Te[u])===Te[u])}}};Ke.prototype.defined=!0;function ot(e,t,n){n&&(e[t]=n)}o(ot,"mark");function Q(e){const t={},n={};for(const[r,l]of Object.entries(e.properties)){const u=new Ke(r,e.transform(e.attributes||{},r),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(u.mustUseProperty=!0),t[r]=u,n[je(r)]=r,n[je(u.attribute)]=r}return new ae(t,n,e.space)}o(Q,"create");var Ot=Q({properties:{ariaActiveDescendant:null,ariaAtomic:L,ariaAutoComplete:null,ariaBusy:L,ariaChecked:L,ariaColCount:m,ariaColIndex:m,ariaColSpan:m,ariaControls:P,ariaCurrent:null,ariaDescribedBy:P,ariaDetails:null,ariaDisabled:L,ariaDropEffect:P,ariaErrorMessage:null,ariaExpanded:L,ariaFlowTo:P,ariaGrabbed:L,ariaHasPopup:null,ariaHidden:L,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:P,ariaLevel:m,ariaLive:null,ariaModal:L,ariaMultiLine:L,ariaMultiSelectable:L,ariaOrientation:null,ariaOwns:P,ariaPlaceholder:null,ariaPosInSet:m,ariaPressed:L,ariaReadOnly:L,ariaRelevant:null,ariaRequired:L,ariaRoleDescription:P,ariaRowCount:m,ariaRowIndex:m,ariaRowSpan:m,ariaSelected:L,ariaSetSize:m,ariaSort:null,ariaValueMax:m,ariaValueMin:m,ariaValueNow:m,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Mt(e,t){return t in e?e[t]:t}o(Mt,"caseSensitiveTransform");function zt(e,t){return Mt(e,t.toLowerCase())}o(zt,"caseInsensitiveTransform");var Ir=Q({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:X,acceptCharset:P,accessKey:P,action:null,allow:null,allowFullScreen:v,allowPaymentRequest:v,allowUserMedia:v,alpha:v,alt:null,as:null,async:v,autoCapitalize:null,autoComplete:P,autoFocus:v,autoPlay:v,blocking:P,capture:null,charSet:null,checked:v,cite:null,className:P,closedBy:null,colorSpace:null,cols:m,colSpan:m,command:null,commandFor:null,content:null,contentEditable:L,controls:v,controlsList:P,coords:m|X,crossOrigin:null,data:null,dateTime:null,decoding:null,default:v,defer:v,dir:null,dirName:null,disabled:v,download:Ne,draggable:L,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:v,formTarget:null,headers:P,height:m,hidden:Ne,high:m,href:null,hrefLang:null,htmlFor:P,httpEquiv:P,id:null,imageSizes:null,imageSrcSet:null,inert:v,inputMode:null,integrity:null,is:null,isMap:v,itemId:null,itemProp:P,itemRef:P,itemScope:v,itemType:P,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:v,low:m,manifest:null,max:null,maxLength:m,media:null,method:null,min:null,minLength:m,multiple:v,muted:v,name:null,nonce:null,noModule:v,noValidate:v,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:v,optimum:m,pattern:null,ping:P,placeholder:null,playsInline:v,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:v,referrerPolicy:null,rel:P,required:v,reversed:v,rows:m,rowSpan:m,sandbox:P,scope:null,scoped:v,seamless:v,selected:v,shadowRootClonable:v,shadowRootCustomElementRegistry:v,shadowRootDelegatesFocus:v,shadowRootMode:null,shadowRootSerializable:v,shape:null,size:m,sizes:null,slot:null,span:m,spellCheck:L,src:null,srcDoc:null,srcLang:null,srcSet:null,start:m,step:null,style:null,tabIndex:m,target:null,title:null,translate:null,type:null,typeMustMatch:v,useMap:null,value:L,width:m,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:P,axis:null,background:null,bgColor:null,border:m,borderColor:null,bottomMargin:m,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:v,declare:v,event:null,face:null,frame:null,frameBorder:null,hSpace:m,leftMargin:m,link:null,longDesc:null,lowSrc:null,marginHeight:m,marginWidth:m,noResize:v,noHref:v,noShade:v,noWrap:v,object:null,profile:null,prompt:null,rev:null,rightMargin:m,rules:null,scheme:null,scrolling:L,standby:null,summary:null,text:null,topMargin:m,valueType:null,version:null,vAlign:null,vLink:null,vSpace:m,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:v,disablePictureInPicture:v,disableRemotePlayback:v,exportParts:X,part:P,prefix:null,property:null,results:m,security:null,unselectable:null},space:"html",transform:zt}),Pr=Q({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:M,accentHeight:m,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:m,amplitude:m,arabicForm:null,ascent:m,attributeName:null,attributeType:null,azimuth:m,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:m,by:null,calcMode:null,capHeight:m,className:P,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:m,diffuseConstant:m,direction:null,display:null,dur:null,divisor:m,dominantBaseline:null,download:v,dx:null,dy:null,edgeMode:null,editable:null,elevation:m,enableBackground:null,end:null,event:null,exponent:m,externalResourcesRequired:null,fill:null,fillOpacity:m,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:X,g2:X,glyphName:X,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:m,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:m,horizOriginX:m,horizOriginY:m,id:null,ideographic:m,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:m,k:m,k1:m,k2:m,k3:m,k4:m,kernelMatrix:M,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:m,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:m,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:m,overlineThickness:m,paintOrder:null,panose1:null,path:null,pathLength:m,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:P,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:m,pointsAtY:m,pointsAtZ:m,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:M,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:M,rev:M,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:M,requiredFeatures:M,requiredFonts:M,requiredFormats:M,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:m,specularExponent:m,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:m,strikethroughThickness:m,string:null,stroke:null,strokeDashArray:M,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:m,strokeOpacity:m,strokeWidth:null,style:null,surfaceScale:m,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:M,tabIndex:m,tableValues:null,target:null,targetX:m,targetY:m,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:M,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:m,underlineThickness:m,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:m,values:null,vAlphabetic:m,vMathematical:m,vectorEffect:null,vHanging:m,vIdeographic:m,version:null,vertAdvY:m,vertOriginX:m,vertOriginY:m,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:m,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Mt}),$t=Q({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Ut=Q({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:zt}),Ht=Q({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Lr={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Rr=/[A-Z]/g,it=/-[a-z]/g,jr=/^data[-\w.:]+$/i;function Tr(e,t){const n=je(t);let r=t,l=N;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&jr.test(t)){if(t.charAt(4)==="-"){const u=t.slice(5).replace(it,_r);r="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=t.slice(4);if(!it.test(u)){let i=u.replace(Rr,Nr);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}l=Ke}return new l(r,t)}o(Tr,"find");function Nr(e){return"-"+e.toLowerCase()}o(Nr,"kebab");function _r(e){return e.charAt(1).toUpperCase()}o(_r,"camelcase");var Or=_t([Ot,Ir,$t,Ut,Ht],"html"),qe=_t([Ot,Pr,$t,Ut,Ht],"svg");function Mr(e){return e.join(" ").trim()}o(Mr,"stringify");var zr=ie(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,l=/^\s*/,u=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,p=/^\s+|\s+$/g,f=`
2
+ var xn=Object.defineProperty;var o=(e,t)=>xn(e,"name",{value:t,configurable:!0});import{i as ye,n as Sn,t as ie}from"./rolldown-runtime-ZpX3ckPj.js";import{Fr as Bn,Lr as In,Pr as Pn,S as H,W as Ln,Xn as fe,Y as St,nr as Rn,t as Bt}from"./createLucideIcon-CZEG6UJ7.js";import{t as jn}from"./preload-helper-CceJXRIF.js";import{B as Tn,a as Nn,c as _n,it as It,o as On,s as Mn,t as Ue}from"./router-G1KztA90.js";import{C as zn,D as Pt,F as Re,H as re,I as tt,J as He,K as $,L as $n,P as T,R as Un,S as Hn,U as le,W as Wn,Y as Z,_ as Vn,c as Kn,d as qn,f as Xn,g as ue,h as Yn,i as Lt,j as We,k as nt,l as Gn,m as Zn,p as Jn,r as Qn,u as er,x as Ve,z as tr}from"./mention-chips-BEaOTvHT.js";import{c as nr,d as rr,h as rt,i as Rt,l as lr,m as or,n as ir,t as ur,u as jt,y as ar}from"./StatusIcon-j05cEqDO.js";import{t as sr}from"./check-CgfxcCMv.js";import{p as cr}from"./button-LkWt40cm.js";import{i as pr,r as fr,t as hr}from"./clipboard-CjMs5cp9.js";import{t as dr}from"./external-link-BbeUY6zf.js";var mr=[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],Dr=Bt("file-code-corner",mr),gr=[["path",{d:"m16 16-3 3 3 3",key:"117b85"}],["path",{d:"M3 12h14.5a1 1 0 0 1 0 7H13",key:"18xa6z"}],["path",{d:"M3 19h6",key:"1ygdsz"}],["path",{d:"M3 5h18",key:"1u36vt"}]],Fr=Bt("text-wrap",gr);function J(e){const t=[];let n=-1,r=0,l=0;for(;++n<e.length;){const u=e.charCodeAt(n);let i="";if(u===37&&le(e.charCodeAt(n+1))&&le(e.charCodeAt(n+2)))l=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(i=String.fromCharCode(u));else if(u>55295&&u<57344){const a=e.charCodeAt(n+1);u<56320&&a>56319&&a<57344?(i=String.fromCharCode(u,a),l=1):i="�"}else i=String.fromCharCode(u);i&&(t.push(e.slice(r,n),encodeURIComponent(i)),r=n+l+1,i=""),l&&(n+=l,l=0)}return t.join("")+e.slice(r)}o(J,"normalizeUri");var w=ye(In(),1),g=ye(Bn(),1);function yr(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}o(yr,"escapeStringRegexp");var Tt="paperclip.theme",wr="#18181b",Cr="#ffffff",Nt=(0,w.createContext)(void 0);function kr(){return typeof document>"u"||document.documentElement.classList.contains("dark")?"dark":"light"}o(kr,"resolveThemeFromDocument");function Er(){if(typeof window>"u")return!1;try{const e=window.localStorage.getItem(Tt);return e==="light"||e==="dark"}catch{return!1}}o(Er,"hasStoredTheme");function Ar(e){if(typeof document>"u")return;const t=e==="dark",n=document.documentElement;n.classList.toggle("dark",t),n.style.colorScheme=t?"dark":"light";const r=document.querySelector('meta[name="theme-color"]');r instanceof HTMLMetaElement&&r.setAttribute("content",t?wr:Cr)}o(Ar,"applyTheme");function oa({children:e}){const[t,n]=(0,w.useState)(()=>kr()),[r,l]=(0,w.useState)(()=>Er()),u=(0,w.useCallback)(c=>{l(!0),n(c)},[]),i=(0,w.useCallback)(()=>{l(!0),n(c=>c==="dark"?"light":"dark")},[]);(0,w.useEffect)(()=>{if(Ar(t),!!r)try{localStorage.setItem(Tt,t)}catch{}},[t,r]),(0,w.useEffect)(()=>{if(r||typeof window>"u"||typeof window.matchMedia!="function")return;const c=window.matchMedia("(prefers-color-scheme: dark)"),p=o(f=>{n(f.matches?"dark":"light")},"handleChange");return c.addEventListener("change",p),()=>c.removeEventListener("change",p)},[r]);const a=(0,w.useMemo)(()=>({theme:t,setTheme:u,toggleTheme:i}),[t,u,i]);return(0,g.jsx)(Nt.Provider,{value:a,children:e})}o(oa,"ThemeProvider");function vr(){const e=(0,w.useContext)(Nt);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}o(vr,"useTheme");function br(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}o(br,"stringify$1");var xr=/[ \t\n\f\r]/g;function Sr(e){return typeof e=="object"?e.type==="text"?lt(e.value):!1:lt(e)}o(Sr,"whitespace");function lt(e){return e.replace(xr,"")===""}o(lt,"empty");var ae=class{static{o(this,"Schema")}constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};ae.prototype.normal={};ae.prototype.property={};ae.prototype.space=void 0;function _t(e,t){const n={},r={};for(const l of e)Object.assign(n,l.property),Object.assign(r,l.normal);return new ae(n,r,t)}o(_t,"merge");function je(e){return e.toLowerCase()}o(je,"normalize$1");var N=class{static{o(this,"Info")}constructor(e,t){this.attribute=t,this.property=e}};N.prototype.attribute="";N.prototype.booleanish=!1;N.prototype.boolean=!1;N.prototype.commaOrSpaceSeparated=!1;N.prototype.commaSeparated=!1;N.prototype.defined=!1;N.prototype.mustUseProperty=!1;N.prototype.number=!1;N.prototype.overloadedBoolean=!1;N.prototype.property="";N.prototype.spaceSeparated=!1;N.prototype.space=void 0;var Te=Sn({boolean:o(()=>v,"boolean"),booleanish:o(()=>L,"booleanish"),commaOrSpaceSeparated:o(()=>M,"commaOrSpaceSeparated"),commaSeparated:o(()=>X,"commaSeparated"),number:o(()=>m,"number"),overloadedBoolean:o(()=>Ne,"overloadedBoolean"),spaceSeparated:o(()=>P,"spaceSeparated")}),Br=0,v=Y(),L=Y(),Ne=Y(),m=Y(),P=Y(),X=Y(),M=Y();function Y(){return 2**++Br}o(Y,"increment");var we=Object.keys(Te),Ke=class extends N{static{o(this,"DefinedInfo")}constructor(e,t,n,r){let l=-1;if(super(e,t),ot(this,"space",r),typeof n=="number")for(;++l<we.length;){const u=we[l];ot(this,we[l],(n&Te[u])===Te[u])}}};Ke.prototype.defined=!0;function ot(e,t,n){n&&(e[t]=n)}o(ot,"mark");function Q(e){const t={},n={};for(const[r,l]of Object.entries(e.properties)){const u=new Ke(r,e.transform(e.attributes||{},r),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(u.mustUseProperty=!0),t[r]=u,n[je(r)]=r,n[je(u.attribute)]=r}return new ae(t,n,e.space)}o(Q,"create");var Ot=Q({properties:{ariaActiveDescendant:null,ariaAtomic:L,ariaAutoComplete:null,ariaBusy:L,ariaChecked:L,ariaColCount:m,ariaColIndex:m,ariaColSpan:m,ariaControls:P,ariaCurrent:null,ariaDescribedBy:P,ariaDetails:null,ariaDisabled:L,ariaDropEffect:P,ariaErrorMessage:null,ariaExpanded:L,ariaFlowTo:P,ariaGrabbed:L,ariaHasPopup:null,ariaHidden:L,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:P,ariaLevel:m,ariaLive:null,ariaModal:L,ariaMultiLine:L,ariaMultiSelectable:L,ariaOrientation:null,ariaOwns:P,ariaPlaceholder:null,ariaPosInSet:m,ariaPressed:L,ariaReadOnly:L,ariaRelevant:null,ariaRequired:L,ariaRoleDescription:P,ariaRowCount:m,ariaRowIndex:m,ariaRowSpan:m,ariaSelected:L,ariaSetSize:m,ariaSort:null,ariaValueMax:m,ariaValueMin:m,ariaValueNow:m,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Mt(e,t){return t in e?e[t]:t}o(Mt,"caseSensitiveTransform");function zt(e,t){return Mt(e,t.toLowerCase())}o(zt,"caseInsensitiveTransform");var Ir=Q({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:X,acceptCharset:P,accessKey:P,action:null,allow:null,allowFullScreen:v,allowPaymentRequest:v,allowUserMedia:v,alpha:v,alt:null,as:null,async:v,autoCapitalize:null,autoComplete:P,autoFocus:v,autoPlay:v,blocking:P,capture:null,charSet:null,checked:v,cite:null,className:P,closedBy:null,colorSpace:null,cols:m,colSpan:m,command:null,commandFor:null,content:null,contentEditable:L,controls:v,controlsList:P,coords:m|X,crossOrigin:null,data:null,dateTime:null,decoding:null,default:v,defer:v,dir:null,dirName:null,disabled:v,download:Ne,draggable:L,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:v,formTarget:null,headers:P,height:m,hidden:Ne,high:m,href:null,hrefLang:null,htmlFor:P,httpEquiv:P,id:null,imageSizes:null,imageSrcSet:null,inert:v,inputMode:null,integrity:null,is:null,isMap:v,itemId:null,itemProp:P,itemRef:P,itemScope:v,itemType:P,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:v,low:m,manifest:null,max:null,maxLength:m,media:null,method:null,min:null,minLength:m,multiple:v,muted:v,name:null,nonce:null,noModule:v,noValidate:v,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:v,optimum:m,pattern:null,ping:P,placeholder:null,playsInline:v,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:v,referrerPolicy:null,rel:P,required:v,reversed:v,rows:m,rowSpan:m,sandbox:P,scope:null,scoped:v,seamless:v,selected:v,shadowRootClonable:v,shadowRootCustomElementRegistry:v,shadowRootDelegatesFocus:v,shadowRootMode:null,shadowRootSerializable:v,shape:null,size:m,sizes:null,slot:null,span:m,spellCheck:L,src:null,srcDoc:null,srcLang:null,srcSet:null,start:m,step:null,style:null,tabIndex:m,target:null,title:null,translate:null,type:null,typeMustMatch:v,useMap:null,value:L,width:m,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:P,axis:null,background:null,bgColor:null,border:m,borderColor:null,bottomMargin:m,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:v,declare:v,event:null,face:null,frame:null,frameBorder:null,hSpace:m,leftMargin:m,link:null,longDesc:null,lowSrc:null,marginHeight:m,marginWidth:m,noResize:v,noHref:v,noShade:v,noWrap:v,object:null,profile:null,prompt:null,rev:null,rightMargin:m,rules:null,scheme:null,scrolling:L,standby:null,summary:null,text:null,topMargin:m,valueType:null,version:null,vAlign:null,vLink:null,vSpace:m,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:v,disablePictureInPicture:v,disableRemotePlayback:v,exportParts:X,part:P,prefix:null,property:null,results:m,security:null,unselectable:null},space:"html",transform:zt}),Pr=Q({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:M,accentHeight:m,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:m,amplitude:m,arabicForm:null,ascent:m,attributeName:null,attributeType:null,azimuth:m,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:m,by:null,calcMode:null,capHeight:m,className:P,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:m,diffuseConstant:m,direction:null,display:null,dur:null,divisor:m,dominantBaseline:null,download:v,dx:null,dy:null,edgeMode:null,editable:null,elevation:m,enableBackground:null,end:null,event:null,exponent:m,externalResourcesRequired:null,fill:null,fillOpacity:m,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:X,g2:X,glyphName:X,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:m,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:m,horizOriginX:m,horizOriginY:m,id:null,ideographic:m,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:m,k:m,k1:m,k2:m,k3:m,k4:m,kernelMatrix:M,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:m,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:m,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:m,overlineThickness:m,paintOrder:null,panose1:null,path:null,pathLength:m,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:P,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:m,pointsAtY:m,pointsAtZ:m,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:M,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:M,rev:M,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:M,requiredFeatures:M,requiredFonts:M,requiredFormats:M,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:m,specularExponent:m,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:m,strikethroughThickness:m,string:null,stroke:null,strokeDashArray:M,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:m,strokeOpacity:m,strokeWidth:null,style:null,surfaceScale:m,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:M,tabIndex:m,tableValues:null,target:null,targetX:m,targetY:m,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:M,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:m,underlineThickness:m,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:m,values:null,vAlphabetic:m,vMathematical:m,vectorEffect:null,vHanging:m,vIdeographic:m,version:null,vertAdvY:m,vertOriginX:m,vertOriginY:m,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:m,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Mt}),$t=Q({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Ut=Q({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:zt}),Ht=Q({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Lr={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Rr=/[A-Z]/g,it=/-[a-z]/g,jr=/^data[-\w.:]+$/i;function Tr(e,t){const n=je(t);let r=t,l=N;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&jr.test(t)){if(t.charAt(4)==="-"){const u=t.slice(5).replace(it,_r);r="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=t.slice(4);if(!it.test(u)){let i=u.replace(Rr,Nr);i.charAt(0)!=="-"&&(i="-"+i),t="data"+i}}l=Ke}return new l(r,t)}o(Tr,"find");function Nr(e){return"-"+e.toLowerCase()}o(Nr,"kebab");function _r(e){return e.charAt(1).toUpperCase()}o(_r,"camelcase");var Or=_t([Ot,Ir,$t,Ut,Ht],"html"),qe=_t([Ot,Pr,$t,Ut,Ht],"svg");function Mr(e){return e.join(" ").trim()}o(Mr,"stringify");var zr=ie(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,l=/^\s*/,u=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,p=/^\s+|\s+$/g,f=`
3
3
  `,s="/",h="*",d="",D="comment",F="declaration";function C(k,E){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];E=E||{};var A=1,y=1;function B(I){var S=I.match(r);S&&(A+=S.length);var O=I.lastIndexOf(f);y=~O?I.length-O:y+I.length}o(B,"updatePosition");function x(){var I={line:A,column:y};return function(S){return S.position=new _(I),ee(),S}}o(x,"position");function _(I){this.start=I,this.end={line:A,column:y},this.source=E.source}o(_,"Position"),_.prototype.content=k;function j(I){var S=new Error(E.source+":"+A+":"+y+": "+I);if(S.reason=I,S.filename=E.source,S.line=A,S.column=y,S.source=k,!E.silent)throw S}o(j,"error");function V(I){var S=I.exec(k);if(S){var O=S[0];return B(O),k=k.slice(O.length),S}}o(V,"match");function ee(){V(l)}o(ee,"whitespace");function R(I){var S;for(I=I||[];S=te();)S!==!1&&I.push(S);return I}o(R,"comments");function te(){var I=x();if(!(s!=k.charAt(0)||h!=k.charAt(1))){for(var S=2;d!=k.charAt(S)&&(h!=k.charAt(S)||s!=k.charAt(S+1));)++S;if(S+=2,d===k.charAt(S-1))return j("End of comment missing");var O=k.slice(2,S-2);return y+=2,B(O),k=k.slice(S),y+=2,I({type:D,comment:O})}}o(te,"comment");function ce(){var I=x(),S=V(u);if(S){if(te(),!V(i))return j("property missing ':'");var O=V(a),bn=I({type:F,property:b(S[0].replace(n,d)),value:O?b(O[0].replace(n,d)):d});return V(c),bn}}o(ce,"declaration");function pe(){var I=[];R(I);for(var S;S=ce();)S!==!1&&(I.push(S),R(I));return I}return o(pe,"declarations"),ee(),pe()}o(C,"index");function b(k){return k?k.replace(p,d):d}o(b,"trim"),t.exports=C})),$r=ie((e=>{var t=e&&e.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(zr());function r(l,u){let i=null;if(!l||typeof l!="string")return i;const a=(0,n.default)(l),c=typeof u=="function";return a.forEach(p=>{if(p.type!=="declaration")return;const{property:f,value:s}=p;c?u(f,s,p):s&&(i=i||{},i[f]=s)}),i}o(r,"StyleToObject")})),Ur=ie((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,u=/^-(ms)-/,i=o(function(f){return!f||r.test(f)||t.test(f)},"skipCamelCase"),a=o(function(f,s){return s.toUpperCase()},"capitalize"),c=o(function(f,s){return"".concat(s,"-")},"trimHyphen"),p=o(function(f,s){return s===void 0&&(s={}),i(f)?f:(f=f.toLowerCase(),s.reactCompat?f=f.replace(u,c):f=f.replace(l,c),f.replace(n,a))},"camelCase");e.camelCase=p})),Hr=ie(((e,t)=>{var n=(e&&e.__importDefault||function(u){return u&&u.__esModule?u:{default:u}})($r()),r=Ur();function l(u,i){var a={};return!u||typeof u!="string"||(0,n.default)(u,function(c,p){c&&p&&(a[(0,r.camelCase)(c,i)]=p)}),a}o(l,"StyleToJS"),l.default=l,t.exports=l})),Wt=Vt("end"),Xe=Vt("start");function Vt(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}o(Vt,"point");function Wr(e){const t=Xe(e),n=Wt(e);if(t&&n)return{start:t,end:n}}o(Wr,"position");var Vr=ye(Hr(),1),Ye={}.hasOwnProperty,Kr=new Map,qr=/[A-Z]/g,Xr=new Set(["table","tbody","thead","tfoot","tr"]),Yr=new Set(["td","th"]),Kt="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Gr(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=ll(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=rl(n,t.jsx,t.jsxs)}const l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?qe:Or,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},u=qt(l,e,void 0);return u&&typeof u!="string"?u:l.create(e,l.Fragment,{children:u||void 0},void 0)}o(Gr,"toJsxRuntime");function qt(e,t,n){if(t.type==="element")return Zr(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Jr(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return el(e,t,n);if(t.type==="mdxjsEsm")return Qr(e,t);if(t.type==="root")return tl(e,t,n);if(t.type==="text")return nl(e,t)}o(qt,"one$1");function Zr(e,t,n){const r=e.schema;let l=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(l=qe,e.schema=l),e.ancestors.push(t);const u=Yt(e,t.tagName,!1),i=ol(e,t);let a=Ze(e,t);return Xr.has(t.tagName)&&(a=a.filter(function(c){return typeof c=="string"?!Sr(c):!0})),Xt(e,i,u,t),Ge(i,a),e.ancestors.pop(),e.schema=r,e.create(t,u,i,n)}o(Zr,"element");function Jr(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}oe(e,t.position)}o(Jr,"mdxExpression");function Qr(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);oe(e,t.position)}o(Qr,"mdxEsm");function el(e,t,n){const r=e.schema;let l=r;t.name==="svg"&&r.space==="html"&&(l=qe,e.schema=l),e.ancestors.push(t);const u=t.name===null?e.Fragment:Yt(e,t.name,!0),i=il(e,t),a=Ze(e,t);return Xt(e,i,u,t),Ge(i,a),e.ancestors.pop(),e.schema=r,e.create(t,u,i,n)}o(el,"mdxJsxElement");function tl(e,t,n){const r={};return Ge(r,Ze(e,t)),e.create(t,e.Fragment,r,n)}o(tl,"root$1");function nl(e,t){return t.value}o(nl,"text$2");function Xt(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}o(Xt,"addNode");function Ge(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}o(Ge,"addChildren");function rl(e,t,n){return r;function r(l,u,i,a){const c=Array.isArray(i.children)?n:t;return a?c(u,i,a):c(u,i)}}o(rl,"productionCreate");function ll(e,t){return n;function n(r,l,u,i){const a=Array.isArray(u.children),c=Xe(r);return t(l,u,i,a,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}o(ll,"developmentCreate");function ol(e,t){const n={};let r,l;for(l in t.properties)if(l!=="children"&&Ye.call(t.properties,l)){const u=ul(e,l,t.properties[l]);if(u){const[i,a]=u;e.tableCellAlignToStyle&&i==="align"&&typeof a=="string"&&Yr.has(t.tagName)?r=a:n[i]=a}}if(r){const u=n.style||(n.style={});u[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}o(ol,"createElementProps");function il(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const u=l.expression;u.type;const i=u.properties[0];i.type,Object.assign(n,e.evaluater.evaluateExpression(i.argument))}else oe(e,t.position);else{const l=r.name;let u;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const i=r.value.data.estree.body[0];i.type,u=e.evaluater.evaluateExpression(i.expression)}else oe(e,t.position);else u=r.value===null?!0:r.value;n[l]=u}return n}o(il,"createJsxElementProps");function Ze(e,t){const n=[];let r=-1;const l=e.passKeys?new Map:Kr;for(;++r<t.children.length;){const u=t.children[r];let i;if(e.passKeys){const c=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(c){const p=l.get(c)||0;i=c+"-"+p,l.set(c,p+1)}}const a=qt(e,u,i);a!==void 0&&n.push(a)}return n}o(Ze,"createChildren");function ul(e,t,n){const r=Tr(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?br(n):Mr(n)),r.property==="style"){let l=typeof n=="object"?n:al(e,String(n));return e.stylePropertyNameCase==="css"&&(l=sl(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&r.space?Lr[r.property]||r.property:r.attribute,n]}}o(ul,"createProperty");function al(e,t){try{return(0,Vr.default)(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,l=new We("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=Kt+"#cannot-parse-style-attribute",l}}o(al,"parseStyle");function Yt(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let u=-1,i;for(;++u<l.length;){const a=nt(l[u])?{type:"Identifier",name:l[u]}:{type:"Literal",value:l[u]};i=i?{type:"MemberExpression",object:i,property:a,computed:!!(u&&a.type==="Literal"),optional:!1}:a}r=i}else r=nt(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const l=r.value;return Ye.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(r);oe(e)}o(Yt,"findComponentFromName");function oe(e,t){const n=new We("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Kt+"#cannot-handle-mdx-estrees-without-createevaluater",n}o(oe,"crashEstree");function sl(e){const t={};let n;for(n in e)Ye.call(e,n)&&(t[cl(n)]=e[n]);return t}o(sl,"transformStylesToCssCasing");function cl(e){let t=e.replace(qr,pl);return t.slice(0,3)==="ms-"&&(t="-"+t),t}o(cl,"transformStyleToCssCasing");function pl(e){return"-"+e.toLowerCase()}o(pl,"toDash");var Ce={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]};function fl(e){const t=this;t.parser=n;function n(r){return Zn(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}o(n,"parser")}o(fl,"remarkParse");function hl(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}o(hl,"blockquote");function dl(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
4
4
  `}]}o(dl,"hardBreak");function ml(e,t){const n=t.value?t.value+`
5
5
  `:"",r={},l=t.lang?t.lang.split(/\s+/):[];l.length>0&&(r.className=["language-"+l[0]]);let u={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(u.data={meta:t.meta}),e.patch(t,u),u=e.applyData(t,u),u={type:"element",tagName:"pre",properties:{},children:[u]},e.patch(t,u),u}o(ml,"code$1");function Dl(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}o(Dl,"strikethrough");function gl(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}o(gl,"emphasis");function Fl(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),l=J(r.toLowerCase()),u=e.footnoteOrder.indexOf(r);let i,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),i=e.footnoteOrder.length):i=u+1,a+=1,e.footnoteCounts.set(r,a);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+l,id:n+"fnref-"+l+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(i)}]};e.patch(t,c);const p={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,p),e.applyData(t,p)}o(Fl,"footnoteReference$1");function yl(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}o(yl,"heading");function wl(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}o(wl,"html");function Gt(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const l=e.all(t),u=l[0];u&&u.type==="text"?u.value="["+u.value:l.unshift({type:"text",value:"["});const i=l[l.length-1];return i&&i.type==="text"?i.value+=r:l.push({type:"text",value:r}),l}o(Gt,"revert");function Cl(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Gt(e,t);const l={src:J(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(l.title=r.title);const u={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,u),e.applyData(t,u)}o(Cl,"imageReference");function kl(e,t){const n={src:J(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}o(kl,"image");function El(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}o(El,"inlineCode");function Al(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Gt(e,t);const l={href:J(r.url||"")};r.title!==null&&r.title!==void 0&&(l.title=r.title);const u={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,u),e.applyData(t,u)}o(Al,"linkReference");function vl(e,t){const n={href:J(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}o(vl,"link");function bl(e,t,n){const r=e.all(t),l=n?xl(n):Zt(t),u={},i=[];if(typeof t.checked=="boolean"){const f=r[0];let s;f&&f.type==="element"&&f.tagName==="p"?s=f:(s={type:"element",tagName:"p",properties:{},children:[]},r.unshift(s)),s.children.length>0&&s.children.unshift({type:"text",value:" "}),s.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const f=r[a];(l||a!==0||f.type!=="element"||f.tagName!=="p")&&i.push({type:"text",value:`