1(()=>{(function(){try{var R=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};R.SENTRY_RELEASE={id:"61452baeb3a610d0c12922600661bb5199f4e61a"}}catch{}})();(self.webpackChunk=self.webpackChunk||[]).push([[4650],{74650(R,C,t){t.r(C),t.d(C,{default:()=>nt});var s=t(36870),v=t(24497),A=t(9109),h=t(86326),O=t(76053),x=t(41173),U=t(59196),c=t(20778),b=t(65215),M=t(18800),S=t(60041);const E=e=>{let a=e.getUTCDay();a===0&&(a=7);const o=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate());return new Date(o-(a-1)*24*60*60*1e3)};function P(e,a){const o=S.c9.fromJSDate(a??new Date);switch(e){case"3mo":return E(o.minus({weeks:13}).toJSDate());case"12mo":return E(o.minus({weeks:52}).toJSDate());case"all":return}}const I={b:1,kb:1e3,mb:1e6,gb:1e9,tb:1e12,pb:1e15};function p(e,a){const o=e/a,i=Math.round(o*100*(1+Number.EPSILON))/100;return i===0?0:i}const D=e=>{const a=new Array(e.length),o=new Array(e.length),i=new Array(e.length),g=new Array(e.length);let n="b",u="b",d=0,l=0;for(let r=0;r<e.length;r++){const f=e[r],j=parseFloat(f.weeklyAddedVolume),K=parseFloat(f.weeklyDeletedVolume),W=parseFloat(f.cumulativeVolume);d<W&&(d=W);const N=Math.abs(j-K);l<N&&(l=N),a[r]=f.week,o[r]=W,i[r]=j,g[r]=-K}let m=1,y=1;for(const[r,f]of Object.entries(I))f<=d&&(m=f,n=r),f<=l&&(y=f,u=r);for(let r=0;r<o.length;r++)o[r]=p(o[r],m),i[r]=p(i[r],y),g[r]=p(g[r],y);return{netUnit:u,cumulativeUnit:n,weekLabels:a,cumulativeVolumes:o,weeklyAdded:i,weeklyDeleted:g}};var B=t(63336);c.t1.register(c.kc,c.PP,c.E8,c.FN,c.No,c.s$,c.m_,c.iw,c.ZT,c.A6);function L(e,a,o){const i=a?.toISOString(),g=o?.toISOString();let n,u=0,d=0;for(;u<e.length;u++){const l=e[u];if(n!=null&&l.week<n)throw new Error("weekly volume data is not sorted by week, ascending");if(i!=null&&l.week<i){d=u;continue}if(g!=null&&l.week>g)break;n=l.week}return e.slice(d,u)}const V={b:{id:"9z-1OD"},kb:{id:"rler_g"},mb:{id:"gDU96g"},gb:{id:"WQwRBG"},tb:{id:"pPDsrH"},pb:{id:"u4L3n5"}},T={b:void 0,kb:{id:"FIkhWn"},mb:{id:"UPyNTs"},gb:{id:"T0oKJo"},tb:{id:"hwnl51"},pb:{id:"BJSimq"}},F=(e,a,o,i)=>{const g=L(a,o,i),n=D(g),u=e._(V[n.cumulativeUnit]),d=T[n.cumulativeUnit]?e._(T[n.cumulativeUnit]):void 0,l=e._(V[n.netUnit]),m=T[n.netUnit]?e._(T[n.netUnit]):void 0,y={unitLabel:d?e._({id:"YIyiVk",values:{longUnit:u,shortUnit:d}}):u,labels:n.weekLabels,datasets:[{type:"line",label:e._({id:"xnnbuK",values:{unit:d??u}}),unitLabel:u,backgroundColor:"rgb(255, 99, 132)",borderColor:"rgb(255, 99, 132)",borderWidth:2,spanGaps:!0,data:n.cumulativeVolumes}]},r={unitLabel:m?e._({id:"YIyiVk",values:{longUnit:l,shortUnit:m}}):l,labels:n.weekLabels,datasets:[{type:"bar",label:e._({id:"iRm9ve",values:{unit:m??l}}),backgroundColor:"rgb(75, 192, 192)",borderColor:"rgb(75, 192, 192)",borderWidth:2,data:n.weeklyAdded},{type:"bar",label:e._({id:"ij_bQy",values:{unit:m??l}}),backgroundColor:"rgb(255, 99, 132)",borderColor:"rgb(255, 99, 132)",borderWidth:2,data:n.weeklyDeleted}]};return{cumulativeChart:y,netChart:r}};function z(e){const{volumeByWeek:a,dateRange:o,endDate:i}=e,{i18n:g}=(0,v.uB)(),n=(0,h.useRef)(null),u=(0,h.useRef)(null),d=P(o,i),l=(0,h.useMemo)(()=>{const{cumulativeChart:y,netChart:r}=F(g,a,d,i),f={animation:!1,interaction:{mode:"index",intersect:!1},plugins:{tooltip:{enabled:!0}},scales:{x:{type:"timeseries",time:{unit:"week",tooltipFormat:"MMM d, yyyy"},grid:{drawOnChartArea:!1}},y:{title:{text:y.unitLabel,display:!0}}},responsive:!1,aspectRatio:3},j={...f,scales:{x:{...f.scales.x,stacked:!0},y:{title:{text:r.unitLabel,display:!0}}}};return{cumulativeOptions:f,netOptions:j,cumulativeChart:y,netChart:r}},[a,d,i,g]),{ref:m}=(0,M.A)({refreshRate:0,refreshMode:"debounce",onResize(){n.current?.resize(),u.current?.resize()}});return(0,s.jsxs)("div",{ref:m,children:[(0,s.jsx)(b.t1,{ref:n,type:"bar",data:l.cumulativeChart,options:l.cumulativeOptions}),(0,s.jsx)(b.t1,{ref:u,type:"bar",data:l.netChart,options:l.netOptions})]})}const k=z;var J=t(91786),Q=t(65888),Y=t(56704),G=t(2344),H=t(25060),X=t(99006),Z=t(12112),w=t(56354);const $=(0,x.withDefault)((0,x.createEnumParam)(["3mo","12mo","all"]),"3mo");function _(){const e=(0,J.cG)(),{_:a}=(0,v.uB)(),o=(0,Q.A)(),[i,g]=(0,x.useQueryParam)("range",$),{value:n,loading:u,error:d}=(0,O.A)(async()=>await e.importVolume(),[e]),l=(0,h.useMemo)(()=>[{value:"3mo",label:a({id:"x1VeBD"})},{value:"12mo",label:a({id:"-N7uug"})},{value:"all",label:a({id:"XOJDc9"})}],[a]);return u?(0,s.jsx)(U.R,{}):(0,s.jsxs)(Y.A,{children:[(0,s.jsx)(G.A,{title:a({id:"Kvn-HL"}),titleTypographyProps:{variant:"h4"},subheader:a({id:"fXT4G0"}),subheaderTypographyProps:{variant:"body2",color:"textSecondary"},action:(0,s.jsx)(H.l,{value:i,onChange:m=>{g(m.target.value)},children:l.map(m=>(0,s.jsx)(X.A,{value:m.value,children:m.label},m.value))})}),(0,s.jsxs)(Z.A,{children:[d&&(0,s.jsx)(w.F,{kind:"error",children:d.message}),n?.data.length===0&&(0,s.jsx)(w.F,{kind:"warning",children:(0,s.jsx)(v.x6,{id:"uiYLOC"})}),n&&n.data.length>0&&(0,s.jsx)("div",{style:{paddingBottom:o.spacing(5)},children:(0,s.jsx)(k,{dateRange:i,volumeByWeek:n.data})})]})]})}var q=t(90670),tt=t(87498);function et(){const{_:e}=(0,v.uB)();return(0,s.jsx)(A.A,{title:e({id:"Tz0i8g"}),children:(0,s.jsx)(_,{})})}const nt=(0,tt.z)((0,q.T)(et))},87498(R,C,t){t.d(C,{z:()=>c});var s=t(36870),v=t(86326),A=t(85417),h=t(3310),O=t(31459),x=t(84527),U=t(51231);function c(b){function M(S){const{authState:E}=(0,h.As)(),[P,I]=(0,v.useState)(!1),p=E?.type==="user"?E.user.org.id:void 0,{data:D,error:B}=(0,O.II)({orgId:p},{enabled:!P&&p!=null}),L=(0,v.useMemo)(()=>
1{if((0,x.maxBlockingUsersExceeded)(D?.planName,D?.currentMemberCount))return"/upgrade";if((0,x.isExpiredEnterprisePlan)(D?.planName,D?.planExpiresAt??void 0))return"/blocked"},[D?.planName,D?.currentMemberCount,D?.planExpiresAt]);return B&&!P&&I(!0),L!=null?(0,s.jsx)(A.C5,{to:(0,h.Ii)({authState:E,path:L}),replace:!0}):(0,s.jsx)(b,{...S})}return(0,U.o)(M)}},90670(R,C,t){t.d(C,{T:()=>O});var s=t(36870),v=t(86326),A=t(85417),h=t(3310);function O(x){function U(c){const{authState:b}=(0,h.As)();return(0,v.useMemo)(()=>b?.type==="user"&&b.user.admin,[b])?(0,s.jsx)(x,{...c}):(0,s.jsx)(A.C5,{to:(0,h.Ii)({authState:b,path:"/dashboard",includeProjectSegment:!0}),replace:!0})}return U}}}]);})();
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.