83 lines
1.1 MiB
JavaScript
83 lines
1.1 MiB
JavaScript
import{o as He,c as mr,J as lk,d as xA,h as gi,a as et,F as Ho,p as Wo,j as De,i as $p,w as pl,t as Qt,K as uk,I as $t,g as be,x as fk,L as po,M as ck,b as Ja,y as vh,e as E_,N as lm,_ as Qa}from"./index-10f45eca.js";import{_ as vk}from"./button.vue_vue_type_style_index_0_lang-80cf0b72.js";import{_ as hk}from"./BasicSelect.vue_vue_type_style_index_0_lang-2a0574c0.js";import{_ as dk}from"./_plugin-vue_export-helper-2f157ef4.js";import{I as O_}from"./Icon-e9a9d64e.js";import{u as pk}from"./usePrice-7afab779.js";import{a as hh}from"./useDataTime-60875705.js";import"./index-9601d570.js";import"./toArray-45e57117.js";import"./index-ceff8631.js";import"./vnode-b14d5532.js";import"./FormItemContext-a11ae724.js";import"./pickAttrs-2c86ae65.js";import"./useState-4f4a8c99.js";const gk={},yk={class:"bg-gradient"};function mk(r,e){return He(),mr("div",yk,[lk(r.$slots,"default")])}const Up=dk(gk,[["render",mk]]),Yp="/assets/totalsales-b298228f.svg",Zp="/assets/orders-4e5dd0bd.svg",Xp="/assets/customers-aa15910e.svg",qp="/assets/salesnumber-bffd0c96.svg",_k={class:"grid grid-cols-1 md:grid-cols-4 gap-3"},Sk={class:"flex"},xk=["src","alt"],bk={class:"flex flex-col justify-between w-full mr-2"},wk={class:"text-base font-bold"},Tk={class:"flex items-center justify-end"},Ck={class:"text-base font-bold"},Ak={class:"mr-1"},Mk=xA({__name:"Header",props:{statistics:{}},setup(r){const e=r,t=gi(()=>{var a;return[{title:"تعداد کاربران",alt:"sales-number",image:qp,value:e.statistics.count_sale_order,unit:"نفر"},{title:"کاربران جدید امروز",alt:"customers",image:Xp,value:e.statistics.new_customer,unit:"نفر"},{title:"کاربران فعال هفته",alt:"orders",image:Zp,value:e.statistics.count_order,unit:"نفر"},{title:"کاربران فعال ماه",alt:"total-sales",image:Yp,value:((a=e.statistics.total_sale)==null?void 0:a.toLocaleString("fa-IR"))||"0",unit:"نفر"}]});return(a,n)=>(He(),mr("div",null,[et("div",_k,[(He(!0),mr(Ho,null,Wo(De(t),(i,o)=>(He(),$p(Up,{class:"h-[120px] p-5",key:o},{default:pl(()=>[et("div",Sk,[et("div",null,[et("img",{class:"w-20 h-20",src:i.image,alt:i.alt},null,8,xk)]),et("div",bk,[et("div",null,[et("span",wk,Qt(i.title),1)]),et("div",Tk,[et("span",Ck,Qt(i.value),1),et("span",Ak,Qt(i.unit),1)])])])]),_:2},1024))),128))])]))}}),Dk=async()=>await uk.get("/admin/report"),Lk=async r=>{const{type:e,item_id:t,date:a}=r,n=a?new Date(a):new Date;if(e==="hourly"){const i=n.toISOString().split("T")[0];let o=$t.from("user_views_hourly").select("*").eq("day",i).eq("type","story").order("hour");t&&(o=o.eq("item_id",t));const{data:s,error:l}=await o;if(l)throw l;return s||[]}else{const i=new Date(n);i.setDate(n.getDate()-29);const o=i.toISOString().split("T")[0],s=n.toISOString().split("T")[0];let l=$t.from("user_views_hourly").select("*").eq("type","story").gte("day",o).lte("day",s).order("day").order("hour");t&&(l=l.eq("item_id",t));const{data:u,error:f}=await l;if(f)throw f;return u||[]}},Ik=async()=>{const r=new Date,e=new Date(r.getFullYear(),r.getMonth(),r.getDate()),t=new Date(e);t.setDate(t.getDate()+1);const a=e.toISOString(),n=t.toISOString(),[i,o]=await Promise.all([$t.from("users").select("*",{count:"exact",head:!0}),$t.from("users").select("*",{count:"exact",head:!0}).gte("created_at",a).lt("created_at",n)]);if(i.error)throw i.error;if(o.error)throw o.error;return{total:i.count||0,today:o.count||0}},Pk=async()=>{const{data:r,error:e}=await $t.from("user_views_hourly").select("views").eq("type","story");if(e)throw e;if(!r||r.length===0)return 0;let t=0;return r.forEach(a=>{t+=Number((a==null?void 0:a.views)||0)}),t},Rk=async()=>{const e=new Date().toISOString().split("T")[0],{data:t,error:a}=await $t.from("user_views_hourly").select("views").eq("type","story").eq("day",e);if(a)throw a;if(!t||t.length===0)return 0;let n=0;return t.forEach(i=>{n+=Number((i==null?void 0:i.views)||0)}),n},kk=async()=>{const{data:r,error:e}=await $t.from("user_views").select("user_id").eq("type","story").not("user_id","is",null);if(e)throw e;if(!r||r.length===0)return 0;const t=new Set;return r.forEa
|
|||
|
|
Copyright (c) Microsoft Corporation.
|
||
|
|
|
||
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
||
|
|
purpose with or without fee is hereby granted.
|
||
|
|
|
||
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||
|
|
PERFORMANCE OF THIS SOFTWARE.
|
||
|
|
***************************************************************************** */var Kp=function(r,e){return Kp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,a){t.__proto__=a}||function(t,a){for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])},Kp(r,e)};function F(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Kp(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Yk=function(){function r(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return r}(),Zk=function(){function r(){this.browser=new Yk,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window<"u"}return r}(),fn=new Zk;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(fn.wxa=!0,fn.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?fn.worker=!0:!fn.hasGlobalWindow||"Deno"in window||typeof navigator<"u"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Node.js")>-1?(fn.node=!0,fn.svgSupported=!0):Xk(navigator.userAgent,fn);function Xk(r,e){var t=e.browser,a=r.match(/Firefox\/([\d.]+)/),n=r.match(/MSIE\s([\d.]+)/)||r.match(/Trident\/.+?rv:(([\d.]+))/),i=r.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(r);a&&(t.firefox=!0,t.version=a[1]),n&&(t.ie=!0,t.version=n[1]),i&&(t.edge=!0,t.version=i[1],t.newEdge=+i[1].split(".")[0]>18),o&&(t.weChat=!0),e.svgSupported=typeof SVGRect<"u",e.touchEventsSupported="ontouchstart"in window&&!t.ie&&!t.edge,e.pointerEventsSupported="onpointerdown"in window&&(t.edge||t.ie&&+t.version>=11);var s=e.domSupported=typeof document<"u";if(s){var l=document.documentElement.style;e.transform3dSupported=(t.ie&&"transition"in l||t.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in l)&&!("OTransition"in l),e.transformSupported=e.transform3dSupported||t.ie&&+t.version>=9}}const Rt=fn;var um=12,bA="sans-serif",Ga=um+"px "+bA,qk=20,Kk=100,jk="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function Jk(r){var e={};if(typeof JSON>"u")return e;for(var t=0;t<r.length;t++){var a=String.fromCharCode(t+32),n=(r.charCodeAt(t)-qk)/Kk;e[a]=n}return e}var Qk=Jk(jk),Hr={createCanvas:function(){return typeof document<"u"&&document.createElement("canvas")},measureText:function(){var r,e;return function(t,a){if(!r){var n=Hr.createCanvas();r=n&&n.getContext("2d")}if(r)return e!==a&&(e=r.font=a||Ga),r.measureText(t);t=t||"",a=a||Ga;var i=/((?:\d+)?\.?\d*)px/.exec(a),o=i&&+i[1]||um,s=0;if(a.indexOf("mono")>=0)s=o*t.length;else for(var l=0;l<t.length;l++){var u=Qk[t[l]];s+=u==null?o:u*o}return{width:s}}}(),loadImage:function(r,e,t){var a=new Image;return a.onload=e,a.onerror=t,a.src=r,a}},wA=ma(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(r,e){return r["[object "+e+"]"]=!0,r},{}),TA=ma(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(r,e){return r["[object "+e+"Array]"]=!0,r},{}),Ss=Object.prototype.toString,Tv=Array.prototype,tE=Tv.forEach,eE=Tv.filter,fm=Tv.slice,rE=Tv.map,B_=function(){}.constructor,Ou=B_?B_.prototype:null,cm="__proto__",aE=2311;function CA(){return aE++}function vm(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];typeof console<"u"&&console.error.apply(console,r)}function st(r){if(r==null||typeof r!="object")return r;var e=r,t=Ss.call(r);if(t==="[object Array]"){if(!Ll(r)){e=[];for(var a=0,n=r.length;a<n;a++)e[a]=st(r[a])}}else if(TA[t]){if(!Ll(r)){var i=r.constructor;if(i.from)e=i.from(r);else{e=new i(r.length);for(var a=0,n=r.length;a<n;a++)e[a]=r[a]}}}else if(!wA[t]&&!Ll(r)&&!os(r)){e={};for(var o in r)r.hasOwnProperty(o)&&o!==cm&&(e[o]=st(r[o]))}return e}function St(r,e,t){if(!vt(e)||!vt(r))return t?st(e):r;for(var a in e)if(e.hasOwnProperty(a)&
|
||
|
|
Copyright (c) Microsoft Corporation.
|
||
|
|
|
||
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
||
|
|
purpose with or without fee is hereby granted.
|
||
|
|
|
||
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||
|
|
PERFORMANCE OF THIS SOFTWARE.
|
||
|
|
***************************************************************************** */var Jp=function(r,e){return Jp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,a){t.__proto__=a}||function(t,a){for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(t[n]=a[n])},Jp(r,e)};function Yt(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Jp(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function eo(r,e){return r==null&&(r=0),e==null&&(e=0),[r,e]}function We(r,e){return r[0]=e[0],r[1]=e[1],r}function Oa(r){return[r[0],r[1]]}function pm(r,e,t){return r[0]=e,r[1]=t,r}function V_(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r}function Qp(r,e,t,a){return r[0]=e[0]+t[0]*a,r[1]=e[1]+t[1]*a,r}function Mi(r,e,t){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r}function tg(r){return Math.sqrt(cE(r))}function cE(r){return r[0]*r[0]+r[1]*r[1]}function jf(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r}function xs(r,e){var t=tg(e);return t===0?(r[0]=0,r[1]=0):(r[0]=e[0]/t,r[1]=e[1]/t),r}function eg(r,e){return Math.sqrt((r[0]-e[0])*(r[0]-e[0])+(r[1]-e[1])*(r[1]-e[1]))}var pn=eg;function vE(r,e){return(r[0]-e[0])*(r[0]-e[0])+(r[1]-e[1])*(r[1]-e[1])}var Oi=vE;function Jf(r,e,t,a){return r[0]=e[0]+a*(t[0]-e[0]),r[1]=e[1]+a*(t[1]-e[1]),r}function ne(r,e,t){var a=e[0],n=e[1];return r[0]=t[0]*a+t[2]*n+t[4],r[1]=t[1]*a+t[3]*n+t[5],r}function gn(r,e,t){return r[0]=Math.min(e[0],t[0]),r[1]=Math.min(e[1],t[1]),r}function yn(r,e,t){return r[0]=Math.max(e[0],t[0]),r[1]=Math.max(e[1],t[1]),r}var go=function(){function r(e,t){this.target=e,this.topTarget=t&&t.topTarget}return r}(),hE=function(){function r(e){this.handler=e,e.on("mousedown",this._dragStart,this),e.on("mousemove",this._drag,this),e.on("mouseup",this._dragEnd,this)}return r.prototype._dragStart=function(e){for(var t=e.target;t&&!t.draggable;)t=t.parent||t.__hostTarget;t&&(this._draggingTarget=t,t.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new go(t,e),"dragstart",e.event))},r.prototype._drag=function(e){var t=this._draggingTarget;if(t){var a=e.offsetX,n=e.offsetY,i=a-this._x,o=n-this._y;this._x=a,this._y=n,t.drift(i,o,e),this.handler.dispatchToElement(new go(t,e),"drag",e.event);var s=this.handler.findHover(a,n,t).target,l=this._dropTarget;this._dropTarget=s,t!==s&&(l&&s!==l&&this.handler.dispatchToElement(new go(l,e),"dragleave",e.event),s&&s!==l&&this.handler.dispatchToElement(new go(s,e),"dragenter",e.event))}},r.prototype._dragEnd=function(e){var t=this._draggingTarget;t&&(t.dragging=!1),this.handler.dispatchToElement(new go(t,e),"dragend",e.event),this._dropTarget&&this.handler.dispatchToElement(new go(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null},r}();const dE=hE;var pE=function(){function r(e){e&&(this._$eventProcessor=e)}return r.prototype.on=function(e,t,a,n){this._$handlers||(this._$handlers={});var i=this._$handlers;if(typeof t=="function"&&(n=a,a=t,t=null),!a||!e)return this;var o=this._$eventProcessor;t!=null&&o&&o.normalizeQuery&&(t=o.normalizeQuery(t)),i[e]||(i[e]=[]);for(var s=0;s<i[e].length;s++)if(i[e][s].h===a)return this;var l={h:a,query:t,ctx:n||this,callAtLast:a.zrEventfulCallAtLast},u=i[e].length-1,f=i[e][u];return f&&f.callAtLast?i[e].splice(u,0,l):i[e].push(l),this},r.prototype.isSilent=function(e){var t=this._$handlers;return!t||!t[e]||!t[e].length},r.prototype.off=function(e,t){var a=this._$handlers;if(!a)return this;if(!e)return this._$handlers={},this;if(t){if(a[e]){for(var n=[],i=0,o=a[e].length;i<o;i++)a[e][i].h!==t&&n.push(a[e][i]);a[e]=n}a[e]&&a[e].length===0&&delete a[e]}else delete a[e];return this},r.prototype.trigger=function(e){for(var t=[],a=1;a<arguments.length;a++)t[a-1]=arguments[a];if(!this._$handlers)return this;var n=this._$handlers[e],i=this._$eventProcessor;if(n)for(var o=t.length,s=n.length,l=0;l<s;l++){var u=n[l];if(!(i&&i.filter&&u.query!=null&&!i.filter(e,u.query)))switch(o){case 0:u.h.call(u.ctx);break;case 1:u.h.call(u.ctx,t[0]);bre
|
||
|
|
`),i=n.length;if(i===1)return f1(n[0],e,t,a);for(var o=new dt(0,0,0,0),s=0;s<n.length;s++){var l=f1(n[s],e,t,a);s===0?o.copy(l):o.union(l)}return o}function ls(r,e,t,a){return t==="right"?a?r+=e:r-=e:t==="center"&&(a?r+=e/2:r-=e/2),r}function Bi(r,e,t,a){return t==="middle"?a?r+=e/2:r-=e/2:t==="bottom"&&(a?r+=e:r-=e),r}function _u(r){return ga(r).stWideCharWidth}function $r(r,e){return typeof r=="string"?r.lastIndexOf("%")>=0?parseFloat(r)/100*e:parseFloat(r):r}function Mc(r,e,t){var a=e.position||"inside",n=e.distance!=null?e.distance:5,i=t.height,o=t.width,s=i/2,l=t.x,u=t.y,f="left",c="top";if(a instanceof Array)l+=$r(a[0],t.width),u+=$r(a[1],t.height),f=null,c=null;else switch(a){case"left":l-=n,u+=s,f="right",c="middle";break;case"right":l+=n+o,u+=s,c="middle";break;case"top":l+=o/2,u-=n,f="center",c="bottom";break;case"bottom":l+=o/2,u+=i+n,f="center";break;case"inside":l+=o/2,u+=s,f="center",c="middle";break;case"insideLeft":l+=n,u+=s,c="middle";break;case"insideRight":l+=o-n,u+=s,f="right",c="middle";break;case"insideTop":l+=o/2,u+=n,f="center";break;case"insideBottom":l+=o/2,u+=i-n,f="center",c="bottom";break;case"insideTopLeft":l+=n,u+=n;break;case"insideTopRight":l+=o-n,u+=n,f="right";break;case"insideBottomLeft":l+=n,u+=i-n,c="bottom";break;case"insideBottomRight":l+=o-n,u+=i-n,f="right",c="bottom";break}return r=r||{},r.x=l,r.y=u,r.align=f,r.verticalAlign=c,r}var Rh="__zr_normal__",kh=Sa.concat(["ignore"]),MO=ma(Sa,function(r,e){return r[e]=!0,r},{ignore:!1}),_o={},DO=new dt(0,0,0,0),$u=[],bm=function(){function r(e){this.id=CA(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return r.prototype._init=function(e){this.attr(e)},r.prototype.drift=function(e,t,a){switch(this.draggable){case"horizontal":t=0;break;case"vertical":e=0;break}var n=this.transform;n||(n=this.transform=[1,0,0,1,0,0]),n[4]+=e,n[5]+=t,this.decomposeTransform(),this.markRedraw()},r.prototype.beforeUpdate=function(){},r.prototype.afterUpdate=function(){},r.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},r.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||(this.textConfig={});var a=this.textConfig,n=a.local,i=t.innerTransformable,o=void 0,s=void 0,l=!1;i.parent=n?this:null;var u=!1;i.copyTransform(t);var f=a.position!=null,c=a.autoOverflowArea,v=void 0;if((c||f)&&(v=DO,a.layoutRect?v.copy(a.layoutRect):v.copy(this.getBoundingRect()),n||v.applyTransform(this.transform)),f){this.calculateTextPosition?this.calculateTextPosition(_o,a,v):Mc(_o,a,v),i.x=_o.x,i.y=_o.y,o=_o.align,s=_o.verticalAlign;var h=a.origin;if(h&&a.rotation!=null){var d=void 0,p=void 0;h==="center"?(d=v.width*.5,p=v.height*.5):(d=$r(h[0],v.width),p=$r(h[1],v.height)),u=!0,i.originX=-i.x+d+(n?0:v.x),i.originY=-i.y+p+(n?0:v.y)}}a.rotation!=null&&(i.rotation=a.rotation);var g=a.offset;g&&(i.x+=g[0],i.y+=g[1],u||(i.originX=-g[0],i.originY=-g[1]));var y=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={});if(c){var m=y.overflowRect=y.overflowRect||new dt(0,0,0,0);i.getLocalTransform($u),Wr($u,$u),dt.copy(m,v),m.applyTransform($u)}else y.overflowRect=null;var _=a.inside==null?typeof a.position=="string"&&a.position.indexOf("inside")>=0:a.inside,S=void 0,b=void 0,x=void 0;_&&this.canBeInsideText()?(S=a.insideFill,b=a.insideStroke,(S==null||S==="auto")&&(S=this.getInsideTextFill()),(b==null||b==="auto")&&(b=this.getInsideTextStroke(S),x=!0)):(S=a.outsideFill,b=a.outsideStroke,(S==null||S==="auto")&&(S=this.getOutsideFill()),(b==null||b==="auto")&&(b=this.getOutsideStroke(S),x=!0)),S=S||"#000",(S!==y.fill||b!==y.stroke||x!==y.autoStroke||o!==y.align||s!==y.verticalAlign)&&(l=!0,y.fill=S,y.stroke=b,y.autoStroke=x,y.align=o,y.verticalAlign=s,t.setDefaultTextStyle(y)),t.__dirty|=sr,l&&t.dirtyStyle(!0)}},r.prototype.canBeInsideText=function(){return!0},r.prototype.getInsideTextFill=function(){return"#fff"},r.prototype.getInsideTextStroke=function(e){return"#000"},r.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?bg:xg},r.prototype.getOutsid
|
||
|
|
* ZRender, a high performance 2d drawing library.
|
||
|
|
*
|
||
|
|
* Copyright (c) 2013, Baidu Inc.
|
||
|
|
* All rights reserved.
|
||
|
|
*
|
||
|
|
* LICENSE
|
||
|
|
* https://github.com/ecomfe/zrender/blob/master/LICENSE.txt
|
||
|
|
*/var nc={},nM={};function kO(r){delete nM[r]}function EO(r){if(!r)return!1;if(typeof r=="string")return wc(r,1)<Sg;if(r.colorStops){for(var e=r.colorStops,t=0,a=e.length,n=0;n<a;n++)t+=wc(e[n].color,1);return t/=a,t<Sg}return!1}var OO=function(){function r(e,t,a){var n=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,a=a||{},this.dom=t,this.id=e;var i=new $E,o=a.renderer||"canvas";nc[o]||(o=Ct(nc)[0]),a.useDirtyRect=a.useDirtyRect==null?!1:a.useDirtyRect;var s=new nc[o](t,i,a,e),l=a.ssr||s.ssrOnly;this.storage=i,this.painter=s;var u=!Rt.node&&!Rt.worker&&!l?new wO(s.getViewportRoot(),s.root):null,f=a.useCoarsePointer,c=f==null||f==="auto"?Rt.touchEventsSupported:!!f,v=44,h;c&&(h=it(a.pointerSize,v)),this.handler=new zE(i,s,u,s.root,h),this.animation=new pO({stage:{update:l?null:function(){return n._flush(!0)}}}),l||this.animation.start()}return r.prototype.add=function(e){this._disposed||!e||(this.storage.addRoot(e),e.addSelfToZr(this),this.refresh())},r.prototype.remove=function(e){this._disposed||!e||(this.storage.delRoot(e),e.removeSelfFromZr(this),this.refresh())},r.prototype.configLayer=function(e,t){this._disposed||(this.painter.configLayer&&this.painter.configLayer(e,t),this.refresh())},r.prototype.setBackgroundColor=function(e){this._disposed||(this.painter.setBackgroundColor&&this.painter.setBackgroundColor(e),this.refresh(),this._backgroundColor=e,this._darkMode=EO(e))},r.prototype.getBackgroundColor=function(){return this._backgroundColor},r.prototype.setDarkMode=function(e){this._darkMode=e},r.prototype.isDarkMode=function(){return this._darkMode},r.prototype.refreshImmediately=function(e){this._disposed||(e||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1)},r.prototype.refresh=function(){this._disposed||(this._needsRefresh=!0,this.animation.start())},r.prototype.flush=function(){this._disposed||this._flush(!1)},r.prototype._flush=function(e){var t,a=qo();this._needsRefresh&&(t=!0,this.refreshImmediately(e)),this._needsRefreshHover&&(t=!0,this.refreshHoverImmediately());var n=qo();t?(this._stillFrameAccum=0,this.trigger("rendered",{elapsedTime:n-a})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},r.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},r.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},r.prototype.refreshHover=function(){this._needsRefreshHover=!0},r.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},r.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},r.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},r.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},r.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},r.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},r.prototype.findHover=function(e,t){if(!this._disposed)return this.handler.findHover(e,t)},r.prototype.on=function(e,t,a){return this._disposed||this.handler.on(e,t,a),this},r.prototype.off=function(e,t){this._disposed||this.handler.off(e,t)},r.prototype.trigger=function(e,t){this._disposed||this.handler.trigger(e,t)},r.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),t=0;t<e.length;t++)e[t]instanceof lt&&e[t].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()}},r.prototype.dispose=function(){this._disposed||(this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,this._disposed=!0,kO(this.id))},r}();function c1(r,e){var t=new OO(CA(),r,e);return nM[t.id]=t,t}function BO(r,e){nc[r]=e}var wg;function NO(r){if(typeof wg=="function
|
||
|
|
`);i=xM(t,a,n,i);for(var s=!1,l={},u=0,f=o.length;u<f;u++)bM(l,o[u],i),o[u]=l.textLine,s=s||l.isTruncated;r.text=o.join(`
|
||
|
|
`),r.isTruncated=s}function xM(r,e,t,a){a=a||{};var n=W({},a);t=it(t,"..."),n.maxIterations=it(a.maxIterations,2);var i=n.minChar=it(a.minChar,0),o=n.fontMeasureInfo=ga(e),s=o.asciiCharWidth;n.placeholder=it(a.placeholder,"");for(var l=r=Math.max(0,r-1),u=0;u<i&&l>=s;u++)l-=s;var f=ya(o,t);return f>l&&(t="",f=0),l=r-f,n.ellipsis=t,n.ellipsisWidth=f,n.contentWidth=l,n.containerWidth=r,n}function bM(r,e,t){var a=t.containerWidth,n=t.contentWidth,i=t.fontMeasureInfo;if(!a){r.textLine="",r.isTruncated=!1;return}var o=ya(i,e);if(o<=a){r.textLine=e,r.isTruncated=!1;return}for(var s=0;;s++){if(o<=n||s>=t.maxIterations){e+=t.ellipsis;break}var l=s===0?wB(e,n,i):o>0?Math.floor(e.length*n/o):0;e=e.substr(0,l),o=ya(i,e)}e===""&&(e=t.placeholder),r.textLine=e,r.isTruncated=!0}function wB(r,e,t){for(var a=0,n=0,i=r.length;n<i&&a<e;n++)a+=tM(t,r.charCodeAt(n));return n}function TB(r,e,t,a){var n=Dm(r),i=e.overflow,o=e.padding,s=o?o[1]+o[3]:0,l=o?o[0]+o[2]:0,u=e.font,f=i==="truncate",c=_u(u),v=it(e.lineHeight,c),h=e.lineOverflow==="truncate",d=!1,p=e.width;p==null&&t!=null&&(p=t-s);var g=e.height;g==null&&a!=null&&(g=a-l);var y;p!=null&&(i==="break"||i==="breakAll")?y=n?wM(n,e.font,p,i==="breakAll",0).lines:[]:y=n?n.split(`
|
||
|
|
`):[];var m=y.length*v;if(g==null&&(g=m),m>g&&h){var _=Math.floor(g/v);d=d||y.length>_,y=y.slice(0,_),m=y.length*v}if(n&&f&&p!=null)for(var S=xM(p,u,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),b={},x=0;x<y.length;x++)bM(b,y[x],S),y[x]=b.textLine,d=d||b.isTruncated;for(var w=g,T=0,C=ga(u),x=0;x<y.length;x++)T=Math.max(ya(C,y[x]),T);p==null&&(p=T);var M=p;return w+=l,M+=s,{lines:y,height:g,outerWidth:M,outerHeight:w,lineHeight:v,calculatedLineHeight:c,contentWidth:T,contentHeight:m,width:p,isTruncated:d}}var CB=function(){function r(){}return r}(),S1=function(){function r(e){this.tokens=[],e&&(this.tokens=e)}return r}(),AB=function(){function r(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[],this.isTruncated=!1}return r}();function MB(r,e,t,a,n){var i=new AB,o=Dm(r);if(!o)return i;var s=e.padding,l=s?s[1]+s[3]:0,u=s?s[0]+s[2]:0,f=e.width;f==null&&t!=null&&(f=t-l);var c=e.height;c==null&&a!=null&&(c=a-u);for(var v=e.overflow,h=(v==="break"||v==="breakAll")&&f!=null?{width:f,accumWidth:0,breakAll:v==="breakAll"}:null,d=Vh.lastIndex=0,p;(p=Vh.exec(o))!=null;){var g=p.index;g>d&&zh(i,o.substring(d,g),e,h),zh(i,p[2],e,h,p[1]),d=Vh.lastIndex}d<o.length&&zh(i,o.substring(d,o.length),e,h);var y=[],m=0,_=0,S=v==="truncate",b=e.lineOverflow==="truncate",x={};function w(Q,nt,J){Q.width=nt,Q.lineHeight=J,m+=J,_=Math.max(_,nt)}t:for(var T=0;T<i.lines.length;T++){for(var C=i.lines[T],M=0,D=0,I=0;I<C.tokens.length;I++){var L=C.tokens[I],P=L.styleName&&e.rich[L.styleName]||{},k=L.textPadding=P.padding,R=k?k[1]+k[3]:0,B=L.font=P.font||e.font;L.contentHeight=_u(B);var E=it(P.height,L.contentHeight);if(L.innerHeight=E,k&&(E+=k[0]+k[2]),L.height=E,L.lineHeight=fr(P.lineHeight,e.lineHeight,E),L.align=P&&P.align||n,L.verticalAlign=P&&P.verticalAlign||"middle",b&&c!=null&&m+L.lineHeight>c){var V=i.lines.length;I>0?(C.tokens=C.tokens.slice(0,I),w(C,D,M),i.lines=i.lines.slice(0,T+1)):i.lines=i.lines.slice(0,T),i.isTruncated=i.isTruncated||i.lines.length<V;break t}var O=P.width,N=O==null||O==="auto";if(typeof O=="string"&&O.charAt(O.length-1)==="%")L.percentWidth=O,y.push(L),L.contentWidth=ya(ga(B),L.text);else{if(N){var z=P.backgroundColor,$=z&&z.image;$&&($=xB($),kv($)&&(L.width=Math.max(L.width,$.width*E/$.height)))}var H=S&&f!=null?f-D:null;H!=null&&H<L.width?!N||H<R?(L.text="",L.width=L.contentWidth=0):(bB(x,L.text,H-R,B,e.ellipsis,{minChar:e.truncateMinChar}),L.text=x.text,i.isTruncated=i.isTruncated||x.isTruncated,L.width=L.contentWidth=ya(ga(B),L.text)):L.contentWidth=ya(ga(B),L.text)}L.width+=R,D+=L.width,P&&(M=Math.max(M,L.lineHeight))}w(C,D,M)}i.outerWidth=i.width=it(f,_),i.outerHeight=i.height=it(c,m),i.contentHeight=m,i.contentWidth=_,i.outerWidth+=l,i.outerHeight+=u;for(var T=0;T<y.length;T++){var L=y[T],Z=L.percentWidth;L.width=parseInt(Z,10)/100*i.width}return i}function zh(r,e,t,a,n){var i=e==="",o=n&&t.rich[n]||{},s=r.lines,l=o.font||t.font,u=!1,f,c;if(a){var v=o.padding,h=v?v[1]+v[3]:0;if(o.width!=null&&o.width!=="auto"){var d=$r(o.width,a.width)+h;s.length>0&&d+a.accumWidth>a.width&&(f=e.split(`
|
||
|
|
`),u=!0),a.accumWidth=d}else{var p=wM(e,l,a.width,a.breakAll,a.accumWidth);a.accumWidth=p.accumWidth+h,c=p.linesWidths,f=p.lines}}f||(f=e.split(`
|
||
|
|
`));for(var g=ga(l),y=0;y<f.length;y++){var m=f[y],_=new CB;if(_.styleName=n,_.text=m,_.isLineHolder=!m&&!i,typeof o.width=="number"?_.width=o.width:_.width=c?c[y]:ya(g,m),!y&&!u){var S=(s[s.length-1]||(s[0]=new S1)).tokens,b=S.length;b===1&&S[0].isLineHolder?S[0]=_:(m||!b||i)&&S.push(_)}else s.push(new S1([_]))}}function DB(r){var e=r.charCodeAt(0);return e>=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}var LB=ma(",&?/;] ".split(""),function(r,e){return r[e]=!0,r},{});function IB(r){return DB(r)?!!LB[r]:!0}function wM(r,e,t,a,n){for(var i=[],o=[],s="",l="",u=0,f=0,c=ga(e),v=0;v<r.length;v++){var h=r.charAt(v);if(h===`
|
||
|
|
`){l&&(s+=l,f+=u),i.push(s),o.push(f),s="",l="",u=0,f=0;continue}var d=tM(c,h.charCodeAt(0)),p=a?!1:!IB(h);if(i.length?f+d>t:n+f+d>t){f?(s||l)&&(p?(s||(s=l,l="",u=0,f=u),i.push(s),o.push(f-u),l+=h,u+=d,s="",f=u):(l&&(s+=l,l="",u=0),i.push(s),o.push(f),s=h,f=d)):p?(i.push(l),o.push(u),l=h,u=d):(i.push(h),o.push(d));continue}f+=d,p?(l+=h,u+=d):(l&&(s+=l,l="",u=0),s+=h)}return l&&(s+=l),s&&(i.push(s),o.push(f)),i.length===1&&(f+=n),{accumWidth:f,lines:i,linesWidths:o}}function x1(r,e,t,a,n,i){if(r.baseX=t,r.baseY=a,r.outerWidth=r.outerHeight=null,!!e){var o=e.width*2,s=e.height*2;dt.set(b1,ls(t,o,n),Bi(a,s,i),o,s),dt.intersect(e,b1,null,w1);var l=w1.outIntersectRect;r.outerWidth=l.width,r.outerHeight=l.height,r.baseX=ls(l.x,l.width,n,!0),r.baseY=Bi(l.y,l.height,i,!0)}}var b1=new dt(0,0,0,0),w1={outIntersectRect:{},clamp:!0};function Dm(r){return r!=null?r+="":r=""}function PB(r){var e=Dm(r.text),t=r.font,a=ya(ga(t),e),n=_u(t);return Ag(r,a,n,null)}function Ag(r,e,t,a){var n=new dt(ls(r.x||0,e,r.textAlign),Bi(r.y||0,t,r.textBaseline),e,t),i=a??(TM(r)?r.lineWidth:0);return i>0&&(n.x-=i/2,n.y-=i/2,n.width+=i,n.height+=i),n}function TM(r){var e=r.stroke;return e!=null&&e!=="none"&&r.lineWidth>0}var Mg="__zr_style_"+Math.round(Math.random()*10),Ni={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},Ev={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};Ni[Mg]=!0;var T1=["z","z2","invisible"],RB=["invisible"],kB=function(r){Yt(e,r);function e(t){return r.call(this,t)||this}return e.prototype._init=function(t){for(var a=Ct(t),n=0;n<a.length;n++){var i=a[n];i==="style"?this.useStyle(t[i]):r.prototype.attrKV.call(this,i,t[i])}this.style||this.useStyle({})},e.prototype.beforeBrush=function(){},e.prototype.afterBrush=function(){},e.prototype.innerBeforeBrush=function(){},e.prototype.innerAfterBrush=function(){},e.prototype.shouldBePainted=function(t,a,n,i){var o=this.transform;if(this.ignore||this.invisible||this.style.opacity===0||this.culling&&EB(this,t,a)||o&&!o[0]&&!o[3])return!1;if(n&&this.__clipPaths&&this.__clipPaths.length){for(var s=0;s<this.__clipPaths.length;++s)if(this.__clipPaths[s].isZeroArea())return!1}if(i&&this.parent)for(var l=this.parent;l;){if(l.ignore)return!1;l=l.parent}return!0},e.prototype.contain=function(t,a){return this.rectContain(t,a)},e.prototype.traverse=function(t,a){t.call(a,this)},e.prototype.rectContain=function(t,a){var n=this.transformCoordToLocal(t,a),i=this.getBoundingRect();return i.contain(n[0],n[1])},e.prototype.getPaintRect=function(){var t=this._paintRect;if(!this._paintRect||this.__dirty){var a=this.transform,n=this.getBoundingRect(),i=this.style,o=i.shadowBlur||0,s=i.shadowOffsetX||0,l=i.shadowOffsetY||0;t=this._paintRect||(this._paintRect=new dt(0,0,0,0)),a?dt.applyTransform(t,n,a):t.copy(n),(o||s||l)&&(t.width+=o*2+Math.abs(s),t.height+=o*2+Math.abs(l),t.x=Math.min(t.x,t.x+s-o),t.y=Math.min(t.y,t.y+l-o));var u=this.dirtyRectTolerance;t.isZero()||(t.x=Math.floor(t.x-u),t.y=Math.floor(t.y-u),t.width=Math.ceil(t.width+1+u*2),t.height=Math.ceil(t.height+1+u*2))}return t},e.prototype.setPrevPaintRect=function(t){t?(this._prevPaintRect=this._prevPaintRect||new dt(0,0,0,0),this._prevPaintRect.copy(t)):this._prevPaintRect=null},e.prototype.getPrevPaintRect=function(){return this._prevPaintRect},e.prototype.animateStyle=function(t){return this.animate("style",t)},e.prototype.updateDuringAnimation=function(t){t==="style"?this.dirtyStyle():this.markRedraw()},e.prototype.attrKV=function(t,a){t!=="style"?r.prototype.attrKV.call(this,t,a):this.style?this.setStyle(a):this.useStyle(a)},e.prototype.setStyle=function(t,a){return typeof t=="string"?this.style[t]=a:W(this.style,t),this.dirtyStyle(),this},e.prototype.dirtyStyle=function(t){t||this.markRedraw(),this.__dirty|=yl,this._rect&&(this._rect=null)},e.prototype.dirty=function(){this.dirtyStyle()},e.prototype.styleChanged=function(){return!!(this.__dirty&yl)},e.prototype.styleUpdated=function(){this.__dirty&=~yl},e.prototype.createStyle=function(t){return Mv(Ni,t)},e.prototyp
|
||
|
|
`,`
|
||
|
|
|
||
|
|
`,`
|
||
|
|
|
||
|
|
|
||
|
|
`];function ue(r,e){return e.type=r,e}function Xg(r){return r.type==="section"}function gL(r){return Xg(r)?Zz:Xz}function yL(r){if(Xg(r)){var e=0,t=r.blocks.length,a=t>1||t>0&&!r.noHeader;return A(r.blocks,function(n){var i=yL(n);i>=e&&(e=i+ +(a&&(!i||Xg(n)&&!n.noHeader)))}),e}return 0}function Zz(r,e,t,a){var n=e.noHeader,i=qz(yL(e)),o=[],s=e.blocks||[];ze(!s||U(s)),s=s||[];var l=r.orderMode;if(e.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(tt(u,l)){var f=new uL(u[l],null);s.sort(function(p,g){return f.evaluate(p.sortParam,g.sortParam)})}else l==="seriesDesc"&&s.reverse()}A(s,function(p,g){var y=e.valueFormatter,m=gL(p)(y?W(W({},r),{valueFormatter:y}):r,p,g>0?i.html:0,a);m!=null&&o.push(m)});var c=r.renderMode==="richText"?o.join(i.richText):qg(a,o.join(""),n?t:i.html);if(n)return c;var v=Hg(e.header,"ordinal",r.useUTC),h=pL(a,r.renderMode).nameStyle,d=dL(a);return r.renderMode==="richText"?mL(r,v,h)+i.richText+c:qg(a,'<div style="'+h+";"+d+';">'+Be(v)+"</div>"+c,t)}function Xz(r,e,t,a){var n=r.renderMode,i=e.noName,o=e.noValue,s=!e.markerType,l=e.name,u=r.useUTC,f=e.valueFormatter||r.valueFormatter||function(S){return S=U(S)?S:[S],Y(S,function(b,x){return Hg(b,U(h)?h[x]:h,u)})};if(!(i&&o)){var c=s?"":r.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||G.color.secondary,n),v=i?"":Hg(l,"ordinal",u),h=e.valueType,d=o?[]:f(e.value,e.dataIndex),p=!s||!i,g=!s&&i,y=pL(a,n),m=y.nameStyle,_=y.valueStyle;return n==="richText"?(s?"":c)+(i?"":mL(r,v,m))+(o?"":Jz(r,d,p,g,_)):qg(a,(s?"":c)+(i?"":Kz(v,!s,m))+(o?"":jz(d,p,g,_)),t)}}function RS(r,e,t,a,n,i){if(r){var o=gL(r),s={useUTC:n,renderMode:t,orderMode:a,markupStyleCreator:e,valueFormatter:r.valueFormatter};return o(s,r,0,i)}}function qz(r){return{html:Uz[r],richText:Yz[r]}}function qg(r,e,t){var a='<div style="clear:both"></div>',n="margin: "+t+"px 0 0",i=dL(r);return'<div style="'+n+";"+i+';">'+e+a+"</div>"}function Kz(r,e,t){var a=e?"margin-left:2px":"";return'<span style="'+t+";"+a+'">'+Be(r)+"</span>"}function jz(r,e,t,a){var n=t?"10px":"20px",i=e?"float:right;margin-left:"+n:"";return r=U(r)?r:[r],'<span style="'+i+";"+a+'">'+Y(r,function(o){return Be(o)}).join(" ")+"</span>"}function mL(r,e,t){return r.markupStyleCreator.wrapRichTextStyle(e,t)}function Jz(r,e,t,a,n){var i=[n],o=a?10:20;return t&&i.push({padding:[0,0,0,o],align:"right"}),r.markupStyleCreator.wrapRichTextStyle(U(e)?e.join(" "):e,i)}function _L(r,e){var t=r.getData().getItemVisual(e,"style"),a=t[r.visualDrawType];return ji(a)}function SL(r,e){var t=r.get("padding");return t??(e==="richText"?[8,10]:10)}var ud=function(){function r(){this.richTextStyles={},this._nextStyleNameId=fM()}return r.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},r.prototype.makeTooltipMarker=function(e,t,a){var n=a==="richText"?this._generateStyleName():null,i=BV({color:t,type:e,renderMode:a,markerId:n});return K(i)?i:(this.richTextStyles[n]=i.style,i.content)},r.prototype.wrapRichTextStyle=function(e,t){var a={};U(t)?A(t,function(i){return W(a,i)}):W(a,t);var n=this._generateStyleName();return this.richTextStyles[n]=a,"{"+n+"|"+e+"}"},r}();function xL(r){var e=r.series,t=r.dataIndex,a=r.multipleSeries,n=e.getData(),i=n.mapDimensionsAll("defaultedTooltip"),o=i.length,s=e.getRawValue(t),l=U(s),u=_L(e,t),f,c,v,h;if(o>1||l&&!o){var d=Qz(s,e,t,i,u);f=d.inlineValues,c=d.inlineValueTypes,v=d.blocks,h=d.inlineValues[0]}else if(o){var p=n.getDimensionInfo(i[0]);h=f=fs(n,t,i[0]),c=p.type}else h=f=l?s[0]:s;var g=Tm(e),y=g&&e.name||"",m=n.getName(t),_=a?y:m;return ue("section",{header:y,noHeader:a||!g,sortParam:h,blocks:[ue("nameValue",{markerType:"item",markerColor:u,name:_,noName:!Mr(_),value:f,valueType:c,dataIndex:t})].concat(v||[])})}function Qz(r,e,t,a,n){var i=e.getData(),o=ma(r,function(c,v,h){var d=i.getDimensionInfo(h);return c=c||d&&d.tooltip!==!1&&d.displayName!=null},!1),s=[],l=[],u=[];a.length?A(a,function(c){f(fs(i,t,c),c)}):A(r,f);function f(c,v){var h=i.getDimensionInfo(v);!h||h.otherDims.tooltip===!1||(o?u.push(ue("nameValue",{markerType:"
|
||
|
|
`:"";function a(n){var i=n.children,o=n.tag,s=n.attrs,l=n.text;return wF(o,s)+(o!=="style"?Be(l):l||"")+(i?""+t+Y(i,function(u){return a(u)}).join(t)+t:"")+TF(o)}return a(r)}function CF(r,e,t){t=t||{};var a=t.newline?`
|
||
|
|
`:"",n=" {"+a,i=a+"}",o=Y(Ct(r),function(l){return l+n+Y(Ct(r[l]),function(u){return u+":"+r[l][u]+";"}).join(a)+i}).join(a),s=Y(Ct(e),function(l){return"@keyframes "+l+n+Y(Ct(e[l]),function(u){return u+n+Y(Ct(e[l][u]),function(f){var c=e[l][u][f];return f==="d"&&(c='path("'+c+'")'),f+":"+c+";"}).join(a)+i}).join(a)+i}).join(a);return!o&&!s?"":["<![CDATA[",o,s,"]]>"].join(a)}function dy(r){return{zrId:r,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function Ix(r,e,t,a){return Se("svg","root",{width:r,height:e,xmlns:$2,"xmlns:xlink":U2,version:"1.1",baseProfile:"full",viewBox:a?"0 0 "+r+" "+e:!1},t)}var AF=0;function Z2(){return AF++}var Px={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},yi="transform-origin";function MF(r,e,t){var a=W({},r.shape);W(a,e),r.buildPath(t,a);var n=new W2;return n.reset(qA(r)),t.rebuildPath(n,1),n.generateStr(),n.getStr()}function DF(r,e){var t=e.originX,a=e.originY;(t||a)&&(r[yi]=t+"px "+a+"px")}var LF={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function X2(r,e){var t=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[t]=r,t}function IF(r,e,t){var a=r.shape.paths,n={},i,o;if(A(a,function(l){var u=dy(t.zrId);u.animation=!0,eh(l,{},u,!0);var f=u.cssAnims,c=u.cssNodes,v=Ct(f),h=v.length;if(h){o=v[h-1];var d=f[o];for(var p in d){var g=d[p];n[p]=n[p]||{d:""},n[p].d+=g.d||""}for(var y in c){var m=c[y].animation;m.indexOf(o)>=0&&(i=m)}}}),!!i){e.d=!1;var s=X2(n,t);return i.replace(o,s)}}function Rx(r){return K(r)?Px[r]?"cubic-bezier("+Px[r]+")":_m(r)?r:"":""}function eh(r,e,t,a){var n=r.animators,i=n.length,o=[];if(r instanceof Hv){var s=IF(r,e,t);if(s)o.push(s);else if(!i)return}else if(!i)return;for(var l={},u=0;u<i;u++){var f=n[u],c=[f.getMaxTime()/1e3+"s"],v=Rx(f.getClip().easing),h=f.getDelay();v?c.push(v):c.push("linear"),h&&c.push(h/1e3+"s"),f.getLoop()&&c.push("infinite");var d=c.join(" ");l[d]=l[d]||[d,[]],l[d][1].push(f)}function p(m){var _=m[1],S=_.length,b={},x={},w={},T="animation-timing-function";function C(J,X,ht){for(var rt=J.getTracks(),pt=J.getMaxTime(),Bt=0;Bt<rt.length;Bt++){var Mt=rt[Bt];if(Mt.needsAnimate()){var Nt=Mt.keyframes,Vt=Mt.propName;if(ht&&(Vt=ht(Vt)),Vt)for(var me=0;me<Nt.length;me++){var ar=Nt[me],Ke=Math.round(ar.time/pt*100)+"%",Wn=Rx(ar.easing),ho=ar.rawValue;(K(ho)||At(ho))&&(X[Ke]=X[Ke]||{},X[Ke][Vt]=ar.rawValue,Wn&&(X[Ke][T]=Wn))}}}}for(var M=0;M<S;M++){var D=_[M],I=D.targetName;I?I==="shape"&&C(D,x):!a&&C(D,b)}for(var L in b){var P={};Ac(P,r),W(P,b[L]);var k=KA(P),R=b[L][T];w[L]=k?{transform:k}:{},DF(w[L],P),R&&(w[L][T]=R)}var B,E=!0;for(var L in x){w[L]=w[L]||{};var V=!B,R=x[L][T];V&&(B=new xa);var O=B.len();B.reset(),w[L].d=MF(r,x[L],B);var N=B.len();if(!V&&O!==N){E=!1;break}R&&(w[L][T]=R)}if(!E)for(var L in w)delete w[L].d;if(!a)for(var M=0;M<S;M++){var D=_[M],I=D.targetName;I==="style"&&C(D,w,function(rt){return LF[rt]})}for(var z=Ct(w),$=!0,H,M=1;M<z.length;M++){var Z=z[M-1],Q=z[M];if(w[Z][yi]!==w[Q][yi]){$=!1;break}H=w[Z][yi]}if($&&H){for(var L in w)w[L][yi]&&delete w[L][yi];e[yi]=H}if(Ot(z,function(J){return Ct(w[J]).length>0}).length){var nt=X2(w,t);return nt+" "+m[0]+" both"}}for(var g in l){var s=p(l[g]);s&&o.push(s)}if(o.length){var y=t.zrId+"-cls-"+Z2();t.cssNodes["."+y]={animation:o.join(",")},e.class=y}}function PF(r,e,t){if(!r.ignore)if(r.isSilent()){var a={"pointer-events":"none"};kx(a,e,t,!0)}else{var n=r.states.emphasis&&r.state
|
||
|
|
`+g.message)}var n=new lt;n.add(a),n.isGeoSVGGraphicRoot=!0;var i=t.width,o=t.height,s=t.viewBoxRect,l=this._boundingRect;if(!l){var u=void 0,f=void 0,c=void 0,v=void 0;if(i!=null?(u=0,c=i):s&&(u=s.x,c=s.width),o!=null?(f=0,v=o):s&&(f=s.y,v=s.height),u==null||f==null){var h=a.getBoundingRect();u==null&&(u=h.x,c=h.width),f==null&&(f=h.y,v=h.height)}l=this._boundingRect=new dt(u,f,c,v)}if(s){var d=YI(s,l);a.scaleX=a.scaleY=d.scale,a.x=d.x,a.y=d.y}n.setClipPath(new bt({shape:l.plain()}));var p=[];return A(t.named,function(g){XW.get(g.svgNodeTagLower)!=null&&(p.push(g),KW(g.el))}),{root:n,boundingRect:l,named:p}},r.prototype.useGraphic=function(e){var t=this._usedGraphicMap,a=t.get(e);return a||(a=this._freedGraphics.pop()||this._buildGraphic(this._parsedXML),t.set(e,a),a)},r.prototype.freeGraphic=function(e){var t=this._usedGraphicMap,a=t.get(e);a&&(t.removeKey(e),this._freedGraphics.push(a))},r}();function KW(r){r.silent=!1,r.isGroup&&r.traverse(function(e){e.silent=!1})}function jW(r){var e=[],t=at();return A(r,function(a){if(a.namedFrom==null){var n=new O3(a.name,a.el);e.push(n),t.set(a.name,n)}}),{regions:e,regionsMap:t}}var Cy=[126,25],Nb="南海诸岛",mi=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]];for(var pi=0;pi<mi.length;pi++)for(var Po=0;Po<mi[pi].length;Po++)mi[pi][Po][0]/=10.5,mi[pi][Po][1]/=-10.5/.75,mi[pi][Po][0]+=Cy[0],mi[pi][Po][1]+=Cy[1];function JW(r,e){if(r==="china"){for(var t=0;t<e.length;t++)if(e[t].name===Nb)return;e.push(new M2(Nb,Y(mi,function(a){return{type:"polygon",exterior:a}}),Cy))}}var QW={南海诸岛:[32,80],广东:[0,-10],香港:[10,5],澳门:[-10,10],天津:[5,5]};function t$(r,e){if(r==="china"){var t=QW[e.name];if(t){var a=e.getCenter();a[0]+=t[0]/10.5,a[1]+=-t[1]/(10.5/.75),e.setCenter(a)}}}var e$=[[[123.45165252685547,25.73527164402261],[123.49731445312499,25.73527164402261],[123.49731445312499,25.750734064600884],[123.45165252685547,25.750734064600884],[123.45165252685547,25.73527164402261]]];function r$(r,e){r==="china"&&e.name==="台湾"&&e.geometries.push({type:"polygon",exterior:e$[0]})}var a$="name",n$=function(){function r(e,t,a){this.type="geoJSON",this._parsedMap=at(),this._mapName=e,this._specialAreas=a,this._geoJSON=o$(t)}return r.prototype.load=function(e,t){t=t||a$;var a=this._parsedMap.get(t);if(!a){var n=this._parseToRegions(t);a=this._parsedMap.set(t,{regions:n,boundingRect:i$(n)})}var i=at(),o=[];return A(a.regions,function(s){var l=s.name;e&&tt(e,l)&&(s=s.cloneShallow(l=e[l])),o.push(s),i.set(l,s)}),{regions:o,boundingRect:a.boundingRect||new dt(0,0,0,0),regionsMap:i}},r.prototype._parseToRegions=function(e){var t=this._mapName,a=this._geoJSON,n;try{n=a?N3(a,e):[]}catch(i){throw new Error(`Invalid geoJson format
|
||
|
|
`+i.message)}return JW(t,n),A(n,function(i){var o=i.name;t$(t,i),r$(t,i);var s=this._specialAreas&&this._specialAreas[o];s&&i.transformTo(s.left,s.top,s.width,s.height)},this),n},r.prototype.getMapForUser=function(){return{geoJson:this._geoJSON,geoJSON:this._geoJSON,specialAreas:this._specialAreas}},r}();function i$(r){for(var e,t=0;t<r.length;t++){var a=r[t].getBoundingRect();e=e||a.clone(),e.union(a)}return e}function o$(r){return K(r)?typeof JSON<"u"&&JSON.parse?JSON.parse(r):new Function("return ("+r+");")():r}var nl=at();const Za={registerMap:function(r,e,t){if(e.svg){var a=new qW(r,e.svg);nl.set(r,a)}else{var n=e.geoJson||e.geoJSON;n&&!e.features?t=e.specialAreas:n=e;var a=new n$(r,n,t);nl.set(r,a)}},getGeoResource:function(r){return nl.get(r)},getMapForUser:function(r){var e=nl.get(r);return e&&e.type==="geoJSON"&&e.getMapForUser()},load:function(r,e,t){var a=nl.get(r);if(a)return a.load(e,t)}};var N0=["rect","circle","line","ellipse","polygon","polyline","path"],s$=at(N0),l$=at(N0.concat(["g"])),u$=at(N0.concat(["g"])),ZI=wt();function Df(r){var e=r.getItemStyle(),t=r.get("areaColor");return t!=null&&(e.fill=t),e}function Vb(r){var e=r.style;e&&(e.stroke=e.stroke||e.fill,e.fill=null)}var f$=function(){function r(e){var t=this.group=new lt,a=this._transformGroup=new lt;t.add(a),this.uid=Ds("ec_map_draw"),this._controller=new co(e.getZr()),this._controllerHost={target:a},a.add(this._regionsGroup=new lt),a.add(this._svgGroup=new lt)}return r.prototype.draw=function(e,t,a,n,i){var o=e.mainType==="geo",s=e.getData&&e.getData();o&&t.eachComponent({mainType:"series",subType:"map"},function(_){!s&&_.getHostGeoModel()===e&&(s=_.getData())});var l=e.coordinateSystem,u=this._regionsGroup,f=this._transformGroup,c=l.getTransformInfo(),v=c.raw,h=c.roam,d=!u.childAt(0)||i,p=e.getShallow("clip",!0),g;p?(g=l.getViewRect().clone(),this.group.setClipPath(new bt({shape:g.clone()}))):this.group.removeClipPath(),d?(f.x=h.x,f.y=h.y,f.scaleX=h.scaleX,f.scaleY=h.scaleY,f.dirty()):It(f,h,e);var y=s&&s.getVisual("visualMeta")&&s.getVisual("visualMeta").length>0,m={api:a,geo:l,mapOrGeoModel:e,data:s,isVisualEncodedByVisualMap:y,isGeo:o,transformInfoRaw:v};l.resourceType==="geoJSON"?this._buildGeoJSON(m):l.resourceType==="geoSVG"&&this._buildSVG(m),this._updateController(e,g,t,a),this._updateMapSelectHandler(e,u,a,n)},r.prototype._buildGeoJSON=function(e){var t=this._regionsGroupByName=at(),a=at(),n=this._regionsGroup,i=e.transformInfoRaw,o=e.mapOrGeoModel,s=e.data,l=e.geo.projection,u=l&&l.stream;function f(h,d){return d&&(h=d(h)),h&&[h[0]*i.scaleX+i.x,h[1]*i.scaleY+i.y]}function c(h){for(var d=[],p=!u&&l&&l.project,g=0;g<h.length;++g){var y=f(h[g],p);y&&d.push(y)}return d}function v(h){return{shape:{points:c(h)}}}n.removeAll(),A(e.geo.regions,function(h){var d=h.name,p=t.get(d),g=a.get(d)||{},y=g.dataIdx,m=g.regionModel;if(!p){p=t.set(d,new lt),n.add(p),y=s?s.indexOfName(d):null,m=e.isGeo?o.getRegionModel(d):s?s.getItemModel(y):null;var _=m.get("silent",!0);_!=null&&(p.silent=_),a.set(d,{dataIdx:y,regionModel:m})}var S=[],b=[];A(h.geometries,function(T){if(T.type==="polygon"){var C=[T.exterior].concat(T.interiors||[]);u&&(C=$b(C,u)),A(C,function(D){S.push(new qe(v(D)))})}else{var M=T.points;u&&(M=$b(M,u,!0)),A(M,function(D){b.push(new Ge(v(D)))})}});var x=f(h.getCenter(),l&&l.project);function w(T,C){if(T.length){var M=new Hv({culling:!0,segmentIgnoreThreshold:1,shape:{paths:T}});p.add(M),zb(e,M,y,m),Gb(e,M,d,m,o,y,x),C&&(Vb(M),A(M.states,Vb))}}w(S),w(b,!0)}),t.each(function(h,d){var p=a.get(d),g=p.dataIdx,y=p.regionModel;Fb(e,h,d,y,o,g),Hb(e,h,d,y,o),Wb(e,h,d,y,o)},this)},r.prototype._buildSVG=function(e){var t=e.geo.map,a=e.transformInfoRaw;this._svgGroup.x=a.x,this._svgGroup.y=a.y,this._svgGroup.scaleX=a.scaleX,this._svgGroup.scaleY=a.scaleY,this._svgResourceChanged(t)&&(this._freeSVG(),this._useSVG(t));var n=this._svgDispatcherMap=at(),i=!1;A(this._svgGraphicRecord.named,function(o){var s=o.name,l=e.mapOrGeoModel,u=e.data,f=o.svgNodeTagLower,c=o.el,v=u?u.indexOfName(s):null,h=l.getRegionModel(s);s$.get(f)!=null&&c instanceof Ir&&zb(e,
|
||
|
|
`))}),e.join(`
|
||
|
|
|
||
|
|
`+fh+`
|
||
|
|
|
||
|
|
`)}function kq(r){return Y(r,function(e){var t=e.getRawData(),a=[e.name],n=[];return t.each(t.dimensions,function(){for(var i=arguments.length,o=arguments[i-1],s=t.getName(o),l=0;l<i-1;l++)n[l]=arguments[l];a.push((s?s+_s:"")+n.join(_s))}),a.join(`
|
||
|
|
`)}).join(`
|
||
|
|
|
||
|
|
`+fh+`
|
||
|
|
|
||
|
|
`)}function Eq(r){var e=Pq(r);return{value:Ot([Rq(e.seriesGroupByCategoryAxis),kq(e.other)],function(t){return!!t.replace(/[\n\t\s]/g,"")}).join(`
|
||
|
|
|
||
|
|
`+fh+`
|
||
|
|
|
||
|
|
`),meta:e.meta}}function pv(r){return r.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Oq(r){var e=r.slice(0,r.indexOf(`
|
||
|
|
`));if(e.indexOf(_s)>=0)return!0}var Zy=new RegExp("["+_s+"]+","g");function Bq(r){for(var e=r.split(/\n+/g),t=pv(e.shift()).split(Zy),a=[],n=Y(t,function(l){return{name:l,data:[]}}),i=0;i<e.length;i++){var o=pv(e[i]).split(Zy);a.push(o.shift());for(var s=0;s<o.length;s++)n[s]&&(n[s].data[i]=o[s])}return{series:n,categories:a}}function Nq(r){for(var e=r.split(/\n+/g),t=pv(e.shift()),a=[],n=0;n<e.length;n++){var i=pv(e[n]);if(i){var o=i.split(Zy),s="",l=void 0,u=!1;isNaN(o[0])?(u=!0,s=o[0],o=o.slice(1),a[n]={name:s,value:[]},l=a[n].value):l=a[n]=[];for(var f=0;f<o.length;f++)l.push(+o[f]);l.length===1&&(u?a[n].value=l[0]:a[n]=l[0])}}return{name:t,data:a}}function Vq(r,e){var t=r.split(new RegExp(`
|
||
|
|
*`+fh+`
|
||
|
|
*`,"g")),a={series:[]};return A(t,function(n,i){if(Oq(n)){var o=Bq(n),s=e[i],l=s.axisDim+"Axis";s&&(a[l]=a[l]||[],a[l][s.axisIndex]={data:o.categories},a.series=a.series.concat(o.series))}else{var o=Nq(n);a.series.push(o)}}),a}var zq=function(r){F(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.onclick=function(t,a){setTimeout(function(){a.dispatchAction({type:"hideTip"})});var n=a.getDom(),i=this.model;this._dom&&n.removeChild(this._dom);var o=document.createElement("div");o.style.cssText="position:absolute;top:0;bottom:0;left:0;right:0;padding:5px",o.style.backgroundColor=i.get("backgroundColor")||G.color.neutral00;var s=document.createElement("h4"),l=i.get("lang")||[];s.innerHTML=l[0]||i.get("title"),s.style.cssText="margin:10px 20px",s.style.color=i.get("textColor");var u=document.createElement("div"),f=document.createElement("textarea");u.style.cssText="overflow:auto";var c=i.get("optionToContent"),v=i.get("contentToOption"),h=Eq(t);if(ot(c)){var d=c(a.getOption());K(d)?u.innerHTML=d:os(d)&&u.appendChild(d)}else{f.readOnly=i.get("readOnly");var p=f.style;p.cssText="display:block;width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;resize:none;box-sizing:border-box;outline:none",p.color=i.get("textColor"),p.borderColor=i.get("textareaBorderColor"),p.backgroundColor=i.get("textareaColor"),f.value=h.value,u.appendChild(f)}var g=h.meta,y=document.createElement("div");y.style.cssText="position:absolute;bottom:5px;left:0;right:0";var m="float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",_=document.createElement("div"),S=document.createElement("div");m+=";background-color:"+i.get("buttonColor"),m+=";color:"+i.get("buttonTextColor");var b=this;function x(){n.removeChild(o),b._dom=null}ig(_,"click",x),ig(S,"click",function(){if(v==null&&c!=null||v!=null&&c==null){x();return}var w;try{ot(v)?w=v(u,a.getOption()):w=Vq(f.value,g)}catch(T){throw x(),new Error("Data view format error "+T)}w&&a.dispatchAction({type:"changeDataView",newOption:w}),x()}),_.innerHTML=l[1],S.innerHTML=l[2],S.style.cssText=_.style.cssText=m,!i.get("readOnly")&&y.appendChild(S),y.appendChild(_),o.appendChild(s),o.appendChild(u),o.appendChild(y),u.style.height=n.clientHeight-80+"px",n.appendChild(o),this._dom=o},e.prototype.remove=function(t,a){this._dom&&a.getDom().removeChild(this._dom)},e.prototype.dispose=function(t,a){this.remove(t,a)},e.getDefaultOption=function(t){var a={show:!0,readOnly:!1,optionToContent:null,contentToOption:null,icon:"M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",title:t.getLocaleModel().get(["toolbox","dataView","title"]),lang:t.getLocaleModel().get(["toolbox","dataView","lang"]),backgroundColor:G.color.background,textColor:G.color.primary,textareaColor:G.color.background,textareaBorderColor:G.color.border,buttonColor:G.color.accent50,buttonTextColor:G.color.neutral00};return a},e}(Tr);function Gq(r,e){return Y(r,function(t,a){var n=e&&e[a];if(vt(n)&&!U(n)){var i=vt(t)&&!U(t);i||(t={value:t});var o=n.name!=null&&t.name==null;return t=ct(t,n),o&&delete t.name,t}else return t})}Ta({type:"changeDataView",event:"dataViewChanged",update:"prepareAndUpdate"},function(r,e){var t=[];A(r.newOption.series,function(a){var n=e.getSeriesByName(a.name)[0];if(!n)t.push(W({type:"scatter"},a));else{var i=n.get("data");t.push({name:a.name,data:Gq(a.data,i)})}}),e.mergeOption(ct({series:t},r.newOption))});const Fq=zq;var PR=A,RR=wt();function Hq(r,e){var t=w_(r);PR(e,function(a,n){for(var i=t.length-1;i>=0;i--){var o=t[i];if(o[n])break}if(i<0){var s=r.queryComponents({mainType:"dataZoom",subType:"select",id:n})[0];if(s){var l=s.getPercentRange();t[0][n]={dataZoomId:n,start:l[0],end:l[1]}}}}),t.push(e)}function Wq(r){var e=w_(r),t=e[e.length-1];e.length>1&&e.pop();var a={};return PR(t,function(n,i){for(var o=e.length-1;o>=0;o--)if(n=e[o][i],n){a[i]=n;break}}),a}function $q(r){RR(r).snapshots=null}function Uq(r){return w_(r).length}function w_(r){var e=RR(r);return e.snap
|
||
|
|
|
||
|
|
`:"<br/>",y=c.join(g);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(t,u)?this._updatePosition(s,h,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,y,u,Math.random()+"",o[0],o[1],h,null,v)})},e.prototype._showSeriesItemTooltip=function(t,a,n){var i=this._ecModel,o=gt(a),s=o.seriesIndex,l=i.getSeriesByIndex(s),u=o.dataModel||l,f=o.dataIndex,c=o.dataType,v=u.getData(c),h=this._renderMode,d=t.positionDefault,p=fl([v.getItemModel(f),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,d?{position:d}:null),g=p.get("trigger");if(!(g!=null&&g!=="item")){var y=u.getDataParams(f,c),m=new ud;y.marker=m.makeTooltipMarker("item",ji(y.color),h);var _=AS(u.formatTooltip(f,!1,c)),S=p.get("order"),b=p.get("valueFormatter"),x=_.frag,w=x?RS(b?W({valueFormatter:b},x):x,m,h,S,i.get("useUTC"),p.get("textStyle")):_.text,T="item_"+u.name+"_"+f;this._showOrMove(p,function(){this._showTooltipContent(p,w,y,T,t.offsetX,t.offsetY,t.position,t.target,m)}),n({type:"showTip",dataIndexInside:f,dataIndex:v.getRawIndex(f),seriesIndex:s,from:this.uid})}},e.prototype._showComponentItemTooltip=function(t,a,n){var i=this._renderMode==="html",o=gt(a),s=o.tooltipConfig,l=s.option||{},u=l.encodeHTMLContent;if(K(l)){var f=l;l={content:f,formatter:f},u=!0}u&&i&&l.content&&(l=st(l),l.content=Be(l.content));var c=[l],v=this._ecModel.getComponent(o.componentMainType,o.componentIndex);v&&c.push(v),c.push({formatter:l.content});var h=t.positionDefault,d=fl(c,this._tooltipModel,h?{position:h}:null),p=d.get("content"),g=Math.random()+"",y=new ud;this._showOrMove(d,function(){var m=st(d.get("formatterParams")||{});this._showTooltipContent(d,p,m,g,t.offsetX,t.offsetY,t.position,a,y)}),n({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(t,a,n,i,o,s,l,u,f){if(this._ticket="",!(!t.get("showContent")||!t.get("show"))){var c=this._tooltipContent;c.setEnterable(t.get("enterable"));var v=t.get("formatter");l=l||t.get("position");var h=a,d=this._getNearestPoint([o,s],n,t.get("trigger"),t.get("borderColor"),t.get("defaultBorderColor",!0)),p=d.color;if(v)if(K(v)){var g=t.ecModel.get("useUTC"),y=U(n)?n[0]:n,m=y&&y.axisType&&y.axisType.indexOf("time")>=0;h=v,m&&(h=Yv(y.axisValue,h,g)),h=RD(h,n,!0)}else if(ot(v)){var _=j(function(S,b){S===this._ticket&&(c.setContent(b,f,t,p,l),this._updatePosition(t,l,o,s,c,n,u))},this);this._ticket=i,h=v(n,i,_)}else h=v;c.setContent(h,f,t,p,l),c.show(t,p),this._updatePosition(t,l,o,s,c,n,u)}},e.prototype._getNearestPoint=function(t,a,n,i,o){if(n==="axis"||U(a))return{color:i||o};if(!U(a))return{color:i||a.color||a.borderColor}},e.prototype._updatePosition=function(t,a,n,i,o,s,l){var u=this._api.getWidth(),f=this._api.getHeight();a=a||t.get("position");var c=o.getSize(),v=t.get("align"),h=t.get("verticalAlign"),d=l&&l.getBoundingRect().clone();if(l&&d.applyTransform(l.transform),ot(a)&&(a=a([n,i],s,o.el,d,{viewSize:[u,f],contentSize:c.slice()})),U(a))n=q(a[0],u),i=q(a[1],f);else if(vt(a)){var p=a;p.width=c[0],p.height=c[1];var g=Xt(p,{width:u,height:f});n=g.x,i=g.y,v=null,h=null}else if(K(a)&&l){var y=TK(a,d,c,t.get("borderWidth"));n=y[0],i=y[1]}else{var y=bK(n,i,o,u,f,v?null:20,h?null:20);n=y[0],i=y[1]}if(v&&(n-=pC(v)?c[0]/2:v==="right"?c[0]:0),h&&(i-=pC(h)?c[1]/2:h==="bottom"?c[1]:0),kR(t)){var y=wK(n,i,o,u,f);n=y[0],i=y[1]}o.moveTo(n,i)},e.prototype._updateContentNotChangedOnAxis=function(t,a){var n=this._lastDataByCoordSys,i=this._cbParamsList,o=!!n&&n.length===t.length;return o&&A(n,function(s,l){var u=s.dataByAxis||[],f=t[l]||{},c=f.dataByAxis||[];o=o&&u.length===c.length,o&&A(u,function(v,h){var d=c[h]||{},p=v.seriesDataIndices||[],g=d.seriesDataIndices||[];o=o&&v.value===d.value&&v.axisType===d.axisType&&v.axisId===d.axisId&&p.length===g.length,o&&A(p,function(y,m){var _=g[m];o=o&&y.seriesIndex===_.seriesIndex&&y.dataIndex===_.dataIndex}),i&&A(v.seriesDataIndices,function(y){var m=y.seriesIndex,_=a[m],S=i[m];_&&S&&S.data!==_.data&&(o=!1)})})}),this._lastDataByCoordSys=t,this._cbParamsList=a,!!o},e.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid
|
||
|
|
`)){var m=new qf;m.newline=!0,u.add(m);return}var _=n.getSeriesByName(y)[0];if(!f.get(y))if(_){var S=_.getData(),b=S.getVisual("legendLineStyle")||{},x=S.getVisual("legendIcon"),w=S.getVisual("style"),T=this._createItem(_,y,p,d,a,t,b,w,x,c,i);T.on("click",Vo(EC,y,null,i,h)).on("mouseover",Vo(em,_.name,null,i,h)).on("mouseout",Vo(rm,_.name,null,i,h)),n.ssr&&T.eachChild(function(C){var M=gt(C);M.seriesIndex=_.seriesIndex,M.dataIndex=p,M.ssrType="legend"}),v&&T.eachChild(function(C){g.packEventData(C,a,_,p,y)}),f.set(y,!0)}else n.eachRawSeries(function(C){var M=this;if(!f.get(y)&&C.legendVisualProvider){var D=C.legendVisualProvider;if(!D.containName(y))return;var I=D.indexOfName(y),L=D.getItemVisual(I,"style"),P=D.getItemVisual(I,"legendIcon"),k=er(L.fill);k&&k[3]===0&&(k[3]=.2,L=W(W({},L),{fill:pa(k,"rgba")}));var R=this._createItem(C,y,p,d,a,t,{},L,P,c,i);R.on("click",Vo(EC,null,y,i,h)).on("mouseover",Vo(em,null,y,i,h)).on("mouseout",Vo(rm,null,y,i,h)),n.ssr&&R.eachChild(function(B){var E=gt(B);E.seriesIndex=C.seriesIndex,E.dataIndex=p,E.ssrType="legend"}),v&&R.eachChild(function(B){M.packEventData(B,a,C,p,y)}),f.set(y,!0)}},this)},this),o&&this._createSelector(o,a,i,s,l)},e.prototype.packEventData=function(t,a,n,i,o){var s={componentType:"legend",componentIndex:a.componentIndex,dataIndex:i,value:o,seriesIndex:n.seriesIndex};gt(t).eventData=s},e.prototype._createSelector=function(t,a,n,i,o){var s=this.getSelectorGroup();tm(t,function(u){var f=u.type,c=new Lt({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){n.dispatchAction({type:f==="all"?"legendAllSelect":"legendInverseSelect",legendId:a.id})}});s.add(c);var v=a.getModel("selectorLabel"),h=a.getModel(["emphasis","selectorLabel"]);xe(c,{normal:v,emphasis:h},{defaultText:u.title}),zi(c)})},e.prototype._createItem=function(t,a,n,i,o,s,l,u,f,c,v){var h=t.visualDrawType,d=o.get("itemWidth"),p=o.get("itemHeight"),g=o.isSelected(a),y=i.get("symbolRotate"),m=i.get("symbolKeepAspect"),_=i.get("icon");f=_||f||"roundRect";var S=Fj(f,i,l,u,h,g,v),b=new qf,x=i.getModel("textStyle");if(ot(t.getLegendIcon)&&(!_||_==="inherit"))b.add(t.getLegendIcon({itemWidth:d,itemHeight:p,icon:f,iconRotate:y,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:m}));else{var w=_==="inherit"&&t.getData().getVisual("symbol")?y==="inherit"?t.getData().getVisual("symbolRotate"):y:0;b.add(Hj({itemWidth:d,itemHeight:p,icon:f,iconRotate:w,itemStyle:S.itemStyle,lineStyle:S.lineStyle,symbolKeepAspect:m}))}var T=s==="left"?d+5:-5,C=s,M=o.get("formatter"),D=a;K(M)&&M?D=M.replace("{name}",a??""):ot(M)&&(D=M(a));var I=g?x.getTextColor():i.get("inactiveColor");b.add(new Lt({style:Ft(x,{text:D,x:T,y:p/2,fill:I,align:C,verticalAlign:"middle"},{inheritColor:I})}));var L=new bt({shape:b.getBoundingRect(),style:{fill:"transparent"}}),P=i.getModel("tooltip");return P.get("show")&&Ka({el:L,componentModel:o,itemName:a,itemTooltipOption:P.option}),b.add(L),b.eachChild(function(k){k.silent=!0}),L.silent=!c,this.getContentGroup().add(b),zi(b),b.__legendDataIndex=n,b},e.prototype.layoutInner=function(t,a,n,i,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();Fi(t.get("orient"),l,t.get("itemGap"),n.width,n.height);var f=l.getBoundingRect(),c=[-f.x,-f.y];if(u.markRedraw(),l.markRedraw(),o){Fi("horizontal",u,t.get("selectorItemGap",!0));var v=u.getBoundingRect(),h=[-v.x,-v.y],d=t.get("selectorButtonGap",!0),p=t.getOrient().index,g=p===0?"width":"height",y=p===0?"height":"width",m=p===0?"y":"x";s==="end"?h[p]+=f[g]+d:c[p]+=v[g]+d,h[1-p]+=f[y]/2-v[y]/2,u.x=h[0],u.y=h[1],l.x=c[0],l.y=c[1];var _={x:0,y:0};return _[g]=f[g]+d+v[g],_[y]=Math.max(f[y],v[y]),_[m]=Math.min(0,v[m]+h[1-p]),_}else return l.x=c[0],l.y=c[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(jt);function Fj(r,e,t,a,n,i,o){function s(g,y){g.lineWidth==="auto"&&(g.lineWidth=y.lineWidth>0?2:0),tm(g,function(m,_){g[_]==="inherit"&&(g[_]=y[_])})}var l=e.getModel("itemStyle"),u=l.getItemStyle(),f=r.lastIndexOf("empty",0)===0?"fill":"s
|
||
|
|
`||n==="")){var i=r.isSelected(n);tt(t,n)?t[n]=t[n]&&i:t[n]=i}}),t}function $j(r){r.registerAction("legendToggleSelect","legendselectchanged",mt(vl,"toggleSelected")),r.registerAction("legendAllSelect","legendselectall",mt(vl,"allSelect")),r.registerAction("legendInverseSelect","legendinverseselect",mt(vl,"inverseSelect")),r.registerAction("legendSelect","legendselected",mt(vl,"select")),r.registerAction("legendUnSelect","legendunselected",mt(vl,"unSelect"))}function UR(r){r.registerComponentModel(Qy),r.registerComponentView($R),r.registerProcessor(r.PRIORITY.PROCESSOR.SERIES_FILTER,Wj),r.registerSubTypeDefaulter("legend",function(){return"plain"}),$j(r)}var Uj=function(r){F(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.setScrollDataIndex=function(t){this.option.scrollDataIndex=t},e.prototype.init=function(t,a,n){var i=io(t);r.prototype.init.call(this,t,a,n),BC(this,t,i)},e.prototype.mergeOption=function(t,a){r.prototype.mergeOption.call(this,t,a),BC(this,this.option,t)},e.type="legend.scroll",e.defaultOption=Hn(Qy.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:G.color.accent50,pageIconInactiveColor:G.color.accent10,pageIconSize:15,pageTextStyle:{color:G.color.tertiary},animationDurationUpdate:800}),e}(Qy);function BC(r,e,t){var a=r.getOrient(),n=[1,1];n[a.index]=0,ba(e,t,{type:"box",ignoreSize:!!n})}const Yj=Uj;var NC=lt,Op=["width","height"],Bp=["x","y"],Zj=function(r){F(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.newlineDisabled=!0,t._currentIndex=0,t}return e.prototype.init=function(){r.prototype.init.call(this),this.group.add(this._containerGroup=new NC),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new NC)},e.prototype.resetInner=function(){r.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},e.prototype.renderInner=function(t,a,n,i,o,s,l){var u=this;r.prototype.renderInner.call(this,t,a,n,i,o,s,l);var f=this._controllerGroup,c=a.get("pageIconSize",!0),v=U(c)?c:[c,c];d("pagePrev",0);var h=a.getModel("pageTextStyle");f.add(new Lt({name:"pageText",style:{text:"xx/xx",fill:h.getTextColor(),font:h.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),d("pageNext",1);function d(p,g){var y=p+"DataIndex",m=bu(a.get("pageIcons",!0)[a.getOrient().name][g],{onclick:j(u._pageGo,u,y,a,i)},{x:-v[0]/2,y:-v[1]/2,width:v[0],height:v[1]});m.name=p,f.add(m)}},e.prototype.layoutInner=function(t,a,n,i,o,s){var l=this.getSelectorGroup(),u=t.getOrient().index,f=Op[u],c=Bp[u],v=Op[1-u],h=Bp[1-u];o&&Fi("horizontal",l,t.get("selectorItemGap",!0));var d=t.get("selectorButtonGap",!0),p=l.getBoundingRect(),g=[-p.x,-p.y],y=st(n);o&&(y[f]=n[f]-p[f]-d);var m=this._layoutContentAndController(t,i,y,u,f,v,h,c);if(o){if(s==="end")g[u]+=m[f]+d;else{var _=p[f]+d;g[u]-=_,m[c]-=_}m[f]+=p[f]+d,g[1-u]+=m[h]+m[v]/2-p[v]/2,m[v]=Math.max(m[v],p[v]),m[h]=Math.min(m[h],p[h]+g[1-u]),l.x=g[0],l.y=g[1],l.markRedraw()}return m},e.prototype._layoutContentAndController=function(t,a,n,i,o,s,l,u){var f=this.getContentGroup(),c=this._containerGroup,v=this._controllerGroup;Fi(t.get("orient"),f,t.get("itemGap"),i?n.width:null,i?null:n.height),Fi("horizontal",v,t.get("pageButtonItemGap",!0));var h=f.getBoundingRect(),d=v.getBoundingRect(),p=this._showController=h[o]>n[o],g=[-h.x,-h.y];a||(g[i]=f[u]);var y=[0,0],m=[-d.x,-d.y],_=it(t.get("pageButtonGap",!0),t.get("itemGap",!0));if(p){var S=t.get("pageButtonPosition",!0);S==="end"?m[i]+=n[o]-d[o]:y[i]+=d[o]+_}m[1-i]+=h[s]/2-d[s]/2,f.setPosition(g),c.setPosition(y),v.setPosition(m);var b={x:0,y:0};if(b[o]=p?n[o]:h[o],b[s]=Math.max(h[s],d[s]),b[l]=Math.min(0,d[l]+m[1-i]),c.__rectSize=n[o],p){var x={x:0,y:0};x[o]=Math.max(n[o]-d[o]-_,0),x[s]=b[s],c.setClipPath(new bt({shape:x}
|
||
|
|
<div style="font-weight: bold; margin-bottom: 4px;">${nt.name}</div>
|
||
|
|
<div style="color: #60A5FA;">تعداد افراد: <span style="color: #fff; font-weight: bold;">${nt.value.toLocaleString("fa-IR")}</span></div>
|
||
|
|
</div>`}},grid:{left:"5%",right:"5%",bottom:"10%",top:"10%",containLabel:!0},xAxis:{type:"category",data:O,boundaryGap:!1,axisLine:{lineStyle:{color:"#E5E7EB",width:1}},axisTick:{show:!1},axisLabel:{color:"#6B7280",fontSize:11,fontFamily:"iran-sans",rotate:t.value==="daily"?45:0,margin:12},splitLine:{show:!1}},yAxis:{type:"value",axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:"#6B7280",fontSize:11,fontFamily:"iran-sans",formatter:Q=>Math.round(Q).toLocaleString("fa-IR")},minInterval:1,scale:!1,splitLine:{lineStyle:{color:"#F3F4F6",type:"dashed",width:1}}},series:[{name:"تعداد افراد",type:"line",smooth:!0,symbol:"circle",symbolSize:6,showSymbol:!1,data:N,areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(37, 99, 235, 0.4)"},{offset:1,color:"rgba(37, 99, 235, 0.05)"}]}},lineStyle:{width:3,color:{type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#3B82F6"},{offset:1,color:"#60A5FA"}]},shadowColor:"rgba(37, 99, 235, 0.5)",shadowBlur:10,shadowOffsetY:5},itemStyle:{color:"#3B82F6",borderColor:"#fff",borderWidth:2,shadowBlur:8,shadowColor:"rgba(37, 99, 235, 0.5)"},emphasis:{focus:"series",itemStyle:{color:"#2563EB",borderColor:"#fff",borderWidth:3,shadowBlur:12,shadowColor:"rgba(37, 99, 235, 0.8)"}},animation:!0,animationDuration:1e3,animationEasing:"cubicOut"}]};return H.setOption(Z,!0),H},I=(O,N,z,$)=>{if(!z)return console.warn("Chart container is not available for user chart"),$;let H=$;H||(H=yd(z));const Z={backgroundColor:"transparent",tooltip:{trigger:"axis",backgroundColor:"rgba(0, 0, 0, 0.8)",borderColor:"#F97316",borderWidth:1,textStyle:{color:"#fff",fontSize:12,fontFamily:"iran-sans"},axisPointer:{type:"line",lineStyle:{color:"#F97316",width:1,type:"dashed"},shadowStyle:{color:"rgba(249, 115, 22, 0.1)"}},formatter:Q=>{const nt=Q[0];return`<div style="padding: 8px;">
|
||
|
|
<div style="font-weight: bold; margin-bottom: 4px;">${nt.name}</div>
|
||
|
|
<div style="color: #FB923C;">تعداد کاربران: <span style="color: #fff; font-weight: bold;">${nt.value.toLocaleString("fa-IR")}</span></div>
|
||
|
|
</div>`}},grid:{left:"5%",right:"5%",bottom:"10%",top:"10%",containLabel:!0},xAxis:{type:"category",data:O,boundaryGap:!1,axisLine:{lineStyle:{color:"#E5E7EB",width:1}},axisTick:{show:!1},axisLabel:{color:"#6B7280",fontSize:11,fontFamily:"iran-sans",rotate:a.value==="daily"?45:0,margin:12},splitLine:{show:!1}},yAxis:{type:"value",axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:"#6B7280",fontSize:11,fontFamily:"iran-sans",formatter:Q=>Math.round(Q).toLocaleString("fa-IR")},minInterval:1,scale:!1,splitLine:{lineStyle:{color:"#F3F4F6",type:"dashed",width:1}}},series:[{name:"تعداد کاربران",type:"line",smooth:!0,symbol:"circle",symbolSize:6,showSymbol:!1,data:N,areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(249, 115, 22, 0.4)"},{offset:1,color:"rgba(249, 115, 22, 0.05)"}]}},lineStyle:{width:3,color:{type:"linear",x:0,y:0,x2:1,y2:0,colorStops:[{offset:0,color:"#F97316"},{offset:1,color:"#FB923C"}]},shadowColor:"rgba(249, 115, 22, 0.5)",shadowBlur:10,shadowOffsetY:5},itemStyle:{color:"#F97316",borderColor:"#fff",borderWidth:2,shadowBlur:8,shadowColor:"rgba(249, 115, 22, 0.5)"},emphasis:{focus:"series",itemStyle:{color:"#EA580C",borderColor:"#fff",borderWidth:3,shadowBlur:12,shadowColor:"rgba(249, 115, 22, 0.8)"}},animation:!0,animationDuration:1e3,animationEasing:"cubicOut"}]};return H.setOption(Z,!0),H},L=(O,N,z,$,H)=>{if(!$)return console.warn("Chart container is null"),null;let Z=H;Z||(Z=yd($));const Q={backgroundColor:"transparent",tooltip:{trigger:"axis",backgroundColor:"rgba(0, 0, 0, 0.8)",borderColor:"#2563EB",borderWidth:1,textStyle:{color:"#fff",fontSize:12,fontFamily:"iran-sans"},axisPointer:{type:"line",lineStyle:{color:"#2563EB",width:1,type:"dashed"},shadowStyle:{color:"rgba(37, 99, 235, 0.1)"}},formatter:nt=>{let J=`<div style="padding: 8px;">
|
||
|
|
<div style="font-weight: bold; margin-bottom: 4px;">${nt[0].name}</div>`;return nt.forEach(X=>{J+=`<div style="color: ${X.color}; margin-top: 4px;">
|
||
|
|
${X.seriesName}: <span style="color: #fff; font-weight: bold;">${X.value.toLocaleString("fa-IR")}</span>
|
||
|
|
</div>`}),J+="</div>",J}},legend:{data:["همه شرکت کنندگان","واجدین شرایط"],top:10,right:10,textStyle:{color:"#6B7280",fontSize:12,fontFamily:"iran-sans"}},grid:{left:"5%",right:"5%",bottom:"10%",top:"15%",containLabel:!0},xAxis:{type:"category",data:O,boundaryGap:!1,axisLine:{lineStyle:{color:"#E5E7EB",width:1}},axisTick:{show:!1},axisLabel:{color:"#6B7280",fontSize:11,fontFamily:"iran-sans",rotate:n.value==="daily"?45:0,margin:12},splitLine:{show:!1}},yAxis:{type:"value",axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:"#6B7280",fontSize:11,fontFamily:"iran-sans",formatter:nt=>Math.round(nt).toLocaleString("fa-IR")},minInterval:1,scale:!1,splitLine:{lineStyle:{color:"#F3F4F6",type:"dashed",width:1}}},series:[{name:"همه شرکت کنندگان",type:"line",smooth:!0,symbol:"circle",symbolSize:6,showSymbol:!1,data:N,areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(239, 68, 68, 0.4)"},{offset:1,color:"rgba(239, 68, 68, 0.05)"}]}},lineStyle:{width:3,color:"#EF4444"},itemStyle:{color:"#EF4444",borderColor:"#fff",borderWidth:2}},{name:"واجدین شرایط",type:"line",smooth:!0,symbol:"circle",symbolSize:6,showSymbol:!1,data:z,areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(34, 197, 94, 0.4)"},{offset:1,color:"rgba(34, 197, 94, 0.05)"}]}},lineStyle:{width:3,color:"#22C55E"},itemStyle:{color:"#22C55E",borderColor:"#fff",borderWidth:2}}]};return Z.setOption(Q,!0),Z},P=async()=>{try{const[O,N,z,$,H,Z,Q,nt,J,X,ht,rt,pt,Bt]=await Promise.allSettled([Ik(),Nk(),Bk(),zk(),Uk(),Pk(),Rk(),kk(),Ek(),Ok(10),Gk(),Fk(),Hk(),Wk()]);O.status==="fulfilled"?(s.value.count_sale_order=O.value.total,s.value.new_customer=O.value.today):(console.error("Error fetching users stats:",O.reason),s.value.count_sale_order=0,s.value.new_customer=0),N.status==="fulfilled"?(s.value.count_order=N.value,s.value.active_users_week=N.value):(console.error("Error fetching active users this week:",N.reason),s.value.count_order=0,s.value.active_users_week=0),z.status==="fulfilled"?s.value.total_sale=String(z.value):(console.error("Error fetching active users this month:",z.reason),s.value.total_sale="0"),$.status==="fulfilled"?m.value=$.value||[]:(console.error("Error fetching latest users:",$.reason),m.value=[]),H.status==="fulfilled"?y.value=H.value||[]:(console.error("Error fetching latest lottery winners:",H.reason),y.value=[]),Z.status==="fulfilled"?s.value.total_story_views=Z.value:(console.error("Error fetching total story views:",Z.reason),s.value.total_story_views=0),Q.status==="fulfilled"?s.value.today_total_story_views=Q.value:(console.error("Error fetching today total story views:",Q.reason),s.value.today_total_story_views=0),nt.status==="fulfilled"?s.value.unique_story_viewers=nt.value:(console.error("Error fetching unique story viewers:",nt.reason),s.value.unique_story_viewers=0),J.status==="fulfilled"?s.value.latest_story_views=J.value:(console.error("Error fetching latest story views:",J.reason),s.value.latest_story_views=0),X.status==="fulfilled"?_.value=X.value||[]:(console.error("Error fetching story views stats:",X.reason),_.value=[]),ht.status==="fulfilled"?s.value.total_competition_participants=ht.value:(console.error("Error fetching total competition participants:",ht.reason),s.value.total_competition_participants=0),rt.status==="fulfilled"?s.value.eligible_competition_participants=rt.value:(console.error("Error fetching eligible competition participants:",rt.reason),s.value.eligible_competition_participants=0),pt.status==="fulfilled"?s.value.latest_competition_participants=pt.value:(console.error("Error fetching latest competition participants:",pt.reason),s.value.latest_competition_participants=0),Bt.status==="fulfilled"?s.value.latest_competition_eligible_participants=Bt.value:(console.error("Error fetching latest competition eligible participants:",Bt.reason),s.value.latest_competition_eligible_participants=0)}catch(O){console.error("Error in getDashboardReport:",O)}if(!e.value)try{const O=await Dk();s.value={...s.value,.
|