1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[68566],{11475:(e,t,a)=>{"use strict";a.d(t,{A:()=>p});var l=a(54568),r=a(94203),n=a(31762),i=a(22228),o=a(44588),s=a.n(o),d=a(50746);function u(e){let{content:t,source:a,createdAt:o,onDelete:u,isDeleting:c}=e,m="string"==typeof o?new Date(o):o,h=a?a.replace(/_/g," "):null,p=t.length<=120&&!t.includes("\n"),_=[];h&&_.push(h),_.push((0,d.Yq)(m));let g=_.join(" ⢠");return p?(0,l.jsx)(i.A,{title:t,subtitle:g,variant:"minimal",collapsible:!1,headerOnly:!0,rightPreview:u&&(0,l.jsx)(r.default,{variant:"text",onClick:u,disabled:c,children:c?"Removing...":"Remove"}),className:s().memoryContainer}):(0,l.jsx)(i.A,{title:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:80,a=(e.split("\n")[0]||e).trim();return a.length<=t?a:a.slice(0,t-3)+"..."}(t),subtitle:g,variant:"minimal",defaultOpen:!1,rightPreview:u&&(0,l.jsx)(r.default,{variant:"text",onClick:u,disabled:c,children:c?"Removing...":"Remove"}),className:s().memoryContainer,noHeightClamp:!0,children:(0,l.jsx)(n.A,{children:t})})}var c=a(69091),m=a(94947),h=a.n(m);function p(e){let{memories:t,totalCount:a,isLoading:r,emptyMessage:i="No memories yet.",showMoreThreshold:o=3,onDeleteMemory:s,deletingMemoryId:d}=e;return r?(0,l.jsx)(n.A,{muted:!0,children:"Loading memories..."}):t.length?(0,l.jsxs)("div",{className:h().memoryList,children:[a>t.length&&(0,l.jsxs)(n.A,{muted:!0,children:["Showing ",t.length," of ",a," memories (most recent)"]}),(0,l.jsx)(c.A,{items:t,initialCount:o,moreLabel:e=>"Show ".concat(e," more"),lessLabel:"Show less",children:e=>e.map(e=>(0,l.jsx)(u,{content:e.content,source:e.source,createdAt:e.created_at,onDelete:s?()=>s(e.id):void 0,isDeleting:d===e.id},e.id))})]}):(0,l.jsx)("div",{className:h().emptyState,children:(0,l.jsx)(n.A,{muted:!0,children:i})})}},33599:e=>{e.exports={chartContainer:"Charts_chartContainer__x0Suw",chartInner:"Charts_chartInner__FAsk4",legendContainer:"Charts_legendContainer__qv2pe",legendButton:"Charts_legendButton__233HZ",legendButtonDimmed:"Charts_legendButtonDimmed__VOyio",tooltipContainer:"Charts_tooltipContainer__fsZfX",tooltipContainerWide:"Charts_tooltipContainerWide__59Q5y",tooltipHeader:"Charts_tooltipHeader__3tsvF",tooltipDate:"Charts_tooltipDate__EjzXz",tooltipDateSpaced:"Charts_tooltipDateSpaced__aGGfW",tooltipRows:"Charts_tooltipRows__jWYEJ",tooltipRow:"Charts_tooltipRow__wKO91",tooltipRowDimmed:"Charts_tooltipRowDimmed__n4EX7",tooltipRowLeft:"Charts_tooltipRowLeft__lk2yS",tooltipDot:"Charts_tooltipDot__fk_LH",tooltipLabel:"Charts_tooltipLabel__fXVnr",tooltipValue:"Charts_tooltipValue__mLHU_",tooltipOutlier:"Charts_tooltipOutlier__oS9tb",chartEmpty:"Charts_chartEmpty__jMz8K",chartEmptyIcon:"Charts_chartEmptyIcon__cpNFD",chartEmptyText:"Charts_chartEmptyText__P7Qd9",fileOverlay:"Charts_fileOverlay__XALrm",fileOverlayGroup:"Charts_fileOverlayGroup__wCu0X",fileGroupCollapsed:"Charts_fileGroupCollapsed__U1O2U",fileStripThumb:"Charts_fileStripThumb__6IRBr",fileGroupBadge:"Charts_fileGroupBadge__45SXu",fileGroupExpanded:"Charts_fileGroupExpanded__kO_Px",fileStripThumbImage:"Charts_fileStripThumbImage__SMyOV",fileStripThumbIcon:"Charts_fileStripThumbIcon__m8hkV",frame:"Charts_frame__CYFW4",plot:"Charts_plot__4gjFF",legend:"Charts_legend__N9XBp",swatch:"Charts_swatch__U8pCQ",swatchBar:"Charts_swatchBar__lQA_B",swatchLine:"Charts_swatchLine__ckwFm",tooltipRowValue:"Charts_tooltipRowValue__7mLo8"}},35092:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});var l=a(54568);function r(e){let{text:t}=e;return(0,l.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",minHeight:100,color:"var(--color-text-primary)",textAlign:"center",padding:"var(--spacing-md)"},children:t})}},36545:(e,t,a)=>{"use strict";a.d(t,{A:()=>F});var l=a(54568),r=a(1467),n=a(7620),i=a(95964);function o(e){var t;return{formattedCost:(0,n.useMemo)(()=>{if(!(null==e?void 0:e.total_cost_cents))return"$0.00";var t=e.total_cost_cents;if(!Number.isFinite(t)||t<=0)return"$0.00";let a=t/100;return a<.01?"$".concat(a.toFixed(4)):"$".concat(a.toFixed(2))},[null==e?void 0:e.total_cost_cents]),formattedTokens:(0,n.useMemo)(()=>{var t;return(null==e?void 0:e.total_tokens)?(t=e.total_tokens)<1e3?t.toString():t<1e6?"".concat((t/1e3).toFixed(1),"K"):"".concat((t/1e6).toFixed(2),"M"):"0"},[null==e?void 0:e.total_tokens]),hasData:(null!=(t=null==e?void 0:e.total_calls)?t:0)>0}}var s=a(26307);function d(e){return!Number.isFinite(e)||e<=0?"0":e>=1e6?"".concat((e/1e6).toFixed(2),"M"):e>
1=1e3?"".concat((e/1e3).toFixed(1),"K"):e.toLocaleString()}var u=a(91041),c=a(10980),m=a(68646),h=a(39443),p=a(2699),_=a(52622),g=a(35092),v=a(13535),f=a(72203),y=a(52213),x=a(64345),b=a(61369),j=a(84320),k=a(31762),w=a(11494),C=a(91316),A=a.n(C);function D(e){var t;let a=null!=e&&Number.isFinite(e)?e/100:0;return null!=(t=(0,s.dR)(a,{decimals:a>0&&a<.01?4:2}))?t:"$0.00"}function L(e){return(0,s.h9)(null!=e&&Number.isFinite(e)?e:0)}let N=[{value:"credits",label:"Credits used"},{value:"cost_usd",label:"Cost ($)"},{value:"calls",label:"API calls"},{value:"tokens",label:"Total tokens"},{value:"input_tokens",label:"Input tokens"},{value:"output_tokens",label:"Output tokens"}],S=[{value:"hour",label:"Hourly"},{value:"day",label:"Daily"},{value:"week",label:"Weekly"}],M=[{value:"7",label:"Last 7 days"},{value:"30",label:"Last 30 days"},{value:"90",label:"Last 90 days"},{value:"180",label:"Last 180 days"},{value:"365",label:"Last 365 days"}];function T(e){var t,a;return null!=(a=null==(t=N.find(t=>t.value===e))?void 0:t.label)?a:"Usage"}function F(e){var t,a,C;let{agentId:F,days:I=30,compact:R=!1,scope:O="account"}=e,{isAdmin:z,isLoading:E}=(0,r.R)(),[P,U]=(0,n.useState)(I),W=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:30,t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],{data:a,isLoading:l,error:r,refetch:n}=i.Ay.useQuery("get","/llm_usage/summary",{params:{query:{days:e}}},{enabled:t});return{data:a,isLoading:l,error:r,refetch:n,...o(a)}}(P,!F&&"account"===O),B=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:30,t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],{data:a,isLoading:l,error:r,refetch:n}=i.Ay.useQuery("get","/llm_usage/admin/summary",{params:{query:{days:e}}},{enabled:t});return{data:a,isLoading:l,error:r,refetch:n,...o(a)}}(P,!F&&"global"===O),q=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,{data:a,isLoading:l,error:r,refetch:n}=i.Ay.useQuery("get","/llm_usage/agent/{agent_id}",{params:{path:{agent_id:e||""},query:{days:t}}},{enabled:!!e});return{data:a,isLoading:l,error:r,refetch:n,...o(a)}}(F,P),K=function(){var e,t;let a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:30,l=!(arguments.length>1)||void 0===arguments[1]||arguments[1],{data:r,isLoading:o,error:s,refetch:u}=i.Ay.useQuery("get","/credits/usage/summary",{params:{query:{days:a}}},{enabled:l}),c=(0,n.useMemo)(()=>(null==r?void 0:r.total_credits_used)?d(r.total_credits_used):"0",[null==r?void 0:r.total_credits_used]);return{data:r,isLoading:o,error:s,refetch:u,formattedCredits:c,totalCredits:null!=(e=null==r?void 0:r.total_credits_used)?e:0,hasData:(null!=(t=null==r?void 0:r.total_credits_used)?t:0)>0}}(P,!F),Q=function(e){var t,a;let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,{data:r,isLoading:o,error:s,refetch:u}=i.Ay.useQuery("get","/credits/usage/agent/{agent_id}",{params:{path:{agent_id:e||""},query:{days:l}}},{enabled:!!e}),c=(0,n.useMemo)(()=>(null==r?void 0:r.total_credits_used)?d(r.total_credits_used):"0",[null==r?void 0:r.total_credits_used]);return{data:r,isLoading:o,error:s,refetch:u,formattedCredits:c,totalCredits:null!=(t=null==r?void 0:r.total_credits_used)?t:0,hasData:(null!=(a=null==r?void 0:r.total_credits_used)?a:0)>0}}(F,P),H=F?Q:K,{data:V,isLoading:Y,hasData:G}=F?q:"global"===O?B:W,X=D(null==V?void 0:V.total_cost_cents),$=!R,Z=F?"This agent":"global"===O?"All accounts + agents":"This account",J=P<=2?"hour":P<=120?"day":"week",[ee,et]=(0,n.useState)("credits"),[ea,el]=(0,n.use
1State)(J);(0,n.useEffect)(()=>{U(I)},[I]),(0,n.useEffect)(()=>{el(J)},[J]);let{data:er,isLoading:en}=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:30,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"day",l=!(arguments.length>2)||void 0===arguments[2]||arguments[2],{data:r,isLoading:n,error:o,refetch:s}=i.Ay.useQuery("get","/llm_usage/timeseries",{params:{query:{days:t,granularity:a}}},{enabled:l});return{data:r||[],isLoading:n,error:o,refetch:s,hasData:(null!=(e=null==r?void 0:r.length)?e:0)>0}}(P,ea,$&&z&&"account"===O),{data:ei,isLoading:eo}=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:30,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"day",l=!(arguments.length>2)||void 0===arguments[2]||arguments[2],{data:r,isLoading:n,error:o,refetch:s}=i.Ay.useQuery("get","/llm_usage/admin/timeseries",{params:{query:{days:t,granularity:a}}},{enabled:l});return{data:r||[],isLoading:n,error:o,refetch:s,hasData:(null!=(e=null==r?void 0:r.length)?e:0)>0}}(P,ea,$&&z&&"global"===O),{data:es,isLoading:ed}=function(e){var t;let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"day",r=!(arguments.length>3)||void 0===arguments[3]||arguments[3],{data:n,isLoading:o,error:s,refetch:d}=i.Ay.useQuery("get","/llm_usage/agent/{agent_id}/timeseries",{params:{path:{agent_id:e||""},query:{days:a,granularity:l}}},{enabled:r&&!!e});return{data:n||[],isLoading:o,error:s,refetch:d,hasData:(null!=(t=null==n?void 0:n.length)?t:0)>0}}(F,P,ea,$&&z&&!!F),{data:eu,isLoading:ec}=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:30,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"day",l=!(arguments.length>2)||void 0===arguments[2]||arguments[2],{data:r,isLoading:n,error:o,refetch:s}=i.Ay.useQuery("get","/credits/usage/timeseries",{params:{query:{days:t,granularity:a}}},{enabled:l});return{data:null!=r?r:[],isLoading:n,error:o,refetch:s,hasData:(null!=(e=null==r?void 0:r.length)?e:0)>0}}(P,"hour"===ea?"day":ea,$&&z&&"credits"===ee&&!F),{data:em,isLoading:eh}=function(e){var t;let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"day",r=!(arguments.length>3)||void 0===arguments[3]||arguments[3],{data:n,isLoading:o,error:s,refetch:d}=i.Ay.useQuery("get","/credits/usage/agent/{agent_id}/timeseries",{params:{path:{agent_id:e||""},query:{days:a,granularity:l}}},{enabled:r&&!!e});return{data:null!=n?n:[],isLoading:o,error:s,refetch:d,hasData:(null!=(t=null==n?void 0:n.length)?t:0)>0}}(F,P,"hour"===ea?"day":ea,$&&z&&"credits"===ee&&!!F),ep=F?em:eu,e_=F?eh:ec,eg=F?es:"global"===O?ei:er,ev=F?ed:"global"===O?eo:en,ef=(0,n.useMemo)(()=>{if(!$)return[];if("credits"===ee){let e=ep.map(e=>({timestamp:Date.parse(e.bucket_start),value:e.credits_consumed})).filter(e=>Number.isFinite(e.timestamp)).sort((e,t)=>e.timestamp-t.timestamp);return e.length?[{id:"__series__",label:T(ee),color:"var(--color-secondary)",data:e}]:[]}let e=eg.map(e=>({timestamp:Date.parse(e.date),value:function(e,t){switch(t){case"cost_usd":return Number(e.cost_cents||0)/100;case"calls":return Number(e.calls||0);case"tokens":return Number(e.tokens||0);case"input_tokens":return Number(e.input_tokens||0);case"output_tokens":return Number(e.output_tokens||0);default:return 0}}(e,ee)})).filter(e=>Number.isFinite(e.timestamp)).sort((e,t)=>e.timestamp-t.timestamp);return e.length?[{id:"__series__",label:T(ee),color:"var(--color-secondary)",data:e}]:[]},[$,ee,ep,eg]),ey=(0,n.useMemo)(()=>{let e=null==V?void 0:V.by_model;if(!e)return[];let t=Object.values(e).reduce((e,t)=>e+Number(t.cost_cents||0),0);return Object.entries(e).map(e=>{let[a,l]=e;return{model:a,calls:Number(l.calls||0),input_tokens:Number(l.input_tokens||0),output_tokens:Number(l.output_tokens||0),cost_cents:Number(l.cost_cents||0),share:t>0?Number(l.cost_cents||0)/t:0}}).sort((e,t)=>t.cost_cents-e.cost_cents)},[null==V?void 0:V.by_model]),ex=(0,n.useMemo)(()=>[{accessorKey:"model",header:"Model",meta:{width:"2xl"},cell:e=>{let{row:t}=e;return(0,l.jsx)(k.A,{weight:"medium",inline:!0,truncate:!0,"data-tooltip":t.original.model,children:function(e){if(!e)return"Unknown model";let t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}(t.original.model)}
1)}},{accessorKey:"calls",header:()=>(0,l.jsx)("span",{"data-tooltip":"Tracked LLM API calls billed to this model in the period. Count of usage records for the model (one record per call).",children:"Calls"}),meta:{width:"sm"},cell:e=>{let{getValue:t}=e;return(0,l.jsx)(k.A,{inline:!0,children:(0,s.bu)(t())})}},{accessorKey:"input_tokens",header:()=>(0,l.jsx)("span",{"data-tooltip":"Prompt tokens sent to this model in the period. Sum of the input_tokens field over the model's usage records.",children:"Input tokens"}),meta:{width:"lg"},cell:e=>{let{getValue:t}=e;return(0,l.jsx)(k.A,{inline:!0,"data-tooltip":"".concat((0,s.bu)(t())," input tokens"),children:L(t())})}},{accessorKey:"output_tokens",header:()=>(0,l.jsx)("span",{"data-tooltip":"Completion tokens generated by this model in the period. Sum of the output_tokens field over the model's usage records.",children:"Output tokens"}),meta:{width:"lg"},cell:e=>{let{getValue:t}=e;return(0,l.jsx)(k.A,{inline:!0,"data-tooltip":"".concat((0,s.bu)(t())," output tokens"),children:L(t())})}},{accessorKey:"cost_cents",header:()=>(0,l.jsx)("span",{"data-tooltip":"Provider-billed cost for this model, priced from tokens at query time: (input tokens / 1M x input price) + (output tokens / 1M x output price) + Anthropic cache-write surcharge - cache-read discount, plus fixed-billed costs.",children:"Cost"}),meta:{width:"sm"},cell:e=>{let{getValue:t}=e;return(0,l.jsx)(k.A,{weight:"semibold",inline:!0,children:D(t())})}},{accessorKey:"share",header:()=>(0,l.jsx)("span",{"data-tooltip":"This model's share of total spend in the period. Model cost divided by the sum of all models' cost.",children:"% of spend"}),meta:{width:"md"},cell:e=>{let{getValue:t}=e;return(0,l.jsx)(k.A,{inline:!0,color:"muted",children:(0,s.Oe)(t(),{fraction:!0})})}}],[]),eb=(0,n.useMemo)(()=>{let e=P>=7;return S.map(t=>({...t,disabled:"week"===t.value&&!e}))},[P]);if(!z)return null;if(E||Y)return R?(0,l.jsx)("span",{className:A().compactLoading,children:"..."}):(0,l.jsx)(_.A,{count:1});if(!(G||H.hasData))return R?(0,l.jsx)("span",{className:A().compactEmpty,children:"$0.00"}):(0,l.jsx)(g.A,{text:"No LLM usage recorded in this period yet."});if(R)return(0,l.jsx)("span",{className:A().compactCost,"data-tooltip":"".concat((0,s.bu)(null!=(t=null==V?void 0:V.total_tokens)?t:0)," tokens in ").concat(P," days"),children:X});let ej="credits"===ee?e_:ev;return(0,l.jsxs)(x.default,{gap:"lg",children:[(0,l.jsxs)(v.A,{minColWidth:"10rem",gap:"sm",children:[(0,l.jsx)(b.A,{value:"".concat(L(H.totalCredits)," cr"),label:"Credits used",tone:"brand",icon:(0,l.jsx)(m.default,{name:"card"}),info:"Platform credits spent in the selected period. Sum of the absolute value of every debit (negative-amount) credit transaction in the window; positive entries such as grants, top-ups, and refunds are excluded."}),(0,l.jsx)(b.A,{value:X,label:"Total cost",icon:(0,l.jsx)(m.default,{name:"money"}),info:"Provider-billed USD cost of every tracked LLM call in the period, priced at query time from tokens. Per model: (input tokens / 1M x input price) + (output tokens / 1M x output price) + Anthropic cache-write surcharge - cache-read discount, plus fixed-billed costs (e.g. image generation), summed across all models."}),(0,l.jsx)(b.A,{value:L(null==V?void 0:V.total_input_tokens),label:"Input tokens",icon:(0,l.jsx)(m.default,{name:"file-read"}),info:"Prompt tokens sent to the models across the period. Sum of the input_tokens field over every usage record in the window."}),(0,l.jsx)(b.A,{value:L(null==V?void 0:V.total_output_tokens),label:"Output tokens",icon:(0,l.jsx)(m.default,{name:"file-write"}),info:"Completion tokens generated by the models across the period. Sum of the output_tokens field over every usage record in the window."}),(0,l.jsx)(b.A,{value:null!=(C=(0,s.bu)(null!=(a=null==V?void 0:V.total_calls)?a:0))?C:"0",label:"API calls",icon:(0,l.jsx)(m.default,{name:"send"}),info:"Number of tracked LLM API calls in the period. Count of usage records (one record is written per call) in the window."})]}),(0,l.jsxs)(p.A,{gap:"sm",align:"center",children:[(0,l.jsxs)(y.A,{align:"center",gap:"xs",wrap:!1,children:[(0,l.jsx)(h.A,{children:"Period"}),(0,l.jsx)(c.A,{value:String(P),options:M,onChange:e=>{let t=Array.isArray(e)?e[0]:e;if(!t)return;let a=Number.parseInt(t,10);Number.isFinite(a)&&U(a)},size:"sm",variant:"minimal",position:"bottom-full",fullWidth:!1})]}),(0,l.jsxs)(y.A,{align:"center",gap:"xs",wrap:!1,children:[(0,l.jsx)(h.A,{children:"Metric"}),(0,l.jsx)(c.A,{value:ee,options:N,onChange:e=>{et(Array.isArray(e)?e[0]:e)},size:"sm",variant:"minimal",position:"bottom-full",fullWidth:!1})]}),(0,l.jsxs)(y.A,{align:"center",gap:"xs",wrap:!1,children:[(0,l.jsx)(h.A,{children:"Interval"}),(0,l.jsx)(c.A,{value:ea,options:eb,onChange:e=>{el(Array.isArray(e)?e[0]:e)},size:"sm",variant:"minimal",position:"bottom-full",fullWidth:!1})]})]}),$&&(0,l.jsx)(j.A,{emphasis:"subtle",children:(0,l.jsxs)(x.default,{gap:"sm",children:[(0,l.jsxs)(y.A,{justify:"between",align:"center",gap:"sm",children:[(0,l.jsx)(f.A,{size:"small",title:"".concat(T(ee)," over time"),icon:(0,l.jsx)(m.default,{name:"chart-bar"})}),(0,l.jsx)(h.A,{children:Z})]}),ej?(0,l.jsx)(_.A,{count:1}):ef.length>0?(0,l.jsx)(u.default,{series:ef,height:280,chartType:"bar",allowDecimals:"cost_usd"===ee,yAxisWidth:"cost_usd"===ee?64:48,valueFormatter:e=>Number.isFinite(e)?"cost_usd"===ee?D(100*e):L(e):"0"}):(0,l.jsx)(k.A,{color:"muted",children:"No trend data for the selected metric."})]})}),ey.length>0&&(0,l.jsxs)(x.default,{gap:"sm",children:[(0,l.jsxs)(y.A,{justify:"between",align:"center",gap:"sm",children:[(0,l.jsx)(f.A,{size:"small",title:"Spend by model",icon:(0,l.jsx)(m.default,{name:"layers"})}),(0,l.jsx)(h.A,{children:Z})]}),(0,l.jsx)(w.b,{data:ey,columns:ex,enableSorting:!0,emptyMessage:"No per-model LLM usage in this period."})]})]})}},44588:e=>{e.exports={memoryContainer:"MemoryItem_memoryContainer__n_8s5"}},61304:(e,t,a)=>{"use strict";function l(e){return e.color?e.color:"var(--color-secondary)"}function r(e){if(void 0!==e.fillOpacity)return e.fillOpacity;switch(e.severity){case"critical":return .2;case"warning":return .12;default:return .06}}function n(e,t,a){return e.filter(e=>"area"===e.type&&e.endDate?e.startDate<=a&&e.endDate>=t:e.startDate>=t&&e.startDate<=a)}function i(e,t){return e.filter(e=>t.includes(e.category))}a.d(t,{Al:()=>n,LS:()=>i,Sk:()=>l,ZU:()=>r})},75552:(e,t,a)=>{"use strict";a.d(t,{an:()=>c,dS:()=>u});var l=a(54568),r=a(28788),n=a(1233),i=a(85647),o=a.n(i),s=a(1467),d=a(72902);function u(e){let{plan:t,size:a="xs",className:i,style:o,href:s}=e;return(0,l.jsx)(r.default,{tone:"brand",size:a,className:i,style:o,href:s,children:(0,n.N4)(t)})}function c(e){let{children:t,requiredPlan:a,featureName:r="this feature",description:i,className:c,labelPosition:m="right",alwaysShowLabel:h=!1,display:p="inline-flex",gap:_="var(--spacing-sm)",onClick:g,onKeyDown:v}=e,{isAtLeast:f,isLoading:y,needsBillingAction:x}=(0,s.R)(),b=!y&&!f(a),j=(0,n.vf)(),k=b?(0,n.r6)(r,a,x):void 0;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:(0,d.A)(o().wrapper,"inline-flex"!==p&&o().fullWidth,b&&o().locked,c),style:{"--plan-restriction-gap":_},role:b?"button":void 0,tabIndex:b?0:void 0,"aria-label":k,"aria-haspopup":b?"dialog":void 0,"aria-busy":y||void 0,"data-tooltip":k,onClick:e=>{if(b||y){e.preventDefault(),e.stopPropagation(),b&&j.open();return}null==g||g(e)},onKeyDown:e=>
1{if(b||y){("Enter"===e.key||" "===e.key)&&(e.preventDefault(),e.stopPropagation(),b&&j.open());return}null==v||v(e)},children:[(0,l.jsx)("div",{className:o().content,inert:b||y,children:t}),b?(0,l.jsx)(n.MY,{billingRequired:x,plan:a,iconOnly:"none"===m}):h&&(0,l.jsx)(u,{plan:a})]}),(0,l.jsx)(n.vw,{isOpen:j.isOpen,onClose:j.close,featureName:r,description:i,requiredPlan:a,features:[]})]})}a(7620)},85647:e=>{e.exports={wrapper:"PlanRestriction_wrapper__YD7b_",fullWidth:"PlanRestriction_fullWidth__r51YH",content:"PlanRestriction_content__7R_A3",locked:"PlanRestriction_locked__E1bAL"}},91041:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>D});var l=a(54568),r=a(12808),n=a(68646),i=a(28788),o=a(72902),s=a(39109),d=a(25830),u=a(7620),c=a(30302),m=a(79886),h=a(65087),p=a(75724),_=a(94503),g=a(65236),v=a(78875),f=a(62070),y=a(29942),x=a(29440),b=a(61304),j=a(33599),k=a.n(j);function w(e,t){let a=new Date(e);if(t<=1728e5)return a.toLocaleTimeString("en-US",{hour:"numeric"});if(t>31536e6){let e=a.getFullYear().toString().slice(-2);return a.toLocaleDateString("en-US",{month:"short"})+" '"+e}return a.toLocaleDateString("en-US",{month:"short",day:"numeric"})}let C=["var(--color-chart-1)","var(--color-chart-2)","var(--color-chart-3)","var(--color-chart-4)","var(--color-chart-5)","var(--color-chart-6)","var(--color-chart-7)","var(--color-chart-8)","var(--color-chart-9)","var(--color-chart-10)"];function A(e){let{active:t,payload:a,label:r,series:n,colorById:i,dimmedIds:u,formatValue:c}=e;if(!t||!a||!a.length)return null;let m=[...n.map(e=>{var t;let l=a.find(t=>t.dataKey===e.id),r="number"==typeof(null==l?void 0:l.value)?l.value:null;return{id:e.id,label:(null==(t=e.meta)?void 0:t.name)||e.label,value:r}}).filter(e=>"number"==typeof e.value)].sort((e,t)=>e.value===t.value?0:null==e.value?1:null==t.value?-1:t.value-e.value),h=m.some(e=>"__overall__"===e.id),p=h&&m.find(e=>"__overall__"===e.id)||null,_=h?m.filter(e=>"__overall__"!==e.id):m,g=_.length?_.reduce((e,t)=>e+(t.value||0),0):(null==p?void 0:p.value)||0,v=p?"Breakdown Total (excl Overall)":"Total",f=p?_:m,y="number"==typeof r?new Date(r):null,x=null!=y?y.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric",year:"numeric"}):"";return(0,l.jsxs)("div",{className:(0,o.A)(k().tooltipContainer,k().tooltipContainerWide),children:[(0,l.jsxs)("div",{className:k().tooltipHeader,children:[(0,l.jsx)("span",{children:v}),(0,l.jsx)("span",{children:c(g)})]}),p?(0,l.jsxs)("div",{className:k().tooltipHeader,children:[(0,l.jsx)("span",{children:"Overall"}),(0,l.jsx)("span",{children:c(p.value)})]}):null,x&&(0,l.jsx)("div",{className:(0,o.A)(k().tooltipDate,k().tooltipDateSpaced),children:x}),(0,l.jsx)("div",{className:k().tooltipRows,children:(0,l.jsx)(s.N,{initial:!1,children:f.map(e=>{let t=!!u[e.id],a=i.get(e.id)||"var(--color-secondary)";return(0,l.jsxs)(d.P.div,{layout:!0,initial:{opacity:0,y:-8},animate:{opacity:1,y:0},exit:{opacity:0,y:8},transition:{type:"spring",stiffness:380,damping:32,mass:.5},className:(0,o.A)(k().tooltipRow,t&&k().tooltipRowDimmed),children:[(0,l.jsxs)("div",{className:k().tooltipRowLeft,children:[(0,l.jsx)("span",{className:k().tooltipDot,style:{background:a}}),(0,l.jsx)("span",{className:k().tooltipLabel,children:e.label})]}),(0,l.jsx)("span",{className:k().tooltipValue,children:c(e.value)})]},e.id)})})})]})}function D(e){let{series:t,height:a=240,onSelectBin:s,selectedBin:d,showLegend:j=!0,initialDimmedIds:D={},allowDecimals:L=!1,valueFormatter:N,yAxisWidth:S=36,chartType:M="line",legendMode:T="sum",events:F,visibleCategories:I,onEventClick:R,hideTooltip:O=!1,onDimChange:z}=e,[E,P]=(0,u.useState)(D),U=t.length>0&&t.some(e=>e.data&&e.data.length>0),W=(0,u.useMemo)(()=>{let e=new Map,a=new Set;return t.forEach(t=>
1{t.color&&(e.set(t.id,t.color),a.add(t.color))}),t.forEach((t,l)=>{var r,n;if(e.has(t.id))return;let i=null!=(r=C[l%C.length])?r:"var(--color-secondary)",o=null!=(n=C.find(e=>!a.has(e)))?n:i;e.set(t.id,o),a.add(o)}),e},[t]),B=(0,u.useMemo)(()=>{var e,a,l,r,n,i;let o=new Set;for(let e of t)for(let t of e.data)o.add(t.timestamp);let s=Array.from(o).sort((e,t)=>e-t),d=s.map(e=>{let a={timestamp:e};for(let l of t){let t=l.data.find(t=>t.timestamp===e);a[l.id]=t?t.value:null}return a}),u=s.length>1?(null!=(e=s[s.length-1])?e:0)-(null!=(a=s[0])?a:0):0,c=[];if(s.length>1){let e=null!=(l=s[0])?l:0,t=null!=(r=s[s.length-1])?r:0;if(u<=6048e5)c=[...s];else if(u<=5184e6){let a=new Date(e),l=new Date(t),r=new Date(a);for(r.setDate(r.getDate()+(8-r.getDay())%7),r.setHours(0,0,0,0);r<=l;)c.push(r.getTime()),r.setDate(r.getDate()+7)}else if(u<=63072e6){let a=new Date(e),l=new Date(t),r=new Date(Date.UTC(a.getFullYear(),a.getMonth(),1));for(;r<=l;)r.getTime()>=e&&c.push(r.getTime()),r.setMonth(r.getMonth()+1);c.length>12&&(c=c.filter((e,t)=>t%2==0))}else if(u<=15768e7){let a=new Date(e),l=new Date(t),r=new Date(Date.UTC(a.getFullYear(),0,1));for(;r<=l;)r.getTime()>=e-3888e6&&c.push(r.getTime()),r.setMonth(r.getMonth()+3);c.length>12&&(c=c.filter(e=>new Date(e).getUTCMonth()%6==0))}else{let a=new Date(e),l=new Date(t);for(let e=a.getFullYear();e<=l.getFullYear();e++)c.push(Date.UTC(e,0,1))}c.length<2&&(c=[e,t])}else 1===s.length&&(c=[...s]);return{rows:d,span:u,ticks:c,minTs:null!=(n=s[0])?n:0,maxTs:null!=(i=s[s.length-1])?i:0}},[t]),q=(0,u.useMemo)(()=>{if(!F||0===F.length)return[];let e=[...F];return B.minTs&&B.maxTs&&(e=(0,b.Al)(e,B.minTs,B.maxTs)),I&&I.length>0&&(e=(0,b.LS)(e,I)),e},[F,B.minTs,B.maxTs,I]);if(!U)return(0,l.jsx)("div",{className:k().chartContainer,children:(0,l.jsxs)("div",{className:k().chartEmpty,style:{height:a},children:[(0,l.jsx)(n.default,{name:"chart-line",className:k().chartEmptyIcon}),(0,l.jsx)("span",{className:k().chartEmptyText,children:"Data not available"})]})});let K=e=>Number.isFinite(e)?N?N(e):e.toLocaleString():"0",Q=()=>{if(0===q.length)return null;let e=[],t=0;for(let a of q)if("area"===a.type&&a.endDate){let r=(0,b.Sk)(a);e.push((0,l.jsx)(c.T,{x1:a.startDate,x2:a.endDate,fill:r,fillOpacity:(0,b.ZU)(a),stroke:"none",label:{value:a.label,position:"insideBottom",fill:"var(--color-secondary)",fontSize:11,fontWeight:600,dy:-8-t%3*14}},a.id)),t++}return e};return(0,l.jsxs)("div",{className:k().chartContainer,children:[(0,l.jsx)("div",{className:k().chartInner,style:{height:a},children:"bar"===M?(0,l.jsx)(m.u,{width:"100%",height:"100%",children:(0,l.jsxs)(h.E,{data:B.rows,margin:{top:10,right:16,left:0,bottom:0},onClick:e=>{let t=null==e?void 0:e.activeLabel;"number"==typeof t&&(null==s||s(t))},children:[(0,l.jsx)(p.d,{strokeDasharray:"3 3",stroke:"var(--color-border)",vertical:!1}),(0,l.jsx)(_.W,{dataKey:"timestamp",type:"number",scale:"time",domain:["dataMin","dataMax"],ticks:B.ticks.length?B.ticks:void 0,tickFormatter:e=>w(e,B.span),tick:{fontSize:"var(--font-size-text-small)",fill:"var(--color-text-primary)"},axisLine:{stroke:"var(--color-border)"},tickLine:{stroke:"var(--color-border)"}}),(0,l.jsx)(g.h,{tick:{fontSize:"var(--font-size-text-small)",fill:"var(--color-text-primary)"},axisLine:{stroke:"var(--color-border)"},tickLine:{stroke:"var(--color-border)"},tickFormatter:e=>K(e),allowDecimals:L,width:S}),(0,l.jsx)(v.m,{content:O?()=>null:(0,l.jsx)(A,{series:t,colorById:W,dimmedIds:E,formatValue:K}),wrapperStyle:{zIndex:9999},cursor:{fill:"transparent",stroke:"transparent"}}),Q(),t.map((e,t)=>{let a=W.get(e.id)||e.color||C[t%C.length],r=!!E[e.id];return(0,l.jsx)(f.y,{dataKey:e.id,fill:a,fillOpacity:r?.25:1,activeBar:!1,isAnimationActive:!0,name:e.label,maxBarSize:24},e.id)})]})}):(0,l.jsx)(m.u,{width:"100%",height:"100%",children:(0,l.jsxs)(y.b,{data:B.rows,margin:{top:10,right:16,left:0,bottom:0},onClick:e=>{let t=null==e?void 0:e.activeLabel;"number"==typeof t&&(null==s||s(t))},children:[(0,l.jsx)(p.d,{strokeDasharray:"3 3",stroke:"var(--color-border)",vertical:!1}),(0,l.jsx)(_.W,{dataKey:"timestamp",type:"number",scale:"time",domain:["dataMin","dataMax"],ticks:B.ticks.length?B.ticks:void 0,tickFormatter:e=>w(e,B.span),tick:{fontSize:"var(--font-size-text-small)",fill:"var(--color-text-primary)"}
1,axisLine:{stroke:"var(--color-border)"},tickLine:{stroke:"var(--color-border)"}}),(0,l.jsx)(g.h,{tick:{fontSize:"var(--font-size-text-small)",fill:"var(--color-text-primary)"},axisLine:{stroke:"var(--color-border)"},tickLine:{stroke:"var(--color-border)"},tickFormatter:e=>K(e),allowDecimals:L,width:S}),(0,l.jsx)(v.m,{content:O?()=>null:(0,l.jsx)(A,{series:t,colorById:W,dimmedIds:E,formatValue:K}),wrapperStyle:{zIndex:9999},cursor:{fill:"transparent",stroke:"transparent"}}),Q(),t.map((e,t)=>{let a=W.get(e.id)||e.color||C[t%C.length],r=!!E[e.id];return(0,l.jsx)(x.N,{type:"monotone",dataKey:e.id,stroke:a,strokeWidth:2,isAnimationActive:!0,connectNulls:!0,strokeOpacity:r?.25:1,dot:e=>{let{cx:t,cy:n,payload:i,index:o}=e;return null!=d&&i&&i.timestamp===d?(0,l.jsx)("circle",{cx:t,cy:n,r:5,stroke:a,strokeWidth:2,fill:"var(--color-background-elevated)",opacity:r?.25:1}):(0,l.jsx)("g",{},o)},activeDot:{r:4,stroke:a,strokeWidth:2,fill:"white",style:{opacity:r?.25:1}},name:e.label},e.id)})]})})}),j&&t.length?(0,l.jsx)("div",{className:k().legendContainer,children:t.map(e=>{var t,a,n,s;let d=!!E[e.id],u={id:e.id,name:(null==(t=e.meta)?void 0:t.name)||e.label,profile_image:null==(a=e.meta)?void 0:a.profile_image,profile_image_id:null==(n=e.meta)?void 0:n.profile_image_id},c=e.data.length>0?e.data[e.data.length-1]:null,m="latest"===T?null!=(s=null==c?void 0:c.value)?s:0:e.data.reduce((e,t)=>e+(t.value||0),0);return(0,l.jsxs)("button",{type:"button",onClick:()=>{var t;return t=e.id,void P(e=>{let a={...e,[t]:!e[t]};return null==z||z(a),a})},className:(0,o.A)(k().legendButton,d&&k().legendButtonDimmed),"aria-pressed":d,"aria-label":"Toggle ".concat(u.name),style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px"},children:[e.meta?(0,l.jsx)(r.A,{agent:u,variant:"neutral",size:"sm"}):(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"var(--spacing-xs)"},children:[(0,l.jsx)("div",{style:{width:8,height:8,borderRadius:"50%",background:W.get(e.id)||"var(--color-secondary)"}}),(0,l.jsx)(i.default,{tone:"neutral",size:"sm",transform:"capitalize",children:e.label})]}),(0,l.jsx)("span",{style:{fontSize:"10px",color:"var(--color-text-tertiary)",fontWeight:500},children:K(m)})]},e.id)})}):null]})}},91316:e=>{e.exports={compactLoading:"LLMUsageDisplay_compactLoading__5PqU8",compactEmpty:"LLMUsageDisplay_compactEmpty__MRM63",compactCost:"LLMUsageDisplay_compactCost__yNbsx",badge:"LLMUsageDisplay_badge__U9mhF"}},94947:e=>{e.exports={memoryList:"MemoryList_memoryList__Z9UzJ",emptyState:"MemoryList_emptyState__7cReq"}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.