You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
250 KiB
1 lines
250 KiB
import{aS as e,aT as t,aM as i,aU as o,aV as a,$ as n,a1 as r,aW as s,aA as l,aX as c,aY as h,aZ as d,a_ as u,s as p,af as g,a$ as f,b0 as x,b1 as y,ar as m,n as v,b2 as b,am as S,b3 as w,b4 as T,b5 as A,b6 as _,b7 as P,o as C,c as k,w as D,d as L,i as I,an as M,m as F,e as O,t as E,b8 as R,b9 as N,at as z,ba as B,bb as U,b as W,bc as j,P as q,bd as $,be as H}from"./index-IX2tYR8R.js";import{_ as G}from"./_plugin-vue_export-helper.BCo6x5W8.js";import{r as J}from"./uni-app.es.Bc5t55A8.js";const K={pages:[{path:"pages/index/index",style:{navigationBarTitleText:"",enablePullDownRefresh:!0,navigationStyle:"custom"}},{path:"pages/index/comp/city",style:{navigationBarTitleText:"选择城市",enablePullDownRefresh:!1}}],subPackages:[{root:"pages/vip",pages:[{path:"vipEntry/vipEntry",style:{navigationBarTitleText:"vip",enablePullDownRefresh:!0,navigationStyle:"custom"}},{path:"paymentOrder/paymentOrder",style:{navigationBarTitleText:"vip",enablePullDownRefresh:!0,navigationStyle:"custom"}},{path:"vipQuestions/vipQuestions",style:{navigationBarTitleText:"VIP常见问题说明",enablePullDownRefresh:!1,backgroundTextStyle:"dark"}}]},{root:"pages/exercises",pages:[{path:"chapter/chapter",style:{navigationBarTitleText:"章节练习",enablePullDownRefresh:!1,backgroundTextStyle:"dark"}},{path:"webView/webView",style:{navigationBarTitleText:"",enablePullDownRefresh:!1,backgroundTextStyle:"dark"}},{path:"brushQuestions/brushQuestions",style:{navigationBarTitleText:"刷题",enablePullDownRefresh:!1,backgroundTextStyle:"dark",navigationStyle:"custom"}},{path:"brushQuestions/examQuestions",style:{navigationBarTitleText:"模拟考试",enablePullDownRefresh:!1,backgroundTextStyle:"dark",navigationStyle:"custom"}},{path:"brushQuestions/wrongQuestions",style:{navigationBarTitleText:"刷错题",enablePullDownRefresh:!1,backgroundTextStyle:"dark",navigationStyle:"custom"}},{path:"exam/exam",style:{navigationBarTitleText:"考试",enablePullDownRefresh:!1,backgroundTextStyle:"dark",navigationStyle:"custom"}},{path:"examIntroduction/examIntroduction",style:{navigationBarTitleText:"考试简介",enablePullDownRefresh:!1,backgroundTextStyle:"dark",navigationStyle:"custom"}},{path:"beforeExam/beforeExam",style:{navigationBarTitleText:"考试须知",enablePullDownRefresh:!1,backgroundTextStyle:"dark",navigationStyle:"custom"}},{path:"examResults/examResults",style:{navigationBarTitleText:"模拟考试成绩",enablePullDownRefresh:!1,backgroundTextStyle:"dark",navigationStyle:"custom"}},{path:"wrongQuestion/wrongQuestion",style:{navigationBarTitleText:"模拟考试成绩",enablePullDownRefresh:!1,backgroundTextStyle:"dark",navigationStyle:"custom"}},{path:"theoryStudy/theoryStudy",style:{navigationBarTitleText:"理论学习",enablePullDownRefresh:!0,backgroundTextStyle:"dark",navigationStyle:"custom"}},{path:"categoryExercises/categoryExercises",style:{navigationBarTitleText:"分类练习",enablePullDownRefresh:!1,backgroundTextStyle:"dark"}},{path:"queTypeExercises/queTypeExercises",style:{navigationBarTitleText:"题型练习",enablePullDownRefresh:!1,backgroundTextStyle:"dark"}},{path:"myStudy/myStudy",style:{navigationBarTitleText:"我的学习",enablePullDownRefresh:!1,backgroundTextStyle:"dark",navigationStyle:"custom"}},{path:"lastPage/lastPage",style:{navigationBarTitleText:"顺序练习成绩",enablePullDownRefresh:!1,backgroundTextStyle:"dark",navigationStyle:"custom"}},{path:"examSubjiect1/examSubjiect1",style:{navigationBarTitleText:"科目一成绩单",enablePullDownRefresh:!1,backgroundTextStyle:"dark",navigationStyle:"custom"}},{path:"examSubjiect1/examResultsOne",style:{navigationBarTitleText:"模拟考试成绩",enablePullDownRefresh:!1,backgroundTextStyle:"dark",navigationStyle:"custom"}}]}],globalStyle:{navigationBarTextStyle:"black",navigationBarTitleText:"习题题库",navigationBarBackgroundColor:"#F8F8F8",backgroundColor:"#F8F8F8"},uniIdRouter:{},easycom:{autoscan:!0,custom:{"^u--(.*)":"@/uni_modules/uview-plus/components/u-$1/u-$1.vue","^up-(.*)":"@/uni_modules/uview-plus/components/u-$1/u-$1.vue","^u-([^-].*)":"@/uni_modules/uview-plus/components/u-$1/u-$1.vue"}}};function X(e,t,i){return e(i={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&i.path)}},i.exports),i.exports}var V=X((function(e,t){var i;e.exports=(i=i||function(e,t){var i=Object.create||function(){function e(){}return function(t){var i;return e.prototype=t,i=new e,e.prototype=null,i}}(),o={},a=o.lib={},n=a.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},r=a.WordArray=n.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,i=e.words,o=this.sigBytes,a=e.sigBytes;if(this.clamp(),o%4)for(var n=0;n<a;n++){var r=i[n>>>2]>>>24-n%4*8&255;t[o+n>>>2]|=r<<24-(o+n)%4*8}else for(n=0;n<a;n+=4)t[o+n>>>2]=i[n>>>2];return this.sigBytes+=a,this},clamp:function(){var t=this.words,i=this.sigBytes;t[i>>>2]&=4294967295<<32-i%4*8,t.length=e.ceil(i/4)},clone:function(){var e=n.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var i,o=[],a=function(t){var i=987654321,o=4294967295;return function(){var a=((i=36969*(65535&i)+(i>>16)&o)<<16)+(t=18e3*(65535&t)+(t>>16)&o)&o;return a/=4294967296,(a+=.5)*(e.random()>.5?1:-1)}},n=0;n<t;n+=4){var s=a(4294967296*(i||e.random()));i=987654071*s(),o.push(4294967296*s()|0)}return new r.init(o,t)}}),s=o.enc={},l=s.Hex={stringify:function(e){for(var t=e.words,i=e.sigBytes,o=[],a=0;a<i;a++){var n=t[a>>>2]>>>24-a%4*8&255;o.push((n>>>4).toString(16)),o.push((15&n).toString(16))}return o.join("")},parse:function(e){for(var t=e.length,i=[],o=0;o<t;o+=2)i[o>>>3]|=parseInt(e.substr(o,2),16)<<24-o%8*4;return new r.init(i,t/2)}},c=s.Latin1={stringify:function(e){for(var t=e.words,i=e.sigBytes,o=[],a=0;a<i;a++){var n=t[a>>>2]>>>24-a%4*8&255;o.push(String.fromCharCode(n))}return o.join("")},parse:function(e){for(var t=e.length,i=[],o=0;o<t;o++)i[o>>>2]|=(255&e.charCodeAt(o))<<24-o%4*8;return new r.init(i,t)}},h=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(c.stringify(e)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(e){return c.parse(unescape(encodeURIComponent(e)))}},d=a.BufferedBlockAlgorithm=n.extend({reset:function(){this._data=new r.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=h.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var i=this._data,o=i.words,a=i.sigBytes,n=this.blockSize,s=a/(4*n),l=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*n,c=e.min(4*l,a);if(l){for(var h=0;h<l;h+=n)this._doProcessBlock(o,h);var d=o.splice(0,l);i.sigBytes-=c}return new r.init(d,c)},clone:function(){var e=n.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});a.Hasher=d.extend({cfg:n.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,i){return new e.init(i).finalize(t)}},_createHmacHelper:function(e){return function(t,i){return new u.HMAC.init(e,i).finalize(t)}}});var u=o.algo={};return o}(Math),i)})),Y=V,Q=(X((function(e,t){var i;e.exports=(i=Y,function(e){var t=i,o=t.lib,a=o.WordArray,n=o.Hasher,r=t.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var l=r.MD5=n.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var i=0;i<16;i++){var o=t+i,a=e[o];e[o]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}var n=this._hash.words,r=e[t+0],l=e[t+1],p=e[t+2],g=e[t+3],f=e[t+4],x=e[t+5],y=e[t+6],m=e[t+7],v=e[t+8],b=e[t+9],S=e[t+10],w=e[t+11],T=e[t+12],A=e[t+13],_=e[t+14],P=e[t+15],C=n[0],k=n[1],D=n[2],L=n[3];C=c(C,k,D,L,r,7,s[0]),L=c(L,C,k,D,l,12,s[1]),D=c(D,L,C,k,p,17,s[2]),k=c(k,D,L,C,g,22,s[3]),C=c(C,k,D,L,f,7,s[4]),L=c(L,C,k,D,x,12,s[5]),D=c(D,L,C,k,y,17,s[6]),k=c(k,D,L,C,m,22,s[7]),C=c(C,k,D,L,v,7,s[8]),L=c(L,C,k,D,b,12,s[9]),D=c(D,L,C,k,S,17,s[10]),k=c(k,D,L,C,w,22,s[11]),C=c(C,k,D,L,T,7,s[12]),L=c(L,C,k,D,A,12,s[13]),D=c(D,L,C,k,_,17,s[14]),C=h(C,k=c(k,D,L,C,P,22,s[15]),D,L,l,5,s[16]),L=h(L,C,k,D,y,9,s[17]),D=h(D,L,C,k,w,14,s[18]),k=h(k,D,L,C,r,20,s[19]),C=h(C,k,D,L,x,5,s[20]),L=h(L,C,k,D,S,9,s[21]),D=h(D,L,C,k,P,14,s[22]),k=h(k,D,L,C,f,20,s[23]),C=h(C,k,D,L,b,5,s[24]),L=h(L,C,k,D,_,9,s[25]),D=h(D,L,C,k,g,14,s[26]),k=h(k,D,L,C,v,20,s[27]),C=h(C,k,D,L,A,5,s[28]),L=h(L,C,k,D,p,9,s[29]),D=h(D,L,C,k,m,14,s[30]),C=d(C,k=h(k,D,L,C,T,20,s[31]),D,L,x,4,s[32]),L=d(L,C,k,D,v,11,s[33]),D=d(D,L,C,k,w,16,s[34]),k=d(k,D,L,C,_,23,s[35]),C=d(C,k,D,L,l,4,s[36]),L=d(L,C,k,D,f,11,s[37]),D=d(D,L,C,k,m,16,s[38]),k=d(k,D,L,C,S,23,s[39]),C=d(C,k,D,L,A,4,s[40]),L=d(L,C,k,D,r,11,s[41]),D=d(D,L,C,k,g,16,s[42]),k=d(k,D,L,C,y,23,s[43]),C=d(C,k,D,L,b,4,s[44]),L=d(L,C,k,D,T,11,s[45]),D=d(D,L,C,k,P,16,s[46]),C=u(C,k=d(k,D,L,C,p,23,s[47]),D,L,r,6,s[48]),L=u(L,C,k,D,m,10,s[49]),D=u(D,L,C,k,_,15,s[50]),k=u(k,D,L,C,x,21,s[51]),C=u(C,k,D,L,T,6,s[52]),L=u(L,C,k,D,g,10,s[53]),D=u(D,L,C,k,S,15,s[54]),k=u(k,D,L,C,l,21,s[55]),C=u(C,k,D,L,v,6,s[56]),L=u(L,C,k,D,P,10,s[57]),D=u(D,L,C,k,y,15,s[58]),k=u(k,D,L,C,A,21,s[59]),C=u(C,k,D,L,f,6,s[60]),L=u(L,C,k,D,w,10,s[61]),D=u(D,L,C,k,p,15,s[62]),k=u(k,D,L,C,b,21,s[63]),n[0]=n[0]+C|0,n[1]=n[1]+k|0,n[2]=n[2]+D|0,n[3]=n[3]+L|0},_doFinalize:function(){var t=this._data,i=t.words,o=8*this._nDataBytes,a=8*t.sigBytes;i[a>>>5]|=128<<24-a%32;var n=e.floor(o/4294967296),r=o;i[15+(a+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),i[14+(a+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(i.length+1),this._process();for(var s=this._hash,l=s.words,c=0;c<4;c++){var h=l[c];l[c]=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8)}return s},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});function c(e,t,i,o,a,n,r){var s=e+(t&i|~t&o)+a+r;return(s<<n|s>>>32-n)+t}function h(e,t,i,o,a,n,r){var s=e+(t&o|i&~o)+a+r;return(s<<n|s>>>32-n)+t}function d(e,t,i,o,a,n,r){var s=e+(t^i^o)+a+r;return(s<<n|s>>>32-n)+t}function u(e,t,i,o,a,n,r){var s=e+(i^(t|~o))+a+r;return(s<<n|s>>>32-n)+t}t.MD5=n._createHelper(l),t.HmacMD5=n._createHmacHelper(l)}(Math),i.MD5)})),X((function(e,t){var i,o,a;e.exports=(o=(i=Y).lib.Base,a=i.enc.Utf8,void(i.algo.HMAC=o.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=a.parse(t));var i=e.blockSize,o=4*i;t.sigBytes>o&&(t=e.finalize(t)),t.clamp();for(var n=this._oKey=t.clone(),r=this._iKey=t.clone(),s=n.words,l=r.words,c=0;c<i;c++)s[c]^=1549556828,l[c]^=909522486;n.sigBytes=r.sigBytes=o,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,i=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(i))}})))})),X((function(e,t){e.exports=Y.HmacMD5}))),Z=X((function(e,t){e.exports=Y.enc.Utf8})),ee=X((function(e,t){var i,o,a;e.exports=(a=(o=i=Y).lib.WordArray,o.enc.Base64={stringify:function(e){var t=e.words,i=e.sigBytes,o=this._map;e.clamp();for(var a=[],n=0;n<i;n+=3)for(var r=(t[n>>>2]>>>24-n%4*8&255)<<16|(t[n+1>>>2]>>>24-(n+1)%4*8&255)<<8|t[n+2>>>2]>>>24-(n+2)%4*8&255,s=0;s<4&&n+.75*s<i;s++)a.push(o.charAt(r>>>6*(3-s)&63));var l=o.charAt(64);if(l)for(;a.length%4;)a.push(l);return a.join("")},parse:function(e){var t=e.length,i=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var n=0;n<i.length;n++)o[i.charCodeAt(n)]=n}var r=i.charAt(64);if(r){var s=e.indexOf(r);-1!==s&&(t=s)}return function(e,t,i){for(var o=[],n=0,r=0;r<t;r++)if(r%4){var s=i[e.charCodeAt(r-1)]<<r%4*2,l=i[e.charCodeAt(r)]>>>6-r%4*2;o[n>>>2]|=(s|l)<<24-n%4*8,n++}return a.create(o,n)}(e,t,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},i.enc.Base64)}));const te="FUNCTION",ie="pending",oe="rejected";function ae(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function ne(e){return"object"===ae(e)}function re(e){return"function"==typeof e}function se(e){return function(){try{return e.apply(e,arguments)}catch(t){console.error(t)}}}const le="REJECTED",ce="NOT_PENDING";class he{constructor({createPromise:e,retryRule:t=le}={}){this.createPromise=e,this.status=null,this.promise=null,this.retryRule=t}get needRetry(){if(!this.status)return!0;switch(this.retryRule){case le:return this.status===oe;case ce:return this.status!==ie}}exec(){return this.needRetry?(this.status=ie,this.promise=this.createPromise().then((e=>(this.status="fulfilled",Promise.resolve(e))),(e=>(this.status=oe,Promise.reject(e)))),this.promise):this.promise}}function de(e){return e&&"string"==typeof e?JSON.parse(e):e}const ue=de([]);de("");const pe=de("[]")||[];let ge="";try{ge="__UNI__445D057"}catch(it){}let fe={};function xe(e,t={}){var i,o;return i=fe,o=e,Object.prototype.hasOwnProperty.call(i,o)||(fe[e]=t),fe[e]}const ye=["invoke","success","fail","complete"],me=xe("_globalUniCloudInterceptor");function ve(e,t){me[e]||(me[e]={}),ne(t)&&Object.keys(t).forEach((i=>{ye.indexOf(i)>-1&&function(e,t,i){let o=me[e][t];o||(o=me[e][t]=[]),-1===o.indexOf(i)&&re(i)&&o.push(i)}(e,i,t[i])}))}function be(e,t){me[e]||(me[e]={}),ne(t)?Object.keys(t).forEach((i=>{ye.indexOf(i)>-1&&function(e,t,i){const o=me[e][t];if(!o)return;const a=o.indexOf(i);a>-1&&o.splice(a,1)}(e,i,t[i])})):delete me[e]}function Se(e,t){return e&&0!==e.length?e.reduce(((e,i)=>e.then((()=>i(t)))),Promise.resolve()):Promise.resolve()}function we(e,t){return me[e]&&me[e][t]||[]}function Te(e){ve("callObject",e)}const Ae=xe("_globalUniCloudListener"),_e="response",Pe="needLogin",Ce="refreshToken",ke="clientdb",De="cloudfunction",Le="cloudobject";function Ie(e){return Ae[e]||(Ae[e]=[]),Ae[e]}function Me(e,t){const i=Ie(e);i.includes(t)||i.push(t)}function Fe(e,t){const i=Ie(e),o=i.indexOf(t);-1!==o&&i.splice(o,1)}function Oe(e,t){const i=Ie(e);for(let o=0;o<i.length;o++)(0,i[o])(t)}let Ee,Re=!1;function Ne(){return Ee||(Ee=new Promise((e=>{Re&&e(),function t(){if("function"==typeof i){const t=i();t&&t[0]&&(Re=!0,e())}Re||setTimeout((()=>{t()}),30)}()})),Ee)}function ze(e){const t={};for(const i in e){const o=e[i];re(o)&&(t[i]=se(o))}return t}class Be extends Error{constructor(e){super(e.message),this.errMsg=e.message||e.errMsg||"unknown system error",this.code=this.errCode=e.code||e.errCode||"SYSTEM_ERROR",this.errSubject=this.subject=e.subject||e.errSubject,this.cause=e.cause,this.requestId=e.requestId}toJson(e=0){if(!(e>=10))return e++,{errCode:this.errCode,errMsg:this.errMsg,errSubject:this.errSubject,cause:this.cause&&this.cause.toJson?this.cause.toJson(e):this.cause}}}var Ue={request:e=>d(e),uploadFile:e=>u(e),setStorageSync:(e,t)=>p(e,t),getStorageSync:e=>g(e),removeStorageSync:e=>f(e),clearStorageSync:()=>x(),connectSocket:e=>y(e)};function We(e){return e&&We(e.__v_raw)||e}function je(){return{token:Ue.getStorageSync("uni_id_token")||Ue.getStorageSync("uniIdToken"),tokenExpired:Ue.getStorageSync("uni_id_token_expired")}}function qe({token:e,tokenExpired:t}={}){e&&Ue.setStorageSync("uni_id_token",e),t&&Ue.setStorageSync("uni_id_token_expired",t)}let $e,He;function Ge(){return $e||($e=m()),$e}function Je(){let e,t;try{if(P){if(P.toString().indexOf("not yet implemented")>-1)return;const{scene:i,channel:o}=P();e=o,t=i}}catch(i){}return{channel:e,scene:t}}let Ke={};function Xe(){const e=_&&_()||"en";if(He)return{...Ke,...He,locale:e,LOCALE:e};const t=Ge(),{deviceId:i,osName:o,uniPlatform:a,appId:n}=t,r=["appId","appLanguage","appName","appVersion","appVersionCode","appWgtVersion","browserName","browserVersion","deviceBrand","deviceId","deviceModel","deviceType","osName","osVersion","romName","romVersion","ua","hostName","hostVersion","uniPlatform","uniRuntimeVersion","uniRuntimeVersionCode","uniCompilerVersion","uniCompilerVersionCode"];for(const s in t)Object.hasOwnProperty.call(t,s)&&-1===r.indexOf(s)&&delete t[s];return He={PLATFORM:a,OS:o,APPID:n,DEVICEID:i,...Je(),...t},{...Ke,...He,locale:e,LOCALE:e}}var Ve=function(e,t){let i="";return Object.keys(e).sort().forEach((function(t){e[t]&&(i=i+"&"+t+"="+e[t])})),i=i.slice(1),Q(i,t).toString()},Ye=function(e,t){return new Promise(((i,o)=>{t(Object.assign(e,{complete(e){e||(e={});const t=e.data&&e.data.header&&e.data.header["x-serverless-request-id"]||e.header&&e.header["request-id"];if(!e.statusCode||e.statusCode>=400){const i=e.data&&e.data.error&&e.data.error.code||"SYS_ERR",a=e.data&&e.data.error&&e.data.error.message||e.errMsg||"request:fail";return o(new Be({code:i,message:a,requestId:t}))}const a=e.data;if(a.error)return o(new Be({code:a.error.code,message:a.error.message,requestId:t}));a.result=a.data,a.requestId=t,delete a.data,i(a)}}))}))},Qe=function(e){return ee.stringify(Z.parse(e))},Ze={init(e){const t=new class{constructor(e){["spaceId","clientSecret"].forEach((t=>{if(!Object.prototype.hasOwnProperty.call(e,t))throw new Error(`${t} required`)})),this.config=Object.assign({},{endpoint:0===e.spaceId.indexOf("mp-")?"https://api.next.bspapp.com":"https://api.bspapp.com"},e),this.config.provider="aliyun",this.config.requestUrl=this.config.endpoint+"/client",this.config.envType=this.config.envType||"public",this.config.accessTokenKey="access_token_"+this.config.spaceId,this.adapter=Ue,this._getAccessTokenPromiseHub=new he({createPromise:()=>this.requestAuth(this.setupRequest({method:"serverless.auth.user.anonymousAuthorize",params:"{}"},"auth")).then((e=>{if(!e.result||!e.result.accessToken)throw new Be({code:"AUTH_FAILED",message:"获取accessToken失败"});this.setAccessToken(e.result.accessToken)})),retryRule:ce})}get hasAccessToken(){return!!this.accessToken}setAccessToken(e){this.accessToken=e}requestWrapped(e){return Ye(e,this.adapter.request)}requestAuth(e){return this.requestWrapped(e)}request(e,t){return Promise.resolve().then((()=>this.hasAccessToken?t?this.requestWrapped(e):this.requestWrapped(e).catch((t=>new Promise(((e,i)=>{!t||"GATEWAY_INVALID_TOKEN"!==t.code&&"InvalidParameter.InvalidToken"!==t.code?i(t):e()})).then((()=>this.getAccessToken())).then((()=>{const t=this.rebuildRequest(e);return this.request(t,!0)})))):this.getAccessToken().then((()=>{const t=this.rebuildRequest(e);return this.request(t,!0)}))))}rebuildRequest(e){const t=Object.assign({},e);return t.data.token=this.accessToken,t.header["x-basement-token"]=this.accessToken,t.header["x-serverless-sign"]=Ve(t.data,this.config.clientSecret),t}setupRequest(e,t){const i=Object.assign({},e,{spaceId:this.config.spaceId,timestamp:Date.now()}),o={"Content-Type":"application/json"};return"auth"!==t&&(i.token=this.accessToken,o["x-basement-token"]=this.accessToken),o["x-serverless-sign"]=Ve(i,this.config.clientSecret),{url:this.config.requestUrl,method:"POST",data:i,dataType:"json",header:o}}getAccessToken(){return this._getAccessTokenPromiseHub.exec()}async authorize(){await this.getAccessToken()}callFunction(e){const t={method:"serverless.function.runtime.invoke",params:JSON.stringify({functionTarget:e.name,functionArgs:e.data||{}})};return this.request({...this.setupRequest(t),timeout:e.timeout})}getOSSUploadOptionsFromPath(e){const t={method:"serverless.file.resource.generateProximalSign",params:JSON.stringify(e)};return this.request(this.setupRequest(t))}uploadFileToOSS({url:e,formData:t,name:i,filePath:o,fileType:a,onUploadProgress:n}){return new Promise(((r,s)=>{const l=this.adapter.uploadFile({url:e,formData:t,name:i,filePath:o,fileType:a,header:{"X-OSS-server-side-encrpytion":"AES256"},success(e){e&&e.statusCode<400?r(e):s(new Be({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(e){s(new Be({code:e.code||"UPLOAD_FAILED",message:e.message||e.errMsg||"文件上传失败"}))}});"function"==typeof n&&l&&"function"==typeof l.onProgressUpdate&&l.onProgressUpdate((e=>{n({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend})}))}))}reportOSSUpload(e){const t={method:"serverless.file.resource.report",params:JSON.stringify(e)};return this.request(this.setupRequest(t))}async uploadFile({filePath:e,cloudPath:t,fileType:i="image",cloudPathAsRealPath:o=!1,onUploadProgress:a,config:n}){if("string"!==ae(t))throw new Be({code:"INVALID_PARAM",message:"cloudPath必须为字符串类型"});if(!(t=t.trim()))throw new Be({code:"INVALID_PARAM",message:"cloudPath不可为空"});if(/:\/\//.test(t))throw new Be({code:"INVALID_PARAM",message:"cloudPath不合法"});const r=n&&n.envType||this.config.envType;if(o&&("/"!==t[0]&&(t="/"+t),t.indexOf("\\")>-1))throw new Be({code:"INVALID_PARAM",message:"使用cloudPath作为路径时,cloudPath不可包含“\\”"});const s=(await this.getOSSUploadOptionsFromPath({env:r,filename:o?t.split("/").pop():t,fileId:o?t:void 0})).result,l="https://"+s.cdnDomain+"/"+s.ossPath,{securityToken:c,accessKeyId:h,signature:d,host:u,ossPath:p,id:g,policy:f,ossCallbackUrl:x}=s,y={"Cache-Control":"max-age=2592000","Content-Disposition":"attachment",OSSAccessKeyId:h,Signature:d,host:u,id:g,key:p,policy:f,success_action_status:200};if(c&&(y["x-oss-security-token"]=c),x){const e=JSON.stringify({callbackUrl:x,callbackBody:JSON.stringify({fileId:g,spaceId:this.config.spaceId}),callbackBodyType:"application/json"});y.callback=Qe(e)}const m={url:"https://"+s.host,formData:y,fileName:"file",name:"file",filePath:e,fileType:i};if(await this.uploadFileToOSS(Object.assign({},m,{onUploadProgress:a})),x)return{success:!0,filePath:e,fileID:l};if((await this.reportOSSUpload({id:g})).success)return{success:!0,filePath:e,fileID:l};throw new Be({code:"UPLOAD_FAILED",message:"文件上传失败"})}getTempFileURL({fileList:e}={}){return new Promise(((t,i)=>{Array.isArray(e)&&0!==e.length||i(new Be({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"})),t({fileList:e.map((e=>({fileID:e,tempFileURL:e})))})}))}async getFileInfo({fileList:e}={}){if(!Array.isArray(e)||0===e.length)throw new Be({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"});const t={method:"serverless.file.resource.info",params:JSON.stringify({id:e.map((e=>e.split("?")[0])).join(",")})};return{fileList:(await this.request(this.setupRequest(t))).result}}}(e),i={signInAnonymously:function(){return t.authorize()},getLoginState:function(){return Promise.resolve(!1)}};return t.auth=function(){return i},t.customAuth=t.auth,t}};const et="undefined"!=typeof location&&"http:"===location.protocol?"http:":"https:";var tt,it;(it=tt||(tt={})).local="local",it.none="none",it.session="session";var ot=function(){},at=X((function(e,t){var i;e.exports=(i=Y,function(e){var t=i,o=t.lib,a=o.WordArray,n=o.Hasher,r=t.algo,s=[],l=[];!function(){function t(t){for(var i=e.sqrt(t),o=2;o<=i;o++)if(!(t%o))return!1;return!0}function i(e){return 4294967296*(e-(0|e))|0}for(var o=2,a=0;a<64;)t(o)&&(a<8&&(s[a]=i(e.pow(o,.5))),l[a]=i(e.pow(o,1/3)),a++),o++}();var c=[],h=r.SHA256=n.extend({_doReset:function(){this._hash=new a.init(s.slice(0))},_doProcessBlock:function(e,t){for(var i=this._hash.words,o=i[0],a=i[1],n=i[2],r=i[3],s=i[4],h=i[5],d=i[6],u=i[7],p=0;p<64;p++){if(p<16)c[p]=0|e[t+p];else{var g=c[p-15],f=(g<<25|g>>>7)^(g<<14|g>>>18)^g>>>3,x=c[p-2],y=(x<<15|x>>>17)^(x<<13|x>>>19)^x>>>10;c[p]=f+c[p-7]+y+c[p-16]}var m=o&a^o&n^a&n,v=(o<<30|o>>>2)^(o<<19|o>>>13)^(o<<10|o>>>22),b=u+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&h^~s&d)+l[p]+c[p];u=d,d=h,h=s,s=r+b|0,r=n,n=a,a=o,o=b+(v+m)|0}i[0]=i[0]+o|0,i[1]=i[1]+a|0,i[2]=i[2]+n|0,i[3]=i[3]+r|0,i[4]=i[4]+s|0,i[5]=i[5]+h|0,i[6]=i[6]+d|0,i[7]=i[7]+u|0},_doFinalize:function(){var t=this._data,i=t.words,o=8*this._nDataBytes,a=8*t.sigBytes;return i[a>>>5]|=128<<24-a%32,i[14+(a+64>>>9<<4)]=e.floor(o/4294967296),i[15+(a+64>>>9<<4)]=o,t.sigBytes=4*i.length,this._process(),this._hash},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=n._createHelper(h),t.HmacSHA256=n._createHmacHelper(h)}(Math),i.SHA256)})),nt=at,rt=X((function(e,t){e.exports=Y.HmacSHA256}));const st=()=>{let e;if(!Promise){e=()=>{},e.promise={};const t=()=>{throw new Be({message:'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.'})};return Object.defineProperty(e.promise,"then",{get:t}),Object.defineProperty(e.promise,"catch",{get:t}),e}const t=new Promise(((t,i)=>{e=(e,o)=>e?i(e):t(o)}));return e.promise=t,e};function lt(e){return void 0===e}function ct(e){return"[object Null]"===Object.prototype.toString.call(e)}var ht;!function(e){e.WEB="web",e.WX_MP="wx_mp"}(ht||(ht={}));const dt={adapter:null,runtime:void 0},ut=["anonymousUuidKey"];class pt extends ot{constructor(){super(),dt.adapter.root.tcbObject||(dt.adapter.root.tcbObject={})}setItem(e,t){dt.adapter.root.tcbObject[e]=t}getItem(e){return dt.adapter.root.tcbObject[e]}removeItem(e){delete dt.adapter.root.tcbObject[e]}clear(){delete dt.adapter.root.tcbObject}}function gt(e,t){switch(e){case"local":return t.localStorage||new pt;case"none":return new pt;default:return t.sessionStorage||new pt}}class ft{constructor(e){if(!this._storage){this._persistence=dt.adapter.primaryStorage||e.persistence,this._storage=gt(this._persistence,dt.adapter);const t=`access_token_${e.env}`,i=`access_token_expire_${e.env}`,o=`refresh_token_${e.env}`,a=`anonymous_uuid_${e.env}`,n=`login_type_${e.env}`,r=`user_info_${e.env}`;this.keys={accessTokenKey:t,accessTokenExpireKey:i,refreshTokenKey:o,anonymousUuidKey:a,loginTypeKey:n,userInfoKey:r}}}updatePersistence(e){if(e===this._persistence)return;const t="local"===this._persistence;this._persistence=e;const i=gt(e,dt.adapter);for(const o in this.keys){const e=this.keys[o];if(t&&ut.includes(o))continue;const a=this._storage.getItem(e);lt(a)||ct(a)||(i.setItem(e,a),this._storage.removeItem(e))}this._storage=i}setStore(e,t,i){if(!this._storage)return;const o={version:i||"localCachev1",content:t},a=JSON.stringify(o);try{this._storage.setItem(e,a)}catch(n){throw n}}getStore(e,t){try{if(!this._storage)return}catch(o){return""}t=t||"localCachev1";const i=this._storage.getItem(e);return i&&i.indexOf(t)>=0?JSON.parse(i).content:""}removeStore(e){this._storage.removeItem(e)}}const xt={},yt={};function mt(e){return xt[e]}class vt{constructor(e,t){this.data=t||null,this.name=e}}class bt extends vt{constructor(e,t){super("error",{error:e,data:t}),this.error=e}}const St=new class{constructor(){this._listeners={}}on(e,t){return i=e,o=t,(a=this._listeners)[i]=a[i]||[],a[i].push(o),this;var i,o,a}off(e,t){return function(e,t,i){if(i&&i[e]){const o=i[e].indexOf(t);-1!==o&&i[e].splice(o,1)}}(e,t,this._listeners),this}fire(e,t){if(e instanceof bt)return console.error(e.error),this;const i="string"==typeof e?new vt(e,t||{}):e,o=i.name;if(this._listens(o)){i.target=this;const e=this._listeners[o]?[...this._listeners[o]]:[];for(const t of e)t.call(this,i)}return this}_listens(e){return this._listeners[e]&&this._listeners[e].length>0}};function wt(e,t){St.on(e,t)}function Tt(e,t={}){St.fire(e,t)}function At(e,t){St.off(e,t)}const _t="loginStateChanged",Pt="loginStateExpire",Ct="loginTypeChanged",kt="anonymousConverted",Dt="refreshAccessToken";var Lt;!function(e){e.ANONYMOUS="ANONYMOUS",e.WECHAT="WECHAT",e.WECHAT_PUBLIC="WECHAT-PUBLIC",e.WECHAT_OPEN="WECHAT-OPEN",e.CUSTOM="CUSTOM",e.EMAIL="EMAIL",e.USERNAME="USERNAME",e.NULL="NULL"}(Lt||(Lt={}));const It=["auth.getJwt","auth.logout","auth.signInWithTicket","auth.signInAnonymously","auth.signIn","auth.fetchAccessTokenWithRefreshToken","auth.signUpWithEmailAndPassword","auth.activateEndUserMail","auth.sendPasswordResetEmail","auth.resetPasswordWithToken","auth.isUsernameRegistered"],Mt={"X-SDK-Version":"1.3.5"};function Ft(e,t,i){const o=e[t];e[t]=function(t){const a={},n={};i.forEach((i=>{const{data:o,headers:r}=i.call(e,t);Object.assign(a,o),Object.assign(n,r)}));const r=t.data;return r&&(()=>{var e;if(e=r,"[object FormData]"!==Object.prototype.toString.call(e))t.data={...r,...a};else for(const t in a)r.append(t,a[t])})(),t.headers={...t.headers||{},...n},o.call(e,t)}}function Ot(){const e=Math.random().toString(16).slice(2);return{data:{seqId:e},headers:{...Mt,"x-seqid":e}}}class Et{constructor(e={}){var t;this.config=e,this._reqClass=new dt.adapter.reqClass({timeout:this.config.timeout,timeoutMsg:`请求在${this.config.timeout/1e3}s内未完成,已中断`,restrictedMethods:["post"]}),this._cache=mt(this.config.env),this._localCache=(t=this.config.env,yt[t]),Ft(this._reqClass,"post",[Ot]),Ft(this._reqClass,"upload",[Ot]),Ft(this._reqClass,"download",[Ot])}async post(e){return await this._reqClass.post(e)}async upload(e){return await this._reqClass.upload(e)}async download(e){return await this._reqClass.download(e)}async refreshAccessToken(){let e,t;this._refreshAccessTokenPromise||(this._refreshAccessTokenPromise=this._refreshAccessToken());try{e=await this._refreshAccessTokenPromise}catch(i){t=i}if(this._refreshAccessTokenPromise=null,this._shouldRefreshAccessTokenHook=null,t)throw t;return e}async _refreshAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t,refreshTokenKey:i,loginTypeKey:o,anonymousUuidKey:a}=this._cache.keys;this._cache.removeStore(e),this._cache.removeStore(t);let n=this._cache.getStore(i);if(!n)throw new Be({message:"未登录CloudBase"});const r={refresh_token:n},s=await this.request("auth.fetchAccessTokenWithRefreshToken",r);if(s.data.code){const{code:e}=s.data;if("SIGN_PARAM_INVALID"===e||"REFRESH_TOKEN_EXPIRED"===e||"INVALID_REFRESH_TOKEN"===e){if(this._cache.getStore(o)===Lt.ANONYMOUS&&"INVALID_REFRESH_TOKEN"===e){const e=this._cache.getStore(a),t=this._cache.getStore(i),o=await this.send("auth.signInAnonymously",{anonymous_uuid:e,refresh_token:t});return this.setRefreshToken(o.refresh_token),this._refreshAccessToken()}Tt(Pt),this._cache.removeStore(i)}throw new Be({code:s.data.code,message:`刷新access token失败:${s.data.code}`})}if(s.data.access_token)return Tt(Dt),this._cache.setStore(e,s.data.access_token),this._cache.setStore(t,s.data.access_token_expire+Date.now()),{accessToken:s.data.access_token,accessTokenExpire:s.data.access_token_expire};s.data.refresh_token&&(this._cache.removeStore(i),this._cache.setStore(i,s.data.refresh_token),this._refreshAccessToken())}async getAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t,refreshTokenKey:i}=this._cache.keys;if(!this._cache.getStore(i))throw new Be({message:"refresh token不存在,登录状态异常"});let o=this._cache.getStore(e),a=this._cache.getStore(t),n=!0;return this._shouldRefreshAccessTokenHook&&!(await this._shouldRefreshAccessTokenHook(o,a))&&(n=!1),(!o||!a||a<Date.now())&&n?this.refreshAccessToken():{accessToken:o,accessTokenExpire:a}}async request(e,t,i){const o=`x-tcb-trace_${this.config.env}`;let a="application/x-www-form-urlencoded";const n={action:e,env:this.config.env,dataVersion:"2019-08-16",...t};if(-1===It.indexOf(e)){const{refreshTokenKey:e}=this._cache.keys;this._cache.getStore(e)&&(n.access_token=(await this.getAccessToken()).accessToken)}let r;if("storage.uploadFile"===e){r=new FormData;for(let e in r)r.hasOwnProperty(e)&&void 0!==r[e]&&r.append(e,n[e]);a="multipart/form-data"}else{a="application/json",r={};for(let e in n)void 0!==n[e]&&(r[e]=n[e])}let s={headers:{"content-type":a}};i&&i.timeout&&(s.timeout=i.timeout),i&&i.onUploadProgress&&(s.onUploadProgress=i.onUploadProgress);const l=this._localCache.getStore(o);l&&(s.headers["X-TCB-Trace"]=l);const{parse:c,inQuery:h,search:d}=t;let u={env:this.config.env};c&&(u.parse=!0),h&&(u={...h,...u});let p=function(e,t,i={}){const o=/\?/.test(t);let a="";for(let n in i)""===a?!o&&(t+="?"):a+="&",a+=`${n}=${encodeURIComponent(i[n])}`;return/^http(s)?\:\/\//.test(t+=a)?t:`${e}${t}`}(et,"//tcb-api.tencentcloudapi.com/web",u);d&&(p+=d);const g=await this.post({url:p,data:r,...s}),f=g.header&&g.header["x-tcb-trace"];if(f&&this._localCache.setStore(o,f),200!==Number(g.status)&&200!==Number(g.statusCode)||!g.data)throw new Be({code:"NETWORK_ERROR",message:"network request error"});return g}async send(e,t={},i={}){const o=await this.request(e,t,{...i,onUploadProgress:t.onUploadProgress});if("ACCESS_TOKEN_EXPIRED"===o.data.code&&-1===It.indexOf(e)){await this.refreshAccessToken();const o=await this.request(e,t,{...i,onUploadProgress:t.onUploadProgress});if(o.data.code)throw new Be({code:o.data.code,message:o.data.message});return o.data}if(o.data.code)throw new Be({code:o.data.code,message:o.data.message});return o.data}setRefreshToken(e){const{accessTokenKey:t,accessTokenExpireKey:i,refreshTokenKey:o}=this._cache.keys;this._cache.removeStore(t),this._cache.removeStore(i),this._cache.setStore(o,e)}}const Rt={};function Nt(e){return Rt[e]}class zt{constructor(e){this.config=e,this._cache=mt(e.env),this._request=Nt(e.env)}setRefreshToken(e){const{accessTokenKey:t,accessTokenExpireKey:i,refreshTokenKey:o}=this._cache.keys;this._cache.removeStore(t),this._cache.removeStore(i),this._cache.setStore(o,e)}setAccessToken(e,t){const{accessTokenKey:i,accessTokenExpireKey:o}=this._cache.keys;this._cache.setStore(i,e),this._cache.setStore(o,t)}async refreshUserInfo(){const{data:e}=await this._request.send("auth.getUserInfo",{});return this.setLocalUserInfo(e),e}setLocalUserInfo(e){const{userInfoKey:t}=this._cache.keys;this._cache.setStore(t,e)}}class Bt{constructor(e){if(!e)throw new Be({code:"PARAM_ERROR",message:"envId is not defined"});this._envId=e,this._cache=mt(this._envId),this._request=Nt(this._envId),this.setUserInfo()}linkWithTicket(e){if("string"!=typeof e)throw new Be({code:"PARAM_ERROR",message:"ticket must be string"});return this._request.send("auth.linkWithTicket",{ticket:e})}linkWithRedirect(e){e.signInWithRedirect()}updatePassword(e,t){return this._request.send("auth.updatePassword",{oldPassword:t,newPassword:e})}updateEmail(e){return this._request.send("auth.updateEmail",{newEmail:e})}updateUsername(e){if("string"!=typeof e)throw new Be({code:"PARAM_ERROR",message:"username must be a string"});return this._request.send("auth.updateUsername",{username:e})}async getLinkedUidList(){const{data:e}=await this._request.send("auth.getLinkedUidList",{});let t=!1;const{users:i}=e;return i.forEach((e=>{e.wxOpenId&&e.wxPublicId&&(t=!0)})),{users:i,hasPrimaryUid:t}}setPrimaryUid(e){return this._request.send("auth.setPrimaryUid",{uid:e})}unlink(e){return this._request.send("auth.unlink",{platform:e})}async update(e){const{nickName:t,gender:i,avatarUrl:o,province:a,country:n,city:r}=e,{data:s}=await this._request.send("auth.updateUserInfo",{nickName:t,gender:i,avatarUrl:o,province:a,country:n,city:r});this.setLocalUserInfo(s)}async refresh(){const{data:e}=await this._request.send("auth.getUserInfo",{});return this.setLocalUserInfo(e),e}setUserInfo(){const{userInfoKey:e}=this._cache.keys,t=this._cache.getStore(e);["uid","loginType","openid","wxOpenId","wxPublicId","unionId","qqMiniOpenId","email","hasPassword","customUserId","nickName","gender","avatarUrl"].forEach((e=>{this[e]=t[e]})),this.location={country:t.country,province:t.province,city:t.city}}setLocalUserInfo(e){const{userInfoKey:t}=this._cache.keys;this._cache.setStore(t,e),this.setUserInfo()}}class Ut{constructor(e){if(!e)throw new Be({code:"PARAM_ERROR",message:"envId is not defined"});this._cache=mt(e);const{refreshTokenKey:t,accessTokenKey:i,accessTokenExpireKey:o}=this._cache.keys,a=this._cache.getStore(t),n=this._cache.getStore(i),r=this._cache.getStore(o);this.credential={refreshToken:a,accessToken:n,accessTokenExpire:r},this.user=new Bt(e)}get isAnonymousAuth(){return this.loginType===Lt.ANONYMOUS}get isCustomAuth(){return this.loginType===Lt.CUSTOM}get isWeixinAuth(){return this.loginType===Lt.WECHAT||this.loginType===Lt.WECHAT_OPEN||this.loginType===Lt.WECHAT_PUBLIC}get loginType(){return this._cache.getStore(this._cache.keys.loginTypeKey)}}class Wt extends zt{async signIn(){this._cache.updatePersistence("local");const{anonymousUuidKey:e,refreshTokenKey:t}=this._cache.keys,i=this._cache.getStore(e)||void 0,o=this._cache.getStore(t)||void 0,a=await this._request.send("auth.signInAnonymously",{anonymous_uuid:i,refresh_token:o});if(a.uuid&&a.refresh_token){this._setAnonymousUUID(a.uuid),this.setRefreshToken(a.refresh_token),await this._request.refreshAccessToken(),Tt(_t),Tt(Ct,{env:this.config.env,loginType:Lt.ANONYMOUS,persistence:"local"});const e=new Ut(this.config.env);return await e.user.refresh(),e}throw new Be({message:"匿名登录失败"})}async linkAndRetrieveDataWithTicket(e){const{anonymousUuidKey:t,refreshTokenKey:i}=this._cache.keys,o=this._cache.getStore(t),a=this._cache.getStore(i),n=await this._request.send("auth.linkAndRetrieveDataWithTicket",{anonymous_uuid:o,refresh_token:a,ticket:e});if(n.refresh_token)return this._clearAnonymousUUID(),this.setRefreshToken(n.refresh_token),await this._request.refreshAccessToken(),Tt(kt,{env:this.config.env}),Tt(Ct,{loginType:Lt.CUSTOM,persistence:"local"}),{credential:{refreshToken:n.refresh_token}};throw new Be({message:"匿名转化失败"})}_setAnonymousUUID(e){const{anonymousUuidKey:t,loginTypeKey:i}=this._cache.keys;this._cache.removeStore(t),this._cache.setStore(t,e),this._cache.setStore(i,Lt.ANONYMOUS)}_clearAnonymousUUID(){this._cache.removeStore(this._cache.keys.anonymousUuidKey)}}class jt extends zt{async signIn(e){if("string"!=typeof e)throw new Be({code:"PARAM_ERROR",message:"ticket must be a string"});const{refreshTokenKey:t}=this._cache.keys,i=await this._request.send("auth.signInWithTicket",{ticket:e,refresh_token:this._cache.getStore(t)||""});if(i.refresh_token)return this.setRefreshToken(i.refresh_token),await this._request.refreshAccessToken(),Tt(_t),Tt(Ct,{env:this.config.env,loginType:Lt.CUSTOM,persistence:this.config.persistence}),await this.refreshUserInfo(),new Ut(this.config.env);throw new Be({message:"自定义登录失败"})}}class qt extends zt{async signIn(e,t){if("string"!=typeof e)throw new Be({code:"PARAM_ERROR",message:"email must be a string"});const{refreshTokenKey:i}=this._cache.keys,o=await this._request.send("auth.signIn",{loginType:"EMAIL",email:e,password:t,refresh_token:this._cache.getStore(i)||""}),{refresh_token:a,access_token:n,access_token_expire:r}=o;if(a)return this.setRefreshToken(a),n&&r?this.setAccessToken(n,r):await this._request.refreshAccessToken(),await this.refreshUserInfo(),Tt(_t),Tt(Ct,{env:this.config.env,loginType:Lt.EMAIL,persistence:this.config.persistence}),new Ut(this.config.env);throw o.code?new Be({code:o.code,message:`邮箱登录失败: ${o.message}`}):new Be({message:"邮箱登录失败"})}async activate(e){return this._request.send("auth.activateEndUserMail",{token:e})}async resetPasswordWithToken(e,t){return this._request.send("auth.resetPasswordWithToken",{token:e,newPassword:t})}}class $t extends zt{async signIn(e,t){if("string"!=typeof e)throw new Be({code:"PARAM_ERROR",message:"username must be a string"});"string"!=typeof t&&(t="",console.warn("password is empty"));const{refreshTokenKey:i}=this._cache.keys,o=await this._request.send("auth.signIn",{loginType:Lt.USERNAME,username:e,password:t,refresh_token:this._cache.getStore(i)||""}),{refresh_token:a,access_token_expire:n,access_token:r}=o;if(a)return this.setRefreshToken(a),r&&n?this.setAccessToken(r,n):await this._request.refreshAccessToken(),await this.refreshUserInfo(),Tt(_t),Tt(Ct,{env:this.config.env,loginType:Lt.USERNAME,persistence:this.config.persistence}),new Ut(this.config.env);throw o.code?new Be({code:o.code,message:`用户名密码登录失败: ${o.message}`}):new Be({message:"用户名密码登录失败"})}}class Ht{constructor(e){this.config=e,this._cache=mt(e.env),this._request=Nt(e.env),this._onAnonymousConverted=this._onAnonymousConverted.bind(this),this._onLoginTypeChanged=this._onLoginTypeChanged.bind(this),wt(Ct,this._onLoginTypeChanged)}get currentUser(){const e=this.hasLoginState();return e&&e.user||null}get loginType(){return this._cache.getStore(this._cache.keys.loginTypeKey)}anonymousAuthProvider(){return new Wt(this.config)}customAuthProvider(){return new jt(this.config)}emailAuthProvider(){return new qt(this.config)}usernameAuthProvider(){return new $t(this.config)}async signInAnonymously(){return new Wt(this.config).signIn()}async signInWithEmailAndPassword(e,t){return new qt(this.config).signIn(e,t)}signInWithUsernameAndPassword(e,t){return new $t(this.config).signIn(e,t)}async linkAndRetrieveDataWithTicket(e){return this._anonymousAuthProvider||(this._anonymousAuthProvider=new Wt(this.config)),wt(kt,this._onAnonymousConverted),await this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e)}async signOut(){if(this.loginType===Lt.ANONYMOUS)throw new Be({message:"匿名用户不支持登出操作"});const{refreshTokenKey:e,accessTokenKey:t,accessTokenExpireKey:i}=this._cache.keys,o=this._cache.getStore(e);if(!o)return;const a=await this._request.send("auth.logout",{refresh_token:o});return this._cache.removeStore(e),this._cache.removeStore(t),this._cache.removeStore(i),Tt(_t),Tt(Ct,{env:this.config.env,loginType:Lt.NULL,persistence:this.config.persistence}),a}async signUpWithEmailAndPassword(e,t){return this._request.send("auth.signUpWithEmailAndPassword",{email:e,password:t})}async sendPasswordResetEmail(e){return this._request.send("auth.sendPasswordResetEmail",{email:e})}onLoginStateChanged(e){wt(_t,(()=>{const t=this.hasLoginState();e.call(this,t)}));const t=this.hasLoginState();e.call(this,t)}onLoginStateExpired(e){wt(Pt,e.bind(this))}onAccessTokenRefreshed(e){wt(Dt,e.bind(this))}onAnonymousConverted(e){wt(kt,e.bind(this))}onLoginTypeChanged(e){wt(Ct,(()=>{const t=this.hasLoginState();e.call(this,t)}))}async getAccessToken(){return{accessToken:(await this._request.getAccessToken()).accessToken,env:this.config.env}}hasLoginState(){const{refreshTokenKey:e}=this._cache.keys;return this._cache.getStore(e)?new Ut(this.config.env):null}async isUsernameRegistered(e){if("string"!=typeof e)throw new Be({code:"PARAM_ERROR",message:"username must be a string"});const{data:t}=await this._request.send("auth.isUsernameRegistered",{username:e});return t&&t.isRegistered}getLoginState(){return Promise.resolve(this.hasLoginState())}async signInWithTicket(e){return new jt(this.config).signIn(e)}shouldRefreshAccessToken(e){this._request._shouldRefreshAccessTokenHook=e.bind(this)}getUserInfo(){return this._request.send("auth.getUserInfo",{}).then((e=>e.code?e:{...e.data,requestId:e.seqId}))}getAuthHeader(){const{refreshTokenKey:e,accessTokenKey:t}=this._cache.keys,i=this._cache.getStore(e);return{"x-cloudbase-credentials":this._cache.getStore(t)+"/@@/"+i}}_onAnonymousConverted(e){const{env:t}=e.data;t===this.config.env&&this._cache.updatePersistence(this.config.persistence)}_onLoginTypeChanged(e){const{loginType:t,persistence:i,env:o}=e.data;o===this.config.env&&(this._cache.updatePersistence(i),this._cache.setStore(this._cache.keys.loginTypeKey,t))}}const Gt=function(e,t){t=t||st();const i=Nt(this.config.env),{cloudPath:o,filePath:a,onUploadProgress:n,fileType:r="image"}=e;return i.send("storage.getUploadMetadata",{path:o}).then((e=>{const{data:{url:s,authorization:l,token:c,fileId:h,cosFileId:d},requestId:u}=e,p={key:o,signature:l,"x-cos-meta-fileid":d,success_action_status:"201","x-cos-security-token":c};i.upload({url:s,data:p,file:a,name:o,fileType:r,onUploadProgress:n}).then((e=>{201===e.statusCode?t(null,{fileID:h,requestId:u}):t(new Be({code:"STORAGE_REQUEST_FAIL",message:`STORAGE_REQUEST_FAIL: ${e.data}`}))})).catch((e=>{t(e)}))})).catch((e=>{t(e)})),t.promise},Jt=function(e,t){t=t||st();const i=Nt(this.config.env),{cloudPath:o}=e;return i.send("storage.getUploadMetadata",{path:o}).then((e=>{t(null,e)})).catch((e=>{t(e)})),t.promise},Kt=function({fileList:e},t){if(t=t||st(),!e||!Array.isArray(e))return{code:"INVALID_PARAM",message:"fileList必须是非空的数组"};for(let o of e)if(!o||"string"!=typeof o)return{code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"};const i={fileid_list:e};return Nt(this.config.env).send("storage.batchDeleteFile",i).then((e=>{e.code?t(null,e):t(null,{fileList:e.data.delete_list,requestId:e.requestId})})).catch((e=>{t(e)})),t.promise},Xt=function({fileList:e},t){t=t||st(),e&&Array.isArray(e)||t(null,{code:"INVALID_PARAM",message:"fileList必须是非空的数组"});let i=[];for(let a of e)"object"==typeof a?(a.hasOwnProperty("fileID")&&a.hasOwnProperty("maxAge")||t(null,{code:"INVALID_PARAM",message:"fileList的元素必须是包含fileID和maxAge的对象"}),i.push({fileid:a.fileID,max_age:a.maxAge})):"string"==typeof a?i.push({fileid:a}):t(null,{code:"INVALID_PARAM",message:"fileList的元素必须是字符串"});const o={file_list:i};return Nt(this.config.env).send("storage.batchGetDownloadUrl",o).then((e=>{e.code?t(null,e):t(null,{fileList:e.data.download_list,requestId:e.requestId})})).catch((e=>{t(e)})),t.promise},Vt=async function({fileID:e},t){const i=(await Xt.call(this,{fileList:[{fileID:e,maxAge:600}]})).fileList[0];if("SUCCESS"!==i.code)return t?t(i):new Promise((e=>{e(i)}));const o=Nt(this.config.env);let a=i.download_url;if(a=encodeURI(a),!t)return o.download({url:a});t(await o.download({url:a}))},Yt=function({name:e,data:t,query:i,parse:o,search:a,timeout:n},r){const s=r||st();let l;try{l=t?JSON.stringify(t):""}catch(h){return Promise.reject(h)}if(!e)return Promise.reject(new Be({code:"PARAM_ERROR",message:"函数名不能为空"}));const c={inQuery:i,parse:o,search:a,function_name:e,request_data:l};return Nt(this.config.env).send("functions.invokeFunction",c,{timeout:n}).then((e=>{if(e.code)s(null,e);else{let i=e.data.response_data;if(o)s(null,{result:i,requestId:e.requestId});else try{i=JSON.parse(e.data.response_data),s(null,{result:i,requestId:e.requestId})}catch(t){s(new Be({message:"response data must be json"}))}}return s.promise})).catch((e=>{s(e)})),s.promise},Qt={timeout:15e3,persistence:"session"},Zt={};class ei{constructor(e){this.config=e||this.config,this.authObj=void 0}init(e){switch(dt.adapter||(this.requestClient=new dt.adapter.reqClass({timeout:e.timeout||5e3,timeoutMsg:`请求在${(e.timeout||5e3)/1e3}s内未完成,已中断`})),this.config={...Qt,...e},!0){case this.config.timeout>6e5:console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"),this.config.timeout=6e5;break;case this.config.timeout<100:console.warn("timeout小于可配置下限[100ms],已重置为下限数值"),this.config.timeout=100}return new ei(this.config)}auth({persistence:e}={}){if(this.authObj)return this.authObj;const t=e||dt.adapter.primaryStorage||Qt.persistence;var i;return t!==this.config.persistence&&(this.config.persistence=t),function(e){const{env:t}=e;xt[t]=new ft(e),yt[t]=new ft({...e,persistence:"local"})}(this.config),i=this.config,Rt[i.env]=new Et(i),this.authObj=new Ht(this.config),this.authObj}on(e,t){return wt.apply(this,[e,t])}off(e,t){return At.apply(this,[e,t])}callFunction(e,t){return Yt.apply(this,[e,t])}deleteFile(e,t){return Kt.apply(this,[e,t])}getTempFileURL(e,t){return Xt.apply(this,[e,t])}downloadFile(e,t){return Vt.apply(this,[e,t])}uploadFile(e,t){return Gt.apply(this,[e,t])}getUploadMetadata(e,t){return Jt.apply(this,[e,t])}registerExtension(e){Zt[e.name]=e}async invokeExtension(e,t){const i=Zt[e];if(!i)throw new Be({message:`扩展${e} 必须先注册`});return await i.invoke(t,this)}useAdapters(e){const{adapter:t,runtime:i}=function(e){const t=(i=e,"[object Array]"===Object.prototype.toString.call(i)?e:[e]);var i;for(const o of t){const{isMatch:e,genAdapter:t,runtime:i}=o;if(e())return{adapter:t(),runtime:i}}}(e)||{};t&&(dt.adapter=t),i&&(dt.runtime=i)}}var ti=new ei;function ii(e,t,i){void 0===i&&(i={});var o=/\?/.test(t),a="";for(var n in i)""===a?!o&&(t+="?"):a+="&",a+=n+"="+encodeURIComponent(i[n]);return/^http(s)?:\/\//.test(t+=a)?t:""+e+t}class oi{post(e){const{url:t,data:i,headers:o,timeout:a}=e;return new Promise(((e,n)=>{Ue.request({url:ii("https:",t),data:i,method:"POST",header:o,timeout:a,success(t){e(t)},fail(e){n(e)}})}))}upload(e){return new Promise(((t,i)=>{const{url:o,file:a,data:n,headers:r,fileType:s}=e,l=Ue.uploadFile({url:ii("https:",o),name:"file",formData:Object.assign({},n),filePath:a,fileType:s,header:r,success(e){const i={statusCode:e.statusCode,data:e.data||{}};200===e.statusCode&&n.success_action_status&&(i.statusCode=parseInt(n.success_action_status,10)),t(i)},fail(e){i(new Error(e.errMsg||"uploadFile:fail"))}});"function"==typeof e.onUploadProgress&&l&&"function"==typeof l.onProgressUpdate&&l.onProgressUpdate((t=>{e.onUploadProgress({loaded:t.totalBytesSent,total:t.totalBytesExpectedToSend})}))}))}}const ai={setItem(e,t){Ue.setStorageSync(e,t)},getItem:e=>Ue.getStorageSync(e),removeItem(e){Ue.removeStorageSync(e)},clear(){Ue.clearStorageSync()}};var ni={genAdapter:function(){return{root:{},reqClass:oi,localStorage:ai,primaryStorage:"local"}},isMatch:function(){return!0},runtime:"uni_app"};ti.useAdapters(ni);const ri=ti,si=ri.init;ri.init=function(e){e.env=e.spaceId;const t=si.call(this,e);t.config.provider="tencent",t.config.spaceId=e.spaceId;const i=t.auth;return t.auth=function(e){const t=i.call(this,e);return["linkAndRetrieveDataWithTicket","signInAnonymously","signOut","getAccessToken","getLoginState","signInWithTicket","getUserInfo"].forEach((e=>{var i;t[e]=(i=t[e],function(e){e=e||{};const{success:t,fail:o,complete:a}=ze(e);if(!(t||o||a))return i.call(this,e);i.call(this,e).then((e=>{t&&t(e),a&&a(e)}),(e=>{o&&o(e),a&&a(e)}))}).bind(t)})),t},t.customAuth=t.auth,t};var li=ri;async function ci(e,t){const i=`http://${e}:${t}/system/ping`;try{const e=await(o={url:i,timeout:500},new Promise(((e,t)=>{Ue.request({...o,success(t){e(t)},fail(e){t(e)}})})));return!(!e.data||0!==e.data.code)}catch(a){return!1}var o}const hi={"serverless.file.resource.generateProximalSign":"storage/generate-proximal-sign","serverless.file.resource.report":"storage/report","serverless.file.resource.delete":"storage/delete","serverless.file.resource.getTempFileURL":"storage/get-temp-file-url"};var di={init(e){const t=new class{constructor(e){if(["spaceId","clientSecret"].forEach((t=>{if(!Object.prototype.hasOwnProperty.call(e,t))throw new Error(`${t} required`)})),!e.endpoint)throw new Error("集群空间未配置ApiEndpoint,配置后需要重新关联服务空间后生效");this.config=Object.assign({},e),this.config.provider="dcloud",this.config.requestUrl=this.config.endpoint+"/client",this.config.envType=this.config.envType||"public",this.adapter=Ue}async request(e,t=!0){return e=this.setupRequest(e),Promise.resolve().then((()=>Ye(e,this.adapter.request)))}requestLocal(e){return new Promise(((t,i)=>{this.adapter.request(Object.assign(e,{complete(e){if(e||(e={}),!e.statusCode||e.statusCode>=400){const t=e.data&&e.data.code||"SYS_ERR",o=e.data&&e.data.message||"request:fail";return i(new Be({code:t,message:o}))}t({success:!0,result:e.data})}}))}))}setupRequest(e){const t=Object.assign({},e,{spaceId:this.config.spaceId,timestamp:Date.now()}),i={"Content-Type":"application/json"};i["x-serverless-sign"]=Ve(t,this.config.clientSecret);const o=Xe();i["x-client-info"]=encodeURIComponent(JSON.stringify(o));const{token:a}=je();return i["x-client-token"]=a,{url:this.config.requestUrl,method:"POST",data:t,dataType:"json",header:JSON.parse(JSON.stringify(i))}}async setupLocalRequest(e){const t=Xe(),{token:i}=je(),o=Object.assign({},e,{spaceId:this.config.spaceId,timestamp:Date.now(),clientInfo:t,token:i}),{address:a,servePort:n}=this.__dev__&&this.__dev__.debugInfo||{},{address:r}=await async function(e,t){let i;for(let o=0;o<e.length;o++){const a=e[o];if(await ci(a,t)){i=a;break}}return{address:i,port:t}}(a,n);return{url:`http://${r}:${n}/${hi[e.method]}`,method:"POST",data:o,dataType:"json",header:JSON.parse(JSON.stringify({"Content-Type":"application/json"}))}}callFunction(e){const t={method:"serverless.function.runtime.invoke",params:JSON.stringify({functionTarget:e.name,functionArgs:e.data||{}})};return this.request(t,!1)}getUploadFileOptions(e){const t={method:"serverless.file.resource.generateProximalSign",params:JSON.stringify(e)};return this.request(t)}reportUploadFile(e){const t={method:"serverless.file.resource.report",params:JSON.stringify(e)};return this.request(t)}uploadFile({filePath:e,cloudPath:t,fileType:i="image",onUploadProgress:o}){if(!t)throw new Be({code:"CLOUDPATH_REQUIRED",message:"cloudPath不可为空"});let a;return this.getUploadFileOptions({cloudPath:t}).then((t=>{const{url:n,formData:r,name:s}=t.result;return a=t.result.fileUrl,new Promise(((t,a)=>{const l=this.adapter.uploadFile({url:n,formData:r,name:s,filePath:e,fileType:i,success(e){e&&e.statusCode<400?t(e):a(new Be({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(e){a(new Be({code:e.code||"UPLOAD_FAILED",message:e.message||e.errMsg||"文件上传失败"}))}});"function"==typeof o&&l&&"function"==typeof l.onProgressUpdate&&l.onProgressUpdate((e=>{o({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend})}))}))})).then((()=>this.reportUploadFile({cloudPath:t}))).then((t=>new Promise(((i,o)=>{t.success?i({success:!0,filePath:e,fileID:a}):o(new Be({code:"UPLOAD_FAILED",message:"文件上传失败"}))}))))}deleteFile({fileList:e}){const t={method:"serverless.file.resource.delete",params:JSON.stringify({fileList:e})};return this.request(t).then((e=>{if(e.success)return e.result;throw new Be({code:"DELETE_FILE_FAILED",message:"删除文件失败"})}))}getTempFileURL({fileList:e,maxAge:t}={}){if(!Array.isArray(e)||0===e.length)throw new Be({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"});const i={method:"serverless.file.resource.getTempFileURL",params:JSON.stringify({fileList:e,maxAge:t})};return this.request(i).then((e=>{if(e.success)return{fileList:e.result.fileList.map((e=>({fileID:e.fileID,tempFileURL:e.tempFileURL})))};throw new Be({code:"GET_TEMP_FILE_URL_FAILED",message:"获取临时文件链接失败"})}))}}(e),i={signInAnonymously:function(){return Promise.resolve()},getLoginState:function(){return Promise.resolve(!1)}};return t.auth=function(){return i},t.customAuth=t.auth,t}},ui=X((function(e,t){e.exports=Y.enc.Hex}));function pi(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function gi(e="",t={}){const{data:i,functionName:o,method:a,headers:n,signHeaderKeys:r=[],config:s}=t,l=Date.now(),c=pi(),h=Object.assign({},n,{"x-from-app-id":s.spaceAppId,"x-from-env-id":s.spaceId,"x-to-env-id":s.spaceId,"x-from-instance-id":l,"x-from-function-name":o,"x-client-timestamp":l,"x-alipay-source":"client","x-request-id":c,"x-alipay-callid":c,"x-trace-id":c}),d=["x-from-app-id","x-from-env-id","x-to-env-id","x-from-instance-id","x-from-function-name","x-client-timestamp"].concat(r),[u="",p=""]=e.split("?")||[],g=function(e){const t=e.signedHeaders.join(";"),i=e.signedHeaders.map((t=>`${t.toLowerCase()}:${e.headers[t]}\n`)).join(""),o=nt(e.body).toString(ui),a=`${e.method.toUpperCase()}\n${e.path}\n${e.query}\n${i}\n${t}\n${o}\n`,n=nt(a).toString(ui),r=`HMAC-SHA256\n${e.timestamp}\n${n}\n`,s=rt(r,e.secretKey).toString(ui);return`HMAC-SHA256 Credential=${e.secretId}, SignedHeaders=${t}, Signature=${s}`}({path:u,query:p,method:a,headers:h,timestamp:l,body:JSON.stringify(i),secretId:s.accessKey,secretKey:s.secretKey,signedHeaders:d.sort()});return{url:`${s.endpoint}${e}`,headers:Object.assign({},h,{Authorization:g})}}function fi({url:e,data:t,method:i="POST",headers:o={},timeout:a}){return new Promise(((n,r)=>{Ue.request({url:e,method:i,data:"object"==typeof t?JSON.stringify(t):t,header:o,dataType:"json",timeout:a,complete:(e={})=>{const t=o["x-trace-id"]||"";if(!e.statusCode||e.statusCode>=400){const{message:i,errMsg:o,trace_id:a}=e.data||{};return r(new Be({code:"SYS_ERR",message:i||o||"request:fail",requestId:a||t}))}n({status:e.statusCode,data:e.data,headers:e.header,requestId:t})}})}))}function xi(e,t){const{path:i,data:o,method:a="GET"}=e,{url:n,headers:r}=gi(i,{functionName:"",data:o,method:a,headers:{"x-alipay-cloud-mode":"oss","x-data-api-type":"oss","x-expire-timestamp":Date.now()+6e4},signHeaderKeys:["x-data-api-type","x-expire-timestamp"],config:t});return fi({url:n,data:o,method:a,headers:r}).then((e=>{const t=e.data||{};if(!t.success)throw new Be({code:e.errCode,message:e.errMsg,requestId:e.requestId});return t.data||{}})).catch((e=>{throw new Be({code:e.errCode,message:e.errMsg,requestId:e.requestId})}))}function yi(e=""){const t=e.trim().replace(/^cloud:\/\//,""),i=t.indexOf("/");if(i<=0)throw new Be({code:"INVALID_PARAM",message:"fileID不合法"});const o=t.substring(0,i),a=t.substring(i+1);return o!==this.config.spaceId&&console.warn("file ".concat(e," does not belong to env ").concat(this.config.spaceId)),a}function mi(e=""){return"cloud://".concat(this.config.spaceId,"/").concat(e.replace(/^\/+/,""))}class vi{constructor(e){this.config=e}signedURL(e,t={}){const i=`/ws/function/${e}`,o=this.config.wsEndpoint.replace(/^ws(s)?:\/\//,""),a=Object.assign({},t,{accessKeyId:this.config.accessKey,signatureNonce:pi(),timestamp:""+Date.now()}),n=[i,["accessKeyId","authorization","signatureNonce","timestamp"].sort().map((function(e){return a[e]?"".concat(e,"=").concat(a[e]):null})).filter(Boolean).join("&"),`host:${o}`].join("\n"),r=["HMAC-SHA256",nt(n).toString(ui)].join("\n"),s=rt(r,this.config.secretKey).toString(ui),l=Object.keys(a).map((e=>`${e}=${encodeURIComponent(a[e])}`)).join("&");return`${this.config.wsEndpoint}${i}?${l}&signature=${s}`}}var bi={init:e=>{e.provider="alipay";const t=new class{constructor(e){if(["spaceId","spaceAppId","accessKey","secretKey"].forEach((t=>{if(!Object.prototype.hasOwnProperty.call(e,t))throw new Error(`${t} required`)})),e.endpoint){if("string"!=typeof e.endpoint)throw new Error("endpoint must be string");if(!/^https:\/\//.test(e.endpoint))throw new Error("endpoint must start with https://");e.endpoint=e.endpoint.replace(/\/$/,"")}this.config=Object.assign({},e,{endpoint:e.endpoint||`https://${e.spaceId}.api-hz.cloudbasefunction.cn`,wsEndpoint:e.wsEndpoint||`wss://${e.spaceId}.api-hz.cloudbasefunction.cn`}),this._websocket=new vi(this.config)}callFunction(e){return function(e,t){const{name:i,data:o,async:a=!1,timeout:n}=e,r="POST",s={"x-to-function-name":i};a&&(s["x-function-invoke-type"]="async");const{url:l,headers:c}=gi("/functions/invokeFunction",{functionName:i,data:o,method:r,headers:s,signHeaderKeys:["x-to-function-name"],config:t});return fi({url:l,data:o,method:r,headers:c,timeout:n}).then((e=>{let t=0;if(a){const i=e.data||{};t="200"===i.errCode?0:i.errCode,e.data=i.data||{},e.errMsg=i.errMsg}if(0!==t)throw new Be({code:t,message:e.errMsg,requestId:e.requestId});return{errCode:t,success:0===t,requestId:e.requestId,result:e.data}})).catch((e=>{throw new Be({code:e.errCode,message:e.errMsg,requestId:e.requestId})}))}(e,this.config)}uploadFileToOSS({url:e,filePath:t,fileType:i,formData:o,onUploadProgress:a}){return new Promise(((n,r)=>{const s=Ue.uploadFile({url:e,filePath:t,fileType:i,formData:o,name:"file",success(e){e&&e.statusCode<400?n(e):r(new Be({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(e){r(new Be({code:e.code||"UPLOAD_FAILED",message:e.message||e.errMsg||"文件上传失败"}))}});"function"==typeof a&&s&&"function"==typeof s.onProgressUpdate&&s.onProgressUpdate((e=>{a({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend})}))}))}async uploadFile({filePath:e,cloudPath:t="",fileType:i="image",onUploadProgress:o}){if("string"!==ae(t))throw new Be({code:"INVALID_PARAM",message:"cloudPath必须为字符串类型"});if(!(t=t.trim()))throw new Be({code:"INVALID_PARAM",message:"cloudPath不可为空"});if(/:\/\//.test(t))throw new Be({code:"INVALID_PARAM",message:"cloudPath不合法"});const a=await xi({path:"/".concat(t.replace(/^\//,""),"?post_url")},this.config),{file_id:n,upload_url:r,form_data:s}=a,l=s&&s.reduce(((e,t)=>(e[t.key]=t.value,e)),{});return this.uploadFileToOSS({url:r,filePath:e,fileType:i,formData:l,onUploadProgress:o}).then((()=>({fileID:n})))}async getTempFileURL({fileList:e}){return new Promise(((t,i)=>{(!e||e.length<0)&&i(new Be({errCode:"INVALID_PARAM",errMsg:"fileList不能为空数组"})),e.length>50&&i(new Be({errCode:"INVALID_PARAM",errMsg:"fileList数组长度不能超过50"}));const o=[];for(const a of e){"string"!==ae(a)&&i(new Be({errCode:"INVALID_PARAM",errMsg:"fileList的元素必须是非空的字符串"}));const e=yi.call(this,a);o.push({file_id:e,expire:600})}xi({path:"/?download_url",data:{file_list:o},method:"POST"},this.config).then((e=>{const{file_list:i=[]}=e;t({fileList:i.map((e=>({fileID:mi.call(this,e.file_id),tempFileURL:e.download_url})))})})).catch((e=>i(e)))}))}async connectWebSocket(e){const{name:t,query:i}=e;return Ue.connectSocket({url:this._websocket.signedURL(t,i),complete:()=>{}})}}(e);return t.auth=function(){return{signInAnonymously:function(){return Promise.resolve()},getLoginState:function(){return Promise.resolve(!0)}}},t}};function Si({data:e}){let t;t=Xe();const i=JSON.parse(JSON.stringify(e||{}));if(Object.assign(i,{clientInfo:t}),!i.uniIdToken){const{token:e}=je();e&&(i.uniIdToken=e)}return i}const wi=[{rule:/fc_function_not_found|FUNCTION_NOT_FOUND/,content:",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",mode:"append"}];var Ti=/[\\^$.*+?()[\]{}|]/g,Ai=RegExp(Ti.source);function _i(e,t,i){return e.replace(new RegExp((o=t)&&Ai.test(o)?o.replace(Ti,"\\$&"):o,"g"),i);var o}const Pi=2e4,Ci={code:20101,message:"Invalid client"};function ki(e){const{errSubject:t,subject:i,errCode:o,errMsg:a,code:n,message:r,cause:s}=e||{};return new Be({subject:t||i||"uni-secure-network",code:o||n||Pi,message:a||r,cause:s})}let Di;function Li({secretType:e}={}){return"request"===e||"response"===e||"both"===e}function Ii({functionName:e,result:t,logPvd:i}){}function Mi(e){const t=e.callFunction,i=function(i){const o=i.name;i.data=Si.call(e,{data:i.data});const a={aliyun:"aliyun",tencent:"tcb",tcb:"tcb",alipay:"alipay",dcloud:"dcloud"}[this.config.provider],n=Li(i)||false;return t.call(this,i).then((e=>(e.errCode=0,!n&&Ii.call(this,{functionName:o,result:e,logPvd:a}),Promise.resolve(e))),(e=>(!n&&Ii.call(this,{functionName:o,result:e,logPvd:a}),e&&e.message&&(e.message=function({message:e="",extraInfo:t={},formatter:i=[]}={}){for(let o=0;o<i.length;o++){const{rule:a,content:n,mode:r}=i[o],s=e.match(a);if(!s)continue;let l=n;for(let e=1;e<s.length;e++)l=_i(l,`{$${e}}`,s[e]);for(const e in t)l=_i(l,`{${e}}`,t[e]);return"replace"===r?l:e+l}return e}({message:`[${i.name}]: ${e.message}`,formatter:wi,extraInfo:{functionName:o}})),Promise.reject(e))))};e.callFunction=function(t){const{provider:o,spaceId:a}=e.config,n=t.name;let r,s;return t.data=t.data||{},r=i,r=r.bind(e),s=Li(t)?new Di({secretType:t.secretType,uniCloudIns:e}).wrapEncryptDataCallFunction(i.bind(e))(t):function({provider:e,spaceId:t,functionName:i}={}){const{appId:o,uniPlatform:a,osName:n}=Ge();let r=a;"app"===a&&(r=n);const s=function({provider:e,spaceId:t}={}){const i=ue;if(!i)return{};e=function(e){return"tencent"===e?"tcb":e}(e);const o=i.find((i=>i.provider===e&&i.spaceId===t));return o&&o.config}({provider:e,spaceId:t});if(!s||!s.accessControl||!s.accessControl.enable)return!1;const l=s.accessControl.function||{},c=Object.keys(l);if(0===c.length)return!0;const h=function(e,t){let i,o,a;for(let n=0;n<e.length;n++){const r=e[n];r!==t?"*"!==r?r.split(",").map((e=>e.trim())).indexOf(t)>-1&&(o=r):a=r:i=r}return i||o||a}(c,i);if(!h)return!1;if((l[h]||[]).find(((e={})=>e.appId===o&&(e.platform||"").toLowerCase()===r.toLowerCase())))return!0;throw console.error(`此应用[appId: ${o}, platform: ${r}]不在云端配置的允许访问的应用列表内,参考:https://uniapp.dcloud.net.cn/uniCloud/secure-network.html#verify-client`),ki(Ci)}({provider:o,spaceId:a,functionName:n})?new Di({secretType:t.secretType,uniCloudIns:e}).wrapVerifyClientCallFunction(i.bind(e))(t):r(t),Object.defineProperty(s,"result",{get:()=>(console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"),{})}),s.then((e=>("undefined"!=typeof UTSJSONObject&&(e.result=new UTSJSONObject(e.result)),e)))}}Di=class{constructor(){throw ki({message:"Platform web is not supported by secure network"})}};const Fi=Symbol("CLIENT_DB_INTERNAL");function Oi(e,t){return e.then="DoNotReturnProxyWithAFunctionNamedThen",e._internalType=Fi,e.inspect=null,e.__v_raw=void 0,new Proxy(e,{get(e,i,o){if("_uniClient"===i)return null;if("symbol"==typeof i)return e[i];if(i in e||"string"!=typeof i){const t=e[i];return"function"==typeof t?t.bind(e):t}return t.get(e,i,o)}})}function Ei(e){return{on:(t,i)=>{e[t]=e[t]||[],e[t].indexOf(i)>-1||e[t].push(i)},off:(t,i)=>{e[t]=e[t]||[];const o=e[t].indexOf(i);-1!==o&&e[t].splice(o,1)}}}const Ri=["db.Geo","db.command","command.aggregate"];function Ni(e,t){return Ri.indexOf(`${e}.${t}`)>-1}function zi(e){switch(ae(e=We(e))){case"array":return e.map((e=>zi(e)));case"object":return e._internalType===Fi||Object.keys(e).forEach((t=>{e[t]=zi(e[t])})),e;case"regexp":return{$regexp:{source:e.source,flags:e.flags}};case"date":return{$date:e.toISOString()};default:return e}}function Bi(e){return e&&e.content&&e.content.$method}class Ui{constructor(e,t,i){this.content=e,this.prevStage=t||null,this.udb=null,this._database=i}toJSON(){let e=this;const t=[e.content];for(;e.prevStage;)e=e.prevStage,t.push(e.content);return{$db:t.reverse().map((e=>({$method:e.$method,$param:zi(e.$param)})))}}toString(){return JSON.stringify(this.toJSON())}getAction(){const e=this.toJSON().$db.find((e=>"action"===e.$method));return e&&e.$param&&e.$param[0]}getCommand(){return{$db:this.toJSON().$db.filter((e=>"action"!==e.$method))}}get isAggregate(){let e=this;for(;e;){const t=Bi(e),i=Bi(e.prevStage);if("aggregate"===t&&"collection"===i||"pipeline"===t)return!0;e=e.prevStage}return!1}get isCommand(){let e=this;for(;e;){if("command"===Bi(e))return!0;e=e.prevStage}return!1}get isAggregateCommand(){let e=this;for(;e;){const t=Bi(e),i=Bi(e.prevStage);if("aggregate"===t&&"command"===i)return!0;e=e.prevStage}return!1}getNextStageFn(e){const t=this;return function(){return Wi({$method:e,$param:zi(Array.from(arguments))},t,t._database)}}get count(){return this.isAggregate?this.getNextStageFn("count"):function(){return this._send("count",Array.from(arguments))}}get remove(){return this.isCommand?this.getNextStageFn("remove"):function(){return this._send("remove",Array.from(arguments))}}get(){return this._send("get",Array.from(arguments))}get add(){return this.isCommand?this.getNextStageFn("add"):function(){return this._send("add",Array.from(arguments))}}update(){return this._send("update",Array.from(arguments))}end(){return this._send("end",Array.from(arguments))}get set(){return this.isCommand?this.getNextStageFn("set"):function(){throw new Error("JQL禁止使用set方法")}}_send(e,t){const i=this.getAction(),o=this.getCommand();return o.$db.push({$method:e,$param:zi(t)}),this._database._callCloudFunction({action:i,command:o})}}function Wi(e,t,i){return Oi(new Ui(e,t,i),{get(e,t){let o="db";return e&&e.content&&(o=e.content.$method),Ni(o,t)?Wi({$method:t},e,i):function(){return Wi({$method:t,$param:zi(Array.from(arguments))},e,i)}}})}function ji({path:e,method:t}){return class{constructor(){this.param=Array.from(arguments)}toJSON(){return{$newDb:[...e.map((e=>({$method:e}))),{$method:t,$param:this.param}]}}toString(){return JSON.stringify(this.toJSON())}}}function qi(e,t={}){return Oi(new e(t),{get:(e,t)=>Ni("db",t)?Wi({$method:t},null,e):function(){return Wi({$method:t,$param:zi(Array.from(arguments))},null,e)}})}class $i extends class{constructor({uniClient:e={},isJQL:t=!1}={}){this._uniClient=e,this._authCallBacks={},this._dbCallBacks={},e._isDefault&&(this._dbCallBacks=xe("_globalUniCloudDatabaseCallback")),t||(this.auth=Ei(this._authCallBacks)),this._isJQL=t,Object.assign(this,Ei(this._dbCallBacks)),this.env=Oi({},{get:(e,t)=>({$env:t})}),this.Geo=Oi({},{get:(e,t)=>ji({path:["Geo"],method:t})}),this.serverDate=ji({path:[],method:"serverDate"}),this.RegExp=ji({path:[],method:"RegExp"})}getCloudEnv(e){if("string"!=typeof e||!e.trim())throw new Error("getCloudEnv参数错误");return{$env:e.replace("$cloudEnv_","")}}_callback(e,t){const i=this._dbCallBacks;i[e]&&i[e].forEach((e=>{e(...t)}))}_callbackAuth(e,t){const i=this._authCallBacks;i[e]&&i[e].forEach((e=>{e(...t)}))}multiSend(){const e=Array.from(arguments),t=e.map((e=>{const t=e.getAction(),i=e.getCommand();if("getTemp"!==i.$db[i.$db.length-1].$method)throw new Error("multiSend只支持子命令内使用getTemp");return{action:t,command:i}}));return this._callCloudFunction({multiCommand:t,queryList:e})}}{_parseResult(e){return this._isJQL?e.result:e}_callCloudFunction({action:e,command:t,multiCommand:i,queryList:o}){function a(e,t){if(i&&o)for(let i=0;i<o.length;i++){const a=o[i];a.udb&&"function"==typeof a.udb.setResult&&(t?a.udb.setResult(t):a.udb.setResult(e.result.dataList[i]))}}const n=this,r=this._isJQL?"databaseForJQL":"database";function s(e){return n._callback("error",[e]),Se(we(r,"fail"),e).then((()=>Se(we(r,"complete"),e))).then((()=>(a(null,e),Oe(_e,{type:ke,content:e}),Promise.reject(e))))}const l=Se(we(r,"invoke")),c=this._uniClient;return l.then((()=>c.callFunction({name:"DCloud-clientDB",type:"CLIENT_DB",data:{action:e,command:t,multiCommand:i}}))).then((e=>{const{code:t,message:i,token:o,tokenExpired:l,systemInfo:c=[]}=e.result;if(c)for(let a=0;a<c.length;a++){const{level:e,message:t,detail:i}=c[a],o=console[e]||console.log;let n="[System Info]"+t;i&&(n=`${n}\n详细信息:${i}`),o(n)}if(t)return s(new Be({code:t,message:i,requestId:e.requestId}));e.result.errCode=e.result.errCode||e.result.code,e.result.errMsg=e.result.errMsg||e.result.message,o&&l&&(qe({token:o,tokenExpired:l}),this._callbackAuth("refreshToken",[{token:o,tokenExpired:l}]),this._callback("refreshToken",[{token:o,tokenExpired:l}]),Oe(Ce,{token:o,tokenExpired:l}));const h=[{prop:"affectedDocs",tips:"affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代"},{prop:"code",tips:"code不再推荐使用,请使用errCode替代"},{prop:"message",tips:"message不再推荐使用,请使用errMsg替代"}];for(let a=0;a<h.length;a++){const{prop:t,tips:i}=h[a];if(t in e.result){const o=e.result[t];Object.defineProperty(e.result,t,{get:()=>(console.warn(i),o)})}}return d=e,Se(we(r,"success"),d).then((()=>Se(we(r,"complete"),d))).then((()=>{a(d,null);const e=n._parseResult(d);return Oe(_e,{type:ke,content:e}),Promise.resolve(e)}));var d}),(e=>(/fc_function_not_found|FUNCTION_NOT_FOUND/g.test(e.message)&&console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB"),s(new Be({code:e.code||"SYSTEM_ERROR",message:e.message,requestId:e.requestId})))))}}const Hi="token无效,跳转登录页面",Gi="token过期,跳转登录页面",Ji={TOKEN_INVALID_TOKEN_EXPIRED:Gi,TOKEN_INVALID_INVALID_CLIENTID:Hi,TOKEN_INVALID:Hi,TOKEN_INVALID_WRONG_TOKEN:Hi,TOKEN_INVALID_ANONYMOUS_USER:Hi},Ki={"uni-id-token-expired":Gi,"uni-id-check-token-failed":Hi,"uni-id-token-not-exist":Hi,"uni-id-check-device-feature-failed":Hi};function Xi(e,t){let i="";return i=e?`${e}/${t}`:t,i.replace(/^\//,"")}function Vi(e=[],t=""){const i=[],o=[];return e.forEach((e=>{!0===e.needLogin?i.push(Xi(t,e.path)):!1===e.needLogin&&o.push(Xi(t,e.path))})),{needLoginPage:i,notNeedLoginPage:o}}function Yi(e){return e.split("?")[0].replace(/^\//,"")}function Qi(){return function(e){let t=e&&e.$page&&e.$page.fullPath||"";return t?("/"!==t.charAt(0)&&(t="/"+t),t):t}(function(){const e=i();return e[e.length-1]}())}function Zi(){return Yi(Qi())}function eo(e="",t={}){if(!e)return!1;if(!(t&&t.list&&t.list.length))return!1;const i=t.list,o=Yi(e);return i.some((e=>e.pagePath===o))}const to=!!K.uniIdRouter,{loginPage:io,routerNeedLogin:oo,resToLogin:ao,needLoginPage:no,notNeedLoginPage:ro,loginPageInTabBar:so}=function({pages:e=[],subPackages:t=[],uniIdRouter:i={},tabBar:o={}}=K){const{loginPage:a,needLogin:n=[],resToLogin:r=!0}=i,{needLoginPage:s,notNeedLoginPage:l}=Vi(e),{needLoginPage:c,notNeedLoginPage:h}=function(e=[]){const t=[],i=[];return e.forEach((e=>{const{root:o,pages:a=[]}=e,{needLoginPage:n,notNeedLoginPage:r}=Vi(a,o);t.push(...n),i.push(...r)})),{needLoginPage:t,notNeedLoginPage:i}}(t);return{loginPage:a,routerNeedLogin:n,resToLogin:r,needLoginPage:[...s,...c],notNeedLoginPage:[...l,...h],loginPageInTabBar:eo(a,o)}}();if(no.indexOf(io)>-1)throw new Error(`Login page [${io}] should not be "needLogin", please check your pages.json`);function lo(e){const t=Zi();if("/"===e.charAt(0))return e;const[i,o]=e.split("?"),a=i.replace(/^\//,"").split("/"),n=t.split("/");n.pop();for(let r=0;r<a.length;r++){const e=a[r];".."===e?n.pop():"."!==e&&n.push(e)}return""===n[0]&&n.shift(),"/"+n.join("/")+(o?"?"+o:"")}function co({redirect:e}){const t=Yi(e),i=Yi(io);return Zi()!==i&&t!==i}function ho({api:e,redirect:t}={}){if(!t||!co({redirect:t}))return;const i=(a=t,"/"!==(o=io).charAt(0)&&(o="/"+o),a?o.indexOf("?")>-1?o+`&uniIdRedirectUrl=${encodeURIComponent(a)}`:o+`?uniIdRedirectUrl=${encodeURIComponent(a)}`:o);var o,a;so?"navigateTo"!==e&&"redirectTo"!==e||(e="switchTab"):"switchTab"===e&&(e="navigateTo");const n={navigateTo:v,redirectTo:b,switchTab:S,reLaunch:w};setTimeout((()=>{n[e]({url:i})}),0)}function uo({url:e}={}){const t={abortLoginPageJump:!1,autoToLoginPage:!1},i=function(){const{token:e,tokenExpired:t}=je();let i;if(e){if(t<Date.now()){const e="uni-id-token-expired";i={errCode:e,errMsg:Ki[e]}}}else{const e="uni-id-check-token-failed";i={errCode:e,errMsg:Ki[e]}}return i}();if(function(e){const t=Yi(lo(e));return!(ro.indexOf(t)>-1)&&(no.indexOf(t)>-1||oo.some((t=>{return i=e,new RegExp(t).test(i);var i})))}(e)&&i){if(i.uniIdRedirectUrl=e,Ie(Pe).length>0)return setTimeout((()=>{Oe(Pe,i)}),0),t.abortLoginPageJump=!0,t;t.autoToLoginPage=!0}return t}function po(){!function(){const e=Qi(),{abortLoginPageJump:t,autoToLoginPage:i}=uo({url:e});t||i&&ho({api:"redirectTo",redirect:e})}();const e=["navigateTo","redirectTo","reLaunch","switchTab"];for(let t=0;t<e.length;t++){const i=e[t];o(i,{invoke(e){const{abortLoginPageJump:t,autoToLoginPage:o}=uo({url:e.url});return t?e:o?(ho({api:i,redirect:lo(e.url)}),!1):e}})}}function go(){this.onResponse((e=>{const{type:t,content:i}=e;let o=!1;switch(t){case"cloudobject":o=function(e){if("object"!=typeof e)return!1;const{errCode:t}=e||{};return t in Ki}(i);break;case"clientdb":o=function(e){if("object"!=typeof e)return!1;const{errCode:t}=e||{};return t in Ji}(i)}o&&function(e={}){const t=Ie(Pe);Ne().then((()=>{const i=Qi();if(i&&co({redirect:i}))return t.length>0?Oe(Pe,Object.assign({uniIdRedirectUrl:i},e)):void(io&&ho({api:"navigateTo",redirect:i}))}))}(i)}))}function fo(e){var t;(t=e).onResponse=function(e){Me(_e,e)},t.offResponse=function(e){Fe(_e,e)},function(e){e.onNeedLogin=function(e){Me(Pe,e)},e.offNeedLogin=function(e){Fe(Pe,e)},to&&(xe("_globalUniCloudStatus").needLoginInit||(xe("_globalUniCloudStatus").needLoginInit=!0,Ne().then((()=>{po.call(e)})),ao&&go.call(e)))}(e),function(e){e.onRefreshToken=function(e){Me(Ce,e)},e.offRefreshToken=function(e){Fe(Ce,e)}}(e)}let xo;const yo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",mo=/^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;function vo(){const e=je().token||"",t=e.split(".");if(!e||3!==t.length)return{uid:null,role:[],permission:[],tokenExpired:0};let i;try{i=JSON.parse((o=t[1],decodeURIComponent(xo(o).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))))}catch(a){throw new Error("获取当前用户信息出错,详细错误信息为:"+a.message)}var o;return i.tokenExpired=1e3*i.exp,delete i.exp,delete i.iat,i}xo="function"!=typeof atob?function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!mo.test(e))throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");var t;e+="==".slice(2-(3&e.length));for(var i,o,a="",n=0;n<e.length;)t=yo.indexOf(e.charAt(n++))<<18|yo.indexOf(e.charAt(n++))<<12|(i=yo.indexOf(e.charAt(n++)))<<6|(o=yo.indexOf(e.charAt(n++))),a+=64===i?String.fromCharCode(t>>16&255):64===o?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return a}:atob;var bo=function(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}(X((function(i,o){Object.defineProperty(o,"__esModule",{value:!0});const n="chooseAndUploadFile:ok",r="chooseAndUploadFile:fail";function s(e,t){return e.tempFiles.forEach(((e,i)=>{e.name||(e.name=e.path.substring(e.path.lastIndexOf("/")+1)),t&&(e.fileType=t),e.cloudPath=Date.now()+"_"+i+e.name.substring(e.name.lastIndexOf("."))})),e.tempFilePaths||(e.tempFilePaths=e.tempFiles.map((e=>e.path))),e}function l(e,t,{onChooseFile:i,onUploadProgress:o}){return t.then((e=>{if(i){const t=i(e);if(void 0!==t)return Promise.resolve(t).then((t=>void 0===t?e:t))}return e})).then((t=>!1===t?{errMsg:n,tempFilePaths:[],tempFiles:[]}:function(e,t,i=5,o){(t=Object.assign({},t)).errMsg=n;const a=t.tempFiles,r=a.length;let s=0;return new Promise((n=>{for(;s<i;)l();function l(){const i=s++;if(i>=r)return void(!a.find((e=>!e.url&&!e.errMsg))&&n(t));const c=a[i];e.uploadFile({provider:c.provider,filePath:c.path,cloudPath:c.cloudPath,fileType:c.fileType,cloudPathAsRealPath:c.cloudPathAsRealPath,onUploadProgress(e){e.index=i,e.tempFile=c,e.tempFilePath=c.path,o&&o(e)}}).then((e=>{c.url=e.fileID,i<r&&l()})).catch((e=>{c.errMsg=e.errMsg||e.message,i<r&&l()}))}}))}(e,t,5,o)))}o.initChooseAndUploadFile=function(i){return function(o={type:"all"}){return"image"===o.type?l(i,function(t){const{count:i,sizeType:o,sourceType:a=["album","camera"],extension:n}=t;return new Promise(((t,l)=>{e({count:i,sizeType:o,sourceType:a,extension:n,success(e){t(s(e,"image"))},fail(e){l({errMsg:e.errMsg.replace("chooseImage:fail",r)})}})}))}(o),o):"video"===o.type?l(i,function(e){const{camera:i,compressed:o,maxDuration:a,sourceType:n=["album","camera"],extension:l}=e;return new Promise(((e,c)=>{t({camera:i,compressed:o,maxDuration:a,sourceType:n,extension:l,success(t){const{tempFilePath:i,duration:o,size:a,height:n,width:r}=t;e(s({errMsg:"chooseVideo:ok",tempFilePaths:[i],tempFiles:[{name:t.tempFile&&t.tempFile.name||"",path:i,size:a,type:t.tempFile&&t.tempFile.type||"",width:r,height:n,duration:o,fileType:"video",cloudPath:""}]},"video"))},fail(e){c({errMsg:e.errMsg.replace("chooseVideo:fail",r)})}})}))}(o),o):l(i,function(e){const{count:t,extension:i}=e;return new Promise(((e,o)=>{let n=a;if("undefined"!=typeof wx&&"function"==typeof wx.chooseMessageFile&&(n=wx.chooseMessageFile),"function"!=typeof n)return o({errMsg:r+" 请指定 type 类型,该平台仅支持选择 image 或 video。"});n({type:"all",count:t,extension:i,success(t){e(s(t))},fail(e){o({errMsg:e.errMsg.replace("chooseFile:fail",r)})}})}))}(o),o)}}})));function So(e){return{props:{localdata:{type:Array,default:()=>[]},options:{type:[Object,Array],default:()=>({})},spaceInfo:{type:Object,default:()=>({})},collection:{type:[String,Array],default:""},action:{type:String,default:""},field:{type:String,default:""},orderby:{type:String,default:""},where:{type:[String,Object],default:""},pageData:{type:String,default:"add"},pageCurrent:{type:Number,default:1},pageSize:{type:Number,default:20},getcount:{type:[Boolean,String],default:!1},gettree:{type:[Boolean,String],default:!1},gettreepath:{type:[Boolean,String],default:!1},startwith:{type:String,default:""},limitlevel:{type:Number,default:10},groupby:{type:String,default:""},groupField:{type:String,default:""},distinct:{type:[Boolean,String],default:!1},foreignKey:{type:String,default:""},loadtime:{type:String,default:"auto"},manual:{type:Boolean,default:!1}},data:()=>({mixinDatacomLoading:!1,mixinDatacomHasMore:!1,mixinDatacomResData:[],mixinDatacomErrorMessage:"",mixinDatacomPage:{},mixinDatacomError:null}),created(){this.mixinDatacomPage={current:this.pageCurrent,size:this.pageSize,count:0},this.$watch((()=>{var e=[];return["pageCurrent","pageSize","localdata","collection","action","field","orderby","where","getont","getcount","gettree","groupby","groupField","distinct"].forEach((t=>{e.push(this[t])})),e}),((e,t)=>{if("manual"===this.loadtime)return;let i=!1;const o=[];for(let a=2;a<e.length;a++)e[a]!==t[a]&&(o.push(e[a]),i=!0);e[0]!==t[0]&&(this.mixinDatacomPage.current=this.pageCurrent),this.mixinDatacomPage.size=this.pageSize,this.onMixinDatacomPropsChange(i,o)}))},methods:{onMixinDatacomPropsChange(e,t){},mixinDatacomEasyGet({getone:e=!1,success:t,fail:i}={}){this.mixinDatacomLoading||(this.mixinDatacomLoading=!0,this.mixinDatacomErrorMessage="",this.mixinDatacomError=null,this.mixinDatacomGet().then((i=>{this.mixinDatacomLoading=!1;const{data:o,count:a}=i.result;this.getcount&&(this.mixinDatacomPage.count=a),this.mixinDatacomHasMore=o.length<this.pageSize;const n=e?o.length?o[0]:void 0:o;this.mixinDatacomResData=n,t&&t(n)})).catch((e=>{this.mixinDatacomLoading=!1,this.mixinDatacomErrorMessage=e,this.mixinDatacomError=e,i&&i(e)})))},mixinDatacomGet(t={}){let i;t=t||{},i="undefined"!=typeof __uniX&&__uniX?e.databaseForJQL(this.spaceInfo):e.database(this.spaceInfo);const o=t.action||this.action;o&&(i=i.action(o));const a=t.collection||this.collection;i=Array.isArray(a)?i.collection(...a):i.collection(a);const n=t.where||this.where;n&&Object.keys(n).length&&(i=i.where(n));const r=t.field||this.field;r&&(i=i.field(r));const s=t.foreignKey||this.foreignKey;s&&(i=i.foreignKey(s));const l=t.groupby||this.groupby;l&&(i=i.groupBy(l));const c=t.groupField||this.groupField;c&&(i=i.groupField(c)),!0===(void 0!==t.distinct?t.distinct:this.distinct)&&(i=i.distinct());const h=t.orderby||this.orderby;h&&(i=i.orderBy(h));const d=void 0!==t.pageCurrent?t.pageCurrent:this.mixinDatacomPage.current,u=void 0!==t.pageSize?t.pageSize:this.mixinDatacomPage.size,p=void 0!==t.getcount?t.getcount:this.getcount,g=void 0!==t.gettree?t.gettree:this.gettree,f=void 0!==t.gettreepath?t.gettreepath:this.gettreepath,x={getCount:p},y={limitLevel:void 0!==t.limitlevel?t.limitlevel:this.limitlevel,startWith:void 0!==t.startwith?t.startwith:this.startwith};return g&&(x.getTree=y),f&&(x.getTreePath=y),i=i.skip(u*(d-1)).limit(u).get(x),i}}}}function wo(e){return xe("_globalUniCloudSecureNetworkCache__{spaceId}".replace("{spaceId}",e.config.spaceId))}async function To({openid:e,callLoginByWeixin:t=!1}={}){throw wo(this),new Error("[SecureNetwork] API `initSecureNetworkByWeixin` is not supported on platform `web`")}async function Ao(e){const t=wo(this);return t.initPromise||(t.initPromise=To.call(this,e).then((e=>e)).catch((e=>{throw delete t.initPromise,e}))),t.initPromise}function _o(e){Ke=e}function Po(e){const t={getSystemInfo:T,getPushClientId:A};return function(i){return new Promise(((o,a)=>{t[e]({...i,success(e){o(e)},fail(e){a(e)}})}))}}class Co extends class{constructor(){this._callback={}}addListener(e,t){this._callback[e]||(this._callback[e]=[]),this._callback[e].push(t)}on(e,t){return this.addListener(e,t)}removeListener(e,t){if(!t)throw new Error('The "listener" argument must be of type function. Received undefined');const i=this._callback[e];if(!i)return;const o=function(e,t){for(let i=e.length-1;i>=0;i--)if(e[i]===t)return i;return-1}(i,t);i.splice(o,1)}off(e,t){return this.removeListener(e,t)}removeAllListener(e){delete this._callback[e]}emit(e,...t){const i=this._callback[e];if(i)for(let o=0;o<i.length;o++)i[o](...t)}}{constructor(){super(),this._uniPushMessageCallback=this._receivePushMessage.bind(this),this._currentMessageId=-1,this._payloadQueue=[]}init(){return Promise.all([Po("getSystemInfo")(),Po("getPushClientId")()]).then((([{appId:e}={},{cid:t}={}]=[])=>{if(!e)throw new Error("Invalid appId, please check the manifest.json file");if(!t)throw new Error("Invalid push client id");this._appId=e,this._pushClientId=t,this._seqId=Date.now()+"-"+Math.floor(9e5*Math.random()+1e5),this.emit("open"),this._initMessageListener()}),(e=>{throw this.emit("error",e),this.close(),e}))}async open(){return this.init()}_isUniCloudSSE(e){if("receive"!==e.type)return!1;const t=e&&e.data&&e.data.payload;return!(!t||"UNI_CLOUD_SSE"!==t.channel||t.seqId!==this._seqId)}_receivePushMessage(e){if(!this._isUniCloudSSE(e))return;const t=e&&e.data&&e.data.payload,{action:i,messageId:o,message:a}=t;this._payloadQueue.push({action:i,messageId:o,message:a}),this._consumMessage()}_consumMessage(){for(;;){const e=this._payloadQueue.find((e=>e.messageId===this._currentMessageId+1));if(!e)break;this._currentMessageId++,this._parseMessagePayload(e)}}_parseMessagePayload(e){const{action:t,messageId:i,message:o}=e;"end"===t?this._end({messageId:i,message:o}):"message"===t&&this._appendMessage({messageId:i,message:o})}_appendMessage({messageId:e,message:t}={}){this.emit("message",t)}_end({messageId:e,message:t}={}){this.emit("end",t),this.close()}_initMessageListener(){c(this._uniPushMessageCallback)}_destroy(){h(this._uniPushMessageCallback)}toJSON(){return{appId:this._appId,pushClientId:this._pushClientId,seqId:this._seqId}}close(){this._destroy(),this.emit("close")}}const ko={tcb:li,tencent:li,aliyun:Ze,private:di,dcloud:di,alipay:bi};let Do=new class{init(e){let t={};const i=ko[e.provider];if(!i)throw new Error("未提供正确的provider参数");var o;return t=i.init(e),function(e){e._initPromiseHub||(e._initPromiseHub=new he({createPromise:function(){let t=Promise.resolve();t=new Promise((e=>{setTimeout((()=>{e()}),1)}));const i=e.auth();return t.then((()=>i.getLoginState())).then((e=>e?Promise.resolve():i.signInAnonymously()))}}))}(t),Mi(t),function(e){const t=e.uploadFile;e.uploadFile=function(e){return t.call(this,e)}}(t),(o=t).database=function(e){if(e&&Object.keys(e).length>0)return o.init(e).database();if(this._database)return this._database;const t=qi($i,{uniClient:o});return this._database=t,t},o.databaseForJQL=function(e){if(e&&Object.keys(e).length>0)return o.init(e).databaseForJQL();if(this._databaseForJQL)return this._databaseForJQL;const t=qi($i,{uniClient:o,isJQL:!0});return this._databaseForJQL=t,t},function(e){e.getCurrentUserInfo=vo,e.chooseAndUploadFile=bo.initChooseAndUploadFile(e),Object.assign(e,{get mixinDatacom(){return So(e)}}),e.SSEChannel=Co,e.initSecureNetworkByWeixin=function(e){return function({openid:t,callLoginByWeixin:i=!1}={}){return Ao.call(e,{openid:t,callLoginByWeixin:i})}}(e),e.setCustomClientInfo=_o,e.importObject=function(t){return function(i,o={}){o=function(e,t={}){return e.customUI=t.customUI||e.customUI,e.parseSystemError=t.parseSystemError||e.parseSystemError,Object.assign(e.loadingOptions,t.loadingOptions),Object.assign(e.errorOptions,t.errorOptions),"object"==typeof t.secretMethods&&(e.secretMethods=t.secretMethods),e}({customUI:!1,loadingOptions:{title:"加载中...",mask:!0},errorOptions:{type:"modal",retry:!1}},o);const{customUI:a,loadingOptions:c,errorOptions:h,parseSystemError:d}=o,u=!a;return new Proxy({},{get(a,p){switch(p){case"toString":return"[object UniCloudObject]";case"toJSON":return{}}return function({fn:e,interceptorName:t,getCallbackArgs:i}={}){return async function(...o){const a=i?i({params:o}):{};let n,r;try{return await Se(we(t,"invoke"),{...a}),n=await e(...o),await Se(we(t,"success"),{...a,result:n}),n}catch(s){throw r=s,await Se(we(t,"fail"),{...a,error:r}),r}finally{await Se(we(t,"complete"),r?{...a,error:r}:{...a,result:n})}}}({fn:async function a(...g){let f;u&&n({title:c.title,mask:c.mask});const x={name:i,type:"OBJECT",data:{method:p,params:g}};"object"==typeof o.secretMethods&&function(e,t){const i=t.data.method,o=e.secretMethods||{},a=o[i]||o["*"];a&&(t.secretType=a)}(o,x);let y=!1;try{f=await t.callFunction(x)}catch(e){y=!0,f={result:new Be(e)}}const{errSubject:m,errCode:v,errMsg:b,newToken:S}=f.result||{};if(u&&r(),S&&S.token&&S.tokenExpired&&(qe(S),Oe(Ce,{...S})),v){let e=b;if(y&&d&&(e=(await d({objectName:i,methodName:p,params:g,errSubject:m,errCode:v,errMsg:b})).errMsg||b),u)if("toast"===h.type)s({title:e,icon:"none"});else{if("modal"!==h.type)throw new Error(`Invalid errorOptions.type: ${h.type}`);{const{confirm:t}=await async function({title:e,content:t,showCancel:i,cancelText:o,confirmText:a}={}){return new Promise(((n,r)=>{l({title:e,content:t,showCancel:i,cancelText:o,confirmText:a,success(e){n(e)},fail(){n({confirm:!1,cancel:!0})}})}))}({title:"提示",content:e,showCancel:h.retry,cancelText:"取消",confirmText:h.retry?"重试":"确定"});if(h.retry&&t)return a(...g)}}const t=new Be({subject:m,code:v,message:b,requestId:f.requestId});throw t.detail=f.result,Oe(_e,{type:Le,content:t}),t}return Oe(_e,{type:Le,content:f.result}),f.result},interceptorName:"callObject",getCallbackArgs:function({params:e}={}){return{objectName:i,methodName:p,params:e}}})}})}}(e)}(t),["callFunction","uploadFile","deleteFile","getTempFileURL","downloadFile","chooseAndUploadFile"].forEach((e=>{if(!t[e])return;const i=t[e];t[e]=function(){return i.apply(t,Array.from(arguments))},t[e]=function(e,t){return function(i){let o=!1;if("callFunction"===t){const e=i&&i.type||te;o=e!==te}const a="callFunction"===t&&!o,n=this._initPromiseHub.exec();i=i||{};const{success:r,fail:s,complete:l}=ze(i),c=n.then((()=>o?Promise.resolve():Se(we(t,"invoke"),i))).then((()=>e.call(this,i))).then((e=>o?Promise.resolve(e):Se(we(t,"success"),e).then((()=>Se(we(t,"complete"),e))).then((()=>(a&&Oe(_e,{type:De,content:e}),Promise.resolve(e))))),(e=>o?Promise.reject(e):Se(we(t,"fail"),e).then((()=>Se(we(t,"complete"),e))).then((()=>(Oe(_e,{type:De,content:e}),Promise.reject(e))))));if(!(r||s||l))return c;c.then((e=>{r&&r(e),l&&l(e),a&&Oe(_e,{type:De,content:e})}),(e=>{s&&s(e),l&&l(e),a&&Oe(_e,{type:De,content:e})}))}}(t[e],e).bind(t)})),t.init=this.init,t}};(()=>{const e=pe;let t={};if(e&&1===e.length)t=e[0],Do=Do.init(t),Do._isDefault=!0;else{const t=["auth","callFunction","uploadFile","deleteFile","getTempFileURL","downloadFile","database","getCurrentUSerInfo","importObject"];let i;i=e&&e.length>0?"应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间":"应用未关联服务空间,请在uniCloud目录右键关联服务空间",t.forEach((e=>{Do[e]=function(){return console.error(i),Promise.reject(new Be({code:"SYS_ERR",message:i}))}}))}Object.assign(Do,{get mixinDatacom(){return So(Do)}}),fo(Do),Do.addInterceptor=ve,Do.removeInterceptor=be,Do.interceptObject=Te})();var Lo=Do;const Io=G({components:{Loading1:G({name:"loading1",data:()=>({})},[["render",function(e,t,i,o,a,n){const r=I;return C(),k(r,{class:"container loading1"},{default:D((()=>[L(r,{class:"shape shape1"}),L(r,{class:"shape shape2"}),L(r,{class:"shape shape3"}),L(r,{class:"shape shape4"})])),_:1})}],["__scopeId","data-v-a16ea79e"]]),Loading2:G({name:"loading2",data:()=>({})},[["render",function(e,t,i,o,a,n){const r=I;return C(),k(r,{class:"container loading2"},{default:D((()=>[L(r,{class:"shape shape1"}),L(r,{class:"shape shape2"}),L(r,{class:"shape shape3"}),L(r,{class:"shape shape4"})])),_:1})}],["__scopeId","data-v-51d40d8b"]]),Loading3:G({name:"loading3",data:()=>({})},[["render",function(e,t,i,o,a,n){const r=I;return C(),k(r,{class:"container loading3"},{default:D((()=>[L(r,{class:"shape shape1"}),L(r,{class:"shape shape2"}),L(r,{class:"shape shape3"}),L(r,{class:"shape shape4"})])),_:1})}],["__scopeId","data-v-47408335"]]),Loading4:G({name:"loading5",data:()=>({})},[["render",function(e,t,i,o,a,n){const r=I;return C(),k(r,{class:"container loading5"},{default:D((()=>[L(r,{class:"shape shape1"}),L(r,{class:"shape shape2"}),L(r,{class:"shape shape3"}),L(r,{class:"shape shape4"})])),_:1})}],["__scopeId","data-v-49a6258a"]]),Loading5:G({name:"loading6",data:()=>({})},[["render",function(e,t,i,o,a,n){const r=I;return C(),k(r,{class:"container loading6"},{default:D((()=>[L(r,{class:"shape shape1"}),L(r,{class:"shape shape2"}),L(r,{class:"shape shape3"}),L(r,{class:"shape shape4"})])),_:1})}],["__scopeId","data-v-08a06125"]])},name:"qiun-loading",props:{loadingType:{type:Number,default:2}},data:()=>({})},[["render",function(e,t,i,o,a,n){const r=M("Loading1"),s=M("Loading2"),l=M("Loading3"),c=M("Loading4"),h=M("Loading5"),d=I;return C(),k(d,null,{default:D((()=>[1==i.loadingType?(C(),k(r,{key:0})):F("",!0),2==i.loadingType?(C(),k(s,{key:1})):F("",!0),3==i.loadingType?(C(),k(l,{key:2})):F("",!0),4==i.loadingType?(C(),k(c,{key:3})):F("",!0),5==i.loadingType?(C(),k(h,{key:4})):F("",!0)])),_:1})}]]);const Mo=G({name:"qiun-error",props:{errorMessage:{type:String,default:null}},data:()=>({})},[["render",function(e,t,i,o,a,n){const r=I;return C(),k(r,{class:"chartsview"},{default:D((()=>[L(r,{class:"charts-error"}),L(r,{class:"charts-font"},{default:D((()=>[O(E(null==i.errorMessage?"请点击重试":i.errorMessage),1)])),_:1})])),_:1})}],["__scopeId","data-v-af32de60"]]);var Fo={version:"v2.5.0-20230101",yAxisWidth:15,xAxisHeight:22,padding:[10,10,10,10],rotate:!1,fontSize:13,fontColor:"#666666",dataPointShape:["circle","circle","circle","circle"],color:["#1890FF","#91CB74","#FAC858","#EE6666","#73C0DE","#3CA272","#FC8452","#9A60B4","#ea7ccc"],linearColor:["#0EE2F8","#2BDCA8","#FA7D8D","#EB88E2","#2AE3A0","#0EE2F8","#EB88E2","#6773E3","#F78A85"],pieChartLinePadding:15,pieChartTextPadding:5,titleFontSize:20,subtitleFontSize:15,radarLabelTextMargin:13},Oo=function(e,...t){if(null==e)throw new TypeError("[uCharts] Cannot convert undefined or null to object");if(!t||t.length<=0)return e;function i(e,t){for(let o in t)e[o]=e[o]&&"[object Object]"===e[o].toString()?i(e[o],t[o]):e[o]=t[o];return e}return t.forEach((t=>{e=i(e,t)})),e},Eo={toFixed:function(e,t){return t=t||2,this.isFloat(e)&&(e=e.toFixed(t)),e},isFloat:function(e){return e%1!=0},approximatelyEqual:function(e,t){return Math.abs(e-t)<1e-10},isSameSign:function(e,t){return Math.abs(e)===e&&Math.abs(t)===t||Math.abs(e)!==e&&Math.abs(t)!==t},isSameXCoordinateArea:function(e,t){return this.isSameSign(e.x,t.x)},isCollision:function(e,t){return e.end={},e.end.x=e.start.x+e.width,e.end.y=e.start.y-e.height,t.end={},t.end.x=t.start.x+t.width,t.end.y=t.start.y-t.height,!(t.start.x>e.end.x||t.end.x<e.start.x||t.end.y>e.start.y||t.start.y<e.end.y)}};function Ro(e,t){var i=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,i,o){return t+t+i+i+o+o})),o=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(i);return"rgba("+parseInt(o[1],16)+","+parseInt(o[2],16)+","+parseInt(o[3],16)+","+t+")"}function No(e,t,i){if(isNaN(e))throw new Error("[uCharts] series数据需为Number格式");i=i||10,t=t||"upper";for(var o=1;i<1;)i*=10,o*=10;for(e="upper"===t?Math.ceil(e*o):Math.floor(e*o);e%i!=0;)if("upper"===t){if(e==e+1)break;e++}else e--;return e/o}function zo(e,t,i,o,a){var n=a.width-a.area[1]-a.area[3],r=i.eachSpacing*(a.chartData.xAxisData.xAxisPoints.length-1);"mount"==a.type&&a.extra&&a.extra.mount&&a.extra.mount.widthRatio&&a.extra.mount.widthRatio>1&&(a.extra.mount.widthRatio>2&&(a.extra.mount.widthRatio=2),r+=(a.extra.mount.widthRatio-1)*i.eachSpacing);var s=t;return t>=0?(s=0,e.uevent.trigger("scrollLeft"),e.scrollOption.position="left",a.xAxis.scrollPosition="left"):Math.abs(t)>=r-n?(s=n-r,e.uevent.trigger("scrollRight"),e.scrollOption.position="right",a.xAxis.scrollPosition="right"):(e.scrollOption.position=t,a.xAxis.scrollPosition=t),s}function Bo(e,t,i){function o(e){for(;e<0;)e+=2*Math.PI;for(;e>2*Math.PI;)e-=2*Math.PI;return e}return e=o(e),(t=o(t))>(i=o(i))&&(i+=2*Math.PI,e<t&&(e+=2*Math.PI)),e>=t&&e<=i}function Uo(e,t){function i(e,t){return!(!e[t-1]||!e[t+1])&&(e[t].y>=Math.max(e[t-1].y,e[t+1].y)||e[t].y<=Math.min(e[t-1].y,e[t+1].y))}function o(e,t){return!(!e[t-1]||!e[t+1])&&(e[t].x>=Math.max(e[t-1].x,e[t+1].x)||e[t].x<=Math.min(e[t-1].x,e[t+1].x))}var a=.2,n=.2,r=null,s=null,l=null,c=null;if(t<1?(r=e[0].x+(e[1].x-e[0].x)*a,s=e[0].y+(e[1].y-e[0].y)*a):(r=e[t].x+(e[t+1].x-e[t-1].x)*a,s=e[t].y+(e[t+1].y-e[t-1].y)*a),t>e.length-3){var h=e.length-1;l=e[h].x-(e[h].x-e[h-1].x)*n,c=e[h].y-(e[h].y-e[h-1].y)*n}else l=e[t+1].x-(e[t+2].x-e[t].x)*n,c=e[t+1].y-(e[t+2].y-e[t].y)*n;return i(e,t+1)&&(c=e[t+1].y),i(e,t)&&(s=e[t].y),o(e,t+1)&&(l=e[t+1].x),o(e,t)&&(r=e[t].x),(s>=Math.max(e[t].y,e[t+1].y)||s<=Math.min(e[t].y,e[t+1].y))&&(s=e[t].y),(c>=Math.max(e[t].y,e[t+1].y)||c<=Math.min(e[t].y,e[t+1].y))&&(c=e[t+1].y),(r>=Math.max(e[t].x,e[t+1].x)||r<=Math.min(e[t].x,e[t+1].x))&&(r=e[t].x),(l>=Math.max(e[t].x,e[t+1].x)||l<=Math.min(e[t].x,e[t+1].x))&&(l=e[t+1].x),{ctrA:{x:r,y:s},ctrB:{x:l,y:c}}}function Wo(e,t,i){return{x:i.x+e,y:i.y-t}}function jo(e,t){if(t)for(;Eo.isCollision(e,t);)e.start.x>0?e.start.y--:e.start.x<0||e.start.y>0?e.start.y++:e.start.y--;return e}function qo(e,t,i){for(var o=0,a=0;a<e.length;a++){let n=e[a];if(n.color||(n.color=i.color[o],o=(o+1)%i.color.length),n.linearIndex||(n.linearIndex=a),n.index||(n.index=0),n.type||(n.type=t.type),void 0===n.show&&(n.show=!0),n.type||(n.type=t.type),n.pointShape||(n.pointShape="circle"),!n.legendShape)switch(n.type){case"line":n.legendShape="line";break;case"column":case"bar":n.legendShape="rect";break;case"area":case"mount":n.legendShape="triangle";break;default:n.legendShape="circle"}}return e}function $o(e,t,i,o){var a=t||[];if("custom"==e&&0==a.length&&(a=o.linearColor),"custom"==e&&a.length<i.length){let e=i.length-a.length;for(var n=0;n<e;n++)a.push(o.linearColor[(n+1)%o.linearColor.length])}return a}function Ho(e,t,i){var o=0;if(e=String(e),!1!==i&&void 0!==i&&i.setFontSize&&i.measureText)return i.setFontSize(t),i.measureText(e).width;e=e.split("");for(let a=0;a<e.length;a++){let t=e[a];/[a-zA-Z]/.test(t)?o+=7:/[0-9]/.test(t)?o+=5.5:/\./.test(t)?o+=2.7:/-/.test(t)?o+=3.25:/:/.test(t)?o+=2.5:/[\u4e00-\u9fa5]/.test(t)?o+=10:/\(|\)/.test(t)?o+=3.73:/\s/.test(t)?o+=2.5:/%/.test(t)?o+=8:o+=10}return o*t/10}function Go(e){return e.reduce((function(e,t){return(e.data?e.data:e).concat(t.data)}),[])}function Jo(e,t){for(var i=new Array(t),o=0;o<i.length;o++)i[o]=0;for(var a=0;a<e.length;a++)for(o=0;o<i.length;o++)i[o]+=e[a].data[o];return e.reduce((function(e,t){return(e.data?e.data:e).concat(t.data).concat(i)}),[])}function Ko(e,t,i){let o,a;return e.clientX?t.rotate?(a=t.height-e.clientX*t.pix,o=(e.pageY-i.currentTarget.offsetTop-t.height/t.pix/2*(t.pix-1))*t.pix):(o=e.clientX*t.pix,a=(e.pageY-i.currentTarget.offsetTop-t.height/t.pix/2*(t.pix-1))*t.pix):t.rotate?(a=t.height-e.x*t.pix,o=e.y*t.pix):(o=e.x*t.pix,a=e.y*t.pix),{x:o,y:a}}function Xo(e,t,i){var o=[],a=[],n=t.constructor.toString().indexOf("Array")>-1;if(n){let t=ta(e);for(var r=0;r<i.length;r++)a.push(t[i[r]])}else a=e;for(let s=0;s<a.length;s++){let e=a[s],i=-1;if(i=n?t[s]:t,null!==e.data[i]&&void 0!==e.data[i]&&e.show){let t={};t.color=e.color,t.type=e.type,t.style=e.style,t.pointShape=e.pointShape,t.disableLegend=e.disableLegend,t.legendShape=e.legendShape,t.name=e.name,t.show=e.show,t.data=e.formatter?e.formatter(e.data[i]):e.data[i],o.push(t)}}return o}function Vo(e,t,i){var o=e.map((function(e){return Ho(e,t,i)}));return Math.max.apply(null,o)}function Yo(e){for(var t=2*Math.PI/e,i=[],o=0;o<e;o++)i.push(t*o);return i.map((function(e){return-1*e+Math.PI/2}))}function Qo(e,t,i,o,a){var n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},r=t.chartData.calPoints?t.chartData.calPoints:[];let s={};if(o.length>0){let e=[];for(let t=0;t<o.length;t++)e.push(r[o[t]]);s=e[0][i[0]]}else for(let h=0;h<r.length;h++)if(r[h][i]){s=r[h][i];break}var l=e.map((function(e){let o=null;return t.categories&&t.categories.length>0&&(o=a[i]),{text:n.formatter?n.formatter(e,o,i,t):e.name+": "+e.data,color:e.color,legendShape:"auto"==t.extra.tooltip.legendShape?e.legendShape:t.extra.tooltip.legendShape}})),c={x:Math.round(s.x),y:Math.round(s.y)};return{textList:l,offset:c}}function Zo(e,t,i,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},n=t.chartData.xAxisPoints[i]+t.chartData.eachSpacing/2,r=e.map((function(e){return{text:a.formatter?a.formatter(e,o[i],i,t):e.name+": "+e.data,color:e.color,disableLegend:!!e.disableLegend,legendShape:"auto"==t.extra.tooltip.legendShape?e.legendShape:t.extra.tooltip.legendShape}}));r=r.filter((function(e){if(!0!==e.disableLegend)return e}));var s={x:Math.round(n),y:0};return{textList:r,offset:s}}function ea(e,t,i,o,a,n){var r=i.chartData.calPoints;let s=n.color.upFill,l=n.color.downFill,c=[s,s,l,s];var h=[];t.map((function(t){0==o?t.data[1]-t.data[0]<0?c[1]=l:c[1]=s:(t.data[0]<e[o-1][1]&&(c[0]=l),t.data[1]<t.data[0]&&(c[1]=l),t.data[2]>e[o-1][1]&&(c[2]=s),t.data[3]<e[o-1][1]&&(c[3]=l));let a={text:"开盘:"+t.data[0],color:c[0],legendShape:"auto"==i.extra.tooltip.legendShape?t.legendShape:i.extra.tooltip.legendShape},n={text:"收盘:"+t.data[1],color:c[1],legendShape:"auto"==i.extra.tooltip.legendShape?t.legendShape:i.extra.tooltip.legendShape},r={text:"最低:"+t.data[2],color:c[2],legendShape:"auto"==i.extra.tooltip.legendShape?t.legendShape:i.extra.tooltip.legendShape},d={text:"最高:"+t.data[3],color:c[3],legendShape:"auto"==i.extra.tooltip.legendShape?t.legendShape:i.extra.tooltip.legendShape};h.push(a,n,r,d)}));var d=[],u={x:0,y:0};for(let p=0;p<r.length;p++){let e=r[p];void 0!==e[o]&&null!==e[o]&&d.push(e[o])}return u.x=Math.round(d[0][0].x),{textList:h,offset:u}}function ta(e){let t=[];for(let i=0;i<e.length;i++)1==e[i].show&&t.push(e[i]);return t}function ia(e,t,i){return e.x<=t.width-t.area[1]+10&&e.x>=t.area[3]-10&&e.y>=t.area[0]&&e.y<=t.height-t.area[2]}function oa(e,t,i){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)<=Math.pow(i,2)}function aa(e,t){var i=[],o=[];return e.forEach((function(e,a){t.connectNulls?null!==e&&o.push(e):null!==e?o.push(e):(o.length&&i.push(o),o=[])})),o.length&&i.push(o),i}function na(e,t,i,o,a){var n={angle:0,xAxisHeight:t.xAxis.lineHeight*t.pix+t.xAxis.marginTop*t.pix},r=t.xAxis.fontSize*t.pix,s=e.map((function(e,i){var o=t.xAxis.formatter?t.xAxis.formatter(e,i,t):e;return Ho(String(o),r,a)})),l=Math.max.apply(this,s);if(1==t.xAxis.rotateLabel){n.angle=t.xAxis.rotateAngle*Math.PI/180;let e=t.xAxis.marginTop*t.pix*2+Math.abs(l*Math.sin(n.angle));e=e<r+t.xAxis.marginTop*t.pix*2?e+t.xAxis.marginTop*t.pix*2:e,n.xAxisHeight=e}return t.enableScroll&&t.xAxis.scrollShow&&(n.xAxisHeight+=6*t.pix),t.xAxis.disabled&&(n.xAxisHeight=0),n}function ra(e,t,i,o){var a=Oo({},{type:""},t.extra.bar),n={angle:0,xAxisHeight:t.xAxis.lineHeight*t.pix+t.xAxis.marginTop*t.pix};n.ranges=function(e,t,i,o){var a,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;a="stack"==o?Jo(e,t.categories.length):Go(e);var r=[];(a=a.filter((function(e){return"object"==typeof e&&null!==e?e.constructor.toString().indexOf("Array")>-1?null!==e:null!==e.value:null!==e}))).map((function(e){"object"==typeof e?e.constructor.toString().indexOf("Array")>-1?"candle"==t.type?e.map((function(e){r.push(e)})):r.push(e[0]):r.push(e.value):r.push(e)}));var s=0,l=0;if(r.length>0&&(s=Math.min.apply(this,r),l=Math.max.apply(this,r)),n>-1?("number"==typeof t.xAxis.data[n].min&&(s=Math.min(t.xAxis.data[n].min,s)),"number"==typeof t.xAxis.data[n].max&&(l=Math.max(t.xAxis.data[n].max,l))):("number"==typeof t.xAxis.min&&(s=Math.min(t.xAxis.min,s)),"number"==typeof t.xAxis.max&&(l=Math.max(t.xAxis.max,l))),s===l){l+=l||10}for(var c=s,h=[],d=(l-c)/t.xAxis.splitNumber,u=0;u<=t.xAxis.splitNumber;u++)h.push(c+d*u);return h}(e,t,i,a.type),n.rangesFormat=n.ranges.map((function(e){return e=Eo.toFixed(e,2)}));var r=n.ranges.map((function(e){return e=Eo.toFixed(e,2)}));return(n=Object.assign(n,ba(r,t))).eachSpacing,r.map((function(e){return Ho(e,t.xAxis.fontSize*t.pix,o)})),!0===t.xAxis.disabled&&(n.xAxisHeight=0),n}function sa(e,t,i,o,a){var n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,r=a.extra.radar||{};r.max=r.max||0;var s=Math.max(r.max,Math.max.apply(null,Go(o))),l=[];for(let c=0;c<o.length;c++){let a=o[c],r={};r.color=a.color,r.legendShape=a.legendShape,r.pointShape=a.pointShape,r.data=[],a.data.forEach((function(o,a){let l={};l.angle=e[a],l.proportion=o/s,l.value=o,l.position=Wo(i*l.proportion*n*Math.cos(l.angle),i*l.proportion*n*Math.sin(l.angle),t),r.data.push(l)})),l.push(r)}return l}function la(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,o=0,a=0;for(let n=0;n<e.length;n++){let t=e[n];t.data=null===t.data?0:t.data,o+=t.data}for(let n=0;n<e.length;n++){let a=e[n];a.data=null===a.data?0:a.data,a._proportion_=0===o?1/e.length*i:a.data/o*i,a._radius_=t}for(let n=0;n<e.length;n++){let t=e[n];t._start_=a,a+=2*t._proportion_*Math.PI}return e}function ca(e,t,i,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;for(let n=0;n<e.length;n++)"funnel"==i.type?e[n].radius=e[n].data/e[0].data*t*a:e[n].radius=o*(e.length-n)/(o*e.length)*t*a,e[n]._proportion_=e[n].data/e[0].data;return e}function ha(e,t,i,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,n=0,r=0,s=[];for(let d=0;d<e.length;d++){let t=e[d];t.data=null===t.data?0:t.data,n+=t.data,s.push(t.data)}var l=Math.min.apply(null,s),c=Math.max.apply(null,s),h=o-i;for(let d=0;d<e.length;d++){let r=e[d];r.data=null===r.data?0:r.data,0===n?(r._proportion_=1/e.length*a,r._rose_proportion_=1/e.length*a):(r._proportion_=r.data/n*a,r._rose_proportion_="area"==t?1/e.length*a:r.data/n*a),r._radius_=i+h*((r.data-l)/(c-l))||o}for(let d=0;d<e.length;d++){let t=e[d];t._start_=r,r+=2*t._rose_proportion_*Math.PI}return e}function da(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;1==i&&(i=.999999);for(let o=0;o<e.length;o++){let a,n=e[o];n.data=null===n.data?0:n.data,a="circle"==t.type?2:"ccw"==t.direction?t.startAngle<t.endAngle?2+t.startAngle-t.endAngle:t.startAngle-t.endAngle:t.endAngle<t.startAngle?2+t.endAngle-t.startAngle:t.startAngle-t.endAngle,n._proportion_=a*n.data*i+t.startAngle,"ccw"==t.direction&&(n._proportion_=t.startAngle-a*n.data*i),n._proportion_>=2&&(n._proportion_=n._proportion_%2)}return e}function ua(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;1==i&&(i=.999999);for(let o=0;o<e.length;o++){let a,n=e[o];n.data=null===n.data?0:n.data,a="circle"==t.type?2:t.endAngle<t.startAngle?2+t.endAngle-t.startAngle:t.startAngle-t.endAngle,n._proportion_=a*n.data*i+t.startAngle,n._proportion_>=2&&(n._proportion_=n._proportion_%2)}return e}function pa(e,t,i){let o;o=i<t?2+i-t:t-i;let a=t;for(let n=0;n<e.length;n++)e[n].value=null===e[n].value?0:e[n].value,e[n]._startAngle_=a,e[n]._endAngle_=o*e[n].value+t,e[n]._endAngle_>=2&&(e[n]._endAngle_=e[n]._endAngle_%2),a=e[n]._endAngle_;return e}function ga(e,t,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;for(let a=0;a<e.length;a++){let n,r=e[a];if(r.data=null===r.data?0:r.data,"auto"==i.pointer.color){for(let e=0;e<t.length;e++)if(r.data<=t[e].value){r.color=t[e].color;break}}else r.color=i.pointer.color;n=i.endAngle<i.startAngle?2+i.endAngle-i.startAngle:i.startAngle-i.endAngle,r._endAngle_=n*r.data+i.startAngle,r._oldAngle_=i.oldAngle,i.oldAngle<i.endAngle&&(r._oldAngle_+=2),r.data>=i.oldData?r._proportion_=(r._endAngle_-r._oldAngle_)*o+i.oldAngle:r._proportion_=r._oldAngle_-(r._oldAngle_-r._endAngle_)*o,r._proportion_>=2&&(r._proportion_=r._proportion_%2)}return e}function fa(e,t,i,o,a,n){return e.map((function(e){if(null===e)return null;var a=0,r=0;return"mix"==n.type?(a=n.extra.mix.column.seriesGap*n.pix||0,r=n.extra.mix.column.categoryGap*n.pix||0):(a=n.extra.column.seriesGap*n.pix||0,r=n.extra.column.categoryGap*n.pix||0),a=Math.min(a,t/i),r=Math.min(r,t/i),e.width=Math.ceil((t-2*r-a*(i-1))/i),n.extra.mix&&n.extra.mix.column.width&&+n.extra.mix.column.width>0&&(e.width=Math.min(e.width,+n.extra.mix.column.width*n.pix)),n.extra.column&&n.extra.column.width&&+n.extra.column.width>0&&(e.width=Math.min(e.width,+n.extra.column.width*n.pix)),e.width<=0&&(e.width=1),e.x+=(o+.5-i/2)*(e.width+a),e}))}function xa(e,t,i,o,a,n){return e.map((function(e){if(null===e)return null;var a=0,r=0;return a=n.extra.bar.seriesGap*n.pix||0,r=n.extra.bar.categoryGap*n.pix||0,a=Math.min(a,t/i),r=Math.min(r,t/i),e.width=Math.ceil((t-2*r-a*(i-1))/i),n.extra.bar&&n.extra.bar.width&&+n.extra.bar.width>0&&(e.width=Math.min(e.width,+n.extra.bar.width*n.pix)),e.width<=0&&(e.width=1),e.y+=(o+.5-i/2)*(e.width+a),e}))}function ya(e,t,i,o,a,n,r){var s=n.extra.column.categoryGap*n.pix||0;return e.map((function(e){return null===e?null:(e.width=t-2*s,n.extra.column&&n.extra.column.width&&+n.extra.column.width>0&&(e.width=Math.min(e.width,+n.extra.column.width*n.pix)),o>0&&(e.width-=r),e)}))}function ma(e,t,i,o,a,n,r){var s=n.extra.column.categoryGap*n.pix||0;return e.map((function(e,i){return null===e?null:(e.width=Math.ceil(t-2*s),n.extra.column&&n.extra.column.width&&+n.extra.column.width>0&&(e.width=Math.min(e.width,+n.extra.column.width*n.pix)),e.width<=0&&(e.width=1),e)}))}function va(e,t,i,o,a,n,r){var s=n.extra.bar.categoryGap*n.pix||0;return e.map((function(e,i){return null===e?null:(e.width=Math.ceil(t-2*s),n.extra.bar&&n.extra.bar.width&&+n.extra.bar.width>0&&(e.width=Math.min(e.width,+n.extra.bar.width*n.pix)),e.width<=0&&(e.width=1),e)}))}function ba(e,t,i){var o=t.width-t.area[1]-t.area[3],a=t.enableScroll?Math.min(t.xAxis.itemCount,e.length):e.length;("line"==t.type||"area"==t.type||"scatter"==t.type||"bubble"==t.type||"bar"==t.type)&&a>1&&"justify"==t.xAxis.boundaryGap&&(a-=1);var n=0;"mount"==t.type&&t.extra&&t.extra.mount&&t.extra.mount.widthRatio&&t.extra.mount.widthRatio>1&&(t.extra.mount.widthRatio>2&&(t.extra.mount.widthRatio=2),a+=n=t.extra.mount.widthRatio-1);var r=o/a,s=[],l=t.area[3],c=t.width-t.area[1];return e.forEach((function(e,t){s.push(l+n/2*r+t*r)})),"justify"!==t.xAxis.boundaryGap&&(!0===t.enableScroll?s.push(l+n*r+e.length*r):s.push(c)),{xAxisPoints:s,startX:l,endX:c,eachSpacing:r}}function Sa(e,t,i,o,a,n,r){var s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1,l=[],c=n.height-n.area[0]-n.area[2];return e.forEach((function(e,r){if(null===e)l.push(null);else{var h=[];e.forEach((function(e,l){var d={};d.x=o[r]+Math.round(a/2);var u=e.value||e,p=c*(u-t)/(i-t);p*=s,d.y=n.height-Math.round(p)-n.area[2],h.push(d)})),l.push(h)}})),l}function wa(e,t,i,o,a,n,r){var s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1,l="center";"line"!=n.type&&"area"!=n.type&&"scatter"!=n.type&&"bubble"!=n.type||(l=n.xAxis.boundaryGap);var c=[],h=n.height-n.area[0]-n.area[2],d=n.width-n.area[1]-n.area[3];return e.forEach((function(e,r){if(null===e)c.push(null);else{var u={};u.color=e.color,u.x=o[r];var p=e;if("object"==typeof e&&null!==e)if(e.constructor.toString().indexOf("Array")>-1){let t,i,o;t=[].concat(n.chartData.xAxisData.ranges),i=t.shift(),o=t.pop(),p=e[1],u.x=n.area[3]+d*(e[0]-i)/(o-i),"bubble"==n.type&&(u.r=e[2],u.t=e[3])}else p=e.value;"center"==l&&(u.x+=a/2);var g=h*(p-t)/(i-t);g*=s,u.y=n.height-g-n.area[2],c.push(u)}})),c}function Ta(e,t,i,o,a,n,r,s,l){l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1;var c=n.xAxis.boundaryGap,h=[],d=n.height-n.area[0]-n.area[2],u=n.width-n.area[1]-n.area[3];return e.forEach((function(e,r){if(null===e)h.push(null);else{var p={};if(p.color=e.color,"vertical"==s.animation){p.x=o[r];var g=e;if("object"==typeof e&&null!==e)if(e.constructor.toString().indexOf("Array")>-1){let t,i,o;t=[].concat(n.chartData.xAxisData.ranges),i=t.shift(),o=t.pop(),g=e[1],p.x=n.area[3]+u*(e[0]-i)/(o-i)}else g=e.value;"center"==c&&(p.x+=a/2);var f=d*(g-t)/(i-t);f*=l,p.y=n.height-f-n.area[2],h.push(p)}else{p.x=o[0]+a*r*l;g=e;"center"==c&&(p.x+=a/2);f=d*(g-t)/(i-t);p.y=n.height-f-n.area[2],h.push(p)}}})),h}function Aa(e,t,i,o,a,n,r,s,l){l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1;var c=[],h=n.height-n.area[0]-n.area[2],d=n.width-n.area[1]-n.area[3];return e.forEach((function(e,r){if(null===e)c.push(null);else{var s={};s.color=e.color,s.x=o[r];var u=e;if("object"==typeof e&&null!==e)if(e.constructor.toString().indexOf("Array")>-1){let t,i,o;t=[].concat(n.chartData.xAxisData.ranges),i=t.shift(),o=t.pop(),u=e[1],s.x=n.area[3]+d*(e[0]-i)/(o-i)}else u=e.value;s.x+=a/2;var p=h*(u*l-t)/(i-t);s.y=n.height-p-n.area[2],c.push(s)}})),c}function _a(e,t,i,o,a,n,r,s){var l=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1,c=[],h=n.height-n.area[0]-n.area[2];n.width,n.area[1],n.area[3];var d=a*r.widthRatio;return e.forEach((function(e,r){if(null===e)c.push(null);else{var s={};s.color=e.color,s.x=o[r],s.x+=a/2;var u=e.data,p=h*(u*l-t)/(i-t);s.y=n.height-p-n.area[2],s.value=u,s.width=d,c.push(s)}})),c}function Pa(e,t,i,o,a,n,r){var s=arguments.length>7&&void 0!==arguments[7]?arguments[7]:1,l=[];n.height,n.area[0],n.area[2];var c=n.width-n.area[1]-n.area[3];return e.forEach((function(e,a){if(null===e)l.push(null);else{var r={};r.color=e.color,r.y=o[a];var h=e;"object"==typeof e&&null!==e&&(h=e.value);var d=c*(h-t)/(i-t);d*=s,r.height=d,r.value=h,r.x=d+n.area[3],l.push(r)}})),l}function Ca(e,t,i,o,a,n,r,s,l){var c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:1,h=[],d=n.height-n.area[0]-n.area[2];return e.forEach((function(e,r){if(null===e)h.push(null);else{var u={};if(u.color=e.color,u.x=o[r]+Math.round(a/2),s>0){var p=0;for(let e=0;e<=s;e++)p+=l[e].data[r];var g=d*(p-t)/(i-t),f=d*(p-e-t)/(i-t)}else{p=e;"object"==typeof e&&null!==e&&(p=e.value);g=d*(p-t)/(i-t),f=0}var x=f;g*=c,x*=c,u.y=n.height-Math.round(g)-n.area[2],u.y0=n.height-Math.round(x)-n.area[2],h.push(u)}})),h}function ka(e,t,i,o,a,n,r,s,l){var c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:1,h=[],d=n.width-n.area[1]-n.area[3];return e.forEach((function(e,a){if(null===e)h.push(null);else{var r={};if(r.color=e.color,r.y=o[a],s>0){var u=0;for(let e=0;e<=s;e++)u+=l[e].data[a];var p=d*(u-t)/(i-t),g=d*(u-e-t)/(i-t)}else{u=e;"object"==typeof e&&null!==e&&(u=e.value);p=d*(u-t)/(i-t),g=0}var f=g;p*=c,f*=c,r.height=p-f,r.x=n.area[3]+p,r.x0=n.area[3]+f,h.push(r)}})),h}function Da(e,t,i,o,a){var n;n="stack"==o?Jo(e,t.categories.length):Go(e);var r=[];(n=n.filter((function(e){return"object"==typeof e&&null!==e?e.constructor.toString().indexOf("Array")>-1?null!==e:null!==e.value:null!==e}))).map((function(e){"object"==typeof e?e.constructor.toString().indexOf("Array")>-1?"candle"==t.type?e.map((function(e){r.push(e)})):r.push(e[1]):r.push(e.value):r.push(e)}));var s=a.min||0,l=a.max||0;r.length>0&&(s=Math.min.apply(this,r),l=Math.max.apply(this,r)),s===l&&(0==l?l=10:s=0);for(var c=function(e,t){var i=0,o=t-e;return{minRange:No(e,"lower",i=o>=1e4?1e3:o>=1e3?100:o>=100?10:o>=10?5:o>=1?1:o>=.1?.1:o>=.01?.01:o>=.001?.001:o>=1e-4?1e-4:o>=1e-5?1e-5:1e-6),maxRange:No(t,"upper",i)}}(s,l),h=void 0===a.min||null===a.min?c.minRange:a.min,d=((void 0===a.max||null===a.max?c.maxRange:a.max)-h)/t.yAxis.splitNumber,u=[],p=0;p<=t.yAxis.splitNumber;p++)u.push(h+d*p);return u.reverse()}function La(e,t,i,o){var a=Oo({},{type:""},t.extra.column),n=t.yAxis.data.length,r=new Array(n);if(n>0){for(let t=0;t<n;t++){r[t]=[];for(let i=0;i<e.length;i++)e[i].index==t&&r[t].push(e[i])}var s=new Array(n),l=new Array(n),c=new Array(n);for(let e=0;e<n;e++){let n=t.yAxis.data[e];1==t.yAxis.disabled&&(n.disabled=!0),"categories"===n.type?(n.formatter||(n.formatter=(e,t,i)=>e+(n.unit||"")),n.categories=n.categories||t.categories,s[e]=n.categories):(n.formatter||(n.formatter=(e,t,i)=>Eo.toFixed(e,n.tofix||0)+(n.unit||"")),s[e]=Da(r[e],t,0,a.type,n));let h=n.fontSize*t.pix||i.fontSize;c[e]={position:n.position?n.position:"left",width:0},l[e]=s[e].map((function(i,a){return i=n.formatter(i,a,t),c[e].width=Math.max(c[e].width,Ho(i,h,o)+5),i}));let d=n.calibration?4*t.pix:0;c[e].width+=d+3*t.pix,!0===n.disabled&&(c[e].width=0)}}else{s=new Array(1),l=new Array(1),c=new Array(1);"bar"===t.type?(s[0]=t.categories,t.yAxis.formatter||(t.yAxis.formatter=(e,t,i)=>e+(i.yAxis.unit||""))):(t.yAxis.formatter||(t.yAxis.formatter=(e,t,i)=>e.toFixed(i.yAxis.tofix)+(i.yAxis.unit||"")),s[0]=Da(e,t,0,a.type,{})),c[0]={position:"left",width:0};var h=t.yAxis.fontSize*t.pix||i.fontSize;l[0]=s[0].map((function(e,i){return e=t.yAxis.formatter(e,i,t),c[0].width=Math.max(c[0].width,Ho(e,h,o)+5),e})),c[0].width+=3*t.pix,!0===t.yAxis.disabled?(c[0]={position:"left",width:0},t.yAxis.data[0]={disabled:!0}):(t.yAxis.data[0]={disabled:!1,position:"left",max:t.yAxis.max,min:t.yAxis.min,formatter:t.yAxis.formatter},"bar"===t.type&&(t.yAxis.data[0].categories=t.categories,t.yAxis.data[0].type="categories"))}return{rangesFormat:l,ranges:s,yAxisWidth:c}}function Ia(e,t){!0!==t.rotateLock?(e.translate(t.height,0),e.rotate(90*Math.PI/180)):!0!==t._rotate_&&(e.translate(t.height,0),e.rotate(90*Math.PI/180),t._rotate_=!0)}function Ma(e,t,i,o,a){if(o.beginPath(),"hollow"==a.dataPointShapeType?(o.setStrokeStyle(t),o.setFillStyle(a.background),o.setLineWidth(2*a.pix)):(o.setStrokeStyle("#ffffff"),o.setFillStyle(t),o.setLineWidth(1*a.pix)),"diamond"===i)e.forEach((function(e,t){null!==e&&(o.moveTo(e.x,e.y-4.5),o.lineTo(e.x-4.5,e.y),o.lineTo(e.x,e.y+4.5),o.lineTo(e.x+4.5,e.y),o.lineTo(e.x,e.y-4.5))}));else if("circle"===i)e.forEach((function(e,t){null!==e&&(o.moveTo(e.x+2.5*a.pix,e.y),o.arc(e.x,e.y,3*a.pix,0,2*Math.PI,!1))}));else if("square"===i)e.forEach((function(e,t){null!==e&&(o.moveTo(e.x-3.5,e.y-3.5),o.rect(e.x-3.5,e.y-3.5,7,7))}));else if("triangle"===i)e.forEach((function(e,t){null!==e&&(o.moveTo(e.x,e.y-4.5),o.lineTo(e.x-4.5,e.y+4.5),o.lineTo(e.x+4.5,e.y+4.5),o.lineTo(e.x,e.y-4.5))}));else if("none"===i)return;o.closePath(),o.fill(),o.stroke()}function Fa(e,t,i,o,a,n,r){if(a.tooltip&&!(a.tooltip.group.length>0&&0==a.tooltip.group.includes(r))){var s="number"==typeof a.tooltip.index?a.tooltip.index:a.tooltip.index[a.tooltip.group.indexOf(r)];if(o.beginPath(),"hollow"==n.activeType?(o.setStrokeStyle(t),o.setFillStyle(a.background),o.setLineWidth(2*a.pix)):(o.setStrokeStyle("#ffffff"),o.setFillStyle(t),o.setLineWidth(1*a.pix)),"diamond"===i)e.forEach((function(e,t){null!==e&&s==t&&(o.moveTo(e.x,e.y-4.5),o.lineTo(e.x-4.5,e.y),o.lineTo(e.x,e.y+4.5),o.lineTo(e.x+4.5,e.y),o.lineTo(e.x,e.y-4.5))}));else if("circle"===i)e.forEach((function(e,t){null!==e&&s==t&&(o.moveTo(e.x+2.5*a.pix,e.y),o.arc(e.x,e.y,3*a.pix,0,2*Math.PI,!1))}));else if("square"===i)e.forEach((function(e,t){null!==e&&s==t&&(o.moveTo(e.x-3.5,e.y-3.5),o.rect(e.x-3.5,e.y-3.5,7,7))}));else if("triangle"===i)e.forEach((function(e,t){null!==e&&s==t&&(o.moveTo(e.x,e.y-4.5),o.lineTo(e.x-4.5,e.y+4.5),o.lineTo(e.x+4.5,e.y+4.5),o.lineTo(e.x,e.y-4.5))}));else if("none"===i)return;o.closePath(),o.fill(),o.stroke()}}function Oa(e,t,i,o){var a=e.title.fontSize||t.titleFontSize,n=e.subtitle.fontSize||t.subtitleFontSize,r=e.title.name||"",s=e.subtitle.name||"",l=e.title.color||e.fontColor,c=e.subtitle.color||e.fontColor,h=r?a:0,d=s?n:0;if(s){var u=Ho(s,n*e.pix,i),p=o.x-u/2+(e.subtitle.offsetX||0)*e.pix,g=o.y+n*e.pix/2+(e.subtitle.offsetY||0)*e.pix;r&&(g+=(h*e.pix+5)/2),i.beginPath(),i.setFontSize(n*e.pix),i.setFillStyle(c),i.fillText(s,p,g),i.closePath(),i.stroke()}if(r){var f=Ho(r,a*e.pix,i),x=o.x-f/2+(e.title.offsetX||0),y=o.y+a*e.pix/2+(e.title.offsetY||0)*e.pix;s&&(y-=(d*e.pix+5)/2),i.beginPath(),i.setFontSize(a*e.pix),i.setFillStyle(l),i.fillText(r,x,y),i.closePath(),i.stroke()}}function Ea(e,t,i,o,a){var n=t.data,r=t.textOffset?t.textOffset:0;e.forEach((function(e,s){if(null!==e){o.beginPath();var l=t.textSize?t.textSize*a.pix:i.fontSize;o.setFontSize(l),o.setFillStyle(t.textColor||a.fontColor);var c=n[s];"object"==typeof n[s]&&null!==n[s]&&(c=n[s].constructor.toString().indexOf("Array")>-1?n[s][1]:n[s].value);var h=t.formatter?t.formatter(c,s,t,a):c;o.setTextAlign("center"),o.fillText(String(h),e.x,e.y-4+r*a.pix),o.closePath(),o.stroke(),o.setTextAlign("left")}}))}function Ra(e,t,i,o,a){var n=t.data,r=t.textOffset?t.textOffset:0,s=a.extra.column.labelPosition;e.forEach((function(e,l){if(null!==e){o.beginPath();var c=t.textSize?t.textSize*a.pix:i.fontSize;o.setFontSize(c),o.setFillStyle(t.textColor||a.fontColor);var h=n[l];"object"==typeof n[l]&&null!==n[l]&&(h=n[l].constructor.toString().indexOf("Array")>-1?n[l][1]:n[l].value);var d=t.formatter?t.formatter(h,l,t,a):h;o.setTextAlign("center");var u=e.y-4*a.pix+r*a.pix;e.y>t.zeroPoints&&(u=e.y+r*a.pix+c),"insideTop"==s&&(u=e.y+c+r*a.pix,e.y>t.zeroPoints&&(u=e.y-r*a.pix-4*a.pix)),"center"==s&&(u=e.y+r*a.pix+(a.height-a.area[2]-e.y+c)/2,t.zeroPoints<a.height-a.area[2]&&(u=e.y+r*a.pix+(t.zeroPoints-e.y+c)/2),e.y>t.zeroPoints&&(u=e.y-r*a.pix-(e.y-t.zeroPoints-c)/2),"stack"==a.extra.column.type&&(u=e.y+r*a.pix+(e.y0-e.y+c)/2)),"bottom"==s&&(u=a.height-a.area[2]+r*a.pix-4*a.pix,t.zeroPoints<a.height-a.area[2]&&(u=t.zeroPoints+r*a.pix-4*a.pix),e.y>t.zeroPoints&&(u=t.zeroPoints-r*a.pix+c+2*a.pix),"stack"==a.extra.column.type&&(u=e.y0+r*a.pix-4*a.pix)),o.fillText(String(d),e.x,u),o.closePath(),o.stroke(),o.setTextAlign("left")}}))}function Na(e,t,i,o,a,n){t.data;var r=t.textOffset?t.textOffset:0;a.extra.mount.labelPosition,e.forEach((function(e,s){if(null!==e){o.beginPath();var l=t[s].textSize?t[s].textSize*a.pix:i.fontSize;o.setFontSize(l),o.setFillStyle(t[s].textColor||a.fontColor);var c=e.value,h=t[s].formatter?t[s].formatter(c,s,t,a):c;o.setTextAlign("center");var d=e.y-4*a.pix+r*a.pix;e.y>n&&(d=e.y+r*a.pix+l),o.fillText(String(h),e.x,d),o.closePath(),o.stroke(),o.setTextAlign("left")}}))}function za(e,t,i,o,a){var n=t.data;t.textOffset&&t.textOffset,e.forEach((function(e,r){if(null!==e){o.beginPath();var s=t.textSize?t.textSize*a.pix:i.fontSize;o.setFontSize(s),o.setFillStyle(t.textColor||a.fontColor);var l=n[r];"object"==typeof n[r]&&null!==n[r]&&(l=n[r].value);var c=t.formatter?t.formatter(l,r,t,a):l;o.setTextAlign("left"),o.fillText(String(c),e.x+4*a.pix,e.y+s/2-3),o.closePath(),o.stroke()}}))}function Ba(e,t,i,o,a,n){let r;t=(t-=e.width/2+e.labelOffset*o.pix)<10?10:t,r=e.endAngle<e.startAngle?2+e.endAngle-e.startAngle:e.startAngle-e.endAngle;let s=r/e.splitLine.splitNumber,l=(e.endNumber-e.startNumber)/e.splitLine.splitNumber,c=e.startAngle,h=e.startNumber;for(let f=0;f<e.splitLine.splitNumber+1;f++){var d={x:t*Math.cos(c*Math.PI),y:t*Math.sin(c*Math.PI)},u=e.formatter?e.formatter(h,f,o):h;d.x+=i.x-Ho(u,a.fontSize,n)/2,d.y+=i.y;var p=d.x,g=d.y;n.beginPath(),n.setFontSize(a.fontSize),n.setFillStyle(e.labelColor||o.fontColor),n.fillText(u,p,g+a.fontSize/2),n.closePath(),n.stroke(),c+=s,c>=2&&(c%=2),h+=l}}function Ua(e,t,i,o,a,n){var r=o.extra.radar||{};e.forEach((function(e,s){if(!0===r.labelPointShow&&""!==o.categories[s]){var l={x:t*Math.cos(e),y:t*Math.sin(e)},c=Wo(l.x,l.y,i);n.setFillStyle(r.labelPointColor),n.beginPath(),n.arc(c.x,c.y,r.labelPointRadius*o.pix,0,2*Math.PI,!1),n.closePath(),n.fill()}if(!0===r.labelShow){var h={x:(t+a.radarLabelTextMargin*o.pix)*Math.cos(e),y:(t+a.radarLabelTextMargin*o.pix)*Math.sin(e)},d=Wo(h.x,h.y,i),u=d.x,p=d.y;Eo.approximatelyEqual(h.x,0)?u-=Ho(o.categories[s]||"",a.fontSize,n)/2:h.x<0&&(u-=Ho(o.categories[s]||"",a.fontSize,n)),n.beginPath(),n.setFontSize(a.fontSize),n.setFillStyle(r.labelColor||o.fontColor),n.fillText(o.categories[s]||"",u,p+a.fontSize/2),n.closePath(),n.stroke()}}))}function Wa(e,t,i,o,a,n){var r=i.pieChartLinePadding,s=[],l=null,c=e.map((function(i,o){var a=i.formatter?i.formatter(i,o,e,t):Eo.toFixed(100*i._proportion_.toFixed(4))+"%";a=i.labelText?i.labelText:a;var n=2*Math.PI-(i._start_+2*Math.PI*i._proportion_/2);return i._rose_proportion_&&(n=2*Math.PI-(i._start_+2*Math.PI*i._rose_proportion_/2)),{arc:n,text:a,color:i.color,radius:i._radius_,textColor:i.textColor,textSize:i.textSize,labelShow:i.labelShow}}));for(let h=0;h<c.length;h++){let e=c[h],a=Math.cos(e.arc)*(e.radius+r),n=Math.sin(e.arc)*(e.radius+r),d=Math.cos(e.arc)*e.radius,u=Math.sin(e.arc)*e.radius,p=a>=0?a+i.pieChartTextPadding:a-i.pieChartTextPadding,g=n,f=Ho(e.text,e.textSize*t.pix||i.fontSize,o),x=g;l&&Eo.isSameXCoordinateArea(l.start,{x:p})&&(x=p>0?Math.min(g,l.start.y):a<0||g>0?Math.max(g,l.start.y):Math.min(g,l.start.y)),p<0&&(p-=f),l=jo({lineStart:{x:d,y:u},lineEnd:{x:a,y:n},start:{x:p,y:x},width:f,height:i.fontSize,text:e.text,color:e.color,textColor:e.textColor,textSize:e.textSize},l),s.push(l)}for(let h=0;h<s.length;h++){if(!1===c[h].labelShow)continue;let e=s[h],a=Wo(e.lineStart.x,e.lineStart.y,n),r=Wo(e.lineEnd.x,e.lineEnd.y,n),l=Wo(e.start.x,e.start.y,n);o.setLineWidth(1*t.pix),o.setFontSize(e.textSize*t.pix||i.fontSize),o.beginPath(),o.setStrokeStyle(e.color),o.setFillStyle(e.color),o.moveTo(a.x,a.y);let d=e.start.x<0?l.x+e.width:l.x,u=e.start.x<0?l.x-5:l.x+5;o.quadraticCurveTo(r.x,r.y,d,l.y),o.moveTo(a.x,a.y),o.stroke(),o.closePath(),o.beginPath(),o.moveTo(l.x+e.width,l.y),o.arc(d,l.y,2*t.pix,0,2*Math.PI),o.closePath(),o.fill(),o.beginPath(),o.setFontSize(e.textSize*t.pix||i.fontSize),o.setFillStyle(e.textColor||t.fontColor),o.fillText(e.text,u,l.y+3),o.closePath(),o.stroke(),o.closePath()}}function ja(e,t,i){let o=Oo({},{type:"solid",dashLength:4,data:[]},e.extra.markLine),a=e.area[3],n=e.width-e.area[1],r=function(e,t){let i,o,a=t.height-t.area[0]-t.area[2];for(let n=0;n<e.length;n++){e[n].yAxisIndex=e[n].yAxisIndex?e[n].yAxisIndex:0;let r=[].concat(t.chartData.yAxisData.ranges[e[n].yAxisIndex]);i=r.pop(),o=r.shift();let s=a*(e[n].value-i)/(o-i);e[n].y=t.height-Math.round(s)-t.area[2]}return e}(o.data,e);for(let s=0;s<r.length;s++){let t=Oo({},{lineColor:"#DE4A42",showLabel:!1,labelFontSize:13,labelPadding:6,labelFontColor:"#666666",labelBgColor:"#DFE8FF",labelBgOpacity:.8,labelAlign:"left",labelOffsetX:0,labelOffsetY:0},r[s]);if("dash"==o.type&&i.setLineDash([o.dashLength,o.dashLength]),i.setStrokeStyle(t.lineColor),i.setLineWidth(1*e.pix),i.beginPath(),i.moveTo(a,t.y),i.lineTo(n,t.y),i.stroke(),i.setLineDash([]),t.showLabel){let o=t.labelFontSize*e.pix,a=t.labelText?t.labelText:t.value;i.setFontSize(o);let n=Ho(a,o,i)+t.labelPadding*e.pix*2,r="left"==t.labelAlign?e.area[3]-n:e.width-e.area[1];r+=t.labelOffsetX;let s=t.y-.5*o-t.labelPadding*e.pix;s+=t.labelOffsetY;let l=r+t.labelPadding*e.pix;t.y,i.setFillStyle(Ro(t.labelBgColor,t.labelBgOpacity)),i.setStrokeStyle(t.labelBgColor),i.setLineWidth(1*e.pix),i.beginPath(),i.rect(r,s,n,o+2*t.labelPadding*e.pix),i.closePath(),i.stroke(),i.fill(),i.setFontSize(o),i.setTextAlign("left"),i.setFillStyle(t.labelFontColor),i.fillText(String(a),l,s+o+t.labelPadding*e.pix/2),i.stroke(),i.setTextAlign("left")}}}function qa(e,t,i,o,a){var n=Oo({},{gridType:"solid",dashLength:4},e.extra.tooltip),r=e.area[3],s=e.width-e.area[1];if("dash"==n.gridType&&i.setLineDash([n.dashLength,n.dashLength]),i.setStrokeStyle(n.gridColor||"#cccccc"),i.setLineWidth(1*e.pix),i.beginPath(),i.moveTo(r,e.tooltip.offset.y),i.lineTo(s,e.tooltip.offset.y),i.stroke(),i.setLineDash([]),n.yAxisLabel){let o=n.boxPadding*e.pix,a=function(e,t,i,o,a){let n=[].concat(i.chartData.yAxisData.ranges),r=i.height-i.area[0]-i.area[2],s=i.area[0],l=[];for(let c=0;c<n.length;c++){let t=Math.max.apply(this,n[c]),o=t-(t-Math.min.apply(this,n[c]))*(e-s)/r;o=i.yAxis.data&&i.yAxis.data[c].formatter?i.yAxis.data[c].formatter(o,c,i):o.toFixed(0),l.push(String(o))}return l}(e.tooltip.offset.y,e.series,e),r=e.chartData.yAxisData.yAxisWidth,s=e.area[3],l=e.width-e.area[1];for(let c=0;c<a.length;c++){i.setFontSize(n.fontSize*e.pix);let h,d,u,p=Ho(a[c],n.fontSize*e.pix,i);"left"==r[c].position?(h=s-(p+2*o)-2*e.pix,d=Math.max(h,h+p+2*o)):(h=l+2*e.pix,d=Math.max(h+r[c].width,h+p+2*o)),u=d-h;let g=h+(u-p)/2,f=e.tooltip.offset.y;i.beginPath(),i.setFillStyle(Ro(n.labelBgColor||t.toolTipBackground,n.labelBgOpacity||t.toolTipOpacity)),i.setStrokeStyle(n.labelBgColor||t.toolTipBackground),i.setLineWidth(1*e.pix),i.rect(h,f-.5*t.fontSize-o,u,t.fontSize+2*o),i.closePath(),i.stroke(),i.fill(),i.beginPath(),i.setFontSize(t.fontSize),i.setFillStyle(n.labelFontColor||e.fontColor),i.fillText(a[c],g,f+.5*t.fontSize),i.closePath(),i.stroke(),"left"==r[c].position?s-=r[c].width+e.yAxis.padding*e.pix:l+=r[c].width+e.yAxis.padding*e.pix}}}function $a(e,t,i,o,a){var n=Oo({},{activeBgColor:"#000000",activeBgOpacity:.08,activeWidth:a},t.extra.column);n.activeWidth=n.activeWidth>a?a:n.activeWidth;var r=t.area[0],s=t.height-t.area[2];o.beginPath(),o.setFillStyle(Ro(n.activeBgColor,n.activeBgOpacity)),o.rect(e-n.activeWidth/2,r,n.activeWidth,s-r),o.closePath(),o.fill(),o.setFillStyle("#FFFFFF")}function Ha(e,t,i,o,a){var n=Oo({},{activeBgColor:"#000000",activeBgOpacity:.08},t.extra.bar),r=t.area[3],s=t.width-t.area[1];o.beginPath(),o.setFillStyle(Ro(n.activeBgColor,n.activeBgOpacity)),o.rect(r,e-a/2,s-r,a),o.closePath(),o.fill(),o.setFillStyle("#FFFFFF")}function Ga(e,t,i,o,a,n,r){var s=Oo({},{showBox:!0,showArrow:!0,showCategory:!1,bgColor:"#000000",bgOpacity:.7,borderColor:"#000000",borderWidth:0,borderRadius:0,borderOpacity:.7,boxPadding:3,fontColor:"#FFFFFF",fontSize:13,lineHeight:20,legendShow:!0,legendShape:"auto",splitLine:!0},i.extra.tooltip);1==s.showCategory&&i.categories&&e.unshift({text:i.categories[i.tooltip.index],color:null});var l=s.fontSize*i.pix,c=s.lineHeight*i.pix,h=s.boxPadding*i.pix,d=l,u=5*i.pix;0==s.legendShow&&(d=0,u=0);var p=s.showArrow?8*i.pix:0,g=!1;"line"!=i.type&&"mount"!=i.type&&"area"!=i.type&&"candle"!=i.type&&"mix"!=i.type||1==s.splitLine&&function(e,t,i,o){var a=t.extra.tooltip||{};a.gridType=null==a.gridType?"solid":a.gridType,a.dashLength=null==a.dashLength?4:a.dashLength;var n=t.area[0],r=t.height-t.area[2];if("dash"==a.gridType&&o.setLineDash([a.dashLength,a.dashLength]),o.setStrokeStyle(a.gridColor||"#cccccc"),o.setLineWidth(1*t.pix),o.beginPath(),o.moveTo(e,n),o.lineTo(e,r),o.stroke(),o.setLineDash([]),a.xAxisLabel){let n=t.categories[t.tooltip.index];o.setFontSize(i.fontSize);let s=Ho(n,i.fontSize,o),l=e-.5*s,c=r+2*t.pix;o.beginPath(),o.setFillStyle(Ro(a.labelBgColor||i.toolTipBackground,a.labelBgOpacity||i.toolTipOpacity)),o.setStrokeStyle(a.labelBgColor||i.toolTipBackground),o.setLineWidth(1*t.pix),o.rect(l-a.boxPadding*t.pix,c,s+2*a.boxPadding*t.pix,i.fontSize+2*a.boxPadding*t.pix),o.closePath(),o.stroke(),o.fill(),o.beginPath(),o.setFontSize(i.fontSize),o.setFillStyle(a.labelFontColor||t.fontColor),o.fillText(String(n),l,c+a.boxPadding*t.pix+i.fontSize),o.closePath(),o.stroke()}}(i.tooltip.offset.x,i,o,a),(t=Oo({x:0,y:0},t)).y-=8*i.pix;var f=e.map((function(e){return Ho(e.text,l,a)})),x=d+u+4*h+Math.max.apply(null,f),y=2*h+e.length*c;if(0!=s.showBox){t.x-Math.abs(i._scrollDistance_||0)+p+x>i.width&&(g=!0),y+t.y>i.height&&(t.y=i.height-y),a.beginPath(),a.setFillStyle(Ro(s.bgColor,s.bgOpacity)),a.setLineWidth(s.borderWidth*i.pix),a.setStrokeStyle(Ro(s.borderColor,s.borderOpacity));var m=s.borderRadius;g?(x+p>i.width&&(t.x=i.width+Math.abs(i._scrollDistance_||0)+p+(x-i.width)),x>t.x&&(t.x=i.width+Math.abs(i._scrollDistance_||0)+p+(x-i.width)),s.showArrow&&(a.moveTo(t.x,t.y+10*i.pix),a.lineTo(t.x-p,t.y+10*i.pix+5*i.pix)),a.arc(t.x-p-m,t.y+y-m,m,0,Math.PI/2,!1),a.arc(t.x-p-Math.round(x)+m,t.y+y-m,m,Math.PI/2,Math.PI,!1),a.arc(t.x-p-Math.round(x)+m,t.y+m,m,-Math.PI,-Math.PI/2,!1),a.arc(t.x-p-m,t.y+m,m,-Math.PI/2,0,!1),s.showArrow&&(a.lineTo(t.x-p,t.y+10*i.pix-5*i.pix),a.lineTo(t.x,t.y+10*i.pix))):(s.showArrow&&(a.moveTo(t.x,t.y+10*i.pix),a.lineTo(t.x+p,t.y+10*i.pix-5*i.pix)),a.arc(t.x+p+m,t.y+m,m,-Math.PI,-Math.PI/2,!1),a.arc(t.x+p+Math.round(x)-m,t.y+m,m,-Math.PI/2,0,!1),a.arc(t.x+p+Math.round(x)-m,t.y+y-m,m,0,Math.PI/2,!1),a.arc(t.x+p+m,t.y+y-m,m,Math.PI/2,Math.PI,!1),s.showArrow&&(a.lineTo(t.x+p,t.y+10*i.pix+5*i.pix),a.lineTo(t.x,t.y+10*i.pix))),a.closePath(),a.fill(),s.borderWidth>0&&a.stroke(),s.legendShow&&e.forEach((function(e,o){if(null!==e.color){a.beginPath(),a.setFillStyle(e.color);var n=t.x+p+2*h,r=t.y+(c-l)/2+c*o+h+1;switch(g&&(n=t.x-x-p+2*h),e.legendShape){case"line":a.moveTo(n,r+.5*d-2*i.pix),a.fillRect(n,r+.5*d-2*i.pix,d,4*i.pix);break;case"triangle":a.moveTo(n+7.5*i.pix,r+.5*d-5*i.pix),a.lineTo(n+2.5*i.pix,r+.5*d+5*i.pix),a.lineTo(n+12.5*i.pix,r+.5*d+5*i.pix),a.lineTo(n+7.5*i.pix,r+.5*d-5*i.pix);break;case"diamond":a.moveTo(n+7.5*i.pix,r+.5*d-5*i.pix),a.lineTo(n+2.5*i.pix,r+.5*d),a.lineTo(n+7.5*i.pix,r+.5*d+5*i.pix),a.lineTo(n+12.5*i.pix,r+.5*d),a.lineTo(n+7.5*i.pix,r+.5*d-5*i.pix);break;case"circle":a.moveTo(n+7.5*i.pix,r+.5*d),a.arc(n+7.5*i.pix,r+.5*d,5*i.pix,0,2*Math.PI);break;case"rect":default:a.moveTo(n,r+.5*d-5*i.pix),a.fillRect(n,r+.5*d-5*i.pix,15*i.pix,10*i.pix);break;case"square":a.moveTo(n+2*i.pix,r+.5*d-5*i.pix),a.fillRect(n+2*i.pix,r+.5*d-5*i.pix,10*i.pix,10*i.pix)}a.closePath(),a.fill()}})),e.forEach((function(e,i){var o=t.x+p+2*h+d+u;g&&(o=t.x-x-p+2*h+d+u);var n=t.y+c*i+(c-l)/2-1+h+l;a.beginPath(),a.setFontSize(l),a.setTextBaseline("normal"),a.setFillStyle(s.fontColor),a.fillText(e.text,o,n),a.closePath(),a.stroke()}))}}function Ja(e,t,i,o,a,n){(e.extra.tooltip||{}).horizentalLine&&e.tooltip&&1===o&&("line"==e.type||"area"==e.type||"column"==e.type||"mount"==e.type||"candle"==e.type||"mix"==e.type)&&qa(e,t,i),i.save(),e._scrollDistance_&&0!==e._scrollDistance_&&!0===e.enableScroll&&i.translate(e._scrollDistance_,0),e.tooltip&&e.tooltip.textList&&e.tooltip.textList.length&&1===o&&Ga(e.tooltip.textList,e.tooltip.offset,e,t,i),i.restore()}function Ka(e,t,i,o){let a=t.chartData.xAxisData,n=a.xAxisPoints,r=a.startX,s=a.endX,l=a.eachSpacing;var c="center";"bar"!=t.type&&"line"!=t.type&&"area"!=t.type&&"scatter"!=t.type&&"bubble"!=t.type||(c=t.xAxis.boundaryGap);var h=t.height-t.area[2],d=t.area[0];if(t.enableScroll&&t.xAxis.scrollShow){var u=t.height-t.area[2]+i.xAxisHeight,p=s-r,g=l*(n.length-1);"mount"==t.type&&t.extra&&t.extra.mount&&t.extra.mount.widthRatio&&t.extra.mount.widthRatio>1&&(t.extra.mount.widthRatio>2&&(t.extra.mount.widthRatio=2),g+=(t.extra.mount.widthRatio-1)*l);var f=p*p/g,x=0;t._scrollDistance_&&(x=-t._scrollDistance_*p/g),o.beginPath(),o.setLineCap("round"),o.setLineWidth(6*t.pix),o.setStrokeStyle(t.xAxis.scrollBackgroundColor||"#EFEBEF"),o.moveTo(r,u),o.lineTo(s,u),o.stroke(),o.closePath(),o.beginPath(),o.setLineCap("round"),o.setLineWidth(6*t.pix),o.setStrokeStyle(t.xAxis.scrollColor||"#A6A6A6"),o.moveTo(r+x,u),o.lineTo(r+x+f,u),o.stroke(),o.closePath(),o.setLineCap("butt")}if(o.save(),t._scrollDistance_&&0!==t._scrollDistance_&&o.translate(t._scrollDistance_,0),!0===t.xAxis.calibration&&(o.setStrokeStyle(t.xAxis.gridColor||"#cccccc"),o.setLineCap("butt"),o.setLineWidth(1*t.pix),n.forEach((function(e,i){i>0&&(o.beginPath(),o.moveTo(e-l/2,h),o.lineTo(e-l/2,h+3*t.pix),o.closePath(),o.stroke())}))),!0!==t.xAxis.disableGrid&&(o.setStrokeStyle(t.xAxis.gridColor||"#cccccc"),o.setLineCap("butt"),o.setLineWidth(1*t.pix),"dash"==t.xAxis.gridType&&o.setLineDash([t.xAxis.dashLength*t.pix,t.xAxis.dashLength*t.pix]),t.xAxis.gridEval=t.xAxis.gridEval||1,n.forEach((function(e,i){i%t.xAxis.gridEval==0&&(o.beginPath(),o.moveTo(e,h),o.lineTo(e,d),o.stroke())})),o.setLineDash([])),!0!==t.xAxis.disabled){let a=e.length;t.xAxis.labelCount&&(a=t.xAxis.itemCount?Math.ceil(e.length/t.xAxis.itemCount*t.xAxis.labelCount):t.xAxis.labelCount,a-=1);let r=Math.ceil(e.length/a),s=[],d=e.length;for(let t=0;t<d;t++)t%r!=0?s.push(""):s.push(e[t]);s[d-1]=e[d-1];var y=t.xAxis.fontSize*t.pix||i.fontSize;0===i._xAxisTextAngle_?s.forEach((function(e,i){var a=t.xAxis.formatter?t.xAxis.formatter(e,i,t):e,r=-Ho(String(a),y,o)/2;"center"==c&&(r+=l/2),t.xAxis.scrollShow&&t.pix;var s=t._scrollDistance_||0,d="center"==c?n[i]+l/2:n[i];d-Math.abs(s)>=t.area[3]-1&&d-Math.abs(s)<=t.width-t.area[1]+1&&(o.beginPath(),o.setFontSize(y),o.setFillStyle(t.xAxis.fontColor||t.fontColor),o.fillText(String(a),n[i]+r,h+t.xAxis.marginTop*t.pix+(t.xAxis.lineHeight-t.xAxis.fontSize)*t.pix/2+t.xAxis.fontSize*t.pix),o.closePath(),o.stroke())})):s.forEach((function(e,a){var r=t.xAxis.formatter?t.xAxis.formatter(e):e,s=t._scrollDistance_||0,d="center"==c?n[a]+l/2:n[a];if(d-Math.abs(s)>=t.area[3]-1&&d-Math.abs(s)<=t.width-t.area[1]+1){o.save(),o.beginPath(),o.setFontSize(y),o.setFillStyle(t.xAxis.fontColor||t.fontColor);var u=Ho(String(r),y,o),p=n[a];"center"==c&&(p=n[a]+l/2),t.xAxis.scrollShow&&t.pix;var g=h+t.xAxis.marginTop*t.pix+y-y*Math.abs(Math.sin(i._xAxisTextAngle_));t.xAxis.rotateAngle<0?(p-=y/2,u=0):(p+=y/2,u=-u),o.translate(p,g),o.rotate(-1*i._xAxisTextAngle_),o.fillText(String(r),u,0),o.closePath(),o.stroke(),o.restore()}}))}o.restore(),t.xAxis.title&&(o.beginPath(),o.setFontSize(t.xAxis.titleFontSize*t.pix),o.setFillStyle(t.xAxis.titleFontColor),o.fillText(String(t.xAxis.title),t.width-t.area[1]+t.xAxis.titleOffsetX*t.pix,t.height-t.area[2]+t.xAxis.marginTop*t.pix+(t.xAxis.lineHeight-t.xAxis.titleFontSize)*t.pix/2+(t.xAxis.titleFontSize+t.xAxis.titleOffsetY)*t.pix),o.closePath(),o.stroke()),t.xAxis.axisLine&&(o.beginPath(),o.setStrokeStyle(t.xAxis.axisLineColor),o.setLineWidth(1*t.pix),o.moveTo(r,t.height-t.area[2]),o.lineTo(s,t.height-t.area[2]),o.stroke())}function Xa(e,t,i,o){if(!0===t.yAxis.disableGrid)return;let a=(t.height-t.area[0]-t.area[2])/t.yAxis.splitNumber,n=t.area[3],r=t.chartData.xAxisData.xAxisPoints,s=t.chartData.xAxisData.eachSpacing,l=s*(r.length-1);"mount"==t.type&&t.extra&&t.extra.mount&&t.extra.mount.widthRatio&&t.extra.mount.widthRatio>1&&(t.extra.mount.widthRatio>2&&(t.extra.mount.widthRatio=2),l+=(t.extra.mount.widthRatio-1)*s);let c=n+l,h=[],d=1;!1===t.xAxis.axisLine&&(d=0);for(let u=d;u<t.yAxis.splitNumber+1;u++)h.push(t.height-t.area[2]-a*u);o.save(),t._scrollDistance_&&0!==t._scrollDistance_&&o.translate(t._scrollDistance_,0),"dash"==t.yAxis.gridType&&o.setLineDash([t.yAxis.dashLength*t.pix,t.yAxis.dashLength*t.pix]),o.setStrokeStyle(t.yAxis.gridColor),o.setLineWidth(1*t.pix),h.forEach((function(e,t){o.beginPath(),o.moveTo(n,e),o.lineTo(c,e),o.stroke()})),o.setLineDash([]),o.restore()}function Va(e,t,i,o){if(!0===t.yAxis.disabled)return;var a=t.height-t.area[0]-t.area[2],n=a/t.yAxis.splitNumber,r=t.area[3],s=t.width-t.area[1],l=t.height-t.area[2];o.beginPath(),o.setFillStyle(t.background),1==t.enableScroll&&t.xAxis.scrollPosition&&"left"!==t.xAxis.scrollPosition&&o.fillRect(0,0,r,l+2*t.pix),1==t.enableScroll&&t.xAxis.scrollPosition&&"right"!==t.xAxis.scrollPosition&&o.fillRect(s,0,t.width,l+2*t.pix),o.closePath(),o.stroke();let c=t.area[3],h=t.width-t.area[1],d=t.area[3]+(t.width-t.area[1]-t.area[3])/2;if(t.yAxis.data)for(let p=0;p<t.yAxis.data.length;p++){let e=t.yAxis.data[p];var u=[];if("categories"===e.type)for(let i=0;i<=e.categories.length;i++)u.push(t.area[0]+a/e.categories.length/2+a/e.categories.length*i);else for(let i=0;i<=t.yAxis.splitNumber;i++)u.push(t.area[0]+n*i);if(!0!==e.disabled){let a=t.chartData.yAxisData.rangesFormat[p],n=e.fontSize?e.fontSize*t.pix:i.fontSize,r=t.chartData.yAxisData.yAxisWidth[p],s=e.textAlign||"right";if(a.forEach((function(i,a){var l=u[a];o.beginPath(),o.setFontSize(n),o.setLineWidth(1*t.pix),o.setStrokeStyle(e.axisLineColor||"#cccccc"),o.setFillStyle(e.fontColor||t.fontColor);let p=0,g=4*t.pix;if("left"==r.position){switch(1==e.calibration&&(o.moveTo(c,l),o.lineTo(c-3*t.pix,l),g+=3*t.pix),s){case"left":o.setTextAlign("left"),p=c-r.width;break;case"right":o.setTextAlign("right"),p=c-g;break;default:o.setTextAlign("center"),p=c-r.width/2}o.fillText(String(i),p,l+n/2-3*t.pix)}else if("right"==r.position){switch(1==e.calibration&&(o.moveTo(h,l),o.lineTo(h+3*t.pix,l),g+=3*t.pix),s){case"left":o.setTextAlign("left"),p=h+g;break;case"right":o.setTextAlign("right"),p=h+r.width;break;default:o.setTextAlign("center"),p=h+r.width/2}o.fillText(String(i),p,l+n/2-3*t.pix)}else if("center"==r.position){switch(1==e.calibration&&(o.moveTo(d,l),o.lineTo(d-3*t.pix,l),g+=3*t.pix),s){case"left":o.setTextAlign("left"),p=d-r.width;break;case"right":o.setTextAlign("right"),p=d-g;break;default:o.setTextAlign("center"),p=d-r.width/2}o.fillText(String(i),p,l+n/2-3*t.pix)}o.closePath(),o.stroke(),o.setTextAlign("left")})),!1!==e.axisLine&&(o.beginPath(),o.setStrokeStyle(e.axisLineColor||"#cccccc"),o.setLineWidth(1*t.pix),"left"==r.position?(o.moveTo(c,t.height-t.area[2]),o.lineTo(c,t.area[0])):"right"==r.position?(o.moveTo(h,t.height-t.area[2]),o.lineTo(h,t.area[0])):"center"==r.position&&(o.moveTo(d,t.height-t.area[2]),o.lineTo(d,t.area[0])),o.stroke()),t.yAxis.showTitle){let a=e.titleFontSize*t.pix||i.fontSize,n=e.title;o.beginPath(),o.setFontSize(a),o.setFillStyle(e.titleFontColor||t.fontColor),"left"==r.position?o.fillText(n,c-Ho(n,a,o)/2+(e.titleOffsetX||0),t.area[0]-(10-(e.titleOffsetY||0))*t.pix):"right"==r.position?o.fillText(n,h-Ho(n,a,o)/2+(e.titleOffsetX||0),t.area[0]-(10-(e.titleOffsetY||0))*t.pix):"center"==r.position&&o.fillText(n,d-Ho(n,a,o)/2+(e.titleOffsetX||0),t.area[0]-(10-(e.titleOffsetY||0))*t.pix),o.closePath(),o.stroke()}"left"==r.position?c-=r.width+t.yAxis.padding*t.pix:h+=r.width+t.yAxis.padding*t.pix}}}function Ya(e,t,i,o,a){if(!1===t.legend.show)return;let n=a.legendData,r=n.points,s=n.area,l=t.legend.padding*t.pix,c=t.legend.fontSize*t.pix,h=15*t.pix,d=5*t.pix,u=t.legend.itemGap*t.pix,p=Math.max(t.legend.lineHeight*t.pix,c);o.beginPath(),o.setLineWidth(t.legend.borderWidth*t.pix),o.setStrokeStyle(t.legend.borderColor),o.setFillStyle(t.legend.backgroundColor),o.moveTo(s.start.x,s.start.y),o.rect(s.start.x,s.start.y,s.width,s.height),o.closePath(),o.fill(),o.stroke(),r.forEach((function(e,a){let r=0,g=0;r=n.widthArr[a],g=n.heightArr[a];let f=0,x=0;if("top"==t.legend.position||"bottom"==t.legend.position){switch(t.legend.float){case"left":f=s.start.x+l;break;case"right":f=s.start.x+s.width-r;break;default:f=s.start.x+(s.width-r)/2}x=s.start.y+l+a*p}else r=0==a?0:n.widthArr[a-1],f=s.start.x+l+r,x=s.start.y+l+(s.height-g)/2;o.setFontSize(i.fontSize);for(let i=0;i<e.length;i++){let a=e[i];switch(a.area=[0,0,0,0],a.area[0]=f,a.area[1]=x,a.area[3]=x+p,o.beginPath(),o.setLineWidth(1*t.pix),o.setStrokeStyle(a.show?a.color:t.legend.hiddenColor),o.setFillStyle(a.show?a.color:t.legend.hiddenColor),a.legendShape){case"line":o.moveTo(f,x+.5*p-2*t.pix),o.fillRect(f,x+.5*p-2*t.pix,15*t.pix,4*t.pix);break;case"triangle":o.moveTo(f+7.5*t.pix,x+.5*p-5*t.pix),o.lineTo(f+2.5*t.pix,x+.5*p+5*t.pix),o.lineTo(f+12.5*t.pix,x+.5*p+5*t.pix),o.lineTo(f+7.5*t.pix,x+.5*p-5*t.pix);break;case"diamond":o.moveTo(f+7.5*t.pix,x+.5*p-5*t.pix),o.lineTo(f+2.5*t.pix,x+.5*p),o.lineTo(f+7.5*t.pix,x+.5*p+5*t.pix),o.lineTo(f+12.5*t.pix,x+.5*p),o.lineTo(f+7.5*t.pix,x+.5*p-5*t.pix);break;case"circle":o.moveTo(f+7.5*t.pix,x+.5*p),o.arc(f+7.5*t.pix,x+.5*p,5*t.pix,0,2*Math.PI);break;case"rect":default:o.moveTo(f,x+.5*p-5*t.pix),o.fillRect(f,x+.5*p-5*t.pix,15*t.pix,10*t.pix);break;case"square":o.moveTo(f+5*t.pix,x+.5*p-5*t.pix),o.fillRect(f+5*t.pix,x+.5*p-5*t.pix,10*t.pix,10*t.pix);case"none":}o.closePath(),o.fill(),o.stroke(),f+=h+d;let n=.5*p+.5*c-2;const r=a.legendText?a.legendText:a.name;o.beginPath(),o.setFontSize(c),o.setFillStyle(a.show?t.legend.fontColor:t.legend.hiddenColor),o.fillText(r,f,x+n),o.closePath(),o.stroke(),"top"==t.legend.position||"bottom"==t.legend.position?(f+=Ho(r,c,o)+u,a.area[2]=f):(a.area[2]=f+Ho(r,c,o)+u,f-=h+d,x+=p)}}))}function Qa(e,t,i,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,n=Oo({},{activeOpacity:.5,activeRadius:10,offsetAngle:0,labelWidth:15,ringWidth:30,customRadius:0,border:!1,borderWidth:2,borderColor:"#FFFFFF",centerColor:"#FFFFFF",linearType:"none",customColor:[]},"pie"==t.type?t.extra.pie:t.extra.ring),r={x:t.area[3]+(t.width-t.area[1]-t.area[3])/2,y:t.area[0]+(t.height-t.area[0]-t.area[2])/2};0==i.pieChartLinePadding&&(i.pieChartLinePadding=n.activeRadius*t.pix);var s=Math.min((t.width-t.area[1]-t.area[3])/2-i.pieChartLinePadding-i.pieChartTextPadding-i._pieTextMaxLength_,(t.height-t.area[0]-t.area[2])/2-i.pieChartLinePadding-i.pieChartTextPadding);s=s<10?10:s,n.customRadius>0&&(s=n.customRadius*t.pix),e=la(e,s,a);var l=n.activeRadius*t.pix;if(n.customColor=$o(n.linearType,n.customColor,e,i),(e=e.map((function(e){return e._start_+=n.offsetAngle*Math.PI/180,e}))).forEach((function(e,i){t.tooltip&&t.tooltip.index==i&&(o.beginPath(),o.setFillStyle(Ro(e.color,n.activeOpacity||.5)),o.moveTo(r.x,r.y),o.arc(r.x,r.y,e._radius_+l,e._start_,e._start_+2*e._proportion_*Math.PI),o.closePath(),o.fill()),o.beginPath(),o.setLineWidth(n.borderWidth*t.pix),o.lineJoin="round",o.setStrokeStyle(n.borderColor);var a,s=e.color;"custom"==n.linearType&&((a=o.createCircularGradient?o.createCircularGradient(r.x,r.y,e._radius_):o.createRadialGradient(r.x,r.y,0,r.x,r.y,e._radius_)).addColorStop(0,Ro(n.customColor[e.linearIndex],1)),a.addColorStop(1,Ro(e.color,1)),s=a);o.setFillStyle(s),o.moveTo(r.x,r.y),o.arc(r.x,r.y,e._radius_,e._start_,e._start_+2*e._proportion_*Math.PI),o.closePath(),o.fill(),1==n.border&&o.stroke()})),"ring"===t.type){var c=.6*s;"number"==typeof n.ringWidth&&n.ringWidth>0&&(c=Math.max(0,s-n.ringWidth*t.pix)),o.beginPath(),o.setFillStyle(n.centerColor),o.moveTo(r.x,r.y),o.arc(r.x,r.y,c,0,2*Math.PI),o.closePath(),o.fill()}return!1!==t.dataLabel&&1===a&&Wa(e,t,i,o,0,r),1===a&&"ring"===t.type&&Oa(t,i,o,r),{center:r,radius:s,series:e}}function Za(e,t){var i=Array(2),o=20037508.34*e/180,a=Math.log(Math.tan((90+t)*Math.PI/360))/(Math.PI/180);return a=20037508.34*a/180,i[0]=o,i[1]=a,i}function en(e,t,i,o,a,n){return{x:(t-i.xMin)*o+a,y:(i.yMax-e)*o+n}}function tn(e,t,i){if(t[1]==i[1])return!1;if(t[1]>e[1]&&i[1]>e[1])return!1;if(t[1]<e[1]&&i[1]<e[1])return!1;if(t[1]==e[1]&&i[1]>e[1])return!1;if(i[1]==e[1]&&t[1]>e[1])return!1;if(t[0]<e[0]&&i[1]<e[1])return!1;return!(i[0]-(i[0]-t[0])*(i[1]-e[1])/(i[1]-t[1])<e[0])}function on(e,t,i){let o=0;for(let a=0;a<t.length;a++){let n=t[a][0];1==t.length&&(n=t[a][0]);for(let t=0;t<n.length-1;t++){let a=n[t],r=n[t+1];i&&(a=Za(n[t][0],n[t][1]),r=Za(n[t+1][0],n[t+1][1])),tn(e,a,r)&&(o+=1)}}return o%2==1}function an(e,t,i){i=0==i?1:i;for(var o=[],a=0;a<i;a++)o[a]=Math.random();return Math.floor(o.reduce((function(e,t){return e+t}))/i*(t-e))+e}function nn(e,t,i,o){var a=!1;for(let n=0;n<t.length;n++)if(t[n].area){if(!(e[3]<t[n].area[1]||e[0]>t[n].area[2]||e[1]>t[n].area[3]||e[2]<t[n].area[0])){a=!0;break}if(e[0]<0||e[1]<0||e[2]>i||e[3]>o){a=!0;break}a=!1}return a}function rn(e,t,i){let o=e.series;switch(t){case"normal":for(let a=0;a<o.length;a++){let t,n,r,s=o[a].name,l=o[a].textSize*e.pix,c=Ho(s,l,i),h=0;for(;;){if(h++,t=an(-e.width/2,e.width/2,5)-c/2,n=an(-e.height/2,e.height/2,5)+l/2,r=[t-5+e.width/2,n-5-l+e.height/2,t+c+5+e.width/2,n+5+e.height/2],!nn(r,o,e.width,e.height))break;if(1e3==h){r=[-100,-100,-100,-100];break}}o[a].area=r}break;case"vertical":let t=function(){return Math.random()>.7};for(let a=0;a<o.length;a++){let n,r,s,l,c=o[a].name,h=o[a].textSize*e.pix,d=Ho(c,h,i),u=t(),p=0;for(;;){let t;if(p++,u?(n=an(-e.width/2,e.width/2,5)-d/2,r=an(-e.height/2,e.height/2,5)+h/2,s=[r-5-d+e.width/2,-n-5+e.height/2,r+5+e.width/2,-n+h+5+e.height/2],l=[e.width-(e.width/2-e.height/2)-(-n+h+5+e.height/2)-5,e.height/2-e.width/2+(r-5-d+e.width/2)-5,e.width-(e.width/2-e.height/2)-(-n+h+5+e.height/2)+h,e.height/2-e.width/2+(r-5-d+e.width/2)+d+5],t=nn(l,o,e.height,e.width)):(n=an(-e.width/2,e.width/2,5)-d/2,r=an(-e.height/2,e.height/2,5)+h/2,s=[n-5+e.width/2,r-5-h+e.height/2,n+d+5+e.width/2,r+5+e.height/2],t=nn(s,o,e.width,e.height)),!t)break;if(1e3==p){s=[-1e3,-1e3,-1e3,-1e3];break}}u?(o[a].area=l,o[a].areav=s):o[a].area=s,o[a].rotate=u}}return o}function sn(e,t,i,o,a,n,r){for(let s=0;s<e.length;s++){let l,c,h,d,u=e[s];if(!1===u.labelShow)continue;let p=u.formatter?u.formatter(u,s,e,t):Eo.toFixed(100*u._proportion_)+"%";p=u.labelText?u.labelText:p,"right"==a&&(l=s==e.length-1?(u.funnelArea[2]+r.x)/2:(u.funnelArea[2]+e[s+1].funnelArea[2])/2,c=l+2*n,h=u.funnelArea[1]+o/2,d=u.textSize*t.pix||t.fontSize*t.pix,i.setLineWidth(1*t.pix),i.setStrokeStyle(u.color),i.setFillStyle(u.color),i.beginPath(),i.moveTo(l,h),i.lineTo(c,h),i.stroke(),i.closePath(),i.beginPath(),i.moveTo(c,h),i.arc(c,h,2*t.pix,0,2*Math.PI),i.closePath(),i.fill(),i.beginPath(),i.setFontSize(d),i.setFillStyle(u.textColor||t.fontColor),i.fillText(p,c+5,h+d/2-2),i.closePath(),i.stroke(),i.closePath()),"left"==a&&(l=s==e.length-1?(u.funnelArea[0]+r.x)/2:(u.funnelArea[0]+e[s+1].funnelArea[0])/2,c=l-2*n,h=u.funnelArea[1]+o/2,d=u.textSize*t.pix||t.fontSize*t.pix,i.setLineWidth(1*t.pix),i.setStrokeStyle(u.color),i.setFillStyle(u.color),i.beginPath(),i.moveTo(l,h),i.lineTo(c,h),i.stroke(),i.closePath(),i.beginPath(),i.moveTo(c,h),i.arc(c,h,2,0,2*Math.PI),i.closePath(),i.fill(),i.beginPath(),i.setFontSize(d),i.setFillStyle(u.textColor||t.fontColor),i.fillText(p,c-5-Ho(p,d,i),h+d/2-2),i.closePath(),i.stroke(),i.closePath())}}function ln(e,t,i,o,a,n,r){for(let s=0;s<e.length;s++){let a,n,l=e[s];l.centerText&&(a=l.funnelArea[1]+o/2,n=l.centerTextSize*t.pix||t.fontSize*t.pix,i.beginPath(),i.setFontSize(n),i.setFillStyle(l.centerTextColor||"#FFFFFF"),i.fillText(l.centerText,r.x-Ho(l.centerText,n,i)/2,a+n/2-2),i.closePath(),i.stroke(),i.closePath())}}function cn(e,t){t.save(),t.translate(0,.5),t.restore(),t.draw()}var hn={easeIn:function(e){return Math.pow(e,3)},easeOut:function(e){return Math.pow(e-1,3)+1},easeInOut:function(e){return(e/=.5)<1?.5*Math.pow(e,3):.5*(Math.pow(e-2,3)+2)},linear:function(e){return e}};function dn(e){this.isStop=!1,e.duration=void 0===e.duration?1e3:e.duration,e.timing=e.timing||"easeInOut";var t="undefined"!=typeof setTimeout?function(e,t){setTimeout((function(){e(+new Date)}),t)}:"undefined"!=typeof requestAnimationFrame?requestAnimationFrame:function(e){e(null)},i=null,o=function(a){if(null===a||!0===this.isStop)return e.onProcess&&e.onProcess(1),void(e.onAnimationFinish&&e.onAnimationFinish());if(null===i&&(i=a),a-i<e.duration){var n=(a-i)/e.duration;n=(0,hn[e.timing])(n),e.onProcess&&e.onProcess(n),t(o,17)}else e.onProcess&&e.onProcess(1),e.onAnimationFinish&&e.onAnimationFinish()};o=o.bind(this),t(o,17)}function un(e,t,i,o){var a=this,n=t.series;"pie"!==e&&"ring"!==e&&"mount"!==e&&"rose"!==e&&"funnel"!==e||(n=function(e,t,i){let o=[];if(e.length>0&&e[0].data.constructor.toString().indexOf("Array")>-1){t._pieSeries_=e;let i=e[0].data;for(var a=0;a<i.length;a++)i[a].formatter=e[0].formatter,i[a].data=i[a].value,o.push(i[a]);t.series=o}else o=e;return o}(n,t));var r=t.categories;if("mount"===e){r=[];for(let e=0;e<n.length;e++)!1!==n[e].show&&r.push(n[e].name);t.categories=r}n=qo(n,t,i);var s=t.animation?t.duration:0;a.animationInstance&&a.animationInstance.stop();var l=null;if("candle"==e){let e=Oo({},t.extra.candle.average);e.show?(l=qo(l=function(e,t,i,o){let a=[];for(let n=0;n<e.length;n++){let r={data:[],name:t[n],color:i[n]};for(let t=0,i=o.length;t<i;t++){if(t<e[n]){r.data.push(null);continue}let i=0;for(let a=0;a<e[n];a++)i+=o[t-a][1];r.data.push(+(i/e[n]).toFixed(3))}a.push(r)}return a}(e.day,e.name,e.color,n[0].data),t,i),t.seriesMA=l):l=t.seriesMA?t.seriesMA=qo(t.seriesMA,t,i):n}else l=n;t._series_=n=ta(n),t.area=new Array(4);for(let g=0;g<4;g++)t.area[g]=t.padding[g]*t.pix;var c=function(e,t,i,o,a){let n={area:{start:{x:0,y:0},end:{x:0,y:0},width:0,height:0,wholeWidth:0,wholeHeight:0},points:[],widthArr:[],heightArr:[]};if(!1===t.legend.show)return o.legendData=n,n;let r=t.legend.padding*t.pix,s=t.legend.margin*t.pix,l=t.legend.fontSize?t.legend.fontSize*t.pix:i.fontSize,c=15*t.pix,h=5*t.pix,d=Math.max(t.legend.lineHeight*t.pix,l);if("top"==t.legend.position||"bottom"==t.legend.position){let i=[],o=0,u=[],p=[];for(let n=0;n<e.length;n++){let r=e[n],s=c+h+Ho((r.legendText?r.legendText:r.name)||"undefined",l,a)+t.legend.itemGap*t.pix;o+s>t.width-t.area[1]-t.area[3]?(i.push(p),u.push(o-t.legend.itemGap*t.pix),o=s,p=[r]):(o+=s,p.push(r))}if(p.length){i.push(p),u.push(o-t.legend.itemGap*t.pix),n.widthArr=u;let e=Math.max.apply(null,u);switch(t.legend.float){case"left":n.area.start.x=t.area[3],n.area.end.x=t.area[3]+e+2*r;break;case"right":n.area.start.x=t.width-t.area[1]-e-2*r,n.area.end.x=t.width-t.area[1];break;default:n.area.start.x=(t.width-e)/2-r,n.area.end.x=(t.width+e)/2+r}n.area.width=e+2*r,n.area.wholeWidth=e+2*r,n.area.height=i.length*d+2*r,n.area.wholeHeight=i.length*d+2*r+2*s,n.points=i}}else{let i=e.length,o=t.height-t.area[0]-t.area[2]-2*s-2*r,u=Math.min(Math.floor(o/d),i);switch(n.area.height=u*d+2*r,n.area.wholeHeight=u*d+2*r,t.legend.float){case"top":n.area.start.y=t.area[0]+s,n.area.end.y=t.area[0]+s+n.area.height;break;case"bottom":n.area.start.y=t.height-t.area[2]-s-n.area.height,n.area.end.y=t.height-t.area[2]-s;break;default:n.area.start.y=(t.height-n.area.height)/2,n.area.end.y=(t.height+n.area.height)/2}let p=i%u==0?i/u:Math.floor(i/u+1),g=[];for(let t=0;t<p;t++){let i=e.slice(t*u,t*u+u);g.push(i)}if(n.points=g,g.length){for(let i=0;i<g.length;i++){let e=g[i],o=0;for(let i=0;i<e.length;i++){let n=c+h+Ho(e[i].name||"undefined",l,a)+t.legend.itemGap*t.pix;n>o&&(o=n)}n.widthArr.push(o),n.heightArr.push(e.length*d+2*r)}let e=0;for(let t=0;t<n.widthArr.length;t++)e+=n.widthArr[t];n.area.width=e-t.legend.itemGap*t.pix+2*r,n.area.wholeWidth=n.area.width+r}}switch(t.legend.position){case"top":n.area.start.y=t.area[0]+s,n.area.end.y=t.area[0]+s+n.area.height;break;case"bottom":n.area.start.y=t.height-t.area[2]-n.area.height-s,n.area.end.y=t.height-t.area[2]-s;break;case"left":n.area.start.x=t.area[3],n.area.end.x=t.area[3]+n.area.width;break;case"right":n.area.start.x=t.width-t.area[1]-n.area.width,n.area.end.x=t.width-t.area[1]}return o.legendData=n,n}(l,t,i,t.chartData,o),h=c.area.wholeHeight,d=c.area.wholeWidth;switch(t.legend.position){case"top":t.area[0]+=h;break;case"bottom":t.area[2]+=h;break;case"left":t.area[3]+=d;break;case"right":t.area[1]+=d}let u={},p=0;if("line"===t.type||"column"===t.type||"mount"===t.type||"area"===t.type||"mix"===t.type||"candle"===t.type||"scatter"===t.type||"bubble"===t.type||"bar"===t.type){if(u=La(n,t,i,o),p=u.yAxisWidth,t.yAxis.showTitle){let e=0;for(let o=0;o<t.yAxis.data.length;o++)e=Math.max(e,t.yAxis.data[o].titleFontSize?t.yAxis.data[o].titleFontSize*t.pix:i.fontSize);t.area[0]+=e}let e=0,a=0;for(let i=0;i<p.length;i++)"left"==p[i].position?(t.area[3]+=a>0?p[i].width+t.yAxis.padding*t.pix:p[i].width,a+=1):"right"==p[i].position&&(t.area[1]+=e>0?p[i].width+t.yAxis.padding*t.pix:p[i].width,e+=1)}else i.yAxisWidth=p;if(t.chartData.yAxisData=u,t.categories&&t.categories.length&&"radar"!==t.type&&"gauge"!==t.type&&"bar"!==t.type){t.chartData.xAxisData=ba(t.categories,t);let e=na(t.categories,t,0,t.chartData.xAxisData.eachSpacing,o),a=e.xAxisHeight,n=e.angle;i.xAxisHeight=a,i._xAxisTextAngle_=n,t.area[2]+=a,t.chartData.categoriesData=e}else if("line"===t.type||"area"===t.type||"scatter"===t.type||"bubble"===t.type||"bar"===t.type){t.chartData.xAxisData=ra(n,t,i,o);let e=na(r=t.chartData.xAxisData.rangesFormat,t,0,t.chartData.xAxisData.eachSpacing,o),a=e.xAxisHeight,s=e.angle;i.xAxisHeight=a,i._xAxisTextAngle_=s,t.area[2]+=a,t.chartData.categoriesData=e}else t.chartData.xAxisData={xAxisPoints:[]};if(t.enableScroll&&"right"==t.xAxis.scrollAlign&&void 0===t._scrollDistance_){let e=0,i=t.chartData.xAxisData.xAxisPoints,o=t.chartData.xAxisData.startX;e=t.chartData.xAxisData.endX-o-t.chartData.xAxisData.eachSpacing*(i.length-1),a.scrollOption.currentOffset=e,a.scrollOption.startTouchX=e,a.scrollOption.distance=0,a.scrollOption.lastMoveTime=0,t._scrollDistance_=e}switch("pie"!==e&&"ring"!==e&&"rose"!==e||(i._pieTextMaxLength_=!1===t.dataLabel?0:function(e,t,i,o){e=la(e);let a=0;for(let n=0;n<e.length;n++){let r=e[n],s=r.formatter?r.formatter(+r._proportion_.toFixed(2)):Eo.toFixed(100*r._proportion_)+"%";a=Math.max(a,Ho(s,r.textSize*o.pix||t.fontSize,i))}return a}(l,i,o,t)),e){case"word":this.animationInstance=new dn({timing:t.timing,duration:s,onProcess:function(e){o.clearRect(0,0,t.width,t.height),t.rotate&&Ia(o,t),function(e,t,i,o){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,n=Oo({},{type:"normal",autoColors:!0},t.extra.word);t.chartData.wordCloudData||(t.chartData.wordCloudData=rn(t,n.type,o)),o.beginPath(),o.setFillStyle(t.background),o.rect(0,0,t.width,t.height),o.fill(),o.save();let r=t.chartData.wordCloudData;o.translate(t.width/2,t.height/2);for(let s=0;s<r.length;s++){o.save(),r[s].rotate&&o.rotate(90*Math.PI/180);let e=r[s].name,i=r[s].textSize*t.pix,n=Ho(e,i,o);o.beginPath(),o.setStrokeStyle(r[s].color),o.setFillStyle(r[s].color),o.setFontSize(i),r[s].rotate?r[s].areav[0]>0&&(t.tooltip&&t.tooltip.index==s?o.strokeText(e,(r[s].areav[0]+5-t.width/2)*a-n*(1-a)/2,(r[s].areav[1]+5+i-t.height/2)*a):o.fillText(e,(r[s].areav[0]+5-t.width/2)*a-n*(1-a)/2,(r[s].areav[1]+5+i-t.height/2)*a)):r[s].area[0]>0&&(t.tooltip&&t.tooltip.index==s?o.strokeText(e,(r[s].area[0]+5-t.width/2)*a-n*(1-a)/2,(r[s].area[1]+5+i-t.height/2)*a):o.fillText(e,(r[s].area[0]+5-t.width/2)*a-n*(1-a)/2,(r[s].area[1]+5+i-t.height/2)*a)),o.stroke(),o.restore()}o.restore()}(n,t,i,o,e),cn(0,o)},onAnimationFinish:function(){a.uevent.trigger("renderComplete")}});break;case"map":o.clearRect(0,0,t.width,t.height),function(e,t,i,o){var a,n,r=Oo({},{border:!0,mercator:!1,borderWidth:1,active:!0,borderColor:"#666666",fillOpacity:.6,activeBorderColor:"#f04864",activeFillColor:"#facc14",activeFillOpacity:1},t.extra.map),s=e,l=function(e){for(var t,i={xMin:180,xMax:0,yMin:90,yMax:0},o=0;o<e.length;o++)for(var a=e[o].geometry.coordinates,n=0;n<a.length;n++){1==(t=a[n]).length&&(t=t[0]);for(var r=0;r<t.length;r++){var s={x:t[r][0],y:t[r][1]};i.xMin=i.xMin<s.x?i.xMin:s.x,i.xMax=i.xMax>s.x?i.xMax:s.x,i.yMin=i.yMin<s.y?i.yMin:s.y,i.yMax=i.yMax>s.y?i.yMax:s.y}}return i}(s);if(r.mercator){var c=Za(l.xMax,l.yMax),h=Za(l.xMin,l.yMin);l.xMax=c[0],l.yMax=c[1],l.xMin=h[0],l.yMin=h[1]}for(var d=t.width/Math.abs(l.xMax-l.xMin),u=t.height/Math.abs(l.yMax-l.yMin),p=d<u?d:u,g=t.width/2-Math.abs(l.xMax-l.xMin)/2*p,f=t.height/2-Math.abs(l.yMax-l.yMin)/2*p,x=0;x<s.length;x++){o.beginPath(),o.setLineWidth(r.borderWidth*t.pix),o.setStrokeStyle(r.borderColor),o.setFillStyle(Ro(e[x].color,e[x].fillOpacity||r.fillOpacity)),1==r.active&&t.tooltip&&t.tooltip.index==x&&(o.setStrokeStyle(r.activeBorderColor),o.setFillStyle(Ro(r.activeFillColor,r.activeFillOpacity)));for(var y=s[x].geometry.coordinates,m=0;m<y.length;m++){1==(a=y[m]).length&&(a=a[0]);for(var v=0;v<a.length;v++){var b=Array(2);n=en((b=r.mercator?Za(a[v][0],a[v][1]):a[v])[1],b[0],l,p,g,f),0===v?(o.beginPath(),o.moveTo(n.x,n.y)):o.lineTo(n.x,n.y)}o.fill(),1==r.border&&o.stroke()}}if(1==t.dataLabel)for(x=0;x<s.length;x++){var S=s[x].properties.centroid;if(S){r.mercator&&(S=Za(s[x].properties.centroid[0],s[x].properties.centroid[1])),n=en(S[1],S[0],l,p,g,f);let e=s[x].textSize*t.pix||i.fontSize,a=s[x].textColor||t.fontColor;r.active&&r.activeTextColor&&t.tooltip&&t.tooltip.index==x&&(a=r.activeTextColor);let c=s[x].properties.name;o.beginPath(),o.setFontSize(e),o.setFillStyle(a),o.fillText(c,n.x-Ho(c,e,o)/2,n.y+e/2),o.closePath(),o.stroke()}}t.chartData.mapData={bounds:l,scale:p,xoffset:g,yoffset:f,mercator:r.mercator},Ja(t,i,o,1),o.draw()}(n,t,i,o),setTimeout((()=>{this.uevent.trigger("renderComplete")}),50);break;case"funnel":this.animationInstance=new dn({timing:t.timing,duration:s,onProcess:function(e){o.clearRect(0,0,t.width,t.height),t.rotate&&Ia(o,t),t.chartData.funnelData=function(e,t,i,o){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,n=Oo({},{type:"funnel",activeWidth:10,activeOpacity:.3,border:!1,borderWidth:2,borderColor:"#FFFFFF",fillOpacity:1,minSize:0,labelAlign:"right",linearType:"none",customColor:[]},t.extra.funnel),r=(t.height-t.area[0]-t.area[2])/e.length,s={x:t.area[3]+(t.width-t.area[1]-t.area[3])/2,y:t.height-t.area[2]},l=n.activeWidth*t.pix,c=Math.min((t.width-t.area[1]-t.area[3])/2-l,(t.height-t.area[0]-t.area[2])/2-l),h=ca(e,c,n,r,a);if(o.save(),o.translate(s.x,s.y),n.customColor=$o(n.linearType,n.customColor,e,i),"pyramid"==n.type)for(let p=0;p<h.length;p++){if(p==h.length-1){t.tooltip&&t.tooltip.index==p&&(o.beginPath(),o.setFillStyle(Ro(h[p].color,n.activeOpacity)),o.moveTo(-l,-r),o.lineTo(-h[p].radius-l,0),o.lineTo(h[p].radius+l,0),o.lineTo(l,-r),o.lineTo(-l,-r),o.closePath(),o.fill()),h[p].funnelArea=[s.x-h[p].radius,s.y-r*(p+1),s.x+h[p].radius,s.y-r*p],o.beginPath(),o.setLineWidth(n.borderWidth*t.pix),o.setStrokeStyle(n.borderColor);var d=Ro(h[p].color,n.fillOpacity);"custom"==n.linearType&&((u=o.createLinearGradient(h[p].radius,-r,-h[p].radius,-r)).addColorStop(0,Ro(h[p].color,n.fillOpacity)),u.addColorStop(.5,Ro(n.customColor[h[p].linearIndex],n.fillOpacity)),u.addColorStop(1,Ro(h[p].color,n.fillOpacity)),d=u),o.setFillStyle(d),o.moveTo(0,-r),o.lineTo(-h[p].radius,0),o.lineTo(h[p].radius,0),o.lineTo(0,-r),o.closePath(),o.fill(),1==n.border&&o.stroke()}else t.tooltip&&t.tooltip.index==p&&(o.beginPath(),o.setFillStyle(Ro(h[p].color,n.activeOpacity)),o.moveTo(0,0),o.lineTo(-h[p].radius-l,0),o.lineTo(-h[p+1].radius-l,-r),o.lineTo(h[p+1].radius+l,-r),o.lineTo(h[p].radius+l,0),o.lineTo(0,0),o.closePath(),o.fill()),h[p].funnelArea=[s.x-h[p].radius,s.y-r*(p+1),s.x+h[p].radius,s.y-r*p],o.beginPath(),o.setLineWidth(n.borderWidth*t.pix),o.setStrokeStyle(n.borderColor),d=Ro(h[p].color,n.fillOpacity),"custom"==n.linearType&&((u=o.createLinearGradient(h[p].radius,-r,-h[p].radius,-r)).addColorStop(0,Ro(h[p].color,n.fillOpacity)),u.addColorStop(.5,Ro(n.customColor[h[p].linearIndex],n.fillOpacity)),u.addColorStop(1,Ro(h[p].color,n.fillOpacity)),d=u),o.setFillStyle(d),o.moveTo(0,0),o.lineTo(-h[p].radius,0),o.lineTo(-h[p+1].radius,-r),o.lineTo(h[p+1].radius,-r),o.lineTo(h[p].radius,0),o.lineTo(0,0),o.closePath(),o.fill(),1==n.border&&o.stroke();o.translate(0,-r)}else{o.translate(0,-(h.length-1)*r);for(let e=0;e<h.length;e++){var u;if(e==h.length-1)t.tooltip&&t.tooltip.index==e&&(o.beginPath(),o.setFillStyle(Ro(h[e].color,n.activeOpacity)),o.moveTo(-l-n.minSize/2,0),o.lineTo(-h[e].radius-l,-r),o.lineTo(h[e].radius+l,-r),o.lineTo(l+n.minSize/2,0),o.lineTo(-l-n.minSize/2,0),o.closePath(),o.fill()),h[e].funnelArea=[s.x-h[e].radius,s.y-r,s.x+h[e].radius,s.y],o.beginPath(),o.setLineWidth(n.borderWidth*t.pix),o.setStrokeStyle(n.borderColor),d=Ro(h[e].color,n.fillOpacity),"custom"==n.linearType&&((u=o.createLinearGradient(h[e].radius,-r,-h[e].radius,-r)).addColorStop(0,Ro(h[e].color,n.fillOpacity)),u.addColorStop(.5,Ro(n.customColor[h[e].linearIndex],n.fillOpacity)),u.addColorStop(1,Ro(h[e].color,n.fillOpacity)),d=u),o.setFillStyle(d),o.moveTo(0,0),o.lineTo(-n.minSize/2,0),o.lineTo(-h[e].radius,-r),o.lineTo(h[e].radius,-r),o.lineTo(n.minSize/2,0),o.lineTo(0,0),o.closePath(),o.fill(),1==n.border&&o.stroke();else t.tooltip&&t.tooltip.index==e&&(o.beginPath(),o.setFillStyle(Ro(h[e].color,n.activeOpacity)),o.moveTo(0,0),o.lineTo(-h[e+1].radius-l,0),o.lineTo(-h[e].radius-l,-r),o.lineTo(h[e].radius+l,-r),o.lineTo(h[e+1].radius+l,0),o.lineTo(0,0),o.closePath(),o.fill()),h[e].funnelArea=[s.x-h[e].radius,s.y-r*(h.length-e),s.x+h[e].radius,s.y-r*(h.length-e-1)],o.beginPath(),o.setLineWidth(n.borderWidth*t.pix),o.setStrokeStyle(n.borderColor),d=Ro(h[e].color,n.fillOpacity),"custom"==n.linearType&&((u=o.createLinearGradient(h[e].radius,-r,-h[e].radius,-r)).addColorStop(0,Ro(h[e].color,n.fillOpacity)),u.addColorStop(.5,Ro(n.customColor[h[e].linearIndex],n.fillOpacity)),u.addColorStop(1,Ro(h[e].color,n.fillOpacity)),d=u),o.setFillStyle(d),o.moveTo(0,0),o.lineTo(-h[e+1].radius,0),o.lineTo(-h[e].radius,-r),o.lineTo(h[e].radius,-r),o.lineTo(h[e+1].radius,0),o.lineTo(0,0),o.closePath(),o.fill(),1==n.border&&o.stroke();o.translate(0,r)}}return o.restore(),!1!==t.dataLabel&&1===a&&sn(h,t,o,r,n.labelAlign,l,s),1===a&&ln(h,t,o,r,n.labelAlign,0,s),{center:s,radius:c,series:h}}(n,t,i,o,e),Ya(t.series,t,i,o,t.chartData),Ja(t,i,o,e),cn(0,o)},onAnimationFinish:function(){a.uevent.trigger("renderComplete")}});break;case"line":this.animationInstance=new dn({timing:t.timing,duration:s,onProcess:function(e){o.clearRect(0,0,t.width,t.height),t.rotate&&Ia(o,t),Xa(0,t,0,o),Ka(r,t,i,o);var a=function(e,t,i,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,n=Oo({},{type:"straight",width:2,activeType:"none",linearType:"none",onShadow:!1,animation:"vertical"},t.extra.line);n.width*=t.pix;let r=t.chartData.xAxisData,s=r.xAxisPoints,l=r.eachSpacing;var c=[];o.save();let h=0,d=t.width+l;return t._scrollDistance_&&0!==t._scrollDistance_&&!0===t.enableScroll&&(o.translate(t._scrollDistance_,0),h=-t._scrollDistance_-2*l+t.area[3],d=h+(t.xAxis.itemCount+4)*l),e.forEach((function(e,r){let u,p,g;o.beginPath(),o.setStrokeStyle(e.color),o.moveTo(-1e4,-1e4),o.lineTo(-10001,-10001),o.stroke(),u=[].concat(t.chartData.yAxisData.ranges[e.index]),p=u.pop(),g=u.shift();var f=Ta(e.data,p,g,s,l,t,i,n,a);c.push(f);var x=aa(f,e);if("dash"==e.lineType){let i=e.dashLength?e.dashLength:8;i*=t.pix,o.setLineDash([i,i])}o.beginPath();var y=e.color;if("none"!==n.linearType&&e.linearColor&&e.linearColor.length>0){for(var m=o.createLinearGradient(t.chartData.xAxisData.startX,t.height/2,t.chartData.xAxisData.endX,t.height/2),v=0;v<e.linearColor.length;v++)m.addColorStop(e.linearColor[v][0],Ro(e.linearColor[v][1],1));y=m}o.setStrokeStyle(y),1==n.onShadow&&e.setShadow&&e.setShadow.length>0?o.setShadow(e.setShadow[0],e.setShadow[1],e.setShadow[2],e.setShadow[3]):o.setShadow(0,0,0,"rgba(0,0,0,0)"),o.setLineWidth(n.width),x.forEach((function(e,t){if(1===e.length)o.moveTo(e[0].x,e[0].y);else{o.moveTo(e[0].x,e[0].y);let t=0;if("curve"===n.type)for(let a=0;a<e.length;a++){let n=e[a];if(0==t&&n.x>h&&(o.moveTo(n.x,n.y),t=1),a>0&&n.x>h&&n.x<d){var i=Uo(e,a-1);o.bezierCurveTo(i.ctrA.x,i.ctrA.y,i.ctrB.x,i.ctrB.y,n.x,n.y)}}if("straight"===n.type)for(let i=0;i<e.length;i++){let a=e[i];0==t&&a.x>h&&(o.moveTo(a.x,a.y),t=1),i>0&&a.x>h&&a.x<d&&o.lineTo(a.x,a.y)}if("step"===n.type)for(let i=0;i<e.length;i++){let a=e[i];0==t&&a.x>h&&(o.moveTo(a.x,a.y),t=1),i>0&&a.x>h&&a.x<d&&(o.lineTo(a.x,e[i-1].y),o.lineTo(a.x,a.y))}o.moveTo(e[0].x,e[0].y)}})),o.stroke(),o.setLineDash([]),!1!==t.dataPointShape&&Ma(f,e.color,e.pointShape,o,t),Fa(f,e.color,e.pointShape,o,t,n)})),!1!==t.dataLabel&&1===a&&e.forEach((function(e,n){let r,c,h;r=[].concat(t.chartData.yAxisData.ranges[e.index]),c=r.pop(),h=r.shift(),Ea(wa(e.data,c,h,s,l,t,i,a),e,i,o,t)})),o.restore(),{xAxisPoints:s,calPoints:c,eachSpacing:l}}(n,t,i,o,e),s=a.xAxisPoints,l=a.calPoints,c=a.eachSpacing;t.chartData.xAxisPoints=s,t.chartData.calPoints=l,t.chartData.eachSpacing=c,Va(0,t,i,o),!1!==t.enableMarkLine&&1===e&&ja(t,0,o),Ya(t.series,t,i,o,t.chartData),Ja(t,i,o,e),cn(0,o)},onAnimationFinish:function(){a.uevent.trigger("renderComplete")}});break;case"scatter":this.animationInstance=new dn({timing:t.timing,duration:s,onProcess:function(e){o.clearRect(0,0,t.width,t.height),t.rotate&&Ia(o,t),Xa(0,t,0,o),Ka(r,t,i,o);var a=function(e,t,i,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;Oo({},{type:"circle"},t.extra.scatter);let n=t.chartData.xAxisData,r=n.xAxisPoints,s=n.eachSpacing;var l=[];o.save();let c=0;return t.width,t._scrollDistance_&&0!==t._scrollDistance_&&!0===t.enableScroll&&(o.translate(t._scrollDistance_,0),c=-t._scrollDistance_-2*s+t.area[3],t.xAxis.itemCount),e.forEach((function(e,n){let l,c,h;l=[].concat(t.chartData.yAxisData.ranges[e.index]),c=l.pop(),h=l.shift();var d=wa(e.data,c,h,r,s,t,i,a);o.beginPath(),o.setStrokeStyle(e.color),o.setFillStyle(e.color),o.setLineWidth(1*t.pix);var u=e.pointShape;if("diamond"===u)d.forEach((function(e,t){null!==e&&(o.moveTo(e.x,e.y-4.5),o.lineTo(e.x-4.5,e.y),o.lineTo(e.x,e.y+4.5),o.lineTo(e.x+4.5,e.y),o.lineTo(e.x,e.y-4.5))}));else if("circle"===u)d.forEach((function(e,i){null!==e&&(o.moveTo(e.x+2.5*t.pix,e.y),o.arc(e.x,e.y,3*t.pix,0,2*Math.PI,!1))}));else if("square"===u)d.forEach((function(e,t){null!==e&&(o.moveTo(e.x-3.5,e.y-3.5),o.rect(e.x-3.5,e.y-3.5,7,7))}));else if("triangle"===u)d.forEach((function(e,t){null!==e&&(o.moveTo(e.x,e.y-4.5),o.lineTo(e.x-4.5,e.y+4.5),o.lineTo(e.x+4.5,e.y+4.5),o.lineTo(e.x,e.y-4.5))}));else if("triangle"===u)return;o.closePath(),o.fill(),o.stroke()})),!1!==t.dataLabel&&1===a&&e.forEach((function(e,n){let l,c,h;l=[].concat(t.chartData.yAxisData.ranges[e.index]),c=l.pop(),h=l.shift(),Ea(wa(e.data,c,h,r,s,t,i,a),e,i,o,t)})),o.restore(),{xAxisPoints:r,calPoints:l,eachSpacing:s}}(n,t,i,o,e),s=a.xAxisPoints,l=a.calPoints,c=a.eachSpacing;t.chartData.xAxisPoints=s,t.chartData.calPoints=l,t.chartData.eachSpacing=c,Va(0,t,i,o),!1!==t.enableMarkLine&&1===e&&ja(t,0,o),Ya(t.series,t,i,o,t.chartData),Ja(t,i,o,e),cn(0,o)},onAnimationFinish:function(){a.uevent.trigger("renderComplete")}});break;case"bubble":this.animationInstance=new dn({timing:t.timing,duration:s,onProcess:function(e){o.clearRect(0,0,t.width,t.height),t.rotate&&Ia(o,t),Xa(0,t,0,o),Ka(r,t,i,o);var a=function(e,t,i,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,n=Oo({},{opacity:1,border:2},t.extra.bubble);let r=t.chartData.xAxisData,s=r.xAxisPoints,l=r.eachSpacing;var c=[];o.save();let h=0;return t.width,t._scrollDistance_&&0!==t._scrollDistance_&&!0===t.enableScroll&&(o.translate(t._scrollDistance_,0),h=-t._scrollDistance_-2*l+t.area[3],t.xAxis.itemCount),e.forEach((function(e,r){let c,h,d;c=[].concat(t.chartData.yAxisData.ranges[e.index]),h=c.pop(),d=c.shift();var u=wa(e.data,h,d,s,l,t,i,a);o.beginPath(),o.setStrokeStyle(e.color),o.setLineWidth(n.border*t.pix),o.setFillStyle(Ro(e.color,n.opacity)),u.forEach((function(e,i){o.moveTo(e.x+e.r,e.y),o.arc(e.x,e.y,e.r*t.pix,0,2*Math.PI,!1)})),o.closePath(),o.fill(),o.stroke(),!1!==t.dataLabel&&1===a&&u.forEach((function(a,n){o.beginPath();var r=e.textSize*t.pix||i.fontSize;o.setFontSize(r),o.setFillStyle(e.textColor||"#FFFFFF"),o.setTextAlign("center"),o.fillText(String(a.t),a.x,a.y+r/2),o.closePath(),o.stroke(),o.setTextAlign("left")}))})),o.restore(),{xAxisPoints:s,calPoints:c,eachSpacing:l}}(n,t,i,o,e),s=a.xAxisPoints,l=a.calPoints,c=a.eachSpacing;t.chartData.xAxisPoints=s,t.chartData.calPoints=l,t.chartData.eachSpacing=c,Va(0,t,i,o),!1!==t.enableMarkLine&&1===e&&ja(t,0,o),Ya(t.series,t,i,o,t.chartData),Ja(t,i,o,e),cn(0,o)},onAnimationFinish:function(){a.uevent.trigger("renderComplete")}});break;case"mix":this.animationInstance=new dn({timing:t.timing,duration:s,onProcess:function(e){o.clearRect(0,0,t.width,t.height),t.rotate&&Ia(o,t),Xa(0,t,0,o),Ka(r,t,i,o);var a=function(e,t,i,o){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,n=t.chartData.xAxisData,r=n.xAxisPoints,s=n.eachSpacing,l=Oo({},{width:s/2,barBorderCircle:!1,barBorderRadius:[],seriesGap:2,linearType:"none",linearOpacity:1,customColor:[],colorStop:0},t.extra.mix.column),c=Oo({},{opacity:.2,gradient:!1},t.extra.mix.area),h=Oo({},{width:2},t.extra.mix.line),d=t.height-t.area[2],u=[];var p=0,g=0;e.forEach((function(e,t){"column"==e.type&&(g+=1)})),o.save();let f=-2,x=r.length+2,y=0,m=t.width+s;t._scrollDistance_&&0!==t._scrollDistance_&&!0===t.enableScroll&&(o.translate(t._scrollDistance_,0),f=Math.floor(-t._scrollDistance_/s)-2,x=f+t.xAxis.itemCount+4,y=-t._scrollDistance_-2*s+t.area[3],m=y+(t.xAxis.itemCount+4)*s),l.customColor=$o(l.linearType,l.customColor,e,i),e.forEach((function(e,n){let v,b,S;v=[].concat(t.chartData.yAxisData.ranges[e.index]),b=v.pop(),S=v.shift();var w=wa(e.data,b,S,r,s,t,i,a);if(u.push(w),"column"==e.type){w=fa(w,s,g,p,0,t);for(let i=0;i<w.length;i++){let a=w[i];if(null!==a&&i>f&&i<x){var T=a.x-a.width/2;t.height,a.y,t.area[2],o.beginPath();var A=a.color||e.color,_=a.color||e.color;if("none"!==l.linearType){var P=o.createLinearGradient(T,a.y,T,t.height-t.area[2]);"opacity"==l.linearType?(P.addColorStop(0,Ro(A,l.linearOpacity)),P.addColorStop(1,Ro(A,1))):(P.addColorStop(0,Ro(l.customColor[e.linearIndex],l.linearOpacity)),P.addColorStop(l.colorStop,Ro(l.customColor[e.linearIndex],l.linearOpacity)),P.addColorStop(1,Ro(A,1))),A=P}if(l.barBorderRadius&&4===l.barBorderRadius.length||l.barBorderCircle){const e=T,i=a.y,n=a.width,r=t.height-t.area[2]-a.y;l.barBorderCircle&&(l.barBorderRadius=[n/2,n/2,0,0]);let[s,c,h,d]=l.barBorderRadius,u=Math.min(n/2,r/2);s=s>u?u:s,c=c>u?u:c,h=h>u?u:h,d=d>u?u:d,s=s<0?0:s,c=c<0?0:c,h=h<0?0:h,d=d<0?0:d,o.arc(e+s,i+s,s,-Math.PI,-Math.PI/2),o.arc(e+n-c,i+c,c,-Math.PI/2,0),o.arc(e+n-h,i+r-h,h,0,Math.PI/2),o.arc(e+d,i+r-d,d,Math.PI/2,Math.PI)}else o.moveTo(T,a.y),o.lineTo(T+a.width,a.y),o.lineTo(T+a.width,t.height-t.area[2]),o.lineTo(T,t.height-t.area[2]),o.lineTo(T,a.y),o.setLineWidth(1),o.setStrokeStyle(_);o.setFillStyle(A),o.closePath(),o.fill()}}p+=1}if("area"==e.type){let i=aa(w,e);for(let a=0;a<i.length;a++){let n=i[a];if(o.beginPath(),o.setStrokeStyle(e.color),o.setStrokeStyle(Ro(e.color,c.opacity)),c.gradient){let i=o.createLinearGradient(0,t.area[0],0,t.height-t.area[2]);i.addColorStop("0",Ro(e.color,c.opacity)),i.addColorStop("1.0",Ro("#FFFFFF",.1)),o.setFillStyle(i)}else o.setFillStyle(Ro(e.color,c.opacity));if(o.setLineWidth(2*t.pix),n.length>1){var C=n[0];let t=n[n.length-1];o.moveTo(C.x,C.y);let i=0;if("curve"===e.style)for(let e=0;e<n.length;e++){let t=n[e];if(0==i&&t.x>y&&(o.moveTo(t.x,t.y),i=1),e>0&&t.x>y&&t.x<m){var k=Uo(n,e-1);o.bezierCurveTo(k.ctrA.x,k.ctrA.y,k.ctrB.x,k.ctrB.y,t.x,t.y)}}else for(let e=0;e<n.length;e++){let t=n[e];0==i&&t.x>y&&(o.moveTo(t.x,t.y),i=1),e>0&&t.x>y&&t.x<m&&o.lineTo(t.x,t.y)}o.lineTo(t.x,d),o.lineTo(C.x,d),o.lineTo(C.x,C.y)}else{let e=n[0];o.moveTo(e.x-s/2,e.y)}o.closePath(),o.fill()}}"line"==e.type&&aa(w,e).forEach((function(i,a){if("dash"==e.lineType){let i=e.dashLength?e.dashLength:8;i*=t.pix,o.setLineDash([i,i])}if(o.beginPath(),o.setStrokeStyle(e.color),o.setLineWidth(h.width*t.pix),1===i.length)o.moveTo(i[0].x,i[0].y);else{o.moveTo(i[0].x,i[0].y);let t=0;if("curve"==e.style)for(let e=0;e<i.length;e++){let a=i[e];if(0==t&&a.x>y&&(o.moveTo(a.x,a.y),t=1),e>0&&a.x>y&&a.x<m){var n=Uo(i,e-1);o.bezierCurveTo(n.ctrA.x,n.ctrA.y,n.ctrB.x,n.ctrB.y,a.x,a.y)}}else for(let e=0;e<i.length;e++){let a=i[e];0==t&&a.x>y&&(o.moveTo(a.x,a.y),t=1),e>0&&a.x>y&&a.x<m&&o.lineTo(a.x,a.y)}o.moveTo(i[0].x,i[0].y)}o.stroke(),o.setLineDash([])})),"point"==e.type&&(e.addPoint=!0),1==e.addPoint&&"column"!==e.type&&Ma(w,e.color,e.pointShape,o,t)})),!1!==t.dataLabel&&1===a&&(p=0,e.forEach((function(e,n){let l,c,h;l=[].concat(t.chartData.yAxisData.ranges[e.index]),c=l.pop(),h=l.shift();var d=wa(e.data,c,h,r,s,t,i,a);"column"!==e.type?Ea(d,e,i,o,t):(Ea(d=fa(d,s,g,p,0,t),e,i,o,t),p+=1)})));return o.restore(),{xAxisPoints:r,calPoints:u,eachSpacing:s}}(n,t,i,o,e),s=a.xAxisPoints,l=a.calPoints,c=a.eachSpacing;t.chartData.xAxisPoints=s,t.chartData.calPoints=l,t.chartData.eachSpacing=c,Va(0,t,i,o),!1!==t.enableMarkLine&&1===e&&ja(t,0,o),Ya(t.series,t,i,o,t.chartData),Ja(t,i,o,e),cn(0,o)},onAnimationFinish:function(){a.uevent.trigger("renderComplete")}});break;case"column":this.animationInstance=new dn({timing:t.timing,duration:s,onProcess:function(e){o.clearRect(0,0,t.width,t.height),t.rotate&&Ia(o,t),Xa(0,t,0,o),Ka(r,t,i,o);var a=function(e,t,i,o){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,n=t.chartData.xAxisData,r=n.xAxisPoints,s=n.eachSpacing,l=Oo({},{type:"group",width:s/2,meterBorder:4,meterFillColor:"#FFFFFF",barBorderCircle:!1,barBorderRadius:[],seriesGap:2,linearType:"none",linearOpacity:1,customColor:[],colorStop:0,labelPosition:"outside"},t.extra.column),c=[];o.save();let h=-2,d=r.length+2;return t._scrollDistance_&&0!==t._scrollDistance_&&!0===t.enableScroll&&(o.translate(t._scrollDistance_,0),h=Math.floor(-t._scrollDistance_/s)-2,d=h+t.xAxis.itemCount+4),t.tooltip&&t.tooltip.textList&&t.tooltip.textList.length&&1===a&&$a(t.tooltip.offset.x,t,0,o,s),l.customColor=$o(l.linearType,l.customColor,e,i),e.forEach((function(n,u){let p,g,f;p=[].concat(t.chartData.yAxisData.ranges[n.index]),g=p.pop(),f=p.shift();let x=(t.height-t.area[0]-t.area[2])*(0-g)/(f-g),y=t.height-Math.round(x)-t.area[2];n.zeroPoints=y;var m=n.data;switch(l.type){case"group":var v=Aa(m,g,f,r,s,t,i,y,a),b=Ca(m,g,f,r,s,t,i,u,e,a);c.push(b),v=fa(v,s,e.length,u,0,t);for(let e=0;e<v.length;e++){let i=v[e];if(null!==i&&e>h&&e<d){var S=i.x-i.width/2,w=t.height-i.y-t.area[2];o.beginPath();var T=i.color||n.color,A=i.color||n.color;if("none"!==l.linearType){var _=o.createLinearGradient(S,i.y,S,y);"opacity"==l.linearType?(_.addColorStop(0,Ro(T,l.linearOpacity)),_.addColorStop(1,Ro(T,1))):(_.addColorStop(0,Ro(l.customColor[n.linearIndex],l.linearOpacity)),_.addColorStop(l.colorStop,Ro(l.customColor[n.linearIndex],l.linearOpacity)),_.addColorStop(1,Ro(T,1))),T=_}if(l.barBorderRadius&&4===l.barBorderRadius.length||!0===l.barBorderCircle){const e=S,t=i.y>y?y:i.y,a=i.width,n=Math.abs(y-i.y);l.barBorderCircle&&(l.barBorderRadius=[a/2,a/2,0,0]),i.y>y&&(l.barBorderRadius=[0,0,a/2,a/2]);let[r,s,c,h]=l.barBorderRadius,d=Math.min(a/2,n/2);r=r>d?d:r,s=s>d?d:s,c=c>d?d:c,h=h>d?d:h,r=r<0?0:r,s=s<0?0:s,c=c<0?0:c,h=h<0?0:h,o.arc(e+r,t+r,r,-Math.PI,-Math.PI/2),o.arc(e+a-s,t+s,s,-Math.PI/2,0),o.arc(e+a-c,t+n-c,c,0,Math.PI/2),o.arc(e+h,t+n-h,h,Math.PI/2,Math.PI)}else o.moveTo(S,i.y),o.lineTo(S+i.width,i.y),o.lineTo(S+i.width,y),o.lineTo(S,y),o.lineTo(S,i.y),o.setLineWidth(1),o.setStrokeStyle(A);o.setFillStyle(T),o.closePath(),o.fill()}}break;case"stack":v=Ca(m,g,f,r,s,t,i,u,e,a),c.push(v),v=ma(v,s,e.length,0,0,t);for(let e=0;e<v.length;e++){let i=v[e];if(null!==i&&e>h&&e<d){o.beginPath(),T=i.color||n.color,S=i.x-i.width/2+1,w=t.height-i.y-t.area[2];var P=t.height-i.y0-t.area[2];u>0&&(w-=P),o.setFillStyle(T),o.moveTo(S,i.y),o.fillRect(S,i.y,i.width,w),o.closePath(),o.fill()}}break;case"meter":v=wa(m,g,f,r,s,t,i,a),c.push(v),v=ya(v,s,e.length,u,0,t,l.meterBorder);for(let e=0;e<v.length;e++){let i=v[e];if(null!==i&&e>h&&e<d){if(o.beginPath(),0==u&&l.meterBorder>0&&(o.setStrokeStyle(n.color),o.setLineWidth(l.meterBorder*t.pix)),0==u?o.setFillStyle(l.meterFillColor):o.setFillStyle(i.color||n.color),S=i.x-i.width/2,w=t.height-i.y-t.area[2],l.barBorderRadius&&4===l.barBorderRadius.length||!0===l.barBorderCircle){const e=S,t=i.y,a=i.width,n=y-i.y;l.barBorderCircle&&(l.barBorderRadius=[a/2,a/2,0,0]);let[r,s,c,h]=l.barBorderRadius,d=Math.min(a/2,n/2);r=r>d?d:r,s=s>d?d:s,c=c>d?d:c,h=h>d?d:h,r=r<0?0:r,s=s<0?0:s,c=c<0?0:c,h=h<0?0:h,o.arc(e+r,t+r,r,-Math.PI,-Math.PI/2),o.arc(e+a-s,t+s,s,-Math.PI/2,0),o.arc(e+a-c,t+n-c,c,0,Math.PI/2),o.arc(e+h,t+n-h,h,Math.PI/2,Math.PI),o.fill()}else o.moveTo(S,i.y),o.lineTo(S+i.width,i.y),o.lineTo(S+i.width,y),o.lineTo(S,y),o.lineTo(S,i.y),o.fill();0==u&&l.meterBorder>0&&(o.closePath(),o.stroke())}}}})),!1!==t.dataLabel&&1===a&&e.forEach((function(n,c){let h,d,u;h=[].concat(t.chartData.yAxisData.ranges[n.index]),d=h.pop(),u=h.shift();var p=n.data;switch(l.type){case"group":Ra(fa(Aa(p,d,u,r,s,t,i,a),s,e.length,c,0,t),n,i,o,t);break;case"stack":Ra(Ca(p,d,u,r,s,t,i,c,e,a),n,i,o,t);break;case"meter":Ra(wa(p,d,u,r,s,t,i,a),n,i,o,t)}})),o.restore(),{xAxisPoints:r,calPoints:c,eachSpacing:s}}(n,t,i,o,e),s=a.xAxisPoints,l=a.calPoints,c=a.eachSpacing;t.chartData.xAxisPoints=s,t.chartData.calPoints=l,t.chartData.eachSpacing=c,Va(0,t,i,o),!1!==t.enableMarkLine&&1===e&&ja(t,0,o),Ya(t.series,t,i,o,t.chartData),Ja(t,i,o,e),cn(0,o)},onAnimationFinish:function(){a.uevent.trigger("renderComplete")}});break;case"mount":this.animationInstance=new dn({timing:t.timing,duration:s,onProcess:function(e){o.clearRect(0,0,t.width,t.height),t.rotate&&Ia(o,t),Xa(0,t,0,o),Ka(r,t,i,o);var a=function(e,t,i,o){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,n=t.chartData.xAxisData,r=n.xAxisPoints,s=n.eachSpacing,l=Oo({},{type:"mount",widthRatio:1,borderWidth:1,barBorderCircle:!1,barBorderRadius:[],linearType:"none",linearOpacity:1,customColor:[],colorStop:0},t.extra.mount);l.widthRatio=l.widthRatio<=0?0:l.widthRatio,l.widthRatio=l.widthRatio>=2?2:l.widthRatio,o.save();let c,h,d,u=-2,p=r.length+2;t._scrollDistance_&&0!==t._scrollDistance_&&!0===t.enableScroll&&(o.translate(t._scrollDistance_,0),u=Math.floor(-t._scrollDistance_/s)-2,p=u+t.xAxis.itemCount+4),l.customColor=$o(l.linearType,l.customColor,e,i),c=[].concat(t.chartData.yAxisData.ranges[0]),h=c.pop(),d=c.shift();let g=(t.height-t.area[0]-t.area[2])*(0-h)/(d-h),f=t.height-Math.round(g)-t.area[2];var x=_a(e,h,d,r,s,t,l,f,a);switch(l.type){case"bar":for(let i=0;i<x.length;i++){let a=x[i];if(null!==a&&i>u&&i<p){var y=a.x-s*l.widthRatio/2,m=t.height-a.y-t.area[2];o.beginPath();var v=a.color||e[i].color,b=a.color||e[i].color;if("none"!==l.linearType){var S=o.createLinearGradient(y,a.y,y,f);"opacity"==l.linearType?(S.addColorStop(0,Ro(v,l.linearOpacity)),S.addColorStop(1,Ro(v,1))):(S.addColorStop(0,Ro(l.customColor[e[i].linearIndex],l.linearOpacity)),S.addColorStop(l.colorStop,Ro(l.customColor[e[i].linearIndex],l.linearOpacity)),S.addColorStop(1,Ro(v,1))),v=S}if(l.barBorderRadius&&4===l.barBorderRadius.length||!0===l.barBorderCircle){const e=y,t=a.y>f?f:a.y,i=a.width,n=Math.abs(f-a.y);l.barBorderCircle&&(l.barBorderRadius=[i/2,i/2,0,0]),a.y>f&&(l.barBorderRadius=[0,0,i/2,i/2]);let[r,s,c,h]=l.barBorderRadius,d=Math.min(i/2,n/2);r=r>d?d:r,s=s>d?d:s,c=c>d?d:c,h=h>d?d:h,r=r<0?0:r,s=s<0?0:s,c=c<0?0:c,h=h<0?0:h,o.arc(e+r,t+r,r,-Math.PI,-Math.PI/2),o.arc(e+i-s,t+s,s,-Math.PI/2,0),o.arc(e+i-c,t+n-c,c,0,Math.PI/2),o.arc(e+h,t+n-h,h,Math.PI/2,Math.PI)}else o.moveTo(y,a.y),o.lineTo(y+a.width,a.y),o.lineTo(y+a.width,f),o.lineTo(y,f),o.lineTo(y,a.y);o.setStrokeStyle(b),o.setFillStyle(v),l.borderWidth>0&&(o.setLineWidth(l.borderWidth*t.pix),o.closePath(),o.stroke()),o.fill()}}break;case"triangle":for(let i=0;i<x.length;i++){let a=x[i];null!==a&&i>u&&i<p&&(y=a.x-s*l.widthRatio/2,m=t.height-a.y-t.area[2],o.beginPath(),v=a.color||e[i].color,b=a.color||e[i].color,"none"!==l.linearType&&(S=o.createLinearGradient(y,a.y,y,f),"opacity"==l.linearType?(S.addColorStop(0,Ro(v,l.linearOpacity)),S.addColorStop(1,Ro(v,1))):(S.addColorStop(0,Ro(l.customColor[e[i].linearIndex],l.linearOpacity)),S.addColorStop(l.colorStop,Ro(l.customColor[e[i].linearIndex],l.linearOpacity)),S.addColorStop(1,Ro(v,1))),v=S),o.moveTo(y,f),o.lineTo(a.x,a.y),o.lineTo(y+a.width,f),o.setStrokeStyle(b),o.setFillStyle(v),l.borderWidth>0&&(o.setLineWidth(l.borderWidth*t.pix),o.stroke()),o.fill())}break;case"mount":for(let i=0;i<x.length;i++){let a=x[i];null!==a&&i>u&&i<p&&(y=a.x-s*l.widthRatio/2,m=t.height-a.y-t.area[2],o.beginPath(),v=a.color||e[i].color,b=a.color||e[i].color,"none"!==l.linearType&&(S=o.createLinearGradient(y,a.y,y,f),"opacity"==l.linearType?(S.addColorStop(0,Ro(v,l.linearOpacity)),S.addColorStop(1,Ro(v,1))):(S.addColorStop(0,Ro(l.customColor[e[i].linearIndex],l.linearOpacity)),S.addColorStop(l.colorStop,Ro(l.customColor[e[i].linearIndex],l.linearOpacity)),S.addColorStop(1,Ro(v,1))),v=S),o.moveTo(y,f),o.bezierCurveTo(a.x-a.width/4,f,a.x-a.width/4,a.y,a.x,a.y),o.bezierCurveTo(a.x+a.width/4,a.y,a.x+a.width/4,f,y+a.width,f),o.setStrokeStyle(b),o.setFillStyle(v),l.borderWidth>0&&(o.setLineWidth(l.borderWidth*t.pix),o.stroke()),o.fill())}break;case"sharp":for(let i=0;i<x.length;i++){let a=x[i];null!==a&&i>u&&i<p&&(y=a.x-s*l.widthRatio/2,m=t.height-a.y-t.area[2],o.beginPath(),v=a.color||e[i].color,b=a.color||e[i].color,"none"!==l.linearType&&(S=o.createLinearGradient(y,a.y,y,f),"opacity"==l.linearType?(S.addColorStop(0,Ro(v,l.linearOpacity)),S.addColorStop(1,Ro(v,1))):(S.addColorStop(0,Ro(l.customColor[e[i].linearIndex],l.linearOpacity)),S.addColorStop(l.colorStop,Ro(l.customColor[e[i].linearIndex],l.linearOpacity)),S.addColorStop(1,Ro(v,1))),v=S),o.moveTo(y,f),o.quadraticCurveTo(a.x-0,f-m/4,a.x,a.y),o.quadraticCurveTo(a.x+0,f-m/4,y+a.width,f),o.setStrokeStyle(b),o.setFillStyle(v),l.borderWidth>0&&(o.setLineWidth(l.borderWidth*t.pix),o.stroke()),o.fill())}}if(!1!==t.dataLabel&&1===a){let n,c,h;n=[].concat(t.chartData.yAxisData.ranges[0]),c=n.pop(),h=n.shift(),Na(x=_a(e,c,h,r,s,t,l,f,a),e,i,o,t,f)}return o.restore(),{xAxisPoints:r,calPoints:x,eachSpacing:s}}(n,t,i,o,e),s=a.xAxisPoints,l=a.calPoints,c=a.eachSpacing;t.chartData.xAxisPoints=s,t.chartData.calPoints=l,t.chartData.eachSpacing=c,Va(0,t,i,o),!1!==t.enableMarkLine&&1===e&&ja(t,0,o),Ya(t.series,t,i,o,t.chartData),Ja(t,i,o,e),cn(0,o)},onAnimationFinish:function(){a.uevent.trigger("renderComplete")}});break;case"bar":this.animationInstance=new dn({timing:t.timing,duration:s,onProcess:function(e){o.clearRect(0,0,t.width,t.height),t.rotate&&Ia(o,t),Ka(r,t,i,o);var a=function(e,t,i,o){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,n=[],r=(t.height-t.area[0]-t.area[2])/t.categories.length;for(let d=0;d<t.categories.length;d++)n.push(t.area[0]+r/2+r*d);let s=Oo({},{type:"group",width:r/2,meterBorder:4,meterFillColor:"#FFFFFF",barBorderCircle:!1,barBorderRadius:[],seriesGap:2,linearType:"none",linearOpacity:1,customColor:[],colorStop:0},t.extra.bar),l=[];o.save();let c=-2,h=n.length+2;return t.tooltip&&t.tooltip.textList&&t.tooltip.textList.length&&1===a&&Ha(t.tooltip.offset.y,t,0,o,r),s.customColor=$o(s.linearType,s.customColor,e,i),e.forEach((function(d,u){let p,g,f;p=[].concat(t.chartData.xAxisData.ranges),f=p.pop(),g=p.shift();var x=d.data;switch(s.type){case"group":var y=Pa(x,g,f,n,r,t,i,a),m=ka(x,g,f,n,r,t,i,u,e,a);l.push(m),y=xa(y,r,e.length,u,0,t);for(let e=0;e<y.length;e++){let i=y[e];if(null!==i&&e>c&&e<h){var v=t.area[3],b=i.y-i.width/2;i.height,o.beginPath();var S=i.color||d.color,w=i.color||d.color;if("none"!==s.linearType){var T=o.createLinearGradient(v,i.y,i.x,i.y);"opacity"==s.linearType?(T.addColorStop(0,Ro(S,s.linearOpacity)),T.addColorStop(1,Ro(S,1))):(T.addColorStop(0,Ro(s.customColor[d.linearIndex],s.linearOpacity)),T.addColorStop(s.colorStop,Ro(s.customColor[d.linearIndex],s.linearOpacity)),T.addColorStop(1,Ro(S,1))),S=T}if(s.barBorderRadius&&4===s.barBorderRadius.length||!0===s.barBorderCircle){const e=v,t=i.width,a=i.y-i.width/2,n=i.height;s.barBorderCircle&&(s.barBorderRadius=[t/2,t/2,0,0]);let[r,l,c,h]=s.barBorderRadius,d=Math.min(t/2,n/2);r=r>d?d:r,l=l>d?d:l,c=c>d?d:c,h=h>d?d:h,r=r<0?0:r,l=l<0?0:l,c=c<0?0:c,h=h<0?0:h,o.arc(e+h,a+h,h,-Math.PI,-Math.PI/2),o.arc(i.x-r,a+r,r,-Math.PI/2,0),o.arc(i.x-l,a+t-l,l,0,Math.PI/2),o.arc(e+c,a+t-c,c,Math.PI/2,Math.PI)}else o.moveTo(v,b),o.lineTo(i.x,b),o.lineTo(i.x,b+i.width),o.lineTo(v,b+i.width),o.lineTo(v,b),o.setLineWidth(1),o.setStrokeStyle(w);o.setFillStyle(S),o.closePath(),o.fill()}}break;case"stack":y=ka(x,g,f,n,r,t,i,u,e,a),l.push(y),y=va(y,r,e.length,0,0,t);for(let e=0;e<y.length;e++){let t=y[e];null!==t&&e>c&&e<h&&(o.beginPath(),S=t.color||d.color,v=t.x0,o.setFillStyle(S),o.moveTo(v,t.y-t.width/2),o.fillRect(v,t.y-t.width/2,t.height,t.width),o.closePath(),o.fill())}}})),!1!==t.dataLabel&&1===a&&e.forEach((function(l,c){let h,d,u;h=[].concat(t.chartData.xAxisData.ranges),u=h.pop(),d=h.shift();var p=l.data;switch(s.type){case"group":za(xa(Pa(p,d,u,n,r,t,i,a),r,e.length,c,0,t),l,i,o,t);break;case"stack":za(ka(p,d,u,n,r,t,i,c,e,a),l,i,o,t)}})),{yAxisPoints:n,calPoints:l,eachSpacing:r}}(n,t,i,o,e),s=a.yAxisPoints,l=a.calPoints,c=a.eachSpacing;t.chartData.yAxisPoints=s,t.chartData.xAxisPoints=t.chartData.xAxisData.xAxisPoints,t.chartData.calPoints=l,t.chartData.eachSpacing=c,Va(0,t,i,o),!1!==t.enableMarkLine&&1===e&&ja(t,0,o),Ya(t.series,t,i,o,t.chartData),Ja(t,i,o,e),cn(0,o)},onAnimationFinish:function(){a.uevent.trigger("renderComplete")}});break;case"area":this.animationInstance=new dn({timing:t.timing,duration:s,onProcess:function(e){o.clearRect(0,0,t.width,t.height),t.rotate&&Ia(o,t),Xa(0,t,0,o),Ka(r,t,i,o);var a=function(e,t,i,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,n=Oo({},{type:"straight",opacity:.2,addLine:!1,width:2,gradient:!1,activeType:"none"},t.extra.area);let r=t.chartData.xAxisData,s=r.xAxisPoints,l=r.eachSpacing,c=t.height-t.area[2],h=[];o.save();let d=0,u=t.width+l;return t._scrollDistance_&&0!==t._scrollDistance_&&!0===t.enableScroll&&(o.translate(t._scrollDistance_,0),d=-t._scrollDistance_-2*l+t.area[3],u=d+(t.xAxis.itemCount+4)*l),e.forEach((function(e,r){let p,g,f;p=[].concat(t.chartData.yAxisData.ranges[e.index]),g=p.pop(),f=p.shift();let x=wa(e.data,g,f,s,l,t,i,a);h.push(x);let y=aa(x,e);for(let i=0;i<y.length;i++){let a=y[i];if(o.beginPath(),o.setStrokeStyle(Ro(e.color,n.opacity)),n.gradient){let i=o.createLinearGradient(0,t.area[0],0,t.height-t.area[2]);i.addColorStop("0",Ro(e.color,n.opacity)),i.addColorStop("1.0",Ro("#FFFFFF",.1)),o.setFillStyle(i)}else o.setFillStyle(Ro(e.color,n.opacity));if(o.setLineWidth(n.width*t.pix),a.length>1){let e=a[0],t=a[a.length-1];o.moveTo(e.x,e.y);let i=0;if("curve"===n.type)for(let n=0;n<a.length;n++){let e=a[n];if(0==i&&e.x>d&&(o.moveTo(e.x,e.y),i=1),n>0&&e.x>d&&e.x<u){let t=Uo(a,n-1);o.bezierCurveTo(t.ctrA.x,t.ctrA.y,t.ctrB.x,t.ctrB.y,e.x,e.y)}}if("straight"===n.type)for(let n=0;n<a.length;n++){let e=a[n];0==i&&e.x>d&&(o.moveTo(e.x,e.y),i=1),n>0&&e.x>d&&e.x<u&&o.lineTo(e.x,e.y)}if("step"===n.type)for(let n=0;n<a.length;n++){let e=a[n];0==i&&e.x>d&&(o.moveTo(e.x,e.y),i=1),n>0&&e.x>d&&e.x<u&&(o.lineTo(e.x,a[n-1].y),o.lineTo(e.x,e.y))}o.lineTo(t.x,c),o.lineTo(e.x,c),o.lineTo(e.x,e.y)}else{let e=a[0];o.moveTo(e.x-l/2,e.y)}if(o.closePath(),o.fill(),n.addLine){if("dash"==e.lineType){let i=e.dashLength?e.dashLength:8;i*=t.pix,o.setLineDash([i,i])}if(o.beginPath(),o.setStrokeStyle(e.color),o.setLineWidth(n.width*t.pix),1===a.length)o.moveTo(a[0].x,a[0].y);else{o.moveTo(a[0].x,a[0].y);let e=0;if("curve"===n.type)for(let t=0;t<a.length;t++){let i=a[t];if(0==e&&i.x>d&&(o.moveTo(i.x,i.y),e=1),t>0&&i.x>d&&i.x<u){let e=Uo(a,t-1);o.bezierCurveTo(e.ctrA.x,e.ctrA.y,e.ctrB.x,e.ctrB.y,i.x,i.y)}}if("straight"===n.type)for(let t=0;t<a.length;t++){let i=a[t];0==e&&i.x>d&&(o.moveTo(i.x,i.y),e=1),t>0&&i.x>d&&i.x<u&&o.lineTo(i.x,i.y)}if("step"===n.type)for(let t=0;t<a.length;t++){let i=a[t];0==e&&i.x>d&&(o.moveTo(i.x,i.y),e=1),t>0&&i.x>d&&i.x<u&&(o.lineTo(i.x,a[t-1].y),o.lineTo(i.x,i.y))}o.moveTo(a[0].x,a[0].y)}o.stroke(),o.setLineDash([])}}!1!==t.dataPointShape&&Ma(x,e.color,e.pointShape,o,t),Fa(x,e.color,e.pointShape,o,t,n,r)})),!1!==t.dataLabel&&1===a&&e.forEach((function(e,n){let r,c,h;r=[].concat(t.chartData.yAxisData.ranges[e.index]),c=r.pop(),h=r.shift(),Ea(wa(e.data,c,h,s,l,t,i,a),e,i,o,t)})),o.restore(),{xAxisPoints:s,calPoints:h,eachSpacing:l}}(n,t,i,o,e),s=a.xAxisPoints,l=a.calPoints,c=a.eachSpacing;t.chartData.xAxisPoints=s,t.chartData.calPoints=l,t.chartData.eachSpacing=c,Va(0,t,i,o),!1!==t.enableMarkLine&&1===e&&ja(t,0,o),Ya(t.series,t,i,o,t.chartData),Ja(t,i,o,e),cn(0,o)},onAnimationFinish:function(){a.uevent.trigger("renderComplete")}});break;case"ring":case"pie":this.animationInstance=new dn({timing:t.timing,duration:s,onProcess:function(e){o.clearRect(0,0,t.width,t.height),t.rotate&&Ia(o,t),t.chartData.pieData=Qa(n,t,i,o,e),Ya(t.series,t,i,o,t.chartData),Ja(t,i,o,e),cn(0,o)},onAnimationFinish:function(){a.uevent.trigger("renderComplete")}});break;case"rose":this.animationInstance=new dn({timing:t.timing,duration:s,onProcess:function(e){o.clearRect(0,0,t.width,t.height),t.rotate&&Ia(o,t),t.chartData.pieData=function(e,t,i,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,n=Oo({},{type:"area",activeOpacity:.5,activeRadius:10,offsetAngle:0,labelWidth:15,border:!1,borderWidth:2,borderColor:"#FFFFFF",linearType:"none",customColor:[]},t.extra.rose);0==i.pieChartLinePadding&&(i.pieChartLinePadding=n.activeRadius*t.pix);var r={x:t.area[3]+(t.width-t.area[1]-t.area[3])/2,y:t.area[0]+(t.height-t.area[0]-t.area[2])/2},s=Math.min((t.width-t.area[1]-t.area[3])/2-i.pieChartLinePadding-i.pieChartTextPadding-i._pieTextMaxLength_,(t.height-t.area[0]-t.area[2])/2-i.pieChartLinePadding-i.pieChartTextPadding);s=s<10?10:s;var l=n.minRadius||.5*s;s<l&&(s=l+10),e=ha(e,n.type,l,s,a);var c=n.activeRadius*t.pix;return n.customColor=$o(n.linearType,n.customColor,e,i),(e=e.map((function(e){return e._start_+=(n.offsetAngle||0)*Math.PI/180,e}))).forEach((function(e,i){t.tooltip&&t.tooltip.index==i&&(o.beginPath(),o.setFillStyle(Ro(e.color,n.activeOpacity||.5)),o.moveTo(r.x,r.y),o.arc(r.x,r.y,c+e._radius_,e._start_,e._start_+2*e._rose_proportion_*Math.PI),o.closePath(),o.fill()),o.beginPath(),o.setLineWidth(n.borderWidth*t.pix),o.lineJoin="round",o.setStrokeStyle(n.borderColor);var a,s=e.color;"custom"==n.linearType&&((a=o.createCircularGradient?o.createCircularGradient(r.x,r.y,e._radius_):o.createRadialGradient(r.x,r.y,0,r.x,r.y,e._radius_)).addColorStop(0,Ro(n.customColor[e.linearIndex],1)),a.addColorStop(1,Ro(e.color,1)),s=a),o.setFillStyle(s),o.moveTo(r.x,r.y),o.arc(r.x,r.y,e._radius_,e._start_,e._start_+2*e._rose_proportion_*Math.PI),o.closePath(),o.fill(),1==n.border&&o.stroke()})),!1!==t.dataLabel&&1===a&&Wa(e,t,i,o,0,r),{center:r,radius:s,series:e}}(n,t,i,o,e),Ya(t.series,t,i,o,t.chartData),Ja(t,i,o,e),cn(0,o)},onAnimationFinish:function(){a.uevent.trigger("renderComplete")}});break;case"radar":this.animationInstance=new dn({timing:t.timing,duration:s,onProcess:function(e){o.clearRect(0,0,t.width,t.height),t.rotate&&Ia(o,t),t.chartData.radarData=function(e,t,i,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,n=Oo({},{gridColor:"#cccccc",gridType:"radar",gridEval:1,axisLabel:!1,axisLabelTofix:0,labelShow:!0,labelColor:"#666666",labelPointShow:!1,labelPointRadius:3,labelPointColor:"#cccccc",opacity:.2,gridCount:3,border:!1,borderWidth:2,linearType:"none",customColor:[]},t.extra.radar),r=Yo(t.categories.length),s={x:t.area[3]+(t.width-t.area[1]-t.area[3])/2,y:t.area[0]+(t.height-t.area[0]-t.area[2])/2},l=(t.width-t.area[1]-t.area[3])/2,c=(t.height-t.area[0]-t.area[2])/2,h=Math.min(l-(Vo(t.categories,i.fontSize,o)+i.radarLabelTextMargin),c-i.radarLabelTextMargin);h=(h-=i.radarLabelTextMargin*t.pix)<10?10:h,h=n.radius?n.radius:h,o.beginPath(),o.setLineWidth(1*t.pix),o.setStrokeStyle(n.gridColor),r.forEach((function(e,t){var i=Wo(h*Math.cos(e),h*Math.sin(e),s);o.moveTo(s.x,s.y),t%n.gridEval==0&&o.lineTo(i.x,i.y)})),o.stroke(),o.closePath();for(var d=function(e){var i={};if(o.beginPath(),o.setLineWidth(1*t.pix),o.setStrokeStyle(n.gridColor),"radar"==n.gridType)r.forEach((function(t,a){var r=Wo(h/n.gridCount*e*Math.cos(t),h/n.gridCount*e*Math.sin(t),s);0===a?(i=r,o.moveTo(r.x,r.y)):o.lineTo(r.x,r.y)})),o.lineTo(i.x,i.y);else{var a=Wo(h/n.gridCount*e*Math.cos(1.5),h/n.gridCount*e*Math.sin(1.5),s);o.arc(s.x,s.y,s.y-a.y,0,2*Math.PI,!1)}o.stroke(),o.closePath()},u=1;u<=n.gridCount;u++)d(u);n.customColor=$o(n.linearType,n.customColor,e,i);var p=sa(r,s,h,e,t,a);if(p.forEach((function(i,a){o.beginPath(),o.setLineWidth(n.borderWidth*t.pix),o.setStrokeStyle(i.color);var r,l=Ro(i.color,n.opacity);"custom"==n.linearType&&((r=o.createCircularGradient?o.createCircularGradient(s.x,s.y,h):o.createRadialGradient(s.x,s.y,0,s.x,s.y,h)).addColorStop(0,Ro(n.customColor[e[a].linearIndex],n.opacity)),r.addColorStop(1,Ro(i.color,n.opacity)),l=r),o.setFillStyle(l),i.data.forEach((function(e,t){0===t?o.moveTo(e.position.x,e.position.y):o.lineTo(e.position.x,e.position.y)})),o.closePath(),o.fill(),!0===n.border&&o.stroke(),o.closePath(),!1!==t.dataPointShape&&Ma(i.data.map((function(e){return e.position})),i.color,i.pointShape,o,t)})),!0===n.axisLabel){const i=Math.max(n.max,Math.max.apply(null,Go(e))),a=h/n.gridCount,r=t.fontSize*t.pix;for(o.setFontSize(r),o.setFillStyle(t.fontColor),o.setTextAlign("left"),u=0;u<n.gridCount+1;u++){let e=u*i/n.gridCount;e=e.toFixed(n.axisLabelTofix),o.fillText(String(e),s.x+3*t.pix,s.y-u*a+r/2)}}return Ua(r,h,s,t,i,o),!1!==t.dataLabel&&1===a&&(p.forEach((function(e,a){o.beginPath();var n=e.textSize*t.pix||i.fontSize;o.setFontSize(n),o.setFillStyle(e.textColor||t.fontColor),e.data.forEach((function(e,t){Math.abs(e.position.x-s.x)<2?e.position.y<s.y?(o.setTextAlign("center"),o.fillText(e.value,e.position.x,e.position.y-4)):(o.setTextAlign("center"),o.fillText(e.value,e.position.x,e.position.y+n+2)):e.position.x<s.x?(o.setTextAlign("right"),o.fillText(e.value,e.position.x-4,e.position.y+n/2-2)):(o.setTextAlign("left"),o.fillText(e.value,e.position.x+4,e.position.y+n/2-2))})),o.closePath(),o.stroke()})),o.setTextAlign("left")),{center:s,radius:h,angleList:r}}(n,t,i,o,e),Ya(t.series,t,i,o,t.chartData),Ja(t,i,o,e),cn(0,o)},onAnimationFinish:function(){a.uevent.trigger("renderComplete")}});break;case"arcbar":this.animationInstance=new dn({timing:t.timing,duration:s,onProcess:function(e){o.clearRect(0,0,t.width,t.height),t.rotate&&Ia(o,t),t.chartData.arcbarData=function(e,t,i,o){var a,n,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,s=Oo({},{startAngle:.75,endAngle:.25,type:"default",direction:"cw",lineCap:"round",width:12,gap:2,linearType:"none",customColor:[]},t.extra.arcbar);e=da(e,s,r),a=s.centerX||s.centerY?{x:s.centerX?s.centerX:t.width/2,y:s.centerY?s.centerY:t.height/2}:{x:t.width/2,y:t.height/2},s.radius?n=s.radius:(n=Math.min(a.x,a.y),n-=5*t.pix,n-=s.width/2),n=n<10?10:n,s.customColor=$o(s.linearType,s.customColor,e,i);for(let h=0;h<e.length;h++){let i=e[h];o.setLineWidth(s.width*t.pix),o.setStrokeStyle(s.backgroundColor||"#E9E9E9"),o.setLineCap(s.lineCap),o.beginPath(),"default"==s.type?o.arc(a.x,a.y,n-(s.width*t.pix+s.gap*t.pix)*h,s.startAngle*Math.PI,s.endAngle*Math.PI,"ccw"==s.direction):o.arc(a.x,a.y,n-(s.width*t.pix+s.gap*t.pix)*h,0,2*Math.PI,"ccw"==s.direction),o.stroke();var l=i.color;if("custom"==s.linearType){var c=o.createLinearGradient(a.x-n,a.y,a.x+n,a.y);c.addColorStop(1,Ro(s.customColor[i.linearIndex],1)),c.addColorStop(0,Ro(i.color,1)),l=c}o.setLineWidth(s.width*t.pix),o.setStrokeStyle(l),o.setLineCap(s.lineCap),o.beginPath(),o.arc(a.x,a.y,n-(s.width*t.pix+s.gap*t.pix)*h,s.startAngle*Math.PI,i._proportion_*Math.PI,"ccw"==s.direction),o.stroke()}return Oa(t,i,o,a),{center:a,radius:n,series:e}}(n,t,i,o,e),cn(0,o)},onAnimationFinish:function(){a.uevent.trigger("renderComplete")}});break;case"gauge":this.animationInstance=new dn({timing:t.timing,duration:s,onProcess:function(e){o.clearRect(0,0,t.width,t.height),t.rotate&&Ia(o,t),t.chartData.gaugeData=function(e,t,i,o,a){var n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,r=Oo({},{type:"default",startAngle:.75,endAngle:.25,width:15,labelOffset:13,splitLine:{fixRadius:0,splitNumber:10,width:15,color:"#FFFFFF",childNumber:5,childWidth:5},pointer:{width:15,color:"auto"}},i.extra.gauge);null==r.oldAngle&&(r.oldAngle=r.startAngle),null==r.oldData&&(r.oldData=0),e=pa(e,r.startAngle,r.endAngle);var s={x:i.width/2,y:i.height/2},l=Math.min(s.x,s.y);l-=5*i.pix;var c=(l=(l-=r.width/2)<10?10:l)-r.width,h=0;if("progress"==r.type){var d=l-3*r.width;a.beginPath();let e=a.createLinearGradient(s.x,s.y-d,s.x,s.y+d);e.addColorStop("0",Ro(t[0].color,.3)),e.addColorStop("1.0",Ro("#FFFFFF",.1)),a.setFillStyle(e),a.arc(s.x,s.y,d,0,2*Math.PI,!1),a.fill(),a.setLineWidth(r.width),a.setStrokeStyle(Ro(t[0].color,.3)),a.setLineCap("round"),a.beginPath(),a.arc(s.x,s.y,c,r.startAngle*Math.PI,r.endAngle*Math.PI,!1),a.stroke(),h=r.endAngle<r.startAngle?2+r.endAngle-r.startAngle:r.startAngle-r.endAngle,r.splitLine.splitNumber;let o=h/r.splitLine.splitNumber/r.splitLine.childNumber,u=-l-.5*r.width-r.splitLine.fixRadius,p=-l-r.width-r.splitLine.fixRadius+r.splitLine.width;a.save(),a.translate(s.x,s.y),a.rotate((r.startAngle-1)*Math.PI);let g=r.splitLine.splitNumber*r.splitLine.childNumber+1,f=t[0].data*n;for(let n=0;n<g;n++)a.beginPath(),f>n/g?a.setStrokeStyle(Ro(t[0].color,1)):a.setStrokeStyle(Ro(t[0].color,.3)),a.setLineWidth(3*i.pix),a.moveTo(u,0),a.lineTo(p,0),a.stroke(),a.rotate(o*Math.PI);a.restore(),t=ua(t,r,n),a.setLineWidth(r.width),a.setStrokeStyle(t[0].color),a.setLineCap("round"),a.beginPath(),a.arc(s.x,s.y,c,r.startAngle*Math.PI,t[0]._proportion_*Math.PI,!1),a.stroke();let x=l-2.5*r.width;a.save(),a.translate(s.x,s.y),a.rotate((t[0]._proportion_-1)*Math.PI),a.beginPath(),a.setLineWidth(r.width/3);let y=a.createLinearGradient(0,.6*-x,0,.6*x);y.addColorStop("0",Ro("#FFFFFF",0)),y.addColorStop("0.5",Ro(t[0].color,1)),y.addColorStop("1.0",Ro("#FFFFFF",0)),a.setStrokeStyle(y),a.arc(0,0,x,.85*Math.PI,1.15*Math.PI,!1),a.stroke(),a.beginPath(),a.setLineWidth(1),a.setStrokeStyle(t[0].color),a.setFillStyle(t[0].color),a.moveTo(-x-r.width/3/2,-4),a.lineTo(-x-r.width/3/2-4,0),a.lineTo(-x-r.width/3/2,4),a.lineTo(-x-r.width/3/2,-4),a.stroke(),a.fill(),a.restore()}else{a.setLineWidth(r.width),a.setLineCap("butt");for(let t=0;t<e.length;t++){let i=e[t];a.beginPath(),a.setStrokeStyle(i.color),a.arc(s.x,s.y,l,i._startAngle_*Math.PI,i._endAngle_*Math.PI,!1),a.stroke()}a.save();let d=(h=r.endAngle<r.startAngle?2+r.endAngle-r.startAngle:r.startAngle-r.endAngle)/r.splitLine.splitNumber,u=h/r.splitLine.splitNumber/r.splitLine.childNumber,p=-l-.5*r.width-r.splitLine.fixRadius,g=-l-.5*r.width-r.splitLine.fixRadius+r.splitLine.width,f=-l-.5*r.width-r.splitLine.fixRadius+r.splitLine.childWidth;a.translate(s.x,s.y),a.rotate((r.startAngle-1)*Math.PI);for(let e=0;e<r.splitLine.splitNumber+1;e++)a.beginPath(),a.setStrokeStyle(r.splitLine.color),a.setLineWidth(2*i.pix),a.moveTo(p,0),a.lineTo(g,0),a.stroke(),a.rotate(d*Math.PI);a.restore(),a.save(),a.translate(s.x,s.y),a.rotate((r.startAngle-1)*Math.PI);for(let e=0;e<r.splitLine.splitNumber*r.splitLine.childNumber+1;e++)a.beginPath(),a.setStrokeStyle(r.splitLine.color),a.setLineWidth(1*i.pix),a.moveTo(p,0),a.lineTo(f,0),a.stroke(),a.rotate(u*Math.PI);a.restore(),t=ga(t,e,r,n);for(let e=0;e<t.length;e++){let i=t[e];a.save(),a.translate(s.x,s.y),a.rotate((i._proportion_-1)*Math.PI),a.beginPath(),a.setFillStyle(i.color),a.moveTo(r.pointer.width,0),a.lineTo(0,-r.pointer.width/2),a.lineTo(-c,0),a.lineTo(0,r.pointer.width/2),a.lineTo(r.pointer.width,0),a.closePath(),a.fill(),a.beginPath(),a.setFillStyle("#FFFFFF"),a.arc(0,0,r.pointer.width/6,0,2*Math.PI,!1),a.fill(),a.restore()}!1!==i.dataLabel&&Ba(r,l,s,i,o,a)}return Oa(i,o,a,s),1===n&&"gauge"===i.type&&(i.extra.gauge.oldAngle=t[0]._proportion_,i.extra.gauge.oldData=t[0].data),{center:s,radius:l,innerRadius:c,categories:e,totalAngle:h}}(r,n,t,i,o,e),cn(0,o)},onAnimationFinish:function(){a.uevent.trigger("renderComplete")}});break;case"candle":this.animationInstance=new dn({timing:t.timing,duration:s,onProcess:function(e){o.clearRect(0,0,t.width,t.height),t.rotate&&Ia(o,t),Xa(0,t,0,o),Ka(r,t,i,o);var a=function(e,t,i,o,a){var n=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,r=Oo({},{color:{},average:{}},i.extra.candle);r.color=Oo({},{upLine:"#f04864",upFill:"#f04864",downLine:"#2fc25b",downFill:"#2fc25b"},r.color),r.average=Oo({},{show:!1,name:[],day:[],color:o.color},r.average),i.extra.candle=r;let s=i.chartData.xAxisData,l=s.xAxisPoints,c=s.eachSpacing,h=[];a.save();let d=-2,u=l.length+2,p=0,g=i.width+c;return i._scrollDistance_&&0!==i._scrollDistance_&&!0===i.enableScroll&&(a.translate(i._scrollDistance_,0),d=Math.floor(-i._scrollDistance_/c)-2,u=d+i.xAxis.itemCount+4,p=-i._scrollDistance_-2*c+i.area[3],g=p+(i.xAxis.itemCount+4)*c),(r.average.show||t)&&t.forEach((function(e,t){let r,s,h;r=[].concat(i.chartData.yAxisData.ranges[e.index]),s=r.pop(),h=r.shift();var d=aa(wa(e.data,s,h,l,c,i,o,n),e);for(let i=0;i<d.length;i++){let t=d[i];if(a.beginPath(),a.setStrokeStyle(e.color),a.setLineWidth(1),1===t.length)a.moveTo(t[0].x,t[0].y),a.arc(t[0].x,t[0].y,1,0,2*Math.PI);else{a.moveTo(t[0].x,t[0].y);let e=0;for(let i=0;i<t.length;i++){let o=t[i];if(0==e&&o.x>p&&(a.moveTo(o.x,o.y),e=1),i>0&&o.x>p&&o.x<g){var u=Uo(t,i-1);a.bezierCurveTo(u.ctrA.x,u.ctrA.y,u.ctrB.x,u.ctrB.y,o.x,o.y)}}a.moveTo(t[0].x,t[0].y)}a.closePath(),a.stroke()}})),e.forEach((function(e,t){let s,p,g;s=[].concat(i.chartData.yAxisData.ranges[e.index]),p=s.pop(),g=s.shift();var f=e.data,x=Sa(f,p,g,l,c,i,o,n);h.push(x);var y=aa(x,e);for(let o=0;o<y[0].length;o++)if(o>d&&o<u){let e=y[0][o];a.beginPath(),f[o][1]-f[o][0]>0?(a.setStrokeStyle(r.color.upLine),a.setFillStyle(r.color.upFill),a.setLineWidth(1*i.pix),a.moveTo(e[3].x,e[3].y),a.lineTo(e[1].x,e[1].y),a.lineTo(e[1].x-c/4,e[1].y),a.lineTo(e[0].x-c/4,e[0].y),a.lineTo(e[0].x,e[0].y),a.lineTo(e[2].x,e[2].y),a.lineTo(e[0].x,e[0].y),a.lineTo(e[0].x+c/4,e[0].y),a.lineTo(e[1].x+c/4,e[1].y),a.lineTo(e[1].x,e[1].y),a.moveTo(e[3].x,e[3].y)):(a.setStrokeStyle(r.color.downLine),a.setFillStyle(r.color.downFill),a.setLineWidth(1*i.pix),a.moveTo(e[3].x,e[3].y),a.lineTo(e[0].x,e[0].y),a.lineTo(e[0].x-c/4,e[0].y),a.lineTo(e[1].x-c/4,e[1].y),a.lineTo(e[1].x,e[1].y),a.lineTo(e[2].x,e[2].y),a.lineTo(e[1].x,e[1].y),a.lineTo(e[1].x+c/4,e[1].y),a.lineTo(e[0].x+c/4,e[0].y),a.lineTo(e[0].x,e[0].y),a.moveTo(e[3].x,e[3].y)),a.closePath(),a.fill(),a.stroke()}})),a.restore(),{xAxisPoints:l,calPoints:h,eachSpacing:c}}(n,l,t,i,o,e),s=a.xAxisPoints,c=a.calPoints,h=a.eachSpacing;t.chartData.xAxisPoints=s,t.chartData.calPoints=c,t.chartData.eachSpacing=h,Va(0,t,i,o),!1!==t.enableMarkLine&&1===e&&ja(t,0,o),Ya(l?0:t.series,t,i,o,t.chartData),Ja(t,i,o,e),cn(0,o)},onAnimationFinish:function(){a.uevent.trigger("renderComplete")}})}}function pn(){this.events={}}dn.prototype.stop=function(){this.isStop=!0},pn.prototype.addEventListener=function(e,t){this.events[e]=this.events[e]||[],this.events[e].push(t)},pn.prototype.delEventListener=function(e){this.events[e]=[]},pn.prototype.trigger=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];var o=t[0],a=t.slice(1);this.events[o]&&this.events[o].forEach((function(e){try{e.apply(null,a)}catch(it){}}))};var gn=function(e){e.pix=e.pixelRatio?e.pixelRatio:1,e.fontSize=e.fontSize?e.fontSize:13,e.fontColor=e.fontColor?e.fontColor:Fo.fontColor,""!=e.background&&"none"!=e.background||(e.background="#FFFFFF"),e.title=Oo({},e.title),e.subtitle=Oo({},e.subtitle),e.duration=e.duration?e.duration:1e3,e.yAxis=Oo({},{data:[],showTitle:!1,disabled:!1,disableGrid:!1,gridSet:"number",splitNumber:5,gridType:"solid",dashLength:4*e.pix,gridColor:"#cccccc",padding:10,fontColor:"#666666"},e.yAxis),e.xAxis=Oo({},{rotateLabel:!1,rotateAngle:45,disabled:!1,disableGrid:!1,splitNumber:5,calibration:!1,fontColor:"#666666",fontSize:13,lineHeight:20,marginTop:0,gridType:"solid",dashLength:4,scrollAlign:"left",boundaryGap:"center",axisLine:!0,axisLineColor:"#cccccc",titleFontSize:13,titleOffsetY:0,titleOffsetX:0,titleFontColor:"#666666"},e.xAxis),e.xAxis.scrollPosition=e.xAxis.scrollAlign,e.legend=Oo({},{show:!0,position:"bottom",float:"center",backgroundColor:"rgba(0,0,0,0)",borderColor:"rgba(0,0,0,0)",borderWidth:0,padding:5,margin:5,itemGap:10,fontSize:e.fontSize,lineHeight:e.fontSize,fontColor:e.fontColor,formatter:{},hiddenColor:"#CECECE"},e.legend),e.extra=Oo({tooltip:{legendShape:"auto"}},e.extra),e.rotate=!!e.rotate,e.animation=!!e.animation,e.rotate=!!e.rotate,e.canvas2d=!!e.canvas2d;let t=Oo({},Fo);if(t.color=e.color?e.color:t.color,"pie"==e.type&&(t.pieChartLinePadding=!1===e.dataLabel?0:e.extra.pie.labelWidth*e.pix||t.pieChartLinePadding*e.pix),"ring"==e.type&&(t.pieChartLinePadding=!1===e.dataLabel?0:e.extra.ring.labelWidth*e.pix||t.pieChartLinePadding*e.pix),"rose"==e.type&&(t.pieChartLinePadding=!1===e.dataLabel?0:e.extra.rose.labelWidth*e.pix||t.pieChartLinePadding*e.pix),t.pieChartTextPadding=!1===e.dataLabel?0:t.pieChartTextPadding*e.pix,t.rotate=e.rotate,e.rotate){let t=e.width,i=e.height;e.width=i,e.height=t}if(e.padding=e.padding?e.padding:t.padding,t.yAxisWidth=Fo.yAxisWidth*e.pix,t.fontSize=e.fontSize*e.pix,t.titleFontSize=Fo.titleFontSize*e.pix,t.subtitleFontSize=Fo.subtitleFontSize*e.pix,!e.context)throw new Error("[uCharts] 未获取到context!注意:v2.0版本后,需要自行获取canvas的绘图上下文并传入opts.context!");this.context=e.context,this.context.setTextAlign||(this.context.setStrokeStyle=function(e){return this.strokeStyle=e},this.context.setLineWidth=function(e){return this.lineWidth=e},this.context.setLineCap=function(e){return this.lineCap=e},this.context.setFontSize=function(e){return this.font=e+"px sans-serif"},this.context.setFillStyle=function(e){return this.fillStyle=e},this.context.setTextAlign=function(e){return this.textAlign=e},this.context.setTextBaseline=function(e){return this.textBaseline=e},this.context.setShadow=function(e,t,i,o){this.shadowColor=o,this.shadowOffsetX=e,this.shadowOffsetY=t,this.shadowBlur=i},this.context.draw=function(){}),this.context.setLineDash||(this.context.setLineDash=function(e){}),e.chartData={},this.uevent=new pn,this.scrollOption={currentOffset:0,startTouchX:0,distance:0,lastMoveTime:0},this.opts=e,this.config=t,un.call(this,e.type,e,t,this.context)};gn.prototype.updateData=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.opts=Oo({},this.opts,e),this.opts.updateData=!0;let t=e.scrollPosition||"current";switch(t){case"current":this.opts._scrollDistance_=this.scrollOption.currentOffset;break;case"left":this.opts._scrollDistance_=0,this.scrollOption={currentOffset:0,startTouchX:0,distance:0,lastMoveTime:0};break;case"right":let e=La(this.opts.series,this.opts,this.config,this.context).yAxisWidth;this.config.yAxisWidth=e;let t=0,i=ba(this.opts.categories,this.opts,this.config),o=i.xAxisPoints,a=i.startX;t=i.endX-a-i.eachSpacing*(o.length-1),this.scrollOption={currentOffset:t,startTouchX:t,distance:0,lastMoveTime:0},this.opts._scrollDistance_=t}un.call(this,this.opts.type,this.opts,this.config,this.context)},gn.prototype.zoom=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.opts.xAxis.itemCount;if(!0!==this.opts.enableScroll)return void console.log("[uCharts] 请启用滚动条后使用");let t=Math.round(Math.abs(this.scrollOption.currentOffset)/this.opts.chartData.eachSpacing)+Math.round(this.opts.xAxis.itemCount/2);this.opts.animation=!1,this.opts.xAxis.itemCount=e.itemCount;let i=La(this.opts.series,this.opts,this.config,this.context),o=i.yAxisWidth;this.config.yAxisWidth=o;let a=0,n=ba(this.opts.categories,this.opts,this.config),r=n.xAxisPoints,s=n.startX,l=n.endX,c=n.eachSpacing,h=c*t,d=l-s,u=d-c*(r.length-1);a=d/2-h,a>0&&(a=0),a<u&&(a=u),this.scrollOption={currentOffset:a,startTouchX:0,distance:0,lastMoveTime:0},zo(this,a,this.opts.chartData,this.config,this.opts),this.opts._scrollDistance_=a,un.call(this,this.opts.type,this.opts,this.config,this.context)},gn.prototype.dobuleZoom=function(e){if(!0!==this.opts.enableScroll)return void console.log("[uCharts] 请启用滚动条后使用");const t=e.changedTouches;if(t.length<2)return;for(var i=0;i<t.length;i++)t[i].x=t[i].x?t[i].x:t[i].clientX,t[i].y=t[i].y?t[i].y:t[i].clientY;const o=[Ko(t[0],this.opts,e),Ko(t[1],this.opts,e)],a=Math.abs(o[0].x-o[1].x);if(!this.scrollOption.moveCount){let e={changedTouches:[{x:t[0].x,y:this.opts.area[0]/this.opts.pix+2}]},i={changedTouches:[{x:t[1].x,y:this.opts.area[0]/this.opts.pix+2}]};this.opts.rotate&&(e={changedTouches:[{x:this.opts.height/this.opts.pix-this.opts.area[0]/this.opts.pix-2,y:t[0].y}]},i={changedTouches:[{x:this.opts.height/this.opts.pix-this.opts.area[0]/this.opts.pix-2,y:t[1].y}]});const o=this.getCurrentDataIndex(e).index,a=this.getCurrentDataIndex(i).index,n=Math.abs(o-a);return this.scrollOption.moveCount=n,this.scrollOption.moveCurrent1=Math.min(o,a),void(this.scrollOption.moveCurrent2=Math.max(o,a))}let n=a/this.scrollOption.moveCount,r=(this.opts.width-this.opts.area[1]-this.opts.area[3])/n;r=r<=2?2:r,r=r>=this.opts.categories.length?this.opts.categories.length:r,this.opts.animation=!1,this.opts.xAxis.itemCount=r;let s=0,l=ba(this.opts.categories,this.opts,this.config),c=l.xAxisPoints,h=l.startX,d=l.endX,u=l.eachSpacing,p=u*this.scrollOption.moveCurrent1,g=d-h-u*(c.length-1);s=-p+Math.min(o[0].x,o[1].x)-this.opts.area[3]-u,s>0&&(s=0),s<g&&(s=g),this.scrollOption.currentOffset=s,this.scrollOption.startTouchX=0,this.scrollOption.distance=0,zo(this,s,this.opts.chartData,this.config,this.opts),this.opts._scrollDistance_=s,un.call(this,this.opts.type,this.opts,this.config,this.context)},gn.prototype.stopAnimation=function(){this.animationInstance&&this.animationInstance.stop()},gn.prototype.addEventListener=function(e,t){this.uevent.addEventListener(e,t)},gn.prototype.delEventListener=function(e){this.uevent.delEventListener(e)},gn.prototype.getCurrentDataIndex=function(e){var t=null;if(t=e.changedTouches?e.changedTouches[0]:e.mp.changedTouches[0]){let i=Ko(t,this.opts,e);return"pie"===this.opts.type||"ring"===this.opts.type?function(e,t,i){var o=-1,a=la(t.series);if(t&&t.center&&oa(e,t.center,t.radius)){var n=Math.atan2(t.center.y-e.y,e.x-t.center.x);n=-n,i.extra.pie&&i.extra.pie.offsetAngle&&(n-=i.extra.pie.offsetAngle*Math.PI/180),i.extra.ring&&i.extra.ring.offsetAngle&&(n-=i.extra.ring.offsetAngle*Math.PI/180);for(var r=0,s=a.length;r<s;r++)if(Bo(n,a[r]._start_,a[r]._start_+2*a[r]._proportion_*Math.PI)){o=r;break}}return o}({x:i.x,y:i.y},this.opts.chartData.pieData,this.opts):"rose"===this.opts.type?function(e,t,i){var o=-1,a=ha(i._series_,i.extra.rose.type,t.radius,t.radius);if(t&&t.center&&oa(e,t.center,t.radius)){var n=Math.atan2(t.center.y-e.y,e.x-t.center.x);n=-n,i.extra.rose&&i.extra.rose.offsetAngle&&(n-=i.extra.rose.offsetAngle*Math.PI/180);for(var r=0,s=a.length;r<s;r++)if(Bo(n,a[r]._start_,a[r]._start_+2*a[r]._rose_proportion_*Math.PI)){o=r;break}}return o}({x:i.x,y:i.y},this.opts.chartData.pieData,this.opts):"radar"===this.opts.type?function(e,t,i){var o=2*Math.PI/i,a=-1;if(oa(e,t.center,t.radius)){var n=function(e){return e<0&&(e+=2*Math.PI),e>2*Math.PI&&(e-=2*Math.PI),e},r=Math.atan2(t.center.y-e.y,e.x-t.center.x);(r*=-1)<0&&(r+=2*Math.PI),t.angleList.map((function(e){return n(-1*e)})).forEach((function(e,t){var i=n(e-o/2),s=n(e+o/2);s<i&&(s+=2*Math.PI),(r>=i&&r<=s||r+2*Math.PI>=i&&r+2*Math.PI<=s)&&(a=t)}))}return a}({x:i.x,y:i.y},this.opts.chartData.radarData,this.opts.categories.length):"funnel"===this.opts.type?function(e,t){for(var i=-1,o=0,a=t.series.length;o<a;o++){var n=t.series[o];if(e.x>n.funnelArea[0]&&e.x<n.funnelArea[2]&&e.y>n.funnelArea[1]&&e.y<n.funnelArea[3]){i=o;break}}return i}({x:i.x,y:i.y},this.opts.chartData.funnelData):"map"===this.opts.type?function(e,t){for(var i,o,a,n,r,s,l=-1,c=t.chartData.mapData,h=t.series,d=(i=e.y,o=e.x,a=c.bounds,n=c.scale,r=c.xoffset,s=c.yoffset,{x:(o-r)/n+a.xMin,y:a.yMax-(i-s)/n}),u=[d.x,d.y],p=0,g=h.length;p<g;p++)if(on(u,h[p].geometry.coordinates,t.chartData.mapData.mercator)){l=p;break}return l}({x:i.x,y:i.y},this.opts):"word"===this.opts.type?function(e,t){for(var i=-1,o=0,a=t.length;o<a;o++){var n=t[o];if(e.x>n.area[0]&&e.x<n.area[2]&&e.y>n.area[1]&&e.y<n.area[3]){i=o;break}}return i}({x:i.x,y:i.y},this.opts.chartData.wordCloudData):"bar"===this.opts.type?function(e,t,i,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,n={index:-1,group:[]},r=i.chartData.eachSpacing/2;let s=i.chartData.yAxisPoints;return t&&t.length>0&&ia(e,i)&&s.forEach((function(t,i){e.y+a+r>t&&(n.index=i)})),n}({x:i.x,y:i.y},this.opts.chartData.calPoints,this.opts,this.config,Math.abs(this.scrollOption.currentOffset)):function(e,t,i,o){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,n={index:-1,group:[]},r=i.chartData.eachSpacing/2;let s=[];if(t&&t.length>0){if(i.categories){for(let e=1;e<i.chartData.xAxisPoints.length;e++)s.push(i.chartData.xAxisPoints[e]-r);"line"!=i.type&&"area"!=i.type||"justify"!=i.xAxis.boundaryGap||(s=i.chartData.xAxisPoints)}else r=0;if(ia(e,i))if(i.categories)s.forEach((function(t,i){e.x+a+r>t&&(n.index=i)}));else{let i=Array(t.length);for(let n=0;n<t.length;n++){i[n]=Array(t[n].length);for(let o=0;o<t[n].length;o++)i[n][o]=Math.abs(t[n][o].x-e.x)}let o=Array(i.length),a=Array(i.length);for(let e=0;e<i.length;e++)o[e]=Math.min.apply(null,i[e]),a[e]=i[e].indexOf(o[e]);let r=Math.min.apply(null,o);n.index=[];for(let e=0;e<o.length;e++)o[e]==r&&(n.group.push(e),n.index.push(a[e]))}}return n}({x:i.x,y:i.y},this.opts.chartData.calPoints,this.opts,this.config,Math.abs(this.scrollOption.currentOffset))}return-1},gn.prototype.getLegendDataIndex=function(e){var t=null;if(t=e.changedTouches?e.changedTouches[0]:e.mp.changedTouches[0]){let i=Ko(t,this.opts,e);return function(e,t,i){let o=-1;if(function(e,t){return e.x>t.start.x&&e.x<t.end.x&&e.y>t.start.y&&e.y<t.end.y}(e,t.area)){let i=t.points,a=-1;for(let t=0,n=i.length;t<n;t++){let n=i[t];for(let t=0;t<n.length;t++){a+=1;let i=n[t].area;if(i&&e.x>i[0]-0&&e.x<i[2]+0&&e.y>i[1]-0&&e.y<i[3]+0){o=a;break}}}return o}return o}({x:i.x,y:i.y},this.opts.chartData.legendData)}return-1},gn.prototype.touchLegend=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null;if(i=e.changedTouches?e.changedTouches[0]:e.mp.changedTouches[0]){Ko(i,this.opts,e);var o=this.getLegendDataIndex(e);o>=0&&("candle"==this.opts.type?this.opts.seriesMA[o].show=!this.opts.seriesMA[o].show:this.opts.series[o].show=!this.opts.series[o].show,this.opts.animation=!!t.animation,this.opts._scrollDistance_=this.scrollOption.currentOffset,un.call(this,this.opts.type,this.opts,this.config,this.context))}},gn.prototype.showToolTip=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=null;(i=e.changedTouches?e.changedTouches[0]:e.mp.changedTouches[0])||console.log("[uCharts] 未获取到event坐标信息");var o=Ko(i,this.opts,e),a=this.scrollOption.currentOffset,n=Oo({},this.opts,{_scrollDistance_:a,animation:!1});if("line"===this.opts.type||"area"===this.opts.type||"column"===this.opts.type||"scatter"===this.opts.type||"bubble"===this.opts.type){var r=this.getCurrentDataIndex(e);if((u=null==t.index?r.index:t.index)>-1||u.length>0)if(0!==(l=Xo(this.opts.series,u,r.group)).length){var s=(d=Qo(l,this.opts,u,r.group,this.opts.categories,t)).textList;(c=d.offset).y=o.y,n.tooltip={textList:void 0!==t.textList?t.textList:s,offset:void 0!==t.offset?t.offset:c,option:t,index:u,group:r.group}}un.call(this,n.type,n,this.config,this.context)}if("mount"===this.opts.type){if((u=null==t.index?this.getCurrentDataIndex(e).index:t.index)>-1){n=Oo({},this.opts,{animation:!1});var l=Oo({},n._series_[u]),c=(s=[{text:t.formatter?t.formatter(l,void 0,u,n):l.name+": "+l.data,color:l.color,legendShape:"auto"==this.opts.extra.tooltip.legendShape?l.legendShape:this.opts.extra.tooltip.legendShape}],{x:n.chartData.calPoints[u].x,y:o.y});n.tooltip={textList:t.textList?t.textList:s,offset:void 0!==t.offset?t.offset:c,option:t,index:u}}un.call(this,n.type,n,this.config,this.context)}if("bar"===this.opts.type){r=this.getCurrentDataIndex(e);if((u=null==t.index?r.index:t.index)>-1||u.length>0)if(0!==(l=Xo(this.opts.series,u,r.group)).length){s=(d=Qo(l,this.opts,u,r.group,this.opts.categories,t)).textList;(c=d.offset).x=o.x,n.tooltip={textList:void 0!==t.textList?t.textList:s,offset:void 0!==t.offset?t.offset:c,option:t,index:u}}un.call(this,n.type,n,this.config,this.context)}if("mix"===this.opts.type){r=this.getCurrentDataIndex(e);if((u=null==t.index?r.index:t.index)>-1){a=this.scrollOption.currentOffset,n=Oo({},this.opts,{_scrollDistance_:a,animation:!1});if(0!==(l=Xo(this.opts.series,u)).length){var h=Zo(l,this.opts,u,this.opts.categories,t);s=h.textList;(c=h.offset).y=o.y,n.tooltip={textList:t.textList?t.textList:s,offset:void 0!==t.offset?t.offset:c,option:t,index:u}}}un.call(this,n.type,n,this.config,this.context)}if("candle"===this.opts.type){r=this.getCurrentDataIndex(e);if((u=null==t.index?r.index:t.index)>-1){a=this.scrollOption.currentOffset,n=Oo({},this.opts,{_scrollDistance_:a,animation:!1});if(0!==(l=Xo(this.opts.series,u)).length){var d;s=(d=ea(this.opts.series[0].data,l,this.opts,u,this.opts.categories,this.opts.extra.candle)).textList;(c=d.offset).y=o.y,n.tooltip={textList:t.textList?t.textList:s,offset:void 0!==t.offset?t.offset:c,option:t,index:u}}}un.call(this,n.type,n,this.config,this.context)}if("pie"===this.opts.type||"ring"===this.opts.type||"rose"===this.opts.type||"funnel"===this.opts.type){if((u=null==t.index?this.getCurrentDataIndex(e):t.index)>-1){n=Oo({},this.opts,{animation:!1}),l=Oo({},n._series_[u]),s=[{text:t.formatter?t.formatter(l,void 0,u,n):l.name+": "+l.data,color:l.color,legendShape:"auto"==this.opts.extra.tooltip.legendShape?l.legendShape:this.opts.extra.tooltip.legendShape}],c={x:o.x,y:o.y};n.tooltip={textList:t.textList?t.textList:s,offset:void 0!==t.offset?t.offset:c,option:t,index:u}}un.call(this,n.type,n,this.config,this.context)}if("map"===this.opts.type){if((u=null==t.index?this.getCurrentDataIndex(e):t.index)>-1){n=Oo({},this.opts,{animation:!1});(l=Oo({},this.opts.series[u])).name=l.properties.name;s=[{text:t.formatter?t.formatter(l,void 0,u,this.opts):l.name,color:l.color,legendShape:"auto"==this.opts.extra.tooltip.legendShape?l.legendShape:this.opts.extra.tooltip.legendShape}],c={x:o.x,y:o.y};n.tooltip={textList:t.textList?t.textList:s,offset:void 0!==t.offset?t.offset:c,option:t,index:u}}n.updateData=!1,un.call(this,n.type,n,this.config,this.context)}if("word"===this.opts.type){if((u=null==t.index?this.getCurrentDataIndex(e):t.index)>-1){n=Oo({},this.opts,{animation:!1}),l=Oo({},this.opts.series[u]),s=[{text:t.formatter?t.formatter(l,void 0,u,this.opts):l.name,color:l.color,legendShape:"auto"==this.opts.extra.tooltip.legendShape?l.legendShape:this.opts.extra.tooltip.legendShape}],c={x:o.x,y:o.y};n.tooltip={textList:t.textList?t.textList:s,offset:void 0!==t.offset?t.offset:c,option:t,index:u}}n.updateData=!1,un.call(this,n.type,n,this.config,this.context)}if("radar"===this.opts.type){var u;if((u=null==t.index?this.getCurrentDataIndex(e):t.index)>-1){n=Oo({},this.opts,{animation:!1});if(0!==(l=Xo(this.opts.series,u)).length){s=l.map((e=>({text:t.formatter?t.formatter(e,this.opts.categories[u],u,this.opts):e.name+": "+e.data,color:e.color,legendShape:"auto"==this.opts.extra.tooltip.legendShape?e.legendShape:this.opts.extra.tooltip.legendShape}))),c={x:o.x,y:o.y};n.tooltip={textList:t.textList?t.textList:s,offset:void 0!==t.offset?t.offset:c,option:t,index:u}}}un.call(this,n.type,n,this.config,this.context)}},gn.prototype.translate=function(e){this.scrollOption={currentOffset:e,startTouchX:e,distance:0,lastMoveTime:0};let t=Oo({},this.opts,{_scrollDistance_:e,animation:!1});un.call(this,this.opts.type,t,this.config,this.context)},gn.prototype.scrollStart=function(e){var t=null,i=Ko(t=e.changedTouches?e.changedTouches[0]:e.mp.changedTouches[0],this.opts,e);t&&!0===this.opts.enableScroll&&(this.scrollOption.startTouchX=i.x)},gn.prototype.scroll=function(e){0===this.scrollOption.lastMoveTime&&(this.scrollOption.lastMoveTime=Date.now());let t=this.opts.touchMoveLimit||60,i=Date.now();if(!(i-this.scrollOption.lastMoveTime<Math.floor(1e3/t))&&0!=this.scrollOption.startTouchX){this.scrollOption.lastMoveTime=i;var o=null;if((o=e.changedTouches?e.changedTouches[0]:e.mp.changedTouches[0])&&!0===this.opts.enableScroll){var a;a=Ko(o,this.opts,e).x-this.scrollOption.startTouchX;var n=this.scrollOption.currentOffset,r=zo(this,n+a,this.opts.chartData,this.config,this.opts);this.scrollOption.distance=a=r-n;var s=Oo({},this.opts,{_scrollDistance_:n+a,animation:!1});return this.opts=s,un.call(this,s.type,s,this.config,this.context),n+a}}},gn.prototype.scrollEnd=function(e){if(!0===this.opts.enableScroll){var t=this.scrollOption,i=t.currentOffset,o=t.distance;this.scrollOption.currentOffset=i+o,this.scrollOption.distance=0,this.scrollOption.moveCount=0}};const fn=["#1890FF","#91CB74","#FAC858","#EE6666","#73C0DE","#3CA272","#FC8452","#9A60B4","#ea7ccc"],xn={type:["pie","ring","rose","word","funnel","map","arcbar","line","column","mount","bar","area","radar","gauge","candle","mix","tline","tarea","scatter","bubble","demotype"],range:["饼状图","圆环图","玫瑰图","词云图","漏斗图","地图","圆弧进度条","折线图","柱状图","山峰图","条状图","区域图","雷达图","仪表盘","K线图","混合图","时间轴折线","时间轴区域","散点图","气泡图","自定义类型"],categories:["line","column","mount","bar","area","radar","gauge","candle","mix","demotype"],instance:{},option:{},formatter:{yAxisDemo1:function(e,t,i){return e+"元"},yAxisDemo2:function(e,t,i){return e.toFixed(2)},xAxisDemo1:function(e,t,i){return e+"年"},xAxisDemo2:function(e,t,i){return((e,t)=>{var i=new Date;i.setTime(1e3*e);var o=i.getFullYear(),a=i.getMonth()+1;a=a<10?"0"+a:a;var n=i.getDate();n=n<10?"0"+n:n;var r=i.getHours();r=r<10?"0"+r:r;var s=i.getMinutes(),l=i.getSeconds();return s=s<10?"0"+s:s,l=l<10?"0"+l:l,"full"==t?o+"-"+a+"-"+n+" "+r+":"+s+":"+l:"y-m-d"==t?o+"-"+a+"-"+n:"h:m"==t?r+":"+s:"h:m:s"==t?r+":"+s+":"+l:[o,a,n,r,s,l]})(e,"h:m")},seriesDemo1:function(e,t,i,o){return e+"元"},tooltipDemo1:function(e,t,i,o){return 0==i?"随便用"+e.data+"年":"其他我没改"+e.data+"天"},pieDemo:function(e,t,i,o){if(void 0!==t)return i[t].name+":"+i[t].data+"元"}},demotype:{type:"line",color:fn,padding:[15,10,0,15],xAxis:{disableGrid:!0},yAxis:{gridType:"dash",dashLength:2},legend:{},extra:{line:{type:"curve",width:2}}},pie:{type:"pie",color:fn,padding:[5,5,5,5],extra:{pie:{activeOpacity:.5,activeRadius:10,offsetAngle:0,labelWidth:15,border:!0,borderWidth:3,borderColor:"#FFFFFF"}}},ring:{type:"ring",color:fn,padding:[5,5,5,5],rotate:!1,dataLabel:!0,legend:{show:!0,position:"right",lineHeight:25},title:{name:"收益率",fontSize:15,color:"#666666"},subtitle:{name:"70%",fontSize:25,color:"#7cb5ec"},extra:{ring:{ringWidth:30,activeOpacity:.5,activeRadius:10,offsetAngle:0,labelWidth:15,border:!0,borderWidth:3,borderColor:"#FFFFFF"}}},rose:{type:"rose",color:fn,padding:[5,5,5,5],legend:{show:!0,position:"left",lineHeight:25},extra:{rose:{type:"area",minRadius:50,activeOpacity:.5,activeRadius:10,offsetAngle:0,labelWidth:15,border:!1,borderWidth:2,borderColor:"#FFFFFF"}}},word:{type:"word",color:fn,extra:{word:{type:"normal",autoColors:!1}}},funnel:{type:"funnel",color:fn,padding:[15,15,0,15],extra:{funnel:{activeOpacity:.3,activeWidth:10,border:!0,borderWidth:2,borderColor:"#FFFFFF",fillOpacity:1,labelAlign:"right"}}},map:{type:"map",color:fn,padding:[0,0,0,0],dataLabel:!0,extra:{map:{border:!0,borderWidth:1,borderColor:"#666666",fillOpacity:.6,activeBorderColor:"#F04864",activeFillColor:"#FACC14",activeFillOpacity:1}}},arcbar:{type:"arcbar",color:fn,title:{name:"百分比",fontSize:25,color:"#00FF00"},subtitle:{name:"默认标题",fontSize:15,color:"#666666"},extra:{arcbar:{type:"default",width:12,backgroundColor:"#E9E9E9",startAngle:.75,endAngle:.25,gap:2}}},line:{type:"line",color:fn,padding:[15,10,0,15],xAxis:{disableGrid:!0},yAxis:{gridType:"dash",dashLength:2},legend:{},extra:{line:{type:"straight",width:2,activeType:"hollow"}}},tline:{type:"line",color:fn,padding:[15,10,0,15],xAxis:{disableGrid:!1,boundaryGap:"justify"},yAxis:{gridType:"dash",dashLength:2,data:[{min:0,max:80}]},legend:{},extra:{line:{type:"curve",width:2,activeType:"hollow"}}},tarea:{type:"area",color:fn,padding:[15,10,0,15],xAxis:{disableGrid:!0,boundaryGap:"justify"},yAxis:{gridType:"dash",dashLength:2,data:[{min:0,max:80}]},legend:{},extra:{area:{type:"curve",opacity:.2,addLine:!0,width:2,gradient:!0,activeType:"hollow"}}},column:{type:"column",color:fn,padding:[15,15,0,5],xAxis:{disableGrid:!0},yAxis:{data:[{min:0}]},legend:{},extra:{column:{type:"group",width:30,activeBgColor:"#000000",activeBgOpacity:.08}}},mount:{type:"mount",color:fn,padding:[15,15,0,5],xAxis:{disableGrid:!0},yAxis:{data:[{min:0}]},legend:{},extra:{mount:{type:"mount",widthRatio:1.5}}},bar:{type:"bar",color:fn,padding:[15,30,0,5],xAxis:{boundaryGap:"justify",disableGrid:!1,min:0,axisLine:!1},yAxis:{},legend:{},extra:{bar:{type:"group",width:30,meterBorde:1,meterFillColor:"#FFFFFF",activeBgColor:"#000000",activeBgOpacity:.08}}},area:{type:"area",color:fn,padding:[15,15,0,15],xAxis:{disableGrid:!0},yAxis:{gridType:"dash",dashLength:2},legend:{},extra:{area:{type:"straight",opacity:.2,addLine:!0,width:2,gradient:!1,activeType:"hollow"}}},radar:{type:"radar",color:fn,padding:[5,5,5,5],dataLabel:!1,legend:{show:!0,position:"right",lineHeight:25},extra:{radar:{gridType:"radar",gridColor:"#CCCCCC",gridCount:3,opacity:.2,max:200,labelShow:!0}}},gauge:{type:"gauge",color:fn,title:{name:"66Km/H",fontSize:25,color:"#2fc25b",offsetY:50},subtitle:{name:"实时速度",fontSize:15,color:"#1890ff",offsetY:-50},extra:{gauge:{type:"default",width:30,labelColor:"#666666",startAngle:.75,endAngle:.25,startNumber:0,endNumber:100,labelFormat:"",splitLine:{fixRadius:0,splitNumber:10,width:30,color:"#FFFFFF",childNumber:5,childWidth:12},pointer:{width:24,color:"auto"}}}},candle:{type:"candle",color:fn,padding:[15,15,0,15],enableScroll:!0,enableMarkLine:!0,dataLabel:!1,xAxis:{labelCount:4,itemCount:40,disableGrid:!0,gridColor:"#CCCCCC",gridType:"solid",dashLength:4,scrollShow:!0,scrollAlign:"left",scrollColor:"#A6A6A6",scrollBackgroundColor:"#EFEBEF"},yAxis:{},legend:{},extra:{candle:{color:{upLine:"#f04864",upFill:"#f04864",downLine:"#2fc25b",downFill:"#2fc25b"},average:{show:!0,name:["MA5","MA10","MA30"],day:[5,10,20],color:["#1890ff","#2fc25b","#facc14"]}},markLine:{type:"dash",dashLength:5,data:[{value:2150,lineColor:"#f04864",showLabel:!0},{value:2350,lineColor:"#f04864",showLabel:!0}]}}},mix:{type:"mix",color:fn,padding:[15,15,0,15],xAxis:{disableGrid:!0},yAxis:{disabled:!1,disableGrid:!1,splitNumber:5,gridType:"dash",dashLength:4,gridColor:"#CCCCCC",padding:10,showTitle:!0,data:[]},legend:{},extra:{mix:{column:{width:20}}}},scatter:{type:"scatter",color:fn,padding:[15,15,0,15],dataLabel:!1,xAxis:{disableGrid:!1,gridType:"dash",splitNumber:5,boundaryGap:"justify",min:0},yAxis:{disableGrid:!1,gridType:"dash"},legend:{},extra:{scatter:{}}},bubble:{type:"bubble",color:fn,padding:[15,15,0,15],xAxis:{disableGrid:!1,gridType:"dash",splitNumber:5,boundaryGap:"justify",min:0,max:250},yAxis:{disableGrid:!1,gridType:"dash",data:[{min:0,max:150}]},legend:{},extra:{bubble:{border:2,opacity:.5}}}},yn=["#1890FF","#91CB74","#FAC858","#EE6666","#73C0DE","#3CA272","#FC8452","#9A60B4","#ea7ccc"],mn={type:["pie","ring","rose","funnel","line","column","area","radar","gauge","candle","demotype"],categories:["line","column","area","radar","gauge","candle","demotype"],instance:{},option:{},formatter:{tooltipDemo1:function(e){let t="";for(let i in e){0==i&&(t+=e[i].axisValueLabel+"年销售额");let o="--";null!==e[i].data&&(o=e[i].data),t+="\n"+e[i].seriesName+":"+o+" 万元"}return t},legendFormat:function(e){return"自定义图例+"+e},yAxisFormatDemo:function(e,t){return e+"元"},seriesFormatDemo:function(e){return e.name+"年"+e.value+"元"}},demotype:{color:yn},column:{color:yn,title:{text:""},tooltip:{trigger:"axis"},grid:{top:30,bottom:50,right:15,left:40},legend:{bottom:"left"},toolbox:{show:!1},xAxis:{type:"category",axisLabel:{color:"#666666"},axisLine:{lineStyle:{color:"#CCCCCC"}},boundaryGap:!0,data:[]},yAxis:{type:"value",axisTick:{show:!1},axisLabel:{color:"#666666"},axisLine:{lineStyle:{color:"#CCCCCC"}}},seriesTemplate:{name:"",type:"bar",data:[],barwidth:20,label:{show:!0,color:"#666666",position:"top"}}},line:{color:yn,title:{text:""},tooltip:{trigger:"axis"},grid:{top:30,bottom:50,right:15,left:40},legend:{bottom:"left"},toolbox:{show:!1},xAxis:{type:"category",axisLabel:{color:"#666666"},axisLine:{lineStyle:{color:"#CCCCCC"}},boundaryGap:!0,data:[]},yAxis:{type:"value",axisTick:{show:!1},axisLabel:{color:"#666666"},axisLine:{lineStyle:{color:"#CCCCCC"}}},seriesTemplate:{name:"",type:"line",data:[],barwidth:20,label:{show:!0,color:"#666666",position:"top"}}},area:{color:yn,title:{text:""},tooltip:{trigger:"axis"},grid:{top:30,bottom:50,right:15,left:40},legend:{bottom:"left"},toolbox:{show:!1},xAxis:{type:"category",axisLabel:{color:"#666666"},axisLine:{lineStyle:{color:"#CCCCCC"}},boundaryGap:!0,data:[]},yAxis:{type:"value",axisTick:{show:!1},axisLabel:{color:"#666666"},axisLine:{lineStyle:{color:"#CCCCCC"}}},seriesTemplate:{name:"",type:"line",data:[],areaStyle:{},label:{show:!0,color:"#666666",position:"top"}}},pie:{color:yn,title:{text:""},tooltip:{trigger:"item"},grid:{top:40,bottom:30,right:15,left:15},legend:{bottom:"left"},seriesTemplate:{name:"",type:"pie",data:[],radius:"50%",label:{show:!0,color:"#666666",position:"top"}}},ring:{color:yn,title:{text:""},tooltip:{trigger:"item"},grid:{top:40,bottom:30,right:15,left:15},legend:{bottom:"left"},seriesTemplate:{name:"",type:"pie",data:[],radius:["40%","70%"],avoidLabelOverlap:!1,label:{show:!0,color:"#666666",position:"top"},labelLine:{show:!0}}},rose:{color:yn,title:{text:""},tooltip:{trigger:"item"},legend:{top:"bottom"},seriesTemplate:{name:"",type:"pie",data:[],radius:"55%",center:["50%","50%"],roseType:"area"}},funnel:{color:yn,title:{text:""},tooltip:{trigger:"item",formatter:"{b} : {c}%"},legend:{top:"bottom"},seriesTemplate:{name:"",type:"funnel",left:"10%",top:60,bottom:60,width:"80%",min:0,max:100,minSize:"0%",maxSize:"100%",sort:"descending",gap:2,label:{show:!0,position:"inside"},labelLine:{length:10,lineStyle:{width:1,type:"solid"}},itemStyle:{bordercolor:"#fff",borderwidth:1},emphasis:{label:{fontSize:20}},data:[]}},gauge:{color:yn,tooltip:{formatter:"{a} <br/>{b} : {c}%"},seriesTemplate:{name:"业务指标",type:"gauge",detail:{formatter:"{value}%"},data:[{value:50,name:"完成率"}]}},candle:{xAxis:{data:[]},yAxis:{},color:yn,title:{text:""},dataZoom:[{type:"inside",xAxisIndex:[0,1],start:10,end:100},{show:!0,xAxisIndex:[0,1],type:"slider",bottom:10,start:10,end:100}],seriesTemplate:{name:"",type:"k",data:[]}}};var vn={},bn=null;function Sn(e={},...t){for(let i in t)for(let o in t[i])t[i].hasOwnProperty(o)&&(e[o]=t[i][o]&&"object"==typeof t[i][o]?Sn(Array.isArray(t[i][o])?[]:{},e[o],t[i][o]):t[i][o]);return e}function wn(e,t){for(let i in e)e.hasOwnProperty(i)&&null!==e[i]&&"object"==typeof e[i]?wn(e[i],t):"format"===i&&"string"==typeof e[i]&&(e.formatter=t[e[i]]?t[e[i]]:void 0);return e}const Tn={data:()=>({rid:null}),mounted(){bn={top:0,left:0};let e=document.querySelectorAll("uni-main")[0];void 0===e&&(e=document.querySelectorAll("uni-page-wrapper")[0]),bn={top:e.offsetTop,left:e.offsetLeft},setTimeout((()=>{null===this.rid&&this.$ownerInstance&&this.$ownerInstance.callMethod("getRenderType")}),200)},destroyed(){delete xn.option[this.rid],delete xn.instance[this.rid],delete mn.option[this.rid],delete mn.instance[this.rid]},methods:{ecinit(e,t,i,o){let a=JSON.stringify(e.id);this.rid=a,vn[a]=this.$ownerInstance||o;let n=JSON.parse(JSON.stringify(e)),r=n.type;r&&mn.type.includes(r)?mn.option[a]=Sn({},mn[r],n):mn.option[a]=Sn({},n);let s=n.chartData;if(s){mn.option[a].xAxis&&mn.option[a].xAxis.type&&"category"===mn.option[a].xAxis.type&&(mn.option[a].xAxis.data=s.categories),mn.option[a].yAxis&&mn.option[a].yAxis.type&&"category"===mn.option[a].yAxis.type&&(mn.option[a].yAxis.data=s.categories),mn.option[a].series=[];for(var l=0;l<s.series.length;l++){mn.option[a].seriesTemplate=mn.option[a].seriesTemplate?mn.option[a].seriesTemplate:{};let e=Sn({},mn.option[a].seriesTemplate,s.series[l]);mn.option[a].series.push(e)}}if("object"==typeof window.echarts)this.newEChart();else{const e=document.createElement("script"),t=window.location.origin,i=o.getDataset().directory;e.src=t+i+"uni_modules/qiun-data-charts/static/h5/echarts.min.js",e.onload=this.newEChart,document.head.appendChild(e)}},ecresize(e,t,i,o){mn.instance[this.rid]&&mn.instance[this.rid].resize()},newEChart(){let e=this.rid;void 0===mn.instance[e]?(mn.instance[e]=echarts.init(vn[e].$el.children[0]),!0===mn.option[e].ontap&&(mn.instance[e].on("click",(t=>{let i=JSON.parse(JSON.stringify({x:t.event.offsetX,y:t.event.offsetY}));vn[e].callMethod("emitMsg",{name:"getIndex",params:{type:"getIndex",event:i,currentIndex:t.dataIndex,value:t.data,seriesName:t.seriesName,id:e}})})),mn.instance[e].on("highlight",(t=>{vn[e].callMethod("emitMsg",{name:"getHighlight",params:{type:"highlight",res:t,id:e}})}))),this.updataEChart(e,mn.option[e])):this.updataEChart(e,mn.option[e])},updataEChart(e,t){if((t=wn(t,mn.formatter)).tooltip&&(t.tooltip.show=!!t.tooltipShow,t.tooltip.position=this.tooltipPosition(),"string"==typeof t.tooltipFormat&&mn.formatter[t.tooltipFormat]&&(t.tooltip.formatter=t.tooltip.formatter?t.tooltip.formatter:mn.formatter[t.tooltipFormat])),t.series)for(let i in t.series){let e=t.series[i].linearGradient;e&&(t.series[i].color=new echarts.graphic.LinearGradient(e[0],e[1],e[2],e[3],e[4]))}mn.instance[e].setOption(t,t.notMerge),mn.instance[e].on("finished",(function(){vn[e].callMethod("emitMsg",{name:"complete",params:{type:"complete",complete:!0,id:e}}),mn.instance[e]&&mn.instance[e].off("finished")})),void 0!==vn[e].$el.children[0].clientWidth&&(Math.abs(vn[e].$el.children[0].clientWidth-mn.instance[e].getWidth())>3||Math.abs(vn[e].$el.children[0].clientHeight-mn.instance[e].getHeight())>3)&&this.ecresize()},tooltipPosition:()=>(e,t,i,o,a)=>{let n=e[0],r=e[1],s=a.viewSize[0],l=a.viewSize[1],c=a.contentSize[0],h=a.contentSize[1],d=n+30,u=r+30;return d+c>s&&(d=n-c-30),u+h>l&&(u=r-h-30),[d,u]},ucinit(e,t,i,o){if(JSON.stringify(e)==JSON.stringify(t))return;if(!e.canvasId)return;let a=JSON.parse(JSON.stringify(e.canvasId));this.rid=a,vn[a]=this.$ownerInstance||o,xn.option[a]=JSON.parse(JSON.stringify(e)),xn.option[a]=wn(xn.option[a],xn.formatter);let n=document.getElementById(a);n&&n.children[0]&&(xn.option[a].context=n.children[0].getContext("2d"),xn.instance[a]&&xn.option[a]&&!0===xn.option[a].update?this.updataUChart():setTimeout((()=>{xn.option[a].context.restore(),xn.option[a].context.save(),this.newUChart()}),100))},newUChart(){let e=this.rid;xn.instance[e]=new gn(xn.option[e]),xn.instance[e].addEventListener("renderComplete",(()=>{vn[e].callMethod("emitMsg",{name:"complete",params:{type:"complete",complete:!0,id:e,opts:xn.instance[e].opts}}),xn.instance[e].delEventListener("renderComplete")})),xn.instance[e].addEventListener("scrollLeft",(()=>{vn[e].callMethod("emitMsg",{name:"scrollLeft",params:{type:"scrollLeft",scrollLeft:!0,id:e,opts:xn.instance[e].opts}})})),xn.instance[e].addEventListener("scrollRight",(()=>{vn[e].callMethod("emitMsg",{name:"scrollRight",params:{type:"scrollRight",scrollRight:!0,id:e,opts:xn.instance[e].opts}})}))},updataUChart(){let e=this.rid;xn.instance[e].updateData(xn.option[e])},tooltipDefault(e,t,i,o){if(t){let i=e.data;return"object"==typeof e.data&&(i=e.data.value),t+" "+e.name+":"+i}return e.properties&&e.properties.name?e.properties.name:e.name+":"+e.data},showTooltip(e,t){let i=xn.option[t].tooltipCustom;if(i&&null!=i){let o;i.x>=0&&i.y>=0&&(o={x:i.x,y:i.y+10}),xn.instance[t].showToolTip(e,{index:i.index,offset:o,textList:i.textList,formatter:(e,i,o,a)=>"string"==typeof xn.option[t].tooltipFormat&&xn.formatter[xn.option[t].tooltipFormat]?xn.formatter[xn.option[t].tooltipFormat](e,i,o,a):this.tooltipDefault(e,i,o,a)})}else xn.instance[t].showToolTip(e,{formatter:(e,i,o,a)=>"string"==typeof xn.option[t].tooltipFormat&&xn.formatter[xn.option[t].tooltipFormat]?xn.formatter[xn.option[t].tooltipFormat](e,i,o,a):this.tooltipDefault(e,i,o,a)})},tap(e){let t=this.rid,i=xn.option[t].ontap,o=xn.option[t].tooltipShow,a=xn.option[t].tapLegend;if(0==i)return;let n=null,r=null,s=document.getElementById("UC"+t).getBoundingClientRect(),l={};l=e.detail.x?{x:e.detail.x-s.left,y:e.detail.y-s.top+bn.top}:{x:e.clientX-s.left,y:e.clientY-s.top+bn.top},e.changedTouches=[],e.changedTouches.unshift(l),n=xn.instance[t].getCurrentDataIndex(e),r=xn.instance[t].getLegendDataIndex(e),!0===a&&xn.instance[t].touchLegend(e),1==o&&this.showTooltip(e,t),vn[t].callMethod("emitMsg",{name:"getIndex",params:{type:"getIndex",event:l,currentIndex:n,legendIndex:r,id:t,opts:xn.instance[t].opts}})},touchStart(e){let t=this.rid;0!=xn.option[t].ontouch&&(!0===xn.option[t].enableScroll&&1==e.touches.length&&xn.instance[t].scrollStart(e),vn[t].callMethod("emitMsg",{name:"getTouchStart",params:{type:"touchStart",event:e.changedTouches[0],id:t,opts:xn.instance[t].opts}}))},touchMove(e){let t=this.rid,i=xn.option[t].ontouch;if(0!=i){if(!0===xn.option[t].enableScroll&&1==e.changedTouches.length&&xn.instance[t].scroll(e),!0===xn.option[t].ontap&&!1===xn.option[t].enableScroll&&!0===xn.option[t].onmovetip){let i=document.getElementById("UC"+t).getBoundingClientRect(),o={x:e.changedTouches[0].clientX-i.left,y:e.changedTouches[0].clientY-i.top+bn.top};e.changedTouches.unshift(o),!0===xn.option[t].tooltipShow&&this.showTooltip(e,t)}!0===i&&!0===xn.option[t].enableScroll&&!0===xn.option[t].onzoom&&2==e.changedTouches.length&&xn.instance[t].dobuleZoom(e),vn[t].callMethod("emitMsg",{name:"getTouchMove",params:{type:"touchMove",event:e.changedTouches[0],id:t,opts:xn.instance[t].opts}})}},touchEnd(e){let t=this.rid;0!=xn.option[t].ontouch&&(!0===xn.option[t].enableScroll&&0==e.touches.length&&xn.instance[t].scrollEnd(e),vn[t].callMethod("emitMsg",{name:"getTouchEnd",params:{type:"touchEnd",event:e.changedTouches[0],id:t,opts:xn.instance[t].opts}}))},mouseDown(e){let t=this.rid;if(0==xn.option[t].onmouse)return;let i=document.getElementById("UC"+t).getBoundingClientRect(),o={};o={x:e.clientX-i.left,y:e.clientY-i.top+bn.top},e.changedTouches=[],e.changedTouches.unshift(o),xn.instance[t].scrollStart(e),xn.option[t].mousedown=!0,vn[t].callMethod("emitMsg",{name:"getTouchStart",params:{type:"mouseDown",event:o,id:t,opts:xn.instance[t].opts}})},mouseMove(e){let t=this.rid,i=xn.option[t].onmouse,o=xn.option[t].tooltipShow;if(0==i)return;let a=document.getElementById("UC"+t).getBoundingClientRect(),n={};n={x:e.clientX-a.left,y:e.clientY-a.top+bn.top},e.changedTouches=[],e.changedTouches.unshift(n),xn.option[t].mousedown?(xn.instance[t].scroll(e),vn[t].callMethod("emitMsg",{name:"getTouchMove",params:{type:"mouseMove",event:n,id:t,opts:xn.instance[t].opts}})):xn.instance[t]&&1==o&&this.showTooltip(e,t)},mouseUp(e){let t=this.rid;if(0==xn.option[t].onmouse)return;let i=document.getElementById("UC"+t).getBoundingClientRect(),o={};o={x:e.clientX-i.left,y:e.clientY-i.top+bn.top},e.changedTouches=[],e.changedTouches.unshift(o),xn.instance[t].scrollEnd(e),xn.option[t].mousedown=!1,vn[t].callMethod("emitMsg",{name:"getTouchEnd",params:{type:"mouseUp",event:o,id:t,opts:xn.instance[t].opts}})}}},An=e=>{e.$renderjs||(e.$renderjs=[]),e.$renderjs.push("rdcharts"),e.mixins||(e.mixins=[]),e.mixins.push({beforeCreate(){this.rdcharts=this},mounted(){this.$ownerInstance=this.$gcd(this,!0)}}),e.mixins.push(Tn)};function _n(e={},...t){for(let i in t)for(let o in t[i])t[i].hasOwnProperty(o)&&(e[o]=t[i][o]&&"object"==typeof t[i][o]?_n(Array.isArray(t[i][o])?[]:{},e[o],t[i][o]):t[i][o]);return e}function Pn(e,t){for(let i in e)e.hasOwnProperty(i)&&null!==e[i]&&"object"==typeof e[i]?Pn(e[i],t):"format"===i&&"string"==typeof e[i]&&(e.formatter=t[e[i]]?t[e[i]]:void 0);return e}const Cn={name:"qiun-data-charts",mixins:[Lo.mixinDatacom],props:{type:{type:String,default:null},canvasId:{type:String,default:"uchartsid"},canvas2d:{type:Boolean,default:!1},background:{type:String,default:"rgba(0,0,0,0)"},animation:{type:Boolean,default:!0},chartData:{type:Object,default:()=>({categories:[],series:[]})},opts:{type:Object,default:()=>({})},eopts:{type:Object,default:()=>({})},loadingType:{type:Number,default:2},errorShow:{type:Boolean,default:!0},errorReload:{type:Boolean,default:!0},errorMessage:{type:String,default:null},inScrollView:{type:Boolean,default:!1},reshow:{type:Boolean,default:!1},reload:{type:Boolean,default:!1},disableScroll:{type:Boolean,default:!1},optsWatch:{type:Boolean,default:!0},onzoom:{type:Boolean,default:!1},ontap:{type:Boolean,default:!0},ontouch:{type:Boolean,default:!1},onmouse:{type:Boolean,default:!0},onmovetip:{type:Boolean,default:!1},echartsH5:{type:Boolean,default:!1},echartsApp:{type:Boolean,default:!1},tooltipShow:{type:Boolean,default:!0},tooltipFormat:{type:String,default:void 0},tooltipCustom:{type:Object,default:void 0},startDate:{type:String,default:void 0},endDate:{type:String,default:void 0},textEnum:{type:Array,default:()=>[]},groupEnum:{type:Array,default:()=>[]},pageScrollTop:{type:Number,default:0},directory:{type:String,default:"/"},tapLegend:{type:Boolean,default:!0},menus:{type:Array,default:()=>[]}},data:()=>({cid:"uchartsid",inWx:!1,inAli:!1,inTt:!1,inBd:!1,inH5:!1,inApp:!1,inWin:!1,type2d:!0,disScroll:!1,openmouse:!1,pixel:1,cWidth:375,cHeight:250,showchart:!1,echarts:!1,echartsResize:{state:!1},uchartsOpts:{},echartsOpts:{},drawData:{},lastDrawTime:null}),created(){if(this.cid=this.canvasId,"uchartsid"==this.canvasId||""==this.canvasId){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",t=e.length,i="";for(let o=0;o<32;o++)i+=e.charAt(Math.floor(Math.random()*t));this.cid=i}const e=m();"windows"!==e.platform&&"mac"!==e.platform||(this.inWin=!0),this.type2d=!1,this.disScroll=this.disableScroll},mounted(){this.inH5=!0,!0===this.inWin&&(this.openmouse=this.onmouse),!0===this.echartsH5&&(this.echarts=!0),this.$nextTick((()=>{this.beforeInit()}));const e=this.inH5?500:200,t=this;R(function(e,t){let i=!1;return function(){clearTimeout(i),i&&clearTimeout(i),i=setTimeout((()=>{i=!1,e.apply(this,arguments)}),t)}}((function(e){if(1==t.mixinDatacomLoading)return;let i=t.mixinDatacomErrorMessage;null!==i&&"null"!==i&&""!==i||(t.echarts?t.echartsResize.state=!t.echartsResize.state:t.resizeHandler())}),e))},destroyed(){!0===this.echarts?(delete mn.option[this.cid],delete mn.instance[this.cid]):(delete xn.option[this.cid],delete xn.instance[this.cid]),N((()=>{}))},watch:{chartDataProps:{handler(e,t){"object"==typeof e?JSON.stringify(e)!==JSON.stringify(t)&&(this._clearChart(),e.series&&e.series.length>0?this.beforeInit():(this.mixinDatacomLoading=!0,this.showchart=!1,this.mixinDatacomErrorMessage=null)):(this.mixinDatacomLoading=!1,this._clearChart(),this.showchart=!1,this.mixinDatacomErrorMessage="参数错误:chartData数据类型错误")},immediate:!1,deep:!0},localdata:{handler(e,t){JSON.stringify(e)!==JSON.stringify(t)&&(e.length>0?this.beforeInit():(this.mixinDatacomLoading=!0,this._clearChart(),this.showchart=!1,this.mixinDatacomErrorMessage=null))},immediate:!1,deep:!0},optsProps:{handler(e,t){"object"==typeof e?JSON.stringify(e)!==JSON.stringify(t)&&!1===this.echarts&&1==this.optsWatch&&this.checkData(this.drawData):(this.mixinDatacomLoading=!1,this._clearChart(),this.showchart=!1,this.mixinDatacomErrorMessage="参数错误:opts数据类型错误")},immediate:!1,deep:!0},eoptsProps:{handler(e,t){"object"==typeof e?JSON.stringify(e)!==JSON.stringify(t)&&!0===this.echarts&&this.checkData(this.drawData):(this.mixinDatacomLoading=!1,this.showchart=!1,this.mixinDatacomErrorMessage="参数错误:eopts数据类型错误")},immediate:!1,deep:!0},reshow(e,t){!0===e&&!1===this.mixinDatacomLoading&&setTimeout((()=>{this.mixinDatacomErrorMessage=null,this.echartsResize.state=!this.echartsResize.state,this.checkData(this.drawData)}),200)},reload(e,t){!0===e&&(this.showchart=!1,this.mixinDatacomErrorMessage=null,this.reloading())},mixinDatacomErrorMessage(e,t){e&&(this.emitMsg({name:"error",params:{type:"error",errorShow:this.errorShow,msg:e,id:this.cid}}),this.errorShow&&console.log("[秋云图表组件]"+e))},errorMessage(e,t){e&&this.errorShow&&null!==e&&"null"!==e&&""!==e?(this.showchart=!1,this.mixinDatacomLoading=!1,this.mixinDatacomErrorMessage=e):(this.showchart=!1,this.mixinDatacomErrorMessage=null,this.reloading())}},computed:{optsProps(){return JSON.parse(JSON.stringify(this.opts))},eoptsProps(){return JSON.parse(JSON.stringify(this.eopts))},chartDataProps(){return JSON.parse(JSON.stringify(this.chartData))}},methods:{beforeInit(){this.mixinDatacomErrorMessage=null,"object"==typeof this.chartData&&null!=this.chartData&&void 0!==this.chartData.series&&this.chartData.series.length>0?(this.drawData=_n({},this.chartData),this.mixinDatacomLoading=!1,this.showchart=!0,this.checkData(this.chartData)):this.localdata.length>0?(this.mixinDatacomLoading=!1,this.showchart=!0,this.localdataInit(this.localdata)):""!==this.collection?(this.mixinDatacomLoading=!1,this.getCloudData()):this.mixinDatacomLoading=!0},localdataInit(e){if(this.groupEnum.length>0)for(let h=0;h<e.length;h++)for(let t=0;t<this.groupEnum.length;t++)e[h].group===this.groupEnum[t].value&&(e[h].group=this.groupEnum[t].text);if(this.textEnum.length>0)for(let h=0;h<e.length;h++)for(let t=0;t<this.textEnum.length;t++)e[h].text===this.textEnum[t].value&&(e[h].text=this.textEnum[t].text);let t=!1,i={categories:[],series:[]},o=[],a=[];if(t=!0===this.echarts?mn.categories.includes(this.type):xn.categories.includes(this.type),!0===t){if(this.chartData&&this.chartData.categories&&this.chartData.categories.length>0)o=this.chartData.categories;else if(this.startDate&&this.endDate){let e=new Date(this.startDate),t=new Date(this.endDate);for(;e<=t;)o.push((r=void 0,s=void 0,l=void 0,r=(n=e).getFullYear(),s=n.getMonth()+1,l=n.getDate(),s>=1&&s<=9&&(s="0"+s),l>=0&&l<=9&&(l="0"+l),r+"-"+s+"-"+l)),e=e.setDate(e.getDate()+1),e=new Date(e)}else{let t={};e.map((function(e,i){null==e.text||t[e.text]||(o.push(e.text),t[e.text]=!0)}))}i.categories=o}var n,r,s,l;let c={};if(e.map((function(e,t){null==e.group||c[e.group]||(a.push({name:e.group,data:[]}),c[e.group]=!0)})),0==a.length)if(a=[{name:"默认分组",data:[]}],!0===t)for(let h=0;h<o.length;h++){let t=0;for(let i=0;i<e.length;i++)e[i].text==o[h]&&(t=e[i].value);a[0].data.push(t)}else for(let h=0;h<e.length;h++)a[0].data.push({name:e[h].text,value:e[h].value});else for(let h=0;h<a.length;h++)if(o.length>0)for(let t=0;t<o.length;t++){let i=0;for(let n=0;n<e.length;n++)a[h].name==e[n].group&&e[n].text==o[t]&&(i=e[n].value);a[h].data.push(i)}else for(let t=0;t<e.length;t++)a[h].name==e[t].group&&a[h].data.push(e[t].value);i.series=a,this.drawData=_n({},i),this.checkData(i)},reloading(){!1!==this.errorReload&&(this.showchart=!1,this.mixinDatacomErrorMessage=null,""!==this.collection?(this.mixinDatacomLoading=!1,this.onMixinDatacomPropsChange(!0)):this.beforeInit())},checkData(e){let t=this.cid;!0===this.echarts?(mn.option[t]=_n({},this.eopts),mn.option[t].id=t,mn.option[t].type=this.type):this.type&&xn.type.includes(this.type)?(xn.option[t]=_n({},xn[this.type],this.opts),xn.option[t].canvasId=t):(this.mixinDatacomLoading=!1,this.showchart=!1,this.mixinDatacomErrorMessage="参数错误:props参数中type类型不正确");let i=_n({},e);void 0!==i.series&&i.series.length>0&&(this.mixinDatacomErrorMessage=null,!0===this.echarts?(mn.option[t].chartData=i,this.$nextTick((()=>{this.init()}))):(xn.option[t].categories=i.categories,xn.option[t].series=i.series,this.$nextTick((()=>{this.init()}))))},resizeHandler(){let e=Date.now();e-(this.lastDrawTime?this.lastDrawTime:e-3e3)<1e3||z().in(this).select("#ChartBoxId"+this.cid).boundingClientRect((e=>{this.showchart=!0,e.width>0&&e.height>0&&(e.width===this.cWidth&&e.height===this.cHeight||this.checkData(this.drawData))})).exec()},getCloudData(){1!=this.mixinDatacomLoading&&(this.mixinDatacomLoading=!0,this.mixinDatacomGet().then((e=>{this.mixinDatacomResData=e.result.data,this.localdataInit(this.mixinDatacomResData)})).catch((e=>{this.mixinDatacomLoading=!1,this.showchart=!1,this.mixinDatacomErrorMessage="请求错误:"+e})))},onMixinDatacomPropsChange(e,t){1==e&&""!==this.collection&&(this.showchart=!1,this.mixinDatacomErrorMessage=null,this._clearChart(),this.getCloudData())},_clearChart(){let e=this.cid;if(!0!==this.echarts&&xn.option[e]&&xn.option[e].context){const t=xn.option[e].context;"object"!=typeof t||xn.option[e].update||(t.clearRect(0,0,this.cWidth*this.pixel,this.cHeight*this.pixel),t.draw())}},init(){let e=this.cid;z().in(this).select("#ChartBoxId"+e).boundingClientRect((t=>{t.width>0&&t.height>0?(this.mixinDatacomLoading=!1,this.showchart=!0,this.lastDrawTime=Date.now(),this.cWidth=t.width,this.cHeight=t.height,!0!==this.echarts&&(xn.option[e].background="rgba(0,0,0,0)"==this.background?"#FFFFFF":this.background,xn.option[e].canvas2d=this.type2d,xn.option[e].pixelRatio=this.pixel,xn.option[e].animation=this.animation,xn.option[e].width=t.width*this.pixel,xn.option[e].height=t.height*this.pixel,xn.option[e].onzoom=this.onzoom,xn.option[e].ontap=this.ontap,xn.option[e].ontouch=this.ontouch,xn.option[e].onmouse=this.openmouse,xn.option[e].onmovetip=this.onmovetip,xn.option[e].tooltipShow=this.tooltipShow,xn.option[e].tooltipFormat=this.tooltipFormat,xn.option[e].tooltipCustom=this.tooltipCustom,xn.option[e].inScrollView=this.inScrollView,xn.option[e].lastDrawTime=this.lastDrawTime,xn.option[e].tapLegend=this.tapLegend),this.inH5||this.inApp?1==this.echarts?(mn.option[e].ontap=this.ontap,mn.option[e].onmouse=this.openmouse,mn.option[e].tooltipShow=this.tooltipShow,mn.option[e].tooltipFormat=this.tooltipFormat,mn.option[e].tooltipCustom=this.tooltipCustom,mn.option[e].lastDrawTime=this.lastDrawTime,this.echartsOpts=_n({},mn.option[e])):(xn.option[e].rotateLock=xn.option[e].rotate,this.uchartsOpts=_n({},xn.option[e])):(xn.option[e]=Pn(xn.option[e],xn.formatter),this.mixinDatacomErrorMessage=null,this.mixinDatacomLoading=!1,this.showchart=!0,this.$nextTick((()=>{if(!0===this.type2d){z().in(this).select("#"+e).fields({node:!0,size:!0}).exec((i=>{if(i[0]){const o=i[0].node,a=o.getContext("2d");xn.option[e].context=a,xn.option[e].rotateLock=xn.option[e].rotate,xn.instance[e]&&xn.option[e]&&!0===xn.option[e].update?this._updataUChart(e):(o.width=t.width*this.pixel,o.height=t.height*this.pixel,o._width=t.width*this.pixel,o._height=t.height*this.pixel,setTimeout((()=>{xn.option[e].context.restore(),xn.option[e].context.save(),this._newChart(e)}),100))}else this.showchart=!1,this.mixinDatacomErrorMessage="参数错误:开启2d模式后,未获取到dom节点,canvas-id:"+e}))}else this.inAli&&(xn.option[e].rotateLock=xn.option[e].rotate),xn.option[e].context=B(e,this),xn.instance[e]&&xn.option[e]&&!0===xn.option[e].update?this._updataUChart(e):setTimeout((()=>{xn.option[e].context.restore(),xn.option[e].context.save(),this._newChart(e)}),100)})))):(this.mixinDatacomLoading=!1,this.showchart=!1,1==this.reshow&&(this.mixinDatacomErrorMessage="布局错误:未获取到父元素宽高尺寸!canvas-id:"+e))})).exec()},saveImage(){U({canvasId:this.cid,success:e=>{var t=document.createElement("a");t.href=e.tempFilePath,t.download=this.cid,t.target="_blank",t.click()}},this)},getImage(){if(0==this.type2d)U({canvasId:this.cid,success:e=>{this.emitMsg({name:"getImage",params:{type:"getImage",base64:e.tempFilePath}})}},this);else{z().in(this).select("#"+this.cid).fields({node:!0,size:!0}).exec((e=>{if(e[0]){const t=e[0].node;this.emitMsg({name:"getImage",params:{type:"getImage",base64:t.toDataURL("image/png")}})}}))}},_error(e){this.mixinDatacomErrorMessage=e.detail.errMsg},emitMsg(e){this.$emit(e.name,e.params)},getRenderType(){!0===this.echarts&&!1===this.mixinDatacomLoading&&this.beforeInit()},toJSON(){return this}}};An(Cn);const kn=G(Cn,[["render",function(e,t,i,o,a,n){const r=J(W("qiun-loading"),Io),s=I,l=J(W("qiun-error"),Mo),c=H;return C(),k(s,{class:"chartsview",id:"ChartBoxId"+a.cid},{default:D((()=>[e.mixinDatacomLoading?(C(),k(s,{key:0},{default:D((()=>[L(r,{loadingType:i.loadingType},null,8,["loadingType"])])),_:1})):F("",!0),e.mixinDatacomErrorMessage&&i.errorShow?(C(),k(s,{key:1,onClick:n.reloading},{default:D((()=>[L(l,{errorMessage:i.errorMessage},null,8,["errorMessage"])])),_:1},8,["onClick"])):F("",!0),a.echarts?j((C(),k(s,{key:2,style:q([{background:i.background},{width:"100%",height:"100%"}]),"data-directory":i.directory,id:"EC"+a.cid,prop:a.echartsOpts,"change:prop":e.rdcharts.ecinit,resize:a.echartsResize,"change:resize":e.rdcharts.ecresize},null,8,["style","data-directory","id","prop","change:prop","resize","change:resize"])),[[$,a.showchart]]):(C(),k(s,{key:3,onClick:e.rdcharts.tap,onMousemove:e.rdcharts.mouseMove,onMousedown:e.rdcharts.mouseDown,onMouseup:e.rdcharts.mouseUp,onTouchstart:e.rdcharts.touchStart,onTouchmove:e.rdcharts.touchMove,onTouchend:e.rdcharts.touchEnd,id:"UC"+a.cid,prop:a.uchartsOpts,"change:prop":e.rdcharts.ucinit},{default:D((()=>[j(L(c,{id:a.cid,canvasId:a.cid,style:q({width:a.cWidth+"px",height:a.cHeight+"px",background:i.background}),"disable-scroll":i.disableScroll,onError:n._error},null,8,["id","canvasId","style","disable-scroll","onError"]),[[$,a.showchart]])])),_:1},8,["onClick","onMousemove","onMousedown","onMouseup","onTouchstart","onTouchmove","onTouchend","id","prop","change:prop"]))])),_:1},8,["id"])}],["__scopeId","data-v-d3533eac"]]);export{kn as _};
|