1import{j as C,S as Qe,r as M,cq as Ce,b as Ft,B as Gt,h as Ve,T as ct,e as Bt,f as hr,d as pr,u as vr}from"./index-BrT3F50e.js";import{d as We,f as ut,n as fr}from"./dayjs-CSchl2My.js";import{n as mr}from"./numbro-B2pgkeWL.js";import{f as yr,a as br,c as xr,b as Sr,e as _r,F as Ar}from"./index-aiUU9uK4.js";import{h as Cr,f as wr,a as Dr,c as Lr}from"./index-CERVQ99E.js";import{P as N,D as dt,r as we,d as jt,f as zt,S as gt,g as ht,l as Ge,_ as Y,h as Et,j as $,k as Je,m as Nt,n as Mt,o as pt,p as Pe,q as re,s as et,t as Ir,v as Tr,w as te,x as J,y as Vt,z as Pr,A as $e,G as tt,B as kr,C as ae,E as Wt,F as $t,H as ke,I as ce,J as H,K as Yt,L as rt,M as Rr,N as Or,O as Ht,Q as Ut,T as Fr,U as Gr,V as Z,W as Br,X as jr,Y as zr,Z as Er,$ as Nr,a0 as De,a1 as q,a2 as Xt,a3 as Mr,a4 as le,a5 as Vr,a6 as Wr,a7 as $r,a8 as Ye,a9 as Yr,aa as Hr,ab as Ur,ac as Xr,ad as qr,ae as qt,af as He,ag as vt,ah as Zt,ai as Zr,aj as Le,ak as Kr,al as Kt,am as Qr,an as Jr,ao as ea,ap as ta,aq as ra,ar as ft,as as mt,at as aa,au as fe,av as na,aw as ia,ax as oa,ay as sa,az as la,aA as ca,aB as ua,u as Ie,R as da,e as ga,i as ha,b as pa,a as va,c as fa}from"./core-B7EWEoEU.js";import{A as Qt}from"./index-DRrMmQ2c.js";import{F as Jt}from"./Table-6SzYbSzL.js";import{n as er}from"./timezoneNormalizer-l1yj-VtS.js";import{T as ma}from"./index-JIFlWX-e.js";import{M as ya}from"./MessageHistoryTable-C_TdmaxS.js";import{l as ba}from"./messages_history-CRZ042o3.js";import{c as xa}from"./contacts-C1xHMXIW.js";import{l as Sa}from"./segment-Bwak2QKo.js";import{S as _a}from"./index-DDdNZ6K1.js";import{T as Aa}from"./index-KB2153Cz.js";import"./styleChecker-CI4V7a_h.js";import"./index-DF5CAhcZ.js";import"./Overflow-BkMYm1DN.js";import"./getAllowClear-C4A34otO.js";import"./Input-DOcZa3u3.js";import"./index-BDXfpOYW.js";import"./useForm-BVKnLQxW.js";import"./LeftOutlined-C9qxU1fR.js";import"./Dropdown-DXdTgnhA.js";import"./index-Cl3KiXUs.js";import"./EllipsisOutlined-Cu-qV7Vg.js";import"./Sider-DNV35gRJ.js";import"./useBreakpoint-FD8ghq8d.js";import"./Pagination-DBPbQz54.js";import"./TextArea-BpydDq59.js";import"./TemplatePreviewDrawer-Dr10TA_N.js";import"./index-Cw5ISF4o.js";import"./index-BI849doy.js";import"./index-DG69r-Xk.js";import"./columns-2-BDWavgY3.js";import"./gapSize-U1swVQyS.js";function tr(a,r,e,t,n,i,o,c){var l=n-a,u=i-r,s=e-a,g=t-r,p=Math.sqrt(s*s+g*g);s/=p,g/=p;var d=l*s+u*g,h=d/p;h*=p;var v=o[0]=a+h*s,f=o[1]=r+h*g;return Math.sqrt((v-n)*(v-n)+(f-i)*(f-i))}var K=new N,B=new N,E=new N,Q=new N,X=new N,Te=[],W=new N;function Ca(a,r){if(r<=180&&r>0){r=r/180*Math.PI,K.fromArray(a[0]),B.fromArray(a[1]),E.fromArray(a[2]),N.sub(Q,K,B),N.sub(X,E,B);var e=Q.len(),t=X.len();if(!(e<.001||t<.001)){Q.scale(1/e),X.scale(1/t);var n=Q.dot(X),i=Math.cos(r);if(i<n){var o=tr(B.x,B.y,E.x,E.y,K.x,K.y,Te);W.fromArray(Te),W.scaleAndAdd(X,o/Math.tan(Math.PI-r));var c=E.x!==B.x?(W.x-B.x)/(E.x-B.x):(W.y-B.y)/(E.y-B.y);if(isNaN(c))return;c<0?N.copy(W,B):c>1&&N.copy(W,E),W.toArray(a[1])}}}}function wa(a,r,e){if(e<=180&&e>0){e=e/180*Math.PI,K.fromArray(a[0]),B.fromArray(a[1]),E.fromArray(a[2]),N.sub(Q,B,K),N.sub(X,E,B);var t=Q.len(),n=X.len();if(!(t<.001||n<.001)){Q.scale(1/t),X.scale(1/n);var i=Q.dot(r),o=Math.cos(e);if(i<o){var c=tr(B.x,B.y,E.x,E.y,K.x,K.y,Te);W.fromArray(Te);var l=Math.PI/2,u=Math.acos(X.dot(r)),s=l+u-e;if(s>=l)N.copy(W,E);else{W.scaleAndAdd(X,c/Math.tan(Math.PI/2-s));var g=E.x!==B.x?(W.x-B.x)/(E.x-B.x):(W.y-B.y)/(E.y-B.y);if(isNaN(g))return;g<0?N.copy(W,B):g>1&&N.copy(W,E)}W.toArray(a[1])}}}}function Be(a,r,e,t){var n=e==="normal",i=n?a:a.ensureState(e);i.ignore=r;var o=t.get("smooth");o&&o===!0&&(o=.3),i.shape=i.shape||{},o>0&&(i.shape.smooth=o);var c=t.getModel("lineStyle").getLineStyle();n?a.useStyle(c):i.style=c}function Da(a,r){var e=r.smooth,t=r.points;if(t)if(a.moveTo(t[0][0],t[0][1]),e>0&&t.length>=3){var n=ht(t[0],t[1]),i=ht(t[1],t[2]);if(!n||!i){a.lineTo(t[1][0],t[1][1]),a.lineTo(t[2][0],t[2][1]);return}var o=Math.min(n,i)*e,c=Ge([],t[1],t[0],o/n),l=Ge([],t[1],t[2],o/i),u=Ge([],c,l,.5);a.bezierCurveTo(c[0],c[1],c[0],c[1],u[0],u[1]),a.bezierCurveTo(l[0],l[1],l[0],l[1],t[2][0],t[2][1])}else for(var s=1;s<t.length;s++)a.lineTo(t[s][0],t[s][1])}function La(a,r,e){var t=a.getTextGuideLine(),n=a.getTextContent();if(!n){t&&a.removeTextGuideLine();return}for(var i=r.normal,o=i.get("show"),c=n.ignore,l=0;l<dt.length;l++){var u=dt[l],s=r[u],g=u==="normal";if(s){var p=s.get("show"),d=g?c:we(n.states[u]&&n.states[u].ignore,c);if(d||!we(p,o)){var h=g?t:t&&t.states[u];h&&(h.ignore=!0),t&&Be(t,!0,u,s);continue}t||(t=new jt,a.setTextGuideLine(t),!g&&(c||!o)&&Be(t,!0,"normal",r.normal),a.stateProxy&&(t.stateProxy=a.stateProxy)),Be(t,!1,u,s)}}if(t){zt(t.style,e),t.style.fill=null;var v=i.get("showAbove"),f=a.textGuideLineConfig=a.textGuideLineConfig||{};f.showAbove=v||!1,t.buildPath=Da}}function Ia(a,r){r=r||"labelLine";for(var e={normal:a.getModel(r)},t=0;t<gt.length;t++){var n=gt[t];e[n]=a.getModel([n,r])}return e}var Ue=(function(a){Y(r,a);function r(){var e=a!==null&&a.apply(this,arguments)||this;return e.type=r.type,e}return r.prototype.getInitialData=function(e,t){return Et(null,this,{useEncodeDefaulter:!0})},r.prototype.getMarkerPosition=function(e,t,n){var i=this.coordinateSystem;if(i&&i.clampData){var o=i.clampData(e),c=i.dataToPoint(o);if(n)$(i.getAxes(),function(p,d){if(p.type==="category"&&t!=null){var h=p.getTicksCoords(),v=p.getTickModel().get("alignWithLabel"),f=o[d],m=t[d]==="x1"||t[d]==="y1";if(m&&!v&&(f+=1),h.length<2)return;if(h.length===2){c[d]=p.toGlobalCoord(p.getExtent()[m?1:0]);return}for(var b=void 0,x=void 0,w=1,_=0;_<h.length;_++){var A=h[_].coord,y=_===h.length-1?h[_-1].tickValue+w:h[_].tickValue;if(y===f){x=A;break}else if(y<f)b=A;else if(b!=null&&y>f){x=(A+b)/2;break}_===1&&(w=y-h[0].tickValue)}
1x==null&&(b?b&&(x=h[h.length-1].coord):x=h[0].coord),c[d]=p.toGlobalCoord(x)}});else{var l=this.getData(),u=l.getLayout("offset"),s=l.getLayout("size"),g=i.getBaseAxis().isHorizontal()?0:1;c[g]+=u+s/2}return c}return[NaN,NaN]},r.type="series.__base_bar__",r.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},r})(Je);Je.registerClass(Ue);var Ta=(function(a){Y(r,a);function r(){var e=a!==null&&a.apply(this,arguments)||this;return e.type=r.type,e}return r.prototype.getInitialData=function(){return Et(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},r.prototype.getProgressive=function(){return this.get("large")?this.get("progressive"):!1},r.prototype.getProgressiveThreshold=function(){var e=this.get("progressiveThreshold"),t=this.get("largeThreshold");return t>e&&(e=t),e},r.prototype.brushSelector=function(e,t,n){return n.rect(t.getItemLayout(e))},r.type="series.bar",r.dependencies=["grid","polar"],r.defaultOption=Nt(Ue.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),r})(Ue),Pa=(function(){function a(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return a})(),yt=(function(a){Y(r,a);function r(e){var t=a.call(this,e)||this;return t.type="sausage",t}return r.prototype.getDefaultShape=function(){return new Pa},r.prototype.buildPath=function(e,t){var n=t.cx,i=t.cy,o=Math.max(t.r0||0,0),c=Math.max(t.r,0),l=(c-o)*.5,u=o+l,s=t.startAngle,g=t.endAngle,p=t.clockwise,d=Math.PI*2,h=p?g-s<d:s-g<d;h||(s=g-(p?d:-d));var v=Math.cos(s),f=Math.sin(s),m=Math.cos(g),b=Math.sin(g);h?(e.moveTo(v*o+n,f*o+i),e.arc(v*u+n,f*u+i,l,-Math.PI+s,s,!p)):e.moveTo(v*c+n,f*c+i),e.arc(n,i,c,s,g,!p),e.arc(m*u+n,b*u+i,l,g-Math.PI*2,g-Math.PI,!p),o!==0&&e.arc(n,i,o,g,s,p)},r})(Mt);function ka(a,r){r=r||{};var e=r.isRoundCap;return function(t,n,i){var o=n.position;if(!o||o instanceof Array)return pt(t,n,i);var c=a(o),l=n.distance!=null?n.distance:5,u=this.shape,s=u.cx,g=u.cy,p=u.r,d=u.r0,h=(p+d)/2,v=u.startAngle,f=u.endAngle,m=(v+f)/2,b=e?Math.abs(p-d)/2:0,x=Math.cos,w=Math.sin,_=s+p*x(v),A=g+p*w(v),y="left",S="top";switch(c){case"startArc":_=s+(d-l)*x(m),A=g+(d-l)*w(m),y="center",S="top";break;case"insideStartArc":_=s+(d+l)*x(m),A=g+(d+l)*w(m),y="center",S="bottom";break;case"startAngle":_=s+h*x(v)+be(v,l+b,!1),A=g+h*w(v)+xe(v,l+b,!1),y="right",S="middle";break;case"insideStartAngle":_=s+h*x(v)+be(v,-l+b,!1),A=g+h*w(v)+xe(v,-l+b,!1),y="left",S="middle";break;case"middle":_=s+h*x(m),A=g+h*w(m),y="center",S="middle";break;case"endArc":_=s+(p+l)*x(m),A=g+(p+l)*w(m),y="center",S="bottom";break;case"insideEndArc":_=s+(p-l)*x(m),A=g+(p-l)*w(m),y="center",S="top";break;case"endAngle":_=s+h*x(f)+be(f,l+b,!0),A=g+h*w(f)+xe(f,l+b,!0),y="left",S="middle";break;case"insideEndAngle":_=s+h*x(f)+be(f,-l+b,!0),A=g+h*w(f)+xe(f,-l+b,!0),y="right",S="middle";break;default:return pt(t,n,i)}return t=t||{},t.x=_,t.y=A,t.align=y,t.verticalAlign=S,t}}function Ra(a,r,e,t){if(Pe(t)){a.setTextConfig({rotation:t});return}else if(re(r)){a.setTextConfig({rotation:0});return}var n=a.shape,i=n.clockwise?n.startAngle:n.endAngle,o=n.clockwise?n.endAngle:n.startAngle,c=(i+o)/2,l,u=e(r);switch(u){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":l=c;break;case"startAngle":case"insideStartAngle":l=i;break;case"endAngle":case"insideEndAngle":l=o;break;default:a.setTextConfig({rotation:0});return}var s=Math.PI*1.5-l;u==="middle"&&s>Math.PI/2&&s<Math.PI*1.5&&(s-=Math.PI),a.setTextConfig({rotation:s})}function be(a,r,e){return r*Math.sin(a)*(e?-1:1)}function xe(a,r,e){return r*Math.cos(a)*(e?1:-1)}function ve(a,r,e){var t=a.get("borderRadius");if(t==null)return e?{cornerRadius:0}:null;re(t)||(t=[t,t,t,t]);var n=Math.abs(r.r||0-r.r0||0);return{cornerRadius:et(t,function(i){return Ir(i,n)})}}var je=Math.max,ze=Math.min;function Oa(a,r){var e=a.getArea&&a.getArea();if($t(a,"cartesian2d")){var t=a.getBaseAxis();if(t.type!=="category"||!t.onBand){var n=r.getLayout("bandWidth");t.isHorizontal()?(e.x-=n,e.width+=n*2):(e.y-=n,e.height+=n*2)}}return e}var Fa=(function(a){Y(r,a);function r(){var e=a.call(this)||this;return e.type=r.type,e._isFirstFrame=!0,e}return r.prototype.render=function(e,t,n,i){this._model=e,this._removeOnRenderedListener(n),this._updateDrawMode(e);
1var o=e.get("coordinateSystem");(o==="cartesian2d"||o==="polar")&&(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(e,t,n):this._renderNormal(e,t,n,i))},r.prototype.incrementalPrepareRender=function(e){this._clear(),this._updateDrawMode(e),this._updateLargeClip(e)},r.prototype.incrementalRender=function(e,t){this._progressiveEls=[],this._incrementalRenderLarge(e,t)},r.prototype.eachRendered=function(e){Tr(this._progressiveEls||this.group,e)},r.prototype._updateDrawMode=function(e){var t=e.pipelineContext.large;(this._isLargeDraw==null||t!==this._isLargeDraw)&&(this._isLargeDraw=t,this._clear())},r.prototype._renderNormal=function(e,t,n,i){var o=this.group,c=e.getData(),l=this._data,u=e.coordinateSystem,s=u.getBaseAxis(),g;u.type==="cartesian2d"?g=s.isHorizontal():u.type==="polar"&&(g=s.dim==="angle");var p=e.isAnimationEnabled()?e:null,d=Ga(e,u);d&&this._enableRealtimeSort(d,c,n);var h=e.get("clip",!0)||d,v=Oa(u,c);o.removeClipPath();var f=e.get("roundCap",!0),m=e.get("showBackground",!0),b=e.getModel("backgroundStyle"),x=b.get("borderRadius")||0,w=[],_=this._backgroundEls,A=i&&i.isInitSort,y=i&&i.type==="changeAxisOrder";function S(I){var D=Se[u.type](c,I),L=Va(u,g,D);return L.useStyle(b.getItemStyle()),u.type==="cartesian2d"?L.setShape("r",x):L.setShape("cornerRadius",x),w[I]=L,L}c.diff(l).add(function(I){var D=c.getItemModel(I),L=Se[u.type](c,I,D);if(m&&S(I),!(!c.hasValue(I)||!At[u.type](L))){var R=!1;h&&(R=bt[u.type](v,L));var P=xt[u.type](e,c,I,L,g,p,s.model,!1,f);d&&(P.forceLabelAnimation=!0),Ct(P,c,I,D,L,e,g,u.type==="polar"),A?P.attr({shape:L}):d?St(d,p,P,L,I,g,!1,!1):te(P,{shape:L},e,I),c.setItemGraphicEl(I,P),o.add(P),P.ignore=R}}).update(function(I,D){var L=c.getItemModel(I),R=Se[u.type](c,I,L);if(m){var P=void 0;_.length===0?P=S(D):(P=_[D],P.useStyle(b.getItemStyle()),u.type==="cartesian2d"?P.setShape("r",x):P.setShape("cornerRadius",x),w[I]=P);var U=Se[u.type](c,I),V=ar(g,U,u);J(P,{shape:V},p,I)}var O=l.getItemGraphicEl(D);if(!c.hasValue(I)||!At[u.type](R)){o.remove(O);return}var F=!1;if(h&&(F=bt[u.type](v,R),F&&o.remove(O)),O?Vt(O):O=xt[u.type](e,c,I,R,g,p,s.model,!!O,f),d&&(O.forceLabelAnimation=!0),y){var j=O.getTextContent();if(j){var G=Pr(j);G.prevValue!=null&&(G.prevValue=G.value)}}else Ct(O,c,I,L,R,e,g,u.type==="polar");A?O.attr({shape:R}):d?St(d,p,O,R,I,g,!0,y):J(O,{shape:R},e,I,null),c.setItemGraphicEl(I,O),O.ignore=F,o.add(O)}).remove(function(I){var D=l.getItemGraphicEl(I);D&&$e(D,e,I)}).execute();var T=this._backgroundGroup||(this._backgroundGroup=new tt);T.removeAll();for(var k=0;k<w.length;++k)T.add(w[k]);o.add(T),this._backgroundEls=w,this._data=c},r.prototype._renderLarge=function(e,t,n){this._clear(),Dt(e,this.group),this._updateLargeClip(e)},r.prototype._incrementalRenderLarge=function(e,t){this._removeBackground(),Dt(t,this.group,this._progressiveEls,!0)},r.prototype._updateLargeClip=function(e){var t=e.get("clip",!0)&&kr(e.coordinateSystem,!1,e),n=this.group;t?n.setClipPath(t):n.removeClipPath()},r.prototype._enableRealtimeSort=function(e,t,n){var i=this;if(t.count()){var o=e.baseAxis;if(this._isFirstFrame)this._dispatchInitSort(t,e,n),this._isFirstFrame=!1;else{var c=function(l){var u=t.getItemGraphicEl(l),s=u&&u.shape;return s&&Math.abs(o.isHorizontal()?s.height:s.width)||0};this._onRendered=function(){i._updateSortWithinSameData(t,c,o,n)},n.getZr().on("rendered",this._onRendered)}}},r.prototype._dataSort=function(e,t,n){var i=[];return e.each(e.mapDimension(t.dim),function(o,c){var l=n(c);l=l??NaN,i.push({dataIndex:c,mappedValue:l,ordinalNumber:o})}),i.sort(function(o,c){return c.mappedValue-o.mappedValue}),{ordinalNumbers:et(i,function(o){return o.ordinalNumber})}},r.prototype._isOrderChangedWithinSameData=function(e,t,n){for(var i=n.scale,o=e.mapDimension(n.dim),c=Number.MAX_VALUE,l=0,u=i.getOrdinalMeta().categories.length;l<u;++l){var s=e.rawIndexOf(o,i.getRawOrdinalNumber(l)),g=s<0?Number.MIN_VALUE:t(e.indexOfRawIndex(s));if(g>c)return!0;c=g}return!1},r.prototype._isOrderDifferentInView=function(e,t){for(var n=t.scale,i=n.getExtent(),o=Math.max(0,i[0]),c=Math.min(i[1],n.getOrdinalMeta().categories.length-1);o<=c;++o)if(e.ordinalNumbers[o]!==n.getRawOrdinalNumber(o))return!0},r.prototype._updateSortWithinSameData=function(e,t,n,i){if(this._isOrderChangedWithinSameData(e,t,n)){var o=this._dataSort(e,n,t);this._isOrderDifferentInView(o,n)&&(this._removeOnRenderedListener(i),i.dispatchAction({type:"changeAxisOrder",componentType:n.dim+"Axis",axisId:n.index,sortInfo:o}))}},r.prototype._dispatchInitSort=function(e,t,n){var i=t.baseAxis,o=this._dataSort(e,i,function(c){return e.get(e.mapDimension(t.otherAxis.dim),c)});n.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",isInitSort:!0,axisId:i.index,sortInfo:o})},r.prototype.remove=function(e,t){this._clear(this._model),this._removeOnRenderedListener(t)},r.prototype.dispose=function(e,t){this._removeOnRenderedListener(t)},r.prototype._removeOnRenderedListener=function(e){this._onRendered&&(e.getZr().off("rendered",this._onRendered),this._onRendered=null)},r.prototype._clear=function(e){var t=this.group,n=this._data;
1e&&e.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl(function(i){$e(i,e,ae(i).dataIndex)})):t.removeAll(),this._data=null,this._isFirstFrame=!0},r.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},r.type="bar",r})(Wt),bt={cartesian2d:function(a,r){var e=r.width<0?-1:1,t=r.height<0?-1:1;e<0&&(r.x+=r.width,r.width=-r.width),t<0&&(r.y+=r.height,r.height=-r.height);var n=a.x+a.width,i=a.y+a.height,o=je(r.x,a.x),c=ze(r.x+r.width,n),l=je(r.y,a.y),u=ze(r.y+r.height,i),s=c<o,g=u<l;return r.x=s&&o>n?c:o,r.y=g&&l>i?u:l,r.width=s?0:c-o,r.height=g?0:u-l,e<0&&(r.x+=r.width,r.width=-r.width),t<0&&(r.y+=r.height,r.height=-r.height),s||g},polar:function(a,r){var e=r.r0<=r.r?1:-1;if(e<0){var t=r.r;r.r=r.r0,r.r0=t}var n=ze(r.r,a.r),i=je(r.r0,a.r0);r.r=n,r.r0=i;var o=n-i<0;if(e<0){var t=r.r;r.r=r.r0,r.r0=t}return o}},xt={cartesian2d:function(a,r,e,t,n,i,o,c,l){var u=new ce({shape:H({},t),z2:1});if(u.__dataIndex=e,u.name="item",i){var s=u.shape,g=n?"height":"width";s[g]=0}return u},polar:function(a,r,e,t,n,i,o,c,l){var u=!n&&l?yt:ke,s=new u({shape:t,z2:1});s.name="item";var g=rr(n);if(s.calculateTextPosition=ka(g,{isRoundCap:u===yt}),i){var p=s.shape,d=n?"r":"endAngle",h={};p[d]=n?t.r0:t.startAngle,h[d]=t[d],(c?J:te)(s,{shape:h},i)}return s}};function Ga(a,r){var e=a.get("realtimeSort",!0),t=r.getBaseAxis();if(e&&t.type==="category"&&r.type==="cartesian2d")return{baseAxis:t,otherAxis:r.getOtherAxis(t)}}function St(a,r,e,t,n,i,o,c){var l,u;i?(u={x:t.x,width:t.width},l={y:t.y,height:t.height}):(u={y:t.y,height:t.height},l={x:t.x,width:t.width}),c||(o?J:te)(e,{shape:l},r,n,null);var s=r?a.baseAxis.model:null;(o?J:te)(e,{shape:u},s,n)}function _t(a,r){for(var e=0;e<r.length;e++)if(!isFinite(a[r[e]]))return!0;return!1}var Ba=["x","y","width","height"],ja=["cx","cy","r","startAngle","endAngle"],At={cartesian2d:function(a){return!_t(a,Ba)},polar:function(a){return!_t(a,ja)}},Se={cartesian2d:function(a,r,e){var t=a.getItemLayout(r),n=e?Ea(e,t):0,i=t.width>0?1:-1,o=t.height>0?1:-1;return{x:t.x+i*n/2,y:t.y+o*n/2,width:t.width-i*n,height:t.height-o*n}},polar:function(a,r,e){var t=a.getItemLayout(r);return{cx:t.cx,cy:t.cy,r0:t.r0,r:t.r,startAngle:t.startAngle,endAngle:t.endAngle,clockwise:t.clockwise}}};function za(a){return a.startAngle!=null&&a.endAngle!=null&&a.startAngle===a.endAngle}function rr(a){return(function(r){var e=r?"Arc":"Angle";return function(t){switch(t){case"start":case"insideStart":case"end":case"insideEnd":return t+e;default:return t}}})(a)}function Ct(a,r,e,t,n,i,o,c){var l=r.getItemVisual(e,"style");if(c){if(!i.get("roundCap")){var s=a.shape,g=ve(t.getModel("itemStyle"),s,!0);H(s,g),a.setShape(s)}}else{var u=t.get(["itemStyle","borderRadius"])||0;a.setShape("r",u)}a.useStyle(l);var p=t.getShallow("cursor");p&&a.attr("cursor",p);var d=c?o?n.r>=n.r0?"endArc":"startArc":n.endAngle>=n.startAngle?"endAngle":"startAngle":o?n.height>=0?"bottom":"top":n.width>=0?"right":"left",h=Yt(t);rt(a,h,{labelFetcher:i,labelDataIndex:e,defaultText:Rr(i.getData(),e),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:d});var v=a.getTextContent();if(c&&v){var f=t.get(["label","position"]);a.textConfig.inside=f==="middle"?!0:null,Ra(a,f==="outside"?d:f,rr(o),t.get(["label","rotate"]))}Or(v,h,i.getRawValue(e),function(b){return Gr(r,b)});var m=t.getModel(["emphasis"]);Ht(a,m.get("focus"),m.get("blurScope"),m.get("disabled")),Ut(a,t),za(n)&&(a.style.fill="none",a.style.stroke="none",$(a.states,function(b){b.style&&(b.style.fill=b.style.stroke="none")}))}function Ea(a,r){var e=a.get(["itemStyle","borderColor"]);if(!e||e==="none")return 0;var t=a.get(["itemStyle","borderWidth"])||0,n=isNaN(r.width)?Number.MAX_VALUE:Math.abs(r.width),i=isNaN(r.height)?Number.MAX_VALUE:Math.abs(r.height);return Math.min(t,n,i)}var Na=(function(){function a(){}return a})(),wt=(function(a){Y(r,a);function r(e){var t=a.call(this,e)||this;return t.type="largeBar",t}return r.prototype.getDefaultShape=function(){return new Na},r.prototype.buildPath=function(e,t){for(var n=t.points,i=this.baseDimIdx,o=1-this.baseDimIdx,c=[],l=[],u=this.barWidth,s=0;s<n.length;
1s+=3)l[i]=u,l[o]=n[s+2],c[i]=n[s+i],c[o]=n[s+o],e.rect(c[0],c[1],l[0],l[1])},r})(Mt);function Dt(a,r,e,t){var n=a.getData(),i=n.getLayout("valueAxisHorizontal")?1:0,o=n.getLayout("largeDataIndices"),c=n.getLayout("size"),l=a.getModel("backgroundStyle"),u=n.getLayout("largeBackgroundPoints");if(u){var s=new wt({shape:{points:u},incremental:!!t,silent:!0,z2:0});s.baseDimIdx=i,s.largeDataIndices=o,s.barWidth=c,s.useStyle(l.getItemStyle()),r.add(s),e&&e.push(s)}var g=new wt({shape:{points:n.getLayout("largePoints")},incremental:!!t,ignoreCoarsePointer:!0,z2:1});g.baseDimIdx=i,g.largeDataIndices=o,g.barWidth=c,r.add(g),g.useStyle(n.getVisual("style")),g.style.stroke=null,ae(g).seriesIndex=a.seriesIndex,a.get("silent")||(g.on("mousedown",Lt),g.on("mousemove",Lt)),e&&e.push(g)}var Lt=Fr(function(a){var r=this,e=Ma(r,a.offsetX,a.offsetY);ae(r).dataIndex=e>=0?e:null},30,!1);function Ma(a,r,e){for(var t=a.baseDimIdx,n=1-t,i=a.shape.points,o=a.largeDataIndices,c=[],l=[],u=a.barWidth,s=0,g=i.length/3;s<g;s++){var p=s*3;if(l[t]=u,l[n]=i[p+2],c[t]=i[p+t],c[n]=i[p+n],l[n]<0&&(c[n]+=l[n],l[n]=-l[n]),r>=c[0]&&r<=c[0]+l[0]&&e>=c[1]&&e<=c[1]+l[1])return o[s]}return-1}function ar(a,r,e){if($t(e,"cartesian2d")){var t=r,n=e.getArea();return{x:a?t.x:n.x,y:a?n.y:t.y,width:a?t.width:n.width,height:a?n.height:t.height}}else{var n=e.getArea(),i=r;return{cx:n.cx,cy:n.cy,r0:a?n.r0:i.r0,r:a?n.r:i.r,startAngle:a?i.startAngle:0,endAngle:a?i.endAngle:Math.PI*2}}}function Va(a,r,e){var t=a.type==="polar"?ke:ce;return new t({shape:ar(r,e,a),silent:!0,z2:0})}function Wa(a){a.registerChartView(Fa),a.registerSeriesModel(Ta),a.registerLayout(a.PRIORITY.VISUAL.LAYOUT,Z(Br,"bar")),a.registerLayout(a.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,jr("bar")),a.registerProcessor(a.PRIORITY.PROCESSOR.STATISTIC,zr("bar")),a.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(r,e){var t=r.componentType||"series";e.eachComponent({mainType:t,query:r},function(n){r.sortInfo&&n.axis.setCategorySortInfo(r.sortInfo)})})}var It=Math.PI*2,_e=Math.PI/180;function nr(a,r){return De(a.getBoxLayoutParams(),{width:r.getWidth(),height:r.getHeight()})}function ir(a,r){var e=nr(a,r),t=a.get("center"),n=a.get("radius");re(n)||(n=[0,n]);var i=q(e.width,r.getWidth()),o=q(e.height,r.getHeight()),c=Math.min(i,o),l=q(n[0],c/2),u=q(n[1],c/2),s,g,p=a.coordinateSystem;if(p){var d=p.dataToPoint(t);s=d[0]||0,g=d[1]||0}else re(t)||(t=[t,t]),s=q(t[0],i)+e.x,g=q(t[1],o)+e.y;return{cx:s,cy:g,r0:l,r:u}}function $a(a,r,e){r.eachSeriesByType(a,function(t){var n=t.getData(),i=n.mapDimension("value"),o=nr(t,e),c=ir(t,e),l=c.cx,u=c.cy,s=c.r,g=c.r0,p=-t.get("startAngle")*_e,d=t.get("endAngle"),h=t.get("padAngle")*_e;d=d==="auto"?p-It:-d*_e;var v=t.get("minAngle")*_e,f=v+h,m=0;n.each(i,function(V){!isNaN(V)&&m++});var b=n.getSum(i),x=Math.PI/(b||m)*2,w=t.get("clockwise"),_=t.get("roseType"),A=t.get("stillShowZeroSum"),y=n.getDataExtent(i);y[0]=0;var S=w?1:-1,T=[p,d],k=S*h/2;Er(T,!w),p=T[0],d=T[1];var I=or(t);I.startAngle=p,I.endAngle=d,I.clockwise=w;var D=Math.abs(d-p),L=D,R=0,P=p;if(n.setLayout({viewRect:o,r:s}),n.each(i,function(V,O){var F;if(isNaN(V)){n.setItemLayout(O,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:w,cx:l,cy:u,r0:g,r:_?NaN:s});return}_!=="area"?F=b===0&&A?x:V*x:F=D/m,F<f?(F=f,L-=f):R+=V;var j=P+S*F,G=0,z=0;h>F?(G=P+S*F/2,z=G):(G=P+k,z=j-k),n.setItemLayout(O,{angle:F,startAngle:G,endAngle:z,clockwise:w,cx:l,cy:u,r0:g,r:_?Nr(V,y,[g,s]):s}),P=j}),L<It&&m)if(L<=.001){var U=D/m;n.each(i,function(V,O){if(!isNaN(V)){var F=n.getItemLayout(O);F.angle=U;var j=0,G=0;U<h?(j=p+S*(O+1/2)*U,G=j):(j=p+S*O*U+k,G=p+S*(O+1)*U-k),F.startAngle=j,F.endAngle=G}})}else x=L/R,P=p,n.each(i,function(V,O){if(!isNaN(V)){var F=n.getItemLayout(O),j=F.angle===f?f:V*x,G=0,z=0;j<h?(G=P+S*j/2,z=G):(G=P+k,z=P+S*j-k),F.startAngle=G,F.endAngle=z,P+=S*j}})})}var or=Xt();function Ya(a){return{seriesType:a,reset:function(r,e){var t=e.findComponents({mainType:"legend"});if(!(!t||!t.length)){var n=r.getData();n.filterSelf(function(i){for(var o=n.getName(i),c=0;c<t.length;c++)if(!t[c].isSelected(o))return!1;return!0})}}}}var Ha=Math.PI/180;function Tt(a,r,e,t,n,i,o,c,l,u){if(a.length<2)return;function s(v){for(var f=v.rB,m=f*f,b=0;b<v.list.length;b++){var x=v.list[b],w=Math.abs(x.label.y-e),_=t+x.len,A=_*_,y=Math.sqrt(Math.abs((1-w*w/m)*A)),S=r+(y+x.len2)*n,T=S-x.label.x,k=x.targetTextWidth-T*n;sr(x,k,!0),x.label.x=S}}function g(v){for(var f={list:[],maxY:0},m={list:[],maxY:0},b=0;b<v.length;b++)if(v[b].labelAlignTo==="none"){var x=v[b],w=x.label.y>e?m:f,_=Math.abs(x.label.y-e);if(_>=w.maxY){var A=x.label.x-r-x.len2*n,y=t+x.len,S=Math.abs(A)<y?Math.sqrt(_*_/(1-A*A/y/y)):y;w.rB=S,w.maxY=_}w.list.push(x)}s(f),s(m)}for(var p=a.length,d=0;d<p;d++)if(a[d].position==="outer"&&a[d].labelAlignTo==="labelLine"){var h=a[d].label.x-u;a[d].linePoints[1][0]+=h,a[d].label.x=u}Mr(a,l,l+o)&&g(a)}function Ua(a,r,e,t,n,i,o,c){for(var l=[],u=[],s=Number.MAX_VALUE,g=-Number.MAX_VALUE,p=0;p<a.length;p++){var d=a[p].label;Ee(a[p])||(d.x<r?(s=Math.min(s,d.x),l.push(a[p])):(g=Math.max(g,d.x),u.push(a[p])))}for(var p=0;p<a.length;p++){var h=a[p];if(!Ee(h)&&h.linePoints){if(h.labelStyleWidth!=null)continue;var d=h.label,v=h.linePoints,f=void 0;h.labelAlignTo==="edge"?d.x<r?f=v[2][0]-h.labelDistance-o-h.edgeDistance:f=o+n-h.edgeDistance-v[2][0]-h.labelDistance:h.labelAlignTo==="labelLine"?d.x<r?f=s-o-h.bleedMargin:f=o+n-g-h.bleedMargin:d.x<r?f=d.x-o-h.bleedMargin:f=o+n-d.x-h.bleedMargin,h.targetTextWidth=f,sr(h,f)}}Tt(u,r,e,t,1,n,i,o,c,g),Tt(l,r,e,t,-1,n,i,o,c,s);for(var p=0;p<a.length;p++){var h=a[p];if(!Ee(h)&&h.linePoints){var d=h.label,v=h.linePoints,m=h.labelAlignTo==="edge",b=d.style.padding,x=b?b[1]+b[3]:0,w=d.style.backgroundColor?0:x,_=h.rect.width+w,A=v[1][0]-v[2][0];m?d.x<r?v[2][0]=o+h.edgeDistance+_+h.labelDistance:v[2][0]=o+n-h.edgeDistance-_-h.labelDistance:(d.x<r?v[2][0]=d.x+h.labelDistance:v[2][0]=d.x-h.labelDistance,v[1][0]=v[2][0]+A),v[1][1]=v[2][1]=d.y}}}function sr(a,r,e){if(e===void 0&&(e=!1),a.labelStyleWidth==null){var t=a.label,n=t.style,i=a.rect,o=n.backgroundColor,c=n.padding,l=c?c[1]+c[3]:0,u=n.overflow,s=i.width+(o?0:l);if(r<s||e){var g=i.height;if(u&&u.match("break")){t.setStyle("backgroundColor",null),t.setStyle("width",r-l);
1var p=t.getBoundingRect();t.setStyle("width",Math.ceil(p.width)),t.setStyle("backgroundColor",o)}else{var d=r-l,h=r<s?d:e?d>a.unconstrainedWidth?null:d:null;t.setStyle("width",h)}var v=t.getBoundingRect();i.width=v.width;var f=(t.style.margin||0)+2.1;i.height=v.height+f,i.y-=(i.height-g)/2}}}function Ee(a){return a.position==="center"}function Xa(a){var r=a.getData(),e=[],t,n,i=!1,o=(a.get("minShowLabelAngle")||0)*Ha,c=r.getLayout("viewRect"),l=r.getLayout("r"),u=c.width,s=c.x,g=c.y,p=c.height;function d(A){A.ignore=!0}function h(A){if(!A.ignore)return!0;for(var y in A.states)if(A.states[y].ignore===!1)return!0;return!1}r.each(function(A){var y=r.getItemGraphicEl(A),S=y.shape,T=y.getTextContent(),k=y.getTextGuideLine(),I=r.getItemModel(A),D=I.getModel("label"),L=D.get("position")||I.get(["emphasis","label","position"]),R=D.get("distanceToLabelLine"),P=D.get("alignTo"),U=q(D.get("edgeDistance"),u),V=D.get("bleedMargin"),O=I.getModel("labelLine"),F=O.get("length");F=q(F,u);var j=O.get("length2");if(j=q(j,u),Math.abs(S.endAngle-S.startAngle)<o){$(T.states,d),T.ignore=!0,k&&($(k.states,d),k.ignore=!0);return}if(h(T)){var G=(S.startAngle+S.endAngle)/2,z=Math.cos(G),ee=Math.sin(G),ue,me,at,ye;t=S.cx,n=S.cy;var ne=L==="inside"||L==="inner";if(L==="center")ue=S.cx,me=S.cy,ye="center";else{var Re=(ne?(S.r+S.r0)/2*z:S.r*z)+t,Oe=(ne?(S.r+S.r0)/2*ee:S.r*ee)+n;if(ue=Re+z*3,me=Oe+ee*3,!ne){var nt=Re+z*(F+l-S.r),it=Oe+ee*(F+l-S.r),ot=nt+(z<0?-1:1)*j,st=it;P==="edge"?ue=z<0?s+U:s+u-U:ue=ot+(z<0?-R:R),me=st,at=[[Re,Oe],[nt,it],[ot,st]]}ye=ne?"center":P==="edge"?z>0?"right":"left":z>0?"left":"right"}var de=Math.PI,ie=0,ge=D.get("rotate");if(Pe(ge))ie=ge*(de/180);else if(L==="center")ie=0;else if(ge==="radial"||ge===!0){var dr=z<0?-G+de:-G;ie=dr}else if(ge==="tangential"&&L!=="outside"&&L!=="outer"){var oe=Math.atan2(z,ee);oe<0&&(oe=de*2+oe);var gr=ee>0;gr&&(oe=de+oe),ie=oe-de}if(i=!!ie,T.x=ue,T.y=me,T.rotation=ie,T.setStyle({verticalAlign:"middle"}),ne){T.setStyle({align:ye});var Fe=T.states.select;Fe&&(Fe.x+=T.x,Fe.y+=T.y)}else{var he=T.getBoundingRect().clone();he.applyTransform(T.getComputedTransform());var lt=(T.style.margin||0)+2.1;he.y-=lt/2,he.height+=lt,e.push({label:T,labelLine:k,position:L,len:F,len2:j,minTurnAngle:O.get("minTurnAngle"),maxSurfaceAngle:O.get("maxSurfaceAngle"),surfaceNormal:new N(z,ee),linePoints:at,textAlign:ye,labelDistance:R,labelAlignTo:P,edgeDistance:U,bleedMargin:V,rect:he,unconstrainedWidth:he.width,labelStyleWidth:T.style.width})}y.setTextConfig({inside:ne})}}),!i&&a.get("avoidLabelOverlap")&&Ua(e,t,n,l,u,p,s,g);for(var v=0;v<e.length;v++){var f=e[v],m=f.label,b=f.labelLine,x=isNaN(m.x)||isNaN(m.y);if(m){m.setStyle({align:f.textAlign}),x&&($(m.states,d),m.ignore=!0);var w=m.states.select;w&&(w.x+=m.x,w.y+=m.y)}if(b){var _=f.linePoints;x||!_?($(b.states,d),b.ignore=!0):(Ca(_,f.minTurnAngle),wa(_,f.surfaceNormal,f.maxSurfaceAngle),b.setShape({points:_}),m.__hostTarget.textGuideLineConfig={anchor:new N(_[0][0],_[0][1])})}}}var qa=(function(a){Y(r,a);function r(e,t,n){var i=a.call(this)||this;i.z2=2;var o=new le;return i.setTextContent(o),i.updateData(e,t,n,!0),i}return r.prototype.updateData=function(e,t,n,i){var o=this,c=e.hostModel,l=e.getItemModel(t),u=l.getModel("emphasis"),s=e.getItemLayout(t),g=H(ve(l.getModel("itemStyle"),s,!0),s);if(isNaN(g.startAngle)){o.setShape(g);return}if(i){o.setShape(g);var p=c.getShallow("animationType");c.ecModel.ssr?(te(o,{scaleX:0,scaleY:0},c,{dataIndex:t,isFrom:!0}),o.originX=g.cx,o.originY=g.cy):p==="scale"?(o.shape.r=s.r0,te(o,{shape:{r:s.r}},c,t)):n!=null?(o.setShape({startAngle:n,endAngle:n}),te(o,{shape:{startAngle:s.startAngle,endAngle:s.endAngle}},c,t)):(o.shape.endAngle=s.startAngle,J(o,{shape:{endAngle:s.endAngle}},c,t))}else Vt(o),J(o,{shape:g},c,t);o.useStyle(e.getItemVisual(t,"style")),Ut(o,l);var d=(s.startAngle+s.endAngle)/2,h=c.get("selectedOffset"),v=Math.cos(d)*h,f=Math.sin(d)*h,m=l.getShallow("cursor");m&&o.attr("cursor",m),this._updateLabel(c,e,t),o.ensureState("emphasis").shape=H({r:s.r+(u.get("scale")&&u.get("scaleSize")||0)},ve(u.getModel("itemStyle"),s)),H(o.ensureState("select"),{x:v,y:f,shape:ve(l.getModel(["select","itemStyle"]),s)}),H(o.ensureState("blur"),{shape:ve(l.getModel(["blur","itemStyle"]),s)});var b=o.getTextGuideLine(),x=o.getTextContent();b&&H(b.ensureState("select"),{x:v,y:f}),H(x.ensureState("select"),{x:v,y:f}),Ht(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},r.prototype._updateLabel=function(e,t,n){var i=this,o=t.getItemModel(n),c=o.getModel("labelLine"),l=t.getItemVisual(n,"style"),u=l&&l.fill,s=l&&l.opacity;rt(i,Yt(o),{labelFetcher:t.hostModel,labelDataIndex:n,inheritColor:u,defaultOpacity:s,defaultText:e.getFormattedLabel(n,"normal")||t.getName(n)});var g=i.getTextContent();i.setTextConfig({position:null,rotation:null}),g.attr({z2:10});var p=e.get(["label","position"]);if(p!=="outside"&&p!=="outer")i.removeTextGuideLine();else{var d=this.getTextGuideLine();d||(d=new jt,this.setTextGuideLine(d)),La(this,Ia(o),{stroke:u,opacity:Vr(c.get(["lineStyle","opacity"]),s,1)})}},r})(ke),Za=(function(a){Y(r,a);function r(){var e=a!==null&&a.apply(this,arguments)||this;return e.ignoreLabelLineUpdate=!0,e}return r.prototype.render=function(e,t,n,i){var o=e.getData(),c=this._data,l=this.group,u;if(!c&&o.count()>0){for(var s=o.getItemLayout(0),g=1;isNaN(s&&s.startAngle)&&g<o.count();++g)s=o.getItemLayout(g);s&&(u=s.startAngle)}if(this._emptyCircleSector&&l.remove(this._emptyCircleSector),o.count()===0&&e.get("showEmptyCircle")){var p=or(e),d=new ke({shape:H(ir(e,n),p)});d.useStyle(e.getModel("emptyCircleStyle").getItemStyle()),this._emptyCircleSector=d,l.add(d)}o.diff(c).add(function(h){var v=new qa(o,h,u);o.setItemGraphicEl(h,v),l.add(v)}).update(function(h,v){var f=c.getItemGraphicEl(v);f.updateData(o,h,u),f.off("click"),l.add(f),o.setItemGraphicEl(h,f)}).remove(function(h){var v=c.getItemGraphicEl(h);$e(v,e,h)}).execute(),Xa(e),e.get("animationTypeUpdate")!=="expansion"&&(this._data=o)},r.prototype.dispose=function(){},r.prototype.containPoint=function(e,t){var n=t.getData(),i=n.getItemLayout(0);if(i){var o=e[0]-i.cx,c=e[1]-i.cy,l=Math.sqrt(o*o+c*c);return l<=i.r&&l>=i.r0}},r.type="pie",r})(Wt);function Ka(a,r,e){r=re(r)&&{coordDimensions:r}||H({encodeDefine:a.getEncode()},r);var t=a.getSource(),n=Wr(t,r).dimensions,i=new $r(n,a);return i.initData(t,e),i}var Qa=(function(){function a(r,e){this._getDataWithEncodedVisual=r,this._getRawData=e}return a.prototype.getAllNames=function(){var r=this._getRawData();return r.mapArray(r.getName)},a.prototype.containName=function(r){var e=this._getRawData();return e.indexOfName(r)>=0},a.prototype.indexOfName=function(r){var e=this._getDataWithEncodedVisual();return e.indexOfName(r)},a.prototype.getItemVisual=function(r,e){var t=this._getDataWithEncodedVisual();return t.getItemVisual(r,e)},a})(),Ja=Xt(),en=(function(a){Y(r,a);function r(){return a!==null&&a.apply(this,arguments)||this}
1return r.prototype.init=function(e){a.prototype.init.apply(this,arguments),this.legendVisualProvider=new Qa(Ye(this.getData,this),Ye(this.getRawData,this)),this._defaultLabelLine(e)},r.prototype.mergeOption=function(){a.prototype.mergeOption.apply(this,arguments)},r.prototype.getInitialData=function(){return Ka(this,{coordDimensions:["value"],encodeDefaulter:Z(Yr,this)})},r.prototype.getDataParams=function(e){var t=this.getData(),n=Ja(t),i=n.seats;if(!i){var o=[];t.each(t.mapDimension("value"),function(l){o.push(l)}),i=n.seats=Hr(o,t.hostModel.get("percentPrecision"))}var c=a.prototype.getDataParams.call(this,e);return c.percent=i[e]||0,c.$vars.push("percent"),c},r.prototype._defaultLabelLine=function(e){Ur(e,"labelLine",["show"]);var t=e.labelLine,n=e.emphasis.labelLine;t.show=t.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},r.type="series.pie",r.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},r})(Je);function tn(a){return{seriesType:a,reset:function(r,e){var t=r.getData();t.filterSelf(function(n){var i=t.mapDimension("value"),o=t.get(i,n);return!(Pe(o)&&!isNaN(o)&&o<0)})}}}function rn(a){a.registerChartView(Za),a.registerSeriesModel(en),Xr("pie",a.registerAction),a.registerLayout(Z($a,"pie")),a.registerProcessor(Ya("pie")),a.registerProcessor(tn("pie"))}function an(a,r){var e=qr(r.get("padding")),t=r.getItemStyle(["color","opacity"]);return t.fill=r.get("backgroundColor"),a=new ce({shape:{x:a.x-e[3],y:a.y-e[0],width:a.width+e[1]+e[3],height:a.height+e[0]+e[2],r:r.get("borderRadius")},style:t,silent:!0,z2:-1}),a}var nn=(function(a){Y(r,a);function r(){var e=a!==null&&a.apply(this,arguments)||this;return e.type=r.type,e.layoutMode={type:"box",ignoreSize:!0},e}return r.type="title",r.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},r})(qt),on=(function(a){Y(r,a);function r(){var e=a!==null&&a.apply(this,arguments)||this;return e.type=r.type,e}return r.prototype.render=function(e,t,n){if(this.group.removeAll(),!!e.get("show")){var i=this.group,o=e.getModel("textStyle"),c=e.getModel("subtextStyle"),l=e.get("textAlign"),u=we(e.get("textBaseline"),e.get("textVerticalAlign")),s=new le({style:He(o,{text:e.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),g=s.getBoundingRect(),p=e.get("subtext"),d=new le({style:He(c,{text:p,fill:c.getTextColor(),y:g.height+e.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),h=e.get("link"),v=e.get("sublink"),f=e.get("triggerEvent",!0);s.silent=!h&&!f,d.silent=!v&&!f,h&&s.on("click",function(){vt(h,"_"+e.get("target"))}),v&&d.on("click",function(){vt(v,"_"+e.get("subtarget"))}),ae(s).eventData=ae(d).eventData=f?{componentType:"title",componentIndex:e.componentIndex}:null,i.add(s),p&&i.add(d);var m=i.getBoundingRect(),b=e.getBoxLayoutParams();b.width=m.width,b.height=m.height;var x=De(b,{width:n.getWidth(),height:n.getHeight()},e.get("padding"));l||(l=e.get("left")||e.get("right"),l==="middle"&&(l="center"),l==="right"?x.x+=x.width:l==="center"&&(x.x+=x.width/2)),u||(u=e.get("top")||e.get("bottom"),u==="center"&&(u="middle"),u==="bottom"?x.y+=x.height:u==="middle"&&(x.y+=x.height/2),u=u||"top"),i.x=x.x,i.y=x.y,i.markRedraw();var w={align:l,verticalAlign:u};
1s.setStyle(w),d.setStyle(w),m=i.getBoundingRect();var _=x.margin,A=e.getItemStyle(["color","opacity"]);A.fill=e.get("backgroundColor");var y=new ce({shape:{x:m.x-_[3],y:m.y-_[0],width:m.width+_[1]+_[3],height:m.height+_[0]+_[2],r:e.get("borderRadius")},style:A,subPixelOptimize:!0,silent:!0});i.add(y)}},r.type="title",r})(Zt);function sn(a){a.registerComponentModel(nn),a.registerComponentView(on)}var ln=function(a,r){if(r==="all")return{type:"all",title:a.getLocaleModel().get(["legend","selector","all"])};if(r==="inverse")return{type:"inverse",title:a.getLocaleModel().get(["legend","selector","inverse"])}},Xe=(function(a){Y(r,a);function r(){var e=a!==null&&a.apply(this,arguments)||this;return e.type=r.type,e.layoutMode={type:"box",ignoreSize:!0},e}return r.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),e.selected=e.selected||{},this._updateSelector(e)},r.prototype.mergeOption=function(e,t){a.prototype.mergeOption.call(this,e,t),this._updateSelector(e)},r.prototype._updateSelector=function(e){var t=e.selector,n=this.ecModel;t===!0&&(t=e.selector=["all","inverse"]),re(t)&&$(t,function(i,o){Le(i)&&(i={type:i}),t[o]=Zr(i,ln(n,i.type))})},r.prototype.optionUpdated=function(){this._updateData(this.ecModel);var e=this._data;if(e[0]&&this.get("selectedMode")==="single"){for(var t=!1,n=0;n<e.length;n++){var i=e[n].get("name");if(this.isSelected(i)){this.select(i),t=!0;break}}!t&&this.select(e[0].get("name"))}},r.prototype._updateData=function(e){var t=[],n=[];e.eachRawSeries(function(l){var u=l.name;n.push(u);var s;if(l.legendVisualProvider){var g=l.legendVisualProvider,p=g.getAllNames();e.isSeriesFiltered(l)||(n=n.concat(p)),p.length?t=t.concat(p):s=!0}else s=!0;s&&Kr(l)&&t.push(l.name)}),this._availableNames=n;var i=this.get("data")||t,o=Kt(),c=et(i,function(l){return(Le(l)||Pe(l))&&(l={name:l}),o.get(l.name)?null:(o.set(l.name,!0),new Qr(l,this,this.ecModel))},this);this._data=Jr(c,function(l){return!!l})},r.prototype.getData=function(){return this._data},r.prototype.select=function(e){var t=this.option.selected,n=this.get("selectedMode");if(n==="single"){var i=this._data;$(i,function(o){t[o.get("name")]=!1})}t[e]=!0},r.prototype.unSelect=function(e){this.get("selectedMode")!=="single"&&(this.option.selected[e]=!1)},r.prototype.toggleSelected=function(e){var t=this.option.selected;t.hasOwnProperty(e)||(t[e]=!0),this[t[e]?"unSelect":"select"](e)},r.prototype.allSelect=function(){var e=this._data,t=this.option.selected;$(e,function(n){t[n.get("name",!0)]=!0})},r.prototype.inverseSelect=function(){var e=this._data,t=this.option.selected;$(e,function(n){var i=n.get("name",!0);t.hasOwnProperty(i)||(t[i]=!0),t[i]=!t[i]})},r.prototype.isSelected=function(e){var t=this.option.selected;return!(t.hasOwnProperty(e)&&!t[e])&&ea(this._availableNames,e)>=0},r.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},r.type="legend.plain",r.dependencies=["series"],r.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miter
1Limit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},r})(qt),se=Z,qe=$,Ae=tt,lr=(function(a){Y(r,a);function r(){var e=a!==null&&a.apply(this,arguments)||this;return e.type=r.type,e.newlineDisabled=!1,e}return r.prototype.init=function(){this.group.add(this._contentGroup=new Ae),this.group.add(this._selectorGroup=new Ae),this._isFirstRender=!0},r.prototype.getContentGroup=function(){return this._contentGroup},r.prototype.getSelectorGroup=function(){return this._selectorGroup},r.prototype.render=function(e,t,n){var i=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!e.get("show",!0)){var o=e.get("align"),c=e.get("orient");(!o||o==="auto")&&(o=e.get("left")==="right"&&c==="vertical"?"right":"left");var l=e.get("selector",!0),u=e.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=c==="horizontal"?"end":"start"),this.renderInner(o,e,t,n,l,c,u);var s=e.getBoxLayoutParams(),g={width:n.getWidth(),height:n.getHeight()},p=e.get("padding"),d=De(s,g,p),h=this.layoutInner(e,o,d,i,l,u),v=De(zt({width:h.width,height:h.height},s),g,p);this.group.x=v.x-h.x,this.group.y=v.y-h.y,this.group.markRedraw(),this.group.add(this._backgroundEl=an(h,e))}},r.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},r.prototype.renderInner=function(e,t,n,i,o,c,l){var u=this.getContentGroup(),s=Kt(),g=t.get("selectedMode"),p=[];n.eachRawSeries(function(d){!d.get("legendHoverLink")&&p.push(d.id)}),qe(t.getData(),function(d,h){var v=d.get("name");if(!this.newlineDisabled&&(v===""||v===` 2`)){var f=new Ae;f.newline=!0,u.add(f);return}var m=n.getSeriesByName(v)[0];if(!s.get(v))if(m){var b=m.getData(),x=b.getVisual("legendLineStyle")||{},w=b.getVisual("legendIcon"),_=b.getVisual("style"),A=this._createItem(m,v,h,d,t,e,x,_,w,g,i);A.on("click",se(Pt,v,null,i,p)).on("mouseover",se(Ze,m.name,null,i,p)).on("mouseout",se(Ke,m.name,null,i,p)),n.ssr&&A.eachChild(function(y){var S=ae(y);S.seriesIndex=m.seriesIndex,S.dataIndex=h,S.ssrType="legend"}),s.set(v,!0)}else n.eachRawSeries(function(y){if(!s.get(v)&&y.legendVisualProvider){var S=y.legendVisualProvider;if(!S.containName(v))return;var T=S.indexOfName(v),k=S.getItemVisual(T,"style"),I=S.getItemVisual(T,"legendIcon"),D=ta(k.fill);D&&D[3]===0&&(D[3]=.2,k=H(H({},k),{fill:ra(D,"rgba")}));var L=this._createItem(y,v,h,d,t,e,{},k,I,g,i);L.on("click",se(Pt,null,v,i,p)).on("mouseover",se(Ze,null,v,i,p)).on("mouseout",se(Ke,null,v,i,p)),n.ssr&&L.eachChild(function(R){var P=ae(R);P.seriesIndex=y.seriesIndex,P.dataIndex=h,P.ssrType="legend"}),s.set(v,!0)}},this)},this),o&&this._createSelector(o,t,i,c,l)},r.prototype._createSelector=function(e,t,n,i,o){var c=this.getSelectorGroup();qe(e,function(u){var s=u.type,g=new le({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:s==="all"?"legendAllSelect":"legendInverseSelect",legendId:t.id})}});c.add(g);var p=t.getModel("selectorLabel"),d=t.getModel(["emphasis","selectorLabel"]);rt(g,{normal:p,emphasis:d},{defaultText:u.title}),ft(g)})},r.prototype._createItem=function(e,t,n,i,o,c,l,u,s,g,p){var d=e.visualDrawType,h=o.get("itemWidth"),v=o.get("itemHeight"),f=o.isSelected(t),m=i.get("symbolRotate"),b=i.get("symbolKeepAspect"),x=i.get("icon");s=x||s||"roundRect";var w=cn(s,i,l,u,d,f,p),_=new Ae,A=i.getModel("textStyle");if(mt(e.getLegendIcon)&&(!x||x==="inherit"))_.add(e.getLegendIcon({itemWidth:h,itemHeight:v,icon:s,iconRotate:m,itemStyle:w.itemStyle,lineStyle:w.lineStyle,symbolKeepAspect:b}));else{var y=x==="inherit"&&e.getData().getVisual("symbol")?m==="inherit"?e.getData().getVisual("symbolRotate"):m:0;_.add(un({itemWidth:h,itemHeight:v,icon:s,iconRotate:y,itemStyle:w.itemStyle,symbolKeepAspect:b}))}var S=c==="left"?h+5:-5,T=c,k=o.get("formatter"),I=t;Le(k)&&k?I=k.replace("{name}",t??""):mt(k)&&(I=k(t));var D=f?A.getTextColor():i.get("inactiveColor");_.add(new le({style:He(A,{text:I,x:S,y:v/2,fill:D,align:T,verticalAlign:"middle"},{inheritColor:D})}));
2var L=new ce({shape:_.getBoundingRect(),style:{fill:"transparent"}}),R=i.getModel("tooltip");return R.get("show")&&aa({el:L,componentModel:o,itemName:t,itemTooltipOption:R.option}),_.add(L),_.eachChild(function(P){P.silent=!0}),L.silent=!g,this.getContentGroup().add(_),ft(_),_.__legendDataIndex=n,_},r.prototype.layoutInner=function(e,t,n,i,o,c){var l=this.getContentGroup(),u=this.getSelectorGroup();fe(e.get("orient"),l,e.get("itemGap"),n.width,n.height);var s=l.getBoundingRect(),g=[-s.x,-s.y];if(u.markRedraw(),l.markRedraw(),o){fe("horizontal",u,e.get("selectorItemGap",!0));var p=u.getBoundingRect(),d=[-p.x,-p.y],h=e.get("selectorButtonGap",!0),v=e.getOrient().index,f=v===0?"width":"height",m=v===0?"height":"width",b=v===0?"y":"x";c==="end"?d[v]+=s[f]+h:g[v]+=p[f]+h,d[1-v]+=s[m]/2-p[m]/2,u.x=d[0],u.y=d[1],l.x=g[0],l.y=g[1];var x={x:0,y:0};return x[f]=s[f]+h+p[f],x[m]=Math.max(s[m],p[m]),x[b]=Math.min(0,p[b]+d[1-v]),x}else return l.x=g[0],l.y=g[1],this.group.getBoundingRect()},r.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},r.type="legend.plain",r})(Zt);function cn(a,r,e,t,n,i,o){function c(f,m){f.lineWidth==="auto"&&(f.lineWidth=m.lineWidth>0?2:0),qe(f,function(b,x){f[x]==="inherit"&&(f[x]=m[x])})}var l=r.getModel("itemStyle"),u=l.getItemStyle(),s=a.lastIndexOf("empty",0)===0?"fill":"stroke",g=l.getShallow("decal");u.decal=!g||g==="inherit"?t.decal:na(g,o),u.fill==="inherit"&&(u.fill=t[n]),u.stroke==="inherit"&&(u.stroke=t[s]),u.opacity==="inherit"&&(u.opacity=(n==="fill"?t:e).opacity),c(u,t);var p=r.getModel("lineStyle"),d=p.getLineStyle();if(c(d,e),u.fill==="auto"&&(u.fill=t.fill),u.stroke==="auto"&&(u.stroke=t.fill),d.stroke==="auto"&&(d.stroke=t.fill),!i){var h=r.get("inactiveBorderWidth"),v=u[s];u.lineWidth=h==="auto"?t.lineWidth>0&&v?2:0:u.lineWidth,u.fill=r.get("inactiveColor"),u.stroke=r.get("inactiveBorderColor"),d.stroke=p.get("inactiveColor"),d.lineWidth=p.get("inactiveWidth")}return{itemStyle:u,lineStyle:d}}function un(a){var r=a.icon||"roundRect",e=ia(r,0,0,a.itemWidth,a.itemHeight,a.itemStyle.fill,a.symbolKeepAspect);return e.setStyle(a.itemStyle),e.rotation=(a.iconRotate||0)*Math.PI/180,e.setOrigin([a.itemWidth/2,a.itemHeight/2]),r.indexOf("empty")>-1&&(e.style.stroke=e.style.fill,e.style.fill="#fff",e.style.lineWidth=2),e}function Pt(a,r,e,t){Ke(a,r,e,t),e.dispatchAction({type:"legendToggleSelect",name:a??r}),Ze(a,r,e,t)}function cr(a){for(var r=a.getZr().storage.getDisplayList(),e,t=0,n=r.length;t<n&&!(e=r[t].states.emphasis);)t++;return e&&e.hoverLayer}function Ze(a,r,e,t){cr(e)||e.dispatchAction({type:"highlight",seriesName:a,name:r,excludeSeriesId:t})}function Ke(a,r,e,t){cr(e)||e.dispatchAction({type:"downplay",seriesName:a,name:r,excludeSeriesId:t})}function dn(a){var r=a.findComponents({mainType:"legend"});r&&r.length&&a.filterSeries(function(e){for(var t=0;t<r.length;t++)if(!r[t].isSelected(e.name))return!1;return!0})}function pe(a,r,e){var t=a==="allSelect"||a==="inverseSelect",n={},i=[];e.eachComponent({mainType:"legend",query:r},function(c){t?c[a]():c[a](r.name),kt(c,n),i.push(c.componentIndex)});var o={};return e.eachComponent("legend",function(c){$(n,function(l,u){c[l?"select":"unSelect"](u)}),kt(c,o)}),t?{selected:o,legendIndex:i}:{name:r.name,selected:o}}function kt(a,r){var e=r||{};return $(a.getData(),function(t){var n=t.get("name");if(!(n===` 3`||n==="")){var i=a.isSelected(n);oa(e,n)?e[n]=e[n]&&i:e[n]=i}}),e}function gn(a){a.registerAction("legendToggleSelect","legendselectchanged",Z(pe,"toggleSelected")),a.registerAction("legendAllSelect","legendselectall",Z(pe,"allSelect")),a.registerAction("legendInverseSelect","legendinverseselect",Z(pe,"inverseSelect")),a.registerAction("legendSelect","legendselected",Z(pe,"select")),a.registerAction("legendUnSelect","legendunselected",Z(pe,"unSelect"))}function ur(a){a.registerComponentModel(Xe),a.registerComponentView(lr),a.registerProcessor(a.PRIORITY.PROCESSOR.SERIES_FILTER,dn),a.registerSubTypeDefaulter("legend",function(){return"plain"}),gn(a)}var hn=(function(a){Y(r,a);function r(){var e=a!==null&&a.apply(this,arguments)||this;return e.type=r.type,e}return r.prototype.setScrollDataIndex=function(e){this.option.scrollDataIndex=e},r.prototype.init=function(e,t,n){var i=sa(e);a.prototype.init.call(this,e,t,n),Rt(this,e,i)},r.prototype.mergeOption=function(e,t){a.prototype.mergeOption.call(this,e,t),Rt(this,this.option,e)},r.type="legend.scroll",r.defaultOption=Nt(Xe.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),r})(Xe);function Rt(a,r,e){var t=a.getOrient(),n=[1,1];n[t.index]=0,la(r,e,{type:"box",ignoreSize:!!n})}var Ot=tt,Ne=["width","height"],Me=["x","y"],pn=(function(a){Y(r,a);function r(){var e=a!==null&&a.apply(this,arguments)||this;return e.type=r.type,e.newlineDisabled=!0,e._currentIndex=0,e}return r.prototype.init=function(){a.prototype.init.call(this),this.group.add(this._containerGroup=new Ot),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new Ot)},r.prototype.resetInner=function(){a.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},r.prototype.renderInner=function(e,t,n,i,o,c,l){var u=this;a.prototype.renderInner.call(this,e,t,n,i,o,c,l);var s=this._controllerGroup,g=t.get("pageIconSize",!0),p=re(g)?g:[g,g];h("pagePrev",0);var d=t.getModel("pageTextStyle");s.add(new le({name:"pageText",style:{text:"xx/xx",fill:d.getTextColor(),font:d.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),h("pageNext",1);function h(v,f){var m=v+"DataIndex",b=ca(t.get("pageIcons",!0)[t.getOrient().name][f],{onclick:Ye(u._pageGo,u,m,t,i)},{x:-p[0]/2,y:-p[1]/2,width:p[0],height:p[1]});b.name=v,s.add(b)}},r.prototype.layoutInner=function(e,t,n,i,o,c){var l=this.getSelectorGroup(),u=e.getOrient().index,s=Ne[u],g=Me[u],p=Ne[1-u],d=Me[1-u];o&&fe("horizontal",l,e.get("selectorItemGap",!0));
3var h=e.get("selectorButtonGap",!0),v=l.getBoundingRect(),f=[-v.x,-v.y],m=ua(n);o&&(m[s]=n[s]-v[s]-h);var b=this._layoutContentAndController(e,i,m,u,s,p,d,g);if(o){if(c==="end")f[u]+=b[s]+h;else{var x=v[s]+h;f[u]-=x,b[g]-=x}b[s]+=v[s]+h,f[1-u]+=b[d]+b[p]/2-v[p]/2,b[p]=Math.max(b[p],v[p]),b[d]=Math.min(b[d],v[d]+f[1-u]),l.x=f[0],l.y=f[1],l.markRedraw()}return b},r.prototype._layoutContentAndController=function(e,t,n,i,o,c,l,u){var s=this.getContentGroup(),g=this._containerGroup,p=this._controllerGroup;fe(e.get("orient"),s,e.get("itemGap"),i?n.width:null,i?null:n.height),fe("horizontal",p,e.get("pageButtonItemGap",!0));var d=s.getBoundingRect(),h=p.getBoundingRect(),v=this._showController=d[o]>n[o],f=[-d.x,-d.y];t||(f[i]=s[u]);var m=[0,0],b=[-h.x,-h.y],x=we(e.get("pageButtonGap",!0),e.get("itemGap",!0));if(v){var w=e.get("pageButtonPosition",!0);w==="end"?b[i]+=n[o]-h[o]:m[i]+=h[o]+x}b[1-i]+=d[c]/2-h[c]/2,s.setPosition(f),g.setPosition(m),p.setPosition(b);var _={x:0,y:0};if(_[o]=v?n[o]:d[o],_[c]=Math.max(d[c],h[c]),_[l]=Math.min(0,h[l]+b[1-i]),g.__rectSize=n[o],v){var A={x:0,y:0};A[o]=Math.max(n[o]-h[o]-x,0),A[c]=_[c],g.setClipPath(new ce({shape:A})),g.__rectSize=A[o]}else p.eachChild(function(S){S.attr({invisible:!0,silent:!0})});var y=this._getPageInfo(e);return y.pageIndex!=null&&J(s,{x:y.contentPosition[0],y:y.contentPosition[1]},v?e:null),this._updatePageInfoView(e,y),_},r.prototype._pageGo=function(e,t,n){var i=this._getPageInfo(t)[e];i!=null&&n.dispatchAction({type:"legendScroll",scrollDataIndex:i,legendId:t.id})},r.prototype._updatePageInfoView=function(e,t){var n=this._controllerGroup;$(["pagePrev","pageNext"],function(s){var g=s+"DataIndex",p=t[g]!=null,d=n.childOfName(s);d&&(d.setStyle("fill",p?e.get("pageIconColor",!0):e.get("pageIconInactiveColor",!0)),d.cursor=p?"pointer":"default")});var i=n.childOfName("pageText"),o=e.get("pageFormatter"),c=t.pageIndex,l=c!=null?c+1:0,u=t.pageCount;i&&o&&i.setStyle("text",Le(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):o({current:l,total:u}))},r.prototype._getPageInfo=function(e){var t=e.get("scrollDataIndex",!0),n=this.getContentGroup(),i=this._containerGroup.__rectSize,o=e.getOrient().index,c=Ne[o],l=Me[o],u=this._findTargetItemIndex(t),s=n.children(),g=s[u],p=s.length,d=p?1:0,h={contentPosition:[n.x,n.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!g)return h;var v=w(g);h.contentPosition[o]=-v.s;for(var f=u+1,m=v,b=v,x=null;f<=p;++f)x=w(s[f]),(!x&&b.e>m.s+i||x&&!_(x,m.s))&&(b.i>m.i?m=b:m=x,m&&(h.pageNextDataIndex==null&&(h.pageNextDataIndex=m.i),++h.pageCount)),b=x;for(var f=u-1,m=v,b=v,x=null;f>=-1;--f)x=w(s[f]),(!x||!_(b,x.s))&&m.i<b.i&&(b=m,h.pagePrevDataIndex==null&&(h.pagePrevDataIndex=m.i),++h.pageCount,++h.pageIndex),m=x;return h;function w(A){if(A){var y=A.getBoundingRect(),S=y[l]+A[l];return{s:S,e:S+y[c],i:A.__legendDataIndex}}}function _(A,y){return A.e>=y&&A.s<=y+i}},r.prototype._findTargetItemIndex=function(e){if(!this._showController)return 0;var t,n=this.getContentGroup(),i;return n.eachChild(function(o,c){var l=o.__legendDataIndex;i==null&&l!=null&&(i=c),l===e&&(t=c)}),t??i},r.type="legend.scroll",r})(lr);function vn(a){a.registerAction("legendScroll","legendscroll",function(r,e){var t=r.scrollDataIndex;t!=null&&e.eachComponent({mainType:"legend",subType:"scroll",query:r},function(n){n.setScrollDataIndex(t)})})}function fn(a){Ie(ur),a.registerComponentModel(hn),a.registerComponentView(pn),vn(a)}function mn(a){Ie(ur),Ie(fn)}function yn(a,r=We.utc()){if(!a)return a;const e=We.utc(a);return e.isValid()?e.year()!==r.year()?e.format("MMM D, YYYY"):e.format("MMM D"):a}Ie([ha,Wa,rn,sn,pa,va,mn,fa]);const bn=({data:a,chartType:r,query:e,loading:t=!1,error:n=null,height:i=300,showLegend:o=!0,colors:c={},measureTitles:l={}})=>{const u=yn,s=()=>{if(!a||!a.data.length)return{};const v=a.data;switch(r){case"line":return g(v,e);case"bar":return p(v,e);case"pie":return d(v,e);default:return{}}},g=(v,f)=>{const m=f.timeDimensions?.[0]?.dimension,b=f.measures,x=f.dimensions;if(m){const w=`${m}_${f.timeDimensions?.[0]?.granularity}`||m,_=v.map(y=>{const S=y[w]||y[m]||y.created_at;return u(S)}),A=b.map(y=>({name:y,type:"line",data:v.map(S=>S[y]||0),smooth:!0,symbol:"none",symbolSize:6,emphasis:{focus:"series",symbol:"circle",symbolSize:8},...c[y]&&{itemStyle:{color:c[y]}}}));return{animation:!1,tooltip:{trigger:"axis",axisPointer:{type:"cross"},formatter:y=>{if(!Array.isArray(y))return"";let S=`<div style="margin-bottom: 4px; font-weight: 600;">${y[0]?.axisValue||""}</div>`;
3return y.forEach(T=>{const k=T.seriesName,I=l[k]||k,D=T.value||0,L=T.color||"#000";S+=`<div style="display: flex; align-items: center; margin: 2px 0;"> 4 <span style="display: inline-block; width: 10px; height: 10px; background-color: ${L}; border-radius: 50%; margin-right: 8px;"></span> 5 <span style="font-weight: 500;">${I}:</span> 6 <span style="margin-left: 8px; font-weight: 600;">${D.toLocaleString()}</span> 7 </div>`}),S}},...o&&{legend:{data:b}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:_},yAxis:{type:"value"},series:A}}else if(x.length>0){const w=v.map(A=>{const y=A[x[0]];return typeof y=="string"&&(y.includes("T")||y.includes("-"))?u(y):y}),_=b.map(A=>({name:A,type:"line",data:v.map(y=>y[A]||0),symbol:"none",symbolSize:6,emphasis:{focus:"series",symbol:"circle",symbolSize:8},...c[A]&&{itemStyle:{color:c[A]}}}));return{animation:!1,tooltip:{trigger:"axis",formatter:A=>{if(!Array.isArray(A))return"";let y=`<div style="margin-bottom: 4px; font-weight: 600;">${A[0]?.axisValue||""}</div>`;return A.forEach(S=>{const T=S.seriesName,k=l[T]||T,I=S.value||0,D=S.color||"#000";y+=`<div style="display: flex; align-items: center; margin: 2px 0;"> 8 <span style="display: inline-block; width: 10px; height: 10px; background-color: ${D}; border-radius: 50%; margin-right: 8px;"></span> 9 <span style="font-weight: 500;">${k}:</span> 10 <span style="margin-left: 8px; font-weight: 600;">${I.toLocaleString()}</span> 11 </div>`}),y}},...o&&{legend:{data:b}},xAxis:{type:"category",data:w},yAxis:{type:"value"},series:_}}return{}},p=(v,f)=>{const m=f.timeDimensions?.[0]?.dimension,b=f.measures,x=f.dimensions;if(m){const w=`${m}_${f.timeDimensions?.[0]?.granularity}`||m,_=v.map(y=>{const S=y[w]||y[m]||y.created_at;return u(S)}),A=b.map(y=>({name:y,type:"bar",data:v.map(S=>S[y]||0)}));return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},...o&&{legend:{data:b}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"category",data:_},yAxis:{type:"value"},series:A}}else if(x.length>0){const w=v.map(A=>{const y=A[x[0]];return typeof y=="string"&&(y.includes("T")||y.includes("-"))?u(y):y}),_=b.map(A=>({name:A,type:"bar",data:v.map(y=>y[A]||0)}));return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},...o&&{legend:{data:b}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"category",data:w},yAxis:{type:"value"},series:_}}return{}},d=(v,f)=>{const m=f.dimensions,b=f.measures;if(m.length>0&&b.length>0){const x=v.map(w=>({name:w[m[0]],value:w[b[0]]||0}));return{tooltip:{trigger:"item"},legend:{orient:"vertical",left:"left"},series:[{name:b[0],type:"pie",radius:"50%",data:x,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]}}return{}},h=()=>{if(!a||!a.data.length)return[];const v=a.data[0];return Object.keys(v).map(f=>({title:f,dataIndex:f,key:f,sorter:(m,b)=>typeof m[f]=="number"&&typeof b[f]=="number"?m[f]-b[f]:String(m[f]).localeCompare(String(b[f]))}))};return t?C.jsx("div",{style:{textAlign:"center",padding:"50px"},children:C.jsx(Qe,{size:"large"})}):n?C.jsx(Qt,{message:"Error",description:n,type:"error",showIcon:!0}):!a||!a.data.length?C.jsx("div",{style:{textAlign:"center",padding:"50px",color:"#999"},children:"No data available"}):r==="table"?C.jsx(Jt,{columns:h(),dataSource:a.data.map((v,f)=>({...v,key:f})),pagination:{pageSize:10},size:"small"}):C.jsx(da,{echarts:ga,option:s(),style:{height:`${i}px`},notMerge:!0,lazyUpdate:!0})},{Text:xn}=ma,Sn=({workspace:a,timeRange:r=["2024-01-01","2024-12-31"],timezone:e,isMobile:t=!1})=>{const n=er(e||a.settings.timezone||"UTC"),[i,o]=M.useState("broadcasts"),[c,l]=M.useState(null),[u,s]=M.useState(null),[g,p]=M.useState(!1),[d,h]=M.useState(!1),[v,f]=M.useState(null),[m,b]=M.use
11State({count_sent:!0,count_delivered:!0,count_opened:!0,count_clicked:!0,count_bounced:!0,count_complained:!0,count_unsubscribed:!0,count_subscribed:!0,count_failed:!0}),x=D=>{b(L=>({...L,[D]:!L[D]}))},w=D=>{const R={schema:"message_history",measures:["count_sent","count_delivered","count_bounced","count_complained","count_opened","count_clicked","count_unsubscribed","count_subscribed","count_failed"].filter(P=>m[P]),dimensions:[],timezone:n,timeDimensions:[{dimension:"created_at",granularity:"day",dateRange:r}],filters:[]};return D==="broadcasts"?R.filters?.push({member:"broadcast_id",operator:"set",values:[]}):D==="transactional"&&R.filters?.push({member:"broadcast_id",operator:"notSet",values:[]}),R},_=D=>{const L={schema:"message_history",measures:["count_sent","count_delivered","count_bounced","count_complained","count_opened","count_clicked","count_unsubscribed","count_subscribed","count_failed"],dimensions:[],timezone:n,timeDimensions:[{dimension:"created_at",granularity:"day",dateRange:r}],filters:[]};return D==="broadcasts"?L.filters?.push({member:"broadcast_id",operator:"set",values:[]}):D==="transactional"&&L.filters?.push({member:"broadcast_id",operator:"notSet",values:[]}),L},A=async D=>{try{p(!0),h(!0),f(null);const[L,R]=await Promise.all([Ce.query(w(D),a.id),Ce.query(_(D),a.id)]);l(L),s(R)}catch(L){console.error("Failed to fetch email metrics:",L),f(L instanceof Error?L.message:"Failed to fetch email metrics")}finally{p(!1),h(!1)}};M.useEffect(()=>{A(i)},[a.id,i,r,m]);const y=u?.data?.reduce((D,L)=>({count_sent:D.count_sent+(L.count_sent||0),count_delivered:D.count_delivered+(L.count_delivered||0),count_opened:D.count_opened+(L.count_opened||0),count_clicked:D.count_clicked+(L.count_clicked||0),count_bounced:D.count_bounced+(L.count_bounced||0),count_complained:D.count_complained+(L.count_complained||0),count_unsubscribed:D.count_unsubscribed+(L.count_unsubscribed||0),count_subscribed:D.count_subscribed+(L.count_subscribed||0),count_failed:D.count_failed+(L.count_failed||0)}),{count_sent:0,count_delivered:0,count_opened:0,count_clicked:0,count_bounced:0,count_complained:0,count_unsubscribed:0,count_subscribed:0,count_failed:0})||{count_sent:0,count_delivered:0,count_opened:0,count_clicked:0,count_bounced:0,count_complained:0,count_unsubscribed:0,count_subscribed:0,count_failed:0},S=(D,L)=>{if(L===0)return"-";const R=D/L*100;return R===0||R>=10?`${Math.round(R)}%`:`${R.toFixed(1)}%`},T={count_sent:"#3b82f6",count_delivered:"#10b981",count_opened:"#8b5cf6",count_clicked:"#06b6d4",count_bounced:"#f97316",count_complained:"#f97316",count_unsubscribed:"#f97316",count_subscribed:"#22c55e",count_failed:"#ef4444"},k={count_sent:"Sent",count_delivered:"Delivered",count_opened:"Opens",count_clicked:"Clicks",count_bounced:"Bounced",count_complained:"Complaints",count_unsubscribed:"Unsubscribes",count_subscribed:"Subscribes",count_failed:"Failed"},I=[{key:"count_sent",icon:yr,iconColor:"text-blue-500",label:"Sent",value:d?null:String(y.count_sent),tooltip:`${y.count_sent} total emails sent`},{key:"count_delivered",icon:br,iconColor:"text-green-500",label:"Delivered",value:d?null:S(y.count_delivered,y.count_sent),tooltip:`${y.count_delivered} emails delivered`},{key:"count_opened",icon:xr,iconColor:"text-pink-500",label:"Opens",value:d?null:S(y.count_opened,y.count_sent),tooltip:`${y.count_opened} total opens`},{key:"count_clicked",icon:Cr,iconColor:"text-violet-500",label:"Clicks",value:d?null:S(y.count_clicked,y.count_sent),tooltip:`${y.count_clicked} total clicks`},{key:"count_failed",icon:Sr,iconColor:"text-red-500",label:"Failed",value:d?null:S(y.count_failed,y.count_sent),tooltip:`${y.count_failed} emails failed`},{key:"count_bounced",icon:wr,iconColor:"text-amber-500",label:"Bounced",value:d?null:S(y.count_bounced,y.count_sent),tooltip:`${y.count_bounced} emails bounced`},{key:"count_complained",icon:_r,iconColor:"text-pink-500",label:"Complaints",value:d?null:S(y.count_complained,y.count_sent),tooltip:`${y.count_complained} total complaints`},{key:"count_unsubscribed",icon:Dr,iconColor:"text-green-600",label:"Unsub.",value:d?null:S(y.count_unsubscribed,y.count_sent),tooltip:`${y.count_unsubscribed} total unsubscribes`},{key:"count_subscribed",icon:Lr,iconColor:"text-emerald-600",label:"Sub.",value:d?null:S(y.count_subscribed,y.count_sent),tooltip:`${y.count_subscribed} total subscribes`}];return C.jsxs("div",{style:{borderRadius:10,border:"1px solid #EAEAEC",background:"#FAFAFA",padding:t?14:20},children:[C.jsx("div",{style:{fontSize:16,fontWeight:600,color:"#1C1D1F",marginBottom:t?12:16},children:"Email Metrics"}),v&&C.jsx(Qt,{message:"Error",description:v,type:"error",showIcon:!0,style:{marginBottom:16}}),C.jsx("div",{style:{display:"grid",gridTemplateColumns:t?"repeat(2, 1fr)":"repeat(9, 1fr)",gap:t?6:8},children:I.map(D=>C.jsxs("div",{title:`${D.tooltip}${m[D.key]?"":" (hidden from chart)"}`,className:`bg-[#1C1D1F08] cursor-pointer hover:bg-gray-100 transition-colors ${m[D.key]?"":"opacity-50"}`,style:{borderRadius:8,padding:"12px"},onClick:()=>x(D.key),children:[C.jsxs("div",{className:"flex items-center gap-1.5",style:{marginBottom:6},children:[C.jsx(Ar,{icon:D.icon,className:D.iconColor,style:{fontSize:15}}),C.jsx(xn,{style:{fontSize:16,fontWeight:500},children:D.label})]}),C.jsx("div",{style:{fontSize:16,fontWeight:600,color:"#111827"},children:D.value===null?C.jsx(Qe,{size:"small"}):D.value})]},D.key))}),C.jsx(bn,{data:c,chartType:"line",query:w(i),loading:g,error:v,he
11ight:t?180:220,showLegend:!1,colors:T,measureTitles:k})]})},_n=({workspace:a,isMobile:r=!1})=>{const e=Ft(),[t,n]=M.useState([]),[i,o]=M.useState(!1),[c,l]=M.useState(null),u=()=>({limit:5,is_failed:!0}),s=async()=>{try{o(!0),l(null);const d=u(),h=await ba(a.id,d);n(h.messages)}catch(d){console.error("Failed to fetch failed messages data:",d),l(d instanceof Error?d.message:"Failed to fetch failed messages data")}finally{o(!1)}},g=()=>{e({to:"/workspace/$workspaceId/logs",params:{workspaceId:a.id},search:{is_failed:!0}})};M.useEffect(()=>{s()},[a.id]);const p=C.jsx(Gt,{type:"link",size:"small",onClick:g,children:"View more"});return C.jsxs("div",{style:{borderRadius:10,border:"1px solid #EAEAEC",background:"#FAFAFA",padding:r?14:20},children:[C.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:r?12:16},children:[C.jsx("div",{style:{fontSize:16,fontWeight:600,color:"#1C1D1F"},children:"Recent Failed Messages"}),p]}),c?C.jsx("div",{className:"text-red-500 p-4",children:C.jsxs("p",{children:["Error: ",c]})}):C.jsx("div",{style:{overflowX:"auto"},children:C.jsx(ya,{messages:t,loading:i,isLoadingMore:!1,nextCursor:void 0,onLoadMore:()=>{},show_email:!0,bordered:!1,size:"small",workspace:a})})]})},An=({workspace:a,isMobile:r=!1})=>{const e=Ft(),[t,n]=M.useState([]),[i,o]=M.useState(!1),[c,l]=M.useState(null),{data:u}=Ve({queryKey:["segments",a.id],queryFn:()=>Sa({workspace_id:a.id,with_count:!0})}),s=()=>({workspace_id:a.id,limit:5,with_contact_lists:!0}),g=async()=>{try{o(!0),l(null);const f=s(),m=await xa.list(f);n(m.contacts)}catch(f){console.error("Failed to fetch new contacts data:",f),l(f instanceof Error?f.message:"Failed to fetch new contacts data")}finally{o(!1)}},p=()=>{e({to:"/workspace/$workspaceId/contacts",params:{workspaceId:a.id}})};M.useEffect(()=>{g()},[a.id]);const d=()=>({style:{backgroundColor:"#FAFAFA",color:"rgba(28, 29, 31, 0.5)",fontWeight:500}}),h=(f,m)=>({style:{backgroundColor:m!==void 0&&m%2===1?"#f2f2f2":"#fafafa"}}),v=[{title:"Email",dataIndex:"email",key:"email",onHeaderCell:d,onCell:h},{title:"Name",key:"name",onHeaderCell:d,onCell:h,render:(f,m)=>[m.first_name,m.last_name].filter(Boolean).join(" ")||"-"},{title:"Phone",dataIndex:"phone",key:"phone",onHeaderCell:d,onCell:h},{title:"Segments",key:"segments",onHeaderCell:d,onCell:h,render:(f,m)=>C.jsx(_a,{direction:"vertical",size:2,children:m.contact_segments?.map(b=>{const x=u?.segments?.find(S=>S.id===b.segment_id),w=x?.name||b.segment_id,_=x?.color||"#1890ff",A=b.matched_at?ut(b.matched_at,a.settings.timezone,"LL - HH:mm"):"Unknown date",y=C.jsxs(C.Fragment,{children:[C.jsx("div",{children:C.jsx("strong",{children:w})}),C.jsxs("div",{children:["Matched on: ",A]}),b.version&&C.jsxs("div",{children:["Version: ",b.version]}),C.jsx("div",{children:C.jsxs("small",{children:["Timezone: ",a.settings.timezone]})})]});return C.jsx(ct,{title:y,children:C.jsx(Aa,{bordered:!1,color:_,style:{marginBottom:"2px"},children:w})},b.segment_id)})||[]})},{title:"Since",dataIndex:"created_at",key:"created_at",onHeaderCell:d,onCell:h,render:f=>C.jsx(ct,{title:`${ut(f,a.settings.timezone,"lll")} in ${a.settings.timezone}`,children:C.jsx("span",{children:We(f).fromNow()})})}];return C.jsxs("div",{style:{borderRadius:10,border:"1px solid #EAEAEC",background:"#FAFAFA",padding:r?14:20},children:[C.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:r?12:16},children:[C.jsx("div",{style:{fontSize:16,fontWeight:700,color:"#1C1D1F"},children:"Recent New Contacts"}),C.jsx(Gt,{type:"link",size:"small",onClick:p,children:"View more"})]}),c?C.jsx("div",{className:"text-red-500 p-4",children:C.jsxs("p",{children:["Error: ",c]})}):C.jsx("div",{style:{backgroundColor:"#FAFAFA",borderRadius:"20px",padding:"10px",overflow:"hidden"},children:C.jsx(Jt,{className:"table-no-cell-border",dataSource:t,columns:v,rowKey:"email",pagination:!1,loading:i,scroll:{x:"max-content"},rowClassName:(f,m)=>m%2===1?"zebra-row":""})})]})},Cn=({workspace:a,timeRange:r,timezone:e})=>{const t=Bt(),n=`${r[0]}-${r[1]}-${e||""}`,{data:i,isLoading:o}=Ve({queryKey:["analytics","total-contacts",a.id],queryFn:async()=>Ce.query({schema:"contacts",measures:["count"],dimensions:[],filters:[]},a.id),refetchInterval:6e4}),{data:c,isLoading:l}=Ve({queryKey:["analytics","new-contacts",a.id,r[0],r[1],e],queryFn:async()=>Ce.query({schema:"contacts",measures:["count"],dimensions:[],timezone:e||a.settings.timezone||"UTC",filters:[{member:"created_at",operator:"inDateRange",values:r}]},a.id),refetchInterval:6e4}),u=i?.data?.[0]?.count||0,s=c?.data?.[0]?.count||0,g=(p,d)=>d?C.jsx(Qe,{size:"small"}):mr(p).format({thousandSeparated:!0});return C.jsxs("div",{children:[C.jsxs("div",{style:{borderRadius:10,border:"1px solid #EAEAEC",background:"#FAFAFA",padding:t?14:20,marginBottom:t?12:16},children:[C.jsx("div",{style:{fontSize:16,fontWeight:700,color:"#1C1D1F",marginBottom:t?12:16},children:"Overview"}),C.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:t?10:16},children:[C.jsxs("div",{style:{position:"relative",overflow:"hidden",borderRadius:10,background:"#1C1D1F08",padding:t?"14px":"20px",height:t?80:100},children:[C.jsx("div",{style:{fontSize:t?14:16,fontWeight:500,lineHeight:1.5,color:"#1C1D1F"},children:"Total Contacts"}),C.jsx("div",{style:{fontSize:t?18:20,fontWeight:700,lineHeight:1.5,color:"#1C1D1F",marginTop:10},children:g(u,o)}),C.jsx("svg",{width:t?84:135,height:t?65:104,viewBox:"0 0 135 104",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",right:0,bottom:0},children:C.jsx("g",{opacity:"0.2",children:C.jsx("path",{d:"M117.196 100.37L125.883 99.6104C132.301 99.0488 137.424 93.1899 134.852 87.282C130.933 78.2786 122.797 73.3383 109.187 72.5712M89.7859 55.13C91.5235 55.5166 93.4825 55.6001 95.6653 55.4092C105.35 54.5618 109.757 49.1572 108.668 36.7047C107.578 24.2523 102.3 19.695 92.6148 20.5424C90.432 20.7333 88.5173 21.1558 86.8733 21.8382M62.3236 75.893C84.2504 73.9747 96.045 79.3886 100.604 91.8814C102.497 97.0696 98.178 102.034 92.6761 102.516L37.0553 107.382C31.5534 107.863 26.438 103.724 27.4015 98.2858C29.7216 85.1912 40.3969 77.8114 62.3236 75.893ZM60.7984 58.4596C70.4836 57.6123 74.8905 52.2076 73.801 39.7552C72.7116 27.3028 67.4332 22.7455 57.748 23.5928C48.0627 24.4402 43.6559 29.8448 44.7454 42.2972C45.8348 54.7497 51.1132 59.307 60.7984 58.4596Z",stroke:"#2F6DFB",strokeWidth:"10",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),C.jsxs("div",{style:{position:"relative",overflow:"hidden",borderRadius:10,background:"#1C1D1F08",padding:t?"14px":"20px",height:t?80:100},children:[C.jsx("div",{style:{fontSize:t?14:16,fontWeight:500,lineHeight:1.5,color:"#1C1D1F"},children:"New Contacts"}),C.jsx("div",{style:{fontSize:t?18:20,fontWeight:700,lineHeight:1.5,color:"#1C1D1F",marginTop:10},children:g(s,l)}
11),C.jsx("svg",{width:t?76:122,height:t?65:104,viewBox:"0 0 122 104",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",right:0,bottom:0},children:C.jsx("g",{opacity:"0.2",children:C.jsx("path",{d:"M73.8013 42.7554L77.8685 89.2445M99.0794 63.9663L52.5903 68.0336M80.4106 118.3C109.295 115.773 130.662 90.3089 128.135 61.4243C125.608 32.5396 100.144 11.1726 71.2592 13.6997C42.3746 16.2268 21.0076 41.691 23.5347 70.5756C26.0617 99.4602 51.5259 120.827 80.4106 118.3Z",stroke:"#2F6DFB",strokeWidth:"10",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]})]}),C.jsx(Sn,{workspace:a,timeRange:r,timezone:e,isMobile:t},`email-metrics-${n}`),C.jsx("div",{style:{marginTop:t?12:16},children:C.jsx(An,{workspace:a,isMobile:t},`new-contacts-${n}`)}),C.jsx("div",{style:{marginTop:t?12:16},children:C.jsx(_n,{workspace:a,isMobile:t},`failed-messages-${n}`)})]})};function li(){const{workspaceId:a}=hr({strict:!1}),r=pr({strict:!1}),{workspaces:e}=vr(),t=Bt(),n=r.period||"14D",i=e.find(u=>u.id===a),o=(u,s)=>{const g=fr(s).add(1,"day");let p=g.subtract(30,"days");switch(u){case"7D":p=g.subtract(7,"days");break;case"14D":p=g.subtract(14,"days");break;case"30D":p=g.subtract(30,"days");break;case"90D":p=g.subtract(90,"days");break}return[p.format("YYYY-MM-DD"),g.format("YYYY-MM-DD")]};if(!i)return C.jsxs("div",{style:{padding:"24px",textAlign:"center"},children:[C.jsx("h2",{children:"Workspace not found"}),C.jsx("p",{children:"The requested workspace could not be found."})]});const c=er(i.settings.timezone||"UTC"),l=o(n,c);return C.jsx("div",{className:"flex-1 overflow-auto",style:{padding:t?"16px 16px 0":"20px 20px 0"},children:C.jsx(Cn,{workspace:i,timeRange:l,timezone:c})})}export{li as AnalyticsPage};
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.